linux-stable/net/ethtool
Willem de Bruijn b534dc46c8 net_tstamp: add SOF_TIMESTAMPING_OPT_ID_TCP
Add an option to initialize SOF_TIMESTAMPING_OPT_ID for TCP from
write_seq sockets instead of snd_una.

This should have been the behavior from the start. Because processes
may now exist that rely on the established behavior, do not change
behavior of the existing option, but add the right behavior with a new
flag. It is encouraged to always set SOF_TIMESTAMPING_OPT_ID_TCP on
stream sockets along with the existing SOF_TIMESTAMPING_OPT_ID.

Intuitively the contract is that the counter is zero after the
setsockopt, so that the next write N results in a notification for
the last byte N - 1.

On idle sockets snd_una == write_seq and this holds for both. But on
sockets with data in transmission, snd_una records the unacked offset
in the stream. This depends on the ACK response from the peer. A
process cannot learn this in a race free manner (ioctl SIOCOUTQ is one
racy approach).

write_seq records the offset at the last byte written by the process.
This is a better starting point. It matches the intuitive contract in
all circumstances, unaffected by external behavior.

The new timestamp flag necessitates increasing sk_tsflags to 32 bits.
Move the field in struct sock to avoid growing the socket (for some
common CONFIG variants). The UAPI interface so_timestamping.flags is
already int, so 32 bits wide.

Reported-by: Sotirios Delimanolis <sotodel@meta.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20221207143701.29861-1-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-12-08 19:49:21 -08:00
..
Makefile ethtool: add netlink based get rss support 2022-12-05 17:25:00 -08:00
bitset.c ethtool: fix stack overflow in ethnl_parse_bitset() 2020-12-09 15:50:38 -08:00
bitset.h ethtool: add ethnl_parse_bitset() helper 2020-03-12 15:32:32 -07:00
cabletest.c net: delete extra space and tab in blank line 2022-07-25 19:38:31 -07:00
channels.c ethtool: Fail number of channels change when it conflicts with rxnfc 2022-11-08 12:08:44 +01:00
coalesce.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
common.c net_tstamp: add SOF_TIMESTAMPING_OPT_ID_TCP 2022-12-08 19:49:21 -08:00
common.h ethtool: Fail number of channels change when it conflicts with rxnfc 2022-11-08 12:08:44 +01:00
debug.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
eee.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
eeprom.c ethtool: eeprom: fix null-deref on genl_info in dump 2022-10-24 19:08:07 -07:00
features.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
fec.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
ioctl.c ethtool: avoiding integer overflow in ethtool_phys_id() 2022-11-23 20:03:51 -08:00
linkinfo.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
linkmodes.c net: phy: Add support for rate matching 2022-09-23 11:55:35 +01:00
linkstate.c ethtool: linkstate: add a statistic for PHY down events 2022-11-08 10:36:54 +01:00
module.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
netlink.c ethtool: add netlink based get rss support 2022-12-05 17:25:00 -08:00
netlink.h ethtool: add netlink based get rss support 2022-12-05 17:25:00 -08:00
pause.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
phc_vclocks.c ethtool: add a new command for getting PHC virtual clocks 2021-07-01 13:08:18 -07:00
privflags.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00
pse-pd.c ethtool: pse-pd: fix null-deref on genl_info in dump 2022-10-21 13:18:05 +01:00
rings.c net: ethtool: move checks before rtnl_lock() in ethnl_set_rings 2022-04-15 11:41:45 -07:00
rss.c ethtool: add netlink based get rss support 2022-12-05 17:25:00 -08:00
stats.c ethtool: stats: Use struct_group() to clear all stats at once 2021-11-19 11:53:02 +00:00
strset.c ethtool: strset: report missing ETHTOOL_A_STRINGSET_ID via ext_ack 2022-08-30 12:20:43 +02:00
tsinfo.c ethtool: link up ethnl_header_policy as a nested policy 2020-10-06 06:25:55 -07:00
tunnels.c ethtool: tunnels: check the return value of nla_nest_start() 2022-09-22 19:28:10 -07:00
wol.c ethtool: use ethnl_parse_header_dev_put() 2021-12-15 10:27:47 +00:00