[net-next,01/10] net: microchip: sparx5: Discard frames with SMAC multicast addresses
Message ID | 20230213092426.1331379-2-steen.hegelund@microchip.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2249996wrn; Mon, 13 Feb 2023 01:27:49 -0800 (PST) X-Google-Smtp-Source: AK7set8wiEagMaX1xjkJhhpp/4QNNHnyE54s/vc8WWnMASt4QXeAwwPF7ofw/jPLnK9PvdKLhdV+ X-Received: by 2002:a50:d7cd:0:b0:4a0:af87:b3ab with SMTP id m13-20020a50d7cd000000b004a0af87b3abmr23082769edj.36.1676280469727; Mon, 13 Feb 2023 01:27:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676280469; cv=none; d=google.com; s=arc-20160816; b=Q3GpsyUK4DVfLrTq8Jplax7R7npFc6cMd0E3Sq/W6YsZp6rF8ovMg2IPOUBinTn+cs vrt077DX+pKTF2tWWnSWieLbVvSeEs0sOXxlgi5YlrQIafRzjLMLcBTQQTKrRyGin3k1 9K8F7ybTPJxcoMf3qNIQDsVtDw/hT0k+ToUgplPzTXk6naYQ3fWf8yGwlUKgWsK/Ji6K f+yn+JUW6qWQ1K+DfRcu+P7wHE1suG8YAjFLyJo5pDDQPpPyXh2NB1aMkZBMF5mh8dJV nZE0D7s7LdydNe9MHZuIL12dcYYOpRlFbEDsWJ7kAD5A8PXbeGvDeuCxyo442OVwh1Ze 49rw== 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=vnTGXj3imE8LTGH5Aid1jdWPhWwrU8LOVRi8iKSYlOk=; b=R9g0DjOPE5roT8fdCI9qyVe/Qu+rEctWur+mQD0Axgclct7E3pRM2/i6VRY/cCohAi 2pBnTtMSycdDCwv7ikI6F0uWqF5e0h3K7qsfxRONQp51OPtSG2hLV9+UeVbISPSMI5tp XDTRNebJAx1mMBCk9NB2fefzithR4RLoBD+4Eth8K0uI3hk/dN8R1v/vJ+FmH71ulJUe PYrTtYUSlmImsTP18FYUHF4QKeHI89iT8MLvKBqU+q7HzgBfA/LXGMwKqz2UoVFy6JIp drNT08tFe2sTd5/AnmOuhqJ2UX9v7boUYac9ITb5jk5AzUst24oWozha+h32kx3gPEZP xvPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=eIKEGfzQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a056402028b00b004accbc4a5absi1895530edv.110.2023.02.13.01.27.26; Mon, 13 Feb 2023 01:27:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=eIKEGfzQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbjBMJYw (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 04:24:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbjBMJYo (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 04:24:44 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B285CC642; Mon, 13 Feb 2023 01:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1676280280; x=1707816280; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e1mnShQAa1T1MjAsWoZ1kSb7/9+7Gmh5X558Qs7HZWA=; b=eIKEGfzQqiBZG2m+vilZbdHqWny7doKAGSPplPxTktpvgRXuuFd1J/Y4 LY1ffofAj3vuqfCIf82/RWxTeyjBC2q0kKUTaunfh7xSimojLi/ttiWWJ 4IY8adVE8J4dNqR1R9F8dM2I4ugA44eZJ6Ad/g6lSj52KJXGTH3eyhIJo aiHwK0G2zEZXiceKxf1svJLQzwTcqzNNHbgZUHkKgjoxRT4oYpN1esa4R cpxcD+qu1dz9IPvQfWCcrZtRyQrEB5K/URPe4qFuFh7DjpiIFHW7lfuUZ gnj8Wu0UEfL3YvarLVa55lY/WsKKhmrGS5p23CM+3f2qVLEpFO3THAWpk g==; X-IronPort-AV: E=Sophos;i="5.97,293,1669100400"; d="scan'208";a="200397457" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Feb 2023 02:24:39 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 13 Feb 2023 02:24:39 -0700 Received: from den-dk-m31857.microchip.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 13 Feb 2023 02:24:35 -0700 From: Steen Hegelund <steen.hegelund@microchip.com> To: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> CC: Steen Hegelund <steen.hegelund@microchip.com>, <UNGLinuxDriver@microchip.com>, Randy Dunlap <rdunlap@infradead.org>, "Casper Andersson" <casper.casan@gmail.com>, Russell King <rmk+kernel@armlinux.org.uk>, Wan Jiabing <wanjiabing@vivo.com>, "Nathan Huckleberry" <nhuck@google.com>, <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, "Steen Hegelund" <Steen.Hegelund@microchip.com>, Daniel Machon <daniel.machon@microchip.com>, Horatiu Vultur <horatiu.vultur@microchip.com>, Lars Povlsen <lars.povlsen@microchip.com>, Dan Carpenter <error27@gmail.com>, Michael Walle <michael@walle.cc> Subject: [PATCH net-next 01/10] net: microchip: sparx5: Discard frames with SMAC multicast addresses Date: Mon, 13 Feb 2023 10:24:17 +0100 Message-ID: <20230213092426.1331379-2-steen.hegelund@microchip.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213092426.1331379-1-steen.hegelund@microchip.com> References: <20230213092426.1331379-1-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757707469674992795?= X-GMAIL-MSGID: =?utf-8?q?1757707469674992795?= |
Series |
Adding Sparx5 ES0 VCAP support
|
|
Commit Message
Steen Hegelund
Feb. 13, 2023, 9:24 a.m. UTC
A valid frame should never use a multicast address as its source MAC
address, so discard these invalid frames.
Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com>
---
drivers/net/ethernet/microchip/sparx5/sparx5_port.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c index 246259b2ae94..3a1b1a1f5a19 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c @@ -1071,6 +1071,11 @@ int sparx5_port_init(struct sparx5 *sparx5, /* Discard pause frame 01-80-C2-00-00-01 */ spx5_wr(PAUSE_DISCARD, sparx5, ANA_CL_CAPTURE_BPDU_CFG(port->portno)); + /* Discard SMAC multicast */ + spx5_rmw(ANA_CL_FILTER_CTRL_FILTER_SMAC_MC_DIS_SET(0), + ANA_CL_FILTER_CTRL_FILTER_SMAC_MC_DIS, + sparx5, ANA_CL_FILTER_CTRL(port->portno)); + if (conf->portmode == PHY_INTERFACE_MODE_QSGMII || conf->portmode == PHY_INTERFACE_MODE_SGMII) { err = sparx5_serdes_set(sparx5, port, conf);