Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp761044pxb; Tue, 12 Apr 2022 12:45:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLYCnv5rqtmV2RrMR+vbsH84h2G8jC5+lIiUqcUC+Ps2VEjwP0y6FTHrP0W4EOGo8jREGH X-Received: by 2002:a63:f46:0:b0:39d:945b:5f8d with SMTP id 6-20020a630f46000000b0039d945b5f8dmr4163514pgp.612.1649792721838; Tue, 12 Apr 2022 12:45:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649792721; cv=none; d=google.com; s=arc-20160816; b=N6+g/SpJnS6IInpINxPDAOqprvvZF96j5j63KySJdOi3BGlmHdpUEUwrXgAP6HUFFo ZsKJogbgI+GldBzkPK7BAqyWggnwXjtHEKfnoZJ+J1MfUKiT3JBhf4KY25n5hzw9bcAi ra6DMac9RAbb87Ir6aD3f4fNM63tzFsBgKs1HeVh5LpE30rNUa/FR83xs9aCA59C8eq5 7a4r6PXDw+rcmWxyWeV5K9fgIlPnPp9wemcczCnWyzJ3QmSShIeT6O9twFpZ03Sw16WA maqJ+n+5b2w/4nfQrVQZ1c6ccKJnpnzRf2aQrkb35rtCZRvbnIML/9xvqoBqZ4Ji7hJ8 YXOQ== 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=I/ZSzteaPO6aLTiNdjzC+MMOOgrwUqovFFOvxxyHK6E=; b=MnS82bPPXUlsxxDBHG/OI4sCIbRSvBcKB3eo1IooshNGhQ3lhzgjDTJcCmnOwY/6M8 DnExvlX5BAN9HI7xAS3e65Fn8eRv70j+9VDMBleVZI4CzHflbRQOgxy4eEXutywGXOQ4 6IUYscRrmpJp0y4jawQGgBvTQWp4zSpuKIa9QpW8B6D6+PTY0mWo4jEF/tlTHaSMPYcp 6V9Ys9+8w0AGvP3i18nbdiffjfBi+J/sAjBHUv/hNb2qR9drqyXK32ncXq7kc7cXQF5R iqVCbpXf6aDgfkXq/D0FDDwy93zTvOw3fzCOaqSVdgD3MqjoWSXOAcliqa6tw/ql/sfn CZsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b="h4D1Lgq/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a72-20020a63904b000000b0039dae555241si299087pge.628.2022.04.12.12.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 12:45:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=fail header.i=@microchip.com header.s=mchp header.b="h4D1Lgq/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 82AF266C8E; Tue, 12 Apr 2022 12:43:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243028AbiDISlQ (ORCPT + 99 others); Sat, 9 Apr 2022 14:41:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243007AbiDISlJ (ORCPT ); Sat, 9 Apr 2022 14:41:09 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D210429D25E; Sat, 9 Apr 2022 11:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1649529543; x=1681065543; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=egRgAcVpqsi35K+VjlJJW60X1GVnDcMnXByx+r3KOJ0=; b=h4D1Lgq/fzU9nYURCAKe5nXJizfV1qjdF40m3Ur17KxqRT/pS/mpo9XD I1+Lzkr0ogjPVGi0qj1nuzUJzGcWDkLwSzo9Qyaw3HzCzipztIv+i1UI0 V821EwtiF/ERNaNnPY67XNYVHXFXlY/0xOfSAZzNqOCsIRU3JsMup9DOI sy73MoXMsz57jqgxDRNmp2N2lxJWaE0JdQY78/HHVB2rHpOD8zKQLhw+/ s3ONJH58J5YwMQ4kNLxquU2fGa05DZr6OFGWMnubWwDaq1+cy+Ybot8xe XHG+tCtOiL9jntbIJrAVKAMaHzddbJT5NnXH1aBsDSCI5cwgX2AWFog8g Q==; X-IronPort-AV: E=Sophos;i="5.90,248,1643698800"; d="scan'208";a="159534950" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Apr 2022 11:39:02 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Sat, 9 Apr 2022 11:39:01 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2375.17 via Frontend Transport; Sat, 9 Apr 2022 11:38:59 -0700 From: Horatiu Vultur To: , CC: , , , , Horatiu Vultur Subject: [PATCH net 2/4] net: lan966x: Fix IGMP snooping when frames have vlan tag Date: Sat, 9 Apr 2022 20:41:41 +0200 Message-ID: <20220409184143.1204786-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20220409184143.1204786-1-horatiu.vultur@microchip.com> References: <20220409184143.1204786-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org In case an IGMP frame has a vlan tag, then the function lan966x_hw_offload couldn't figure out that is a IGMP frame. Therefore the SW thinks that the frame was already forward by the HW which is not true. Extend lan966x_hw_offload to pop the vlan tag if are any and then check for IGMP frames. Fixes: 47aeea0d57e80c ("net: lan966x: Implement the callback SWITCHDEV_ATTR_ID_BRIDGE_MC_DISABLED ") Signed-off-by: Horatiu Vultur --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index 1f8c67f0261b..958e55596b82 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -446,6 +446,12 @@ static bool lan966x_hw_offload(struct lan966x *lan966x, u32 port, ANA_CPU_FWD_CFG_MLD_REDIR_ENA))) return true; + if (eth_type_vlan(skb->protocol)) { + skb = skb_vlan_untag(skb); + if (unlikely(!skb)) + return false; + } + if (skb->protocol == htons(ETH_P_IP) && ip_hdr(skb)->protocol == IPPROTO_IGMP) return false; -- 2.33.0