Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8497/?format=api
https://patches.dpdk.org/api/patches/8497/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446307051-29283-6-git-send-email-jingjing.wu@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": "<1446307051-29283-6-git-send-email-jingjing.wu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1446307051-29283-6-git-send-email-jingjing.wu@intel.com", "date": "2015-10-31T15:57:27", "name": "[dpdk-dev,v3,5/9] ethdev: new API to get dcb related information", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "6731dc0088f561701dd78c33487fc703f1a19f7b", "submitter": { "id": 47, "url": "https://patches.dpdk.org/api/people/47/?format=api", "name": "Jingjing Wu", "email": "jingjing.wu@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446307051-29283-6-git-send-email-jingjing.wu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8497/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8497/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 CF7248DB4;\n\tSat, 31 Oct 2015 16:57:55 +0100 (CET)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id A512F8E78\n\tfor <dev@dpdk.org>; Sat, 31 Oct 2015 16:57:50 +0100 (CET)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga103.jf.intel.com with ESMTP; 31 Oct 2015 08:57:49 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 31 Oct 2015 08:57:49 -0700", "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9VFvlsn032730;\n\tSat, 31 Oct 2015 23:57:47 +0800", "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9VFvi0r029695; Sat, 31 Oct 2015 23:57:46 +0800", "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9VFvhqN029691; \n\tSat, 31 Oct 2015 23:57:43 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.20,224,1444719600\"; d=\"scan'208\";a=\"808470675\"", "From": "Jingjing Wu <jingjing.wu@intel.com>", "To": "dev@dpdk.org", "Date": "Sat, 31 Oct 2015 23:57:27 +0800", "Message-Id": "<1446307051-29283-6-git-send-email-jingjing.wu@intel.com>", "X-Mailer": "git-send-email 1.7.4.1", "In-Reply-To": "<1446307051-29283-1-git-send-email-jingjing.wu@intel.com>", "References": "<1446108827-7907-1-git-send-email-jingjing.wu@intel.com>\n\t<1446307051-29283-1-git-send-email-jingjing.wu@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 5/9] ethdev: new API to get dcb related\n\tinformation", "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": "This patch adds one new API to get dcb related info.\n rte_eth_dev_get_dcb_info\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n lib/librte_ether/rte_ethdev.c | 18 ++++++++++++\n lib/librte_ether/rte_ethdev.h | 54 ++++++++++++++++++++++++++++++++++\n lib/librte_ether/rte_ether_version.map | 7 +++++\n 3 files changed, 79 insertions(+)", "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex c7247c3..721cef6 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -3143,3 +3143,21 @@ rte_eth_dev_set_eeprom(uint8_t port_id, struct rte_dev_eeprom_info *info)\n \tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_eeprom, -ENOTSUP);\n \treturn (*dev->dev_ops->set_eeprom)(dev, info);\n }\n+\n+int\n+rte_eth_dev_get_dcb_info(uint8_t port_id,\n+\t\t\t struct rte_eth_dcb_info *dcb_info)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\n+\t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tmemset(dcb_info, 0, sizeof(struct rte_eth_dcb_info));\n+\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_dcb_info, -ENOTSUP);\n+\treturn (*dev->dev_ops->get_dcb_info)(dev, dcb_info);\n+}\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 377da6a..2e05189 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -854,6 +854,38 @@ struct rte_eth_xstats {\n \tuint64_t value;\n };\n \n+#define ETH_DCB_NUM_TCS 8\n+#define ETH_MAX_VMDQ_POOL 64\n+\n+/**\n+ * A structure used to get the information of queue and\n+ * TC mapping on both TX and RX paths.\n+ */\n+struct rte_eth_dcb_tc_queue_mapping {\n+\t/** rx queues assigned to tc per Pool */\n+\tstruct {\n+\t\tuint8_t base;\n+\t\tuint8_t nb_queue;\n+\t} tc_rxq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];\n+\t/** rx queues assigned to tc per Pool */\n+\tstruct {\n+\t\tuint8_t base;\n+\t\tuint8_t nb_queue;\n+\t} tc_txq[ETH_MAX_VMDQ_POOL][ETH_DCB_NUM_TCS];\n+};\n+\n+/**\n+ * A structure used to get the information of DCB.\n+ * It includes TC UP mapping and queue TC mapping.\n+ */\n+struct rte_eth_dcb_info {\n+\tuint8_t nb_tcs; /**< number of TCs */\n+\tuint8_t prio_tc[ETH_DCB_NUM_USER_PRIORITIES]; /**< Priority to tc */\n+\tuint8_t tc_bws[ETH_DCB_NUM_TCS]; /**< TX BW percentage for each TC */\n+\t/** rx queues assigned to tc */\n+\tstruct rte_eth_dcb_tc_queue_mapping tc_queue;\n+};\n+\n struct rte_eth_dev;\n \n struct rte_eth_dev_callback;\n@@ -1207,6 +1239,10 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,\n \t\t\t\t void *arg);\n /**< @internal Take operations to assigned filter type on an Ethernet device */\n \n+typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,\n+\t\t\t\t struct rte_eth_dcb_info *dcb_info);\n+/**< @internal Get dcb information on an Ethernet device */\n+\n /**\n * @internal A structure containing the functions exported by an Ethernet driver.\n */\n@@ -1312,6 +1348,9 @@ struct eth_dev_ops {\n \teth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;\n \t/** Read the IEEE1588/802.1AS TX timestamp. */\n \teth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;\n+\n+\t/** Get DCB information */\n+\teth_get_dcb_info get_dcb_info;\n };\n \n /**\n@@ -3321,6 +3360,21 @@ int rte_eth_dev_filter_ctrl(uint8_t port_id, enum rte_filter_type filter_type,\n \t\t\tenum rte_filter_op filter_op, void *arg);\n \n /**\n+ * Get DCB information on an Ethernet device.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param dcb_info\n+ * dcb information.\n+ * @return\n+ * - (0) if successful.\n+ * - (-ENODEV) if port identifier is invalid.\n+ * - (-ENOTSUP) if hardware doesn't support.\n+ */\n+int rte_eth_dev_get_dcb_info(uint8_t port_id,\n+\t\t\t struct rte_eth_dcb_info *dcb_info);\n+\n+/**\n * Add a callback to be called on packet RX on a given port and queue.\n *\n * This API configures a function to be called for each burst of\ndiff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map\nindex 8345a6c..3c4dc2d 100644\n--- a/lib/librte_ether/rte_ether_version.map\n+++ b/lib/librte_ether/rte_ether_version.map\n@@ -127,3 +127,10 @@ DPDK_2.1 {\n \trte_eth_timesync_read_tx_timestamp;\n \n } DPDK_2.0;\n+\n+DPDK_2.2 {\n+\tglobal:\n+\n+\trte_eth_dev_get_dcb_info;\n+\n+} DPDK_2.1;\n", "prefixes": [ "dpdk-dev", "v3", "5/9" ] }{ "id": 8497, "url": "