/* *lpfc_vmid_hash_fn-createahashvalueoftheUUID *@vmid:uuidassociatedwiththeVE *@len:lengthoftheVMIDstring *Returnsthecalculatedhashvalue
*/ int lpfc_vmid_hash_fn(constchar *vmid, int len)
{ int c; int hash = 0;
if (len == 0) return0; while (len--) {
c = *vmid++; if (c >= 'A' && c <= 'Z')
c += 'a' - 'A';
/* check if QFPA is complete */ if (lpfc_vmid_is_type_priority_tag(vport) &&
!(vport->vmid_flag & LPFC_VMID_QFPA_CMPL) &&
(vport->vmid_flag & LPFC_VMID_ISSUE_QFPA)) {
vport->work_port_events |= WORKER_CHECK_VMID_ISSUE_QFPA; return -EAGAIN;
}
/* search if the UUID has already been mapped to the VMID */
len = strlen(uuid);
hash = lpfc_vmid_hash_fn(uuid, len);
/* search for the VMID in the table */
read_lock(&vport->vmid_lock);
vmp = lpfc_get_vmid_from_hashtable(vport, hash, uuid);
/* if found, check if its already registered */ if (vmp && vmp->flag & LPFC_VMID_REGISTERED) {
read_unlock(&vport->vmid_lock);
lpfc_vmid_update_entry(vport, iodir, vmp, tag);
rc = 0;
} elseif (vmp && (vmp->flag & LPFC_VMID_REQ_REGISTER ||
vmp->flag & LPFC_VMID_DE_REGISTER)) { /* else if register or dereg request has already been sent */ /* Hence VMID tag will not be added for this I/O */
read_unlock(&vport->vmid_lock);
rc = -EBUSY;
} else { /* The VMID was not found in the hashtable. At this point, */ /* drop the read lock first before proceeding further */
read_unlock(&vport->vmid_lock); /* start the process to obtain one as per the */ /* type of the VMID indicated */
write_lock(&vport->vmid_lock);
vmp = lpfc_get_vmid_from_hashtable(vport, hash, uuid);
/* while the read lock was released, in case the entry was */ /* added by other context or is in process of being added */ if (vmp && vmp->flag & LPFC_VMID_REGISTERED) {
lpfc_vmid_update_entry(vport, iodir, vmp, tag);
write_unlock(&vport->vmid_lock); return0;
} elseif (vmp && vmp->flag & LPFC_VMID_REQ_REGISTER) {
write_unlock(&vport->vmid_lock); return -EBUSY;
}
/* else search and allocate a free slot in the hash table */ if (vport->cur_vmid_cnt < vport->max_vmid) { for (i = 0; i < vport->max_vmid; i++) {
vmp = vport->vmid + i; if (vmp->flag == LPFC_VMID_SLOT_FREE) break;
} if (i == vport->max_vmid)
vmp = NULL;
} else {
vmp = NULL;
}
if (!vmp) {
write_unlock(&vport->vmid_lock); return -ENOMEM;
}
/* if type priority tag, get next available VMID */ if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO)
lpfc_vmid_assign_cs_ctl(vport, vmp);
/* allocate the per cpu variable for holding */ /* the last access time stamp only if VMID is enabled */ if (!vmp->last_io_time)
vmp->last_io_time = alloc_percpu_gfp(u64, GFP_ATOMIC); if (!vmp->last_io_time) {
hash_del(&vmp->hnode);
vmp->flag = LPFC_VMID_SLOT_FREE;
write_unlock(&vport->vmid_lock); return -EIO;
}
for (i = 0; i < vport->max_vmid; i++) {
vmp = &vport->vmid[i];
vmp->flag = LPFC_VMID_SLOT_FREE;
memset(vmp->host_vmid, 0, sizeof(vmp->host_vmid));
vmp->io_rd_cnt = 0;
vmp->io_wr_cnt = 0;
if (vmp->last_io_time)
for_each_possible_cpu(cpu)
*per_cpu_ptr(vmp->last_io_time, cpu) = 0;
}
/* for all elements in the hash table */ if (!hash_empty(vport->hash_table))
hash_for_each_safe(vport->hash_table, bucket, tmp, cur, hnode)
hash_del(&cur->hnode);
write_unlock(&vport->vmid_lock);
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.9Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.