Commit 85badb2c authored by Paolo Abeni's avatar Paolo Abeni

Merge branch 'bnxt_en-ntuple-filter-improvements'

Michael Chan says:

====================
bnxt_en: Ntuple filter improvements

The current Ntuple filter implementation has a limitation on 5750X (P5)
and newer chips.  The destination ring of the ntuple filter must be
a valid ring in the RSS indirection table.  Ntuple filters may not work
if the RSS indirection table is modified by the user to only contain a
subset of the rings.  If an ntuple filter is set to a ring destination
that is not in the RSS indirection table, the packet matching that
filter will be placed in a random ring instead of the specified
destination ring.

This series of patches will fix the problem by using a separate VNIC
for ntuple filters.  The default VNIC will be dedicated for RSS and
so the indirection table can be setup in any way and will not affect
ntuple filters using the separate VNIC.

Quite a bit of refactoring is needed to do the the VNIC and RSS
context accounting in the first few patches.  This is technically a
bug fix, but I think the changes are too big for -net.
====================

Link: https://lore.kernel.org/r/20240220230317.96341-1-michael.chan@broadcom.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents e7b83f2f f6eff053
This diff is collapsed.
...@@ -1213,6 +1213,9 @@ struct bnxt_ring_grp_info { ...@@ -1213,6 +1213,9 @@ struct bnxt_ring_grp_info {
u16 cp_fw_ring_id; u16 cp_fw_ring_id;
}; };
#define BNXT_VNIC_DEFAULT 0
#define BNXT_VNIC_NTUPLE 1
struct bnxt_vnic_info { struct bnxt_vnic_info {
u16 fw_vnic_id; /* returned by Chimp during alloc */ u16 fw_vnic_id; /* returned by Chimp during alloc */
#define BNXT_MAX_CTX_PER_VNIC 8 #define BNXT_MAX_CTX_PER_VNIC 8
...@@ -1252,11 +1255,24 @@ struct bnxt_vnic_info { ...@@ -1252,11 +1255,24 @@ struct bnxt_vnic_info {
#define BNXT_VNIC_MCAST_FLAG 4 #define BNXT_VNIC_MCAST_FLAG 4
#define BNXT_VNIC_UCAST_FLAG 8 #define BNXT_VNIC_UCAST_FLAG 8
#define BNXT_VNIC_RFS_NEW_RSS_FLAG 0x10 #define BNXT_VNIC_RFS_NEW_RSS_FLAG 0x10
#define BNXT_VNIC_NTUPLE_FLAG 0x20
};
struct bnxt_hw_rings {
int tx;
int rx;
int grp;
int cp;
int cp_p5;
int stat;
int vnic;
int rss_ctx;
}; };
struct bnxt_hw_resc { struct bnxt_hw_resc {
u16 min_rsscos_ctxs; u16 min_rsscos_ctxs;
u16 max_rsscos_ctxs; u16 max_rsscos_ctxs;
u16 resv_rsscos_ctxs;
u16 min_cp_rings; u16 min_cp_rings;
u16 max_cp_rings; u16 max_cp_rings;
u16 resv_cp_rings; u16 resv_cp_rings;
...@@ -2314,12 +2330,16 @@ struct bnxt { ...@@ -2314,12 +2330,16 @@ struct bnxt {
#define BNXT_FW_CAP_BACKING_STORE_V2 BIT_ULL(36) #define BNXT_FW_CAP_BACKING_STORE_V2 BIT_ULL(36)
#define BNXT_FW_CAP_VNIC_TUNNEL_TPA BIT_ULL(37) #define BNXT_FW_CAP_VNIC_TUNNEL_TPA BIT_ULL(37)
#define BNXT_FW_CAP_CFA_NTUPLE_RX_EXT_IP_PROTO BIT_ULL(38) #define BNXT_FW_CAP_CFA_NTUPLE_RX_EXT_IP_PROTO BIT_ULL(38)
#define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V3 BIT_ULL(39)
u32 fw_dbg_cap; u32 fw_dbg_cap;
#define BNXT_NEW_RM(bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM) #define BNXT_NEW_RM(bp) ((bp)->fw_cap & BNXT_FW_CAP_NEW_RM)
#define BNXT_PTP_USE_RTC(bp) (!BNXT_MH(bp) && \ #define BNXT_PTP_USE_RTC(bp) (!BNXT_MH(bp) && \
((bp)->fw_cap & BNXT_FW_CAP_PTP_RTC)) ((bp)->fw_cap & BNXT_FW_CAP_PTP_RTC))
#define BNXT_SUPPORTS_NTUPLE_VNIC(bp) \
(BNXT_PF(bp) && ((bp)->fw_cap & BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V3))
u32 hwrm_spec_code; u32 hwrm_spec_code;
u16 hwrm_cmd_seq; u16 hwrm_cmd_seq;
u16 hwrm_cmd_kong_seq; u16 hwrm_cmd_kong_seq;
......
...@@ -1314,7 +1314,7 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, ...@@ -1314,7 +1314,7 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp,
if (!new_fltr) if (!new_fltr)
return -ENOMEM; return -ENOMEM;
l2_fltr = bp->vnic_info[0].l2_filters[0]; l2_fltr = bp->vnic_info[BNXT_VNIC_DEFAULT].l2_filters[0];
atomic_inc(&l2_fltr->refcnt); atomic_inc(&l2_fltr->refcnt);
new_fltr->l2_fltr = l2_fltr; new_fltr->l2_fltr = l2_fltr;
fmasks = &new_fltr->fmasks; fmasks = &new_fltr->fmasks;
...@@ -1763,7 +1763,7 @@ static int bnxt_get_rxfh(struct net_device *dev, ...@@ -1763,7 +1763,7 @@ static int bnxt_get_rxfh(struct net_device *dev,
if (!bp->vnic_info) if (!bp->vnic_info)
return 0; return 0;
vnic = &bp->vnic_info[0]; vnic = &bp->vnic_info[BNXT_VNIC_DEFAULT];
if (rxfh->indir && bp->rss_indir_tbl) { if (rxfh->indir && bp->rss_indir_tbl) {
tbl_size = bnxt_get_rxfh_indir_size(dev); tbl_size = bnxt_get_rxfh_indir_size(dev);
for (i = 0; i < tbl_size; i++) for (i = 0; i < tbl_size; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment