- pmd_nb_cores = '--nb-cores={} '.format(
- bin(int(args['eal_coremask'], 0)).count('1')-1)\
- if args.get('eal_coremask', '') else ''
- pmd_options = '-- '\
- + pmd_fwd_mode\
- + pmd_burst\
- + pmd_txd\
- + pmd_rxd\
- + pmd_txq\
- + pmd_rxq\
- + pmd_txqflags\
- + pmd_total_num_mbufs\
- + pmd_portmask\
- + pmd_disable_hw_vlan\
- + pmd_disable_rss\
- + pmd_eth_peer_0\
- + pmd_eth_peer_1\
- + pmd_nb_cores\
- + pmd_max_pkt_len
- return pmd_options
+ options.add_equals_from_dict(u"nb-cores", u"pmd_nb_cores", kwargs)
+ return options
+
+ @staticmethod
+ def get_testpmd_cmdline(**kwargs):
+ """Get DPDK testpmd command line arguments.
+
+ :param kwargs: Key-value testpmd parameters.
+ :type kwargs: dict
+ :returns: Command line string.
+ :rtype: OptionString
+ """
+ options = OptionString()
+ options.add(u"testpmd")
+ options.extend(DpdkUtil.get_eal_options(**kwargs))
+ options.add(u"--")
+ options.extend(DpdkUtil.get_pmd_options(**kwargs))
+ return options