Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f61a9d62 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller
Browse files

hv_netvsc: track memory allocation failures in ethtool stats



When skb can not be allocated, update ethtool statisitics
rather than rx_dropped which is intended for netif_receive.

Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 26a11262
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -705,6 +705,7 @@ struct netvsc_ethtool_stats {
	unsigned long tx_busy;
	unsigned long tx_send_full;
	unsigned long rx_comp_busy;
	unsigned long rx_no_memory;
	unsigned long stop_queue;
	unsigned long wake_queue;
};
+3 −2
Original line number Diff line number Diff line
@@ -773,8 +773,8 @@ int netvsc_recv_callback(struct net_device *net,
	skb = netvsc_alloc_recv_skb(net, &nvchan->napi,
				    csum_info, vlan, data, len);
	if (unlikely(!skb)) {
		++net_device_ctx->eth_stats.rx_no_memory;
drop:
		++net->stats.rx_dropped;
		rcu_read_unlock();
		return NVSP_STAT_FAIL;
	}
@@ -1131,6 +1131,7 @@ static const struct {
	{ "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) },
	{ "rx_no_memory", offsetof(struct netvsc_ethtool_stats, rx_no_memory) },
	{ "stop_queue", offsetof(struct netvsc_ethtool_stats, stop_queue) },
	{ "wake_queue", offsetof(struct netvsc_ethtool_stats, wake_queue) },
}, vf_stats[] = {