X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=iproute2-2.2.4-wrr.patch;h=4a46e8cef8b966c5757eb885006b4eac53aed4ea;hb=a7f458f6dd59f0892761325911d24cf4c1d43a1e;hp=281caf4ba95d87e8e7c33e4f3253e4aa433ae682;hpb=23166bc15fcca82c1d6496230e0b86ba5f1cca96;p=packages%2Fiproute2.git diff --git a/iproute2-2.2.4-wrr.patch b/iproute2-2.2.4-wrr.patch index 281caf4..4a46e8c 100644 --- a/iproute2-2.2.4-wrr.patch +++ b/iproute2-2.2.4-wrr.patch @@ -1,35 +1,22 @@ -diff -uNrbB org/tc/Makefile new/tc/Makefile ---- org/tc/Makefile Fri Feb 25 20:51:57 2000 -+++ new/tc/Makefile Mon Feb 12 17:24:48 2001 -@@ -9,6 +9,7 @@ - TCMODULES += q_prio.o +diff -urN iproute-2.6.20-070313-orig/tc/Makefile iproute-2.6.20-070313/tc/Makefile +--- iproute-2.6.20-070313-orig/tc/Makefile 2007-03-13 22:50:56.000000000 +0100 ++++ iproute-2.6.20-070313/tc/Makefile 2007-04-15 20:52:33.000000000 +0200 +@@ -11,6 +11,7 @@ TCMODULES += q_tbf.o TCMODULES += q_cbq.o + TCMODULES += q_netem.o +TCMODULES += q_wrr.o + TCMODULES += q_choke.o + TCMODULES += q_sfb.o TCMODULES += f_rsvp.o TCMODULES += f_u32.o - TCMODULES += f_route.o -diff -uNrbB org/tc/q_wrr.c new/tc/q_wrr.c ---- org/tc/q_wrr.c Thu Jan 1 01:00:00 1970 -+++ new/tc/q_wrr.c Sun Sep 9 12:44:28 2001 -@@ -0,0 +1,437 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "utils.h" -+#include "tc_util.h" -+ -+#define usage() return(-1) -+ -+#ifdef NEED_WRR_DEFS +diff -urN iproute-2.6.20-070313-orig/include/linux/pkt_sched.h iproute-2.6.20-070313/include/linux/pkt_sched.h +--- iproute-2.6.20-070313-orig/include/linux/pkt_sched.h 2007-03-13 22:50:56.000000000 +0100 ++++ iproute-2.6.20-070313/include/linux/pkt_sched.h 2007-04-15 20:52:33.000000000 +0200 +@@ -466,4 +498,116 @@ + + #define NETEM_DIST_SCALE 8192 + +/* WRR section */ + +/* Other includes */ @@ -38,110 +25,131 @@ diff -uNrbB org/tc/q_wrr.c new/tc/q_wrr.c +// A sub weight and of a class +// All numbers are represented as parts of (2^64-1). +struct tc_wrr_class_weight { -+ __u64 val; // Current value (0 is not valid) -+ __u64 decr; // Value pr bytes (2^64-1 is not valid) -+ __u64 incr; // Value pr seconds (2^64-1 is not valid) -+ __u64 min; // Minimal value (0 is not valid) -+ __u64 max; // Minimal value (0 is not valid) -+ -+ // The time where the above information was correct: -+ time_t tim; ++ __u64 val; // Current value (0 is not valid) ++ __u64 decr; // Value pr bytes (2^64-1 is not valid) ++ __u64 incr; // Value pr seconds (2^64-1 is not valid) ++ __u64 min; // Minimal value (0 is not valid) ++ __u64 max; // Minimal value (0 is not valid) ++ ++// The time where the above information was correct: ++ time_t tim; +}; + -+// Pakcet send when modifying a class: ++// Packet send when modifying a class: +struct tc_wrr_class_modf { -+ // Not-valid values are ignored. -+ struct tc_wrr_class_weight weight1; -+ struct tc_wrr_class_weight weight2; ++ // Not-valid values are ignored. ++ struct tc_wrr_class_weight weight1; ++ struct tc_wrr_class_weight weight2; +}; + +// Packet returned when quering a class: +struct tc_wrr_class_stats { -+ char used; // If this is false the information below is invalid ++ char used; // If this is false the information below is invalid + -+ struct tc_wrr_class_modf class_modf; ++ struct tc_wrr_class_modf class_modf; + -+ unsigned char addr[ETH_ALEN]; -+ char usemac; // True if addr is a MAC address, else it is an IP address -+ // (this value is only for convience, it is always the same -+ // value as in the qdisc) -+ int heappos; // Current heap position or 0 if not in heap -+ __u64 penal_ls; // Penalty value in heap (ls) -+ __u64 penal_ms; // Penalty value in heap (ms) ++ unsigned char addr[ETH_ALEN]; ++ char usemac; // True if addr is a MAC address, else it is an IP address ++ // (this value is only for convience, it is always the same ++ // value as in the qdisc) ++ int heappos; // Current heap position or 0 if not in heap ++ __u64 penal_ls; // Penalty value in heap (ls) ++ __u64 penal_ms; // Penalty value in heap (ms) +}; + +// Qdisc-wide penalty information (boolean values - 2 not valid) +struct tc_wrr_qdisc_weight { -+ char weight_mode; // 0=No automatic change to weight -+ // 1=Decrease normally -+ // 2=Also multiply with number of machines -+ // 3=Instead multiply with priority divided -+ // with priority of the other. -+ // -1=no change ++ char weight_mode; // 0=No automatic change to weight ++ // 1=Decrease normally ++ // 2=Also multiply with number of machines ++ // 3=Instead multiply with priority divided ++ // with priority of the other. ++ // -1=no change +}; + +// Packet send when modifing a qdisc: +struct tc_wrr_qdisc_modf { -+ // Not-valid values are ignored: -+ struct tc_wrr_qdisc_weight weight1; -+ struct tc_wrr_qdisc_weight weight2; ++ // Not-valid values are ignored: ++ struct tc_wrr_qdisc_weight weight1; ++ struct tc_wrr_qdisc_weight weight2; +}; + +// Packet send when creating a qdisc: +struct tc_wrr_qdisc_crt { -+ struct tc_wrr_qdisc_modf qdisc_modf; -+ -+ char srcaddr; // 1=lookup source, 0=lookup destination -+ char usemac; // 1=Classify on MAC addresses, 0=classify on IP -+ char usemasq; // 1=Classify based on masqgrading - only valid -+ // if usemac is zero -+ int bands_max; // Maximal number of bands (i.e.: classes) -+ int proxy_maxconn; // If differnt from 0 then we support proxy remapping -+ // of packets. And this is the number of maximal -+ // concurrent proxy connections. ++ struct tc_wrr_qdisc_modf qdisc_modf; ++ ++ char srcaddr; // 1=lookup source, 0=lookup destination ++ char usemac; // 1=Classify on MAC addresses, 0=classify on IP ++ char usemasq; // 1=Classify based on masqgrading - only valid ++ // if usemac is zero ++ int bands_max; // Maximal number of bands (i.e.: classes) ++ int proxy_maxconn;// If differnt from 0 then we support proxy remapping ++ // of packets. And this is the number of maximal ++ // concurrent proxy connections. +}; + +// Packet returned when quering a qdisc: +struct tc_wrr_qdisc_stats { -+ struct tc_wrr_qdisc_crt qdisc_crt; -+ int proxy_curconn; -+ int nodes_in_heap; // Current number of bands wanting to send something -+ int bands_cur; // Current number of bands used (i.e.: MAC/IP addresses seen) -+ int bands_reused; // Number of times this band has been reused. -+ int packets_requed; // Number of times packets have been requeued. -+ __u64 priosum; // Sum of priorities in heap where 1 is 2^32 ++ struct tc_wrr_qdisc_crt qdisc_crt; ++ int proxy_curconn; ++ int nodes_in_heap; // Current number of bands wanting to send something ++ int bands_cur; // Current number of bands used (i.e.: MAC/IP addresses seen) ++ int bands_reused; // Number of times this band has been reused. ++ int packets_requed; // Number of times packets have been requeued. ++ __u64 priosum; // Sum of priorities in heap where 1 is 2^32 +}; + +struct tc_wrr_qdisc_modf_std { -+ // This indicates which of the tc_wrr_qdisc_modf structers this is: -+ char proxy; // 0=This struct ++ // This indicates which of the tc_wrr_qdisc_modf structers this is: ++ char proxy; // 0=This struct + -+ // Should we also change a class? -+ char change_class; ++ // Should we also change a class? ++ char change_class; + -+ // Only valid if change_class is false -+ struct tc_wrr_qdisc_modf qdisc_modf; -+ -+ // Only valid if change_class is true: -+ unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0) -+ struct tc_wrr_class_modf class_modf; // The change ++ // Only valid if change_class is false ++ struct tc_wrr_qdisc_modf qdisc_modf; ++ ++ // Only valid if change_class is true: ++ unsigned char addr[ETH_ALEN]; // Class to change (non-used bytes should be 0) ++ struct tc_wrr_class_modf class_modf; // The change +}; + +// Used for proxyrempping: +struct tc_wrr_qdisc_modf_proxy { -+ // This indicates which of the tc_wrr_qdisc_modf structers this is: -+ char proxy; // 1=This struct -+ -+ // This is 1 if the proxyremap information should be reset -+ char reset; -+ -+ // changec is the number of elements in changes. -+ int changec; -+ -+ // This is an array of type ProxyRemapBlock: -+ long changes[0]; ++ // This indicates which of the tc_wrr_qdisc_modf structers this is: ++ char proxy; // 1=This struct ++ ++ // This is 1 if the proxyremap information should be reset ++ char reset; ++ ++ // changec is the number of elements in changes. ++ int changec; ++ ++ // This is an array of type ProxyRemapBlock: ++ long changes[0]; +}; -+#endif /* NEED_WRR_DEFS */ ++ + #endif + +diff -urN iproute-2.6.20-070313-orig/tc/q_wrr.c iproute-2.6.20-070313/tc/q_wrr.c +--- iproute-2.6.20-070313-orig/tc/q_wrr.c 1970-01-01 01:00:00.000000000 +0100 ++++ iproute-2.6.20-070313/tc/q_wrr.c 2007-04-15 20:52:33.000000000 +0200 +@@ -0,0 +1,322 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "utils.h" ++#include "tc_util.h" ++ ++#define usage() return(-1) + +// Returns -1 on error +static int wrr_parse_qdisc_weight(int argc, char** argv, @@ -441,12 +449,11 @@ diff -uNrbB org/tc/q_wrr.c new/tc/q_wrr.c +} + + -+struct qdisc_util wrr_util = { -+ NULL, -+ "wrr", -+ wrr_parse_opt, -+ wrr_print_opt, -+ wrr_print_xstats, -+ wrr_parse_copt, -+ wrr_print_copt ++struct qdisc_util wrr_qdisc_util = { ++ .id = "wrr", ++ .parse_qopt = wrr_parse_opt, ++ .print_qopt = wrr_print_opt, ++ .print_xstats = wrr_print_xstats, ++ .parse_copt = wrr_parse_copt, ++ .print_copt = wrr_print_copt +};