| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the interface input handler lists were originally set up to help
us during the intial mpsafe network stack work. at the time not all
the virtual ethernet interfaces (vlan, svlan, bridge, trunk, etc)
were mpsafe, so we wanted a way to avoid them by default, and only
take the kernel lock hit when they were specifically enabled on the
interface. since then, they have been fixed up to be mpsafe.
i could leave the list in place, but it has some semantic problems.
because virtual interfaces filter packets based on the order they
were attached to the parent interface, you can get packets taken
away in surprising ways, especially when you reboot and netstart
does something different to what you did by hand. by hardcoding the
order that things like vlan and bridge get to look at packets, we
can document the behaviour and get consistency.
it also means we can get rid of a use of SRPs which were difficult
to replace with SMRs. the interface input handler list is an SRPL,
which we would like to deprecate. it turns out that you can sleep
during stack processing, which you're not supposed to do with SRPs
or SMRs, but SRPs are a lot more forgiving and it worked.
lastly, it turns out that this code is faster than the input list
handling, so lots of winning all around.
special thanks to hrvoje popovski and aaron bieber for testing.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
| |
the if_detach() call. In if_detach() various route messages are generated
and during that time the rtable_l2() mapping needs to stay.
OK kn@
|
|
|
|
|
|
|
|
|
|
|
| |
introduced a queue to grab the lock for multiple packets. Now we
have only netlock for both IP and protocol input. So the queue is
not necessary anymore. It just switches CPU and decreases performance.
So remove the inet and inet6 ip queue for local packets.
To get TCP running on loopback, we have to queue once between TCP
input and output of the two sockets. So use the loopback queue in
looutput() unconditionally.
OK visa@
|
|
|
|
|
|
|
|
| |
deleted if the rdomain doesn't contain any other interface. turn the rdomain
back into an ordinary, empty rtable in that case.
with this and the previous commits one can get rid of rdomains again without
rebooting, which wasn't possible any more for some time
ok bluhm, input mpi
|
|
|
|
| |
This needs to go back to the drawing board.
|
|
|
|
|
|
|
| |
as loopback interfaces for each rdomain (including lo0). This is done when
the interface is brought up. This is now also done by default (either on
attach of lo0 or when creating the rdomain).
OK mpi@
|
|
|
|
|
|
| |
memory shortage. As it is invoked from a system call, it should
not fail and wait instead.
OK visa@ mpi@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
currently there is a single mbuf_queue per interface, which all
rings on a nic shove packets onto. while the list inside this queue
is protected by a mutex, the counters around it (ie, ipackets,
ibytes, idrops) are not. this means updates can be lost, and reading
the statistics is also inconsistent. having a single queue means
that busy rx rings can dominate and then starve the others.
ifiqueue structs are like ifqueue structs. they provide per ring
queues, and independent counters for each ring. when ifdata is read
for userland, these counters are aggregated. having a queue per
ring now allows for per ring backpressure to be applied. MCLGETI
will have it's day again.
right now we assume every interface wants an input queue and
unconditionally provide one. individual interfaces can opt into
more.
im not completely happy about the shape of this atm, but shuffling
it around more makes the diff bigger.
ok visa@
|
|
|
|
|
|
|
| |
NOTE: code still runs with single softnet task. change definition of
SOFTNET_TASKS in net/if.c, if you want to have more than one softnet task
OK mpi@, OK phessler@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
removed some queueing. lo(4) output called the ip input routines
without a queue. So if a packet looped through the kernel, the
kernel stack filled up.
Use M_LOOP to find recursive calls to looutput(). This flag is set
when a packet goes through the loopback interface. Avoid an
additional queueing if the packet goes to lo(4) only once. As there
may be gif(4), bridge(4), pair(4), ipsec(4), rdomain(4), ... setups
that legitimately pass lo(4) more than once, use the interface input
queue for these cases.
Packets in the queue run through ip forward. There the TTL is
decremented and the packet is finally processed or dropped.
found by markus@; OK mpi@ sashan@
|
|
|
|
|
| |
No binary change.
OK mpi@
|
|
|
|
| |
rectification.
|
|
|
|
|
|
|
|
|
| |
only once per packet.
Fix a regression introduced when if_input() started to be called by
every pseudo-driver.
ok claudio@, dlg@
|
|
|
|
|
|
|
| |
This synchronize lo(4) with other pseudo-driver and fix a regression
introduced by the refactoring of the UP/DOWN logic in if.c
ok dlg@, claudio@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to stop abusing lo0 for all rdomains, a new loopback interface
will be created every time a rdomain is created. The unit number will
be the same as the rdomain, i.e. lo1 will be attached to rdomain 1.
If this loopback interface is already in use it wont be possible to create
the corresponding rdomain.
In order to know which lo(4) interface is attached to a rdomain, its index
is stored in the rtable/rdomain map.
This is a long overdue since the introduction of rtable/rdomain. It also
fixes a recent regression due to resetting the rdomain of an incoming
packet reported by semarie@, Andreas Bartelt and Nils Frohberg.
ok claudio@
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
descriptor.
Allow to get rid of two if_ref() in the output paths.
ok dlg@
|
|
|
|
|
|
|
|
|
| |
L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''. Not having to care about an ``ifa'' makes our life easier
in our MP effort. Fewer dependencies between data structures implies
fewer headaches.
Discussed with bluhm@, ok claudio@
|
|
|
|
|
|
|
|
|
|
| |
the protocol queues.
It basically does what looutput() was doing but having a generic
function will allow us to get rid of the loopback hack overwwritting
the rt_ifp field of RTF_LOCAL routes.
ok mikeb@, dlg@, claudio@
|
|
|
|
|
|
| |
directly. Also protect non mp-safe functions while at it.
ok mpi@.
|
|
|
|
| |
reported by rpe@
|
|
|
|
|
|
|
|
|
|
|
| |
if_input() has been designed to be able to safely handle a batch of
packets from physical drivers to the network stack. Most of these
drivers have an interrupt routine executed at IPL_NET and the check
made sense during the conversion. However we also want to re-enqueue
packets with if_input() from the network stack currently running at
IPL_SOFTNET.
ok claudio@
|
|
|
|
|
|
| |
with MPLS packets.
ok mpi@, claudio@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
receiving interface in the packet header of every mbuf.
The interface pointer should now be retrieved when necessary with
if_get(). If a NULL pointer is returned by if_get(), the interface
has probably been destroy/removed and the mbuf should be freed.
Such mechanism will simplify garbage collection of mbufs and limit
problems with dangling ifp pointers.
Tested by jmatthew@ and krw@, discussed with many.
ok mikeb@, bluhm@, dlg@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with niqueues.
this change is so big because there's a lot of code that takes
pointers to different input queues (eg, ether_input picks between
ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through
to code to enqueue packets against the pointer. if i changed only
one of the input queues id have to add sepearate code paths, one
for ifqueues and one for niqueues in each of these places
by flipping all these input queues at once i can keep the currently
common code common.
testing by mpi@ sthen@ and rafael zalamena
ok mpi@ sthen@ claudio@ henning@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
| |
Allow to use different size than the default of 32K.
ok henning@, stsp@, florian@, benno@ as part of a larger diff.
|
|
|
|
|
| |
long live the one true internet.
ok henning mikeb
|
|
|
|
| |
ok mikeb@, krw@, bluhm@, tedu@
|
| |
|
|
|
|
|
|
| |
cannot create it.
Suggested by and ok claudio@
|
|
|
|
|
|
|
|
|
|
|
|
| |
raise it inside their ioctl handler (except for carp(4), what else?).
In general, global structures manipulated in the softnet codepath only
require a splsoftnet() protection when they are modified in process
(ioctl) context.
Also put some IPL_SOFNET asserts in functions accessing global structures.
Previous version diff ok mikeb@, with inputs from and ok bluhm@
|
| |
|
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
|
|
|
| |
Also making the size 32k + some extra is not very helpful since we don't
do something like zerocopy or sendfile. Just go back to 32768 and we can
bikeshed over the right value later on once we have features that benefit
from it. OK mpi@
|
|
|
|
|
|
|
|
| |
* altq for loop is just for debugging.
* only used when called for loop interface (not for
* a simplex interface).
*/
bye bye!
|
|
|
|
|
|
| |
global variables to in6.h.
ok deraadt@
|
|
|
|
|
|
| |
global variables to in.h.
ok mikeb@, deraadt@
|
|
|
|
|
|
| |
them ignore the SIOC{ADD,DEL}MULTI ioctls.
ok reyk@, claudio@
|
|
|
|
| |
ok krw@, mikeb@
|
|
|
|
|
| |
.h files to pull it in, if needed
ok tedu
|
|
|
|
| |
No binary change.
|
|
|
|
|
|
|
|
| |
Byte order adjustment for bpf was hidden behind bpf_mtap_af() and
sizeof(u_int32_t) is used for length of the bpf header.
tested by sebastia and mxb at alumni.chalmers.se.
ok claudio
|
| |
|
|
|
|
|
| |
ospfd doesn't notice an interface added at runtime unless you ifconfig down+up.
ok phessler@ claudio@
|
|
|
|
|
|
| |
Makes it possible to do evil tricks locally.
ok claudio@
|
|
|
|
| |
ok claudio@ krw@ jason@ dlg@
|
|
|
|
|
|
|
| |
-remove useless casts
-MALLOC/FREE -> malloc/free
-use M_ZERO where appropriate instead of seperate bzero
feedback & ok krw, hshoexer
|