From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shahaf Shuler Subject: [PATCH] net/mlx5: fix flow director drop rule deletion crash Date: Wed, 9 May 2018 10:37:00 +0300 Message-ID: <20180509073700.11627-1-shahafs@mellanox.com> Cc: dev@dpdk.org, stable@dpdk.org To: nelio.laranjeiro@6wind.com, adrien.mazarguil@6wind.com, yskoh@mellanox.com Return-path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 2EC04397D for ; Wed, 9 May 2018 09:37:11 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Drop flow rules are created on the ETH queue even though the parser layer matches the flow rule layer (L3/L4) Fixes: 6f2f4948b236 ("net/mlx5: fix flow director rule deletion crash") Cc: stable@dpdk.org Cc: adrien.mazarguil@6wind.com Signed-off-by: Shahaf Shuler --- drivers/net/mlx5/mlx5_flow.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 38811bbcec..ebc6754eeb 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -3382,6 +3382,8 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, if (parser.drop) { struct ibv_flow_spec_action_drop *drop; + /* Drop rules are created on the ETH queue. */ + parser.layer = HASH_RXQ_ETH; drop = (void *)((uintptr_t)parser.queue[parser.layer].ibv_attr + parser.queue[parser.layer].offset); *drop = (struct ibv_flow_spec_action_drop){ @@ -3401,6 +3403,9 @@ mlx5_fdir_filter_delete(struct rte_eth_dev *dev, attr = parser.queue[parser.layer].ibv_attr; flow_attr = flow->frxq[parser.layer].ibv_attr; + /* Matching flows must have ibv context on the same queue. */ + if (!flow_attr) + continue; /* Compare first the attributes. */ if (memcmp(attr, flow_attr, sizeof(struct ibv_flow_attr))) continue; -- 2.12.0