net/nat: Use hashtable to optimize performance
Performance tested on simulator:
Before optimization: -25% bandwidth @2k entries, -64% @10k entries
hashtable size= 2(1bit): -24% bandwidth @2k entries, -65% @10k entries
hashtable size= 4(2bits):-15% bandwidth @2k entries, -51% @10k entries
hashtable size= 32(5bits): -3% bandwidth @2k entries, -14% @10k entries
hashtable size=256(8bits): -1% bandwidth @2k entries, -3% @10k entries
Note: Tested on worst performance, the earliest entry will be the worst.
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>