From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 18:42:08 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 224CE1065673; Sun, 26 Feb 2012 18:42:08 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 036BA8FC21; Sun, 26 Feb 2012 18:42:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QIg7gx077977; Sun, 26 Feb 2012 18:42:07 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QIg75A077975; Sun, 26 Feb 2012 18:42:07 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261842.q1QIg75A077975@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 18:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232188 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 18:42:08 -0000 Author: gabor Date: Sun Feb 26 18:42:07 2012 New Revision: 232188 URL: http://svn.freebsd.org/changeset/base/232188 Log: - Fix memory leaks - More consistent variable naming Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 17:39:46 2012 (r232187) +++ user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 18:42:07 2012 (r232188) @@ -73,7 +73,7 @@ tre_mcompile(mregex_t *preg, size_t nr, ret = tre_compile(&preg->patterns[i], wregex[i], wn[i], regex[i], n[i], cflags); if (ret != REG_OK) - return ret; + goto err; } /* If not literal, check if any of them have fixed-length prefix. */ @@ -167,21 +167,27 @@ tre_mregncomp(mregex_t *preg, size_t nr, return REG_ESPACE; wlen = xmalloc(nr * sizeof(size_t)); if (!wlen) - return REG_ESPACE; + goto err; for (i = 0; i < nr; i++) { ret = tre_convert_pattern_to_wcs(regex[i], n[i], &wregex[i], &wlen[i]); if (ret != REG_OK) - goto fail; + goto err; } wr = (const wchar_t **)wregex; ret = tre_mcompile(preg, nr, wr, wlen, regex, n, cflags); -fail: - for (int j = 0; j < i; j++) - tre_free_wcs_pattern(wregex[j]); +err: + if (wregex) + { + for (int j = 0; j < i; j++) + if (wregex[j]) + tre_free_wcs_pattern(wregex[j]); + } + if (wlen) + xfree(wlen); return ret; } @@ -189,17 +195,17 @@ int tre_mregcomp(mregex_t *preg, size_t nr, const char **regex, int cflags) { int ret; - size_t *wlen; + size_t *len; - wlen = xmalloc(nr * sizeof(size_t)); - if (!wlen) + len = xmalloc(nr * sizeof(size_t)); + if (!len) return REG_ESPACE; for (int i = 0; i < nr; i++) - wlen[i] = strlen(regex[i]); + len[i] = strlen(regex[i]); - ret = tre_mregncomp(preg, nr, regex, wlen, cflags); - xfree(wlen); + ret = tre_mregncomp(preg, nr, regex, len, cflags); + xfree(len); return ret; } @@ -219,21 +225,27 @@ tre_mregwncomp(mregex_t *preg, size_t nr return REG_ESPACE; slen = xmalloc(nr * sizeof(size_t)); if (!slen) - return REG_ESPACE; + goto err; for (i = 0; i < nr; i++) { ret = tre_convert_pattern_to_mbs(regex[i], n[i], &sregex[i], &slen[i]); if (ret != REG_OK) - goto fail; + goto err; } sr = (const char **)sregex; ret = tre_mcompile(preg, nr, regex, n, sr, slen, cflags); -fail: - for (int j = 0; j < i; j++) - tre_free_mbs_pattern(sregex[j]); +err: + if (sregex) + { + for (int j = 0; j < i; j++) + if (sregex[j]) + tre_free_mbs_pattern(sregex[j]); + } + if (slen) + xfree(slen); return ret; } @@ -242,17 +254,17 @@ tre_mregwcomp(mregex_t *preg, size_t nr, int cflags) { int ret; - size_t *wlen; + size_t *len; - wlen = xmalloc(nr * sizeof(size_t)); - if (!wlen) + len = xmalloc(nr * sizeof(size_t)); + if (!len) return REG_ESPACE; for (int i = 0; i < nr; i++) - wlen[i] = tre_strlen(regex[i]); + len[i] = tre_strlen(regex[i]); - ret = tre_mregwncomp(preg, nr, regex, wlen, cflags); - xfree(wlen); + ret = tre_mregwncomp(preg, nr, regex, len, cflags); + xfree(len); return ret; } #endif /* TRE_WCHAR */ From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 18:54:45 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D338D106564A; Sun, 26 Feb 2012 18:54:45 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDCAF8FC16; Sun, 26 Feb 2012 18:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QIsjvT078421; Sun, 26 Feb 2012 18:54:45 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QIsjZS078416; Sun, 26 Feb 2012 18:54:45 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261854.q1QIsjZS078416@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 18:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232189 - in user/gabor/tre-integration: contrib/tre/lib include lib/libc/regex X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 18:54:45 -0000 Author: gabor Date: Sun Feb 26 18:54:45 2012 New Revision: 232189 URL: http://svn.freebsd.org/changeset/base/232189 Log: - Add mregerror() Added: user/gabor/tre-integration/contrib/tre/lib/mregerror.c (contents, props changed) Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c user/gabor/tre-integration/include/mregex.h user/gabor/tre-integration/lib/libc/regex/Symbol.map Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 18:42:07 2012 (r232188) +++ user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 18:54:45 2012 (r232189) @@ -73,7 +73,10 @@ tre_mcompile(mregex_t *preg, size_t nr, ret = tre_compile(&preg->patterns[i], wregex[i], wn[i], regex[i], n[i], cflags); if (ret != REG_OK) - goto err; + { + preg->err = i; + goto err; + } } /* If not literal, check if any of them have fixed-length prefix. */ Added: user/gabor/tre-integration/contrib/tre/lib/mregerror.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/gabor/tre-integration/contrib/tre/lib/mregerror.c Sun Feb 26 18:54:45 2012 (r232189) @@ -0,0 +1,44 @@ +/*- + * Copyright (C) 2012 Gabor Kovesdan + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + +#include +#include + +size_t +tre_mregerror(int errcode, const mregex_t *preg, int *errpatn, char *errbuf, + size_t errbuf_size) +{ + + if (errpatn) + *errpatn = preg->err; + + /* XXX: 2nd argument is never read in the underlying code */ + return tre_regerror(errcode, NULL, errbuf, errbuf_size); +} Modified: user/gabor/tre-integration/include/mregex.h ============================================================================== --- user/gabor/tre-integration/include/mregex.h Sun Feb 26 18:42:07 2012 (r232188) +++ user/gabor/tre-integration/include/mregex.h Sun Feb 26 18:54:45 2012 (r232189) @@ -37,8 +37,9 @@ typedef struct { size_t k; /* Number of patterns */ regex_t *patterns; /* regex_t structure for each pattern */ - size_t mfrag; /* XXX Number of fragments */ - size_t type; /* XXX Matching type */ + size_t mfrag; /* XXX (private) Number of fragments */ + size_t type; /* XXX (private) Matching type */ + int err; /* XXX (private) Which pattern failed */ void *searchdata; } mregex_t; @@ -56,6 +57,9 @@ FUNC_DECL(mregexec)(const mregex_t *preg size_t nmatch, regmatch_t pmatch[], int eflags); void FUNC_DECL(mregfree)(mregex_t *preg); +size_t +FUNC_DECL(tre_mregerror)(int errcode, const mregex_t *preg, + int *errpatn, char *errbuf, size_t errbuf_size); #ifdef TRE_WCHAR int FUNC_DECL(mregwncomp)(mregex_t *preg, size_t nr, const wchar_t **regex, Modified: user/gabor/tre-integration/lib/libc/regex/Symbol.map ============================================================================== --- user/gabor/tre-integration/lib/libc/regex/Symbol.map Sun Feb 26 18:42:07 2012 (r232188) +++ user/gabor/tre-integration/lib/libc/regex/Symbol.map Sun Feb 26 18:54:45 2012 (r232189) @@ -6,6 +6,7 @@ FBSD_1.2 { mregncomp; mregnexec; mregcomp; + mregerror; mregexec; mregfree; mregwcomp; From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 19:01:00 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C623106566B; Sun, 26 Feb 2012 19:01:00 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37FC28FC13; Sun, 26 Feb 2012 19:01:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QJ104f078696; Sun, 26 Feb 2012 19:01:00 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QJ10E5078694; Sun, 26 Feb 2012 19:01:00 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261901.q1QJ10E5078694@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 19:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232190 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:01:00 -0000 Author: gabor Date: Sun Feb 26 19:00:59 2012 New Revision: 232190 URL: http://svn.freebsd.org/changeset/base/232190 Log: - Only set offset when REG_NOSUB was not specified and nmatch is greater then 0. Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 18:54:45 2012 (r232189) +++ user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 19:00:59 2012 (r232190) @@ -263,12 +263,13 @@ finish2: pm, eflags); if ((ret == REG_OK) && (pm[0].rm_so == 0)) { - for (int i = 0; i < nmatch; i++) - { - pm[i].rm_so += st; - pm[i].rm_eo += st; - pm[i].p = rpm.p; - } + if (need_offsets) + for (int i = 0; i < nmatch; i++) + { + pm[i].rm_so += st; + pm[i].rm_eo += st; + pm[i].p = rpm.p; + } goto finish3; } else if ((ret != REG_NOMATCH) || (ret != REG_OK)) From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 19:05:17 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C52B4106566C; Sun, 26 Feb 2012 19:05:17 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97A278FC14; Sun, 26 Feb 2012 19:05:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QJ5H2a078859; Sun, 26 Feb 2012 19:05:17 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QJ5Hdg078855; Sun, 26 Feb 2012 19:05:17 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261905.q1QJ5Hdg078855@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 19:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232191 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:05:17 -0000 Author: gabor Date: Sun Feb 26 19:05:17 2012 New Revision: 232191 URL: http://svn.freebsd.org/changeset/base/232191 Log: - Add handling single pattern Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c user/gabor/tre-integration/contrib/tre/lib/mregexec.c user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.h Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 19:00:59 2012 (r232190) +++ user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Sun Feb 26 19:05:17 2012 (r232191) @@ -79,6 +79,12 @@ tre_mcompile(mregex_t *preg, size_t nr, } } + if (nr == 1) + { + preg->type = MHEUR_SINGLE; + goto finish; + } + /* If not literal, check if any of them have fixed-length prefix. */ if (!(cflags & REG_LITERAL)) for (int i = 0; i < nr; i++) Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 19:00:59 2012 (r232190) +++ user/gabor/tre-integration/contrib/tre/lib/mregexec.c Sun Feb 26 19:05:17 2012 (r232191) @@ -235,6 +235,15 @@ finish2: } /* + * Single pattern. Call single matcher. + */ + else if (preg->type == MHEUR_SINGLE) + { + return tre_match(&preg->patterns[0], str, len, type, nmatch, pmatch, + eflags); + } + + /* * General case. Look for the beginning of any of the patterns with the * Wu-Manber algorithm and try to match from there with the automaton. */ Modified: user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.h ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.h Sun Feb 26 19:00:59 2012 (r232190) +++ user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.h Sun Feb 26 19:05:17 2012 (r232191) @@ -15,6 +15,7 @@ #define MHEUR_PREFIX 1 #define MHEUR_LONGEST 2 #define MHEUR_LITERAL 3 +#define MHEUR_SINGLE 4 typedef struct { int cflags; From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 19:24:40 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF29106564A; Sun, 26 Feb 2012 19:24:40 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A3248FC0C; Sun, 26 Feb 2012 19:24:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QJOejd079590; Sun, 26 Feb 2012 19:24:40 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QJOebg079588; Sun, 26 Feb 2012 19:24:40 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261924.q1QJOebg079588@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 19:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232193 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:24:40 -0000 Author: gabor Date: Sun Feb 26 19:24:39 2012 New Revision: 232193 URL: http://svn.freebsd.org/changeset/base/232193 Log: - Fix length calculation Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/regexec.c Sun Feb 26 19:10:14 2012 (r232192) +++ user/gabor/tre-integration/contrib/tre/lib/regexec.c Sun Feb 26 19:24:39 2012 (r232193) @@ -434,7 +434,7 @@ tre_regwnexec(const regex_t *preg, const CALL_WITH_OFFSET(tre_match(preg, &str[offset], slen, type, nmatch, pmatch, eflags)); else - return tre_match(preg, str, len == (unsigned)-1 ? strlen(str) : len, + return tre_match(preg, str, len == (unsigned)-1 ? tre_strlen(str) : len, STR_WIDE, nmatch, pmatch, eflags); } From owner-svn-src-user@FreeBSD.ORG Sun Feb 26 19:25:42 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0BFC1065672; Sun, 26 Feb 2012 19:25:42 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC0A98FC08; Sun, 26 Feb 2012 19:25:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QJPgta079660; Sun, 26 Feb 2012 19:25:42 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QJPgdo079658; Sun, 26 Feb 2012 19:25:42 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202261925.q1QJPgdo079658@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 26 Feb 2012 19:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232194 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:25:43 -0000 Author: gabor Date: Sun Feb 26 19:25:42 2012 New Revision: 232194 URL: http://svn.freebsd.org/changeset/base/232194 Log: - Fix compilation Modified: user/gabor/tre-integration/usr.bin/grep/util.c Modified: user/gabor/tre-integration/usr.bin/grep/util.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/util.c Sun Feb 26 19:24:39 2012 (r232193) +++ user/gabor/tre-integration/usr.bin/grep/util.c Sun Feb 26 19:25:42 2012 (r232194) @@ -285,7 +285,7 @@ procline(struct str *l, int nottext) (size_t)pmatch.rm_eo; if (r == REG_NOMATCH) continue; - else if (ret != REG_OK) + else if (r != REG_OK) // XXX: better error msg? errx(2, "Failed processing input."); From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 09:09:07 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3A99106566C; Mon, 27 Feb 2012 09:09:07 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99C118FC12; Mon, 27 Feb 2012 09:09:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1R997Hf007686; Mon, 27 Feb 2012 09:09:07 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1R997jm007682; Mon, 27 Feb 2012 09:09:07 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202270909.q1R997jm007682@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 09:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232205 - in user/gabor/tre-integration: include lib/libc/regex X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 09:09:07 -0000 Author: gabor Date: Mon Feb 27 09:09:07 2012 New Revision: 232205 URL: http://svn.freebsd.org/changeset/base/232205 Log: - Properly add mregerror() Modified: user/gabor/tre-integration/include/mregex.h user/gabor/tre-integration/lib/libc/regex/Makefile.inc user/gabor/tre-integration/lib/libc/regex/Symbol.map Modified: user/gabor/tre-integration/include/mregex.h ============================================================================== --- user/gabor/tre-integration/include/mregex.h Mon Feb 27 08:57:02 2012 (r232204) +++ user/gabor/tre-integration/include/mregex.h Mon Feb 27 09:09:07 2012 (r232205) @@ -10,6 +10,7 @@ #define tre_mregncomp mregncomp #define tre_mregcomp mregcomp #define tre_mregnexec mregnexec +#define tre_mregerror mregerror #define tre_mregexec mregexec #define tre_mregfree mregfree #define tre_mregwncomp mregwncomp @@ -24,6 +25,7 @@ #define mregncomp tre_mregncomp #define mregcomp tre_mregcomp #define mregnexec tre_mregnexec +#define mregerror tre_mregerror #define mregexec tre_mregexec #define mregfree tre_mregfree #define mregwncomp tre_mregwncomp @@ -58,8 +60,8 @@ FUNC_DECL(mregexec)(const mregex_t *preg void FUNC_DECL(mregfree)(mregex_t *preg); size_t -FUNC_DECL(tre_mregerror)(int errcode, const mregex_t *preg, - int *errpatn, char *errbuf, size_t errbuf_size); +FUNC_DECL(mregerror)(int errcode, const mregex_t *preg, + int *errpatn, char *errbuf, size_t errbuf_size); #ifdef TRE_WCHAR int FUNC_DECL(mregwncomp)(mregex_t *preg, size_t nr, const wchar_t **regex, Modified: user/gabor/tre-integration/lib/libc/regex/Makefile.inc ============================================================================== --- user/gabor/tre-integration/lib/libc/regex/Makefile.inc Mon Feb 27 08:57:02 2012 (r232204) +++ user/gabor/tre-integration/lib/libc/regex/Makefile.inc Mon Feb 27 09:09:07 2012 (r232205) @@ -5,8 +5,8 @@ CFLAGS+=-DHAVE_CONFIG_H -DTRE_LIBC_BUILD -I${.CURDIR}/../../contrib/tre -SRCS+= hashtable.c mregcomp.c mregexec.c regcomp.c regerror.c regexec.c \ - tre-ast.c tre-compile.c tre-fastmatch.c tre-heuristic.c \ +SRCS+= hashtable.c mregcomp.c mregerror.c mregexec.c regcomp.c regerror.c \ + regexec.c tre-ast.c tre-compile.c tre-fastmatch.c tre-heuristic.c \ tre-match-approx.c tre-match-backtrack.c tre-match-parallel.c \ tre-mfastmatch.c tre-mem.c tre-parse.c tre-stack.c xmalloc.c Modified: user/gabor/tre-integration/lib/libc/regex/Symbol.map ============================================================================== --- user/gabor/tre-integration/lib/libc/regex/Symbol.map Mon Feb 27 08:57:02 2012 (r232204) +++ user/gabor/tre-integration/lib/libc/regex/Symbol.map Mon Feb 27 09:09:07 2012 (r232205) @@ -37,6 +37,7 @@ FBSDprivate_1.0 { tre_mregncomp; tre_mregnexec; tre_mregcomp; + tre_mregerror; tre_mregexec; tre_mregfree; tre_mregwcomp; From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 09:10:25 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4474F106564A; Mon, 27 Feb 2012 09:10:25 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 348228FC13; Mon, 27 Feb 2012 09:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1R9APu9007765; Mon, 27 Feb 2012 09:10:25 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1R9AOZC007763; Mon, 27 Feb 2012 09:10:25 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202270910.q1R9AOZC007763@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 09:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232206 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 09:10:25 -0000 Author: gabor Date: Mon Feb 27 09:10:24 2012 New Revision: 232206 URL: http://svn.freebsd.org/changeset/base/232206 Log: - Define weak reference for mregerror() Modified: user/gabor/tre-integration/contrib/tre/lib/mregerror.c Modified: user/gabor/tre-integration/contrib/tre/lib/mregerror.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregerror.c Mon Feb 27 09:09:07 2012 (r232205) +++ user/gabor/tre-integration/contrib/tre/lib/mregerror.c Mon Feb 27 09:10:24 2012 (r232206) @@ -31,6 +31,10 @@ #include #include +#ifdef TRE_LIBC_BUILD +__weak_reference(tre_mregerror, mregerror); +#endif + size_t tre_mregerror(int errcode, const mregex_t *preg, int *errpatn, char *errbuf, size_t errbuf_size) From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 13:04:10 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13114106564A; Mon, 27 Feb 2012 13:04:10 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01AE98FC17; Mon, 27 Feb 2012 13:04:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RD49aT018625; Mon, 27 Feb 2012 13:04:09 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RD499o018623; Mon, 27 Feb 2012 13:04:09 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201202271304.q1RD499o018623@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 27 Feb 2012 13:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232208 - in user/jchandra/xlp-merge/sys/mips/nlm: . dev X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 13:04:10 -0000 Author: jchandra Date: Mon Feb 27 13:04:09 2012 New Revision: 232208 URL: http://svn.freebsd.org/changeset/base/232208 Log: Move UART device to dev/ directory. Other drivers for the XLP SoC devices will be added here as well Added: user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c - copied unchanged from r231964, user/jchandra/xlp-merge/sys/mips/nlm/uart_pci_xlp.c Deleted: user/jchandra/xlp-merge/sys/mips/nlm/uart_pci_xlp.c Modified: user/jchandra/xlp-merge/sys/mips/nlm/files.xlp Copied: user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c (from r231964, user/jchandra/xlp-merge/sys/mips/nlm/uart_pci_xlp.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c Mon Feb 27 13:04:09 2012 (r232208, copy of r231964, user/jchandra/xlp-merge/sys/mips/nlm/uart_pci_xlp.c) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2011 Netlogic Microsystems Inc. + * + * (based on dev/uart/uart_bus_pci.c) + * Copyright (c) 2006 Marcel Moolenaar + * Copyright (c) 2001 M. Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include + +static int uart_soc_probe(device_t dev); + +static device_method_t uart_soc_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, uart_soc_probe), + DEVMETHOD(device_attach, uart_bus_attach), + DEVMETHOD(device_detach, uart_bus_detach), + { 0, 0 } +}; + +static driver_t uart_soc_driver = { + uart_driver_name, + uart_soc_methods, + sizeof(struct uart_softc), +}; + +static int +uart_soc_probe(device_t dev) +{ + struct uart_softc *sc; + + if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC || + pci_get_device(dev) != PCI_DEVICE_ID_NLM_UART) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_class = &uart_ns8250_class; + device_set_desc(dev, "Netlogic SoC UART"); + return (uart_bus_probe(dev, 2, 133000000, 0, 0)); +} + +DRIVER_MODULE(uart_soc, pci, uart_soc_driver, uart_devclass, 0, 0); Modified: user/jchandra/xlp-merge/sys/mips/nlm/files.xlp ============================================================================== --- user/jchandra/xlp-merge/sys/mips/nlm/files.xlp Mon Feb 27 10:31:54 2012 (r232207) +++ user/jchandra/xlp-merge/sys/mips/nlm/files.xlp Mon Feb 27 13:04:09 2012 (r232208) @@ -13,12 +13,13 @@ mips/nlm/board_eeprom.c standard mips/nlm/board_cpld.c standard mips/nlm/xlp_pci.c optional pci mips/nlm/intern_dev.c optional pci -mips/nlm/uart_pci_xlp.c optional uart mips/nlm/uart_cpu_xlp.c optional uart mips/nlm/usb_init.c optional usb # -# Network driver and micro-core code +# Simple SoC devices +mips/nlm/dev/uart_pci_xlp.c optional uart # +# Network driver and micro-core code mips/nlm/dev/net/nae.c optional xlpge mips/nlm/dev/net/mdio.c optional xlpge mips/nlm/dev/net/sgmii.c optional xlpge From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 13:57:14 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF46A1065672; Mon, 27 Feb 2012 13:57:14 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 949C78FC13; Mon, 27 Feb 2012 13:57:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RDvEcO020620; Mon, 27 Feb 2012 13:57:14 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RDvEbh020615; Mon, 27 Feb 2012 13:57:14 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201202271357.q1RDvEbh020615@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 27 Feb 2012 13:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232210 - user/jchandra/xlp-merge/sys/dev/cfi X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 13:57:14 -0000 Author: jchandra Date: Mon Feb 27 13:57:14 2012 New Revision: 232210 URL: http://svn.freebsd.org/changeset/base/232210 Log: CFI fixes for big endian architectures. The commands and responses are little-endian which has to be bswapped, while raw read of data need not be. Make the default cfi_read and cfi_write do 'htole', and provide a cfi_read_raw which is used for reading data. Modified: user/jchandra/xlp-merge/sys/dev/cfi/cfi_core.c user/jchandra/xlp-merge/sys/dev/cfi/cfi_dev.c user/jchandra/xlp-merge/sys/dev/cfi/cfi_disk.c user/jchandra/xlp-merge/sys/dev/cfi/cfi_var.h Modified: user/jchandra/xlp-merge/sys/dev/cfi/cfi_core.c ============================================================================== --- user/jchandra/xlp-merge/sys/dev/cfi/cfi_core.c Mon Feb 27 13:38:52 2012 (r232209) +++ user/jchandra/xlp-merge/sys/dev/cfi/cfi_core.c Mon Feb 27 13:57:14 2012 (r232210) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -54,7 +55,7 @@ devclass_t cfi_devclass; devclass_t cfi_diskclass; uint32_t -cfi_read(struct cfi_softc *sc, u_int ofs) +cfi_read_raw(struct cfi_softc *sc, u_int ofs) { uint32_t val; @@ -76,6 +77,29 @@ cfi_read(struct cfi_softc *sc, u_int ofs return (val); } +uint32_t +cfi_read(struct cfi_softc *sc, u_int ofs) +{ + uint32_t val; + + ofs &= ~(sc->sc_width - 1); + switch (sc->sc_width) { + case 1: + val = bus_space_read_1(sc->sc_tag, sc->sc_handle, ofs); + break; + case 2: + val = le16toh(bus_space_read_2(sc->sc_tag, sc->sc_handle, ofs)); + break; + case 4: + val = le32toh(bus_space_read_4(sc->sc_tag, sc->sc_handle, ofs)); + break; + default: + val = ~0; + break; + } + return (val); +} + static void cfi_write(struct cfi_softc *sc, u_int ofs, u_int val) { @@ -86,10 +110,10 @@ cfi_write(struct cfi_softc *sc, u_int of bus_space_write_1(sc->sc_tag, sc->sc_handle, ofs, val); break; case 2: - bus_space_write_2(sc->sc_tag, sc->sc_handle, ofs, val); + bus_space_write_2(sc->sc_tag, sc->sc_handle, ofs, htole16(val)); break; case 4: - bus_space_write_4(sc->sc_tag, sc->sc_handle, ofs, val); + bus_space_write_4(sc->sc_tag, sc->sc_handle, ofs, htole32(val)); break; } } Modified: user/jchandra/xlp-merge/sys/dev/cfi/cfi_dev.c ============================================================================== --- user/jchandra/xlp-merge/sys/dev/cfi/cfi_dev.c Mon Feb 27 13:38:52 2012 (r232209) +++ user/jchandra/xlp-merge/sys/dev/cfi/cfi_dev.c Mon Feb 27 13:57:14 2012 (r232210) @@ -103,7 +103,7 @@ cfi_block_start(struct cfi_softc *sc, u_ /* Read the block from flash for byte-serving. */ ptr.x8 = sc->sc_wrbuf; for (r = 0; r < sc->sc_wrbufsz; r += sc->sc_width) { - val = cfi_read(sc, sc->sc_wrofs + r); + val = cfi_read_raw(sc, sc->sc_wrofs + r); switch (sc->sc_width) { case 1: *(ptr.x8)++ = val; @@ -189,7 +189,7 @@ cfi_devread(struct cdev *dev, struct uio while (error == 0 && uio->uio_resid > 0 && uio->uio_offset < sc->sc_size) { ofs = uio->uio_offset; - val = cfi_read(sc, ofs); + val = cfi_read_raw(sc, ofs); switch (sc->sc_width) { case 1: buf.x8[0] = val; Modified: user/jchandra/xlp-merge/sys/dev/cfi/cfi_disk.c ============================================================================== --- user/jchandra/xlp-merge/sys/dev/cfi/cfi_disk.c Mon Feb 27 13:38:52 2012 (r232209) +++ user/jchandra/xlp-merge/sys/dev/cfi/cfi_disk.c Mon Feb 27 13:57:14 2012 (r232210) @@ -182,19 +182,19 @@ cfi_disk_read(struct cfi_softc *sc, stru if (sc->sc_width == 1) { uint8_t *dp = (uint8_t *)bp->bio_data; while (resid > 0 && bp->bio_offset < sc->sc_size) { - *dp++ = cfi_read(sc, bp->bio_offset); + *dp++ = cfi_read_raw(sc, bp->bio_offset); bp->bio_offset += 1, resid -= 1; } } else if (sc->sc_width == 2) { uint16_t *dp = (uint16_t *)bp->bio_data; while (resid > 0 && bp->bio_offset < sc->sc_size) { - *dp++ = cfi_read(sc, bp->bio_offset); + *dp++ = cfi_read_raw(sc, bp->bio_offset); bp->bio_offset += 2, resid -= 2; } } else { uint32_t *dp = (uint32_t *)bp->bio_data; while (resid > 0 && bp->bio_offset < sc->sc_size) { - *dp++ = cfi_read(sc, bp->bio_offset); + *dp++ = cfi_read_raw(sc, bp->bio_offset); bp->bio_offset += 4, resid -= 4; } } Modified: user/jchandra/xlp-merge/sys/dev/cfi/cfi_var.h ============================================================================== --- user/jchandra/xlp-merge/sys/dev/cfi/cfi_var.h Mon Feb 27 13:38:52 2012 (r232209) +++ user/jchandra/xlp-merge/sys/dev/cfi/cfi_var.h Mon Feb 27 13:57:14 2012 (r232210) @@ -71,6 +71,7 @@ int cfi_probe(device_t); int cfi_attach(device_t); int cfi_detach(device_t); +uint32_t cfi_read_raw(struct cfi_softc *, u_int); uint32_t cfi_read(struct cfi_softc *, u_int); uint8_t cfi_read_qry(struct cfi_softc *, u_int); int cfi_write_block(struct cfi_softc *); From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 14:03:50 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16A85106566B; Mon, 27 Feb 2012 14:03:50 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 061818FC18; Mon, 27 Feb 2012 14:03:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RE3n6g020867; Mon, 27 Feb 2012 14:03:49 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RE3ncE020865; Mon, 27 Feb 2012 14:03:49 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201202271403.q1RE3ncE020865@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 27 Feb 2012 14:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232211 - user/jchandra/xlp-merge/sys/mips/nlm/dev X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 14:03:50 -0000 Author: jchandra Date: Mon Feb 27 14:03:49 2012 New Revision: 232211 URL: http://svn.freebsd.org/changeset/base/232211 Log: Use DEVMETHOD_END Modified: user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c Modified: user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c ============================================================================== --- user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c Mon Feb 27 13:57:14 2012 (r232210) +++ user/jchandra/xlp-merge/sys/mips/nlm/dev/uart_pci_xlp.c Mon Feb 27 14:03:49 2012 (r232211) @@ -56,7 +56,7 @@ static device_method_t uart_soc_methods[ DEVMETHOD(device_probe, uart_soc_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t uart_soc_driver = { From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 14:12:50 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C405106564A; Mon, 27 Feb 2012 14:12:50 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10B9F8FC14; Mon, 27 Feb 2012 14:12:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RECnlb021308; Mon, 27 Feb 2012 14:12:49 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RECnIR021303; Mon, 27 Feb 2012 14:12:49 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201202271412.q1RECnIR021303@svn.freebsd.org> From: "Jayachandran C." Date: Mon, 27 Feb 2012 14:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232212 - in user/jchandra/xlp-merge/sys/mips: conf nlm nlm/dev X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 14:12:50 -0000 Author: jchandra Date: Mon Feb 27 14:12:49 2012 New Revision: 232212 URL: http://svn.freebsd.org/changeset/base/232212 Log: NOR flash driver for XLP The NOR interface on the SoC appears on the top level PCI bus. Add a simple driver for this. Added: user/jchandra/xlp-merge/sys/mips/nlm/dev/cfi_pci_xlp.c Modified: user/jchandra/xlp-merge/sys/mips/conf/std.XLP user/jchandra/xlp-merge/sys/mips/nlm/files.xlp user/jchandra/xlp-merge/sys/mips/nlm/xlp_pci.c Modified: user/jchandra/xlp-merge/sys/mips/conf/std.XLP ============================================================================== --- user/jchandra/xlp-merge/sys/mips/conf/std.XLP Mon Feb 27 14:03:49 2012 (r232211) +++ user/jchandra/xlp-merge/sys/mips/conf/std.XLP Mon Feb 27 14:12:49 2012 (r232212) @@ -106,3 +106,7 @@ device nlmsec device nlmrsa options IPSEC options GEOM_ELI + +# NOR +device cfi +device cfid Added: user/jchandra/xlp-merge/sys/mips/nlm/dev/cfi_pci_xlp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/jchandra/xlp-merge/sys/mips/nlm/dev/cfi_pci_xlp.c Mon Feb 27 14:12:49 2012 (r232212) @@ -0,0 +1,78 @@ +/*- + * Copyright (c) 2011 Netlogic Microsystems Inc. + * + * (based on dev/uart/uart_bus_pci.c) + * Copyright (c) 2006 Marcel Moolenaar + * Copyright (c) 2001 M. Warner Losh + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +static int cfi_xlp_probe(device_t dev); + +static device_method_t cfi_xlp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, cfi_xlp_probe), + DEVMETHOD(device_attach, cfi_attach), + DEVMETHOD(device_detach, cfi_detach), + DEVMETHOD_END +}; + +static driver_t cfi_xlp_driver = { + cfi_driver_name, + cfi_xlp_methods, + sizeof(struct cfi_softc), +}; + +static int +cfi_xlp_probe(device_t dev) +{ + + if (pci_get_vendor(dev) != PCI_VENDOR_NETLOGIC || + pci_get_device(dev) != PCI_DEVICE_ID_NLM_NOR) + return (ENXIO); + + device_set_desc(dev, "Netlogic XLP NOR Bus"); + return (cfi_probe(dev)); +} + +DRIVER_MODULE(cfi_xlp, pci, cfi_xlp_driver, cfi_devclass, 0, 0); Modified: user/jchandra/xlp-merge/sys/mips/nlm/files.xlp ============================================================================== --- user/jchandra/xlp-merge/sys/mips/nlm/files.xlp Mon Feb 27 14:03:49 2012 (r232211) +++ user/jchandra/xlp-merge/sys/mips/nlm/files.xlp Mon Feb 27 14:12:49 2012 (r232212) @@ -18,6 +18,7 @@ mips/nlm/usb_init.c optional usb # # Simple SoC devices mips/nlm/dev/uart_pci_xlp.c optional uart +mips/nlm/dev/cfi_pci_xlp.c optional cfi # # Network driver and micro-core code mips/nlm/dev/net/nae.c optional xlpge Modified: user/jchandra/xlp-merge/sys/mips/nlm/xlp_pci.c ============================================================================== --- user/jchandra/xlp-merge/sys/mips/nlm/xlp_pci.c Mon Feb 27 14:03:49 2012 (r232211) +++ user/jchandra/xlp-merge/sys/mips/nlm/xlp_pci.c Mon Feb 27 14:12:49 2012 (r232212) @@ -59,10 +59,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include -#include #include #include #include @@ -480,6 +481,7 @@ assign_soc_resource(device_t child, int u_long *countp, struct rman **rm, bus_space_tag_t *bst, vm_offset_t *va) { int devid, inst, node, unit; + uint32_t val; devid = pci_get_device(child); inst = pci_get_function(child); @@ -506,6 +508,15 @@ assign_soc_resource(device_t child, int *rm = &emul_rman; *bst = uart_bus_space_mem; break; + case PCI_DEVICE_ID_NLM_NOR: + /* XXXJC: support multiple chip selects */ + val = nlm_read_pci_reg(nlm_get_gbu_regbase(node), 0); + *startp = val << 8; + *va = MIPS_PHYS_TO_KSEG1(*startp); + /* XXXJC: count is not correct */ + *countp = 0x100; + *rm = &emul_rman; + break; } /* calculate end if allocated */ if (*rm) From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 15:58:38 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDF5A1065672; Mon, 27 Feb 2012 15:58:38 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDC388FC0C; Mon, 27 Feb 2012 15:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RFwcLO025253; Mon, 27 Feb 2012 15:58:38 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RFwcaZ025251; Mon, 27 Feb 2012 15:58:38 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271558.q1RFwcaZ025251@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 15:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232216 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 15:58:38 -0000 Author: gabor Date: Mon Feb 27 15:58:38 2012 New Revision: 232216 URL: http://svn.freebsd.org/changeset/base/232216 Log: - Fix infinite loop Modified: user/gabor/tre-integration/usr.bin/grep/util.c Modified: user/gabor/tre-integration/usr.bin/grep/util.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 15:47:41 2012 (r232215) +++ user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 15:58:38 2012 (r232216) @@ -276,7 +276,7 @@ procline(struct str *l, int nottext) int c = 0, m = 0, r = 0; /* Loop to process the whole line */ - while (st <= l->len) { + while (st < l->len) { pmatch.rm_so = st; pmatch.rm_eo = l->len; From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 15:59:18 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDCF1065675; Mon, 27 Feb 2012 15:59:18 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B86F8FC13; Mon, 27 Feb 2012 15:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RFxIfk025310; Mon, 27 Feb 2012 15:59:18 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RFxHQ9025308; Mon, 27 Feb 2012 15:59:17 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271559.q1RFxHQ9025308@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 15:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232217 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 15:59:18 -0000 Author: gabor Date: Mon Feb 27 15:59:17 2012 New Revision: 232217 URL: http://svn.freebsd.org/changeset/base/232217 Log: - Use mregerror() to determine which pattern compilation fails and why Modified: user/gabor/tre-integration/usr.bin/grep/grep.c Modified: user/gabor/tre-integration/usr.bin/grep/grep.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/grep.c Mon Feb 27 15:58:38 2012 (r232216) +++ user/gabor/tre-integration/usr.bin/grep/grep.c Mon Feb 27 15:59:17 2012 (r232217) @@ -687,9 +687,10 @@ main(int argc, char *argv[]) ptr = (const char **)pats; c = mregncomp(&preg, patterns, ptr, lens, cflags); if (c != 0) { - // regerror(c, &r_pattern[i], re_error, RE_ERROR_BUF); - // errx(2, "%s", re_error); - errx(2, "%s", "Bad patterns."); + int no; + + mregerror(c, &preg, &no, re_error, RE_ERROR_BUF); + errx(2, "%s:%s", pats[no], re_error); } if (lbflag) From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:10:44 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2EA61065676; Mon, 27 Feb 2012 16:10:44 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2BFA8FC1F; Mon, 27 Feb 2012 16:10:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGAiXb025850; Mon, 27 Feb 2012 16:10:44 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGAiPB025848; Mon, 27 Feb 2012 16:10:44 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271610.q1RGAiPB025848@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232220 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:10:45 -0000 Author: gabor Date: Mon Feb 27 16:10:44 2012 New Revision: 232220 URL: http://svn.freebsd.org/changeset/base/232220 Log: - Use fast matcher when possible (add missing return) Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/regexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/regexec.c Mon Feb 27 16:10:26 2012 (r232219) +++ user/gabor/tre-integration/contrib/tre/lib/regexec.c Mon Feb 27 16:10:44 2012 (r232220) @@ -167,8 +167,8 @@ tre_match(const regex_t *preg, const voi heur_t *heur = preg->heur; if ((shortcut != NULL) && (type != STR_USER)) - tre_match_fast(shortcut, string, len, type, nmatch, - pmatch, eflags); + return tre_match_fast(shortcut, string, len, type, nmatch, + pmatch, eflags); else if ((heur != NULL) && (type != STR_USER)) return tre_match_heur(tnfa, heur, string, len, type, nmatch, pmatch, eflags); From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:12:00 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F23B8106568E; Mon, 27 Feb 2012 16:12:00 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1F0A8FC12; Mon, 27 Feb 2012 16:12:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGC061025939; Mon, 27 Feb 2012 16:12:00 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGC0JN025937; Mon, 27 Feb 2012 16:12:00 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271612.q1RGC0JN025937@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:12:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232221 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:12:01 -0000 Author: gabor Date: Mon Feb 27 16:12:00 2012 New Revision: 232221 URL: http://svn.freebsd.org/changeset/base/232221 Log: - When the pattern is too short no need to free anything Modified: user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Modified: user/gabor/tre-integration/contrib/tre/lib/tre-compile.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Mon Feb 27 16:10:44 2012 (r232220) +++ user/gabor/tre-integration/contrib/tre/lib/tre-compile.c Mon Feb 27 16:12:00 2012 (r232221) @@ -2033,8 +2033,8 @@ tre_compile_bm(regex_t *preg, const tre_ } else { -too_short: xfree(shortcut); +too_short: preg->shortcut = NULL; DPRINT("tre_compile_bm: pattern compilation failed for fast matcher\n"); } From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:12:50 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BD11106566B; Mon, 27 Feb 2012 16:12:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A0B8FC0C; Mon, 27 Feb 2012 16:12:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGCo5S026018; Mon, 27 Feb 2012 16:12:50 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGCoK2026015; Mon, 27 Feb 2012 16:12:50 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271612.q1RGCoK2026015@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232222 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:12:50 -0000 Author: gabor Date: Mon Feb 27 16:12:49 2012 New Revision: 232222 URL: http://svn.freebsd.org/changeset/base/232222 Log: - Avoid segfaults by adding and extra condition and initializing variables with NULL Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c user/gabor/tre-integration/contrib/tre/lib/mregexec.c Modified: user/gabor/tre-integration/contrib/tre/lib/mregcomp.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Mon Feb 27 16:12:00 2012 (r232221) +++ user/gabor/tre-integration/contrib/tre/lib/mregcomp.c Mon Feb 27 16:12:49 2012 (r232222) @@ -58,11 +58,12 @@ tre_mcompile(mregex_t *preg, size_t nr, size_t *wn, const char **regex, size_t *n, int cflags) { int ret; - const wchar_t **frags; - size_t *siz; - wmsearch_t *wm; + const wchar_t **frags = NULL; + size_t *siz = NULL; + wmsearch_t *wm = NULL; preg->k = nr; + preg->searchdata = NULL; preg->patterns = xmalloc(nr * sizeof(regex_t)); if (!preg->patterns) return REG_ESPACE; @@ -152,7 +153,7 @@ err: xfree(wm); finish: - if (!(cflags & REG_LITERAL)) + if (!(cflags & REG_LITERAL) && !(preg->type == MHEUR_SINGLE)) { if (frags) xfree(frags); @@ -168,8 +169,8 @@ tre_mregncomp(mregex_t *preg, size_t nr, { int i, ret; const wchar_t **wr; - wchar_t **wregex; - size_t *wlen; + wchar_t **wregex = NULL; + size_t *wlen = NULL; wregex = xmalloc(nr * sizeof(wchar_t *)); if (!wregex) @@ -226,8 +227,8 @@ tre_mregwncomp(mregex_t *preg, size_t nr { int i, ret; const char **sr; - char **sregex; - size_t *slen; + char **sregex = NULL; + size_t *slen = NULL; sregex = xmalloc(nr * sizeof(char *)); if (!sregex) Modified: user/gabor/tre-integration/contrib/tre/lib/mregexec.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/mregexec.c Mon Feb 27 16:12:00 2012 (r232221) +++ user/gabor/tre-integration/contrib/tre/lib/mregexec.c Mon Feb 27 16:12:49 2012 (r232222) @@ -58,7 +58,7 @@ tre_mmatch(const void *str, size_t len, int ret; bool need_offsets; - need_offsets = (((wmsearch_t *)(preg->searchdata))->cflags & REG_NOSUB) && + need_offsets = (preg->searchdata && ((wmsearch_t *)(preg->searchdata))->cflags & REG_NOSUB) && (nmatch > 0); #define INPUT(pos) ((type == STR_WIDE) ? (const void *)&str_wide[pos] : \ From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:15:56 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B461065670; Mon, 27 Feb 2012 16:15:56 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C98738FC0A; Mon, 27 Feb 2012 16:15:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGFuFC026227; Mon, 27 Feb 2012 16:15:56 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGFu9X026225; Mon, 27 Feb 2012 16:15:56 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271615.q1RGFu9X026225@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232223 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:15:56 -0000 Author: gabor Date: Mon Feb 27 16:15:56 2012 New Revision: 232223 URL: http://svn.freebsd.org/changeset/base/232223 Log: - When having a match that is not a full match we cannot have a full match later in the same line. Modified: user/gabor/tre-integration/usr.bin/grep/util.c Modified: user/gabor/tre-integration/usr.bin/grep/util.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:12:49 2012 (r232222) +++ user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:15:56 2012 (r232223) @@ -289,11 +289,14 @@ procline(struct str *l, int nottext) // XXX: better error msg? errx(2, "Failed processing input."); - /* Check for full match */ + /* + * Check for full match. There is already a match so + * if it fails it will not succeed later either. + */ if (xflag) if (pmatch.rm_so != 0 || (size_t)pmatch.rm_eo != l->len) - continue; + break; /* If reached here, we have a match. */ if (m == 0) From owner-svn-src-user@FreeBSD.ORG Mon Feb 27 16:18:51 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B673B1065680; Mon, 27 Feb 2012 16:18:51 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD3F8FC1B; Mon, 27 Feb 2012 16:18:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGInJs026361; Mon, 27 Feb 2012 16:18:49 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGInMJ026359; Mon, 27 Feb 2012 16:18:49 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202271618.q1RGInMJ026359@svn.freebsd.org> From: Gabor Kovesdan Date: Mon, 27 Feb 2012 16:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232224 - user/gabor/tre-integration/usr.bin/grep X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:18:51 -0000 Author: gabor Date: Mon Feb 27 16:18:49 2012 New Revision: 232224 URL: http://svn.freebsd.org/changeset/base/232224 Log: - mregerror() (and regerror()) can also be used after regexec() and the rest Modified: user/gabor/tre-integration/usr.bin/grep/util.c Modified: user/gabor/tre-integration/usr.bin/grep/util.c ============================================================================== --- user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:15:56 2012 (r232223) +++ user/gabor/tre-integration/usr.bin/grep/util.c Mon Feb 27 16:18:49 2012 (r232224) @@ -285,9 +285,10 @@ procline(struct str *l, int nottext) (size_t)pmatch.rm_eo; if (r == REG_NOMATCH) continue; - else if (r != REG_OK) - // XXX: better error msg? - errx(2, "Failed processing input."); + else if (r != REG_OK) { + mregerror(r, &preg, NULL, re_error, RE_ERROR_BUF); + errx(2, "%s", re_error); + } /* * Check for full match. There is already a match so From owner-svn-src-user@FreeBSD.ORG Tue Feb 28 13:28:50 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9837F1065674; Tue, 28 Feb 2012 13:28:50 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD578FC1B; Tue, 28 Feb 2012 13:28:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SDSoOO072696; Tue, 28 Feb 2012 13:28:50 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SDSofq072694; Tue, 28 Feb 2012 13:28:50 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202281328.q1SDSofq072694@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 28 Feb 2012 13:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232251 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 13:28:50 -0000 Author: gabor Date: Tue Feb 28 13:28:50 2012 New Revision: 232251 URL: http://svn.freebsd.org/changeset/base/232251 Log: - Fix some shifts in the Wu-Manber algorithms - Actually update shifts if there is a lower one for the same fragment - Fix saving patterns - Initialize some pointers with NULL and avoid segfaults Modified: user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Modified: user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Tue Feb 28 13:19:34 2012 (r232250) +++ user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Tue Feb 28 13:28:50 2012 (r232251) @@ -58,8 +58,12 @@ for (int i = 1; i < nr; i++) \ wm->m_field = siz_arr[i] < wm->m_field ? siz_arr[i] : wm->m_field; \ \ - wm->sh_field = hashtable_init((wm->m_field - 1) * nr * 2, WM_B * \ - char_size, sizeof(wmentry_t)); \ + /* + * m - WM_B + 1 fragment per pattern plus extra space to reduce \ + * collisions. \ + */ \ + wm->sh_field = hashtable_init((wm->m_field - WM_B + 1) * nr * 2, \ + WM_B * char_size, sizeof(wmentry_t)); \ if (!wm->sh_field) \ { \ ret = REG_ESPACE; \ @@ -73,7 +77,7 @@ \ /* First fragment, treat special because it is a prefix */ \ ret = hashtable_get(wm->sh_field, pat_arr[i], entry); \ - sh = siz_arr[i] - WM_B; \ + sh = wm->m_field - WM_B; \ switch (ret) \ { \ case HASH_NOTFOUND: \ @@ -88,14 +92,15 @@ case HASH_OK: \ entry->shift = entry->shift < sh ? entry->shift : sh; \ entry->pref_list[entry->pref++] = i; \ + ret = hashtable_put(wm->sh_field, pat_arr[i], entry); \ if (ret != HASH_UPDATED) \ FAIL; \ } \ /* Intermediate fragments, only shift calculated */ \ - for (int j = 1; j < siz_arr[i] - WM_B; j++) \ + for (int j = 1; j < wm->m_field - WM_B; j++) \ { \ ret = hashtable_get(wm->sh_field, &pat_arr[i][j], entry); \ - sh = siz_arr[i] - WM_B - j; \ + sh = wm->m_field - WM_B - j; \ switch (ret) \ { \ case HASH_NOTFOUND: \ @@ -109,11 +114,13 @@ break; \ case HASH_OK: \ entry->shift = entry->shift < sh ? entry->shift : sh; \ + ret = hashtable_put(wm->sh_field, &pat_arr[i][j], \ + entry); \ if (ret != HASH_UPDATED) \ FAIL; \ } \ } \ - ret = hashtable_get(wm->sh_field, &pat_arr[i][n[i] - WM_B], \ + ret = hashtable_get(wm->sh_field, &pat_arr[i][wm->m_field - WM_B],\ entry); \ switch (ret) \ { \ @@ -122,36 +129,43 @@ entry->suff = 1; \ entry->pref = 0; \ entry->suff_list[0] = i; \ - ret = hashtable_put(wm->sh_field, &pat_arr[i][n[i] - WM_B], \ - entry); \ + ret = hashtable_put(wm->sh_field, &pat_arr[i][wm->m_field - \ + WM_B], entry); \ if (ret != HASH_OK) \ FAIL; \ case HASH_OK: \ entry->shift = entry->shift < sh ? entry->shift : sh; \ entry->suff_list[entry->suff++] = i; \ + ret = hashtable_put(wm->sh_field, &pat_arr[i][wm->m_field - \ + WM_B], entry); \ if (ret != HASH_UPDATED) \ FAIL; \ } \ } \ xfree(entry); -#define _SAVE_PATTERNS(dst, s, type) \ +#define _SAVE_PATTERNS(src, ss, dst, ds, type) \ do \ { \ ALLOC(dst, sizeof(type *) * nr); \ - ALLOC(s, sizeof(size_t) * nr); \ + ALLOC(ds, sizeof(size_t) * nr); \ for (int i = 0; i < nr; i++) \ { \ - ALLOC(dst[i], n[i] * sizeof(type)); \ - memcpy(dst[i], regex[i], n[i] * sizeof(type)); \ - s[i] = n[i]; \ + ALLOC(dst[i], ss[i] * sizeof(type)); \ + memcpy(dst[i], src[i], ss[i] * sizeof(type)); \ + ds[i] = ss[i]; \ } \ } while (0); +#ifdef TRE_WCHAR #define SAVE_PATTERNS \ - _SAVE_PATTERNS(wm->pat, wm->siz, char) + _SAVE_PATTERNS(bregex, bn, wm->pat, wm->siz, char) #define SAVE_PATTERNS_WIDE \ - _SAVE_PATTERNS(wm->wpat, wm->wsiz, tre_char_t) + _SAVE_PATTERNS(regex, n, wm->wpat, wm->wsiz, tre_char_t) +#else +#define SAVE_PATTERNS \ + _SAVE_PATTERNS(regex, n, wm->pat, wm->siz, char) +#endif #ifdef TRE_WCHAR #define PROC_WM(pat_arr, size_arr) \ @@ -177,15 +191,15 @@ tre_wmcomp(wmsearch_t *wm, size_t nr, co wmentry_t *entry = NULL; int ret; #ifdef TRE_WCHAR - char **bregex; - size_t *bn; + char **bregex = NULL; + size_t *bn = NULL; #endif ALLOC(wm, sizeof(wmsearch_t)); + wm->wshift = NULL; + wm->shift = NULL; #ifdef TRE_WCHAR - PROC_WM_WIDE(regex, n); - ALLOC(bregex, sizeof(char *) * nr); ALLOC(bn, sizeof(size_t) * nr); @@ -205,21 +219,33 @@ tre_wmcomp(wmsearch_t *wm, size_t nr, co wm->pat = bregex; wm->siz = bn; + + PROC_WM_WIDE(regex, n); PROC_WM(bregex, bn); + SAVE_PATTERNS_WIDE; + SAVE_PATTERNS; + for (int i = 0; i < nr; i++) xfree(bregex[i]); xfree(bregex); - - SAVE_PATTERNS; - SAVE_PATTERNS_WIDE; + xfree(bn); #else PROC_WM(regex, n); SAVE_PATTERNS; #endif return REG_OK; + fail: #ifdef TRE_WCHAR + if (bn) + xfree(bn); + if (bregex) + { + for (int i = 0; i < nr; i++) + xfree(bregex[i]); + xfree(bregex); + } if (wm->wshift) hashtable_free(wm->wshift); #endif From owner-svn-src-user@FreeBSD.ORG Tue Feb 28 14:22:55 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51201106564A; Tue, 28 Feb 2012 14:22:55 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40B868FC18; Tue, 28 Feb 2012 14:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SEMtDk074502; Tue, 28 Feb 2012 14:22:55 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SEMtpV074500; Tue, 28 Feb 2012 14:22:55 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201202281422.q1SEMtpV074500@svn.freebsd.org> From: Gabor Kovesdan Date: Tue, 28 Feb 2012 14:22:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232252 - user/gabor/tre-integration/contrib/tre/lib X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 14:22:55 -0000 Author: gabor Date: Tue Feb 28 14:22:54 2012 New Revision: 232252 URL: http://svn.freebsd.org/changeset/base/232252 Log: - Fix return when match found - Remove a superfluous else - Initialize pointers with NULL Modified: user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Modified: user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Tue Feb 28 13:28:50 2012 (r232251) +++ user/gabor/tre-integration/contrib/tre/lib/tre-mfastmatch.c Tue Feb 28 14:22:54 2012 (r232252) @@ -266,9 +266,9 @@ fail: pmatch->rm_so = beg; \ pmatch->rm_eo = end; \ pmatch->p = idx; \ - ret = REG_OK; \ - goto finish; \ } \ + ret = REG_OK; \ + goto finish; \ } while (0); #define _WMSEARCH(data, pats, sizes, mlen, tbl, dshift) \ @@ -305,8 +305,6 @@ fail: idx); \ } \ } \ - else \ - continue; \ pos += 1; \ } \ } \ @@ -326,7 +324,7 @@ tre_wmexec(const wmsearch_t *wm, const v tre_str_type_t type, size_t nmatch, regmatch_t pmatch[], int eflags) { - wmentry_t *s_entry, *p_entry; + wmentry_t *s_entry = NULL, *p_entry = NULL; const tre_char_t *wide_str = str; const char *byte_str = str; size_t pos = (type == STR_WIDE) ? wm->wm : wm->m; From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 00:27:52 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09F7D106564A; Thu, 1 Mar 2012 00:27:52 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E98768FC16; Thu, 1 Mar 2012 00:27:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q210RpgF052016; Thu, 1 Mar 2012 00:27:51 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q210Rp0U052004; Thu, 1 Mar 2012 00:27:51 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201203010027.q210Rp0U052004@svn.freebsd.org> From: Attilio Rao Date: Thu, 1 Mar 2012 00:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232325 - in user/attilio/vmcontention: . cddl/contrib/opensolaris/cmd/zfs contrib/top etc/devd gnu/usr.bin/cc/c++ gnu/usr.bin/cc/cc gnu/usr.bin/cc/cpp lib/libc/sys lib/libsm lib/libthr... X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 00:27:52 -0000 Author: attilio Date: Thu Mar 1 00:27:51 2012 New Revision: 232325 URL: http://svn.freebsd.org/changeset/base/232325 Log: MFC Added: user/attilio/vmcontention/gnu/usr.bin/cc/cpp/gcpp.1 - copied unchanged from r232323, head/gnu/usr.bin/cc/cpp/gcpp.1 user/attilio/vmcontention/sys/powerpc/powermac/atibl.c - copied unchanged from r232323, head/sys/powerpc/powermac/atibl.c user/attilio/vmcontention/sys/x86/include/_limits.h - copied unchanged from r232323, head/sys/x86/include/_limits.h user/attilio/vmcontention/sys/x86/include/_stdint.h - copied unchanged from r232323, head/sys/x86/include/_stdint.h user/attilio/vmcontention/sys/x86/include/_types.h - copied unchanged from r232323, head/sys/x86/include/_types.h user/attilio/vmcontention/sys/x86/include/endian.h - copied unchanged from r232323, head/sys/x86/include/endian.h user/attilio/vmcontention/sys/x86/include/setjmp.h - copied unchanged from r232323, head/sys/x86/include/setjmp.h user/attilio/vmcontention/sys/x86/include/stdarg.h - copied unchanged from r232323, head/sys/x86/include/stdarg.h user/attilio/vmcontention/tools/build/options/WITH_CLANG_IS_CC - copied unchanged from r232323, head/tools/build/options/WITH_CLANG_IS_CC Modified: user/attilio/vmcontention/Makefile.inc1 user/attilio/vmcontention/ObsoleteFiles.inc user/attilio/vmcontention/UPDATING user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs.8 user/attilio/vmcontention/contrib/top/top.c user/attilio/vmcontention/etc/devd/apple.conf user/attilio/vmcontention/gnu/usr.bin/cc/c++/Makefile user/attilio/vmcontention/gnu/usr.bin/cc/cc/Makefile user/attilio/vmcontention/gnu/usr.bin/cc/cpp/Makefile user/attilio/vmcontention/lib/libc/sys/getsockopt.2 user/attilio/vmcontention/lib/libsm/Makefile user/attilio/vmcontention/lib/libthr/thread/thr_rwlock.c user/attilio/vmcontention/lib/libthr/thread/thr_umtx.c user/attilio/vmcontention/lib/libthr/thread/thr_umtx.h user/attilio/vmcontention/lib/libthread_db/Makefile user/attilio/vmcontention/lib/libz/Makefile user/attilio/vmcontention/libexec/mail.local/Makefile user/attilio/vmcontention/libexec/smrsh/Makefile user/attilio/vmcontention/sbin/fsdb/Makefile user/attilio/vmcontention/sbin/ifconfig/ifconfig.8 user/attilio/vmcontention/sbin/ipfw/ipfw.8 user/attilio/vmcontention/share/man/man4/ath.4 user/attilio/vmcontention/share/man/man4/mos.4 user/attilio/vmcontention/share/man/man4/net80211.4 user/attilio/vmcontention/share/man/man4/netmap.4 user/attilio/vmcontention/share/man/man4/usb.4 user/attilio/vmcontention/share/man/man5/devfs.5 user/attilio/vmcontention/share/man/man5/passwd.5 user/attilio/vmcontention/share/man/man5/rc.conf.5 user/attilio/vmcontention/share/man/man5/src.conf.5 user/attilio/vmcontention/share/man/man9/byteorder.9 user/attilio/vmcontention/share/man/man9/sysctl.9 user/attilio/vmcontention/share/misc/committers-doc.dot user/attilio/vmcontention/share/mk/bsd.own.mk user/attilio/vmcontention/share/mk/bsd.sys.mk user/attilio/vmcontention/sys/amd64/amd64/cpu_switch.S user/attilio/vmcontention/sys/amd64/include/_limits.h user/attilio/vmcontention/sys/amd64/include/_stdint.h user/attilio/vmcontention/sys/amd64/include/_types.h user/attilio/vmcontention/sys/amd64/include/cpufunc.h user/attilio/vmcontention/sys/amd64/include/endian.h user/attilio/vmcontention/sys/amd64/include/segments.h user/attilio/vmcontention/sys/amd64/include/setjmp.h user/attilio/vmcontention/sys/amd64/include/stdarg.h user/attilio/vmcontention/sys/arm/mv/mv_machdep.c user/attilio/vmcontention/sys/arm/xscale/i8134x/crb_machdep.c user/attilio/vmcontention/sys/boot/i386/boot0/Makefile user/attilio/vmcontention/sys/boot/i386/boot2/Makefile user/attilio/vmcontention/sys/boot/i386/btx/btx/Makefile user/attilio/vmcontention/sys/boot/i386/btx/btxldr/Makefile user/attilio/vmcontention/sys/boot/i386/gptboot/Makefile user/attilio/vmcontention/sys/boot/i386/gptzfsboot/Makefile user/attilio/vmcontention/sys/boot/i386/libi386/Makefile user/attilio/vmcontention/sys/boot/i386/libi386/vidconsole.c user/attilio/vmcontention/sys/boot/i386/pxeldr/Makefile user/attilio/vmcontention/sys/boot/i386/zfsboot/Makefile user/attilio/vmcontention/sys/boot/pc98/btx/btx/Makefile user/attilio/vmcontention/sys/boot/pc98/btx/btxldr/Makefile user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c user/attilio/vmcontention/sys/compat/linprocfs/linprocfs.c user/attilio/vmcontention/sys/compat/linsysfs/linsysfs.c user/attilio/vmcontention/sys/conf/Makefile.amd64 user/attilio/vmcontention/sys/conf/Makefile.i386 user/attilio/vmcontention/sys/conf/NOTES user/attilio/vmcontention/sys/conf/files.powerpc user/attilio/vmcontention/sys/conf/kern.mk user/attilio/vmcontention/sys/conf/kern.pre.mk user/attilio/vmcontention/sys/conf/kmod.mk user/attilio/vmcontention/sys/dev/acpi_support/atk0110.c user/attilio/vmcontention/sys/dev/amr/amr_pci.c user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.c user/attilio/vmcontention/sys/dev/ath/ath_rate/sample/sample.h user/attilio/vmcontention/sys/dev/ath/if_ath.c user/attilio/vmcontention/sys/dev/ath/if_ath_sysctl.c user/attilio/vmcontention/sys/dev/ath/if_athvar.h user/attilio/vmcontention/sys/dev/dpt/dpt_scsi.c user/attilio/vmcontention/sys/dev/e1000/if_em.c user/attilio/vmcontention/sys/dev/e1000/if_igb.c user/attilio/vmcontention/sys/dev/e1000/if_lem.c user/attilio/vmcontention/sys/dev/isci/isci.c user/attilio/vmcontention/sys/dev/ixgbe/ixgbe.c user/attilio/vmcontention/sys/dev/mii/rgephy.c user/attilio/vmcontention/sys/dev/mlx/mlx.c user/attilio/vmcontention/sys/dev/netmap/if_em_netmap.h user/attilio/vmcontention/sys/dev/netmap/if_igb_netmap.h user/attilio/vmcontention/sys/dev/netmap/if_lem_netmap.h user/attilio/vmcontention/sys/dev/netmap/if_re_netmap.h user/attilio/vmcontention/sys/dev/netmap/ixgbe_netmap.h user/attilio/vmcontention/sys/dev/netmap/netmap.c user/attilio/vmcontention/sys/dev/netmap/netmap_kern.h user/attilio/vmcontention/sys/dev/pci/pci.c user/attilio/vmcontention/sys/dev/pcn/if_pcn.c user/attilio/vmcontention/sys/dev/re/if_re.c user/attilio/vmcontention/sys/dev/sf/if_sfreg.h user/attilio/vmcontention/sys/dev/siba/siba_core.c user/attilio/vmcontention/sys/dev/usb/net/if_mos.c user/attilio/vmcontention/sys/dev/usb/net/if_mosreg.h user/attilio/vmcontention/sys/dev/usb/usbdevs user/attilio/vmcontention/sys/fs/devfs/devfs_vfsops.c user/attilio/vmcontention/sys/fs/nullfs/null_subr.c user/attilio/vmcontention/sys/fs/nullfs/null_vfsops.c user/attilio/vmcontention/sys/fs/nullfs/null_vnops.c user/attilio/vmcontention/sys/fs/procfs/procfs.c user/attilio/vmcontention/sys/fs/pseudofs/pseudofs.h user/attilio/vmcontention/sys/i386/i386/trap.c user/attilio/vmcontention/sys/i386/include/_limits.h user/attilio/vmcontention/sys/i386/include/_stdint.h user/attilio/vmcontention/sys/i386/include/_types.h user/attilio/vmcontention/sys/i386/include/apicvar.h user/attilio/vmcontention/sys/i386/include/endian.h user/attilio/vmcontention/sys/i386/include/segments.h user/attilio/vmcontention/sys/i386/include/setjmp.h user/attilio/vmcontention/sys/i386/include/stdarg.h user/attilio/vmcontention/sys/ia64/ia64/machdep.c user/attilio/vmcontention/sys/kern/kern_fork.c user/attilio/vmcontention/sys/kern/kern_jail.c user/attilio/vmcontention/sys/kern/kern_proc.c user/attilio/vmcontention/sys/kern/kern_umtx.c user/attilio/vmcontention/sys/kern/sched_ule.c user/attilio/vmcontention/sys/kern/subr_bus.c user/attilio/vmcontention/sys/kern/subr_syscall.c user/attilio/vmcontention/sys/kern/sys_pipe.c user/attilio/vmcontention/sys/kern/tty.c user/attilio/vmcontention/sys/kern/uipc_socket.c user/attilio/vmcontention/sys/kern/uipc_usrreq.c user/attilio/vmcontention/sys/kern/vfs_bio.c user/attilio/vmcontention/sys/kern/vfs_default.c user/attilio/vmcontention/sys/kern/vnode_if.src user/attilio/vmcontention/sys/mips/cavium/files.octeon1 user/attilio/vmcontention/sys/mips/cavium/if_octm.c user/attilio/vmcontention/sys/mips/cavium/octe/ethernet-common.c user/attilio/vmcontention/sys/mips/rt305x/rt305x_sysctl.c user/attilio/vmcontention/sys/modules/bios/smapi/Makefile user/attilio/vmcontention/sys/modules/linux/Makefile user/attilio/vmcontention/sys/modules/scc/Makefile user/attilio/vmcontention/sys/net/if_bridge.c user/attilio/vmcontention/sys/net/netmap.h user/attilio/vmcontention/sys/net/netmap_user.h user/attilio/vmcontention/sys/net80211/ieee80211_input.c user/attilio/vmcontention/sys/net80211/ieee80211_ioctl.h user/attilio/vmcontention/sys/net80211/ieee80211_sta.c user/attilio/vmcontention/sys/netatalk/aarp.c user/attilio/vmcontention/sys/netinet/ipfw/ip_fw_dynamic.c user/attilio/vmcontention/sys/pc98/include/_limits.h user/attilio/vmcontention/sys/pc98/include/_stdint.h user/attilio/vmcontention/sys/pc98/include/_types.h user/attilio/vmcontention/sys/pc98/include/endian.h user/attilio/vmcontention/sys/pc98/include/setjmp.h user/attilio/vmcontention/sys/pc98/include/stdarg.h user/attilio/vmcontention/sys/powerpc/conf/GENERIC user/attilio/vmcontention/sys/powerpc/conf/GENERIC64 user/attilio/vmcontention/sys/sys/jail.h user/attilio/vmcontention/sys/sys/proc.h user/attilio/vmcontention/sys/sys/rman.h user/attilio/vmcontention/sys/sys/socket.h user/attilio/vmcontention/sys/sys/sysctl.h user/attilio/vmcontention/sys/sys/vnode.h user/attilio/vmcontention/sys/vm/vm_kern.c user/attilio/vmcontention/sys/vm/vm_mmap.c user/attilio/vmcontention/sys/x86/cpufreq/p4tcc.c user/attilio/vmcontention/sys/x86/x86/busdma_machdep.c user/attilio/vmcontention/sys/x86/x86/local_apic.c user/attilio/vmcontention/sys/xen/interface/io/blkif.h user/attilio/vmcontention/tools/regression/fifo/fifo_misc/fifo_misc.c user/attilio/vmcontention/tools/regression/security/cap_test/cap_test_capmode.c user/attilio/vmcontention/tools/tools/net80211/wlanstats/wlanstats.c user/attilio/vmcontention/tools/tools/netmap/bridge.c user/attilio/vmcontention/tools/tools/netmap/pcap.c user/attilio/vmcontention/tools/tools/netmap/pkt-gen.c user/attilio/vmcontention/usr.bin/clang/clang/Makefile user/attilio/vmcontention/usr.bin/csup/auth.c user/attilio/vmcontention/usr.bin/fetch/fetch.1 user/attilio/vmcontention/usr.bin/fstat/fstat.c user/attilio/vmcontention/usr.bin/netstat/Makefile user/attilio/vmcontention/usr.bin/procstat/procstat.1 user/attilio/vmcontention/usr.bin/procstat/procstat_cred.c user/attilio/vmcontention/usr.bin/vacation/Makefile user/attilio/vmcontention/usr.bin/xargs/xargs.c user/attilio/vmcontention/usr.sbin/bsdinstall/distextract/distextract.c user/attilio/vmcontention/usr.sbin/bsdinstall/distfetch/distfetch.c user/attilio/vmcontention/usr.sbin/cron/crontab/crontab.c user/attilio/vmcontention/usr.sbin/jail/jail.8 user/attilio/vmcontention/usr.sbin/sendmail/Makefile user/attilio/vmcontention/usr.sbin/tzsetup/tzsetup.8 Directory Properties: user/attilio/vmcontention/ (props changed) user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/contrib/top/ (props changed) user/attilio/vmcontention/lib/libc/ (props changed) user/attilio/vmcontention/lib/libz/ (props changed) user/attilio/vmcontention/sbin/ (props changed) user/attilio/vmcontention/sbin/ipfw/ (props changed) user/attilio/vmcontention/share/man/man4/ (props changed) user/attilio/vmcontention/sys/ (props changed) user/attilio/vmcontention/sys/boot/ (props changed) user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed) user/attilio/vmcontention/sys/conf/ (props changed) user/attilio/vmcontention/usr.bin/csup/ (props changed) user/attilio/vmcontention/usr.bin/procstat/ (props changed) Modified: user/attilio/vmcontention/Makefile.inc1 ============================================================================== --- user/attilio/vmcontention/Makefile.inc1 Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/Makefile.inc1 Thu Mar 1 00:27:51 2012 (r232325) @@ -1108,6 +1108,10 @@ _aicasm= sys/modules/aic7xxx/aicasm _share= share/syscons/scrnmaps .endif +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") +_gcc_tools= gnu/usr.bin/cc/cc_tools +.endif + .if ${MK_KERBEROS} != "no" _kerberos5_tools= kerberos5/tools .endif @@ -1136,7 +1140,7 @@ build-tools: ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ - gnu/usr.bin/cc/cc_tools \ + ${_gcc_tools} \ ${_kerberos5_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ cd ${.CURDIR}/${_tool}; \ @@ -1166,14 +1170,12 @@ _kgzip= usr.sbin/kgzip _binutils= gnu/usr.bin/binutils .endif -.if ${MK_CLANG} != "no" -.if ${CC:T:Mclang} == "clang" +.if ${MK_CLANG} != "no" && (${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang") _clang= usr.bin/clang _clang_libs= lib/clang .endif -.endif -.if ${MK_GCC} != "no" +.if ${MK_GCC} != "no" && (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") _cc= gnu/usr.bin/cc .endif Modified: user/attilio/vmcontention/ObsoleteFiles.inc ============================================================================== --- user/attilio/vmcontention/ObsoleteFiles.inc Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/ObsoleteFiles.inc Thu Mar 1 00:27:51 2012 (r232325) @@ -39,23 +39,26 @@ # done # 20120225: libarchive 3.0.3 -OLD_FILES+=man/man3/archive_read_data_into_buffer.3.gz \ - man/man3/archive_read_support_compression_all.3.gz \ - man/man3/archive_read_support_compression_bzip2.3.gz \ - man/man3/archive_read_support_compression_compress.3.gz \ - man/man3/archive_read_support_compression_gzip.3.gz \ - man/man3/archive_read_support_compression_lzma.3.gz \ - man/man3/archive_read_support_compression_none.3.gz \ - man/man3/archive_read_support_compression_program.3.gz \ - man/man3/archive_read_support_compression_program_signature.3.gz \ - man/man3/archive_read_support_compression_xz.3.gz \ - man/man3/archive_write_set_callbacks.3.gz \ - man/man3/archive_write_set_compression_bzip2.3.gz \ - man/man3/archive_write_set_compression_compress.3.gz \ - man/man3/archive_write_set_compression_gzip.3.gz \ - man/man3/archive_write_set_compression_none.3.gz \ - man/man3/archive_write_set_compression_program.3.gz +OLD_FILES+=usr/share/man/man3/archive_read_data_into_buffer.3.gz \ + usr/share/man/man3/archive_read_support_compression_all.3.gz \ + usr/share/man/man3/archive_read_support_compression_bzip2.3.gz \ + usr/share/man/man3/archive_read_support_compression_compress.3.gz \ + usr/share/man/man3/archive_read_support_compression_gzip.3.gz \ + usr/share/man/man3/archive_read_support_compression_lzma.3.gz \ + usr/share/man/man3/archive_read_support_compression_none.3.gz \ + usr/share/man/man3/archive_read_support_compression_program.3.gz \ + usr/share/man/man3/archive_read_support_compression_program_signature.3.gz \ + usr/share/man/man3/archive_read_support_compression_xz.3.gz \ + usr/share/man/man3/archive_write_set_callbacks.3.gz \ + usr/share/man/man3/archive_write_set_compression_bzip2.3.gz \ + usr/share/man/man3/archive_write_set_compression_compress.3.gz \ + usr/share/man/man3/archive_write_set_compression_gzip.3.gz \ + usr/share/man/man3/archive_write_set_compression_none.3.gz \ + usr/share/man/man3/archive_write_set_compression_program.3.gz OLD_LIBS+=usr/lib/libarchive.so.5 +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_LIBS+=usr/lib32/libarchive.so.5 +.endif # 20120113: removal of wtmpcvt(1) OLD_FILES+=usr/bin/wtmpcvt OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz Modified: user/attilio/vmcontention/UPDATING ============================================================================== --- user/attilio/vmcontention/UPDATING Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/UPDATING Thu Mar 1 00:27:51 2012 (r232325) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120229: + Now unix domain sockets behave "as expected" on nullfs(5). Previously + nullfs(5) did not pass through all behaviours to the underlying layer, + as a result if we bound to a socket on the lower layer we could connect + only to the lower path; if we bound to the upper layer we could connect + only to the upper path. The new behavior is one can connect to both the + lower and the upper paths regardless what layer path one binds to. + 20120211: The getifaddrs upgrade path broken with 20111215 has been restored. If you have upgraded in between 20111215 and 20120209 you need to Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Thu Mar 1 00:27:51 2012 (r232325) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd February 26, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -413,9 +413,15 @@ subcommand. You cannot attach a dataset same dataset to another jails. To allow management of the dataset from within a jail, the .Sy jailed -property has to be set. The +property has to be set and the jail needs access to the +.Pa /dev/zfs +device. The .Sy quota -property cannot be changed from within a jail. +property cannot be changed from within a jail. See +.Xr jail 8 +for information on how to allow mounting +.Tn ZFS +datasets from within a jail. .Pp .No A Tn ZFS dataset can be detached from a jail using the @@ -2715,13 +2721,12 @@ to the jail identified by JID From now on this file system tree can be managed from within a jail if the .Sy jailed property has been set. To use this functionality, the jail needs the -.Va enforce_statfs -parameter set to -.Sy 0 -and the .Va allow.mount -parameter set to -.Sy 1 . +and +.Va allow.mount.zfs +parameters set to 1 and the +.Va enforce_statfs +parameter set to a value lower than 2. .Pp See .Xr jail 8 Modified: user/attilio/vmcontention/contrib/top/top.c ============================================================================== --- user/attilio/vmcontention/contrib/top/top.c Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/contrib/top/top.c Thu Mar 1 00:27:51 2012 (r232325) @@ -70,7 +70,6 @@ int pcpu_stats = No; /* signal handling routines */ sigret_t leave(); -sigret_t onalrm(); sigret_t tstop(); #ifdef SIGWINCH sigret_t winch(); @@ -723,12 +722,7 @@ restart: no_command = Yes; if (!interactive) { - /* set up alarm */ - (void) signal(SIGALRM, onalrm); - (void) alarm((unsigned)delay); - - /* wait for the rest of it .... */ - pause(); + sleep(delay); } else while (no_command) { @@ -1174,11 +1168,3 @@ int status; exit(status); /*NOTREACHED*/ } - -sigret_t onalrm() /* SIGALRM handler */ - -{ - /* this is only used in batch mode to break out of the pause() */ - /* return; */ -} - Modified: user/attilio/vmcontention/etc/devd/apple.conf ============================================================================== --- user/attilio/vmcontention/etc/devd/apple.conf Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/etc/devd/apple.conf Thu Mar 1 00:27:51 2012 (r232325) @@ -19,6 +19,26 @@ notify 0 { }; +# The next blocks enable brightness hotkeys that can be found on Apple laptops +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "brightness"; + match "notify" "down"; + action "sysctl dev.backlight.0.level=\ + $(expr `sysctl -n dev.backlight.0.level` - 10)"; +}; + +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "brightness"; + match "notify" "up"; + action "sysctl dev.backlight.0.level=\ + $(expr `sysctl -n dev.backlight.0.level` + 10)"; +}; + + # The next blocks enable volume hotkeys that can be found on Apple laptops notify 0 { match "system" "PMU"; Modified: user/attilio/vmcontention/gnu/usr.bin/cc/c++/Makefile ============================================================================== --- user/attilio/vmcontention/gnu/usr.bin/cc/c++/Makefile Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/gnu/usr.bin/cc/c++/Makefile Thu Mar 1 00:27:51 2012 (r232325) @@ -1,14 +1,18 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.fe" .PATH: ${GCCDIR}/cp -PROG= c++ +PROG= g++ SRCS+= g++spec.c -LINKS= ${BINDIR}/c++ ${BINDIR}/g++ -LINKS+= ${BINDIR}/c++ ${BINDIR}/CC +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/g++ ${BINDIR}/c++ +LINKS+= ${BINDIR}/g++ ${BINDIR}/CC +.endif NO_MAN= DPADD= ${LIBCPP} ${LIBIBERTY} Modified: user/attilio/vmcontention/gnu/usr.bin/cc/cc/Makefile ============================================================================== --- user/attilio/vmcontention/gnu/usr.bin/cc/cc/Makefile Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/gnu/usr.bin/cc/cc/Makefile Thu Mar 1 00:27:51 2012 (r232325) @@ -1,15 +1,20 @@ # $FreeBSD$ +.include + .include "../Makefile.inc" .include "../Makefile.fe" -PROG= cc +PROG= gcc MAN= gcc.1 SRCS+= gccspec.c NO_SHARED?=yes -LINKS= ${BINDIR}/cc ${BINDIR}/gcc -MLINKS= gcc.1 cc.1 gcc.1 c++.1 gcc.1 g++.1 gcc.1 CC.1 +MLINKS= gcc.1 g++.1 +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/gcc ${BINDIR}/cc +MLINKS+= gcc.1 cc.1 gcc.1 c++.1 gcc.1 CC.1 +.endif .include Modified: user/attilio/vmcontention/gnu/usr.bin/cc/cpp/Makefile ============================================================================== --- user/attilio/vmcontention/gnu/usr.bin/cc/cpp/Makefile Thu Mar 1 00:22:52 2012 (r232324) +++ user/attilio/vmcontention/gnu/usr.bin/cc/cpp/Makefile Thu Mar 1 00:27:51 2012 (r232325) @@ -1,10 +1,16 @@ # $FreeBSD$ +.include .include "../Makefile.inc" .include "../Makefile.fe" -PROG= cpp +PROG= gcpp SRCS+= cppspec.c +.if ${MK_CLANG_IS_CC} == "no" +LINKS= ${BINDIR}/gcpp ${BINDIR}/cpp +MLINKS= gcpp.1 cpp.1 +.endif + .include Copied: user/attilio/vmcontention/gnu/usr.bin/cc/cpp/gcpp.1 (from r232323, head/gnu/usr.bin/cc/cpp/gcpp.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/attilio/vmcontention/gnu/usr.bin/cc/cpp/gcpp.1 Thu Mar 1 00:27:51 2012 (r232325, copy of r232323, head/gnu/usr.bin/cc/cpp/gcpp.1) @@ -0,0 +1,929 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CPP 1" +.TH CPP 1 "2007-07-19" "gcc-4.2.1" "GNU" +.SH "NAME" +cpp \- The C Preprocessor +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] + [\fB\-I\fR\fIdir\fR...] [\fB\-iquote\fR\fIdir\fR...] + [\fB\-W\fR\fIwarn\fR...] + [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR] + [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] + [\fB\-MT\fR \fItarget\fR...] + [\fB\-P\fR] [\fB\-fno\-working\-directory\fR] + [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR] + \fIinfile\fR \fIoutfile\fR +.PP +Only the most useful options are listed here; see below for the remainder. +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR +that is used automatically by the C compiler to transform your program +before compilation. It is called a macro processor because it allows +you to define \fImacros\fR, which are brief abbreviations for longer +constructs. +.PP +The C preprocessor is intended to be used only with C and \*(C+ source +code. In the past, it has been abused as a general text processor. It +will choke on input which does not obey C's lexical rules. For +example, apostrophes will be interpreted as the beginning of character +constants, and cause errors. Also, you cannot rely on it preserving +characteristics of the input which are not significant to C\-family +languages. If a Makefile is preprocessed, all the hard tabs will be +removed, and the Makefile will not work. +.PP +Having said that, you can often get away with using cpp on things which +are not C. Other Algol-ish programming languages are often safe +(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR +mode preserves more white space, and is otherwise more permissive. Many +of the problems can be avoided by writing C or \*(C+ style comments +instead of native language comments, and keeping macros simple. +.PP +Wherever possible, you should use a preprocessor geared to the language +you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro +facilities. Most high level programming languages have their own +conditional compilation and inclusion mechanism. If all else fails, +try a true general text processor, such as \s-1GNU\s0 M4. +.PP +C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C +preprocessor, which provides a small superset of the features of \s-1ISO\s0 +Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a +few things required by the standard. These are features which are +rarely, if ever, used, and may cause surprising changes to the meaning +of a program which does not expect them. To get strict \s-1ISO\s0 Standard C, +you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending +on which version of the standard you want. To get all the mandatory +diagnostics, you must also use \fB\-pedantic\fR. +.PP +This manual describes the behavior of the \s-1ISO\s0 preprocessor. To +minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's +behavior does not conflict with traditional semantics, the +traditional preprocessor should behave the same way. The various +differences that do exist are detailed in the section \fBTraditional +Mode\fR. +.PP +For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this +manual refer to \s-1GNU\s0 \s-1CPP\s0. +.SH "OPTIONS" +.IX Header "OPTIONS" +The C preprocessor expects two file names as arguments, \fIinfile\fR and +\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any +other files it specifies with \fB#include\fR. All the output generated +by the combined input files is written in \fIoutfile\fR. +.PP +Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as +\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR +means to write to standard output. Also, if either file is omitted, it +means the same as if \fB\-\fR had been specified for that file. +.PP +Unless otherwise noted, or the option ends in \fB=\fR, all options +which take an argument may have that argument appear either immediately +after the option, or with a space between option and argument: +\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect. +.PP +Many options have multi-letter names; therefore multiple single-letter +options may \fInot\fR be grouped: \fB\-dM\fR is very different from +\&\fB\-d\ \-M\fR. +.IP "\fB\-D\fR \fIname\fR" 4 +.IX Item "-D name" +Predefine \fIname\fR as a macro, with definition \f(CW1\fR. +.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4 +.IX Item "-D name=definition" +The contents of \fIdefinition\fR are tokenized and processed as if +they appeared during translation phase three in a \fB#define\fR +directive. In particular, the definition will be truncated by +embedded newline characters. +.Sp +If you are invoking the preprocessor from a shell or shell-like +program you may need to use the shell's quoting syntax to protect +characters such as spaces that have a meaning in the shell syntax. +.Sp +If you wish to define a function-like macro on the command line, write +its argument list with surrounding parentheses before the equals sign +(if any). Parentheses are meaningful to most shells, so you will need +to quote the option. With \fBsh\fR and \fBcsh\fR, +\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works. +.Sp +\&\fB\-D\fR and \fB\-U\fR options are processed in the order they +are given on the command line. All \fB\-imacros\fR \fIfile\fR and +\&\fB\-include\fR \fIfile\fR options are processed after all +\&\fB\-D\fR and \fB\-U\fR options. +.IP "\fB\-U\fR \fIname\fR" 4 +.IX Item "-U name" +Cancel any previous definition of \fIname\fR, either built in or +provided with a \fB\-D\fR option. +.IP "\fB\-undef\fR" 4 +.IX Item "-undef" +Do not predefine any system-specific or GCC-specific macros. The +standard predefined macros remain defined. +.IP "\fB\-I\fR \fIdir\fR" 4 +.IX Item "-I dir" +Add the directory \fIdir\fR to the list of directories to be searched +for header files. +.Sp +Directories named by \fB\-I\fR are searched before the standard +system include directories. If the directory \fIdir\fR is a standard +system include directory, the option is ignored to ensure that the +default search order for system directories and the special treatment +of system headers are not defeated +\&. +.IP "\fB\-o\fR \fIfile\fR" 4 +.IX Item "-o file" +Write output to \fIfile\fR. This is the same as specifying \fIfile\fR +as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a +different interpretation of a second non-option argument, so you must +use \fB\-o\fR to specify the output file. +.IP "\fB\-Wall\fR" 4 +.IX Item "-Wall" +Turns on all optional warnings which are desirable for normal code. +At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, +\&\fB\-Wmultichar\fR and a warning about integer promotion causing a +change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the +preprocessor's warnings are on by default and have no options to +control them. +.IP "\fB\-Wcomment\fR" 4 +.IX Item "-Wcomment" +.PD 0 +.IP "\fB\-Wcomments\fR" 4 +.IX Item "-Wcomments" +.PD +Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR +comment, or whenever a backslash-newline appears in a \fB//\fR comment. +(Both forms have the same effect.) +.IP "\fB\-Wtrigraphs\fR" 4 +.IX Item "-Wtrigraphs" +Most trigraphs in comments cannot affect the meaning of the program. +However, a trigraph that would form an escaped newline (\fB??/\fR at +the end of a line) can, by changing where the comment begins or ends. +Therefore, only trigraphs that would form escaped newlines produce +warnings inside a comment. +.Sp +This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not +given, this option is still enabled unless trigraphs are enabled. To +get trigraph conversion without warnings, but get the other +\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR. +.IP "\fB\-Wtraditional\fR" 4 +.IX Item "-Wtraditional" +Warn about certain constructs that behave differently in traditional and +\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C +equivalent, and problematic constructs which should be avoided. +.IP "\fB\-Wimport\fR" 4 +.IX Item "-Wimport" +Warn the first time \fB#import\fR is used. +.IP "\fB\-Wundef\fR" 4 +.IX Item "-Wundef" +Warn whenever an identifier which is not a macro is encountered in an +\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are +replaced with zero. +.IP "\fB\-Wunused\-macros\fR" 4 +.IX Item "-Wunused-macros" +Warn about macros defined in the main file that are unused. A macro +is \fIused\fR if it is expanded or tested for existence at least once. +The preprocessor will also warn if the macro has not been used at the +time it is redefined or undefined. +.Sp +Built-in macros, macros defined on the command line, and macros +defined in include files are not warned about. +.Sp +\&\fINote:\fR If a macro is actually used, but only used in skipped +conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the +warning in such a case, you might improve the scope of the macro's +definition by, for example, moving it into the first skipped block. +Alternatively, you could provide a dummy use with something like: +.Sp +.Vb 2 +\& #if defined the_macro_causing_the_warning +\& #endif +.Ve +.IP "\fB\-Wendif\-labels\fR" 4 +.IX Item "-Wendif-labels" +Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text. +This usually happens in code of the form +.Sp +.Vb 5 +\& #if FOO +\& ... +\& #else FOO +\& ... +\& #endif FOO +.Ve +.Sp +The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not +in older programs. This warning is on by default. +.IP "\fB\-Werror\fR" 4 +.IX Item "-Werror" +Make all warnings into hard errors. Source code which triggers warnings +will be rejected. +.IP "\fB\-Wsystem\-headers\fR" 4 +.IX Item "-Wsystem-headers" +Issue warnings for code in system headers. These are normally unhelpful +in finding bugs in your own code, therefore suppressed. If you are +responsible for the system library, you may want to see them. +.IP "\fB\-w\fR" 4 +.IX Item "-w" +Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default. +.IP "\fB\-pedantic\fR" 4 +.IX Item "-pedantic" +Issue all the mandatory diagnostics listed in the C standard. Some of +them are left out by default, since they trigger frequently on harmless +code. +.IP "\fB\-pedantic\-errors\fR" 4 +.IX Item "-pedantic-errors" +Issue all the mandatory diagnostics, and make all mandatory diagnostics +into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues +without \fB\-pedantic\fR but treats as warnings. +.IP "\fB\-M\fR" 4 +.IX Item "-M" +Instead of outputting the result of preprocessing, output a rule +suitable for \fBmake\fR describing the dependencies of the main +source file. The preprocessor outputs one \fBmake\fR rule containing +the object file name for that source file, a colon, and the names of all +the included files, including those coming from \fB\-include\fR or +\&\fB\-imacros\fR command line options. +.Sp +Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the +object file name consists of the basename of the source file with any +suffix replaced with object file suffix. If there are many included +files then the rule is split into several lines using \fB\e\fR\-newline. +The rule has no commands. +.Sp +This option does not suppress the preprocessor's debug output, such as +\&\fB\-dM\fR. To avoid mixing such debug output with the dependency +rules you should explicitly specify the dependency output file with +\&\fB\-MF\fR, or use an environment variable like +\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output +will still be sent to the regular output stream as normal. +.Sp +Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses +warnings with an implicit \fB\-w\fR. +.IP "\fB\-MM\fR" 4 +.IX Item "-MM" +Like \fB\-M\fR but do not mention header files that are found in +system header directories, nor header files that are included, +directly or indirectly, from such a header. +.Sp +This implies that the choice of angle brackets or double quotes in an +\&\fB#include\fR directive does not in itself determine whether that +header will appear in \fB\-MM\fR dependency output. This is a +slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier. +.IP "\fB\-MF\fR \fIfile\fR" 4 +.IX Item "-MF file" +When used with \fB\-M\fR or \fB\-MM\fR, specifies a +file to write the dependencies to. If no \fB\-MF\fR switch is given +the preprocessor sends the rules to the same place it would have sent +preprocessed output. +.Sp +When used with the driver options \fB\-MD\fR or \fB\-MMD\fR, +\&\fB\-MF\fR overrides the default dependency output file. +.IP "\fB\-MG\fR" 4 +.IX Item "-MG" +In conjunction with an option such as \fB\-M\fR requesting +dependency generation, \fB\-MG\fR assumes missing header files are +generated files and adds them to the dependency list without raising +an error. The dependency filename is taken directly from the +\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR +also suppresses preprocessed output, as a missing header file renders +this useless. +.Sp +This feature is used in automatic updating of makefiles. +.IP "\fB\-MP\fR" 4 +.IX Item "-MP" +This option instructs \s-1CPP\s0 to add a phony target for each dependency +other than the main file, causing each to depend on nothing. These +dummy rules work around errors \fBmake\fR gives if you remove header +files without updating the \fIMakefile\fR to match. +.Sp +This is typical output: +.Sp +.Vb 1 +\& test.o: test.c test.h +.Ve +.Sp +.Vb 1 +\& test.h: +.Ve +.IP "\fB\-MT\fR \fItarget\fR" 4 +.IX Item "-MT target" +Change the target of the rule emitted by dependency generation. By +default \s-1CPP\s0 takes the name of the main input file, including any path, +deletes any file suffix such as \fB.c\fR, and appends the platform's +usual object suffix. The result is the target. +.Sp +An \fB\-MT\fR option will set the target to be exactly the string you +specify. If you want multiple targets, you can specify them as a single +argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options. +.Sp +For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give +.Sp +.Vb 1 +\& $(objpfx)foo.o: foo.c +.Ve +.IP "\fB\-MQ\fR \fItarget\fR" 4 +.IX Item "-MQ target" +Same as \fB\-MT\fR, but it quotes any characters which are special to +Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives +.Sp +.Vb 1 +\& $$(objpfx)foo.o: foo.c +.Ve +.Sp +The default target is automatically quoted, as if it were given with +\&\fB\-MQ\fR. +.IP "\fB\-MD\fR" 4 +.IX Item "-MD" +\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that +\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on +whether an \fB\-o\fR option is given. If it is, the driver uses its +argument but with a suffix of \fI.d\fR, otherwise it take the +basename of the input file and applies a \fI.d\fR suffix. +.Sp +If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any +\&\fB\-o\fR switch is understood to specify the dependency output file, but if used without \fB\-E\fR, each \fB\-o\fR +is understood to specify a target object file. +.Sp +Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate +a dependency output file as a side-effect of the compilation process. +.IP "\fB\-MMD\fR" 4 +.IX Item "-MMD" +Like \fB\-MD\fR except mention only user header files, not system +header files. +.IP "\fB\-x c\fR" 4 +.IX Item "-x c" +.PD 0 +.IP "\fB\-x c++\fR" 4 +.IX Item "-x c++" +.IP "\fB\-x assembler-with-cpp\fR" 4 +.IX Item "-x assembler-with-cpp" +.PD +Specify the source language: C, \*(C+, or assembly. This has nothing +to do with standards conformance or extensions; it merely selects which +base syntax to expect. If you give none of these options, cpp will +deduce the language from the extension of the source file: \&\fB.c\fR, +\fB.cc\fR, or \fB.S\fR. Some other common extensions for \*(C+ and +assembly are also recognized. If cpp does not recognize the extension, +it will treat the file as C; this is the most generic mode. +.Sp +\&\fINote:\fR Previous versions of cpp accepted a \fB\-lang\fR option +which selected both the language and the standards conformance level. +This option has been removed, because it conflicts with the \fB\-l\fR +option. +.IP "\fB\-std=\fR\fIstandard\fR" 4 +.IX Item "-std=standard" +.PD 0 +.IP "\fB\-ansi\fR" 4 +.IX Item "-ansi" +.PD +Specify the standard to which the code should conform. Currently \s-1CPP\s0 +knows about C and \*(C+ standards; others may be added in the future. +.Sp +\&\fIstandard\fR +may be one of: +.RS 4 +.ie n .IP """iso9899:1990""" 4 +.el .IP "\f(CWiso9899:1990\fR" 4 +.IX Item "iso9899:1990" +.PD 0 +.ie n .IP """c89""" 4 +.el .IP "\f(CWc89\fR" 4 +.IX Item "c89" +.PD +The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for +this version of the standard. +.Sp +The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR. +.ie n .IP """iso9899:199409""" 4 +.el .IP "\f(CWiso9899:199409\fR" 4 +.IX Item "iso9899:199409" +The 1990 C standard, as amended in 1994. +.ie n .IP """iso9899:1999""" 4 +.el .IP "\f(CWiso9899:1999\fR" 4 +.IX Item "iso9899:1999" +.PD 0 +.ie n .IP """c99""" 4 +.el .IP "\f(CWc99\fR" 4 +.IX Item "c99" +.ie n .IP """iso9899:199x""" 4 +.el .IP "\f(CWiso9899:199x\fR" 4 +.IX Item "iso9899:199x" +.ie n .IP """c9x""" 4 +.el .IP "\f(CWc9x\fR" 4 +.IX Item "c9x" +.PD +The revised \s-1ISO\s0 C standard, published in December 1999. Before +publication, this was known as C9X. +.ie n .IP """gnu89""" 4 +.el .IP "\f(CWgnu89\fR" 4 +.IX Item "gnu89" +The 1990 C standard plus \s-1GNU\s0 extensions. This is the default. +.ie n .IP """gnu99""" 4 +.el .IP "\f(CWgnu99\fR" 4 +.IX Item "gnu99" +.PD 0 +.ie n .IP """gnu9x""" 4 +.el .IP "\f(CWgnu9x\fR" 4 +.IX Item "gnu9x" +.PD +The 1999 C standard plus \s-1GNU\s0 extensions. +.ie n .IP """c++98""" 4 +.el .IP "\f(CWc++98\fR" 4 +.IX Item "c++98" +The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. +.ie n .IP """gnu++98""" 4 +.el .IP "\f(CWgnu++98\fR" 4 +.IX Item "gnu++98" +The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the +default for \*(C+ code. +.RE +.RS 4 +.RE +.IP "\fB\-I\-\fR" 4 +.IX Item "-I-" +Split the include path. Any directories specified with \fB\-I\fR +options before \fB\-I\-\fR are searched only for headers requested with +\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for +\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are +specified with \fB\-I\fR options after the \fB\-I\-\fR, those +directories are searched for all \fB#include\fR directives. +.Sp +In addition, \fB\-I\-\fR inhibits the use of the directory of the current +file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR. +.Sp +This option has been deprecated. +.IP "\fB\-nostdinc\fR" 4 +.IX Item "-nostdinc" +Do not search the standard system directories for header files. +Only the directories you have specified with \fB\-I\fR options +(and the directory of the current file, if appropriate) are searched. +.IP "\fB\-nostdinc++\fR" 4 +.IX Item "-nostdinc++" +Do not search for header files in the \*(C+\-specific standard directories, +but do still search the other standard directories. (This option is +used when building the \*(C+ library.) +.IP "\fB\-include\fR \fIfile\fR" 4 +.IX Item "-include file" +Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first +line of the primary source file. However, the first directory searched +for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR +the directory containing the main source file. If not found there, it +is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search +chain as normal. +.Sp +If multiple \fB\-include\fR options are given, the files are included +in the order they appear on the command line. +.IP "\fB\-imacros\fR \fIfile\fR" 4 +.IX Item "-imacros file" +Exactly like \fB\-include\fR, except that any output produced by +scanning \fIfile\fR is thrown away. Macros it defines remain defined. +This allows you to acquire all the macros from a header without also +processing its declarations. +.Sp +All files specified by \fB\-imacros\fR are processed before all files +specified by \fB\-include\fR. +.IP "\fB\-idirafter\fR \fIdir\fR" 4 +.IX Item "-idirafter dir" +Search \fIdir\fR for header files, but do it \fIafter\fR all +directories specified with \fB\-I\fR and the standard system directories +have been exhausted. \fIdir\fR is treated as a system include directory. +.IP "\fB\-iprefix\fR \fIprefix\fR" 4 +.IX Item "-iprefix prefix" +Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR +options. If the prefix represents a directory, you should include the +final \fB/\fR. +.IP "\fB\-iwithprefix\fR \fIdir\fR" 4 +.IX Item "-iwithprefix dir" +.PD 0 +.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4 +.IX Item "-iwithprefixbefore dir" +.PD +Append \fIdir\fR to the prefix specified previously with +\&\fB\-iprefix\fR, and add the resulting directory to the include search +path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR +would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would. +.IP "\fB\-isysroot\fR \fIdir\fR" 4 +.IX Item "-isysroot dir" +This option is like the \fB\-\-sysroot\fR option, but applies only to +header files. See the \fB\-\-sysroot\fR option for more information. +.IP "\fB\-imultilib\fR \fIdir\fR" 4 +.IX Item "-imultilib dir" +Use \fIdir\fR as a subdirectory of the directory containing +target-specific \*(C+ headers. +.IP "\fB\-isystem\fR \fIdir\fR" 4 +.IX Item "-isystem dir" +Search \fIdir\fR for header files, after all directories specified by +\&\fB\-I\fR but before the standard system directories. Mark it +as a system directory, so that it gets the same special treatment as +is applied to the standard system directories. +.IP "\fB\-iquote\fR \fIdir\fR" 4 +.IX Item "-iquote dir" +Search \fIdir\fR only for header files requested with +\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for +\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR, before all directories specified by +\&\fB\-I\fR and before the standard system directories. +.IP "\fB\-fdollars\-in\-identifiers\fR" 4 +.IX Item "-fdollars-in-identifiers" +Accept \fB$\fR in identifiers. +.IP "\fB\-fextended\-identifiers\fR" 4 +.IX Item "-fextended-identifiers" +Accept universal character names in identifiers. This option is +experimental; in a future version of \s-1GCC\s0, it will be enabled by +default for C99 and \*(C+. +.IP "\fB\-fpreprocessed\fR" 4 +.IX Item "-fpreprocessed" +Indicate to the preprocessor that the input file has already been +preprocessed. This suppresses things like macro expansion, trigraph +conversion, escaped newline splicing, and processing of most directives. +The preprocessor still recognizes and removes comments, so that you can +pass a file preprocessed with \fB\-C\fR to the compiler without +problems. In this mode the integrated preprocessor is little more than +a tokenizer for the front ends. +.Sp +\&\fB\-fpreprocessed\fR is implicit if the input file has one of the +extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the +extensions that \s-1GCC\s0 uses for preprocessed files created by +\&\fB\-save\-temps\fR. +.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4 +.IX Item "-ftabstop=width" +Set the distance between tab stops. This helps the preprocessor report +correct column numbers in warnings or errors, even if tabs appear on the +line. If the value is less than 1 or greater than 100, the option is +ignored. The default is 8. +.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fexec-charset=charset" +Set the execution character set, used for string and character +constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fwide-exec-charset=charset" +Set the wide execution character set, used for wide string and +character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever +corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with +\&\fB\-fexec\-charset\fR, \fIcharset\fR can be any encoding supported +by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have +problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR. +.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4 +.IX Item "-finput-charset=charset" +Set the input character set, used for translation from the character +set of the input file to the source character set used by \s-1GCC\s0. If the +locale does not specify, or \s-1GCC\s0 cannot get this information from the +locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale +or this command line option. Currently the command line option takes +precedence if there's a conflict. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fworking\-directory\fR" 4 +.IX Item "-fworking-directory" +Enable generation of linemarkers in the preprocessor output that will +let the compiler know the current working directory at the time of +preprocessing. When this option is enabled, the preprocessor will +emit, after the initial linemarker, a second linemarker with the +current working directory followed by two slashes. \s-1GCC\s0 will use this +directory, when it's present in the preprocessed input, as the +directory emitted as the current working directory in some debugging +information formats. This option is implicitly enabled if debugging +information is enabled, but this can be inhibited with the negated +form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 00:54:08 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C68CA106564A; Thu, 1 Mar 2012 00:54:08 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B61C28FC12; Thu, 1 Mar 2012 00:54:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q210s871052854; Thu, 1 Mar 2012 00:54:08 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q210s8KC052851; Thu, 1 Mar 2012 00:54:08 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201203010054.q210s8KC052851@svn.freebsd.org> From: Attilio Rao Date: Thu, 1 Mar 2012 00:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232326 - user/attilio/vmcontention/sys/vm X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 00:54:09 -0000 Author: attilio Date: Thu Mar 1 00:54:08 2012 New Revision: 232326 URL: http://svn.freebsd.org/changeset/base/232326 Log: - Exclude vm_radix_shrink() from the interface but retain the code still as it can be useful. - Make most of the interface private as it is unnecessary public right now. This will help in making nodes changing with arch and still avoid namespace pollution. Modified: user/attilio/vmcontention/sys/vm/vm_radix.c user/attilio/vmcontention/sys/vm/vm_radix.h Modified: user/attilio/vmcontention/sys/vm/vm_radix.c ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.c Thu Mar 1 00:27:51 2012 (r232325) +++ user/attilio/vmcontention/sys/vm/vm_radix.c Thu Mar 1 00:54:08 2012 (r232326) @@ -54,9 +54,32 @@ #include +#define VM_RADIX_WIDTH 5 +#define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH) +#define VM_RADIX_MASK (VM_RADIX_COUNT - 1) +#define VM_RADIX_MAXVAL ((vm_pindex_t)-1) +#define VM_RADIX_LIMIT howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH) + +/* Flag bits stored in node pointers. */ +#define VM_RADIX_FLAGS 0x3 + +/* Bits of height in root. */ +#define VM_RADIX_HEIGHT 0xf + +/* Calculates maximum value for a tree of height h. */ +#define VM_RADIX_MAX(h) \ + ((h) == VM_RADIX_LIMIT ? VM_RADIX_MAXVAL : \ + (((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1)) + +CTASSERT(VM_RADIX_HEIGHT >= VM_RADIX_LIMIT); CTASSERT(sizeof(struct vm_radix_node) < PAGE_SIZE); CTASSERT((sizeof(u_int) * NBBY) >= VM_RADIX_LIMIT); +struct vm_radix_node { + void *rn_child[VM_RADIX_COUNT]; /* Child nodes. */ + volatile uint32_t rn_count; /* Valid children. */ +}; + static uma_zone_t vm_radix_node_zone; #ifndef UMA_MD_SMALL_ALLOC @@ -789,6 +812,7 @@ vm_radix_reclaim_allnodes(struct vm_radi rtree->rt_root = 0; } +#ifdef notyet /* * Attempts to reduce the height of the tree. */ @@ -818,3 +842,4 @@ vm_radix_shrink(struct vm_radix *rtree) } vm_radix_setroot(rtree, root, level); } +#endif Modified: user/attilio/vmcontention/sys/vm/vm_radix.h ============================================================================== --- user/attilio/vmcontention/sys/vm/vm_radix.h Thu Mar 1 00:27:51 2012 (r232325) +++ user/attilio/vmcontention/sys/vm/vm_radix.h Thu Mar 1 00:54:08 2012 (r232326) @@ -29,27 +29,11 @@ #ifndef _VM_RADIX_H_ #define _VM_RADIX_H_ -#include - -/* Default values of the tree parameters */ -#define VM_RADIX_WIDTH 5 -#define VM_RADIX_COUNT (1 << VM_RADIX_WIDTH) -#define VM_RADIX_MASK (VM_RADIX_COUNT - 1) -#define VM_RADIX_MAXVAL ((vm_pindex_t)-1) -#define VM_RADIX_LIMIT howmany((sizeof(vm_pindex_t) * NBBY), VM_RADIX_WIDTH) -#define VM_RADIX_FLAGS 0x3 /* Flag bits stored in node pointers. */ #define VM_RADIX_BLACK 0x1 /* Black node. (leaf only) */ #define VM_RADIX_RED 0x2 /* Red node. (leaf only) */ #define VM_RADIX_ANY (VM_RADIX_RED | VM_RADIX_BLACK) -#define VM_RADIX_EMPTY 0x1 /* Empty hint. (internal only) */ -#define VM_RADIX_HEIGHT 0xf /* Bits of height in root */ #define VM_RADIX_STACK 8 /* Nodes to store on stack. */ -/* Calculates maximum value for a tree of height h. */ -#define VM_RADIX_MAX(h) \ - ((h) == VM_RADIX_LIMIT ? VM_RADIX_MAXVAL : \ - (((vm_pindex_t)1 << ((h) * VM_RADIX_WIDTH)) - 1)) - /* * Radix tree root. The height and pointer are set together to permit * coherent lookups while the root is modified. @@ -59,20 +43,16 @@ struct vm_radix { }; #ifdef _KERNEL -CTASSERT(VM_RADIX_HEIGHT >= VM_RADIX_LIMIT); - -struct vm_radix_node { - void *rn_child[VM_RADIX_COUNT]; /* Child nodes. */ - volatile uint32_t rn_count; /* Valid children. */ -}; +/* + * Initialize the radix tree subsystem. + */ void vm_radix_init(void); /* * Functions which only work with black nodes. (object lock) */ int vm_radix_insert(struct vm_radix *, vm_pindex_t, void *); -void vm_radix_shrink(struct vm_radix *); /* * Functions which work on specified colors. (object, vm_page_queue_free locks) From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 14:01:16 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE1C8106564A; Thu, 1 Mar 2012 14:01:16 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 910A38FC16; Thu, 1 Mar 2012 14:01:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21E1GRT081826; Thu, 1 Mar 2012 14:01:16 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21E1Gfo081825; Thu, 1 Mar 2012 14:01:16 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203011401.q21E1Gfo081825@svn.freebsd.org> From: Andre Oppermann Date: Thu, 1 Mar 2012 14:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232338 - in user/andre: . tcp_workqueue X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 14:01:17 -0000 Author: andre Date: Thu Mar 1 14:01:16 2012 New Revision: 232338 URL: http://svn.freebsd.org/changeset/base/232338 Log: Create personal branch for tcp and network related works that should sooner or later be committed to head. Added: user/andre/ user/andre/tcp_workqueue/ - copied from r232337, head/sys/ Directory Properties: user/andre/tcp_workqueue/sys/ (props changed) From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 15:08:58 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B03DF1065678; Thu, 1 Mar 2012 15:08:58 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C72A8FC19; Thu, 1 Mar 2012 15:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21F8wQ9084150; Thu, 1 Mar 2012 15:08:58 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21F8wUa084148; Thu, 1 Mar 2012 15:08:58 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203011508.q21F8wUa084148@svn.freebsd.org> From: Andre Oppermann Date: Thu, 1 Mar 2012 15:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232341 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 15:08:58 -0000 Author: andre Date: Thu Mar 1 15:08:58 2012 New Revision: 232341 URL: http://svn.freebsd.org/changeset/base/232341 Log: Adjust the default initial CWND upon connection establishment to the new and larger values specified by RFC5681 Section 3.1. The larger initial CWND per RFC3390, if enabled, is not affected. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 14:42:06 2012 (r232340) +++ user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 15:08:58 2012 (r232341) @@ -347,8 +347,15 @@ cc_conn_init(struct tcpcb *tp) if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); - else - tp->snd_cwnd = tp->t_maxseg; + else { + /* Per RFC5681 Section 3.1 */ + if (tp->t_maxseg > 2190) + tp->snd_cwnd = 2 * tp->t_maxseg; + if (tp->t_maxseg > 1095) + tp->snd_cwnd = 3 * tp->t_maxseg; + else + tp->snd_cwnd = 4 * tp->t_maxseg; + } if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 16:04:25 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCDCF106566C; Thu, 1 Mar 2012 16:04:25 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DAA08FC0C; Thu, 1 Mar 2012 16:04:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21G4PJY085931; Thu, 1 Mar 2012 16:04:25 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21G4PXj085927; Thu, 1 Mar 2012 16:04:25 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203011604.q21G4PXj085927@svn.freebsd.org> From: Andre Oppermann Date: Thu, 1 Mar 2012 16:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232344 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 16:04:25 -0000 Author: andre Date: Thu Mar 1 16:04:25 2012 New Revision: 232344 URL: http://svn.freebsd.org/changeset/base/232344 Log: When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to reduce the initial CWND to one segment. This reduction got lost some time ago due to a change initialization ordering. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 15:51:19 2012 (r232343) +++ user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 16:04:25 2012 (r232344) @@ -341,10 +341,16 @@ cc_conn_init(struct tcpcb *tp) /* * Set the initial slow-start flight size. * - * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. - * XXX: We currently check only in syncache_socket for that. - */ - if (V_tcp_do_rfc3390) + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. + * + * If a SYN or SYN/ACK was lost and retransmitted, we have to + * reduce the initial CWND to one segment as congestion is likely + * requiring us to be cautious. + */ + if (tp->snd_cwnd == 1) + tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); else { Modified: user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c Thu Mar 1 15:51:19 2012 (r232343) +++ user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c Thu Mar 1 16:04:25 2012 (r232344) @@ -840,11 +840,12 @@ syncache_socket(struct syncache *sc, str tcp_mss(tp, sc->sc_peer_mss); /* - * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. + * If the SYN,ACK was retransmitted, indicate that CWND to be + * limited to one segment in cc_conn_init(). * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits. */ if (sc->sc_rxmits > 1) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = 1; /* * Copy and activate timers. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Thu Mar 1 15:51:19 2012 (r232343) +++ user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Thu Mar 1 16:04:25 2012 (r232344) @@ -510,7 +510,13 @@ tcp_timer_rexmt(void * xtp) } INP_INFO_RUNLOCK(&V_tcbinfo); headlocked = 0; - if (tp->t_rxtshift == 1) { + if (tp->t_state == TCPS_SYN_SENT) { + /* + * If the SYN was retransmitted, indicate CWND to be + * limited to 1 segment in cc_conn_init(). + */ + tp->snd_cwnd = 1; + } else if (tp->t_rxtshift == 1) { /* * first retransmit; record ssthresh and cwnd so they can * be recovered if this turns out to be a "bad" retransmit. From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 16:18:40 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD204106566C; Thu, 1 Mar 2012 16:18:39 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE72E8FC13; Thu, 1 Mar 2012 16:18:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21GId90086430; Thu, 1 Mar 2012 16:18:39 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21GIdww086427; Thu, 1 Mar 2012 16:18:39 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203011618.q21GIdww086427@svn.freebsd.org> From: Andre Oppermann Date: Thu, 1 Mar 2012 16:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 16:18:40 -0000 Author: andre Date: Thu Mar 1 16:18:39 2012 New Revision: 232345 URL: http://svn.freebsd.org/changeset/base/232345 Log: Increase the initial CWND to 10 segments as defined in IETF TCPM draft-ietf-tcpm-initcwnd-03 discussing why the higher initial window improves the overall performance of many web services without risking congestion collapse. As long as it remains a draft it is not enabled by default and placed under a sysctl marking it clearly as experimental: net.inet.tcp.exprimental.initcwnd10 Linux as of kernel 3.0 has enabled it by default. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c user/andre/tcp_workqueue/sys/netinet/tcp_var.h Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 16:04:25 2012 (r232344) +++ user/andre/tcp_workqueue/sys/netinet/tcp_input.c Thu Mar 1 16:18:39 2012 (r232345) @@ -155,6 +155,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, + "Experimental TCP extensions"); + +VNET_DEFINE(int, tcp_do_initcwnd10) = 0; +SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, + &VNET_NAME(tcp_do_initcwnd10), 0, + "Enable draft-ietf-tcpm-initcwnd-03 (Increasing initial CWND to 10)"); + VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, @@ -343,6 +351,7 @@ cc_conn_init(struct tcpcb *tp) * * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. + * draft-ietf-tcpm-initcwnd-03 increases it to ten segments. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely @@ -350,6 +359,9 @@ cc_conn_init(struct tcpcb *tp) */ if (tp->snd_cwnd == 1) tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_initcwnd10) + tp->snd_cwnd = min(10 * tp->t_maxseg, + max(2 * tp->t_maxseg, 14600)); else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); Modified: user/andre/tcp_workqueue/sys/netinet/tcp_var.h ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_var.h Thu Mar 1 16:04:25 2012 (r232344) +++ user/andre/tcp_workqueue/sys/netinet/tcp_var.h Thu Mar 1 16:18:39 2012 (r232345) @@ -611,6 +611,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX * VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_initcwnd10); VNET_DECLARE(int, tcp_sendspace); VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); @@ -623,6 +624,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) #define V_tcp_sendspace VNET(tcp_sendspace) #define V_tcp_recvspace VNET(tcp_recvspace) #define V_path_mtu_discovery VNET(path_mtu_discovery) From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 16:40:13 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519361065670; Thu, 1 Mar 2012 16:40:13 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 22CC98FC0C; Thu, 1 Mar 2012 16:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q21GeCO3087191; Thu, 1 Mar 2012 16:40:12 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q21GeCgb087189; Thu, 1 Mar 2012 16:40:12 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203011640.q21GeCgb087189@svn.freebsd.org> From: Andre Oppermann Date: Thu, 1 Mar 2012 16:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232346 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 16:40:13 -0000 Author: andre Date: Thu Mar 1 16:40:12 2012 New Revision: 232346 URL: http://svn.freebsd.org/changeset/base/232346 Log: Work around a bug in path MTU discovery where it never managages to update to the new and lower MTU when the tcp hostcache is full. When an ICMP fragmentation needed message comes in, it is dispatched through tcp_ctlinput() which determines the tcp connection it belongs to and then updates the tcp hostcache with the new MTU. After that tcp_mtudisc() is called, recalculates the MSS from tcp hostcache for this connection and resends some data. If the tcp hostcache is full, the update with the new MTU fails and the MSS recalculation doesn't take the MTU reduction into consideration which leads to a too large segment to be sent causing an ICMP message again... The workaround abuses the errno field in tcp_mtudisc() to communicate the new MTU directly and to have it included in the MSS recalculation in any case and independent of the tcp hostcache. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_subr.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Thu Mar 1 16:18:39 2012 (r232345) +++ user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Thu Mar 1 16:40:12 2012 (r232346) @@ -1410,9 +1410,14 @@ tcp_ctlinput(int cmd, struct sockaddr *s */ if (mtu <= tcp_maxmtu(&inc, NULL)) tcp_hc_updatemtu(&inc, mtu); - } - - inp = (*notify)(inp, inetctlerrmap[cmd]); + /* + * Communicated the new MTU + * directly to tcp_mtudisc(). + */ + inp = (*notify)(inp, mtu); + } else + inp = (*notify)(inp, + inetctlerrmap[cmd]); } } if (inp != NULL) @@ -1656,12 +1661,15 @@ tcp_drop_syn_sent(struct inpcb *inp, int * based on the new value in the route. Also nudge TCP to send something, * since we know the packet we just sent was dropped. * This duplicates some code in the tcp_mss() function in tcp_input.c. + * + * XXX: errno is abused to directly communicate the new MTU. */ struct inpcb * tcp_mtudisc(struct inpcb *inp, int errno) { struct tcpcb *tp; struct socket *so; + int mtu; INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || @@ -1671,7 +1679,12 @@ tcp_mtudisc(struct inpcb *inp, int errno tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); - tcp_mss_update(tp, -1, NULL, NULL); + /* Extract the MTU from errno for IPv4. */ + if (errno > PRC_NCMDS) + mtu = errno; + else + mtu = -1: + tcp_mss_update(tp, mtu, NULL, NULL); so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd); From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 16:59:26 2012 Return-Path: Delivered-To: svn-src-user@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6058B106566C; Thu, 1 Mar 2012 16:59:26 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id C56958FC0C; Thu, 1 Mar 2012 16:59:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q21GxKgj050888; Thu, 1 Mar 2012 20:59:20 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Thu, 1 Mar 2012 20:59:20 +0400 (MSK) From: Maxim Konovalov To: Andre Oppermann In-Reply-To: <201203011618.q21GIdww086427@svn.freebsd.org> Message-ID: References: <201203011618.q21GIdww086427@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: src-committers@FreeBSD.ORG, svn-src-user@FreeBSD.ORG Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 16:59:26 -0000 Hi Andre, On Thu, 1 Mar 2012, 16:18-0000, Andre Oppermann wrote: > Author: andre > Date: Thu Mar 1 16:18:39 2012 > New Revision: 232345 > URL: http://svn.freebsd.org/changeset/base/232345 > > Log: > Increase the initial CWND to 10 segments as defined in IETF TCPM > draft-ietf-tcpm-initcwnd-03 discussing why the higher initial window > improves the overall performance of many web services without risking > congestion collapse. > > As long as it remains a draft it is not enabled by default and placed > under a sysctl marking it clearly as experimental: > net.inet.tcp.exprimental.initcwnd10 > > Linux as of kernel 3.0 has enabled it by default. > Wouldn't it be better to just let user to specify icwnd size? -- Maxim Konovalov From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 17:02:40 2012 Return-Path: Delivered-To: svn-src-user@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C4FD106566C; Thu, 1 Mar 2012 17:02:40 +0000 (UTC) (envelope-from tuexen@fh-muenster.de) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id CAE348FC0C; Thu, 1 Mar 2012 17:02:39 +0000 (UTC) Received: from [192.168.1.2] (p5481B202.dip.t-dialin.net [84.129.178.2]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id 34C821C0B4611; Thu, 1 Mar 2012 18:02:37 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: Date: Thu, 1 Mar 2012 18:02:36 +0100 Content-Transfer-Encoding: 7bit Message-Id: References: <201203011618.q21GIdww086427@svn.freebsd.org> To: Maxim Konovalov X-Mailer: Apple Mail (2.1257) Cc: src-committers@FreeBSD.ORG, Andre Oppermann , svn-src-user@FreeBSD.ORG Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 17:02:40 -0000 On Mar 1, 2012, at 5:59 PM, Maxim Konovalov wrote: > Hi Andre, > > On Thu, 1 Mar 2012, 16:18-0000, Andre Oppermann wrote: > >> Author: andre >> Date: Thu Mar 1 16:18:39 2012 >> New Revision: 232345 >> URL: http://svn.freebsd.org/changeset/base/232345 >> >> Log: >> Increase the initial CWND to 10 segments as defined in IETF TCPM >> draft-ietf-tcpm-initcwnd-03 discussing why the higher initial window >> improves the overall performance of many web services without risking >> congestion collapse. >> >> As long as it remains a draft it is not enabled by default and placed >> under a sysctl marking it clearly as experimental: >> net.inet.tcp.exprimental.initcwnd10 >> >> Linux as of kernel 3.0 has enabled it by default. >> > Wouldn't it be better to just let user to specify icwnd size? In SCTP we have a sysctl which gives the IW in MSS... Best regards Michael > > -- > Maxim Konovalov > From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 17:05:17 2012 Return-Path: Delivered-To: svn-src-user@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39914106566B; Thu, 1 Mar 2012 17:05:17 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id A1E1C8FC0A; Thu, 1 Mar 2012 17:05:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q21H56pT051017; Thu, 1 Mar 2012 21:05:06 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Thu, 1 Mar 2012 21:05:06 +0400 (MSK) From: Maxim Konovalov To: Michael Tuexen In-Reply-To: Message-ID: References: <201203011618.q21GIdww086427@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: src-committers@FreeBSD.ORG, Andre Oppermann , svn-src-user@FreeBSD.ORG Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 17:05:17 -0000 > >> Author: andre > >> Date: Thu Mar 1 16:18:39 2012 > >> New Revision: 232345 > >> URL: http://svn.freebsd.org/changeset/base/232345 > >> > >> Log: > >> Increase the initial CWND to 10 segments as defined in IETF TCPM > >> draft-ietf-tcpm-initcwnd-03 discussing why the higher initial window > >> improves the overall performance of many web services without risking > >> congestion collapse. > >> > >> As long as it remains a draft it is not enabled by default and placed > >> under a sysctl marking it clearly as experimental: > >> net.inet.tcp.exprimental.initcwnd10 > >> > >> Linux as of kernel 3.0 has enabled it by default. > >> > > Wouldn't it be better to just let user to specify icwnd size? > In SCTP we have a sysctl which gives the IW in MSS... > Yes, that's why I'm asking mainly. -- Maxim Konovalov From owner-svn-src-user@FreeBSD.ORG Thu Mar 1 18:20:16 2012 Return-Path: Delivered-To: svn-src-user@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA93D106564A for ; Thu, 1 Mar 2012 18:20:16 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 46DA28FC15 for ; Thu, 1 Mar 2012 18:20:15 +0000 (UTC) Received: (qmail 33654 invoked from network); 1 Mar 2012 16:08:21 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Mar 2012 16:08:21 -0000 Message-ID: <4F4FB792.5080908@freebsd.org> Date: Thu, 01 Mar 2012 18:53:22 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Maxim Konovalov References: <201203011618.q21GIdww086427@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Michael Tuexen , src-committers@FreeBSD.ORG, svn-src-user@FreeBSD.ORG Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Mar 2012 18:20:16 -0000 On 01.03.2012 18:05, Maxim Konovalov wrote: >>>> Author: andre >>>> Date: Thu Mar 1 16:18:39 2012 >>>> New Revision: 232345 >>>> URL: http://svn.freebsd.org/changeset/base/232345 >>>> >>>> Log: >>>> Increase the initial CWND to 10 segments as defined in IETF TCPM >>>> draft-ietf-tcpm-initcwnd-03 discussing why the higher initial window >>>> improves the overall performance of many web services without risking >>>> congestion collapse. >>>> >>>> As long as it remains a draft it is not enabled by default and placed >>>> under a sysctl marking it clearly as experimental: >>>> net.inet.tcp.exprimental.initcwnd10 >>>> >>>> Linux as of kernel 3.0 has enabled it by default. >>>> >>> Wouldn't it be better to just let user to specify icwnd size? >> In SCTP we have a sysctl which gives the IW in MSS... >> > Yes, that's why I'm asking mainly. I'm a bit wary of abuse by non-clueful enough people who think bigger must be better. There was a recent discussion to this effect on TCPM. Also there were reports of congestion collapse in some networks, due to some other issues. I've even seen botched windows servers that respond with an icwnd of 64K. Hence I'd rather not have it open to anyone to fumble with this important parameter. The (negative) effects are not directly visible to a normal admin. -- Andre From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 10:08:24 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C861106564A; Fri, 2 Mar 2012 10:08:24 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 98ED18FC08; Fri, 2 Mar 2012 10:08:23 +0000 (UTC) Received: by yenl9 with SMTP id l9so533616yen.13 for ; Fri, 02 Mar 2012 02:08:23 -0800 (PST) Received-SPF: pass (google.com: domain of ivoras@gmail.com designates 10.236.155.101 as permitted sender) client-ip=10.236.155.101; Authentication-Results: mr.google.com; spf=pass (google.com: domain of ivoras@gmail.com designates 10.236.155.101 as permitted sender) smtp.mail=ivoras@gmail.com; dkim=pass header.i=ivoras@gmail.com Received: from mr.google.com ([10.236.155.101]) by 10.236.155.101 with SMTP id i65mr12702327yhk.52.1330682903217 (num_hops = 1); Fri, 02 Mar 2012 02:08:23 -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:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=ToLnHBqrWy4RiFxHZhCNC2WeaMoMXrQSVfH0O8EcMt4=; b=QBPWCBo72AZoZyyUHVkI9a4ow7jNO7+13qJAKVAyZcysyVW1BtDOIzINOP8/11sv0S YHMmpYT/hRHTJodjubbtNEOYbGXvAhM18NgFsFquCMcLYiudsGlUwecQv5N5EI06Ro41 bKBIo6bI4AsQ+Quf74Hx3YKr7ECVGvMOepAXC+H2Gkjlu5kcE8IL7XBl30a8YS8XFDIF Gi7C8eemCfQxg2o+teootPDy6uySkeDby0VNstmer2wqqZHOLDwJP83KVUxaLqcS6MlH kA+vjsTybwjbKJcn+pLHykHkpYlAhK6AHs+aIcrQX4NKzk8WtpL8jkWfl9/OQJ89oUcJ 4hTg== Received: by 10.236.155.101 with SMTP id i65mr9954232yhk.52.1330681591142; Fri, 02 Mar 2012 01:46:31 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.101.130.23 with HTTP; Fri, 2 Mar 2012 01:45:51 -0800 (PST) In-Reply-To: <4F4FB792.5080908@freebsd.org> References: <201203011618.q21GIdww086427@svn.freebsd.org> <4F4FB792.5080908@freebsd.org> From: Ivan Voras Date: Fri, 2 Mar 2012 10:45:51 +0100 X-Google-Sender-Auth: BY17bVIoMhh2v0-E0DMh09HKMe4 Message-ID: To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 10:08:24 -0000 On 1 March 2012 18:53, Andre Oppermann wrote: > I'm a bit wary of abuse by non-clueful enough people who think bigger > must be better. =C2=A0There was a recent discussion to this effect on TCP= M. > Also there were reports of congestion collapse in some networks, due > to some other issues. =C2=A0I've even seen botched windows servers that > respond with an icwnd of 64K. > > Hence I'd rather not have it open to anyone to fumble with this important > parameter. =C2=A0The (negative) effects are not directly visible to a nor= mal > admin. AFAIK the whole idea about increasing the initial window was started in Google; there are some blog posts from their engineers and at least one paper (http://code.google.com/speed/articles/tcp_initcwnd_paper.pdf). The reason why they have been able to experiment with it is that it's so easy to change in Linux: " the initial congestion window is con=EF=AC=81gured using the intitcwnd option in the ip route command. " So, by not having this as tunable, that opportunity was missed by someone who uses FreeBSD (Yahoo?). Less power to tinker results in less power to do some innovation. Even more, the quote I've pasted from the paper suggests it's a per-route setting in Linux. From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 14:42:34 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A0A51065673; Fri, 2 Mar 2012 14:42:34 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35EE88FC13; Fri, 2 Mar 2012 14:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22EgYXi034670; Fri, 2 Mar 2012 14:42:34 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22EgYb5034668; Fri, 2 Mar 2012 14:42:34 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203021442.q22EgYb5034668@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Mar 2012 14:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232394 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 14:42:34 -0000 Author: andre Date: Fri Mar 2 14:42:33 2012 New Revision: 232394 URL: http://svn.freebsd.org/changeset/base/232394 Log: Fix typo. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_subr.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Fri Mar 2 14:05:50 2012 (r232393) +++ user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Fri Mar 2 14:42:33 2012 (r232394) @@ -1683,7 +1683,7 @@ tcp_mtudisc(struct inpcb *inp, int errno if (errno > PRC_NCMDS) mtu = errno; else - mtu = -1: + mtu = -1; tcp_mss_update(tp, mtu, NULL, NULL); so = inp->inp_socket; From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 15:37:56 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85D54106564A for ; Fri, 2 Mar 2012 15:37:56 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id D6E888FC0A for ; Fri, 2 Mar 2012 15:37:55 +0000 (UTC) Received: (qmail 43151 invoked from network); 2 Mar 2012 13:52:32 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 2 Mar 2012 13:52:32 -0000 Message-ID: <4F50E946.3090909@freebsd.org> Date: Fri, 02 Mar 2012 16:37:42 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Ivan Voras References: <201203011618.q21GIdww086427@svn.freebsd.org> <4F4FB792.5080908@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r232345 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 15:37:56 -0000 On 02.03.2012 10:45, Ivan Voras wrote: > On 1 March 2012 18:53, Andre Oppermann wrote: > >> I'm a bit wary of abuse by non-clueful enough people who think bigger >> must be better. There was a recent discussion to this effect on TCPM. >> Also there were reports of congestion collapse in some networks, due >> to some other issues. I've even seen botched windows servers that >> respond with an icwnd of 64K. >> >> Hence I'd rather not have it open to anyone to fumble with this important >> parameter. The (negative) effects are not directly visible to a normal >> admin. > > AFAIK the whole idea about increasing the initial window was started > in Google; there are some blog posts from their engineers and at least > one paper (http://code.google.com/speed/articles/tcp_initcwnd_paper.pdf). > The reason why they have been able to experiment with it is that it's > so easy to change in Linux: The ease of changing it in Linux actually doesn't have anything to do with it. Their bonus (the network stack team) depends on making go things faster. They even said so on the TCPM list. Whether it was easy in Linux didn't really matter as Linux is their OS of choice and hacking the whole kernel would have been acceptable as well. To their credit they didn't just increase some tuneables but also did the hard empirical work behind it to show that it improves what they care about (easy) while at the time that it doesn't seem to hurt the other TCP connections not doing it too much and that the packet loss ratio is just slightly increased but still within the statistical noise. There was a great comment on HN recently: "TL;DR version - another new guy discovers TCP slow start, and not doing it, wow major speedup! Now, imagine the whole Internet doing that, whoops. I once peevishly pointed out that if you weren't required to stop at stop signs your commute would go faster, but if nobody was required to stop at stop signs it would be slower because every other intersection would have an accident blocking the way. This is also very much true of TCP congestion control algorithms. And while a few people not using them can get away with it, everyone not using them and you will find your network latency goes from a median with a low standard deviation, to a slightly lower median with a HUGE standard deviation. ..." http://news.ycombinator.com/item?id=3651106 If you look at RFC793 there is no mentioning of slow start or such. It took a bit of time until John Nagle wrote RFC896 describing the effects of unhindered data sending leading to the introduction of slow start and AIMD. I'm wary on having every other Jon Doe doing his own "research" on the most optimal icwnd from his point of view. -- Andre > " the initial congestion window is configured using the intitcwnd > option in the ip route command. " > > So, by not having this as tunable, that opportunity was missed by > someone who uses FreeBSD (Yahoo?). Less power to tinker results in > less power to do some innovation. > > Even more, the quote I've pasted from the paper suggests it's a > per-route setting in Linux. From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 15:48:53 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2DD1A106564A; Fri, 2 Mar 2012 15:48:53 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190DC8FC0C; Fri, 2 Mar 2012 15:48:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22FmqY5036784; Fri, 2 Mar 2012 15:48:52 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22Fmqvv036782; Fri, 2 Mar 2012 15:48:52 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203021548.q22Fmqvv036782@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Mar 2012 15:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232395 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 15:48:53 -0000 Author: andre Date: Fri Mar 2 15:48:52 2012 New Revision: 232395 URL: http://svn.freebsd.org/changeset/base/232395 Log: Defer sending an independent window update if a delayed ACK is pending saving a packet. The window update then gets piggy-backed on the next already scheduled ACK. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_output.c Fri Mar 2 14:42:33 2012 (r232394) +++ user/andre/tcp_workqueue/sys/netinet/tcp_output.c Fri Mar 2 15:48:52 2012 (r232395) @@ -542,10 +542,14 @@ after_sack_rexmit: * max size segments, or at least 50% of the maximum possible * window, then want to send a window update to peer. * Skip this if the connection is in T/TCP half-open state. - * Don't send pure window updates when the peer has closed - * the connection and won't ever send more data. + * + * Don't send an independent window update if a delayed + * ACK is pending (it will get piggy-backed on it) or the + * remote side already has done a half-close and won't send + * more data. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && + !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* * "adv" is the amount we can increase the window, From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 16:35:18 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ADE3F106566B; Fri, 2 Mar 2012 16:35:18 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98F778FC15; Fri, 2 Mar 2012 16:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q22GZI3C038377; Fri, 2 Mar 2012 16:35:18 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q22GZIEu038375; Fri, 2 Mar 2012 16:35:18 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203021635.q22GZIEu038375@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Mar 2012 16:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232396 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 16:35:18 -0000 Author: andre Date: Fri Mar 2 16:35:18 2012 New Revision: 232396 URL: http://svn.freebsd.org/changeset/base/232396 Log: Prevent a flurry of forced window updates when an application is doing small reads on a (partially) filled receive socket buffer. Normally one would a send a window update every time the available space in the socket buffer increases by two times MSS. This leads to a flurry of window updates that do not provide any meaningful new information to the sender. There still is available space in the window and the sender can continue sending data. All window updates then get carried by the regular ACKs. Only when the socket buffer was (almost) full and the window closed accordingly a window updates delivery new information and allows the sender to start sending more data again. Send window updates only every two MSS when the socket buffer has less than 1/8 space available, or the available space in the socket buffer increased by 1/4 its full capacity, or the socket buffer is very small. The next regular data ACK will carry and report the exact window size again. Reported by: sbruno Tested by: Darren Baginsky PR: kern/116335 Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_output.c Fri Mar 2 15:48:52 2012 (r232395) +++ user/andre/tcp_workqueue/sys/netinet/tcp_output.c Fri Mar 2 16:35:18 2012 (r232396) @@ -536,23 +536,39 @@ after_sack_rexmit: } /* - * Compare available window to amount of window - * known to peer (as advertised window less - * next expected input). If the difference is at least two - * max size segments, or at least 50% of the maximum possible - * window, then want to send a window update to peer. - * Skip this if the connection is in T/TCP half-open state. + * Sending of standalone window updates. + * + * Window updates important when we close our window due to a full + * socket buffer and are opening it again after the application + * reads data from it. Once the window has opened again and the + * remote end starts to send again the ACK clock takes over and + * provides the most current window information. + * + * We must avoid to the silly window syndrome whereas every read + * from the receive buffer, no matter how small, causes a window + * update to be sent. We also should avoid sending a flurry of + * window updates when the socket buffer had queued a lot of data + * and the application is doing small reads. + * + * Prevent a flurry of pointless window updates by only sending + * an update when we can increase the advertized window by more + * than 1/4th of the socket buffer capacity. When the buffer is + * getting full or is very small be more aggressive and send an + * update whenever we can increase by two mss sized segments. + * In all other situations the ACK's to new incoming data will + * carry further window increases. * * Don't send an independent window update if a delayed * ACK is pending (it will get piggy-backed on it) or the * remote side already has done a half-close and won't send - * more data. + * more data. Skip this if the connection is in T/TCP + * half-open state. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* - * "adv" is the amount we can increase the window, + * "adv" is the amount we could increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ @@ -572,9 +588,11 @@ after_sack_rexmit: */ if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; - if (adv >= (long) (2 * tp->t_maxseg)) - goto send; - if (2 * adv >= (long) so->so_rcv.sb_hiwat) + + if (adv >= (long)(2 * tp->t_maxseg) && + (adv >= (long)(so->so_rcv.sb_hiwat / 4) || + recwin <= (long)(so->so_rcv.sb_hiwat / 8) || + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) goto send; } dontupdate: From owner-svn-src-user@FreeBSD.ORG Fri Mar 2 16:45:29 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0999E106564A for ; Fri, 2 Mar 2012 16:45:29 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 68E608FC17 for ; Fri, 2 Mar 2012 16:45:27 +0000 (UTC) Received: (qmail 44023 invoked from network); 2 Mar 2012 15:00:04 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 2 Mar 2012 15:00:04 -0000 Message-ID: <4F50F91B.3020309@freebsd.org> Date: Fri, 02 Mar 2012 17:45:15 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Andre Oppermann References: <201203021635.q22GZIEu038375@svn.freebsd.org> In-Reply-To: <201203021635.q22GZIEu038375@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r232396 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Mar 2012 16:45:29 -0000 On 02.03.2012 17:35, Andre Oppermann wrote: > Author: andre > Date: Fri Mar 2 16:35:18 2012 > New Revision: 232396 > URL: http://svn.freebsd.org/changeset/base/232396 > > Log: > Prevent a flurry of forced window updates when an application is > doing small reads on a (partially) filled receive socket buffer. > > Normally one would a send a window update every time the available > space in the socket buffer increases by two times MSS. This leads > to a flurry of window updates that do not provide any meaningful > new information to the sender. There still is available space in > the window and the sender can continue sending data. All window > updates then get carried by the regular ACKs. Only when the socket > buffer was (almost) full and the window closed accordingly a window > updates delivery new information and allows the sender to start > sending more data again. > > Send window updates only every two MSS when the socket buffer > has less than 1/8 space available, or the available space in the > socket buffer increased by 1/4 its full capacity, or the socket > buffer is very small. The next regular data ACK will carry and > report the exact window size again. > > Reported by: sbruno > Tested by: Darren Baginsky Oops, the correct last name is "Baginski" and previous version before some more recent changes to tcp_output() about Aug 2011. > PR: kern/116335 > > Modified: > user/andre/tcp_workqueue/sys/netinet/tcp_output.c -- Andre From owner-svn-src-user@FreeBSD.ORG Sat Mar 3 11:11:56 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7E341065678; Sat, 3 Mar 2012 11:11:56 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2FA8FC14; Sat, 3 Mar 2012 11:11:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23BBuiL079211; Sat, 3 Mar 2012 11:11:56 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23BBuFI079209; Sat, 3 Mar 2012 11:11:56 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203031111.q23BBuFI079209@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Mar 2012 11:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232453 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 11:11:56 -0000 Author: andre Date: Sat Mar 3 11:11:56 2012 New Revision: 232453 URL: http://svn.freebsd.org/changeset/base/232453 Log: Simplify reporting of global maximum number of TCP segments in reassembly queue. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_reass.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_reass.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_reass.c Sat Mar 3 10:22:49 2012 (r232452) +++ user/andre/tcp_workqueue/sys/netinet/tcp_reass.c Sat Mar 3 11:11:56 2012 (r232453) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS); static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, @@ -82,9 +81,8 @@ static SYSCTL_NODE(_net_inet_tcp, OID_AU static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, - CTLTYPE_INT | CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, + &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_qsize) = 0; @@ -109,8 +107,10 @@ static void tcp_reass_zone_change(void *tag) { + /* Set the zone limit and read back the effective value. */ V_tcp_reass_maxseg = nmbclusters / 16; uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); } void @@ -122,7 +122,9 @@ tcp_reass_init(void) &V_tcp_reass_maxseg); V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + /* Set the zone limit and read back the effective value. */ uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -156,13 +158,6 @@ tcp_reass_flush(struct tcpcb *tp) } static int -tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS) -{ - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) { V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone); From owner-svn-src-user@FreeBSD.ORG Sat Mar 3 13:02:29 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3F1B0106567D; Sat, 3 Mar 2012 13:02:29 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA408FC1F; Sat, 3 Mar 2012 13:02:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23D2TF3082917; Sat, 3 Mar 2012 13:02:29 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23D2SIl082911; Sat, 3 Mar 2012 13:02:28 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203031302.q23D2SIl082911@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Mar 2012 13:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232459 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 13:02:29 -0000 Author: andre Date: Sat Mar 3 13:02:28 2012 New Revision: 232459 URL: http://svn.freebsd.org/changeset/base/232459 Log: Remove the need for routes to have the MTU explicitly set or inherited from their interface. Unless explicitly set the route MTU is zero and the current interface MTU is being used. This allows interface MTU to be increased even after it got an IP address assigned. If a route has an MTU set that is lower than the interface MTU it will be used instead. If a route has an MTU set that is higher than the interface MTU it will be adjusted and the interface MTU will be used as before. Modified: user/andre/tcp_workqueue/sys/netinet/in_rmx.c user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c user/andre/tcp_workqueue/sys/netinet/ip_input.c user/andre/tcp_workqueue/sys/netinet/ip_output.c user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Modified: user/andre/tcp_workqueue/sys/netinet/in_rmx.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/in_rmx.c Sat Mar 3 12:41:19 2012 (r232458) +++ user/andre/tcp_workqueue/sys/netinet/in_rmx.c Sat Mar 3 13:02:28 2012 (r232459) @@ -104,7 +104,8 @@ in_addroute(void *v_arg, void *n_arg, st if (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))) rt->rt_flags |= RTF_MULTICAST; - if (!rt->rt_rmx.rmx_mtu && rt->rt_ifp) + if (rt->rt_rmx.rmx_mtu > 0 && rt->rt_ifp != NULL && + rt->rt_rmx.rmx_mtu > rt->rt_ifp->if_mtu) rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu; return (rn_addroute(v_arg, n_arg, head, treenodes)); Modified: user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c Sat Mar 3 12:41:19 2012 (r232458) +++ user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c Sat Mar 3 13:02:28 2012 (r232459) @@ -534,7 +534,7 @@ passout: /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_rmx.rmx_mtu) + if (ro.ro_rt->rt_rmx.rmx_mtu > 0) mtu = min(ro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); else mtu = ifp->if_mtu; Modified: user/andre/tcp_workqueue/sys/netinet/ip_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_input.c Sat Mar 3 12:41:19 2012 (r232458) +++ user/andre/tcp_workqueue/sys/netinet/ip_input.c Sat Mar 3 13:02:28 2012 (r232459) @@ -1493,8 +1493,12 @@ ip_forward(struct mbuf *m, int srcrt) error = ip_output(m, NULL, &ro, IP_FORWARDING, NULL, NULL); - if (error == EMSGSIZE && ro.ro_rt) - mtu = ro.ro_rt->rt_rmx.rmx_mtu; + if (error == EMSGSIZE && ro.ro_rt) { + if (ro.ro_rt->rt_rmx.rmx_mtu > 0) + mtu = ro.ro_rt->rt_rmx.rmx_mtu; + else + mtu = ro.ro_rt->rt_ifp->if_mtu; + } if (ro.ro_rt) RTFREE(ro.ro_rt); Modified: user/andre/tcp_workqueue/sys/netinet/ip_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_output.c Sat Mar 3 12:41:19 2012 (r232458) +++ user/andre/tcp_workqueue/sys/netinet/ip_output.c Sat Mar 3 13:02:28 2012 (r232459) @@ -309,7 +309,8 @@ again: * Calculate MTU. If we have a route that is up, use that, * otherwise use the interface's MTU. */ - if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST))) { + if (rte != NULL && (rte->rt_flags & (RTF_UP|RTF_HOST)) && + rte->rt_rmx.rmx_mtu > 0) { /* * This case can happen if the user changed the MTU * of an interface after enabling IP on it. Because Modified: user/andre/tcp_workqueue/sys/netinet/tcp_subr.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Sat Mar 3 12:41:19 2012 (r232458) +++ user/andre/tcp_workqueue/sys/netinet/tcp_subr.c Sat Mar 3 13:02:28 2012 (r232459) @@ -1731,10 +1731,10 @@ tcp_maxmtu(struct in_conninfo *inc, int } if (sro.ro_rt != NULL) { ifp = sro.ro_rt->rt_ifp; - if (sro.ro_rt->rt_rmx.rmx_mtu == 0) - maxmtu = ifp->if_mtu; - else + if (sro.ro_rt->rt_rmx.rmx_mtu > 0) maxmtu = min(sro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); + else + maxmtu = ifp->if_mtu; /* Report additional interface capabilities. */ if (flags != NULL) { From owner-svn-src-user@FreeBSD.ORG Sat Mar 3 13:31:20 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DF91D1065673; Sat, 3 Mar 2012 13:31:20 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB5448FC08; Sat, 3 Mar 2012 13:31:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23DVKYl083927; Sat, 3 Mar 2012 13:31:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23DVKQF083925; Sat, 3 Mar 2012 13:31:20 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203031331.q23DVKQF083925@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Mar 2012 13:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232460 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 13:31:21 -0000 Author: andre Date: Sat Mar 3 13:31:20 2012 New Revision: 232460 URL: http://svn.freebsd.org/changeset/base/232460 Log: If the user has closed the socket then drop a persisting connection after a much reduced timeout. Typically web servers close their sockets quickly under the assumption that the TCP connections goes away as well. That is not entirely true however. If the peer closed the window we're going to wait for a long time with lots of data in the send buffer. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Sat Mar 3 13:02:28 2012 (r232459) +++ user/andre/tcp_workqueue/sys/netinet/tcp_timer.c Sat Mar 3 13:31:20 2012 (r232460) @@ -424,6 +424,16 @@ tcp_timer_persist(void *xtp) tp = tcp_drop(tp, ETIMEDOUT); goto out; } + /* + * If the user has closed the socket then drop a persisting + * connection after a much reduced timeout. + */ + if (tp->t_state > TCPS_CLOSE_WAIT && + (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { + TCPSTAT_INC(tcps_persistdrop); + tp = tcp_drop(tp, ETIMEDOUT); + goto out; + } tcp_setpersist(tp); tp->t_flags |= TF_FORCEDATA; (void) tcp_output(tp); From owner-svn-src-user@FreeBSD.ORG Sat Mar 3 13:51:52 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 23254106567A; Sat, 3 Mar 2012 13:51:52 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA0D58FC18; Sat, 3 Mar 2012 13:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23Dpp5C084658; Sat, 3 Mar 2012 13:51:51 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23DpptA084656; Sat, 3 Mar 2012 13:51:51 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203031351.q23DpptA084656@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Mar 2012 13:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232461 - user/andre/tcp_workqueue/sys/kern X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 13:51:52 -0000 Author: andre Date: Sat Mar 3 13:51:51 2012 New Revision: 232461 URL: http://svn.freebsd.org/changeset/base/232461 Log: Add logging for socket attach failures in sonewconn() while accepting a new connection to make problems easier to track. Modified: user/andre/tcp_workqueue/sys/kern/uipc_socket.c Modified: user/andre/tcp_workqueue/sys/kern/uipc_socket.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sat Mar 3 13:31:20 2012 (r232460) +++ user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sat Mar 3 13:51:51 2012 (r232461) @@ -135,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -447,16 +448,22 @@ sonewconn(struct socket *head, int conns over = (head->so_qlen > 3 * head->so_qlimit / 2); ACCEPT_UNLOCK(); #ifdef REGRESSION - if (regression_sonewconn_earlytest && over) + if (regression_sonewconn_earlytest && over) { #else - if (over) + if (over) { #endif + log(LOG_DEBUG, "%s: Listen queue overflow: %i in queue", + __func__, over); return (NULL); + } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", __func__, __LINE__, head)); so = soalloc(head->so_vnet); - if (so == NULL) + if (so == NULL) { + log(LOG_DEBUG, "%s: Socket allocation failure: " + "limit reached or out of memory", __func__); return (NULL); + } if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; @@ -476,6 +483,8 @@ sonewconn(struct socket *head, int conns if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); + log(LOG_DEBUG, "%s: soreserve() or pru_attach() failed ", + __func__); return (NULL); } so->so_rcv.sb_lowat = head->so_rcv.sb_lowat; @@ -3216,7 +3225,7 @@ filt_soread(struct knote *kn, long hint) else if (kn->kn_sfflags & NOTE_LOWAT) return (kn->kn_data >= kn->kn_sdata); else - return (so->so_rcv.sb_cc >= so->so_rcv.sb_lowat); + return (soreadabledata(so)); } static void From owner-svn-src-user@FreeBSD.ORG Sat Mar 3 19:03:26 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D965106564A; Sat, 3 Mar 2012 19:03:26 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 898D78FC15; Sat, 3 Mar 2012 19:03:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q23J3QOE096254; Sat, 3 Mar 2012 19:03:26 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q23J3QfF096252; Sat, 3 Mar 2012 19:03:26 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201203031903.q23J3QfF096252@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Mar 2012 19:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232474 - user/andre/tcp_workqueue/sys/netinet X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2012 19:03:26 -0000 Author: andre Date: Sat Mar 3 19:03:26 2012 New Revision: 232474 URL: http://svn.freebsd.org/changeset/base/232474 Log: Allow arbitrary MSS sizes and don't mind about the cluster size anymore. We've got more cluster sizes for quite some time now and the orginally imposed limits and the previously codified thoughts on efficiency gains are no longer true. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_input.c Sat Mar 3 18:58:15 2012 (r232473) +++ user/andre/tcp_workqueue/sys/netinet/tcp_input.c Sat Mar 3 19:03:26 2012 (r232474) @@ -3296,9 +3296,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt * Determine a reasonable value for maxseg size. * If the route is known, check route for mtu. * If none, use an mss that can be handled on the outgoing - * interface without forcing IP to fragment; if bigger than - * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES - * to utilize large mbufs. If no route is found, route has no mtu, + * interface without forcing IP to fragment. + * If no route is found, route has no mtu, * or the destination isn't local, use a default, hopefully conservative * size (usually 512 or the default IP max size, but no more than the mtu * of the interface), as we can't discover anything about intervening @@ -3476,13 +3475,6 @@ tcp_mss_update(struct tcpcb *tp, int off (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)) mss -= TCPOLEN_TSTAMP_APPA; -#if (MCLBYTES & (MCLBYTES - 1)) == 0 - if (mss > MCLBYTES) - mss &= ~(MCLBYTES-1); -#else - if (mss > MCLBYTES) - mss = mss / MCLBYTES * MCLBYTES; -#endif tp->t_maxseg = mss; }