* Re: [LARTC] Out of IMQ interfaces
2003-07-07 20:32 [LARTC] Out of IMQ interfaces Hasso Tepper
@ 2003-07-08 2:59 ` Patrick McHardy
2003-07-08 8:45 ` Alexander Trotsai
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2003-07-08 2:59 UTC (permalink / raw)
To: lartc
Hasso Tepper wrote:
>But there is problem though - router can handle more, but I'm running
>out of IMQ devices. Default is 16 devices, but it is possible to
>change it in linux/include/imq.h. Theoretical maximum is 127. There
>is bug is imq module btw, it refuses to accept bigger number of
>numdevs argument than 99. But router really can handle more.
>
The default is 2 devices. I can not imagine why there should be a 99 device
limit, there is one such limit in net/core/dev.c:dev_alloc_name, but imq
doesn't use that function. I can't really imagine alloc_netdev calling
dev_alloc_name
because the caller chooses it's own name, but i haven't checked. if you want
to make sure, change dev_alloc_name to support more than 100 devices
(trivial)
and try again. Please inform me in case of success.
Bye,
Patrick
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [LARTC] Out of IMQ interfaces
2003-07-07 20:32 [LARTC] Out of IMQ interfaces Hasso Tepper
2003-07-08 2:59 ` Patrick McHardy
@ 2003-07-08 8:45 ` Alexander Trotsai
2003-07-08 9:50 ` Hasso Tepper
2003-07-09 11:30 ` Patrick McHardy
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Trotsai @ 2003-07-08 8:45 UTC (permalink / raw)
To: lartc
May you need mark packets with iptables and one IMQ device
with htb queue
Something like
iptables -t mangle -A PREROUTING -i intf1 -j MARK --set-mark 1
.....
iptables -t mangle -A PREROUTING -i intfN -j MARK --set-mark N
iptables -t mangle -A PREROUTING -j IMQ
And to imq0 attach HTB qdisc with shaping according to mark
value
On Mon, Jul 07, 2003 at 11:32:25PM +0300, Hasso Tepper wrote:
HT>I needed router that can do "bidirectional" shaping in interface. I'm
HT>using IMQ + TBF for that at the moment. One ethernet interface is
HT>connected to "backbone", other has many vlan's. Every vlan is
HT>"connected" to IMQ device. I have wrapper scripts for maintaining
HT>this stuff and it works like a charm.
HT>But there is problem though - router can handle more, but I'm running
HT>out of IMQ devices. Default is 16 devices, but it is possible to
HT>change it in linux/include/imq.h. Theoretical maximum is 127. There
HT>is bug is imq module btw, it refuses to accept bigger number of
HT>numdevs argument than 99. But router really can handle more.
HT>So, any ideas?
HT>1) It is router, nothing more. No any services here.
HT>2) Solution should be really simple because configuration changes
HT>really often.
HT>3) Shaping "upload" only in backbone interface isn't solution.
HT>4) No need for obvious "solutions" like - buy another box ;).
HT>regards,
HT>PS. I posted with wrong from address at first. Sorry if it would be
HT>duplicate.
HT>--
HT>Hasso Tepper
HT>Elion Enterprises Ltd.
HT>WAN administrator
HT>_______________________________________________
HT>LARTC mailing list / LARTC@mailman.ds9a.nl
HT>http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
--
Best regard, Aleksander Trotsai aka MAGE-RIPE aka MAGE-UANIC
My PGP key at ftp://blackhole.adamant.ua/pgp/trotsai.key[.asc]
Big trouble - Quantum dynamics are affecting the transistors
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] Out of IMQ interfaces
2003-07-07 20:32 [LARTC] Out of IMQ interfaces Hasso Tepper
2003-07-08 2:59 ` Patrick McHardy
2003-07-08 8:45 ` Alexander Trotsai
@ 2003-07-08 9:50 ` Hasso Tepper
2003-07-09 11:30 ` Patrick McHardy
3 siblings, 0 replies; 5+ messages in thread
From: Hasso Tepper @ 2003-07-08 9:50 UTC (permalink / raw)
To: lartc
Alexander Trotsai wrote:
> May you need mark packets with iptables and one IMQ device
> with htb queue
> Something like
> iptables -t mangle -A PREROUTING -i intf1 -j MARK --set-mark 1
> .....
> iptables -t mangle -A PREROUTING -i intfN -j MARK --set-mark N
> iptables -t mangle -A PREROUTING -j IMQ
>
> And to imq0 attach HTB qdisc with shaping according to mark
> value
Yes, I thought about it, but it will make management a lot more
complicated. If I have to change rate on one vlan only? At the
moment:
Up:
iptables -t mangle -A PREROUTING -i eth1.$d+ -j IMQ --todev $d
tc qdisc add dev eth1.$d root tbf rate ...
tc qdisc add dev imq$d root tbf rate ...
ip link set imq$d up
Down:
iptables -t mangle -D PREROUTING -i eth1.$d+ -j IMQ --todev $d
tc qdisc del dev eth1.$d root
tc qdisc del dev imq$d root
ip link set imq$d down
I made wrapper script, which takes device number and shaping
parameters from command line. I can change shaping parameters on any
vlan without affecting others.
regards,
--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] Out of IMQ interfaces
2003-07-07 20:32 [LARTC] Out of IMQ interfaces Hasso Tepper
` (2 preceding siblings ...)
2003-07-08 9:50 ` Hasso Tepper
@ 2003-07-09 11:30 ` Patrick McHardy
3 siblings, 0 replies; 5+ messages in thread
From: Patrick McHardy @ 2003-07-09 11:30 UTC (permalink / raw)
To: lartc
[-- Attachment #1: Type: text/plain, Size: 1138 bytes --]
Hi Hasso,
just to correct some wrong information i gave, imq _does_ use that
function indirectly
through alloc_netdev, the caller sets the format string not the name.
Must have been
too late. Anyway, this patch should fix your problem.
Bye
Patrick
Patrick McHardy wrote:
> Hasso Tepper wrote:
>
>> But there is problem though - router can handle more, but I'm running
>> out of IMQ devices. Default is 16 devices, but it is possible to
>> change it in linux/include/imq.h. Theoretical maximum is 127. There
>> is bug is imq module btw, it refuses to accept bigger number of
>> numdevs argument than 99. But router really can handle more.
>>
> The default is 2 devices. I can not imagine why there should be a 99
> device
> limit, there is one such limit in net/core/dev.c:dev_alloc_name, but imq
> doesn't use that function. I can't really imagine alloc_netdev calling
> dev_alloc_name
> because the caller chooses it's own name, but i haven't checked. if
> you want
> to make sure, change dev_alloc_name to support more than 100 devices
> (trivial)
> and try again. Please inform me in case of success.
>
> Bye,
> Patrick
>
[-- Attachment #2: x --]
[-- Type: text/plain, Size: 398 bytes --]
===== net/core/dev.c 1.36 vs edited =====
--- 1.36/net/core/dev.c Fri May 23 19:59:51 2003
+++ edited/net/core/dev.c Wed Jul 9 13:29:21 2003
@@ -620,7 +620,7 @@
/*
* If you need over 100 please also fix the algorithm...
*/
- for (i = 0; i < 100; i++) {
+ for (i = 0; i < 128; i++) {
snprintf(buf,sizeof(buf),name,i);
if (__dev_get_by_name(buf) == NULL) {
strcpy(dev->name, buf);
^ permalink raw reply [flat|nested] 5+ messages in thread