Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp8057309ioo; Fri, 3 Jun 2022 21:30:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHIyuOO9r8wsQ7GvfZC8mzFEpfu/kwo5rpMH8aVBac3Y5LdR9kuJI8Pew3YMpAJJzzKlK9 X-Received: by 2002:a63:87c8:0:b0:3fd:41a7:bcc with SMTP id i191-20020a6387c8000000b003fd41a70bccmr3213486pge.543.1654317034505; Fri, 03 Jun 2022 21:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654317034; cv=none; d=google.com; s=arc-20160816; b=K1xUteM2cbz8T9sp1lHBa9CEk1dJzb+BZZJHMzrQLMT1c0mBd+stcQAlib/Uwhc1uT DDSnBjMo8P4Qi9abuVblC+A7S2Xb4sN7qQfvUJcGLR8NVGlkQnyN46MGdMLulsI6x290 im7fAVStSwqGZ9MqDQSfWepsTTeEZL0WyWYK19zBYcXc1vC+wCCfl2RDIF3QVDVsFyDd mx6T/4HuxmfgKTo/TAVozajdTaUEOBattSx/A7vL2yNoDk7usQ7w/Shc+wp/eEEuVX9e c6Q1517amqMlu6LSgolK8LE2FRFzfwWOgOcXmRcL5M9AXrd43hv7O5oKYEoS0k1dPKDU mYhg== 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=iabOKt8Lt4ClyBb4r4Q/KqHn7Cps1qrTWhdLROC0vws=; b=jQmZFikDmWoVyqenFCjr8zhZ+Y/wyPnwqDVGy5GLExvkrhvDk2fa/VyBWUe9hrDw8T ex/veog+L7dZrLraLfkTEXTvcISQ6J4+Mua8FmHZOcj16KdZMfn8ku3eBCCtTcSKfYBB l7V4uHugJo3TbUaZMBHPgi2ubqti9v0YRABSKnYwp1/4JAyiVRRpKnRa8Mlrdhs4NLsa KYVG/Da6Y0hlXfGqW+gm40LNRqFp29E3zDD/bajRE7b0LPhTzN+HRN/RC0105aHWtOq0 kFvUJqFOcn2dIJbYAD2nqO4iOOw6yGNKPrbwYQuPWMa5cQoe9pK/bcZNqN/6MCWNm/zj vGxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@blackwall-org.20210112.gappssmtp.com header.s=20210112 header.b=VQCl9uRJ; 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 h11-20020a170902eecb00b00161f8628ed7si11316072plb.238.2022.06.03.21.30.01; Fri, 03 Jun 2022 21:30:34 -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=VQCl9uRJ; 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 S233877AbiFBKaW (ORCPT + 99 others); Thu, 2 Jun 2022 06:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233909AbiFBKaL (ORCPT ); Thu, 2 Jun 2022 06:30:11 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF1C1BE80 for ; Thu, 2 Jun 2022 03:30:09 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id me5so8566753ejb.2 for ; Thu, 02 Jun 2022 03:30:09 -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=iabOKt8Lt4ClyBb4r4Q/KqHn7Cps1qrTWhdLROC0vws=; b=VQCl9uRJ1U9yzv+giXqEkz6Z1yMCqEp3hD2gW4Jaw5s1Ewt13S9ZakS15xCYWgi3dv xayD1UAWLjkxDApMnNgrFpkP1w09bQiGAG1jDOT96JEC8CsV4tlBXUJHtyiCTPMsiDZx Ayt7KUdq8NRJLYDz2WlL2v8d2xGg5Kc1SDjshNLy/xPvE3M4zaxkKtVQdbvoCpaT8Fwp zD8In4NBTo53lm8LB1BxmK9EXteWssgCifKEmDLsDDB4VC2y7OtAmcxx/TCoq8dQR+2r 9Ma6Txx/6cNyejFL24zKary5+Wajx7zFRWu44J5LchvKYmsCy0hhGgqcVVhxQ0Qdw/dh EJxA== 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=iabOKt8Lt4ClyBb4r4Q/KqHn7Cps1qrTWhdLROC0vws=; b=sP/11nkjpyjClFHvbC6gv3tlz9T6f8BYUw+zNz8hx/DMP9Z2WFYwE2e4Q/ldoeVBwk 9BNOUBtkJsv9pWrkcyDB3UjQPEEoLYNXnRd13rdOZ1BcWMWlAF09o5fXc89Dwc2Qfhew oiiC5jP0tJIB4GvDhI8ZCNNBLhTf++iAo64Uy39UVqfctRtoQaUCJ3FS56uh3cAchiyu JUBCo2ojOKykHJ2SGoB6r5gTC0qMzdKIXZfO9L0EJRn2hblVMw49QdhYexLtVQ0xHTKZ oAdiPo6TQ2h8OO1SW6zyL9QytSrD+iBanw+IqUM4OgLMXZQQGlFc9EJbXI7VgFfQVkNL E01Q== X-Gm-Message-State: AOAM532PrqVepIZA0KX/g2YViLRIxXWSkXG82fdFzeouGlkNGAWH7/fB Y01QS/SfEZ+i/R6EK8J0cANzuA== X-Received: by 2002:a17:907:3e07:b0:6fe:fdf9:2c2e with SMTP id hp7-20020a1709073e0700b006fefdf92c2emr3609612ejc.378.1654165808343; Thu, 02 Jun 2022 03:30:08 -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 oy9-20020a170907104900b006fe99b66198sm133279ejb.60.2022.06.02.03.30.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jun 2022 03:30:07 -0700 (PDT) Message-ID: <3d93d46d-c484-da0a-c12c-80e83eba31c9@blackwall.org> Date: Thu, 2 Jun 2022 13:30:06 +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> <86sfonjroi.fsf@gmail.com> From: Nikolay Aleksandrov In-Reply-To: <86sfonjroi.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=unavailable 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 13:17, Hans Schultz wrote: > 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 > after the above add: $ bridge fdb show dev vnet110 | grep 00:11 00:11:22:33:44:55 master virbr0 static >>> 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.