[netmp] socket accesses

Matthew Dillon dillon at apollo.backplane.com
Sun Aug 17 16:48:20 PDT 2008

:So, atomic or non-atomic op, if we race here, the mbufs can stay in the sockbuf
:for ever...

    The current code does not clean out the sockbuf when setting
    SS_CANTRCVMORE.  I think data already queued stays in there until read
    by userland or until the socket is closed.  So it shouldn't matter if
    an extra packet or two gets in there while the socket is still open.

:> if (so->so_state & SS_CANTRCVMORE) {
:>         soisdisconnected(so);
:>         callout_reset(tp->tt_2msl, tcp_maxidle,
:>                       tcp_timer_2msl, tp);
:> }
:And if we race here, we'll never disconnect the socket.

    This code looks like an optimization to me.  It shouldn't matter whether
    the conditional occurs or not.  All it does is shortcut the FIN2 state
    because there are no longer any readers that might need data received
    during that state.

    If it misses the case it would be as if the user shutdown a microsecond
    after the remote end initiated a close sequence instead of a microsecond

					Matthew Dillon 
					<dillon at backplane.com>

More information about the Kernel mailing list