diff mbox

IB/srp: Fix possible send queue overflow

Message ID 1444901206-27462-1-git-send-email-sagig@mellanox.com (mailing list archive)
State Superseded
Headers show

Commit Message

Sagi Grimberg Oct. 15, 2015, 9:26 a.m. UTC
When using work request based memory registration (fast_reg)
we must reserve SQ entries for registration and invalidation
in addition to send operations. Each IO consumes 3 SQ entries
(registration, send, invalidation) so we need to allocate 3x
larger send-queue instead of 2x.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
CC: Stable <stable@vger.kernel.org>
---
 drivers/infiniband/ulp/srp/ib_srp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Bart Van Assche Oct. 15, 2015, 3:35 p.m. UTC | #1
On 10/15/2015 02:26 AM, Sagi Grimberg wrote:
> When using work request based memory registration (fast_reg)
> we must reserve SQ entries for registration and invalidation
> in addition to send operations. Each IO consumes 3 SQ entries
> (registration, send, invalidation) so we need to allocate 3x
> larger send-queue instead of 2x.
>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> CC: Stable <stable@vger.kernel.org>
> ---
>   drivers/infiniband/ulp/srp/ib_srp.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index d00f819..43b07f7 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -488,7 +488,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch)
>   	struct ib_qp *qp;
>   	struct ib_fmr_pool *fmr_pool = NULL;
>   	struct srp_fr_pool *fr_pool = NULL;
> -	const int m = 1 + dev->use_fast_reg;
> +	const int m = dev->use_fast_reg ? 3 : 1;
>   	struct ib_cq_init_attr cq_attr = {};
>   	int ret;
>

Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Nov. 3, 2015, 6:56 p.m. UTC | #2
On 15/10/2015 12:26, Sagi Grimberg wrote:
> When using work request based memory registration (fast_reg)
> we must reserve SQ entries for registration and invalidation
> in addition to send operations. Each IO consumes 3 SQ entries
> (registration, send, invalidation) so we need to allocate 3x
> larger send-queue instead of 2x.
>
> Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
> CC: Stable <stable@vger.kernel.org>
> ---
>   drivers/infiniband/ulp/srp/ib_srp.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index d00f819..43b07f7 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -488,7 +488,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch)
>   	struct ib_qp *qp;
>   	struct ib_fmr_pool *fmr_pool = NULL;
>   	struct srp_fr_pool *fr_pool = NULL;
> -	const int m = 1 + dev->use_fast_reg;
> +	const int m = dev->use_fast_reg ? 3 : 1;
>   	struct ib_cq_init_attr cq_attr = {};
>   	int ret;
>
>

Hi Doug,

Kind reminder for picking this up for 4.4

Cheers,
Sagi
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Nov. 5, 2015, 10:23 a.m. UTC | #3
>
> Hi Doug,
>
> Kind reminder for picking this up for 4.4

Doug?

Are you planning to pick this up? Note that this patch
is stable material as well.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sagi Grimberg Nov. 10, 2015, 10:35 a.m. UTC | #4
>>
>> Hi Doug,
>>
>> Kind reminder for picking this up for 4.4
>
> Doug?
>
> Are you planning to pick this up? Note that this patch
> is stable material as well.

Doug? any plans for this patch?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig Nov. 22, 2015, 1:37 p.m. UTC | #5
On Tue, Nov 10, 2015 at 12:35:05PM +0200, Sagi Grimberg wrote:
> >Are you planning to pick this up? Note that this patch
> >is stable material as well.
> 
> Doug? any plans for this patch?

We should really get this in an into -stable.  Bart, can you resend
the series and if it doesn't get picked up next week send it directly
to Linus?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche Nov. 24, 2015, 1:11 a.m. UTC | #6
On 11/22/2015 05:37 AM, Christoph Hellwig wrote:
> On Tue, Nov 10, 2015 at 12:35:05PM +0200, Sagi Grimberg wrote:
>>> Are you planning to pick this up? Note that this patch
>>> is stable material as well.
>>
>> Doug? any plans for this patch?
>
> We should really get this in an into -stable.  Bart, can you resend
> the series and if it doesn't get picked up next week send it directly
> to Linus?

Hi Christoph,

Are you referring to Sagi's patch only or also to my patch series that 
fixes error handling ?

Thanks,

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index d00f819..43b07f7 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -488,7 +488,7 @@  static int srp_create_ch_ib(struct srp_rdma_ch *ch)
 	struct ib_qp *qp;
 	struct ib_fmr_pool *fmr_pool = NULL;
 	struct srp_fr_pool *fr_pool = NULL;
-	const int m = 1 + dev->use_fast_reg;
+	const int m = dev->use_fast_reg ? 3 : 1;
 	struct ib_cq_init_attr cq_attr = {};
 	int ret;