Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/126560/?format=api
http://patches.dpdk.org/api/patches/126560/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1682561915-7204-1-git-send-email-longli@linuxonhyperv.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": "<1682561915-7204-1-git-send-email-longli@linuxonhyperv.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1682561915-7204-1-git-send-email-longli@linuxonhyperv.com", "date": "2023-04-27T02:18:35", "name": "net/mana: return probe failure if there is no device found", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "22486c50c0fce8f1e8de91aef6c370aec9381294", "submitter": { "id": 1784, "url": "http://patches.dpdk.org/api/people/1784/?format=api", "name": "Long Li", "email": "longli@linuxonhyperv.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1682561915-7204-1-git-send-email-longli@linuxonhyperv.com/mbox/", "series": [ { "id": 27880, "url": "http://patches.dpdk.org/api/series/27880/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27880", "date": "2023-04-27T02:18:35", "name": "net/mana: return probe failure if there is no device found", "version": 1, "mbox": "http://patches.dpdk.org/series/27880/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/126560/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/126560/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 53BF8429F1;\n\tThu, 27 Apr 2023 04:18:47 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B24CA42D35;\n\tThu, 27 Apr 2023 04:18:46 +0200 (CEST)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 303D240E0F;\n Thu, 27 Apr 2023 04:18:44 +0200 (CEST)", "by linux.microsoft.com (Postfix, from userid 1004)\n id 385E121C33CF; Wed, 26 Apr 2023 19:18:43 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 385E121C33CF", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com;\n s=default; t=1682561923;\n bh=kGnD60hbO0ifi1hapzzVp5R9EDU5S229vK+P4hYkhFo=;\n h=From:To:Cc:Subject:Date:From;\n b=NHX6tQ+3lJ8+AnR7UMi/dJGjzbfboiWTBMExvk8QakEtG2Kuti6GeeQyrY4hAGHKT\n Qw8enqMb99VAJZNRvILUmxVsHHqKu6wKqgreSEKXMunt1F/qGcqu8PN/ut6QmrTXlo\n bhcPXOGINqWpJ33feHF3NURoPfDrzubn67L9jERE=", "From": "longli@linuxonhyperv.com", "To": "Ferruh Yigit <ferruh.yigit@amd.com>", "Cc": "dev@dpdk.org, Ajay Sharma <sharmaajay@microsoft.com>,\n Long Li <longli@microsoft.com>, stable@dpdk.org", "Subject": "[PATCH] net/mana: return probe failure if there is no device found", "Date": "Wed, 26 Apr 2023 19:18:35 -0700", "Message-Id": "<1682561915-7204-1-git-send-email-longli@linuxonhyperv.com>", "X-Mailer": "git-send-email 1.8.3.1", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "From: Long Li <longli@microsoft.com>\n\nWhen there is no device found on this PCI device, return probe failure and\nrelease allocated resources for this PCI device.\n\nFixes: 517ed6e2d5 (\"net/mana: add basic driver with build environment\")\nCc: stable@dpdk.org\nSigned-off-by: Long Li <longli@microsoft.com>\n---\n drivers/net/mana/mana.c | 39 ++++++++++++++++++++++++++++-----------\n 1 file changed, 28 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c\nindex 2463f34c1e..90d083aae7 100644\n--- a/drivers/net/mana/mana.c\n+++ b/drivers/net/mana/mana.c\n@@ -1343,6 +1343,7 @@ mana_probe_port(struct ibv_device *ibdev, struct ibv_device_attr_ex *dev_attr,\n /*\n * Goes through the IB device list to look for the IB port matching the\n * mac_addr. If found, create a rte_eth_dev for it.\n+ * Return value: number of successfully probed deivces\n */\n static int\n mana_pci_probe_mac(struct rte_pci_device *pci_dev,\n@@ -1352,8 +1353,9 @@ mana_pci_probe_mac(struct rte_pci_device *pci_dev,\n \tint ibv_idx;\n \tstruct ibv_context *ctx;\n \tint num_devices;\n-\tint ret = 0;\n+\tint ret;\n \tuint8_t port;\n+\tint count = 0;\n \n \tibv_list = ibv_get_device_list(&num_devices);\n \tfor (ibv_idx = 0; ibv_idx < num_devices; ibv_idx++) {\n@@ -1383,6 +1385,12 @@ mana_pci_probe_mac(struct rte_pci_device *pci_dev,\n \t\tret = ibv_query_device_ex(ctx, NULL, &dev_attr);\n \t\tibv_close_device(ctx);\n \n+\t\tif (ret) {\n+\t\t\tDRV_LOG(ERR, \"Failed to query IB device %s\",\n+\t\t\t\tibdev->name);\n+\t\t\tcontinue;\n+\t\t}\n+\n \t\tfor (port = 1; port <= dev_attr.orig_attr.phys_port_cnt;\n \t\t port++) {\n \t\t\tstruct rte_ether_addr addr;\n@@ -1394,15 +1402,17 @@ mana_pci_probe_mac(struct rte_pci_device *pci_dev,\n \t\t\t\tcontinue;\n \n \t\t\tret = mana_probe_port(ibdev, &dev_attr, port, pci_dev, &addr);\n-\t\t\tif (ret)\n+\t\t\tif (ret) {\n \t\t\t\tDRV_LOG(ERR, \"Probe on IB port %u failed %d\", port, ret);\n-\t\t\telse\n+\t\t\t} else {\n+\t\t\t\tcount++;\n \t\t\t\tDRV_LOG(INFO, \"Successfully probed on IB port %u\", port);\n+\t\t\t}\n \t\t}\n \t}\n \n \tibv_free_device_list(ibv_list);\n-\treturn ret;\n+\treturn count;\n }\n \n /*\n@@ -1416,6 +1426,7 @@ mana_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \tstruct mana_conf conf = {0};\n \tunsigned int i;\n \tint ret;\n+\tint count = 0;\n \n \tif (args && args->drv_str) {\n \t\tret = mana_parse_args(args, &conf);\n@@ -1433,16 +1444,21 @@ mana_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t}\n \n \t/* If there are no driver parameters, probe on all ports */\n-\tif (!conf.index)\n-\t\treturn mana_pci_probe_mac(pci_dev, NULL);\n+\tif (conf.index) {\n+\t\tfor (i = 0; i < conf.index; i++)\n+\t\t\tcount += mana_pci_probe_mac(pci_dev,\n+\t\t\t\t\t\t &conf.mac_array[i]);\n+\t} else {\n+\t\tcount = mana_pci_probe_mac(pci_dev, NULL);\n+\t}\n \n-\tfor (i = 0; i < conf.index; i++) {\n-\t\tret = mana_pci_probe_mac(pci_dev, &conf.mac_array[i]);\n-\t\tif (ret)\n-\t\t\treturn ret;\n+\tif (!count) {\n+\t\trte_memzone_free(mana_shared_mz);\n+\t\tmana_shared_mz = NULL;\n+\t\tret = -ENODEV;\n \t}\n \n-\treturn 0;\n+\treturn ret;\n }\n \n static int\n@@ -1475,6 +1491,7 @@ mana_pci_remove(struct rte_pci_device *pci_dev)\n \t\tif (!mana_shared_data->primary_cnt) {\n \t\t\tDRV_LOG(DEBUG, \"free shared memezone data\");\n \t\t\trte_memzone_free(mana_shared_mz);\n+\t\t\tmana_shared_mz = NULL;\n \t\t}\n \n \t\trte_spinlock_unlock(&mana_shared_data_lock);\n", "prefixes": [] }{ "id": 126560, "url": "