get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 51964,
    "url": "http://patches.dpdk.org/api/patches/51964/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190401022700.1570-3-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": "<20190401022700.1570-3-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190401022700.1570-3-thomas@monjalon.net",
    "date": "2019-04-01T02:26:58",
    "name": "[v3,2/4] ethdev: add siblings iterators",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b697558187abab8f5bf7ce4e155155667aec034b",
    "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/20190401022700.1570-3-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 4017,
            "url": "http://patches.dpdk.org/api/series/4017/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4017",
            "date": "2019-04-01T02:26:56",
            "name": "ethdev iterators for multi-ports device",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4017/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/51964/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/51964/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 6A4E04C9D;\n\tMon,  1 Apr 2019 04:27:29 +0200 (CEST)",
            "from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n\t[66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 47C0C4C91\n\tfor <dev@dpdk.org>; Mon,  1 Apr 2019 04:27:27 +0200 (CEST)",
            "from compute1.internal (compute1.nyi.internal [10.202.2.41])\n\tby mailout.nyi.internal (Postfix) with ESMTP id C8E4221ADA;\n\tSun, 31 Mar 2019 22:27:26 -0400 (EDT)",
            "from mailfrontend2 ([10.202.2.163])\n\tby compute1.internal (MEProxy); Sun, 31 Mar 2019 22:27:26 -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 DEA4C10392;\n\tSun, 31 Mar 2019 22:27:25 -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=UKuiSD+Ujj\n\tc2eeMVXzGHLYl/5C8iShIhuBy6awAD470=; b=rbx20xQlYhN3ULugw0+NG4KQuX\n\tYCo8M3bhT4U+1bKhCDfc3bF3c/EDeDNwMYBMe4jgDNyogqnhA/ft2dNs69KkJSyF\n\t+z5rEWN57S+j+i3sOY05GJsPBF6pC5P/EM0dQhQtmN+6KlKSlJj/QcIFi5j65XO4\n\tPiOImtORJ0hg572As=",
            "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\tfm2; bh=UKuiSD+Ujjc2eeMVXzGHLYl/5C8iShIhuBy6awAD470=; b=EQBAyJeK\n\txU12QxtBPT1nacroDKDkk+L3WiVsCMuJ1Q3jU5nYNw+7RconqH4JH0kkja0p9FMX\n\tqC1TgZk/Yl8vRDTVkd1URgwrLtOa4yt3t3YsLH6d9X3sEHRv2r+N2wTEcr3BitWm\n\t3Ex8C5vA8VHdkpb4w67ijT2AfdksYg5pVmH1HBjbjOZfdLF75baptJRytNQc+alr\n\ttQRBf4v0WNdZkkzZ0Zy6Ret66Tci5M1JftCagq7L3HJrNpcKwfQpyzpjxGFjJlml\n\t5cNijH3y+2rrTTnb5FB7X+aWj3/PWjhAEhl6AZelwINKeIzlR/n1wuxnLtEEErcS\n\ta+c5wQAPB8iwVw=="
        ],
        "X-ME-Sender": "<xms:DnehXH93APXsHAHwjO3197tXJ4Pe_DKTwHG_EB-8qe25Ux8csvxu8w>",
        "X-ME-Proxy-Cause": "gggruggvucftvghtrhhoucdtuddrgedutddrleefgdehlecutefuodetggdotefrodftvf\n\tcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu\n\tuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc\n\tfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs\n\tucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph\n\tepjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho\n\tmhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgepvd",
        "X-ME-Proxy": "<xmx:DnehXEVrhmjIHJ0ADfJ5x0EXccTG5PyTK3CU2t5n-DlzoLO5CPGgvw>\n\t<xmx:DnehXAJ6yVUlOtsli6Vm1bY9Qsq6gt-Ay63yQlxl0YMzBEoJjxhcGg>\n\t<xmx:DnehXIDJ6doIF_Slwat3Sj-jaKFkcapl-5f0ks4NElTQFUWHaWvWbw>\n\t<xmx:DnehXExFygDq7zkBq297Pgg6STCz-Ia3Yk-Nm5qk4101xLv3ojkFNA>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "gaetan.rivet@6wind.com, Ferruh Yigit <ferruh.yigit@intel.com>,\n\tAndrew Rybchenko <arybchenko@solarflare.com>",
        "Cc": "dev@dpdk.org",
        "Date": "Mon,  1 Apr 2019 04:26:58 +0200",
        "Message-Id": "<20190401022700.1570-3-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190401022700.1570-1-thomas@monjalon.net>",
        "References": "<20181130002716.27325-1-thomas@monjalon.net>\n\t<20190401022700.1570-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v3 2/4] ethdev: add siblings iterators",
        "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": "If multiple ports share the same hardware device (rte_device),\nthey are siblings and can be found thanks to the new functions\nand loop macros.\nOne iterator takes a port id as reference,\nwhile the other one directly refers to the parent device.\n\nThe ownership is not checked because siblings may have\ndifferent owners.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\nv2: Reviewed-by: Andrew Rybchenko - not kept because of changes in v3\n\nv3:\n\t- fix logic + re-use rte_eth_find_next()\n\t- longer parameter names\n\t- more and better doxygen comments\n---\n lib/librte_ethdev/rte_ethdev.c           | 19 +++++++\n lib/librte_ethdev/rte_ethdev.h           | 63 ++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_version.map |  2 +\n 3 files changed, 84 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 33cffc498..3b125a642 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -339,6 +339,25 @@ rte_eth_find_next(uint16_t port_id)\n \treturn port_id;\n }\n \n+uint16_t __rte_experimental\n+rte_eth_find_next_of(uint16_t port_id, const struct rte_device *parent)\n+{\n+\tport_id = rte_eth_find_next(port_id);\n+\twhile (port_id < RTE_MAX_ETHPORTS &&\n+\t\t\trte_eth_devices[port_id].device != parent)\n+\t\tport_id = rte_eth_find_next(port_id + 1);\n+\n+\treturn port_id;\n+}\n+\n+uint16_t __rte_experimental\n+rte_eth_find_next_sibling(uint16_t port_id, uint16_t ref_port_id)\n+{\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(ref_port_id, RTE_MAX_ETHPORTS);\n+\treturn rte_eth_find_next_of(port_id,\n+\t\t\trte_eth_devices[ref_port_id].device);\n+}\n+\n static void\n rte_eth_dev_shared_data_prepare(void)\n {\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex b6023c050..3d5bacaee 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1387,6 +1387,69 @@ uint16_t rte_eth_find_next(uint16_t port_id);\n #define RTE_ETH_FOREACH_DEV(p) \\\n \tRTE_ETH_FOREACH_DEV_OWNED_BY(p, RTE_ETH_DEV_NO_OWNER)\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Iterates over ethdev ports of a specified device.\n+ *\n+ * @param port_id_start\n+ *   The id of the next possible valid port.\n+ * @param parent\n+ *   The generic device behind the ports to iterate.\n+ * @return\n+ *   Next port id of the device, possibly port_id_start,\n+ *   RTE_MAX_ETHPORTS if there is none.\n+ */\n+__rte_experimental\n+uint16_t rte_eth_find_next_of(uint16_t port_id_start,\n+\t\tconst struct rte_device *parent);\n+\n+/**\n+ * Macro to iterate over all ethdev ports of a specified device.\n+ *\n+ * @param port_id\n+ *   The id of the matching port being iterated.\n+ * @param parent\n+ *   The rte_device pointer matching the iterated ports.\n+ */\n+#define RTE_ETH_FOREACH_DEV_OF(port_id, parent) \\\n+\tfor (port_id = rte_eth_find_next_of(0, parent); \\\n+\t\tport_id < RTE_MAX_ETHPORTS; \\\n+\t\tport_id = rte_eth_find_next_of(port_id + 1, parent))\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Iterates over sibling ethdev ports (i.e. sharing the same rte_device).\n+ *\n+ * @param port_id_start\n+ *   The id of the next possible valid sibling port.\n+ * @param ref_port_id\n+ *   The id of a reference port to compare rte_device with.\n+ * @return\n+ *   Next sibling port id, possibly port_id_start or ref_port_id itself,\n+ *   RTE_MAX_ETHPORTS if there is none.\n+ */\n+__rte_experimental\n+uint16_t rte_eth_find_next_sibling(uint16_t port_id_start,\n+\t\tuint16_t ref_port_id);\n+\n+/**\n+ * Macro to iterate over all ethdev ports sharing the same rte_device\n+ * as the specified port.\n+ * Note: the specified reference port is part of the loop iterations.\n+ *\n+ * @param port_id\n+ *   The id of the matching port being iterated.\n+ * @param ref_port_id\n+ *   The id of the port being compared.\n+ */\n+#define RTE_ETH_FOREACH_DEV_SIBLING(port_id, ref_port_id) \\\n+\tfor (port_id = rte_eth_find_next_sibling(0, ref_port_id); \\\n+\t\tport_id < RTE_MAX_ETHPORTS; \\\n+\t\tport_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id))\n \n /**\n  * @warning\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 92ac3de25..b37a4167d 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -245,6 +245,8 @@ EXPERIMENTAL {\n \trte_eth_dev_owner_set;\n \trte_eth_dev_owner_unset;\n \trte_eth_dev_rx_intr_ctl_q_get_fd;\n+\trte_eth_find_next_of;\n+\trte_eth_find_next_sibling;\n \trte_eth_switch_domain_alloc;\n \trte_eth_switch_domain_free;\n \trte_flow_conv;\n",
    "prefixes": [
        "v3",
        "2/4"
    ]
}