patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/fm10k: fix descriptor filling in vector Tx
@ 2019-07-03  2:53 Xiao Wang
  2019-07-08  2:10 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Xiao Wang @ 2019-07-03  2:53 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, marek.kiejdo, Xiao Wang, stable

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 <xiao.w.wang@intel.com>
---
 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 96b46a2bd..788e2484a 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.15.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] net/fm10k: fix descriptor filling in vector Tx
  2019-07-03  2:53 [dpdk-stable] [PATCH] net/fm10k: fix descriptor filling in vector Tx Xiao Wang
@ 2019-07-08  2:10 ` Zhang, Qi Z
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2019-07-08  2:10 UTC (permalink / raw)
  To: Wang, Xiao W; +Cc: dev, Kiejdo, Marek, stable



> -----Original Message-----
> From: Wang, Xiao W
> Sent: Wednesday, July 3, 2019 10:54 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Kiejdo, Marek <marek.kiejdo@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>; stable@dpdk.org
> 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 <xiao.w.wang@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-stable] [PATCH] net/fm10k: fix descriptor filling in vector Tx
@ 2019-07-03  2:50 Xiao Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Xiao Wang @ 2019-07-03  2:50 UTC (permalink / raw)
  To: xiao.w.wang; +Cc: stable

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 <xiao.w.wang@intel.com>
---
 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 96b46a2bd..788e2484a 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.15.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-08  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-03  2:53 [dpdk-stable] [PATCH] net/fm10k: fix descriptor filling in vector Tx Xiao Wang
2019-07-08  2:10 ` Zhang, Qi Z
  -- strict thread matches above, loose matches on Subject: below --
2019-07-03  2:50 Xiao Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).