From: Petr Machata <petrm@mellanox.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH iproute2-next 1/3] tc: p_ip6: Support pedit of IPv6 dsfield
Date: Mon, 30 Mar 2020 10:32:13 +0200 [thread overview]
Message-ID: <87eetafdki.fsf@mellanox.com> (raw)
In-Reply-To: <20200327175123.1930e099@hermes.lan>
Stephen Hemminger <stephen@networkplumber.org> writes:
>> diff --git a/tc/p_ip6.c b/tc/p_ip6.c
>> index 7cc7997b..b6fe81f5 100644
>> --- a/tc/p_ip6.c
>> +++ b/tc/p_ip6.c
>> @@ -56,6 +56,22 @@ parse_ip6(int *argc_p, char ***argv_p,
>> res = parse_cmd(&argc, &argv, 4, TU32, 0x0007ffff, sel, tkey);
>> goto done;
>> }
>> + if (strcmp(*argv, "traffic_class") == 0 ||
>> + strcmp(*argv, "tos") == 0 ||
>> + strcmp(*argv, "dsfield") == 0) {
>> + NEXT_ARG();
>> + tkey->off = 1;
>> + res = parse_cmd(&argc, &argv, 1, TU32, RU8, sel, tkey);
>> +
>> + /* Shift the field by 4 bits on success. */
>> + if (!res) {
>> + int nkeys = sel->sel.nkeys;
>> + struct tc_pedit_key *key = &sel->sel.keys[nkeys - 1];
>> + key->mask = htonl(ntohl(key->mask) << 4 | 0xf);
>> + key->val = htonl(ntohl(key->val) << 4);
>> + }
>> + goto done;
>> + }
> Why in the middle of the list?
Because that's the order IPv4 code does them.
> Why three aliases for the same value?
> Since this is new code choose one and make it match what IPv6 standard
> calls that field.
TOS because flower also calls it TOS, even if it's the IPv6 field.
dsfield, because the IPv4 pedit also accepts this. I'm fine with just
accepting traffic_class though.
next prev parent reply other threads:[~2020-03-30 8:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-27 17:55 [PATCH iproute2-next 0/3] Support pedit of ip6 dsfield Petr Machata
2020-03-27 17:55 ` [PATCH iproute2-next 1/3] tc: p_ip6: Support pedit of IPv6 dsfield Petr Machata
2020-03-28 0:51 ` Stephen Hemminger
2020-03-30 8:32 ` Petr Machata [this message]
2020-04-01 20:00 ` David Ahern
2020-04-02 11:06 ` Petr Machata
2020-03-27 17:55 ` [PATCH iproute2-next 2/3] man: tc-pedit: Add examples for dsfield and retain Petr Machata
2020-03-27 17:55 ` [PATCH iproute2-next 3/3] man: tc-pedit: Drop the claim that pedit ex is only for IPv4 Petr Machata
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=87eetafdki.fsf@mellanox.com \
--to=petrm@mellanox.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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.