aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasu Dev <vasu.dev@intel.com>2011-09-28 00:38:13 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-10-02 13:57:12 -0400
commitd1483bb90a01ec68c2f6dc8842ce2d449cd6d6d0 (patch)
tree5e053e97351e55bc5cafc8c6694afc3c2f87647a
parente17b4af7c7a6f5c24b0e6b856bb45a1a22be75f5 (diff)
[SCSI] fcoe: use real dev in case of HW vlan acceleration
Use real dev in case it has HW vlan acceleration support since in this case the real dev would do needed vlan processing, this way unnecessary vlan layer processing avoided and it gives slightly better IOPS with 512B size IOs. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/fcoe/fcoe.c9
-rw-r--r--drivers/scsi/fcoe/fcoe.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 010432596eaf..0086fc836b54 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -280,6 +280,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
280 * use the first one for SPMA */ 280 * use the first one for SPMA */
281 real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ? 281 real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ?
282 vlan_dev_real_dev(netdev) : netdev; 282 vlan_dev_real_dev(netdev) : netdev;
283 fcoe->realdev = real_dev;
283 rcu_read_lock(); 284 rcu_read_lock();
284 for_each_dev_addr(real_dev, ha) { 285 for_each_dev_addr(real_dev, ha) {
285 if ((ha->type == NETDEV_HW_ADDR_T_SAN) && 286 if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
@@ -1518,7 +1519,13 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
1518 skb_reset_network_header(skb); 1519 skb_reset_network_header(skb);
1519 skb->mac_len = elen; 1520 skb->mac_len = elen;
1520 skb->protocol = htons(ETH_P_FCOE); 1521 skb->protocol = htons(ETH_P_FCOE);
1521 skb->dev = fcoe->netdev; 1522 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
1523 fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
1524 skb->vlan_tci = VLAN_TAG_PRESENT |
1525 vlan_dev_vlan_id(fcoe->netdev);
1526 skb->dev = fcoe->realdev;
1527 } else
1528 skb->dev = fcoe->netdev;
1522 1529
1523 /* fill up mac and fcoe headers */ 1530 /* fill up mac and fcoe headers */
1524 eh = eth_hdr(skb); 1531 eh = eth_hdr(skb);
diff --git a/drivers/scsi/fcoe/fcoe.h b/drivers/scsi/fcoe/fcoe.h
index 408a6fd78fb4..6c6884bcf840 100644
--- a/drivers/scsi/fcoe/fcoe.h
+++ b/drivers/scsi/fcoe/fcoe.h
@@ -80,6 +80,7 @@ do { \
80struct fcoe_interface { 80struct fcoe_interface {
81 struct list_head list; 81 struct list_head list;
82 struct net_device *netdev; 82 struct net_device *netdev;
83 struct net_device *realdev;
83 struct packet_type fcoe_packet_type; 84 struct packet_type fcoe_packet_type;
84 struct packet_type fip_packet_type; 85 struct packet_type fip_packet_type;
85 struct fcoe_ctlr ctlr; 86 struct fcoe_ctlr ctlr;