[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0686d67a-84e8-dfab-7200-c67105420bcb@gmail.com>
Date: Wed, 1 Apr 2020 14:00:27 -0600
From: David Ahern <dsahern@...il.com>
To: Petr Machata <petrm@...lanox.com>,
Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org, David Ahern <dsahern@...il.com>
Subject: Re: [PATCH iproute2-next 1/3] tc: p_ip6: Support pedit of IPv6
dsfield
On 3/30/20 2:32 AM, Petr Machata wrote:
>
> Stephen Hemminger <stephen@...workplumber.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.
neither parse function uses matches() so the order should not matter.
>
>> 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.
>
that's probably the right thing to do since this is ipv6 related
Powered by blists - more mailing lists