Reviewed-by: Michael Shamis <michae...@marvell.com>

-----Original Message-----
From: dev <dev-boun...@dpdk.org> On Behalf Of lir...@marvell.com
Sent: Wednesday, December 2, 2020 12:12 PM
To: Jerin Jacob Kollanukkaran <jer...@marvell.com>
Cc: dev@dpdk.org; Yuri Chipchev <yu...@marvell.com>; Liron Himi 
<lir...@marvell.com>
Subject: [dpdk-dev] [PATCH v1 10/38] net/mvpp2: cosmetic changes to cookie usage
From: Yuri Chipchev <yu...@marvell.com>

No need to add high address to cookie on transmit side, as it has already 64bit 
value

Signed-off-by: Yuri Chipchev <yu...@marvell.com>
Reviewed-by: Liron Himi <lir...@marvell.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c 
index e81d5ee91..130f5221d 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -1643,14 +1643,16 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
                if (((uint64_t)mbufs[i] & MRVL_COOKIE_HIGH_ADDR_MASK)
                        != cookie_addr_high) {
                        MRVL_LOG(ERR,
-                               "mbuf virtual addr high 0x%lx out of range",
-                               (uint64_t)mbufs[i] >> 32);
+                               "mbuf virtual addr high is out of range "
+                               "0x%x instead of 0x%x\n",
+                               (uint32_t)((uint64_t)mbufs[i] >> 32),
+                               (uint32_t)(cookie_addr_high >> 32));
                        goto out;
                }
 
                entries[i].buff.addr =
                        rte_mbuf_data_iova_default(mbufs[i]);
-               entries[i].buff.cookie = (uint64_t)mbufs[i];
+               entries[i].buff.cookie = (uintptr_t)mbufs[i];
                entries[i].bpool = bpool;
        }
 
@@ -2549,8 +2551,7 @@ mrvl_free_sent_buffers(struct pp2_ppio *ppio, struct 
pp2_hif *hif,
                if (unlikely(!entry->bpool)) {
                        struct rte_mbuf *mbuf;
 
-                       mbuf = (struct rte_mbuf *)
-                              (cookie_addr_high | entry->buff.cookie);
+                       mbuf = (struct rte_mbuf *)entry->buff.cookie;
                        rte_pktmbuf_free(mbuf);
                        skip_bufs = 1;
                        goto skip;
@@ -2663,7 +2664,7 @@ mrvl_tx_pkt_burst(void *txq, struct rte_mbuf **tx_pkts, 
uint16_t nb_pkts)
                for (i = nb_pkts; i < num; i++) {
                        sq->head = (MRVL_PP2_TX_SHADOWQ_SIZE + sq->head - 1) &
                                MRVL_PP2_TX_SHADOWQ_MASK;
-                       addr = cookie_addr_high | sq->ent[sq->head].buff.cookie;
+                       addr = sq->ent[sq->head].buff.cookie;
                        bytes_sent -=
                                rte_pktmbuf_pkt_len((struct rte_mbuf *)addr);
                }
--
2.28.0

Reply via email to