Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3667855ima; Mon, 4 Feb 2019 03:07:52 -0800 (PST) X-Google-Smtp-Source: AHgI3IbxCZd6uDccpzs4PXfgd/MvSs71xDmyXoJwchMha6qlSolKbIZnpirlSsJQzWjIKHDJquY6 X-Received: by 2002:a63:c451:: with SMTP id m17mr12442031pgg.27.1549278472891; Mon, 04 Feb 2019 03:07:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549278472; cv=none; d=google.com; s=arc-20160816; b=pSM8jb6R5xLdWffaxXT/8j2vcdXMSyhwy9O43nPN3RD/HsQm1s91Zg2NMyBXGGv9an OgwkdlCe65cWmXnFXa/oaoTLqPH1BTvVdaHnyewe7oSwm1wuIj0QqmZkDMPxR3Z92SZa taF6Nq4K5G2kUiBEQ8eCk8ptQNQrDGd6Ed1o/ty2JdrKgltSFp7TKyvz5RWMoLZMtOMk oslOV5Q5iIjucotmbgHjfPWrIqr2IOmtXS/3THRPTGLJe+SMS1Kal821B5WC3rvIYgzP a17yGWXMPgNm79dlS0/CgZ6KMUovgVYAUVnaIWYy8a7+4WxBhsjKALaaUe7xW+DaT4SR FWoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r8KhkUQLloYvIpLSn/6S4RlbAUA2QAjbUo8uLo9GAgo=; b=t9nb0OVJZBllARn8NlHPSG1gOTjDtPp9bF21QVjvLPgyRMxhyTMoQUnwUS0UeC+xpP UbpLElhsoYLnD9R3NhCcqTkjHVv9v/4e1jCL4ocmkaXDK6oE95FnuOQez/JGOeSAgTEi HXcrHmXa1otn1NcnBiZz/T0WeGm5XIhUjBB/Qs7TFywdK15888RQjZpbxWU/+sLwHMl0 MhmCkf5IRbUYZWBZc4RFxIHq7Sr5gug5aYW279lYfoumfF4r08hCC2pcKt583DE3c6yo dGYdHxwM+VEXw9zSt+i4bdhElCcFoy95QGkYWBtE2yKm2Y/u5+yT+r/m8gy/r7x+O0/g y/Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rpl3LSCP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si14889603plt.295.2019.02.04.03.07.36; Mon, 04 Feb 2019 03:07:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rpl3LSCP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730983AbfBDKo1 (ORCPT + 99 others); Mon, 4 Feb 2019 05:44:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:42204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730519AbfBDKoY (ORCPT ); Mon, 4 Feb 2019 05:44:24 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A5D5C2176F; Mon, 4 Feb 2019 10:44:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549277064; bh=A9fxE1x00GgycQ2AVf6PRUOepdRNBGrIgR5VXOkzLYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rpl3LSCPP9S48eWxsfpYq0l/ucslfajmW6cdzjJfFr2VsZu+gqowyL1CyxdC8lXdk Mqaf15ByjkhP+A1echuBQyYaCqONY+HTN8cPyT9UBglx1dRvvazUMOCQ/r8tW8+nKT 4zygLSZzmo2NQYN2Isb9eaKdWhniVTG0jUb3Op1I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aya Levin , Eran Ben Elisha , Saeed Mahameed Subject: [PATCH 4.14 10/46] net/mlx5e: Allow MAC invalidation while spoofchk is ON Date: Mon, 4 Feb 2019 11:36:41 +0100 Message-Id: <20190204103610.476927978@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103608.651205056@linuxfoundation.org> References: <20190204103608.651205056@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aya Levin [ Upstream commit 9d2cbdc5d334967c35b5f58c7bf3208e17325647 ] Prior to this patch the driver prohibited spoof checking on invalid MAC. Now the user can set this configuration if it wishes to. This is required since libvirt might invalidate the VF Mac by setting it to zero, while spoofcheck is ON. Fixes: 1ab2068a4c66 ("net/mlx5: Implement vports admin state backup/restore") Signed-off-by: Aya Levin Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1126,13 +1126,6 @@ static int esw_vport_ingress_config(stru int err = 0; u8 *smac_v; - if (vport->info.spoofchk && !is_valid_ether_addr(vport->info.mac)) { - mlx5_core_warn(esw->dev, - "vport[%d] configure ingress rules failed, illegal mac with spoofchk\n", - vport->vport); - return -EPERM; - } - esw_vport_cleanup_ingress_rules(esw, vport); if (!vport->info.vlan && !vport->info.qos && !vport->info.spoofchk) { @@ -1734,13 +1727,10 @@ int mlx5_eswitch_set_vport_mac(struct ml mutex_lock(&esw->state_lock); evport = &esw->vports[vport]; - if (evport->info.spoofchk && !is_valid_ether_addr(mac)) { + if (evport->info.spoofchk && !is_valid_ether_addr(mac)) mlx5_core_warn(esw->dev, - "MAC invalidation is not allowed when spoofchk is on, vport(%d)\n", + "Set invalid MAC while spoofchk is on, vport(%d)\n", vport); - err = -EPERM; - goto unlock; - } err = mlx5_modify_nic_vport_mac_address(esw->dev, vport, mac); if (err) { @@ -1886,6 +1876,10 @@ int mlx5_eswitch_set_vport_spoofchk(stru evport = &esw->vports[vport]; pschk = evport->info.spoofchk; evport->info.spoofchk = spoofchk; + if (pschk && !is_valid_ether_addr(evport->info.mac)) + mlx5_core_warn(esw->dev, + "Spoofchk in set while MAC is invalid, vport(%d)\n", + evport->vport); if (evport->enabled && esw->mode == SRIOV_LEGACY) err = esw_vport_ingress_config(esw, evport); if (err)