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 9493CA0518 for ; Fri, 24 Jul 2020 14:11:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A99F1C012; Fri, 24 Jul 2020 14:11:44 +0200 (CEST) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 057671C29A for ; Fri, 24 Jul 2020 14:11:43 +0200 (CEST) Received: by mail-wm1-f67.google.com with SMTP id o8so7760665wmh.4 for ; Fri, 24 Jul 2020 05:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tBedKLlf343QFsoPuXPIyLUXKjEaPV7LUci3i+0CiJM=; b=BjhE/uPa6JOFi1HvW2tg1Yl3dTtRnDKXey5BrG+C+y1opI8pSa7YCowjMM5U+ywSo2 MPIi9emFQ0x28PnpZrpOuk5DStCVWVFS6nkMzAAkSd95lyn3KAbsZLFJ88Yltu5Bs9LX zCLXavY9DI1frITwZUnhQMn49VxUrVGfrzcFcdP7DDBlf9m2okvlA57EzTCkM2thzZNk 7fRmauGamuejsiRCMSf/Bm1H9CjiqfdjvXDQ/uTrr9f9bzCdYBmg6nM2eNRu9I/ffFne DuipkXReAA2a+JYWCupcxRzOgcBUW69GhhvgoqJ2Uj628PU284S8FdB1F66f+2/qnoW8 G/Cw== 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:mime-version:content-transfer-encoding; bh=tBedKLlf343QFsoPuXPIyLUXKjEaPV7LUci3i+0CiJM=; b=QbRZk5dLVnk/qWo+GNLmCahYBdK1PJDYRgs+9pXynzlEDd37DtW3KqaUinVoyU2wO1 qY5eKmmBFHIyO9TAFlbPSMbmMuPgU1y7MDRDCVbdw2XZk8iwHjx4ctQZXiLV2MKQ/v57 D4/rXwx0kT0h0ywZSEZRXrD+f1+dXbFzXO9tVMw4SKtc4bruaeu1mBgT/5p2E9VekAc9 VOKJ27xuM6j6F/gk1Gv3RP9LMG2sWrek882zAg5XSG9tziQvW1F92EhB75/+x7md67z1 DsnppGoc0CNTfCDiBKp/r+NI2CBAcVM63hia6GL00V5r6vEsgFnsLsUgb/4J8mKTZUCW VPdw== X-Gm-Message-State: AOAM533Ny3ipWLZ3DUhbEg94V/uQLKUwlmeSdlerOSzM4mkqtjnp+K25 ffKyxTONYazAhrggaPB6a0o= X-Google-Smtp-Source: ABdhPJw7QZ02t74FFCGlIUw3FB22J5wl2T3SpSkrU6kh42k807WlfyCxuBgfrvAw3yUFd6x7+K8ljw== X-Received: by 2002:a7b:cbc1:: with SMTP id n1mr8553310wmi.18.1595592702700; Fri, 24 Jul 2020 05:11:42 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 65sm1472833wre.6.2020.07.24.05.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:11:41 -0700 (PDT) From: luca.boccassi@gmail.com To: Shy Shyman Cc: Viacheslav Ovsiienko , dpdk stable Date: Fri, 24 Jul 2020 13:00:10 +0100 Message-Id: <20200724120030.1863487-172-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx5: fix HW counters path in switchdev mode' has been queued to stable release 19.11.4 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 9b7e7f229e94d30d6de0bd0782b778c379dba898 Mon Sep 17 00:00:00 2001 From: Shy Shyman Date: Wed, 15 Jul 2020 13:50:55 +0300 Subject: [PATCH] net/mlx5: fix HW counters path in switchdev mode [ upstream commit 038e7fc085746167f8a50c1612acada5a78fc7da ] When debugging performance of a DPDK application the user may need to view the different statistics of DPDK (for example out_of_buffer) This can be enabled by using testpmd command 'show port xstats ' for example. The current implementation assumes legacy mode in which the counters are at //hw_counters/. In switchdev mode the counters file is located right after the device name, hence resides at /hw_counters. The fix tries to open the path in the second location after a failure to open the file from the first location. Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB context") Signed-off-by: Shy Shyman Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_stats.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 636fc80c7..f3ec9543f 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -145,10 +145,20 @@ mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat) if (priv->sh) { MKSTR(path, "%s/ports/%d/hw_counters/%s", - priv->sh->ibdev_path, - priv->ibv_port, - ctr_name); + priv->sh->ibdev_path, + priv->ibv_port, + ctr_name); fd = open(path, O_RDONLY); + /* + * in switchdev the file location is not per port + * but rather in /hw_counters/. + */ + if (fd == -1) { + MKSTR(path1, "%s/hw_counters/%s", + priv->sh->ibdev_path, + ctr_name); + fd = open(path1, O_RDONLY); + } if (fd != -1) { char buf[21] = {'\0'}; ssize_t n = read(fd, buf, sizeof(buf)); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:55.187825621 +0100 +++ 0172-net-mlx5-fix-HW-counters-path-in-switchdev-mode.patch 2020-07-24 12:53:48.579011900 +0100 @@ -1,8 +1,10 @@ -From 038e7fc085746167f8a50c1612acada5a78fc7da Mon Sep 17 00:00:00 2001 +From 9b7e7f229e94d30d6de0bd0782b778c379dba898 Mon Sep 17 00:00:00 2001 From: Shy Shyman Date: Wed, 15 Jul 2020 13:50:55 +0300 Subject: [PATCH] net/mlx5: fix HW counters path in switchdev mode +[ upstream commit 038e7fc085746167f8a50c1612acada5a78fc7da ] + When debugging performance of a DPDK application the user may need to view the different statistics of DPDK (for example out_of_buffer) This can be enabled by using testpmd command 'show port xstats @@ -17,27 +19,26 @@ to open the file from the first location. Fixes: 9c0a9eed37f1 ("net/mlx5: switch to the names in the shared IB context") -Cc: stable@dpdk.org Signed-off-by: Shy Shyman Acked-by: Viacheslav Ovsiienko --- - drivers/net/mlx5/linux/mlx5_os.c | 16 +++++++++++++--- + drivers/net/mlx5/mlx5_stats.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c -index 9622eb31e..c4e6c6f6f 100644 ---- a/drivers/net/mlx5/linux/mlx5_os.c -+++ b/drivers/net/mlx5/linux/mlx5_os.c -@@ -2166,10 +2166,20 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name, +diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c +index 636fc80c7..f3ec9543f 100644 +--- a/drivers/net/mlx5/mlx5_stats.c ++++ b/drivers/net/mlx5/mlx5_stats.c +@@ -145,10 +145,20 @@ mlx5_read_ib_stat(struct mlx5_priv *priv, const char *ctr_name, uint64_t *stat) if (priv->sh) { MKSTR(path, "%s/ports/%d/hw_counters/%s", - priv->sh->ibdev_path, -- priv->dev_port, +- priv->ibv_port, - ctr_name); + priv->sh->ibdev_path, -+ priv->dev_port, ++ priv->ibv_port, + ctr_name); fd = open(path, O_RDONLY); + /*