+#if MPTCP
+ if (so->so_flags & SOF_MP_SUBFLOW) {
+ struct mptcb *mp_tp = tptomptp(tp);
+
+ if (mp_tp != NULL) {
+ MPT_LOCK(mp_tp);
+ recwin = imin(recwin, (int)mp_tp->mpt_rcvwnd);
+ MPT_UNLOCK(mp_tp);
+ }
+ }
+#endif
+
+ if (recwin < (int32_t)(so->so_rcv.sb_hiwat / 4) &&
+ recwin < (int)tp->t_maxseg)
+ recwin = 0;
+ if (tp->t_flags & TF_SLOWLINK && slowlink_wsize > 0) {
+ if (recwin > (int32_t)slowlink_wsize)
+ recwin = slowlink_wsize;
+ }
+
+#if TRAFFIC_MGT
+ if (tcp_recv_bg == 1 || IS_TCP_RECV_BG(so)) {
+ if (tcp_recv_throttle(tp)) {
+ uint32_t min_iaj_win =
+ tcp_min_iaj_win * tp->t_maxseg;
+ if (tp->iaj_rwintop == 0 ||
+ SEQ_LT(tp->iaj_rwintop, tp->rcv_adv))
+ tp->iaj_rwintop = tp->rcv_adv;
+ if (SEQ_LT(tp->iaj_rwintop,
+ tp->rcv_nxt + min_iaj_win))
+ tp->iaj_rwintop = tp->rcv_nxt + min_iaj_win;
+ recwin = min(tp->iaj_rwintop - tp->rcv_nxt, recwin);
+ }
+ }
+#endif /* TRAFFIC_MGT */
+
+ if (recwin > (int32_t)(TCP_MAXWIN << tp->rcv_scale))
+ recwin = (int32_t)(TCP_MAXWIN << tp->rcv_scale);
+ if (recwin < (int32_t)(tp->rcv_adv - tp->rcv_nxt))
+ recwin = (int32_t)(tp->rcv_adv - tp->rcv_nxt);