All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/4] Add support for DMA timestamp for non-PTP packets
@ 2022-09-27 13:06 ` Muhammad Husaini Zulkifli
  0 siblings, 0 replies; 32+ messages in thread
From: Muhammad Husaini Zulkifli @ 2022-09-27 13:06 UTC (permalink / raw)
  To: intel-wired-lan
  Cc: netdev, davem, kuba, edumazet, muhammad.husaini.zulkifli,
	vinicius.gomes, aravindhan.gunasekaran, noor.azura.ahmad.tarmizi

The HW TX timestamps created by the NIC via socket options can be
requested using the current network timestamps generation capability of
SOF_TIMESTAMPING_TX_HARDWARE. The most common users of this socket flag
is PTP, however other packet applications that require tx timestamps might
also ask for it.

The problem is that, when there is a lot of traffic, there is a high chance
that the timestamps for a PTP packet will be lost if both PTP and Non-PTP
packets use the same SOF TIMESTAMPING TX HARDWARE causing the tx timeout.

DMA timestamps through socket options are not currently available to
the user. Because if the user wants to, they can configure the hwtstamp
config option to use the new introduced DMA Time Stamp flag through the
setsockopt().

With these additional socket options, users can continue to utilise
HW timestamps for PTP while specifying non-PTP packets to use DMA
timestamps if the NIC can support them.

Any socket application can be use to verify this.
TSN Ref SW application is been used for testing by changing as below:

	int timestamping_flags = SOF_TIMESTAMPING_TX_HARDWARE_DMA_FETCH;

	strncpy(hwtstamp.ifr_name, opt->ifname, sizeof(hwtstamp.ifr_name)-1);
	hwtstamp.ifr_data = (void *)&hwconfig;
	hwconfig.tx_type = HWTSTAMP_TX_ON;
	hwconfig.flags = HWTSTAMP_FLAG_DMA_TIMESTAMP;
	hwconfig.rx_filter = HWTSTAMP_FILTER_ALL;

	if (ioctl(sock, SIOCSHWTSTAMP, &hwtstamp) < 0) {
		fprintf(stderr, "%s: %s\n", "ioctl", strerror(errno));
		exit(1);
	}

	if (setsockopt(sock, SOL_SOCKET, SO_TIMESTAMPING, &timestamping_flags,
			sizeof(timestamping_flags)) < 0)
		exit_with_error("setsockopt SO_TIMESTAMPING");

Muhammad Husaini Zulkifli (3):
  ethtool: Add new hwtstamp flag
  net-timestamp: Increase the size of tsflags
  net: sock: extend SO_TIMESTAMPING for DMA Fetch

Vinicius Costa Gomes (1):
  igc: Add support for DMA timestamp for non-PTP packets

 drivers/net/ethernet/intel/igc/igc.h         | 10 +++
 drivers/net/ethernet/intel/igc/igc_base.h    |  2 +-
 drivers/net/ethernet/intel/igc/igc_defines.h |  2 +
 drivers/net/ethernet/intel/igc/igc_ethtool.c |  5 +-
 drivers/net/ethernet/intel/igc/igc_main.c    | 24 ++++--
 drivers/net/ethernet/intel/igc/igc_ptp.c     | 83 ++++++++++++++++++++
 include/linux/skbuff.h                       |  3 +
 include/net/sock.h                           | 12 +--
 include/uapi/linux/ethtool.h                 |  3 +
 include/uapi/linux/ethtool_netlink.h         |  1 +
 include/uapi/linux/net_tstamp.h              | 11 ++-
 net/ethtool/common.c                         |  7 ++
 net/ethtool/common.h                         |  2 +
 net/ethtool/strset.c                         |  5 ++
 net/ethtool/tsinfo.c                         | 17 ++++
 net/socket.c                                 |  5 +-
 16 files changed, 175 insertions(+), 17 deletions(-)

--
2.17.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2022-09-30 14:40 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 13:06 [PATCH v1 0/4] Add support for DMA timestamp for non-PTP packets Muhammad Husaini Zulkifli
2022-09-27 13:06 ` [Intel-wired-lan] " Muhammad Husaini Zulkifli
2022-09-27 13:06 ` [PATCH v1 1/4] ethtool: Add new hwtstamp flag Muhammad Husaini Zulkifli
2022-09-27 13:06   ` [Intel-wired-lan] " Muhammad Husaini Zulkifli
2022-09-28  0:11   ` Jakub Kicinski
2022-09-28  0:11     ` [Intel-wired-lan] " Jakub Kicinski
2022-09-29  3:40     ` Zulkifli, Muhammad Husaini
2022-09-29  3:40       ` [Intel-wired-lan] " Zulkifli, Muhammad Husaini
2022-09-27 13:06 ` [PATCH v1 2/4] net-timestamp: Increase the size of tsflags Muhammad Husaini Zulkifli
2022-09-27 13:06   ` [Intel-wired-lan] " Muhammad Husaini Zulkifli
2022-09-27 13:06 ` [PATCH v1 3/4] net: sock: extend SO_TIMESTAMPING for DMA Fetch Muhammad Husaini Zulkifli
2022-09-27 13:06   ` [Intel-wired-lan] " Muhammad Husaini Zulkifli
2022-09-27 13:06 ` [PATCH v1 4/4] igc: Add support for DMA timestamp for non-PTP packets Muhammad Husaini Zulkifli
2022-09-27 13:06   ` [Intel-wired-lan] " Muhammad Husaini Zulkifli
2022-09-27 15:27 ` [PATCH v1 0/4] " Andrew Lunn
2022-09-27 15:27   ` [Intel-wired-lan] " Andrew Lunn
2022-09-29  2:22   ` Zulkifli, Muhammad Husaini
2022-09-29  2:22     ` [Intel-wired-lan] " Zulkifli, Muhammad Husaini
2022-09-28  0:09 ` Jakub Kicinski
2022-09-28  0:09   ` [Intel-wired-lan] " Jakub Kicinski
2022-09-29  2:35   ` Zulkifli, Muhammad Husaini
2022-09-29  2:35     ` Zulkifli, Muhammad Husaini
2022-09-29 13:56     ` Jakub Kicinski
2022-09-29 13:56       ` [Intel-wired-lan] " Jakub Kicinski
2022-09-29 14:46       ` Gal Pressman
2022-09-29 14:46         ` [Intel-wired-lan] " Gal Pressman
2022-09-29 15:23         ` Jakub Kicinski
2022-09-29 15:23           ` [Intel-wired-lan] " Jakub Kicinski
2022-09-30  8:52       ` Zulkifli, Muhammad Husaini
2022-09-30  8:52         ` [Intel-wired-lan] " Zulkifli, Muhammad Husaini
2022-09-30 14:40         ` Jakub Kicinski
2022-09-30 14:40           ` [Intel-wired-lan] " Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.