mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
net: macb: Enable RX timestamping for specific PTPv1 filters
Selecting a PTPv1 Sync or Delay_Req filter in gem_set_hwtst() returns success, but leaves rx_bd_control at its initial value of TSTAMP_DISABLED. The requested filter therefore appears to have been applied, even though received packets have no hardware timestamps. The PTPv1 event case already enables timestamping for all frames, so use that path for Sync and Delay_Req as well. This enables timestamping for both requests and returns HWTSTAMP_FILTER_ALL to tell the caller which filter was actually applied. Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de> Reviewed-by: Théo Lebrun <theo.lebrun@bootlin.com> Tested-by: Nicolai Buchwitz <nb@tipi-net.de> Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr> Link: https://patch.msgid.link/20260923-macb-hwtstamp-rework-v2-2-75c909b2676d@khu.ac.kr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
381cb968fa
commit
059a5a238c
|
|
@ -421,10 +421,6 @@ int gem_set_hwtst(struct net_device *netdev,
|
|||
switch (rx_filter) {
|
||||
case HWTSTAMP_FILTER_NONE:
|
||||
break;
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
|
||||
break;
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
|
||||
break;
|
||||
case HWTSTAMP_FILTER_PTP_V2_EVENT:
|
||||
case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
|
||||
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
|
||||
|
|
@ -439,6 +435,8 @@ int gem_set_hwtst(struct net_device *netdev,
|
|||
ncr_mask |= MACB_BIT(SRTSM);
|
||||
ncr_bits |= MACB_BIT(SRTSM);
|
||||
break;
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
|
||||
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
|
||||
case HWTSTAMP_FILTER_ALL:
|
||||
rx_bd_control = TSTAMP_ALL_FRAMES;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user