]> git.droids-corp.org - dpdk.git/commit
net/i40e: fix Tx descriptor status api tx-desc
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 25 Jun 2018 13:34:51 +0000 (15:34 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Mon, 25 Jun 2018 13:38:29 +0000 (15:38 +0200)
commitd643da2f29b31b1188d58735ecb9bfda23588199
tree9a1b8d09af290073375486bc026ba5fe4e90f3f8
parentba6b53716407104772daff10df7e4cc90931bf28
net/i40e: fix Tx descriptor status api

The Tx descriptor status api was not behaving as expected. This API is
used to inspect the content of the descriptors in the Tx ring to
determine the length of the Tx queue.

Since the software advances the tail pointer and the hardware advances
the head pointer, the Tx queue is located before txq->tx_tail in the
ring. Therefore, a call to rte_eth_tx_descriptor_status(..., offset=20)
should inspect the 20th descriptor before the tail, not after.

As before, we still need to take care about only checking descriptors
that have the RS bit.

Additionally, we can avoid an access to the ring if offset is greater or
equal to nb_tx_desc - nb_tx_free.

Fixes: 68a43d1bb023 ("net/i40e: implement descriptor status API")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
drivers/net/i40e/i40e_rxtx.c