RTNET and rtskb size
Hello list,
I'm working on a project with a custom MAC which is using up to 2048 ethernet frame length.
Lately, I was having weird crash in RX interrupt code, or even sometimes in RTNET packet dispatch logic.
It turned out that while rt_alloc_etherdev () requests the number of rtskb to allocate in the device pool (and with associated packet buffers of RTSKB_SIZE bytes), rtnetdev_alloc_rtskb (that is usually called after one packet is received to allocate a new rtskb for another packet to be received) takes a size parameter, and uses this as the rtskb buffer actual length whereas RTSKB_SIZE only is allocated. Because of this, I believe I might be having the MAC overwriting rtskbs that are being used.
I was wondering if it would not be a good thing to either make rtnetdev_alloc_rtskb check size against RTSKB_SIZE or even discard size parameters, or maybe add a new rt_alloc_etherdev function which would allow passing the max frame length.
Any thoughs on this ?
François
Quoted 10 lines · François Legal via Xenomai
Hello list,
I'm working on a project with a custom MAC which is using up to 2048 ethernet frame length.
Lately, I was having weird crash in RX interrupt code, or even sometimes in RTNET packet dispatch logic.
It turned out that whilert_alloc_etherdev() requests the number of rtskb to allocate in the device pool (and with associated packet buffers ofRTSKB_SIZEbytes),rtnetdev_alloc_rtskb(that is usually called after one packet is received to allocate a new rtskb for another packet to be received) takes a size parameter, and uses this as the rtskb buffer actual length whereasRTSKB_SIZEonly is allocated. Because of this, I believe I might be having the MAC overwriting rtskbs that are being used.I was wondering if it would not be a good thing to either make
rtnetdev_alloc_rtskbcheck size againstRTSKB_SIZEor even discard size parameters, or maybe add a newrt_alloc_etherdevfunction which would allow passing the max frame length.Any thoughs on this ?
The RTnet core is limited to raw packets with RTSKB_SIZE, and that is so far static. It has to fit to all cards attached in a system as buffers may circle across them. So, dynamic control can be hard to impossible.
Fixing blind overruns would be definitely valuable, and maybe there is also value in making that size configurable at build time. Though we do not have a use case for larger frames in-tree so far.
Jan
Signature · 2 lines
Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux