David Miller <da...@davemloft.net> wrote: > From: Florian Westphal <f...@strlen.de> > Date: Thu, 6 Jun 2019 14:58:18 +0200 > > >> @@ -827,6 +828,7 @@ struct sk_buff { > >> __u8 tc_at_ingress:1; > >> __u8 tc_redirected:1; > >> __u8 tc_from_ingress:1; > >> + __u8 tc_hop_count:2; > > > > I dislike this, why can't we just use a pcpu counter? > > I understand that it's because the only precise context is per-SKB not > per-cpu doing packet processing. This has been discussed before.
I don't think its worth it, and it won't work with physical-world loops (e.g. a bridge setup with no spanning tree and a closed loop). Also I fear that if we start to do this for tc, we will also have to followup later with more l2 hopcounts for other users, e.g. veth, bridge, ovs, and so on.