mbox series

[rdma-next,v2,0/3] Fix in-kernel active_speed type

Message ID 20200917090223.1018224-1-leon@kernel.org
Headers show
Series Fix in-kernel active_speed type | expand

Message

Leon Romanovsky Sept. 17, 2020, 9:02 a.m. UTC
From: Leon Romanovsky <leonro@nvidia.com>

Changelog:
v2:
 * Changed WARN_ON casting to be saturated value instead while returning active_speed
   to the user.
v1: https://lore.kernel.org/linux-rdma/20200902074503.743310-1-leon@kernel.org
 * Changed patch #1 to fix memory corruption to help with bisect. No
   change in series, because the added code is changed anyway in patch
   #3.
v0:
 * https://lore.kernel.org/linux-rdma/20200824105826.1093613-1-leon@kernel.org

----------------------------------------------------------------------------------------

IBTA declares speed as 16 bits, but kernel stores it in u8. This series
fixes in-kernel declaration while keeping external interface intact.

Thanks

Aharon Landau (3):
  net/mlx5: Refactor query port speed functions
  RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
  RDMA: Fix link active_speed size

 .../infiniband/core/uverbs_std_types_device.c |  3 +-
 drivers/infiniband/core/verbs.c               |  2 +-
 drivers/infiniband/hw/bnxt_re/bnxt_re.h       |  2 +-
 drivers/infiniband/hw/hfi1/verbs.c            |  2 +-
 drivers/infiniband/hw/mlx5/main.c             | 41 +++++++------------
 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c   |  2 +-
 drivers/infiniband/hw/qedr/verbs.c            |  2 +-
 drivers/infiniband/hw/qib/qib.h               |  6 +--
 .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h   |  2 +-
 .../mellanox/mlx5/core/ipoib/ethtool.c        | 31 ++------------
 .../net/ethernet/mellanox/mlx5/core/port.c    | 23 ++---------
 include/linux/mlx5/port.h                     | 15 +++++--
 include/rdma/ib_verbs.h                       |  4 +-
 13 files changed, 47 insertions(+), 88 deletions(-)

--
2.26.2

Comments

Jason Gunthorpe Sept. 17, 2020, 11:41 a.m. UTC | #1
On Thu, Sep 17, 2020 at 12:02:20PM +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Changelog:
> v2:
>  * Changed WARN_ON casting to be saturated value instead while returning active_speed
>    to the user.
> v1: https://lore.kernel.org/linux-rdma/20200902074503.743310-1-leon@kernel.org
>  * Changed patch #1 to fix memory corruption to help with bisect. No
>    change in series, because the added code is changed anyway in patch
>    #3.
> v0:
>  * https://lore.kernel.org/linux-rdma/20200824105826.1093613-1-leon@kernel.org
> 
> 
> IBTA declares speed as 16 bits, but kernel stores it in u8. This series
> fixes in-kernel declaration while keeping external interface intact.
> 
> Thanks
> 
> Aharon Landau (3):
>   net/mlx5: Refactor query port speed functions
>   RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
>   RDMA: Fix link active_speed size

Look OK, can you update the shared branch?

Thanks,
Jason
Leon Romanovsky Sept. 17, 2020, 4:35 p.m. UTC | #2
On Thu, Sep 17, 2020 at 08:41:54AM -0300, Jason Gunthorpe wrote:
> On Thu, Sep 17, 2020 at 12:02:20PM +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@nvidia.com>
> >
> > Changelog:
> > v2:
> >  * Changed WARN_ON casting to be saturated value instead while returning active_speed
> >    to the user.
> > v1: https://lore.kernel.org/linux-rdma/20200902074503.743310-1-leon@kernel.org
> >  * Changed patch #1 to fix memory corruption to help with bisect. No
> >    change in series, because the added code is changed anyway in patch
> >    #3.
> > v0:
> >  * https://lore.kernel.org/linux-rdma/20200824105826.1093613-1-leon@kernel.org
> >
> >
> > IBTA declares speed as 16 bits, but kernel stores it in u8. This series
> > fixes in-kernel declaration while keeping external interface intact.
> >
> > Thanks
> >
> > Aharon Landau (3):
> >   net/mlx5: Refactor query port speed functions
> >   RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
> >   RDMA: Fix link active_speed size
>
> Look OK, can you update the shared branch?

I pushed first two patches to mlx5-next branch:

e27014bdb47e RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
639bf4415cad net/mlx5: Refactor query port speed functions

Thanks

>
> Thanks,
> Jason
Jason Gunthorpe Sept. 17, 2020, 11:04 p.m. UTC | #3
On Thu, Sep 17, 2020 at 07:35:20PM +0300, Leon Romanovsky wrote:
> On Thu, Sep 17, 2020 at 08:41:54AM -0300, Jason Gunthorpe wrote:
> > On Thu, Sep 17, 2020 at 12:02:20PM +0300, Leon Romanovsky wrote:
> > > From: Leon Romanovsky <leonro@nvidia.com>
> > >
> > > Changelog:
> > > v2:
> > >  * Changed WARN_ON casting to be saturated value instead while returning active_speed
> > >    to the user.
> > > v1: https://lore.kernel.org/linux-rdma/20200902074503.743310-1-leon@kernel.org
> > >  * Changed patch #1 to fix memory corruption to help with bisect. No
> > >    change in series, because the added code is changed anyway in patch
> > >    #3.
> > > v0:
> > >  * https://lore.kernel.org/linux-rdma/20200824105826.1093613-1-leon@kernel.org
> > >
> > >
> > > IBTA declares speed as 16 bits, but kernel stores it in u8. This series
> > > fixes in-kernel declaration while keeping external interface intact.
> > >
> > > Thanks
> > >
> > > Aharon Landau (3):
> > >   net/mlx5: Refactor query port speed functions
> > >   RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
> > >   RDMA: Fix link active_speed size
> >
> > Look OK, can you update the shared branch?
> 
> I pushed first two patches to mlx5-next branch:
> 
> e27014bdb47e RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
> 639bf4415cad net/mlx5: Refactor query port speed functions

Applied to for-next, thanks

Jason
Jason Gunthorpe Sept. 18, 2020, 1:33 p.m. UTC | #4
On Thu, Sep 17, 2020 at 08:04:42PM -0300, Jason Gunthorpe wrote:
> On Thu, Sep 17, 2020 at 07:35:20PM +0300, Leon Romanovsky wrote:
> > On Thu, Sep 17, 2020 at 08:41:54AM -0300, Jason Gunthorpe wrote:
> > > On Thu, Sep 17, 2020 at 12:02:20PM +0300, Leon Romanovsky wrote:
> > > > From: Leon Romanovsky <leonro@nvidia.com>
> > > >
> > > > Changelog:
> > > > v2:
> > > >  * Changed WARN_ON casting to be saturated value instead while returning active_speed
> > > >    to the user.
> > > > v1: https://lore.kernel.org/linux-rdma/20200902074503.743310-1-leon@kernel.org
> > > >  * Changed patch #1 to fix memory corruption to help with bisect. No
> > > >    change in series, because the added code is changed anyway in patch
> > > >    #3.
> > > > v0:
> > > >  * https://lore.kernel.org/linux-rdma/20200824105826.1093613-1-leon@kernel.org
> > > >
> > > >
> > > > IBTA declares speed as 16 bits, but kernel stores it in u8. This series
> > > > fixes in-kernel declaration while keeping external interface intact.
> > > >
> > > > Thanks
> > > >
> > > > Aharon Landau (3):
> > > >   net/mlx5: Refactor query port speed functions
> > > >   RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
> > > >   RDMA: Fix link active_speed size
> > >
> > > Look OK, can you update the shared branch?
> > 
> > I pushed first two patches to mlx5-next branch:
> > 
> > e27014bdb47e RDMA/mlx5: Delete duplicated mlx5_ptys_width enum
> > 639bf4415cad net/mlx5: Refactor query port speed functions
> 
> Applied to for-next, thanks

Actually it needed a little help with this:

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index caa9c5966e44bd..a7e203bcb012db 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -535,7 +535,8 @@ enum ib_port_speed {
 	IB_SPEED_FDR10	= 8,
 	IB_SPEED_FDR	= 16,
 	IB_SPEED_EDR	= 32,
-	IB_SPEED_HDR	= 64
+	IB_SPEED_HDR	= 64,
+	IB_SPEED_NDR	= 128,
 };
 
 /**

I fixed it

Jason