qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] ec50dd: rocker: fix memory leak


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] ec50dd: rocker: fix memory leak
Date: Tue, 07 Jul 2015 09:00:02 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: ec50dd4634ae06091e61f42b7ba975f9ed510ad0
      
https://github.com/qemu/qemu/commit/ec50dd4634ae06091e61f42b7ba975f9ed510ad0
  Author: Gonglei <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/rocker/rocker.c

  Log Message:
  -----------
  rocker: fix memory leak

Meanwhile, using g_new0 instead of g_malloc0,
refer to commit 5839e53.

Signed-off-by: Gonglei <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5df6a1855b62dc653515d919e48c5b6f00c48f32
      
https://github.com/qemu/qemu/commit/5df6a1855b62dc653515d919e48c5b6f00c48f32
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/e1000.c

  Log Message:
  -----------
  e1000: flush packets when link comes up

e1000_can_receive() checks the link up status register bit.  If the bit
is clear, packets will be queued and the peer may disable receive to
avoid wasting CPU reading packets that cannot be delivered.  The queue
must be flushed once the link comes back up again.

This patch fixes broken e1000 receive with Mac OS X Snow Leopard guests
and tap networking.  Flushing the queue invokes the async send callback,
which re-enables tap fd read.

Reported-by: Jonathan Liu <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden


  Commit: b83b5f2ef9753713c2fb64ff4cae7cb1e080624e
      
https://github.com/qemu/qemu/commit/b83b5f2ef9753713c2fb64ff4cae7cb1e080624e
  Author: Brian Kress <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/vmxnet3.c

  Log Message:
  -----------
  vmxnet3: Fix incorrect small packet padding

When running ESXi under qemu there is an issue with the ESXi guest
discarding packets that are too short.  The guest discards any packets
under the normal minimum length for an ethernet packet (60).  This
results in odd behaviour where other hosts or VMs on other hosts can
communicate with the ESXi guest just fine (since there's a physical NIC
somewhere doing padding), but VMs on the host and the host itself cannot
because the ARP request packets are too small for the ESXi host to
accept.

Someone in the past thought this was worth fixing, and added code to the
vmxnet3 qemu emulation such that if it is receiving packets smaller than
60 bytes to pad the packet out to 60. Unfortunately this code is wrong
(or at least in the wrong place). It does so BEFORE before taking into
account the vnet_hdr at the front of the packet added by the tap device.
As a result, it might add padding, but it never adds enough.
Specifically it adds 10 less (the length of the vnet_hdr) than it needs
to.

The following (hopefully "obviously correct") patch simply swaps the
order of processing the vnet header and the padding.  With this patch an
ESXi guest is able to communicate with the host or other local VMs.

Signed-off-by: Brian Kress <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 66851f640b73a5a84160ee6ab19ab429f68bbb9f
      
https://github.com/qemu/qemu/commit/66851f640b73a5a84160ee6ab19ab429f68bbb9f
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/rocker/rocker_fp.c

  Log Message:
  -----------
  rocker: don't queue receive pkts when port is disabled

Commit 6e99c63 ("net/socket: Drop net_socket_can_send") changed the
semantics around .can_receive for sockets to now require the device to
flush queued pkts when transitioning to a .can_receive=true state.  Rocker
device was not flushing the queue on .can_receive=true transition, so the
receiver was stuck.

But, turns out we really don't want any queuing at all on the port when the
port is disabled, otherwise when the port transitions to enabled, we'd
receive and forward stale pkts that really should have been dropped.  So,
let's remove .can_receive so avoid queuing and drop the pkt in .receive if
the port is disabled.

Signed-off-by: Scott Feldman <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d1a88c96b7f94c8e12c07518f55fce8873e814d0
      
https://github.com/qemu/qemu/commit/d1a88c96b7f94c8e12c07518f55fce8873e814d0
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/rocker/rocker_of_dpa.c

  Log Message:
  -----------
  rocker: fix misplaced break statement

Premature break in switch case block.  This particular case (group L2 rewrite)
will be used for L2 LAG and L3 ECMP support, neither of which are enabled in
the guest driver at this time, but are under development.

Signed-off-by: Scott Feldman <address@hidden>
Reported-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f211fcd75fec96ec9850885622ed028c6f7ebdf4
      
https://github.com/qemu/qemu/commit/f211fcd75fec96ec9850885622ed028c6f7ebdf4
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/rocker/rocker.c

  Log Message:
  -----------
  rocker: fix missing break statements

Signed-off-by: Scott Feldman <address@hidden>
Reported-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 96497af0afd60e57749316f1bc196b417055c585
      
https://github.com/qemu/qemu/commit/96497af0afd60e57749316f1bc196b417055c585
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M hw/net/rocker/rocker_world.c

  Log Message:
  -----------
  rocker: return -1 when dropping packet on ingress

Signed-off-by: Scott Feldman <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: d0d2555852c5e684a97dce787d3c2a65b9a6d64c
      
https://github.com/qemu/qemu/commit/d0d2555852c5e684a97dce787d3c2a65b9a6d64c
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M docs/specs/rocker.txt
    M hw/net/rocker/rocker.c
    M hw/net/rocker/rocker.h
    M hw/net/rocker/rocker_hw.h
    M hw/net/rocker/rocker_of_dpa.c

  Log Message:
  -----------
  rocker: mark copy-to-cpu pkts as forwarding offloaded

For pkts copied to the CPU (to be processed by guest driver), mark the Rx
descriptor with flag "OFFLOAD_FWD" to indicate device has already forwarded
pkt.  The guest driver will use this indicator to avoid duplicate
forwarding in the guest OS.

Examples include bcast/mcast/unknown ucast pkts flooded to bridged ports.
We want to avoid both the device and the guest bridge driver flooding these
pkts, which would result in duplicates pkts on the wire.  Packet sampling,
such as sFlow, can also use this technique to mark pkts for the guest OS to
record but otherwise drop.

Signed-off-by: Scott Feldman <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 849729bb796e0ecbb3f370f119682f2821dd1441
      
https://github.com/qemu/qemu/commit/849729bb796e0ecbb3f370f119682f2821dd1441
  Author: Scott Feldman <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M tests/rocker/bridge-vlan
    M tests/rocker/bridge-vlan-stp

  Log Message:
  -----------
  rocker: tests: don't need to specify master/self when setting vlans

4.1 Linux kernel doesn't require specifying "master" or "self" when setting
vlans on a port, so clean these up from the tests that use vlans.

Signed-off-by: Scott Feldman <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f2562fbb7ac54d597cfe05f613d30296d1850d1b
      
https://github.com/qemu/qemu/commit/f2562fbb7ac54d597cfe05f613d30296d1850d1b
  Author: Peter Maydell <address@hidden>
  Date:   2015-07-07 (Tue, 07 Jul 2015)

  Changed paths:
    M docs/specs/rocker.txt
    M hw/net/e1000.c
    M hw/net/rocker/rocker.c
    M hw/net/rocker/rocker.h
    M hw/net/rocker/rocker_fp.c
    M hw/net/rocker/rocker_hw.h
    M hw/net/rocker/rocker_of_dpa.c
    M hw/net/rocker/rocker_world.c
    M hw/net/vmxnet3.c
    M tests/rocker/bridge-vlan
    M tests/rocker/bridge-vlan-stp

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into 
staging

# gpg: Signature made Tue Jul  7 13:38:13 2015 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/net-pull-request:
  rocker: tests: don't need to specify master/self when setting vlans
  rocker: mark copy-to-cpu pkts as forwarding offloaded
  rocker: return -1 when dropping packet on ingress
  rocker: fix missing break statements
  rocker: fix misplaced break statement
  rocker: don't queue receive pkts when port is disabled
  vmxnet3: Fix incorrect small packet padding
  e1000: flush packets when link comes up
  rocker: fix memory leak

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/aeb72188e073...f2562fbb7ac5

reply via email to

[Prev in Thread] Current Thread [Next in Thread]