From: Paolo Abeni <pabeni@redhat.com>
To: Mina Almasry <almasrymina@google.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Jason Gunthorpe" <jgg@nvidia.com>,
"Christian König" <christian.koenig@amd.com>,
"Shakeel Butt" <shakeelb@google.com>,
"Yunsheng Lin" <linyunsheng@huawei.com>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>
Subject: Re: [PATCH net-next v7 2/2] net: add netmem to skb_frag_t
Date: Tue, 06 Feb 2024 10:30:14 +0100 [thread overview]
Message-ID: <1560533cb4eb3f36e640c9931fba93e0d0378652.camel@redhat.com> (raw)
In-Reply-To: <20240201213429.4120839-3-almasrymina@google.com>
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.
Cheers,
Paolo
next prev parent reply other threads:[~2024-02-06 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-01 21:34 [PATCH net-next v7 0/2] Abstract page from net stack Mina Almasry
2024-02-01 21:34 ` [PATCH net-next v7 1/2] net: introduce abstraction for network memory Mina Almasry
2024-02-01 21:34 ` [PATCH net-next v7 2/2] net: add netmem to skb_frag_t Mina Almasry
2024-02-06 9:30 ` Paolo Abeni [this message]
2024-02-06 18:17 ` Mina Almasry
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1560533cb4eb3f36e640c9931fba93e0d0378652.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=almasrymina@google.com \
--cc=christian.koenig@amd.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jgg@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=shakeelb@google.com \
--cc=willemdebruijn.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®