Skip to content

Commit 3617604

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 dfa40b7 commit 3617604

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
@@ -2329,6 +2329,12 @@ netdev_tc_flow_put(struct netdev *netdev, struct match *match,
23292329
return -ifindex;
23302330
}
23312331

2332+
if (key->recirc_id > TC_ACT_EXT_VAL_MASK) {
2333+
VLOG_DBG_RL(&rl, "flow recirc_id %u exceeds the chain id upper limit",
2334+
key->recirc_id);
2335+
return EOPNOTSUPP;
2336+
}
2337+
23322338
memset(&flower, 0, sizeof flower);
23332339

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

0 commit comments

Comments
 (0)