[RFC,3/3] examples: add Rx ptype offload

Message ID 20190806080206.1572-4-pbhagavatula@marvell.com (mailing list archive)
State Not Applicable, archived
Delegated to: Ferruh Yigit
Headers
Series ethdev: add ptype as Rx offload |

Checks

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

Commit Message

Pavan Nikhilesh Bhagavatula Aug. 6, 2019, 8:02 a.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable
examples.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/ip_fragmentation/main.c                | 7 +++++++
 examples/l3fwd-power/main.c                     | 8 ++++++++
 examples/l3fwd/main.c                           | 9 +++++++++
 examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++
 examples/tep_termination/vxlan_setup.c          | 1 +
 5 files changed, 34 insertions(+)
  

Comments

Ananyev, Konstantin Aug. 6, 2019, 9:20 a.m. UTC | #1
> -----Original Message-----
> From: pbhagavatula@marvell.com [mailto:pbhagavatula@marvell.com]
> Sent: Tuesday, August 6, 2019 9:02 AM
> To: jerinj@marvell.com; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Hunt, David <david.hunt@intel.com>; Kovacevic, Marko
> <marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>; Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>; Nicolau, Radu <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Kantecki, Tomasz
> <tomasz.kantecki@intel.com>; Mcnamara, John <john.mcnamara@intel.com>; Van Haaren, Harry <harry.van.haaren@intel.com>; Li,
> Xiaoyun <xiaoyun.li@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable
> examples.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/ip_fragmentation/main.c                | 7 +++++++
>  examples/l3fwd-power/main.c                     | 8 ++++++++
>  examples/l3fwd/main.c                           | 9 +++++++++
>  examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++
>  examples/tep_termination/vxlan_setup.c          | 1 +
>  5 files changed, 34 insertions(+)
> 
> diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> index 324d60773..2a9895542 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -904,6 +904,13 @@ main(int argc, char **argv)
> 
>  		/* limit the frame size to the maximum supported by NIC */
>  		rte_eth_dev_info_get(portid, &dev_info);
> +
> +		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE)
> +			local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE;
> +
> +		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
> +			local_port_conf.txmode.offloads |=
> +				DEV_TX_OFFLOAD_MBUF_FAST_FREE;

I didn't look at the rest of the patch series yet, but these 3 lines above seems wrong.
and not related to that subject. 
Probably something wrong with your merge process.
Check
commit ed553e3db4a84af0ddac0d898476333d61adb93a
Author: Sunil Kumar Kori <skori@marvell.com>
Date:   Thu Jul 25 13:54:10 2019 +0530

    examples/ip_frag: remove Tx fast free offload flag


>  		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
>  		    dev_info.max_rx_pktlen,
>  		    local_port_conf.rxmode.max_rx_pkt_len);
> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
> index fd8d9528f..875d60c06 100644
> --- a/examples/l3fwd-power/main.c
> +++ b/examples/l3fwd-power/main.c
> @@ -2261,6 +2261,14 @@ main(int argc, char **argv)
>  		dev_rxq_num = dev_info.max_rx_queues;
>  		dev_txq_num = dev_info.max_tx_queues;
> 
> +		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
> +			if (!parse_ptype)
> +				port_conf.rxmode.offloads |=
> +					DEV_RX_OFFLOAD_PTYPE;
> +		} else {
> +			parse_ptype = 1;
> +		}
> +
>  		nb_rx_queue = get_port_n_rx_queues(portid);
>  		if (nb_rx_queue > dev_rxq_num)
>  			rte_exit(EXIT_FAILURE,
> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
> index 3800bad19..dfee880a0 100644
> --- a/examples/l3fwd/main.c
> +++ b/examples/l3fwd/main.c
> @@ -875,6 +875,15 @@ main(int argc, char **argv)
>  			nb_rx_queue, (unsigned)n_tx_queue );
> 
>  		rte_eth_dev_info_get(portid, &dev_info);
> +
> +		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
> +			if (!parse_ptype)
> +				local_port_conf.rxmode.offloads |=
> +					DEV_RX_OFFLOAD_PTYPE;
> +		} else {
> +			parse_ptype = 1;
> +		}
> +
>  		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>  			local_port_conf.txmode.offloads |=
>  				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
> diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
> index 49d942407..f033326be 100644
> --- a/examples/performance-thread/l3fwd-thread/main.c
> +++ b/examples/performance-thread/l3fwd-thread/main.c
> @@ -3560,6 +3560,15 @@ main(int argc, char **argv)
>  		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
>  			nb_rx_queue, (unsigned)n_tx_queue);
>  		rte_eth_dev_info_get(portid, &dev_info);
> +
> +		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
> +			if (!parse_ptype_on)
> +				port_conf.rxmode.offloads |=
> +					DEV_RX_OFFLOAD_PTYPE;
> +		} else {
> +			parse_ptype_on = 1;
> +		}
> +
>  		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>  			local_port_conf.txmode.offloads |=
>  				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
> diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
> index 9a0880002..3d2acecd5 100644
> --- a/examples/tep_termination/vxlan_setup.c
> +++ b/examples/tep_termination/vxlan_setup.c
> @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID,
>  static struct rte_eth_conf port_conf = {
>  	.rxmode = {
>  		.split_hdr_size = 0,
> +		.offloads = DEV_RX_OFFLOAD_PTYPE,
>  	},
>  	.txmode = {
>  		.mq_mode = ETH_MQ_TX_NONE,
> --
> 2.17.1
  
Pavan Nikhilesh Bhagavatula Aug. 6, 2019, 1:57 p.m. UTC | #2
>-----Original Message-----
>From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
>Sent: Tuesday, August 6, 2019 2:50 PM
>To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin
>Jacob Kollanukkaran <jerinj@marvell.com>; Hunt, David
><david.hunt@intel.com>; Kovacevic, Marko
><marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>;
>Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch,
>Pablo <pablo.de.lara.guarch@intel.com>; Nicolau, Radu
><radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>;
>Kantecki, Tomasz <tomasz.kantecki@intel.com>; Mcnamara, John
><john.mcnamara@intel.com>; Van Haaren, Harry
><harry.van.haaren@intel.com>; Li, Xiaoyun <xiaoyun.li@intel.com>
>Cc: dev@dpdk.org
>Subject: RE: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload
>> -----Original Message-----
>> From: pbhagavatula@marvell.com
>[mailto:pbhagavatula@marvell.com]
>> Sent: Tuesday, August 6, 2019 9:02 AM
>> To: jerinj@marvell.com; Ananyev, Konstantin
><konstantin.ananyev@intel.com>; Hunt, David
><david.hunt@intel.com>; Kovacevic, Marko
>> <marko.kovacevic@intel.com>; Ori Kam <orika@mellanox.com>;
>Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch,
>Pablo
>> <pablo.de.lara.guarch@intel.com>; Nicolau, Radu
><radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>;
>Kantecki, Tomasz
>> <tomasz.kantecki@intel.com>; Mcnamara, John
><john.mcnamara@intel.com>; Van Haaren, Harry
><harry.van.haaren@intel.com>; Li,
>> Xiaoyun <xiaoyun.li@intel.com>
>> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Subject: [dpdk-dev] [RFC 3/3] examples: add Rx ptype offload
>>
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add DEV_RX_OFFLOAD_PTYPE as a offload requirement for applicable
>> examples.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> ---
>>  examples/ip_fragmentation/main.c                | 7 +++++++
>>  examples/l3fwd-power/main.c                     | 8 ++++++++
>>  examples/l3fwd/main.c                           | 9 +++++++++
>>  examples/performance-thread/l3fwd-thread/main.c | 9 +++++++++
>>  examples/tep_termination/vxlan_setup.c          | 1 +
>>  5 files changed, 34 insertions(+)
>>
>> diff --git a/examples/ip_fragmentation/main.c
>b/examples/ip_fragmentation/main.c
>> index 324d60773..2a9895542 100644
>> --- a/examples/ip_fragmentation/main.c
>> +++ b/examples/ip_fragmentation/main.c
>> @@ -904,6 +904,13 @@ main(int argc, char **argv)
>>
>>  		/* limit the frame size to the maximum supported by
>NIC */
>>  		rte_eth_dev_info_get(portid, &dev_info);
>> +
>> +		if (dev_info.rx_offload_capa &
>DEV_RX_OFFLOAD_PTYPE)
>> +			local_port_conf.rxmode.offloads |=
>DEV_RX_OFFLOAD_PTYPE;
>> +
>> +		if (dev_info.tx_offload_capa &
>DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>> +			local_port_conf.txmode.offloads |=
>> +				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
>
>I didn't look at the rest of the patch series yet, but these 3 lines above
>seems wrong.
>and not related to that subject.
>Probably something wrong with your merge process.

Ack. I will remove it in the next version.

>Check
>commit ed553e3db4a84af0ddac0d898476333d61adb93a
>Author: Sunil Kumar Kori <skori@marvell.com>
>Date:   Thu Jul 25 13:54:10 2019 +0530
>
>    examples/ip_frag: remove Tx fast free offload flag
>
>
>>  		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
>>  		    dev_info.max_rx_pktlen,
>>  		    local_port_conf.rxmode.max_rx_pkt_len);
>> diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-
>power/main.c
>> index fd8d9528f..875d60c06 100644
>> --- a/examples/l3fwd-power/main.c
>> +++ b/examples/l3fwd-power/main.c
>> @@ -2261,6 +2261,14 @@ main(int argc, char **argv)
>>  		dev_rxq_num = dev_info.max_rx_queues;
>>  		dev_txq_num = dev_info.max_tx_queues;
>>
>> +		if (dev_info.rx_offload_capa &
>DEV_RX_OFFLOAD_PTYPE) {
>> +			if (!parse_ptype)
>> +				port_conf.rxmode.offloads |=
>> +					DEV_RX_OFFLOAD_PTYPE;
>> +		} else {
>> +			parse_ptype = 1;
>> +		}
>> +
>>  		nb_rx_queue = get_port_n_rx_queues(portid);
>>  		if (nb_rx_queue > dev_rxq_num)
>>  			rte_exit(EXIT_FAILURE,
>> diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
>> index 3800bad19..dfee880a0 100644
>> --- a/examples/l3fwd/main.c
>> +++ b/examples/l3fwd/main.c
>> @@ -875,6 +875,15 @@ main(int argc, char **argv)
>>  			nb_rx_queue, (unsigned)n_tx_queue );
>>
>>  		rte_eth_dev_info_get(portid, &dev_info);
>> +
>> +		if (dev_info.rx_offload_capa &
>DEV_RX_OFFLOAD_PTYPE) {
>> +			if (!parse_ptype)
>> +				local_port_conf.rxmode.offloads |=
>> +					DEV_RX_OFFLOAD_PTYPE;
>> +		} else {
>> +			parse_ptype = 1;
>> +		}
>> +
>>  		if (dev_info.tx_offload_capa &
>DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>>  			local_port_conf.txmode.offloads |=
>>  				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
>> diff --git a/examples/performance-thread/l3fwd-thread/main.c
>b/examples/performance-thread/l3fwd-thread/main.c
>> index 49d942407..f033326be 100644
>> --- a/examples/performance-thread/l3fwd-thread/main.c
>> +++ b/examples/performance-thread/l3fwd-thread/main.c
>> @@ -3560,6 +3560,15 @@ main(int argc, char **argv)
>>  		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
>>  			nb_rx_queue, (unsigned)n_tx_queue);
>>  		rte_eth_dev_info_get(portid, &dev_info);
>> +
>> +		if (dev_info.rx_offload_capa &
>DEV_RX_OFFLOAD_PTYPE) {
>> +			if (!parse_ptype_on)
>> +				port_conf.rxmode.offloads |=
>> +					DEV_RX_OFFLOAD_PTYPE;
>> +		} else {
>> +			parse_ptype_on = 1;
>> +		}
>> +
>>  		if (dev_info.tx_offload_capa &
>DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>>  			local_port_conf.txmode.offloads |=
>>  				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
>> diff --git a/examples/tep_termination/vxlan_setup.c
>b/examples/tep_termination/vxlan_setup.c
>> index 9a0880002..3d2acecd5 100644
>> --- a/examples/tep_termination/vxlan_setup.c
>> +++ b/examples/tep_termination/vxlan_setup.c
>> @@ -69,6 +69,7 @@ uint8_t tep_filter_type[] =
>{RTE_TUNNEL_FILTER_IMAC_TENID,
>>  static struct rte_eth_conf port_conf = {
>>  	.rxmode = {
>>  		.split_hdr_size = 0,
>> +		.offloads = DEV_RX_OFFLOAD_PTYPE,
>>  	},
>>  	.txmode = {
>>  		.mq_mode = ETH_MQ_TX_NONE,
>> --
>> 2.17.1
  

Patch

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 324d60773..2a9895542 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -904,6 +904,13 @@  main(int argc, char **argv)
 
 		/* limit the frame size to the maximum supported by NIC */
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE)
+			local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_PTYPE;
+
+		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+			local_port_conf.txmode.offloads |=
+				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 		local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN(
 		    dev_info.max_rx_pktlen,
 		    local_port_conf.rxmode.max_rx_pkt_len);
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd8d9528f..875d60c06 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2261,6 +2261,14 @@  main(int argc, char **argv)
 		dev_rxq_num = dev_info.max_rx_queues;
 		dev_txq_num = dev_info.max_tx_queues;
 
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype)
+				port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype = 1;
+		}
+
 		nb_rx_queue = get_port_n_rx_queues(portid);
 		if (nb_rx_queue > dev_rxq_num)
 			rte_exit(EXIT_FAILURE,
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 3800bad19..dfee880a0 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -875,6 +875,15 @@  main(int argc, char **argv)
 			nb_rx_queue, (unsigned)n_tx_queue );
 
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype)
+				local_port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype = 1;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 49d942407..f033326be 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -3560,6 +3560,15 @@  main(int argc, char **argv)
 		printf("Creating queues: nb_rxq=%d nb_txq=%u... ",
 			nb_rx_queue, (unsigned)n_tx_queue);
 		rte_eth_dev_info_get(portid, &dev_info);
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_PTYPE) {
+			if (!parse_ptype_on)
+				port_conf.rxmode.offloads |=
+					DEV_RX_OFFLOAD_PTYPE;
+		} else {
+			parse_ptype_on = 1;
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index 9a0880002..3d2acecd5 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -69,6 +69,7 @@  uint8_t tep_filter_type[] = {RTE_TUNNEL_FILTER_IMAC_TENID,
 static struct rte_eth_conf port_conf = {
 	.rxmode = {
 		.split_hdr_size = 0,
+		.offloads = DEV_RX_OFFLOAD_PTYPE,
 	},
 	.txmode = {
 		.mq_mode = ETH_MQ_TX_NONE,