From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7211A04C1; Tue, 12 Nov 2019 15:19:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CD22B2AB; Tue, 12 Nov 2019 15:19:40 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0308D91 for ; Tue, 12 Nov 2019 15:19:39 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@mellanox.com) with ESMTPS (AES256-SHA encrypted); 12 Nov 2019 16:19:38 +0200 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.128.130.87]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xACEJcst032337; Tue, 12 Nov 2019 16:19:38 +0200 From: Dekel Peled To: matan@mellanox.com, shahafs@mellanox.com, viacheslavo@mellanox.com Cc: orika@mellanox.com, dev@dpdk.org Date: Tue, 12 Nov 2019 16:19:20 +0200 Message-Id: <639b4cebe1b4f8efb2f2e2150eee708575f523d1.1573568296.git.dekelp@mellanox.com> X-Mailer: git-send-email 1.7.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix verbs flow counter query 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" Function flow_verbs_counter_query() was recently modified. The new 'if' condition uses a pointer to flow counter-set. This pointer is valid only if flow contains a count action. This patch adds check to verify the pointer is valid. Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows") Cc: orika@mellanox.com Signed-off-by: Dekel Peled --- drivers/net/mlx5/mlx5_flow_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c index ea85fa1..c787c98 100644 --- a/drivers/net/mlx5/mlx5_flow_verbs.c +++ b/drivers/net/mlx5/mlx5_flow_verbs.c @@ -191,7 +191,7 @@ { #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) || \ defined(HAVE_IBV_DEVICE_COUNTERS_SET_V45) - if (flow->counter->cs) { + if (flow->counter && flow->counter->cs) { struct rte_flow_query_count *qc = data; uint64_t counters[2] = {0, 0}; #if defined(HAVE_IBV_DEVICE_COUNTERS_SET_V42) -- 1.8.3.1