diff options
author | Yevgeny Petrilin <yevgenyp@mellanox.co.il> | 2009-06-20 18:15:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-21 22:18:02 -0400 |
commit | 7e23091347664bf357ca651545c93e99fafc7b40 (patch) | |
tree | 8b8764a3fa55aabbae6fa4d04130ff422035ce47 /drivers/net/mlx4 | |
parent | 6be832529a8129c9d90a1d3a78c5d503a710b6fc (diff) |
mlx4_en: Counting all the dropped packets on the TX side
Reporting the counter's value through 'ethtool -S'
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mlx4')
-rw-r--r-- | drivers/net/mlx4/en_tx.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c index 5dc7466ad035..c0177c364bbf 100644 --- a/drivers/net/mlx4/en_tx.c +++ b/drivers/net/mlx4/en_tx.c | |||
@@ -515,14 +515,12 @@ static int get_real_size(struct sk_buff *skb, struct net_device *dev, | |||
515 | else { | 515 | else { |
516 | if (netif_msg_tx_err(priv)) | 516 | if (netif_msg_tx_err(priv)) |
517 | en_warn(priv, "Non-linear headers\n"); | 517 | en_warn(priv, "Non-linear headers\n"); |
518 | dev_kfree_skb_any(skb); | ||
519 | return 0; | 518 | return 0; |
520 | } | 519 | } |
521 | } | 520 | } |
522 | if (unlikely(*lso_header_size > MAX_LSO_HDR_SIZE)) { | 521 | if (unlikely(*lso_header_size > MAX_LSO_HDR_SIZE)) { |
523 | if (netif_msg_tx_err(priv)) | 522 | if (netif_msg_tx_err(priv)) |
524 | en_warn(priv, "LSO header size too big\n"); | 523 | en_warn(priv, "LSO header size too big\n"); |
525 | dev_kfree_skb_any(skb); | ||
526 | return 0; | 524 | return 0; |
527 | } | 525 | } |
528 | } else { | 526 | } else { |
@@ -622,7 +620,7 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
622 | } | 620 | } |
623 | real_size = get_real_size(skb, dev, &lso_header_size); | 621 | real_size = get_real_size(skb, dev, &lso_header_size); |
624 | if (unlikely(!real_size)) | 622 | if (unlikely(!real_size)) |
625 | return NETDEV_TX_OK; | 623 | goto tx_drop; |
626 | 624 | ||
627 | /* Allign descriptor to TXBB size */ | 625 | /* Allign descriptor to TXBB size */ |
628 | desc_size = ALIGN(real_size, TXBB_SIZE); | 626 | desc_size = ALIGN(real_size, TXBB_SIZE); |
@@ -630,8 +628,7 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
630 | if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { | 628 | if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { |
631 | if (netif_msg_tx_err(priv)) | 629 | if (netif_msg_tx_err(priv)) |
632 | en_warn(priv, "Oversized header or SG list\n"); | 630 | en_warn(priv, "Oversized header or SG list\n"); |
633 | dev_kfree_skb_any(skb); | 631 | goto tx_drop; |
634 | return NETDEV_TX_OK; | ||
635 | } | 632 | } |
636 | 633 | ||
637 | tx_ind = skb->queue_mapping; | 634 | tx_ind = skb->queue_mapping; |
@@ -657,8 +654,7 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
657 | if (unlikely(!priv->port_up)) { | 654 | if (unlikely(!priv->port_up)) { |
658 | if (netif_msg_tx_err(priv)) | 655 | if (netif_msg_tx_err(priv)) |
659 | en_warn(priv, "xmit: port down!\n"); | 656 | en_warn(priv, "xmit: port down!\n"); |
660 | dev_kfree_skb_any(skb); | 657 | goto tx_drop; |
661 | return NETDEV_TX_OK; | ||
662 | } | 658 | } |
663 | 659 | ||
664 | /* Track current inflight packets for performance analysis */ | 660 | /* Track current inflight packets for performance analysis */ |
@@ -785,5 +781,10 @@ int mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) | |||
785 | mlx4_en_xmit_poll(priv, tx_ind); | 781 | mlx4_en_xmit_poll(priv, tx_ind); |
786 | 782 | ||
787 | return 0; | 783 | return 0; |
784 | |||
785 | tx_drop: | ||
786 | dev_kfree_skb_any(skb); | ||
787 | priv->stats.tx_dropped++; | ||
788 | return NETDEV_TX_OK; | ||
788 | } | 789 | } |
789 | 790 | ||