Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jun 2013 13:46:29 +0300
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Nikos Vassiliadis <nvass@gmx.com>, zec@FreeBSD.org, src-committers@freebsd.org
Subject:   Re: svn commit: r251490 - head/sys/net
Message-ID:  <20130607104628.GA96120@gmail.com>
In-Reply-To: <20130607103307.GA1187@FreeBSD.org>
References:  <201306071027.r57ARpaF056606@svn.freebsd.org> <20130607103307.GA1187@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 07, 2013 at 02:33:08PM +0400, Gleb Smirnoff wrote:
> On Fri, Jun 07, 2013 at 10:27:51AM +0000, Mikolaj Golub wrote:
> M> Author: trociny
> M> Date: Fri Jun  7 10:27:50 2013
> M> New Revision: 251490
> M> URL: http://svnweb.freebsd.org/changeset/base/251490
> M> 
> M> Log:
> M>   Properly set curvnet context in lagg_port_setlladdr() task handler.
> M>   
> M>   Reported by:	Nikos Vassiliadis <nvass gmx.com>
> M>   Submitted by:	zec
> M>   Tested by:	Nikos Vassiliadis <nvass gmx.com>
> M>   MFC after:	1 week
> M> 
> M> Modified:
> M>   head/sys/net/if_lagg.c
> M> 
> M> Modified: head/sys/net/if_lagg.c
> M> ==============================================================================
> M> --- head/sys/net/if_lagg.c	Fri Jun  7 09:06:50 2013	(r251489)
> M> +++ head/sys/net/if_lagg.c	Fri Jun  7 10:27:50 2013	(r251490)
> M> @@ -505,7 +505,9 @@ lagg_port_setlladdr(void *arg, int pendi
> M>  		ifp = llq->llq_ifp;
> M>  
> M>  		/* Set the link layer address */
> M> +		CURVNET_SET(ifp->if_vnet);
> M>  		error = if_setlladdr(ifp, llq->llq_lladdr, ETHER_ADDR_LEN);
> M> +		CURVNET_RESTORE();
> M>  		if (error)
> M>  			printf("%s: setlladdr failed on %s\n", __func__,
> M>  			    ifp->if_xname);
> 
> IMHO, the entire task function should be embraced into VNET context.

The VNET context is obtained from ifp, which is taken from the queue
just one line above.

It might be taken from lagg interface, supposing that all the lagg
ports are in the same vnet, but this may not always be true, e.g. when
you moving a lagg and its ports to another vnet, one by one.

-- 
Mikolaj Golub



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