[ovs-dev] [dscp 4/4] vswitch: Use consistent representation of DSCP bits.

Ben Pfaff blp at nicira.com
Tue Apr 17 09:37:24 PDT 2012


On Mon, Apr 16, 2012 at 02:17:52PM -0700, Ethan Jackson wrote:
> There are two sensible ways to represent the 6 DSCP bits of an IP
> packet.  One could represent them as an integer in the range 0 to
> 63.  Or one could represent them as they would appear in the tos
> field (0 to 63) << 2.  Before this patch, OVS had used the former
> method for the DSCP bits in the Queue Table, and the latter for the
> DSCP in the Controller and Manager tables.  Since the ability to
> set DSCP bits in the Controller and Manager tables is so new that
> it hasn't been released yet, this patch changes it to use the
> existing style employed in the Queue table.  Hopefully this should
> make the code and configuration less confusing.
> 
> Signed-off-by: Ethan Jackson <ethan at nicira.com>

You should update the comments on inet_open_active() and
inet_open_passive() to describe the new format of their 'dscp'
parameters.

I think that the assert() in set_dscp() is a bit too much.  DSCP
values can come from the user and a bit of missing validation code
somewhere along the line could abort the program.  I'd be more
inclined to log a warning and return an error (EINVAL?).

The DSCP_DEFAULT macro expansion should be surrounded by ().

Otherwise this looks good to me.  Thank you!



More information about the dev mailing list