get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47066,
    "url": "http://patches.dpdk.org/api/patches/47066/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181019020757.27698-6-thomas@monjalon.net/",
    "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": "<20181019020757.27698-6-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181019020757.27698-6-thomas@monjalon.net",
    "date": "2018-10-19T02:07:56",
    "name": "[v6,5/6] ethdev: remove release function for secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "2772391d21bc3428267c9b36f3d80e89d891e7b0",
    "submitter": {
        "id": 685,
        "url": "http://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181019020757.27698-6-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 1984,
            "url": "http://patches.dpdk.org/api/series/1984/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1984",
            "date": "2018-10-19T02:07:51",
            "name": "ethdev port freeing",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/1984/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47066/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/47066/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 309201B161;\n\tFri, 19 Oct 2018 04:08:16 +0200 (CEST)",
            "from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com\n\t[66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 79C0A1B120\n\tfor <dev@dpdk.org>; Fri, 19 Oct 2018 04:08:06 +0200 (CEST)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 26315229F1;\n\tThu, 18 Oct 2018 22:08:06 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n\tby compute1.internal (MEProxy); Thu, 18 Oct 2018 22:08:06 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id 11251102DE;\n\tThu, 18 Oct 2018 22:08:04 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n\tfrom:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding; s=mesmtp; bh=00uIpEvScM\n\tMS101IrwtScwDCxJHg5fassXgl/ke5V2I=; b=rbFtacO/grwpyyJNwLV/3RKnSK\n\t6yi5p/kk+2PKRksYVEVZ1l6TNi6lpl/Z0t8vHkjJZWPmnMKU4zdGP8yg4n2GGTrC\n\tY55sqY6Tqe61S44CpOPRScMLMs/6jxu/yN6+RHsalnJNYfRezKnZ5iFmnDZVyscm\n\twM5XGFWaOK62omITY=",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:content-transfer-encoding:date:from\n\t:in-reply-to:message-id:mime-version:references:subject:to\n\t:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n\tfm1; bh=00uIpEvScMMS101IrwtScwDCxJHg5fassXgl/ke5V2I=; b=vh/f3rbg\n\tEzvxpKOXZV9sdIW4UwkhkJv09m1XghwBvwAe7nLJ6C3jAn0nsWHIOjl0yVGWjV/C\n\tYeI6f+79UUycej9pyOvcThFuw0q+PrGlobovdz0NTRLDkXA8ZgsGsxec1dupcNMv\n\tC/1RritWiI7NUwxBjWJxYGw510YRCpIYOHG7GinexSDI5uOs9KMzG0E0g9mLGoV9\n\teaPwhxxZZ0bwiONBOPeU4vD4WFE2F+FytYDOUFRAY43uerZC7m2LDto6KQbuoPed\n\t25DgngvzlsN2gPpaVYSVaMU4mGSQZxW/SsuH+01QKrdysVgU70xONTGwYWDTJqry\n\tSZ+xXtE4AdJGcA=="
        ],
        "X-ME-Sender": "<xms:hTzJW7YbQ6cOpGy-BF8WBbukczO9u4Vkqr4ppgB7a0adEZ7RVJBthw>",
        "X-ME-Proxy": "<xmx:hTzJW7tqdH70ISblOS46CE7jJGda3LvTnbcVgTSD2DSc0dAW2j1oXw>\n\t<xmx:hTzJW61zf0bYNGoqhVtcNLQcGyYf-OavIV918YM2uZflnmAMY2PjXw>\n\t<xmx:hTzJWxPVTwIuv-fibQ55JeS7RI-N2cYYIFPunKVRB4IYImA2FhyVXg>\n\t<xmx:hTzJW3Yp0tEU-V0vBOFPgOz4biOroMUJKRk2ua-I7ur3Y0M53NEiJw>\n\t<xmx:hTzJW8iHVlK1e1EmIe-zpJWb9tp2MrRO0t9WqpeC_A1QoSGUHk0a3g>\n\t<xmx:hjzJWzxXLKBEE6TItf--QFWCgxlOzd4mU44vFGMHPhZYIMTwP3t9nQ>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "ferruh.yigit@intel.com,\n\tarybchenko@solarflare.com",
        "Cc": "dev@dpdk.org, ophirmu@mellanox.com, bernard.iremonger@intel.com,\n\trahul.lakkireddy@chelsio.com",
        "Date": "Fri, 19 Oct 2018 04:07:56 +0200",
        "Message-Id": "<20181019020757.27698-6-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.19.0",
        "In-Reply-To": "<20181019020757.27698-1-thomas@monjalon.net>",
        "References": "<20180907233929.21950-1-thomas@monjalon.net>\n\t<20181019020757.27698-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v6 5/6] ethdev: remove release function for\n\tsecondary process",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "After previous changes, the function rte_eth_dev_release_port()\ncan be used for primary or secondary process as well.\nThe only difference with rte_eth_dev_release_port_secondary()\nis the shared lock used in rte_eth_dev_release_port().\n\nThe function rte_eth_dev_release_port_secondary() was recently\nadded in 18.11 cycle.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\nReviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>\n---\n drivers/net/af_packet/rte_eth_af_packet.c |  2 +-\n drivers/net/bonding/rte_eth_bond_pmd.c    |  2 +-\n drivers/net/kni/rte_eth_kni.c             |  2 +-\n drivers/net/null/rte_eth_null.c           |  7 +++----\n drivers/net/octeontx/octeontx_ethdev.c    |  2 +-\n drivers/net/pcap/rte_eth_pcap.c           | 12 ++++++------\n drivers/net/tap/rte_eth_tap.c             |  2 +-\n drivers/net/vhost/rte_eth_vhost.c         |  2 +-\n lib/librte_ethdev/rte_ethdev.c            | 15 ---------------\n lib/librte_ethdev/rte_ethdev_driver.h     | 14 --------------\n lib/librte_ethdev/rte_ethdev_pci.h        |  7 -------\n lib/librte_ethdev/rte_ethdev_version.map  |  7 -------\n 12 files changed, 15 insertions(+), 59 deletions(-)",
    "diff": "diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c\nindex 2efc17725..95a98c6b8 100644\n--- a/drivers/net/af_packet/rte_eth_af_packet.c\n+++ b/drivers/net/af_packet/rte_eth_af_packet.c\n@@ -990,7 +990,7 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)\n \teth_dev->data->mac_addrs = NULL;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\t\treturn rte_eth_dev_release_port(eth_dev);\n \n \tinternals = eth_dev->data->dev_private;\n \tfor (q = 0; q < internals->nb_queues; q++) {\ndiff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c\nindex 77fb3dcd3..e7a4be921 100644\n--- a/drivers/net/bonding/rte_eth_bond_pmd.c\n+++ b/drivers/net/bonding/rte_eth_bond_pmd.c\n@@ -3267,7 +3267,7 @@ bond_remove(struct rte_vdev_device *dev)\n \t\treturn -ENODEV;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\t\treturn rte_eth_dev_release_port(eth_dev);\n \n \tRTE_ASSERT(eth_dev->device == &dev->device);\n \ndiff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c\nindex f43ee7d2e..a1e9970df 100644\n--- a/drivers/net/kni/rte_eth_kni.c\n+++ b/drivers/net/kni/rte_eth_kni.c\n@@ -467,7 +467,7 @@ eth_kni_remove(struct rte_vdev_device *vdev)\n \teth_dev->data->mac_addrs = NULL;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\t\treturn rte_eth_dev_release_port(eth_dev);\n \n \teth_kni_dev_stop(eth_dev);\n \ndiff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c\nindex b77283ae7..159c1c1fd 100644\n--- a/drivers/net/null/rte_eth_null.c\n+++ b/drivers/net/null/rte_eth_null.c\n@@ -679,11 +679,10 @@ rte_pmd_null_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY)\n+\t\t/* mac_addrs must not be freed alone because part of dev_private */\n+\t\teth_dev->data->mac_addrs = NULL;\n \n-\t/* mac_addrs must not be freed alone because part of dev_private */\n-\teth_dev->data->mac_addrs = NULL;\n \trte_eth_dev_release_port(eth_dev);\n \n \treturn 0;\ndiff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c\nindex 746507912..068148624 100644\n--- a/drivers/net/octeontx/octeontx_ethdev.c\n+++ b/drivers/net/octeontx/octeontx_ethdev.c\n@@ -1129,7 +1129,7 @@ octeontx_remove(struct rte_vdev_device *dev)\n \t\t\treturn -ENODEV;\n \n \t\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n-\t\t\trte_eth_dev_release_port_secondary(eth_dev);\n+\t\t\trte_eth_dev_release_port(eth_dev);\n \t\t\tcontinue;\n \t\t}\n \ndiff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex 1790a8064..7bbe72e25 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -1228,13 +1228,13 @@ pmd_pcap_remove(struct rte_vdev_device *dev)\n \tif (eth_dev == NULL)\n \t\treturn -1;\n \n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\tinternals = eth_dev->data->dev_private;\n+\t\tif (internals != NULL && internals->phy_mac == 0)\n+\t\t\t/* not dynamically allocated, must not be freed */\n+\t\t\teth_dev->data->mac_addrs = NULL;\n+\t}\n \n-\tinternals = eth_dev->data->dev_private;\n-\tif (internals != NULL && internals->phy_mac == 0)\n-\t\t/* not dynamically allocated, must not be freed */\n-\t\teth_dev->data->mac_addrs = NULL;\n \trte_eth_dev_release_port(eth_dev);\n \n \treturn 0;\ndiff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex 2327fbf8c..53d37b3cb 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -2082,7 +2082,7 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)\n \teth_dev->data->mac_addrs = NULL;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\t\treturn rte_eth_dev_release_port(eth_dev);\n \n \tinternals = eth_dev->data->dev_private;\n \ndiff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex cf51c072d..0cd1a4642 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -1433,7 +1433,7 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev)\n \t\treturn -ENODEV;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(eth_dev);\n+\t\treturn rte_eth_dev_release_port(eth_dev);\n \n \teth_dev_close(eth_dev);\n \ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 3bc05f4c3..178800a5b 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -362,18 +362,6 @@ rte_eth_dev_attach_secondary(const char *name)\n \treturn eth_dev;\n }\n \n-int\n-rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev)\n-{\n-\tif (eth_dev == NULL)\n-\t\treturn -EINVAL;\n-\n-\t_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);\n-\teth_dev->state = RTE_ETH_DEV_UNUSED;\n-\n-\treturn 0;\n-}\n-\n int\n rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)\n {\n@@ -3591,9 +3579,6 @@ rte_eth_dev_destroy(struct rte_eth_dev *ethdev,\n \t\t\treturn ret;\n \t}\n \n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n-\t\treturn rte_eth_dev_release_port_secondary(ethdev);\n-\n \treturn rte_eth_dev_release_port(ethdev);\n }\n \ndiff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h\nindex 66274be7a..c2ac26328 100644\n--- a/lib/librte_ethdev/rte_ethdev_driver.h\n+++ b/lib/librte_ethdev/rte_ethdev_driver.h\n@@ -74,20 +74,6 @@ struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);\n  */\n int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);\n \n-/**\n- * @internal\n- * Release the specified ethdev port in the local process.\n- * Only set ethdev state to unused, but not reset shared data since\n- * it assume other processes is still using it. typically it is\n- * called by a secondary process.\n- *\n- * @param eth_dev\n- * Device to be detached.\n- * @return\n- *   - 0 on success, negative on error\n- */\n-int rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev);\n-\n /**\n  * @internal\n  * Release device queues and clear its configuration to force the user\ndiff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h\nindex 8ff4f6b89..23257e986 100644\n--- a/lib/librte_ethdev/rte_ethdev_pci.h\n+++ b/lib/librte_ethdev/rte_ethdev_pci.h\n@@ -135,13 +135,6 @@ rte_eth_dev_pci_allocate(struct rte_pci_device *dev, size_t private_data_size)\n static inline void\n rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)\n {\n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n-\t\teth_dev->device = NULL;\n-\t\teth_dev->intr_handle = NULL;\n-\t\trte_eth_dev_release_port_secondary(eth_dev);\n-\t\treturn;\n-\t}\n-\n \teth_dev->device = NULL;\n \teth_dev->intr_handle = NULL;\n \ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 3a4dd4790..dfa122c1a 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -220,13 +220,6 @@ DPDK_18.08 {\n \n } DPDK_18.05;\n \n-DPDK_18.11 {\n-\tglobal:\n-\n-\trte_eth_dev_release_port_secondary;\n-\n-} DPDK_18.08;\n-\n EXPERIMENTAL {\n \tglobal:\n \n",
    "prefixes": [
        "v6",
        "5/6"
    ]
}