From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 10:11:48 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 045C0610; Sun, 28 Oct 2012 10:11:48 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1E168FC0C; Sun, 28 Oct 2012 10:11:47 +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 q9SABlFH080649; Sun, 28 Oct 2012 10:11:47 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SABlg1080647; Sun, 28 Oct 2012 10:11:47 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210281011.q9SABlg1080647@svn.freebsd.org> From: Chris Rees Date: Sun, 28 Oct 2012 10:11:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242213 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 10:11:48 -0000 Author: crees (ports committer) Date: Sun Oct 28 10:11:47 2012 New Revision: 242213 URL: http://svn.freebsd.org/changeset/base/242213 Log: Strip path from filename and assume '-' means '_' inside file Modified: user/crees/rclint/Makefile user/crees/rclint/rclint.py Modified: user/crees/rclint/Makefile ============================================================================== --- user/crees/rclint/Makefile Sun Oct 28 09:18:13 2012 (r242212) +++ user/crees/rclint/Makefile Sun Oct 28 10:11:47 2012 (r242213) @@ -41,3 +41,7 @@ tarball: ${CP} ${FILES} rclint-${VERSION} && \ ${TAR} cvfz rclint-${VERSION}.tar.gz rclint-${VERSION} && \ ${RM} -rf rclint-${VERSION} + if [ "`id -un`@`hostname -s`" = "crees@pegasus" ]; then \ + sudo cp rclint-${VERSION}.tar.gz /usr/local/www/data/dist/rclint/ &&\ + scp rclint-${VERSION}.tar.gz freefall.FreeBSD.org:public_distfiles/rclint/; \ + fi Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Sun Oct 28 09:18:13 2012 (r242212) +++ user/crees/rclint/rclint.py Sun Oct 28 10:11:47 2012 (r242213) @@ -28,7 +28,7 @@ __version__ = '$FreeBSD$' MAJOR = 0 MINOR = 0 -MICRO = 1 +MICRO = 2 DATADIR = '.' @@ -401,6 +401,7 @@ def do_rclint(filename): # Strip .in from filename logging.debug('Checking $name agrees with PROVIDE and filename') fn = filename[:-3] if filename[-3:] == '.in' else filename + fn = fn.split('/')[-1].replace('-', '_') n = get(lineobj['Variable'], 'name').value rcordervars = [] for r in lineobj['Rcorder']: From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 10:33: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 21A6BA76; Sun, 28 Oct 2012 10:33:20 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09E8B8FC0A; Sun, 28 Oct 2012 10:33: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 q9SAXJ5V085506; Sun, 28 Oct 2012 10:33:19 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SAXJIf085501; Sun, 28 Oct 2012 10:33:19 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210281033.q9SAXJIf085501@svn.freebsd.org> From: Chris Rees Date: Sun, 28 Oct 2012 10:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242215 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 10:33:20 -0000 Author: crees (ports committer) Date: Sun Oct 28 10:33:19 2012 New Revision: 242215 URL: http://svn.freebsd.org/changeset/base/242215 Log: Unbreak function detection logic, and check that it is indented Modified: user/crees/rclint/errors.en user/crees/rclint/rclint.py Modified: user/crees/rclint/errors.en ============================================================================== --- user/crees/rclint/errors.en Sun Oct 28 10:18:46 2012 (r242214) +++ user/crees/rclint/errors.en Sun Oct 28 10:33:19 2012 (r242215) @@ -9,6 +9,7 @@ error_id message explanation file_order Order of rc file incorrect Order of the rc file should be shebang/header/$FreeBSD$/sourcing rc_subr/name/rcvar/load_rc_config/setting defaults/setting other definitions/defining functions. Do not include unassociated shell commands, and blocks must be separated by single blank lines. Single blank lines may appear inside the defaults, definitions and functions blocks functions_chown Useless use of chown? Using chown in functions can nearly always be replaced with appropriate use of install(1) +functions_indent Unindented function contents Style dictates that indentation of rc scripts should be tabs. Ensure that function contents are indented functions_inline_brace Inline brace in function Put the opening brace for a function ({) on its own line functions_neverending Unclosed function block Functions must end with a closing brace on its own line functions_problem Function incorrectly defined Functions should not have spaces in the definition @@ -31,7 +32,7 @@ run_rc_argument Incorrect argument to ru shebang Incorrect shebang used All rc scripts must start with the correct shebang; #!/bin/sh variables_defaults_mandatory_colon Override blanks in mandatory values (:=/:- vs =/-) Values that must not be blank (such as _enable) should be set by default as ${var:=value}; thus disallowing blank values (man sh) -variables_defaults_non_mandatory_colon Do not clobber blank values for non-mandatory variables Syntax for variables that are not mandatory is ${var=value}; including := will override var="" set in rc.conf (man sh) +variables_defaults_non_mandatory_colon Do not clobber blank values for non-mandatory variables Syntax for variables that are not mandatory is ${var=value}; including := will override var="" set in rc.conf (man sh). If this variable is mandatory just for this script, then ignore this error variables_defaults_old_style Prefer condensed version for setting default values of variables When setting the default value for a variable, it is much less verbose and clearer to use the : ${variable=var} notation, as well as it being obvious that the source and destination variable are the same variables_order Order of variables incorrect Order of the variables should be setting defaults then setting other variables Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Sun Oct 28 10:18:46 2012 (r242214) +++ user/crees/rclint/rclint.py Sun Oct 28 10:33:19 2012 (r242215) @@ -194,7 +194,7 @@ class RcsId: class Function: def __init__(self, lines, num): - if lines[0] and lines[0][-1] == '{': + if len(lines[0]) > 1 and lines[0][-1] == '{': error.give('functions_inline_brace', num) elif lines[1] and lines[1][0] == '{': try: @@ -210,6 +210,8 @@ class Function: error.give('functions_neverending', num) break self.value.append(lines[self.length]) + if self.value[-1] and self.value[-1][0] not in '\t {}': + error.give('functions_indent', num + self.length) # Remove { and } lines from length self.length -= 2 logging.debug('Found function %s' % self.name) From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 11:27:55 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 A4BBB666; Sun, 28 Oct 2012 11:27:55 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72E628FC14; Sun, 28 Oct 2012 11:27: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 q9SBRt6s094806; Sun, 28 Oct 2012 11:27:55 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SBRtbN094804; Sun, 28 Oct 2012 11:27:55 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210281127.q9SBRtbN094804@svn.freebsd.org> From: Chris Rees Date: Sun, 28 Oct 2012 11:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242217 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 11:27:55 -0000 Author: crees (ports committer) Date: Sun Oct 28 11:27:54 2012 New Revision: 242217 URL: http://svn.freebsd.org/changeset/base/242217 Log: Allow multiline variables Discovered in: net/activemq Add option -k to continue reporting errors past the error threshold Modified: user/crees/rclint/rclint.py Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Sun Oct 28 10:57:24 2012 (r242216) +++ user/crees/rclint/rclint.py Sun Oct 28 11:27:54 2012 (r242217) @@ -76,7 +76,7 @@ class Db: else: logging.error('No such error: %s' % key) self.count += 1 - if self.count > 10: + if self.count > 10 and beaucoup_errors == False: hint = ' Try rerunning with -v option for extra details.' if verbosity == 0 else '' logging.error('Error threshold reached-- further errors are unlikely to be helpful. Fix the errors and rerun.' + hint) exit() @@ -85,14 +85,18 @@ class Db: self.give(key, num, level) class Statement: - def __init__(self, line, number): + def __init__(self, lines, number): types = {'.': 'source', 'load_rc_config': 'load_rc_config', 'run_rc_command': 'run_rc_command'} - spl = line.split(' ') + self.length = 1 + spl = lines[number].split(' ') if spl[0] in types: self.name = spl[0] self.type = types[spl[0]] self.value = ' '.join(spl[1:]) + while self.value[-1] == '\\': + self.value = ' '.join((self.value[:-1], lines[num+self.length])) + self.length += 1 self.line = number else: self.value = False @@ -112,7 +116,9 @@ class Statement: return False class Variable(Statement): - def __init__(self, line, number): + def __init__(self, lines, number): + line = lines[number] + self.length = 1 basic = re.compile(r'([^\s=]+)=(.*)') result = basic.match(line) if result: @@ -123,11 +129,19 @@ class Variable(Statement): self.type = 'longhand' else: (self.name, self.value) = result.groups() + while self.value[-1] == '\\': + self.value = ' '.join((self.value[:-1], + lines[number+self.length])) + self.length += 1 self.type = ( 'init' if self.name in ('name', 'rcvar') else 'basic') elif line[:4] == 'eval': self.value = line + while self.value[-1] == '\\': + self.value = ' '.join(self.value[:-1], + lines[number+self.length]) + self.length += 1 self.name = line self.type = 'eval' else: @@ -153,7 +167,8 @@ class Variable(Statement): return False if re.match('[\'"]?[^\'"]+[\'"]?', self.value) else True class Comment: - def __init__(self, line, number): + def __init__(self, lines, number): + line = lines[number] self.value = line if line and line[0] == '#' else False self.line = number @@ -264,7 +279,7 @@ def do_rclint(filename): for num in range(0, len(lines)): for obj in list(lineobj.keys()): - tmp = eval(obj)(lines[num], num) + tmp = eval(obj)(lines, num) if tmp.value != False: lineobj[obj].append(tmp) break @@ -331,7 +346,11 @@ def do_rclint(filename): logging.debug('Checking all lines are accounted for') for obj in list(lineobj.keys()): for o in lineobj[obj]: - linenumbers.append(o.line) + if hasattr(o, 'length'): + for l in range(0, o.length): + linenumbers.append(o.line+l) + else: + linenumbers.append(o.line) for r in range(0, len(lines)): if r not in linenumbers and lines[r] != '': if True not in [f.contains_line(r) for f in lineobj['Function']]: @@ -428,9 +447,11 @@ parser.add_argument('-v', action='count' parser.add_argument('--version', action='version', version='%s.%s.%s-%s'%(MAJOR, MINOR, MICRO, __version__)) parser.add_argument('-b', action='store_true', help='chooses base RC script mode') parser.add_argument('-p', action='store_true', help='chooses ports RC script mode (default)') +parser.add_argument('-k', action='store_true', help='tells rclint to carry on reporting even if there are over 10 errors') args = parser.parse_args() mode = 'base' if args.b else 'ports' +beaucoup_errors = args.k verbosity = args.v if args.v != None else 0 logging.basicConfig(level=logging.DEBUG if verbosity > 1 else logging.WARN) From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 12:12:45 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 BBDF9E8C; Sun, 28 Oct 2012 12:12:45 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A417A8FC0A; Sun, 28 Oct 2012 12:12: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 q9SCCjK0002927; Sun, 28 Oct 2012 12:12:45 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SCCjwE002925; Sun, 28 Oct 2012 12:12:45 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210281212.q9SCCjwE002925@svn.freebsd.org> From: Chris Rees Date: Sun, 28 Oct 2012 12:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242219 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 12:12:45 -0000 Author: crees (ports committer) Date: Sun Oct 28 12:12:45 2012 New Revision: 242219 URL: http://svn.freebsd.org/changeset/base/242219 Log: Check multiple keywords (an accidental omission) Allow $* in run_rc_command Modified: user/crees/rclint/rclint.py Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Sun Oct 28 11:53:54 2012 (r242218) +++ user/crees/rclint/rclint.py Sun Oct 28 12:12:45 2012 (r242219) @@ -28,7 +28,7 @@ __version__ = '$FreeBSD$' MAJOR = 0 MINOR = 0 -MICRO = 2 +MICRO = 3 DATADIR = '.' @@ -194,7 +194,7 @@ class Rcorder: self.line = comment.line result = comment.match('# ([A-Z]+): (.+)') if result: - (self.type, self.value) = (result[0], result[1:]) + (self.type, self.value) = (result[0], result[1].split()) else: self.value = False @@ -416,7 +416,7 @@ def do_rclint(filename): logging.debug('Checking for run_rc_command') for s in lineobj['Statement']: if s.type == 'run_rc_command': - if '$1' not in s.value: + if '$1' not in s.value and '$*' not in s.value: error.give('run_rc_argument', s.line) # Strip .in from filename From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 17:06:50 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 E0249CA0; Sun, 28 Oct 2012 17:06:50 +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 C219C8FC0C; Sun, 28 Oct 2012 17:06: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 q9SH6oLN058533; Sun, 28 Oct 2012 17:06:50 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SH6otS058531; Sun, 28 Oct 2012 17:06:50 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281706.q9SH6otS058531@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242248 - user/andre/tcp_workqueue/sys/netinet X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 17:06:51 -0000 Author: andre Date: Sun Oct 28 17:06:50 2012 New Revision: 242248 URL: http://svn.freebsd.org/changeset/base/242248 Log: Add missing "else" to multi-"if" statement in cc_conn_init(). 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 Sun Oct 28 16:21:46 2012 (r242247) +++ user/andre/tcp_workqueue/sys/netinet/tcp_input.c Sun Oct 28 17:06:50 2012 (r242248) @@ -373,7 +373,7 @@ cc_conn_init(struct tcpcb *tp) /* Per RFC5681 Section 3.1 */ if (tp->t_maxseg > 2190) tp->snd_cwnd = 2 * tp->t_maxseg; - if (tp->t_maxseg > 1095) + else if (tp->t_maxseg > 1095) tp->snd_cwnd = 3 * tp->t_maxseg; else tp->snd_cwnd = 4 * tp->t_maxseg; From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 17:42:37 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 77540932; Sun, 28 Oct 2012 17:42:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2805C8FC08; Sun, 28 Oct 2012 17:42:35 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4207915lag.13 for ; Sun, 28 Oct 2012 10:42:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=cxkd49lSYW1yJr0swNCwp1Ha3QPK63DTiDPQ4R/BUFk=; b=qg1aLxi97/cl93/ZHHS1BhG5LGs8RkjEPJLW1gLI/u6mTFkrwhvz0CtrIV3iIW/Kr+ /D6FQPJ0MAFl27vQlGirBMVKflztjo89BAX8yik8Dml8xO9lL0rRw6H8GcpmvYpb+7Ww CmAylC8lwO7pV3SCrj5SL+aqg0bhgyqdwN2fji9lADhQDfyfCVUXIJw7pM7/IZWQz/yD 7hKYG6buhMyX244wP1UyemeaaTqWU6XDKAUtaQ1v2nVw4xGdCmC7TN+YCefynhn8/rFt u64I9NSNF517KnEBZJ6/kk99gJ+cUazmTqGMqir7L1zIKIvsVK6UYfI1Xw7B31YuJ/tB ZW5g== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr25643796lab.9.1351446154788; Sun, 28 Oct 2012 10:42:34 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Sun, 28 Oct 2012 10:42:34 -0700 (PDT) In-Reply-To: References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> Date: Sun, 28 Oct 2012 17:42:34 +0000 X-Google-Sender-Auth: ptQKedc0N0pxyNX7ucio9CSgmu0 Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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, 28 Oct 2012 17:42:37 -0000 On Sat, Oct 27, 2012 at 5:27 PM, Attilio Rao wrote: > On Sat, Oct 27, 2012 at 3:35 PM, Attilio Rao wrote: >> On 10/26/12, Andre Oppermann wrote: >>> On 26.10.2012 08:27, Attilio Rao wrote: >>>> On Thu, Oct 25, 2012 at 10:03 PM, Andre Oppermann >>>> wrote: >>>>> On 25.10.2012 18:21, Attilio Rao wrote: >>>>>> Did you see my (and also Jeff) objection to your proposal about this? >>>>>> You are deliberating ignoring this? >>>>> >>>>> >>>>> Well, I'm allowed to have a different opinion, am I? I'm not ignoring >>>>> your objection in the sense as I'm not trying to commit any of this to >>>>> HEAD while it is disputed. >>>>> >>>>> Mind you this whole conversation was started because I was trying to >>>>> solve >>>>> a problem with unfortunate cache line sharing for global mutexes in the >>>>> kernel .bss section on my *personal* svn branch. >>>> >>>> Andre, >>>> I'm sorry if you felt I was being harsh or confrontative. This was >>>> really not my intention and I apologize. >>> >>> I apologize too for being a bit difficult and taking some time understand >>> the differences in __aligned() regarding padding behavior. >>> >>>> Said that, I fail in seeing a proper technical discussion on your side >>>> on how what I propose is "overdoing it" or how do you plan to address >>>> the concerns people are raising with your proposal of bumping all lock >>>> sizes indiscriminately. >>> >>> I'm wary of micro-optimizing and generally prefer clean and for a >>> reader obvious approaches. That said my assumption on the distribution >>> of mutex use cases in the kernel was wrong. By counting from a grep >>> it seems that about half of the mutexes could possibly benefit from >>> being padded and the other half doesn't because it is in structures >>> and next to its data. >> >> Besides that, you are likely misunderstanding something about what I >> propose: what I'm proposing is completely transparent to developers. >> You will just need to declare a mtx like: >> >> struct mtx_unshare Giant; >> >> and then you can use the mtx(9) interface on it without any issue. I >> don't see how this is less clean than what you propose. It just >> enables the alignment/padding on a selection basis rather than >> indiscriminately. >> >>>> However, here is the first half of the patch I'd like to see in: >>>> http:///www.freebsd.org/~attilio/mtx_decoupled.patch >>> > >>>> This is just the part to give the ability to crunch different >>>> structures to the mtx KPI. Please note that from the users perspective >>>> the mtx KPI remains absolutely the same, so there is theoretically no >>>> KPI discontinuity, the support is absolutely transparent. >>> >>> This seems rather complicated. Instead of mtxlock2mtx() wouldn't >>> __containerof() work just as well? The __DEVOLATILE() looks a bit >>> dangerous. Are you sure the compiler won't reorder things it should >>> not? >> >> What do you mean with "rather complicated"? >> For the users of the primitive nothing changes at all. >> For the people that might read the code it is pretty much >> self-explanatory, in particular if you know how lock classes work in >> our locking scheme. Maybe I can add a comment or two to clarify. > > Here we go with further comments tweaks. > Also, in order to make it a complete NOP from KPI perspective I had to > change the way the mtx_assert() wrapper was implemented as in v1 it > wasn't correctly handling the const qualifier. > I think the result is better now and you should refer to this patch for reviews: > http://www.freebsd.org/~attilio/mtx_decoupled2.patch BTW, the mtx_sysuninit() introduction can be avoided by using this other trick: #define MTX_SYSINIT(name, mtx, desc, opts) \ static struct mtx_args name##_args = { \ (mtx), \ (desc), \ (opts) \ }; \ SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ mtx_sysinit, &name##_args); \ SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) I'm just not sure that I would like the use of __DEVOLATILE() even if it would help in this case when introducing MTX_SYSINIT_UNSHARE() because we will just need to reuse the same code. Also, the more I think about this the more I feel convinced that mtxlock2mtx() should be static in kern_mutex.c. I can simply add a note to _mutex.h as a reminder for it. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 20:14:22 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 94D13977; Sun, 28 Oct 2012 20:14:22 +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 78DB98FC0A; Sun, 28 Oct 2012 20:14:22 +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 q9SKEMmH090852; Sun, 28 Oct 2012 20:14:22 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SKELRD090817; Sun, 28 Oct 2012 20:14:21 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210282014.q9SKELRD090817@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 20:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242269 - in user/andre/tcp_workqueue/sys: amd64/conf arm/conf arm/ti cam cam/ctl cam/scsi conf dev/ata dev/ata/chipsets dev/ath dev/filemon dev/sound/usb ia64/ia64 ia64/include kern mi... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 20:14:22 -0000 Author: andre Date: Sun Oct 28 20:14:21 2012 New Revision: 242269 URL: http://svn.freebsd.org/changeset/base/242269 Log: Integrate from HEAD @242267. Modified: user/andre/tcp_workqueue/sys/amd64/conf/GENERIC user/andre/tcp_workqueue/sys/arm/conf/PANDABOARD user/andre/tcp_workqueue/sys/arm/ti/ti_machdep.c user/andre/tcp_workqueue/sys/cam/cam.h user/andre/tcp_workqueue/sys/cam/cam_xpt.c user/andre/tcp_workqueue/sys/cam/ctl/ctl_frontend_cam_sim.c user/andre/tcp_workqueue/sys/cam/ctl/scsi_ctl.c user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c user/andre/tcp_workqueue/sys/cam/scsi/scsi_enc.c user/andre/tcp_workqueue/sys/cam/scsi/scsi_pass.c user/andre/tcp_workqueue/sys/conf/files user/andre/tcp_workqueue/sys/conf/files.mips user/andre/tcp_workqueue/sys/dev/ata/ata-all.c user/andre/tcp_workqueue/sys/dev/ata/ata-all.h user/andre/tcp_workqueue/sys/dev/ata/ata-lowlevel.c user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-ahci.c user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-siliconimage.c user/andre/tcp_workqueue/sys/dev/ath/if_ath.c user/andre/tcp_workqueue/sys/dev/filemon/filemon.c user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c user/andre/tcp_workqueue/sys/ia64/ia64/pmap.c user/andre/tcp_workqueue/sys/ia64/include/pmap.h user/andre/tcp_workqueue/sys/kern/kern_umtx.c user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c user/andre/tcp_workqueue/sys/mips/mips/pmap.c user/andre/tcp_workqueue/sys/modules/Makefile user/andre/tcp_workqueue/sys/modules/drm/r128/Makefile user/andre/tcp_workqueue/sys/modules/drm/radeon/Makefile user/andre/tcp_workqueue/sys/modules/drm/via/Makefile user/andre/tcp_workqueue/sys/net/if_bridge.c user/andre/tcp_workqueue/sys/net80211/ieee80211_freebsd.c user/andre/tcp_workqueue/sys/net80211/ieee80211_ht.c user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c user/andre/tcp_workqueue/sys/netinet/ip_mroute.c user/andre/tcp_workqueue/sys/netinet/ip_output.c user/andre/tcp_workqueue/sys/netinet/ip_var.h user/andre/tcp_workqueue/sys/netinet/tcp_input.c user/andre/tcp_workqueue/sys/netinet/tcp_timer.c user/andre/tcp_workqueue/sys/netpfil/pf/pf.c user/andre/tcp_workqueue/sys/sys/buf.h user/andre/tcp_workqueue/sys/ufs/ffs/ffs_softdep.c user/andre/tcp_workqueue/sys/vm/uma.h user/andre/tcp_workqueue/sys/vm/uma_core.c user/andre/tcp_workqueue/sys/vm/uma_int.h user/andre/tcp_workqueue/sys/vm/vm_glue.c user/andre/tcp_workqueue/sys/xen/evtchn/evtchn.c Directory Properties: user/andre/tcp_workqueue/sys/ (props changed) user/andre/tcp_workqueue/sys/conf/ (props changed) Modified: user/andre/tcp_workqueue/sys/amd64/conf/GENERIC ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/conf/GENERIC Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/amd64/conf/GENERIC Sun Oct 28 20:14:21 2012 (r242269) @@ -71,6 +71,10 @@ options KDTRACE_HOOKS # Kernel DTrace options DDB_CTF # Kernel ELF linker loads CTF data options INCLUDE_CONFIG_FILE # Include this file in kernel +options IPSEC +device crypto +device enc + # Debugging support. Always need this: options KDB # Enable kernel debugger support. # For minimum debugger support (stable branch) use: Modified: user/andre/tcp_workqueue/sys/arm/conf/PANDABOARD ============================================================================== --- user/andre/tcp_workqueue/sys/arm/conf/PANDABOARD Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/arm/conf/PANDABOARD Sun Oct 28 20:14:21 2012 (r242269) @@ -54,7 +54,7 @@ options NFS_ROOT #NFS usable as /, req #options BOOTP_NFSROOT #options BOOTP_COMPAT #options BOOTP -options BOOTP_NFSV3 +#options BOOTP_NFSV3 #options BOOTP_WIRED_TO=ue0 options MSDOSFS #MSDOS Filesystem #options CD9660 #ISO 9660 Filesystem Modified: user/andre/tcp_workqueue/sys/arm/ti/ti_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/ti/ti_machdep.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/arm/ti/ti_machdep.c Sun Oct 28 20:14:21 2012 (r242269) @@ -494,7 +494,7 @@ initarm(struct arm_boot_params *abp) env = getenv("kernelname"); if (env != NULL) - strlcpy(kernelname, env, sizeof(kernelname); + strlcpy(kernelname, env, sizeof(kernelname)); if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", Modified: user/andre/tcp_workqueue/sys/cam/cam.h ============================================================================== --- user/andre/tcp_workqueue/sys/cam/cam.h Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/cam.h Sun Oct 28 20:14:21 2012 (r242269) @@ -83,6 +83,7 @@ typedef struct { #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 #define CAM_PRIORITY_TO_RL(x) ((x) >> 8) +#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: user/andre/tcp_workqueue/sys/cam/cam_xpt.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/cam_xpt.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/cam_xpt.c Sun Oct 28 20:14:21 2012 (r242269) @@ -2468,9 +2468,6 @@ xpt_action(union ccb *start_ccb) CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); start_ccb->ccb_h.status = CAM_REQ_INPROG; - /* Compatibility for RL-unaware code. */ - if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0) - start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); } Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_frontend_cam_sim.c Sun Oct 28 20:14:21 2012 (r242269) @@ -240,7 +240,7 @@ cfcs_init(void) goto bailout; } - xpt_setup_ccb(&csa.ccb_h, softc->path, /*priority*/ 5); + xpt_setup_ccb(&csa.ccb_h, softc->path, CAM_PRIORITY_NONE); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE; csa.callback = cfcs_async; Modified: user/andre/tcp_workqueue/sys/cam/ctl/scsi_ctl.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/scsi_ctl.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/ctl/scsi_ctl.c Sun Oct 28 20:14:21 2012 (r242269) @@ -334,7 +334,7 @@ ctlfeasync(void *callback_arg, uint32_t return; } xpt_setup_ccb(&ccb->ccb_h, cpi->ccb_h.path, - /*priority*/ 1); + CAM_PRIORITY_NONE); sim = xpt_path_sim(cpi->ccb_h.path); @@ -571,7 +571,7 @@ ctlferegister(struct cam_periph *periph, callout_init_mtx(&softc->dma_callout, sim->mtx, /*flags*/ 0); periph->softc = softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -668,7 +668,7 @@ ctlfeoninvalidate(struct cam_periph *per softc = (struct ctlfe_lun_softc *)periph->softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -1694,7 +1694,7 @@ ctlfe_onoffline(void *arg, int online) return; } ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, path, /*priority*/ 1); + xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); sim = xpt_path_sim(path); Modified: user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Sun Oct 28 20:14:21 2012 (r242269) @@ -1510,7 +1510,7 @@ dasysctlinit(void *context, int pending) * Add some addressing info. */ memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1); + xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cam_periph_lock(periph); Modified: user/andre/tcp_workqueue/sys/cam/scsi/scsi_enc.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/scsi/scsi_enc.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/scsi/scsi_enc.c Sun Oct 28 20:14:21 2012 (r242269) @@ -559,7 +559,7 @@ enc_runcmd(struct enc_softc *enc, char * cdbl = IOCDBLEN; } - ccb = cam_periph_getccb(enc->periph, 1); + ccb = cam_periph_getccb(enc->periph, CAM_PRIORITY_NORMAL); if (enc->enc_type == ENC_SEMB_SES || enc->enc_type == ENC_SEMB_SAFT) { tdlen = min(dlen, 1020); tdlen = (tdlen + 3) & ~3; Modified: user/andre/tcp_workqueue/sys/cam/scsi/scsi_pass.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/scsi/scsi_pass.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/cam/scsi/scsi_pass.c Sun Oct 28 20:14:21 2012 (r242269) @@ -521,6 +521,7 @@ passioctl(struct cdev *dev, u_long cmd, struct cam_periph *periph; struct pass_softc *softc; int error; + uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) @@ -553,6 +554,11 @@ passioctl(struct cdev *dev, u_long cmd, break; } + /* Compatibility for RL/priority-unaware code. */ + priority = inccb->ccb_h.pinfo.priority; + if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL)) + priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL); + /* * Non-immediate CCBs need a CCB from the per-device pool * of CCBs, which is scheduled by the transport layer. @@ -561,15 +567,14 @@ passioctl(struct cdev *dev, u_long cmd, */ if ((inccb->ccb_h.func_code & XPT_FC_QUEUED) && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) { - ccb = cam_periph_getccb(periph, - inccb->ccb_h.pinfo.priority); + ccb = cam_periph_getccb(periph, priority); ccb_malloced = 0; } else { ccb = xpt_alloc_ccb_nowait(); if (ccb != NULL) xpt_setup_ccb(&ccb->ccb_h, periph->path, - inccb->ccb_h.pinfo.priority); + priority); ccb_malloced = 1; } Modified: user/andre/tcp_workqueue/sys/conf/files ============================================================================== --- user/andre/tcp_workqueue/sys/conf/files Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/conf/files Sun Oct 28 20:14:21 2012 (r242269) @@ -1940,8 +1940,11 @@ dev/si/si3_t225.c optional si dev/si/si_eisa.c optional si eisa dev/si/si_isa.c optional si isa dev/si/si_pci.c optional si pci +dev/siba/siba.c optional siba dev/siba/siba_bwn.c optional siba_bwn pci -dev/siba/siba_core.c optional siba_bwn pci +dev/siba/siba_cc.c optional siba +dev/siba/siba_core.c optional siba | siba_bwn pci +dev/siba/siba_pcib.c optional siba pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci Modified: user/andre/tcp_workqueue/sys/conf/files.mips ============================================================================== --- user/andre/tcp_workqueue/sys/conf/files.mips Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/conf/files.mips Sun Oct 28 20:14:21 2012 (r242269) @@ -33,7 +33,7 @@ mips/mips/pm_machdep.c standard mips/mips/pmap.c standard mips/mips/ptrace_machdep.c standard mips/mips/sc_machdep.c standard -mips/mips/stack_machdep.c standard +mips/mips/stack_machdep.c optional ddb | stack mips/mips/support.S standard mips/mips/swtch.S standard mips/mips/sys_machdep.c standard @@ -76,9 +76,9 @@ dev/fdt/fdt_mips.c optional fdt crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec -# AP common nvram interface +# AP common nvram interface MIPS specific, but maybe should be more generic dev/nvram2env/nvram2env.c optional nvram2env -# hwpmc goo +# hwpmc support dev/hwpmc/hwpmc_mips.c optional hwpmc dev/hwpmc/hwpmc_mips24k.c optional hwpmc Modified: user/andre/tcp_workqueue/sys/dev/ata/ata-all.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ata/ata-all.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ata/ata-all.c Sun Oct 28 20:14:21 2012 (r242269) @@ -1492,6 +1492,8 @@ ata_cam_begin_transaction(device_t dev, request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | (uint64_t)ccb->ataio.cmd.lba_low; + if (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) + request->flags |= ATA_R_NEEDRESULT; if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && ccb->ataio.cmd.flags & CAM_ATAIO_DMA) request->flags |= ATA_R_DMA; Modified: user/andre/tcp_workqueue/sys/dev/ata/ata-all.h ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ata/ata-all.h Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ata/ata-all.h Sun Oct 28 20:14:21 2012 (r242269) @@ -397,6 +397,7 @@ struct ata_request { #define ATA_R_REQUEUE 0x00000400 #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 +#define ATA_R_NEEDRESULT 0x00002000 #define ATA_R_ATAPI16 0x00010000 #define ATA_R_ATAPI_INTR 0x00020000 Modified: user/andre/tcp_workqueue/sys/dev/ata/ata-lowlevel.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ata/ata-lowlevel.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ata/ata-lowlevel.c Sun Oct 28 20:14:21 2012 (r242269) @@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request } while (request->status & ATA_S_BUSY && timeout--); if (request->status & ATA_S_ERROR) request->error = ATA_IDX_INB(ch, ATA_ERROR); + ch->hw.tf_read(request); goto begin_finished; } @@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request * if (request->flags & ATA_R_TIMEOUT) goto end_finished; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { ch->hw.tf_read(request); } @@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request * else if (!(request->flags & ATA_R_TIMEOUT)) request->donecount = request->bytecount; + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { + ch->hw.tf_read(request); + } + /* release SG list etc */ ch->dma.unload(request); Modified: user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-ahci.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-ahci.c Sun Oct 28 20:14:21 2012 (r242269) @@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ if (request->status & ATA_S_ERROR) request->error = tf_data >> 8; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8); Modified: user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-siliconimage.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ata/chipsets/ata-siliconimage.c Sun Oct 28 20:14:21 2012 (r242269) @@ -658,8 +658,10 @@ ata_siiprb_end_transaction(struct ata_re } } - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { request->u.ata.count = prb->fis[12] | ((u_int16_t)prb->fis[13] << 8); request->u.ata.lba = prb->fis[4] | ((u_int64_t)prb->fis[5] << 8) | ((u_int64_t)prb->fis[6] << 16); Modified: user/andre/tcp_workqueue/sys/dev/ath/if_ath.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_ath.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/ath/if_ath.c Sun Oct 28 20:14:21 2012 (r242269) @@ -281,6 +281,7 @@ ath_attach(u_int16_t devid, struct ath_s DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); + CURVNET_SET(vnet0); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(sc->sc_dev, "can not if_alloc()\n"); @@ -292,6 +293,7 @@ ath_attach(u_int16_t devid, struct ath_s /* set these up early for if_printf use */ if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); + CURVNET_RESTORE(); ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, sc->sc_eepromdata, &status); @@ -887,8 +889,11 @@ bad2: bad: if (ah) ath_hal_detach(ah); - if (ifp != NULL) + if (ifp != NULL) { + CURVNET_SET(ifp->if_vnet); if_free(ifp); + CURVNET_RESTORE(); + } sc->sc_invalid = 1; return error; } @@ -930,7 +935,10 @@ ath_detach(struct ath_softc *sc) ath_rxdma_teardown(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ + + CURVNET_SET(ifp->if_vnet); if_free(ifp); + CURVNET_RESTORE(); return 0; } Modified: user/andre/tcp_workqueue/sys/dev/filemon/filemon.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/filemon/filemon.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/filemon/filemon.c Sun Oct 28 20:14:21 2012 (r242269) @@ -136,6 +136,12 @@ filemon_dtr(void *data) } } +#if __FreeBSD_version < 900041 +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3)) +#else +#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, (a3)) +#endif + static int filemon_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag __unused, struct thread *td) @@ -148,11 +154,6 @@ filemon_ioctl(struct cdev *dev, u_long c switch (cmd) { /* Set the output file descriptor. */ case FILEMON_SET_FD: -#if __FreeBSD_version < 900041 -#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), (a3)) -#else -#define FGET_WRITE(a1, a2, a3) fget_write((a1), (a2), CAP_WRITE | CAP_SEEK, (a3)) -#endif if ((error = FGET_WRITE(td, *(int *)data, &filemon->fp)) == 0) /* Write the file header. */ filemon_comment(filemon); @@ -160,7 +161,7 @@ filemon_ioctl(struct cdev *dev, u_long c /* Set the monitored process ID. */ case FILEMON_SET_PID: - filemon->pid = *((pid_t *) data); + filemon->pid = *((pid_t *)data); break; default: Modified: user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c Sun Oct 28 20:14:21 2012 (r242269) @@ -176,7 +176,7 @@ struct uaudio_chan { struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; - struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; + struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; union uaudio_asf1d p_asf1d; union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; @@ -206,6 +206,12 @@ struct uaudio_chan { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + + uint8_t last_sync_time; + uint8_t last_sync_state; +#define UAUDIO_SYNC_NONE 0 +#define UAUDIO_SYNC_MORE 1 +#define UAUDIO_SYNC_LESS 2 }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -386,7 +392,9 @@ static device_attach_t uaudio_attach; static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; +static usb_callback_t uaudio_chan_play_sync_callback; static usb_callback_t uaudio_chan_record_callback; +static usb_callback_t uaudio_chan_record_sync_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; @@ -482,7 +490,7 @@ static void uaudio_chan_dump_ep_desc( #endif static const struct usb_config - uaudio_cfg_record[UAUDIO_NCHANBUFS] = { + uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -502,10 +510,20 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_sync_callback, + }, }; static const struct usb_config - uaudio_cfg_play[UAUDIO_NCHANBUFS] = { + uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -525,6 +543,16 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_sync_callback, + }, }; static const struct usb_config @@ -845,9 +873,9 @@ uaudio_detach(device_t dev) * any. */ if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); @@ -1396,10 +1424,96 @@ done: } static void +uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uaudio_chan *ch = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + uint8_t buf[4]; + uint64_t temp; + int len; + int actlen; + int nframes; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + DPRINTFN(6, "transferred %d bytes\n", actlen); + + if (nframes == 0) + break; + len = usbd_xfer_frame_len(xfer, 0); + if (len == 0) + break; + if (len > sizeof(buf)) + len = sizeof(buf); + + memset(buf, 0, sizeof(buf)); + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, buf, len); + + temp = UGETDW(buf); + + DPRINTF("Value = 0x%08x\n", (int)temp); + + /* auto-detect SYNC format */ + + if (len == 4) + temp &= 0x0fffffff; + + /* check for no data */ + + if (temp == 0) + break; + + /* correctly scale value */ + + temp = (temp * 125ULL) - 64; + + /* auto adjust */ + + while (temp < (ch->sample_rate - (ch->sample_rate / 4))) + temp *= 2; + + while (temp > (ch->sample_rate + (ch->sample_rate / 2))) + temp /= 2; + + /* bias */ + + temp += (ch->sample_rate + 1999) / 2000; + + /* compare */ + + DPRINTF("Comparing %d < %d\n", + (int)temp, (int)ch->sample_rate); + + if (temp == ch->sample_rate) + ch->last_sync_state = UAUDIO_SYNC_NONE; + else if (temp > ch->sample_rate) + ch->last_sync_state = UAUDIO_SYNC_MORE; + else + ch->last_sync_state = UAUDIO_SYNC_LESS; + break; + + case USB_ST_SETUP: + usbd_xfer_set_frames(xfer, 1); + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + break; + } +} + +static void uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; + uint32_t mfl; uint32_t total; uint32_t blockcount; uint32_t n; @@ -1423,12 +1537,18 @@ tr_transferred: } chn_intr(ch->pcm_ch); + /* start SYNC transfer, if any */ + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + case USB_ST_SETUP: - if (ch->bytes_per_frame[1] > usbd_xfer_max_framelen(xfer)) { + mfl = usbd_xfer_max_framelen(xfer); + + if (ch->bytes_per_frame[1] > mfl) { DPRINTF("bytes per transfer, %d, " "exceeds maximum, %d!\n", ch->bytes_per_frame[1], - usbd_xfer_max_framelen(xfer)); + mfl); break; } @@ -1442,15 +1562,37 @@ tr_transferred: /* setup frame lengths */ for (n = 0; n != blockcount; n++) { + uint32_t frame_len; + ch->sample_curr += ch->sample_rem; if (ch->sample_curr >= ch->frames_per_second) { ch->sample_curr -= ch->frames_per_second; - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[1]); - total += ch->bytes_per_frame[1]; + frame_len = ch->bytes_per_frame[1]; } else { - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[0]); - total += ch->bytes_per_frame[0]; + frame_len = ch->bytes_per_frame[0]; + } + + if (n == (blockcount - 1)) { + switch (ch->last_sync_state) { + case UAUDIO_SYNC_MORE: + DPRINTFN(6, "sending one sample more\n"); + if ((frame_len + ch->sample_size) <= mfl) + frame_len += ch->sample_size; + ch->last_sync_state = UAUDIO_SYNC_NONE; + break; + case UAUDIO_SYNC_LESS: + DPRINTFN(6, "sending one sample less\n"); + if (frame_len >= ch->sample_size) + frame_len -= ch->sample_size; + ch->last_sync_state = UAUDIO_SYNC_NONE; + break; + default: + break; + } } + + usbd_xfer_set_frame_len(xfer, n, frame_len); + total += frame_len; } DPRINTFN(6, "transfer %d bytes\n", total); @@ -1487,6 +1629,12 @@ tr_transferred: } static void +uaudio_chan_record_sync_callback(struct usb_xfer *xfer, usb_error_t error) +{ + /* TODO */ +} + +static void uaudio_chan_record_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); @@ -1697,7 +1845,7 @@ uaudio_chan_init(struct uaudio_softc *sc } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, - ch->usb_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { + ch->usb_cfg, UAUDIO_NCHANBUFS + 1, ch, ch->pcm_mtx)) { DPRINTF("could not allocate USB transfers!\n"); goto error; } @@ -1767,7 +1915,7 @@ uaudio_chan_free(struct uaudio_chan *ch) free(ch->buf, M_DEVBUF); ch->buf = NULL; } - usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS + 1); ch->valid = 0; @@ -1868,12 +2016,8 @@ uaudio_chan_start(struct uaudio_chan *ch #if (UAUDIO_NCHANBUFS != 2) #error "please update code" #endif - if (ch->xfer[0]) { - usbd_transfer_start(ch->xfer[0]); - } - if (ch->xfer[1]) { - usbd_transfer_start(ch->xfer[1]); - } + usbd_transfer_start(ch->xfer[0]); + usbd_transfer_start(ch->xfer[1]); return (0); } Modified: user/andre/tcp_workqueue/sys/ia64/ia64/pmap.c ============================================================================== --- user/andre/tcp_workqueue/sys/ia64/ia64/pmap.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/ia64/ia64/pmap.c Sun Oct 28 20:14:21 2012 (r242269) @@ -140,6 +140,29 @@ extern uint64_t ia64_gateway_page[]; #define pmap_set_wired(lpte) (lpte)->pte |= PTE_WIRED /* + * Individual PV entries are stored in per-pmap chunks. This saves + * space by eliminating the need to record the pmap within every PV + * entry. + */ +#if PAGE_SIZE == 8192 +#define _NPCM 6 +#define _NPCPV 337 +#define _NPCS 2 +#elif PAGE_SIZE == 16384 +#define _NPCM 11 +#define _NPCPV 677 +#define _NPCS 1 +#endif +struct pv_chunk { + pmap_t pc_pmap; + TAILQ_ENTRY(pv_chunk) pc_list; + u_long pc_map[_NPCM]; /* bitmap; 1 = free */ + TAILQ_ENTRY(pv_chunk) pc_lru; + u_long pc_spare[_NPCS]; + struct pv_entry pc_pventry[_NPCPV]; +}; + +/* * The VHPT bucket head structure. */ struct ia64_bucket { @@ -693,8 +716,6 @@ pmap_growkernel(vm_offset_t addr) ***************************************************/ CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); -CTASSERT(_NPCM == 6); -CTASSERT(_NPCPV == 337); static __inline struct pv_chunk * pv_to_chunk(pv_entry_t pv) @@ -705,13 +726,23 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) -#define PC_FREE0_4 0xfffffffffffffffful -#define PC_FREE5 0x000000000001fffful +#define PC_FREE_FULL 0xfffffffffffffffful +#define PC_FREE_PARTIAL \ + ((1UL << (_NPCPV - sizeof(u_long) * 8 * (_NPCM - 1))) - 1) +#if PAGE_SIZE == 8192 static const u_long pc_freemask[_NPCM] = { - PC_FREE0_4, PC_FREE0_4, PC_FREE0_4, - PC_FREE0_4, PC_FREE0_4, PC_FREE5 + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_PARTIAL }; +#elif PAGE_SIZE == 16384 +static const u_long pc_freemask[_NPCM] = { + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_PARTIAL +}; +#endif static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); Modified: user/andre/tcp_workqueue/sys/ia64/include/pmap.h ============================================================================== --- user/andre/tcp_workqueue/sys/ia64/include/pmap.h Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/ia64/include/pmap.h Sun Oct 28 20:14:21 2012 (r242269) @@ -105,21 +105,6 @@ typedef struct pv_entry { TAILQ_ENTRY(pv_entry) pv_list; } *pv_entry_t; -/* - * pv_entries are allocated in chunks per-process. This avoids the - * need to track per-pmap assignments. - */ -#define _NPCM 6 -#define _NPCPV 337 -struct pv_chunk { - pmap_t pc_pmap; - TAILQ_ENTRY(pv_chunk) pc_list; - u_long pc_map[_NPCM]; /* bitmap; 1 = free */ - TAILQ_ENTRY(pv_chunk) pc_lru; - u_long pc_spare[2]; - struct pv_entry pc_pventry[_NPCPV]; -}; - #ifdef _KERNEL extern vm_paddr_t phys_avail[]; Modified: user/andre/tcp_workqueue/sys/kern/kern_umtx.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_umtx.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/kern/kern_umtx.c Sun Oct 28 20:14:21 2012 (r242269) @@ -3291,8 +3291,8 @@ freebsd32_umtx_unlock(struct thread *td, } struct timespec32 { - uint32_t tv_sec; - uint32_t tv_nsec; + int32_t tv_sec; + int32_t tv_nsec; }; struct umtx_time32 { Modified: user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c Sun Oct 28 20:14:21 2012 (r242269) @@ -1584,7 +1584,7 @@ again: n = m->m_next; if (n == NULL) break; - if (!M_WRITABLE(m) && + if (M_WRITABLE(m) && n->m_len < M_TRAILINGSPACE(m)) { bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, n->m_len); Modified: user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c Sun Oct 28 20:14:21 2012 (r242269) @@ -280,6 +280,7 @@ static void cf_outb_8(int port, uint8_t if (bus_type == CF_8) { volatile uint8_t *task_file = (volatile uint8_t *)base_addr; task_file[port] = val; + return; } /* Modified: user/andre/tcp_workqueue/sys/mips/mips/pmap.c ============================================================================== --- user/andre/tcp_workqueue/sys/mips/mips/pmap.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/mips/mips/pmap.c Sun Oct 28 20:14:21 2012 (r242269) @@ -1440,7 +1440,6 @@ pmap_pv_reclaim(pmap_t locked_pmap) *pte = PTE_G; else *pte = 0; - pmap_invalidate_page(pmap, va); m = PHYS_TO_VM_PAGE(TLBLO_PTE_TO_PA(oldpte)); if (pte_test(&oldpte, PTE_D)) vm_page_dirty(m); Modified: user/andre/tcp_workqueue/sys/modules/Makefile ============================================================================== --- user/andre/tcp_workqueue/sys/modules/Makefile Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/modules/Makefile Sun Oct 28 20:14:21 2012 (r242269) @@ -783,6 +783,7 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq +_drm= drm _exca= exca _nvram= powermac_nvram _pccard= pccard Modified: user/andre/tcp_workqueue/sys/modules/drm/r128/Makefile ============================================================================== --- user/andre/tcp_workqueue/sys/modules/drm/r128/Makefile Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/modules/drm/r128/Makefile Sun Oct 28 20:14:21 2012 (r242269) @@ -7,6 +7,6 @@ SRCS +=device_if.h bus_if.h pci_if.h opt .include -CWARNFLAGS.r128_cce.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.r128_state.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS.r128_cce.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.r128_state.c= -Wno-unused CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: user/andre/tcp_workqueue/sys/modules/drm/radeon/Makefile ============================================================================== --- user/andre/tcp_workqueue/sys/modules/drm/radeon/Makefile Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/modules/drm/radeon/Makefile Sun Oct 28 20:14:21 2012 (r242269) @@ -8,6 +8,6 @@ SRCS +=device_if.h bus_if.h pci_if.h opt .include -CWARNFLAGS.r600_cp.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.radeon_cp.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.r600_cp.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.radeon_cp.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: user/andre/tcp_workqueue/sys/modules/drm/via/Makefile ============================================================================== --- user/andre/tcp_workqueue/sys/modules/drm/via/Makefile Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/modules/drm/via/Makefile Sun Oct 28 20:14:21 2012 (r242269) @@ -10,7 +10,8 @@ SRCS += device_if.h bus_if.h pci_if.h op DRM_DEBUG_OPT= "\#define DRM_DEBUG 1" .endif -.if !defined(DRM_NOLINUX) +.if !defined(DRM_NOLINUX) && \ + (${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64") DRM_LINUX_OPT= "\#define DRM_LINUX 1" .endif @@ -21,6 +22,6 @@ opt_drm.h: .include -CWARNFLAGS.via_dma.c= ${NO_WUNUSED_VALUE} -CWARNFLAGS.via_dmablit.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS.via_dma.c= -Wno-unused-value +CWARNFLAGS.via_dmablit.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: user/andre/tcp_workqueue/sys/net/if_bridge.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/if_bridge.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/net/if_bridge.c Sun Oct 28 20:14:21 2012 (r242269) @@ -3379,8 +3379,8 @@ bridge_fragment(struct ifnet *ifp, struc goto out; ip = mtod(m, struct ip *); - error = ip_fragment(ip, &m, ifp->if_mtu, ifp->if_hwassist, - CSUM_DELAY_IP); + m->m_pkthdr.csum_flags |= CSUM_IP; + error = ip_fragment(ip, &m, ifp->if_mtu, ifp->if_hwassist); if (error) goto out; Modified: user/andre/tcp_workqueue/sys/net80211/ieee80211_freebsd.c ============================================================================== --- user/andre/tcp_workqueue/sys/net80211/ieee80211_freebsd.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/net80211/ieee80211_freebsd.c Sun Oct 28 20:14:21 2012 (r242269) @@ -65,9 +65,10 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, C static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state"); +#if __FreeBSD_version >= 1000020 static const char wlanname[] = "wlan"; - static struct if_clone *wlan_cloner; +#endif /* * Allocate/free com structure in conjunction with ifnet; @@ -133,10 +134,19 @@ wlan_clone_create(struct if_clone *ifc, if_printf(ifp, "TDMA not supported\n"); return EOPNOTSUPP; } +#if __FreeBSD_version >= 1000020 vap = ic->ic_vap_create(ic, wlanname, unit, cp.icp_opmode, cp.icp_flags, cp.icp_bssid, cp.icp_flags & IEEE80211_CLONE_MACADDR ? cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp)); +#else + vap = ic->ic_vap_create(ic, ifc->ifc_name, unit, + cp.icp_opmode, cp.icp_flags, cp.icp_bssid, + cp.icp_flags & IEEE80211_CLONE_MACADDR ? + cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp)); + +#endif + return (vap == NULL ? EIO : 0); } @@ -149,11 +159,19 @@ wlan_clone_destroy(struct ifnet *ifp) ic->ic_vap_delete(vap); } +#if __FreeBSD_version < 1000020 +IFC_SIMPLE_DECLARE(wlan, 0); +#endif + void ieee80211_vap_destroy(struct ieee80211vap *vap) { CURVNET_SET(vap->iv_ifp->if_vnet); +#if __FreeBSD_version >= 1000020 if_clone_destroyif(wlan_cloner, vap->iv_ifp); +#else + if_clone_destroyif(&wlan_cloner, vap->iv_ifp); +#endif CURVNET_RESTORE(); } @@ -811,13 +829,21 @@ wlan_modevent(module_t mod, int type, vo EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent); return ENOMEM; } +#if __FreeBSD_version >= 1000020 wlan_cloner = if_clone_simple(wlanname, wlan_clone_create, wlan_clone_destroy, 0); +#else + if_clone_attach(&wlan_cloner); +#endif if_register_com_alloc(IFT_IEEE80211, wlan_alloc, wlan_free); return 0; case MOD_UNLOAD: if_deregister_com_alloc(IFT_IEEE80211); +#if __FreeBSD_version >= 1000020 if_clone_detach(wlan_cloner); +#else + if_clone_detach(&wlan_cloner); +#endif EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent); EVENTHANDLER_DEREGISTER(iflladdr_event, wlan_ifllevent); return 0; @@ -826,7 +852,11 @@ wlan_modevent(module_t mod, int type, vo } static moduledata_t wlan_mod = { +#if __FreeBSD_version >= 1000020 wlanname, +#else + "wlan", +#endif wlan_modevent, 0 }; Modified: user/andre/tcp_workqueue/sys/net80211/ieee80211_ht.c ============================================================================== --- user/andre/tcp_workqueue/sys/net80211/ieee80211_ht.c Sun Oct 28 20:03:57 2012 (r242268) +++ user/andre/tcp_workqueue/sys/net80211/ieee80211_ht.c Sun Oct 28 20:14:21 2012 (r242269) @@ -1025,12 +1025,21 @@ ieee80211_ht_node_init(struct ieee80211_ struct ieee80211_tx_ampdu *tap; int tid; + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: called", + __func__); + if (ni->ni_flags & IEEE80211_NODE_HT) { /* * Clean AMPDU state on re-associate. This handles the case * where a station leaves w/o notifying us and then returns * before node is reaped for inactivity. */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: calling cleanup", + __func__); ieee80211_ht_node_cleanup(ni); } for (tid = 0; tid < WME_NUM_TID; tid++) { @@ -1052,6 +1061,11 @@ ieee80211_ht_node_cleanup(struct ieee802 struct ieee80211com *ic = ni->ni_ic; int i; + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: called", + __func__); + KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node")); /* XXX optimize this */ @@ -1684,6 +1698,11 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu struct ieee80211_node *ni = tap->txa_ni; struct ieee80211com *ic = ni->ni_ic; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 21:20:23 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 5A6361EE for ; Sun, 28 Oct 2012 21:20:23 +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 917018FC17 for ; Sun, 28 Oct 2012 21:20:22 +0000 (UTC) Received: (qmail 92856 invoked from network); 28 Oct 2012 22:57:24 -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 ; 28 Oct 2012 22:57:24 -0000 Message-ID: <508DA194.6060807@freebsd.org> Date: Sun, 28 Oct 2012 22:20:20 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 21:20:23 -0000 On 28.10.2012 18:42, Attilio Rao wrote: > On Sat, Oct 27, 2012 at 5:27 PM, Attilio Rao wrote: >> Here we go with further comments tweaks. >> Also, in order to make it a complete NOP from KPI perspective I had to >> change the way the mtx_assert() wrapper was implemented as in v1 it >> wasn't correctly handling the const qualifier. >> I think the result is better now and you should refer to this patch for reviews: >> http://www.freebsd.org/~attilio/mtx_decoupled2.patch Thank you for the updated patch. If the others more versed in this area are happy with it I'm not objecting. > BTW, the mtx_sysuninit() introduction can be avoided by using this other trick: > #define MTX_SYSINIT(name, mtx, desc, opts) \ > static struct mtx_args name##_args = { \ > (mtx), \ > (desc), \ > (opts) \ > }; \ > SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ > mtx_sysinit, &name##_args); \ > SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ > _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) > > I'm just not sure that I would like the use of __DEVOLATILE() even if > it would help in this case when introducing MTX_SYSINIT_UNSHARE() > because we will just need to reuse the same code. I'm not really happy about the _unshare naming. Something like _aligned or _cachline would be much more obvious on what it does. > Also, the more I think about this the more I feel convinced that > mtxlock2mtx() should be static in kern_mutex.c. I can simply add a > note to _mutex.h as a reminder for it. Agreed. -- Andre From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 21:32:22 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 CBBE2ADA; Sun, 28 Oct 2012 21:32:22 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3548FC08; Sun, 28 Oct 2012 21:32:21 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so3389745lbd.13 for ; Sun, 28 Oct 2012 14:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=mcsMZNKQPIg2Bno4LoLmqUsoiwjct8DSCzRwBsgI0+I=; b=n3tjnoGsqhk2P8T6/w9SkL/U6E6LDj3W+C6nlQQbeJiQfUzT+cyBQqJELlBgTbAO+3 gdnJJ4VImjQshuiZebHpLQzZVZjskIfhR04H9nqSmINpmCbxmlcP5TS7zKp1DqyNXYC0 zzBwiwVBTyJ/0/fCGYKWEt9pe+ew6RC5K4QviCvR42KoA6qsJgwa+1ooizkZmxjWGNyW P5PoCG1HOoM8I/P0Ky/+9/HO5ZpBH4foZiaTxVE415g2tKdfx3iGUi5YfbCf3EtmCHYn WADVemiEegaOCjL6/rphSnFLD4ZJDK4uFboZ0jgGV7wKYXQHZrv5pNOwCjN6THWcCebD DMCg== MIME-Version: 1.0 Received: by 10.112.41.36 with SMTP id c4mr10571060lbl.75.1351459939991; Sun, 28 Oct 2012 14:32:19 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Sun, 28 Oct 2012 14:32:19 -0700 (PDT) In-Reply-To: <508DA194.6060807@freebsd.org> References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> <508DA194.6060807@freebsd.org> Date: Sun, 28 Oct 2012 21:32:19 +0000 X-Google-Sender-Auth: bIqqyBpklJ9b8zH3UTuoHsal2bQ Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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, 28 Oct 2012 21:32:23 -0000 On Sun, Oct 28, 2012 at 9:20 PM, Andre Oppermann wrote: > On 28.10.2012 18:42, Attilio Rao wrote: >> >> On Sat, Oct 27, 2012 at 5:27 PM, Attilio Rao wrote: >>> >>> Here we go with further comments tweaks. >>> Also, in order to make it a complete NOP from KPI perspective I had to >>> change the way the mtx_assert() wrapper was implemented as in v1 it >>> wasn't correctly handling the const qualifier. >>> I think the result is better now and you should refer to this patch for >>> reviews: >>> http://www.freebsd.org/~attilio/mtx_decoupled2.patch > > > Thank you for the updated patch. If the others more versed in this > area are happy with it I'm not objecting. > > >> BTW, the mtx_sysuninit() introduction can be avoided by using this other >> trick: >> #define MTX_SYSINIT(name, mtx, desc, opts) \ >> static struct mtx_args name##_args = { \ >> (mtx), \ >> (desc), \ >> (opts) \ >> }; \ >> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >> mtx_sysinit, &name##_args); \ >> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >> >> I'm just not sure that I would like the use of __DEVOLATILE() even if >> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >> because we will just need to reuse the same code. > > > I'm not really happy about the _unshare naming. Something like > _aligned or _cachline would be much more obvious on what it does. I agree. Infact if we want to apply this to ie. sx locks too _unshared will generate too much confusion (as already reported by Jeff too). I'd say _aligned is good to go. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Sun Oct 28 21:49:22 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 4424695E for ; Sun, 28 Oct 2012 21:49:22 +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 778BC8FC15 for ; Sun, 28 Oct 2012 21:49:21 +0000 (UTC) Received: (qmail 93011 invoked from network); 28 Oct 2012 23:26:22 -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 ; 28 Oct 2012 23:26:22 -0000 Message-ID: <508DA85F.3090503@freebsd.org> Date: Sun, 28 Oct 2012 22:49:19 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> <508DA194.6060807@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 28 Oct 2012 21:49:22 -0000 On 28.10.2012 22:32, Attilio Rao wrote: > On Sun, Oct 28, 2012 at 9:20 PM, Andre Oppermann wrote: >> On 28.10.2012 18:42, Attilio Rao wrote: >>> >>> On Sat, Oct 27, 2012 at 5:27 PM, Attilio Rao wrote: >>>> >>>> Here we go with further comments tweaks. >>>> Also, in order to make it a complete NOP from KPI perspective I had to >>>> change the way the mtx_assert() wrapper was implemented as in v1 it >>>> wasn't correctly handling the const qualifier. >>>> I think the result is better now and you should refer to this patch for >>>> reviews: >>>> http://www.freebsd.org/~attilio/mtx_decoupled2.patch >> >> >> Thank you for the updated patch. If the others more versed in this >> area are happy with it I'm not objecting. >> >> >>> BTW, the mtx_sysuninit() introduction can be avoided by using this other >>> trick: >>> #define MTX_SYSINIT(name, mtx, desc, opts) \ >>> static struct mtx_args name##_args = { \ >>> (mtx), \ >>> (desc), \ >>> (opts) \ >>> }; \ >>> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >>> mtx_sysinit, &name##_args); \ >>> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >>> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >>> >>> I'm just not sure that I would like the use of __DEVOLATILE() even if >>> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >>> because we will just need to reuse the same code. >> >> >> I'm not really happy about the _unshare naming. Something like >> _aligned or _cachline would be much more obvious on what it does. > > I agree. Infact if we want to apply this to ie. sx locks too _unshared > will generate too much confusion (as already reported by Jeff too). > I'd say _aligned is good to go. _aligned can be slightly confusing too for someone not aware of the differences of alignment (begin of structure aligned) and the additional padding to a cache line. So _cacheline is probably more expressive and spells out what the real purpose is. -- Andre From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 12:16: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 27DF2B9B; Mon, 29 Oct 2012 12:16:20 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0595A8FC08; Mon, 29 Oct 2012 12:16: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 q9TCGJeP058675; Mon, 29 Oct 2012 12:16:19 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TCGJLP058673; Mon, 29 Oct 2012 12:16:19 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201210291216.q9TCGJLP058673@svn.freebsd.org> From: Peter Holm Date: Mon, 29 Oct 2012 12:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242307 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 12:16:20 -0000 Author: pho Date: Mon Oct 29 12:16:19 2012 New Revision: 242307 URL: http://svn.freebsd.org/changeset/base/242307 Log: Added two Fuse / NTFS test scenarios. Added: user/pho/stress2/misc/fuse.sh (contents, props changed) user/pho/stress2/misc/fuse2.sh (contents, props changed) Added: user/pho/stress2/misc/fuse.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/fuse.sh Mon Oct 29 12:16:19 2012 (r242307) @@ -0,0 +1,58 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# 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. +# +# $FreeBSD$ +# + +# General Fuse test scenario + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +[ -c /dev/fuse ] || kldload fuse.ko + +MOUNT=/usr/local/bin/ntfs-3g + +mount | grep -q "$mntpoint" && umount $mntpoint +mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 1g -u $mdstart +mkntfs -Ff /dev/md${mdstart} > /dev/null 2>&1 || exit 1 + +$MOUNT /dev/md${mdstart} $mntpoint || exit 1 + +export RUNDIR=$mntpoint/stressX +export runRUNTIME=20m +(cd ..; ./run.sh marcus.cfg) +rm -rf $RUNDIR + +for i in `jot 10`; do + umount $mntpoint || sleep 2 + mount | grep -q $mntpoint || break +done +mdconfig -d -u $mdstart Added: user/pho/stress2/misc/fuse2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/fuse2.sh Mon Oct 29 12:16:19 2012 (r242307) @@ -0,0 +1,93 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# 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. +# +# $FreeBSD$ +# + +# Parallel mount and umount test +# livelock seen + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +[ -c /dev/fuse ] || kldload fuse.ko + +. ../default.cfg + +[ -c /dev/fuse ] || kldload fuse.ko +MOUNT=/usr/local/bin/ntfs-3g +mounts=15 # Number of parallel scripts +mdstart=$mdstart # Use md unit numbers from this point + +if [ $# -eq 0 ]; then + for i in `jot $mounts`; do + m=$(( i + mdstart - 1 )) + [ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m + mount | grep "$mntpoint" | grep -q md$m && umount ${mntpoint}$m + mdconfig -l | grep -q md$m && mdconfig -d -u $m + + mdconfig -a -t swap -s 1g -u $m + mkntfs -Ff /dev/md$m > /dev/null 2>&1 || exit 1 + + done + + # start the parallel tests + for i in `jot $mounts`; do + m=$(( i + mdstart - 1 )) + ./$0 $m & + ./$0 find & + done + + for i in `jot $mounts`; do + wait; wait + done + + for i in `jot $mounts`; do + m=$(( i + mdstart - 1 )) + mdconfig -d -u $m + done + +else + if [ $1 = find ]; then + while mount | grep -q fusefs; do + find ${mntpoint}* -type f > /dev/null 2>&1 + sleep 1 + done + else + + # The test: Parallel mount and unmounts + for i in `jot 100`; do + m=$1 + $MOUNT /dev/md$m ${mntpoint}$m || continue + cp -r /usr/include/sys ${mntpoint}$m/file.$m 2>/dev/null + sleep .5 + while mount | grep -q ${mntpoint}$m; do + umount ${mntpoint}$m > /dev/null 2>&1 || + sleep 1 + done + done + fi +fi From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 13:49:07 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 7EFC1904; Mon, 29 Oct 2012 13:49:07 +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 657E88FC0A; Mon, 29 Oct 2012 13:49: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 q9TDn7Bc073330; Mon, 29 Oct 2012 13:49:07 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TDn6Fu073307; Mon, 29 Oct 2012 13:49:07 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291349.q9TDn6Fu073307@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 13:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242312 - in user/andre/tcp_workqueue/sys: contrib/octeon-sdk dev/acpi_support dev/ath dev/mii kern mips/cavium netinet sys vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 13:49:07 -0000 Author: andre Date: Mon Oct 29 13:49:06 2012 New Revision: 242312 URL: http://svn.freebsd.org/changeset/base/242312 Log: Integrate from HEAD @242311. Modified: user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-ebt3000.c user/andre/tcp_workqueue/sys/dev/acpi_support/acpi_ibm.c user/andre/tcp_workqueue/sys/dev/ath/if_ath.c user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.h user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h user/andre/tcp_workqueue/sys/dev/mii/e1000phy.c user/andre/tcp_workqueue/sys/kern/kern_mbuf.c user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1 user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h user/andre/tcp_workqueue/sys/mips/cavium/uart_dev_oct16550.c user/andre/tcp_workqueue/sys/netinet/tcp_output.c user/andre/tcp_workqueue/sys/netinet/tcp_timer.h user/andre/tcp_workqueue/sys/sys/sched.h user/andre/tcp_workqueue/sys/vm/vm_page.c user/andre/tcp_workqueue/sys/vm/vm_page.h user/andre/tcp_workqueue/sys/vm/vm_pageout.c Directory Properties: user/andre/tcp_workqueue/sys/ (props changed) user/andre/tcp_workqueue/sys/contrib/octeon-sdk/ (props changed) Modified: user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-ebt3000.c ============================================================================== --- user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-ebt3000.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-ebt3000.c Mon Oct 29 13:49:06 2012 (r242312) @@ -52,15 +52,18 @@ * */ +#if !defined(__FreeBSD__) || !defined(_KERNEL) #include "cvmx-config.h" +#endif #include "cvmx.h" +#include "cvmx-ebt3000.h" #include "cvmx-sysinfo.h" void ebt3000_char_write(int char_position, char val) { /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ - void *led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); + char *led_base = CASTPTR(char , CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); if (!led_base) return; if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) @@ -82,10 +85,10 @@ void ebt3000_char_write(int char_positio void ebt3000_str_write(const char *str) { /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ - void *led_base; + char *led_base; if (!cvmx_sysinfo_get()->led_display_base_addr) return; - led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); + led_base = CASTPTR(char, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) { char *ptr = (char *)(led_base + 4); Modified: user/andre/tcp_workqueue/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/acpi_support/acpi_ibm.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/acpi_support/acpi_ibm.c Mon Oct 29 13:49:06 2012 (r242312) @@ -317,7 +317,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", "LEN0068", NULL}; static void ibm_led(void *softc, int onoff) Modified: user/andre/tcp_workqueue/sys/dev/ath/if_ath.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_ath.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/ath/if_ath.c Mon Oct 29 13:49:06 2012 (r242312) @@ -201,6 +201,7 @@ static void ath_announce(struct ath_soft static void ath_dfs_tasklet(void *, int); static void ath_node_powersave(struct ieee80211_node *, int); +static int ath_node_set_tim(struct ieee80211_node *, int); #ifdef IEEE80211_SUPPORT_TDMA #include @@ -1152,6 +1153,9 @@ ath_vap_create(struct ieee80211com *ic, avp->av_node_ps = vap->iv_node_ps; vap->iv_node_ps = ath_node_powersave; + avp->av_set_tim = vap->iv_set_tim; + vap->iv_set_tim = ath_node_set_tim; + /* Set default parameters */ /* @@ -2558,6 +2562,12 @@ ath_start(struct ifnet *ifp) ieee80211_free_node(ni); continue; } + + /* + * Check here if the node is in power save state. + */ + ath_tx_update_tim(sc, ni, 1); + if (next != NULL) { /* * Beware of state changing between frags. @@ -3536,6 +3546,24 @@ ath_tx_default_comp(struct ath_softc *sc SEQNO(bf->bf_state.bfs_seqno)); /* + * Check if the node software queue is empty; if so + * then clear the TIM. + * + * This needs to be done before the buffer is freed as + * otherwise the node reference will have been released + * and the node may not actually exist any longer. + * + * XXX I don't like this belonging here, but it's cleaner + * to do it here right now then all the other places + * where ath_tx_default_comp() is called. + * + * XXX TODO: during drain, ensure that the callback is + * being called so we get a chance to update the TIM. + */ + if (bf->bf_node) + ath_tx_update_tim(sc, bf->bf_node, 0); + + /* * Do any tx complete callback. Note this must * be done before releasing the node reference. * This will free the mbuf, release the net80211 @@ -3559,6 +3587,7 @@ ath_tx_update_ratectrl(struct ath_softc return; an = ATH_NODE(ni); + ATH_NODE_UNLOCK_ASSERT(an); if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); @@ -3754,6 +3783,8 @@ ath_tx_processq(struct ath_softc *sc, st * Update statistics and call completion */ ath_tx_process_buf_completion(sc, txq, ts, bf); + + /* XXX at this point, bf and ni may be totally invalid */ } #ifdef IEEE80211_SUPPORT_SUPERG /* @@ -5397,6 +5428,219 @@ ath_node_powersave(struct ieee80211_node avp->av_node_ps(ni, enable); } +/* + * Notification from net80211 that the powersave queue state has + * changed. + * + * Since the software queue also may have some frames: + * + * + if the node software queue has frames and the TID state + * is 0, we set the TIM; + * + if the node and the stack are both empty, we clear the TIM bit. + * + If the stack tries to set the bit, always set it. + * + If the stack tries to clear the bit, only clear it if the + * software queue in question is also cleared. + * + * TODO: this is called during node teardown; so let's ensure this + * is all correctly handled and that the TIM bit is cleared. + * It may be that the node flush is called _AFTER_ the net80211 + * stack clears the TIM. + * + * Here is the racy part. Since it's possible >1 concurrent, + * overlapping TXes will appear complete with a TX completion in + * another thread, it's possible that the concurrent TIM calls will + * clash. We can't hold the node lock here because setting the + * TIM grabs the net80211 comlock and this may cause a LOR. + * The solution is either to totally serialise _everything_ at + * this point (ie, all TX, completion and any reset/flush go into + * one taskqueue) or a new "ath TIM lock" needs to be created that + * just wraps the driver state change and this call to avp->av_set_tim(). + * + * The same race exists in the net80211 power save queue handling + * as well. Since multiple transmitting threads may queue frames + * into the driver, as well as ps-poll and the driver transmitting + * frames (and thus clearing the psq), it's quite possible that + * a packet entering the PSQ and a ps-poll being handled will + * race, causing the TIM to be cleared and not re-set. + */ +static int +ath_node_set_tim(struct ieee80211_node *ni, int enable) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_node *an = ATH_NODE(ni); + struct ath_vap *avp = ATH_VAP(ni->ni_vap); + int changed = 0; + + ATH_NODE_UNLOCK_ASSERT(an); + + /* + * For now, just track and then update the TIM. + */ + ATH_NODE_LOCK(an); + an->an_stack_psq = enable; + + /* + * This will get called for all operating modes, + * even if avp->av_set_tim is unset. + * It's currently set for hostap/ibss modes; but + * the same infrastructure is used for both STA + * and AP/IBSS node power save. + */ + if (avp->av_set_tim == NULL) { + ATH_NODE_UNLOCK(an); + return (0); + } + + /* + * If setting the bit, always set it here. + * If clearing the bit, only clear it if the + * software queue is also empty. + * + * If the node has left power save, just clear the TIM + * bit regardless of the state of the power save queue. + * + * XXX TODO: although atomics are used, it's quite possible + * that a race will occur between this and setting/clearing + * in another thread. TX completion will occur always in + * one thread, however setting/clearing the TIM bit can come + * from a variety of different process contexts! + */ + if (enable && an->an_tim_set == 1) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, tim_set=1, ignoring\n", + __func__, an, enable); + ATH_NODE_UNLOCK(an); + } else if (enable) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, enabling TIM\n", + __func__, an, enable); + an->an_tim_set = 1; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else if (atomic_load_acq_int(&an->an_swq_depth) == 0) { + /* disable */ + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n", + __func__, an, enable); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else if (! an->an_is_powersave) { + /* + * disable regardless; the node isn't in powersave now + */ + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, an_pwrsave=0, disabling\n", + __func__, an, enable); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else { + /* + * psq disable, node is currently in powersave, node + * software queue isn't empty, so don't clear the TIM bit + * for now. + */ + ATH_NODE_UNLOCK(an); + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: enable=%d, an_swq_depth > 0, ignoring\n", + __func__, enable); + changed = 0; + } + + return (changed); +} + +/* + * Set or update the TIM from the software queue. + * + * Check the software queue depth before attempting to do lock + * anything; that avoids trying to obtain the lock. Then, + * re-check afterwards to ensure nothing has changed in the + * meantime. + * + * set: This is designed to be called from the TX path, after + * a frame has been queued; to see if the swq > 0. + * + * clear: This is designed to be called from the buffer completion point + * (right now it's ath_tx_default_comp()) where the state of + * a software queue has changed. + * + * It makes sense to place it at buffer free / completion rather + * than after each software queue operation, as there's no real + * point in churning the TIM bit as the last frames in the software + * queue are transmitted. If they fail and we retry them, we'd + * just be setting the TIM bit again anyway. + */ +void +ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, + int enable) +{ + struct ath_node *an; + struct ath_vap *avp; + + /* Don't do this for broadcast/etc frames */ + if (ni == NULL) + return; + + an = ATH_NODE(ni); + avp = ATH_VAP(ni->ni_vap); + + /* + * And for operating modes without the TIM handler set, let's + * just skip those. + */ + if (avp->av_set_tim == NULL) + return; + + ATH_NODE_UNLOCK_ASSERT(an); + + if (enable) { + /* + * Don't bother grabbing the lock unless the queue is not + * empty. + */ + if (atomic_load_acq_int(&an->an_swq_depth) == 0) + return; + + ATH_NODE_LOCK(an); + if (an->an_is_powersave && + an->an_tim_set == 0 && + atomic_load_acq_int(&an->an_swq_depth) != 0) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, swq_depth>0, tim_set=0, set!\n", + __func__, an); + an->an_tim_set = 1; + ATH_NODE_UNLOCK(an); + (void) avp->av_set_tim(ni, 1); + } else { + ATH_NODE_UNLOCK(an); + } + } else { + /* + * Don't bother grabbing the lock unless the queue is empty. + */ + if (atomic_load_acq_int(&an->an_swq_depth) != 0) + return; + + ATH_NODE_LOCK(an); + if (an->an_is_powersave && + an->an_stack_psq == 0 && + an->an_tim_set == 1 && + atomic_load_acq_int(&an->an_swq_depth) == 0) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, swq_depth=0, tim_set=1, psq_set=0," + " clear!\n", + __func__, an); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + (void) avp->av_set_tim(ni, 0); + } else { + ATH_NODE_UNLOCK(an); + } + } +} MODULE_VERSION(if_ath, 1); MODULE_DEPEND(if_ath, wlan, 1, 1, 1); /* 802.11 media layer */ Modified: user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h Mon Oct 29 13:49:06 2012 (r242312) @@ -107,6 +107,9 @@ extern void ath_tx_process_buf_completio extern int ath_stoptxdma(struct ath_softc *sc); +extern void ath_tx_update_tim(struct ath_softc *sc, + struct ieee80211_node *ni, int enable); + /* * This is only here so that the RX proc function can call it. * It's very likely that the "start TX after RX" call should be Modified: user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c Mon Oct 29 13:49:06 2012 (r242312) @@ -2219,6 +2219,13 @@ ath_raw_xmit(struct ieee80211_node *ni, ifp->if_opackets++; sc->sc_stats.ast_tx_raw++; + /* + * Update the TIM - if there's anything queued to the + * software queue and power save is enabled, we should + * set the TIM. + */ + ath_tx_update_tim(sc, ni, 1); + ATH_PCU_LOCK(sc); sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); @@ -5292,11 +5299,10 @@ ath_addba_response_timeout(struct ieee80 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } -#if 0 /* * Check if a node is asleep or not. */ -static int +int ath_tx_node_is_asleep(struct ath_softc *sc, struct ath_node *an) { @@ -5304,7 +5310,6 @@ ath_tx_node_is_asleep(struct ath_softc * return (an->an_is_powersave); } -#endif /* * Mark a node as currently "in powersaving." Modified: user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.h ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.h Mon Oct 29 13:49:06 2012 (r242312) @@ -128,6 +128,7 @@ extern void ath_addba_response_timeout(s */ extern void ath_tx_node_sleep(struct ath_softc *sc, struct ath_node *an); extern void ath_tx_node_wakeup(struct ath_softc *sc, struct ath_node *an); +extern int ath_tx_node_is_asleep(struct ath_softc *sc, struct ath_node *an); /* * Setup path Modified: user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h Mon Oct 29 13:49:06 2012 (r242312) @@ -173,6 +173,8 @@ struct ath_node { u_int8_t an_mgmtrix; /* min h/w rate index */ u_int8_t an_mcastrix; /* mcast h/w rate index */ uint32_t an_is_powersave; /* node is sleeping */ + uint32_t an_stack_psq; /* net80211 psq isn't empty */ + uint32_t an_tim_set; /* TIM has been set */ struct ath_buf *an_ff_buf[WME_NUM_AC]; /* ff staging area */ struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */ char an_name[32]; /* eg "wlan0_a1" */ @@ -432,6 +434,7 @@ struct ath_vap { enum ieee80211_state, int); void (*av_bmiss)(struct ieee80211vap *); void (*av_node_ps)(struct ieee80211_node *, int); + int (*av_set_tim)(struct ieee80211_node *, int); }; #define ATH_VAP(vap) ((struct ath_vap *)(vap)) Modified: user/andre/tcp_workqueue/sys/dev/mii/e1000phy.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/mii/e1000phy.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/dev/mii/e1000phy.c Mon Oct 29 13:49:06 2012 (r242312) @@ -108,6 +108,7 @@ static const struct mii_phydesc e1000phy MII_PHY_DESC(xxMARVELL, E1116R), MII_PHY_DESC(xxMARVELL, E1116R_29), MII_PHY_DESC(xxMARVELL, E1118), + MII_PHY_DESC(xxMARVELL, E1145), MII_PHY_DESC(xxMARVELL, E1149R), MII_PHY_DESC(xxMARVELL, E3016), MII_PHY_DESC(xxMARVELL, PHYG65G), Modified: user/andre/tcp_workqueue/sys/kern/kern_mbuf.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/kern_mbuf.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/kern/kern_mbuf.c Mon Oct 29 13:49:06 2012 (r242312) @@ -244,7 +244,7 @@ static void mb_reclaim(void *); static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); -/* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */ +/* Ensure that MSIZE must be a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); /* Modified: user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c ============================================================================== --- user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/kern/uipc_mbuf.c Mon Oct 29 13:49:06 2012 (r242312) @@ -1000,8 +1000,8 @@ m_adj(struct mbuf *mp, int req_len) /* * Rearange an mbuf chain so that len bytes are contiguous - * and in the data area of an mbuf (so that mtod and dtom - * will work for a structure of size len). Returns the resulting + * and in the data area of an mbuf (so that mtod will work + * for a structure of size len). Returns the resulting * mbuf chain on success, frees it and returns null on failure. * If there is room, it will add up to max_protohdr-len extra bytes to the * contiguous region in an attempt to avoid being called next time. Modified: user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1 ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1 Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1 Mon Oct 29 13:49:06 2012 (r242312) @@ -58,6 +58,7 @@ mips/cavium/octeon_gpio.c optional gpi contrib/octeon-sdk/cvmx-cmd-queue.c standard contrib/octeon-sdk/cvmx-bootmem.c standard contrib/octeon-sdk/cvmx-clock.c standard +contrib/octeon-sdk/cvmx-ebt3000.c standard contrib/octeon-sdk/cvmx-fpa.c standard contrib/octeon-sdk/cvmx-helper.c standard contrib/octeon-sdk/cvmx-helper-board.c standard Modified: user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c Mon Oct 29 13:49:06 2012 (r242312) @@ -326,15 +326,10 @@ static int cf_cmd_read (uint32_t nr_sect uint8_t *ptr_8; int error; -//#define OCTEON_VISUAL_CF_0 1 -#ifdef OCTEON_VISUAL_CF_0 - octeon_led_write_char(0, 'R'); -#endif ptr_8 = (uint8_t*)buf; ptr_16 = (uint16_t*)buf; lba = start_sector; - while (nr_sectors--) { error = cf_send_cmd(lba, CMD_READ_SECTOR); if (error != 0) { @@ -366,9 +361,6 @@ static int cf_cmd_read (uint32_t nr_sect lba++; } -#ifdef OCTEON_VISUAL_CF_0 - octeon_led_write_char(0, ' '); -#endif return (0); } @@ -387,10 +379,6 @@ static int cf_cmd_write (uint32_t nr_sec uint8_t *ptr_8; int error; -//#define OCTEON_VISUAL_CF_1 1 -#ifdef OCTEON_VISUAL_CF_1 - octeon_led_write_char(1, 'W'); -#endif lba = start_sector; ptr_8 = (uint8_t*)buf; ptr_16 = (uint16_t*)buf; @@ -425,9 +413,6 @@ static int cf_cmd_write (uint32_t nr_sec lba++; } -#ifdef OCTEON_VISUAL_CF_1 - octeon_led_write_char(1, ' '); -#endif return (0); } @@ -543,13 +528,6 @@ static int cf_wait_busy (void) { uint8_t status; -//#define OCTEON_VISUAL_CF_2 1 -#ifdef OCTEON_VISUAL_CF_2 - static int where0 = 0; - - octeon_led_run_wheel(&where0, 2); -#endif - switch (bus_type) { case CF_8: @@ -585,9 +563,6 @@ static int cf_wait_busy (void) return (ENXIO); } -#ifdef OCTEON_VISUAL_CF_2 - octeon_led_write_char(2, ' '); -#endif return (0); } Modified: user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c Mon Oct 29 13:49:06 2012 (r242312) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -159,88 +161,6 @@ platform_reset(void) cvmx_write_csr(CVMX_CIU_SOFT_RST, 1); } -void -octeon_led_write_char(int char_position, char val) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - - if (octeon_is_simulation()) - return; - - char_position &= 0x7; /* only 8 chars */ - ptr += char_position; - oct_write8_x8(ptr, val); -} - -void -octeon_led_write_char0(char val) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - - if (octeon_is_simulation()) - return; - oct_write8_x8(ptr, val); -} - -void -octeon_led_write_hexchar(int char_position, char hexval) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - char char1, char2; - - if (octeon_is_simulation()) - return; - - char1 = (hexval >> 4) & 0x0f; char1 = (char1 < 10)?char1+'0':char1+'7'; - char2 = (hexval & 0x0f); char2 = (char2 < 10)?char2+'0':char2+'7'; - char_position &= 0x7; /* only 8 chars */ - if (char_position > 6) - char_position = 6; - ptr += char_position; - oct_write8_x8(ptr, char1); - ptr++; - oct_write8_x8(ptr, char2); -} - -void -octeon_led_write_string(const char *str) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - int i; - - if (octeon_is_simulation()) - return; - - for (i=0; i<8; i++, ptr++) { - if (str && *str) - oct_write8_x8(ptr, *str++); - else - oct_write8_x8(ptr, ' '); - (void)cvmx_read_csr(CVMX_MIO_BOOT_BIST_STAT); - } -} - -static char progress[8] = { '-', '/', '|', '\\', '-', '/', '|', '\\'}; - -void -octeon_led_run_wheel(int *prog_count, int led_position) -{ - if (octeon_is_simulation()) - return; - octeon_led_write_char(led_position, progress[*prog_count]); - *prog_count += 1; - *prog_count &= 0x7; -} - -void -octeon_led_write_hex(uint32_t wl) -{ - char nbuf[80]; - - sprintf(nbuf, "%X", wl); - octeon_led_write_string(nbuf); -} - /* * octeon_debug_symbol * @@ -447,6 +367,46 @@ octeon_get_timecount(struct timecounter return ((unsigned)octeon_get_ticks()); } +static int +sysctl_machdep_led_display(SYSCTL_HANDLER_ARGS) +{ + size_t buflen; + char buf[9]; + int error; + + if (req->newptr == NULL) + return (EINVAL); + + if (cvmx_sysinfo_get()->led_display_base_addr == 0) + return (ENODEV); + + /* + * Revision 1.x of the EBT3000 only supports 4 characters, but + * other devices support 8. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && + cvmx_sysinfo_get()->board_rev_major == 1) + buflen = 4; + else + buflen = 8; + + if (req->newlen > buflen) + return (E2BIG); + + error = SYSCTL_IN(req, buf, req->newlen); + if (error != 0) + return (error); + + buf[req->newlen] = '\0'; + ebt3000_str_write(buf); + + return (0); +} + +SYSCTL_PROC(_machdep, OID_AUTO, led_display, CTLTYPE_STRING | CTLFLAG_WR, + NULL, 0, sysctl_machdep_led_display, "A", + "String to display on LED display"); + /** * version of printf that works better in exception context. * @@ -593,13 +553,19 @@ octeon_process_app_desc_ver_6(void) octeon_bootinfo->board_rev_major, octeon_bootinfo->board_rev_minor, octeon_bootinfo->eclock_hz); - memcpy(cvmx_sysinfo_get()->mac_addr_base, octeon_bootinfo->mac_addr_base, 6); + memcpy(cvmx_sysinfo_get()->mac_addr_base, + octeon_bootinfo->mac_addr_base, 6); cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; cvmx_sysinfo_get()->compact_flash_common_base_addr = octeon_bootinfo->compact_flash_common_base_addr; cvmx_sysinfo_get()->compact_flash_attribute_base_addr = octeon_bootinfo->compact_flash_attribute_base_addr; cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask; + cvmx_sysinfo_get()->led_display_base_addr = + octeon_bootinfo->led_display_base_addr; + memcpy(cvmx_sysinfo_get()->board_serial_number, + octeon_bootinfo->board_serial_number, + sizeof cvmx_sysinfo_get()->board_serial_number); } static void @@ -616,6 +582,18 @@ octeon_boot_params_init(register_t ptr) KASSERT(octeon_bootinfo != NULL, ("octeon_bootinfo should be set")); + if (cvmx_sysinfo_get()->led_display_base_addr != 0) { + /* + * Revision 1.x of the EBT3000 only supports 4 characters, but + * other devices support 8. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && + cvmx_sysinfo_get()->board_rev_major == 1) + ebt3000_str_write("FBSD"); + else + ebt3000_str_write("FreeBSD!"); + } + if (cvmx_sysinfo_get()->phy_mem_desc_addr == (uint64_t)0) panic("Your boot loader did not supply a memory descriptor."); cvmx_bootmem_init(cvmx_sysinfo_get()->phy_mem_desc_addr); @@ -656,5 +634,6 @@ octeon_boot_params_init(register_t ptr) #endif strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); printf("Model: %s\n", cpu_model); + printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number); } /* impEND: This stuff should move back into the Cavium SDK */ Modified: user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h Mon Oct 29 13:49:06 2012 (r242312) @@ -54,7 +54,6 @@ #if defined(__mips_n64) #define oct_write64(a, v) (*(volatile uint64_t *)(a) = (uint64_t)(v)) -#define oct_write8_x8(a, v) (*(volatile uint8_t *)(a) = (uint8_t)(v)) #define OCT_READ(n, t) \ static inline t oct_read ## n(uintptr_t a) \ @@ -63,9 +62,6 @@ static inline t oct_read ## n(uintptr_t return (*p); \ } -OCT_READ(8, uint8_t); -OCT_READ(16, uint16_t); -OCT_READ(32, uint32_t); OCT_READ(64, uint64_t); #elif defined(__mips_n32) || defined(__mips_o32) @@ -81,17 +77,6 @@ static inline void oct_write64 (uint64_t : "r"(val64), "r"(csr_addr)); } -static inline void oct_write8_x8 (uint64_t csr_addr, uint8_t val8) -{ - __asm __volatile ( - ".set push\n" - ".set mips64\n" - "sb %0, 0(%1)\n" - ".set pop\n" - : - : "r"(val8), "r"(csr_addr)); -} - #define OCT_READ(n, t, insn) \ static inline t oct_read ## n(uint64_t a) \ { \ @@ -107,9 +92,6 @@ static inline t oct_read ## n(uint64_t a return ((t)tmp); \ } -OCT_READ(8, uint8_t, "lb"); -OCT_READ(16, uint16_t, "lh"); -OCT_READ(32, uint32_t, "lw"); OCT_READ(64, uint64_t, "ld"); #else @@ -158,66 +140,6 @@ static inline void oct_write64 (uint64_t intr_restore(sr); } -static inline void oct_write8_x8 (uint64_t csr_addr, uint8_t val8) -{ - uint32_t csr_addrh = csr_addr >> 32; - uint32_t csr_addrl = csr_addr; - uint32_t tmp1; - uint32_t tmp2; - register_t sr; - - sr = intr_disable(); - - __asm __volatile ( - ".set push\n" - ".set mips64\n" - ".set noreorder\n" - ".set noat\n" - "dsll %0, %3, 32\n" - "dsll %1, %4, 32\n" - "dsrl %1, %1, 32\n" - "or %0, %0, %1\n" - "sb %2, 0(%0)\n" - ".set pop\n" - : "=&r" (tmp1), "=&r" (tmp2) - : "r" (val8), "r" (csr_addrh), "r" (csr_addrl)); - - intr_restore(sr); -} - -#define OCT_READ(n, t, insn) \ -static inline t oct_read ## n(uint64_t csr_addr) \ -{ \ - uint32_t csr_addrh = csr_addr >> 32; \ - uint32_t csr_addrl = csr_addr; \ - uint32_t tmp1, tmp2; \ - register_t sr; \ - \ - sr = intr_disable(); \ - \ - __asm __volatile ( \ - ".set push\n" \ - ".set mips64\n" \ - ".set noreorder\n" \ - ".set noat\n" \ - "dsll %1, %2, 32\n" \ - "dsll %0, %3, 32\n" \ - "dsrl %0, %0, 32\n" \ - "or %1, %1, %0\n" \ - "lb %1, 0(%1)\n" \ - ".set pop\n" \ - : "=&r" (tmp1), "=&r" (tmp2) \ - : "r" (csr_addrh), "r" (csr_addrl)); \ - \ - intr_restore(sr); \ - \ - return ((t)tmp2); \ -} - -OCT_READ(8, uint8_t, "lb"); -OCT_READ(16, uint16_t, "lh"); -OCT_READ(32, uint32_t, "lw"); - static inline uint64_t oct_read64 (uint64_t csr_addr) { uint32_t csr_addrh = csr_addr >> 32; @@ -253,51 +175,18 @@ static inline uint64_t oct_read64 (uint6 #endif -#define oct_write64_int64(a, v) (oct_write64(a, (int64_t)(v))) - -/* - * Most write bus transactions are actually 64-bit on Octeon. - */ -static inline void oct_write8 (uint64_t csr_addr, uint8_t val8) -{ - oct_write64(csr_addr, (uint64_t) val8); -} - -static inline void oct_write16 (uint64_t csr_addr, uint16_t val16) -{ - oct_write64(csr_addr, (uint64_t) val16); -} - -static inline void oct_write32 (uint64_t csr_addr, uint32_t val32) -{ - oct_write64(csr_addr, (uint64_t) val32); -} - -#define oct_readint32(a) ((int32_t)oct_read32((a))) - /* * octeon_machdep.c * * Direct to Board Support level. */ -extern void octeon_led_write_char(int char_position, char val); -extern void octeon_led_write_hexchar(int char_position, char hexval); -extern void octeon_led_write_hex(uint32_t wl); -extern void octeon_led_write_string(const char *str); extern void octeon_reset(void); -extern void octeon_led_write_char0(char val); -extern void octeon_led_run_wheel(int *pos, int led_position); extern void octeon_debug_symbol(void); extern void octeon_ciu_reset(void); extern int octeon_is_simulation(void); #endif /* LOCORE */ /* - * EBT3000 LED Unit - */ -#define OCTEON_CHAR_LED_BASE_ADDR (0x1d020000 | (0x1ffffffffull << 31)) - -/* * Default FLASH device (physical) base address */ #define OCTEON_FLASH_BASE_ADDR (0x1d040000ull) Modified: user/andre/tcp_workqueue/sys/mips/cavium/uart_dev_oct16550.c ============================================================================== --- user/andre/tcp_workqueue/sys/mips/cavium/uart_dev_oct16550.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/mips/cavium/uart_dev_oct16550.c Mon Oct 29 13:49:06 2012 (r242312) @@ -632,13 +632,6 @@ oct16550_bus_ipend(struct uart_softc *sc } uart_unlock(sc->sc_hwmtx); -//#define OCTEON_VISUAL_UART 1 -#ifdef OCTEON_VISUAL_UART - static int where1 = 0; - - if (ipend) octeon_led_run_wheel(&where1, 6 + device_get_unit(sc->sc_dev)); -#endif - return (ipend); } Modified: user/andre/tcp_workqueue/sys/netinet/tcp_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_output.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/netinet/tcp_output.c Mon Oct 29 13:49:06 2012 (r242312) @@ -547,13 +547,13 @@ after_sack_rexmit: /* * 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 + * Window updates are 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 + * We must avoid 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 Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.h ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_timer.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/netinet/tcp_timer.h Mon Oct 29 13:49:06 2012 (r242312) @@ -118,7 +118,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ -#define TCPTV_DELACK (hz / PR_FASTHZ / 2) /* 100ms timeout */ +#define TCPTV_DELACK ( hz/10 ) /* 100ms timeout */ #ifdef TCPTIMERS static const char *tcptimers[] = Modified: user/andre/tcp_workqueue/sys/sys/sched.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/sched.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/sys/sched.h Mon Oct 29 13:49:06 2012 (r242312) @@ -151,11 +151,13 @@ static __inline void sched_pin(void) { curthread->td_pinned++; + __compiler_membar(); } static __inline void sched_unpin(void) { + __compiler_membar(); curthread->td_pinned--; } Modified: user/andre/tcp_workqueue/sys/vm/vm_page.c ============================================================================== --- user/andre/tcp_workqueue/sys/vm/vm_page.c Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/vm/vm_page.c Mon Oct 29 13:49:06 2012 (r242312) @@ -308,7 +308,6 @@ vm_page_startup(vm_offset_t vaddr) TAILQ_INIT(&vm_page_queues[i].pl); vm_page_queues[PQ_INACTIVE].cnt = &cnt.v_inactive_count; vm_page_queues[PQ_ACTIVE].cnt = &cnt.v_active_count; - vm_page_queues[PQ_HOLD].cnt = &cnt.v_active_count; /* * Allocate memory for use when boot strapping the kernel memory @@ -540,7 +539,7 @@ vm_page_unhold(vm_page_t mem) vm_page_lock_assert(mem, MA_OWNED); --mem->hold_count; KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!")); - if (mem->hold_count == 0 && mem->queue == PQ_HOLD) + if (mem->hold_count == 0 && (mem->flags & PG_UNHOLDFREE) != 0) vm_page_free_toq(mem); } @@ -2042,9 +2041,9 @@ vm_page_free_toq(vm_page_t m) panic("vm_page_free: freeing wired page %p", m); if (m->hold_count != 0) { m->flags &= ~PG_ZERO; - vm_page_lock_queues(); - vm_page_enqueue(PQ_HOLD, m); - vm_page_unlock_queues(); + KASSERT((m->flags & PG_UNHOLDFREE) == 0, + ("vm_page_free: freeing PG_UNHOLDFREE page %p", m)); + m->flags |= PG_UNHOLDFREE; } else { /* * Restore the default memory attribute to the page. Modified: user/andre/tcp_workqueue/sys/vm/vm_page.h ============================================================================== --- user/andre/tcp_workqueue/sys/vm/vm_page.h Mon Oct 29 13:16:33 2012 (r242311) +++ user/andre/tcp_workqueue/sys/vm/vm_page.h Mon Oct 29 13:49:06 2012 (r242312) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 13:58:11 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 EB4D4D85; Mon, 29 Oct 2012 13:58:11 +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 D311C8FC0A; Mon, 29 Oct 2012 13:58:11 +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 q9TDwB2Z074910; Mon, 29 Oct 2012 13:58:11 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TDwBMe074907; Mon, 29 Oct 2012 13:58:11 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291358.q9TDwBMe074907@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 13:58:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242313 - user/andre/tcp_workqueue/sys/netipsec X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 13:58:12 -0000 Author: andre Date: Mon Oct 29 13:58:11 2012 New Revision: 242313 URL: http://svn.freebsd.org/changeset/base/242313 Log: Copy if_enc.c to serve as starting point for an if_ipsec.c virtual interface for tunnel mode in an ipsec_pfil world. Added: user/andre/tcp_workqueue/sys/netipsec/if_ipsec.c - copied unchanged from r242311, user/andre/tcp_workqueue/sys/net/if_enc.c Copied: user/andre/tcp_workqueue/sys/netipsec/if_ipsec.c (from r242311, user/andre/tcp_workqueue/sys/net/if_enc.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/andre/tcp_workqueue/sys/netipsec/if_ipsec.c Mon Oct 29 13:58:11 2012 (r242313, copy of r242311, user/andre/tcp_workqueue/sys/net/if_enc.c) @@ -0,0 +1,365 @@ +/*- + * Copyright (c) 2006 The FreeBSD Project. + * 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. + * + * $FreeBSD$ + */ + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_enc.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef INET6 +#include +#include +#endif + +#include +#include + +#define ENCMTU (1024+512) + +/* XXX this define must have the same value as in OpenBSD */ +#define M_CONF 0x0400 /* payload was encrypted (ESP-transport) */ +#define M_AUTH 0x0800 /* payload was authenticated (AH or ESP auth) */ +#define M_AUTH_AH 0x2000 /* header was authenticated (AH) */ + +struct enchdr { + u_int32_t af; + u_int32_t spi; + u_int32_t flags; +}; + +struct ifnet *encif; +static struct mtx enc_mtx; + +struct enc_softc { + struct ifnet *sc_ifp; +}; + +static int enc_ioctl(struct ifnet *, u_long, caddr_t); +static int enc_output(struct ifnet *ifp, struct mbuf *m, + struct sockaddr *dst, struct route *ro); +static int enc_clone_create(struct if_clone *, int, caddr_t); +static void enc_clone_destroy(struct ifnet *); +static struct if_clone *enc_cloner; +static const char encname[] = "enc"; + +/* + * Sysctls. + */ + +/* + * Before and after are relative to when we are stripping the + * outer IP header. + */ +static SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG_RW, 0, "enc sysctl"); + +static SYSCTL_NODE(_net_enc, OID_AUTO, in, CTLFLAG_RW, 0, "enc input sysctl"); +static int ipsec_filter_mask_in = ENC_BEFORE; +SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, + &ipsec_filter_mask_in, 0, "IPsec input firewall filter mask"); +static int ipsec_bpf_mask_in = ENC_BEFORE; +SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, + &ipsec_bpf_mask_in, 0, "IPsec input bpf mask"); + +static SYSCTL_NODE(_net_enc, OID_AUTO, out, CTLFLAG_RW, 0, "enc output sysctl"); +static int ipsec_filter_mask_out = ENC_BEFORE; +SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW, + &ipsec_filter_mask_out, 0, "IPsec output firewall filter mask"); +static int ipsec_bpf_mask_out = ENC_BEFORE|ENC_AFTER; +SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW, + &ipsec_bpf_mask_out, 0, "IPsec output bpf mask"); + +static void +enc_clone_destroy(struct ifnet *ifp) +{ + KASSERT(ifp != encif, ("%s: destroying encif", __func__)); + + bpfdetach(ifp); + if_detach(ifp); + if_free(ifp); +} + +static int +enc_clone_create(struct if_clone *ifc, int unit, caddr_t params) +{ + struct ifnet *ifp; + struct enc_softc *sc; + + sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + ifp = sc->sc_ifp = if_alloc(IFT_ENC); + if (ifp == NULL) { + free(sc, M_DEVBUF); + return (ENOSPC); + } + + if_initname(ifp, encname, unit); + ifp->if_mtu = ENCMTU; + ifp->if_ioctl = enc_ioctl; + ifp->if_output = enc_output; + ifp->if_snd.ifq_maxlen = ifqmaxlen; + ifp->if_softc = sc; + if_attach(ifp); + bpfattach(ifp, DLT_ENC, sizeof(struct enchdr)); + + mtx_lock(&enc_mtx); + /* grab a pointer to enc0, ignore the rest */ + if (encif == NULL) + encif = ifp; + mtx_unlock(&enc_mtx); + + return (0); +} + +static int +enc_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + mtx_init(&enc_mtx, "enc mtx", NULL, MTX_DEF); + enc_cloner = if_clone_simple(encname, enc_clone_create, + enc_clone_destroy, 0); + break; + case MOD_UNLOAD: + printf("enc module unload - not possible for this module\n"); + return (EINVAL); + default: + return (EOPNOTSUPP); + } + return (0); +} + +static moduledata_t enc_mod = { + "if_enc", + enc_modevent, + 0 +}; + +DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); + +static int +enc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, + struct route *ro) +{ + m_freem(m); + return (0); +} + +/* + * Process an ioctl request. + */ +/* ARGSUSED */ +static int +enc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + int error = 0; + + mtx_lock(&enc_mtx); + + switch (cmd) { + + case SIOCSIFFLAGS: + if (ifp->if_flags & IFF_UP) + ifp->if_drv_flags |= IFF_DRV_RUNNING; + else + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + + break; + + default: + error = EINVAL; + } + + mtx_unlock(&enc_mtx); + return (error); +} + +int +ipsec_filter(struct mbuf **mp, int dir, int flags) +{ + int error, i; + struct ip *ip; + + KASSERT(encif != NULL, ("%s: encif is null", __func__)); + KASSERT(flags & (ENC_IN|ENC_OUT), + ("%s: invalid flags: %04x", __func__, flags)); + + if ((encif->if_drv_flags & IFF_DRV_RUNNING) == 0) + return (0); + + if (flags & ENC_IN) { + if ((flags & ipsec_filter_mask_in) == 0) + return (0); + } else { + if ((flags & ipsec_filter_mask_out) == 0) + return (0); + } + + /* Skip pfil(9) if no filters are loaded */ + if (1 +#ifdef INET + && !PFIL_HOOKED(&V_inet_pfil_hook) +#endif +#ifdef INET6 + && !PFIL_HOOKED(&V_inet6_pfil_hook) +#endif + ) { + return (0); + } + + i = min((*mp)->m_pkthdr.len, max_protohdr); + if ((*mp)->m_len < i) { + *mp = m_pullup(*mp, i); + if (*mp == NULL) { + printf("%s: m_pullup failed\n", __func__); + return (-1); + } + } + + error = 0; + ip = mtod(*mp, struct ip *); + switch (ip->ip_v) { +#ifdef INET + case 4: + error = pfil_run_hooks(&V_inet_pfil_hook, mp, + encif, dir, NULL); + break; +#endif +#ifdef INET6 + case 6: + error = pfil_run_hooks(&V_inet6_pfil_hook, mp, + encif, dir, NULL); + break; +#endif + default: + printf("%s: unknown IP version\n", __func__); + } + + /* + * If the mbuf was consumed by the filter for requeueing (dummynet, etc) + * then error will be zero but we still want to return an error to our + * caller so the null mbuf isn't forwarded further. + */ + if (*mp == NULL && error == 0) + return (-1); /* Consumed by the filter */ + if (*mp == NULL) + return (error); + if (error != 0) + goto bad; + + return (error); + +bad: + m_freem(*mp); + *mp = NULL; + return (error); +} + +void +ipsec_bpf(struct mbuf *m, struct secasvar *sav, int af, int flags) +{ + int mflags; + struct enchdr hdr; + + KASSERT(encif != NULL, ("%s: encif is null", __func__)); + KASSERT(flags & (ENC_IN|ENC_OUT), + ("%s: invalid flags: %04x", __func__, flags)); + + if ((encif->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + if (flags & ENC_IN) { + if ((flags & ipsec_bpf_mask_in) == 0) + return; + } else { + if ((flags & ipsec_bpf_mask_out) == 0) + return; + } + + if (bpf_peers_present(encif->if_bpf)) { + mflags = 0; + hdr.spi = 0; + if (!sav) { + struct m_tag *mtag; + mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL); + if (mtag != NULL) { + struct tdb_ident *tdbi; + tdbi = (struct tdb_ident *) (mtag + 1); + if (tdbi->alg_enc != SADB_EALG_NONE) + mflags |= M_CONF; + if (tdbi->alg_auth != SADB_AALG_NONE) + mflags |= M_AUTH; + hdr.spi = tdbi->spi; + } + } else { + if (sav->alg_enc != SADB_EALG_NONE) + mflags |= M_CONF; + if (sav->alg_auth != SADB_AALG_NONE) + mflags |= M_AUTH; + hdr.spi = sav->spi; + } + + /* + * We need to prepend the address family as a four byte + * field. Cons up a dummy header to pacify bpf. This + * is safe because bpf will only read from the mbuf + * (i.e., it won't try to free it or keep a pointer a + * to it). + */ + hdr.af = af; + /* hdr.spi already set above */ + hdr.flags = mflags; + + bpf_mtap2(encif->if_bpf, &hdr, sizeof(hdr), m); + } +} From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 15:08: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 760D55C8; Mon, 29 Oct 2012 15:08: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 5E15B8FC12; Mon, 29 Oct 2012 15:08: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 q9TF8Kkj085902; Mon, 29 Oct 2012 15:08:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TF8Kw8085899; Mon, 29 Oct 2012 15:08:20 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291508.q9TF8Kw8085899@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 15:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242316 - user/andre/tcp_workqueue/sys/netipsec X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 15:08:20 -0000 Author: andre Date: Mon Oct 29 15:08:19 2012 New Revision: 242316 URL: http://svn.freebsd.org/changeset/base/242316 Log: Remove support for really old RFC1826 AH protocol version. It was obsoleted in 1998 by RFC2402, which in turn has been obsoleted in 2005 by RFC4302. The RFC1826 header didn't support the sequence field making it vulnerable to replay attacks. Also rename the AH header from struct ah into struct ipsec_ah. Modified: user/andre/tcp_workqueue/sys/netipsec/ah.h user/andre/tcp_workqueue/sys/netipsec/xform_ah.c Modified: user/andre/tcp_workqueue/sys/netipsec/ah.h ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/ah.h Mon Oct 29 14:27:28 2012 (r242315) +++ user/andre/tcp_workqueue/sys/netipsec/ah.h Mon Oct 29 15:08:19 2012 (r242316) @@ -37,15 +37,7 @@ #ifndef _NETIPSEC_AH_H_ #define _NETIPSEC_AH_H_ -struct ah { - u_int8_t ah_nxt; /* Next Header */ - u_int8_t ah_len; /* Length of data, in 32bit */ - u_int16_t ah_reserve; /* Reserved for future use */ - u_int32_t ah_spi; /* Security parameter index */ - /* variable size, 32bit bound*/ /* Authentication data */ -}; - -struct newah { +struct ipsec_ah { u_int8_t ah_nxt; /* Next Header */ u_int8_t ah_len; /* Length of data + 1, in 32bit */ u_int16_t ah_reserve; /* Reserved for future use */ Modified: user/andre/tcp_workqueue/sys/netipsec/xform_ah.c ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/xform_ah.c Mon Oct 29 14:27:28 2012 (r242315) +++ user/andre/tcp_workqueue/sys/netipsec/xform_ah.c Mon Oct 29 15:08:19 2012 (r242316) @@ -73,20 +73,6 @@ #include -/* - * Return header size in bytes. The old protocol did not support - * the replay counter; the new protocol always includes the counter. - */ -#define HDRSIZE(sav) \ - (((sav)->flags & SADB_X_EXT_OLD) ? \ - sizeof (struct ah) : sizeof (struct ah) + sizeof (u_int32_t)) -/* - * Return authenticator size in bytes. The old protocol is known - * to use a fixed 16-byte authenticator. The new algorithm use 12-byte - * authenticator. - */ -#define AUTHSIZE(sav) ah_authsize(sav) - VNET_DEFINE(int, ah_enable) = 1; /* control flow of packets with AH */ VNET_DEFINE(int, ah_cleartos) = 1; /* clear ip_tos when doing AH calc */ VNET_DEFINE(struct ahstat, ahstat); @@ -106,6 +92,7 @@ static unsigned char ipseczeroes[256]; / static int ah_input_cb(struct cryptop*); static int ah_output_cb(struct cryptop*); +/* Return authenticator size in bytes. */ static int ah_authsize(struct secasvar *sav) { @@ -167,11 +154,12 @@ ah_hdrsiz(struct secasvar *sav) int authsize; IPSEC_ASSERT(sav->tdb_authalgxform != NULL, ("null xform")); /*XXX not right for null algorithm--does it matter??*/ - authsize = AUTHSIZE(sav); - size = roundup(authsize, sizeof (u_int32_t)) + HDRSIZE(sav); + authsize = ah_authsize(sav); + size = roundup(authsize, sizeof (u_int32_t)) + + sizeof(struct ipsec_ah); } else { /* default guess */ - size = sizeof (struct ah) + sizeof (u_int32_t) + 16; + size = sizeof (struct ipsec_ah) + 16; } return size; } @@ -225,7 +213,7 @@ ah_init0(struct secasvar *sav, struct xf cria->cri_alg = sav->tdb_authalgxform->type; cria->cri_klen = _KEYBITS(sav->key_auth); cria->cri_key = sav->key_auth->key_data; - cria->cri_mlen = AUTHSIZE(sav); + cria->cri_mlen = ah_authsize(sav); return 0; } @@ -565,7 +553,7 @@ ah_input(struct mbuf *m, struct secasvar struct tdb_ident *tdbi; struct tdb_crypto *tc; struct m_tag *mtag; - struct newah *ah; + struct ipsec_ah *ah; int hl, rplen, authsize; struct cryptodesc *crda; @@ -577,10 +565,10 @@ ah_input(struct mbuf *m, struct secasvar ("null authentication xform")); /* Figure out header size. */ - rplen = HDRSIZE(sav); + rplen = sizeof(struct ipsec_ah); /* XXX don't pullup, just copy header */ - IP6_EXTHDR_GET(ah, struct newah *, m, skip, rplen); + IP6_EXTHDR_GET(ah, struct ipsec_ah *, m, skip, rplen); if (ah == NULL) { DPRINTF(("ah_input: cannot pullup header\n")); V_ahstat.ahs_hdrops++; /*XXX*/ @@ -600,11 +588,11 @@ ah_input(struct mbuf *m, struct secasvar /* Verify AH header length. */ hl = ah->ah_len * sizeof (u_int32_t); ahx = sav->tdb_authalgxform; - authsize = AUTHSIZE(sav); - if (hl != authsize + rplen - sizeof (struct ah)) { + authsize = ah_authsize(sav); + if (hl != authsize + rplen - sizeof (struct ipsec_ah)) { DPRINTF(("%s: bad authenticator length %u (expecting %lu)" " for packet in SA %s/%08lx\n", __func__, - hl, (u_long) (authsize + rplen - sizeof (struct ah)), + hl, (u_long) (authsize + rplen - sizeof (struct ipsec_ah)), ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); V_ahstat.ahs_badauthl++; @@ -779,8 +767,8 @@ ah_input_cb(struct cryptop *crp) } /* Figure out header size. */ - rplen = HDRSIZE(sav); - authsize = AUTHSIZE(sav); + rplen = sizeof(struct ipsec_ah); + authsize = ah_authsize(sav); /* Copy authenticator off the packet. */ m_copydata(m, skip + rplen, authsize, calc); @@ -826,7 +814,7 @@ ah_input_cb(struct cryptop *crp) if (sav->replay) { u_int32_t seq; - m_copydata(m, skip + offsetof(struct newah, ah_seq), + m_copydata(m, skip + offsetof(struct ipsec_ah, ah_seq), sizeof (seq), (caddr_t) &seq); if (ipsec_updatereplay(ntohl(seq), sav)) { V_ahstat.ahs_replay++; @@ -897,7 +885,7 @@ ah_output( u_int16_t iplen; int error, rplen, authsize, maxpacketsize, roff; u_int8_t prot; - struct newah *ah; + struct ipsec_ah *ah; sav = isr->sav; IPSEC_ASSERT(sav != NULL, ("null SA")); @@ -907,7 +895,7 @@ ah_output( V_ahstat.ahs_output++; /* Figure out header size. */ - rplen = HDRSIZE(sav); + rplen = sizeof(struct ipsec_ah); /* Check for maximum packet size violations. */ switch (sav->sah->saidx.dst.sa.sa_family) { @@ -931,7 +919,7 @@ ah_output( error = EPFNOSUPPORT; goto bad; } - authsize = AUTHSIZE(sav); + authsize = ah_authsize(sav); if (rplen + authsize + m->m_pkthdr.len > maxpacketsize) { DPRINTF(("%s: packet in SA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, @@ -973,11 +961,11 @@ ah_output( * The AH header is guaranteed by m_makespace() to be in * contiguous memory, at roff bytes offset into the returned mbuf. */ - ah = (struct newah *)(mtod(mi, caddr_t) + roff); + ah = (struct ipsec_ah *)(mtod(mi, caddr_t) + roff); /* Initialize the AH header. */ m_copydata(m, protoff, sizeof(u_int8_t), (caddr_t) &ah->ah_nxt); - ah->ah_len = (rplen + authsize - sizeof(struct ah)) / sizeof(u_int32_t); + ah->ah_len = (rplen + authsize - sizeof(struct ipsec_ah)) / sizeof(u_int32_t); ah->ah_reserve = 0; ah->ah_spi = sav->spi; @@ -1185,7 +1173,7 @@ ah_output_cb(struct cryptop *crp) * Corrupt HMAC if we want to test integrity verification of * the other side. */ - alen = AUTHSIZE(sav); + alen = ah_authsize(sav); m_copyback(m, m->m_pkthdr.len - alen, alen, ipseczeroes); } #endif From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 16:42:38 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 9D0649CD; Mon, 29 Oct 2012 16:42:38 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 863358FC0A; Mon, 29 Oct 2012 16:42: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 q9TGgcaD000412; Mon, 29 Oct 2012 16:42:38 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TGgc6N000411; Mon, 29 Oct 2012 16:42:38 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201210291642.q9TGgc6N000411@svn.freebsd.org> From: Peter Holm Date: Mon, 29 Oct 2012 16:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242317 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 16:42:38 -0000 Author: pho Date: Mon Oct 29 16:42:37 2012 New Revision: 242317 URL: http://svn.freebsd.org/changeset/base/242317 Log: Regression test added. Added: user/pho/stress2/misc/mlockall2.sh (contents, props changed) Added: user/pho/stress2/misc/mlockall2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mlockall2.sh Mon Oct 29 16:42:37 2012 (r242317) @@ -0,0 +1,148 @@ +#!/bin/sh + +# +# Copyright (c) 2012 Peter Holm +# 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. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# core dumps seen in watchdogd after mlockall() was added. +# This scenario demonstrates the problem. Fixed in r242012. + +mem=`sysctl hw.usermem | awk '{print $NF}'` + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > mlockall2.c +cc -o mlockall2 -Wall -Wextra -O2 -g mlockall2.c +rm -f mlockall2.c +cd $here + +rm -f mlockall2.core +/tmp/mlockall2 $mem & +while kill -0 $! 2>/dev/null; do + [ -r mlockall2.core ] && kill $! && break + sleep 10 +done +[ -r mlockall2.core ] && echo "FAIL" +killall mlockall2 +rm -f /tmp/mlockall2 +exit 0 +EOF +#include +#include +#include +#include +#include +#include +#include + +#define LOAD 40 +#define N 90000 +#define PARALLEL 5 + +long size; + +void +swap(void) +{ + char *c; + int page; + long i; + + setproctitle("swap"); + c = malloc(size); + while (c == NULL) { + size -= 1024 * 1024; + c = malloc(size); + } + page = getpagesize(); + for (;;) { + i = 0; + while (i < size) { + c[i] = 0; + i += page; + } + } +} + +void +test(void) +{ + pid_t p; + int i, status; + + setproctitle("test"); + for (i = 0; i < N; i++) { + if ((p = fork()) == 0) { + _exit(0); + } + if (p > 0) + wait(&status); + if (status != 0) + break; + } + _exit(0); +} + +int +main(int argc __unused, char **argv) +{ + struct rtprio rtp; + int i, j; + + size = atol(argv[1]) / LOAD * 1.5; + for (i = 0; i < LOAD; i++) + if (fork() == 0) + swap(); + sleep(10); + + rtp.type = RTP_PRIO_REALTIME; + rtp.prio = 0; + if (rtprio(RTP_SET, 0, &rtp) == -1) + err(1, "rtprio"); + + if (madvise(0, 0, MADV_PROTECT) != 0) + err(1, "madvise failed"); + if (mlockall(MCL_CURRENT | MCL_FUTURE) != 0) + err(1, "mlockall failed"); + + for (j = 0; j < 10; j++) { + + for (i = 0; i < PARALLEL; i++) { + if (fork() == 0) + test(); + } + + for (i = 0; i < PARALLEL; i++) + wait(NULL); + if (access("mlockall2.core", R_OK) == 0) + break; + } + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Mon Oct 29 21:48:25 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 011B4E16; Mon, 29 Oct 2012 21:48:24 +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 DAB2E8FC08; Mon, 29 Oct 2012 21:48:24 +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 q9TLmOVe050626; Mon, 29 Oct 2012 21:48:24 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TLmOMi050621; Mon, 29 Oct 2012 21:48:24 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210292148.q9TLmOMi050621@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 21:48:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242330 - user/andre/tcp_workqueue/sys/netipsec X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 29 Oct 2012 21:48:25 -0000 Author: andre Date: Mon Oct 29 21:48:24 2012 New Revision: 242330 URL: http://svn.freebsd.org/changeset/base/242330 Log: Remove support for really old RFC1827 ESP protocol version. It was obsoleted in 1998 by RFC2406, which in turn has been obsoleted in 2005 by RFC4303. The RFC1827 header didn't support the sequence field making it vulnerable to replay attacks. Also rename the ESP header from struct esp into struct ipsec_esp. Modified: user/andre/tcp_workqueue/sys/netipsec/esp.h user/andre/tcp_workqueue/sys/netipsec/ipsec_input.c user/andre/tcp_workqueue/sys/netipsec/xform_ah.c user/andre/tcp_workqueue/sys/netipsec/xform_esp.c Modified: user/andre/tcp_workqueue/sys/netipsec/esp.h ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/esp.h Mon Oct 29 21:11:37 2012 (r242329) +++ user/andre/tcp_workqueue/sys/netipsec/esp.h Mon Oct 29 21:48:24 2012 (r242330) @@ -37,18 +37,7 @@ #ifndef _NETIPSEC_ESP_H_ #define _NETIPSEC_ESP_H_ -struct esp { - u_int32_t esp_spi; /* ESP */ - /*variable size, 32bit bound*/ /* Initialization Vector */ - /*variable size*/ /* Payload data */ - /*variable size*/ /* padding */ - /*8bit*/ /* pad size */ - /*8bit*/ /* next header */ - /*8bit*/ /* next header */ - /*variable size, 32bit bound*/ /* Authentication data (new IPsec) */ -}; - -struct newesp { +struct ipsec_esp { u_int32_t esp_spi; /* ESP */ u_int32_t esp_seq; /* Sequence number */ /*variable size*/ /* (IV and) Payload data */ Modified: user/andre/tcp_workqueue/sys/netipsec/ipsec_input.c ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/ipsec_input.c Mon Oct 29 21:11:37 2012 (r242329) +++ user/andre/tcp_workqueue/sys/netipsec/ipsec_input.c Mon Oct 29 21:48:24 2012 (r242330) @@ -861,9 +861,9 @@ esp6_ctlinput(int cmd, struct sockaddr * int valid; /* check header length before using m_copydata */ - if (m->m_pkthdr.len < off + sizeof (struct esp)) + if (m->m_pkthdr.len < off + sizeof (struct ipsec_esp)) return; - m_copydata(m, off + offsetof(struct esp, esp_spi), + m_copydata(m, off + offsetof(struct ipsec_esp, esp_spi), sizeof(u_int32_t), (caddr_t) &spi); /* * Check to see if we have a valid SA corresponding to Modified: user/andre/tcp_workqueue/sys/netipsec/xform_ah.c ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/xform_ah.c Mon Oct 29 21:11:37 2012 (r242329) +++ user/andre/tcp_workqueue/sys/netipsec/xform_ah.c Mon Oct 29 21:48:24 2012 (r242330) @@ -99,9 +99,6 @@ ah_authsize(struct secasvar *sav) IPSEC_ASSERT(sav != NULL, ("%s: sav == NULL", __func__)); - if (sav->flags & SADB_X_EXT_OLD) - return 16; - switch (sav->alg_auth) { case SADB_X_AALG_SHA2_256: return 16; @@ -185,11 +182,9 @@ ah_init0(struct secasvar *sav, struct xf * later during protocol processing. */ /* NB: replay state is setup elsewhere (sigh) */ - if (((sav->flags&SADB_X_EXT_OLD) == 0) ^ (sav->replay != NULL)) { - DPRINTF(("%s: replay state block inconsistency, " - "%s algorithm %s replay state\n", __func__, - (sav->flags & SADB_X_EXT_OLD) ? "old" : "new", - sav->replay == NULL ? "without" : "with")); + if (sav->replay == NULL) { + DPRINTF(("%s: replay state block inconsistency\n", + __func__)); return EINVAL; } if (sav->key_auth == NULL) { Modified: user/andre/tcp_workqueue/sys/netipsec/xform_esp.c ============================================================================== --- user/andre/tcp_workqueue/sys/netipsec/xform_esp.c Mon Oct 29 21:11:37 2012 (r242329) +++ user/andre/tcp_workqueue/sys/netipsec/xform_esp.c Mon Oct 29 21:48:24 2012 (r242330) @@ -127,10 +127,7 @@ esp_hdrsiz(struct secasvar *sav) /*XXX not right for null algorithm--does it matter??*/ IPSEC_ASSERT(sav->tdb_encalgxform != NULL, ("SA with null xform")); - if (sav->flags & SADB_X_EXT_OLD) - size = sizeof (struct esp); - else - size = sizeof (struct newesp); + size = sizeof (struct ipsec_esp); size += sav->tdb_encalgxform->blocksize + 9; /*XXX need alg check???*/ if (sav->tdb_authalgxform != NULL && sav->replay) @@ -144,7 +141,7 @@ esp_hdrsiz(struct secasvar *sav) * + sizeof (next header field) * + max icv supported. */ - size = sizeof (struct newesp) + EALG_MAX_BLOCK_LEN + 9 + 16; + size = sizeof (struct ipsec_esp) + EALG_MAX_BLOCK_LEN + 9 + 16; } return size; } @@ -171,7 +168,7 @@ esp_init(struct secasvar *sav, struct xf __func__, txform->name)); return EINVAL; } - if ((sav->flags&(SADB_X_EXT_OLD|SADB_X_EXT_IV4B)) == SADB_X_EXT_IV4B) { + if ((sav->flags & SADB_X_EXT_IV4B) == SADB_X_EXT_IV4B) { DPRINTF(("%s: 4-byte IV not supported with protocol\n", __func__)); return EINVAL; @@ -267,7 +264,7 @@ esp_input(struct mbuf *m, struct secasva struct tdb_crypto *tc; int plen, alen, hlen; struct m_tag *mtag; - struct newesp *esp; + struct ipsec_esp *esp; struct cryptodesc *crde; struct cryptop *crp; @@ -285,16 +282,13 @@ esp_input(struct mbuf *m, struct secasva } /* XXX don't pullup, just copy header */ - IP6_EXTHDR_GET(esp, struct newesp *, m, skip, sizeof (struct newesp)); + IP6_EXTHDR_GET(esp, struct ipsec_esp *, m, skip, sizeof (struct ipsec_esp)); esph = sav->tdb_authalgxform; espx = sav->tdb_encalgxform; /* Determine the ESP header length */ - if (sav->flags & SADB_X_EXT_OLD) - hlen = sizeof (struct esp) + sav->ivlen; - else - hlen = sizeof (struct newesp) + sav->ivlen; + hlen = sizeof (struct ipsec_esp) + sav->ivlen; /* Authenticator hash size */ if (esph != NULL) { switch (esph->type) { @@ -564,7 +558,7 @@ esp_input_cb(struct cryptop *crp) if (sav->replay) { u_int32_t seq; - m_copydata(m, skip + offsetof(struct newesp, esp_seq), + m_copydata(m, skip + offsetof(struct ipsec_esp, esp_seq), sizeof (seq), (caddr_t) &seq); if (ipsec_updatereplay(ntohl(seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, @@ -576,10 +570,7 @@ esp_input_cb(struct cryptop *crp) } /* Determine the ESP header length */ - if (sav->flags & SADB_X_EXT_OLD) - hlen = sizeof (struct esp) + sav->ivlen; - else - hlen = sizeof (struct newesp) + sav->ivlen; + hlen = sizeof (struct ipsec_esp) + sav->ivlen; /* Remove the ESP header and IV from the mbuf. */ error = m_striphdr(m, skip, hlen); @@ -687,10 +678,7 @@ esp_output( espx = sav->tdb_encalgxform; IPSEC_ASSERT(espx != NULL, ("null encoding xform")); - if (sav->flags & SADB_X_EXT_OLD) - hlen = sizeof (struct esp) + sav->ivlen; - else - hlen = sizeof (struct newesp) + sav->ivlen; + hlen = sizeof (struct ipsec_esp) + sav->ivlen; rlen = m->m_pkthdr.len - skip; /* Raw payload length. */ /* From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 01:38:48 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 D3520CD9; Tue, 30 Oct 2012 01:38:48 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 54A378FC08; Tue, 30 Oct 2012 01:38:46 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so4485506lbd.13 for ; Mon, 29 Oct 2012 18:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=lb71FKAQ0YRu3Md2e22Bc+fFVgvLlh0eV7qWrPNRi1g=; b=N35spmQCqLvZEVyc8dAwEWPBUc6dYSn3zovMzbiQqp1eauG5rvUgvJXDSBOl5XbYEX xWu6c7H14TcGkzeZJ86GrSrFnhn9maBGBRouWZ9v5n74vZxnhDJy2HFJ6HFqDrjdqEXN jRM8CiWZ6w+y6ueKXxceaXL387LsVlURqRIxBSdPK1Mw485XX8uc5fHOUW8uwhtCX/2t 5CkNlZFdWy8HRkd8+ALIb0DPTpCH5pK7O3CT+sgEHkTtMnX8Ip6YjqYqDP5I9WqTZS1V SskjWbhSkIb0rOr+SxH57OTyUCcdNB0fz8kiJ2aI1soojU+3wZnXBrhfozjwZRjmyqsn YiVg== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr29532042lab.9.1351561125908; Mon, 29 Oct 2012 18:38:45 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Mon, 29 Oct 2012 18:38:45 -0700 (PDT) In-Reply-To: References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> Date: Tue, 30 Oct 2012 01:38:45 +0000 X-Google-Sender-Auth: 2mZMDEJ9ZHgxrwYfTAoSb146XBU Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Jeff Roberson Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, Andre Oppermann , John Baldwin , svn-src-user@freebsd.org, Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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, 30 Oct 2012 01:38:49 -0000 On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: > On Sat, Oct 27, 2012 at 5:27 PM, Attilio Rao wrote: >> On Sat, Oct 27, 2012 at 3:35 PM, Attilio Rao wrote: >>> On 10/26/12, Andre Oppermann wrote: >>>> On 26.10.2012 08:27, Attilio Rao wrote: >>>>> On Thu, Oct 25, 2012 at 10:03 PM, Andre Oppermann >>>>> wrote: >>>>>> On 25.10.2012 18:21, Attilio Rao wrote: >>>>>>> Did you see my (and also Jeff) objection to your proposal about this? >>>>>>> You are deliberating ignoring this? >>>>>> >>>>>> >>>>>> Well, I'm allowed to have a different opinion, am I? I'm not ignoring >>>>>> your objection in the sense as I'm not trying to commit any of this to >>>>>> HEAD while it is disputed. >>>>>> >>>>>> Mind you this whole conversation was started because I was trying to >>>>>> solve >>>>>> a problem with unfortunate cache line sharing for global mutexes in the >>>>>> kernel .bss section on my *personal* svn branch. >>>>> >>>>> Andre, >>>>> I'm sorry if you felt I was being harsh or confrontative. This was >>>>> really not my intention and I apologize. >>>> >>>> I apologize too for being a bit difficult and taking some time understand >>>> the differences in __aligned() regarding padding behavior. >>>> >>>>> Said that, I fail in seeing a proper technical discussion on your side >>>>> on how what I propose is "overdoing it" or how do you plan to address >>>>> the concerns people are raising with your proposal of bumping all lock >>>>> sizes indiscriminately. >>>> >>>> I'm wary of micro-optimizing and generally prefer clean and for a >>>> reader obvious approaches. That said my assumption on the distribution >>>> of mutex use cases in the kernel was wrong. By counting from a grep >>>> it seems that about half of the mutexes could possibly benefit from >>>> being padded and the other half doesn't because it is in structures >>>> and next to its data. >>> >>> Besides that, you are likely misunderstanding something about what I >>> propose: what I'm proposing is completely transparent to developers. >>> You will just need to declare a mtx like: >>> >>> struct mtx_unshare Giant; >>> >>> and then you can use the mtx(9) interface on it without any issue. I >>> don't see how this is less clean than what you propose. It just >>> enables the alignment/padding on a selection basis rather than >>> indiscriminately. >>> >>>>> However, here is the first half of the patch I'd like to see in: >>>>> http:///www.freebsd.org/~attilio/mtx_decoupled.patch >>>> > >>>>> This is just the part to give the ability to crunch different >>>>> structures to the mtx KPI. Please note that from the users perspective >>>>> the mtx KPI remains absolutely the same, so there is theoretically no >>>>> KPI discontinuity, the support is absolutely transparent. >>>> >>>> This seems rather complicated. Instead of mtxlock2mtx() wouldn't >>>> __containerof() work just as well? The __DEVOLATILE() looks a bit >>>> dangerous. Are you sure the compiler won't reorder things it should >>>> not? >>> >>> What do you mean with "rather complicated"? >>> For the users of the primitive nothing changes at all. >>> For the people that might read the code it is pretty much >>> self-explanatory, in particular if you know how lock classes work in >>> our locking scheme. Maybe I can add a comment or two to clarify. >> >> Here we go with further comments tweaks. >> Also, in order to make it a complete NOP from KPI perspective I had to >> change the way the mtx_assert() wrapper was implemented as in v1 it >> wasn't correctly handling the const qualifier. >> I think the result is better now and you should refer to this patch for reviews: >> http://www.freebsd.org/~attilio/mtx_decoupled2.patch > > BTW, the mtx_sysuninit() introduction can be avoided by using this other trick: > #define MTX_SYSINIT(name, mtx, desc, opts) \ > static struct mtx_args name##_args = { \ > (mtx), \ > (desc), \ > (opts) \ > }; \ > SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ > mtx_sysinit, &name##_args); \ > SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ > _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) > > I'm just not sure that I would like the use of __DEVOLATILE() even if > it would help in this case when introducing MTX_SYSINIT_UNSHARE() > because we will just need to reuse the same code. > > Also, the more I think about this the more I feel convinced that > mtxlock2mtx() should be static in kern_mutex.c. I can simply add a > note to _mutex.h as a reminder for it. Here is the patch that does both things and the one I would like to commit: http://www.freebsd.org/~attilio/mtx_decoupled3.patch Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 02:25:55 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 3A158B05; Tue, 30 Oct 2012 02:25:55 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C4CA08FC12; Tue, 30 Oct 2012 02:25:53 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so5397938lag.13 for ; Mon, 29 Oct 2012 19:25:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=/HEgkPk+O8SIROMzs3LlXOzs4qmLyR2gtXN0DuAsPU4=; b=1FZEY80wQcPhYkep4a0OpRdwldxLaN5r2QIF4B4aR3ARP57jI4uHrLuCvl9GBjubHH 9da83OocKFqIoFQRmMg7n2b5cG0C6Ny6oh++xsxqx38jgeLuzvG5kP44VGbqPKyK76Fs n9F//wipBBjkQG6RuarOe1K2j1slN86/kI1+EwNCYcdkPTER372cETfcIUQ/iXGWvQ9C zLxL/tQIXrdDbdz1BjhvF55s1NK0PcNPcPkgvn/n9gZDa/XwZWuB/cY2zg3x8sTA7pev jz3dJoKVufYxz/8h1aEIrXFuwCwV3eECU3TG59TtB9mkhZJ19z7ZQ3FAlxafxSOHPcnX 5SwA== MIME-Version: 1.0 Received: by 10.152.132.3 with SMTP id oq3mr28574939lab.18.1351563952680; Mon, 29 Oct 2012 19:25:52 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Mon, 29 Oct 2012 19:25:52 -0700 (PDT) In-Reply-To: References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> Date: Tue, 30 Oct 2012 02:25:52 +0000 X-Google-Sender-Auth: t5Sy2RMzIx4MkDxi7Y-_zqjTHrk Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Jeff Roberson Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, Andre Oppermann , John Baldwin , svn-src-user@freebsd.org, Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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, 30 Oct 2012 02:25:55 -0000 On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao wrote: > On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: [ trimm ] >> >> BTW, the mtx_sysuninit() introduction can be avoided by using this other trick: >> #define MTX_SYSINIT(name, mtx, desc, opts) \ >> static struct mtx_args name##_args = { \ >> (mtx), \ >> (desc), \ >> (opts) \ >> }; \ >> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >> mtx_sysinit, &name##_args); \ >> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >> >> I'm just not sure that I would like the use of __DEVOLATILE() even if >> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >> because we will just need to reuse the same code. >> >> Also, the more I think about this the more I feel convinced that >> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a >> note to _mutex.h as a reminder for it. > > Here is the patch that does both things and the one I would like to commit: > http://www.freebsd.org/~attilio/mtx_decoupled3.patch BTW, I've updated the patch in order to make use of __containerof() rather than the manual frobbing. I had no idea that this method was existing, many thanks to andre@ and mdf@ for signaling it. Please refresh the patch. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 09:23:43 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 C10CEC6 for ; Tue, 30 Oct 2012 09:23:43 +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 1515B8FC08 for ; Tue, 30 Oct 2012 09:23:42 +0000 (UTC) Received: (qmail 53845 invoked from network); 30 Oct 2012 11:00:22 -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 ; 30 Oct 2012 11:00:22 -0000 Message-ID: <508F9C94.7080703@freebsd.org> Date: Tue, 30 Oct 2012 10:23:32 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 09:23:43 -0000 On 30.10.2012 03:25, Attilio Rao wrote: > On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao wrote: >> On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: > > [ trimm ] > >>> >>> BTW, the mtx_sysuninit() introduction can be avoided by using this other trick: >>> #define MTX_SYSINIT(name, mtx, desc, opts) \ >>> static struct mtx_args name##_args = { \ >>> (mtx), \ >>> (desc), \ >>> (opts) \ >>> }; \ >>> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >>> mtx_sysinit, &name##_args); \ >>> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ >>> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >>> >>> I'm just not sure that I would like the use of __DEVOLATILE() even if >>> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >>> because we will just need to reuse the same code. >>> >>> Also, the more I think about this the more I feel convinced that >>> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a >>> note to _mutex.h as a reminder for it. >> >> Here is the patch that does both things and the one I would like to commit: >> http://www.freebsd.org/~attilio/mtx_decoupled3.patch > > BTW, I've updated the patch in order to make use of __containerof() > rather than the manual frobbing. I had no idea that this method was > existing, many thanks to andre@ and mdf@ for signaling it. > Please refresh the patch. Thank you for the updated patch. I have no objections to the patch, though I'm not really qualified to have a final say on changes to the mutex code. -- Andre From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 10:52:36 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 772959E3; Tue, 30 Oct 2012 10:52:36 +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 5EDB68FC0C; Tue, 30 Oct 2012 10:52:36 +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 q9UAqaRo074265; Tue, 30 Oct 2012 10:52:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UAqalp074263; Tue, 30 Oct 2012 10:52:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210301052.q9UAqalp074263@svn.freebsd.org> From: Andre Oppermann Date: Tue, 30 Oct 2012 10:52:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242351 - user/andre/tcp_workqueue/sys/netinet X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 10:52:36 -0000 Author: andre Date: Tue Oct 30 10:52:35 2012 New Revision: 242351 URL: http://svn.freebsd.org/changeset/base/242351 Log: Add DELACK to list of timers. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.h Modified: user/andre/tcp_workqueue/sys/netinet/tcp_timer.h ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_timer.h Tue Oct 30 10:13:26 2012 (r242350) +++ user/andre/tcp_workqueue/sys/netinet/tcp_timer.h Tue Oct 30 10:52:35 2012 (r242351) @@ -122,7 +122,7 @@ #ifdef TCPTIMERS static const char *tcptimers[] = - { "REXMT", "PERSIST", "KEEP", "2MSL" }; + { "REXMT", "PERSIST", "KEEP", "2MSL", "DELACK" }; #endif /* From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 11:01: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 8CE72F11; Tue, 30 Oct 2012 11:01: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 6835C8FC0C; Tue, 30 Oct 2012 11:01: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 q9UB1Qja075676; Tue, 30 Oct 2012 11:01:26 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UB1Qd8075671; Tue, 30 Oct 2012 11:01:26 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210301101.q9UB1Qd8075671@svn.freebsd.org> From: Andre Oppermann Date: Tue, 30 Oct 2012 11:01:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242353 - in user/andre/tcp_workqueue/sys: dev/ti net netinet sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 11:01:26 -0000 Author: andre Date: Tue Oct 30 11:01:25 2012 New Revision: 242353 URL: http://svn.freebsd.org/changeset/base/242353 Log: Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability. Checksumming the IP header of fragments is no different from doing normal IP headers. Modified: user/andre/tcp_workqueue/sys/dev/ti/if_ti.c user/andre/tcp_workqueue/sys/net/if_vlan.c user/andre/tcp_workqueue/sys/netinet/ip_output.c user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/dev/ti/if_ti.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ti/if_ti.c Tue Oct 30 10:59:42 2012 (r242352) +++ user/andre/tcp_workqueue/sys/dev/ti/if_ti.c Tue Oct 30 11:01:25 2012 (r242353) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) /* * We can only turn on header splitting if we're using extended receive * BDs. Modified: user/andre/tcp_workqueue/sys/net/if_vlan.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/if_vlan.c Tue Oct 30 10:59:42 2012 (r242352) +++ user/andre/tcp_workqueue/sys/net/if_vlan.c Tue Oct 30 11:01:25 2012 (r242353) @@ -1493,7 +1493,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: user/andre/tcp_workqueue/sys/netinet/ip_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_output.c Tue Oct 30 10:59:42 2012 (r242352) +++ user/andre/tcp_workqueue/sys/netinet/ip_output.c Tue Oct 30 11:01:25 2012 (r242353) @@ -725,14 +725,12 @@ ip_fragment(struct ip *ip, struct mbuf * * If the interface will not calculate checksums on * fragmented packets, then do it here. */ - if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP - if (m0->m_pkthdr.csum_flags & CSUM_SCTP && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 10:59:42 2012 (r242352) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:01:25 2012 (r242353) @@ -279,7 +279,7 @@ struct mbuf { #define CSUM_IP 0x0001 /* will csum IP */ #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ -#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ +/* 0x0008 */ #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 11:15:37 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 757523F8; Tue, 30 Oct 2012 11:15:37 +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 51AF88FC17; Tue, 30 Oct 2012 11:15:37 +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 q9UBFb5t077854; Tue, 30 Oct 2012 11:15:37 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UBFavj077845; Tue, 30 Oct 2012 11:15:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210301115.q9UBFavj077845@svn.freebsd.org> From: Andre Oppermann Date: Tue, 30 Oct 2012 11:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242354 - in user/andre/tcp_workqueue/sys: dev/bce dev/bxe net netinet netpfil/pf sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 11:15:37 -0000 Author: andre Date: Tue Oct 30 11:15:36 2012 New Revision: 242354 URL: http://svn.freebsd.org/changeset/base/242354 Log: Rename unused CSUM_FRAGMENT offload capability to CSUM_IPFRAG to make clear is an IPv4 feature. No driver currently in the tree supports IP fragmentation offloading. It should be implementable in some of them though. Modified: user/andre/tcp_workqueue/sys/dev/bce/if_bce.c user/andre/tcp_workqueue/sys/dev/bxe/if_bxe.c user/andre/tcp_workqueue/sys/net/if_vlan.c user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c user/andre/tcp_workqueue/sys/netinet/ip_output.c user/andre/tcp_workqueue/sys/netpfil/pf/pf.c user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/dev/bce/if_bce.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/bce/if_bce.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/dev/bce/if_bce.c Tue Oct 30 11:15:36 2012 (r242354) @@ -9881,7 +9881,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru "\22M_PROMISC\23M_NOFREE", mp->m_pkthdr.csum_flags, "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" - "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" + "\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); } Modified: user/andre/tcp_workqueue/sys/dev/bxe/if_bxe.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/bxe/if_bxe.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/dev/bxe/if_bxe.c Tue Oct 30 11:15:36 2012 (r242354) @@ -16282,7 +16282,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc, "\22M_PROMISC\23M_NOFREE", m->m_pkthdr.csum_flags, "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" - "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" + "\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); } Modified: user/andre/tcp_workqueue/sys/net/if_vlan.c ============================================================================== --- user/andre/tcp_workqueue/sys/net/if_vlan.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/net/if_vlan.c Tue Oct 30 11:15:36 2012 (r242354) @@ -1493,7 +1493,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP | CSUM_IPFRAG); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/netinet/ip_fastfwd.c Tue Oct 30 11:15:36 2012 (r242354) @@ -522,7 +522,7 @@ passout: mtu = ifp->if_mtu; if (ip_len <= mtu || - (ifp->if_hwassist & CSUM_FRAGMENT && (ip_off & IP_DF) == 0)) { + (ifp->if_hwassist & CSUM_IPFRAG && (ip_off & IP_DF) == 0)) { /* * Send off the packet via outgoing interface */ Modified: user/andre/tcp_workqueue/sys/netinet/ip_output.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/ip_output.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/netinet/ip_output.c Tue Oct 30 11:15:36 2012 (r242354) @@ -601,7 +601,7 @@ passout: */ if (ip_len <= mtu || (m->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 || - ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) { + ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_IPFRAG))) { ip->ip_sum = 0; if (m->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) { ip->ip_sum = in_cksum(m, hlen); Modified: user/andre/tcp_workqueue/sys/netpfil/pf/pf.c ============================================================================== --- user/andre/tcp_workqueue/sys/netpfil/pf/pf.c Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/netpfil/pf/pf.c Tue Oct 30 11:15:36 2012 (r242354) @@ -5257,7 +5257,7 @@ pf_route(struct mbuf **m, struct pf_rule */ if (ip_len <= ifp->if_mtu || (m0->m_pkthdr.csum_flags & ifp->if_hwassist & CSUM_TSO) != 0 || - ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_FRAGMENT))) { + ((ip_off & IP_DF) == 0 && (ifp->if_hwassist & CSUM_IPFRAG))) { ip->ip_sum = 0; if (m0->m_pkthdr.csum_flags & CSUM_IP & ~ifp->if_hwassist) { ip->ip_sum = in_cksum(m0, ip->ip_hl << 2); Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:01:25 2012 (r242353) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:15:36 2012 (r242354) @@ -279,8 +279,8 @@ struct mbuf { #define CSUM_IP 0x0001 /* will csum IP */ #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ -/* 0x0008 */ -#define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ +#define CSUM_IPFRAG 0x0008 /* IP fragmentation offload */ +/* 0x0010 */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ #define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 11:42:10 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 39F3DBB1; Tue, 30 Oct 2012 11:42:10 +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 DF1798FC31; Tue, 30 Oct 2012 11:33:47 +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 q9UBXlAs080639; Tue, 30 Oct 2012 11:33:47 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UBXlke080637; Tue, 30 Oct 2012 11:33:47 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210301133.q9UBXlke080637@svn.freebsd.org> From: Andre Oppermann Date: Tue, 30 Oct 2012 11:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242355 - user/andre/tcp_workqueue/sys/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 11:42:10 -0000 Author: andre Date: Tue Oct 30 11:33:47 2012 New Revision: 242355 URL: http://svn.freebsd.org/changeset/base/242355 Log: Add define for CSUM_UFO which is UDP checksum offload. Spell out TSO as TCP segmentation offload. Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:15:36 2012 (r242354) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:33:47 2012 (r242355) @@ -280,8 +280,8 @@ struct mbuf { #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ #define CSUM_IPFRAG 0x0008 /* IP fragmentation offload */ -/* 0x0010 */ -#define CSUM_TSO 0x0020 /* will do TSO */ +#define CSUM_UFO 0x0010 /* UDP fragmentation offload */ +#define CSUM_TSO 0x0020 /* TCP segmentation offliad */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ #define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 11:44:15 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 BA729EBD; Tue, 30 Oct 2012 11:44:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 355CA8FC08; Tue, 30 Oct 2012 11:44:15 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9UBiDWH037058; Tue, 30 Oct 2012 15:44:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9UBiDDx037057; Tue, 30 Oct 2012 15:44:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 30 Oct 2012 15:44:13 +0400 From: Gleb Smirnoff To: Andre Oppermann Subject: Re: svn commit: r242355 - user/andre/tcp_workqueue/sys/sys Message-ID: <20121030114413.GC70741@FreeBSD.org> References: <201210301133.q9UBXlke080637@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210301133.q9UBXlke080637@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.org, svn-src-user@FreeBSD.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 11:44:15 -0000 On Tue, Oct 30, 2012 at 11:33:47AM +0000, Andre Oppermann wrote: A> Author: andre A> Date: Tue Oct 30 11:33:47 2012 A> New Revision: 242355 A> URL: http://svn.freebsd.org/changeset/base/242355 A> A> Log: A> Add define for CSUM_UFO which is UDP checksum offload. A> Spell out TSO as TCP segmentation offload. A> A> Modified: A> user/andre/tcp_workqueue/sys/sys/mbuf.h A> A> Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h A> ============================================================================== A> --- user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:15:36 2012 (r242354) A> +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:33:47 2012 (r242355) A> @@ -280,8 +280,8 @@ struct mbuf { A> #define CSUM_TCP 0x0002 /* will csum TCP */ A> #define CSUM_UDP 0x0004 /* will csum UDP */ A> #define CSUM_IPFRAG 0x0008 /* IP fragmentation offload */ A> -/* 0x0010 */ A> -#define CSUM_TSO 0x0020 /* will do TSO */ A> +#define CSUM_UFO 0x0010 /* UDP fragmentation offload */ So does it mean fragmentation as in comment or checksum as in commit log? A> +#define CSUM_TSO 0x0020 /* TCP segmentation offliad */ Typo in last word in comment. A> #define CSUM_SCTP 0x0040 /* will csum SCTP */ A> #define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ A> -- Totus tuus, Glebius. From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 12:00:46 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 53BA57D9 for ; Tue, 30 Oct 2012 12:00:46 +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 A3F168FC14 for ; Tue, 30 Oct 2012 12:00:45 +0000 (UTC) Received: (qmail 54827 invoked from network); 30 Oct 2012 13:37:29 -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 ; 30 Oct 2012 13:37:29 -0000 Message-ID: <508FC169.9050208@freebsd.org> Date: Tue, 30 Oct 2012 13:00:41 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r242355 - user/andre/tcp_workqueue/sys/sys References: <201210301133.q9UBXlke080637@svn.freebsd.org> <20121030114413.GC70741@FreeBSD.org> In-Reply-To: <20121030114413.GC70741@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, svn-src-user@FreeBSD.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 12:00:46 -0000 On 30.10.2012 12:44, Gleb Smirnoff wrote: > On Tue, Oct 30, 2012 at 11:33:47AM +0000, Andre Oppermann wrote: > A> Author: andre > A> Date: Tue Oct 30 11:33:47 2012 > A> New Revision: 242355 > A> URL: http://svn.freebsd.org/changeset/base/242355 > A> > A> Log: > A> Add define for CSUM_UFO which is UDP checksum offload. > A> Spell out TSO as TCP segmentation offload. > A> > A> Modified: > A> user/andre/tcp_workqueue/sys/sys/mbuf.h > A> > A> Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h > A> ============================================================================== > A> --- user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:15:36 2012 (r242354) > A> +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Tue Oct 30 11:33:47 2012 (r242355) > A> @@ -280,8 +280,8 @@ struct mbuf { > A> #define CSUM_TCP 0x0002 /* will csum TCP */ > A> #define CSUM_UDP 0x0004 /* will csum UDP */ > A> #define CSUM_IPFRAG 0x0008 /* IP fragmentation offload */ > A> -/* 0x0010 */ > A> -#define CSUM_TSO 0x0020 /* will do TSO */ > A> +#define CSUM_UFO 0x0010 /* UDP fragmentation offload */ > > So does it mean fragmentation as in comment or checksum as in commit log? Fragmentation as in comment. Commit message is wrong. > A> +#define CSUM_TSO 0x0020 /* TCP segmentation offliad */ > > Typo in last word in comment. Oops. Thanks. > A> #define CSUM_SCTP 0x0040 /* will csum SCTP */ > A> #define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ > A> -- Andre From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 20:40:22 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 408D54FB; Tue, 30 Oct 2012 20:40:22 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 259CE8FC12; Tue, 30 Oct 2012 20:40:22 +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 q9UKeMYI071690; Tue, 30 Oct 2012 20:40:22 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UKeLXV071688; Tue, 30 Oct 2012 20:40:21 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210302040.q9UKeLXV071688@svn.freebsd.org> From: Chris Rees Date: Tue, 30 Oct 2012 20:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242373 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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, 30 Oct 2012 20:40:22 -0000 Author: crees (ports committer) Date: Tue Oct 30 20:40:21 2012 New Revision: 242373 URL: http://svn.freebsd.org/changeset/base/242373 Log: Clarify the error message when rcvar is incorrectly set Modified: user/crees/rclint/errors.en Modified: user/crees/rclint/errors.en ============================================================================== --- user/crees/rclint/errors.en Tue Oct 30 19:46:00 2012 (r242372) +++ user/crees/rclint/errors.en Tue Oct 30 20:40:21 2012 (r242373) @@ -25,7 +25,7 @@ rcorder_order rcorder block in the wrong rcsid Missing FreeBSD RCSId keyword All rc scripts must contain a line beginning # $FreeBSD$. Do not include blank lines without comment markers at the beginning (#) until the script begins -rcvar_incorrect rcvar is not set correctly rcvar must be directly set to name_enable. Do not quote, and do not use indirection; ${name}_enable is slower than example_enable +rcvar_incorrect rcvar is not set correctly rcvar must be directly set to name_enable. Do not quote, and do not use indirection; ${name}_enable is slower than example_enable. `set_rcvar` was removed from FreeBSD in January 2012, so definitely do not use that run_rc_argument Incorrect argument to run_rc_command The last line of the file should be run_rc_command $1 From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 22:59:11 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 CEC736F0; Tue, 30 Oct 2012 22:59:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 38E368FC0C; Tue, 30 Oct 2012 22:59:09 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so793305lbd.13 for ; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=YmmG4loKjbpnI4othZnJrizeFrJaZp2oX+8Q1iqkOms=; b=PZDcLD1ZV+teJOwDpfAaqwOVv1Y3tekggFEHmQ6U7IkqSJy9+zmxwxLkAKUbijryvj qyHA6zEItfQlhXKj16mCui+SnaJBy3TqM1OJXMSOgd3AKW4h8nsaFq+y2B1/ebK1vN9N sUgujOFNC5YySMMqZPmwGyAJzgy7KEoplLpeqv1Ughkj+4m6feXzkq0USlB+2mzeNHXu t12Z7M+7JvFfxetr9NIMNT+NDkd2macZa0Y+1BPbmgSDLvxc1+fZ0jFArigzz8xH2hc0 Zx/67xwKa2gYkkDqHAaLXbFv5rg0oyYEajYaNbKz32At/VaHMH511TZe48fS0QcNcuEO 9ebA== MIME-Version: 1.0 Received: by 10.112.26.67 with SMTP id j3mr14147190lbg.39.1351637948573; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) In-Reply-To: <508F9C94.7080703@freebsd.org> References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> <508F9C94.7080703@freebsd.org> Date: Tue, 30 Oct 2012 22:59:08 +0000 X-Google-Sender-Auth: nITuBrsBh8uiJmziyWKIGl4nKzg Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Jeff Roberson Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, Andre Oppermann , John Baldwin , svn-src-user@freebsd.org, Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org 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, 30 Oct 2012 22:59:12 -0000 On Tue, Oct 30, 2012 at 9:23 AM, Andre Oppermann wrote: > On 30.10.2012 03:25, Attilio Rao wrote: >> >> On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao wrote: >>> >>> On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: >> >> >> [ trimm ] >> >>>> >>>> BTW, the mtx_sysuninit() introduction can be avoided by using this other >>>> trick: >>>> #define MTX_SYSINIT(name, mtx, desc, opts) >>>> \ >>>> static struct mtx_args name##_args = { >>>> \ >>>> (mtx), >>>> \ >>>> (desc), >>>> \ >>>> (opts) >>>> \ >>>> }; >>>> \ >>>> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>> \ >>>> mtx_sysinit, &name##_args); >>>> \ >>>> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>> \ >>>> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >>>> >>>> I'm just not sure that I would like the use of __DEVOLATILE() even if >>>> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >>>> because we will just need to reuse the same code. >>>> >>>> Also, the more I think about this the more I feel convinced that >>>> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a >>>> note to _mutex.h as a reminder for it. >>> >>> >>> Here is the patch that does both things and the one I would like to >>> commit: >>> http://www.freebsd.org/~attilio/mtx_decoupled3.patch >> >> >> BTW, I've updated the patch in order to make use of __containerof() >> rather than the manual frobbing. I had no idea that this method was >> existing, many thanks to andre@ and mdf@ for signaling it. >> Please refresh the patch. > > > Thank you for the updated patch. I have no objections to the patch, > though I'm not really qualified to have a final say on changes to the > mutex code. Jeff has replied privately to me saying that he would have preferred to see altogether also the implementation of padded mutexes along with the mtx decoupling interface. The following patch, does what expected: http://www.freebsd.org/~attilio/mtx_decoupled_padalign.patch I converted a bunch of locks and they work fine even with MTX_SYSINIT() with the small change contained in this patchset, so that doesn't require a separate KPI in the end. The patch is being tested right now and I will commit as soon as I will receive positive feedbacks. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-user@FreeBSD.ORG Wed Oct 31 08:17: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 0322BB49 for ; Wed, 31 Oct 2012 08:17:40 +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 3F2528FC15 for ; Wed, 31 Oct 2012 08:17:39 +0000 (UTC) Received: (qmail 65101 invoked from network); 31 Oct 2012 09:54:14 -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 ; 31 Oct 2012 09:54:14 -0000 Message-ID: <5090DE9E.5030301@freebsd.org> Date: Wed, 31 Oct 2012 09:17:34 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> <508F9C94.7080703@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: mdf@freebsd.org, src-committers@freebsd.org, John Baldwin , svn-src-user@freebsd.org, Jeff Roberson , Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 31 Oct 2012 08:17:40 -0000 On 30.10.2012 23:59, Attilio Rao wrote: > On Tue, Oct 30, 2012 at 9:23 AM, Andre Oppermann wrote: >> On 30.10.2012 03:25, Attilio Rao wrote: >>> >>> On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao wrote: >>>> >>>> On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: >>> >>> >>> [ trimm ] >>> >>>>> >>>>> BTW, the mtx_sysuninit() introduction can be avoided by using this other >>>>> trick: >>>>> #define MTX_SYSINIT(name, mtx, desc, opts) >>>>> \ >>>>> static struct mtx_args name##_args = { >>>>> \ >>>>> (mtx), >>>>> \ >>>>> (desc), >>>>> \ >>>>> (opts) >>>>> \ >>>>> }; >>>>> \ >>>>> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>>> \ >>>>> mtx_sysinit, &name##_args); >>>>> \ >>>>> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>>> \ >>>>> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >>>>> >>>>> I'm just not sure that I would like the use of __DEVOLATILE() even if >>>>> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >>>>> because we will just need to reuse the same code. >>>>> >>>>> Also, the more I think about this the more I feel convinced that >>>>> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a >>>>> note to _mutex.h as a reminder for it. >>>> >>>> >>>> Here is the patch that does both things and the one I would like to >>>> commit: >>>> http://www.freebsd.org/~attilio/mtx_decoupled3.patch >>> >>> >>> BTW, I've updated the patch in order to make use of __containerof() >>> rather than the manual frobbing. I had no idea that this method was >>> existing, many thanks to andre@ and mdf@ for signaling it. >>> Please refresh the patch. >> >> >> Thank you for the updated patch. I have no objections to the patch, >> though I'm not really qualified to have a final say on changes to the >> mutex code. > > Jeff has replied privately to me saying that he would have preferred > to see altogether also the implementation of padded mutexes along with > the mtx decoupling interface. > The following patch, does what expected: > http://www.freebsd.org/~attilio/mtx_decoupled_padalign.patch > > I converted a bunch of locks and they work fine even with > MTX_SYSINIT() with the small change contained in this patchset, so > that doesn't require a separate KPI in the end. > > The patch is being tested right now and I will commit as soon as I > will receive positive feedbacks. Haven't tested it but to me looks good and fulfills my requirements. :) -- Andre From owner-svn-src-user@FreeBSD.ORG Wed Oct 31 20:51:42 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 7668EA9B; Wed, 31 Oct 2012 20:51:42 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4ED8FC08; Wed, 31 Oct 2012 20:51: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 q9VKpg6v028334; Wed, 31 Oct 2012 20:51:42 GMT (envelope-from crees@svn.freebsd.org) Received: (from crees@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VKpgcl028332; Wed, 31 Oct 2012 20:51:42 GMT (envelope-from crees@svn.freebsd.org) Message-Id: <201210312051.q9VKpgcl028332@svn.freebsd.org> From: Chris Rees Date: Wed, 31 Oct 2012 20:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242405 - user/crees/rclint X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 31 Oct 2012 20:51:42 -0000 Author: crees (ports committer) Date: Wed Oct 31 20:51:41 2012 New Revision: 242405 URL: http://svn.freebsd.org/changeset/base/242405 Log: Be more relaxed about quoting by being observant of POSIX, rather than our sh's behaviour Submitted by: jilles Modified: user/crees/rclint/rclint.py Modified: user/crees/rclint/rclint.py ============================================================================== --- user/crees/rclint/rclint.py Wed Oct 31 19:17:55 2012 (r242404) +++ user/crees/rclint/rclint.py Wed Oct 31 20:51:41 2012 (r242405) @@ -109,11 +109,10 @@ class Statement: def pointless_quoted(self): if self.quoted(): - if self.type == 'shorthand': - return True - elif ' ' not in self.value and '\t' not in self.value: - return True - return False + for char in self.value: + if char in ' \t|&;<>()$`\\\"\'': + return False + return True class Variable(Statement): def __init__(self, lines, number): From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 16:49:45 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 BDB02505; Thu, 1 Nov 2012 16:49:45 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6908FC0A; Thu, 1 Nov 2012 16:49: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 qA1GnjDx034695; Thu, 1 Nov 2012 16:49:45 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1GnjP7034694; Thu, 1 Nov 2012 16:49:45 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011649.qA1GnjP7034694@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 16:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242436 - user/alfred X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 16:49:45 -0000 Author: alfred Date: Thu Nov 1 16:49:45 2012 New Revision: 242436 URL: http://svn.freebsd.org/changeset/base/242436 Log: Some space for my -stable branch. Added: user/alfred/ From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 16:52:00 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 C156D63C; Thu, 1 Nov 2012 16:52:00 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 907588FC08; Thu, 1 Nov 2012 16:52: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 qA1Gq0l6035134; Thu, 1 Nov 2012 16:52:00 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1Gq0fa035132; Thu, 1 Nov 2012 16:52:00 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011652.qA1Gq0fa035132@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 16:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242437 - user/alfred/9-alfred X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 16:52:00 -0000 Author: alfred Date: Thu Nov 1 16:52:00 2012 New Revision: 242437 URL: http://svn.freebsd.org/changeset/base/242437 Log: Place to hold/test my -stable contributions pre-MFC/pre-commit. Added: - copied from r242367, stable/9/ Directory Properties: user/alfred/9-alfred/ (props changed) From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:19:07 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 D4855DE5; Thu, 1 Nov 2012 17:19:07 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB9DA8FC0A; Thu, 1 Nov 2012 17:19: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 qA1HJ77E040065; Thu, 1 Nov 2012 17:19:07 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HJ7v8040057; Thu, 1 Nov 2012 17:19:07 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011719.qA1HJ7v8040057@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242442 - in user/alfred/9-alfred: share/man/man4 sys/conf sys/ddb X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:19:07 -0000 Author: alfred Date: Thu Nov 1 17:19:07 2012 New Revision: 242442 URL: http://svn.freebsd.org/changeset/base/242442 Log: Merge textdump enhancements from head. svn merge -c 242424,242427,242428,242440 ^/head/share svn merge -c 242424,242427,242428,242440 ^/head/sys Modified: user/alfred/9-alfred/share/man/man4/ddb.4 user/alfred/9-alfred/share/man/man4/textdump.4 user/alfred/9-alfred/sys/conf/NOTES user/alfred/9-alfred/sys/conf/options user/alfred/9-alfred/sys/ddb/db_command.c user/alfred/9-alfred/sys/ddb/db_textdump.c Directory Properties: user/alfred/9-alfred/ (props changed) user/alfred/9-alfred/share/ (props changed) user/alfred/9-alfred/share/man/ (props changed) user/alfred/9-alfred/share/man/man4/ (props changed) user/alfred/9-alfred/sys/ (props changed) user/alfred/9-alfred/sys/conf/ (props changed) Modified: user/alfred/9-alfred/share/man/man4/ddb.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:19:07 2012 (r242442) @@ -1176,6 +1176,7 @@ section for more information on the scri .It Ic textdump set .It Ic textdump status .It Ic textdump unset +.It Ic textdump dump The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1184,6 +1185,9 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. +Use the +.Ic textdump dump +command to immediately perform a textdump. More information may be found in .Xr textdump 4 . .El Modified: user/alfred/9-alfred/share/man/man4/textdump.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:19:07 2012 (r242442) @@ -36,6 +36,9 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB +.Pp +.Cd options TEXTDUMP_VERBOSE +.Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION The .Nm @@ -115,7 +118,11 @@ or by setting the .Dv debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , -it is possible to request that the next dump be a textdump. +it is possible to request that the next dump be a textdump. One can +also directly trigger a textdump in +.Xr ddb 4 +by running the command +.Ic textdump dump . .Pp If at the .Xr ddb 4 @@ -125,10 +132,30 @@ command line, the commands and .Ic textdump unset may be used to set, query, and clear the textdump pending flag. +The command +.Ic textdump dump +can be used to immediately trigger a textdump. .Pp As with regular kernel dumps, a dump partition must be automatically or manually configured using .Xr dumpon 8 . +.Pp +Additional kernel +.Xr config 8 +options: +.Bl -tag -width TEXTDUMP_PREFERRED +.It Cd TEXTDUMP_PREFERRED +sets textdumps to be the default manner of doing dumps. This means there +will be no need to +.Xr sysctl 8 +or use the +.Ic textdump set +.Xr ddb 8 +commands. +.It Cd TEXTDUMP_VERBOSE +will have the textdump facility be more verbose about each file it is emitting +as well as other diagnostics useful to debug the textdump facility itself. +.El .Sh EXAMPLES In the following example, the script .Dv kdb.enter.panic Modified: user/alfred/9-alfred/sys/conf/NOTES ============================================================================== --- user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:19:07 2012 (r242442) @@ -389,6 +389,16 @@ options GDB options SYSCTL_DEBUG # +# Enable textdump by default, this disables kernel core dumps. +# +options TEXTDUMP_PREFERRED + +# +# Enable extra debug messages while performing textdumps. +# +options TEXTDUMP_VERBOSE + +# # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. options NO_SYSCTL_DESCR Modified: user/alfred/9-alfred/sys/conf/options ============================================================================== --- user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:19:07 2012 (r242442) @@ -60,6 +60,8 @@ KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h SYSCTL_DEBUG opt_sysctl.h +TEXTDUMP_PREFERRED opt_ddb.h +TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS Modified: user/alfred/9-alfred/sys/ddb/db_command.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:19:07 2012 (r242442) @@ -535,6 +535,11 @@ db_dump(db_expr_t dummy, boolean_t dummy { int error; + if (textdump_pending) { + db_printf("textdump_pending set.\n" + "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n"); + return; + } error = doadump(FALSE); if (error) { db_printf("Cannot dump: "); Modified: user/alfred/9-alfred/sys/ddb/db_textdump.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:17:05 2012 (r242441) +++ user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:19:07 2012 (r242442) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include "opt_config.h" +#include "opt_ddb.h" + #include #include #include @@ -118,7 +120,11 @@ CTASSERT(sizeof(struct ustar_header) == * Is a textdump scheduled? If so, the shutdown code will invoke our dumpsys * routine instead of the machine-dependent kernel dump routine. */ -int textdump_pending; +#ifdef TEXTDUMP_PREFERRED +int textdump_pending = 1; +#else +int textdump_pending = 0; +#endif SYSCTL_INT(_debug_ddb_textdump, OID_AUTO, pending, CTLFLAG_RW, &textdump_pending, 0, "Perform textdump instead of regular kernel dump."); @@ -201,6 +207,10 @@ textdump_mkustar(char *block_buffer, con { struct ustar_header *uhp; +#ifdef TEXTDUMP_VERBOSE + if (textdump_error == 0) + printf("textdump: creating '%s'.\n", filename); +#endif uhp = (struct ustar_header *)block_buffer; bzero(uhp, sizeof(*uhp)); strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename)); @@ -237,6 +247,9 @@ textdump_writeblock(struct dumperinfo *d return (ENOSPC); textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, TEXTDUMP_BLOCKSIZE); + if (textdump_error) + printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, + textdump_error); return (textdump_error); } @@ -430,7 +443,7 @@ textdump_dumpsys(struct dumperinfo *di) * of data. */ if (di->mediasize < SIZEOF_METADATA + 2 * sizeof(kdh)) { - printf("Insufficient space on dump partition.\n"); + printf("Insufficient space on dump partition for minimal textdump.\n"); return; } textdump_error = 0; @@ -480,9 +493,9 @@ textdump_dumpsys(struct dumperinfo *di) if (textdump_error == 0) (void)dump_write(di, NULL, 0, 0, 0); if (textdump_error == ENOSPC) - printf("Insufficient space on dump partition\n"); + printf("Textdump: Insufficient space on dump partition\n"); else if (textdump_error != 0) - printf("Error %d writing dump\n", textdump_error); + printf("Textdump: Error %d writing dump\n", textdump_error); else printf("Textdump complete.\n"); textdump_pending = 0; @@ -499,7 +512,7 @@ static void db_textdump_usage(void) { - db_printf("textdump [unset|set|status]\n"); + db_printf("textdump [unset|set|status|dump]\n"); } void @@ -528,6 +541,10 @@ db_textdump_cmd(db_expr_t addr, boolean_ } else if (strcmp(db_tok_string, "unset") == 0) { textdump_pending = 0; db_printf("textdump unset\n"); - } else + } else if (strcmp(db_tok_string, "dump") == 0) { + textdump_pending = 1; + doadump(TRUE); + } else { db_textdump_usage(); + } } From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:22:41 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 D04ECF64; Thu, 1 Nov 2012 17:22:41 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8FDB8FC12; Thu, 1 Nov 2012 17:22:41 +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 qA1HMfvo040769; Thu, 1 Nov 2012 17:22:41 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HMfNS040767; Thu, 1 Nov 2012 17:22:41 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011722.qA1HMfNS040767@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242443 - user/alfred/9-alfred/sys/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:22:41 -0000 Author: alfred Date: Thu Nov 1 17:22:41 2012 New Revision: 242443 URL: http://svn.freebsd.org/changeset/base/242443 Log: Merge r242029: scale maxusers past 384 for mbufs. Modified: user/alfred/9-alfred/sys/kern/subr_param.c Directory Properties: user/alfred/9-alfred/sys/ (props changed) Modified: user/alfred/9-alfred/sys/kern/subr_param.c ============================================================================== --- user/alfred/9-alfred/sys/kern/subr_param.c Thu Nov 1 17:19:07 2012 (r242442) +++ user/alfred/9-alfred/sys/kern/subr_param.c Thu Nov 1 17:22:41 2012 (r242443) @@ -278,8 +278,16 @@ init_param2(long physpages) maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; - if (maxusers > 384) - maxusers = 384; + /* + * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. + * Scales it down 6x for large memory machines. + */ + if (maxusers > 384) { + if (sizeof(void *) <= 4) + maxusers = 384; + else + maxusers = 384 + ((maxusers - 384) / 6); + } } /* From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:27:33 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 A8FE3209; Thu, 1 Nov 2012 17:27:33 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90E488FC0A; Thu, 1 Nov 2012 17:27:33 +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 qA1HRXvY041771; Thu, 1 Nov 2012 17:27:33 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HRXYD041769; Thu, 1 Nov 2012 17:27:33 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011727.qA1HRXYD041769@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242444 - user/alfred/9-alfred/usr.bin/netstat X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:27:33 -0000 Author: alfred Date: Thu Nov 1 17:27:33 2012 New Revision: 242444 URL: http://svn.freebsd.org/changeset/base/242444 Log: Merge 242030, show number of times we blocked on mbufs. Modified: user/alfred/9-alfred/usr.bin/netstat/mbuf.c Directory Properties: user/alfred/9-alfred/usr.bin/netstat/ (props changed) Modified: user/alfred/9-alfred/usr.bin/netstat/mbuf.c ============================================================================== --- user/alfred/9-alfred/usr.bin/netstat/mbuf.c Thu Nov 1 17:22:41 2012 (r242443) +++ user/alfred/9-alfred/usr.bin/netstat/mbuf.c Thu Nov 1 17:27:33 2012 (r242444) @@ -67,16 +67,18 @@ mbpr(void *kvmd, u_long mbaddr) struct memory_type_list *mtlp; struct memory_type *mtp; uintmax_t mbuf_count, mbuf_bytes, mbuf_free, mbuf_failures, mbuf_size; + uintmax_t mbuf_sleeps; uintmax_t cluster_count, cluster_bytes, cluster_limit, cluster_free; - uintmax_t cluster_failures, cluster_size; + uintmax_t cluster_failures, cluster_size, cluster_sleeps; uintmax_t packet_count, packet_bytes, packet_free, packet_failures; + uintmax_t packet_sleeps; uintmax_t tag_count, tag_bytes; uintmax_t jumbop_count, jumbop_bytes, jumbop_limit, jumbop_free; - uintmax_t jumbop_failures, jumbop_size; + uintmax_t jumbop_failures, jumbop_sleeps, jumbop_size; uintmax_t jumbo9_count, jumbo9_bytes, jumbo9_limit, jumbo9_free; - uintmax_t jumbo9_failures, jumbo9_size; + uintmax_t jumbo9_failures, jumbo9_sleeps, jumbo9_size; uintmax_t jumbo16_count, jumbo16_bytes, jumbo16_limit, jumbo16_free; - uintmax_t jumbo16_failures, jumbo16_size; + uintmax_t jumbo16_failures, jumbo16_sleeps, jumbo16_size; uintmax_t bytes_inuse, bytes_incache, bytes_total; int nsfbufs, nsfbufspeak, nsfbufsused; struct mbstat mbstat; @@ -121,6 +123,7 @@ mbpr(void *kvmd, u_long mbaddr) mbuf_bytes = memstat_get_bytes(mtp); mbuf_free = memstat_get_free(mtp); mbuf_failures = memstat_get_failures(mtp); + mbuf_sleeps = memstat_get_sleeps(mtp); mbuf_size = memstat_get_size(mtp); mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_PACKET_MEM_NAME); @@ -132,6 +135,7 @@ mbpr(void *kvmd, u_long mbaddr) packet_count = memstat_get_count(mtp); packet_bytes = memstat_get_bytes(mtp); packet_free = memstat_get_free(mtp); + packet_sleeps = memstat_get_sleeps(mtp); packet_failures = memstat_get_failures(mtp); mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_CLUSTER_MEM_NAME); @@ -145,6 +149,7 @@ mbpr(void *kvmd, u_long mbaddr) cluster_limit = memstat_get_countlimit(mtp); cluster_free = memstat_get_free(mtp); cluster_failures = memstat_get_failures(mtp); + cluster_sleeps = memstat_get_sleeps(mtp); cluster_size = memstat_get_size(mtp); mtp = memstat_mtl_find(mtlp, ALLOCATOR_MALLOC, MBUF_TAG_MEM_NAME); @@ -167,6 +172,7 @@ mbpr(void *kvmd, u_long mbaddr) jumbop_limit = memstat_get_countlimit(mtp); jumbop_free = memstat_get_free(mtp); jumbop_failures = memstat_get_failures(mtp); + jumbop_sleeps = memstat_get_sleeps(mtp); jumbop_size = memstat_get_size(mtp); mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_JUMBO9_MEM_NAME); @@ -180,6 +186,7 @@ mbpr(void *kvmd, u_long mbaddr) jumbo9_limit = memstat_get_countlimit(mtp); jumbo9_free = memstat_get_free(mtp); jumbo9_failures = memstat_get_failures(mtp); + jumbo9_sleeps = memstat_get_sleeps(mtp); jumbo9_size = memstat_get_size(mtp); mtp = memstat_mtl_find(mtlp, ALLOCATOR_UMA, MBUF_JUMBO16_MEM_NAME); @@ -193,6 +200,7 @@ mbpr(void *kvmd, u_long mbaddr) jumbo16_limit = memstat_get_countlimit(mtp); jumbo16_free = memstat_get_free(mtp); jumbo16_failures = memstat_get_failures(mtp); + jumbo16_sleeps = memstat_get_sleeps(mtp); jumbo16_size = memstat_get_size(mtp); printf("%ju/%ju/%ju mbufs in use (current/cache/total)\n", @@ -279,7 +287,13 @@ mbpr(void *kvmd, u_long mbaddr) printf("%ju/%ju/%ju requests for mbufs denied (mbufs/clusters/" "mbuf+clusters)\n", mbuf_failures, cluster_failures, packet_failures); - + printf("%ju/%ju/%ju requests for mbufs delayed (mbufs/clusters/" + "mbuf+clusters)\n", mbuf_sleeps, cluster_sleeps, + packet_sleeps); + + printf("%ju/%ju/%ju requests for jumbo clusters delayed " + "(%juk/9k/16k)\n", jumbop_sleeps, jumbo9_sleeps, + jumbo16_sleeps, jumbop_size / 1024); printf("%ju/%ju/%ju requests for jumbo clusters denied " "(%juk/9k/16k)\n", jumbop_failures, jumbo9_failures, jumbo16_failures, jumbop_size / 1024); From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:30:33 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 9DB86377; Thu, 1 Nov 2012 17:30:33 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84B348FC0A; Thu, 1 Nov 2012 17:30:33 +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 qA1HUXTl042332; Thu, 1 Nov 2012 17:30:33 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HUXg0042325; Thu, 1 Nov 2012 17:30:33 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011730.qA1HUXg0042325@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242445 - in user/alfred/9-alfred: share/man/man4 sys/conf sys/ddb X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:30:33 -0000 Author: alfred Date: Thu Nov 1 17:30:33 2012 New Revision: 242445 URL: http://svn.freebsd.org/changeset/base/242445 Log: This merge was done incorrectly under "share", back it out. It should have been done under share/man/man9. Modified: user/alfred/9-alfred/share/man/man4/ddb.4 user/alfred/9-alfred/share/man/man4/textdump.4 user/alfred/9-alfred/sys/conf/NOTES user/alfred/9-alfred/sys/conf/options user/alfred/9-alfred/sys/ddb/db_command.c user/alfred/9-alfred/sys/ddb/db_textdump.c Directory Properties: user/alfred/9-alfred/ (props changed) user/alfred/9-alfred/share/ (props changed) user/alfred/9-alfred/share/man/ (props changed) user/alfred/9-alfred/share/man/man4/ (props changed) user/alfred/9-alfred/sys/ (props changed) user/alfred/9-alfred/sys/conf/ (props changed) Modified: user/alfred/9-alfred/share/man/man4/ddb.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:30:33 2012 (r242445) @@ -1176,7 +1176,6 @@ section for more information on the scri .It Ic textdump set .It Ic textdump status .It Ic textdump unset -.It Ic textdump dump The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1185,9 +1184,6 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. -Use the -.Ic textdump dump -command to immediately perform a textdump. More information may be found in .Xr textdump 4 . .El Modified: user/alfred/9-alfred/share/man/man4/textdump.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:30:33 2012 (r242445) @@ -36,9 +36,6 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB -.Pp -.Cd options TEXTDUMP_VERBOSE -.Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION The .Nm @@ -118,11 +115,7 @@ or by setting the .Dv debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , -it is possible to request that the next dump be a textdump. One can -also directly trigger a textdump in -.Xr ddb 4 -by running the command -.Ic textdump dump . +it is possible to request that the next dump be a textdump. .Pp If at the .Xr ddb 4 @@ -132,30 +125,10 @@ command line, the commands and .Ic textdump unset may be used to set, query, and clear the textdump pending flag. -The command -.Ic textdump dump -can be used to immediately trigger a textdump. .Pp As with regular kernel dumps, a dump partition must be automatically or manually configured using .Xr dumpon 8 . -.Pp -Additional kernel -.Xr config 8 -options: -.Bl -tag -width TEXTDUMP_PREFERRED -.It Cd TEXTDUMP_PREFERRED -sets textdumps to be the default manner of doing dumps. This means there -will be no need to -.Xr sysctl 8 -or use the -.Ic textdump set -.Xr ddb 8 -commands. -.It Cd TEXTDUMP_VERBOSE -will have the textdump facility be more verbose about each file it is emitting -as well as other diagnostics useful to debug the textdump facility itself. -.El .Sh EXAMPLES In the following example, the script .Dv kdb.enter.panic Modified: user/alfred/9-alfred/sys/conf/NOTES ============================================================================== --- user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:30:33 2012 (r242445) @@ -389,16 +389,6 @@ options GDB options SYSCTL_DEBUG # -# Enable textdump by default, this disables kernel core dumps. -# -options TEXTDUMP_PREFERRED - -# -# Enable extra debug messages while performing textdumps. -# -options TEXTDUMP_VERBOSE - -# # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. options NO_SYSCTL_DESCR Modified: user/alfred/9-alfred/sys/conf/options ============================================================================== --- user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:30:33 2012 (r242445) @@ -60,8 +60,6 @@ KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h SYSCTL_DEBUG opt_sysctl.h -TEXTDUMP_PREFERRED opt_ddb.h -TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS Modified: user/alfred/9-alfred/sys/ddb/db_command.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:30:33 2012 (r242445) @@ -535,11 +535,6 @@ db_dump(db_expr_t dummy, boolean_t dummy { int error; - if (textdump_pending) { - db_printf("textdump_pending set.\n" - "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n"); - return; - } error = doadump(FALSE); if (error) { db_printf("Cannot dump: "); Modified: user/alfred/9-alfred/sys/ddb/db_textdump.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:27:33 2012 (r242444) +++ user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:30:33 2012 (r242445) @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD$"); #include "opt_config.h" -#include "opt_ddb.h" - #include #include #include @@ -120,11 +118,7 @@ CTASSERT(sizeof(struct ustar_header) == * Is a textdump scheduled? If so, the shutdown code will invoke our dumpsys * routine instead of the machine-dependent kernel dump routine. */ -#ifdef TEXTDUMP_PREFERRED -int textdump_pending = 1; -#else -int textdump_pending = 0; -#endif +int textdump_pending; SYSCTL_INT(_debug_ddb_textdump, OID_AUTO, pending, CTLFLAG_RW, &textdump_pending, 0, "Perform textdump instead of regular kernel dump."); @@ -207,10 +201,6 @@ textdump_mkustar(char *block_buffer, con { struct ustar_header *uhp; -#ifdef TEXTDUMP_VERBOSE - if (textdump_error == 0) - printf("textdump: creating '%s'.\n", filename); -#endif uhp = (struct ustar_header *)block_buffer; bzero(uhp, sizeof(*uhp)); strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename)); @@ -247,9 +237,6 @@ textdump_writeblock(struct dumperinfo *d return (ENOSPC); textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, TEXTDUMP_BLOCKSIZE); - if (textdump_error) - printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, - textdump_error); return (textdump_error); } @@ -443,7 +430,7 @@ textdump_dumpsys(struct dumperinfo *di) * of data. */ if (di->mediasize < SIZEOF_METADATA + 2 * sizeof(kdh)) { - printf("Insufficient space on dump partition for minimal textdump.\n"); + printf("Insufficient space on dump partition.\n"); return; } textdump_error = 0; @@ -493,9 +480,9 @@ textdump_dumpsys(struct dumperinfo *di) if (textdump_error == 0) (void)dump_write(di, NULL, 0, 0, 0); if (textdump_error == ENOSPC) - printf("Textdump: Insufficient space on dump partition\n"); + printf("Insufficient space on dump partition\n"); else if (textdump_error != 0) - printf("Textdump: Error %d writing dump\n", textdump_error); + printf("Error %d writing dump\n", textdump_error); else printf("Textdump complete.\n"); textdump_pending = 0; @@ -512,7 +499,7 @@ static void db_textdump_usage(void) { - db_printf("textdump [unset|set|status|dump]\n"); + db_printf("textdump [unset|set|status]\n"); } void @@ -541,10 +528,6 @@ db_textdump_cmd(db_expr_t addr, boolean_ } else if (strcmp(db_tok_string, "unset") == 0) { textdump_pending = 0; db_printf("textdump unset\n"); - } else if (strcmp(db_tok_string, "dump") == 0) { - textdump_pending = 1; - doadump(TRUE); - } else { + } else db_textdump_usage(); - } } From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:33: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 32AB04DB; Thu, 1 Nov 2012 17:33:53 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C6C8FC0C; Thu, 1 Nov 2012 17:33: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 qA1HXqvc042973; Thu, 1 Nov 2012 17:33:52 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HXqqR042966; Thu, 1 Nov 2012 17:33:52 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011733.qA1HXqqR042966@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242446 - in user/alfred/9-alfred: share/man/man4 sys/conf sys/ddb X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:33:53 -0000 Author: alfred Date: Thu Nov 1 17:33:52 2012 New Revision: 242446 URL: http://svn.freebsd.org/changeset/base/242446 Log: re-do: Merge textdump enhancements from head. svn merge -c 242424,242427,242428,242440 ^/head/share/man/man4 svn merge -c 242424,242427,242428,242440 ^/head/sys Modified: user/alfred/9-alfred/share/man/man4/ddb.4 user/alfred/9-alfred/share/man/man4/textdump.4 user/alfred/9-alfred/sys/conf/NOTES user/alfred/9-alfred/sys/conf/options user/alfred/9-alfred/sys/ddb/db_command.c user/alfred/9-alfred/sys/ddb/db_textdump.c Directory Properties: user/alfred/9-alfred/share/man/man4/ (props changed) user/alfred/9-alfred/sys/ (props changed) user/alfred/9-alfred/sys/conf/ (props changed) Modified: user/alfred/9-alfred/share/man/man4/ddb.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:33:52 2012 (r242446) @@ -1176,6 +1176,7 @@ section for more information on the scri .It Ic textdump set .It Ic textdump status .It Ic textdump unset +.It Ic textdump dump The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1184,6 +1185,9 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. +Use the +.Ic textdump dump +command to immediately perform a textdump. More information may be found in .Xr textdump 4 . .El Modified: user/alfred/9-alfred/share/man/man4/textdump.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/share/man/man4/textdump.4 Thu Nov 1 17:33:52 2012 (r242446) @@ -36,6 +36,9 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB +.Pp +.Cd options TEXTDUMP_VERBOSE +.Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION The .Nm @@ -115,7 +118,11 @@ or by setting the .Dv debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , -it is possible to request that the next dump be a textdump. +it is possible to request that the next dump be a textdump. One can +also directly trigger a textdump in +.Xr ddb 4 +by running the command +.Ic textdump dump . .Pp If at the .Xr ddb 4 @@ -125,10 +132,30 @@ command line, the commands and .Ic textdump unset may be used to set, query, and clear the textdump pending flag. +The command +.Ic textdump dump +can be used to immediately trigger a textdump. .Pp As with regular kernel dumps, a dump partition must be automatically or manually configured using .Xr dumpon 8 . +.Pp +Additional kernel +.Xr config 8 +options: +.Bl -tag -width TEXTDUMP_PREFERRED +.It Cd TEXTDUMP_PREFERRED +sets textdumps to be the default manner of doing dumps. This means there +will be no need to +.Xr sysctl 8 +or use the +.Ic textdump set +.Xr ddb 8 +commands. +.It Cd TEXTDUMP_VERBOSE +will have the textdump facility be more verbose about each file it is emitting +as well as other diagnostics useful to debug the textdump facility itself. +.El .Sh EXAMPLES In the following example, the script .Dv kdb.enter.panic Modified: user/alfred/9-alfred/sys/conf/NOTES ============================================================================== --- user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/sys/conf/NOTES Thu Nov 1 17:33:52 2012 (r242446) @@ -389,6 +389,16 @@ options GDB options SYSCTL_DEBUG # +# Enable textdump by default, this disables kernel core dumps. +# +options TEXTDUMP_PREFERRED + +# +# Enable extra debug messages while performing textdumps. +# +options TEXTDUMP_VERBOSE + +# # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. options NO_SYSCTL_DESCR Modified: user/alfred/9-alfred/sys/conf/options ============================================================================== --- user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/sys/conf/options Thu Nov 1 17:33:52 2012 (r242446) @@ -60,6 +60,8 @@ KDB opt_global.h KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h SYSCTL_DEBUG opt_sysctl.h +TEXTDUMP_PREFERRED opt_ddb.h +TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS Modified: user/alfred/9-alfred/sys/ddb/db_command.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/sys/ddb/db_command.c Thu Nov 1 17:33:52 2012 (r242446) @@ -535,6 +535,11 @@ db_dump(db_expr_t dummy, boolean_t dummy { int error; + if (textdump_pending) { + db_printf("textdump_pending set.\n" + "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n"); + return; + } error = doadump(FALSE); if (error) { db_printf("Cannot dump: "); Modified: user/alfred/9-alfred/sys/ddb/db_textdump.c ============================================================================== --- user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:30:33 2012 (r242445) +++ user/alfred/9-alfred/sys/ddb/db_textdump.c Thu Nov 1 17:33:52 2012 (r242446) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include "opt_config.h" +#include "opt_ddb.h" + #include #include #include @@ -118,7 +120,11 @@ CTASSERT(sizeof(struct ustar_header) == * Is a textdump scheduled? If so, the shutdown code will invoke our dumpsys * routine instead of the machine-dependent kernel dump routine. */ -int textdump_pending; +#ifdef TEXTDUMP_PREFERRED +int textdump_pending = 1; +#else +int textdump_pending = 0; +#endif SYSCTL_INT(_debug_ddb_textdump, OID_AUTO, pending, CTLFLAG_RW, &textdump_pending, 0, "Perform textdump instead of regular kernel dump."); @@ -201,6 +207,10 @@ textdump_mkustar(char *block_buffer, con { struct ustar_header *uhp; +#ifdef TEXTDUMP_VERBOSE + if (textdump_error == 0) + printf("textdump: creating '%s'.\n", filename); +#endif uhp = (struct ustar_header *)block_buffer; bzero(uhp, sizeof(*uhp)); strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename)); @@ -237,6 +247,9 @@ textdump_writeblock(struct dumperinfo *d return (ENOSPC); textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, TEXTDUMP_BLOCKSIZE); + if (textdump_error) + printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, + textdump_error); return (textdump_error); } @@ -430,7 +443,7 @@ textdump_dumpsys(struct dumperinfo *di) * of data. */ if (di->mediasize < SIZEOF_METADATA + 2 * sizeof(kdh)) { - printf("Insufficient space on dump partition.\n"); + printf("Insufficient space on dump partition for minimal textdump.\n"); return; } textdump_error = 0; @@ -480,9 +493,9 @@ textdump_dumpsys(struct dumperinfo *di) if (textdump_error == 0) (void)dump_write(di, NULL, 0, 0, 0); if (textdump_error == ENOSPC) - printf("Insufficient space on dump partition\n"); + printf("Textdump: Insufficient space on dump partition\n"); else if (textdump_error != 0) - printf("Error %d writing dump\n", textdump_error); + printf("Textdump: Error %d writing dump\n", textdump_error); else printf("Textdump complete.\n"); textdump_pending = 0; @@ -499,7 +512,7 @@ static void db_textdump_usage(void) { - db_printf("textdump [unset|set|status]\n"); + db_printf("textdump [unset|set|status|dump]\n"); } void @@ -528,6 +541,10 @@ db_textdump_cmd(db_expr_t addr, boolean_ } else if (strcmp(db_tok_string, "unset") == 0) { textdump_pending = 0; db_printf("textdump unset\n"); - } else + } else if (strcmp(db_tok_string, "dump") == 0) { + textdump_pending = 1; + doadump(TRUE); + } else { db_textdump_usage(); + } } From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:36:34 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 5B3BB609; Thu, 1 Nov 2012 17:36:34 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 431BD8FC08; Thu, 1 Nov 2012 17:36: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 qA1HaYIk043483; Thu, 1 Nov 2012 17:36:34 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HaYE8043481; Thu, 1 Nov 2012 17:36:34 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011736.qA1HaYE8043481@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:36:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242447 - user/alfred/9-alfred/share/man/man4 X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:36:34 -0000 Author: alfred Date: Thu Nov 1 17:36:33 2012 New Revision: 242447 URL: http://svn.freebsd.org/changeset/base/242447 Log: merge more fixes for my textdump manual changes. svn merge -c 242441 ^/head/share/man/man4 Modified: user/alfred/9-alfred/share/man/man4/ddb.4 Directory Properties: user/alfred/9-alfred/share/man/man4/ (props changed) Modified: user/alfred/9-alfred/share/man/man4/ddb.4 ============================================================================== --- user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:33:52 2012 (r242446) +++ user/alfred/9-alfred/share/man/man4/ddb.4 Thu Nov 1 17:36:33 2012 (r242447) @@ -1173,10 +1173,15 @@ See the .Sx SCRIPTING section for more information on the scripting facility. .Pp +.It Ic textdump dump .It Ic textdump set .It Ic textdump status .It Ic textdump unset -.It Ic textdump dump +Use the +.Ic textdump dump +command to immediately perform a textdump. +More information may be found in +.Xr textdump 4 . The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1185,11 +1190,6 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. -Use the -.Ic textdump dump -command to immediately perform a textdump. -More information may be found in -.Xr textdump 4 . .El .Sh VARIABLES The debugger accesses registers and variables as From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 17:38:05 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 9F38E734; Thu, 1 Nov 2012 17:38:05 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85E998FC08; Thu, 1 Nov 2012 17:38:05 +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 qA1Hc5Sx043787; Thu, 1 Nov 2012 17:38:05 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1Hc5cU043782; Thu, 1 Nov 2012 17:38:05 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011738.qA1Hc5cU043782@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:38:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242448 - in user/alfred/9-alfred/sys: dev/null geom kern sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:38:05 -0000 Author: alfred Date: Thu Nov 1 17:38:04 2012 New Revision: 242448 URL: http://svn.freebsd.org/changeset/base/242448 Log: MFC: Show dumpdev via sysctl. svn merge -c 242439 ^/head/sys Modified: user/alfred/9-alfred/sys/dev/null/null.c user/alfred/9-alfred/sys/geom/geom_dev.c user/alfred/9-alfred/sys/kern/kern_shutdown.c user/alfred/9-alfred/sys/sys/conf.h Directory Properties: user/alfred/9-alfred/sys/ (props changed) user/alfred/9-alfred/sys/dev/ (props changed) Modified: user/alfred/9-alfred/sys/dev/null/null.c ============================================================================== --- user/alfred/9-alfred/sys/dev/null/null.c Thu Nov 1 17:36:33 2012 (r242447) +++ user/alfred/9-alfred/sys/dev/null/null.c Thu Nov 1 17:38:04 2012 (r242448) @@ -91,7 +91,7 @@ null_ioctl(struct cdev *dev __unused, u_ case DIOCSKERNELDUMP: error = priv_check(td, PRIV_SETDUMPER); if (error == 0) - error = set_dumper(NULL); + error = set_dumper(NULL, NULL); break; case FIONBIO: break; Modified: user/alfred/9-alfred/sys/geom/geom_dev.c ============================================================================== --- user/alfred/9-alfred/sys/geom/geom_dev.c Thu Nov 1 17:36:33 2012 (r242447) +++ user/alfred/9-alfred/sys/geom/geom_dev.c Thu Nov 1 17:38:04 2012 (r242448) @@ -351,7 +351,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd case DIOCSKERNELDUMP: u = *((u_int *)data); if (!u) { - set_dumper(NULL); + set_dumper(NULL, NULL); error = 0; break; } @@ -360,7 +360,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd i = sizeof kd; error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); if (!error) { - error = set_dumper(&kd.di); + error = set_dumper(&kd.di, devtoname(dev)); if (!error) dev->si_flags |= SI_DUMPDEV; } @@ -518,7 +518,7 @@ g_dev_orphan(struct g_consumer *cp) /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) - set_dumper(NULL); + set_dumper(NULL, NULL); /* Destroy the struct cdev *so we get no more requests */ destroy_dev(dev); Modified: user/alfred/9-alfred/sys/kern/kern_shutdown.c ============================================================================== --- user/alfred/9-alfred/sys/kern/kern_shutdown.c Thu Nov 1 17:36:33 2012 (r242447) +++ user/alfred/9-alfred/sys/kern/kern_shutdown.c Thu Nov 1 17:38:04 2012 (r242448) @@ -711,18 +711,28 @@ kthread_shutdown(void *arg, int howto) printf("done\n"); } +static char dumpdevname[sizeof(((struct cdev*)NULL)->si_name)]; +SYSCTL_STRING(_kern_shutdown, OID_AUTO, dumpdevname, CTLFLAG_RD, + dumpdevname, 0, "Device for kernel dumps"); + /* Registration of dumpers */ int -set_dumper(struct dumperinfo *di) +set_dumper(struct dumperinfo *di, const char *devname) { if (di == NULL) { bzero(&dumper, sizeof dumper); + dumpdevname[0] = '\0'; return (0); } if (dumper.dumper != NULL) return (EBUSY); dumper = *di; + strlcpy(dumpdevname, devname, sizeof(dumpdevname)); + if (strlen(dumpdevname) != strlen(devname)) { + printf("set_dumper: device name truncated from '%s' -> '%s'\n", + devname, dumpdevname); + } return (0); } Modified: user/alfred/9-alfred/sys/sys/conf.h ============================================================================== --- user/alfred/9-alfred/sys/sys/conf.h Thu Nov 1 17:36:33 2012 (r242447) +++ user/alfred/9-alfred/sys/sys/conf.h Thu Nov 1 17:38:04 2012 (r242448) @@ -335,7 +335,7 @@ struct dumperinfo { off_t mediasize; /* Space available in bytes. */ }; -int set_dumper(struct dumperinfo *); +int set_dumper(struct dumperinfo *, const char *_devname); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); void dumpsys(struct dumperinfo *); int doadump(boolean_t); From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 18:51:11 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 EF4AF1CA; Thu, 1 Nov 2012 18:51:11 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE5708FC17; Thu, 1 Nov 2012 18:51:11 +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 qA1IpBOl055454; Thu, 1 Nov 2012 18:51:11 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1IpBue055452; Thu, 1 Nov 2012 18:51:11 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011851.qA1IpBue055452@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 18:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242449 - user/alfred/9-alfred/sbin/dumpon X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 18:51:12 -0000 Author: alfred Date: Thu Nov 1 18:51:11 2012 New Revision: 242449 URL: http://svn.freebsd.org/changeset/base/242449 Log: Add -l option to dumpon(8). Show which dumpdev is currently enabled. When dumps are disabled show _PATH_DEVNULL ("/dev/null"). Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.c Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.c ============================================================================== --- user/alfred/9-alfred/sbin/dumpon/dumpon.c Thu Nov 1 17:38:04 2012 (r242448) +++ user/alfred/9-alfred/sbin/dumpon/dumpon.c Thu Nov 1 18:51:11 2012 (r242449) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,9 +61,10 @@ static int verbose; static void usage(void) { - fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: dumpon [-v] special_file", - " dumpon [-v] off"); + " dumpon [-v] off", + " dumpon -l"); exit(EX_USAGE); } @@ -92,15 +94,45 @@ check_size(int fd, const char *fn) } } +static void +listdumpdev(void) +{ + char dumpdev[PATH_MAX]; + size_t len; + const char *sysctlname = "kern.shutdown.dumpdevname"; + + len = sizeof(dumpdev); + if (sysctlbyname(sysctlname, &dumpdev, &len, NULL, 0) != 0) { + if (errno == ENOMEM) { + err(EX_OSERR, "Kernel returned too large of a buffer for '%s'\n", + sysctlname); + } else { + err(EX_OSERR, "Sysctl get '%s'\n", sysctlname); + } + } + if (verbose) { + printf("kernel dumps on "); + } + if (strlen(dumpdev) == 0) { + printf("%s\n", _PATH_DEVNULL); + } else { + printf("%s\n", dumpdev); + } +} + int main(int argc, char *argv[]) { int ch; int i, fd; u_int u; + int do_listdumpdev = 0; - while ((ch = getopt(argc, argv, "v")) != -1) + while ((ch = getopt(argc, argv, "lv")) != -1) switch((char)ch) { + case 'l': + do_listdumpdev = 1; + break; case 'v': verbose = 1; break; @@ -111,6 +143,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (do_listdumpdev) { + listdumpdev(); + exit(EX_OK); + } + if (argc != 1) usage(); From owner-svn-src-user@FreeBSD.ORG Thu Nov 1 18:55: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 080033BE; Thu, 1 Nov 2012 18:55:18 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E521F8FC0C; Thu, 1 Nov 2012 18:55: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 qA1ItHnY056269; Thu, 1 Nov 2012 18:55:17 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1ItHhV056266; Thu, 1 Nov 2012 18:55:17 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011855.qA1ItHhV056266@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 18:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242450 - user/alfred/9-alfred/sbin/dumpon X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 18:55:18 -0000 Author: alfred Date: Thu Nov 1 18:55:17 2012 New Revision: 242450 URL: http://svn.freebsd.org/changeset/base/242450 Log: document dumpon -l Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.8 Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.8 ============================================================================== --- user/alfred/9-alfred/sbin/dumpon/dumpon.8 Thu Nov 1 18:51:11 2012 (r242449) +++ user/alfred/9-alfred/sbin/dumpon/dumpon.8 Thu Nov 1 18:55:17 2012 (r242450) @@ -41,6 +41,8 @@ .Nm .Op Fl v .Cm off +.Nm +.Fl l .Sh DESCRIPTION The .Nm @@ -72,6 +74,13 @@ total amount of physical memory as repor variable. .Pp The +.Fl l +flag causes +.Nm +to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is +configured. +.Pp +The .Fl v flag causes .Nm From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 13:43:17 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 E8F45DF3; Fri, 2 Nov 2012 13:43:17 +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 C56EA8FC16; Fri, 2 Nov 2012 13:43: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 qA2DhHdO031788; Fri, 2 Nov 2012 13:43:17 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2DhHHr031786; Fri, 2 Nov 2012 13:43:17 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211021343.qA2DhHHr031786@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Nov 2012 13:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242473 - user/andre/tcp_workqueue/sys/dev/ixgbe X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 13:43:18 -0000 Author: andre Date: Fri Nov 2 13:43:17 2012 New Revision: 242473 URL: http://svn.freebsd.org/changeset/base/242473 Log: Merge ixgbe_tx_ctx_setup() and ixgbe_tso_setup() together into ixgbe_offload_setup() as they have a large overlap in packet inspection and variables. Add UDP fragmentation offload functionality as well. Also the driver can assume that the necessary headers for the activated offload functions are contiguously present in the first mbuf. This assumption is not formalized yet but significantly simplify the driver code. The upper layers of the stack adhere to this assumption as well. We leave enough leading space in the mbufs to prepend all registered (max_linkhdr) encapsulations. There may be misbehaving packet transformations that have to be fixed. Assertion functions have to be provided as well. This change is not tested yet because I lack the hardware. This change translates well to other driver with a similar structure. Modified: user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c Modified: user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c ============================================================================== --- user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c Fri Nov 2 12:18:38 2012 (r242472) +++ user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c Fri Nov 2 13:43:17 2012 (r242473) @@ -165,8 +165,8 @@ static int ixgbe_dma_malloc(struct adapt static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); static void ixgbe_add_rx_process_limit(struct adapter *, const char *, const char *, int *, int); -static bool ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *); -static bool ixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); +static bool ixgbe_offload_setup(struct tx_ring *, struct mbuf *, u32 *, + u32 *); static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); static void ixgbe_configure_ivars(struct adapter *); static u8 * ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); @@ -1726,7 +1726,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m { struct adapter *adapter = txr->adapter; u32 olinfo_status = 0, cmd_type_len; - u32 paylen = 0; int i, j, error, nsegs; int first, last = 0; struct mbuf *m_head; @@ -1741,9 +1740,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m cmd_type_len = (IXGBE_ADVTXD_DTYP_DATA | IXGBE_ADVTXD_DCMD_IFCS | IXGBE_ADVTXD_DCMD_DEXT); - if (m_head->m_flags & M_VLANTAG) - cmd_type_len |= IXGBE_ADVTXD_DCMD_VLE; - /* * Important to capture the first descriptor * used because it will contain the index of @@ -1807,16 +1803,18 @@ ixgbe_xmit(struct tx_ring *txr, struct m ** this becomes the first descriptor of ** a packet. */ - if (m_head->m_pkthdr.csum_flags & CSUM_TSO) { - if (ixgbe_tso_setup(txr, m_head, &paylen, &olinfo_status)) { - cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; - olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; + if ((m_head->m_flags & M_VLANTAG) || + (m_head->m_pkthdr.csum_flags & + (CSUM_IP|CSUM_TCP|CSUM_TCP_IPV6|CSUM_TSO|CSUM_UDP|CSUM_UDP_IPV6| + CSUM_UFO|CSUM_SCTP|CSUM_SCTP_IPV6))) { + if (ixgbe_offload_setup(txr, m_head, &cmd_type_len, + &olinfo_status)) ++adapter->tso_tx; - } else + else return (ENXIO); - } else if (ixgbe_tx_ctx_setup(txr, m_head)) - olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + } else + olinfo_status |= m_head->m_pkthdr.len << + IXGBE_ADVTXD_PAYLEN_SHIFT; #ifdef IXGBE_IEEE1588 /* This is changing soon to an mtag detection */ @@ -1834,10 +1832,6 @@ ixgbe_xmit(struct tx_ring *txr, struct m } } #endif - /* Record payload length */ - if (paylen == 0) - olinfo_status |= m_head->m_pkthdr.len << - IXGBE_ADVTXD_PAYLEN_SHIFT; i = txr->next_avail_desc; for (j = 0; j < nsegs; j++) { @@ -1851,7 +1845,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m txd->read.buffer_addr = segaddr; txd->read.cmd_type_len = htole32(txr->txd_cmd | - cmd_type_len |seglen); + cmd_type_len | seglen); txd->read.olinfo_status = htole32(olinfo_status); last = i; /* descriptor that will get completion IRQ */ @@ -3220,157 +3214,40 @@ ixgbe_free_transmit_buffers(struct tx_ri return; } -/********************************************************************* - * - * Advanced Context Descriptor setup for VLAN or CSUM - * - **********************************************************************/ - -static bool -ixgbe_tx_ctx_setup(struct tx_ring *txr, struct mbuf *mp) -{ - struct adapter *adapter = txr->adapter; - struct ixgbe_adv_tx_context_desc *TXD; - struct ixgbe_tx_buf *tx_buffer; - u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; - struct ether_vlan_header *eh; - struct ip *ip; - struct ip6_hdr *ip6; - int ehdrlen, ip_hlen = 0; - u16 etype; - u8 ipproto = 0; - bool offload = TRUE; - int ctxd = txr->next_avail_desc; - u16 vtag = 0; - - - if ((mp->m_pkthdr.csum_flags & CSUM_OFFLOAD) == 0) - offload = FALSE; - - tx_buffer = &txr->tx_buffers[ctxd]; - TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; - - /* - ** In advanced descriptors the vlan tag must - ** be placed into the descriptor itself. - */ - if (mp->m_flags & M_VLANTAG) { - vtag = htole16(mp->m_pkthdr.ether_vtag); - vlan_macip_lens |= (vtag << IXGBE_ADVTXD_VLAN_SHIFT); - } else if (offload == FALSE) - return FALSE; - - /* - * Determine where frame payload starts. - * Jump over vlan headers if already present, - * helpful for QinQ too. - */ - eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { - etype = ntohs(eh->evl_proto); - ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - } else { - etype = ntohs(eh->evl_encap_proto); - ehdrlen = ETHER_HDR_LEN; - } - - /* Set the ether header length */ - vlan_macip_lens |= ehdrlen << IXGBE_ADVTXD_MACLEN_SHIFT; - - switch (etype) { - case ETHERTYPE_IP: - ip = (struct ip *)(mp->m_data + ehdrlen); - ip_hlen = ip->ip_hl << 2; - ipproto = ip->ip_p; - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; - break; - case ETHERTYPE_IPV6: - ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); - ip_hlen = sizeof(struct ip6_hdr); - /* XXX-BZ this will go badly in case of ext hdrs. */ - ipproto = ip6->ip6_nxt; - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; - break; - default: - offload = FALSE; - break; - } - - vlan_macip_lens |= ip_hlen; - type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; - - switch (ipproto) { - case IPPROTO_TCP: - if (mp->m_pkthdr.csum_flags & CSUM_TCP) - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; - break; - - case IPPROTO_UDP: - if (mp->m_pkthdr.csum_flags & CSUM_UDP) - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; - break; - -#if __FreeBSD_version >= 800000 - case IPPROTO_SCTP: - if (mp->m_pkthdr.csum_flags & CSUM_SCTP) - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP; - break; -#endif - default: - offload = FALSE; - break; - } - - /* Now copy bits into descriptor */ - TXD->vlan_macip_lens |= htole32(vlan_macip_lens); - TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); - TXD->seqnum_seed = htole32(0); - TXD->mss_l4len_idx = htole32(0); - - tx_buffer->m_head = NULL; - tx_buffer->eop_index = -1; - - /* We've consumed the first desc, adjust counters */ - if (++ctxd == adapter->num_tx_desc) - ctxd = 0; - txr->next_avail_desc = ctxd; - --txr->tx_avail; - - return (offload); -} - /********************************************************************** * + * Advanced Context Descriptor setup for VLAN or CSUM. * Setup work for hardware segmentation offload (TSO) on - * adapters using advanced tx descriptors + * adapters using advanced tx descriptors. * **********************************************************************/ static bool -ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen, +ixgbe_offload_setup(struct tx_ring *txr, struct mbuf *m, u32 *cmd_type_len, u32 *olinfo_status) { struct adapter *adapter = txr->adapter; struct ixgbe_adv_tx_context_desc *TXD; struct ixgbe_tx_buf *tx_buffer; u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0; - u32 mss_l4len_idx = 0, len; - u16 vtag = 0, eh_type; - int ctxd, ehdrlen, ip_hlen, tcp_hlen; struct ether_vlan_header *eh; -#ifdef INET6 - struct ip6_hdr *ip6; -#endif #ifdef INET struct ip *ip; #endif +#ifdef INET6 + struct ip6_hdr *ip6; +#endif struct tcphdr *th; - + int ctxd, ehdrlen, ip_hlen = 0, l4_hlen = 0; + u32 mss_l4len_idx = 0; + u32 paylen = m->m_pkthdr.len; + u16 vtag = 0, eh_type; + u8 ipproto = 0; /* * Determine where frame payload starts. * Jump over vlan headers if already present */ - eh = mtod(mp, struct ether_vlan_header *); + eh = mtod(m, struct ether_vlan_header *); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; eh_type = eh->evl_proto; @@ -3378,74 +3255,97 @@ ixgbe_tso_setup(struct tx_ring *txr, str ehdrlen = ETHER_HDR_LEN; eh_type = eh->evl_encap_proto; } + if (m->m_flags & M_VLANTAG) { + vtag = htole16(m->m_pkthdr.ether_vtag); + vlan_macip_lens |= vtag << IXGBE_ADVTXD_VLAN_SHIFT; + *cmd_type_len |= IXGBE_ADVTXD_DCMD_VLE; + } + + /* Set the ether header length */ + vlan_macip_lens |= ehdrlen << IXGBE_ADVTXD_MACLEN_SHIFT; - /* Ensure we have at least the IP+TCP header in the first mbuf. */ - len = ehdrlen + sizeof(struct tcphdr); switch (ntohs(eh_type)) { -#ifdef INET6 - case ETHERTYPE_IPV6: - if (mp->m_len < len + sizeof(struct ip6_hdr)) - return FALSE; - ip6 = (struct ip6_hdr *)(mp->m_data + ehdrlen); - /* XXX-BZ For now we do not pretend to support ext. hdrs. */ - if (ip6->ip6_nxt != IPPROTO_TCP) - return FALSE; - ip_hlen = sizeof(struct ip6_hdr); - th = (struct tcphdr *)((caddr_t)ip6 + ip_hlen); - th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; - break; -#endif #ifdef INET case ETHERTYPE_IP: - if (mp->m_len < len + sizeof(struct ip)) - return FALSE; - ip = (struct ip *)(mp->m_data + ehdrlen); - if (ip->ip_p != IPPROTO_TCP) - return FALSE; - ip->ip_sum = 0; + ip = mtod(m + ehdrlen, struct ip *); ip_hlen = ip->ip_hl << 2; - th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + ipproto = ip->ip_p; + if (m->m_pkthdr.csum_flags & CSUM_IP) { + ip->ip_sum = 0; + *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; + } type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV4; - /* Tell transmit desc to also do IPv4 checksum. */ - *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; + break; +#endif +#ifdef INET6 + case ETHERTYPE_IPV6: + ip6 = mtod(m + ehdrlen, struct ip6_hdr *); + ip_hlen = sizeof(struct ip6_hdr); + ipproto = ip6->ip6_nxt; + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; break; #endif default: - panic("%s: CSUM_TSO but no supported IP version (0x%04x)", - __func__, ntohs(eh_type)); + return (FALSE); break; } - ctxd = txr->next_avail_desc; - tx_buffer = &txr->tx_buffers[ctxd]; - TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; + vlan_macip_lens |= ip_hlen; - tcp_hlen = th->th_off << 2; + switch (ipproto) { + case IPPROTO_TCP: + th = mtod(m + ehdrlen + ip_hlen, struct tcphdr *); + l4_hlen = th->th_off << 2; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_TCP_IPV6)) + *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + if (m->m_pkthdr.csum_flags & (CSUM_TSO | 0)) { + *cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; + paylen -= ehdrlen + ip_hlen + l4_hlen; + } + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; + break; - /* This is used in the transmit desc in encap */ - *paylen = mp->m_pkthdr.len - ehdrlen - ip_hlen - tcp_hlen; + case IPPROTO_UDP: + l4_hlen = sizeof(struct udphdr); + if (m->m_pkthdr.csum_flags & (CSUM_UDP | CSUM_UDP_IPV6)) + *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + if (m->m_pkthdr.csum_flags & (CSUM_UFO | 0)) { + *cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE; + paylen -= ehdrlen + ip_hlen + l4_hlen; + } + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; + break; - /* VLAN MACLEN IPLEN */ - if (mp->m_flags & M_VLANTAG) { - vtag = htole16(mp->m_pkthdr.ether_vtag); - vlan_macip_lens |= (vtag << IXGBE_ADVTXD_VLAN_SHIFT); +#if __FreeBSD_version >= 800000 + case IPPROTO_SCTP: + if (m->m_pkthdr.csum_flags & (CSUM_SCTP | CSUM_SCTP_IPV6)) + *olinfo_status |= IXGBE_TXD_POPTS_TXSM << 8; + type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP; + break; +#endif + default: + /* Only IP header checksumming or nothing. */ + break; } - vlan_macip_lens |= ehdrlen << IXGBE_ADVTXD_MACLEN_SHIFT; - vlan_macip_lens |= ip_hlen; - TXD->vlan_macip_lens |= htole32(vlan_macip_lens); + /* This is used in the transmit desc in encap */ + *olinfo_status |= paylen << IXGBE_ADVTXD_PAYLEN_SHIFT; + + /* Descriptor context setup starts here. */ + ctxd = txr->next_avail_desc; + tx_buffer = &txr->tx_buffers[ctxd]; + TXD = (struct ixgbe_adv_tx_context_desc *) &txr->tx_base[ctxd]; /* ADV DTYPE TUCMD */ type_tucmd_mlhl |= IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DTYP_CTXT; - type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; TXD->type_tucmd_mlhl |= htole32(type_tucmd_mlhl); + /* VLAN MAC LEN */ + TXD->vlan_macip_lens |= htole32(vlan_macip_lens); + /* MSS L4LEN IDX */ - mss_l4len_idx |= (mp->m_pkthdr.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT); - mss_l4len_idx |= (tcp_hlen << IXGBE_ADVTXD_L4LEN_SHIFT); + mss_l4len_idx |= (m->m_pkthdr.tso_segsz << IXGBE_ADVTXD_MSS_SHIFT); + mss_l4len_idx |= (l4_hlen << IXGBE_ADVTXD_L4LEN_SHIFT); TXD->mss_l4len_idx = htole32(mss_l4len_idx); TXD->seqnum_seed = htole32(0); @@ -3457,7 +3357,8 @@ ixgbe_tso_setup(struct tx_ring *txr, str txr->tx_avail--; txr->next_avail_desc = ctxd; - return TRUE; + + return (TRUE); } #ifdef IXGBE_FDIR From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 17:31:28 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 3A49B26E; Fri, 2 Nov 2012 17:31:28 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217528FC08; Fri, 2 Nov 2012 17:31:28 +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 qA2HVRWQ069179; Fri, 2 Nov 2012 17:31:27 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2HVR3o069176; Fri, 2 Nov 2012 17:31:27 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211021731.qA2HVR3o069176@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 2 Nov 2012 17:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242487 - user/alfred/9-alfred/sbin/dumpon X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:31:28 -0000 Author: alfred Date: Fri Nov 2 17:31:27 2012 New Revision: 242487 URL: http://svn.freebsd.org/changeset/base/242487 Log: Document -v with -l. MFC: 242486 svn merge -c 242486 ^/head/sbin/dumpon Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.8 user/alfred/9-alfred/sbin/dumpon/dumpon.c Directory Properties: user/alfred/9-alfred/sbin/dumpon/ (props changed) Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.8 ============================================================================== --- user/alfred/9-alfred/sbin/dumpon/dumpon.8 Fri Nov 2 17:30:08 2012 (r242486) +++ user/alfred/9-alfred/sbin/dumpon/dumpon.8 Fri Nov 2 17:31:27 2012 (r242487) @@ -42,6 +42,7 @@ .Op Fl v .Cm off .Nm +.Op Fl v .Fl l .Sh DESCRIPTION The Modified: user/alfred/9-alfred/sbin/dumpon/dumpon.c ============================================================================== --- user/alfred/9-alfred/sbin/dumpon/dumpon.c Fri Nov 2 17:30:08 2012 (r242486) +++ user/alfred/9-alfred/sbin/dumpon/dumpon.c Fri Nov 2 17:31:27 2012 (r242487) @@ -64,7 +64,7 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n", "usage: dumpon [-v] special_file", " dumpon [-v] off", - " dumpon -l"); + " dumpon [-v] -l"); exit(EX_USAGE); } From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 18:54:11 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 1415551B; Fri, 2 Nov 2012 18:54:11 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF6BB8FC0C; Fri, 2 Nov 2012 18:54: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 qA2IsAtq082144; Fri, 2 Nov 2012 18:54:10 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2IsAVd082142; Fri, 2 Nov 2012 18:54:10 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211021854.qA2IsAVd082142@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 2 Nov 2012 18:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242488 - user/alfred/9-alfred/sys/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 18:54:11 -0000 Author: alfred Date: Fri Nov 2 18:54:10 2012 New Revision: 242488 URL: http://svn.freebsd.org/changeset/base/242488 Log: Optimize sysctl, better strlcpy test. Submitted by: Eric van Gyzen Modified: user/alfred/9-alfred/sys/kern/kern_shutdown.c Modified: user/alfred/9-alfred/sys/kern/kern_shutdown.c ============================================================================== --- user/alfred/9-alfred/sys/kern/kern_shutdown.c Fri Nov 2 17:31:27 2012 (r242487) +++ user/alfred/9-alfred/sys/kern/kern_shutdown.c Fri Nov 2 18:54:10 2012 (r242488) @@ -719,6 +719,7 @@ SYSCTL_STRING(_kern_shutdown, OID_AUTO, int set_dumper(struct dumperinfo *di, const char *devname) { + size_t wantcopy; if (di == NULL) { bzero(&dumper, sizeof dumper); @@ -728,8 +729,8 @@ set_dumper(struct dumperinfo *di, const if (dumper.dumper != NULL) return (EBUSY); dumper = *di; - strlcpy(dumpdevname, devname, sizeof(dumpdevname)); - if (strlen(dumpdevname) != strlen(devname)) { + wantcopy = strlcpy(dumpdevname, devname, sizeof(dumpdevname)); + if (wantcopy >= sizeof(dumpdevname)) { printf("set_dumper: device name truncated from '%s' -> '%s'\n", devname, dumpdevname); } From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 20:36:42 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 3CE4179; Fri, 2 Nov 2012 20:36:42 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABC28FC0A; Fri, 2 Nov 2012 20:36: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 qA2Kafwg097286; Fri, 2 Nov 2012 20:36:41 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2KafBC097283; Fri, 2 Nov 2012 20:36:41 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211022036.qA2KafBC097283@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 2 Nov 2012 20:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242491 - user/alfred/9-alfred/sys/fs/tmpfs X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 20:36:42 -0000 Author: alfred Date: Fri Nov 2 20:36:41 2012 New Revision: 242491 URL: http://svn.freebsd.org/changeset/base/242491 Log: Merge from stable, nfs export tmpfs. svn merge -c 234346 ^/head/sys Modified: user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c Directory Properties: user/alfred/9-alfred/sys/ (props changed) user/alfred/9-alfred/sys/fs/ (props changed) Modified: user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h ============================================================================== --- user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h Fri Nov 2 20:23:41 2012 (r242490) +++ user/alfred/9-alfred/sys/fs/tmpfs/tmpfs.h Fri Nov 2 20:36:41 2012 (r242491) @@ -387,6 +387,9 @@ struct tmpfs_mount { * tmpfs_pool.c. */ uma_zone_t tm_dirent_pool; uma_zone_t tm_node_pool; + + /* Read-only status. */ + int tm_ronly; }; #define TMPFS_LOCK(tm) mtx_lock(&(tm)->allnode_lock) #define TMPFS_UNLOCK(tm) mtx_unlock(&(tm)->allnode_lock) Modified: user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 2 20:23:41 2012 (r242490) +++ user/alfred/9-alfred/sys/fs/tmpfs/tmpfs_vfsops.c Fri Nov 2 20:36:41 2012 (r242491) @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { NULL }; +static const char *tmpfs_updateopts[] = { + "from", "export", NULL +}; + /* --------------------------------------------------------------------- */ static int @@ -193,10 +197,13 @@ tmpfs_mount(struct mount *mp) return (EINVAL); if (mp->mnt_flag & MNT_UPDATE) { - /* XXX: There is no support yet to update file system - * settings. Should be added. */ - - return EOPNOTSUPP; + /* Only support update mounts for certain options. */ + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) + return (EOPNOTSUPP); + if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) != + ((struct tmpfs_mount *)mp->mnt_data)->tm_ronly) + return (EOPNOTSUPP); + return (0); } vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); @@ -269,6 +276,7 @@ tmpfs_mount(struct mount *mp) tmpfs_node_ctor, tmpfs_node_dtor, tmpfs_node_init, tmpfs_node_fini, UMA_ALIGN_PTR, 0); + tmp->tm_ronly = (mp->mnt_flag & MNT_RDONLY) != 0; /* Allocate the root node. */ error = tmpfs_alloc_node(tmp, VDIR, root_uid, From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 21:07:31 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 2ACCDAF0; Fri, 2 Nov 2012 21:07:31 +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 0B0B98FC17; Fri, 2 Nov 2012 21:07:31 +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 qA2L7UbN001771; Fri, 2 Nov 2012 21:07:30 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2L7UJ6001769; Fri, 2 Nov 2012 21:07:30 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211022107.qA2L7UJ6001769@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Nov 2012 21:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242493 - user/andre/tcp_workqueue/sys/sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 21:07:31 -0000 Author: andre Date: Fri Nov 2 21:07:30 2012 New Revision: 242493 URL: http://svn.freebsd.org/changeset/base/242493 Log: Spelling. Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h Modified: user/andre/tcp_workqueue/sys/sys/mbuf.h ============================================================================== --- user/andre/tcp_workqueue/sys/sys/mbuf.h Fri Nov 2 21:04:06 2012 (r242492) +++ user/andre/tcp_workqueue/sys/sys/mbuf.h Fri Nov 2 21:07:30 2012 (r242493) @@ -281,7 +281,7 @@ struct mbuf { #define CSUM_UDP 0x0004 /* will csum UDP */ #define CSUM_IPFRAG 0x0008 /* IP fragmentation offload */ #define CSUM_UFO 0x0010 /* UDP fragmentation offload */ -#define CSUM_TSO 0x0020 /* TCP segmentation offliad */ +#define CSUM_TSO 0x0020 /* TCP segmentation offload */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ #define CSUM_SCTP_IPV6 0x0080 /* will csum IPv6/SCTP */ From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 21:11:57 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 5C519C4F; Fri, 2 Nov 2012 21:11:57 +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 3FE918FC12; Fri, 2 Nov 2012 21:11:57 +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 qA2LBvn5002479; Fri, 2 Nov 2012 21:11:57 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2LBu75002456; Fri, 2 Nov 2012 21:11:56 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211022111.qA2LBu75002456@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Nov 2012 21:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242494 - in user/andre/tcp_workqueue/sys: amd64/amd64 amd64/include arm/broadcom/bcm2835 arm/conf arm/lpc arm/mv arm/mv/armadaxp arm/tegra arm/ti/omap4 cam/ctl cam/scsi cddl/contrib/op... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 21:11:57 -0000 Author: andre Date: Fri Nov 2 21:11:56 2012 New Revision: 242494 URL: http://svn.freebsd.org/changeset/base/242494 Log: Integrate from HEAD @242493. Added: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c - copied unchanged from r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Modified: user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c user/andre/tcp_workqueue/sys/amd64/include/md_var.h user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 user/andre/tcp_workqueue/sys/arm/conf/RPI-B user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c user/andre/tcp_workqueue/sys/cam/ctl/ctl.c user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c user/andre/tcp_workqueue/sys/conf/NOTES user/andre/tcp_workqueue/sys/conf/options user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c user/andre/tcp_workqueue/sys/contrib/octeon-sdk/octeon-feature.c user/andre/tcp_workqueue/sys/contrib/octeon-sdk/octeon-feature.h user/andre/tcp_workqueue/sys/ddb/db_command.c user/andre/tcp_workqueue/sys/ddb/db_textdump.c user/andre/tcp_workqueue/sys/dev/age/if_age.c user/andre/tcp_workqueue/sys/dev/ata/ata-all.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah.h user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah_devid.h user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ah_internal.h user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c user/andre/tcp_workqueue/sys/dev/ath/ath_rate/sample/sample.c user/andre/tcp_workqueue/sys/dev/ath/if_ath.c user/andre/tcp_workqueue/sys/dev/ath/if_ath_ahb.c user/andre/tcp_workqueue/sys/dev/ath/if_ath_misc.h user/andre/tcp_workqueue/sys/dev/ath/if_ath_pci.c user/andre/tcp_workqueue/sys/dev/ath/if_ath_tx.c user/andre/tcp_workqueue/sys/dev/ath/if_athvar.h user/andre/tcp_workqueue/sys/dev/bce/if_bcereg.h user/andre/tcp_workqueue/sys/dev/bge/if_bge.c user/andre/tcp_workqueue/sys/dev/drm2/drm_drv.c user/andre/tcp_workqueue/sys/dev/hwpmc/hwpmc_mod.c user/andre/tcp_workqueue/sys/dev/isp/isp_pci.c user/andre/tcp_workqueue/sys/dev/isp/isp_sbus.c user/andre/tcp_workqueue/sys/dev/ixgbe/ixgbe.c user/andre/tcp_workqueue/sys/dev/mmc/mmc.c user/andre/tcp_workqueue/sys/dev/null/null.c user/andre/tcp_workqueue/sys/dev/nvme/nvme_qpair.c user/andre/tcp_workqueue/sys/dev/sdhci/sdhci.c user/andre/tcp_workqueue/sys/dev/sdhci/sdhci.h user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa.c user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa.h user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdaa_patches.c user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdac.c user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdac.h user/andre/tcp_workqueue/sys/dev/sound/pci/hda/hdacc.c user/andre/tcp_workqueue/sys/dev/sound/pcm/mixer.h user/andre/tcp_workqueue/sys/dev/sound/usb/uaudio.c user/andre/tcp_workqueue/sys/dev/ti/if_ti.c user/andre/tcp_workqueue/sys/dev/uart/uart_dev_pl011.c user/andre/tcp_workqueue/sys/dev/usb/usb_msctest.c user/andre/tcp_workqueue/sys/fs/nullfs/null_vnops.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs.h user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_io.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_node.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_node.h user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_smb.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_subr.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_subr.h user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_vfsops.c user/andre/tcp_workqueue/sys/fs/smbfs/smbfs_vnops.c user/andre/tcp_workqueue/sys/fs/unionfs/union_subr.c user/andre/tcp_workqueue/sys/geom/geom_dev.c user/andre/tcp_workqueue/sys/geom/geom_disk.c user/andre/tcp_workqueue/sys/geom/geom_disk.h user/andre/tcp_workqueue/sys/geom/label/g_label_ufs.c user/andre/tcp_workqueue/sys/geom/raid/g_raid.c user/andre/tcp_workqueue/sys/geom/raid/g_raid.h user/andre/tcp_workqueue/sys/geom/raid/md_ddf.c user/andre/tcp_workqueue/sys/geom/raid/md_intel.c user/andre/tcp_workqueue/sys/geom/raid/md_jmicron.c user/andre/tcp_workqueue/sys/geom/raid/md_nvidia.c user/andre/tcp_workqueue/sys/geom/raid/md_promise.c user/andre/tcp_workqueue/sys/geom/raid/md_sii.c user/andre/tcp_workqueue/sys/geom/raid/tr_concat.c user/andre/tcp_workqueue/sys/geom/raid/tr_raid0.c user/andre/tcp_workqueue/sys/geom/raid/tr_raid1.c user/andre/tcp_workqueue/sys/geom/raid/tr_raid1e.c user/andre/tcp_workqueue/sys/i386/ibcs2/imgact_coff.c user/andre/tcp_workqueue/sys/kern/kern_exec.c user/andre/tcp_workqueue/sys/kern/kern_mutex.c user/andre/tcp_workqueue/sys/kern/kern_shutdown.c user/andre/tcp_workqueue/sys/kern/kern_timeout.c user/andre/tcp_workqueue/sys/kern/sched_ule.c user/andre/tcp_workqueue/sys/kern/subr_trap.c user/andre/tcp_workqueue/sys/kern/vfs_default.c user/andre/tcp_workqueue/sys/kern/vfs_vnops.c user/andre/tcp_workqueue/sys/kern/vnode_if.src user/andre/tcp_workqueue/sys/mips/cavium/files.octeon1 user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-common.c user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-rgmii.c user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-rx.c user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-sgmii.c user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet-xaui.c user/andre/tcp_workqueue/sys/mips/cavium/octe/ethernet.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_ebt3000_cf.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_machdep.c user/andre/tcp_workqueue/sys/mips/cavium/octeon_pcmap_regs.h user/andre/tcp_workqueue/sys/mips/cavium/octopci.c user/andre/tcp_workqueue/sys/mips/cavium/uart_cpu_octeonusart.c user/andre/tcp_workqueue/sys/mips/mips/busdma_machdep.c user/andre/tcp_workqueue/sys/net/pfil.c user/andre/tcp_workqueue/sys/net/pfil.h 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/ip_var.h user/andre/tcp_workqueue/sys/netinet/sctp_output.c user/andre/tcp_workqueue/sys/netinet/sctp_uio.h user/andre/tcp_workqueue/sys/netinet/sctp_var.h user/andre/tcp_workqueue/sys/netinet/sctputil.c user/andre/tcp_workqueue/sys/netinet/tcp_input.c user/andre/tcp_workqueue/sys/netinet/udp_usrreq.c user/andre/tcp_workqueue/sys/netinet6/ip6_forward.c user/andre/tcp_workqueue/sys/netinet6/ip6_input.c user/andre/tcp_workqueue/sys/netinet6/ip6_output.c user/andre/tcp_workqueue/sys/netinet6/ip6_var.h user/andre/tcp_workqueue/sys/netinet6/sctp6_var.h user/andre/tcp_workqueue/sys/netinet6/udp6_usrreq.c user/andre/tcp_workqueue/sys/netpfil/ipfw/ip_fw2.c user/andre/tcp_workqueue/sys/netpfil/ipfw/ip_fw_pfil.c user/andre/tcp_workqueue/sys/netsmb/smb_conn.c user/andre/tcp_workqueue/sys/netsmb/smb_dev.c user/andre/tcp_workqueue/sys/netsmb/smb_trantcp.c user/andre/tcp_workqueue/sys/netsmb/smb_usr.c user/andre/tcp_workqueue/sys/powerpc/powermac/openpic_macio.c user/andre/tcp_workqueue/sys/sys/_mutex.h user/andre/tcp_workqueue/sys/sys/conf.h user/andre/tcp_workqueue/sys/sys/mutex.h user/andre/tcp_workqueue/sys/ufs/ffs/ffs_softdep.c user/andre/tcp_workqueue/sys/ufs/ffs/fs.h user/andre/tcp_workqueue/sys/ufs/ufs/ufs_extattr.c user/andre/tcp_workqueue/sys/vm/vm_page.c user/andre/tcp_workqueue/sys/vm/vm_page.h user/andre/tcp_workqueue/sys/vm/vm_pageout.c user/andre/tcp_workqueue/sys/vm/vnode_pager.c user/andre/tcp_workqueue/sys/x86/include/specialreg.h Directory Properties: user/andre/tcp_workqueue/sys/ (props changed) user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/ (props changed) user/andre/tcp_workqueue/sys/conf/ (props changed) user/andre/tcp_workqueue/sys/contrib/octeon-sdk/ (props changed) Modified: user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/amd64/amd64/identcpu.c Fri Nov 2 21:11:56 2012 (r242494) @@ -384,6 +384,18 @@ printcpuinfo(void) ); } + if (cpu_stdext_feature != 0) { + printf("\n Standard Extended Features=0x%b", + cpu_stdext_feature, + "\020" + "\001GSFSBASE" + "\002TSCADJ" + "\010SMEP" + "\012ENHMOVSB" + "\013INVPCID" + ); + } + if (via_feature_rng != 0 || via_feature_xcrypt != 0) print_via_padlock_info(); @@ -501,6 +513,11 @@ identify_cpu(void) } } + if (cpu_high >= 7) { + cpuid_count(7, 0, regs); + cpu_stdext_feature = regs[1]; + } + if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { Modified: user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/amd64/amd64/initcpu.c Fri Nov 2 21:11:56 2012 (r242494) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -72,6 +73,7 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; +u_int cpu_stdext_feature; u_int cpu_max_ext_state_size; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, @@ -152,11 +154,25 @@ void initializecpu(void) { uint64_t msr; + uint32_t cr4; + cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { - load_cr4(rcr4() | CR4_FXSR | CR4_XMM); + cr4 |= CR4_FXSR | CR4_XMM; cpu_fxsr = hw_instruction_sse = 1; } + if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) + cr4 |= CR4_FSGSBASE; + + /* + * Postpone enabling the SMEP on the boot CPU until the page + * tables are switched from the boot loader identity mapping + * to the kernel tables. The boot loader enables the U bit in + * its tables. + */ + if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP)) + cr4 |= CR4_SMEP; + load_cr4(cr4); if ((amd_feature & AMDID_NX) != 0) { msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); Modified: user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/amd64/amd64/pmap.c Fri Nov 2 21:11:56 2012 (r242494) @@ -622,6 +622,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* XXX do %cr0 as well */ load_cr4(rcr4() | CR4_PGE | CR4_PSE); load_cr3(KPML4phys); + if (cpu_stdext_feature & CPUID_STDEXT_SMEP) + load_cr4(rcr4() | CR4_SMEP); /* * Initialize the kernel pmap (which is statically allocated). Modified: user/andre/tcp_workqueue/sys/amd64/include/md_var.h ============================================================================== --- user/andre/tcp_workqueue/sys/amd64/include/md_var.h Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/amd64/include/md_var.h Fri Nov 2 21:11:56 2012 (r242494) @@ -48,6 +48,7 @@ extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; +extern u_int cpu_stdext_feature; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Fri Nov 2 21:11:56 2012 (r242494) @@ -306,6 +306,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -491,6 +492,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Copied: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c (from r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Fri Nov 2 21:11:56 2012 (r242494, copy of r242493, head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c) @@ -0,0 +1,364 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * 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. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include "sdhci_if.h" + +#define DEBUG + +#ifdef DEBUG +#define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define dprintf(fmt, args...) +#endif + +struct bcm_sdhci_dmamap_arg { + bus_addr_t sc_dma_busaddr; +}; + +struct bcm_sdhci_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + struct mmc_request * sc_req; + struct mmc_data * sc_data; + uint32_t sc_flags; +#define LPC_SD_FLAGS_IGNORECRC (1 << 0) + int sc_xfer_direction; +#define DIRECTION_READ 0 +#define DIRECTION_WRITE 1 + int sc_xfer_done; + int sc_bus_busy; + struct sdhci_slot sc_slot; +}; + +#define SD_MAX_BLOCKSIZE 1024 +/* XXX */ + +static int bcm_sdhci_probe(device_t); +static int bcm_sdhci_attach(device_t); +static int bcm_sdhci_detach(device_t); +static void bcm_sdhci_intr(void *); + +static int bcm_sdhci_get_ro(device_t, device_t); + +#define bcm_sdhci_lock(_sc) \ + mtx_lock(&_sc->sc_mtx); +#define bcm_sdhci_unlock(_sc) \ + mtx_unlock(&_sc->sc_mtx); + +static int +bcm_sdhci_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci")) + return (ENXIO); + + device_set_desc(dev, "Broadcom 2708 SDHCI controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_sdhci_attach(device_t dev) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + int rid, err; + + sc->sc_dev = dev; + sc->sc_req = NULL; + + mtx_init(&sc->sc_mtx, "bcm sdhci", "sdhci", MTX_DEF); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + err = ENXIO; + goto fail; + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + device_printf(dev, "cannot allocate interrupt\n"); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + err = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, bcm_sdhci_intr, sc, &sc->sc_intrhand)) + { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + device_printf(dev, "cannot setup interrupt handler\n"); + err = ENXIO; + goto fail; + } + + sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180 | SDHCI_CAN_DO_HISPD; + sc->sc_slot.caps |= (50 << SDHCI_CLOCK_BASE_SHIFT); + sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK + | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL + | SDHCI_QUIRK_MISSING_CAPS; + + sdhci_init_slot(dev, &sc->sc_slot, 0); + + bus_generic_probe(dev); + bus_generic_attach(dev); + + sdhci_start_slot(&sc->sc_slot); + + return (0); + +fail: + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (err); +} + +static int +bcm_sdhci_detach(device_t dev) +{ + + return (EBUSY); +} + +static void +bcm_sdhci_intr(void *arg) +{ + struct bcm_sdhci_softc *sc = arg; + + sdhci_generic_intr(&sc->sc_slot); +} + +static int +bcm_sdhci_get_ro(device_t bus, device_t child) +{ + + return (0); +} + +static inline uint32_t +RD4(struct bcm_sdhci_softc *sc, bus_size_t off) +{ + uint32_t val = bus_space_read_4(sc->sc_bst, sc->sc_bsh, off); + return val; +} + +static inline void +WR4(struct bcm_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); + + if ((off != SDHCI_BUFFER && off != SDHCI_INT_STATUS && off != SDHCI_CLOCK_CONTROL)) + { + int timeout = 100000; + while (val != bus_space_read_4(sc->sc_bst, sc->sc_bsh, off) + && --timeout > 0) + continue; + + if (timeout <= 0) + printf("sdhci_brcm: writing 0x%X to reg 0x%X " + "always gives 0x%X\n", + val, (uint32_t)off, + bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); + } +} + +static uint8_t +bcm_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val = RD4(sc, off & ~3); + + return ((val >> (off & 3)*8) & 0xff); +} + +static uint16_t +bcm_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val = RD4(sc, off & ~3); + + return ((val >> (off & 3)*8) & 0xffff); +} + +static uint32_t +bcm_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + return RD4(sc, off); +} + +static void +bcm_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + bus_space_read_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count); +} + +static void +bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32 = RD4(sc, off & ~3); + val32 &= ~(0xff << (off & 3)*8); + val32 |= (val << (off & 3)*8); + WR4(sc, off & ~3, val32); +} + +static void +bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + static uint32_t cmd_and_trandfer_mode; + uint32_t val32; + if (off == SDHCI_COMMAND_FLAGS) + val32 = cmd_and_trandfer_mode; + else + val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3)*8); + val32 |= (val << (off & 3)*8); + if (off == SDHCI_TRANSFER_MODE) + cmd_and_trandfer_mode = val32; + else + WR4(sc, off & ~3, val32); +} + +static void +bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + WR4(sc, off, val); +} + +static void +bcm_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + bus_space_write_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count); +} + +static device_method_t bcm_sdhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_sdhci_probe), + DEVMETHOD(device_attach, bcm_sdhci_attach), + DEVMETHOD(device_detach, bcm_sdhci_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_print_child, bus_generic_print_child), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, bcm_sdhci_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, bcm_sdhci_read_1), + DEVMETHOD(sdhci_read_2, bcm_sdhci_read_2), + DEVMETHOD(sdhci_read_4, bcm_sdhci_read_4), + DEVMETHOD(sdhci_read_multi_4, bcm_sdhci_read_multi_4), + DEVMETHOD(sdhci_write_1, bcm_sdhci_write_1), + DEVMETHOD(sdhci_write_2, bcm_sdhci_write_2), + DEVMETHOD(sdhci_write_4, bcm_sdhci_write_4), + DEVMETHOD(sdhci_write_multi_4, bcm_sdhci_write_multi_4), + + { 0, 0 } +}; + +static devclass_t bcm_sdhci_devclass; + +static driver_t bcm_sdhci_driver = { + "sdhci_bcm", + bcm_sdhci_methods, + sizeof(struct bcm_sdhci_softc), +}; + +DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); +MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); Modified: user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/broadcom/bcm2835/files.bcm2835 Fri Nov 2 21:11:56 2012 (r242494) @@ -4,6 +4,7 @@ arm/broadcom/bcm2835/bcm2835_fb.c optio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt Modified: user/andre/tcp_workqueue/sys/arm/conf/RPI-B ============================================================================== --- user/andre/tcp_workqueue/sys/arm/conf/RPI-B Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/conf/RPI-B Fri Nov 2 21:11:56 2012 (r242494) @@ -61,7 +61,7 @@ options SYSVMSG #SYSV-style message q options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev -#options ROOTDEVNAME=\"ufs:/dev/da0s1a\" +#options ROOTDEVNAME=\"ufs:mmcsd0s2\" options PREEMPTION @@ -80,6 +80,10 @@ device pty # options SC_DFLT_FONT # compile font in # makeoptions SC_DFLT_FONT=cp437 +device sdhci +device mmc +device mmcsd + options KDB options DDB #Enable the kernel debugger options INVARIANTS #Enable calls of extra sanity checking Modified: user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/lpc/lpc_machdep.c Fri Nov 2 21:11:56 2012 (r242494) @@ -307,6 +307,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -492,6 +493,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); @@ -542,11 +547,6 @@ initarm(struct arm_boot_params *abp) */ physmap_init(); - /* - * Set initial values of GPIO output ports - */ - platform_gpio_init(); - /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); @@ -569,6 +569,11 @@ initarm_lastaddr(void) void initarm_gpio_init(void) { + + /* + * Set initial values of GPIO output ports + */ + platform_gpio_init(); } void Modified: user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/mv/armadaxp/armadaxp_mp.c Fri Nov 2 21:11:56 2012 (r242494) @@ -179,7 +179,7 @@ platform_mp_start_ap(void) for (cpu_num = 1; cpu_num < mp_ncpus; cpu_num++ ) bus_space_write_4(fdtbus_bs_tag, CPU_PMU(cpu_num), CPU_PMU_BOOT, - pmap_kextract(mpentry)); + pmap_kextract((vm_offset_t)mpentry)); cpu_idcache_wbinv_all(); Modified: user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/mv/mv_machdep.c Fri Nov 2 21:11:56 2012 (r242494) @@ -297,6 +297,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -482,6 +483,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Modified: user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/tegra/tegra2_machdep.c Fri Nov 2 21:11:56 2012 (r242494) @@ -346,6 +346,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -531,6 +532,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Modified: user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/arm/ti/omap4/omap4_mp.c Fri Nov 2 21:11:56 2012 (r242494) @@ -75,7 +75,7 @@ platform_mp_start_ap(void) cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); ti_smc0(0x200, 0xfffffdff, MODIFY_AUX_CORE_0); - ti_smc0(pmap_kextract(mpentry), 0, WRITE_AUX_CORE_1); + ti_smc0(pmap_kextract((vm_offset_t)mpentry), 0, WRITE_AUX_CORE_1); armv7_sev(); bus_space_unmap(fdtbus_bs_tag, scu_addr, 0x1000); } Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl.c Fri Nov 2 21:11:56 2012 (r242494) @@ -957,11 +957,10 @@ ctl_init(void) if (ctl_disable != 0) return; - control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK); + control_softc = malloc(sizeof(*control_softc), M_DEVBUF, + M_WAITOK | M_ZERO); softc = control_softc; - memset(softc, 0, sizeof(*softc)); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "cam/ctl"); @@ -3271,14 +3270,13 @@ ctl_pool_create(struct ctl_softc *ctl_so retval = 0; - pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT); + pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, + M_NOWAIT | M_ZERO); if (pool == NULL) { retval = -ENOMEM; goto bailout; } - memset(pool, 0, sizeof(*pool)); - pool->type = pool_type; pool->ctl_softc = ctl_softc; @@ -6561,7 +6559,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len, page_len, total_len); #endif - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6574,7 +6572,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - memset(ctsio->kern_data_ptr, 0, total_len); switch (ctsio->cdb[0]) { case MODE_SENSE_6: { @@ -6742,7 +6739,7 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6751,8 +6748,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - /* * If the maximum LBA is greater than 0xfffffffe, the user must * issue a SERVICE ACTION IN (16) command, with the read capacity @@ -6806,7 +6801,7 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6822,8 +6817,6 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); @@ -6913,8 +6906,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - memset(ctsio->kern_data_ptr, 0, total_len); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; @@ -7068,7 +7060,7 @@ retry: } mtx_unlock(&softc->ctl_lock); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7084,8 +7076,6 @@ retry: ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(ctsio->kern_data_ptr, 0, total_len); - mtx_lock(&softc->ctl_lock); switch (cdb->action) { case SPRI_RK: { // read keys @@ -8611,7 +8601,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); - ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO); lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8630,8 +8620,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - memset(lun_data, 0, lun_datalen); - /* * We set this to the actual data length, regardless of how much * space we actually have to return results. If the user looks at @@ -8907,7 +8895,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc * XXX KDM GFP_??? We probably don't want to wait here, * unless we end up having a process/thread context. */ - ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8930,8 +8918,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(pages, 0, sup_page_size); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -8971,7 +8957,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* XXX KDM which malloc flags here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8994,8 +8980,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(sn_ptr, 0, sizeof(*sn_ptr)); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -9065,7 +9049,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio sizeof(struct scsi_vpd_id_trgt_port_grp_id); /* XXX KDM which malloc flags here ?? */ - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9096,7 +9080,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio CTL_WWPN_LEN); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - memset(devid_ptr, 0, devid_len); /* * The control device is always connected. The disk device, on the @@ -9296,7 +9279,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * that much. */ /* XXX KDM what malloc flags should we use here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9318,8 +9301,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->kern_total_len = alloc_len; } - memset(inq_ptr, 0, sizeof(*inq_ptr)); - /* * If we have a LUN configured, report it as connected. Otherwise, * report that it is offline or no device is supported, depending Modified: user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/cam/ctl/ctl_backend_block.c Fri Nov 2 21:11:56 2012 (r242494) @@ -376,7 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); Modified: user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c ============================================================================== --- user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/cam/scsi/scsi_da.c Fri Nov 2 21:11:56 2012 (r242494) @@ -2673,6 +2673,7 @@ dasetgeom(struct cam_periph *periph, uin struct da_softc *softc; struct disk_params *dp; u_int lbppbe, lalba; + int error; softc = (struct da_softc *)periph->softc; @@ -2779,10 +2780,9 @@ dasetgeom(struct cam_periph *periph, uin else softc->disk->d_flags &= ~DISKFLAG_CANDELETE; -/* Currently as of 6/13/2012, panics if DIAGNOSTIC is set */ -#ifndef DIAGNOSTIC - disk_resize(softc->disk); -#endif + error = disk_resize(softc->disk, M_NOWAIT); + if (error != 0) + xpt_print(periph->path, "disk_resize(9) failed, error = %d\n", error); } static void Modified: user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Nov 2 21:11:56 2012 (r242494) @@ -332,7 +332,7 @@ vdev_geom_attach_taster(struct g_consume } static void -vdev_geom_dettach_taster(struct g_consumer *cp) +vdev_geom_detach_taster(struct g_consumer *cp) { g_access(cp, -1, 0, 0); g_detach(cp); @@ -373,7 +373,7 @@ vdev_geom_read_pool_label(const char *na g_topology_unlock(); error = vdev_geom_read_config(zcp, &vdev_cfg); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (error) continue; ZFS_LOG(1, "successfully read vdev config"); @@ -442,7 +442,7 @@ vdev_geom_attach_by_guid(uint64_t guid) g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); Modified: user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c ============================================================================== --- user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/compat/linux/linux_misc.c Fri Nov 2 21:11:56 2012 (r242494) @@ -246,8 +246,7 @@ linux_uselib(struct thread *td, struct l unsigned long bss_size; char *library; ssize_t aresid; - int error; - int locked; + int error, locked, writecount; LCONVPATHEXIST(td, args->library, &library); @@ -277,7 +276,10 @@ linux_uselib(struct thread *td, struct l locked = 1; /* Writable? */ - if (vp->v_writecount) { + error = VOP_GET_WRITECOUNT(vp, &writecount); + if (error != 0) + goto cleanup; + if (writecount != 0) { error = ETXTBSY; goto cleanup; } Modified: user/andre/tcp_workqueue/sys/conf/NOTES ============================================================================== --- user/andre/tcp_workqueue/sys/conf/NOTES Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/conf/NOTES Fri Nov 2 21:11:56 2012 (r242494) @@ -389,6 +389,16 @@ options GDB options SYSCTL_DEBUG # +# Enable textdump by default, this disables kernel core dumps. +# +options TEXTDUMP_PREFERRED + +# +# Enable extra debug messages while performing textdumps. +# +options TEXTDUMP_VERBOSE + +# # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. options NO_SYSCTL_DESCR @@ -2142,12 +2152,6 @@ device ral # Ralink Technology RT2500 # This option requires the TI_SF_BUF_JUMBO option above. #options TI_JUMBO_HDRSPLIT -# -# Use header splitting feature on bce(4) adapters. -# This may help to reduce the amount of jumbo-sized memory buffers used. -# -options BCE_JUMBO_HDRSPLIT - # These two options allow manipulating the mbuf cluster size and mbuf size, # respectively. Be very careful with NIC driver modules when changing # these from their default values, because that can potentially cause a Modified: user/andre/tcp_workqueue/sys/conf/options ============================================================================== --- user/andre/tcp_workqueue/sys/conf/options Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/conf/options Fri Nov 2 21:11:56 2012 (r242494) @@ -61,6 +61,8 @@ KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h KLD_DEBUG opt_kld.h SYSCTL_DEBUG opt_sysctl.h +TEXTDUMP_PREFERRED opt_ddb.h +TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS @@ -523,7 +525,6 @@ SOCKET_SEND_COW opt_zero.h SOCKET_RECV_PFLIP opt_zero.h TI_SF_BUF_JUMBO opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h -BCE_JUMBO_HDRSPLIT opt_bce.h # XXX Conflict: # of devices vs network protocol (Native ATM). # This makes "atm.h" unusable. Modified: user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Nov 2 21:07:30 2012 (r242493) +++ user/andre/tcp_workqueue/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri Nov 2 21:11:56 2012 (r242494) @@ -451,6 +451,12 @@ int cvmx_helper_board_get_mii_address(in return ipd_port+1; else return -1; + case CVMX_BOARD_TYPE_EBT5600: + /* Board has 1 management port */ + if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT) + return 0; + /* Board has 1 XAUI port connected to a switch. */ + return -1; case CVMX_BOARD_TYPE_EBB5600: { static unsigned char qlm_switch_addr = 0; @@ -990,6 +996,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo } /* Fall through to the generic code below */ break; + case CVMX_BOARD_TYPE_EBT5600: case CVMX_BOARD_TYPE_EBH5600: case CVMX_BOARD_TYPE_EBH5601: case CVMX_BOARD_TYPE_EBH5610: @@ -1289,6 +1296,11 @@ int __cvmx_helper_board_interface_probe( return 0; #endif break; + case CVMX_BOARD_TYPE_EBT5600: + /* Disable loopback. */ + if (interface == 3) + return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Nov 2 22:17:11 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 1FFFF2DF; Fri, 2 Nov 2012 22:17:11 +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 E2E348FC16; Fri, 2 Nov 2012 22:17: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 qA2MHAI8013570; Fri, 2 Nov 2012 22:17:10 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2MHAGS013567; Fri, 2 Nov 2012 22:17:10 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211022217.qA2MHAGS013567@svn.freebsd.org> From: Andre Oppermann Date: Fri, 2 Nov 2012 22:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242498 - user/andre/tcp_workqueue/sys/netinet X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 22:17:11 -0000 Author: andre Date: Fri Nov 2 22:17:10 2012 New Revision: 242498 URL: http://svn.freebsd.org/changeset/base/242498 Log: Reintroduce the SACK required test in syncache_expand() but make it non-fatal and for informative logging only. This way a better overview of real-world behavior can be gained. A previous version of this change slipped into an integrate from head. Modified: user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c Modified: user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c ============================================================================== --- user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c Fri Nov 2 22:07:45 2012 (r242497) +++ user/andre/tcp_workqueue/sys/netinet/tcp_syncache.c Fri Nov 2 22:17:10 2012 (r242498) @@ -991,28 +991,32 @@ syncache_expand(struct in_conninfo *inc, "rejected\n", s, __func__, th->th_seq, sc->sc_irs); goto failed; } + /* - * If timestamps were not negotiated we don't expect them. + * If timestamps were present in the SYN and we accepted + * them in our SYN|ACK we require them to be present from + * now on. And vice versa. + * RFC1323, Section 3.2 */ - if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) { + if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: Timestamp not expected, " - "segment rejected\n", s, __func__); + log(LOG_DEBUG, "%s; %s: Timestamp missing, " + "rfc violation ignored\n", s, __func__); +#if 0 goto failed; +#endif } + /* - * If timestamps were negotiated every packet is required - * to carry them. - * RFC1323, Section X + * If timestamps were not negotiated we don't expect them. */ - if ((sc->sc_flags & SCF_TIMESTAMP) && !(to->to_flags & TOF_TS)) { + if (!(sc->sc_flags & SCF_TIMESTAMP) && (to->to_flags & TOF_TS)) { if ((s = tcp_log_addrs(inc, th, NULL, NULL))) - log(LOG_DEBUG, "%s; %s: Timestamp expected, " - "rfc violation ignored\n", s, __func__); -#if 0 + log(LOG_DEBUG, "%s; %s: Timestamp not expected, " + "segment rejected\n", s, __func__); goto failed; -#endif } + /* * If timestamps were negotiated the reflected timestamp * must be equal to what we actually sent in the SYN|ACK. From owner-svn-src-user@FreeBSD.ORG Sat Nov 3 17:49:05 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 98619E40; Sat, 3 Nov 2012 17:49:05 +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 66CAB8FC15; Sat, 3 Nov 2012 17:49:05 +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 qA3Hn5c7013455; Sat, 3 Nov 2012 17:49:05 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3Hn5bR013453; Sat, 3 Nov 2012 17:49:05 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201211031749.qA3Hn5bR013453@svn.freebsd.org> From: Andre Oppermann Date: Sat, 3 Nov 2012 17:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r242517 - user/andre/tcp_workqueue/sys/kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:49:05 -0000 Author: andre Date: Sat Nov 3 17:49:04 2012 New Revision: 242517 URL: http://svn.freebsd.org/changeset/base/242517 Log: Fix a race on listen socket teardown where while draining the accept queues a new socket/connection may be added to the queue due to a race on the ACCEPT_LOCK. The submitted patch is slightly changed in comments, teardown and locking order and extended with KASSERT's. Submitted by: Vijay Singh Found by: His team. 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 Nov 3 16:06:14 2012 (r242516) +++ user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sat Nov 3 17:49:04 2012 (r242517) @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; so->so_state |= connstatus; ACCEPT_LOCK(); + /* + * The accept socket may be tearing down but we just + * won a race on the ACCEPT_LOCK. + */ + if (!(so->so_options & SO_ACCEPTCONN)) { + SOCK_LOCK(so); + so->so_head = NULL; + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ + return (NULL); + } if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); so->so_qstate |= SQ_COMP; @@ -780,9 +790,14 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + ACCEPT_LOCK(); if (so->so_options & SO_ACCEPTCONN) { struct socket *sp; - ACCEPT_LOCK(); + /* + * Prevent new additions to the accept queues due + * to ACCEPT_LOCK races while we are draining them. + */ + so->so_options &= ~SO_ACCEPTCONN; while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { TAILQ_REMOVE(&so->so_incomp, sp, so_list); so->so_incqlen--; @@ -801,9 +816,11 @@ drop: soabort(sp); ACCEPT_LOCK(); } - ACCEPT_UNLOCK(); + KASSERT((TAILQ_EMPTY(&so->so_comp)), + ("%s: so_comp populated", __func__)); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), + ("%s: so_incomp populated", __func__)); } - ACCEPT_LOCK(); SOCK_LOCK(so); KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; From owner-svn-src-user@FreeBSD.ORG Sat Nov 3 17:53:04 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 D7FF4FD0 for ; Sat, 3 Nov 2012 17:53:04 +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 3DA8F8FC14 for ; Sat, 3 Nov 2012 17:53:03 +0000 (UTC) Received: (qmail 35265 invoked from network); 3 Nov 2012 19:28:55 -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 ; 3 Nov 2012 19:28:55 -0000 Message-ID: <509559F0.7030000@freebsd.org> Date: Sat, 03 Nov 2012 18:52:48 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: src-committers@freebsd.org Subject: Re: svn commit: r242517 - user/andre/tcp_workqueue/sys/kern References: <201211031749.qA3Hn5bR013453@svn.freebsd.org> In-Reply-To: <201211031749.qA3Hn5bR013453@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 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 Nov 2012 17:53:04 -0000 On 03.11.2012 18:49, Andre Oppermann wrote: > Author: andre > Date: Sat Nov 3 17:49:04 2012 > New Revision: 242517 > URL: http://svn.freebsd.org/changeset/base/242517 > > Log: > Fix a race on listen socket teardown where while draining the > accept queues a new socket/connection may be added to the queue > due to a race on the ACCEPT_LOCK. > > The submitted patch is slightly changed in comments, teardown > and locking order and extended with KASSERT's. > > Submitted by: Vijay Singh > Found by: His team. I'm waiting on Vijay's feedback on my changes and merge to HEAD when I've received his report. -- Andre > 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 Nov 3 16:06:14 2012 (r242516) > +++ user/andre/tcp_workqueue/sys/kern/uipc_socket.c Sat Nov 3 17:49:04 2012 (r242517) > @@ -555,6 +555,16 @@ sonewconn(struct socket *head, int conns > so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; > so->so_state |= connstatus; > ACCEPT_LOCK(); > + /* > + * The accept socket may be tearing down but we just > + * won a race on the ACCEPT_LOCK. > + */ > + if (!(so->so_options & SO_ACCEPTCONN)) { > + SOCK_LOCK(so); > + so->so_head = NULL; > + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ > + return (NULL); > + } > if (connstatus) { > TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); > so->so_qstate |= SQ_COMP; > @@ -780,9 +790,14 @@ soclose(struct socket *so) > drop: > if (so->so_proto->pr_usrreqs->pru_close != NULL) > (*so->so_proto->pr_usrreqs->pru_close)(so); > + ACCEPT_LOCK(); > if (so->so_options & SO_ACCEPTCONN) { > struct socket *sp; > - ACCEPT_LOCK(); > + /* > + * Prevent new additions to the accept queues due > + * to ACCEPT_LOCK races while we are draining them. > + */ > + so->so_options &= ~SO_ACCEPTCONN; > while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { > TAILQ_REMOVE(&so->so_incomp, sp, so_list); > so->so_incqlen--; > @@ -801,9 +816,11 @@ drop: > soabort(sp); > ACCEPT_LOCK(); > } > - ACCEPT_UNLOCK(); > + KASSERT((TAILQ_EMPTY(&so->so_comp)), > + ("%s: so_comp populated", __func__)); > + KASSERT((TAILQ_EMPTY(&so->so_incomp)), > + ("%s: so_incomp populated", __func__)); > } > - ACCEPT_LOCK(); > SOCK_LOCK(so); > KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); > so->so_state |= SS_NOFDREF; > >