Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/64945/?format=api
http://patches.dpdk.org/api/patches/64945/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1579539790-3882-5-git-send-email-matan@mellanox.com/", "project": { "id": 1, "url": "http://patches.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": "<1579539790-3882-5-git-send-email-matan@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1579539790-3882-5-git-send-email-matan@mellanox.com", "date": "2020-01-20T17:02:36", "name": "[v1,04/38] mlx5: share mlx5 PCI device detection", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "56caf412f7dc15e0ac6e9574d383e9bc5f6a0dff", "submitter": { "id": 796, "url": "http://patches.dpdk.org/api/people/796/?format=api", "name": "Matan Azrad", "email": "matan@mellanox.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1579539790-3882-5-git-send-email-matan@mellanox.com/mbox/", "series": [ { "id": 8223, "url": "http://patches.dpdk.org/api/series/8223/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8223", "date": "2020-01-20T17:02:37", "name": "Introduce mlx5 vDPA driver", "version": 1, "mbox": "http://patches.dpdk.org/series/8223/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/64945/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/64945/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 79758A0526;\n\tMon, 20 Jan 2020 18:04:29 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DF7401BFC8;\n\tMon, 20 Jan 2020 18:03:31 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n by dpdk.org (Postfix) with ESMTP id 17E421BF81\n for <dev@dpdk.org>; Mon, 20 Jan 2020 18:03:13 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n asafp@mellanox.com)\n with ESMTPS (AES256-SHA encrypted); 20 Jan 2020 19:03:12 +0200", "from pegasus07.mtr.labs.mlnx (pegasus07.mtr.labs.mlnx\n [10.210.16.112])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 00KH3BGN024424;\n Mon, 20 Jan 2020 19:03:12 +0200" ], "From": "Matan Azrad <matan@mellanox.com>", "To": "dev@dpdk.org", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n Thomas Monjalon <thomas@monjalon.net>", "Date": "Mon, 20 Jan 2020 17:02:36 +0000", "Message-Id": "<1579539790-3882-5-git-send-email-matan@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1579539790-3882-1-git-send-email-matan@mellanox.com>", "References": "<1579539790-3882-1-git-send-email-matan@mellanox.com>", "Subject": "[dpdk-dev] [PATCH v1 04/38] mlx5: share mlx5 PCI device detection", "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": "Move PCI detection by IB device from mlx5 PMD to the common code.\n\nSigned-off-by: Matan Azrad <matan@mellanox.com>\n---\n drivers/common/mlx5/Makefile | 2 +-\n drivers/common/mlx5/mlx5_common.c | 55 +++++++++++++++++++++++++\n drivers/common/mlx5/mlx5_common.h | 4 ++\n drivers/common/mlx5/rte_common_mlx5_version.map | 2 +\n drivers/net/mlx5/mlx5.c | 1 +\n drivers/net/mlx5/mlx5.h | 2 -\n drivers/net/mlx5/mlx5_ethdev.c | 53 +-----------------------\n drivers/net/mlx5/mlx5_rxtx.c | 1 +\n drivers/net/mlx5/mlx5_stats.c | 3 ++\n 9 files changed, 68 insertions(+), 55 deletions(-)", "diff": "diff --git a/drivers/common/mlx5/Makefile b/drivers/common/mlx5/Makefile\nindex b94d3c0..66585b2 100644\n--- a/drivers/common/mlx5/Makefile\n+++ b/drivers/common/mlx5/Makefile\n@@ -41,7 +41,7 @@ else\n LDLIBS += -libverbs -lmlx5\n endif\n \n-LDLIBS += -lrte_eal\n+LDLIBS += -lrte_eal -lrte_pci\n \n # A few warnings cannot be avoided in external headers.\n CFLAGS += -Wno-error=cast-qual -DNDEBUG -UPEDANTIC\ndiff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c\nindex 9c88a63..2381208 100644\n--- a/drivers/common/mlx5/mlx5_common.c\n+++ b/drivers/common/mlx5/mlx5_common.c\n@@ -5,6 +5,9 @@\n #include <dlfcn.h>\n #include <unistd.h>\n #include <string.h>\n+#include <stdio.h>\n+\n+#include <rte_errno.h>\n \n #include <rte_errno.h>\n \n@@ -16,6 +19,58 @@\n int mlx5_common_logtype;\n \n \n+/**\n+ * Get PCI information by sysfs device path.\n+ *\n+ * @param dev_path\n+ * Pointer to device sysfs folder name.\n+ * @param[out] pci_addr\n+ * PCI bus address output buffer.\n+ *\n+ * @return\n+ * 0 on success, a negative errno value otherwise and rte_errno is set.\n+ */\n+int\n+mlx5_dev_to_pci_addr(const char *dev_path,\n+\t\t struct rte_pci_addr *pci_addr)\n+{\n+\tFILE *file;\n+\tchar line[32];\n+\tMKSTR(path, \"%s/device/uevent\", dev_path);\n+\n+\tfile = fopen(path, \"rb\");\n+\tif (file == NULL) {\n+\t\trte_errno = errno;\n+\t\treturn -rte_errno;\n+\t}\n+\twhile (fgets(line, sizeof(line), file) == line) {\n+\t\tsize_t len = strlen(line);\n+\t\tint ret;\n+\n+\t\t/* Truncate long lines. */\n+\t\tif (len == (sizeof(line) - 1))\n+\t\t\twhile (line[(len - 1)] != '\\n') {\n+\t\t\t\tret = fgetc(file);\n+\t\t\t\tif (ret == EOF)\n+\t\t\t\t\tbreak;\n+\t\t\t\tline[(len - 1)] = ret;\n+\t\t\t}\n+\t\t/* Extract information. */\n+\t\tif (sscanf(line,\n+\t\t\t \"PCI_SLOT_NAME=\"\n+\t\t\t \"%\" SCNx32 \":%\" SCNx8 \":%\" SCNx8 \".%\" SCNx8 \"\\n\",\n+\t\t\t &pci_addr->domain,\n+\t\t\t &pci_addr->bus,\n+\t\t\t &pci_addr->devid,\n+\t\t\t &pci_addr->function) == 4) {\n+\t\t\tret = 0;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tfclose(file);\n+\treturn 0;\n+}\n+\n #ifdef RTE_IBVERBS_LINK_DLOPEN\n \n /**\ndiff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h\nindex 9f10def..107ab8d 100644\n--- a/drivers/common/mlx5/mlx5_common.h\n+++ b/drivers/common/mlx5/mlx5_common.h\n@@ -6,7 +6,9 @@\n #define RTE_PMD_MLX5_COMMON_H_\n \n #include <assert.h>\n+#include <stdio.h>\n \n+#include <rte_pci.h>\n #include <rte_log.h>\n \n \n@@ -84,4 +86,6 @@\n \t\\\n \tsnprintf(name, sizeof(name), \"\" __VA_ARGS__)\n \n+int mlx5_dev_to_pci_addr(const char *dev_path, struct rte_pci_addr *pci_addr);\n+\n #endif /* RTE_PMD_MLX5_COMMON_H_ */\ndiff --git a/drivers/common/mlx5/rte_common_mlx5_version.map b/drivers/common/mlx5/rte_common_mlx5_version.map\nindex e4f85e2..0c01172 100644\n--- a/drivers/common/mlx5/rte_common_mlx5_version.map\n+++ b/drivers/common/mlx5/rte_common_mlx5_version.map\n@@ -17,4 +17,6 @@ DPDK_20.02 {\n \tmlx5_devx_cmd_qp_query_tis_td;\n \tmlx5_devx_cmd_query_hca_attr;\n \tmlx5_devx_get_out_command_status;\n+\n+\tmlx5_dev_to_pci_addr;\n };\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex f3cb19d..75175c9 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -39,6 +39,7 @@\n \n #include <mlx5_glue.h>\n #include <mlx5_devx_cmds.h>\n+#include <mlx5_common.h>\n \n #include \"mlx5_defs.h\"\n #include \"mlx5.h\"\ndiff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex 29c0a06..4126284 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -653,8 +653,6 @@ int mlx5_dev_get_flow_ctrl(struct rte_eth_dev *dev,\n \t\t\t struct rte_eth_fc_conf *fc_conf);\n int mlx5_dev_set_flow_ctrl(struct rte_eth_dev *dev,\n \t\t\t struct rte_eth_fc_conf *fc_conf);\n-int mlx5_dev_to_pci_addr(const char *dev_path,\n-\t\t\t struct rte_pci_addr *pci_addr);\n void mlx5_dev_link_status_handler(void *arg);\n void mlx5_dev_interrupt_handler(void *arg);\n void mlx5_dev_interrupt_handler_devx(void *arg);\ndiff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c\nindex eddf888..2628e64 100644\n--- a/drivers/net/mlx5/mlx5_ethdev.c\n+++ b/drivers/net/mlx5/mlx5_ethdev.c\n@@ -38,6 +38,7 @@\n \n #include <mlx5_glue.h>\n #include <mlx5_devx_cmds.h>\n+#include <mlx5_common.h>\n \n #include \"mlx5.h\"\n #include \"mlx5_rxtx.h\"\n@@ -1212,58 +1213,6 @@ int mlx5_fw_version_get(struct rte_eth_dev *dev, char *fw_ver, size_t fw_size)\n }\n \n /**\n- * Get PCI information by sysfs device path.\n- *\n- * @param dev_path\n- * Pointer to device sysfs folder name.\n- * @param[out] pci_addr\n- * PCI bus address output buffer.\n- *\n- * @return\n- * 0 on success, a negative errno value otherwise and rte_errno is set.\n- */\n-int\n-mlx5_dev_to_pci_addr(const char *dev_path,\n-\t\t struct rte_pci_addr *pci_addr)\n-{\n-\tFILE *file;\n-\tchar line[32];\n-\tMKSTR(path, \"%s/device/uevent\", dev_path);\n-\n-\tfile = fopen(path, \"rb\");\n-\tif (file == NULL) {\n-\t\trte_errno = errno;\n-\t\treturn -rte_errno;\n-\t}\n-\twhile (fgets(line, sizeof(line), file) == line) {\n-\t\tsize_t len = strlen(line);\n-\t\tint ret;\n-\n-\t\t/* Truncate long lines. */\n-\t\tif (len == (sizeof(line) - 1))\n-\t\t\twhile (line[(len - 1)] != '\\n') {\n-\t\t\t\tret = fgetc(file);\n-\t\t\t\tif (ret == EOF)\n-\t\t\t\t\tbreak;\n-\t\t\t\tline[(len - 1)] = ret;\n-\t\t\t}\n-\t\t/* Extract information. */\n-\t\tif (sscanf(line,\n-\t\t\t \"PCI_SLOT_NAME=\"\n-\t\t\t \"%\" SCNx32 \":%\" SCNx8 \":%\" SCNx8 \".%\" SCNx8 \"\\n\",\n-\t\t\t &pci_addr->domain,\n-\t\t\t &pci_addr->bus,\n-\t\t\t &pci_addr->devid,\n-\t\t\t &pci_addr->function) == 4) {\n-\t\t\tret = 0;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\tfclose(file);\n-\treturn 0;\n-}\n-\n-/**\n * Handle asynchronous removal event for entire multiport device.\n *\n * @param sh\ndiff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c\nindex a845f67..95e0a99 100644\n--- a/drivers/net/mlx5/mlx5_rxtx.c\n+++ b/drivers/net/mlx5/mlx5_rxtx.c\n@@ -30,6 +30,7 @@\n \n #include <mlx5_devx_cmds.h>\n #include <mlx5_prm.h>\n+#include <mlx5_common.h>\n \n #include \"mlx5_defs.h\"\n #include \"mlx5.h\"\ndiff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c\nindex 0ed7170..4c69e77 100644\n--- a/drivers/net/mlx5/mlx5_stats.c\n+++ b/drivers/net/mlx5/mlx5_stats.c\n@@ -13,10 +13,13 @@\n #include <rte_common.h>\n #include <rte_malloc.h>\n \n+#include <mlx5_common.h>\n+\n #include \"mlx5_defs.h\"\n #include \"mlx5.h\"\n #include \"mlx5_rxtx.h\"\n \n+\n static const struct mlx5_counter_ctrl mlx5_counters_init[] = {\n \t{\n \t\t.dpdk_name = \"rx_port_unicast_bytes\",\n", "prefixes": [ "v1", "04/38" ] }{ "id": 64945, "url": "