diff mbox

[for-rc,1/5] RDMA/qedr: Fix iWARP over ipv6 address resolution

Message ID 1520239811-10934-2-git-send-email-Michal.Kalderon@cavium.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Kalderon, Michal March 5, 2018, 8:50 a.m. UTC
Use device network namespaces instead of init_net

Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
---
 drivers/infiniband/hw/qedr/qedr_iw_cm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe March 6, 2018, 11:52 p.m. UTC | #1
On Mon, Mar 05, 2018 at 10:50:07AM +0200, Michal Kalderon wrote:
> Use device network namespaces instead of init_net
> 
> Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
> Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
>  drivers/infiniband/hw/qedr/qedr_iw_cm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> index 478b731..28183ea 100644
> +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> @@ -447,7 +447,7 @@ qedr_addr6_resolve(struct qedr_dev *dev,
>  	fl6.daddr = dst_in->sin6_addr;
>  	fl6.saddr = src_in->sin6_addr;
>  
> -	dst = ip6_route_output(&init_net, NULL, &fl6);
> +	dst = ip6_route_output(dev_net(dev->ndev), NULL, &fl6);

what does this have to do with

'Fix iWARP over ipv6 address resolution' ?

There are lots of other init_net's in this driver, it doesn't make any
sense to me to just fix one of them.

.. and using dev_net is harder than just the above, you can't just
obtain the namespace without some kind of locking.

Jason
--
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
Kalderon, Michal March 7, 2018, 12:53 p.m. UTC | #2
> From: Jason Gunthorpe [mailto:jgg@ziepe.ca]
> Sent: Wednesday, March 07, 2018 1:52 AM
> 
> On Mon, Mar 05, 2018 at 10:50:07AM +0200, Michal Kalderon wrote:
> > Use device network namespaces instead of init_net
> >
> > Signed-off-by: Michal Kalderon <Michal.Kalderon@cavium.com>
> > Signed-off-by: Ariel Elior <Ariel.Elior@cavium.com>
> > drivers/infiniband/hw/qedr/qedr_iw_cm.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> > b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> > index 478b731..28183ea 100644
> > +++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
> > @@ -447,7 +447,7 @@ qedr_addr6_resolve(struct qedr_dev *dev,
> >  	fl6.daddr = dst_in->sin6_addr;
> >  	fl6.saddr = src_in->sin6_addr;
> >
> > -	dst = ip6_route_output(&init_net, NULL, &fl6);
> > +	dst = ip6_route_output(dev_net(dev->ndev), NULL, &fl6);
> 
> what does this have to do with
> 
> 'Fix iWARP over ipv6 address resolution' ?
> 
> There are lots of other init_net's in this driver, it doesn't make any sense to
> me to just fix one of them.
> 
> .. and using dev_net is harder than just the above, you can't just obtain the
> namespace without some kind of locking.

Thanks, will revisit and provide as a full feature for adding network namespace support.
 
> 
> Jason
--
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
diff mbox

Patch

diff --git a/drivers/infiniband/hw/qedr/qedr_iw_cm.c b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
index 478b731..28183ea 100644
--- a/drivers/infiniband/hw/qedr/qedr_iw_cm.c
+++ b/drivers/infiniband/hw/qedr/qedr_iw_cm.c
@@ -447,7 +447,7 @@  qedr_addr6_resolve(struct qedr_dev *dev,
 	fl6.daddr = dst_in->sin6_addr;
 	fl6.saddr = src_in->sin6_addr;
 
-	dst = ip6_route_output(&init_net, NULL, &fl6);
+	dst = ip6_route_output(dev_net(dev->ndev), NULL, &fl6);
 
 	if ((!dst) || dst->error) {
 		if (dst) {