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

From: Mina Almasry
Date: Tue Feb 06 2024 - 13:17:57 EST


On Tue, Feb 6, 2024 at 1:30 AM Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
>
> On Thu, 2024-02-01 at 13:34 -0800, Mina Almasry wrote:
> > @@ -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;
> > +}
>
> > +
> > +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