mbuf: rename physical address to IOVA
[dpdk.git] / drivers / net / dpaa / dpaa_rxtx.c
index 9c25d8c..41e57f2 100644 (file)
@@ -32,7 +32,6 @@
  */
 
 /* System headers */
-#include <stdio.h>
 #include <inttypes.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -40,7 +39,6 @@
 #include <sched.h>
 #include <pthread.h>
 
-#include <rte_config.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
 #include <rte_interrupts.h>
 #include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_memory.h>
-#include <rte_memzone.h>
 #include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
-#include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_ring.h>
 #include <rte_ip.h>
                (_fd)->opaque = QM_FD_CONTIG << DPAA_FD_FORMAT_SHIFT; \
                (_fd)->opaque |= ((_mbuf)->data_off) << DPAA_FD_OFFSET_SHIFT; \
                (_fd)->opaque |= (_mbuf)->pkt_len; \
-               (_fd)->addr = (_mbuf)->buf_physaddr; \
+               (_fd)->addr = (_mbuf)->buf_iova; \
                (_fd)->bpid = _bpid; \
        } while (0)
 
+#if (defined RTE_LIBRTE_DPAA_DEBUG_DRIVER)
+void dpaa_display_frame(const struct qm_fd *fd)
+{
+       int ii;
+       char *ptr;
+
+       printf("%s::bpid %x addr %08x%08x, format %d off %d, len %d stat %x\n",
+              __func__, fd->bpid, fd->addr_hi, fd->addr_lo, fd->format,
+               fd->offset, fd->length20, fd->status);
+
+       ptr = (char *)rte_dpaa_mem_ptov(fd->addr);
+       ptr += fd->offset;
+       printf("%02x ", *ptr);
+       for (ii = 1; ii < fd->length20; ii++) {
+               printf("%02x ", *ptr);
+               if ((ii % 16) == 0)
+                       printf("\n");
+               ptr++;
+       }
+       printf("\n");
+}
+#else
+#define dpaa_display_frame(a)
+#endif
+
 static inline void dpaa_slow_parsing(struct rte_mbuf *m __rte_unused,
                                     uint64_t prs __rte_unused)
 {
@@ -196,7 +217,7 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m,
 
        /* Check if Vlan is present */
        if (prs & DPAA_PARSE_VLAN_MASK)
-               m->ol_flags |= PKT_RX_VLAN_PKT;
+               m->ol_flags |= PKT_RX_VLAN;
        /* Packet received without stripping the vlan */
 }
 
@@ -353,6 +374,7 @@ static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd,
                return dpaa_eth_sg_to_mbuf(fd, ifid);
 
        /* Ignoring case when format != qm_fd_contig */
+       dpaa_display_frame(fd);
        ptr = rte_dpaa_mem_ptov(fd->addr);
        /* Ignoring case when ptr would be NULL. That is only possible incase
         * of a corrupted packet
@@ -492,7 +514,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
 
        sgt = temp->buf_addr + temp->data_off;
        fd->format = QM_FD_SG;
-       fd->addr = temp->buf_physaddr;
+       fd->addr = temp->buf_iova;
        fd->offset = temp->data_off;
        fd->bpid = bpid;
        fd->length20 = mbuf->pkt_len;
@@ -501,7 +523,7 @@ dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
                sg_temp = &sgt[i++];
                sg_temp->opaque = 0;
                sg_temp->val = 0;
-               sg_temp->addr = cur_seg->buf_physaddr;
+               sg_temp->addr = cur_seg->buf_iova;
                sg_temp->offset = cur_seg->data_off;
                sg_temp->length = cur_seg->data_len;
                if (RTE_MBUF_DIRECT(cur_seg)) {