Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c
Show First 20 Lines • Show All 1,136 Lines • ▼ Show 20 Lines | do { | ||||
if (space < resid && | if (space < resid && | ||||
(atomic || space < so->so_snd.sb_lowat)) { | (atomic || space < so->so_snd.sb_lowat)) { | ||||
if ((so->so_state & SS_NBIO) || | if ((so->so_state & SS_NBIO) || | ||||
(flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { | (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { | ||||
SOCKBUF_UNLOCK(&so->so_snd); | SOCKBUF_UNLOCK(&so->so_snd); | ||||
error = EWOULDBLOCK; | error = EWOULDBLOCK; | ||||
goto release; | goto release; | ||||
} | } | ||||
error = sbwait(&so->so_snd); | error = sbwait(so, SO_SND); | ||||
SOCKBUF_UNLOCK(&so->so_snd); | SOCKBUF_UNLOCK(&so->so_snd); | ||||
if (error) | if (error) | ||||
goto release; | goto release; | ||||
goto restart; | goto restart; | ||||
} | } | ||||
SOCKBUF_UNLOCK(&so->so_snd); | SOCKBUF_UNLOCK(&so->so_snd); | ||||
do { | do { | ||||
if (uio == NULL) { | if (uio == NULL) { | ||||
▲ Show 20 Lines • Show All 177 Lines • ▼ Show 20 Lines | restart: | ||||
if ((flags & MSG_WAITALL) && | if ((flags & MSG_WAITALL) && | ||||
(sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_lowat)) | (sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_lowat)) | ||||
goto deliver; | goto deliver; | ||||
/* | /* | ||||
* Wait and block until (more) data comes in. | * Wait and block until (more) data comes in. | ||||
* NB: Drops the sockbuf lock during wait. | * NB: Drops the sockbuf lock during wait. | ||||
*/ | */ | ||||
error = sbwait(sb); | error = sbwait(so, SO_RCV); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
goto restart; | goto restart; | ||||
deliver: | deliver: | ||||
SOCKBUF_LOCK_ASSERT(&so->so_rcv); | SOCKBUF_LOCK_ASSERT(&so->so_rcv); | ||||
KASSERT(sbavail(sb), ("%s: sockbuf empty", __func__)); | KASSERT(sbavail(sb), ("%s: sockbuf empty", __func__)); | ||||
KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); | KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); | ||||
▲ Show 20 Lines • Show All 630 Lines • Show Last 20 Lines |