Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3696124pxb; Mon, 24 Jan 2022 15:37:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2BW7Z6+Jfa5XzLdaryD0KS6YioarfZKtaAoukUCu08lsGR5NG0bccVvNCinhSNlpYyRH4 X-Received: by 2002:a05:6a00:1bc4:b0:4c9:b1d5:6130 with SMTP id o4-20020a056a001bc400b004c9b1d56130mr5501772pfw.36.1643067444917; Mon, 24 Jan 2022 15:37:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643067444; cv=none; d=google.com; s=arc-20160816; b=ftL/nZq4NNAyECOj4aIppJjkgBnXWiKRMJMoW0P28vvZL9Z+sr/h6g/H6N+5AGEyX9 C+MongMHFgs7W4/Au6ISfBWF7YynwXc84uRo9UJeCsGCQHScwNfTiwbOKvbAVUlFZY8S F4FFh3VWBFhcIKcQN/Iq2oFmmFE1w5BJ/UoxBWtFMz2CqDJEyCgPBnRUejuj02Xkpr9h dREgJWD5qmzDqHvvoD/eTJipqpQ5fBt9SihU3hfIAsFphIhoSlh6wUoMiQjJVnHGeOL3 D4QHXKHFikMMTJgRX+X6+rxZ8gDBuawnSCM7nvluUXQIK69YLNBPYQ+xR+DnrfympqUx A5Wg== 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=FilgKx0vkMHDW5pXIOE5W7nUOcrDzFHTX5/VyabeL213eWX+Cxmh2ovM9SOMxBrnw2 h3NbMHsHvNwrh3XQ/iUp/us8KOn6LTXSXtENiJKIIVGMgy8Uc94FR4HlB2nPNW7w75Sy jpQ2VOoVAip2vkDWNkfm72+USZxLGGOb+Mnl3AUEB/jC2qEPkgarntQpbplBTaYDqWtm wTGdJZXJTAdC/OApT/PHG99vcDJsuPJxFQfbQpY8tV7kHWBRhe5bxopwPKAiXBGCAR56 v60MWO03PL7/LtGPJk4H0L4MuycASM1NA5iUVMKz0Hnkrd/4EDWmM7GJQ1RADfyh83zU hl5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lR78Kk7a; 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 p12si14541612plq.95.2022.01.24.15.37.11; Mon, 24 Jan 2022 15:37:24 -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=lR78Kk7a; 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 S1850940AbiAXXbU (ORCPT + 99 others); Mon, 24 Jan 2022 18:31:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579217AbiAXWFM (ORCPT ); Mon, 24 Jan 2022 17:05:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B86CFC04590D; Mon, 24 Jan 2022 12:42:21 -0800 (PST) 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 2F76DB8122A; Mon, 24 Jan 2022 20:42:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55D26C340E5; Mon, 24 Jan 2022 20:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056938; bh=Py0Utb8K/TKDOXRe9hLUxo0KxcgvtJEQobvTI9y/7YQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lR78Kk7arsWpcvrybCtCYStB1AMCmUqLzpTMCKxvvyzyXLW04KszrS0HY9K3pwJrS QihQc0hl3UR12Iu9uFt3OybUU5T6nLoDMdZhf5b4VZesTnd6XngR+jfU6swd1/aI3G DpfQ2cHyVWjfQxKAN+Wmb0QUv/9WVohlA/egiSyQ= 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.15 616/846] net/mlx5e: Unblock setting vid 0 for VF in case PF isnt eswitch manager Date: Mon, 24 Jan 2022 19:42:13 +0100 Message-Id: <20220124184122.296054536@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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