* [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
@ 2013-03-28 9:13 Shmulik Ladkani
2013-03-28 13:36 ` Eric Dumazet
2013-03-29 19:11 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Shmulik Ladkani @ 2013-03-28 9:13 UTC (permalink / raw)
To: David Miller; +Cc: Ben Greear, netdev, Igor Michailov, Shmulik Ladkani
'nf_reset' is called just prior calling 'netif_rx'.
No need to call it twice.
Reported-by: Igor Michailov <rgohita@gmail.com>
Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
---
net/core/dev.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 2db88df..071f398 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1624,7 +1624,6 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
}
skb_orphan(skb);
- nf_reset(skb);
if (unlikely(!is_skb_forwardable(dev, skb))) {
atomic_long_inc(&dev->rx_dropped);
--
1.7.9
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
2013-03-28 9:13 [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb' Shmulik Ladkani
@ 2013-03-28 13:36 ` Eric Dumazet
2013-03-29 19:11 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: Eric Dumazet @ 2013-03-28 13:36 UTC (permalink / raw)
To: Shmulik Ladkani; +Cc: David Miller, Ben Greear, netdev, Igor Michailov
On Thu, 2013-03-28 at 11:13 +0200, Shmulik Ladkani wrote:
> 'nf_reset' is called just prior calling 'netif_rx'.
> No need to call it twice.
>
> Reported-by: Igor Michailov <rgohita@gmail.com>
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
> ---
> net/core/dev.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 2db88df..071f398 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1624,7 +1624,6 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
> }
>
> skb_orphan(skb);
> - nf_reset(skb);
>
> if (unlikely(!is_skb_forwardable(dev, skb))) {
> atomic_long_inc(&dev->rx_dropped);
Acked-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
2013-03-28 9:13 [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb' Shmulik Ladkani
2013-03-28 13:36 ` Eric Dumazet
@ 2013-03-29 19:11 ` David Miller
2013-03-29 19:17 ` Eric Dumazet
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2013-03-29 19:11 UTC (permalink / raw)
To: shmulik.ladkani; +Cc: greearb, netdev, rgohita
From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Date: Thu, 28 Mar 2013 11:13:26 +0200
> 'nf_reset' is called just prior calling 'netif_rx'.
> No need to call it twice.
>
> Reported-by: Igor Michailov <rgohita@gmail.com>
> Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
I do not see this happening in the:
macvlan_start_xmit()
--> macvlan_queue_xmit()
code path.
I'm not applying this patch. There seems to be no real agreement
that the caller of dev_forward_skb() takes care of the nf_reset().
And wouldn't it be better to consolidate the nf_reset() calls
into one place instead of several, increasing the audit burdon.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
2013-03-29 19:11 ` David Miller
@ 2013-03-29 19:17 ` Eric Dumazet
2013-03-29 19:26 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Eric Dumazet @ 2013-03-29 19:17 UTC (permalink / raw)
To: David Miller; +Cc: shmulik.ladkani, greearb, netdev, rgohita
On Fri, 2013-03-29 at 15:11 -0400, David Miller wrote:
> From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
> Date: Thu, 28 Mar 2013 11:13:26 +0200
>
> > 'nf_reset' is called just prior calling 'netif_rx'.
> > No need to call it twice.
> >
> > Reported-by: Igor Michailov <rgohita@gmail.com>
> > Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
>
> I do not see this happening in the:
>
> macvlan_start_xmit()
>
> --> macvlan_queue_xmit()
>
> code path.
>
> I'm not applying this patch. There seems to be no real agreement
> that the caller of dev_forward_skb() takes care of the nf_reset().
>
> And wouldn't it be better to consolidate the nf_reset() calls
> into one place instead of several, increasing the audit burdon.
>
Hmm, I believe you misread this patch :
nf_reset() is called _twice_ in dev_forward_skb()
int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
{
if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) {
if (skb_copy_ubufs(skb, GFP_ATOMIC)) {
atomic_long_inc(&dev->rx_dropped);
kfree_skb(skb);
return NET_RX_DROP;
}
}
skb_orphan(skb);
<1> nf_reset(skb);
if (unlikely(!is_skb_forwardable(dev, skb))) {
atomic_long_inc(&dev->rx_dropped);
kfree_skb(skb);
return NET_RX_DROP;
}
skb->skb_iif = 0;
skb->dev = dev;
skb_dst_drop(skb);
skb->tstamp.tv64 = 0;
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, dev);
skb->mark = 0;
secpath_reset(skb);
<2> nf_reset(skb);
return netif_rx(skb);
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb'
2013-03-29 19:17 ` Eric Dumazet
@ 2013-03-29 19:26 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-03-29 19:26 UTC (permalink / raw)
To: eric.dumazet; +Cc: shmulik.ladkani, greearb, netdev, rgohita
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 29 Mar 2013 12:17:36 -0700
> On Fri, 2013-03-29 at 15:11 -0400, David Miller wrote:
>> From: Shmulik Ladkani <shmulik.ladkani@gmail.com>
>> Date: Thu, 28 Mar 2013 11:13:26 +0200
>>
>> > 'nf_reset' is called just prior calling 'netif_rx'.
>> > No need to call it twice.
>> >
>> > Reported-by: Igor Michailov <rgohita@gmail.com>
>> > Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
>>
>> I do not see this happening in the:
>>
>> macvlan_start_xmit()
>>
>> --> macvlan_queue_xmit()
>>
>> code path.
>>
>> I'm not applying this patch. There seems to be no real agreement
>> that the caller of dev_forward_skb() takes care of the nf_reset().
>>
>> And wouldn't it be better to consolidate the nf_reset() calls
>> into one place instead of several, increasing the audit burdon.
>>
>
> Hmm, I believe you misread this patch :
>
> nf_reset() is called _twice_ in dev_forward_skb()
Aha, that makes more sense, applied.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-29 19:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 9:13 [PATCH] net: core: Remove redundant call to 'nf_reset' in 'dev_forward_skb' Shmulik Ladkani
2013-03-28 13:36 ` Eric Dumazet
2013-03-29 19:11 ` David Miller
2013-03-29 19:17 ` Eric Dumazet
2013-03-29 19:26 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).