From patchwork Mon Oct 23 10:04:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1853646 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=YfcAh+6q; 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 4SDW576Fnyz23jV for ; Mon, 23 Oct 2023 21:04:43 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id EF56D4155C; Mon, 23 Oct 2023 10:04:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org EF56D4155C Authentication-Results: smtp2.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=YfcAh+6q X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i04OMnaHCZrX; Mon, 23 Oct 2023 10:04:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 951C14155A; Mon, 23 Oct 2023 10:04:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 951C14155A Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 603BAC0072; Mon, 23 Oct 2023 10:04:39 +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 E4ED8C0032 for ; Mon, 23 Oct 2023 10:04:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B1B0441FCB for ; Mon, 23 Oct 2023 10:04:36 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org B1B0441FCB Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=YfcAh+6q 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 qc-gp63HHgvT for ; Mon, 23 Oct 2023 10:04:36 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 04DEC41FC6 for ; Mon, 23 Oct 2023 10:04:35 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 04DEC41FC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698055475; 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=ObhiNDaq/ft774xHgSIdAdYX3/6r3ywy2X5U4Dpm0/8=; b=YfcAh+6qxjGpLCnu509hjfac9qh+mK6lLqUc4jf5yO1YyfDpMQc4QnYNhfL+PV/plwOmtW Drv+fUykzNl9RcjUdQ5fw5cNx/d0kd3wVL+VyDdwvJIsMutUg5Jsx1muUTjgY/jCuPCXtt C0yObHpa3lnAskS0iTLpXBwGJHu1/Ho= 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-479-sbJvOiQQOQmnm3Ep-n0P4w-1; Mon, 23 Oct 2023 06:04:23 -0400 X-MC-Unique: sbJvOiQQOQmnm3Ep-n0P4w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8F91110201F5 for ; Mon, 23 Oct 2023 10:04:23 +0000 (UTC) Received: from wsfd-netdev90.ntdv.lab.eng.bos.redhat.com (wsfd-netdev90.ntdv.lab.eng.bos.redhat.com [10.19.188.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 775DD1C060AE; Mon, 23 Oct 2023 10:04:23 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Mon, 23 Oct 2023 12:04:23 +0200 Message-Id: <20231023100423.3861347-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-ic: wakeup on ovsdb transaction failures 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" If an ovsdb transaction fails (e.g. adding the same tunnel_key as another ovn-ic to the same datapath, for a different port (race condition)), there was no guarentee that ovn-ic would wake up, and that state would stay until ovn-ic wake up, for instance due to some ovn-ic-sb changes. Signed-off-by: Xavier Simonart Acked-by: Mark Michelson Acked-by: Ales Musil --- ic/ovn-ic.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ic/ovn-ic.c b/ic/ovn-ic.c index e2023c2ba..bb91bad11 100644 --- a/ic/ovn-ic.c +++ b/ic/ovn-ic.c @@ -2216,10 +2216,19 @@ main(int argc, char *argv[]) ovn_db_run(&ctx); } - ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop); - ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop); - ovsdb_idl_loop_commit_and_wait(&ovninb_idl_loop); - ovsdb_idl_loop_commit_and_wait(&ovnisb_idl_loop); + int rc1 = ovsdb_idl_loop_commit_and_wait(&ovnnb_idl_loop); + int rc2 = ovsdb_idl_loop_commit_and_wait(&ovnsb_idl_loop); + int rc3 = ovsdb_idl_loop_commit_and_wait(&ovninb_idl_loop); + int rc4 = ovsdb_idl_loop_commit_and_wait(&ovnisb_idl_loop); + if (!rc1 || !rc2 || !rc3 || !rc4) { + VLOG_DBG(" a transaction failed in: %s %s %s %s", + !rc1 ? "nb" : "", !rc2 ? "sb" : "", + !rc3 ? "ic_nb" : "", rc4 ? "ic_sb" : ""); + /* A transaction failed. Wake up immediately to give + * opportunity to send the proper transaction + */ + poll_immediate_wake(); + } } else { /* ovn-ic is paused * - we still want to handle any db updates and update the