From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, kerneljasonxing@gmail.com, pav@iki.fi,
gerhard@engleder-embedded.com, vinicius.gomes@intel.com,
anthony.l.nguyen@intel.com, Willem de Bruijn <willemb@google.com>
Subject: Re: [PATCH net-next] net: skb: free up one bit in tx_flags
Date: Mon, 24 Feb 2025 14:21:04 -0800 [thread overview]
Message-ID: <20250224142104.14f44a27@kernel.org> (raw)
In-Reply-To: <20250221035938.2891898-1-willemdebruijn.kernel@gmail.com>
On Thu, 20 Feb 2025 22:58:20 -0500 Willem de Bruijn wrote:
> 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.
This needs a respin, presumably because Jason's series reached net-next
already.
--
pw-bot: cr
prev parent reply other threads:[~2025-02-24 22:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 3:58 [PATCH net-next] net: skb: free up one bit in tx_flags Willem de Bruijn
2025-02-21 6:12 ` Jason Xing
2025-02-21 21:11 ` Gerhard Engleder
2025-02-24 22:21 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250224142104.14f44a27@kernel.org \
--to=kuba@kernel.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerhard@engleder-embedded.com \
--cc=kerneljasonxing@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pav@iki.fi \
--cc=vinicius.gomes@intel.com \
--cc=willemb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).