1. 30 10月, 2016 1 次提交
  2. 27 10月, 2016 1 次提交
    • S
      netvsc: fix incorrect receive checksum offloading · e52fed71
      Stephen Hemminger 提交于
      The Hyper-V netvsc driver was looking at the incorrect status bits
      in the checksum info. It was setting the receive checksum unnecessary
      flag based on the IP header checksum being correct. The checksum
      flag is skb is about TCP and UDP checksum status. Because of this
      bug, any packet received with bad TCP checksum would be passed
      up the stack and to the application causing data corruption.
      The problem is reproducible via netcat and netem.
      
      This had a side effect of not doing receive checksum offload
      on IPv6. The driver was also also always doing checksum offload
      independent of the checksum setting done via ethtool.
      Signed-off-by: NStephen Hemminger <sthemmin@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e52fed71
  3. 19 10月, 2016 1 次提交
    • A
      net/hyperv: avoid uninitialized variable · 52ccd631
      Arnd Bergmann 提交于
      The hdr_offset variable is only if we deal with a TCP or UDP packet,
      but as the check surrounding its usage tests for skb_is_gso()
      instead, the compiler has no idea if the variable is initialized
      or not at that point:
      
      drivers/net/hyperv/netvsc_drv.c: In function ‘netvsc_start_xmit’:
      drivers/net/hyperv/netvsc_drv.c:494:42: error: ‘hdr_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This adds an additional check for the transport type, which
      tells the compiler that this path cannot happen. Since the
      get_net_transport_info() function should always be inlined
      here, I don't expect this to result in additional runtime
      checks.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      52ccd631
  4. 13 10月, 2016 2 次提交
  5. 23 9月, 2016 6 次提交
  6. 24 8月, 2016 5 次提交
  7. 16 8月, 2016 5 次提交
  8. 09 8月, 2016 2 次提交
  9. 26 7月, 2016 1 次提交
  10. 06 6月, 2016 3 次提交
  11. 04 6月, 2016 1 次提交
  12. 17 5月, 2016 5 次提交
    • V
      hv_netvsc: synchronize netvsc_change_mtu()/netvsc_set_channels() with netvsc_remove() · 6da7225f
      Vitaly Kuznetsov 提交于
      When netvsc device is removed during mtu change or channels setup we get
      into troubles as both paths are trying to remove the device. Synchronize
      them with start_remove flag and rtnl lock.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6da7225f
    • V
      hv_netvsc: get rid of struct net_device pointer in struct netvsc_device · 0a1275ca
      Vitaly Kuznetsov 提交于
      Simplify netvsvc pointer graph by getting rid of the redundant ndev
      pointer. We can always get a pointer to struct net_device from somewhere
      else.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0a1275ca
    • V
      hv_netvsc: untangle the pointer mess · 3d541ac5
      Vitaly Kuznetsov 提交于
      We have the following structures keeping netvsc adapter state:
      - struct net_device
      - struct net_device_context
      - struct netvsc_device
      - struct rndis_device
      - struct hv_device
      and there are pointers/dependencies between them:
      - struct net_device_context is contained in struct net_device
      - struct hv_device has driver_data pointer which points to
        'struct net_device' OR 'struct netvsc_device' depending on driver's
        state (!).
      - struct net_device_context has a pointer to 'struct hv_device'.
      - struct netvsc_device has pointers to 'struct hv_device' and
        'struct net_device_context'.
      - struct rndis_device has a pointer to 'struct netvsc_device'.
      
      Different functions get different structures as parameters and use these
      pointers for traveling. The problem is (in addition to keeping in mind
      this complex graph) that some of these structures (struct netvsc_device
      and struct rndis_device) are being removed and re-created on mtu change
      (as we implement it as re-creation of hyper-v device) so our travel using
      these pointers is dangerous.
      
      Simplify this to a the following:
      - add struct netvsc_device pointer to struct net_device_context (which is
        a part of struct net_device and thus never disappears)
      - remove struct hv_device and struct net_device_context pointers from
        struct netvsc_device
      - replace pointer to 'struct netvsc_device' with pointer to
        'struct net_device'.
      - always keep 'struct net_device' in hv_device driver_data.
      
      We'll end up with the following 'circular' structure:
      
      net_device:
       [net_device_context] -> netvsc_device -> rndis_device -> net_device
                            -> hv_device -> net_device
      
      On MTU change we'll be removing the 'netvsc_device -> rndis_device'
      branch and re-creating it making the synchronization easier.
      
      There is one additional redundant pointer left, it is struct net_device
      link in struct netvsc_device, it is going to be removed in a separate
      commit.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3d541ac5
    • V
      hv_netvsc: use start_remove flag to protect netvsc_link_change() · 1bdcec8a
      Vitaly Kuznetsov 提交于
      netvsc_link_change() can race with netvsc_change_mtu() or
      netvsc_set_channels() as these functions destroy struct netvsc_device and
      rndis filter. Use start_remove flag for syncronization. As
      netvsc_change_mtu()/netvsc_set_channels() are called with rtnl lock held
      we need to take it before checking start_remove value in
      netvsc_link_change().
      Reported-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1bdcec8a
    • V
      hv_netvsc: move start_remove flag to net_device_context · f580aec4
      Vitaly Kuznetsov 提交于
      struct netvsc_device is destroyed on mtu change so keeping the
      protection flag there is not a good idea. Move it to struct
      net_device_context which is preserved.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f580aec4
  13. 25 4月, 2016 1 次提交
  14. 19 4月, 2016 1 次提交
    • K
      hv_netvsc: Implement support for VF drivers on Hyper-V · 84bf9cef
      KY Srinivasan 提交于
      Support VF drivers on Hyper-V. On Hyper-V, each VF instance presented to
      the guest has an associated synthetic interface that shares the MAC address
      with the VF instance. Typically these are bonded together to support
      live migration. By default, the host delivers all the incoming packets
      on the synthetic interface. Once the VF is up, we need to explicitly switch
      the data path on the host to divert traffic onto the VF interface. Even after
      switching the data path, broadcast and multicast packets are always delivered
      on the synthetic interface and these will have to be injected back onto the
      VF interface (if VF is up).
      This patch implements the necessary support in netvsc to support Linux
      VF drivers.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      84bf9cef
  15. 24 3月, 2016 1 次提交
  16. 01 3月, 2016 1 次提交
  17. 20 2月, 2016 1 次提交
  18. 13 2月, 2016 1 次提交
    • V
      hv_netvsc: Restore needed_headroom request · 14a03cf8
      Vitaly Kuznetsov 提交于
      Commit c0eb4540 ("hv_netvsc: Don't ask for additional head room in the
      skb") got rid of needed_headroom setting for the driver. With the change I
      hit the following issue trying to use ptkgen module:
      
      [   57.522021] kernel BUG at net/core/skbuff.c:1128!
      [   57.522021] invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC
      ...
      [   58.721068] Call Trace:
      [   58.721068]  [<ffffffffa0144e86>] netvsc_start_xmit+0x4c6/0x8e0 [hv_netvsc]
      ...
      [   58.721068]  [<ffffffffa02f87fc>] ? pktgen_finalize_skb+0x25c/0x2a0 [pktgen]
      [   58.721068]  [<ffffffff814f5760>] ? __netdev_alloc_skb+0xc0/0x100
      [   58.721068]  [<ffffffffa02f9907>] pktgen_thread_worker+0x257/0x1920 [pktgen]
      
      Basically, we're calling skb_cow_head(skb, RNDIS_AND_PPI_SIZE) and crash on
          if (skb_shared(skb))
              BUG();
      
      We probably need to restore needed_headroom setting (but shrunk to
      RNDIS_AND_PPI_SIZE as we don't need more) to request the required headroom
      space. In theory, it should not give us performance penalty.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14a03cf8
  19. 11 2月, 2016 1 次提交