Page MenuHomeFreeBSD

bpf: convert several boolean natured fields of bpf_d to flags
Needs ReviewPublic

Authored by glebius on Fri, Nov 21, 10:56 PM.
Tags
None
Referenced Files
F139439217: D53870.id167511.diff
Fri, Dec 12, 2:40 AM
Unknown Object (File)
Sat, Dec 6, 12:30 AM
Unknown Object (File)
Sun, Nov 30, 5:00 PM
Unknown Object (File)
Sat, Nov 29, 1:07 PM
Unknown Object (File)
Sat, Nov 29, 12:08 AM
Unknown Object (File)
Fri, Nov 28, 7:17 PM
Unknown Object (File)
Fri, Nov 28, 4:30 PM
Unknown Object (File)
Fri, Nov 28, 3:17 PM

Details

Reviewers
None
Group Reviewers
network
Summary

This shrinks the structure a bit. Should be no functional change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69031
Build 65914: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/net/bpf.c
876

No lock is held here.

1511

Most of the accesses/updates are locked by the bpfd lock, so this update is unlocked.

sys/net/bpf.c
1511

With this revision I don't intend to fix any bugs, just make struct smaller and make it possible to pass flags to bif_write method.

sys/net/bpf.c
1511

Ok, but you're also introducing new bugs. Before, the code was performing unsynchronized stores to different fields. Now they are doing read-modify-writes to the same field, so setting one flag might clobber a different one. That wasn't possible before.

The d_promisc appears to be locked by the global BPF_LOCK(). Thus, remove it
from this changes. This addresses Mark's comments.