public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues
@ 2026-01-29  6:16 Michael Chan
  2026-01-29  6:16 ` [PATCH net 1/4] bnxt_en: Fix RSS context delete logic Michael Chan
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Michael Chan @ 2026-01-29  6:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek

The first patch fixes the problem of ifup failing if one or more RSS
contexts were previously created.  The 2nd patch is a cleanup patch
required by the 3rd patch which fixes ntuple filter deletion errors
in ifdown state.  The 4th patch adds self tests to cover these failure
cases.

Pavan Chebbi (4):
  bnxt_en: Fix RSS context delete logic
  bnxt_en: Don't overload fw_vnic_id for RSS context's filters
  bnxt_en: Fix deleting of Ntuple filters
  selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |  28 +++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h     |   3 +-
 .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  12 +-
 .../selftests/drivers/net/hw/rss_ctx.py       | 117 +++++++++++++++++-
 4 files changed, 141 insertions(+), 19 deletions(-)

-- 
2.51.0


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

* [PATCH net 1/4] bnxt_en: Fix RSS context delete logic
  2026-01-29  6:16 [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues Michael Chan
@ 2026-01-29  6:16 ` Michael Chan
  2026-01-29  6:16 ` [PATCH net 2/4] bnxt_en: Don't overload fw_vnic_id for RSS context's filters Michael Chan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Michael Chan @ 2026-01-29  6:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek, Jakub Kicinski

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

We need to free the corresponding RSS context VNIC
in FW everytime an RSS context is deleted in driver.
Commit 667ac333dbb7 added a check to delete the VNIC
in FW only when netif_running() is true to help delete
RSS contexts with interface down.

Having that condition will make the driver leak VNICs
in FW whenever close() happens with active RSS contexts.
On the subsequent open(), as part of RSS context restoration,
we will end up trying to create extra VNICs for which we
did not make any reservation. FW can fail this request,
thereby making us lose active RSS contexts.

Suppose an RSS context is deleted already and we try to
process a delete request again, then the HWRM functions
will check for validity of the request and they simply
return if the resource is already freed. So, even for
delete-when-down cases, netif_running() check is not
necessary.

Remove the netif_running() condition check when deleting
an RSS context.

Reported-by: Jakub Kicinski <kicinski@meta.com>
Fixes: 667ac333dbb7 ("eth: bnxt: allow deleting RSS contexts when the device is down")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 8419d1eb4035..64832289e18d 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -10827,12 +10827,10 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
 	struct bnxt_ntuple_filter *ntp_fltr;
 	int i;
 
-	if (netif_running(bp->dev)) {
-		bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
-		for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
-			if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
-				bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
-		}
+	bnxt_hwrm_vnic_free_one(bp, &rss_ctx->vnic);
+	for (i = 0; i < BNXT_MAX_CTX_PER_VNIC; i++) {
+		if (vnic->fw_rss_cos_lb_ctx[i] != INVALID_HW_RING_ID)
+			bnxt_hwrm_vnic_ctx_free_one(bp, vnic, i);
 	}
 	if (!all)
 		return;
-- 
2.51.0


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

* [PATCH net 2/4] bnxt_en: Don't overload fw_vnic_id for RSS context's filters
  2026-01-29  6:16 [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues Michael Chan
  2026-01-29  6:16 ` [PATCH net 1/4] bnxt_en: Fix RSS context delete logic Michael Chan
@ 2026-01-29  6:16 ` Michael Chan
  2026-01-29  6:16 ` [PATCH net 3/4] bnxt_en: Fix deleting of Ntuple filters Michael Chan
  2026-01-29  6:16 ` [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up Michael Chan
  3 siblings, 0 replies; 14+ messages in thread
From: Michael Chan @ 2026-01-29  6:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

Currently the ntuple filters installed for an RSS context
use the ntuple filter's base member 'fw_vnic_id' to save the
RSS context id. This is making the fw_vnic_id overloaded when it
is being used with RSS context. This is very confusing.

Make explicit provision to save rss_ctx_id in the ntuple filter
so that we can avoid overloading fw_vnic_id.
Also remove unnecessary initialization of the id to 0.

This cleanup is necessary for the next patch that will remove
the fw_vnic_id field.

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 4 ++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         | 1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 5 ++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 64832289e18d..6fae0490bc1c 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6259,7 +6259,7 @@ bnxt_cfg_rfs_ring_tbl_idx(struct bnxt *bp,
 		struct bnxt_vnic_info *vnic;
 
 		ctx = xa_load(&bp->dev->ethtool->rss_ctx,
-			      fltr->base.fw_vnic_id);
+			      fltr->base.rss_ctx_id);
 		if (ctx) {
 			rss_ctx = ethtool_rxfh_context_priv(ctx);
 			vnic = &rss_ctx->vnic;
@@ -10837,7 +10837,7 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
 
 	list_for_each_entry_safe(usr_fltr, tmp, &bp->usr_fltr_list, list) {
 		if ((usr_fltr->flags & BNXT_ACT_RSS_CTX) &&
-		    usr_fltr->fw_vnic_id == rss_ctx->index) {
+		    usr_fltr->rss_ctx_id == rss_ctx->index) {
 			ntp_fltr = container_of(usr_fltr,
 						struct bnxt_ntuple_filter,
 						base);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index f88e7769a838..e2d52841fa86 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1425,6 +1425,7 @@ struct bnxt_filter_base {
 	u16			sw_id;
 	u16			rxq;
 	u16			fw_vnic_id;
+	u16			rss_ctx_id;
 	u16			vf_idx;
 	unsigned long		state;
 #define BNXT_FLTR_VALID		0
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 068e191ede19..8fd0e06ef2a7 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1219,7 +1219,7 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd)
 		fs->ring_cookie = RX_CLS_FLOW_DISC;
 	} else if (fltr->base.flags & BNXT_ACT_RSS_CTX) {
 		fs->flow_type |= FLOW_RSS;
-		cmd->rss_context = fltr->base.fw_vnic_id;
+		cmd->rss_context = fltr->base.rss_ctx_id;
 	} else {
 		fs->ring_cookie = fltr->base.rxq;
 	}
@@ -1468,11 +1468,10 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp,
 	if (fs->flow_type & FLOW_RSS) {
 		struct bnxt_rss_ctx *rss_ctx;
 
-		new_fltr->base.fw_vnic_id = 0;
 		new_fltr->base.flags |= BNXT_ACT_RSS_CTX;
 		rss_ctx = bnxt_get_rss_ctx_from_index(bp, cmd->rss_context);
 		if (rss_ctx) {
-			new_fltr->base.fw_vnic_id = rss_ctx->index;
+			new_fltr->base.rss_ctx_id = rss_ctx->index;
 		} else {
 			rc = -EINVAL;
 			goto ntuple_err;
-- 
2.51.0


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

* [PATCH net 3/4] bnxt_en: Fix deleting of Ntuple filters
  2026-01-29  6:16 [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues Michael Chan
  2026-01-29  6:16 ` [PATCH net 1/4] bnxt_en: Fix RSS context delete logic Michael Chan
  2026-01-29  6:16 ` [PATCH net 2/4] bnxt_en: Don't overload fw_vnic_id for RSS context's filters Michael Chan
@ 2026-01-29  6:16 ` Michael Chan
  2026-01-29  6:16 ` [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up Michael Chan
  3 siblings, 0 replies; 14+ messages in thread
From: Michael Chan @ 2026-01-29  6:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

Ntuple filters can be deleted when the interface
is down. The current code blindly sends the filter
delete command to FW. When the interface is down, all
the VNICs are deleted in the FW. When the VNIC is
freed in the FW, all the associated filters are also
freed. We need not send the free command explicitly.
Sending such command will generate FW error in the
dmesg.

In order to fix this, save a pointer to the corresponding
VNIC of an Ntuple filter in the ntuple filter's base
structure. Use this pointer to check if the VNIC is
already freed whenever we are freeing the Ntuple filters.
Now that we have access to the vnic itself, remove the
redundant reference to fw_vnic_id from all places.

Fixes: 8336a974f37d ("bnxt_en: Save user configured filters in a lookup list")
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c         | 14 ++++++++++++--
 drivers/net/ethernet/broadcom/bnxt/bnxt.h         |  2 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c |  7 +++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 6fae0490bc1c..6ec173a25332 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -6156,6 +6156,7 @@ int bnxt_hwrm_l2_filter_alloc(struct bnxt *bp, struct bnxt_l2_filter *fltr)
 {
 	struct hwrm_cfa_l2_filter_alloc_output *resp;
 	struct hwrm_cfa_l2_filter_alloc_input *req;
+	u16 dst_id = INVALID_HW_RING_ID;
 	u16 target_id = 0xffff;
 	int rc;
 
@@ -6177,7 +6178,10 @@ int bnxt_hwrm_l2_filter_alloc(struct bnxt *bp, struct bnxt_l2_filter *fltr)
 	if (!BNXT_CHIP_TYPE_NITRO_A0(bp))
 		req->flags |=
 			cpu_to_le32(CFA_L2_FILTER_ALLOC_REQ_FLAGS_OUTERMOST);
-	req->dst_id = cpu_to_le16(fltr->base.fw_vnic_id);
+
+	if (fltr->base.vnic)
+		dst_id = fltr->base.vnic->fw_vnic_id;
+	req->dst_id = cpu_to_le16(dst_id);
 	req->enables =
 		cpu_to_le32(CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR |
 			    CFA_L2_FILTER_ALLOC_REQ_ENABLES_DST_ID |
@@ -6212,6 +6216,9 @@ int bnxt_hwrm_cfa_ntuple_filter_free(struct bnxt *bp,
 	int rc;
 
 	set_bit(BNXT_FLTR_FW_DELETED, &fltr->base.state);
+	if (fltr->base.vnic->fw_vnic_id == INVALID_HW_RING_ID)
+		return 0;
+
 	rc = hwrm_req_init(bp, req, HWRM_CFA_NTUPLE_FILTER_FREE);
 	if (rc)
 		return rc;
@@ -6263,6 +6270,7 @@ bnxt_cfg_rfs_ring_tbl_idx(struct bnxt *bp,
 		if (ctx) {
 			rss_ctx = ethtool_rxfh_context_priv(ctx);
 			vnic = &rss_ctx->vnic;
+			fltr->base.vnic = vnic;
 
 			req->dst_id = cpu_to_le16(vnic->fw_vnic_id);
 		}
@@ -6273,6 +6281,7 @@ bnxt_cfg_rfs_ring_tbl_idx(struct bnxt *bp,
 		u32 enables;
 
 		vnic = &bp->vnic_info[BNXT_VNIC_NTUPLE];
+		fltr->base.vnic = vnic;
 		req->dst_id = cpu_to_le16(vnic->fw_vnic_id);
 		enables = CFA_NTUPLE_FILTER_ALLOC_REQ_ENABLES_RFS_RING_TBL_IDX;
 		req->enables |= cpu_to_le32(enables);
@@ -6311,6 +6320,7 @@ int bnxt_hwrm_cfa_ntuple_filter_alloc(struct bnxt *bp,
 		bnxt_cfg_rfs_ring_tbl_idx(bp, req, fltr);
 	} else {
 		vnic = &bp->vnic_info[fltr->base.rxq + 1];
+		fltr->base.vnic = vnic;
 		req->dst_id = cpu_to_le16(vnic->fw_vnic_id);
 	}
 	req->enables |= cpu_to_le32(BNXT_NTP_FLTR_FLAGS);
@@ -6365,7 +6375,7 @@ static int bnxt_hwrm_set_vnic_filter(struct bnxt *bp, u16 vnic_id, u16 idx,
 	if (IS_ERR(fltr))
 		return PTR_ERR(fltr);
 
-	fltr->base.fw_vnic_id = bp->vnic_info[vnic_id].fw_vnic_id;
+	fltr->base.vnic = &bp->vnic_info[vnic_id];
 	rc = bnxt_hwrm_l2_filter_alloc(bp, fltr);
 	if (rc)
 		bnxt_del_l2_filter(bp, fltr);
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index e2d52841fa86..fd7201283364 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -1424,9 +1424,9 @@ struct bnxt_filter_base {
 #define BNXT_ACT_RSS_CTX	0x10
 	u16			sw_id;
 	u16			rxq;
-	u16			fw_vnic_id;
 	u16			rss_ctx_id;
 	u16			vf_idx;
+	struct bnxt_vnic_info	*vnic;
 	unsigned long		state;
 #define BNXT_FLTR_VALID		0
 #define BNXT_FLTR_INSERTED	1
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
index 8fd0e06ef2a7..f8aacd2822f9 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
@@ -1267,9 +1267,9 @@ static int bnxt_add_l2_cls_rule(struct bnxt *bp,
 	u8 vf = ethtool_get_flow_spec_ring_vf(fs->ring_cookie);
 	struct ethhdr *h_ether = &fs->h_u.ether_spec;
 	struct ethhdr *m_ether = &fs->m_u.ether_spec;
+	struct bnxt_vnic_info *vnic = NULL;
 	struct bnxt_l2_filter *fltr;
 	struct bnxt_l2_key key;
-	u16 vnic_id;
 	u8 flags;
 	int rc;
 
@@ -1291,17 +1291,16 @@ static int bnxt_add_l2_cls_rule(struct bnxt *bp,
 
 	if (vf) {
 		flags = BNXT_ACT_FUNC_DST;
-		vnic_id = 0xffff;
 		vf--;
 	} else {
 		flags = BNXT_ACT_RING_DST;
-		vnic_id = bp->vnic_info[ring + 1].fw_vnic_id;
+		vnic = &bp->vnic_info[ring + 1];
 	}
 	fltr = bnxt_alloc_new_l2_filter(bp, &key, flags);
 	if (IS_ERR(fltr))
 		return PTR_ERR(fltr);
 
-	fltr->base.fw_vnic_id = vnic_id;
+	fltr->base.vnic = vnic;
 	fltr->base.rxq = ring;
 	fltr->base.vf_idx = vf;
 	rc = bnxt_hwrm_l2_filter_alloc(bp, fltr);
-- 
2.51.0


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

* [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-29  6:16 [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues Michael Chan
                   ` (2 preceding siblings ...)
  2026-01-29  6:16 ` [PATCH net 3/4] bnxt_en: Fix deleting of Ntuple filters Michael Chan
@ 2026-01-29  6:16 ` Michael Chan
  2026-01-29 20:19   ` Joe Damato
  2026-01-30  2:03   ` Jakub Kicinski
  3 siblings, 2 replies; 14+ messages in thread
From: Michael Chan @ 2026-01-29  6:16 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, kuba, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek

From: Pavan Chebbi <pavan.chebbi@broadcom.com>

Add tests to verify
1. that RSS contexts persist across interface down/up
2. that RSS contexts persist across interface down/up along
with their associated Ntuple fitlers

Testing on bnxt_en:

 TAP version 13
 1..1
 # timeout set to 0
 # selftests: drivers/net/hw: rss_ctx.py
 # TAP version 13
 # 1..2
 # ok 1 rss_ctx.test_rss_context_persist_ifupdown
 # ok 2 rss_ctx.test_rss_context_ntuple_persist_ifupdown
 # # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
 ok 1 selftests: drivers/net/hw: rss_ctx.py

Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
---
 .../selftests/drivers/net/hw/rss_ctx.py       | 117 +++++++++++++++++-
 1 file changed, 116 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
index ed7e405682f0..4e46c5931c7f 100755
--- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
+++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
@@ -809,6 +809,119 @@ def test_rss_default_context_rule(cfg):
                           'noise' : (0, 1) })
 
 
+def test_rss_context_persist_ifupdown(cfg):
+    """
+    Check that RSS contexts persist across an interface down/up cycle.
+    """
+
+    require_context_cnt(cfg, 10)
+
+    # Create 10 RSS contexts and store their IDs and configurations
+    ctx_ids = []
+    ctx_configs_before = {}
+    try:
+        for i in range(10):
+            ctx_id = ethtool_create(cfg, "-X", "context new")
+            ctx_ids.append(ctx_id)
+            defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
+    except CmdExitFailure:
+        raise KsftSkipEx(f"Could only create {len(ctx_ids)} contexts, test requires 10")
+
+    # Bring interface down
+    ip(f"link set dev {cfg.ifname} down")
+
+    # Bring interface back up
+    ip(f"link set dev {cfg.ifname} up")
+
+    # Wait for interface to be fully up
+    cfg.wait_hw_stats_settle()
+
+    # Verify all 10 contexts still exist after ifup
+    missing_contexts = []
+    persisted_contexts = []
+
+    for ctx_id in ctx_ids:
+        try:
+            data = get_rss(cfg, context=ctx_id)
+            _rss_key_check(cfg, data=data, context=ctx_id)
+            persisted_contexts.append(ctx_id)
+        except CmdExitFailure:
+            missing_contexts.append(ctx_id)
+            ksft_pr(f"Context {ctx_id} is missing after ifup")
+
+
+def test_rss_context_ntuple_persist_ifupdown(cfg):
+    """
+    Test that RSS contexts and their associated ntuple filters persist across
+    an interface down/up cycle.
+    """
+
+    require_ntuple(cfg)
+    require_context_cnt(cfg, 10)
+
+    # Create 10 RSS contexts with ntuple filters
+    ctx_ids = []
+    ntuple_ids = []
+    ports = []
+
+    try:
+        for i in range(10):
+            # Create RSS context
+            ctx_id = ethtool_create(cfg, "-X", "context new")
+            ctx_ids.append(ctx_id)
+            defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
+
+            # Create ntuple filter for this context
+            port = rand_port()
+            ports.append(port)
+            flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
+            ntuple_id = ethtool_create(cfg, "-N", flow)
+            ntuple_ids.append(ntuple_id)
+            defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
+
+    except CmdExitFailure:
+        raise KsftSkipEx(f"Could only create {len(ctx_ids)} contexts with ntuple filters, test requires 10")
+
+    # Bring interface down
+    ip(f"link set dev {cfg.ifname} down")
+
+    # Bring interface back up
+    ip(f"link set dev {cfg.ifname} up")
+
+    # Wait for interface to be fully up
+    cfg.wait_hw_stats_settle()
+
+    # Verify all contexts and ntuple rules still exist after ifup
+    missing_contexts = []
+    persisted_contexts = []
+    missing_ntuple_rules = []
+    persisted_ntuple_rules = []
+    broken_associations = []
+
+    for i, ctx_id in enumerate(ctx_ids):
+        # Check if context persists
+        try:
+            data = get_rss(cfg, context=ctx_id)
+            _rss_key_check(cfg, data=data, context=ctx_id)
+            persisted_contexts.append(ctx_id)
+        except CmdExitFailure:
+            missing_contexts.append(ctx_id)
+            ksft_pr(f"Context {ctx_id} is missing after ifup")
+            continue
+
+        # Check if ntuple rule persists
+        ntuple_id = ntuple_ids[i]
+        try:
+            _ntuple_rule_check(cfg, ntuple_id, ctx_id)
+            persisted_ntuple_rules.append(ntuple_id)
+        except CmdExitFailure:
+            missing_ntuple_rules.append(ntuple_id)
+            ksft_pr(f"Ntuple rule {ntuple_id} is missing after ifup")
+        except Exception as e:
+            broken_associations.append((ntuple_id, ctx_id))
+            ksft_pr(f"Ntuple rule {ntuple_id} exists but is not properly associated with context {ctx_id}: {e}")
+
+
 def main() -> None:
     with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
         cfg.context_cnt = None
@@ -823,7 +936,9 @@ def main() -> None:
                   test_rss_context_out_of_order, test_rss_context4_create_with_cfg,
                   test_flow_add_context_missing,
                   test_delete_rss_context_busy, test_rss_ntuple_addition,
-                  test_rss_default_context_rule],
+                  test_rss_default_context_rule,
+                  test_rss_context_persist_ifupdown,
+                  test_rss_context_ntuple_persist_ifupdown],
                  args=(cfg, ))
     ksft_exit()
 
-- 
2.51.0


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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-29  6:16 ` [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up Michael Chan
@ 2026-01-29 20:19   ` Joe Damato
  2026-01-29 23:58     ` Jakub Kicinski
  2026-01-30  2:03   ` Jakub Kicinski
  1 sibling, 1 reply; 14+ messages in thread
From: Joe Damato @ 2026-01-29 20:19 UTC (permalink / raw)
  To: Michael Chan
  Cc: davem, netdev, edumazet, kuba, pabeni, andrew+netdev,
	pavan.chebbi, andrew.gospodarek

On Wed, Jan 28, 2026 at 10:16:46PM -0800, Michael Chan wrote:
> From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> 
> Add tests to verify
> 1. that RSS contexts persist across interface down/up
> 2. that RSS contexts persist across interface down/up along
> with their associated Ntuple fitlers
> 
> Testing on bnxt_en:
> 
>  TAP version 13
>  1..1
>  # timeout set to 0
>  # selftests: drivers/net/hw: rss_ctx.py
>  # TAP version 13
>  # 1..2
>  # ok 1 rss_ctx.test_rss_context_persist_ifupdown
>  # ok 2 rss_ctx.test_rss_context_ntuple_persist_ifupdown
>  # # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
>  ok 1 selftests: drivers/net/hw: rss_ctx.py
> 
> Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
> Signed-off-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>
> ---
>  .../selftests/drivers/net/hw/rss_ctx.py       | 117 +++++++++++++++++-
>  1 file changed, 116 insertions(+), 1 deletion(-)

I feel like this one might be net-next material since it is a new test and not
a "Fixes" ?

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-29 20:19   ` Joe Damato
@ 2026-01-29 23:58     ` Jakub Kicinski
  0 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2026-01-29 23:58 UTC (permalink / raw)
  To: Joe Damato
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	pavan.chebbi, andrew.gospodarek

On Thu, 29 Jan 2026 12:19:35 -0800 Joe Damato wrote:
> >  .../selftests/drivers/net/hw/rss_ctx.py       | 117 +++++++++++++++++-
> >  1 file changed, 116 insertions(+), 1 deletion(-)  
> 
> I feel like this one might be net-next material since it is a new test and not
> a "Fixes" ?

Quoting documentation:

  Co-posting selftests
  ~~~~~~~~~~~~~~~~~~~~
  
  Selftests should be part of the same series as the code changes.
  Specifically for fixes both code change and related test should go into
  the same tree (the tests may lack a Fixes tag, which is expected).
  Mixing code changes and test changes in a single commit is discouraged.
  
See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#co-posting-selftests

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-29  6:16 ` [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up Michael Chan
  2026-01-29 20:19   ` Joe Damato
@ 2026-01-30  2:03   ` Jakub Kicinski
  2026-01-30  3:52     ` Pavan Chebbi
                       ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Jakub Kicinski @ 2026-01-30  2:03 UTC (permalink / raw)
  To: Michael Chan
  Cc: davem, netdev, edumazet, pabeni, andrew+netdev, pavan.chebbi,
	andrew.gospodarek

On Wed, 28 Jan 2026 22:16:46 -0800 Michael Chan wrote:
> From: Pavan Chebbi <pavan.chebbi@broadcom.com>
> 
> Add tests to verify
> 1. that RSS contexts persist across interface down/up
> 2. that RSS contexts persist across interface down/up along
> with their associated Ntuple fitlers
> 
> Testing on bnxt_en:
> 
>  TAP version 13
>  1..1
>  # timeout set to 0
>  # selftests: drivers/net/hw: rss_ctx.py
>  # TAP version 13
>  # 1..2
>  # ok 1 rss_ctx.test_rss_context_persist_ifupdown
>  # ok 2 rss_ctx.test_rss_context_ntuple_persist_ifupdown
>  # # Totals: pass:2 fail:0 xfail:0 xpass:0 skip:0 error:0
>  ok 1 selftests: drivers/net/hw: rss_ctx.py

Thanks for the test. Please make sure that

  ruff check $file

is clean

> diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> index ed7e405682f0..4e46c5931c7f 100755
> --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py
> @@ -809,6 +809,119 @@ def test_rss_default_context_rule(cfg):
>                            'noise' : (0, 1) })
>  
>  

Please put

@ksft_disruptive

decorator before test cases which may disconnect the machine (take the
link down). We won't be able to run them remotely 

> +def test_rss_context_persist_ifupdown(cfg):
> +    """
> +    Check that RSS contexts persist across an interface down/up cycle.
> +    """
> +
> +    require_context_cnt(cfg, 10)

Why 10? I don't think we're gaining any coverage with > 2.

> +    # Create 10 RSS contexts and store their IDs and configurations
> +    ctx_ids = []
> +    ctx_configs_before = {}

appears unused

> +    try:
> +        for i in range(10):
> +            ctx_id = ethtool_create(cfg, "-X", "context new")
> +            ctx_ids.append(ctx_id)
> +            defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
> +    except CmdExitFailure:
> +        raise KsftSkipEx(f"Could only create {len(ctx_ids)} contexts, test requires 10")
> +
> +    # Bring interface down

these comments are pointless and make the whole thing look AI generated

> +    ip(f"link set dev {cfg.ifname} down")
> +
> +    # Bring interface back up
> +    ip(f"link set dev {cfg.ifname} up")
> +
> +    # Wait for interface to be fully up
> +    cfg.wait_hw_stats_settle()

Why?

> +    # Verify all 10 contexts still exist after ifup
> +    missing_contexts = []
> +    persisted_contexts = []
> +
> +    for ctx_id in ctx_ids:
> +        try:
> +            data = get_rss(cfg, context=ctx_id)
> +            _rss_key_check(cfg, data=data, context=ctx_id)
> +            persisted_contexts.append(ctx_id)
> +        except CmdExitFailure:
> +            missing_contexts.append(ctx_id)
> +            ksft_pr(f"Context {ctx_id} is missing after ifup")

You can use netlink to get them all

ctxs = cfg.ethnl.rss_get({}, dump=True)

> +def test_rss_context_ntuple_persist_ifupdown(cfg):
> +    """
> +    Test that RSS contexts and their associated ntuple filters persist across
> +    an interface down/up cycle.
> +    """
> +
> +    require_ntuple(cfg)
> +    require_context_cnt(cfg, 10)
> +
> +    # Create 10 RSS contexts with ntuple filters
> +    ctx_ids = []
> +    ntuple_ids = []
> +    ports = []
> +
> +    try:
> +        for i in range(10):
> +            # Create RSS context
> +            ctx_id = ethtool_create(cfg, "-X", "context new")
> +            ctx_ids.append(ctx_id)
> +            defer(ethtool, f"-X {cfg.ifname} context {ctx_id} delete")
> +
> +            # Create ntuple filter for this context
> +            port = rand_port()
> +            ports.append(port)
> +            flow = f"flow-type tcp{cfg.addr_ipver} dst-ip {cfg.addr} dst-port {port} context {ctx_id}"
> +            ntuple_id = ethtool_create(cfg, "-N", flow)
> +            ntuple_ids.append(ntuple_id)
> +            defer(ethtool, f"-N {cfg.ifname} delete {ntuple_id}")
> +
> +    except CmdExitFailure:
> +        raise KsftSkipEx(f"Could only create {len(ctx_ids)} contexts with ntuple filters, test requires 10")
> +
> +    # Bring interface down
> +    ip(f"link set dev {cfg.ifname} down")
> +
> +    # Bring interface back up
> +    ip(f"link set dev {cfg.ifname} up")
> +
> +    # Wait for interface to be fully up
> +    cfg.wait_hw_stats_settle()
> +
> +    # Verify all contexts and ntuple rules still exist after ifup
> +    missing_contexts = []
> +    persisted_contexts = []
> +    missing_ntuple_rules = []
> +    persisted_ntuple_rules = []
> +    broken_associations = []
> +
> +    for i, ctx_id in enumerate(ctx_ids):
> +        # Check if context persists
> +        try:
> +            data = get_rss(cfg, context=ctx_id)
> +            _rss_key_check(cfg, data=data, context=ctx_id)
> +            persisted_contexts.append(ctx_id)
> +        except CmdExitFailure:
> +            missing_contexts.append(ctx_id)
> +            ksft_pr(f"Context {ctx_id} is missing after ifup")
> +            continue
> +
> +        # Check if ntuple rule persists
> +        ntuple_id = ntuple_ids[i]
> +        try:
> +            _ntuple_rule_check(cfg, ntuple_id, ctx_id)
> +            persisted_ntuple_rules.append(ntuple_id)
> +        except CmdExitFailure:
> +            missing_ntuple_rules.append(ntuple_id)
> +            ksft_pr(f"Ntuple rule {ntuple_id} is missing after ifup")
> +        except Exception as e:
> +            broken_associations.append((ntuple_id, ctx_id))
> +            ksft_pr(f"Ntuple rule {ntuple_id} exists but is not properly associated with context {ctx_id}: {e}")

Not sure why this is a separate test, TBH. You can remove the test
without the ntuple filters. The two cases I would have expected based
on patches is:

tests1:
 - add a couple of contexts
 - add a n-tuple filter to one of the context
 - ifdown/ifup
 - check contexts and filters are there
 - run some traffic to make sure it flows right

tests2:
 - ifdown
 - add a couple of contexts
 - add a n-tuple filter to one of the context
 - ifup
 - check contexts and filters are there
 - run some traffic to make sure it flows right

You can probably have one shared implementation and pass a param to 
it  to tell it whether to "pre-down" the interface.
-- 
pw-bot: cr

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-30  2:03   ` Jakub Kicinski
@ 2026-01-30  3:52     ` Pavan Chebbi
  2026-01-30  5:24     ` Pavan Chebbi
  2026-02-04 16:15     ` Pavan Chebbi
  2 siblings, 0 replies; 14+ messages in thread
From: Pavan Chebbi @ 2026-01-30  3:52 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

> Not sure why this is a separate test, TBH. You can remove the test
> without the ntuple filters. The two cases I would have expected based
> on patches is:
>
> tests1:
>  - add a couple of contexts
>  - add a n-tuple filter to one of the context
>  - ifdown/ifup
>  - check contexts and filters are there
>  - run some traffic to make sure it flows right
>
> tests2:
>  - ifdown
>  - add a couple of contexts
>  - add a n-tuple filter to one of the context
>  - ifup
>  - check contexts and filters are there
>  - run some traffic to make sure it flows right
>

Very smart, thanks! When I see such beautiful solutions I curse myself
for not thinking about it in the first place.

> You can probably have one shared implementation and pass a param to
> it  to tell it whether to "pre-down" the interface.

Yes, Michael also did bring this point up that there is a lot of
shared code between the tests, but I tried to test my luck.
Will be back with a v2. Thanks.

> --
> pw-bot: cr

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-30  2:03   ` Jakub Kicinski
  2026-01-30  3:52     ` Pavan Chebbi
@ 2026-01-30  5:24     ` Pavan Chebbi
  2026-01-30 16:09       ` Jakub Kicinski
  2026-02-04 16:15     ` Pavan Chebbi
  2 siblings, 1 reply; 14+ messages in thread
From: Pavan Chebbi @ 2026-01-30  5:24 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

>
> tests1:
>  - add a couple of contexts
>  - add a n-tuple filter to one of the context
>  - ifdown/ifup
>  - check contexts and filters are there
>  - run some traffic to make sure it flows right
>
> tests2:
>  - ifdown
>  - add a couple of contexts

BTW, bnxt won't support adding contexts when if is down. I could still
add the test..

>  - add a n-tuple filter to one of the context
>  - ifup
>  - check contexts and filters are there
>  - run some traffic to make sure it flows right
>
> You can probably have one shared implementation and pass a param to
> it  to tell it whether to "pre-down" the interface.
> --
> pw-bot: cr

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-30  5:24     ` Pavan Chebbi
@ 2026-01-30 16:09       ` Jakub Kicinski
  0 siblings, 0 replies; 14+ messages in thread
From: Jakub Kicinski @ 2026-01-30 16:09 UTC (permalink / raw)
  To: Pavan Chebbi
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

On Fri, 30 Jan 2026 10:54:42 +0530 Pavan Chebbi wrote:
> > tests1:
> >  - add a couple of contexts
> >  - add a n-tuple filter to one of the context
> >  - ifdown/ifup
> >  - check contexts and filters are there
> >  - run some traffic to make sure it flows right
> >
> > tests2:
> >  - ifdown
> >  - add a couple of contexts  
> 
> BTW, bnxt won't support adding contexts when if is down. I could still
> add the test..

I see. Yes, please still add the test. You can just let it fail, no
need to catch exceptions and re-raise SKIP unless you really want to.
The HW tests are expected to be automatically ignored if they never pass
for a given platform. We're primarily looking for regressions and
crashes.

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-01-30  2:03   ` Jakub Kicinski
  2026-01-30  3:52     ` Pavan Chebbi
  2026-01-30  5:24     ` Pavan Chebbi
@ 2026-02-04 16:15     ` Pavan Chebbi
  2026-02-05  2:09       ` Jakub Kicinski
  2 siblings, 1 reply; 14+ messages in thread
From: Pavan Chebbi @ 2026-02-04 16:15 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

> > +
> > +    for ctx_id in ctx_ids:
> > +        try:
> > +            data = get_rss(cfg, context=ctx_id)
> > +            _rss_key_check(cfg, data=data, context=ctx_id)
> > +            persisted_contexts.append(ctx_id)
> > +        except CmdExitFailure:
> > +            missing_contexts.append(ctx_id)
> > +            ksft_pr(f"Context {ctx_id} is missing after ifup")
>
> You can use netlink to get them all
>
> ctxs = cfg.ethnl.rss_get({}, dump=True)

Jakub, maybe it's a rookie question but I am having trouble getting
the netlink call to work.
Not sure if my analysis is right but it looks like I don't have the
right schema..
It appears like the decode does not ignore unsupported ethnl options?
I always get the error:

# Error decoding 'input-xfrm' from 'rss'

with the below call stack:

# # Exception| Traceback (most recent call last):
# # Exception|   File "/tmp/ksft-net-drv/net/lib/py/ksft.py", line
319, in ksft_run
# # Exception|     func(*args)
# # Exception|   File "/tmp/ksft-net-drv/drivers/net/hw/./rss_ctx.py",
line 395, in test_rss_context_dump
# # Exception|     ctxs = cfg.ethnl.rss_get({}, dump=True)
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1159, in _op
# # Exception|     return self._ops(ops)[0]
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1146, in _ops
# # Exception|     rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name)
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 814, in _decode
# # Exception|     decoded = self._decode_enum(decoded, attr_spec)
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 672, in
_decode_enum
# # Exception|     value.add(self._get_enum_or_unknown(enum, i))
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 662, in
_get_enum_or_unknown
# # Exception|     raise error
# # Exception|   File
"/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 657, in
_get_enum_or_unknown
# # Exception|     name = enum.entries_by_val[raw].name
# # Exception| KeyError: 2

Do you think I am missing some config?

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-02-04 16:15     ` Pavan Chebbi
@ 2026-02-05  2:09       ` Jakub Kicinski
  2026-02-05  5:41         ` Pavan Chebbi
  0 siblings, 1 reply; 14+ messages in thread
From: Jakub Kicinski @ 2026-02-05  2:09 UTC (permalink / raw)
  To: Pavan Chebbi
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

On Wed, 4 Feb 2026 21:45:12 +0530 Pavan Chebbi wrote:
> > > +
> > > +    for ctx_id in ctx_ids:
> > > +        try:
> > > +            data = get_rss(cfg, context=ctx_id)
> > > +            _rss_key_check(cfg, data=data, context=ctx_id)
> > > +            persisted_contexts.append(ctx_id)
> > > +        except CmdExitFailure:
> > > +            missing_contexts.append(ctx_id)
> > > +            ksft_pr(f"Context {ctx_id} is missing after ifup")  
> >
> > You can use netlink to get them all
> >
> > ctxs = cfg.ethnl.rss_get({}, dump=True)  
> 
> Jakub, maybe it's a rookie question but I am having trouble getting
> the netlink call to work.
> Not sure if my analysis is right but it looks like I don't have the
> right schema..
> It appears like the decode does not ignore unsupported ethnl options?
> I always get the error:
> 
> # Error decoding 'input-xfrm' from 'rss'
> 
> with the below call stack:
> 
> # # Exception| Traceback (most recent call last):
> # # Exception|   File "/tmp/ksft-net-drv/net/lib/py/ksft.py", line
> 319, in ksft_run
> # # Exception|     func(*args)
> # # Exception|   File "/tmp/ksft-net-drv/drivers/net/hw/./rss_ctx.py",
> line 395, in test_rss_context_dump
> # # Exception|     ctxs = cfg.ethnl.rss_get({}, dump=True)
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1159, in _op
> # # Exception|     return self._ops(ops)[0]
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1146, in _ops
> # # Exception|     rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name)
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 814, in _decode
> # # Exception|     decoded = self._decode_enum(decoded, attr_spec)
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 672, in
> _decode_enum
> # # Exception|     value.add(self._get_enum_or_unknown(enum, i))
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 662, in
> _get_enum_or_unknown
> # # Exception|     raise error
> # # Exception|   File
> "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 657, in
> _get_enum_or_unknown
> # # Exception|     name = enum.entries_by_val[raw].name
> # # Exception| KeyError: 2
> 
> Do you think I am missing some config?

Ah! I think you run into what I recently fixed in net.
Could you try with 1c172febdf065375 cherry-picked to your tree?
It's sitting in net, hasn't reached net-next yet.
Sorry about that..

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

* Re: [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up
  2026-02-05  2:09       ` Jakub Kicinski
@ 2026-02-05  5:41         ` Pavan Chebbi
  0 siblings, 0 replies; 14+ messages in thread
From: Pavan Chebbi @ 2026-02-05  5:41 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Michael Chan, davem, netdev, edumazet, pabeni, andrew+netdev,
	andrew.gospodarek

[-- Attachment #1: Type: text/plain, Size: 2694 bytes --]

On Thu, Feb 5, 2026 at 7:39 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 4 Feb 2026 21:45:12 +0530 Pavan Chebbi wrote:
> > > > +
> > > > +    for ctx_id in ctx_ids:
> > > > +        try:
> > > > +            data = get_rss(cfg, context=ctx_id)
> > > > +            _rss_key_check(cfg, data=data, context=ctx_id)
> > > > +            persisted_contexts.append(ctx_id)
> > > > +        except CmdExitFailure:
> > > > +            missing_contexts.append(ctx_id)
> > > > +            ksft_pr(f"Context {ctx_id} is missing after ifup")
> > >
> > > You can use netlink to get them all
> > >
> > > ctxs = cfg.ethnl.rss_get({}, dump=True)
> >
> > Jakub, maybe it's a rookie question but I am having trouble getting
> > the netlink call to work.
> > Not sure if my analysis is right but it looks like I don't have the
> > right schema..
> > It appears like the decode does not ignore unsupported ethnl options?
> > I always get the error:
> >
> > # Error decoding 'input-xfrm' from 'rss'
> >
> > with the below call stack:
> >
> > # # Exception| Traceback (most recent call last):
> > # # Exception|   File "/tmp/ksft-net-drv/net/lib/py/ksft.py", line
> > 319, in ksft_run
> > # # Exception|     func(*args)
> > # # Exception|   File "/tmp/ksft-net-drv/drivers/net/hw/./rss_ctx.py",
> > line 395, in test_rss_context_dump
> > # # Exception|     ctxs = cfg.ethnl.rss_get({}, dump=True)
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1159, in _op
> > # # Exception|     return self._ops(ops)[0]
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 1146, in _ops
> > # # Exception|     rsp_msg = self._decode(decoded.raw_attrs, op.attr_set.name)
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 814, in _decode
> > # # Exception|     decoded = self._decode_enum(decoded, attr_spec)
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 672, in
> > _decode_enum
> > # # Exception|     value.add(self._get_enum_or_unknown(enum, i))
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 662, in
> > _get_enum_or_unknown
> > # # Exception|     raise error
> > # # Exception|   File
> > "/tmp/ksft-net-drv/net/lib/ynl/pyynl/lib/ynl.py", line 657, in
> > _get_enum_or_unknown
> > # # Exception|     name = enum.entries_by_val[raw].name
> > # # Exception| KeyError: 2
> >
> > Do you think I am missing some config?
>
> Ah! I think you run into what I recently fixed in net.
> Could you try with 1c172febdf065375 cherry-picked to your tree?

Yes, that fixed it! Thanks

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5469 bytes --]

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

end of thread, other threads:[~2026-02-05  5:42 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29  6:16 [PATCH net 0/4] bnxt_en: Fix RSS context and ntuple filter issues Michael Chan
2026-01-29  6:16 ` [PATCH net 1/4] bnxt_en: Fix RSS context delete logic Michael Chan
2026-01-29  6:16 ` [PATCH net 2/4] bnxt_en: Don't overload fw_vnic_id for RSS context's filters Michael Chan
2026-01-29  6:16 ` [PATCH net 3/4] bnxt_en: Fix deleting of Ntuple filters Michael Chan
2026-01-29  6:16 ` [PATCH net 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up Michael Chan
2026-01-29 20:19   ` Joe Damato
2026-01-29 23:58     ` Jakub Kicinski
2026-01-30  2:03   ` Jakub Kicinski
2026-01-30  3:52     ` Pavan Chebbi
2026-01-30  5:24     ` Pavan Chebbi
2026-01-30 16:09       ` Jakub Kicinski
2026-02-04 16:15     ` Pavan Chebbi
2026-02-05  2:09       ` Jakub Kicinski
2026-02-05  5:41         ` Pavan Chebbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox