Skip to content

Conversation

yangbolu1991
Copy link
Member

This PR is to support DSA PTP. (Now only gPTP is supported)
Also enabled i.MX943 gPTP sample for testing. gPTP on all 5 ports on i.MX943 (2 DSA switch ports and 3 ENETC ports) worked fine.

There is a hal_nxp dependency:

Thanks a lot.

Copy link

github-actions bot commented Aug 27, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@809b1c1 zephyrproject-rtos/hal_nxp@b03baa6 zephyrproject-rtos/[email protected]

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest-hal_nxp DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Aug 27, 2025
@yangbolu1991
Copy link
Member Author

Updated to fix twister issues.
Thanks.

ankuns
ankuns previously approved these changes Sep 11, 2025
return eth_api_conduit->send(dev_conduit, dsa_pkt);
ret = eth_api_conduit->send(dev_conduit, dsa_pkt);
if (ret != 0) {
return ret;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be other way around i.e., if ret == 0 (so send was successfull) we just return, and if there was an error ret != 0, we unref the clone?
Or even simpler

ret = eth_api_conduit->send(dev_conduit, dsa_pkt);
if (ret != 0) {
	net_pkt_unref(clone);
}

return ret;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the unref is needed when failed.
I think for the clone pkt sent through ethernet_api->send, there should be unref to release no matter the result is success or not. Will fix.
Thanks.

@yangbolu1991
Copy link
Member Author

Updated to v4. Changes include,

  • Made sure unref cloned pkt when dsa tx failed.

Thanks.

jukkar
jukkar previously approved these changes Sep 12, 2025
Updated hal_nxp to support netc switch ptp.

Signed-off-by: Yangbo Lu <[email protected]>
Moved dsa_tag_netc.h to public include directory for devices
reusing.

Signed-off-by: Yangbo Lu <[email protected]>
Supported tagger data and connecting device to tag protocol, so that some
device specific work could be handled.

Signed-off-by: Yangbo Lu <[email protected]>
Allowed ptp-clock property for dsa.

Signed-off-by: Yangbo Lu <[email protected]>
Added PTP solution in core driver. Now only gPTP was supported.

- ethernet_api like get_capabilities and get_ptp_clock
  were supported in port driver.

- For TX timestamp, added new dsa_api port_txtstamp for device
  to handle. Device driver might put pkt in queue, and reported
  timestamp after completing transmitting on hardware.

- For RX timestamp, the timestamp could be given to pkt in tag
  driver or device driver.

Signed-off-by: Yangbo Lu <[email protected]>
Supported common usage of control block for any layer.

Signed-off-by: Yangbo Lu <[email protected]>
Supported PTP timestamping in netc tag driver.

Signed-off-by: Yangbo Lu <[email protected]>
PTP clock may be enabled per Ethernet port. Especially pseudo port for
switch management does not need PTP clock.

Signed-off-by: Yangbo Lu <[email protected]>
Supported receiving more types frames. One was TX timestamp response
frame and the other one is RX timestamped frame which were for switch
port.

Signed-off-by: Yangbo Lu <[email protected]>
Supported PTP timestamping. Now only gPTP was supported.

Signed-off-by: Yangbo Lu <[email protected]>
Added imx943_evk_mimx94398_m33_ddr support.

Signed-off-by: Yangbo Lu <[email protected]>
@yangbolu1991
Copy link
Member Author

Rebased to address conflicts.
Thanks.

Copy link

@nashif nashif merged commit 298ea52 into zephyrproject-rtos:main Sep 15, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants