get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/8571/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 8571,
    "url": "https://patches.dpdk.org/api/patches/8571/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446555725-19540-2-git-send-email-bernard.iremonger@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": "<1446555725-19540-2-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446555725-19540-2-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-11-03T13:01:55",
    "name": "[dpdk-dev,v8,01/11] librte_ether: add fields from rte_pci_driver to rte_eth_dev_data",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0ec1dadb41588fa113f2d6bb6f1cc40dfec411b9",
    "submitter": {
        "id": 91,
        "url": "https://patches.dpdk.org/api/people/91/?format=api",
        "name": "Iremonger, Bernard",
        "email": "bernard.iremonger@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446555725-19540-2-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8571/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8571/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id EEDE68E7E;\n\tTue,  3 Nov 2015 14:02:12 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id E09965A32\n\tfor <dev@dpdk.org>; Tue,  3 Nov 2015 14:02:11 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga102.fm.intel.com with ESMTP; 03 Nov 2015 05:02:10 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga002.jf.intel.com with ESMTP; 03 Nov 2015 05:02:10 -0800",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ttA3D29ig011904; Tue, 3 Nov 2015 13:02:09 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA3D29n4019596;\n\tTue, 3 Nov 2015 13:02:09 GMT",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id tA3D29Tf019591;\n\tTue, 3 Nov 2015 13:02:09 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,238,1444719600\"; d=\"scan'208\";a=\"841480971\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  3 Nov 2015 13:01:55 +0000",
        "Message-Id": "<1446555725-19540-2-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446555725-19540-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<PATCH v8>\n\t<1446555725-19540-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 01/11] librte_ether: add fields from\n\trte_pci_driver to rte_eth_dev_data",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The driver fields have been added the rte_eth_dev_data so that it is no\nlonger necessary access this data through the pci_dev pointer.\n\nThe following fields have been added to rte_eth_dev_data:\n\ndev_flags, and macros for dev_flags.\nkdrv\nnuma_node\ndrv_name\n\nadd function rte_eth_copy_pci_info\nremove branches on pci_dev\n\nlibrte_eal: add RTE_KDRV_NONE for vdevs\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n lib/librte_eal/common/include/rte_pci.h |  3 ++-\n lib/librte_ether/rte_ethdev.c           | 24 ++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h           | 27 +++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map  |  1 +\n 4 files changed, 54 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h\nindex 83e3c28..334c12e 100644\n--- a/lib/librte_eal/common/include/rte_pci.h\n+++ b/lib/librte_eal/common/include/rte_pci.h\n@@ -1,7 +1,7 @@\n /*-\n  *   BSD LICENSE\n  *\n- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.\n+ *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.\n  *   All rights reserved.\n  *\n  *   Redistribution and use in source and binary forms, with or without\n@@ -149,6 +149,7 @@ enum rte_kernel_driver {\n \tRTE_KDRV_VFIO,\n \tRTE_KDRV_UIO_GENERIC,\n \tRTE_KDRV_NIC_UIO,\n+\tRTE_KDRV_NONE,\n };\n \n /**\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 39f65bf..04eff73 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -3229,3 +3229,27 @@ rte_eth_dev_get_dcb_info(uint8_t port_id,\n \tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_dcb_info, -ENOTSUP);\n \treturn (*dev->dev_ops->get_dcb_info)(dev, dcb_info);\n }\n+\n+void\n+rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev)\n+{\n+\tif ((eth_dev == NULL) || (pci_dev == NULL)) {\n+\t\tPMD_DEBUG_TRACE(\"NULL pointer eth_dev=%p pci_dev=%p\\n\",\n+\t\t\t\teth_dev, pci_dev);\n+\t}\n+\n+\teth_dev->data->dev_flags = 0;\n+\n+\tif (pci_dev->driver->drv_flags & RTE_PCI_DRV_NEED_MAPPING)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_DRV_NEED_MAPPING;\n+\tif (pci_dev->driver->drv_flags &  RTE_PCI_DRV_FORCE_UNBIND)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_DRV_FORCE_UNBIND;\n+\tif (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;\n+\tif (pci_dev->driver->drv_flags &  RTE_PCI_DRV_DETACHABLE)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;\n+\n+\teth_dev->data->kdrv = pci_dev->kdrv;\n+\teth_dev->data->numa_node = pci_dev->numa_node;\n+\teth_dev->data->drv_name = pci_dev->driver->name;\n+}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex c835a2f..2e5b9b8 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1551,8 +1551,21 @@ struct rte_eth_dev_data {\n \t\tall_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */\n \t\tdev_started : 1,   /**< Device state: STARTED(1) / STOPPED(0). */\n \t\tlro         : 1;   /**< RX LRO is ON(1) / OFF(0) */\n+\tuint32_t dev_flags; /**< Flags controlling handling of device. */\n+\tenum rte_kernel_driver kdrv;    /**< Kernel driver passthrough */\n+\tint numa_node;  /**< NUMA node connection */\n+\tconst char *drv_name;   /**< Driver name */\n };\n \n+/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */\n+#define RTE_ETH_DEV_DRV_NEED_MAPPING 0x0001\n+/** Device needs to be unbound even if no module is provided */\n+#define RTE_ETH_DEV_DRV_FORCE_UNBIND 0x0002\n+/** Device supports link state interrupt */\n+#define RTE_ETH_DEV_INTR_LSC 0x0003\n+/** Device  supports detaching capability */\n+#define RTE_ETH_DEV_DETACHABLE 0x0004\n+\n /**\n  * @internal\n  * The pool of *rte_eth_dev* structures. The size of the pool\n@@ -3733,6 +3746,20 @@ extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,\n extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,\n \t\t\t\t\t      struct timespec *timestamp);\n \n+/**\n+ * Copy pci device info to the Ethernet device data.\n+ *\n+ * @param eth_dev\n+ * The *eth_dev* pointer is the address of the *rte_eth_dev* structure.\n+ * @param pci_dev\n+ * The *pci_dev* pointer is the address of the *rte_pci_device* structure.\n+ *\n+ * @return\n+ *   - 0 on success, negative on error\n+ */\n+extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);\n+\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex 7b04e95..08c97f4 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -134,5 +134,6 @@ DPDK_2.2 {\n \trte_eth_dev_get_dcb_info;\n \trte_eth_rx_queue_info_get;\n \trte_eth_tx_queue_info_get;\n+\trte_eth_copy_pci_info;\n \n } DPDK_2.1;\n",
    "prefixes": [
        "dpdk-dev",
        "v8",
        "01/11"
    ]
}