Date: Mon, 25 Jan 2016 05:18:57 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294702 - head/sys/dev/hyperv/netvsc Message-ID: <201601250518.u0P5IvkW052092@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Mon Jan 25 05:18:57 2016 New Revision: 294702 URL: https://svnweb.freebsd.org/changeset/base/294702 Log: 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 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:12:00 2016 (r294701) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jan 25 05:18:57 2016 (r294702) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601250518.u0P5IvkW052092>