Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/76819/?format=api
http://patches.dpdk.org/api/patches/76819/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1599534347-20430-2-git-send-email-humin29@huawei.com/", "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": "<1599534347-20430-2-git-send-email-humin29@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1599534347-20430-2-git-send-email-humin29@huawei.com", "date": "2020-09-08T03:05:45", "name": "[1/3] ethdev: introduce FEC API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2846a51c20c9233aa1936fc3020626a2c475fa6e", "submitter": { "id": 1944, "url": "http://patches.dpdk.org/api/people/1944/?format=api", "name": "humin (Q)", "email": "humin29@huawei.com" }, "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/1599534347-20430-2-git-send-email-humin29@huawei.com/mbox/", "series": [ { "id": 12003, "url": "http://patches.dpdk.org/api/series/12003/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12003", "date": "2020-09-08T03:05:44", "name": "add FEC support", "version": 1, "mbox": "http://patches.dpdk.org/series/12003/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/76819/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/76819/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 0F036A04AA;\n\tTue, 8 Sep 2020 05:08:22 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1F8EA1C134;\n\tTue, 8 Sep 2020 05:08:17 +0200 (CEST)", "from huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by dpdk.org (Postfix) with ESMTP id 6B6DE1C11B\n for <dev@dpdk.org>; Tue, 8 Sep 2020 05:08:13 +0200 (CEST)", "from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60])\n by Forcepoint Email with ESMTP id 0A4C730197DC946D8A45;\n Tue, 8 Sep 2020 11:08:11 +0800 (CST)", "from localhost.localdomain (10.69.192.56) by\n DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id\n 14.3.487.0; Tue, 8 Sep 2020 11:08:05 +0800" ], "From": "\"Min Hu (Connor)\" <humin29@huawei.com>", "To": "<dev@dpdk.org>", "CC": "<thomas@monjalon.net>, <arybchenko@solarflare.com>,\n <ferruh.yigit@intel.com>, <linuxarm@huawei.com>", "Date": "Tue, 8 Sep 2020 11:05:45 +0800", "Message-ID": "<1599534347-20430-2-git-send-email-humin29@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1599534347-20430-1-git-send-email-humin29@huawei.com>", "References": "<1598614332-48508-1-git-send-email-humin29@huawei.com>\n <1599534347-20430-1-git-send-email-humin29@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Originating-IP": "[10.69.192.56]", "X-CFilter-Loop": "Reflected", "Subject": "[dpdk-dev] [PATCH 1/3] ethdev: introduce FEC API", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch adds Forward error correction(FEC) support for ethdev.\nIntroduce APIs which support query and config FEC information in\nhardware.\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nReviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nReviewed-by: Chengwen Feng <fengchengwen@huawei.com>\nReviewed-by: Chengchang Tang <tangchengchang@huawei.com>\n---\n lib/librte_ethdev/rte_ethdev.c | 50 +++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev.h | 74 ++++++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_core.h | 77 ++++++++++++++++++++++++++++++++\n lib/librte_ethdev/rte_ethdev_version.map | 5 +++\n 4 files changed, 206 insertions(+)", "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 7858ad5..b7ac791 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -3642,6 +3642,56 @@ rte_eth_led_off(uint16_t port_id)\n \treturn eth_err(port_id, (*dev->dev_ops->dev_led_off)(dev));\n }\n \n+int\n+rte_eth_fec_get_capability(uint16_t port_id, uint8_t *fec_cap)\n+{\n+\tstruct rte_eth_dev *dev;\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->fec_get_capability, -ENOTSUP);\n+\treturn eth_err(port_id, (*dev->dev_ops->fec_get_capability)(dev,\n+\t\t\t\t\t\t\t\tfec_cap));\n+}\n+\n+int\n+rte_eth_fec_get(uint16_t port_id, enum rte_fec_mode *mode)\n+{\n+\tstruct rte_eth_dev *dev;\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->fec_get, -ENOTSUP);\n+\treturn eth_err(port_id, (*dev->dev_ops->fec_get)(dev, mode));\n+}\n+\n+int\n+rte_eth_fec_set(uint16_t port_id, enum rte_fec_mode mode)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tuint8_t fec_mode_mask;\n+\tint ret;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\n+\tret = rte_eth_fec_get_capability(port_id, &fec_mode_mask);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\t/*\n+\t * Check whether the configured mode is within the FEC capability.\n+\t * If not, the configured mode will not be supported.\n+\t */\n+\tif (!(fec_mode_mask & (1U << (uint8_t)mode))) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"unsupported fec mode=%d\\n\", mode);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->fec_set, -ENOTSUP);\n+\treturn eth_err(port_id, (*dev->dev_ops->fec_set)(dev, mode));\n+}\n+\n /*\n * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find\n * an empty spot.\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 70295d7..23e069a 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1511,6 +1511,17 @@ struct rte_eth_dcb_info {\n \tstruct rte_eth_dcb_tc_queue_mapping tc_queue;\n };\n \n+/**\n+ * This enum indicates the possible (forward error correction)FEC modes\n+ * of an ethdev port.\n+ */\n+enum rte_fec_mode {\n+\tETH_FEC_NOFEC = 0, /**< FEC is off */\n+\tETH_FEC_BASER, /**< FEC using common algorithm */\n+\tETH_FEC_RS, /**< FEC using RS algorithm */\n+\tETH_FEC_AUTO /**< FEC autonegotiation modes */\n+};\n+\n #define RTE_ETH_ALL RTE_MAX_ETHPORTS\n \n /* Macros to check for valid port */\n@@ -3328,6 +3339,69 @@ int rte_eth_led_on(uint16_t port_id);\n int rte_eth_led_off(uint16_t port_id);\n \n /**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Get Forward Error Correction(FEC) capability.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param fec_cap\n+ * returns the FEC capability from the device, as follows:\n+ * bit0: nofec\n+ * bit1: baser\n+ * bit2: rs\n+ * bit3: auto\n+ * @return\n+ * - (0) if successful.\n+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support\n+ * that operation.\n+ * - (-EIO) if device is removed.\n+ * - (-ENODEV) if *port_id* invalid.\n+ */\n+__rte_experimental\n+int rte_eth_fec_get_capability(uint16_t port_id, uint8_t *fec_cap);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Get current Forward Error Correction(FEC) mode.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param mode\n+ * returns the FEC mode from the device.\n+ * @return\n+ * - (0) if successful.\n+ * - (-ENOTSUP) if underlying hardware OR driver doesn't support\n+ * that operation.\n+ * - (-EIO) if device is removed.\n+ * - (-ENODEV) if *port_id* invalid.\n+ */\n+__rte_experimental\n+int rte_eth_fec_get(uint16_t port_id, enum rte_fec_mode *mode);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Set Forward Error Correction(FEC) mode.\n+ *\n+ * @param port_id\n+ * The port identifier of the Ethernet device.\n+ * @param mode\n+ * the FEC mode.\n+ * @return\n+ * - (0) if successful.\n+ * - (-EINVAL) if the FEC mode is not valid.\n+ * - (-EIO) if device is removed.\n+ * - (-ENODEV) if *port_id* invalid.\n+ */\n+__rte_experimental\n+int rte_eth_fec_set(uint16_t port_id, enum rte_fec_mode mode);\n+\n+/**\n * Get current status of the Ethernet link flow control for Ethernet device\n *\n * @param port_id\ndiff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h\nindex 32407dd..efd9dc5 100644\n--- a/lib/librte_ethdev/rte_ethdev_core.h\n+++ b/lib/librte_ethdev/rte_ethdev_core.h\n@@ -604,6 +604,76 @@ typedef int (*eth_tx_hairpin_queue_setup_t)\n \t const struct rte_eth_hairpin_conf *hairpin_conf);\n \n /**\n+ * @internal\n+ * Get Forward Error Correction(FEC) capability.\n+ *\n+ * @param dev\n+ * ethdev handle of port.\n+ * @param fec_cap\n+ * returns the FEC capability from the device.\n+ *\n+ * @return\n+ * Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ * Success, get FEC success.\n+ * @retval -EOPNOTSUPP\n+ * opreation is not supported.\n+ * @retval -EIO\n+ * device is removed.\n+ * @retval -ENODEV\n+ * Device is gone.\n+ */\n+typedef int (*eth_fec_get_capability_t)(struct rte_eth_dev *dev,\n+\t\t\t\t\tuint8_t *fec_cap);\n+\n+/**\n+ * @internal\n+ * Get Forward Error Correction(FEC) mode.\n+ *\n+ * @param dev\n+ * ethdev handle of port.\n+ * @param mode\n+ * returns the FEC mode from the device.\n+ *\n+ * @return\n+ * Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ * Success, get FEC success.\n+ * @retval -EOPNOTSUPP\n+ * opreation is not supported.\n+ * @retval -EIO\n+ * device is removed.\n+ * @retval -ENODEV\n+ * Device is gone.\n+ */\n+typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev, enum rte_fec_mode *mode);\n+\n+/**\n+ * @internal\n+ * Set Forward Error Correction(FEC) mode.\n+ *\n+ * @param dev\n+ * ethdev handle of port.\n+ * @param mode\n+ * the FEC mode.\n+ *\n+ * @return\n+ * Negative errno value on error, 0 on success.\n+ *\n+ * @retval 0\n+ * Success, set FEC success.\n+ * @retval -EOPNOTSUPP\n+ * opreation is not supported.\n+ * @retval -EIO\n+ * device is removed.\n+ * @retval -ENODEV\n+ * Device is gone.\n+ */\n+typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, enum rte_fec_mode mode);\n+\n+/**\n * @internal A structure containing the functions exported by an Ethernet driver.\n */\n struct eth_dev_ops {\n@@ -752,6 +822,13 @@ struct eth_dev_ops {\n \t/**< Set up device RX hairpin queue. */\n \teth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;\n \t/**< Set up device TX hairpin queue. */\n+\n+\teth_fec_get_capability_t fec_get_capability;\n+\t/**< Get Forward Error Correction(FEC) capability; */\n+\teth_fec_get_t fec_get;\n+\t/**< Get Forward Error Correction(FEC) mode; */\n+\teth_fec_set_t fec_set;\n+\t/**< Set Forward Error Correction(FEC) mode; */\n };\n \n /**\ndiff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map\nindex 1212a17..33cf5e4 100644\n--- a/lib/librte_ethdev/rte_ethdev_version.map\n+++ b/lib/librte_ethdev/rte_ethdev_version.map\n@@ -241,6 +241,11 @@ EXPERIMENTAL {\n \t__rte_ethdev_trace_rx_burst;\n \t__rte_ethdev_trace_tx_burst;\n \trte_flow_get_aged_flows;\n+\n+\t# added in 20.11\n+\trte_eth_fec_get_capability;\n+\trte_eth_fec_get;\n+\trte_eth_fec_set;\n };\n \n INTERNAL {\n", "prefixes": [ "1/3" ] }{ "id": 76819, "url": "