On 6/6/2023 10:12 PM, Mike Pattrick wrote: > Previously the noisy neighbour vnf simulation would only operate in io > mode, forwarding packets as is. However, this limited the usefulness of > noisy neighbour simulation. > > This feature has now been expanded to supporting mac, macswap, and > 5tswap modes. To facilitate adding this support, some new header files > were added. > > Signed-off-by: Mike Pattrick <m...@redhat.com> > --- > v2: Reverted changes to random memory lookup > v3: Refactored entire patch > v4: Implemented recommended formatting changes > v5: Corrected copyright statement and formatting changes
<...> > @@ -226,6 +291,15 @@ noisy_fwd_begin(portid_t pi) > "--noisy-lkup-memory-size must be > 0\n"); > } > > + if (noisy_fwd_mode == NOISY_FWD_MODE_IO) > + noisy_vnf_engine.packet_fwd = pkt_burst_io; > + else if (noisy_fwd_mode == NOISY_FWD_MODE_MAC) > + noisy_vnf_engine.packet_fwd = pkt_burst_mac; > + else if (noisy_fwd_mode == NOISY_FWD_MODE_MACSWAP) > + noisy_vnf_engine.packet_fwd = pkt_burst_macswap; > + else if (noisy_fwd_mode == NOISY_FWD_MODE_5TSWAP) > + noisy_vnf_engine.packet_fwd = pkt_brust_5tswap; > + When noisy forward mode is set, it is not possbile to see what mode is set, what about keeping '.fwd_mode_name' longer, like "noisy - ", and update it based on selected mode? This way "show config fwd" command displays selected noisy mode. > return 0; > } > > @@ -233,6 +307,6 @@ struct fwd_engine noisy_vnf_engine = { > .fwd_mode_name = "noisy", > .port_fwd_begin = noisy_fwd_begin, > .port_fwd_end = noisy_fwd_end, > - .stream_init = common_fwd_stream_init, > - .packet_fwd = pkt_burst_noisy_vnf, > + .stream_init = common_fwd_stream_init, > + .packet_fwd = pkt_burst_io, > }; > diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c > index 3b37809baf..d29c65fef4 100644 > --- a/app/test-pmd/parameters.c > +++ b/app/test-pmd/parameters.c > @@ -190,6 +190,7 @@ usage(char* progname) > " anon: use regular DPDK memory to create and anonymous > memory to populate mempool\n" > " xmem: use anonymous memory to create and populate mempool\n" > " xmemhuge: use anonymous hugepage memory to create and > populate mempool\n"); > + printf(" --noisy-fwd-mode=<io|mac|macswap|5tswap>: set the sub-fwd > mode, defaults to io\n"); Main forwarding parameter is '--forward-mode=N', and while testing I searched for 'forward' in the testpmd help output but not able to find this command, because of shortened 'fwd'. What do you think to have full '--noisy-forward-mode' to be more consistent with existing '--forward-mode=N'? > printf(" --noisy-tx-sw-buffer-size=N: size of FIFO buffer\n"); > printf(" --noisy-tx-sw-buffer-flushtime=N: flush FIFO after N ms\n"); > printf(" --noisy-lkup-memory=N: allocate N MB of VNF memory\n"); > @@ -704,6 +705,7 @@ launch_args_parse(int argc, char** argv) > { "noisy-lkup-num-writes", 1, 0, 0 }, > { "noisy-lkup-num-reads", 1, 0, 0 }, > { "noisy-lkup-num-reads-writes", 1, 0, 0 }, > + { "noisy-fwd-mode", 1, 0, 0 }, If there will be a new version can you please move it to the top of the noisy-* block, as done in the help string? And this is same for all new code, from 'extern' to global variable to .rst documentation update.