From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] app/testpmd: fix tx vlan and qinq insert enable Date: Fri, 1 Mar 2019 16:29:07 +0000 Message-ID: <97ca84ab-84b1-744d-c571-ab052fd9f19d@intel.com> References: <20190219064840.12046-1-ndabilpuram@marvell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: "dev@dpdk.org" , Jerin Jacob Kollanukkaran To: Nithin Kumar Dabilpuram , Wenzhuo Lu , Jingjing Wu , Bernard Iremonger Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 4F42F2BB5 for ; Fri, 1 Mar 2019 17:29:10 +0100 (CET) In-Reply-To: <20190219064840.12046-1-ndabilpuram@marvell.com> 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" On 2/19/2019 6:48 AM, Nithin Kumar Dabilpuram wrote: > Tx VLAN & QinQ insert enable need not depend on > Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. +1 > Also enable > DEV_TX_OFFLOAD_VLAN_INSERT for tx_qinq_set() as it takes > both vlan id's. +1 Technically two different but related fix, should it be two separate patches, what do you think? > > Signed-off-by: Nithin Dabilpuram > --- > app/test-pmd/config.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c > index b9e5dd9..0243f07 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -2955,7 +2955,6 @@ vlan_tpid_set(portid_t port_id, enum rte_vlan_type vlan_type, uint16_t tp_id) > void > tx_vlan_set(portid_t port_id, uint16_t vlan_id) > { > - int vlan_offload; > struct rte_eth_dev_info dev_info; > > if (port_id_is_invalid(port_id, ENABLED_WARN)) > @@ -2963,11 +2962,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) > if (vlan_id_is_invalid(vlan_id)) > return; > > - vlan_offload = rte_eth_dev_get_vlan_offload(port_id); > - if (vlan_offload & ETH_VLAN_EXTEND_OFFLOAD) { > - printf("Error, as QinQ has been enabled.\n"); > - return; > - } Here I think intention is if QINQ is enabled 'tx_vlan_id' & 'tx_vlan_id_outer' should be set by tx_qinq_set() not 'tx_vlan_set', and check is for that. What do you think keeping same logic? But of course check should be if 'ports[port_id].dev_conf.txmode.offloads' has 'DEV_TX_OFFLOAD_QINQ_INSERT' instead of above check. > rte_eth_dev_info_get(port_id, &dev_info); > if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) == 0) { > printf("Error: vlan insert is not supported by port %d\n", > @@ -2983,7 +2977,6 @@ tx_vlan_set(portid_t port_id, uint16_t vlan_id) > void > tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) > { > - int vlan_offload; > struct rte_eth_dev_info dev_info; > > if (port_id_is_invalid(port_id, ENABLED_WARN)) > @@ -2993,11 +2986,6 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) > if (vlan_id_is_invalid(vlan_id_outer)) > return; > > - vlan_offload = rte_eth_dev_get_vlan_offload(port_id); > - if (!(vlan_offload & ETH_VLAN_EXTEND_OFFLOAD)) { > - printf("Error, as QinQ hasn't been enabled.\n"); > - return; > - } > rte_eth_dev_info_get(port_id, &dev_info); > if ((dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) == 0) { > printf("Error: qinq insert not supported by port %d\n", > @@ -3006,7 +2994,8 @@ tx_qinq_set(portid_t port_id, uint16_t vlan_id, uint16_t vlan_id_outer) > } > > tx_vlan_reset(port_id); > - ports[port_id].dev_conf.txmode.offloads |= DEV_TX_OFFLOAD_QINQ_INSERT; > + ports[port_id].dev_conf.txmode.offloads |= (DEV_TX_OFFLOAD_VLAN_INSERT | > + DEV_TX_OFFLOAD_QINQ_INSERT); > ports[port_id].tx_vlan_id = vlan_id; > ports[port_id].tx_vlan_id_outer = vlan_id_outer; > } >