Skip to content

Commit

Permalink
Merge pull request #6085 from yanqzhan/tuntap_with_multiqueue
Browse files Browse the repository at this point in the history
mtu: create tap with multi_queue flag
  • Loading branch information
chloerh authored Jan 16, 2025
2 parents 730bbcb + 8b89ff7 commit 9f35597
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libvirt/tests/cfg/virtual_network/mtu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
- tap:
create_tap = yes
tap_mtu_size = 2000
tap_cmd = 'ip tuntap add mode tap name {tap_name};ip link set dev {tap_name} mtu ${tap_mtu_size}'
tap_cmd = 'ip tuntap add mode tap name {tap_name} multi_queue;ip link set dev {tap_name} mtu ${tap_mtu_size}'
variants:
- managed_no:
iface_target = {'dev': '%s', 'managed': 'no'}
Expand Down
11 changes: 8 additions & 3 deletions libvirt/tests/src/virtual_network/mtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ def check_mtu_in_vm(fn_login, mtu_size, timeout):
if tap_cmd is None:
test.error('No tap creating command provided.')
tap_cmd = tap_cmd.format(tap_name=tap_name)
vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name)
iface = vmxml.devices.by_device_tag('interface')[0]
if "driver queues" not in str(iface):
tap_cmd = tap_cmd.replace(' multi_queue', '')
logging.debug('Tap creating command: \n %s', tap_cmd)
# Create tap device
process.run(tap_cmd, verbose=True, shell=True)
Expand All @@ -231,8 +235,6 @@ def check_mtu_in_vm(fn_login, mtu_size, timeout):
test.fail('Host mtu size check FAIL.')

# Get iface mac address
vmxml = vm_xml.VMXML.new_from_dumpxml(vm_name)
iface = vmxml.devices.by_device_tag('interface')[0]
iface_mac = iface.mac_address

# Check mtu inside vm
Expand Down Expand Up @@ -386,4 +388,7 @@ def check_mtu_in_vm(fn_login, mtu_size, timeout):
process.run("ovs-vsctl del-br %s" % br, verbose=True)
utils_package.package_remove(add_pkg)
if create_tap:
process.run('ip tuntap del mode tap {}'.format(tap_name), verbose=True, shell=True)
tap_del_cmd = 'ip tuntap del mode tap {} multi_queue'
if "multi_queue" not in tap_cmd:
tap_del_cmd = tap_del_cmd.replace(' multi_queue', '')
process.run(tap_del_cmd.format(tap_name), verbose=True, shell=True)

0 comments on commit 9f35597

Please sign in to comment.