[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251104173737.3f655692@kernel.org>
Date: Tue, 4 Nov 2025 17:37:37 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Cc: Manish Chopra <manishc@...vell.com>, Marco Crivellari
<marco.crivellari@...e.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo
Abeni <pabeni@...hat.com>, Sunil Goutham <sgoutham@...vell.com>, Richard
Cochran <richardcochran@...il.com>, Russell King <linux@...linux.org.uk>,
Vladimir Oltean <vladimir.oltean@....com>, Simon Horman <horms@...nel.org>,
Jacob Keller <jacob.e.keller@...el.com>, Kory Maincent
<kory.maincent@...tlin.com>, linux-arm-kernel@...ts.infradead.org,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/7] bnx2x: convert to use ndo_hwtstamp
callbacks
On Mon, 3 Nov 2025 15:09:46 +0000 Vadim Fedorenko wrote:
> -static int bnx2x_hwtstamp_ioctl(struct bnx2x *bp, struct ifreq *ifr)
> +static int bnx2x_hwtstamp_set(struct net_device *dev,
> + struct kernel_hwtstamp_config *config,
> + struct netlink_ext_ack *extack)
> {
> - struct hwtstamp_config config;
> + struct bnx2x *bp = netdev_priv(dev);
> int rc;
>
> - DP(BNX2X_MSG_PTP, "HWTSTAMP IOCTL called\n");
> -
> - if (copy_from_user(&config, ifr->ifr_data, sizeof(config)))
> - return -EFAULT;
> + DP(BNX2X_MSG_PTP, "HWTSTAMP SET called\n");
>
> DP(BNX2X_MSG_PTP, "Requested tx_type: %d, requested rx_filters = %d\n",
> - config.tx_type, config.rx_filter);
> + config->tx_type, config->rx_filter);
>
> bp->hwtstamp_ioctl_called = true;
> - bp->tx_type = config.tx_type;
> - bp->rx_filter = config.rx_filter;
> + bp->tx_type = config->tx_type;
> + bp->rx_filter = config->rx_filter;
>
> rc = bnx2x_configure_ptp_filters(bp);
bnx2x_configure_ptp_filters() may return -ERANGE if settings were not applied.
This may already be semi-broken but with the get in place we will make
it even worse.
> if (rc)
> return rc;
>
> - config.rx_filter = bp->rx_filter;
> + config->rx_filter = bp->rx_filter;
> +
> + return 0;
> +}
>
> - return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ?
> - -EFAULT : 0;
> +static int bnx2x_hwtstamp_get(struct net_device *dev,
> + struct kernel_hwtstamp_config *config)
> +{
> + struct bnx2x *bp = netdev_priv(dev);
> +
> + config->rx_filter = bp->rx_filter;
> + config->tx_type = bp->tx_type;
> +
> + return 0;
> }
Powered by blists - more mailing lists