svn commit: r202749 - in user/luigi/ipfw3-head: sbin/ipfw sys/netinet sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Thu Jan 21 13:31:41 UTC 2010


Author: luigi
Date: Thu Jan 21 13:31:41 2010
New Revision: 202749
URL: http://svn.freebsd.org/changeset/base/202749

Log:
  more renaming of objects -- new_inst becomes dn_flow.

Modified:
  user/luigi/ipfw3-head/sbin/ipfw/dummynet.c
  user/luigi/ipfw3-head/sys/netinet/ip_dummynet.h
  user/luigi/ipfw3-head/sys/netinet/ipfw/dummynet.txt
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dummynet.c
  user/luigi/ipfw3-head/sys/netinet/ipfw/test_dn_sched.c

Modified: user/luigi/ipfw3-head/sbin/ipfw/dummynet.c
==============================================================================
--- user/luigi/ipfw3-head/sbin/ipfw/dummynet.c	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sbin/ipfw/dummynet.c	Thu Jan 21 13:31:41 2010	(r202749)
@@ -170,7 +170,7 @@ print_mask(struct ipfw_flow_id *id)
 }
 
 static void
-list_queue(struct new_inst *ni)
+list_flow(struct dn_flow *ni)
 {
 	char buff[255];
 	struct protoent *pe;
@@ -307,8 +307,8 @@ list_pipes(struct dn_id *oid, struct dn_
 	    }
 	    break;
 
-	case DN_NI:
-	    list_queue((struct new_inst *)oid);
+	case DN_FLOW:
+	    list_flow((struct dn_flow *)oid);
 	    break;
 
 	case DN_LINK: {

Modified: user/luigi/ipfw3-head/sys/netinet/ip_dummynet.h
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ip_dummynet.h	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ip_dummynet.h	Thu Jan 21 13:31:41 2010	(r202749)
@@ -70,7 +70,7 @@ enum {
 	DN_QUEUE,
 	DN_DELAY_LINE,
 	DN_PROFILE,
-	DN_NI,			/* struct new_inst */
+	DN_FLOW,		/* struct dn_flow */
 	//DN_FS_EXT,
 	//DN_QUEUE_EXT,
 	DN_TEXT,		/* opaque text is the object */
@@ -137,12 +137,12 @@ struct new_fs {
 };
 
 /*
- * new_inst collects flow_id and stats for queues and scheduler
+ * dn_flow collects flow_id and stats for queues and scheduler
  * instances, and is used to pass these info to userland.
  * oid.type/oid.subtype describe the object, oid.id is number
  * of the parent object.
  */
-struct new_inst {
+struct dn_flow {
 	struct dn_id oid;
 	struct	ipfw_flow_id fid;
 	uint32_t	length; /* Queue lenght, in packets */
@@ -221,13 +221,16 @@ and transmits on a private instance of a
 A PIPE is a simplified version of the above, where there
 is no flow_mask, and each scheduler instance handles a single queue.
 
-There are three data structures definining a pipe and associated queues:
+The following data structures (visible from userland) describe
+the objects used by dummynet:
 
- + dn_link, which contains the main configuration parameters related
+ + dn_link, contains the main configuration parameters related
    to delay and bandwidth;
- + dn_flowset, which contains flow masks, weights and queue
-   parameters;
- + dn_flow, which contains the queue status (flow id, statistics)
+ + dn_profile describes a delay profile;
+ + dn_flow describes the flow status (flow id, statistics)
+   
+ + new_sch describes a scheduler
+ + new_fs describes a flowset (msk, weight, queue parameters)
 
  *
  */

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/dummynet.txt
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/dummynet.txt	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/dummynet.txt	Thu Jan 21 13:31:41 2010	(r202749)
@@ -73,7 +73,7 @@ NOTE: for up-to-date details please look
 
 USERLAND-KERNEL API	(ip_dummynet.h)
 
-    struct new_pipe:
+    struct dn_link:
 	contains data about the physical link such as
 	bandwith, delay, burst size;
 
@@ -125,7 +125,7 @@ KERNEL REPRESENTATION	(ip_dn_private.h)
 		sweeps the hash table of instances deleting them
 
     struct new_schk
-	includes new_sch, new_pipe, a pointer to new_profile,
+	includes new_sch, dn_link, a pointer to new_profile,
 	a hash table of new_sch_inst, a list of new_fsk
 	attached to it.
 	CREATE: configuration command. If there are flowsets that
@@ -138,7 +138,7 @@ KERNEL REPRESENTATION	(ip_dn_private.h)
       +---------------+   sched        +--------------+
       |      sched-------------------->|      NEW_SCHK|
   -<----*sch_chain    |<-----------------*fsk_list    |
-      |NEW_FSK        |<----.          | [new_pipe]   |
+      |NEW_FSK        |<----.          | [dn_link]    |
       +---------------+     |          +--------------+
       |qht (hash)     |     |          |  siht(hash)  |
       |  [new_queue]  |     |          | [new_si]     |
@@ -297,7 +297,7 @@ To create a pipe, queue or scheduler, th
 The userland side of dummynet will prepare a buffer contains data to pass to
 kernel side.
 The buffer contains all struct needed to configure an object. In more detail,
-to configure a pipe all three structs (new_pipe, new_sch, new_fs) are needed,
+to configure a pipe all three structs (dn_link, new_sch, new_fs) are needed,
 plus the delay profile struct if the pipe has a delay profile.
 
 If configuring a scheduler only the struct new_sch is wrote in the buffer,
@@ -361,7 +361,7 @@ The kernel side of dummynet send a buffe
 pipe, all scheduler, all flowset, plus all scheduler instances and all queues.
 The dummynet user land will format the output and show only the relevant
 information.
-The buffer sent start with all pipe from the system. The entire struct new_pipe
+The buffer sent start with all pipe from the system. The entire struct dn_link
 is passed, except the delay_profile struct that is useless in user space.
 After pipes, all flowset are wrote in the buffer. The struct contains
 scheduler flowset specific data is linked with the flowset writing the
@@ -492,7 +492,7 @@ There are four request for old dummynet:
 - IP_DUMMYNET_CONFIGURE: the configure command receive a buffer depending of
   the ipfw version. After the properly extraction of all data, that depends
   by the ipfw version used, new structures are filled and then the dummynet
-  config_pipe() function is properly called. Note that the 7.2 version does
+  config_link() function is properly called. Note that the 7.2 version does
   not support some parameter as burst or delay profile.
 - IP_DUMMYNET_GET: The get command should send to the ipfw the correct buffer
   depending of its version. There are two function that build the

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_io.c	Thu Jan 21 13:31:41 2010	(r202749)
@@ -231,7 +231,7 @@ int
 dn_enqueue(struct new_queue *q, struct mbuf* m, int drop)
 {   
 	struct new_fs *f;
-	struct new_inst *ni;	/* stats for scheduler instance */
+	struct dn_flow *ni;	/* stats for scheduler instance */
 	uint64_t len;
 
 	if (q->fs == NULL || q->_si == NULL) {

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h	Thu Jan 21 13:31:41 2010	(r202749)
@@ -179,7 +179,7 @@ struct new_fsk { /* kernel side of a flo
  * should not enqueue.
  */
 struct new_queue {
-	struct new_inst ni;	/* oid, flow_id, stats */
+	struct dn_flow ni;	/* oid, flow_id, stats */
 	struct mq mq;	/* packets queue */
 	struct new_sch_inst *_si;	/* owner scheduler instance */
 	SLIST_ENTRY(new_queue) q_next; /* hash chain list for fs */
@@ -218,7 +218,7 @@ struct new_schk {
  * This struct is created a runtime.
  */
 struct new_sch_inst {
-	struct new_inst ni;	/* oid, id and stats */
+	struct dn_flow ni;	/* oid, id and stats */
 	SLIST_ENTRY(new_sch_inst) si_next; /* next item in the bucket */
 	struct delay_line dline;
 	struct new_schk *sched;	/* the template */

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dummynet.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dummynet.c	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dummynet.c	Thu Jan 21 13:31:41 2010	(r202749)
@@ -418,7 +418,7 @@ si_new(uintptr_t key, int flags, void *a
 	if (si == NULL)
 		goto error;
 	/* Set length only for the part passed up to userland. */
-	set_oid(&si->ni.oid, DN_SCH_I, sizeof(struct new_inst));
+	set_oid(&si->ni.oid, DN_SCH_I, sizeof(struct dn_flow));
 	set_oid(&(si->dline.oid), DN_DELAY_LINE,
 		sizeof(struct delay_line));
 	/* mark si and dline as outside the event queue */
@@ -790,11 +790,11 @@ copy_si_cb(void *obj, void *arg)
 {
 	struct new_sch_inst *si = obj;
 	struct copy_args *a = arg;
-	struct new_inst *ni = (struct new_inst *)(*a->start);
+	struct dn_flow *ni = (struct dn_flow *)(*a->start);
 	if (copy_obj(a->start, a->end, &si->ni, "inst",
 			si->sched->sch.sched_nr))
 		return DNHT_SCAN_END;
-	ni->oid.type = DN_NI;
+	ni->oid.type = DN_FLOW; /* override the DN_SCH_I */
 	return 0;
 }
 
@@ -1373,7 +1373,7 @@ compute_space(struct dn_id *cmd, int *to
 	if (x & DN_C_QUEUE)
 		need += dn_cfg.queue_count * sizeof(struct new_queue);
 	if (x & DN_C_SCH_INST)
-		need += dn_cfg.si_count * sizeof(struct new_inst);
+		need += dn_cfg.si_count * sizeof(struct dn_flow);
 	return need;
 }
 
@@ -1420,12 +1420,12 @@ dummynet_get(struct sockopt *sopt)
 	}
 	if (start == NULL)
 		return sooptcopyout(sopt, &cmd, sizeof(cmd));
-	ND("have %d:%d sched %d, %d:%d links %d, %d:%d flows %d, "
+	ND("have %d:%d sched %d, %d:%d links %d, %d:%d flowsets %d, "
 		"%d:%d si %d, %d:%d queues %d",
 		dn_cfg.schk_count, sizeof(struct new_sch), DN_SCH,
 		dn_cfg.schk_count, sizeof(struct dn_link), DN_LINK,
 		dn_cfg.fsk_count, sizeof(struct new_fs), DN_FS,
-		dn_cfg.si_count, sizeof(struct new_inst), DN_SCH_I,
+		dn_cfg.si_count, sizeof(struct dn_flow), DN_SCH_I,
 		dn_cfg.queue_count, sizeof(struct new_queue), DN_QUEUE);
 	sopt->sopt_valsize = sopt_valsize;
 	bcopy(&cmd, start, sizeof(cmd));

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/test_dn_sched.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/test_dn_sched.c	Thu Jan 21 13:21:06 2010	(r202748)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/test_dn_sched.c	Thu Jan 21 13:31:41 2010	(r202749)
@@ -63,7 +63,7 @@ int
 dn_enqueue(struct new_queue *q, struct mbuf* m, int drop)
 {
         struct new_fs *f;
-        struct new_inst *ni;    /* stats for scheduler instance */
+        struct dn_flow *ni;    /* stats for scheduler instance */
         uint64_t len;
 
         f = &q->fs->fs;


More information about the svn-src-user mailing list