<div dir="ltr">Hi Michal,<div><br></div><div>Get it, Thank you!<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 7, 2022 at 7:36 PM Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/3/22 03:55, Yalan Zhang wrote:<br>
> Hi there,<br>
> <br>
> I have an Intel X520 network card, and I find the max supported VFs are<br>
> different.<br>
> Please check below outputs:<br>
> <br>
> # lspci -vvv -s 04:00.0<br>
> 04:00.0 Ethernet controller: Intel Corporation Ethernet 10G 2P X520<br>
> Adapter (rev 01)<br>
> ...<br>
>  Capabilities: [160 v1] Single Root I/O Virtualization (SR-IOV)<br>
> IOVCap: Migration-, Interrupt Message Number: 000<br>
> IOVCtl: Enable- Migration- Interrupt- MSE- ARIHierarchy+<br>
> IOVSta: Migration-<br>
> ** Initial VFs: 64, Total VFs: 64**, Number of VFs: 0, Function<br>
> Dependency Link: 00<br>
> VF offset: 128, stride: 2, Device ID: 10ed<br>
> Supported Page Size: 00000553, System Page Size: 00000001<br>
> Region 0: Memory at 0000000094400000 (64-bit, prefetchable)<br>
> Region 3: Memory at 0000000094500000 (64-bit, prefetchable)<br>
> VF Migration: offset: 00000000, BIR: 0<br>
> Kernel driver in use: ixgbe<br>
> Kernel modules: ixgbe<br>
> <br>
> # cat /sys/class/net/enp4s0f0/device/sriov_totalvfs<br>
> 63<br>
> <br>
> # echo 64 > /sys/class/net/enp4s0f0/device/sriov_numvfs<br>
> -bash: echo: write error: Numerical result out of range<br>
> # echo 63 > /sys/class/net/enp4s0f0/device/sriov_numvfs<br>
> # cat /sys/class/net/enp4s0f0/device/sriov_numvfs<br>
> 63<br>
> <br>
> The lspci command says the Total VFs supported is 64, while in the file<br>
> "sriov_totalvfs"  says it's 63.<br>
> And the sriov_numvfs file will take precedence.<br>
> Why are the numbers different?  Just a little curious.<br>
<br>
I believe this comes from the driver implementation:<br>
<br>
/*  ixgbe driver limit the max number of VFs could be enabled to<br>
 *  63 (IXGBE_MAX_VF_FUNCTIONS - 1)<br>
 */<br>
#define IXGBE_MAX_VFS_DRV_LIMIT  (IXGBE_MAX_VF_FUNCTIONS - 1)<br>
<br>
<a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h#n7" rel="noreferrer" target="_blank">https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h#n7</a><br>
<br>
Michal<br>
<br>
</blockquote></div>