Commit a222ad1a authored by Karen Xie's avatar Karen Xie Committed by James Bottomley

[SCSI] cxgb3i: fix connection error when vlan is enabled

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: default avatarKaren Xie <kxie@chelsio.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 39562e78
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/inet.h> #include <linux/inet.h>
#include <linux/crypto.h> #include <linux/crypto.h>
#include <linux/if_vlan.h>
#include <net/dst.h> #include <net/dst.h>
#include <net/tcp.h> #include <net/tcp.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
...@@ -184,6 +185,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev) ...@@ -184,6 +185,9 @@ static struct cxgb3i_hba *cxgb3i_hba_find_by_netdev(struct net_device *ndev)
struct cxgb3i_adapter *snic; struct cxgb3i_adapter *snic;
int i; int i;
if (ndev->priv_flags & IFF_802_1Q_VLAN)
ndev = vlan_dev_real_dev(ndev);
read_lock(&cxgb3i_snic_rwlock); read_lock(&cxgb3i_snic_rwlock);
list_for_each_entry(snic, &cxgb3i_snic_list, list_head) { list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
for (i = 0; i < snic->hba_cnt; i++) { for (i = 0; i < snic->hba_cnt; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment