Commit Graph

9 Commits

Author SHA1 Message Date
riastradh
24f30c4a12 Switch if_l2tp to atomic_load/store_*.
Fix missing membar_datadep_consumer -- now atomic_load_consume -- in
l2tp_lookup_session_ref.
2020-02-01 02:58:05 +00:00
knakahara
2da350beca 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@
2019-09-19 06:07:24 +00:00
knakahara
b18d08a8c6 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).
2019-09-19 04:59:42 +00:00
knakahara
ebac3c728d Fix panic when doing ioctl to multiple pseudo interfaces. Pointed out by k-goda@IIJ.
XXX pullup-8
2018-10-19 00:12:56 +00:00
knakahara
b0c61d654b Fix LOCKDEBUG kernel panic when many(about 200) tunnel interfaces is created.
The tunnel interfaces are gif(4), l2tp(4), and ipsecif(4). They use mutex
itself in percpu area. When percpu_cpu_enlarge() run, the address of the
mutex in percpu area becomes different from the address which lockdebug
saved. That can cause "already initialized" false detection.
2018-04-27 09:55:27 +00:00
christos
ec77b5055a s/static inline/static __inline/g for consistency. 2018-04-19 21:20:43 +00:00
knakahara
a90a862765 If if_attach() failed in the attach function, return. Add comments about if_initialize().
suggested by ozaki-r@n.o.
2017-10-30 11:24:04 +00:00
knakahara
516a5b9a9a remove obsoleted comment. pointed out by s-yamaguchi@IIJ. 2017-05-31 08:19:44 +00:00
knakahara
706b73f634 add missing files. 2017-02-16 08:23:35 +00:00