[v3,2/5] failsafe: use public rx/tx burst API
Checks
Commit Message
The failsafe rx/tx functions are calling the rx/tx functions of
sub-devices via the function pointers stored in the rte_eth_dev
structure rather than use the public APIs (rte_eth_rx/tx_burst).
Use the public API rather than access structure internals which could
change in the future.
Signed-off-by: Luc Pelletier <lucp.at.work@gmail.com>
---
drivers/net/failsafe/failsafe_rxtx.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
@@ -50,7 +50,6 @@ failsafe_rx_burst(void *queue,
{
struct sub_device *sdev;
struct rxq *rxq;
- void *sub_rxq;
uint16_t nb_rx;
rxq = queue;
@@ -61,10 +60,8 @@ failsafe_rx_burst(void *queue,
sdev = sdev->next;
continue;
}
- sub_rxq = ETH(sdev)->data->rx_queues[rxq->qid];
FS_ATOMIC_P(rxq->refcnt[sdev->sid]);
- nb_rx = ETH(sdev)->
- rx_pkt_burst(sub_rxq, rx_pkts, nb_pkts);
+ nb_rx = rte_eth_rx_burst(PORT_ID(sdev), rxq->qid, rx_pkts, nb_pkts);
FS_ATOMIC_V(rxq->refcnt[sdev->sid]);
sdev = sdev->next;
} while (nb_rx == 0 && sdev != rxq->sdev);
@@ -82,16 +79,14 @@ failsafe_tx_burst(void *queue,
{
struct sub_device *sdev;
struct txq *txq;
- void *sub_txq;
uint16_t nb_tx;
txq = queue;
sdev = TX_SUBDEV(&rte_eth_devices[txq->priv->data->port_id]);
if (unlikely(fs_tx_unsafe(sdev)))
return 0;
- sub_txq = ETH(sdev)->data->tx_queues[txq->qid];
FS_ATOMIC_P(txq->refcnt[sdev->sid]);
- nb_tx = ETH(sdev)->tx_pkt_burst(sub_txq, tx_pkts, nb_pkts);
+ nb_tx = rte_eth_tx_burst(PORT_ID(sdev), txq->qid, tx_pkts, nb_pkts);
FS_ATOMIC_V(txq->refcnt[sdev->sid]);
return nb_tx;
}