mbuf: remove packet type from offload flags
[dpdk.git] / examples / ip_fragmentation / main.c
index cf63718..fbc0b8d 100644 (file)
@@ -76,8 +76,6 @@
 
 #define RTE_LOGTYPE_IP_FRAG RTE_LOGTYPE_USER1
 
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
-
 /* allow max jumbo frame 9.5 KB */
 #define JUMBO_FRAME_MAX_SIZE   0x2600
 
@@ -285,7 +283,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
        len = qconf->tx_mbufs[port_out].len;
 
        /* if this is an IPv4 packet */
-       if (m->ol_flags & PKT_RX_IPV4_HDR) {
+       if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
                struct ipv4_hdr *ip_hdr;
                uint32_t ip_dst;
                /* Read the lookup key (i.e. ip_dst) from the input packet */
@@ -319,9 +317,8 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
                        if (unlikely (len2 < 0))
                                return;
                }
-       }
-       /* if this is an IPv6 packet */
-       else if (m->ol_flags & PKT_RX_IPV6_HDR) {
+       } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+               /* if this is an IPv6 packet */
                struct ipv6_hdr *ip_hdr;
 
                ipv6 = 1;
@@ -744,12 +741,8 @@ init_mem(void)
                                        socket);
                        snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
 
-                       mp = rte_mempool_create(buf, NB_MBUF,
-                                                  MBUF_SIZE, 32,
-                                                  sizeof(struct rte_pktmbuf_pool_private),
-                                                  rte_pktmbuf_pool_init, NULL,
-                                                  rte_pktmbuf_init, NULL,
-                                                  socket, 0);
+                       mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32,
+                               0, RTE_MBUF_DEFAULT_BUF_SIZE, socket);
                        if (mp == NULL) {
                                RTE_LOG(ERR, IP_FRAG, "Cannot create direct mempool\n");
                                return -1;
@@ -762,12 +755,8 @@ init_mem(void)
                                        socket);
                        snprintf(buf, sizeof(buf), "pool_indirect_%i", socket);
 
-                       mp = rte_mempool_create(buf, NB_MBUF,
-                                                          sizeof(struct rte_mbuf), 32,
-                                                          sizeof(struct rte_pktmbuf_pool_private),
-                                                          rte_pktmbuf_pool_init, NULL,
-                                                          rte_pktmbuf_init, NULL,
-                                                          socket, 0);
+                       mp = rte_pktmbuf_pool_create(buf, NB_MBUF, 32, 0, 0,
+                               socket);
                        if (mp == NULL) {
                                RTE_LOG(ERR, IP_FRAG, "Cannot create indirect mempool\n");
                                return -1;