net/fm10k: fix descriptor vlan field filling in Tx
diff mbox series

Message ID 20191205133008.4464-1-luqiuwen@iie.ac.cn
State Accepted, archived
Delegated to: xiaolong ye
Headers show
Series
  • net/fm10k: fix descriptor vlan field filling in Tx
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Lu Qiuwen Dec. 5, 2019, 1:30 p.m. UTC
The VLAN field in the descriptor is not filled when ol_flags has
no VLAN flag. When the caller sends some packets with VLAN tags,
but other packets do not have VLAN tags, the behavior of the program
cannot be determined.

Fixes: 4b61d3bfa941 ("fm10k: add receive and tranmit")
Cc: jeffrey.b.shaw@intel.com
Cc: stable@dpdk.org

Signed-off-by: Lu Qiuwen <luqiuwen@iie.ac.cn>
---
 drivers/net/fm10k/fm10k_rxtx.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Wang, Xiao W Dec. 6, 2019, 1:21 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Lu Qiuwen <luqiuwen@iie.ac.cn>
> Sent: Thursday, December 5, 2019 9:30 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Shaw, Jeffrey B <jeffrey.b.shaw@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/fm10k: fix descriptor vlan field filling in Tx
> 
> The VLAN field in the descriptor is not filled when ol_flags has
> no VLAN flag. When the caller sends some packets with VLAN tags,
> but other packets do not have VLAN tags, the behavior of the program
> cannot be determined.
> 
> Fixes: 4b61d3bfa941 ("fm10k: add receive and tranmit")
> Cc: jeffrey.b.shaw@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Lu Qiuwen <luqiuwen@iie.ac.cn>
> ---
>  drivers/net/fm10k/fm10k_rxtx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
> index 5c3112183..4accaa2cd 100644
> --- a/drivers/net/fm10k/fm10k_rxtx.c
> +++ b/drivers/net/fm10k/fm10k_rxtx.c
> @@ -611,6 +611,8 @@ static inline void tx_xmit_pkt(struct fm10k_tx_queue *q,
> struct rte_mbuf *mb)
>  	/* set vlan if requested */
>  	if (mb->ol_flags & PKT_TX_VLAN_PKT)
>  		q->hw_ring[q->next_free].vlan = mb->vlan_tci;
> +	else
> +		q->hw_ring[q->next_free].vlan = 0;
> 
>  	q->sw_ring[q->next_free] = mb;
>  	q->hw_ring[q->next_free].buffer_addr =
> --
> 2.20.1.windows.1

Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Xiaolong Ye Dec. 9, 2019, 12:59 p.m. UTC | #2
On 12/06, Wang, Xiao W wrote:
>Hi,
>
>> -----Original Message-----
>> From: Lu Qiuwen <luqiuwen@iie.ac.cn>
>> Sent: Thursday, December 5, 2019 9:30 PM
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
>> <xiao.w.wang@intel.com>
>> Cc: dev@dpdk.org; Shaw, Jeffrey B <jeffrey.b.shaw@intel.com>;
>> stable@dpdk.org
>> Subject: [PATCH] net/fm10k: fix descriptor vlan field filling in Tx
>> 
>> The VLAN field in the descriptor is not filled when ol_flags has
>> no VLAN flag. When the caller sends some packets with VLAN tags,
>> but other packets do not have VLAN tags, the behavior of the program
>> cannot be determined.
>> 
>> Fixes: 4b61d3bfa941 ("fm10k: add receive and tranmit")
>> Cc: jeffrey.b.shaw@intel.com
>> Cc: stable@dpdk.org
>> 
>> Signed-off-by: Lu Qiuwen <luqiuwen@iie.ac.cn>
>> ---
>>  drivers/net/fm10k/fm10k_rxtx.c | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
>> index 5c3112183..4accaa2cd 100644
>> --- a/drivers/net/fm10k/fm10k_rxtx.c
>> +++ b/drivers/net/fm10k/fm10k_rxtx.c
>> @@ -611,6 +611,8 @@ static inline void tx_xmit_pkt(struct fm10k_tx_queue *q,
>> struct rte_mbuf *mb)
>>  	/* set vlan if requested */
>>  	if (mb->ol_flags & PKT_TX_VLAN_PKT)
>>  		q->hw_ring[q->next_free].vlan = mb->vlan_tci;
>> +	else
>> +		q->hw_ring[q->next_free].vlan = 0;
>> 
>>  	q->sw_ring[q->next_free] = mb;
>>  	q->hw_ring[q->next_free].buffer_addr =
>> --
>> 2.20.1.windows.1
>
>Acked-by: Xiao Wang <xiao.w.wang@intel.com>


Applied to dpdk-next-net-intel, Thanks.

Patch
diff mbox series

diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxtx.c
index 5c3112183..4accaa2cd 100644
--- a/drivers/net/fm10k/fm10k_rxtx.c
+++ b/drivers/net/fm10k/fm10k_rxtx.c
@@ -611,6 +611,8 @@  static inline void tx_xmit_pkt(struct fm10k_tx_queue *q, struct rte_mbuf *mb)
 	/* set vlan if requested */
 	if (mb->ol_flags & PKT_TX_VLAN_PKT)
 		q->hw_ring[q->next_free].vlan = mb->vlan_tci;
+	else
+		q->hw_ring[q->next_free].vlan = 0;
 
 	q->sw_ring[q->next_free] = mb;
 	q->hw_ring[q->next_free].buffer_addr =