Re: [PATCH net-next 2/4] chelsio: Convert chtls_sendpage() to use MSG_SPLICE_PAGES

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> cc: Ayush Sawal <ayush.sawal@xxxxxxxxxxx>
> cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> cc: Paolo Abeni <pabeni@xxxxxxxxxx>
> cc: Jens Axboe <axboe@xxxxxxxxx>
> cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> cc: netdev@xxxxxxxxxxxxxxx
> ---
>  .../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





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux