From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: "Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Igor Russkikh" <irusskikh@marvell.com>,
"Egor Pomozov" <epomozov@marvell.com>,
"Potnuri Bharat Teja" <bharat@chelsio.com>,
"Dimitris Michailidis" <dmichail@fungible.com>,
"Jian Shen" <shenjian15@huawei.com>,
"Salil Mehta" <salil.mehta@huawei.com>,
"Jijie Shao" <shaojijie@huawei.com>,
"Sunil Goutham" <sgoutham@marvell.com>,
"Geetha sowjanya" <gakula@marvell.com>,
"Subbaraya Sundeep" <sbhatta@marvell.com>,
"Bharat Bhushan" <bbhushan2@marvell.com>,
"Tariq Toukan" <tariqt@nvidia.com>,
"Brett Creeley" <brett.creeley@amd.com>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
"Paul Barker" <paul@pbarker.dev>,
"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
"MD Danish Anwar" <danishanwar@ti.com>,
"Roger Quadros" <rogerq@kernel.org>
Cc: Richard Cochran <richardcochran@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Vadim Fedorenko <vadim.fedorenko@linux.dev>
Subject: [PATCH net-next 13/14] net: hns3: add hwtstamp_get/hwtstamp_set ops
Date: Mon, 13 Oct 2025 16:37:48 +0000 [thread overview]
Message-ID: <20251013163749.5047-8-vadim.fedorenko@linux.dev> (raw)
In-Reply-To: <20251013163749.5047-1-vadim.fedorenko@linux.dev>
And .ndo_hwtstamp_get()/.ndo_hwtstamp_set() callbacks to HNS3 framework
to support HW timestamp configuration via netlink.
Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
drivers/net/ethernet/hisilicon/hns3/hnae3.h | 5 ++++
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 29 +++++++++++++++++++
2 files changed, 34 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 3b548f71fa8a..d7c3df1958f3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -804,6 +804,11 @@ struct hnae3_ae_ops {
int (*dbg_get_read_func)(struct hnae3_handle *handle,
enum hnae3_dbg_cmd cmd,
read_func *func);
+ int (*hwtstamp_get)(struct hnae3_handle *handle,
+ struct kernel_hwtstamp_config *config);
+ int (*hwtstamp_set)(struct hnae3_handle *handle,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack);
};
struct hnae3_dcb_ops {
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index bfa5568baa92..1e9388f1115c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -2419,6 +2419,35 @@ static int hns3_nic_do_ioctl(struct net_device *netdev,
return h->ae_algo->ops->do_ioctl(h, ifr, cmd);
}
+static int hns3_nic_hwtstamp_get(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config)
+{
+ struct hnae3_handle *h = hns3_get_handle(netdev);
+
+ if (!netif_running(netdev))
+ return -EINVAL;
+
+ if (!h->ae_algo->ops->hwtstamp_get)
+ return -EOPNOTSUPP;
+
+ return h->ae_algo->ops->hwtstamp_get(h, config);
+}
+
+static int hns3_nic_hwtstamp_set(struct net_device *netdev,
+ struct kernel_hwtstamp_config *config,
+ struct netlink_ext_ack *extack)
+{
+ struct hnae3_handle *h = hns3_get_handle(netdev);
+
+ if (!netif_running(netdev))
+ return -EINVAL;
+
+ if (!h->ae_algo->ops->hwtstamp_set)
+ return -EOPNOTSUPP;
+
+ return h->ae_algo->ops->hwtstamp_set(h, config, extack);
+}
+
static int hns3_nic_set_features(struct net_device *netdev,
netdev_features_t features)
{
--
2.47.3
next prev parent reply other threads:[~2025-10-13 16:39 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-13 16:37 [PATCH net-next 06/14] tsnep: convert to ndo_hwtstatmp API Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 07/14] funeth: convert to ndo_hwtstamp API Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 08/14] octeontx2: " Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 09/14] mlx4: " Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 10/14] ionic: " Vadim Fedorenko
2025-10-17 17:11 ` Brett Creeley
2025-10-18 13:51 ` Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 11/14] net: ravb: " Vadim Fedorenko
2025-10-13 16:37 ` [PATCH net-next 12/14] net: renesas: rswitch: " Vadim Fedorenko
2025-10-13 16:37 ` Vadim Fedorenko [this message]
2025-10-14 11:26 ` [PATCH net-next 13/14] net: hns3: add hwtstamp_get/hwtstamp_set ops Simon Horman
2025-10-14 11:33 ` Vadim Fedorenko
2025-10-17 20:59 ` [PATCH net-next 06/14] tsnep: convert to ndo_hwtstatmp API Gerhard Engleder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251013163749.5047-8-vadim.fedorenko@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=Shyam-sundar.S-k@amd.com \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=bharat@chelsio.com \
--cc=brett.creeley@amd.com \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=dmichail@fungible.com \
--cc=edumazet@google.com \
--cc=epomozov@marvell.com \
--cc=gakula@marvell.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=pabeni@redhat.com \
--cc=paul@pbarker.dev \
--cc=richardcochran@gmail.com \
--cc=rogerq@kernel.org \
--cc=salil.mehta@huawei.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=shaojijie@huawei.com \
--cc=shenjian15@huawei.com \
--cc=tariqt@nvidia.com \
--cc=vladimir.oltean@nxp.com \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.