All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	"Saleem, Shiraz" <shiraz.saleem@intel.com>
Cc: "Kalderon, Michal" <Michal.Kalderon@cavium.com>,
	"Amrani, Ram" <Ram.Amrani@cavium.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"Elior, Ariel" <Ariel.Elior@cavium.com>,
	target-devel <target-devel@vger.kernel.org>,
	Potnuri Bharat Teja <bharat@chelsio.com>
Subject: Re: SQ overflow seen running isert traffic with high block sizes
Date: Mon, 29 Jan 2018 21:36:04 +0200	[thread overview]
Message-ID: <62470be0-c6e0-cee6-867f-5231da99fdc6@grimberg.me> (raw)
In-Reply-To: <1516780918.24576.341.camel@haakon3.daterainc.com>

Hi,

>>> First, would it be helpful to limit maximum payload size per I/O for consumers
>>> based on number of iser-target sq hw sges..?
>>>
>> Assuming data is not able to be fast registered as if virtually contiguous;
>> artificially limiting the data size might not be the best solution.
>>
>> But max SGEs does need to be exposed higher. Somewhere in the stack,
>> there might need to be multiple WRs submitted or data copied.
>>
> 
> Sagi..?

I tend to agree that if the adapter support just a hand-full of sges its
counter-productive to expose infinite data transfer size. On the other
hand, I think we should be able to chunk more with memory registrations
(although rdma rw code never even allocates them for non-iwarp devices).

We have an API for check this in the RDMA core (thanks to chuck)
introduced in:
commit 0062818298662d0d05061949d12880146b5ebd65
Author: Chuck Lever <chuck.lever@oracle.com>
Date:   Mon Aug 28 15:06:14 2017 -0400

     rdma core: Add rdma_rw_mr_payload()

     The amount of payload per MR depends on device capabilities and
     the memory registration mode in use. The new rdma_rw API hides both,
     making it difficult for ULPs to determine how large their transport
     send queues need to be.

     Expose the MR payload information via a new API.

     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
     Acked-by: Doug Ledford <dledford@redhat.com>
     Signed-off-by: J. Bruce Fields <bfields@redhat.com>


So the easy way out would be to use that and plug it to
max_sg_data_nents. Regardless, queue-full logic today yields a TX attack
on the transport.

>>> diff --git a/drivers/target/iscsi/iscsi_target_configfs.c
>>> b/drivers/target/iscsi/iscsi_target_configf
>>> index 0ebc481..d8a4cc5 100644
>>> --- a/drivers/target/iscsi/iscsi_target_configfs.c
>>> +++ b/drivers/target/iscsi/iscsi_target_configfs.c
>>> @@ -1553,6 +1553,7 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
>>>          .module                         = THIS_MODULE,
>>>          .name                           = "iscsi",
>>>          .node_acl_size                  = sizeof(struct iscsi_node_acl),
>>> +       .max_data_sg_nents              = 32, /* 32 * PAGE_SIZE = MAXIMUM
>>> TRANSFER LENGTH */
>>>          .get_fabric_name                = iscsi_get_fabric_name,
>>>          .tpg_get_wwn                    = lio_tpg_get_endpoint_wwn,
>>>          .tpg_get_tag                    = lio_tpg_get_tag,
>>>
>>
>> BTW, this is helping the SQ overflow issue.
> 
> Thanks for confirming as a possible work-around.
> 
> For reference, what is i40iw's max_send_sg reporting..?
> 
> Is max_data_sg_nents=32 + 4k pages = 128K the largest MAX TRANSFER
> LENGTH to avoid consistent SQ overflow as-is with i40iw..?

I vaguely recall that this is the maximum mr length for i40e (and cxgb4
if I'm not mistaken).

WARNING: multiple messages have this Message-ID (diff)
From: Sagi Grimberg <sagi@grimberg.me>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	"Saleem, Shiraz" <shiraz.saleem@intel.com>
Cc: "Kalderon, Michal" <Michal.Kalderon@cavium.com>,
	"Amrani, Ram" <Ram.Amrani@cavium.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"Elior, Ariel" <Ariel.Elior@cavium.com>,
	target-devel <target-devel@vger.kernel.org>,
	Potnuri Bharat Teja <bharat@chelsio.com>
Subject: Re: SQ overflow seen running isert traffic with high block sizes
Date: Mon, 29 Jan 2018 19:36:04 +0000	[thread overview]
Message-ID: <62470be0-c6e0-cee6-867f-5231da99fdc6@grimberg.me> (raw)
In-Reply-To: <1516780918.24576.341.camel@haakon3.daterainc.com>

Hi,

>>> First, would it be helpful to limit maximum payload size per I/O for consumers
>>> based on number of iser-target sq hw sges..?
>>>
>> Assuming data is not able to be fast registered as if virtually contiguous;
>> artificially limiting the data size might not be the best solution.
>>
>> But max SGEs does need to be exposed higher. Somewhere in the stack,
>> there might need to be multiple WRs submitted or data copied.
>>
> 
> Sagi..?

I tend to agree that if the adapter support just a hand-full of sges its
counter-productive to expose infinite data transfer size. On the other
hand, I think we should be able to chunk more with memory registrations
(although rdma rw code never even allocates them for non-iwarp devices).

We have an API for check this in the RDMA core (thanks to chuck)
introduced in:
commit 0062818298662d0d05061949d12880146b5ebd65
Author: Chuck Lever <chuck.lever@oracle.com>
Date:   Mon Aug 28 15:06:14 2017 -0400

     rdma core: Add rdma_rw_mr_payload()

     The amount of payload per MR depends on device capabilities and
     the memory registration mode in use. The new rdma_rw API hides both,
     making it difficult for ULPs to determine how large their transport
     send queues need to be.

     Expose the MR payload information via a new API.

     Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
     Acked-by: Doug Ledford <dledford@redhat.com>
     Signed-off-by: J. Bruce Fields <bfields@redhat.com>


So the easy way out would be to use that and plug it to
max_sg_data_nents. Regardless, queue-full logic today yields a TX attack
on the transport.

>>> diff --git a/drivers/target/iscsi/iscsi_target_configfs.c
>>> b/drivers/target/iscsi/iscsi_target_configf
>>> index 0ebc481..d8a4cc5 100644
>>> --- a/drivers/target/iscsi/iscsi_target_configfs.c
>>> +++ b/drivers/target/iscsi/iscsi_target_configfs.c
>>> @@ -1553,6 +1553,7 @@ static void lio_release_cmd(struct se_cmd *se_cmd)
>>>          .module                         = THIS_MODULE,
>>>          .name                           = "iscsi",
>>>          .node_acl_size                  = sizeof(struct iscsi_node_acl),
>>> +       .max_data_sg_nents              = 32, /* 32 * PAGE_SIZE = MAXIMUM
>>> TRANSFER LENGTH */
>>>          .get_fabric_name                = iscsi_get_fabric_name,
>>>          .tpg_get_wwn                    = lio_tpg_get_endpoint_wwn,
>>>          .tpg_get_tag                    = lio_tpg_get_tag,
>>>
>>
>> BTW, this is helping the SQ overflow issue.
> 
> Thanks for confirming as a possible work-around.
> 
> For reference, what is i40iw's max_send_sg reporting..?
> 
> Is max_data_sg_nents2 + 4k pages = 128K the largest MAX TRANSFER
> LENGTH to avoid consistent SQ overflow as-is with i40iw..?

I vaguely recall that this is the maximum mr length for i40e (and cxgb4
if I'm not mistaken).

  parent reply	other threads:[~2018-01-29 19:36 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28  9:25 SQ overflow seen running isert traffic with high block sizes Amrani, Ram
     [not found] ` <BN3PR07MB25784033E7FCD062FA0A7855F8DD0-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-06-28 10:35   ` Potnuri Bharat Teja
     [not found]     ` <20170628103505.GA27517-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2017-06-28 11:29       ` Amrani, Ram
2017-06-28 10:39 ` Sagi Grimberg
2017-06-28 11:32   ` Amrani, Ram
     [not found]     ` <BN3PR07MB25786338EADC77A369A6D493F8DD0-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-07-13 18:29       ` Nicholas A. Bellinger
2017-07-17  9:26         ` Amrani, Ram
     [not found]           ` <BN3PR07MB2578E6561CC669922A322245F8A00-EldUQEzkDQfpW3VS/XPqkOFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-10-06 22:40             ` Shiraz Saleem
2017-10-06 22:40               ` Shiraz Saleem
     [not found]               ` <20171006224025.GA23364-GOXS9JX10wfOxmVO0tvppfooFf0ArEBIu+b9c/7xato@public.gmane.org>
2018-01-15  4:56                 ` Nicholas A. Bellinger
2018-01-15  4:56                   ` Nicholas A. Bellinger
     [not found]                   ` <1515992195.24576.156.camel-XoQW25Eq2zs8TOCF0fvnoXxStJ4P+DSV@public.gmane.org>
2018-01-15 10:12                     ` Kalderon, Michal
2018-01-15 10:12                       ` Kalderon, Michal
     [not found]                       ` <CY1PR0701MB2012E53C69D1CE3E16BA320B88EB0-UpKza+2NMNLHMJvQ0dyT705OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-01-15 15:22                         ` Shiraz Saleem
2018-01-15 15:22                           ` Shiraz Saleem
2018-01-18  9:58                           ` Nicholas A. Bellinger
2018-01-18  9:58                             ` Nicholas A. Bellinger
2018-01-18 17:53                             ` Potnuri Bharat Teja
2018-01-18 17:53                               ` Potnuri Bharat Teja
     [not found]                               ` <20180118175316.GA11338-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2018-01-24  7:25                                 ` Nicholas A. Bellinger
2018-01-24  7:25                                   ` Nicholas A. Bellinger
2018-01-24 12:21                                   ` Potnuri Bharat Teja
2018-01-24 12:33                                     ` Potnuri Bharat Teja
     [not found]                               ` <1516778717.24576.319.came l@haakon3.daterainc.com>
     [not found]                                 ` <1516778717.24576.319.camel-XoQW25Eq2zs8TOCF0fvnoXxStJ4P+DSV@public.gmane.org>
2018-01-24 16:03                                   ` Steve Wise
2018-01-24 16:03                                     ` Steve Wise
2018-01-19 19:33                             ` Kalderon, Michal
2018-01-24  7:55                               ` Nicholas A. Bellinger
2018-01-24  7:55                                 ` Nicholas A. Bellinger
2018-01-24  8:09                                 ` Kalderon, Michal
2018-01-24  8:09                                   ` Kalderon, Michal
2018-01-29 19:20                                   ` Sagi Grimberg
2018-01-29 19:20                                     ` Sagi Grimberg
     [not found]                                 ` <1516780534.24576.335.camel-XoQW25Eq2zs8TOCF0fvnoXxStJ4P+DSV@public.gmane.org>
2018-01-29 19:17                                   ` Sagi Grimberg
2018-01-29 19:17                                     ` Sagi Grimberg
     [not found]                                     ` <55569d98-7f8c-7414-ab03-e52e2bfc518b-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2018-01-30 16:30                                       ` Shiraz Saleem
2018-01-30 16:30                                         ` Shiraz Saleem
     [not found]                             ` <1516269522.24576.274.camel-XoQW25Eq2zs8TOCF0fvnoXxStJ4P+DSV@public.gmane.org>
2018-01-22 17:49                               ` Saleem, Shiraz
2018-01-22 17:49                                 ` Saleem, Shiraz
2018-01-24  8:01                                 ` Nicholas A. Bellinger
2018-01-24  8:01                                   ` Nicholas A. Bellinger
2018-01-26 18:52                                   ` Shiraz Saleem
2018-01-26 18:52                                     ` Shiraz Saleem
2018-01-29 19:36                                   ` Sagi Grimberg [this message]
2018-01-29 19:36                                     ` Sagi Grimberg

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=62470be0-c6e0-cee6-867f-5231da99fdc6@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=Ariel.Elior@cavium.com \
    --cc=Michal.Kalderon@cavium.com \
    --cc=Ram.Amrani@cavium.com \
    --cc=bharat@chelsio.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=shiraz.saleem@intel.com \
    --cc=target-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.