diff options
author | Saurav Kashyap <skashyap@marvell.com> | 2019-04-21 22:44:58 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-29 08:34:09 -0400 |
commit | 19c2b6d84b7206548caedda83de96f54ff76f655 (patch) | |
tree | 1d1a6e1dd006a7c6e9e44d5fdc930dae912ec068 /drivers/scsi | |
parent | 249b148f3620577c923894dfab5a75cb59c024eb (diff) | |
download | linux-19c2b6d84b7206548caedda83de96f54ff76f655.tar.bz2 |
scsi: qedf: Check the return value of start_xmit
Log the reason for start xmit failure.
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Chad Dupuis <cdupuis@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qedf/qedf_fip.c | 17 | ||||
-rw-r--r-- | drivers/scsi/qedf/qedf_main.c | 7 |
2 files changed, 21 insertions, 3 deletions
diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index 49d0724535e3..d4741f8dcb41 100644 --- a/drivers/scsi/qedf/qedf_fip.c +++ b/drivers/scsi/qedf/qedf_fip.c @@ -23,6 +23,7 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf) #define MY_FIP_ALL_FCF_MACS ((__u8[6]) { 1, 0x10, 0x18, 1, 0, 2 }) static u8 my_fcoe_all_fcfs[ETH_ALEN] = MY_FIP_ALL_FCF_MACS; unsigned long flags = 0; + int rc = -1; skb = dev_alloc_skb(sizeof(struct fip_vlan)); if (!skb) @@ -66,7 +67,13 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf) } set_bit(QED_LL2_XMIT_FLAGS_FIP_DISCOVERY, &flags); - qed_ops->ll2->start_xmit(qedf->cdev, skb, flags); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, flags); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return; + } + } static void qedf_fcoe_process_vlan_resp(struct qedf_ctx *qedf, @@ -118,6 +125,7 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) struct fip_header *fiph; u16 op, vlan_tci = 0; u8 sub; + int rc = -1; if (!test_bit(QEDF_LL2_STARTED, &qedf->flags)) { QEDF_WARN(&(qedf->dbg_ctx), "LL2 not started\n"); @@ -146,7 +154,12 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) print_hex_dump(KERN_WARNING, "fip ", DUMP_PREFIX_OFFSET, 16, 1, skb->data, skb->len, false); - qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return; + } } static u8 fcoe_all_enode[ETH_ALEN] = FIP_ALL_ENODE_MACS; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index e2f3228f15a6..1de2b18dd96a 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1141,7 +1141,12 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp) if (qedf_dump_frames) print_hex_dump(KERN_WARNING, "fcoe: ", DUMP_PREFIX_OFFSET, 16, 1, skb->data, skb->len, false); - qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return rc; + } return 0; } |