1. 18 10月, 2013 2 次提交
  2. 04 9月, 2013 1 次提交
  3. 28 7月, 2013 1 次提交
  4. 10 7月, 2013 1 次提交
    • M
      virtio_net: fix race in RX VQ processing · cbdadbbf
      Michael S. Tsirkin 提交于
      virtio net called virtqueue_enable_cq on RX path after napi_complete, so
      with NAPI_STATE_SCHED clear - outside the implicit napi lock.
      This violates the requirement to synchronize virtqueue_enable_cq wrt
      virtqueue_add_buf.  In particular, used event can move backwards,
      causing us to lose interrupts.
      In a debug build, this can trigger panic within START_USE.
      
      Jason Wang reports that he can trigger the races artificially,
      by adding udelay() in virtqueue_enable_cb() after virtio_mb().
      
      However, we must call napi_complete to clear NAPI_STATE_SCHED before
      polling the virtqueue for used buffers, otherwise napi_schedule_prep in
      a callback will fail, causing us to lose RX events.
      
      To fix, call virtqueue_enable_cb_prepare with NAPI_STATE_SCHED
      set (under napi lock), later call virtqueue_poll with
      NAPI_STATE_SCHED clear (outside the lock).
      Reported-by: NJason Wang <jasowang@redhat.com>
      Tested-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cbdadbbf
  5. 04 7月, 2013 1 次提交
    • J
      virtio-net: fix the race between channels setting and refill · 9b9cd802
      Jason Wang 提交于
      Commit 55257d72 (virtio-net: fill only rx queues
      which are being used) tries to refill on demand when changing the number of
      channels by call try_refill_recv() directly, this may race:
      
      - the refill work who may do the refill in the same time
      - the try_refill_recv() called in bh since napi was not disabled
      
      Which may led guest complain during setting channels:
      
      virtio_net virtio0: input.1:id 0 is not a head!
      
      Solve this issue by scheduling a refill work which can guarantee the
      serialization of refill.
      
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      9b9cd802
  6. 23 5月, 2013 1 次提交
  7. 12 5月, 2013 1 次提交
  8. 29 4月, 2013 1 次提交
    • S
      virtio-net: fill only rx queues which are being used · 55257d72
      Sasha Levin 提交于
      Due to MQ support we may allocate a whole bunch of rx queues but
      never use them. With this patch we'll safe the space used by
      the receive buffers until they are actually in use:
      
      sh-4.2# free -h
                   total       used       free     shared    buffers     cached
      Mem:          490M        35M       455M         0B         0B       4.1M
      -/+ buffers/cache:        31M       459M
      Swap:           0B         0B         0B
      sh-4.2# ethtool -L eth0 combined 8
      sh-4.2# free -h
                   total       used       free     shared    buffers     cached
      Mem:          490M       162M       327M         0B         0B       4.1M
      -/+ buffers/cache:       158M       331M
      Swap:           0B         0B         0B
      Signed-off-by: NSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      55257d72
  9. 20 4月, 2013 2 次提交
  10. 12 4月, 2013 1 次提交
    • J
      virtio-net: initialize vlan_features · 4fda8302
      Jason Wang 提交于
      There's nothing that prevent passing the device features of virtio_net to its
      vlan device. So this patch simply passes those to vlan device to benefit from
      advanced features.
      
      Netperf shows better sending performance for vlan device since TSO can work on
      vlan now.
      
      before:
      netperf -H 192.168.5.2
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.2 ()
      port 0 AF_INET : demo
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    4162.35
      
      after:
      netperf -H 192.168.5.2
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.2 ()
      port 0 AF_INET : demo
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    9365.42
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4fda8302
  11. 22 3月, 2013 1 次提交
  12. 20 3月, 2013 2 次提交
  13. 14 2月, 2013 1 次提交
    • P
      net: Fix possible wrong checksum generation. · c9af6db4
      Pravin B Shelar 提交于
      Patch cef401de (net: fix possible wrong checksum
      generation) fixed wrong checksum calculation but it broke TSO by
      defining new GSO type but not a netdev feature for that type.
      net_gso_ok() would not allow hardware checksum/segmentation
      offload of such packets without the feature.
      
      Following patch fixes TSO and wrong checksum. This patch uses
      same logic that Eric Dumazet used. Patch introduces new flag
      SKBTX_SHARED_FRAG if at least one frag can be modified by
      the user. but SKBTX_SHARED_FRAG flag is kept in skb shared
      info tx_flags rather than gso_type.
      
      tx_flags is better compared to gso_type since we can have skb with
      shared frag without gso packet. It does not link SHARED_FRAG to
      GSO, So there is no need to define netdev feature for this.
      Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9af6db4
  14. 13 2月, 2013 1 次提交
  15. 05 2月, 2013 1 次提交
  16. 28 1月, 2013 1 次提交
    • E
      net: fix possible wrong checksum generation · cef401de
      Eric Dumazet 提交于
      Pravin Shelar mentioned that GSO could potentially generate
      wrong TX checksum if skb has fragments that are overwritten
      by the user between the checksum computation and transmit.
      
      He suggested to linearize skbs but this extra copy can be
      avoided for normal tcp skbs cooked by tcp_sendmsg().
      
      This patch introduces a new SKB_GSO_SHARED_FRAG flag, set
      in skb_shinfo(skb)->gso_type if at least one frag can be
      modified by the user.
      
      Typical sources of such possible overwrites are {vm}splice(),
      sendfile(), and macvtap/tun/virtio_net drivers.
      
      Tested:
      
      $ netperf -H 7.7.8.84
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      7.7.8.84 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3959.52
      
      $ netperf -H 7.7.8.84 -t TCP_SENDFILE
      TCP SENDFILE TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 7.7.8.84 ()
      port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    3216.80
      
      Performance of the SENDFILE is impacted by the extra allocation and
      copy, and because we use order-0 pages, while the TCP_STREAM uses
      bigger pages.
      Reported-by: NPravin Shelar <pshelar@nicira.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cef401de
  17. 27 1月, 2013 3 次提交
  18. 22 1月, 2013 2 次提交
  19. 18 12月, 2012 4 次提交
  20. 11 12月, 2012 1 次提交
  21. 09 12月, 2012 3 次提交
  22. 04 12月, 2012 1 次提交
  23. 10 11月, 2012 1 次提交
  24. 21 8月, 2012 1 次提交
    • T
      workqueue: deprecate system_nrt[_freezable]_wq · 3b07e9ca
      Tejun Heo 提交于
      system_nrt[_freezable]_wq are now spurious.  Mark them deprecated and
      convert all users to system[_freezable]_wq.
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant, so there's no reason to use system_nrt[_freezable]_wq.
      Please use system[_freezable]_wq instead.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-By: NLai Jiangshan <laijs@cn.fujitsu.com>
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      3b07e9ca
  25. 15 8月, 2012 1 次提交
  26. 23 7月, 2012 1 次提交
  27. 30 6月, 2012 1 次提交
  28. 28 6月, 2012 1 次提交
  29. 11 6月, 2012 1 次提交