2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/net/ethernet/intel/igc
Willem de Bruijn e6116fc605 net: skb: free up one bit in tx_flags
The linked series wants to add skb tx completion timestamps.
That needs a bit in skb_shared_info.tx_flags, but all are in use.

A per-skb bit is only needed for features that are configured on a
per packet basis. Per socket features can be read from sk->sk_tsflags.

Per packet tsflags can be set in sendmsg using cmsg, but only those in
SOF_TIMESTAMPING_TX_RECORD_MASK.

Per packet tsflags can also be set without cmsg by sandwiching a
send inbetween two setsockopts:

    val |= SOF_TIMESTAMPING_$FEATURE;
    setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val));
    write(fd, buf, sz);
    val &= ~SOF_TIMESTAMPING_$FEATURE;
    setsockopt(fd, SOL_SOCKET, SO_TIMESTAMPING, &val, sizeof(val));

Changing a datapath test from skb_shinfo(skb)->tx_flags to
skb->sk->sk_tsflags can change behavior in that case, as the tx_flags
is written before the second setsockopt updates sk_tsflags.

Therefore, only bits can be reclaimed that cannot be set by cmsg and
are also highly unlikely to be used to target individual packets
otherwise.

Free up the bit currently used for SKBTX_HW_TSTAMP_USE_CYCLES. This
selects between clock and free running counter source for HW TX
timestamps. It is probable that all packets of the same socket will
always use the same source.

Link: https://lore.kernel.org/netdev/cover.1739988644.git.pav@iki.fi/
Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://patch.msgid.link/20250225023416.2088705-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-02-26 19:01:08 -08:00
..
igc_base.c igc: return early when failing to read EECD register 2025-01-07 09:01:15 -08:00
igc_base.h igc: Add support for PTP .getcyclesx64() 2023-11-13 15:17:09 -08:00
igc_defines.h igc: Move the MULTI GBT AN Control Register to _regs file 2024-08-30 07:44:39 -07:00
igc_diag.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_diag.h
igc_dump.c
igc_ethtool.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_hw.h igc: Remove unused igc_read/write_pcie_cap_reg 2025-01-06 13:32:44 -08:00
igc_i225.c igc: field get conversion 2023-12-18 11:20:43 -08:00
igc_i225.h
igc_leds.c igc: Fix LED-related deadlock on driver unbind 2024-04-24 20:09:30 -07:00
igc_mac.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_mac.h
igc_main.c net: skb: free up one bit in tx_flags 2025-02-26 19:01:08 -08:00
igc_nvm.c igc: Remove unused igc_acquire/release_nvm 2025-01-06 13:32:44 -08:00
igc_nvm.h igc: Remove unused igc_acquire/release_nvm 2025-01-06 13:32:44 -08:00
igc_phy.c igc: remove autoneg parameter from igc_mac_info 2024-11-13 10:30:21 -08:00
igc_phy.h igc: Change type of the 'igc_check_downshift' method 2022-05-10 14:02:53 -07:00
igc_ptp.c igc: Remove convert_art_ns_to_tsc() 2024-06-03 11:18:50 +02:00
igc_regs.h igc: Move the MULTI GBT AN Control Register to _regs file 2024-08-30 07:44:39 -07:00
igc_tsn.c igc: Add MQPRIO offload support 2024-08-30 07:33:46 -07:00
igc_tsn.h igc: Fix qbv_config_change_errors logics 2024-08-07 13:30:23 -07:00
igc_xdp.c igc: Avoid unnecessary link down event in XDP_SETUP_PROG process 2025-02-10 10:43:48 -08:00
igc_xdp.h
igc.h igc: Add launch time support to XDP ZC 2025-02-20 15:13:46 -08:00
Makefile net: intel: Use *-y instead of *-objs in Makefile 2024-06-10 19:52:44 -07:00