diff options
author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2008-10-28 16:21:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-28 16:21:51 -0400 |
commit | 882716604ecf388b2ff09bc76eb2a752aa9cc76b (patch) | |
tree | 795870dbd12373a9a7f8df59e8996eba1c77d0ba /net | |
parent | b3ed4bc082077045f680400c8bb02fa8d9c9ecf5 (diff) |
pktgen: fix multiple queue warning
when testing the new pktgen module with multiple queues and ixgbe with:
pgset "flag QUEUE_MAP_CPU"
I found that I was getting errors in dmesg like:
pktgen: WARNING: QUEUE_MAP_CPU disabled because CPU count (8) exceeds number
<4>pktgen: WARNING: of tx queues (8) on eth15
you'll note, 8 really doesn't exceed 8.
This patch seemed to fix the logic errors and also the attempts at
limiting line length in printk (which didn't work anyway)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/pktgen.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 99f656d35b4f..a47f5bad110d 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -1973,28 +1973,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
1973 | 1973 | ||
1974 | /* make sure that we don't pick a non-existing transmit queue */ | 1974 | /* make sure that we don't pick a non-existing transmit queue */ |
1975 | ntxq = pkt_dev->odev->real_num_tx_queues; | 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; |
1976 | if (ntxq <= num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | 1976 | if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { |
1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " | 1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " |
1978 | "disabled because CPU count (%d) exceeds number ", | 1978 | "disabled because CPU count (%d) exceeds number " |
1979 | num_online_cpus()); | 1979 | "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, |
1980 | printk(KERN_WARNING "pktgen: WARNING: of tx queues " | 1980 | pkt_dev->odev->name); |
1981 | "(%d) on %s \n", ntxq, pkt_dev->odev->name); | ||
1982 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; | 1981 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; |
1983 | } | 1982 | } |
1984 | if (ntxq <= pkt_dev->queue_map_min) { | 1983 | if (ntxq <= pkt_dev->queue_map_min) { |
1985 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1984 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
1986 | "queue_map_min (%d) exceeds number of tx\n", | 1985 | "queue_map_min (zero-based) (%d) exceeds valid range " |
1987 | pkt_dev->queue_map_min); | 1986 | "[0 - %d] for (%d) queues on %s, resetting\n", |
1988 | printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " | 1987 | pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq, |
1989 | "%s, resetting\n", ntxq, pkt_dev->odev->name); | 1988 | pkt_dev->odev->name); |
1990 | pkt_dev->queue_map_min = ntxq - 1; | 1989 | pkt_dev->queue_map_min = ntxq - 1; |
1991 | } | 1990 | } |
1992 | if (ntxq <= pkt_dev->queue_map_max) { | 1991 | if (pkt_dev->queue_map_max >= ntxq) { |
1993 | printk(KERN_WARNING "pktgen: WARNING: Requested " | 1992 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
1994 | "queue_map_max (%d) exceeds number of tx\n", | 1993 | "queue_map_max (zero-based) (%d) exceeds valid range " |
1995 | pkt_dev->queue_map_max); | 1994 | "[0 - %d] for (%d) queues on %s, resetting\n", |
1996 | printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " | 1995 | pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq, |
1997 | "%s, resetting\n", ntxq, pkt_dev->odev->name); | 1996 | pkt_dev->odev->name); |
1998 | pkt_dev->queue_map_max = ntxq - 1; | 1997 | pkt_dev->queue_map_max = ntxq - 1; |
1999 | } | 1998 | } |
2000 | 1999 | ||