On Tue, 2015-12-08 at 10:19 +0100, Per Hurtig wrote: > +static u32 tcp_unsent_pkts(const struct sock *sk, u32 ulimit) > +{ > + struct sk_buff *skb = tcp_send_head(sk); > + u32 pkts = 0; > + > + if (skb) > + tcp_for_write_queue_from(skb, sk) { > + pkts += tcp_skb_pcount(skb); > + > + if (ulimit && pkts >= ulimit) > + return ulimit; > + } > + > + return pkts; > +}
Considering Yuchung feedback, have you looked at using an approximation instead ? (ie using tp->write_seq - tp->snd_nxt) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html