public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Chintan Vankar <c-vankar@ti.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
	Siddharth Vadapalli <s-vadapalli@ti.com>,
	Michael Walle <mwalle@kernel.org>, Nishanth Menon <nm@ti.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
	"MD Danish Anwar" <danishanwar@ti.com>,
	Vishnu Singh <v-singh1@ti.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support
Date: Wed, 4 Mar 2026 19:01:56 -0800	[thread overview]
Message-ID: <20260304190156.319df897@kernel.org> (raw)
In-Reply-To: <20260303075819.3246032-1-c-vankar@ti.com>

On Tue, 3 Mar 2026 13:28:19 +0530 Chintan Vankar wrote:
> @@ -1888,8 +1894,8 @@ static int am65_cpsw_nuss_hwtstamp_get(struct net_device *ndev,
>  	cfg->flags = 0;
>  	cfg->tx_type = port->tx_ts_enabled ?
>  		      HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
> -	cfg->rx_filter = port->rx_ts_enabled ? HWTSTAMP_FILTER_PTP_V2_EVENT |
> -			HWTSTAMP_FILTER_PTP_V1_L4_EVENT : HWTSTAMP_FILTER_NONE;
> +	cfg->rx_filter = port->rx_ts_enabled ?
> +			 port->rx_ts_filter : HWTSTAMP_FILTER_NONE;

HWTSTAMP_FILTER_NONE == 0
a lot of code depends on that
so you can just assign port->rx_ts_filter

>  
>  	return 0;
>  }
> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.h b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
> index 917c37e4e89b..595123c155db 100644
> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.h
> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
> @@ -53,6 +53,7 @@ struct am65_cpsw_port {
>  	struct am65_cpsw_slave_data	slave;
>  	bool				tx_ts_enabled;
>  	bool				rx_ts_enabled;
> +	int				rx_ts_filter;

given none == 0 you can just turn rx_ts_enabled from a bool into
an enum hwtstamp_rx_filters and maybe rename it?
no need to have two members in the struct for rx
-- 
pw-bot: cr

  reply	other threads:[~2026-03-05  3:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03  7:58 [PATCH net] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support Chintan Vankar
2026-03-05  3:01 ` Jakub Kicinski [this message]
2026-03-10 17:10   ` Chintan Vankar

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=20260304190156.319df897@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=c-vankar@ti.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=mwalle@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=s-vadapalli@ti.com \
    --cc=v-singh1@ti.com \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vigneshr@ti.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