From owner-svn-src-head@freebsd.org Thu May 18 15:10:06 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 365D9D7307A; Thu, 18 May 2017 15:10:06 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (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 DD3A1160E; Thu, 18 May 2017 15:10:02 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x229.google.com with SMTP id h4so57728673oib.3; Thu, 18 May 2017 08:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rXFf1m+PKc0Jst4UNAxHnlnMYVGw2l/PMtaWxFqEQZ4=; b=tDDJfR6XbY9vqU/nlpM9txJbrqSnDR+PnV+lySMKMwiYKj7q65ht5g0j8WJsg6YYuc sn357j7sxgo1p2t2Q8R4vfBNbrbCACibT6/FxsCOowsRfGkyCvcTRqX7YhSqgDhTviw5 0cXQy+sej/GfJsBaDkQS9gcEqqvlHGsOXVaOB4XGCUSw/IDLDj/3utftaTeKE2OigWT5 sfQocqnjndI36mvmNbAyqI679Rap6CP8AsEfteRa2LATms51jGQOSlkKQcMbWHwSuYOX +mqj/QJqyRtCxjmCutMvH99nAIOQHklt4O1L+pwPWsXcox9zUBy4cJ+LeFvnt/7kMGSR L85g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rXFf1m+PKc0Jst4UNAxHnlnMYVGw2l/PMtaWxFqEQZ4=; b=hYwCgHiK0VbbpcWFy5IKyefR1W8oKUFz3qHaZrT8EqHUeygZn9GqTDgJH9mi3LDYpz /O7IV/4Lzckc8a8670Fn3LMbzm8rXPFxJSERFL0jq6udu0n4exCEkuzgPiUAcop8f2uI HhbCGQ/1FWEi+AzzCKxJdL6XZh5KURAYy+bz00+mxIB8WBVvkYhX2nZzASnuGs6EVnqu ksJQGfKvipQN8DjdgzKt1m8DAk6j8vDPCyyjtQStvWi+wP41bG1I+dTYVRdkDgBVywqr qtmIbMh26Hu/xKqraK4fLp3lhtR2rcd0lRMMS9JvHRU5M8KWTvQseoYOOLCUZDVHRHNq vz2g== X-Gm-Message-State: AODbwcCYPpfWSZd5ACEG2gyjGkjFxkrde0MFv/EuQEBKD/EOk2zk5jX8 YP3DkMFjDax26uPcLI36gXJmgB2mcw== X-Received: by 10.157.29.235 with SMTP id w40mr2706985otw.128.1495120201896; Thu, 18 May 2017 08:10:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.20.163 with HTTP; Thu, 18 May 2017 08:10:01 -0700 (PDT) In-Reply-To: <20170518150030.GA55481@lath.RINET.ru> References: <201609010632.u816WZUj025186@repo.freebsd.org> <20170518140403.GA54405@lath.RINET.ru> <355478da-ed4d-60bb-bb4e-144a694e28b8@selasky.org> <20170518150030.GA55481@lath.RINET.ru> From: Benjamin Kaduk Date: Thu, 18 May 2017 10:10:01 -0500 Message-ID: Subject: Re: svn commit: r305177 - head/sys/net To: Oleg Bulyzhin Cc: Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , araujo@freebsd.org, hps@freebsd.org, "svn-src-head@freebsd.org" , Sepherosa Ziehau Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Thu, 18 May 2017 15:10:06 -0000 On Thu, May 18, 2017 at 10:00 AM, Oleg Bulyzhin wrote: > On Thu, May 18, 2017 at 04:25:01PM +0200, Hans Petter Selasky wrote: > > > > 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)). > Calculations in the C abstract machine would be performed in the 'int' type to which uint16 operands are promoted, though. -Ben