summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c')
-rw-r--r--sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
index 24aa310..17094ce 100644
--- a/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
@@ -154,8 +154,8 @@ __FBSDID("$FreeBSD$");
#define HN_TX_DATA_BOUNDARY PAGE_SIZE
#define HN_TX_DATA_MAXSIZE IP_MAXPACKET
#define HN_TX_DATA_SEGSIZE PAGE_SIZE
-#define HN_TX_DATA_SEGCNT_MAX \
- (NETVSC_PACKET_MAXPAGE - HV_RF_NUM_TX_RESERVED_PAGE_BUFS)
+/* -1 for RNDIS packet message */
+#define HN_TX_DATA_SEGCNT_MAX (NETVSC_PACKET_MAXPAGE - 1)
#define HN_DIRECT_TX_SIZE_DEF 128
@@ -651,7 +651,7 @@ netvsc_detach(device_t dev)
* the netdevice.
*/
- hv_rf_on_device_remove(sc, HV_RF_NV_DESTROY_CHANNEL);
+ hv_rf_on_device_remove(sc);
hn_stop_tx_tasks(sc);
@@ -1029,7 +1029,8 @@ hn_encap(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head0)
}
*m_head0 = m_head;
- txr->hn_gpa_cnt = nsegs + HV_RF_NUM_TX_RESERVED_PAGE_BUFS;
+ /* +1 RNDIS packet message */
+ txr->hn_gpa_cnt = nsegs + 1;
/* send packet with page buffer */
txr->hn_gpa[0].gpa_page = atop(txd->rndis_msg_paddr);
@@ -1037,12 +1038,11 @@ hn_encap(struct hn_tx_ring *txr, struct hn_txdesc *txd, struct mbuf **m_head0)
txr->hn_gpa[0].gpa_len = rndis_msg_size;
/*
- * Fill the page buffers with mbuf info starting at index
- * HV_RF_NUM_TX_RESERVED_PAGE_BUFS.
+ * Fill the page buffers with mbuf info after the page
+ * buffer for RNDIS packet message.
*/
for (i = 0; i < nsegs; ++i) {
- struct vmbus_gpa *gpa = &txr->hn_gpa[
- i + HV_RF_NUM_TX_RESERVED_PAGE_BUFS];
+ struct vmbus_gpa *gpa = &txr->hn_gpa[i + 1];
gpa->gpa_page = atop(segs[i].ds_addr);
gpa->gpa_ofs = segs[i].ds_addr & PAGE_MASK;
@@ -1576,7 +1576,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
* MTU to take effect. This includes tearing down, but not
* deleting the channel, then bringing it back up.
*/
- error = hv_rf_on_device_remove(sc, HV_RF_NV_RETAIN_CHANNEL);
+ error = hv_rf_on_device_remove(sc);
if (error) {
NV_LOCK(sc);
sc->temp_unusable = FALSE;
OpenPOWER on IntegriCloud