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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZG8TXgs+36O9AS93@corigine.com>
Date:   Thu, 25 May 2023 09:50:54 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     David Howells <dhowells@...hat.com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Willem de Bruijn <willemdebruijn.kernel@...il.com>,
        David Ahern <dsahern@...nel.org>,
        Matthew Wilcox <willy@...radead.org>,
        Jens Axboe <axboe@...nel.dk>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Ayush Sawal <ayush.sawal@...lsio.com>
Subject: Re: [PATCH net-next 2/4] chelsio: Convert chtls_sendpage() to use
 MSG_SPLICE_PAGES

On Wed, May 24, 2023 at 03:49:21PM +0100, David Howells wrote:
> Convert chtls_sendpage() to use sendmsg() with MSG_SPLICE_PAGES rather than
> directly splicing in the pages itself.
> 
> This allows ->sendpage() to be replaced by something that can handle
> multiple multipage folios in a single transaction.
> 
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Ayush Sawal <ayush.sawal@...lsio.com>
> cc: "David S. Miller" <davem@...emloft.net>
> cc: Eric Dumazet <edumazet@...gle.com>
> cc: Jakub Kicinski <kuba@...nel.org>
> cc: Paolo Abeni <pabeni@...hat.com>
> cc: Jens Axboe <axboe@...nel.dk>
> cc: Matthew Wilcox <willy@...radead.org>
> cc: netdev@...r.kernel.org
> ---
>  .../chelsio/inline_crypto/chtls/chtls_io.c    | 109 ++----------------
>  1 file changed, 7 insertions(+), 102 deletions(-)
> 
> diff --git a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
> index 1d08386ac916..65efd20ec796 100644
> --- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
> +++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c
> @@ -1240,110 +1240,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
>  int chtls_sendpage(struct sock *sk, struct page *page,
>  		   int offset, size_t size, int flags)
>  {
> -	struct chtls_sock *csk;
> -	struct chtls_dev *cdev;
> -	int mss, err, copied;
> -	struct tcp_sock *tp;
> -	long timeo;
> -
> -	tp = tcp_sk(sk);
> -	copied = 0;
> -	csk = rcu_dereference_sk_user_data(sk);
> -	cdev = csk->cdev;
> -	lock_sock(sk);
> -	timeo = sock_sndtimeo(sk, flags & MSG_DONTWAIT);
> +	struct bio_vec bvec;
> +	struct msghdr msg = { .msg_flags = flags | MSG_SPLICE_PAGES, };
>  

Hi David,

a minor nit, in case you need to repost this series for some other reason.

Please use reverse Xmas tree - longest line to shortest - order for
Networking code. I understand this file doesn't adhere to that, and
we probably don't want churn due to addressing it throughout this file.
But my preference is to move towards this standard, or at least not away
from it.

So in this case:

	struct msghdr msg = { .msg_flags = flags | MSG_SPLICE_PAGES, };
	struct bio_vec bvec;

This tool can be useful:

	https://github.com/ecree-solarflare/xmastree

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ