Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Aug 2010 18:25:53 GMT
From:      Alexandre Fiveg <afiveg@skunkworks.freebsd.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 182125 for review
Message-ID:  <201008111825.o7BIPrqo083880@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@182125?ac=10

Change 182125 by afiveg@cottonmouth on 2010/08/09 11:29:28

	Set slot takes only capt_object as parameter and slot number. Other things like dev, ring, etc.. are stored in the capt_object

Affected files ...

.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#29 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#21 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#28 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#26 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#18 edit
.. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#23 edit
.. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#24 edit
.. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#18 edit

Differences ...

==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#29 (text+ko) ====

@@ -276,7 +276,7 @@
 extern int ringmap_attach (device_t, struct ringmap_functions *);
 extern int ringmap_detach (device_t);
 
-extern struct ringmap_functions ringmap_f;
+extern struct ringmap_functions ringmap_8254_f;
 #endif 
 
 #ifdef DEVICE_POLLING
@@ -686,7 +686,7 @@
 	    device_get_nameunit(dev));
 
 #ifdef RINGMAP
-	ringmap_attach (dev, &ringmap_f);
+	ringmap_attach (dev, &ringmap_8254_f);
 #endif 
 
 	INIT_DEBUGOUT("lem_attach: end");

==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#21 (text+ko) ====


==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#28 (text+ko) ====

@@ -23,15 +23,15 @@
 device_t rm_8254_get_device_p(struct cdev *);
 void rm_8254_enable_intr(device_t);
 void rm_8254_disable_intr(device_t);
-int rm_8254_set_slot(struct ring *, device_t, unsigned int);
+int rm_8254_set_slot(struct capt_object *, unsigned int);
 void rm_8254_interrupt(void *);
 void rm_8254_delayed_interrupt(void *);
+void rm_8254_delayed_interrupt_per_packet(void *, int);
 int rm_8254_print_ring_pointers(struct adapter *);
-void rm_8254_sync_head_tail(device_t);
-void rm_8254_sync_tail(device_t);
-void rm_8254_sync_head(device_t);
-void rm_8254_delayed_interrupt_per_packet(device_t, int);
+void rm_8254_sync_tail(void *);
+void rm_8254_sync_head(void *);
 struct ring * rm_8254_find_next(struct adapter *);
+int rm_8254_set_queue(struct capt_object *, unsigned int);
 
 extern devclass_t em_devclass;
 extern void	lem_enable_intr(struct adapter *);
@@ -40,48 +40,39 @@
 extern void print_capt_obj(struct capt_object *);
 
 
-struct ringmap_functions ringmap_f = {
+struct ringmap_functions ringmap_8254_f = {
 	rm_8254_set_ringmap_to_adapter,
 	rm_8254_enable_intr,
 	rm_8254_disable_intr,
 	rm_8254_interrupt,
 	rm_8254_delayed_interrupt,
 	rm_8254_delayed_interrupt_per_packet,
-	rm_8254_sync_head_tail,
 	rm_8254_sync_tail,
 	rm_8254_sync_head,
 	rm_8254_set_slot,
+	rm_8254_set_queue,
 	rm_8254_get_ringmap_p,
 	rm_8254_get_device_p
 };
 
 
 /* 
- * This function synchronize the tail and head hardware registers
- * with head and tail software varibles, that are visible from 
- * software process. 
- *
- * Synchronisation rules:
- * 1. SYNC_HEAD: ring->kernrp = RDH
+ * Write the userrp into the RDT register
  * 2. SYNC_TAIL: RDT =  ring->userrp
  */
 void 
-rm_8254_sync_head_tail(device_t dev)
+rm_8254_sync_tail(void *context)
 {
-	rm_8254_sync_tail(dev);
-	rm_8254_sync_head(dev);
-}
-
-
-void 
-rm_8254_sync_tail(device_t dev)
-{
-	struct adapter *adapter;
-	adapter = (struct adapter *)device_get_softc(dev);
+	device_t dev = (device_t)context;
+	struct adapter *adapter = (struct adapter *)device_get_softc(dev);
 	struct ring *ring = NULL;
 
 	RINGMAP_FUNC_DEBUG(start);
 
+	/* 
+	 * In case if there are many processes that capture, take the 
+	 * userrp from process that is next to RDH.
+	 */
 	ring = rm_8254_find_next(adapter);
 
 #if (__RINGMAP_DEB)
@@ -93,19 +84,26 @@
 	RINGMAP_FUNC_DEBUG(end);
 }
 
-
+/* Set value from RDH to the ring->kernrp*/
 void 
-rm_8254_sync_head(device_t dev)
+rm_8254_sync_head(void *context)
 {
+	device_t dev = (device_t)context;
 	struct capt_object *co = NULL;
 	struct adapter *adapter;
 
 	RINGMAP_FUNC_DEBUG(start);
 
 	adapter = (struct adapter *)device_get_softc(dev);
+	if (adapter->rm == NULL)
+		return;
 
 	RINGMAP_LOCK(adapter->rm);
 
+	/* 
+	 * In case if there are many processes that capture, set in the 
+	 * ring structure of each process the kernrp
+	 */
 	SLIST_FOREACH(co, &adapter->rm->object_list, objects) {
 		if (co->ring != NULL) {
 			RINGMAP_HW_SYNC_HEAD(adapter, co->ring); 
@@ -187,8 +185,9 @@
 }
 
 void 
-rm_8254_delayed_interrupt_per_packet(device_t dev, int slot_num)
+rm_8254_delayed_interrupt_per_packet(void *context, int slot_num)
 {
+	device_t dev = (device_t)context;
 	struct capt_object *co = NULL;
 	struct adapter *adapter = NULL;
 	struct ringmap *rm = NULL;
@@ -220,10 +219,11 @@
 
 
 int
-rm_8254_set_slot(struct ring *ring, device_t dev, unsigned int slot_num)
+rm_8254_set_slot(struct capt_object *co, unsigned int slot_num)
 {
-	struct adapter *adapter = NULL;
-	adapter = (struct adapter *)device_get_softc(dev);
+	device_t dev = co->dev;
+	struct adapter *adapter = (struct adapter *)device_get_softc(dev);
+	struct ring *ring = co->ring;
 
 #if (__RINGMAP_DEB)
 	printf("[%s] Set slot: %d\n", __func__, slot_num);
@@ -346,6 +346,7 @@
 }
 
 
+/* Print the values from RDT and RDH */
 int 
 rm_8254_print_ring_pointers(struct adapter *adapter)
 {
@@ -368,3 +369,13 @@
 out:
 	return (0);
 }
+
+
+int 
+rm_8254_set_queue(struct capt_object *co, unsigned int i)
+{
+	/* No multiqueue for 8254 */
+	co->que = NULL;
+
+	return (0);
+}

==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#26 (text+ko) ====


==== //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_e1000.h#18 (text+ko) ====


==== //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#23 (text+ko) ====


==== //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#24 (text+ko) ====


==== //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#18 (text+ko) ====




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008111825.o7BIPrqo083880>