linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 00/13] Add ethtool ntuple filters support
@ 2020-11-11  7:13 Naveen Mamindlapalli
  2020-11-11  7:13 ` [PATCH v3 net-next 01/13] octeontx2-af: Modify default KEX profile to extract TX packet fields Naveen Mamindlapalli
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Naveen Mamindlapalli @ 2020-11-11  7:13 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, saeed, sgoutham, lcherian, gakula, jerinj, sbhatta, hkelam

This patch series adds support for ethtool ntuple filters, unicast
address filtering, VLAN offload and SR-IOV ndo handlers. All of the
above features are based on the Admin Function(AF) driver support to
install and delete the low level MCAM entries. Each MCAM entry is
programmed with the packet fields to match and what actions to take
if the match succeeds. The PF driver requests AF driver to allocate
set of MCAM entries to be used to install the flows by that PF. The
entries will be freed when the PF driver is unloaded.

* The patches 1 to 4 adds AF driver infrastructure to install and
  delete the low level MCAM flow entries.
* Patch 5 adds ethtool ntuple filter support.
* Patch 6 adds unicast MAC address filtering.
* Patch 7 adds support for dumping the MCAM entries via debugfs.
* Patches 8 to 10 adds support for VLAN offload.
* Patch 10 to 11 adds support for SR-IOV ndo handlers.
* Patch 12 adds support to read the MCAM entries.

Misc:
* Removed redundant mailbox NIX_RXVLAN_ALLOC.

Change-log:
v3:
- Fixed Saeed's review comments on v2.
	- Fixed modifying the netdev->flags from driver.
	- Fixed modifying the netdev features and hw_features after register_netdev.
	- Removed unwanted ndo_features_check callback.
v2:
- Fixed the sparse issues reported by Jakub.

Hariprasad Kelam (3):
  octeontx2-pf: Add support for unicast MAC address filtering
  octeontx2-pf: Implement ingress/egress VLAN offload
  octeontx2-af: Handle PF-VF mac address changes

Naveen Mamindlapalli (2):
  octeontx2-pf: Add support for SR-IOV management functions
  octeontx2-af: Add new mbox messages to retrieve MCAM entries

Stanislaw Kardach (1):
  octeontx2-af: Modify default KEX profile to extract TX packet fields

Subbaraya Sundeep (6):
  octeontx2-af: Verify MCAM entry channel and PF_FUNC
  octeontx2-af: Generate key field bit mask from KEX profile
  octeontx2-af: Add mbox messages to install and delete MCAM rules
  octeontx2-pf: Add support for ethtool ntuple filters
  octeontx2-af: Add debugfs entry to dump the MCAM rules
  octeontx2-af: Delete NIX_RXVLAN_ALLOC mailbox message

Vamsi Attunuru (1):
  octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries

 drivers/net/ethernet/marvell/octeontx2/af/Makefile |    2 +-
 drivers/net/ethernet/marvell/octeontx2/af/common.h |    2 +
 drivers/net/ethernet/marvell/octeontx2/af/mbox.h   |  170 ++-
 drivers/net/ethernet/marvell/octeontx2/af/npc.h    |  106 +-
 .../ethernet/marvell/octeontx2/af/npc_profile.h    |   71 +-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |   16 +-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.h    |   71 +-
 .../ethernet/marvell/octeontx2/af/rvu_debugfs.c    |  197 +++
 .../net/ethernet/marvell/octeontx2/af/rvu_nix.c    |  305 ++++-
 .../net/ethernet/marvell/octeontx2/af/rvu_npc.c    |  462 ++++++-
 .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 1334 ++++++++++++++++++++
 .../net/ethernet/marvell/octeontx2/af/rvu_struct.h |   11 +
 .../net/ethernet/marvell/octeontx2/nic/Makefile    |    2 +-
 .../ethernet/marvell/octeontx2/nic/otx2_common.c   |    8 +-
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |   59 +
 .../ethernet/marvell/octeontx2/nic/otx2_ethtool.c  |   58 +-
 .../ethernet/marvell/octeontx2/nic/otx2_flows.c    |  820 ++++++++++++
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  307 ++++-
 .../net/ethernet/marvell/octeontx2/nic/otx2_txrx.c |   16 +
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |    5 +
 20 files changed, 3862 insertions(+), 160 deletions(-)
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
 create mode 100644 drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c

-- 
2.16.5


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH v3 net-next 03/13] octeontx2-af: Generate key field bit mask from KEX profile
@ 2020-11-14 18:54 Naveen Mamindlapalli
  0 siblings, 0 replies; 24+ messages in thread
From: Naveen Mamindlapalli @ 2020-11-14 18:54 UTC (permalink / raw)
  To: Alexander Duyck
  Cc: Netdev, LKML, Jakub Kicinski, David Miller, saeed,
	Sunil Kovvuri Goutham, Linu Cherian, Geethasowjanya Akula,
	Jerin Jacob Kollanukkaran, Subbaraya Sundeep Bhatta,
	Hariprasad Kelam

Hi Alexander,

Thanks for the review.

> -----Original Message-----
> From: Alexander Duyck <alexander.duyck@gmail.com>
> Sent: Friday, November 13, 2020 2:55 AM
> To: Naveen Mamindlapalli <naveenm@marvell.com>
> Cc: Netdev <netdev@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>;
> Jakub Kicinski <kuba@kernel.org>; David Miller <davem@davemloft.net>;
> saeed@kernel.org; Sunil Kovvuri Goutham <sgoutham@marvell.com>; Linu
> Cherian <lcherian@marvell.com>; Geethasowjanya Akula
> <gakula@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Hariprasad Kelam
> <hkelam@marvell.com>
> Subject: Re: [PATCH v3 net-next 03/13] octeontx2-af: Generate key field
> bit mask from KEX profile
> 
> On Tue, Nov 10, 2020 at 11:24 PM Naveen Mamindlapalli
> <naveenm@marvell.com> wrote:
> >
> > From: Subbaraya Sundeep <sbhatta@marvell.com>
> >
> > Key Extraction(KEX) profile decides how the packet metadata such as
> > layer information and selected packet data bytes at each layer are
> > placed in MCAM search key. This patch reads the configured KEX profile
> > parameters to find out the bit position and bit mask for each field.
> > The information is used when programming the MCAM match data by SW to
> > match a packet flow and take appropriate action on the flow. This
> > patch also verifies the mandatory fields such as channel and DMAC are
> > not overwritten by the KEX configuration of other fields.
> >
> > Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
> > Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
> > Signed-off-by: Naveen Mamindlapalli <naveenm@marvell.com>
> 
> A few minor spelling issues, otherwise it looks fine.
> 
> Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
> 
> > ---
> >  drivers/net/ethernet/marvell/octeontx2/af/Makefile |   2 +-
> >  drivers/net/ethernet/marvell/octeontx2/af/npc.h    |  48 ++
> >  drivers/net/ethernet/marvell/octeontx2/af/rvu.h    |  38 ++
> >  .../net/ethernet/marvell/octeontx2/af/rvu_npc.c    |  11 +-
> >  .../net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 562
> > +++++++++++++++++++++
> >  5 files changed, 658 insertions(+), 3 deletions(-)  create mode
> > 100644 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
> >
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/Makefile
> > b/drivers/net/ethernet/marvell/octeontx2/af/Makefile
> > index 2f7a861d0c7b..ffc681b67f1c 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/Makefile
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/Makefile
> > @@ -9,4 +9,4 @@ obj-$(CONFIG_OCTEONTX2_AF) += octeontx2_af.o
> >
> >  octeontx2_mbox-y := mbox.o rvu_trace.o  octeontx2_af-y := cgx.o rvu.o
> > rvu_cgx.o rvu_npa.o rvu_nix.o \
> > -                 rvu_reg.o rvu_npc.o rvu_debugfs.o ptp.o
> > +                 rvu_reg.o rvu_npc.o rvu_debugfs.o ptp.o rvu_npc_fs.o
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > b/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > index 91a9d00e4fb5..0fe47216f771 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/npc.h
> > @@ -140,6 +140,54 @@ enum npc_kpu_lh_ltype {
> >         NPC_LT_LH_CUSTOM1 = 0xF,
> >  };
> >
> > +/* list of known and supported fields in packet header and
> > + * fields present in key structure.
> > + */
> > +enum key_fields {
> > +       NPC_DMAC,
> > +       NPC_SMAC,
> > +       NPC_ETYPE,
> > +       NPC_OUTER_VID,
> > +       NPC_TOS,
> > +       NPC_SIP_IPV4,
> > +       NPC_DIP_IPV4,
> > +       NPC_SIP_IPV6,
> > +       NPC_DIP_IPV6,
> > +       NPC_SPORT_TCP,
> > +       NPC_DPORT_TCP,
> > +       NPC_SPORT_UDP,
> > +       NPC_DPORT_UDP,
> > +       NPC_SPORT_SCTP,
> > +       NPC_DPORT_SCTP,
> > +       NPC_HEADER_FIELDS_MAX,
> > +       NPC_CHAN = NPC_HEADER_FIELDS_MAX, /* Valid when Rx */
> > +       NPC_PF_FUNC, /* Valid when Tx */
> > +       NPC_ERRLEV,
> > +       NPC_ERRCODE,
> > +       NPC_LXMB,
> > +       NPC_LA,
> > +       NPC_LB,
> > +       NPC_LC,
> > +       NPC_LD,
> > +       NPC_LE,
> > +       NPC_LF,
> > +       NPC_LG,
> > +       NPC_LH,
> > +       /* ether type for untagged frame */
> > +       NPC_ETYPE_ETHER,
> > +       /* ether type for single tagged frame */
> > +       NPC_ETYPE_TAG1,
> > +       /* ether type for double tagged frame */
> > +       NPC_ETYPE_TAG2,
> > +       /* outer vlan tci for single tagged frame */
> > +       NPC_VLAN_TAG1,
> > +       /* outer vlan tci for double tagged frame */
> > +       NPC_VLAN_TAG2,
> > +       /* other header fields programmed to extract but not of our interest */
> > +       NPC_UNKNOWN,
> > +       NPC_KEY_FIELDS_MAX,
> > +};
> > +
> >  struct npc_kpu_profile_cam {
> >         u8 state;
> >         u8 state_mask;
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > index 1724dbd18847..7e556c7b6ccf 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
> > @@ -15,6 +15,7 @@
> >  #include "rvu_struct.h"
> >  #include "common.h"
> >  #include "mbox.h"
> > +#include "npc.h"
> >
> >  /* PCI device IDs */
> >  #define        PCI_DEVID_OCTEONTX2_RVU_AF              0xA065
> > @@ -105,6 +106,36 @@ struct nix_mce_list {
> >         int                     max;
> >  };
> >
> > +/* layer meta data to uniquely identify a packet header field */
> 
> s/meta data/metadata/

Okay, I will change.

> 
> > +struct npc_layer_mdata {
> > +       u8 lid;
> > +       u8 ltype;
> > +       u8 hdr;
> > +       u8 key;
> > +       u8 len;
> > +};
> > +
> 
> <snip>
> 
> > +       /* Handle header fields which can come from multiple layers like
> > +        * etype, outer vlan tci. These fields should have same position in
> > +        * the key otherwise to install a mcam rule more than one entry is
> > +        * needed which complicates mcam space management.
> > +        */
> > +       etype_ether = &key_fields[NPC_ETYPE_ETHER];
> > +       etype_tag1 = &key_fields[NPC_ETYPE_TAG1];
> > +       etype_tag2 = &key_fields[NPC_ETYPE_TAG2];
> > +       vlan_tag1 = &key_fields[NPC_VLAN_TAG1];
> > +       vlan_tag2 = &key_fields[NPC_VLAN_TAG2];
> > +
> > +       /* if key profile programmed does not extract ether type at
> > + all */
> 
> s/ether type/Ethertype/

I will update this too.

> 
> > +       if (!etype_ether->nr_kws && !etype_tag1->nr_kws && !etype_tag2-
> >nr_kws)
> > +               goto vlan_tci;
> > +
> > +       /* if key profile programmed extracts ether type from one
> > + layer */
> 
> Same issue here and a few other places, replace "ether type" with "Ethertype".

I will change them all & send v4.

> 
> 
> > +       if (etype_ether->nr_kws && !etype_tag1->nr_kws && !etype_tag2-
> >nr_kws)
> > +               key_fields[NPC_ETYPE] = *etype_ether;
> > +       if (!etype_ether->nr_kws && etype_tag1->nr_kws && !etype_tag2-
> >nr_kws)
> > +               key_fields[NPC_ETYPE] = *etype_tag1;
> > +       if (!etype_ether->nr_kws && !etype_tag1->nr_kw
> >

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-11-14 19:00 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11  7:13 [PATCH v3 net-next 00/13] Add ethtool ntuple filters support Naveen Mamindlapalli
2020-11-11  7:13 ` [PATCH v3 net-next 01/13] octeontx2-af: Modify default KEX profile to extract TX packet fields Naveen Mamindlapalli
2020-11-12 19:57   ` Saeed Mahameed
2020-11-14 18:59     ` [EXT] " Naveen Mamindlapalli
2020-11-12 20:02   ` Alexander Duyck
2020-11-11  7:13 ` [PATCH v3 net-next 02/13] octeontx2-af: Verify MCAM entry channel and PF_FUNC Naveen Mamindlapalli
2020-11-12 20:03   ` Alexander Duyck
2020-11-11  7:13 ` [PATCH v3 net-next 03/13] octeontx2-af: Generate key field bit mask from KEX profile Naveen Mamindlapalli
2020-11-12 21:24   ` Alexander Duyck
2020-11-11  7:13 ` [PATCH v3 net-next 04/13] octeontx2-af: Add mbox messages to install and delete MCAM rules Naveen Mamindlapalli
2020-11-12 21:46   ` Alexander Duyck
2020-11-11  7:13 ` [PATCH v3 net-next 05/13] octeontx2-pf: Add support for ethtool ntuple filters Naveen Mamindlapalli
2020-11-11  7:13 ` [PATCH v3 net-next 06/13] octeontx2-pf: Add support for unicast MAC address filtering Naveen Mamindlapalli
2020-11-11  7:13 ` [PATCH v3 net-next 07/13] octeontx2-af: Add debugfs entry to dump the MCAM rules Naveen Mamindlapalli
2020-11-12 19:48   ` Saeed Mahameed
2020-11-11  7:13 ` [PATCH v3 net-next 08/13] octeontx2-af: Modify nix_vtag_cfg mailbox to support TX VTAG entries Naveen Mamindlapalli
2020-11-11  7:14 ` [PATCH v3 net-next 09/13] octeontx2-pf: Implement ingress/egress VLAN offload Naveen Mamindlapalli
2020-11-11  7:14 ` [PATCH v3 net-next 10/13] octeontx2-pf: Add support for SR-IOV management functions Naveen Mamindlapalli
2020-11-11  7:14 ` [PATCH v3 net-next 11/13] octeontx2-af: Handle PF-VF mac address changes Naveen Mamindlapalli
2020-11-11  7:14 ` [PATCH v3 net-next 12/13] octeontx2-af: Add new mbox messages to retrieve MCAM entries Naveen Mamindlapalli
2020-11-11  7:14 ` [PATCH v3 net-next 13/13] octeontx2-af: Delete NIX_RXVLAN_ALLOC mailbox message Naveen Mamindlapalli
2020-11-12 20:16 ` [PATCH v3 net-next 00/13] Add ethtool ntuple filters support Saeed Mahameed
2020-11-14 19:00   ` [EXT] " Naveen Mamindlapalli
2020-11-14 18:54 [PATCH v3 net-next 03/13] octeontx2-af: Generate key field bit mask from KEX profile Naveen Mamindlapalli

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).