This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bug (I think) in ethernet driver for XScale 80310


Richard Wicks wrote:
> The file
> ${ECOS_REPOSITORY}devs/eth/arm/iq80310/current/include/iq80310_info.h defines
> MAX_RX_DESCRIPTORS and MAX_RX_DESCRIPTORS both to 128 when eCos is compiled
> for the target=iq80310 template=net.  However, the amount of memory that is
> reserved total for these descriptors appears to only be 16KB regardless of
> the number of descriptors defined in iq80310_info.h

Looks like you're right IMHO.

Mark, I can't test this patch, so in your opinion does it look okay to
check-in?

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Index: ChangeLog
===================================================================
RCS file: /home/cvs/ecc/ecc/devs/eth/arm/iq80310/current/ChangeLog,v
retrieving revision 1.7
diff -u -5 -p -r1.7 ChangeLog
--- ChangeLog	2001/08/24 12:35:54	1.7
+++ ChangeLog	2001/09/25 19:33:21
@@ -1,5 +1,15 @@
+2001-09-25  Jonathan Larmour  <jlarmour@redhat.com>
+
+	* include/iq80310_info.h: Remove MAX_TX_DESCRIPTORS and 
+	MAX_RX_DESCRIPTORS, to be replaced by...
+	* cdl/iq80310_eth_drivers.cdl: Add
+	CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_TX_DESCRIPTORS and
+	CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_RX_DESCRIPTORS.
+	* src/if_shmem.S: Use above definitions to calculate size of
+	shared mem.	
+
 2001-08-24  Mark Salter  <msalter@redhat.com>
 
 	* src/if_iq80310.c (PacketRxReady): Break out of Rx loop after
 	one packet is delivered for RedBoot.
 
Index: cdl/iq80310_eth_drivers.cdl
===================================================================
RCS file: /home/cvs/ecc/ecc/devs/eth/arm/iq80310/current/cdl/iq80310_eth_drivers.cdl,v
retrieving revision 1.1
diff -u -5 -p -r1.1 iq80310_eth_drivers.cdl
--- cdl/iq80310_eth_drivers.cdl	2000/11/05 01:02:20	1.1
+++ cdl/iq80310_eth_drivers.cdl	2001/09/25 19:33:21
@@ -87,10 +87,42 @@ cdl_package CYGPKG_DEVS_ETH_ARM_IQ80310 
 	description   "
 	    This option selects the number of PCI ethernet interfaces to
             be supported by the driver."
     }
 
+    cdl_option CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_RX_DESCRIPTORS {
+        display       "Maximum number of RX descriptors"
+        default_value { CYGPKG_REDBOOT ? 4 : 128 }
+        define        MAX_RX_DESCRIPTORS
+        description   "
+                An RX descriptor is used for each ethernet frame required
+                to be passed to the upper networking layers. This option
+                sets the maximum number of these. Higher numbers use more
+                memory, lower numbers will reduce performance. The system
+                appears to work OK with as few as 8 descriptors but limps
+                painfully with only 4. Performance is better with more than
+                8, but since the size of non-cached (so useless for anything
+                else) memory window is 1Mb, we might as well use it all.
+                128 RX and TX descriptors uses the whole 1Mb, near enough."
+    }
+
+    cdl_option CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_TX_DESCRIPTORS {
+        display       "Maximum number of TX descriptors"
+        default_value { CYGPKG_REDBOOT ? 4 : 128 }
+        define        MAX_TX_DESCRIPTORS
+        description   "
+                A TX descriptor is used for each ethernet frame passed down
+                from upper networking layers for transmission. This option
+                sets the maximum number of these. Higher numbers use more
+                memory, lower numbers will reduce performance. The system
+                appears to work OK with as few as 8 descriptors but limps
+                painfully with only 4. Performance is better with more than
+                8, but since the size of non-cached (so useless for anything
+                else) memory window is 1Mb, we might as well use it all.
+                128 RX and TX descriptors uses the whole 1Mb, near enough."
+    }
+
     cdl_component CYGDBG_DEVS_ETH_ARM_IQ80310_KEEP_STATISTICS {
 	display "Keep Ethernet statistics"
 	default_value 1
 	description   "
 	    The ethernet device can maintain statistics about the network,
Index: include/iq80310_info.h
===================================================================
RCS file: /home/cvs/ecc/ecc/devs/eth/arm/iq80310/current/include/iq80310_info.h,v
retrieving revision 1.2
diff -u -5 -p -r1.2 iq80310_info.h
--- include/iq80310_info.h	2000/11/07 01:19:38	1.2
+++ include/iq80310_info.h	2001/09/25 19:33:21
@@ -106,32 +106,10 @@ extern I82559_COUNTERS i82559_counters[2
 // ------------------------------------------------------------------------
 //
 //                      DEVICES AND PACKET QUEUES
 //
 // ------------------------------------------------------------------------
-// The system seems to work OK with as few as 8 of RX and TX descriptors.
-// It limps very painfully with only 4.
-// Performance is better with more than 8.
-// But the size of non-cached (so useless for anything else)
-// memory window is 1Mb, so we might as well use it all.
-//
-// 128 for these uses the whole 1Mb, near enough.
-
-#ifndef MAX_RX_DESCRIPTORS
-#ifdef CYGPKG_REDBOOT
-#define MAX_RX_DESCRIPTORS	4       // number of Rx descriptors
-#else
-#define MAX_RX_DESCRIPTORS	128     // number of Rx descriptors
-#endif
-#endif
-#ifndef MAX_TX_DESCRIPTORS
-#ifdef CYGPKG_REDBOOT
-#define MAX_TX_DESCRIPTORS	4       // number of Tx descriptors
-#else
-#define MAX_TX_DESCRIPTORS	128     // number of Tx descriptors
-#endif
-#endif
 
 
 typedef struct i82559 {
     cyg_uint8                           // (split up for atomic byte access)
         found:1,                        // was hardware discovered?
Index: src/if_shmem.S
===================================================================
RCS file: /home/cvs/ecc/ecc/devs/eth/arm/iq80310/current/src/if_shmem.S,v
retrieving revision 1.1
diff -u -5 -p -r1.1 if_shmem.S
--- src/if_shmem.S	2000/11/05 01:02:22	1.1
+++ src/if_shmem.S	2001/09/25 19:33:22
@@ -34,24 +34,26 @@
 // #
 // # Author(s):     msalter
 // # Contributors:  msalter
 // # Date:          2000-11-03
 // # Purpose:       
-// # Description:   This file defines a chunk of 4Kbyte aligned memory for use
+// # Description:   This file defines a chunk of aligned memory for use
 // #                by bus-mastering PCI ethernet device.
 // #
 // #####DESCRIPTIONEND####
 // #
 // #========================================================================
 
+#include <pkgconf/devs_eth_arm_iq80310.h>
+        
+#define MAX_PACKET_SIZE   1536
+#define SIZEOF_DESCRIPTOR 16
 	
 	.bss
 	.p2align(12)
 	.globl cyg_io_iq80310_i82559_shmem
 cyg_io_iq80310_i82559_shmem:
-	.rept 16*1024
+	.rept ((MAX_PACKET_SIZE + SIZEOF_DESCRIPTOR) * \
+               (CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_TX_DESCRIPTORS + \
+                CYGNUM_DEVS_ETH_ARM_IQ80310_MAX_RX_DESCRIPTORS))
 	.byte 0
 	.endr
-
-
-	
-	
\ No newline at end of file

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]