All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: libcxgbi: in case of vlan pass 0 as ifindex to find route
@ 2017-10-10 13:55 Varun Prakash
  2017-10-11 18:27 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Varun Prakash @ 2017-10-10 13:55 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, indranil, varun

In case of vlan pass 0 as ifindex to find route instead of
passing real_dev ifindex, if we pass real_dev ifindex
then ip_route_output_ports() and ip6_route_output() will
check for route through real_dev not through vlan interface.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/scsi/cxgbi/libcxgbi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 512c8f1..8503ac9 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -2556,7 +2556,10 @@ struct iscsi_endpoint *cxgbi_ep_connect(struct Scsi_Host *shost,
 			goto err_out;
 		}
 
-		ifindex = hba->ndev->ifindex;
+		rtnl_lock();
+		if (!vlan_uses_dev(hba->ndev))
+			ifindex = hba->ndev->ifindex;
+		rtnl_unlock();
 	}
 
 	if (dst_addr->sa_family == AF_INET) {
-- 
2.0.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: libcxgbi: in case of vlan pass 0 as ifindex to find route
  2017-10-10 13:55 [PATCH] scsi: libcxgbi: in case of vlan pass 0 as ifindex to find route Varun Prakash
@ 2017-10-11 18:27 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2017-10-11 18:27 UTC (permalink / raw)
  To: Varun Prakash; +Cc: martin.petersen, linux-scsi, indranil


Varun,

> In case of vlan pass 0 as ifindex to find route instead of passing
> real_dev ifindex, if we pass real_dev ifindex then
> ip_route_output_ports() and ip6_route_output() will check for route
> through real_dev not through vlan interface.

Applied to 4.15/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-11 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10 13:55 [PATCH] scsi: libcxgbi: in case of vlan pass 0 as ifindex to find route Varun Prakash
2017-10-11 18:27 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.