aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-10-02 16:24:59 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-05 00:08:54 -0400
commit896a7cf8d846a9e86fb823be16f4f14ffeb7f074 (patch)
tree2260fac9cccf51938d710ab0fc74dc0fa0503a4f
parenta825e00c98a2ee37eb2a0ad93b352e79d2bc1593 (diff)
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> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/pktgen.txt8
-rw-r--r--net/core/pktgen.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/networking/pktgen.txt b/Documentation/networking/pktgen.txt
index c6cf4a3c16e0..61bb645d50e0 100644
--- a/Documentation/networking/pktgen.txt
+++ b/Documentation/networking/pktgen.txt
@@ -90,6 +90,11 @@ Examples:
90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address 90 pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address 91 pgset "srcmac 00:00:00:00:00:00" sets MAC source address
92 92
93 pgset "queue_map_min 0" Sets the min value of tx queue interval
94 pgset "queue_map_max 7" Sets the max value of tx queue interval, for multiqueue devices
95 To select queue 1 of a given device,
96 use queue_map_min=1 and queue_map_max=1
97
93 pgset "src_mac_count 1" Sets the number of MACs we'll range through. 98 pgset "src_mac_count 1" Sets the number of MACs we'll range through.
94 The 'minimum' MAC is what you set with srcmac. 99 The 'minimum' MAC is what you set with srcmac.
95 100
@@ -101,6 +106,9 @@ Examples:
101 IPDST_RND, UDPSRC_RND, 106 IPDST_RND, UDPSRC_RND,
102 UDPDST_RND, MACSRC_RND, MACDST_RND 107 UDPDST_RND, MACSRC_RND, MACDST_RND
103 MPLS_RND, VID_RND, SVID_RND 108 MPLS_RND, VID_RND, SVID_RND
109 QUEUE_MAP_RND # queue map random
110 QUEUE_MAP_CPU # queue map mirrors smp_processor_id()
111
104 112
105 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then 113 pgset "udp_src_min 9" set UDP source port min, If < udp_src_max, then
106 cycle through the port range. 114 cycle through the port range.
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b69455217ed6..421857c8c071 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)
2212 if (pkt_dev->flags & F_QUEUE_MAP_CPU) 2212 if (pkt_dev->flags & F_QUEUE_MAP_CPU)
2213 pkt_dev->cur_queue_map = smp_processor_id(); 2213 pkt_dev->cur_queue_map = smp_processor_id();
2214 2214
2215 else if (pkt_dev->queue_map_min < pkt_dev->queue_map_max) { 2215 else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
2216 __u16 t; 2216 __u16 t;
2217 if (pkt_dev->flags & F_QUEUE_MAP_RND) { 2217 if (pkt_dev->flags & F_QUEUE_MAP_RND) {
2218 t = random32() % 2218 t = random32() %