]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
[SCSI] cxgb3i: fix connection error when vlan is enabled
authorKaren Xie <kxie@chelsio.com>
Fri, 26 Jun 2009 22:17:29 +0000 (15:17 -0700)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Sat, 27 Jun 2009 17:56:00 +0000 (12:56 -0500)
There is a bug when VLAN is configured on the cxgb3 interface, the iscsi
conn. would be denied with message "cxgb3i: NOT going through cxgbi device."

This patch adds code to get the real egress net_device when vlan is configured.

Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
drivers/scsi/cxgb3i/cxgb3i_iscsi.c

index 74369a3f963b66bdbdbaa0b71bdd6f848a074048..c399f485aa7d1228c415c703c85ceddafcbdc0cf 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <linux/inet.h>
 #include <linux/crypto.h>
+#include <linux/if_vlan.h>
 #include <net/dst.h>
 #include <net/tcp.h>
 #include <scsi/scsi_cmnd.h>
@@ -184,6 +185,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
        struct cxgb3i_adapter *snic;
        int i;
 
+       if (ndev->priv_flags & IFF_802_1Q_VLAN)
+               ndev = vlan_dev_real_dev(ndev);
+
        read_lock(&cxgb3i_snic_rwlock);
        list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
                for (i = 0; i < snic->hba_cnt; i++) {