On Thu, Jul 24, 2025 at 01:53 PM +02, Jakub Sitnicki wrote: > 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? [...] > 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). Now that Martin has enlightened me [1] how things work today for skb payload dynptr's, I will first try to follow the same approach, that is: Make a copy of skb metadata before the BPF program runs, if the program may write to the metadata. [1] https://lore.kernel.org/all/0190e181-c592-454a-a99b-5ec361ce84e9@xxxxxxxxx/