Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17927122ybl; Thu, 2 Jan 2020 14:59:21 -0800 (PST) X-Google-Smtp-Source: APXvYqyIZuKlH7u7Atb4Kny5CY8282zazvqvBnf7TFjU0lMDQW754WIaQAZpVVyzknB6nzVaBwz4 X-Received: by 2002:a9d:6502:: with SMTP id i2mr68054835otl.206.1578005960849; Thu, 02 Jan 2020 14:59:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005960; cv=none; d=google.com; s=arc-20160816; b=09HW1RR3NF06vketr/ys492dhqmb1E44uInHS7KfrzFc9QBWnnQJE0y6NTO3VlYXzp FGBNGFr0Tvr7Bf5RsFeCaS1OvupmvaUMWmgurJObMnXCAxQ/g3po9SN7JL45V4Ac2oNf 3iD5PEMwahLCUcbrk1R303e1LykuFY6/CVY2Koa3yuu9zYtJq5ie3Qr5XlCnKad6ox5e nYoFsdlIXX/gsPxv+XbTEYNYrDu1C3t3zceyntAp6Bv25BDGXq0nHjh2V3EH4KXjZOs2 myBxPtOjNzZMjQ6+eCwnJwKc1WqPGVOf31otRVHYmNMaAFUR9RI2VvTyU3CsyLeRe9GS X55Q== 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=D2iLHzOH7NdwAGYcXh+xWtEwOJapgSwn473KOERoYsU=; b=GIFaV+l8vGic+QX38NYL1gZz01xJ5uhEEYbWFvP5pUbynlShk1MNtXqOHLVyafHrmZ YtGbmU7Tk7OAowRHfPBOeHbU9YERrUFIa8ny/XQ0nIfd6dWQEIGWwEJkomcqB8twRLe7 xk7mpCgp84iqefPq7wyAQkp2vZGvN5wXbGsy0xScEAc3t5gcyt1f3RacekOwrIMJp58C wrbswj0a4/MP90JOftYBnf62/fFIs3MBFBOuZREksxsWb9TEyw0bEbc80P4YCwBH4cTe pRiylb+UntSIzSh6SSoIZ4ELJIHyKK0DlAklnJ6FYU+lzLlbLW05xzoEc8vOwSBiSzKD aRuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VVfjvTm5; 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 e13si23105155otp.164.2020.01.02.14.59.08; Thu, 02 Jan 2020 14:59:20 -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=VVfjvTm5; 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 S1728366AbgABWRh (ORCPT + 99 others); Thu, 2 Jan 2020 17:17:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:60088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727315AbgABWRd (ORCPT ); Thu, 2 Jan 2020 17:17:33 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 B1E1421582; Thu, 2 Jan 2020 22:17:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003452; bh=//md0SP1j14tlYgqQUFEa08cSupdWyzLqvhOB/J0sPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VVfjvTm5iOrUSAaMiTcU0ExTEQtDfoB+HgkY7wIFb9gmzc36yJsEqOOQMmgC3zMQ6 PM5iuRi0t2ksepxxQdjUea4wf+bGg5bHvUxdNv2M01bgHcP0wkny40vbG7wyUWphbd TL0wcBMT+JGtJkUQRRDSHXV29Y7g2TuGGzC3dCRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ido Schimmel , Alex Veber , "David S. Miller" Subject: [PATCH 5.4 166/191] mlxsw: spectrum: Use dedicated policer for VRRP packets Date: Thu, 2 Jan 2020 23:07:28 +0100 Message-Id: <20200102215847.131563257@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Ido Schimmel [ Upstream commit acca789a358cc960be3937851d7de6591c79d6c2 ] Currently, VRRP packets and packets that hit exceptions during routing (e.g., MTU error) are policed using the same policer towards the CPU. This means, for example, that misconfiguration of the MTU on a routed interface can prevent VRRP packets from reaching the CPU, which in turn can cause the VRRP daemon to assume it is the Master router. Fix this by using a dedicated policer for VRRP packets. Fixes: 11566d34f895 ("mlxsw: spectrum: Add VRRP traps") Signed-off-by: Ido Schimmel Reported-by: Alex Veber Tested-by: Alex Veber Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlxsw/reg.h | 1 + drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h @@ -5421,6 +5421,7 @@ enum mlxsw_reg_htgt_trap_group { MLXSW_REG_HTGT_TRAP_GROUP_SP_LBERROR, MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0, MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP1, + MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP, __MLXSW_REG_HTGT_TRAP_GROUP_MAX, MLXSW_REG_HTGT_TRAP_GROUP_MAX = __MLXSW_REG_HTGT_TRAP_GROUP_MAX - 1 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -4398,8 +4398,8 @@ static const struct mlxsw_listener mlxsw MLXSW_SP_RXL_MARK(ROUTER_ALERT_IPV6, TRAP_TO_CPU, ROUTER_EXP, false), MLXSW_SP_RXL_MARK(IPIP_DECAP_ERROR, TRAP_TO_CPU, ROUTER_EXP, false), MLXSW_SP_RXL_MARK(DECAP_ECN0, TRAP_TO_CPU, ROUTER_EXP, false), - MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, ROUTER_EXP, false), - MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, ROUTER_EXP, false), + MLXSW_SP_RXL_MARK(IPV4_VRRP, TRAP_TO_CPU, VRRP, false), + MLXSW_SP_RXL_MARK(IPV6_VRRP, TRAP_TO_CPU, VRRP, false), /* PKT Sample trap */ MLXSW_RXL(mlxsw_sp_rx_listener_sample_func, PKT_SAMPLE, MIRROR_TO_CPU, false, SP_IP2ME, DISCARD), @@ -4483,6 +4483,10 @@ static int mlxsw_sp_cpu_policers_set(str rate = 19 * 1024; burst_size = 12; break; + case MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP: + rate = 360; + burst_size = 7; + break; default: continue; } @@ -4522,6 +4526,7 @@ static int mlxsw_sp_trap_groups_set(stru case MLXSW_REG_HTGT_TRAP_GROUP_SP_OSPF: case MLXSW_REG_HTGT_TRAP_GROUP_SP_PIM: case MLXSW_REG_HTGT_TRAP_GROUP_SP_PTP0: + case MLXSW_REG_HTGT_TRAP_GROUP_SP_VRRP: priority = 5; tc = 5; break;