mbox series

[net-next,0/3] Extend action skbedit to RX queue mapping

Message ID 166185158175.65874.17492440987811366231.stgit@anambiarhost.jf.intel.com (mailing list archive)
Headers show
Series Extend action skbedit to RX queue mapping | expand

Message

Nambiar, Amritha Aug. 30, 2022, 9:28 a.m. UTC
Based on the discussion on
https://lore.kernel.org/netdev/20220429171717.5b0b2a81@kernel.org/,
the following series extends skbedit tc action to RX queue mapping.
Currently, skbedit action in tc allows overriding of transmit queue.
Extending this ability of skedit action supports the selection of receive
queue for incoming packets. Offloading this action is added for receive
side. Enabled ice driver to offload this type of filter into the
hardware for accepting packets to the device's receive queue.

---

Amritha Nambiar (3):
      act_skbedit: Add support for action skbedit RX queue mapping
      act_skbedit: Offload skbedit queue mapping for receive queue
      ice: Enable RX queue selection using skbedit action


 drivers/net/ethernet/intel/ice/ice.h        |   15 +
 drivers/net/ethernet/intel/ice/ice_main.c   |    2 
 drivers/net/ethernet/intel/ice/ice_tc_lib.c |  351 +++++++++++++++++++--------
 drivers/net/ethernet/intel/ice/ice_tc_lib.h |   40 ++-
 include/net/act_api.h                       |    1 
 include/net/flow_offload.h                  |    2 
 include/net/tc_act/tc_skbedit.h             |   11 +
 net/sched/act_skbedit.c                     |   40 ++-
 net/sched/cls_api.c                         |    7 +
 9 files changed, 352 insertions(+), 117 deletions(-)

--

Comments

Jakub Kicinski Sept. 1, 2022, 2:46 a.m. UTC | #1
On Tue, 30 Aug 2022 02:28:39 -0700 Amritha Nambiar wrote:
> Based on the discussion on
> https://lore.kernel.org/netdev/20220429171717.5b0b2a81@kernel.org/,
> the following series extends skbedit tc action to RX queue mapping.
> Currently, skbedit action in tc allows overriding of transmit queue.
> Extending this ability of skedit action supports the selection of receive
> queue for incoming packets. Offloading this action is added for receive
> side. Enabled ice driver to offload this type of filter into the
> hardware for accepting packets to the device's receive queue.

Thinking about this again - is redirecting to a queue really the most
useful API to expose? Wouldn't users want to redirect to a set of
queues, i.e. RSS context?

Or in your case the redirect to a set of queues is done by assigning
a class?

Either way we should start documenting things, so please find (/create)
some place under Documentation/networking where we can make notes for
posterity.
Nambiar, Amritha Sept. 2, 2022, 8:37 a.m. UTC | #2
> -----Original Message-----
> From: Jakub Kicinski <kuba@kernel.org>
> Sent: Wednesday, August 31, 2022 7:46 PM
> To: Nambiar, Amritha <amritha.nambiar@intel.com>
> Cc: netdev@vger.kernel.org; alexander.h.duyck@intel.com;
> jhs@mojatatu.com; jiri@resnulli.us; xiyou.wangcong@gmail.com; Gomes,
> Vinicius <vinicius.gomes@intel.com>; Samudrala, Sridhar
> <sridhar.samudrala@intel.com>
> Subject: Re: [net-next PATCH 0/3] Extend action skbedit to RX queue mapping
> 
> On Tue, 30 Aug 2022 02:28:39 -0700 Amritha Nambiar wrote:
> > Based on the discussion on
> > https://lore.kernel.org/netdev/20220429171717.5b0b2a81@kernel.org/,
> > the following series extends skbedit tc action to RX queue mapping.
> > Currently, skbedit action in tc allows overriding of transmit queue.
> > Extending this ability of skedit action supports the selection of receive
> > queue for incoming packets. Offloading this action is added for receive
> > side. Enabled ice driver to offload this type of filter into the
> > hardware for accepting packets to the device's receive queue.
> 
> Thinking about this again - is redirecting to a queue really the most
> useful API to expose? Wouldn't users want to redirect to a set of
> queues, i.e. RSS context?
> 
> Or in your case the redirect to a set of queues is done by assigning
> a class?
> 
We already support redirecting to a set of queues using the 'hw_tc' option
of tc-flower. From the man page of tc-flower:
"hw_tc TCID - Specify a hardware traffic class to pass matching packets on to.
 TCID is in the range 0 through 15."
We needed two levels of filtering via TC, the first level selects the set of
queues, and an additional level that selects a queue within the queue-set 
(from the first level). Hence redirecting to a queue as an action. The additional
advantage is that being a tc-action allows using other action controls on this,
action chaining via "pipe" with other tc actions, and continuing classification
via action control "continue" etc.

> Either way we should start documenting things, so please find (/create)
> some place under Documentation/networking where we can make notes for
> posterity.

Agree. I'll update the man page for tc-skbedit action. I can add notes in
Documentation/networking as well.