net/igb: fix Tx descriptor status api
authorOlivier Matz <olivier.matz@6wind.com>
Mon, 25 Jun 2018 13:34:48 +0000 (15:34 +0200)
committerOlivier Matz <olivier.matz@6wind.com>
Mon, 25 Jun 2018 13:37:38 +0000 (15:37 +0200)
commitde0ae4440ad84edc4eb6892eb2a618712d32fa78
tree4fa94c8b755645e01f91525f932eba26472bb562
parentb8e634a36e623615a59e1448cf49885b127b126c
net/igb: 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.

Fixes: 7d499cb15e8a ("net/igb: implement descriptor status API")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
drivers/net/e1000/igb_rxtx.c