Author: sephe
Date: Wed Aug 17 05:14:26 2016
New Revision: 304252
URL: https://svnweb.freebsd.org/changeset/base/304252

Log:
  hyperv/hn: Ignore the useless TX table.
  
  MFC after:    1 week
  Sponsored by: Microsoft
  Differential Revision:        https://reviews.freebsd.org/D7514

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.c
  head/sys/dev/hyperv/netvsc/if_hnreg.h

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Wed Aug 17 05:02:18 2016        
(r304251)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c     Wed Aug 17 05:14:26 2016        
(r304252)
@@ -930,44 +930,17 @@ retry_send_cmplt:
        }
 }
 
-/*
- * Net VSC receiving vRSS send table from VSP
- */
 static void
-hv_nv_send_table(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt)
+hn_proc_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt)
 {
-       netvsc_dev *net_dev;
-       const nvsp_msg *nvsp_msg_pkt;
-       int i;
-       uint32_t count;
-       const uint32_t *table;
-
-       net_dev = hv_nv_get_inbound_net_device(sc);
-       if (!net_dev)
-               return;
+       const struct hn_nvs_hdr *hdr;
 
-       nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkt);
-
-       if (nvsp_msg_pkt->hdr.msg_type !=
-           nvsp_msg5_type_send_indirection_table) {
-               printf("Netvsc: !Warning! receive msg type not "
-                       "send_indirection_table. type = %d\n",
-                       nvsp_msg_pkt->hdr.msg_type);
+       hdr = VMBUS_CHANPKT_CONST_DATA(pkt);
+       if (hdr->nvs_type == HN_NVS_TYPE_TXTBL_NOTE) {
+               /* Useless; ignore */
                return;
        }
-
-       count = nvsp_msg_pkt->msgs.vers_5_msgs.send_table.count;
-       if (count != VRSS_SEND_TABLE_SIZE) {
-               printf("Netvsc: Received wrong send table size: %u\n", count);
-               return;
-       }
-
-       table = (const uint32_t *)
-           ((const uint8_t *)&nvsp_msg_pkt->msgs.vers_5_msgs.send_table +
-            nvsp_msg_pkt->msgs.vers_5_msgs.send_table.offset);
-
-       for (i = 0; i < count; i++)
-               net_dev->vrss_send_table[i] = table[i];
+       if_printf(sc->hn_ifp, "got notify, nvs type %u\n", hdr->nvs_type);
 }
 
 /*
@@ -1005,7 +978,7 @@ hv_nv_on_channel_callback(struct vmbus_c
                                        hv_nv_on_receive(net_dev, rxr, chan, 
pkt);
                                        break;
                                case VMBUS_CHANPKT_TYPE_INBAND:
-                                       hv_nv_send_table(sc, pkt);
+                                       hn_proc_notify(sc, pkt);
                                        break;
                                default:
                                        if_printf(rxr->hn_ifp,

Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/if_hnreg.h       Wed Aug 17 05:02:18 2016        
(r304251)
+++ head/sys/dev/hyperv/netvsc/if_hnreg.h       Wed Aug 17 05:14:26 2016        
(r304252)
@@ -59,8 +59,11 @@
 #define HN_NVS_TYPE_CHIM_DISCONN       106
 #define HN_NVS_TYPE_RNDIS              107
 #define HN_NVS_TYPE_NDIS_CONF          125
+#define HN_NVS_TYPE_VFASSOC_NOTE       128     /* notification */
+#define HN_NVS_TYPE_SET_DATAPATH       129
 #define HN_NVS_TYPE_SUBCH_REQ          133
 #define HN_NVS_TYPE_SUBCH_RESP         133     /* same as SUBCH_REQ */
+#define HN_NVS_TYPE_TXTBL_NOTE         134     /* notification */
 
 /*
  * Any size less than this one will _not_ work, e.g. hn_nvs_init
_______________________________________________
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