Lines Matching refs:vport

47 struct lpfc_vmid *lpfc_get_vmid_from_hashtable(struct lpfc_vport *vport,  in lpfc_get_vmid_from_hashtable()  argument
52 hash_for_each_possible(vport->hash_table, vmp, hnode, hash) { in lpfc_get_vmid_from_hashtable()
69 lpfc_put_vmid_in_hashtable(struct lpfc_vport *vport, u32 hash, in lpfc_put_vmid_in_hashtable() argument
72 hash_add(vport->hash_table, &vmp->hnode, hash); in lpfc_put_vmid_in_hashtable()
107 static void lpfc_vmid_update_entry(struct lpfc_vport *vport, in lpfc_vmid_update_entry() argument
114 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) in lpfc_vmid_update_entry()
116 else if (vport->phba->cfg_vmid_app_header) in lpfc_vmid_update_entry()
129 static void lpfc_vmid_assign_cs_ctl(struct lpfc_vport *vport, in lpfc_vmid_assign_cs_ctl() argument
135 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_vmid_assign_cs_ctl()
136 vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport); in lpfc_vmid_assign_cs_ctl()
140 lpfc_get_vmid_from_hashtable(vport->phba->pport, hash, in lpfc_vmid_assign_cs_ctl()
145 vmid->un.cs_ctl_vmid = lpfc_vmid_get_cs_ctl(vport); in lpfc_vmid_assign_cs_ctl()
158 int lpfc_vmid_get_appid(struct lpfc_vport *vport, char *uuid, in lpfc_vmid_get_appid() argument
166 if (lpfc_vmid_is_type_priority_tag(vport) && in lpfc_vmid_get_appid()
167 !(vport->vmid_flag & LPFC_VMID_QFPA_CMPL) && in lpfc_vmid_get_appid()
168 (vport->vmid_flag & LPFC_VMID_ISSUE_QFPA)) { in lpfc_vmid_get_appid()
169 vport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA; in lpfc_vmid_get_appid()
178 read_lock(&vport->vmid_lock); in lpfc_vmid_get_appid()
179 vmp = lpfc_get_vmid_from_hashtable(vport, hash, uuid); in lpfc_vmid_get_appid()
183 read_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
184 lpfc_vmid_update_entry(vport, iodir, vmp, tag); in lpfc_vmid_get_appid()
190 read_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
195 read_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
198 write_lock(&vport->vmid_lock); in lpfc_vmid_get_appid()
199 vmp = lpfc_get_vmid_from_hashtable(vport, hash, uuid); in lpfc_vmid_get_appid()
204 lpfc_vmid_update_entry(vport, iodir, vmp, tag); in lpfc_vmid_get_appid()
205 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
208 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
213 if (vport->cur_vmid_cnt < vport->max_vmid) { in lpfc_vmid_get_appid()
214 for (i = 0; i < vport->max_vmid; i++) { in lpfc_vmid_get_appid()
215 vmp = vport->vmid + i; in lpfc_vmid_get_appid()
219 if (i == vport->max_vmid) in lpfc_vmid_get_appid()
226 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
231 lpfc_put_vmid_in_hashtable(vport, hash, vmp); in lpfc_vmid_get_appid()
239 vport->vmid_inactivity_timeout ? 1 : 0; in lpfc_vmid_get_appid()
242 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) in lpfc_vmid_get_appid()
243 lpfc_vmid_assign_cs_ctl(vport, vmp); in lpfc_vmid_get_appid()
252 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
256 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
259 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) in lpfc_vmid_get_appid()
260 rc = lpfc_vmid_uvem(vport, vmp, true); in lpfc_vmid_get_appid()
261 else if (vport->phba->cfg_vmid_app_header) in lpfc_vmid_get_appid()
262 rc = lpfc_vmid_cmd(vport, SLI_CTAS_RAPP_IDENT, vmp); in lpfc_vmid_get_appid()
264 write_lock(&vport->vmid_lock); in lpfc_vmid_get_appid()
265 vport->cur_vmid_cnt++; in lpfc_vmid_get_appid()
267 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
269 write_lock(&vport->vmid_lock); in lpfc_vmid_get_appid()
273 write_unlock(&vport->vmid_lock); in lpfc_vmid_get_appid()
278 if (!(vport->phba->pport->vmid_flag & LPFC_VMID_TIMER_ENBLD)) { in lpfc_vmid_get_appid()
279 mod_timer(&vport->phba->inactive_vmid_poll, in lpfc_vmid_get_appid()
282 vport->phba->pport->vmid_flag |= LPFC_VMID_TIMER_ENBLD; in lpfc_vmid_get_appid()
298 lpfc_reinit_vmid(struct lpfc_vport *vport) in lpfc_reinit_vmid() argument
305 write_lock(&vport->vmid_lock); in lpfc_reinit_vmid()
306 vport->cur_vmid_cnt = 0; in lpfc_reinit_vmid()
308 for (i = 0; i < vport->max_vmid; i++) { in lpfc_reinit_vmid()
309 vmp = &vport->vmid[i]; in lpfc_reinit_vmid()
321 if (!hash_empty(vport->hash_table)) in lpfc_reinit_vmid()
322 hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode) in lpfc_reinit_vmid()
324 write_unlock(&vport->vmid_lock); in lpfc_reinit_vmid()