hyperv/hn: Remove unnecessary zeroing out the netvsc_packet

All used fields are setup one by one, so there is no need to zero
out this large struct.

While I'm here, move the stack variable near its usage.

Reviewed by:		adrian, delphij, Jun Su <junsu microsoft com>
Approved by:		adrian (mentor)
Sponsored by:		Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D4978
This commit is contained in:
Sepherosa Ziehau 2016-01-25 05:18:57 +00:00
parent 4d9e79a3be
commit 7ea161b0ec

View File

@ -755,7 +755,6 @@ hn_start_locked(struct ifnet *ifp)
hn_softc_t *sc = ifp->if_softc;
struct hv_device *device_ctx = vmbus_get_devctx(sc->hn_dev);
netvsc_dev *net_dev = sc->net_dev;
netvsc_packet *packet;
struct ether_vlan_header *eh;
rndis_msg *rndis_mesg;
rndis_packet *rndis_pkt;
@ -775,6 +774,7 @@ hn_start_locked(struct ifnet *ifp)
bus_dma_segment_t segs[HN_TX_DATA_SEGCNT_MAX];
int error, nsegs, i, send_failed = 0;
struct hn_txdesc *txd;
netvsc_packet *packet;
struct mbuf *m_head;
IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head);
@ -790,11 +790,7 @@ hn_start_locked(struct ifnet *ifp)
}
packet = &txd->netvsc_pkt;
/* XXX not necessary */
memset(packet, 0, sizeof(*packet));
packet->is_data_pkt = TRUE;
/* Initialize it from the mbuf */
packet->tot_data_buf_len = m_head->m_pkthdr.len;