From patchwork Thu Aug 18 14:00:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xavier Simonart X-Patchwork-Id: 1667706 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=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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=ZZKLwvTT; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4M7mkS3hYNz1ygd for ; Fri, 19 Aug 2022 00:00:48 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B7608411A0; Thu, 18 Aug 2022 14:00:46 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org B7608411A0 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=ZZKLwvTT 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 7j_YH3MCCbHS; Thu, 18 Aug 2022 14:00:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id E7969408B8; Thu, 18 Aug 2022 14:00:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E7969408B8 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BE9AEC002D; Thu, 18 Aug 2022 14:00:44 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 63384C002D for ; Thu, 18 Aug 2022 14:00:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 205F4408D8 for ; Thu, 18 Aug 2022 14:00:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 205F4408D8 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 9cLhUMko0zpU for ; Thu, 18 Aug 2022 14:00:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 70332408BB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id 70332408BB for ; Thu, 18 Aug 2022 14:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660831241; 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=2GTZU3lioK9U8jZfe2/r8geWldrHx6nRZcBQBR00bBw=; b=ZZKLwvTTs6KomkVHONEEttFu86v7tbhlJqZLeQcU8RgI9fxSfJv2z7PSYj0YAkut7Xq0Me gerBny1ZZ08kQlGmEyIDCIftMOa/CfEZT1NL9gFmy389xu8vJpVSQWGmYi4hZs8X+G03HZ 2417Y/PiHLJCDqOBx3IUJwsUnDi4oak= 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-615--ykuTiUMN-6Nam3Y9A2z4g-1; Thu, 18 Aug 2022 10:00:39 -0400 X-MC-Unique: -ykuTiUMN-6Nam3Y9A2z4g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5EE09185A7BA for ; Thu, 18 Aug 2022 14:00:38 +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 480B42026D4C; Thu, 18 Aug 2022 14:00:38 +0000 (UTC) From: Xavier Simonart To: xsimonar@redhat.com, dev@openvswitch.org Date: Thu, 18 Aug 2022 10:00:38 -0400 Message-Id: <20220818140038.4148633-1-xsimonar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] pinctrl fix missing packets (e.g. icmp) 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" seq_read should be used before processing any changes. If buffered_mac_bindings is updated by pinctrl_run while pinctrl_handler is running, but before seq_read, pinctrl_handler was not being woken up (until another event wakes it). This could cause icmp packets to be missing or delayed until the pinctrl_handler thread is woken up by another event. Note that with this patch, pinctrl_handler might be woken up for nothing. Signed-off-by: Xavier Simonart Acked-by: Mark Michelson --- controller/pinctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index eeb6f7527..a8a307a56 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -3460,6 +3460,7 @@ pinctrl_handler(void *arg_) ovs_mutex_unlock(&pinctrl_mutex); rconn_run(swconn); + new_seq = seq_read(pinctrl_handler_seq); if (rconn_is_connected(swconn)) { if (conn_seq_no != rconn_get_connection_seqno(swconn)) { pinctrl_setup(swconn); @@ -3506,7 +3507,6 @@ pinctrl_handler(void *arg_) ipv6_prefixd_wait(send_prefixd_time); bfd_monitor_wait(bfd_time); - new_seq = seq_read(pinctrl_handler_seq); seq_wait(pinctrl_handler_seq, new_seq); latch_wait(&pctrl->pinctrl_thread_exit);