linux/drivers
Song Yoong Siang 15fd021bc4 igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet
This patch adds support to per-packet Tx hardware timestamp request to
AF_XDP zero-copy packet via XDP Tx metadata framework. Please note that
user needs to enable Tx HW timestamp capability via igc_ioctl() with
SIOCSHWTSTAMP cmd before sending xsk Tx hardware timestamp request.

Same as implementation in RX timestamp XDP hints kfunc metadata, Timer 0
(adjustable clock) is used in xsk Tx hardware timestamp. i225/i226 have
four sets of timestamping registers. *skb and *xsk_tx_buffer pointers
are used to indicate whether the timestamping register is already occupied.

Furthermore, a boolean variable named xsk_pending_ts is used to hold the
transmit completion until the tx hardware timestamp is ready. This is
because, for i225/i226, the timestamp notification event comes some time
after the transmit completion event. The driver will retrigger hardware irq
to clean the packet after retrieve the tx hardware timestamp.

Besides, xsk_meta is added into struct igc_tx_timestamp_request as a hook
to the metadata location of the transmit packet. When the Tx timestamp
interrupt is fired, the interrupt handler will copy the value of Tx hwts
into metadata location via xsk_tx_metadata_complete().

This patch is tested with tools/testing/selftests/bpf/xdp_hw_metadata
on Intel ADL-S platform. Below are the test steps and results.

Test Step 1: Run xdp_hw_metadata app
 ./xdp_hw_metadata <iface> > /dev/shm/result.log

Test Step 2: Enable Tx hardware timestamp
 hwstamp_ctl -i <iface> -t 1 -r 1

Test Step 3: Run ptp4l and phc2sys for time synchronization

Test Step 4: Generate UDP packets with 1ms interval for 10s
 trafgen --dev <iface> '{eth(da=<addr>), udp(dp=9091)}' -t 1ms -n 10000

Test Step 5: Rerun Step 1-3 with 10s iperf3 as background traffic

Test Step 6: Rerun Step 1-4 with 10s iperf3 as background traffic

Based on iperf3 results below, the impact of holding tx completion to
throughput is not observable.

Result of last UDP packet (no. 10000) in Step 4:
poll: 1 (0) skip=99 fail=0 redir=10000
xsk_ring_cons__peek: 1
0x5640a37972d0: rx_desc[9999]->addr=f2110 addr=f2110 comp_addr=f2110 EoP
rx_hash: 0x2049BE1D with RSS type:0x1
HW RX-time:   1679819246792971268 (sec:1679819246.7930) delta to User RX-time sec:0.0000 (14.990 usec)
XDP RX-time:   1679819246792981987 (sec:1679819246.7930) delta to User RX-time sec:0.0000 (4.271 usec)
No rx_vlan_tci or rx_vlan_proto, err=-95
0x5640a37972d0: ping-pong with csum=ab19 (want 315b) csum_start=34 csum_offset=6
0x5640a37972d0: complete tx idx=9999 addr=f010
HW TX-complete-time:   1679819246793036971 (sec:1679819246.7930) delta to User TX-complete-time sec:0.0001 (77.656 usec)
XDP RX-time:   1679819246792981987 (sec:1679819246.7930) delta to User TX-complete-time sec:0.0001 (132.640 usec)
HW RX-time:   1679819246792971268 (sec:1679819246.7930) delta to HW TX-complete-time sec:0.0001 (65.703 usec)
0x5640a37972d0: complete rx idx=10127 addr=f2110

Result of iperf3 without tx hwts request in step 5:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.74 GBytes  2.36 Gbits/sec    0             sender
[  5]   0.00-10.05  sec  2.74 GBytes  2.34 Gbits/sec                  receiver

Result of iperf3 running parallel with trafgen command in step 6:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.74 GBytes  2.36 Gbits/sec    0             sender
[  5]   0.00-10.04  sec  2.74 GBytes  2.34 Gbits/sec                  receiver

Co-developed-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://lore.kernel.org/r/20240424210256.3440903-1-anthony.l.nguyen@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-04-26 15:23:59 +02:00
..
accel accel/ivpu: Fix deadlock in context_xa 2024-04-08 10:55:01 +02:00
accessibility speakup: Avoid crash on very long word 2024-04-11 14:32:53 +02:00
acpi ACPI: scan: Do not increase dep_unmet for already met dependencies 2024-04-08 16:44:14 +02:00
amba
android binder: check offset alignment in binder_get_object() 2024-04-11 15:19:12 +02:00
ata ata: libata-core: Allow command duration limits detection for ACS-4 drives 2024-04-13 10:42:28 +09:00
atm atm: fore200e: Convert to platform remove callback returning void 2024-03-07 20:36:32 -08:00
auxdisplay auxdisplay: img-ascii-lcd: Convert to platform remove callback returning void 2024-03-12 17:37:54 +02:00
base regmap: Fixes for v6.9 2024-04-05 17:21:16 -07:00
bcma bcma: convert to platform remove callback returning void 2024-03-12 17:32:55 +02:00
block nullblk: Fix cleanup order in null_add_dev() error path 2024-04-02 07:43:24 -06:00
bluetooth Bluetooth: qca: set power_ctrl_enabled on NULL returned by gpiod_get_optional() 2024-04-24 16:26:22 -04:00
bus Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
cache cache: sifive_ccache: Partially convert to a platform driver 2024-03-28 22:40:56 +00:00
cdrom cdrom: gdrom: Convert to platform remove callback returning void 2024-03-07 11:53:30 -07:00
cdx cdx: add MSI support for CDX bus 2024-03-07 21:52:03 +00:00
char random: handle creditable entropy from atomic process context 2024-04-17 13:53:18 +02:00
clk clk: mediatek: mt7988-infracfg: fix clocks for 2nd PCIe port 2024-04-10 20:50:26 -07:00
clocksource A set of updates for clocksource and clockevent drivers: 2024-03-23 14:42:45 -07:00
comedi comedi: vmk80xx: fix incomplete endpoint checking 2024-04-11 15:16:23 +02:00
connector
counter
cpufreq RISC-V Patches for the 6.9 Merge Window 2024-03-22 10:41:13 -07:00
cpuidle RISC-V Patches for the 6.9 Merge Window 2024-03-22 10:41:13 -07:00
crypto devlink: extend devlink_param *set pointer 2024-04-22 13:05:19 -07:00
cxl cxl fixes for v6.9-rc4 2024-04-11 16:49:11 -07:00
dax libnvdimm updates for v6.9 2024-03-15 11:58:32 -07:00
dca
devfreq
dio dio: make dio_bus_type const 2024-03-07 20:37:04 +00:00
dma dmaengine updates for v6.9 2024-03-15 12:25:13 -07:00
dma-buf Merge drm/drm-fixes into drm-misc-fixes 2024-03-25 21:11:58 +01:00
dpll dpll: fix dpll_pin_on_pin_register() for multiple parent pins 2024-04-25 08:32:09 -07:00
edac - Add a FRU (Field Replaceable Unit) memory poison manager which 2024-03-11 18:14:06 -07:00
eisa
extcon
firewire firewire: ohci: mask bus reset interrupts between ISR and bottom half 2024-04-06 09:36:46 +09:00
firmware Arm FF-A fix for v6.9 2024-04-09 16:29:48 +02:00
fpga Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
fsi
gnss
gpio gpio: lpc32xx: fix module autoloading 2024-04-12 21:30:58 +02:00
gpu - Fix bo leak on error path during fb init 2024-04-19 10:40:47 +10:00
greybus Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
hid HID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled 2024-04-12 17:48:53 +02:00
hsi HSI: ssi_protocol: fix struct members kernel-doc warnings 2024-02-25 19:05:45 +01:00
hte
hv hyperv-fixes for v6.9-rc4 2024-04-11 16:23:56 -07:00
hwmon - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
hwspinlock hwspinlock: omap: Use index to get hwspinlock pointer 2024-03-05 20:01:14 -08:00
hwtracing coresight-tpda: Change qcom,dsb-element-size to qcom,dsb-elem-bits 2024-02-27 11:26:45 +00:00
i2c i2c: pxa: hide unused icr_bits[] variable 2024-04-04 01:07:57 +02:00
i3c i3c: Make i3c_bus_type const 2024-02-19 21:23:28 +01:00
idle cpuidle: ACPI/intel: fix MWAIT hint target C-state computation 2024-03-05 21:25:18 +01:00
iio Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-25 12:41:37 -07:00
input TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
interconnect interconnect fixes for v6.9-rc 2024-04-11 14:44:49 +02:00
iommu iommufd for 6.9 first rc 2024-04-19 14:02:21 -07:00
ipack ipack: make ipack_bus_type const 2024-03-07 20:32:47 +00:00
irqchip irqchip/gic-v3-its: Fix VSYNC referencing an unmapped VPE on GIC v4.1 2024-04-09 11:11:18 +02:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-11 14:23:47 -07:00
leds - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min 2024-03-14 18:03:09 -07:00
macintosh powerpc updates for 6.9 2024-03-15 17:53:48 -07:00
mailbox imx: add support for i.MX95 ELE/V2X MU 2024-03-13 12:23:36 -07:00
mcb mcb: constify the struct device_type usage 2024-03-07 20:38:15 +00:00
md Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-18 13:12:24 -07:00
media media: mediatek: vcodec: support 36 bits physical address 2024-03-26 09:52:59 +01:00
memory Char/Misc and other driver subsystem updates for 6.9-rc1 2024-03-21 13:21:31 -07:00
memstick MMC core: 2024-03-13 10:59:28 -07:00
message
mfd TTY/Serial driver update for 6.9-rc1 2024-03-21 12:44:10 -07:00
misc mei: vsc: Unregister interrupt handler for system suspend 2024-04-11 15:15:53 +02:00
mmc GPIO regression fixes for n8x0 2024-04-09 16:17:37 +02:00
most most: core: make mostbus const 2024-03-07 20:32:38 +00:00
mtd fs,block: yield devices early 2024-03-27 13:17:15 +01:00
mux
net igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet 2024-04-26 15:23:59 +02:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-25 12:41:37 -07:00
ntb
nubus
nvdimm libnvdimm updates for v6.9 2024-03-15 11:58:32 -07:00
nvme nvme-fc: rename free_ctrl callback to match name pattern 2024-04-04 08:47:56 -07:00
nvmem nvmem: core: Print error on wrong bits DT property 2024-03-07 20:21:53 +00:00
of of: property: Add fw_devlink support for pse parent 2024-04-16 19:17:16 -07:00
opp OPP: Extend dev_pm_opp_data with turbo support 2024-03-11 10:39:24 +05:30
parisc parisc: led: Convert to platform remove callback returning void 2024-03-08 10:00:07 +01:00
parport parport: sunbpp: Convert to platform remove callback returning void 2024-03-07 21:50:06 +00:00
pci Revert "PCI: Mark LSI FW643 to avoid bus reset" 2024-03-29 11:57:12 -05:00
pcmcia pcmcia: cs: make pcmcia_socket_class constant 2024-03-10 09:07:00 +01:00
peci
perf drivers/perf: riscv: Disable PERF_SAMPLE_BRANCH_* while not supported 2024-03-26 14:09:18 -07:00
phy USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
pinctrl Kbuild fixes for v6.9 2024-03-31 11:23:51 -07:00
platform platform-drivers-x86 for v6.9-3 2024-04-18 07:15:33 -07:00
pmdomain Core: 2024-03-13 11:33:10 -07:00
pnp
power power supply and reset changes for the 6.9 series 2024-03-14 10:19:48 -07:00
powercap powercap: intel_rapl: Convert to platform remove callback returning void 2024-03-13 20:45:54 +01:00
pps pps: use cflags-y instead of EXTRA_CFLAGS 2024-03-07 21:51:39 +00:00
ps3
ptp ptp: ptp_qoriq: Convert to platform remove callback returning void 2024-04-12 18:51:39 -07:00
pwm pwm: dwc: allow suspend/resume for 16 channels 2024-04-15 17:28:13 +02:00
rapidio
ras RAS: Avoid build errors when CONFIG_DEBUG_FS=n 2024-03-26 21:48:21 +01:00
regulator regulator: tps65132: Add of_match table 2024-03-25 19:28:27 +00:00
remoteproc remoteproc updates for v6.9 2024-03-21 10:37:39 -07:00
reset reset: Instantiate reset GPIO controller for shared reset-gpios 2024-02-21 11:53:25 +01:00
rpmsg
rtc RTC for 6.9 2024-03-21 17:16:46 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-25 12:41:37 -07:00
sbus This includes the following changes related to sparc for v6.9: 2024-03-15 12:47:21 -07:00
scsi scsi: core: Fix handling of SCMD_FAIL_IF_RECOVERING 2024-04-08 21:40:29 -04:00
sh
siox SIOX changes for 6.9-rc1 2024-03-21 15:18:18 -07:00
slimbus slimbus: core: make slimbus_bus const 2024-03-07 20:21:39 +00:00
soc Including fixes from CAN, netfilter, wireguard and IPsec. 2024-03-21 14:50:39 -07:00
soundwire soundwire updates for 6.9 2024-03-15 12:22:52 -07:00
spi spi: mchp-pci1xxx: Fix a possible null pointer dereference in pci1xxx_spi_probe 2024-04-03 11:04:58 +01:00
spmi
ssb ssb: use "break" on default case to prevent warning 2024-03-14 10:56:31 +02:00
staging staging: vc04_services: fix information leak in create_component() 2024-03-25 19:10:01 +01:00
target scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-04-05 21:37:54 -04:00
tc tc: make tc_bus_type const 2024-02-20 13:36:34 +01:00
tee ARM: SoC drivers for 6.9 2024-03-12 10:35:24 -07:00
thermal thermal/debugfs: Add missing count increment to thermal_debug_tz_trip_up() 2024-04-19 15:08:19 +02:00
thunderbolt thunderbolt: Avoid notify PM core about runtime PM resume 2024-04-10 10:49:58 +03:00
tty serial: stm32: Reset .throttled state in .startup() 2024-04-17 13:26:45 +02:00
ufs scsi: ufs: qcom: Add missing interconnect bandwidth values for Gear 5 2024-04-08 15:06:56 -04:00
uio hyperv-fixes for v6.9-rc4 2024-04-11 16:23:56 -07:00
usb USB-serial device ids for 6.9-rc5 2024-04-19 16:07:18 +02:00
vdpa vDPA: report virtio-blk flush info to user space 2024-03-19 02:45:51 -04:00
vfio VFIO updates for v6.9-rc1 2024-03-15 13:21:13 -07:00
vhost net: extend ubuf_info callback to ops structure 2024-04-22 16:21:35 -07:00
video fbdev: Select I/O-memory framebuffer ops for SBus 2024-03-25 21:34:08 +01:00
virt Revert "vmgenid: emit uevent when VMGENID updates" 2024-04-18 14:47:23 +02:00
virtio virtio: add debugfs infrastructure to allow to debug virtio features 2024-04-26 13:26:53 +02:00
w1 w1: w1-gpio: Convert to platform remove callback returning void 2024-02-20 11:24:34 +01:00
watchdog linux-watchdog 6.9-rc1 tag 2024-03-17 12:06:10 -07:00
xen xen: branch for v6.9-rc1 2024-03-19 08:48:09 -07:00
zorro zorro: Make zorro_bus_type const 2024-02-19 11:10:55 +01:00
Kconfig
Makefile Revert "leds: Only descend into leds directory when CONFIG_NEW_LEDS is set" 2024-03-07 08:48:10 +00:00