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: 21f13c541e ("fm10k: add vector Tx")
Cc: stable@dpdk.org

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
This commit is contained in:
Xiao Wang 2019-07-03 10:53:32 +08:00 committed by Ferruh Yigit
parent 5a6d883878
commit e62d90f2a2

View File

@ -711,7 +711,7 @@ vtx1(volatile struct fm10k_tx_desc *txdp,
struct rte_mbuf *pkt, uint64_t flags) struct rte_mbuf *pkt, uint64_t flags)
{ {
__m128i descriptor = _mm_set_epi64x(flags << 56 | __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)); MBUF_DMA_ADDR(pkt));
_mm_store_si128((__m128i *)txdp, descriptor); _mm_store_si128((__m128i *)txdp, descriptor);
} }