summaryrefslogtreecommitdiff
path: root/drivers/scsi/qedf/qedf_main.c
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@cavium.com>2017-08-15 20:08:18 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-08-25 05:29:03 +0300
commitcf29116375b7868aabe826ceda6fbe3f2451f8a7 (patch)
treecbe47af0f9bbd0034db6b3658d223a864ef7ea74 /drivers/scsi/qedf/qedf_main.c
parenta3cd42a9d627fd7c472664e454108829886e123f (diff)
downloadlinux-cf29116375b7868aabe826ceda6fbe3f2451f8a7.tar.xz
scsi: qedf: Corrent VLAN tag insertion in fallback VLAN case.
Currently in the driver the qedf_ctx attribute vlan_hw_insert is used to which whether to insert a VLAN tag in FIP frames (except for FIP VLAN request which is explicitly sent out untagged at least from the driver's point of view). When we receive a FIP VLAN response, we set qedf->vlan_hw_insert to 0 which makes the qedf_fip_send function insert the VLAN. However when we exhaust our FIP VLAN retries, we do not set qedf->vlan_hw_insert to 0 which means that the driver will not tag the FIP frame with the correct VLAN ID. The result that was observed on the wire is that some entity either in the LL2 or L2 firmware is adding a NULL VLAN tag which can cause FIP solicitation to fail. The offload FCoE frame function, qedf_xmit, does not use the vlan_hw_insert attribute to decide whether to tag frames with the FIP/FCoE VLAN. Instead it unilaterially tags the offload frames with the VLAN ID stored in qedf->vlan_id. This is the correct behavior so the driver can guarantee that non-offload FIP frames go out with the correct VLAN ID. Also use the Linux network layer helpers instead of doing the VLAN insert manually. Also fix setting the fallback VLAN so that it used the module parameter and is not hardcoded to 1002 (though 1002 is the default). [mkp: fixed typo] Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf/qedf_main.c')
-rw-r--r--drivers/scsi/qedf/qedf_main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index c61c1352c364..dc6a3f6b9e1f 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -164,7 +164,7 @@ static void qedf_handle_link_update(struct work_struct *work)
QEDF_WARN(&(qedf->dbg_ctx), "Did not receive FIP VLAN "
"response, falling back to default VLAN %d.\n",
qedf_fallback_vlan);
- qedf_set_vlan_id(qedf, QEDF_FALLBACK_VLAN);
+ qedf_set_vlan_id(qedf, qedf_fallback_vlan);
/*
* Zero out data_src_addr so we'll update it with the new
@@ -361,8 +361,9 @@ static void qedf_link_recovery(struct work_struct *work)
/* Since the link when down and up to verify which vlan we're on */
qedf->fipvlan_retries = qedf_fipvlan_retries;
rc = qedf_initiate_fipvlan_req(qedf);
+ /* If getting the VLAN fails, set the VLAN to the fallback one */
if (!rc)
- return;
+ qedf_set_vlan_id(qedf, qedf_fallback_vlan);
/*
* We need to wait for an FCF to be selected due to the
@@ -964,6 +965,10 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp)
skb->mac_len = elen;
skb->protocol = htons(ETH_P_FCOE);
+ /*
+ * Add VLAN tag to non-offload FCoE frame based on current stored VLAN
+ * for FIP/FCoE traffic.
+ */
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), qedf->vlan_id);
/* fill up mac and fcoe headers */
@@ -3174,8 +3179,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
}
set_bit(QEDF_LL2_STARTED, &qedf->flags);
- /* hw will be insterting vlan tag*/
- qedf->vlan_hw_insert = 1;
+ /* Set initial FIP/FCoE VLAN to NULL */
qedf->vlan_id = 0;
/*