{"id":811337,"url":"http://patchwork.ozlabs.org/api/patches/811337/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170908070018.4141-5-daniel.axtens@canonical.com/","project":{"id":15,"url":"http://patchwork.ozlabs.org/api/projects/15/?format=json","name":"Ubuntu Kernel","link_name":"ubuntu-kernel","list_id":"kernel-team.lists.ubuntu.com","list_email":"kernel-team@lists.ubuntu.com","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170908070018.4141-5-daniel.axtens@canonical.com>","list_archive_url":null,"date":"2017-09-08T07:00:15","name":"[SRU,Zesty,4/7] tcp: replace dst_confirm with sk_dst_confirm","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d80e813da5c1feea617757aa600b03701ecc8689","submitter":{"id":71548,"url":"http://patchwork.ozlabs.org/api/people/71548/?format=json","name":"Daniel Axtens","email":"daniel.axtens@canonical.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20170908070018.4141-5-daniel.axtens@canonical.com/mbox/","series":[{"id":2111,"url":"http://patchwork.ozlabs.org/api/series/2111/?format=json","web_url":"http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=2111","date":"2017-09-08T07:00:11","name":"Fixes for LP#1715812","version":1,"mbox":"http://patchwork.ozlabs.org/series/2111/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/811337/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/811337/checks/","tags":{},"related":[],"headers":{"Return-Path":"<kernel-team-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=kernel-team-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xpSrn6ZB3z9s83;\n\tFri,  8 Sep 2017 17:00:41 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1dqDHL-0000op-5s; Fri, 08 Sep 2017 07:00:39 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <daniel.axtens@canonical.com>)\n\tid 1dqDHK-0000nm-Bf\n\tfor kernel-team@lists.canonical.com; Fri, 08 Sep 2017 07:00:38 +0000","from mail-pg0-f71.google.com ([74.125.83.71])\n\tby youngberry.canonical.com with esmtps\n\t(TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.76) (envelope-from <daniel.axtens@canonical.com>)\n\tid 1dqDHJ-00039c-Uo\n\tfor kernel-team@lists.canonical.com; Fri, 08 Sep 2017 07:00:38 +0000","by mail-pg0-f71.google.com with SMTP id 11so3643407pge.4\n\tfor <kernel-team@lists.canonical.com>;\n\tFri, 08 Sep 2017 00:00:37 -0700 (PDT)","from localhost.localdomain (124-171-202-56.dyn.iinet.net.au.\n\t[124.171.202.56]) by smtp.gmail.com with ESMTPSA id\n\t125sm2138129pff.5.2017.09.08.00.00.34\n\tfor <kernel-team@lists.canonical.com>\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 08 Sep 2017 00:00:35 -0700 (PDT)"],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=/QxdCQOt06IjsyPFIvjZf4WQRlzazDBZe/0+5Kcw9yA=;\n\tb=hb+Y4P1AUGom7GA1mmN+kWztLaW7eGiPIUsMQAMTbPD7wSmHUIVKDy/ixDpwR/Ge1q\n\t7RZGuYkpzXBh7Uq2e5p1i76WJYJJmPOZ6x7NVmLJlqfvxyBCpnmikm4N8SkM0WAAiJFM\n\tVT8+vScYg82sm9Cd5qRgAfYHd42xUJ0K3achGTdxMu5zXfRmfKznrDhF8FxkuZFoJOVv\n\tRlSmOFQctJzVb7+oia8AawPHzSozFPmq7Bd20OVJh3NgtM4RgzxaNvfjqeN56nfn0bbh\n\tz9HSquDf3Bk5gf/1qdFyqdnWDGpgsjBJkm4i4lHqrFiwCdbkxAZn5tj+ieUaMknHthx9\n\tm2Qg==","X-Gm-Message-State":"AHPjjUiV/nZ5Gjk+/VxHfFGiqwsN+omEpX+F2V6z5x6wqDKtkmKrpyPP\n\tfNBnLJV+ep6KDnr7UhKc9YK96ALd2AXxevdLxCBRXWXn/iAJ+M8azoyeTnKF2376lzijaCQQ4Lg\n\tkWacqRTBwvtLqNRMdVrbiRxmlB3JwrGTIK3id+QU=","X-Received":["by 10.84.129.193 with SMTP id b59mr2289810plb.121.1504854036506; \n\tFri, 08 Sep 2017 00:00:36 -0700 (PDT)","by 10.84.129.193 with SMTP id b59mr2289790plb.121.1504854036265; \n\tFri, 08 Sep 2017 00:00:36 -0700 (PDT)"],"X-Google-Smtp-Source":"ADKCNb5wn7I8iAvIrMxUI4ez49YeXC8GX5qOGXpEhCXhQ9HBsBsDUkPaBddE4gSbJ/+JdE82OTsbeg==","From":"Daniel Axtens <daniel.axtens@canonical.com>","To":"kernel-team@lists.canonical.com","Subject":"[SRU][Zesty][PATCH 4/7] tcp: replace dst_confirm with sk_dst_confirm","Date":"Fri,  8 Sep 2017 17:00:15 +1000","Message-Id":"<20170908070018.4141-5-daniel.axtens@canonical.com>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170908070018.4141-1-daniel.axtens@canonical.com>","References":"<20170908070018.4141-1-daniel.axtens@canonical.com>","X-BeenThere":"kernel-team@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Kernel team discussions <kernel-team.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/kernel-team>","List-Post":"<mailto:kernel-team@lists.ubuntu.com>","List-Help":"<mailto:kernel-team-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n\t<mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"kernel-team-bounces@lists.ubuntu.com","Sender":"\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>"},"content":"From: Julian Anastasov <ja@ssi.bg>\n\nBugLink: https://bugs.launchpad.net/bugs/1715812\n\nWhen same struct dst_entry can be used for many different\nneighbours we can not use it for pending confirmations.\nUse the new sk_dst_confirm() helper to propagate the\nindication from received packets to sock_confirm_neigh().\n\nReported-by: YueHaibing <yuehaibing@huawei.com>\nFixes: 5110effee8fd (\"net: Do delayed neigh confirmation.\")\nFixes: f2bb4bedf35d (\"ipv4: Cache output routes in fib_info nexthops.\")\nTested-by: YueHaibing <yuehaibing@huawei.com>\nSigned-off-by: Julian Anastasov <ja@ssi.bg>\nAcked-by: Eric Dumazet <edumazet@google.com>\nSigned-off-by: David S. Miller <davem@davemloft.net>\n(cherry picked from commit c3a2e8370534f810cac6050169db0ed3e0f94f0b)\nSigned-off-by: Daniel Axtens <daniel.axtens@canonical.com>\n---\n net/ipv4/tcp_input.c   | 12 +++---------\n net/ipv4/tcp_metrics.c |  7 ++-----\n net/ipv4/tcp_output.c  |  2 ++\n 3 files changed, 7 insertions(+), 14 deletions(-)","diff":"diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c\nindex e7516efa99dc..f3ed7c2f9429 100644\n--- a/net/ipv4/tcp_input.c\n+++ b/net/ipv4/tcp_input.c\n@@ -3698,11 +3698,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)\n \tif (tp->tlp_high_seq)\n \t\ttcp_process_tlp_ack(sk, ack, flag);\n \n-\tif ((flag & FLAG_FORWARD_PROGRESS) || !(flag & FLAG_NOT_DUP)) {\n-\t\tstruct dst_entry *dst = __sk_dst_get(sk);\n-\t\tif (dst)\n-\t\t\tdst_confirm(dst);\n-\t}\n+\tif ((flag & FLAG_FORWARD_PROGRESS) || !(flag & FLAG_NOT_DUP))\n+\t\tsk_dst_confirm(sk);\n \n \tif (icsk->icsk_pending == ICSK_TIME_RETRANS)\n \t\ttcp_schedule_loss_probe(sk);\n@@ -6028,7 +6025,6 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)\n \t\tbreak;\n \n \tcase TCP_FIN_WAIT1: {\n-\t\tstruct dst_entry *dst;\n \t\tint tmo;\n \n \t\t/* If we enter the TCP_FIN_WAIT1 state and we are a\n@@ -6055,9 +6051,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)\n \t\ttcp_set_state(sk, TCP_FIN_WAIT2);\n \t\tsk->sk_shutdown |= SEND_SHUTDOWN;\n \n-\t\tdst = __sk_dst_get(sk);\n-\t\tif (dst)\n-\t\t\tdst_confirm(dst);\n+\t\tsk_dst_confirm(sk);\n \n \t\tif (!sock_flag(sk, SOCK_DEAD)) {\n \t\t\t/* Wake up lingering close() */\ndiff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c\nindex ba8f02d0f283..077d7b7ba403 100644\n--- a/net/ipv4/tcp_metrics.c\n+++ b/net/ipv4/tcp_metrics.c\n@@ -375,12 +375,10 @@ void tcp_update_metrics(struct sock *sk)\n \tu32 val;\n \tint m;\n \n+\tsk_dst_confirm(sk);\n \tif (sysctl_tcp_nometrics_save || !dst)\n \t\treturn;\n \n-\tif (dst->flags & DST_HOST)\n-\t\tdst_confirm(dst);\n-\n \trcu_read_lock();\n \tif (icsk->icsk_backoff || !tp->srtt_us) {\n \t\t/* This session failed to estimate rtt. Why?\n@@ -493,11 +491,10 @@ void tcp_init_metrics(struct sock *sk)\n \tstruct tcp_metrics_block *tm;\n \tu32 val, crtt = 0; /* cached RTT scaled by 8 */\n \n+\tsk_dst_confirm(sk);\n \tif (!dst)\n \t\tgoto reset;\n \n-\tdst_confirm(dst);\n-\n \trcu_read_lock();\n \ttm = tcp_get_metrics(sk, dst, true);\n \tif (!tm) {\ndiff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c\nindex b7236ad4d832..4c49283900b6 100644\n--- a/net/ipv4/tcp_output.c\n+++ b/net/ipv4/tcp_output.c\n@@ -975,6 +975,8 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,\n \tskb_set_hash_from_sk(skb, sk);\n \tatomic_add(skb->truesize, &sk->sk_wmem_alloc);\n \n+\tskb_set_dst_pending_confirm(skb, sk->sk_dst_pending_confirm);\n+\n \t/* Build TCP header and checksum it. */\n \tth = (struct tcphdr *)skb->data;\n \tth->source\t\t= inet->inet_sport;\n","prefixes":["SRU","Zesty","4/7"]}