Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103038551
D47542.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
8 KB
Referenced Files
None
Subscribers
None
D47542.diff
View Options
diff --git a/sys/netinet/tcp_stacks/bbr.c b/sys/netinet/tcp_stacks/bbr.c
--- a/sys/netinet/tcp_stacks/bbr.c
+++ b/sys/netinet/tcp_stacks/bbr.c
@@ -7823,7 +7823,7 @@
(int)(ticks - tp->t_badrxtwin) < 0)
bbr_cong_signal(tp, th, CC_RTO_ERR, NULL);
}
- SOCKBUF_LOCK(&so->so_snd);
+ SOCK_SENDBUF_LOCK(so);
acked_amount = min(acked, (int)sbavail(&so->so_snd));
tp->snd_wnd -= acked_amount;
mfree = sbcut_locked(&so->so_snd, acked_amount);
@@ -8295,7 +8295,7 @@
thflags = tcp_get_flags(th) & TH_FIN;
KMOD_TCPSTAT_ADD(tcps_rcvpack, (int)nsegs);
KMOD_TCPSTAT_ADD(tcps_rcvbyte, tlen);
- SOCKBUF_LOCK(&so->so_rcv);
+ SOCK_RECVBUF_LOCK(so);
if (so->so_rcv.sb_state & SBS_CANTRCVMORE)
m_freem(m);
else
@@ -8528,7 +8528,7 @@
newsize = tcp_autorcvbuf(m, th, so, tp, tlen);
/* Add data to socket buffer. */
- SOCKBUF_LOCK(&so->so_rcv);
+ SOCK_RECVBUF_LOCK(so);
if (so->so_rcv.sb_state & SBS_CANTRCVMORE) {
m_freem(m);
} else {
@@ -12138,7 +12138,7 @@
len = 0;
rsm = NULL;
if (flags & TH_RST) {
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
goto send;
}
recheck_resend:
@@ -12205,7 +12205,7 @@
} else {
/* Retransmitting SYN */
rsm = NULL;
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
goto send;
}
} else
@@ -12304,7 +12304,7 @@
kern_prefetch(end_rsm, &prefetch_rsm);
prefetch_rsm = 1;
}
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
/*
* If snd_nxt == snd_max and we have transmitted a FIN, the
* sb_offset will be > 0 even if so_snd.sb_cc is 0, resulting in a
@@ -12721,7 +12721,7 @@
* No reason to send a segment, just return.
*/
just_return:
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
just_return_nolock:
if (tot_len)
slot = bbr_get_pacing_delay(bbr, bbr->r_ctl.rc_bbr_hptsi_gain, tot_len, cts, 0);
@@ -12829,7 +12829,7 @@
len--;
}
}
- SOCKBUF_LOCK_ASSERT(sb);
+ SOCK_SENDBUF_LOCK_ASSERT(so);
if (len > 0) {
if ((tp->snd_una == tp->snd_max) &&
(bbr_calc_time(cts, bbr->r_ctl.rc_went_idle_time) >= bbr_rtt_probe_time)) {
@@ -12945,7 +12945,7 @@
if (tp->t_port) {
if (V_tcp_udp_tunneling_port == 0) {
/* The port was removed?? */
- SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_SENDBUF_UNLOCK(so);
return (EHOSTUNREACH);
}
hdrlen += sizeof(struct udphdr);
@@ -13036,7 +13036,7 @@
* byte of the payload can be put into the
* TCP segment.
*/
- SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_SENDBUF_UNLOCK(so);
error = EMSGSIZE;
sack_rxmit = 0;
goto out;
@@ -13106,7 +13106,7 @@
if (m == NULL) {
BBR_STAT_INC(bbr_failed_mbuf_aloc);
bbr_log_enobuf_jmp(bbr, len, cts, __LINE__, len, 0, 0);
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
error = ENOBUFS;
sack_rxmit = 0;
goto out;
@@ -13150,7 +13150,7 @@
* is the only thing to do.
*/
BBR_STAT_INC(bbr_offset_drop);
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
(void)m_free(m);
return (-EFAULT); /* tcp_drop() */
}
@@ -13210,7 +13210,7 @@
tso = 0;
}
if (m->m_next == NULL) {
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
(void)m_free(m);
error = ENOBUFS;
sack_rxmit = 0;
@@ -13246,9 +13246,9 @@
!(flags & TH_SYN)) {
flags |= TH_PUSH;
}
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
} else {
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
if (tp->t_flags & TF_ACKNOW)
KMOD_TCPSTAT_INC(tcps_sndacks);
else if (flags & (TH_SYN | TH_FIN | TH_RST))
@@ -13274,7 +13274,7 @@
m->m_data += max_linkhdr;
m->m_len = hdrlen;
}
- SOCKBUF_UNLOCK_ASSERT(sb);
+ SOCK_SENDBUF_UNLOCK_ASSERT(so);
m->m_pkthdr.rcvif = (struct ifnet *)0;
#ifdef MAC
mac_inpcb_create_mbuf(inp, m);
@@ -13766,7 +13766,7 @@
* Everything else will just have to retransmit with the timer
* (no pacer).
*/
- SOCKBUF_UNLOCK_ASSERT(sb);
+ SOCK_SENDBUF_UNLOCK_ASSERT(so);
BBR_STAT_INC(bbr_saw_oerr);
/* Clear all delay/early tracks */
bbr->r_ctl.rc_hptsi_agg_delay = 0;
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -11992,7 +11992,7 @@
/* Must be non-newreno (cubic) getting too ahead of itself */
tp->snd_cwnd = p_cwnd;
}
- SOCKBUF_LOCK(&so->so_snd);
+ SOCK_SENDBUF_LOCK(so);
acked_amount = min(acked, (int)sbavail(&so->so_snd));
tp->snd_wnd -= acked_amount;
mfree = sbcut_locked(&so->so_snd, acked_amount);
@@ -12378,7 +12378,7 @@
thflags = tcp_get_flags(th) & TH_FIN;
KMOD_TCPSTAT_ADD(tcps_rcvpack, nsegs);
KMOD_TCPSTAT_ADD(tcps_rcvbyte, tlen);
- SOCKBUF_LOCK(&so->so_rcv);
+ SOCK_RECVBUF_LOCK(so);
if (so->so_rcv.sb_state & SBS_CANTRCVMORE) {
m_freem(m);
} else {
@@ -12620,7 +12620,7 @@
newsize = tcp_autorcvbuf(m, th, so, tp, tlen);
/* Add data to socket buffer. */
- SOCKBUF_LOCK(&so->so_rcv);
+ SOCK_RECVBUF_LOCK(so);
if (so->so_rcv.sb_state & SBS_CANTRCVMORE) {
m_freem(m);
} else {
@@ -12779,7 +12779,7 @@
struct mbuf *mfree;
rack_ack_received(tp, rack, th->th_ack, nsegs, CC_ACK, 0);
- SOCKBUF_LOCK(&so->so_snd);
+ SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked);
tp->snd_una = th->th_ack;
/* Note we want to hold the sb lock through the sendmap adjust */
@@ -16108,7 +16108,7 @@
/* Must be non-newreno (cubic) getting too ahead of itself */
tp->snd_cwnd = p_cwnd;
}
- SOCKBUF_LOCK(&so->so_snd);
+ SOCK_SENDBUF_LOCK(so);
mfree = sbcut_locked(&so->so_snd, acked_amount);
tp->snd_una = high_seq;
/* Note we want to hold the sb lock through the sendmap adjust */
@@ -19531,9 +19531,9 @@
rack->r_fast_output = 0;
rack->r_ctl.fsb.left_to_send = 0;
/* At the end of fast_output scale up the sb */
- SOCKBUF_LOCK(&rack->rc_inp->inp_socket->so_snd);
+ SOCK_SENDBUF_LOCK(rack->rc_inp->inp_socket);
rack_sndbuf_autoscale(rack);
- SOCKBUF_UNLOCK(&rack->rc_inp->inp_socket->so_snd);
+ SOCK_SENDBUF_UNLOCK(rack->rc_inp->inp_socket);
}
if (tp->t_rtttime == 0) {
tp->t_rtttime = ticks;
@@ -20111,7 +20111,7 @@
len = 0;
rsm = NULL;
if (flags & TH_RST) {
- SOCKBUF_LOCK(&inp->inp_socket->so_snd);
+ SOCK_SENDBUF_LOCK(inp->inp_socket);
so = inp->inp_socket;
sb = &so->so_snd;
goto send;
@@ -20370,7 +20370,7 @@
kern_prefetch(end_rsm, &prefetch_rsm);
prefetch_rsm = 1;
}
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
if ((sack_rxmit == 0) &&
(TCPS_HAVEESTABLISHED(tp->t_state) ||
(tp->t_flags & TF_FASTOPEN))) {
@@ -20880,7 +20880,7 @@
* No reason to send a segment, just return.
*/
just_return:
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
just_return_nolock:
{
int app_limited = CTF_JR_SENT_DATA;
@@ -21139,7 +21139,7 @@
rack->r_ctl.rc_agg_early = 0;
rack->r_early = 0;
rack->r_late = 0;
- SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_SENDBUF_UNLOCK(so);
goto skip_all_send;
}
}
@@ -21356,7 +21356,7 @@
if (tp->t_port) {
if (V_tcp_udp_tunneling_port == 0) {
/* The port was removed?? */
- SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_SENDBUF_UNLOCK(so);
#ifdef TCP_ACCOUNTING
crtsc = get_cyclecount();
if (tp->t_flags2 & TF2_TCP_ACCOUNTING) {
@@ -21459,7 +21459,7 @@
* byte of the payload can be put into the
* TCP segment.
*/
- SOCKBUF_UNLOCK(&so->so_snd);
+ SOCK_SENDBUF_UNLOCK(so);
error = EMSGSIZE;
sack_rxmit = 0;
goto out;
@@ -21542,7 +21542,7 @@
m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
error = ENOBUFS;
sack_rxmit = 0;
goto out;
@@ -21600,7 +21600,7 @@
tso = 0;
}
if (m->m_next == NULL) {
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
(void)m_free(m);
error = ENOBUFS;
sack_rxmit = 0;
@@ -21644,9 +21644,9 @@
add_flag |= RACK_HAD_PUSH;
}
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
} else {
- SOCKBUF_UNLOCK(sb);
+ SOCK_SENDBUF_UNLOCK(so);
if (tp->t_flags & TF_ACKNOW)
KMOD_TCPSTAT_INC(tcps_sndacks);
else if (flags & (TH_SYN | TH_FIN | TH_RST))
@@ -21669,7 +21669,7 @@
m->m_data += max_linkhdr;
m->m_len = hdrlen;
}
- SOCKBUF_UNLOCK_ASSERT(sb);
+ SOCK_SENDBUF_UNLOCK_ASSERT(so);
m->m_pkthdr.rcvif = (struct ifnet *)0;
#ifdef MAC
mac_inpcb_create_mbuf(inp, m);
@@ -22331,7 +22331,7 @@
len = n_len;
sb_offset = tp->snd_max - tp->snd_una;
/* Re-lock for the next spin */
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
goto send;
}
} else {
@@ -22350,7 +22350,7 @@
len = n_len;
sb_offset = tp->snd_max - tp->snd_una;
/* Re-lock for the next spin */
- SOCKBUF_LOCK(sb);
+ SOCK_SENDBUF_LOCK(so);
goto send;
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 21, 3:29 AM (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14718548
Default Alt Text
D47542.diff (8 KB)
Attached To
Mode
D47542: Change the SOCKBUF_LOCK calls to use the more refined SOCK_XXXBUF_LOCK/UNLOCK.
Attached
Detach File
Event Timeline
Log In to Comment