Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/43752/?format=api
http://patches.dpdk.org/api/patches/43752/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20180816184750.30843-2-bluca@debian.org/", "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": "<20180816184750.30843-2-bluca@debian.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20180816184750.30843-2-bluca@debian.org", "date": "2018-08-16T18:47:50", "name": "[2/2] virtio: fix PCI config err handling", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2516b5495e86a49bce9dde9c1cc4bb10f2b83cac", "submitter": { "id": 823, "url": "http://patches.dpdk.org/api/people/823/?format=api", "name": "Luca Boccassi", "email": "bluca@debian.org" }, "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/20180816184750.30843-2-bluca@debian.org/mbox/", "series": [ { "id": 1003, "url": "http://patches.dpdk.org/api/series/1003/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1003", "date": "2018-08-16T18:47:49", "name": "[1/2] bus/pci: harmonize and document rte_pci_read_config return value", "version": 1, "mbox": "http://patches.dpdk.org/series/1003/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/43752/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/43752/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 D917A4C94;\n\tThu, 16 Aug 2018 20:48:00 +0200 (CEST)", "from mail-wm0-f65.google.com (mail-wm0-f65.google.com\n\t[74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 0AB834C8E\n\tfor <dev@dpdk.org>; Thu, 16 Aug 2018 20:47:59 +0200 (CEST)", "by mail-wm0-f65.google.com with SMTP id l2-v6so16302452wme.1\n\tfor <dev@dpdk.org>; Thu, 16 Aug 2018 11:47:59 -0700 (PDT)", "from localhost ([2a01:4b00:f419:6f00:8361:8946:ba2b:d556])\n\tby smtp.gmail.com with ESMTPSA id\n\tc12-v6sm54021wrr.6.2018.08.16.11.47.58\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tThu, 16 Aug 2018 11:47:58 -0700 (PDT)" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=3jaYz322ohNBPkSebIMuyNg5T9pWuMC5tD0kch/fRi0=;\n\tb=DmJ5OXQ+iY9xijAMqOUCm3gq9VjekHBXHE0LtVp8Y/tfGOvjEPLdWpiGdak86RAo0M\n\ti0kYarFsiO3Bx0iGhe1X81FzGP5BHngUdu0w7TYwu9AYKSbF+th625Kzorn/Iug5XCPY\n\tM49ON4LblOEzcYVhGsQ7Abrvu63+wqh/GIGB8p+ZywEib3q/F+cq1+2XPoMA/pG6vxrP\n\ta+saWrocGklKucRO3cdgKprZQ+Uqve07H5dF+pqVYQKgU137Swv4sg3E6fFItQFThguh\n\t+MbfeCqGZzaMTCqC5D2bzm48Puwx1KFiHEgTuBMdE5sdf8Y1V2V/4qNhJNXP+6q92hcW\n\tcysA==", "X-Gm-Message-State": "AOUpUlHvwQBBisgl/f0abmgjYhuPoDrGi57qmVVF2Qwve0LDVa5Eh7Nn\n\tdhNSVylvM7vdPlDGrgJ13anH/vnW", "X-Google-Smtp-Source": "AA+uWPwNEsAqQ8CaA5wvbzCydNymTMU8vf1Ruts3Yoj/4/BirKr2wo3iR8JG3oztBLZdICttQ8MHGg==", "X-Received": "by 2002:a1c:ea9c:: with SMTP id\n\tg28-v6mr16989465wmi.65.1534445279317; \n\tThu, 16 Aug 2018 11:47:59 -0700 (PDT)", "From": "Luca Boccassi <bluca@debian.org>", "To": "dev@dpdk.org", "Cc": "maxime.coquelin@redhat.com, zhihong.wang@intel.com, tiwei.bie@intel.com, \n\tbruce.richardson@intel.com, Brian Russell <brussell@brocade.com>,\n\tLuca Boccassi <bluca@debian.org>", "Date": "Thu, 16 Aug 2018 19:47:50 +0100", "Message-Id": "<20180816184750.30843-2-bluca@debian.org>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20180816184750.30843-1-bluca@debian.org>", "References": "<20180814143035.19640-1-bluca@debian.org>\n\t<20180816184750.30843-1-bluca@debian.org>", "Subject": "[dpdk-dev] [PATCH 2/2] virtio: fix PCI config err handling", "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": "From: Brian Russell <brussell@brocade.com>\n\nIn virtio_read_caps and vtpci_msix_detect, rte_pci_read_config returns\nthe number of bytes read from PCI config or < 0 on error.\nIf less than the expected number of bytes are read then log the\nfailure and return rather than carrying on with garbage.\n\nFixes: 6ba1f63b5ab0 (\"virtio: support specification 1.0\")\n\nSigned-off-by: Brian Russell <brussell@brocade.com>\nSigned-off-by: Luca Boccassi <bluca@debian.org>\n---\nv2: handle additional rte_pci_read_config incomplete reads\n\n drivers/net/virtio/virtio_pci.c | 35 +++++++++++++++++++++------------\n 1 file changed, 22 insertions(+), 13 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c\nindex 6bd22e54a6..ff6f96f361 100644\n--- a/drivers/net/virtio/virtio_pci.c\n+++ b/drivers/net/virtio/virtio_pci.c\n@@ -560,6 +560,7 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)\n \tuint8_t pos;\n \tstruct virtio_pci_cap cap;\n \tint ret;\n+\tuint32_t multiplier;\n \n \tif (rte_pci_map_device(dev)) {\n \t\tPMD_INIT_LOG(DEBUG, \"failed to map pci device!\");\n@@ -567,16 +568,18 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)\n \t}\n \n \tret = rte_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST);\n-\tif (ret < 0) {\n-\t\tPMD_INIT_LOG(DEBUG, \"failed to read pci capability list\");\n+\tif (ret != 1) {\n+\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t \"failed to read pci capability list, ret %d\", ret);\n \t\treturn -1;\n \t}\n \n \twhile (pos) {\n \t\tret = rte_pci_read_config(dev, &cap, sizeof(cap), pos);\n-\t\tif (ret < 0) {\n-\t\t\tPMD_INIT_LOG(ERR,\n-\t\t\t\t\"failed to read pci cap at pos: %x\", pos);\n+\t\tif (ret != sizeof(cap)) {\n+\t\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t\t \"failed to read pci cap at pos: %x ret %d\",\n+\t\t\t\t pos, ret);\n \t\t\tbreak;\n \t\t}\n \n@@ -610,9 +613,13 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)\n \t\t\thw->common_cfg = get_cfg_addr(dev, &cap);\n \t\t\tbreak;\n \t\tcase VIRTIO_PCI_CAP_NOTIFY_CFG:\n-\t\t\trte_pci_read_config(dev, &hw->notify_off_multiplier,\n-\t\t\t\t\t4, pos + sizeof(cap));\n-\t\t\thw->notify_base = get_cfg_addr(dev, &cap);\n+\t\t\t/* Avoid half-reads into hw */\n+\t\t\tret = rte_pci_read_config(dev, &multiplier, 4,\n+\t\t\t\t\tpos + sizeof(cap));\n+\t\t\tif (ret == 4) {\n+\t\t\t\thw->notify_off_multiplier = multiplier;\n+\t\t\t\thw->notify_base = get_cfg_addr(dev, &cap);\n+\t\t\t}\n \t\t\tbreak;\n \t\tcase VIRTIO_PCI_CAP_DEVICE_CFG:\n \t\t\thw->dev_cfg = get_cfg_addr(dev, &cap);\n@@ -693,16 +700,18 @@ vtpci_msix_detect(struct rte_pci_device *dev)\n \tint ret;\n \n \tret = rte_pci_read_config(dev, &pos, 1, PCI_CAPABILITY_LIST);\n-\tif (ret < 0) {\n-\t\tPMD_INIT_LOG(DEBUG, \"failed to read pci capability list\");\n+\tif (ret != 1) {\n+\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t \"failed to read pci capability list, ret %d\", ret);\n \t\treturn VIRTIO_MSIX_NONE;\n \t}\n \n \twhile (pos) {\n \t\tret = rte_pci_read_config(dev, &cap, sizeof(cap), pos);\n-\t\tif (ret < 0) {\n-\t\t\tPMD_INIT_LOG(ERR,\n-\t\t\t\t\"failed to read pci cap at pos: %x\", pos);\n+\t\tif (ret != sizeof(cap)) {\n+\t\t\tPMD_INIT_LOG(DEBUG,\n+\t\t\t\t \"failed to read pci cap at pos: %x ret %d\",\n+\t\t\t\t pos, ret);\n \t\t\tbreak;\n \t\t}\n \n", "prefixes": [ "2/2" ] }{ "id": 43752, "url": "