From patchwork Wed Sep 11 21:18:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1161290 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TsbNt31t"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TFC944rPz9sDB for ; Thu, 12 Sep 2019 07:19:17 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 2D220D4A; Wed, 11 Sep 2019 21:18:46 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E6925B79 for ; Wed, 11 Sep 2019 21:18:43 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9B07E894 for ; Wed, 11 Sep 2019 21:18:43 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id x15so12166956pgg.8 for ; Wed, 11 Sep 2019 14:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/zBlLO7g6z771qLOZG275SNGw40lB8M1fzcUuLzy65M=; b=TsbNt31tBDV+MOPj1hDVEfLcML3mFEeSXMbnoLBlDUL8vSGuSvZsmnPN0SjwBoM/IQ rHKYbu/pHDG3lR+aEwihijOK1iFe6b2grLrRp71bFukFcIG1RGcu26k2ECwEAN64xGCp xuVxMHqL+gfeZvIqD/xuu4phRzPjzv+ZpsbH4PUQ6Epy6k+FO32aGSMi1DyVChnVKSVP X4R8mIvRjnsUDHdxE84Fff+J8RshQ/hbswRHB8ZPFSF/SbomwXybjykCJNqu9j3gQTin oqLEYczkulkjzOFb2zPgOg0hEisx9bDmsgiputDgoxZ2YVIMyYjqDX8orqCPM3EE5Atp /uOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/zBlLO7g6z771qLOZG275SNGw40lB8M1fzcUuLzy65M=; b=h1+/+qgOWy7SUGAx5Pi+pK2k4f5LlFZlNWGvhxhT3CTLlFO0iB/oJXpd7PhbB70Ms8 +hEDVXr7ZuQDeqOaAoM3qcfKFrh7Y4dJ+2YKP9a8bBMLncLU0iH0nhK1hZ/Z9vgGRgxX xFlxuNM0Xc2/cHZMh7XKvojEQV70GKMN2M7VNs6rG3JBjHIgoDSIHBkucSbA1rmBfhae 9W1dUzx8cZ4OW3ihn1wpRf58MH0vKZhWfKyLkyYGuc627lLmC2r6zjVaAzHbHnVh9DR1 d6vYJyfgZBtFh4vD621ZHrdjT5dpATLCXXxSlZDVPQKNCOwgJoUpIKSC31h63ixAfIpL cx/A== X-Gm-Message-State: APjAAAV3PXDJmyEr3A6EgbJhC3yc3taeQgwu36CTatq6NwFjAVgw/ZRX AsHELhAORQrksARW3PVTSjr6D0ww X-Google-Smtp-Source: APXvYqyREL3M+0gcRggR9YMQGN1uSdW2sVKyE2mm8QzrhtDiATSxRq21ol1pqWpE1S4EkKeaEh3XUQ== X-Received: by 2002:a63:ff0c:: with SMTP id k12mr33380572pgi.186.1568236722887; Wed, 11 Sep 2019 14:18:42 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id k1sm24612487pfi.132.2019.09.11.14.18.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Sep 2019 14:18:42 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Wed, 11 Sep 2019 14:18:28 -0700 Message-Id: <1568236716-18105-2-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568236716-18105-1-git-send-email-pkusunyifeng@gmail.com> References: <1568236716-18105-1-git-send-email-pkusunyifeng@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 02/10] ofproto-dpif: Uninitialize 'xlate_cache' to free resources X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Valgrind reported: 1210: ofproto-dpif - continuation after clone ==32205== 4,392 (1,440 direct, 2,952 indirect) bytes in 12 blocks are definitely lost in loss record 359 of 362 ==32205== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==32205== by 0x532574: xmalloc (util.c:138) ==32205== by 0x4F98CA: ofpbuf_init (ofpbuf.c:123) ==32205== by 0x42C07B: nxt_resume (ofproto-dpif.c:5110) ==32205== by 0x41796F: handle_nxt_resume (ofproto.c:3677) ==32205== by 0x424583: handle_single_part_openflow (ofproto.c:8473) ==32205== by 0x424583: handle_openflow (ofproto.c:8606) ==32205== by 0x4579E2: ofconn_run (connmgr.c:1318) ==32205== by 0x4579E2: connmgr_run (connmgr.c:355) ==32205== by 0x41E0F5: ofproto_run (ofproto.c:1845) ==32205== by 0x40BA63: bridge_run__ (bridge.c:2971) ==32205== by 0x410CF3: bridge_run (bridge.c:3029) ==32205== by 0x407614: main (ovs-vswitchd.c:127) This is because 'xcache' was not destroyed properly. This patch fixes it. Signed-off-by: Yifeng Sun Acked-by: William Tu --- ofproto/ofproto-dpif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 751535249e21..46fa1357163b 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -5148,6 +5148,7 @@ nxt_resume(struct ofproto *ofproto_, /* Clean up. */ ofpbuf_uninit(&odp_actions); dp_packet_uninit(&packet); + xlate_cache_uninit(&xcache); return error; }