DORMANTno replies

[PATCH] about net/core/pktgen.c module.

From: ustc.mail <hidden>
Date: 2010-08-03 15:28:08

Hi,
I find that there is a bug in the pktgen kernel packet generator. It's
my first time to add a patch, so welcome to give me suggestion about
patch work.

description: the bug makes the first generated packets (one or more
which depend on the configuration from usespace script.)enter to the
same NIC queue of multi-queue NIC for the wrong position of
mod_cur_headers(pkt_dev) call while building the IPV4 and IPV6
skb_buff.
kernel version: linux-2.6.33.3
file: linux-2.6.33.3/net/core/pktgen.c
result: while setting skb_clone more than one, specially for a
considerable number, the multiqueue function is not efficient for its
wrong queue_map value.
patch as following:
--- pktgen.c	2010-08-03 22:46:55.001682745 +0800
+++ pktgen.patch.c	2010-08-03 22:48:03.367409102 +0800
@@ -2567,8 +2567,8 @@
 	/* Update any of the values, used when we're incrementing various
 	 * fields.
 	 */
-	queue_map = pkt_dev->cur_queue_map;
 	mod_cur_headers(pkt_dev);
+	queue_map = pkt_dev->cur_queue_map;

 	datalen = (odev->hard_header_len + 16) & ~0xf;
 	skb = __netdev_alloc_skb(odev,
@@ -2913,8 +2913,8 @@
 	/* Update any of the values, used when we're incrementing various
 	 * fields.
 	 */
-	queue_map = pkt_dev->cur_queue_map;
 	mod_cur_headers(pkt_dev);
+	queue_map = pkt_dev->cur_queue_map;

 	skb = __netdev_alloc_skb(odev,
 				 pkt_dev->cur_pkt_size + 64
--------------------------------------patch
end-------------------------------------------------
Best regards!
from backyes
---------------------------------------reply
end-------------------------------------------------
On Tue, Aug 3, 2010 at 10:30 PM, ustc.mail [off-list ref] wrote:
Thanks for your reply!
It's my pleasure to patch it.
-Yanfei

On Tue, Aug 3, 2010 at 7:44 PM, [off-list ref] wrote:
quoted
quoted
Dear robert, I am doing some research on the
pktgen.c implementation. While reading the source code, I find some
doubts about cur->cur_queue_map for multiqueue NIC .  The following
code is from pktgen.c in kernel 2.6.33.3.   For line 2919 and line
2920, the first generated packets is sent to same queue of NIC for
every thread. Because the the first generated packets is sent while
the cur_queue_map is not setted yet.   "reverse the two line" is OK.
Am I right?
Right first time we're using queue_map that's not been set by
set_cur_queue_map(pkt_dev);

       queue_map = pkt_dev->cur_queue_map;
       mod_cur_headers(pkt_dev);

Can you make a patch and submit to netdev?


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