aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/pktgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r--net/core/pktgen.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 99f656d35b4f..8997e912aaaf 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1973,28 +1973,21 @@ 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
1977 printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU "
1978 "disabled because CPU count (%d) exceeds number ",
1979 num_online_cpus());
1980 printk(KERN_WARNING "pktgen: WARNING: of tx queues "
1981 "(%d) on %s \n", ntxq, pkt_dev->odev->name);
1982 pkt_dev->flags &= ~F_QUEUE_MAP_CPU;
1983 }
1984 if (ntxq <= pkt_dev->queue_map_min) { 1977 if (ntxq <= pkt_dev->queue_map_min) {
1985 printk(KERN_WARNING "pktgen: WARNING: Requested " 1978 printk(KERN_WARNING "pktgen: WARNING: Requested "
1986 "queue_map_min (%d) exceeds number of tx\n", 1979 "queue_map_min (zero-based) (%d) exceeds valid range "
1987 pkt_dev->queue_map_min); 1980 "[0 - %d] for (%d) queues on %s, resetting\n",
1988 printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " 1981 pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq,
1989 "%s, resetting\n", ntxq, pkt_dev->odev->name); 1982 pkt_dev->odev->name);
1990 pkt_dev->queue_map_min = ntxq - 1; 1983 pkt_dev->queue_map_min = ntxq - 1;
1991 } 1984 }
1992 if (ntxq <= pkt_dev->queue_map_max) { 1985 if (pkt_dev->queue_map_max >= ntxq) {
1993 printk(KERN_WARNING "pktgen: WARNING: Requested " 1986 printk(KERN_WARNING "pktgen: WARNING: Requested "
1994 "queue_map_max (%d) exceeds number of tx\n", 1987 "queue_map_max (zero-based) (%d) exceeds valid range "
1995 pkt_dev->queue_map_max); 1988 "[0 - %d] for (%d) queues on %s, resetting\n",
1996 printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " 1989 pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq,
1997 "%s, resetting\n", ntxq, pkt_dev->odev->name); 1990 pkt_dev->odev->name);
1998 pkt_dev->queue_map_max = ntxq - 1; 1991 pkt_dev->queue_map_max = ntxq - 1;
1999 } 1992 }
2000 1993
@@ -2203,6 +2196,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
2203 } 2196 }
2204 pkt_dev->cur_queue_map = t; 2197 pkt_dev->cur_queue_map = t;
2205 } 2198 }
2199 pkt_dev->cur_queue_map = pkt_dev->cur_queue_map % pkt_dev->odev->real_num_tx_queues;
2206} 2200}
2207 2201
2208/* Increment/randomize headers according to flags and current values 2202/* Increment/randomize headers according to flags and current values