Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/47575/?format=api
http://patches.dpdk.org/api/patches/47575/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181030152720.3728-1-qi.z.zhang@intel.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": "<20181030152720.3728-1-qi.z.zhang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181030152720.3728-1-qi.z.zhang@intel.com", "date": "2018-10-30T15:27:20", "name": "[v3] bus/pci: fix unexpected resource mapping override", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "1444e57cf67f094ccbe32a09ae4b5b32c594cf81", "submitter": { "id": 504, "url": "http://patches.dpdk.org/api/people/504/?format=api", "name": "Qi Zhang", "email": "qi.z.zhang@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181030152720.3728-1-qi.z.zhang@intel.com/mbox/", "series": [ { "id": 2162, "url": "http://patches.dpdk.org/api/series/2162/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2162", "date": "2018-10-30T15:27:20", "name": "[v3] bus/pci: fix unexpected resource mapping override", "version": 3, "mbox": "http://patches.dpdk.org/series/2162/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/47575/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/47575/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 715424CB3;\n\tTue, 30 Oct 2018 16:26:16 +0100 (CET)", "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n\tby dpdk.org (Postfix) with ESMTP id 6D0574CA0;\n\tTue, 30 Oct 2018 16:26:14 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t30 Oct 2018 08:26:13 -0700", "from dpdk51.sh.intel.com ([10.67.110.190])\n\tby fmsmga005.fm.intel.com with ESMTP; 30 Oct 2018 08:26:12 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.54,444,1534834800\"; d=\"scan'208\";a=\"275707920\"", "From": "Qi Zhang <qi.z.zhang@intel.com>", "To": "dev@dpdk.org", "Cc": "anatoly.burakov@intel.com, ferruh.yigit@intel.com, geoffrey.lv@gmail.com,\n\tajit.khaparde@broadcom.com, Qi Zhang <qi.z.zhang@intel.com>,\n\tstable@dpdk.org", "Date": "Tue, 30 Oct 2018 23:27:20 +0800", "Message-Id": "<20181030152720.3728-1-qi.z.zhang@intel.com>", "X-Mailer": "git-send-email 2.13.6", "In-Reply-To": "<20180903084005.29706-1-qi.z.zhang@intel.com>", "References": "<20180903084005.29706-1-qi.z.zhang@intel.com>", "Subject": "[dpdk-dev] [PATCH v3] bus/pci: fix unexpected resource mapping\n\toverride", "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": "When scanning an already plugged device, the virtual address\nof mapped PCI resource in rte_pci_device will be overridden\nwith 0, that may cause driver does not work correctly.\nThe fix is not to update any rte_pci_device's field if the being\nscanned device's driver is already probed.\n\nBugzilla ID: 85\nFixes: c752998b5e2e (\"pci: introduce library and driver\")\nCc: stable@dpdk.org\n\nReported-by: Lv Geoffrey <geoffrey.lv@gmail.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/bus/pci/linux/pci.c | 35 ++++++++++++++++++++++++++++++-----\n 1 file changed, 30 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c\nindex 145cb1091..35744466d 100644\n--- a/drivers/bus/pci/linux/pci.c\n+++ b/drivers/bus/pci/linux/pci.c\n@@ -349,11 +349,36 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)\n \t\t\tif (ret < 0) {\n \t\t\t\trte_pci_insert_device(dev2, dev);\n \t\t\t} else { /* already registered */\n-\t\t\t\tdev2->kdrv = dev->kdrv;\n-\t\t\t\tdev2->max_vfs = dev->max_vfs;\n-\t\t\t\tpci_name_set(dev2);\n-\t\t\t\tmemmove(dev2->mem_resource, dev->mem_resource,\n-\t\t\t\t\tsizeof(dev->mem_resource));\n+\t\t\t\tif (!rte_dev_is_probed(&dev2->device)) {\n+\t\t\t\t\tdev2->kdrv = dev->kdrv;\n+\t\t\t\t\tdev2->max_vfs = dev->max_vfs;\n+\t\t\t\t\tpci_name_set(dev2);\n+\t\t\t\t\tmemmove(dev2->mem_resource,\n+\t\t\t\t\t\tdev->mem_resource,\n+\t\t\t\t\t\tsizeof(dev->mem_resource));\n+\t\t\t\t} else {\n+\t\t\t\t\t/**\n+\t\t\t\t\t * If device is plugged and driver is\n+\t\t\t\t\t * probed already, (This happens when\n+\t\t\t\t\t * we call rte_dev_probe which will\n+\t\t\t\t\t * scan all device on the bus) we don't\n+\t\t\t\t\t * need to do anything here unless...\n+\t\t\t\t\t **/\n+\t\t\t\t\tif (dev2->kdrv != dev->kdrv ||\n+\t\t\t\t\t\tdev2->max_vfs != dev->max_vfs)\n+\t\t\t\t\t\t/*\n+\t\t\t\t\t\t * This should not happens.\n+\t\t\t\t\t\t * But it is still possible if\n+\t\t\t\t\t\t * we unbind a device from\n+\t\t\t\t\t\t * vfio or uio before hotplug\n+\t\t\t\t\t\t * remove and rebind it with\n+\t\t\t\t\t\t * a different configure.\n+\t\t\t\t\t\t * So we just print out the\n+\t\t\t\t\t\t * error as an alarm.\n+\t\t\t\t\t\t */\n+\t\t\t\t\t\tRTE_LOG(ERR, EAL, \"Unexpected device scan at %s!\\n\",\n+\t\t\t\t\t\t\tfilename);\n+\t\t\t\t}\n \t\t\t\tfree(dev);\n \t\t\t}\n \t\t\treturn 0;\n", "prefixes": [ "v3" ] }{ "id": 47575, "url": "