Author: dexuan
Date: Thu Feb 23 06:49:46 2017
New Revision: 314121
URL: https://svnweb.freebsd.org/changeset/base/314121

Log:
  MFC: r312685, r312686
  
  Approved by:  sephe (mentor)
  
  r312685
      hyperv/hn: remember the channel pointer in struct hn_rx_ring
  
      This will be used by the coming NIC SR-IOV patch.
  
      Reviewed by:      sephe
      Approved by:      sephe (mentor)
      Sponsored by:     Microsoft
      Differential Revision:    https://reviews.freebsd.org/D8909
  
  r312686
      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)
      Sponsored by:     Microsoft
      Differential Revision:    https://reviews.freebsd.org/D8962

Modified:
  stable/10/sys/dev/hyperv/netvsc/if_hn.c
  stable/10/sys/dev/hyperv/netvsc/if_hnvar.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/if_hn.c     Thu Feb 23 05:40:59 2017        
(r314120)
+++ stable/10/sys/dev/hyperv/netvsc/if_hn.c     Thu Feb 23 06:49:46 2017        
(r314121)
@@ -2118,15 +2118,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const v
        int size, do_lro = 0, do_csum = 1;
        int hash_type = M_HASHTYPE_OPAQUE;
 
-       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);
@@ -4297,6 +4289,7 @@ hn_chan_attach(struct hn_softc *sc, stru
        KASSERT((rxr->hn_rx_flags & HN_RX_FLAG_ATTACHED) == 0,
            ("RX ring %d already attached", idx));
        rxr->hn_rx_flags |= HN_RX_FLAG_ATTACHED;
+       rxr->hn_chan = chan;
 
        if (bootverbose) {
                if_printf(sc->hn_ifp, "link RX ring %d to chan%u\n",

Modified: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h
==============================================================================
--- stable/10/sys/dev/hyperv/netvsc/if_hnvar.h  Thu Feb 23 05:40:59 2017        
(r314120)
+++ stable/10/sys/dev/hyperv/netvsc/if_hnvar.h  Thu Feb 23 06:49:46 2017        
(r314121)
@@ -85,6 +85,8 @@ struct hn_rx_ring {
 
        void            *hn_br;         /* TX/RX bufring */
        struct hyperv_dma hn_br_dma;
+
+       struct vmbus_channel *hn_chan;
 } __aligned(CACHE_LINE_SIZE);
 
 #define HN_TRUST_HCSUM_IP      0x0001
_______________________________________________
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