From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Carolina Jubran <cjubran@nvidia.com>
Cc: netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Richard Cochran <richardcochran@gmail.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Michael Chan <michael.chan@broadcom.com>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Tariq Toukan <tariqt@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>
Subject: Re: [PATCH net-next 3/4] mlx5: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set()
Date: Tue, 23 Sep 2025 21:48:23 +0100 [thread overview]
Message-ID: <3a6ce0da-9f3f-4630-8c01-43ae980828d1@linux.dev> (raw)
In-Reply-To: <5b42dbf4-cc20-4cf7-bad5-fbe3e9055c0c@nvidia.com>
On 23/09/2025 18:44, Carolina Jubran wrote:
>
> On 22/09/2025 19:51, Vadim Fedorenko wrote:
> Hi Vadim, thanks for the patch!
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/
>> drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>> index 5e007bb3bad1..74a63371ab69 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
>> @@ -4755,9 +4755,11 @@ static int mlx5e_hwstamp_config_ptp_rx(struct
>> mlx5e_priv *priv, bool ptp_rx)
>> &new_params.ptp_rx, true);
>> }
>> -int mlx5e_hwstamp_set(struct mlx5e_priv *priv, struct ifreq *ifr)
>> +int mlx5e_hwstamp_set(struct net_device *dev,
>> + struct kernel_hwtstamp_config *config,
>> + struct netlink_ext_ack *extack)
>> {
>> - struct hwtstamp_config config;
>> + struct mlx5e_priv *priv = netdev_priv(dev);
>> bool rx_cqe_compress_def;
>> bool ptp_rx;
>> int err;
>> @@ -4766,11 +4768,8 @@ int mlx5e_hwstamp_set(struct mlx5e_priv *priv,
>> struct ifreq *ifr)
>> (mlx5_clock_get_ptp_index(priv->mdev) == -1))
>
>
> I would add an |extack| message here.
Yeah, but the !MLX5_CAP_GEN(priv->mdev, device_frequency_khz) check
looks redundant as mdev->clock->ptp will be null in case of absent of
device_frequency_khz, according to mlx5_init_clock()
>
>> @@ -4814,47 +4813,34 @@ int mlx5e_hwstamp_set(struct mlx5e_priv *priv,
>> struct ifreq *ifr)
>> if (!mlx5e_profile_feature_cap(priv->profile, PTP_RX))
>> err = mlx5e_hwstamp_config_no_ptp_rx(priv,
>> - config.rx_filter != HWTSTAMP_FILTER_NONE);
>> + config->rx_filter != HWTSTAMP_FILTER_NONE);
>> else
>> err = mlx5e_hwstamp_config_ptp_rx(priv, ptp_rx);
>> if (err)
>> goto err_unlock;
>> - memcpy(&priv->tstamp, &config, sizeof(config));
>> + memcpy(&priv->tstamp, config, sizeof(*config));
>
>
> A direct assignment would be cleaner.
Just wanted to follow original style. I'll change it in the next ver
>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c b/
>> drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
>> index 79ae3a51a4b3..ff8ffd997b17 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c
>> @@ -52,7 +52,8 @@ static const struct net_device_ops mlx5i_netdev_ops = {
>> .ndo_init = mlx5i_dev_init,
>> .ndo_uninit = mlx5i_dev_cleanup,
>> .ndo_change_mtu = mlx5i_change_mtu,
>> - .ndo_eth_ioctl = mlx5i_ioctl,
>> + .ndo_hwtstamp_get = mlx5e_hwstamp_get,
>> + .ndo_hwtstamp_set = mlx5e_hwstamp_set,
>> };
>> /* IPoIB mlx5 netdev profile */
>> @@ -557,20 +558,6 @@ int mlx5i_dev_init(struct net_device *dev)
>> return 0;
>> }
>> -int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
>> -{
>> - struct mlx5e_priv *priv = mlx5i_epriv(dev);
>> -
>
>
> mlx5i_epriv should still be used here. on IPoIB netdev_priv gives you a
> struct mlx5i_priv .
Oh, I see... we have to have slightly different hwstamp functions for
mlx5i and mlx5e because of different netdev->priv type. Let me see how
it can be factorized.
next prev parent reply other threads:[~2025-09-23 20:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-22 16:51 [PATCH net-next 0/4] convert 3 drivers to ndo_hwtstamp API Vadim Fedorenko
2025-09-22 16:51 ` [PATCH net-next 1/4] tg3: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() Vadim Fedorenko
2025-09-22 22:15 ` Michael Chan
2025-09-23 3:47 ` Pavan Chebbi
2025-09-22 16:51 ` [PATCH net-next 2/4] bnxt_en: " Vadim Fedorenko
2025-09-22 22:17 ` Michael Chan
2025-09-23 3:48 ` Pavan Chebbi
2025-09-22 16:51 ` [PATCH net-next 3/4] mlx5: " Vadim Fedorenko
2025-09-23 17:44 ` Carolina Jubran
2025-09-23 20:48 ` Vadim Fedorenko [this message]
2025-09-22 16:51 ` [PATCH net-next 4/4] selftests: drv-net: add HW timestamping tests Vadim Fedorenko
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=3a6ce0da-9f3f-4630-8c01-43ae980828d1@linux.dev \
--to=vadim.fedorenko@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=cjubran@nvidia.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=mbloch@nvidia.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=richardcochran@gmail.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.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.