diff mbox series

[v4,1/2] app/testpmd: fix Tx VLAN and QinQ dependency

Message ID 20190405120403.5446-1-nithind1988@gmail.com (mailing list archive)
State Not Applicable, archived
Delegated to: Ferruh Yigit
Headers show
Series [v4,1/2] app/testpmd: fix Tx VLAN and QinQ dependency | expand

Checks

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

Commit Message

Nithin Dabilpuram April 5, 2019, 12:04 p.m. UTC
From: Nithin Dabilpuram <ndabilpuram@marvell.com>

Tx VLAN & QinQ insert enable need not depend on
Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN
insert enable, error check is now to see if QinQ was enabled
but only single VLAN id is set.

Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx VLAN")
Cc: xiao.w.wang@intel.com

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
v4:
* Resend v3 from different mailserver to avoid 
  CRLF
v3:
* Add back error check in tx_vlan_set() to check if QinQ is
already enabled. Also fix headline.
v2:
* Split change into two seperate patches as suggested.

 app/test-pmd/config.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

Comments

Ferruh Yigit April 5, 2019, 12:06 p.m. UTC | #1
On 4/5/2019 1:04 PM, Nithin Dabilpuram wrote:
> From: Nithin Dabilpuram <ndabilpuram@marvell.com>
> 
> Tx VLAN & QinQ insert enable need not depend on
> Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN
> insert enable, error check is now to see if QinQ was enabled
> but only single VLAN id is set.
> 
> Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx VLAN")
> Cc: xiao.w.wang@intel.com
> 
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
> v4:
> * Resend v3 from different mailserver to avoid 
>   CRLF
> v3:
> * Add back error check in tx_vlan_set() to check if QinQ is
> already enabled. Also fix headline.
> v2:
> * Split change into two seperate patches as suggested.
> 

Hi Nithin,

I just merged the v3 and about to send the mail :)

What is different in v4? avoid CRLF?
Nithin Dabilpuram April 5, 2019, 1:10 p.m. UTC | #2
Hi Ferruh,

Yes, our mail server had some issue and was inserting CRLF chars. So I sent
the same v3 as v4 from gmail.

Thanks
Nithin

On Fri, Apr 5, 2019 at 5:36 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 4/5/2019 1:04 PM, Nithin Dabilpuram wrote:
> > From: Nithin Dabilpuram <ndabilpuram@marvell.com>
> >
> > Tx VLAN & QinQ insert enable need not depend on
> > Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN
> > insert enable, error check is now to see if QinQ was enabled
> > but only single VLAN id is set.
> >
> > Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx
> VLAN")
> > Cc: xiao.w.wang@intel.com
> >
> > Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> > Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> > v4:
> > * Resend v3 from different mailserver to avoid
> >   CRLF
> > v3:
> > * Add back error check in tx_vlan_set() to check if QinQ is
> > already enabled. Also fix headline.
> > v2:
> > * Split change into two seperate patches as suggested.
> >
>
> Hi Nithin,
>
> I just merged the v3 and about to send the mail :)
>
> What is different in v4? avoid CRLF?
>
>
Ferruh Yigit April 5, 2019, 1:32 p.m. UTC | #3
On 4/5/2019 2:10 PM, Nithin Kumar D wrote:
> Hi Ferruh,
> 
> Yes, our mail server had some issue and was inserting CRLF chars. So I sent
> the same v3 as v4 from gmail.

If the content is same I will continue with v3, thanks.

> 
> Thanks
> Nithin
> 
> On Fri, Apr 5, 2019 at 5:36 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 4/5/2019 1:04 PM, Nithin Dabilpuram wrote:
>>> From: Nithin Dabilpuram <ndabilpuram@marvell.com>
>>>
>>> Tx VLAN & QinQ insert enable need not depend on
>>> Rx VLAN offload ETH_VLAN_EXTEND_OFFLOAD. For Tx VLAN
>>> insert enable, error check is now to see if QinQ was enabled
>>> but only single VLAN id is set.
>>>
>>> Fixes: 6a34f91690d0 ("app/testpmd: fix error message when setting Tx
>> VLAN")
>>> Cc: xiao.w.wang@intel.com
>>>
>>> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
>>> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>> ---
>>> v4:
>>> * Resend v3 from different mailserver to avoid
>>>   CRLF
>>> v3:
>>> * Add back error check in tx_vlan_set() to check if QinQ is
>>> already enabled. Also fix headline.
>>> v2:
>>> * Split change into two seperate patches as suggested.
>>>
>>
>> Hi Nithin,
>>
>> I just merged the v3 and about to send the mail :)
>>
>> What is different in v4? avoid CRLF?
>>
>>
diff mbox series

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index cadcb51..010e26d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2962,7 +2962,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))
@@ -2970,8 +2969,8 @@  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) {
+	if (ports[port_id].dev_conf.txmode.offloads &
+	    DEV_TX_OFFLOAD_QINQ_INSERT) {
 		printf("Error, as QinQ has been enabled.\n");
 		return;
 	}
@@ -2990,7 +2989,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))
@@ -3000,11 +2998,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",