From owner-p4-projects@FreeBSD.ORG Mon Jun 27 15:10:55 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8A155106567A; Mon, 27 Jun 2011 15:10:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42A821065676 for ; Mon, 27 Jun 2011 15:10:55 +0000 (UTC) (envelope-from cnicutar@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 185AB8FC1F for ; Mon, 27 Jun 2011 15:10:55 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p5RFAsMM064112 for ; Mon, 27 Jun 2011 15:10:54 GMT (envelope-from cnicutar@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p5RFAsR0064108 for perforce@freebsd.org; Mon, 27 Jun 2011 15:10:54 GMT (envelope-from cnicutar@freebsd.org) Date: Mon, 27 Jun 2011 15:10:54 GMT Message-Id: <201106271510.p5RFAsR0064108@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to cnicutar@freebsd.org using -f From: Catalin Nicutar To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 195423 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2011 15:10:55 -0000 http://p4web.freebsd.org/@@195423?ac=10 Change 195423 by cnicutar@cnicutar_cronos on 2011/06/27 15:10:25 Replace magic values used for UTO granularity with defines. Affected files ... .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#4 edit .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_output.c#5 edit .. //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_var.h#6 edit Differences ... ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_input.c#4 (text+ko) ==== @@ -1092,8 +1092,8 @@ if (to.to_flags & TOF_UTO) { if (tp->t_flags & TF_RCV_UTO) { - tp->rcv_uto = (to.to_uto & 0x8000) ? - (to.to_uto & 0x7FFF) * 60 : to.to_uto; + tp->rcv_uto = (to.to_uto & UTO_MINS) ? + (to.to_uto & ~(UTO_MINS)) * 60 : to.to_uto; /* silently make it fit between min-max */ tp->rcv_uto = min(V_uto_max_timeout, max(V_uto_min_timeout, tp->rcv_uto)); @@ -1291,8 +1291,8 @@ /* Processing received UTO. */ if ((to.to_flags & TOF_UTO) && (tp->t_flags & TF_RCV_UTO)) { /* convert to seconds if granularity is set */ - tp->rcv_uto = (to.to_uto & 0x8000) ? - (to.to_uto & 0x7FFF) * 60 : to.to_uto; + tp->rcv_uto = (to.to_uto & UTO_MINS) ? + (to.to_uto & ~(UTO_MINS)) * 60 : to.to_uto; tp->rcv_uto = min(V_uto_max_timeout, max(V_uto_min_timeout, tp->rcv_uto)); } ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_output.c#5 (text+ko) ==== @@ -1474,14 +1474,14 @@ *optp++ = TCPOPT_UTO; *optp++ = TCPOLEN_UTO; - if (to->to_uto > 3600) { + if (to->to_uto > UTO_MINS_TH) { /* * If the timeout is larger than 3600 * we'll specify minutes. * XXX-CN 3600 is arbitrary. */ to->to_uto /= 60; - to->to_uto |= 0x8000; + to->to_uto |= UTO_MINS; } /* ==== //depot/projects/soc2011/cnicutar_tcputo_8/src/sys/netinet/tcp_var.h#6 (text+ko) ==== @@ -300,6 +300,12 @@ */ #define TO_SYN 0x01 /* parse SYN-only options */ +/* + * Flags for TCP UTO + */ +#define UTO_MINS 0x8000 /* highest bit set means "minutes" */ +#define UTO_MINS_TH 3600 /* send minutes if >= one hour */ + struct hc_metrics_lite { /* must stay in sync with hc_metrics */ u_long rmx_mtu; /* MTU for this path */ u_long rmx_ssthresh; /* outbound gateway buffer limit */