diff mbox

[v2] rdma/core: Don't dereference device->get_link_layer directly

Message ID 1505908483-29641-1-git-send-email-sagi@grimberg.me (mailing list archive)
State Not Applicable
Headers show

Commit Message

Sagi Grimberg Sept. 20, 2017, 11:54 a.m. UTC
We have rdma_port_get_link_layer that checks the callout
is actually implemented.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
---
Changes from v1:
- fixed typo

 drivers/infiniband/core/verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Estrin, Alex Sept. 20, 2017, 12:33 p.m. UTC | #1
Patch for this issue was already posted about 3 weeks ago.
https://patchwork.kernel.org/patch/9932505/

Thanks,
Alex.

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Sagi Grimberg
> Sent: Wednesday, September 20, 2017 7:55 AM
> To: Doug Ledford <dledford@redhat.com>
> Cc: linux-rdma@vger.kernel.org
> Subject: [PATCH v2] rdma/core: Don't dereference device->get_link_layer directly
> 
> We have rdma_port_get_link_layer that checks the callout
> is actually implemented.
> 
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> Changes from v1:
> - fixed typo
> 
>  drivers/infiniband/core/verbs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index ee9e27dc799b..de57d6c11a25 100644
> --- a/drivers/infiniband/core/verbs.c
> +++ b/drivers/infiniband/core/verbs.c
> @@ -1646,7 +1646,7 @@ static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid)
>  	 */
>  	if (!ib_query_qp(qp, &attr, IB_QP_STATE | IB_QP_PORT, &init_attr)) {
>  		if (attr.qp_state >= IB_QPS_INIT) {
> -			if (qp->device->get_link_layer(qp->device, attr.port_num) !=
> +			if (rdma_port_get_link_layer(qp->device, attr.port_num) !=
>  			    IB_LINK_LAYER_INFINIBAND)
>  				return true;
>  			goto lid_check;
> @@ -1655,7 +1655,7 @@ static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid)
> 
>  	/* Can't get a quick answer, iterate over all ports */
>  	for (port = 0; port < qp->device->phys_port_cnt; port++)
> -		if (qp->device->get_link_layer(qp->device, port) !=
> +		if (rdma_port_get_link_layer(qp->device, port) !=
>  		    IB_LINK_LAYER_INFINIBAND)
>  			num_eth_ports++;
> 
> --
> 2.7.4
> 
> --
> 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
Leon Romanovsky Sept. 20, 2017, 1:47 p.m. UTC | #2
On Wed, Sep 20, 2017 at 12:33:39PM +0000, Estrin, Alex wrote:
> Patch for this issue was already posted about 3 weeks ago.
> https://patchwork.kernel.org/patch/9932505/

Yeah, exactly.
I had a dejavu while I read the "crash IPoIB" report.

I assume that it didn't make to Linus, because it was posted after Doug
went to vacation.

Thanks
Doug Ledford Sept. 22, 2017, 5:23 p.m. UTC | #3
On Wed, 2017-09-20 at 16:47 +0300, Leon Romanovsky wrote:
> On Wed, Sep 20, 2017 at 12:33:39PM +0000, Estrin, Alex wrote:
> > Patch for this issue was already posted about 3 weeks ago.
> > https://patchwork.kernel.org/patch/9932505/
> 
> Yeah, exactly.
> I had a dejavu while I read the "crash IPoIB" report.
> 
> I assume that it didn't make to Linus, because it was posted after
> Doug
> went to vacation.

I wouldn't call it "vacation" ;-).  I had no internet as I was moving
homes.  It was hardly the peaceful, relaxing experience one hopes to
get on vacation! :-)
Leon Romanovsky Sept. 22, 2017, 7:13 p.m. UTC | #4
On Fri, Sep 22, 2017 at 01:23:22PM -0400, Doug Ledford wrote:
> On Wed, 2017-09-20 at 16:47 +0300, Leon Romanovsky wrote:
> > On Wed, Sep 20, 2017 at 12:33:39PM +0000, Estrin, Alex wrote:
> > > Patch for this issue was already posted about 3 weeks ago.
> > > https://patchwork.kernel.org/patch/9932505/
> >
> > Yeah, exactly.
> > I had a dejavu while I read the "crash IPoIB" report.
> >
> > I assume that it didn't make to Linus, because it was posted after
> > Doug
> > went to vacation.
>
> I wouldn't call it "vacation" ;-).  I had no internet as I was moving
> homes.  It was hardly the peaceful, relaxing experience one hopes to
> get on vacation! :-)

Nowadays, every day without internet is called "vacation" now :).

>
> --
> Doug Ledford <dledford@redhat.com>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD
>
diff mbox

Patch

diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
index ee9e27dc799b..de57d6c11a25 100644
--- a/drivers/infiniband/core/verbs.c
+++ b/drivers/infiniband/core/verbs.c
@@ -1646,7 +1646,7 @@  static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid)
 	 */
 	if (!ib_query_qp(qp, &attr, IB_QP_STATE | IB_QP_PORT, &init_attr)) {
 		if (attr.qp_state >= IB_QPS_INIT) {
-			if (qp->device->get_link_layer(qp->device, attr.port_num) !=
+			if (rdma_port_get_link_layer(qp->device, attr.port_num) !=
 			    IB_LINK_LAYER_INFINIBAND)
 				return true;
 			goto lid_check;
@@ -1655,7 +1655,7 @@  static bool is_valid_mcast_lid(struct ib_qp *qp, u16 lid)
 
 	/* Can't get a quick answer, iterate over all ports */
 	for (port = 0; port < qp->device->phys_port_cnt; port++)
-		if (qp->device->get_link_layer(qp->device, port) !=
+		if (rdma_port_get_link_layer(qp->device, port) !=
 		    IB_LINK_LAYER_INFINIBAND)
 			num_eth_ports++;