From owner-svn-src-projects@freebsd.org Tue Sep 29 21:57:53 2015 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74870A0C322 for ; Tue, 29 Sep 2015 21:57:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA131CB5; Tue, 29 Sep 2015 21:57:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8TLvrrG001549; Tue, 29 Sep 2015 21:57:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8TLvrQM001548; Tue, 29 Sep 2015 21:57:53 GMT (envelope-from np@FreeBSD.org) Message-Id: <201509292157.t8TLvrQM001548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 29 Sep 2015 21:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r288402 - projects/cxl_iscsi/sys/dev/cxgbe/cxgbei X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 21:57:53 -0000 Author: np Date: Tue Sep 29 21:57:52 2015 New Revision: 288402 URL: https://svnweb.freebsd.org/changeset/base/288402 Log: - Fix minor memory leak (ic_offload is never freed). - Remove unused icl_pdu_stailq. - Do not use the same names as icl_soft for the global connection counter or for the per-connection send/recv CVs. Modified: projects/cxl_iscsi/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Modified: projects/cxl_iscsi/sys/dev/cxgbe/cxgbei/icl_cxgbei.c ============================================================================== --- projects/cxl_iscsi/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue Sep 29 21:55:45 2015 (r288401) +++ projects/cxl_iscsi/sys/dev/cxgbe/cxgbei/icl_cxgbei.c Tue Sep 29 21:57:52 2015 (r288402) @@ -86,15 +86,13 @@ SYSCTL_INT(_kern_icl_cxgbei, OID_AUTO, r static uma_zone_t icl_pdu_zone; static uma_zone_t icl_transfer_zone; -static volatile u_int icl_ncons; +static volatile u_int icl_cxgbei_ncons; #define ICL_CONN_LOCK(X) mtx_lock(X->ic_lock) #define ICL_CONN_UNLOCK(X) mtx_unlock(X->ic_lock) #define ICL_CONN_LOCK_ASSERT(X) mtx_assert(X->ic_lock, MA_OWNED) #define ICL_CONN_LOCK_ASSERT_NOT(X) mtx_assert(X->ic_lock, MA_NOTOWNED) -STAILQ_HEAD(icl_pdu_stailq, icl_pdu); - static icl_conn_new_pdu_t icl_cxgbei_conn_new_pdu; static icl_conn_pdu_free_t icl_cxgbei_conn_pdu_free; static icl_conn_pdu_data_segment_length_t @@ -418,20 +416,20 @@ icl_cxgbei_new_conn(const char *name, st { struct icl_conn *ic; - refcount_acquire(&icl_ncons); + refcount_acquire(&icl_cxgbei_ncons); ic = (struct icl_conn *)kobj_create(&icl_cxgbei_class, M_CXGBE, M_WAITOK | M_ZERO); STAILQ_INIT(&ic->ic_to_send); ic->ic_lock = lock; - cv_init(&ic->ic_send_cv, "icl_tx"); - cv_init(&ic->ic_receive_cv, "icl_rx"); + cv_init(&ic->ic_send_cv, "icl_cxgbei_tx"); + cv_init(&ic->ic_receive_cv, "icl_cxgbei_rx"); #ifdef DIAGNOSTIC refcount_init(&ic->ic_outstanding_pdus, 0); #endif ic->ic_max_data_segment_length = ICL_MAX_DATA_SEGMENT_LENGTH; ic->ic_name = name; - ic->ic_offload = strdup("cxgbei", M_TEMP);; + ic->ic_offload = "cxgbei"; return (ic); } @@ -443,7 +441,7 @@ icl_cxgbei_conn_free(struct icl_conn *ic cv_destroy(&ic->ic_send_cv); cv_destroy(&ic->ic_receive_cv); kobj_delete((struct kobj *)ic, M_CXGBE); - refcount_release(&icl_ncons); + refcount_release(&icl_cxgbei_ncons); } /* XXXNP: what is this for? There's no conn_start method. */ @@ -749,7 +747,7 @@ icl_cxgbei_load(void) 16 * 1024, NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - refcount_init(&icl_ncons, 0); + refcount_init(&icl_cxgbei_ncons, 0); /* * The reason we call this "none" is that to the user, @@ -766,7 +764,7 @@ static int icl_cxgbei_unload(void) { - if (icl_ncons != 0) + if (icl_cxgbei_ncons != 0) return (EBUSY); icl_unregister("cxgbei");