From patchwork Wed Jul 5 11:49:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Philipov X-Patchwork-Id: 26488 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 434B33772; Wed, 5 Jul 2017 13:49:31 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 929262C48 for ; Wed, 5 Jul 2017 13:49:29 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from vasilyf@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 Jul 2017 14:49:25 +0300 Received: from hpchead.mtr.labs.mlnx. (hpchead.mtr.labs.mlnx [10.209.44.59]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v65BnPq5027280; Wed, 5 Jul 2017 14:49:25 +0300 Received: from hpchead.mtr.labs.mlnx. (localhost.localdomain [127.0.0.1]) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7) with ESMTP id v65BnOde011313; Wed, 5 Jul 2017 14:49:24 +0300 Received: (from vasilyf@localhost) by hpchead.mtr.labs.mlnx. (8.14.7/8.14.7/Submit) id v65BnOU2011077; Wed, 5 Jul 2017 14:49:24 +0300 From: Vasily Philipov To: dev@dpdk.org Cc: Vasily Philipov , Adrien Mazarguil , Nelio Laranjeiro , stable@dpdk.org Date: Wed, 5 Jul 2017 14:49:22 +0300 Message-Id: <513298ea9e590eda85def2ef4bc7029879dbcb32.1499243201.git.vasilyf@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx4: fix mbuf poisoning in debug code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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 + * 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. */