Patchwork Still using IPTOS_TOS() in kernel? Really???

login
register
mail settings
Submitter Torsten Schmidt
Date Dec. 21, 2009, 8:50 p.m.
Message ID <200912212150.34727.schmto@hrz.tu-chemnitz.de>
Download mbox | patch
Permalink /patch/41565/
State RFC
Delegated to: David Miller
Headers show

Comments

Torsten Schmidt - Dec. 21, 2009, 8:50 p.m.
Hi Philip,

here a second PATCH to add the missing DSCP classes to 
ipv4_dscp_stat(), also tested against 2.6.32. 

Next step is to add IN / OUT statistic to DSCP. Maybe 
/proc/net/ipdscp will look like:
CS0	in	out
CS1	in	out
...
EF	in	out


any comments ?
Torsten
Philip Prindeville - Dec. 21, 2009, 9:28 p.m.
On 12/21/2009 12:50 PM, Torsten Schmidt wrote:
> Hi Philip,
> 
> here a second PATCH to add the missing DSCP classes to 
> ipv4_dscp_stat(), also tested against 2.6.32. 
> 
> Next step is to add IN / OUT statistic to DSCP. Maybe 
> /proc/net/ipdscp will look like:
> CS0	in	out
> CS1	in	out
> ...
> EF	in	out
> 
> 
> any comments ?
> Torsten

Hi Torsten,

Yes, the MIB changes are certainly important... we are more focused though on actually updating the default queuing strategies.

I'll poke around and see if I can figure out how that works...

Looking at include/linux/pkt_sched.h:

#define TC_PRIO_BESTEFFORT              0
#define TC_PRIO_FILLER                  1
#define TC_PRIO_BULK                    2
#define TC_PRIO_INTERACTIVE_BULK        4
#define TC_PRIO_INTERACTIVE             6
#define TC_PRIO_CONTROL                 7

it seems that these TC priorities are just random, unrelated buckets and their ordinality has no relation to their priority.  Is that correct?

If that's the case, then you *can't* just do:

static inline char rt_dscp2priority(u8 tos)
{
	return IPTOS_PREC(tos)>>5;
}

for instance.  No, that would be too easy.  :-)

-Philip


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

From 58a2a79f4083fa614637cab13fe7df99b92b6fcf Mon Sep 17 00:00:00 2001
From: Torsten Schmidt <schmto@hrz.tu-chemnitz.de>
Date: Mon, 21 Dec 2009 21:30:44 +0100
Subject: [PATCH 2/2] ipv4: add missing DSCP classes

This patch adds the missing IANA DSCP registry entries to ipv4 DSCP
statistic counter. See /proc/net/ipdscp

Signed-off-by: Torsten Schmidt <schmto@hrz.tu-chemnitz.de>
---
 include/net/ipdscp.h |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/include/net/ipdscp.h b/include/net/ipdscp.h
index d5bce81..14cc8a6 100644
--- a/include/net/ipdscp.h
+++ b/include/net/ipdscp.h
@@ -58,7 +58,25 @@  static inline void ipv4_dscp_stat(struct net *net, __u8 dsfield)
 	switch (dsfield >> 2) {
 	case IP_DSCP_CS0:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS0);break;
 	case IP_DSCP_EF:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_EF);break;
-	/* add new entrys here ... */
+	case IP_DSCP_CS1:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS1);break;
+	case IP_DSCP_CS2:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS2);break;
+	case IP_DSCP_CS3:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS3);break;
+	case IP_DSCP_CS4:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS4);break;
+	case IP_DSCP_CS5:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS5);break;
+	case IP_DSCP_CS6:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS6);break;
+	case IP_DSCP_CS7:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_CS7);break;
+	case IP_DSCP_AF11:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF11);break;
+	case IP_DSCP_AF12:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF12);break;
+	case IP_DSCP_AF13:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF13);break;
+	case IP_DSCP_AF21:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF21);break;
+	case IP_DSCP_AF22:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF22);break;
+	case IP_DSCP_AF23:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF23);break;
+	case IP_DSCP_AF31:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF31);break;
+	case IP_DSCP_AF32:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF32);break;
+	case IP_DSCP_AF33:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF33);break;
+	case IP_DSCP_AF41:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF41);break;
+	case IP_DSCP_AF42:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF42);break;
+	case IP_DSCP_AF43:	IP_DSCP_INC_STATS_BH(net, LINUX_MIB_IPDSCP_AF43);break;
 	}
 }
 
-- 
1.6.3.3