Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3654841pxb; Mon, 24 Jan 2022 14:33:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxm0kjqbbjYkWAQsOzGnsFUsbDUQ0MyCIBsWCveLGN5xM4x83mweBy8JJgen3rRPcjC4UIC X-Received: by 2002:a17:90a:9284:: with SMTP id n4mr443138pjo.109.1643063462601; Mon, 24 Jan 2022 14:31:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643063462; cv=none; d=google.com; s=arc-20160816; b=0irY6v8PrTg96XoEPNtQVTL6bDGhI/Ekz1n/tOwt8emeaF7M14Q2d2ZjSQrPQAy4c7 Ax9S2hUHX7PvDl5Sve/kl2VEA3w6ONBJKCPvQlbZ+UZFbu99+ziCCp39QoXUotS7lWzR eCYsrlG68Ro0K79Hrt2ROuCIJbZ/uz/0dgmGpapD6XWgRAB/fIvHwWUly86rhyqESxcP SDjwH83GUzlhy/BddHQqJTeW20pv2kd9DWIX8sDcHI0LVxpH9//plaMU5+i9eZntDSS0 X/E2oiD3xwXp7a2LwNLUsxJdKqjovSe1Dah0e7FJ9ZvxYaduDo2gX9bYIGQtdkDTesjU Qfxg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2YLGSGZZKfSK3K7jFRF0ae8CpK69ypzdkSuXHXNDoMU=; b=mW07HoTaZZxLfmi23Xg2h/3eM1lUH2uPzoTI4iIQNN1WGGTxFLcf7Xrqhx6e2CqnYC SdZBZPSoRyP1i1cHKDow8u9gGNfJwGWI7I9vyn4mhiED8qEdvS7PUz1ZcypJi8Zocz2q Ipu2bsbRxSRxw1IJBdnN/SPRea24yyDInDbLkTMw5Qt58e00MbU2Ta8IZHec5YXeUeQ9 D3Vqh0R9J1Diu6RxDHYZfDz+x9aAgJXgl/LM3YocADD4VQChFeTCRB05l1zX2kWR5GDw 7Ke+fZ4IhlA1x/mTR+l37m5Pj3rl56Gw4x5BxDHC6RPIYMJjIOCrvI0I7LbqhSdEPheV 9ucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IIU+zaC7; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 2si6207998pli.600.2022.01.24.14.30.50; Mon, 24 Jan 2022 14:31:02 -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=@linuxfoundation.org header.s=korg header.b=IIU+zaC7; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1584557AbiAXWVY (ORCPT + 99 others); Mon, 24 Jan 2022 17:21:24 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:51098 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1453514AbiAXVaQ (ORCPT ); Mon, 24 Jan 2022 16:30:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 3BCB0614B4; Mon, 24 Jan 2022 21:30:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 201DEC340E4; Mon, 24 Jan 2022 21:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059815; bh=Py0Utb8K/TKDOXRe9hLUxo0KxcgvtJEQobvTI9y/7YQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IIU+zaC7/jrHb4F60RQY6TDm9ymPQATuHP4Gu4Q7GLepoOmbVloEicOZjZdpT+v2w omGQzId0P3uPk/VeruOuo1jXTEpjZtGwhTIw9Dok0TYJY2CXIUJYNJfnRxPLzeHTGc AsTI6jFTytwGuSDq55atGbKOL0KCGrNAj83GKv+g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maor Dickman , Roi Dayan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.16 0726/1039] net/mlx5e: Unblock setting vid 0 for VF in case PF isnt eswitch manager Date: Mon, 24 Jan 2022 19:41:55 +0100 Message-Id: <20220124184149.735208995@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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