From patchwork Wed May 31 05:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priyankar Jain X-Patchwork-Id: 1788136 X-Patchwork-Delegate: dceara@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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=L4VBmvLv; 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=KpWj8SNT; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QWJ0Q4KMQz20Q4 for ; Wed, 31 May 2023 15:36:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 172EE61148; Wed, 31 May 2023 05:36:20 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 172EE61148 Authentication-Results: smtp3.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=L4VBmvLv; 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=KpWj8SNT X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V5JL4O-KV0Lf; Wed, 31 May 2023 05:36:19 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id E61F66107C; Wed, 31 May 2023 05:36:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E61F66107C Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id ADC29C007C; Wed, 31 May 2023 05:36:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 645CAC0037 for ; Wed, 31 May 2023 05:36:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 3507841F2D for ; Wed, 31 May 2023 05:36:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3507841F2D Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=proofpoint20171006 header.b=L4VBmvLv; dkim=pass (2048-bit key, unprotected) header.d=nutanix.com header.i=@nutanix.com header.a=rsa-sha256 header.s=selector1 header.b=KpWj8SNT X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EbOIl1Equ0EZ for ; Wed, 31 May 2023 05:36:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 837E441F2C Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) by smtp4.osuosl.org (Postfix) with ESMTPS id 837E441F2C for ; Wed, 31 May 2023 05:36:13 +0000 (UTC) Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34V0Q6RO008362 for ; Tue, 30 May 2023 22:36:12 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=proofpoint20171006; bh=zdczWPcEdEJnsRzwtXpfV/llCAjfHL+Uk2KXZXEX67I=; b=L4VBmvLvUc9VpLR8CzvCLcISjpSRVgH96d3kwEGCEayIGCwdgNWUrcqhokNWSoBgkgfN +MEzQ7dZSEnfTHhQq7pMo8uaJpzETJ2SjhYhM5A5wv+yeyvFPlBr1+wMIWvl0EX5XW9C jpYaOT29fH9sxnmYiLSocWoD+ZXDvyrh4QauPEnsoQXiMFUFz7V238nZrAEZ3QV7HP/J qpNIFE28daKoO8rpB7q92aA+NXTRZy/Yqah7Et6pSK3DhUoOVbawFQrnOdOMMamyfYyu tBh4sLoTEjOMh6XvyWoHvmY8HiW+LskhkW2SacQ0BBDFLBdShyeI+LBgf2QCJ10fpXIw JQ== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by mx0b-002c1b01.pphosted.com (PPS) with ESMTPS id 3qufd6s4pj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 May 2023 22:36:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0ZTpvotxKCLeCcLNPSI/gTCJEjKte3Pfhlz20emm6+jPq9sTP6evOaB48PRXvbxKCT+j6Mrp8Jo/L9vybl6eHRnyCnD0P0Kq7qZkUUh/No5yNUq7iP2RCCxodskZXeUHrqHtz948ly02nrfvTgxoJl3wSPUwZrz69dGCkcTYwuUlKynpjss2pC2sMf2/a26V5zhcfUH3DNg/23ahNj1dQ//LhYf76/SobzjrQ2LVrBT8zWwjzd2OkTQJ70uLnvW+n3s8ADx6RgCAyPR9PB6PkHNML6vT6Hveebi/WNJL+fPYl4zE8ahWdDBaD1C27nr5rlxtDZIG3IgkehkIMNFCw== 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=zdczWPcEdEJnsRzwtXpfV/llCAjfHL+Uk2KXZXEX67I=; b=f9l232vSIMP0EiqsaqEAcwqP5PAWLBX0/WvLWyRLOJ8/x17ku2k28QKe5iC/zDHviIdO5Q49SaTQh6hXTq1Do4DCIML/N0YTnhPl3OeTFFnl5TmkKfd5HKi1mSdMq0QFhLgo5dQrPwMaD2vEIHZ0NbBQEpa4f5evhhEt//+lo6Bl41KJ8bLvZ26ufAhrcCVMsCwYPrS2q+Jny4rjeFuP5AOB+UolmMVAdAqu/vZ6jGDRPluFqCcZJub98ZIBAv+0zIbPlRfnqw9AevfU7Bq9qrf0zPoBA9OejCFkfpTk+14XR1O+yaY3iLU9a8/z+62jM8U2G4njhTLpscLZolenXQ== 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=zdczWPcEdEJnsRzwtXpfV/llCAjfHL+Uk2KXZXEX67I=; b=KpWj8SNTIpbla/WPVHY8yjk5KUYKaADIIvEA2tkbIqHXrLJUOyN6/aOeV9rxP7yC7k6QxLrR9qsCv+adhX1liu+xLi/ma9mvZ8rNp0BvykSdgjyDde4h5z17SMNm6AZa/oWszz+xqmiww64c5uOR3X3VVtC3vPvWBZSpDl1r+XBg6KhwYcLUYbSyz+wuj+vPjKVZkoVbTV7Rtl+8QJKhn3yr+8HS3F9YMFzOLdttEIQSrd/qtz/554RMnpofVpRTeF/lBquEkcMTCQn0Gr/P4c/XC1zt5fAmI6jhAJDPflECWsBEHEwM2c5BwSorm0giMkMprjJC+io6aIdCRQSfIQ== Received: from PH0PR02MB7496.namprd02.prod.outlook.com (2603:10b6:510:16::12) by IA0PR02MB9630.namprd02.prod.outlook.com (2603:10b6:208:40b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Wed, 31 May 2023 05:36:09 +0000 Received: from PH0PR02MB7496.namprd02.prod.outlook.com ([fe80::2499:d414:2357:ab14]) by PH0PR02MB7496.namprd02.prod.outlook.com ([fe80::2499:d414:2357:ab14%7]) with mapi id 15.20.6433.022; Wed, 31 May 2023 05:36:08 +0000 From: Priyankar Jain To: dev@openvswitch.org Date: Wed, 31 May 2023 05:35:49 +0000 Message-Id: <1685511349-156407-1-git-send-email-priyankar.jain@nutanix.com> X-Mailer: git-send-email 1.8.3.1 X-ClientProxiedBy: BYAPR01CA0032.prod.exchangelabs.com (2603:10b6:a02:80::45) To PH0PR02MB7496.namprd02.prod.outlook.com (2603:10b6:510:16::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR02MB7496:EE_|IA0PR02MB9630:EE_ X-MS-Office365-Filtering-Correlation-Id: 883a7dcf-925d-461c-7185-08db6198ef8d x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ku0nBs5cQQMk7AbvP0bA40HfF70lyDJPy3iSJ95kwpOF0dgsYVit2QOz/gwWgBIct7oqfbL5YMtxK0fl8Kea4hd8rFbUNRzdSjBlU3AL1r3d8iMvRmd33uMBLInHB7oKVvCHLwl9s7FMN5iO1VTnUEiRJnsHqUSq5LALXh7TQlK7zzFjDH5jqGELkFa7MV6sgk4iQnErRdHJJo31vP+xqwnshag2SlxACYoIObI8Hfj+/gbdjku50nMA3ggaCk+WOhp8dZ1BEcJOHXjU7UwvE5hjEcnFUlKwCciBe7pBG3ywhIGAN1GSTsY30EfvX+nUjhNM1ox1e74xTM8hVMJxKc6nwvUMM2FK474EQKofqNrqLgCrYR+BIKfy8CbggDxXPECsN8O7ocDcw18MzOpyQbQy5rJc2NnLvj478IcBROmLSPwJWyRECLif0BVIoovwSl9AqWgcC3pmUDC9vcbwJb1jBifJJ/u3qBzAklEPt/bFBQcn0wEvCsbzqwW56UIwh88vfPchXFnkkZxdTK5bxY3/0gYUD6ftZtCmIeNWH/hpjxpiRSdmqp543BFRCnHnT7dmukEFovIy4Aw1TrZrGWzofflgqKJxE6KqNX2lTaMvscyOtPJ5uDGF5mGcXTvy X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR02MB7496.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(39860400002)(366004)(376002)(346002)(396003)(136003)(451199021)(478600001)(6666004)(66946007)(66476007)(66556008)(4326008)(6916009)(316002)(44832011)(2616005)(6506007)(6512007)(26005)(5660300002)(8936002)(41300700001)(8676002)(2906002)(186003)(107886003)(83380400001)(38350700002)(38100700002)(36756003)(52116002)(6486002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NALTZVnyIedqqBXm27QThtaRgV/g0V/ZC9H3O7pTfHLZifN1unBGf+KHwxWrVf3y0yxot0St4LNOheGC0m40E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MerX7JF/1CfLxpPO0QjQo2D4Vk8BT/1mWYffFJc0+5WYiN9+wDweTqM2FUzL7UCbYoigbnj8FuBs1yohVTxIZjZ7P8sIwqHToKJf+LYJkXp5fJFTlkYtBxwJ5mQF0DXN4/X1tVBfvfMResxnvjazkj2VqO3n9OgoGKIfekzJLxu9mk5H3PMuKT+4xsfnzD+QDqSYRen5Q5dcNzZEwhLXBmBSawuzF4gz4HFNwnorBKplagZxMVp34U2gQU5QNFIJXnci1k/PxqMVk1twx6RVcdkXkVHq6JB/50QyfhUywo9C+jOgz/2PvpvnXJHI2AdBP76tgtyBckR+Krd/EPdYNNU84Svte9Fevmk3UeXQz1t0bjGyctr++p7BPLkm6pVNfrdVfa8oXR+jfTd8ImAFQD0B7EPmzOr4yOTcv8fqyKtjAYuFfji6BkHBVWyayAp/Z41NbVFA== X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 883a7dcf-925d-461c-7185-08db6198ef8d X-MS-Exchange-CrossTenant-AuthSource: PH0PR02MB7496.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2023 05:36:08.7030 (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: u51vb7SLCQImRcRGId5Rg0PUjH3lYuU1oPO1A3XZzmxfhkP4j+wAR+tipSYQg/N45qJaXnP1s/6KwaOnyyZgo1RjyQI9JRuPbdh8QjVgvMo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9630 X-Proofpoint-ORIG-GUID: 6Q0eFic0A1ZXj2uTDyPf7hKh7CwMno_Q X-Proofpoint-GUID: 6Q0eFic0A1ZXj2uTDyPf7hKh7CwMno_Q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-31_02,2023-05-30_01,2023-05-22_02 X-Proofpoint-Spam-Reason: safe Subject: [ovs-dev] [PATCH ovn] Remove lport from related_lports if there is no binding 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" Currently during port migration, two chassis (source and destination) can try to claim the same logical switch port simultaneously for a short-period of time until the tap is deleted on source hypervisor. ovn-controllers on these 2 hosts constantly receives port-binding updates about other chassis claiming the port and as a result it tries to claim the port again (because its chassis has a tap interface referencing the LSP). This flapping ends once CMS cleans up tap interface from the source chassis. Now following steps occur during a single iteration inc-proc-eng during flapping: 1. PB update received on OVN controller about other chassis owning the port. 2. ovn-controller tries to claim the port. 3. It installs the OVS flows for the port and updates the runtime_data to include this port in locally relevant ports. 4. If some change to runtime data happens as part of 3, port-groups containing the affected ports are recomputed. It uses related_lports runtime data to compute the port-groups. Finally, ovn-controller sends a port-binding update to SB changing the chassis to itself. At a later point of time, SB sends the notification to ovn-controller about (4) being completed. Once CMS deletes the tap interface, ovn-controller receives the notification and updates the runtime data accordingly. Issue: ovs-flows are (sometimes)not cleaned up upon port migration. If the notification of OVS interface deletion is received before SB acks the PortBinding update, then ovn-controller does not cleanup related_lports leading to incorrect port-groups computation. i.e if the order of events is as follows: 1. PB update received on OVN controller about other chassis owning the port. 2. ovn-controller claims the port, installs OVS flows and sends the PortBinding update to SB. 3. OVS interface deletion notification received by ovn-controller. 4. SB ack received for step-2 PB update. This commit fixes this issue by removing the logical_port from related port even in case there is no binding available locally. Signed-off-by: Priyankar Jain Acked-by: Mark Michelson --- controller/binding.c | 1 + 1 file changed, 1 insertion(+) diff --git a/controller/binding.c b/controller/binding.c index 9b0647b70..9889be5c7 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1568,6 +1568,7 @@ consider_vif_lport_(const struct sbrec_port_binding *pb, || is_additional_chassis(pb, b_ctx_in->chassis_rec)) { /* Release the lport if there is no lbinding. */ if (!lbinding_set || !can_bind) { + remove_related_lport(pb, b_ctx_out); return release_lport(pb, b_ctx_in->chassis_rec, !b_ctx_in->ovnsb_idl_txn, b_ctx_out->tracked_dp_bindings,