mbox series

[net-next,v7,0/4] Support PTP clock for Wangxun NICs

Message ID 20250213083041.78917-1-jiawenwu@trustnetic.com (mailing list archive)
Headers show
Series Support PTP clock for Wangxun NICs | expand

Message

Jiawen Wu Feb. 13, 2025, 8:30 a.m. UTC
Implement support for PTP clock on Wangxun NICs.

Changes in v7:
- Link to v6: https://lore.kernel.org/all/20250208031348.4368-1-jiawenwu@trustnetic.com/
- Merge the task for checking TX timestamp into do_aux_work
- Add Intel copyright in wx_ptp.c

Changes in v6:
- Link to v5: https://lore.kernel.org/all/20250117062051.2257073-1-jiawenwu@trustnetic.com/
- Add "depends on PTP_1588_CLOCK_OPTIONAL" in Kconfig to fix build
  errors

Changes in v5:
- Link to v4: https://lore.kernel.org/all/20250114084425.2203428-1-jiawenwu@trustnetic.com/
- Use reading template for timecounter_cyc2time()
- Move the same piece of codes to the functions
- Fix read sequence for time registers
- Remove skb_shared_hwtstamps zero out
- Pass duty cycle for the pulse width

Changes in v4:
- Link to v3: https://lore.kernel.org/all/20250110031716.2120642-1-jiawenwu@trustnetic.com/
- Add tx_hwtstamp_errors to record errors of DMA mapping
- Remove flag bits clear for default case in setting TS mode
- Change to use seqlock_t hw_tc_lock
- Add ptp_schedule_worker in wx_ptp_reset()
- Remove perout index check
- Refactor the same code into a function

Changes in v3:
- Link to v2: https://lore.kernel.org/all/20250106084506.2042912-1-jiawenwu@trustnetic.com/
- Clean up messy patches
- Return delay value in wx_ptp_do_aux_work()
- Remove dev_warn()
- Implement ethtool get_ts_stats
- Support PTP_CLK_REQ_PEROUT instead of PTP_CLK_REQ_PPS
- Change to start polling Tx timestamp once descriptor done bit is set

Changes in v2:
- Link to v1: https://lore.kernel.org/all/20250102103026.1982137-1-jiawenwu@trustnetic.com/
- Fix build warning
- Convert to .ndo_hwtstamp_get and .ndo_hwtstamp_set
- Remove needless timestamp flags
- Use .do_aux_work instead of driver service task
- Use the better error code
- Rename function wx_ptp_start_cyclecounter()
- Keep the register names consistent between comments and code

Jiawen Wu (4):
  net: wangxun: Add support for PTP clock
  net: wangxun: Support to get ts info
  net: wangxun: Add periodic checks for overflow and errors
  net: ngbe: Add support for 1PPS and TOD

 drivers/net/ethernet/wangxun/Kconfig          |    1 +
 drivers/net/ethernet/wangxun/libwx/Makefile   |    2 +-
 .../net/ethernet/wangxun/libwx/wx_ethtool.c   |   53 +
 .../net/ethernet/wangxun/libwx/wx_ethtool.h   |    4 +
 drivers/net/ethernet/wangxun/libwx/wx_hw.c    |   19 +
 drivers/net/ethernet/wangxun/libwx/wx_hw.h    |    1 +
 drivers/net/ethernet/wangxun/libwx/wx_lib.c   |   52 +-
 drivers/net/ethernet/wangxun/libwx/wx_ptp.c   | 1011 +++++++++++++++++
 drivers/net/ethernet/wangxun/libwx/wx_ptp.h   |   20 +
 drivers/net/ethernet/wangxun/libwx/wx_type.h  |  105 ++
 .../net/ethernet/wangxun/ngbe/ngbe_ethtool.c  |    2 +
 drivers/net/ethernet/wangxun/ngbe/ngbe_main.c |   20 +-
 drivers/net/ethernet/wangxun/ngbe/ngbe_mdio.c |   11 +
 drivers/net/ethernet/wangxun/ngbe/ngbe_type.h |    5 +
 .../ethernet/wangxun/txgbe/txgbe_ethtool.c    |    2 +
 .../net/ethernet/wangxun/txgbe/txgbe_main.c   |   11 +
 .../net/ethernet/wangxun/txgbe/txgbe_phy.c    |   10 +
 17 files changed, 1322 insertions(+), 7 deletions(-)
 create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_ptp.c
 create mode 100644 drivers/net/ethernet/wangxun/libwx/wx_ptp.h

Comments

Jakub Kicinski Feb. 15, 2025, 12:52 a.m. UTC | #1
On Thu, 13 Feb 2025 16:30:37 +0800 Jiawen Wu wrote:
> Implement support for PTP clock on Wangxun NICs.

Please run:

./scripts/kernel-doc -none -Wall drivers/net/ethernet/wangxun/*/*

Existing errors are fine, but you shouldn't be adding new ones.
You're missing documentation for return values for a lot of functions.

Note that adding kdoc is not required, you can just remove it where
it doesn't add value. But if you add kdoc comments they need to be
fully specified.
Jiawen Wu Feb. 17, 2025, 1:47 a.m. UTC | #2
On Sat, Feb 15, 2025 8:52 AM, Jakub Kicinski wrote:
> On Thu, 13 Feb 2025 16:30:37 +0800 Jiawen Wu wrote:
> > Implement support for PTP clock on Wangxun NICs.
> 
> Please run:
> 
> ./scripts/kernel-doc -none -Wall drivers/net/ethernet/wangxun/*/*
> 
> Existing errors are fine, but you shouldn't be adding new ones.
> You're missing documentation for return values for a lot of functions.
> 
> Note that adding kdoc is not required, you can just remove it where
> it doesn't add value. But if you add kdoc comments they need to be
> fully specified.

OK, I'll fix it in the V8 patch set.
So what is the conclusion about the "work" item. Should I revert it to V6?
Jakub Kicinski Feb. 17, 2025, 10:37 p.m. UTC | #3
On Mon, 17 Feb 2025 09:47:51 +0800 Jiawen Wu wrote:
> On Sat, Feb 15, 2025 8:52 AM, Jakub Kicinski wrote:
> > On Thu, 13 Feb 2025 16:30:37 +0800 Jiawen Wu wrote:  
> > > Implement support for PTP clock on Wangxun NICs.  
> > 
> > Please run:
> > 
> > ./scripts/kernel-doc -none -Wall drivers/net/ethernet/wangxun/*/*
> > 
> > Existing errors are fine, but you shouldn't be adding new ones.
> > You're missing documentation for return values for a lot of functions.
> > 
> > Note that adding kdoc is not required, you can just remove it where
> > it doesn't add value. But if you add kdoc comments they need to be
> > fully specified.  
> 
> OK, I'll fix it in the V8 patch set.
> So what is the conclusion about the "work" item. Should I revert it to V6?

Not, why? IIUC people who replied on that thread were just backing up
my assertion that aux_work is much better.