[v2,3/5] ethdev: convert remaining apps to new offload API

Message ID 20180702212750.16758-4-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series remove old ethdev offload API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon July 2, 2018, 9:27 p.m. UTC
  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>
---
 app/test-eventdev/test_perf_common.c          |  8 +----
 .../sample_app_ug/l2_forward_job_stats.rst    | 19 ------------
 .../sample_app_ug/l2_forward_real_virtual.rst | 19 ------------
 doc/guides/sample_app_ug/link_status_intr.rst |  5 +---
 .../sample_app_ug/vmdq_dcb_forwarding.rst     |  4 ---
 examples/bbdev_app/main.c                     |  6 +---
 examples/ip_pipeline/link.c                   | 11 +------
 test/test-pipeline/init.c                     |  6 +---
 test/test/test_kni.c                          |  6 +---
 test/test/test_link_bonding.c                 | 13 ++-------
 test/test/test_link_bonding_mode4.c           |  6 +---
 test/test/test_link_bonding_rssconf.c         | 12 ++------
 test/test/test_pmd_perf.c                     | 29 +++----------------
 13 files changed, 15 insertions(+), 129 deletions(-)
  

Comments

Andrew Rybchenko July 4, 2018, 11:16 a.m. UTC | #1
On 07/03/2018 12:27 AM, Thomas Monjalon wrote:
> 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>
> ---

<...>

> diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
> index 8c11ba4ae..c7665fe5c 100644
> --- a/doc/guides/sample_app_ug/link_status_intr.rst
> +++ b/doc/guides/sample_app_ug/link_status_intr.rst
> @@ -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,

Is it intended that CRC strip was disabled before and now it is becoming 
enabled?

>           },
>           .txmode = {},
>           .intr_conf = {

<...>

> diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
> index 254cc0676..045a190b9 100644
> --- a/examples/bbdev_app/main.c
> +++ b/examples/bbdev_app/main.c
> @@ -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,

Is it intended that CRC strip was disabled before and now it is becoming 
enabled?


>   	},
>   	.txmode = {
>   		.mq_mode = ETH_MQ_TX_NONE,

<...>

> diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
> index 54bc4f6b0..4549965fc 100644
> --- a/test/test/test_pmd_perf.c
> +++ b/test/test/test_pmd_perf.c
> @@ -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;

I'd say that 100% correct equivalent would be:
tx_conf.offloads &= ~(DEV_TX_OFFLOAD_VLAN_INSERT |
           DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM |
           DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM |
           DEV_TX_OFFLOAD_MULTI_SEGS);

I guess the function may be called few times with different mode set.
If so, similar fixes should be applied below as well.

>   		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;

port_conf.rxmode.offloads &= ~(DEV_RX_OFFLOAD_CHECKSUM | 
DEV_RX_OFFLOAD_SCATTER);

>   		return 0;
>   	} else if (!strcmp(mode, "scalar")) {
>   		/* bulk alloc rx, full-featured tx */
> -		tx_conf.txq_flags = 0;

I think here we should enable offloads listed above to have 
full-featured Tx:
tx_conf.offloads |=  ...

>   		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;

port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_SCATTER;

>   		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;

As in similar case above.

>   		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;

As in similar case above

>   		return 0;
>   	} else if (!strcmp(mode, "full")) {
>   		/* full feature rx,tx pair */
> -		tx_conf.txq_flags = 0x0;   /* must condition */

As in similar case above.

>   		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;

port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_CHECKSUM;

>   		return 0;
>   	}
>   

In general I think that it would be really good to avoid changes in
behaviour when technical changes are done.
  
Thomas Monjalon July 4, 2018, 12:26 p.m. UTC | #2
04/07/2018 13:16, Andrew Rybchenko:
> On 07/03/2018 12:27 AM, Thomas Monjalon wrote:
> > --- a/doc/guides/sample_app_ug/link_status_intr.rst
> > +++ b/doc/guides/sample_app_ug/link_status_intr.rst
> > @@ -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,
> 
> Is it intended that CRC strip was disabled before and now it is becoming 
> enabled?

Yes, I consider the comment to be the real intent.

> > --- a/examples/bbdev_app/main.c
> > +++ b/examples/bbdev_app/main.c
> > @@ -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,
> 
> Is it intended that CRC strip was disabled before and now it is becoming 
> enabled?

Yes, I consider the comment to be the real intent.

> > --- a/test/test/test_pmd_perf.c
> > +++ b/test/test/test_pmd_perf.c
> > @@ -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;
> 
> I'd say that 100% correct equivalent would be:
> tx_conf.offloads &= ~(DEV_TX_OFFLOAD_VLAN_INSERT |
>            DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM |
>            DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM |
>            DEV_TX_OFFLOAD_MULTI_SEGS);

I'd say it is a really crappy code, and probably tuned for Intel devices only.

> 
> I guess the function may be called few times with different mode set.
> If so, similar fixes should be applied below as well.
> 
> >   		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;
> 
> port_conf.rxmode.offloads &= ~(DEV_RX_OFFLOAD_CHECKSUM | 
> DEV_RX_OFFLOAD_SCATTER);
> 
> >   		return 0;
> >   	} else if (!strcmp(mode, "scalar")) {
> >   		/* bulk alloc rx, full-featured tx */
> > -		tx_conf.txq_flags = 0;
> 
> I think here we should enable offloads listed above to have 
> full-featured Tx:
> tx_conf.offloads |=  ...
> 
> >   		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;
> 
> port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_SCATTER;
> 
> >   		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;
> 
> As in similar case above.
> 
> >   		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;
> 
> As in similar case above
> 
> >   		return 0;
> >   	} else if (!strcmp(mode, "full")) {
> >   		/* full feature rx,tx pair */
> > -		tx_conf.txq_flags = 0x0;   /* must condition */
> 
> As in similar case above.
> 
> >   		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;
> 
> port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_CHECKSUM;
> 
> >   		return 0;
> >   	}
> >   
> 
> In general I think that it would be really good to avoid changes in
> behaviour when technical changes are done.

I agree, but in this case, it is impossible to know what was the real intent.
And I am perfectly fine breaking bad code.
The other option is to just remove the file. Maybe the best option?
  
Andrew Rybchenko July 4, 2018, 12:52 p.m. UTC | #3
On 07/04/2018 03:26 PM, Thomas Monjalon wrote:
> 04/07/2018 13:16, Andrew Rybchenko:
>> On 07/03/2018 12:27 AM, Thomas Monjalon wrote:
>>> --- a/doc/guides/sample_app_ug/link_status_intr.rst
>>> +++ b/doc/guides/sample_app_ug/link_status_intr.rst
>>> @@ -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,
>> Is it intended that CRC strip was disabled before and now it is becoming
>> enabled?
> Yes, I consider the comment to be the real intent.

OK. I see. Most likely yes. I agree.

>>> --- a/examples/bbdev_app/main.c
>>> +++ b/examples/bbdev_app/main.c
>>> @@ -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,
>> Is it intended that CRC strip was disabled before and now it is becoming
>> enabled?
> Yes, I consider the comment to be the real intent.
>
>>> --- a/test/test/test_pmd_perf.c
>>> +++ b/test/test/test_pmd_perf.c
>>> @@ -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;
>> I'd say that 100% correct equivalent would be:
>> tx_conf.offloads &= ~(DEV_TX_OFFLOAD_VLAN_INSERT |
>>             DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM |
>>             DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM |
>>             DEV_TX_OFFLOAD_MULTI_SEGS);
> I'd say it is a really crappy code, and probably tuned for Intel devices only.
>
>> I guess the function may be called few times with different mode set.
>> If so, similar fixes should be applied below as well.
>>
>>>    		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;
>> port_conf.rxmode.offloads &= ~(DEV_RX_OFFLOAD_CHECKSUM |
>> DEV_RX_OFFLOAD_SCATTER);
>>
>>>    		return 0;
>>>    	} else if (!strcmp(mode, "scalar")) {
>>>    		/* bulk alloc rx, full-featured tx */
>>> -		tx_conf.txq_flags = 0;
>> I think here we should enable offloads listed above to have
>> full-featured Tx:
>> tx_conf.offloads |=  ...
>>
>>>    		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;
>> port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_SCATTER;
>>
>>>    		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;
>> As in similar case above.
>>
>>>    		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;
>> As in similar case above
>>
>>>    		return 0;
>>>    	} else if (!strcmp(mode, "full")) {
>>>    		/* full feature rx,tx pair */
>>> -		tx_conf.txq_flags = 0x0;   /* must condition */
>> As in similar case above.
>>
>>>    		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;
>> port_conf.rxmode.offloads &= ~DEV_RX_OFFLOAD_CHECKSUM;
>>
>>>    		return 0;
>>>    	}
>>>    
>> In general I think that it would be really good to avoid changes in
>> behaviour when technical changes are done.
> I agree, but in this case, it is impossible to know what was the real intent.
> And I am perfectly fine breaking bad code.
> The other option is to just remove the file. Maybe the best option?

I have no strong opinion. As far as I can see there is no maintainer for 
it...
  

Patch

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index d00f91802..eed80d1b1 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -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 = {
diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
index d7219a293..ba73d8557 100644
--- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst
+++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst
@@ -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
 ~~~~~~~~~~~~~~~~~~~~~~~
 
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index b459d4efe..2b2d5afa0 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -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
diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst
index 8c11ba4ae..c7665fe5c 100644
--- a/doc/guides/sample_app_ug/link_status_intr.rst
+++ b/doc/guides/sample_app_ug/link_status_intr.rst
@@ -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 = {
diff --git a/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst b/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
index 83fcdf637..0e9da9707 100644
--- a/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
+++ b/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst
@@ -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,
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 254cc0676..045a190b9 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -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,
diff --git a/examples/ip_pipeline/link.c b/examples/ip_pipeline/link.c
index b8a431f3e..181c31f9c 100644
--- a/examples/ip_pipeline/link.c
+++ b/examples/ip_pipeline/link.c
@@ -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 = {
diff --git a/test/test-pipeline/init.c b/test/test-pipeline/init.c
index 19cf04a6c..f33216c90 100644
--- a/test/test-pipeline/init.c
+++ b/test/test-pipeline/init.c
@@ -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 = {
diff --git a/test/test/test_kni.c b/test/test/test_kni.c
index 56773c8a2..1b876719a 100644
--- a/test/test/test_kni.c
+++ b/test/test/test_kni.c
@@ -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,
diff --git a/test/test/test_link_bonding.c b/test/test/test_link_bonding.c
index d74c0ab4e..ff0576a54 100644
--- a/test/test/test_link_bonding.c
+++ b/test/test/test_link_bonding.c
@@ -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);
diff --git a/test/test/test_link_bonding_mode4.c b/test/test/test_link_bonding_mode4.c
index 33c1fab01..9163f6313 100644
--- a/test/test/test_link_bonding_mode4.c
+++ b/test/test/test_link_bonding_mode4.c
@@ -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,
diff --git a/test/test/test_link_bonding_rssconf.c b/test/test/test_link_bonding_rssconf.c
index 6a1a28d23..e6e798f5b 100644
--- a/test/test/test_link_bonding_rssconf.c
+++ b/test/test/test_link_bonding_rssconf.c
@@ -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,
diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c
index 54bc4f6b0..4549965fc 100644
--- a/test/test/test_pmd_perf.c
+++ b/test/test/test_pmd_perf.c
@@ -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;
 	}