From nobody Tue Feb 10 17:07:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 154185557073510.085116165071213; Sat, 10 Nov 2018 05:12:50 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B5AF58E3C; Sat, 10 Nov 2018 13:12:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBA0119753; Sat, 10 Nov 2018 13:12:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6951C4CAA0; Sat, 10 Nov 2018 13:12:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wAACueIU022798 for ; Sat, 10 Nov 2018 07:56:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 620506015E; Sat, 10 Nov 2018 12:56:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx13.extmail.prod.ext.phx2.redhat.com [10.5.110.42]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57FAC6013F for ; Sat, 10 Nov 2018 12:56:38 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 06EF83082125 for ; Sat, 10 Nov 2018 12:56:37 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id k19-v6so3833304lji.11 for ; Sat, 10 Nov 2018 04:56:36 -0800 (PST) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id h16-v6sm2145024lfc.0.2018.11.10.04.56.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Nov 2018 04:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e+mT0DZkcvqrBMyR+P9cV2e4Y0jqelEzRORpP/6dbio=; b=kc4Q15pYNTAO66yjdJvi7ZEuVqUJGuZGOGwi695Yc4lmeshREU2xmeS+xA71lUnaBE QNSIACwuSGN0S2zG5BQduc75GVsJIVG0Tmf8aX54PWK1yrKNUHZfxUM0nPjhI3oLrgGm Ff2qlNadJg4SStGg/Dg8PwJs5aTjDR0J6zoa8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e+mT0DZkcvqrBMyR+P9cV2e4Y0jqelEzRORpP/6dbio=; b=eiaGgmo15oETJbqVHH1Q25vwWW9h+IRhWL1LMxSSVEyrN40v6IyhWGs8cJizI9eRnK THfQvDkasPN4PtqhwDA3GngrovJ6m6SqVAmKUjYPe0jwSrd0VNAl/1yl4ypxKRUNKHMf 8nHTyFqgI7NIm3Wh/sEXQGPUeEukUlFiiBo2wIw8TD7RzN3bGcMAGDOMXKfSfDkh7TgW xAoosDQ4uZ7vKozdF3uKIL9jM824xaqXp8/BOompNaZBsnt0EUUTB6IHfvSnPlYNTTpU y4QzKQlOpUAxVXVuj9LH03rAf+3PQCqaouiyIzwSsiRTsREptInHWCKgg3qq0ssacE0Z UERA== X-Gm-Message-State: AGRZ1gKHaSFyleDXsJqVZFz1tYB3x5jpiYMcDwcmaRch0b9/wMiHGPko jxkgJLDxSNujo6slMc2AlFLce07d8Ns= X-Google-Smtp-Source: AJdET5f+gBdp0plRJevKC+pxgUb5t9gbeJww+f3RSPxwU48mtajuY7Z3XqJ7OQUh8PNCcDzsQScgQA== X-Received: by 2002:a2e:2416:: with SMTP id k22-v6mr8491973ljk.80.1541854595078; Sat, 10 Nov 2018 04:56:35 -0800 (PST) From: Radoslaw Biernacki To: libvir-list@redhat.com Date: Sat, 10 Nov 2018 13:56:21 +0100 Message-Id: <20181110125624.1168-2-radoslaw.biernacki@linaro.org> In-Reply-To: <20181110125624.1168-1-radoslaw.biernacki@linaro.org> References: <20181110125624.1168-1-radoslaw.biernacki@linaro.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 10 Nov 2018 12:56:37 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Sat, 10 Nov 2018 12:56:37 +0000 (UTC) for IP:'209.85.208.194' DOMAIN:'mail-lj1-f194.google.com' HELO:'mail-lj1-f194.google.com' FROM:'radoslaw.biernacki@linaro.org' RCPT:'' X-RedHat-Spam-Score: -0.112 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.194 mail-lj1-f194.google.com 209.85.208.194 mail-lj1-f194.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.42 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: laine@laine.org Subject: [libvirt] [PATCH 1/4] util: fixing wrong assumption that PF has to have netdev assigned X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Sat, 10 Nov 2018 13:12:49 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 removes 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 --- src/util/virnetdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5867977df4..e55c538a29 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1359,9 +1359,6 @@ virNetDevGetPhysicalFunction(const char *ifname, char= **pfname) } =20 if (!*pfname) { - /* this shouldn't be possible. A VF can't exist unless its - * PF device is bound to a network driver - */ virReportError(VIR_ERR_INTERNAL_ERROR, _("The PF device for VF %s has no network device na= me"), ifname); @@ -3182,8 +3179,11 @@ virNetDevSwitchdevFeature(const char *ifname, if ((is_vf =3D virNetDevIsVirtualFunction(ifname)) < 0) return ret; =20 - if (is_vf =3D=3D 1 && virNetDevGetPhysicalFunction(ifname, &pfname) < = 0) - goto cleanup; + if (is_vf =3D=3D 1) { + /* ignore error if PF does noto have netdev assigned + * in that case pfname =3D=3D NULL */ + ignore_value(virNetDevGetPhysicalFunction(ifname, &pfname)); + } =20 pci_device_ptr =3D pfname ? virNetDevGetPCIDevice(pfname) : virNetDevGetPCIDevice(ifname); --=20 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list