Fwd: [netperf-dev] Controlling socket priority
|Target version:||1st Usable CeroWrt release|
awesome - we can control diffserv stuff more remotely now...
---------- Forwarded message ----------
From: Rick Jones <firstname.lastname@example.org>
Date: Thu, Aug 4, 2011 at 7:11 PM
Subject: Re: [netperf-dev] Controlling socket priority
To: Amir Vadai <email@example.com>
Cc: firstname.lastname@example.org, email@example.com
On 08/02/2011 05:16 AM, Amir Vadai wrote:
I added support for setting socket priority through netperf command line arguments.
Please consider adding it.
Many points for including src/nettest_omni and adding the output selectors.
One nit though - how portable is SO_PRIORITY? I did a quick check on an
HP-UX 11.31 system and didn't find it in any of the header files. That
being the case, the addition will need to be conditional on SO_PRIORITY
Also, how does this relate to DSCP?
Updated by Dave Täht over 2 years ago
At least on gcc/glibc calling the above patch only sets the in-kernel priority.
If you want to set the diffserv field, you need to do a:
rc = setsockopt(fd, IPPROTO_IP, IP_TOS, &socket_prio, 1);
where socket_prio is a byte. The ECN bits are automagically masked out in this call.