public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Lee Duncan <lduncan@suse.com>
To: Mike Christie <michael.christie@oracle.com>,
	cleech@redhat.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, jejb@linux.ibm.com
Subject: Re: [PATCH 06/12] scsi: iscsi_tcp: Use sendpage for the PDU header
Date: Sat, 12 Mar 2022 11:42:14 -0800	[thread overview]
Message-ID: <49ce092f-b97c-53a6-85ff-490eeeba4f47@suse.com> (raw)
In-Reply-To: <20220308002747.122682-7-michael.christie@oracle.com>

On 3/7/22 16:27, Mike Christie wrote:
> This has us use zero copy the PDU header.
> 
> Signed-off-by: Mike Christie <michael.christie@oracle.com>
> ---
>   drivers/scsi/iscsi_tcp.c | 30 ++++++++++++++++++++++--------
>   1 file changed, 22 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
> index 261599938fc9..3bdefc4b6b17 100644
> --- a/drivers/scsi/iscsi_tcp.c
> +++ b/drivers/scsi/iscsi_tcp.c
> @@ -306,7 +306,7 @@ static int iscsi_sw_tcp_xmit_segment(struct iscsi_tcp_conn *tcp_conn,
>   		copy = segment->size - offset;
>   
>   		if (segment->total_copied + segment->size < segment->total_size)
> -			flags |= MSG_MORE;
> +			flags |= MSG_MORE | MSG_SENDPAGE_NOTLAST;
>   
>   		/* Use sendpage if we can; else fall back to sendmsg */
>   		if (!segment->data) {
> @@ -315,13 +315,27 @@ static int iscsi_sw_tcp_xmit_segment(struct iscsi_tcp_conn *tcp_conn,
>   			r = tcp_sw_conn->sendpage(sk, sg_page(sg), offset,
>   						  copy, flags);
>   		} else {
> -			struct msghdr msg = { .msg_flags = flags };
> -			struct kvec iov = {
> -				.iov_base = segment->data + offset,
> -				.iov_len = copy
> -			};
> -
> -			r = kernel_sendmsg(sk, &msg, &iov, 1, copy);
> +			void *data = segment->data + offset;
> +
> +			/*
> +			 * Make sure it's ok to send the header using zero
> +			 * copy. The case where the sg page can't be zero
> +			 * copied will also go down the sendmsg path.
> +			 */
> +			if (sendpage_ok(data)) {
> +				r = tcp_sw_conn->sendpage(sk,
> +						virt_to_page(data),
> +						offset_in_page(data), copy,
> +						flags);
> +			} else {
> +				struct msghdr msg = { .msg_flags = flags };
> +				struct kvec iov = {
> +					.iov_base = data,
> +					.iov_len = copy,
> +				};
> +
> +				r = kernel_sendmsg(sk, &msg, &iov, 1, copy);
> +			}
>   		}
>   
>   		if (r < 0) {

Reviewed-by: Lee Duncan <lduncan@suse.com>


  reply	other threads:[~2022-03-12 19:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  0:27 [[PATCH 00/12] misc iscsi patches Mike Christie
2022-03-08  0:27 ` [PATCH 01/12] scsi: iscsi: Merge suspend fields Mike Christie
2022-03-08 18:47   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 02/12] scsi: iscsi: Rename iscsi_conn_queue_work Mike Christie
2022-03-08 18:49   ` Lee Duncan
2022-03-09  0:55   ` Wu Bo
2022-03-08  0:27 ` [PATCH 03/12] scsi: iscsi: Add recv workqueue helpers Mike Christie
2022-03-10 22:50   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 04/12] scsi: iscsi: Allow a recv and xmit work to run Mike Christie
2022-03-08 19:00   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 05/12] scsi: iscsi: Run recv path from workqueue Mike Christie
2022-03-18 16:45   ` Lee Duncan
2022-03-18 22:11     ` Mike Christie
2022-03-08  0:27 ` [PATCH 06/12] scsi: iscsi_tcp: Use sendpage for the PDU header Mike Christie
2022-03-12 19:42   ` Lee Duncan [this message]
2022-03-08  0:27 ` [PATCH 07/12] scsi: iscsi_tcp: Drop target_alloc use Mike Christie
2022-03-09  1:31   ` Wu Bo
2022-03-12 19:43   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 08/12] scsi: iscsi: remove unneeded task state check Mike Christie
2022-03-09  1:33   ` Wu Bo
2022-03-14 17:13   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 09/12] scsi: iscsi: Remove iscsi_get_task back_lock requirement Mike Christie
2022-03-14 17:44   ` Lee Duncan
2022-03-18 17:31   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 10/12] scsi: iscsi: Try to avoid taking back_lock in xmit path Mike Christie
2022-03-18 17:37   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 11/12] scsi: libiscsi: improve conn_send_pdu API Mike Christie
2022-03-18 16:49   ` Lee Duncan
2022-03-08  0:27 ` [PATCH 12/12] scsi: iscsi: Fix race between recovery and task xmit Mike Christie
2022-03-14 17:46   ` Lee Duncan

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=49ce092f-b97c-53a6-85ff-490eeeba4f47@suse.com \
    --to=lduncan@suse.com \
    --cc=cleech@redhat.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=michael.christie@oracle.com \
    /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