get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 12139,
    "url": "https://patches.dpdk.org/api/patches/12139/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1461152657-19969-18-git-send-email-david.marchand@6wind.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": "<1461152657-19969-18-git-send-email-david.marchand@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1461152657-19969-18-git-send-email-david.marchand@6wind.com",
    "date": "2016-04-20T11:44:17",
    "name": "[dpdk-dev,v2,17/17] ethdev: get rid of device type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ebc32eaf5279c2afb6284bfa26e3bfaf441c88ba",
    "submitter": {
        "id": 3,
        "url": "https://patches.dpdk.org/api/people/3/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1461152657-19969-18-git-send-email-david.marchand@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/12139/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/12139/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 48B2F5953;\n\tWed, 20 Apr 2016 13:44:46 +0200 (CEST)",
            "from mail-wm0-f51.google.com (mail-wm0-f51.google.com\n\t[74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 61B4E58C3\n\tfor <dev@dpdk.org>; Wed, 20 Apr 2016 13:44:40 +0200 (CEST)",
            "by mail-wm0-f51.google.com with SMTP id n3so77131770wmn.0\n\tfor <dev@dpdk.org>; Wed, 20 Apr 2016 04:44:40 -0700 (PDT)",
            "from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net.\n\t[78.126.77.144]) by smtp.gmail.com with ESMTPSA id\n\tm6sm5195708wje.21.2016.04.20.04.44.39\n\t(version=TLSv1/SSLv3 cipher=OTHER);\n\tWed, 20 Apr 2016 04:44:39 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=KshFNrlwHqbCSZuHz52ElbOyMy6QFRcUyu5893kLD8M=;\n\tb=fTUVb1sqvWSXmNC+3ReSQYokVku2vf8BALDYiDlCz73ptpGhrmreslatllibIjuWgB\n\teEZkDLu0Z3ut5LZl52V2p47dve9EeV7MERzVNIOxGuWu1RDkeeE07pCdUHxB68j13G3s\n\tNeIVsM0pJYaUA6rZRKjPr0bl867iP6GFFymmOeEi6bCY/4ojjdhvsPBGCguePmVyITNk\n\tsaxTaCHzicexBv1ke5FsjUHDew2yvJ4iLgiXo5tQDbCMOwrkv1v7Roq3N3d9viviMq58\n\tTvurhQCL2vyil3PqIPsOqUNCzxy5Si4F8E9o2tMyaB8wSFcJWRaHKANsTrKqqboVvDj6\n\tQcUw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=KshFNrlwHqbCSZuHz52ElbOyMy6QFRcUyu5893kLD8M=;\n\tb=N84lWOKCNX4HLqUoSYq5aZp+k4/tt3Vxbx0L1fW8ke3AOR4Dx2Kc7HXEkWceM/CBwe\n\tab2zCQpOIkwLDOBD98rlo9ePhabHAWaOC4MbE557wfrLbQBZmtjeGijV4HHmFNOvi9e7\n\t4mq710WABthWYZdIERMuNwR2Hk5VYaWLE2xktDItJR+NQmq2WQXQ/pTyBB1hsdSoHnRo\n\to84260Fu0xM13LJedTWVWeCdLWNB8yVEywI+EltrqURDMjkKOrer+p74Xgikn/XUeBId\n\tMy1XckaHUllTZuTo8+6hB6QvS0HDix9FJ4ncLXooHifXmBhiLhSInDevwuDJpDWavaGg\n\txr0g==",
        "X-Gm-Message-State": "AOPr4FXDQUA+uIVrW6r0IgM6E6dfpCCXugh2pLoNKJ3M6m7kO9eKwfGCxdR/HO9/TFtOah8B",
        "X-Received": "by 10.194.192.106 with SMTP id\n\thf10mr8120017wjc.134.1461152680219; \n\tWed, 20 Apr 2016 04:44:40 -0700 (PDT)",
        "From": "David Marchand <david.marchand@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas.monjalon@6wind.com,\n\tviktorin@rehivetech.com",
        "Date": "Wed, 20 Apr 2016 13:44:17 +0200",
        "Message-Id": "<1461152657-19969-18-git-send-email-david.marchand@6wind.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1461152657-19969-1-git-send-email-david.marchand@6wind.com>",
        "References": "<1454076516-21591-1-git-send-email-david.marchand@6wind.com>\n\t<1461152657-19969-1-git-send-email-david.marchand@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v2 17/17] ethdev: get rid of device type",
        "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": "Now that hotplug has been moved to eal, there is no reason to keep the device\ntype in this layer.\n\nSigned-off-by: David Marchand <david.marchand@6wind.com>\n---\n app/test/virtual_pmd.c                    |  2 +-\n drivers/net/af_packet/rte_eth_af_packet.c |  2 +-\n drivers/net/bonding/rte_eth_bond_api.c    |  2 +-\n drivers/net/cxgbe/cxgbe_main.c            |  2 +-\n drivers/net/mlx4/mlx4.c                   |  2 +-\n drivers/net/mlx5/mlx5.c                   |  2 +-\n drivers/net/mpipe/mpipe_tilegx.c          |  2 +-\n drivers/net/null/rte_eth_null.c           |  2 +-\n drivers/net/pcap/rte_eth_pcap.c           |  2 +-\n drivers/net/ring/rte_eth_ring.c           |  2 +-\n drivers/net/vhost/rte_eth_vhost.c         |  2 +-\n drivers/net/xenvirt/rte_eth_xenvirt.c     |  2 +-\n examples/ip_pipeline/init.c               | 22 ----------------------\n lib/librte_ether/rte_ethdev.c             |  5 ++---\n lib/librte_ether/rte_ethdev.h             | 15 +--------------\n 15 files changed, 15 insertions(+), 51 deletions(-)",
    "diff": "diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c\nindex b4bd2f2..8a1f0d0 100644\n--- a/app/test/virtual_pmd.c\n+++ b/app/test/virtual_pmd.c\n@@ -581,7 +581,7 @@ virtual_ethdev_create(const char *name, struct ether_addr *mac_addr,\n \t\tgoto err;\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL)\n \t\tgoto err;\n \ndiff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c\nindex f17bd7e..36ac102 100644\n--- a/drivers/net/af_packet/rte_eth_af_packet.c\n+++ b/drivers/net/af_packet/rte_eth_af_packet.c\n@@ -648,7 +648,7 @@ rte_pmd_init_internals(const char *name,\n \t}\n \n \t/* reserve an ethdev entry */\n-\t*eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\t*eth_dev = rte_eth_dev_allocate(name);\n \tif (*eth_dev == NULL)\n \t\tgoto error;\n \ndiff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c\nindex e9247b5..c72807c 100644\n--- a/drivers/net/bonding/rte_eth_bond_api.c\n+++ b/drivers/net/bonding/rte_eth_bond_api.c\n@@ -193,7 +193,7 @@ rte_eth_bond_create(const char *name, uint8_t mode, uint8_t socket_id)\n \t}\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL) {\n \t\tRTE_BOND_LOG(ERR, \"Unable to allocate rte_eth_dev\");\n \t\tgoto err;\ndiff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c\nindex ceaf5ab..922155b 100644\n--- a/drivers/net/cxgbe/cxgbe_main.c\n+++ b/drivers/net/cxgbe/cxgbe_main.c\n@@ -1150,7 +1150,7 @@ int cxgbe_probe(struct adapter *adapter)\n \t\t */\n \n \t\t/* reserve an ethdev entry */\n-\t\tpi->eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);\n+\t\tpi->eth_dev = rte_eth_dev_allocate(name);\n \t\tif (!pi->eth_dev)\n \t\t\tgoto out_free;\n \ndiff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c\nindex 8e4b0cc..0c76e72 100644\n--- a/drivers/net/mlx4/mlx4.c\n+++ b/drivers/net/mlx4/mlx4.c\n@@ -5667,7 +5667,7 @@ mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)\n \n \t\t\tsnprintf(name, sizeof(name), \"%s port %u\",\n \t\t\t\t ibv_get_device_name(ibv_dev), port);\n-\t\t\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);\n+\t\t\teth_dev = rte_eth_dev_allocate(name);\n \t\t}\n \t\tif (eth_dev == NULL) {\n \t\t\tERROR(\"can not allocate rte ethdev\");\ndiff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c\nindex 1989a37..f6399fc 100644\n--- a/drivers/net/mlx5/mlx5.c\n+++ b/drivers/net/mlx5/mlx5.c\n@@ -519,7 +519,7 @@ mlx5_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)\n \n \t\t\tsnprintf(name, sizeof(name), \"%s port %u\",\n \t\t\t\t ibv_get_device_name(ibv_dev), port);\n-\t\t\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_PCI);\n+\t\t\teth_dev = rte_eth_dev_allocate(name);\n \t\t}\n \t\tif (eth_dev == NULL) {\n \t\t\tERROR(\"can not allocate rte ethdev\");\ndiff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c\nindex adcbc19..4e29931 100644\n--- a/drivers/net/mpipe/mpipe_tilegx.c\n+++ b/drivers/net/mpipe/mpipe_tilegx.c\n@@ -1587,7 +1587,7 @@ rte_pmd_mpipe_devinit(const char *ifname,\n \t\treturn -ENODEV;\n \t}\n \n-\teth_dev = rte_eth_dev_allocate(ifname, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(ifname);\n \tif (!eth_dev) {\n \t\tRTE_LOG(ERR, PMD, \"%s: Failed to allocate device.\\n\", ifname);\n \t\trte_free(priv);\ndiff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c\nindex 5e8e203..e6c74a6 100644\n--- a/drivers/net/null/rte_eth_null.c\n+++ b/drivers/net/null/rte_eth_null.c\n@@ -514,7 +514,7 @@ eth_dev_null_create(const char *name,\n \t\tgoto error;\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL)\n \t\tgoto error;\n \ndiff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex c98e234..2d00d04 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -822,7 +822,7 @@ rte_pmd_init_internals(const char *name, const unsigned nb_rx_queues,\n \t\tgoto error;\n \n \t/* reserve an ethdev entry */\n-\t*eth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\t*eth_dev = rte_eth_dev_allocate(name);\n \tif (*eth_dev == NULL)\n \t\tgoto error;\n \ndiff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c\nindex b1783c3..b78d1cf 100644\n--- a/drivers/net/ring/rte_eth_ring.c\n+++ b/drivers/net/ring/rte_eth_ring.c\n@@ -303,7 +303,7 @@ do_eth_dev_ring_create(const char *name,\n \t}\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL) {\n \t\trte_errno = ENOSPC;\n \t\tgoto error;\ndiff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 310cbef..4e99360 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -717,7 +717,7 @@ eth_dev_vhost_create(const char *name, char *iface_name, int16_t queues,\n \t\tgoto error;\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL)\n \t\tgoto error;\n \ndiff --git a/drivers/net/xenvirt/rte_eth_xenvirt.c b/drivers/net/xenvirt/rte_eth_xenvirt.c\nindex b9638d9..663fb14 100644\n--- a/drivers/net/xenvirt/rte_eth_xenvirt.c\n+++ b/drivers/net/xenvirt/rte_eth_xenvirt.c\n@@ -663,7 +663,7 @@ eth_dev_xenvirt_create(const char *name, const char *params,\n \t\tgoto err;\n \n \t/* reserve an ethdev entry */\n-\teth_dev = rte_eth_dev_allocate(name, RTE_ETH_DEV_VIRTUAL);\n+\teth_dev = rte_eth_dev_allocate(name);\n \tif (eth_dev == NULL)\n \t\tgoto err;\n \ndiff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c\nindex 83422e8..476d372 100644\n--- a/examples/ip_pipeline/init.c\n+++ b/examples/ip_pipeline/init.c\n@@ -604,29 +604,12 @@ app_link_set_tcp_syn_filter(struct app_params *app, struct app_link_params *cp)\n \t}\n }\n \n-static int\n-app_link_is_virtual(struct app_link_params *p)\n-{\n-\tuint32_t pmd_id = p->pmd_id;\n-\tstruct rte_eth_dev *dev = &rte_eth_devices[pmd_id];\n-\n-\tif (dev->dev_type == RTE_ETH_DEV_VIRTUAL)\n-\t\treturn 1;\n-\n-\treturn 0;\n-}\n-\n void\n app_link_up_internal(struct app_params *app, struct app_link_params *cp)\n {\n \tuint32_t i;\n \tint status;\n \n-\tif (app_link_is_virtual(cp)) {\n-\t\tcp->state = 1;\n-\t\treturn;\n-\t}\n-\n \t/* For each link, add filters for IP of current link */\n \tif (cp->ip != 0) {\n \t\tfor (i = 0; i < app->n_links; i++) {\n@@ -734,11 +717,6 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp)\n \tuint32_t i;\n \tint status;\n \n-\tif (app_link_is_virtual(cp)) {\n-\t\tcp->state = 0;\n-\t\treturn;\n-\t}\n-\n \t/* PMD link down */\n \tstatus = rte_eth_dev_set_link_down(cp->pmd_id);\n \tif (status < 0)\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 1794025..55b32da 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -185,7 +185,7 @@ rte_eth_dev_find_free_port(void)\n }\n \n struct rte_eth_dev *\n-rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type)\n+rte_eth_dev_allocate(const char *name)\n {\n \tuint8_t port_id;\n \tstruct rte_eth_dev *eth_dev;\n@@ -210,7 +210,6 @@ rte_eth_dev_allocate(const char *name, enum rte_eth_dev_type type)\n \tsnprintf(eth_dev->data->name, sizeof(eth_dev->data->name), \"%s\", name);\n \teth_dev->data->port_id = port_id;\n \teth_dev->attached = DEV_ATTACHED;\n-\teth_dev->dev_type = type;\n \teth_dev_last_created_port = port_id;\n \tnb_ports++;\n \treturn eth_dev;\n@@ -242,7 +241,7 @@ rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,\n \trte_eal_pci_device_name(&pci_dev->addr, ethdev_name,\n \t\t\tsizeof(ethdev_name));\n \n-\teth_dev = rte_eth_dev_allocate(ethdev_name, RTE_ETH_DEV_PCI);\n+\teth_dev = rte_eth_dev_allocate(ethdev_name);\n \tif (eth_dev == NULL)\n \t\treturn -ENOMEM;\n \ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 016ce33..d120522 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1600,17 +1600,6 @@ struct rte_eth_rxtx_callback {\n };\n \n /**\n- * The eth device type.\n- */\n-enum rte_eth_dev_type {\n-\tRTE_ETH_DEV_UNKNOWN,\t/**< unknown device type */\n-\tRTE_ETH_DEV_PCI,\n-\t\t/**< Physical function and Virtual function of PCI devices */\n-\tRTE_ETH_DEV_VIRTUAL,\t/**< non hardware device */\n-\tRTE_ETH_DEV_MAX\t\t/**< max value of this enum */\n-};\n-\n-/**\n  * @internal\n  * The generic data structure associated with each ethernet device.\n  *\n@@ -1640,7 +1629,6 @@ struct rte_eth_dev {\n \t */\n \tstruct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];\n \tuint8_t attached; /**< Flag indicating the port is attached */\n-\tenum rte_eth_dev_type dev_type; /**< Flag indicating the device type */\n };\n \n struct rte_eth_dev_sriov {\n@@ -1753,8 +1741,7 @@ struct rte_eth_dev *rte_eth_dev_allocated(const char *name);\n  * @return\n  *   - Slot in the rte_dev_devices array for a new device;\n  */\n-struct rte_eth_dev *rte_eth_dev_allocate(const char *name,\n-\t\tenum rte_eth_dev_type type);\n+struct rte_eth_dev *rte_eth_dev_allocate(const char *name);\n \n /**\n  * @internal\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "17/17"
    ]
}