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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4415C43334 for ; Thu, 2 Jun 2022 10:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233513AbiFBKRM (ORCPT ); Thu, 2 Jun 2022 06:17:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230153AbiFBKRI (ORCPT ); Thu, 2 Jun 2022 06:17:08 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E81FE1C8645; Thu, 2 Jun 2022 03:17:06 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id a15so7039600lfb.9; Thu, 02 Jun 2022 03:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=OfL1oE8E5VUJipAihqvicf8O595es3dpUsW+47EuKCY=; b=fPH/OXEF4aWfuqMLZjJjspqSrKGuHIXivBc2TH1XFAnfKX7dIES4CqwmbJkJMkgZaS aLbLeB03ocWh/mJ3KX5nwifk0mqRjdYkZMBcDWNU+J9riwzosD9MqiU8d5k9tTac1P3y 40iICoXleS9wOCo85Jxxwb6xc51YKyEO4qYx1qIDTuLPrxTPr3yRmgeDY+590QOUSf+d ZeLL6yG4Y02fLrfMInR6zJTwvacH5r2oz+VnG5WR/uDN0V7EA9miP+1pwQ5kIhycmtaF C0SdrN0oWry6F4di+poq7ojQ9yHRqyZiRVQkvDkdK4obYqs128afI9ADaLUdaT3YjT1d Fpsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=OfL1oE8E5VUJipAihqvicf8O595es3dpUsW+47EuKCY=; b=aVNlyCFTlLCR6YKWcIkbWD5H61ztGZYLTRJ83BP8qX3pC9OBODu0X/pOFCCQZyI2mw y7DRmFEgn1H6KuQKuHjFAgVkeoTYKfXy0z8s4oF525bney3IqxJ9jB4ja9X+ln4N6gF5 8PuKf4p84JLACETl4GMxEf3oocMxo8TPO5WfhEfW3J3/KXG/dRXUkoETrnHHFQEus6yn sw/JzIsRf+vZLH7KebOW11txv/KWXxX23UKlb40bEO9BdbMZTaq20JNMC3RbYWEDN0qI 97itggczeGixY86q0D1TdEJWn82DBrYeWE9PbWF+/qmnPtHg7bSgIxOLEDqpq8EvFniY UTog== X-Gm-Message-State: AOAM532YtuqOwx7fdhvB/D0fKbqECs00uAEd/tQ7MLYQNRfehyzgt9Md nSI77x3cna0QjiqPR6REyRDMVmQh3lDuJg== X-Google-Smtp-Source: ABdhPJwoXhgkd+mJ5N9o5LUK3SSXkfhC3/uG/ZU+2A8rBS13nRZXnz4HRP9Jj6FhMYPTW7Ck/a9NqA== X-Received: by 2002:a05:6512:3130:b0:479:2e0:631b with SMTP id p16-20020a056512313000b0047902e0631bmr5965447lfd.561.1654165025269; Thu, 02 Jun 2022 03:17:05 -0700 (PDT) Received: from wse-c0127 ([208.127.141.28]) by smtp.gmail.com with ESMTPSA id h16-20020a2e5310000000b0024f3d1dae87sm790662ljb.15.2022.06.02.03.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 03:17:04 -0700 (PDT) From: Hans Schultz X-Google-Original-From: Hans Schultz To: Nikolay Aleksandrov , 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 Subject: Re: [PATCH V3 net-next 1/4] net: bridge: add fdb flag to extent locked port feature In-Reply-To: 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> Date: Thu, 02 Jun 2022 12:17:01 +0200 Message-ID: <86sfonjroi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On tor, jun 02, 2022 at 12:33, Nikolay Aleksandrov wrote: > 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: >> 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 > I also get 0x4 from iproute2, but I still get SELF entries when I look with: bridge fdb show dev DEV >> 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. Okay, so then there is missing checks on flags as the issue arose from replacing locked entries with dynamic entries. I will do another fix based on flags as modified needs to be true for the driver to get notified. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=OfL1oE8E5VUJipAihqvicf8O595es3dpUsW+47EuKCY=; b=fPH/OXEF4aWfuqMLZjJjspqSrKGuHIXivBc2TH1XFAnfKX7dIES4CqwmbJkJMkgZaS aLbLeB03ocWh/mJ3KX5nwifk0mqRjdYkZMBcDWNU+J9riwzosD9MqiU8d5k9tTac1P3y 40iICoXleS9wOCo85Jxxwb6xc51YKyEO4qYx1qIDTuLPrxTPr3yRmgeDY+590QOUSf+d ZeLL6yG4Y02fLrfMInR6zJTwvacH5r2oz+VnG5WR/uDN0V7EA9miP+1pwQ5kIhycmtaF C0SdrN0oWry6F4di+poq7ojQ9yHRqyZiRVQkvDkdK4obYqs128afI9ADaLUdaT3YjT1d Fpsw== From: Hans Schultz In-Reply-To: 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> Date: Thu, 02 Jun 2022 12:17:01 +0200 Message-ID: <86sfonjroi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Bridge] [PATCH V3 net-next 1/4] net: bridge: add fdb flag to extent locked port feature List-Id: Linux Ethernet Bridging List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikolay Aleksandrov , Hans Schultz , Ido Schimmel Cc: Ivan Vecera , Andrew Lunn , Florian Fainelli , Jiri Pirko , Daniel Borkmann , netdev@vger.kernel.org, bridge@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Vivien Didelot , Ido Schimmel , Eric Dumazet , Paolo Abeni , linux-kselftest@vger.kernel.org, Roopa Prabhu , kuba@kernel.org, Vladimir Oltean , Shuah Khan , davem@davemloft.net On tor, jun 02, 2022 at 12:33, Nikolay Aleksandrov wrote: > 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: >> 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 > I also get 0x4 from iproute2, but I still get SELF entries when I look with: bridge fdb show dev DEV >> 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. Okay, so then there is missing checks on flags as the issue arose from replacing locked entries with dynamic entries. I will do another fix based on flags as modified needs to be true for the driver to get notified.