DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap
@ 2018-11-05  9:35 Ori Kam
  2018-11-05  9:35 ` [dpdk-dev] [PATCH 2/2] examples/flow_filtering: fix remove vlan item Ori Kam
  2018-11-05  9:51 ` [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Zhao1, Wei
  0 siblings, 2 replies; 4+ messages in thread
From: Ori Kam @ 2018-11-05  9:35 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, wei.zhao1

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/2] examples/flow_filtering: fix remove vlan item
  2018-11-05  9:35 [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Ori Kam
@ 2018-11-05  9:35 ` Ori Kam
  2018-11-05  9:51 ` [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Zhao1, Wei
  1 sibling, 0 replies; 4+ messages in thread
From: Ori Kam @ 2018-11-05  9:35 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev

Since the vlan is not in use and some PMD can't support vlan = 0
this item was removed.

Fixes: 4a3ef59a10c8 ("examples/flow_filtering: add simple demo of flow API")
Cc: orika@mellanox.com

Signed-off-by: Ori Kam <orika@mellanox.com>
---
 examples/flow_filtering/flow_blocks.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/examples/flow_filtering/flow_blocks.c b/examples/flow_filtering/flow_blocks.c
index 4da4592..bae7116 100644
--- a/examples/flow_filtering/flow_blocks.c
+++ b/examples/flow_filtering/flow_blocks.c
@@ -46,8 +46,6 @@ struct rte_flow *
 	struct rte_flow_action_queue queue = { .index = rx_q };
 	struct rte_flow_item_eth eth_spec;
 	struct rte_flow_item_eth eth_mask;
-	struct rte_flow_item_vlan vlan_spec;
-	struct rte_flow_item_vlan vlan_mask;
 	struct rte_flow_item_ipv4 ip_spec;
 	struct rte_flow_item_ipv4 ip_mask;
 	int res;
@@ -85,17 +83,6 @@ struct rte_flow *
 	pattern[0].mask = &eth_mask;
 
 	/*
-	 * setting the second level of the pattern (vlan).
-	 * since in this example we just want to get the
-	 * ipv4 we also set this level to allow all.
-	 */
-	memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan));
-	memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan));
-	pattern[1].type = RTE_FLOW_ITEM_TYPE_VLAN;
-	pattern[1].spec = &vlan_spec;
-	pattern[1].mask = &vlan_mask;
-
-	/*
 	 * setting the third level of the pattern (ip).
 	 * in this example this is the level we care about
 	 * so we set it according to the parameters.
@@ -106,12 +93,12 @@ struct rte_flow *
 	ip_mask.hdr.dst_addr = dest_mask;
 	ip_spec.hdr.src_addr = htonl(src_ip);
 	ip_mask.hdr.src_addr = src_mask;
-	pattern[2].type = RTE_FLOW_ITEM_TYPE_IPV4;
-	pattern[2].spec = &ip_spec;
-	pattern[2].mask = &ip_mask;
+	pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
+	pattern[1].spec = &ip_spec;
+	pattern[1].mask = &ip_mask;
 
 	/* the final level must be always type end */
-	pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
+	pattern[2].type = RTE_FLOW_ITEM_TYPE_END;
 
 	res = rte_flow_validate(port_id, &attr, pattern, action, error);
 	if (!res)
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap
  2018-11-05  9:35 [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Ori Kam
  2018-11-05  9:35 ` [dpdk-dev] [PATCH 2/2] examples/flow_filtering: fix remove vlan item Ori Kam
@ 2018-11-05  9:51 ` Zhao1, Wei
  2018-11-06  1:29   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Zhao1, Wei @ 2018-11-05  9:51 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap
  2018-11-05  9:51 ` [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Zhao1, Wei
@ 2018-11-06  1:29   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2018-11-06  1:29 UTC (permalink / raw)
  To: Ori Kam; +Cc: dev, Zhao1, Wei

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-06  1:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05  9:35 [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Ori Kam
2018-11-05  9:35 ` [dpdk-dev] [PATCH 2/2] examples/flow_filtering: fix remove vlan item Ori Kam
2018-11-05  9:51 ` [dpdk-dev] [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Zhao1, Wei
2018-11-06  1:29   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).