mbuf: remove packet type from offload flags
[dpdk.git] / examples / ip_reassembly / main.c
index 9353df8..741c398 100644 (file)
@@ -50,7 +50,6 @@
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
@@ -86,7 +85,7 @@
 
 #define MAX_JUMBO_PKT_LEN  9600
 
-#define        BUF_SIZE        2048
+#define        BUF_SIZE        RTE_MBUF_DEFAULT_DATAROOM
 #define MBUF_SIZE      \
        (BUF_SIZE + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
 
@@ -357,7 +356,7 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue,
        dst_port = portid;
 
        /* if packet is IPv4 */
-       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;
 
@@ -397,9 +396,8 @@ reassemble(struct rte_mbuf *m, uint8_t portid, uint32_t queue,
                }
 
                eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
-       }
-       /* if packet is IPv6 */
-       else if (m->ol_flags & (PKT_RX_IPV6_HDR | PKT_RX_IPV6_HDR_EXT)) {
+       } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
+               /* if packet is IPv6 */
                struct ipv6_extension_fragment *frag_hdr;
                struct ipv6_hdr *ip_hdr;
 
@@ -858,7 +856,7 @@ setup_port_tbl(struct lcore_queue_conf *qconf, uint32_t lcore, int socket,
        n = RTE_MAX(max_flow_num, 2UL * MAX_PKT_BURST);
        sz = sizeof (*mtb) + sizeof (mtb->m_table[0]) *  n;
 
-       if ((mtb = rte_zmalloc_socket(__func__, sz, CACHE_LINE_SIZE,
+       if ((mtb = rte_zmalloc_socket(__func__, sz, RTE_CACHE_LINE_SIZE,
                        socket)) == NULL) {
                RTE_LOG(ERR, IP_RSMBL, "%s() for lcore: %u, port: %u "
                        "failed to allocate %zu bytes\n",