Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/74083/?format=api
http://patchwork.dpdk.org/api/patches/74083/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200715105055.80089-1-shys@mellanox.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20200715105055.80089-1-shys@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200715105055.80089-1-shys@mellanox.com", "date": "2020-07-15T10:50:55", "name": "net/mlx5: fix file path location of HW counters", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "70b48c701597ec0e8c3aed44d918b5b082c596e3", "submitter": { "id": 1716, "url": "http://patchwork.dpdk.org/api/people/1716/?format=api", "name": "Shy Shyman", "email": "shys@mellanox.com" }, "delegate": { "id": 3268, "url": "http://patchwork.dpdk.org/api/users/3268/?format=api", "username": "rasland", "first_name": "Raslan", "last_name": "Darawsheh", "email": "rasland@nvidia.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200715105055.80089-1-shys@mellanox.com/mbox/", "series": [ { "id": 11045, "url": "http://patchwork.dpdk.org/api/series/11045/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=11045", "date": "2020-07-15T10:50:55", "name": "net/mlx5: fix file path location of HW counters", "version": 1, "mbox": "http://patchwork.dpdk.org/series/11045/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/74083/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/74083/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3017DA0545;\n\tWed, 15 Jul 2020 12:51:01 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A1F331BED3;\n\tWed, 15 Jul 2020 12:50:59 +0200 (CEST)", "from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130])\n by dpdk.org (Postfix) with ESMTP id 167801BEBF;\n Wed, 15 Jul 2020 12:50:58 +0200 (CEST)" ], "From": "Shy Shyman <shys@mellanox.com>", "To": "dev@dpdk.org", "Cc": "viacheslavo@mellanox.com,\n\tstable@dpdk.org", "Date": "Wed, 15 Jul 2020 13:50:55 +0300", "Message-Id": "<20200715105055.80089-1-shys@mellanox.com>", "X-Mailer": "git-send-email 2.21.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH] net/mlx5: fix file path location of HW counters", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "When debugging performance of a DPDK application the user may\nneed to view the different statistics of DPDK(for example out_of_buffer)\nThis can be enabled by using testpmd command 'show port xstats\n<port_id>' for example.\n\nThe current implementation assumes legacy mode in which the\ncounters\nare at <ibdev_path>/<port_id>/hw_counters/<file_name>.\nIn switchdev mode the counters file is located right after the device\nname, hence resides at <ibdev_path>/hw_counters.\n\nThe fix tries to open the path in the second location after a failure\nto open the file from the first location.\n\nFixes: 9c0a9eed37f1 (\"net/mlx5: switch to the names in the shared IB context\")\n\nCc: stable@dpdk.org\nCc: viacheslavo@mellanox.com\n\nSigned-off-by: Shy Shyman <shys@mellanox.com>\n---\n drivers/net/mlx5/linux/mlx5_os.c | 16 +++++++++++++---\n 1 file changed, 13 insertions(+), 3 deletions(-)", "diff": "diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c\nindex 2dc57b20ef..0edc96299c 100644\n--- a/drivers/net/mlx5/linux/mlx5_os.c\n+++ b/drivers/net/mlx5/linux/mlx5_os.c\n@@ -1948,10 +1948,20 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,\n \n \tif (priv->sh) {\n \t\tMKSTR(path, \"%s/ports/%d/hw_counters/%s\",\n-\t\t\t priv->sh->ibdev_path,\n-\t\t\t priv->dev_port,\n-\t\t\t ctr_name);\n+\t\t priv->sh->ibdev_path,\n+\t\t priv->dev_port,\n+\t\t ctr_name);\n \t\tfd = open(path, O_RDONLY);\n+\t\t/*\n+ \t\t * in switchdev the file location is not per port\n+\t\t * but rather in <ibdev_path>/hw_counters/<file_name>.\n+\t\t*/\n+\t\tif (fd == -1) {\n+\t\t\tMKSTR(path1, \"%s/hw_counters/%s\",\n+\t\t\t priv->sh->ibdev_path,\n+\t\t\t ctr_name);\n+\t\t\tfd = open(path1, O_RDONLY);\n+\t\t}\n \t\tif (fd != -1) {\n \t\t\tchar buf[21] = {'\\0'};\n \t\t\tssize_t n = read(fd, buf, sizeof(buf));\n", "prefixes": [] }{ "id": 74083, "url": "