From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f41.google.com (mail-pg0-f41.google.com [74.125.83.41]) by dpdk.org (Postfix) with ESMTP id 561999963 for ; Mon, 21 Aug 2017 11:37:53 +0200 (CEST) Received: by mail-pg0-f41.google.com with SMTP id t3so68861669pgt.0 for ; Mon, 21 Aug 2017 02:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CKmH/69o5WwW2E0P2hiSmZ1oVJ4abNdk8Vz4TwFWM4E=; b=ou3TjLRfkLGsvkwsGRPj5lZ0mU6a8Rsd0OZPFk0pGgRHAdFc2H5kML8/LxmTVS3RkK d/liKnriYGvorwfZsZxRZxwN3LVXQXB7cJrWcoqnOZ6XXJZAy+neqPlHGtV5CTe1EQZ3 W5HPr3aFDEpMyw3UhD6sW6qrt2qD2aWzcMPIcDN0f/t2kRqh2FmcDS7hyBnmdVcpoEqj hHdExfVof4DSaek3GpIR9Oet9HeiRYL4Q51lUPhRI4t+xPytQhuYd2mHX4Q61257Nq4r gMb3nOhF7sOeK3vRm2JbWJu5NcU4eB/9FbykKMKmoD3oWFVqJDuGKVOqz96vTsKOxs3l xRFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CKmH/69o5WwW2E0P2hiSmZ1oVJ4abNdk8Vz4TwFWM4E=; b=KBprqwKd5+VP3xUnZoszKUQW8oxfSkKtl2q9+1m8HqmIUbXCEOxOHuAeF6jwsKBcs1 zbDCGwbeavOy+f9U8L03XWEe7YH6eLlNiMCCUksBH8IGY3XggRCgAsjxrjTlxFv45KXu I+zvGl41KxD8hzdZOeUeRFz2Nd3sVcZcF5cgJu3ZMcRMUU4M8a+PSwz3Jk4mrIcXd34W 9V9EaQW6B8JWClqdJvdCLBuO7V1juqgYlv6JU0ro7q1GSli75lb/dqvi+O9+uVjxJM8y 7p3QUVQJnmwN0r1VoIjAaYjkloeBvStntv3ALfEGrFXBv31a3g10AV8sS6TC278ZcLrD 0cDg== X-Gm-Message-State: AHYfb5jX+y66fXNkpFkVVtOx84MbLWRxoL72BM01mmr222Hwsws2//9n 1h/TKdJt8dp2uMcxc8vL+g== X-Received: by 10.98.131.141 with SMTP id h135mr16342488pfe.271.1503308272394; Mon, 21 Aug 2017 02:37:52 -0700 (PDT) Received: from localhost.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 69sm23355087pfh.186.2017.08.21.02.37.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 02:37:51 -0700 (PDT) From: Yuanhan Liu To: Matan Azrad Cc: Adrien Mazarguil , dpdk stable , Yuanhan Liu Date: Mon, 21 Aug 2017 17:31:09 +0800 Message-Id: <1503307878-16728-55-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> References: <1503307878-16728-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx4: fix flow creation before start' has been queued to stable release 17.05.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2017 09:37:53 -0000 Hi, FYI, your patch has been queued to stable release 17.05.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 3f666ca92676cfca2e2ee87d9874e3ad4a15fdf7 Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Thu, 27 Jul 2017 13:27:24 +0300 Subject: [PATCH] net/mlx4: fix flow creation before start [ upstream commit f3b10f1d2474dfa6774ec31e1a8dc14c76b3ac53 ] The corrupted code causes segmentation fault when user creates flow with drop action before device starting. For example, failsafe PMD recreates all the flows before calling dev_start in plug-in sequence and mlx4 allocated its flow drop queue in dev_start. Hence, when failsafe created flow with drop action after plug-in event, mlx4 tried to dereference flow drop queue which was uninitialized. The fix added check to the drop qp accessible and conditioned the ibv_create_flow calling on device starting. Fixes: 642fe56a1ba5 ("net/mlx4: use a single drop queue for all drop flows") Fixes: 46d5736a7049 ("net/mlx4: support basic flow items and actions") Signed-off-by: Matan Azrad Acked-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_flow.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index edfac03..b9a024b 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -829,7 +829,7 @@ priv_flow_create_action_queue(struct priv *priv, return NULL; } if (action->drop) { - qp = priv->flow_drop_queue->qp; + qp = priv->flow_drop_queue ? priv->flow_drop_queue->qp : NULL; } else { struct rxq *rxq = (*priv->rxqs)[action->queue_id]; @@ -837,6 +837,8 @@ priv_flow_create_action_queue(struct priv *priv, rte_flow->qp = qp; } rte_flow->ibv_attr = ibv_attr; + if (!priv->started) + return rte_flow; rte_flow->ibv_flow = ibv_create_flow(qp, rte_flow->ibv_attr); if (!rte_flow->ibv_flow) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, -- 2.7.4