Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp790026imw; Fri, 8 Jul 2022 11:45:55 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uxV1E5Dlru9jgkID//2JF88V2ClLZh47ys2Qfqu2pHoWtRV3auP4h0/w2CVMFA2rPeu6SU X-Received: by 2002:a17:907:3f29:b0:722:e5b0:ebe7 with SMTP id hq41-20020a1709073f2900b00722e5b0ebe7mr4785241ejc.335.1657305955563; Fri, 08 Jul 2022 11:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657305955; cv=none; d=google.com; s=arc-20160816; b=Efl+4ekD581bhbeGaeIvUlo0cdoVhJfjO+EvDTTaDyOuh5oU8CQktKzaolvHF5XCTn scQ8KSVdRTK6Y2XBBT1vjtV0yHE0fqSu2Oaw7LAsWGhrNzMYdi5DI0O6ZWw6u0rkOqvG gitaD8Jy28cYcw2T4Oy+jB92PtR2pF3ZKxHVQUeh29WbpvRcnIeN8esYmq/MpsJm82KE a5hyB1/jWJ+CbFLfH8R3bHhA/UJl+GDtLAl2tQOIZZ776udoKQiqcKkBti/TQwM+BX7w 6dQcpinFW7fbBrmNmNY0Jtd/VWVhwcThsfBbt3dqJE4NhOs/7QkwdZ/3NTnprL2at7mG 9hcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C1Fa11yvH3zHSAbXYwOqWzVpwYwysHK4A0l1MnClKws=; b=RMzN+i8s8hf+lvZFAH/YhtcPXdJlSYEIy39yf4A8TR5UufIxO1Jkq8JXj3l3JIBd+a NVKEOWLgLBTCd+90Ggc9FaLNipiAmzPoBxu/w8IcPs+1qmUEERW/wK3ogtVVmjq0CxhY 8C6iHmdHWGkJX6L/IOMhztdKZQ9CT8m2owf3dAVZ14QObRc/jhi0b71+/mnHthPzBa0a nKDwr5vgDFskQUKJmXPqUfUW+HG7kaACzZaKT3RDzKExrgz4dVkBdVgRgYki5illTibt WLC0VN6oL2iJjlF7Bh8QqTJJ+KtmMJpAd86eezy+ECyY1VZAmTVVdRoN0yGQpWssAVnZ 8LfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JCLMs3Mv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a50ec02000000b0043a27fde63fsi6012310edr.296.2022.07.08.11.45.29; Fri, 08 Jul 2022 11:45:55 -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=@redhat.com header.s=mimecast20190719 header.b=JCLMs3Mv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239522AbiGHSme (ORCPT + 99 others); Fri, 8 Jul 2022 14:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239379AbiGHSmP (ORCPT ); Fri, 8 Jul 2022 14:42:15 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 882F21E3C6 for ; Fri, 8 Jul 2022 11:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657305733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=C1Fa11yvH3zHSAbXYwOqWzVpwYwysHK4A0l1MnClKws=; b=JCLMs3MvClfGaVH96rzF0f/mR+Ct+bmX7VABVTcTK1sMASxFdPtpQNSEyd5wmolN5+UP6K zdHC60XUQO4q9uds1wDgfIJ/5wwnMAfYuBcH70ggNT9ZpZF/QvhsXfIBckXxFudr4XOw6R UHp1sc6AtH11iBzKfS+ya9nc0ko2YSE= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-263-x6XNsB5YPlejLLtztiKp4A-1; Fri, 08 Jul 2022 14:42:08 -0400 X-MC-Unique: x6XNsB5YPlejLLtztiKp4A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01EA21C05130; Fri, 8 Jul 2022 18:42:08 +0000 (UTC) Received: from jtoppins.rdu.csb (unknown [10.22.16.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F008492C3B; Fri, 8 Jul 2022 18:42:07 +0000 (UTC) From: Jonathan Toppins To: netdev@vger.kernel.org Cc: jtoppins@redhat.com, razor@blackwall.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH iproute2 next v4 2/2] bond: add mac_filter option Date: Fri, 8 Jul 2022 14:41:57 -0400 Message-Id: <3c7a89f9a92c41847a1b643c9db5c0a601e95d66.1657303056.git.jtoppins@redhat.com> In-Reply-To: <1755bbaad9c3792ce22b8fa4906bb6051968f29e.1657302266.git.jtoppins@redhat.com> References: <1755bbaad9c3792ce22b8fa4906bb6051968f29e.1657302266.git.jtoppins@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, 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 Add ability to set bonding option `mac_filter`. Values greater than zero represent the maximum hashtable size the mac filter is allowed to grow to, zero disables the filter. Signed-off-by: Jonathan Toppins --- Notes: v4: * rebase onto latest next branch include/uapi/linux/if_link.h | 1 + ip/iplink_bond.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index e0fbbfeeb3a1..529ae4faa7e2 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h @@ -934,6 +934,7 @@ enum { IFLA_BOND_AD_LACP_ACTIVE, IFLA_BOND_MISSED_MAX, IFLA_BOND_NS_IP6_TARGET, + IFLA_BOND_MAC_FILTER, __IFLA_BOND_MAX, }; diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c index 7943499e0adf..fb7236c58253 100644 --- a/ip/iplink_bond.c +++ b/ip/iplink_bond.c @@ -157,6 +157,7 @@ static void print_explain(FILE *f) " [ ad_actor_sys_prio SYSPRIO ]\n" " [ ad_actor_system LLADDR ]\n" " [ arp_missed_max MISSED_MAX ]\n" + " [ mac_filter HASH_SIZE ]\n" "\n" "BONDMODE := balance-rr|active-backup|balance-xor|broadcast|802.3ad|balance-tlb|balance-alb\n" "ARP_VALIDATE := none|active|backup|all|filter|filter_active|filter_backup\n" @@ -410,6 +411,14 @@ static int bond_parse_opt(struct link_util *lu, int argc, char **argv, } addattr8(n, 1024, IFLA_BOND_TLB_DYNAMIC_LB, tlb_dynamic_lb); + } else if (matches(*argv, "mac_filter") == 0) { + __u8 mac_filter; + NEXT_ARG(); + if (get_u8(&mac_filter, *argv, 0)) { + invarg("invalid mac_filter", *argv); + return -1; + } + addattr8(n, 1024, IFLA_BOND_MAC_FILTER, mac_filter); } else if (matches(*argv, "help") == 0) { explain(); return -1; @@ -491,6 +500,12 @@ static void bond_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) "arp_missed_max %u ", rta_getattr_u8(tb[IFLA_BOND_MISSED_MAX])); + if (tb[IFLA_BOND_MAC_FILTER]) + print_uint(PRINT_ANY, + "mac_filter", + "mac_filter %u ", + rta_getattr_u8(tb[IFLA_BOND_MAC_FILTER])); + if (tb[IFLA_BOND_ARP_IP_TARGET]) { struct rtattr *iptb[BOND_MAX_ARP_TARGETS + 1]; -- 2.31.1