summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_sack.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-04-17 21:38:18 +0000
committerrwatson <rwatson@FreeBSD.org>2008-04-17 21:38:18 +0000
commitca47fccd6b260693108c5ee5634bd0e011c67f5e (patch)
treefd64d5b5062ffc1979994100cac82014c5ed48b6 /sys/netinet/tcp_sack.c
parent3e83d6e7db0e2c7d805fd36da3475e635fbb4b3e (diff)
downloadFreeBSD-src-ca47fccd6b260693108c5ee5634bd0e011c67f5e.zip
FreeBSD-src-ca47fccd6b260693108c5ee5634bd0e011c67f5e.tar.gz
Convert pcbinfo and inpcb mutexes to rwlocks, and modify macros to
explicitly select write locking for all use of the inpcb mutex. Update some pcbinfo lock assertions to assert locked rather than write-locked, although in practice almost all uses of the pcbinfo rwlock main exclusive, and all instances of inpcb lock acquisition are exclusive. This change should introduce (ideally) little functional change. However, it lays the groundwork for significantly increased parallelism in the TCP/IP code. MFC after: 3 months Tested by: kris (superset of committered patch)
Diffstat (limited to 'sys/netinet/tcp_sack.c')
-rw-r--r--sys/netinet/tcp_sack.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c
index aa0849c..0b55a04 100644
--- a/sys/netinet/tcp_sack.c
+++ b/sys/netinet/tcp_sack.c
@@ -160,7 +160,7 @@ tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_start, tcp_seq rcv_end)
struct sackblk head_blk, saved_blks[MAX_SACK_BLKS];
int num_head, num_saved, i;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
/* Check arguments. */
KASSERT(SEQ_LT(rcv_start, rcv_end), ("rcv_start < rcv_end"));
@@ -240,7 +240,7 @@ tcp_clean_sackreport(struct tcpcb *tp)
{
int i;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
tp->rcv_numsacks = 0;
for (i = 0; i < MAX_SACK_BLKS; i++)
tp->sackblks[i].start = tp->sackblks[i].end=0;
@@ -347,7 +347,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack)
struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1], *sblkp;
int i, j, num_sack_blks;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
num_sack_blks = 0;
/*
@@ -544,7 +544,7 @@ tcp_free_sackholes(struct tcpcb *tp)
{
struct sackhole *q;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
while ((q = TAILQ_FIRST(&tp->snd_holes)) != NULL)
tcp_sackhole_remove(tp, q);
tp->sackhint.sack_bytes_rexmit = 0;
@@ -567,7 +567,7 @@ tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
{
int num_segs = 1;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
tcp_timer_activate(tp, TT_REXMT, 0);
tp->t_rtttime = 0;
/* Send one or 2 segments based on how much new data was acked. */
@@ -591,7 +591,7 @@ tcp_sack_output_debug(struct tcpcb *tp, int *sack_bytes_rexmt)
{
struct sackhole *p;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
*sack_bytes_rexmt = 0;
TAILQ_FOREACH(p, &tp->snd_holes, scblink) {
if (SEQ_LT(p->rxmit, p->end)) {
@@ -629,7 +629,7 @@ tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt)
{
struct sackhole *hole = NULL;
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
*sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit;
hole = tp->sackhint.nexthole;
if (hole == NULL || SEQ_LT(hole->rxmit, hole->end))
@@ -654,7 +654,7 @@ tcp_sack_adjust(struct tcpcb *tp)
{
struct sackhole *p, *cur = TAILQ_FIRST(&tp->snd_holes);
- INP_LOCK_ASSERT(tp->t_inpcb);
+ INP_WLOCK_ASSERT(tp->t_inpcb);
if (cur == NULL)
return; /* No holes */
if (SEQ_GEQ(tp->snd_nxt, tp->snd_fack))
OpenPOWER on IntegriCloud