scsi: libcxgbi: find cxgbi device by MAC address
authorVarun Prakash <varun@chelsio.com>
Sat, 13 Apr 2019 14:51:54 +0000 (20:21 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 16 Apr 2019 02:13:12 +0000 (22:13 -0400)
If cxgbi_device_find_by_netdev() returns NULL then find cxgbi device by MAC
address.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/libcxgbi.c

index 1d91154845038e7f02e7bc215445ce972d9e5182..d7abc7e9ec9429d2677d6b47a3e580cc8bf65799 100644 (file)
@@ -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);