#
d10e2ccb |
| 03-Sep-2022 |
thorpej <thorpej@NetBSD.org> |
Garbage-collect the remaining vestiges of netisr.
|
#
0932bf36 |
| 03-Sep-2022 |
thorpej <thorpej@NetBSD.org> |
Convert ARP from a legacy netisr to pktqueue.
|
#
bbdda93b |
| 16-Jun-2021 |
riastradh <riastradh@NetBSD.org> |
if_attach and if_initialize cannot fail, don't test return value
These were originally made failable back in 2017 when if_initialize allocated a softint in every interface for link state changes, so
if_attach and if_initialize cannot fail, don't test return value
These were originally made failable back in 2017 when if_initialize allocated a softint in every interface for link state changes, so that it could fail gracefully instead of panicking:
https://mail-index.NetBSD.org/source-changes/2017/10/23/msg089053.html
However, this spawned many seldom- or never-tested error branches, which are risky to have around. And that softint in every interface has since been replaced by a single global workqueue, because link state changes require thread context but not low latency or high throughput:
https://mail-index.NetBSD.org/source-changes/2020/02/06/msg113759.html
So there is no longer any reason for if_initialize to fail. (The subroutine if_stats_init can't fail because percpu_alloc can't fail either.)
There is a snag: the softint_establish in if_percpuq_create could fail, potentially leading to bad consequences later on trying to use the softint. This change doesn't introduce any new bugs because of the snag -- if_percpuq_attach was already broken. However, the snag can be better addressed without spawning error branches, either by using a single softint or making softints less scarce.
(Separate commit will change the signatures of if_attach and if_initialize to return void, scheduled to ride whatever is the next convenient kernel bump.)
Patch and testing on amd64 and evbmips64-eb by maya@; commit message soliloquy, and compile-testing on evbppc/i386/earmv7hf, by me.
show more ...
|
#
a381972a |
| 28-Aug-2020 |
ozaki-r <ozaki-r@NetBSD.org> |
net: introduce IFQ_ENQUEUE_ISR to assemble packet queuing routines (NFCI)
|
#
3a4e0c47 |
| 29-Jan-2020 |
thorpej <thorpej@NetBSD.org> |
Adopt <net/if_stats.h>.
|
#
29142498 |
| 09-May-2018 |
maxv <maxv@NetBSD.org> |
Replace m_copym(m, 0, M_COPYALL, M_DONTWAIT) by m_copypacket(m, M_DONTWAIT) when it is clear that we are copying a packet (that has M_PKTHDR) and not a raw mbuf chain.
|
#
4bd38589 |
| 26-Apr-2018 |
maxv <maxv@NetBSD.org> |
m_copy -> m_copym
|
#
dec70a2f |
| 23-Oct-2017 |
msaitoh <msaitoh@NetBSD.org> |
If if_attach() failed in the attach function, return.
|
#
4db47e60 |
| 14-Feb-2017 |
ozaki-r <ozaki-r@NetBSD.org> |
Do ND in L2_output in the same manner as arpresolve
The benefits of this change are: - The flow is consistent with IPv4 (and FreeBSD and OpenBSD) - old: ip6_output => nd6_output (do ND if needed)
Do ND in L2_output in the same manner as arpresolve
The benefits of this change are: - The flow is consistent with IPv4 (and FreeBSD and OpenBSD) - old: ip6_output => nd6_output (do ND if needed) => L2_output (lookup a stored cache) - new: ip6_output => L2_output (lookup a cache. Do ND if cache not found) - We can remove some workarounds in nd6_output - We can move L2 specific operations to their own place - The performance slightly improves because one cache lookup is reduced
show more ...
|
#
ca025ac8 |
| 24-Jan-2017 |
maxv <maxv@NetBSD.org> |
Don't forget to free the mbuf when we decide not to reply to an ARP request. This obviously is a terrible bug, since it allows a remote sender to DoS the system with specially-crafted requests sent i
Don't forget to free the mbuf when we decide not to reply to an ARP request. This obviously is a terrible bug, since it allows a remote sender to DoS the system with specially-crafted requests sent in a loop.
show more ...
|
#
a41b4f38 |
| 11-Jan-2017 |
ozaki-r <ozaki-r@NetBSD.org> |
Get rid of unnecessary header inclusions
|
#
8253fb55 |
| 03-Oct-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Fix race condition on ifqueue used by traditional netisr
If a underlying network device driver supports MSI/MSI-X, RX interrupts can be delivered to arbitrary CPUs. This means that Layer 2 subroutin
Fix race condition on ifqueue used by traditional netisr
If a underlying network device driver supports MSI/MSI-X, RX interrupts can be delivered to arbitrary CPUs. This means that Layer 2 subroutines such as ether_input (softint) and subsequent Layer 3 subroutines (softint) which are called via traditional netisr can be dispatched on an arbitrary CPU. Layer 2 subroutines now run without any locks (expected) and so a Layer 2 subroutine and a Layer 3 subroutine can run in parallel.
There is a shared data between a Layer 2 routine and a Layer 3 routine, that is ifqueue and IF_ENQUEUE (from L2) and IF_DEQUEUE (from L3) on it are racy now.
To fix the race condition, use ifqueue#ifq_lock to protect ifqueue instead of splnet that is meaningless now.
The same race condition exists in route_intr. Fix it as well.
Reviewed by knakahara@
show more ...
|
#
4a52bd73 |
| 28-Apr-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Constify remaining rtentry of if_output (fix build)
|
#
963cb311 |
| 20-Apr-2016 |
knakahara <knakahara@NetBSD.org> |
IFQ_ENQUEUE refactor (3/3) : eliminate pktattr argument from IFQ_ENQUEUE caller
|
#
30f8ece8 |
| 07-Apr-2016 |
christos <christos@NetBSD.org> |
- tidy up error messages - add a length argument to arpresolve() - add KASSERT for overflow
|
#
83a653c3 |
| 09-Feb-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Fix build
|
#
c2e6d390 |
| 13-Oct-2015 |
roy <roy@NetBSD.org> |
arpresolve() now returns 0 on success otherwise an error code. Callers of arpresolve() now pass the error code back to their caller, masking out EWOULDBLOCK.
This allows applications such as ping(8)
arpresolve() now returns 0 on success otherwise an error code. Callers of arpresolve() now pass the error code back to their caller, masking out EWOULDBLOCK.
This allows applications such as ping(8) to display a suitable error condition.
show more ...
|
#
082aeae6 |
| 24-Aug-2015 |
pooka <pooka@NetBSD.org> |
sprinkle _KERNEL_OPT
|
#
3442f7f8 |
| 04-Jun-2015 |
ozaki-r <ozaki-r@NetBSD.org> |
Pull out route lookups from L2 output routines
Route lookups for routes of RTF_GATEWAY were done in L2 output routines such as ether_output, but they should be done in L3 i.e., before L2 output rout
Pull out route lookups from L2 output routines
Route lookups for routes of RTF_GATEWAY were done in L2 output routines such as ether_output, but they should be done in L3 i.e., before L2 output routines. This change places the lookups between L3 output routines (say ip_output) and the L2 output routines.
The change is based on dyoung's patch submitted in the thread: https://mail-index.netbsd.org/tech-net/2013/02/01/msg003847.html You can find out detailed investigations by dyoung about the issue in there.
Note that the change introduces a workaround for MPLS. ether_output knew that it needs to fill the ethertype of a frame as MPLS, based on a tag of an original route (rtentry), but now we don't pass it to ehter_output. So we have to tell that in another way. We use mtag to do so for now, which introduces some overhead. We should fix it somehow in the future.
Discussed on tech-kern and tech-net.
show more ...
|
#
774e72bc |
| 05-Jun-2014 |
rmind <rmind@NetBSD.org> |
- Implement pktqueue interface for lockless IP input queue. - Replace ipintrq and ip6intrq with the pktqueue mechanism. - Eliminate kernel-lock from ipintr() and ip6intr(). - Some preparation work to
- Implement pktqueue interface for lockless IP input queue. - Replace ipintrq and ip6intrq with the pktqueue mechanism. - Eliminate kernel-lock from ipintr() and ip6intr(). - Some preparation work to push softnet_lock out of ipintr().
Discussed on tech-net.
show more ...
|
#
badee5ca |
| 15-May-2014 |
msaitoh <msaitoh@NetBSD.org> |
Put schednetisr() into splnet()/splx() pair. This might avoids delay of processing a packet.
|
#
ad1f2513 |
| 24-Sep-2012 |
msaitoh <msaitoh@NetBSD.org> |
Add missing "\n" in log(9)
|
#
58e86755 |
| 05-Apr-2010 |
joerg <joerg@NetBSD.org> |
Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf check into the inline functions as well the fourth argument for bpf_attach.
|
#
10fe49d7 |
| 19-Jan-2010 |
pooka <pooka@NetBSD.org> |
Redefine bpf linkage through an always present op vector, i.e. #if NBPFILTER is no longer required in the client. This change doesn't yet add support for loading bpf as a module, since drivers can r
Redefine bpf linkage through an always present op vector, i.e. #if NBPFILTER is no longer required in the client. This change doesn't yet add support for loading bpf as a module, since drivers can register before bpf is attached. However, callers of bpf can now be modularized.
Dynamically loadable bpf could probably be done fairly easily with coordination from the stub driver and the real driver by registering attachments in the stub before the real driver is loaded and doing a handoff. ... and I'm not going to ponder the depths of unload here.
Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
show more ...
|
#
dd8534ac |
| 20-Nov-2009 |
christos <christos@NetBSD.org> |
ar_tha() can return NULL; treat this as an error.
|