diff mbox series

[1/1] UBUNTU: SAUCE: (no-up) igc: Add RX HW timestamp to support XDP zero copy

Message ID 20230608190941.29063-2-philip.cox@canonical.com
State New
Headers show
Series TSN - Cache HW timestamp | expand

Commit Message

Philip Cox June 8, 2023, 7:09 p.m. UTC
From: mohd faizal abdul rahim <faizal.abdul.rahim@intel.com>

BugLink: https://bugs.launchpad.net/bugs/2023325

Enable the Rx HW Timestamp using metadata to userspace.

Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Signed-off-by: Mohd Faizal Abdul rahim <faizal.abdul.rahim@intel.com>
(patch from launchpad)
Signed-off-by: Philip Cox <philip.cox@canonical.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 5e3b653574e2..c34d7b81180e 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -2746,6 +2746,7 @@  static int igc_clean_rx_irq_zc(struct igc_q_vector *q_vector, const int budget)
 		struct igc_rx_buffer *bi;
 		ktime_t timestamp = 0;
 		unsigned int size;
+		ktime_t *rxhwts;
 		int res;
 
 		desc = IGC_RX_DESC(ring, ntc);
@@ -2775,6 +2776,9 @@  static int igc_clean_rx_irq_zc(struct igc_q_vector *q_vector, const int budget)
 		}
 
 		bi->xdp->data_end = bi->xdp->data + size;
+		rxhwts = bi->xdp->data - sizeof(ktime_t);
+		*rxhwts = timestamp;
+		bi->xdp->data_meta = rxhwts;
 		xsk_buff_dma_sync_for_cpu(bi->xdp, ring->xsk_pool);
 
 		res = __igc_xdp_run_prog(adapter, prog, bi->xdp);