netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] veth: Kill unused code label and code block.
@ 2011-07-06  6:49 David Miller
  2011-07-06  8:16 ` WANG Cong
  2011-07-06  8:17 ` [PATCH net-next-2.6] veth: Kill unused tx_dropped Eric Dumazet
  0 siblings, 2 replies; 4+ messages in thread
From: David Miller @ 2011-07-06  6:49 UTC (permalink / raw)
  To: netdev


Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/veth.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 9eb92bf..19e0b0c 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -148,13 +148,6 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	return NETDEV_TX_OK;
 
-tx_drop:
-	kfree_skb(skb);
-	u64_stats_update_begin(&stats->syncp);
-	stats->tx_dropped++;
-	u64_stats_update_end(&stats->syncp);
-	return NETDEV_TX_OK;
-
 rx_drop:
 	u64_stats_update_begin(&rcv_stats->syncp);
 	rcv_stats->rx_dropped++;
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] veth: Kill unused code label and code block.
  2011-07-06  6:49 [PATCH] veth: Kill unused code label and code block David Miller
@ 2011-07-06  8:16 ` WANG Cong
  2011-07-06  8:17 ` [PATCH net-next-2.6] veth: Kill unused tx_dropped Eric Dumazet
  1 sibling, 0 replies; 4+ messages in thread
From: WANG Cong @ 2011-07-06  8:16 UTC (permalink / raw)
  To: netdev

On Tue, 05 Jul 2011 23:49:30 -0700, David Miller wrote:

>  
> -tx_drop:
> -	kfree_skb(skb);
> -	u64_stats_update_begin(&stats->syncp); -	stats->tx_dropped++;
> -	u64_stats_update_end(&stats->syncp); -	return NETDEV_TX_OK;
> -

Ahh, yeah, we have removed the goto tx_drop...

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next-2.6] veth: Kill unused tx_dropped
  2011-07-06  6:49 [PATCH] veth: Kill unused code label and code block David Miller
  2011-07-06  8:16 ` WANG Cong
@ 2011-07-06  8:17 ` Eric Dumazet
  2011-07-06  8:51   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2011-07-06  8:17 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

Le mardi 05 juillet 2011 à 23:49 -0700, David Miller a écrit :

> -tx_drop:
> -	kfree_skb(skb);
> -	u64_stats_update_begin(&stats->syncp);
> -	stats->tx_dropped++;
> -	u64_stats_update_end(&stats->syncp);
> -	return NETDEV_TX_OK;
> -
>  rx_drop:
>  	u64_stats_update_begin(&rcv_stats->syncp);
>  	rcv_stats->rx_dropped++;


Then we should also kill tx_dropped from percpu stats ?

Here is a patch on top of yours

[PATCH] veth: Kill unused tx_dropped

Followup to commit f82528bc13a (Exclude duplicated checking for
iface-up) : We no longer need percpu tx_dropped field.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
 drivers/net/veth.c |    5 +----
 1 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 19e0b0c..7f78db7 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -30,7 +30,6 @@ struct veth_net_stats {
 	u64			rx_bytes;
 	u64			tx_bytes;
 	u64			rx_dropped;
-	u64			tx_dropped;
 	struct u64_stats_sync	syncp;
 };
 
@@ -168,7 +167,7 @@ static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
 	for_each_possible_cpu(cpu) {
 		struct veth_net_stats *stats = per_cpu_ptr(priv->stats, cpu);
 		u64 rx_packets, rx_bytes, rx_dropped;
-		u64 tx_packets, tx_bytes, tx_dropped;
+		u64 tx_packets, tx_bytes;
 		unsigned int start;
 
 		do {
@@ -178,14 +177,12 @@ static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev,
 			rx_bytes = stats->rx_bytes;
 			tx_bytes = stats->tx_bytes;
 			rx_dropped = stats->rx_dropped;
-			tx_dropped = stats->tx_dropped;
 		} while (u64_stats_fetch_retry_bh(&stats->syncp, start));
 		tot->rx_packets += rx_packets;
 		tot->tx_packets += tx_packets;
 		tot->rx_bytes   += rx_bytes;
 		tot->tx_bytes   += tx_bytes;
 		tot->rx_dropped += rx_dropped;
-		tot->tx_dropped += tx_dropped;
 	}
 
 	return tot;



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next-2.6] veth: Kill unused tx_dropped
  2011-07-06  8:17 ` [PATCH net-next-2.6] veth: Kill unused tx_dropped Eric Dumazet
@ 2011-07-06  8:51   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2011-07-06  8:51 UTC (permalink / raw)
  To: eric.dumazet; +Cc: netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 06 Jul 2011 10:17:20 +0200

> Then we should also kill tx_dropped from percpu stats ?
> 
> Here is a patch on top of yours
> 
> [PATCH] veth: Kill unused tx_dropped
> 
> Followup to commit f82528bc13a (Exclude duplicated checking for
> iface-up) : We no longer need percpu tx_dropped field.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Looks good to me, applied, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-06  8:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-06  6:49 [PATCH] veth: Kill unused code label and code block David Miller
2011-07-06  8:16 ` WANG Cong
2011-07-06  8:17 ` [PATCH net-next-2.6] veth: Kill unused tx_dropped Eric Dumazet
2011-07-06  8:51   ` 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).