Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Aug 2018 14:28:27 -0700
From:      Navdeep Parhar <np@FreeBSD.org>
To:        Gleb Smirnoff <glebius@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r337932 - in head/sys: net netinet
Message-ID:  <1e809525-77bd-19e2-6908-a984c3414aed@FreeBSD.org>
In-Reply-To: <20180821212628.GN27633@FreeBSD.org>
References:  <201808162346.w7GNkc2p006822@repo.freebsd.org> <20180821212628.GN27633@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 8/21/18 2:26 PM, Gleb Smirnoff wrote:
>   Navdeep,
> 
> On Thu, Aug 16, 2018 at 11:46:38PM +0000, Navdeep Parhar wrote:
> N> Author: np
> N> Date: Thu Aug 16 23:46:38 2018
> N> New Revision: 337932
> N> URL: https://svnweb.freebsd.org/changeset/base/337932
> N> 
> N> Log:
> N>   Add the ability to look up the 3b PCP of a VLAN interface.  Use it in
> N>   toe_l2_resolve to fill up the complete vtag and not just the vid.
> N>   
> N>   Reviewed by:	kib@
> N>   MFC after:	1 week
> N>   Sponsored by:	Chelsio Communications
> N>   Differential Revision:	https://reviews.freebsd.org/D16752
> ...
> N> +static int
> N> +vlan_pcp(struct ifnet *ifp, uint16_t *pcpp)
> N> +{
> N> +	struct ifvlan *ifv;
> N> +
> N> +	if (ifp->if_type != IFT_L2VLAN)
> N> +		return (EINVAL);
> N> +	ifv = ifp->if_softc;
> N> +	*pcpp = ifv->ifv_pcp;
> N> +	return (0);
> N> +}
> 
> Is there any good reason not to assert that ifp->if_type == IFT_L2VLAN?
> 

I can't think of any.  But I wrote it this way to match the vlan_tag()
function a few lines above.

Regards,
Navdeep



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1e809525-77bd-19e2-6908-a984c3414aed>