[1/2] examples/flow_filtering: fix set offloads based on cap

Message ID 1541410503-29360-1-git-send-email-orika@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] examples/flow_filtering: fix set offloads based on cap |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Ori Kam Nov. 5, 2018, 9:35 a.m. UTC
  Some of the requested offloads are not supported by all devices.

This patch fixes this issue by setting only the supported offloads.

Fixes: feca6c428a5e ("examples/flow_filtering: add Tx queues setup process")
Cc: wei.zhao1@intel.com

Signed-off-by: Ori Kam <orika@mellanox.com>
---
 examples/flow_filtering/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Zhao1, Wei Nov. 5, 2018, 9:51 a.m. UTC | #1
Acked-by: Wei Zhao <wei.zhao1@intel.com>

> -----Original Message-----
> From: Ori Kam [mailto:orika@mellanox.com]
> Sent: Monday, November 5, 2018 5:35 PM
> To: Ori Kam <orika@mellanox.com>
> Cc: dev@dpdk.org; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap
> 
> Some of the requested offloads are not supported by all devices.
> 
> This patch fixes this issue by setting only the supported offloads.
> 
> Fixes: feca6c428a5e ("examples/flow_filtering: add Tx queues setup
> process")
> Cc: wei.zhao1@intel.com
> 
> Signed-off-by: Ori Kam <orika@mellanox.com>
> ---
>  examples/flow_filtering/main.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
> index a73d120..27e287a 100644
> --- a/examples/flow_filtering/main.c
> +++ b/examples/flow_filtering/main.c
> @@ -136,6 +136,8 @@
>  	struct rte_eth_rxconf rxq_conf;
>  	struct rte_eth_dev_info dev_info;
> 
> +	rte_eth_dev_info_get(port_id, &dev_info);
> +	port_conf.txmode.offloads &= dev_info.rx_offload_capa;
>  	printf(":: initializing port: %d\n", port_id);
>  	ret = rte_eth_dev_configure(port_id,
>  				nr_queues, nr_queues, &port_conf);
> @@ -145,7 +147,6 @@
>  			ret, port_id);
>  	}
> 
> -	rte_eth_dev_info_get(port_id, &dev_info);
>  	rxq_conf = dev_info.default_rxconf;
>  	rxq_conf.offloads = port_conf.rxmode.offloads;
>  	/* only set Rx queues: something we care only so far */
> --
> 1.8.3.1
  
Thomas Monjalon Nov. 6, 2018, 1:29 a.m. UTC | #2
05/11/2018 10:51, Zhao1, Wei:
> From: Ori Kam [mailto:orika@mellanox.com]
> > 
> > Some of the requested offloads are not supported by all devices.
> > 
> > This patch fixes this issue by setting only the supported offloads.
> > 
> > Fixes: feca6c428a5e ("examples/flow_filtering: add Tx queues setup
> > process")
> > Cc: wei.zhao1@intel.com
> > 
> > Signed-off-by: Ori Kam <orika@mellanox.com>
> 
> Acked-by: Wei Zhao <wei.zhao1@intel.com>

Series applied, thanks
  

Patch

diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a73d120..27e287a 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -136,6 +136,8 @@ 
 	struct rte_eth_rxconf rxq_conf;
 	struct rte_eth_dev_info dev_info;
 
+	rte_eth_dev_info_get(port_id, &dev_info);
+	port_conf.txmode.offloads &= dev_info.rx_offload_capa;
 	printf(":: initializing port: %d\n", port_id);
 	ret = rte_eth_dev_configure(port_id,
 				nr_queues, nr_queues, &port_conf);
@@ -145,7 +147,6 @@ 
 			ret, port_id);
 	}
 
-	rte_eth_dev_info_get(port_id, &dev_info);
 	rxq_conf = dev_info.default_rxconf;
 	rxq_conf.offloads = port_conf.rxmode.offloads;
 	/* only set Rx queues: something we care only so far */