PERFORCE change 181470 for review

Alexandre Fiveg afiveg at FreeBSD.org
Wed Jul 28 08:21:56 UTC 2010


http://p4web.freebsd.org/@@181470?ac=10

Change 181470 by afiveg at ringmap-2 on 2010/07/26 23:06:14

	debugging: The userspace-process reads sometimes the old cached date from ring :( The problem is not solved yet

Affected files ...

.. //depot/projects/soc2010/ringmap/current/contrib/libpcap/ringmap_pcap.c#23 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.c#8 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.h#7 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#6 edit
.. //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#7 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.c#37 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap.h#37 edit
.. //depot/projects/soc2010/ringmap/current/sys/net/ringmap_kernel.h#7 edit
.. //depot/projects/soc2010/ringmap/scripts/build_ringmap.sh#18 edit
.. //depot/projects/soc2010/ringmap/scripts/set_ringmap.sh#19 edit
.. //depot/projects/soc2010/ringmap/scripts/tailf_ringmap_msgs.sh#13 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/close.c#6 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#6 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/main.c#8 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#8 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/open.c#8 edit
.. //depot/projects/soc2010/ringmap/tests/ringmap/tests.h#6 edit

Differences ...

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

@@ -278,6 +278,7 @@
 #if (__RINGMAP_DEB)
 			printf("Slot %d was not accepted by driver!\n", curr_slot);
 #endif 
+			printf("Slot %d was not accepted by driver!\n", curr_slot);
 			goto out;
 		}
 

==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.c#8 (text+ko) ====

@@ -1343,7 +1343,9 @@
 		IXGBE_TX_UNLOCK(txr);
 
 #ifdef RINGMAP
+		IXGBE_RX_LOCK(que->rxr);
 		adapter->rm->funcs->sync_head(que);
+		IXGBE_RX_UNLOCK(que->rxr);
 			
 		/* TODO: don't wake up the all threads, only our thread! */
 		SLIST_FOREACH(co, &adapter->rm->object_list, objects) {
@@ -1437,7 +1439,9 @@
 
 #ifdef RINGMAP
 	struct capt_object *co = NULL; 
+	IXGBE_RX_LOCK(que->rxr);
 	adapter->rm->funcs->delayed_isr(que);
+	IXGBE_RX_UNLOCK(que->rxr);
 #endif
 
 	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
@@ -1449,7 +1453,9 @@
 	more_rx = ixgbe_rxeof(que, adapter->rx_process_limit);
 
 #ifdef RINGMAP
+	IXGBE_RX_LOCK(que->rxr);
 	adapter->rm->funcs->sync_head(que);
+	IXGBE_RX_UNLOCK(que->rxr);
 	
 	/* TODO: Only our co not all */
 	SLIST_FOREACH(co, &adapter->rm->object_list, objects) {
@@ -3517,6 +3523,8 @@
 		}
 #endif 
 
+		/* To delete */
+		printf("[%s] Refreshed slot %d\n", __func__, i);
 		cleaned = i;
 		/* Calculate next index */
 		if (++i == adapter->num_rx_desc)
@@ -4318,7 +4326,7 @@
 			sendmp = rbuf->fmp;
 #ifndef RINGMAP
 			rbuf->m_pack = rbuf->fmp = NULL;
-#endif
+#endif 
 			if (sendmp != NULL) /* secondary frag */
 				sendmp->m_pkthdr.len += mp->m_len;
 			else {
@@ -4354,6 +4362,12 @@
 			sendmp->m_flags |= M_FLOWID;
 #endif
 		}
+
+#ifdef RINGMAP
+		if (adapter->rm != NULL) 
+			adapter->rm->funcs->delayed_isr_per_packet(que, i);
+#endif
+
 next_desc:
 		bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map,
 		    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
@@ -4364,31 +4378,25 @@
 
 
 #ifndef RINGMAP
-/* RINGMAP: Do not send packet to the IP-stack. And do not refresh */
+/* RINGMAP: Do not send packet to the IP-stack. */
 
 		/* Now send to the stack or do LRO */
 		if (sendmp != NULL)
 			ixgbe_rx_input(rxr, ifp, sendmp, ptype);
 
+#endif
                /* Every 8 descriptors we go to refresh mbufs */
 		if (processed == 8) {
 			ixgbe_refresh_mbufs(rxr, i);
 			processed = 0;
 		}
-#else
-		if (adapter->rm != NULL) 
-			adapter->rm->funcs->delayed_isr_per_packet(que, 
-					R_MODULO(i-1));
-#endif
 	}
 
-#ifndef RINGMAP
 	/* Refresh any remaining buf structs */
 	if (processed != 0) {
 		ixgbe_refresh_mbufs(rxr, i);
 		processed = 0;
 	}
-#endif
 
 	rxr->next_to_check = i;
 

==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ixgbe.h#7 (text+ko) ====


==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_8259.h#6 (text+ko) ====


==== //depot/projects/soc2010/ringmap/current/sys/dev/ixgbe/ringmap_ixgbe.c#7 (text+ko) ====

@@ -96,7 +96,6 @@
 	RINGMAP_LOCK(adapter->rm);
 	co = get_capt_obj(que);
 	if (co != NULL) {
-		ixgbe_refresh_mbufs(que->rxr, SW_TAIL(co->ring));
 		RINGMAP_HW_SYNC_TAIL(que, co->ring);	
 	}
 	RINGMAP_UNLOCK(adapter->rm);

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


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

@@ -32,9 +32,9 @@
 #define RINGMAP_MAX_THREADS 8
 
 struct address {
-	vm_paddr_t 	phys;
-	vm_offset_t	kern;
-	vm_offset_t	user;
+	vm_paddr_t 	volatile phys;
+	vm_offset_t	volatile kern;
+	vm_offset_t	volatile user;
 };
 
 /*
@@ -136,7 +136,7 @@
 	unsigned int pid;
 
 	/* Array of slots */
-	struct ring_slot slot[SLOTS_NUMBER];
+	struct ring_slot volatile slot[SLOTS_NUMBER];
 };
 
 

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


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


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


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


==== //depot/projects/soc2010/ringmap/tests/ringmap/close.c#6 (text+ko) ====


==== //depot/projects/soc2010/ringmap/tests/ringmap/ioctl.c#6 (text+ko) ====


==== //depot/projects/soc2010/ringmap/tests/ringmap/main.c#8 (text+ko) ====


==== //depot/projects/soc2010/ringmap/tests/ringmap/mmap.c#8 (text+ko) ====


==== //depot/projects/soc2010/ringmap/tests/ringmap/open.c#8 (text+ko) ====


==== //depot/projects/soc2010/ringmap/tests/ringmap/tests.h#6 (text+ko) ====



More information about the p4-projects mailing list