patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send
@ 2016-12-26 15:28 Shahaf Shuler
  2016-12-27 10:21 ` Adrien Mazarguil
  0 siblings, 1 reply; 4+ messages in thread
From: Shahaf Shuler @ 2016-12-26 15:28 UTC (permalink / raw)
  To: adrien.mazarguil; +Cc: dev, stable

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

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

CC: stable@dpdk.org
Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 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 97810e8..d6688c6 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -483,7 +483,7 @@
 				assert(addr <= addr_end);
 			}
 			/*
-			 * 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);
@@ -498,6 +498,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

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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send
  2016-12-26 15:28 [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send Shahaf Shuler
@ 2016-12-27 10:21 ` Adrien Mazarguil
  2017-01-05 18:55   ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Adrien Mazarguil @ 2016-12-27 10:21 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: dev, stable

Hi Shahaf,

On Mon, Dec 26, 2016 at 05:28:36PM +0200, Shahaf Shuler wrote:
> Dseg pointer is not initialised when the first segment is inlined
> causing a segmentation fault in such situation.
> 
> Fixes: 2a66cf378954 ("net/mlx5: support inline send")
> 
> CC: stable@dpdk.org
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>

Thanks for fixing this bug, a few comments below.

> ---
>  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 97810e8..d6688c6 100644
> --- a/drivers/net/mlx5/mlx5_rxtx.c
> +++ b/drivers/net/mlx5/mlx5_rxtx.c
> @@ -483,7 +483,7 @@
>  				assert(addr <= addr_end);
>  			}
>  			/*
> -			 * 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);
> @@ -498,6 +498,10 @@
>  			} else if (!segs_n) {
>  				goto next_pkt;
>  			} else {
> +				/* dseg will be advance as part of next_seg*/

Nit-picking here, there is a missing space in the above comment.

> +				dseg = (volatile rte_v128u32_t *)

rte_v128u32_t does not exist (yet) in the tree, this patch therefore depends
on "eal: define generic vector types" [1]. Such dependencies should be
mentioned as a notes section of a patch (after a three-dash line).

Regarding stable@dpdk.org, un case the vector types patch is not applied on
the stable branch, you'll also have to provide your own definition.

> +					((uintptr_t)wqe +
> +					 ((ds - 1) * MLX5_WQE_DWORD_SIZE));
>  				goto next_seg;
>  			}
>  		} else {
> -- 
> 1.8.3.1
> 

Otherwise,

Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

[1] http://dpdk.org/ml/archives/dev/2016-November/050261.html

-- 
Adrien Mazarguil
6WIND

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

* Re: [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send
  2016-12-27 10:21 ` Adrien Mazarguil
@ 2017-01-05 18:55   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-01-05 18:55 UTC (permalink / raw)
  To: Adrien Mazarguil, Shahaf Shuler; +Cc: dev, stable

On 12/27/2016 10:21 AM, Adrien Mazarguil wrote:
> Hi Shahaf,
> 
> On Mon, Dec 26, 2016 at 05:28:36PM +0200, Shahaf Shuler wrote:
>> Dseg pointer is not initialised when the first segment is inlined
>> causing a segmentation fault in such situation.
>>
>> Fixes: 2a66cf378954 ("net/mlx5: support inline send")
>>
>> CC: stable@dpdk.org
>> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
...
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Applied to dpdk-next-net/master, thanks.

(whitespace int the comment fixed)

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

* [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send
@ 2017-01-25 13:35 Shahaf Shuler
  0 siblings, 0 replies; 4+ messages in thread
From: Shahaf Shuler @ 2017-01-25 13:35 UTC (permalink / raw)
  To: stable; +Cc: adrien.mazarguil

[ 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

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

end of thread, other threads:[~2017-01-25 13:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-26 15:28 [dpdk-stable] [PATCH] net/mlx5: fix multi segment packet send Shahaf Shuler
2016-12-27 10:21 ` Adrien Mazarguil
2017-01-05 18:55   ` Ferruh Yigit
2017-01-25 13:35 Shahaf Shuler

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).