1. 21 1月, 2017 27 次提交
  2. 20 1月, 2017 7 次提交
  3. 19 1月, 2017 6 次提交
    • T
      net: Remove usage of net_device last_rx member · 4a7c9726
      Tobias Klauser 提交于
      The network stack no longer uses the last_rx member of struct net_device
      since the bonding driver switched to use its own private last_rx in
      commit 9f242738 ("bonding: use last_arp_rx in slave_last_rx()").
      
      However, some drivers still (ab)use the field for their own purposes and
      some driver just update it without actually using it.
      
      Previously, there was an accompanying comment for the last_rx member
      added in commit 4dc89133 ("net: add a comment on netdev->last_rx")
      which asked drivers not to update is, unless really needed. However,
      this commend was removed in commit f8ff080d ("bonding: remove
      useless updating of slave->dev->last_rx"), so some drivers added later
      on still did update last_rx.
      
      Remove all usage of last_rx and switch three drivers (sky2, atp and
      smc91c92_cs) which actually read and write it to use their own private
      copy in netdev_priv.
      
      Compile-tested with allyesconfig and allmodconfig on x86 and arm.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: Jay Vosburgh <j.vosburgh@gmail.com>
      Cc: Veaceslav Falico <vfalico@gmail.com>
      Cc: Andy Gospodarek <andy@greyhouse.net>
      Cc: Mirko Lindner <mlindner@marvell.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Reviewed-by: NJay Vosburgh <jay.vosburgh@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4a7c9726
    • V
      net: dsa: use cpu_switch instead of ds[0] · 9520ed8f
      Vivien Didelot 提交于
      Now that the DSA Ethernet switches are true Linux devices, the CPU
      switch is not necessarily the first one. If its address is higher than
      the second switch on the same MDIO bus, its index will be 1, not 0.
      
      Avoid any confusion by using dst->cpu_switch instead of dst->ds[0].
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9520ed8f
    • V
      net: dsa: store CPU switch structure in the tree · b22de490
      Vivien Didelot 提交于
      Store a dsa_switch pointer to the CPU switch in the tree instead of only
      its index. This avoids the need to initialize it to -1.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b22de490
    • I
      net: ethernet: ti: davinci_cpdma: correct check on NULL in set rate · e33c2ef1
      Ivan Khoronzhuk 提交于
      Check "ch" on NULL first, then get ctlr.
      Signed-off-by: NIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e33c2ef1
    • D
      Merge branch 'vhost_net-batching' · e3e37e70
      David S. Miller 提交于
      Jason Wang says:
      
      ====================
      vhost_net tx batching
      
      This series tries to implement tx batching support for vhost. This was
      done by using MSG_MORE as a hint for under layer socket. The backend
      (e.g tap) can then batch the packets temporarily in a list and
      submit it all once the number of bacthed exceeds a limitation.
      
      Tests shows obvious improvement on guest pktgen over over
      mlx4(noqueue) on host:
      
                                           Mpps  -+%
              rx-frames = 0                0.91  +0%
              rx-frames = 4                1.00  +9.8%
              rx-frames = 8                1.00  +9.8%
              rx-frames = 16               1.01  +10.9%
              rx-frames = 32               1.07  +17.5%
              rx-frames = 48               1.07  +17.5%
              rx-frames = 64               1.08  +18.6%
              rx-frames = 64 (no MSG_MORE) 0.91  +0%
      
      Changes from V4:
      - stick to NAPI_POLL_WEIGHT for rx-frames is user specify a value
        greater than it.
      Changes from V3:
      - use ethtool instead of module parameter to control the maximum
        number of batched packets
      - avoid overhead when MSG_MORE were not set and no packet queued
      Changes from V2:
      - remove uselss queue limitation check (and we don't drop any packet now)
      Changes from V1:
      - drop NAPI handler since we don't use NAPI now
      - fix the issues that may exceeds max pending of zerocopy
      - more improvement on available buffer detection
      - move the limitation of batched pacekts from vhost to tuntap
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3e37e70
    • J
      tun: rx batching · 5503fcec
      Jason Wang 提交于
      We can only process 1 packet at one time during sendmsg(). This often
      lead bad cache utilization under heavy load. So this patch tries to do
      some batching during rx before submitting them to host network
      stack. This is done through accepting MSG_MORE as a hint from
      sendmsg() caller, if it was set, batch the packet temporarily in a
      linked list and submit them all once MSG_MORE were cleared.
      
      Tests were done by pktgen (burst=128) in guest over mlx4(noqueue) on host:
      
                                       Mpps  -+%
          rx-frames = 0                0.91  +0%
          rx-frames = 4                1.00  +9.8%
          rx-frames = 8                1.00  +9.8%
          rx-frames = 16               1.01  +10.9%
          rx-frames = 32               1.07  +17.5%
          rx-frames = 48               1.07  +17.5%
          rx-frames = 64               1.08  +18.6%
          rx-frames = 64 (no MSG_MORE) 0.91  +0%
      
      User were allowed to change per device batched packets through
      ethtool -C rx-frames. NAPI_POLL_WEIGHT were used as upper limitation
      to prevent bh from being disabled too long.
      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>
      5503fcec