Re: [edk2-devel] [PATCH] MdeModulePkg: Handle InitialVFs=0 case for SR-IOV

2022-09-29 Thread Ni, Ray
MdeModulePkg: Handle InitialVFs=0 case for > SR-IOV > > From: Foster Nong > > Per SR-IOV spec,InitialVFs minimum is 0. Below code which use to calculate > SR-IOV bus number, > if InitialVFs =0, it maybe calculate the wrong bus number. > > LastVF = PFRid + FirstVFOffset

[edk2-devel] [PATCH] MdeModulePkg: Handle InitialVFs=0 case for SR-IOV

2022-09-29 Thread Bob Feng
From: Foster Nong Per SR-IOV spec,InitialVFs minimum is 0. Below code which use to calculate SR-IOV bus number, if InitialVFs =0, it maybe calculate the wrong bus number. LastVF = PFRid + FirstVFOffset + (PciIoDevice->InitialVFs - 1) * VFStride we can fix it with below code: if (PciIoDevice->I