All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: "David Ahern" <dsahern@gmail.com>,
	"Asbjørn Sloth Tønnesen" <asbjorn@asbjorn.st>,
	netdev@vger.kernel.org, "Cong Wang" <xiyou.wangcong@gmail.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH iproute2 v3 2/2] tc: pedit: add decrement operation
Date: Thu, 24 Jun 2021 16:24:17 -0400	[thread overview]
Message-ID: <74b620dd-3552-b20d-ba5c-b681e7eabca7@mojatatu.com> (raw)
In-Reply-To: <7b5d610b-0fd6-d466-cd6d-bb2725397cdd@gmail.com>

Hi Asbjørn,


On 2021-06-22 11:39 a.m., David Ahern wrote:
> [ looks fine to me; adding tc folks to make sure they see it ]
> 
> On 6/18/21 10:06 AM, Asbjørn Sloth Tønnesen wrote:
>> Implement a decrement operation for ttl and hoplimit.
>>
>> Since this is just syntactic sugar, it goes that:
>>
>>    tc filter add ... action pedit ex munge ip ttl dec ...
>>    tc filter add ... action pedit ex munge ip6 hoplimit dec ...
>>
>> is just a more readable version of this:
>>
>>    tc filter add ... action pedit ex munge ip ttl add 0xff ...
>>    tc filter add ... action pedit ex munge ip6 hoplimit add 0xff ...
>>

So you "add" essentially one's complement of the value you are trying to
decrement with?

>> This feature was suggested by some pseudo tc examples in Mellanox's
>> documentation[1], but wasn't present in neither their mlnx-iproute2
>> nor iproute2.
>>
>> Tested with skip_sw on Mellanox ConnectX-6 Dx.
>>
>> [1] https://docs.mellanox.com/pages/viewpage.action?pageId=47033989


I didnt see an example which showed using "dec" but what you described
above makes sense. And the changes below look sane. So:

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

  reply	other threads:[~2021-06-24 20:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 16:06 [PATCH iproute2 1/2] tc: pedit: parse_cmd: add flags argument Asbjørn Sloth Tønnesen
2021-06-18 16:06 ` [PATCH iproute2 v3 2/2] tc: pedit: add decrement operation Asbjørn Sloth Tønnesen
2021-06-22 15:39   ` David Ahern
2021-06-24 20:24     ` Jamal Hadi Salim [this message]
2021-06-25 19:21       ` Asbjørn Sloth Tønnesen
2021-06-26  4:45   ` David Ahern

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=74b620dd-3552-b20d-ba5c-b681e7eabca7@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=asbjorn@asbjorn.st \
    --cc=dsahern@gmail.com \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=xiyou.wangcong@gmail.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.