diff mbox

[5/7] RDMA/i40iw: Fix for using one sge for RDMA READ

Message ID 1461352469-16504-6-git-send-email-tatyana.e.nikolova@intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Nikolova, Tatyana E April 22, 2016, 7:14 p.m. UTC
From: Shiraz Saleem <shiraz.saleem@intel.com>

A check is added to validate the requested sge number.
iWARP doesn't support multiple sg elements for
RDMA READ work requests.

Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Faisal Latif <faisal.latif@intel.com>
---
 drivers/infiniband/hw/i40iw/i40iw_verbs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Leon Romanovsky April 24, 2016, 7:35 a.m. UTC | #1
On Fri, Apr 22, 2016 at 02:14:27PM -0500, Tatyana Nikolova wrote:
> From: Shiraz Saleem <shiraz.saleem@intel.com>
> 
> A check is added to validate the requested sge number.
> iWARP doesn't support multiple sg elements for
> RDMA READ work requests.
> 
> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> index 2d832c7..45f70f5 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> @@ -74,7 +74,7 @@ static int i40iw_query_device(struct ib_device *ibdev,
>  	props->max_cqe = iwdev->max_cqe;
>  	props->max_mr = iwdev->max_mr;
>  	props->max_pd = iwdev->max_pd;
> -	props->max_sge_rd = 1;
> +	props->max_sge_rd = I40IW_MAX_SGE_RD;
>  	props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
>  	props->max_qp_init_rd_atom = props->max_qp_rd_atom;
>  	props->atomic_cap = IB_ATOMIC_NONE;
> @@ -2117,6 +2117,10 @@ static int i40iw_post_send(struct ib_qp *ibqp,
>  			inv_stag = true;
>  			/* fall-through*/
                        ^^^^^^^^^^^^^^^^
Do you support multiple SGE for RDMA WRITE?


>  		case IB_WR_RDMA_READ:
> +			if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
> +				err = -EINVAL;
> +				break;
> +			}
>  			info.op_type = I40IW_OP_TYPE_RDMA_READ;
>  			info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
>  			info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;
> -- 
> 2.7.4
> 
> --
> 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
Nikolova, Tatyana E April 26, 2016, 3:27 p.m. UTC | #2
Hi Leon,

We support multiple sges for RDMA WRITE. In the patch, the fall-through case above RDMA READ is RDMA READ WITH INVALIDATE.

Thanks,
Tatyana

-----Original Message-----
From: Leon Romanovsky [mailto:leon@kernel.org] 
Sent: Sunday, April 24, 2016 2:35 AM
To: Nikolova, Tatyana E <tatyana.e.nikolova@intel.com>
Cc: dledford@redhat.com; linux-rdma@vger.kernel.org; e1000-rdma@lists.sourceforge.net; Latif, Faisal <faisal.latif@intel.com>
Subject: Re: [PATCH 5/7] RDMA/i40iw: Fix for using one sge for RDMA READ

On Fri, Apr 22, 2016 at 02:14:27PM -0500, Tatyana Nikolova wrote:
> From: Shiraz Saleem <shiraz.saleem@intel.com>
> 
> A check is added to validate the requested sge number.
> iWARP doesn't support multiple sg elements for RDMA READ work 
> requests.
> 
> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
> ---
>  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c 
> b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> index 2d832c7..45f70f5 100644
> --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> @@ -74,7 +74,7 @@ static int i40iw_query_device(struct ib_device *ibdev,
>  	props->max_cqe = iwdev->max_cqe;
>  	props->max_mr = iwdev->max_mr;
>  	props->max_pd = iwdev->max_pd;
> -	props->max_sge_rd = 1;
> +	props->max_sge_rd = I40IW_MAX_SGE_RD;
>  	props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
>  	props->max_qp_init_rd_atom = props->max_qp_rd_atom;
>  	props->atomic_cap = IB_ATOMIC_NONE;
> @@ -2117,6 +2117,10 @@ static int i40iw_post_send(struct ib_qp *ibqp,
>  			inv_stag = true;
>  			/* fall-through*/
                        ^^^^^^^^^^^^^^^^ Do you support multiple SGE for RDMA WRITE?


>  		case IB_WR_RDMA_READ:
> +			if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
> +				err = -EINVAL;
> +				break;
> +			}
>  			info.op_type = I40IW_OP_TYPE_RDMA_READ;
>  			info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
>  			info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;
> --
> 2.7.4
> 
> --
> 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
--
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
Leon Romanovsky April 27, 2016, 6:25 a.m. UTC | #3
On Tue, Apr 26, 2016 at 03:27:46PM +0000, Nikolova, Tatyana E wrote:
> Hi Leon,
> 
> We support multiple sges for RDMA WRITE. In the patch, the fall-through case above RDMA READ is RDMA READ WITH INVALIDATE.

I believe that we are looking on the different trees.
In official tree, the case above RDMA_READ is RDMA_WRITE.

> 
> Thanks,
> Tatyana
> 
> -----Original Message-----
> From: Leon Romanovsky [mailto:leon@kernel.org] 
> Sent: Sunday, April 24, 2016 2:35 AM
> To: Nikolova, Tatyana E <tatyana.e.nikolova@intel.com>
> Cc: dledford@redhat.com; linux-rdma@vger.kernel.org; e1000-rdma@lists.sourceforge.net; Latif, Faisal <faisal.latif@intel.com>
> Subject: Re: [PATCH 5/7] RDMA/i40iw: Fix for using one sge for RDMA READ
> 
> On Fri, Apr 22, 2016 at 02:14:27PM -0500, Tatyana Nikolova wrote:
> > From: Shiraz Saleem <shiraz.saleem@intel.com>
> > 
> > A check is added to validate the requested sge number.
> > iWARP doesn't support multiple sg elements for RDMA READ work 
> > requests.
> > 
> > Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
> > Signed-off-by: Faisal Latif <faisal.latif@intel.com>
> > ---
> >  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c 
> > b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> > index 2d832c7..45f70f5 100644
> > --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> > +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
> > @@ -74,7 +74,7 @@ static int i40iw_query_device(struct ib_device *ibdev,
> >  	props->max_cqe = iwdev->max_cqe;
> >  	props->max_mr = iwdev->max_mr;
> >  	props->max_pd = iwdev->max_pd;
> > -	props->max_sge_rd = 1;
> > +	props->max_sge_rd = I40IW_MAX_SGE_RD;
> >  	props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
> >  	props->max_qp_init_rd_atom = props->max_qp_rd_atom;
> >  	props->atomic_cap = IB_ATOMIC_NONE;
> > @@ -2117,6 +2117,10 @@ static int i40iw_post_send(struct ib_qp *ibqp,
> >  			inv_stag = true;
> >  			/* fall-through*/
>                         ^^^^^^^^^^^^^^^^ Do you support multiple SGE for RDMA WRITE?
> 
> 
> >  		case IB_WR_RDMA_READ:
> > +			if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
> > +				err = -EINVAL;
> > +				break;
> > +			}
> >  			info.op_type = I40IW_OP_TYPE_RDMA_READ;
> >  			info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
> >  			info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;
> > --
> > 2.7.4
> > 
> > --
> > 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
Doug Ledford April 29, 2016, 2:35 a.m. UTC | #4
On 04/27/2016 02:25 AM, Leon Romanovsky wrote:
> On Tue, Apr 26, 2016 at 03:27:46PM +0000, Nikolova, Tatyana E wrote:
>> Hi Leon,
>>
>> We support multiple sges for RDMA WRITE. In the patch, the fall-through case above RDMA READ is RDMA READ WITH INVALIDATE.
> 
> I believe that we are looking on the different trees.
> In official tree, the case above RDMA_READ is RDMA_WRITE.

Theses patches presumably are on top of the 16 previous patches to the
i40iw driver.

>>
>> Thanks,
>> Tatyana
>>
>> -----Original Message-----
>> From: Leon Romanovsky [mailto:leon@kernel.org] 
>> Sent: Sunday, April 24, 2016 2:35 AM
>> To: Nikolova, Tatyana E <tatyana.e.nikolova@intel.com>
>> Cc: dledford@redhat.com; linux-rdma@vger.kernel.org; e1000-rdma@lists.sourceforge.net; Latif, Faisal <faisal.latif@intel.com>
>> Subject: Re: [PATCH 5/7] RDMA/i40iw: Fix for using one sge for RDMA READ
>>
>> On Fri, Apr 22, 2016 at 02:14:27PM -0500, Tatyana Nikolova wrote:
>>> From: Shiraz Saleem <shiraz.saleem@intel.com>
>>>
>>> A check is added to validate the requested sge number.
>>> iWARP doesn't support multiple sg elements for RDMA READ work 
>>> requests.
>>>
>>> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
>>> Signed-off-by: Faisal Latif <faisal.latif@intel.com>
>>> ---
>>>  drivers/infiniband/hw/i40iw/i40iw_verbs.c | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/infiniband/hw/i40iw/i40iw_verbs.c 
>>> b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>>> index 2d832c7..45f70f5 100644
>>> --- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>>> +++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
>>> @@ -74,7 +74,7 @@ static int i40iw_query_device(struct ib_device *ibdev,
>>>  	props->max_cqe = iwdev->max_cqe;
>>>  	props->max_mr = iwdev->max_mr;
>>>  	props->max_pd = iwdev->max_pd;
>>> -	props->max_sge_rd = 1;
>>> +	props->max_sge_rd = I40IW_MAX_SGE_RD;
>>>  	props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
>>>  	props->max_qp_init_rd_atom = props->max_qp_rd_atom;
>>>  	props->atomic_cap = IB_ATOMIC_NONE;
>>> @@ -2117,6 +2117,10 @@ static int i40iw_post_send(struct ib_qp *ibqp,
>>>  			inv_stag = true;
>>>  			/* fall-through*/
>>                         ^^^^^^^^^^^^^^^^ Do you support multiple SGE for RDMA WRITE?
>>
>>
>>>  		case IB_WR_RDMA_READ:
>>> +			if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
>>> +				err = -EINVAL;
>>> +				break;
>>> +			}
>>>  			info.op_type = I40IW_OP_TYPE_RDMA_READ;
>>>  			info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
>>>  			info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;
>>> --
>>> 2.7.4
>>>
>>> --
>>> 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/hw/i40iw/i40iw_verbs.c b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
index 2d832c7..45f70f5 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_verbs.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_verbs.c
@@ -74,7 +74,7 @@  static int i40iw_query_device(struct ib_device *ibdev,
 	props->max_cqe = iwdev->max_cqe;
 	props->max_mr = iwdev->max_mr;
 	props->max_pd = iwdev->max_pd;
-	props->max_sge_rd = 1;
+	props->max_sge_rd = I40IW_MAX_SGE_RD;
 	props->max_qp_rd_atom = I40IW_MAX_IRD_SIZE;
 	props->max_qp_init_rd_atom = props->max_qp_rd_atom;
 	props->atomic_cap = IB_ATOMIC_NONE;
@@ -2117,6 +2117,10 @@  static int i40iw_post_send(struct ib_qp *ibqp,
 			inv_stag = true;
 			/* fall-through*/
 		case IB_WR_RDMA_READ:
+			if (ib_wr->num_sge > I40IW_MAX_SGE_RD) {
+				err = -EINVAL;
+				break;
+			}
 			info.op_type = I40IW_OP_TYPE_RDMA_READ;
 			info.op.rdma_read.rem_addr.tag_off = rdma_wr(ib_wr)->remote_addr;
 			info.op.rdma_read.rem_addr.stag = rdma_wr(ib_wr)->rkey;