aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorKaren Xie <kxie@chelsio.com>2014-12-11 22:13:41 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-12 11:22:29 -0500
commitf7bcd2e11107af39367fb726196f372f8ad05199 (patch)
tree8be0f9b38f1b06fe5e287cd5f77763788221f0b3 /drivers/scsi
parent928567ada48b772505e5245267d616c7af97edf0 (diff)
cxgb4i: handle non-pdu-aligned rx data
Abort the connection upon receiving of cpl_rx_data, which means the pdu cannot be recovered from the tcp stream. This generally is due to pdu header corruption. Signed-off-by: Karen Xie <kxie@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/cxgbi/cxgb4i/cxgb4i.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
index 8ca91fdfdc35..8b7e8f815357 100644
--- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
+++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
@@ -1037,6 +1037,27 @@ rel_skb:
1037 __kfree_skb(skb); 1037 __kfree_skb(skb);
1038} 1038}
1039 1039
1040static void do_rx_data(struct cxgbi_device *cdev, struct sk_buff *skb)
1041{
1042 struct cxgbi_sock *csk;
1043 struct cpl_rx_data *cpl = (struct cpl_rx_data *)skb->data;
1044 unsigned int tid = GET_TID(cpl);
1045 struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(cdev);
1046 struct tid_info *t = lldi->tids;
1047
1048 csk = lookup_tid(t, tid);
1049 if (!csk) {
1050 pr_err("can't find connection for tid %u.\n", tid);
1051 } else {
1052 /* not expecting this, reset the connection. */
1053 pr_err("csk 0x%p, tid %u, rcv cpl_rx_data.\n", csk, tid);
1054 spin_lock_bh(&csk->lock);
1055 send_abort_req(csk);
1056 spin_unlock_bh(&csk->lock);
1057 }
1058 __kfree_skb(skb);
1059}
1060
1040static void do_rx_iscsi_hdr(struct cxgbi_device *cdev, struct sk_buff *skb) 1061static void do_rx_iscsi_hdr(struct cxgbi_device *cdev, struct sk_buff *skb)
1041{ 1062{
1042 struct cxgbi_sock *csk; 1063 struct cxgbi_sock *csk;
@@ -1456,6 +1477,7 @@ cxgb4i_cplhandler_func cxgb4i_cplhandlers[NUM_CPL_CMDS] = {
1456 [CPL_SET_TCB_RPL] = do_set_tcb_rpl, 1477 [CPL_SET_TCB_RPL] = do_set_tcb_rpl,
1457 [CPL_RX_DATA_DDP] = do_rx_data_ddp, 1478 [CPL_RX_DATA_DDP] = do_rx_data_ddp,
1458 [CPL_RX_ISCSI_DDP] = do_rx_data_ddp, 1479 [CPL_RX_ISCSI_DDP] = do_rx_data_ddp,
1480 [CPL_RX_DATA] = do_rx_data,
1459}; 1481};
1460 1482
1461int cxgb4i_ofld_init(struct cxgbi_device *cdev) 1483int cxgb4i_ofld_init(struct cxgbi_device *cdev)