LAN driver update
- separate semaphore for write queue (about 2% more speed) - re-enabled init optimization (avoidance of full chip resets, still experimental)
This commit is contained in:
@@ -66,6 +66,12 @@ PRIORITY=PRI/K/N,BPS/K/N,MTU/K/N,FULLDUPLEX/S,FLOWCONTROL/S,TIMER/K/N,MULTICAST/
|
|||||||
Changelog:
|
Changelog:
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
2.4 - added second semaphore, specifically for the write list
|
||||||
|
- recompiled using GCC 2.95 for slightly smaller binary
|
||||||
|
- avoid full ethernet chip reset on startup when the
|
||||||
|
registers seem to be in a sane state (faster init, especially
|
||||||
|
with DHCP)
|
||||||
|
|
||||||
2.3 - implemented fine grained multicast filter hashes
|
2.3 - implemented fine grained multicast filter hashes
|
||||||
|
|
||||||
2.2 - some more tuning to RX/TX scheduling
|
2.2 - some more tuning to RX/TX scheduling
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -27,8 +27,8 @@ compiler_vcc = 0
|
|||||||
# prefix for system includes (ASM)
|
# prefix for system includes (ASM)
|
||||||
# native AmigaOS compilation: set PREFX=GG: or PREFX=ADE:, depending on toolchain
|
# native AmigaOS compilation: set PREFX=GG: or PREFX=ADE:, depending on toolchain
|
||||||
###############################################################################
|
###############################################################################
|
||||||
PREFX = /opt/amigaos-68k/
|
#PREFX = /opt/amigaos-68k/
|
||||||
#PREFX = gg:
|
PREFX = gg:
|
||||||
SYSINC = $(PREFX)os-include
|
SYSINC = $(PREFX)os-include
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@@ -54,8 +54,9 @@ else
|
|||||||
CCX = m68k-amigaos-gcc
|
CCX = m68k-amigaos-gcc
|
||||||
LINK = $(CCX) -nostartfiles -s
|
LINK = $(CCX) -nostartfiles -s
|
||||||
LINKEXE = $(CCX) -s -noixemul
|
LINKEXE = $(CCX) -s -noixemul
|
||||||
CFLAGS = -O3 -s -m$(CPU) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
|
#$(CPU)
|
||||||
CFLAGS2 = -O3 -s -m$(CPU2) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
|
CFLAGS = -Os -s -m$(CPU) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
|
||||||
|
CFLAGS2 = -Os -s -m$(CPU2) -Wall -noixemul -mregparm=4 -fomit-frame-pointer -msoft-float -noixemul
|
||||||
VASMFORMAT = -m$(CPU) -Faout -nowarn=2064 -quiet -I$(SYSINC)
|
VASMFORMAT = -m$(CPU) -Faout -nowarn=2064 -quiet -I$(SYSINC)
|
||||||
VASMFORMAT2 = -m$(CPU2) -Faout -nowarn=2064 -quiet -I$(SYSINC)
|
VASMFORMAT2 = -m$(CPU2) -Faout -nowarn=2064 -quiet -I$(SYSINC)
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ ASMOBJECTS = $(SUBDIR)/enc624j6l.o $(SUBDIR)/intervaltimer.o kprintf.o
|
|||||||
DEVICEID=enc624j6net.device
|
DEVICEID=enc624j6net.device
|
||||||
DEFINES = -DHW_DMA_TX # -DPROTO_V2EXPNET
|
DEFINES = -DHW_DMA_TX # -DPROTO_V2EXPNET
|
||||||
ASMDEFS = -DHW_DMA_TX # -DPROTO_V2EXPNET
|
ASMDEFS = -DHW_DMA_TX # -DPROTO_V2EXPNET
|
||||||
CPU = 68020
|
CPU = 68060
|
||||||
|
|
||||||
DEVICEID2=enc624j6net.device_68000
|
DEVICEID2=enc624j6net.device_68000
|
||||||
DEFINES2 = # -DPROTO_V2EXPNET
|
DEFINES2 = # -DPROTO_V2EXPNET
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ ASM SAVEDS struct Device *DevInit( ASMR(d0) DEVBASEP ASMREG(d0)
|
|||||||
dbNewList( (struct List*)&db->db_Units[i].du_WriteQueue );
|
dbNewList( (struct List*)&db->db_Units[i].du_WriteQueue );
|
||||||
dbNewList( (struct List*)&db->db_Units[i].du_EventQueue );
|
dbNewList( (struct List*)&db->db_Units[i].du_EventQueue );
|
||||||
InitSemaphore( &db->db_Units[i].du_Sem );
|
InitSemaphore( &db->db_Units[i].du_Sem );
|
||||||
|
InitSemaphore( &db->db_Units[i].du_WrSem );
|
||||||
db->db_Units[i].du_MTU = DEF_MTU;
|
db->db_Units[i].du_MTU = DEF_MTU;
|
||||||
db->db_Units[i].du_BitPerSec = DEF_BPS;
|
db->db_Units[i].du_BitPerSec = DEF_BPS;
|
||||||
}
|
}
|
||||||
@@ -484,12 +485,27 @@ ASM SAVEDS VOID DevBeginIO( ASMR(a1) struct IOSana2Req *ioreq ASMREG(a1),
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
LONG code;
|
||||||
|
LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq );
|
||||||
|
|
||||||
|
ObtainSemaphore(&db->db_Units[unit].du_WrSem);
|
||||||
|
code = write_frame( db, unit, ioreq );
|
||||||
|
if( code >= 0 )
|
||||||
|
{
|
||||||
|
db->db_Units[unit].du_DevStats.PacketsSent++;
|
||||||
|
ioreq->ios2_Req.io_Error = S2ERR_NO_ERROR;
|
||||||
|
ioreq->ios2_WireError = S2WERR_GENERIC_ERROR;
|
||||||
|
}
|
||||||
|
ReleaseSemaphore(&db->db_Units[unit].du_WrSem);
|
||||||
|
#else
|
||||||
ioreq->ios2_Req.io_Flags &= ~SANA2IOF_QUICK;
|
ioreq->ios2_Req.io_Flags &= ~SANA2IOF_QUICK;
|
||||||
ObtainSemaphore(&db->db_Units[unit].du_Sem);
|
ObtainSemaphore(&db->db_Units[unit].du_WrSem);
|
||||||
ADDTAIL((struct List*)&db->db_Units[unit].du_WriteQueue,(struct Node*)ioreq);
|
ADDTAIL((struct List*)&db->db_Units[unit].du_WriteQueue,(struct Node*)ioreq);
|
||||||
ReleaseSemaphore(&db->db_Units[unit].du_Sem);
|
ReleaseSemaphore(&db->db_Units[unit].du_WrSem);
|
||||||
Signal( (struct Task*)db->db_ServerProc, SIGBREAKF_CTRL_F );
|
Signal( (struct Task*)db->db_ServerProc, SIGBREAKF_CTRL_F );
|
||||||
ioreq = (0);
|
ioreq = (0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ struct DevUnit {
|
|||||||
volatile struct List du_EventQueue; /* Event queue */
|
volatile struct List du_EventQueue; /* Event queue */
|
||||||
|
|
||||||
struct SignalSemaphore du_Sem; /* list locking (global per unit) */
|
struct SignalSemaphore du_Sem; /* list locking (global per unit) */
|
||||||
|
struct SignalSemaphore du_WrSem; /* experimental: separate Sempaphore for write list */
|
||||||
|
|
||||||
ULONG du_OpenCount; /* unit openers */
|
ULONG du_OpenCount; /* unit openers */
|
||||||
ULONG du_Flags; /* unit flags */
|
ULONG du_Flags; /* unit flags */
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ DUF_PROMISC EQU (1<<DUB_PROMISC)
|
|||||||
STRUCT du_WriteQueue,LH_SIZE ;TX queue
|
STRUCT du_WriteQueue,LH_SIZE ;TX queue
|
||||||
STRUCT du_EventQueue,LH_SIZE ;Event queue
|
STRUCT du_EventQueue,LH_SIZE ;Event queue
|
||||||
STRUCT du_Sem,SS_SIZE ;list locking (global per unit)
|
STRUCT du_Sem,SS_SIZE ;list locking (global per unit)
|
||||||
|
STRUCT du_WrSem,SS_SIZE ;write list locking
|
||||||
|
|
||||||
ULONG du_OpenCount ;unit openers
|
ULONG du_OpenCount ;unit openers
|
||||||
ULONG du_Flags ;unit flags
|
ULONG du_Flags ;unit flags
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
;
|
;
|
||||||
; enable debugging code block (comment/uncomment, see below)
|
; enable debugging code block (comment/uncomment, see below)
|
||||||
DEBUG EQU 0
|
DEBUG EQU 0
|
||||||
GLOBALINT_BOARD EQU 1 ;if 1, then toggle board interrupt, else ENC624 INTIE
|
GLOBALINT_BOARD EQU 0 ;if 1, then toggle board interrupt, else ENC624 INTIE
|
||||||
OPT_AVOID_DEFAULT_RESETS EQU 0 ;if 1, then check valid Microchip MAC OUI and don't reset the whole chip if the MAC address is ok
|
OPT_AVOID_DEFAULT_RESETS EQU 1 ;if 1, then check valid Microchip MAC OUI and don't reset the whole chip if the MAC address is ok
|
||||||
|
|
||||||
incdir src:baxnet/trunk/source/
|
incdir src:baxnet/trunk/source/
|
||||||
;Temp:Amiga/src/Zorro-LAN-IDE.git/Driver/enc624j6net/
|
;Temp:Amiga/src/Zorro-LAN-IDE.git/Driver/enc624j6net/
|
||||||
|
|||||||
@@ -702,6 +702,8 @@ void myhw_ControlIntervalTimer( DEVBASEP )
|
|||||||
flag = -1; /* stop timer */
|
flag = -1; /* stop timer */
|
||||||
else flag = 0; /* no change */
|
else flag = 0; /* no change */
|
||||||
}
|
}
|
||||||
|
if( hwd->timervalue < 1000 )
|
||||||
|
flag = -1;
|
||||||
|
|
||||||
if( flag > 0 )
|
if( flag > 0 )
|
||||||
StartIntervalTimer( &hwd->ivtimer, hwd->timervalue );
|
StartIntervalTimer( &hwd->ivtimer, hwd->timervalue );
|
||||||
|
|||||||
@@ -94,11 +94,12 @@ static void server_Offline_CancelRequests( DEVBASEP , ULONG unit )
|
|||||||
type = GetSucc( type );
|
type = GetSucc( type );
|
||||||
}
|
}
|
||||||
|
|
||||||
server_AbortList( db, (struct List*)&db->db_Units[unit].du_WriteQueue );
|
|
||||||
server_AbortList( db, (struct List*)&db->db_Units[unit].du_EventQueue );
|
server_AbortList( db, (struct List*)&db->db_Units[unit].du_EventQueue );
|
||||||
server_AbortList( db, (struct List*)&db->db_Units[unit].du_ReadOrphans );
|
server_AbortList( db, (struct List*)&db->db_Units[unit].du_ReadOrphans );
|
||||||
|
|
||||||
ReleaseSemaphore( &db->db_Units[unit].du_Sem );
|
ReleaseSemaphore( &db->db_Units[unit].du_Sem );
|
||||||
|
ObtainSemaphore( &db->db_Units[unit].du_WrSem );
|
||||||
|
server_AbortList( db, (struct List*)&db->db_Units[unit].du_WriteQueue );
|
||||||
|
ReleaseSemaphore( &db->db_Units[unit].du_WrSem );
|
||||||
|
|
||||||
/* clear Multicast list, TODO: subroutine */
|
/* clear Multicast list, TODO: subroutine */
|
||||||
{
|
{
|
||||||
@@ -722,7 +723,8 @@ LONG server_writeerror( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq, LONG cod
|
|||||||
HW_DMA_TX is defined by the Makefile. One of the chunks
|
HW_DMA_TX is defined by the Makefile. One of the chunks
|
||||||
is the constant-size header (14 Bytes) and the other is the payload.
|
is the constant-size header (14 Bytes) and the other is the payload.
|
||||||
*/
|
*/
|
||||||
static LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq )
|
//static
|
||||||
|
LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq )
|
||||||
{
|
{
|
||||||
LONG ret;/* = SERR_OK;*/
|
LONG ret;/* = SERR_OK;*/
|
||||||
UBYTE *copy_ptr,*frame;
|
UBYTE *copy_ptr,*frame;
|
||||||
@@ -816,7 +818,7 @@ static LONG server_writequeue( DEVBASEP, ULONG unit )
|
|||||||
#endif
|
#endif
|
||||||
struct IOSana2Req *ioreq,*nextio;
|
struct IOSana2Req *ioreq,*nextio;
|
||||||
|
|
||||||
ObtainSemaphore( &db->db_Units[unit].du_Sem );
|
ObtainSemaphore( &db->db_Units[unit].du_WrSem );
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
/* whole queue per call */
|
/* whole queue per call */
|
||||||
@@ -871,7 +873,7 @@ static LONG server_writequeue( DEVBASEP, ULONG unit )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ReleaseSemaphore( &db->db_Units[unit].du_Sem );
|
ReleaseSemaphore( &db->db_Units[unit].du_WrSem );
|
||||||
|
|
||||||
return SERR_OK;
|
return SERR_OK;
|
||||||
}
|
}
|
||||||
@@ -977,7 +979,7 @@ static LONG server_readqueue( DEVBASEP, ULONG unit )
|
|||||||
|
|
||||||
/* desired type not found, get orphan list */
|
/* desired type not found, get orphan list */
|
||||||
db->db_Units[unit].du_DevStats.UnknownTypesReceived++;
|
db->db_Units[unit].du_DevStats.UnknownTypesReceived++;
|
||||||
orphan:
|
/*orphan:*/
|
||||||
ioreq = (struct IOSana2Req *)GetHead( (struct List*)&db->db_Units[unit].du_ReadOrphans );
|
ioreq = (struct IOSana2Req *)GetHead( (struct List*)&db->db_Units[unit].du_ReadOrphans );
|
||||||
if( ioreq )
|
if( ioreq )
|
||||||
{
|
{
|
||||||
@@ -1023,7 +1025,7 @@ havetype:
|
|||||||
db->db_Units[unit].du_DevStats.Overruns++;
|
db->db_Units[unit].du_DevStats.Overruns++;
|
||||||
type->srt_Sana2PacketTypeStats.PacketsDropped++;
|
type->srt_Sana2PacketTypeStats.PacketsDropped++;
|
||||||
D4(("No Reader for frame\n"));
|
D4(("No Reader for frame\n"));
|
||||||
goto orphan; /* does it help if we give the frame to the orphan list? */
|
/* goto orphan; */ /* does it help if we give the frame to the orphan list? */
|
||||||
}
|
}
|
||||||
nextframe:
|
nextframe:
|
||||||
ReleaseSemaphore( &db->db_Units[unit].du_Sem );
|
ReleaseSemaphore( &db->db_Units[unit].du_Sem );
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ LONG server_writeerror( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq, LONG cod
|
|||||||
#ifdef EXTERNAL_WRITE_FRAME
|
#ifdef EXTERNAL_WRITE_FRAME
|
||||||
LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq );
|
LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq );
|
||||||
#else
|
#else
|
||||||
static LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq );
|
//static
|
||||||
|
LONG write_frame( DEVBASEP, ULONG unit, struct IOSana2Req *ioreq );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static LONG server_writequeue( DEVBASETYPE*, ULONG );
|
static LONG server_writequeue( DEVBASETYPE*, ULONG );
|
||||||
|
|||||||
Reference in New Issue
Block a user