From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH] net/mlx4: fix mbuf poisoning in debug code Date: Wed, 5 Jul 2017 16:35:47 +0200 Message-ID: <20170705143547.GA19852@6wind.com> References: <513298ea9e590eda85def2ef4bc7029879dbcb32.1499243201.git.vasilyf@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, Nelio Laranjeiro , stable@dpdk.org To: Vasily Philipov Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 41E962A58 for ; Wed, 5 Jul 2017 16:35:57 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id w126so224195550wme.0 for ; Wed, 05 Jul 2017 07:35:57 -0700 (PDT) Content-Disposition: inline In-Reply-To: <513298ea9e590eda85def2ef4bc7029879dbcb32.1499243201.git.vasilyf@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Thanks Vasily, except for the minor nit below, Acked-by: Adrien Mazarguil > --- > 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