Commit 24cfa8c7 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

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: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3daca28f
...@@ -37,6 +37,7 @@ struct ionic_rx_stats { ...@@ -37,6 +37,7 @@ struct ionic_rx_stats {
u64 csum_complete; u64 csum_complete;
u64 csum_error; u64 csum_error;
u64 buffers_posted; u64 buffers_posted;
u64 dropped;
}; };
#define IONIC_QCQ_F_INITED BIT(0) #define IONIC_QCQ_F_INITED BIT(0)
......
...@@ -39,6 +39,7 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = { ...@@ -39,6 +39,7 @@ static const struct ionic_stat_desc ionic_rx_stats_desc[] = {
IONIC_RX_STAT_DESC(csum_none), IONIC_RX_STAT_DESC(csum_none),
IONIC_RX_STAT_DESC(csum_complete), IONIC_RX_STAT_DESC(csum_complete),
IONIC_RX_STAT_DESC(csum_error), IONIC_RX_STAT_DESC(csum_error),
IONIC_RX_STAT_DESC(dropped),
}; };
static const struct ionic_stat_desc ionic_txq_stats_desc[] = { static const struct ionic_stat_desc ionic_txq_stats_desc[] = {
......
...@@ -152,12 +152,16 @@ static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_i ...@@ -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); stats = q_to_rx_stats(q);
netdev = q->lif->netdev; netdev = q->lif->netdev;
if (comp->status) if (comp->status) {
stats->dropped++;
return; return;
}
/* no packet processing while resetting */ /* 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; return;
}
stats->pkts++; stats->pkts++;
stats->bytes += le16_to_cpu(comp->len); 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 ...@@ -167,8 +171,10 @@ static void ionic_rx_clean(struct ionic_queue *q, struct ionic_desc_info *desc_i
else else
skb = ionic_rx_frags(q, desc_info, cq_info); skb = ionic_rx_frags(q, desc_info, cq_info);
if (unlikely(!skb)) if (unlikely(!skb)) {
stats->dropped++;
return; return;
}
skb_record_rx_queue(skb, q->index); skb_record_rx_queue(skb, q->index);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment