Age | Commit message (Collapse) | Author |
|
this is largely mechanical, except for carp. this moves the addition
of the carp link state hook after we're committed to using the new
interface as a carpdev. because the add can't fail, we avoid a
complicated unwind dance. also, this tweaks the carp linkstate hook
so it only updates the relevant carp interface, not all of the
carpdevs on the parent.
hrvoje popovski has tested an early version of this diff and it's
generally ok, but there's some splasserts that this diff fires that
i'll fix in an upcoming diff.
ok claudio@
|
|
the main semantic change is that things registering detach hooks
have to allocate and set a task structure that then gets added to
the list. this means if the task is allocated up front (eg, as part
of carps softc or bridges port structure), it avoids the possibility
that adding a hook can fail. a lot of drivers weren't checking for
failure, and unwinding state in the event of failure in other parts
was error prone.
while doing this i discovered that the list operations have to be
in a particular order, but drivers weren't doing that consistently
either. this diff wraps the list ops up so you have to seriously
go out of your way to screw them up.
ive also sprinkled some NET_ASSERT_LOCKED around the list operations
so we can make sure there's no potential for the list to be corrupted,
especially while it's being run.
hrvoje popovski has tested this a bit, and some issues he discovered
have been fixed.
ok sashan@
|
|
|
|
this has been reported by a bunch of people including chris@, jon
williams on bugs@, and ze loff on misc@
|
|
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.
|
|
it's not atomic is the main reason. this simplifies leaving the
function too.
|
|
|
|
|
|
|
|
makes vlan more consistent with the rest of the tree, but no
functional change.
|
|
|
|
|
|
|
|
|
|
this makes it more consistent with the rest of the tree, but has
no functional change.
|
|
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@
|
|
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.
|
|
reduces code duplication and chance for error.
|
|
vlan already used the 802.1p prio in packets to set the mbuf prio.
this maintains that as the default.
ok claudio@
|
|
ok dlg@
|
|
|
|
|
|
this allows vlan packets to bypass the ifq handling, which allows
packets to be encapsulated concurrently by any context. the code
falls back to ifqs if hfsc is enabled on the vlan interface, otherwise
it encaps the packet immedate and enqueues it on the parent interface.
hrove popovski has seen a performance bump in certain configurations
from this change.
ok mpi@
no objections claudio@
|
|
if you're using llprio and link0, you'll need to update your config.
ok claudio@
|
|
Document that some chips actually could do hardware checksum offload for
encapsulated packets, though that would need special handling in those
drivers.
discussions and ok naddy@
|
|
some ISPs now provide services over vlans, but require vlan packets
going to the internet have their priority set to 1 (ie, 0 on the
wire) or they will be dropped. configuring this on openbsd requires
config in several places, eg, pf rules to set the prio on ip packets,
llprio on the pppoe interface for it's management frames, and the
llprio on the vlan interface if you're using dhclient on it. this
has the side effect that you can no longer use priority queuing,
and can be error prone to get right.
using link0 to flatteng the priority for isp transit is simple to
configure, and allows priority queuing.
a man page update is coming.
ok henning@
|
|
The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.
No objection from millert@, ok tedu@, bluhm@
|
|
memory shortage. As it is invoked from a system call, it should
not fail and wait instead.
OK visa@ mpi@
|
|
|
|
krw@ has been having issues with dhclient on vlan interfaces because
i made them only configure the lladdr when they were brought up.
dhclient likes to read the mac address and then bring them up.
this makes vlan copy the parents lladdr onto the vlan interface
when the parent is configured. this probably helps with v6 addresses
on vlan interfaces too.
the new code still supports configuring a custom lladdr on a vlan
interface. this can be done both before and after a parent is
configured, and if a parent is removed.
while here, if the parent is reconfigured while the vlan is up, dont
error if the new parent is the same as the current one. this should
make running netstart again less noisy.
ok krw@
|
|
ok krw@, dlg@
|
|
rectification.
|
|
an ifq to transmit a packet is picked by the current traffic
conditioner (ie, priq or hfsc) by providing an index into an array
of ifqs. by default interfaces get a single ifq but can ask for
more using if_attach_queues().
the vast majority of our drivers still think there's a 1:1 mapping
between interfaces and transmit queues, so their if_start routines
take an ifnet pointer instead of a pointer to the ifqueue struct.
instead of changing all the drivers in the tree, drivers can opt
into using an if_qstart routine and setting the IFXF_MPSAFE flag.
the stack provides a compatability wrapper from the new if_qstart
handler to the previous if_start handlers if IFXF_MPSAFE isnt set.
enabling hfsc on an interface configures it to transmit everything
through the first ifq. any other ifqs are left configured as priq,
but unused, when hfsc is enabled.
getting this in now so everyone can kick the tyres.
ok mpi@ visa@ (who provided some tweaks for cnmac).
|
|
only once per packet.
Fix a regression introduced when if_input() started to be called by
every pseudo-driver.
ok claudio@, dlg@
|
|
this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.
ok mpi@ deraadt@
|
|
even if m_prepend allocates a new mbuf in front of the current one.
this is done by asking M_PREPEND for ETHER_HDR_LEN + ETHER_ALIGN bytes,
and then calling m_adj(ETHER_ALIGN) after.
in the case M_PREPEND does not allocate a new mbuf and ends up with the
same layout as before.
in the allocation case, the requested length is provided on a long
boundary. an ETHER_HDR_LEN request would therefore be 6 bytes
allocated on a long boundary, when we want it to be at ETHER_ALIGN.
by asking for ETHER_HDR_LEN plus ETHER_ALIGN, we can m_adj ETHER_ALIGN
off to get us to the ETHER_ALIGN offset.
ok yasuoka@ mikeb@
|
|
mode, vxlan(4) must be configured to accept any virtual network
identifier with "vnetid any" and added to a bridge(4) or switch(4).
This way the driver will dynamically learn the tunnel endpoints and
their vnetids for the responses and can be used to dynamically bridge
between VXLANs. It is also being used in combination with switch(4)
and the OpenFlow tunnel classifiers.
With input from yasuoka@ goda@
OK deraadt@ dlg@
|
|
the srp_ref struct is used to track the location of the callers
hazard pointer so later calls to srp_follow and srp_enter already
know what to clear. this in turn means most of the caveats around
using srps go away. specifically, you can now:
- switch cpus while holding an srp ref
- ie, you can sleep while holding an srp ref
- you can take and release srp refs in any order
the original intent was to simplify use of the api when dealing
with complicated data structures. the caller now no longer has to
track the location of the srp a value was fetched from, the srp_ref
effectively does that for you.
srp lists have been refactored to use srp_refs instead of srpl_iter
structs.
this is in preparation of using srps inside the ART code. ART is a
complicated data structure, and lookups require overlapping holds
of srp references.
ok mpi@ jmatthew@
|
|
no functional change
|
|
the recent vlan code sets the vlan interfaces mac address to the
parent interfaces mac address when it is brought up, and resets it
when the vlan interface is brought down.
now, if you set a mac address manually (eg, ifconfig vlanX lladdr
f0:0b:a7:ba:2b:00), vlan(4) ignores the parents mac address and
never resets its own.
to make this work, setting a custom lladdr on a vlan interface makes
the parent interface promisc so the packets wont be filtered by the
hardware interface.
setting the mac address to 00:00:00:00:00:00 resets this behavior
and makes the interface inherit the parents mac again.
issue reported by and fix tested by paul de weerd
|
|
this makes it more clear to the casual reader that it refers to the
parent interface, which is consistently referred to as ifp0 in the
rest of the vlan (and carp) code.
this is a good idea from mpi@
|
|
configuration of the vlan parent interface and the vlan id should
come via the IFPARENT and VNETID ioctls now. the vlan specific
ioctls are still available via a compat layer, but that will go
away a bit further into this release cycle.
the parent interface may only be configured while the vlan is down.
the vnetid may be changed at runtime, but will generate link state
changes across that event.
the vlan is implicitily brought up when an address is assigned,
which brings it in line with all our other network drivers. the
legacy vlan ioctl still imply bringing the interface up because
that's what it used to do.
the code that brings vlans up and down is now simplified because
it no longer supports changing the parent at run time. most of that
code now adds state to the parent when bringing the vlan up, and
bringing the interface down just removes it in reverse.
these simplifications in turn make it possible for us to transmit
packets on vlan interfaces without holding the big lock, so its now
marked as MPSAFE.
ok jmatthew@ sthen@ mpi@
|
|
|
|
|
|
ok mpi@ claudio@
|
|
|
|
ok mpi@ jmatthew@
|
|
the previous code had vlan_ether_purgemulti and vlan_ether_resetmulti,
both of which did too many things. purgemulti would try and remove
the multicast entries from the parent, and then free the local
copies of the addresses. resetmulti would try to remove the address
from the parent, and then optionally try to add them to a new parent.
resetmulti in particular makes the overall vlan config steps fairly
twisty.
the refactor offers vlan_multi_apply, and vlan_multi_free. multi_apply
simply adds or removes the multicast addresses from a parent
interface. it is now up to the config steps to call them appropriately
when configuring a parent or a new parent. vlan_multi_free only
deletes the memory associated with the vlans multicast addresses.
vlan_multi_apply is called when a parent is configured (ie, ifconfig
vlan0 up), or unconfigured (ifconfig vlan0 down or a detach of the
parent). vlan_multi_free is called when a vlan interface is destroyed
(ifconfig vlan0 destroy).
ok mpi@
|
|
still no binary change.
|
|
the vlan interface is ifp, the vlans parent interface is ifp0, the new
interface parent is newifp0.
requested by mpi@
no binary change
|