]> git.droids-corp.org - dpdk.git/commitdiff
ethdev: convert remaining apps to new offload API
authorThomas Monjalon <thomas@monjalon.net>
Mon, 2 Jul 2018 21:27:48 +0000 (23:27 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 4 Jul 2018 19:50:22 +0000 (21:50 +0200)
Some test applications and examples were not converted
to the new offload API introduced in 17.11.

For reference, see "Hardware Offload" in
doc/guides/prog_guide/poll_mode_drv.rst

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
13 files changed:
app/test-eventdev/test_perf_common.c
doc/guides/sample_app_ug/l2_forward_job_stats.rst
doc/guides/sample_app_ug/l2_forward_real_virtual.rst
doc/guides/sample_app_ug/link_status_intr.rst
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
examples/bbdev_app/main.c
examples/ip_pipeline/link.c
test/test-pipeline/init.c
test/test/test_kni.c
test/test/test_link_bonding.c
test/test/test_link_bonding_mode4.c
test/test/test_link_bonding_rssconf.c
test/test/test_pmd_perf.c

index d00f918026631e3c63ae421434d4d17d27c1016d..eed80d1b1508a2ce640a8ffbcd04805507b8f9bc 100644 (file)
@@ -680,13 +680,7 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
                        .mq_mode = ETH_MQ_RX_RSS,
                        .max_rx_pkt_len = ETHER_MAX_LEN,
                        .split_hdr_size = 0,
-                       .header_split   = 0,
-                       .hw_ip_checksum = 0,
-                       .hw_vlan_filter = 0,
-                       .hw_vlan_strip  = 0,
-                       .hw_vlan_extend = 0,
-                       .jumbo_frame    = 0,
-                       .hw_strip_crc   = 1,
+                       .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
                },
                .rx_adv_conf = {
                        .rss_conf = {
index d7219a2939ff6ad6b71444168e198b32eef785f8..ba73d85579d26b967c6ed0cf034c16417f660615 100644 (file)
@@ -218,25 +218,6 @@ The rte_eth_dev_configure() function is used to configure the number of queues f
             "err=%d, port=%u\n",
             ret, portid);
 
-The global configuration is stored in a static structure:
-
-.. code-block:: c
-
-    static const struct rte_eth_conf port_conf = {
-        .rxmode = {
-            .split_hdr_size = 0,
-            .header_split = 0,   /**< Header Split disabled */
-            .hw_ip_checksum = 0, /**< IP checksum offload disabled */
-            .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-            .jumbo_frame = 0,    /**< Jumbo Frame Support disabled */
-            .hw_strip_crc= 0,    /**< CRC stripped by hardware */
-        },
-
-        .txmode = {
-            .mq_mode = ETH_DCB_NONE
-        },
-    };
-
 RX Queue Initialization
 ~~~~~~~~~~~~~~~~~~~~~~~
 
index b459d4efee98c0cf711d375da6f244b08233aeb5..2b2d5afa07a996e27bf32487c363b3580161678b 100644 (file)
@@ -245,25 +245,6 @@ The rte_eth_dev_configure() function is used to configure the number of queues f
             "err=%d, port=%u\n",
             ret, portid);
 
-The global configuration is stored in a static structure:
-
-.. code-block:: c
-
-    static const struct rte_eth_conf port_conf = {
-        .rxmode = {
-            .split_hdr_size = 0,
-            .header_split = 0,   /**< Header Split disabled */
-            .hw_ip_checksum = 0, /**< IP checksum offload disabled */
-            .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-            .jumbo_frame = 0,    /**< Jumbo Frame Support disabled */
-            .hw_strip_crc= 0,    /**< CRC stripped by hardware */
-        },
-
-        .txmode = {
-            .mq_mode = ETH_DCB_NONE
-        },
-    };
-
 .. _l2_fwd_app_rx_init:
 
 RX Queue Initialization
index 8c11ba4ae80a8ecfb10a70c05542370da387f65d..c7665fe5cf5ad95a8d2311ddaba474108027f4e8 100644 (file)
@@ -137,10 +137,7 @@ The global configuration is stored in a static structure:
     static const struct rte_eth_conf port_conf = {
         .rxmode = {
             .split_hdr_size = 0,
-            .header_split = 0,   /**< Header Split disabled */
-            .hw_ip_checksum = 0, /**< IP checksum offload disabled */
-            .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-            .hw_strip_crc= 0,    /**< CRC stripped by hardware */
+            .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
         },
         .txmode = {},
         .intr_conf = {
index 83fcdf637235da3481a4db04665af48951c6e057..0e9da9707a74a89c173cabc6b620905b4307fd79 100644 (file)
@@ -102,10 +102,6 @@ a default structure is provided for VMDQ and DCB configuration to be filled in l
         .rxmode = {
             .mq_mode        = ETH_MQ_RX_VMDQ_DCB,
             .split_hdr_size = 0,
-            .header_split   = 0, /**< Header Split disabled */
-            .hw_ip_checksum = 0, /**< IP checksum offload disabled */
-            .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-            .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
         },
         .txmode = {
             .mq_mode = ETH_MQ_TX_VMDQ_DCB,
index 254cc06763f3ceb0f8d03909aa3d8d7d13cd1649..045a190b9d99dd9cdfe7835897d051b4ef3fdb1c 100644 (file)
@@ -64,11 +64,7 @@ static const struct rte_eth_conf port_conf = {
                .mq_mode = ETH_MQ_RX_NONE,
                .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload disabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc = 0, /**< CRC stripped by hardware */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
index b8a431f3e0cbc4c8d9e1091a19d403c5a99cded9..181c31f9c4bc64f8cfc11b3d79d82e0727bc963f 100644 (file)
@@ -40,18 +40,9 @@ static struct rte_eth_conf port_conf_default = {
        .link_speeds = 0,
        .rxmode = {
                .mq_mode = ETH_MQ_RX_NONE,
-
-               .header_split   = 0, /* Header split */
-               .hw_ip_checksum = 0, /* IP checksum offload */
-               .hw_vlan_filter = 0, /* VLAN filtering */
-               .hw_vlan_strip  = 0, /* VLAN strip */
-               .hw_vlan_extend = 0, /* Extended VLAN */
-               .jumbo_frame    = 0, /* Jumbo frame support */
-               .hw_strip_crc   = 1, /* CRC strip by HW */
-               .enable_scatter = 0, /* Scattered packets RX handler */
-
                .max_rx_pkt_len = 9000, /* Jumbo frame max packet len */
                .split_hdr_size = 0, /* Header split buffer size */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .rx_adv_conf = {
                .rss_conf = {
index 19cf04a6c9d6ce6470c9e5f81d1e78e58d477297..f33216c90df326799b6b76d2144f539139adb683 100644 (file)
@@ -70,11 +70,7 @@ struct app_params app = {
 static struct rte_eth_conf port_conf = {
        .rxmode = {
                .split_hdr_size = 0,
-               .header_split   = 0, /* Header Split disabled */
-               .hw_ip_checksum = 1, /* IP checksum offload enabled */
-               .hw_vlan_filter = 0, /* VLAN filtering disabled */
-               .jumbo_frame    = 0, /* Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /* CRC stripped by hardware */
+               .offloads = DEV_RX_OFFLOAD_CHECKSUM | DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .rx_adv_conf = {
                .rss_conf = {
index 56773c8a2ee4943acb00046c2d947a6fea421330..1b876719ab8ab553780384b4507ce2536a38f9de 100644 (file)
@@ -71,11 +71,7 @@ static const struct rte_eth_txconf tx_conf = {
 
 static const struct rte_eth_conf port_conf = {
        .rxmode = {
-               .header_split = 0,
-               .hw_ip_checksum = 0,
-               .hw_vlan_filter = 0,
-               .jumbo_frame = 0,
-               .hw_strip_crc = 1,
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_DCB_NONE,
index d74c0ab4e959302e9ab593ca2670c8ad32b96fd8..ff0576a5406ae87045b93cf6224995452e11d119 100644 (file)
@@ -43,9 +43,6 @@
 #define TX_HTHRESH 0
 #define TX_WTHRESH 0
 #define TX_RSBIT_THRESH 32
-#define TX_Q_FLAGS (ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOVLANOFFL |\
-       ETH_TXQ_FLAGS_NOXSUMSCTP | ETH_TXQ_FLAGS_NOXSUMUDP | \
-       ETH_TXQ_FLAGS_NOXSUMTCP)
 
 #define MBUF_CACHE_SIZE (250)
 #define BURST_SIZE (32)
@@ -138,13 +135,9 @@ static uint16_t vlan_id = 0x100;
 static struct rte_eth_conf default_pmd_conf = {
        .rxmode = {
                .mq_mode = ETH_MQ_RX_NONE,
-               .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
+               .max_rx_pkt_len = ETHER_MAX_LEN,
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
@@ -170,8 +163,6 @@ static struct rte_eth_txconf tx_conf_default = {
        },
        .tx_free_thresh = TX_FREE_THRESH,
        .tx_rs_thresh = TX_RSBIT_THRESH,
-       .txq_flags = TX_Q_FLAGS
-
 };
 
 static void free_virtualpmd_tx_queue(void);
index 33c1fab0117a3c27250b0300626a8d543381cc1a..9163f631316beca0a199a2a1f983b6498f84c81d 100644 (file)
@@ -110,11 +110,7 @@ static struct rte_eth_conf default_pmd_conf = {
                .mq_mode = ETH_MQ_RX_NONE,
                .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
index 6a1a28d2360ef1cf9929bc3994306025c8cea930..e6e798f5b16c2ac5c8c454130e1001c98e1779db 100644 (file)
@@ -83,11 +83,7 @@ static struct rte_eth_conf default_pmd_conf = {
                .mq_mode = ETH_MQ_RX_NONE,
                .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
@@ -100,11 +96,7 @@ static struct rte_eth_conf rss_pmd_conf = {
                .mq_mode = ETH_MQ_RX_RSS,
                .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
index 54bc4f6b008ef4f9454df6b87624532a4d26bace..4549965fcbacc2dae367a2674d8d4c440c10cde9 100644 (file)
@@ -65,14 +65,7 @@ static struct rte_eth_conf port_conf = {
                .mq_mode = ETH_MQ_RX_NONE,
                .max_rx_pkt_len = ETHER_MAX_LEN,
                .split_hdr_size = 0,
-               .header_split   = 0, /**< Header Split disabled */
-               .hw_ip_checksum = 0, /**< IP checksum offload enabled */
-               .hw_vlan_filter = 0, /**< VLAN filtering disabled */
-               .hw_vlan_strip  = 0, /**< VLAN strip enabled. */
-               .hw_vlan_extend = 0, /**< Extended VLAN disabled. */
-               .jumbo_frame    = 0, /**< Jumbo Frame Support disabled */
-               .hw_strip_crc   = 1, /**< CRC stripped by hardware */
-               .enable_scatter = 0, /**< scatter rx disabled */
+               .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        },
        .txmode = {
                .mq_mode = ETH_MQ_TX_NONE,
@@ -97,11 +90,6 @@ static struct rte_eth_txconf tx_conf = {
        },
        .tx_free_thresh = 32, /* Use PMD default values */
        .tx_rs_thresh = 32, /* Use PMD default values */
-       .txq_flags = (ETH_TXQ_FLAGS_NOMULTSEGS |
-                     ETH_TXQ_FLAGS_NOVLANOFFL |
-                     ETH_TXQ_FLAGS_NOXSUMSCTP |
-                     ETH_TXQ_FLAGS_NOXSUMUDP |
-                     ETH_TXQ_FLAGS_NOXSUMTCP)
 };
 
 enum {
@@ -808,38 +796,29 @@ test_set_rxtx_conf(cmdline_fixed_string_t mode)
 
        if (!strcmp(mode, "vector")) {
                /* vector rx, tx */
-               tx_conf.txq_flags = 0xf01;
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.hw_ip_checksum = 0;
-               port_conf.rxmode.enable_scatter = 0;
                return 0;
        } else if (!strcmp(mode, "scalar")) {
                /* bulk alloc rx, full-featured tx */
-               tx_conf.txq_flags = 0;
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.hw_ip_checksum = 1;
-               port_conf.rxmode.enable_scatter = 0;
+               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM;
                return 0;
        } else if (!strcmp(mode, "hybrid")) {
                /* bulk alloc rx, vector tx
                 * when vec macro not define,
                 * using the same rx/tx as scalar
                 */
-               tx_conf.txq_flags = 0xf01;
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.hw_ip_checksum = 1;
-               port_conf.rxmode.enable_scatter = 0;
+               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CHECKSUM;
                return 0;
        } else if (!strcmp(mode, "full")) {
                /* full feature rx,tx pair */
-               tx_conf.txq_flags = 0x0;   /* must condition */
                tx_conf.tx_rs_thresh = 32;
                tx_conf.tx_free_thresh = 32;
-               port_conf.rxmode.hw_ip_checksum = 0;
-               port_conf.rxmode.enable_scatter = 1; /* must condition */
+               port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SCATTER;
                return 0;
        }