Re: nfe(4) hardware checksum support

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <cube@...>
Cc: <jmarin@...>, <tech-net@...>, <tech-kern@...>, <tsutsui@...>
Date: Sunday, February 4, 2007 - 1:40 am

cube@cubidou.net wrote:


If it's caused by some race condition, how about the attached one?

BTW, which is your port, i386 or amd64?
With a quick glance there is not any improper reordering around
descriptor access even without volatile on i386, but I'm not sure.
---
Izumi Tsutsui


Index: if_nfereg.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_nfereg.h,v
retrieving revision 1.3
diff -u -r1.3 if_nfereg.h
--- if_nfereg.h	9 Jan 2007 10:29:27 -0000	1.3
+++ if_nfereg.h	4 Feb 2007 05:01:10 -0000
@@ -144,9 +147,9 @@
 
 /* Rx/Tx descriptor */
 struct nfe_desc32 {
-	uint32_t	physaddr;
-	uint16_t	length;
-	uint16_t	flags;
+	volatile uint32_t	physaddr;
+	volatile uint16_t	length;
+	volatile uint16_t	flags;
 #define NFE_RX_FIXME_V1		0x6004
 #define NFE_RX_VALID_V1		(1 << 0)
 #define NFE_TX_ERROR_V1		0x7808
@@ -155,12 +158,12 @@
 
 /* V2 Rx/Tx descriptor */
 struct nfe_desc64 {
-	uint32_t	physaddr[2];
-	uint32_t	vtag;
+	volatile uint32_t	physaddr[2];
+	volatile uint32_t	vtag;
 #define NFE_RX_VTAG		(1 << 16)
 #define NFE_TX_VTAG		(1 << 18)
-	uint16_t	length;
-	uint16_t	flags;
+	volatile uint16_t	length;
+	volatile uint16_t	flags;
 #define NFE_RX_FIXME_V2		0x4300
 #define NFE_RX_VALID_V2		(1 << 13)
 #define NFE_RX_IP_CSUMOK	(1 << 12)
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
nfe(4) hardware checksum support, Izumi Tsutsui, (Mon Jan 1, 2:45 am)
Re: nfe(4) hardware checksum support, Jukka Marin, (Sat Jan 6, 2:15 pm)
Re: nfe(4) hardware checksum support, Jared D. McNeill, (Sat Jan 6, 9:18 pm)
Re: nfe(4) hardware checksum support, Jukka Marin, (Wed Jan 24, 1:57 pm)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Thu Jan 25, 11:01 am)
Re: nfe(4) hardware checksum support, Jukka Marin, (Mon Jan 29, 6:55 am)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sat Feb 3, 11:46 pm)
Re: nfe(4) hardware checksum support, Jared D. McNeill, (Sun Feb 4, 11:56 am)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sun Feb 4, 12:37 pm)
Re: nfe(4) hardware checksum support, Quentin Garnier, (Sun Feb 4, 12:31 am)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sun Feb 4, 1:40 am)
Re: nfe(4) hardware checksum support, Jukka Marin, (Sat Mar 10, 11:47 am)
Re: nfe(4) hardware checksum support, Jukka Marin, (Sun Feb 4, 4:51 am)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sun Feb 4, 6:23 am)
Re: nfe(4) hardware checksum support, Jukka Marin, (Wed Jan 10, 2:29 pm)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sat Jan 6, 8:41 pm)
Re: nfe(4) hardware checksum support, César Catrián Carreño, (Fri Jan 5, 2:19 pm)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Sat Jan 6, 12:24 pm)
Re: nfe(4) hardware checksum support, César Catrián Carreño, (Mon Jan 8, 12:38 pm)
Re: nfe(4) hardware checksum support, Izumi Tsutsui, (Tue Jan 9, 6:50 am)
Re: nfe(4) hardware checksum support, Thomas E. Spanjaard, (Fri Jan 5, 10:04 pm)