From: Simon Horman <horms@kernel•org>
To: Yunsheng Lin <linyunsheng@huawei•com>
Cc: davem@davemloft•net, kuba@kernel•org, pabeni@redhat•com,
netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
Alexander Duyck <alexander.duyck@gmail•com>,
Ayush Sawal <ayush.sawal@chelsio•com>,
Eric Dumazet <edumazet@google•com>,
Willem de Bruijn <willemdebruijn.kernel@gmail•com>,
Jason Wang <jasowang@redhat•com>, Ingo Molnar <mingo@redhat•com>,
Peter Zijlstra <peterz@infradead•org>,
Juri Lelli <juri.lelli@redhat•com>,
Vincent Guittot <vincent.guittot@linaro•org>,
Dietmar Eggemann <dietmar.eggemann@arm•com>,
Steven Rostedt <rostedt@goodmis•org>,
Ben Segall <bsegall@google•com>, Mel Gorman <mgorman@suse•de>,
Valentin Schneider <vschneid@redhat•com>,
John Fastabend <john.fastabend@gmail•com>,
Jakub Sitnicki <jakub@cloudflare•com>,
David Ahern <dsahern@kernel•org>,
Matthieu Baerts <matttbe@kernel•org>,
Mat Martineau <martineau@kernel•org>,
Geliang Tang <geliang@kernel•org>,
Jamal Hadi Salim <jhs@mojatatu•com>,
Cong Wang <xiyou.wangcong@gmail•com>,
Jiri Pirko <jiri@resnulli•us>, Boris Pismenny <borisp@nvidia•com>,
bpf@vger•kernel.org, mptcp@lists•linux.dev
Subject: Re: [PATCH net-next v14 09/11] net: replace page_frag with page_frag_cache
Date: Fri, 23 Aug 2024 18:40:27 +0100 [thread overview]
Message-ID: <20240823174027.GB2164@kernel.org> (raw)
In-Reply-To: <20240823150040.1567062-10-linyunsheng@huawei.com>
On Fri, Aug 23, 2024 at 11:00:37PM +0800, Yunsheng Lin wrote:
> @@ -1114,82 +1104,44 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
> if (err)
> goto do_fault;
> } else {
> + struct page_frag_cache *nc = &sk->sk_frag;
> + struct page_frag page_frag, *pfrag;
> int i = skb_shinfo(skb)->nr_frags;
> - struct page *page = TCP_PAGE(sk);
> - int pg_size = PAGE_SIZE;
> - int off = TCP_OFF(sk);
> - bool merge;
> -
> - if (page)
> - pg_size = page_size(page);
> - if (off < pg_size &&
> - skb_can_coalesce(skb, i, page, off)) {
> + bool merge = false;
> + void *va;
> +
> + pfrag = &page_frag;
> + va = page_frag_alloc_refill_prepare(pfrag, 32U, pfrag,
> + sk->sk_allocation);
Unfortunately this does not seem to compile.
.../chtls_io.c: In function 'chtls_sendmsg':
.../chtls_io.c:1114:61: error: passing argument 1 of 'page_frag_alloc_refill_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
1114 | va = page_frag_alloc_refill_prepare(pfrag, 32U, pfrag,
| ^~~~~
| |
| struct page_frag *
In file included from ./include/linux/skbuff.h:34,
from .../chtls_io.c:11:
./include/linux/page_frag_cache.h:205:76: note: expected 'struct page_frag_cache *' but argument is of type 'struct page_frag *'
205 | static inline void *page_frag_alloc_refill_prepare(struct page_frag_cache *nc,
| ~~~~~~~~~~~~~~~~~~~~~~~~^~
...
--
pw-bot: cr
next prev parent reply other threads:[~2024-08-23 17:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 15:00 [PATCH net-next v14 00/11] Replace page_frag with page_frag_cache for sk_page_frag() Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 01/11] mm: page_frag: add a test module for page_frag Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 02/11] mm: move the page fragment allocator from page_alloc into its own file Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 03/11] mm: page_frag: use initial zero offset for page_frag_alloc_align() Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 04/11] mm: page_frag: avoid caller accessing 'page_frag_cache' directly Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 05/11] mm: page_frag: reuse existing space for 'size' and 'pfmemalloc' Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 06/11] mm: page_frag: use __alloc_pages() to replace alloc_pages_node() Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 07/11] net: rename skb_copy_to_page_nocache() helper Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 08/11] mm: page_frag: introduce prepare/probe/commit API Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 09/11] net: replace page_frag with page_frag_cache Yunsheng Lin
2024-08-23 17:40 ` Simon Horman [this message]
2024-08-23 15:00 ` [PATCH net-next v14 10/11] mm: page_frag: update documentation for page_frag Yunsheng Lin
2024-08-23 15:00 ` [PATCH net-next v14 11/11] mm: page_frag: add an entry in MAINTAINERS " Yunsheng Lin
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=20240823174027.GB2164@kernel.org \
--to=horms@kernel$(echo .)org \
--cc=alexander.duyck@gmail$(echo .)com \
--cc=ayush.sawal@chelsio$(echo .)com \
--cc=borisp@nvidia$(echo .)com \
--cc=bpf@vger$(echo .)kernel.org \
--cc=bsegall@google$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=dietmar.eggemann@arm$(echo .)com \
--cc=dsahern@kernel$(echo .)org \
--cc=edumazet@google$(echo .)com \
--cc=geliang@kernel$(echo .)org \
--cc=jakub@cloudflare$(echo .)com \
--cc=jasowang@redhat$(echo .)com \
--cc=jhs@mojatatu$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=john.fastabend@gmail$(echo .)com \
--cc=juri.lelli@redhat$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linyunsheng@huawei$(echo .)com \
--cc=martineau@kernel$(echo .)org \
--cc=matttbe@kernel$(echo .)org \
--cc=mgorman@suse$(echo .)de \
--cc=mingo@redhat$(echo .)com \
--cc=mptcp@lists$(echo .)linux.dev \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=peterz@infradead$(echo .)org \
--cc=rostedt@goodmis$(echo .)org \
--cc=vincent.guittot@linaro$(echo .)org \
--cc=vschneid@redhat$(echo .)com \
--cc=willemdebruijn.kernel@gmail$(echo .)com \
--cc=xiyou.wangcong@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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