From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65B1BC433DB for ; Thu, 21 Jan 2021 04:40:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18FD623888 for ; Thu, 21 Jan 2021 04:40:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731182AbhAUEkI (ORCPT ); Wed, 20 Jan 2021 23:40:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729511AbhAUEDd (ORCPT ); Wed, 20 Jan 2021 23:03:33 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 337D8C061575 for ; Wed, 20 Jan 2021 20:02:53 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id i7so517895pgc.8 for ; Wed, 20 Jan 2021 20:02:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sG+8U2a0VzflH0AQCilm4xiwM2Lp+RWQMQAIENGnnIw=; b=dND3ZqHtHbU9r7q6L/5Z5KJM9n6yPI2SjuXSH2ZpUS288tKvvbT8GcRdlEA1QhKyvf rAgIZis1j9Au4KeIiUZw8N5yjCZsFCTMM1ArwqUr/0Q1YkJsn0Dsa2XjhEUNsdPiX5O8 7yoBS5RhIZUl/J7aPKEAhnwQY0iEZlRwT3515U7WlKdqTrkdhTwNJ+XR+BxuSNiA31wR lMlMRyjJc3+qJdnVx6km+8+uKpxQXlb2Wb1ZBuSb2ay3223xs93iFD7K2vtXdfEJDBVm PXxrHna68yIFgZlL6EgYC+zRyw8pnUK3DwQEu6KAFS4WVxNAyoGMjKeXH96vNCo8WtPN 3O0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sG+8U2a0VzflH0AQCilm4xiwM2Lp+RWQMQAIENGnnIw=; b=Cek3K8zzJLoacVLOHsJZbhNQaMdThHIHmGon3AAp8X7mfvMsU/8uEbdAYQ21adl56M jP+D4di+4MNfp5kHVutvtZsxW+gSgVeZOnszJK4NiZokX+EZWzAQA5YR/4yVBYBozpat 8/cUafS/53f8z76m2il4QO13I/CDrHQSPfvI6YO0Q88Lw+i8V/o+8Xhi4mYAAV403SvF UnMc37KNsGhI4S8QwNn1jU9cLo+5CcX/Dls2HO9Wc5JsfMs499Z6TszNW7JhUtphR0q7 m6DyBkWXxjknsGNSXevq+oVQUr43GdZ+14SPex91Kqjpu9lbFoNYVNyMUQzWZpCzBHl3 7GVQ== X-Gm-Message-State: AOAM531Omf4gZ6ctg8qPwikjuALJpyX9HQJJtThNj4wmbrgmVXQnAllq VPemMl7zvBgz9FMiABk6u+U= X-Google-Smtp-Source: ABdhPJzwmlV0jFIiKSJ448zHTCVV8bamoVvn4EPTLVcYkoNnsSwrxuw8FXuje7os5C9OceLWqggL7g== X-Received: by 2002:a65:4206:: with SMTP id c6mr6298368pgq.262.1611201772644; Wed, 20 Jan 2021 20:02:52 -0800 (PST) Received: from [10.230.29.30] ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 7sm3512263pfh.142.2021.01.20.20.02.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Jan 2021 20:02:51 -0800 (PST) Subject: Re: [PATCH v5 net-next 08/10] net: dsa: felix: convert to the new .{set,del}_tag_protocol DSA API To: Vladimir Oltean , "David S . Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: Andrew Lunn , Vivien Didelot , Richard Cochran , Claudiu Manoil , Alexandru Marginean , Alexandre Belloni , Xiaoliang Yang , Hongbo Wang , Vladimir Oltean , Po Liu , Yangbo Lu , Maxim Kochetkov , Eldar Gasanov , Andrey L , Tobias Waldekranz , UNGLinuxDriver@microchip.com References: <20210121023616.1696021-1-olteanv@gmail.com> <20210121023616.1696021-9-olteanv@gmail.com> From: Florian Fainelli Message-ID: Date: Wed, 20 Jan 2021 20:02:48 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210121023616.1696021-9-olteanv@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 1/20/2021 6:36 PM, Vladimir Oltean wrote: > From: Vladimir Oltean > > In expectation of the new tag_ocelot_8021q tagger implementation, we > need to be able to do runtime switchover between one tagger and another. > So we must implement the .set_tag_protocol() and .del_tag_protocol() for > the current NPI-based tagger. > > We move the felix_npi_port_init function in expectation of the future > driver configuration necessary for tag_ocelot_8021q: we would like to > not have the NPI-related bits interspersed with the tag_8021q bits. > > Note that the NPI port is no longer configured when the .setup() method > concludes - aka when ocelot_init() and ocelot_init_port() are called. > So we need to set the replicator groups - the PGIDs - again, when the > NPI port is configured - in .set_tag_protocol(). So we export and call > ocelot_apply_bridge_fwd_mask(). > > The conversion from this: > > ocelot_write_rix(ocelot, > ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)), > ANA_PGID_PGID, PGID_UC); > > to this: > > cpu_flood = ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports)); > ocelot_rmw_rix(ocelot, cpu_flood, cpu_flood, ANA_PGID_PGID, PGID_UC); > > is perhaps non-trivial, but is nonetheless non-functional. The PGID_UC > (replicator for unknown unicast) is already configured out of hardware > reset to flood to all ports except ocelot->num_phys_ports (the CPU port > module). All we change is that we use a read-modify-write to only add > the CPU port module to the unknown unicast replicator, as opposed to > doing a full write to the register. > > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian