tuexen [Thu, 7 Mar 2013 23:37:53 +0000 (23:37 +0000)]
MFC r238454:
Bugfix: Send up a COMM UP notification for active 1-to-1 style sockets
also in the case where the assoc comes up due to a remotely
started handshake (collision case).
tuexen [Thu, 7 Mar 2013 21:17:37 +0000 (21:17 +0000)]
MFC r236959:
Add a IP_RECVTOS socket option to receive for received UDP/IPv4
packets a cmsg of type IP_RECVTOS which contains the TOS byte.
Much like IP_RECVTTL does for TTL. This allows to implement a
protocol on top of UDP and implementing ECN.
tuexen [Thu, 7 Mar 2013 21:11:16 +0000 (21:11 +0000)]
MFC r236958:
Deliver IPV6_TCLASS, IPV6_HOPLIMIT and IPV6_PKTINFO cmsgs (if
requested) on IPV6 sockets, which have been marked to be not IPV6_V6ONLY,
for each received IPV4 packet.
- r238072: Do not include <sys/types.h> in the local headers.
- r238360: Various VirtIO improvements
- r240430: No need to leak these into the includer's namespace.
- r241469: virtqueue: Fix non-indirect virtqueues
- r241470: Add Virtio SCSI driver
- r241495: Fix build with PAE enabled
- r244136: Remove duplicated lines
- r244200: Start taskqueues threads after attach cannot fail
jilles [Wed, 6 Mar 2013 22:12:45 +0000 (22:12 +0000)]
MFC r246522: sh: Simplify mksyntax and make it fit for cross-compiling.
Now it outputs fixed files, which use constants provided by the C standard
library to determine appropriate values for the target machine.
Before, mksyntax inspected the host machine which resulted in subtle
breakage if e.g. char is signed on the host and unsigned on the target such
as when cross-compiling on x86 for ARM.
Tested by: ian (this patch)
Submitted by: Christoph Mallon (patch for head)
yongari [Wed, 6 Mar 2013 08:04:44 +0000 (08:04 +0000)]
MFC r247382:
RX checksum offloading on old Yukon controllers seem to cause more
problems. Disable RX checksum offloading on controllers that don't
use new descriptor format but give chance to enable it with
ifconfig(8).
gallatin [Tue, 5 Mar 2013 17:46:12 +0000 (17:46 +0000)]
MFC r247159
Improvements for newer mxge nics:
- Some mxge nics may store the serial number in the SN2 field of the
EEPROM. These will also have an SN=0 field, so parse the SN2 field,
and give it precedence.
- Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it.
This saves roughly 10ms per port at device attach time.
ian [Mon, 4 Mar 2013 23:22:37 +0000 (23:22 +0000)]
MFC r246134 ...
Improve devd startup time, by tweaking some string handling routines that are
heavily used when parsing config files. Mostly these changes avoid making
temporary copies of the strings, and avoid doing byte at a time append
operations, on the most-used code path.
ian [Mon, 4 Mar 2013 23:15:25 +0000 (23:15 +0000)]
MFC ...
r210609 - remove unused string
r210610 - avoid copy ctors by using prefix operators
r213646 - allow spacey things (liberal whitespace parsing)
r236388 - libc++ compatibility (add :: prefix to bind() call)
r240823 - use O_CLOEXEC for open instead of separate fcntl(2) call
r243932 - prefer init expression to assignment in ctor
r209583 ...
Expand system into my_system, and add the necessary tidyness that we
need. Close the pidfile. Then close all descriptors >= 3 to avoid
information leakage to children.
This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...
ian [Mon, 4 Mar 2013 22:04:14 +0000 (22:04 +0000)]
MFC r209583 ...
Expand system into my_system, and add the necessary tidyness that we
need. Close the pidfile. Then close all descriptors >= 3 to avoid
information leakage to children.
This solves the problem of not being able to restart devd when you
have, for example, a dhclient forked to configure your network...
ian [Mon, 4 Mar 2013 17:39:17 +0000 (17:39 +0000)]
MFC r246121 r246361 ...
Fix a descriptor leak in devd. Clients reading /var/run/devd.pipe can close
their socket connection any time, and devd only notices that when it gets an
error trying to write an event to the client. On a system with no device
change activity, clients could connect and disappear repeatedly without devd
noticing, leading to an ever-growing list of open socket descriptors in devd.
Now devd uses poll(2) looking for POLLHUP on all existing clients every time
a new client connection is established, and also periodically (once a minute)
to proactively find zombie clients and reap the socket descriptors. It also
now has a connection limit, configurable with a new -l <num> command line arg.
When the maximum number of connections is reached it stops accepting new
connections until some current clients drop off.
jhb [Mon, 4 Mar 2013 17:35:10 +0000 (17:35 +0000)]
MFC 199757:
- For 350 chips, don't set various INTR bits in TX control word; turning INTR
bits on seems to confuse hardware TX engine.
- For 350 chips, set TX desc's buffer physical address before turning on the
TX desc valid bit.
dteske [Mon, 4 Mar 2013 01:14:06 +0000 (01:14 +0000)]
MFC r230005:
Use a reasonable-sized buffer when formatting error messages about
installing zoneinfo. While we're in the vicinity, add some missing
error checking to eliminate an unhelpful error message when unlink()
fails.
/me is embarrassed by the quality of his 16-year-old code.
The whole thing is awful and could stand a complete rewrite.
melifaro [Sun, 3 Mar 2013 21:48:40 +0000 (21:48 +0000)]
Merge
* r233937 - Improve BPF locking model
* r233938 - Improve performace for writer-only BPF users
* r233946 - Fix build
* r235744 - Fix (new) panic on attaching to non-existent interface
* r235745 - Fix old panic when BPF consumer attaches to destroying interface
* r235746 - Call bpf_jitter() before acquiring BPF global lock
* r235747 - Make most BPF ioctls() SMP-safe.
* r236231 - Fix BPF_JITTER code broken by r235746.
* r236261 - Save the previous filter right before we set new one.
* r236262 - Fix style(9) nits, reduce unnecessary type castings.
* r236559 - Fix panic introduced by r235745
* r236806 - Fix typo introduced in r236559.
r233937
- Improve BPF locking model.
Interface locks and descriptor locks are converted from mutex(9) to rwlock(9).
This greately improves performance: in most common case we need to acquire 1
reader lock instead of 2 mutexes.
- Remove filter(descriptor) (reader) lock in bpf_mtap[2]
This was suggested by glebius@. We protect filter by requesting interface
writer lock on filter change.
- Cover struct bpf_if under BPF_INTERNAL define. This permits including bpf.h
without including rwlock stuff. However, this is is temporary solution,
struct bpf_if should be made opaque for any external caller.
r233938
- Improve performace for writer-only BPF users.
Linux and Solaris (at least OpenSolaris) has PF_PACKET socket families to send
raw ethernet frames. The only FreeBSD interface that can be used to send raw
frames is BPF. As a result, many programs like cdpd, lldpd, various dhcp stuff
uses BPF only to send data. This leads us to the situation when software like
cdpd, being run on high-traffic-volume interface significantly reduces overall
performance since we have to acquire additional locks for every packet.
Here we add sysctl that changes BPF behavior in the following way:
If program came and opens BPF socket without explicitly specifyin read filter
we assume it to be write-only and add it to special writer-only per-interface
list. This makes bpf_peers_present() return 0, so no additional overhead is
introduced. After filter is supplied, descriptor is added to original
per-interface list permitting packets to be captured.
Unfortunately, pcap_open_live() sets catch-all filter itself for the purpose
of setting snap length.
Fortunately, most programs explicitly sets (event catch-all) filter after
that. tcpdump(1) is a good example.
So a bit hackis approach is taken: we upgrade description only after second
BIOCSETF is received.
Sysctl is named net.bpf.optimize_writers and is turned off by default.
- While here, document all sysctl variables in bpf.4
r233946
Fix build broken by r233938.
r235744
Fix panic on attaching to non-existent interface
(introduced by r233937, pointed by hrs@)
Fix panic on tcpdump being attached to interface being removed
(introduced by r233937, pointed by hrs@ and adrian@)
Protect most of bpf_setf() by BPF global lock
Add several forgotten assertions (thanks to adrian@)
Document current locking model inside bpf.c
Document EVENTHANDLER(9) usage inside BPF.
r235745
Fix old panic when BPF consumer attaches to destroying interface.
'flags' field is added to the end of bpf_if structure. Currently the only
flag is BPFIF_FLAG_DYING which is set on bpf detach and checked by bpf_attachd()
Problem can be easily triggered on SMP stable/[89] by the following command
(sort of):
'while true; do ifconfig vlan222 create vlan 222 vlandev em0 up ; \
tcpdump -pi vlan222 & ; ifconfig vlan222 destroy ; done'
Fix possible use-after-free when BPF detaches itself from interface, freeing
bpf_bif memory, while interface is still UP and there can be routes via this
interface. Freeing is now delayed till ifnet_departure_event is received via
eventhandler(9) api.
Convert bpfd rwlock back to mutex due lack of performance gain
(currently checking if packet matches filter is done without holding bpfd
lock and we have to acquire write lock if packet matches)
r235746
Call bpf_jitter() before acquiring BPF global lock due to malloc() being
used inside bpf_jitter.
Eliminate bpf_buffer_alloc() and allocate BPF buffers on descriptor creation
and BIOCSBLEN ioctl. This permits us not to allocate buffers inside
bpf_attachd() which is protected by global lock.
r235747
Make most BPF ioctls() SMP-safe.
r236559
Fix panic introduced by r235745. Panic occurs after first packet traverse
renamed interface.
Add several comments on locking
r236231
Fix BPF_JITTER code broken by r235746.
r236261
- Save the previous filter right before we set new one.
- Reduce duplicate code and make it little easier to read.
r236262
Fix style(9) nits, reduce unnecessary type castings, etc., for bpf_setf().
markj [Sun, 3 Mar 2013 19:02:11 +0000 (19:02 +0000)]
MFC r246978:
- Make sure to set an error code when trying to obtain a data descriptor for
a section of type SHT_NULL.
- Update the man page to reflect the fact that elf_getdata() and
elf_rawdata() may return with an error of ELF_E_SECTION.
dteske [Sun, 3 Mar 2013 09:13:18 +0000 (09:13 +0000)]
MFS 9->8 r247267:
Oops, r55392 (over 13 years ago) forgot to classify the new HTTP Proxy for the
options dialog (causing "<unknown>" to be displayed for the HTTP media type).
dteske [Sun, 3 Mar 2013 08:51:56 +0000 (08:51 +0000)]
MFS 9->8 r217491 with slight modification:
Reduce the amount of text users need to read on each screen. Also try and
make it more relevant to modern systems: for example users will be
familiar with the MBR but possibly less so with MS-DOS.
After installation has finished don't return to the main menu but exit.
Slight modification:
Ignore the last sentence (need feedback from brucec before carrying that back
to 8 where sysinstall is still the main installer).
This brings stable/8's cxgbe(4) up to date with what's in head right
now. One major difference is the missing t4_tom (TCP Offload Module);
there are no plans to backport it to 8.
Build tested with make universe (with -DMAKE_JUST_KERNELS)
* partial
** partial manual backport, not really an MFC
marius [Sat, 2 Mar 2013 17:32:20 +0000 (17:32 +0000)]
MFC: r246257
Improve r238673 (MFC'ed to stable/8 in r239495) to additionally allow
for odd-aligned buffers as passed in by smartd of smartmontools.
While at it, hint the compiler that 32-bit PIO is the most likely
case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
of bus_{read,write}_multi_stream_2(9) for single count reads/writes.