1. 02 4月, 2013 2 次提交
  2. 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
  3. 22 3月, 2013 1 次提交
  4. 19 12月, 2012 4 次提交
  5. 01 11月, 2012 1 次提交
  6. 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
  7. 23 9月, 2012 1 次提交
  8. 14 9月, 2012 3 次提交
  9. 07 9月, 2012 1 次提交
  10. 01 8月, 2012 5 次提交
  11. 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
  12. 05 6月, 2012 1 次提交
  13. 10 2月, 2012 1 次提交
  14. 13 1月, 2012 1 次提交
  15. 06 1月, 2012 1 次提交
  16. 13 12月, 2011 2 次提交
  17. 06 12月, 2011 1 次提交
  18. 21 8月, 2011 1 次提交
  19. 07 8月, 2011 1 次提交
    • B
      Fix forcing multicast msgs to loopback on OpenBSD. · 23ddf2bb
      Brad 提交于
      Fix forcing multicast msgs to loopback on OpenBSD.
      e.g.
      $ sudo qemu -m 128 -no-fd-bootchk \
              -hda virtual.img -boot n -nographic \
              -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:34:03 \
              -net user -tftp /usr/src/sys/arch/i386/compile/TEST -bootp pxeboot \
              -net nic,vlan=1,model=rtl8139,macaddr=52:54:00:23:03:01 \
              -net tap,vlan=1,script=no \
              -net nic,vlan=3,model=rtl8139,macaddr=52:54:00:23:03:03 \
              -net socket,vlan=3,mcast=230.0.0.1:10003
      setsockopt(SOL_IP, IP_MULTICAST_LOOP): Invalid argument
      qemu: -net socket,vlan=3,mcast=230.0.0.1:10003: Device 'socket' could not be initialized
      Signed-off-by: NBrad Smith <brad@comstyle.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      23ddf2bb
  20. 25 7月, 2011 1 次提交
    • B
      Wrap recv to avoid warnings · 00aa0040
      Blue Swirl 提交于
      Avoid warnings like these by wrapping recv():
        CC    slirp/ip_icmp.o
      /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
      /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]
      /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *'
      
      Remove also casts used to avoid warnings.
      Reviewed-by: NAnthony Liguori <aliguori@us.ibm.com>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      00aa0040
  21. 24 6月, 2011 1 次提交
  22. 25 2月, 2011 1 次提交
  23. 18 12月, 2010 1 次提交
    • B
      Fix warning on mingw32 · 4d22c6c2
      Blue Swirl 提交于
      Avoid this warning like other uses of setsockopt:
      /src/qemu/net/socket.c: In function 'net_socket_mcast_create':
      /src/qemu/net/socket.c:210: warning: passing argument 4 of 'setsockopt' from incompatible pointer type
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      4d22c6c2
  24. 09 12月, 2010 1 次提交
    • M
      net/sock: option to specify local address · 3a75e74c
      Mike Ryan 提交于
      Add an option to specify the host IP to send multicast packets from,
      when using a multicast socket for networking. The option takes an IP
      address and sets the IP_MULTICAST_IF socket option, which causes the
      packets to use that IP's interface as an egress.
      
      This is useful if the host machine has several interfaces with several
      virtual networks across disparate interfaces.
      Signed-off-by: NMike Ryan <mikeryan@ISI.EDU>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      3a75e74c
  25. 16 3月, 2010 1 次提交
    • M
      error: Replace qemu_error() by error_report() · 1ecda02b
      Markus Armbruster 提交于
      error_report() terminates the message with a newline.  Strip it it
      from its arguments.
      
      This fixes a few error messages lacking a newline:
      net_handle_fd_param()'s "No file descriptor named %s found", and
      tap_open()'s "vnet_hdr=1 requested, but no kernel support for
      IFF_VNET_HDR available" (all three versions).
      
      There's one place that passes arguments without newlines
      intentionally: load_vmstate().  Fix it up.
      1ecda02b