Re: UDP Lite support

From: John Baldwin <jhb_at_freebsd.org>
Date: Tue, 1 Apr 2014 09:49:35 -0400
On Monday, March 31, 2014 10:20:53 pm Kevin Lo wrote:
> On 2014/03/28 00:21, John Baldwin wrote:
> > On Thursday, March 27, 2014 5:32:16 am Kevin Lo wrote:
> >>>>> Are you interested in working on these and report back?
> >>>> The revised patch is available at:
> >>>> http://people.freebsd.org/~kevlo/udplite.diff
> >> Thank you for your suggestions.
> >>
> >>> A few suggestions:
> >>>
> >>> - I would just drop the INP lock and return EOPNOTSUPP directly rather
> >>>     than using goto's to 'bad_setoptname' and 'bad_getoptname' so the
> >>>     UDP-lite options are self-contained.
> >> Fixed.
> > Thanks.
> >
> >>> - I'm not a super big fan of all the udp_common_* macros only because
> >>>     I think it obfuscates things.  At the very least, please move these
> >>>     things out of the header and into udp_usrreq.c so they are closer
> >>>     to the implementation.  I would even suggest making them inline
> >>>     functions instead of macros.
> >> Okay, I removed two udp_common_* macros.  I also renamed udp_common_init()
> >> to udp_udplite_init() and moved it into udp_usrreq.c.  Using a macro here
> >> to follow the style used in SCTP (sctp_os_bsd.h).
> >>
> >> Here's a third version of the udp-lite patch:
> >> http://people.freebsd.org/~kevlo/udplite.diff
> > Ok, I would say that udp_common_init() is actually a better name if you keep
> > the macro (which I think is fine) rather than udp_udplite_init() as the macro
> > is not specific to UDP Lite.  However, thanks for moving the macros out of the
> > header.
> 
> Thank you John.  glebius_at_ suggests we don't need to have two absolutely
> equal uma zones since most systems don't run UDP-Lite.
> If practice shows that a differentiation at zone level between UDP and
> UDP-Lite PCBs is important, then it could be done later.

Ok.  I do think this is probably cleaner as well and almost suggested it
myself.  The only caveat to this is that it means UDP and UDP Lite sockets
share the same resource limit.  That is probably fine in practice.

I think the current patch looks good.

-- 
John Baldwin
Received on Tue Apr 01 2014 - 11:57:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:48 UTC