aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2014-04-11 07:22:00 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-12 01:59:38 -0400
commit0f2eea4b7e29ab693b07f6eedf8e87a0c11b8b42 (patch)
tree0d1b66aac812f1e2fa01f0e311e66d48dd747442 /net/core
parent6871438cc4e5307ccda70fa2a246a546300ac9fa (diff)
pktgen: be friendly to LLTX devices
Similarly to commit 43279500deca ("packet: respect devices with LLTX flag in direct xmit"), we can basically apply the very same to pktgen. This will help testing against LLTX devices such as dummy driver (or others), which only have a single netdevice txq and would otherwise require locking their txq from pktgen side while e.g. in dummy case, we would not need any locking. Fix this by making use of HARD_TX_{UN,}LOCK API, so that NETIF_F_LLTX will be respected. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d068ec25db1e..0304f981f7ff 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3338,7 +3338,9 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3338 queue_map = skb_get_queue_mapping(pkt_dev->skb); 3338 queue_map = skb_get_queue_mapping(pkt_dev->skb);
3339 txq = netdev_get_tx_queue(odev, queue_map); 3339 txq = netdev_get_tx_queue(odev, queue_map);
3340 3340
3341 __netif_tx_lock_bh(txq); 3341 local_bh_disable();
3342
3343 HARD_TX_LOCK(odev, txq, smp_processor_id());
3342 3344
3343 if (unlikely(netif_xmit_frozen_or_drv_stopped(txq))) { 3345 if (unlikely(netif_xmit_frozen_or_drv_stopped(txq))) {
3344 ret = NETDEV_TX_BUSY; 3346 ret = NETDEV_TX_BUSY;
@@ -3374,7 +3376,9 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3374 pkt_dev->last_ok = 0; 3376 pkt_dev->last_ok = 0;
3375 } 3377 }
3376unlock: 3378unlock:
3377 __netif_tx_unlock_bh(txq); 3379 HARD_TX_UNLOCK(odev, txq);
3380
3381 local_bh_enable();
3378 3382
3379 /* If pkt_dev->count is zero, then run forever */ 3383 /* If pkt_dev->count is zero, then run forever */
3380 if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { 3384 if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) {