All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute
@ 2020-02-05  8:13 Kamal Heib
  2020-02-05 11:01 ` Gal Pressman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kamal Heib @ 2020-02-05  8:13 UTC (permalink / raw)
  To: linux-rdma; +Cc: Doug Ledford, Jason Gunthorpe, Bernard Metzler, Kamal Heib

Make sure to set the active_mtu attribute to avoid report the following
invalid value:

$ ibv_devinfo -d siw0 | grep active_mtu
			active_mtu:		invalid MTU (0)

Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c
index 07e30138aaa1..73485d0da907 100644
--- a/drivers/infiniband/sw/siw/siw_verbs.c
+++ b/drivers/infiniband/sw/siw/siw_verbs.c
@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port,
 
 	memset(attr, 0, sizeof(*attr));
 
-	attr->active_mtu = attr->max_mtu;
 	attr->active_speed = 2;
 	attr->active_width = 2;
 	attr->gid_tbl_len = 1;
 	attr->max_msg_sz = -1;
 	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
+	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
 	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
 		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
 	attr->pkey_tbl_len = 1;
-- 
2.21.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute
  2020-02-05  8:13 [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute Kamal Heib
@ 2020-02-05 11:01 ` Gal Pressman
  2020-02-05 14:06 ` Bernard Metzler
  2020-02-11 18:33 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Gal Pressman @ 2020-02-05 11:01 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Jason Gunthorpe, Bernard Metzler

On 05/02/2020 10:13, Kamal Heib wrote:
> Make sure to set the active_mtu attribute to avoid report the following
> invalid value:
> 
> $ ibv_devinfo -d siw0 | grep active_mtu
> 			active_mtu:		invalid MTU (0)
> 
> Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
>  drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/sw/siw/siw_verbs.c b/drivers/infiniband/sw/siw/siw_verbs.c
> index 07e30138aaa1..73485d0da907 100644
> --- a/drivers/infiniband/sw/siw/siw_verbs.c
> +++ b/drivers/infiniband/sw/siw/siw_verbs.c
> @@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev, u8 port,
>  
>  	memset(attr, 0, sizeof(*attr));
>  
> -	attr->active_mtu = attr->max_mtu;
>  	attr->active_speed = 2;
>  	attr->active_width = 2;

Off topic: these should use ib_port_speed and ib_port_width enum.

>  	attr->gid_tbl_len = 1;
>  	attr->max_msg_sz = -1;
>  	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
> +	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
>  	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
>  		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
>  	attr->pkey_tbl_len = 1;
> 

Reviewed-by: Gal Pressman <galpress@amazon.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute
  2020-02-05  8:13 [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute Kamal Heib
  2020-02-05 11:01 ` Gal Pressman
@ 2020-02-05 14:06 ` Bernard Metzler
  2020-02-11 18:33 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Bernard Metzler @ 2020-02-05 14:06 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Jason Gunthorpe

-----"Kamal Heib" <kamalheib1@gmail.com> wrote: -----

>To: linux-rdma@vger.kernel.org
>From: "Kamal Heib" <kamalheib1@gmail.com>
>Date: 02/05/2020 09:14AM
>Cc: "Doug Ledford" <dledford@redhat.com>, "Jason Gunthorpe"
><jgg@ziepe.ca>, "Bernard Metzler" <bmt@zurich.ibm.com>, "Kamal Heib"
><kamalheib1@gmail.com>
>Subject: [EXTERNAL] [PATCH for-rc] RDMA/siw: Fix setting active_mtu
>attribute
>
>Make sure to set the active_mtu attribute to avoid report the
>following
>invalid value:
>
>$ ibv_devinfo -d siw0 | grep active_mtu
>			active_mtu:		invalid MTU (0)
>
>Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
>Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
>---
> drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/infiniband/sw/siw/siw_verbs.c
>b/drivers/infiniband/sw/siw/siw_verbs.c
>index 07e30138aaa1..73485d0da907 100644
>--- a/drivers/infiniband/sw/siw/siw_verbs.c
>+++ b/drivers/infiniband/sw/siw/siw_verbs.c
>@@ -168,12 +168,12 @@ int siw_query_port(struct ib_device *base_dev,
>u8 port,
> 
> 	memset(attr, 0, sizeof(*attr));
> 
>-	attr->active_mtu = attr->max_mtu;
> 	attr->active_speed = 2;
> 	attr->active_width = 2;
> 	attr->gid_tbl_len = 1;
> 	attr->max_msg_sz = -1;
> 	attr->max_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
>+	attr->active_mtu = ib_mtu_int_to_enum(sdev->netdev->mtu);
> 	attr->phys_state = sdev->state == IB_PORT_ACTIVE ?
> 		IB_PORT_PHYS_STATE_LINK_UP : IB_PORT_PHYS_STATE_DISABLED;
> 	attr->pkey_tbl_len = 1;
>-- 
>2.21.1
>
>

thanks, makes complete sense.

Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute
  2020-02-05  8:13 [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute Kamal Heib
  2020-02-05 11:01 ` Gal Pressman
  2020-02-05 14:06 ` Bernard Metzler
@ 2020-02-11 18:33 ` Jason Gunthorpe
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2020-02-11 18:33 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Doug Ledford, Bernard Metzler

On Wed, Feb 05, 2020 at 10:13:54AM +0200, Kamal Heib wrote:
> Make sure to set the active_mtu attribute to avoid report the following
> invalid value:
> 
> $ ibv_devinfo -d siw0 | grep active_mtu
> 			active_mtu:		invalid MTU (0)
> 
> Fixes: 303ae1cdfdf7 ("rdma/siw: application interface")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> Reviewed-by: Gal Pressman <galpress@amazon.com>
> Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
> ---
>  drivers/infiniband/sw/siw/siw_verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

This isn't really rc worthy as it has always been broken

Applied to for-next, thanks

Jason

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-11 18:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-05  8:13 [PATCH for-rc] RDMA/siw: Fix setting active_mtu attribute Kamal Heib
2020-02-05 11:01 ` Gal Pressman
2020-02-05 14:06 ` Bernard Metzler
2020-02-11 18:33 ` Jason Gunthorpe

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.