tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Lockless IP input queue, the pktqueue interface



I would like to point out that exposing the guts of structures has
bitten us many times in the past (FILE, etc.). Once you expose a
struct, you are making the size of it known; even if your API does
not need it, people might use that fact to keep local copies or
declare objects of that type. Maintaining binary compatibility
becomes really difficult.

On the other hand, hiding a structure can lead to less efficient
code, because you need to have getters/setters, allocate memory
instead of using the callers stack etc.

All these are well-known trade-offs, and given our experience with
the structure in discussion in the networking stack (the pollution
in device drivers by direct access for example), the path chosen
seems the correct one for me.

christos



Home | Main Index | Thread Index | Old Index