svn commit: r301200 - head/sys/dev/xen/netfront

Roger Pau Monné royger at FreeBSD.org
Thu Jun 2 11:19:17 UTC 2016


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 <wei.liu2 at citrix.com>
  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);


More information about the svn-src-all mailing list