gpudev: add communication list
[dpdk.git] / examples / ip_fragmentation / main.c
index a7f4097..78205d2 100644 (file)
@@ -21,7 +21,6 @@
 #include <rte_memcpy.h>
 #include <rte_eal.h>
 #include <rte_launch.h>
-#include <rte_atomic.h>
 #include <rte_cycles.h>
 #include <rte_prefetch.h>
 #include <rte_lcore.h>
@@ -146,16 +145,16 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 static struct rte_eth_conf port_conf = {
        .rxmode = {
-               .max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
+               .mtu = JUMBO_FRAME_MAX_SIZE - RTE_ETHER_HDR_LEN -
+                       RTE_ETHER_CRC_LEN,
                .split_hdr_size = 0,
-               .offloads = (DEV_RX_OFFLOAD_CHECKSUM |
-                            DEV_RX_OFFLOAD_SCATTER |
-                            DEV_RX_OFFLOAD_JUMBO_FRAME),
+               .offloads = (RTE_ETH_RX_OFFLOAD_CHECKSUM |
+                            RTE_ETH_RX_OFFLOAD_SCATTER),
        },
        .txmode = {
-               .mq_mode = ETH_MQ_TX_NONE,
-               .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM |
-                            DEV_TX_OFFLOAD_MULTI_SEGS),
+               .mq_mode = RTE_ETH_MQ_TX_NONE,
+               .offloads = (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
+                            RTE_ETH_TX_OFFLOAD_MULTI_SEGS),
        },
 };
 
@@ -299,7 +298,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
                        rte_pktmbuf_free(m);
 
                        /* request HW to regenerate IPv4 cksum */
-                       ol_flags |= (PKT_TX_IPV4 | PKT_TX_IP_CKSUM);
+                       ol_flags |= (RTE_MBUF_F_TX_IPV4 | RTE_MBUF_F_TX_IP_CKSUM);
 
                        /* If we fail to fragment the packet */
                        if (unlikely (len2 < 0))
@@ -624,7 +623,7 @@ check_all_ports_link_status(uint32_t port_mask)
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
-                       if (link.link_status == ETH_LINK_DOWN) {
+                       if (link.link_status == RTE_ETH_LINK_DOWN) {
                                all_ports_up = 0;
                                break;
                        }
@@ -918,9 +917,9 @@ main(int argc, char **argv)
                                "Error during getting device (port %u) info: %s\n",
                                portid, strerror(-ret));
 
-               local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
-                   dev_info.max_rx_pktlen,
-                   local_port_conf.rxmode.max_rx_pkt_len);
+               local_port_conf.rxmode.mtu = RTE_MIN(
+                   dev_info.max_mtu,
+                   local_port_conf.rxmode.mtu);
 
                /* get the lcore_id for this port */
                while (rte_lcore_is_enabled(rx_lcore_id) == 0 ||
@@ -963,8 +962,7 @@ main(int argc, char **argv)
                }
 
                /* set the mtu to the maximum received packet size */
-               ret = rte_eth_dev_set_mtu(portid,
-                       local_port_conf.rxmode.max_rx_pkt_len - MTU_OVERHEAD);
+               ret = rte_eth_dev_set_mtu(portid, local_port_conf.rxmode.mtu);
                if (ret < 0) {
                        printf("\n");
                        rte_exit(EXIT_FAILURE, "Set MTU failed: "