* [PATCH] pktgen: Fix multiqueue handling
@ 2009-10-03 6:24 Eric Dumazet
2009-10-03 19:24 ` Robert Olsson
0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2009-10-03 6:24 UTC (permalink / raw)
To: David S. Miller; +Cc: Robert Olsson, Linux Netdev List, Stephen Hemminger
Note : I could not really test this patch, I dont have multi queue hardware yet.
I found this by code inspection, please double check, thanks
[PATCH] pktgen: Fix multiqueue handling
It is not currently possible to instruct pktgen to use one selected tx queue.
When Robert added multiqueue support in commit 45b270f8, he added
an interval (queue_map_min, queue_map_max), and his code doesnt take
into account the case of min = max, to select one tx queue exactly.
I suspect a high performance setup on a eight txqueue device wants
to use exactly eight cpus, and assign one tx queue to each sender.
This patchs makes pktgen select the right tx queue, not the first one.
Also updates Documentation to reflect Robert changes.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
Documentation/networking/pktgen.txt | 8 ++++++++
net/core/pktgen.c | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index c6cf4a3..61bb645 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -90,6 +90,11 @@ Examples:
pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
pgset "srcmac 00:00:00:00:00:00" sets MAC source address
+ pgset "queue_map_min 0" Sets the min value of tx queue interval
+ pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices
+ To select queue 1 of a given device,
+ use queue_map_min=1 and queue_map_max=1
+
pgset "src_mac_count 1" Sets the number of MACs we'll range through.
The 'minimum' MAC is what you set with srcmac.
@@ -101,6 +106,9 @@ Examples:
IPDST_RND, UDPSRC_RND,
UDPDST_RND, MACSRC_RND, MACDST_RND
MPLS_RND, VID_RND, SVID_RND
+ QUEUE_MAP_RND # queue map random
+ QUEUE_MAP_CPU # queue map mirrors smp_processor_id()
+
pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
cycle through the port range.
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b694552..421857c 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2212,7 +2212,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
if (pkt_dev->flags & F_QUEUE_MAP_CPU)
pkt_dev->cur_queue_map = smp_processor_id();
- else if (pkt_dev->queue_map_min < pkt_dev->queue_map_max) {
+ else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
__u16 t;
if (pkt_dev->flags & F_QUEUE_MAP_RND) {
t = random32() %
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] pktgen: Fix multiqueue handling
2009-10-03 6:24 [PATCH] pktgen: Fix multiqueue handling Eric Dumazet
@ 2009-10-03 19:24 ` Robert Olsson
2009-10-05 4:09 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Robert Olsson @ 2009-10-03 19:24 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S. Miller, Robert Olsson, Linux Netdev List,
Stephen Hemminger
Thanks yes is seems right. We can chose a single arbitrary TX queue with the patch.
BTW Noticed you and Stephen discussed to reduce dirtying skb->users, maybe the idea
to bump up skb->users to clone_skb is not so bad. I'll think the code will be pretty
straight-forward.
Cheers
--ro
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Eric Dumazet writes:
> Note : I could not really test this patch, I dont have multi queue hardware yet.
> I found this by code inspection, please double check, thanks
> [PATCH] pktgen: Fix multiqueue handling
>
> It is not currently possible to instruct pktgen to use one selected tx queue.
>
> When Robert added multiqueue support in commit 45b270f8, he added
> an interval (queue_map_min, queue_map_max), and his code doesnt take
> into account the case of min = max, to select one tx queue exactly.
>
> I suspect a high performance setup on a eight txqueue device wants
> to use exactly eight cpus, and assign one tx queue to each sender.
>
> This patchs makes pktgen select the right tx queue, not the first one.
>
> Also updates Documentation to reflect Robert changes.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> Documentation/networking/pktgen.txt | 8 ++++++++
> net/core/pktgen.c | 2 +-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
> index c6cf4a3..61bb645 100644
> --- a/Documentation/networking/pktgen.txt
> +++ b/Documentation/networking/pktgen.txt
> @@ -90,6 +90,11 @@ Examples:
> pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
> pgset "srcmac 00:00:00:00:00:00" sets MAC source address
>
> + pgset "queue_map_min 0" Sets the min value of tx queue interval
> + pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices
> + To select queue 1 of a given device,
> + use queue_map_min=1 and queue_map_max=1
> +
> pgset "src_mac_count 1" Sets the number of MACs we'll range through.
> The 'minimum' MAC is what you set with srcmac.
>
> @@ -101,6 +106,9 @@ Examples:
> IPDST_RND, UDPSRC_RND,
> UDPDST_RND, MACSRC_RND, MACDST_RND
> MPLS_RND, VID_RND, SVID_RND
> + QUEUE_MAP_RND # queue map random
> + QUEUE_MAP_CPU # queue map mirrors smp_processor_id()
> +
>
> pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
> cycle through the port range.
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index b694552..421857c 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -2212,7 +2212,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
> if (pkt_dev->flags & F_QUEUE_MAP_CPU)
> pkt_dev->cur_queue_map = smp_processor_id();
>
> - else if (pkt_dev->queue_map_min < pkt_dev->queue_map_max) {
> + else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
> __u16 t;
> if (pkt_dev->flags & F_QUEUE_MAP_RND) {
> t = random32() %
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pktgen: Fix multiqueue handling
2009-10-03 19:24 ` Robert Olsson
@ 2009-10-05 4:09 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-10-05 4:09 UTC (permalink / raw)
To: robert; +Cc: eric.dumazet, robert.olsson, netdev, shemminger
From: Robert Olsson <robert@herjulf.net>
Date: Sat, 3 Oct 2009 21:24:23 +0200
>
>
> Thanks yes is seems right. We can chose a single arbitrary TX queue with the patch.
> BTW Noticed you and Stephen discussed to reduce dirtying skb->users, maybe the idea
> to bump up skb->users to clone_skb is not so bad. I'll think the code will be pretty
> straight-forward.
>
> Cheers
> --ro
>
>
> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-05 4:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-03 6:24 [PATCH] pktgen: Fix multiqueue handling Eric Dumazet
2009-10-03 19:24 ` Robert Olsson
2009-10-05 4:09 ` 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).