The following commits changed the master branch of DPDK:

http://dpdk.org/browse/dpdk/commit/?id=7869536f
http://dpdk.org/browse/dpdk/commit/?id=ca04aaea
http://dpdk.org/browse/dpdk/commit/?id=08b563ff
http://dpdk.org/browse/dpdk/commit/?id=ea672a8b
http://dpdk.org/browse/dpdk/commit/?id=9aaccf1a
http://dpdk.org/browse/dpdk/commit/?id=e5ffdd14
http://dpdk.org/browse/dpdk/commit/?id=591a9d79

This patch adjust the code to these changes.

Signed-off-by: Zoltan Kiss <zoltan.k...@linaro.org>
diff --git a/platform/linux-dpdk/odp_buffer.c b/platform/linux-dpdk/odp_buffer.c
index 4914ca2..b586fa2 100644
--- a/platform/linux-dpdk/odp_buffer.c
+++ b/platform/linux-dpdk/odp_buffer.c
@@ -69,8 +69,6 @@ int odp_buffer_snprint(char *str, size_t n, odp_buffer_t buf)
        len += snprintf(&str[len], n-len,
                        "  ref_count    %i\n",        hdr->mb.refcnt);
        len += snprintf(&str[len], n-len,
-                       "  dpdk type    %i\n",        hdr->mb.type);
-       len += snprintf(&str[len], n-len,
                        "  odp type     %i\n",        hdr->type);
 
        return len;
diff --git a/platform/linux-dpdk/odp_buffer_pool.c 
b/platform/linux-dpdk/odp_buffer_pool.c
index 8325b9e..e2183d6 100644
--- a/platform/linux-dpdk/odp_buffer_pool.c
+++ b/platform/linux-dpdk/odp_buffer_pool.c
@@ -169,18 +169,18 @@ odp_dpdk_mbuf_ctor(struct rte_mempool *mp,
        /* keep some headroom between start of buffer and data */
        if (mb_ctor_arg->buf_type == ODP_BUFFER_TYPE_PACKET ||
            mb_ctor_arg->buf_type == ODP_BUFFER_TYPE_ANY)
-               mb->pkt.data = (char *)mb->buf_addr + RTE_PKTMBUF_HEADROOM;
+               mb->data_off = RTE_PKTMBUF_HEADROOM;
        else
-               mb->pkt.data = mb->buf_addr;
+               mb->data_off = 0;
 
        /* init some constant fields */
-       mb->type         = RTE_MBUF_PKT;
        mb->pool         = mp;
-       mb->pkt.nb_segs  = 1;
-       mb->pkt.in_port  = 0xff;
+       mb->nb_segs  = 1;
+       mb->port  = 0xff;
        mb->ol_flags     = 0;
-       mb->pkt.vlan_macip.data = 0;
-       mb->pkt.hash.rss = 0;
+       mb->l2_l3_len = 0;
+       mb->vlan_tci = 0;
+       mb->hash.rss = 0;
 
        /* Save index, might be useful for debugging purposes */
        buf_hdr = (struct odp_buffer_hdr_t *)raw_mbuf;
@@ -282,5 +282,5 @@ void odp_buffer_free(odp_buffer_t buf)
 
 void odp_buffer_pool_print(odp_buffer_pool_t pool_id)
 {
-       rte_mempool_dump((const struct rte_mempool *)pool_id);
+       rte_mempool_dump(stdout, (const struct rte_mempool *)pool_id);
 }
diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c
index ecc2066..97f8b21 100644
--- a/platform/linux-dpdk/odp_init.c
+++ b/platform/linux-dpdk/odp_init.c
@@ -37,11 +37,6 @@ int odp_init_dpdk(void)
                return -1;
        }
 
-       if (rte_pmd_init_all() < 0) {
-               ODP_ERR("Cannot init pmd\n");
-               return -1;
-       }
-
        if (rte_eal_pci_probe() < 0) {
                ODP_ERR("Cannot probe PCI\n");
                return -1;
diff --git a/platform/linux-dpdk/odp_packet.c b/platform/linux-dpdk/odp_packet.c
index 1cd190d..0586538 100644
--- a/platform/linux-dpdk/odp_packet.c
+++ b/platform/linux-dpdk/odp_packet.c
@@ -51,14 +51,12 @@ static int odp_packet_set_offset_len(odp_packet_t pkt, 
size_t frame_offset,
                                     size_t len)
 {
        struct rte_mbuf *mb = &(odp_packet_hdr(pkt)->buf_hdr.mb);
-       uint16_t offset;
+       uint16_t offset = mb->data_off;
        uint16_t data_len;
 
        /* The pkt buf may have been pulled back into the headroom
         * so we cannot rely on finding the data right after the
         * ODP header and HEADROOM */
-       offset = (uint16_t)((unsigned long)mb->pkt.data -
-                           (unsigned long)mb->buf_addr);
        ODP_ASSERT(mb->buf_len >= offset, "Corrupted mbuf");
        data_len = mb->buf_len - offset;
 
@@ -66,14 +64,14 @@ static int odp_packet_set_offset_len(odp_packet_t pkt, 
size_t frame_offset,
                ODP_ERR("Frame offset too big");
                return -1;
        }
-       mb->pkt.data = (void *)((char *)mb->pkt.data + frame_offset);
+       mb->data_off += frame_offset;
        data_len -= frame_offset;
 
        if (data_len < len) {
                ODP_ERR("Packet len too big");
                return -1;
        }
-       mb->pkt.pkt_len = len;
+       mb->pkt_len = len;
 
        return 0;
 }
@@ -86,7 +84,7 @@ void odp_packet_set_len(odp_packet_t pkt, size_t len)
 size_t odp_packet_get_len(odp_packet_t pkt)
 {
        struct rte_mbuf *mb = &(odp_packet_hdr(pkt)->buf_hdr.mb);
-       return mb->pkt.pkt_len;
+       return mb->pkt_len;
 }
 
 uint8_t *odp_packet_buf_addr(odp_packet_t pkt)
@@ -97,7 +95,7 @@ uint8_t *odp_packet_buf_addr(odp_packet_t pkt)
 uint8_t *odp_packet_start(odp_packet_t pkt)
 {
        struct rte_mbuf *mb = &(odp_packet_hdr(pkt)->buf_hdr.mb);
-       return mb->pkt.data;
+       return ((uint8_t *)(mb->buf_addr) + mb->data_off);
 }
 
 
@@ -360,13 +358,13 @@ void odp_packet_print(odp_packet_t pkt)
        len += snprintf(&str[len], n-len,
                        "  l4_offset    %u\n", hdr->l4_offset);
        len += snprintf(&str[len], n-len,
-                       "  frame_len    %u\n", hdr->buf_hdr.mb.pkt.pkt_len);
+                       "  frame_len    %u\n", hdr->buf_hdr.mb.pkt_len);
        len += snprintf(&str[len], n-len,
                        "  input        %u\n", hdr->input);
        str[len] = '\0';
 
        printf("\n%s\n", str);
-       rte_pktmbuf_dump(&hdr->buf_hdr.mb, 32);
+       rte_pktmbuf_dump(stdout, &hdr->buf_hdr.mb, 32);
 
        p = odp_packet_start(pkt);
        printf("00000000: %02X %02X %02X %02X %02X %02X %02X %02X\n",
@@ -393,12 +391,12 @@ int odp_packet_copy(odp_packet_t pkt_dst, odp_packet_t 
pkt_src)
        mb_dst = &(odp_packet_hdr(pkt_dst)->buf_hdr.mb);
        mb_src = &(odp_packet_hdr(pkt_src)->buf_hdr.mb);
 
-       if (mb_dst->pkt.nb_segs != mb_src->pkt.nb_segs) {
+       if (mb_dst->nb_segs != mb_src->nb_segs) {
                ODP_ERR("Different nb_segs in pkt_dst and pkt_src");
                return -1;
        }
 
-       nb_segs = mb_src->pkt.nb_segs;
+       nb_segs = mb_src->nb_segs;
 
        if (mb_dst->buf_len < mb_src->buf_len) {
                ODP_ERR("dst_pkt smaller than src_pkt");
@@ -411,8 +409,8 @@ int odp_packet_copy(odp_packet_t pkt_dst, odp_packet_t 
pkt_src)
                        return -1;
                }
                memcpy(mb_dst->buf_addr, mb_src->buf_addr, mb_src->buf_len);
-               mb_dst = mb_dst->pkt.next;
-               mb_src = mb_src->pkt.next;
+               mb_dst = mb_dst->next;
+               mb_src = mb_src->next;
        }
        return 0;
 }
diff --git a/platform/linux-dpdk/odp_packet_dpdk.c 
b/platform/linux-dpdk/odp_packet_dpdk.c
index 9fe4bbd..94653d4 100644
--- a/platform/linux-dpdk/odp_packet_dpdk.c
+++ b/platform/linux-dpdk/odp_packet_dpdk.c
@@ -167,7 +167,7 @@ int recv_pkt_dpdk(pkt_dpdk_t * const pkt_dpdk, odp_packet_t 
pkt_table[],
        for (i = 0; i < nb_rx; i++) {
                odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt_table[i]);
                struct rte_mbuf *mb = &pkt_hdr->buf_hdr.mb;
-               odp_packet_parse(pkt_table[i], mb->pkt.pkt_len, 0);
+               odp_packet_parse(pkt_table[i], mb->pkt_len, 0);
        }
        return nb_rx;
 }

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to