diff options
author | Shannon Nelson <snelson@pensando.io> | 2020-01-06 19:43:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-01-07 13:05:06 -0800 |
commit | 24cfa8c76278d48fe521a363b74e36861b4462d6 (patch) | |
tree | 5e11a92fc2fcc5a54fadb1e7f6cc7d47321852bc /drivers/net/ethernet/pensando/ionic/ionic_txrx.c | |
parent | 3daca28f15f5e70ae54859abd66dcdb6be31ba91 (diff) | |
download | linux-24cfa8c76278d48fe521a363b74e36861b4462d6.tar.bz2 |
ionic: add Rx dropped packet counter
Add a counter for packets dropped by the driver, typically
for bad size or a receive error seen by the device.
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_txrx.c')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_txrx.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c index 97e79949b359..a009bbe9f9be 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c @@ -152,12 +152,16 @@ static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_i stats = q_to_rx_stats(q); netdev = q->lif->netdev; - if (comp->status) + if (comp->status) { + stats->dropped++; return; + } /* no packet processing while resetting */ - if (unlikely(test_bit(IONIC_LIF_QUEUE_RESET, q->lif->state))) + if (unlikely(test_bit(IONIC_LIF_QUEUE_RESET, q->lif->state))) { + stats->dropped++; return; + } stats->pkts++; stats->bytes += le16_to_cpu(comp->len); @@ -167,8 +171,10 @@ static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_i else skb = ionic_rx_frags(q, desc_info, cq_info); - if (unlikely(!skb)) + if (unlikely(!skb)) { + stats->dropped++; return; + } skb_record_rx_queue(skb, q->index); |