[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgT0UeSbXTXoOuTZS918pZQcCVZBXiTseN-NUBTGt71ctQ2Vw@mail.gmail.com>
Date: Thu, 3 Oct 2024 20:00:14 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: Yunsheng Lin <yunshenglin0825@...il.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Yunsheng Lin <linyunsheng@...wei.com>, Eric Dumazet <edumazet@...gle.com>,
David Ahern <dsahern@...nel.org>
Subject: Re: [PATCH net-next v19 09/14] net: rename skb_copy_to_page_nocache() helper
On Tue, Oct 1, 2024 at 12:59 AM Yunsheng Lin <yunshenglin0825@...il.com> wrote:
>
> Rename skb_copy_to_page_nocache() to skb_copy_to_va_nocache()
> to avoid calling virt_to_page() as we are about to pass virtual
> address directly.
>
> CC: Alexander Duyck <alexander.duyck@...il.com>
> Signed-off-by: Yunsheng Lin <linyunsheng@...wei.com>
> ---
> include/net/sock.h | 10 ++++------
> net/ipv4/tcp.c | 7 +++----
> net/kcm/kcmsock.c | 7 +++----
> 3 files changed, 10 insertions(+), 14 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index c58ca8dd561b..7d0b606d6251 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -2185,15 +2185,13 @@ static inline int skb_add_data_nocache(struct sock *sk, struct sk_buff *skb,
> return err;
> }
>
> -static inline int skb_copy_to_page_nocache(struct sock *sk, struct iov_iter *from,
> - struct sk_buff *skb,
> - struct page *page,
> - int off, int copy)
> +static inline int skb_copy_to_va_nocache(struct sock *sk, struct iov_iter *from,
> + struct sk_buff *skb, char *va,
> + int copy)
> {
This new naming is kind of confusing. Currently the only other
"skb_copy_to" functions are skb_copy_to_linear_data and
skb_copy_to_linear_data_offset. The naming before basically indicated
which part of the skb the data was being copied into. So before we
were copying into the "page" frags. With the new naming this function
is much less clear as technically the linear data can also be a
virtual address.
I would recommend maybe replacing "va" with "frag", "page_frag" or
maybe "pfrag" as what we are doing is copying the data to one of the
pages in the paged frags section of the skb before they are added to
the skb itself.
Powered by blists - more mailing lists