netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Or Gerlitz <gerlitz.or@gmail.com>
Cc: Anjali Singhai Jain <anjali.singhai@intel.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	ast@fb.com, "Skidmore, Donald C" <donald.c.skidmore@intel.com>,
	horms@verge.net.au, Linux Netdev List <netdev@vger.kernel.org>,
	Thomas Graf <tgraf@suug.ch>, David Miller <davem@davemloft.net>,
	Jiri Pirko <jiri@mellanox.com>
Subject: Re: [RFC PATCH 3/7] net: sched: add cls_u32 offload hooks for netdevs
Date: Tue, 02 Feb 2016 08:42:46 -0800	[thread overview]
Message-ID: <56B0DC86.7090402@gmail.com> (raw)
In-Reply-To: <CAJ3xEMjRRUgHo_J4yQr3Z9wSJA7aRAzHc1ZNoBVP5WRmDFTRjw@mail.gmail.com>

On 16-02-02 08:25 AM, Or Gerlitz wrote:
> On Mon, Feb 1, 2016 at 3:50 AM, John Fastabend <john.fastabend@gmail.com> wrote:
>> This patch allows netdev drivers to consume cls_u32 offloads via
>> the ndo_setup_tc ndo op.
>>
>> This works aligns with how network drivers have been doing qdisc
>> offloads for mqprio.
> 
> [...]
> 
>> --- a/include/linux/netdevice.h
>> +++ b/include/linux/netdevice.h
>> @@ -779,17 +779,21 @@ static inline bool netdev_phys_item_id_same(struct netdev_phys_item_id *a,
>>  typedef u16 (*select_queue_fallback_t)(struct net_device *dev,
>>                                        struct sk_buff *skb);
>>
>> -/* This structure holds attributes of qdisc and classifiers
>> +/* These structures hold the attributes of qdisc and classifiers
>>   * that are being passed to the netdevice through the setup_tc op.
>>   */
>>  enum {
>>         TC_SETUP_MQPRIO,
>> +       TC_SETUP_CLSU32,
>>  };
>>
>> +struct tc_cls_u32_offload;
>> +
>>  struct tc_to_netdev {
>>         unsigned int type;
>>         union {
>>                 u8 tc;
>> +               struct tc_cls_u32_offload *cls_u32;
>>         };
>>  };
> 
> So under this approach we're making the HW driver u32 aware. Do we
> really want to go there?
> 

Yes, I'm not convinced writing the universal language X to arbitrary
hardware is worth the complexity/cost at the moment. I already started
writing this universal block of code and it gets a bit complex to do
it right. Anyways none of this is exposed via UAPI so it can be
conslidated reworked as needed. Also I'm not to keen on going from
tc/netfilter/etc to language X (hw IR) to hardware when the block of
code to jump from u32 or flower to hardware is so simple. I added
flower support to the driver with about 100lines of code fwiw I'll
send the patch out later today, sure I skipped populating all the
fields by breaking out of some case statements but not that many.

I don't mind opening up some helper functions if you like my backend
structures. But anyways most the hard work is programming the hardware
and hoping someone did silicon validation anyways imo.

> The flow-dissector + actions structure way of describing matching and
> actions maybe had some
> drawbacks but it's not affiliated with a specific networking component
> (here TC/U32). When we look
> fwd do we expect everything (netfilter offloads for example) to be
> expressed in u32 terms?

I'm a bit tired of speculating about what_ifs when we see the netfilter
offload code lets take a look at consolidating. For now I have code that
_works_.

> 
> Or.
> 

  reply	other threads:[~2016-02-02 16:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-01  1:48 [RFC PATCH 0/7] tc cls_u32 hardware interface John Fastabend
2016-02-01  1:49 ` [RFC PATCH 1/7] net: rework ndo tc op to consume additional qdisc handle parameter John Fastabend
2016-02-01  1:49 ` [RFC PATCH 2/7] net: rework setup_tc ndo op to consume general tc operand John Fastabend
2016-02-01  1:50 ` [RFC PATCH 3/7] net: sched: add cls_u32 offload hooks for netdevs John Fastabend
2016-02-02 16:25   ` Or Gerlitz
2016-02-02 16:42     ` John Fastabend [this message]
2016-02-02 22:06       ` Or Gerlitz
2016-02-01  1:51 ` [RFC PATCH 4/7] net: add tc offload feature flag John Fastabend
2016-02-01  1:51 ` [RFC PATCH 5/7] net: tc: helper functions to query action types John Fastabend
2016-02-01  1:52 ` [RFC PATCH 6/7] net: ixgbe: add minimal parser details for ixgbe John Fastabend
2016-02-02 16:27   ` Or Gerlitz
2016-02-02 16:46     ` John Fastabend
2016-02-01  1:53 ` [RFC PATCH 7/7] net: ixgbe: add support for tc_u32 offload John Fastabend
2016-02-02  2:17   ` David Miller
2016-02-02  4:53     ` John Fastabend
2016-02-02 11:49 ` [RFC PATCH 0/7] tc cls_u32 hardware interface Jiri Pirko
2016-02-02 14:58   ` John Fastabend

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=56B0DC86.7090402@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=anjali.singhai@intel.com \
    --cc=ast@fb.com \
    --cc=davem@davemloft.net \
    --cc=donald.c.skidmore@intel.com \
    --cc=gerlitz.or@gmail.com \
    --cc=horms@verge.net.au \
    --cc=jesse.brandeburg@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).