net/bntx: use new API to get iova address XXX
authorOlivier Matz <olivier.matz@6wind.com>
Tue, 12 Dec 2017 08:43:19 +0000 (09:43 +0100)
committerOlivier Matz <olivier.matz@6wind.com>
Thu, 14 Dec 2017 12:19:04 +0000 (13:19 +0100)
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 <olivier.matz@6wind.com>
drivers/net/bnxt/bnxt_ring.h
drivers/net/bnxt/bnxt_rxr.c
drivers/net/bnxt/bnxt_txr.c

index 164f482..12992f2 100644 (file)
@@ -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)
index 604aa09..226de3c 100644 (file)
@@ -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;
 }
index 8ca4bbd..676551e 100644 (file)
@@ -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;