Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/51447/?format=api
http://patches.dpdk.org/api/patches/51447/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1553155888-27498-5-git-send-email-viacheslavo@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": "<1553155888-27498-5-git-send-email-viacheslavo@mellanox.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1553155888-27498-5-git-send-email-viacheslavo@mellanox.com", "date": "2019-03-21T08:11:18", "name": "[04/14] net/mlx5: add getting IB ports number for multiport IB", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "60f26aa2369b9aa6cd286d6ccf0f0c94817ae088", "submitter": { "id": 1102, "url": "http://patches.dpdk.org/api/people/1102/?format=api", "name": "Slava Ovsiienko", "email": "viacheslavo@mellanox.com" }, "delegate": { "id": 6624, "url": "http://patches.dpdk.org/api/users/6624/?format=api", "username": "shahafs", "first_name": "Shahaf", "last_name": "Shuler", "email": "shahafs@mellanox.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1553155888-27498-5-git-send-email-viacheslavo@mellanox.com/mbox/", "series": [ { "id": 3842, "url": "http://patches.dpdk.org/api/series/3842/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=3842", "date": "2019-03-21T08:11:18", "name": "net/mlx5: add support for multiport IB devices", "version": 1, "mbox": "http://patches.dpdk.org/series/3842/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/51447/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/51447/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BE9A71B437;\n\tThu, 21 Mar 2019 09:11:44 +0100 (CET)", "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id 936681B438\n\tfor <dev@dpdk.org>; Thu, 21 Mar 2019 09:11:42 +0100 (CET)", "from Internal Mail-Server by MTLPINE1 (envelope-from\n\tviacheslavo@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 21 Mar 2019 10:11:37 +0200", "from pegasus12.mtr.labs.mlnx. (pegasus12.mtr.labs.mlnx\n\t[10.210.17.40])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x2L8Bai2003643;\n\tThu, 21 Mar 2019 10:11:37 +0200" ], "From": "Viacheslav Ovsiienko <viacheslavo@mellanox.com>", "To": "dev@dpdk.org", "Cc": "shahafs@mellanox.com", "Date": "Thu, 21 Mar 2019 08:11:18 +0000", "Message-Id": "<1553155888-27498-5-git-send-email-viacheslavo@mellanox.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1553155888-27498-1-git-send-email-viacheslavo@mellanox.com>", "References": "<1551376985-11096-1-git-send-email-viacheslavo@mellanox.com>\n\t<1553155888-27498-1-git-send-email-viacheslavo@mellanox.com>", "Subject": "[dpdk-dev] [PATCH 04/14] net/mlx5: add getting IB ports number for\n\tmultiport IB", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "There is the routine mlx5_nl_portnum() added to get\nthe number of ports of multiport Infiniband device.\nIt is assumed the Uplink/VF representors are attached\non this ports.\n\nSigned-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>\n---\n drivers/net/mlx5/mlx5.h | 1 +\n drivers/net/mlx5/mlx5_nl.c | 45 +++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 46 insertions(+)", "diff": "diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h\nindex f5e29ca..528ae02 100644\n--- a/drivers/net/mlx5/mlx5.h\n+++ b/drivers/net/mlx5/mlx5.h\n@@ -470,6 +470,7 @@ int mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct ether_addr *mac,\n void mlx5_nl_mac_addr_flush(struct rte_eth_dev *dev);\n int mlx5_nl_promisc(struct rte_eth_dev *dev, int enable);\n int mlx5_nl_allmulti(struct rte_eth_dev *dev, int enable);\n+unsigned int mlx5_nl_portnum(int nl, const char *name);\n unsigned int mlx5_nl_ifindex(int nl, const char *name, uint32_t pindex);\n int mlx5_nl_switch_info(int nl, unsigned int ifindex,\n \t\t\tstruct mlx5_switch_info *info);\ndiff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c\nindex 6e9145a..81483b8 100644\n--- a/drivers/net/mlx5/mlx5_nl.c\n+++ b/drivers/net/mlx5/mlx5_nl.c\n@@ -826,6 +826,51 @@ struct mlx5_nl_ifindex_data {\n }\n \n /**\n+ * Get the number of physical ports of given IB device.\n+ *\n+ * @param nl\n+ * Netlink socket of the RDMA kind (NETLINK_RDMA).\n+ * @param[in] name\n+ * IB device name.\n+ *\n+ * @return\n+ * A valid (nonzero) number of ports on success, 0 otherwise\n+ * and rte_errno is set.\n+ */\n+unsigned int\n+mlx5_nl_portnum(int nl, const char *name)\n+{\n+\tuint32_t seq = random();\n+\tstruct mlx5_nl_ifindex_data data = {\n+\t\t.name = name,\n+\t\t.ibindex = 0,\n+\t\t.ifindex = 0,\n+\t\t.portnum = 0,\n+\t};\n+\tstruct nlmsghdr req = {\n+\t\t.nlmsg_len = NLMSG_LENGTH(0),\n+\t\t.nlmsg_type = RDMA_NL_GET_TYPE(RDMA_NL_NLDEV,\n+\t\t\t\t\t RDMA_NLDEV_CMD_GET),\n+\t\t.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_DUMP,\n+\t};\n+\tint ret;\n+\n+\tret = mlx5_nl_send(nl, &req, seq);\n+\tif (ret < 0)\n+\t\treturn 0;\n+\tret = mlx5_nl_recv(nl, seq, mlx5_nl_cmdget_cb, &data);\n+\tif (ret < 0)\n+\t\treturn 0;\n+\tif (!data.ibindex) {\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\t}\n+\tif (!data.portnum)\n+\t\trte_errno = EINVAL;\n+\treturn data.portnum;\n+}\n+\n+/**\n * Process switch information from Netlink message.\n *\n * @param nh\n", "prefixes": [ "04/14" ] }{ "id": 51447, "url": "