View | Details | Raw Unified | Return to bug 183139
Collapse All | Expand All

(-)b/sys/dev/xen/netfront/netfront.c (-6 / +24 lines)
Lines 285-290 struct netfront_info { Link Here
285
	multicall_entry_t	rx_mcl[NET_RX_RING_SIZE+1];
285
	multicall_entry_t	rx_mcl[NET_RX_RING_SIZE+1];
286
	mmu_update_t		rx_mmu[NET_RX_RING_SIZE];
286
	mmu_update_t		rx_mmu[NET_RX_RING_SIZE];
287
	struct ifmedia		sc_media;
287
	struct ifmedia		sc_media;
288
289
	bool			xn_resume;
288
};
290
};
289
291
290
#define rx_mbufs xn_cdata.xn_rx_chain
292
#define rx_mbufs xn_cdata.xn_rx_chain
Lines 500-505 netfront_resume(device_t dev) Link Here
500
{
502
{
501
	struct netfront_info *info = device_get_softc(dev);
503
	struct netfront_info *info = device_get_softc(dev);
502
504
505
	info->xn_resume = true;
503
	netif_disconnect_backend(info);
506
	netif_disconnect_backend(info);
504
	return (0);
507
	return (0);
505
}
508
}
Lines 1982-1999 xn_query_features(struct netfront_info *np) Link Here
1982
static int
1985
static int
1983
xn_configure_features(struct netfront_info *np)
1986
xn_configure_features(struct netfront_info *np)
1984
{
1987
{
1985
	int err;
1988
	int err, cap_enabled;
1986
1989
1987
	err = 0;
1990
	err = 0;
1991
1992
	if (np->xn_resume &&
1993
	    ((np->xn_ifp->if_capenable & np->xn_ifp->if_capabilities)
1994
	    == np->xn_ifp->if_capenable)) {
1995
		/* Current options are available, no need to do anything. */
1996
		return (0);
1997
	}
1998
1999
	/* Try to preserve as many options as possible. */
2000
	if (np->xn_resume)
2001
		cap_enabled = np->xn_ifp->if_capenable;
2002
	else
2003
		cap_enabled = UINT_MAX;
2004
1988
#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
2005
#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
1989
	if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0)
2006
	if ((np->xn_ifp->if_capenable & IFCAP_LRO) == (cap_enabled & IFCAP_LRO))
1990
		tcp_lro_free(&np->xn_lro);
2007
		tcp_lro_free(&np->xn_lro);
1991
#endif
2008
#endif
1992
    	np->xn_ifp->if_capenable =
2009
    	np->xn_ifp->if_capenable =
1993
	    np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4);
2010
	    np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4) & cap_enabled;
1994
	np->xn_ifp->if_hwassist &= ~CSUM_TSO;
2011
	np->xn_ifp->if_hwassist &= ~CSUM_TSO;
1995
#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
2012
#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
1996
	if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) {
2013
	if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) ==
2014
	    (cap_enabled & IFCAP_LRO)) {
1997
		err = tcp_lro_init(&np->xn_lro);
2015
		err = tcp_lro_init(&np->xn_lro);
1998
		if (err) {
2016
		if (err) {
1999
			device_printf(np->xbdev, "LRO initialization failed\n");
2017
			device_printf(np->xbdev, "LRO initialization failed\n");
Lines 2002-2008 xn_configure_features(struct netfront_info *np) Link Here
2002
			np->xn_ifp->if_capenable |= IFCAP_LRO;
2020
			np->xn_ifp->if_capenable |= IFCAP_LRO;
2003
		}
2021
		}
2004
	}
2022
	}
2005
	if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) != 0) {
2023
	if ((np->xn_ifp->if_capabilities & IFCAP_TSO4) ==
2024
	    (cap_enabled & IFCAP_TSO4)) {
2006
		np->xn_ifp->if_capenable |= IFCAP_TSO4;
2025
		np->xn_ifp->if_capenable |= IFCAP_TSO4;
2007
		np->xn_ifp->if_hwassist |= CSUM_TSO;
2026
		np->xn_ifp->if_hwassist |= CSUM_TSO;
2008
	}
2027
	}
2009
- 

Return to bug 183139