1. 25 1月, 2017 5 次提交
  2. 30 11月, 2016 1 次提交
  3. 21 10月, 2016 1 次提交
    • V
      hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() · e8f0a89c
      Vitaly Kuznetsov 提交于
      Fix in commit 88098834 ("hv_netvsc: set nvdev link after populating
      chn_table") turns out to be incomplete. A crash in
      netvsc_get_next_send_section() is observed on mtu change when the device
      is under load. The race I identified is: if we get to netvsc_send() after
      we set net_device_ctx->nvdev link in netvsc_device_add() but before we
      finish netvsc_connect_vsp()->netvsc_init_buf() send_section_map is not
      allocated and we crash. Unfortunately we can't set net_device_ctx->nvdev
      link after the netvsc_init_buf() call as during the negotiation we need
      to receive packets and on the receive path we check for it. It would
      probably be possible to split nvdev into a pair of nvdev_in and nvdev_out
      links and check them accordingly in get_outbound_net_device()/
      get_inbound_net_device() but this looks like an overkill.
      
      Check that send_section_map is allocated in netvsc_send().
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8f0a89c
  4. 23 9月, 2016 1 次提交
  5. 11 9月, 2016 1 次提交
  6. 24 8月, 2016 9 次提交
  7. 20 8月, 2016 1 次提交
  8. 16 8月, 2016 1 次提交
  9. 09 8月, 2016 1 次提交
  10. 09 7月, 2016 1 次提交
  11. 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
  12. 06 6月, 2016 1 次提交
  13. 17 5月, 2016 4 次提交
    • 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: 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: 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
  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. 26 1月, 2016 1 次提交
  16. 14 12月, 2015 1 次提交
  17. 03 12月, 2015 9 次提交