Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Phil Sutter <phil@nwl.cc>,
	Stephen Hemminger <stephen@networkplumber.org>,
	netdev@vger.kernel.org
Subject: Re: [iproute PATCH] tc: u32: Fix key folding in sample option
Date: Thu, 4 Feb 2021 10:28:26 -0500	[thread overview]
Message-ID: <7d5e31b1-0348-e617-0d3e-5acee7796361@mojatatu.com> (raw)
In-Reply-To: <20210204145006.GT3158@orbyte.nwl.cc>

On 2021-02-04 9:50 a.m., Phil Sutter wrote:
> On Thu, Feb 04, 2021 at 09:34:01AM -0500, Jamal Hadi Salim wrote:
>> On 2021-02-04 9:04 a.m., Phil Sutter wrote:
>>> 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?
>>>
>>
>> tc assumes 256 when undefined. Maybe man page needs to be
>> updated to state we need divisor specified otherwise default
>> is 256.
> 
> tc-u32.8 mentions the default in 'sample' option description. Specifying
> divisor is mandatory when creating a hash table, so that path is
> covered, too. I still don't get how this is related to my patch, though.
> 

It is a general comment related to this code (that you are modifying).
You mentioned divisor in your earlier email as part of the syntax for
sample. So it made me wonder:
Does the bucket placement assume a specific number of buckets in a
table? Example if i had a hash table with 4 buckets, would the sample
then pick the correct bucket? Would it be also correct for 32 buckets,
etc. Or it didnt matter before and it doesnt matter now.

>>>> 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
>>>
>>
>> Ok, this is the most common use-case. So we are good.
> 
> Whatever.

Meaning?


cheers,
jamal

  reply	other threads:[~2021-02-04 15:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 18:30 Phil Sutter
2021-02-04 13:19 ` Jamal Hadi Salim
2021-02-04 14:04   ` Phil Sutter
2021-02-04 14:34     ` Jamal Hadi Salim
2021-02-04 14:36       ` Jamal Hadi Salim
2021-02-04 14:50       ` Phil Sutter
2021-02-04 15:28         ` Jamal Hadi Salim [this message]
2021-02-04 16:50           ` Phil Sutter
2021-02-04 18:08             ` Jamal Hadi Salim
2021-07-05 14:17 ` Phil Sutter
2021-07-05 17:25   ` Jamal Hadi Salim
2021-08-03 16:42     ` Phil Sutter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7d5e31b1-0348-e617-0d3e-5acee7796361@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=phil@nwl.cc \
    --cc=stephen@networkplumber.org \
    --subject='Re: [iproute PATCH] tc: u32: Fix key folding in sample option' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).