diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-01-02 15:33:13 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-01-02 15:33:13 +0000 |
commit | 56df19b4b34a98524cfdc7cd4f7842505c793be4 (patch) | |
tree | 04845842e99a8726737d694652764a6e27464991 /sys | |
parent | b45de8ac1b66f472795961a882cd0c2e057271de (diff) | |
download | FreeBSD-src-56df19b4b34a98524cfdc7cd4f7842505c793be4.zip FreeBSD-src-56df19b4b34a98524cfdc7cd4f7842505c793be4.tar.gz |
Explicitly lock the send socket buffer in spx_reass() to cover the drop
record loop for ACK'd data, rather than relying on lokcing in
sbdroprecord() and sowwakeup(), reducing the number of lock operations
as well as eliminating a possible race against the head of the send
buffer mbuf chain. Use the _locked variants of sbdroprecord() and
sowwakeup().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netipx/spx_usrreq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 4aa93a3..099d42b 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -486,13 +486,14 @@ register struct spx *si; /* * Trim Acked data from output queue. */ + SOCKBUF_LOCK(&so->so_snd); while ((m = so->so_snd.sb_mb) != NULL) { if (SSEQ_LT((mtod(m, struct spx *))->si_seq, si->si_ack)) - sbdroprecord(&so->so_snd); + sbdroprecord_locked(&so->so_snd); else break; } - sowwakeup(so); + sowwakeup_locked(so); cb->s_rack = si->si_ack; update_window: if (SSEQ_LT(cb->s_snxt, cb->s_rack)) |