diff options
-rw-r--r-- | drivers/net/ifb.c | 13 | ||||
-rw-r--r-- | include/linux/skbuff.h | 5 | ||||
-rw-r--r-- | include/net/sch_generic.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/pkt_cls.h | 6 | ||||
-rw-r--r-- | net/sched/act_mirred.c | 6 | ||||
-rw-r--r-- | net/sched/sch_netem.c | 2 |
6 files changed, 15 insertions, 19 deletions
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index b73b6b6c066b..312fce7302d3 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -78,9 +78,7 @@ static void ifb_ri_tasklet(unsigned long _txp) | |||
78 | } | 78 | } |
79 | 79 | ||
80 | while ((skb = __skb_dequeue(&txp->tq)) != NULL) { | 80 | while ((skb = __skb_dequeue(&txp->tq)) != NULL) { |
81 | u32 from = skb->tc_from; | 81 | skb->tc_redirected = 0; |
82 | |||
83 | skb_reset_tc(skb); | ||
84 | skb->tc_skip_classify = 1; | 82 | skb->tc_skip_classify = 1; |
85 | 83 | ||
86 | u64_stats_update_begin(&txp->tsync); | 84 | u64_stats_update_begin(&txp->tsync); |
@@ -101,13 +99,12 @@ static void ifb_ri_tasklet(unsigned long _txp) | |||
101 | rcu_read_unlock(); | 99 | rcu_read_unlock(); |
102 | skb->skb_iif = txp->dev->ifindex; | 100 | skb->skb_iif = txp->dev->ifindex; |
103 | 101 | ||
104 | if (from & AT_EGRESS) { | 102 | if (!skb->tc_from_ingress) { |
105 | dev_queue_xmit(skb); | 103 | dev_queue_xmit(skb); |
106 | } else if (from & AT_INGRESS) { | 104 | } else { |
107 | skb_pull(skb, skb->mac_len); | 105 | skb_pull(skb, skb->mac_len); |
108 | netif_receive_skb(skb); | 106 | netif_receive_skb(skb); |
109 | } else | 107 | } |
110 | BUG(); | ||
111 | } | 108 | } |
112 | 109 | ||
113 | if (__netif_tx_trylock(txq)) { | 110 | if (__netif_tx_trylock(txq)) { |
@@ -246,7 +243,7 @@ static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev) | |||
246 | txp->rx_bytes += skb->len; | 243 | txp->rx_bytes += skb->len; |
247 | u64_stats_update_end(&txp->rsync); | 244 | u64_stats_update_end(&txp->rsync); |
248 | 245 | ||
249 | if (skb->tc_from == AT_STACK || !skb->skb_iif) { | 246 | if (!skb->tc_redirected || !skb->skb_iif) { |
250 | dev_kfree_skb(skb); | 247 | dev_kfree_skb(skb); |
251 | dev->stats.rx_dropped++; | 248 | dev->stats.rx_dropped++; |
252 | return NETDEV_TX_OK; | 249 | return NETDEV_TX_OK; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fab3f87e9bd1..3149a88de548 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -591,6 +591,8 @@ static inline bool skb_mstamp_after(const struct skb_mstamp *t1, | |||
591 | * @ipvs_property: skbuff is owned by ipvs | 591 | * @ipvs_property: skbuff is owned by ipvs |
592 | * @tc_skip_classify: do not classify packet. set by IFB device | 592 | * @tc_skip_classify: do not classify packet. set by IFB device |
593 | * @tc_at_ingress: used within tc_classify to distinguish in/egress | 593 | * @tc_at_ingress: used within tc_classify to distinguish in/egress |
594 | * @tc_redirected: packet was redirected by a tc action | ||
595 | * @tc_from_ingress: if tc_redirected, tc_at_ingress at time of redirect | ||
594 | * @peeked: this packet has been seen already, so stats have been | 596 | * @peeked: this packet has been seen already, so stats have been |
595 | * done for it, don't do them again | 597 | * done for it, don't do them again |
596 | * @nf_trace: netfilter packet trace flag | 598 | * @nf_trace: netfilter packet trace flag |
@@ -753,7 +755,8 @@ struct sk_buff { | |||
753 | #ifdef CONFIG_NET_CLS_ACT | 755 | #ifdef CONFIG_NET_CLS_ACT |
754 | __u8 tc_skip_classify:1; | 756 | __u8 tc_skip_classify:1; |
755 | __u8 tc_at_ingress:1; | 757 | __u8 tc_at_ingress:1; |
756 | __u8 tc_from:2; | 758 | __u8 tc_redirected:1; |
759 | __u8 tc_from_ingress:1; | ||
757 | #endif | 760 | #endif |
758 | 761 | ||
759 | #ifdef CONFIG_NET_SCHED | 762 | #ifdef CONFIG_NET_SCHED |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 4bd6d5387209..e2f426f6d62f 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -412,7 +412,7 @@ int skb_do_redirect(struct sk_buff *); | |||
412 | static inline void skb_reset_tc(struct sk_buff *skb) | 412 | static inline void skb_reset_tc(struct sk_buff *skb) |
413 | { | 413 | { |
414 | #ifdef CONFIG_NET_CLS_ACT | 414 | #ifdef CONFIG_NET_CLS_ACT |
415 | skb->tc_from = 0; | 415 | skb->tc_redirected = 0; |
416 | #endif | 416 | #endif |
417 | } | 417 | } |
418 | 418 | ||
diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h index cee753a7a40c..a081efbd61a2 100644 --- a/include/uapi/linux/pkt_cls.h +++ b/include/uapi/linux/pkt_cls.h | |||
@@ -4,12 +4,6 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pkt_sched.h> | 5 | #include <linux/pkt_sched.h> |
6 | 6 | ||
7 | #ifdef __KERNEL__ | ||
8 | #define AT_STACK 0x0 | ||
9 | #define AT_INGRESS 0x1 | ||
10 | #define AT_EGRESS 0x2 | ||
11 | #endif | ||
12 | |||
13 | /* Action attributes */ | 7 | /* Action attributes */ |
14 | enum { | 8 | enum { |
15 | TCA_ACT_UNSPEC, | 9 | TCA_ACT_UNSPEC, |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index e832c62fd705..84682f02b611 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -211,8 +211,10 @@ static int tcf_mirred(struct sk_buff *skb, const struct tc_action *a, | |||
211 | } | 211 | } |
212 | 212 | ||
213 | /* mirror is always swallowed */ | 213 | /* mirror is always swallowed */ |
214 | if (tcf_mirred_is_act_redirect(m_eaction)) | 214 | if (tcf_mirred_is_act_redirect(m_eaction)) { |
215 | skb2->tc_from = skb_at_tc_ingress(skb) ? AT_INGRESS : AT_EGRESS; | 215 | skb2->tc_redirected = 1; |
216 | skb2->tc_from_ingress = skb2->tc_at_ingress; | ||
217 | } | ||
216 | 218 | ||
217 | skb2->skb_iif = skb->dev->ifindex; | 219 | skb2->skb_iif = skb->dev->ifindex; |
218 | skb2->dev = dev; | 220 | skb2->dev = dev; |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index bb5c638b6852..c8bb62a1e744 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -626,7 +626,7 @@ deliver: | |||
626 | * If it's at ingress let's pretend the delay is | 626 | * If it's at ingress let's pretend the delay is |
627 | * from the network (tstamp will be updated). | 627 | * from the network (tstamp will be updated). |
628 | */ | 628 | */ |
629 | if (skb->tc_from & AT_INGRESS) | 629 | if (skb->tc_redirected && skb->tc_from_ingress) |
630 | skb->tstamp = 0; | 630 | skb->tstamp = 0; |
631 | #endif | 631 | #endif |
632 | 632 | ||