Re: [PATCH v3 1/4] util: fixing wrong assumption that PF has to have netdev assigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/22/19 8:26 PM, dann frazier wrote:
> From: Radoslaw Biernacki <radoslaw.biernacki@xxxxxxxxxx>
> 
> libvirt wrongly assumes that VF netdev has to have the
> netdev assigned to PF. There is no such requirement in SRIOV standard.
> This patch change the virNetDevSwitchdevFeature() function to deal
> with SRIOV devices which does not have netdev on PF. Also corrects
> one comment about PF netdev assumption.
> 
> One example of such devices is ThunderX VNIC.
> By applying this change, VF device is used for virNetlinkCommand() as
> it is the only netdev assigned to VNIC.
> 
> Signed-off-by: Radoslaw Biernacki <radoslaw.biernacki@xxxxxxxxxx>
> [ dannf: Reinstated error path in virNetDevGetPhysicalFunction() as
>   suggested by Michal Privoznik ]
> Signed-off-by: dann frazier <dann.frazier@xxxxxxxxxxxxx>
> ---
>  src/util/virnetdev.c | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
> 
> diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
> index 2111b3ada9..82823c0dfc 100644
> --- a/src/util/virnetdev.c
> +++ b/src/util/virnetdev.c
> @@ -1355,9 +1355,8 @@ virNetDevGetPhysicalFunction(const char *ifname, char **pfname)
>      }
>  
>      if (!*pfname) {
> -        /* this shouldn't be possible. A VF can't exist unless its
> -         * PF device is bound to a network driver
> -         */
> +        /* The SRIOV standard does not require VF netdevs to have the
> +           netdev assigned to a PF */
>          virReportError(VIR_ERR_INTERNAL_ERROR,
>                         _("The PF device for VF %s has no network device name"),
>                         ifname);
> @@ -1449,8 +1448,12 @@ virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname,
>  
>      *pfname = NULL;
>  
> -    if (virNetDevGetPhysicalFunction(vfname, pfname) < 0)
> +    if (virNetDevGetPhysicalFunction(vfname, pfname) < 0) {
> +        virReportError(VIR_ERR_INTERNAL_ERROR,
> +                       _("Cannot get PF netdev name for VF %s"),
> +                       vfname);
>          return ret;

This is not needed. It overwrites (probably more accurate) error
reported by virNetDevGetPhysicalFunction().


ACK with that removed.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux