Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-9] src/sys



Module Name:    src
Committed By:   martin
Date:           Tue Sep 24 03:10:36 UTC 2019

Modified Files:
        src/sys/net [netbsd-9]: if.c if.h if_gif.c if_gif.h if_ipsec.c
            if_ipsec.h if_l2tp.c if_l2tp.h route.c route.h
        src/sys/netinet [netbsd-9]: in_gif.c in_l2tp.c ip_input.c wqinput.c
        src/sys/netinet6 [netbsd-9]: in6_gif.c in6_l2tp.c ip6_forward.c
            ip6_input.c
        src/sys/netipsec [netbsd-9]: ipsec_output.c ipsecif.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #238):

        sys/netipsec/ipsec_output.c: revision 1.83
        sys/net/route.h: revision 1.125
        sys/netinet6/ip6_input.c: revision 1.210
        sys/netinet6/ip6_input.c: revision 1.211
        sys/net/if.c: revision 1.461
        sys/net/if_gif.h: revision 1.33
        sys/net/route.c: revision 1.220
        sys/net/route.c: revision 1.221
        sys/net/if.h: revision 1.277
        sys/netinet6/ip6_forward.c: revision 1.97
        sys/netinet/wqinput.c: revision 1.6
        sys/net/if_ipsec.h: revision 1.5
        sys/netinet6/in6_l2tp.c: revision 1.18
        sys/netinet6/in6_gif.c: revision 1.94
        sys/net/if_l2tp.h: revision 1.7
        sys/net/if_gif.c: revision 1.149
        sys/net/if_l2tp.h: revision 1.8
        sys/netinet/in_gif.c: revision 1.95
        sys/netinet/in_l2tp.c: revision 1.17
        sys/netipsec/ipsecif.c: revision 1.17
        sys/net/if_ipsec.c: revision 1.24
        sys/net/if_l2tp.c: revision 1.37
        sys/netinet/ip_input.c: revision 1.391
        sys/net/if_l2tp.c: revision 1.38
        sys/netinet/ip_input.c: revision 1.392
        sys/net/if_l2tp.c: revision 1.39

Avoid having a rtcache directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

wqinput: avoid having struct wqinput_worklist directly in a percpu storage

percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Input handlers of wqinput normally involves sleepable operations so we must
avoid dereferencing a percpu data (struct wqinput_worklist) after executing
an input handler.  Address this situation by having just a pointer to the data
in a percpu storage instead.
Reviewed by knakahara@ and yamaguchi@

 -

Add missing #include <sys/kmem.h>

 -

Divide Tx context of l2tp(4) to improve performance.

It seems l2tp(4) call path is too long for instruction cache. So, dividing
l2tp(4) Tx context improves CPU use efficiency.

After this commit, l2tp(4) throughput gains 10% on my machine(Atom C3000).

 -

Apply some missing changes lost on the previous commit

 -

Avoid having a rtcache directly in a percpu storage for tunnel protocols.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Using rtcache, i.e., packet processing, typically involves sleepable operations
such as rwlock so we must avoid dereferencing a rtcache that is directly stored
in a percpu storage during packet processing.  Address this situation by having
just a pointer to a rtcache in a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@

 -

l2tp(4): avoid having struct ifqueue directly in a percpu storage.
percpu(9) has a certain memory storage for each CPU and provides it by the piece
to users.  If the storages went short, percpu(9) enlarges them by allocating new
larger memory areas, replacing old ones with them and destroying the old ones.

A percpu storage referenced by a pointer gotten via percpu_getref can be
destroyed by the mechanism after a running thread sleeps even if percpu_putref
has not been called.

Tx processing of l2tp(4) uses normally involves sleepable operations so we
must avoid dereferencing a percpu data (struct ifqueue) after executing Tx
processing.  Address this situation by having just a pointer to the data in
a percpu storage instead.

Reviewed by ozaki-r@ and yamaguchi@


To generate a diff of this commit:
cvs rdiff -u -r1.457.2.1 -r1.457.2.2 src/sys/net/if.c
cvs rdiff -u -r1.274 -r1.274.2.1 src/sys/net/if.h
cvs rdiff -u -r1.148 -r1.148.2.1 src/sys/net/if_gif.c
cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/net/if_gif.h
cvs rdiff -u -r1.22 -r1.22.2.1 src/sys/net/if_ipsec.c
cvs rdiff -u -r1.4 -r1.4.4.1 src/sys/net/if_ipsec.h
cvs rdiff -u -r1.35 -r1.35.2.1 src/sys/net/if_l2tp.c
cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/net/if_l2tp.h
cvs rdiff -u -r1.219 -r1.219.2.1 src/sys/net/route.c
cvs rdiff -u -r1.123.2.1 -r1.123.2.2 src/sys/net/route.h
cvs rdiff -u -r1.94 -r1.94.6.1 src/sys/netinet/in_gif.c
cvs rdiff -u -r1.16 -r1.16.4.1 src/sys/netinet/in_l2tp.c
cvs rdiff -u -r1.389.2.1 -r1.389.2.2 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.5 -r1.5.4.1 src/sys/netinet/wqinput.c
cvs rdiff -u -r1.93 -r1.93.6.1 src/sys/netinet6/in6_gif.c
cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/netinet6/in6_l2tp.c
cvs rdiff -u -r1.96 -r1.96.2.1 src/sys/netinet6/ip6_forward.c
cvs rdiff -u -r1.208.2.1 -r1.208.2.2 src/sys/netinet6/ip6_input.c
cvs rdiff -u -r1.82 -r1.82.4.1 src/sys/netipsec/ipsec_output.c
cvs rdiff -u -r1.16 -r1.16.2.1 src/sys/netipsec/ipsecif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index