1. 12 6月, 2015 1 次提交
    • F
      net/socket: Drop net_socket_can_send · 6e99c631
      Fam Zheng 提交于
      This callback is called by main loop before polling s->fd, if it returns
      false, the fd will not be polled in this iteration.
      
      This is redundant with checks inside read callback. After this patch,
      the data will be sent to peer when it arrives. If the device can't
      receive, it will be queued to incoming_queue, and when the device status
      changes, this queue will be flushed.
      
      If the peer is not ready, disable the read poll until send completes.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 1433400324-7358-6-git-send-email-famz@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      6e99c631
  2. 27 5月, 2015 1 次提交
    • M
      net: Permit incremental conversion of init functions to Error · a30ecde6
      Markus Armbruster 提交于
      Error reporting for netdev_add is broken: the net_client_init_fun[]
      report the actual errors with (at best) error_report(), and their
      caller net_client_init1() makes up a generic error on top.
      
      For command line and HMP, this produces an mildly ugly error cascade.
      
      In QMP, the actual errors go to stderr, and the generic error becomes
      the command's error reply.
      
      To fix this, we need to convert the net_client_init_fun[] to Error.
      
      To permit fixing them one by one, add an Error ** parameter to the
      net_client_init_fun[].  If the call fails without returning an Error,
      make up the same generic Error as before.  But if it returns one, use
      that instead.  Since none of them does so far, no functional change.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1431691143-1015-3-git-send-email-armbru@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a30ecde6
  3. 18 2月, 2015 1 次提交
    • M
      monitor: Clean up around monitor_handle_fd_param() · 1677f4c6
      Markus Armbruster 提交于
      monitor_handle_fd_param() is a wrapper around
      monitor_handle_fd_param2() that feeds errors to qerror_report_err()
      instead of returning them.  qerror_report_err() is inappropriate in
      many contexts.  monitor_handle_fd_param() looks simpler than
      monitor_handle_fd_param2(), which tempts use.  Remove the temptation:
      drop the wrapper and open-code the (trivial) error handling instead.
      
      Replace the open-coded qerror_report_err() by error_report_err() in
      places that already use error_report().  Turns out that's everywhere.
      
      While there, rename monitor_handle_fd_param2() to monitor_fd_param().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1677f4c6
  4. 21 11月, 2014 1 次提交
  5. 18 11月, 2014 1 次提交
  6. 03 10月, 2013 1 次提交
  7. 23 8月, 2013 1 次提交
  8. 02 4月, 2013 2 次提交
  9. 25 3月, 2013 2 次提交
    • S
      net: increase buffer size to accommodate Jumbo frame pkts · d32fcad3
      Scott Feldman 提交于
      Socket buffer sizes were hard-coded to 4K for VDE and socket netdevs.  Bump this
      up to 68K (ala tap netdev) to handle maximum GSO packet size (64k) plus plenty
      of room for the ethernet and virtio_net headers.
      
      Originally, ran into this limitation when using -netdev UDP sockets to connect
      VM-to-VM, where VM interface is configure with MTU=9000.  (Using virtio_net
      NIC model).  Test is simple: ping -M do -s 8500 <target>.  This test will
      attempt to ping with unfragmented packet of given size.  Without patch, size
      is limited to < 4K (minus protocol hdrs).  With patch, ping test works with pkt
      size up to 9000 (again, minus protocol hdrs).
      
      v2: per Stefan, increase buf size to (4096+65536) as done in tap and apply
          to vde and socket netdevs.
      v1: increase buf size to 12K just for -netdev UDP sockets
      Signed-off-by: NScott Feldman <sfeldma@cumulusnetworks.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      d32fcad3
    • S
      net: use socket_set_nodelay() for -netdev socket · 20048d0a
      Stefan Hajnoczi 提交于
      Reduce -netdev socket latency by disabling the Nagle algorithm on
      SOCK_STREAM sockets in net/socket.c.  Since we are tunelling Ethernet
      over TCP we shouldn't artificially delay outgoing packets, let the guest
      decide packet scheduling.
      
      I already get sub-millisecond -netdev socket ping times on localhost, so
      there was no measurable difference in my testing.  This won't hurt
      though and may improve remote socket performance.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NDaniel P. Berrange <berrange@redhat.com>
      20048d0a
  10. 22 3月, 2013 1 次提交
  11. 19 12月, 2012 4 次提交
  12. 01 11月, 2012 1 次提交
  13. 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
  14. 23 9月, 2012 1 次提交
  15. 14 9月, 2012 3 次提交
  16. 07 9月, 2012 1 次提交
  17. 01 8月, 2012 5 次提交
  18. 23 7月, 2012 4 次提交
    • L
      remove unused QemuOpts parameter from net init functions · 1a0c0958
      Laszlo Ersek 提交于
      v1->v2:
      - unchanged
      
      v2->v3:
      - keep "qemu-option.h" included in "net/slirp.h"
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      1a0c0958
    • L
      convert net_init_socket() to NetClientOptions · bef8e8fe
      Laszlo Ersek 提交于
      I "reverse engineered" the following permissions between the -socket
      sub-options:
      
                   fd  listen  connect  mcast  udp | localaddr
        fd         x   .       .        .      .   | .
        listen     .   x       .        .      .   | .
        connect    .   .       x        .      .   | .
        mcast      .   .       .        x      .   | x
        udp        .   .       .        .      x   | x
        -------------------------------------------+
        localaddr  .   .       .        x      x     x
      
      I transformed the code accordingly. The real fix would be to embed "fd",
      "listen", "connect", "mcast" and "udp" in a separate union. However
      OptsVisitor's enum parser only supports the type=XXX QemuOpt instance as
      union discriminator.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      bef8e8fe
    • L
      convert net_client_init() to OptsVisitor · 6687b79d
      Laszlo Ersek 提交于
      The net_client_init() prototype is kept intact.
      
      Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
      Netdev or a NetLegacy. The original meat of net_client_init() is moved to
      and simplified in net_client_init1():
      
      Fields not common between -net and -netdev are clearly separated. Getting
      the name for the init functions is cleaner: Netdev::id is mandatory, and
      all init functions handle a NULL NetLegacy::name. NetLegacy::vlan
      explicitly depends on -net (see below).
      
      Verifying the "type=" option for -netdev can be turned into a switch.
      
      Format validation with qemu_opts_validate() can be removed because the
      visitor covers it. Relatedly, the "net_client_types" array is reduced to
      an array of init functions that can be directly indexed by opts->kind.
      (Help text is available in the schema JSON.)
      
      The outermost negation in the condition around qemu_find_vlan() was
      flattened, because it expresses the dependent code's requirements more
      clearly.
      
      VLAN lookup is avoided if there's no init function to pass the VLAN to.
      
      Whenever the value of type=... is needed, we substitute
      NetClientOptionsKind_lookup[kind].
      
      The individual init functions are not converted yet, thus the original
      QemuOpts instance is passed transparently.
      
      v1->v2:
      - NetLegacy::name is optional. Tracked it through all init functions: they
        all handle a NULL name. Updated commit message accordingly.
      
      v2->v3:
      - NetLegacy::id is allowed and takes precedence over NetLegacy::name.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      6687b79d
    • L
      hw, net: "net_client_type" -> "NetClientOptionsKind" (qapi-generated) · 2be64a68
      Laszlo Ersek 提交于
      NET_CLIENT_TYPE_ -> NET_CLIENT_OPTIONS_KIND_
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      2be64a68
  19. 05 6月, 2012 1 次提交
  20. 10 2月, 2012 1 次提交
  21. 13 1月, 2012 1 次提交
  22. 06 1月, 2012 1 次提交
  23. 13 12月, 2011 2 次提交
  24. 06 12月, 2011 1 次提交
  25. 21 8月, 2011 1 次提交