hyperv/hn: Fix some ifnet settings

- ifnet.if_mtu does not require explicit setting.
- ifnet.if_hdrlen must be set after ether_ifattach().

MFC after:	1 week
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D7873
This commit is contained in:
Sepherosa Ziehau 2016-09-14 09:17:00 +00:00
parent 2b9577d34f
commit 276c74b29a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=305801

View File

@ -536,7 +536,6 @@ netvsc_attach(device_t dev)
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_ioctl = hn_ioctl;
ifp->if_init = hn_init;
ifp->if_mtu = ETHERMTU;
if (hn_use_if_start) {
int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]);
@ -558,7 +557,6 @@ netvsc_attach(device_t dev)
/*
* Tell upper layers that we support full VLAN capability.
*/
ifp->if_hdrlen = sizeof(struct ether_vlan_header);
ifp->if_capabilities |=
IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO |
IFCAP_LRO;
@ -600,6 +598,9 @@ netvsc_attach(device_t dev)
if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax,
ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize);
/* Inform the upper layer about the long frame support. */
ifp->if_hdrlen = sizeof(struct ether_vlan_header);
hn_set_chim_size(sc, sc->hn_chim_szmax);
if (hn_tx_chimney_size > 0 &&
hn_tx_chimney_size < sc->hn_chim_szmax)