From: Florian Fainelli <f.fainelli@gmail.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com,
eladr@mellanox.com, mlxsw@mellanox.com, ogerlitz@mellanox.com,
jhs@mojatatu.com, ivecera@redhat.com, jbenc@redhat.com
Subject: Re: [patch net-next 00/19] mlxsw: Introduce TC Flower offload using TCAM
Date: Fri, 3 Feb 2017 09:57:25 -0800 [thread overview]
Message-ID: <c22756d1-552f-4cda-c44c-960b0275a432@gmail.com> (raw)
In-Reply-To: <20170203065801.GB1871@nanopsycho.orion>
On 02/02/2017 10:58 PM, Jiri Pirko wrote:
> Thu, Feb 02, 2017 at 10:40:42PM CET, f.fainelli@gmail.com wrote:
>> On 02/02/2017 07:12 AM, Jiri Pirko wrote:
>>> From: Jiri Pirko <jiri@mellanox.com>
>>>
>>> This patchset introduces support for offloading TC cls_flower and actions
>>> to Spectrum TCAM-base policy engine.
>>>
>>> The patchset contains patches to allow work with flexible keys and actions
>>> which are used in Spectrum TCAM.
>>>
>>> It also contains in-driver infrastructure for offloading TC rules to TCAM HW.
>>> The TCAM management code is simple and limited for now. It is going to be
>>> extended as a follow-up work.
>>>
>>> The last patch uses the previously introduced infra to allow to implement
>>> cls_flower offloading. Initially, only limited set of match-keys and only
>>> a drop and forward actions are supported.
>>>
>>> As a dependency, this patchset introduces parman - priority array
>>> area manager - as a library.
>>
>> This looks really great (except all the input parameters validation
>> using flow_dissector keys, but there is already a thread about that, and
>> you are working with what you have)!
>>
>> One thing I found missing with cls_flower is the ability to specify the
>> location of a rule, or if not specified have the switch driver return to
>> user which rule index was selected. Should we consider adding that so we
>> could finally move out of ethtool::rxfnc for NICs and other drivers?
>
> What exactly do you mean by "location"? When you add the rule, you
> specify "pref/prio". Rules with same prio have always indentical mask
> and go into one hashtable. For mlxsw offload, the rule with prio goes
> down to driver and the chunks of rules with same priority are arranged
> in TCAM accordingly (using parman).
location parameter in ethtool_rx_flow_spec allows you to either let the
driver decide where to place the rule in its TCAM (RX_CLS_LOC_ANY), or
you can influence this decision by setting it to 0 ... MAX.
In the Broadcom SF2 switch case, this rule location is used during
packet matching, for instance:
- you program a rule to match a given 5-tuple on Port 0, queue 0 that
redirects the packet to Port 7 queue 8, with a rule ID of X (that is
both position in TCAM, and unique global identifier)
- a packet is matched, switch classifies packets, find a matching rule
and the packet ingresses Port 7 with Broadcom tag (per-packet metadata)
and the classification ID is set to X indicating that the packet you
receive has been matched by a rule
The driver knows how many rules are available (HW limitation), and can
either do a first unused rule location, or let the user specify where it
wants it (look at bcm_sf2_cfp.c).
The part that seems to be possibly missing here is that if the driver
did decide where to place this rule in its TCAM, it can be useful to
return that to user-space, so it can be communicated to other parts of
the system.
Of course, this only works if the programming paradigm is that rules are
identified by some kind of location...
--
Florian
next prev parent reply other threads:[~2017-02-03 17:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 15:12 [patch net-next 00/19] mlxsw: Introduce TC Flower offload using TCAM Jiri Pirko
2017-02-02 15:12 ` [patch net-next 01/19] mlxsw: item: Add 8bit item helpers Jiri Pirko
2017-02-02 15:12 ` [patch net-next 02/19] mlxsw: item: Add helpers for getting pointer into payload for char buffer item Jiri Pirko
2017-02-02 15:12 ` [patch net-next 03/19] mlxsw: reg: Add Policy-Engine ACL Register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 04/19] mlxsw: reg: Add Policy-Engine ACL Group Table register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 05/19] mlxsw: reg: Add Policy-Engine TCAM Allocation Register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 06/19] mlxsw: reg: Add Policy-Engine TCAM Entry Register Version 2 Jiri Pirko
2017-02-02 15:12 ` [patch net-next 07/19] mlxsw: reg: Add Policy-Engine Port Binding Table Jiri Pirko
2017-02-02 15:12 ` [patch net-next 08/19] mlxsw: reg: Add Policy-Engine Rules Copy Register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 09/19] mlxsw: reg: Add Policy-Engine Policy Based Switching Register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 10/19] mlxsw: reg: Add Policy-Engine Extended Flexible Action Register Jiri Pirko
2017-02-02 15:12 ` [patch net-next 11/19] mlxsw: core: Introduce flexible keys support Jiri Pirko
2017-02-02 15:12 ` [patch net-next 12/19] mlxsw: core: Introduce flexible actions support Jiri Pirko
2017-02-02 15:12 ` [patch net-next 13/19] mlxsw: spectrum: Introduce basic set of flexible key blocks Jiri Pirko
2017-02-02 15:12 ` [patch net-next 14/19] mlxsw: resources: Add ACL related resources Jiri Pirko
2017-02-02 15:12 ` [patch net-next 15/19] list: introduce list_for_each_entry_from_reverse helper Jiri Pirko
2017-02-02 15:12 ` [patch net-next 16/19] lib: Introduce priority array area manager Jiri Pirko
2017-02-02 21:58 ` Tom Herbert
2017-02-02 22:28 ` Eric Dumazet
2017-02-03 7:08 ` Jiri Pirko
2017-02-02 22:51 ` Joe Perches
2017-02-03 7:01 ` Jiri Pirko
2017-02-02 15:12 ` [patch net-next 17/19] mlxsw: spectrum: Introduce ACL core with simple TCAM implementation Jiri Pirko
2017-02-02 22:34 ` David Miller
2017-02-03 6:53 ` Jiri Pirko
2017-02-02 15:12 ` [patch net-next 18/19] sched: cls_flower: expose priority to offloading netdevice Jiri Pirko
2017-02-02 15:12 ` [patch net-next 19/19] mlxsw: spectrum: Implement TC flower offload Jiri Pirko
2017-02-02 21:37 ` Florian Fainelli
2017-02-03 7:38 ` Jiri Pirko
2017-02-02 21:40 ` [patch net-next 00/19] mlxsw: Introduce TC Flower offload using TCAM Florian Fainelli
2017-02-03 6:58 ` Jiri Pirko
2017-02-03 17:57 ` Florian Fainelli [this message]
2017-02-03 18:10 ` Jiri Pirko
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=c22756d1-552f-4cda-c44c-960b0275a432@gmail.com \
--to=f.fainelli@gmail.com \
--cc=davem@davemloft.net \
--cc=eladr@mellanox.com \
--cc=idosch@mellanox.com \
--cc=ivecera@redhat.com \
--cc=jbenc@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.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).