1. 16 8月, 2016 4 次提交
  2. 26 7月, 2016 1 次提交
  3. 06 6月, 2016 3 次提交
  4. 04 6月, 2016 1 次提交
  5. 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
  6. 25 4月, 2016 1 次提交
  7. 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
  8. 24 3月, 2016 1 次提交
  9. 01 3月, 2016 1 次提交
  10. 20 2月, 2016 1 次提交
  11. 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
  12. 11 2月, 2016 1 次提交
  13. 26 1月, 2016 1 次提交
  14. 03 12月, 2015 14 次提交
  15. 02 12月, 2015 1 次提交
    • V
      hv_netvsc: rework link status change handling · 27a70af3
      Vitaly Kuznetsov 提交于
      There are several issues in hv_netvsc driver with regards to link status
      change handling:
      - RNDIS_STATUS_NETWORK_CHANGE results in calling userspace helper doing
        '/etc/init.d/network restart' and this is inappropriate and broken for
        many reasons.
      - link_watch infrastructure only sends one notification per second and
        in case of e.g. paired disconnect/connect events we get only one
        notification with last status. This makes it impossible to handle such
        situations in userspace.
      
      Redo link status changes handling in the following way:
      - Create a list of reconfig events in network device context.
      - On a reconfig event add it to the list of events and schedule
        netvsc_link_change().
      - In netvsc_link_change() ensure 2-second delay between link status
        changes.
      - Handle RNDIS_STATUS_NETWORK_CHANGE as a paired disconnect/connect event.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27a70af3
  16. 02 9月, 2015 1 次提交
  17. 19 8月, 2015 1 次提交
  18. 13 8月, 2015 1 次提交