[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221018010733.4765-6-muhammad.husaini.zulkifli@intel.com>
Date: Tue, 18 Oct 2022 09:07:33 +0800
From: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@...el.com>
To: intel-wired-lan@...osl.org
Cc: netdev@...r.kernel.org, kuba@...nel.org, davem@...emloft.net,
edumazet@...gle.com, aravindhan.gunasekaran@...el.com,
richardcochran@...il.com, gal@...dia.com, saeed@...nel.org,
leon@...nel.org, michael.chan@...adcom.com, andy@...yhouse.net,
muhammad.husaini.zulkifli@...el.com, vinicius.gomes@...el.com
Subject: [PATCH v2 5/5] ethtool: Add support for HWTSTAMP_FILTER_DMA_TIMESTAMP
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@...el.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 --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);
--
2.17.1
Powered by blists - more mailing lists