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 A320342ECF for ; Thu, 20 Jul 2023 17:30:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F479427F5; Thu, 20 Jul 2023 17:30:45 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 62467400D6 for ; Thu, 20 Jul 2023 17:30:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689867043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FofVl+gf9mGHa2o3cYwp7p+UxdVMqsFrxXfO0hZxSsA=; b=cJD2x4+029gQSc35y0gbmh83YXuZFT81sSzFBZw2J8hEj8ooG21NyZU9glldymgChXR/5O YPsr6u8G4f1M4sqrBMKx+Xl8/RzWfO2dKccZ0qjPasO5Me19NzOOjxQsQ2ghL7LlShxhgi PgyVcfOYuryH6cS18wfr0gwaZmCjPsw= Received: from mimecast-mx02.redhat.com (66.187.233.88 [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-453-Q17ICinMPher1Bz8o0dcFg-1; Thu, 20 Jul 2023 11:21:25 -0400 X-MC-Unique: Q17ICinMPher1Bz8o0dcFg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F07EF196EF89; Thu, 20 Jul 2023 15:20:57 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id D04E9492C13; Thu, 20 Jul 2023 15:20:56 +0000 (UTC) From: Kevin Traynor To: Huisong Li Cc: Dongdong Liu , dpdk stable Subject: patch 'net/hns3: extract PTP to its own header file' has been queued to stable release 21.11.5 Date: Thu, 20 Jul 2023 16:17:52 +0100 Message-ID: <20230720151942.262154-41-ktraynor@redhat.com> In-Reply-To: <20230720151942.262154-1-ktraynor@redhat.com> References: <20230720151942.262154-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/25/23. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/37164c253777acd6fd83d605621b7faf194118a8 Thanks. Kevin --- >From 37164c253777acd6fd83d605621b7faf194118a8 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Fri, 2 Jun 2023 19:41:58 +0800 Subject: [PATCH] net/hns3: extract PTP to its own header file [ upstream commit 78399874af509e129c13c6771aafa8f27c456c95 ] This patch extracts a PTP header file to contain PTP registers and external API in order to make PTP code structure more clear. Fixes: 38b539d96eb6 ("net/hns3: support IEEE 1588 PTP") Signed-off-by: Huisong Li Signed-off-by: Dongdong Liu --- drivers/net/hns3/hns3_ethdev.c | 1 + drivers/net/hns3/hns3_ethdev.h | 17 ------------ drivers/net/hns3/hns3_ptp.c | 2 +- drivers/net/hns3/hns3_ptp.h | 48 ++++++++++++++++++++++++++++++++++ drivers/net/hns3/hns3_regs.h | 23 ---------------- 5 files changed, 50 insertions(+), 41 deletions(-) create mode 100644 drivers/net/hns3/hns3_ptp.h diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 0ee6a4e948..f61509a281 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -17,4 +17,5 @@ #include "hns3_mp.h" #include "hns3_flow.h" +#include "hns3_ptp.h" #define HNS3_SERVICE_INTERVAL 1000000 /* us */ diff --git a/drivers/net/hns3/hns3_ethdev.h b/drivers/net/hns3/hns3_ethdev.h index 6c07075867..878d4ae492 100644 --- a/drivers/net/hns3/hns3_ethdev.h +++ b/drivers/net/hns3/hns3_ethdev.h @@ -1041,21 +1041,4 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, void hns3vf_update_push_lsc_cap(struct hns3_hw *hw, bool supported); -int hns3_restore_ptp(struct hns3_adapter *hns); -int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev, - struct rte_eth_conf *conf); -int hns3_ptp_init(struct hns3_hw *hw); -void hns3_ptp_uninit(struct hns3_hw *hw); -int hns3_timesync_enable(struct rte_eth_dev *dev); -int hns3_timesync_disable(struct rte_eth_dev *dev); -int hns3_timesync_read_rx_timestamp(struct rte_eth_dev *dev, - struct timespec *timestamp, - uint32_t flags __rte_unused); -int hns3_timesync_read_tx_timestamp(struct rte_eth_dev *dev, - struct timespec *timestamp); -int hns3_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts); -int hns3_timesync_write_time(struct rte_eth_dev *dev, - const struct timespec *ts); -int hns3_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta); - static inline bool is_reset_pending(struct hns3_adapter *hns) diff --git a/drivers/net/hns3/hns3_ptp.c b/drivers/net/hns3/hns3_ptp.c index 0e17a17034..894ac6dd71 100644 --- a/drivers/net/hns3/hns3_ptp.c +++ b/drivers/net/hns3/hns3_ptp.c @@ -8,5 +8,5 @@ #include "hns3_ethdev.h" -#include "hns3_regs.h" +#include "hns3_ptp.h" #include "hns3_logs.h" diff --git a/drivers/net/hns3/hns3_ptp.h b/drivers/net/hns3/hns3_ptp.h new file mode 100644 index 0000000000..2b8717fa3c --- /dev/null +++ b/drivers/net/hns3/hns3_ptp.h @@ -0,0 +1,48 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 HiSilicon Limited. + */ + +#ifndef HNS3_PTP_H +#define HNS3_PTP_H + +/* Register bit for 1588 event */ +#define HNS3_VECTOR0_1588_INT_B 0 + +#define HNS3_PTP_BASE_ADDRESS 0x29000 + +#define HNS3_TX_1588_SEQID_BACK (HNS3_PTP_BASE_ADDRESS + 0x0) +#define HNS3_TX_1588_TSP_BACK_0 (HNS3_PTP_BASE_ADDRESS + 0x4) +#define HNS3_TX_1588_TSP_BACK_1 (HNS3_PTP_BASE_ADDRESS + 0x8) +#define HNS3_TX_1588_TSP_BACK_2 (HNS3_PTP_BASE_ADDRESS + 0xc) + +#define HNS3_TX_1588_BACK_TSP_CNT (HNS3_PTP_BASE_ADDRESS + 0x30) + +#define HNS3_CFG_TIME_SYNC_H (HNS3_PTP_BASE_ADDRESS + 0x50) +#define HNS3_CFG_TIME_SYNC_M (HNS3_PTP_BASE_ADDRESS + 0x54) +#define HNS3_CFG_TIME_SYNC_L (HNS3_PTP_BASE_ADDRESS + 0x58) +#define HNS3_CFG_TIME_SYNC_RDY (HNS3_PTP_BASE_ADDRESS + 0x5c) + +#define HNS3_CFG_TIME_CYC_EN (HNS3_PTP_BASE_ADDRESS + 0x70) + +#define HNS3_CURR_TIME_OUT_H (HNS3_PTP_BASE_ADDRESS + 0x74) +#define HNS3_CURR_TIME_OUT_L (HNS3_PTP_BASE_ADDRESS + 0x78) +#define HNS3_CURR_TIME_OUT_NS (HNS3_PTP_BASE_ADDRESS + 0x7c) + +int hns3_restore_ptp(struct hns3_adapter *hns); +int hns3_mbuf_dyn_rx_timestamp_register(struct rte_eth_dev *dev, + struct rte_eth_conf *conf); +int hns3_ptp_init(struct hns3_hw *hw); +void hns3_ptp_uninit(struct hns3_hw *hw); +int hns3_timesync_enable(struct rte_eth_dev *dev); +int hns3_timesync_disable(struct rte_eth_dev *dev); +int hns3_timesync_read_rx_timestamp(struct rte_eth_dev *dev, + struct timespec *timestamp, + uint32_t flags __rte_unused); +int hns3_timesync_read_tx_timestamp(struct rte_eth_dev *dev, + struct timespec *timestamp); +int hns3_timesync_read_time(struct rte_eth_dev *dev, struct timespec *ts); +int hns3_timesync_write_time(struct rte_eth_dev *dev, + const struct timespec *ts); +int hns3_timesync_adjust_time(struct rte_eth_dev *dev, int64_t delta); + +#endif /* HNS3_PTP_H */ diff --git a/drivers/net/hns3/hns3_regs.h b/drivers/net/hns3/hns3_regs.h index 5812eb39db..d5f9d0ae9f 100644 --- a/drivers/net/hns3/hns3_regs.h +++ b/drivers/net/hns3/hns3_regs.h @@ -122,27 +122,4 @@ #define HNS3_TQP_INTR_QL_DEFAULT 0 -/* Register bit for 1588 event */ -#define HNS3_VECTOR0_1588_INT_B 0 - -#define HNS3_PTP_BASE_ADDRESS 0x29000 - -#define HNS3_TX_1588_SEQID_BACK (HNS3_PTP_BASE_ADDRESS + 0x0) -#define HNS3_TX_1588_TSP_BACK_0 (HNS3_PTP_BASE_ADDRESS + 0x4) -#define HNS3_TX_1588_TSP_BACK_1 (HNS3_PTP_BASE_ADDRESS + 0x8) -#define HNS3_TX_1588_TSP_BACK_2 (HNS3_PTP_BASE_ADDRESS + 0xc) - -#define HNS3_TX_1588_BACK_TSP_CNT (HNS3_PTP_BASE_ADDRESS + 0x30) - -#define HNS3_CFG_TIME_SYNC_H (HNS3_PTP_BASE_ADDRESS + 0x50) -#define HNS3_CFG_TIME_SYNC_M (HNS3_PTP_BASE_ADDRESS + 0x54) -#define HNS3_CFG_TIME_SYNC_L (HNS3_PTP_BASE_ADDRESS + 0x58) -#define HNS3_CFG_TIME_SYNC_RDY (HNS3_PTP_BASE_ADDRESS + 0x5c) - -#define HNS3_CFG_TIME_CYC_EN (HNS3_PTP_BASE_ADDRESS + 0x70) - -#define HNS3_CURR_TIME_OUT_H (HNS3_PTP_BASE_ADDRESS + 0x74) -#define HNS3_CURR_TIME_OUT_L (HNS3_PTP_BASE_ADDRESS + 0x78) -#define HNS3_CURR_TIME_OUT_NS (HNS3_PTP_BASE_ADDRESS + 0x7c) - /* gl_usec convert to hardware count, as writing each 1 represents 2us */ #define HNS3_GL_USEC_TO_REG(gl_usec) ((gl_usec) >> 1) -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-07-20 16:18:00.122364170 +0100 +++ 0041-net-hns3-extract-PTP-to-its-own-header-file.patch 2023-07-20 16:17:54.656750487 +0100 @@ -1 +1 @@ -From 78399874af509e129c13c6771aafa8f27c456c95 Mon Sep 17 00:00:00 2001 +From 37164c253777acd6fd83d605621b7faf194118a8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 78399874af509e129c13c6771aafa8f27c456c95 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 70463fe177..64028778d0 100644 +index 0ee6a4e948..f61509a281 100644 @@ -27 +28 @@ -@@ -16,4 +16,5 @@ +@@ -17,4 +17,5 @@ @@ -31 +31,0 @@ - #include "hns3_ethdev.h" @@ -32,0 +33 @@ + #define HNS3_SERVICE_INTERVAL 1000000 /* us */ @@ -34 +35 @@ -index 9456204422..c58094d87b 100644 +index 6c07075867..878d4ae492 100644 @@ -37 +38 @@ -@@ -1042,21 +1042,4 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, +@@ -1041,21 +1041,4 @@ void hns3vf_update_link_status(struct hns3_hw *hw, uint8_t link_status, @@ -57,2 +58,2 @@ - const char *hns3_get_media_type_name(uint8_t media_type); - + static inline bool + is_reset_pending(struct hns3_adapter *hns) @@ -125 +126 @@ -index 459bbaf773..6b037f81c1 100644 +index 5812eb39db..d5f9d0ae9f 100644 @@ -128 +129 @@ -@@ -125,27 +125,4 @@ +@@ -122,27 +122,4 @@