diff mbox series

[v2,5/5] ethtool: Add support for HWTSTAMP_FILTER_DMA_TIMESTAMP

Message ID 20221018010733.4765-6-muhammad.husaini.zulkifli@intel.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add support for DMA timestamp for non-PTP packets | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2659 this patch: 2659
netdev/cc_maintainers warning 6 maintainers not CCed: alexandru.tachici@analog.com jesse.brandeburg@intel.com liuhangbin@gmail.com intel-wired-lan@lists.osuosl.org anthony.l.nguyen@intel.com pabeni@redhat.com
netdev/build_clang success Errors and warnings before: 580 this patch: 580
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2790 this patch: 2790
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 30 lines checked
netdev/kdoc success Errors and warnings before: 1 this patch: 1
netdev/source_inline success Was 0 now: 0

Commit Message

Zulkifli, Muhammad Husaini Oct. 18, 2022, 1:07 a.m. UTC
Add new HWTSTAMP_FILTER_DMA_TIMESTAMP receive filters.
This filter can be configured for devices that support/allow the
DMA timestamp retrieval on receive side.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
---
 drivers/net/ethernet/intel/igc/igc_ptp.c | 1 +
 include/uapi/linux/net_tstamp.h          | 3 +++
 net/core/dev_ioctl.c                     | 1 +
 net/ethtool/common.c                     | 1 +
 4 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 631972d7e97b..39ed759f9057 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -637,6 +637,7 @@  static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
 	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
 	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
 	case HWTSTAMP_FILTER_NTP_ALL:
+	case HWTSTAMP_FILTER_DMA_TIMESTAMP:
 	case HWTSTAMP_FILTER_ALL:
 		igc_ptp_enable_rx_timestamp(adapter);
 		config->rx_filter = HWTSTAMP_FILTER_ALL;
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index c9e113cea883..e72261ed879f 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -177,6 +177,9 @@  enum hwtstamp_rx_filters {
 	/* NTP, UDP, all versions and packet modes */
 	HWTSTAMP_FILTER_NTP_ALL,
 
+	/* DMA time stamp packet */
+	HWTSTAMP_FILTER_DMA_TIMESTAMP,
+
 	/* add new constants above here */
 	__HWTSTAMP_FILTER_CNT
 };
diff --git a/net/core/dev_ioctl.c b/net/core/dev_ioctl.c
index 7674bb9f3076..963327472c26 100644
--- a/net/core/dev_ioctl.c
+++ b/net/core/dev_ioctl.c
@@ -229,6 +229,7 @@  static int net_hwtstamp_validate(struct ifreq *ifr)
 	case HWTSTAMP_FILTER_PTP_V2_SYNC:
 	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
 	case HWTSTAMP_FILTER_NTP_ALL:
+	case HWTSTAMP_FILTER_DMA_TIMESTAMP:
 		rx_filter_valid = 1;
 		break;
 	case __HWTSTAMP_FILTER_CNT:
diff --git a/net/ethtool/common.c b/net/ethtool/common.c
index 24f8e7f9b4a5..fe6e5dfdfcce 100644
--- a/net/ethtool/common.c
+++ b/net/ethtool/common.c
@@ -438,6 +438,7 @@  const char ts_rx_filter_names[][ETH_GSTRING_LEN] = {
 	[HWTSTAMP_FILTER_PTP_V2_SYNC]		= "ptpv2-sync",
 	[HWTSTAMP_FILTER_PTP_V2_DELAY_REQ]	= "ptpv2-delay-req",
 	[HWTSTAMP_FILTER_NTP_ALL]		= "ntp-all",
+	[HWTSTAMP_FILTER_DMA_TIMESTAMP]		= "dma-timestamp",
 };
 static_assert(ARRAY_SIZE(ts_rx_filter_names) == __HWTSTAMP_FILTER_CNT);