From patchwork Mon Jun 28 21:59:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 468180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 308A0C11F64 for ; Mon, 28 Jun 2021 22:01:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0DE6661CF9 for ; Mon, 28 Jun 2021 22:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237015AbhF1WD3 (ORCPT ); Mon, 28 Jun 2021 18:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233976AbhF1WDH (ORCPT ); Mon, 28 Jun 2021 18:03:07 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6C5FC061766 for ; Mon, 28 Jun 2021 15:00:37 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id i5so28291400eds.1 for ; Mon, 28 Jun 2021 15:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8q4kkEQ6fmMwH2vZZgk3RBl2nTpfC/5pzFbK/qkE2Zg=; b=BDTbf4Rqjae5preCqMBM7V+YWwVpfVYwi+WnxouCpz++sQZoDjzPVmFs3DFVNWCreR OubOX7aohHbe4wl/SMaiEHPVJ/ZeizVRw/RSU9J7KqjOARLnPSmMK0wRTvF3IyslHU8A UPCfc7K/MqOmdv5Uxkl6nwM67CSHI6YrNIexqFUxLfIrVS7+rtp6Oul8aB/Wxz88E+DO U7BwoIVrslfrJdp4ov55V1erSJIyZoWIUXbjCzzlV2UZ2cpF9ALlv6+iWqOKF3h3WZrz r8ah9hI7hms6ahWb335CDRQMZDBbUeZhKgEXlelg6AuJZQJXKwqNLY8qD6KCNIo66EiR P3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8q4kkEQ6fmMwH2vZZgk3RBl2nTpfC/5pzFbK/qkE2Zg=; b=duaAy98gfXDNeW4mt7jrXsLvv+N0j2JH43ob7ZU3HAyTOW2CyFWxD1mJqolKD+3hr6 KCivU+IpBXrU5M6XqBieXxZI6XVbKTse8QEt+Cefg5qnejNBCSB43sEdtzyTEGLQs7zn mv7L5u/xEBwpBdBVtgo238a8RjRHISZuttfUVsy9T1vLjgGAQa5l22/Fm6yJUqp4/2eR 0HyOicba2V4KJ1V8N4tItYwQ0Go2Dis+uBj243vHmmNwdRHC+RIMroX5r4wsLIrw/3Dk aL/T5+8snijUfpZcm/n7qCYKHM2kV7IimBUeN+A3v0ThLSyPsMxN05RiwVdYfhTAFF/J Gf2A== X-Gm-Message-State: AOAM532fJOXPpk2bQmbmhBXPbSBcCyKM1t3CvFBIyW1esvKboJ89GeNi mkZ7DK3z+6f8obD0LjJDwusprCbhJKw= X-Google-Smtp-Source: ABdhPJwe98lPcer4uCXqZ7SLbwBhOk0wY5ovwmoEWEsNnCqHQGRP7dfBzhLKn/SIp/ILBIDsh9CZwg== X-Received: by 2002:a05:6402:58:: with SMTP id f24mr18417864edu.234.1624917636125; Mon, 28 Jun 2021 15:00:36 -0700 (PDT) Received: from localhost.localdomain ([188.26.224.68]) by smtp.gmail.com with ESMTPSA id dn7sm10146615edb.29.2021.06.28.15.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jun 2021 15:00:35 -0700 (PDT) From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , Vivien Didelot , Jiri Pirko , Ido Schimmel , Tobias Waldekranz , Roopa Prabhu , Nikolay Aleksandrov , Vladimir Oltean Subject: [PATCH v4 net-next 02/14] net: bridge: allow br_fdb_replay to be called for the bridge device Date: Tue, 29 Jun 2021 00:59:59 +0300 Message-Id: <20210628220011.1910096-3-olteanv@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210628220011.1910096-1-olteanv@gmail.com> References: <20210628220011.1910096-1-olteanv@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladimir Oltean When a port joins a bridge which already has local FDB entries pointing to the bridge device itself, we would like to offload those, so allow the "dev" argument to be equal to the bridge too. The code already does what we need in that case. Signed-off-by: Vladimir Oltean --- net/bridge/br_fdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index 0296d737a519..5a92bec02bbc 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c @@ -754,7 +754,8 @@ int br_fdb_replay(const struct net_device *br_dev, const struct net_device *dev, unsigned long action; int err = 0; - if (!netif_is_bridge_master(br_dev) || !netif_is_bridge_port(dev)) + if (!netif_is_bridge_master(br_dev) || + (!netif_is_bridge_port(dev) && !netif_is_bridge_master(dev))) return -EINVAL; br = netdev_priv(br_dev);