summaryrefslogtreecommitdiff
path: root/sys/net
AgeCommit message (Collapse)Author
2019-05-09Add a sysctl accessor to struct pf_status. The pf_status only holds theClaudio Jeker
current status and statistics and can be exported without super-user rights via sysctl to make it easier for tools like systat to access those. OK deraadt@, sashan@
2019-05-09we don't need to check rtisvalid() in these places, the functions we arePeter Hessler
protecing will do the right thing OK claudio@
2019-05-03Add missing bridge_getbif(), reported by jsg@.Martin Pieuchot
2019-05-03An if_put() was missing in one branch of bridge_process(). ThisAlexander Bluhm
caused a hanging "ifconfig bridge0 destroy" and a subsequent uvm fault. reported and tested by Hrvoje Popovski; OK visa@
2019-05-02Reset root port after last STP interface is removed.Martin Pieuchot
Prevent use-after-free reported by Hrvoje Popovski.
2019-05-01pretty much all of tun_wakeup needs to be protected with KERNEL_LOCKDavid Gwynne
tun_wakeup is called from the network stack, which generally runs with NET_LOCK, not KERNEL_LOCK, which is a problem when it calls into things like csignal or kq code. this started causing corruption and panics of a list inside the kq code, which got reported to bugs@. this version of the fix is ok mpi@ (even though he hasn't seen it) an earlier but far trickier fix was ok visa@ the bug was reported by Olivier Antoine, and again by jmc@ privately.
2019-04-29tr_unit is unused, so gc itDavid Gwynne
2019-04-29don't have lacp input push lacp packets into the trunkports bpf again.David Gwynne
if_input already runs bpf for all packets on a trunkport. having lacp code do it again means packets are seen twice by bpf filters twice, which is misleading.
2019-04-28Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.Martin Pieuchot
This redefines the ifp <-> bridge relationship. No lock can be currently used across the multiples contexts where the bridge has tentacles to protect a pointer, use an interface index. Tested by various, ok dlg@, visa@
2019-04-28Fix reading route entries via kvm(3).Martin Pieuchot
From Naoki Fukaumi, ok yasuoka@, sthen@
2019-04-27fix up some rxprio handling while hereDavid Gwynne
we should swap the value off the wire for 802.1P, not the rxhprio config value. try and avoid toctou issues by copying the sc_rxprio value to a local.
2019-04-27don't increment noproto on the parent interface when there's no childDavid Gwynne
it's not atomic is the main reason. this simplifies leaving the function too.
2019-04-27use unsigned int, not u_int, and uintXX_t, not u_intXX_tDavid Gwynne
2019-04-27rename sc_prio to sc_txprioDavid Gwynne
2019-04-27remove sc_proto, it isn't used.David Gwynne
2019-04-27rename softc members so theyre prefixed with sc.David Gwynne
makes vlan more consistent with the rest of the tree, but no functional change.
2019-04-27back out, this isn't part of a vlan change.David Gwynne
2019-04-27this wasnt meant to be committed, back out for now.David Gwynne
2019-04-27get rid of ifv_linkmib and a bunch of useless macrosDavid Gwynne
2019-04-27fix some whitespace.David Gwynne
2019-04-27call vlan_softc variables sc, not ifv. no functional change.David Gwynne
2019-04-27whitespace tweaks. no functional change.David Gwynne
2019-04-27rename struct ifvlan to struct vlan_softcDavid Gwynne
this makes it more consistent with the rest of the tree, but has no functional change.
2019-04-27move the struct ifvlan (the vlan softc) definition into if_vlan.c.David Gwynne
nothing needs to see inside it, so it can move. the next steps are to rename it to vlan_softc and all the variables to sc to make the driver move consistent with the rest of the tree. ok visa@ mpi@
2019-04-25Lower the accepted upper bound for bd_rtout to INT_MAX in order toanton
prevent passing negative values to timeout_add(). While here, protect against unsigned wrap around during addition of bd_rdStart and bd_rtout since it could also cause passing negative values to timeout_add(). ok bluhm@ Reported-by: syzbot+6771e3d6d9567b3983aa@syzkaller.appspotmail.com
2019-04-23give gre and mgre percpu counters tooDavid Gwynne
makes input bytes and packets consistent
2019-04-23a first cut at converting some virtual ethernet interfaces to if_vinputDavid Gwynne
this let's input processing bypass ifiqs. there's a performance benefit from this, and it will let me tweak the backpressure detection mechanism that ifiqs use without impacting on a stack of virtual interfaces. ive tested all of these except mpw, which i will end up testing soon anyway.
2019-04-22use if_vinput instead of if_input, thereby bypassing ifiqs on vlansDavid Gwynne
ifiqs on vlans are mostly just overhead. this improves vlan input speeds a lot, depending on your setup. i havent seen any speed regression with this.
2019-04-22add if_vinput so pseudo (ethernet) interfaces can bypass ifiqsDavid Gwynne
if_vinput assumes that the interface that its called against uses per cpu counters so it can count input packets, but basically does all the things that if_input and ifiq_input do. the main difference is it assumes the network stack is already running and runs the interface input handlers directly. this is instead of queuing the packets for a nettq to run. ifiqs arent free, especially when they only run per packet like they do on psuedo interfaces. this allows that overhead to be bypassed.
2019-04-22factor out calling the if input handlers for a packet.David Gwynne
this is a step toward letting interfaces like vlan bypass ifiqs
2019-04-22support rxprioDavid Gwynne
i need to come back to this and make it flow a bit better, but this is a good start.
2019-04-21Interpret ENETRESET from ifm_change() as success in ifmedia_ioctl().Stefan Sperling
Drivers will return ENETREST if the hardware needs to be reinitialized after successfully switching to the new media mode; it's not an error. This change fixes unreliable 'ifconfig mode' with some wireless drivers. ok phessler@ jmatthew@
2019-04-19use the common code in if.c to check if txhprio is good.David Gwynne
no functional change.
2019-04-19use the factored out txhprio and rxhprio checksDavid Gwynne
reduces code duplication and chance for error.
2019-04-19provide factored out txhprio and rxhprio checksDavid Gwynne
l2 and l3 drivers do the same thing all the time, so reduce the chance of error by doing the checks once and making it available for drivers to call instead of rolling on their own again.
2019-04-19add rxprio supportDavid Gwynne
this is modelled on vlan(4) where the packet prio is put in the bpe header in tx, and the bpe header prio is put on the packet in rx.
2019-04-19add rxprio supportDavid Gwynne
2019-04-19implement rxprioDavid Gwynne
2019-04-19allow configuration of rxprioDavid Gwynne
ok claudio@
2019-04-19add support for configuring rxprio.David Gwynne
vlan already used the 802.1p prio in packets to set the mbuf prio. this maintains that as the default. ok claudio@
2019-04-19only root can change rxprioDavid Gwynne
2019-04-19add IF_HDRPRIO_OUTER for rxprioDavid Gwynne
IF_HDRPRIO_OUTER says you want the priority from the outer encap header. ok claudio@
2019-04-17don't lose the TTL on FAT labelsDavid Gwynne
2019-04-17use txprio to control the use of exp as a priority fieldDavid Gwynne
by default txprio is set to 0, so the exp field will be 0. howerver, txprio on mpe/mpw/mpip can be configured with other values or settings like our other tunnel or encapsulation interfaces. intermediate LSPs can use the exp field to manage their prioritisation of encapsulated traffic.
2019-04-16have another go at tx mitigationDavid Gwynne
the idea is to call the hardware transmit routine less since in a lot of cases posting a producer ring update to the chip is (very) expensive. it's better to do it for several packets instead of each packet, hence calling this tx mitigation. this diff defers the call to the transmit routine to a network taskq, or until a backlog of packets has built up. dragonflybsd uses 16 as the size of it's backlog, so i'm copying them for now. i've tried this before, but previous versions caused deadlocks. i discovered that the deadlocks in the previous version was from ifq_barrier calling taskq_barrier against the nettq. interfaces generally hold NET_LOCK while calling ifq_barrier, but the tq might already be waiting for the lock we hold. this version just doesnt have ifq_barrier call taskq_barrier. it instead relies on the IFF_RUNNING flag and normal ifq serialiser barrier to guarantee the start routine wont be called when an interface is going down. the taskq_barrier is only used during interface destruction to make sure the task struct wont get used in the future, which is already done without the NET_LOCK being held. tx mitigation provides a nice performanace bump in some setups. up to 25% in some cases. tested by tb@ and hrvoje popovski (who's running this in production). ok visa@
2019-04-15moving BPF to RCUAlexandr Nedvedicky
OK visa@
2019-04-15Use timeout_del_barrier(9) instead of timeout_del(9) followed byVisa Hankala
conditional timeout_barrier(9). OK kn@ dlg@
2019-04-14don't take splnet when running the network stackDavid Gwynne
the stack uses the NET_LOCK for most protection now, so it doesnt need to block actual hardware interrupts. blocking hw interrupts can cause huge latency spikes, which in turn works against the rx ring moderation. im putting this in early in the release cycle so it can get the most testing possible. ok mpi@ (a while back)
2019-04-10do custom checks for SIOCGIFSFFPAGE.David Gwynne
this should only be used by root, and it should not tak the NET_LOCK because a bunch of i2c reads can take a relatively long time during which packets would be blocked. while here make sure userland only requests pages from the eeprom and diag i2c addresses. ok deraadt@
2019-04-10add struct if_sffpage so userland can read a page of sfp/qsfp infoDavid Gwynne
this will be used by ifconfig so it can show you things like who mades what module you're using and when it was made, and on some modules you get diag info like temperature, vcc, and rx and tx powers. im putting the kernel side in so we can keep fiddling with the userland printf side of things. this work was done based on a question by rachel roch ok deraadt@ enthusiasm from many including mikeb@ sthen@ patrick@