get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8581,
    "url": "https://patches.dpdk.org/api/patches/8581/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446555725-19540-12-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-12-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446555725-19540-12-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-11-03T13:02:05",
    "name": "[dpdk-dev,v8,11/11] bonding: remove pci device",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "0c1dce18ce13e3010808e8b9d14052bf45e59c67",
    "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-12-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8581/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8581/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 E1BD991CB;\n\tTue,  3 Nov 2015 14:02:51 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 3792C5A32\n\tfor <dev@dpdk.org>; Tue,  3 Nov 2015 14:02:49 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 03 Nov 2015 05:02:21 -0800",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 03 Nov 2015 05:02:19 -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\ttA3D2Jx9011948; Tue, 3 Nov 2015 13:02:19 GMT",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id tA3D2JXd019680;\n\tTue, 3 Nov 2015 13:02:19 GMT",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id tA3D2JNf019676;\n\tTue, 3 Nov 2015 13:02:19 GMT"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,238,1444719600\"; d=\"scan'208\";a=\"593169028\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  3 Nov 2015 13:02:05 +0000",
        "Message-Id": "<1446555725-19540-12-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 11/11] bonding: remove pci device",
        "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\nrename the function valid_bonded_device to check_for_bonded_device\nremove branches on pci_dev\n\nSigned-off-by: Bernard Iremonger <bernard.iremonger@intel.com>\nAcked-by: Tomasz Kulasek <tomaszx.kulasek@intel.com>\n---\n drivers/net/bonding/rte_eth_bond_8023ad.c  |  4 +--\n drivers/net/bonding/rte_eth_bond_alb.c     |  2 +-\n drivers/net/bonding/rte_eth_bond_api.c     | 46 ++++--------------------------\n drivers/net/bonding/rte_eth_bond_pmd.c     | 18 ++++++------\n drivers/net/bonding/rte_eth_bond_private.h |  2 +-\n 5 files changed, 19 insertions(+), 53 deletions(-)",
    "diff": "diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c\nindex c0f0b99..ee2964a 100644\n--- a/drivers/net/bonding/rte_eth_bond_8023ad.c\n+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c\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@@ -879,7 +879,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, uint8_t slave_id)\n \n \tRTE_VERIFY(port->rx_ring == NULL);\n \tRTE_VERIFY(port->tx_ring == NULL);\n-\tsocket_id = rte_eth_devices[slave_id].pci_dev->numa_node;\n+\tsocket_id = rte_eth_devices[slave_id].data->numa_node;\n \n \telement_size = sizeof(struct slow_protocol_frame) + sizeof(struct rte_mbuf)\n \t\t\t\t+ RTE_PKTMBUF_HEADROOM;\ndiff --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 34adbde..8a000c8 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -47,14 +47,14 @@\n const char pmd_bond_driver_name[] = \"rte_bond_pmd\";\n \n int\n-valid_bonded_ethdev(const struct rte_eth_dev *eth_dev)\n+check_for_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->data->drv_name == NULL)\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+\treturn eth_dev->data->drv_name != pmd_bond_driver_name;\n }\n \n int\n@@ -63,7 +63,7 @@ valid_bonded_port_id(uint8_t port_id)\n \tif (!rte_eth_dev_is_valid_port(port_id))\n \t\treturn -1;\n \n-\treturn valid_bonded_ethdev(&rte_eth_devices[port_id]);\n+\treturn check_for_bonded_ethdev(&rte_eth_devices[port_id]);\n }\n \n int\n@@ -74,7 +74,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 (check_for_bonded_ethdev(&rte_eth_devices[port_id]) == 0)\n \t\treturn -1;\n \n \treturn 0;\n@@ -165,28 +165,11 @@ number_of_sockets(void)\n \treturn ++sockets;\n }\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 +186,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,11 +199,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->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@@ -250,8 +220,6 @@ 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-\n \teth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC |\n \t\tRTE_ETH_DEV_DETACHABLE;\n \teth_dev->driver = NULL;\n@@ -297,7 +265,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@@ -329,7 +296,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 \n@@ -358,7 +324,7 @@ __eth_bond_slave_add_lock_free(uint8_t bonded_port_id, uint8_t slave_port_id)\n \t/* Verify that new slave device is not already a slave of another\n \t * bonded device */\n \tfor (i = rte_eth_dev_count()-1; i >= 0; i--) {\n-\t\tif (valid_bonded_ethdev(&rte_eth_devices[i]) == 0) {\n+\t\tif (check_for_bonded_ethdev(&rte_eth_devices[i]) == 0) {\n \t\t\ttemp_internals = rte_eth_devices[i].data->dev_private;\n \n \t\t\tfor (j = 0; j < temp_internals->slave_count; j++) {\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex eecb381..500a1ee 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -1307,7 +1307,7 @@ 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+\tif (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)\n \t\tslave_eth_dev->data->dev_conf.intr_conf.lsc = 1;\n \n \t/* If RSS is enabled for bonding, try to enable it for slaves  */\n@@ -1403,9 +1403,9 @@ 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+\tif (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)\n \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\t\tRTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id);\n \n \treturn 0;\n }\n@@ -1444,7 +1444,7 @@ slave_add(struct bond_dev_private *internals,\n \n \t/* If slave device doesn't support interrupts then we need to enabled\n \t * polling to monitor link status */\n-\tif (!(slave_eth_dev->pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)) {\n+\tif (!(slave_eth_dev->data->dev_flags & RTE_PCI_DRV_INTR_LSC)) {\n \t\tslave_details->link_status_poll_enabled = 1;\n \n \t\tif (!internals->link_status_polling_enabled) {\n@@ -1488,7 +1488,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev)\n \tint i;\n \n \t/* slave eth dev will be started by bonded device */\n-\tif (valid_bonded_ethdev(eth_dev)) {\n+\tif (check_for_bonded_ethdev(eth_dev)) {\n \t\tRTE_BOND_LOG(ERR, \"User tried to explicitly start a slave eth_dev (%d)\",\n \t\t\t\teth_dev->data->port_id);\n \t\treturn -1;\n@@ -1633,7 +1633,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@@ -1649,7 +1649,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@@ -1673,7 +1673,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;\n@@ -1926,7 +1926,7 @@ bond_ethdev_lsc_event_callback(uint8_t port_id, enum rte_eth_event_type type,\n \tbonded_eth_dev = &rte_eth_devices[*(uint8_t *)param];\n \tslave_eth_dev = &rte_eth_devices[port_id];\n \n-\tif (valid_bonded_ethdev(bonded_eth_dev))\n+\tif (check_for_bonded_ethdev(bonded_eth_dev))\n \t\treturn;\n \n \tinternals = bonded_eth_dev->data->dev_private;\ndiff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h\nindex e7af809..6c47a29 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -174,7 +174,7 @@ struct bond_dev_private {\n extern struct eth_dev_ops default_dev_ops;\n \n int\n-valid_bonded_ethdev(const struct rte_eth_dev *eth_dev);\n+check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev);\n \n /* Search given slave array to find possition of given id.\n  * Return slave pos or slaves_count if not found. */\n",
    "prefixes": [
        "dpdk-dev",
        "v8",
        "11/11"
    ]
}