Deleted Added
full compact
netmap_generic.c (285349) netmap_generic.c (297298)
1/*
2 * Copyright (C) 2013-2014 Universita` di Pisa. 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.

--- 49 unchanged lines hidden (view full) ---

58 *
59 * RX:
60 *
61 */
62
63#ifdef __FreeBSD__
64
65#include <sys/cdefs.h> /* prerequisite */
1/*
2 * Copyright (C) 2013-2014 Universita` di Pisa. 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.

--- 49 unchanged lines hidden (view full) ---

58 *
59 * RX:
60 *
61 */
62
63#ifdef __FreeBSD__
64
65#include <sys/cdefs.h> /* prerequisite */
66__FBSDID("$FreeBSD: head/sys/dev/netmap/netmap_generic.c 285349 2015-07-10 05:51:36Z luigi $");
66__FBSDID("$FreeBSD: head/sys/dev/netmap/netmap_generic.c 297298 2016-03-26 23:39:53Z np $");
67
68#include <sys/types.h>
69#include <sys/errno.h>
70#include <sys/malloc.h>
71#include <sys/lock.h> /* PROT_EXEC */
72#include <sys/rwlock.h>
73#include <sys/socket.h> /* sockaddrs */
74#include <sys/selinfo.h>

--- 49 unchanged lines hidden (view full) ---

124 SET_MBUF_REFCNT(m, 1);
125 uma_zfree(zone_pack, m);
126}
127
128static inline struct mbuf *
129netmap_get_mbuf(int len)
130{
131 struct mbuf *m;
67
68#include <sys/types.h>
69#include <sys/errno.h>
70#include <sys/malloc.h>
71#include <sys/lock.h> /* PROT_EXEC */
72#include <sys/rwlock.h>
73#include <sys/socket.h> /* sockaddrs */
74#include <sys/selinfo.h>

--- 49 unchanged lines hidden (view full) ---

124 SET_MBUF_REFCNT(m, 1);
125 uma_zfree(zone_pack, m);
126}
127
128static inline struct mbuf *
129netmap_get_mbuf(int len)
130{
131 struct mbuf *m;
132 m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR | M_NOFREE);
132 m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
133 if (m) {
133 if (m) {
134 m->m_flags |= M_NOFREE; /* XXXNP: Almost certainly incorrect. */
134 m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save
135 m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor;
136 m->m_ext.ext_type = EXT_EXTREF;
137 ND(5, "create m %p refcnt %d", m, GET_MBUF_REFCNT(m));
138 }
139 return m;
140}
141

--- 724 unchanged lines hidden ---
135 m->m_ext.ext_arg1 = m->m_ext.ext_buf; // XXX save
136 m->m_ext.ext_free = (void *)netmap_default_mbuf_destructor;
137 m->m_ext.ext_type = EXT_EXTREF;
138 ND(5, "create m %p refcnt %d", m, GET_MBUF_REFCNT(m));
139 }
140 return m;
141}
142

--- 724 unchanged lines hidden ---