summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_dummynet.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2005-11-29 00:11:01 +0000
committerglebius <glebius@FreeBSD.org>2005-11-29 00:11:01 +0000
commit1de2727068c3d74bb7342410ff133fc9e1de6680 (patch)
tree92ed2a7dd6a58e67c18b475aa3889747d223a489 /sys/netinet/ip_dummynet.h
parent3de8a0378fe9d46d02eec1b0054452fdcdee5327 (diff)
downloadFreeBSD-src-1de2727068c3d74bb7342410ff133fc9e1de6680.zip
FreeBSD-src-1de2727068c3d74bb7342410ff133fc9e1de6680.tar.gz
First step in removing welding between ipfw(4) and dummynet.
o Do not use ipfw_insn_pipe->pipe_ptr in locate_flowset(). The _ipfw_insn_pipe isn't touched by this commit to preserve ABI compatibility. o To optimize the lookup of the pipe/flowset in locate_flowset() introduce hashes for pipes and queues: - To preserve ABI compatibility utilize the place of global list pointer for SLIST_ENTRY. - Introduce locate_flowset(queue nr) and locate_pipe(pipe nr). o Rework all the dummynet code to deal with the hashes, not global lists. Also did some style(9) changes in the code blocks that were touched by this sweep: - Be conservative about flowset and pipe variable names on stack, use "fs" and "pipe" everywhere. - Cleanup whitespaces. - Sort variables. - Give variables more meaningful names. - Uppercase and dots in comments. - ENOMEM when malloc(9) failed.
Diffstat (limited to 'sys/netinet/ip_dummynet.h')
-rw-r--r--sys/netinet/ip_dummynet.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/ip_dummynet.h b/sys/netinet/ip_dummynet.h
index b98ee4c..9749c08 100644
--- a/sys/netinet/ip_dummynet.h
+++ b/sys/netinet/ip_dummynet.h
@@ -249,7 +249,7 @@ struct dn_flow_queue {
* latter case, the structure is located inside the struct dn_pipe).
*/
struct dn_flow_set {
- struct dn_flow_set *next; /* next flow set in all_flow_sets list */
+ SLIST_ENTRY(dn_flow_set) next; /* linked list in a hash slot */
u_short fs_nr ; /* flow_set number */
u_short flags_fs;
@@ -297,7 +297,8 @@ struct dn_flow_set {
int lookup_weight ; /* equal to (1-w_q)^t / (1-w_q)^(t+1) */
int avg_pkt_size ; /* medium packet size */
int max_pkt_size ; /* max packet size */
-} ;
+};
+SLIST_HEAD(dn_flow_set_head, dn_flow_set);
/*
* Pipe descriptor. Contains global parameters, delay-line queue,
@@ -314,7 +315,7 @@ struct dn_flow_set {
*
*/
struct dn_pipe { /* a pipe */
- struct dn_pipe *next ;
+ SLIST_ENTRY(dn_pipe) next; /* linked list in a hash slot */
int pipe_nr ; /* number */
int bandwidth; /* really, bytes/tick. */
@@ -343,6 +344,7 @@ struct dn_pipe { /* a pipe */
struct dn_flow_set fs ; /* used with fixed-rate flows */
};
+SLIST_HEAD(dn_pipe_head, dn_pipe);
#ifdef _KERNEL
typedef int ip_dn_ctl_t(struct sockopt *); /* raw_ip.c */
OpenPOWER on IntegriCloud