From patchwork Thu Feb 8 20:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Michelson X-Patchwork-Id: 1896763 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" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SP2U+S1R; 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 4TW8HK05tkz23h4 for ; Fri, 9 Feb 2024 07:49:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id ACA7883C6A; Thu, 8 Feb 2024 20:49:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bNsWMqohyNqx; Thu, 8 Feb 2024 20:49:28 +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 6604483BFE Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SP2U+S1R Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6604483BFE; Thu, 8 Feb 2024 20:49:28 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4834DC0077; Thu, 8 Feb 2024 20:49:28 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 61BCEC0037 for ; Thu, 8 Feb 2024 20:49:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 5108E6FADD for ; Thu, 8 Feb 2024 20:49:26 +0000 (UTC) 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 F3_cTxWs142Q for ; Thu, 8 Feb 2024 20:49:25 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=170.10.129.124; helo=us-smtp-delivery-124.mimecast.com; envelope-from=mmichels@redhat.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 5813C60FEE Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5813C60FEE Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SP2U+S1R Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5813C60FEE for ; Thu, 8 Feb 2024 20:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707425363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1P4p6kOqOudChQSy/cgmJVEk3AvekG8wMIEJKTjXfjE=; b=SP2U+S1RHw8A9im0pCeTO0hDJ8joepy59q/edAJbXmbo500/vIgyPw38lWjCZmr48oNtgV FoUw0N6chIwUk8jveaVEp1O0Uba8ngnFPqYqH/RhIAzNropA1wo2OyqRGMKp2mRXAaNZg/ aLQ/p5IJidQmJz/Gj/rpe9fyY8egNHM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-467-RPYUS_fEM5SuYZt1eG6UgQ-1; Thu, 08 Feb 2024 15:49:22 -0500 X-MC-Unique: RPYUS_fEM5SuYZt1eG6UgQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1ABED8432A5 for ; Thu, 8 Feb 2024 20:49:22 +0000 (UTC) Received: from localhost.redhat.com (ovpn-0-19.rdu2.redhat.com [10.22.0.19]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0EED40C9444 for ; Thu, 8 Feb 2024 20:49:21 +0000 (UTC) From: Mark Michelson To: dev@openvswitch.org Date: Thu, 8 Feb 2024 15:49:14 -0500 Message-ID: <20240208204921.932115-1-mmichels@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] features.c: Always wait on the rconn. 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" When performing feature detection with OVS, we use an rconn connected to br-int.mgmt to query for features. If the rconn is not connected, then we would exit early. However, this early exit did not call rconn_run_wait() or rconn_recv_wait(). Therefore, if the rconn were in a state such as BACKOFF or CONNECTING, we would not wait on the rconn's fd for activity. In most cases, nobody would notice this because ovn-controller would likely be waking up constantly due to southbound database changes, handling CLI commands, or other activity. However, in one of Red Hat QE's tests, they were seeing ovn-controller take 10 seconds between when it would start up and when OF flows were installed. This was because the only thing waking ovn-controller up was regularly-scheduled probe intervals with the southbound database. To fix this, we call rconn_run_wait() and rconn_recv_wait() even in the case when the rconn is not connected. This way, if we end up in a state other than ACTIVE or IDLE, we can handle traffic from the rconn when it arrives. Fixes: e9e716ad531e ("controller: Don't artificially limit group and meter IDs to 16bit.") Reported-at: https://issues.redhat.com/browse/FDP-357 Signed-off-by: Mark Michelson Acked-by: Dumitru Ceara --- lib/features.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/features.c b/lib/features.c index 82bce10e9..b04437235 100644 --- a/lib/features.c +++ b/lib/features.c @@ -150,6 +150,8 @@ ovs_feature_get_openflow_cap(const char *br_name) rconn_run(swconn); if (!rconn_is_connected(swconn)) { + rconn_run_wait(swconn); + rconn_recv_wait(swconn); return false; }