Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2020 13:16:22 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r357012 - head/sys/net
Message-ID:  <0fc0f0d5-b339-fdd9-3cf9-febf58d802d9@selasky.org>
In-Reply-To: <202001230147.00N1lh9g042266@repo.freebsd.org>
References:  <202001230147.00N1lh9g042266@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-01-23 02:47, Gleb Smirnoff wrote:
> Author: glebius
> Date: Thu Jan 23 01:47:43 2020
> New Revision: 357012
> URL: https://svnweb.freebsd.org/changeset/base/357012
> 
> Log:
>    Stop entering the network epoch in ether_input(), unless driver
>    is marked with IFF_NEEDSEPOCH.
> 
> Modified:
>    head/sys/net/if_ethersubr.c
> 
> Modified: head/sys/net/if_ethersubr.c
> ==============================================================================
> --- head/sys/net/if_ethersubr.c	Thu Jan 23 01:46:05 2020	(r357011)
> +++ head/sys/net/if_ethersubr.c	Thu Jan 23 01:47:43 2020	(r357012)
> @@ -809,7 +809,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
>   	 * them up. This allows the drivers to amortize the receive lock.
>   	 */
>   	CURVNET_SET_QUIET(ifp->if_vnet);
> -	NET_EPOCH_ENTER(et);
> +	if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
> +		NET_EPOCH_ENTER(et);
>   	while (m) {
>   		mn = m->m_nextpkt;
>   		m->m_nextpkt = NULL;
> @@ -824,7 +825,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
>   		netisr_dispatch(NETISR_ETHER, m);
>   		m = mn;
>   	}
> -	NET_EPOCH_EXIT(et);
> +	if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
> +		NET_EPOCH_EXIT(et);
>   	CURVNET_RESTORE();
>   }
>   
> 

Can we do it like this instead:
https://reviews.freebsd.org/D23348

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0fc0f0d5-b339-fdd9-3cf9-febf58d802d9>