return SDP_TX_SIZE - tx_ring_posted(ssk);
}
+static inline int credit_update_needed(struct sdp_sock *ssk)
+{
+ int c;
+
+ c = remote_credits(ssk);
+ if (likely(c > SDP_MIN_TX_CREDITS))
+ c += c/2;
+ return unlikely(c < rx_ring_posted(ssk)) &&
+ likely(tx_credits(ssk) > 0) &&
+ likely(sdp_tx_ring_slots_left(ssk));
+}
+
+
#ifdef SDPSTATS_ON
#define SDPSTATS_MAX_HIST_SIZE 256
{
/* TODO: nonagle? */
struct sk_buff *skb;
- int c;
int post_count = 0;
struct sock *sk = &ssk->isk.sk;
post_count++;
}
- c = remote_credits(ssk);
- if (likely(c > SDP_MIN_TX_CREDITS))
- c *= 2;
-
- if (unlikely(c < rx_ring_posted(ssk)) &&
- likely(tx_credits(ssk) > 1) &&
- likely(sdp_tx_ring_slots_left(ssk)) &&
+ if (credit_update_needed(ssk) &&
likely((1 << ssk->isk.sk.sk_state) &
(TCPF_ESTABLISHED | TCPF_FIN_WAIT1))) {
ssk->sent_request = 0;
}
-static inline int credit_update_needed(struct sdp_sock *ssk)
-{
- int c;
-
- c = remote_credits(ssk);
- if (likely(c > SDP_MIN_TX_CREDITS))
- c += c/2;
-
- return unlikely(c < rx_ring_posted(ssk)) &&
- likely(tx_credits(ssk) > 1) &&
- likely(sdp_tx_ring_slots_left(ssk));
-}
-
-
static struct sk_buff *sdp_recv_completion(struct sdp_sock *ssk, int id)
{
struct sdp_buf *rx_req;