summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Krawczyk <mk@semihalf.com>2019-05-28 10:28:34 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-06-13 23:54:29 +0900
commitef74b5f7b69b9502ddab81121611243efcfe1dde (patch)
treee7a84fe79d0008cec0beda0e87caba346d2f03b8
parent5673e285a63347068e51dbd191915348f6a580b0 (diff)
downloaddpdk-ef74b5f7b69b9502ddab81121611243efcfe1dde.zip
dpdk-ef74b5f7b69b9502ddab81121611243efcfe1dde.tar.gz
dpdk-ef74b5f7b69b9502ddab81121611243efcfe1dde.tar.xz
net/ena: fix Rx checksum errors statistics
Rx checksum flags and input errors shouldn't be updated on Tx, as it would work only for packets forwarding. The ierrors statistic should be updated on Rx, right after checking Rx checksum flags if the Rx checksum offload is enabled. Fixes: 1173fca25af9 ("ena: add polling-mode driver") Cc: stable@dpdk.org Signed-off-by: Michal Krawczyk <mk@semihalf.com>
-rw-r--r--drivers/net/ena/ena_ethdev.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index ffecdb8..a42ec8c 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -2089,8 +2089,10 @@ static uint16_t eth_ena_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
ena_rx_mbuf_prepare(mbuf_head, &ena_rx_ctx);
if (unlikely(mbuf_head->ol_flags &
- (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD)))
+ (PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD))) {
+ rte_atomic64_inc(&rx_ring->adapter->drv_stats->ierrors);
++rx_ring->rx_stats.bad_csum;
+ }
mbuf_head->hash.rss = ena_rx_ctx.hash;
@@ -2318,10 +2320,6 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
/* Set TX offloads flags, if applicable */
ena_tx_mbuf_prepare(mbuf, &ena_tx_ctx, tx_ring->offloads);
- if (unlikely(mbuf->ol_flags &
- (PKT_RX_L4_CKSUM_BAD | PKT_RX_IP_CKSUM_BAD)))
- rte_atomic64_inc(&tx_ring->adapter->drv_stats->ierrors);
-
rte_prefetch0(tx_pkts[(sent_idx + 4) & ring_mask]);
/* Process first segment taking into