From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: "Tariq Toukan" <ttoukan.linux@gmail.com>,
"Jian Shen" <shenjian15@huawei.com>,
"Salil Mehta" <salil.mehta@huawei.com>,
"Jijie Shao" <shaojijie@huawei.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>,
"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>
Cc: linux-renesas-soc@vger.kernel.org,
Richard Cochran <richardcochran@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
Simon Horman <horms@kernel.org>,
Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/6] mlx4: convert to ndo_hwtstamp API
Date: Mon, 20 Oct 2025 11:15:12 +0100 [thread overview]
Message-ID: <4d1e7b89-9316-4956-96fc-0ce306637e3b@linux.dev> (raw)
In-Reply-To: <75c45f72-a0bf-4b72-8ba2-5b4c8073f21d@gmail.com>
On 20/10/2025 11:11, Tariq Toukan wrote:
>
>
> On 17/10/2025 21:21, Vadim Fedorenko wrote:
>> Convert driver to use .ndo_hwtstamp_get()/.ndo_hwtstamp_set() callbacks.
>> mlx4_en_ioctl() becomes empty, remove it.
>>
>> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
>> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
>> ---
>> .../net/ethernet/mellanox/mlx4/en_netdev.c | 61 ++++++++-----------
>> drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 6 +-
>> 2 files changed, 28 insertions(+), 39 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/
>> net/ethernet/mellanox/mlx4/en_netdev.c
>> index 308b4458e0d4..514f29f241c3 100644
>> --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
>> +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
>> @@ -2420,21 +2420,21 @@ static int mlx4_en_change_mtu(struct
>> net_device *dev, int new_mtu)
>> return 0;
>> }
>> -static int mlx4_en_hwtstamp_set(struct net_device *dev, struct ifreq
>> *ifr)
>> +static int mlx4_en_hwtstamp_set(struct net_device *dev,
>> + struct kernel_hwtstamp_config *config,
>> + struct netlink_ext_ack *extack)
>> {
>> struct mlx4_en_priv *priv = netdev_priv(dev);
>> struct mlx4_en_dev *mdev = priv->mdev;
>> - struct hwtstamp_config config;
>> -
>> - if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
>> - return -EFAULT;
>> /* device doesn't support time stamping */
>> - if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS))
>> + if (!(mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS)) {
>> + NL_SET_ERR_MSG(extack, "device doesn't support time stamping");
>
> Encouraged to add more extack messages, for error flows below.
> WDYT?
It may potentially be a follow up work, but I decided to keep -ERANGE as
is because it's kinda self explanatory and is consistent across all the
drivers, while EINVAL is bit outlier and needs a bit more explanation.
next prev parent reply other threads:[~2025-10-20 10:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 18:21 [PATCH net-next v2 0/6] convert net drivers to ndo_hwtstamp API part 2 Vadim Fedorenko
2025-10-17 18:21 ` [PATCH net-next v2 1/6] octeontx2: convert to ndo_hwtstamp API Vadim Fedorenko
2025-10-21 1:45 ` Jakub Kicinski
2025-10-17 18:21 ` [PATCH net-next v2 2/6] mlx4: " Vadim Fedorenko
2025-10-20 10:11 ` Tariq Toukan
2025-10-20 10:15 ` Vadim Fedorenko [this message]
2025-10-17 18:21 ` [PATCH net-next v2 3/6] ionic: " Vadim Fedorenko
2025-10-17 18:21 ` [PATCH net-next v2 4/6] net: ravb: " Vadim Fedorenko
2025-10-17 18:21 ` [PATCH net-next v2 5/6] net: renesas: rswitch: " Vadim Fedorenko
2025-10-17 18:21 ` [PATCH net-next v2 6/6] net: hns3: add hwtstamp_get/hwtstamp_set ops Vadim Fedorenko
2025-10-20 2:00 ` Jijie Shao
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=4d1e7b89-9316-4956-96fc-0ce306637e3b@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=bbhushan2@marvell.com \
--cc=brett.creeley@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.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=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=ttoukan.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).