Hello Petr,

Hallo,

I have written this small patch for RTnet during a research project, so if anyone is interested, here it is.

It allows to register multiple packet handlers for a single protocol and to have separate handlers depending on the interface. For this reason I also added shared SKB support (inspiration by the newer kernels).

The changes should be transparent for most code, though I didn't test it with the more advanced features of RTNet (e.g. TDMA).


Thanks for the patch. It's an interesting idea to assign protocol handlers on a per-interface basis in order to share protocol slots between multiple users. We may consider adding this feature to the main line, e.g. as a compilation option (because it slightly extends the critical reception path).


Also shared rtskbs are a very hot topic which would be important for features like multicast as well. But there is one big issue which yet prevented the inclusion of shared rtskbs into RTnet: the buffer ownership handling becomes much more complex. You basically have two options:

a) Let the first user of an rtskb (and only the first) pay for it, e.i. let that user acquire the rtskb by handing over an empty buffer. The first user would then get the buffer back as soon as the last concurrent rtskb user released it. Not a nice approach as it would break with the strict resource pool isolation in RTnet if not every user of an rtskb belongs to the same application.

b) Let every user pay for an incoming rtskb, but pass only the first empty buffer back to the rtskb producer (NIC driver) and store the others in some list inside the rtskb. Then, when a user releases the rtskb while others are still holding it, that user would get one of the stored buffers back into its own pool. The original rtskb would finally return to the last user. This approach would preserve the resource pool isolation, but it is quite complicated to implement and adds further code to the reception path and the rtskb release function.

Based on my first look at your patch, I think you do not yet take care for this issue. I guess that in case there are actually more than one rtskb user, buffers will leak due to multiple rtskb_acquire calls on the same rtskb. Or am I overseeing something?

Jan


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
RTnet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rtnet-users

Reply via email to