From owner-svn-src-all@freebsd.org Thu Jun 2 11:19:17 2016 Return-Path: Delivered-To: svn-src-all@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 B5655B6450A; Thu, 2 Jun 2016 11:19:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 6DDDE1C45; Thu, 2 Jun 2016 11:19:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u52BJG8Y047471; Thu, 2 Jun 2016 11:19:16 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u52BJGBh047470; Thu, 2 Jun 2016 11:19:16 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201606021119.u52BJGBh047470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 2 Jun 2016 11:19:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301200 - head/sys/dev/xen/netfront X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2016 11:19:17 -0000 Author: royger Date: Thu Jun 2 11:19:16 2016 New Revision: 301200 URL: https://svnweb.freebsd.org/changeset/base/301200 Log: xen-netfront: release grant references used for the shared rings Just calling gnttab_end_foreign_access_ref doesn't free the references, instead call gnttab_end_foreign_access with a NULL page argument in order to have the grant references freed. The code that maps the ring (xenbus_map_ring) already uses gnttab_grant_foreign_access which takes care of allocating a grant reference. Reviewed by: Wei Liu Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D6608 Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:18:02 2016 (r301199) +++ head/sys/dev/xen/netfront/netfront.c Thu Jun 2 11:19:16 2016 (r301200) @@ -663,7 +663,7 @@ disconnect_rxq(struct netfront_rxq *rxq) xn_release_rx_bufs(rxq); gnttab_free_grant_references(rxq->gref_head); - gnttab_end_foreign_access_ref(rxq->ring_ref); + gnttab_end_foreign_access(rxq->ring_ref, NULL); /* * No split event channel support at the moment, handle will * be unbound in tx. So no need to call xen_intr_unbind here, @@ -765,7 +765,7 @@ disconnect_txq(struct netfront_txq *txq) xn_release_tx_bufs(txq); gnttab_free_grant_references(txq->gref_head); - gnttab_end_foreign_access_ref(txq->ring_ref); + gnttab_end_foreign_access(txq->ring_ref, NULL); xen_intr_unbind(&txq->xen_intr_handle); } @@ -877,7 +877,7 @@ fail_bind_port: fail_start_thread: buf_ring_free(txq->br, M_DEVBUF); taskqueue_free(txq->tq); - gnttab_end_foreign_access_ref(txq->ring_ref); + gnttab_end_foreign_access(txq->ring_ref, NULL); fail_grant_ring: gnttab_free_grant_references(txq->gref_head); free(txq->ring.sring, M_DEVBUF);