lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240823174027.GB2164@kernel.org>
Date: Fri, 23 Aug 2024 18:40:27 +0100
From: Simon Horman <horms@...nel.org>
To: Yunsheng Lin <linyunsheng@...wei.com>
Cc: davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Alexander Duyck <alexander.duyck@...il.com>,
	Ayush Sawal <ayush.sawal@...lsio.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Willem de Bruijn <willemdebruijn.kernel@...il.com>,
	Jason Wang <jasowang@...hat.com>, Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
	Valentin Schneider <vschneid@...hat.com>,
	John Fastabend <john.fastabend@...il.com>,
	Jakub Sitnicki <jakub@...udflare.com>,
	David Ahern <dsahern@...nel.org>,
	Matthieu Baerts <matttbe@...nel.org>,
	Mat Martineau <martineau@...nel.org>,
	Geliang Tang <geliang@...nel.org>,
	Jamal Hadi Salim <jhs@...atatu.com>,
	Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko <jiri@...nulli.us>,
	Boris Pismenny <borisp@...dia.com>, bpf@...r.kernel.org,
	mptcp@...ts.linux.dev
Subject: Re: [PATCH net-next v14 09/11] net: replace page_frag with
 page_frag_cache

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ