* [PATCH v2] macvlan: Fix rx counters update in macvlan_handle_frame()
@ 2010-07-27 19:10 Sridhar Samudrala
2010-07-28 0:14 ` Herbert Xu
0 siblings, 1 reply; 3+ messages in thread
From: Sridhar Samudrala @ 2010-07-27 19:10 UTC (permalink / raw)
To: David Miller, Herbert Xu; +Cc: netdev
Fix macvlan_handle_frame() to update the rx counters based
on the return value of the vlan->receive call.
Updated the patch to not do any packet count drops when the interface
is down based on Herber'ts comments.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 87e8d4c..bcb1b36 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -152,7 +152,8 @@ static struct sk_buff *macvlan_handle_frame(struct macvlan_port *port,
const struct macvlan_dev *vlan;
const struct macvlan_dev *src;
struct net_device *dev;
- unsigned int len;
+ unsigned int len = 0;
+ int ret = NET_RX_DROP;
if (is_multicast_ether_addr(eth->h_dest)) {
src = macvlan_hash_lookup(port, eth->h_source);
@@ -188,14 +189,16 @@ static struct sk_buff *macvlan_handle_frame(struct macvlan_port *port,
}
len = skb->len + ETH_HLEN;
skb = skb_share_check(skb, GFP_ATOMIC);
- macvlan_count_rx(vlan, len, skb != NULL, 0);
if (!skb)
- return NULL;
+ goto out;
skb->dev = dev;
skb->pkt_type = PACKET_HOST;
- vlan->receive(skb);
+ ret = vlan->receive(skb);
+
+out:
+ macvlan_count_rx(vlan, len, ret == NET_RX_SUCCESS, 0);
return NULL;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] macvlan: Fix rx counters update in macvlan_handle_frame()
2010-07-27 19:10 [PATCH v2] macvlan: Fix rx counters update in macvlan_handle_frame() Sridhar Samudrala
@ 2010-07-28 0:14 ` Herbert Xu
2010-07-28 4:03 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-07-28 0:14 UTC (permalink / raw)
To: Sridhar Samudrala; +Cc: David Miller, netdev
On Tue, Jul 27, 2010 at 12:10:07PM -0700, Sridhar Samudrala wrote:
> Fix macvlan_handle_frame() to update the rx counters based
> on the return value of the vlan->receive call.
>
> Updated the patch to not do any packet count drops when the interface
> is down based on Herber'ts comments.
>
> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] macvlan: Fix rx counters update in macvlan_handle_frame()
2010-07-28 0:14 ` Herbert Xu
@ 2010-07-28 4:03 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-07-28 4:03 UTC (permalink / raw)
To: herbert; +Cc: sri, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 28 Jul 2010 08:14:04 +0800
> On Tue, Jul 27, 2010 at 12:10:07PM -0700, Sridhar Samudrala wrote:
>> Fix macvlan_handle_frame() to update the rx counters based
>> on the return value of the vlan->receive call.
>>
>> Updated the patch to not do any packet count drops when the interface
>> is down based on Herber'ts comments.
>>
>> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied to net-next-2.6, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-28 4:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 19:10 [PATCH v2] macvlan: Fix rx counters update in macvlan_handle_frame() Sridhar Samudrala
2010-07-28 0:14 ` Herbert Xu
2010-07-28 4:03 ` 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).