patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: stable@dpdk.org
Cc: adrien.mazarguil@6wind.com
Subject: [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send
Date: Wed, 25 Jan 2017 15:35:52 +0200	[thread overview]
Message-ID: <1485351352-48066-1-git-send-email-shahafs@mellanox.com> (raw)

[ backported from upstream commit 786b5c2dac785fe2fdbd303c236edc9491c00e5e ]

Dseg pointer is not initialized when the first segment is inlined
causing a segmentation fault in such situation.

Fixes: 2a66cf378954 ("net/mlx5: support inline send")

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
Strangely i didn't had any conflicts when applying this patch on top of 16.11 stable branch.
Please let me know if you have any.
---
 drivers/net/mlx5/mlx5_rxtx.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index 9b59801..eda88b6 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -488,7 +488,7 @@
 			/* Store the inlined packet size in the WQE. */
 			wqe->eseg.inline_hdr_sz = htons(pkt_inline_sz);
 			/*
-			 * 2 DWORDs consumed by the WQE header + 1 DSEG +
+			 * 2 DWORDs consumed by the WQE header + ETH segment +
 			 * the size of the inline part of the packet.
 			 */
 			ds = 2 + MLX5_WQE_DS(pkt_inline_sz - 2);
@@ -503,6 +503,10 @@
 			} else if (!segs_n) {
 				goto next_pkt;
 			} else {
+				/* dseg will be advance as part of next_seg */
+				dseg = (volatile rte_v128u32_t *)
+					((uintptr_t)wqe +
+					 ((ds - 1) * MLX5_WQE_DWORD_SIZE));
 				goto next_seg;
 			}
 		} else {
-- 
1.8.3.1

             reply	other threads:[~2017-01-25 13:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-25 13:35 Shahaf Shuler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-26 15:28 Shahaf Shuler
2016-12-27 10:21 ` Adrien Mazarguil
2017-01-05 18:55   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485351352-48066-1-git-send-email-shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).