Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp909649rwi; Thu, 20 Oct 2022 06:41:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UkIjls+rDdBZMqJg204a4qiTYF2RXldrJUDFx3iygUf1PmEVDDcgYPIdpHexToTWnKMWt X-Received: by 2002:a17:907:9707:b0:78d:45d1:487e with SMTP id jg7-20020a170907970700b0078d45d1487emr10919229ejc.566.1666273274885; Thu, 20 Oct 2022 06:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666273274; cv=none; d=google.com; s=arc-20160816; b=EsMNzxZX6GZf+eURPECQk4BI/CfTUVfgC0+59yMzTJ7myX0xPdPOZ+AqIXeLBbiyew cMoVPRHexhZImDdur2FlHNbsuK8paEok3uk2IPB/+X2ux5yjTkYyuWI7GmekK4dEi2uK PSaTVacQExo9e65bxk9QZvlkI5/N/s06VCMBjpCX2hc+/7tb294WFTpLnyQvN/DFVe5k bgXgc96ThXQkaFAq7zvBc26e612jte0xLA9RC5t+rWbMBHdecgn+gFctd62bM6EQaO0P QPwwbKbcVOtEvnXT+yOIShMWA0zPG7URrR7l6EjXcOB6NyV9b1Sqi8PFulXhkDxb2Zf0 4obQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X+gkU/NqbzBkggz5iJ5jkNMymmdjI88HmNgirY0p7mo=; b=a4ZHb05Nf6cc86BFzoiPBJMatHCsXbK5isV8m40Hx18poTVU+7YHogVdt1XnlqufMw 8m11sXHNLPfRqR2VlmZOP66W4dK234Wg94neMCJ9V/idzt8w4hgZUrmeNRaKIEvFWUSw V1nXLFYVqM3RSx6oRGp2VlYZYZS5ewtGmGhP8Sc7HHECwRiyiZnOyrjceZuVK0jFvEhB IHQCW1cmb60BHEUil4rnbfFiybOD9uFunvndQrpY6EbOtfF3tU0CD67Iy7kApRHhUDgI Iz4Bei+KqTzeq+TdbGj6NeozKtfdH1pM6BJ21PBEeXW3zwq7d+HmGdgoR3beSGHT5Q50 XNNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TPiipjpD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a056402500b00b0045d212cc170si16277606eda.363.2022.10.20.06.40.48; Thu, 20 Oct 2022 06:41:14 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=TPiipjpD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230183AbiJTNMx (ORCPT + 99 others); Thu, 20 Oct 2022 09:12:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbiJTNMu (ORCPT ); Thu, 20 Oct 2022 09:12:50 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1D031D4DE7; Thu, 20 Oct 2022 06:12:19 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id k2so47315625ejr.2; Thu, 20 Oct 2022 06:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=X+gkU/NqbzBkggz5iJ5jkNMymmdjI88HmNgirY0p7mo=; b=TPiipjpDMk6wGWOJP+Agw+/0B6vH+/ztEW3I5tVyt2LoCYXke1TXQmFBwagKR/ECpK gEOm4H8c5qA8hZGz4VSJZPpkqt/IbvYZ19Te5+K8V6qcAjLW+yd00jruzQfGjWyTw1cr D5eAElpBXfz6xrI/19Get5d4/+bXbVvXDLrr4XJpc6KgZGXdlyBIfs1ftcluwlcs3TzI FPdNNA1X3wp1dFiIVzbhTRBNAtVDAHuEP77BPZNag0f6UGW/O85leK27nNsrOFr5A8gj BturwMnkyEbZpgiYOgFFYhxOalzV668fNDGJNiEqvHrmEQZIJTIN3mr4jmBQMU8LwU4k tOOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=X+gkU/NqbzBkggz5iJ5jkNMymmdjI88HmNgirY0p7mo=; b=7W7IWtjwhgG9FLm3wGD0kh4eBSTZZODWU5sd/gUIj2L4CyJZCAXh0iZ6T30vhGLLaq N7gBMAnqxK8/cuti85vZB2T2DhsxxQLkUz1d4FgGtthnpxSXkjJsISUEWPjCIx8egEJx NxxI84cqJzZWtpHWSPjnsv5beFyZjkKjKt9k87F2rhREmOC+7p+80LNN0PMO8aUDpdyD lQ4nN1hmcAKETXLP3ZC8qvBASh7NTTcMbqoMhW83LCvdP7V1Ig88PViuzdq8pY4zvlCk KhaQiUESTwnjgrTYF9l4Xrj2WVZ4wUGOPZiKMvJUN+IAt2F8XUndvaahNvZq0/1pnT+9 20Gg== X-Gm-Message-State: ACrzQf0lyu97Oqb28xFSpVKHGcl82Hf2k2iuWcSGZMqfDfAxBWI9EyCn znL4cnPSZFDTLtDUeEW/+kWUBsy9Y6Ucww== X-Received: by 2002:a17:906:db0d:b0:77b:a7cd:8396 with SMTP id xj13-20020a170906db0d00b0077ba7cd8396mr11433584ejb.264.1666271466154; Thu, 20 Oct 2022 06:11:06 -0700 (PDT) Received: from skbuf ([188.27.184.197]) by smtp.gmail.com with ESMTPSA id w11-20020a170906d20b00b0078258a26667sm10359958ejz.52.2022.10.20.06.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 06:11:04 -0700 (PDT) Date: Thu, 20 Oct 2022 16:11:01 +0300 From: Vladimir Oltean To: "Hans J. Schultz" Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Florian Fainelli , Andrew Lunn , Vivien Didelot , Eric Dumazet , Paolo Abeni , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Shuah Khan , Russell King , Christian Marangi , Daniel Borkmann , Yuwei Wang , Petr Machata , Ido Schimmel , Florent Fourcot , Hans Schultz , Joachim Wiberg , Amit Cohen , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v8 net-next 11/12] net: dsa: mv88e6xxx: add blackhole ATU entries Message-ID: <20221020131101.zotvyglhlayqdvu7@skbuf> References: <20221018165619.134535-1-netdev@kapio-technology.com> <20221018165619.134535-12-netdev@kapio-technology.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221018165619.134535-12-netdev@kapio-technology.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2022 at 06:56:18PM +0200, Hans J. Schultz wrote: > Blackhole FDB entries can now be added, deleted or replaced in the > driver ATU. Why is this necessary, why is it useful? > > Signed-off-by: Hans J. Schultz > --- > static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port, > const unsigned char *addr, u16 vid, > u16 fdb_flags, struct dsa_db db) > @@ -2742,9 +2794,10 @@ static int mv88e6xxx_port_fdb_add(struct dsa_switch *ds, int port, > struct mv88e6xxx_chip *chip = ds->priv; > int err; > > - /* Ignore entries with flags set */ > - if (fdb_flags) > + if (fdb_flags & DSA_FDB_FLAG_LOCKED) > return 0; I don't understand this. If no driver looks at DSA_FDB_FLAG_LOCKED (not even mv88e6xxx, up until the end of the series), then why was it propagated all the way in the first place? > + if (fdb_flags & DSA_FDB_FLAG_BLACKHOLE) > + return mv88e6xxx_blackhole_fdb_add(ds, addr, vid); > > if (mv88e6xxx_port_is_locked(chip, port)) > mv88e6xxx_atu_locked_entry_find_purge(ds, port, addr, vid); > @@ -2765,9 +2818,10 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, > bool locked_found = false; > int err = 0; > > - /* Ignore entries with flags set */ > - if (fdb_flags) > + if (fdb_flags & DSA_FDB_FLAG_LOCKED) > return 0; > + if (fdb_flags & DSA_FDB_FLAG_BLACKHOLE) > + return mv88e6xxx_blackhole_fdb_del(ds, addr, vid); > > if (mv88e6xxx_port_is_locked(chip, port)) > locked_found = mv88e6xxx_atu_locked_entry_find_purge(ds, port, addr, vid); > -- > 2.34.1 >