[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-KExuakKn709DNNAcio2M86=SYKp1=tMMohaL+mdMfmMA@mail.gmail.com>
Date: Thu, 28 Jun 2018 10:26:24 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Jesus Sanchez-Palencia <jesus.sanchez-palencia@...el.com>
Cc: Network Development <netdev@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
jan.altenberg@...utronix.de,
Vinicius Gomes <vinicius.gomes@...el.com>,
kurt.kanzenbach@...utronix.de, Henrik Austad <henrik@...tad.us>,
Richard Cochran <richardcochran@...il.com>,
Levi Pearson <levi.pearson@...man.com>,
ilias.apalodimas@...aro.org, ivan.khoronzhuk@...aro.org,
Miroslav Lichvar <mlichvar@...hat.com>,
Willem de Bruijn <willemb@...gle.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiří Pírko <jiri@...nulli.us>,
Richard Cochran <rcochran@...utronix.de>
Subject: Re: [PATCH v1 net-next 03/14] net: ipv4: Hook into time based transmission
On Wed, Jun 27, 2018 at 6:07 PM Jesus Sanchez-Palencia
<jesus.sanchez-palencia@...el.com> wrote:
>
> Add a transmit_time field to struct inet_cork, then copy the
> timestamp from the CMSG cookie at ip_setup_cork() so we can
> safely copy it into the skb later during __ip_make_skb().
>
> For the raw fast path, just perform the copy at raw_send_hdrinc().
>
> Signed-off-by: Richard Cochran <rcochran@...utronix.de>
> Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@...el.com>
> ---
> include/net/inet_sock.h | 1 +
> net/ipv4/ip_output.c | 3 +++
> net/ipv4/raw.c | 2 ++
> net/ipv4/udp.c | 1 +
Also support the feature for ipv6
> 4 files changed, 7 insertions(+)
>
> diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
> index 83d5b3c2ac42..314be484c696 100644
> --- a/include/net/inet_sock.h
> +++ b/include/net/inet_sock.h
> @@ -148,6 +148,7 @@ struct inet_cork {
> __s16 tos;
> char priority;
> __u16 gso_size;
> + u64 transmit_time;
> };
>
> struct inet_cork_full {
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index b3308e9d9762..904a54a090e9 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -1153,6 +1153,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
> cork->tos = ipc->tos;
> cork->priority = ipc->priority;
> cork->tx_flags = ipc->tx_flags;
> + cork->transmit_time = ipc->sockc.transmit_time;
Initialize ipc->sockc.transmit_time in all possible paths to avoid bugs like the
one fixed in commit 9887cba19978 ("ip: limit use of gso_size to udp").
> return 0;
> }
> @@ -1413,6 +1414,7 @@ struct sk_buff *__ip_make_skb(struct sock *sk,
>
> skb->priority = (cork->tos != -1) ? cork->priority: sk->sk_priority;
> skb->mark = sk->sk_mark;
> + skb->tstamp = cork->transmit_time;
> /*
> * Steal rt from cork.dst to avoid a pair of atomic_inc/atomic_dec
> * on dst refcount
> @@ -1495,6 +1497,7 @@ struct sk_buff *ip_make_skb(struct sock *sk,
> cork->flags = 0;
> cork->addr = 0;
> cork->opt = NULL;
> + cork->transmit_time = 0;
Not needed when unconditionally overwriting the field in ip_setup_cork.
> err = ip_setup_cork(sk, cork, ipc, rtp);
> if (err)
> return ERR_PTR(err);
Powered by blists - more mailing lists