summaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc/tcm_fc.h
diff options
context:
space:
mode:
authorKiran Patil <kiran.patil@intel.com>2011-08-03 11:20:01 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2011-08-03 11:38:21 +0200
commitdcd998ccdbf74a7d8fe0f0a44e85da1ed5975946 (patch)
tree1f8464657afdff8b1ca63c8f060b50ffb1bc73be /drivers/target/tcm_fc/tcm_fc.h
parenttarget: Fix bug for transport_generic_wait_for_tasks with direct operation (diff)
downloadlinux-dcd998ccdbf74a7d8fe0f0a44e85da1ed5975946.tar.xz
linux-dcd998ccdbf74a7d8fe0f0a44e85da1ed5975946.zip
tcm_fc: Handle DDP/SW fc_frame_payload_get failures in ft_recv_write_data
Problem: HW DDP context was not invalidated in case of ABORTS, etc... This leads to the problem where memory pages which are used for DDP as user descriptor could get reused for some other purpose (such as to satisfy new memory allocation request either by kernel or user mode threads) and since HW DDP context was not invalidated, HW continue to write to those pages, hence causing memory corruption. Fix: Either on incoming ABORTS or due to exchange time out, allowed the target to cleanup HW DDP context if it was setup for respective ft_cmd. Added new function to perform this cleanup, furthur it can be enhanced for other cleanup activity. Fix ft_recv_write_data() to properly handle fc_frame_payload_get to return pointer to payload if it exist. If there is no payload which is most common case (+ve case in case if DDP is working as expected, it will return NULL. Yes, scope of buf is limited to printk. Invalidation of HW context (which is done inside ft_invl_hw_context() is necessary in SUCCESS and FAILURE case of DDP. Hence invalidation is DONE as long as there was DDP setup (whether it worked correctly or not, NOTE: For some reason, if there is any error w.r.t DDP such as out of order packet reception, HW simply post the full packet in rx queue. Signed-off-by: Kiran Patil <kiran.patil@intel.com> Cc: Robert W Love <robert.w.love@intel.com> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/tcm_fc/tcm_fc.h')
-rw-r--r--drivers/target/tcm_fc/tcm_fc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h
index f7fff7ed63c3..bd4fe21a23b8 100644
--- a/drivers/target/tcm_fc/tcm_fc.h
+++ b/drivers/target/tcm_fc/tcm_fc.h
@@ -187,4 +187,9 @@ void ft_dump_cmd(struct ft_cmd *, const char *caller);
ssize_t ft_format_wwn(char *, size_t, u64);
+/*
+ * Underlying HW specific helper function
+ */
+void ft_invl_hw_context(struct ft_cmd *);
+
#endif /* __TCM_FC_H__ */