#
9187b359 |
| 21-Jun-2016 |
Bill Yuan <bycn82@dragonflybsd.org> |
ipfw3: lockless in-kernel NAT
The libalias is used in kernel space for in-kernel NAT, and its alias_link entries are stored with LIST. so all the packets which need to be NAT will scan against the L
ipfw3: lockless in-kernel NAT
The libalias is used in kernel space for in-kernel NAT, and its alias_link entries are stored with LIST. so all the packets which need to be NAT will scan against the LIST and trying to find the matched alias_link. by seperating the libalias into context of different CPUs, the lock can be removed. and due to the nature of NAT, the outgoing and incoming packets are possible to be handled by different CPUs, to ensure the returning packet can be translated properly, the newly created alias_link is required to be duplicated and inserted into contexts of both CPUs.
e.g. ipfw3 nat 1 config if em0 ipfw3 nat 1 all via em0 ipfw3 nat 1 show state
show more ...
|