freebsd-dev/share/man
Alexander V. Chernikov 51ec1eb70d - 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

Sponsored by Yandex LLC

Reviewed by:    glebius (previous version)
Reviewed by:    silence on -net@
Approved by:    (mentor)

MFC after:      4 weeks
2012-04-06 06:55:21 +00:00
..
man1 sh: Add kill builtin. 2010-12-21 22:47:34 +00:00
man3 Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
man4 - Improve performace for writer-only BPF users. 2012-04-06 06:55:21 +00:00
man5 Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
man6
man7 Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
man8 Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
man9 Remove end of line whitespace. 2012-03-31 07:10:16 +00:00
Makefile Add a new build option, MAN_UTILS. This option lets you control building 2010-05-19 23:56:26 +00:00