Commit 4bfac56c authored by Robert Sprowson's avatar Robert Sprowson

Minor speedup, and fix for mbuf loop on fragmented packet

Line 277: When an interrupt is handled by the driver, actively claim it rather than clearing and passing on, to save the kernel having to carry on looking through its claimant list.
Line 527: On fast machines if you're unlucky while sending out a fragmented packet which has been provided as a list of mbufs length > 1, having sent the first chain in the list by using CAT() the chain is free'd but without cropping the hdr off which now points to a free'd mbuf. An incoming packet just at that moment would likely recycle the mbuf and the result is a circular linked list which MbufManager can't process. Unlink hdr before freeing to break the chain.

Version 0.02. Tagged as 'EtherCPSW-0_02'
parent 1aa5a68f
/* (0.01)
/* (0.02)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.01
#define Module_MajorVersion_CMHG 0.02
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Nov 2015
#define Module_Date_CMHG 24 Nov 2015
#define Module_MajorVersion "0.01"
#define Module_Version 1
#define Module_MajorVersion "0.02"
#define Module_Version 2
#define Module_MinorVersion ""
#define Module_Date "07 Nov 2015"
#define Module_Date "24 Nov 2015"
#define Module_ApplicationDate "07-Nov-15"
#define Module_ApplicationDate "24-Nov-15"
#define Module_ComponentName "EtherCPSW"
#define Module_ComponentPath "bsd/RiscOS/Sources/Networking/Ethernet/EtherCPSW"
#define Module_FullVersion "0.01"
#define Module_HelpVersion "0.01 (07 Nov 2015)"
#define Module_LibraryVersionInfo "0:1"
#define Module_FullVersion "0.02"
#define Module_HelpVersion "0.02 (24 Nov 2015)"
#define Module_LibraryVersionInfo "0:2"
......@@ -275,6 +275,7 @@ int intr_handler(_kernel_swi_regs *r, void *pw)
/* Handled, so clear and claim */
_swix(OS_Hardware, _IN(0) | _INR(8,9),
r->r[0] & 0xFFFFFF, OSHW_CallHAL, EntryNo_HAL_IRQClear);
return 0;
}
return 1;
}
......@@ -522,6 +523,9 @@ int glue_transmit(bool free, uint8_t unit, uint16_t frame,
ifp->if_start(ifp);
splx(s);
/* Unlink the header for reuse down the list */
hdr->m_next = NULL;
/* If the chain wasn't dequeued infer an error */
if (ifp->if_snd != NULL)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment