From nobody Mon Feb 9 07:25:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1650629762; cv=none; d=zohomail.com; s=zohoarc; b=M9EtxBiDAQYncqotoMDVjjTWAN+xLtmIBCK6flMkMEc89PbVayQNxpXHgzoHA/RBoy6Oek95Aj/AFT88DVeKDRtfpIkJuJjxgHT3+f+qUEMy6GRRrNg0+5lUM+VEJsKNzlKD7Sh94HR4TRjUvOorKn3li+Dta0Iz/Dr8CU/LRe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650629762; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AWH3U+p6pvkW8tj1pdGlTBMOMd8uyIU63/YunfugxIg=; b=HsbD7Shr+1PBqGvxlie49o0nV6Ue+IGpJtvWXYH40xXfMiyUJnNNQYwg71SK/fHiJBlYWflbQJ/9iOgfuKEoqoggK3Hy+xlKdZH7IZwQy+Ydeyhn6ntyaoToKtEzZdfvO2NAdjDQhSDEHn6E+xp+ic8KYxJIE6Cjf1sgpTgssjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1650629762198220.5679104658775; Fri, 22 Apr 2022 05:16:02 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-sTOh2nsoOVa3hcuDi0P4pw-1; Fri, 22 Apr 2022 08:15:56 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E01DC280304B; Fri, 22 Apr 2022 12:15:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B04C040F494C; Fri, 22 Apr 2022 12:15:53 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 49D111940352; Fri, 22 Apr 2022 12:15:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 81EAB1940351 for ; Fri, 22 Apr 2022 12:15:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6A06F14A5066; Fri, 22 Apr 2022 12:15:50 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10BFC14A5060 for ; Fri, 22 Apr 2022 12:15:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650629760; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=AWH3U+p6pvkW8tj1pdGlTBMOMd8uyIU63/YunfugxIg=; b=Ay2y6AjZEzzRjrvWAh5/DSkCBM9xKnefg1dCKZ1WO8TxDySkpGu4Xd+KEJPOUuXZUzsyNV l4bYpJncOJU/LZX0k+9E3ck7vk3+poFleEPFb6s1wsS37CVznId/5TbUH7iLgqE2pn5/Jh Kh4p72b7AextT3dr0Lfr0Q3nJbkE9mI= X-MC-Unique: sTOh2nsoOVa3hcuDi0P4pw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] virnetdev: Fix regression in setting VLAN tag Date: Fri, 22 Apr 2022 14:15:47 +0200 Message-Id: <97e31bae27ad71cb5373cd518ad4bfffda133366.1650629734.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1650630664182100001 Content-Type: text/plain; charset="utf-8"; x-default="true" In the past, we did set VLAN tag on . However, during rewrite (v8.1.0-rc1~191) virNetDevSetVfConfig() was changed and a condition that was responsible for calling a function that sets VLAN tag was changed accidentally resulting in VLAN tag not being set anymore. However, because of other changes in the same patchset, it may happen that @adminMac is NULL (this is to work around yet another broken SRIOV driver), and thus we must refrain from setting MAC and have to set VLAN tag only. Fixes: 73961771a1cfec3c0f43caec9d117d2fbcc7af39 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2075383 Signed-off-by: Michal Privoznik --- src/util/virnetdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5e60bf068f..93f836cd92 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1682,7 +1682,8 @@ virNetDevSetVfConfig(const char *ifname, { int ret =3D -1; =20 - if ((ret =3D virNetDevSetVfMac(ifname, vf, macaddr, allowRetry)) < 0) + if (macaddr && + (ret =3D virNetDevSetVfMac(ifname, vf, macaddr, allowRetry)) < 0) return ret; if ((ret =3D virNetDevSetVfVlan(ifname, vf, vlanid)) < 0) return ret; @@ -2365,7 +2366,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, } } =20 - if (adminMAC) { + if (adminMAC || vlanTag) { /* Set vlanTag and admin MAC using an RTM_SETLINK request sent to * PFdevname+VF#, if mac !=3D NULL this will set the "admin MAC" v= ia * the PF, *not* the actual VF MAC - the admin MAC only takes --=20 2.35.1