1. 15 11月, 2012 1 次提交
  2. 01 11月, 2012 1 次提交
  3. 31 10月, 2012 1 次提交
  4. 19 10月, 2012 1 次提交
  5. 08 10月, 2012 1 次提交
    • P
      net: consolidate NetClientState header files into one · a245fc18
      Paolo Bonzini 提交于
      This patch doesn't seem much useful alone, I must admit.  However,
      it makes sense as part of the upcoming directory reorganization,
      where I want to have include/net/tap.h as the net<->hw interface
      for tap.  Then having both net/tap.h and include/net/tap.h does
      not work.  "Fixed" by moving all the init functions to a single
      header file net/clients.h.
      
      The patch also adopts a uniform style for including net/*.h files
      from net/*.c, without the net/ path.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@gmail.com>
      a245fc18
  6. 23 9月, 2012 1 次提交
  7. 14 9月, 2012 6 次提交
    • S
      net: EAGAIN handling for net/socket.c TCP · 45a7f54a
      Stefan Hajnoczi 提交于
      Replace spinning send_all() with a proper non-blocking send.  When the
      socket write buffer limit is reached, we should stop trying to send and
      wait for the socket to become writable again.
      
      Non-blocking TCP sockets can return in two different ways when the write
      buffer limit is reached:
      
      1. ret = -1 and errno = EAGAIN/EWOULDBLOCK.  No data has been written.
      
      2. ret < total_size.  Short write, only part of the message was
         transmitted.
      
      Handle both cases and keep track of how many bytes have been written in
      s->send_index.  (This includes the 'length' header before the actual
      payload buffer.)
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      45a7f54a
    • S
      net: EAGAIN handling for net/socket.c UDP · 213fd508
      Stefan Hajnoczi 提交于
      Implement asynchronous send for UDP (or other SOCK_DGRAM) sockets.  If
      send fails with EAGAIN we wait for the socket to become writable again.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      213fd508
    • S
      net: asynchronous send/receive infrastructure for net/socket.c · 863f678f
      Stefan Hajnoczi 提交于
      The net/socket.c net client is not truly asynchronous.  This patch
      borrows the qemu_set_fd_handler2() code from net/tap.c as the basis for
      proper asynchronous send/receive.
      
      Only read packets from the socket when the peer is able to receive.
      This avoids needless queuing.
      
      Later patches implement asynchronous send.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      863f678f
    • S
      net: broadcast hub packets if at least one port can receive · 61518a74
      Stefan Hajnoczi 提交于
      In commit 60c07d93 ("net: fix
      qemu_can_send_packet logic") the "VLAN" broadcast behavior was changed
      to queue packets if any net client cannot receive.  It turns out that
      this was not actually the right fix and just hides the real bug that
      hw/usb/dev-network.c:usbnet_receive() clobbers its receive buffer when
      called multiple times in a row.  The commit also introduced a new bug
      that "VLAN" packets would not be sent if one of multiple net clients was
      down.
      
      The hw/usb/dev-network.c bug has since been fixed, so this patch reverts
      broadcast behavior to send packets as long as one net client can
      receive.  Packets simply get queued for the net clients that are
      temporarily unable to receive.
      Reported-by: NRoy.Li <rongqing.li@windriver.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      61518a74
    • S
      net: do not report queued packets as sent · 06b5f36d
      Stefan Hajnoczi 提交于
      Net send functions have a return value where 0 means the packet has not
      been sent and will be queued.  A non-zero value means the packet was
      sent or an error caused the packet to be dropped.
      
      This patch fixes two instances where packets are queued but we return
      their size.  This causes callers to believe the packets were sent.  When
      the caller uses the async send interface this creates a real problem
      because the callback will be invoked for a packet that the caller
      believed to be already sent.  This bug can cause double-frees in the
      caller.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      06b5f36d
    • P
      net: notify iothread after flushing queue · 987a9b48
      Paolo Bonzini 提交于
      virtio-net has code to flush the queue and notify the iothread
      whenever new receive buffers are added by the guest.  That is
      fine, and indeed we need to do the same in all other drivers.
      However, notifying the iothread should be work for the network
      subsystem.  And since we are at it we can add a little smartness:
      if some of the queued packets already could not be delivered,
      there is no need to notify the iothread.
      Reported-by: NLuigi Rizzo <rizzo@iet.unipi.it>
      Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Cc: Jan Kiszka <jan.kiszka@siemens.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NAmos Kong <akong@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      987a9b48
  8. 07 9月, 2012 1 次提交
  9. 10 8月, 2012 1 次提交
  10. 01 8月, 2012 15 次提交
  11. 23 7月, 2012 9 次提交
  12. 09 7月, 2012 2 次提交