Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/cxgbe/tom/t4_cpl_io.c
Show First 20 Lines • Show All 440 Lines • ▼ Show 20 Lines | t4_rcvd_locked(struct toedev *tod, struct tcpcb *tp) | ||||
struct sockbuf *sb = &so->so_rcv; | struct sockbuf *sb = &so->so_rcv; | ||||
struct toepcb *toep = tp->t_toe; | struct toepcb *toep = tp->t_toe; | ||||
int rx_credits; | int rx_credits; | ||||
INP_WLOCK_ASSERT(inp); | INP_WLOCK_ASSERT(inp); | ||||
SOCKBUF_LOCK_ASSERT(sb); | SOCKBUF_LOCK_ASSERT(sb); | ||||
rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; | rx_credits = sbspace(sb) > tp->rcv_wnd ? sbspace(sb) - tp->rcv_wnd : 0; | ||||
if (ulp_mode(toep) == ULP_MODE_TLS) { | |||||
if (toep->tls.rcv_over >= rx_credits) { | |||||
toep->tls.rcv_over -= rx_credits; | |||||
rx_credits = 0; | |||||
} else { | |||||
rx_credits -= toep->tls.rcv_over; | |||||
toep->tls.rcv_over = 0; | |||||
} | |||||
} | |||||
if (rx_credits > 0 && | if (rx_credits > 0 && | ||||
(tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || | (tp->rcv_wnd <= 32 * 1024 || rx_credits >= 64 * 1024 || | ||||
(rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || | (rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || | ||||
sbused(sb) + tp->rcv_wnd < sb->sb_lowat)) { | sbused(sb) + tp->rcv_wnd < sb->sb_lowat)) { | ||||
rx_credits = send_rx_credits(sc, toep, rx_credits); | rx_credits = send_rx_credits(sc, toep, rx_credits); | ||||
tp->rcv_wnd += rx_credits; | tp->rcv_wnd += rx_credits; | ||||
tp->rcv_adv += rx_credits; | tp->rcv_adv += rx_credits; | ||||
} else if (toep->flags & TPF_FORCE_CREDITS) | } else if (toep->flags & TPF_FORCE_CREDITS) | ||||
▲ Show 20 Lines • Show All 1,838 Lines • Show Last 20 Lines |