diff options
Diffstat (limited to 'common/VIL/l2l3_stack')
-rw-r--r-- | common/VIL/l2l3_stack/build/.interface.o.d | 180 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/build/.l2_proto.o.d | 175 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/build/.main.o.d | 209 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/interface.c | 2 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/l3fwd_lpm4.c | 2 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/l3fwd_lpm6.c | 2 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/lib_arp.c | 1774 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/lib_arp.h | 131 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/lib_icmpv6.c | 40 | ||||
-rw-r--r-- | common/VIL/l2l3_stack/lib_icmpv6.h | 1 |
10 files changed, 1197 insertions, 1319 deletions
diff --git a/common/VIL/l2l3_stack/build/.interface.o.d b/common/VIL/l2l3_stack/build/.interface.o.d deleted file mode 100644 index 582958f4..00000000 --- a/common/VIL/l2l3_stack/build/.interface.o.d +++ /dev/null @@ -1,180 +0,0 @@ -dep_interface.o = \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/interface.c \ - /usr/include/stdc-predef.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_config.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/interface.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ - /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \ - /usr/include/stdint.h /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/inttypes.h /usr/include/x86_64-linux-gnu/sys/queue.h \ - /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/socket_type.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/setjmp.h \ - /usr/include/x86_64-linux-gnu/bits/setjmp.h /usr/include/ctype.h \ - /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/getopt.h /usr/include/signal.h \ - /usr/include/x86_64-linux-gnu/bits/signum.h \ - /usr/include/x86_64-linux-gnu/bits/siginfo.h \ - /usr/include/x86_64-linux-gnu/bits/sigaction.h \ - /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigstack.h \ - /usr/include/x86_64-linux-gnu/sys/ucontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigthread.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \ - /usr/include/arpa/inet.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ - /usr/include/x86_64-linux-gnu/bits/local_lim.h \ - /usr/include/linux/limits.h \ - /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/emmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memory.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_dom0_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memcpy.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_vect.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/x86intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ia32intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ammintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/smmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/popcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/wmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/immintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512fintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512erintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512pfintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512cdintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512bwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512dqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlbwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vldqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmavlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmivlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/shaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lzcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmi2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/f16cintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rtmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xtestintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm3dnow.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/prfchwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fma4intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xopintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lwpintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tbmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rdseedintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fxsrintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/adxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clwbintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pcommitintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clflushoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavesintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavecintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memzone.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eal.h \ - /usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_per_lcore.h \ - /usr/include/pthread.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_launch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_debug.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lcore.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_pci.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_random.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mbuf.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mempool.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rtm.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ring.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_devargs.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev_info.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_errno.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_bond.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/lib_arp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_pipeline.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l2_proto.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ip.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/tsx.h diff --git a/common/VIL/l2l3_stack/build/.l2_proto.o.d b/common/VIL/l2l3_stack/build/.l2_proto.o.d deleted file mode 100644 index 13bcf504..00000000 --- a/common/VIL/l2l3_stack/build/.l2_proto.o.d +++ /dev/null @@ -1,175 +0,0 @@ -dep_l2_proto.o = \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l2_proto.c \ - /usr/include/stdc-predef.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_config.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l2_proto.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ - /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib-float.h /usr/include/string.h \ - /usr/include/xlocale.h /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h \ - /usr/include/stdint.h /usr/include/x86_64-linux-gnu/bits/wchar.h \ - /usr/include/inttypes.h /usr/include/x86_64-linux-gnu/sys/queue.h \ - /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/socket_type.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/in.h /usr/include/setjmp.h \ - /usr/include/x86_64-linux-gnu/bits/setjmp.h /usr/include/ctype.h \ - /usr/include/errno.h /usr/include/x86_64-linux-gnu/bits/errno.h \ - /usr/include/linux/errno.h /usr/include/x86_64-linux-gnu/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/getopt.h /usr/include/signal.h \ - /usr/include/x86_64-linux-gnu/bits/signum.h \ - /usr/include/x86_64-linux-gnu/bits/siginfo.h \ - /usr/include/x86_64-linux-gnu/bits/sigaction.h \ - /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigstack.h \ - /usr/include/x86_64-linux-gnu/sys/ucontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigthread.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ - /usr/include/x86_64-linux-gnu/bits/local_lim.h \ - /usr/include/linux/limits.h \ - /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/emmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memory.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_dom0_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memcpy.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_vect.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/x86intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ia32intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ammintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/smmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/popcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/wmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/immintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512fintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512erintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512pfintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512cdintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512bwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512dqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlbwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vldqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmavlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmivlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/shaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lzcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmi2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/f16cintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rtmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xtestintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm3dnow.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/prfchwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fma4intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xopintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lwpintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tbmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rdseedintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fxsrintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/adxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clwbintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pcommitintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clflushoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavesintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavecintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memzone.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eal.h \ - /usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_per_lcore.h \ - /usr/include/pthread.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_launch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_debug.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lcore.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_pci.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_random.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mbuf.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mempool.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rtm.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ring.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_devargs.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev_info.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ip.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/interface.h \ - /usr/include/arpa/inet.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_errno.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_bond.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h diff --git a/common/VIL/l2l3_stack/build/.main.o.d b/common/VIL/l2l3_stack/build/.main.o.d deleted file mode 100644 index 9d27accd..00000000 --- a/common/VIL/l2l3_stack/build/.main.o.d +++ /dev/null @@ -1,209 +0,0 @@ -dep_main.o = \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/main.c \ - /usr/include/stdc-predef.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/x86_64-linux-gnu/sys/cdefs.h \ - /usr/include/x86_64-linux-gnu/bits/wordsize.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs.h \ - /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \ - /usr/include/x86_64-linux-gnu/bits/types.h \ - /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ - /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ - /usr/include/x86_64-linux-gnu/bits/sys_errlist.h /usr/include/stdlib.h \ - /usr/include/x86_64-linux-gnu/bits/waitflags.h \ - /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ - /usr/include/x86_64-linux-gnu/bits/endian.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap.h \ - /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ - /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/x86_64-linux-gnu/sys/select.h \ - /usr/include/x86_64-linux-gnu/bits/select.h \ - /usr/include/x86_64-linux-gnu/bits/sigset.h \ - /usr/include/x86_64-linux-gnu/bits/time.h \ - /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ - /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h /usr/include/stdint.h \ - /usr/include/x86_64-linux-gnu/bits/wchar.h /usr/include/inttypes.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/x86_64-linux-gnu/sys/queue.h /usr/include/errno.h \ - /usr/include/x86_64-linux-gnu/bits/errno.h /usr/include/linux/errno.h \ - /usr/include/x86_64-linux-gnu/asm/errno.h \ - /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ - /usr/include/getopt.h /usr/include/signal.h \ - /usr/include/x86_64-linux-gnu/bits/signum.h \ - /usr/include/x86_64-linux-gnu/bits/siginfo.h \ - /usr/include/x86_64-linux-gnu/bits/sigaction.h \ - /usr/include/x86_64-linux-gnu/bits/sigcontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigstack.h \ - /usr/include/x86_64-linux-gnu/sys/ucontext.h \ - /usr/include/x86_64-linux-gnu/bits/sigthread.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/stdbool.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /usr/include/ctype.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ - /usr/include/x86_64-linux-gnu/bits/local_lim.h \ - /usr/include/linux/limits.h \ - /usr/include/x86_64-linux-gnu/bits/posix2_lim.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/emmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_vect.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/x86intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ia32intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/ammintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/smmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/popcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/wmmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/immintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512fintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512erintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512pfintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512cdintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512bwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512dqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vlbwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vldqintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512ifmavlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/avx512vbmivlintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/shaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lzcntintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmiintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/bmi2intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fmaintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/f16cintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rtmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xtestintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mm3dnow.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/prfchwintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fma4intrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xopintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/lwpintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/tbmintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/rdseedintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/fxsrintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsaveoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/adxintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clwbintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/pcommitintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/clflushoptintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavesintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/xsavecintrin.h \ - /usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_byteorder.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_byteorder_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memory.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_dom0_common.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memcpy.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_memzone.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eal.h \ - /usr/include/sched.h /usr/include/x86_64-linux-gnu/bits/sched.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_per_lcore.h \ - /usr/include/pthread.h /usr/include/x86_64-linux-gnu/bits/setjmp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_launch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_atomic.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_atomic_64.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cycles.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_debug.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_log.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_branch_prediction.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_prefetch.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lcore.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/exec-env/rte_interrupts.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_pci.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_random.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mbuf.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_mempool.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_spinlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rtm.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ring.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_devargs.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ether.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_dev_info.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_ip.h \ - /usr/include/netinet/in.h /usr/include/x86_64-linux-gnu/sys/socket.h \ - /usr/include/x86_64-linux-gnu/sys/uio.h \ - /usr/include/x86_64-linux-gnu/bits/uio.h \ - /usr/include/x86_64-linux-gnu/bits/socket.h \ - /usr/include/x86_64-linux-gnu/bits/socket_type.h \ - /usr/include/x86_64-linux-gnu/bits/sockaddr.h \ - /usr/include/x86_64-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/x86_64-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h \ - /usr/include/x86_64-linux-gnu/bits/in.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_tcp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_udp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_string_fns.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_timer.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/lib_arp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_pipeline.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l2_proto.h \ - /usr/include/setjmp.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_malloc.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_ctrl.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/interface.h \ - /usr/include/arpa/inet.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_errno.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port_ethdev.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_port.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_eth_bond.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/generic/rte_rwlock.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_spinlock.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/interface.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l3fwd_common.h \ - /usr/include/x86_64-linux-gnu/sys/param.h \ - /usr/include/x86_64-linux-gnu/bits/param.h /usr/include/linux/param.h \ - /usr/include/x86_64-linux-gnu/asm/param.h \ - /usr/include/asm-generic/param.h /usr/include/unistd.h \ - /usr/include/x86_64-linux-gnu/bits/posix_opt.h \ - /usr/include/x86_64-linux-gnu/bits/environments.h \ - /usr/include/x86_64-linux-gnu/bits/confname.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_hash.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_jhash.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table_hash.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table_lpm.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l3fwd_lpm4.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lpm.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_compat.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lpm_sse.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_lpm6.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l3fwd_lpm6.h \ - /home/ubuntu/dpdk-16.07/x86_64-native-linuxapp-gcc/include/rte_table_lpm_ipv6.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l3fwd_lpm4.h \ - /home/ubuntu/feb_cgnat/csig_sdnd_benchmarking-industrial_standard_benchmarking/common/VIL/l2l3_stack/l3fwd_lpm6.h diff --git a/common/VIL/l2l3_stack/interface.c b/common/VIL/l2l3_stack/interface.c index bd4c4e92..627423b4 100644 --- a/common/VIL/l2l3_stack/interface.c +++ b/common/VIL/l2l3_stack/interface.c @@ -453,6 +453,7 @@ void ifm_update_linkstatus(uint8_t port_id, uint16_t linkstatus) rte_eth_link_get(port_id, &link); if (linkstatus == IFM_ETH_LINK_UP) { port->admin_status = IFM_ETH_LINK_UP; + port->link_status = IFM_ETH_LINK_UP; if(!link.link_status) { if (rte_eth_dev_set_link_up(port_id) < 0) { RTE_LOG(INFO, IFM, @@ -481,6 +482,7 @@ void ifm_update_linkstatus(uint8_t port_id, uint16_t linkstatus) { int status; port->admin_status = IFM_ETH_LINK_DOWN; + port->link_status = IFM_ETH_LINK_DOWN; /* need to check the following if */ if(link.link_status) { status = rte_eth_dev_set_link_down(port_id); diff --git a/common/VIL/l2l3_stack/l3fwd_lpm4.c b/common/VIL/l2l3_stack/l3fwd_lpm4.c index 081038b6..8b3aab19 100644 --- a/common/VIL/l2l3_stack/l3fwd_lpm4.c +++ b/common/VIL/l2l3_stack/l3fwd_lpm4.c @@ -491,7 +491,7 @@ get_dest_mac_for_nexthop(uint32_t next_hop_ip, arp_key.port_id = out_phy_port; arp_key.ip = next_hop_ip; - arp_data = retrieve_arp_entry(arp_key); + arp_data = retrieve_arp_entry(arp_key, DYNAMIC_ARP); if (arp_data == NULL) { printf("ARP entry is not found for ip %x, port %d\n", next_hop_ip, out_phy_port); diff --git a/common/VIL/l2l3_stack/l3fwd_lpm6.c b/common/VIL/l2l3_stack/l3fwd_lpm6.c index 7aa7fb6a..7d3cf4fb 100644 --- a/common/VIL/l2l3_stack/l3fwd_lpm6.c +++ b/common/VIL/l2l3_stack/l3fwd_lpm6.c @@ -705,7 +705,7 @@ int get_dest_mac_for_nexthop_ipv6(uint8_t nh_ipv6[RTE_LPM_IPV6_ADDR_SIZE], } tmp_nd_key.port_id = out_phy_port; - nd_data = retrieve_nd_entry(tmp_nd_key); + nd_data = retrieve_nd_entry(tmp_nd_key, DYNAMIC_ND); if (nd_data == NULL) { printf("ND entry is not found\n"); return 0; diff --git a/common/VIL/l2l3_stack/lib_arp.c b/common/VIL/l2l3_stack/lib_arp.c index 0162f820..0c597301 100644 --- a/common/VIL/l2l3_stack/lib_arp.c +++ b/common/VIL/l2l3_stack/lib_arp.c @@ -34,6 +34,7 @@ #include <rte_jhash.h> #include <rte_cycles.h> #include <rte_timer.h> +#include <tsx.h> #include "interface.h" #include "l2_proto.h" #include "lib_arp.h" @@ -53,20 +54,27 @@ #define IP_VERSION_4 0x40 #define IP_HDRLEN 0x05 /**< default IP header length == five 32-bits words. */ #define IP_VHL_DEF (IP_VERSION_4 | IP_HDRLEN) - +#define MAX_POOL 32 #define is_multicast_ipv4_addr(ipv4_addr) \ (((rte_be_to_cpu_32((ipv4_addr)) >> 24) & 0x000000FF) == 0xE0) extern uint8_t prv_in_port_a[PIPELINE_MAX_PORT_IN]; extern uint32_t timer_lcore; +extern int USE_RTM_LOCKS; uint32_t arp_timeout = ARP_TIMER_EXPIRY; +uint32_t arp_buffer = ARP_BUF_DEFAULT; +uint32_t nd_buffer = ARP_BUF_DEFAULT; /*ND IPV6 */ #define INADDRSZ 4 #define IN6ADDRSZ 16 +#define MAX_PORTS 32 + static int my_inet_pton_ipv6(int af, const char *src, void *dst); static int inet_pton_ipv6(const char *src, unsigned char *dst); static int inet_pton_ipv4(const char *src, unsigned char *dst); +static void local_arp_cache_init(void); +struct ether_addr *get_nd_local_link_hw_addr(uint8_t out_port, uint8_t nhip[]); extern void convert_prefixlen_to_netmask_ipv6(uint32_t depth, uint8_t netmask_ipv6[]); @@ -101,12 +109,61 @@ uint32_t lib_nd_duplicate_found; struct rte_mempool *lib_arp_pktmbuf_tx_pool; struct rte_mempool *lib_nd_pktmbuf_tx_pool; -struct rte_mbuf *lib_arp_pkt; -struct rte_mbuf *lib_nd_pkt; +struct rte_mbuf *lib_arp_pkt[MAX_PORTS]; +struct rte_mbuf *lib_nd_pkt[MAX_PORTS]; uint8_t default_ether_addr[6] = { 0, 0, 0, 0, 1, 1 }; uint8_t default_ip[4] = { 0, 0, 1, 1 }; +uint64_t start_tsc[4]; +uint64_t end_tsc[4]; +#define ticks_per_ms (rte_get_tsc_hz()/1000) + +#define MAX_NUM_ARP_CACHE_MAC_ADDRESS 16 + +/***** ARP local cache *****/ +struct arp_data *p_arp_data; +//struct arp_cache arp_local_cache[MAX_PORTS]; +uint8_t arp_cache_hw_laddr_valid[MAX_NUM_ARP_CACHE_MAC_ADDRESS] = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/** + * handler lock. + */ +rte_rwlock_t arp_hash_handle_lock; +rte_rwlock_t nd_hash_handle_lock; + +void update_nhip_access(uint8_t dest_if) +{ + p_arp_data->update_tsc[dest_if] = rte_rdtsc(); +} + +/** + * A structure defining the mbuf meta data for VFW. + */ +struct mbuf_arp_meta_data { +/* output port stored for RTE_PIPELINE_ACTION_PORT_META */ + uint32_t output_port; + struct rte_mbuf *next; /* next pointer for chained buffers */ +} __rte_cache_aligned; + +static struct arp_entry_data arp_entry_data_default = { + .status = COMPLETE, + .num_pkts = 0, +}; + +static struct nd_entry_data nd_entry_data_default = { + .status = COMPLETE, + .num_pkts = 0, +}; + +/** + * memory pool for queued up user pkts. + */ +struct rte_mempool *arp_icmp_pktmbuf_tx_pool; + static struct rte_hash_parameters arp_hash_params = { .name = "ARP", .entries = 64, @@ -125,6 +182,24 @@ static struct rte_hash_parameters nd_hash_params = { .hash_func_init_val = 0, }; +struct ether_addr broadcast_ether_addr = { + .addr_bytes[0] = 0xFF, + .addr_bytes[1] = 0xFF, + .addr_bytes[2] = 0xFF, + .addr_bytes[3] = 0xFF, + .addr_bytes[4] = 0xFF, + .addr_bytes[5] = 0xFF, +}; + +static const struct ether_addr null_ether_addr = { + .addr_bytes[0] = 0x00, + .addr_bytes[1] = 0x00, + .addr_bytes[2] = 0x00, + .addr_bytes[3] = 0x00, + .addr_bytes[4] = 0x00, + .addr_bytes[5] = 0x00, +}; + struct rte_hash *arp_hash_handle; struct rte_hash *nd_hash_handle; @@ -150,18 +225,19 @@ int timer_objs_mempool_count = 70000; #define MAX_NUM_ARP_ENTRIES 64 #define MAX_NUM_ND_ENTRIES 64 -uint32_t get_nh(uint32_t, uint32_t *); -void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[]); +inline uint32_t get_nh(uint32_t, uint32_t *, struct ether_addr *addr); +void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[], + struct ether_addr *hw_addr); #define MAX_ARP_DATA_ENTRY_TABLE 7 struct table_arp_entry_data arp_entry_data_table[MAX_ARP_DATA_ENTRY_TABLE] = { - {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(192, 168, 0, 2)}, - {{0, 0, 0, 0, 0, 2}, 0, INCOMPLETE, IPv4(192, 168, 0, 3)}, - {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(30, 40, 50, 60)}, - {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(120, 0, 0, 2)}, - {{0, 0, 0, 0, 0, 4}, 3, INCOMPLETE, IPv4(1, 1, 1, 4)}, - {{0, 0, 0, 0, 0, 5}, 4, INCOMPLETE, IPv4(1, 1, 1, 5)}, + {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(1, 1, 1, 1)}, + {{0, 0, 0, 0, 0, 2}, 0, INCOMPLETE, IPv4(1, 1, 1, 2)}, + {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(1, 1, 1, 3)}, + {{0, 0, 0, 0, 0, 1}, 1, INCOMPLETE, IPv4(1, 1, 1, 4)}, + {{0, 0, 0, 0, 0, 4}, 1, INCOMPLETE, IPv4(1, 1, 1, 5)}, + {{0, 0, 0, 0, 0, 5}, 0, INCOMPLETE, IPv4(1, 1, 1, 6)}, {{0, 0, 0, 0, 0, 6}, 1, INCOMPLETE, IPv4(1, 1, 1, 7)}, }; @@ -251,43 +327,28 @@ struct lib_nd_route_table_entry lib_nd_route_table[MAX_ND_RT_ENTRY] = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} } }; -struct lib_arp_route_table_entry lib_arp_route_table[MAX_ARP_RT_ENTRY] = { - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0}, - {0, 0, 0, 0} -}; - void print_trace(void); +uint32_t get_arp_buf(void) +{ + return arp_buffer; +} + +uint32_t get_nd_buf(void) +{ + return nd_buffer; +} + +uint8_t arp_cache_dest_mac_present(uint32_t out_port) +{ + return p_arp_data->arp_cache_hw_laddr_valid[out_port]; +} + +uint8_t nd_cache_dest_mac_present(uint32_t out_port) +{ + return p_arp_data->nd_cache_hw_laddr_valid[out_port]; +} + /* Obtain a backtrace and print it to stdout. */ void print_trace(void) { @@ -307,36 +368,28 @@ void print_trace(void) free(strings); } -uint32_t get_nh(uint32_t ip, uint32_t *port) +uint32_t get_nh(uint32_t ip, uint32_t *port, struct ether_addr *addr) { int i = 0; - for (i = 0; i < MAX_ARP_RT_ENTRY; i++) { - if (((lib_arp_route_table[i]. - ip & lib_arp_route_table[i].mask) == - (ip & lib_arp_route_table[i].mask))) { - - *port = lib_arp_route_table[i].port; - lib_arp_nh_found++; - return lib_arp_route_table[i].nh; + for (i = 0; i < p_arp_data->lib_arp_route_ent_cnt; i++) { + if ((p_arp_data->lib_arp_route_table[i].nh_mask) == + (ip & p_arp_data->lib_arp_route_table[i].mask)) { + + *port = p_arp_data->lib_arp_route_table[i].port; + if (arp_cache_dest_mac_present(*port)) + ether_addr_copy( + get_local_link_hw_addr(*port, + p_arp_data->lib_arp_route_table[i].nh), addr); + return p_arp_data->lib_arp_route_table[i].nh; } - if (ARPICMP_DEBUG) - printf("No nh match ip 0x%x, port %u, t_ip " - "0x%x, t_port %u, mask 0x%x, r1 %x, r2 %x\n", - ip, *port, lib_arp_route_table[i].ip, - lib_arp_route_table[i].port, - lib_arp_route_table[i].mask, - (lib_arp_route_table[i].ip & - lib_arp_route_table[i].mask), - (ip & lib_arp_route_table[i].mask)); } - if (ARPICMP_DEBUG) - printf("No NH - ip 0x%x, port %u\n", ip, *port); lib_arp_no_nh_found++; return 0; } /*ND IPv6 */ -void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[]) +void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[], +struct ether_addr *hw_addr) { int i = 0; uint8_t netmask_ipv6[16], netip_nd[16], netip_in[16]; @@ -374,6 +427,11 @@ void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[]) for (j = 0; j < 16; j++) nhipv6[j] = lib_nd_route_table[i].nhipv6[j]; + if (nd_cache_dest_mac_present(*port)) { + ether_addr_copy( + get_nd_local_link_hw_addr(*port, nhipv6), + (struct ether_addr *)hw_addr); + } return; } @@ -383,27 +441,33 @@ void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[]) depthflags1 = 0; } if (NDIPV6_DEBUG) - printf("No NH - ip 0x%x, port %u\n", ipv6[0], *port); + printf("No NH - ip 0x%x, \n", ipv6[0]); lib_nd_no_nh_found++; } /* Added for Multiport changes*/ -int get_dest_mac_addr_port(const uint32_t ipaddr, +struct arp_entry_data *get_dest_mac_addr_port(const uint32_t ipaddr, uint32_t *phy_port, struct ether_addr *hw_addr) { - lib_arp_get_mac_req++; + struct arp_entry_data *ret_arp_data = NULL; uint32_t nhip = 0; + uint8_t index; - nhip = get_nh(ipaddr, phy_port); - if (nhip == 0) { + nhip = get_nh(ipaddr, phy_port, hw_addr); + if (unlikely(nhip == 0)) { if (ARPICMP_DEBUG) printf("ARPICMP no nh found for ip %x, port %d\n", ipaddr, *phy_port); - //return 0; - return NH_NOT_FOUND; + return ret_arp_data; + } + + /* as part of optimization we store mac address in cache + * & thus can be sent without having to retrieve + */ + if (arp_cache_dest_mac_present(*phy_port)) { + return &arp_entry_data_default; } - struct arp_entry_data *ret_arp_data = NULL; struct arp_key_ipv4 tmp_arp_key; tmp_arp_key.port_id = *phy_port; /* Changed for Multi Port */ tmp_arp_key.ip = nhip; @@ -412,130 +476,49 @@ int get_dest_mac_addr_port(const uint32_t ipaddr, printf("%s: nhip: %x, phyport: %d\n", __FUNCTION__, nhip, *phy_port); - ret_arp_data = retrieve_arp_entry(tmp_arp_key); - if (ret_arp_data == NULL) { - if (ARPICMP_DEBUG) { - printf - ("ARPICMP no arp entry found for ip %x, port %d\n", - ipaddr, *phy_port); - print_arp_table(); - } - if (nhip != 0) { - if (ARPICMP_DEBUG) - printf("CG-NAPT requesting ARP for ip %x, " - "port %d\n", nhip, *phy_port); - request_arp(*phy_port, nhip); //Changed for Multiport - - } - lib_arp_no_arp_entry_found++; - return ARP_NOT_FOUND; - } - ether_addr_copy(&ret_arp_data->eth_addr, hw_addr); - lib_arp_arp_entry_found++; - if (ARPICMP_DEBUG) - printf("%s: ARPICMP hwaddr found\n", __FUNCTION__); - return ARP_FOUND; -} - -int get_dest_mac_address(const uint32_t ipaddr, uint32_t *phy_port, - struct ether_addr *hw_addr, uint32_t *nhip) -{ - lib_arp_get_mac_req++; - - *nhip = get_nh(ipaddr, phy_port); - if (*nhip == 0) { - if (ARPICMP_DEBUG && ipaddr) - RTE_LOG(INFO, LIBARP, - "ARPICMP no nh found for ip %x, port %d\n", - ipaddr, *phy_port); - return 0; - } - - struct arp_entry_data *ret_arp_data = NULL; - struct arp_key_ipv4 tmp_arp_key; - tmp_arp_key.port_id = *phy_port; - tmp_arp_key.ip = *nhip; - - ret_arp_data = retrieve_arp_entry(tmp_arp_key); + ret_arp_data = retrieve_arp_entry(tmp_arp_key, DYNAMIC_ARP); if (ret_arp_data == NULL) { - if (ARPICMP_DEBUG && ipaddr) { - RTE_LOG(INFO, LIBARP, - "ARPICMP no arp entry found for ip %x, port %d\n", - ipaddr, *phy_port); - print_arp_table(); - } + if (ARPICMP_DEBUG && ipaddr) + { + RTE_LOG(INFO, LIBARP,"ARPICMP no arp entry found for ip %x," + " port %u\n", ipaddr, *phy_port); + print_arp_table(); + } lib_arp_no_arp_entry_found++; - return 0; - } - ether_addr_copy(&ret_arp_data->eth_addr, hw_addr); - lib_arp_arp_entry_found++; - return 1; - -} - -int get_dest_mac_addr(const uint32_t ipaddr, - uint32_t *phy_port, struct ether_addr *hw_addr) -{ - lib_arp_get_mac_req++; - uint32_t nhip = 0; - - nhip = get_nh(ipaddr, phy_port); - if (nhip == 0) { - if (ARPICMP_DEBUG && ipaddr) - RTE_LOG(INFO, LIBARP, - "ARPICMP no nh found for ip %x, port %d\n", - ipaddr, *phy_port); - return 0; - } - - struct arp_entry_data *ret_arp_data = NULL; - struct arp_key_ipv4 tmp_arp_key; - tmp_arp_key.port_id = *phy_port; - tmp_arp_key.ip = nhip; + } else if (ret_arp_data->status == COMPLETE) { + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + ether_addr_copy(&ret_arp_data->eth_addr, hw_addr); + p_arp_data->arp_cache_hw_laddr_valid[*phy_port] = 1; + index = p_arp_data->arp_local_cache[*phy_port].num_nhip; + p_arp_data->arp_local_cache[*phy_port].nhip[index] = nhip; + ether_addr_copy(hw_addr, + &p_arp_data->arp_local_cache[*phy_port].link_hw_laddr[index]); + p_arp_data->arp_local_cache[*phy_port].num_nhip++; + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + lib_arp_arp_entry_found++; + if (ARPICMP_DEBUG) + printf("%s: ARPICMP hwaddr found\n", __FUNCTION__); + } - ret_arp_data = retrieve_arp_entry(tmp_arp_key); - if (ret_arp_data == NULL) { - if (ARPICMP_DEBUG && ipaddr) { - printf - ("ARPICMP no arp entry found for ip %x, port %d\n", - ipaddr, *phy_port); - print_arp_table(); - } + if (ret_arp_data) + p_arp_data->update_tsc[*phy_port] = rte_rdtsc(); - if (nhip != 0) { - if (ARPICMP_DEBUG > 4) - printf - ("CG-NAPT requesting ARP for ip %x, port %d\n", - nhip, *phy_port); - if (ifm_chk_port_ipv4_enabled(*phy_port)) { - request_arp(*phy_port, nhip); - } else { - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "%s: IP is not enabled on port %u, not sending ARP REQ\n\r", - __FUNCTION__, *phy_port); - } - - } - lib_arp_no_arp_entry_found++; - return 0; - } - ether_addr_copy(&ret_arp_data->eth_addr, hw_addr); - lib_arp_arp_entry_found++; - return 1; + return ret_arp_data; } -int get_dest_mac_address_ipv6_port(uint8_t ipv6addr[], uint32_t *phy_port, - struct ether_addr *hw_addr, uint8_t nhipv6[]) +struct nd_entry_data *get_dest_mac_address_ipv6_port(uint8_t ipv6addr[], + uint32_t *phy_port, struct ether_addr *hw_addr, uint8_t nhipv6[]) { int i = 0, j = 0, flag = 0; + uint8_t index; lib_nd_get_mac_req++; - get_nh_ipv6(ipv6addr, phy_port, nhipv6); + get_nh_ipv6(ipv6addr, phy_port, nhipv6, hw_addr); for (j = 0; j < 16; j++) { if (nhipv6[j]) flag++; } + if (flag == 0) { if (NDIPV6_DEBUG) printf("NDIPV6 no nh found for ipv6 " @@ -554,73 +537,41 @@ int get_dest_mac_address_ipv6_port(uint8_t ipv6addr[], uint32_t *phy_port, struct nd_key_ipv6 tmp_nd_key; tmp_nd_key.port_id = *phy_port; + if (nd_cache_dest_mac_present(*phy_port)) { + return &nd_entry_data_default; + } + + for (i = 0; i < 16; i++) tmp_nd_key.ipv6[i] = nhipv6[i]; - ret_nd_data = retrieve_nd_entry(tmp_nd_key); + ret_nd_data = retrieve_nd_entry(tmp_nd_key, DYNAMIC_ND); if (ret_nd_data == NULL) { if (NDIPV6_DEBUG) { printf("NDIPV6 no nd entry found for ip %x, port %d\n", ipv6addr[0], *phy_port); } lib_nd_no_arp_entry_found++; - return 0; - } - ether_addr_copy(&ret_nd_data->eth_addr, hw_addr); - lib_nd_nd_entry_found++; - return 1; -} - -int get_dest_mac_address_ipv6(uint8_t ipv6addr[], uint32_t *phy_port, - struct ether_addr *hw_addr, uint8_t nhipv6[]) -{ - int i = 0, j = 0, flag = 0; - lib_nd_get_mac_req++; - - get_nh_ipv6(ipv6addr, phy_port, nhipv6); - for (j = 0; j < 16; j++) { - if (nhipv6[j]) { - flag++; - } - } - if (flag == 0) { - if (NDIPV6_DEBUG && ipv6addr) - RTE_LOG(INFO, LIBARP, - "NDIPV6 no nh found for ipv6 %x, port %d\n", - ipv6addr[0], *phy_port); - return 0; - } - - struct nd_entry_data *ret_nd_data = NULL; - struct nd_key_ipv6 tmp_nd_key; - tmp_nd_key.port_id = *phy_port; + return NULL; + } else if (ret_nd_data->status == COMPLETE) { + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + ether_addr_copy(&ret_nd_data->eth_addr, hw_addr); + p_arp_data->nd_cache_hw_laddr_valid[*phy_port] = 1; + index = p_arp_data->nd_local_cache[*phy_port].num_nhip; + rte_mov16(&p_arp_data->nd_local_cache[*phy_port].nhip[index][0], + &nhipv6[0]); + ether_addr_copy(hw_addr, + &p_arp_data->nd_local_cache[*phy_port].link_hw_laddr[index]); + p_arp_data->nd_local_cache[*phy_port].num_nhip++; - for (i = 0; i < 16; i++) { - tmp_nd_key.ipv6[i] = nhipv6[i]; + lib_nd_nd_entry_found++; + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); } - ret_nd_data = retrieve_nd_entry(tmp_nd_key); - if (ret_nd_data == NULL) { - if (NDIPV6_DEBUG && ipv6addr) { - RTE_LOG(INFO, LIBARP, - "NDIPV6 no nd entry found for ip %x, port %d\n", - ipv6addr[0], *phy_port); - } - if (flag != 0) { - if (ARPICMP_DEBUG > 4) - printf - ("Requesting ARP for ipv6 addr and port %d\n", - *phy_port); - request_nd(&nhipv6[0], ifm_get_port(*phy_port)); - - } + if (ret_nd_data) + p_arp_data->update_tsc[*phy_port] = rte_rdtsc(); - lib_nd_no_arp_entry_found++; - return 0; - } - ether_addr_copy(&ret_nd_data->eth_addr, hw_addr); - lib_nd_nd_entry_found++; - return 1; + return ret_nd_data; } /** @@ -775,7 +726,92 @@ print_mbuf(const char *rx_tx, uint8_t portid, struct rte_mbuf *mbuf, fflush(stdout); } -struct arp_entry_data *retrieve_arp_entry(struct arp_key_ipv4 arp_key) +/** + * Add entry in ND table. + * + * @param nd_key + * key. + * @param ret_nd_data + * return nd entry from table. + * + */ +static int add_nd_data(struct nd_key_ipv6 *nd_key, + struct nd_entry_data *ret_nd_data) +{ + int ret; + struct nd_entry_data *tmp_nd_data = NULL; + rte_rwlock_write_lock(&nd_hash_handle_lock); + /* Check for value while locked */ + ret = rte_hash_lookup_data(nd_hash_handle, nd_key, (void **)&tmp_nd_data); + + if (ret == -ENOENT) { + /* entry not yet added, do so now */ + ret = rte_hash_add_key_data(nd_hash_handle, nd_key, ret_nd_data); + if (ret) { + /* We panic here because either: + * ret == -EINVAL and a parameter got messed up, or + * ret == -ENOSPC and the hash table isn't big enough + */ + rte_panic("ND: Error on entry add for %s", rte_strerror(abs(ret))); + } + } else if (ret < 0) { + /* We panic here because ret == -EINVAL and a parameter got + * messed up, or dpdk hash lib changed and this needs corrected */ + rte_panic("ARP: Error on entry add for %s", rte_strerror(abs(ret))); + } else { + /* entry already exists */ + ret = EEXIST; + } + + rte_rwlock_write_unlock(&nd_hash_handle_lock); + return ret; +} + +/** + * Add entry in ARP table. + * + * @param arp_key + * key. + * @param ret_arp_data + * return arp entry from table. + * + */ +static int add_arp_data(struct arp_key_ipv4 *arp_key, + struct arp_entry_data *ret_arp_data) { + int ret; + struct arp_entry_data *tmp_arp_data = NULL; + rte_rwlock_write_lock(&arp_hash_handle_lock); + /* Check for value while locked */ + ret = rte_hash_lookup_data(arp_hash_handle, arp_key, (void **)&tmp_arp_data); + + if (ret == -ENOENT) { + /* entry not yet added, do so now */ + ret = rte_hash_add_key_data(arp_hash_handle, arp_key, ret_arp_data); + if (ret) { + /* We panic here because either: + * ret == -EINVAL and a parameter got messed up, or + * ret == -ENOSPC and the hash table isn't big enough + */ + rte_panic("ARP: Error on entry add for %s - %s", + inet_ntoa(*(struct in_addr *)&arp_key->ip), + rte_strerror(abs(ret))); + } + } else if (ret < 0) { + /* We panic here because ret == -EINVAL and a parameter got + * messed up, or dpdk hash lib changed and this needs corrected */ + rte_panic("ARP: Error on entry add for %s - %s", + inet_ntoa(*(struct in_addr *)&arp_key->ip), + rte_strerror(abs(ret))); + } else { + /* entry already exists */ + ret = EEXIST; + } + + rte_rwlock_write_unlock(&arp_hash_handle_lock); + return ret; +} + +struct arp_entry_data *retrieve_arp_entry(struct arp_key_ipv4 arp_key, uint8_t mode) { struct arp_entry_data *ret_arp_data = NULL; arp_key.filler1 = 0; @@ -784,32 +820,108 @@ struct arp_entry_data *retrieve_arp_entry(struct arp_key_ipv4 arp_key) int ret = rte_hash_lookup_data(arp_hash_handle, &arp_key, (void **)&ret_arp_data); - if (ret < 0) { - // RTE_LOG(INFO, LIBARP,"arp-hash lookup failed ret %d, EINVAL %d, ENOENT %d\n", ret, EINVAL, ENOENT); - } else { + if (ret < 0 && (mode == DYNAMIC_ARP)) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, "ARP entry not found for ip 0x%x\n", + arp_key.ip); + + /* add INCOMPLETE arp entry */ + ret_arp_data = rte_malloc_socket(NULL, sizeof(struct arp_entry_data), + RTE_CACHE_LINE_SIZE, rte_socket_id()); + ether_addr_copy(&null_ether_addr, &ret_arp_data->eth_addr); + ret_arp_data->status = INCOMPLETE; + ret_arp_data->port = arp_key.port_id; + ret_arp_data->ip = arp_key.ip; + ret_arp_data->mode = mode; + ret_arp_data->num_pkts = 0; + rte_rwlock_init(&ret_arp_data->queue_lock); + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + + /* attempt to add arp_entry to hash */ + ret = add_arp_data(&arp_key, ret_arp_data); + + if (ret == EEXIST) { + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + rte_free(ret_arp_data); + /* Some other thread has 'beat' this thread in + creation of arp_data, try again */ + return NULL; + } - if (ret_arp_data->mode == DYNAMIC_ARP) { - struct arp_timer_key callback_key; - callback_key.port_id = ret_arp_data->port; - callback_key.ip = ret_arp_data->ip; - /*lcore need to check which parameter need to be put */ - if (rte_timer_reset(ret_arp_data->timer, - (arp_timeout * rte_get_tsc_hz()), - SINGLE, timer_lcore, - arp_timer_callback, - &callback_key) < 0) - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Err : Timer already running\n"); + if (rte_mempool_get(timer_mempool_arp, + (void **) &(ret_arp_data->timer) ) < 0) { + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + RTE_LOG(INFO, LIBARP,"Error in getting timer alloc buf\n"); + return NULL; + } + + ret_arp_data->buf_pkts = (struct rte_mbuf **)rte_zmalloc_socket( + NULL, sizeof(struct rte_mbuf *) * arp_buffer, + RTE_CACHE_LINE_SIZE, rte_socket_id()); + + if (ret_arp_data->buf_pkts == NULL) { + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + RTE_LOG(INFO, LIBARP,"Could not allocate buf for queueing\n"); + return NULL; + } + + rte_timer_init(ret_arp_data->timer); + struct arp_timer_key * callback_key = + (struct arp_timer_key*) rte_malloc(NULL, + sizeof(struct arp_timer_key*),RTE_CACHE_LINE_SIZE); + callback_key->port_id = arp_key.port_id; + callback_key->ip = arp_key.ip; + if(ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"TIMER STARTED FOR %u seconds\n", + ARP_TIMER_EXPIRY); + if(rte_timer_reset(ret_arp_data->timer, + (PROBE_TIME * rte_get_tsc_hz() / 1000), + SINGLE,timer_lcore, + arp_timer_callback, + callback_key) < 0) + if(ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"Err : Timer already running\n"); + + ret_arp_data->timer_key = callback_key; + + /* send arp request */ + request_arp(arp_key.port_id, arp_key.ip); + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + } else { + if (ret_arp_data && + ret_arp_data->mode == DYNAMIC_ARP && ret_arp_data->status == STALE) { + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + ether_addr_copy(&null_ether_addr, &ret_arp_data->eth_addr); + ret_arp_data->status = PROBE; + struct arp_timer_key * callback_key = + (struct arp_timer_key*) rte_malloc(NULL, + sizeof(struct arp_timer_key*),RTE_CACHE_LINE_SIZE); + callback_key->port_id = arp_key.port_id; + callback_key->ip = arp_key.ip; + if(ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"TIMER STARTED FOR %u" + " seconds\n",ARP_TIMER_EXPIRY); + if(rte_timer_reset(ret_arp_data->timer, + (arp_timeout * rte_get_tsc_hz()), + SINGLE,timer_lcore, + arp_timer_callback, + callback_key) < 0) + if(ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"Err : Timer already running\n"); + + ret_arp_data->timer_key = callback_key; + + /* send arp request */ + request_arp(arp_key.port_id, arp_key.ip); + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); } - return ret_arp_data; } - return NULL; + return ret_arp_data; } -struct nd_entry_data *retrieve_nd_entry(struct nd_key_ipv6 nd_key) +struct nd_entry_data *retrieve_nd_entry(struct nd_key_ipv6 nd_key, uint8_t mode) { struct nd_entry_data *ret_nd_data = NULL; nd_key.filler1 = 0; @@ -820,46 +932,123 @@ struct nd_entry_data *retrieve_nd_entry(struct nd_key_ipv6 nd_key) /*Find a nd IPv6 key-data pair in the hash table for ND IPv6 */ int ret = rte_hash_lookup_data(nd_hash_handle, &nd_key, (void **)&ret_nd_data); - if (ret < 0) { -/* RTE_LOG(INFO, LIBARP,"nd-hash: no lookup Entry Found - ret %d, EINVAL %d, ENOENT %d\n", - ret, EINVAL, ENOENT);*/ - } else { - if (ret_nd_data->mode == DYNAMIC_ND) { - struct nd_timer_key callback_key; - callback_key.port_id = ret_nd_data->port; + if (ret < 0 && (mode == DYNAMIC_ND)) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, "ND entry not found for ip \n"); + + /* add INCOMPLETE arp entry */ + ret_nd_data = rte_malloc_socket(NULL, sizeof(struct nd_entry_data), + RTE_CACHE_LINE_SIZE, rte_socket_id()); + ether_addr_copy(&null_ether_addr, &ret_nd_data->eth_addr); + ret_nd_data->status = INCOMPLETE; + ret_nd_data->port = nd_key.port_id; + + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) + ret_nd_data->ipv6[i] = nd_key.ipv6[i]; + ret_nd_data->mode = mode; + ret_nd_data->num_pkts = 0; + rte_rwlock_init(&ret_nd_data->queue_lock); + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + + /* attempt to add arp_entry to hash */ + ret = add_nd_data(&nd_key, ret_nd_data); + + if (ret == EEXIST) { + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + rte_free(ret_nd_data); + /* Some other thread has 'beat' this thread in + creation of arp_data, try again */ + return NULL; + } - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { - callback_key.ipv6[i] = ret_nd_data->ipv6[i]; + if (rte_mempool_get(timer_mempool_arp, + (void **) &(ret_nd_data->timer) ) < 0) { + RTE_LOG(INFO, LIBARP,"Error in getting timer alloc buf\n"); + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + return NULL; + } + + ret_nd_data->buf_pkts = (struct rte_mbuf **)rte_zmalloc_socket( + NULL, sizeof(struct rte_mbuf *) * nd_buffer, + RTE_CACHE_LINE_SIZE, rte_socket_id()); + + if (ret_nd_data->buf_pkts == NULL) { + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + RTE_LOG(INFO, LIBARP,"Could not allocate buf for queueing\n"); + return NULL; + } + + rte_timer_init(ret_nd_data->timer); + struct nd_timer_key * callback_key = + (struct nd_timer_key*) rte_malloc(NULL, + sizeof(struct nd_timer_key*),RTE_CACHE_LINE_SIZE); + callback_key->port_id = nd_key.port_id; + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { + callback_key->ipv6[i] = ret_nd_data->ipv6[i]; + } + + if(ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP,"TIMER STARTED FOR %u seconds\n", + ARP_TIMER_EXPIRY); + } + + if(rte_timer_reset(ret_nd_data->timer, + (PROBE_TIME * rte_get_tsc_hz() / 1000), + SINGLE,timer_lcore, + nd_timer_callback, + callback_key) < 0) + if(ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"Err : Timer already running\n"); + + ret_nd_data->timer_key = callback_key; + /* send nd request */ + request_nd(callback_key->ipv6, ifm_get_port(callback_key->port_id)); + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + } else { + if (ret_nd_data && + ret_nd_data->mode == DYNAMIC_ND && ret_nd_data->status == STALE) { + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + ether_addr_copy(&null_ether_addr, &ret_nd_data->eth_addr); + ret_nd_data->status = PROBE; + struct nd_timer_key * callback_key = + (struct nd_timer_key*) rte_malloc(NULL, + sizeof(struct nd_timer_key*),RTE_CACHE_LINE_SIZE); + + callback_key->port_id = nd_key.port_id; + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { + callback_key->ipv6[i] = ret_nd_data->ipv6[i]; } if (rte_timer_reset - (ret_nd_data->timer, - (arp_timeout * rte_get_tsc_hz()), SINGLE, - timer_lcore, nd_timer_callback, &callback_key) < 0) - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Err : Timer already running\n"); + (ret_nd_data->timer, + (arp_timeout * rte_get_tsc_hz()), SINGLE, + timer_lcore, nd_timer_callback, callback_key) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + ret_nd_data->timer_key = callback_key; + + /* send nd request */ + request_nd(callback_key->ipv6, ifm_get_port(callback_key->port_id)); + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); } - return ret_nd_data; } - - return NULL; + return ret_nd_data; } +static const char* arp_status[] = {"INCOMPLETE", "COMPLETE", "PROBE", "STALE"}; + void print_arp_table(void) { const void *next_key; void *next_data; uint32_t iter = 0; - printf - ("------------------------ ARP CACHE -----------------------------------------\n"); - printf - ("----------------------------------------------------------------------------\n"); + printf("------------------------ ARP CACHE ------------------------------------\n"); + printf("-----------------------------------------------------------------------\n"); printf("\tport hw addr status ip addr\n"); - printf - ("----------------------------------------------------------------------------\n"); + printf("-----------------------------------------------------------------------\n"); while (rte_hash_iterate(arp_hash_handle, &next_key, &next_data, &iter) >= 0) { @@ -868,16 +1057,15 @@ void print_arp_table(void) (struct arp_entry_data *)next_data; struct arp_key_ipv4 tmp_arp_key; memcpy(&tmp_arp_key, next_key, sizeof(struct arp_key_ipv4)); - printf - ("\t%4d %02X:%02X:%02X:%02X:%02X:%02X %10s %d.%d.%d.%d\n", + printf("\t%4d %02X:%02X:%02X:%02X:%02X:%02X" + " %10s %d.%d.%d.%d\n", tmp_arp_data->port, tmp_arp_data->eth_addr.addr_bytes[0], tmp_arp_data->eth_addr.addr_bytes[1], tmp_arp_data->eth_addr.addr_bytes[2], tmp_arp_data->eth_addr.addr_bytes[3], tmp_arp_data->eth_addr.addr_bytes[4], tmp_arp_data->eth_addr.addr_bytes[5], - tmp_arp_data->status == - COMPLETE ? "COMPLETE" : "INCOMPLETE", + arp_status[tmp_arp_data->status], (tmp_arp_data->ip >> 24), ((tmp_arp_data->ip & 0x00ff0000) >> 16), ((tmp_arp_data->ip & 0x0000ff00) >> 8), @@ -885,17 +1073,18 @@ void print_arp_table(void) } uint32_t i = 0; - printf("\nARP routing table has %d entries\n", arp_route_tbl_index); + printf("\nARP routing table has %d entries\n", p_arp_data->lib_arp_route_ent_cnt); printf("\nIP_Address Mask Port NH_IP_Address\n"); - for (i = 0; i < arp_route_tbl_index; i++) { + for (i = 0; i < p_arp_data->lib_arp_route_ent_cnt; i++) { printf("0x%x 0x%x %d 0x%x\n", - lib_arp_route_table[i].ip, - lib_arp_route_table[i].mask, - lib_arp_route_table[i].port, lib_arp_route_table[i].nh); + p_arp_data->lib_arp_route_table[i].ip, + p_arp_data->lib_arp_route_table[i].mask, + p_arp_data->lib_arp_route_table[i].port, + p_arp_data->lib_arp_route_table[i].nh); } - printf - ("\nARP Stats: Total Queries %u, ok_NH %u, no_NH %u, ok_Entry %u, no_Entry %u, PopulateCall %u, Del %u, Dup %u\n", + printf("\nARP Stats: Total Queries %u, ok_NH %u, no_NH %u, ok_Entry %u," + " no_Entry %u, PopulateCall %u, Del %u, Dup %u\n", lib_arp_get_mac_req, lib_arp_nh_found, lib_arp_no_nh_found, lib_arp_arp_entry_found, lib_arp_no_arp_entry_found, lib_arp_populate_called, lib_arp_delete_called, @@ -911,12 +1100,10 @@ void print_nd_table(void) void *next_data; uint32_t iter = 0; uint8_t ii = 0, j = 0, k = 0; - printf - ("------------------------------------------------------------------------------------------------------\n"); + printf("-----------------------------------------------------------------------\n"); printf("\tport hw addr status ip addr\n"); - printf - ("------------------------------------------------------------------------------------------------------\n"); + printf("-----------------------------------------------------------------------\n"); while (rte_hash_iterate(nd_hash_handle, &next_key, &next_data, &iter) >= 0) { @@ -932,8 +1119,7 @@ void print_nd_table(void) tmp_nd_data->eth_addr.addr_bytes[3], tmp_nd_data->eth_addr.addr_bytes[4], tmp_nd_data->eth_addr.addr_bytes[5], - tmp_nd_data->status == - COMPLETE ? "COMPLETE" : "INCOMPLETE"); + arp_status[tmp_nd_data->status]); printf("\t\t\t\t\t\t"); for (ii = 0; ii < ND_IPV6_ADDR_SIZE; ii += 2) { printf("%02X%02X ", tmp_nd_data->ipv6[ii], @@ -945,8 +1131,8 @@ void print_nd_table(void) uint32_t i = 0; printf("\n\nND IPV6 routing table has %d entries\n", nd_route_tbl_index); - printf - ("\nIP_Address Depth Port NH_IP_Address\n"); + printf("\nIP_Address Depth"); + printf(" Port NH_IP_Address\n"); for (i = 0; i < nd_route_tbl_index; i++) { printf("\n"); @@ -965,8 +1151,8 @@ void print_nd_table(void) lib_nd_route_table[i].ipv6[k + 1]); } } - printf - ("\nND IPV6 Stats: \nTotal Queries %u, ok_NH %u, no_NH %u, ok_Entry %u, no_Entry %u, PopulateCall %u, Del %u, Dup %u\n", + printf("\nND IPV6 Stats: \nTotal Queries %u, ok_NH %u," + " no_NH %u, ok_Entry %u, no_Entry %u, PopulateCall %u, Del %u, Dup %u\n", lib_nd_get_mac_req, lib_nd_nh_found, lib_nd_no_nh_found, lib_nd_nd_entry_found, lib_nd_no_arp_entry_found, lib_nd_populate_called, lib_nd_delete_called, @@ -974,127 +1160,140 @@ void print_nd_table(void) printf("ND table key len is %lu\n\n", sizeof(struct nd_key_ipv6)); } -void remove_arp_entry(uint32_t ipaddr, uint8_t portid, void *arg) +void remove_arp_entry(struct arp_entry_data *ret_arp_data, void *arg) { - struct arp_key_ipv4 arp_key; - arp_key.port_id = portid; - arp_key.ip = ipaddr; - arp_key.filler1 = 0; - arp_key.filler2 = 0; - arp_key.filler3 = 0; - + struct arp_timer_key *arp_key = (struct arp_timer_key *)arg; lib_arp_delete_called++; - struct arp_entry_data *ret_arp_data = NULL; - - int ret = rte_hash_lookup_data(arp_hash_handle, &arp_key, - (void **)&ret_arp_data); - if (ret < 0) { -// RTE_LOG(INFO, LIBARP,"arp-hash lookup failed ret %d, EINVAL %d, ENOENT %d\n", ret, EINVAL, ENOENT); - return; - } else { - if (ret_arp_data->mode == DYNAMIC_ARP) { - if (ret_arp_data->retry_count == 3) { - rte_timer_stop(ret_arp_data->timer); - rte_free(ret_arp_data->timer_key); - if (ARPICMP_DEBUG) { - RTE_LOG(INFO, LIBARP, - "ARP Entry Deleted for IP :%d.%d.%d.%d , port %d\n", - (arp_key.ip >> 24), - ((arp_key.ip & 0x00ff0000) >> - 16), - ((arp_key.ip & 0x0000ff00) >> - 8), - ((arp_key.ip & 0x000000ff)), - arp_key.port_id); - } - rte_hash_del_key(arp_hash_handle, &arp_key); - //print_arp_table(); - } else { - ret_arp_data->retry_count++; - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "RETRY ARP..retry count : %u\n", - ret_arp_data->retry_count); - //print_arp_table(); - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "TIMER STARTED FOR %u seconds\n", - ARP_TIMER_EXPIRY); - if (ifm_chk_port_ipv4_enabled - (ret_arp_data->port)) { - request_arp(ret_arp_data->port, - ret_arp_data->ip); - } else { - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "%s: IP is not enabled on port %u, not sending GARP\n\r", - __FUNCTION__, - ret_arp_data->port); - } - if (rte_timer_reset(ret_arp_data->timer, - (arp_timeout * - rte_get_tsc_hz()), SINGLE, - timer_lcore, - arp_timer_callback, - arg) < 0) - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Err : Timer already running\n"); - - } - } else { - rte_hash_del_key(arp_hash_handle, &arp_key); - } - } + rte_timer_stop(ret_arp_data->timer); + rte_free(ret_arp_data->timer_key); + rte_free(ret_arp_data->buf_pkts); + ret_arp_data->buf_pkts = NULL; + if (ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP, + "ARP Entry Deleted for IP :%d.%d.%d.%d , port %d\n", + (arp_key->ip >> 24), + ((arp_key->ip & 0x00ff0000) >> 16), + ((arp_key->ip & 0x0000ff00) >> 8), + ((arp_key->ip & 0x000000ff)), + arp_key->port_id); + } + rte_hash_del_key(arp_hash_handle, arp_key); + print_arp_table(); } /* ND IPv6 */ -void remove_nd_entry_ipv6(uint8_t ipv6addr[], uint8_t portid) +void remove_nd_entry_ipv6(struct nd_entry_data *ret_nd_data, void *arg) { int i = 0; - struct nd_entry_data *ret_nd_data = NULL; - struct nd_key_ipv6 nd_key; - nd_key.port_id = portid; + struct nd_timer_key *timer_key = (struct nd_timer_key *)arg; - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { - nd_key.ipv6[i] = ipv6addr[i]; + lib_nd_delete_called++; + + rte_timer_stop(ret_nd_data->timer); + rte_free(ret_nd_data->timer_key); + rte_free(ret_nd_data->buf_pkts); + ret_nd_data->buf_pkts = NULL; + + if (NDIPV6_DEBUG) { + RTE_LOG(INFO, LIBARP, + "Deletes rte hash table nd entry for port %d ipv6=", + timer_key->port_id); + for (i = 0; i < ND_IPV6_ADDR_SIZE; i += 2) { + RTE_LOG(INFO, LIBARP, "%02X%02X ", timer_key->ipv6[i], + timer_key->ipv6[i + 1]); + } + } + rte_hash_del_key(nd_hash_handle, timer_key); +} + +int +arp_queue_unresolved_packet(struct arp_entry_data *ret_arp_data, struct rte_mbuf *pkt) +{ + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + if (ret_arp_data->num_pkts == NUM_DESC) { + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + return 0; } - nd_key.filler1 = 0; - nd_key.filler2 = 0; - nd_key.filler3 = 0; + ret_arp_data->buf_pkts[ret_arp_data->num_pkts++] = pkt; + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + return 0; +} - lib_nd_delete_called++; +void +arp_send_buffered_pkts(struct arp_entry_data *ret_arp_data, + struct ether_addr *hw_addr, uint8_t port_id) +{ + l2_phy_interface_t *port = ifm_get_port(port_id); + struct rte_mbuf *pkt, *tmp; + uint8_t *eth_dest, *eth_src; + int i; - if (NDIPV6_DEBUG) { - RTE_LOG(INFO, LIBARP, - "Deletes rte hash table nd entry for port %d ipv6=", - nd_key.port_id); - for (i = 0; i < ND_IPV6_ADDR_SIZE; i += 2) { - RTE_LOG(INFO, LIBARP, "%02X%02X ", nd_key.ipv6[i], - nd_key.ipv6[i + 1]); - } - } - struct nd_timer_key callback_key; - callback_key.port_id = portid; - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { - callback_key.ipv6[i] = ipv6addr[i]; + if (!hw_addr || !ret_arp_data) + return; + + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + for (i=0;i<(int)ret_arp_data->num_pkts;i++) { + pkt = ret_arp_data->buf_pkts[i]; + eth_dest = RTE_MBUF_METADATA_UINT8_PTR(pkt, MBUF_HDR_ROOM); + eth_src = RTE_MBUF_METADATA_UINT8_PTR(pkt, MBUF_HDR_ROOM + 6); + + memcpy(eth_dest, hw_addr, sizeof(struct ether_addr)); + memcpy(eth_src, get_link_hw_addr(port_id), + sizeof(struct ether_addr)); + port->transmit_single_pkt(port, pkt); + tmp = pkt; + rte_pktmbuf_free(tmp); } - int ret = rte_hash_lookup_data(arp_hash_handle, &callback_key, - (void **)&ret_nd_data); - if (ret < 0) { -// RTE_LOG(INFO, LIBARP,"arp-hash lookup failed ret %d, EINVAL %d, ENOENT %d\n", ret, EINVAL, ENOENT); - } else { - if (ret_nd_data->mode == DYNAMIC_ND) { - rte_timer_stop(ret_nd_data->timer); - rte_free(ret_nd_data->timer); - } + ret_arp_data->num_pkts = 0; + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); +} + +int +nd_queue_unresolved_packet(struct nd_entry_data *ret_nd_data, struct rte_mbuf *pkt) +{ + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + if (ret_nd_data->num_pkts == get_nd_buf()) { + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + return 0; } - rte_hash_del_key(nd_hash_handle, &nd_key); + + ret_nd_data->buf_pkts[ret_nd_data->num_pkts++] = pkt; + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + return 0; +} + +void +nd_send_buffered_pkts(struct nd_entry_data *ret_nd_data, + struct ether_addr *hw_addr, uint8_t port_id) +{ + l2_phy_interface_t *port = ifm_get_port(port_id); + struct rte_mbuf *pkt, *tmp; + uint8_t *eth_dest, *eth_src; + int i; + + if (!hw_addr || !ret_nd_data) + return; + + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + for (i=0;i<(int)ret_nd_data->num_pkts;i++) { + pkt = ret_nd_data->buf_pkts[i]; + eth_dest = RTE_MBUF_METADATA_UINT8_PTR(pkt, MBUF_HDR_ROOM); + eth_src = RTE_MBUF_METADATA_UINT8_PTR(pkt, MBUF_HDR_ROOM + 6); + + memcpy(eth_dest, hw_addr, sizeof(struct ether_addr)); + memcpy(eth_src, get_link_hw_addr(port_id), + sizeof(struct ether_addr)); + port->transmit_single_pkt(port, pkt); + tmp = pkt; + rte_pktmbuf_free(tmp); + } + ret_nd_data->num_pkts = 0; + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); } void @@ -1102,6 +1301,7 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, uint8_t portid, uint8_t mode) { struct arp_key_ipv4 arp_key; + struct arp_entry_data *new_arp_data; arp_key.port_id = portid; arp_key.ip = ipaddr; arp_key.filler1 = 0; @@ -1109,25 +1309,28 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, arp_key.filler3 = 0; lib_arp_populate_called++; + printf("populate_arp_entry ip %x, port %d\n", arp_key.ip, arp_key.port_id); if (ARPICMP_DEBUG) RTE_LOG(INFO, LIBARP, "populate_arp_entry ip %x, port %d\n", arp_key.ip, arp_key.port_id); - struct arp_entry_data *new_arp_data = retrieve_arp_entry(arp_key); + new_arp_data = retrieve_arp_entry(arp_key, mode); if (new_arp_data && ((new_arp_data->mode == STATIC_ARP - && mode == DYNAMIC_ARP) || (new_arp_data->mode == DYNAMIC_ARP - && mode == STATIC_ARP))) { - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP,"populate_arp_entry: ARP entry already exists(%d %d)\n", - new_arp_data->mode, mode); - - return; - } + && mode == DYNAMIC_ARP) || (new_arp_data->mode == DYNAMIC_ARP + && mode == STATIC_ARP))) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP,"populate_arp_entry: ARP entry " + "already exists(%d %d)\n", new_arp_data->mode, mode); + return; + } if (mode == DYNAMIC_ARP) { + if (new_arp_data && is_same_ether_addr(&new_arp_data->eth_addr, hw_addr)) { + printf("entry exists\n"); + if (ARPICMP_DEBUG) { RTE_LOG(INFO, LIBARP, "arp_entry exists ip :%d.%d.%d.%d , port %d\n", @@ -1138,68 +1341,60 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, arp_key.port_id); } lib_arp_duplicate_found++; + rte_rwlock_write_lock(&new_arp_data->queue_lock); new_arp_data->retry_count = 0; // Reset + if (new_arp_data->status == STALE) { + new_arp_data->status = PROBE; + if (ifm_chk_port_ipv4_enabled + (new_arp_data->port)) { + request_arp(new_arp_data->port, + new_arp_data->ip); + } else { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "%s: IP is not enabled on port %u, not sending GARP\n\r", + __FUNCTION__, + new_arp_data->port); + } + } + if (rte_timer_reset(new_arp_data->timer, - (arp_timeout * rte_get_tsc_hz()), - SINGLE, timer_lcore, - arp_timer_callback, - new_arp_data->timer_key) < 0) + (arp_timeout * rte_get_tsc_hz()), + SINGLE, timer_lcore, + arp_timer_callback, + new_arp_data->timer_key) < 0) { if (ARPICMP_DEBUG) RTE_LOG(INFO, LIBARP, "Err : Timer already running\n"); + } + rte_rwlock_write_unlock(&new_arp_data->queue_lock); return; - } - - uint32_t size = - RTE_CACHE_LINE_ROUNDUP(sizeof(struct arp_entry_data)); - new_arp_data = rte_zmalloc(NULL, size, RTE_CACHE_LINE_SIZE); - new_arp_data->eth_addr = *hw_addr; - new_arp_data->status = COMPLETE; - new_arp_data->port = portid; - new_arp_data->ip = ipaddr; - new_arp_data->mode = mode; - if (rte_mempool_get - (timer_mempool_arp, (void **)&(new_arp_data->timer)) < 0) { - RTE_LOG(INFO, LIBARP, - "TIMER - Error in getting timer alloc buffer\n"); + } else { + rte_rwlock_write_lock(&new_arp_data->queue_lock); + ether_addr_copy(hw_addr, &new_arp_data->eth_addr); + if ((new_arp_data->status == INCOMPLETE) || + (new_arp_data->status == PROBE)) { + new_arp_data->status = COMPLETE; + new_arp_data->mode = mode; + new_arp_data->n_confirmed = rte_rdtsc(); + new_arp_data->retry_count = 0; + if (rte_timer_reset(new_arp_data->timer, + (arp_timeout * rte_get_tsc_hz()), + SINGLE, timer_lcore, + arp_timer_callback, + new_arp_data->timer_key) < 0) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } + } + rte_rwlock_write_unlock(&new_arp_data->queue_lock); return; } - - rte_hash_add_key_data(arp_hash_handle, &arp_key, new_arp_data); - if (ARPICMP_DEBUG) { - RTE_LOG(INFO, LIBARP, - "arp_entry exists ip :%d.%d.%d.%d , port %d\n", - (arp_key.ip >> 24), - ((arp_key.ip & 0x00ff0000) >> 16), - ((arp_key.ip & 0x0000ff00) >> 8), - ((arp_key.ip & 0x000000ff)), arp_key.port_id); - } - // Call l3fwd module for resolving 2_adj structure. - resolve_l2_adj(ipaddr, portid, hw_addr); - - rte_timer_init(new_arp_data->timer); - struct arp_timer_key *callback_key = - (struct arp_timer_key *)rte_malloc(NULL, - sizeof(struct - arp_timer_key *), - RTE_CACHE_LINE_SIZE); - callback_key->port_id = portid; - callback_key->ip = ipaddr; - - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, "TIMER STARTED FOR %u seconds\n", - ARP_TIMER_EXPIRY); - if (rte_timer_reset - (new_arp_data->timer, (arp_timeout * rte_get_tsc_hz()), - SINGLE, timer_lcore, arp_timer_callback, callback_key) < 0) - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Err : Timer already running\n"); - - new_arp_data->timer_key = callback_key; } else { if (new_arp_data - && is_same_ether_addr(&new_arp_data->eth_addr, hw_addr)) { + && is_same_ether_addr(&new_arp_data->eth_addr, hw_addr)) { + if (ARPICMP_DEBUG) { RTE_LOG(INFO, LIBARP, "arp_entry exists ip :%d.%d.%d.%d , port %d\n", @@ -1221,9 +1416,16 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, new_arp_data->port = portid; new_arp_data->ip = ipaddr; new_arp_data->mode = mode; + new_arp_data->num_pkts = 0; + + /* attempt to add arp_entry to hash */ + int ret; + ret = add_arp_data(&arp_key, new_arp_data); + if (ret) { + /* Some other thread created an entry for this ip */ + rte_free(new_arp_data); + } - rte_hash_add_key_data(arp_hash_handle, &arp_key, - new_arp_data); if (ARPICMP_DEBUG) { RTE_LOG(INFO, LIBARP, "arp_entry exists ip :%d.%d.%d.%d , port %d\n", @@ -1233,10 +1435,13 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, ((arp_key.ip & 0x000000ff)), arp_key.port_id); } + #ifdef L3_STACK_SUPPORT // Call l3fwd module for resolving 2_adj structure. resolve_l2_adj(ipaddr, portid, hw_addr); + #endif } } + if (ARPICMP_DEBUG) { /* print entire hash table */ RTE_LOG(INFO, LIBARP, @@ -1260,21 +1465,24 @@ populate_arp_entry(const struct ether_addr *hw_addr, uint32_t ipaddr, * Install key - data pair in Hash table - From Pipeline Configuration * */ - void populate_nd_entry(const struct ether_addr *hw_addr, uint8_t ipv6[], uint8_t portid, uint8_t mode) { /* need to lock here if multi-threaded */ /* rte_hash_add_key_data is not thread safe */ - uint8_t i; + uint8_t i, val = 0; struct nd_key_ipv6 nd_key; nd_key.port_id = portid; - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { nd_key.ipv6[i] = ipv6[i]; + val |= ipv6[i]; + } + + if (!val) + return; -// RTE_LOG(INFO, LIBARP,"\n"); nd_key.filler1 = 0; nd_key.filler2 = 0; nd_key.filler3 = 0; @@ -1282,11 +1490,18 @@ void populate_nd_entry(const struct ether_addr *hw_addr, uint8_t ipv6[], lib_nd_populate_called++; /* Validate if key-value pair already exists in the hash table for ND IPv6 */ - struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key); + struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key, mode); + if (new_nd_data && ((new_nd_data->mode == STATIC_ND + && mode == DYNAMIC_ND) || (new_nd_data->mode == DYNAMIC_ND + && mode == STATIC_ND))) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, "populate_arp_entry: ND entry already" + " exists(%d %d)\n", new_nd_data->mode, mode); + return; + } if (mode == DYNAMIC_ND) { - if (new_nd_data - && is_same_ether_addr(&new_nd_data->eth_addr, hw_addr)) { + if (new_nd_data && is_same_ether_addr(&new_nd_data->eth_addr, hw_addr)) { if (NDIPV6_DEBUG) { RTE_LOG(INFO, LIBARP, @@ -1301,61 +1516,48 @@ void populate_nd_entry(const struct ether_addr *hw_addr, uint8_t ipv6[], } lib_nd_duplicate_found++; - RTE_LOG(INFO, LIBARP, "nd_entry exists\n"); - return; - } - uint32_t size = - RTE_CACHE_LINE_ROUNDUP(sizeof(struct nd_entry_data)); - new_nd_data = rte_zmalloc(NULL, size, RTE_CACHE_LINE_SIZE); - - //new_nd_data = (struct nd_entry_data *)rte_malloc(NULL, sizeof(struct nd_entry_data *),RTE_CACHE_LINE_SIZE); - new_nd_data->eth_addr = *hw_addr; - new_nd_data->status = COMPLETE; - new_nd_data->port = portid; - new_nd_data->mode = mode; - if (rte_mempool_get - (timer_mempool_arp, (void **)&(new_nd_data->timer)) < 0) { - RTE_LOG(INFO, LIBARP, - "TIMER - Error in getting timer alloc buffer\n"); + rte_rwlock_write_lock(&new_nd_data->queue_lock); + if (new_nd_data->status == STALE) { + new_nd_data->retry_count = 0; // Reset + new_nd_data->status = PROBE; + request_nd(new_nd_data->ipv6, + ifm_get_port(new_nd_data->port)); + + if (rte_timer_reset(new_nd_data->timer, + (arp_timeout * rte_get_tsc_hz()), + SINGLE, timer_lcore, + nd_timer_callback, + new_nd_data->timer_key) < 0) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } + } + rte_rwlock_write_unlock(&new_nd_data->queue_lock); return; - } - - if (NDIPV6_DEBUG) - RTE_LOG(INFO, LIBARP, "populate_nd_entry ipv6="); - - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { - new_nd_data->ipv6[i] = ipv6[i]; - } - - if (NDIPV6_DEBUG) { - for (i = 0; i < ND_IPV6_ADDR_SIZE; i += 2) { - - RTE_LOG(INFO, LIBARP, "%02X%02X ", - new_nd_data->ipv6[i], - new_nd_data->ipv6[i + 1]); + } else { + rte_rwlock_write_lock(&new_nd_data->queue_lock); + ether_addr_copy(hw_addr, &new_nd_data->eth_addr); + if ((new_nd_data->status == INCOMPLETE) || + (new_nd_data->status == PROBE)) { + new_nd_data->status = COMPLETE; + new_nd_data->mode = mode; + new_nd_data->n_confirmed = rte_rdtsc(); + new_nd_data->retry_count = 0; + if (rte_timer_reset(new_nd_data->timer, + (arp_timeout * rte_get_tsc_hz()), + SINGLE, timer_lcore, + nd_timer_callback, + new_nd_data->timer_key) < 0) { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } } - } - - /*Add a key-data pair at hash table for ND IPv6 static routing */ - rte_hash_add_key_data(nd_hash_handle, &nd_key, new_nd_data); - /* need to check the return value of the hash add */ + rte_rwlock_write_unlock(&new_nd_data->queue_lock); + return; + } - /* after the hash is created then time is started */ - rte_timer_init(new_nd_data->timer); - struct nd_timer_key *callback_key = - (struct nd_timer_key *)rte_malloc(NULL, - sizeof(struct nd_timer_key - *), - RTE_CACHE_LINE_SIZE); - callback_key->port_id = portid; - - for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { - callback_key->ipv6[i] = ipv6[i]; - } - if (rte_timer_reset - (new_nd_data->timer, (arp_timeout * rte_get_tsc_hz()), - SINGLE, timer_lcore, nd_timer_callback, callback_key) < 0) - RTE_LOG(INFO, LIBARP, "Err : Timer already running\n"); } else { if (new_nd_data && is_same_ether_addr(&new_nd_data->eth_addr, hw_addr)) { @@ -1379,7 +1581,6 @@ void populate_nd_entry(const struct ether_addr *hw_addr, uint8_t ipv6[], new_nd_data = rte_zmalloc(NULL, size, RTE_CACHE_LINE_SIZE); - //new_nd_data = (struct nd_entry_data *)rte_malloc(NULL, sizeof(struct nd_entry_data *),RTE_CACHE_LINE_SIZE); new_nd_data->eth_addr = *hw_addr; new_nd_data->status = COMPLETE; new_nd_data->port = portid; @@ -1387,13 +1588,25 @@ void populate_nd_entry(const struct ether_addr *hw_addr, uint8_t ipv6[], for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) { new_nd_data->ipv6[i] = ipv6[i]; } + new_nd_data->mode = mode; + new_nd_data->num_pkts = 0; /*Add a key-data pair at hash table for ND IPv6 static routing */ - rte_hash_add_key_data(nd_hash_handle, &nd_key, - new_nd_data); + /* attempt to add arp_entry to hash */ + int ret; + ret = add_nd_data(&nd_key, new_nd_data); + if (ret) { + rte_free(new_nd_data); + } + /* need to check the return value of the hash add */ + #ifdef L3_STACK_SUPPORT + // Call l3fwd module for resolving 2_adj structure. + resolve_l2_adj(ipaddr, portid, hw_addr); + #endif } } + if (NDIPV6_DEBUG) printf ("\n....Added a key-data pair at rte hash table for ND IPv6 static routing\n"); @@ -1428,29 +1641,11 @@ void print_pkt1(struct rte_mbuf *pkt) RTE_LOG(INFO, LIBARP, "\nPacket Contents...\n"); for (i = 0; i < 20; i++) { for (j = 0; j < 20; j++) - RTE_LOG(INFO, LIBARP, "%02x ", rd[(20 * i) + j]); + printf("%02x ", rd[(20 * i) + j]); RTE_LOG(INFO, LIBARP, "\n"); } } -struct ether_addr broadcast_ether_addr = { - .addr_bytes[0] = 0xFF, - .addr_bytes[1] = 0xFF, - .addr_bytes[2] = 0xFF, - .addr_bytes[3] = 0xFF, - .addr_bytes[4] = 0xFF, - .addr_bytes[5] = 0xFF, -}; - -static const struct ether_addr null_ether_addr = { - .addr_bytes[0] = 0x00, - .addr_bytes[1] = 0x00, - .addr_bytes[2] = 0x00, - .addr_bytes[3] = 0x00, - .addr_bytes[4] = 0x00, - .addr_bytes[5] = 0x00, -}; - #define MAX_NUM_MAC_ADDRESS 16 struct ether_addr link_hw_addr[MAX_NUM_MAC_ADDRESS] = { {.addr_bytes = {0x90, 0xe2, 0xba, 0x54, 0x67, 0xc8} }, @@ -1473,7 +1668,7 @@ struct ether_addr link_hw_addr[MAX_NUM_MAC_ADDRESS] = { struct ether_addr *get_link_hw_addr(uint8_t out_port) { - return &link_hw_addr[out_port]; + return &p_arp_data->link_hw_addr[out_port]; } void request_arp(uint8_t port_id, uint32_t ip) @@ -1484,7 +1679,7 @@ void request_arp(uint8_t port_id, uint32_t ip) l2_phy_interface_t *link; link = ifm_get_port(port_id); - struct rte_mbuf *arp_pkt = lib_arp_pkt; + struct rte_mbuf *arp_pkt = lib_arp_pkt[port_id]; if (arp_pkt == NULL) { if (ARPICMP_DEBUG) @@ -1492,7 +1687,6 @@ void request_arp(uint8_t port_id, uint32_t ip) "Error allocating arp_pkt rte_mbuf\n"); return; } - eth_h = rte_pktmbuf_mtod(arp_pkt, struct ether_hdr *); ether_addr_copy(&broadcast_ether_addr, ð_h->d_addr); @@ -1507,12 +1701,12 @@ void request_arp(uint8_t port_id, uint32_t ip) arp_h->arp_pln = sizeof(uint32_t); arp_h->arp_op = CHECK_ENDIAN_16(ARP_OP_REQUEST); - ether_addr_copy((struct ether_addr *) - &link->macaddr[0], &arp_h->arp_data.arp_sha); if (link && link->ipv4_list) { arp_h->arp_data.arp_sip = (((ipv4list_t *) (link->ipv4_list))->ipaddr); } + ether_addr_copy((struct ether_addr *) + &link->macaddr[0], &arp_h->arp_data.arp_sha); ether_addr_copy(&null_ether_addr, &arp_h->arp_data.arp_tha); arp_h->arp_data.arp_tip = rte_cpu_to_be_32(ip); if (ARPICMP_DEBUG) @@ -1528,6 +1722,8 @@ void request_arp(uint8_t port_id, uint32_t ip) } if (link) link->transmit_single_pkt(link, arp_pkt); +// start_tsc[port_id] = rte_rdtsc(); + printf("Sent ARP Request %x \n", arp_h->arp_data.arp_tip); } struct rte_mbuf *request_echo(uint32_t port_id, uint32_t ip) @@ -1537,7 +1733,7 @@ struct rte_mbuf *request_echo(uint32_t port_id, uint32_t ip) struct icmp_hdr *icmp_h; l2_phy_interface_t *port = ifm_get_port(port_id); - struct rte_mbuf *icmp_pkt = lib_arp_pkt; + struct rte_mbuf *icmp_pkt = lib_arp_pkt[port_id]; if (icmp_pkt == NULL) { if (ARPICMP_DEBUG) RTE_LOG(INFO, LIBARP, @@ -1583,57 +1779,6 @@ struct rte_mbuf *request_echo(uint32_t port_id, uint32_t ip) return icmp_pkt; } -#if 0 -/** - * Function to send ICMP dest unreachable msg - * - */ -struct rte_mbuf *send_icmp_dest_unreachable_msg(uint32_t src_ip, - uint32_t dest_ip) -{ - struct ether_hdr *eth_h; - struct ipv4_hdr *ip_h; - struct icmp_hdr *icmp_h; - struct rte_mbuf *icmp_pkt = lib_arp_pkt; - - if (icmp_pkt == NULL) { - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Error allocating icmp_pkt rte_mbuf\n"); - return NULL; - } - - eth_h = rte_pktmbuf_mtod(icmp_pkt, struct ether_hdr *); - ip_h = (struct ipv4_hdr *)((char *)eth_h + sizeof(struct ether_hdr)); - icmp_h = (struct icmp_hdr *)((char *)ip_h + sizeof(struct ipv4_hdr)); - - ip_h->version_ihl = IP_VHL_DEF; - ip_h->type_of_service = 0; - ip_h->total_length = - rte_cpu_to_be_16(sizeof(struct ipv4_hdr) + sizeof(struct icmp_hdr)); - ip_h->packet_id = 0xaabb; - ip_h->fragment_offset = 0x0000; - ip_h->time_to_live = 64; - ip_h->next_proto_id = 1; - - ip_h->dst_addr = rte_bswap32(dest_ip); - ip_h->src_addr = rte_bswap32(src_ip); - - ip_h->hdr_checksum = 0; - ip_h->hdr_checksum = rte_ipv4_cksum(ip_h); - - icmp_h->icmp_type = 3; /* Destination Unreachable */ - icmp_h->icmp_code = 13; /* Communication administratively prohibited */ - - icmp_h->icmp_cksum = ~rte_raw_cksum(icmp_h, sizeof(struct icmp_hdr)); - - icmp_pkt->pkt_len = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + - sizeof(struct icmp_hdr); - icmp_pkt->data_len = icmp_pkt->pkt_len; - - return icmp_pkt; -} -#endif void process_arpicmp_pkt_parse(struct rte_mbuf **pkt, uint16_t pkt_num, uint64_t pkt_mask, l2_phy_interface_t *port) @@ -1671,7 +1816,6 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) uint32_t ip_addr; uint32_t req_tip; - eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); if (eth_h->ether_type == rte_cpu_to_be_16(ETHER_TYPE_ARP)) { @@ -1703,6 +1847,7 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) if (arp_h->arp_data.arp_tip != ((ipv4list_t *) (port->ipv4_list))->ipaddr) { if (arp_h->arp_data.arp_tip == arp_h->arp_data.arp_sip) { + printf("gratuitous arp received\n"); populate_arp_entry( (struct ether_addr *)&arp_h->arp_data.arp_sha, rte_cpu_to_be_32(arp_h->arp_data.arp_sip), @@ -1731,7 +1876,6 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) print_mbuf("RX", in_port_id, pkt, __LINE__); } - populate_arp_entry((struct ether_addr *) &arp_h->arp_data.arp_sha, rte_cpu_to_be_32 @@ -1750,7 +1894,6 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) arp_h->arp_data.arp_sip = req_tip; ether_addr_copy(ð_h->d_addr, &arp_h->arp_data.arp_tha); - if (ARPICMP_DEBUG) print_mbuf("TX ARP REPLY PKT", port->pmdid, pkt, __LINE__); @@ -1758,7 +1901,7 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) if (ARPICMP_DEBUG) print_mbuf("TX", port->pmdid, pkt, __LINE__); - + printf("replying arp pkt done\n"); return; } else if (arp_h->arp_op == rte_cpu_to_be_16(ARP_OP_REPLY)) { @@ -1901,7 +2044,8 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) arp_key.filler3 = 0; struct arp_entry_data *arp_entry = - retrieve_arp_entry(arp_key); + retrieve_arp_entry(arp_key, + DYNAMIC_ARP); if (arp_entry == NULL) { if (ARPICMP_DEBUG) RTE_LOG(INFO, LIBARP, @@ -2108,7 +2252,6 @@ static int arp_parse_args(struct pipeline_params *params) { uint32_t arp_route_tbl_present = 0; uint32_t nd_route_tbl_present = 0; - uint32_t ports_mac_list_present = 0; uint32_t numArg; uint32_t n_vnf_threads_present = 0; @@ -2123,7 +2266,6 @@ static int arp_parse_args(struct pipeline_params *params) pub_to_prv_map[i] = 0xff; } - RTE_SET_USED(ports_mac_list_present); RTE_SET_USED(nd_route_tbl_present); RTE_SET_USED(arp_route_tbl_present); for (numArg = 0; numArg < params->n_args; numArg++) { @@ -2175,6 +2317,16 @@ static int arp_parse_args(struct pipeline_params *params) continue; } + if (strcmp(arg_name, "arp_buf") == 0) { + arp_buffer = atoi(arg_value); + continue; + } + + if (strcmp(arg_name, "nd_buf") == 0) { + nd_buffer = atoi(arg_value); + continue; + } + /* prv_to_pub_map */ if (strcmp(arg_name, "prv_to_pub_map") == 0) { if (prv_to_pub_map_present) { @@ -2256,52 +2408,6 @@ static int arp_parse_args(struct pipeline_params *params) continue; } - /* ports_mac_list */ - if (strcmp(arg_name, "ports_mac_list") == 0) { - ports_mac_list_present = 1; - - uint32_t i = 0, j = 0, k = 0, MAC_NUM_BYTES = 6; - - char byteStr[MAC_NUM_BYTES][3]; - uint32_t byte[MAC_NUM_BYTES]; - - char *token = strtok(arg_value, " "); - while (token) { - k = 0; - for (i = 0; i < MAC_NUM_BYTES; i++) { - for (j = 0; j < 2; j++) { - byteStr[i][j] = token[k++]; - } - byteStr[i][j] = '\0'; - k++; - } - - for (i = 0; i < MAC_NUM_BYTES; i++) { - byte[i] = strtoul(byteStr[i], NULL, 16); - } - - if (ARPICMP_DEBUG) { - RTE_LOG(INFO, LIBARP, "token: %s", - token); - for (i = 0; i < MAC_NUM_BYTES; i++) - RTE_LOG(INFO, LIBARP, - ", byte[%u] %u", i, - byte[i]); - RTE_LOG(INFO, LIBARP, "\n"); - } - //Populate the static arp_route_table - for (i = 0; i < MAC_NUM_BYTES; i++) - link_hw_addr - [link_hw_addr_array_idx].addr_bytes - [i] = byte[i]; - - link_hw_addr_array_idx++; - token = strtok(NULL, " "); - } - - continue; - } - /* arp_route_tbl */ if (strcmp(arg_name, "arp_route_tbl") == 0) { arp_route_tbl_present = 1; @@ -2373,15 +2479,15 @@ static int arp_parse_args(struct pipeline_params *params) } */ //Populate the static arp_route_table - lib_arp_route_table[arp_route_tbl_index].ip = - dest_ip; - lib_arp_route_table[arp_route_tbl_index].mask = - mask; - lib_arp_route_table[arp_route_tbl_index].port = - tx_port; - lib_arp_route_table[arp_route_tbl_index].nh = - nh_ip; - arp_route_tbl_index++; + struct lib_arp_route_table_entry *lentry = + &p_arp_data->lib_arp_route_table + [p_arp_data->lib_arp_route_ent_cnt]; + lentry->ip = dest_ip; + lentry->mask = mask; + lentry->port = tx_port; + lentry->nh = nh_ip; + lentry->nh_mask = nh_ip & mask; + p_arp_data->lib_arp_route_ent_cnt++; token = strtok(NULL, "("); } @@ -2481,18 +2587,89 @@ static int arp_parse_args(struct pipeline_params *params) return 0; } +static void local_arp_cache_init(void) +{ + int i, j, k; + for (i=0; i<MAX_PORTS;i++) { + for (j=0; j<MAX_LOCAL_MAC_ADDRESS;j++) { + p_arp_data->arp_local_cache[i].nhip[j] = 0; + for (k=0;k<6;k++) + p_arp_data->arp_local_cache[i].link_hw_laddr[j].addr_bytes[k] = 0; + p_arp_data->arp_local_cache[i].num_nhip = 0; + } + } +} + +struct ether_addr *get_nd_local_link_hw_addr(uint8_t out_port, uint8_t nhip[]) +{ + int i, j, limit; + struct ether_addr *x = NULL; + limit = p_arp_data->nd_local_cache[out_port].num_nhip; + + for (i=0; i < limit; i++) { + for (j=0;j<16;j++) { + if (p_arp_data->nd_local_cache[out_port].nhip[i][j] != nhip[j]) + continue; + } + + x = &p_arp_data->nd_local_cache[out_port].link_hw_laddr[i]; + return x; + } + + return x; +} + +struct ether_addr *get_local_link_hw_addr(uint8_t out_port, uint32_t nhip) +{ + int i, limit; + uint32_t tmp; + struct ether_addr *x = NULL; + limit = p_arp_data->arp_local_cache[out_port].num_nhip; + for (i=0; i < limit; i++) { + tmp = p_arp_data->arp_local_cache[out_port].nhip[i]; + if (tmp == nhip) { + x = &p_arp_data->arp_local_cache[out_port].link_hw_laddr[i]; + return x; + } + } + return x; +} + void lib_arp_init(struct pipeline_params *params, __rte_unused struct app_params *app) { + int i; + uint32_t size; + struct pipeline_cgnapt *p; + RTE_LOG(INFO, LIBARP, "ARP initialization ...\n"); + /* create arp data for table entries */ + size = RTE_CACHE_LINE_ROUNDUP(sizeof(struct arp_data)); + p = rte_zmalloc(NULL, size, RTE_CACHE_LINE_SIZE); + p_arp_data = (struct arp_data *)p; + /* Parse arguments */ if (arp_parse_args(params)) { RTE_LOG(INFO, LIBARP, "arp_parse_args failed ...\n"); return; } + /* acquire the mac addresses */ + struct ether_addr hw_addr; + uint8_t nb_ports = rte_eth_dev_count(); + + for (i = 0; i < nb_ports; i++) { + rte_eth_macaddr_get(i, &hw_addr); + ether_addr_copy(&hw_addr, &p_arp_data->link_hw_addr[i]); + p_arp_data->link_hw_addr_array_idx++; + } + + /* create a lock for arp/nd hash */ + rte_rwlock_init(&arp_hash_handle_lock); + rte_rwlock_init(&nd_hash_handle_lock); + /* create the arp_icmp mbuf rx pool */ lib_arp_pktmbuf_tx_pool = rte_pktmbuf_pool_create("lib_arp_mbuf_tx_pool", NB_ARPICMP_MBUF, 32, @@ -2504,9 +2681,40 @@ void lib_arp_init(struct pipeline_params *params, return; } - lib_arp_pkt = rte_pktmbuf_alloc(lib_arp_pktmbuf_tx_pool); - if (lib_arp_pkt == NULL) { - RTE_LOG(INFO, LIBARP, "ARP lib_arp_pkt alloc failed.\n"); + for (i=0; i<MAX_PORTS; i++) { + lib_arp_pkt[i] = rte_pktmbuf_alloc(lib_arp_pktmbuf_tx_pool); + if (lib_arp_pkt[i] == NULL) { + RTE_LOG(INFO, LIBARP, "ARP lib_arp_pkt alloc failed.\n"); + return; + } + } + + /* create the nd icmp mbuf rx pool */ + lib_nd_pktmbuf_tx_pool = + rte_pktmbuf_pool_create("lib_nd_mbuf_tx_pool", NB_ARPICMP_MBUF, 32, + 0, RTE_MBUF_DEFAULT_BUF_SIZE, + rte_socket_id()); + + if (lib_nd_pktmbuf_tx_pool == NULL) { + RTE_LOG(INFO, LIBARP, "ND mbuf pool create failed.\n"); + return; + } + + for (i=0; i<MAX_PORTS; i++) { + lib_nd_pkt[i] = rte_pktmbuf_alloc(lib_nd_pktmbuf_tx_pool); + if (lib_nd_pkt[i] == NULL) { + RTE_LOG(INFO, LIBARP, "ND lib_nd_pkt alloc failed.\n"); + return; + } + } + + /* create the arp_icmp mbuf rx pool */ + arp_icmp_pktmbuf_tx_pool = rte_pktmbuf_pool_create("arp_icmp_mbuf_tx_pool", + NB_ARPICMP_MBUF, MAX_POOL, 0, + RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id()); + + if (arp_icmp_pktmbuf_tx_pool == NULL) { + RTE_LOG(INFO, LIBARP, "icmp_pktmbuf pool creation failed\n"); return; } @@ -2552,34 +2760,219 @@ void lib_arp_init(struct pipeline_params *params, (void *)nd_hash_handle); } + /* Initialize the local arp cache */ + local_arp_cache_init(); + return; } void arp_timer_callback(struct rte_timer *timer, void *arg) { - struct arp_timer_key *remove_key = (struct arp_timer_key *)arg; - if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, "ARP TIMER callback : expire :%d\n", - (int)timer->expire); + struct arp_timer_key *timer_key = (struct arp_timer_key *)arg; + struct arp_key_ipv4 arp_key; + arp_key.port_id = timer_key->port_id; + arp_key.ip = timer_key->ip; + arp_key.filler1 = 0; + arp_key.filler2 = 0; + arp_key.filler3 = 0; + + struct arp_entry_data *ret_arp_data = NULL; + uint64_t now; + if (ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP, "arp_timer_callback ip %x, port %d\n", + arp_key.ip, arp_key.port_id); + } + + int ret = rte_hash_lookup_data(arp_hash_handle, &arp_key, + (void **)&ret_arp_data); + now = rte_rdtsc(); + if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, - "Remove ARP Entry for IP :%d.%d.%d.%d , port %d\n", - (remove_key->ip >> 24), - ((remove_key->ip & 0x00ff0000) >> 16), - ((remove_key->ip & 0x0000ff00) >> 8), - ((remove_key->ip & 0x000000ff)), remove_key->port_id); - remove_arp_entry((uint32_t) remove_key->ip, - (uint8_t) remove_key->port_id, arg); + RTE_LOG(INFO, LIBARP, "ARP TIMER callback : expire :%d now:%ld\n", + (int)timer->expire, now); + if (ret < 0) { + printf("Should not have come here\n"); + return; + } else { + if (ret_arp_data->mode == DYNAMIC_ARP) { + rte_rwlock_write_lock(&ret_arp_data->queue_lock); + if (ret_arp_data->status == PROBE || + ret_arp_data->status == INCOMPLETE) { + if (ret_arp_data->retry_count == 3) { + remove_arp_entry(ret_arp_data, arg); + } else { + ret_arp_data->retry_count++; + + if (ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP, + "RETRY ARP..retry count : %u\n", + ret_arp_data->retry_count); + + RTE_LOG(INFO, LIBARP, + "TIMER STARTED FOR %u seconds\n", + ARP_TIMER_EXPIRY); + } + + if (ifm_chk_port_ipv4_enabled + (ret_arp_data->port)) { + request_arp(ret_arp_data->port, + ret_arp_data->ip); + } else { + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "%s: IP is not enabled on port %u" + ", not sending GARP\n\r", + __FUNCTION__, + ret_arp_data->port); + } + + if (rte_timer_reset(ret_arp_data->timer, + (PROBE_TIME * + rte_get_tsc_hz()/ 1000), + SINGLE, + timer_lcore, + arp_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + + } + } else if (ret_arp_data->status == COMPLETE) { + if (now <= (ret_arp_data->n_confirmed + + (arp_timeout * rte_get_tsc_hz()))) { + if (rte_timer_reset(ret_arp_data->timer, + (arp_timeout * + rte_get_tsc_hz()), SINGLE, + timer_lcore, + arp_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } else if (now <= (p_arp_data->update_tsc[ret_arp_data->port] + (USED_TIME * rte_get_tsc_hz()))) { + if (rte_timer_reset(ret_arp_data->timer, + (arp_timeout * + rte_get_tsc_hz()), SINGLE, + timer_lcore, + arp_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } else { + ret_arp_data->status = STALE; + p_arp_data->arp_cache_hw_laddr_valid[ret_arp_data->port] = 0; + } + } + rte_rwlock_write_unlock(&ret_arp_data->queue_lock); + } else { + rte_hash_del_key(arp_hash_handle, &arp_key); + } + } return; } void nd_timer_callback(struct rte_timer *timer, void *arg) { - struct nd_timer_key *remove_key = (struct nd_timer_key *)arg; + struct nd_timer_key *timer_key = (struct nd_timer_key *)arg; + struct nd_key_ipv6 nd_key; + int j; + struct nd_entry_data *ret_nd_data = NULL; + uint64_t now; + + nd_key.port_id = timer_key->port_id; + nd_key.filler1 = 0; + nd_key.filler2 = 0; + nd_key.filler3 = 0; + + rte_mov16(&nd_key.ipv6[0], timer_key->ipv6); + + if (ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP, "nd_timer_callback port %d\n", + nd_key.port_id); + } + + int ret = rte_hash_lookup_data(nd_hash_handle, &nd_key, + (void **)&ret_nd_data); + now = rte_rdtsc(); + if (ARPICMP_DEBUG) - RTE_LOG(INFO, LIBARP, "nd time callback : expire :%d\n", - (int)timer->expire); - remove_nd_entry_ipv6(remove_key->ipv6, remove_key->port_id); + RTE_LOG(INFO, LIBARP, "ND TIMER callback : expire :%d now:%ld\n", + (int)timer->expire, now); + if (ret < 0) { + printf("Should not have come here \n"); + for (j = 0; j < 16; j++) + printf("*%d ", nd_key.ipv6[j]); + printf("*%d ", nd_key.port_id); + return; + } else { + if (ret_nd_data->mode == DYNAMIC_ARP) { + rte_rwlock_write_lock(&ret_nd_data->queue_lock); + if (ret_nd_data->status == PROBE || + ret_nd_data->status == INCOMPLETE) { + if (ret_nd_data->retry_count == 3) { + remove_nd_entry_ipv6(ret_nd_data, arg); + } else { + ret_nd_data->retry_count++; + + if (ARPICMP_DEBUG) { + RTE_LOG(INFO, LIBARP, + "RETRY ND..retry count : %u\n", + ret_nd_data->retry_count); + + RTE_LOG(INFO, LIBARP, + "TIMER STARTED FOR %u seconds\n", + ARP_TIMER_EXPIRY); + } + + request_nd(ret_nd_data->ipv6, + ifm_get_port(ret_nd_data->port)); + if (rte_timer_reset(ret_nd_data->timer, + (PROBE_TIME * + rte_get_tsc_hz()/ 1000), + SINGLE, + timer_lcore, + nd_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + + } + } else if (ret_nd_data->status == COMPLETE) { + if (now <= (ret_nd_data->n_confirmed + + (arp_timeout * rte_get_tsc_hz()))) { + if (rte_timer_reset(ret_nd_data->timer, + (arp_timeout * + rte_get_tsc_hz()), SINGLE, + timer_lcore, + nd_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } else if (now <= (p_arp_data->update_tsc[ret_nd_data->port] + (USED_TIME * rte_get_tsc_hz()))) { + if (rte_timer_reset(ret_nd_data->timer, + (arp_timeout * + rte_get_tsc_hz()), SINGLE, + timer_lcore, + nd_timer_callback, + arg) < 0) + if (ARPICMP_DEBUG) + RTE_LOG(INFO, LIBARP, + "Err : Timer already running\n"); + } else { + printf("making it stale\n"); + ret_nd_data->status = STALE; + p_arp_data->nd_cache_hw_laddr_valid[ret_nd_data->port] = 0; + } + } + rte_rwlock_write_unlock(&ret_nd_data->queue_lock); + } else { + rte_hash_del_key(nd_hash_handle, &nd_key); + } + } return; } @@ -2595,6 +2988,7 @@ void create_arp_table(void) STATIC_ARP); } print_arp_table(); + return; } @@ -2618,7 +3012,7 @@ void send_gratuitous_arp(l2_phy_interface_t *port) struct ether_hdr *eth_h; struct arp_hdr *arp_h; - struct rte_mbuf *arp_pkt = lib_arp_pkt; + struct rte_mbuf *arp_pkt = lib_arp_pkt[port->pmdid]; if (port == NULL) { RTE_LOG(INFO, LIBARP, "PORT ID DOWN.. %s\n", __FUNCTION__); diff --git a/common/VIL/l2l3_stack/lib_arp.h b/common/VIL/l2l3_stack/lib_arp.h index e2d38419..9cb0205f 100644 --- a/common/VIL/l2l3_stack/lib_arp.h +++ b/common/VIL/l2l3_stack/lib_arp.h @@ -24,11 +24,15 @@ #define ND_IPV6_ADDR_SIZE 16 /**< 16 Byte of IPv6 Address. */ #define ND_IPV6_TIMER_EXPIRY 300 /**< in Seconds, Timer for ND IPv6 Expiry */ -#define ARP_TIMER_EXPIRY 1800 /**< in Seconds, TIMER for ARP Expiry */ +#define ARP_TIMER_EXPIRY 20 /**< in Seconds, TIMER for ARP Expiry */ #define TIMER_MILLISECOND 1 #define RTE_LOGTYPE_LIBARP RTE_LOGTYPE_USER1 #define MAX_ND_RT_ENTRY 32 #define MAX_ARP_RT_ENTRY 32 +#define NUM_DESC (get_arp_buf()) +#define ARP_BUF_DEFAULT 30000 +#define PROBE_TIME 50 +#undef L3_STACK_SUPPORT /** * A structure for Route table entries of IPv4 @@ -39,6 +43,21 @@ struct lib_arp_route_table_entry { uint32_t mask; /**< mask */ uint32_t port; /**< Physical port */ uint32_t nh; /**< next hop */ + uint32_t nh_mask; +}; + +#define MAX_LOCAL_MAC_ADDRESS 32 +#define MAX_PORTS 32 +struct arp_cache { + uint32_t nhip[MAX_LOCAL_MAC_ADDRESS]; + struct ether_addr link_hw_laddr[MAX_LOCAL_MAC_ADDRESS]; + uint32_t num_nhip; +}; + +struct nd_cache { + uint8_t nhip[MAX_LOCAL_MAC_ADDRESS][16]; + struct ether_addr link_hw_laddr[MAX_LOCAL_MAC_ADDRESS]; + uint32_t num_nhip; }; /** @@ -52,8 +71,17 @@ struct lib_nd_route_table_entry { uint8_t nhipv6[16]; /**< next hop Ipv6 */ }; +uint8_t arp_cache_dest_mac_present(uint32_t out_port); +uint8_t nd_cache_dest_mac_present(uint32_t out_port); extern struct lib_nd_route_table_entry lib_nd_route_table[MAX_ND_RT_ENTRY]; extern struct lib_arp_route_table_entry lib_arp_route_table[MAX_ARP_RT_ENTRY]; +extern struct ether_addr *get_local_link_hw_addr(uint8_t out_port, uint32_t nhip); +extern struct ether_addr *get_nd_local_link_hw_addr(uint8_t out_port, uint8_t nhip[]); +extern struct arp_cache arp_local_cache[MAX_PORTS]; +extern void prefetch(void); +extern void update_nhip_access(uint8_t); +uint32_t get_arp_buf(void); +uint32_t get_nd_buf(void); enum { ARP_FOUND, @@ -116,8 +144,13 @@ struct arp_timer_key { extern uint32_t ARPICMP_DEBUG; -#define COMPLETE 1 /**< ARP entry populated and echo reply recieved. */ -#define INCOMPLETE 0 /**< ARP entry populated and either awaiting echo reply or stale entry. */ +enum { + INCOMPLETE, + COMPLETE, + PROBE, + STALE +}; +#define USED_TIME 5 extern uint32_t NDIPV6_DEBUG; /**< ND IPv6 */ @@ -142,6 +175,10 @@ struct arp_entry_data { uint8_t retry_count; /**< retry count for ARP*/ struct rte_timer *timer; /**< Timer Associated with ARP*/ struct arp_timer_key *timer_key; + rte_rwlock_t queue_lock; /** queue lock */ + struct rte_mbuf **buf_pkts; + uint32_t num_pkts; + uint64_t n_confirmed; } __attribute__ ((packed)); /** @@ -167,7 +204,13 @@ struct nd_entry_data { uint8_t status; /**< statusof the entry */ uint8_t mode; /**< Mode */ uint8_t ipv6[ND_IPV6_ADDR_SIZE]; /**< Ipv6 address */ + uint8_t retry_count; /**< retry count for ARP*/ struct rte_timer *timer; /**< Timer */ + struct nd_timer_key *timer_key; + rte_rwlock_t queue_lock; /** queue lock */ + struct rte_mbuf **buf_pkts; + uint32_t num_pkts; + uint64_t n_confirmed; } __attribute__ ((packed)); /** @@ -184,22 +227,22 @@ struct table_nd_entry_data { struct rte_timer *timer; /**< Timer */ } __attribute__ ((packed)); -/** -* To get the destination MAC address andnext hop for the ip address and outgoing port -* @param1 ip addr -* IP address for which MAC address is needed. -* @param2 phy_port -* Physical Port -* @param3 ether_addr -* pointer to the ether_addr, This gets update with valid MAC addresss -* @Param4 next nhip -* Gets the next hop IP by Ip address and physical port -* @return -* 0 if failure, and 1 if success -*/ +struct arp_data { + struct lib_arp_route_table_entry + lib_arp_route_table[MAX_ARP_RT_ENTRY]; + uint8_t lib_arp_route_ent_cnt; + struct lib_nd_route_table_entry + lib_nd_route_table[MAX_ARP_RT_ENTRY]; + uint8_t lib_nd_route_ent_cnt; + struct arp_cache arp_local_cache[MAX_PORTS]; + struct nd_cache nd_local_cache[MAX_PORTS]; + struct ether_addr link_hw_addr[MAX_LOCAL_MAC_ADDRESS]; + uint32_t link_hw_addr_array_idx; + uint8_t arp_cache_hw_laddr_valid[MAX_LOCAL_MAC_ADDRESS]; + uint8_t nd_cache_hw_laddr_valid[MAX_LOCAL_MAC_ADDRESS]; + uint64_t update_tsc[MAX_LOCAL_MAC_ADDRESS]; +} __rte_cache_aligned; -int get_dest_mac_address(const uint32_t ipaddr, uint32_t *phy_port, - struct ether_addr *hw_addr, uint32_t *nhip); /** * To get the destination MAC address andnext hop for the ip address and outgoing port * @param1 ip addr @@ -213,39 +256,10 @@ int get_dest_mac_address(const uint32_t ipaddr, uint32_t *phy_port, * @return * 0 if failure, and 1 if success */ -int get_dest_mac_addr_port(const uint32_t ipaddr, +struct arp_entry_data *get_dest_mac_addr_port(const uint32_t ipaddr, uint32_t *phy_port, struct ether_addr *hw_addr); /** -* To get the destination mac address for IPv4 address -* @param Ipaddr -* IP address which need the destination mac address -* @param Phy_port -* physical port -* @param ether_addr -* pointer to the ether_addr, This gets update with valid mac address -* @return -* 0 if failure, 1 if success -*/ -int get_dest_mac_addr(const uint32_t ipaddr, uint32_t *phy_port, - struct ether_addr *hw_addr); - -/** -* To get the destination mac address for IPV6 address -* @param ipv6addr -* IPv6 address which need the destination mac adress -* @param Phy_Port -* physical prt -* @param ether_addr -* pointer to the ether_address, This gets update with valid mac address -* @param Nhipv6[] -* Gets the next hop ipv6 address by ipv6 address and physical port -* @return -* 0 if failure, 1 ifsuccess -*/ -int get_dest_mac_address_ipv6(uint8_t ipv6addr[], uint32_t *phy_port, - struct ether_addr *hw_addr, uint8_t nhipv6[]); -/** * To get the destination mac address for IPV6 address * @param ipv6addr * IPv6 address which need the destination mac adress @@ -259,9 +273,16 @@ int get_dest_mac_address_ipv6(uint8_t ipv6addr[], uint32_t *phy_port, * 0 if failure, 1 ifsuccess */ -int get_dest_mac_address_ipv6_port(uint8_t ipv6addr[], uint32_t *phy_port, +struct nd_entry_data *get_dest_mac_address_ipv6_port(uint8_t ipv6addr[], uint32_t *phy_port, struct ether_addr *hw_addr, uint8_t nhipv6[]); +int arp_queue_unresolved_packet(struct arp_entry_data * arp_data, + struct rte_mbuf * m); +extern void arp_send_buffered_pkts(struct arp_entry_data *ret_arp_data,struct ether_addr *hw_addr, uint8_t port_id); + +int nd_queue_unresolved_packet(struct nd_entry_data *nd_data, + struct rte_mbuf * m); +extern void nd_send_buffered_pkts(struct nd_entry_data *ret_nd_data,struct ether_addr *hw_addr, uint8_t port_id); /** * To get hardware link address @@ -292,7 +313,7 @@ void print_nd_table(void); * @param portid * Port id */ -void remove_arp_entry(uint32_t ipaddr, uint8_t portid, void *arg); +void remove_arp_entry(struct arp_entry_data *ret_arp_data, void *arg); /** * Removes ND entry from Nd Table @@ -302,7 +323,7 @@ void remove_arp_entry(uint32_t ipaddr, uint8_t portid, void *arg); * Port id */ -void remove_nd_entry_ipv6(uint8_t ipv6addr[], uint8_t portid); +void remove_nd_entry_ipv6(struct nd_entry_data *ret_nd_data, void *arg); /** * Populate arp entry in arp Table @@ -387,7 +408,7 @@ void process_arpicmp_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port); * @Param arp_key * Arp key to validate entry */ -struct arp_entry_data *retrieve_arp_entry(const struct arp_key_ipv4 arp_key); +struct arp_entry_data *retrieve_arp_entry(const struct arp_key_ipv4 arp_key, uint8_t mode); /** * ND IPv6 @@ -396,7 +417,7 @@ struct arp_entry_data *retrieve_arp_entry(const struct arp_key_ipv4 arp_key); * Nd key to validate Nd entry */ -struct nd_entry_data *retrieve_nd_entry(struct nd_key_ipv6 nd_key); +struct nd_entry_data *retrieve_nd_entry(struct nd_key_ipv6 nd_key, uint8_t mode); /** * Setsup Arp Initilization @@ -492,7 +513,7 @@ void set_arptimeout(uint32_t timeout_val); * @Param * timeout_val to set */ -uint32_t get_nh(uint32_t, uint32_t *); +uint32_t get_nh(uint32_t, uint32_t *, struct ether_addr *addr); /** * To get nexthop for ipv6 * @Param ipv6 @@ -502,5 +523,5 @@ uint32_t get_nh(uint32_t, uint32_t *); * @Param nhipv6 * next hop ipv6 */ -void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[]); +void get_nh_ipv6(uint8_t ipv6[], uint32_t *port, uint8_t nhipv6[], struct ether_addr *hw_addr); #endif diff --git a/common/VIL/l2l3_stack/lib_icmpv6.c b/common/VIL/l2l3_stack/lib_icmpv6.c index 44f30cbf..eea67b0d 100644 --- a/common/VIL/l2l3_stack/lib_icmpv6.c +++ b/common/VIL/l2l3_stack/lib_icmpv6.c @@ -184,7 +184,7 @@ void process_icmpv6_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) nd_key.filler3 = 0; /*Validate if key-value pair already exists in the hash table for ND IPv6 */ - struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key); + struct nd_entry_data *new_nd_data = retrieve_nd_entry(nd_key, DYNAMIC_ND); if (new_nd_data == NULL) { printf ("Received unsolicited ICMPv6 echo reply on port %d\n", @@ -209,6 +209,7 @@ void process_icmpv6_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) src_ipv6[i] = ipv6_h->src_addr[i]; + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) dst_ipv6[i] = ipv6_h->dst_addr[i]; @@ -217,6 +218,7 @@ void process_icmpv6_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port) /* Check for Multicast Address */ if ((IPV6_MULTICAST & ((multi_addr << 8) | dst_ipv6[1])) || !memcmp(&port->macaddr[0], ð_h->d_addr, 6)) { + populate_nd_entry(src_hw_addr, src_ipv6, port->pmdid, DYNAMIC_ND); @@ -346,6 +348,9 @@ struct rte_mbuf *request_icmpv6_echo(uint8_t ipv6[], l2_phy_interface_t *port) sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr) + 64; icmpv6_pkt->data_len = icmpv6_pkt->pkt_len; + if (port) + port->transmit_single_pkt(port, icmpv6_pkt); + return icmpv6_pkt; } @@ -357,13 +362,16 @@ struct rte_mbuf *request_nd(uint8_t ipv6[], l2_phy_interface_t *port) struct icmpv6_nd_hdr *icmpv6_nd_h; int i; - struct rte_mbuf *icmpv6_pkt = lib_icmpv6_pkt; + struct rte_mbuf *icmpv6_pkt = lib_nd_pkt[port->pmdid]; if (icmpv6_pkt == NULL) { if (ARPICMP_DEBUG) printf("Error allocating icmpv6_pkt rte_mbuf\n"); return NULL; } + uint8_t dst_ip[] = {255, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 255, 16, 100, 20}; + uint8_t dst_mac[] = {51,51,255, 16, 100, 20}; + eth_h = rte_pktmbuf_mtod(icmpv6_pkt, struct ether_hdr *); ipv6_h = (struct ipv6_hdr *)((char *)eth_h + sizeof(struct ether_hdr)); @@ -375,24 +383,37 @@ struct rte_mbuf *request_nd(uint8_t ipv6[], l2_phy_interface_t *port) ether_addr_copy((struct ether_addr *)&port->macaddr[0], ð_h->s_addr); eth_h->ether_type = rte_bswap16(0x86dd); + for (i = 0; i < 6; i++) { - eth_h->d_addr.addr_bytes[i] = 0; + if (i < 3) + eth_h->d_addr.addr_bytes[i] = dst_mac[i]; + else + eth_h->d_addr.addr_bytes[i] = ipv6[i]; } - ipv6_h->vtc_flow = 0x60000000; + for (i=13; i<16; i++) + dst_ip[i] = ipv6[i]; + + uint8_t *addr = ((ipv6list_t *) (port->ipv6_list))->ipaddr; + + ipv6_h->vtc_flow = rte_bswap32(0x60000000); ipv6_h->payload_len = rte_bswap16(32); ipv6_h->proto = 58; - ipv6_h->hop_limits = 64; + ipv6_h->hop_limits = 255; for (i = 0; i < 16; i++) { - ipv6_h->src_addr[i] = 0x0; - ipv6_h->dst_addr[i] = ipv6[i]; + ipv6_h->src_addr[i] = *(addr + i); + ipv6_h->dst_addr[i] = dst_ip[i]; } icmpv6_h->icmpv6_type = ICMPV6_NEIGHBOR_SOLICITATION; icmpv6_h->icmpv6_code = 0; icmpv6_nd_h->icmpv6_reserved = 0x0; + icmpv6_nd_h->icmpv6_reserved |= + rte_cpu_to_be_32 + (NEIGHBOR_ROUTER_OVERRIDE_SET); + for (i = 0; i < ND_IPV6_ADDR_SIZE; i++) icmpv6_nd_h->target_ipv6[i] = ipv6[i]; icmpv6_nd_h->type = e_Source_Link_Layer_Address; @@ -401,10 +422,13 @@ struct rte_mbuf *request_nd(uint8_t ipv6[], l2_phy_interface_t *port) icmpv6_h->icmpv6_cksum = 0; icmpv6_h->icmpv6_cksum = ~icmpv6_ipv6_nd_checksum(icmpv6_pkt); - icmpv6_pkt->pkt_len = sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr) + 32; icmpv6_pkt->data_len = icmpv6_pkt->pkt_len; + if (port) { + port->transmit_single_pkt(port, icmpv6_pkt); + } + return icmpv6_pkt; } diff --git a/common/VIL/l2l3_stack/lib_icmpv6.h b/common/VIL/l2l3_stack/lib_icmpv6.h index e9ccca14..b713d822 100644 --- a/common/VIL/l2l3_stack/lib_icmpv6.h +++ b/common/VIL/l2l3_stack/lib_icmpv6.h @@ -111,3 +111,4 @@ struct rte_mbuf *lib_icmpv6_pkt; * port - port structure */ void process_icmpv6_pkt(struct rte_mbuf *pkt, l2_phy_interface_t *port); +extern struct rte_mbuf *lib_nd_pkt[MAX_PORTS]; |