tech-net archive

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

Re: patch: sockaddr instead of mbuf to carry addresses



Greg Troxel <gdt%ir.bbn.com@localhost> wrote:
> 
> Not objecting, but can you articulate the gain?
> 

It is a part of wider objective to cleanup protocol user-request methods.
Historically, we had a single pr_usrreq method which was just a massive
switch statement with PRU_ constants.  While such API was okay in 1980s,
it is quite far away from okay in today's standards.

So I made initial steps of splitting the pr_usrreq actions into their own
methods, defining a proper API between the socket layer and protocol layer
(something what FreeBSD and others did long time ago).  Tyler volunteered
and did a great job to finish up the split.

The old pr_usrreq method abused struct mbuf and other parameters to carry
various different types.  It is a massive change to fix everything in one
go, so usng *real* type of the parameters is a next step.  AFAIK (although
I might be wrong) the reason why mbufs were abused to carry the parameters
was because back in the day they just had a faster memory allocator.  Well,
today we prefer functions, type-safety, clear locking rules, symmetric and
just generally sane APIs. :)

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index