Thread (5 messages) 5 messages, 2 authors, 2024-02-06

Re: [PATCH net-next v7 2/2] net: add netmem to skb_frag_t

From: Mina Almasry <hidden>
Date: 2024-02-06 18:17:45
Also in: lkml

On Tue, Feb 6, 2024 at 1:30 AM Paolo Abeni [off-list ref] wrote:
On Thu, 2024-02-01 at 13:34 -0800, Mina Almasry wrote:
quoted
@@ -2528,8 +2562,25 @@ static inline void skb_fill_page_desc_noacc(struct sk_buff *skb, int i,
      shinfo->nr_frags = i + 1;
 }

-void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off,
-                  int size, unsigned int truesize);
+static inline void skb_add_rx_frag_netmem(struct sk_buff *skb, int i,
+                                       netmem_ref netmem, int off, int size,
+                                       unsigned int truesize)
+{
+     DEBUG_NET_WARN_ON_ONCE(size > truesize);
+
+     skb_fill_netmem_desc(skb, i, netmem, off, size);
+     skb->len += size;
+     skb->data_len += size;
+     skb->truesize += truesize;
+}
quoted
+
+static inline void skb_add_rx_frag(struct sk_buff *skb, int i,
+                                struct page *page, int off, int size,
+                                unsigned int truesize)
+{
+     skb_add_rx_frag_netmem(skb, i, page_to_netmem(page), off, size,
+                            truesize);
+}
I'm very sorry, I was not clear in my previous feedback: only
skb_add_rx_frag() was supposed to be 'static inline'.

skb_add_rx_frag_netmem() contains a few more instructions and there are
a lot of callers, always inline it does not look the best option.

I'm sorry for requiring an additional iteration, but feel free to ad my
Acked-by with the above change.
No worries, minor miscommunication. I'm happy to respin with the change. Thanks!



-- 
Thanks,
Mina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help