From: Numan Siddique <[email protected]>

Kernel reserves the highest nibble of TCA_CHAIN for extended action
types.  This means we can't offload the recirculations with values
greater than 2^28.  Instead of kernel tc returning the error,
netdev_tc_flow_put() does the check and returns the error.

Reported-at: 
https://mail.openvswitch.org/pipermail/ovs-dev/2025-November/427485.html
Suggested-by: Ilya Maximets <[email protected]>
Signed-off-by: Numan Siddique <[email protected]>
---
 lib/netdev-offload-tc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 9491dc90e..40205d7f8 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -2329,6 +2329,12 @@ netdev_tc_flow_put(struct netdev *netdev, struct match 
*match,
         return -ifindex;
     }
 
+    if (key->recirc_id > TC_ACT_EXT_VAL_MASK) {
+        VLOG_ERR_RL(&error_rl, "flow recirc_id %u can't be used as chain id. "
+                    "It exceeds upper limit", key->recirc_id);
+        return EOPNOTSUPP;
+    }
+
     memset(&flower, 0, sizeof flower);
 
     exact_match_on_dl_type = mask->dl_type == htons(0xffff);
-- 
2.52.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to