From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <4bone@gndrsh.dnsmgr.net> Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 090263B29D for ; Tue, 29 Dec 2020 15:13:20 -0500 (EST) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 0BTKDHSA078797; Tue, 29 Dec 2020 12:13:17 -0800 (PST) (envelope-from 4bone@gndrsh.dnsmgr.net) Received: (from 4bone@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 0BTKDGCk078796; Tue, 29 Dec 2020 12:13:16 -0800 (PST) (envelope-from 4bone) From: "Rodney W. Grimes" <4bone@gndrsh.dnsmgr.net> Message-Id: <202012292013.0BTKDGCk078796@gndrsh.dnsmgr.net> In-Reply-To: <977989B4-3537-40CC-8877-E78FE00B0A74@gmail.com> To: Jonathan Morton Date: Tue, 29 Dec 2020 12:13:16 -0800 (PST) CC: "Rodney W. Grimes" <4bone@gndrsh.dnsmgr.net>, Dave Taht , ECN-Sane X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Subject: Re: [Ecn-sane] Fwd: [PATCH net] ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst() X-BeenThere: ecn-sane@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion of explicit congestion notification's impact on the Internet List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 20:13:21 -0000 > > On 29 Dec, 2020, at 3:33 pm, Rodney W. Grimes <4bone@gndrsh.dnsmgr.net> wrote: > > > > A better fix might be to create some new macros, make the > > old macro emmit a compile time warning to weed out the > > bad use cases: > > a) Modify RT_TOS to assert a compile time warning to > > flag old usage. > > > > b) create RT_TOSBYTE, this returns the whole byte, used > > to replace RT_TOS when the whole byte is needed and > > dealt with properly. > > > > c) create RT_TOSTOSBITS, this returns ONLY the TOS bits, > > and probably should replace most of the current calls > > to RT_TOS with this, after inspecting the code to > > make sure it does the right thing. > > > > d) create RT_TOSECNBITS, this returns ONLY the ECN bits > > Agree with the principle here, quibble with the terminology. Better names for these new macros: :-) Its, blue, I tell you that bike shed must be blue! :-) > > RT_TOSBYTE > RT_TOS_DSFIELD > RT_TOS_ECNFIELD I agree that these are better names. > > This emphasises that the "TOS bits" and Precedence field have been absorbed into the Diffserv field for the past 20 years already, and that generally the talk is nowadays of a "field" or a "flag" rather than "bits". > > I would seriously consider also making the DSFIELD macro return a right-justified value, matching most Diffserv documentation tables, rather than just masking out the left-justified position it occupies within the TOS byte. This requires a second macro to correctly insert a fresh right-justified value into the left-justified position, ideally without disturbing any ECN field value already present. There is some evidence that mishandling this is a significant source of bugs in user code, if not also in kernel code. That does make since but my concern is this would require more than just a drop in replacement of RT_TOS as now you would need to replace the macro and probably modify other nerby code. If these are purely kernel macros that scope of work is well contained. Are these macro's exported from a header to userland visible code? > - Jonathan Morton -- Rod Grimes rgrimes@freebsd.org