1. 16 8月, 2016 4 次提交
  2. 26 7月, 2016 1 次提交
  3. 09 7月, 2016 1 次提交
  4. 10 6月, 2016 1 次提交
    • V
      netvsc: get rid of completion timeouts · 5362855a
      Vitaly Kuznetsov 提交于
      I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting
      RSS parameters for the device. When this happens we end up returning
      -ETIMEDOUT from the function and rndis_filter_device_add() falls back to
      setting
      
              net_device->max_chn = 1;
              net_device->num_chn = 1;
              net_device->num_sc_offered = 0;
      
      but after a moment the rndis request succeeds and subchannels start to
      appear. netvsc_sc_open() does unconditional nvscdev->num_sc_offered-- and
      it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang
      while waiting for all U32_MAX-1 subchannels to appear and this is not
      going to happen.
      
      The immediate issue could be solved by adding num_sc_offered > 0 check to
      netvsc_sc_open() but we're getting out of sync with the host and it's not
      easy to adjust things later, e.g. in this particular case we'll be creating
      queues without a user request for it and races are expected. Same applies
      to other parts of the driver which have the same completion timeout.
      
      Following the trend in drivers/hv/* code I suggest we remove all these
      timeouts completely. As a guest we can always trust the host we're running
      on and if the host screws things up there is no easy way to recover anyway.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Acked-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5362855a
  5. 06 6月, 2016 5 次提交
  6. 04 6月, 2016 1 次提交
  7. 17 5月, 2016 6 次提交
    • V
      hv_netvsc: set nvdev link after populating chn_table · 88098834
      Vitaly Kuznetsov 提交于
      Crash in netvsc_send() is observed when netvsc device is re-created on
      mtu change/set channels. The crash is caused by dereferencing of NULL
      channel pointer which comes from chn_table. The root cause is a mixture
      of two facts:
      - we set nvdev pointer in net_device_context in alloc_net_device()
        before we populate chn_table.
      - we populate chn_table[0] only.
      
      The issue could be papered over by checking channel != NULL in
      netvsc_send() but populating the whole chn_table and writing the
      nvdev pointer afterwards seems more appropriate.
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88098834
    • 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
  8. 25 4月, 2016 1 次提交
  9. 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
  10. 24 3月, 2016 3 次提交
  11. 08 3月, 2016 1 次提交
  12. 01 3月, 2016 1 次提交
  13. 20 2月, 2016 1 次提交
  14. 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
  15. 11 2月, 2016 1 次提交
  16. 26 1月, 2016 2 次提交
  17. 14 12月, 2015 1 次提交
  18. 03 12月, 2015 8 次提交