[dpdk-stable] [PATCH] net/fm10k: fix descriptor vlan field filling in Tx

Lu Qiuwen luqiuwen at iie.ac.cn
Thu Dec 5 14:30:08 CET 2019


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 at intel.com
Cc: stable at dpdk.org

Signed-off-by: Lu Qiuwen <luqiuwen at 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



More information about the stable mailing list