From owner-svn-src-all@freebsd.org Thu Feb 18 07:47:21 2016 Return-Path: Delivered-To: svn-src-all@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 5E886AAB3F8; Thu, 18 Feb 2016 07:47:21 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x232.google.com (mail-vk0-x232.google.com [IPv6:2607:f8b0:400c:c05::232]) (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 1A8CF103A; Thu, 18 Feb 2016 07:47:21 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x232.google.com with SMTP id k196so37448269vka.0; Wed, 17 Feb 2016 23:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=f92oppCIZhI1zxNQIMMa4Tr6lU2ak7AUmpa8/2oBL5k=; b=SnQhd/c6+wkzW0MolytDnxuYZfokOLbMrQqmd0/4FQLt4nzLEtWpgBJ2FepdLQDxqE nEPuN8ycC4/SHl+a2xvNfhJMqah4E82SGynb0twDmiIufUYBBrHD+I+wVfgetTzFzhCd iIxbx9BDJkZJ2ybqwwSVpAGAh21v9lp/AJxsYtruZSZ0OjYor5kDATmLxGkxtZ1JZDDr ThWe/aUvvR2lllYrrUfZvt193FVCYVtKdFXAOAkHsTBlAMEpr1wi8LGL/7WmW3GdP6FG zrSqpx3wdVhxRhUgypAMMGn3jtXxBpXprKvKH/6bhuWXhPa0u/GRN5oIekvhmB1AG1ET jTPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=f92oppCIZhI1zxNQIMMa4Tr6lU2ak7AUmpa8/2oBL5k=; b=hd0wb02wCbWYQ/YVxdDKw+HtZX7sidfcKrQhSk3QT+uLf2enAQTDgp4QYTc8xmbrVw K2JN8t7+Sh4etqZTS+R7Dbece/q/hTyrlaGF2Xpyv9vq/EXSOzQZxMsl/qN6EFghhhhM 6TM1dJyfT3XnX3ioUfS9VLaZacqir78PN3vo7HWDeIj1jMri7iMeAQz9PgEFZRPxUlz1 sepvRRGtpsDJ55udMrIViE41cJ1JuxoQUVa9jIabxagTfiJe0RwhA+iHX6u7FL9HoDza e86G/beaFl59kyxG3cb4Ejl30a5gqT060cF2cY39umlaY0tigAaT9GGB5cHyy7/NvSnT iY0A== X-Gm-Message-State: AG10YOQljHpeGHnuBOXO5LT5nzwnkrnp7HC0cXlzeC4cVNQRuh7uQ1X3qJ1Uqn1HqizOjmO5/AR+qL979/gXMw== MIME-Version: 1.0 X-Received: by 10.31.9.72 with SMTP id 69mr4281462vkj.126.1455781640055; Wed, 17 Feb 2016 23:47:20 -0800 (PST) Sender: sepherosa@gmail.com Received: by 10.176.65.104 with HTTP; Wed, 17 Feb 2016 23:47:19 -0800 (PST) In-Reply-To: <201602180458.u1I4wYmJ012190@repo.freebsd.org> References: <201602180458.u1I4wYmJ012190@repo.freebsd.org> Date: Thu, 18 Feb 2016 15:47:19 +0800 X-Google-Sender-Auth: erNH_JYq4fRUZhNHV9lwjrTrLeg Message-ID: Subject: Re: svn commit: r295739 - in head/sys: netinet sys From: Sepherosa Ziehau To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2016 07:47:21 -0000 Sorry about the MFC note in the commit message. This commit will _not_ be MFCed. Thanks, sephe On Thu, Feb 18, 2016 at 12:58 PM, Sepherosa Ziehau wrote: > Author: sephe > Date: Thu Feb 18 04:58:34 2016 > New Revision: 295739 > URL: https://svnweb.freebsd.org/changeset/base/295739 > > Log: > tcp/lro: Allow drivers to set the TCP ACK/data segment aggregation limit > > ACK aggregation limit is append count based, while the TCP data segment > aggregation limit is length based. Unless the network driver sets these > two limits, it's an NO-OP. > > Reviewed by: adrian, gallatin (previous version), hselasky (previous version) > Approved by: adrian (mentor) > MFC after: 1 week > Sponsored by: Microsoft OSTC > Differential Revision: https://reviews.freebsd.org/D5185 > > Modified: > head/sys/netinet/tcp_lro.c > head/sys/netinet/tcp_lro.h > head/sys/sys/param.h > > Modified: head/sys/netinet/tcp_lro.c > ============================================================================== > --- head/sys/netinet/tcp_lro.c Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/netinet/tcp_lro.c Thu Feb 18 04:58:34 2016 (r295739) > @@ -88,6 +88,8 @@ tcp_lro_init_args(struct lro_ctrl *lc, s > lc->lro_mbuf_count = 0; > lc->lro_mbuf_max = lro_mbufs; > lc->lro_cnt = lro_entries; > + lc->lro_ackcnt_lim = TCP_LRO_ACKCNT_MAX; > + lc->lro_length_lim = TCP_LRO_LENGTH_MAX; > lc->ifp = ifp; > SLIST_INIT(&lc->lro_free); > SLIST_INIT(&lc->lro_active); > @@ -610,7 +612,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > } > > /* Flush now if appending will result in overflow. */ > - if (le->p_len > (65535 - tcp_data_len)) { > + if (le->p_len > (lc->lro_length_lim - tcp_data_len)) { > SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); > tcp_lro_flush(lc, le); > break; > @@ -648,6 +650,15 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > > if (tcp_data_len == 0) { > m_freem(m); > + /* > + * Flush this LRO entry, if this ACK should not > + * be further delayed. > + */ > + if (le->append_cnt >= lc->lro_ackcnt_lim) { > + SLIST_REMOVE(&lc->lro_active, le, lro_entry, > + next); > + tcp_lro_flush(lc, le); > + } > return (0); > } > > @@ -668,7 +679,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > * If a possible next full length packet would cause an > * overflow, pro-actively flush now. > */ > - if (le->p_len > (65535 - lc->ifp->if_mtu)) { > + if (le->p_len > (lc->lro_length_lim - lc->ifp->if_mtu)) { > SLIST_REMOVE(&lc->lro_active, le, lro_entry, next); > tcp_lro_flush(lc, le); > } else > > Modified: head/sys/netinet/tcp_lro.h > ============================================================================== > --- head/sys/netinet/tcp_lro.h Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/netinet/tcp_lro.h Thu Feb 18 04:58:34 2016 (r295739) > @@ -91,11 +91,16 @@ struct lro_ctrl { > unsigned lro_cnt; > unsigned lro_mbuf_count; > unsigned lro_mbuf_max; > + unsigned short lro_ackcnt_lim; /* max # of aggregated ACKs */ > + unsigned lro_length_lim; /* max len of aggregated data */ > > struct lro_head lro_active; > struct lro_head lro_free; > }; > > +#define TCP_LRO_LENGTH_MAX 65535 > +#define TCP_LRO_ACKCNT_MAX 65535 /* unlimited */ > + > int tcp_lro_init(struct lro_ctrl *); > int tcp_lro_init_args(struct lro_ctrl *, struct ifnet *, unsigned, unsigned); > void tcp_lro_free(struct lro_ctrl *); > > Modified: head/sys/sys/param.h > ============================================================================== > --- head/sys/sys/param.h Thu Feb 18 03:05:08 2016 (r295738) > +++ head/sys/sys/param.h Thu Feb 18 04:58:34 2016 (r295739) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100098 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1100099 /* Master, propagated to newvers */ > > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Tomorrow Will Never Die