Module Name: src Committed By: maxv Date: Thu Aug 9 17:32:44 UTC 2018
Modified Files: src/sys/arch/xen/xen: xennetback_xenbus.c Log Message: Use an independent pool, don't steal pages from mcl_cache. This was a bad hack. No particular functional change, since the (MCLBYTES != PAGE_SIZE) condition is already true. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/xen/xen/xennetback_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/xen/xen/xennetback_xenbus.c diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.66 src/sys/arch/xen/xen/xennetback_xenbus.c:1.67 --- src/sys/arch/xen/xen/xennetback_xenbus.c:1.66 Thu Aug 9 17:26:00 2018 +++ src/sys/arch/xen/xen/xennetback_xenbus.c Thu Aug 9 17:32:44 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: xennetback_xenbus.c,v 1.66 2018/08/09 17:26:00 maxv Exp $ */ +/* $NetBSD: xennetback_xenbus.c,v 1.67 2018/08/09 17:32:44 maxv Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.66 2018/08/09 17:26:00 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.67 2018/08/09 17:32:44 maxv Exp $"); #include "opt_xen.h" @@ -173,13 +173,9 @@ static void xennetback_get_new_mcl_pages /* * If we can't transfer the mbuf directly, we have to copy it to a page which - * will be transferred to the remote domain. We use a pool_cache - * for this, or the mbuf cluster pool cache if MCLBYTES == PAGE_SIZE + * will be transferred to the remote domain. We use a pool_cache for this. */ -#if MCLBYTES != PAGE_SIZE pool_cache_t xmit_pages_cache; -#endif -pool_cache_t xmit_pages_cachep; /* arrays used in xennetback_ifstart(), too large to allocate on stack */ /* XXXSMP */ @@ -227,13 +223,8 @@ xvifattach(int n) /* initialise pools */ pool_init(&xni_pkt_pool, sizeof(struct xni_pkt), 0, 0, 0, "xnbpkt", NULL, IPL_VM); -#if MCLBYTES != PAGE_SIZE xmit_pages_cache = pool_cache_init(PAGE_SIZE, 0, 0, 0, "xnbxm", NULL, IPL_VM, NULL, NULL, NULL); - xmit_pages_cachep = xmit_pages_cache; -#else - xmit_pages_cachep = mcl_cache; -#endif SLIST_INIT(&xnetback_instances); mutex_init(&xnetback_lock, MUTEX_DEFAULT, IPL_NONE); @@ -1048,8 +1039,7 @@ xennetback_ifsoftstart_transfer(void *ar } else { /* we have to copy the packet */ xmit_va = (vaddr_t)pool_cache_get_paddr( - xmit_pages_cachep, - PR_NOWAIT, &xmit_pa); + xmit_pages_cache, PR_NOWAIT, &xmit_pa); if (__predict_false(xmit_va == 0)) break; /* out of memory */ @@ -1185,7 +1175,7 @@ xennetback_ifsoftstart_transfer(void *ar m_freem(mbufs_sent[j]); } for (j = 0; j < nppitems; j++) { - pool_cache_put_paddr(xmit_pages_cachep, + pool_cache_put_paddr(xmit_pages_cache, (void *)pages_pool_free[j].va, pages_pool_free[j].pa); }