| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
pass the uint64_t that ether_input has already converted from a
real ethernet address into carp_input so it can use it without
having to do its own conversion.
tested by hrvoje popovski
tested by me on amd64 and sparc64
ok patrick@ jmatthew@
|
|
|
|
| |
tested on amd64 and sparc64.
|
|
|
|
|
|
|
|
|
|
|
| |
this applies the tricks with addresses from veb and etherbridge
code to the normal ethernet input processing. it basically loads
the destination address from the packet and the interface ethernet
address into uint64_ts for comparison.
tested by hrvoje popovski and chris cappuccio
tested here on amd64, arm64, and sparc64
ok claudio@ jmatthew@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the main bits are ether_addr_to_e64 and ether_e64_to addr for loading
an ethernet address into a uin64_t and visa versa. there's also
some macros for testing if an address in a uint64_t is multicast,
broadcast, anyaddr, or if it's an 802.1q reserved multicast group
address.
the reason for this functionality is once you have an ethernet
address as a uint64_t, operations like compares, bit tests, and
so on are fast and easy.
tested on amd64 and sparc64
|
|
|
|
|
|
|
|
| |
offloading. The checksum must be calculated in software. Use the
same condition in ether_resolve() to send the broadcast packet back
to the stack and in in_ifcap_cksum() to force software checksumming.
This fixes regress/sys/kern/sosplice/loop.
OK procter@
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Less scheduling, lock contention and queues.
Previously, if_netisr() handled the net lock around those calls, now
if_input_process() does it before calling ether_input(), so no need to add
or remove NET_*LOCK() anywhere.
OK mvs claudio
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the interface input handler lists were originally set up to help
us during the intial mpsafe network stack work. at the time not all
the virtual ethernet interfaces (vlan, svlan, bridge, trunk, etc)
were mpsafe, so we wanted a way to avoid them by default, and only
take the kernel lock hit when they were specifically enabled on the
interface. since then, they have been fixed up to be mpsafe.
i could leave the list in place, but it has some semantic problems.
because virtual interfaces filter packets based on the order they
were attached to the parent interface, you can get packets taken
away in surprising ways, especially when you reboot and netstart
does something different to what you did by hand. by hardcoding the
order that things like vlan and bridge get to look at packets, we
can document the behaviour and get consistency.
it also means we can get rid of a use of SRPs which were difficult
to replace with SMRs. the interface input handler list is an SRPL,
which we would like to deprecate. it turns out that you can sleep
during stack processing, which you're not supposed to do with SRPs
or SMRs, but SRPs are a lot more forgiving and it worked.
lastly, it turns out that this code is faster than the input list
handling, so lots of winning all around.
special thanks to hrvoje popovski and aaron bieber for testing.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
|
|
| |
carp_input is only tried after vlan and bridge handling is done,
and after the ethernet packet doesnt match the parent interfaces
mac address.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this means there's a consistent order of processing of service
delimited (vlan and svlan) packets and bridging of packets. vlan
and svlan get to look at a packet first. it's only if they decline
a packet that a bridge can handle it. this allows operators to slice
vlans out for processing separate to the "native" vlan handling if
they want.
while here, this fixes up a bug in vlan_input if m_pullup needed
to prepend an mbuf.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
|
| |
if the bridge declines the packet, it just returns it to ether_input
to allow local deliver to proceed.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is the first step in refactoring how ethernet frames are demuxed
by virtual interfaces, and also in deprecating interface input list
handling.
we now have drivers for three types of virtual bridges, bridge(4),
switch(4), and tpmr(4), and it doesn't make sense for any of them
to be enabled on the same "port" interfaces at the same time.
currently you can add a port interface to multiple types of bridge,
but which one gets to steal the packets depends on the order in
which they were attached.
this creates an ether_brport structure that holds an input function
for the bridge, and optionally some per port state that the bridge
can use. arpcom has a single pointer to one of these structs that
will be used during normal ether_input processing to see if a packet
should be passed to a bridge, and will be used instead of an if
input handler. because it is a single pointer, it will make sure
only one bridge of any type is attached to a port at any one time.
this has been in snaps as part of a larger diff for over a week.
|
|
|
|
|
|
| |
In that case the function can just return. Part of a larger diff
to use the if_rtrequest functions for RTM_PROPOSAL info.
OK florian@
|
|
|
|
| |
ok dlg@, sthen@, millert@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sending an MPLS frame is weird compared to other address families.
other families figure out and pass the address on the local link
for ether_output to use for resolution, but AF_MPLS basically passes
a dummy sockaddr so ether_output can get the ethernet protocol field
right. ether_output then has to pull the route apart to figure out
which address and family to use for address resolution on the local
net. eg, MPLS tagged routes via ip addresess need to pull the route
apart and get at the AF_INET sockaddr to pass to arpresolve. that
code currently uses the destination address of the route, but if
that destination is not on the local network, we'd end up using it
for arp requests that don't work.
this change uses the rt_gateway sockaddr if RTF_GATEWAY is set.
this solves the problem in my testing and doesn't seem to break
other uses cases ive tried.
reported by adrian close via bugs@
ok deraadt@ claudio@
|
|
|
|
| |
no functional change
|
|
|
|
| |
input and OK mpi@
|
|
|
|
|
|
|
|
| |
Backbone refers to 802.1ah or 802.1Q Provider Backbone Bridges
(PBB), or mac-in-mac, which is like vlans except it completely
encapsulates the inner packet rather than just add a shim to it.
This removes the need for Backbone Core Bridges (ie, switches between
bpe instances) to know all the addresses on all the networks.
|
|
|
|
|
|
|
|
|
| |
this will be mostly useful for virtual interfaces like vlan and
etherip, where they can bypass queueing on an ifq, and instead
encapsulate in on multiple cpus concurrently and push the packet
onto the next layer directly.
ok visa@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if if_output can be overridden on ethernet interfaces, it will allow
things like vlan to do it's packet encapsulation during output
before putting the packet directly on the underlying interface for
output.
this has two benefits. first, it can avoid having ether_output on
pseudo interfaces recurse, which makes profiling of the network
stack a lot clearer. secondly, and more importantly, it allows
pseudo ethernet interface packet encapsulation to by run concurrently
by the stack, rather than having packets unnecessarily serialied
by an ifq.
this diff just splits ether_output up, it doesnt have any interface
take advantage of it yet.
tweaks and ok claudio@
|
|
|
|
|
|
|
|
|
|
|
|
| |
if the mac address is not for the interface, it must be multicast
or broadcast. this is instead of if the packet is not
multicast/broadcast, it must be for the interface.
this allows ethernet interfaces to have multicast mac addresses
without having to special case it themselves. eg, carp load balancing
should become easier with this.
ok mpi@
|
|
|
|
| |
ok mpi@
|
|
|
|
|
|
| |
and return. Change sizeof(etherbroadcastaddr) to ETHER_ADDR_LEN
for consistency.
from Michele Curti
|
|
|
|
|
|
|
|
| |
the main change is to defer chopping the ethernet header off until the
ether_type is looked at. the main advantage of this is pppoe doesn't have
to reattach the ether header anymore, which simplifies the code a lot.
ok mpi@ visa@ bluhm@
|
|
|
|
|
|
|
|
|
|
|
| |
this makes it like all our other protocol family input functions.
mpls_input always looks up the interface the mbuf was received on,
but it's always called by code that already has a reference to that
interface anyway. the result of this is a few less if_get/if_put
calls.
ok mpi@ bluhm@ visa@ claudio@
|
|
|
|
|
|
|
| |
the code was broken and noone noticed. this argues that we don't
need it.
ok mpi@
|
|
|
|
| |
OK claudio@ jca@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IPv4 & IPv6 dispatch functions outside the KERNEL_LOCK().
We currently rely on the NET_LOCK() serializing access to most global
data structures for that. IP input queues are no longer used in the
forwarding case. They still exist as boundary between the network and
transport layers because TCP/UDP & friends still need the KERNEL_LOCK().
Since we do not want to grab the NET_LOCK() for every packet, the
softnet thread will do it once before processing a batch. That means
the L2 processing path, which is currently running without lock, will
now run with the NET_LOCK().
IPsec isn't ready to run without KERNEL_LOCK(), so the softnet thread
will grab the KERNEL_LOCK() as soon as ``ipsec_in_use'' is set.
Tested by Hrvoje Popovski.
ok visa@, bluhm@, henning@
|
|
|
|
|
|
|
| |
This will help transitionning to an un-KERNEL_LOCK()ed IP
forwarding path.
Disucssed with bluhm@, ok claudio@
|
|
|
|
|
|
|
| |
them by NET_LOCK/NET_UNLOCK. Also make the timeout for pipex_timer
run with a thread context and replace pipex softintr by NETISR_PIPEX.
ok mpi
|
| |
|
|
|
|
| |
rectification.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
input handlers.
ok dlg@
|
|
|
|
|
|
|
|
|
| |
rename it to nd6_resolve().
This allows us to get rid of non-Ethernet hacks by moving Ethernet
specific logic in the appropriate layer.
ok sthen@
|
|
|
|
|
|
|
|
|
|
|
|
| |
resolution is required.
This will allow us to enforce that no route entry is inserted in
the routing table after ether_output().
This is now possible because if_output() is no longer called with
a NULL route argument.
Tested by Hrvoje Popovski, ok visa@, bluhm@
|
|
|
|
|
|
| |
routines are call directly by ether_input().
ok visa@, dlg@
|
|
|
|
|
|
|
|
|
| |
eleven years, remove it.
Despite what the wildly outdated time(9) claims, there is no longer
globally visible "struct timeval mono_time" or "struct timeval time".
ok mpi@ sthen@ mikeb@
|
| |
|
|
|
|
|
|
|
|
|
|
| |
only when in promiscuous mode
This necessary for NICs like virtio, where the unicast MAC filter is
'best effort' only.
ok dlg@
encouragement from mpi@
|
|
|
|
|
|
|
| |
Packets of types ARP and REVARP are now processed in the softnet task,
directly from ether_input() and without holding the KERNEL_LOCK.
Tested by many, ok dlg@
|
|
|
|
|
|
|
|
|
| |
them and they make everything so much harder with no gain. Remove the
ifp argument from mpls_input since it is not needed. On the input side
the lookup side is modified a bit when it comes to BOS handling.
Tested in a L3VPN setup with ldpd and bgpd. Commiting now so we can move
on with cleaning up rt_ifp usage. If this breaks L2VPN I will fix it once
reported. OK mpi@
|
|
|
|
|
|
|
|
|
| |
L2 resolution depends on the protocol (encoded in the route entry) and
an ``ifp''. Not having to care about an ``ifa'' makes our life easier
in our MP effort. Fewer dependencies between data structures implies
fewer headaches.
Discussed with bluhm@, ok claudio@
|
|
|
|
|
|
| |
Instead of casts they check wether the incoming object has the
expected type. So introduce satosdl() and sdltosa() in the kernel.
OK mpi@
|
|
|
|
| |
ok mpi
|
|
|
|
|
|
| |
Can be used to check if a MAC address is all zeros.
Will be used by iwm(4) soon.
ok kettenis@
|
|
|
|
|
|
| |
so packets can get enqueued for the arp netisr to process.
fixes jsgs nfs mountroot problem.
|
|
|
|
|
|
| |
the kernel lock.
"do it" claudio@ mpi@
|