• Home
  • Raw
  • Download

Lines Matching refs:vf

145 	struct qlcnic_vf_info *vf;  in qlcnic_sriov_init()  local
189 vf = &sriov->vf_info[i]; in qlcnic_sriov_init()
190 vf->adapter = adapter; in qlcnic_sriov_init()
191 vf->pci_func = qlcnic_sriov_virtid_fn(adapter, i); in qlcnic_sriov_init()
192 mutex_init(&vf->send_cmd_lock); in qlcnic_sriov_init()
193 spin_lock_init(&vf->vlan_list_lock); in qlcnic_sriov_init()
194 INIT_LIST_HEAD(&vf->rcv_act.wait_list); in qlcnic_sriov_init()
195 INIT_LIST_HEAD(&vf->rcv_pend.wait_list); in qlcnic_sriov_init()
196 spin_lock_init(&vf->rcv_act.lock); in qlcnic_sriov_init()
197 spin_lock_init(&vf->rcv_pend.lock); in qlcnic_sriov_init()
198 init_completion(&vf->ch_free_cmpl); in qlcnic_sriov_init()
200 INIT_WORK(&vf->trans_work, qlcnic_sriov_process_bc_cmd); in qlcnic_sriov_init()
262 struct qlcnic_vf_info *vf; in __qlcnic_sriov_cleanup() local
272 vf = &sriov->vf_info[i]; in __qlcnic_sriov_cleanup()
273 qlcnic_sriov_cleanup_list(&vf->rcv_pend); in __qlcnic_sriov_cleanup()
274 cancel_work_sync(&vf->trans_work); in __qlcnic_sriov_cleanup()
275 qlcnic_sriov_cleanup_list(&vf->rcv_act); in __qlcnic_sriov_cleanup()
820 static int qlcnic_sriov_clear_trans(struct qlcnic_vf_info *vf, in qlcnic_sriov_clear_trans() argument
828 t_list = &vf->rcv_act; in qlcnic_sriov_clear_trans()
837 while (test_and_set_bit(QLC_BC_VF_SEND, &vf->state)) in qlcnic_sriov_clear_trans()
839 vf->send_cmd = NULL; in qlcnic_sriov_clear_trans()
840 clear_bit(QLC_BC_VF_SEND, &vf->state); in qlcnic_sriov_clear_trans()
846 struct qlcnic_vf_info *vf, in qlcnic_sriov_schedule_bc_cmd() argument
849 if (test_bit(QLC_BC_VF_FLR, &vf->state) || in qlcnic_sriov_schedule_bc_cmd()
850 vf->adapter->need_fw_reset) in qlcnic_sriov_schedule_bc_cmd()
853 queue_work(sriov->bc.bc_trans_wq, &vf->trans_work); in qlcnic_sriov_schedule_bc_cmd()
889 struct qlcnic_vf_info *vf = trans->vf; in qlcnic_sriov_wait_for_channel_free() local
890 struct completion *cmpl = &vf->ch_free_cmpl; in qlcnic_sriov_wait_for_channel_free()
897 clear_bit(QLC_BC_VF_CHANNEL, &vf->state); in qlcnic_sriov_wait_for_channel_free()
918 static int __qlcnic_sriov_issue_bc_post(struct qlcnic_vf_info *vf) in __qlcnic_sriov_issue_bc_post() argument
924 if (!test_and_set_bit(QLC_BC_VF_CHANNEL, &vf->state)) { in __qlcnic_sriov_issue_bc_post()
936 struct qlcnic_vf_info *vf = trans->vf; in qlcnic_sriov_issue_bc_post() local
942 if (__qlcnic_sriov_issue_bc_post(vf)) in qlcnic_sriov_issue_bc_post()
961 ret = qlcnic_sriov_post_bc_msg(vf->adapter, hdr, pay, in qlcnic_sriov_issue_bc_post()
967 struct qlcnic_vf_info *vf, u8 type) in __qlcnic_sriov_send_bc_msg() argument
973 if (test_bit(QLC_BC_VF_FLR, &vf->state) || in __qlcnic_sriov_send_bc_msg()
974 vf->adapter->need_fw_reset) in __qlcnic_sriov_send_bc_msg()
996 clear_bit(QLC_BC_VF_CHANNEL, &vf->state); in __qlcnic_sriov_send_bc_msg()
1009 struct qlcnic_vf_info *vf; in qlcnic_sriov_send_bc_cmd() local
1015 vf = &adapter->ahw->sriov->vf_info[index]; in qlcnic_sriov_send_bc_cmd()
1016 trans->vf = vf; in qlcnic_sriov_send_bc_cmd()
1019 if (!test_bit(QLC_BC_VF_STATE, &vf->state)) { in qlcnic_sriov_send_bc_cmd()
1027 mutex_lock(&vf->send_cmd_lock); in qlcnic_sriov_send_bc_cmd()
1028 vf->send_cmd = trans; in qlcnic_sriov_send_bc_cmd()
1029 err = __qlcnic_sriov_send_bc_msg(trans, vf, QLC_BC_COMMAND); in qlcnic_sriov_send_bc_cmd()
1030 qlcnic_sriov_clear_trans(vf, trans, QLC_BC_COMMAND); in qlcnic_sriov_send_bc_cmd()
1031 mutex_unlock(&vf->send_cmd_lock); in qlcnic_sriov_send_bc_cmd()
1051 struct qlcnic_vf_info *vf = container_of(work, struct qlcnic_vf_info, in qlcnic_sriov_process_bc_cmd() local
1054 struct qlcnic_adapter *adapter = vf->adapter; in qlcnic_sriov_process_bc_cmd()
1061 if (test_bit(QLC_BC_VF_FLR, &vf->state)) in qlcnic_sriov_process_bc_cmd()
1065 trans = list_first_entry(&vf->rcv_act.wait_list, in qlcnic_sriov_process_bc_cmd()
1067 adapter = vf->adapter; in qlcnic_sriov_process_bc_cmd()
1075 __qlcnic_sriov_send_bc_msg(trans, vf, QLC_BC_RESPONSE); in qlcnic_sriov_process_bc_cmd()
1079 req = qlcnic_sriov_clear_trans(vf, trans, QLC_BC_RESPONSE); in qlcnic_sriov_process_bc_cmd()
1082 qlcnic_sriov_schedule_bc_cmd(adapter->ahw->sriov, vf, in qlcnic_sriov_process_bc_cmd()
1087 struct qlcnic_vf_info *vf) in qlcnic_sriov_handle_bc_resp() argument
1092 if (test_and_set_bit(QLC_BC_VF_SEND, &vf->state)) in qlcnic_sriov_handle_bc_resp()
1095 trans = vf->send_cmd; in qlcnic_sriov_handle_bc_resp()
1105 qlcnic_sriov_pull_bc_msg(vf->adapter, in qlcnic_sriov_handle_bc_resp()
1115 clear_bit(QLC_BC_VF_SEND, &vf->state); in qlcnic_sriov_handle_bc_resp()
1119 struct qlcnic_vf_info *vf, in __qlcnic_sriov_add_act_list() argument
1122 struct qlcnic_trans_list *t_list = &vf->rcv_act; in __qlcnic_sriov_add_act_list()
1127 qlcnic_sriov_schedule_bc_cmd(sriov, vf, in __qlcnic_sriov_add_act_list()
1133 struct qlcnic_vf_info *vf, in qlcnic_sriov_add_act_list() argument
1136 struct qlcnic_trans_list *t_list = &vf->rcv_act; in qlcnic_sriov_add_act_list()
1140 __qlcnic_sriov_add_act_list(sriov, vf, trans); in qlcnic_sriov_add_act_list()
1147 struct qlcnic_vf_info *vf, in qlcnic_sriov_handle_pending_trans() argument
1155 spin_lock(&vf->rcv_pend.lock); in qlcnic_sriov_handle_pending_trans()
1156 if (vf->rcv_pend.count > 0) { in qlcnic_sriov_handle_pending_trans()
1157 list_for_each(node, &vf->rcv_pend.wait_list) { in qlcnic_sriov_handle_pending_trans()
1170 qlcnic_sriov_pull_bc_msg(vf->adapter, in qlcnic_sriov_handle_pending_trans()
1176 vf->rcv_pend.count--; in qlcnic_sriov_handle_pending_trans()
1181 spin_unlock(&vf->rcv_pend.lock); in qlcnic_sriov_handle_pending_trans()
1184 if (qlcnic_sriov_add_act_list(sriov, vf, trans)) in qlcnic_sriov_handle_pending_trans()
1192 struct qlcnic_vf_info *vf) in qlcnic_sriov_handle_bc_cmd() argument
1195 struct qlcnic_adapter *adapter = vf->adapter; in qlcnic_sriov_handle_bc_cmd()
1204 if (!test_bit(QLC_BC_VF_STATE, &vf->state) && in qlcnic_sriov_handle_bc_cmd()
1210 qlcnic_sriov_handle_pending_trans(sriov, vf, hdr); in qlcnic_sriov_handle_bc_cmd()
1239 qlcnic_sriov_pull_bc_msg(vf->adapter, in qlcnic_sriov_handle_bc_cmd()
1243 trans->func_id = vf->pci_func; in qlcnic_sriov_handle_bc_cmd()
1244 trans->vf = vf; in qlcnic_sriov_handle_bc_cmd()
1248 if (qlcnic_sriov_soft_flr_check(adapter, trans, vf)) in qlcnic_sriov_handle_bc_cmd()
1252 if (qlcnic_sriov_add_act_list(sriov, vf, trans)) { in qlcnic_sriov_handle_bc_cmd()
1257 spin_lock(&vf->rcv_pend.lock); in qlcnic_sriov_handle_bc_cmd()
1258 list_add_tail(&trans->list, &vf->rcv_pend.wait_list); in qlcnic_sriov_handle_bc_cmd()
1259 vf->rcv_pend.count++; in qlcnic_sriov_handle_bc_cmd()
1260 spin_unlock(&vf->rcv_pend.lock); in qlcnic_sriov_handle_bc_cmd()
1265 struct qlcnic_vf_info *vf) in qlcnic_sriov_handle_msg_event() argument
1272 ptr[i - 2] = readl(QLCNIC_MBX_FW(vf->adapter->ahw, i)); in qlcnic_sriov_handle_msg_event()
1277 qlcnic_sriov_handle_bc_cmd(sriov, &hdr, vf); in qlcnic_sriov_handle_msg_event()
1280 qlcnic_sriov_handle_bc_resp(&hdr, vf); in qlcnic_sriov_handle_msg_event()
1286 struct qlcnic_vf_info *vf) in qlcnic_sriov_handle_flr_event() argument
1288 struct qlcnic_adapter *adapter = vf->adapter; in qlcnic_sriov_handle_flr_event()
1291 qlcnic_sriov_pf_handle_flr(sriov, vf); in qlcnic_sriov_handle_flr_event()
1299 struct qlcnic_vf_info *vf; in qlcnic_sriov_handle_bc_event() local
1311 vf = &sriov->vf_info[index]; in qlcnic_sriov_handle_bc_event()
1312 vf->pci_func = pci_func; in qlcnic_sriov_handle_bc_event()
1315 complete(&vf->ch_free_cmpl); in qlcnic_sriov_handle_bc_event()
1318 qlcnic_sriov_handle_flr_event(sriov, vf); in qlcnic_sriov_handle_bc_event()
1323 qlcnic_sriov_handle_msg_event(sriov, vf); in qlcnic_sriov_handle_bc_event()
1361 clear_bit(QLC_BC_VF_CHANNEL, &trans->vf->state); in qlcnic_sriov_retry_bc_cmd()
1469 struct qlcnic_vf_info *vf = &adapter->ahw->sriov->vf_info[0]; in qlcnic_sriov_channel_cfg_cmd() local
1488 set_bit(QLC_BC_VF_STATE, &vf->state); in qlcnic_sriov_channel_cfg_cmd()
1490 clear_bit(QLC_BC_VF_STATE, &vf->state); in qlcnic_sriov_channel_cfg_cmd()
1502 struct qlcnic_vf_info *vf; in qlcnic_vf_add_mc_list() local
1506 vf = &adapter->ahw->sriov->vf_info[0]; in qlcnic_vf_add_mc_list()
1508 if (!qlcnic_sriov_check_any_vlan(vf)) { in qlcnic_vf_add_mc_list()
1511 spin_lock(&vf->vlan_list_lock); in qlcnic_vf_add_mc_list()
1513 vlan_id = vf->sriov_vlans[i]; in qlcnic_vf_add_mc_list()
1518 spin_unlock(&vf->vlan_list_lock); in qlcnic_vf_add_mc_list()
1950 struct qlcnic_vf_info *vf, u16 vlan_id) in qlcnic_sriov_check_vlan_id() argument
1954 if (!vf->sriov_vlans) in qlcnic_sriov_check_vlan_id()
1957 spin_lock_bh(&vf->vlan_list_lock); in qlcnic_sriov_check_vlan_id()
1960 if (vf->sriov_vlans[i] == vlan_id) { in qlcnic_sriov_check_vlan_id()
1966 spin_unlock_bh(&vf->vlan_list_lock); in qlcnic_sriov_check_vlan_id()
1971 struct qlcnic_vf_info *vf) in qlcnic_sriov_validate_num_vlans() argument
1975 spin_lock_bh(&vf->vlan_list_lock); in qlcnic_sriov_validate_num_vlans()
1977 if (vf->num_vlan >= sriov->num_allowed_vlans) in qlcnic_sriov_validate_num_vlans()
1980 spin_unlock_bh(&vf->vlan_list_lock); in qlcnic_sriov_validate_num_vlans()
1988 struct qlcnic_vf_info *vf; in qlcnic_sriov_validate_vlan_cfg() local
1993 vf = &adapter->ahw->sriov->vf_info[0]; in qlcnic_sriov_validate_vlan_cfg()
1994 vlan_exist = qlcnic_sriov_check_any_vlan(vf); in qlcnic_sriov_validate_vlan_cfg()
2002 if (qlcnic_sriov_validate_num_vlans(sriov, vf)) in qlcnic_sriov_validate_vlan_cfg()
2015 if (!vlan_exist || qlcnic_sriov_check_vlan_id(sriov, vf, vid)) in qlcnic_sriov_validate_vlan_cfg()
2022 static void qlcnic_sriov_vlan_operation(struct qlcnic_vf_info *vf, u16 vlan_id, in qlcnic_sriov_vlan_operation() argument
2025 struct qlcnic_adapter *adapter = vf->adapter; in qlcnic_sriov_vlan_operation()
2030 if (!vf->sriov_vlans) in qlcnic_sriov_vlan_operation()
2033 spin_lock_bh(&vf->vlan_list_lock); in qlcnic_sriov_vlan_operation()
2037 qlcnic_sriov_add_vlan_id(sriov, vf, vlan_id); in qlcnic_sriov_vlan_operation()
2040 qlcnic_sriov_del_vlan_id(sriov, vf, vlan_id); in qlcnic_sriov_vlan_operation()
2046 spin_unlock_bh(&vf->vlan_list_lock); in qlcnic_sriov_vlan_operation()
2055 struct qlcnic_vf_info *vf; in qlcnic_sriov_cfg_vf_guest_vlan() local
2063 vf = &adapter->ahw->sriov->vf_info[0]; in qlcnic_sriov_cfg_vf_guest_vlan()
2086 qlcnic_sriov_vlan_operation(vf, vid, QLC_VLAN_ADD); in qlcnic_sriov_cfg_vf_guest_vlan()
2088 qlcnic_sriov_vlan_operation(vf, vid, QLC_VLAN_DELETE); in qlcnic_sriov_cfg_vf_guest_vlan()
2168 struct qlcnic_vf_info *vf; in qlcnic_sriov_alloc_vlans() local
2172 vf = &sriov->vf_info[i]; in qlcnic_sriov_alloc_vlans()
2173 vf->sriov_vlans = kcalloc(sriov->num_allowed_vlans, in qlcnic_sriov_alloc_vlans()
2174 sizeof(*vf->sriov_vlans), GFP_KERNEL); in qlcnic_sriov_alloc_vlans()
2181 struct qlcnic_vf_info *vf; in qlcnic_sriov_free_vlans() local
2185 vf = &sriov->vf_info[i]; in qlcnic_sriov_free_vlans()
2186 kfree(vf->sriov_vlans); in qlcnic_sriov_free_vlans()
2187 vf->sriov_vlans = NULL; in qlcnic_sriov_free_vlans()
2192 struct qlcnic_vf_info *vf, u16 vlan_id) in qlcnic_sriov_add_vlan_id() argument
2197 if (!vf->sriov_vlans[i]) { in qlcnic_sriov_add_vlan_id()
2198 vf->sriov_vlans[i] = vlan_id; in qlcnic_sriov_add_vlan_id()
2199 vf->num_vlan++; in qlcnic_sriov_add_vlan_id()
2206 struct qlcnic_vf_info *vf, u16 vlan_id) in qlcnic_sriov_del_vlan_id() argument
2211 if (vf->sriov_vlans[i] == vlan_id) { in qlcnic_sriov_del_vlan_id()
2212 vf->sriov_vlans[i] = 0; in qlcnic_sriov_del_vlan_id()
2213 vf->num_vlan--; in qlcnic_sriov_del_vlan_id()
2219 bool qlcnic_sriov_check_any_vlan(struct qlcnic_vf_info *vf) in qlcnic_sriov_check_any_vlan() argument
2223 spin_lock_bh(&vf->vlan_list_lock); in qlcnic_sriov_check_any_vlan()
2225 if (vf->num_vlan) in qlcnic_sriov_check_any_vlan()
2228 spin_unlock_bh(&vf->vlan_list_lock); in qlcnic_sriov_check_any_vlan()