1. 19 1月, 2021 1 次提交
  2. 13 1月, 2021 1 次提交
  3. 01 12月, 2020 1 次提交
  4. 17 11月, 2020 1 次提交
  5. 28 9月, 2020 1 次提交
  6. 18 9月, 2020 1 次提交
  7. 23 4月, 2020 1 次提交
  8. 31 3月, 2020 1 次提交
  9. 24 2月, 2020 1 次提交
    • H
      hv_netvsc: Fix unwanted wakeup in netvsc_attach() · f6f13c12
      Haiyang Zhang 提交于
      When netvsc_attach() is called by operations like changing MTU, etc.,
      an extra wakeup may happen while netvsc_attach() calling
      rndis_filter_device_add() which sends rndis messages when queue is
      stopped in netvsc_detach(). The completion message will wake up queue 0.
      
      We can reproduce the issue by changing MTU etc., then the wake_queue
      counter from "ethtool -S" will increase beyond stop_queue counter:
           stop_queue: 0
           wake_queue: 1
      The issue causes queue wake up, and counter increment, no other ill
      effects in current code. So we didn't see any network problem for now.
      
      To fix this, initialize tx_disable to true, and set it to false when
      the NIC is ready to be attached or registered.
      
      Fixes: 7b2ee50c ("hv_netvsc: common detach logic")
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f6f13c12
  10. 25 1月, 2020 1 次提交
    • H
      hv_netvsc: Add XDP support · 351e1581
      Haiyang Zhang 提交于
      This patch adds support of XDP in native mode for hv_netvsc driver, and
      transparently sets the XDP program on the associated VF NIC as well.
      
      Setting / unsetting XDP program on synthetic NIC (netvsc) propagates to
      VF NIC automatically. Setting / unsetting XDP program on VF NIC directly
      is not recommended, also not propagated to synthetic NIC, and may be
      overwritten by setting of synthetic NIC.
      
      The Azure/Hyper-V synthetic NIC receive buffer doesn't provide headroom
      for XDP. We thought about re-use the RNDIS header space, but it's too
      small. So we decided to copy the packets to a page buffer for XDP. And,
      most of our VMs on Azure have Accelerated  Network (SRIOV) enabled, so
      most of the packets run on VF NIC. The synthetic NIC is considered as a
      fallback data-path. So the data copy on netvsc won't impact performance
      significantly.
      
      XDP program cannot run with LRO (RSC) enabled, so you need to disable LRO
      before running XDP:
              ethtool -K eth0 lro off
      
      XDP actions not yet supported:
              XDP_REDIRECT
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      351e1581
  11. 22 11月, 2019 2 次提交
    • H
      hv_netvsc: Fix send_table offset in case of a host bug · 171c1fd9
      Haiyang Zhang 提交于
      If negotiated NVSP version <= NVSP_PROTOCOL_VERSION_6, the offset may
      be wrong (too small) due to a host bug. This can cause missing the
      end of the send indirection table, and add multiple zero entries from
      leading zeros before the data region. This bug adds extra burden on
      channel 0.
      
      So fix the offset by computing it from the data structure sizes. This
      will ensure netvsc driver runs normally on unfixed hosts, and future
      fixed hosts.
      
      Fixes: 5b54dac8 ("hyperv: Add support for virtual Receive Side Scaling (vRSS)")
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      171c1fd9
    • H
      hv_netvsc: Fix offset usage in netvsc_send_table() · 71f21959
      Haiyang Zhang 提交于
      To reach the data region, the existing code adds offset in struct
      nvsp_5_send_indirect_table on the beginning of this struct. But the
      offset should be based on the beginning of its container,
      struct nvsp_message. This bug causes the first table entry missing,
      and adds an extra zero from the zero pad after the data region.
      This can put extra burden on the channel 0.
      
      So, correct the offset usage. Also add a boundary check to ensure
      not reading beyond data region.
      
      Fixes: 5b54dac8 ("hyperv: Add support for virtual Receive Side Scaling (vRSS)")
      Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71f21959
  12. 31 5月, 2019 1 次提交
  13. 04 5月, 2019 1 次提交
  14. 02 4月, 2019 1 次提交
    • F
      net: move skb->xmit_more hint to softnet data · 6b16f9ee
      Florian Westphal 提交于
      There are two reasons for this.
      
      First, the xmit_more flag conceptually doesn't fit into the skb, as
      xmit_more is not a property related to the skb.
      Its only a hint to the driver that the stack is about to transmit another
      packet immediately.
      
      Second, it was only done this way to not have to pass another argument
      to ndo_start_xmit().
      
      We can place xmit_more in the softnet data, next to the device recursion.
      The recursion counter is already written to on each transmit. The "more"
      indicator is placed right next to it.
      
      Drivers can use the netdev_xmit_more() helper instead of skb->xmit_more
      to check the "more packets coming" hint.
      
      skb->xmit_more is retained (but always 0) to not cause build breakage.
      
      This change takes care of the simple s/skb->xmit_more/netdev_xmit_more()/
      conversions.  Remaining drivers are converted in the next patches.
      Suggested-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6b16f9ee
  15. 30 3月, 2019 1 次提交
  16. 24 1月, 2019 2 次提交
  17. 23 9月, 2018 1 次提交
  18. 17 9月, 2018 1 次提交
  19. 19 7月, 2018 1 次提交
  20. 30 6月, 2018 1 次提交
  21. 28 4月, 2018 1 次提交
  22. 19 4月, 2018 2 次提交
  23. 06 4月, 2018 4 次提交
    • M
      hv_netvsc: Pass net_device parameter to revoke and teardown functions · 3f076eff
      Mohammed Gamal 提交于
      The callers to netvsc_revoke_*_buf() and netvsc_teardown_*_gpadl()
      already have their net_device instances. Pass them as a paramaeter to
      the function instead of obtaining them from netvsc_device struct
      everytime
      Signed-off-by: NMohammed Gamal <mgamal@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3f076eff
    • M
      hv_netvsc: Ensure correct teardown message sequence order · a56d99d7
      Mohammed Gamal 提交于
      Prior to commit 0cf73780 ("hv_netvsc: netvsc_teardown_gpadl() split")
      the call sequence in netvsc_device_remove() was as follows (as
      implemented in netvsc_destroy_buf()):
      1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message
      2- Teardown receive buffer GPADL
      3- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message
      4- Teardown send buffer GPADL
      5- Close vmbus
      
      This didn't work for WS2016 hosts. Commit 0cf73780
      ("hv_netvsc: netvsc_teardown_gpadl() split") rearranged the
      teardown sequence as follows:
      1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message
      2- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message
      3- Close vmbus
      4- Teardown receive buffer GPADL
      5- Teardown send buffer GPADL
      
      That worked well for WS2016 hosts, but it prevented guests on older hosts from
      shutting down after changing network settings. Commit 0ef58b0a
      ("hv_netvsc: change GPAD teardown order on older versions") ensured the
      following message sequence for older hosts
      1- Send NVSP_MSG1_TYPE_REVOKE_RECV_BUF message
      2- Send NVSP_MSG1_TYPE_REVOKE_SEND_BUF message
      3- Teardown receive buffer GPADL
      4- Teardown send buffer GPADL
      5- Close vmbus
      
      However, with this sequence calling `ip link set eth0 mtu 1000` hangs and the
      process becomes uninterruptible. On futher analysis it turns out that on tearing
      down the receive buffer GPADL the kernel is waiting indefinitely
      in vmbus_teardown_gpadl() for a completion to be signaled.
      
      Here is a snippet of where this occurs:
      int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
      {
              struct vmbus_channel_gpadl_teardown *msg;
              struct vmbus_channel_msginfo *info;
              unsigned long flags;
              int ret;
      
              info = kmalloc(sizeof(*info) +
                             sizeof(struct vmbus_channel_gpadl_teardown), GFP_KERNEL);
              if (!info)
                      return -ENOMEM;
      
              init_completion(&info->waitevent);
              info->waiting_channel = channel;
      [....]
              ret = vmbus_post_msg(msg, sizeof(struct vmbus_channel_gpadl_teardown),
                                   true);
      
              if (ret)
                      goto post_msg_err;
      
              wait_for_completion(&info->waitevent);
      [....]
      }
      
      The completion is signaled from vmbus_ongpadl_torndown(), which gets called when
      the corresponding message is received from the host, which apparently never happens
      in that case.
      This patch works around the issue by restoring the first mentioned message sequence
      for older hosts
      
      Fixes: 0ef58b0a ("hv_netvsc: change GPAD teardown order on older versions")
      Signed-off-by: NMohammed Gamal <mgamal@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a56d99d7
    • M
      hv_netvsc: Split netvsc_revoke_buf() and netvsc_teardown_gpadl() · 7992894c
      Mohammed Gamal 提交于
      Split each of the functions into two for each of send/recv buffers.
      This will be needed in order to implement a fine-grained messaging
      sequence to the host so that we accommodate the requirements of
      different Windows versions
      
      Fixes: 0ef58b0a ("hv_netvsc: change GPAD teardown order on older versions")
      Signed-off-by: NMohammed Gamal <mgamal@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7992894c
    • M
      hv_netvsc: Use Windows version instead of NVSP version on GPAD teardown · 2afc5d61
      Mohammed Gamal 提交于
      When changing network interface settings, Windows guests
      older than WS2016 can no longer shutdown. This was addressed
      by commit 0ef58b0a ("hv_netvsc: change GPAD teardown order
      on older versions"), however the issue also occurs on WS2012
      guests that share NVSP protocol versions with WS2016 guests.
      Hence we use Windows version directly to differentiate them.
      
      Fixes: 0ef58b0a ("hv_netvsc: change GPAD teardown order on older versions")
      Signed-off-by: NMohammed Gamal <mgamal@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2afc5d61
  24. 26 3月, 2018 2 次提交
  25. 23 3月, 2018 4 次提交
  26. 18 3月, 2018 1 次提交
  27. 05 3月, 2018 4 次提交