netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Tom Herbert <tom@herbertland.com>
Cc: Or Gerlitz <gerlitz.or@gmail.com>,
	Or Gerlitz <ogerlitz@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Roi Dayan <roid@mellanox.com>, Paul Blakey <paulb@mellanox.com>
Subject: Re: [PATCH net-next 1/4] net/flow_dissector: add support for dissection of misc ip header fields
Date: Tue, 30 May 2017 15:10:29 +0200	[thread overview]
Message-ID: <20170530131029.GD1838@nanopsycho> (raw)
In-Reply-To: <CALx6S35LoybyU-NN8RTk4YMOmuOZTkJeZ6GVBnWbX6rtd2uM6Q@mail.gmail.com>

Sat, May 27, 2017 at 07:18:45PM CEST, tom@herbertland.com wrote:
>On Sat, May 27, 2017 at 9:31 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
>> On Thu, May 25, 2017 at 7:22 PM, Tom Herbert <tom@herbertland.com> wrote:
>>> On Thu, May 25, 2017 at 6:24 AM, Or Gerlitz <ogerlitz@mellanox.com> wrote:
>>>> Add support for dissection of ip tos and ttl and ipv6 traffic-class
>>>> and hoplimit. Both are dissected into the same struct.
>>
>>>> Uses similar call to ip dissection function as with tcp, arp and others.
>>
>>
>>>> +/**
>>>> + * struct flow_dissector_key_ip:
>>>> + * @tos: tos
>>>> + * @ttl: ttl
>>>> + */
>>>> +struct flow_dissector_key_ip {
>>>> +       __u8    tos;
>>>> +       __u8    ttl;
>>>> +};
>>>> --- a/net/core/flow_dissector.c
>>>> +++ b/net/core/flow_dissector.c
>>
>>>> +static void
>>>> +__skb_flow_dissect_ipv4(const struct sk_buff *skb,
>>>> +                       struct flow_dissector *flow_dissector,
>>>> +                       void *target_container, void *data, const struct iphdr *iph)
>>>> +{
>>>> +       struct flow_dissector_key_ip *key_ip;
>>>> +
>>>> +       if (!dissector_uses_key(flow_dissector, FLOW_DISSECTOR_KEY_IP))
>>>> +               return;
>>>> +
>>>> +       key_ip = skb_flow_dissector_target(flow_dissector,
>>>> +                                          FLOW_DISSECTOR_KEY_IP,
>>>> +                                          target_container);
>>>> +       key_ip->tos = iph->tos;
>>>> +       key_ip->ttl = iph->ttl;
>>>
>>> In an encapsulation this returns the tos and ttl of the encapsulated
>>> packet. Is that really useful to the caller? Seems more likely that
>>> they need the outer tos and ttl for forwarding.
>>
>> In what we are dealing with, classification is carried after the
>> packet is decapsulated by the shared tunnel device. So even today,e.g
>> for the src/dst IP, the dissection is carried on what were the inner
>> fields before decap.
>>
>Or,
>
>I think the problem is I don't know what you're dealing with. The only
>thing I can derive from the commit log is that tos and ttl are being
>extracted, but I don't know why they are needed. I do know this is
>adding complexity to an already overly complex function, and this
>introduces new conditionals and code into the primary use case of
>flow_dissector which is to create a key for deriving skb->hash. I
>don't see that the cost of this patch has been justified.

Tom, we have been over this multiple times. The decision DaveM made at
the time I was pushing cls_flower was to have one shared dissection code
(I originally had a separate dissector inside cls_flower). And I
agree with that decision. It was a bit painful to work out the
flow_dissector in a generic way, but it was worth the efford.

So when we need to dissect something new for cls_flower, we put it here.
flow_dissector is now miles away from being just a plain
"creator of the key to derive skb->hash".

Jiří

  parent reply	other threads:[~2017-05-30 13:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 13:24 [PATCH net-next 0/4] add support for dissection and matching on ip tos and ttl Or Gerlitz
2017-05-25 13:24 ` [PATCH net-next 1/4] net/flow_dissector: add support for dissection of misc ip header fields Or Gerlitz
2017-05-25 15:42   ` Tom Herbert
2017-05-27 16:29     ` Or Gerlitz
2017-05-25 16:22   ` Tom Herbert
2017-05-27 16:31     ` Or Gerlitz
2017-05-27 17:18       ` Tom Herbert
2017-05-27 20:56         ` Or Gerlitz
2017-05-30 13:10         ` Jiri Pirko [this message]
2017-05-30 16:06           ` Tom Herbert
2017-05-30 16:18             ` David Miller
2017-06-01 16:08               ` Or Gerlitz
2017-06-01 16:35                 ` David Miller
2017-05-25 13:24 ` [PATCH net-next 2/4] net/sched: cls_flower: add support for matching on ip tos and ttl Or Gerlitz
2017-05-25 13:24 ` [PATCH net-next 3/4] net/mlx5e: Offload TC matching on tcp flags Or Gerlitz
2017-05-25 13:24 ` [PATCH net-next 4/4] net/mlx5e: Offload TC matching on ip tos / traffic-class Or Gerlitz

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=20170530131029.GD1838@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=gerlitz.or@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=paulb@mellanox.com \
    --cc=roid@mellanox.com \
    --cc=saeedm@mellanox.com \
    --cc=tom@herbertland.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 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).