netmap_mem2.c (238912) | netmap_mem2.c (241643) |
---|---|
1/* 2 * Copyright (C) 2012 Matteo Landi, Luigi Rizzo. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* | 1/* 2 * Copyright (C) 2012 Matteo Landi, Luigi Rizzo. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23 * SUCH DAMAGE. 24 */ 25 26/* |
27 * $FreeBSD: head/sys/dev/netmap/netmap_mem2.c 238912 2012-07-30 18:21:48Z luigi $ | 27 * $FreeBSD: head/sys/dev/netmap/netmap_mem2.c 241643 2012-10-17 18:21:14Z emaste $ |
28 * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $ 29 * 30 * New memory allocator for netmap 31 */ 32 33/* 34 * The new version allocates three regions: 35 * nm_if_pool for the struct netmap_if --- 284 unchanged lines hidden (view full) --- 320 slot[i].len = p->_objsize; 321 slot[i].flags = NS_BUF_CHANGED; // XXX GAETANO hack 322 } 323 324 ND("allocated %d buffers, %d available", n, p->objfree); 325 return; 326 327cleanup: | 28 * $Id: netmap_mem2.c 11445 2012-07-30 10:49:07Z luigi $ 29 * 30 * New memory allocator for netmap 31 */ 32 33/* 34 * The new version allocates three regions: 35 * nm_if_pool for the struct netmap_if --- 284 unchanged lines hidden (view full) --- 320 slot[i].len = p->_objsize; 321 slot[i].flags = NS_BUF_CHANGED; // XXX GAETANO hack 322 } 323 324 ND("allocated %d buffers, %d available", n, p->objfree); 325 return; 326 327cleanup: |
328 for (i--; i >= 0; i--) { | 328 while (i > 0) { 329 i--; |
329 netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); 330 } 331} 332 333 334static void 335netmap_free_buf(struct netmap_if *nifp, uint32_t i) 336{ --- 385 unchanged lines hidden --- | 330 netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); 331 } 332} 333 334 335static void 336netmap_free_buf(struct netmap_if *nifp, uint32_t i) 337{ --- 385 unchanged lines hidden --- |