netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, Jiri Pirko <jiri@resnulli.us>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	simon.horman@netronome.com,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	David Miller <davem@davemloft.net>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: Re: [net-next PATCH v3 1/3] net: sched: consolidate offload decision in cls_u32
Date: Mon, 29 Feb 2016 15:40:26 -0800	[thread overview]
Message-ID: <56D4D6EA.50608@gmail.com> (raw)
In-Reply-To: <CAM_iQpVP-HbhN=p0xq=wBvjYFG8rF9RCJr=r1-gznMh0ZfGCqA@mail.gmail.com>

On 16-02-29 01:25 PM, Cong Wang wrote:
> On Mon, Feb 29, 2016 at 10:58 AM, Jiri Pirko <jiri@resnulli.us> wrote:
>> Mon, Feb 29, 2016 at 07:40:53PM CET, john.fastabend@gmail.com wrote:
>>> On 16-02-27 08:28 PM, Cong Wang wrote:
>>>> On Fri, Feb 26, 2016 at 8:24 PM, John Fastabend
>>>> <john.fastabend@gmail.com> wrote:
>>>>> On 16-02-26 09:39 AM, Cong Wang wrote:
>>>>>> On Fri, Feb 26, 2016 at 7:53 AM, John Fastabend
>>>>>> <john.fastabend@gmail.com> wrote:
>>>>>>> diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
>>>>>>> index 2121df5..e64d20b 100644
>>>>>>> --- a/include/net/pkt_cls.h
>>>>>>> +++ b/include/net/pkt_cls.h
>>>>>>> @@ -392,4 +392,9 @@ struct tc_cls_u32_offload {
>>>>>>>         };
>>>>>>>  };
>>>>>>>
>>>>>>> +static inline bool tc_should_offload(struct net_device *dev)
>>>>>>> +{
>>>>>>> +       return dev->netdev_ops->ndo_setup_tc;
>>>>>>> +}
>>>>>>> +
>>>>>>
>>>>>> These should be protected by CONFIG_NET_CLS_U32, no?
>>>>>>
>>>>>
>>>>> Its not necessary it is a completely general function and I only
>>>>> lifted it out of cls_u32 so that the cls_flower classifier could
>>>>> also use it.
>>>>>
>>>>> I don't see the need off-hand to have it wrapped in an ORd ifdef
>>>>> statement where its (CONFIG_NET_CLS_U32 | CONFIG_NET_CLS_X ...).
>>>>> Any particular reason you were thnking it should be wrapped in ifdefs?
>>>>>
>>>>
>>>> Not a big deal.
>>>>
>>>> I just feel these don't need to compile when I have CONFIG_NET_CLS_U32=n.
>>>>
>>>> Thanks.
>>>>
>>>
>>> Well because this is 'static inline' gcc should just remove it
>>> if it is not used. Assuming non-ancient gcc and normal compile
>>> flags, e.g. you are not including -fkeep-inline-functions or
>>> something.
>>>
>>> So just to keep it readable I would prefer to just leave it
>>> as is.
>>
>> Definitelly. cls_flower will use it in very near future. Making it
>> dependent on CONFIG_NET_CLS_U32 makes 0 sense to me.
> 
> Oh, why then do you have u32 in the struct name tc_cls_u32_offload?
> 
> (Note that in the above I said "these" not "this", so I never only refer
> to tc_should_offload)
> 

hmm yeah that likely wont be needed by flower although it could be used.
I still think its best to leave this as is there doesn't seem to be a
very strong precedent to wrap any of the other structs/fields/etc in
pkt_cls.h into their respective ifdef/endif blocks. And I think it
starts to get a bit much if we do. I'm trusting gcc here can do the
right thing when these are included but never used.

Thanks,
John

  reply	other threads:[~2016-02-29 23:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 15:53 [net-next PATCH v3 0/3] tc software only John Fastabend
2016-02-26 15:53 ` [net-next PATCH v3 1/3] net: sched: consolidate offload decision in cls_u32 John Fastabend
2016-02-26 15:55   ` Jiri Pirko
2016-02-26 17:39   ` Cong Wang
2016-02-27  4:24     ` John Fastabend
2016-02-28  4:28       ` Cong Wang
2016-02-29 18:40         ` John Fastabend
2016-02-29 18:58           ` Jiri Pirko
2016-02-29 21:25             ` Cong Wang
2016-02-29 23:40               ` John Fastabend [this message]
2016-02-26 15:54 ` [net-next PATCH v3 2/3] net: cls_u32: move TC offload feature bit into cls_u32 offload logic John Fastabend
2016-02-26 15:56   ` Jiri Pirko
2016-02-26 15:54 ` [net-next PATCH v3 3/3] net: sched: cls_u32 add bit to specify software only rules John Fastabend
2016-02-26 15:58   ` Jiri Pirko
2016-03-01 21:06 ` [net-next PATCH v3 0/3] tc software only David Miller

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=56D4D6EA.50608@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=simon.horman@netronome.com \
    --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 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).