From: Eric Dumazet <edumazet@google•com>
To: "David S . Miller" <davem@davemloft•net>,
Neal Cardwell <ncardwell@google•com>,
Yuchung Cheng <ycheng@google•com>
Cc: netdev <netdev@vger•kernel.org>,
Eric Dumazet <edumazet@google•com>,
Eric Dumazet <eric.dumazet@gmail•com>
Subject: [PATCH net-next 3/7] tcp: tcp_tx_timestamp() cleanup
Date: Thu, 5 Oct 2017 22:21:23 -0700 [thread overview]
Message-ID: <20171006052127.19913-4-edumazet@google.com> (raw)
In-Reply-To: <20171006052127.19913-1-edumazet@google.com>
tcp_write_queue_tail() call can be factorized.
Signed-off-by: Eric Dumazet <edumazet@google•com>
---
net/ipv4/tcp.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f8ebae62f834ce6059d5bcf7dcb84988187dfbce..b8d379c8093661ccc4ef7fb82fa92828ab5f6918 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -469,8 +469,10 @@ void tcp_init_transfer(struct sock *sk, int bpf_op)
tcp_init_buffer_space(sk);
}
-static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb)
+static void tcp_tx_timestamp(struct sock *sk, u16 tsflags)
{
+ struct sk_buff *skb = tcp_write_queue_tail(sk);
+
if (tsflags && skb) {
struct skb_shared_info *shinfo = skb_shinfo(skb);
struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
@@ -1041,7 +1043,7 @@ ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset,
out:
if (copied) {
- tcp_tx_timestamp(sk, sk->sk_tsflags, tcp_write_queue_tail(sk));
+ tcp_tx_timestamp(sk, sk->sk_tsflags);
if (!(flags & MSG_SENDPAGE_NOTLAST))
tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
}
@@ -1418,7 +1420,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
out:
if (copied) {
- tcp_tx_timestamp(sk, sockc.tsflags, tcp_write_queue_tail(sk));
+ tcp_tx_timestamp(sk, sockc.tsflags);
tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
}
out_nopush:
--
2.14.2.920.gcf0c67979c-goog
next prev parent reply other threads:[~2017-10-06 5:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 5:21 [PATCH net-next 0/7] tcp: implement rb-tree based retransmit queue Eric Dumazet
2017-10-06 5:21 ` [PATCH net-next 1/7] net: add rb_to_skb() and other rb tree helpers Eric Dumazet
2017-10-06 5:21 ` [PATCH net-next 2/7] tcp: uninline tcp_write_queue_purge() Eric Dumazet
2017-10-06 5:21 ` Eric Dumazet [this message]
2017-10-06 5:21 ` [PATCH net-next 4/7] tcp: tcp_mark_head_lost() optimization Eric Dumazet
2017-10-06 5:21 ` [PATCH net-next 5/7] tcp: reduce tcp_fastretrans_alert() verbosity Eric Dumazet
2017-10-06 5:21 ` [PATCH net-next 6/7] tcp: pass previous skb to tcp_shifted_skb() Eric Dumazet
2017-10-06 5:21 ` [PATCH net-next 7/7] tcp: implement rb-tree based retransmit queue Eric Dumazet
2017-10-06 23:31 ` [PATCH net-next 0/7] " David Miller
2018-01-21 20:52 ` Tal Gilboa
2018-01-21 23:47 ` Eric Dumazet
2018-01-24 14:42 ` Tal Gilboa
2018-01-24 15:09 ` Eric Dumazet
2018-02-06 13:51 ` Tal Gilboa
2018-02-06 14:19 ` Eric Dumazet
2018-02-06 15:22 ` David Laight
2018-02-06 15:52 ` Eric Dumazet
2018-02-06 16:27 ` Tal Gilboa
2018-02-06 17:05 ` Eric Dumazet
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=20171006052127.19913-4-edumazet@google.com \
--to=edumazet@google$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=ncardwell@google$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=ycheng@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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