From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1297A0A0E for ; Mon, 10 May 2021 18:04:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EB5194003E; Mon, 10 May 2021 18:04:36 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2052.outbound.protection.outlook.com [40.107.244.52]) by mails.dpdk.org (Postfix) with ESMTP id 0418141104 for ; Mon, 10 May 2021 18:04:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WurCoMggy00DVHyQxnJUreEdgzUnLyD6w6UjEQeSJ3CsNnLHyjESGWyWsCfHnN/euj7Bo09swbuKH2k1PLqw5XGSF0VFf7aFz7jO4gro4C8BzfkEco2MKsZxTbnGF4CzTPZPCn74xtAdaszRn/aZWO3sh3aNj5ve2NS+2Z7bO9+Z0TteZyr5v4UQvCtlTKHaYKMjD36Xm1TCsrNcLjanWz40GQLnOWD4prhldX6r5sMvUf/POF1tS7k/lR2Rb3O9KS92nYAsGVLq7qDRGR0acPIh1b9OCj8A8ndZ5wjyZqWOgb2RIBOUR+BUK/qw9HBe22s79pIrEE4zBSn7wZZCaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C6rHrCT55oP02u+w8FQMJOCDf9D84JvraSGO/si53D0=; b=eItlcUhntgSCX+YXtBUB80WNm+C3UqSpTJd2dS0kcUCkQzujMGjB2THIMAVvbIXjlAh+TaU/JlT3sS/qJZqTx7TPbr9767fs4GjNSLp9AQmndg5E8IIeuOxJn4w/ajduykE/MTR8NJaT7IzgQ7HLnlH2EKOespfvC2d8ZV8hRGR7Gpau4I0gei6foGMz5KlTtwnALJVb4hu9iI5AYXhUDXtP+7BP5ljEvJ0YiEtVidVDgqONeZ4ihlEE4XH4AdCCE/DMdOY6b3fmXaKbMc6MGIpCM5H2/Q5+wLyx3RKsp5TghWwANBaaIWu4nIOOCVmd0M+2wbOA9nBICaZI7P3cQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=nxp.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C6rHrCT55oP02u+w8FQMJOCDf9D84JvraSGO/si53D0=; b=t/FnfZoFB0VzYvPZXJBDCaa4HmalnbDSpUaEuRmvCasNGgWF4JBlkCE6KPuSu/urj79wXTDyOLq3vAkv2d7ngB6cEWRf9Y62ruIsZynwbHttsta+ZC1PP4yzDvLO0jmRiL9tV5sDv1HgSwbF1zZm48W9B6GZzF8l6JIIODy29CX6GSU5zNUO+YqSNwAkRA2vOS4NW3KYr2ALuCBWI7Hcv9rqxI/dLaYSLa3SQDoK+uSabAFQWQvYwNpkb09eLEn1VzOdHGHFH9BhYPqzR8X2k7CnxokkfJ5QAuWNao1mXMxUYd1F7+ner42MxFABtqxoZ6wNRZ7/GsI4FxZnrEochA== Received: from BN8PR07CA0019.namprd07.prod.outlook.com (2603:10b6:408:ac::32) by DM6PR12MB2971.namprd12.prod.outlook.com (2603:10b6:5:118::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Mon, 10 May 2021 16:04:33 +0000 Received: from BN8NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::7e) by BN8PR07CA0019.outlook.office365.com (2603:10b6:408:ac::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:04:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT064.mail.protection.outlook.com (10.13.176.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:04:33 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:04:30 +0000 From: Xueming Li To: Rohit Raj CC: Luca Boccassi , Hemant Agrawal , dpdk stable Date: Mon, 10 May 2021 23:59:22 +0800 Message-ID: <20210510160258.30982-13-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6c64f5d-bab1-47cf-feb1-08d913cd4d24 X-MS-TrafficTypeDiagnostic: DM6PR12MB2971: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PAa1NYoqTJMt8dfhbLAaU8ia2NALowdkolvOsuH63tcG8/tX0g8e0+NU7PjFDs9qUxKiB0xJ/lbKo464hgk5UK/3arZ2hP4TzaIYzw9za/ZNsGLeWpZmOfEknvpxG3fpLU/EQOGwlrUsk8xoXH46tAMwn/SoXUttijaz2cmiOptlBQtLbgcLSMMLK0HlJG1kekv0/8ffrGF1inPxUQeq7E0G5CBIWqstTmJS27oJIpUjPlnJRAstUhCyO6nMYWZ9qqmaRG5FejPRNwpPyXyXhHcWTp4yloskszZcZwPkRBmr7Y8TI9Bt/netPRMEnc2b3cKYKskx8htisiapC+AJQRcHTYU4ctoV5pVuqzQ7L4HaRPlOWp2gP6ST8K5+b7foxFj/02akQ5/Ln372IxJb9iBtjaPElVdCCnBQUrSvsK5JeXOovhhDar04Y+YOEtcFwceD7B8crx1FTPQeJrp7XsQ69w6Y0FPjChqvLBrzsWBhTLm+bd8F3OZSP2rsNRrXHjQpRa6WOMQz4IKetFAC+WO4XfG3Dj/XWGc/zhKJSdS5VHa3lJ1gLBKKRNo9DB3cKDT9rcnoFwVVsvJb4jvi4NqjeEOR8ET+yDl3uJvnDAieLtCpIHMXpBm+T6yY0B4N3NMvIHyfS2nyeeY6Igh0weniRpwxKxhu5hTIucfSUCTa3yzsYHzK8+0BG7fiuL8/IaYiFuihddRS/griz66cyegwkKF3W+t9StZtFYv8vOM= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(136003)(39860400002)(36840700001)(46966006)(26005)(7696005)(86362001)(36756003)(36906005)(6286002)(36860700001)(966005)(478600001)(356005)(336012)(426003)(2616005)(82740400003)(6916009)(7636003)(5660300002)(70586007)(2906002)(55016002)(53546011)(83380400001)(16526019)(6666004)(54906003)(47076005)(8936002)(82310400003)(316002)(186003)(8676002)(70206006)(4326008)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:04:33.1340 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6c64f5d-bab1-47cf-feb1-08d913cd4d24 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2971 Subject: [dpdk-stable] patch 'net/dpaa2: fix getting link status' has been queued to stable release 20.11.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/d287fda7da82a6224290ac9b3548d34d43593b32 Thanks. Xueming Li --- >From d287fda7da82a6224290ac9b3548d34d43593b32 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Wed, 24 Feb 2021 18:12:51 +0530 Subject: [PATCH] net/dpaa2: fix getting link status Cc: Luca Boccassi [ upstream commit eadcfd95ffde80b679b757d060f889f683c96266 ] According to DPDK Documentation, rte_eth_link_get API can wait up to 9 seconds for auto-negotiation to finish and then returns link status. In current implementation of rte_eth_link_get API in DPAA2 drivers, it was not waiting for auto negotiation to finish and was returning link status DOWN It can cause issues with DPDK applications which relies on rte_eth_link_get API for link status and does not support link status interrupt. Similar kind of issue was seen in TRex Application. This patch fixes this bug by adding wait for up to 9 seconds for auto negotiation to finish. Fixes: c56c86ff87c1 ("net/dpaa2: update link status") Signed-off-by: Rohit Raj Acked-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_ethdev.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 6f38da3cce..5c1a12b841 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -31,6 +31,8 @@ #define DRIVER_LOOPBACK_MODE "drv_loopback" #define DRIVER_NO_PREFETCH_MODE "drv_no_prefetch" +#define CHECK_INTERVAL 100 /* 100ms */ +#define MAX_REPEAT_TIME 90 /* 9s (90 * 100ms) in total */ /* Supported Rx offloads */ static uint64_t dev_rx_offloads_sup = @@ -1805,23 +1807,32 @@ error: /* return 0 means link status changed, -1 means not changed */ static int dpaa2_dev_link_update(struct rte_eth_dev *dev, - int wait_to_complete __rte_unused) + int wait_to_complete) { int ret; struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)dev->process_private; struct rte_eth_link link; struct dpni_link_state state = {0}; + uint8_t count; if (dpni == NULL) { DPAA2_PMD_ERR("dpni is NULL"); return 0; } - ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, &state); - if (ret < 0) { - DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); - return -1; + for (count = 0; count <= MAX_REPEAT_TIME; count++) { + ret = dpni_get_link_state(dpni, CMD_PRI_LOW, priv->token, + &state); + if (ret < 0) { + DPAA2_PMD_DEBUG("error: dpni_get_link_state %d", ret); + return -1; + } + if (state.up == ETH_LINK_DOWN && + wait_to_complete) + rte_delay_ms(CHECK_INTERVAL); + else + break; } memset(&link, 0, sizeof(struct rte_eth_link)); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:27.058958500 +0800 +++ 0014-net-dpaa2-fix-getting-link-status.patch 2021-05-10 23:59:26.330000000 +0800 @@ -1 +1 @@ -From eadcfd95ffde80b679b757d060f889f683c96266 Mon Sep 17 00:00:00 2001 +From d287fda7da82a6224290ac9b3548d34d43593b32 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit eadcfd95ffde80b679b757d060f889f683c96266 ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -30 +32 @@ -index 38774e255b..a81c73438e 100644 +index 6f38da3cce..5c1a12b841 100644