linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: David Howells <dhowells@redhat.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	David Ahern <dsahern@kernel.org>,
	Matthew Wilcox <willy@infradead.org>,
	Jens Axboe <axboe@kernel.dk>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Ayush Sawal <ayush.sawal@chelsio.com>
Subject: Re: [PATCH net-next 2/4] chelsio: Convert chtls_sendpage() to use MSG_SPLICE_PAGES
Date: Thu, 25 May 2023 09:50:54 +0200	[thread overview]
Message-ID: <ZG8TXgs+36O9AS93@corigine.com> (raw)
In-Reply-To: <20230524144923.3623536-3-dhowells@redhat.com>

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@redhat.com>
> cc: Ayush Sawal <ayush.sawal@chelsio.com>
> cc: "David S. Miller" <davem@davemloft.net>
> cc: Eric Dumazet <edumazet@google.com>
> cc: Jakub Kicinski <kuba@kernel.org>
> cc: Paolo Abeni <pabeni@redhat.com>
> cc: Jens Axboe <axboe@kernel.dk>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: netdev@vger.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



  reply	other threads:[~2023-05-25  7:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 14:49 [PATCH net-next 0/4] splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES), part 2 David Howells
2023-05-24 14:49 ` [PATCH net-next 1/4] chelsio: Support MSG_SPLICE_PAGES David Howells
2023-05-24 14:49 ` [PATCH net-next 2/4] chelsio: Convert chtls_sendpage() to use MSG_SPLICE_PAGES David Howells
2023-05-25  7:50   ` Simon Horman [this message]
2023-05-25  8:41   ` David Howells
2023-05-25  8:50     ` Simon Horman
2023-05-24 14:49 ` [PATCH net-next 3/4] kcm: Support MSG_SPLICE_PAGES David Howells
2023-05-27  3:12   ` Jakub Kicinski
2023-05-31  8:51   ` David Howells
2023-05-24 14:49 ` [PATCH net-next 4/4] kcm: Convert kcm_sendpage() to use MSG_SPLICE_PAGES David Howells

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=ZG8TXgs+36O9AS93@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=axboe@kernel.dk \
    --cc=ayush.sawal@chelsio.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=willy@infradead.org \
    /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