aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_fcpim.h
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-24 23:24:29 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 18:11:09 -0400
commit4507025d01149aea8705e43508d0ef11e7010cfd (patch)
tree937fefad76c8534bd42e0d1e46659db61ea57288 /drivers/scsi/bfa/bfa_fcpim.h
parent3fd459804ff8e002db2671900debd0fc6dc6c443 (diff)
[SCSI] bfa: DMA memory allocation enhancement.
- Modified the design such that each BFA sub-module will provide the amount of DMA and KVA memory needed by it and queues the same request to the global dma and kva info queues. - During the memory allocation we iterate over this queue to allocate the dma and kva memory requested by sub-modules. - The change is needed to avoid requesting the aggregate amount of memory needed by all the BFA sub-modules as one contiguous chunk. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcpim.h')
-rw-r--r--drivers/scsi/bfa/bfa_fcpim.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h
index bc6b294426ec..ccb7c6ebebf9 100644
--- a/drivers/scsi/bfa/bfa_fcpim.h
+++ b/drivers/scsi/bfa/bfa_fcpim.h
@@ -25,8 +25,8 @@
25#include "bfa_cs.h" 25#include "bfa_cs.h"
26 26
27/* FCP module related definitions */ 27/* FCP module related definitions */
28#define BFA_IO_MAX 2000 28#define BFA_IO_MAX BFI_IO_MAX
29#define BFA_FWTIO_MAX 0 29#define BFA_FWTIO_MAX 2000
30 30
31struct bfa_fcp_mod_s; 31struct bfa_fcp_mod_s;
32struct bfa_iotag_s { 32struct bfa_iotag_s {
@@ -41,16 +41,17 @@ struct bfa_itn_s {
41void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport, 41void bfa_itn_create(struct bfa_s *bfa, struct bfa_rport_s *rport,
42 void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m)); 42 void (*isr)(struct bfa_s *bfa, struct bfi_msg_s *m));
43void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m); 43void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m);
44void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp, struct bfa_meminfo_s *minfo); 44void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp);
45void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw); 45void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw);
46 46
47#define BFA_FCP_MOD(_hal) (&(_hal)->modules.fcp_mod) 47#define BFA_FCP_MOD(_hal) (&(_hal)->modules.fcp_mod)
48#define BFA_MEM_FCP_KVA(__bfa) (&(BFA_FCP_MOD(__bfa)->kva_seg))
48#define BFA_IOTAG_FROM_TAG(_fcp, _tag) \ 49#define BFA_IOTAG_FROM_TAG(_fcp, _tag) \
49 (&(_fcp)->iotag_arr[(_tag & BFA_IOIM_IOTAG_MASK)]) 50 (&(_fcp)->iotag_arr[(_tag & BFA_IOIM_IOTAG_MASK)])
50#define BFA_ITN_FROM_TAG(_fcp, _tag) \ 51#define BFA_ITN_FROM_TAG(_fcp, _tag) \
51 ((_fcp)->itn_arr + ((_tag) & ((_fcp)->num_itns - 1))) 52 ((_fcp)->itn_arr + ((_tag) & ((_fcp)->num_itns - 1)))
52#define BFA_SNSINFO_FROM_TAG(_fcp, _tag) \ 53#define BFA_SNSINFO_FROM_TAG(_fcp, _tag) \
53 (((u8 *)(_fcp)->snsbase.kva) + (_tag * BFI_IOIM_SNSLEN)) 54 bfa_mem_get_dmabuf_kva(_fcp, _tag, BFI_IOIM_SNSLEN)
54 55
55#define BFA_ITNIM_MIN 32 56#define BFA_ITNIM_MIN 32
56#define BFA_ITNIM_MAX 1024 57#define BFA_ITNIM_MAX 1024
@@ -130,6 +131,9 @@ struct bfa_fcpim_s {
130 bfa_fcpim_profile_t profile_start; 131 bfa_fcpim_profile_t profile_start;
131}; 132};
132 133
134/* Max FCP dma segs required */
135#define BFA_FCP_DMA_SEGS BFI_IOIM_SNSBUF_SEGS
136
133struct bfa_fcp_mod_s { 137struct bfa_fcp_mod_s {
134 struct bfa_s *bfa; 138 struct bfa_s *bfa;
135 struct list_head iotag_ioim_free_q; /* free IO resources */ 139 struct list_head iotag_ioim_free_q; /* free IO resources */
@@ -140,8 +144,10 @@ struct bfa_fcp_mod_s {
140 int num_ioim_reqs; 144 int num_ioim_reqs;
141 int num_fwtio_reqs; 145 int num_fwtio_reqs;
142 int num_itns; 146 int num_itns;
143 struct bfa_dma_s snsbase; 147 struct bfa_dma_s snsbase[BFA_FCP_DMA_SEGS];
144 struct bfa_fcpim_s fcpim; 148 struct bfa_fcpim_s fcpim;
149 struct bfa_mem_dma_s dma_seg[BFA_FCP_DMA_SEGS];
150 struct bfa_mem_kva_s kva_seg;
145}; 151};
146 152
147/* 153/*
@@ -256,8 +262,7 @@ bfa_ioim_maxretry_reached(struct bfa_ioim_s *ioim)
256/* 262/*
257 * function prototypes 263 * function prototypes
258 */ 264 */
259void bfa_ioim_attach(struct bfa_fcpim_s *fcpim, 265void bfa_ioim_attach(struct bfa_fcpim_s *fcpim);
260 struct bfa_meminfo_s *minfo);
261void bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); 266void bfa_ioim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
262void bfa_ioim_good_comp_isr(struct bfa_s *bfa, 267void bfa_ioim_good_comp_isr(struct bfa_s *bfa,
263 struct bfi_msg_s *msg); 268 struct bfi_msg_s *msg);
@@ -267,18 +272,15 @@ void bfa_ioim_cleanup_tm(struct bfa_ioim_s *ioim,
267void bfa_ioim_iocdisable(struct bfa_ioim_s *ioim); 272void bfa_ioim_iocdisable(struct bfa_ioim_s *ioim);
268void bfa_ioim_tov(struct bfa_ioim_s *ioim); 273void bfa_ioim_tov(struct bfa_ioim_s *ioim);
269 274
270void bfa_tskim_attach(struct bfa_fcpim_s *fcpim, 275void bfa_tskim_attach(struct bfa_fcpim_s *fcpim);
271 struct bfa_meminfo_s *minfo);
272void bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); 276void bfa_tskim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
273void bfa_tskim_iodone(struct bfa_tskim_s *tskim); 277void bfa_tskim_iodone(struct bfa_tskim_s *tskim);
274void bfa_tskim_iocdisable(struct bfa_tskim_s *tskim); 278void bfa_tskim_iocdisable(struct bfa_tskim_s *tskim);
275void bfa_tskim_cleanup(struct bfa_tskim_s *tskim); 279void bfa_tskim_cleanup(struct bfa_tskim_s *tskim);
276void bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw); 280void bfa_tskim_res_recfg(struct bfa_s *bfa, u16 num_tskim_fw);
277 281
278void bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len, 282void bfa_itnim_meminfo(struct bfa_iocfc_cfg_s *cfg, u32 *km_len);
279 u32 *dm_len); 283void bfa_itnim_attach(struct bfa_fcpim_s *fcpim);
280void bfa_itnim_attach(struct bfa_fcpim_s *fcpim,
281 struct bfa_meminfo_s *minfo);
282void bfa_itnim_iocdisable(struct bfa_itnim_s *itnim); 284void bfa_itnim_iocdisable(struct bfa_itnim_s *itnim);
283void bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg); 285void bfa_itnim_isr(struct bfa_s *bfa, struct bfi_msg_s *msg);
284void bfa_itnim_iodone(struct bfa_itnim_s *itnim); 286void bfa_itnim_iodone(struct bfa_itnim_s *itnim);