History

net-tc: convert tc_from to tc_from_ingress and tc_redirected

The tc_from field fulfills two roles. It encodes whether a packet was redirected by an act_mirred device and, if so, whether act_mirred was called on ingress or egress. Split it into separate fields. The information is needed by the special IFB loop, where packets are taken out of the normal path by act_mirred, forwarded to IFB, then reinjected at their original location (ingress or egress) by IFB. The IFB device cannot use skb->tc_at_ingress, because that may have been overwritten as the packet travels from act_mirred to ifb_xmit, when it passes through tc_classify on the IFB egress path. Cache this value in skb->tc_from_ingress. That field is valid only if a packet arriving at ifb_xmit came from act_mirred. Other packets can be crafted to reach ifb_xmit. These must be dropped. Set tc_redirected on redirection and drop all packets that do not have this bit set. Both fields are set only on cloned skbs in tc actions, so original packet sources do not have to clear the bit when reusing packets (notably, pktgen and octeon).

Willem de Bruijn committed 9 years ago

Commit bc31c901 parent 8dc07fd6 files · +15 −19Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/pkt_cls.h+0−6
@@ -4,12 +4,6 @@ · 3 unmodified lines
44 #include <linux/types.h>
55 #include <linux/pkt_sched.h>
66
7−#ifdef __KERNEL__
8−#define AT_STACK 0x0
9−#define AT_INGRESS 0x1
10−#define AT_EGRESS 0x2
11−#endif
12−
137 /* Action attributes */
148 enum {
159 TCA_ACT_UNSPEC,