From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45B4EC433E0 for ; Thu, 4 Feb 2021 14:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 195C964F51 for ; Thu, 4 Feb 2021 14:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236538AbhBDOH6 (ORCPT ); Thu, 4 Feb 2021 09:07:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236596AbhBDOGB (ORCPT ); Thu, 4 Feb 2021 09:06:01 -0500 Received: from orbyte.nwl.cc (orbyte.nwl.cc [IPv6:2001:41d0:e:133a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B87EEC06178C for ; Thu, 4 Feb 2021 06:04:53 -0800 (PST) Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.94) (envelope-from ) id 1l7fFa-0005wj-O9; Thu, 04 Feb 2021 15:04:50 +0100 Date: Thu, 4 Feb 2021 15:04:50 +0100 From: Phil Sutter To: Jamal Hadi Salim Cc: Stephen Hemminger , netdev@vger.kernel.org Subject: Re: [iproute PATCH] tc: u32: Fix key folding in sample option Message-ID: <20210204140450.GS3158@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Jamal Hadi Salim , Stephen Hemminger , netdev@vger.kernel.org References: <20210202183051.21022-1-phil@nwl.cc> <6948a2a9-1ed2-ce8d-daeb-601c425e1258@mojatatu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6948a2a9-1ed2-ce8d-daeb-601c425e1258@mojatatu.com> Sender: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Jamal, On Thu, Feb 04, 2021 at 08:19:55AM -0500, Jamal Hadi Salim wrote: > I couldnt tell by inspection if what used to work before continues to. > In particular the kernel version does consider the divisor when folding. That's correct. And so does tc. What's the matter? > Two examples that currently work, if you can try them: Both lack information about the used hashkey and divisor. > Most used scheme: > --- > tc filter add dev $DEV parent 999:0 protocol ip prio 10 u32 \ > ht 2:: \ > sample ip protocol 1 0xff match ip src 1.2.3.4/32 flowid 1:10 \ > action ok > ---- htid before: 0x201000 htid after: 0x201000 > > and this i also found in one of my scripts: > ---- > tc filter add dev $DEV parent 999:0 protocol ip prio 10 u32 \ > ht 2:: \ > sample u32 0x00000806 0x0000ffff at 12 \ > match u32 0x00000800 0x0000ff00 at 12 flowid 1:10 \ > action ok > ---- htid before: 0x20e000 (0x8 ^ 0x6 = 0xe) htid after: 0x206000 Are you sure this still works with current kernel and iproute2 (excluding my patch)? What divisor and hashkey is used? > Probably a simple meaning of "working" is: > the values before and after (your changes) are consistent. > > If also you will do us a kindness and add maybe a testcase in tdc? > This way next person wanting to fix it can run the tests first before > posting a patch. What is "tdc"? Cheers, Phil