Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/60290/?format=api
https://patches.dpdk.org/api/patches/60290/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20191001064139.9325-2-pbhagavatula@marvell.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": "<20191001064139.9325-2-pbhagavatula@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191001064139.9325-2-pbhagavatula@marvell.com", "date": "2019-10-01T06:41:33", "name": "[v5,1/7] ethdev: add set ptype function", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "1a1505faf7264745f4be8e1d798f84045de480fb", "submitter": { "id": 1183, "url": "https://patches.dpdk.org/api/people/1183/?format=api", "name": "Pavan Nikhilesh Bhagavatula", "email": "pbhagavatula@marvell.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20191001064139.9325-2-pbhagavatula@marvell.com/mbox/", "series": [ { "id": 6639, "url": "https://patches.dpdk.org/api/series/6639/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6639", "date": "2019-10-01T06:41:32", "name": "ethdev: add new Rx offload flags", "version": 5, "mbox": "https://patches.dpdk.org/series/6639/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/60290/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/60290/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 6FB621BED5;\n\tTue, 1 Oct 2019 08:41:49 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n\t[67.231.148.174]) by dpdk.org (Postfix) with ESMTP id AC13A1BECA\n\tfor <dev@dpdk.org>; Tue, 1 Oct 2019 08:41:47 +0200 (CEST)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n\tby mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx916eOhJ006656; Mon, 30 Sep 2019 23:41:47 -0700", "from sc-exch03.marvell.com ([199.233.58.183])\n\tby mx0a-0016f401.pphosted.com with ESMTP id 2vbur190xc-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 30 Sep 2019 23:41:46 -0700", "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 30 Sep 2019 23:41:45 -0700", "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 30 Sep 2019 23:41:45 -0700", "from BG-LT7430.marvell.com (bg-lt7430.marvell.com [10.28.10.255])\n\tby maili.marvell.com (Postfix) with ESMTP id 6109E3F7040;\n\tMon, 30 Sep 2019 23:41:43 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-type : content-transfer-encoding; s=pfpt0818;\n\tbh=N6naz5owuEHMK77pJjg1A30TpEXpKB60NaOifcoZquo=;\n\tb=ZU52R8xmT9/8WPGIHG9lGgVfPU5ikLMGhXQCtGXAbkb7I4z6FeHwYgRWyg1c+HbE7tiN\n\thZXYymnR4o+5/agoZDvRsBGcwglqD9gTa9ipYxBXRtJUFfq1TVP4gCNkML/vyatrY8GE\n\tH+JImGyWpGeSnViBW280biCseiXCBuV7bLJFmAJYoLicEB2YyYf2Uf5HWMqtL/nIZS8R\n\tn7hXwDzL7X7s5sKfOEsUvjBogclF3SNi1c2z6pRU6XYZNk4X0DAPNg032kjiLpvQjb6n\n\tb7+kpr+WY31JLW9WQgCP/HjtuVJD6FVKy+d3xS0ec+/y9eaF7+wMv/o1GAMp6+r5MlUi\n\tkg== ", "From": "<pbhagavatula@marvell.com>", "To": "<arybchenko@solarflare.com>, <jerinj@marvell.com>, John McNamara\n\t<john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>,\n\tThomas Monjalon <thomas@monjalon.net>,\n\tFerruh Yigit <ferruh.yigit@intel.com>", "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>", "Date": "Tue, 1 Oct 2019 12:11:33 +0530", "Message-ID": "<20191001064139.9325-2-pbhagavatula@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191001064139.9325-1-pbhagavatula@marvell.com>", "References": "<20191001063453.7138-1-pbhagavatula@marvell.com>\n\t<20191001064139.9325-1-pbhagavatula@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"UTF-8\"", "Content-Transfer-Encoding": "8bit", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,1.0.8\n\tdefinitions=2019-10-01_03:2019-09-30,2019-10-01 signatures=0", "Subject": "[dpdk-dev] [PATCH v5 1/7] ethdev: add set ptype function", "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": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd `rte_eth_dev_set_supported_ptypes` function that will allow the\napplication to inform the PMD the packet types it is interested in.\nBased on the ptypes set PMDs can optimize their Rx path.\n\n-If application doesn’t want any ptype information it can call\n`rte_eth_dev_set_supported_ptypes(ethdev_id, RTE_PTYPE_UNKNOWN, NULL, 0)`\nand PMD may skip packet type processing and set rte_mbuf::packet_type to\nRTE_PTYPE_UNKNOWN.\n\n-If application doesn’t call `rte_eth_dev_set_supported_ptypes` PMD can\nreturn `rte_mbuf::packet_type` with `rte_eth_dev_get_supported_ptypes`.\n\n-If application is interested only in L2/L3 layer, it can inform the PMD\nto update `rte_mbuf::packet_type` with L2/L3 ptype by calling\n`rte_eth_dev_set_supported_ptypes(ethdev_id,\n\t\tRTE_PTYPE_L2_MASK | RTE_PTYPE_L3_MASK, NULL, 0)`.\n\nSuggested-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n doc/guides/nics/features.rst | 8 +++--\n doc/guides/rel_notes/release_19_11.rst | 7 +++++\n lib/librte_ethdev/rte_ethdev.c | 38 ++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev.h | 29 ++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_core.h | 6 ++++\n lib/librte_ethdev/rte_ethdev_version.map | 3 ++\n 6 files changed, 89 insertions(+), 2 deletions(-)", "diff": "diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst\nindex c4e128d2f..1756fa73a 100644\n--- a/doc/guides/nics/features.rst\n+++ b/doc/guides/nics/features.rst\n@@ -583,9 +583,13 @@ Packet type parsing\n -------------------\n \n Supports packet type parsing and returns a list of supported types.\n+Allows application to set ptypes it is interested in.\n \n-* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``.\n-* **[related] API**: ``rte_eth_dev_get_supported_ptypes()``.\n+* **[implements] eth_dev_ops**: ``dev_supported_ptypes_get``,\n+ ``dev_supported_ptypes_set``.\n+* **[related] API**: ``rte_eth_dev_get_supported_ptypes()``,\n+ ``rte_eth_dev_set_supported_ptypes()``.\n+* **[provides] mbuf**: ``mbuf.packet_type``.\n \n \n .. _nic_features_timesync:\ndiff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst\nindex 27cfbd9e3..7e31b9401 100644\n--- a/doc/guides/rel_notes/release_19_11.rst\n+++ b/doc/guides/rel_notes/release_19_11.rst\n@@ -56,6 +56,13 @@ New Features\n Also, make sure to start the actual text at the margin.\n =========================================================\n \n+* **Added ethdev API to set supported packet types**\n+\n+ * Added new API ``rte_eth_dev_set_supported_ptypes`` that allows an\n+ application to inform PMD about packet types classification the application\n+ is interested in\n+ * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx\n+ and thereby improve Rx performance if application wishes do so.\n \n Removed Items\n -------------\ndiff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 17d183e1f..061de7ac5 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -2602,6 +2602,44 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n \treturn j;\n }\n \n+int\n+rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n+\t\t\t\t uint32_t *set_ptypes, int num)\n+{\n+\tint i, j;\n+\tstruct rte_eth_dev *dev;\n+\tconst uint32_t *all_ptypes;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_set, 0);\n+\n+\tif (ptype_mask == 0)\n+\t\treturn (*dev->dev_ops->dev_supported_ptypes_set)(dev,\n+\t\t\t\tptype_mask);\n+\n+\tall_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);\n+\tif (all_ptypes == NULL)\n+\t\treturn 0;\n+\n+\tfor (i = 0, j = 0; set_ptypes && (all_ptypes[i] != RTE_PTYPE_UNKNOWN);\n+\t\t\t\t\t\t\t\t\t++i) {\n+\t\tif (ptype_mask & all_ptypes[i]) {\n+\t\t\tif (j < num - 1) {\n+\t\t\t\tset_ptypes[j] = all_ptypes[i];\n+\t\t\t\tj++;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tset_ptypes[j] = RTE_PTYPE_UNKNOWN;\n+\n+\treturn (*dev->dev_ops->dev_supported_ptypes_set)(dev, ptype_mask);\n+}\n+\n void\n rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)\n {\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex d9871782e..06c770055 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -2431,6 +2431,35 @@ int rte_eth_dev_fw_version_get(uint16_t port_id,\n */\n int rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n \t\t\t\t uint32_t *ptypes, int num);\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Inform Ethernet device of the packet types classification in which\n+ * the recipient is interested.\n+ *\n+ * Application can use this function to set only specific ptypes that it's\n+ * interested. This information can be used by the PMD to optimize Rx path.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param ptype_mask\n+ * The ptype family that application is interested in.\n+ * @param set_ptypes\n+ * An array pointer to store set packet types, allocated by caller. The\n+ * function marks the end of array with RTE_PTYPE_UNKNOWN.\n+ * @param num\n+ * Size of the array pointed by param ptypes.\n+ * Should be rte_eth_dev_get_supported_ptypes() + 1 to accommodate the\n+ * set ptypes.\n+ * @return\n+ * - (0) if Success.\n+ * - (-ENODEV) if *port_id* invalid.\n+ * - (-EINVAL) if *ptype_mask* is invalid.\n+ */\n+__rte_experimental\n+int rte_eth_dev_set_supported_ptypes(uint16_t port_id, uint32_t ptype_mask,\n+\t\t\t\t uint32_t *set_ptypes, int num);\n \n /**\n * Retrieve the MTU of an Ethernet device.\ndiff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h\nindex 2922d5b7c..93bc34480 100644\n--- a/lib/librte_ethdev/rte_ethdev_core.h\n+++ b/lib/librte_ethdev/rte_ethdev_core.h\n@@ -110,6 +110,10 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,\n typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);\n /**< @internal Get supported ptypes of an Ethernet device. */\n \n+typedef uint32_t (*eth_dev_supported_ptypes_set_t)(struct rte_eth_dev *dev,\n+\t\t\t\t\t uint32_t ptype_mask);\n+/**< @internal Inform device about packet types in which the recipient is interested. */\n+\n typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,\n \t\t\t\t uint16_t queue_id);\n /**< @internal Start rx and tx of a queue of an Ethernet device. */\n@@ -421,6 +425,8 @@ struct eth_dev_ops {\n \teth_fw_version_get_t fw_version_get; /**< Get firmware version. */\n \teth_dev_supported_ptypes_get_t dev_supported_ptypes_get;\n \t/**< Get packet types supported and identified by device. */\n+\teth_dev_supported_ptypes_set_t dev_supported_ptypes_set;\n+\t/**< Inform device about packet types in which the recipient is interested. */\n \n \tvlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */\n \tvlan_tpid_set_t vlan_tpid_set; /**< Outer/Inner VLAN TPID Setup. */\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 6df42a47b..e14745b9c 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -283,4 +283,7 @@ EXPERIMENTAL {\n \n \t# added in 19.08\n \trte_eth_read_clock;\n+\n+\t# added in 19.11\n+\trte_eth_dev_set_supported_ptypes;\n };\n", "prefixes": [ "v5", "1/7" ] }{ "id": 60290, "url": "