mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chintan Vankar <c-vankar@ti.com>
To: Jakub Kicinski <kuba@kernel.org>
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: Tue, 10 Mar 2026 22:40:00 +0530	[thread overview]
Message-ID: <b6457298-12c2-4f13-9704-c0b46a34137b@ti.com> (raw)
In-Reply-To: <20260304190156.319df897@kernel.org>

Hello Jakub,

On 05/03/26 08:31, Jakub Kicinski wrote:
> 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

Thanks for suggesting this, I have posted a version 2 with updated
changes at:
https://lore.kernel.org/r/20260310160940.109822-1-c-vankar@ti.com/

Regards,
Chintan.

      reply	other threads:[~2026-03-10 17:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03  7:58 Chintan Vankar
2026-03-05  3:01 ` Jakub Kicinski
2026-03-10 17:10   ` Chintan Vankar [this message]

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=b6457298-12c2-4f13-9704-c0b46a34137b@ti.com \
    --to=c-vankar@ti.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@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

all inboxes | Powered by JetHome®