get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6805,
    "url": "https://patches.dpdk.org/api/patches/6805/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1440690041-32391-6-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": "<1440690041-32391-6-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1440690041-32391-6-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-08-27T15:40:40",
    "name": "[dpdk-dev,RFC,5/6] bonding: remove pci device driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "436afca969624060c5318a153fb3db8d86c9f8b3",
    "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/1440690041-32391-6-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6805/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6805/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 48A7B8DAB;\n\tThu, 27 Aug 2015 17:40:57 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id B45E86A80\n\tfor <dev@dpdk.org>; Thu, 27 Aug 2015 17:40:51 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga102.fm.intel.com with ESMTP; 27 Aug 2015 08:40:51 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga001.jf.intel.com with ESMTP; 27 Aug 2015 08:40:50 -0700",
            "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\tt7RFen9H004315; Thu, 27 Aug 2015 16:40:49 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id t7RFen1R032474;\n\tThu, 27 Aug 2015 16:40:49 +0100",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id t7RFentU032470;\n\tThu, 27 Aug 2015 16:40:49 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.17,422,1437462000\"; d=\"scan'208\";a=\"756580989\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 27 Aug 2015 16:40:40 +0100",
        "Message-Id": "<1440690041-32391-6-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1440690041-32391-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<RFC PATCH>\n\t<1440690041-32391-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [RFC PATCH 5/6] bonding: remove pci device driver",
        "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": "remove pci_dev, pci_drv, rte_bond_pmd and pci_id_table.\nhandle numa_node for vdevs\nhandle RTE_ETH_DEV_INTR_LSC for vdevs\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\n---\n drivers/net/bonding/rte_eth_bond_alb.c |  2 +-\n drivers/net/bonding/rte_eth_bond_api.c | 51 ++++++++--------------------------\n drivers/net/bonding/rte_eth_bond_pmd.c | 22 ++++++++++-----\n lib/librte_ether/rte_ethdev.h          |  2 ++\n 4 files changed, 30 insertions(+), 47 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c\nindex 6df318e..3157543 100644\n--- a/drivers/net/bonding/rte_eth_bond_alb.c\n+++ b/drivers/net/bonding/rte_eth_bond_alb.c\n@@ -65,7 +65,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)\n \n \tuint16_t data_size;\n \tchar mem_name[RTE_ETH_NAME_MAX_LEN];\n-\tint socket_id = bond_dev->pci_dev->numa_node;\n+\tint socket_id = bond_dev->data->numa_node;\n \n \t/* Fill hash table with initial values */\n \tmemset(hash_table, 0, sizeof(struct client_data) * ALB_HASH_TABLE_SIZE);\ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex 0681d1a..b866bf3 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -48,11 +48,14 @@ int\n valid_bonded_ethdev(const struct rte_eth_dev *eth_dev)\n {\n \t/* Check valid pointer */\n-\tif (eth_dev->driver->pci_drv.name == NULL)\n+\tif (!eth_dev)\n \t\treturn -1;\n \n-\t/* return 0 if driver name matches */\n-\treturn eth_dev->driver->pci_drv.name != pmd_bond_driver_name;\n+\t/* return 0 if bonded device */\n+\tif (eth_dev->dev_flags & RTE_ETH_DEV_BONDED)\n+\t\treturn 0;\n+\telse\n+\t\treturn 1;\n }\n \n int\n@@ -72,7 +75,7 @@ valid_slave_port_id(uint8_t port_id)\n \t\treturn -1;\n \n \t/* Verify that port_id refers to a non bonded port */\n-\tif (!valid_bonded_ethdev(&rte_eth_devices[port_id]))\n+\tif (valid_bonded_ethdev(&rte_eth_devices[port_id]) == 0)\n \t\treturn -1;\n \n \treturn 0;\n@@ -163,30 +166,11 @@ number_of_sockets(void)\n \treturn ++sockets;\n }\n \n-const char pmd_bond_driver_name[] = \"rte_bond_pmd\";\n-\n-static struct rte_pci_id pci_id_table = {\n-\t.device_id = PCI_ANY_ID,\n-\t.subsystem_device_id = PCI_ANY_ID,\n-\t.vendor_id = PCI_ANY_ID,\n-\t.subsystem_vendor_id = PCI_ANY_ID,\n-};\n-\n-static struct eth_driver rte_bond_pmd = {\n-\t.pci_drv = {\n-\t\t.name = pmd_bond_driver_name,\n-\t\t.drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_DETACHABLE,\n-\t\t.id_table = &pci_id_table,\n-\t},\n-};\n-\n int\n rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n {\n-\tstruct rte_pci_device *pci_dev = NULL;\n \tstruct bond_dev_private *internals = NULL;\n \tstruct rte_eth_dev *eth_dev = NULL;\n-\tstruct rte_pci_driver *pci_drv = NULL;\n \n \t/* now do all data allocation - for eth_dev structure, dummy pci driver\n \t * and internal (private) data\n@@ -203,14 +187,6 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \t\tgoto err;\n \t}\n \n-\tpci_dev = rte_zmalloc_socket(name, sizeof(*pci_dev), 0, socket_id);\n-\tif (pci_dev == NULL) {\n-\t\tRTE_BOND_LOG(ERR, \"Unable to malloc pci dev on socket\");\n-\t\tgoto err;\n-\t}\n-\n-\tpci_drv = &rte_bond_pmd.pci_drv;\n-\n \tinternals = rte_zmalloc_socket(name, sizeof(*internals), 0, socket_id);\n \tif (internals == NULL) {\n \t\tRTE_BOND_LOG(ERR, \"Unable to malloc internals on socket\");\n@@ -224,14 +200,10 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \t\tgoto err;\n \t}\n \n-\tpci_dev->numa_node = socket_id;\n-\tpci_drv->name = pmd_bond_driver_name;\n-\tpci_dev->driver = pci_drv;\n-\n-\teth_dev->driver = &rte_bond_pmd;\n \teth_dev->data->dev_private = internals;\n \teth_dev->data->nb_rx_queues = (uint16_t)1;\n \teth_dev->data->nb_tx_queues = (uint16_t)1;\n+\teth_dev->data->numa_node =  socket_id;\n \n \tTAILQ_INIT(&(eth_dev->link_intr_cbs));\n \n@@ -250,7 +222,10 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \teth_dev->data->all_multicast = 0;\n \n \teth_dev->dev_ops = &default_dev_ops;\n-\teth_dev->pci_dev = pci_dev;\n+\teth_dev->pci_dev = NULL;\n+\teth_dev->driver = NULL;\n+\teth_dev->dev_flags = RTE_ETH_DEV_INTR_LSC |\n+\t\tRTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_BONDED;\n \n \trte_spinlock_init(&internals->lock);\n \n@@ -287,7 +262,6 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \treturn eth_dev->data->port_id;\n \n err:\n-\trte_free(pci_dev);\n \trte_free(internals);\n \tif (eth_dev != NULL) {\n \t\trte_free(eth_dev->data->mac_addrs);\n@@ -319,7 +293,6 @@ rte_eth_bond_free(const char *name)\n \teth_dev->rx_pkt_burst = NULL;\n \teth_dev->tx_pkt_burst = NULL;\n \n-\trte_free(eth_dev->pci_dev);\n \trte_free(eth_dev->data->dev_private);\n \trte_free(eth_dev->data->mac_addrs);\n \ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 5cc6372..387d370 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1307,8 +1307,12 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,\n \trte_eth_dev_stop(slave_eth_dev->data->port_id);\n \n \t/* Enable interrupts on slave device if supported */\n-\tif (slave_eth_dev->driver->pci_drv.drv_flags & RTE_PCI_DRV_INTR_LSC)\n-\t\tslave_eth_dev->data->dev_conf.intr_conf.lsc = 1;\n+\tif (slave_eth_dev->dev_type == RTE_ETH_DEV_PCI) {\n+\t\tif (slave_eth_dev->driver->pci_drv.drv_flags & RTE_PCI_DRV_INTR_LSC)\n+\t\t\tslave_eth_dev->data->dev_conf.intr_conf.lsc = 1;\n+\t} else if (slave_eth_dev->dev_flags & RTE_ETH_DEV_INTR_LSC)\n+\t\t\tslave_eth_dev->data->dev_conf.intr_conf.lsc = 1;\n+\n \n \t/* Configure device */\n \terrval = rte_eth_dev_configure(slave_eth_dev->data->port_id,\n@@ -1362,8 +1366,12 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,\n \t}\n \n \t/* If lsc interrupt is set, check initial slave's link status */\n-\tif (slave_eth_dev->driver->pci_drv.drv_flags & RTE_PCI_DRV_INTR_LSC)\n-\t\tbond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,\n+\tif (slave_eth_dev->dev_type == RTE_ETH_DEV_PCI) {\n+\t\tif (slave_eth_dev->driver->pci_drv.drv_flags & RTE_PCI_DRV_INTR_LSC)\n+\t\t\tbond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,\n+\t\t\t\tRTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);\n+\t} else if (slave_eth_dev->dev_flags & RTE_ETH_DEV_INTR_LSC)\n+\t\t\tbond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id,\n \t\t\t\tRTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);\n \n \treturn 0;\n@@ -1592,7 +1600,7 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n \tdev_info->max_tx_queues = (uint16_t)512;\n \n \tdev_info->min_rx_bufsize = 0;\n-\tdev_info->pci_dev = dev->pci_dev;\n+\tdev_info->pci_dev = NULL;\n \n \tdev_info->rx_offload_capa = internals->rx_offload_capa;\n \tdev_info->tx_offload_capa = internals->tx_offload_capa;\n@@ -1605,7 +1613,7 @@ bond_ethdev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,\n {\n \tstruct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)\n \t\t\trte_zmalloc_socket(NULL, sizeof(struct bond_rx_queue),\n-\t\t\t\t\t0, dev->pci_dev->numa_node);\n+\t\t\t\t\t0, dev->data->numa_node);\n \tif (bd_rx_q == NULL)\n \t\treturn -1;\n \n@@ -1629,7 +1637,7 @@ bond_ethdev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,\n {\n \tstruct bond_tx_queue *bd_tx_q  = (struct bond_tx_queue *)\n \t\t\trte_zmalloc_socket(NULL, sizeof(struct bond_tx_queue),\n-\t\t\t\t\t0, dev->pci_dev->numa_node);\n+\t\t\t\t\t0, dev->data->numa_node);\n \n \tif (bd_tx_q == NULL)\n \t\treturn -1;\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex a0a648f..6804bd3 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1593,6 +1593,8 @@ struct rte_eth_dev {\n #define RTE_ETH_DEV_INTR_LSC\t0x0008\n /** Device  supports detaching capability */\n #define RTE_ETH_DEV_DETACHABLE\t0x0010\n+/** Device  is a bonded device */\n+#define RTE_ETH_DEV_BONDED\t0x0020\n \n struct rte_eth_dev_sriov {\n \tuint8_t active;               /**< SRIOV is active with 16, 32 or 64 pools */\n",
    "prefixes": [
        "dpdk-dev",
        "RFC",
        "5/6"
    ]
}