From patchwork Thu Oct 26 18:10:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Paasch X-Patchwork-Id: 830852 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=apple.com header.i=@apple.com header.b="MwJnoLX4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yNFRp2546z9t2h for ; Fri, 27 Oct 2017 05:10:45 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbdJZSKl (ORCPT ); Thu, 26 Oct 2017 14:10:41 -0400 Received: from mail-out7.apple.com ([17.151.62.29]:51167 "EHLO mail-in7.apple.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932332AbdJZSKk (ORCPT ); Thu, 26 Oct 2017 14:10:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; d=apple.com; s=mailout2048s; c=relaxed/simple; q=dns/txt; i=@apple.com; t=1509041440; h=From:Sender:Reply-To:Subject:Date:Message-id:To:Cc:MIME-Version:Content-Type: Content-transfer-encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Kklp/0Gib3GmVdlmkfz7pGXOMKyyKTssqYRjaEdpiaQ=; b=MwJnoLX4AVSXUDPfMKXIFI94i7Emdli9qu9ahUzyEu1ksEv3dWrrXlnTR4G444Y8 YSxuRSItCKG7mouUvpvKlZalotQqsWmT5AT9AW7BI82/dS04TAseW3iuU0DF2BcT NDChKrQU3ngZ750apvvFYl4vxANVCwYGSJYpTG4gpj9W9mVAFfvgAMgdHt/Pnqq4 ekTbTOCeXCd1qAJkinsZxya0X3oBK09Z7WSMQp9PIbORMYAhUD4L05xiDROY3oVc fUXDF2TWCl+ptaRmjuqGD4ofHB74E6y949HMDwOg1YAkPIBtYOXbo/s4eL/McJmj AMCDSrUc+5fTjl7kLiFPEA==; Received: from relay3.apple.com (relay3.apple.com [17.128.113.83]) (using TLS with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail-in7.apple.com (Apple Secure Mail Relay) with SMTP id 58.1E.31255.02522F95; Thu, 26 Oct 2017 11:10:40 -0700 (PDT) X-AuditID: 11973e16-c0fdc9c000007a17-00-59f225207270 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by relay3.apple.com (Apple SCV relay) with SMTP id DC.E7.23978.F1522F95; Thu, 26 Oct 2017 11:10:39 -0700 (PDT) Content-transfer-encoding: 7BIT Received: from localhost ([17.226.23.227]) by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.1.3.20170825 64bit (built Aug 25 2017)) with ESMTPSA id <0OYF0092HZTRWQ10@nwk-mmpp-sz09.apple.com>; Thu, 26 Oct 2017 11:10:39 -0700 (PDT) From: Christoph Paasch To: Stephen Hemminger Cc: netdev@vger.kernel.org, Yuchung Cheng , Eric Dumazet Subject: [PATCH iproute2] ip: add fastopen_no_cookie option to ip route Date: Thu, 26 Oct 2017 11:10:38 -0700 Message-id: <20171026181038.23929-1-cpaasch@apple.com> X-Mailer: git-send-email 2.14.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNJMWRmVeSWpSXmKPExsUi2FAYrKug+inSYOIqJounxx6xWxxbIGax +I6cxZfHV9kcWDwWbCr16Dk5j8nj8ya5AOYoLpuU1JzMstQifbsEro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WxpYmF gYGJpZkJDmElcd5TIh8jhQTSE0tSs1NTC1KLYMYxcXBKNTBqLDBzP/UvX/mNtavbfYHHx98U xt1ufnp83Yr5Ooa7+KcGHbqbblS7cVmxl5b5g6ttzFenqvg8f1L+4nx5tfRrX8mP8x91MnFq XZG+2jd94SWr14cmrFkzf+PXcO8vKoWv9lukZ62sVO19GueTNKth3nLv6uuHNWtzc5us1e+b 3hJKWRA9Y8MxJRZg5BtqMRcVJwIAnkKsT1oCAAA= Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch adds fastopen_no_cookie option to enable/disable TCP fastopen without a cookie on a per-route basis. Support in Linux was added with 71c02379c762 (tcp: Configure TFO without cookie per socket and/or per route). Cc: Stephen Hemminger Signed-off-by: Christoph Paasch --- include/uapi/linux/rtnetlink.h | 2 ++ ip/iproute.c | 42 ++++++++++++++++++++++++++---------------- man/man8/ip-route.8.in | 6 ++++++ 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index 813e9e0767d3..ff0eec7329c6 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h @@ -430,6 +430,8 @@ enum { #define RTAX_QUICKACK RTAX_QUICKACK RTAX_CC_ALGO, #define RTAX_CC_ALGO RTAX_CC_ALGO + RTAX_FASTOPEN_NO_COOKIE, +#define RTAX_FASTOPEN_NO_COOKIE RTAX_FASTOPEN_NO_COOKIE __RTAX_MAX }; diff --git a/ip/iproute.c b/ip/iproute.c index e81bc05ec16c..eadf0394de7f 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -41,21 +41,22 @@ enum list_action { IPROUTE_SAVE, }; static const char *mx_names[RTAX_MAX+1] = { - [RTAX_MTU] = "mtu", - [RTAX_WINDOW] = "window", - [RTAX_RTT] = "rtt", - [RTAX_RTTVAR] = "rttvar", - [RTAX_SSTHRESH] = "ssthresh", - [RTAX_CWND] = "cwnd", - [RTAX_ADVMSS] = "advmss", - [RTAX_REORDERING] = "reordering", - [RTAX_HOPLIMIT] = "hoplimit", - [RTAX_INITCWND] = "initcwnd", - [RTAX_FEATURES] = "features", - [RTAX_RTO_MIN] = "rto_min", - [RTAX_INITRWND] = "initrwnd", - [RTAX_QUICKACK] = "quickack", - [RTAX_CC_ALGO] = "congctl", + [RTAX_MTU] = "mtu", + [RTAX_WINDOW] = "window", + [RTAX_RTT] = "rtt", + [RTAX_RTTVAR] = "rttvar", + [RTAX_SSTHRESH] = "ssthresh", + [RTAX_CWND] = "cwnd", + [RTAX_ADVMSS] = "advmss", + [RTAX_REORDERING] = "reordering", + [RTAX_HOPLIMIT] = "hoplimit", + [RTAX_INITCWND] = "initcwnd", + [RTAX_FEATURES] = "features", + [RTAX_RTO_MIN] = "rto_min", + [RTAX_INITRWND] = "initrwnd", + [RTAX_QUICKACK] = "quickack", + [RTAX_CC_ALGO] = "congctl", + [RTAX_FASTOPEN_NO_COOKIE] = "fastopen_no_cookie" }; static void usage(void) __attribute__((noreturn)); @@ -89,7 +90,7 @@ static void usage(void) fprintf(stderr, " [ ssthresh NUMBER ] [ realms REALM ] [ src ADDRESS ]\n"); fprintf(stderr, " [ rto_min TIME ] [ hoplimit NUMBER ] [ initrwnd NUMBER ]\n"); fprintf(stderr, " [ features FEATURES ] [ quickack BOOL ] [ congctl NAME ]\n"); - fprintf(stderr, " [ pref PREF ] [ expires TIME ]\n"); + fprintf(stderr, " [ pref PREF ] [ expires TIME ] [ fastopen_no_cookie BOOL ]\n"); fprintf(stderr, "TYPE := { unicast | local | broadcast | multicast | throw |\n"); fprintf(stderr, " unreachable | prohibit | blackhole | nat }\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | all | NUMBER ]\n"); @@ -1216,6 +1217,15 @@ static int iproute_modify(int cmd, unsigned int flags, int argc, char **argv) addattr8(&req.n, sizeof(req), RTA_TTL_PROPAGATE, ttl_prop); + } else if (matches(*argv, "fastopen_no_cookie") == 0) { + unsigned int fastopen_no_cookie; + + NEXT_ARG(); + if (get_unsigned(&fastopen_no_cookie, *argv, 0)) + invarg("\"fastopen_no_cookie\" value is invalid\n", *argv); + if (fastopen_no_cookie != 1 && fastopen_no_cookie != 0) + invarg("\"fastopen_no_cookie\" value should be 0 or 1\n", *argv); + rta_addattr32(mxrta, sizeof(mxbuf), RTAX_FASTOPEN_NO_COOKIE, fastopen_no_cookie); } else { int type; inet_prefix dst; diff --git a/man/man8/ip-route.8.in b/man/man8/ip-route.8.in index 705ceb2054dc..a863769526f3 100644 --- a/man/man8/ip-route.8.in +++ b/man/man8/ip-route.8.in @@ -142,6 +142,8 @@ replace " } " .IR PREF " ] [ " .B expires .IR TIME " ]" +.B fastopen_no_cookie +.IR BOOL " ] [ " .ti -8 .IR TYPE " := [ " @@ -524,6 +526,10 @@ sysctl is set to 0. .BI quickack " BOOL " "(3.11+ only)" Enable or disable quick ack for connections to this destination. +.TP +.BI fastopen_no_cookie " BOOL " "(4.15+ only)" +Enable TCP Fastopen without a cookie for connections to this destination. + .TP .BI congctl " NAME " "(3.20+ only)" .TP