Commit Graph

1777 Commits

Author SHA1 Message Date
dyoung 73b0c685df Use IFADDR_FOREACH(). 2007-12-04 10:31:14 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
ad 57ab3d5998 Grab tty_lock in more places. Noted and tested by degroote@. 2007-11-28 21:44:11 +00:00
dyoung 453e5e8a7d Cosmetic: join two lines. 2007-11-28 02:40:21 +00:00
dyoung 42e892e3d8 Pass the mbuf type (e.g., MT_SONAME, MT_SOOPTS) as the second
argument to getsockmbuf().
2007-11-24 07:49:03 +00:00
dyoung 8fd9837dcc Fix a bunch of locking bugs ("Mutex error: lockdebug_barrier: spin
lock held"): only hold a mutex briefly at the top and bottom of
gre_ioctl().  Use splnet() to synchronize reconfiguration with
network interrupts.
2007-11-24 07:43:32 +00:00
dyoung 50906e3486 Delete state GRE_S_DOCONF, I no longer use it. 2007-11-23 22:58:54 +00:00
ad 9bf7522dd1 Call ttwakeup() with tty_lock held. 2007-11-12 14:20:40 +00:00
ad 0f8b0df960 Call ttyflush() with tty_lock held. 2007-11-10 18:29:36 +00:00
ad d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
ad efe07d555b Use the softint_* API. 2007-11-07 00:19:54 +00:00
dyoung 08fdf3b0de Change a few malloc(9) + memset(3) pairs to malloc(..., ...|M_ZERO). 2007-11-01 20:37:48 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
dyoung 462deb7ea8 In ifreq_setaddr(), use the right buffer sizes for compat v.
non-compat commands.
2007-10-11 20:47:27 +00:00
dyoung c54777285d Delete dead code. 2007-10-10 22:14:38 +00:00
ad 46ed8f7d77 Use the softint API. 2007-10-08 16:18:02 +00:00
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
dyoung 1dc4f12dca Change some ints to bools. 2007-10-06 03:35:14 +00:00
dyoung 2c54ff5913 Good-bye, kernel thread, we don't need you any longer. 2007-10-06 03:30:25 +00:00
martin 38e2704180 Add missing include for definition of struct evcnt. 2007-10-05 08:05:37 +00:00
dyoung 32fddb3293 Cosmetic: KNF. Litter the code with fewer #if NBPFILTER > 0. 2007-10-05 05:15:58 +00:00
dyoung 944a024048 Remove a lot of dead code. Move gre_do_send() code into greintr(),
and move gre_do_recv() code into gre_receive().  Get rid of some
unused event counters.
2007-10-05 04:55:10 +00:00
dyoung 60149b1ce8 Work in progress: use a raw socket for GRE in IP encapsulation
instead of adding/subtracting our own IPv4 header.

There are many benefits:  gre(4) needn't grok the outer encapsulation
header any longer, so this simplifies the gre(4) code.  The IP
stack needn't grok GRE, so it is simplified, too.  gre(4) will
benefit from optimizations in the socket code.  Eventually, gre(4)
will gain an IPv6 encapsulation with very few new lines of code.

There is a small performance loss.  A 133 MHz, 486-class AMD Elan
sinks/sources a TCP stream over GRE with about 93% the throughput
of the old code.  TCP throughput on a 266 MHz, 586-class AMD Geode
is about 96% the throughput of the old code.  A 175-MHz ADM5120
(MIPS) only sinks a TCP stream over GRE at about 90% of the old
code; I am still investigating that.

I produced stripped-down versions of sosend() and soreceive() for
gre(4) to use.  They are guaranteed not to block, so they can be
called from a software interrupt and from a socket upcall,
respectively.

A kernel thread is no longer necessary for socket transmit/receive,
but I didn't get around to removing it, yet.

Thanks to Matt Thomas for suggesting the use of stripped-down socket
code and software interrupts, and to Andrew Doran for advice and
answers concerning software interrupts, threads, and performance.
2007-10-05 03:28:12 +00:00
scw 851609250e s/NPBFILTER/NBPFILTER/
Compile-tested only.
2007-09-29 18:44:51 +00:00
dyoung 43390716bc Constify sockaddr argument to ether_multiaddr(). Change struct
ifreq * arguments to ether_addmulti() and ether_delmulti() to const
struct sockaddr *, since ether_{add,del}multi() only ever read the
sockaddr ifreq member, ifr_addr.  Update uses in carp(4) and in
vlan(4).
2007-09-19 05:25:33 +00:00
dyoung 306b542543 Save some lines of code, use sockaddr_dup(), sockaddr_free(),
sockaddr_cmp().  No functional change intended.

Bug fix: pass M_WAITOK, not M_WAIT, to malloc(9).
2007-09-16 18:09:51 +00:00
dyoung 2d2c83df85 KNF: use tabs instead of spaces. 2007-09-16 02:23:29 +00:00
dyoung b0dad91e16 Use sockaddr_dup() and sockaddr_free(). 2007-09-16 02:19:44 +00:00
dyoung d34212ed04 Move the LIST_HEAD() definition below etherip_softc's definition.
Somehow having it above interfered with ctags(1) producing a tag
for etherip_softc.

Remove the sole member of the union etherip_softc.sc_scr; call it
sc_ro.  Delete the union.  Delete the #define for sc_ro.  The union
was a holdover from days before the route caches were unified.
2007-09-16 02:15:54 +00:00
gdt 2f4541505a Add a define for the ifru_space union member.
Copy the entire sockaddr to the buffer to be written to user space,
according to its length, not just the part that fits in struct
sockaddr.

This fixes the 'bad MAC address' problem in dhclient.
2007-09-13 18:54:57 +00:00
gdt aebe6f5793 Fix bug in SIOCGIFCONF where the wrong length was calculated for
sockaddrs bigger than struct sockaddr.  Tightly bind decrementing
available space and using it, avoiding incorrect accounting in an
error case.  Document invariants.  Document calling convention for
SIOCGIFCONF.  Simplify by removing code to handle sockaddrs that don't
fit in struct ifreq; with sockaddr_storage this can no longer occur.
Add several KASSERTs.

This commit resolves the problem with racoon failing to list
interfaces.

Proposed on tech-net@ with no objections.
2007-09-11 19:31:22 +00:00
cube c725329722 Remove 3rd clause and my name from all the licences which were only in my
name.
2007-09-10 10:35:51 +00:00
martin 90ef42f1bb Print the access concentrator name when a session is established.
This seems to be usefull to identify peers with known broken firmware
(e.g. that can only do IPv4 reliably).
2007-09-09 09:58:55 +00:00
dyoung 7cf94b5474 Rename gre_socreate1() -> gre_socreate(). 2007-09-08 04:34:02 +00:00
dyoung 88399b6877 We cannot sleep in a software interrupt, so do not sockaddr_dl_alloc(...,
M_WAITOK).  Instead, sockaddr_dl_init() a sockaddr_dl on the stack.
2007-09-02 19:42:21 +00:00
dyoung da055795a8 Delete unused variable. 2007-09-02 07:03:22 +00:00
dyoung c87aad4f08 Simplify code, add debug statements, and fix a bug that could
soclose() a UDP socket that a struct file still pointed at.
2007-09-02 07:01:41 +00:00
dyoung 76b1df3703 Get rid of struct oifreq/ifreq compat code, because ifioctl() has
taken care of this for us.
2007-09-02 01:50:58 +00:00
dyoung 0af5ef16d6 Be consistent: use the prefix sc_ for all members of the gre_softc. 2007-09-02 01:49:49 +00:00
dyoung 36a3794513 Protect userland from ifreq_getaddr() w/ #ifdef _KERNEL. 2007-09-02 00:24:18 +00:00
dyoung 064ec1416f token_addmulti and token_delmulti are never used in the kernel, so
delete them.
2007-09-01 07:41:22 +00:00
dyoung c66d2e7604 fddi_addmulti and fddi_delmulti are never used in the kernel, so
delete them.
2007-09-01 07:40:53 +00:00
dyoung 9bee2cd7f1 Fix compilation if !defined(INET6). Thanks, Geoff Wing, for the
bug report & patch.
2007-09-01 07:03:32 +00:00
dyoung 2fc102750d Use ifreq_setaddr(), ifreq_getaddr(), sockaddr_in_init(), and
sockaddr_copy().  Constify.  Compare pointers with NULL, not 0.
Don't "test truth" of pointers, but compare with NULL.
2007-09-01 04:32:50 +00:00
dyoung aade2db1a7 Use ifreq_getaddr(). Pass a sockaddr instead of ifreq where sockaddr
will suffice.
2007-09-01 03:07:24 +00:00
dyoung 7e6b3f4292 Per discussion in 30 May 2007 on tech-net, add accessors for
ifreq->ifr_addr, ifreq_getaddr() and ifreq_setaddr().
2007-08-31 21:02:15 +00:00
dyoung e44b703953 Move sc_fp & sc_newfp from struct gre_softc to struct gre_soparm. 2007-08-30 05:54:07 +00:00
dyoung 7ac92eed2a Remove out-of-date debug message and comment. 2007-08-30 05:14:32 +00:00
dyoung f562a76244 Cosmetic: remove an out-of-place comma in a comment. 2007-08-30 05:01:30 +00:00
dyoung 17038010cb Do not hold the mutex as much in gre_thread1(). Move initial mutex
acquisition and final release out into gre_thread().  This will
fix a locking bug that LOCKDEBUG exposed: holding a spinlock over
an sosend() call is a no-no.

Cosmetic: join some lines, remove some unnecessary curly braces.
2007-08-30 04:58:25 +00:00