From patchwork Thu May 16 06:11:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indrajitt Valsaraj X-Patchwork-Id: 1935810 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=hPd2PIsS; 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=oARqdhH9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (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 4Vg08s0BbNz1ydW for ; Thu, 16 May 2024 16:11:24 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 893E741C2E; Thu, 16 May 2024 06:11:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id bYXt0pcF1XaD; Thu, 16 May 2024 06:11:19 +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 smtp2.osuosl.org 3F62240470 Authentication-Results: smtp2.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=hPd2PIsS; 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=oARqdhH9 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3F62240470; Thu, 16 May 2024 06:11:19 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C6054C0072; Thu, 16 May 2024 06:11:18 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6AB5CC0037 for ; Thu, 16 May 2024 06:11:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 505FB4056C for ; Thu, 16 May 2024 06:11:17 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rphK41nENk5R for ; Thu, 16 May 2024 06:11:15 +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 smtp4.osuosl.org 9490C4032A Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=nutanix.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9490C4032A Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=hPd2PIsS; dkim=pass (2048-bit key, unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=oARqdhH9 Received: from mx0a-002c1b01.pphosted.com (mx0a-002c1b01.pphosted.com [148.163.151.68]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9490C4032A for ; Thu, 16 May 2024 06:11:15 +0000 (UTC) Received: from pps.filterd (m0127839.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44G19Oqt021489 for ; Wed, 15 May 2024 23:11:14 -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=uCQeYCvmyzX bF4evC4+mE29B44Dio8XhMTpxTdPsJ5c=; b=hPd2PIsSxFgtqY+fxIJ1Ad7IPH7 EdarZdk2M/7EgKKTsV+m0sdgSaqKupjhoRCAaBNhucikraXLyiMeYTf3ncKzbKZ1 /V/VUxJmyXw/0H0u6x7Lfrg0YLsG8HI8p/Wvi5ogR8PGoxeK/oKBISy3pPgAZmhs 6f113ZqsNXiXSXwFRyHKT8cGyuvWOtEpeHlTcdG63uBzWFTgQWNNvpctdjomjJqP +DwEi8l4kkLVzz8eWGEekcJoJEmL3XzRut062+gCrttiqgf0nrOI8WNrueE8gRXT iBYqpGuCjZvt7D9rejW4h+yIgR+z0dtU5bki1I/mxFshzoe9zequsCjR81A== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3y27rdaauj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 May 2024 23:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+lCHb9k/CbrUjhhTRhhuiu52cNi1VumuKBxByJ4PRLA1jJg7VD90ylCqRuf57wmqyoql88TKT5OpcE3G4CKYj0Z19VS39ovP0DmdXbYQPPve/JUrTcTu8Dj60n7YKvQMha/23xOu6CNLKqu3JtBRxRWaSxTP1MQLLGoqcSk4xsyCKFQncOYtdQuqn3YO63AD9OSyzhJNO8eEkQ8yYKA7oJ7IZ+eELfm270vLhIRw3XfBhOnFMsp5MNx6n5BmFECIYBekxizCqxyGYiZRijt4+4JXT+pHnQ6oHoOJjXadBKSEVxfiPvNlwo/HXtIhN4ZCE8yTnDDj6bc5/zougLaEA== 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=uCQeYCvmyzXbF4evC4+mE29B44Dio8XhMTpxTdPsJ5c=; b=mhBe5MExe5LM/opIgcEtacTLatDH+1I0zolw9WTG8NGH6qSP6m3PJ5PhG7bP4ZpKGT+Xg4ySP1RQZ/cD8sxHAgRH4qN/TpsGWHrFYJzQEyueV0CSUoooxWrNfm9YIqdE4iaPHTxPc1/+QlYi8Sgi0TUzEElCjZ2YC7QmScyW3sbi/gPUY1wL0PLJnmqz7wdsM09Rdsl+9lWj01MVvpYzIu8XI3qyMu/K4O0IWoi7Aan7nnZ91Wx/CxRp+yZslH6qbM3NgEEdT1utdG4bYGhCGe1rnLjMRM0IW2sIY2VZ/lIEvzJN4/Y5S9qMCdNDjBZBWkrlZDWRBM1/dUExXFw9qw== 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=uCQeYCvmyzXbF4evC4+mE29B44Dio8XhMTpxTdPsJ5c=; b=oARqdhH9u+2TTylfV6EkTUCxyaVYuDqwIkzTDSEJXTYFPwVQHYBq06vA1bFkog7cVHspmag0Rh74/2a801OdvIRljoel/Of3Lthdn67VOTaSidMURBsZNsrJiVzUyivkU+t5Ml/vpzfVb5tyBQs7XzymZkbpdmxMLr7IKkMoHH5GHTLTy662uKshM+KdACAZGtaBPU18YDI3nF0tC8qUX3LTrx10S7GdqKgP9RtyHCtz/nlJ63urYO8BOXtXDxe1H3fpkmItsdFlQIdr+umD1RhMupwOGVDxBIAjnk3yUapjtyV/5sUBoQ441oHHewBxqxeblOFsvgBX4ODE2hNVQg== Received: from DM6PR02MB6747.namprd02.prod.outlook.com (2603:10b6:5:220::15) by LV3PR02MB10127.namprd02.prod.outlook.com (2603:10b6:408:1a5::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.26; Thu, 16 May 2024 06:11:12 +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.7544.052; Thu, 16 May 2024 06:11:11 +0000 From: Indrajitt Valsaraj To: dev@openvswitch.org Date: Thu, 16 May 2024 06:11:08 +0000 Message-Id: <20240516061108.50291-1-indrajitt.valsaraj@nutanix.com> X-Mailer: git-send-email 2.22.3 X-ClientProxiedBy: SJ0P220CA0010.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::14) To DM6PR02MB6747.namprd02.prod.outlook.com (2603:10b6:5:220::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR02MB6747:EE_|LV3PR02MB10127:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d478012-a0ae-4244-7416-08dc756efc26 x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|1800799015|366007|376005|38350700005; X-Microsoft-Antispam-Message-Info: ItfqqPW1f3E123qab+j2xDtIdyXHjp+9sPKskZVLA9WbaWuvMr+UiK5O59WMH8A3fSc0JuC94Gm4BYjINhvAFjxUbGl4u4Z7mo4yVPiet7vAbyYe3YizxsMuy0ozkpWj5gUYQ1QKZWNffuQv66DoXE4gG6C0AboZZKrRFm7GUWP4TPtJkk+ic1cYYWMxl4pA57YWGrIAcGUXB31PlgVOZng783Pqa4fNsTeqX26po5w5eSLvbS8jkYj8yCX84rAYLMDZdyEJh/hJipy4QlDv4Q6MZ161NrN66++wMyn66v6zqSXc9fsfh6U6TMI7a3ANSAPvL3MI3EWlkMjH+cACTYuKSC4W8Q3jx3jc5wu05hthpArvUxzmucYkDWa2cJP1kCxx7HdS+LTHK2c8x+yeMUZFKKzrnnYwyKDyO2aumI+/7563tcBBW02H+zC+vQSBj2S5BoDNbgJDaHt8i6RtmBUnLnUMKKKlo0/GJ3LUAc6SfhjqjLaic6obbCUzbWz55jgcfgrHZj2ZEdqwPHLEpxKjTgJZ9TX0CURS6w+4Wvdmx4Fyg78pmw4N8lVHVL9cetTzLqpTietkbVgwlB/UX0M66JSKUMKZQP0U+ufLqk/jFntPnU8aE1VnfWaEInp01Vuxre1HSPpJ+gxO0MQnbNid8qxBLYqU677NzvRgwZM8TNduLXxDnFVH6K3oU0wQ+7K3tPc6bZ/7eTOyOWHzNfXmpwAjJvY7V7IEi8uoueGqTzWGIxDvBlD5y5x4E3uf0nRUC3ZS5LHT6lKjOcdT3P3yy59ltQf6Rvq5j3h92YzcFutTk9hR+NBzq6zGWW5Be7APVanPnJxJ3N3SYBuXl7cum20DndiAGJCTiL8AhLpfH3Xd/1+3BcRHjpVIlu0/lFbPbnyb9nJAHBds9Qveu3xWE9dPVhgm45pywnYS162SIYnHCft/4GrMo/vBLGucmR5IjPSDPk5eBpd8zQwp7+bOi/nZCsczdBgl0AjOm5rzB4pnKFni7fKLdSGPtAfTJHCMoqdQRxxP8qEvgbWv8zXTggCU85xyy9jHrWdUZGLHKSEC0zoXyqGFZ7w6KnvEwNbehViZYU8L87e844ubmVXOLcwqQ0BCNWBO+sCObMBqu7ja6z5Bj8HQnf0fiSnO2+aJSTTRxuYpjH1otymjiLM0Zi5+3tZf/yokTUpS9Mp95FWmt9eRBwGBdLdp5xbdsqj1q6YuVUGy5wyO6UsRREP25wsARFYkLNz9OXxHW2urPrYMvwqHgmVybx41Y6JXQZs+5WlqLaQHlOBBQjfiZlx50ZCOa1lZrNDjjJ2ZXTZt3DoUoOlAOcRKdXTOgjff5cwsvSxlTywva6iIhuXn6w== 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)(1800799015)(366007)(376005)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gKncke/crhevKNMKYsWqk1TdhrmusiQwtHhxelFlJABS7ABKpplYllR9pSuVu/Mr7f03p1S1RaN94/8KnY6XuR/BP7l6wjmc3ZYR5Mb3zjJoz5REkA36LkaFdZY/yq/HIJV9Le9xvU2IK6/MNo77qNoQ4IgEBriYY7C1P83GNLy5XQ/+y0JeTGbZgxwoSInTAvsxSLyb5k+HW/D6zcgT4hwXRhgYKv37O+O+tPt5H9AAwiFsrgNqr/r02ewkxSHuj9RIDMqCug8SEID3tQwgE1HOFT9FD+rTpPuc9RRNz9dgSTkFJzAhp1oRhvEjgCpvwcBGeD1p10kMk7H+e1si0VjU53zsKWkCtHjLYai+pa1Oy2g0j7qFPfCXD6EXaW4YEn6CIyCTJFHfGhPMgdPy67EGr+uuihz4DZ5R74NdL5bWesHNKZcL6zs90UEtEL1Pn31yrz+Q4pS6LX6ja6BvUaAUqn1f3pf5Y62Z2YWYEEJGXVvLosX4sqwWPvRQJmpUyfOKZm8BXwj6fAFIE6+85Y0ZOTWkiGsK07CZr1KpYSIjODT/YS/W1/hHer8a3mgvjTg2wwEH1+mi/xgq64abzdOjZHr5iIhSaz10J2jdPK/1a4ShrH5H35KG9dPYHQZOx+UrTvJy8ydGsSjUEY7ZVo7H/hpjDB6riLSfYbaWuzciJB+FAh43lhJ5by3fz2T73TIjpT6ED7lEKpnRdZEKgNEzc3iV8yJGyU4XS2/IKeqGXu2gVqtP4yZsjLexX8sIGJ98b7s/0y+huZGcrpufdKDf8gePreQXBApyrOw2RjM/Vi5cVNAec7uyXzvuTC/ICqU2AYtsM1nQG7PEe0yUudPjXMKOcLiZSQz7AGOdQsmrHW+CJklq7a8ZWKjv6UV23QkRuF9n8yGnDxuAnRJ91SCAsoBFeTr4C7F8fqUnDtI+KIJhdztK3eDvCeMHk3bjMjI4+yB6yVlkxrc4TjTedZP3ueqFTlOuKPVEzsRxCHSSHDx99dW67VLViQuooht0Kk6yZYjb3X38o2YfuANyWRCnLebrRdipAwiQVA3EbzRF9AdDvS+xKkAV48G4GxlfZOIEePiFrYTlsTt+a7AelrTBORAkIqm6CnlOoAjI6yjl2t7pZDJa9QKK2nLUglzsj2eOISGEUlAT1SB5NcxXFW96Zedm+XtVJA7SjnxVfvxQayUPI6CzFQ4NTFq8/slT4rb8DXwqNg/nBxcqGLlTAOqZqE6y76qOB/H+C6ItpWU11F8tAXIvtjx4y29cIJMZfpDlkHKPy9xys/tT2u1FsWajTPvZq0/WN7jyr5V2sb8lbuMMz92i5G5b1ohqXk0Oc0tmZLyu29e5Ovg+DshBLfsctlZZ0jMOW6vddxdSkQ4ofwrclsH87CcFMaNeJlZasxeAMqopWmjGB/mKHCTR2yTYJ9lz0DvwLSLcB05H2zfkewjC8mdQfDaRBZW1Vv1+QaygCbEIYVXTiBT2iU5K5mmYbw0PlQJkvzFtkyeZSfIXcwAfZvizcGFteA1vwpZqItblldf3QLRU1f15u+r5pxO6nwzPETRtC959+46AU27DiiEq9ZqbO7ekV+iLnxaOoUlIiutvWT5sWIFHIkxA1sLvADL7da9sy99QcshMnJQ= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d478012-a0ae-4244-7416-08dc756efc26 X-MS-Exchange-CrossTenant-AuthSource: DM6PR02MB6747.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 06:11:11.8056 (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: 2HbZZ35VgqgpQQaCjnY+gbpmcIZqk9jpFe/hKdRgucwwGR2/7E+H5wR3xomMujVC+Be/hSN9VUOvIICYeNluh47ZhHVsNm3U/bsR7jFtzG4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR02MB10127 X-Proofpoint-GUID: Jlx9Yuqs-78Rl14DH4Cyko7NrYm6iRnk X-Proofpoint-ORIG-GUID: Jlx9Yuqs-78Rl14DH4Cyko7NrYm6iRnk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-16_03,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Cc: Indrajitt Valsaraj Subject: [ovs-dev] [PATCH ovn v1] 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 --- northd/aging.c | 2 +- tests/ovn.at | 97 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 67 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..8d5512bf2 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 @@ -34613,6 +34630,24 @@ OVS_WAIT_UNTIL([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) sleep 5 AT_CHECK([ovn-sbctl list mac_binding | grep -q "192.168.10.10"]) +# 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]) + +# 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 ])