From patchwork Mon Feb 13 09:24:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steen Hegelund X-Patchwork-Id: 13138005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77509C636D7 for ; Mon, 13 Feb 2023 09:26:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=99naWXP84oLQ7MUxQGLUjid2SJOv6SbjuR4A/ufQJ7I=; b=eN3jcfkUUI8HrC WM1/WP91RIlg/b3vHCeUeBOCR/Ld+A9F0QTrlNib2Afm0FAHTOd1ElMWGUv8FpYpNJV0FOQpFBFr5 gVM83cAodpFCd0jVr1MV/9ZS2IlTbWw48FbEW3061NTM9HcTqu/4OvxNw4WVeMtSjGwcwENy6eFKa Rc+q/vACrUrXa1d0xijuemxhQuxMGjlW3YpjyvuY+BmvY2sA86g8XOPFOaArOa2LBWHKaynEmThE8 Yj4c7wKrQh+cYOd+mak0Lt6Nqu8LfMDqPonUiwGRbbpmKN+1hTHhLh2P4nlpKyLssPZXmkf14totN 7GqloqzPXRGvnKDD+TbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRV4v-00Dpiv-2f; Mon, 13 Feb 2023 09:24:54 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRV4l-00Dpdz-43 for linux-arm-kernel@lists.infradead.org; Mon, 13 Feb 2023 09:24:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1676280282; x=1707816282; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e1mnShQAa1T1MjAsWoZ1kSb7/9+7Gmh5X558Qs7HZWA=; b=tcBEQ3q1BMayFqRLRMgf/2eNlpVNEK+5wgoXPDUpWkbCRON59dAD8qAL 4ydSteSAq7KyJHVmRDWiZSyYV0HcuV9Kklkm6SM3xI6B0mi5C6Z3SahGq PhUGkMLdQomgAtds2nNa+SXMV209PqEPpi3p9xESdy+3T1UPxmZqyxqHT eEwSK4Lbor5s8+ygfKGMMLB2OrpECndx30Y0hw4vbTYWUa1S1RL7bGcyp lsCzeHFCutuZ+M3dthkfFd7sNoHODLlxj2e0bl9Pgrnk9QWRTbIXaCZLz L6uH91Gy81wPcCp3GQ5oPSwGnu7ShrTxzi7GW2sestCsLxrVIJfrFFNsZ A==; 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 To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni CC: Steen Hegelund , , Randy Dunlap , "Casper Andersson" , Russell King , Wan Jiabing , "Nathan Huckleberry" , , , , "Steen Hegelund" , Daniel Machon , Horatiu Vultur , Lars Povlsen , Dan Carpenter , Michael Walle 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230213_012443_210509_2D5E14FA X-CRM114-Status: UNSURE ( 8.34 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org A valid frame should never use a multicast address as its source MAC address, so discard these invalid frames. Signed-off-by: Steen Hegelund --- 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);