* [net-2.6 PATCH] pktgen: ndo_start_xmit can return NET_XMIT_xxx values
@ 2009-12-23 23:39 Jeff Kirsher
2009-12-24 6:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Kirsher @ 2009-12-23 23:39 UTC (permalink / raw)
To: davem; +Cc: robert, netdev, gospo, John Fastabend, Jeff Kirsher
From: John Fastabend <john.r.fastabend@intel.com>
This updates pktgen so that it does not decrement skb->users
when it receives valid NET_XMIT_xxx values. These are now
valid return values from ndo_start_xmit in net-next-2.6.
They also indicate the skb has been consumed.
This fixes pktgen to work correctly with vlan devices.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
net/core/pktgen.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a23b45f..de0c2c7 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -250,8 +250,7 @@ struct pktgen_dev {
__u64 count; /* Default No packets to send */
__u64 sofar; /* How many pkts we've sent so far */
__u64 tx_bytes; /* How many bytes we've transmitted */
- __u64 errors; /* Errors when trying to transmit,
- pkts will be re-sent */
+ __u64 errors; /* Errors when trying to transmit, */
/* runtime counters relating to clone_skb */
@@ -3465,6 +3464,12 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
pkt_dev->seq_num++;
pkt_dev->tx_bytes += pkt_dev->last_pkt_size;
break;
+ case NET_XMIT_DROP:
+ case NET_XMIT_CN:
+ case NET_XMIT_POLICED:
+ /* skb has been consumed */
+ pkt_dev->errors++;
+ break;
default: /* Drivers are not supposed to return other values! */
if (net_ratelimit())
pr_info("pktgen: %s xmit error: %d\n",
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net-2.6 PATCH] pktgen: ndo_start_xmit can return NET_XMIT_xxx values
2009-12-23 23:39 [net-2.6 PATCH] pktgen: ndo_start_xmit can return NET_XMIT_xxx values Jeff Kirsher
@ 2009-12-24 6:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-12-24 6:03 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: robert, netdev, gospo, john.r.fastabend
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Wed, 23 Dec 2009 15:39:52 -0800
> From: John Fastabend <john.r.fastabend@intel.com>
>
> This updates pktgen so that it does not decrement skb->users
> when it receives valid NET_XMIT_xxx values. These are now
> valid return values from ndo_start_xmit in net-next-2.6.
> They also indicate the skb has been consumed.
>
> This fixes pktgen to work correctly with vlan devices.
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-24 6:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-23 23:39 [net-2.6 PATCH] pktgen: ndo_start_xmit can return NET_XMIT_xxx values Jeff Kirsher
2009-12-24 6: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