From: Lawrence Brakmo <brakmo@fb.com>
To: Neal Cardwell <ncardwell@google.com>, Tom Herbert <tom@herbertland.com>
Cc: netdev <netdev@vger.kernel.org>, Kernel Team <Kernel-team@fb.com>,
"Yuchung Cheng" <ycheng@google.com>
Subject: Re: [RFC PATCH net-next] tcp: add NV congestion control
Date: Tue, 7 Jul 2015 00:17:33 +0000 [thread overview]
Message-ID: <D1C056D1.47B8%brakmo@fb.com> (raw)
In-Reply-To: <CADVnQykDpuO991cv43=1=A4mBJJD5pbE6paF3okXnZzeTOUs9g@mail.gmail.com>
On 7/3/15, 1:30 PM, "Neal Cardwell" <ncardwell@google.com> wrote:
>> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
>> index 48c3696..05e0da5 100644
>> --- a/include/linux/tcp.h
>> +++ b/include/linux/tcp.h
>> @@ -254,6 +254,10 @@ struct tcp_sock {
>> u32 lost_out; /* Lost packets */
>> u32 sacked_out; /* SACK'd packets
>>*/
>> u32 fackets_out; /* FACK'd packets
>>*/
>> + u32 ack_in_flight; /* This field is populated when new acks
>> + * are received. It contains the number
>>of
>> + * bytes in flight when the last packet
>> + * acked was sent. Used by tcp-nv. */
>
>AFAICT the tcp_sock struct does not really need to grow to hold the
>ack_in_flight field, because this field does not need to be remembered
>between ACKs. I would recommend putting it in a small struct ("struct
>ack_sample"?) that is allocated on the stack in tcp_ack() and passed
>into the pkts_acked() function for congestion control modules that
>want extra info beyond the number of packets ACKed and the RTT.
>
>In fact it might be cleaner to put the number of packets ACKed and the
>RTT in that struct as well, so in the future we don't have to modify
>all the congestion control modules' pkts_acked() function
>every time a new piece of info is provided by the core TCP stack.
It makes sense. I just wasn¹t sure if it made sense to add one more
parameter
to pkts_acked() until I heard if there was interest to have it in the
kernel.
However, I like your idea of passing a structure since it would simplify
future changes. I¹ll get to it.
>
>> /* This is what the send packet queuing engine uses to pass
>> * TCP per-packet control information to the transmission code.
>> * We also store the host-order sequence numbers in here too.
>> - * This is 44 bytes if IPV6 is enabled.
>> + * This is 48 bytes if IPV6 is enabled.
>> * If this grows please adjust skbuff.h:skbuff->cb[xxx] size
>>appropriately.
>> */
>> struct tcp_skb_cb {
>> __u32 seq; /* Starting sequence number
>>*/
>> __u32 end_seq; /* SEQ + FIN + SYN + datalen
>>*/
>> + __u32 in_flight; /* bytes in flight when this
>>packet
>> + * was sent. */
>
>AFAICT this patch would not require an increase in the size of sk_buff
>cb[] if it were to take advantage of the fact that the tcp_skb_cb
>header.h4 and header.h6 fields are only used in the packet reception
>code path, and this in_flight field is only used on the transmit
>side. So the in_flight field could be placed in a struct that is
>itself placed in a union with the "header" union. Like this:
>
> union {
> struct {
> /* bytes in flight when this packet was sent */
> __u32 in_flight;
> } tx; /* only used for outgoing skbs */
>
> union {
> struct inet_skb_parm h4;
>#if IS_ENABLED(CONFIG_IPV6)
> struct inet6_skb_parm h6;
>#endif
> } header; /* only used for incoming skbs */
> };
>
>That way the sender code can remember the in_flight value
>without requiring any extra space. And in the future other
>sender-side info could be stored in the "tx" struct, if needed.
>
>neal
Great idea, thanks Neal! I¹ll look into it.
next prev parent reply other threads:[~2015-07-07 0:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-03 1:21 [RFC PATCH net-next] tcp: add NV congestion control Lawrence Brakmo
2015-07-03 5:00 ` Eric Dumazet
2015-07-03 16:37 ` David Miller
2015-07-03 17:10 ` Eric Dumazet
2015-07-03 16:47 ` David Miller
2015-07-06 22:40 ` Lawrence Brakmo
2015-07-03 17:10 ` Tom Herbert
2015-07-03 20:30 ` Neal Cardwell
2015-07-07 0:17 ` Lawrence Brakmo [this message]
2015-07-06 23:01 ` Lawrence Brakmo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D1C056D1.47B8%brakmo@fb.com \
--to=brakmo@fb.com \
--cc=Kernel-team@fb.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
--cc=ycheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).