summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-01-06 04:13:47 +0100
committerDavid S. Miller <davem@davemloft.net>2012-01-07 21:26:08 +0100
commit26e29eeda048aa6699984c4b9d6997dd1a1315db (patch)
treeeeef1467c079ce2f3470163d5151b35b7e733fb5
parentsmsc911x: Unconditionally include linux/smscphy.h in smsc911x.h (diff)
downloadlinux-26e29eeda048aa6699984c4b9d6997dd1a1315db.tar.xz
linux-26e29eeda048aa6699984c4b9d6997dd1a1315db.zip
pktgen: set correct max and min in pktgen_setup_inject()
In 882716604ec "pktgen: fix multiple queue warning" we added special logic to handle the case where ntxq is zero. It's not clear to me that ntxq can actually be zero. But if it were then we would set ->queue_map_min and ->queue_map_max to USHRT_MAX when probably we want to set them to zero? Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/pktgen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 449fe0f068f8..65f80c7b1656 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2024,13 +2024,13 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
pr_warning("WARNING: Requested queue_map_min (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq,
pkt_dev->odevname);
- pkt_dev->queue_map_min = ntxq - 1;
+ pkt_dev->queue_map_min = (ntxq ?: 1) - 1;
}
if (pkt_dev->queue_map_max >= ntxq) {
pr_warning("WARNING: Requested queue_map_max (zero-based) (%d) exceeds valid range [0 - %d] for (%d) queues on %s, resetting\n",
pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq,
pkt_dev->odevname);
- pkt_dev->queue_map_max = ntxq - 1;
+ pkt_dev->queue_map_max = (ntxq ?: 1) - 1;
}
/* Default to the interface's mac if not explicitly set. */