Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-18187

Packet loss due to excessive fragmentation in small TCP packet transmission

    • None
    • Moderate
    • rhel-sst-virtualization-windows
    • ssg_virtualization
    • None
    • QE ack
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • x86_64
    • Windows
    • None

      What were you trying to do that didn't work?
      Transmitting small TCP packets continuously using the NetKVM driver led to excessive paging and packet loss.

       

      Please provide the package NVR for which the bug is seen:
      qemu-kvm-8.0.0-7.el9.x86_64
      virtio-win-1.9.35-0.el9.iso
      kernel-5.14.0-362.8.1.el9_3.x86_64

       

      How reproducible:
      50%

       

      Steps to reproduce
      1. Setup a Win2019 VM using virtio-net adapter on QEMU

      /usr/libexec/qemu-kvm -m 17408 \
      -device '{"id": "pcie-root-port-3", "port": 3, "driver": "pcie-root-port", "addr": "0x1.0x3", "bus": "pcie.0", "chassis": 4}' \
      -device '{"driver": "virtio-net-pci", "mac": "9a:44:d9:4f:bb:cf", "id": "idUyryQr", "netdev": "idxarPu0", "bus": "pcie-root-port-3", "addr": "0x0"}' \
      -netdev  '{"id": "idxarPu0", "type": "tap", "vhost": true, "vhostfd": "16", "fd": "12"}' \{noformat}
      

      2. Run a Python script that sends small TCP packets continuously in the host.

      3. Run a Python script to receive these packets in the VM.

      4. Observe the packet handling behavior at the driver level.

       

      Expected results

      Always 100% of packets received  

       

      Actual results

      The reception of packets randomly stops

       

      Additional context

      The `rec.py` in the VM:

      import random
      import socket
      
      for i in range(1, 1001):
          random1 = random.randint(0, 99)
          random2 = random.randint(0, 9999)
          message = "Count {}: {},{},{}".format(i, random1, '12233333', random2).encode('utf-8')
          sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
          sock.connect(('<Host_IP>', 8001))
          sock.sendall(message)
          sock.close() 

      The `send.py` in the Host:

      import socket
      
      HOST = '<Host_IP>'
      PORT = 8001
      with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
          s.bind((HOST, PORT))
          s.listen()
          while True:
              conn, addr = s.accept()
              with conn:
                  print('Connected by', addr)
                  while True:
                      data = conn.recv(1024)
                      if not data:
                          break
                      print(data)
                      conn.sendall(data) 

      Upstream source: https://github.com/virtio-win/kvm-guest-drivers-windows/issues/942

        1. p1.png
          p1.png
          176 kB
        2. p2.png
          p2.png
          294 kB

              virt-maint virt-maint
              rh-ee-wji Wenkang Ji
              virt-maint virt-maint
              Wenkang Ji Wenkang Ji
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: