Deleted Added
full compact
if_epair.c (204805) if_epair.c (209059)
1/*-
2 * Copyright (c) 2008 The FreeBSD Foundation
3 * Copyright (c) 2009-2010 Bjoern A. Zeeb <bz@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by CK Software GmbH under sponsorship
7 * from the FreeBSD Foundation.
8 *

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

43 * to re-do them in case we move the interface between network stacks
44 * in a private if_reassign function.
45 * In case we bridge to a real interface/network or between indepedent
46 * epairs on multiple stacks/machines, we may need this.
47 * For now let the user handle that case.
48 */
49
50#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 The FreeBSD Foundation
3 * Copyright (c) 2009-2010 Bjoern A. Zeeb <bz@FreeBSD.org>
4 * All rights reserved.
5 *
6 * This software was developed by CK Software GmbH under sponsorship
7 * from the FreeBSD Foundation.
8 *

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

43 * to re-do them in case we move the interface between network stacks
44 * in a private if_reassign function.
45 * In case we bridge to a real interface/network or between indepedent
46 * epairs on multiple stacks/machines, we may need this.
47 * For now let the user handle that case.
48 */
49
50#include <sys/cdefs.h>
51__FBSDID("$FreeBSD: head/sys/net/if_epair.c 204805 2010-03-06 21:22:28Z bz $");
51__FBSDID("$FreeBSD: head/sys/net/if_epair.c 209059 2010-06-11 18:46:34Z jhb $");
52
53#include <sys/param.h>
54#include <sys/kernel.h>
55#include <sys/mbuf.h>
56#include <sys/module.h>
57#include <sys/refcount.h>
58#include <sys/queue.h>
59#include <sys/smp.h>

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

184
185static void
186epair_dpcpu_init(void)
187{
188 struct epair_dpcpu *epair_dpcpu;
189 struct eid_list *s;
190 u_int cpuid;
191
52
53#include <sys/param.h>
54#include <sys/kernel.h>
55#include <sys/mbuf.h>
56#include <sys/module.h>
57#include <sys/refcount.h>
58#include <sys/queue.h>
59#include <sys/smp.h>

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

184
185static void
186epair_dpcpu_init(void)
187{
188 struct epair_dpcpu *epair_dpcpu;
189 struct eid_list *s;
190 u_int cpuid;
191
192 for (cpuid = 0; cpuid <= mp_maxid; cpuid++) {
193 if (CPU_ABSENT(cpuid))
194 continue;
195
192 CPU_FOREACH(cpuid) {
196 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
197
198 /* Initialize per-cpu lock. */
199 EPAIR_LOCK_INIT(epair_dpcpu);
200
201 /* Driver flags are per-cpu as are our netisr "hw" queues. */
202 epair_dpcpu->epair_drv_flags = 0;
203

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

212}
213
214static void
215epair_dpcpu_detach(void)
216{
217 struct epair_dpcpu *epair_dpcpu;
218 u_int cpuid;
219
193 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
194
195 /* Initialize per-cpu lock. */
196 EPAIR_LOCK_INIT(epair_dpcpu);
197
198 /* Driver flags are per-cpu as are our netisr "hw" queues. */
199 epair_dpcpu->epair_drv_flags = 0;
200

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

209}
210
211static void
212epair_dpcpu_detach(void)
213{
214 struct epair_dpcpu *epair_dpcpu;
215 u_int cpuid;
216
220 for (cpuid = 0; cpuid <= mp_maxid; cpuid++) {
221 if (CPU_ABSENT(cpuid))
222 continue;
223
217 CPU_FOREACH(cpuid) {
224 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
225
226 /* Destroy per-cpu lock. */
227 EPAIR_LOCK_DESTROY(epair_dpcpu);
228 }
229}
230
231/*

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

325 */
326static void
327epair_remove_ifp_from_draining(struct ifnet *ifp)
328{
329 struct epair_dpcpu *epair_dpcpu;
330 struct epair_ifp_drain *elm, *tvar;
331 u_int cpuid;
332
218 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
219
220 /* Destroy per-cpu lock. */
221 EPAIR_LOCK_DESTROY(epair_dpcpu);
222 }
223}
224
225/*

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

319 */
320static void
321epair_remove_ifp_from_draining(struct ifnet *ifp)
322{
323 struct epair_dpcpu *epair_dpcpu;
324 struct epair_ifp_drain *elm, *tvar;
325 u_int cpuid;
326
333 for (cpuid = 0; cpuid <= mp_maxid; cpuid++) {
334 if (CPU_ABSENT(cpuid))
335 continue;
336
327 CPU_FOREACH(cpuid) {
337 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
338 EPAIR_LOCK(epair_dpcpu);
339 STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list,
340 ifp_next, tvar) {
341 if (ifp == elm->ifp) {
342 struct epair_softc *sc;
343
344 STAILQ_REMOVE(

--- 603 unchanged lines hidden ---
328 epair_dpcpu = DPCPU_ID_PTR(cpuid, epair_dpcpu);
329 EPAIR_LOCK(epair_dpcpu);
330 STAILQ_FOREACH_SAFE(elm, &epair_dpcpu->epair_ifp_drain_list,
331 ifp_next, tvar) {
332 if (ifp == elm->ifp) {
333 struct epair_softc *sc;
334
335 STAILQ_REMOVE(

--- 603 unchanged lines hidden ---