From patchwork Sat Nov 10 12:56:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radoslaw Biernacki X-Patchwork-Id: 150735 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1034822ljp; Sat, 10 Nov 2018 05:12:50 -0800 (PST) X-Google-Smtp-Source: AJdET5fyFSXi0B5YMvhGRYIM8cQO3IUsU7houSPHh2XDj61a0ZDMCoulH4wokjU4UCXvRVeA9oYy X-Received: by 2002:a37:bf46:: with SMTP id p67-v6mr12335652qkf.46.1541855570309; Sat, 10 Nov 2018 05:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541855570; cv=none; d=google.com; s=arc-20160816; b=BMb4Usquhkc5s4WpQidPqMlKvT1+3mMx0WpEpxaJV5vIu4g4xB3iDN+/1ZUgzX+y4J 4/TbMZfjrOLIRI1FYDds4rgHqCxGbWETlJ8aLzREXHvzRo/ekk+dO8wKGgE7pBg9Jwji 00JW74jh0SnNSjlM0xyVOmHkPk7myai3ItduCr+JgcQXm/2k2SZrUbKYr3GBxIvfPejf CY6IcAOf/clzffGTd0s56ekiJppXDzxlB0+k8nqTlf+UHRXQghtvjeQEvPjbAiFVr7vq +GG2rH35CVt2EAK8C8TN/C+cGUJJL80Fhtox9s2D+YYTecPF0GdqZmBZplVSOUVl4v82 bvgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=GOfvukbM4KHdPirpRQoJY5BiVHrl9cHb2JJhRZ3ehUQ=; b=lRpdKymaWsXHpjOtD4POCKa1I48FCN7ZXun5hJY7OIdhDEnhs9W914zhfxXB4erUy/ RYqGH+8U1N3Vs4s8U7m2amj8wQDD9vYJY3uMv7XbghQe2Ur98liDrcQoXsstPBC8xmdt rHN7PhqZnXg8Ib9VPzPFLJD5DtAIHkeKMW8NIT0w5YVirYcr2ivJ3gSfo157CgZooCwq DkgR8yXdL9Lfvfgj0nNYRDOOsW8wUL5WWtB9FrQpJD/iW9qKZUSCSdcvjCQ1L3ygMrgy 2IDdxFLqmTKO+MTTRR+yOTCMX4/p83Tf8/FHQGtdN366U2/3IpSAEuiyn3rkEnH1uy0T YXSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kc4Q15pY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id l2si2068162qtj.22.2018.11.10.05.12.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Nov 2018 05:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kc4Q15pY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) Delivered-To: libvir-list@redhat.com 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) 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-Received: by 2002:a2e:2416:: with SMTP id k22-v6mr8491973ljk.80.1541854595078; Sat, 10 Nov 2018 04:56:35 -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) 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 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) 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(-) -- 2.14.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list 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) } 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 name"), ifname); @@ -3182,8 +3179,11 @@ virNetDevSwitchdevFeature(const char *ifname, if ((is_vf = virNetDevIsVirtualFunction(ifname)) < 0) return ret; - if (is_vf == 1 && virNetDevGetPhysicalFunction(ifname, &pfname) < 0) - goto cleanup; + if (is_vf == 1) { + /* ignore error if PF does noto have netdev assigned + * in that case pfname == NULL */ + ignore_value(virNetDevGetPhysicalFunction(ifname, &pfname)); + } pci_device_ptr = pfname ? virNetDevGetPCIDevice(pfname) : virNetDevGetPCIDevice(ifname);