aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/DpdkUtil.py10
-rw-r--r--resources/libraries/python/QemuUtils.py13
2 files changed, 17 insertions, 6 deletions
diff --git a/resources/libraries/python/DpdkUtil.py b/resources/libraries/python/DpdkUtil.py
index 79e7209364..b8c1d15a9f 100644
--- a/resources/libraries/python/DpdkUtil.py
+++ b/resources/libraries/python/DpdkUtil.py
@@ -79,8 +79,11 @@ class DpdkUtil(object):
# Set the hexadecimal bitmask of TX queue flags.
pmd_txqflags = '--txqflags=0xf00 '
# Set the number of mbufs to be allocated in the mbuf pools.
- pmd_total_num_mbufs = '--total-num-mbufs={} '.format(\
+ pmd_total_num_mbufs = '--total-num-mbufs={} '.format(
args['pmd_num_mbufs']) if args.get('pmd_num_mbufs', '') else ''
+ # Set the max packet length.
+ pmd_max_pkt_len = "--max-pkt-len={0}".format(args["pmd_max_pkt_len"]) \
+ if args.get("pmd_max_pkt_len", "") else ""
# Set the hexadecimal bitmask of the ports for forwarding.
pmd_portmask = '--portmask={} '.format(args['pmd_portmask'])\
if args.get('pmd_portmask', '') else ''
@@ -96,7 +99,7 @@ class DpdkUtil(object):
pmd_eth_peer_1 = '--eth-peer={} '.format(args['pmd_eth_peer_1'])\
if args.get('pmd_eth_peer_1', '') else ''
# Set the number of forwarding cores based on coremask.
- pmd_nb_cores = '--nb-cores={} '.format(\
+ pmd_nb_cores = '--nb-cores={} '.format(
bin(int(args['eal_coremask'], 0)).count('1')-1)\
if args.get('eal_coremask', '') else ''
pmd_options = '-- '\
@@ -113,7 +116,8 @@ class DpdkUtil(object):
+ pmd_disable_rss\
+ pmd_eth_peer_0\
+ pmd_eth_peer_1\
- + pmd_nb_cores
+ + pmd_nb_cores\
+ + pmd_max_pkt_len
return pmd_options
@staticmethod
diff --git a/resources/libraries/python/QemuUtils.py b/resources/libraries/python/QemuUtils.py
index aa45ce08ef..a8c26d6898 100644
--- a/resources/libraries/python/QemuUtils.py
+++ b/resources/libraries/python/QemuUtils.py
@@ -192,16 +192,19 @@ class QemuUtils(object):
arch = Topology.get_node_arch(node)
self._qemu_bin = 'qemu-system-{arch}'.format(arch=arch)
- def qemu_add_vhost_user_if(self, socket, server=True, mac=None):
+ def qemu_add_vhost_user_if(self, socket, server=True, mac=None,
+ jumbo_frames=False):
"""Add Vhost-user interface.
:param socket: Path of the unix socket.
:param server: If True the socket shall be a listening socket.
:param mac: Vhost-user interface MAC address (optional, otherwise is
- used auto-generated MAC 52:54:00:00:xx:yy).
+ used auto-generated MAC 52:54:00:00:xx:yy).
+ :param jumbo_frames: Set True if jumbo frames are used in the test.
:type socket: str
:type server: bool
:type mac: str
+ :type jumbo_frames: bool
"""
self._vhost_id += 1
# Create unix socket character device.
@@ -221,7 +224,11 @@ class QemuUtils(object):
mac = '52:54:00:00:{0:02x}:{1:02x}'.\
format(self._qemu_id, self._vhost_id)
extend_options = 'mq=on,csum=off,gso=off,guest_tso4=off,'\
- 'guest_tso6=off,guest_ecn=off,mrg_rxbuf=off'
+ 'guest_tso6=off,guest_ecn=off'
+ if jumbo_frames:
+ extend_options += ",mrg_rxbuf=on"
+ else:
+ extend_options += ",mrg_rxbuf=off"
# Create Virtio network device.
device = ' -device virtio-net-pci,netdev=vhost{0},mac={1},{2}'.format(
self._vhost_id, mac, extend_options)