From patchwork Mon Jun 26 20:45:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 9810421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51F7B603D7 for ; Mon, 26 Jun 2017 20:45:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EFB327853 for ; Mon, 26 Jun 2017 20:45:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 437B727F81; Mon, 26 Jun 2017 20:45:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B9727853 for ; Mon, 26 Jun 2017 20:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751461AbdFZUpn convert rfc822-to-8bit (ORCPT ); Mon, 26 Jun 2017 16:45:43 -0400 Received: from smtp.opengridcomputing.com ([72.48.136.20]:37112 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751403AbdFZUpm (ORCPT ); Mon, 26 Jun 2017 16:45:42 -0400 Received: from cody (cody.ogc.int [10.10.0.240]) by smtp.opengridcomputing.com (Postfix) with ESMTPS id CC8EE2B7F3; Mon, 26 Jun 2017 15:45:41 -0500 (CDT) From: "Steve Wise" To: "'Dan Coombs'" , Cc: "'Michael Chen'" References: In-Reply-To: Subject: RE: IWARP Valgrind Issue Date: Mon, 26 Jun 2017 15:45:44 -0500 Message-ID: <006801d2eebd$2e54ba60$8afe2f20$@opengridcomputing.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKQtA3d1UmJpSJ2rfSvFcxOE0yqvqC8D7xA Content-Language: en-us Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hey Dan: > > Hello, > > I'm getting a valgrind error when using the cxgb4/iw_cxgb4 drivers for a Chelsio > IWARP card. > > System info: > Distribution: Ubuntu 16.04.2 LTS > Kernel: 4.4.0-79-generic > Hardware: Chelsio T420-BT > Drivers: > Chelsio T4/T5/T6 Offload Network Driver - version 3.2.0.0 > Chelsio T420-BT rev 2 > iw_cxgb4:Chelsio T4/T5/T6 RDMA Driver - version 3.2.0.0 > This is Chelsio's Unified Wire package, yes? > > Bug: > > Running with sudo valgrind --leak-check=full --undef-value-errors=no > > 12,720 bytes in 1 blocks are definitely lost in loss record 146 of 150 > > > Call stack: > > ibv_create_cq (verbs.c:328) > c4iw_create_cq (verbs.c:245) > calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) > > Code simply opens the device, creates a completion channel and a completion > queue with ibv_create_*, then destroys the completion queue and completion > channel with ibv_destroy_*. > That looks like a bug in Chelsio's Unified Wire libcxgb4 core (ie not in the upstream rdma-core libcxgb4 code). I See the leak. Something like this should probably fix it. Steve. --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r fbf715bf1eb7 linux_libs/libcxgb4/src/verbs.c --- a/linux_libs/libcxgb4/src/verbs.c Fri Jun 23 13:44:07 2017 -0700 +++ b/linux_libs/libcxgb4/src/verbs.c Mon Jun 26 13:43:52 2017 -0700 @@ -304,6 +304,7 @@ int c4iw_destroy_cq(struct ibv_cq *ibcq) dev->cqid2ptr[chp->cq.cqid] = NULL; pthread_spin_unlock(&dev->lock); + free(chp->cq.swiq_queue); free(chp->cq.sw_queue); free(chp); return 0;