DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx4: fix mbuf poisoning in debug code
@ 2017-07-05 11:49 Vasily Philipov
  2017-07-05 14:35 ` Adrien Mazarguil
  0 siblings, 1 reply; 3+ messages in thread
From: Vasily Philipov @ 2017-07-05 11:49 UTC (permalink / raw)
  To: dev; +Cc: Vasily Philipov, Adrien Mazarguil, Nelio Laranjeiro, stable

In debug mode, all mbuf ol_flags are temporarily enabled while sitting in
the Rx queue to detect otherwise silent data corruption, however some of
them are special (indirect and control) and must be cleared before
returning mbufs to the pool to avoid crashing.

Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
CC: stable@dpdk.org

Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
---
 drivers/net/mlx4/mlx4.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 16cafae..03c5c98 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -3008,6 +3008,13 @@ struct txq_mp2mr_mbuf_check_data {
 			NB_SEGS(rep) = 0x2a;
 			PORT(rep) = 0x2a;
 			rep->ol_flags = -1;
+			/*
+			 * Clear special flags in membuf to avoid
+			 * crashing while freeing.
+			 */
+			rep->ol_flags &=
+				~(uint64_t)(IND_ATTACHED_MBUF |
+					    CTRL_MBUF_FLAG);
 #endif
 			assert(rep->buf_len == seg->buf_len);
 			/* Reconfigure sge to use rep instead of seg. */
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH] net/mlx4: fix mbuf poisoning in debug code
  2017-07-05 11:49 [dpdk-dev] [PATCH] net/mlx4: fix mbuf poisoning in debug code Vasily Philipov
@ 2017-07-05 14:35 ` Adrien Mazarguil
  2017-07-05 14:46   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Adrien Mazarguil @ 2017-07-05 14:35 UTC (permalink / raw)
  To: Vasily Philipov; +Cc: dev, Nelio Laranjeiro, stable

On Wed, Jul 05, 2017 at 02:49:22PM +0300, Vasily Philipov wrote:
> In debug mode, all mbuf ol_flags are temporarily enabled while sitting in
> the Rx queue to detect otherwise silent data corruption, however some of
> them are special (indirect and control) and must be cleared before
> returning mbufs to the pool to avoid crashing.
> 
> Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
> CC: stable@dpdk.org
> 
> Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>

Thanks Vasily, except for the minor nit below,

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

> ---
>  drivers/net/mlx4/mlx4.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
> index 16cafae..03c5c98 100644
> --- a/drivers/net/mlx4/mlx4.c
> +++ b/drivers/net/mlx4/mlx4.c
> @@ -3008,6 +3008,13 @@ struct txq_mp2mr_mbuf_check_data {
>  			NB_SEGS(rep) = 0x2a;
>  			PORT(rep) = 0x2a;
>  			rep->ol_flags = -1;
> +			/*
> +			 * Clear special flags in membuf to avoid

"membuf" => "mbuf"

> +			 * crashing while freeing.
> +			 */
> +			rep->ol_flags &=
> +				~(uint64_t)(IND_ATTACHED_MBUF |
> +					    CTRL_MBUF_FLAG);
>  #endif
>  			assert(rep->buf_len == seg->buf_len);
>  			/* Reconfigure sge to use rep instead of seg. */
> -- 
> 1.8.3.1
> 

-- 
Adrien Mazarguil
6WIND

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/mlx4: fix mbuf poisoning in debug code
  2017-07-05 14:35 ` Adrien Mazarguil
@ 2017-07-05 14:46   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-07-05 14:46 UTC (permalink / raw)
  To: Adrien Mazarguil, Vasily Philipov; +Cc: dev, Nelio Laranjeiro, stable

On 7/5/2017 3:35 PM, Adrien Mazarguil wrote:
> On Wed, Jul 05, 2017 at 02:49:22PM +0300, Vasily Philipov wrote:
>> In debug mode, all mbuf ol_flags are temporarily enabled while sitting in
>> the Rx queue to detect otherwise silent data corruption, however some of
>> them are special (indirect and control) and must be cleared before
>> returning mbufs to the pool to avoid crashing.
>>
>> Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
>> CC: stable@dpdk.org
>>
>> Signed-off-by: Vasily Philipov <vasilyf@mellanox.com>
> 
> Thanks Vasily, except for the minor nit below,
> 
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

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


> "membuf" => "mbuf"
Fixed while applying.

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

end of thread, other threads:[~2017-07-05 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 11:49 [dpdk-dev] [PATCH] net/mlx4: fix mbuf poisoning in debug code Vasily Philipov
2017-07-05 14:35 ` Adrien Mazarguil
2017-07-05 14:46   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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