Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Cc: Sudarsana Kalluru <skalluru@marvell.com>,
	Manish Chopra <manishc@marvell.com>,
	Marco Crivellari <marco.crivellari@suse.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>,
	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>,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 6/7] net: pch_gbe: convert to use ndo_hwtstamp callbacks
Date: Fri, 31 Oct 2025 18:35:25 +0100	[thread overview]
Message-ID: <20251031183525.5b8b8110@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <20251031004607.1983544-7-vadim.fedorenko@linux.dev>

On Fri, 31 Oct 2025 00:46:06 +0000
Vadim Fedorenko <vadim.fedorenko@linux.dev> wrote:

> The driver implemented SIOCSHWTSTAMP ioctl command only, but it stores
> configuration in the private data, so it is possible to report it back
> to users. Implement both ndo_hwtstamp_set and ndo_hwtstamp_get
> callbacks. To properly report RX filter type, store it in hwts_rx_en
> instead of using this field as a simple flag. The logic didn't change
> because receive path used this field as boolean flag.
> 
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
> ---
>  .../ethernet/oki-semi/pch_gbe/pch_gbe_main.c  | 40 +++++++++++--------
>  1 file changed, 24 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index
> e5a6f59af0b6..4049137abc40 100644 ---
> a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++
> b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c @@ -198,42 +198,40 @@
> pch_tx_timestamp(struct pch_gbe_adapter *adapter, struct sk_buff *skb)
> pch_ch_event_write(pdev, TX_SNAPSHOT_LOCKED); }
>  
> -static int hwtstamp_ioctl(struct net_device *netdev, struct ifreq *ifr, int
> cmd) +static int pch_gbe_hwtstamp_set(struct net_device *netdev,
> +				struct kernel_hwtstamp_config *cfg,
> +				struct netlink_ext_ack *extack)
>  {
> -	struct hwtstamp_config cfg;
>  	struct pch_gbe_adapter *adapter = netdev_priv(netdev);
>  	struct pci_dev *pdev;
>  	u8 station[20];
>  
> -	if (copy_from_user(&cfg, ifr->ifr_data, sizeof(cfg)))
> -		return -EFAULT;
> -
>  	/* Get ieee1588's dev information */
>  	pdev = adapter->ptp_pdev;
>  
> -	if (cfg.tx_type != HWTSTAMP_TX_OFF && cfg.tx_type != HWTSTAMP_TX_ON)
> +	if (cfg->tx_type != HWTSTAMP_TX_OFF && cfg->tx_type !=
> HWTSTAMP_TX_ON) return -ERANGE;
>  
> -	switch (cfg.rx_filter) {
> +	switch (cfg->rx_filter) {
>  	case HWTSTAMP_FILTER_NONE:
>  		adapter->hwts_rx_en = 0;
>  		break;
>  	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
> -		adapter->hwts_rx_en = 0;
> +		adapter->hwts_rx_en = cfg->rx_filter;

It seems there is a functional change here.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


  reply	other threads:[~2025-10-31 17:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31  0:46 [PATCH net-next 0/7] convert drivers to use ndo_hwtstamp callbacks part 3 Vadim Fedorenko
2025-10-31  0:46 ` [PATCH net-next 1/7] bnx2x: convert to use ndo_hwtstamp callbacks Vadim Fedorenko
2025-10-31 17:04   ` Kory Maincent
2025-10-31  0:46 ` [PATCH net-next 2/7] net: liquidio: " Vadim Fedorenko
2025-10-31 17:07   ` Kory Maincent
2025-10-31  0:46 ` [PATCH net-next 3/7] net: liquidio_vf: " Vadim Fedorenko
2025-10-31 17:19   ` Kory Maincent
2025-10-31  0:46 ` [PATCH net-next 4/7] net: octeon: mgmt: " Vadim Fedorenko
2025-10-31 17:16   ` Kory Maincent
2025-10-31 17:18     ` Kory Maincent
2025-10-31  0:46 ` [PATCH net-next 5/7] net: thunderx: " Vadim Fedorenko
2025-10-31 17:23   ` Kory Maincent
2025-10-31  0:46 ` [PATCH net-next 6/7] net: pch_gbe: " Vadim Fedorenko
2025-10-31 17:35   ` Kory Maincent [this message]
2025-10-31 18:38     ` Jakub Kicinski
2025-11-03 14:30       ` Vadim Fedorenko
2025-10-31  0:46 ` [PATCH net-next 7/7] qede: " Vadim Fedorenko
2025-10-31 17:39   ` Kory Maincent
2025-10-31 17:10 ` [PATCH net-next 0/7] convert drivers to use ndo_hwtstamp callbacks part 3 Kory Maincent
2025-10-31 17:41   ` Kory Maincent

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=20251031183525.5b8b8110@kmaincent-XPS-13-7390 \
    --to=kory.maincent@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=manishc@marvell.com \
    --cc=marco.crivellari@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sgoutham@marvell.com \
    --cc=skalluru@marvell.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vladimir.oltean@nxp.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