Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/11334/?format=api
https://patches.dpdk.org/api/patches/11334/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1457551895-12077-2-git-send-email-jianfeng.tan@intel.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": "<1457551895-12077-2-git-send-email-jianfeng.tan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1457551895-12077-2-git-send-email-jianfeng.tan@intel.com", "date": "2016-03-09T19:31:25", "name": "[dpdk-dev,v7,01/11] ethdev: add API to query packet type filling info", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7510dbfd2f272d0bc795dce7aacb569fcb89bc0f", "submitter": { "id": 313, "url": "https://patches.dpdk.org/api/people/313/?format=api", "name": "Jianfeng Tan", "email": "jianfeng.tan@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1457551895-12077-2-git-send-email-jianfeng.tan@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/11334/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/11334/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 E1AAF2BD8;\n\tThu, 10 Mar 2016 03:32:19 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id A93F72BBC\n\tfor <dev@dpdk.org>; Thu, 10 Mar 2016 03:32:16 +0100 (CET)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP; 09 Mar 2016 18:32:16 -0800", "from dpdk06.sh.intel.com ([10.239.128.225])\n\tby orsmga003.jf.intel.com with ESMTP; 09 Mar 2016 18:32:14 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,313,1455004800\"; d=\"scan'208\";a=\"761354449\"", "From": "Jianfeng Tan <jianfeng.tan@intel.com>", "To": "dev@dpdk.org", "Date": "Thu, 10 Mar 2016 03:31:25 +0800", "Message-Id": "<1457551895-12077-2-git-send-email-jianfeng.tan@intel.com>", "X-Mailer": "git-send-email 2.1.4", "In-Reply-To": "<1457551895-12077-1-git-send-email-jianfeng.tan@intel.com>", "References": "<1451544799-70776-1-git-send-email-jianfeng.tan@intel.com>\n\t<1457551895-12077-1-git-send-email-jianfeng.tan@intel.com>", "Subject": "[dpdk-dev] [PATCH v7 01/11] ethdev: add API to query packet type\n\tfilling info", "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": "Add a new API rte_eth_dev_get_ptype_info to query whether/what packet\ntype can be filled by given already started device or its pmd rx burst\nfunction has already been decided).\n\nSigned-off-by: Jianfeng Tan <jianfeng.tan@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nAcked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>\n---\n doc/guides/rel_notes/release_16_04.rst | 3 +++\n lib/librte_ether/rte_ethdev.c | 26 ++++++++++++++++++++++++++\n lib/librte_ether/rte_ethdev.h | 27 +++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map | 8 ++++++++\n 4 files changed, 64 insertions(+)", "diff": "diff --git a/doc/guides/rel_notes/release_16_04.rst b/doc/guides/rel_notes/release_16_04.rst\nindex aa9eabc..376ece5 100644\n--- a/doc/guides/rel_notes/release_16_04.rst\n+++ b/doc/guides/rel_notes/release_16_04.rst\n@@ -162,6 +162,9 @@ This section should contain API changes. Sample format:\n handlers are updated: the pipeline parameter is added,\n the packets mask parameter has been either removed or made input-only.\n \n+* A new API ``rte_eth_dev_get_ptype_info`` is added to query what packet types\n+ can be filled by given already started device.\n+\n \n ABI Changes\n -----------\ndiff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 5c2b416..d828dcf 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1576,6 +1576,32 @@ rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info)\n \tdev_info->driver_name = dev->data->drv_name;\n }\n \n+int\n+rte_eth_dev_get_ptype_info(uint8_t port_id, uint32_t ptype_mask,\n+\t\t\t uint32_t *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_ptype_info_get, -ENOTSUP);\n+\tall_ptypes = (*dev->dev_ops->dev_ptype_info_get)(dev);\n+\n+\tif (!all_ptypes)\n+\t\treturn 0;\n+\n+\tfor (i = 0, j = 0; all_ptypes[i] != RTE_PTYPE_UNKNOWN; ++i)\n+\t\tif (all_ptypes[i] & ptype_mask) {\n+\t\t\tif (j < num)\n+\t\t\t\tptypes[j] = all_ptypes[i];\n+\t\t\tj++;\n+\t\t}\n+\n+\treturn j;\n+}\n+\n void\n rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr)\n {\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex d53e362..e0d2232 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -1021,6 +1021,9 @@ typedef void (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,\n \t\t\t\t struct rte_eth_dev_info *dev_info);\n /**< @internal Get specific informations of an Ethernet device. */\n \n+typedef const uint32_t *(*eth_dev_ptype_info_get_t)(struct rte_eth_dev *dev);\n+/**< @internal Get ptype info of an Ethernet device. */\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@@ -1347,6 +1350,7 @@ struct eth_dev_ops {\n \teth_queue_stats_mapping_set_t queue_stats_mapping_set;\n \t/**< Configure per queue stat counter mapping. */\n \teth_dev_infos_get_t dev_infos_get; /**< Get device info. */\n+\teth_dev_ptype_info_get_t dev_ptype_info_get; /** Get ptype info */\n \tmtu_set_t mtu_set; /**< Set MTU. */\n \tvlan_filter_set_t vlan_filter_set; /**< Filter VLAN Setup. */\n \tvlan_tpid_set_t vlan_tpid_set; /**< Outer VLAN TPID Setup. */\n@@ -2268,6 +2272,29 @@ void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);\n void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info);\n \n /**\n+ * Retrieve the packet type information of an Ethernet device.\n+ *\n+ * @note\n+ * Better to invoke this API after the device is already started or rx burst\n+ * function is decided, to obtain concise ptype information.\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param ptype_mask\n+ * A hint of what kind of packet type which the caller is interested in.\n+ * @param ptypes\n+ * An array pointer to store adequent packet types, allocated by caller.\n+ * @param num\n+ * Size of the array pointed by param ptypes.\n+ * @return\n+ * - (>0) Number of ptypes supported. If it exceeds param num, exceeding\n+ * packet types will not be filled in the given array.\n+ * - (0 or -ENOTSUP) if PMD does not fill the specified ptype.\n+ * - (-ENODEV) if *port_id* invalid.\n+ */\n+int rte_eth_dev_get_ptype_info(uint8_t port_id, uint32_t ptype_mask,\n+\t\t\t uint32_t *ptypes, int num);\n+\n+/**\n * Retrieve the MTU of an Ethernet device.\n *\n * @param port_id\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex d8db24d..a12784c 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -117,3 +117,11 @@ DPDK_2.2 {\n \n \tlocal: *;\n };\n+\n+DPDK_16.04 {\n+\tglobal:\n+\n+\trte_eth_dev_get_ptype_info;\n+\n+\tlocal: *;\n+} DPDK_2.2;\n", "prefixes": [ "dpdk-dev", "v7", "01/11" ] }{ "id": 11334, "url": "