svn commit: r312686 - head/sys/dev/hyperv/netvsc

Dexuan Cui dexuan at FreeBSD.org
Tue Jan 24 09:15:38 UTC 2017


Author: dexuan
Date: Tue Jan 24 09:15:36 2017
New Revision: 312686
URL: https://svnweb.freebsd.org/changeset/base/312686

Log:
  hyperv/hn: remove the MTU and IFF_DRV_RUNNING checking in hn_rxpkt()
  
  It's unnecessary because the upper nework stack does the same checking.
  
  In the case of Hyper-V SR-IOV, we need to remove the checking because
  1) multicast/broadcast packets are still received through the synthetic
  NIC and we need to inject the packets through the VF interface;
  2) we must inject the packets even if the synthetic NIC is down, or has
  a different MTU from the VF device.
  
  Reviewed by:	sephe
  Approved by:	sephe (mentor)
  MFC after:	2 weeks
  Sponsored by:	Microsoft
  Differential Revision:	https://reviews.freebsd.org/D8962

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

Modified: head/sys/dev/hyperv/netvsc/if_hn.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hn.c	Tue Jan 24 09:09:53 2017	(r312685)
+++ head/sys/dev/hyperv/netvsc/if_hn.c	Tue Jan 24 09:15:36 2017	(r312686)
@@ -2129,15 +2129,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v
 	int size, do_lro = 0, do_csum = 1;
 	int hash_type;
 
-	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
-		return (0);
-
-	/*
-	 * Bail out if packet contains more data than configured MTU.
-	 */
-	if (dlen > (ifp->if_mtu + ETHER_HDR_LEN)) {
-		return (0);
-	} else if (dlen <= MHLEN) {
+	if (dlen <= MHLEN) {
 		m_new = m_gethdr(M_NOWAIT, MT_DATA);
 		if (m_new == NULL) {
 			if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);


More information about the svn-src-head mailing list