From patchwork Fri May 17 05:09:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indrajitt Valsaraj X-Patchwork-Id: 1936273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=Xm3nt3Bl; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=uw/UQikU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VgZkj1gVbz20dJ for ; Fri, 17 May 2024 15:09:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 13BB581BBD; Fri, 17 May 2024 05:09:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 2gJs_5ZAfv0W; Fri, 17 May 2024 05:09:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 7BA5E812CB Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=Xm3nt3Bl; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=uw/UQikU Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7BA5E812CB; Fri, 17 May 2024 05:09:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 53663C0072; Fri, 17 May 2024 05:09:13 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 29C98C0037 for ; Fri, 17 May 2024 05:09:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0C427812CB for ; Fri, 17 May 2024 05:09:11 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IsF75LFqicba for ; Fri, 17 May 2024 05:09:09 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=148.163.151.68; helo=mx0a-002c1b01.pphosted.com; envelope-from=indrajitt.valsaraj@nutanix.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 89661812C3 Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=nutanix.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 89661812C3 Received: from mx0a-002c1b01.pphosted.com (mx0a-002c1b01.pphosted.com [148.163.151.68]) by smtp1.osuosl.org (Postfix) with ESMTPS id 89661812C3 for ; Fri, 17 May 2024 05:09:08 +0000 (UTC) Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44GML2xw018988 for ; Thu, 16 May 2024 22:09:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h= from:to:cc:subject:date:message-id:content-transfer-encoding :content-type:mime-version; s=proofpoint20171006; bh=uRSaoeON00k Ur0UEDjU3mbvnll9s8txfVs+TK6olJJA=; b=Xm3nt3Bl5LrV6rxgARzhgMvlUVh V+m2jriaKm57igdpgeCMGHQvz3nOYRH1ADyjqI3CNfkuNf6r0aCYriM8OLz7d52x dZT32ulsulWB88z4Cy7UQgAm0krFK4XHHBmjRHi+V4JD8rStug4WnROLzrbyDmKo c8QwR0cqLqJJFm6kiLdc9R46K6YN8STq7BGWPd52wMXtePgXuS+zHZx2ZFEeF/fa RpExL23xrRIVjMZUvTg4rJ3f6Dr1D++CY3W98EULuH7N1/ne6MammxTNCqi1WSXl dsDUmxCy/XdPlNtf6pTLxvW78T5+5ttVYDBMtzZdoGE8drnep22msrS1Sxg== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3y287vcrpn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 May 2024 22:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=au+vaxY8ufQIvsCf5Cwom8lCpWYjTgco/oNHsiBUxyD4pUzOrs95v6r4Jphv5a45eYt7MRLRQzoodQ27l8CwAEGcFBaasjE99kwEeYjJJMfPz3tmvzAIjx8ZGOx8RRanQJ8g8l5dJqNq0qxz7ZhCHsam1MZ2wmKtU6YYhhABfY/eS2oqY+gl+IGct8MY3Ak4TueVIH3LjJE43CvATz974t60xO6AGRu1JHikWypfVExDds3yiGKdqsfvzE85hXL9N1F7NUXYcOh3ECEkTlcyPaJ0bnbG4pYhNjy5bIfDD7x6ERNZmEo8dx/7wvqB8nKD+uiW3N0mURyg2UoB9MZ0cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uRSaoeON00kUr0UEDjU3mbvnll9s8txfVs+TK6olJJA=; b=cvX5LijbAMBUzl+TmXqQ4C3a+sjcQIsRWD/tsPmeAwziHxbz2Dxn00a191nbwWYJc8UVwbLcf1E5BVpPJcjPe/mPyHBH6nLERYpD3iusHY/dCbk/i4D0Ixn+Qqf2EDaqHYgJbELSSo6vzZIXYGvIp5i9V4TA+A1kDJjJpW6W2aNcS8XelBhLzT7b2quqSmtw7Q5cLiCownfEON8Q/nNRvs9dCcG9FyN0TPuxYn5d2K/UxqmZFp/3tCWPJfzgq+knRZ3qKTXWaafdwMlOF6JumeewNZtOR7heE6QEBLPvbQ/Wl+68fOKrfMjk05rqWpt0ivE4933h0fEnSplEoao9yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uRSaoeON00kUr0UEDjU3mbvnll9s8txfVs+TK6olJJA=; b=uw/UQikUiG84U4pWSeIue0Q1GZ57/2lZ8Tgn3zGqKUg24b/Btw7BsOLKlwEE049lJ4J95/Q0hmfvKA8OyAN1As+nKPGbqkkL8mEwWjyn1uhmnmhvqz96miNJaY/gshiGCUjcxQ7AM0dxgt26IPNAO4veWd61DwBQ8Fjw+ixYWf1m9qIglUqF1mwMI1C1bCMcBDUEHtSvCi1usJwU7E87gmESaNOWCNxjIh/xlPqtmkg26BMBc5PzcLM1SFdps4ERiL9oOGOadDiHoLLCZvpIeLyjFTAo9nThpSSelzhoRmDZ83iRqapAIbThcbugoZpWYJG9KiwVL+MKwoZkMP1zDg== Received: from DM6PR02MB6747.namprd02.prod.outlook.com (2603:10b6:5:220::15) by PH8PR02MB10183.namprd02.prod.outlook.com (2603:10b6:510:225::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.54; Fri, 17 May 2024 05:09:05 +0000 Received: from DM6PR02MB6747.namprd02.prod.outlook.com ([fe80::8dba:5918:2130:6dcc]) by DM6PR02MB6747.namprd02.prod.outlook.com ([fe80::8dba:5918:2130:6dcc%3]) with mapi id 15.20.7587.028; Fri, 17 May 2024 05:09:05 +0000 From: Indrajitt Valsaraj To: dev@openvswitch.org Date: Fri, 17 May 2024 05:09:01 +0000 Message-Id: <20240517050901.113635-1-indrajitt.valsaraj@nutanix.com> X-Mailer: git-send-email 2.22.3 X-ClientProxiedBy: SJ0PR05CA0093.namprd05.prod.outlook.com (2603:10b6:a03:334::8) To DM6PR02MB6747.namprd02.prod.outlook.com (2603:10b6:5:220::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR02MB6747:EE_|PH8PR02MB10183:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bbbc176-e1c3-4a71-aae7-08dc762f794b x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|366007|1800799015|376005|38350700005; X-Microsoft-Antispam-Message-Info: nXf/kF537LQmYUq5nN4ouvkeFA20UeK6PFAiFeU+b3hw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hiML1AmYj4CgoYtUYAMkedmD+P96ESZ2UXbRd7Qdcbr3yRqRkOyaFhK9FqloIDvBBYO9zn4PHX/Idc7K7WZ20u6F7MdtOWfoTKggnY9pKgll99botZOmwYQDjzCDDrX2bM8+n47YGN39UyTRQNKVYW28PBenaU0rNMghii/Xhf0lZQzieivR7hmHIFdpCP3ydpwbbAttmwnCqaIB8UTYefFCWRn59eQpV2HQTpBXja5Mg5+jo9WBFXPdGjw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR02MB6747.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(366007)(1800799015)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V9T36oLurB9JF1Sp+V3xY+9qCsVfO7afeGmhDzFoRvxLx2OsZD7sJj6JewJFjNXRb4Orqe6hOtB7V5xrebOAjXlu3SH6dM7WZJYM9/nwUuwNvn7LdhWSlhaA0p+TZgy2SP7/nxp1wWlJ/KA+ZAU2DHoFvan6oEIo1ikuMC3psDhsKwG9bj9n5O4oCxg+GsJZwAahmFe7O681YONwOlj58ewkvli9IGBhkWTAb6xCv0sEsij/Ltu3d+OOZXJvPEwko0nSVD/sH8RKhi2AjCKw2OdJJ7auhJ0tyoBvN27M8B+CWpPDmMsjlrExfU4LgruD87LdNueL2K7SFhI0PPoSGZ+YIYPmoQlFjZtZcfwMxwFW7nrw7j/8j6Q7x64EofE2DpGzW6J2kfNbqD6q1N/NjDTLvH2FnpqJ2nIMSKtuUNYV7CnTTqZqd5rSK43sNoYH0v5F8OVzRXzSzrGV++eArqECCpnqSc4ywUCOkCZDz0jc+V494XGg9AqAVkg3deBXfmaRz0Xiq/pyCHQ0nWUITOtstLOaFg1/PyPtT5CdSda1jtRSr2AqNGYb7SSb67zgE20HYkBWiwwTDfHWGvnKu4WpG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ant-Network-Message-Id: 9bbbc176-e1c3-4a71-aae7-08dc762f794b X-MS-Exchange-CrossTenant-AuthSource: DM6PR02MB6747.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 05:09:05.1838 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vbQXpyhEiLfMQ+/nISX5/58lgAeRiAOxcIlDu2eWvndOo3S3bTulS0UiP/sLg4Kc7QfLV3aZKgHvoW3H8tBMBa2FfnHL9lN3Pm1FDZc7UPA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR02MB10183 X-Proofpoint-ORIG-GUID: w32kfwkw_BoVUzwDk8dqL1KBzwJyufmg X-Proofpoint-GUID: w32kfwkw_BoVUzwDk8dqL1KBzwJyufmg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_07,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Cc: Indrajitt Valsaraj Subject: [ovs-dev] [PATCH ovn v2] northd: Fix an issue wrt mac binding aging. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Issue: In case of a Logical_Router without mac_binding_age_threshold set or a Logical_Router with an incorrectly formatted mac_binding_threshold option, entries were not being purged from the Mac Binding table in SouthBound. This was because in the function `en_mac_binding_aging_run` in case of an invalid mac_binding_threshold entry or if mac_binding_threshold is not set we are returning from the loop instead of iterating through the remaining LRs. As a result, subsequent runs of the aging_waker node are also not scehduled and we end up not purging any MAC Bindings. Fix: This patch fixes this issue by changing the return to a continue so that we skip the current LR but continue processing for the remaining LRs. Fixes: 78851b6ffb58 ("Support CIDR-based MAC binding aging threshold.") Signed-off-by: Indrajitt Valsaraj Acked-by: Naveen Yerramneni Acked-by: Ales Musil --- v1: - Addressed review comment from Ales v2: - Fix test failure --- northd/aging.c | 2 +- tests/ovn.at | 107 +++++++++++++++++++++++++++++++++++-------------- 2 files changed, 77 insertions(+), 32 deletions(-) -- 2.22.3 diff --git a/northd/aging.c b/northd/aging.c index b76963a2d..9685044e7 100644 --- a/northd/aging.c +++ b/northd/aging.c @@ -421,7 +421,7 @@ en_mac_binding_aging_run(struct engine_node *node, void *data OVS_UNUSED) if (!parse_aging_threshold(smap_get(&od->nbr->options, "mac_binding_age_threshold"), &threshold_config)) { - return; + continue; } aging_context_set_threshold(&ctx, &threshold_config); diff --git a/tests/ovn.at b/tests/ovn.at index 486680649..5ab64ae9b 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -34414,10 +34414,15 @@ AT_CHECK([ovn-nbctl lsp-set-addresses ln_port unknown]) AT_CHECK([ovn-nbctl lsp-set-type ln_port localnet]) AT_CHECK([ovn-nbctl lsp-set-options ln_port network_name=physnet1]) -AT_CHECK([ovn-nbctl lsp-add public public-gw]) -AT_CHECK([ovn-nbctl lsp-set-type public-gw router]) -AT_CHECK([ovn-nbctl lsp-set-addresses public-gw 00:00:00:00:10:00 router]) -AT_CHECK([ovn-nbctl lsp-set-options public-gw router-port=gw-public]) +AT_CHECK([ovn-nbctl lsp-add public public-gw-1]) +AT_CHECK([ovn-nbctl lsp-set-type public-gw-1 router]) +AT_CHECK([ovn-nbctl lsp-set-addresses public-gw-1 00:00:00:00:10:00 router]) +AT_CHECK([ovn-nbctl lsp-set-options public-gw-1 router-port=gw-1-public]) + +AT_CHECK([ovn-nbctl lsp-add public public-gw-2]) +AT_CHECK([ovn-nbctl lsp-set-type public-gw-2 router]) +AT_CHECK([ovn-nbctl lsp-set-addresses public-gw-2 00:00:00:00:30:00 router]) +AT_CHECK([ovn-nbctl lsp-set-options public-gw-2 router-port=gw-2-public]) AT_CHECK([ovn-nbctl lsp-add internal internal-gw]) AT_CHECK([ovn-nbctl lsp-set-type internal-gw router]) @@ -34430,9 +34435,12 @@ AT_CHECK([ovn-nbctl lsp-set-addresses vif1 "00:00:00:00:20:10 192.168.20.10"]) AT_CHECK([ovn-nbctl lsp-add internal vif2]) AT_CHECK([ovn-nbctl lsp-set-addresses vif2 "00:00:00:00:20:20 192.168.20.20"]) -AT_CHECK([ovn-nbctl lr-add gw]) -AT_CHECK([ovn-nbctl lrp-add gw gw-public 00:00:00:00:10:00 192.168.10.1/24]) -AT_CHECK([ovn-nbctl lrp-add gw gw-internal 00:00:00:00:20:00 192.168.20.1/24]) +AT_CHECK([ovn-nbctl lr-add gw-1]) +AT_CHECK([ovn-nbctl lrp-add gw-1 gw-1-public 00:00:00:00:10:00 192.168.10.1/24]) +AT_CHECK([ovn-nbctl lrp-add gw-1 gw-internal 00:00:00:00:20:00 192.168.20.1/24]) + +AT_CHECK([ovn-nbctl lr-add gw-2]) +AT_CHECK([ovn-nbctl lrp-add gw-2 gw-2-public 00:00:00:00:30:00 192.168.10.2/24]) sim_add hv1 as hv1 @@ -34500,21 +34508,27 @@ send_udp() { as $hv ovs-appctl netdev-dummy/receive $dev $packet } # Check if the option is not present by default -AT_CHECK([fetch_column nb:logical_router options name="gw" | grep -q mac_binding_age_threshold], [1]) +AT_CHECK([fetch_column nb:logical_router options name="gw-1" | grep -q mac_binding_age_threshold], [1]) +AT_CHECK([fetch_column nb:logical_router options name="gw-2" | grep -q mac_binding_age_threshold], [1]) # Send GARP to populate MAC binding table records send_garp hv1 ext1 10 send_garp hv2 ext2 20 -wait_row_count mac_binding 1 ip="192.168.10.10" -wait_row_count mac_binding 1 ip="192.168.10.20" +# Two rows present for each IP, one corresponding to each logical_port +wait_row_count mac_binding 2 ip="192.168.10.10" +wait_row_count mac_binding 2 ip="192.168.10.20" -dp_key=$(printf "0x%x" $(as hv1 fetch_column datapath tunnel_key external_ids:name=gw)) -port_key=$(printf "0x%x" $(as hv1 fetch_column port_binding tunnel_key logical_port=gw-public)) +dp_key_1=$(printf "0x%x" $(as hv1 fetch_column datapath tunnel_key external_ids:name=gw-1)) +port_key_1=$(printf "0x%x" $(as hv1 fetch_column port_binding tunnel_key logical_port=gw-1-public)) +dp_key_2=$(printf "0x%x" $(as hv1 fetch_column datapath tunnel_key external_ids:name=gw-2)) +port_key_2=$(printf "0x%x" $(as hv1 fetch_column port_binding tunnel_key logical_port=gw-2-public)) AT_CHECK_UNQUOTED([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_MAC_CACHE_USE --no-stats | strip_cookie | sort], [0], [dnl - table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key},metadata=${dp_key},dl_src=00:00:00:00:10:10,nw_src=192.168.10.10 actions=drop - table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key},metadata=${dp_key},dl_src=00:00:00:00:10:20,nw_src=192.168.10.20 actions=drop + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_1},metadata=${dp_key_1},dl_src=00:00:00:00:10:10,nw_src=192.168.10.10 actions=drop + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_1},metadata=${dp_key_1},dl_src=00:00:00:00:10:20,nw_src=192.168.10.20 actions=drop + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_2},metadata=${dp_key_2},dl_src=00:00:00:00:10:10,nw_src=192.168.10.10 actions=drop + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_2},metadata=${dp_key_2},dl_src=00:00:00:00:10:20,nw_src=192.168.10.20 actions=drop ]) timestamp=$(fetch_column mac_binding timestamp ip="192.168.10.20") @@ -34525,8 +34539,8 @@ send_udp hv2 ext2 20 OVS_WAIT_UNTIL([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_MAC_CACHE_USE | grep "192.168.10.10" | grep -q "n_packets=1"]) OVS_WAIT_UNTIL([as hv2 ovs-ofctl dump-flows br-int table=OFTABLE_MAC_CACHE_USE | grep "192.168.10.20" | grep -q "n_packets=1"]) -# Set the MAC binding aging threshold -AT_CHECK([ovn-nbctl set logical_router gw options:mac_binding_age_threshold=5]) +# Set the MAC binding aging threshold for gw-1 router. No option for gw-2 router. +AT_CHECK([ovn-nbctl set logical_router gw-1 options:mac_binding_age_threshold=5]) AT_CHECK([fetch_column nb:logical_router options | grep -q mac_binding_age_threshold=5]) AT_CHECK([ovn-nbctl --wait=sb sync]) @@ -34542,21 +34556,24 @@ OVS_WAIT_UNTIL([ ]) check test "$(fetch_column mac_binding timestamp ip='192.168.10.20')" != "" -# Check if the records are removed after some inactivity +# Check if the records are removed after some inactivity for gw-1. Only 1 entry should be present for gw-2. OVS_WAIT_UNTIL([ - test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" + test "1" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" ]) # The second one takes longer because it got refreshed OVS_WAIT_UNTIL([ - test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.20')" + test "1" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.20')" ]) -AT_CHECK([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_MAC_CACHE_USE --no-stats | strip_cookie], [0], []) +AT_CHECK_UNQUOTED([as hv1 ovs-ofctl dump-flows br-int table=OFTABLE_MAC_CACHE_USE --no-stats | strip_cookie | sort], [0], [dnl + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_2},metadata=${dp_key_2},dl_src=00:00:00:00:10:10,nw_src=192.168.10.10 actions=drop + table=OFTABLE_MAC_CACHE_USE, priority=100,ip,reg14=${port_key_2},metadata=${dp_key_2},dl_src=00:00:00:00:10:20,nw_src=192.168.10.20 actions=drop +]) # Test CIDR-based threshold configuration -check ovn-nbctl set logical_router gw options:mac_binding_age_threshold="192.168.10.0/255.255.255.0:2;192.168.10.64/26:0;192.168.10.20:0" +check ovn-nbctl set logical_router gw-1 options:mac_binding_age_threshold="192.168.10.0/255.255.255.0:2;192.168.10.64/26:0;192.168.10.20:0" check ovn-nbctl --wait=sb sync -uuid=$(fetch_column datapath _uuid external_ids:name=gw) +uuid=$(fetch_column datapath _uuid external_ids:name=gw-1) AT_CHECK([ovn-sbctl get datapath $uuid external_ids:mac_binding_age_threshold], [0], [dnl "2" ]) @@ -34566,12 +34583,12 @@ send_garp hv1 ext1 10 # belong to 192.168.10.0/24 send_garp hv2 ext2 20 # belong to 192.168.10.20/32 send_garp hv2 ext2 65 # belong to 192.168.10.64/26 -OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) -OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.20"]) -OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.65"]) +wait_row_count mac_binding 2 ip="192.168.10.10" +wait_row_count mac_binding 2 ip="192.168.10.20" +wait_row_count mac_binding 2 ip="192.168.10.65" OVS_WAIT_UNTIL([ - test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" + test "1" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" ]) # The other two should remain because the corresponding prefixes have threshold 0 AT_CHECK([ovn-sbctl list mac_binding | grep -q "192.168.10.20"]) @@ -34579,9 +34596,9 @@ AT_CHECK([ovn-sbctl list mac_binding | grep -q "192.168.10.65"]) check ovn-sbctl --all destroy mac_binding # Set the aging threshold mixed with IPv6 prefixes and default threshold -check ovn-nbctl set logical_router gw options:mac_binding_age_threshold="2;192.168.10.64/26:0;ff00:1234::/32:888;ff00::abcd:1" +check ovn-nbctl set logical_router gw-1 options:mac_binding_age_threshold="2;192.168.10.64/26:0;ff00:1234::/32:888;ff00::abcd:1" check ovn-nbctl --wait=sb sync -uuid=$(fetch_column datapath _uuid external_ids:name=gw) +uuid=$(fetch_column datapath _uuid external_ids:name=gw-1) AT_CHECK([ovn-sbctl get datapath $uuid external_ids:mac_binding_age_threshold], [0], [dnl "1" ]) @@ -34594,15 +34611,15 @@ OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.65"]) OVS_WAIT_UNTIL([ - test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" + test "1" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" ]) AT_CHECK([ovn-sbctl list mac_binding | grep -q "192.168.10.65"]) check ovn-sbctl --all destroy mac_binding # Set the aging threshold with invalid format -check ovn-nbctl set logical_router gw options:mac_binding_age_threshold="1;abc/26:0" +check ovn-nbctl set logical_router gw-1 options:mac_binding_age_threshold="1;abc/26:0" check ovn-nbctl --wait=sb sync -uuid=$(fetch_column datapath _uuid external_ids:name=gw) +uuid=$(fetch_column datapath _uuid external_ids:name=gw-1) AT_CHECK([ovn-sbctl get datapath $uuid external_ids:mac_binding_age_threshold], [1], [ignore], [ignore]) # Send GARP to populate MAC binding table records @@ -34612,6 +34629,34 @@ OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) # The record is not deleted sleep 5 AT_CHECK([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) +check ovn-sbctl --all destroy mac_binding + +# Set the aging threshold on both routers and ensure that they are aged out of both the routers +AT_CHECK([ovn-nbctl set logical_router gw-1 options:mac_binding_age_threshold=5]) +AT_CHECK([ovn-nbctl set logical_router gw-2 options:mac_binding_age_threshold=5]) +check ovn-nbctl --wait=sb sync +uuid=$(fetch_column datapath _uuid external_ids:name=gw-1) +AT_CHECK([ovn-sbctl get datapath $uuid external_ids:mac_binding_age_threshold], [0], [dnl +"5" +]) +uuid=$(fetch_column datapath _uuid external_ids:name=gw-2) +AT_CHECK([ovn-sbctl get datapath $uuid external_ids:mac_binding_age_threshold], [0], [dnl +"5" +]) + +# Send GARP to populate MAC binding table records +send_garp hv1 ext1 10 # belong to 192.168.10.0/24 +send_garp hv2 ext2 20 # belong to 192.168.10.20/32 + +wait_row_count mac_binding 2 ip="192.168.10.10" +wait_row_count mac_binding 2 ip="192.168.10.20" + +OVS_WAIT_UNTIL([ + test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.10')" +]) +OVS_WAIT_UNTIL([ + test "0" = "$(ovn-sbctl list mac_binding | grep -c '192.168.10.20')" +]) OVN_CLEANUP([hv1], [hv2]) AT_CLEANUP