Author: sephe
Date: Tue Mar 22 07:08:47 2016
New Revision: 297182
URL: https://svnweb.freebsd.org/changeset/base/297182

Log:
  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

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Mar 22 06:42:24 
2016        (r297181)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Tue Mar 22 07:08:47 
2016        (r297182)
@@ -1260,8 +1260,10 @@ netvsc_recv(struct hv_vmbus_channel *cha
                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 *cha
 
                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);
                }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to