From e62d90f2a21b5196aa7606a933923c068a500bee Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Wed, 3 Jul 2019 10:53:32 +0800 Subject: [PATCH] net/fm10k: fix descriptor filling in vector Tx The shift left operation "pkt->vlan_tci << 16" gets vlan_tci extended to signed type and may cause invalid descriptor. Also the same issue for the "data_len" field. This patch fixes it by casting them to uint64_t. Fixes: 21f13c541eb0 ("fm10k: add vector Tx") Cc: stable@dpdk.org Signed-off-by: Xiao Wang Acked-by: Qi Zhang --- drivers/net/fm10k/fm10k_rxtx_vec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/fm10k/fm10k_rxtx_vec.c b/drivers/net/fm10k/fm10k_rxtx_vec.c index 96b46a2bdf..788e2484a2 100644 --- a/drivers/net/fm10k/fm10k_rxtx_vec.c +++ b/drivers/net/fm10k/fm10k_rxtx_vec.c @@ -711,7 +711,7 @@ vtx1(volatile struct fm10k_tx_desc *txdp, struct rte_mbuf *pkt, uint64_t flags) { __m128i descriptor = _mm_set_epi64x(flags << 56 | - pkt->vlan_tci << 16 | pkt->data_len, + (uint64_t)pkt->vlan_tci << 16 | (uint64_t)pkt->data_len, MBUF_DMA_ADDR(pkt)); _mm_store_si128((__m128i *)txdp, descriptor); } -- 2.20.1