From 2e4dba97bd9c4db4282ca78c55b9ac2ce19b5088 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 22 Mar 2016 07:08:47 +0000 Subject: [PATCH] hyperv/hn: When short of mbufs on the RX path, don't spam the console. Instead, increase the IQDROPS counter. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5693 --- sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c index 51f7d7c6c47f..69c4eb528a8f 100644 --- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -1260,8 +1260,10 @@ netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, return (0); } else if (packet->tot_data_buf_len <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); - if (m_new == NULL) + if (m_new == NULL) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); + } memcpy(mtod(m_new, void *), packet->data, packet->tot_data_buf_len); m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; @@ -1281,7 +1283,7 @@ netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); if (m_new == NULL) { - if_printf(ifp, "alloc mbuf failed.\n"); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); }