Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/73521/?format=api
https://patches.dpdk.org/api/patches/73521/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200708092435.9776-1-alvinx.zhang@intel.com/", "project": { "id": 1, "url": "https://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": "<20200708092435.9776-1-alvinx.zhang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200708092435.9776-1-alvinx.zhang@intel.com", "date": "2020-07-08T09:24:35", "name": "bus/pci: fix mmap PCI resource", "commit_ref": null, "pull_url": null, "state": "rejected", "archived": true, "hash": "a31cd9625ceacb6bf7708e3ed126b3ef3e4732e0", "submitter": { "id": 1398, "url": "https://patches.dpdk.org/api/people/1398/?format=api", "name": "Alvin Zhang", "email": "alvinx.zhang@intel.com" }, "delegate": { "id": 24651, "url": "https://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200708092435.9776-1-alvinx.zhang@intel.com/mbox/", "series": [ { "id": 10886, "url": "https://patches.dpdk.org/api/series/10886/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10886", "date": "2020-07-08T09:24:35", "name": "bus/pci: fix mmap PCI resource", "version": 1, "mbox": "https://patches.dpdk.org/series/10886/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/73521/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/73521/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 EA617A00BE;\n\tWed, 8 Jul 2020 11:26:45 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BC6ED1DAC5;\n\tWed, 8 Jul 2020 11:26:45 +0200 (CEST)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id 805A41D546\n for <dev@dpdk.org>; Wed, 8 Jul 2020 11:26:44 +0200 (CEST)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 08 Jul 2020 02:26:43 -0700", "from shwdenpg235.ccr.corp.intel.com ([10.240.182.60])\n by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2020 02:26:42 -0700" ], "IronPort-SDR": [ "\n Ruliu5xVCq4Auht3RPKElQii3tyaiq+5DOojogx3kHKpZWDvAZtEAWZB4Vt690wAqx16YpZCf6\n IFOZraTVF4Pw==", "\n cjOWeTjAwhQ9aOG9SucWzf0lI3HMSqDABy3+KXAruOFi56wWd7IhlNiruXFS5UyHP0SYsIlMBa\n QP/AlWI6effA==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9675\"; a=\"145867386\"", "E=Sophos;i=\"5.75,327,1589266800\"; d=\"scan'208\";a=\"145867386\"", "E=Sophos;i=\"5.75,327,1589266800\"; d=\"scan'208\";a=\"315813148\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "alvinx.zhang@intel.com", "To": "dev@dpdk.org", "Cc": "beilei.xing@intel.com,\n\tjia.guo@intel.com", "Date": "Wed, 8 Jul 2020 17:24:35 +0800", "Message-Id": "<20200708092435.9776-1-alvinx.zhang@intel.com>", "X-Mailer": "git-send-email 2.21.0.windows.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH] bus/pci: fix mmap PCI resource", "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": "From: Alvin Zhang <alvinx.zhang@intel.com>\n\nWhen mapping a PCI BAR containing an MSI-X table, some devices do not\nneed to actually map this BAR or only need to map part of them, which\nmay cause the mapping to fail. Now some checks are added and a non-NULL\ninitial value is set to the variable to avoid this situation.\n\nFixes: 2fd3567e5425 (\"pci: use OS generic memory mapping functions\")\nCc: talshn@mellanox.com\n\nSigned-off-by: Alvin Zhang <alvinx.zhang@intel.com>\n---\n drivers/bus/pci/linux/pci_vfio.c | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c\nindex fdeb9a8..9143bfc 100644\n--- a/drivers/bus/pci/linux/pci_vfio.c\n+++ b/drivers/bus/pci/linux/pci_vfio.c\n@@ -547,6 +547,14 @@\n \t\t\tbar_index,\n \t\t\tmemreg[0].offset, memreg[0].size,\n \t\t\tmemreg[1].offset, memreg[1].size);\n+\n+\t\tif (memreg[0].size == 0 && memreg[1].size == 0) {\n+\t\t\t/* No need to map this BAR */\n+\t\t\tRTE_LOG(DEBUG, EAL, \"Skipping BAR%d\\n\", bar_index);\n+\t\t\tbar->size = 0;\n+\t\t\tbar->addr = 0;\n+\t\t\treturn 0;\n+\t\t}\n \t} else {\n \t\tmemreg[0].offset = bar->offset;\n \t\tmemreg[0].size = bar->size;\n@@ -556,7 +564,9 @@\n \tbar_addr = mmap(bar->addr, bar->size, 0, MAP_PRIVATE |\n \t\t\tMAP_ANONYMOUS | additional_flags, -1, 0);\n \tif (bar_addr != MAP_FAILED) {\n-\t\tvoid *map_addr = NULL;\n+\t\t/* Set non NULL initial value for in case of no PCI mapping */\n+\t\tvoid *map_addr = bar_addr;\n+\n \t\tif (memreg[0].size) {\n \t\t\t/* actual map of first part */\n \t\t\tmap_addr = pci_map_resource(bar_addr, vfio_dev_fd,\n", "prefixes": [] }{ "id": 73521, "url": "