Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1166224pxb; Wed, 10 Feb 2021 01:31:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJyayBk4G08HAnD0vRYCjNvgB4KHJnJp64WSDoJE208HiviPIO6YxLa0wBr0Rz0wWzX2ADrN X-Received: by 2002:a17:906:149a:: with SMTP id x26mr2068922ejc.486.1612949497079; Wed, 10 Feb 2021 01:31:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612949497; cv=none; d=google.com; s=arc-20160816; b=Bq0hkANI/ExOIfyfU3Cn1UTeqTdlKrFt+QqykayIiipoNPN8Liv02W8AXJSc2gldfP J5D1I19F6i3GETT41Utaz2fDGBbn6Rv467nQWB0ziaAJCdddfCZU1DEcHLrzNt1cAYyv /Y/ncjW+fNAVLeTs39EvQ7ImKDQNVqgYVcdxYklapjbqm7QCvoJP5yJZ6STiDQbcqZV0 7gFn7eAa4elQ524VrBvqOV2JHESPo9/WzK7nh6wn+L3It7AEMgmRnRS+maU7/l/J0wR2 5xlVGNuP3uFQktuBSkBIQJWoZHgcg7PKYpuhyPVWpcOgy8ABSyWeEXjJ0rrIsKeiHUaJ +XfQ== 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=VuZTEPYHMg3ShgofbvGoqs9eGEg01aAq4yuwAM+XNnk=; b=r56BJclAie+ij5YiIO3Hd4QFUkjvvjv/318tDGCPf2wZy9hKuRA7xjfHI7VO3ppaya x9VJlANiDk10kAW5Asi2ms5SNjLIHqPvfzVGl2RFFuajYK4aQBhnGIhhy6JHlnwDI0qh HFSAIPUEVC6XVvpRh8C4d36DLCcA7Tu6FuCrbegsKmfjsC5/HfgulW6rjbPIVYNQXNLR JAdjfa2QxeBPF3KpuP6YQYnPQxdUT5qWz5l2mLpMjlYv7LrW2AB/u5hmztXsAaS5KwRv HRo9PIA0wdSuPHKtyPAvFBfAf04qdXI0S6bG8aqqbvckZqGIm3Iky/gH8HNJEZPqJKdp viDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=llFPHmLv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f7si1168591edd.574.2021.02.10.01.31.12; Wed, 10 Feb 2021 01:31:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=llFPHmLv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbhBJJ2U (ORCPT + 99 others); Wed, 10 Feb 2021 04:28:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbhBJJVg (ORCPT ); Wed, 10 Feb 2021 04:21:36 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13555C0617AB; Wed, 10 Feb 2021 01:19:29 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id i8so2804091ejc.7; Wed, 10 Feb 2021 01:19:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VuZTEPYHMg3ShgofbvGoqs9eGEg01aAq4yuwAM+XNnk=; b=llFPHmLvhLGFXxaCSMKvKR0NGGdq6GpGMXgrxyQCDOIka8JKqsSparIRtSjxe96eV1 DHAkUwEu0RHu21UwzoqJNk2/ES3lCxlHp1SQwMW1zX1QHHygDY3K01k0veSt5SnBsnxv ALD7cEku3cRKPvRv8fNNkrIRvtsA7BH0TeuE46Xeq0u6dRvaLCprMdoBvt8t8k4QUD2E +WShvWxi4FimoshbiVNux+9Hb1TUQBfZwcSxAPbJXFOE5UuxnZ68ZXAgSvC+KhG7WJAM 3moz+4OzfhfsPP1hU2RS6R6Trf7KDZSRTXPGuq2o0t3oYdwseF55pmEDunto0I/YtVsr JK1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VuZTEPYHMg3ShgofbvGoqs9eGEg01aAq4yuwAM+XNnk=; b=pzfORhHva38Vna/QgE6hfgA0NM6A9bCIBgqptN8h/Qi3Tz4GxGeVkEyJRtvNsPRsSW kFNHdVSVVSFzWlbfnQ8T8BuHNYgMxPcLnpxT8NhLLnguPwMFFMZJ3jAW60ug+mkTP2pF Ry/uowgdZK1JQP9Tfh/CRjkIGZzfOQPG/DV9JyAtgaR9k4FFqac250ceEJNVbL88khOU 0yPxxo/hRKLAqBmDw8dyRVcMVotl0t0YPLdicgJkD6p9XTS42ByQxaB3wS1uKIDtDtfz pBZtCfDuYkBpjDYWbn12lPuBsu2poWhHxyMYdKrObPzL4yJqQOLihp+DtdKllwObQYl9 +b6A== X-Gm-Message-State: AOAM530OppDSwFJ90s3ZzAtgsRiLnGAumb5V/vHLeINVD6g6epyGDDN2 VYFDBXU+9++xTLBSdnumMdE= X-Received: by 2002:a17:907:262b:: with SMTP id aq11mr1987073ejc.360.1612948767790; Wed, 10 Feb 2021 01:19:27 -0800 (PST) Received: from localhost.localdomain (5-12-227-87.residential.rdsnet.ro. [5.12.227.87]) by smtp.gmail.com with ESMTPSA id u2sm701801ejb.65.2021.02.10.01.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 01:19:27 -0800 (PST) From: Vladimir Oltean To: Jakub Kicinski , "David S. Miller" Cc: Andrew Lunn , Vivien Didelot , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, Roopa Prabhu , Nikolay Aleksandrov , Jiri Pirko , Ido Schimmel , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Vadym Kochan , Taras Chornyi , Grygorii Strashko , Ioana Ciornei , Ivan Vecera , linux-omap@vger.kernel.org Subject: [PATCH v3 net-next 09/11] net: mscc: ocelot: use separate flooding PGID for broadcast Date: Wed, 10 Feb 2021 11:14:43 +0200 Message-Id: <20210210091445.741269-10-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210210091445.741269-1-olteanv@gmail.com> References: <20210210091445.741269-1-olteanv@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Oltean In preparation of offloading the bridge port flags which have independent settings for unknown multicast and for broadcast, we should also start reserving one destination Port Group ID for the flooding of broadcast packets, to allow configuring it individually. Signed-off-by: Vladimir Oltean --- Changes in v3: None. Changes in v2: None. drivers/net/ethernet/mscc/ocelot.c | 13 ++++++++----- include/soc/mscc/ocelot.h | 15 ++++++++------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index f8b85ab8be5d..8c1052346b58 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -1662,7 +1662,7 @@ int ocelot_init(struct ocelot *ocelot) /* Setup flooding PGIDs */ for (i = 0; i < ocelot->num_flooding_pgids; i++) ocelot_write_rix(ocelot, ANA_FLOODING_FLD_MULTICAST(PGID_MC) | - ANA_FLOODING_FLD_BROADCAST(PGID_MC) | + ANA_FLOODING_FLD_BROADCAST(PGID_BC) | ANA_FLOODING_FLD_UNICAST(PGID_UC), ANA_FLOODING, i); ocelot_write(ocelot, ANA_FLOODING_IPMC_FLD_MC6_DATA(PGID_MCIPV6) | @@ -1683,15 +1683,18 @@ int ocelot_init(struct ocelot *ocelot) ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_SRC + port); } - /* Allow broadcast MAC frames. */ for_each_nonreserved_multicast_dest_pgid(ocelot, i) { u32 val = ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports - 1, 0)); ocelot_write_rix(ocelot, val, ANA_PGID_PGID, i); } - ocelot_write_rix(ocelot, - ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)), - ANA_PGID_PGID, PGID_MC); + /* Allow broadcast and unknown L2 multicast to the CPU. */ + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_MC); + ocelot_rmw_rix(ocelot, ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)), + ANA_PGID_PGID, PGID_BC); ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV4); ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, PGID_MCIPV6); diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index d0d48e9620fb..7ee85527cb5f 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -54,16 +54,17 @@ * PGID_CPU: used for whitelisting certain MAC addresses, such as the addresses * of the switch port net devices, towards the CPU port module. * PGID_UC: the flooding destinations for unknown unicast traffic. - * PGID_MC: the flooding destinations for broadcast and non-IP multicast - * traffic. + * PGID_MC: the flooding destinations for non-IP multicast traffic. * PGID_MCIPV4: the flooding destinations for IPv4 multicast traffic. * PGID_MCIPV6: the flooding destinations for IPv6 multicast traffic. + * PGID_BC: the flooding destinations for broadcast traffic. */ -#define PGID_CPU 59 -#define PGID_UC 60 -#define PGID_MC 61 -#define PGID_MCIPV4 62 -#define PGID_MCIPV6 63 +#define PGID_CPU 58 +#define PGID_UC 59 +#define PGID_MC 60 +#define PGID_MCIPV4 61 +#define PGID_MCIPV6 62 +#define PGID_BC 63 #define for_each_unicast_dest_pgid(ocelot, pgid) \ for ((pgid) = 0; \ -- 2.25.1