Example #1
0
    def get_eal_options(**kwargs):
        """Create EAL parameters options (including -v).

        :param kwargs: Dict of testpmd parameters.
        :type kwargs: dict
        :returns: EAL parameters.
        :rtype: OptionString
        """
        options = OptionString(prefix='-')
        options.add('v')
        # Set the hexadecimal bitmask of the cores to run on.
        options.add_with_value_from_dict('l', 'eal_corelist', kwargs)
        # Set master core.
        options.add_with_value('-master-lcore', '0')
        # Load an external driver. Multiple -d options are allowed.
        options.add_with_value_if_from_dict('d',
                                            '/usr/lib/librte_pmd_virtio.so',
                                            'eal_driver', kwargs, True)
        options.add_if_from_dict('-in-memory', 'eal_in_memory', kwargs, False)
        return options
Example #2
0
    def get_l3fwd_pmd_options(**kwargs):
        """Create PMD parameters options for l3fwd (without --).

        :param kwargs: List of l3fwd parameters.
        :type kwargs: dict
        :returns: PMD parameters.
        :rtype: OptionString
        """
        options = OptionString(prefix=u"--")
        # Set to use software to analyze packet type.
        options.add_if_from_dict(u"parse-ptype", u"pmd_parse_ptype", kwargs,
                                 True)
        # Set the MAC address XX:XX:XX:XX:XX:XX of the peer port N.
        options.add_equals_from_dict(u"eth-dest", u"pmd_eth_dest_0", kwargs)
        options.add_equals_from_dict(u"eth-dest", u"pmd_eth_dest_1", kwargs)
        # Determines which queues from which ports are mapped to which cores.
        options.add_equals_from_dict(u"config", u"pmd_config", kwargs)
        # Set the max packet length.
        options.add_with_value_if_from_dict(u"max-pkt-len", u"9200",
                                            u"pmd_max_pkt_len", kwargs, False)
        return options
Example #3
0
    def get_eal_options(**kwargs):
        """Create EAL parameters options (including -v).

        :param kwargs: Dict of testpmd parameters.
        :type kwargs: dict
        :returns: EAL parameters.
        :rtype: OptionString
        """
        options = OptionString(prefix=u"-")
        options.add(u"v")
        # Set the hexadecimal bitmask of the cores to run on.
        options.add_with_value_from_dict(u"l", u"eal_corelist", kwargs)
        # Add a PCI device in white list.
        options.add_with_value_from_dict(u"a", u"eal_pci_whitelist0", kwargs)
        options.add_with_value_from_dict(u"a", u"eal_pci_whitelist1", kwargs)
        # Load an external driver. Multiple -d options are allowed.
        options.add_with_value_if_from_dict(u"d",
                                            u"/usr/lib/librte_pmd_virtio.so",
                                            u"eal_driver", kwargs, True)
        options.add_if_from_dict(u"-in-memory", u"eal_in_memory", kwargs,
                                 False)
        return options