diff mbox series

scsi: libcxgbi: find cxgbi device by MAC address

Message ID 1555167114-3318-1-git-send-email-varun@chelsio.com (mailing list archive)
State Mainlined
Commit ffcd686b913eab35b7f447d8e373aae16d5fed34
Headers show
Series scsi: libcxgbi: find cxgbi device by MAC address | expand

Commit Message

Varun Prakash April 13, 2019, 2:51 p.m. UTC
If cxgbi_device_find_by_netdev() returns NULL
then find cxgbi device by MAC address.

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

Comments

Martin K. Petersen April 16, 2019, 2:13 a.m. UTC | #1
Varun,

> If cxgbi_device_find_by_netdev() returns NULL then find cxgbi device
> by MAC address.

Applied to 5.2/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index 006372b..b7d28d4 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -282,7 +282,6 @@  struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *ndev,
 }
 EXPORT_SYMBOL_GPL(cxgbi_device_find_by_netdev_rcu);
 
-#if IS_ENABLED(CONFIG_IPV6)
 static struct cxgbi_device *cxgbi_device_find_by_mac(struct net_device *ndev,
 						     int *port)
 {
@@ -315,7 +314,6 @@  static struct cxgbi_device *cxgbi_device_find_by_mac(struct net_device *ndev,
 		  ndev, ndev->name);
 	return NULL;
 }
-#endif
 
 void cxgbi_hbas_remove(struct cxgbi_device *cdev)
 {
@@ -653,6 +651,8 @@  cxgbi_check_route(struct sockaddr *dst_addr, int ifindex)
 	}
 
 	cdev = cxgbi_device_find_by_netdev(ndev, &port);
+	if (!cdev)
+		cdev = cxgbi_device_find_by_mac(ndev, &port);
 	if (!cdev) {
 		pr_info("dst %pI4, %s, NOT cxgbi device.\n",
 			&daddr->sin_addr.s_addr, ndev->name);