Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sched: Fix setting last executed chain on skb extension

After driver sets the missed chain on the tc skb extension it is
consumed (deleted) by tc_classify_ingress and tc jumps to that chain.
If tc now misses on this chain (either no match, or no goto action),
then last executed chain remains 0, and the skb extension is not re-added,
and the next datapath (ovs) will start from 0.

Fix that by setting last executed chain to the chain read from the skb
extension, so if there is a miss, we set it back.

Fixes: af699626ee26 ("net: sched: Support specifying a starting chain via tc skb ext")
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Paul Blakey and committed by
David S. Miller
a080da6a a4837980

+1
+1
net/sched/cls_api.c
··· 1667 1667 skb_ext_del(skb, TC_SKB_EXT); 1668 1668 1669 1669 tp = rcu_dereference_bh(fchain->filter_chain); 1670 + last_executed_chain = fchain->index; 1670 1671 } 1671 1672 1672 1673 ret = __tcf_classify(skb, tp, orig_tp, res, compat_mode,