Thread (6 messages) 6 messages, 2 authors, 2016-06-30

Re: [net-next PATCH v2 1/2] net: pktgen: support injecting packets for qdisc testing

From: John Fastabend <john.fastabend@gmail.com>
Date: 2016-06-30 16:57:57

On 16-06-30 01:37 AM, Jesper Dangaard Brouer wrote:
On Wed, 29 Jun 2016 13:03:06 -0700
John Fastabend [off-list ref] wrote:
quoted
Add another xmit_mode to pktgen to allow testing xmit functionality
of qdiscs. The new mode "queue_xmit" injects packets at
__dev_queue_xmit() so that qdisc is called.

Signed-off-by: John Fastabend <redacted>
I generally like this.
[...]
quoted
@@ -3434,6 +3442,36 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
 #endif
 		} while (--burst > 0);
 		goto out; /* Skips xmit_mode M_START_XMIT */
+	} else if (pkt_dev->xmit_mode == M_QUEUE_XMIT) {
+		local_bh_disable();
+		atomic_add(burst, &pkt_dev->skb->users);
Reading the code, people might think that "burst" is allowed for this
mode, which it is not. (You do handle this earlier in this patch when
configuring this mode).
Right we never get here without burst == 1 but sure it does read
a bit strange I'll use atomic_inc().


Thanks,
John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help