From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ori Kam Subject: [PATCH 1/2] examples/flow_filtering: fix set offloads based on cap Date: Mon, 5 Nov 2018 09:35:27 +0000 Message-ID: <1541410503-29360-1-git-send-email-orika@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "wei.zhao1@intel.com" To: Ori Kam Return-path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60040.outbound.protection.outlook.com [40.107.6.40]) by dpdk.org (Postfix) with ESMTP id 77B3158C6 for ; Mon, 5 Nov 2018 10:35:28 +0100 (CET) Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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; =20 + rte_eth_dev_info_get(port_id, &dev_info); + port_conf.txmode.offloads &=3D dev_info.rx_offload_capa; printf(":: initializing port: %d\n", port_id); ret =3D rte_eth_dev_configure(port_id, nr_queues, nr_queues, &port_conf); @@ -145,7 +147,6 @@ ret, port_id); } =20 - rte_eth_dev_info_get(port_id, &dev_info); rxq_conf =3D dev_info.default_rxconf; rxq_conf.offloads =3D port_conf.rxmode.offloads; /* only set Rx queues: something we care only so far */ --=20 1.8.3.1