From patchwork Tue Mar 8 13:29:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Wiberg X-Patchwork-Id: 12773821 X-Patchwork-Delegate: dsahern@gmail.com 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 A0163C433EF for ; Tue, 8 Mar 2022 13:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231289AbiCHNac (ORCPT ); Tue, 8 Mar 2022 08:30:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbiCHNaZ (ORCPT ); Tue, 8 Mar 2022 08:30:25 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C087A43AD1 for ; Tue, 8 Mar 2022 05:29:28 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id w27so32237968lfa.5 for ; Tue, 08 Mar 2022 05:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:organization:content-transfer-encoding; bh=vKI9hOdRsycB1cOoFMiddNOLZ6leR1+qJXbgkTLjIxg=; b=QH42UoS4tT2EpsMPV75d+TIi4FGjYeSwCN3ysV1KsFS+0u5qHxswrUQt4f6xaCbSQF xKL5Tj9Gvds/DOwqwvW1RUWt+fSL8ig29kzubyutH5JzRJz0xmDbm3eZIgdFf82Lhdtj qJIboK5E5+SWw+lEbU1kKHQ8TThTPprpfaUsvQkSVIAp2JiMFV8+sPvzj+P9Em8WmzK0 m3UVTHkN+WTbTB2+I+gDFJeL3OThMmGX51JcZGLZeDcdof+/NDJBTXKN/4k/kbiylf6O bwI5TXv8uXlkcqU8cEV6UM+K6NzyzypPUZr115E6HwA6rf6cA62G5DVuoVohv3dkoWHR F/gA== 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:date:message-id:in-reply-to :references:mime-version:organization:content-transfer-encoding; bh=vKI9hOdRsycB1cOoFMiddNOLZ6leR1+qJXbgkTLjIxg=; b=J9zQ/i7h3nTC5iF2nY9LUB+xX+8nAY0Rq8DOm12ajW8enKIh1hnPYpemlyqwvPi44K OI78pGtBxH6OrCWq2simEIliSUrXUjUDXTApCDs2MV66vcMPpKjiiBdVb4iuWsUjHe9Z 8eM9OjrHghmgbOxVNaOCZOQji6tHc0ocJxHEBUflwojqsKYkTy0I2LPYxWtXA1Vr6sBb +bxrtfXsjEELyO2MSVd99MtadI+c1GdTXhOxdgIseUsdhprkQdxivdFYI+AcgZuCqi7t OO89z6X7HmmXmmUglYBTx0RWK7BDLTarRx6NnOPEswD9ov1VnDfhvUys5HmjaF01t0tp XMTg== X-Gm-Message-State: AOAM530f0FROFMuNBTqRPrU9YTMe7XPe5sow92YO0vnnH9pt623nQLI4 q5ofU7CwEutv8e/v+Kf9RmrNnUkRyQc= X-Google-Smtp-Source: ABdhPJyplmro/lr4uC/rrMcdzNVk1tZ41yjyTZAtVCUpa7o2JgQNKDcAOLEk3EQt7nDMmD1j8YxQBw== X-Received: by 2002:a05:6512:2316:b0:446:a84a:173e with SMTP id o22-20020a056512231600b00446a84a173emr10599395lfu.73.1646746166596; Tue, 08 Mar 2022 05:29:26 -0800 (PST) Received: from wbg.labs.westermo.se (a124.broadband3.quicknet.se. [46.17.184.124]) by smtp.gmail.com with ESMTPSA id c4-20020ac244a4000000b004482d916b47sm1578711lfm.253.2022.03.08.05.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 05:29:26 -0800 (PST) From: Joachim Wiberg To: netdev@vger.kernel.org Cc: Stephen Hemminger , Nikolay Aleksandrov , Joachim Wiberg Subject: [PATCH iproute2-next 1/2] bridge: support for controlling flooding of broadcast per port Date: Tue, 8 Mar 2022 14:29:14 +0100 Message-Id: <20220308132915.2610480-2-troglobit@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308132915.2610480-1-troglobit@gmail.com> References: <20220308132915.2610480-1-troglobit@gmail.com> MIME-Version: 1.0 Organization: Westermo Network Technologies AB Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Add per-port support for controlling flooding of broadcast traffic. Similar to unicast and multcast flooding that already exist. Signed-off-by: Joachim Wiberg --- bridge/link.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bridge/link.c b/bridge/link.c index bc7837a9..407dc8ea 100644 --- a/bridge/link.c +++ b/bridge/link.c @@ -153,6 +153,9 @@ static void print_protinfo(FILE *fp, struct rtattr *attr) if (prtb[IFLA_BRPORT_MCAST_FLOOD]) print_on_off(PRINT_ANY, "mcast_flood", "mcast_flood %s ", rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_FLOOD])); + if (prtb[IFLA_BRPORT_BCAST_FLOOD]) + print_on_off(PRINT_ANY, "bcast_flood", "bcast_flood %s ", + rta_getattr_u8(prtb[IFLA_BRPORT_BCAST_FLOOD])); if (prtb[IFLA_BRPORT_MCAST_TO_UCAST]) print_on_off(PRINT_ANY, "mcast_to_unicast", "mcast_to_unicast %s ", rta_getattr_u8(prtb[IFLA_BRPORT_MCAST_TO_UCAST])); @@ -265,6 +268,7 @@ static void usage(void) " [ learning_sync {on | off} ]\n" " [ flood {on | off} ]\n" " [ mcast_flood {on | off} ]\n" + " [ bcast_flood {on | off} ]\n" " [ mcast_to_unicast {on | off} ]\n" " [ neigh_suppress {on | off} ]\n" " [ vlan_tunnel {on | off} ]\n" @@ -296,6 +300,7 @@ static int brlink_modify(int argc, char **argv) __s8 flood = -1; __s8 vlan_tunnel = -1; __s8 mcast_flood = -1; + __s8 bcast_flood = -1; __s8 mcast_to_unicast = -1; __s8 isolated = -1; __s8 hairpin = -1; @@ -354,6 +359,11 @@ static int brlink_modify(int argc, char **argv) mcast_flood = parse_on_off("mcast_flood", *argv, &ret); if (ret) return ret; + } else if (strcmp(*argv, "bcast_flood") == 0) { + NEXT_ARG(); + bcast_flood = parse_on_off("bcast_flood", *argv, &ret); + if (ret) + return ret; } else if (strcmp(*argv, "mcast_to_unicast") == 0) { NEXT_ARG(); mcast_to_unicast = parse_on_off("mcast_to_unicast", *argv, &ret); @@ -456,6 +466,9 @@ static int brlink_modify(int argc, char **argv) if (mcast_flood >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_FLOOD, mcast_flood); + if (bcast_flood >= 0) + addattr8(&req.n, sizeof(req), IFLA_BRPORT_BCAST_FLOOD, + bcast_flood); if (mcast_to_unicast >= 0) addattr8(&req.n, sizeof(req), IFLA_BRPORT_MCAST_TO_UCAST, mcast_to_unicast); From patchwork Tue Mar 8 13:29:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Wiberg X-Patchwork-Id: 12773822 X-Patchwork-Delegate: dsahern@gmail.com 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 954A6C433F5 for ; Tue, 8 Mar 2022 13:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233146AbiCHNad (ORCPT ); Tue, 8 Mar 2022 08:30:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233134AbiCHNa2 (ORCPT ); Tue, 8 Mar 2022 08:30:28 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3699544760 for ; Tue, 8 Mar 2022 05:29:31 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id bn33so25024688ljb.6 for ; Tue, 08 Mar 2022 05:29:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:organization:content-transfer-encoding; bh=93c5XXpJUTEPP71ABquCsBO3fHl+NABUZRIP4xIAZT4=; b=heMyUJRq4dH8Ia3M4mWZGOtRd8dvoGBM91VXXGu1/kWtQp/VMo6X59SQWtV1AMzpDh MVfvYn4mjIAXe+qY7GHXgeQVHqZOfTEQntHrRJfxiB/sNwxYNMAHlWHLqCUSAXvL8p0p B33jsszCrTW87YOQToZvNb1uSco2YVN9NxPhKPGSfkoFOGZADGVRLaPNVXmhzZNHGxCV +rfu/+NluhgI1mX3sf6gltmR6688ahr4ShYuLz7exWUxg+AnrfUgKozyksiFW0jbFhiY bNWJSpvpyGFG2s3qqBazlQww3BRP4fIjbiZqQrAN62dOrs1Zk863f1FYCaXTBDoeMM6v oixA== 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:date:message-id:in-reply-to :references:mime-version:organization:content-transfer-encoding; bh=93c5XXpJUTEPP71ABquCsBO3fHl+NABUZRIP4xIAZT4=; b=6I0RYatOAZr37AW483MViBbUn+ZaTlZqdQW9RtqtFHk1k+BFOmUoJjDiGS9TQEP71K dS0BjQvHx4VvfUKAd0T1l1thuO9Ejf4vTa4glmAXc6Q+0TMo3xF7jkshQO1oBf3muxx5 lP2JL/ZhZ2REtHuE/vdZaOCKboZzx5g5xt9BKk8Rb4GirEmKJ++0827X9kLgYLmsvK6z k3ifpsAU7tSthZxQqMpTDkUHiTZ7b1m5Zs+cku+BzT/ofONm0ppJUCpwRwjj4PYHcZjm SGj5C55W7n1HerD0raCv2ofAoam2q/DKhcEQGRbQGxsgqxIssEg1VmIXHjF7N/NVl9Iv VHVw== X-Gm-Message-State: AOAM531/drVuR0aHpvHFt0sB5a3Pgj5UByl+xA3CX6BrxGrzHMptElmZ deXsnaazYVymqmXkJkQPIMSpB6ZMO2Q= X-Google-Smtp-Source: ABdhPJzDFzrn1ntLHjgAAvTZkk8AtDEtW8kCYz8S40prvtLATyJ8oTqI3brhPaTKTrpK1EErUecYbw== X-Received: by 2002:a2e:90d6:0:b0:246:e44:bcf6 with SMTP id o22-20020a2e90d6000000b002460e44bcf6mr11131973ljg.501.1646746169126; Tue, 08 Mar 2022 05:29:29 -0800 (PST) Received: from wbg.labs.westermo.se (a124.broadband3.quicknet.se. [46.17.184.124]) by smtp.gmail.com with ESMTPSA id c4-20020ac244a4000000b004482d916b47sm1578711lfm.253.2022.03.08.05.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 05:29:28 -0800 (PST) From: Joachim Wiberg To: netdev@vger.kernel.org Cc: Stephen Hemminger , Nikolay Aleksandrov , Joachim Wiberg Subject: [PATCH iproute2-next 2/2] man: document new bcast_flood config/query support for bridge ports Date: Tue, 8 Mar 2022 14:29:15 +0100 Message-Id: <20220308132915.2610480-3-troglobit@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308132915.2610480-1-troglobit@gmail.com> References: <20220308132915.2610480-1-troglobit@gmail.com> MIME-Version: 1.0 Organization: Westermo Network Technologies AB Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: dsahern@gmail.com Signed-off-by: Joachim Wiberg --- man/man8/bridge.8 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/man8/bridge.8 b/man/man8/bridge.8 index 81ce9e6f..1d03eef1 100644 --- a/man/man8/bridge.8 +++ b/man/man8/bridge.8 @@ -46,6 +46,7 @@ bridge \- show / manipulate bridge addresses and devices .BR flood " { " on " | " off " } ] [ " .BR hwmode " { " vepa " | " veb " } ] [ " .BR mcast_flood " { " on " | " off " } ] [ " +.BR bcast_flood " { " on " | " off " } ] [ " .BR mcast_to_unicast " { " on " | " off " } ] [ " .BR neigh_suppress " { " on " | " off " } ] [ " .BR vlan_tunnel " { " on " | " off " } ] [ " @@ -466,6 +467,11 @@ switch. Controls whether multicast traffic for which there is no MDB entry will be flooded towards this given port. By default this flag is on. +.TP +.BR "bcast_flood on " or " bcast_flood off " +Controls flooding of broadcast traffic on the given port. +By default this flag is on. + .TP .BR "mcast_to_unicast on " or " mcast_to_unicast off " Controls whether a given port will replicate packets using unicast