Eric Dumazet <eric.dumazet@gmail.com> wrote:
> As advertized by comment, we should hold the association *before*
> accessing backlog queue.
> If order is not important, comment should be relaxed somehow ?
I don't see how the order is important here. We are under sock_lock
here thus nobody will race with us. IMHO, the comment talks about
if a packet is queued into the backlog, we need to increase the assoc/ep
reference count. Otherwise the assoc/ep might be disappeared when
we are about to process it (by sctp_backlog_rcv) sometime later.
Thanks,
-yi

Le vendredi 05 mars 2010 à 19:05 +0800, Zhu, Yi a écrit :
> I don't see how the order is important here. We are under sock_lock > here thus nobody will race with us. IMHO, the comment talks about> if a packet is queued into the backlog, we need to increase the assoc/ep> reference count. Otherwise the assoc/ep might be disappeared when> we are about to process it (by sctp_backlog_rcv) sometime later.>
OK then.
Its strange this protocol has to increase a refcount for each queued
frame in its backlog, but this is unrelated to your changes anyway.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Zhu, Yi wrote:
> Eric Dumazet <eric.dumazet@gmail.com> wrote:> >> As advertized by comment, we should hold the association *before*>> accessing backlog queue.> >> If order is not important, comment should be relaxed somehow ?> > I don't see how the order is important here. We are under sock_lock > here thus nobody will race with us. IMHO, the comment talks about> if a packet is queued into the backlog, we need to increase the assoc/ep> reference count. Otherwise the assoc/ep might be disappeared when> we are about to process it (by sctp_backlog_rcv) sometime later.> > Thanks,> -yi
Yes, that's correct. The order is not really important since we
are under lock and are actually already holding a ref. However
the ref will be dropped once we exit the function, so the function
takes an additional ref that is held while the packet is backloged.
You could get rid of the extra nesting though by returning early
if backlog failed.
-vlad
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html