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 21918A0A0E for ; Mon, 10 May 2021 18:12:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1AE3240147; Mon, 10 May 2021 18:12:24 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2062.outbound.protection.outlook.com [40.107.94.62]) by mails.dpdk.org (Postfix) with ESMTP id 3FF5440140 for ; Mon, 10 May 2021 18:12:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eq1i1k1pl+bCtj57peQ+q5plfY7LPUKOVSqZ7rZsoVSkUknlTdfNGXafNZC3fgUNDJ5rIwfZlJFvJGXPQMyZGpU4bx0E4my9SRNBx9ESaCUzmyRJKW1p64e5LJjx2/NwmcNeT6gX0velwQpNk4Z+po+CfbQqvuceA98CB6XjKxfDO46AKPtK7wJfdyKrTfXJmPCOxXOcVc8pA0pdFV/XcxcxTiviqicfCgZO97elx8ZD7m0arkNikfkPr0xKBxWWLJQVCApuIHlUhe+54HJ2iABPGXlVUTvcH7+EztcT5Y25fhQXTP8n5/JdViTqRMg6dZL15xEpQSTJe5fLQsmflQ== 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=KhEgrey2Wsy21MW8FPGP0CK18Jwww2tUiitqt8/eQLA=; b=KW/UreJ6t4Oz3Zh/fI2ZLSOLboQRROyuIabA2XG1YW7N2ju7RrPxYhuzlEBp+i8YJhRiPJlc8ADk2b2jQvuqoXOwccjDSsrveGQSwXLcW7IAUcTnl6p3tbppvKud/q+W1GRlabuKJE1tAmIWWlwUdjYiu/mmjLSz+O6VTlS6zVqz9boBliWhA0MAZt1Nn5KmSAxSMmZf0GYh5edMDXl54jYKlyQg2m0suaqfi2wMEXo+gJBRPj6fmN4kVLqpmcNc1yvZnVVKYe5HAzporXE0qBVybflpRJ3Gz581Fpv1VfyOx6QHJVVCbaIgqFSI/HdIn1Zwfa4n7QZwP9E3fiOnBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=broadcom.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=KhEgrey2Wsy21MW8FPGP0CK18Jwww2tUiitqt8/eQLA=; b=dvLYEMQwrUFJju+vY6yi0TyCTx+iYF615q09z7ur/Wim4NmM8VqghbZPFJJvXRyMjsu+B0kU0WyCfjVthEgu0VEtfRt7k0trGs1py4IhQ9ouTac3VHNh2NwiiTprnF9LbjIZbEykm8eoJ7oplp0BZlzbfXtSdUx0ZPRIFqjfluGIqUe/TZpZzp8zvzSS/ORipgHrlGb5J98J6zIALipmV3adMu7t9v6U980qDIelH8M/H6yjalmXz3DJoUFBNMiDkW46uBIX3W2X9aSoJF0lsSj9Uioz7sYuqk7o7uEFKnDwlA7/L1e0+tmzAWwneb5eab1bdDJTukl2fZ2sBNkBcg== Received: from MW4PR03CA0068.namprd03.prod.outlook.com (2603:10b6:303:b6::13) by MWHPR1201MB0015.namprd12.prod.outlook.com (2603:10b6:300:df::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Mon, 10 May 2021 16:12:20 +0000 Received: from CO1NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b6:cafe::84) by MW4PR03CA0068.outlook.office365.com (2603:10b6:303:b6::13) 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:12:20 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; broadcom.com; dkim=none (message not signed) header.d=none;broadcom.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 CO1NAM11FT048.mail.protection.outlook.com (10.13.175.148) 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:12:20 +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:12:17 +0000 From: Xueming Li To: Kalesh AP CC: Luca Boccassi , Ajit Khaparde , Somnath Kotur , dpdk stable Date: Tue, 11 May 2021 00:00:40 +0800 Message-ID: <20210510160258.30982-91-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: 6b1d7f0a-0813-47ce-2ef4-08d913ce6386 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0015: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1mKbwTVEKm1LdtDeEjYI4EbGseZWxr9GZUu4Qog3dxttvbw5dLq+P3C41vpNZkPB0zqEUplhicMLtKX4Zr2WfbIxsmEH37Wy6b5G9bz6J7IOFwUH6mGtvQKJg6yA9ilAJGhKE2skAnwtvIMf+4w4hB2kYAwcVdzk1sonFHkJHkklFB4KV7M4uXqyj92UdOxHzwq9QKvjVWxw0MPL5eMImGtDaoTw56fRNWZVr8azpCZSjiEzeV2cl0/BcoOk9ziwYQssPZ3+biOedS3WfA6AqNMRsDb3AKxWv2HYTmWRl3V+SWGbapLwdbS5TL27ehslkA9flmDIDYHLSVxHSO6D89bGpFzmsdR6m/AfDODLIvzjIkSzqUE8wz71bc/iL8tN/xbadyfAlJwgz0A4uCpJBHgYxBwsV8O0cOGu0+Yx7s1nqg2PNd3LTGenZ5tQK+XQQQxgphpvrmZAJKJjTyxPpWl81oru/VZpzzxCmMll4Wmekqo55YYgu6MyZkBFSHLgtjTnwsxrSLovq0+3OK3wig57us75XFc8btdSbEp81o2WaLd4qR2+szccO8//G7uHJOu1dnSww6yhDzH65mcfOLhQPgiqZtLIvUUqscDb5eQyyWZqPQzIE94vW0Tri9UgH5wp49PJiDHB95tZ83VXMSm3Db+Je+01/E0pAIxmDh7sFHbsP4E709CRZJntS4ilZLMNLmYsGpdwbT5LMAf6d8aRLW5XOqY5bF02pDPlnMHh7tIOCO///Z2WPIHohdeBmcF49o13h+XxiQbTpayug== 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)(376002)(39860400002)(346002)(396003)(136003)(36840700001)(46966006)(53546011)(966005)(6286002)(2906002)(6666004)(36756003)(70206006)(6916009)(47076005)(83380400001)(8936002)(7696005)(186003)(16526019)(36860700001)(70586007)(336012)(5660300002)(86362001)(82310400003)(26005)(82740400003)(356005)(7636003)(1076003)(426003)(2616005)(478600001)(54906003)(36906005)(4326008)(55016002)(8676002)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:12:20.2515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b1d7f0a-0813-47ce-2ef4-08d913ce6386 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: CO1NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0015 Subject: [dpdk-stable] patch 'net/bnxt: fix timesync when PTP is not supported' 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/6260a81282190cf7e019ada470ea062a321f302c Thanks. Xueming Li --- >From 6260a81282190cf7e019ada470ea062a321f302c Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Thu, 18 Mar 2021 15:05:23 +0530 Subject: [PATCH] net/bnxt: fix timesync when PTP is not supported Cc: Luca Boccassi [ upstream commit ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 ] Fixed to return error when PTP support is not supported on the port. Also, removed an unnecessary check inside bnxt_get_rx_ts(). Fixes: b11cceb83a34 ("net/bnxt: support timesync") Signed-off-by: Kalesh AP Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_ethdev.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index d70e37ca60..b719cd74c4 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -3198,9 +3198,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts) uint16_t port_id; uint32_t fifo; - if (!ptp) - return -ENODEV; - fifo = rte_le_to_cpu_32(rte_read32((uint8_t *)bp->bar0 + ptp->rx_mapped_regs[BNXT_PTP_RX_FIFO])); if (!(fifo & BNXT_PTP_RX_FIFO_PENDING)) @@ -3233,7 +3230,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ns = rte_timespec_to_ns(ts); /* Set the timecounters to a new value. */ @@ -3253,7 +3250,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) int rc = 0; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_CURRENT_TIME, @@ -3275,7 +3272,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev) int rc; if (!ptp) - return 0; + return -ENOTSUP; ptp->rx_filter = 1; ptp->tx_tstamp_en = 1; @@ -3314,7 +3311,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev) struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ptp->rx_filter = 0; ptp->tx_tstamp_en = 0; @@ -3339,7 +3336,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev, uint64_t ns; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rx_tstamp_cycles = ptp->rx_timestamp; @@ -3362,7 +3359,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev, int rc = 0; if (!ptp) - return 0; + return -ENOTSUP; if (BNXT_CHIP_THOR(bp)) rc = bnxt_hwrm_port_ts_query(bp, BNXT_PTP_FLAGS_PATH_TX, @@ -3383,7 +3380,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta) struct bnxt_ptp_cfg *ptp = bp->ptp_cfg; if (!ptp) - return 0; + return -ENOTSUP; ptp->tc.nsec += delta; ptp->tx_tstamp_tc.nsec += delta; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:28.978051400 +0800 +++ 0092-net-bnxt-fix-timesync-when-PTP-is-not-supported.patch 2021-05-10 23:59:26.460000000 +0800 @@ -1 +1 @@ -From ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 Mon Sep 17 00:00:00 2001 +From 6260a81282190cf7e019ada470ea062a321f302c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit ab15dd5a1c4d563e80b10e42e39c4d2f010fa389 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 4bdc8223d3..646cc94bd8 100644 +index d70e37ca60..b719cd74c4 100644 @@ -23 +25 @@ -@@ -3399,9 +3399,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts) +@@ -3198,9 +3198,6 @@ static int bnxt_get_rx_ts(struct bnxt *bp, uint64_t *ts) @@ -33 +35 @@ -@@ -3434,7 +3431,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) +@@ -3233,7 +3230,7 @@ bnxt_timesync_write_time(struct rte_eth_dev *dev, const struct timespec *ts) @@ -42 +44 @@ -@@ -3454,7 +3451,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) +@@ -3253,7 +3250,7 @@ bnxt_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts) @@ -49 +51 @@ - if (BNXT_CHIP_P5(bp)) + if (BNXT_CHIP_THOR(bp)) @@ -51 +53 @@ -@@ -3476,7 +3473,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev) +@@ -3275,7 +3272,7 @@ bnxt_timesync_enable(struct rte_eth_dev *dev) @@ -60 +62 @@ -@@ -3517,7 +3514,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev) +@@ -3314,7 +3311,7 @@ bnxt_timesync_disable(struct rte_eth_dev *dev) @@ -69 +71 @@ -@@ -3544,7 +3541,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev, +@@ -3339,7 +3336,7 @@ bnxt_timesync_read_rx_timestamp(struct rte_eth_dev *dev, @@ -76 +78 @@ - if (BNXT_CHIP_P5(bp)) + if (BNXT_CHIP_THOR(bp)) @@ -78 +80 @@ -@@ -3567,7 +3564,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev, +@@ -3362,7 +3359,7 @@ bnxt_timesync_read_tx_timestamp(struct rte_eth_dev *dev, @@ -85 +87 @@ - if (BNXT_CHIP_P5(bp)) + if (BNXT_CHIP_THOR(bp)) @@ -87 +89 @@ -@@ -3588,7 +3585,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta) +@@ -3383,7 +3380,7 @@ bnxt_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta)