All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] esfq hash type
@ 2004-08-17  0:42 Marcin Sura
  2004-08-17  1:24 ` Patrick McHardy
  2004-08-18  3:22 ` gypsy
  0 siblings, 2 replies; 3+ messages in thread
From: Marcin Sura @ 2004-08-17  0:42 UTC (permalink / raw)
  To: lartc

Hi

  I have a small lan (10.0.0.0/8) behind my linux box. I use MASQUERADE to allow
  users connects to internet.

  I set up an esfq qdisc for outgoing traffic. And there is a little
  question. Does source hash type in esfq recognize NATed local ip's?

-- 
Pozdrawiam
 Marcin                         mailto:slacklist@op.pl

_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

* Re: [LARTC] esfq hash type
  2004-08-17  0:42 [LARTC] esfq hash type Marcin Sura
@ 2004-08-17  1:24 ` Patrick McHardy
  2004-08-18  3:22 ` gypsy
  1 sibling, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2004-08-17  1:24 UTC (permalink / raw)
  To: lartc

[-- Attachment #1: Type: text/plain, Size: 377 bytes --]

Marcin Sura wrote:

>Hi
>
>  I have a small lan (10.0.0.0/8) behind my linux box. I use MASQUERADE to allow
>  users connects to internet.
>
>  I set up an esfq qdisc for outgoing traffic. And there is a little
>  question. Does source hash type in esfq recognize NATed local ip's?
>  
>

No, but with this little hack (against esfq-patched kernel) it does.

Regards
Patrick



[-- Attachment #2: linux-2.4.24-esfq-origsource.diff --]
[-- Type: text/x-patch, Size: 1093 bytes --]

diff -urN a/net/sched/sch_esfq.c b/net/sched/sch_esfq.c
--- a/net/sched/sch_esfq.c	2004-06-05 15:45:19.000000000 +0200
+++ b/net/sched/sch_esfq.c	2004-06-05 15:47:21.000000000 +0200
@@ -34,6 +34,7 @@
 #include <linux/etherdevice.h>
 #include <linux/notifier.h>
 #include <linux/init.h>
+#include <linux/netfilter_ipv4/ip_conntrack.h>
 #include <net/ip.h>
 #include <linux/ipv6.h>
 #include <net/route.h>
@@ -109,6 +110,18 @@
 	return h & (q->hash_divisor-1);
 }
 
+static inline u32 esfq_get_source(struct sk_buff *skb)
+{
+	struct ip_conntrack *ct;
+	int dir;
+
+	if (skb->nfct == NULL)
+		return skb->nh.iph->saddr;
+	ct = (struct ip_conntrack *)skb->nfct->master;
+	dir = CTINFO2DIR(skb->nfct - ct->infos);
+	return ct->tuplehash[dir].tuple.src.ip;
+}
+
 static unsigned esfq_hash(struct esfq_sched_data *q, struct sk_buff *skb)
 {
 	u32 h, h2;
@@ -119,7 +132,7 @@
 	{
 		struct iphdr *iph = skb->nh.iph;
 		h = iph->daddr;
-		hs = iph->saddr;
+		hs = esfq_get_source(skb);
 		h2 = hs^iph->protocol;
 		if (!(iph->frag_off&htons(IP_MF|IP_OFFSET)) &&
 		    (iph->protocol == IPPROTO_TCP ||

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

* Re: [LARTC] esfq hash type
  2004-08-17  0:42 [LARTC] esfq hash type Marcin Sura
  2004-08-17  1:24 ` Patrick McHardy
@ 2004-08-18  3:22 ` gypsy
  1 sibling, 0 replies; 3+ messages in thread
From: gypsy @ 2004-08-18  3:22 UTC (permalink / raw)
  To: lartc

Patrick McHardy wrote:
> 
> Marcin Sura wrote:
> 
> >Hi
> >  I set up an esfq qdisc for outgoing traffic. And there is a little
> >  question. Does source hash type in esfq recognize NATed local ip's?
> 
> No, but with this little hack (against esfq-patched kernel) it does.
> 
> Regards
> Patrick
> 
> diff -urN a/net/sched/sch_esfq.c b/net/sched/sch_esfq.c
> --- a/net/sched/sch_esfq.c      2004-06-05 15:45:19.000000000 +0200
> +++ b/net/sched/sch_esfq.c      2004-06-05 15:47:21.000000000 +0200

Patrick,

Does this work both with and without NAT?

I'd like to propose that the original sfq be entirely replaced with
esfq.  Except, of course, that sfq has been maintained and esfq has
not.  Nor are the esfq docs (at least what I can find) sufficient any
more.

gypsy
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

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

end of thread, other threads:[~2004-08-18  3:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-17  0:42 [LARTC] esfq hash type Marcin Sura
2004-08-17  1:24 ` Patrick McHardy
2004-08-18  3:22 ` gypsy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.