diff mbox series

[for-next] RDMA/irdma: Use the queried port attributes

Message ID 20210620201503.67055-1-kamalheib1@gmail.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series [for-next] RDMA/irdma: Use the queried port attributes | expand

Commit Message

Kamal Heib June 20, 2021, 8:15 p.m. UTC
Instead of hard code the gid_table_len value, use the value from the
ib_query_port() attributes.

Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/hw/irdma/verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nikolova, Tatyana E June 22, 2021, 11:17 p.m. UTC | #1
> -----Original Message-----
> From: Kamal Heib <kamalheib1@gmail.com>
> Sent: Sunday, June 20, 2021 3:15 PM
> To: linux-rdma@vger.kernel.org
> Cc: Ismail, Mustafa <mustafa.ismail@intel.com>; Saleem, Shiraz
> <shiraz.saleem@intel.com>; Doug Ledford <dledford@redhat.com>; Jason
> Gunthorpe <jgg@ziepe.ca>; Kamal Heib <kamalheib1@gmail.com>
> Subject: [PATCH for-next] RDMA/irdma: Use the queried port attributes
> 
> Instead of hard code the gid_table_len value, use the value from the
> ib_query_port() attributes.
> 
> Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb
> APIs")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
>  drivers/infiniband/hw/irdma/verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/irdma/verbs.c
> b/drivers/infiniband/hw/irdma/verbs.c
> index e8b170f0d997..5ae5dbcbc3a5 100644
> --- a/drivers/infiniband/hw/irdma/verbs.c
> +++ b/drivers/infiniband/hw/irdma/verbs.c
> @@ -3627,7 +3627,7 @@ static int irdma_iw_port_immutable(struct
> ib_device *ibdev, u32 port_num,
>  	err = ib_query_port(ibdev, port_num, &attr);
>  	if (err)
>  		return err;
> -	immutable->gid_tbl_len = 1;
> +	immutable->gid_tbl_len = attr.gid_tbl_len;
> 
>  	return 0;
>  }
> --
> 2.31.1

Acked-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Jason Gunthorpe June 23, 2021, 12:02 a.m. UTC | #2
On Sun, Jun 20, 2021 at 11:15:03PM +0300, Kamal Heib wrote:
> Instead of hard code the gid_table_len value, use the value from the
> ib_query_port() attributes.
> 
> Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> Acked-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
> ---
>  drivers/infiniband/hw/irdma/verbs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index e8b170f0d997..5ae5dbcbc3a5 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -3627,7 +3627,7 @@  static int irdma_iw_port_immutable(struct ib_device *ibdev, u32 port_num,
 	err = ib_query_port(ibdev, port_num, &attr);
 	if (err)
 		return err;
-	immutable->gid_tbl_len = 1;
+	immutable->gid_tbl_len = attr.gid_tbl_len;
 
 	return 0;
 }