Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_output.c
Show First 20 Lines • Show All 1,539 Lines • ▼ Show 20 Lines | if (((tp->t_flags & TF_FORCEDATA) == 0 || | ||||
tp->snd_nxt -= len; | tp->snd_nxt -= len; | ||||
} | } | ||||
SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ | SOCKBUF_UNLOCK_ASSERT(&so->so_snd); /* Check gotos. */ | ||||
switch (error) { | switch (error) { | ||||
case EPERM: | case EPERM: | ||||
tp->t_softerror = error; | tp->t_softerror = error; | ||||
return (error); | return (error); | ||||
case ENOBUFS: | case ENOBUFS: | ||||
if (!tcp_timer_active(tp, TT_REXMT) && | if ((len > 0 || (flags & (TH_SYN | TH_FIN))) && | ||||
!tcp_timer_active(tp, TT_REXMT) && | |||||
!tcp_timer_active(tp, TT_PERSIST)) | !tcp_timer_active(tp, TT_PERSIST)) | ||||
tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); | panic("neither rexmt nor persist timer is set"); | ||||
jtl: In my opinion, this does //not// need to be a panic. A KASSERT() should be sufficient.
Also… | |||||
sepherosa_gmail.comAuthorUnsubmitted Not Done Inline ActionsIt's what I am testing w/, since I need non-INVARIANT kernel to generate enough traffic to make ENOBUFS happen. We can change it into KASSERT, however, I am wondering should we just use "if (__predict_false(...)) panic" here? Missing timeout here can obviously causing issues for data/SYN/FIN. I will wrap this code segment into a macro (change it into KASSERT is fine w/ me) after more testing. I think the code segment is fine now; we just need to inverse the logic, if we choose to use KASSERT. sepherosa_gmail.com: It's what I am testing w/, since I need non-INVARIANT kernel to generate enough traffic to make… | |||||
tp->snd_cwnd = tp->t_maxseg; | tp->snd_cwnd = tp->t_maxseg; | ||||
return (0); | return (0); | ||||
case EMSGSIZE: | case EMSGSIZE: | ||||
/* | /* | ||||
* For some reason the interface we used initially | * For some reason the interface we used initially | ||||
* to send segments changed to another or lowered | * to send segments changed to another or lowered | ||||
* its MTU. | * its MTU. | ||||
Not Done Inline ActionsYou already own a lock on tp. No need to do atomic operations. jtl: You already own a lock on tp. No need to do atomic operations. | |||||
* If TSO was active we either got an interface | * If TSO was active we either got an interface | ||||
* without TSO capabilits or TSO was turned off. | * without TSO capabilits or TSO was turned off. | ||||
* If we obtained mtu from ip_output() then update | * If we obtained mtu from ip_output() then update | ||||
* it and try again. | * it and try again. | ||||
*/ | */ | ||||
if (tso) | if (tso) | ||||
tp->t_flags &= ~TF_TSO; | tp->t_flags &= ~TF_TSO; | ||||
if (mtu != 0) { | if (mtu != 0) { | ||||
▲ Show 20 Lines • Show All 241 Lines • Show Last 20 Lines |
In my opinion, this does not need to be a panic. A KASSERT() should be sufficient.
Also, this is not the re-usable macro which Lawrence suggested.