Discussion of explicit congestion notification's impact on the Internet
 help / color / mirror / Atom feed
From: Jonathan Morton <chromatix99@gmail.com>
To: "Rodney W. Grimes" <4bone@gndrsh.dnsmgr.net>
Cc: Dave Taht <dave.taht@gmail.com>,
	ECN-Sane <ecn-sane@lists.bufferbloat.net>
Subject: Re: [Ecn-sane] Fwd: [PATCH net] ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst()
Date: Tue, 29 Dec 2020 17:21:57 +0200	[thread overview]
Message-ID: <977989B4-3537-40CC-8877-E78FE00B0A74@gmail.com> (raw)
In-Reply-To: <202012291333.0BTDXwOf077551@gndrsh.dnsmgr.net>

> 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:

RT_TOSBYTE
RT_TOS_DSFIELD
RT_TOS_ECNFIELD

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.

 - Jonathan Morton

  reply	other threads:[~2020-12-29 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <49ff39b1f55c914847cd58678bae6282112db701.1608836260.git.gnault@redhat.com>
2020-12-29  3:18 ` Dave Taht
2020-12-29 13:33   ` Rodney W. Grimes
2020-12-29 15:21     ` Jonathan Morton [this message]
2020-12-29 20:13       ` Rodney W. Grimes
2020-12-29 20:59         ` Jonathan Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.bufferbloat.net/postorius/lists/ecn-sane.lists.bufferbloat.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=977989B4-3537-40CC-8877-E78FE00B0A74@gmail.com \
    --to=chromatix99@gmail.com \
    --cc=4bone@gndrsh.dnsmgr.net \
    --cc=dave.taht@gmail.com \
    --cc=ecn-sane@lists.bufferbloat.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox