From: Olivier Matz Date: Tue, 12 Dec 2017 08:43:19 +0000 (+0100) Subject: net/bntx: use new API to get iova address XXX X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4ad5b94e0d13771a48cdf395d0c8b26e5f8cbe91;p=dpdk.git net/bntx: use new API to get iova address XXX XXX: use mbuf instead of m ? The functions rte_mbuf_data_dma_addr*() are deprecated. Replace them with their iova version. Also rename the 'data' variable to 'm' (for mbuf) to avoid confusion. Signed-off-by: Olivier Matz --- diff --git a/drivers/net/bnxt/bnxt_ring.h b/drivers/net/bnxt/bnxt_ring.h index 164f482e34..12992f2da7 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 604aa092c3..226de3c99a 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 *m; - data = __bnxt_alloc_rx_data(rxq->mb_pool); - if (!data) { + m = __bnxt_alloc_rx_data(rxq->mb_pool); + if (!m) { rte_atomic64_inc(&rxq->bp->rx_mbuf_alloc_fail); return -ENOMEM; } - rx_buf->mbuf = data; + rx_buf->mbuf = m; - rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(data)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(m)); 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 *m; - data = __bnxt_alloc_rx_data(rxq->mb_pool); - if (!data) { + m = __bnxt_alloc_rx_data(rxq->mb_pool); + if (!m) { 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 = m; - rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_dma_addr_default(data)); + rxbd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(m)); 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_default(mbuf)); + prod_bd->addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(mbuf)); rxr->rx_prod = prod; } diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c index 8ca4bbd80a..676551e5c1 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; @@ -257,7 +257,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;