diff options
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r-- | net/core/pktgen.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 2456bd5b086f..bce9bf4b4a62 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3424,27 +3424,29 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3424 | pkt_dev->last_ok = 0; | 3424 | pkt_dev->last_ok = 0; |
3425 | else { | 3425 | else { |
3426 | atomic_inc(&(pkt_dev->skb->users)); | 3426 | atomic_inc(&(pkt_dev->skb->users)); |
3427 | retry_now: | 3427 | |
3428 | retry_now: | ||
3428 | ret = (*xmit)(pkt_dev->skb, odev); | 3429 | ret = (*xmit)(pkt_dev->skb, odev); |
3429 | if (likely(ret == NETDEV_TX_OK)) { | 3430 | switch (ret) { |
3431 | case NETDEV_TX_OK: | ||
3430 | txq_trans_update(txq); | 3432 | txq_trans_update(txq); |
3431 | pkt_dev->last_ok = 1; | 3433 | pkt_dev->last_ok = 1; |
3432 | pkt_dev->sofar++; | 3434 | pkt_dev->sofar++; |
3433 | pkt_dev->seq_num++; | 3435 | pkt_dev->seq_num++; |
3434 | pkt_dev->tx_bytes += pkt_dev->cur_pkt_size; | 3436 | pkt_dev->tx_bytes += pkt_dev->cur_pkt_size; |
3435 | 3437 | break; | |
3436 | } else if (ret == NETDEV_TX_LOCKED | 3438 | case NETDEV_TX_LOCKED: |
3437 | && (odev->features & NETIF_F_LLTX)) { | ||
3438 | cpu_relax(); | 3439 | cpu_relax(); |
3439 | goto retry_now; | 3440 | goto retry_now; |
3440 | } else { /* Retry it next time */ | 3441 | default: /* Drivers are not supposed to return other values! */ |
3441 | 3442 | if (net_ratelimit()) | |
3442 | atomic_dec(&(pkt_dev->skb->users)); | 3443 | pr_info("pktgen: %s xmit error: %d\n", |
3443 | 3444 | odev->name, ret); | |
3444 | if (debug && net_ratelimit()) | ||
3445 | printk(KERN_INFO "pktgen: Hard xmit error\n"); | ||
3446 | |||
3447 | pkt_dev->errors++; | 3445 | pkt_dev->errors++; |
3446 | /* fallthru */ | ||
3447 | case NETDEV_TX_BUSY: | ||
3448 | /* Retry it next time */ | ||
3449 | atomic_dec(&(pkt_dev->skb->users)); | ||
3448 | pkt_dev->last_ok = 0; | 3450 | pkt_dev->last_ok = 0; |
3449 | } | 3451 | } |
3450 | 3452 | ||