From patchwork Fri Jul 15 06:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangchuanlei X-Patchwork-Id: 1656886 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lkskh0Lndz9ryY for ; Fri, 15 Jul 2022 23:33:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E16EB41934; Fri, 15 Jul 2022 13:33:29 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E16EB41934 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 8gCPLTJmH0Qf; Fri, 15 Jul 2022 13:33:28 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 9585E427B3; Fri, 15 Jul 2022 13:33:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9585E427B3 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 80D99C007F; Fri, 15 Jul 2022 13:33:25 +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 BE8B1C002D for ; Fri, 15 Jul 2022 06:11:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 93B3D40176 for ; Fri, 15 Jul 2022 06:11:17 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 93B3D40176 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 GbiDQLFrbvW4 for ; Fri, 15 Jul 2022 06:11:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3897E40002 Received: from ssh248.corpemail.net (ssh248.corpemail.net [210.51.61.248]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3897E40002 for ; Fri, 15 Jul 2022 06:11:15 +0000 (UTC) Received: from ([60.208.111.195]) by ssh248.corpemail.net ((D)) with ASMTP (SSL) id JDA00108 for ; Fri, 15 Jul 2022 14:11:08 +0800 Received: from localhost.localdomain (10.180.206.78) by jtjnmail201609.home.langchao.com (10.100.2.9) with Microsoft SMTP Server id 15.1.2507.9; Fri, 15 Jul 2022 14:11:12 +0800 From: wangchuanlei To: Date: Fri, 15 Jul 2022 02:11:08 -0400 Message-ID: <20220715061108.609594-1-wangchuanlei@inspur.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Originating-IP: [10.180.206.78] tUid: 20227151411083493b5397ebead3d81427ad642220ac0 X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com X-Mailman-Approved-At: Fri, 15 Jul 2022 13:33:24 +0000 Cc: wangchuanlei Subject: [ovs-dev] [PATCH ovn] pinctrl: fix ovn-controller abort when service start. 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" Hi, when start service ovn-controller, the br-int may be not connected, in case, swconn->version = -1, on my enviroment, i have loadlalancer, in the process of sending health check packet, ofp_proto is 0, which will leads controller serivice to abort in ofputil_encode_packet_out. So this patch is to avoid this problem. Signed-off-by: wangchuanlei --- controller/pinctrl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index f954362b7..2fcf91bc9 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -3454,11 +3454,11 @@ pinctrl_handler(void *arg_) ip_mcast_querier_run(swconn, &send_mcast_query_time); } - } - ovs_mutex_lock(&pinctrl_mutex); - svc_monitors_run(swconn, &svc_monitors_next_run_time); - ovs_mutex_unlock(&pinctrl_mutex); + ovs_mutex_lock(&pinctrl_mutex); + svc_monitors_run(swconn, &svc_monitors_next_run_time); + ovs_mutex_unlock(&pinctrl_mutex); + } rconn_run_wait(swconn); rconn_recv_wait(swconn);