Commit d1483bb9 authored by Vasu Dev's avatar Vasu Dev Committed by James Bottomley

[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: default avatarVasu Dev <vasu.dev@intel.com>
Tested-by: default avatarRoss Brattain <ross.b.brattain@intel.com>
Signed-off-by: default avatarYi Zou <yi.zou@intel.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent e17b4af7
...@@ -280,6 +280,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe, ...@@ -280,6 +280,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
* use the first one for SPMA */ * use the first one for SPMA */
real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ? real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ?
vlan_dev_real_dev(netdev) : netdev; vlan_dev_real_dev(netdev) : netdev;
fcoe->realdev = real_dev;
rcu_read_lock(); rcu_read_lock();
for_each_dev_addr(real_dev, ha) { for_each_dev_addr(real_dev, ha) {
if ((ha->type == NETDEV_HW_ADDR_T_SAN) && if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
...@@ -1518,7 +1519,13 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) ...@@ -1518,7 +1519,13 @@ int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp)
skb_reset_network_header(skb); skb_reset_network_header(skb);
skb->mac_len = elen; skb->mac_len = elen;
skb->protocol = htons(ETH_P_FCOE); skb->protocol = htons(ETH_P_FCOE);
skb->dev = fcoe->netdev; if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN &&
fcoe->realdev->features & NETIF_F_HW_VLAN_TX) {
skb->vlan_tci = VLAN_TAG_PRESENT |
vlan_dev_vlan_id(fcoe->netdev);
skb->dev = fcoe->realdev;
} else
skb->dev = fcoe->netdev;
/* fill up mac and fcoe headers */ /* fill up mac and fcoe headers */
eh = eth_hdr(skb); eh = eth_hdr(skb);
......
...@@ -80,6 +80,7 @@ do { \ ...@@ -80,6 +80,7 @@ do { \
struct fcoe_interface { struct fcoe_interface {
struct list_head list; struct list_head list;
struct net_device *netdev; struct net_device *netdev;
struct net_device *realdev;
struct packet_type fcoe_packet_type; struct packet_type fcoe_packet_type;
struct packet_type fip_packet_type; struct packet_type fip_packet_type;
struct fcoe_ctlr ctlr; struct fcoe_ctlr ctlr;
......
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