Dynamic VLAN tagging with replay pcap file examples
Hi Napatech, I would like to simulate the replay pcap file with some of the with/without VLAN tags. in DPDK there is a option to offload VLAN insertion to Intel NIC cards. How we can set VLAN tagging ?
VLAN demo example fails as below.
examples/net/vlandemo :
NT_NTPL() failed: Detected a time stamp type setting and packet descriptor type setting mismatch
>>> NTPL errorcode: 20000018
>>> Inconsistency between packet descriptor format and TimeStampFormat
I have tried add similar piece of code in other program, but memmove crashes.
pDyn3 = (NtDyn3Descr_t*)NT_NET_GET_PKT_DESCR_PTR(hNetBufTx);
pb = (uint8_t*)pDyn3;
const size_t descrLen = pDyn3->descrLength – 4U;
pDyn3->descrLength = descrLen & 0x3fU; // create space in actual packet to prepend 4-byte VLAN-tag,
memmove(pb + descrLen, pb + descrLen + 4U, 12U); // move actual MAC-header to new start of packet payload
memcpy(pb + descrLen + 12U, &vlan_tag, 4U); // insert VLAN tag after MAC-header
pDyn3->wireLength = (pDyn3->wireLength + 4U) & 0x3fffU; // set new wire length to inlude the 4-byte VLAN-tag
examples/net/replay4GA_loop
Thread 1 “replay4ga_loop_” received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:312
312 ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0 __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:312
#1 0x0000555555556f06 in memmove (__len=12, __src=0x8000e9800002, __dest=0x8000e97ffffe) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:40
#2 main (argc=<optimized out>, argv=<optimized out>) at /home/rglab/gm/examples/net/replay4GA_loop/replay4ga_loop_example.c:484
(gdb) quit
appreciate if you can suggest correct use of VLAN insertion in any given size of the packet replay utilities via simple steps.
adapter : NT50B01_2x1G/10G