Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1354395pxb; Thu, 24 Mar 2022 18:33:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxym+YW46MEhamsSTQLyy5ZwE48GphxUpEVEISjVohD3dRets8/WILbv5PIoMql08jCXip1 X-Received: by 2002:a50:d4d2:0:b0:410:9fa2:60d6 with SMTP id e18-20020a50d4d2000000b004109fa260d6mr10215143edj.35.1648172016743; Thu, 24 Mar 2022 18:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648172016; cv=none; d=google.com; s=arc-20160816; b=oqq30IGMUeuF0xlkS4un1rQgYqq3oIUnq5jOqVFMEhz+JHYEOQvFn8+3TLJ9yK+Kbo ticu29UU2auXGK7QJpEV7RqvYaCjNsSSWWcG4xjBrfKpFu52vSB1jvJ/wmO/OuMNRGhQ iRtu1GfN2dITEbivg7a6jwc1LIC3HmCmY2GFnkfeHA8+TnGsP2nY3hE2u2zGh6hLWrtE mq0TNqPUp6Knn3/p3ZIiqzUuk/P0/vge+uZqvIgC3zThDOxUdC5j97xr7/3y2VdA1O/n AHH83Ni7BbDoT1ufWMk0vgS0r5ix/accV73Amb1Kb7aCZXNvUTNRTK/EGwhxWqntA9R8 0m1A== 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=qhk/cSlBhu9FyIQHni5JTdj5gaUuouDSx4dOdLvCXlU=; b=KUJUJ4UOiLQDtjcFDxf8i6zrBNMMlC6NvyLmY7cxTlXCl9w+tEYVgGeisi4gXprkHw Ius51gcXlYHwz6p6BunCqwqxvacCikCABlPbQBB+xIFcMinNTFvgLr0ojJNiTVC2JPjK E+2v5FWQWnrR0ol6VQ/3tLMftmLqYzhH1KkjrqG1skHuDwgUd2V0cdHTF4YPwQhYP9KH QglO9Laz/tkptN4fOkn5mS73RhKZe3vO2J50bpQDRYQzDoqgmUhbtOEVu1hFbcKGMrVm TxI5pGPtcRBncfoJUi5EK8Uh2vpD4OIQgr3UfUd4qUymlFPyr09jGOeaGXnUbVHXqtSR nV4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FJAC60D0; 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 u5-20020a50c045000000b00418c2b5bdf2si1383562edd.212.2022.03.24.18.33.11; Thu, 24 Mar 2022 18:33:36 -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=FJAC60D0; 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 S1351418AbiCXP4n (ORCPT + 99 others); Thu, 24 Mar 2022 11:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351374AbiCXP4i (ORCPT ); Thu, 24 Mar 2022 11:56:38 -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 E7BC4AC938 for ; Thu, 24 Mar 2022 08:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648137305; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qhk/cSlBhu9FyIQHni5JTdj5gaUuouDSx4dOdLvCXlU=; b=FJAC60D02tgWpasaYe3ECEnefjYRR1FXjrUW7Hmqq3V/TKQtGPnmSTJL1gi9yBlQZo+3jn riqN1pJuMLQ8wRPNW2Lm9azCtl3jrJhlUDKeumyjF+jvM6zaR5dG1TicfDPtqocDppENA/ R510cZJcGN4q8DgsnGgeYbyLVv5Bfx8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-XGELB1YLM0WwMYKHKCvZHg-1; Thu, 24 Mar 2022 11:55:03 -0400 X-MC-Unique: XGELB1YLM0WwMYKHKCvZHg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68C2E892D1A; Thu, 24 Mar 2022 15:54:57 +0000 (UTC) Received: from jtoppins.rdu.csb (unknown [10.22.17.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3144740146E; Thu, 24 Mar 2022 15:54:57 +0000 (UTC) From: Jonathan Toppins To: netdev@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH iproute2 next] bond: add mac_filter option Date: Thu, 24 Mar 2022 11:54:42 -0400 Message-Id: <2d08b009c8a66524609902d3707bf325f7905691.1648136550.git.jtoppins@redhat.com> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 --- 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 22e21e57afc9..23b61679b4ff 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h @@ -927,6 +927,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 650411fc7de1..64f910e2b4cc 100644 --- a/ip/iplink_bond.c +++ b/ip/iplink_bond.c @@ -156,6 +156,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" @@ -409,6 +410,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; @@ -490,6 +499,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.27.0