Prepare to copy XDP metadata into an skb extension chunk. To access the metadata contents, we need to know where it is located. Document the expectation - skb->data must point right past the metadata when skb_metadata_set gets called.
Signed-off-by: Jakub Sitnicki <[email protected]> --- include/linux/skbuff.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 86737076101d..df001283076f 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4554,6 +4554,13 @@ static inline bool skb_metadata_differs(const struct sk_buff *skb_a, true : __skb_metadata_differs(skb_a, skb_b, len_a); } +/** + * skb_metadata_set - Record packet metadata length. + * @skb: packet carrying the metadata + * @meta_len: number of bytes of metadata preceding skb->data + * + * Must be called when skb->data already points past the metadata area. + */ static inline void skb_metadata_set(struct sk_buff *skb, u8 meta_len) { skb_shinfo(skb)->meta_len = meta_len; -- 2.43.0
