Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:27 +0200
commitd1f8c37317e60091468a74141bd69ab97d2b9850 (patch)
tree984eed2667a959bd3eff2cb827d7a2b009efcc16
parent17db1c5b512ba042515271cbc2a34a556e981bd6 (diff)
netvsc: keep track of some non-fatal overload conditions
-rw-r--r--patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch104
-rw-r--r--series.conf1
2 files changed, 105 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch b/patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch
new file mode 100644
index 0000000000..48818b8cf1
--- /dev/null
+++ b/patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch
@@ -0,0 +1,104 @@
+From: stephen hemminger <stephen@networkplumber.org>
+Date: Wed, 9 Aug 2017 17:46:12 -0700
+Patch-mainline: v4.14-rc1
+Subject: netvsc: keep track of some non-fatal overload conditions
+Git-commit: cad5c197704d82faf33ffdbef414f15db08d9ef9
+References: fate#323887
+
+Add ethtool statistics for case where send chimmeny buffer is
+exhausted and driver has to fall back to doing scatter/gather
+send. Also, add statistic for case where ring buffer is full and
+receive completions are delayed.
+
+Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/net/hyperv/hyperv_net.h | 2 ++
+ drivers/net/hyperv/netvsc.c | 19 +++++++++++++------
+ drivers/net/hyperv/netvsc_drv.c | 2 ++
+ 3 files changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
+--- a/drivers/net/hyperv/hyperv_net.h
++++ b/drivers/net/hyperv/hyperv_net.h
+@@ -680,6 +680,8 @@ struct netvsc_ethtool_stats {
+ unsigned long tx_no_space;
+ unsigned long tx_too_big;
+ unsigned long tx_busy;
++ unsigned long tx_send_full;
++ unsigned long rx_comp_busy;
+ };
+
+ struct netvsc_vf_pcpu_stats {
+diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
+--- a/drivers/net/hyperv/netvsc.c
++++ b/drivers/net/hyperv/netvsc.c
+@@ -883,7 +883,9 @@ int netvsc_send(struct net_device_context *ndev_ctx,
+ } else if (pktlen + net_device->pkt_align <
+ net_device->send_section_size) {
+ section_index = netvsc_get_next_send_section(net_device);
+- if (section_index != NETVSC_INVALID_INDEX) {
++ if (unlikely(section_index == NETVSC_INVALID_INDEX)) {
++ ++ndev_ctx->eth_stats.tx_send_full;
++ } else {
+ move_pkt_msd(&msd_send, &msd_skb, msdp);
+ msd_len = 0;
+ }
+@@ -949,9 +951,10 @@ send_now:
+ }
+
+ /* Send pending recv completions */
+-static int send_recv_completions(struct netvsc_channel *nvchan)
++static int send_recv_completions(struct net_device *ndev,
++ struct netvsc_device *nvdev,
++ struct netvsc_channel *nvchan)
+ {
+- struct netvsc_device *nvdev = nvchan->net_device;
+ struct multi_recv_comp *mrc = &nvchan->mrc;
+ struct recv_comp_msg {
+ struct nvsp_message_header hdr;
+@@ -969,8 +972,12 @@ static int send_recv_completions(struct netvsc_channel *nvchan)
+ msg.status = rcd->status;
+ ret = vmbus_sendpacket(nvchan->channel, &msg, sizeof(msg),
+ rcd->tid, VM_PKT_COMP, 0);
+- if (unlikely(ret))
++ if (unlikely(ret)) {
++ struct net_device_context *ndev_ctx = netdev_priv(ndev);
++
++ ++ndev_ctx->eth_stats.rx_comp_busy;
+ return ret;
++ }
+
+ if (++mrc->first == nvdev->recv_completion_cnt)
+ mrc->first = 0;
+@@ -1011,7 +1018,7 @@ static void enq_receive_complete(struct net_device *ndev,
+ recv_comp_slot_avail(nvdev, mrc, &filled, &avail);
+
+ if (unlikely(filled > NAPI_POLL_WEIGHT)) {
+- send_recv_completions(nvchan);
++ send_recv_completions(ndev, nvdev, nvchan);
+ recv_comp_slot_avail(nvdev, mrc, &filled, &avail);
+ }
+
+@@ -1194,7 +1201,7 @@ int netvsc_poll(struct napi_struct *napi, int budget)
+ * then re-enable host interrupts
+ * and reschedule if ring is not empty.
+ */
+- if (send_recv_completions(nvchan) == 0 &&
++ if (send_recv_completions(ndev, net_device, nvchan) == 0 &&
+ work_done < budget &&
+ napi_complete_done(napi, work_done) &&
+ hv_end_read(&channel->inbound)) {
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -1112,6 +1112,8 @@ static const struct {
+ { "tx_no_space", offsetof(struct netvsc_ethtool_stats, tx_no_space) },
+ { "tx_too_big", offsetof(struct netvsc_ethtool_stats, tx_too_big) },
+ { "tx_busy", offsetof(struct netvsc_ethtool_stats, tx_busy) },
++ { "tx_send_full", offsetof(struct netvsc_ethtool_stats, tx_send_full) },
++ { "rx_comp_busy", offsetof(struct netvsc_ethtool_stats, rx_comp_busy) },
+ }, vf_stats[] = {
+ { "vf_rx_packets", offsetof(struct netvsc_vf_pcpu_stats, rx_packets) },
+ { "vf_rx_bytes", offsetof(struct netvsc_vf_pcpu_stats, rx_bytes) },
diff --git a/series.conf b/series.conf
index 9ff1b44fa2..7ce60fa78e 100644
--- a/series.conf
+++ b/series.conf
@@ -1684,6 +1684,7 @@
patches.suse/msft-hv-1431-netvsc-remove-unnecessary-cast-of-void-pointer.patch
patches.suse/msft-hv-1432-netvsc-remove-unnecessary-check-for-NULL-hdr.patch
patches.suse/msft-hv-1433-netvsc-allow-controlling-send-recv-buffer-size.patch
+ patches.suse/msft-hv-1434-netvsc-keep-track-of-some-non-fatal-overload-conditi.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch