diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-09-21 20:26:41 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-10-07 06:21:29 -0400 |
commit | 7ace27ae28a5fa67fa3d25f31d1111991c81e015 (patch) | |
tree | 841612f109ef2b32d15613aa8093d683a6261356 /drivers/scsi | |
parent | 6894f013a71b1bcd09f46b8071f0c6b55fc58139 (diff) |
[SCSI] bfa: Add support for IO throttling at port level
Add capability to limit the number of exchanges on a port to
avoid queue-full conditions from the target side.
Signed-off-by: Sudarsana Reddy Kalluru <skalluru@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/bfa/bfa_core.c | 9 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_defs_svc.h | 13 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.c | 105 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcpim.h | 9 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_rport.c | 6 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.h | 3 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 36 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.h | 9 |
8 files changed, 182 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c index 837879de72c3..eb296286c37e 100644 --- a/drivers/scsi/bfa/bfa_core.c +++ b/drivers/scsi/bfa/bfa_core.c | |||
@@ -983,7 +983,8 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
983 | cfg_info->single_msix_vec = 1; | 983 | cfg_info->single_msix_vec = 1; |
984 | cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG; | 984 | cfg_info->endian_sig = BFI_IOC_ENDIAN_SIG; |
985 | cfg_info->num_cqs = cfg->fwcfg.num_cqs; | 985 | cfg_info->num_cqs = cfg->fwcfg.num_cqs; |
986 | cfg_info->num_ioim_reqs = cpu_to_be16(cfg->fwcfg.num_ioim_reqs); | 986 | cfg_info->num_ioim_reqs = cpu_to_be16(bfa_fcpim_get_throttle_cfg(bfa, |
987 | cfg->fwcfg.num_ioim_reqs)); | ||
987 | cfg_info->num_fwtio_reqs = cpu_to_be16(cfg->fwcfg.num_fwtio_reqs); | 988 | cfg_info->num_fwtio_reqs = cpu_to_be16(cfg->fwcfg.num_fwtio_reqs); |
988 | 989 | ||
989 | bfa_dma_be_addr_set(cfg_info->cfgrsp_addr, iocfc->cfgrsp_dma.pa); | 990 | bfa_dma_be_addr_set(cfg_info->cfgrsp_addr, iocfc->cfgrsp_dma.pa); |
@@ -1245,10 +1246,14 @@ bfa_iocfc_qreg(struct bfa_s *bfa, struct bfi_iocfc_qreg_s *qreg) | |||
1245 | static void | 1246 | static void |
1246 | bfa_iocfc_res_recfg(struct bfa_s *bfa, struct bfa_iocfc_fwcfg_s *fwcfg) | 1247 | bfa_iocfc_res_recfg(struct bfa_s *bfa, struct bfa_iocfc_fwcfg_s *fwcfg) |
1247 | { | 1248 | { |
1249 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | ||
1250 | struct bfi_iocfc_cfg_s *cfg_info = iocfc->cfginfo; | ||
1251 | |||
1248 | bfa_fcxp_res_recfg(bfa, fwcfg->num_fcxp_reqs); | 1252 | bfa_fcxp_res_recfg(bfa, fwcfg->num_fcxp_reqs); |
1249 | bfa_uf_res_recfg(bfa, fwcfg->num_uf_bufs); | 1253 | bfa_uf_res_recfg(bfa, fwcfg->num_uf_bufs); |
1250 | bfa_rport_res_recfg(bfa, fwcfg->num_rports); | 1254 | bfa_rport_res_recfg(bfa, fwcfg->num_rports); |
1251 | bfa_fcp_res_recfg(bfa, fwcfg->num_ioim_reqs); | 1255 | bfa_fcp_res_recfg(bfa, cpu_to_be16(cfg_info->num_ioim_reqs), |
1256 | fwcfg->num_ioim_reqs); | ||
1252 | bfa_tskim_res_recfg(bfa, fwcfg->num_tskim_reqs); | 1257 | bfa_tskim_res_recfg(bfa, fwcfg->num_tskim_reqs); |
1253 | } | 1258 | } |
1254 | 1259 | ||
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h index 18e4f6ba70d2..0e37e233ebc5 100644 --- a/drivers/scsi/bfa/bfa_defs_svc.h +++ b/drivers/scsi/bfa/bfa_defs_svc.h | |||
@@ -875,6 +875,19 @@ struct bfa_lunmask_cfg_s { | |||
875 | struct bfa_lun_mask_s lun_list[MAX_LUN_MASK_CFG]; | 875 | struct bfa_lun_mask_s lun_list[MAX_LUN_MASK_CFG]; |
876 | }; | 876 | }; |
877 | 877 | ||
878 | struct bfa_throttle_cfg_s { | ||
879 | u16 is_valid; | ||
880 | u16 value; | ||
881 | u32 rsvd; | ||
882 | }; | ||
883 | |||
884 | struct bfa_defs_fcpim_throttle_s { | ||
885 | u16 max_value; | ||
886 | u16 cur_value; | ||
887 | u16 cfg_value; | ||
888 | u16 rsvd; | ||
889 | }; | ||
890 | |||
878 | /* | 891 | /* |
879 | * Physical port configuration | 892 | * Physical port configuration |
880 | */ | 893 | */ |
diff --git a/drivers/scsi/bfa/bfa_fcpim.c b/drivers/scsi/bfa/bfa_fcpim.c index 4118d84be6eb..27b560962357 100644 --- a/drivers/scsi/bfa/bfa_fcpim.c +++ b/drivers/scsi/bfa/bfa_fcpim.c | |||
@@ -3703,6 +3703,7 @@ bfa_fcp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
3703 | struct bfa_mem_dma_s *seg_ptr; | 3703 | struct bfa_mem_dma_s *seg_ptr; |
3704 | u16 idx, nsegs, num_io_req; | 3704 | u16 idx, nsegs, num_io_req; |
3705 | 3705 | ||
3706 | fcp->max_ioim_reqs = cfg->fwcfg.num_ioim_reqs; | ||
3706 | fcp->num_ioim_reqs = cfg->fwcfg.num_ioim_reqs; | 3707 | fcp->num_ioim_reqs = cfg->fwcfg.num_ioim_reqs; |
3707 | fcp->num_fwtio_reqs = cfg->fwcfg.num_fwtio_reqs; | 3708 | fcp->num_fwtio_reqs = cfg->fwcfg.num_fwtio_reqs; |
3708 | fcp->num_itns = cfg->fwcfg.num_rports; | 3709 | fcp->num_itns = cfg->fwcfg.num_rports; |
@@ -3725,6 +3726,7 @@ bfa_fcp_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg, | |||
3725 | bfa_iocfc_set_snsbase(bfa, idx, fcp->snsbase[idx].pa); | 3726 | bfa_iocfc_set_snsbase(bfa, idx, fcp->snsbase[idx].pa); |
3726 | } | 3727 | } |
3727 | 3728 | ||
3729 | fcp->throttle_update_required = 1; | ||
3728 | bfa_fcpim_attach(fcp, bfad, cfg, pcidev); | 3730 | bfa_fcpim_attach(fcp, bfad, cfg, pcidev); |
3729 | 3731 | ||
3730 | bfa_iotag_attach(fcp); | 3732 | bfa_iotag_attach(fcp); |
@@ -3763,23 +3765,33 @@ bfa_fcp_iocdisable(struct bfa_s *bfa) | |||
3763 | { | 3765 | { |
3764 | struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa); | 3766 | struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa); |
3765 | 3767 | ||
3766 | /* Enqueue unused ioim resources to free_q */ | ||
3767 | list_splice_tail_init(&fcp->iotag_unused_q, &fcp->iotag_ioim_free_q); | ||
3768 | |||
3769 | bfa_fcpim_iocdisable(fcp); | 3768 | bfa_fcpim_iocdisable(fcp); |
3770 | } | 3769 | } |
3771 | 3770 | ||
3772 | void | 3771 | void |
3773 | bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw) | 3772 | bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_ioim_fw) |
3774 | { | 3773 | { |
3775 | struct bfa_fcp_mod_s *mod = BFA_FCP_MOD(bfa); | 3774 | struct bfa_fcp_mod_s *mod = BFA_FCP_MOD(bfa); |
3776 | struct list_head *qe; | 3775 | struct list_head *qe; |
3777 | int i; | 3776 | int i; |
3778 | 3777 | ||
3778 | /* Update io throttle value only once during driver load time */ | ||
3779 | if (!mod->throttle_update_required) | ||
3780 | return; | ||
3781 | |||
3779 | for (i = 0; i < (mod->num_ioim_reqs - num_ioim_fw); i++) { | 3782 | for (i = 0; i < (mod->num_ioim_reqs - num_ioim_fw); i++) { |
3780 | bfa_q_deq_tail(&mod->iotag_ioim_free_q, &qe); | 3783 | bfa_q_deq_tail(&mod->iotag_ioim_free_q, &qe); |
3781 | list_add_tail(qe, &mod->iotag_unused_q); | 3784 | list_add_tail(qe, &mod->iotag_unused_q); |
3782 | } | 3785 | } |
3786 | |||
3787 | if (mod->num_ioim_reqs != num_ioim_fw) { | ||
3788 | bfa_trc(bfa, mod->num_ioim_reqs); | ||
3789 | bfa_trc(bfa, num_ioim_fw); | ||
3790 | } | ||
3791 | |||
3792 | mod->max_ioim_reqs = max_ioim_fw; | ||
3793 | mod->num_ioim_reqs = num_ioim_fw; | ||
3794 | mod->throttle_update_required = 0; | ||
3783 | } | 3795 | } |
3784 | 3796 | ||
3785 | void | 3797 | void |
@@ -3837,3 +3849,88 @@ bfa_iotag_attach(struct bfa_fcp_mod_s *fcp) | |||
3837 | 3849 | ||
3838 | bfa_mem_kva_curp(fcp) = (u8 *) iotag; | 3850 | bfa_mem_kva_curp(fcp) = (u8 *) iotag; |
3839 | } | 3851 | } |
3852 | |||
3853 | |||
3854 | /** | ||
3855 | * To send config req, first try to use throttle value from flash | ||
3856 | * If 0, then use driver parameter | ||
3857 | * We need to use min(flash_val, drv_val) because | ||
3858 | * memory allocation was done based on this cfg'd value | ||
3859 | */ | ||
3860 | u16 | ||
3861 | bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param) | ||
3862 | { | ||
3863 | u16 tmp; | ||
3864 | struct bfa_fcp_mod_s *fcp = BFA_FCP_MOD(bfa); | ||
3865 | |||
3866 | /* | ||
3867 | * If throttle value from flash is already in effect after driver is | ||
3868 | * loaded then until next load, always return current value instead | ||
3869 | * of actual flash value | ||
3870 | */ | ||
3871 | if (!fcp->throttle_update_required) | ||
3872 | return (u16)fcp->num_ioim_reqs; | ||
3873 | |||
3874 | tmp = bfa_dconf_read_data_valid(bfa) ? bfa_fcpim_read_throttle(bfa) : 0; | ||
3875 | if (!tmp || (tmp > drv_cfg_param)) | ||
3876 | tmp = drv_cfg_param; | ||
3877 | |||
3878 | return tmp; | ||
3879 | } | ||
3880 | |||
3881 | bfa_status_t | ||
3882 | bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value) | ||
3883 | { | ||
3884 | if (!bfa_dconf_get_min_cfg(bfa)) { | ||
3885 | BFA_DCONF_MOD(bfa)->dconf->throttle_cfg.value = value; | ||
3886 | BFA_DCONF_MOD(bfa)->dconf->throttle_cfg.is_valid = 1; | ||
3887 | return BFA_STATUS_OK; | ||
3888 | } | ||
3889 | |||
3890 | return BFA_STATUS_FAILED; | ||
3891 | } | ||
3892 | |||
3893 | u16 | ||
3894 | bfa_fcpim_read_throttle(struct bfa_s *bfa) | ||
3895 | { | ||
3896 | struct bfa_throttle_cfg_s *throttle_cfg = | ||
3897 | &(BFA_DCONF_MOD(bfa)->dconf->throttle_cfg); | ||
3898 | |||
3899 | return ((!bfa_dconf_get_min_cfg(bfa)) ? | ||
3900 | ((throttle_cfg->is_valid == 1) ? (throttle_cfg->value) : 0) : 0); | ||
3901 | } | ||
3902 | |||
3903 | bfa_status_t | ||
3904 | bfa_fcpim_throttle_set(struct bfa_s *bfa, u16 value) | ||
3905 | { | ||
3906 | /* in min cfg no commands should run. */ | ||
3907 | if ((bfa_dconf_get_min_cfg(bfa) == BFA_TRUE) || | ||
3908 | (!bfa_dconf_read_data_valid(bfa))) | ||
3909 | return BFA_STATUS_FAILED; | ||
3910 | |||
3911 | bfa_fcpim_write_throttle(bfa, value); | ||
3912 | |||
3913 | return bfa_dconf_update(bfa); | ||
3914 | } | ||
3915 | |||
3916 | bfa_status_t | ||
3917 | bfa_fcpim_throttle_get(struct bfa_s *bfa, void *buf) | ||
3918 | { | ||
3919 | struct bfa_fcpim_s *fcpim = BFA_FCPIM(bfa); | ||
3920 | struct bfa_defs_fcpim_throttle_s throttle; | ||
3921 | |||
3922 | if ((bfa_dconf_get_min_cfg(bfa) == BFA_TRUE) || | ||
3923 | (!bfa_dconf_read_data_valid(bfa))) | ||
3924 | return BFA_STATUS_FAILED; | ||
3925 | |||
3926 | memset(&throttle, 0, sizeof(struct bfa_defs_fcpim_throttle_s)); | ||
3927 | |||
3928 | throttle.cur_value = (u16)(fcpim->fcp->num_ioim_reqs); | ||
3929 | throttle.cfg_value = bfa_fcpim_read_throttle(bfa); | ||
3930 | if (!throttle.cfg_value) | ||
3931 | throttle.cfg_value = throttle.cur_value; | ||
3932 | throttle.max_value = (u16)(fcpim->fcp->max_ioim_reqs); | ||
3933 | memcpy(buf, &throttle, sizeof(struct bfa_defs_fcpim_throttle_s)); | ||
3934 | |||
3935 | return BFA_STATUS_OK; | ||
3936 | } | ||
diff --git a/drivers/scsi/bfa/bfa_fcpim.h b/drivers/scsi/bfa/bfa_fcpim.h index b81d51cfe2bb..e693af6e5930 100644 --- a/drivers/scsi/bfa/bfa_fcpim.h +++ b/drivers/scsi/bfa/bfa_fcpim.h | |||
@@ -42,7 +42,7 @@ void 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)); |
43 | void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m); | 43 | void bfa_itn_isr(struct bfa_s *bfa, struct bfi_msg_s *m); |
44 | void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp); | 44 | void bfa_iotag_attach(struct bfa_fcp_mod_s *fcp); |
45 | void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw); | 45 | void bfa_fcp_res_recfg(struct bfa_s *bfa, u16 num_ioim_fw, u16 max_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_MEM_FCP_KVA(__bfa) (&(BFA_FCP_MOD(__bfa)->kva_seg)) |
@@ -150,6 +150,7 @@ struct bfa_fcp_mod_s { | |||
150 | struct list_head iotag_unused_q; /* unused IO resources*/ | 150 | struct list_head iotag_unused_q; /* unused IO resources*/ |
151 | struct bfa_iotag_s *iotag_arr; | 151 | struct bfa_iotag_s *iotag_arr; |
152 | struct bfa_itn_s *itn_arr; | 152 | struct bfa_itn_s *itn_arr; |
153 | int max_ioim_reqs; | ||
153 | int num_ioim_reqs; | 154 | int num_ioim_reqs; |
154 | int num_fwtio_reqs; | 155 | int num_fwtio_reqs; |
155 | int num_itns; | 156 | int num_itns; |
@@ -157,6 +158,7 @@ struct bfa_fcp_mod_s { | |||
157 | struct bfa_fcpim_s fcpim; | 158 | struct bfa_fcpim_s fcpim; |
158 | struct bfa_mem_dma_s dma_seg[BFA_FCP_DMA_SEGS]; | 159 | struct bfa_mem_dma_s dma_seg[BFA_FCP_DMA_SEGS]; |
159 | struct bfa_mem_kva_s kva_seg; | 160 | struct bfa_mem_kva_s kva_seg; |
161 | int throttle_update_required; | ||
160 | }; | 162 | }; |
161 | 163 | ||
162 | /* | 164 | /* |
@@ -418,5 +420,10 @@ bfa_status_t bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, | |||
418 | bfa_status_t bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id, | 420 | bfa_status_t bfa_fcpim_lunmask_add(struct bfa_s *bfa, u16 vf_id, |
419 | wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun); | 421 | wwn_t *pwwn, wwn_t rpwwn, struct scsi_lun lun); |
420 | bfa_status_t bfa_fcpim_lunmask_clear(struct bfa_s *bfa); | 422 | bfa_status_t bfa_fcpim_lunmask_clear(struct bfa_s *bfa); |
423 | u16 bfa_fcpim_read_throttle(struct bfa_s *bfa); | ||
424 | bfa_status_t bfa_fcpim_write_throttle(struct bfa_s *bfa, u16 value); | ||
425 | bfa_status_t bfa_fcpim_throttle_set(struct bfa_s *bfa, u16 value); | ||
426 | bfa_status_t bfa_fcpim_throttle_get(struct bfa_s *bfa, void *buf); | ||
427 | u16 bfa_fcpim_get_throttle_cfg(struct bfa_s *bfa, u16 drv_cfg_param); | ||
421 | 428 | ||
422 | #endif /* __BFA_FCPIM_H__ */ | 429 | #endif /* __BFA_FCPIM_H__ */ |
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c index e90800d0557a..58ac643ba9f3 100644 --- a/drivers/scsi/bfa/bfa_fcs_rport.c +++ b/drivers/scsi/bfa/bfa_fcs_rport.c | |||
@@ -3026,6 +3026,9 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport, | |||
3026 | struct bfa_rport_qos_attr_s qos_attr; | 3026 | struct bfa_rport_qos_attr_s qos_attr; |
3027 | struct bfa_fcs_lport_s *port = rport->port; | 3027 | struct bfa_fcs_lport_s *port = rport->port; |
3028 | bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed; | 3028 | bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed; |
3029 | struct bfa_port_attr_s port_attr; | ||
3030 | |||
3031 | bfa_fcport_get_attr(rport->fcs->bfa, &port_attr); | ||
3029 | 3032 | ||
3030 | memset(rport_attr, 0, sizeof(struct bfa_rport_attr_s)); | 3033 | memset(rport_attr, 0, sizeof(struct bfa_rport_attr_s)); |
3031 | memset(&qos_attr, 0, sizeof(struct bfa_rport_qos_attr_s)); | 3034 | memset(&qos_attr, 0, sizeof(struct bfa_rport_qos_attr_s)); |
@@ -3056,7 +3059,8 @@ bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport, | |||
3056 | rport_speed = | 3059 | rport_speed = |
3057 | bfa_fcport_get_ratelim_speed(rport->fcs->bfa); | 3060 | bfa_fcport_get_ratelim_speed(rport->fcs->bfa); |
3058 | 3061 | ||
3059 | if (rport_speed < bfa_fcs_lport_get_rport_max_speed(port)) | 3062 | if ((bfa_fcs_lport_get_rport_max_speed(port) != |
3063 | BFA_PORT_SPEED_UNKNOWN) && (rport_speed < port_attr.speed)) | ||
3060 | rport_attr->trl_enforced = BFA_TRUE; | 3064 | rport_attr->trl_enforced = BFA_TRUE; |
3061 | } | 3065 | } |
3062 | } | 3066 | } |
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h index f16ebc92d1ef..8e267246c1a5 100644 --- a/drivers/scsi/bfa/bfa_ioc.h +++ b/drivers/scsi/bfa/bfa_ioc.h | |||
@@ -716,6 +716,7 @@ struct bfa_dconf_hdr_s { | |||
716 | struct bfa_dconf_s { | 716 | struct bfa_dconf_s { |
717 | struct bfa_dconf_hdr_s hdr; | 717 | struct bfa_dconf_hdr_s hdr; |
718 | struct bfa_lunmask_cfg_s lun_mask; | 718 | struct bfa_lunmask_cfg_s lun_mask; |
719 | struct bfa_throttle_cfg_s throttle_cfg; | ||
719 | }; | 720 | }; |
720 | #pragma pack() | 721 | #pragma pack() |
721 | 722 | ||
@@ -738,6 +739,8 @@ struct bfa_dconf_mod_s { | |||
738 | #define bfa_dconf_read_data_valid(__bfa) \ | 739 | #define bfa_dconf_read_data_valid(__bfa) \ |
739 | (BFA_DCONF_MOD(__bfa)->read_data_valid) | 740 | (BFA_DCONF_MOD(__bfa)->read_data_valid) |
740 | #define BFA_DCONF_UPDATE_TOV 5000 /* memtest timeout in msec */ | 741 | #define BFA_DCONF_UPDATE_TOV 5000 /* memtest timeout in msec */ |
742 | #define bfa_dconf_get_min_cfg(__bfa) \ | ||
743 | (BFA_DCONF_MOD(__bfa)->min_cfg) | ||
741 | 744 | ||
742 | void bfa_dconf_modinit(struct bfa_s *bfa); | 745 | void bfa_dconf_modinit(struct bfa_s *bfa); |
743 | void bfa_dconf_modexit(struct bfa_s *bfa); | 746 | void bfa_dconf_modexit(struct bfa_s *bfa); |
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 90c40e4e2d4b..6e1478ae6251 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -2547,6 +2547,36 @@ bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) | |||
2547 | return 0; | 2547 | return 0; |
2548 | } | 2548 | } |
2549 | 2549 | ||
2550 | int | ||
2551 | bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd) | ||
2552 | { | ||
2553 | struct bfa_bsg_fcpim_throttle_s *iocmd = | ||
2554 | (struct bfa_bsg_fcpim_throttle_s *)cmd; | ||
2555 | unsigned long flags; | ||
2556 | |||
2557 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2558 | iocmd->status = bfa_fcpim_throttle_get(&bfad->bfa, | ||
2559 | (void *)&iocmd->throttle); | ||
2560 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2561 | |||
2562 | return 0; | ||
2563 | } | ||
2564 | |||
2565 | int | ||
2566 | bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd) | ||
2567 | { | ||
2568 | struct bfa_bsg_fcpim_throttle_s *iocmd = | ||
2569 | (struct bfa_bsg_fcpim_throttle_s *)cmd; | ||
2570 | unsigned long flags; | ||
2571 | |||
2572 | spin_lock_irqsave(&bfad->bfad_lock, flags); | ||
2573 | iocmd->status = bfa_fcpim_throttle_set(&bfad->bfa, | ||
2574 | iocmd->throttle.cfg_value); | ||
2575 | spin_unlock_irqrestore(&bfad->bfad_lock, flags); | ||
2576 | |||
2577 | return 0; | ||
2578 | } | ||
2579 | |||
2550 | static int | 2580 | static int |
2551 | bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | 2581 | bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, |
2552 | unsigned int payload_len) | 2582 | unsigned int payload_len) |
@@ -2881,6 +2911,12 @@ bfad_iocmd_handler(struct bfad_s *bfad, unsigned int cmd, void *iocmd, | |||
2881 | case IOCMD_FCPIM_LUNMASK_DELETE: | 2911 | case IOCMD_FCPIM_LUNMASK_DELETE: |
2882 | rc = bfad_iocmd_fcpim_cfg_lunmask(bfad, iocmd, cmd); | 2912 | rc = bfad_iocmd_fcpim_cfg_lunmask(bfad, iocmd, cmd); |
2883 | break; | 2913 | break; |
2914 | case IOCMD_FCPIM_THROTTLE_QUERY: | ||
2915 | rc = bfad_iocmd_fcpim_throttle_query(bfad, iocmd); | ||
2916 | break; | ||
2917 | case IOCMD_FCPIM_THROTTLE_SET: | ||
2918 | rc = bfad_iocmd_fcpim_throttle_set(bfad, iocmd); | ||
2919 | break; | ||
2884 | default: | 2920 | default: |
2885 | rc = -EINVAL; | 2921 | rc = -EINVAL; |
2886 | break; | 2922 | break; |
diff --git a/drivers/scsi/bfa/bfad_bsg.h b/drivers/scsi/bfa/bfad_bsg.h index b67a2292cff3..37922b96079b 100644 --- a/drivers/scsi/bfa/bfad_bsg.h +++ b/drivers/scsi/bfa/bfad_bsg.h | |||
@@ -145,6 +145,8 @@ enum { | |||
145 | IOCMD_DIAG_DPORT_DISABLE, | 145 | IOCMD_DIAG_DPORT_DISABLE, |
146 | IOCMD_DIAG_DPORT_GET_STATE, | 146 | IOCMD_DIAG_DPORT_GET_STATE, |
147 | IOCMD_QOS_SET_BW, | 147 | IOCMD_QOS_SET_BW, |
148 | IOCMD_FCPIM_THROTTLE_QUERY, | ||
149 | IOCMD_FCPIM_THROTTLE_SET | ||
148 | }; | 150 | }; |
149 | 151 | ||
150 | struct bfa_bsg_gen_s { | 152 | struct bfa_bsg_gen_s { |
@@ -740,6 +742,13 @@ struct bfa_bsg_fcpim_lunmask_s { | |||
740 | struct scsi_lun lun; | 742 | struct scsi_lun lun; |
741 | }; | 743 | }; |
742 | 744 | ||
745 | struct bfa_bsg_fcpim_throttle_s { | ||
746 | bfa_status_t status; | ||
747 | u16 bfad_num; | ||
748 | u16 vf_id; | ||
749 | struct bfa_defs_fcpim_throttle_s throttle; | ||
750 | }; | ||
751 | |||
743 | struct bfa_bsg_fcpt_s { | 752 | struct bfa_bsg_fcpt_s { |
744 | bfa_status_t status; | 753 | bfa_status_t status; |
745 | u16 vf_id; | 754 | u16 vf_id; |