Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6781770ioo; Thu, 2 Jun 2022 13:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuyL4k5DHHDp7h4wRWLX+xKi6JXWYTgt9eRuCY+O6nMSpt2U+KXGdRUZpY1LYwzTYZlgVG X-Received: by 2002:a17:902:d4c2:b0:166:46c9:577b with SMTP id o2-20020a170902d4c200b0016646c9577bmr3621410plg.66.1654202366369; Thu, 02 Jun 2022 13:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654202366; cv=none; d=google.com; s=arc-20160816; b=homioToYnazSZMraCA+0qzibyluZ9sOqexkIxc8HhdY6G3yO99j8W9ry6UbELEoHUf YJH7C8siBnChKX6YkN3GW3WTBZz7NVixAdMpEoLrL9rdeJh0SlW+GjwxPp4TIqPFcyIs BbRfw2zToJeo2Byya93b/N0Zqg6pz3IZ1QvTRPuiD/Drqi7zD6rvmcYgKpGLUAcqHgqY JSrdLx4p48KOyibRgNWvs+efthIHGIm2G1vg9KnHjNij284EPIOFpg4d3o1glc8gyT7v SyB49yMRg5SQUOl5gTgHiu0BmqjGoHMJ37uhF/gQhga/hOiEvFqB/9Dms4ZpsJ5b2bVX 5pTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jLhgLLgTKtoWPjtFp8qSJCOCQYPPUCR4lznJBFvpJ40=; b=SRJnLAkK+HAaoRSySX92qQ3l15hIDVG2jkVJe4rgZywSOlkP7TX12LBwgTwUb1+ZOU 1VJEHlGWYlUoAG/fLgGIdV3ypgFXFR0/7vGsmtpr7aP/5kfumFLhJ13nTQ77W34E4l8/ V2ypnEmavBPIIR656UBrInnlAzXJ/YPSf/NxL5jZzqjNhqlrIanVoDpVywcxlifkVnPJ ENpNPFmuGPNpNAlj4BOl6Uix473i+1Eh50eioskO+UIX7LFHF2+zBai2xSA1SjBvwrvo zFsyfQXsuUg2YMMB+1NRoDQxzxTHYwRfqGA+MhqNPqQpKifc56Zg4v4H6d12ACHjzF6D EM7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b="U2/PO1uN"; 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 gm1-20020a17090b100100b001e31dce0eb8si6763312pjb.62.2022.06.02.13.39.14; Thu, 02 Jun 2022 13:39:26 -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=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b="U2/PO1uN"; 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 S232296AbiFBJdq (ORCPT + 99 others); Thu, 2 Jun 2022 05:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbiFBJdo (ORCPT ); Thu, 2 Jun 2022 05:33:44 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93440DEEB for ; Thu, 2 Jun 2022 02:33:38 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id n28so5483238edb.9 for ; Thu, 02 Jun 2022 02:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=jLhgLLgTKtoWPjtFp8qSJCOCQYPPUCR4lznJBFvpJ40=; b=U2/PO1uNjGw4COGMRK/7YnRCnLhzHnfNDU3fAZ5Gx+P/GW9LrdqG3I45ITG643pzdb JG96C8RFIxHaJo6jdq6DH8J0mqrH0Bz1LFAyLJSsLa4UaZpclulO0L4GHi+89g9+1pnR HDM6h3Y5186RpYH4+PvFGvDR2Ik+oyncwi5oGmQCSvo+gPTdzOt12QXk6cniH/TCtech Vq3liKmSG0Xman0T2LN3WT0Wj/eUgaio4p3CEkzLOQrTkoGzCA/fMFr6AeOL1HJpIUZ2 C0wbKaR6CbkPBGYPA6Dz6XgoxKgg/nkvNXlWjX0lgXr+zdmUXLKioQVm/Tf/NW942v7j a/3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=jLhgLLgTKtoWPjtFp8qSJCOCQYPPUCR4lznJBFvpJ40=; b=EixkUcJPFzpMbPe6PclbfMocIbXyrRnCiH+rf5yh2pDvMQKBp5DmqrbP/hyMBDcKj9 miqwyrau6Wj/D6vM0GJbHx6XC9FqyZ4BZsIm9v3CnUvB4YLHOFWoTJIWy3GMdqO1UGur xXWYNqqMpXAQaNhf/tKT9fqG2IlblDWu/G08nj34QMDhYAV8io7iY4pkW5/6u+I226x3 KKEDo6hIRfryVdFWqA+hSRRuj/AL+U40NLCCncV7p8Lbps3ob57mdakRwoiTegq9A2Sj ddbOjbqzOdIBALEjX+4fdBEJ/+dR8KXV3I3VdqetofWDWhEOGerg7J5o6OGTSOPkyAYf iXXg== X-Gm-Message-State: AOAM533aUmoEkWF/r7y5JVzQYJsurMyWrBRZ7zevgTyvcEhWj9GJtPzG 8raBdqtSrT22YL7WZOAahIcKyw== X-Received: by 2002:aa7:c34d:0:b0:42d:ce57:5df2 with SMTP id j13-20020aa7c34d000000b0042dce575df2mr4213121edr.315.1654162416951; Thu, 02 Jun 2022 02:33:36 -0700 (PDT) Received: from [192.168.0.111] (87-243-81-1.ip.btc-net.bg. [87.243.81.1]) by smtp.gmail.com with ESMTPSA id lk24-20020a170906cb1800b006fa84a0af2asm1596415ejb.16.2022.06.02.02.33.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jun 2022 02:33:36 -0700 (PDT) Message-ID: Date: Thu, 2 Jun 2022 12:33:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH V3 net-next 1/4] net: bridge: add fdb flag to extent locked port feature Content-Language: en-US To: Hans Schultz , Ido Schimmel Cc: Ido Schimmel , davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , Eric Dumazet , Paolo Abeni , Jiri Pirko , Ivan Vecera , Roopa Prabhu , Shuah Khan , Daniel Borkmann , linux-kernel@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kselftest@vger.kernel.org References: <20220524152144.40527-1-schultz.hans+netdev@gmail.com> <20220524152144.40527-2-schultz.hans+netdev@gmail.com> <86sfov2w8k.fsf@gmail.com> <86sfoqgi5e.fsf@gmail.com> <86y1yfzap3.fsf@gmail.com> From: Nikolay Aleksandrov In-Reply-To: <86y1yfzap3.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, 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 On 02/06/2022 12:17, Hans Schultz wrote: > On tis, maj 31, 2022 at 17:23, Ido Schimmel wrote: >> On Tue, May 31, 2022 at 11:34:21AM +0200, Hans Schultz wrote: >>>> Just to give you another data point about how this works in other >>>> devices, I can say that at least in Spectrum this works a bit >>>> differently. Packets that ingress via a locked port and incur an FDB >>>> miss are trapped to the CPU where they should be injected into the Rx >>>> path so that the bridge will create the 'locked' FDB entry and notify it >>>> to user space. The packets are obviously rated limited as the CPU cannot >>>> handle billions of packets per second, unlike the ASIC. The limit is not >>>> per bridge port (or even per bridge), but instead global to the entire >>>> device. >>> >>> Btw, will the bridge not create a SWITCHDEV_FDB_ADD_TO_DEVICE event >>> towards the switchcore in the scheme you mention and thus add an entry >>> that opens up for the specified mac address? >> >> It will, but the driver needs to ignore FDB entries that are notified >> with locked flag. I see that you extended 'struct >> switchdev_notifier_fdb_info' with the locked flag, but it's not >> initialized in br_switchdev_fdb_populate(). Can you add it in the next >> version? > > An issue with sending the flag to the driver is that port_fdb_add() is > suddenly getting more and more arguments and getting messy in my > opinion, but maybe that's just how it is... > > Another issue is that > bridge fdb add MAC dev DEV master static > seems to add the entry with the SELF flag set, which I don't think is > what we would want it to do or? I don't see such thing (hacked iproute2 to print the flags before cmd): $ bridge fdb add 00:11:22:33:44:55 dev vnet110 master static flags 0x4 0x4 = NTF_MASTER only > Also the replace command is not really supported properly as it is. I > have made a fix for that which looks something like this: > > diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c > index 6cbb27e3b976..f43aa204f375 100644 > --- a/net/bridge/br_fdb.c > +++ b/net/bridge/br_fdb.c > @@ -917,6 +917,9 @@ static int fdb_add_entry(struct net_bridge *br, struct net_bridge_port *source, > if (flags & NLM_F_EXCL) > return -EEXIST; > > + if (flags & NLM_F_REPLACE) > + modified = true; > + > if (READ_ONCE(fdb->dst) != source) { > WRITE_ONCE(fdb->dst, source); > modified = true; > > The argument for always sending notifications to the driver in the case > of replace is that a replace command will refresh the entries timeout if > the entry is the same. Any thoughts on this? I don't think so. It always updates its "used" timer, not its "updated" timer which is the one for expire. A replace that doesn't actually change anything on the entry shouldn't generate a notification.