Commit 88271660 authored by Jesse Brandeburg's avatar Jesse Brandeburg Committed by David S. Miller

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: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarRobert Olsson <robert.olsson@its.uu.se>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3ed4bc0
...@@ -1973,28 +1973,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) ...@@ -1973,28 +1973,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
/* make sure that we don't pick a non-existing transmit queue */ /* make sure that we don't pick a non-existing transmit queue */
ntxq = pkt_dev->odev->real_num_tx_queues; ntxq = pkt_dev->odev->real_num_tx_queues;
if (ntxq <= num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) {
printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU "
"disabled because CPU count (%d) exceeds number ", "disabled because CPU count (%d) exceeds number "
num_online_cpus()); "of tx queues (%d) on %s\n", num_online_cpus(), ntxq,
printk(KERN_WARNING "pktgen: WARNING: of tx queues " pkt_dev->odev->name);
"(%d) on %s \n", ntxq, pkt_dev->odev->name);
pkt_dev->flags &= ~F_QUEUE_MAP_CPU; pkt_dev->flags &= ~F_QUEUE_MAP_CPU;
} }
if (ntxq <= pkt_dev->queue_map_min) { if (ntxq <= pkt_dev->queue_map_min) {
printk(KERN_WARNING "pktgen: WARNING: Requested " printk(KERN_WARNING "pktgen: WARNING: Requested "
"queue_map_min (%d) exceeds number of tx\n", "queue_map_min (zero-based) (%d) exceeds valid range "
pkt_dev->queue_map_min); "[0 - %d] for (%d) queues on %s, resetting\n",
printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq,
"%s, resetting\n", ntxq, pkt_dev->odev->name); pkt_dev->odev->name);
pkt_dev->queue_map_min = ntxq - 1; pkt_dev->queue_map_min = ntxq - 1;
} }
if (ntxq <= pkt_dev->queue_map_max) { if (pkt_dev->queue_map_max >= ntxq) {
printk(KERN_WARNING "pktgen: WARNING: Requested " printk(KERN_WARNING "pktgen: WARNING: Requested "
"queue_map_max (%d) exceeds number of tx\n", "queue_map_max (zero-based) (%d) exceeds valid range "
pkt_dev->queue_map_max); "[0 - %d] for (%d) queues on %s, resetting\n",
printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq,
"%s, resetting\n", ntxq, pkt_dev->odev->name); pkt_dev->odev->name);
pkt_dev->queue_map_max = ntxq - 1; pkt_dev->queue_map_max = ntxq - 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment