Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2013 16:20:01 GMT
From:      =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/183139: ifconfig options on xn0 lost after xen vm migration to another server
Message-ID:  <201310281620.r9SGK1gX026824@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/183139; it has been noted by GNATS.

From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
To: <bug-followup@FreeBSD.org>, <mcdouga9@egr.msu.edu>
Cc:  
Subject: Re: kern/183139: ifconfig options on xn0 lost after xen vm migration
 to another server
Date: Mon, 28 Oct 2013 17:13:01 +0100

 Hello,
 
 The following patch seems to solve the problem, but I'm not that much 
 familiar with netfront or net drivers in general (also netfront code is 
 not that great, which makes it even harder to understand IMHO).
 
 ---
 diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
 index f9c72e6..99d3cf9 100644
 --- a/sys/dev/xen/netfront/netfront.c
 +++ b/sys/dev/xen/netfront/netfront.c
 @@ -2022,15 +2022,31 @@ static int
  xn_configure_features(struct netfront_info *np)
  {
  	int err;
 +	bool resume;
  
  	err = 0;
 +	resume = !!np->xn_ifp->if_capenable;
 +
 +	if (!resume || ((np->xn_ifp->if_capenable & np->xn_ifp->if_capabilities)
 +	    != np->xn_ifp->if_capenable)) {
 +	    	/*
 +	    	 * Check if current enabled capabilities are available,
 +	    	 * if not switch to default capabilities.
 +	    	 */
  #if __FreeBSD_version >= 700000
 -	if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0)
 -		tcp_lro_free(&np->xn_lro);
 +		if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0)
 +			tcp_lro_free(&np->xn_lro);
  #endif
 -    	np->xn_ifp->if_capenable =
 -	    np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4);
 -	np->xn_ifp->if_hwassist &= ~CSUM_TSO;
 +    		np->xn_ifp->if_capenable =
 +	    		np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4);
 +		np->xn_ifp->if_hwassist &= ~CSUM_TSO;
 +	} else {
 +		/*
 +		 * What we have currently enabled is supported by the
 +		 * new host, no need to change anything.
 +		 */
 +		return 0;
 +	}
  #if __FreeBSD_version >= 700000
  	if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) {
  		err = tcp_lro_init(&np->xn_lro);
 -- 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310281620.r9SGK1gX026824>