Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Jun 2010 11:37:50 GMT
From:      Alexandre Fiveg <afiveg@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 180208 for review
Message-ID:  <201006251137.o5PBboap091071@repoman.freebsd.org>

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

Change 180208 by afiveg@cottonmouth on 2010/06/25 11:36:51

	comments update

Affected files ...

.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#4 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.c#12 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/if_lem.h#10 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.c#11 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/e1000/ringmap_8254.h#9 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#15 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#15 edit

Differences ...

==== //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#4 (text+ko) ====


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


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


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


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


==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#15 (text+ko) ====


==== //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#15 (text+ko) ====

@@ -45,7 +45,14 @@
 };
 
 /*
- * This structure represents the ring slot. 
+ * This structure represents the ring slot. Each slot contains three 
+ * entities: descriptor, mbuf and packet. The descriptore represents 
+ * the hardware view of of packet. Mbuf represents the kernel view of 
+ * packet. The packet represents the buffer where the packet data placed. 
+ *
+ * Each entity is of type 'struct address'. Struct 'address' contains 
+ * three addresses: physical-, kernel- and user-address. We need to store 
+ * the physical addresses to be able to do memory mapping. 
  */
 struct ring_slot {
 
@@ -71,19 +78,28 @@
 };
 
 /*
- * Packet ring buffer
+ * This structure represents the packets ringbuffer.  The structure should be
+ * mapped into the user-space to be visible and accessible from the user
+ * capturing application. The ring contains the pointer to SLOTs array. Each
+ * SLOT represents one packet. Additionaly, the structure the ring-HEAD
+ * (kernrp) and ring-TAIL (userrp). 
  */
 struct ring {
 
 	/*
 	 * kernrp - ring HEAD. Should be changed ONLY in driver. And should be
-	 * synchronized with the hardware ring HEAD register (RDH).
+	 * synchronized with the adapter-ring-HEAD register. Adapter increments 
+	 * the value in its HEAD-register after storing the incomming packets
+	 * in the RAM. The driver shoud in the ISR check the value in the 
+	 * adapter-HEAD-register and set this value in kernrp.
 	 */
 	unsigned int volatile kernrp;
 
 	/* 
 	 * userrp - ring TAIL. Should be incremented by user space software after
-	 * reading the slots with a new received packets
+	 * reading the slots with a new received packets. The driver, while 
+	 * executing ISR shoud check the value in userrp and set this value in 
+	 * the adapter-TAIL-register.
 	 */
 	unsigned int volatile userrp;
 
@@ -138,6 +154,12 @@
 	unsigned int controller_type;
 };
 
+/*
+ * This structure will be visible only in the kernel. It contains 
+ * the pointers to the ring that should be mapped in user-space, 
+ * to the functions for accessing the ring and for accessing to the 
+ * device and driver structures
+ */
 struct ringmap {
 	/* Device structure of network adapter */
 	device_t dev;
@@ -148,9 +170,6 @@
 	/* Now only one process can only one time open device */
 	uint32_t volatile open_cnt;
 	
-	/* How many packets have counted driver in RAM */
-	unsigned long long 	pkts_counter;
-
 	/* Hardware dependent functions */
 	struct ringmap_functions *funcs;
 
@@ -380,3 +399,5 @@
 #endif
 
 
+
+



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