Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/87858/?format=api
http://patches.dpdk.org/api/patches/87858/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210211141620.12482-4-hemant.agrawal@nxp.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": "<20210211141620.12482-4-hemant.agrawal@nxp.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210211141620.12482-4-hemant.agrawal@nxp.com", "date": "2021-02-11T14:16:03", "name": "[v2,03/20] net/dpaa2: fix link get API implementation", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "b9b34e1995c88a52bfab9992e021592ea23a8e71", "submitter": { "id": 477, "url": "http://patches.dpdk.org/api/people/477/?format=api", "name": "Hemant Agrawal", "email": "hemant.agrawal@nxp.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/20210211141620.12482-4-hemant.agrawal@nxp.com/mbox/", "series": [ { "id": 15239, "url": "http://patches.dpdk.org/api/series/15239/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15239", "date": "2021-02-11T14:16:00", "name": "NXP DPAAx ethernet PMD changes", "version": 2, "mbox": "http://patches.dpdk.org/series/15239/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/87858/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/87858/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2B4FCA054A;\n\tThu, 11 Feb 2021 15:28:25 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 52DB11CC55D;\n\tThu, 11 Feb 2021 15:28:04 +0100 (CET)", "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by mails.dpdk.org (Postfix) with ESMTP id 46E3E1CC38A\n for <dev@dpdk.org>; Thu, 11 Feb 2021 15:28:00 +0100 (CET)", "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C77BD1A05EF;\n Thu, 11 Feb 2021 15:27:59 +0100 (CET)", "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 8740C1A05D6;\n Thu, 11 Feb 2021 15:27:58 +0100 (CET)", "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 86986402D0;\n Thu, 11 Feb 2021 15:27:56 +0100 (CET)" ], "From": "Hemant Agrawal <hemant.agrawal@nxp.com>", "To": "dev@dpdk.org,\n\tferruh.yigit@intel.com", "Date": "Thu, 11 Feb 2021 19:46:03 +0530", "Message-Id": "<20210211141620.12482-4-hemant.agrawal@nxp.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210211141620.12482-1-hemant.agrawal@nxp.com>", "References": "<20210120142723.14090-1-hemant.agrawal@nxp.com>\n <20210211141620.12482-1-hemant.agrawal@nxp.com>", "X-Virus-Scanned": "ClamAV using ClamSMTP", "Subject": "[dpdk-dev] [PATCH v2 03/20] net/dpaa2: fix link get API\n implementation", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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": "From: Rohit Raj <rohit.raj@nxp.com>\n\nAccording to DPDK Documentation, rte_eth_link_get API can wait upto 9\nseconds for auto-negotiation to finish and then returns link status.\n\nIn current implementation of rte_eth_link_get API in DPAA2 drivers, it\nwasn't waiting for auto negotiation to finish and was returning link\nstatus DOWN\nIt can cause issues with DPDK applications which relies on\nrte_eth_link_get API for link status and doesn't support link status\ninterrupt.\nSimilar kind of issue was seen in TRex Application.\n\nThis patch fixes this bug by adding wait for up to 9 seconds for auto\nnegotiation to finish.\n\nFixes: c56c86ff87c1 (\"net/dpaa2: update link status\")\nCc: stable@dpdk.org\n\nSigned-off-by: Rohit Raj <rohit.raj@nxp.com>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++-----\n 1 file changed, 16 insertions(+), 5 deletions(-)", "diff": "diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c\nindex 38774e255b..a81c73438e 100644\n--- a/drivers/net/dpaa2/dpaa2_ethdev.c\n+++ b/drivers/net/dpaa2/dpaa2_ethdev.c\n@@ -31,6 +31,8 @@\n \n #define DRIVER_LOOPBACK_MODE \"drv_loopback\"\n #define DRIVER_NO_PREFETCH_MODE \"drv_no_prefetch\"\n+#define CHECK_INTERVAL 100 /* 100ms */\n+#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */\n \n /* Supported Rx offloads */\n static uint64_t dev_rx_offloads_sup =\n@@ -1805,23 +1807,32 @@ dpaa2_dev_stats_reset(struct rte_eth_dev *dev)\n /* return 0 means link status changed, -1 means not changed */\n static int\n dpaa2_dev_link_update(struct rte_eth_dev *dev,\n-\t\t\tint wait_to_complete __rte_unused)\n+\t\t int wait_to_complete)\n {\n \tint ret;\n \tstruct dpaa2_dev_priv *priv = dev->data->dev_private;\n \tstruct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private;\n \tstruct rte_eth_link link;\n \tstruct dpni_link_state state = {0};\n+\tuint8_t count;\n \n \tif (dpni == NULL) {\n \t\tDPAA2_PMD_ERR(\"dpni is NULL\");\n \t\treturn 0;\n \t}\n \n-\tret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state);\n-\tif (ret < 0) {\n-\t\tDPAA2_PMD_DEBUG(\"error: dpni_get_link_state %d\", ret);\n-\t\treturn -1;\n+\tfor (count = 0; count <= MAX_REPEAT_TIME; count++) {\n+\t\tret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token,\n+\t\t\t\t\t &state);\n+\t\tif (ret < 0) {\n+\t\t\tDPAA2_PMD_DEBUG(\"error: dpni_get_link_state %d\", ret);\n+\t\t\treturn -1;\n+\t\t}\n+\t\tif (state.up == ETH_LINK_DOWN &&\n+\t\t wait_to_complete)\n+\t\t\trte_delay_ms(CHECK_INTERVAL);\n+\t\telse\n+\t\t\tbreak;\n \t}\n \n \tmemset(&link, 0, sizeof(struct rte_eth_link));\n", "prefixes": [ "v2", "03/20" ] }{ "id": 87858, "url": "