Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1796483pxp; Thu, 10 Mar 2022 12:21:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFH+/Q1S8P0lFJyKZoKro5tWl9tXsQFfad4FWnHnJql3JBJY9ChwJmOPHytRmfImTA1dWo X-Received: by 2002:a05:6402:11c6:b0:416:3751:d700 with SMTP id j6-20020a05640211c600b004163751d700mr6180892edw.97.1646943687335; Thu, 10 Mar 2022 12:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646943687; cv=none; d=google.com; s=arc-20160816; b=ODEvGKaLe6KIK6efG2JQ6/6E8ZsVQqiVok7zcXe3+feMZ/fCDq7xsHOrfgiCHZ4QYe Rp4etVJvciapePsSiLPE4iRHaP2MAd7FefR57QqV5j2DoLQo8RYt3w9Ea76uFGIekaqM GHcqV05Tqrgl2GYWdyrH8wguAM+m0xStSTAo1siaBm5FQYhL6oe5IwHBpxN5JTWZe9BE FmtrheAQVS8Tjwpoe5z/KgozT6urPClo6sPKxYQqGhtS16j/zHGKcHv1A+u71A/l7meV XjLlL+6Gn5l/53arwRIz9lcGsMsV3mAth91p04+4ARjc4K+bQ53nzzIBZckTuu1Za23v 57wg== 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=/58cWmygECTkPSPoDwqtqviybzKgiSNcNrLHiVOqlDE=; b=N3rBrw/oaiFlaTmpJq2PtU29F9CusZHV1vtwRPwRcSjxo34wiNam0Td9W9zPX20Ign y2qCZ9eKxdwh2SuXZW2pQRqtY9ES9GVSLdTt4F29xBD1OMLcuYPdy08Pqe1fi53nMN8g 59Bt7HfucJJrfdJwu0na/GF8HJTGcsVHHW5RrWMNZbhVp9Xs3l5wXVkSihB83nIhPP01 PLp5Msi4lyuQffOGnKla0IqsIz8IEjrqKeMVzCN5JESy4sp4WG5vee/a6Z0T2rpBeWZR 6RuMbHBaJUWMhHQITDmXhPtVrPQrUDuYFMfM1AhszZ3DKo4SeaaNOgnk81kDTjxj+jhu JJHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="h7/+Dopd"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji12-20020a170907980c00b006db35ceb7e8si4027485ejc.284.2022.03.10.12.21.03; Thu, 10 Mar 2022 12:21:27 -0800 (PST) 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=@lunn.ch header.s=20171124 header.b="h7/+Dopd"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236397AbiCJPFv (ORCPT + 99 others); Thu, 10 Mar 2022 10:05:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344491AbiCJPDv (ORCPT ); Thu, 10 Mar 2022 10:03:51 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EED77199E22; Thu, 10 Mar 2022 06:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=/58cWmygECTkPSPoDwqtqviybzKgiSNcNrLHiVOqlDE=; b=h7/+DopdaFXY6RnCGoW2MCpXek qjKJbQBjWD3BTW7lvhC3/IM7+YQ0Ur/v7fTn0R3Vn7u1Mj6C3SL/3JtCokFcECooPEFCCJLW+1jqP 5EOLJB2P4lgIuPexvsE5raXxdasl+V1XPBy6P/+7lChYHfG1j1xhM21wZXl8I7mPu0cc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nSKBv-00A9LI-05; Thu, 10 Mar 2022 15:54:59 +0100 Date: Thu, 10 Mar 2022 15:54:58 +0100 From: Andrew Lunn To: Hans Schultz Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Hans Schultz , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Nikolay Aleksandrov , Daniel Borkmann , Ido Schimmel , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org Subject: Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: mac-auth/MAB implementation Message-ID: References: <20220310142320.611738-1-schultz.hans+netdev@gmail.com> <20220310142320.611738-4-schultz.hans+netdev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220310142320.611738-4-schultz.hans+netdev@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 > + if (mv88e6xxx_port_is_locked(chip, chip->ports[spid].port)) > + err = mv88e6xxx_switchdev_handle_atu_miss_violation(chip, > + chip->ports[spid].port, > + &entry, > + fid); > +static int mv88e6xxx_find_vid_on_matching_fid(struct mv88e6xxx_chip *chip, > + const struct mv88e6xxx_vtu_entry *entry, > + void *priv) > +{ > + struct mv88e6xxx_fid_search_ctx *ctx = priv; > + > + if (ctx->fid_search == entry->fid) { > + ctx->vid_found = entry->vid; > + return 1; > + } > + return 0; > +} > + > +int mv88e6xxx_switchdev_handle_atu_miss_violation(struct mv88e6xxx_chip *chip, > + int port, > + struct mv88e6xxx_atu_entry *entry, > + u16 fid) > +{ > + struct switchdev_notifier_fdb_info info = { > + .addr = entry->mac, > + .vid = 0, > + .added_by_user = false, > + .is_local = false, > + .offloaded = true, > + .locked = true, > + }; > + struct mv88e6xxx_fid_search_ctx ctx; > + struct netlink_ext_ack *extack; > + struct net_device *brport; > + struct dsa_port *dp; > + int err; > + > + ctx.fid_search = fid; > + err = mv88e6xxx_vtu_walk(chip, mv88e6xxx_find_vid_on_matching_fid, &ctx); I could be reading this code wrong, but it looks like you assume there is a single new entry in the ATU. But interrupts on these devices are slow. It would be easy for two or more devices to pop into existence at the same time. Don't you need to walk the whole ATU to find all the new entries? Have you tried this with a traffic generating populating the ATU with new entries at different rates, up to line rate? Do you get notifications for them all? Andrew