get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 7973,
    "url": "http://patches.dpdk.org/api/patches/7973/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1445621793-3630-29-git-send-email-bernard.iremonger@intel.com/",
    "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": "<1445621793-3630-29-git-send-email-bernard.iremonger@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1445621793-3630-29-git-send-email-bernard.iremonger@intel.com",
    "date": "2015-10-23T17:36:33",
    "name": "[dpdk-dev,v5,28/28] bonding: remove pci device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ed3ae193445460d13428d760992adabde8267235",
    "submitter": {
        "id": 91,
        "url": "http://patches.dpdk.org/api/people/91/?format=api",
        "name": "Iremonger, Bernard",
        "email": "bernard.iremonger@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1445621793-3630-29-git-send-email-bernard.iremonger@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/7973/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/7973/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 920FA9220;\n\tFri, 23 Oct 2015 19:58:06 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 9532191D6\n\tfor <dev@dpdk.org>; Fri, 23 Oct 2015 19:57:58 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga103.fm.intel.com with ESMTP; 23 Oct 2015 10:57:51 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby fmsmga002.fm.intel.com with ESMTP; 23 Oct 2015 10:57: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\tt9NHb8LK006684; Fri, 23 Oct 2015 18:37:08 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id t9NHb87u004061;\n\tFri, 23 Oct 2015 18:37:08 +0100",
            "(from bairemon@localhost)\n\tby sivswdev01.ir.intel.com with  id t9NHb8lk004056;\n\tFri, 23 Oct 2015 18:37:08 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,187,1444719600\"; d=\"scan'208\";a=\"834027369\"",
        "From": "Bernard Iremonger <bernard.iremonger@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 23 Oct 2015 18:36:33 +0100",
        "Message-Id": "<1445621793-3630-29-git-send-email-bernard.iremonger@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1445621793-3630-1-git-send-email-bernard.iremonger@intel.com>",
        "References": "<PATCH v5>\n\t<1445621793-3630-1-git-send-email-bernard.iremonger@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v5 28/28] 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 valid_bonded_device to check_for_bonded_device\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     | 16 +++++-----\n drivers/net/bonding/rte_eth_bond_private.h |  2 +-\n 4 files changed, 20 insertions(+), 51 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 6aa13f7..55f028f 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -45,14 +45,17 @@\n #define DEFAULT_POLLING_INTERVAL_10_MS (10)\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)\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->data->dev_flags & RTE_ETH_DEV_BONDED)\n+\t\treturn 0;\n+\telse\n+\t\treturn 1;\n }\n \n int\n@@ -61,7 +64,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@@ -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 (check_for_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,11 +200,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@@ -292,7 +263,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@@ -324,7 +294,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@@ -353,7 +322,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 5cc6372..f4f29c5 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/* Configure device */\n@@ -1362,9 +1362,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@@ -1447,7 +1447,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@@ -1592,7 +1592,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 +1605,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 +1629,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@@ -1873,7 +1873,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 038bca6..82dadfc 100644\n--- a/drivers/net/bonding/rte_eth_bond_private.h\n+++ b/drivers/net/bonding/rte_eth_bond_private.h\n@@ -162,7 +162,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",
        "v5",
        "28/28"
    ]
}