From owner-freebsd-transport@freebsd.org Thu Oct 6 19:05:15 2016 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0EF2BEC4D3 for ; Thu, 6 Oct 2016 19:05:15 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-qk0-x229.google.com (mail-qk0-x229.google.com [IPv6:2607:f8b0:400d:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67FBBE89 for ; Thu, 6 Oct 2016 19:05:12 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-qk0-x229.google.com with SMTP id o68so24392482qkf.3 for ; Thu, 06 Oct 2016 12:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=y8EjuTBGdEqmXVPL80I2rHzFkH43+v9A3uDvH34DYng=; b=SivqVrJxR7cTC8212cJF3prR9spW86SUVjfZXZH5jVtoflarStZVu0DLZLohsZwmc8 tC0C6MostE5DwQqpLUTTn46TlHxD0i2K0yNpGpUobwGyPLXRcSed/FKFSRFPPe4l5tG5 tnKdQjJ5MRnp6FtvxG0T/DlV3TiCyfAsoanJhEbX0XX8zChCvMqTSKA0vghK/U1TYFLW N3Hs5wVIU46Oapnkp4iAOH0tHxEIpt445KSw8+FriPR5zCzDFfELHzCPzyT05m4+TcUE iXFAtfshNg2Via9leGOovH0HkrQAs45gqs/OUKxNoNfulIgApPT2PczSrWAMDh+/1pvD N7/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=y8EjuTBGdEqmXVPL80I2rHzFkH43+v9A3uDvH34DYng=; b=bFgzQqFXBmFPfYbMcz5XQSo8cHvVIW7syFcaWlWL/iUD3y6aXNoFJorvtrYXJUs5ag X7O0nYqrSg75cQ51A7rGWeP0bVfr7Ai0GVFWOi7/dwHmnn3s/RCCozE3cHT5I9VxEfOY 2/dyHJYJpQdH9YUl+gqz3j3c3gNYHuEOXylycJtsecMTkrFeohVLZ57OsZRcmvIKz672 8B1HhGKYinJTHxJU4cSDxwJ0GPJq1GArA7jy88/aQHbc4r3geChhkgMGXufYiG7KBA77 Ve/3yp0pX5u0aVi9IQreJ64LkOESPkjbsIjcadX/R8hEPa/WM5My5n5783qJxqQV5X7w WR3w== X-Gm-Message-State: AA6/9RnB7MThiqAejowCAp4LB3QCpb3zkMVoiGjnd37AVqaJB5TeBaCznWgjhSGg8/zyxEJzyfnanela4q7V1A== X-Received: by 10.55.149.67 with SMTP id x64mr16921098qkd.135.1475780711328; Thu, 06 Oct 2016 12:05:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.53.208 with HTTP; Thu, 6 Oct 2016 12:05:10 -0700 (PDT) From: Jonathan Looney Date: Thu, 6 Oct 2016 15:05:10 -0400 Message-ID: Subject: Remove (struct tcpcb) from the API? To: freebsd-transport@freebsd.org X-Mailman-Approved-At: Thu, 06 Oct 2016 19:34:45 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 19:05:15 -0000 Folks, Currently, the (struct tcpcb) is part of the kernel API. This means that we can only mess with the "spare" fields when we MFC things. Currently, things in userland *should* only be using the 'net.inet.tcp.pcblist' to extract the (stuct tcpcb) list from the kernel. We *should* be able to switch that sysctl so it only copies out the portion of the (struct tcpcb) that is actually needed by userspace. The trick is coming up with that list of fields, and then dealing with the fallout when userspace things not from the base package break. Does anyone have an idea of whether things in the ports tree use this and will break? And, does anyone have strong feelings one way or the other? Jonathan From owner-freebsd-transport@freebsd.org Thu Oct 6 20:21:19 2016 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D009CBEC9D9 for ; Thu, 6 Oct 2016 20:21:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB65E44 for ; Thu, 6 Oct 2016 20:21:19 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x235.google.com with SMTP id o19so41118471ito.1 for ; Thu, 06 Oct 2016 13:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eXxbbbZ4FCKpWO95fBI+uBDYNx5qi1zqK8KAMuKXtWM=; b=1IeVVhccXa1vzezB3ynnT9bH7kStU2ZfOPNE138pCzyIswJn3D9EzTXWXOkxjmlBTg YYM1Rq9qR0zlXRNSTtK75NEXHPWhHYr6F595ycOImmdZYohApcVT6Fua11Yr8rndUb0j By+EDz9p8HPZE9c9jJcjD04z1OpILw6+iiR5R3Lv0S7JyZK8MMZdPXCt4NMSMkjHqSR6 A/8VGLNopbphSkF32qX+a9RdCfIF+xdlW+t2hTs6NwuTTNt2wZvYinJFvqozozKjoIZw GJqL7DEZa+NG8KpsX2S+bA5Afd6E/3ueDjpopAGh3N6ns5sn2kJxdfOfo+pQAIsG2ucF a3iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eXxbbbZ4FCKpWO95fBI+uBDYNx5qi1zqK8KAMuKXtWM=; b=Ejesoski+/tEuHSQ/ljMBsPjm+pi4yxY3IPtCL8PoytCpwyaaQkzSVy21ua5HNChQB dGP8f6xAZpU2iUSw/wKM3J5Lhk8ozy9CGO//OPWsmY9H8FMa5ZvedDcqj14bGzfCVMkc en+cy25sYyGEKxU7UbTuJYeoic7RM0g81CraB8rZAriQSy5gGB/dnPUiA3qgqgLVPJdb BYPz8c4iu/xPU1rvZ9phxOj10qLVMammkmeCYU3HlFPkwrZnoyKyc53wHvV+MeoHRBw8 3+1nzCH31OYLhaAJ4aFGv3rne/1khDj9fGjNGbWLBa/YX+MuwPgob+RTj6zBsnC4KYvs Efbw== X-Gm-Message-State: AA6/9RmxpggDLgRfu4nlWmrwQSvAQEzhaR/QPKAJZJ7zIOA8sOF33lWagbedhQvO3T/0ADsWHny31+FHySp/LQ== X-Received: by 10.36.200.85 with SMTP id w82mr25800423itf.29.1475785278943; Thu, 06 Oct 2016 13:21:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Thu, 6 Oct 2016 13:21:18 -0700 (PDT) In-Reply-To: References: From: Adrian Chadd Date: Thu, 6 Oct 2016 13:21:18 -0700 Message-ID: Subject: Re: Remove (struct tcpcb) from the API? To: Jonathan Looney Cc: "" Content-Type: text/plain; charset=UTF-8 X-Mailman-Approved-At: Thu, 06 Oct 2016 22:32:39 +0000 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Oct 2016 20:21:19 -0000 Wait, I thought we had xtcpcb or something to face userland? -a On 6 October 2016 at 12:05, Jonathan Looney wrote: > Folks, > > Currently, the (struct tcpcb) is part of the kernel API. This means that we > can only mess with the "spare" fields when we MFC things. > > Currently, things in userland *should* only be using the > 'net.inet.tcp.pcblist' to extract the (stuct tcpcb) list from the kernel. > We *should* be able to switch that sysctl so it only copies out the portion > of the (struct tcpcb) that is actually needed by userspace. The trick is > coming up with that list of fields, and then dealing with the fallout when > userspace things not from the base package break. > > Does anyone have an idea of whether things in the ports tree use this and > will break? And, does anyone have strong feelings one way or the other? > > Jonathan > _______________________________________________ > freebsd-transport@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-transport > To unsubscribe, send any mail to "freebsd-transport-unsubscribe@freebsd.org" From owner-freebsd-transport@freebsd.org Fri Oct 7 00:22:12 2016 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778F4BEC0F6 for ; Fri, 7 Oct 2016 00:22:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 6729D7D4 for ; Fri, 7 Oct 2016 00:22:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: by mailman.ysv.freebsd.org (Postfix) id 663F9BEC0F5; Fri, 7 Oct 2016 00:22:12 +0000 (UTC) Delivered-To: transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64406BEC0F4 for ; Fri, 7 Oct 2016 00:22:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 58C1E7D0; Fri, 7 Oct 2016 00:22:12 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 31E711763B; Thu, 6 Oct 2016 17:22:11 -0700 (PDT) Date: Thu, 6 Oct 2016 17:22:11 -0700 From: hiren panchasara To: transport@FreeBSD.org Cc: lstewart@FreeBSD.org Subject: Exiting from loss recovery Message-ID: <20161007002211.GO50669@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="S0GG+JvAI2G0KxBG" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2016 00:22:12 -0000 --S0GG+JvAI2G0KxBG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In tcp_do_segment(): /* * If the congestion window was inflated to account * for the other side's cached packets, retract it. */ if (IN_FASTRECOVERY(tp->t_flags)) { if (SEQ_LT(th->th_ack, tp->snd_recover)) { if (tp->t_flags & TF_SACK_PERMIT) tcp_sack_partialack(tp, th);=20 else tcp_newreno_partial_ack(tp, th);=20 } else=20 cc_post_recovery(tp, th);=20 } Here, if we get an ack that marks recovery from loss i.e. >=3D snd_recovery, we call cc_post_recovery() which in-turn calls CC specific post_recovery routine. But we don't reset TF_FASTRECOVERY | TF_CONGRECOVERY flags by calling EXIT_RECOVERY()=20 Later in the code we do this check again in 'process_ACK:' /* XXXLAS: Can this be moved up into cc_post_recovery? */ if (IN_RECOVERY(tp->t_flags) && SEQ_GEQ(th->th_ack, tp->snd_recover)) { EXIT_RECOVERY(tp->t_flags); } And as it can be seen, Lawrence marked it as something that could possibly be done here and at the end of cc_post_recovery().=20 So, should we do it? i.e call EXIT_RECOVERY() at the end of cc_post_recovery() and remove the block from 'process_ACK' section? or there is something subtle I am not seeing? Cheers, Hiren --S0GG+JvAI2G0KxBG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJX9uqwXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l5TYIAKiIHlBmt622sH0ZSHbMxTZS qxgoQKvTmgTmDchPNix7DFjFq8/mwsbOvj5M9NRnHm+JeSgsl/3fzfVDg4PXsMf4 Z8wBOeZzlK56DY75F122ejfY46v4Ag0G5jLQTLywyztl4jgspV/VxJp7zdbif+Qd YDu9+0AhGmyXuFcOvALsiq4Y5vrR9mDw4qsEBuxB1eLChGAs/8EnOEK5mpeCugu0 oItd0qmsjRQgcVhgSMp0oOupbfinXH65JLGm3PTcAuF6E64UrAl8Y2/odBaNJm0b Zfs4DjKSgZ+q5yLxO2XuKiYhNtFenS6I6HInFX0j/MeILPMjyyIOGrY/OWjflBc= =TUng -----END PGP SIGNATURE----- --S0GG+JvAI2G0KxBG-- From owner-freebsd-transport@freebsd.org Fri Oct 7 11:34:29 2016 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E2BABEC4ED for ; Fri, 7 Oct 2016 11:34:29 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57BA0A48 for ; Fri, 7 Oct 2016 11:34:29 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-qk0-x234.google.com with SMTP id o68so40188510qkf.3 for ; Fri, 07 Oct 2016 04:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=jgAFgvflI2j3EBpWiKgBPGvIJybBPpqawumo0SbvXI4=; b=RHie63XKQEVhxPMaYudD6wRgU5nMeDv9cU+uL0x1g6rIIOflXi7/406y5iWLdH4r16 ou3+N5UDsvqY2SyF3BDkPIAtauGgFzTzA9eX0vVfcwtKV18y8eqFi9+bRlzl/8ND9ZQm wEFCALiEM3G/0bkVRzRGZ2LyqHOjeyVXmKrEohL+iuQezO1/hZd5HXRXAa2NVjQnBmlz b3DKnHPU+1bfC4PvYfgbbH437T9FDV55XuezVS4U7EXbB+iPKU4fQty+pjOVdBsxcCpM oM+etz0bcFoczPwyzGT6luaGTVTxgjkaCG9IntzKknwLTgJwaXr3v8UCVzMmaipy0hho G2wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=jgAFgvflI2j3EBpWiKgBPGvIJybBPpqawumo0SbvXI4=; b=XOAhmlFn1cV4C8no1jTuAHXmhAxOc25HMAbA1ZFcdyZTiBRcLiynMT88MSrTrPTNlU rLfiHsmTdQLmiRDShj558yWMc2guqR5vNScoNFbema5HXXw3n5pvYb/KnbcT6IxYK7Z0 6RCLQhgaLG6rYSS+tZ92B3A3I3hiqYAmANYdwhxlbmGiwR9guSHiZ1Z4M2Nb7OjcPnTB DYFyoh4lNRTDugaNDaDsHuiWzIc4NFarvZ4mLvst5EV+g+IU178hVQLpIkZXi3iTB15j sOeuibjJ4SuEiNGzpZzE7hKE32S0Jtz6X2LQI1+6OjB0NegYgO+NEWxUbmZTOcLycr15 1X5g== X-Gm-Message-State: AA6/9RnX/9pCEETTK4uvd+NpXEaz/GM4QsaheAgLoKph9sxFWJ8C1/wA/rfF4fTOLmDI8ZqR2ibsS93fkxpd2A== X-Received: by 10.55.149.67 with SMTP id x64mr20107172qkd.135.1475840068436; Fri, 07 Oct 2016 04:34:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.53.208 with HTTP; Fri, 7 Oct 2016 04:34:27 -0700 (PDT) In-Reply-To: References: From: Jonathan Looney Date: Fri, 7 Oct 2016 07:34:27 -0400 Message-ID: Subject: Re: Remove (struct tcpcb) from the API? To: Adrian Chadd Cc: "" X-Mailman-Approved-At: Fri, 07 Oct 2016 12:46:20 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Oct 2016 11:34:29 -0000 On Thu, Oct 6, 2016 at 4:21 PM, Adrian Chadd wrote: > Wait, I thought we had xtcpcb or something to face userland? > Yes, but the xtcpcb structure includes the entire (struct tcpcb): struct xtcpcb { size_t xt_len; struct inpcb xt_inp; struct tcpcb xt_tp; struct xsocket xt_socket; struct xtcp_timer xt_timer; u_quad_t xt_alignment_hack; }; And, in tcp_pcblist(): struct xtcpcb xt; [...] inp_ppcb = inp->inp_ppcb; [...] bcopy(inp_ppcb, &xt.xt_tp, sizeof xt.xt_tp); So, my proposal is to replace xt_tp with a minimal structure that includes the (20 or so?) fields that userland actually cares about. Importantly, we can then leave that structure as the stable API, while we are free to modify the actual (struct tcpcb). Relatedly, this could cut down substantially on the number of bytes we copy out for each TCP session (which can really add up on a loaded box, and only adds to the overhead of the locking). Jonathan