From owner-svn-src-head@freebsd.org Fri May 19 01:18:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8795D719F1; Fri, 19 May 2017 01:18:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-pg0-x22e.google.com (mail-pg0-x22e.google.com [IPv6:2607:f8b0:400e:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92A75942; Fri, 19 May 2017 01:18:31 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-pg0-x22e.google.com with SMTP id x64so30472748pgd.3; Thu, 18 May 2017 18:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4tz9rXCMmxtEUksoEkeSQ5mYhtAFal6Uhe4IqTj6oX4=; b=qgwBw/czWAVyrIpyrA1jFYL6WpS649jATJxAIU1RXWYUOhZ7Y5Sns2DXguFAoWEayD fSfm9drgqm9Fdt/4mmm/rRZZj1MAaLLFTTFbKkj4rIq+GYKQ7UmgHAtBDGj60g6NZRT0 WvzO7iaIwXiX+lSYdFXLcErhgqgvmfl/Vr3E5iUQagOKLgh8+Ywk5gpRNVnpYwjn7qZ2 VqWr6O0AS89gAjysHGw7rMj+sxAziU08a92qJjaslsUjpPlJ2sx4rRSYsqJhLFnzp3xk 1K2cFRRtn59KLGJNf8VuMir19Mn2rutp1TQC+hM5K6Ljv/6rBUobypbYlxLAD4SsO4pB 3lpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4tz9rXCMmxtEUksoEkeSQ5mYhtAFal6Uhe4IqTj6oX4=; b=auPCQ85OpJRg02aubr82YgHKXWLJCrVjxlkcf3hjGaDedbHaqv2pxo9jiEnu5MAOSY 0w+1TJYNd8iEycWpUkgjlbER65E4JcRU9B30U2PKamd+egnFPPBfx4wzwzRVzkLoaGFQ ZsZnkI1HZfOAimGn/W7cp78NCRWGSLm0J6m/jE0A0dMqpHxNp+jZDXWypWXXyuVC9/fI R6VBhtv5NPm/9KVjYhXfNTIzGv7P6ha938u01WJUpcv2np2p9aY5MPyGkGR54EHbamDE xQmiaKObS+ahhgjSE1BKqpuPiAzAnowz90pbxWWoj0PxA/dRVsrHsF2x5gbrNVQwHEST ygwg== X-Gm-Message-State: AODbwcBHGzXkyy9m/PJjl5Rh60/TcE0AK/7vo4nSOV1c0tL40bc0d5rg Gb2xvUBXQ0rcu0cFSLQ1urUBzbLG0g== X-Received: by 10.99.115.73 with SMTP id d9mr2114201pgn.5.1495156711153; Thu, 18 May 2017 18:18:31 -0700 (PDT) MIME-Version: 1.0 Sender: sepherosa@gmail.com Received: by 10.100.160.112 with HTTP; Thu, 18 May 2017 18:18:30 -0700 (PDT) In-Reply-To: References: <201609010632.u816WZUj025186@repo.freebsd.org> <20170518140403.GA54405@lath.RINET.ru> <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org> <20170518150030.GA55481@lath.RINET.ru> From: Sepherosa Ziehau Date: Fri, 19 May 2017 09:18:30 +0800 X-Google-Sender-Auth: G66Gd5S2gDp2rc1bE4OHC96Sxsc Message-ID: Subject: Re: svn commit: r305177 - head/sys/net To: Hans Petter Selasky Cc: Oleg Bulyzhin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, araujo@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 19 May 2017 01:18:31 -0000 Oh, my fault. I will revert it. On Thu, May 18, 2017 at 11:11 PM, Hans Petter Selasky wrote: > On 05/18/17 17:00, Oleg Bulyzhin wrote: >> >> On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote: >>> >>> On 05/18/17 16:04, Oleg Bulyzhin wrote: >>>> >>>> On Thu, Sep 01, 2016 at 06:32:35AM +0000, Sepherosa Ziehau wrote: >>>>> >>>>> Author: sephe >>>>> Date: Thu Sep 1 06:32:35 2016 >>>>> New Revision: 305177 >>>>> URL: https://svnweb.freebsd.org/changeset/base/305177 >>>>> >>>>> Log: >>>>> net/vlan: Shift for pri is 13 (pri mask 0xe000) not 1. >>>>> Reviewed by: araujo, hps >>>>> MFC after: 1 week >>>>> Sponsored by: Microsoft >>>>> Differential Revision: https://reviews.freebsd.org/D7710 >>>>> >>>>> Modified: >>>>> head/sys/net/ethernet.h >>>>> >>>>> Modified: head/sys/net/ethernet.h >>>>> >>>>> ============================================================================== >>>>> --- head/sys/net/ethernet.h Thu Sep 1 06:05:08 2016 >>>>> (r305176) >>>>> +++ head/sys/net/ethernet.h Thu Sep 1 06:32:35 2016 >>>>> (r305177) >>>>> @@ -92,7 +92,7 @@ struct ether_vlan_header { >>>>> #define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7) >>>>> #define EVL_CFIOFTAG(tag) (((tag) >> 12) & 1) >>>>> #define EVL_MAKETAG(vlid, pri, cfi) >>>>> \ >>>>> - ((((((pri) & 7) << 1) | ((cfi) & 1)) << 12) | ((vlid) & >>>>> EVL_VLID_MASK)) >>>>> + ((((((pri) & 7) << 13) | ((cfi) & 1)) << 12) | ((vlid) & >>>>> EVL_VLID_MASK)) >>>>> /* >>>>> * NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length >>>>> fields. >>>> >>>> >>>> Please revert this one. It's just plain wrong and previous one was ok. >>>> >>> >>> Hi, >>> >>> Can you explain a bit more what is wrong? >>> >>>> If you care about readability it should be: >>>> ((((pri) & 7) << 13) | (((cfi) & 1) << 12) | ((vlid) & EVL_VLID_MASK)) >>> >>> >>> Isn't this exactly what the patch is doing? -R ??? >> >> >> Current version is shifting pri out of uint16. If you examine parentheses: >> pri is shifted left 13, then 12. >> Original version did it right (shift 1, then 12 (total 13)). >> > > Hi Oleg, > > I see. The VLAN priority is then always zero after this change. > > I'll let Sepherosa handle the revert and/or readability update. > > --HPS -- Tomorrow Will Never Die