From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Doug Ledford <dledford@redhat.com>,
Aharon Landau <aharonl@mellanox.com>,
Adit Ranadive <aditr@vmware.com>,
Ariel Elior <aelior@marvell.com>,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Devesh Sharma <devesh.sharma@broadcom.com>,
linux-rdma@vger.kernel.org,
Michael Guralnik <michaelgur@nvidia.com>,
Michal Kalderon <mkalderon@marvell.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>,
Selvin Xavier <selvin.xavier@broadcom.com>,
Somnath Kotur <somnath.kotur@broadcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>,
VMware PV-Drivers <pv-drivers@vmware.com>
Subject: Re: [PATCH rdma-next v1 3/3] RDMA: Fix link active_speed size
Date: Tue, 8 Sep 2020 17:26:51 +0300 [thread overview]
Message-ID: <20200908142651.GE421756@unreal> (raw)
In-Reply-To: <20200908141924.GG9166@nvidia.com>
On Tue, Sep 08, 2020 at 11:19:24AM -0300, Jason Gunthorpe wrote:
> On Wed, Sep 02, 2020 at 10:45:03AM +0300, Leon Romanovsky wrote:
> > From: Aharon Landau <aharonl@mellanox.com>
> >
> > According to the IB spec active_speed size should be u16 and not u8 as
> > before. Changing it to allow further extensions in offered speeds.
> >
> > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > Signed-off-by: Aharon Landau <aharonl@mellanox.com>
> > Reviewed-by: Michael Guralnik <michaelgur@nvidia.com>
> > Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
> > drivers/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 | 8 ++------
> > drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +-
> > drivers/infiniband/hw/qedr/verbs.c | 2 +-
> > drivers/infiniband/hw/qib/qib.h | 6 +++---
> > drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h | 2 +-
> > include/rdma/ib_verbs.h | 4 ++--
> > 10 files changed, 15 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/infiniband/core/uverbs_std_types_device.c b/drivers/infiniband/core/uverbs_std_types_device.c
> > index 75df2094a010..7b03446b6936 100644
> > +++ b/drivers/infiniband/core/uverbs_std_types_device.c
> > @@ -165,7 +165,8 @@ void copy_port_attr_to_resp(struct ib_port_attr *attr,
> > resp->subnet_timeout = attr->subnet_timeout;
> > resp->init_type_reply = attr->init_type_reply;
> > resp->active_width = attr->active_width;
> > - resp->active_speed = attr->active_speed;
> > + WARN_ON(attr->active_speed & ~0xFF);
>
> ?? This doesn't seem like a warn on situation..
Why? We are returning u8 to the user, so need to catch overflow.
>
> > @@ -1307,7 +1303,7 @@ static int mlx5_query_hca_port(struct ib_device *ibdev, u8 port,
> > props->port_cap_flags2 = rep->cap_mask2;
> >
> > err = mlx5_query_ib_port_oper(mdev, &ib_link_width_oper,
> > - (u16 *)&props->active_speed, port);
> > + &props->active_speed, port);
>
> This hunk should be in the earlier patch
Sorry about that.
>
> Jason
next prev parent reply other threads:[~2020-09-08 19:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-02 7:45 [PATCH rdma-next v1 0/3] Fix in-kernel active_speed type Leon Romanovsky
2020-09-02 7:45 ` [PATCH mlx5-next v1 1/3] net/mlx5: Refactor query port speed functions Leon Romanovsky
2020-09-02 7:45 ` [PATCH mlx5-next v1 2/3] RDMA/mlx5: Delete duplicated mlx5_ptys_width enum Leon Romanovsky
2020-09-02 7:45 ` [PATCH rdma-next v1 3/3] RDMA: Fix link active_speed size Leon Romanovsky
2020-09-08 14:19 ` Jason Gunthorpe
2020-09-08 14:26 ` Leon Romanovsky [this message]
2020-09-08 14:27 ` Jason Gunthorpe
2020-09-08 14:42 ` Leon Romanovsky
2020-09-08 14:46 ` Jason Gunthorpe
2020-09-08 15:04 ` Leon Romanovsky
2020-09-08 17:21 ` Jason Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200908142651.GE421756@unreal \
--to=leon@kernel.org \
--cc=aditr@vmware.com \
--cc=aelior@marvell.com \
--cc=aharonl@mellanox.com \
--cc=dennis.dalessandro@intel.com \
--cc=devesh.sharma@broadcom.com \
--cc=dledford@redhat.com \
--cc=jgg@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=michaelgur@nvidia.com \
--cc=mike.marciniszyn@intel.com \
--cc=mkalderon@marvell.com \
--cc=nareshkumar.pbs@broadcom.com \
--cc=pv-drivers@vmware.com \
--cc=selvin.xavier@broadcom.com \
--cc=somnath.kotur@broadcom.com \
--cc=sriharsha.basavapatna@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).