netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/6] d80211: fix classify_1d() priority selection
@ 2006-12-14  4:02 Zhu Yi
  2006-12-14 11:13 ` Jiri Benc
  2006-12-15 13:53 ` Jiri Benc
  0 siblings, 2 replies; 3+ messages in thread
From: Zhu Yi @ 2006-12-14  4:02 UTC (permalink / raw)
  To: netdev

I don't see any reason why packets with DSCP=0x40 should have lower IEEE
802.1D priority than packets with DSCP=0x20. Spare > Background. No?

Signed-off-by: Zhu Yi <yi.zhu@intel.com>

---

 net/d80211/wme.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

e1765ea0d80ad86619300d3253e801883fd745a5
diff --git a/net/d80211/wme.c b/net/d80211/wme.c
index b9505dc..f26fe6c 100644
--- a/net/d80211/wme.c
+++ b/net/d80211/wme.c
@@ -131,9 +131,9 @@ static inline unsigned classify_1d(struc
 	dscp = ip->tos & 0xfc;
 	switch (dscp) {
 	case 0x20:
-		return 2;
-	case 0x40:
 		return 1;
+	case 0x40:
+		return 2;
 	case 0x60:
 		return 3;
 	case 0x80:
-- 
1.2.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/6] d80211: fix classify_1d() priority selection
  2006-12-14  4:02 [PATCH 3/6] d80211: fix classify_1d() priority selection Zhu Yi
@ 2006-12-14 11:13 ` Jiri Benc
  2006-12-15 13:53 ` Jiri Benc
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Benc @ 2006-12-14 11:13 UTC (permalink / raw)
  To: yi.zhu; +Cc: netdev, Jouni Malinen, John W. Linville

On Thu, 14 Dec 2006 12:02:27 +0800, Zhu Yi wrote:
> I don't see any reason why packets with DSCP=0x40 should have lower IEEE
> 802.1D priority than packets with DSCP=0x20. Spare > Background. No?

Hm, seems so. Jouni, is there any reason for this?

> 
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> 
> ---
> 
>  net/d80211/wme.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> e1765ea0d80ad86619300d3253e801883fd745a5
> diff --git a/net/d80211/wme.c b/net/d80211/wme.c
> index b9505dc..f26fe6c 100644
> --- a/net/d80211/wme.c
> +++ b/net/d80211/wme.c
> @@ -131,9 +131,9 @@ static inline unsigned classify_1d(struc
>  	dscp = ip->tos & 0xfc;
>  	switch (dscp) {
>  	case 0x20:
> -		return 2;
> -	case 0x40:
>  		return 1;
> +	case 0x40:
> +		return 2;
>  	case 0x60:
>  		return 3;
>  	case 0x80:

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 3/6] d80211: fix classify_1d() priority selection
  2006-12-14  4:02 [PATCH 3/6] d80211: fix classify_1d() priority selection Zhu Yi
  2006-12-14 11:13 ` Jiri Benc
@ 2006-12-15 13:53 ` Jiri Benc
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Benc @ 2006-12-15 13:53 UTC (permalink / raw)
  To: yi.zhu; +Cc: netdev, John W. Linville, Simon Barber

On Thu, 14 Dec 2006 12:02:27 +0800, Zhu Yi wrote:
> I don't see any reason why packets with DSCP=0x40 should have lower IEEE
> 802.1D priority than packets with DSCP=0x20. Spare > Background. No?

Applied to my tree, thanks.

I also applied the following patch on top of it:

--
Subject: [PATCH] d80211: simplify classify_1d

The switch in classify_1d can be simplified to a bit operation.

Signed-off-by: Jiri Benc <jbenc@suse.cz>

---
 net/d80211/wme.c |   19 ++-----------------
 1 files changed, 2 insertions(+), 17 deletions(-)

--- dscape.orig/net/d80211/wme.c
+++ dscape/net/d80211/wme.c
@@ -129,24 +129,9 @@ static inline unsigned classify_1d(struc
 	ip = (struct iphdr *) (skb->data + offset);
 
 	dscp = ip->tos & 0xfc;
-	switch (dscp) {
-	case 0x20:
-		return 1;
-	case 0x40:
-		return 2;
-	case 0x60:
-		return 3;
-	case 0x80:
-		return 4;
-	case 0xa0:
-		return 5;
-	case 0xc0:
-		return 6;
-	case 0xe0:
-		return 7;
-	default:
+	if (dscp & 0x1c)
 		return 0;
-	}
+	return dscp >> 5;
 }
 

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-12-15 13:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14  4:02 [PATCH 3/6] d80211: fix classify_1d() priority selection Zhu Yi
2006-12-14 11:13 ` Jiri Benc
2006-12-15 13:53 ` Jiri Benc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).