diff mbox

[V1] IB/cma: Fix RDMA port validation for iWarp

Message ID 1452158369-2938-1-git-send-email-matanb@mellanox.com (mailing list archive)
State Accepted
Headers show

Commit Message

Matan Barak Jan. 7, 2016, 9:19 a.m. UTC
cma_validate_port wrongly assumed that Ethernet devices are RoCE
devices and thus their ndev should be matched in the GID table.
This broke the iWarp support. Fixing that matching the ndev only if
we work on a RoCE port.

Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
		     and netdevice')
Reported-by: Hariprasad Shenai <hariprasad@chelsio.com>
Tested-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
---

Hi Doug,

This patch fixes an iWarp issue that was introduced in the RoCE
refactoring series.

Regards,
Matan

Changes from V0:
 - Fixed typo

 drivers/infiniband/core/cma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steve Wise Jan. 7, 2016, 5:38 p.m. UTC | #1
> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-owner@vger.kernel.org] On Behalf Of Matan Barak
> Sent: Thursday, January 07, 2016 3:19 AM
> To: Doug Ledford
> Cc: linux-rdma@vger.kernel.org; Or Gerlitz; Majd Dibbiny; Hariprasad Shenai; Matan Barak
> Subject: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> 
> cma_validate_port wrongly assumed that Ethernet devices are RoCE
> devices and thus their ndev should be matched in the GID table.
> This broke the iWarp support. Fixing that matching the ndev only if
> we work on a RoCE port.
> 
> Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
> 		     and netdevice')
> Reported-by: Hariprasad Shenai <hariprasad@chelsio.com>
> Tested-by: Hariprasad Shenai <hariprasad@chelsio.com>
> Signed-off-by: Matan Barak <matanb@mellanox.com>

Reviewed-by: Steve Wise <swise@opengridcomputing.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
Steve Wise Jan. 12, 2016, 6:43 p.m. UTC | #2
Hey Matan,

Will you please submit this to 4.4-stable?

Thanks,

Steve.

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-owner@vger.kernel.org] On Behalf Of Matan Barak
> Sent: Thursday, January 07, 2016 3:19 AM
> To: Doug Ledford
> Cc: linux-rdma@vger.kernel.org; Or Gerlitz; Majd Dibbiny; Hariprasad Shenai; Matan Barak
> Subject: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> 
> cma_validate_port wrongly assumed that Ethernet devices are RoCE
> devices and thus their ndev should be matched in the GID table.
> This broke the iWarp support. Fixing that matching the ndev only if
> we work on a RoCE port.
> 
> Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
> 		     and netdevice')
> Reported-by: Hariprasad Shenai <hariprasad@chelsio.com>
> Tested-by: Hariprasad Shenai <hariprasad@chelsio.com>
> Signed-off-by: Matan Barak <matanb@mellanox.com>
> ---
> 
> Hi Doug,
> 
> This patch fixes an iWarp issue that was introduced in the RoCE
> refactoring series.
> 
> Regards,
> Matan
> 
> Changes from V0:
>  - Fixed typo
> 
>  drivers/infiniband/core/cma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 2d762a2..17a15c5 100644
> --- a/drivers/infiniband/core/cma.c
> +++ b/drivers/infiniband/core/cma.c
> @@ -453,7 +453,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
>  	if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port))
>  		return ret;
> 
> -	if (dev_type == ARPHRD_ETHER)
> +	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
>  		ndev = dev_get_by_index(&init_net, bound_if_index);
> 
>  	ret = ib_find_cached_gid_by_port(device, gid, port, ndev, NULL);
> --
> 2.1.0
> 
> --
> 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
Matan Barak Jan. 13, 2016, 10:32 a.m. UTC | #3
On Tue, Jan 12, 2016 at 8:43 PM, Steve Wise <swise@opengridcomputing.com> wrote:
> Hey Matan,
>
> Will you please submit this to 4.4-stable?
>
> Thanks,
>
> Steve.
>

You could only take it to 4.4-stable, once it's accepted to upstream.
--
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
Steve Wise Jan. 13, 2016, 3:03 p.m. UTC | #4
> -----Original Message-----
> From: Matan Barak [mailto:matanb@dev.mellanox.co.il]
> Sent: Wednesday, January 13, 2016 4:33 AM
> To: Steve Wise
> Cc: Matan Barak; Doug Ledford; linux-rdma; Or Gerlitz; Majd Dibbiny; Hariprasad Shenai
> Subject: Re: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> 
> On Tue, Jan 12, 2016 at 8:43 PM, Steve Wise <swise@opengridcomputing.com> wrote:
> > Hey Matan,
> >
> > Will you please submit this to 4.4-stable?
> >
> > Thanks,
> >
> > Steve.
> >
> 
> You could only take it to 4.4-stable, once it's accepted to upstream.

You could add this to the sign-off section of the patch and it will flow automagically...

Cc:  <stable@vger.kernel.org> # 4.4.x-

Doug, perhaps you could add this when you pull it in?


--
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
Or Gerlitz Jan. 14, 2016, 7:14 a.m. UTC | #5
On 1/13/2016 5:03 PM, Steve Wise wrote:
>> -----Original Message-----
>> From: Matan Barak [mailto:matanb@dev.mellanox.co.il]
>> Sent: Wednesday, January 13, 2016 4:33 AM
>> To: Steve Wise
>> Cc: Matan Barak; Doug Ledford; linux-rdma; Or Gerlitz; Majd Dibbiny; Hariprasad Shenai
>> Subject: Re: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
>>
>> On Tue, Jan 12, 2016 at 8:43 PM, Steve Wise <swise@opengridcomputing.com> wrote:
>>> Hey Matan,
>>>
>>> Will you please submit this to 4.4-stable?
>>>
>>> Thanks,
>>>
>>> Steve.
>>>
>> You could only take it to 4.4-stable, once it's accepted to upstream.
> You could add this to the sign-off section of the patch and it will flow automagically...
>
> Cc:  <stable@vger.kernel.org> # 4.4.x-
>
> Doug, perhaps you could add this when you pull it in?

Steve,

We prefer that patches to our drivers and the IB core will swim for a 
while in upstream before they go to -stable.

I suggest we wait till 4.5-rc2 for that, Okay?

Or.



>

--
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
Steve Wise Jan. 14, 2016, 2:53 p.m. UTC | #6
> -----Original Message-----
> From: Or Gerlitz [mailto:ogerlitz@mellanox.com]
> Sent: Thursday, January 14, 2016 1:15 AM
> To: Steve Wise
> Cc: 'Matan Barak'; dledford@redhat.com; 'linux-rdma'; 'Majd Dibbiny'; 'Hariprasad Shenai'
> Subject: Re: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> 
> On 1/13/2016 5:03 PM, Steve Wise wrote:
> >> -----Original Message-----
> >> From: Matan Barak [mailto:matanb@dev.mellanox.co.il]
> >> Sent: Wednesday, January 13, 2016 4:33 AM
> >> To: Steve Wise
> >> Cc: Matan Barak; Doug Ledford; linux-rdma; Or Gerlitz; Majd Dibbiny; Hariprasad Shenai
> >> Subject: Re: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> >>
> >> On Tue, Jan 12, 2016 at 8:43 PM, Steve Wise <swise@opengridcomputing.com> wrote:
> >>> Hey Matan,
> >>>
> >>> Will you please submit this to 4.4-stable?
> >>>
> >>> Thanks,
> >>>
> >>> Steve.
> >>>
> >> You could only take it to 4.4-stable, once it's accepted to upstream.
> > You could add this to the sign-off section of the patch and it will flow automagically...
> >
> > Cc:  <stable@vger.kernel.org> # 4.4.x-
> >
> > Doug, perhaps you could add this when you pull it in?
> 
> Steve,
> 
> We prefer that patches to our drivers and the IB core will swim for a
> while in upstream before they go to -stable.
> 
> I suggest we wait till 4.5-rc2 for that, Okay?
> 

Hey Or,

iWARP is non-functional in 4.4, and this patch fixes the regression.  I suggest we get this fix in stable asap.


--
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
Or Gerlitz Jan. 14, 2016, 3 p.m. UTC | #7
On 1/14/2016 4:53 PM, Steve Wise wrote:
> Hey Or, iWARP is non-functional in 4.4, and this patch fixes the regression.  I suggest we get this fix in stable asap.

sure, we can make an exception in our usual track for this one, but you 
need upstream commit ID ## -- Doug is your key person here
--
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
Steve Wise Jan. 14, 2016, 3:08 p.m. UTC | #8
> -----Original Message-----
> From: Or Gerlitz [mailto:ogerlitz@mellanox.com]
> Sent: Thursday, January 14, 2016 9:01 AM
> To: Steve Wise
> Cc: 'Matan Barak'; dledford@redhat.com; 'linux-rdma'; 'Majd Dibbiny'; 'Hariprasad Shenai'
> Subject: Re: [PATCH V1] IB/cma: Fix RDMA port validation for iWarp
> 
> On 1/14/2016 4:53 PM, Steve Wise wrote:
> > Hey Or, iWARP is non-functional in 4.4, and this patch fixes the regression.  I suggest we get this fix in stable asap.
> 
> sure, we can make an exception in our usual track for this one, but you
> need upstream commit ID ## -- Doug is your key person here

This patch commit comment cites the offending patch:

Fixes: abae1b71dd37 ('IB/cma: cma_validate_port should verify the port
		     and netdevice')

Does that need to be in the Cc: line somehow?

Doug?  

--
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 Jan. 14, 2016, 5:40 p.m. UTC | #9
On Thu, Jan 14, 2016 at 05:00:30PM +0200, Or Gerlitz wrote:
> On 1/14/2016 4:53 PM, Steve Wise wrote:
> >Hey Or, iWARP is non-functional in 4.4, and this patch fixes the regression.  I suggest we get this fix in stable asap.
> 
> sure, we can make an exception in our usual track for this one, but you need
> upstream commit ID ## -- Doug is your key person here

Or, there are no doubts that commit ID is important for our work, however
submission to stable can be done without it [1].

Just follow the Steve's advice on cc-ing stable list in sign-off section.

[1] http://lxr.free-electrons.com/source/Documentation/stable_kernel_rules.txt#L40

> --
> 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
Steve Wise Jan. 15, 2016, 7:47 p.m. UTC | #10
On 1/14/2016 11:40 AM, Leon Romanovsky wrote:
> On Thu, Jan 14, 2016 at 05:00:30PM +0200, Or Gerlitz wrote:
>> On 1/14/2016 4:53 PM, Steve Wise wrote:
>>> Hey Or, iWARP is non-functional in 4.4, and this patch fixes the regression.  I suggest we get this fix in stable asap.
>> sure, we can make an exception in our usual track for this one, but you need
>> upstream commit ID ## -- Doug is your key person here
> Or, there are no doubts that commit ID is important for our work, however
> submission to stable can be done without it [1].
>
> Just follow the Steve's advice on cc-ing stable list in sign-off section.
>
> [1] http://lxr.free-electrons.com/source/Documentation/stable_kernel_rules.txt#L40
>

Hey Doug, can you please accept this and add the Cc: line to get it into 
stable-4.x?

Thanks,

Steve.
--
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 Jan. 19, 2016, 6:44 p.m. UTC | #11
On 01/15/2016 02:47 PM, Steve Wise wrote:
> On 1/14/2016 11:40 AM, Leon Romanovsky wrote:
>> On Thu, Jan 14, 2016 at 05:00:30PM +0200, Or Gerlitz wrote:
>>> On 1/14/2016 4:53 PM, Steve Wise wrote:
>>>> Hey Or, iWARP is non-functional in 4.4, and this patch fixes the
>>>> regression.  I suggest we get this fix in stable asap.
>>> sure, we can make an exception in our usual track for this one, but
>>> you need
>>> upstream commit ID ## -- Doug is your key person here
>> Or, there are no doubts that commit ID is important for our work, however
>> submission to stable can be done without it [1].
>>
>> Just follow the Steve's advice on cc-ing stable list in sign-off section.
>>
>> [1]
>> http://lxr.free-electrons.com/source/Documentation/stable_kernel_rules.txt#L40
>>
>>
> 
> Hey Doug, can you please accept this and add the Cc: line to get it into
> stable-4.x?
> 
> Thanks,
> 
> Steve.

I've pulled this in.  I had to fix it up to work with some other code,
and I added the Cc: to stable.
Steve Wise Jan. 19, 2016, 6:52 p.m. UTC | #12
> >
> > Hey Doug, can you please accept this and add the Cc: line to get it into
> > stable-4.x?
> >
> > Thanks,
> >
> > Steve.
> 
> I've pulled this in.  I had to fix it up to work with some other code,
> and I added the Cc: to stable.
> 

Thanks Doug.


--
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/core/cma.c b/drivers/infiniband/core/cma.c
index 2d762a2..17a15c5 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -453,7 +453,7 @@  static inline int cma_validate_port(struct ib_device *device, u8 port,
 	if ((dev_type != ARPHRD_INFINIBAND) && rdma_protocol_ib(device, port))
 		return ret;
 
-	if (dev_type == ARPHRD_ETHER)
+	if (dev_type == ARPHRD_ETHER && rdma_protocol_roce(device, port))
 		ndev = dev_get_by_index(&init_net, bound_if_index);
 
 	ret = ib_find_cached_gid_by_port(device, gid, port, ndev, NULL);