| #
023842dd |
| 29-Jun-2024 |
riastradh <riastradh@NetBSD.org> |
netinet: Use _NET_STAT* API instead of direct array access.
PR kern/58380
|
| #
2143da87 |
| 19-Feb-2021 |
christos <christos@NetBSD.org> |
- Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is more correct because it works with non-primitive types and provides the ABI alignment for the type the compiler will use. - R
- Make ALIGNED_POINTER use __alignof(t) instead of sizeof(t). This is more correct because it works with non-primitive types and provides the ABI alignment for the type the compiler will use. - Remove all the *_HDR_ALIGNMENT macros and asserts - Replace POINTER_ALIGNED_P with ACCESSIBLE_POINTER which is identical to ALIGNED_POINTER, but returns that the pointer is always aligned if the CPU supports unaligned accesses. [ as proposed in tech-kern ]
show more ...
|
| #
94b86f7d |
| 15-Feb-2021 |
knakahara <knakahara@NetBSD.org> |
Fix build failure for options GATEWAY.
|
| #
91838898 |
| 14-Feb-2021 |
christos <christos@NetBSD.org> |
- centralize header align and pullup into a single inline function - use a single macro to align pointers and expose the alignment, instead of hard-coding 3 in 1/2 the macros. - fix an issue in the
- centralize header align and pullup into a single inline function - use a single macro to align pointers and expose the alignment, instead of hard-coding 3 in 1/2 the macros. - fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling for ipv6.
show more ...
|
| #
81857fe9 |
| 11-Apr-2018 |
maxv <maxv@NetBSD.org> |
Remove whitespaces/tabs, and one non-ASCII character.
|
| #
cead3b88 |
| 17-Nov-2017 |
ozaki-r <ozaki-r@NetBSD.org> |
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..." scattered all over the source code and makes it e
Provide macros for softnet_lock and KERNEL_LOCK hiding NET_MPSAFE switch
It reduces C&P codes such as "#ifndef NET_MPSAFE KERNEL_LOCK(1, NULL); ..." scattered all over the source code and makes it easy to identify remaining KERNEL_LOCK and/or softnet_lock that are held even if NET_MPSAFE.
No functional change
show more ...
|
| #
57c38b28 |
| 07-Feb-2017 |
ozaki-r <ozaki-r@NetBSD.org> |
Add missing NULL checks for m_get_rcvif
|
| #
2b82ef9b |
| 11-Jan-2017 |
ozaki-r <ozaki-r@NetBSD.org> |
Get rid of unnecessary header inclusions
|
| #
4c25fb2f |
| 08-Dec-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Add rtcache_unref to release points of rtentry stemming from rtcache
In the MP-safe world, a rtentry stemming from a rtcache can be freed at any points. So we need to protect rtentries somehow say b
Add rtcache_unref to release points of rtentry stemming from rtcache
In the MP-safe world, a rtentry stemming from a rtcache can be freed at any points. So we need to protect rtentries somehow say by reference couting or passive references. Regardless of the method, we need to call some release function of a rtentry after using it.
The change adds a new function rtcache_unref to release a rtentry. At this point, this function does nothing because for now we don't add a reference to a rtentry when we get one from a rtcache. We will add something useful in a further commit.
This change is a part of changes for MP-safe routing table. It is separated to avoid one big change that makes difficult to debug by bisecting.
show more ...
|
| #
3be31428 |
| 18-Oct-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Don't hold global locks if NET_MPSAFE is enabled
If NET_MPSAFE is enabled, don't hold KERNEL_LOCK and softnet_lock in part of the network stack such as IP forwarding paths. The aim of the change is
Don't hold global locks if NET_MPSAFE is enabled
If NET_MPSAFE is enabled, don't hold KERNEL_LOCK and softnet_lock in part of the network stack such as IP forwarding paths. The aim of the change is to make it easy to test the network stack without the locks and reduce our local diffs.
By default (i.e., if NET_MPSAFE isn't enabled), the locks are held as they used to be.
Reviewed by knakahara@
show more ...
|
| #
56995fec |
| 01-Aug-2016 |
knakahara <knakahara@NetBSD.org> |
improve fast-forward performance when the number of flows exceeds IPFLOW_MAX.
In the fast-forward case, when the number of flows exceeds IPFLOW_MAX, the performmance degraded to about 50% compared t
improve fast-forward performance when the number of flows exceeds IPFLOW_MAX.
In the fast-forward case, when the number of flows exceeds IPFLOW_MAX, the performmance degraded to about 50% compared to the case less than IPFLOW_MAX flows. This modification suppresses the degradation to 65%. Furthermore, the modified kernel is about the same performance as the original kernel when the number of flows is less than IPFLOW_MAX.
The original patch is implemented by ryo@n.o. Thanks.
show more ...
|
| #
c5ebd2d1 |
| 27-Jul-2016 |
knakahara <knakahara@NetBSD.org> |
remove extra ifdefs. no functional changes.
ip_flow.c becomes build target only if GATEWAY kernel option is on. So, "#ifdef GATEWAY" in ip_flow.c is not needed.
|
| #
e449cc85 |
| 26-Jul-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Simplify by using atomic_swap instead of mutex
Suggested by kefren@
|
| #
dca032f9 |
| 11-Jul-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Run timers in workqueue
Timers (such as nd6_timer) typically free/destroy some data in callout (softint). If we apply psz/psref for such data, we cannot do free/destroy process in there because sync
Run timers in workqueue
Timers (such as nd6_timer) typically free/destroy some data in callout (softint). If we apply psz/psref for such data, we cannot do free/destroy process in there because synchronization of psz/psref cannot be used in softint. So run timer callbacks in workqueue works (normal LWP context).
Doing workqueue_enqueue a work twice (i.e., call workqueue_enqueue before a previous task is scheduled) isn't allowed. For nd6_timer and rt_timer_timer, this doesn't happen because callout_reset is called only from workqueue's work. OTOH, ip{,6}flow_slowtimo's callout can be called before its work starts and completes because the callout is periodically called regardless of completion of the work. To avoid such a situation, add a flag for each protocol; the flag is set true when a work is enqueued and set false after the work finished. workqueue_enqueue is called only if the flag is false.
Proposed on tech-net and tech-kern.
show more ...
|
| #
95fc1456 |
| 20-Jun-2016 |
knakahara <knakahara@NetBSD.org> |
apply if_output_lock() to L3 callers which call ifp->if_output() of L2(or L3 tunneling).
|
| #
a6f4292e |
| 13-Jun-2016 |
knakahara <knakahara@NetBSD.org> |
eliminate unnecessary splnet
|
| #
e4ff09f0 |
| 13-Jun-2016 |
knakahara <knakahara@NetBSD.org> |
MP-ify fastforward to support GATEWAY kernel option.
I add "ipflow_lock" mutex in ip_flow.c and "ip6flow_lock" mutex in ip6_flow.c to protect all data in each file. Of course, this is not MP-scalabl
MP-ify fastforward to support GATEWAY kernel option.
I add "ipflow_lock" mutex in ip_flow.c and "ip6flow_lock" mutex in ip6_flow.c to protect all data in each file. Of course, this is not MP-scalable. However, it is sufficient as tentative workaround. We should make it scalable somehow in the future.
ok by ozaki-r@n.o.
show more ...
|
| #
14ea9af5 |
| 13-Jun-2016 |
knakahara <knakahara@NetBSD.org> |
make ipflow_reap() static function.
|
| #
f2808ade |
| 13-Jun-2016 |
knakahara <knakahara@NetBSD.org> |
remove unnecessary splnet before pool_{get,put}
|
| #
fe6d4275 |
| 10-Jun-2016 |
ozaki-r <ozaki-r@NetBSD.org> |
Avoid storing a pointer of an interface in a mbuf
Having a pointer of an interface in a mbuf isn't safe if we remove big kernel locks; an interface object (ifnet) can be destroyed anytime in any pac
Avoid storing a pointer of an interface in a mbuf
Having a pointer of an interface in a mbuf isn't safe if we remove big kernel locks; an interface object (ifnet) can be destroyed anytime in any packet processing and accessing such object via a pointer is racy. Instead we have to get an object from the interface collection (ifindex2ifnet) via an interface index (if_index) that is stored to a mbuf instead of an pointer.
The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9) for sleep-able critical sections and m_{get,put}_rcvif that use pserialize(9) for other critical sections. The change also adds another API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition moratorium, i.e., it is intended to be used for places where are not planned to be MP-ified soon.
The change adds some overhead due to psref to performance sensitive paths, however the overhead is not serious, 2% down at worst.
Proposed on tech-kern and tech-net.
show more ...
|
| #
a37502b2 |
| 23-Mar-2015 |
roy <roy@NetBSD.org> |
Add RTF_BROADCAST to mark routes used for the broadcast address when they are created on the fly. This makes it clear what the route is for and allows an optimisation in ip_output() by avoiding a cal
Add RTF_BROADCAST to mark routes used for the broadcast address when they are created on the fly. This makes it clear what the route is for and allows an optimisation in ip_output() by avoiding a call to in_broadcast() because most of the time we do talk to a host. It also avoids a needless allocation for the storage of llinfo_arp and thus vanishes from arp(8) - it showed as incomplete anyway so this is a nice side effect.
Guard against this and routes marked with RTF_BLACKHOLE in ip_fastforward(). While here, guard against routes marked with RTF_BLACKHOLE in ip6_fastforward(). RTF_BROADCAST is IPv4 only, so don't bother checking that here.
show more ...
|
| #
f0a7346d |
| 18-Oct-2014 |
snj <snj@NetBSD.org> |
src is too big these days to tolerate superfluous apostrophes. It's "its", people!
|
| #
f499e20d |
| 22-May-2014 |
rmind <rmind@NetBSD.org> |
- Add in_init() and move some functions, variables and sysctls into in.c where they belong to. Make some functions and variables static. - ip_input.c: reduce some #ifdefs, cleanup a little. - Move
- Add in_init() and move some functions, variables and sysctls into in.c where they belong to. Make some functions and variables static. - ip_input.c: reduce some #ifdefs, cleanup a little. - Move some sysctls into ip_flow.c as they belong there.
No functional change.
show more ...
|
| #
d6107915 |
| 01-Apr-2014 |
pooka <pooka@NetBSD.org> |
Wrap ipflow_create() & ip6flow_create() in kernel lock. Prevents the interrupt side on another core from seeing the situation while the ipflow is being modified.
|
| #
6ea5422d |
| 19-Mar-2014 |
liamjfoy <liamjfoy@NetBSD.org> |
Move ipflow into ip_var.h and fix confliction
|