Skip to content

Commit 916ec33

Browse files
numansiddiqueigsilya
authored andcommitted
netdev-offload-tc: Make sure tcf_id chain doesn't exceed upper limit.
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 <i.maximets@ovn.org> Acked-by: Eelco Chaudron <echaudro@redhat.com> Signed-off-by: Numan Siddique <numans@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
1 parent 9ad5b9f commit 916ec33

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/netdev-offload-tc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,6 +2269,12 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
22692269
return -ifindex;
22702270
}
22712271

2272+
if (key->recirc_id > TC_ACT_EXT_VAL_MASK) {
2273+
VLOG_DBG_RL(&rl, "flow recirc_id %u exceeds the chain id upper limit",
2274+
key->recirc_id);
2275+
return EOPNOTSUPP;
2276+
}
2277+
22722278
memset(&flower, 0, sizeof flower);
22732279

22742280
exact_match_on_dl_type = mask->dl_type == htons(0xffff);

0 commit comments

Comments
 (0)