Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-08 Thread Jamal Hadi Salim
On 16-10-06 08:49 PM, Cong Wang wrote: On Thu, Oct 6, 2016 at 5:17 PM, Jamal Hadi Salim wrote: I dont believe we need to bother with the return code in this case. Why? For a quick example, STOLEN vs. SHOT: result = tc_classify(skb, filter, &res, false); if (result >= 0) { #

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Cong Wang
On Thu, Oct 6, 2016 at 5:17 PM, Jamal Hadi Salim wrote: > I dont believe we need to bother with the return code in this case. Why? For a quick example, STOLEN vs. SHOT: result = tc_classify(skb, filter, &res, false); if (result >= 0) { #ifdef CONFIG_NET_CLS_ACT

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Cong Wang
On Thu, Oct 6, 2016 at 12:38 PM, Eric Dumazet wrote: > And another quick grep shows that out of 142 drivers, only one [1] of > them (incorrectly) checks netif_receive_skb() return value. > act_mirred is not a driver, apparently. > Real question is more like : what is the impact of propagating a

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Jamal Hadi Salim
On 16-10-06 01:30 PM, Cong Wang wrote: On Thu, Oct 6, 2016 at 6:30 AM, Shmulik Ladkani wrote: Hi, On Mon, Oct 3, 2016 at 12:45 PM, Cong Wang wrote: On Thu, Sep 29, 2016 at 4:03 AM, Shmulik Ladkani wrote: skb2->skb_iif = skb->dev->ifindex; skb2->dev = dev; - err = dev_

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Eric Dumazet
On Thu, 2016-10-06 at 10:30 -0700, Cong Wang wrote: > On Thu, Oct 6, 2016 at 6:30 AM, Shmulik Ladkani > wrote: > > Hi, > > > > On Mon, Oct 3, 2016 at 12:45 PM, Cong Wang wrote: > >> On Thu, Sep 29, 2016 at 4:03 AM, Shmulik Ladkani > >> wrote: > >>> skb2->skb_iif = skb->dev->ifindex; > >>

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Cong Wang
On Thu, Oct 6, 2016 at 6:30 AM, Shmulik Ladkani wrote: > Hi, > > On Mon, Oct 3, 2016 at 12:45 PM, Cong Wang wrote: >> On Thu, Sep 29, 2016 at 4:03 AM, Shmulik Ladkani >> wrote: >>> skb2->skb_iif = skb->dev->ifindex; >>> skb2->dev = dev; >>> - err = dev_queue_xmit(skb2); >>>

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-06 Thread Shmulik Ladkani
Hi, On Mon, Oct 3, 2016 at 12:45 PM, Cong Wang wrote: > On Thu, Sep 29, 2016 at 4:03 AM, Shmulik Ladkani > wrote: >> skb2->skb_iif = skb->dev->ifindex; >> skb2->dev = dev; >> - err = dev_queue_xmit(skb2); >> + if (tcf_mirred_act_direction(m_eaction) & AT_EGRESS) >> +

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-03 Thread David Miller
From: Shmulik Ladkani Date: Thu, 29 Sep 2016 14:03:32 +0300 > skb2->skb_iif = skb->dev->ifindex; > skb2->dev = dev; > - err = dev_queue_xmit(skb2); > + if (tcf_mirred_act_direction(m_eaction) & AT_EGRESS) > + err = dev_queue_xmit(skb2); > + else > +

Re: [PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-10-03 Thread Cong Wang
On Thu, Sep 29, 2016 at 4:03 AM, Shmulik Ladkani wrote: > skb2->skb_iif = skb->dev->ifindex; > skb2->dev = dev; > - err = dev_queue_xmit(skb2); > + if (tcf_mirred_act_direction(m_eaction) & AT_EGRESS) > + err = dev_queue_xmit(skb2); > + else > +

[PATCH v3 net-next 4/4] net/sched: act_mirred: Implement ingress actions

2016-09-29 Thread Shmulik Ladkani
Up until now, 'action mirred' supported only egress actions (either TCA_EGRESS_REDIR or TCA_EGRESS_MIRROR). This patch implements the corresponding ingress actions TCA_INGRESS_REDIR and TCA_INGRESS_MIRROR. This allows attaching filters whose target is to hand matching skbs into the rx processing