]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/bpf: Enable Tx hwtstamp in xdp_hw_metadata
authorSong Yoong Siang <yoong.siang.song@intel.com>
Thu, 5 Dec 2024 05:19:36 +0000 (13:19 +0800)
committerMartin KaFai Lau <martin.lau@kernel.org>
Fri, 6 Dec 2024 00:37:16 +0000 (16:37 -0800)
Currently, user needs to manually enable transmit hardware timestamp
feature of certain Ethernet drivers, e.g. stmmac and igc drivers, through
following command after running the xdp_hw_metadata app.

sudo hwstamp_ctl -i eth0 -t 1

To simplify the step test of xdp_hw_metadata, set tx_type to HWTSTAMP_TX_ON
to enable hardware timestamping for all outgoing packets, so that user no
longer need to execute hwstamp_ctl command.

Signed-off-by: Song Yoong Siang <yoong.siang.song@intel.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20241205051936.3156307-1-yoong.siang.song@intel.com
tools/testing/selftests/bpf/xdp_hw_metadata.c

index ad6c08dfd6c8cc4ed38500f89b77049f262f1c64..e38675d9b11891f543e55b6408c4f2f23b4037b4 100644 (file)
@@ -551,6 +551,7 @@ static void hwtstamp_enable(const char *ifname)
 {
        struct hwtstamp_config cfg = {
                .rx_filter = HWTSTAMP_FILTER_ALL,
+               .tx_type = HWTSTAMP_TX_ON,
        };
 
        hwtstamp_ioctl(SIOCGHWTSTAMP, ifname, &saved_hwtstamp_cfg);