public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Steve Wise" <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
To: 'Dan Coombs'
	<dcoombs-LmJBtNfl/RVO0n7uQEQMm4CZgX+1HZI1@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: 'Michael Chen' <mchen-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Subject: RE: IWARP Valgrind Issue
Date: Mon, 26 Jun 2017 15:45:44 -0500	[thread overview]
Message-ID: <006801d2eebd$2e54ba60$8afe2f20$@opengridcomputing.com> (raw)
In-Reply-To: <CY4PR19MB12215AF6E7225113294CF8DB8BDF0-48YGSBrqCmz95OYN2XvIqNvXXbHMiUzJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>

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.

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;


Steve.


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-06-26 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 16:57 IWARP Valgrind Issue Dan Coombs
     [not found] ` <CY4PR19MB12215AF6E7225113294CF8DB8BDF0-48YGSBrqCmz95OYN2XvIqNvXXbHMiUzJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2017-06-26 20:45   ` Steve Wise [this message]
2017-06-26 23:08     ` Dan Coombs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006801d2eebd$2e54ba60$8afe2f20$@opengridcomputing.com' \
    --to=swise-7bpotxp6k4+p2yhjcf5u+vpxobypeauw@public.gmane.org \
    --cc=dcoombs-LmJBtNfl/RVO0n7uQEQMm4CZgX+1HZI1@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mchen-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox