Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4468825pxb; Tue, 18 Jan 2022 20:54:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+X+X4ipyy68sCstkd0QNZDU7dC7xADncJIHn1r1mQY38zOxXSe6CiIQq/wo4gTpzROnHk X-Received: by 2002:a17:903:2311:b0:14a:96a4:1069 with SMTP id d17-20020a170903231100b0014a96a41069mr21618457plh.149.1642568086028; Tue, 18 Jan 2022 20:54:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642568086; cv=none; d=google.com; s=arc-20160816; b=JpDEoBD1cfJ0OwDy4pTFI3mDMavLx4NwjWb2ltAk361E+3vyIEK7CMBZko8Ekcuu3L SUQyMuNyhA4ejfY3DGo7cxA1TMbhLEz049DCZCpHJ1Lj+kRYBlbYKOJGR7lffhNte45v htTdicAkzCbt9ZaMcMuAQvoVYsM/HhjYroJJrbhCE7zzC9YE7Bvb3NT//TnhwsTNtS+A UPgPS7/YJF/4vfCteqlqGt2ug4u5tMH88O0jlBtSJV2wjm/Q5QuNSKiAPULEs88l0XHS QVZ6c8JWeL3MSC9hKab1qFJSpnomIWFSWcOm23z+pjWZONWNA3zKsM/yrNbDPbr4Bf7T MkCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2YLGSGZZKfSK3K7jFRF0ae8CpK69ypzdkSuXHXNDoMU=; b=EgIrCZk+Qu/t+zzGjHIXvGoL/b9Hm0oOtWxuyrkkse1pCEsBqoZkHb21N/cZZ93tR+ tiuAL7CmfOS/X+NZHrOE3sdRwAk0YcQpRBvy0PHqQAxPp/BJjd1BKDhEA6ylxuteM+oG P7JLU/PgctRJMzIcWhopj8aMeaNsq1QM8m+RAqLEHb4K/PEWeQtDVTNYNdLrY+cg78US U+MITwPePbrKI4jv3dtVBm05TV58rptehIxxyWNqqky+g4PrBRHh5mYm6c5wz00PfZdm vlThet2Bl29QFiHhUmeI6Ui8afGZWCCH3BWEDrOejhb3AvpJP7ADRHR74HouNrs1O+YU Ub1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qj9sjjVU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u37si19503392pgl.592.2022.01.18.20.54.06; Tue, 18 Jan 2022 20:54:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qj9sjjVU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349749AbiARCuL (ORCPT + 99 others); Mon, 17 Jan 2022 21:50:11 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:43148 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345420AbiARCbd (ORCPT ); Mon, 17 Jan 2022 21:31:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 02B93B81235; Tue, 18 Jan 2022 02:31:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6FD5BC36AEF; Tue, 18 Jan 2022 02:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473090; bh=Py0Utb8K/TKDOXRe9hLUxo0KxcgvtJEQobvTI9y/7YQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qj9sjjVUy40lF4WQnU42Zlk5r8pGZ2Inhv9MYPYkxX+FCSPbkDwwNrY7abLOgsEHx ISkoI6HdPCsgEVPMCOwYFVFYAyXw0/s5WDcIP5i2kbkbZ/mx2rrylqqZGi+NpmFHEE 5KLYI3FfpyynKTt6TcNZrS56BoNtvwJlZqDPsvJJpkH+vn5CXh3jd/C0r0jTV30eXJ k+9izOHYF9MeP1iqJ7zwdW3MdwFvqSQ4UmJV01eTJl7RKyy6q8sAEPDwS/EqSCeXMl INNq0ESHrgkoYUiVyIE8yHrGF4Y5ROtC3I+AQvwYbVIQ/zJWU+B4MR80IJTz/PhVhb 8Bp1cvdzHnH+A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Maor Dickman , Roi Dayan , Saeed Mahameed , Sasha Levin , davem@davemloft.net, kuba@kernel.org, parav@nvidia.com, mbloch@nvidia.com, dlinkin@nvidia.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 210/217] net/mlx5e: Unblock setting vid 0 for VF in case PF isn't eswitch manager Date: Mon, 17 Jan 2022 21:19:33 -0500 Message-Id: <20220118021940.1942199-210-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maor Dickman [ Upstream commit 7846665d3504812acaebf920d1141851379a7f37 ] When using libvirt to passthrough VF to VM it will always set the VF vlan to 0 even if user didn’t request it, this will cause libvirt to fail to boot in case the PF isn't eswitch owner. Example of such case is the DPU host PF which isn't eswitch manager, so any attempt to passthrough VF of it using libvirt will fail. Fix it by not returning error in case set VF vlan is called with vid 0. Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c index df277a6cddc0b..0c4c743ca31e1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c @@ -431,7 +431,7 @@ int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw, int err = 0; if (!mlx5_esw_allowed(esw)) - return -EPERM; + return vlan ? -EPERM : 0; if (vlan || qos) set_flags = SET_VLAN_STRIP | SET_VLAN_INSERT; -- 2.34.1