From: Olivier Matz Date: Wed, 3 Jan 2018 10:32:24 +0000 (+0100) Subject: net/bnxt: use new API to get IOVA address X-Git-Tag: spdx-start~363 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=42b883535804d69ca8b21b39087fc1d14a1ee3f3;p=dpdk.git net/bnxt: use new API to get IOVA address Replace internal functions to get DMA address them with their generic IOVA version. Also rename the 'data' variable to 'mbuf' for more readability. Signed-off-by: Olivier Matz Acked-by: Ajit Khaparde --- diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h index a88ab55f4a..ebf7228e4b 100644 --- a/drivers/net/bnxt/bnxt_ring.h +++ b/drivers/net/bnxt/bnxt_ring.h @@ -40,9 +40,6 @@ #define RING_NEXT(ring, idx) (((idx) + 1) & (ring)->ring_mask) -#define RTE_MBUF_DATA_DMA_ADDR(mb) \ - ((uint64_t)((mb)->buf_iova + (mb)->data_off)) - #define DB_IDX_MASK 0xffffff #define DB_IDX_VALID (0x1 << 26) #define DB_IRQ_DIS (0x1 << 27) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 188df362e0..89114ccb7d 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -65,17 +65,17 @@ static inline int bnxt_alloc_rx_data(struct bnxt_rx_queue *rxq, { struct rx_prod_pkt_bd *rxbd = &rxr->rx_desc_ring[prod]; struct bnxt_sw_rx_bd *rx_buf = &rxr->rx_buf_ring[prod]; - struct rte_mbuf *data; + struct rte_mbuf *mbuf; - data = __bnxt_alloc_rx_data(rxq->mb_pool); - if (!data) { + mbuf = __bnxt_alloc_rx_data(rxq->mb_pool); + if (!mbuf) { rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail); return -ENOMEM; } - rx_buf->mbuf = data; + rx_buf->mbuf = mbuf; - rxbd->addr = rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR(rx_buf->mbuf)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); return 0; } @@ -86,10 +86,10 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq, { struct rx_prod_pkt_bd *rxbd = &rxr->ag_desc_ring[prod]; struct bnxt_sw_rx_bd *rx_buf = &rxr->ag_buf_ring[prod]; - struct rte_mbuf *data; + struct rte_mbuf *mbuf; - data = __bnxt_alloc_rx_data(rxq->mb_pool); - if (!data) { + mbuf = __bnxt_alloc_rx_data(rxq->mb_pool); + if (!mbuf) { rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail); return -ENOMEM; } @@ -100,9 +100,9 @@ static inline int bnxt_alloc_ag_data(struct bnxt_rx_queue *rxq, RTE_LOG(ERR, PMD, "Jumbo Frame. rx_buf is NULL\n"); - rx_buf->mbuf = data; + rx_buf->mbuf = mbuf; - rxbd->addr = rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR(rx_buf->mbuf)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); return 0; } @@ -123,7 +123,7 @@ static inline void bnxt_reuse_rx_mbuf(struct bnxt_rx_ring_info *rxr, prod_bd = &rxr->rx_desc_ring[prod]; - prod_bd->addr = rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR(mbuf)); + prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova(mbuf)); rxr->rx_prod = prod; } diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 4a152aa86f..ac77434b71 100644 --- a/drivers/net/bnxt/bnxt_txr.c +++ b/drivers/net/bnxt/bnxt_txr.c @@ -181,7 +181,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt, txbd->flags_type |= TX_BD_LONG_FLAGS_LHINT_GTE2K; else txbd->flags_type |= lhint_arr[txbd->len >> 9]; - txbd->addr = rte_cpu_to_le_32(RTE_MBUF_DATA_DMA_ADDR(tx_buf->mbuf)); + txbd->addr = rte_cpu_to_le_32(rte_mbuf_data_iova(tx_buf->mbuf)); if (long_bd) { txbd->flags_type |= TX_BD_LONG_TYPE_TX_BD_LONG; @@ -262,7 +262,7 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt, tx_buf = &txr->tx_buf_ring[txr->tx_prod]; txbd = &txr->tx_desc_ring[txr->tx_prod]; - txbd->addr = rte_cpu_to_le_32(RTE_MBUF_DATA_DMA_ADDR(m_seg)); + txbd->addr = rte_cpu_to_le_32(rte_mbuf_data_iova(m_seg)); txbd->flags_type = TX_BD_SHORT_TYPE_TX_BD_SHORT; txbd->len = m_seg->data_len;