diff mbox

about net/core/pktgen.c module.

Message ID AANLkTim7ZhGGgE9TJsu1m5=fD743meN12V5Ywn_9Cyaq@mail.gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

ustc.mail Aug. 3, 2010, 3:20 p.m. UTC
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:
--------------------------------------patch
end-------------------------------------------------
Best regards!
from backyes
---------------------------------------reply
end-------------------------------------------------
On Tue, Aug 3, 2010 at 10:30 PM, ustc.mail <backyes@mail.ustc.edu.cn> wrote:
> Thanks for your reply!
> It's my pleasure to patch it.
> -Yanfei
>
> On Tue, Aug 3, 2010 at 7:44 PM, <robert@herjulf.net> wrote:
>>
>> > 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
>>
>
>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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