]> git.droids-corp.org - dpdk.git/commitdiff
net/ena: assert on outstanding mbuf in Tx
authorMichal Krawczyk <mk@semihalf.com>
Wed, 23 Feb 2022 12:19:25 +0000 (13:19 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 23 Feb 2022 17:53:49 +0000 (18:53 +0100)
To make sure there is no outstanding mbuf in the reused Tx queue (due to
improper cleanup, or some invalid logic on Tx path), the assertion was
added on the Tx path.

As it's being compiled out in the release version, it won't affect
the IO path performance.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Dawid Gorecki <dgr@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
drivers/net/ena/ena_ethdev.c

index deaee30664227fea6ea583656909ed36abfb1373..34fb43cb00741cade2b5b5c85bd6e1ef18d7e723 100644 (file)
@@ -2661,6 +2661,7 @@ static int ena_xmit_mbuf(struct ena_ring *tx_ring, struct rte_mbuf *mbuf)
        req_id = tx_ring->empty_tx_reqs[next_to_use];
        tx_info = &tx_ring->tx_buffer_info[req_id];
        tx_info->num_of_bufs = 0;
+       RTE_ASSERT(tx_info->mbuf == NULL);
 
        ena_tx_map_mbuf(tx_ring, tx_info, mbuf, &push_header, &header_len);