From patchwork Wed May 24 16:26:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Watson X-Patchwork-Id: 9746387 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F005560209 for ; Wed, 24 May 2017 16:27:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E068C287F5 for ; Wed, 24 May 2017 16:27:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D50B32899F; Wed, 24 May 2017 16:27:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8133C2897C for ; Wed, 24 May 2017 16:27:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967800AbdEXQ1S (ORCPT ); Wed, 24 May 2017 12:27:18 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:36699 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967737AbdEXQ1N (ORCPT ); Wed, 24 May 2017 12:27:13 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v4OGOlI1024794; Wed, 24 May 2017 09:27:05 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=facebook; bh=wR8k0wLyyL9JsUWYRYz1GeXRhUVszC9FwsMurzHGLas=; b=Trt4zKBUUW+s5qDOKZohJ5wzRgZzxQgY++UuGL8HPmdg+Grrduh93Bpb0A5NeWvPew3q WUVB/UYS76IPfybHZ8z/y2MNDhxf4nsIQgehIBuOvmtvTECFi85VoXh7a3oUyOV9HqWX RwbZfwXIhjaMpg7uhyMsln8pCQvScR2mg/M= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2andgc01ev-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 24 May 2017 09:27:05 -0700 Received: from NAM01-BN3-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.17) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 24 May 2017 09:27:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=wR8k0wLyyL9JsUWYRYz1GeXRhUVszC9FwsMurzHGLas=; b=IxX6ZV5v8oG5XBFxE4ltYA46LdMVEOLbu8qBtwghSM3tQdlcoGLUUmRC/XNhPnPC5Ap2LcqMHKN/9l1Eu/ZX/LfTujL6mqF/HEBBjyI4cU5fe4hE5xBwNHYNm/KcIp5KuuT9TzZFgEt2ZWRt0cEBKmdUXJPmbpymdCy7cFU31O8= Authentication-Results: mellanox.com; dkim=none (message not signed) header.d=none; mellanox.com; dmarc=none action=none header.from=fb.com; Received: from localhost (2620:10d:c090:180::df6b) by CY4PR15MB1752.namprd15.prod.outlook.com (10.174.53.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1101.14; Wed, 24 May 2017 16:27:01 +0000 Date: Wed, 24 May 2017 09:26:57 -0700 From: Dave Watson To: Ilya Lesokhin , Aviad Yehezkel , Boris Pismenny , Liran Liss , Matan Barak , David Miller , , Tom Herbert , , , Hannes Frederic Sowa CC: Alexei Starovoitov , , Subject: [PATCH net-next 2/4] tcp: export do_tcp_sendpages and tcp_rate_check_app_limited functions Message-ID: <20170524162657.GA24165@davejwatson-mba.local> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-Originating-IP: [2620:10d:c090:180::df6b] X-ClientProxiedBy: BN6PR04CA0011.namprd04.prod.outlook.com (10.172.194.21) To CY4PR15MB1752.namprd15.prod.outlook.com (10.174.53.142) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PR15MB1752: X-MS-Office365-Filtering-Correlation-Id: 817e89af-ba72-4129-abe0-08d4a2c1b51a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:CY4PR15MB1752; X-Microsoft-Exchange-Diagnostics: 1; CY4PR15MB1752; 3:dPUrgz/qde8tkeA2ONADpr6Mj7E6yWUksHMmZ/5N2plUcfj3QSs7wucmHyYGCf+H5WT7KhkFFQG6RUbv2E3CPu+q9GOgrFaTj76sqAZd9lYvSoyjHuRv0P8PmSh+wibthMxOyl1iVxql9sfGgF2ZMHSxajjkracR7WovXS0KgWKoOJz1fCymQsnQk0RZ9fp3xxR4/mcZWD2x7kMxztukuYAljdl7R8FenzU6GdgJ6FLgy6mXW87xh8WnAmzjx5pVc7iZUs1mxOc42+qo6FI7A9UDU4ePXUhjd9aCKQZj+XyMzULaP495Z4efqwkWAbmdH0GJx7D3dQGdfbq0vx03Ng==; 25:gO0gR7r1eEvyQUgqOyYxLKhNgdxbDpVA6DipkAvSUKrnXBliIpDn4t2nU+NMgOF0HeOWkzV3I5NPb3uQyyfhcWnpcWxM5A9L2LpC910JF+461KgJU6TJY3LD5hrXkYWpaWufH4PfZxWPsCA/NUOKGLvLU09cnt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ElOxxqTK5ccnVTaGwe6IkiLEbW947NQxT3uibpRR9Vjv/T2JE2pXS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484)(266576461109395); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148); SRVR:CY4PR15MB1752; BCL:0; PCL:0; RULEID:; SRVR:CY4PR15MB1752; X-Microsoft-Exchange-Diagnostics: 1; CY4PR15MB1752; 4:y3m1aiOZ1PEyy/d6kk0+ceyXvd5VIdbhsZivubgaXeWpgrYWnpPvzCO14BQSD8LcdV2DWLRJSq5LlwdDiIKpiwkkNNqfIWfht5d2zAovjvqquj37WwDno3CDwaHp7pgFqCKxCqrKrPAPjS0L3g5HQxc/K8blaKK2+txS0BF9tELYkQBeIRGlrgx6rFpqt2R6772z6zM6qIEo2FXP9P6st7+vfSbkcYl14jaggF6un0+K/ZEUPGJ/OfVv8WiQW8406PsdszSJntBrKpjBw6sBOUc/78Mkom+UMLxs3Yun5zimMg6cXSF4qnLLZO98wS2sRD6qCLAopdOssvh3NnfP6GYh3muJoaYlRm148y1xPjK81adn+hqquNrkOtqPi34acxWFf6xEmOQX0+B4VBsW3Y7HB0y7faVDb/UJsEqz3R7nLL+yVx9kbyTX8AlROhdyyfkDkDqoYOAzScnluKctno810v72xySFhozmDphdOe6QIxE0rpPCGhC4ydc6d++xmzYJwe/k8tfV1gbd+74bfWbzB7WZNHY5wDbn0sZ/bAwADQUfGSbfCHE8Z7LyQt8YJxa8UzQKRpbzOl8NUU0FrDBzaYd/6ohl7qiJQ4MjbbSVr/If4uucydPzlQcDhLGoaIB7i4JztQA1f00A3vhIw82d+8ZgKqTYvOfGtuG0CY+JRtNpiQBPU4dvi+78RbANk7FdU3Ajio95wwzVdGfF0e9fuBg5bGmQBM81lLNj+dGDZh/TK5TgCFzju5tir9giJmT53qZ2cZvVwiCJApHLQZ6PP6fwItbLzTUvkbvojDjN38TGlqoZatZ/LfUzNtv7iMc1Y6hZTJbQdwv5yfREQUWsnJKX8L/7IPeIFpTPlEI= X-Forefront-PRVS: 031763BCAF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6069001)(6009001)(39400400002)(39840400002)(39850400002)(39450400003)(39410400002)(25786009)(98436002)(76176999)(33656002)(4326008)(50986999)(8676002)(81166006)(189998001)(54356999)(5660300001)(6486002)(86362001)(1076002)(47776003)(6666003)(42186005)(23726003)(76506005)(6116002)(4001350100001)(2950100002)(83506001)(50466002)(7736002)(305945005)(2906002)(6496005)(478600001)(9686003)(38730400002)(7416002)(53936002)(18370500001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR15MB1752; H:localhost; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR15MB1752; 23:JslOuC1NBCfLGogWY5ddcaroTnFqbt0ctKhrdCSDK?= =?us-ascii?Q?B6QfYm4f22S90+QKSK1sKEIlHlW5QdpsHc/hdalmmiy6qqHKmJUMGAHpCRpE?= =?us-ascii?Q?vJt9DaXOhtIN3b/DCS+Rzk3gTQ/veF2XViCwvHLoPlc9avOf+t2wcyEs1ZUN?= =?us-ascii?Q?yIail4ZfiAXfjof8sHoI6ijrBuZbBbEjrid7dX4D0+N4M3XOecpAWA7VxdDU?= =?us-ascii?Q?Szh95evG+S9KYrfSJFKXngCp9Jqh1YxJTDNj1qQG/Tdgz+dTv0IM/hetIZ9B?= =?us-ascii?Q?f7p5KLtMD2RdByl+1ivdvkwKNMpdceN3OKGsRlTQZ0nnXaIV+49VnVBScxgF?= =?us-ascii?Q?+7tW3Rh3fXYapLppWLbykHBvejRHqBHzc3dG+HlihKt+qMm2VG7xLCbyTOIA?= =?us-ascii?Q?AaNbipsm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QF2R2jc7cIw==; 20:Tp+PoBksQsRI/aUcGLYT2Njtpyzdf0bUbN0YV4jMBn2q/2aAhjwFpS1aJdih525zepyxFMuUBeu8a5hE1Na+8+Qsbogq4G+3l9KCxVvv1Wp9686Fjy4zelkDsq1Fw1xOxoCArXAE+njgVqoo9LY1SrTK1ExChjEprkzvDaIbmPM= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 May 2017 16:27:01.3851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1752 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-24_12:, , signatures=0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Export do_tcp_sendpages and tcp_rate_check_app_limited, since tls will need to sendpages while the socket is already locked. tcp_sendpage is exported, but requires the socket lock to not be held already. Signed-off-by: Aviad Yehezkel Signed-off-by: Ilya Lesokhin Signed-off-by: Boris Pismenny Signed-off-by: Dave Watson --- include/net/tcp.h | 2 ++ net/ipv4/tcp.c | 5 +++-- net/ipv4/tcp_rate.c | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index fcc39f8..2b35100 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -353,6 +353,8 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size); int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int flags); +ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, + size_t size, int flags); void tcp_release_cb(struct sock *sk); void tcp_wfree(struct sk_buff *skb); void tcp_write_timer_handler(struct sock *sk); diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9f06faa..08a8ef4 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -882,8 +882,8 @@ static int tcp_send_mss(struct sock *sk, int *size_goal, int flags) return mss_now; } -static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, - size_t size, int flags) +ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, + size_t size, int flags) { struct tcp_sock *tp = tcp_sk(sk); int mss_now, size_goal; @@ -1013,6 +1013,7 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, } return sk_stream_error(sk, flags, err); } +EXPORT_SYMBOL(do_tcp_sendpages); int tcp_sendpage(struct sock *sk, struct page *page, int offset, size_t size, int flags) diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c index ad99569..62876e4 100644 --- a/net/ipv4/tcp_rate.c +++ b/net/ipv4/tcp_rate.c @@ -185,3 +185,4 @@ void tcp_rate_check_app_limited(struct sock *sk) tp->app_limited = (tp->delivered + tcp_packets_in_flight(tp)) ? : 1; } +EXPORT_SYMBOL(tcp_rate_check_app_limited);