From owner-svn-src-head@freebsd.org Tue Aug 21 21:28:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31B31107FAED; Tue, 21 Aug 2018 21:28:31 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAD897015; Tue, 21 Aug 2018 21:28:30 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf1-x42d.google.com with SMTP id 79-v6so110803pfi.8; Tue, 21 Aug 2018 14:28:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:openpgp:autocrypt:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PBVl0XO44UoC52ZxUSYEVvF+Xxm+mq4CT3gpLo7mCq4=; b=ChMSAuLWpXm2Z0ryOnXcP+Z1FO6mY3Ho4M+st/xD58psYDQd4M+J6vBaguTVLj3Z6I MxXaTmwAash3yW+XI1PwgIsxNXjAw/EtnlaZgvGo+Q2oTEnUFDFc07h1j9KaGN8Yimf8 M+YA/rfYRTgA9Ai04TH5aBzVMBQcFQSuJYnvrRluc+PrlVYMkdu9BAt83KxxwA7KpzeE ayCDGp7Uhe9Kzenh9PI7AYiRn+f8xX0zo3pX/duA6DhqgrqRBpQmGuRRbUwZJozeln+z PCcG+VokHLl9eQXC9hEULW93dD7IoNywH88eJJSxU+83toIQrOHL1KkgSo4vutPsWHA3 Ke1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:openpgp :autocrypt:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=PBVl0XO44UoC52ZxUSYEVvF+Xxm+mq4CT3gpLo7mCq4=; b=VfAYrEStpnAbnIuHhL2cx6MLJHLXbgJ5Re1HBZ/fTpRShI7/4u9j8zlhW0um1twrpU aoVgrEC9ZmsADJCFPW0XzRigyMlHb8dbeX2d7q4j1fVzdCJfDJyjuDtgJH+p+zuQVN12 jclAHyDdGAN+BPvtT0U7bBW1qKzQK8ogIOdTC2g3cmDochEqHXYD2jYMH9pTMWh8iDih jYqhpJDODSwm7bAnGfs3PV9bCsLqDbYTaGMeDyC7pmGiBbcAn4WauV3BfkVBFx9B2qCy 28TvoatlxGkwO0cAlRQuuRZR5LnbPyfxCTVckNM9Jmmihjc5wzA+CrV0sFbi4LbGiLMh rG+w== X-Gm-Message-State: AOUpUlGkWrO+TDfhAd8aUrQ1i6YDKfR3gHebaCS3K7ezSQqLrhMuBTTx PxiMazR2aouN7s4KbkeJoV7Icbpn X-Google-Smtp-Source: AA+uWPxtBZuydmNsmHQXL3iyawSIH/IVl8DRL1UP70i1GH7slePty3g4QH4gov0CG5+ml81CL7QFXw== X-Received: by 2002:a63:a919:: with SMTP id u25-v6mr49861261pge.211.1534886909382; Tue, 21 Aug 2018 14:28:29 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id r18-v6sm1415320pgo.27.2018.08.21.14.28.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Aug 2018 14:28:28 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: svn commit: r337932 - in head/sys: net netinet To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201808162346.w7GNkc2p006822@repo.freebsd.org> <20180821212628.GN27633@FreeBSD.org> From: Navdeep Parhar Openpgp: preference=signencrypt Autocrypt: addr=np@FreeBSD.org; prefer-encrypt=mutual; keydata= xsDiBEosaGcRBACOXnXquGEW53BjpMt2jViod/TUf1xgjMekcbDxqOODPeX7eYfrwJ8G6BCN OpGjBmWDu/JcNj4Z+gmTilJ6WLZQ7ecFZfEeO91pt6ys0cyWh0xfO+/mT83D7W81S/kqrJBk QbBIdV6LumevdErHo272r8RcMELC4Ru87eRtX3hmEwCgnnGNJMpQFUfYTt5XE7nY0yQoeV8D /0OcWmJbEZWxX9O7AuliCe3zd2Dw0B4LB9SZ2Dis7+gpVd3xVgYnt5wRE9kM+ThgrMA/wqr8 07qmEG6bcfUsfwwGN9YUtNF3xAN07cXTs026sCIFNZK816PrThBzCgkwR7pDpkMzGWIBr8Wi XXy0eB+JlQ6UV4PEiXuZ5ulzP0b1A/9CZm3wJfrNC0r1gMyrfVedg4zwKU997bmPLGcYs+rW XDTI9CvMseOUYn4CoDZQCp/9zxuHK+VU7Y/w0c/hVE5ERACSn4SjN2unEDstK9njZBMHEPVk Ae/YvSG5cmc97SHlVE+eu/bbLKcvFb6rRLPOaVFQJMJA2VJEGWtYhvP7Zc0fTmF2ZGVlcCBQ YXJoYXIgPG5wQEZyZWVCU0Qub3JnPsJgBBMRAgAgBQJKLGhnAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQyrIrk6yriBL0MQCfUJOiS2PbJFDeiav1ylcXXwfpggAAoJRoS7GDENGy M4BzjJ4b0ptZqTLRzsFNBEosaGcQCACFCWs47SL4DQA6bNDlVJu4w8wLf8uVOyatuGmdXX8Y /OTVQJgA3vS+ODNVJCxhKVlvhcn7bhBdGdWKS9K+lr8+eEvr4hf2bQpesoHC+uFgKyILkCBN L8raixbhysyq0pfZWWDJMyn+G42BG1yJJi+bykygdpYnbIVA8dYHmBibI8mkPKOHSohjXT1S RfGGn+l1w54OO4NlJhCXMkjTA/Z9Bt4XeaiR85uJi0UUfV8FGZHhgSvT+/P1xIvz+nytuehS P/QLXl13CtAG/nKVkAcZnsT/3NrJ4Z2r45k+c50Wrf210scAaBogrrV5eIHfNGgOANApN8+8 vj+aXO4pXRuXAAMFB/44ea8rd+P5N3OMrfuM8i91Qe1bJ+BIoroKPOr8jvCry0h3QpdfLKUN IgaqbS3JZeBJ8HHnWSGCF+o6H5gzRe1hvylPEclLPDCuPe7T746h9Mzejf2hNDJvOg+BuweD ZW4KhovVbdS+syJEvpGF4bO8qgHT2CKgruXSHbFetdQWbkM0rfMmTuo0GcR2BEVrPb/SPFv6 4ZZyAZzmnGO4vT1bzClnTzJixrDpH74M3vSEYegMB4KdbLYBi8Jx4QUKgVEhJHjJubKWX4et yU/uuehOC3xYrmr1UXvsom3U8r36Dvdo77Yr3dgDVXa7bolNx0TIhdWxZI+R4z9E75QY+/wg wkkEGBECAAkFAkosaGcCGwwACgkQyrIrk6yriBI+JQCfUxgyqGtzZvLh5Al7gsTmRc11PLwA niD3NfWGRcO2+9uxSSQqRH1ywC4n Message-ID: <1e809525-77bd-19e2-6908-a984c3414aed@FreeBSD.org> Date: Tue, 21 Aug 2018 14:28:27 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180821212628.GN27633@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 21:28:31 -0000 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