* [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support
@ 2026-03-10 16:09 Chintan Vankar
2026-03-12 3:50 ` patchwork-bot+netdevbpf
2026-03-12 10:53 ` [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support: manual merge Matthieu Baerts
0 siblings, 2 replies; 3+ messages in thread
From: Chintan Vankar @ 2026-03-10 16:09 UTC (permalink / raw)
To: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Simon Horman, Chintan Vankar, Siddharth Vadapalli,
Michael Walle, Nishanth Menon, Vadim Fedorenko,
Vignesh Raghavendra, Matthias Schiffer, MD Danish Anwar,
Vishnu Singh
Cc: netdev, linux-kernel
The "rx_filter" member of "hwtstamp_config" structure is an enum field and
does not support bitwise OR combination of multiple filter values. It
causes error while linuxptp application tries to match rx filter version.
Fix this by storing the requested filter type in a new port field.
Fixes: 97248adb5a3b ("net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets")
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
---
This patch is based on commit '0d9a60a0618d' of origin/main
branch of Linux net repo.
Link to v2:
https://lore.kernel.org/r/20260303075819.3246032-1-c-vankar@ti.com/
Changes from v1 to v2:
- Updated variable name to enum to avoid creating new redundant
variable as suggested by Jakub Kicinski.
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 16 +++++++++-------
drivers/net/ethernet/ti/am65-cpsw-nuss.h | 2 +-
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 967918050433..265ce5479915 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -1351,7 +1351,7 @@ static int am65_cpsw_nuss_rx_packets(struct am65_cpsw_rx_flow *flow,
ndev_priv = netdev_priv(ndev);
am65_cpsw_nuss_set_offload_fwd_mark(skb, ndev_priv->offload_fwd_mark);
skb_put(skb, pkt_len);
- if (port->rx_ts_enabled)
+ if (port->rx_ts_filter)
am65_cpts_rx_timestamp(common->cpts, skb);
skb_mark_for_recycle(skb);
skb->protocol = eth_type_trans(skb, ndev);
@@ -1811,11 +1811,14 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
switch (cfg->rx_filter) {
case HWTSTAMP_FILTER_NONE:
- port->rx_ts_enabled = false;
+ port->rx_ts_filter = HWTSTAMP_FILTER_NONE;
break;
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
+ port->rx_ts_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+ cfg->rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+ break;
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
@@ -1825,8 +1828,8 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
case HWTSTAMP_FILTER_PTP_V2_EVENT:
case HWTSTAMP_FILTER_PTP_V2_SYNC:
case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
- port->rx_ts_enabled = true;
- cfg->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT | HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+ port->rx_ts_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
+ cfg->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
break;
case HWTSTAMP_FILTER_ALL:
case HWTSTAMP_FILTER_SOME:
@@ -1863,7 +1866,7 @@ static int am65_cpsw_nuss_hwtstamp_set(struct net_device *ndev,
ts_ctrl |= AM65_CPSW_TS_TX_ANX_ALL_EN |
AM65_CPSW_PN_TS_CTL_TX_VLAN_LT1_EN;
- if (port->rx_ts_enabled)
+ if (port->rx_ts_filter)
ts_ctrl |= AM65_CPSW_TS_RX_ANX_ALL_EN |
AM65_CPSW_PN_TS_CTL_RX_VLAN_LT1_EN;
@@ -1888,8 +1891,7 @@ 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_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..7750448e4746 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.h
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.h
@@ -52,7 +52,7 @@ struct am65_cpsw_port {
bool disabled;
struct am65_cpsw_slave_data slave;
bool tx_ts_enabled;
- bool rx_ts_enabled;
+ enum hwtstamp_rx_filters rx_ts_filter;
struct am65_cpsw_qos qos;
struct devlink_port devlink_port;
struct bpf_prog *xdp_prog;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support
2026-03-10 16:09 [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support Chintan Vankar
@ 2026-03-12 3:50 ` patchwork-bot+netdevbpf
2026-03-12 10:53 ` [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support: manual merge Matthieu Baerts
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-12 3:50 UTC (permalink / raw)
To: Chintan Vankar
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, horms, s-vadapalli,
mwalle, nm, vadim.fedorenko, vigneshr, matthias.schiffer,
danishanwar, v-singh1, netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 10 Mar 2026 21:39:40 +0530 you wrote:
> The "rx_filter" member of "hwtstamp_config" structure is an enum field and
> does not support bitwise OR combination of multiple filter values. It
> causes error while linuxptp application tries to match rx filter version.
> Fix this by storing the requested filter type in a new port field.
>
> Fixes: 97248adb5a3b ("net: ti: am65-cpsw: Update hw timestamping filter for PTPv1 RX packets")
> Signed-off-by: Chintan Vankar <c-vankar@ti.com>
>
> [...]
Here is the summary with links:
- [net,v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support
https://git.kernel.org/netdev/net/c/840c9d13cb1c
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support: manual merge
2026-03-10 16:09 [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support Chintan Vankar
2026-03-12 3:50 ` patchwork-bot+netdevbpf
@ 2026-03-12 10:53 ` Matthieu Baerts
1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2026-03-12 10:53 UTC (permalink / raw)
To: Chintan Vankar
Cc: netdev, linux-kernel, Andrew Lunn, David S . Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman, Siddharth Vadapalli,
Michael Walle, Nishanth Menon, Vadim Fedorenko,
Vignesh Raghavendra, Matthias Schiffer, MD Danish Anwar,
Vishnu Singh, linux-next, Mark Brown
Hi Chintan,
+cc linux-next
On 10/03/2026 17:09, Chintan Vankar wrote:
> The "rx_filter" member of "hwtstamp_config" structure is an enum field and
> does not support bitwise OR combination of multiple filter values. It
> causes error while linuxptp application tries to match rx filter version.
> Fix this by storing the requested filter type in a new port field.
FYI, we got a small conflict when merging 'net' in 'net-next' in the
MPTCP tree due to this patch applied in 'net':
840c9d13cb1c ("net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support")
and this one from 'net-next':
a23c657e332f ("net: ethernet: ti: am65-cpsw: Use also port number to identify timestamps")
----- Generic Message -----
The best is to avoid conflicts between 'net' and 'net-next' trees but if
they cannot be avoided when preparing patches, a note about how to fix
them is much appreciated.
The conflict has been resolved on our side [1] and the resolution we
suggest is attached to this email. Please report any issues linked to
this conflict resolution as it might be used by others. If you worked on
the mentioned patches, don't hesitate to ACK this conflict resolution.
---------------------------
Rerere cache is available in [2].
The conflict was in the context: this patch here in 'net' modified the
if condition, while the one in 'net-next' modified the line below.
----------- 8< -----------
diff --cc drivers/net/ethernet/ti/am65-cpsw-nuss.c
index a38bf7f4f434,265ce5479915..d9400599e80a
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@@ -1351,8 -1351,8 +1351,8 @@@ static int am65_cpsw_nuss_rx_packets(st
ndev_priv = netdev_priv(ndev);
am65_cpsw_nuss_set_offload_fwd_mark(skb, ndev_priv->offload_fwd_mark);
skb_put(skb, pkt_len);
- if (port->rx_ts_enabled)
+ if (port->rx_ts_filter)
- am65_cpts_rx_timestamp(common->cpts, skb);
+ am65_cpts_rx_timestamp(common->cpts, port_id, skb);
skb_mark_for_recycle(skb);
skb->protocol = eth_type_trans(skb, ndev);
am65_cpsw_nuss_rx_csum(skb, csum_info);
----------- 8< -----------
1: https://github.com/multipath-tcp/mptcp_net-next/commit/e9021220744d
2: https://github.com/multipath-tcp/mptcp-upstream-rr-cache/commit/c39c9fa
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-12 10:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 16:09 [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support Chintan Vankar
2026-03-12 3:50 ` patchwork-bot+netdevbpf
2026-03-12 10:53 ` [PATCH net v2] net: ethernet: ti: am65-cpsw-nuss: Fix rx_filter value for PTP support: manual merge Matthieu Baerts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox