On Wed, Jul 23, 2025 at 05:30 PM -07, Jakub Kicinski wrote: > On Wed, 23 Jul 2025 19:36:47 +0200 Jakub Sitnicki wrote: >> Now that we can create a dynptr to skb metadata, make reads to the metadata >> area possible with bpf_dynptr_read() or through a bpf_dynptr_slice(), and >> make writes to the metadata area possible with bpf_dynptr_write() or >> through a bpf_dynptr_slice_rdwr(). > > What are the expectations around the writes? Presumably we could have > two programs writing into the same metadata if the SKB is a clone, no? In this series we maintain the status quo. Access metadata dynptr is limited to TC BPF hook only, so we provide the same guarntees as the existing __sk_buff->data_meta. Current situation, as I understand it, is that while packet taps are not an issue, you could probably do naughty things with 'tc action mirred' and end up with concurrent writes. Taking about the next step, once skb metadata is preserved past the TC hook - here my impression from Netdev was that the least suprising thing to do will be to copy-on-clone or copy-on-write (if we can pull it off).