HV: rename vbdf in struct pci_vdev to bdf
Rename vbdf to bdf for the following reasons: Use the same coding style as struct pci_pdev, as pci_pdev uses bdf instead of pbdf pci_vdev implies the its bdf is virtual, no need to prefix bdf with the v prefix (redundant) Tracked-On: #3241 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
148e747349
commit
012ec75163
|
@ -83,7 +83,7 @@ struct pci_vdev *pci_find_vdev_by_vbdf(const struct acrn_vpci *vpci, union pci_b
|
|||
for (i = 0U; i < vpci->pci_vdev_cnt; i++) {
|
||||
tmp = (struct pci_vdev *)&(vpci->pci_vdevs[i]);
|
||||
|
||||
if (bdf_is_equal(&(tmp->vbdf), &vbdf)) {
|
||||
if (bdf_is_equal(&(tmp->bdf), &vbdf)) {
|
||||
vdev = tmp;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ static int32_t vmsi_remap(const struct pci_vdev *vdev, bool enable)
|
|||
info.vmsi_data.full = 0U;
|
||||
}
|
||||
|
||||
ret = ptirq_msix_remap(vm, vdev->vbdf.value, pbdf.value, 0U, &info);
|
||||
ret = ptirq_msix_remap(vm, vdev->bdf.value, pbdf.value, 0U, &info);
|
||||
if (ret == 0) {
|
||||
/* Update MSI Capability structure to physical device */
|
||||
pci_pdev_write_cfg(pbdf, capoff + PCIR_MSI_ADDR, 0x4U, (uint32_t)info.pmsi_addr.full);
|
||||
|
@ -185,7 +185,7 @@ int32_t vmsi_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, u
|
|||
void deinit_vmsi(const struct pci_vdev *vdev)
|
||||
{
|
||||
if (has_msi_cap(vdev)) {
|
||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->vbdf.value, 1U);
|
||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->bdf.value, 1U);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ static int32_t vmsix_remap_entry(const struct pci_vdev *vdev, uint32_t index, bo
|
|||
info.vmsi_addr.full = vdev->msix.table_entries[index].addr;
|
||||
info.vmsi_data.full = (enable) ? vdev->msix.table_entries[index].data : 0U;
|
||||
|
||||
ret = ptirq_msix_remap(vdev->vpci->vm, vdev->vbdf.value, vdev->pdev->bdf.value, (uint16_t)index, &info);
|
||||
ret = ptirq_msix_remap(vdev->vpci->vm, vdev->bdf.value, vdev->pdev->bdf.value, (uint16_t)index, &info);
|
||||
if (ret == 0) {
|
||||
/* Write the table entry to the physical structure */
|
||||
hva = hpa2hva(vdev->msix.mmio_hpa + vdev->msix.table_offset);
|
||||
|
@ -383,7 +383,7 @@ void deinit_vmsix(const struct pci_vdev *vdev)
|
|||
{
|
||||
if (has_msix_cap(vdev)) {
|
||||
if (vdev->msix.table_count != 0U) {
|
||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->vbdf.value, vdev->msix.table_count);
|
||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->bdf.value, vdev->msix.table_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -419,10 +419,10 @@ static void init_vdev_for_pdev(struct pci_pdev *pdev, const struct acrn_vm *vm)
|
|||
|
||||
if (ptdev_config != NULL) {
|
||||
/* vbdf is defined in vm_config */
|
||||
vdev->vbdf.value = ptdev_config->vbdf.value;
|
||||
vdev->bdf.value = ptdev_config->vbdf.value;
|
||||
} else {
|
||||
/* vbdf is not defined in vm_config, set it to equal to pbdf */
|
||||
vdev->vbdf.value = pdev->bdf.value;
|
||||
vdev->bdf.value = pdev->bdf.value;
|
||||
}
|
||||
|
||||
init_vhostbridge(vdev);
|
||||
|
@ -523,7 +523,7 @@ static void deinit_postlaunched_vm_vpci(const struct acrn_vm *vm)
|
|||
vdev->vpci = (struct acrn_vpci *) &sos_vm->vpci;
|
||||
|
||||
/* vbdf equals to pbdf in sos */
|
||||
vdev->vbdf.value = vdev->pdev->bdf.value;
|
||||
vdev->bdf.value = vdev->pdev->bdf.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void vpci_set_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf, ui
|
|||
} else {
|
||||
/* UOS may do BDF mapping */
|
||||
vdev->vpci = (struct acrn_vpci *)&(target_vm->vpci);
|
||||
vdev->vbdf.value = vbdf;
|
||||
vdev->bdf.value = vbdf;
|
||||
vdev->pdev->bdf.value = pbdf;
|
||||
}
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ void vpci_reset_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf,
|
|||
vdev->vpci = &vm->vpci;
|
||||
|
||||
/* vbdf equals to pbdf in sos */
|
||||
vdev->vbdf.value = vdev->pdev->bdf.value;
|
||||
vdev->bdf.value = vdev->pdev->bdf.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ static inline bool has_msix_cap(const struct pci_vdev *vdev)
|
|||
*/
|
||||
static inline bool is_hostbridge(const struct pci_vdev *vdev)
|
||||
{
|
||||
return (vdev->vbdf.value == 0U);
|
||||
return (vdev->bdf.value == 0U);
|
||||
}
|
||||
|
||||
void init_vhostbridge(struct pci_vdev *vdev);
|
||||
|
|
|
@ -67,7 +67,7 @@ union pci_cfgdata {
|
|||
struct pci_vdev {
|
||||
const struct acrn_vpci *vpci;
|
||||
/* The bus/device/function triple of the virtual PCI device. */
|
||||
union pci_bdf vbdf;
|
||||
union pci_bdf bdf;
|
||||
|
||||
struct pci_pdev *pdev;
|
||||
|
||||
|
|
Loading…
Reference in New Issue