Skip to contentSkip to conversation

RTSKB_SIZE

Xenomai Edouard Tisserant 2 participants 3 messages Sep 15, 2018 – Sep 17, 2018

lore
Share & tools
lore
#0 lore raw

Hi all.

I'd like to send proper patches to fix RTNet's rt_fec, but I can't decide if this change of RTSKB_SIZE is acceptable.

RTSKB_SIZE=1533 was having a nasty influence on RX ring allocation/handling. With RTSKB_SIZE set to the next power of 2 (2048), it works better. It might simply be another bug in rt_fec, but I stopped searching for now.

In rtskb.h RTSKB_SIZE is hard-coded to 1533. Why such value ?

Should RTSKB_SIZE be defined with KConfig, and then depend on what driver is selected ?

Regards

Edouard

#1 lore raw
Quoted 9 lines · Edouard Tisserant

Hi all.

I'd like to send proper patches to fix RTNet's rt_fec, but I can't decide if this change of RTSKB_SIZE is acceptable.

RTSKB_SIZE=1533 was having a nasty influence on RX ring allocation/handling. With RTSKB_SIZE set to the next power of 2 (2048), it works better. It might simply be another bug in rt_fec, but I stopped searching for now.

What does "better" mean? "Crashes less frequently"? ;)

Quoted 2 lines

In rtskb.h RTSKB_SIZE is hard-coded to 1533. Why such value ?

You mean 1544?

RTSKBs are preallocated in RTnet, therefore their static size. The larger you make them, the more you may waste with drivers that do not use that extra space.

Quoted 3 lines

Should RTSKB_SIZE be defined with KConfig, and then depend on what driver is selected ?

If there are good reasons for making the buffer larger here (that should be understood, though), we could make it a configurable, or select the maximum of all enabled drivers (though I don't think the latter is expressible via kconfig).

In fact, there might be good reasons once someone starts working on jumbo frames...

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 8 lines
Quoted 6 lines

RTSKB_SIZE=1533 was having a nasty influence on RX ring allocation/handling. With RTSKB_SIZE set to the next power of 2 (2048), it works better. It might simply be another bug in rt_fec, but I stopped searching for now.

What does "better" mean? "Crashes less frequently"? ;)

Well... It comes from a pile of patch that was rotting in an archive since 2014. To be honest, it is not clear why I had to do that back then and I left no comment for my future self. As far as I remember, some Rx frames data were corrupted or missing. I'll come back with a patch and clear explanation once I'll have it tested with and without the patch, and found the origins of the problem, if any.

Quoted 7 lines
Quoted 2 lines

Should RTSKB_SIZE be defined with KConfig, and then depend on what driver is selected ?

If there are good reasons for making the buffer larger here (that should be understood, though), we could make it a configurable, or select the maximum of all enabled drivers (though I don't think the latter is expressible via kconfig).

I also think that Kconfig will not let us do that. Still we can make it configurable, and add some #if and #error in drivers that require some special RTSKB_SIZE. Then it would refuse to build if RTSKB_SIZE isn't set according to individual drivers requirement.

Edouard