From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 00:27:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF1671065672; Sun, 3 Jan 2010 00:27:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC2368FC13; Sun, 3 Jan 2010 00:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o030RZRr098721; Sun, 3 Jan 2010 00:27:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o030RZrO098717; Sun, 3 Jan 2010 00:27:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030027.o030RZrO098717@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 00:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201407 - in stable/8/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 00:27:36 -0000 Author: delphij Date: Sun Jan 3 00:27:35 2010 New Revision: 201407 URL: http://svn.freebsd.org/changeset/base/201407 Log: MFC r200516: Add an option to specify that the received ZFS should not be automatically mounted (receive -u). Obtained from: OpenSolaris (onnv revision 8584:327a1b6dd944) Approved by: pjd Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Directory Properties: stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sat Jan 2 23:38:03 2010 (r201406) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 3 00:27:35 2010 (r201407) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2457,7 +2457,7 @@ zfs_do_receive(int argc, char **argv) bzero(&flags, sizeof (recvflags_t)); /* check options */ - while ((c = getopt(argc, argv, ":dnvF")) != -1) { + while ((c = getopt(argc, argv, ":dnuvF")) != -1) { switch (c) { case 'd': flags.isprefix = B_TRUE; @@ -2465,6 +2465,9 @@ zfs_do_receive(int argc, char **argv) case 'n': flags.dryrun = B_TRUE; break; + case 'u': + flags.nomount = B_TRUE; + break; case 'v': flags.verbose = B_TRUE; break; Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sat Jan 2 23:38:03 2010 (r201406) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Sun Jan 3 00:27:35 2010 (r201407) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -457,6 +457,9 @@ typedef struct recvflags { /* byteswap flag is used internally; callers need not specify */ int byteswap : 1; + + /* do not mount file systems as they are extracted (private) */ + int nomount : 1; } recvflags_t; extern int zfs_receive(libzfs_handle_t *, const char *, recvflags_t, Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sat Jan 2 23:38:03 2010 (r201406) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Sun Jan 3 00:27:35 2010 (r201407) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -2080,7 +2080,7 @@ zfs_receive(libzfs_handle_t *hdl, const err = zfs_receive_impl(hdl, tosnap, flags, infd, stream_avl, &top_zfs); - if (err == 0 && top_zfs) { + if (err == 0 && !flags.nomount && top_zfs) { zfs_handle_t *zhp; prop_changelist_t *clp; From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 02:43:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63EE01065672; Sun, 3 Jan 2010 02:43:47 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 539638FC13; Sun, 3 Jan 2010 02:43:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o032hl64028551; Sun, 3 Jan 2010 02:43:47 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o032hlLX028549; Sun, 3 Jan 2010 02:43:47 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201001030243.o032hlLX028549@svn.freebsd.org> From: Matt Jacob Date: Sun, 3 Jan 2010 02:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201408 - head/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 02:43:47 -0000 Author: mjacob Date: Sun Jan 3 02:43:46 2010 New Revision: 201408 URL: http://svn.freebsd.org/changeset/base/201408 Log: Make sure that the WWNN is also created for 2100..2300 cards. MFC after: 1 day Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Sun Jan 3 00:27:35 2010 (r201407) +++ head/sys/dev/isp/isp.c Sun Jan 3 02:43:46 2010 (r201408) @@ -8285,6 +8285,8 @@ isp_parse_nvram_2100(ispsoftc_t *isp, ui if ((wwn >> 60) == 0) { wwn |= (((uint64_t) 2)<< 60); } + } else { + wwn = fcp->isp_wwpn_nvram & ~((uint64_t) 0xfff << 48); } } else { wwn &= ~((uint64_t) 0xfff << 48); From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 02:58:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53898106566B; Sun, 3 Jan 2010 02:58:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9FB8FC19; Sun, 3 Jan 2010 02:58:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o032w6ov031720; Sun, 3 Jan 2010 02:58:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o032w67c031716; Sun, 3 Jan 2010 02:58:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030258.o032w67c031716@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 02:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201409 - in stable/8: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 02:58:06 -0000 Author: delphij Date: Sun Jan 3 02:58:05 2010 New Revision: 201409 URL: http://svn.freebsd.org/changeset/base/201409 Log: MFC r200724: Apply fix for Solaris bug 6462803 zfs snapshot -r failed because filesystem was busy. PR: kern/141387 Submitted by: mm Approved by: pjd Obtained from: OpenSolaris (onnv 8989:cfce31f4eebf) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: stable/8/cddl/contrib/opensolaris/cmd/zdb/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sun Jan 3 02:43:46 2010 (r201408) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c Sun Jan 3 02:58:05 2010 (r201409) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Print intent log header and statistics. */ @@ -345,8 +343,10 @@ dump_intent_log(zilog_t *zilog) if (zh->zh_log.blk_birth == 0 || verbose < 2) return; - (void) printf("\n ZIL header: claim_txg %llu, seq %llu\n", - (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_replay_seq); + (void) printf("\n ZIL header: claim_txg %llu, claim_seq %llu", + (u_longlong_t)zh->zh_claim_txg, (u_longlong_t)zh->zh_claim_seq); + (void) printf(" replay_seq %llu, flags 0x%llx\n", + (u_longlong_t)zh->zh_replay_seq, (u_longlong_t)zh->zh_flags); if (verbose >= 4) print_log_bp(&zh->zh_log, "\n\tfirst block: "); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sun Jan 3 02:43:46 2010 (r201408) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Sun Jan 3 02:58:05 2010 (r201409) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -56,10 +56,16 @@ typedef struct zil_header { uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ uint64_t zh_claim_seq; /* highest claimed sequence number */ - uint64_t zh_pad[5]; + uint64_t zh_flags; /* header flags */ + uint64_t zh_pad[4]; } zil_header_t; /* + * zh_flags bit settings + */ +#define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */ + +/* * Log block trailer - structure at the end of the header and each log block * * The zit_bt contains a zbt_cksum which for the intent log is Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Jan 3 02:43:46 2010 (r201408) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Sun Jan 3 02:58:05 2010 (r201409) @@ -502,6 +502,25 @@ zil_rollback_destroy(zilog_t *zilog, dmu tx, zh->zh_claim_txg); } +/* + * return true if the initial log block is not valid + */ +static boolean_t +zil_empty(zilog_t *zilog) +{ + const zil_header_t *zh = zilog->zl_header; + arc_buf_t *abuf = NULL; + + if (BP_IS_HOLE(&zh->zh_log)) + return (B_TRUE); + + if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) + return (B_TRUE); + + VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); + return (B_FALSE); +} + int zil_claim(char *osname, void *txarg) { @@ -522,6 +541,21 @@ zil_claim(char *osname, void *txarg) zh = zil_header_in_syncing_context(zilog); /* + * Record here whether the zil has any records to replay. + * If the header block pointer is null or the block points + * to the stubby then we know there are no valid log records. + * We use the header to store this state as the the zilog gets + * freed later in dmu_objset_close(). + * The flags (and the rest of the header fields) are cleared in + * zil_sync() as a result of a zil_destroy(), after replaying the log. + * + * Note, the intent log can be empty but still need the + * stubby to be claimed. + */ + if (!zil_empty(zilog)) + zh->zh_flags |= ZIL_REPLAY_NEEDED; + + /* * Claim all log blocks if we haven't already done so, and remember * the highest claimed sequence number. This ensures that if we can * read only part of the log now (e.g. due to a missing device), @@ -1345,25 +1379,6 @@ zil_free(zilog_t *zilog) } /* - * return true if the initial log block is not valid - */ -static boolean_t -zil_empty(zilog_t *zilog) -{ - const zil_header_t *zh = zilog->zl_header; - arc_buf_t *abuf = NULL; - - if (BP_IS_HOLE(&zh->zh_log)) - return (B_TRUE); - - if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) - return (B_TRUE); - - VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); - return (B_FALSE); -} - -/* * Open an intent log. */ zilog_t * @@ -1418,7 +1433,7 @@ zil_suspend(zilog_t *zilog) const zil_header_t *zh = zilog->zl_header; mutex_enter(&zilog->zl_lock); - if (zh->zh_claim_txg != 0) { /* unplayed log */ + if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */ mutex_exit(&zilog->zl_lock); return (EBUSY); } @@ -1645,7 +1660,7 @@ zil_replay(objset_t *os, void *arg, uint const zil_header_t *zh = zilog->zl_header; zil_replay_arg_t zr; - if (zil_empty(zilog)) { + if ((zh->zh_flags & ZIL_REPLAY_NEEDED) == 0) { zil_destroy(zilog, B_TRUE); return; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 02:58:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DF42106566B; Sun, 3 Jan 2010 02:58:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DC998FC2C; Sun, 3 Jan 2010 02:58:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o032whDh031915; Sun, 3 Jan 2010 02:58:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o032wh8K031913; Sun, 3 Jan 2010 02:58:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001030258.o032wh8K031913@svn.freebsd.org> From: Marius Strobl Date: Sun, 3 Jan 2010 02:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201410 - head/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 02:58:43 -0000 Author: marius Date: Sun Jan 3 02:58:43 2010 New Revision: 201410 URL: http://svn.freebsd.org/changeset/base/201410 Log: Exclude options COMPAT_FREEBSD4 now that the MD freebsd4_sigreturn() is gone since r201396 and which is also in line with the fact that FreeBSD 4 didn't supported sparc64. Modified: head/sys/sparc64/conf/NOTES Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Sun Jan 3 02:58:05 2010 (r201409) +++ head/sys/sparc64/conf/NOTES Sun Jan 3 02:58:43 2010 (r201410) @@ -129,6 +129,7 @@ nodevice ex # Options we don't want to deal with nooption FDC_DEBUG +nooption COMPAT_FREEBSD4 nooption SC_RENDER_DEBUG nooption SC_DEBUG_LEVEL nooption PPC_DEBUG From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 03:05:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9325C1065670; Sun, 3 Jan 2010 03:05:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 803AE8FC08; Sun, 3 Jan 2010 03:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0335UbL033573; Sun, 3 Jan 2010 03:05:30 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0335UWJ033568; Sun, 3 Jan 2010 03:05:30 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030305.o0335UWJ033568@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 03:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201411 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 03:05:30 -0000 Author: delphij Date: Sun Jan 3 03:05:30 2010 New Revision: 201411 URL: http://svn.freebsd.org/changeset/base/201411 Log: MFC r200726: Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG (onnv revision 8986) PR: kern/141355 Requested by: mm Submitted by: pjd Obtained from: OpenSolaris Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sun Jan 3 02:58:43 2010 (r201410) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Sun Jan 3 03:05:30 2010 (r201411) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -108,19 +106,51 @@ dmu_object_claim(objset_t *os, uint64_t int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) + int blocksize, dmu_object_type_t bonustype, int bonuslen) { dnode_t *dn; + dmu_tx_t *tx; + int nblkptr; int err; - if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) + if (object == DMU_META_DNODE_OBJECT) return (EBADF); err = dnode_hold_impl(os->os, object, DNODE_MUST_BE_ALLOCATED, FTAG, &dn); if (err) return (err); + + if (dn->dn_type == ot && dn->dn_datablksz == blocksize && + dn->dn_bonustype == bonustype && dn->dn_bonuslen == bonuslen) { + /* nothing is changing, this is a noop */ + dnode_rele(dn, FTAG); + return (0); + } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + dnode_rele(dn, FTAG); + return (err); + } + + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + + /* + * If we are losing blkptrs or changing the block size this must + * be a new file instance. We must clear out the previous file + * contents before we can change this type of metadata in the dnode. + */ + if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) + dmu_free_long_range(os, object, 0, DMU_OBJECT_END); + dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx); + + dmu_tx_commit(tx); + dnode_rele(dn, FTAG); return (0); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 3 02:58:43 2010 (r201410) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 3 03:05:30 2010 (r201411) @@ -829,11 +829,6 @@ restore_object(struct restorearg *ra, ob int err; dmu_tx_t *tx; - err = dmu_object_info(os, drro->drr_object, NULL); - - if (err != 0 && err != ENOENT) - return (EINVAL); - if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || drro->drr_bonustype >= DMU_OT_NUMTYPES || @@ -846,12 +841,15 @@ restore_object(struct restorearg *ra, ob return (EINVAL); } - tx = dmu_tx_create(os); + err = dmu_object_info(os, drro->drr_object, NULL); + + if (err != 0 && err != ENOENT) + return (EINVAL); if (err == ENOENT) { /* currently free, want to be allocated */ + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, DMU_NEW_OBJECT); - dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, 1); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); @@ -860,28 +858,23 @@ restore_object(struct restorearg *ra, ob err = dmu_object_claim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); + dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - dmu_tx_hold_bonus(tx, drro->drr_object); - /* - * We may change blocksize and delete old content, - * so need to hold_write and hold_free. - */ - dmu_tx_hold_write(tx, drro->drr_object, 0, 1); - dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err) { - dmu_tx_abort(tx); - return (err); - } err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen); } - if (err) { - dmu_tx_commit(tx); + if (err) return (EINVAL); + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, drro->drr_object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + return (err); } dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jan 3 02:58:43 2010 (r201410) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Sun Jan 3 03:05:30 2010 (r201411) @@ -415,8 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, nblkptr; - dmu_buf_impl_t *db = NULL; + int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE); @@ -428,42 +427,25 @@ dnode_reallocate(dnode_t *dn, dmu_object ASSERT3U(bonustype, <, DMU_OT_NUMTYPES); ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN); - for (i = 0; i < TXG_SIZE; i++) - ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - /* clean up any unreferenced dbufs */ dnode_evict_dbufs(dn); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); - - /* - * XXX I should really have a generation number to tell if we - * need to do this... - */ - if (blocksize != dn->dn_datablksz || - dn->dn_bonustype != bonustype || dn->dn_bonuslen != bonuslen) { - /* free all old data */ - dnode_free_range(dn, 0, -1ULL, tx); - } - - nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); - /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (blocksize != dn->dn_datablksz && - (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || - list_head(&dn->dn_dbufs) != NULL)) { - db = dbuf_hold(dn, 0, FTAG); - dbuf_new_size(db, blocksize, tx); - } - dnode_setdblksz(dn, blocksize); dnode_setdirty(dn, tx); - dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; - dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_datablksz != blocksize) { + /* change blocksize */ + ASSERT(dn->dn_maxblkid == 0 && + (BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || + dnode_block_freed(dn, 0))); + dnode_setdblksz(dn, blocksize); + dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + } + if (dn->dn_bonuslen != bonuslen) + dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); if (dn->dn_nblkptr != nblkptr) dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); - if (db) - dbuf_rele(db, FTAG); /* change type */ dn->dn_type = ot; @@ -1187,11 +1169,6 @@ dnode_block_freed(dnode_t *dn, uint64_t if (dn->dn_free_txg) return (TRUE); - /* - * If dn_datablkshift is not set, then there's only a single - * block, in which case there will never be a free range so it - * won't matter. - */ range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Jan 3 02:58:43 2010 (r201410) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Sun Jan 3 03:05:30 2010 (r201411) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -237,7 +237,7 @@ uint64_t dmu_object_alloc(objset_t *os, int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx); int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx); + int blocksize, dmu_object_type_t bonustype, int bonuslen); /* * Free an object from this objset. From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 03:10:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36C83106568B; Sun, 3 Jan 2010 03:10:29 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B8388FC19; Sun, 3 Jan 2010 03:10:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o033ASrY034873; Sun, 3 Jan 2010 03:10:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o033ASpD034871; Sun, 3 Jan 2010 03:10:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030310.o033ASpD034871@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 03:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201412 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 03:10:29 -0000 Author: delphij Date: Sun Jan 3 03:10:28 2010 New Revision: 201412 URL: http://svn.freebsd.org/changeset/base/201412 Log: MFC r200727: Apply fix for Solaris bug 6764159: restore_object() makes a call that can block while having a tx open but not yet committed (onnv revision 7994) Submitted by: mm Approved by: pjd Obtained from: OpenSolaris Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 3 03:05:30 2010 (r201411) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Sun Jan 3 03:10:28 2010 (r201412) @@ -828,6 +828,7 @@ restore_object(struct restorearg *ra, ob { int err; dmu_tx_t *tx; + void *data = NULL; if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || @@ -869,6 +870,12 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); @@ -880,18 +887,13 @@ restore_object(struct restorearg *ra, ob dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); dmu_object_set_compress(os, drro->drr_object, drro->drr_compress, tx); - if (drro->drr_bonuslen) { + if (data != NULL) { dmu_buf_t *db; - void *data; + VERIFY(0 == dmu_bonus_hold(os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (data == NULL) { - dmu_tx_commit(tx); - return (ra->err); - } bcopy(data, db->db_data, drro->drr_bonuslen); if (ra->byteswap) { dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data, From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 03:23:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CDFE106566B; Sun, 3 Jan 2010 03:23:17 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B6E68FC13; Sun, 3 Jan 2010 03:23:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o033NHvo037736; Sun, 3 Jan 2010 03:23:17 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o033NHUV037733; Sun, 3 Jan 2010 03:23:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030323.o033NHUV037733@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 03:23:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201413 - stable/7/sys/compat/svr4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 03:23:17 -0000 Author: delphij Date: Sun Jan 3 03:23:17 2010 New Revision: 201413 URL: http://svn.freebsd.org/changeset/base/201413 Log: MFC r193012: Add new sysconfig bits, Fix the bogus numbering of the old bits. Submitted by: "Pedro f. Giffuni" Obtained from: NetBSD PR: kern/91293 Modified: stable/7/sys/compat/svr4/svr4_misc.c stable/7/sys/compat/svr4/svr4_sysconfig.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:10:28 2010 (r201412) +++ stable/7/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:23:17 2010 (r201413) @@ -706,9 +706,6 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); switch (uap->name) { - case SVR4_CONFIG_UNUSED: - *retval = 0; - break; case SVR4_CONFIG_NGROUPS: *retval = NGROUPS_MAX; break; @@ -788,7 +785,45 @@ svr4_sys_sysconfig(td, uap) #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } Modified: stable/7/sys/compat/svr4/svr4_sysconfig.h ============================================================================== --- stable/7/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:10:28 2010 (r201412) +++ stable/7/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:23:17 2010 (r201413) @@ -31,7 +31,7 @@ #ifndef _SVR4_SYSCONFIG_H_ #define _SVR4_SYSCONFIG_H_ -#define SVR4_CONFIG_UNUSED 0x01 +#define SVR4_CONFIG_UNUSED_1 0x01 #define SVR4_CONFIG_NGROUPS 0x02 #define SVR4_CONFIG_CHILD_MAX 0x03 #define SVR4_CONFIG_OPEN_FILES 0x04 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 03:35:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5F6106568F; Sun, 3 Jan 2010 03:35:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E1F48FC14; Sun, 3 Jan 2010 03:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o033ZNBF040425; Sun, 3 Jan 2010 03:35:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o033ZN6S040422; Sun, 3 Jan 2010 03:35:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001030335.o033ZN6S040422@svn.freebsd.org> From: Xin LI Date: Sun, 3 Jan 2010 03:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201414 - stable/6/sys/compat/svr4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 03:35:23 -0000 Author: delphij Date: Sun Jan 3 03:35:23 2010 New Revision: 201414 URL: http://svn.freebsd.org/changeset/base/201414 Log: MFC r193012: Add new sysconfig bits, Fix the bogus numbering of the old bits. Submitted by: "Pedro f. Giffuni" Obtained from: NetBSD PR: kern/91293 Modified: stable/6/sys/compat/svr4/svr4_misc.c stable/6/sys/compat/svr4/svr4_sysconfig.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/compat/svr4/svr4_misc.c ============================================================================== --- stable/6/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:23:17 2010 (r201413) +++ stable/6/sys/compat/svr4/svr4_misc.c Sun Jan 3 03:35:23 2010 (r201414) @@ -699,9 +699,6 @@ svr4_sys_sysconfig(td, uap) retval = &(td->td_retval[0]); switch (uap->name) { - case SVR4_CONFIG_UNUSED: - *retval = 0; - break; case SVR4_CONFIG_NGROUPS: *retval = NGROUPS_MAX; break; @@ -781,7 +778,45 @@ svr4_sys_sysconfig(td, uap) #endif break; #endif /* NOTYET */ - + case SVR4_CONFIG_COHERENCY: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_SPLIT_CACHE: + *retval = 0; /* XXX */ + break; + case SVR4_CONFIG_ICACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_DCACHESZ: + *retval = 256; /* XXX */ + break; + case SVR4_CONFIG_ICACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHELINESZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHEBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_DCACHETBLKSZ: + *retval = 64; /* XXX */ + break; + case SVR4_CONFIG_ICACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_DCACHE_ASSOC: + *retval = 1; /* XXX */ + break; + case SVR4_CONFIG_MAXPID: + *retval = PID_MAX; + break; + case SVR4_CONFIG_STACK_PROT: + *retval = PROT_READ|PROT_WRITE|PROT_EXEC; + break; default: return EINVAL; } Modified: stable/6/sys/compat/svr4/svr4_sysconfig.h ============================================================================== --- stable/6/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:23:17 2010 (r201413) +++ stable/6/sys/compat/svr4/svr4_sysconfig.h Sun Jan 3 03:35:23 2010 (r201414) @@ -31,7 +31,7 @@ #ifndef _SVR4_SYSCONFIG_H_ #define _SVR4_SYSCONFIG_H_ -#define SVR4_CONFIG_UNUSED 0x01 +#define SVR4_CONFIG_UNUSED_1 0x01 #define SVR4_CONFIG_NGROUPS 0x02 #define SVR4_CONFIG_CHILD_MAX 0x03 #define SVR4_CONFIG_OPEN_FILES 0x04 @@ -43,20 +43,36 @@ #define SVR4_CONFIG_PROF_TCK 0x0a #define SVR4_CONFIG_NPROC_CONF 0x0b #define SVR4_CONFIG_NPROC_ONLN 0x0c -#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0e -#define SVR4_CONFIG_AIO_MAX 0x0f -#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x10 -#define SVR4_CONFIG_DELAYTIMER_MAX 0x11 -#define SVR4_CONFIG_MQ_OPEN_MAX 0x12 -#define SVR4_CONFIG_MQ_PRIO_MAX 0x13 -#define SVR4_CONFIG_RTSIG_MAX 0x14 -#define SVR4_CONFIG_SEM_NSEMS_MAX 0x15 -#define SVR4_CONFIG_SEM_VALUE_MAX 0x16 -#define SVR4_CONFIG_SIGQUEUE_MAX 0x17 -#define SVR4_CONFIG_SIGRT_MIN 0x18 -#define SVR4_CONFIG_SIGRT_MAX 0x19 -#define SVR4_CONFIG_TIMER_MAX 0x20 -#define SVR4_CONFIG_PHYS_PAGES 0x21 -#define SVR4_CONFIG_AVPHYS_PAGES 0x22 +#define SVR4_CONFIG_AIO_LISTIO_MAX 0x0d +#define SVR4_CONFIG_AIO_MAX 0x0e +#define SVR4_CONFIG_AIO_PRIO_DELTA_MAX 0x0f +#define SVR4_CONFIG_DELAYTIMER_MAX 0x10 +#define SVR4_CONFIG_MQ_OPEN_MAX 0x11 +#define SVR4_CONFIG_MQ_PRIO_MAX 0x12 +#define SVR4_CONFIG_RTSIG_MAX 0x13 +#define SVR4_CONFIG_SEM_NSEMS_MAX 0x14 +#define SVR4_CONFIG_SEM_VALUE_MAX 0x15 +#define SVR4_CONFIG_SIGQUEUE_MAX 0x16 +#define SVR4_CONFIG_SIGRT_MIN 0x17 +#define SVR4_CONFIG_SIGRT_MAX 0x18 +#define SVR4_CONFIG_TIMER_MAX 0x19 +#define SVR4_CONFIG_PHYS_PAGES 0x1a +#define SVR4_CONFIG_AVPHYS_PAGES 0x1b +#define SVR4_CONFIG_COHERENCY 0x1c +#define SVR4_CONFIG_SPLIT_CACHE 0x1d +#define SVR4_CONFIG_ICACHESZ 0x1e +#define SVR4_CONFIG_DCACHESZ 0x1f +#define SVR4_CONFIG_ICACHELINESZ 0x20 +#define SVR4_CONFIG_DCACHELINESZ 0x21 +#define SVR4_CONFIG_ICACHEBLKSZ 0x22 +#define SVR4_CONFIG_DCACHEBLKSZ 0x23 +#define SVR4_CONFIG_DCACHETBLKSZ 0x24 +#define SVR4_CONFIG_ICACHE_ASSOC 0x25 +#define SVR4_CONFIG_DCACHE_ASSOC 0x26 +#define SVR4_CONFIG_UNUSED_2 0x27 +#define SVR4_CONFIG_UNUSED_3 0x28 +#define SVR4_CONFIG_UNUSED_4 0x29 +#define SVR4_CONFIG_MAXPID 0x2a +#define SVR4_CONFIG_STACK_PROT 0x2b #endif /* !_SVR4_SYSCONFIG_H_ */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 04:38:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA4061065693; Sun, 3 Jan 2010 04:38:38 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9DB58FC17; Sun, 3 Jan 2010 04:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o034ccKY056423; Sun, 3 Jan 2010 04:38:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o034cc7w056420; Sun, 3 Jan 2010 04:38:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201001030438.o034cc7w056420@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 3 Jan 2010 04:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201415 - head/sys/pc98/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 04:38:38 -0000 Author: nyan Date: Sun Jan 3 04:38:38 2010 New Revision: 201415 URL: http://svn.freebsd.org/changeset/base/201415 Log: Re-enable more options and devices. Now kernel size problem is gone. MFC after: 2 week Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Jan 3 03:35:23 2010 (r201414) +++ head/sys/pc98/conf/GENERIC Sun Jan 3 04:38:38 2010 (r201415) @@ -38,7 +38,7 @@ options SCHED_4BSD # 4BSD scheduler #options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols -#options SCTP # Stream Control Transmission Protocol +options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists @@ -46,13 +46,13 @@ options UFS_DIRHASH # Improve performa options UFS_GJOURNAL # Enable gjournal-based UFS journaling options MD_ROOT # MD is a potential root device options NFSCLIENT # Network Filesystem Client -#options NFSSERVER # Network Filesystem Server -#options NFSLOCKD # Network Lock Manager +options NFSSERVER # Network Filesystem Server +options NFSLOCKD # Network Lock Manager options NFS_ROOT # NFS usable as /, requires NFSCLIENT options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem -#options PROCFS # Process filesystem (requires PSEUDOFS) -#options PSEUDOFS # Pseudo-filesystem framework +options PROCFS # Process filesystem (requires PSEUDOFS) +options PSEUDOFS # Pseudo-filesystem framework options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty) @@ -66,9 +66,9 @@ options EPSON_BOUNCEDMA # use bounce b #options LINE30 options KTRACE # ktrace(1) support options STACK # stack(9) support -#options SYSVSHM # SYSV-style shared memory -#options SYSVMSG # SYSV-style message queues -#options SYSVSEM # SYSV-style semaphores +options SYSVSHM # SYSV-style shared memory +options SYSVMSG # SYSV-style message queues +options SYSVSEM # SYSV-style semaphores options P1003_1B_SEMAPHORES # POSIX-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev @@ -114,9 +114,9 @@ device sym # NCR/Symbios Logic (newer device aic # PC-9801-100 device ct # host adapter using WD33C93[ABC] chip (C bus) -#device ncv # NCR 53C500 -#device nsp # Workbit Ninja SCSI-3 -#device stg # TMC 18C30/18C50 +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 # SCSI peripherals device scbus # SCSI bus (required for SCSI) @@ -155,9 +155,9 @@ device sc # PCCARD (PCMCIA) support # PCMCIA and cardbus bridge support -#device cbb # cardbus (yenta) bridge -#device pccard # PC Card (16-bit) bus -#device cardbus # CardBus (32-bit) bus +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus # Serial (COM) ports #options COM_MULTIPORT @@ -169,15 +169,15 @@ device mse #device joy # NEW Parallel port -#device ppc -#device ppbus # Parallel port bus (required) -#device lpt # Printer -#device plip # TCP/IP over parallel -#device ppi # Parallel port interface device +device ppc +device ppbus # Parallel port bus (required) +device lpt # Printer +device plip # TCP/IP over parallel +device ppi # Parallel port interface device #device vpo # Requires scbus and da # OLD Parallel port # Please stay olpt driver after ppc driver -#device olpt +device olpt # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 06:43:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5E11065679; Sun, 3 Jan 2010 06:43:13 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 694E18FC15; Sun, 3 Jan 2010 06:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o036hDGu092254; Sun, 3 Jan 2010 06:43:13 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o036hDQ6092252; Sun, 3 Jan 2010 06:43:13 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201001030643.o036hDQ6092252@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 3 Jan 2010 06:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201416 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 06:43:13 -0000 Author: np Date: Sun Jan 3 06:43:13 2010 New Revision: 201416 URL: http://svn.freebsd.org/changeset/base/201416 Log: Avoid NULL dereference in arpresolve. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Jan 3 04:38:38 2010 (r201415) +++ head/sys/netinet/if_ether.c Sun Jan 3 06:43:13 2010 (r201416) @@ -372,8 +372,8 @@ retry: if (la->la_asked < V_arp_maxtries) error = EWOULDBLOCK; /* First request. */ else - error = - (rt0->rt_flags & RTF_GATEWAY) ? EHOSTUNREACH : EHOSTDOWN; + error = rt0 != NULL && (rt0->rt_flags & RTF_GATEWAY) ? + EHOSTUNREACH : EHOSTDOWN; if (renew) { LLE_ADDREF(la); From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 08:33:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99692106568B; Sun, 3 Jan 2010 08:33:24 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 878508FC27; Sun, 3 Jan 2010 08:33:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o038XOKD024152; Sun, 3 Jan 2010 08:33:24 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o038XOdb024150; Sun, 3 Jan 2010 08:33:24 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001030833.o038XOdb024150@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 08:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201419 - head/tools/regression/acct X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 08:33:24 -0000 Author: obrien Date: Sun Jan 3 08:33:24 2010 New Revision: 201419 URL: http://svn.freebsd.org/changeset/base/201419 Log: Transform from kernel file to userland source. Modified: head/tools/regression/acct/Makefile Modified: head/tools/regression/acct/Makefile ============================================================================== --- head/tools/regression/acct/Makefile Sun Jan 3 06:50:49 2010 (r201418) +++ head/tools/regression/acct/Makefile Sun Jan 3 08:33:24 2010 (r201419) @@ -6,12 +6,16 @@ PROG= pack NO_MAN= +CFLAGS= -include /usr/include/sys/limits.h \ + -include /usr/include/sys/syslog.h + all: regress pack: pack.c convert.c convert.c: ../../../sys/kern/kern_acct.c - sed -n '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ + sed -n -e 's/log(/syslog(/g' \ + -e '/FLOAT_CONVERSION_START/,/FLOAT_CONVERSION_END/p' $? >$@ regress: pack regress.t ./regress.t From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 08:44:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBBC1065672; Sun, 3 Jan 2010 08:44:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92B518FC15; Sun, 3 Jan 2010 08:44:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o038iInD027341; Sun, 3 Jan 2010 08:44:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o038iIlw027339; Sun, 3 Jan 2010 08:44:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001030844.o038iIlw027339@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 08:44:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201420 - head/tools/regression/acct X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 08:44:18 -0000 Author: obrien Date: Sun Jan 3 08:44:18 2010 New Revision: 201420 URL: http://svn.freebsd.org/changeset/base/201420 Log: Make sure 'pack' is usable for 'prove -r'. Modified: head/tools/regression/acct/regress.t (contents, props changed) Modified: head/tools/regression/acct/regress.t ============================================================================== --- head/tools/regression/acct/regress.t Sun Jan 3 08:33:24 2010 (r201419) +++ head/tools/regression/acct/regress.t Sun Jan 3 08:44:18 2010 (r201420) @@ -17,6 +17,8 @@ check() fi } +(cd $DIR ; make pack) + echo 1..7 check 1 0 0 From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 09:30:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E07B1065672; Sun, 3 Jan 2010 09:30:51 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F01E78FC0A; Sun, 3 Jan 2010 09:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o039Uoxt040993; Sun, 3 Jan 2010 09:30:50 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o039Uors040991; Sun, 3 Jan 2010 09:30:50 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001030930.o039Uors040991@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 09:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201421 - head/tools/regression/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 09:30:51 -0000 Author: obrien Date: Sun Jan 3 09:30:50 2010 New Revision: 201421 URL: http://svn.freebsd.org/changeset/base/201421 Log: Allow to be driven by 'prove -r'. Modified: head/tools/regression/bin/date/regress.sh Modified: head/tools/regression/bin/date/regress.sh ============================================================================== --- head/tools/regression/bin/date/regress.sh Sun Jan 3 08:44:18 2010 (r201420) +++ head/tools/regression/bin/date/regress.sh Sun Jan 3 09:30:50 2010 (r201421) @@ -29,25 +29,29 @@ check() A1=$2 A2=$3 - count=`expr ${count} + 1` - if [ -z "${A2}" ]; then A2=${A1}; fi + count=`expr ${count} + 1` + R=`date -r ${TEST1} +%${S}` if [ "${R}" = "${A1}" ]; then - echo "${count}a. ${S} - ok" + echo "ok ${count} - ${S}(a)" else - echo "${count}a. ${S} - not ok (got ${R}, expected ${A1})" + echo "no ok ${count} - ${S}(a) (got ${R}, expected ${A1})" fi + count=`expr ${count} + 1` + R=`date -r ${TEST2} +%${S}` if [ "${R}" = "${A2}" ]; then - echo "${count}b. ${S} - ok" + echo "ok ${count} - ${S}(b)" else - echo "${count}b. ${S} - not ok (got ${R}, expected ${A2})" + echo "no ok ${count} - ${S}(b) (got ${R}, expected ${A2})" fi } +echo "1..78" + check A Saturday Monday check a Sat Mon check B February November From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 09:31:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F51106568F; Sun, 3 Jan 2010 09:31:34 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 436888FC0A; Sun, 3 Jan 2010 09:31:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o039VYrF041246; Sun, 3 Jan 2010 09:31:34 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o039VYnQ041244; Sun, 3 Jan 2010 09:31:34 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001030931.o039VYnQ041244@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 09:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201422 - head/tools/regression/bin/mv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 09:31:34 -0000 Author: obrien Date: Sun Jan 3 09:31:33 2010 New Revision: 201422 URL: http://svn.freebsd.org/changeset/base/201422 Log: Hide expected error output so the 'prove -r' results are easy to read. Modified: head/tools/regression/bin/mv/regress.sh Modified: head/tools/regression/bin/mv/regress.sh ============================================================================== --- head/tools/regression/bin/mv/regress.sh Sun Jan 3 09:30:50 2010 (r201421) +++ head/tools/regression/bin/mv/regress.sh Sun Jan 3 09:31:33 2010 (r201422) @@ -184,7 +184,7 @@ do # Should fail per POSIX step 3a: # Destination path is a file of type directory and # source_file is not a file of type directory - mv 1/2/3/fa ${FS}db + mv 1/2/3/fa ${FS}db 2>/dev/null ckfail $? ckf fa 1/2/3/fa end @@ -238,7 +238,7 @@ do mkd da1/da2/da3/da mkdir -p ${FS}db1/db2/db3/da/full # Should fail (per the semantics of rename(2)) - mv da1/da2/da3/da ${FS}db1/db2/db3 + mv da1/da2/da3/da ${FS}db1/db2/db3 2>/dev/null ckfail $? ckd da da1/da2/da3/da end @@ -250,7 +250,7 @@ do # Should fail per POSIX step 3b: # Destination path is a file not of type directory # and source_file is a file of type directory - mv da1/da2/da3/da ${FS}db1/db2/db3/da + mv da1/da2/da3/da ${FS}db1/db2/db3/da 2>/dev/null ckfail $? ckd da da1/da2/da3/da end From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 11:53:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C97D106566C; Sun, 3 Jan 2010 11:53:48 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFD18FC19; Sun, 3 Jan 2010 11:53:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03BrmDm087182; Sun, 3 Jan 2010 11:53:48 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03Brmlu087180; Sun, 3 Jan 2010 11:53:48 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001031153.o03Brmlu087180@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 11:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201426 - head/tools/regression/usr.bin/jot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 11:53:48 -0000 Author: obrien Date: Sun Jan 3 11:53:48 2010 New Revision: 201426 URL: http://svn.freebsd.org/changeset/base/201426 Log: Provide clean output with 'prove -r'. Modified: head/tools/regression/usr.bin/jot/regress.sh Modified: head/tools/regression/usr.bin/jot/regress.sh ============================================================================== --- head/tools/regression/usr.bin/jot/regress.sh Sun Jan 3 11:04:49 2010 (r201425) +++ head/tools/regression/usr.bin/jot/regress.sh Sun Jan 3 11:53:48 2010 (r201426) @@ -52,8 +52,8 @@ REGRESSION_TEST(`wo', `jot -w "a%ob" 10' REGRESSION_TEST(`wx', `jot -w "a%xb" 10') REGRESSION_TEST(`wX1', `jot -w "a%Xb" 10') REGRESSION_TEST(`wXl', `jot -w "a%Xb" 10 2147483648') -REGRESSION_TEST(`wdl', `jot -w "a%db" 10 2147483648') -REGRESSION_TEST(`wxn', `jot -w "a%xb" 10 -5') +REGRESSION_TEST(`wdl', `jot -w "a%db" 10 2147483648 2>/dev/null') +REGRESSION_TEST(`wxn', `jot -w "a%xb" 10 -5 2>/dev/null') REGRESSION_TEST(`wdn', `jot -w "a%db" 10 -5') REGRESSION_TEST(`wp1', `jot -w "%%%d%%%%" 10') REGRESSION_TEST(`wp2', `jot -w "%d%%d%%" 10') From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 12:17:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A64E1106568F; Sun, 3 Jan 2010 12:17:51 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94F7F8FC0A; Sun, 3 Jan 2010 12:17:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03CHprI096508; Sun, 3 Jan 2010 12:17:51 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03CHp65096506; Sun, 3 Jan 2010 12:17:51 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001031217.o03CHp65096506@svn.freebsd.org> From: "David E. O'Brien" Date: Sun, 3 Jan 2010 12:17:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201427 - head/tools/regression/bin/date X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 12:17:51 -0000 Author: obrien Date: Sun Jan 3 12:17:51 2010 New Revision: 201427 URL: http://svn.freebsd.org/changeset/base/201427 Log: Use t1 & t2 as more symbolic than 'a' and 'b' for the two times. Modified: head/tools/regression/bin/date/regress.sh Modified: head/tools/regression/bin/date/regress.sh ============================================================================== --- head/tools/regression/bin/date/regress.sh Sun Jan 3 11:53:48 2010 (r201426) +++ head/tools/regression/bin/date/regress.sh Sun Jan 3 12:17:51 2010 (r201427) @@ -29,24 +29,22 @@ check() A1=$2 A2=$3 - if [ -z "${A2}" ]; then A2=${A1}; fi - count=`expr ${count} + 1` + if [ -z "${A2}" ]; then A2=${A1}; fi + R=`date -r ${TEST1} +%${S}` if [ "${R}" = "${A1}" ]; then - echo "ok ${count} - ${S}(a)" + echo "ok ${S}{t1}" else - echo "no ok ${count} - ${S}(a) (got ${R}, expected ${A1})" + echo "no ok ${S}{t1} - (got ${R}, expected ${A1})" fi - count=`expr ${count} + 1` - R=`date -r ${TEST2} +%${S}` if [ "${R}" = "${A2}" ]; then - echo "ok ${count} - ${S}(b)" + echo "ok ${S}{t2}" else - echo "no ok ${count} - ${S}(b) (got ${R}, expected ${A2})" + echo "no ok ${S}{t2} - (got ${R}, expected ${A2})" fi } From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 12:50:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A3D21065695; Sun, 3 Jan 2010 12:50:28 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52118FC13; Sun, 3 Jan 2010 12:50:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03CoRlm009281; Sun, 3 Jan 2010 12:50:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03CoRtc009279; Sun, 3 Jan 2010 12:50:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001031250.o03CoRtc009279@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Jan 2010 12:50:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201428 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 12:50:28 -0000 Author: jilles Date: Sun Jan 3 12:50:27 2010 New Revision: 201428 URL: http://svn.freebsd.org/changeset/base/201428 Log: sh: Add a regression test that tries out all arithmetic ops. MFC after: 1 week Added: head/tools/regression/bin/sh/expansion/arith2.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/arith2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith2.0 Sun Jan 3 12:50:27 2010 (r201428) @@ -0,0 +1,76 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ $(($1)) != $2 ]; then + failures=$((failures+1)) + echo "For $1, expected $2 actual $(($1))" + fi +} + +# variables +unset v +check "v=2" 2 +check "v" 2 +check "$(($v))" 2 +check "v+=1" 3 +check "v" 3 + +# constants +check "4611686018427387904" 4611686018427387904 +check "0x4000000000000000" 4611686018427387904 +check "0400000000000000000000" 4611686018427387904 +check "0x4Ab0000000000000" 5381801554707742720 + +# try out all operators +v=42 +check "!v" 0 +check "!!v" 1 +check "!0" 1 +check "~0" -1 +check "~(-1)" 0 +check "-0" 0 +check "-v" -42 +check "v*v" 1764 +check "v/2" 21 +check "v%10" 2 +check "v+v" 84 +check "v-4" 38 +check "v<<1" 84 +check "v>>1" 21 +check "v<43" 1 +check "v>42" 0 +check "v<=43" 1 +check "v>=43" 0 +check "v==41" 0 +check "v!=42" 0 +check "v&3" 2 +check "v^3" 41 +check "v|3" 43 +check "v>=40&&v<=44" 1 +check "v<40||v>44" 0 +check "(v=42)&&(v+=1)==43" 1 +check "v" 43 +check "(v=42)&&(v-=1)==41" 1 +check "v" 41 +check "(v=42)&&(v*=2)==84" 1 +check "v" 84 +check "(v=42)&&(v/=10)==4" 1 +check "v" 4 +check "(v=42)&&(v%=10)==2" 1 +check "v" 2 +check "(v=42)&&(v<<=1)==84" 1 +check "v" 84 +check "(v=42)&&(v>>=2)==10" 1 +check "v" 10 +check "(v=42)&&(v&=32)==32" 1 +check "v" 32 +check "(v=42)&&(v^=32)==10" 1 +check "v" 10 +check "(v=42)&&(v|=32)==42" 1 +check "v" 42 + +# missing: ternary, comma + +exit $((failures != 0)) From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 12:57:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 035451065672; Sun, 3 Jan 2010 12:57:33 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 759938FC17; Sun, 3 Jan 2010 12:57:32 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7B3A845E90; Sun, 3 Jan 2010 13:57:30 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 6382045C9C; Sun, 3 Jan 2010 13:57:25 +0100 (CET) Date: Sun, 3 Jan 2010 13:57:34 +0100 From: Pawel Jakub Dawidek To: Xin LI Message-ID: <20100103125734.GB1704@garage.freebsd.pl> References: <201001030305.o0335UWJ033568@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="61jdw2sOBCFtR2d/" Content-Disposition: inline In-Reply-To: <201001030305.o0335UWJ033568@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org, mm@FreeBSD.org Subject: Re: svn commit: r201411 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 12:57:33 -0000 --61jdw2sOBCFtR2d/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 03, 2010 at 03:05:30AM +0000, Xin LI wrote: > Author: delphij > Date: Sun Jan 3 03:05:30 2010 > New Revision: 201411 > URL: http://svn.freebsd.org/changeset/base/201411 >=20 > Log: > MFC r200726: > =20 > Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG > (onnv revision 8986) > =20 > PR: kern/141355 > Requested by: mm > Submitted by: pjd Did you take my version of the patch? Martin's patch was more complete, AFAIR. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --61jdw2sOBCFtR2d/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFLQJQ9ForvXbEpPzQRAqJlAJ9KDXX5xHsKDLDNHd+rptWroookxwCfagT1 ASuhaoy08DBzcV0HWjkXl1s= =TYjP -----END PGP SIGNATURE----- --61jdw2sOBCFtR2d/-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 13:48:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 158C3106568F; Sun, 3 Jan 2010 13:48:59 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 050E78FC1E; Sun, 3 Jan 2010 13:48:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03Dmw78033825; Sun, 3 Jan 2010 13:48:58 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03DmwLW033823; Sun, 3 Jan 2010 13:48:58 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001031348.o03DmwLW033823@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 3 Jan 2010 13:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201429 - head/usr.bin/tftp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 13:48:59 -0000 Author: gavin Date: Sun Jan 3 13:48:58 2010 New Revision: 201429 URL: http://svn.freebsd.org/changeset/base/201429 Log: Fix return code in the case of successful file transfer, broken in tftp.c 1.13 PR: bin/117452 Submitted by: Spencer Minear minear securecomputing.com Approved by: ed (mentor) MFC after: 2 weeks Modified: head/usr.bin/tftp/tftp.c Modified: head/usr.bin/tftp/tftp.c ============================================================================== --- head/usr.bin/tftp/tftp.c Sun Jan 3 12:50:27 2010 (r201428) +++ head/usr.bin/tftp/tftp.c Sun Jan 3 13:48:58 2010 (r201429) @@ -140,6 +140,7 @@ send_data: (struct sockaddr *)&peer, peer.ss_len); if (n != size + 4) { warn("sendto"); + txrx_error = 1; goto abort; } read_ahead(file, convert); @@ -153,6 +154,7 @@ send_data: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -160,6 +162,7 @@ send_data: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -202,7 +205,6 @@ abort: stopclock(); if (amount > 0) printstats("Sent", amount); - txrx_error = 1; } /* @@ -255,6 +257,7 @@ send_ack: peer.ss_len) != size) { alarm(0); warn("sendto"); + txrx_error = 1; goto abort; } write_behind(file, convert); @@ -268,6 +271,7 @@ send_ack: alarm(0); if (n < 0) { warn("recvfrom"); + txrx_error = 1; goto abort; } if (!serv.ss_family) @@ -275,6 +279,7 @@ send_ack: else if (!cmpport((struct sockaddr *)&serv, (struct sockaddr *)&from)) { warn("server port mismatch"); + txrx_error = 1; goto abort; } peer = from; @@ -325,7 +330,6 @@ abort: /* ok to ack, since user */ stopclock(); if (amount > 0) printstats("Received", amount); - txrx_error = 1; } static int From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 13:59:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 930441065692; Sun, 3 Jan 2010 13:59:59 +0000 (UTC) (envelope-from mbr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8254F8FC18; Sun, 3 Jan 2010 13:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03DxxFm038740; Sun, 3 Jan 2010 13:59:59 GMT (envelope-from mbr@svn.freebsd.org) Received: (from mbr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03DxxBp038737; Sun, 3 Jan 2010 13:59:59 GMT (envelope-from mbr@svn.freebsd.org) Message-Id: <201001031359.o03DxxBp038737@svn.freebsd.org> From: Martin Blapp Date: Sun, 3 Jan 2010 13:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201430 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 13:59:59 -0000 Author: mbr Date: Sun Jan 3 13:59:59 2010 New Revision: 201430 URL: http://svn.freebsd.org/changeset/base/201430 Log: Fix card/device names, no functional change The ADMtek AN985 is the cardbus variant of ADMtek AN983 The Netgear FA511 is just a relabled ADMtek AN985 PR: kern/50574 MFC after: 1 month Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sun Jan 3 13:48:58 2010 (r201429) +++ head/sys/dev/dc/if_dc.c Sun Jan 3 13:59:59 2010 (r201430) @@ -43,8 +43,9 @@ __FBSDID("$FreeBSD$"); * ASIX Electronics AX88140A (www.asix.com.tw) * ASIX Electronics AX88141 (www.asix.com.tw) * ADMtek AL981 (www.admtek.com.tw) - * ADMtek AN985 (www.admtek.com.tw) - * Netgear FA511 (www.netgear.com) Appears to be rebadged ADMTek AN985 + * ADMtek AN983 (www.admtek.com.tw) + * ADMtek cardbus AN985 (www.admtek.com.tw) + * Netgear FA511 (www.netgear.com) Appears to be rebadged ADMTek cardbus AN985 * Davicom DM9100, DM9102, DM9102A (www.davicom8.com) * Accton EN1217 (www.accton.com) * Xircom X3201 (www.xircom.com) @@ -161,14 +162,14 @@ static const struct dc_type dc_devs[] = "Davicom DM9102 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AL981), 0, "ADMtek AL981 10/100BaseTX" }, + { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN983), 0, + "ADMtek AN983 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN985), 0, - "ADMtek AN985 10/100BaseTX" }, + "ADMtek AN985 cardBus 10/100BaseTX or clone" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9511), 0, "ADMtek ADM9511 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9513), 0, "ADMtek ADM9513 10/100BaseTX" }, - { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_FA511), 0, - "Netgear FA511 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ASIX, DC_DEVICEID_AX88140A), DC_REVISION_88141, "ASIX AX88141 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ASIX, DC_DEVICEID_AX88140A), 0, @@ -778,10 +779,10 @@ dc_miibus_readreg(device_t dev, int phy, bzero(&frame, sizeof(frame)); /* - * Note: both the AL981 and AN985 have internal PHYs, + * Note: both the AL981 and AN983 have internal PHYs, * however the AL981 provides direct access to the PHY - * registers while the AN985 uses a serial MII interface. - * The AN985's MII interface is also buggy in that you + * registers while the AN983 uses a serial MII interface. + * The AN983's MII interface is also buggy in that you * can read from any MII address (0 to 31), but only address 1 * behaves normally. To deal with both cases, we pretend * that the PHY is at MII address 1. @@ -1895,11 +1896,11 @@ dc_attach(device_t dev) sc->dc_pmode = DC_PMODE_MII; dc_read_srom(sc, sc->dc_romwidth); break; + case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN983): case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN985): case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9511): case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9513): case DC_DEVID(DC_VENDORID_DLINK, DC_DEVICEID_DRP32TXD): - case DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_FA511): case DC_DEVID(DC_VENDORID_ABOCOM, DC_DEVICEID_FE2500): case DC_DEVID(DC_VENDORID_ABOCOM, DC_DEVICEID_FE2500MX): case DC_DEVID(DC_VENDORID_ACCTON, DC_DEVICEID_EN2242): @@ -1910,7 +1911,7 @@ dc_attach(device_t dev) case DC_DEVID(DC_VENDORID_MICROSOFT, DC_DEVICEID_MSMN130): case DC_DEVID(DC_VENDORID_LINKSYS, DC_DEVICEID_PCMPC200_AB08): case DC_DEVID(DC_VENDORID_LINKSYS, DC_DEVICEID_PCMPC200_AB09): - sc->dc_type = DC_TYPE_AN985; + sc->dc_type = DC_TYPE_AN983; sc->dc_flags |= DC_64BIT_HASH; sc->dc_flags |= DC_TX_USE_TX_INTR; sc->dc_flags |= DC_TX_ADMTEK_WAR; @@ -2057,7 +2058,7 @@ dc_attach(device_t dev) dc_read_eeprom(sc, (caddr_t)&eaddr, DC_EE_NODEADDR, 3, 0); break; case DC_TYPE_AL981: - case DC_TYPE_AN985: + case DC_TYPE_AN983: reg = CSR_READ_4(sc, DC_AL_PAR0); mac = (uint8_t *)&eaddr[0]; mac[0] = (reg >> 0) & 0xff; Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Sun Jan 3 13:48:58 2010 (r201429) +++ head/sys/dev/dc/if_dcreg.h Sun Jan 3 13:59:59 2010 (r201430) @@ -72,7 +72,7 @@ #define DC_TYPE_21143 0x4 /* Intel 21143 */ #define DC_TYPE_ASIX 0x5 /* ASIX AX88140A/AX88141 */ #define DC_TYPE_AL981 0x6 /* ADMtek AL981 Comet */ -#define DC_TYPE_AN985 0x7 /* ADMtek AN985 Centaur */ +#define DC_TYPE_AN983 0x7 /* ADMtek AN983 Centaur */ #define DC_TYPE_DM9102 0x8 /* Davicom DM9102 */ #define DC_TYPE_PNICII 0x9 /* 82c115 PNIC II */ #define DC_TYPE_PNIC 0xA /* 82c168/82c169 PNIC I */ @@ -86,12 +86,12 @@ #define DC_IS_ADMTEK(x) \ (x->dc_type == DC_TYPE_AL981 || \ - x->dc_type == DC_TYPE_AN985) + x->dc_type == DC_TYPE_AN983) #define DC_IS_INTEL(x) (x->dc_type == DC_TYPE_21143) #define DC_IS_ASIX(x) (x->dc_type == DC_TYPE_ASIX) #define DC_IS_COMET(x) (x->dc_type == DC_TYPE_AL981) -#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN985) +#define DC_IS_CENTAUR(x) (x->dc_type == DC_TYPE_AN983) #define DC_IS_DAVICOM(x) (x->dc_type == DC_TYPE_DM9102) #define DC_IS_PNICII(x) (x->dc_type == DC_TYPE_PNICII) #define DC_IS_PNIC(x) (x->dc_type == DC_TYPE_PNIC) @@ -543,8 +543,8 @@ struct dc_mii_frame { */ /* - * ADMtek specific registers and constants for the AL981 and AN985. - * The AN985 doesn't use the magic PHY registers. + * ADMtek specific registers and constants for the AL981 and AN983. + * The AN983 doesn't use the magic PHY registers. */ #define DC_AL_CR 0x88 /* command register */ #define DC_AL_PAR0 0xA4 /* station address */ @@ -890,8 +890,8 @@ struct dc_softc { * ADMtek device IDs. */ #define DC_DEVICEID_AL981 0x0981 -#define DC_DEVICEID_AN985 0x0985 -#define DC_DEVICEID_FA511 0x1985 +#define DC_DEVICEID_AN983 0x0985 +#define DC_DEVICEID_AN985 0x1985 #define DC_DEVICEID_ADM9511 0x9511 #define DC_DEVICEID_ADM9513 0x9513 From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 15:01:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FEA81065676; Sun, 3 Jan 2010 15:01:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA21A8FC15; Sun, 3 Jan 2010 15:01:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03F1cbY063541; Sun, 3 Jan 2010 15:01:38 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03F1cKj063538; Sun, 3 Jan 2010 15:01:38 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001031501.o03F1cKj063538@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 3 Jan 2010 15:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201431 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 15:01:39 -0000 Author: jilles Date: Sun Jan 3 15:01:38 2010 New Revision: 201431 URL: http://svn.freebsd.org/changeset/base/201431 Log: sh: Send the "not found" message for builtin to redirected fd 2. Added: head/tools/regression/bin/sh/builtins/builtin1.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jan 3 13:59:59 2010 (r201430) +++ head/bin/sh/eval.c Sun Jan 3 15:01:38 2010 (r201431) @@ -722,9 +722,10 @@ evalcommand(union node *cmd, int flags, break; if ((cmdentry.u.index = find_builtin(*argv, &cmdentry.special)) < 0) { - out2fmt_flush("%s: not found\n", *argv); - exitstatus = 127; - return; + cmdentry.u.index = BLTINCMD; + argv--; + argc++; + break; } if (cmdentry.u.index != BLTINCMD) break; @@ -944,12 +945,17 @@ prehash(union node *n) */ /* - * No command given, or a bltin command with no arguments. + * No command given, a bltin command with no arguments, or a bltin command + * with an invalid name. */ int -bltincmd(int argc __unused, char **argv __unused) +bltincmd(int argc, char **argv) { + if (argc > 1) { + out2fmt_flush("%s: not found\n", argv[1]); + return 127; + } /* * Preserve exitstatus of a previous possible redirection * as POSIX mandates Added: head/tools/regression/bin/sh/builtins/builtin1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/builtin1.0 Sun Jan 3 15:01:38 2010 (r201431) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +failures=0 + +check() { + if ! eval "[ $* ]"; then + echo "Failed: $*" + : $((failures += 1)) + fi +} + +builtin : || echo "Bad return code at $LINENO" +builtin true || echo "Bad return code at $LINENO" +builtin ls 2>/dev/null && echo "Bad return code at $LINENO" +check '"$(builtin pwd)" = "$(pwd)"' +check '-z "$(builtin :)"' +check '-z "$(builtin true)"' +check '-z "$( (builtin nosuchtool) 2>/dev/null)"' +check '-z "$(builtin nosuchtool 2>/dev/null)"' +check '-z "$(builtin nosuchtool 2>/dev/null; :)"' +check '-z "$( (builtin ls) 2>/dev/null)"' +check '-z "$(builtin ls 2>/dev/null)"' +check '-z "$(builtin ls 2>/dev/null; :)"' +check '-n "$( (builtin nosuchtool) 2>&1)"' +check '-n "$(builtin nosuchtool 2>&1)"' +check '-n "$(builtin nosuchtool 2>&1; :)"' +check '-n "$( (builtin ls) 2>&1)"' +check '-n "$(builtin ls 2>&1)"' +check '-n "$(builtin ls 2>&1; :)"' + +exit $((failures > 0)) From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 15:20:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96E6A106566B; Sun, 3 Jan 2010 15:20:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 852508FC12; Sun, 3 Jan 2010 15:20:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03FKqvY069225; Sun, 3 Jan 2010 15:20:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03FKqCN069221; Sun, 3 Jan 2010 15:20:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001031520.o03FKqCN069221@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 3 Jan 2010 15:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201432 - in head/sbin/geom: class/cache core X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 15:20:52 -0000 Author: trasz Date: Sun Jan 3 15:20:52 2010 New Revision: 201432 URL: http://svn.freebsd.org/changeset/base/201432 Log: Add manual page for gcache(8). Added: head/sbin/geom/class/cache/gcache.8 (contents, props changed) Modified: head/sbin/geom/class/cache/Makefile head/sbin/geom/core/geom.8 Modified: head/sbin/geom/class/cache/Makefile ============================================================================== --- head/sbin/geom/class/cache/Makefile Sun Jan 3 15:01:38 2010 (r201431) +++ head/sbin/geom/class/cache/Makefile Sun Jan 3 15:20:52 2010 (r201432) @@ -3,6 +3,5 @@ .PATH: ${.CURDIR}/../../misc CLASS= cache -NO_MAN= # notyet .include Added: head/sbin/geom/class/cache/gcache.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/geom/class/cache/gcache.8 Sun Jan 3 15:20:52 2010 (r201432) @@ -0,0 +1,192 @@ +.\"- +.\" Copyright (c) 2010 Edward Tomasz Napierala +.\" 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 THE VOICES IN HIS HEAD 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$ +.\" +.Dd January 3, 2010 +.Dt GCACHE 8 +.Os +.Sh NAME +.Nm gcache +.Nd "control utility for CACHE GEOM class" +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl v +.Op Fl b Ar blocksize +.Op Fl s Ar size +.Ar name +.Ar prov +.Nm +.Cm configure +.Op Fl v +.Op Fl b Ar blocksize +.Op Fl s Ar size +.Ar name +.Nm +.Cm destroy +.Op Fl fv +.Ar name +.Nm +.Cm label +.Op Fl v +.Op Fl b Ar blocksize +.Op Fl s Ar size +.Ar name +.Ar prov +.Nm +.Cm stop +.Op Fl fv +.Ar name ... +.Nm +.Cm clear +.Op Fl v +.Ar prov ... +.Nm +.Cm dump +.Ar prov ... +.Nm +.Cm list +.Nm +.Cm status +.Op Fl s Ar name +.Nm +.Cm load +.Op Fl v +.Nm +.Cm unload +.Op Fl v +.Sh DESCRIPTION +The +.Nm +utility is used to control GEOM cache, which can +speed up read performance by sending fixed size +read requests to its consumer. It has been developed to address +the problem of a horrible read performance of a 64k blocksize FS +residing on a RAID3 array with 8 data components, where a single +disk component would only get 8k read requests, thus effectively +killing disk performance under high load. +.Pp +Caching can be configured using two different methods: +.Dq manual +or +.Dq automatic . +When using the +.Dq manual +method, no metadata are stored on the devices, so the cached +device has to be configured by hand every time it is needed. +The +.Dq automatic +method uses on-disk metadata to detect devices. +Once devices are labeled, they will be automatically detected and +configured. +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm destroy" +.It Cm create +Cache the given devices with specified +.Ar name . +This is the +.Dq manual +method. +The kernel module +.Pa geom_cache.ko +will be loaded if it is not loaded already. +.It Cm label +Cache the given devices with the specified +.Ar name . +This is the +.Dq automatic +method, where metadata are stored in every device's last sector. +The kernel module +.Pa geom_cache.ko +will be loaded if it is not loaded already. +.It Cm stop +Turn off existing cache device by its +.Ar name . +This command does not touch on-disk metadata! +.It Cm destroy +Same as +.Cm stop . +.It Cm clear +Clear metadata on the given devices. +.It Cm dump +Dump metadata stored on the given devices. +.It Cm list +See +.Xr geom 8 . +.It Cm status +See +.Xr geom 8 . +.It Cm load +See +.Xr geom 8 . +.It Cm unload +See +.Xr geom 8 . +.El +.Pp +Additional options: +.Bl -tag -width indent +.It Fl f +Force the removal of the specified cache device. +.It Fl v +Be more verbose. +.El +.Sh SYSCTL VARIABLES +The following +.Xr sysctl 8 +variables can be used to control the behavior of the +.Nm CACHE +GEOM class. +The default value is shown next to each variable. +.Bl -tag -width indent +.It Va kern.geom.cache.used_hi : No 20 +.It Va kern.geom.cache.used_lo : No 5 +.It Va kern.geom.cache.idletime : No 5 +.It Va kern.geom.cache.timeout : No 10 +.It Va kern.geom.cache.enable : No 1 +.It Va kern.geom.cache.debug : No 0 +Debug level of the +.Nm CACHE +GEOM class. +This can be set to a number between 0 and 3 inclusive. +If set to 0 minimal debug information is printed, and if set to 3 the +maximum amount of debug information is printed. +.El +.Sh EXIT STATUS +Exit status is 0 on success, and 1 if the command fails. +.Sh SEE ALSO +.Xr geom 4 , +.Xr geom 8 +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 7.0 . +.Sh AUTHORS +.An Ruslan Ermilov Aq ru@FreeBSD.org Modified: head/sbin/geom/core/geom.8 ============================================================================== --- head/sbin/geom/core/geom.8 Sun Jan 3 15:01:38 2010 (r201431) +++ head/sbin/geom/core/geom.8 Sun Jan 3 15:20:52 2010 (r201432) @@ -166,7 +166,7 @@ geom md unload .Sh SEE ALSO .Xr libgeom 3 , .Xr geom 4 , -.\" .Xr gcache 8 , +.Xr gcache 8 , .Xr gconcat 8 , .Xr geli 8 , .Xr gjournal 8 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 15:32:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4133A1065672; Sun, 3 Jan 2010 15:32:28 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 310498FC0C; Sun, 3 Jan 2010 15:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03FWSr0072683; Sun, 3 Jan 2010 15:32:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03FWSpQ072682; Sun, 3 Jan 2010 15:32:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001031532.o03FWSpQ072682@svn.freebsd.org> From: Ed Schouten Date: Sun, 3 Jan 2010 15:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201433 - head/usr.sbin/sendmail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 15:32:28 -0000 Author: ed Date: Sun Jan 3 15:32:25 2010 New Revision: 201433 URL: http://svn.freebsd.org/changeset/base/201433 Log: Lower WARNS for sendmail. Even though it builds with WARNS=2, some users link sendmail from the base system against SASL. This doesn't build in this case. Reported by: Andrzej Tobola Modified: head/usr.sbin/sendmail/Makefile Modified: head/usr.sbin/sendmail/Makefile ============================================================================== --- head/usr.sbin/sendmail/Makefile Sun Jan 3 15:20:52 2010 (r201432) +++ head/usr.sbin/sendmail/Makefile Sun Jan 3 15:32:25 2010 (r201433) @@ -43,7 +43,7 @@ CFLAGS+= ${DBMDEF} ${NIS} -DTCPWRAPPERS CFLAGS+= -DNETINET6 .endif -WARNS?= 2 +WARNS?= 1 DPADD= ${LIBUTIL} ${LIBWRAP} LDADD= -lutil -lwrap From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 17:19:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E65E1065695; Sun, 3 Jan 2010 17:19:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CAB08FC08; Sun, 3 Jan 2010 17:19:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03HJEP2000964; Sun, 3 Jan 2010 17:19:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03HJEZ1000962; Sun, 3 Jan 2010 17:19:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001031719.o03HJEZ1000962@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 3 Jan 2010 17:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201438 - head/sys/security/mac_lomac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 17:19:14 -0000 Author: trasz Date: Sun Jan 3 17:19:14 2010 New Revision: 201438 URL: http://svn.freebsd.org/changeset/base/201438 Log: Make mac_lomac(4) able to interpret NFSv4 access bits. Reviewed by: rwatson Modified: head/sys/security/mac_lomac/mac_lomac.c Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Sun Jan 3 17:19:04 2010 (r201437) +++ head/sys/security/mac_lomac/mac_lomac.c Sun Jan 3 17:19:14 2010 (r201438) @@ -2470,7 +2470,7 @@ lomac_vnode_check_open(struct ucred *cre obj = SLOT(vplabel); /* XXX privilege override for admin? */ - if (accmode & (VWRITE | VAPPEND | VADMIN)) { + if (accmode & VMODIFY_PERMS) { if (!lomac_subject_dominate(subj, obj)) return (EACCES); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 18:27:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40272106566C; Sun, 3 Jan 2010 18:27:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB368FC14; Sun, 3 Jan 2010 18:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03IRBMI015820; Sun, 3 Jan 2010 18:27:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03IRBF5015818; Sun, 3 Jan 2010 18:27:11 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201001031827.o03IRBF5015818@svn.freebsd.org> From: Rick Macklem Date: Sun, 3 Jan 2010 18:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201439 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 18:27:11 -0000 Author: rmacklem Date: Sun Jan 3 18:27:10 2010 New Revision: 201439 URL: http://svn.freebsd.org/changeset/base/201439 Log: Fix three related problems in the experimental nfs client when checking for conflicts w.r.t. byte range locks for NFSv4. 1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK. 2 - Check for "same file" when checking for a conflict. 3 - Don't check for a conflict for the F_UNLCK case. Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Jan 3 17:19:14 2010 (r201438) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Jan 3 18:27:10 2010 (r201439) @@ -116,8 +116,8 @@ static int nfscl_checkconflict(struct nf u_int8_t *, struct nfscllock **); static void nfscl_freelockowner(struct nfscllockowner *, int); static void nfscl_freealllocks(struct nfscllockownerhead *, int); -static int nfscl_localconflict(struct nfsclclient *, struct nfscllock *, - u_int8_t *, struct nfscldeleg *, struct nfscllock **); +static int nfscl_localconflict(struct nfsclclient *, u_int8_t *, int, + struct nfscllock *, u_int8_t *, struct nfscldeleg *, struct nfscllock **); static void nfscl_newopen(struct nfsclclient *, struct nfscldeleg *, struct nfsclowner **, struct nfsclowner **, struct nfsclopen **, struct nfsclopen **, u_int8_t *, u_int8_t *, int, int *); @@ -955,7 +955,8 @@ nfscl_getbytelock(vnode_t vp, u_int64_t lhp = &op->nfso_lock; } if (!error && !recovery) - error = nfscl_localconflict(clp, nlop, ownp, ldp, NULL); + error = nfscl_localconflict(clp, np->n_fhp->nfh_fh, + np->n_fhp->nfh_len, nlop, ownp, ldp, NULL); if (error) { if (!recovery) { nfscl_clrelease(clp); @@ -1047,7 +1048,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t struct nfscldeleg *dp; struct nfsnode *np; u_int8_t own[NFSV4CL_LOCKNAMELEN]; - int ret = 0, fnd, error; + int ret = 0, fnd; np = VTONFS(vp); *lpp = NULL; @@ -1082,16 +1083,6 @@ nfscl_relbytelock(vnode_t vp, u_int64_t dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); - /* Search for a local conflict. */ - error = nfscl_localconflict(clp, nlop, own, dp, NULL); - if (error) { - NFSUNLOCKCLSTATE(); - FREE((caddr_t)nlop, M_NFSCLLOCK); - if (other_lop != NULL) - FREE((caddr_t)other_lop, M_NFSCLLOCK); - return (error); - } - /* * First, unlock any local regions on a delegation. */ @@ -3169,8 +3160,9 @@ nfscl_getmnt(u_int32_t cbident) * a write lock or this is an unlock. */ static int -nfscl_localconflict(struct nfsclclient *clp, struct nfscllock *nlop, - u_int8_t *own, struct nfscldeleg *dp, struct nfscllock **lopp) +nfscl_localconflict(struct nfsclclient *clp, u_int8_t *fhp, int fhlen, + struct nfscllock *nlop, u_int8_t *own, struct nfscldeleg *dp, + struct nfscllock **lopp) { struct nfsclowner *owp; struct nfsclopen *op; @@ -3183,10 +3175,13 @@ nfscl_localconflict(struct nfsclclient * } LIST_FOREACH(owp, &clp->nfsc_owner, nfsow_list) { LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { - ret = nfscl_checkconflict(&op->nfso_lock, nlop, own, - lopp); - if (ret) - return (ret); + if (op->nfso_fhlen == fhlen && + !NFSBCMP(op->nfso_fh, fhp, fhlen)) { + ret = nfscl_checkconflict(&op->nfso_lock, nlop, + own, lopp); + if (ret) + return (ret); + } } } return (0); @@ -3245,10 +3240,9 @@ nfscl_lockt(vnode_t vp, struct nfsclclie nfscl_filllockowner(p, own); NFSLOCKCLSTATE(); dp = nfscl_finddeleg(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len); - error = nfscl_localconflict(clp, &nlck, own, dp, &lop); - if (error == NFSERR_DENIED) - error = EACCES; - if (error) { + error = nfscl_localconflict(clp, np->n_fhp->nfh_fh, np->n_fhp->nfh_len, + &nlck, own, dp, &lop); + if (error != 0) { fl->l_whence = SEEK_SET; fl->l_start = lop->nfslo_first; if (lop->nfslo_end == NFS64BITSSET) @@ -3257,6 +3251,7 @@ nfscl_lockt(vnode_t vp, struct nfsclclie fl->l_len = lop->nfslo_end - lop->nfslo_first; fl->l_pid = (pid_t)0; fl->l_type = lop->nfslo_type; + error = -1; /* no RPC required */ } else if (dp != NULL && ((dp->nfsdl_flags & NFSCLDL_WRITE) || fl->l_type == F_RDLCK)) { /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 19:14:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9AB11065698; Sun, 3 Jan 2010 19:14:22 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8F6C8FC18; Sun, 3 Jan 2010 19:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03JEMOn026148; Sun, 3 Jan 2010 19:14:22 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03JEMpB026146; Sun, 3 Jan 2010 19:14:22 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001031914.o03JEMpB026146@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 3 Jan 2010 19:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201440 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 19:14:23 -0000 Author: gavin Date: Sun Jan 3 19:14:22 2010 New Revision: 201440 URL: http://svn.freebsd.org/changeset/base/201440 Log: The default hash table size is 257 not 255. Reword the rest of the line slightly while here. PR: bin/121671 Submitted by: Artis Caune artis.caune gmail.com Approved by: ed (mentor) Modified: head/etc/rc.d/nsswitch Modified: head/etc/rc.d/nsswitch ============================================================================== --- head/etc/rc.d/nsswitch Sun Jan 3 18:27:10 2010 (r201439) +++ head/etc/rc.d/nsswitch Sun Jan 3 19:14:22 2010 (r201440) @@ -77,10 +77,10 @@ generate_host_conf() nis) echo "nis" >> $host_conf ;; - *=*) + cache | *=*) ;; *) - printf "Warning: unrecognized source [%s]", $_s > "/dev/stderr" + printf "Warning: unrecognized source [%s]\n" $_s > "/dev/stderr" ;; esac done From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 19:19:08 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA68D106566C; Sun, 3 Jan 2010 19:19:08 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw2.york.ac.uk (mail-gw2.york.ac.uk [144.32.128.247]) by mx1.freebsd.org (Postfix) with ESMTP id 70FD58FC15; Sun, 3 Jan 2010 19:19:08 +0000 (UTC) Received: from mail-gw6.york.ac.uk (mail-gw6.york.ac.uk [144.32.129.26]) by mail-gw2.york.ac.uk (8.13.6/8.13.6) with ESMTP id o03JJ5BJ011572; Sun, 3 Jan 2010 19:19:05 GMT Received: from ury.york.ac.uk ([144.32.108.81]) by mail-gw6.york.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1NRVyj-0007kT-Hu; Sun, 03 Jan 2010 19:19:05 +0000 Received: from ury.york.ac.uk (localhost.york.ac.uk [127.0.0.1]) by ury.york.ac.uk (8.14.3/8.14.3) with ESMTP id o03JJ51w087261; Sun, 3 Jan 2010 19:19:05 GMT (envelope-from gavin@FreeBSD.org) Received: from localhost (gavin@localhost) by ury.york.ac.uk (8.14.3/8.14.3/Submit) with ESMTP id o03JJ5ib087250; Sun, 3 Jan 2010 19:19:05 GMT (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: ury.york.ac.uk: gavin owned process doing -bs Date: Sun, 3 Jan 2010 19:19:05 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@ury.york.ac.uk To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org In-Reply-To: <201001031914.o03JEMpB026146@svn.freebsd.org> Message-ID: References: <201001031914.o03JEMpB026146@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-York-MailScanner: Found to be clean X-York-MailScanner-From: gavin@freebsd.org Cc: Subject: Re: svn commit: r201440 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 19:19:08 -0000 On Sun, 3 Jan 2010, Gavin Atkinson wrote: > Author: gavin > Date: Sun Jan 3 19:14:22 2010 > New Revision: 201440 > URL: http://svn.freebsd.org/changeset/base/201440 > > Log: > The default hash table size is 257 not 255. Reword the rest of the line > slightly while here. > > PR: bin/121671 > Submitted by: Artis Caune artis.caune gmail.com > Approved by: ed (mentor) Apologies, this is the incorrect commit message. The correct one should have been: Don't complain when we encounter the "cache" source, it's valid. Also fix the error message to include a line feed and not include a stray comma. PR: bin/121671 Submitted by: Artis Caune artis.caune gmail.com Approved by: ed (mentor) MFC after: 2 weeks Gavin From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 19:28:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A135E106566C; Sun, 3 Jan 2010 19:28:51 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9067F8FC1B; Sun, 3 Jan 2010 19:28:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03JSp49029340; Sun, 3 Jan 2010 19:28:51 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03JSp37029338; Sun, 3 Jan 2010 19:28:51 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001031928.o03JSp37029338@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 3 Jan 2010 19:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201441 - head/usr.sbin/nscd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 19:28:51 -0000 Author: gavin Date: Sun Jan 3 19:28:51 2010 New Revision: 201441 URL: http://svn.freebsd.org/changeset/base/201441 Log: The default hash table size is 257 not 255. Reword the rest of the line slightly while here. PR: bin/121671 Submitted by: Artis Caune artis.caune gmail.com Approved by: ed (mentor) Modified: head/usr.sbin/nscd/nscd.conf.5 Modified: head/usr.sbin/nscd/nscd.conf.5 ============================================================================== --- head/usr.sbin/nscd/nscd.conf.5 Sun Jan 3 19:14:22 2010 (r201440) +++ head/usr.sbin/nscd/nscd.conf.5 Sun Jan 3 19:28:51 2010 (r201441) @@ -106,7 +106,7 @@ The default policy is fifo. This is the internal hash table size. The value should be a prime number for optimum performance. You should only change this value when the number of cached elements is -significantly (in 5-10 times) greater then the default hash table size (255). +significantly (5-10 times) greater than the default hash table size (257). .It Va keep-hot-count Oo Ar cachename Oc Op Ar value The size limit of the cache with the given .Ar cachename . From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 20:06:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FCC71065694; Sun, 3 Jan 2010 20:06:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (core.vx.sk [188.40.32.143]) by mx1.freebsd.org (Postfix) with ESMTP id DAABD8FC1B; Sun, 3 Jan 2010 20:06:34 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 0FFE045EFE; Sun, 3 Jan 2010 20:49:22 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lsel1EDOQJXf; Sun, 3 Jan 2010 20:49:20 +0100 (CET) Received: from [10.9.8.3] (chello089173000055.chello.sk [89.173.0.55]) by mail.vx.sk (Postfix) with ESMTPSA id C593D45EF8; Sun, 3 Jan 2010 20:49:19 +0100 (CET) Message-ID: <4B40F4D5.3060702@FreeBSD.org> Date: Sun, 03 Jan 2010 20:49:41 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201001030305.o0335UWJ033568@svn.freebsd.org> <20100103125734.GB1704@garage.freebsd.pl> In-Reply-To: <20100103125734.GB1704@garage.freebsd.pl> X-Enigmail-Version: 1.0 Content-Type: text/plain; charset=windows-1250 Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI , svn-src-stable-8@freebsd.org Subject: Re: svn commit: r201411 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 20:06:35 -0000 It is ok, I managed to split the patch into 2 patches, each representing a different OpenSolaris revision. Both have been commited by Xin. One of them is Pawel's zfs_recv_E2BIG.patch (this commit), the second one fixes OpenSolaris bug ID 6764159, represents onnv revision 7994 It has been commited as r200727 into HEAD and merged as r201412 into 8-STABLE Cheers, mm Dòa 3. 1. 2010 13:57, Pawel Jakub Dawidek wrote / napísal(a): > On Sun, Jan 03, 2010 at 03:05:30AM +0000, Xin LI wrote: > >> Author: delphij >> Date: Sun Jan 3 03:05:30 2010 >> New Revision: 201411 >> URL: http://svn.freebsd.org/changeset/base/201411 >> >> Log: >> MFC r200726: >> >> Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG >> (onnv revision 8986) >> >> PR: kern/141355 >> Requested by: mm >> Submitted by: pjd >> > Did you take my version of the patch? Martin's patch was more complete, > AFAIR. > > From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 20:08:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E4A1065676; Sun, 3 Jan 2010 20:08:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53168FC1D; Sun, 3 Jan 2010 20:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03K8BFq038046; Sun, 3 Jan 2010 20:08:11 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03K8Bdm038045; Sun, 3 Jan 2010 20:08:11 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201001032008.o03K8Bdm038045@svn.freebsd.org> From: Rick Macklem Date: Sun, 3 Jan 2010 20:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201442 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 20:08:11 -0000 Author: rmacklem Date: Sun Jan 3 20:08:10 2010 New Revision: 201442 URL: http://svn.freebsd.org/changeset/base/201442 Log: The test for "same client" for the experimental nfs server over NFSv4 was broken w.r.t. byte range lock conflicts when it was the same client and the request used the open_to_lock_owner4 case, since lckstp->ls_clp was not set. This patch fixes it by using "clp" instead of "lckstp->ls_clp". MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 3 19:28:51 2010 (r201441) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Jan 3 20:08:10 2010 (r201442) @@ -1753,7 +1753,7 @@ tryagain: (new_lop->lo_flags == NFSLCK_WRITE || lop->lo_flags == NFSLCK_WRITE) && lckstp != lop->lo_stp && - (lckstp->ls_clp != lop->lo_stp->ls_clp || + (clp != lop->lo_stp->ls_clp || lckstp->ls_ownerlen != lop->lo_stp->ls_ownerlen || NFSBCMP(lckstp->ls_owner, lop->lo_stp->ls_owner, lckstp->ls_ownerlen))) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 20:32:11 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D26A1065696; Sun, 3 Jan 2010 20:32:11 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id D341C8FC1F; Sun, 3 Jan 2010 20:32:10 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o03KUoN0002681; Sun, 3 Jan 2010 14:30:54 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o03KUn6L002680; Sun, 3 Jan 2010 14:30:49 -0600 (CST) (envelope-from brooks) Date: Sun, 3 Jan 2010 14:30:49 -0600 From: Brooks Davis To: Max Laier Message-ID: <20100103203049.GA2600@lor.one-eyed-alien.net> References: <200912312044.nBVKicMb003815@svn.freebsd.org> <200912311547.54045.jhb@freebsd.org> <201001010635.33081.max@love2party.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <201001010635.33081.max@love2party.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Sun, 03 Jan 2010 14:30:55 -0600 (CST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, John Baldwin Subject: Re: svn commit: r201351 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 20:32:11 -0000 --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 01, 2010 at 06:35:33AM +0100, Max Laier wrote: > On Thursday 31 December 2009 21:47:54 John Baldwin wrote: > > On Thursday 31 December 2009 3:44:38 pm John Baldwin wrote: > > > Author: jhb > > > Date: Thu Dec 31 20:44:38 2009 > > > New Revision: 201351 > > > URL: http://svn.freebsd.org/changeset/base/201351 > > > > > > Log: > > > Use stricter checking to match possible vlan clones by not allowing > > > extra garbage characters around or within the tag. > >=20 > > Previously some odd clone requests such as 'em0.102a', 'em0.10a3bc', and > > 'em0.foo.104' would have succeeded creating interfaces equivalent to > > em0.102, em0.103, and em0.104. >=20 > The em0.foo.104 case seems quite useful, though. Maybe we can keep that= =20 > /feature/? You can always name any interface anything you want and the new rc.d support John added makes that easy. The origional intent of the name based vlan configuration was to support . and I view this as a bugfix. --2oS5YaxWCcQjTEyO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFLQP54XY6L6fI4GtQRAmizAKCFfyL6G8N/0l26RSM2IIhEOypSqQCbB/f+ 7xqmFgvQFWiJBIioEMZYDGg= =fnKb -----END PGP SIGNATURE----- --2oS5YaxWCcQjTEyO-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 20:40:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98F591065676; Sun, 3 Jan 2010 20:40:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86C698FC0C; Sun, 3 Jan 2010 20:40:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03KesMe045221; Sun, 3 Jan 2010 20:40:54 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03Kes6r045213; Sun, 3 Jan 2010 20:40:54 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001032040.o03Kes6r045213@svn.freebsd.org> From: Brooks Davis Date: Sun, 3 Jan 2010 20:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201443 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 20:40:54 -0000 Author: brooks Date: Sun Jan 3 20:40:54 2010 New Revision: 201443 URL: http://svn.freebsd.org/changeset/base/201443 Log: Add vlan(4) to all GENERIC kernels. MFC after: 1 week Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC head/sys/ia64/conf/GENERIC head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/amd64/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -274,6 +274,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/i386/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -287,6 +287,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/ia64/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -149,6 +149,7 @@ device sbp # SCSI over FireWire (need # Various (pseudo) devices device ether # Ethernet support +device vlan # 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop # Network loopback Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/pc98/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -241,6 +241,7 @@ device xe # Xircom pccard Ethernet device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/powerpc/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -131,6 +131,7 @@ device fxp # Intel EtherExpress PRO/10 device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/sparc64/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -216,6 +216,7 @@ device ath_rate_sample # SampleRate tx device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Sun Jan 3 20:08:10 2010 (r201442) +++ head/sys/sun4v/conf/GENERIC Sun Jan 3 20:40:54 2010 (r201443) @@ -169,6 +169,7 @@ device bge # Broadcom BCM570xx Gigabit device loop # Network loopback device random # Entropy device device ether # Ethernet support +device vlan # 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory "disks" From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 20:45:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DA610656C1; Sun, 3 Jan 2010 20:45:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 223FF8FC16; Sun, 3 Jan 2010 20:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03KjoFO046344; Sun, 3 Jan 2010 20:45:50 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03KjoUa046342; Sun, 3 Jan 2010 20:45:50 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001032045.o03KjoUa046342@svn.freebsd.org> From: Brooks Davis Date: Sun, 3 Jan 2010 20:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201444 - head/crypto/heimdal/kcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 20:45:50 -0000 Author: brooks Date: Sun Jan 3 20:45:49 2010 New Revision: 201444 URL: http://svn.freebsd.org/changeset/base/201444 Log: The size of credential messages is limited by CMGROUP_MAX rather than NGROUPS. MFC after: 1 week Modified: head/crypto/heimdal/kcm/connect.c Modified: head/crypto/heimdal/kcm/connect.c ============================================================================== --- head/crypto/heimdal/kcm/connect.c Sun Jan 3 20:40:54 2010 (r201443) +++ head/crypto/heimdal/kcm/connect.c Sun Jan 3 20:45:49 2010 (r201444) @@ -149,7 +149,7 @@ update_client_creds(int s, kcm_client *p struct sockcred *sc; memset(&msg, 0, sizeof(msg)); - crmsgsize = CMSG_SPACE(SOCKCREDSIZE(NGROUPS)); + crmsgsize = CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)); if (crmsgsize == 0) return 1 ; From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 21:27:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E072A106566C; Sun, 3 Jan 2010 21:27:10 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFDCC8FC16; Sun, 3 Jan 2010 21:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03LRAMI055476; Sun, 3 Jan 2010 21:27:10 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03LRACN055474; Sun, 3 Jan 2010 21:27:10 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001032127.o03LRACN055474@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 3 Jan 2010 21:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201445 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 21:27:11 -0000 Author: gavin Date: Sun Jan 3 21:27:10 2010 New Revision: 201445 URL: http://svn.freebsd.org/changeset/base/201445 Log: Forced commit, to provide correct commit message for r201440: Don't complain when we encounter the "cache" source, it's valid. Also fix the error message to include a line feed and not include a stray comma. PR: bin/121671 Submitted by: Artis Caune artis.caune gmail.com Approved by: ed (mentor) MFC after: 2 weeks While here, change "> /dev/stderr" for more usual ">&2" Submitted by: jilles Modified: head/etc/rc.d/nsswitch Modified: head/etc/rc.d/nsswitch ============================================================================== --- head/etc/rc.d/nsswitch Sun Jan 3 20:45:49 2010 (r201444) +++ head/etc/rc.d/nsswitch Sun Jan 3 21:27:10 2010 (r201445) @@ -80,7 +80,7 @@ generate_host_conf() cache | *=*) ;; *) - printf "Warning: unrecognized source [%s]\n" $_s > "/dev/stderr" + printf "Warning: unrecognized source [%s]\n" $_s >&2 ;; esac done From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 21:33:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261FE106566C; Sun, 3 Jan 2010 21:33:46 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 86B6E8FC19; Sun, 3 Jan 2010 21:33:45 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAOWbQEuDaFvI/2dsb2JhbADSIoQwBA X-IronPort-AV: E=Sophos;i="4.47,493,1257138000"; d="scan'208";a="61124382" Received: from darling.cs.uoguelph.ca ([131.104.91.200]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 03 Jan 2010 16:33:44 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 87A519400DA; Sun, 3 Jan 2010 16:33:44 -0500 (EST) X-Virus-Scanned: amavisd-new at darling.cs.uoguelph.ca Received: from darling.cs.uoguelph.ca ([127.0.0.1]) by localhost (darling.cs.uoguelph.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Ud2xJRIuZRo; Sun, 3 Jan 2010 16:33:44 -0500 (EST) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by darling.cs.uoguelph.ca (Postfix) with ESMTP id 2085194009E; Sun, 3 Jan 2010 16:33:44 -0500 (EST) Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id o03LhX700398; Sun, 3 Jan 2010 16:43:33 -0500 (EST) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sun, 3 Jan 2010 16:43:33 -0500 (EST) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: Rick Macklem In-Reply-To: <201001031827.o03IRBF5015818@svn.freebsd.org> Message-ID: References: <201001031827.o03IRBF5015818@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201439 - head/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 21:33:46 -0000 On Sun, 3 Jan 2010, Rick Macklem wrote: > Author: rmacklem > Date: Sun Jan 3 18:27:10 2010 > New Revision: 201439 > URL: http://svn.freebsd.org/changeset/base/201439 > > Log: > Fix three related problems in the experimental nfs client when > checking for conflicts w.r.t. byte range locks for NFSv4. > 1 - Return 0 instead of EACCES when a conflict is found, for F_GETLK. > 2 - Check for "same file" when checking for a conflict. > 3 - Don't check for a conflict for the F_UNLCK case. > > Modified: > head/sys/fs/nfsclient/nfs_clstate.c > Oops, forgot to put MFC: 2 weeks on the commit. I am planning on doing that, rick. From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 21:49:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D43B1065695; Sun, 3 Jan 2010 21:49:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CB918FC13; Sun, 3 Jan 2010 21:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03LnOPS060397; Sun, 3 Jan 2010 21:49:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03LnOAS060395; Sun, 3 Jan 2010 21:49:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001032149.o03LnOAS060395@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 3 Jan 2010 21:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201446 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 21:49:24 -0000 Author: yongari Date: Sun Jan 3 21:49:24 2010 New Revision: 201446 URL: http://svn.freebsd.org/changeset/base/201446 Log: Fix regression introduced in r198318. BCM5754/BCM5754M uses the same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special firmware to enable TSO and bge(4) does not support firmware based TSO. Reported by: ed Tested by: ed Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sun Jan 3 21:27:10 2010 (r201445) +++ head/sys/dev/bge/if_bge.c Sun Jan 3 21:49:24 2010 (r201446) @@ -2642,8 +2642,15 @@ bge_attach(device_t dev) * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ - if (BGE_IS_5755_PLUS(sc)) - sc->bge_flags |= BGE_FLAG_TSO; + if (BGE_IS_5755_PLUS(sc)) { + /* + * BCM5754 and BCM5787 shares the same ASIC id so + * explicit device id check is required. + */ + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5754 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5754M) + sc->bge_flags |= BGE_FLAG_TSO; + } /* * Check if this is a PCI-X or PCI Express device. From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 22:29:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50145106568B; Sun, 3 Jan 2010 22:29:07 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F6068FC1F; Sun, 3 Jan 2010 22:29:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03MT7CJ069082; Sun, 3 Jan 2010 22:29:07 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03MT7Ys069079; Sun, 3 Jan 2010 22:29:07 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001032229.o03MT7Ys069079@svn.freebsd.org> From: Antoine Brodin Date: Sun, 3 Jan 2010 22:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201447 - in head: . usr.sbin/ntp/doc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 22:29:07 -0000 Author: antoine Date: Sun Jan 3 22:29:06 2010 New Revision: 201447 URL: http://svn.freebsd.org/changeset/base/201447 Log: Complete ntptrace(8) removal: - do not install man page - update ObsoleteFiles.inc Approved by: roberto@ Modified: head/ObsoleteFiles.inc head/usr.sbin/ntp/doc/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Jan 3 21:49:24 2010 (r201446) +++ head/ObsoleteFiles.inc Sun Jan 3 22:29:06 2010 (r201447) @@ -14,6 +14,9 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100103: ntptrace(8) removed +OLD_FILES+=usr/sbin/ntptrace +OLD_FILES+=usr/share/man/man8/ntptrace.8.gz # 20091229: remove no longer relevant examples OLD_FILES+=usr/share/examples/pppd/auth-down.sample OLD_FILES+=usr/share/examples/pppd/auth-up.sample Modified: head/usr.sbin/ntp/doc/Makefile ============================================================================== --- head/usr.sbin/ntp/doc/Makefile Sun Jan 3 21:49:24 2010 (r201446) +++ head/usr.sbin/ntp/doc/Makefile Sun Jan 3 22:29:06 2010 (r201447) @@ -24,7 +24,7 @@ FILES= accopt.html assoc.html audio.html .endif MAN= ntp.conf.5 ntp.keys.5 -MAN+= ntp-keygen.8 ntpd.8 ntpdate.8 ntpdc.8 ntpq.8 ntptime.8 ntptrace.8 +MAN+= ntp-keygen.8 ntpd.8 ntpdate.8 ntpdc.8 ntpq.8 ntptime.8 .PATH: ${.CURDIR}/../../../contrib/ntp/html \ ${.CURDIR}/../../../contrib/ntp/html/build \ From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 23:15:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5069E1065672; Sun, 3 Jan 2010 23:15:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3FF9B8FC0A; Sun, 3 Jan 2010 23:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03NFFVX079275; Sun, 3 Jan 2010 23:15:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03NFFqQ079273; Sun, 3 Jan 2010 23:15:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001032315.o03NFFqQ079273@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jan 2010 23:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201449 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 23:15:15 -0000 Author: imp Date: Sun Jan 3 23:15:14 2010 New Revision: 201449 URL: http://svn.freebsd.org/changeset/base/201449 Log: Fix CardBus spelling. MFC after: 1 month Modified: head/sys/dev/dc/if_dc.c Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Sun Jan 3 23:13:35 2010 (r201448) +++ head/sys/dev/dc/if_dc.c Sun Jan 3 23:15:14 2010 (r201449) @@ -44,8 +44,8 @@ __FBSDID("$FreeBSD$"); * ASIX Electronics AX88141 (www.asix.com.tw) * ADMtek AL981 (www.admtek.com.tw) * ADMtek AN983 (www.admtek.com.tw) - * ADMtek cardbus AN985 (www.admtek.com.tw) - * Netgear FA511 (www.netgear.com) Appears to be rebadged ADMTek cardbus AN985 + * ADMtek CardBus AN985 (www.admtek.com.tw) + * Netgear FA511 (www.netgear.com) Appears to be rebadged ADMTek CardBus AN985 * Davicom DM9100, DM9102, DM9102A (www.davicom8.com) * Accton EN1217 (www.accton.com) * Xircom X3201 (www.xircom.com) @@ -165,7 +165,7 @@ static const struct dc_type dc_devs[] = { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN983), 0, "ADMtek AN983 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_AN985), 0, - "ADMtek AN985 cardBus 10/100BaseTX or clone" }, + "ADMtek AN985 CardBus 10/100BaseTX or clone" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9511), 0, "ADMtek ADM9511 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_ADMTEK, DC_DEVICEID_ADM9513), 0, From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 23:26:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D111A106566B; Sun, 3 Jan 2010 23:26:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0A038FC19; Sun, 3 Jan 2010 23:26:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03NQT1W081775; Sun, 3 Jan 2010 23:26:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03NQTHf081773; Sun, 3 Jan 2010 23:26:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001032326.o03NQTHf081773@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jan 2010 23:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201450 - head/sys/dev/exca X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 23:26:29 -0000 Author: imp Date: Sun Jan 3 23:26:29 2010 New Revision: 201450 URL: http://svn.freebsd.org/changeset/base/201450 Log: CardBus instead of cardbus. Modified: head/sys/dev/exca/excareg.h Modified: head/sys/dev/exca/excareg.h ============================================================================== --- head/sys/dev/exca/excareg.h Sun Jan 3 23:15:14 2010 (r201449) +++ head/sys/dev/exca/excareg.h Sun Jan 3 23:26:29 2010 (r201450) @@ -355,7 +355,7 @@ /* #define EXCA_RESERVED 0x3E */ /* #define EXCA_RESERVED 0x3F */ -/* cardbus extensions - memory window page registers */ +/* CardBus extensions - memory window page registers */ #define EXCA_MEMREG_WIN_SHIFT 24 #define EXCA_SYSMEM_ADDR0_WIN 0x40 From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 23:28:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF721065692; Sun, 3 Jan 2010 23:28:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEC1F8FC08; Sun, 3 Jan 2010 23:28:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03NSW2H082271; Sun, 3 Jan 2010 23:28:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03NSWjG082269; Sun, 3 Jan 2010 23:28:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001032328.o03NSWjG082269@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jan 2010 23:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201451 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 23:28:32 -0000 Author: imp Date: Sun Jan 3 23:28:32 2010 New Revision: 201451 URL: http://svn.freebsd.org/changeset/base/201451 Log: cardbus -> CardBus Modified: head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Sun Jan 3 23:26:29 2010 (r201450) +++ head/sys/dev/dc/if_dcreg.h Sun Jan 3 23:28:32 2010 (r201451) @@ -1002,7 +1002,7 @@ struct dc_softc { #define DC_VENDORID_MICROSOFT 0x1414 /* - * Supported Microsoft PCI and cardbus NICs. These are really + * Supported Microsoft PCI and CardBus NICs. These are really * ADMtek parts in disguise. */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 23:29:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 318301065670; Sun, 3 Jan 2010 23:29:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2188C8FC16; Sun, 3 Jan 2010 23:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03NToOm082600; Sun, 3 Jan 2010 23:29:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03NTo0G082598; Sun, 3 Jan 2010 23:29:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001032329.o03NTo0G082598@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jan 2010 23:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201452 - head/sys/dev/xl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 23:29:50 -0000 Author: imp Date: Sun Jan 3 23:29:49 2010 New Revision: 201452 URL: http://svn.freebsd.org/changeset/base/201452 Log: cardbus -> CardBus Modified: head/sys/dev/xl/if_xl.c Modified: head/sys/dev/xl/if_xl.c ============================================================================== --- head/sys/dev/xl/if_xl.c Sun Jan 3 23:28:32 2010 (r201451) +++ head/sys/dev/xl/if_xl.c Sun Jan 3 23:29:49 2010 (r201452) @@ -929,7 +929,7 @@ xl_reset(struct xl_softc *sc) /* * If we're using memory mapped register mode, pause briefly * after issuing the reset command before trying to access any - * other registers. With my 3c575C cardbus card, failing to do + * other registers. With my 3c575C CardBus card, failing to do * this results in the system locking up while trying to poll * the command busy bit in the status register. */ @@ -1392,7 +1392,7 @@ xl_attach(device_t dev) * Figure out the card type. 3c905B adapters have the * 'supportsNoTxLength' bit set in the capabilities * word in the EEPROM. - * Note: my 3c575C cardbus card lies. It returns a value + * Note: my 3c575C CardBus card lies. It returns a value * of 0x1578 for its capabilities word, which is somewhat * nonsensical. Another way to distinguish a 3c90x chip * from a 3c90xB/C chip is to check for the 'supportsLargePackets' From owner-svn-src-all@FreeBSD.ORG Sun Jan 3 23:31:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F40E0106568B; Sun, 3 Jan 2010 23:31:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAAA78FC18; Sun, 3 Jan 2010 23:31:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o03NVwmC083106; Sun, 3 Jan 2010 23:31:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o03NVw5Y083102; Sun, 3 Jan 2010 23:31:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001032331.o03NVw5Y083102@svn.freebsd.org> From: Warner Losh Date: Sun, 3 Jan 2010 23:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201453 - in head/sys/dev: ath mii pccard X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jan 2010 23:31:59 -0000 Author: imp Date: Sun Jan 3 23:31:58 2010 New Revision: 201453 URL: http://svn.freebsd.org/changeset/base/201453 Log: cardbus -> CardBus Modified: head/sys/dev/ath/if_ath.c head/sys/dev/mii/tdkphy.c head/sys/dev/pccard/card_if.m Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Jan 3 23:29:49 2010 (r201452) +++ head/sys/dev/ath/if_ath.c Sun Jan 3 23:31:58 2010 (r201453) @@ -1190,7 +1190,7 @@ ath_suspend(struct ath_softc *sc) /* * NB: don't worry about putting the chip in low power * mode; pci will power off our socket on suspend and - * cardbus detaches the device. + * CardBus detaches the device. */ } Modified: head/sys/dev/mii/tdkphy.c ============================================================================== --- head/sys/dev/mii/tdkphy.c Sun Jan 3 23:29:49 2010 (r201452) +++ head/sys/dev/mii/tdkphy.c Sun Jan 3 23:31:58 2010 (r201453) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); */ /* - * The TDK 78Q2120 is found on some Xircom X3201 based cardbus cards, + * The TDK 78Q2120 is found on some Xircom X3201 based CardBus cards, * also spotted on some 3C575 cards. It's just like any other normal * phy, except it does auto negotiation in a different way. */ Modified: head/sys/dev/pccard/card_if.m ============================================================================== --- head/sys/dev/pccard/card_if.m Sun Jan 3 23:29:49 2010 (r201452) +++ head/sys/dev/pccard/card_if.m Sun Jan 3 23:31:58 2010 (r201453) @@ -35,7 +35,7 @@ INTERFACE card; # # Companion interface for pccard. We need to set attributes for memory # and i/o port mappings (as well as other types of attributes) that have -# a well defined meaning inside the pccard/cardbus system. The bus +# a well defined meaning inside the PC Card/CardBus system. The bus # methods are inadequate for this because this must be done at the time the # resources are set for the device, which predates their activation. Also, # the driver activating the resources doesn't necessarily know or need to know From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 00:32:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DA31065679; Mon, 4 Jan 2010 00:32:22 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6F8C8FC14; Mon, 4 Jan 2010 00:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o040WM2v096364; Mon, 4 Jan 2010 00:32:22 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o040WM4j096362; Mon, 4 Jan 2010 00:32:22 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040032.o040WM4j096362@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 00:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201455 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 00:32:22 -0000 Author: obrien Date: Mon Jan 4 00:32:22 2010 New Revision: 201455 URL: http://svn.freebsd.org/changeset/base/201455 Log: Add check for subversion "original" marker. Modified: head/usr.bin/make/parse.c Modified: head/usr.bin/make/parse.c ============================================================================== --- head/usr.bin/make/parse.c Mon Jan 4 00:11:46 2010 (r201454) +++ head/usr.bin/make/parse.c Mon Jan 4 00:32:22 2010 (r201455) @@ -802,6 +802,7 @@ ParseDoDependency(char *line) * merges. */ if (strncmp(line, "<<<<<<", 6) == 0 || + strncmp(line, "||||||", 6) == 0 || strncmp(line, "======", 6) == 0 || strncmp(line, ">>>>>>", 6) == 0) { Parse_Error(PARSE_FATAL, "Makefile appears to " From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 00:49:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB99106568B; Mon, 4 Jan 2010 00:49:05 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29AFA8FC1D; Mon, 4 Jan 2010 00:49:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o040n5lN000184; Mon, 4 Jan 2010 00:49:05 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o040n5XC000182; Mon, 4 Jan 2010 00:49:05 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040049.o040n5XC000182@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 00:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201456 - head/usr.bin/make X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 00:49:05 -0000 Author: obrien Date: Mon Jan 4 00:49:04 2010 New Revision: 201456 URL: http://svn.freebsd.org/changeset/base/201456 Log: Report lines that ought to contain a ':' operator but start with a '.' as "Unknown directive" sinze they are more likely to be .elseif (etc). (NetBSD PR 37222). Obtained from: NetBSD Modified: head/usr.bin/make/parse.c Modified: head/usr.bin/make/parse.c ============================================================================== --- head/usr.bin/make/parse.c Mon Jan 4 00:32:22 2010 (r201455) +++ head/usr.bin/make/parse.c Mon Jan 4 00:49:04 2010 (r201456) @@ -699,6 +699,7 @@ static void ParseDoDependency(char *line) { char *cp; /* our current position */ + char *lstart = line; /* original input line */ GNode *gn; /* a general purpose temporary node */ int op; /* the operator on the line */ char savec; /* a place to save a character */ @@ -809,7 +810,8 @@ ParseDoDependency(char *line) "contain unresolved cvs/rcs/??? merge " "conflicts"); } else - Parse_Error(PARSE_FATAL, "Need an operator"); + Parse_Error(PARSE_FATAL, lstart[0] == '.' ? + "Unknown directive" : "Need an operator"); return; } *cp = '\0'; @@ -1029,7 +1031,8 @@ ParseDoDependency(char *line) op = OP_DEPENDS; } } else { - Parse_Error(PARSE_FATAL, "Missing dependency operator"); + Parse_Error(PARSE_FATAL, lstart[0] == '.' ? + "Unknown directive" : "Missing dependency operator"); return; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:07:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7FC106566B; Mon, 4 Jan 2010 01:07:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A2A88FC18; Mon, 4 Jan 2010 01:07:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0417XqP004367; Mon, 4 Jan 2010 01:07:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0417XMg004365; Mon, 4 Jan 2010 01:07:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040107.o0417XMg004365@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201457 - stable/8/usr.bin/finger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:07:33 -0000 Author: delphij Date: Mon Jan 4 01:07:32 2010 New Revision: 201457 URL: http://svn.freebsd.org/changeset/base/201457 Log: MFC r200793: Plug a memory leak. PR: bin/141836 Submitted by: Henning Petersen Modified: stable/8/usr.bin/finger/finger.c Directory Properties: stable/8/usr.bin/finger/ (props changed) Modified: stable/8/usr.bin/finger/finger.c ============================================================================== --- stable/8/usr.bin/finger/finger.c Mon Jan 4 00:49:04 2010 (r201456) +++ stable/8/usr.bin/finger/finger.c Mon Jan 4 01:07:32 2010 (r201457) @@ -373,6 +373,7 @@ net: for (p = nargv; *p;) { printf("\n"); } + free(used); if (entries == 0) return; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:08:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9CC71065672; Mon, 4 Jan 2010 01:08:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8B928FC0A; Mon, 4 Jan 2010 01:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0418RuF004612; Mon, 4 Jan 2010 01:08:27 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0418Rin004610; Mon, 4 Jan 2010 01:08:27 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040108.o0418Rin004610@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201458 - stable/8/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:08:28 -0000 Author: delphij Date: Mon Jan 4 01:08:27 2010 New Revision: 201458 URL: http://svn.freebsd.org/changeset/base/201458 Log: Plug a memory leak. PR: bin/141835 Submitted by: Henning Petersen Modified: stable/8/bin/pax/sel_subs.c Directory Properties: stable/8/bin/pax/ (props changed) Modified: stable/8/bin/pax/sel_subs.c ============================================================================== --- stable/8/bin/pax/sel_subs.c Mon Jan 4 01:07:32 2010 (r201457) +++ stable/8/bin/pax/sel_subs.c Mon Jan 4 01:08:27 2010 (r201458) @@ -396,6 +396,7 @@ trng_add(char *str) default: paxwarn(1, "Bad option %c with time range %s", *flgpt, str); + free(pt); goto out; } ++flgpt; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:10:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15FEE106568F; Mon, 4 Jan 2010 01:10:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04A848FC1B; Mon, 4 Jan 2010 01:10:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0419xZB004993; Mon, 4 Jan 2010 01:09:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0419xVd004991; Mon, 4 Jan 2010 01:09:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040109.o0419xVd004991@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201459 - stable/8/lib/libexpat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:10:00 -0000 Author: delphij Date: Mon Jan 4 01:09:59 2010 New Revision: 201459 URL: http://svn.freebsd.org/changeset/base/201459 Log: MFC r201137: Grammar fix. Submitted by: Kenyon Ralph Modified: stable/8/lib/libexpat/libbsdxml.3 Directory Properties: stable/8/lib/libexpat/ (props changed) Modified: stable/8/lib/libexpat/libbsdxml.3 ============================================================================== --- stable/8/lib/libexpat/libbsdxml.3 Mon Jan 4 01:08:27 2010 (r201458) +++ stable/8/lib/libexpat/libbsdxml.3 Mon Jan 4 01:09:59 2010 (r201459) @@ -40,7 +40,7 @@ library is a verbatim copy of the eXpat .Pp The .Nm -library is intended to use within the +library is intended to be used within the .Fx base system only. Use of the From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:13:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4E401065692; Mon, 4 Jan 2010 01:13:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 936E78FC18; Mon, 4 Jan 2010 01:13:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041D3jP005848; Mon, 4 Jan 2010 01:13:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041D3IL005846; Mon, 4 Jan 2010 01:13:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040113.o041D3IL005846@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201460 - stable/6/usr.bin/finger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:13:03 -0000 Author: delphij Date: Mon Jan 4 01:13:03 2010 New Revision: 201460 URL: http://svn.freebsd.org/changeset/base/201460 Log: MFC r200793: Plug a memory leak. PR: bin/141836 Submitted by: Henning Petersen MFC after: 2 weeks Modified: stable/6/usr.bin/finger/finger.c Directory Properties: stable/6/usr.bin/finger/ (props changed) Modified: stable/6/usr.bin/finger/finger.c ============================================================================== --- stable/6/usr.bin/finger/finger.c Mon Jan 4 01:09:59 2010 (r201459) +++ stable/6/usr.bin/finger/finger.c Mon Jan 4 01:13:03 2010 (r201460) @@ -373,6 +373,7 @@ net: for (p = nargv; *p;) { printf("\n"); } + free(used); if (entries == 0) return; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:13:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBBB3106568B; Mon, 4 Jan 2010 01:13:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA90A8FC19; Mon, 4 Jan 2010 01:13:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041D5vt005886; Mon, 4 Jan 2010 01:13:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041D5lW005884; Mon, 4 Jan 2010 01:13:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040113.o041D5lW005884@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201461 - stable/7/usr.bin/finger X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:13:06 -0000 Author: delphij Date: Mon Jan 4 01:13:05 2010 New Revision: 201461 URL: http://svn.freebsd.org/changeset/base/201461 Log: MFC r200793: Plug a memory leak. PR: bin/141836 Submitted by: Henning Petersen MFC after: 2 weeks Modified: stable/7/usr.bin/finger/finger.c Directory Properties: stable/7/usr.bin/finger/ (props changed) Modified: stable/7/usr.bin/finger/finger.c ============================================================================== --- stable/7/usr.bin/finger/finger.c Mon Jan 4 01:13:03 2010 (r201460) +++ stable/7/usr.bin/finger/finger.c Mon Jan 4 01:13:05 2010 (r201461) @@ -373,6 +373,7 @@ net: for (p = nargv; *p;) { printf("\n"); } + free(used); if (entries == 0) return; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:14:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B51C106566C; Mon, 4 Jan 2010 01:14:19 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A5E08FC08; Mon, 4 Jan 2010 01:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041EIwc006211; Mon, 4 Jan 2010 01:14:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041EI0E006209; Mon, 4 Jan 2010 01:14:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040114.o041EI0E006209@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201462 - stable/6/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:14:19 -0000 Author: delphij Date: Mon Jan 4 01:14:18 2010 New Revision: 201462 URL: http://svn.freebsd.org/changeset/base/201462 Log: MFC r200794: Plug a memory leak. PR: bin/141835 Submitted by: Henning Petersen MFC after: 2 weeks Modified: stable/6/bin/pax/sel_subs.c Directory Properties: stable/6/bin/pax/ (props changed) Modified: stable/6/bin/pax/sel_subs.c ============================================================================== --- stable/6/bin/pax/sel_subs.c Mon Jan 4 01:13:05 2010 (r201461) +++ stable/6/bin/pax/sel_subs.c Mon Jan 4 01:14:18 2010 (r201462) @@ -396,6 +396,7 @@ trng_add(char *str) default: paxwarn(1, "Bad option %c with time range %s", *flgpt, str); + free(pt); goto out; } ++flgpt; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:14:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309E11065672; Mon, 4 Jan 2010 01:14:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA348FC16; Mon, 4 Jan 2010 01:14:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041EMgx006249; Mon, 4 Jan 2010 01:14:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041EMTi006247; Mon, 4 Jan 2010 01:14:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040114.o041EMTi006247@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201463 - stable/7/bin/pax X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:14:22 -0000 Author: delphij Date: Mon Jan 4 01:14:21 2010 New Revision: 201463 URL: http://svn.freebsd.org/changeset/base/201463 Log: MFC r200794: Plug a memory leak. PR: bin/141835 Submitted by: Henning Petersen MFC after: 2 weeks Modified: stable/7/bin/pax/sel_subs.c Directory Properties: stable/7/bin/pax/ (props changed) Modified: stable/7/bin/pax/sel_subs.c ============================================================================== --- stable/7/bin/pax/sel_subs.c Mon Jan 4 01:14:18 2010 (r201462) +++ stable/7/bin/pax/sel_subs.c Mon Jan 4 01:14:21 2010 (r201463) @@ -396,6 +396,7 @@ trng_add(char *str) default: paxwarn(1, "Bad option %c with time range %s", *flgpt, str); + free(pt); goto out; } ++flgpt; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:15:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAB871065679; Mon, 4 Jan 2010 01:15:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B98218FC17; Mon, 4 Jan 2010 01:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041Fdam006629; Mon, 4 Jan 2010 01:15:39 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041FdJW006627; Mon, 4 Jan 2010 01:15:39 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040115.o041FdJW006627@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201464 - stable/5/lib/libexpat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:15:39 -0000 Author: delphij Date: Mon Jan 4 01:15:39 2010 New Revision: 201464 URL: http://svn.freebsd.org/changeset/base/201464 Log: MFC r201137 Grammar fix. Submitted by: Kenyon Ralph Modified: stable/5/lib/libexpat/libbsdxml.3 Directory Properties: stable/5/lib/libexpat/ (props changed) Modified: stable/5/lib/libexpat/libbsdxml.3 ============================================================================== --- stable/5/lib/libexpat/libbsdxml.3 Mon Jan 4 01:14:21 2010 (r201463) +++ stable/5/lib/libexpat/libbsdxml.3 Mon Jan 4 01:15:39 2010 (r201464) @@ -40,7 +40,7 @@ library is a verbatim copy of the eXpat .Pp The .Nm -library is intended to use within the +library is intended to be used within the .Fx base system only. Use of the From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:15:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8ABA1065693; Mon, 4 Jan 2010 01:15:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A79C68FC18; Mon, 4 Jan 2010 01:15:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041FgGJ006667; Mon, 4 Jan 2010 01:15:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041Fgxu006665; Mon, 4 Jan 2010 01:15:42 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040115.o041Fgxu006665@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:15:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201465 - stable/6/lib/libexpat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:15:42 -0000 Author: delphij Date: Mon Jan 4 01:15:42 2010 New Revision: 201465 URL: http://svn.freebsd.org/changeset/base/201465 Log: MFC r201137 Grammar fix. Submitted by: Kenyon Ralph Modified: stable/6/lib/libexpat/libbsdxml.3 Directory Properties: stable/6/lib/libexpat/ (props changed) Modified: stable/6/lib/libexpat/libbsdxml.3 ============================================================================== --- stable/6/lib/libexpat/libbsdxml.3 Mon Jan 4 01:15:39 2010 (r201464) +++ stable/6/lib/libexpat/libbsdxml.3 Mon Jan 4 01:15:42 2010 (r201465) @@ -40,7 +40,7 @@ library is a verbatim copy of the eXpat .Pp The .Nm -library is intended to use within the +library is intended to be used within the .Fx base system only. Use of the From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:15:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8ADD10657BA; Mon, 4 Jan 2010 01:15:47 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979AD8FC0C; Mon, 4 Jan 2010 01:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041FlsI006735; Mon, 4 Jan 2010 01:15:47 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041Fl52006733; Mon, 4 Jan 2010 01:15:47 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001040115.o041Fl52006733@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 01:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201466 - stable/7/lib/libexpat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:15:47 -0000 Author: delphij Date: Mon Jan 4 01:15:47 2010 New Revision: 201466 URL: http://svn.freebsd.org/changeset/base/201466 Log: MFC r201137 Grammar fix. Submitted by: Kenyon Ralph Modified: stable/7/lib/libexpat/libbsdxml.3 Directory Properties: stable/7/lib/libexpat/ (props changed) Modified: stable/7/lib/libexpat/libbsdxml.3 ============================================================================== --- stable/7/lib/libexpat/libbsdxml.3 Mon Jan 4 01:15:42 2010 (r201465) +++ stable/7/lib/libexpat/libbsdxml.3 Mon Jan 4 01:15:47 2010 (r201466) @@ -40,7 +40,7 @@ library is a verbatim copy of the eXpat .Pp The .Nm -library is intended to use within the +library is intended to be used within the .Fx base system only. Use of the From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:30:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47B77106566C; Mon, 4 Jan 2010 01:30:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id D02548FC0C; Mon, 4 Jan 2010 01:30:10 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id D5EC441C7A6; Mon, 4 Jan 2010 02:30:09 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id UvnqPOhRybrt; Mon, 4 Jan 2010 02:30:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id A6AEA41C7A5; Mon, 4 Jan 2010 02:30:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 9564A4448EC; Mon, 4 Jan 2010 01:27:55 +0000 (UTC) Date: Mon, 4 Jan 2010 01:27:55 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Warner Losh In-Reply-To: <201001022036.o02KaaGt047964@svn.freebsd.org> Message-ID: <20100104012648.I88477@maildrop.int.zabbadoz.net> References: <201001022036.o02KaaGt047964@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-6@freebsd.org Subject: Re: svn commit: r201405 - stable/6/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:30:11 -0000 On Sat, 2 Jan 2010, Warner Losh wrote: > Author: imp > Date: Sat Jan 2 20:36:36 2010 > New Revision: 201405 > URL: http://svn.freebsd.org/changeset/base/201405 > > Log: > Welcome to 2010. (Note: this was mistakenly not updated for 2009, > even though there were changes on the releng_6 branch). That said, I think /COPYRIGHT wasn't updated in stable/6 this time either (nor was it last year I assume). > Modified: > stable/6/sys/sys/copyright.h > > Modified: stable/6/sys/sys/copyright.h > ============================================================================== > --- stable/6/sys/sys/copyright.h Sat Jan 2 20:35:19 2010 (r201404) > +++ stable/6/sys/sys/copyright.h Sat Jan 2 20:36:36 2010 (r201405) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (C) 1992-2008 The FreeBSD Project. All rights reserved. > + * Copyright (C) 1992-2010 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 > @@ -30,7 +30,7 @@ > > /* FreeBSD */ > #define COPYRIGHT_FreeBSD \ > - "Copyright (c) 1992-2008 The FreeBSD Project.\n" > + "Copyright (c) 1992-2010 The FreeBSD Project.\n" > > /* Foundation */ > #define TRADEMARK_Foundation \ > -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 01:52:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F26A4106566C; Mon, 4 Jan 2010 01:52:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E16228FC0C; Mon, 4 Jan 2010 01:52:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o041qFZq014869; Mon, 4 Jan 2010 01:52:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o041qF0R014867; Mon, 4 Jan 2010 01:52:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001040152.o041qF0R014867@svn.freebsd.org> From: Warner Losh Date: Mon, 4 Jan 2010 01:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201467 - stable/6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 01:52:16 -0000 Author: imp Date: Mon Jan 4 01:52:15 2010 New Revision: 201467 URL: http://svn.freebsd.org/changeset/base/201467 Log: It is 2010 and we're still making changes to releng_6! Submitted by: bz@ Modified: stable/6/COPYRIGHT Modified: stable/6/COPYRIGHT ============================================================================== --- stable/6/COPYRIGHT Mon Jan 4 01:15:47 2010 (r201466) +++ stable/6/COPYRIGHT Mon Jan 4 01:52:15 2010 (r201467) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (C) 1992-2008 The FreeBSD Project. All rights reserved. +Copyright (C) 1992-2010 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 From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 02:03:52 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A47A7106566B; Mon, 4 Jan 2010 02:03:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC778FC0A; Mon, 4 Jan 2010 02:03:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o041r19i019219; Sun, 3 Jan 2010 18:53:01 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sun, 03 Jan 2010 18:53:41 -0700 (MST) Message-Id: <20100103.185341.1064051296187218048.imp@bsdimp.com> To: bz@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20100104012648.I88477@maildrop.int.zabbadoz.net> References: <201001022036.o02KaaGt047964@svn.freebsd.org> <20100104012648.I88477@maildrop.int.zabbadoz.net> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-6@FreeBSD.org Subject: Re: svn commit: r201405 - stable/6/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 02:03:52 -0000 In message: <20100104012648.I88477@maildrop.int.zabbadoz.net> "Bjoern A. Zeeb" writes: : On Sat, 2 Jan 2010, Warner Losh wrote: : : > Author: imp : > Date: Sat Jan 2 20:36:36 2010 : > New Revision: 201405 : > URL: http://svn.freebsd.org/changeset/base/201405 : > : > Log: : > Welcome to 2010. (Note: this was mistakenly not updated for 2009, : > even though there were changes on the releng_6 branch). : : That said, I think /COPYRIGHT wasn't updated in stable/6 this time : either (nor was it last year I assume). Done. While I don't think there's any more releases planned off this branch, people are still updating it... Warner From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 02:25:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F412A106566C; Mon, 4 Jan 2010 02:25:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id AD6C28FC13; Mon, 4 Jan 2010 02:25:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 1227541C752; Mon, 4 Jan 2010 03:25:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id qhkWewU79RBT; Mon, 4 Jan 2010 03:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 23D7841C751; Mon, 4 Jan 2010 03:25:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id A40474448EC; Mon, 4 Jan 2010 02:21:29 +0000 (UTC) Date: Mon, 4 Jan 2010 02:21:29 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: "M. Warner Losh" In-Reply-To: <20100103.185341.1064051296187218048.imp@bsdimp.com> Message-ID: <20100104021924.M88477@maildrop.int.zabbadoz.net> References: <201001022036.o02KaaGt047964@svn.freebsd.org> <20100104012648.I88477@maildrop.int.zabbadoz.net> <20100103.185341.1064051296187218048.imp@bsdimp.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-6@FreeBSD.org Subject: Re: svn commit: r201405 - stable/6/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 02:25:08 -0000 On Sun, 3 Jan 2010, M. Warner Losh wrote: > In message: <20100104012648.I88477@maildrop.int.zabbadoz.net> > "Bjoern A. Zeeb" writes: > : On Sat, 2 Jan 2010, Warner Losh wrote: > : > : > Author: imp > : > Date: Sat Jan 2 20:36:36 2010 > : > New Revision: 201405 > : > URL: http://svn.freebsd.org/changeset/base/201405 > : > > : > Log: > : > Welcome to 2010. (Note: this was mistakenly not updated for 2009, > : > even though there were changes on the releng_6 branch). > : > : That said, I think /COPYRIGHT wasn't updated in stable/6 this time > : either (nor was it last year I assume). > > Done. While I don't think there's any more releases planned off this > branch, people are still updating it... Yeah and it'a security branch till end of this year and make -j 7 universe seems to fail badly there as well and it's really strange to see alpha being built still ;-) Thanks for the update. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 03:35:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C68106568F; Mon, 4 Jan 2010 03:35:46 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2486B8FC0A; Mon, 4 Jan 2010 03:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o043Zki2037894; Mon, 4 Jan 2010 03:35:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o043Zk3N037885; Mon, 4 Jan 2010 03:35:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001040335.o043Zk3N037885@svn.freebsd.org> From: Rui Paulo Date: Mon, 4 Jan 2010 03:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201468 - in head/sys: arm/arm arm/conf arm/econa arm/include conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 03:35:46 -0000 Author: rpaulo Date: Mon Jan 4 03:35:45 2010 New Revision: 201468 URL: http://svn.freebsd.org/changeset/base/201468 Log: Add support for Cavium Econa CNS11XX ARM boards. These boards were previously know by StarSemi STR9104. Tested by the submitter on an Emprex NSD-100 board. Submitted by: Yohanes Nugroho Reviewed by: freebsd-arm, stas Obtained from: //depot/projects/str91xx/... Added: head/sys/arm/arm/cpufunc_asm_fa526.S (contents, props changed) head/sys/arm/conf/CNS11XXNAS (contents, props changed) head/sys/arm/conf/CNS11XXNAS.hints (contents, props changed) head/sys/arm/econa/ head/sys/arm/econa/cfi_bus_econa.c (contents, props changed) head/sys/arm/econa/econa.c (contents, props changed) head/sys/arm/econa/econa_machdep.c (contents, props changed) head/sys/arm/econa/econa_reg.h (contents, props changed) head/sys/arm/econa/econa_var.h (contents, props changed) head/sys/arm/econa/ehci_ebus.c (contents, props changed) head/sys/arm/econa/files.econa (contents, props changed) head/sys/arm/econa/if_ece.c (contents, props changed) head/sys/arm/econa/if_ecereg.h (contents, props changed) head/sys/arm/econa/if_ecevar.h (contents, props changed) head/sys/arm/econa/ohci_ec.c (contents, props changed) head/sys/arm/econa/std.econa (contents, props changed) head/sys/arm/econa/timer.c (contents, props changed) head/sys/arm/econa/uart_bus_ec.c (contents, props changed) head/sys/arm/econa/uart_cpu_ec.c (contents, props changed) Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/elf_trampoline.c head/sys/arm/include/cpuconf.h head/sys/arm/include/cpufunc.h head/sys/conf/Makefile.arm head/sys/conf/options.arm Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Mon Jan 4 01:52:15 2010 (r201467) +++ head/sys/arm/arm/cpufunc.c Mon Jan 4 03:35:45 2010 (r201468) @@ -781,6 +781,73 @@ struct cpu_functions xscalec3_cpufuncs = xscale_setup /* cpu setup */ }; #endif /* CPU_XSCALE_81342 */ + + +#if defined(CPU_FA526) +struct cpu_functions fa526_cpufuncs = { + /* CPU functions */ + + .cf_id = cpufunc_id, + .cf_cpwait = cpufunc_nullop, + + /* MMU functions */ + + .cf_control = cpufunc_control, + .cf_domains = cpufunc_domains, + .cf_setttb = fa526_setttb, + .cf_faultstatus = cpufunc_faultstatus, + .cf_faultaddress = cpufunc_faultaddress, + + /* TLB functions */ + + .cf_tlb_flushID = armv4_tlb_flushID, + .cf_tlb_flushID_SE = fa526_tlb_flushID_SE, + .cf_tlb_flushI = armv4_tlb_flushI, + .cf_tlb_flushI_SE = fa526_tlb_flushI_SE, + .cf_tlb_flushD = armv4_tlb_flushD, + .cf_tlb_flushD_SE = armv4_tlb_flushD_SE, + + /* Cache operations */ + + .cf_icache_sync_all = fa526_icache_sync_all, + .cf_icache_sync_range = fa526_icache_sync_range, + + .cf_dcache_wbinv_all = fa526_dcache_wbinv_all, + .cf_dcache_wbinv_range = fa526_dcache_wbinv_range, + .cf_dcache_inv_range = fa526_dcache_inv_range, + .cf_dcache_wb_range = fa526_dcache_wb_range, + + .cf_idcache_wbinv_all = fa526_idcache_wbinv_all, + .cf_idcache_wbinv_range = fa526_idcache_wbinv_range, + + + .cf_l2cache_wbinv_all = cpufunc_nullop, + .cf_l2cache_wbinv_range = (void *)cpufunc_nullop, + .cf_l2cache_inv_range = (void *)cpufunc_nullop, + .cf_l2cache_wb_range = (void *)cpufunc_nullop, + + + /* Other functions */ + + .cf_flush_prefetchbuf = fa526_flush_prefetchbuf, + .cf_drain_writebuf = armv4_drain_writebuf, + .cf_flush_brnchtgt_C = cpufunc_nullop, + .cf_flush_brnchtgt_E = fa526_flush_brnchtgt_E, + + .cf_sleep = fa526_cpu_sleep, + + /* Soft functions */ + + .cf_dataabt_fixup = cpufunc_null_fixup, + .cf_prefetchabt_fixup = cpufunc_null_fixup, + + .cf_context_switch = fa526_context_switch, + + .cf_setup = fa526_setup +}; +#endif /* CPU_FA526 */ + + /* * Global constants also used by locore.s */ @@ -793,6 +860,7 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined (CPU_ARM9E) || defined (CPU_ARM10) || \ defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ + defined(CPU_FA526) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) static void get_cachetype_cp15(void); @@ -1073,6 +1141,19 @@ set_cpufuncs() goto out; } #endif /* CPU_SA1110 */ +#ifdef CPU_FA526 + if (cputype == CPU_ID_FA526) { + cpufuncs = fa526_cpufuncs; + cpu_reset_needs_v4_MMU_disable = 1; /* SA needs it */ + get_cachetype_cp15(); + pmap_pte_init_generic(); + + /* Use powersave on this CPU. */ + cpu_do_powersave = 1; + + goto out; + } +#endif /* CPU_FA526 */ #ifdef CPU_IXP12X0 if (cputype == CPU_ID_IXP1200) { cpufuncs = ixp12x0_cpufuncs; @@ -1547,7 +1628,8 @@ late_abort_fixup(arg) defined(CPU_XSCALE_80200) || defined(CPU_XSCALE_80321) || \ defined(CPU_XSCALE_PXA2X0) || defined(CPU_XSCALE_IXP425) || \ defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ - defined(CPU_ARM10) || defined(CPU_ARM11) + defined(CPU_ARM10) || defined(CPU_ARM11) || \ + defined(CPU_FA526) #define IGN 0 #define OR 1 @@ -2013,6 +2095,62 @@ sa11x0_setup(args) } #endif /* CPU_SA1100 || CPU_SA1110 */ +#if defined(CPU_FA526) +struct cpu_option fa526_options[] = { +#ifdef COMPAT_12 + { "nocache", IGN, BIC, (CPU_CONTROL_IC_ENABLE | + CPU_CONTROL_DC_ENABLE) }, + { "nowritebuf", IGN, BIC, CPU_CONTROL_WBUF_ENABLE }, +#endif /* COMPAT_12 */ + { "cpu.cache", BIC, OR, (CPU_CONTROL_IC_ENABLE | + CPU_CONTROL_DC_ENABLE) }, + { "cpu.nocache", OR, BIC, (CPU_CONTROL_IC_ENABLE | + CPU_CONTROL_DC_ENABLE) }, + { "cpu.writebuf", BIC, OR, CPU_CONTROL_WBUF_ENABLE }, + { "cpu.nowritebuf", OR, BIC, CPU_CONTROL_WBUF_ENABLE }, + { NULL, IGN, IGN, 0 } +}; + +void +fa526_setup(char *args) +{ + int cpuctrl, cpuctrlmask; + + cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE + | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE + | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE + | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_LABT_ENABLE; + cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE + | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE + | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE + | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_ROM_ENABLE + | CPU_CONTROL_BEND_ENABLE | CPU_CONTROL_AFLT_ENABLE + | CPU_CONTROL_LABT_ENABLE | CPU_CONTROL_BPRD_ENABLE + | CPU_CONTROL_CPCLK | CPU_CONTROL_VECRELOC; + +#ifndef ARM32_DISABLE_ALIGNMENT_FAULTS + cpuctrl |= CPU_CONTROL_AFLT_ENABLE; +#endif + + cpuctrl = parse_cpu_options(args, fa526_options, cpuctrl); + +#ifdef __ARMEB__ + cpuctrl |= CPU_CONTROL_BEND_ENABLE; +#endif + + if (vector_page == ARM_VECTORS_HIGH) + cpuctrl |= CPU_CONTROL_VECRELOC; + + /* Clear out the cache */ + cpu_idcache_wbinv_all(); + + /* Set the control register */ + ctrl = cpuctrl; + cpu_control(0xffffffff, cpuctrl); +} +#endif /* CPU_FA526 */ + + #if defined(CPU_IXP12X0) struct cpu_option ixp12x0_options[] = { { "cpu.cache", BIC, OR, (CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE) }, Added: head/sys/arm/arm/cpufunc_asm_fa526.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/arm/cpufunc_asm_fa526.S Mon Jan 4 03:35:45 2010 (r201468) @@ -0,0 +1,209 @@ +/* $NetBSD: cpufunc_asm_fa526.S,v 1.3 2008/10/15 16:56:49 matt Exp $*/ +/*- + * Copyright (c) 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas + * + * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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$"); + +#define CACHELINE_SIZE 16 + +ENTRY(fa526_setttb) + mov r1, #0 + mcr p15, 0, r1, c7, c14, 0 /* clean and invalidate D$ */ + mcr p15, 0, r1, c7, c5, 0 /* invalidate I$ */ + mcr p15, 0, r1, c7, c5, 6 /* invalidate BTB */ + mcr p15, 0, r1, c7, c10, 4 /* drain write and fill buffer */ + + mcr p15, 0, r0, c2, c0, 0 /* Write the TTB */ + + /* If we have updated the TTB we must flush the TLB */ + mcr p15, 0, r1, c8, c7, 0 /* invalidate I+D TLB */ + + /* Make sure that pipeline is emptied */ + mov r0, r0 + mov r0, r0 + mov pc, lr + +/* + * TLB functions + */ +ENTRY(fa526_tlb_flushID_SE) + mcr p15, 0, r0, c8, c7, 1 /* flush Utlb single entry */ + mov pc, lr + +/* + * TLB functions + */ +ENTRY(fa526_tlb_flushI_SE) + mcr p15, 0, r0, c8, c5, 1 /* flush Itlb single entry */ + mov pc, lr + +ENTRY(fa526_cpu_sleep) + mov r0, #0 +/* nop + nop*/ + mcr p15, 0, r0, c7, c0, 4 /* Wait for interrupt*/ + mov pc, lr + +ENTRY(fa526_flush_prefetchbuf) + mov r0, #0 + mcr p15, 0, r0, c7, c5, 4 /* Pre-fetch flush */ + mov pc, lr + +/* + * Cache functions + */ +ENTRY(fa526_idcache_wbinv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D$ */ + mcr p15, 0, r0, c7, c5, 0 /* invalidate I$ */ + mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +ENTRY(fa526_icache_sync_all) + mov r0, #0 + mcr p15, 0, r0, c7, c5, 0 /* invalidate I$ */ + mov pc, lr + +ENTRY(fa526_dcache_wbinv_all) + mov r0, #0 + mcr p15, 0, r0, c7, c14, 0 /* clean and invalidate D$ */ + mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +/* + * Soft functions + */ +ENTRY(fa526_dcache_wbinv_range) + cmp r1, #0x4000 + bhs _C_LABEL(fa526_dcache_wbinv_all) + + and r2, r0, #(CACHELINE_SIZE - 1) + add r1, r1, r2 + bic r0, r0, #(CACHELINE_SIZE - 1) + +1: mcr p15, 0, r0, c7, c14, 1 /* clean and invalidate D$ entry */ + add r0, r0, #CACHELINE_SIZE + subs r1, r1, #CACHELINE_SIZE + bhi 1b + + mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +ENTRY(fa526_dcache_wb_range) + cmp r1, #0x4000 + bls 1f + + mov r0, #0 + mcr p15, 0, r0, c7, c10, 0 /* clean entire D$ */ + b 3f + +1: and r2, r0, #(CACHELINE_SIZE - 1) + add r1, r1, r2 + bic r0, r0, #(CACHELINE_SIZE - 1) + +2: mcr p15, 0, r0, c7, c10, 1 /* clean D$ entry */ + add r0, r0, #CACHELINE_SIZE + subs r1, r1, #CACHELINE_SIZE + bhi 2b + +3: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +ENTRY(fa526_dcache_inv_range) + and r2, r0, #(CACHELINE_SIZE - 1) + add r1, r1, r2 + bic r0, r0, #(CACHELINE_SIZE - 1) + +1: mcr p15, 0, r0, c7, c6, 1 /* invalidate D$ single entry */ + add r0, r0, #CACHELINE_SIZE + subs r1, r1, #CACHELINE_SIZE + bhi 1b + + mov pc, lr + +ENTRY(fa526_idcache_wbinv_range) + cmp r1, #0x4000 + bhs _C_LABEL(fa526_idcache_wbinv_all) + + and r2, r0, #(CACHELINE_SIZE - 1) + add r1, r1, r2 + bic r0, r0, #(CACHELINE_SIZE - 1) + +1: mcr p15, 0, r0, c7, c14, 1 /* clean and invalidate D$ entry */ + mcr p15, 0, r0, c7, c5, 1 /* invalidate I$ entry */ + add r0, r0, #CACHELINE_SIZE + subs r1, r1, #CACHELINE_SIZE + bhi 1b + +2: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +ENTRY(fa526_icache_sync_range) + cmp r1, #0x4000 + bhs _C_LABEL(fa526_icache_sync_all) + + and r2, r0, #(CACHELINE_SIZE - 1) + add r1, r1, r2 + bic r0, r0, #(CACHELINE_SIZE - 1) + +1: mcr p15, 0, r0, c7, c10, 1 /* clean D$ entry */ + mcr p15, 0, r0, c7, c5, 1 /* invalidate I$ entry */ + add r0, r0, #CACHELINE_SIZE + subs r1, r1, #CACHELINE_SIZE + bhi 1b + +2: mcr p15, 0, r0, c7, c10, 4 /* drain write buffer */ + mov pc, lr + +ENTRY(fa526_flush_brnchtgt_E) + mov r0, #0 + mcr p15, 0, r0, c7, c5, 6 /* invalidate BTB cache */ + mov pc, lr + +ENTRY(fa526_context_switch) + /* + * CF_CACHE_PURGE_ID will *ALWAYS* be called prior to this. + * Thus the data cache will contain only kernel data and the + * instruction cache will contain only kernel code, and all + * kernel mappings are shared by all processes. + */ + + mcr p15, 0, r0, c2, c0, 0 /* Write the TTB */ + + /* If we have updated the TTB we must flush the TLB */ + mov r0, #0 + mcr p15, 0, r0, c8, c7, 0 /* flush the I+D tlb */ + + /* Make sure that pipeline is emptied */ + mov r0, r0 + mov r0, r0 + mov pc, lr + Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Mon Jan 4 01:52:15 2010 (r201467) +++ head/sys/arm/arm/elf_trampoline.c Mon Jan 4 03:35:45 2010 (r201468) @@ -57,6 +57,8 @@ void __startC(void); #define cpu_idcache_wbinv_all arm8_cache_purgeID #elif defined(CPU_ARM9) #define cpu_idcache_wbinv_all arm9_idcache_wbinv_all +#elif defined(CPU_FA526) +#define cpu_idcache_wbinv_all fa526_idcache_wbinv_all #elif defined(CPU_ARM9E) #define cpu_idcache_wbinv_all armv5_ec_idcache_wbinv_all #elif defined(CPU_ARM10) Added: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CNS11XXNAS Mon Jan 4 03:35:45 2010 (r201468) @@ -0,0 +1,126 @@ +# CNS11XXNAS - StarSemi STR9104/Cavium CNS1102 NAS +# kernel configuration file for FreeBSD/arm +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +ident CNS11XXNAS + +#options PHYSADDR=0x10000000 +#options KERNPHYSADDR=0x10200000 +#options KERNVIRTADDR=0xc0200000 # Used in ldscript.arm +#options FLASHADDR=0x50000000 +#options LOADERRAMADDR=0x00000000 +#options STARTUP_PAGETABLE_ADDR=0x10000000 + +include "../econa/std.econa" + +#To statically compile in device wiring instead of /boot/device.hints +hints "CNS11XXNAS.hints" +makeoptions MODULES_OVERRIDE="" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +options HZ=100 +options DEVICE_POLLING + +# Debugging for use in -current +options KDB +#options GDB +options DDB #Enable the kernel debugger +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +##options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options DIAGNOSTIC + + +#options COMPAT_FREEBSD5 +#options COMPAT_FREEBSD6 +#options COMPAT_FREEBSD7 + + +options SCHED_ULE #ULE scheduler +#options SCHED_4BSD #4BSD scheduler +options GEOM_PART_GPT # GUID Partition Tables. +#options GEOM_PART_EBR +#options GEOM_PART_EBR_COMPAT +options GEOM_LABEL # Provides labelization + + +options INET #InterNETworking +options INET6 #IPv6 communications protocols +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options NFSCLIENT #Network Filesystem Client +#options NFSSERVER #Network Filesystem Server +#options NFSLOCKD #Network Lock Manager +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options MSDOSFS #MSDOS Filesystem +#options CD9660 #ISO 9660 Filesystem +#options PROCFS #Process filesystem (requires PSEUDOFS) +options PSEUDOFS #Pseudo-filesystem framework +options SCSI_DELAY=5000 #Delay (in ms) before probing SCSI +options KTRACE #ktrace(1) support +options SYSVSHM #SYSV-style shared memory +options SYSVMSG #SYSV-style message queues +options SYSVSEM #SYSV-style semaphores +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +options MUTEX_NOINLINE #Mutex inlines are space hogs +options RWLOCK_NOINLINE #rwlock inlines are space hogs +options SX_NOINLINE #sx inliens are space hogs +#options BOOTP +#options BOOTP_NFSROOT +#options BOOTP_NFSV3 +#options BOOTP_WIRED_TO=npe0 +#options BOOTP_COMPAT + +#device pci +device uart + + +device firmware +device mii # Minimal mii routines +device ether +device bpf + +device pty +device loop + +device md +device random # Entropy device + +#options ARM_USE_SMALL_ALLOC + +device usb +#options USB_DEBUG +device ohci +device ehci +device umass +device scbus # SCSI bus (required for SCSI) +device da # Direct Access (disks) +device pass +device cfi + +#device udav # Davicom DM9601E USB + +device geom_label +device geom_journal +device geom_part_bsd + +options ROOTDEVNAME=\"ufs:da0s1a\" Added: head/sys/arm/conf/CNS11XXNAS.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/CNS11XXNAS.hints Mon Jan 4 03:35:45 2010 (r201468) @@ -0,0 +1 @@ +# $FreeBSD$ Added: head/sys/arm/econa/cfi_bus_econa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/econa/cfi_bus_econa.c Mon Jan 4 03:35:45 2010 (r201468) @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 2009 Yohanes Nugroho + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + +static int +cfi_econa_probe(device_t dev) +{ + + return cfi_probe(dev); +} + +static device_method_t cfi_econa_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, cfi_econa_probe), + DEVMETHOD(device_attach, cfi_attach), + DEVMETHOD(device_detach, cfi_detach), + + {0, 0} +}; + +static driver_t cfi_econa_driver = { + cfi_driver_name, + cfi_econa_methods, + sizeof(struct cfi_softc), +}; +DRIVER_MODULE(cfi, econaarm, cfi_econa_driver, cfi_devclass, 0, 0); Added: head/sys/arm/econa/econa.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/econa/econa.c Mon Jan 4 03:35:45 2010 (r201468) @@ -0,0 +1,758 @@ +/*- + * Copyright (c) 2009 Yohanes Nugroho + * 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 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 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 + +#define _ARM32_BUS_DMA_PRIVATE +#include +#include +#include + +#include "econa_reg.h" +#include "econa_var.h" + +static struct econa_softc *econa_softc; + +unsigned int CPU_clock = 200000000; +unsigned int AHB_clock; +unsigned int APB_clock; + +bs_protos(generic); +bs_protos(generic_armv4); + +struct bus_space econa_bs_tag = { + /* cookie */ + (void *) 0, + + /* mapping/unmapping */ + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, + + /* allocation/deallocation */ + generic_bs_alloc, + generic_bs_free, + + /* barrier */ + generic_bs_barrier, + + /* read (single) */ + generic_bs_r_1, + generic_armv4_bs_r_2, + generic_bs_r_4, + NULL, + + /* read multiple */ + generic_bs_rm_1, + generic_armv4_bs_rm_2, + generic_bs_rm_4, + NULL, + + /* read region */ + generic_bs_rr_1, + generic_armv4_bs_rr_2, + generic_bs_rr_4, + NULL, + + /* write (single) */ + generic_bs_w_1, + generic_armv4_bs_w_2, + generic_bs_w_4, + NULL, + + /* write multiple */ + generic_bs_wm_1, + generic_armv4_bs_wm_2, + generic_bs_wm_4, + NULL, + + /* write region */ + NULL, + NULL, + NULL, + NULL, + + /* set multiple */ + NULL, + NULL, + NULL, + NULL, + + /* set region */ + NULL, + NULL, + NULL, + NULL, + + /* copy */ + NULL, + NULL, + NULL, + NULL, + + /* read (single) stream */ + NULL, + NULL, + NULL, + NULL, + + /* read multiple stream */ + NULL, + generic_armv4_bs_rm_2, + NULL, + NULL, + + /* read region stream */ + NULL, + NULL, + NULL, + NULL, + + /* write (single) stream */ + NULL, + NULL, + NULL, + NULL, + + /* write multiple stream */ + NULL, + generic_armv4_bs_wm_2, + NULL, + NULL, + + /* write region stream */ + NULL, + NULL, + NULL, + NULL +}; + +bus_space_tag_t obio_tag = &econa_bs_tag; + +static int +econa_probe(device_t dev) +{ + + device_set_desc(dev, "ECONA device bus"); + return (0); +} + +static void +econa_identify(driver_t *drv, device_t parent) +{ + + BUS_ADD_CHILD(parent, 0, "econaarm", 0); +} + +struct arm32_dma_range * +bus_dma_get_range(void) +{ + + return (NULL); +} + +int +bus_dma_get_range_nb(void) +{ + + return (0); +} + +extern void irq_entry(void); + +static void +econa_add_child(device_t dev, int prio, const char *name, int unit, + bus_addr_t addr, bus_size_t size, + int irq0, int irq1, + int irq2, int irq3, int irq4) +{ + device_t kid; + struct econa_ivar *ivar; + + kid = device_add_child_ordered(dev, prio, name, unit); + if (kid == NULL) { + printf("Can't add child %s%d ordered\n", name, unit); + return; + } + ivar = malloc(sizeof(*ivar), M_DEVBUF, M_NOWAIT | M_ZERO); + if (ivar == NULL) { + device_delete_child(dev, kid); + return; + } + device_set_ivars(kid, ivar); + resource_list_init(&ivar->resources); + if (irq0 != -1) + bus_set_resource(kid, SYS_RES_IRQ, 0, irq0, 1); + if (irq1 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 1, irq1, 1); + if (irq2 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 2, irq2, 1); + if (irq3 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 3, irq3, 1); + if (irq4 != 0) + bus_set_resource(kid, SYS_RES_IRQ, 4, irq4, 1); + + if (addr != 0) + bus_set_resource(kid, SYS_RES_MEMORY, 0, addr, size); + +} + +struct cpu_devs +{ + const char *name; + int unit; + bus_addr_t mem_base; + bus_size_t mem_len; + int irq0; + int irq1; + int irq2; + int irq3; + int irq4; +}; + +struct cpu_devs econarm_devs[] = +{ + { + "econa_ic", 0, + ECONA_IO_BASE + ECONA_PIC_BASE, ECONA_PIC_SIZE, + 0 + }, + { + "system", 0, + ECONA_IO_BASE + ECONA_SYSTEM_BASE, ECONA_SYSTEM_SIZE, + 0 + }, + { + "uart", 0, + ECONA_IO_BASE + ECONA_UART_BASE, ECONA_UART_SIZE, + ECONA_IRQ_UART + }, + { + "timer", 0, + ECONA_IO_BASE + ECONA_TIMER_BASE, ECONA_TIMER_SIZE, + ECONA_IRQ_TIMER_1, ECONA_IRQ_TIMER_2 + }, + { + "ohci", 0, + ECONA_OHCI_VBASE, ECONA_OHCI_SIZE, + ECONA_IRQ_OHCI + }, + { + "ehci", 0, + ECONA_EHCI_VBASE, ECONA_EHCI_SIZE, + ECONA_IRQ_EHCI + }, + { + "cfi", 0, + ECONA_CFI_VBASE, ECONA_CFI_SIZE, + 0 + }, + { + "ece", 0, + ECONA_IO_BASE + ECONA_NET_BASE, ECONA_NET_SIZE, + ECONA_IRQ_STATUS, + ECONA_IRQ_TSTC, ECONA_IRQ_FSRC, + ECONA_IRQ_TSQE, ECONA_IRQ_FSQF, + }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static void +econa_cpu_add_builtin_children(device_t dev, struct econa_softc *sc) +{ + int i; + struct cpu_devs *walker; + + for (i = 0, walker = econarm_devs; walker->name; i++, walker++) { + econa_add_child(dev, i, walker->name, walker->unit, + walker->mem_base, walker->mem_len, + walker->irq0,walker->irq1, walker->irq2, + walker->irq3, walker->irq4); + } + +} + +struct intc_trigger_t { + int mode; + int level; +}; + +static struct intc_trigger_t intc_trigger_table[] = { + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_FALLING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_TRIGGER_UNKNOWN, INTC_TRIGGER_UNKNOWN}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_LOW}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_LOW}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_TRIGGER_UNKNOWN, INTC_TRIGGER_UNKNOWN}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_TRIGGER_UNKNOWN, INTC_TRIGGER_UNKNOWN}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_EDGE_TRIGGER, INTC_FALLING_EDGE}, + {INTC_TRIGGER_UNKNOWN, INTC_TRIGGER_UNKNOWN}, + {INTC_TRIGGER_UNKNOWN, INTC_TRIGGER_UNKNOWN}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_HIGH}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_EDGE_TRIGGER, INTC_RISING_EDGE}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_LOW}, + {INTC_LEVEL_TRIGGER, INTC_ACTIVE_LOW}, +}; + +static inline uint32_t +read_4(struct econa_softc *sc, bus_size_t off) +{ + + return bus_space_read_4(sc->ec_st, sc->ec_sys_sh, off); +} + +static inline void +write_4(struct econa_softc *sc, bus_size_t off, uint32_t val) +{ + + return bus_space_write_4(sc->ec_st, sc->ec_sys_sh, off, val); +} + +static inline uint32_t +system_read_4(struct econa_softc *sc, bus_size_t off) +{ + + return bus_space_read_4(sc->ec_st, sc->ec_system_sh, off); +} + +static inline void +system_write_4(struct econa_softc *sc, bus_size_t off, uint32_t val) +{ + + return bus_space_write_4(sc->ec_st, sc->ec_system_sh, off, val); +} + + + +static inline void +econa_set_irq_mode(struct econa_softc * sc, unsigned int irq, + unsigned int mode) +{ + unsigned int val; + + if ((mode != INTC_LEVEL_TRIGGER) && (mode != INTC_EDGE_TRIGGER)) + return; + + val = read_4(sc, INTC_INTERRUPT_TRIGGER_MODE_REG_OFFSET); + + if (mode == INTC_LEVEL_TRIGGER) { + if (val & (1UL << irq)) { + val &= ~(1UL << irq); + write_4(sc, INTC_INTERRUPT_TRIGGER_MODE_REG_OFFSET, + val); + } + } else { + if (!(val & (1UL << irq))) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 03:40:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06DAC1065696; Mon, 4 Jan 2010 03:40:47 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA38C8FC12; Mon, 4 Jan 2010 03:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o043ekLU039001; Mon, 4 Jan 2010 03:40:46 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o043ekEK038999; Mon, 4 Jan 2010 03:40:46 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001040340.o043ekEK038999@svn.freebsd.org> From: Rui Paulo Date: Mon, 4 Jan 2010 03:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201469 - head/sys/arm/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 03:40:47 -0000 Author: rpaulo Date: Mon Jan 4 03:40:46 2010 New Revision: 201469 URL: http://svn.freebsd.org/changeset/base/201469 Log: Remove CNS11XXNAS.hints. Deleted: head/sys/arm/conf/CNS11XXNAS.hints Modified: head/sys/arm/conf/CNS11XXNAS Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Mon Jan 4 03:35:45 2010 (r201468) +++ head/sys/arm/conf/CNS11XXNAS Mon Jan 4 03:40:46 2010 (r201469) @@ -29,8 +29,6 @@ ident CNS11XXNAS include "../econa/std.econa" -#To statically compile in device wiring instead of /boot/device.hints -hints "CNS11XXNAS.hints" makeoptions MODULES_OVERRIDE="" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 04:10:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEBE01065670; Mon, 4 Jan 2010 04:10:50 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id BDDFC8FC08; Mon, 4 Jan 2010 04:10:49 +0000 (UTC) Received: by fxm27 with SMTP id 27so430491fxm.3 for ; Sun, 03 Jan 2010 20:10:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=ipGa4QdRJMw1aGRtaTwRAc0SwnZkEbdLlyfcUYHUk4Q=; b=VJ+XlwE9E9MwuQeppQr9SRXVYbexTB4I9I1xUknZEUmADkZPhh8zQCLb/R2T+ygJf9 FL+34H0Rs1/ulAA8GfWrj3lu8CgsMMXeiGU2ROFcrHOegTcsXKlRnMcB/OjoLjzjOR7j 9j8FDpHrvdNNH6sVbKOkU8Q8oGIQmv8KARVpE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=V2WDVLwUPuKwWkeC2YEftUMkbO4t/TCfhZ59gRsEQvEFYtv2Q3yzg+pAvU7lhMmL6L Q5oYt4MtCPkKFTSjLMrk5oLD6Xuf+t9HmQwK/qpDqxDolnXBJ/VFN85YEXp3moryo3na pNHrgOIeszL5ZrTlbI0M0o7TFaMDR4ryMcp28= Received: by 10.223.4.150 with SMTP id 22mr24195092far.5.1262578245367; Sun, 03 Jan 2010 20:10:45 -0800 (PST) Received: from ?10.0.10.2? (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id d13sm25768097fka.17.2010.01.03.20.10.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 03 Jan 2010 20:10:44 -0800 (PST) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <201001020102.o0212xa5080515@svn.freebsd.org> Date: Mon, 4 Jan 2010 04:10:43 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <1AD7A3E3-0259-4D4E-A48F-48E216B56E4D@freebsd.org> References: <201001020102.o0212xa5080515@svn.freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201374 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 04:10:50 -0000 On 2 Jan 2010, at 01:02, Marcel Moolenaar wrote: > Author: marcel > Date: Sat Jan 2 01:02:59 2010 > New Revision: 201374 > URL: http://svn.freebsd.org/changeset/base/201374 >=20 > Log: > Properly return the UUID represented by the alias. >=20 > PR: 142174 > Submitted by: Przemyslaw Laczynski > Pointy hat to: rpaulo Thanks! >=20 > Modified: > head/sys/geom/part/g_part_gpt.c >=20 > Modified: head/sys/geom/part/g_part_gpt.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/geom/part/g_part_gpt.c Sat Jan 2 00:37:00 2010 = (r201373) > +++ head/sys/geom/part/g_part_gpt.c Sat Jan 2 01:02:59 2010 = (r201374) > @@ -375,7 +375,7 @@ gpt_parse_type(const char *type, struct=20 > for (uap =3D &gpt_uuid_alias_match[0]; uap->uuid; uap++) { > alias =3D g_part_alias_name(uap->alias); > if (!strcasecmp(type, alias)) { > - uuid =3D uap->uuid; > + *uuid =3D *uap->uuid; > return (0); > } > } -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 05:27:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64C1A1065694; Mon, 4 Jan 2010 05:27:50 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5280E8FC25; Mon, 4 Jan 2010 05:27:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o045RoU2062668; Mon, 4 Jan 2010 05:27:50 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o045RoNN062634; Mon, 4 Jan 2010 05:27:50 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001040527.o045RoNN062634@svn.freebsd.org> From: David Xu Date: Mon, 4 Jan 2010 05:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201472 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 05:27:50 -0000 Author: davidxu Date: Mon Jan 4 05:27:49 2010 New Revision: 201472 URL: http://svn.freebsd.org/changeset/base/201472 Log: Add user-level semaphore synchronous type, this change allows multiple processes to share semaphore by using shared memory area, in simplest case, only one atomic operation is needed in userland, waiter flag is maintained by kernel and userland only checks the flag, if the flag is set, user code enters kernel and does a wakeup() call. Move type definitions into file _umtx.h to minimize compiling time. Also type names need to be prefixed with underline character, this would reduce name conflict (still in progress). Added: head/sys/sys/_umtx.h (contents, props changed) Modified: head/sys/kern/kern_umtx.c head/sys/sys/umtx.h Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Jan 4 04:29:01 2010 (r201471) +++ head/sys/kern/kern_umtx.c Mon Jan 4 05:27:49 2010 (r201472) @@ -2759,6 +2759,110 @@ out: return (error); } +static int +do_sem_wait(struct thread *td, struct _usem *sem, struct timespec *timeout) +{ + struct umtx_q *uq; + struct timeval tv; + struct timespec cts, ets, tts; + uint32_t flags, count; + int error; + + uq = td->td_umtxq; + flags = fuword32(&sem->_flags); + error = umtx_key_get(sem, TYPE_CV, GET_SHARE(flags), &uq->uq_key); + if (error != 0) + return (error); + umtxq_lock(&uq->uq_key); + umtxq_busy(&uq->uq_key); + umtxq_insert(uq); + umtxq_unlock(&uq->uq_key); + + count = fuword32(__DEVOLATILE(uint32_t *, &sem->_count)); + if (count != 0) { + umtxq_lock(&uq->uq_key); + umtxq_unbusy(&uq->uq_key); + umtxq_remove(uq); + umtxq_unlock(&uq->uq_key); + umtx_key_release(&uq->uq_key); + return (0); + } + + /* + * The magic thing is we should set c_has_waiters to 1 before + * releasing user mutex. + */ + suword32(__DEVOLATILE(uint32_t *, &sem->_has_waiters), 1); + + umtxq_lock(&uq->uq_key); + umtxq_unbusy(&uq->uq_key); + umtxq_unlock(&uq->uq_key); + + umtxq_lock(&uq->uq_key); + if (timeout == NULL) { + error = umtxq_sleep(uq, "usem", 0); + } else { + getnanouptime(&ets); + timespecadd(&ets, timeout); + TIMESPEC_TO_TIMEVAL(&tv, timeout); + for (;;) { + error = umtxq_sleep(uq, "usem", tvtohz(&tv)); + if (error != ETIMEDOUT) + break; + getnanouptime(&cts); + if (timespeccmp(&cts, &ets, >=)) { + error = ETIMEDOUT; + break; + } + tts = ets; + timespecsub(&tts, &cts); + TIMESPEC_TO_TIMEVAL(&tv, &tts); + } + } + + if (error != 0) { + if ((uq->uq_flags & UQF_UMTXQ) == 0) { + if (!umtxq_signal(&uq->uq_key, 1)) + error = 0; + } + if (error == ERESTART) + error = EINTR; + } + umtxq_remove(uq); + umtxq_unlock(&uq->uq_key); + umtx_key_release(&uq->uq_key); + return (error); +} + +/* + * Signal a userland condition variable. + */ +static int +do_sem_wake(struct thread *td, struct _usem *sem) +{ + struct umtx_key key; + int error, cnt, nwake; + uint32_t flags; + + flags = fuword32(&sem->_flags); + if ((error = umtx_key_get(sem, TYPE_CV, GET_SHARE(flags), &key)) != 0) + return (error); + umtxq_lock(&key); + umtxq_busy(&key); + cnt = umtxq_count(&key); + nwake = umtxq_signal(&key, 1); + if (cnt <= nwake) { + umtxq_unlock(&key); + error = suword32( + __DEVOLATILE(uint32_t *, &sem->_has_waiters), 0); + umtxq_lock(&key); + } + umtxq_unbusy(&key); + umtxq_unlock(&key); + umtx_key_release(&key); + return (error); +} + int _umtx_lock(struct thread *td, struct _umtx_lock_args *uap) /* struct umtx *umtx */ @@ -3031,6 +3135,35 @@ __umtx_op_rw_unlock(struct thread *td, s return do_rw_unlock(td, uap->obj); } +static int +__umtx_op_sem_wait(struct thread *td, struct _umtx_op_args *uap) +{ + struct timespec *ts, timeout; + int error; + + /* Allow a null timespec (wait forever). */ + if (uap->uaddr2 == NULL) + ts = NULL; + else { + error = copyin(uap->uaddr2, &timeout, + sizeof(timeout)); + if (error != 0) + return (error); + if (timeout.tv_nsec >= 1000000000 || + timeout.tv_nsec < 0) { + return (EINVAL); + } + ts = &timeout; + } + return (do_sem_wait(td, uap->obj, ts)); +} + +static int +__umtx_op_sem_wake(struct thread *td, struct _umtx_op_args *uap) +{ + return do_sem_wake(td, uap->obj); +} + typedef int (*_umtx_op_func)(struct thread *td, struct _umtx_op_args *uap); static _umtx_op_func op_table[] = { @@ -3052,7 +3185,9 @@ static _umtx_op_func op_table[] = { __umtx_op_wait_uint_private, /* UMTX_OP_WAIT_UINT_PRIVATE */ __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ __umtx_op_wait_umutex, /* UMTX_OP_UMUTEX_WAIT */ - __umtx_op_wake_umutex /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_sem_wait, /* UMTX_OP_SEM_WAIT */ + __umtx_op_sem_wake /* UMTX_OP_SEM_WAKE */ }; int @@ -3274,6 +3409,27 @@ __umtx_op_wait_uint_private_compat32(str return do_wait(td, uap->obj, uap->val, ts, 1, 1); } +static int +__umtx_op_sem_wait_compat32(struct thread *td, struct _umtx_op_args *uap) +{ + struct timespec *ts, timeout; + int error; + + /* Allow a null timespec (wait forever). */ + if (uap->uaddr2 == NULL) + ts = NULL; + else { + error = copyin_timeout32(uap->uaddr2, &timeout); + if (error != 0) + return (error); + if (timeout.tv_nsec >= 1000000000 || + timeout.tv_nsec < 0) + return (EINVAL); + ts = &timeout; + } + return (do_sem_wait(td, uap->obj, ts)); +} + static _umtx_op_func op_table_compat32[] = { __umtx_op_lock_umtx_compat32, /* UMTX_OP_LOCK */ __umtx_op_unlock_umtx_compat32, /* UMTX_OP_UNLOCK */ @@ -3293,7 +3449,9 @@ static _umtx_op_func op_table_compat32[] __umtx_op_wait_uint_private_compat32, /* UMTX_OP_WAIT_UINT_PRIVATE */ __umtx_op_wake_private, /* UMTX_OP_WAKE_PRIVATE */ __umtx_op_wait_umutex_compat32, /* UMTX_OP_UMUTEX_WAIT */ - __umtx_op_wake_umutex /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_wake_umutex, /* UMTX_OP_UMUTEX_WAKE */ + __umtx_op_sem_wait_compat32, /* UMTX_OP_SEM_WAIT */ + __umtx_op_sem_wake /* UMTX_OP_SEM_WAKE */ }; int Added: head/sys/sys/_umtx.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_umtx.h Mon Jan 4 05:27:49 2010 (r201472) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2010, David Xu + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + * + */ + +#ifndef _SYS__UMTX_H_ +#define _SYS__UMTX_H_ + +#include + +struct umtx { + volatile unsigned long u_owner; /* Owner of the mutex. */ +}; + +struct umutex { + volatile __lwpid_t m_owner; /* Owner of the mutex */ + __uint32_t m_flags; /* Flags of the mutex */ + __uint32_t m_ceilings[2]; /* Priority protect ceiling */ + __uint32_t m_spare[4]; +}; + +struct ucond { + volatile __uint32_t c_has_waiters; /* Has waiters in kernel */ + __uint32_t c_flags; /* Flags of the condition variable */ + __uint32_t c_spare[2]; /* Spare space */ +}; + +struct urwlock { + volatile __int32_t rw_state; + __uint32_t rw_flags; + __uint32_t rw_blocked_readers; + __uint32_t rw_blocked_writers; + __uint32_t rw_spare[4]; +}; + +struct _usem { + volatile __uint32_t _has_waiters; + volatile __uint32_t _count; + __uint32_t _flags; +}; + +#endif /* !_SYS__UMTX_H_ */ Modified: head/sys/sys/umtx.h ============================================================================== --- head/sys/sys/umtx.h Mon Jan 4 04:29:01 2010 (r201471) +++ head/sys/sys/umtx.h Mon Jan 4 05:27:49 2010 (r201472) @@ -30,19 +30,11 @@ #ifndef _SYS_UMTX_H_ #define _SYS_UMTX_H_ -#include +#include #include -/* - * See pthread_* - */ - -#define UMTX_UNOWNED 0x0 -#define UMTX_CONTESTED LONG_MIN - -struct umtx { - volatile u_long u_owner; /* Owner of the mutex. */ -}; +#define UMTX_UNOWNED 0x0 +#define UMTX_CONTESTED LONG_MIN #define USYNC_PROCESS_SHARED 0x0001 /* Process shared sync objs */ @@ -53,27 +45,6 @@ struct umtx { #define UMUTEX_PRIO_INHERIT 0x0004 /* Priority inherited mutex */ #define UMUTEX_PRIO_PROTECT 0x0008 /* Priority protect mutex */ -struct umutex { - volatile __lwpid_t m_owner; /* Owner of the mutex */ - uint32_t m_flags; /* Flags of the mutex */ - uint32_t m_ceilings[2]; /* Priority protect ceiling */ - uint32_t m_spare[4]; -}; - -struct ucond { - volatile uint32_t c_has_waiters; /* Has waiters in kernel */ - uint32_t c_flags; /* Flags of the condition variable */ - uint32_t c_spare[2]; /* Spare space */ -}; - -struct urwlock { - volatile int32_t rw_state; - uint32_t rw_flags; - uint32_t rw_blocked_readers; - uint32_t rw_blocked_writers; - uint32_t rw_spare[4]; -}; - /* urwlock flags */ #define URWLOCK_PREFER_READER 0x0002 @@ -83,6 +54,9 @@ struct urwlock { #define URWLOCK_MAX_READERS 0x1fffffffU #define URWLOCK_READER_COUNT(c) ((c) & URWLOCK_MAX_READERS) +/* _usem flags */ +#define SEM_NAMED 0x0002 + /* op code for _umtx_op */ #define UMTX_OP_LOCK 0 #define UMTX_OP_UNLOCK 1 @@ -100,10 +74,12 @@ struct urwlock { #define UMTX_OP_RW_WRLOCK 13 #define UMTX_OP_RW_UNLOCK 14 #define UMTX_OP_WAIT_UINT_PRIVATE 15 -#define UMTX_OP_WAKE_PRIVATE 16 -#define UMTX_OP_MUTEX_WAIT 17 -#define UMTX_OP_MUTEX_WAKE 18 -#define UMTX_OP_MAX 19 +#define UMTX_OP_WAKE_PRIVATE 16 +#define UMTX_OP_MUTEX_WAIT 17 +#define UMTX_OP_MUTEX_WAKE 18 +#define UMTX_OP_SEM_WAIT 19 +#define UMTX_OP_SEM_WAKE 20 +#define UMTX_OP_MAX 21 /* flags for UMTX_OP_CV_WAIT */ #define UMTX_CHECK_UNPARKING 0x01 From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:16:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D3C1065676; Mon, 4 Jan 2010 09:16:37 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 703228FC18; Mon, 4 Jan 2010 09:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049GbOY013094; Mon, 4 Jan 2010 09:16:37 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049GZ1Y013061; Mon, 4 Jan 2010 09:16:35 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201001040916.o049GZ1Y013061@svn.freebsd.org> From: Stanislav Sedov Date: Mon, 4 Jan 2010 09:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:16:37 -0000 Author: stas Date: Mon Jan 4 09:16:35 2010 New Revision: 201477 URL: http://svn.freebsd.org/changeset/base/201477 Log: - Add two particulary interesting quotes from the past decade. Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Mon Jan 4 09:02:39 2010 (r201476) +++ head/games/fortune/datfiles/fortunes Mon Jan 4 09:16:35 2010 (r201477) @@ -1604,6 +1604,13 @@ friends and family, and then justify thi for doing it." -- Bruce Feirstein, "Nice Guys Sleep Alone" % + As we know, there are known knowns. There are things we know we +know. We also know there are known unknowns. That is to say, we know +there're some things we do not know. But there're also unknown unknowns; +the ones we don't know we don't know." + -- Defense Secretary Donald Rumsfeld, + about the invasion to Iraq. +% At a recent meeting in Snowmass, Colorado, a participant from Los Angeles fainted from hyperoxygenation, and we had to hold his head under the exhaust of a bus until he revived. @@ -46372,6 +46379,13 @@ constitutions, displaying the utmost imp overturning everything. -- Plato, "Republic", 370 B.C. % +The investment community feels very putupon. They feel there is no +reason why they shouldn't earn $1 million to $200 million a year, +and they don't want to be held responsible for the global financial +meltdown. + -- Daniel Fass, chairman of Obama's + financial-industry fundraising party +% The IQ of the group is the lowest IQ of a member of the group divided by the number of people in the group. % From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:49:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30018106568B; Mon, 4 Jan 2010 09:49:24 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0586C8FC1C; Mon, 4 Jan 2010 09:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049nNR4020312; Mon, 4 Jan 2010 09:49:23 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049nNJY020306; Mon, 4 Jan 2010 09:49:23 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040949.o049nNJY020306@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 09:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201478 - head/tools/regression/usr.bin/make/syntax/directive-t0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:49:24 -0000 Author: obrien Date: Mon Jan 4 09:49:23 2010 New Revision: 201478 URL: http://svn.freebsd.org/changeset/base/201478 Log: Regression test for r201456. Added: head/tools/regression/usr.bin/make/syntax/directive-t0/ head/tools/regression/usr.bin/make/syntax/directive-t0/Makefile (contents, props changed) head/tools/regression/usr.bin/make/syntax/directive-t0/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/directive-t0/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/directive-t0/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/syntax/directive-t0/test.t (contents, props changed) Added: head/tools/regression/usr.bin/make/syntax/directive-t0/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/directive-t0/Makefile Mon Jan 4 09:49:23 2010 (r201478) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# +# A typo'ed directive. +# + +.uudef foo + +all: Added: head/tools/regression/usr.bin/make/syntax/directive-t0/expected.status.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/directive-t0/expected.status.1 Mon Jan 4 09:49:23 2010 (r201478) @@ -0,0 +1 @@ +1 Added: head/tools/regression/usr.bin/make/syntax/directive-t0/expected.stderr.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/directive-t0/expected.stderr.1 Mon Jan 4 09:49:23 2010 (r201478) @@ -0,0 +1,2 @@ +"Makefile", line 6: Unknown directive +make: fatal errors encountered -- cannot continue Added: head/tools/regression/usr.bin/make/syntax/directive-t0/expected.stdout.1 ============================================================================== Added: head/tools/regression/usr.bin/make/syntax/directive-t0/test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/syntax/directive-t0/test.t Mon Jan 4 09:49:23 2010 (r201478) @@ -0,0 +1,14 @@ +#! /bin/sh +# $FreeBSD$ + +cd `dirname $0` +. ../../common.sh + +# Description +DESC="A typo'ed directive." + +# Run +TEST_N=1 +TEST_1= + +eval_cmd $* From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:50:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EAC7106566B; Mon, 4 Jan 2010 09:50:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 048E78FC19; Mon, 4 Jan 2010 09:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049oUOT020613; Mon, 4 Jan 2010 09:50:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049oUN4020612; Mon, 4 Jan 2010 09:50:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040950.o049oUN4020612@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 09:50:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201479 - in head/tools/regression: usr.bin/lastcomm usr.sbin/sa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:50:31 -0000 Author: obrien Date: Mon Jan 4 09:50:30 2010 New Revision: 201479 URL: http://svn.freebsd.org/changeset/base/201479 Log: It is expected these are chmod +x. Modified: Directory Properties: head/tools/regression/usr.bin/lastcomm/regress.t (props changed) head/tools/regression/usr.sbin/sa/regress.t (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:54:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68EA71065695; Mon, 4 Jan 2010 09:54:24 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5890A8FC25; Mon, 4 Jan 2010 09:54:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049sOQp021514; Mon, 4 Jan 2010 09:54:24 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049sOhM021512; Mon, 4 Jan 2010 09:54:24 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040954.o049sOhM021512@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 09:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201480 - head/tools/regression/usr.bin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:54:24 -0000 Author: obrien Date: Mon Jan 4 09:54:24 2010 New Revision: 201480 URL: http://svn.freebsd.org/changeset/base/201480 Log: Don't process 'lastcomm' if "AUTOMATED" is defined. The tests for it require manual setup. Modified: head/tools/regression/usr.bin/Makefile Modified: head/tools/regression/usr.bin/Makefile ============================================================================== --- head/tools/regression/usr.bin/Makefile Mon Jan 4 09:50:30 2010 (r201479) +++ head/tools/regression/usr.bin/Makefile Mon Jan 4 09:54:24 2010 (r201480) @@ -1,5 +1,8 @@ # $FreeBSD$ -SUBDIR= calendar comm file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm +SUBDIR= calendar comm file2c join jot m4 printf sed tr uudecode uuencode xargs +.if !defined(AUTOMATED) +SUBDIR+= lastcomm +.endif .include From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:57:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 814F010656AA; Mon, 4 Jan 2010 09:57:00 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E69E8FC1E; Mon, 4 Jan 2010 09:57:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049v0bj022123; Mon, 4 Jan 2010 09:57:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049v0uJ022121; Mon, 4 Jan 2010 09:57:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040957.o049v0uJ022121@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 09:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201481 - head/tools/regression/acct X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:57:00 -0000 Author: obrien Date: Mon Jan 4 09:57:00 2010 New Revision: 201481 URL: http://svn.freebsd.org/changeset/base/201481 Log: Also cleanup after the test run. Modified: head/tools/regression/acct/regress.t Modified: head/tools/regression/acct/regress.t ============================================================================== --- head/tools/regression/acct/regress.t Mon Jan 4 09:54:24 2010 (r201480) +++ head/tools/regression/acct/regress.t Mon Jan 4 09:57:00 2010 (r201481) @@ -17,7 +17,7 @@ check() fi } -(cd $DIR ; make pack) +(cd $DIR ; make pack) >/dev/null 2>&1 echo 1..7 @@ -29,4 +29,6 @@ check 5 1 1000000 check 6 2147483647 999999 check 7 10000000 +(cd $DIR ; make clean) >/dev/null 2>&1 + exit 0 From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 09:59:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A529106566C; Mon, 4 Jan 2010 09:59:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 799298FC0C; Mon, 4 Jan 2010 09:59:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o049xICg022647; Mon, 4 Jan 2010 09:59:18 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o049xIkw022645; Mon, 4 Jan 2010 09:59:18 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001040959.o049xIkw022645@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 09:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201482 - head/tools/regression/usr.bin/lastcomm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 09:59:18 -0000 Author: obrien Date: Mon Jan 4 09:59:18 2010 New Revision: 201482 URL: http://svn.freebsd.org/changeset/base/201482 Log: You need to be root to run this test. Modified: head/tools/regression/usr.bin/lastcomm/values.sh Modified: head/tools/regression/usr.bin/lastcomm/values.sh ============================================================================== --- head/tools/regression/usr.bin/lastcomm/values.sh Mon Jan 4 09:57:00 2010 (r201481) +++ head/tools/regression/usr.bin/lastcomm/values.sh Mon Jan 4 09:59:18 2010 (r201482) @@ -12,6 +12,11 @@ run() /usr/bin/time -l -o $1.time "$@" } +if [ `whoami` != "root" ]; then + echo "You need to be root to run this test." + exit 1 +fi + echo Redirecting accounting. mkdir $TMPDIR From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 10:37:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B6021065695; Mon, 4 Jan 2010 10:37:08 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B1598FC14; Mon, 4 Jan 2010 10:37:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Ab7eg031250; Mon, 4 Jan 2010 10:37:07 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Ab7S6031248; Mon, 4 Jan 2010 10:37:07 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041037.o04Ab7S6031248@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 10:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201484 - head/bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 10:37:08 -0000 Author: obrien Date: Mon Jan 4 10:37:07 2010 New Revision: 201484 URL: http://svn.freebsd.org/changeset/base/201484 Log: Fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t), "-t" should accept "v1", which means a plain number should be accepted for UNIX98-style PTY's. Modified: head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Mon Jan 4 10:25:00 2010 (r201483) +++ head/bin/pkill/pkill.c Mon Jan 4 10:37:07 2010 (r201484) @@ -670,9 +670,6 @@ makelist(struct listhead *head, enum lis if (li->li_number == 0) li->li_number = -1; /* any jail */ break; - case LT_TTY: - usage(); - /* NOTREACHED */ default: break; } @@ -708,6 +705,10 @@ makelist(struct listhead *head, enum lis if (stat(buf, &st) != -1) goto foundtty; + snprintf(buf, sizeof(buf), _PATH_DEV "pts/%s", cp); + if (stat(buf, &st) != -1) + goto foundtty; + if (errno == ENOENT) errx(STATUS_BADUSAGE, "No such tty: `%s'", sp); err(STATUS_ERROR, "Cannot access `%s'", sp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 10:50:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3F7106566C; Mon, 4 Jan 2010 10:50:18 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BCDA8FC0A; Mon, 4 Jan 2010 10:50:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04AoH70036179; Mon, 4 Jan 2010 10:50:17 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04AoHJS036178; Mon, 4 Jan 2010 10:50:17 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041050.o04AoHJS036178@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 10:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201487 - head/bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 10:50:18 -0000 Author: obrien Date: Mon Jan 4 10:50:17 2010 New Revision: 201487 URL: http://svn.freebsd.org/changeset/base/201487 Log: Committed the wrong version in r201484. This time really fix the "-t" functionality. Per the regression tests (pgrep-t.t & pkill-t.t), "-t" should accept "v1", which means a plain number should be accepted for UNIX98-style PTY's. Modified: head/bin/pkill/pkill.c Modified: head/bin/pkill/pkill.c ============================================================================== --- head/bin/pkill/pkill.c Mon Jan 4 10:39:16 2010 (r201486) +++ head/bin/pkill/pkill.c Mon Jan 4 10:50:17 2010 (r201487) @@ -670,6 +670,20 @@ makelist(struct listhead *head, enum lis if (li->li_number == 0) li->li_number = -1; /* any jail */ break; + case LT_TTY: + if (li->li_number < 0) + errx(STATUS_BADUSAGE, + "Negative /dev/pts tty `%s'", sp); + snprintf(buf, sizeof(buf), _PATH_DEV "pts/%s", + sp); + if (stat(buf, &st) != -1) + goto foundtty; + if (errno == ENOENT) + errx(STATUS_BADUSAGE, "No such tty: `" + _PATH_DEV "pts/%s'", sp); + err(STATUS_ERROR, "Cannot access `" + _PATH_DEV "pts/%s'", sp); + break; default: break; } @@ -705,10 +719,6 @@ makelist(struct listhead *head, enum lis if (stat(buf, &st) != -1) goto foundtty; - snprintf(buf, sizeof(buf), _PATH_DEV "pts/%s", cp); - if (stat(buf, &st) != -1) - goto foundtty; - if (errno == ENOENT) errx(STATUS_BADUSAGE, "No such tty: `%s'", sp); err(STATUS_ERROR, "Cannot access `%s'", sp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 10:58:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 887DC106566C; Mon, 4 Jan 2010 10:58:09 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77CF78FC08; Mon, 4 Jan 2010 10:58:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Aw9F2037927; Mon, 4 Jan 2010 10:58:09 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Aw9MP037925; Mon, 4 Jan 2010 10:58:09 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041058.o04Aw9MP037925@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 10:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201488 - head/tools/regression/usr.bin/calendar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 10:58:09 -0000 Author: obrien Date: Mon Jan 4 10:58:08 2010 New Revision: 201488 URL: http://svn.freebsd.org/changeset/base/201488 Log: 'prove -r' isn't as smart as grog thought. Modified: head/tools/regression/usr.bin/calendar/regress.sh Modified: head/tools/regression/usr.bin/calendar/regress.sh ============================================================================== --- head/tools/regression/usr.bin/calendar/regress.sh Mon Jan 4 10:50:17 2010 (r201487) +++ head/tools/regression/usr.bin/calendar/regress.sh Mon Jan 4 10:58:08 2010 (r201488) @@ -7,31 +7,25 @@ CALENDAR="${CALENDAR_BIN} ${CALENDAR_FIL REGRESSION_START($1) -echo 1..4 +echo 1..28 REGRESSION_TEST(`s1',`$CALENDAR -t 29.12.2006') REGRESSION_TEST(`s2',`$CALENDAR -t 30.12.2006') REGRESSION_TEST(`s3',`$CALENDAR -t 31.12.2006') REGRESSION_TEST(`s4',`$CALENDAR -t 01.01.2007') -echo 5..9 - REGRESSION_TEST(`a1',`$CALENDAR -A 3 -t 28.12.2006') REGRESSION_TEST(`a2',`$CALENDAR -A 3 -t 29.12.2006') REGRESSION_TEST(`a3',`$CALENDAR -A 3 -t 30.12.2006') REGRESSION_TEST(`a4',`$CALENDAR -A 3 -t 31.12.2006') REGRESSION_TEST(`a5',`$CALENDAR -A 3 -t 01.01.2007') -echo 10..14 - REGRESSION_TEST(`b1',`$CALENDAR -B 3 -t 31.12.2006') REGRESSION_TEST(`b2',`$CALENDAR -B 3 -t 01.01.2007') REGRESSION_TEST(`b3',`$CALENDAR -B 3 -t 02.01.2007') REGRESSION_TEST(`b4',`$CALENDAR -B 3 -t 03.01.2007') REGRESSION_TEST(`b5',`$CALENDAR -B 3 -t 04.01.2007') -echo 15..21 - REGRESSION_TEST(`w0-1',`$CALENDAR -W 0 -t 28.12.2006') REGRESSION_TEST(`w0-2',`$CALENDAR -W 0 -t 29.12.2006') REGRESSION_TEST(`w0-3',`$CALENDAR -W 0 -t 30.12.2006') @@ -40,8 +34,6 @@ REGRESSION_TEST(`w0-5',`$CALENDAR -W 0 - REGRESSION_TEST(`w0-6',`$CALENDAR -W 0 -t 02.01.2007') REGRESSION_TEST(`w0-7',`$CALENDAR -W 0 -t 03.01.2007') -echo 22..28 - REGRESSION_TEST(`wn-1',`$CALENDAR -W 0 -t 28.12.2006') REGRESSION_TEST(`wn-2',`$CALENDAR -W 1 -t 28.12.2006') REGRESSION_TEST(`wn-3',`$CALENDAR -W 2 -t 28.12.2006') From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 10:59:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7FCF106566B; Mon, 4 Jan 2010 10:59:14 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F378FC1F; Mon, 4 Jan 2010 10:59:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04AxE6a038225; Mon, 4 Jan 2010 10:59:14 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04AxEIN038222; Mon, 4 Jan 2010 10:59:14 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041059.o04AxEIN038222@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 10:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201489 - head/tools/regression/usr.bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 10:59:15 -0000 Author: obrien Date: Mon Jan 4 10:59:14 2010 New Revision: 201489 URL: http://svn.freebsd.org/changeset/base/201489 Log: Catch up with UNIX98-style PTY's. Modified: head/tools/regression/usr.bin/pkill/pgrep-t.t head/tools/regression/usr.bin/pkill/pkill-t.t Modified: head/tools/regression/usr.bin/pkill/pgrep-t.t ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-t.t Mon Jan 4 10:58:08 2010 (r201488) +++ head/tools/regression/usr.bin/pkill/pgrep-t.t Mon Jan 4 10:59:14 2010 (r201489) @@ -11,7 +11,10 @@ if [ "$tty" = "??" ]; then tty="-" ttyshort="-" else - ttyshort=`echo $tty | cut -c 4-` + case $tty in + pts/*) ttyshort=`echo $tty | cut -c 5-` ;; + *) ttyshort=`echo $tty | cut -c 4-` ;; + esac fi sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 ln -sf /bin/sleep $sleep Modified: head/tools/regression/usr.bin/pkill/pkill-t.t ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-t.t Mon Jan 4 10:58:08 2010 (r201488) +++ head/tools/regression/usr.bin/pkill/pkill-t.t Mon Jan 4 10:59:14 2010 (r201489) @@ -11,7 +11,10 @@ if [ "$tty" = "??" ]; then tty="-" ttyshort="-" else - ttyshort=`echo $tty | cut -c 4-` + case $tty in + pts/*) ttyshort=`echo $tty | cut -c 5-` ;; + *) ttyshort=`echo $tty | cut -c 4-` ;; + esac fi sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 ln -sf /bin/sleep $sleep From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 11:00:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BD59106566B; Mon, 4 Jan 2010 11:00:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7818FC1E; Mon, 4 Jan 2010 11:00:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04B0D5c038481; Mon, 4 Jan 2010 11:00:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04B0Dao038479; Mon, 4 Jan 2010 11:00:13 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041100.o04B0Dao038479@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 11:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201490 - head/tools/regression/usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 11:00:13 -0000 Author: obrien Date: Mon Jan 4 11:00:12 2010 New Revision: 201490 URL: http://svn.freebsd.org/changeset/base/201490 Log: There are actually 129 tests here. Modified: head/tools/regression/usr.bin/sed/multitest.t Modified: head/tools/regression/usr.bin/sed/multitest.t ============================================================================== --- head/tools/regression/usr.bin/sed/multitest.t Mon Jan 4 10:59:14 2010 (r201489) +++ head/tools/regression/usr.bin/sed/multitest.t Mon Jan 4 11:00:12 2010 (r201490) @@ -50,7 +50,7 @@ main() awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' lines1 awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' lines2 - echo "1..121" + echo "1..129" exec 4>&1 5>&2 tests From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 11:11:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DAA106578D; Mon, 4 Jan 2010 11:11:37 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73D9D8FC15; Mon, 4 Jan 2010 11:11:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04BBbhr041069; Mon, 4 Jan 2010 11:11:37 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04BBbQb041066; Mon, 4 Jan 2010 11:11:37 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041111.o04BBbQb041066@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 11:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201491 - head/tools/regression/usr.bin/pkill X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 11:11:38 -0000 Author: obrien Date: Mon Jan 4 11:11:37 2010 New Revision: 201491 URL: http://svn.freebsd.org/changeset/base/201491 Log: Fix formatting. Modified: head/tools/regression/usr.bin/pkill/pgrep-t.t head/tools/regression/usr.bin/pkill/pkill-t.t Modified: head/tools/regression/usr.bin/pkill/pgrep-t.t ============================================================================== --- head/tools/regression/usr.bin/pkill/pgrep-t.t Mon Jan 4 11:00:12 2010 (r201490) +++ head/tools/regression/usr.bin/pkill/pgrep-t.t Mon Jan 4 11:11:37 2010 (r201491) @@ -13,7 +13,7 @@ if [ "$tty" = "??" ]; then else case $tty in pts/*) ttyshort=`echo $tty | cut -c 5-` ;; - *) ttyshort=`echo $tty | cut -c 4-` ;; + *) ttyshort=`echo $tty | cut -c 4-` ;; esac fi sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 Modified: head/tools/regression/usr.bin/pkill/pkill-t.t ============================================================================== --- head/tools/regression/usr.bin/pkill/pkill-t.t Mon Jan 4 11:00:12 2010 (r201490) +++ head/tools/regression/usr.bin/pkill/pkill-t.t Mon Jan 4 11:11:37 2010 (r201491) @@ -13,7 +13,7 @@ if [ "$tty" = "??" ]; then else case $tty in pts/*) ttyshort=`echo $tty | cut -c 5-` ;; - *) ttyshort=`echo $tty | cut -c 4-` ;; + *) ttyshort=`echo $tty | cut -c 4-` ;; esac fi sleep=`mktemp /tmp/$base.XXXXXX` || exit 1 From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 12:32:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 132EE106566C; Mon, 4 Jan 2010 12:32:39 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 021298FC20; Mon, 4 Jan 2010 12:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04CWccB058894; Mon, 4 Jan 2010 12:32:38 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04CWcNW058892; Mon, 4 Jan 2010 12:32:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041232.o04CWcNW058892@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 12:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201494 - stable/7/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 12:32:39 -0000 Author: obrien Date: Mon Jan 4 12:32:38 2010 New Revision: 201494 URL: http://svn.freebsd.org/changeset/base/201494 Log: Spell the full word "February". Submitted by: pluknet@gmail.com Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 ============================================================================== --- stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Mon Jan 4 11:32:37 2010 (r201493) +++ stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Mon Jan 4 12:32:38 2010 (r201494) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feb 9, 2008 +.Dd February 9, 2008 .Os .Dt FIFOLOG 1 .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 12:39:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B3C106568B; Mon, 4 Jan 2010 12:39:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C9FB98FC14; Mon, 4 Jan 2010 12:39:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Cdg59060469; Mon, 4 Jan 2010 12:39:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04CdgGR060467; Mon, 4 Jan 2010 12:39:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001041239.o04CdgGR060467@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 4 Jan 2010 12:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201495 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 12:39:42 -0000 Author: trasz Date: Mon Jan 4 12:39:42 2010 New Revision: 201495 URL: http://svn.freebsd.org/changeset/base/201495 Log: Fix comments. Modified: head/sys/kern/subr_acl_nfs4.c Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Mon Jan 4 12:32:38 2010 (r201494) +++ head/sys/kern/subr_acl_nfs4.c Mon Jan 4 12:39:42 2010 (r201495) @@ -985,7 +985,7 @@ _acls_are_equal(const struct acl *a, con } /* - * This routine is used to determine whether to remove entry_type attribute + * This routine is used to determine whether to remove extended attribute * that stores ACL contents. */ int @@ -1004,9 +1004,8 @@ acl_nfs4_is_trivial(const struct acl *ac * * XXX: I guess there is a faster way to do this. However, even * this slow implementation significantly speeds things up - * for files that don't have any entry_type ACL entries - it's - * critical for performance to not use EA when they are not - * needed. + * for files that don't have non-trivial ACLs - it's critical + * for performance to not use EA when they are not needed. */ tmpaclp = acl_alloc(M_WAITOK | M_ZERO); acl_nfs4_sync_mode_from_acl(&tmpmode, aclp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 13:20:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3633D106568B; Mon, 4 Jan 2010 13:20:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id E48B68FC21; Mon, 4 Jan 2010 13:20:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 4BE9541C759; Mon, 4 Jan 2010 14:20:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id z8I6bek1l7dx; Mon, 4 Jan 2010 14:20:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 81A3141C757; Mon, 4 Jan 2010 14:20:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 5ED784448EC; Mon, 4 Jan 2010 13:18:20 +0000 (UTC) Date: Mon, 4 Jan 2010 13:18:20 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: "David E. O'Brien" In-Reply-To: <201001041232.o04CWcNW058892@svn.freebsd.org> Message-ID: <20100104131712.W88477@maildrop.int.zabbadoz.net> References: <201001041232.o04CWcNW058892@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r201494 - stable/7/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 13:20:07 -0000 On Mon, 4 Jan 2010, David E. O'Brien wrote: > Author: obrien > Date: Mon Jan 4 12:32:38 2010 > New Revision: 201494 > URL: http://svn.freebsd.org/changeset/base/201494 > > Log: > Spell the full word "February". > > Submitted by: pluknet@gmail.com Is there reason not to ask ru@ to MFC 178068 and/or 190693 insetad? > Modified: > stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 > > Modified: stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 > ============================================================================== > --- stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Mon Jan 4 11:32:37 2010 (r201493) > +++ stable/7/usr.sbin/fifolog/fifolog_create/fifolog.1 Mon Jan 4 12:32:38 2010 (r201494) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd Feb 9, 2008 > +.Dd February 9, 2008 > .Os > .Dt FIFOLOG 1 > .Sh NAME > -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:34:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC06010656FE; Mon, 4 Jan 2010 14:34:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C08738FC08; Mon, 4 Jan 2010 14:34:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EY1Ic085610; Mon, 4 Jan 2010 14:34:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EY1Qf085608; Mon, 4 Jan 2010 14:34:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041434.o04EY1Qf085608@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201496 - stable/6/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:34:02 -0000 Author: bz Date: Mon Jan 4 14:34:01 2010 New Revision: 201496 URL: http://svn.freebsd.org/changeset/base/201496 Log: "Merge" a single file out of r184205 by des@ w/o placing mergeinfo to be able to keep files in sync between branches and still allow a possible of the entire commit: Retire the MALLOC and FREE macros. They are an abomination unto style(9). Modified: stable/6/sys/opencrypto/deflate.c Modified: stable/6/sys/opencrypto/deflate.c ============================================================================== --- stable/6/sys/opencrypto/deflate.c Mon Jan 4 12:39:42 2010 (r201495) +++ stable/6/sys/opencrypto/deflate.c Mon Jan 4 14:34:01 2010 (r201496) @@ -79,7 +79,7 @@ deflate_global(data, size, decomp, out) zbuf.avail_in = size; /* Total length of data to be processed */ if (!decomp) { - MALLOC(buf[i].out, u_int8_t *, (u_long) size, M_CRYPTO_DATA, + buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -94,7 +94,7 @@ deflate_global(data, size, decomp, out) * updated while the decompression is going on */ - MALLOC(buf[i].out, u_int8_t *, (u_long) (size * 4), + buf[i].out = malloc((u_long) (size * 4), M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -121,7 +121,7 @@ deflate_global(data, size, decomp, out) goto end; else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { /* we need more output space, allocate size */ - MALLOC(buf[i].out, u_int8_t *, (u_long) size, + buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -137,7 +137,7 @@ deflate_global(data, size, decomp, out) end: result = count = zbuf.total_out; - MALLOC(*out, u_int8_t *, (u_long) result, M_CRYPTO_DATA, M_NOWAIT); + *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); if (*out == NULL) goto bad; if (decomp) @@ -149,13 +149,13 @@ end: if (count > buf[j].size) { bcopy(buf[j].out, *out, buf[j].size); *out += buf[j].size; - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); count -= buf[j].size; } else { /* it should be the last buffer */ bcopy(buf[j].out, *out, count); *out += count; - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); count = 0; } } @@ -165,7 +165,7 @@ end: bad: *out = NULL; for (j = 0; buf[j].flag != 0; j++) - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); if (decomp) inflateEnd(&zbuf); else From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:35:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FDDB1065692; Mon, 4 Jan 2010 14:35:36 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5503C8FC0C; Mon, 4 Jan 2010 14:35:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EZahN085988; Mon, 4 Jan 2010 14:35:36 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EZacU085985; Mon, 4 Jan 2010 14:35:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201001041435.o04EZacU085985@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 4 Jan 2010 14:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201497 - stable/8/sys/gnu/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:35:36 -0000 Author: jh Date: Mon Jan 4 14:35:36 2010 New Revision: 201497 URL: http://svn.freebsd.org/changeset/base/201497 Log: MFC r198940: File flags handling fixes for ext2fs: - Disallow setting of flags not supported by ext2fs. - Map EXT2_APPEND_FL to SF_APPEND. - Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE. - Map EXT2_NODUMP_FL to UF_NODUMP. Note that ext2fs doesn't support user settable append and immutable flags. EXT2_NODUMP_FL is an user settable flag also on Linux. PR: kern/122047 Approved by: trasz (mentor) Modified: stable/8/sys/gnu/fs/ext2fs/ext2_inode_cnv.c stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/gnu/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_inode_cnv.c Mon Jan 4 14:34:01 2010 (r201496) +++ stable/8/sys/gnu/fs/ext2fs/ext2_inode_cnv.c Mon Jan 4 14:35:36 2010 (r201497) @@ -83,8 +83,9 @@ ext2_ei2i(ei, ip) ip->i_mtime = ei->i_mtime; ip->i_ctime = ei->i_ctime; ip->i_flags = 0; - ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? APPEND : 0; - ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? IMMUTABLE : 0; + ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? SF_APPEND : 0; + ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? SF_IMMUTABLE : 0; + ip->i_flags |= (ei->i_flags & EXT2_NODUMP_FL) ? UF_NODUMP : 0; ip->i_blocks = ei->i_blocks; ip->i_gen = ei->i_generation; ip->i_uid = ei->i_uid; @@ -121,8 +122,9 @@ ext2_i2ei(ip, ei) ei->i_ctime = ip->i_ctime; ei->i_flags = ip->i_flags; ei->i_flags = 0; - ei->i_flags |= (ip->i_flags & APPEND) ? EXT2_APPEND_FL: 0; - ei->i_flags |= (ip->i_flags & IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; + ei->i_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND_FL: 0; + ei->i_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; + ei->i_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP_FL : 0; ei->i_blocks = ip->i_blocks; ei->i_generation = ip->i_gen; ei->i_uid = ip->i_uid; Modified: stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c Mon Jan 4 14:34:01 2010 (r201496) +++ stable/8/sys/gnu/fs/ext2fs/ext2_vnops.c Mon Jan 4 14:35:36 2010 (r201497) @@ -391,6 +391,10 @@ ext2_setattr(ap) return (EINVAL); } if (vap->va_flags != VNOVAL) { + /* Disallow flags not supported by ext2fs. */ + if (vap->va_flags & ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP)) + return (EOPNOTSUPP); + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); /* From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:41:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 707D0106566C; Mon, 4 Jan 2010 14:41:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44F688FC13; Mon, 4 Jan 2010 14:41:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EfWnB087368; Mon, 4 Jan 2010 14:41:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EfW6p087366; Mon, 4 Jan 2010 14:41:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041441.o04EfW6p087366@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201498 - stable/6/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:41:32 -0000 Author: bz Date: Mon Jan 4 14:41:31 2010 New Revision: 201498 URL: http://svn.freebsd.org/changeset/base/201498 Log: MFC r199887: Z_PARTIAL_FLUSH is marked deprecated. Z_SYNC_FLUSH is the suggested replacement but only use it for inflate. For deflate use Z_FINISH as Z_SYNC_FLUSH adds a trailing marker in some cases that inflate(), despite the comment in zlib, does not seem to cope well with, resulting in errors when uncompressing exactly fills the output buffer without a Z_STREAM_END and a successive call returns an error. Modified: stable/6/sys/opencrypto/deflate.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/opencrypto/deflate.c ============================================================================== --- stable/6/sys/opencrypto/deflate.c Mon Jan 4 14:35:36 2010 (r201497) +++ stable/6/sys/opencrypto/deflate.c Mon Jan 4 14:41:31 2010 (r201498) @@ -113,13 +113,17 @@ deflate_global(data, size, decomp, out) if (error != Z_OK) goto bad; for (;;) { - error = decomp ? inflate(&zbuf, Z_PARTIAL_FLUSH) : - deflate(&zbuf, Z_PARTIAL_FLUSH); + error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : + deflate(&zbuf, Z_FINISH); if (error != Z_OK && error != Z_STREAM_END) goto bad; - else if (zbuf.avail_in == 0 && zbuf.avail_out != 0) - goto end; - else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { + if (decomp && zbuf.avail_in == 0 && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (!decomp && error == Z_STREAM_END) { + /* Done. */ + break; + } else if (zbuf.avail_out == 0) { /* we need more output space, allocate size */ buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); @@ -130,11 +134,12 @@ deflate_global(data, size, decomp, out) buf[i].flag = 1; zbuf.avail_out = buf[i].size; i++; - } else + } else { + /* Unexpect result. */ goto bad; + } } -end: result = count = zbuf.total_out; *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:43:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B404A1065676; Mon, 4 Jan 2010 14:43:23 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A22128FC14; Mon, 4 Jan 2010 14:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EhNe9087839; Mon, 4 Jan 2010 14:43:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EhNYF087837; Mon, 4 Jan 2010 14:43:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041443.o04EhNYF087837@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201499 - stable/6/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:43:23 -0000 Author: bz Date: Mon Jan 4 14:43:23 2010 New Revision: 201499 URL: http://svn.freebsd.org/changeset/base/201499 Log: MFC r199894: Correct a typo. Modified: stable/6/sys/netipsec/ipsec_mbuf.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netipsec/ipsec_mbuf.c ============================================================================== --- stable/6/sys/netipsec/ipsec_mbuf.c Mon Jan 4 14:41:31 2010 (r201498) +++ stable/6/sys/netipsec/ipsec_mbuf.c Mon Jan 4 14:43:23 2010 (r201499) @@ -67,7 +67,7 @@ m_makespace(struct mbuf *m0, int skip, i * At this point skip is the offset into the mbuf m * where the new header should be placed. Figure out * if there's space to insert the new header. If so, - * and copying the remainder makese sense then do so. + * and copying the remainder makes sense then do so. * Otherwise insert a new mbuf in the chain, splitting * the contents of m as needed. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:45:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCD5310656B9; Mon, 4 Jan 2010 14:45:31 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA2D08FC0A; Mon, 4 Jan 2010 14:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EjVqj088392; Mon, 4 Jan 2010 14:45:31 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EjVkT088390; Mon, 4 Jan 2010 14:45:31 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001041445.o04EjVkT088390@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 4 Jan 2010 14:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201500 - stable/7/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:45:32 -0000 Author: gallatin Date: Mon Jan 4 14:45:31 2010 New Revision: 201500 URL: http://svn.freebsd.org/changeset/base/201500 Log: MFC 200845: Don't take the driver mutex in mxge_tick(), as it is run with the mutex held. Modified: stable/7/sys/dev/mxge/if_mxge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/7/sys/dev/mxge/if_mxge.c Mon Jan 4 14:43:23 2010 (r201499) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Jan 4 14:45:31 2010 (r201500) @@ -3638,9 +3638,7 @@ mxge_tick(void *arg) uint16_t cmd; ticks = mxge_ticks; - mtx_lock(&sc->driver_mtx); running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; - mtx_unlock(&sc->driver_mtx); if (running) { /* aggregate stats from different slices */ pkts = mxge_update_stats(sc); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:52:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B94106566B; Mon, 4 Jan 2010 14:52:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0C568FC15; Mon, 4 Jan 2010 14:52:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EqjYw090013; Mon, 4 Jan 2010 14:52:45 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Eqjr0090010; Mon, 4 Jan 2010 14:52:45 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041452.o04Eqjr0090010@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201501 - stable/6/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:52:45 -0000 Author: bz Date: Mon Jan 4 14:52:45 2010 New Revision: 201501 URL: http://svn.freebsd.org/changeset/base/201501 Log: MFC r199895: Change memory managment from a fixed size array to a list. This is needed to avoid running into out of buffer situations where we cannot alloc a new buffer because we hit the array size limit (ZBUF). Use a combined allocation for the struct and the actual data buffer to not increase the number of malloc calls. [1] Defer initialization of zbuf until we actually need it. Make sure the output buffer will be large enough in all cases. Details discussed with: kib [1] Reviewed by: kib [1] Modified: stable/6/sys/opencrypto/deflate.c stable/6/sys/opencrypto/deflate.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/opencrypto/deflate.c ============================================================================== --- stable/6/sys/opencrypto/deflate.c Mon Jan 4 14:45:31 2010 (r201500) +++ stable/6/sys/opencrypto/deflate.c Mon Jan 4 14:52:45 2010 (r201501) @@ -65,53 +65,52 @@ deflate_global(data, size, decomp, out) z_stream zbuf; u_int8_t *output; u_int32_t count, result; - int error, i = 0, j; - struct deflate_buf buf[ZBUF]; - - bzero(&zbuf, sizeof(z_stream)); - for (j = 0; j < ZBUF; j++) - buf[j].flag = 0; - - zbuf.next_in = data; /* data that is going to be processed */ - zbuf.zalloc = z_alloc; - zbuf.zfree = z_free; - zbuf.opaque = Z_NULL; - zbuf.avail_in = size; /* Total length of data to be processed */ + int error, i; + struct deflate_buf *bufh, *bufp; + bufh = bufp = NULL; if (!decomp) { - buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, - M_NOWAIT); - if (buf[i].out == NULL) - goto bad; - buf[i].size = size; - buf[i].flag = 1; - i++; + i = 1; } else { /* * Choose a buffer with 4x the size of the input buffer * for the size of the output buffer in the case of * decompression. If it's not sufficient, it will need to be - * updated while the decompression is going on + * updated while the decompression is going on. */ - - buf[i].out = malloc((u_long) (size * 4), - M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) - goto bad; - buf[i].size = size * 4; - buf[i].flag = 1; + i = 4; + } + /* + * Make sure we do have enough output space. Repeated calls to + * deflate need at least 6 bytes of output buffer space to avoid + * repeated markers. We will always provide at least 16 bytes. + */ + while ((size * i) < 16) i++; + + bufh = bufp = malloc(sizeof(*bufp) + (size_t)(size * i), + M_CRYPTO_DATA, M_NOWAIT); + if (bufp == NULL) { + goto bad2; } + bufp->next = NULL; + bufp->size = size * i; - zbuf.next_out = buf[0].out; - zbuf.avail_out = buf[0].size; + bzero(&zbuf, sizeof(z_stream)); + zbuf.zalloc = z_alloc; + zbuf.zfree = z_free; + zbuf.opaque = Z_NULL; + zbuf.next_in = data; /* Data that is going to be processed. */ + zbuf.avail_in = size; /* Total length of data to be processed. */ + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; error = decomp ? inflateInit2(&zbuf, window_inflate) : deflateInit2(&zbuf, Z_DEFAULT_COMPRESSION, Z_METHOD, window_deflate, Z_MEMLEVEL, Z_DEFAULT_STRATEGY); - if (error != Z_OK) goto bad; + for (;;) { error = decomp ? inflate(&zbuf, Z_SYNC_FLUSH) : deflate(&zbuf, Z_FINISH); @@ -124,16 +123,20 @@ deflate_global(data, size, decomp, out) /* Done. */ break; } else if (zbuf.avail_out == 0) { - /* we need more output space, allocate size */ - buf[i].out = malloc((u_long) size, + struct deflate_buf *p; + + /* We need more output space for another iteration. */ + p = malloc(sizeof(*p) + (size_t)(size * i), M_CRYPTO_DATA, M_NOWAIT); - if (buf[i].out == NULL) + if (p == NULL) { goto bad; - zbuf.next_out = buf[i].out; - buf[i].size = size; - buf[i].flag = 1; - zbuf.avail_out = buf[i].size; - i++; + } + p->next = NULL; + p->size = size * i; + bufp->next = p; + bufp = p; + zbuf.next_out = bufp->data; + zbuf.avail_out = bufp->size; } else { /* Unexpect result. */ goto bad; @@ -142,25 +145,31 @@ deflate_global(data, size, decomp, out) result = count = zbuf.total_out; - *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); - if (*out == NULL) + *out = malloc(result, M_CRYPTO_DATA, M_NOWAIT); + if (*out == NULL) { goto bad; + } if (decomp) inflateEnd(&zbuf); else deflateEnd(&zbuf); output = *out; - for (j = 0; buf[j].flag != 0; j++) { - if (count > buf[j].size) { - bcopy(buf[j].out, *out, buf[j].size); - *out += buf[j].size; - free(buf[j].out, M_CRYPTO_DATA); - count -= buf[j].size; + for (bufp = bufh; bufp != NULL; ) { + if (count > bufp->size) { + struct deflate_buf *p; + + bcopy(bufp->data, *out, bufp->size); + *out += bufp->size; + count -= bufp->size; + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); } else { - /* it should be the last buffer */ - bcopy(buf[j].out, *out, count); + /* It should be the last buffer. */ + bcopy(bufp->data, *out, count); *out += count; - free(buf[j].out, M_CRYPTO_DATA); + free(bufp, M_CRYPTO_DATA); + bufp = NULL; count = 0; } } @@ -168,13 +177,19 @@ deflate_global(data, size, decomp, out) return result; bad: - *out = NULL; - for (j = 0; buf[j].flag != 0; j++) - free(buf[j].out, M_CRYPTO_DATA); if (decomp) inflateEnd(&zbuf); else deflateEnd(&zbuf); + for (bufp = bufh; bufp != NULL; ) { + struct deflate_buf *p; + + p = bufp; + bufp = bufp->next; + free(p, M_CRYPTO_DATA); + } +bad2: + *out = NULL; return 0; } Modified: stable/6/sys/opencrypto/deflate.h ============================================================================== --- stable/6/sys/opencrypto/deflate.h Mon Jan 4 14:45:31 2010 (r201500) +++ stable/6/sys/opencrypto/deflate.h Mon Jan 4 14:52:45 2010 (r201501) @@ -47,10 +47,14 @@ u_int32_t deflate_global(u_int8_t *, u_i void *z_alloc(void *, u_int, u_int); void z_free(void *, void *); +/* + * We are going to use a combined allocation to hold the metadata + * from the struct immediately followed by the real application data. + */ struct deflate_buf { - u_int8_t *out; - u_int32_t size; - int flag; + struct deflate_buf *next; + uint32_t size; + uint8_t data[]; }; #endif /* _CRYPTO_DEFLATE_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:56:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F3401065692; Mon, 4 Jan 2010 14:56:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D4668FC1D; Mon, 4 Jan 2010 14:56:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EuHAB090883; Mon, 4 Jan 2010 14:56:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EuHkf090881; Mon, 4 Jan 2010 14:56:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041456.o04EuHkf090881@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201502 - stable/6/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:56:17 -0000 Author: bz Date: Mon Jan 4 14:56:16 2010 New Revision: 201502 URL: http://svn.freebsd.org/changeset/base/201502 Log: MFC r199896: Directly send data uncompressed if the packet payload size is lower than the compression algorithm threshold. Modified: stable/6/sys/netipsec/xform_ipcomp.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 14:52:45 2010 (r201501) +++ stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 14:56:16 2010 (r201502) @@ -350,6 +350,17 @@ ipcomp_output( ipcompx = sav->tdb_compalgxform; IPSEC_ASSERT(ipcompx != NULL, ("null compression xform")); + /* + * Do not touch the packet in case our payload to compress + * is lower than the minimal threshold of the compression + * alogrithm. We will just send out the data uncompressed. + * See RFC 3173, 2.2. Non-Expansion Policy. + */ + if (m->m_pkthdr.len <= ipcompx->minlen) { + /* XXX-BZ V_ipcompstat.threshold++; */ + return ipsec_process_done(m, isr); + } + ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ hlen = IPCOMP_HLENGTH; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:58:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A696106568F; Mon, 4 Jan 2010 14:58:25 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3038FC2C; Mon, 4 Jan 2010 14:58:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04EwP3N091413; Mon, 4 Jan 2010 14:58:25 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EwPLD091411; Mon, 4 Jan 2010 14:58:25 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041458.o04EwPLD091411@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 14:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201503 - stable/6/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:58:25 -0000 Author: bz Date: Mon Jan 4 14:58:24 2010 New Revision: 201503 URL: http://svn.freebsd.org/changeset/base/201503 Log: MFC r199897: Remove whitespace. Modified: stable/6/sys/netipsec/xform_ipcomp.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 14:56:16 2010 (r201502) +++ stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 14:58:24 2010 (r201503) @@ -370,12 +370,12 @@ ipcomp_output( switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET case AF_INET: - maxpacketsize = IP_MAXPACKET; + maxpacketsize = IP_MAXPACKET; break; #endif /* INET */ #ifdef INET6 case AF_INET6: - maxpacketsize = IPV6_MAXPACKET; + maxpacketsize = IPV6_MAXPACKET; break; #endif /* INET6 */ default: @@ -575,7 +575,7 @@ ipcomp_output_cb(struct cryptop *crp) DPRINTF(("%s: unknown/unsupported protocol " "family %d, IPCA %s/%08lx\n", __func__, sav->sah->saidx.dst.sa.sa_family, - ipsec_address(&sav->sah->saidx.dst), + ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); error = EPFNOSUPPORT; goto bad; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 14:58:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7811065786; Mon, 4 Jan 2010 14:58:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD2D38FC17; Mon, 4 Jan 2010 14:58:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Ewfh2091521; Mon, 4 Jan 2010 14:58:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04EwfqN091519; Mon, 4 Jan 2010 14:58:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001041458.o04EwfqN091519@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 4 Jan 2010 14:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201504 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 14:58:42 -0000 Author: kib Date: Mon Jan 4 14:58:41 2010 New Revision: 201504 URL: http://svn.freebsd.org/changeset/base/201504 Log: PG_NOSYNC is called VPO_NOSYNC for long time. MFC after: 3 days Modified: head/share/man/man9/vm_page_bits.9 Modified: head/share/man/man9/vm_page_bits.9 ============================================================================== --- head/share/man/man9/vm_page_bits.9 Mon Jan 4 14:58:24 2010 (r201503) +++ head/share/man/man9/vm_page_bits.9 Mon Jan 4 14:58:41 2010 (r201504) @@ -94,7 +94,7 @@ is zero and .Fa size is one page, the modified bit in the page map is cleared; as well, the -.Dv PG_NOSYNC +.Dv VPO_NOSYNC flag is cleared. .Pp .Fn vm_page_clear_dirty From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:01:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E1D106566B; Mon, 4 Jan 2010 15:01:18 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B55E48FC1D; Mon, 4 Jan 2010 15:01:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04F1IpY092231; Mon, 4 Jan 2010 15:01:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04F1IqZ092229; Mon, 4 Jan 2010 15:01:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041501.o04F1IqZ092229@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 15:01:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201505 - stable/6/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:01:18 -0000 Author: bz Date: Mon Jan 4 15:01:18 2010 New Revision: 201505 URL: http://svn.freebsd.org/changeset/base/201505 Log: MFC r199899: Only add the IPcomp header if crypto reported success and we have a lower payload size. Before we had always added the header, no matter if we actually send out compressed data or not. With this, after the opencrypto/deflate changes, IPcomp starts to work apart from edge cases. Leave it disabled by default until those are fixed as well. PR: kern/123587 Modified: stable/6/sys/netipsec/xform_ipcomp.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 14:58:41 2010 (r201504) +++ stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 15:01:18 2010 (r201505) @@ -335,13 +335,10 @@ ipcomp_output( { struct secasvar *sav; struct comp_algo *ipcompx; - int error, ralen, hlen, maxpacketsize, roff; - u_int8_t prot; + int error, ralen, maxpacketsize; struct cryptodesc *crdc; struct cryptop *crp; struct tdb_crypto *tc; - struct mbuf *mo; - struct ipcomp *ipcomp; IPSEC_SPLASSERT_SOFTNET(__func__); @@ -362,8 +359,6 @@ ipcomp_output( } ralen = m->m_pkthdr.len - skip; /* Raw payload length before comp. */ - hlen = IPCOMP_HLENGTH; - ipcompstat.ipcomps_output++; /* Check for maximum packet size violations. */ @@ -388,13 +383,13 @@ ipcomp_output( error = EPFNOSUPPORT; goto bad; } - if (skip + hlen + ralen > maxpacketsize) { + if (ralen + skip + IPCOMP_HLENGTH > maxpacketsize) { ipcompstat.ipcomps_toobig++; DPRINTF(("%s: packet in IPCA %s/%08lx got too big " "(len %u, max len %u)\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi), - skip + hlen + ralen, maxpacketsize)); + ralen + skip + IPCOMP_HLENGTH, maxpacketsize)); error = EMSGSIZE; goto bad; } @@ -412,40 +407,7 @@ ipcomp_output( goto bad; } - /* Inject IPCOMP header */ - mo = m_makespace(m, skip, hlen, &roff); - if (mo == NULL) { - ipcompstat.ipcomps_wrap++; - DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", - __func__, ipsec_address(&sav->sah->saidx.dst), - (u_long) ntohl(sav->spi))); - error = ENOBUFS; - goto bad; - } - ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); - - /* Initialize the IPCOMP header */ - /* XXX alignment always correct? */ - switch (sav->sah->saidx.dst.sa.sa_family) { -#ifdef INET - case AF_INET: - ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; - break; -#endif /* INET */ -#ifdef INET6 - case AF_INET6: - ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; - break; -#endif - } - ipcomp->comp_flags = 0; - ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); - - /* Fix Next Protocol in IPv4/IPv6 header */ - prot = IPPROTO_IPCOMP; - m_copyback(m, protoff, sizeof(u_int8_t), (u_char *) &prot); - - /* Ok now, we can pass to the crypto processing */ + /* Ok now, we can pass to the crypto processing. */ /* Get crypto descriptors */ crp = crypto_getreq(1); @@ -458,10 +420,10 @@ ipcomp_output( crdc = crp->crp_desc; /* Compression descriptor */ - crdc->crd_skip = skip + hlen; - crdc->crd_len = m->m_pkthdr.len - (skip + hlen); + crdc->crd_skip = skip; + crdc->crd_len = ralen; crdc->crd_flags = CRD_F_COMP; - crdc->crd_inject = skip + hlen; + crdc->crd_inject = skip; /* Compression operation */ crdc->crd_alg = ipcompx->type; @@ -481,7 +443,8 @@ ipcomp_output( tc->tc_spi = sav->spi; tc->tc_dst = sav->sah->saidx.dst; tc->tc_proto = sav->sah->saidx.proto; - tc->tc_skip = skip + hlen; + tc->tc_protoff = protoff; + tc->tc_skip = skip; /* Crypto operation descriptor */ crp->crp_ilen = m->m_pkthdr.len; /* Total input length */ @@ -508,7 +471,7 @@ ipcomp_output_cb(struct cryptop *crp) struct ipsecrequest *isr; struct secasvar *sav; struct mbuf *m; - int error, skip, rlen; + int error, skip; NET_LOCK_GIANT(); @@ -516,7 +479,6 @@ ipcomp_output_cb(struct cryptop *crp) IPSEC_ASSERT(tc != NULL, ("null opaque data area!")); m = (struct mbuf *) crp->crp_buf; skip = tc->tc_skip; - rlen = crp->crp_ilen - skip; isr = tc->tc_isr; IPSECREQUEST_LOCK(isr); @@ -556,7 +518,46 @@ ipcomp_output_cb(struct cryptop *crp) } ipcompstat.ipcomps_hist[sav->alg_comp]++; - if (rlen > crp->crp_olen) { + if (crp->crp_ilen - skip > crp->crp_olen) { + struct mbuf *mo; + struct ipcomp *ipcomp; + int roff; + uint8_t prot; + + /* Compression helped, inject IPCOMP header. */ + mo = m_makespace(m, skip, IPCOMP_HLENGTH, &roff); + if (mo == NULL) { + ipcompstat.ipcomps_wrap++; + DPRINTF(("%s: IPCOMP header inject failed for IPCA %s/%08lx\n", + __func__, ipsec_address(&sav->sah->saidx.dst), + (u_long) ntohl(sav->spi))); + error = ENOBUFS; + goto bad; + } + ipcomp = (struct ipcomp *)(mtod(mo, caddr_t) + roff); + + /* Initialize the IPCOMP header */ + /* XXX alignment always correct? */ + switch (sav->sah->saidx.dst.sa.sa_family) { +#ifdef INET + case AF_INET: + ipcomp->comp_nxt = mtod(m, struct ip *)->ip_p; + break; +#endif /* INET */ +#ifdef INET6 + case AF_INET6: + ipcomp->comp_nxt = mtod(m, struct ip6_hdr *)->ip6_nxt; + break; +#endif + } + ipcomp->comp_flags = 0; + ipcomp->comp_cpi = htons((u_int16_t) ntohl(sav->spi)); + + /* Fix Next Protocol in IPv4/IPv6 header */ + prot = IPPROTO_IPCOMP; + m_copyback(m, tc->tc_protoff, sizeof(u_int8_t), + (u_char *)&prot); + /* Adjust the length in the IP header */ switch (sav->sah->saidx.dst.sa.sa_family) { #ifdef INET @@ -583,6 +584,8 @@ ipcomp_output_cb(struct cryptop *crp) } else { /* compression was useless, we have lost time */ /* XXX add statistic */ + /* XXX remember state to not compress the next couple + * of packets, RFC 3173, 2.2. Non-Expansion Policy */ } /* Release the crypto descriptor */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:03:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59371106566C; Mon, 4 Jan 2010 15:03:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474A18FC12; Mon, 4 Jan 2010 15:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04F3XeS092784; Mon, 4 Jan 2010 15:03:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04F3Xm7092782; Mon, 4 Jan 2010 15:03:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041503.o04F3Xm7092782@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 15:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201506 - stable/6/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:03:33 -0000 Author: bz Date: Mon Jan 4 15:03:33 2010 New Revision: 201506 URL: http://svn.freebsd.org/changeset/base/201506 Log: MFC r199905: Assimilate very similar input and output code paths (no real functional change). Modified: stable/6/sys/netipsec/xform_ipcomp.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 15:01:18 2010 (r201505) +++ stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 15:03:33 2010 (r201506) @@ -255,7 +255,6 @@ ipcomp_input_cb(struct cryptop *crp) NET_UNLOCK_GIANT(); return error; } - ipcompstat.ipcomps_noxform++; DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; @@ -493,7 +492,7 @@ ipcomp_output_cb(struct cryptop *crp) /* Check for crypto errors */ if (crp->crp_etype) { - /* Reset session ID */ + /* Reset the session ID */ if (sav->tdb_cryptoid != 0) sav->tdb_cryptoid = crp->crp_sid; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:05:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545741065692; Mon, 4 Jan 2010 15:05:12 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 413828FC0A; Mon, 4 Jan 2010 15:05:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04F5C7b093207; Mon, 4 Jan 2010 15:05:12 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04F5CuJ093205; Mon, 4 Jan 2010 15:05:12 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201001041505.o04F5CuJ093205@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 4 Jan 2010 15:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201507 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:05:12 -0000 Author: ume Date: Mon Jan 4 15:05:11 2010 New Revision: 201507 URL: http://svn.freebsd.org/changeset/base/201507 Log: MFC r200027: Teach an IPv6 to send_pkt() and ipfw_tick(). It fixes the issue which keep-alive doesn't work for an IPv6. Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 15:03:33 2010 (r201506) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 15:05:11 2010 (r201507) @@ -94,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET6 #include +#include #endif #include /* XXX for in_cksum */ @@ -251,6 +252,10 @@ static struct mtx ipfw_dyn_mtx; /* mute #define IPFW_DYN_UNLOCK() mtx_unlock(&ipfw_dyn_mtx) #define IPFW_DYN_LOCK_ASSERT() mtx_assert(&ipfw_dyn_mtx, MA_OWNED) +static struct mbuf *send_pkt(struct mbuf *, struct ipfw_flow_id *, + u_int32_t, u_int32_t, int); + + /* * Timeouts for various events in handing dynamic rules. */ @@ -710,60 +715,18 @@ send_reject6(struct ip_fw_args *args, in m = args->m; if (code == ICMP6_UNREACH_RST && args->f_id.proto == IPPROTO_TCP) { struct tcphdr *tcp; - tcp_seq ack, seq; - int flags; - struct { - struct ip6_hdr ip6; - struct tcphdr th; - } ti; tcp = (struct tcphdr *)((char *)ip6 + hlen); - if ((tcp->th_flags & TH_RST) != 0) { - m_freem(m); - args->m = NULL; - return; - } - - ti.ip6 = *ip6; - ti.th = *tcp; - ti.th.th_seq = ntohl(ti.th.th_seq); - ti.th.th_ack = ntohl(ti.th.th_ack); - ti.ip6.ip6_nxt = IPPROTO_TCP; - - if (ti.th.th_flags & TH_ACK) { - ack = 0; - seq = ti.th.th_ack; - flags = TH_RST; - } else { - ack = ti.th.th_seq; - if ((m->m_flags & M_PKTHDR) != 0) { - /* - * total new data to ACK is: - * total packet length, - * minus the header length, - * minus the tcp header length. - */ - ack += m->m_pkthdr.len - hlen - - (ti.th.th_off << 2); - } else if (ip6->ip6_plen) { - ack += ntohs(ip6->ip6_plen) + sizeof(*ip6) - - hlen - (ti.th.th_off << 2); - } else { - m_freem(m); - return; - } - if (tcp->th_flags & TH_SYN) - ack++; - seq = 0; - flags = TH_RST|TH_ACK; + if ((tcp->th_flags & TH_RST) == 0) { + struct mbuf *m0; + m0 = send_pkt(args->m, &(args->f_id), + ntohl(tcp->th_seq), ntohl(tcp->th_ack), + tcp->th_flags | TH_RST); + if (m0 != NULL) + ip6_output(m0, NULL, NULL, 0, NULL, NULL, + NULL); } - bcopy(&ti, ip6, sizeof(ti)); - /* - * m is only used to recycle the mbuf - * The data in it is never read so we don't need - * to correct the offsets or anything - */ - tcp_respond(NULL, ip6, tcp, m, ack, seq, flags); + m_freem(m); } else if (code != ICMP6_UNREACH_RST) { /* Send an ICMPv6 unreach. */ #if 0 /* @@ -1651,13 +1614,16 @@ send_pkt(struct mbuf *replyto, struct ip u_int32_t ack, int flags) { struct mbuf *m; - struct ip *ip; - struct tcphdr *tcp; + int len, dir; + struct ip *h = NULL; /* stupid compiler */ +#ifdef INET6 + struct ip6_hdr *h6 = NULL; +#endif + struct tcphdr *th = NULL; MGETHDR(m, M_DONTWAIT, MT_DATA); - if (m == 0) + if (m == NULL) return (NULL); - m->m_pkthdr.rcvif = (struct ifnet *)0; M_SETFIB(m, id->fib); #ifdef MAC @@ -1669,67 +1635,118 @@ send_pkt(struct mbuf *replyto, struct ip (void)replyto; /* don't warn about unused arg */ #endif - m->m_pkthdr.len = m->m_len = sizeof(struct ip) + sizeof(struct tcphdr); + switch (id->addr_type) { + case 4: + len = sizeof(struct ip) + sizeof(struct tcphdr); + break; +#ifdef INET6 + case 6: + len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + break; +#endif + default: + /* XXX: log me?!? */ + m_freem(m); + return (NULL); + } + dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN); + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + m->m_pkthdr.len = m->m_len = len; + m->m_pkthdr.rcvif = NULL; + bzero(m->m_data, len); + + switch (id->addr_type) { + case 4: + h = mtod(m, struct ip *); + + /* prepare for checksum */ + h->ip_p = IPPROTO_TCP; + h->ip_len = htons(sizeof(struct tcphdr)); + if (dir) { + h->ip_src.s_addr = htonl(id->src_ip); + h->ip_dst.s_addr = htonl(id->dst_ip); + } else { + h->ip_src.s_addr = htonl(id->dst_ip); + h->ip_dst.s_addr = htonl(id->src_ip); + } - ip = mtod(m, struct ip *); - bzero(ip, m->m_len); - tcp = (struct tcphdr *)(ip + 1); /* no IP options */ - ip->ip_p = IPPROTO_TCP; - tcp->th_off = 5; - /* - * Assume we are sending a RST (or a keepalive in the reverse - * direction), swap src and destination addresses and ports. - */ - ip->ip_src.s_addr = htonl(id->dst_ip); - ip->ip_dst.s_addr = htonl(id->src_ip); - tcp->th_sport = htons(id->dst_port); - tcp->th_dport = htons(id->src_port); - if (flags & TH_RST) { /* we are sending a RST */ + th = (struct tcphdr *)(h + 1); + break; +#ifdef INET6 + case 6: + h6 = mtod(m, struct ip6_hdr *); + + /* prepare for checksum */ + h6->ip6_nxt = IPPROTO_TCP; + h6->ip6_plen = htons(sizeof(struct tcphdr)); + if (dir) { + h6->ip6_src = id->src_ip6; + h6->ip6_dst = id->dst_ip6; + } else { + h6->ip6_src = id->dst_ip6; + h6->ip6_dst = id->src_ip6; + } + + th = (struct tcphdr *)(h6 + 1); + break; +#endif + } + + if (dir) { + th->th_sport = htons(id->src_port); + th->th_dport = htons(id->dst_port); + } else { + th->th_sport = htons(id->dst_port); + th->th_dport = htons(id->src_port); + } + th->th_off = sizeof(struct tcphdr) >> 2; + + if (flags & TH_RST) { if (flags & TH_ACK) { - tcp->th_seq = htonl(ack); - tcp->th_ack = htonl(0); - tcp->th_flags = TH_RST; + th->th_seq = htonl(ack); + th->th_flags = TH_RST; } else { if (flags & TH_SYN) seq++; - tcp->th_seq = htonl(0); - tcp->th_ack = htonl(seq); - tcp->th_flags = TH_RST | TH_ACK; + th->th_ack = htonl(seq); + th->th_flags = TH_RST | TH_ACK; } } else { /* - * We are sending a keepalive. flags & TH_SYN determines - * the direction, forward if set, reverse if clear. - * NOTE: seq and ack are always assumed to be correct - * as set by the caller. This may be confusing... + * Keepalive - use caller provided sequence numbers */ - if (flags & TH_SYN) { - /* - * we have to rewrite the correct addresses! - */ - ip->ip_dst.s_addr = htonl(id->dst_ip); - ip->ip_src.s_addr = htonl(id->src_ip); - tcp->th_dport = htons(id->dst_port); - tcp->th_sport = htons(id->src_port); - } - tcp->th_seq = htonl(seq); - tcp->th_ack = htonl(ack); - tcp->th_flags = TH_ACK; + th->th_seq = htonl(seq); + th->th_ack = htonl(ack); + th->th_flags = TH_ACK; + } + + switch (id->addr_type) { + case 4: + th->th_sum = in_cksum(m, len); + + /* finish the ip header */ + h->ip_v = 4; + h->ip_hl = sizeof(*h) >> 2; + h->ip_tos = IPTOS_LOWDELAY; + h->ip_off = 0; + h->ip_len = len; + h->ip_ttl = V_ip_defttl; + h->ip_sum = 0; + break; +#ifdef INET6 + case 6: + th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6), + sizeof(struct tcphdr)); + + /* finish the ip6 header */ + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_hlim = IPV6_DEFHLIM; + break; +#endif } - /* - * set ip_len to the payload size so we can compute - * the tcp checksum on the pseudoheader - * XXX check this, could save a couple of words ? - */ - ip->ip_len = htons(sizeof(struct tcphdr)); - tcp->th_sum = in_cksum(m, m->m_pkthdr.len); - /* - * now fill fields left out earlier - */ - ip->ip_ttl = V_ip_defttl; - ip->ip_len = m->m_pkthdr.len; - m->m_flags |= M_SKIP_FIREWALL; + return (m); } @@ -4529,13 +4546,16 @@ static void ipfw_tick(void * vnetx) { struct mbuf *m0, *m, *mnext, **mtailp; +#ifdef INET6 + struct mbuf *m6, **m6_tailp; +#endif int i; ipfw_dyn_rule *q; #ifdef VIMAGE struct vnet *vp = vnetx; #endif - CURVNET_SET(vp); + CURVNET_SET(vp); if (V_dyn_keepalive == 0 || V_ipfw_dyn_v == NULL || V_dyn_count == 0) goto done; @@ -4547,6 +4567,10 @@ ipfw_tick(void * vnetx) */ m0 = NULL; mtailp = &m0; +#ifdef INET6 + m6 = NULL; + m6_tailp = &m6; +#endif IPFW_DYN_LOCK(); for (i = 0 ; i < V_curr_dyn_buckets ; i++) { for (q = V_ipfw_dyn_v[i] ; q ; q = q->next ) { @@ -4562,14 +4586,37 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - *mtailp = send_pkt(NULL, &(q->id), q->ack_rev - 1, + m = send_pkt(NULL, &(q->id), q->ack_rev - 1, q->ack_fwd, TH_SYN); - if (*mtailp != NULL) - mtailp = &(*mtailp)->m_nextpkt; - *mtailp = send_pkt(NULL, &(q->id), q->ack_fwd - 1, + mnext = send_pkt(NULL, &(q->id), q->ack_fwd - 1, q->ack_rev, 0); - if (*mtailp != NULL) - mtailp = &(*mtailp)->m_nextpkt; + + switch (q->id.addr_type) { + case 4: + if (m != NULL) { + *mtailp = m; + mtailp = &(*mtailp)->m_nextpkt; + } + if (mnext != NULL) { + *mtailp = mnext; + mtailp = &(*mtailp)->m_nextpkt; + } + break; +#ifdef INET6 + case 6: + if (m != NULL) { + *m6_tailp = m; + m6_tailp = &(*m6_tailp)->m_nextpkt; + } + if (mnext != NULL) { + *m6_tailp = mnext; + m6_tailp = &(*m6_tailp)->m_nextpkt; + } + break; +#endif + } + + m = mnext = NULL; } } IPFW_DYN_UNLOCK(); @@ -4578,6 +4625,13 @@ ipfw_tick(void * vnetx) m->m_nextpkt = NULL; ip_output(m, NULL, NULL, 0, NULL, NULL); } +#ifdef INET6 + for (m = mnext = m6; m != NULL; m = mnext) { + mnext = m->m_nextpkt; + m->m_nextpkt = NULL; + ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); + } +#endif done: callout_reset(&V_ipfw_timeout, V_dyn_keepalive_period * hz, ipfw_tick, vnetx); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:05:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29D3106566C; Mon, 4 Jan 2010 15:05:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B06E38FC1C; Mon, 4 Jan 2010 15:05:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04F5b4V093342; Mon, 4 Jan 2010 15:05:37 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04F5bZC093340; Mon, 4 Jan 2010 15:05:37 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041505.o04F5bZC093340@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 15:05:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201508 - stable/6/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:05:37 -0000 Author: bz Date: Mon Jan 4 15:05:37 2010 New Revision: 201508 URL: http://svn.freebsd.org/changeset/base/201508 Log: MFC r199906: In case the compression result is the same size as the orignal version, the compression was useless as well. Make sure to not update the data and return, else we would waste resources when decompressing. This also avoids the copyback() changing data other consumers like xform_ipcomp.c would have ignored because of no win and sent out without noting that compression was used, resulting in invalid packets at the receiver. Modified: stable/6/sys/opencrypto/cryptosoft.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/6/sys/opencrypto/cryptosoft.c Mon Jan 4 15:05:11 2010 (r201507) +++ stable/6/sys/opencrypto/cryptosoft.c Mon Jan 4 15:05:37 2010 (r201508) @@ -539,7 +539,7 @@ swcr_compdec(struct cryptodesc *crd, str sw->sw_size = result; /* Check the compressed size when doing compression */ if (crd->crd_flags & CRD_F_COMP) { - if (result > crd->crd_len) { + if (result >= crd->crd_len) { /* Compression was useless, we lost time */ FREE(out, M_CRYPTO_DATA); return 0; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:22:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1169C1065670; Mon, 4 Jan 2010 15:22:39 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F25A68FC1F; Mon, 4 Jan 2010 15:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FMcon097218; Mon, 4 Jan 2010 15:22:38 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FMc97097216; Mon, 4 Jan 2010 15:22:38 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201001041522.o04FMc97097216@svn.freebsd.org> From: Hajimu UMEMOTO Date: Mon, 4 Jan 2010 15:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201509 - stable/8/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:22:39 -0000 Author: ume Date: Mon Jan 4 15:22:38 2010 New Revision: 201509 URL: http://svn.freebsd.org/changeset/base/201509 Log: MFC r200055, r200102: - Teach an IPv6 to the debug prints. - Use INET_ADDRSTRLEN and INET6_ADDRSTRLEN rather than hard coded number. Modified: stable/8/sys/netinet/ipfw/ip_fw2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 15:05:37 2010 (r201508) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 15:22:38 2010 (r201509) @@ -899,7 +899,11 @@ ipfw_log(struct ip_fw *f, u_int hlen, st } else { int len; - char src[48], dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif struct icmphdr *icmp; struct tcphdr *tcp; struct udphdr *udp; @@ -1050,6 +1054,32 @@ hash_packet(struct ipfw_flow_id *id) return i; } +static __inline void +unlink_dyn_rule_print(struct ipfw_flow_id *id) +{ + struct in_addr da; +#ifdef INET6 + char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) { + ip6_sprintf(src, &id->src_ip6); + ip6_sprintf(dst, &id->dst_ip6); + } else +#endif + { + da.s_addr = htonl(id->src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(id->dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", + src, id->src_port, dst, id->dst_port, V_dyn_count - 1); +} + /** * unlink a dynamic rule from a chain. prev is a pointer to * the previous one, q is a pointer to the rule to delete, @@ -1062,9 +1092,7 @@ hash_packet(struct ipfw_flow_id *id) /* remove a refcount to the parent */ \ if (q->dyn_type == O_LIMIT) \ q->parent->count--; \ - DEB(printf("ipfw: unlink entry 0x%08x %d -> 0x%08x %d, %d left\n",\ - (q->id.src_ip), (q->id.src_port), \ - (q->id.dst_ip), (q->id.dst_port), V_dyn_count-1 ); ) \ + DEB(unlink_dyn_rule_print(&q->id);) \ if (prev != NULL) \ prev->next = q = q->next; \ else \ @@ -1394,11 +1422,32 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ r->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = r; V_dyn_count++; - DEB(printf("ipfw: add dyn entry ty %d 0x%08x %d -> 0x%08x %d, total %d\n", - dyn_type, - (r->id.src_ip), (r->id.src_port), - (r->id.dst_ip), (r->id.dst_port), - V_dyn_count ); ) + DEB({ + struct in_addr da; +#ifdef INET6 + char src[INET6_ADDRSTRLEN]; + char dst[INET6_ADDRSTRLEN]; +#else + char src[INET_ADDRSTRLEN]; + char dst[INET_ADDRSTRLEN]; +#endif + +#ifdef INET6 + if (IS_IP6_FLOW_ID(&(r->id))) { + ip6_sprintf(src, &r->id.src_ip6); + ip6_sprintf(dst, &r->id.dst_ip6); + } else +#endif + { + da.s_addr = htonl(r->id.src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(r->id.dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: add dyn entry ty %d %s %d -> %s %d, total %d\n", + dyn_type, src, r->id.src_port, dst, r->id.dst_port, + V_dyn_count); + }) return r; } @@ -1455,20 +1504,37 @@ install_state(struct ip_fw *rule, ipfw_i static int last_log; ipfw_dyn_rule *q; struct in_addr da; - char src[48], dst[48]; +#ifdef INET6 + char src[INET6_ADDRSTRLEN + 2], dst[INET6_ADDRSTRLEN + 2]; +#else + char src[INET_ADDRSTRLEN], dst[INET_ADDRSTRLEN]; +#endif src[0] = '\0'; dst[0] = '\0'; + IPFW_DYN_LOCK(); + DEB( - printf("ipfw: %s: type %d 0x%08x %u -> 0x%08x %u\n", - __func__, cmd->o.opcode, - (args->f_id.src_ip), (args->f_id.src_port), - (args->f_id.dst_ip), (args->f_id.dst_port)); +#ifdef INET6 + if (IS_IP6_FLOW_ID(&(args->f_id))) { + ip6_sprintf(src, &args->f_id.src_ip6); + ip6_sprintf(dst, &args->f_id.dst_ip6); + } else +#endif + { + da.s_addr = htonl(args->f_id.src_ip); + inet_ntoa_r(da, src); + da.s_addr = htonl(args->f_id.dst_ip); + inet_ntoa_r(da, dst); + } + printf("ipfw: %s: type %d %s %u -> %s %u\n", + __func__, cmd->o.opcode, src, args->f_id.src_port, + dst, args->f_id.dst_port); + src[0] = '\0'; + dst[0] = '\0'; ) - IPFW_DYN_LOCK(); - q = lookup_dyn_rule_locked(&args->f_id, NULL, NULL); if (q != NULL) { /* should never occur */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:23:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B302A106568F; Mon, 4 Jan 2010 15:23:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A00E68FC12; Mon, 4 Jan 2010 15:23:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FNWYS097581; Mon, 4 Jan 2010 15:23:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FNWpX097578; Mon, 4 Jan 2010 15:23:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001041523.o04FNWpX097578@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 4 Jan 2010 15:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201510 - in stable/6: share/man/man4 sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:23:32 -0000 Author: bz Date: Mon Jan 4 15:23:32 2010 New Revision: 201510 URL: http://svn.freebsd.org/changeset/base/201510 Log: MFC r199947, 199950: Enable IPcomp by default. (Note that fast_ipsec.4 was changed, rather than ipsec.4.) PR: kern/123587 Modified: stable/6/share/man/man4/fast_ipsec.4 stable/6/sys/netipsec/xform_ipcomp.c Directory Properties: stable/6/share/man/man4/ (props changed) stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/share/man/man4/fast_ipsec.4 ============================================================================== --- stable/6/share/man/man4/fast_ipsec.4 Mon Jan 4 15:22:38 2010 (r201509) +++ stable/6/share/man/man4/fast_ipsec.4 Mon Jan 4 15:23:32 2010 (r201510) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 20, 2003 +.Dd November 29, 2009 .Dt FAST_IPSEC 4 .Os .Sh NAME @@ -112,7 +112,9 @@ There is presently no support for IPv6. .Pp The .Tn IPcomp -protocol support does not work. +protocol may occasionally error because of +.Xr zlib 3 +problems. .Pp Certain legacy authentication algorithms are not supported because of issues with the Modified: stable/6/sys/netipsec/xform_ipcomp.c ============================================================================== --- stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 15:22:38 2010 (r201509) +++ stable/6/sys/netipsec/xform_ipcomp.c Mon Jan 4 15:23:32 2010 (r201510) @@ -66,7 +66,7 @@ #include #include -int ipcomp_enable = 0; +int ipcomp_enable = 1; struct ipcompstat ipcompstat; SYSCTL_DECL(_net_inet_ipcomp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:34:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0627106566C; Mon, 4 Jan 2010 15:34:49 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD6308FC12; Mon, 4 Jan 2010 15:34:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FYngG001830; Mon, 4 Jan 2010 15:34:49 GMT (envelope-from gallatin@svn.freebsd.org) Received: (from gallatin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FYnQ0001828; Mon, 4 Jan 2010 15:34:49 GMT (envelope-from gallatin@svn.freebsd.org) Message-Id: <201001041534.o04FYnQ0001828@svn.freebsd.org> From: Andrew Gallatin Date: Mon, 4 Jan 2010 15:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201511 - stable/6/sys/dev/mxge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:34:49 -0000 Author: gallatin Date: Mon Jan 4 15:34:49 2010 New Revision: 201511 URL: http://svn.freebsd.org/changeset/base/201511 Log: MFC 200845: Don't take the driver mutex in mxge_tick(), as it is run with the mutex held. Modified: stable/6/sys/dev/mxge/if_mxge.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/6/sys/dev/mxge/if_mxge.c Mon Jan 4 15:23:32 2010 (r201510) +++ stable/6/sys/dev/mxge/if_mxge.c Mon Jan 4 15:34:49 2010 (r201511) @@ -3638,9 +3638,7 @@ mxge_tick(void *arg) uint16_t cmd; ticks = mxge_ticks; - mtx_lock(&sc->driver_mtx); running = sc->ifp->if_drv_flags & IFF_DRV_RUNNING; - mtx_unlock(&sc->driver_mtx); if (running) { /* aggregate stats from different slices */ pkts = mxge_update_stats(sc); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:40:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C3E21065670; Mon, 4 Jan 2010 15:40:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE84B8FC15; Mon, 4 Jan 2010 15:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FeHnN003849; Mon, 4 Jan 2010 15:40:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FeHfJ003840; Mon, 4 Jan 2010 15:40:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001041540.o04FeHfJ003840@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 4 Jan 2010 15:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201512 - in head: include lib/libc/gen usr.bin/catman usr.bin/makewhatis usr.sbin/lpr/common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:40:18 -0000 Author: kib Date: Mon Jan 4 15:40:17 2010 New Revision: 201512 URL: http://svn.freebsd.org/changeset/base/201512 Log: Modernize scandir(3) and alphasort(3) interfaces according to the IEEE Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks Modified: head/include/dirent.h head/lib/libc/gen/opendir.c head/lib/libc/gen/scandir.3 head/lib/libc/gen/scandir.c head/usr.bin/catman/catman.c head/usr.bin/makewhatis/makewhatis.c head/usr.sbin/lpr/common_source/lp.h head/usr.sbin/lpr/common_source/rmjob.c Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Mon Jan 4 15:34:49 2010 (r201511) +++ head/include/dirent.h Mon Jan 4 15:40:17 2010 (r201512) @@ -95,7 +95,7 @@ typedef void * DIR; __BEGIN_DECLS #if __BSD_VISIBLE DIR *__opendir2(const char *, int); -int alphasort(const void *, const void *); +int alphasort(const struct dirent **, const struct dirent **); int getdents(int, char *, int); int getdirentries(int, char *, int, long *); #endif @@ -109,7 +109,8 @@ int readdir_r(DIR *, struct dirent *, s void rewinddir(DIR *); #if __BSD_VISIBLE int scandir(const char *, struct dirent ***, - int (*)(struct dirent *), int (*)(const void *, const void *)); + int (*)(const struct dirent *), int (*)(const struct dirent **, + const struct dirent **)); #endif #if __XSI_VISIBLE void seekdir(DIR *, long); Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Mon Jan 4 15:34:49 2010 (r201511) +++ head/lib/libc/gen/opendir.c Mon Jan 4 15:40:17 2010 (r201512) @@ -240,7 +240,8 @@ __opendir_common(int fd, const char *nam /* * This sort must be stable. */ - mergesort(dpv, n, sizeof(*dpv), alphasort); + mergesort(dpv, n, sizeof(*dpv), (int (*)(const + void *, const void *))alphasort); dpv[n] = NULL; xp = NULL; Modified: head/lib/libc/gen/scandir.3 ============================================================================== --- head/lib/libc/gen/scandir.3 Mon Jan 4 15:34:49 2010 (r201511) +++ head/lib/libc/gen/scandir.3 Mon Jan 4 15:40:17 2010 (r201512) @@ -28,7 +28,7 @@ .\" @(#)scandir.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 3, 2010 .Dt SCANDIR 3 .Os .Sh NAME @@ -38,12 +38,11 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In dirent.h .Ft int -.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpstruct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst void *, const void *\\*(rp" +.Fn scandir "const char *dirname" "struct dirent ***namelist" "int \\*(lp*select\\*(rp\\*(lpconst struct dirent *\\*(rp" "int \\*(lp*compar\\*(rp\\*(lpconst struct dirent **, const struct dirent **\\*(rp" .Ft int -.Fn alphasort "const void *d1" "const void *d2" +.Fn alphasort "const struct dirent **d1" "const struct dirent **d2" .Sh DESCRIPTION The .Fn scandir Modified: head/lib/libc/gen/scandir.c ============================================================================== --- head/lib/libc/gen/scandir.c Mon Jan 4 15:34:49 2010 (r201511) +++ head/lib/libc/gen/scandir.c Mon Jan 4 15:40:17 2010 (r201512) @@ -58,11 +58,9 @@ __FBSDID("$FreeBSD$"); (((dp)->d_namlen + 1 + 3) &~ 3)) int -scandir(dirname, namelist, select, dcomp) - const char *dirname; - struct dirent ***namelist; - int (*select)(struct dirent *); - int (*dcomp)(const void *, const void *); +scandir(const char *dirname, struct dirent ***namelist, + int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, + const struct dirent **)) { struct dirent *d, *p, **names = NULL; size_t nitems = 0; @@ -111,26 +109,25 @@ scandir(dirname, namelist, select, dcomp } closedir(dirp); if (nitems && dcomp != NULL) - qsort(names, nitems, sizeof(struct dirent *), dcomp); + qsort(names, nitems, sizeof(struct dirent *), + (int (*)(const void *, const void *))dcomp); *namelist = names; - return(nitems); + return (nitems); fail: while (nitems > 0) free(names[--nitems]); free(names); closedir(dirp); - return -1; + return (-1); } /* * Alphabetic order comparison routine for those who want it. */ int -alphasort(d1, d2) - const void *d1; - const void *d2; +alphasort(const struct dirent **d1, const struct dirent **d2) { - return(strcmp((*(struct dirent **)d1)->d_name, - (*(struct dirent **)d2)->d_name)); + + return (strcmp((*d1)->d_name, (*d2)->d_name)); } Modified: head/usr.bin/catman/catman.c ============================================================================== --- head/usr.bin/catman/catman.c Mon Jan 4 15:34:49 2010 (r201511) +++ head/usr.bin/catman/catman.c Mon Jan 4 15:40:17 2010 (r201512) @@ -589,9 +589,15 @@ process_section(char *mandir, char *sect } static int -select_sections(struct dirent *entry) +select_sections(const struct dirent *entry) { - return directory_type(entry->d_name) == MAN_SECTION_DIR; + char *name; + int ret; + + name = strdup(entry->d_name); + ret = directory_type(name) == MAN_SECTION_DIR; + free(name); + return (ret); } /* Modified: head/usr.bin/makewhatis/makewhatis.c ============================================================================== --- head/usr.bin/makewhatis/makewhatis.c Mon Jan 4 15:34:49 2010 (r201511) +++ head/usr.bin/makewhatis/makewhatis.c Mon Jan 4 15:40:17 2010 (r201512) @@ -879,9 +879,9 @@ process_section(char *section_dir) * Returns whether the directory entry is a man page section. */ static int -select_sections(struct dirent *entry) +select_sections(const struct dirent *entry) { - char *p = &entry->d_name[3]; + const char *p = &entry->d_name[3]; if (strncmp(entry->d_name, "man", 3) != 0) return 0; Modified: head/usr.sbin/lpr/common_source/lp.h ============================================================================== --- head/usr.sbin/lpr/common_source/lp.h Mon Jan 4 15:34:49 2010 (r201511) +++ head/usr.sbin/lpr/common_source/lp.h Mon Jan 4 15:40:17 2010 (r201512) @@ -280,7 +280,7 @@ void inform(const struct printer *_pp, void init_printer(struct printer *_pp); void init_request(struct request *_rp); int inlist(char *_uname, char *_cfile); -int iscf(struct dirent *_d); +int iscf(const struct dirent *_d); void ldump(const char *_nfile, const char *_datafile, int _copies); void lastprinter(void); int lockchk(struct printer *_pp, char *_slockf); Modified: head/usr.sbin/lpr/common_source/rmjob.c ============================================================================== --- head/usr.sbin/lpr/common_source/rmjob.c Mon Jan 4 15:34:49 2010 (r201511) +++ head/usr.sbin/lpr/common_source/rmjob.c Mon Jan 4 15:40:17 2010 (r201512) @@ -384,7 +384,7 @@ rmremote(const struct printer *pp) * Return 1 if the filename begins with 'cf' */ int -iscf(struct dirent *d) +iscf(const struct dirent *d) { return(d->d_name[0] == 'c' && d->d_name[1] == 'f'); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:41:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D818D1065693; Mon, 4 Jan 2010 15:41:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64E48FC16; Mon, 4 Jan 2010 15:41:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FfGPm004256; Mon, 4 Jan 2010 15:41:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FfGWK004254; Mon, 4 Jan 2010 15:41:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001041541.o04FfGWK004254@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 4 Jan 2010 15:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201513 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:41:16 -0000 Author: kib Date: Mon Jan 4 15:41:16 2010 New Revision: 201513 URL: http://svn.freebsd.org/changeset/base/201513 Log: Bump __FreeBSD_version for scandir(3) and alphasort(3) prototype changes. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jan 4 15:40:17 2010 (r201512) +++ head/sys/sys/param.h Mon Jan 4 15:41:16 2010 (r201513) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900005 /* Master, propagated to newvers */ +#define __FreeBSD_version 900006 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:50:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 415BA106568B; Mon, 4 Jan 2010 15:50:42 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F6748FC0C; Mon, 4 Jan 2010 15:50:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Fog8o007671; Mon, 4 Jan 2010 15:50:42 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04FogAe007669; Mon, 4 Jan 2010 15:50:42 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201001041550.o04FogAe007669@svn.freebsd.org> From: Benedict Reuschling Date: Mon, 4 Jan 2010 15:50:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201514 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:50:42 -0000 Author: bcr (doc committer) Date: Mon Jan 4 15:50:41 2010 New Revision: 201514 URL: http://svn.freebsd.org/changeset/base/201514 Log: Now that I'm free from mentorship, it's only fair to document who my mentor was. Modified: head/share/misc/committers-doc.dot Modified: head/share/misc/committers-doc.dot ============================================================================== --- head/share/misc/committers-doc.dot Mon Jan 4 15:41:16 2010 (r201513) +++ head/share/misc/committers-doc.dot Mon Jan 4 15:50:41 2010 (r201514) @@ -35,6 +35,7 @@ node [color=lightblue2, style=filled, bg ache [label="Andrey Chernov\nache@FreeBSD.org\n1997/06/13"] ale [label="Alex Dupre\nale@FreeBSD.org\n2003/12/22"] +bcr [label="Benedict Reuschling\nbcr@FreeBSD.org\n2009/12/24"] blackend [label="Marc Fonvieille\nblackend@FreeBSD.org\n2002/06/16"] bmah [label="Bruce A. Mah\nbmah@FreeBSD.org\n2000/08/22"] brd [label="Brad Davis\nbrd@FreeBSD.org\n2005/06/01"] @@ -98,6 +99,7 @@ jesusr -> jcamou jim -> trhodes jkois -> miwi +jkois -> bcr keramida -> blackend keramida -> danger From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 15:58:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A492F106566B; Mon, 4 Jan 2010 15:58:36 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 914D08FC14; Mon, 4 Jan 2010 15:58:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04FwaZK010389; Mon, 4 Jan 2010 15:58:36 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Fwa57010387; Mon, 4 Jan 2010 15:58:36 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201001041558.o04Fwa57010387@svn.freebsd.org> From: Shteryana Shopova Date: Mon, 4 Jan 2010 15:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201515 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 15:58:36 -0000 Author: syrinx Date: Mon Jan 4 15:58:36 2010 New Revision: 201515 URL: http://svn.freebsd.org/changeset/base/201515 Log: MFC r201254: Make sure the multicast forwarding cache entry's stall queue is properly initialized before trying to insert an entry into it. PR: kern/142052 Reviewed by: bms Modified: stable/8/sys/netinet/ip_mroute.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/ip_mroute.c ============================================================================== --- stable/8/sys/netinet/ip_mroute.c Mon Jan 4 15:50:41 2010 (r201514) +++ stable/8/sys/netinet/ip_mroute.c Mon Jan 4 15:58:36 2010 (r201515) @@ -1384,6 +1384,15 @@ fail: rt->mfc_rp.s_addr = INADDR_ANY; rt->mfc_bw_meter = NULL; + /* initialize pkt counters per src-grp */ + rt->mfc_pkt_cnt = 0; + rt->mfc_byte_cnt = 0; + rt->mfc_wrong_if = 0; + timevalclear(&rt->mfc_last_assert); + + TAILQ_INIT(&rt->mfc_stall); + rt->mfc_nstall = 0; + /* link into table */ LIST_INSERT_HEAD(&mfchashtbl[hash], rt, mfc_hash); TAILQ_INSERT_HEAD(&rt->mfc_stall, rte, rte_link); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 17:29:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FF01065670; Mon, 4 Jan 2010 17:29:00 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F52C8FC1B; Mon, 4 Jan 2010 17:29:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04HT0AR030592; Mon, 4 Jan 2010 17:29:00 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04HT0wr030590; Mon, 4 Jan 2010 17:29:00 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001041729.o04HT0wr030590@svn.freebsd.org> From: Alan Cox Date: Mon, 4 Jan 2010 17:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201519 - stable/7/lib/libc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 17:29:00 -0000 Author: alc Date: Mon Jan 4 17:28:59 2010 New Revision: 201519 URL: http://svn.freebsd.org/changeset/base/201519 Log: MFC r197163 Add the FBSD_1.2 namespace. Discussed with: deischen Modified: stable/7/lib/libc/Versions.def Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/Versions.def ============================================================================== --- stable/7/lib/libc/Versions.def Mon Jan 4 17:05:16 2010 (r201518) +++ stable/7/lib/libc/Versions.def Mon Jan 4 17:28:59 2010 (r201519) @@ -1,5 +1,11 @@ # $FreeBSD$ +# +# Note: Whenever bumping the FBSD version, always make +# FBSDprivate_1.0 depend on the new FBSD version. +# This will keep it at the end of the dependency chain. +# + # This is our first version; it depends on no other. # This version was first added to 7.0-current. FBSD_1.0 { @@ -10,9 +16,13 @@ FBSD_1.0 { FBSD_1.1 { } FBSD_1.0; +# This version was first added to 9.0-current. +FBSD_1.2 { +} FBSD_1.1; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries # are listed here. We use a separate namespace so we can write # simple ABI-checking tools. FBSDprivate_1.0 { -} FBSD_1.0; +} FBSD_1.2; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 17:30:01 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4753910656F5; Mon, 4 Jan 2010 17:30:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id AD67C8FC14; Mon, 4 Jan 2010 17:30:00 +0000 (UTC) Received: from c220-239-235-55.carlnfd3.nsw.optusnet.com.au (c220-239-235-55.carlnfd3.nsw.optusnet.com.au [220.239.235.55]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o04HTtQj025591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 5 Jan 2010 04:29:58 +1100 Date: Tue, 5 Jan 2010 04:29:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Konstantin Belousov In-Reply-To: <201001041540.o04FeHfJ003840@svn.freebsd.org> Message-ID: <20100105033154.Y53261@delplex.bde.org> References: <201001041540.o04FeHfJ003840@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201512 - in head: include lib/libc/gen usr.bin/catman usr.bin/makewhatis usr.sbin/lpr/common_source X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 17:30:01 -0000 On Mon, 4 Jan 2010, Konstantin Belousov wrote: > Log: > Modernize scandir(3) and alphasort(3) interfaces according to the IEEE > Std 1003.1-2008. s/Modernize/Break. (I sent private mail about this, but too late.) The old interfaces were correct, since they were compatible with qsort(), unlike the new interfaces. The new interfaces can be used, but are just harder and/or slower to use correctly. That they are harder to use correctly is shown by their incorrect use (=> undefined behaviour) here. > Both Linux and Solaris conforms to the new definitions, > so we better follow too (older glibc used old BSDish alphasort prototype > and corresponding type of the comparision function for scandir). While > there, change the definitions of the functions to ANSI C and fix several > style issues nearby. Hopefully they won't remain broken. Linux seems to have been broken relatively. According to google and glibc-2.6 sources, some of the history of this bug is: - Linux libc4 and libc5 (pre glibc-2.0 (?)) had the "more precise" [i.e., broken] POSIX prototype. - glibc-2.0 reverted to the "less precise" [i.e., correct] BSD prototype. - glibc-2.3 from May 18 2007 has the BSD prototype - glibc was changed to have the POSIX prototype on Mar 16 2009. > POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, > but leave the strcmp(3) call in the function for now. ISTR a thread on the POSIX mailing list saying that strcoll() is unusable here. Directory entries may contain fairly raw bytes which might not be understood by strcoll(). > Adapt in-tree callers of scandir(3) to new declaration. The fact that > select_sections() from catman(1) could modify supplied struct dirent is > a bug. I don't see any bug here, except another one in the POSIX prototype. catman is allowed to modify its own dirents, and does so. This modification may even be required for its call to scandir() to work, and such modifications may even be useful for working around the strcoll() bug -- you could reasonably modify the names in the dirents to ensure that strcoll() can handle them. However, such modifications shouldn't be allowed by scandir(), especially for the comparison function (select_sections() is the select function). However2, scandir()'s new prototype doesn't say this -- it uses "const struct dirent **" where strict const'ness would require "struct dirent const * const *" (parse?). I think it does this for the same reason that the execve() and strtol() families leave out one `const' -- 2 'const' cause too many problems. With the old interface, there is necessarily only 1 `const', so type safety is incomplete in another (mostly less useful) way. > Modified: head/lib/libc/gen/scandir.c > ============================================================================== > --- head/lib/libc/gen/scandir.c Mon Jan 4 15:34:49 2010 (r201511) > +++ head/lib/libc/gen/scandir.c Mon Jan 4 15:40:17 2010 (r201512) > @@ -58,11 +58,9 @@ __FBSDID("$FreeBSD$"); > (((dp)->d_namlen + 1 + 3) &~ 3)) > > int > -scandir(dirname, namelist, select, dcomp) > - const char *dirname; > - struct dirent ***namelist; > - int (*select)(struct dirent *); > - int (*dcomp)(const void *, const void *); > +scandir(const char *dirname, struct dirent ***namelist, > + int (*select)(const struct dirent *), int (*dcomp)(const struct dirent **, > + const struct dirent **)) > { > struct dirent *d, *p, **names = NULL; > size_t nitems = 0; > @@ -111,26 +109,25 @@ scandir(dirname, namelist, select, dcomp > } > closedir(dirp); > if (nitems && dcomp != NULL) > - qsort(names, nitems, sizeof(struct dirent *), dcomp); > + qsort(names, nitems, sizeof(struct dirent *), > + (int (*)(const void *, const void *))dcomp); This bogus cast prevents detection of undefined behaviour. Casting dcomp to an `int (*)(const void *, const void *)' does not make it a function of that type. The old code was correct. > *namelist = names; > - return(nitems); > + return (nitems); > > fail: > while (nitems > 0) > free(names[--nitems]); > free(names); > closedir(dirp); > - return -1; > + return (-1); > } > > /* > * Alphabetic order comparison routine for those who want it. > */ > int > -alphasort(d1, d2) > - const void *d1; > - const void *d2; > +alphasort(const struct dirent **d1, const struct dirent **d2) Undefined behaviour results when this function is called (if dcomp = alphasort). qsort() can only know to call a function of type `int (*)(const void *, const void *)', and alphasort() doesn't have that type. > { > - return(strcmp((*(struct dirent **)d1)->d_name, > - (*(struct dirent **)d2)->d_name)); The weak type checking let it get away with no const's at all here. > + > + return (strcmp((*d1)->d_name, (*d2)->d_name)); Further undefined behaviour results when the parameters are accessed. The undefined behaviour can be avoided using a wrapper function. This would be ugly for scandir(), since dcomp() would have to be passed as a global. The wrapper function would convert from (const void *d1, const void *d2) (the parameters passed to a qsort() comparison function) to (struct dirent **d1, struct dirent **d2) (the parameters accepted by a broken POSIX comparison function), using essentially the same code as the old version of the above. But this is a stupid way to implement a qsort() comparision function -- both ways need to do the conversion on every call, but the broken way requires an extra function to do it, in a context where inlining is usually impossible. These conversions are usually simple but will require extra register or stack copying with the extra function call. > } Similar undefined behaviour has been fixed in a few utilities in FreeBSD. > Modified: head/usr.bin/catman/catman.c > ============================================================================== > --- head/usr.bin/catman/catman.c Mon Jan 4 15:34:49 2010 (r201511) > +++ head/usr.bin/catman/catman.c Mon Jan 4 15:40:17 2010 (r201512) > @@ -589,9 +589,15 @@ process_section(char *mandir, char *sect > } > > static int > -select_sections(struct dirent *entry) > +select_sections(const struct dirent *entry) > { > - return directory_type(entry->d_name) == MAN_SECTION_DIR; > + char *name; > + int ret; > + > + name = strdup(entry->d_name); > + ret = directory_type(name) == MAN_SECTION_DIR; > + free(name); > + return (ret); > } I think the modification is not needed, and also doesn't actually happen here (since directory names cannot contain slashes). Bruce From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:04:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4584B1065679; Mon, 4 Jan 2010 18:04:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3399B8FC14; Mon, 4 Jan 2010 18:04:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04I4bO7038526; Mon, 4 Jan 2010 18:04:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04I4bUw038524; Mon, 4 Jan 2010 18:04:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001041804.o04I4bUw038524@svn.freebsd.org> From: Xin LI Date: Mon, 4 Jan 2010 18:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201520 - head/usr.sbin/rtsold X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:04:37 -0000 Author: delphij Date: Mon Jan 4 18:04:36 2010 New Revision: 201520 URL: http://svn.freebsd.org/changeset/base/201520 Log: Test index value is within the range before using it to reference array member. PR: bin/141838 Submitted by: Henning Petersen MFC after: 2 weeks Modified: head/usr.sbin/rtsold/probe.c Modified: head/usr.sbin/rtsold/probe.c ============================================================================== --- head/usr.sbin/rtsold/probe.c Mon Jan 4 17:28:59 2010 (r201519) +++ head/usr.sbin/rtsold/probe.c Mon Jan 4 18:04:36 2010 (r201520) @@ -118,7 +118,7 @@ defrouter_probe(struct ifinfo *ifinfo) goto closeandend; } - for (i = 0; dr.defrouter[i].if_index && i < PRLSTSIZ; i++) { + for (i = 0; i < DRLSTSIZ && dr.defrouter[i].if_index; i++) { if (ifindex && dr.defrouter[i].if_index == ifindex) { /* sanity check */ if (!IN6_IS_ADDR_LINKLOCAL(&dr.defrouter[i].rtaddr)) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:08:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91A261065676; Mon, 4 Jan 2010 18:08:16 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 56B338FC17; Mon, 4 Jan 2010 18:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04I8Glx039359; Mon, 4 Jan 2010 18:08:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04I8GJ3039357; Mon, 4 Jan 2010 18:08:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001041808.o04I8GJ3039357@svn.freebsd.org> From: Ed Schouten Date: Mon, 4 Jan 2010 18:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201521 - head/usr.sbin/bootparamd/bootparamd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:08:16 -0000 Author: ed Date: Mon Jan 4 18:08:16 2010 New Revision: 201521 URL: http://svn.freebsd.org/changeset/base/201521 Log: Unbreak bootparamd when setting WITHOUT_NIS. Submitted by: bf1783 googlemail com Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.c Modified: head/usr.sbin/bootparamd/bootparamd/bootparamd.c ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/bootparamd.c Mon Jan 4 18:04:36 2010 (r201520) +++ head/usr.sbin/bootparamd/bootparamd/bootparamd.c Mon Jan 4 18:08:16 2010 (r201521) @@ -191,9 +191,9 @@ int blen; { FILE *bpf; char *where; +#ifdef YP static char *result; int resultlen; -#ifdef YP static char *yp_domain; #endif @@ -294,9 +294,9 @@ int len; int ch, pch; FILE *bpf; int res = 0; +#ifdef YP static char *result; int resultlen; -#ifdef YP static char *yp_domain; #endif From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:21:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3365910656A5; Mon, 4 Jan 2010 18:21:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21A3C8FC14; Mon, 4 Jan 2010 18:21:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04ILSsK042379; Mon, 4 Jan 2010 18:21:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04ILSMG042377; Mon, 4 Jan 2010 18:21:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001041821.o04ILSMG042377@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Jan 2010 18:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201522 - head/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:21:28 -0000 Author: jhb Date: Mon Jan 4 18:21:27 2010 New Revision: 201522 URL: http://svn.freebsd.org/changeset/base/201522 Log: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. MFC after: 1 week Modified: head/etc/defaults/devfs.rules Modified: head/etc/defaults/devfs.rules ============================================================================== --- head/etc/defaults/devfs.rules Mon Jan 4 18:08:16 2010 (r201521) +++ head/etc/defaults/devfs.rules Mon Jan 4 18:21:27 2010 (r201522) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path ptmx unhide add path pts unhide add path 'pts/*' unhide From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:25:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9123A1065672; Mon, 4 Jan 2010 18:25:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7338FC0A; Mon, 4 Jan 2010 18:25:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04IPcrO043349; Mon, 4 Jan 2010 18:25:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04IPcXb043347; Mon, 4 Jan 2010 18:25:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201001041825.o04IPcXb043347@svn.freebsd.org> From: Michael Tuexen Date: Mon, 4 Jan 2010 18:25:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201523 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:25:38 -0000 Author: tuexen Date: Mon Jan 4 18:25:38 2010 New Revision: 201523 URL: http://svn.freebsd.org/changeset/base/201523 Log: Correct usage of parenthesis. PR: kern/142066 Approved by: rrs (mentor) Obtained from: Henning Petersen, Bruce Cran. MFC after: 2 weeks Modified: head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Mon Jan 4 18:21:27 2010 (r201522) +++ head/sys/netinet/sctp_pcb.c Mon Jan 4 18:25:38 2010 (r201523) @@ -5528,7 +5528,7 @@ sctp_pcb_init() /* Init the TIMEWAIT list */ for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { - LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); + LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } #if defined(SCTP_USE_THREAD_BASED_ITERATOR) @@ -6385,7 +6385,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp } skip_vtag_check: - chain = &SCTP_BASE_INFO(vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE))]; + chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; /* Now what about timed wait ? */ if (!LIST_EMPTY(chain)) { /* From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:46:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31ADF1065670; Mon, 4 Jan 2010 18:46:55 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210FC8FC33; Mon, 4 Jan 2010 18:46:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04IktIN048100; Mon, 4 Jan 2010 18:46:55 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04IktvK048098; Mon, 4 Jan 2010 18:46:55 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001041846.o04IktvK048098@svn.freebsd.org> From: Ed Schouten Date: Mon, 4 Jan 2010 18:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201525 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:46:55 -0000 Author: ed Date: Mon Jan 4 18:46:54 2010 New Revision: 201525 URL: http://svn.freebsd.org/changeset/base/201525 Log: This should read #if __BSD_VISIBLE instead of #ifdef __BSD_VISIBLE. Modified: head/include/strings.h Modified: head/include/strings.h ============================================================================== --- head/include/strings.h Mon Jan 4 18:31:39 2010 (r201524) +++ head/include/strings.h Mon Jan 4 18:46:54 2010 (r201525) @@ -46,7 +46,7 @@ void bzero(void *, size_t); /* LEGA #if __XSI_VISIBLE int ffs(int) __pure2; #endif -#ifdef __BSD_VISIBLE +#if __BSD_VISIBLE int ffsl(long) __pure2; int ffsll(long long) __pure2; int fls(int) __pure2; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:52:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E06C010656A3; Mon, 4 Jan 2010 18:52:29 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id A03B68FC2A; Mon, 4 Jan 2010 18:52:29 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 9C00D7310A; Mon, 4 Jan 2010 20:00:24 +0100 (CET) Date: Mon, 4 Jan 2010 20:00:24 +0100 From: Luigi Rizzo To: Michael Tuexen Message-ID: <20100104190024.GA47532@onelab2.iet.unipi.it> References: <201001041825.o04IPcXb043347@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001041825.o04IPcXb043347@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:52:30 -0000 taking a random commit to this tree -- would you guys consider moving the sctp sources to its own directory, e.g. netinet/sctp/ or something that suits better ? It would help to browse through the directory: NAME FILES LINES netinet/ 156 153k sctp* 36 66k tcp* 24 16k ipfw/ 9 9k I understand that some of the headers should remain in netinet/ but surely the code is not bound to a specific place... cheers luigi On Mon, Jan 04, 2010 at 06:25:38PM +0000, Michael Tuexen wrote: > Author: tuexen > Date: Mon Jan 4 18:25:38 2010 > New Revision: 201523 > URL: http://svn.freebsd.org/changeset/base/201523 > > Log: > Correct usage of parenthesis. > > PR: kern/142066 > Approved by: rrs (mentor) > Obtained from: Henning Petersen, Bruce Cran. > MFC after: 2 weeks > > Modified: > head/sys/netinet/sctp_pcb.c > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Mon Jan 4 18:21:27 2010 (r201522) > +++ head/sys/netinet/sctp_pcb.c Mon Jan 4 18:25:38 2010 (r201523) > @@ -5528,7 +5528,7 @@ sctp_pcb_init() > > /* Init the TIMEWAIT list */ > for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { > - LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); > + LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); > } > > #if defined(SCTP_USE_THREAD_BASED_ITERATOR) > @@ -6385,7 +6385,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp > } > skip_vtag_check: > > - chain = &SCTP_BASE_INFO(vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE))]; > + chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; > /* Now what about timed wait ? */ > if (!LIST_EMPTY(chain)) { > /* From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 18:57:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6B701065672; Mon, 4 Jan 2010 18:57:22 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B160B8FC15; Mon, 4 Jan 2010 18:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04IvMwX050503; Mon, 4 Jan 2010 18:57:22 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04IvMUG050479; Mon, 4 Jan 2010 18:57:22 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201001041857.o04IvMUG050479@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 4 Jan 2010 18:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201526 - in head: tools/regression/usr.bin/make tools/regression/usr.bin/make/sysmk tools/regression/usr.bin/make/sysmk/t0 tools/regression/usr.bin/make/sysmk/t0/2 tools/regression/usr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 18:57:22 -0000 Author: obrien Date: Mon Jan 4 18:57:22 2010 New Revision: 201526 URL: http://svn.freebsd.org/changeset/base/201526 Log: Add ability to search up the directory hierarchy for the system directory. Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable. Reviewed by: Obtained from: NetBSD (+ embellishment by me, sent back to NetBSD) Added: head/tools/regression/usr.bin/make/sysmk/ head/tools/regression/usr.bin/make/sysmk/t0/ head/tools/regression/usr.bin/make/sysmk/t0/2/ head/tools/regression/usr.bin/make/sysmk/t0/2/1/ head/tools/regression/usr.bin/make/sysmk/t0/2/1/Makefile (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t0/2/1/test.t (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t0/mk/ head/tools/regression/usr.bin/make/sysmk/t0/mk/sys.mk (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/ head/tools/regression/usr.bin/make/sysmk/t1/2/ head/tools/regression/usr.bin/make/sysmk/t1/2/1/ head/tools/regression/usr.bin/make/sysmk/t1/2/1/cleanup (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/2/1/test.t (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t1/mk/ head/tools/regression/usr.bin/make/sysmk/t1/mk/sys.mk (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/ head/tools/regression/usr.bin/make/sysmk/t2/2/ head/tools/regression/usr.bin/make/sysmk/t2/2/1/ head/tools/regression/usr.bin/make/sysmk/t2/2/1/cleanup (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.status.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.stderr.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.stdout.1 (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/2/1/test.t (contents, props changed) head/tools/regression/usr.bin/make/sysmk/t2/mk/ head/tools/regression/usr.bin/make/sysmk/t2/mk/sys.mk (contents, props changed) Modified: head/tools/regression/usr.bin/make/common.sh head/usr.bin/make/dir.c head/usr.bin/make/dir.h head/usr.bin/make/main.c head/usr.bin/make/make.1 Modified: head/tools/regression/usr.bin/make/common.sh ============================================================================== --- head/tools/regression/usr.bin/make/common.sh Mon Jan 4 18:46:54 2010 (r201525) +++ head/tools/regression/usr.bin/make/common.sh Mon Jan 4 18:57:22 2010 (r201526) @@ -233,6 +233,12 @@ reset_test() # eval_clean() { + # + # If you have special cleaning needs, provide a 'cleanup' shell script. + # + if [ -n "${TEST_CLEANUP}" ] ; then + . ${SRC_DIR}/cleanup + fi rm -rf ${WORK_DIR} rm -rf ${OUTPUT_DIR} } Added: head/tools/regression/usr.bin/make/sysmk/t0/2/1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t0/2/1/Makefile Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,6 @@ +# $FreeBSD$ +# +# Can we traverse up to / and find a 'mk/sys.mk'? +# +all: + @echo ${DASH_M_DOTDOTDOT} Added: head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.status.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.status.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.stderr.1 ============================================================================== Added: head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.stdout.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t0/2/1/expected.stdout.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +Found_DotDotDot_sys_mk Added: head/tools/regression/usr.bin/make/sysmk/t0/2/1/test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t0/2/1/test.t Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,17 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../../../common.sh + +# Description +DESC="Can we traverse up to / and find a 'mk/sys.mk'?" + +# Run +TEST_N=1 +TEST_1="-m .../mk" +TEST_MAKE_DIRS="../../mk 755" +TEST_COPY_FILES="../../mk/sys.mk 644" + +eval_cmd $* Added: head/tools/regression/usr.bin/make/sysmk/t0/mk/sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t0/mk/sys.mk Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +DASH_M_DOTDOTDOT=Found_DotDotDot_sys_mk Added: head/tools/regression/usr.bin/make/sysmk/t1/2/1/cleanup ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t1/2/1/cleanup Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +rm -rf ${WORK_DIR}/../../../t0/2/1 Added: head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.status.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.status.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.stderr.1 ============================================================================== Added: head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.stdout.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t1/2/1/expected.stdout.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +Found_DotDotDot_sys_mk Added: head/tools/regression/usr.bin/make/sysmk/t1/2/1/test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t1/2/1/test.t Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,19 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../../../common.sh + +# Description +DESC="Can we traverse up to / and find a 'mk/sys.mk' with -C -m?" + +# Run +TEST_N=1 +TEST_1="-C ../../../t0/2/1 -m .../mk" +TEST_MAKE_DIRS="../../mk 755 ../../../t0/mk 755 ../../../t0/2/1 755" +TEST_COPY_FILES="../../mk/sys.mk 644 ../../../t0/mk/sys.mk 644 ../../../t0/2/1/Makefile 644" +TEST_CLEAN_FILES="../../../t0/2/1" +TEST_CLEANUP=clean-special + +eval_cmd $* Added: head/tools/regression/usr.bin/make/sysmk/t1/mk/sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t1/mk/sys.mk Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +DASH_M_DOTDOTDOT=Found_WRONG_DotDotDot_sys_mk__with_C_before_m Added: head/tools/regression/usr.bin/make/sysmk/t2/2/1/cleanup ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t2/2/1/cleanup Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +rm -rf ${WORK_DIR}/../../../t0/2/1 Added: head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.status.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.status.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +0 Added: head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.stderr.1 ============================================================================== Added: head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.stdout.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t2/2/1/expected.stdout.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1 @@ +Found_DotDotDot_sys_mk__with_m_before_C Added: head/tools/regression/usr.bin/make/sysmk/t2/2/1/test.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t2/2/1/test.t Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,19 @@ +#!/bin/sh + +# $FreeBSD$ + +cd `dirname $0` +. ../../../../common.sh + +# Description +DESC="Can we traverse up to / and find a 'mk/sys.mk' with -m -C?" + +# Run +TEST_N=1 +TEST_1="-m .../mk -C ../../../t0/2/1" +TEST_MAKE_DIRS="../../mk 755 ../../../t0/mk 755 ../../../t0/2/1 755" +TEST_COPY_FILES="../../mk/sys.mk 644 ../../../t0/mk/sys.mk 644 ../../../t0/2/1/Makefile 644" +TEST_CLEAN_FILES="../../../t0/2/1" +TEST_CLEANUP=clean-special + +eval_cmd $* Added: head/tools/regression/usr.bin/make/sysmk/t2/mk/sys.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/usr.bin/make/sysmk/t2/mk/sys.mk Mon Jan 4 18:57:22 2010 (r201526) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +DASH_M_DOTDOTDOT=Found_DotDotDot_sys_mk__with_m_before_C Modified: head/usr.bin/make/dir.c ============================================================================== --- head/usr.bin/make/dir.c Mon Jan 4 18:46:54 2010 (r201525) +++ head/usr.bin/make/dir.c Mon Jan 4 18:57:22 2010 (r201526) @@ -61,6 +61,10 @@ __FBSDID("$FreeBSD$"); * If it exists, the entire path is returned. * Otherwise NULL is returned. * + * Dir_FindHereOrAbove Search for a path in the current directory and + * then all the directories above it in turn until + * the path is found or we reach the root ("/"). + * * Dir_MTime Return the modification time of a node. The file * is searched for along the default search path. * The path and mtime fields of the node are filled in. @@ -83,7 +87,7 @@ __FBSDID("$FreeBSD$"); * Dir_PrintDirectories Print stats about the directory cache. */ -#include +#include #include #include #include @@ -851,6 +855,83 @@ Path_FindFile(char *name, struct Path *p /*- *----------------------------------------------------------------------- + * Dir_FindHereOrAbove -- + * search for a path starting at a given directory and then working + * our way up towards the root. + * + * Input: + * here starting directory + * search_path the path we are looking for + * result the result of a successful search is placed here + * rlen the length of the result buffer + * (typically MAXPATHLEN + 1) + * + * Results: + * 0 on failure, 1 on success [in which case the found path is put + * in the result buffer]. + * + * Side Effects: + *----------------------------------------------------------------------- + */ +int +Dir_FindHereOrAbove(char *here, char *search_path, char *result, int rlen) +{ + struct stat st; + char dirbase[MAXPATHLEN + 1], *db_end; + char try[MAXPATHLEN + 1], *try_end; + + /* copy out our starting point */ + snprintf(dirbase, sizeof(dirbase), "%s", here); + db_end = dirbase + strlen(dirbase); + + /* loop until we determine a result */ + while (1) { + /* try and stat(2) it ... */ + snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); + if (stat(try, &st) != -1) { + /* + * Success! If we found a file, chop off + * the filename so we return a directory. + */ + if ((st.st_mode & S_IFMT) != S_IFDIR) { + try_end = try + strlen(try); + while (try_end > try && *try_end != '/') + try_end--; + if (try_end > try) + *try_end = 0; /* chop! */ + } + + /* + * Done! + */ + snprintf(result, rlen, "%s", try); + return(1); + } + + /* + * Nope, we didn't find it. If we used up dirbase we've + * reached the root and failed. + */ + if (db_end == dirbase) + break; /* Failed! */ + + /* + * truncate dirbase from the end to move up a dir + */ + while (db_end > dirbase && *db_end != '/') + db_end--; + *db_end = 0; /* chop! */ + + } /* while (1) */ + + /* + * We failed... + */ + return(0); +} + +/*- + *----------------------------------------------------------------------- * Dir_MTime -- * Find the modification time of the file described by gn along the * search path dirSearchPath. Modified: head/usr.bin/make/dir.h ============================================================================== --- head/usr.bin/make/dir.h Mon Jan 4 18:46:54 2010 (r201525) +++ head/usr.bin/make/dir.h Mon Jan 4 18:57:22 2010 (r201526) @@ -56,6 +56,7 @@ TAILQ_HEAD(Path, PathElement); void Dir_Init(void); void Dir_InitDot(void); Boolean Dir_HasWildcards(const char *); +int Dir_FindHereOrAbove(char *, char *, char *, int); int Dir_MTime(struct GNode *); void Dir_PrintDirectories(void); Modified: head/usr.bin/make/main.c ============================================================================== --- head/usr.bin/make/main.c Mon Jan 4 18:46:54 2010 (r201525) +++ head/usr.bin/make/main.c Mon Jan 4 18:57:22 2010 (r201526) @@ -368,6 +368,7 @@ MainParseArgs(int argc, char **argv) { int c; Boolean found_dd = FALSE; + char found_dir[MAXPATHLEN + 1]; /* for searching for sys.mk */ rearg: optind = 1; /* since we're called more than once */ @@ -394,6 +395,8 @@ rearg: case 'C': if (chdir(optarg) == -1) err(1, "chdir %s", optarg); + if (getcwd(curdir, MAXPATHLEN) == NULL) + err(2, NULL); break; case 'D': Var_SetGlobal(optarg, "1"); @@ -492,7 +495,15 @@ rearg: MFLAGS_append("-k", NULL); break; case 'm': - Path_AddDir(&sysIncPath, optarg); + /* look for magic parent directory search string */ + if (strncmp(".../", optarg, 4) == 0) { + if (!Dir_FindHereOrAbove(curdir, optarg + 4, + found_dir, sizeof(found_dir))) + break; /* nothing doing */ + Path_AddDir(&sysIncPath, found_dir); + } else { + Path_AddDir(&sysIncPath, optarg); + } MFLAGS_append("-m", optarg); break; case 'n': @@ -869,6 +880,7 @@ main(int argc, char **argv) char mdpath[MAXPATHLEN]; char obpath[MAXPATHLEN]; char cdpath[MAXPATHLEN]; + char found_dir[MAXPATHLEN + 1]; /* for searching for sys.mk */ char *cp = NULL, *start; save_argv = argv; @@ -1022,6 +1034,12 @@ main(int argc, char **argv) Job_SetPrefix(); /* + * Find where we are... + */ + if (getcwd(curdir, MAXPATHLEN) == NULL) + err(2, NULL); + + /* * First snag things out of the MAKEFLAGS environment * variable. Then parse the command line arguments. */ @@ -1030,11 +1048,8 @@ main(int argc, char **argv) MainParseArgs(argc, argv); /* - * Find where we are... + * Verify that cwd is sane (after -C may have changed it). */ - if (getcwd(curdir, MAXPATHLEN) == NULL) - err(2, NULL); - { struct stat sa; @@ -1132,18 +1147,37 @@ main(int argc, char **argv) * as dir1:...:dirn) to the system include path. */ if (TAILQ_EMPTY(&sysIncPath)) { - char syspath[] = PATH_DEFSYSPATH; + char defsyspath[] = PATH_DEFSYSPATH; + char *syspath = getenv("MAKESYSPATH"); + + /* + * If no user-supplied system path was given (thru -m option) + * add the directories from the DEFSYSPATH (more than one may + * be given as dir1:...:dirn) to the system include path. + */ + if (syspath == NULL || *syspath == '\0') + syspath = defsyspath; + else + syspath = estrdup(syspath); for (start = syspath; *start != '\0'; start = cp) { for (cp = start; *cp != '\0' && *cp != ':'; cp++) continue; - if (*cp == '\0') { - Path_AddDir(&sysIncPath, start); - } else { + if (*cp == ':') { *cp++ = '\0'; + } + /* look for magic parent directory search string */ + if (strncmp(".../", start, 4) == 0) { + if (Dir_FindHereOrAbove(curdir, start + 4, + found_dir, sizeof(found_dir))) { + Path_AddDir(&sysIncPath, found_dir); + } + } else { Path_AddDir(&sysIncPath, start); } } + if (syspath != defsyspath) + free(syspath); } /* Modified: head/usr.bin/make/make.1 ============================================================================== --- head/usr.bin/make/make.1 Mon Jan 4 18:46:54 2010 (r201525) +++ head/usr.bin/make/make.1 Mon Jan 4 18:57:22 2010 (r201526) @@ -240,6 +240,36 @@ The system include path will always be a for "..."-style inclusions and makefile searches (see the .Fl I option). +.Pp +If a file or directory name in the +.Fl m +argument (or the +.Ev MAKESYSPATH +environment variable) starts with the string +.Qq \&.../ +then +.Nm +will search for the specified file or directory named in the remaining part +of the argument string. +The search starts with the current directory of the Makefile and then works +upward towards the root of the filesystem. +If the search is successful, +then the resulting directory replaces the +.Qq \&.../ +specification in the +.Fl m +argument. +If used, this feature allows +.Nm +to easily search in the current source tree for customized sys.mk files +(e.g. by using +.Qq \&.../mk/sys.mk +as an argument). +Note that a +.Fl C +that are earlier on the command line affect where +.Fl m Qq \&.../ +searches. .It Fl n Display the commands that would have been executed, but do not actually execute them. @@ -1665,8 +1695,9 @@ utility uses the following environment v .Ev MAKE , .Ev MAKEFLAGS , .Ev MAKEOBJDIR , +.Ev MAKEOBJDIRPREFIX , and -.Ev MAKEOBJDIRPREFIX . +.Ev MAKESYSPATH . .Sh FILES .Bl -tag -width /usr/share/doc/psd/12.make -compact .It Pa .depend From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:01:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A0661065697; Mon, 4 Jan 2010 19:01:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 675458FC0C; Mon, 4 Jan 2010 19:01:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04J1M0J051453; Mon, 4 Jan 2010 19:01:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04J1MdD051439; Mon, 4 Jan 2010 19:01:22 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001041901.o04J1MdD051439@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 4 Jan 2010 19:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201527 - in head/sys: net netgraph netinet netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:01:22 -0000 Author: luigi Date: Mon Jan 4 19:01:22 2010 New Revision: 201527 URL: http://svn.freebsd.org/changeset/base/201527 Log: Various cleanup done in ipfw3-head branch including: - use a uniform mtag format for all packets that exit and re-enter the firewall in the middle of a rulechain. On reentry, all tags containing reinject info are renamed to MTAG_IPFW_RULE so the processing is simpler. - make ipfw and dummynet use ip_len and ip_off in network format everywhere. Conversion is done only once instead of tracking the format in every place. - use a macro FREE_PKT to dispose of mbufs. This eases portability. On passing i also removed a few typos, staticise or localise variables, remove useless declarations and other minor things. Overall the code shrinks a bit and is hopefully more readable. I have tested functionality for all but ng_ipfw and if_bridge/if_ethersubr. For ng_ipfw i am actually waiting for feedback from glebius@ because we might have some small changes to make. For if_bridge and if_ethersubr feedback would be welcome (there are still some redundant parts in these two modules that I would like to remove, but first i need to check functionality). Modified: head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c head/sys/netgraph/ng_ipfw.c head/sys/netinet/ip_divert.c head/sys/netinet/ip_divert.h head/sys/netinet/ip_dummynet.h head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_nat.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/net/if_bridge.c Mon Jan 4 19:01:22 2010 (r201527) @@ -3040,25 +3040,26 @@ bridge_pfil(struct mbuf **mp, struct ifn } /* XXX this section is also in if_ethersubr.c */ - if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && dir == PFIL_OUT && ifp != NULL) { + // XXX PFIL_OUT or DIR_OUT ? + if (V_ip_fw_chk_ptr && pfil_ipfw != 0 && + dir == PFIL_OUT && ifp != NULL) { struct m_tag *mtag; error = -1; - mtag = m_tag_find(*mp, PACKET_TAG_DUMMYNET, NULL); + /* fetch the start point from existing tags, if any */ + mtag = m_tag_locate(*mp, MTAG_IPFW_RULE, 0, NULL); if (mtag == NULL) { - args.slot = 0; + args.rule.slot = 0; } else { struct dn_pkt_tag *dn_tag; + /* XXX can we free the tag after use ? */ mtag->m_tag_id = PACKET_TAG_NONE; dn_tag = (struct dn_pkt_tag *)(mtag + 1); - if (dn_tag->slot != 0 && V_fw_one_pass) - /* packet already partially processed */ + /* packet already partially processed ? */ + if (dn_tag->rule.slot != 0 && V_fw_one_pass) goto ipfwpass; - args.slot = dn_tag->slot; /* next rule to use */ - args.chain_id = dn_tag->chain_id; - args.rulenum = dn_tag->rulenum; - args.rule_id = dn_tag->rule_id; + args.rule = dn_tag->rule; } args.m = *mp; Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/net/if_ethersubr.c Mon Jan 4 19:01:22 2010 (r201527) @@ -469,21 +469,20 @@ ether_ipfw_chk(struct mbuf **m0, struct struct ip_fw_args args; struct m_tag *mtag; - mtag = m_tag_find(*m0, PACKET_TAG_DUMMYNET, NULL); + /* fetch start point from rule, if any */ + mtag = m_tag_locate(*m0, MTAG_IPFW_RULE, 0, NULL); if (mtag == NULL) { - args.slot = 0; + args.rule.slot = 0; } else { struct dn_pkt_tag *dn_tag; + /* XXX can we free it after use ? */ mtag->m_tag_id = PACKET_TAG_NONE; dn_tag = (struct dn_pkt_tag *)(mtag + 1); - if (dn_tag->slot != 0 && V_fw_one_pass) + if (dn_tag->rule.slot != 0 && V_fw_one_pass) /* dummynet packet, already partially processed */ return (1); - args.slot = dn_tag->slot; /* matching rule to restart */ - args.rulenum = dn_tag->rulenum; - args.rule_id = dn_tag->rule_id; - args.chain_id = dn_tag->chain_id; + args.rule = dn_tag->rule; } /* Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netgraph/ng_ipfw.c Mon Jan 4 19:01:22 2010 (r201527) @@ -221,21 +221,23 @@ ng_ipfw_findhook1(node_p node, u_int16_t static int ng_ipfw_rcvdata(hook_p hook, item_p item) { - struct ng_ipfw_tag *ngit; + struct ipfw_rule_ref *tag; struct mbuf *m; NGI_GET_M(item, m); NG_FREE_ITEM(item); - if ((ngit = (struct ng_ipfw_tag *)m_tag_locate(m, NGM_IPFW_COOKIE, 0, - NULL)) == NULL) { + tag = (struct ipfw_rule_ref *) + m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); + if (tag == NULL) { NG_FREE_M(m); return (EINVAL); /* XXX: find smth better */ }; - switch (ngit->dir) { - case DIR_OUT: - { + if (tag->info & IPFW_INFO_IN) { + ip_input(m); + return (0); + } else { struct ip *ip; if (m->m_len < sizeof(struct ip) && @@ -244,27 +246,16 @@ ng_ipfw_rcvdata(hook_p hook, item_p item ip = mtod(m, struct ip *); - ip->ip_len = ntohs(ip->ip_len); - ip->ip_off = ntohs(ip->ip_off); + SET_HOST_IPLEN(ip); return ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); - } - case DIR_IN: - ip_input(m); - return (0); - default: - panic("ng_ipfw_rcvdata: bad dir %u", ngit->dir); } - - /* not reached */ - return (0); } static int ng_ipfw_input(struct mbuf **m0, int dir, struct ip_fw_args *fwa, int tee) { struct mbuf *m; - struct ng_ipfw_tag *ngit; struct ip *ip; hook_p hook; int error = 0; @@ -273,7 +264,7 @@ ng_ipfw_input(struct mbuf **m0, int dir, * Node must be loaded and corresponding hook must be present. */ if (fw_node == NULL || - (hook = ng_ipfw_findhook1(fw_node, fwa->cookie)) == NULL) { + (hook = ng_ipfw_findhook1(fw_node, fwa->rule.info)) == NULL) { if (tee == 0) m_freem(*m0); return (ESRCH); /* no hook associated with this rule */ @@ -285,21 +276,21 @@ ng_ipfw_input(struct mbuf **m0, int dir, * a copy of a packet and forward it into netgraph without a tag. */ if (tee == 0) { + struct m_tag *tag; + struct ipfw_rule_ref *r; m = *m0; *m0 = NULL; /* it belongs now to netgraph */ - if ((ngit = (struct ng_ipfw_tag *)m_tag_alloc(NGM_IPFW_COOKIE, - 0, TAGSIZ, M_NOWAIT|M_ZERO)) == NULL) { + tag = m_tag_alloc(MTAG_IPFW_RULE, 0, sizeof(*r), + M_NOWAIT|M_ZERO); + if (tag == NULL) { m_freem(m); return (ENOMEM); } - ngit->slot = fwa->slot; - ngit->rulenum = fwa->rulenum; - ngit->rule_id = fwa->rule_id; - ngit->chain_id = fwa->chain_id; - ngit->dir = dir; -// ngit->ifp = fwa->oif; /* XXX do we use it ? */ - m_tag_prepend(m, &ngit->mt); + r = (struct ipfw_rule_ref *)(tag + 1); + *r = fwa->rule; + r->info = dir ? IPFW_INFO_IN : IPFW_INFO_OUT; + m_tag_prepend(m, tag); } else if ((m = m_dup(*m0, M_DONTWAIT)) == NULL) @@ -310,8 +301,6 @@ ng_ipfw_input(struct mbuf **m0, int dir, return (EINVAL); ip = mtod(m, struct ip *); - ip->ip_len = htons(ip->ip_len); - ip->ip_off = htons(ip->ip_off); NG_SEND_DATA_ONLY(error, hook, m); Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ip_divert.c Mon Jan 4 19:01:22 2010 (r201527) @@ -52,19 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #include #include -#include #include -#include - -#include #include #include -#include #include #include @@ -72,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -194,7 +186,7 @@ div_destroy(void) * IPPROTO_DIVERT is not in the real IP protocol number space; this * function should never be called. Just in case, drop any packets. */ -void +static void div_input(struct mbuf *m, int off) { @@ -218,9 +210,8 @@ divert_packet(struct mbuf *m, int incomi struct sockaddr_in divsrc; struct m_tag *mtag; - mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); + mtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); if (mtag == NULL) { - printf("%s: no divert tag\n", __func__); m_freem(m); return; } @@ -245,14 +236,15 @@ divert_packet(struct mbuf *m, int incomi ip->ip_len = htons(ip->ip_len); } #endif + bzero(&divsrc, sizeof(divsrc)); + divsrc.sin_len = sizeof(divsrc); + divsrc.sin_family = AF_INET; + /* record matching rule, in host format */ + divsrc.sin_port = ((struct ipfw_rule_ref *)(mtag+1))->rulenum; /* * Record receive interface address, if any. * But only for incoming packets. */ - bzero(&divsrc, sizeof(divsrc)); - divsrc.sin_len = sizeof(divsrc); - divsrc.sin_family = AF_INET; - divsrc.sin_port = divert_cookie(mtag); /* record matching rule */ if (incoming) { struct ifaddr *ifa; struct ifnet *ifp; @@ -300,7 +292,7 @@ divert_packet(struct mbuf *m, int incomi /* Put packet on socket queue, if any */ sa = NULL; - nport = htons((u_int16_t)divert_info(mtag)); + nport = htons((u_int16_t)(((struct ipfw_rule_ref *)(mtag+1))->info)); INP_INFO_RLOCK(&V_divcbinfo); LIST_FOREACH(inp, &V_divcb, inp_list) { /* XXX why does only one socket match? */ @@ -339,7 +331,7 @@ div_output(struct socket *so, struct mbu struct mbuf *control) { struct m_tag *mtag; - struct divert_tag *dt; + struct ipfw_rule_ref *dt; int error = 0; struct mbuf *options; @@ -354,23 +346,31 @@ div_output(struct socket *so, struct mbu if (control) m_freem(control); /* XXX */ - if ((mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL)) == NULL) { - mtag = m_tag_get(PACKET_TAG_DIVERT, sizeof(struct divert_tag), - M_NOWAIT | M_ZERO); + mtag = m_tag_locate(m, MTAG_IPFW_RULE, 0, NULL); + if (mtag == NULL) { + /* this should be normal */ + mtag = m_tag_alloc(MTAG_IPFW_RULE, 0, + sizeof(struct ipfw_rule_ref), M_NOWAIT | M_ZERO); if (mtag == NULL) { error = ENOBUFS; goto cantsend; } - dt = (struct divert_tag *)(mtag+1); m_tag_prepend(m, mtag); - } else - dt = (struct divert_tag *)(mtag+1); + } + dt = (struct ipfw_rule_ref *)(mtag+1); /* Loopback avoidance and state recovery */ if (sin) { int i; - dt->cookie = sin->sin_port; + /* set the starting point. We provide a non-zero slot, + * but a non_matching chain_id to skip that info and use + * the rulenum/rule_id. + */ + dt->slot = 1; /* dummy, chain_id is invalid */ + dt->chain_id = 0; + dt->rulenum = sin->sin_port+1; /* host format ? */ + dt->rule_id = 0; /* * Find receive interface with the given name, stuffed * (if it exists) in the sin_zero[] field. @@ -388,7 +388,7 @@ div_output(struct socket *so, struct mbu struct ip *const ip = mtod(m, struct ip *); struct inpcb *inp; - dt->info |= IP_FW_DIVERT_OUTPUT_FLAG; + dt->info |= IPFW_IS_DIVERT | IPFW_INFO_OUT; INP_INFO_WLOCK(&V_divcbinfo); inp = sotoinpcb(so); INP_RLOCK(inp); @@ -454,7 +454,7 @@ div_output(struct socket *so, struct mbu m_freem(options); } } else { - dt->info |= IP_FW_DIVERT_LOOPBACK_FLAG; + dt->info |= IPFW_IS_DIVERT | IPFW_INFO_IN; if (m->m_pkthdr.rcvif == NULL) { /* * No luck with the name, check by IP address. @@ -588,7 +588,7 @@ div_send(struct socket *so, int flags, s return div_output(so, m, (struct sockaddr_in *)nam, control); } -void +static void div_ctlinput(int cmd, struct sockaddr *sa, void *vip) { struct in_addr faddr; @@ -801,5 +801,5 @@ static moduledata_t ipdivertmod = { }; DECLARE_MODULE(ipdivert, ipdivertmod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); -MODULE_DEPEND(dummynet, ipfw, 2, 2, 2); +MODULE_DEPEND(ipdivert, ipfw, 2, 2, 2); MODULE_VERSION(ipdivert, 1); Modified: head/sys/netinet/ip_divert.h ============================================================================== --- head/sys/netinet/ip_divert.h Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ip_divert.h Mon Jan 4 19:01:22 2010 (r201527) @@ -36,53 +36,20 @@ #define _NETINET_IP_DIVERT_H_ /* - * Sysctl declaration. + * divert has no custom kernel-userland API. + * + * All communication occurs through a sockaddr_in socket where + * + * kernel-->userland + * sin_port = matching rule, host format; + * sin_addr = IN: first address of the incoming interface; + * OUT: INADDR_ANY + * sin_zero = if fits, the interface name (max 7 bytes + NUL) + * + * userland->kernel + * sin_port = restart-rule - 1, host order + * (we restart at sin_port + 1) + * sin_addr = IN: address of the incoming interface; + * OUT: INADDR_ANY */ -#ifdef SYSCTL_DECL -SYSCTL_DECL(_net_inet_divert); -#endif - -/* - * Divert socket definitions. - */ -struct divert_tag { - u_int32_t info; /* port & flags */ - u_int16_t cookie; /* ipfw rule number */ -}; - -/* - * Return the divert cookie associated with the mbuf; if any. - */ -static __inline u_int16_t -divert_cookie(struct m_tag *mtag) -{ - return ((struct divert_tag *)(mtag+1))->cookie; -} -static __inline u_int16_t -divert_find_cookie(struct mbuf *m) -{ - struct m_tag *mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); - return mtag ? divert_cookie(mtag) : 0; -} - -/* - * Return the divert info associated with the mbuf; if any. - */ -static __inline u_int32_t -divert_info(struct m_tag *mtag) -{ - return ((struct divert_tag *)(mtag+1))->info; -} -static __inline u_int32_t -divert_find_info(struct mbuf *m) -{ - struct m_tag *mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); - return mtag ? divert_info(mtag) : 0; -} - -typedef void ip_divert_packet_t(struct mbuf *m, int incoming); -extern ip_divert_packet_t *ip_divert_ptr; - -extern void div_input(struct mbuf *, int); -extern void div_ctlinput(int, struct sockaddr *, void *); #endif /* _NETINET_IP_DIVERT_H_ */ Modified: head/sys/netinet/ip_dummynet.h ============================================================================== --- head/sys/netinet/ip_dummynet.h Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ip_dummynet.h Mon Jan 4 19:01:22 2010 (r201527) @@ -114,11 +114,7 @@ struct dn_heap { * other forms of packet reinjection. */ struct dn_pkt_tag { - /* first part, reinject info */ - uint32_t slot; /* slot of next rule to use */ - uint32_t rulenum; /* matching rule number */ - uint32_t rule_id; /* matching rule id */ - uint32_t chain_id; /* ruleset id */ + struct ipfw_rule_ref rule; /* matching rule */ /* second part, dummynet specific */ int dn_dir; /* action when packet comes out. */ Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_dummynet.c Mon Jan 4 19:01:22 2010 (r201527) @@ -462,15 +462,10 @@ heap_free(struct dn_heap *h) */ /* - * Dispose a packet in dummynet. Use an inline functions so if we + * Dispose a list of packet. Use an inline functions so if we * need to free extra state associated to a packet, this is a * central point to do it. */ -static __inline void *dn_free_pkt(struct mbuf *m) -{ - m_freem(m); - return NULL; -} static __inline void dn_free_pkts(struct mbuf *mnext) { @@ -478,7 +473,7 @@ static __inline void dn_free_pkts(struct while ((m = mnext) != NULL) { mnext = m->m_nextpkt; - dn_free_pkt(m); + FREE_PKT(m); } } @@ -968,24 +963,31 @@ dummynet_send(struct mbuf *m) for (; m != NULL; m = n) { struct ifnet *ifp; int dst; + struct m_tag *tag; n = m->m_nextpkt; m->m_nextpkt = NULL; - if (m_tag_first(m) == NULL) { + tag = m_tag_first(m); + if (tag == NULL) { dst = DIR_DROP; } else { struct dn_pkt_tag *pkt = dn_tag_get(m); + /* extract the dummynet info, rename the tag */ dst = pkt->dn_dir; ifp = pkt->ifp; + /* rename the tag so it carries reinject info */ + tag->m_tag_cookie = MTAG_IPFW_RULE; + tag->m_tag_id = 0; } switch (dst) { case DIR_OUT: + SET_HOST_IPLEN(mtod(m, struct ip *)); ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); break ; case DIR_IN : /* put header in network format for ip_input() */ - SET_NET_IPLEN(mtod(m, struct ip *)); + //SET_NET_IPLEN(mtod(m, struct ip *)); netisr_dispatch(NETISR_IP, m); break; #ifdef INET6 @@ -994,6 +996,7 @@ dummynet_send(struct mbuf *m) break; case DIR_OUT | PROTO_IPV6: + SET_HOST_IPLEN(mtod(m, struct ip *)); ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); break; #endif @@ -1024,12 +1027,12 @@ dummynet_send(struct mbuf *m) case DIR_DROP: /* drop the packet after some time */ - dn_free_pkt(m); + FREE_PKT(m); break; default: printf("dummynet: bad switch %d!\n", dst); - dn_free_pkt(m); + FREE_PKT(m); break; } } @@ -1362,7 +1365,7 @@ dummynet_io(struct mbuf **m0, int dir, s struct dn_pipe *pipe; uint64_t len = m->m_pkthdr.len; struct dn_flow_queue *q = NULL; - int is_pipe = fwa->cookie & 0x8000000 ? 0 : 1; + int is_pipe = fwa->rule.info & IPFW_IS_PIPE; KASSERT(m->m_nextpkt == NULL, ("dummynet_io: mbuf queue passed to dummynet")); @@ -1371,16 +1374,13 @@ dummynet_io(struct mbuf **m0, int dir, s io_pkt++; /* * This is a dummynet rule, so we expect an O_PIPE or O_QUEUE rule. - * - * XXXGL: probably the pipe->fs and fs->pipe logic here - * below can be simplified. */ if (is_pipe) { - pipe = locate_pipe(fwa->cookie & 0xffff); + pipe = locate_pipe(fwa->rule.info & IPFW_INFO_MASK); if (pipe != NULL) fs = &(pipe->fs); } else - fs = locate_flowset(fwa->cookie & 0xffff); + fs = locate_flowset(fwa->rule.info & IPFW_INFO_MASK); if (fs == NULL) goto dropit; /* This queue/pipe does not exist! */ @@ -1426,12 +1426,9 @@ dummynet_io(struct mbuf **m0, int dir, s * Ok, i can handle the pkt now... * Build and enqueue packet + parameters. */ - pkt->slot = fwa->slot; - pkt->rulenum = fwa->rulenum; - pkt->rule_id = fwa->rule_id; - pkt->chain_id = fwa->chain_id; + pkt->rule = fwa->rule; + pkt->rule.info &= IPFW_ONEPASS; /* only keep this info */ pkt->dn_dir = dir; - pkt->ifp = fwa->oif; if (q->head == NULL) @@ -1562,7 +1559,8 @@ dropit: if (q) q->drops++; DUMMYNET_UNLOCK(); - *m0 = dn_free_pkt(m); + FREE_PKT(m); + *m0 = NULL; return ((fs && (fs->flags_fs & DN_NOERROR)) ? 0 : ENOBUFS); } Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Jan 4 19:01:22 2010 (r201527) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -560,7 +559,7 @@ send_reject6(struct ip_fw_args *args, in ip6_output(m0, NULL, NULL, 0, NULL, NULL, NULL); } - m_freem(m); + FREE_PKT(m); } else if (code != ICMP6_UNREACH_RST) { /* Send an ICMPv6 unreach. */ #if 0 /* @@ -576,7 +575,7 @@ send_reject6(struct ip_fw_args *args, in #endif icmp6_error(m, ICMP6_DST_UNREACH, code, 0); } else - m_freem(m); + FREE_PKT(m); args->m = NULL; } @@ -603,9 +602,7 @@ send_reject(struct ip_fw_args *args, int #endif if (code != ICMP_REJECT_RST) { /* Send an ICMP unreach */ /* We need the IP header in host order for icmp_error(). */ - if (args->eh != NULL) { - SET_HOST_IPLEN(ip); - } + SET_HOST_IPLEN(ip); icmp_error(args->m, ICMP_UNREACH, code, 0L, 0); } else if (args->f_id.proto == IPPROTO_TCP) { struct tcphdr *const tcp = @@ -618,9 +615,9 @@ send_reject(struct ip_fw_args *args, int if (m != NULL) ip_output(m, NULL, NULL, 0, NULL, NULL); } - m_freem(args->m); + FREE_PKT(args->m); } else - m_freem(args->m); + FREE_PKT(args->m); args->m = NULL; } @@ -709,16 +706,18 @@ check_uidgid(ipfw_insn_u32 *insn, int pr } /* - * Helper function to write the matching rule into args + * Helper function to set args with info on the rule after the matching + * one. slot is precise, whereas we guess rule_id as they are + * assigned sequentially. */ static inline void set_match(struct ip_fw_args *args, int slot, struct ip_fw_chain *chain) { - args->chain_id = chain->id; - args->slot = slot + 1; /* we use 0 as a marker */ - args->rule_id = chain->map[slot]->id; - args->rulenum = chain->map[slot]->rulenum; + args->rule.chain_id = chain->id; + args->rule.slot = slot + 1; /* we use 0 as a marker */ + args->rule.rule_id = 1 + chain->map[slot]->id; + args->rule.rulenum = chain->map[slot]->rulenum; } /* @@ -743,7 +742,7 @@ set_match(struct ip_fw_args *args, int s * args->rule Pointer to the last matching rule (in/out) * args->next_hop Socket we are forwarding to (out). * args->f_id Addresses grabbed from the packet (out) - * args->cookie a cookie depending on rule action + * args->rule.info a cookie depending on rule action * * Return value: * @@ -753,6 +752,8 @@ set_match(struct ip_fw_args *args, int s * IP_FW_TEE tee packet, port in m_tag * IP_FW_DUMMYNET to dummynet, pipe in args->cookie * IP_FW_NETGRAPH into netgraph, cookie args->cookie + * args->rule contains the matching rule, + * args->rule.info has additional information. * */ int @@ -797,14 +798,6 @@ ipfw_chk(struct ip_fw_args *args) int ucred_lookup = 0; /* - * divinput_flags If non-zero, set to the IP_FW_DIVERT_*_FLAG - * associated with a packet input on a divert socket. This - * will allow to distinguish traffic and its direction when - * it originates from a divert socket. - */ - u_int divinput_flags = 0; - - /* * oif | args->oif If NULL, ipfw_chk has been called on the * inbound path (ether_input, ip_input). * If non-NULL, ipfw_chk has been called on the outbound path @@ -862,7 +855,6 @@ ipfw_chk(struct ip_fw_args *args) int dyn_dir = MATCH_UNKNOWN; ipfw_dyn_rule *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; - struct m_tag *mtag; /* * We store in ulp a pointer to the upper layer protocol header. @@ -1090,16 +1082,8 @@ do { \ proto = ip->ip_p; src_ip = ip->ip_src; dst_ip = ip->ip_dst; -#ifndef HAVE_NET_IPLEN - if (args->eh == NULL) { /* on l3 these are in host format */ - offset = ip->ip_off & IP_OFFMASK; - iplen = ip->ip_len; - } else -#endif /* !HAVE_NET_IPLEN */ - { /* otherwise they are in net format */ - offset = ntohs(ip->ip_off) & IP_OFFMASK; - iplen = ntohs(ip->ip_len); - } + offset = ntohs(ip->ip_off) & IP_OFFMASK; + iplen = ntohs(ip->ip_len); pktlen = iplen < pktlen ? iplen : pktlen; if (offset == 0) { @@ -1143,44 +1127,20 @@ do { \ IPFW_RUNLOCK(chain); return (IP_FW_PASS); /* accept */ } - /* XXX divert should be handled same as other tags */ - mtag = m_tag_find(m, PACKET_TAG_DIVERT, NULL); - if (args->slot) { + if (args->rule.slot) { /* * Packet has already been tagged as a result of a previous * match on rule args->rule aka args->rule_id (PIPE, QUEUE, - * REASS, NETGRAPH and similar, never a skipto). + * REASS, NETGRAPH, DIVERT/TEE...) * Validate the slot and continue from the next one * if still present, otherwise do a lookup. */ - if (V_fw_one_pass) { - IPFW_RUNLOCK(chain); - return (IP_FW_PASS); - } - f_pos = (args->chain_id == chain->id) ? - args->slot /* already incremented */ : - ipfw_find_rule(chain, args->rulenum, args->rule_id+1); + f_pos = (args->rule.chain_id == chain->id) ? + args->rule.slot : + ipfw_find_rule(chain, args->rule.rulenum, + args->rule.rule_id); } else { - /* - * Find the starting rule. It can be either the first - * one, or the one after divert_rule if asked so. - */ - int skipto = mtag ? divert_cookie(mtag) : 0; - f_pos = 0; - if (args->eh == NULL && skipto != 0) { - if (skipto >= IPFW_DEFAULT_RULE) { - IPFW_RUNLOCK(chain); - return (IP_FW_DENY); /* invalid */ - } - f_pos = ipfw_find_rule(chain, skipto+1, 0); - } - } - /* reset divert rule to avoid confusion later */ - if (mtag) { - divinput_flags = divert_info(mtag) & - (IP_FW_DIVERT_OUTPUT_FLAG | IP_FW_DIVERT_LOOPBACK_FLAG); - m_tag_delete(m, mtag); } /* @@ -1332,10 +1292,15 @@ do { \ break; case O_DIVERTED: - match = (cmd->arg1 & 1 && divinput_flags & - IP_FW_DIVERT_LOOPBACK_FLAG) || - (cmd->arg1 & 2 && divinput_flags & - IP_FW_DIVERT_OUTPUT_FLAG); + { + /* For diverted packets, args->rule.info + * contains the divert port (in host format) + * reason and direction. + */ + uint32_t i = args->rule.info; + match = (i&IPFW_IS_MASK) == IPFW_IS_DIVERT && + cmd->arg1 & ((i & IPFW_INFO_IN) ? 1 : 2); + } break; case O_PROTO: @@ -1755,6 +1720,7 @@ do { \ break; case O_TAG: { + struct m_tag *mtag; uint32_t tag = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; @@ -1771,12 +1737,13 @@ do { \ if (cmd->len & F_NOT) { /* `untag' action */ if (mtag != NULL) m_tag_delete(m, mtag); + match = 0; } else if (mtag == NULL) { if ((mtag = m_tag_alloc(MTAG_IPFW, tag, 0, M_NOWAIT)) != NULL) m_tag_prepend(m, mtag); + match = 1; } - match = (cmd->len & F_NOT) ? 0: 1; break; } @@ -1786,6 +1753,7 @@ do { \ break; case O_TAGGED: { + struct m_tag *mtag; uint32_t tag = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; @@ -1926,10 +1894,12 @@ do { \ case O_PIPE: case O_QUEUE: set_match(args, f_pos, chain); - args->cookie = (cmd->arg1 == IP_FW_TABLEARG) ? + args->rule.info = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; - if (cmd->opcode == O_QUEUE) - args->cookie |= 0x80000000; + if (cmd->opcode == O_PIPE) + args->rule.info |= IPFW_IS_PIPE; + if (V_fw_one_pass) + args->rule.info |= IPFW_ONEPASS; retval = IP_FW_DUMMYNET; l = 0; /* exit inner loop */ done = 1; /* exit outer loop */ @@ -1942,23 +1912,11 @@ do { \ /* otherwise this is terminal */ l = 0; /* exit inner loop */ done = 1; /* exit outer loop */ - mtag = m_tag_get(PACKET_TAG_DIVERT, - sizeof(struct divert_tag), - M_NOWAIT); - if (mtag == NULL) { - retval = IP_FW_DENY; - } else { - struct divert_tag *dt; - dt = (struct divert_tag *)(mtag+1); - dt->cookie = f->rulenum; - if (cmd->arg1 == IP_FW_TABLEARG) - dt->info = tablearg; - else - dt->info = cmd->arg1; - m_tag_prepend(m, mtag); - retval = (cmd->opcode == O_DIVERT) ? + retval = (cmd->opcode == O_DIVERT) ? IP_FW_DIVERT : IP_FW_TEE; - } + set_match(args, f_pos, chain); + args->rule.info = (cmd->arg1 == IP_FW_TABLEARG) ? + tablearg : cmd->arg1; break; case O_COUNT: @@ -2074,7 +2032,7 @@ do { \ case O_NETGRAPH: case O_NGTEE: set_match(args, f_pos, chain); - args->cookie = (cmd->arg1 == IP_FW_TABLEARG) ? + args->rule.info = (cmd->arg1 == IP_FW_TABLEARG) ? tablearg : cmd->arg1; retval = (cmd->opcode == O_NETGRAPH) ? IP_FW_NETGRAPH : IP_FW_NGTEE; @@ -2126,12 +2084,6 @@ do { \ f->pcnt++; f->bcnt += pktlen; l = 0; /* in any case exit inner loop */ - -#ifndef HAVE_NET_IPLEN - if (args->eh == NULL) - ip_off = ip->ip_off; - else -#endif /* !HAVE_NET_IPLEN */ ip_off = ntohs(ip->ip_off); /* if not fragmented, go to next rule */ @@ -2139,19 +2091,14 @@ do { \ break; /* * ip_reass() expects len & off in host - * byte order: fix them in case we come - * from layer2. + * byte order. */ - if (args->eh != NULL) { - SET_HOST_IPLEN(ip); - } + SET_HOST_IPLEN(ip); args->m = m = ip_reass(m); /* - * IP header checksum fixup after - * reassembly and leave header - * in network byte order. + * do IP header checksum fixup. */ if (m == NULL) { /* fragment got swallowed */ retval = IP_FW_DENY; @@ -2160,10 +2107,7 @@ do { \ ip = mtod(m, struct ip *); hlen = ip->ip_hl << 2; - /* revert len. & off to net format if needed */ - if (args->eh != NULL) { - SET_NET_IPLEN(ip); - } + SET_NET_IPLEN(ip); ip->ip_sum = 0; if (hlen == sizeof(struct ip)) ip->ip_sum = in_cksum_hdr(ip); Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Mon Jan 4 19:01:22 2010 (r201527) @@ -917,7 +917,7 @@ ipfw_send_pkt(struct mbuf *replyto, stru #endif default: /* XXX: log me?!? */ - m_freem(m); + FREE_PKT(m); return (NULL); } dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN); @@ -1002,11 +1002,7 @@ ipfw_send_pkt(struct mbuf *replyto, stru h->ip_hl = sizeof(*h) >> 2; h->ip_tos = IPTOS_LOWDELAY; h->ip_off = 0; -#ifdef HAVE_NET_IPLEN /* XXX do we handle layer2 ? */ h->ip_len = htons(len); -#else - h->ip_len = len; -#endif h->ip_ttl = V_ip_defttl; h->ip_sum = 0; break; Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_fw_log.c Mon Jan 4 19:01:22 2010 (r201527) @@ -165,16 +165,8 @@ ipfw_log(struct ip_fw *f, u_int hlen, st * more info in the header */ mh.mh_data = "DDDDDDSSSSSS\x08\x00"; - if (args->f_id.addr_type == 4) { - /* restore wire format */ - SET_NET_IPLEN(ip); - } } BPF_MTAP(log_if, (struct mbuf *)&mh); - if (args->eh == NULL && args->f_id.addr_type == 4) { - /* restore host format */ - SET_HOST_IPLEN(ip); - } #endif /* !WITHOUT_BPF */ return; } @@ -409,23 +401,15 @@ ipfw_log(struct ip_fw *f, u_int hlen, st } else #endif { - int ip_off, ip_len; -#ifndef HAVE_NET_IPLEN - if (args->eh == NULL) { - ip_off = ip->ip_off; - ip_len = ip->ip_len; - } else -#endif /* !HAVE_NET_IPLEN */ - { - ip_off = ntohs(ip->ip_off); - ip_len = ntohs(ip->ip_len); - } - if (ip_off & (IP_MF | IP_OFFMASK)) + int ipoff, iplen; + ipoff = ntohs(ip->ip_off); + iplen = ntohs(ip->ip_len); + if (ipoff & (IP_MF | IP_OFFMASK)) snprintf(SNPARGS(fragment, 0), " (frag %d:%d@%d%s)", - ntohs(ip->ip_id), ip_len - (ip->ip_hl << 2), + ntohs(ip->ip_id), iplen - (ip->ip_hl << 2), offset << 3, - (ip_off & IP_MF) ? "+" : ""); + (ipoff & IP_MF) ? "+" : ""); } } if (oif || m->m_pkthdr.rcvif) Modified: head/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_nat.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_fw_nat.c Mon Jan 4 19:01:22 2010 (r201527) @@ -219,9 +219,6 @@ ipfw_nat(struct ip_fw_args *args, struct return (IP_FW_DENY); } ip = mtod(mcl, struct ip *); - if (args->eh == NULL) { - SET_NET_IPLEN(ip); - } /* * XXX - Libalias checksum offload 'duct tape': @@ -330,9 +327,6 @@ ipfw_nat(struct ip_fw_args *args, struct mcl->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } } - if (args->eh == NULL) { - SET_HOST_IPLEN(ip); - } args->m = mcl; return (IP_FW_NAT); } Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Mon Jan 4 18:57:22 2010 (r201526) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Mon Jan 4 19:01:22 2010 (r201527) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:06:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D23010656A3 for ; Mon, 4 Jan 2010 19:06:55 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outI.internet-mail-service.net (outi.internet-mail-service.net [216.240.47.232]) by mx1.freebsd.org (Postfix) with ESMTP id E59878FC22 for ; Mon, 4 Jan 2010 19:06:54 +0000 (UTC) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 559402DA6E; Mon, 4 Jan 2010 11:06:54 -0800 (PST) X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id D9ED62D6012; Mon, 4 Jan 2010 11:06:53 -0800 (PST) Message-ID: <4B423C4D.30002@elischer.org> Date: Mon, 04 Jan 2010 11:06:53 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Luigi Rizzo References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> In-Reply-To: <20100104190024.GA47532@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:06:55 -0000 Luigi Rizzo wrote: > taking a random commit to this tree -- would you guys consider moving > the sctp sources to its own directory, e.g. netinet/sctp/ or something > that suits better ? > > It would help to browse through the directory: > > NAME FILES LINES > > netinet/ 156 153k > sctp* 36 66k > tcp* 24 16k > ipfw/ 9 9k > > > I understand that some of the headers should remain in netinet/ > but surely the code is not bound to a specific place... > we should move tcp too.. it's growing without bounds.. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:15:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1728D1065676; Mon, 4 Jan 2010 19:15:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 9476E8FC1F; Mon, 4 Jan 2010 19:15:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 82AB041C75D; Mon, 4 Jan 2010 20:15:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ilYP3NMtVPzJ; Mon, 4 Jan 2010 20:15:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 35D6C41C75C; Mon, 4 Jan 2010 20:15:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id F05E04448EC; Mon, 4 Jan 2010 19:14:40 +0000 (UTC) Date: Mon, 4 Jan 2010 19:14:40 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Julian Elischer In-Reply-To: <4B423C4D.30002@elischer.org> Message-ID: <20100104191318.K88477@maildrop.int.zabbadoz.net> References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <4B423C4D.30002@elischer.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Michael Tuexen , svn-src-all@freebsd.org, src-committers@freebsd.org, Luigi Rizzo Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:15:07 -0000 On Mon, 4 Jan 2010, Julian Elischer wrote: > Luigi Rizzo wrote: >> taking a random commit to this tree -- would you guys consider moving >> the sctp sources to its own directory, e.g. netinet/sctp/ or something >> that suits better ? >> >> It would help to browse through the directory: >> >> NAME FILES LINES >> >> netinet/ 156 153k >> sctp* 36 66k >> tcp* 24 16k >> ipfw/ 9 9k >> >> >> I understand that some of the headers should remain in netinet/ >> but surely the code is not bound to a specific place... >> > > we should move tcp too.. it's growing without bounds.. Right and all three of SCTP, UDP and TCP are ideally netinet/ independent and will as well work with netinet6 only one day so moving them to a subdir of netinet is not really future-oriented. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:24:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49B1E1065692; Mon, 4 Jan 2010 19:24:25 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) by mx1.freebsd.org (Postfix) with ESMTP id AA2918FC0A; Mon, 4 Jan 2010 19:24:24 +0000 (UTC) Received: from [192.168.1.190] (p508FF7CB.dip.t-dialin.net [80.143.247.203]) by mail-n.franken.de (Postfix) with ESMTP id 8628D1C0C0BEA; Mon, 4 Jan 2010 20:24:22 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Michael Tuexen In-Reply-To: <20100104190024.GA47532@onelab2.iet.unipi.it> Date: Mon, 4 Jan 2010 20:24:21 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> To: Luigi Rizzo X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:24:25 -0000 On Jan 4, 2010, at 8:00 PM, Luigi Rizzo wrote: > taking a random commit to this tree -- would you guys consider moving > the sctp sources to its own directory, e.g. netinet/sctp/ or something > that suits better ? Why do you think that a place different from netinet/ does suit better for the sctp_*.[ch] files than netinet/ ? This is at least the place where TCP and UDP live... Best regards Michael >=20 > It would help to browse through the directory: >=20 > NAME FILES LINES >=20 > netinet/ 156 153k > sctp* 36 66k > tcp* 24 16k > ipfw/ 9 9k >=20 >=20 > I understand that some of the headers should remain in netinet/ > but surely the code is not bound to a specific place... >=20 > cheers > luigi >=20 > On Mon, Jan 04, 2010 at 06:25:38PM +0000, Michael Tuexen wrote: >> Author: tuexen >> Date: Mon Jan 4 18:25:38 2010 >> New Revision: 201523 >> URL: http://svn.freebsd.org/changeset/base/201523 >>=20 >> Log: >> Correct usage of parenthesis. >>=20 >> PR: kern/142066 >> Approved by: rrs (mentor) >> Obtained from: Henning Petersen, Bruce Cran. >> MFC after: 2 weeks >>=20 >> Modified: >> head/sys/netinet/sctp_pcb.c >>=20 >> Modified: head/sys/netinet/sctp_pcb.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/sys/netinet/sctp_pcb.c Mon Jan 4 18:21:27 2010 = (r201522) >> +++ head/sys/netinet/sctp_pcb.c Mon Jan 4 18:25:38 2010 = (r201523) >> @@ -5528,7 +5528,7 @@ sctp_pcb_init() >>=20 >> /* Init the TIMEWAIT list */ >> for (i =3D 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { >> - LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); >> + LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); >> } >>=20 >> #if defined(SCTP_USE_THREAD_BASED_ITERATOR) >> @@ -6385,7 +6385,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp >> } >> skip_vtag_check: >>=20 >> - chain =3D &SCTP_BASE_INFO(vtag_timewait[(tag % = SCTP_STACK_VTAG_HASH_SIZE))]; >> + chain =3D &SCTP_BASE_INFO(vtag_timewait)[(tag % = SCTP_STACK_VTAG_HASH_SIZE)]; >> /* Now what about timed wait ? */ >> if (!LIST_EMPTY(chain)) { >> /* >=20 From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:27:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C6E51065692; Mon, 4 Jan 2010 19:27:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8758FC17; Mon, 4 Jan 2010 19:27:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04JRHld057177; Mon, 4 Jan 2010 19:27:17 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04JRH7X057175; Mon, 4 Jan 2010 19:27:17 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001041927.o04JRH7X057175@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Jan 2010 19:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201528 - stable/8/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:27:17 -0000 Author: jhb Date: Mon Jan 4 19:27:17 2010 New Revision: 201528 URL: http://svn.freebsd.org/changeset/base/201528 Log: MFC 201216: Remove a trailing reference to the obsolete vaps_ variable. Modified: stable/8/etc/network.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/network.subr ============================================================================== --- stable/8/etc/network.subr Mon Jan 4 19:01:22 2010 (r201527) +++ stable/8/etc/network.subr Mon Jan 4 19:27:17 2010 (r201528) @@ -568,7 +568,7 @@ childif_destroy() { local cfg child child_wlans ifn - child_wlans="`get_if_var $ifn wlans_IF` `get_if_var $ifn vaps_IF`" + child_wlans=`get_if_var $ifn wlans_IF` for child in ${child_wlans}; do ifconfig $child destroy && cfg=0 done From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:53:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 791EB1065695; Mon, 4 Jan 2010 19:53:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4835D8FC13; Mon, 4 Jan 2010 19:53:17 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EB68046B7F; Mon, 4 Jan 2010 14:53:16 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 50CDB8A026; Mon, 4 Jan 2010 14:53:16 -0500 (EST) From: John Baldwin To: Max Laier Date: Mon, 4 Jan 2010 11:01:18 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <200912312044.nBVKicMb003815@svn.freebsd.org> <200912311547.54045.jhb@freebsd.org> <201001010635.33081.max@love2party.net> In-Reply-To: <201001010635.33081.max@love2party.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201001041101.18288.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 04 Jan 2010 14:53:16 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00, DATE_IN_PAST_03_06,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201351 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:53:17 -0000 On Friday 01 January 2010 12:35:33 am Max Laier wrote: > On Thursday 31 December 2009 21:47:54 John Baldwin wrote: > > On Thursday 31 December 2009 3:44:38 pm John Baldwin wrote: > > > Author: jhb > > > Date: Thu Dec 31 20:44:38 2009 > > > New Revision: 201351 > > > URL: http://svn.freebsd.org/changeset/base/201351 > > > > > > Log: > > > Use stricter checking to match possible vlan clones by not allowing > > > extra garbage characters around or within the tag. > > > > Previously some odd clone requests such as 'em0.102a', 'em0.10a3bc', and > > 'em0.foo.104' would have succeeded creating interfaces equivalent to > > em0.102, em0.103, and em0.104. > > The em0.foo.104 case seems quite useful, though. Maybe we can keep that > /feature/? Err, I would only find it useful for adding a '104' vlan to a 'em0.foo' interface. Otherwise it is ambiguous. Suppose you have an em0 and an em0.foo interface already, then what should em0.foo.104 do in that case? I think the only way that this auto-cloning makes sense if it is an exact match of . as it is documented to be. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 19:57:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 629911065692; Mon, 4 Jan 2010 19:57:36 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37C048FC12; Mon, 4 Jan 2010 19:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Jvali063904; Mon, 4 Jan 2010 19:57:36 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Jvarw063902; Mon, 4 Jan 2010 19:57:36 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201001041957.o04Jvarw063902@svn.freebsd.org> From: Ken Smith Date: Mon, 4 Jan 2010 19:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201529 - stable/8/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 19:57:36 -0000 Author: kensmith Date: Mon Jan 4 19:57:35 2010 New Revision: 201529 URL: http://svn.freebsd.org/changeset/base/201529 Log: MFC r200775: Add FreeBSD- to the beginning of the ISO image filenames. Modified: stable/8/release/Makefile Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/8/release/Makefile ============================================================================== --- stable/8/release/Makefile Mon Jan 4 19:27:17 2010 (r201528) +++ stable/8/release/Makefile Mon Jan 4 19:57:35 2010 (r201529) @@ -1128,36 +1128,36 @@ iso.1: .if defined(CD_BOOT) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_bootonly \ - ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} .endif @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ ${CD_DISC1_PKGS} @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Packages \ - ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ ${CD_DISC2_PKGS} .if defined(MAKE_DVD) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ ${CD_DVD1_PKGS} .endif .if !defined(NODOC) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Documentation \ - ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DOCS} \ ${CD_DOCS_PKGS} .endif .if defined(SEPARATE_LIVEFS) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_LiveFS \ - ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} .endif @echo "Generating MD5 and SHA256 sums..." - @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) - @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) + @(cd ${CD} && md5 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) + @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) touch ${.TARGET} .else @echo "Do not know how to create an ISO for ${TARGET_ARCH}." From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 20:59:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 095F31065695; Mon, 4 Jan 2010 20:59:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC81F8FC24; Mon, 4 Jan 2010 20:59:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Kxq8Y078041; Mon, 4 Jan 2010 20:59:52 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Kxqmq078036; Mon, 4 Jan 2010 20:59:52 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001042059.o04Kxqmq078036@svn.freebsd.org> From: Ed Schouten Date: Mon, 4 Jan 2010 20:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201532 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 20:59:53 -0000 Author: ed Date: Mon Jan 4 20:59:52 2010 New Revision: 201532 URL: http://svn.freebsd.org/changeset/base/201532 Log: Make TIOCSTI work again. It looks like I didn't implement this when I imported MPSAFE TTY. Applications like mail(1) still use this. I think it's conceptually bad. Tested by: Pete French MFC after: 2 weeks Modified: head/sys/kern/tty.c head/sys/kern/tty_compat.c head/sys/kern/tty_pts.c head/sys/sys/tty.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Jan 4 20:55:47 2010 (r201531) +++ head/sys/kern/tty.c Mon Jan 4 20:59:52 2010 (r201532) @@ -505,12 +505,12 @@ ttydev_ioctl(struct cdev *dev, u_long cm case TIOCSPGRP: case TIOCSTART: case TIOCSTAT: + case TIOCSTI: case TIOCSTOP: case TIOCSWINSZ: #if 0 case TIOCSDRAINWAIT: case TIOCSETD: - case TIOCSTI: #endif #ifdef COMPAT_43TTY case TIOCLBIC: @@ -559,7 +559,7 @@ ttydev_ioctl(struct cdev *dev, u_long cm new->c_ospeed = old->c_ospeed; } - error = tty_ioctl(tp, cmd, data, td); + error = tty_ioctl(tp, cmd, data, fflag, td); done: tty_unlock(tp); return (error); @@ -1350,7 +1350,8 @@ tty_flush(struct tty *tp, int flags) } static int -tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td) +tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, + struct thread *td) { int error; @@ -1677,17 +1678,26 @@ tty_generic_ioctl(struct tty *tp, u_long case TIOCSTAT: tty_info(tp); return (0); + case TIOCSTI: + if ((fflag & FREAD) == 0 && priv_check(td, PRIV_TTY_STI)) + return (EPERM); + if (!tty_is_ctty(tp, td->td_proc) && + priv_check(td, PRIV_TTY_STI)) + return (EACCES); + ttydisc_rint(tp, *(char *)data, 0); + ttydisc_rint_done(tp); + return (0); } #ifdef COMPAT_43TTY - return tty_ioctl_compat(tp, cmd, data, td); + return tty_ioctl_compat(tp, cmd, data, fflag, td); #else /* !COMPAT_43TTY */ return (ENOIOCTL); #endif /* COMPAT_43TTY */ } int -tty_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td) +tty_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td) { int error; @@ -1698,7 +1708,7 @@ tty_ioctl(struct tty *tp, u_long cmd, vo error = ttydevsw_ioctl(tp, cmd, data, td); if (error == ENOIOCTL) - error = tty_generic_ioctl(tp, cmd, data, td); + error = tty_generic_ioctl(tp, cmd, data, fflag, td); return (error); } Modified: head/sys/kern/tty_compat.c ============================================================================== --- head/sys/kern/tty_compat.c Mon Jan 4 20:55:47 2010 (r201531) +++ head/sys/kern/tty_compat.c Mon Jan 4 20:59:52 2010 (r201532) @@ -180,7 +180,8 @@ ttsetcompat(struct tty *tp, u_long *com, /*ARGSUSED*/ int -tty_ioctl_compat(struct tty *tp, u_long com, caddr_t data, struct thread *td) +tty_ioctl_compat(struct tty *tp, u_long com, caddr_t data, int fflag, + struct thread *td) { switch (com) { case TIOCSETP: @@ -196,7 +197,7 @@ tty_ioctl_compat(struct tty *tp, u_long term = tp->t_termios; if ((error = ttsetcompat(tp, &com, data, &term)) != 0) return error; - return tty_ioctl(tp, com, &term, td); + return tty_ioctl(tp, com, &term, fflag, td); } case TIOCGETP: { struct sgttyb *sg = (struct sgttyb *)data; @@ -255,12 +256,13 @@ tty_ioctl_compat(struct tty *tp, u_long int ldisczero = 0; return (tty_ioctl(tp, TIOCSETD, - *(int *)data == 2 ? (caddr_t)&ldisczero : data, td)); + *(int *)data == 2 ? (caddr_t)&ldisczero : data, + fflag, td)); } case OTIOCCONS: *(int *)data = 1; - return (tty_ioctl(tp, TIOCCONS, data, td)); + return (tty_ioctl(tp, TIOCCONS, data, fflag, td)); default: return (ENOIOCTL); Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Mon Jan 4 20:55:47 2010 (r201531) +++ head/sys/kern/tty_pts.c Mon Jan 4 20:59:52 2010 (r201532) @@ -379,7 +379,7 @@ ptsdev_ioctl(struct file *fp, u_long cmd /* Just redirect this ioctl to the slave device. */ tty_lock(tp); - error = tty_ioctl(tp, cmd, data, td); + error = tty_ioctl(tp, cmd, data, fp->f_flag, td); tty_unlock(tp); if (error == ENOIOCTL) error = ENOTTY; Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Mon Jan 4 20:55:47 2010 (r201531) +++ head/sys/sys/tty.h Mon Jan 4 20:59:52 2010 (r201532) @@ -182,9 +182,10 @@ void tty_wakeup(struct tty *tp, int flag int tty_checkoutq(struct tty *tp); int tty_putchar(struct tty *tp, char c); -int tty_ioctl(struct tty *tp, u_long cmd, void *data, struct thread *td); -int tty_ioctl_compat(struct tty *tp, u_long cmd, caddr_t data, +int tty_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td); +int tty_ioctl_compat(struct tty *tp, u_long cmd, caddr_t data, + int fflag, struct thread *td); void tty_init_console(struct tty *tp, speed_t speed); void tty_flush(struct tty *tp, int flags); void tty_hiwat_in_block(struct tty *tp); From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 21:30:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6ED110656A4; Mon, 4 Jan 2010 21:30:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C49748FC24; Mon, 4 Jan 2010 21:30:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04LU4Td085150; Mon, 4 Jan 2010 21:30:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04LU4ln085140; Mon, 4 Jan 2010 21:30:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001042130.o04LU4ln085140@svn.freebsd.org> From: Warner Losh Date: Mon, 4 Jan 2010 21:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201534 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 21:30:04 -0000 Author: imp Date: Mon Jan 4 21:30:04 2010 New Revision: 201534 URL: http://svn.freebsd.org/changeset/base/201534 Log: Revert 200594. This file isn't intended for these sorts of things. Modified: head/sys/amd64/conf/DEFAULTS head/sys/arm/conf/DEFAULTS head/sys/i386/conf/DEFAULTS head/sys/ia64/conf/DEFAULTS head/sys/mips/conf/DEFAULTS head/sys/pc98/conf/DEFAULTS head/sys/powerpc/conf/DEFAULTS head/sys/sparc64/conf/DEFAULTS head/sys/sun4v/conf/DEFAULTS Modified: head/sys/amd64/conf/DEFAULTS ============================================================================== --- head/sys/amd64/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/amd64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -20,10 +20,3 @@ options GEOM_PART_BSD options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/DEFAULTS ============================================================================== --- head/sys/arm/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/arm/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -9,10 +9,3 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/i386/conf/DEFAULTS ============================================================================== --- head/sys/i386/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/i386/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -28,10 +28,3 @@ options GEOM_PART_MBR # enable support for native hardware options NATIVE device atpic - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/ia64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -17,10 +17,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/mips/conf/DEFAULTS ============================================================================== --- head/sys/mips/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/mips/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -11,10 +11,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/pc98/conf/DEFAULTS ============================================================================== --- head/sys/pc98/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/pc98/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -24,10 +24,3 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/powerpc/conf/DEFAULTS ============================================================================== --- head/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -14,10 +14,3 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sparc64/conf/DEFAULTS ============================================================================== --- head/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -19,10 +19,3 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/sun4v/conf/DEFAULTS ============================================================================== --- head/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:02:01 2010 (r201533) +++ head/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) @@ -11,10 +11,3 @@ device mem # Memory and kernel memory # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_VTOC8 - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 21:33:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4945A1065697; Mon, 4 Jan 2010 21:33:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB718FC1D; Mon, 4 Jan 2010 21:33:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04LXBpb085897; Mon, 4 Jan 2010 21:33:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04LXAu4085887; Mon, 4 Jan 2010 21:33:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001042133.o04LXAu4085887@svn.freebsd.org> From: Warner Losh Date: Mon, 4 Jan 2010 21:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201535 - in stable/8/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 21:33:11 -0000 Author: imp Date: Mon Jan 4 21:33:10 2010 New Revision: 201535 URL: http://svn.freebsd.org/changeset/base/201535 Log: Revert 201158. DEFAULTS isn't for this kind of thing.a Modified: stable/8/sys/amd64/conf/DEFAULTS stable/8/sys/arm/conf/DEFAULTS stable/8/sys/i386/conf/DEFAULTS stable/8/sys/ia64/conf/DEFAULTS stable/8/sys/mips/conf/DEFAULTS stable/8/sys/pc98/conf/DEFAULTS stable/8/sys/powerpc/conf/DEFAULTS stable/8/sys/sparc64/conf/DEFAULTS stable/8/sys/sun4v/conf/DEFAULTS Modified: stable/8/sys/amd64/conf/DEFAULTS ============================================================================== --- stable/8/sys/amd64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/amd64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -20,10 +20,3 @@ options GEOM_PART_BSD options GEOM_PART_EBR options GEOM_PART_EBR_COMPAT options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/arm/conf/DEFAULTS ============================================================================== --- stable/8/sys/arm/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/arm/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -9,10 +9,3 @@ device mem options GEOM_PART_BSD options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/i386/conf/DEFAULTS ============================================================================== --- stable/8/sys/i386/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/i386/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -28,10 +28,3 @@ options GEOM_PART_MBR # enable support for native hardware options NATIVE device atpic - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/ia64/conf/DEFAULTS ============================================================================== --- stable/8/sys/ia64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/ia64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -17,10 +17,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/mips/conf/DEFAULTS ============================================================================== --- stable/8/sys/mips/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/mips/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -11,10 +11,3 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/pc98/conf/DEFAULTS ============================================================================== --- stable/8/sys/pc98/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/pc98/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -24,10 +24,3 @@ device uart_ns8250 # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_PC98 - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/powerpc/conf/DEFAULTS ============================================================================== --- stable/8/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -14,10 +14,3 @@ device uart_z8530 options GEOM_PART_APM options GEOM_PART_MBR - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/sparc64/conf/DEFAULTS ============================================================================== --- stable/8/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -19,10 +19,3 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/8/sys/sun4v/conf/DEFAULTS ============================================================================== --- stable/8/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:30:04 2010 (r201534) +++ stable/8/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) @@ -11,10 +11,3 @@ device mem # Memory and kernel memory # Default partitioning schemes options GEOM_PART_BSD options GEOM_PART_VTOC8 - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 21:45:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C608106566C; Mon, 4 Jan 2010 21:45:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39EF38FC1D; Mon, 4 Jan 2010 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Ljcxo088723; Mon, 4 Jan 2010 21:45:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04LjcdN088715; Mon, 4 Jan 2010 21:45:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001042145.o04LjcdN088715@svn.freebsd.org> From: Warner Losh Date: Mon, 4 Jan 2010 21:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201536 - in stable/7/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 21:45:38 -0000 Author: imp Date: Mon Jan 4 21:45:37 2010 New Revision: 201536 URL: http://svn.freebsd.org/changeset/base/201536 Log: Revert 201164. Truly optional items like this do not belong on DEFAULTS. Modified: stable/7/sys/amd64/conf/DEFAULTS stable/7/sys/i386/conf/DEFAULTS stable/7/sys/ia64/conf/DEFAULTS stable/7/sys/pc98/conf/DEFAULTS stable/7/sys/powerpc/conf/DEFAULTS stable/7/sys/sparc64/conf/DEFAULTS stable/7/sys/sun4v/conf/DEFAULTS Modified: stable/7/sys/amd64/conf/DEFAULTS ============================================================================== --- stable/7/sys/amd64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/amd64/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -21,10 +21,3 @@ options GEOM_MBR # KSE support went from being default to a kernel option options KSE - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/i386/conf/DEFAULTS ============================================================================== --- stable/7/sys/i386/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/i386/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -25,10 +25,3 @@ options GEOM_MBR # KSE support went from being default to a kernel option options KSE - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/ia64/conf/DEFAULTS ============================================================================== --- stable/7/sys/ia64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/ia64/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -20,10 +20,3 @@ options GEOM_PART_MBR # KSE support went from being default to a kernel option options KSE - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/pc98/conf/DEFAULTS ============================================================================== --- stable/7/sys/pc98/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/pc98/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -27,10 +27,3 @@ options GEOM_PC98 # KSE support went from being default to a kernel option options KSE - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/powerpc/conf/DEFAULTS ============================================================================== --- stable/7/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/powerpc/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -17,10 +17,3 @@ options GEOM_PART_MBR # KSE support went from being default to a kernel option options KSE - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/sparc64/conf/DEFAULTS ============================================================================== --- stable/7/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/sparc64/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -22,10 +22,3 @@ options GEOM_SUNLABEL # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: stable/7/sys/sun4v/conf/DEFAULTS ============================================================================== --- stable/7/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:33:10 2010 (r201535) +++ stable/7/sys/sun4v/conf/DEFAULTS Mon Jan 4 21:45:37 2010 (r201536) @@ -12,10 +12,3 @@ device genclock # Generic clock interfa # Default partitioning schemes options GEOM_BSD options GEOM_SUNLABEL - -# Store the plain version of the configuration file in the kernel itself. -# To store the entire file, including comments, put this in /etc/src.conf: -# CONFIGARGS= -C -# See config(8) for more details. -# -options INCLUDE_CONFIG_FILE # Include this file in kernel From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 22:15:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A1A0106566C; Mon, 4 Jan 2010 22:15:30 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id EEACF8FC12; Mon, 4 Jan 2010 22:15:29 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id DB5C3730A1; Mon, 4 Jan 2010 23:23:23 +0100 (CET) Date: Mon, 4 Jan 2010 23:23:23 +0100 From: Luigi Rizzo To: Michael Tuexen Message-ID: <20100104222323.GA49068@onelab2.iet.unipi.it> References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 22:15:30 -0000 On Mon, Jan 04, 2010 at 08:24:21PM +0100, Michael Tuexen wrote: > On Jan 4, 2010, at 8:00 PM, Luigi Rizzo wrote: > > > taking a random commit to this tree -- would you guys consider moving > > the sctp sources to its own directory, e.g. netinet/sctp/ or something > > that suits better ? > Why do you think that a place different from netinet/ does suit > better for the sctp_*.[ch] files than netinet/ ? This is at least the > place where TCP and UDP live... TCP and UDP landed there 25 years ago, but overall the directory has grown way too much, which makes it hard to browse through the files, check the logs, etc. etc.. BTW the size of individual files is also worrysome. Back in 2.2, the top 10 files in lines where 2302 7272 55414 ip_mroute.c 2226 9339 64746 tcp_input.c 1564 5349 38710 ip_input.c 1366 4768 33974 ip_output.c 1298 4214 32400 ip_fw.c 861 2927 20788 tcp_usrreq.c 764 3273 21779 tcp_output.c 762 2739 21695 in_pcb.c 730 2441 19269 in.c 712 2461 18672 ip_icmp.c Now we have (excluding sctp) 3648 12414 98354 /home/luigi/FreeBSD/head/sys/netinet/igmp.c 3440 13962 102928 /home/luigi/FreeBSD/head/sys/netinet/tcp_input.c 2909 9728 76470 /home/luigi/FreeBSD/head/sys/netinet/in_mcast.c 2894 9269 74956 /home/luigi/FreeBSD/head/sys/netinet/ip_mroute.c 2354 8521 66835 /home/luigi/FreeBSD/head/sys/netinet/tcp_subr.c 2299 6173 56414 /home/luigi/FreeBSD/head/sys/netinet/ip_carp.c 1950 6377 50717 /home/luigi/FreeBSD/head/sys/netinet/in_pcb.c 1871 5740 46629 /home/luigi/FreeBSD/head/sys/netinet/tcp_usrreq.c 1773 6692 51606 /home/luigi/FreeBSD/head/sys/netinet/tcp_syncache.c 1770 6165 45932 /home/luigi/FreeBSD/head/sys/netinet/ip_input.c (and sctp has some quite large files...) 13808 45244 367610 /home/luigi/FreeBSD/head/sys/netinet/sctp_output.c 8101 28015 253529 /home/luigi/FreeBSD/head/sys/netinet/sctp_indata.c 6938 21122 190172 /home/luigi/FreeBSD/head/sys/netinet/sctputil.c 6717 22130 195580 /home/luigi/FreeBSD/head/sys/netinet/sctp_pcb.c 5924 20286 185239 /home/luigi/FreeBSD/head/sys/netinet/sctp_input.c 4900 14271 140811 /home/luigi/FreeBSD/head/sys/netinet/sctp_usrreq.c This was the reason why I moved ipfw-related stuff out of the way and plan to do the same with tcp unless someone precedes me. Just checked, in 2.2 (which was some 12 years ago) netinet/ had 46 files and 21k lines, of which tcp accounted for 13 files/6K lines. Compare with 156 files/153k lines (tcp: 24 files, 16k lines) in HEAD now. I also think that the name of the new directory or the exact percentage of ipv4-ness or netinet-ness of the sctp* and tcp* and multicast* stuff is irrelevant. Moving directories with svn is so easy that we should not worry even if we need a couple of attempts to find a good name. cheers luigi From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 22:22:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E921065695; Mon, 4 Jan 2010 22:22:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE5788FC2F; Mon, 4 Jan 2010 22:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04MM0xE097637; Mon, 4 Jan 2010 22:22:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04MM0Db097633; Mon, 4 Jan 2010 22:22:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001042222.o04MM0Db097633@svn.freebsd.org> From: Christian Brueffer Date: Mon, 4 Jan 2010 22:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201538 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 22:22:01 -0000 Author: brueffer Date: Mon Jan 4 22:22:00 2010 New Revision: 201538 URL: http://svn.freebsd.org/changeset/base/201538 Log: Catch up with the VFS_VPTOFH(9) -> VOP_VPTOFH(9) repocopy that happened almost three years ago in r166794. PR: 140989 Submitted by: Lachlan Kang MFC after: 1 week Modified: head/share/man/man9/VFS.9 head/share/man/man9/VFS_CHECKEXP.9 head/share/man/man9/VFS_FHTOVP.9 Modified: head/share/man/man9/VFS.9 ============================================================================== --- head/share/man/man9/VFS.9 Mon Jan 4 22:21:56 2010 (r201537) +++ head/share/man/man9/VFS.9 Mon Jan 4 22:22:00 2010 (r201538) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd January 4, 2010 .Os .Dt VFS 9 .Sh NAME @@ -53,7 +53,7 @@ rather than implementing empty functions .Xr VFS_SYNC 9 , .Xr VFS_UNMOUNT 9 , .Xr VFS_VGET 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: head/share/man/man9/VFS_CHECKEXP.9 ============================================================================== --- head/share/man/man9/VFS_CHECKEXP.9 Mon Jan 4 22:21:56 2010 (r201537) +++ head/share/man/man9/VFS_CHECKEXP.9 Mon Jan 4 22:22:00 2010 (r201538) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_CHECKEXP 9 .Sh NAME @@ -81,7 +81,7 @@ and .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_FHTOVP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by Modified: head/share/man/man9/VFS_FHTOVP.9 ============================================================================== --- head/share/man/man9/VFS_FHTOVP.9 Mon Jan 4 22:21:56 2010 (r201537) +++ head/share/man/man9/VFS_FHTOVP.9 Mon Jan 4 22:22:00 2010 (r201538) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd January 4, 2010 .Os .Dt VFS_FHTOVP 9 .Sh NAME @@ -76,7 +76,7 @@ The locked vnode for the file will be re .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_CHECKEXP 9 , -.Xr VFS_VPTOFH 9 , +.Xr VOP_VPTOFH 9 , .Xr vnode 9 .Sh AUTHORS This manual page was written by From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 22:23:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3ECF106568F; Mon, 4 Jan 2010 22:23:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E38358FC12; Mon, 4 Jan 2010 22:23:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04MN94L097963; Mon, 4 Jan 2010 22:23:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04MN9fD097961; Mon, 4 Jan 2010 22:23:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001042223.o04MN9fD097961@svn.freebsd.org> From: Christian Brueffer Date: Mon, 4 Jan 2010 22:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201539 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 22:23:10 -0000 Author: brueffer Date: Mon Jan 4 22:23:09 2010 New Revision: 201539 URL: http://svn.freebsd.org/changeset/base/201539 Log: Add a missing word. PR: 140989 Submitted by: Lachlan Kang MFC after: 1 week Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Mon Jan 4 22:22:00 2010 (r201538) +++ head/share/man/man7/security.7 Mon Jan 4 22:23:09 2010 (r201539) @@ -88,7 +88,7 @@ incur on the system under adverse condit Brute-force network attacks are harder to deal with. A spoofed-packet attack, for example, is nearly impossible to stop short of cutting your system off from the Internet. -It may not be able to take your machine down, but it can fill up Internet +It may not be able to take your machine down, but it can fill up your Internet pipe. .Pp A user account compromise is even more common than a DoS attack. From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 22:44:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A4FC1065676; Mon, 4 Jan 2010 22:44:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 298AC8FC19; Mon, 4 Jan 2010 22:44:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04Minkm003271; Mon, 4 Jan 2010 22:44:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04Min7j003269; Mon, 4 Jan 2010 22:44:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001042244.o04Min7j003269@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Jan 2010 22:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201540 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 22:44:49 -0000 Author: jhb Date: Mon Jan 4 22:44:48 2010 New Revision: 201540 URL: http://svn.freebsd.org/changeset/base/201540 Log: MFC 201351: Use stricter checking to match possible vlan clones by not allowing extra garbage characters around or within the tag. Modified: stable/8/sys/net/if_vlan.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_vlan.c ============================================================================== --- stable/8/sys/net/if_vlan.c Mon Jan 4 22:23:09 2010 (r201539) +++ stable/8/sys/net/if_vlan.c Mon Jan 4 22:44:48 2010 (r201540) @@ -577,7 +577,7 @@ vlan_clone_match_ethertag(struct if_clon { const char *cp; struct ifnet *ifp; - int t = 0; + int t; /* Check for . style interface names. */ IFNET_RLOCK_NOSLEEP(); @@ -587,13 +587,15 @@ vlan_clone_match_ethertag(struct if_clon if (strncmp(ifp->if_xname, name, strlen(ifp->if_xname)) != 0) continue; cp = name + strlen(ifp->if_xname); - if (*cp != '.') + if (*cp++ != '.') continue; - for(; *cp != '\0'; cp++) { - if (*cp < '0' || *cp > '9') - continue; + if (*cp == '\0') + continue; + t = 0; + for(; *cp >= '0' && *cp <= '9'; cp++) t = (t * 10) + (*cp - '0'); - } + if (*cp != '\0') + continue; if (tag != NULL) *tag = t; break; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 22:45:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2768F106568B; Mon, 4 Jan 2010 22:45:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16BF98FC1C; Mon, 4 Jan 2010 22:45:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04MjKJY003422; Mon, 4 Jan 2010 22:45:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04MjKb6003420; Mon, 4 Jan 2010 22:45:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001042245.o04MjKb6003420@svn.freebsd.org> From: John Baldwin Date: Mon, 4 Jan 2010 22:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201541 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 22:45:21 -0000 Author: jhb Date: Mon Jan 4 22:45:20 2010 New Revision: 201541 URL: http://svn.freebsd.org/changeset/base/201541 Log: MFC 201351: Use stricter checking to match possible vlan clones by not allowing extra garbage characters around or within the tag. Modified: stable/7/sys/net/if_vlan.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Mon Jan 4 22:44:48 2010 (r201540) +++ stable/7/sys/net/if_vlan.c Mon Jan 4 22:45:20 2010 (r201541) @@ -573,7 +573,7 @@ vlan_clone_match_ethertag(struct if_clon { const char *cp; struct ifnet *ifp; - int t = 0; + int t; /* Check for . style interface names. */ IFNET_RLOCK(); @@ -583,13 +583,15 @@ vlan_clone_match_ethertag(struct if_clon if (strncmp(ifp->if_xname, name, strlen(ifp->if_xname)) != 0) continue; cp = name + strlen(ifp->if_xname); - if (*cp != '.') + if (*cp++ != '.') continue; - for(; *cp != '\0'; cp++) { - if (*cp < '0' || *cp > '9') - continue; + if (*cp == '\0') + continue; + t = 0; + for(; *cp >= '0' && *cp <= '9'; cp++) t = (t * 10) + (*cp - '0'); - } + if (*cp != '\0') + continue; if (tag != NULL) *tag = t; break; From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 23:29:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29FBC1065672; Mon, 4 Jan 2010 23:29:05 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from mail.vega.ru (mail.vega.ru [90.156.167.5]) by mx1.freebsd.org (Postfix) with ESMTP id D8E738FC15; Mon, 4 Jan 2010 23:29:04 +0000 (UTC) Authentication-Results: mail.vega.ru; dkim=unverified, header.i=@FreeBSD.org Authentication-Results: mail.vega.ru; domainkeys=; header.sender= Received: from [10.100.124.99] (helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NRwMB-0001q7-Dx; Tue, 05 Jan 2010 02:29:03 +0300 Date: Tue, 5 Jan 2010 02:28:52 +0300 From: Ruslan Ermilov To: Gleb Smirnoff Message-ID: <20100104232852.GA14676@edoofus.dev.vega.ru> References: <200912021324.nB2DOLuO006676@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912021324.nB2DOLuO006676@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r200026 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 23:29:05 -0000 On Wed, Dec 02, 2009 at 01:24:21PM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Wed Dec 2 13:24:21 2009 > New Revision: 200026 > URL: http://svn.freebsd.org/changeset/base/200026 > > Log: > Until this moment carp(4) used a strange logging priority. It used debug > priority for such important information as MASTER/BACKUP state change, > and used a normal logging priority for such innocent messages as receiving > short packet (which is a normal VRRP packet between some other routers) or > receving a CARP packet on non-carp interface (someone else running CARP). > > This commit shifts message logging priorities to a more sane default. > > Modified: > head/sys/netinet/ip_carp.c I was wondering why I get these "carp_input: packet received on non-carp interface: %s" messages on FreeBSD 8 and not on FreeBSD 7. This is because ip_input() no longer filters multicast datagrams itself. "Protocols must perform their own filtering and update statistics accordingly." Anyway, this change went undocumented and I think it's partly inconsistent. Here's a proposed patch: %%% Index: sys/netinet/ip_carp.c =================================================================== --- sys/netinet/ip_carp.c (revision 201533) +++ sys/netinet/ip_carp.c (working copy) @@ -560,7 +560,7 @@ /* verify that the IP TTL is 255. */ if (ip->ip_ttl != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG("carp_input: received ttl %d != 255i on %s\n", + CARP_DEBUG("carp_input: received ttl %d != 255 on %s\n", ip->ip_ttl, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -739,7 +739,7 @@ CARPSTATS_INC(carps_badauth); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); - CARP_LOG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); + CARP_DEBUG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); m_freem(m); return; } Index: share/man/man4/carp.4 =================================================================== --- share/man/man4/carp.4 (revision 201533) +++ share/man/man4/carp.4 (working copy) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2006 +.Dd January 5, 2010 .Dt CARP 4 .Os .Sh NAME @@ -118,12 +118,12 @@ Disabled by default. .It Va net.inet.carp.log Value of 0 disables any logging. -Value of 1 enables logging of bad +Value of 1 enables logging state changes of .Nm +interfaces. +Values above 1 enable logging of bad +.Nm packets. -Values above 1 enable logging state changes of -.Nm -interfaces. Default value is 1. .It Va net.inet.carp.arpbalance Balance local traffic using ARP (see below). %%% Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer From owner-svn-src-all@FreeBSD.ORG Mon Jan 4 23:39:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC871065694; Mon, 4 Jan 2010 23:39:53 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E74B8FC1F; Mon, 4 Jan 2010 23:39:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o04NdraC015687; Mon, 4 Jan 2010 23:39:53 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o04NdrYp015685; Mon, 4 Jan 2010 23:39:53 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001042339.o04NdrYp015685@svn.freebsd.org> From: Qing Li Date: Mon, 4 Jan 2010 23:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201543 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jan 2010 23:39:53 -0000 Author: qingli Date: Mon Jan 4 23:39:53 2010 New Revision: 201543 URL: http://svn.freebsd.org/changeset/base/201543 Log: The IFA_RTSELF address flag marks a loopback route has been installed for the interface address. This marker is necessary to properly support PPP types of links where multiple links can have the same local end IP address. The IFA_RTSELF flag bit maps to the RTF_HOST value, which was combined into the route flag bits during prefix installation in IPv6. This inclusion causing the prefix route to be unusable. This patch fixes this bug by excluding the IFA_RTSELF flag during route installation. MFC after: 5 days Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Mon Jan 4 22:57:33 2010 (r201542) +++ head/sys/netinet6/nd6_rtr.c Mon Jan 4 23:39:53 2010 (r201543) @@ -1629,7 +1629,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) bzero(&mask6, sizeof(mask6)); mask6.sin6_len = sizeof(mask6); mask6.sin6_addr = pr->ndpr_mask; - rtflags = ifa->ifa_flags | RTF_UP; + rtflags = (ifa->ifa_flags & ~IFA_RTSELF) | RTF_UP; error = rtrequest(RTM_ADD, (struct sockaddr *)&pr->ndpr_prefix, ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); if (error == 0) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 00:35:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 353AF1065692; Tue, 5 Jan 2010 00:35:47 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 244B78FC17; Tue, 5 Jan 2010 00:35:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o050ZlVF028159; Tue, 5 Jan 2010 00:35:47 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o050Zluo028157; Tue, 5 Jan 2010 00:35:47 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001050035.o050Zluo028157@svn.freebsd.org> From: Qing Li Date: Tue, 5 Jan 2010 00:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201544 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 00:35:47 -0000 Author: qingli Date: Tue Jan 5 00:35:46 2010 New Revision: 201544 URL: http://svn.freebsd.org/changeset/base/201544 Log: An existing incomplete ARP entry would expire a subsequent statically configured entry of the same host. This bug was due to the expiration timer was not cancelled when installing the static entry. Since there exist a potential race condition with respect to timer cancellation, simply check for the LLE_STATIC bit inside the expiration function instead of cancelling the active timer. MFC after: 5 days Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Mon Jan 4 23:39:53 2010 (r201543) +++ head/sys/netinet/if_ether.c Tue Jan 5 00:35:46 2010 (r201544) @@ -175,18 +175,24 @@ arptimer(void *arg) CURVNET_SET(ifp->if_vnet); IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - if ((!callout_pending(&lle->la_timer) && - callout_active(&lle->la_timer))) { - (void) llentry_free(lle); - ARPSTAT_INC(timeouts); - } -#ifdef DIAGNOSTIC + if (lle->la_flags & LLE_STATIC) + LLE_WUNLOCK(lle); else { - struct sockaddr *l3addr = L3_ADDR(lle); - log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, - inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); - } + if (!callout_pending(&lle->la_timer) && + callout_active(&lle->la_timer)) { + (void) llentry_free(lle); + ARPSTAT_INC(timeouts); + } +#ifdef DIAGNOSTIC + else { + struct sockaddr *l3addr = L3_ADDR(lle); + log(LOG_INFO, + "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, + inet_ntoa( + ((const struct sockaddr_in *)l3addr)->sin_addr)); + } #endif + } IF_AFDATA_UNLOCK(ifp); CURVNET_RESTORE(); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 02:06:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B1CD1065698; Tue, 5 Jan 2010 02:06:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1AF8FC15; Tue, 5 Jan 2010 02:06:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05265fJ053912; Tue, 5 Jan 2010 02:06:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05265Ln053910; Tue, 5 Jan 2010 02:06:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001050206.o05265Ln053910@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 02:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201545 - head/sys/geom/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 02:06:05 -0000 Author: mav Date: Tue Jan 5 02:06:05 2010 New Revision: 201545 URL: http://svn.freebsd.org/changeset/base/201545 Log: Slightly optimize XOR calculation. Modified: head/sys/geom/raid3/g_raid3.c Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Tue Jan 5 00:35:46 2010 (r201544) +++ head/sys/geom/raid3/g_raid3.c Tue Jan 5 02:06:05 2010 (r201545) @@ -231,31 +231,31 @@ g_raid3_uma_dtor(void *mem, int size, vo sz->sz_inuse--; } -#define g_raid3_xor(src1, src2, dst, size) \ - _g_raid3_xor((uint64_t *)(src1), (uint64_t *)(src2), \ +#define g_raid3_xor(src, dst, size) \ + _g_raid3_xor((uint64_t *)(src), \ (uint64_t *)(dst), (size_t)size) static void -_g_raid3_xor(uint64_t *src1, uint64_t *src2, uint64_t *dst, size_t size) +_g_raid3_xor(uint64_t *src, uint64_t *dst, size_t size) { KASSERT((size % 128) == 0, ("Invalid size: %zu.", size)); for (; size > 0; size -= 128) { - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); - *dst++ = (*src1++) ^ (*src2++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); + *dst++ ^= (*src++); } } @@ -1049,6 +1049,7 @@ g_raid3_scatter(struct bio *pbp) struct g_raid3_disk *disk; struct bio *bp, *cbp, *tmpbp; off_t atom, cadd, padd, left; + int first; sc = pbp->bio_to->geom->softc; bp = NULL; @@ -1079,12 +1080,18 @@ g_raid3_scatter(struct bio *pbp) /* * Calculate parity. */ - bzero(bp->bio_data, bp->bio_length); + first = 1; G_RAID3_FOREACH_SAFE_BIO(pbp, cbp, tmpbp) { if (cbp == bp) continue; - g_raid3_xor(cbp->bio_data, bp->bio_data, bp->bio_data, - bp->bio_length); + if (first) { + bcopy(cbp->bio_data, bp->bio_data, + bp->bio_length); + first = 0; + } else { + g_raid3_xor(cbp->bio_data, bp->bio_data, + bp->bio_length); + } if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_NODISK) != 0) g_raid3_destroy_bio(sc, cbp); } @@ -1216,7 +1223,7 @@ g_raid3_gather(struct bio *pbp) G_RAID3_FOREACH_BIO(pbp, cbp) { if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_PARITY) != 0) continue; - g_raid3_xor(cbp->bio_data, xbp->bio_data, xbp->bio_data, + g_raid3_xor(cbp->bio_data, xbp->bio_data, xbp->bio_length); } xbp->bio_cflags &= ~G_RAID3_BIO_CFLAG_PARITY; @@ -1639,7 +1646,7 @@ g_raid3_sync_request(struct bio *bp) bcopy(src, dst, atom); src += atom; for (n = 1; n < sc->sc_ndisks - 1; n++) { - g_raid3_xor(src, dst, dst, atom); + g_raid3_xor(src, dst, atom); src += atom; } dst += atom; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 02:37:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4ACF1065679; Tue, 5 Jan 2010 02:37:59 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF62D8FC14; Tue, 5 Jan 2010 02:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o052bxvO061454; Tue, 5 Jan 2010 02:37:59 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o052bxEd061444; Tue, 5 Jan 2010 02:37:59 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050237.o052bxEd061444@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 02:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201546 - in head: . include lib/libc/gen lib/libc/include lib/libthr lib/libthr/thread sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 02:37:59 -0000 Author: davidxu Date: Tue Jan 5 02:37:59 2010 New Revision: 201546 URL: http://svn.freebsd.org/changeset/base/201546 Log: Use umtx to implement process sharable semaphore, to make this work, now type sema_t is a structure which can be put in a shared memory area, and multiple processes can operate it concurrently. User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open() to initialize a shared semaphore. Named semaphore uses file system and is located in /tmp directory, and its file name is prefixed with 'SEMD', so now it is chroot or jail friendly. In simplist cases, both for named and un-named semaphore, userland code does not have to enter kernel to reduce/increase semaphore's count. The semaphore is designed to be crash-safe, it means even if an application is crashed in the middle of operating semaphore, the semaphore state is still safely recovered by later use, there is no waiter counter maintained by userland code. The main semaphore code is in libc and libthr only has some necessary stubs, this makes it possible that a non-threaded application can use semaphore without linking to thread library. Old semaphore implementation is kept libc to maintain binary compatibility. The kernel ksem API is no longer used in the new implemenation. Discussed on: threads@ Added: head/include/semaphore.h (contents, props changed) head/lib/libc/gen/sem_new.c (contents, props changed) head/lib/libthr/thread/thr_sem_new.c (contents, props changed) Deleted: head/sys/sys/semaphore.h Modified: head/ObsoleteFiles.inc head/include/Makefile head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/_pthread_stubs.c head/lib/libc/gen/sem.c head/lib/libc/include/libc_private.h head/lib/libthr/pthread.map head/lib/libthr/thread/Makefile.inc head/lib/libthr/thread/thr_init.c head/lib/libthr/thread/thr_private.h head/lib/libthr/thread/thr_sem.c head/sys/kern/uipc_sem.c head/sys/sys/_semaphore.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jan 5 02:06:05 2010 (r201545) +++ head/ObsoleteFiles.inc Tue Jan 5 02:37:59 2010 (r201546) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100105: new userland semaphore implementation +OLD_FILES+=usr/include/sys/semaphore.h # 20100103: ntptrace(8) removed OLD_FILES+=usr/sbin/ntptrace OLD_FILES+=usr/share/man/man8/ntptrace.8.gz Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Tue Jan 5 02:06:05 2010 (r201545) +++ head/include/Makefile Tue Jan 5 02:37:59 2010 (r201546) @@ -18,7 +18,7 @@ INCS= a.out.h ar.h assert.h bitstring.h netdb.h nl_types.h nlist.h nss.h nsswitch.h paths.h \ printf.h proc_service.h pthread.h \ pthread_np.h pwd.h ranlib.h readpassphrase.h regex.h regexp.h \ - res_update.h resolv.h runetype.h search.h setjmp.h \ + res_update.h resolv.h runetype.h search.h semaphore.h setjmp.h \ signal.h spawn.h stab.h \ stdbool.h stddef.h stdio.h stdlib.h string.h stringlist.h \ strings.h sysexits.h tar.h termios.h tgmath.h \ @@ -28,7 +28,7 @@ INCS= a.out.h ar.h assert.h bitstring.h MHDRS= float.h floatingpoint.h stdarg.h -PHDRS= sched.h semaphore.h _semaphore.h +PHDRS= sched.h _semaphore.h LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdint.h syslog.h \ ucontext.h Added: head/include/semaphore.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/include/semaphore.h Tue Jan 5 02:37:59 2010 (r201546) @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2010 David Xu + * + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* semaphore.h: POSIX 1003.1b semaphores */ + +#ifndef _SEMAPHORE_H_ +#define _SEMAPHORE_H_ + +#include +#include +#include + +struct _sem { + __uint32_t _magic; + struct _usem _kern; +}; + +typedef struct _sem sem_t; + +#define SEM_FAILED ((sem_t *)0) +#define SEM_VALUE_MAX __INT_MAX + +struct timespec; + +__BEGIN_DECLS +int sem_close(sem_t *); +int sem_destroy(sem_t *); +int sem_getvalue(sem_t * __restrict, int * __restrict); +int sem_init(sem_t *, int, unsigned int); +sem_t *sem_open(const char *, int, ...); +int sem_post(sem_t *); +int sem_timedwait(sem_t * __restrict, const struct timespec * __restrict); +int sem_trywait(sem_t *); +int sem_unlink(const char *); +int sem_wait(sem_t *); +__END_DECLS + +#endif /* !_SEMAPHORE_H_ */ Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Jan 5 02:06:05 2010 (r201545) +++ head/lib/libc/gen/Makefile.inc Tue Jan 5 02:37:59 2010 (r201546) @@ -25,7 +25,7 @@ SRCS+= __getosreldate.c __xuname.c \ pause.c pmadvise.c popen.c posix_spawn.c \ psignal.c pw_scan.c pwcache.c \ raise.c readdir.c readpassphrase.c rewinddir.c \ - scandir.c seed48.c seekdir.c sem.c semctl.c \ + scandir.c seed48.c seekdir.c sem.c sem_new.c semctl.c \ setdomainname.c sethostname.c setjmperr.c setmode.c \ setproctitle.c setprogname.c siginterrupt.c siglist.c signal.c \ sigsetops.c sleep.c srand48.c statvfs.c stringlist.c strtofflags.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Jan 5 02:06:05 2010 (r201545) +++ head/lib/libc/gen/Symbol.map Tue Jan 5 02:37:59 2010 (r201546) @@ -236,16 +236,6 @@ FBSD_1.0 { seekdir; user_from_uid; group_from_gid; - sem_init; - sem_destroy; - sem_open; - sem_close; - sem_unlink; - sem_wait; - sem_trywait; - sem_timedwait; - sem_post; - sem_getvalue; setdomainname; sethostname; longjmperror; @@ -363,11 +353,23 @@ FBSD_1.1 { semctl; tcgetsid; tcsetsid; + __pthread_cleanup_pop_imp; + __pthread_cleanup_push_imp; }; FBSD_1.2 { basename_r; getpagesizes; + sem_close; + sem_destroy; + sem_getvalue; + sem_init; + sem_open; + sem_timedwait; + sem_trywait; + sem_post; + sem_wait; + sem_unlink; }; FBSDprivate_1.0 { @@ -456,16 +458,6 @@ FBSDprivate_1.0 { __pw_scan; /* Used by (at least) libutil */ __raise; _raise; - __sem_init; - __sem_destroy; - __sem_open; - __sem_close; - __sem_unlink; - __sem_wait; - __sem_trywait; - __sem_timedwait; - __sem_post; - __sem_getvalue; __sleep; _sleep; _rtld_allocate_tls; @@ -482,4 +474,23 @@ FBSDprivate_1.0 { _wait; __waitpid; _waitpid; + + _libc_sem_destroy; + _libc_sem_init; + _libc_sem_getvalue; + _libc_sem_trywait; + _libc_sem_wait; + _libc_sem_timedwait; + _libc_sem_post; + + _libc_sem_init_compat; + _libc_sem_destroy_compat; + _libc_sem_open_compat; + _libc_sem_close_compat; + _libc_sem_unlink_compat; + _libc_sem_wait_compat; + _libc_sem_trywait_compat; + _libc_sem_timedwait_compat; + _libc_sem_post_compat; + _libc_sem_getvalue_compat; }; Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Tue Jan 5 02:06:05 2010 (r201545) +++ head/lib/libc/gen/_pthread_stubs.c Tue Jan 5 02:37:59 2010 (r201546) @@ -119,6 +119,8 @@ pthread_func_entry_t __thr_jtable[PJT_MA {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SETSPECIFIC */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_SIGMASK */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_TESTCANCEL */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_POP_IMP */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_CLEANUP_PUSH_IMP */ }; /* @@ -265,6 +267,8 @@ STUB_FUNC2(pthread_kill, PJT_KILL, int, STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *) STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *) STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void) +STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int) +STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *); static int stub_zero(void) Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Tue Jan 5 02:06:05 2010 (r201545) +++ head/lib/libc/gen/sem.c Tue Jan 5 02:37:59 2010 (r201546) @@ -1,4 +1,5 @@ /* + * Copyright (C) 2010 David Xu . * Copyright (C) 2000 Jason Evans . * All rights reserved. * @@ -59,34 +60,71 @@ #include "namespace.h" #include #include +#include #include +#include +#include +#include #include #include -#include #include #include #include -#include <_semaphore.h> #include "un-namespace.h" #include "libc_private.h" +/* + * Old semaphore definitions. + */ +struct sem { +#define SEM_MAGIC ((u_int32_t) 0x09fa4012) + u_int32_t magic; + pthread_mutex_t lock; + pthread_cond_t gtzero; + u_int32_t count; + u_int32_t nwaiters; +#define SEM_USER (NULL) + semid_t semid; /* semaphore id if kernel (shared) semaphore */ + int syssem; /* 1 if kernel (shared) semaphore */ + LIST_ENTRY(sem) entry; + struct sem **backpointer; +}; + +typedef struct sem* sem_t; + +#define SEM_FAILED ((sem_t *)0) +#define SEM_VALUE_MAX __INT_MAX + +#define SYM_FB10(sym) __CONCAT(sym, _fb10) +#define SYM_FBP10(sym) __CONCAT(sym, _fbp10) +#define WEAK_REF(sym, alias) __weak_reference(sym, alias) +#define SYM_COMPAT(sym, impl, ver) __sym_compat(sym, impl, ver) +#define SYM_DEFAULT(sym, impl, ver) __sym_default(sym, impl, ver) + +#define FB10_COMPAT(func, sym) \ + WEAK_REF(func, SYM_FB10(sym)); \ + SYM_COMPAT(sym, SYM_FB10(sym), FBSD_1.0) + +#define FB10_COMPAT_PRIVATE(func, sym) \ + WEAK_REF(func, SYM_FBP10(sym)); \ + SYM_DEFAULT(sym, SYM_FBP10(sym), FBSDprivate_1.0) + static sem_t sem_alloc(unsigned int value, semid_t semid, int system_sem); static void sem_free(sem_t sem); -static LIST_HEAD(, sem) named_sems = LIST_HEAD_INITIALIZER(named_sems); +static LIST_HEAD(, sem) named_sems = LIST_HEAD_INITIALIZER(&named_sems); static pthread_mutex_t named_sems_mtx = PTHREAD_MUTEX_INITIALIZER; -__weak_reference(__sem_init, sem_init); -__weak_reference(__sem_destroy, sem_destroy); -__weak_reference(__sem_open, sem_open); -__weak_reference(__sem_close, sem_close); -__weak_reference(__sem_unlink, sem_unlink); -__weak_reference(__sem_wait, sem_wait); -__weak_reference(__sem_trywait, sem_trywait); -__weak_reference(__sem_timedwait, sem_timedwait); -__weak_reference(__sem_post, sem_post); -__weak_reference(__sem_getvalue, sem_getvalue); - +FB10_COMPAT(_libc_sem_init_compat, sem_init); +FB10_COMPAT(_libc_sem_destroy_compat, sem_destroy); +FB10_COMPAT(_libc_sem_open_compat, sem_open); +FB10_COMPAT(_libc_sem_close_compat, sem_close); +FB10_COMPAT(_libc_sem_unlink_compat, sem_unlink); +FB10_COMPAT(_libc_sem_wait_compat, sem_wait); +FB10_COMPAT(_libc_sem_trywait_compat, sem_trywait); +FB10_COMPAT(_libc_sem_timedwait_compat, sem_timedwait); +FB10_COMPAT(_libc_sem_post_compat, sem_post); +FB10_COMPAT(_libc_sem_getvalue_compat, sem_getvalue); static inline int sem_check_validity(sem_t *sem) @@ -104,8 +142,6 @@ static void sem_free(sem_t sem) { - _pthread_mutex_destroy(&sem->lock); - _pthread_cond_destroy(&sem->gtzero); sem->magic = 0; free(sem); } @@ -131,13 +167,11 @@ sem_alloc(unsigned int value, semid_t se sem->magic = SEM_MAGIC; sem->semid = semid; sem->syssem = system_sem; - sem->lock = PTHREAD_MUTEX_INITIALIZER; - sem->gtzero = PTHREAD_COND_INITIALIZER; return (sem); } int -__sem_init(sem_t *sem, int pshared, unsigned int value) +_libc_sem_init_compat(sem_t *sem, int pshared, unsigned int value) { semid_t semid; @@ -147,26 +181,27 @@ __sem_init(sem_t *sem, int pshared, unsi * pthread_cond_wait() is just a stub that doesn't really * wait. */ - if (ksem_init(&semid, value) != 0) + semid = (semid_t)SEM_USER; + if ((pshared != 0) && ksem_init(&semid, value) != 0) return (-1); - (*sem) = sem_alloc(value, semid, 1); + *sem = sem_alloc(value, semid, pshared); if ((*sem) == NULL) { - ksem_destroy(semid); + if (pshared != 0) + ksem_destroy(semid); return (-1); } return (0); } int -__sem_destroy(sem_t *sem) +_libc_sem_destroy_compat(sem_t *sem) { int retval; if (sem_check_validity(sem) != 0) return (-1); - _pthread_mutex_lock(&(*sem)->lock); /* * If this is a system semaphore let the kernel track it otherwise * make sure there are no waiters. @@ -181,18 +216,14 @@ __sem_destroy(sem_t *sem) retval = 0; (*sem)->magic = 0; } - _pthread_mutex_unlock(&(*sem)->lock); - if (retval == 0) { - _pthread_mutex_destroy(&(*sem)->lock); - _pthread_cond_destroy(&(*sem)->gtzero); + if (retval == 0) sem_free(*sem); - } return (retval); } sem_t * -__sem_open(const char *name, int oflag, ...) +_libc_sem_open_compat(const char *name, int oflag, ...) { sem_t *sem; sem_t s; @@ -255,7 +286,7 @@ err: } int -__sem_close(sem_t *sem) +_libc_sem_close_compat(sem_t *sem) { if (sem_check_validity(sem) != 0) @@ -280,68 +311,156 @@ __sem_close(sem_t *sem) } int -__sem_unlink(const char *name) +_libc_sem_unlink_compat(const char *name) { return (ksem_unlink(name)); } -int -__sem_wait(sem_t *sem) +static int +enable_async_cancel(void) { + int old; - if (sem_check_validity(sem) != 0) + _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); + return (old); +} + +static void +restore_async_cancel(int val) +{ + _pthread_setcanceltype(val, NULL); +} + +static int +_umtx_wait_uint(volatile unsigned *mtx, unsigned id, const struct timespec *timeout) +{ + if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && + timeout->tv_nsec <= 0))) { + errno = ETIMEDOUT; return (-1); + } + return _umtx_op(__DEVOLATILE(void *, mtx), + UMTX_OP_WAIT_UINT_PRIVATE, id, NULL, __DECONST(void*, timeout)); +} - return (ksem_wait((*sem)->semid)); +static int +_umtx_wake(volatile void *mtx) +{ + return _umtx_op(__DEVOLATILE(void *, mtx), UMTX_OP_WAKE_PRIVATE, + 1, NULL, NULL); +} + +#define TIMESPEC_SUB(dst, src, val) \ + do { \ + (dst)->tv_sec = (src)->tv_sec - (val)->tv_sec; \ + (dst)->tv_nsec = (src)->tv_nsec - (val)->tv_nsec; \ + if ((dst)->tv_nsec < 0) { \ + (dst)->tv_sec--; \ + (dst)->tv_nsec += 1000000000; \ + } \ + } while (0) + + +static void +sem_cancel_handler(void *arg) +{ + sem_t *sem = arg; + + atomic_add_int(&(*sem)->nwaiters, -1); + if ((*sem)->nwaiters && (*sem)->count) + _umtx_wake(&(*sem)->count); } int -__sem_trywait(sem_t *sem) +_libc_sem_timedwait_compat(sem_t * __restrict sem, + const struct timespec * __restrict abstime) { - int retval; + struct timespec ts, ts2; + int val, retval, saved_cancel; if (sem_check_validity(sem) != 0) return (-1); - if ((*sem)->syssem != 0) - retval = ksem_trywait((*sem)->semid); - else { - _pthread_mutex_lock(&(*sem)->lock); - if ((*sem)->count > 0) { - (*sem)->count--; - retval = 0; - } else { - errno = EAGAIN; - retval = -1; + if ((*sem)->syssem != 0) { + saved_cancel = enable_async_cancel(); + retval = ksem_wait((*sem)->semid); + restore_async_cancel(saved_cancel); + return (retval); + } + + retval = 0; + _pthread_testcancel(); + for (;;) { + while ((val = (*sem)->count) > 0) { + if (atomic_cmpset_acq_int(&(*sem)->count, val, val - 1)) + return (0); + } + if (retval) + break; + if (abstime) { + if (abstime->tv_nsec >= 1000000000 || abstime->tv_nsec < 0) { + errno = EINVAL; + return (-1); + } + clock_gettime(CLOCK_REALTIME, &ts); + TIMESPEC_SUB(&ts2, abstime, &ts); } - _pthread_mutex_unlock(&(*sem)->lock); + atomic_add_int(&(*sem)->nwaiters, 1); + pthread_cleanup_push(sem_cancel_handler, sem); + saved_cancel = enable_async_cancel(); + retval = _umtx_wait_uint(&(*sem)->count, 0, abstime ? &ts2 : NULL); + restore_async_cancel(saved_cancel); + pthread_cleanup_pop(0); + atomic_add_int(&(*sem)->nwaiters, -1); } return (retval); } int -__sem_timedwait(sem_t * __restrict sem, - const struct timespec * __restrict abs_timeout) +_libc_sem_wait_compat(sem_t *sem) { + return _libc_sem_timedwait_compat(sem, NULL); +} + +int +_libc_sem_trywait_compat(sem_t *sem) +{ + int val; + if (sem_check_validity(sem) != 0) return (-1); - return (ksem_timedwait((*sem)->semid, abs_timeout)); + if ((*sem)->syssem != 0) + return ksem_trywait((*sem)->semid); + + while ((val = (*sem)->count) > 0) { + if (atomic_cmpset_acq_int(&(*sem)->count, val, val - 1)) + return (0); + } + errno = EAGAIN; + return (-1); } int -__sem_post(sem_t *sem) +_libc_sem_post_compat(sem_t *sem) { if (sem_check_validity(sem) != 0) return (-1); - return (ksem_post((*sem)->semid)); + if ((*sem)->syssem != 0) + return ksem_post((*sem)->semid); + + atomic_add_rel_int(&(*sem)->count, 1); + + if ((*sem)->nwaiters) + return _umtx_wake(&(*sem)->count); + return (0); } int -__sem_getvalue(sem_t * __restrict sem, int * __restrict sval) +_libc_sem_getvalue_compat(sem_t * __restrict sem, int * __restrict sval) { int retval; @@ -351,10 +470,7 @@ __sem_getvalue(sem_t * __restrict sem, i if ((*sem)->syssem != 0) retval = ksem_getvalue((*sem)->semid, sval); else { - _pthread_mutex_lock(&(*sem)->lock); *sval = (int)(*sem)->count; - _pthread_mutex_unlock(&(*sem)->lock); - retval = 0; } return (retval); Added: head/lib/libc/gen/sem_new.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/sem_new.c Tue Jan 5 02:37:59 2010 (r201546) @@ -0,0 +1,470 @@ +/* + * Copyright (C) 2010 David Xu . + * 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(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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 "namespace.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" + +__weak_reference(_libc_sem_close, sem_close); +__weak_reference(_libc_sem_close, _sem_close); +__weak_reference(_libc_sem_destroy, sem_destroy); +__weak_reference(_libc_sem_destroy, _sem_destroy); +__weak_reference(_libc_sem_getvalue, sem_getvalue); +__weak_reference(_libc_sem_getvalue, _sem_getvalue); +__weak_reference(_libc_sem_init, sem_init); +__weak_reference(_libc_sem_init, _sem_init); +__weak_reference(_libc_sem_open, sem_open); +__weak_reference(_libc_sem_open, _sem_open); +__weak_reference(_libc_sem_post, sem_post); +__weak_reference(_libc_sem_post, _sem_post); +__weak_reference(_libc_sem_timedwait, sem_timedwait); +__weak_reference(_libc_sem_timedwait, _sem_timedwait); +__weak_reference(_libc_sem_trywait, sem_trywait); +__weak_reference(_libc_sem_trywait, _sem_trywait); +__weak_reference(_libc_sem_unlink, sem_unlink); +__weak_reference(_libc_sem_unlink, _sem_unlink); +__weak_reference(_libc_sem_wait, sem_wait); +__weak_reference(_libc_sem_wait, _sem_wait); + +#define SEM_PREFIX "/tmp/SEMD" +#define SEM_MAGIC ((u_int32_t)0x73656d31) + +struct sem_nameinfo { + int open_count; + char *name; + sem_t *sem; + LIST_ENTRY(sem_nameinfo) next; +}; + +static pthread_once_t once = PTHREAD_ONCE_INIT; +static pthread_mutex_t sem_llock; +static LIST_HEAD(,sem_nameinfo) sem_list = LIST_HEAD_INITIALIZER(sem_list); + +static void +sem_prefork() +{ + + _pthread_mutex_lock(&sem_llock); +} + +static void +sem_postfork() +{ + _pthread_mutex_unlock(&sem_llock); +} + +static void +sem_child_postfork() +{ + _pthread_mutex_unlock(&sem_llock); +} + +static void +sem_module_init(void) +{ + pthread_mutexattr_t ma; + + _pthread_mutexattr_init(&ma); + _pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_RECURSIVE); + _pthread_mutex_init(&sem_llock, &ma); + _pthread_mutexattr_destroy(&ma); + _pthread_atfork(sem_prefork, sem_postfork, sem_child_postfork); +} + +static inline int +sem_check_validity(sem_t *sem) +{ + + if (sem->_magic == SEM_MAGIC) + return (0); + else { + errno = EINVAL; + return (-1); + } +} + +int +_libc_sem_init(sem_t *sem, int pshared, unsigned int value) +{ + + if (value > SEM_VALUE_MAX) { + errno = EINVAL; + return (-1); + } + + bzero(sem, sizeof(sem_t)); + sem->_magic = SEM_MAGIC; + sem->_kern._count = (u_int32_t)value; + sem->_kern._has_waiters = 0; + sem->_kern._flags = pshared ? USYNC_PROCESS_SHARED : 0; + return (0); +} + +sem_t * +_libc_sem_open(const char *name, int flags, ...) +{ + char path[PATH_MAX]; + + struct stat sb; + va_list ap; + struct sem_nameinfo *ni = NULL; + sem_t *sem = NULL; + int fd = -1, mode, len; + + if (name[0] != '/') { + errno = EINVAL; + return (NULL); + } + name++; + + if (flags & ~(O_CREAT|O_EXCL)) { + errno = EINVAL; + return (NULL); + } + + _pthread_once(&once, sem_module_init); + + _pthread_mutex_lock(&sem_llock); + LIST_FOREACH(ni, &sem_list, next) { + if (strcmp(name, ni->name) == 0) { + ni->open_count++; + sem = ni->sem; + _pthread_mutex_unlock(&sem_llock); + return (sem); + } + } + + if (flags & O_CREAT) { + va_start(ap, flags); + mode = va_arg(ap, int); + va_end(ap); + } + + len = sizeof(*ni) + strlen(name) + 1; + ni = (struct sem_nameinfo *)malloc(len); + if (ni == NULL) { + errno = ENOSPC; + goto error; + } + + ni->name = (char *)(ni+1); + strcpy(ni->name, name); + + strcpy(path, SEM_PREFIX); + if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { + errno = ENAMETOOLONG; + goto error; + } + + fd = _open(path, flags|O_RDWR, mode); + if (fd == -1) + goto error; + if (flock(fd, LOCK_EX) == -1) + goto error; + if (_fstat(fd, &sb)) { + flock(fd, LOCK_UN); + goto error; + } + if (sb.st_size < sizeof(sem_t)) { + sem_t tmp; + + tmp._magic = SEM_MAGIC; + tmp._kern._has_waiters = 0; + tmp._kern._count = 0; + tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED; + if (_write(fd, &tmp, sizeof(tmp)) != sizeof(tmp)) { + flock(fd, LOCK_UN); + goto error; + } + } + flock(fd, LOCK_UN); + sem = (sem_t *)mmap(NULL, sizeof(sem_t), PROT_READ|PROT_WRITE, + MAP_SHARED|MAP_NOSYNC, fd, 0); + if (sem == MAP_FAILED) { + sem = NULL; + if (errno == ENOMEM) + errno = ENOSPC; + goto error; + } + if (sem->_magic != SEM_MAGIC) { + errno = EINVAL; + goto error; + } + ni->open_count = 1; + ni->sem = sem; + LIST_INSERT_HEAD(&sem_list, ni, next); + _pthread_mutex_unlock(&sem_llock); + _close(fd); + return (sem); + +error: + _pthread_mutex_unlock(&sem_llock); + if (fd != -1) + _close(fd); + if (sem != NULL) + munmap(sem, sizeof(sem_t)); + free(ni); + return (SEM_FAILED); +} + +int +_libc_sem_close(sem_t *sem) +{ + struct sem_nameinfo *ni; + + if (sem_check_validity(sem) != 0) + return (-1); + + if (!(sem->_kern._flags & SEM_NAMED)) { + errno = EINVAL; + return (-1); + } + + _pthread_mutex_lock(&sem_llock); + LIST_FOREACH(ni, &sem_list, next) { + if (sem == ni->sem) { + if (--ni->open_count > 0) { + _pthread_mutex_unlock(&sem_llock); + return (0); + } + else + break; + } + } + + if (ni) { + LIST_REMOVE(ni, next); + _pthread_mutex_unlock(&sem_llock); + munmap(sem, sizeof(*sem)); + free(ni); + return (0); + } + _pthread_mutex_unlock(&sem_llock); + return (-1); +} + +int +_libc_sem_unlink(const char *name) +{ + char path[PATH_MAX]; + + if (name[0] != '/') { + errno = ENOENT; + return -1; + } + name++; + + strcpy(path, SEM_PREFIX); + if (strlcat(path, name, sizeof(path)) >= sizeof(path)) { + errno = ENAMETOOLONG; + return (-1); + } + return unlink(path); +} + +int +_libc_sem_destroy(sem_t *sem) +{ + + if (sem_check_validity(sem) != 0) + return (-1); + + if (sem->_kern._flags & SEM_NAMED) { + errno = EINVAL; + return (-1); + } + sem->_magic = 0; + return (0); +} + +int +_libc_sem_getvalue(sem_t * __restrict sem, int * __restrict sval) +{ + + if (sem_check_validity(sem) != 0) + return (-1); + + *sval = (int)sem->_kern._count; + return (0); +} + +static int +usem_wake(struct _usem *sem) +{ + if (!sem->_has_waiters) + return (0); + return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); +} + +static int +usem_wait(struct _usem *sem, const struct timespec *timeout) +{ + if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && + timeout->tv_nsec <= 0))) { + errno = ETIMEDOUT; + return (-1); + } + return _umtx_op(sem, UMTX_OP_SEM_WAIT, 0, NULL, + __DECONST(void*, timeout)); +} + +int +_libc_sem_trywait(sem_t *sem) +{ + int val; + + if (sem_check_validity(sem) != 0) + return (-1); + + while ((val = sem->_kern._count) > 0) { + if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) + return (0); + } + errno = EAGAIN; + return (-1); +} + +static void +sem_cancel_handler(void *arg) +{ + sem_t *sem = arg; + + if (sem->_kern._has_waiters && sem->_kern._count) + usem_wake(&sem->_kern); +} + +#define TIMESPEC_SUB(dst, src, val) \ + do { \ + (dst)->tv_sec = (src)->tv_sec - (val)->tv_sec; \ + (dst)->tv_nsec = (src)->tv_nsec - (val)->tv_nsec; \ + if ((dst)->tv_nsec < 0) { \ + (dst)->tv_sec--; \ + (dst)->tv_nsec += 1000000000; \ + } \ + } while (0) + + +static int +enable_async_cancel(void) +{ + int old; + + _pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &old); + return (old); +} + +static void +restore_async_cancel(int val) +{ + _pthread_setcanceltype(val, NULL); +} + +int +_libc_sem_timedwait(sem_t * __restrict sem, + const struct timespec * __restrict abstime) +{ + struct timespec ts, ts2; + int val, retval, saved_cancel; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 03:39:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F08E1065692; Tue, 5 Jan 2010 03:39:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3708FC0A; Tue, 5 Jan 2010 03:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o053dVdj075173; Tue, 5 Jan 2010 03:39:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o053dV1j075171; Tue, 5 Jan 2010 03:39:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050339.o053dV1j075171@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 03:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201547 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 03:39:31 -0000 Author: davidxu Date: Tue Jan 5 03:39:31 2010 New Revision: 201547 URL: http://svn.freebsd.org/changeset/base/201547 Log: Don't check has_waiters twice, inline some small functions. performance result on my machine: mutex Elapsed: 902115 us; per iteration: 90 ns. semaphore Elapsed: 958780 us; per iteration: 95 ns. Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Tue Jan 5 02:37:59 2010 (r201546) +++ head/lib/libc/gen/sem_new.c Tue Jan 5 03:39:31 2010 (r201547) @@ -331,7 +331,7 @@ _libc_sem_getvalue(sem_t * __restrict se return (0); } -static int +static __inline int usem_wake(struct _usem *sem) { if (!sem->_has_waiters) @@ -339,7 +339,7 @@ usem_wake(struct _usem *sem) return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); } -static int +static __inline int usem_wait(struct _usem *sem, const struct timespec *timeout) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && @@ -387,7 +387,7 @@ sem_cancel_handler(void *arg) } while (0) -static int +static __inline int enable_async_cancel(void) { int old; @@ -396,7 +396,7 @@ enable_async_cancel(void) return (old); } -static void +static __inline void restore_async_cancel(int val) { _pthread_setcanceltype(val, NULL); @@ -413,7 +413,6 @@ _libc_sem_timedwait(sem_t * __restrict s return (-1); retval = 0; - _pthread_testcancel(); for (;;) { while ((val = sem->_kern._count) > 0) { if (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) @@ -464,7 +463,5 @@ _libc_sem_post(sem_t *sem) return (-1); atomic_add_rel_int(&sem->_kern._count, 1); - if (sem->_kern._has_waiters) - return usem_wake(&sem->_kern); - return (0); + return usem_wake(&sem->_kern); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 04:40:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BCBC1065670; Tue, 5 Jan 2010 04:40:06 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 2AF0C8FC21; Tue, 5 Jan 2010 04:40:04 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so3572945qwb.7 for ; Mon, 04 Jan 2010 20:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=pbeJsc0nKMHfB1BruYzPMiJvotHLmGE33jhbJ9OiYUU=; b=HkcYk2L6rHlTpFDxzdpxl9cjr8hSZ0nGAe0DeELjuR7n3BM1xYCm0tfD5hupovGNoJ mqpEMVFL1bk1fTt5N89F2RSlUdsmgORTnf3rCIlu2W2GnYd/KhffAECCsPvXS8vYn46J 4S3v24wtVXnxHMZDjEthLTnFNlg6/rgyWbbn0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=NeHtnsZGYjTl1OR3K5bwHnFGPLMBBe4S8yprkJIdIIkGhfc6TEcrNLdVafQDs3CCum PMTiNr43vDXti14HkGTqZcerlMec4Dwu93lGVEHc0x689+8DzxSumtysBzU1nrkgMvkf Pts6fPtdchJ7oUZD9pxv5F22FjkgDlUXmx4FY= Received: by 10.224.66.211 with SMTP id o19mr11642572qai.342.1262666396117; Mon, 04 Jan 2010 20:39:56 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 4sm15137889qwe.55.2010.01.04.20.39.51 (version=SSLv3 cipher=RC4-MD5); Mon, 04 Jan 2010 20:39:55 -0800 (PST) Date: Mon, 4 Jan 2010 23:39:46 -0500 From: Alexander Kabaev To: David Xu Message-ID: <20100104233946.6d8bfa37@kan.dnsalias.net> In-Reply-To: <201001050339.o053dV1j075171@svn.freebsd.org> References: <201001050339.o053dV1j075171@svn.freebsd.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/iIY41kDyQ_qlTyTTcA7e/_S"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201547 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 04:40:06 -0000 --Sig_/iIY41kDyQ_qlTyTTcA7e/_S Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi, some quick questions: FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? That aside, use of SYM_DEFAULT is pretty much always wrong. Also, does libthr really need to export sem_ symbols in 1.2 namespace? I do not think so, but there might be reasons I am missing, could you shed some light here? On Tue, 5 Jan 2010 03:39:31 +0000 (UTC) David Xu wrote: > Author: davidxu > Date: Tue Jan 5 03:39:31 2010 > New Revision: 201547 > URL: http://svn.freebsd.org/changeset/base/201547 >=20 > Log: > Don't check has_waiters twice, inline some small functions. > performance result on my machine: > mutex Elapsed: 902115 us; per iteration: 90 ns. > semaphore Elapsed: 958780 us; per iteration: 95 ns. >=20 > Modified: > head/lib/libc/gen/sem_new.c >=20 > Modified: head/lib/libc/gen/sem_new.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/gen/sem_new.c Tue Jan 5 02:37:59 > 2010 (r201546) +++ head/lib/libc/gen/sem_new.c Tue Jan > 5 03:39:31 2010 (r201547) @@ -331,7 +331,7 @@ > _libc_sem_getvalue(sem_t * __restrict se return (0); > } > =20 > -static int > +static __inline int > usem_wake(struct _usem *sem) > { > if (!sem->_has_waiters) > @@ -339,7 +339,7 @@ usem_wake(struct _usem *sem) > return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL); > } > =20 > -static int > +static __inline int > usem_wait(struct _usem *sem, const struct timespec *timeout) > { > if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec =3D=3D 0 > && @@ -387,7 +387,7 @@ sem_cancel_handler(void *arg) > } while (0) > =20 > =20 > -static int > +static __inline int > enable_async_cancel(void) > { > int old; > @@ -396,7 +396,7 @@ enable_async_cancel(void) > return (old); > } > =20 > -static void > +static __inline void > restore_async_cancel(int val) > { > _pthread_setcanceltype(val, NULL); > @@ -413,7 +413,6 @@ _libc_sem_timedwait(sem_t * __restrict s > return (-1); > =20 > retval =3D 0; > - _pthread_testcancel(); > for (;;) { > while ((val =3D sem->_kern._count) > 0) { > if > (atomic_cmpset_acq_int(&sem->_kern._count, val, val - 1)) @@ -464,7 > +463,5 @@ _libc_sem_post(sem_t *sem) return (-1); > =20 > atomic_add_rel_int(&sem->_kern._count, 1); > - if (sem->_kern._has_waiters) > - return usem_wake(&sem->_kern); > - return (0); > + return usem_wake(&sem->_kern); > } --=20 Alexander Kabaev --Sig_/iIY41kDyQ_qlTyTTcA7e/_S Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLQsKWQ6z1jMm+XZYRArwyAJwOc/6JtClBjYxuHbGvwayJtQ5KpwCfQStd sgXlj8pE9DNj3cwia4tZsws= =JzuK -----END PGP SIGNATURE----- --Sig_/iIY41kDyQ_qlTyTTcA7e/_S-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 05:39:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E48F61065692; Tue, 5 Jan 2010 05:39:09 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D1FC58FC19; Tue, 5 Jan 2010 05:39:09 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o055d6fO054251; Tue, 5 Jan 2010 05:39:08 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4B42D07A.5000803@freebsd.org> Date: Tue, 05 Jan 2010 13:39:06 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Alexander Kabaev References: <201001050339.o053dV1j075171@svn.freebsd.org> <20100104233946.6d8bfa37@kan.dnsalias.net> In-Reply-To: <20100104233946.6d8bfa37@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201547 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 05:39:10 -0000 Alexander Kabaev wrote: > Hi, > > some quick questions: > > FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? > That aside, use of SYM_DEFAULT is pretty much always wrong. > Yes, this needs to be cleaned. > Also, does libthr really need to export sem_ symbols in 1.2 namespace? > I do not think so, but there might be reasons I am missing, could you > shed some light here? > If libthr.so does not have 1.2 semaphore, a program linked against libthr may use 1.0 version at linking time, doesn't this cause trouble? anyway, I am not symbol versioning expert, welcome to fix it. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 05:44:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A0891065693; Tue, 5 Jan 2010 05:44:52 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52D798FC17; Tue, 5 Jan 2010 05:44:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o055iqtI003088; Tue, 5 Jan 2010 05:44:52 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o055iqqA003086; Tue, 5 Jan 2010 05:44:52 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050544.o055iqqA003086@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 05:44:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201553 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 05:44:52 -0000 Author: davidxu Date: Tue Jan 5 05:44:52 2010 New Revision: 201553 URL: http://svn.freebsd.org/changeset/base/201553 Log: Remove unused macros. Modified: head/lib/libc/gen/sem.c Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Tue Jan 5 05:43:53 2010 (r201552) +++ head/lib/libc/gen/sem.c Tue Jan 5 05:44:52 2010 (r201553) @@ -99,16 +99,11 @@ typedef struct sem* sem_t; #define SYM_FBP10(sym) __CONCAT(sym, _fbp10) #define WEAK_REF(sym, alias) __weak_reference(sym, alias) #define SYM_COMPAT(sym, impl, ver) __sym_compat(sym, impl, ver) -#define SYM_DEFAULT(sym, impl, ver) __sym_default(sym, impl, ver) #define FB10_COMPAT(func, sym) \ WEAK_REF(func, SYM_FB10(sym)); \ SYM_COMPAT(sym, SYM_FB10(sym), FBSD_1.0) -#define FB10_COMPAT_PRIVATE(func, sym) \ - WEAK_REF(func, SYM_FBP10(sym)); \ - SYM_DEFAULT(sym, SYM_FBP10(sym), FBSDprivate_1.0) - static sem_t sem_alloc(unsigned int value, semid_t semid, int system_sem); static void sem_free(sem_t sem); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 05:47:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5099E106566B; Tue, 5 Jan 2010 05:47:19 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9C38FC0A; Tue, 5 Jan 2010 05:47:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o055lJ0l003693; Tue, 5 Jan 2010 05:47:19 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o055lJue003691; Tue, 5 Jan 2010 05:47:19 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050547.o055lJue003691@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 05:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201555 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 05:47:19 -0000 Author: davidxu Date: Tue Jan 5 05:47:18 2010 New Revision: 201555 URL: http://svn.freebsd.org/changeset/base/201555 Log: forgot to remove SYM_FBP10. ;-) Modified: head/lib/libc/gen/sem.c Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Tue Jan 5 05:45:51 2010 (r201554) +++ head/lib/libc/gen/sem.c Tue Jan 5 05:47:18 2010 (r201555) @@ -96,7 +96,6 @@ typedef struct sem* sem_t; #define SEM_VALUE_MAX __INT_MAX #define SYM_FB10(sym) __CONCAT(sym, _fb10) -#define SYM_FBP10(sym) __CONCAT(sym, _fbp10) #define WEAK_REF(sym, alias) __weak_reference(sym, alias) #define SYM_COMPAT(sym, impl, ver) __sym_compat(sym, impl, ver) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 05:52:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB7DD106568B; Tue, 5 Jan 2010 05:52:48 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF408FC12; Tue, 5 Jan 2010 05:52:48 +0000 (UTC) Received: by qyk6 with SMTP id 6so6727120qyk.3 for ; Mon, 04 Jan 2010 21:52:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=5veqIyWsBJBPmAoQivUKz6LaJXcBM36hA2APJK09+rA=; b=eGD/qy0HzItXbOOJGbt1fTOq1FvxQ0Bb5/L/gb00AQ8GHhR9qeqmLorHXpb9Nve3h1 A3+VEKFuF5UU29Jmiotn2C5bj4ek2nu2yIqSlyWyW1d8WMn9Wj3BnMTQs574SysTtPBk LSg5OV0G2WXVHFNYYXzuL5dbVIXM4ap6pZBoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=O3qXOeM4w+pRFXuENIcPApt4p+d7uVd7vWj4v/xnaUsm0cKxBg4RA53qfCEn6H7mfw CbOv1FYYzoZFeKNQM0jSIRPClj/ae5MqCdMHulVTYuiWXdTGEInLWJ2mDxHEln+q1cdl kxgbX8JSVRezuRtY8WhGt1H2z9vD9nw5fmz6M= Received: by 10.224.63.202 with SMTP id c10mr11790159qai.39.1262670762158; Mon, 04 Jan 2010 21:52:42 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 4sm50712932qwe.5.2010.01.04.21.52.39 (version=SSLv3 cipher=RC4-MD5); Mon, 04 Jan 2010 21:52:40 -0800 (PST) Date: Tue, 5 Jan 2010 00:50:42 -0500 From: Alexander Kabaev To: David Xu Message-ID: <20100105005042.7fd9db85@kan.dnsalias.net> In-Reply-To: <4B42D07A.5000803@freebsd.org> References: <201001050339.o053dV1j075171@svn.freebsd.org> <20100104233946.6d8bfa37@kan.dnsalias.net> <4B42D07A.5000803@freebsd.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/r1jJl/6LmJiltlx8/HPQCSW"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201547 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 05:52:49 -0000 --Sig_/r1jJl/6LmJiltlx8/HPQCSW Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 05 Jan 2010 13:39:06 +0800 David Xu wrote: > Alexander Kabaev wrote: > > Hi, > >=20 > > some quick questions: > >=20 > > FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? > > That aside, use of SYM_DEFAULT is pretty much always wrong. > >=20 > Yes, this needs to be cleaned. >=20 > > Also, does libthr really need to export sem_ symbols in 1.2 > > namespace? I do not think so, but there might be reasons I am > > missing, could you shed some light here? > >=20 >=20 > If libthr.so does not have 1.2 semaphore, a program linked against=20 > libthr may use 1.0 version at linking time, doesn't this cause > trouble? anyway, I am not symbol versioning expert, welcome to fix it. >=20 No, that won't happen. Compat (single '@') symbols are only resolvable at runtime, bit at link time, so ld won't see any sem_ symbols in libthr and by necessity will pick ones from libc. --=20 Alexander Kabaev --Sig_/r1jJl/6LmJiltlx8/HPQCSW Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLQtOmQ6z1jMm+XZYRAtNPAKCcgaPECN3d4E0hz0if5Vh1/RX6ggCfbL+f 3KL2Sr7OKHUWX5F2SMc0IoY= =P1Cy -----END PGP SIGNATURE----- --Sig_/r1jJl/6LmJiltlx8/HPQCSW-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 06:02:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C851065670; Tue, 5 Jan 2010 06:02:53 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 17EA48FC15; Tue, 5 Jan 2010 06:02:53 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o0562opM078456; Tue, 5 Jan 2010 06:02:51 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4B42D60A.1090901@freebsd.org> Date: Tue, 05 Jan 2010 14:02:50 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Alexander Kabaev References: <201001050339.o053dV1j075171@svn.freebsd.org> <20100104233946.6d8bfa37@kan.dnsalias.net> <4B42D07A.5000803@freebsd.org> <20100105005042.7fd9db85@kan.dnsalias.net> In-Reply-To: <20100105005042.7fd9db85@kan.dnsalias.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201547 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 06:02:53 -0000 Alexander Kabaev wrote: > On Tue, 05 Jan 2010 13:39:06 +0800 > David Xu wrote: > >> Alexander Kabaev wrote: >>> Hi, >>> >>> some quick questions: >>> >>> FB10_COMPAT_PRIVATE is not used anywhere, why did it get committed? >>> That aside, use of SYM_DEFAULT is pretty much always wrong. >>> >> Yes, this needs to be cleaned. >> >>> Also, does libthr really need to export sem_ symbols in 1.2 >>> namespace? I do not think so, but there might be reasons I am >>> missing, could you shed some light here? >>> >> If libthr.so does not have 1.2 semaphore, a program linked against >> libthr may use 1.0 version at linking time, doesn't this cause >> trouble? anyway, I am not symbol versioning expert, welcome to fix it. >> > > No, that won't happen. Compat (single '@') symbols are only resolvable > at runtime, bit at link time, so ld won't see any sem_ symbols in libthr > and by necessity will pick ones from libc. > > My previous test got opposite result, it sticked with libthr, but this time I tested it again, you are right, it uses version 1.2 from libc. I will remove extra stubs from libthr. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 06:21:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AAA1065676; Tue, 5 Jan 2010 06:21:29 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 708448FC08; Tue, 5 Jan 2010 06:21:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o056LT7o011406; Tue, 5 Jan 2010 06:21:29 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o056LTL6011404; Tue, 5 Jan 2010 06:21:29 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050621.o056LTL6011404@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 06:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201559 - in head/lib/libthr: . thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 06:21:29 -0000 Author: davidxu Date: Tue Jan 5 06:21:29 2010 New Revision: 201559 URL: http://svn.freebsd.org/changeset/base/201559 Log: Remove extra new semaphore stubs, because libc already has them, and ld can find the newest version which is default. Poked by: kan@ Deleted: head/lib/libthr/thread/thr_sem_new.c Modified: head/lib/libthr/pthread.map Modified: head/lib/libthr/pthread.map ============================================================================== --- head/lib/libthr/pthread.map Tue Jan 5 06:13:15 2010 (r201558) +++ head/lib/libthr/pthread.map Tue Jan 5 06:21:29 2010 (r201559) @@ -396,11 +396,4 @@ FBSD_1.1 { FBSD_1.2 { openat; - sem_destroy; - sem_getvalue; - sem_init; - sem_post; - sem_timedwait; - sem_trywait; - sem_wait; }; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 06:40:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 730331065679; Tue, 5 Jan 2010 06:40:27 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61A898FC0C; Tue, 5 Jan 2010 06:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o056eRgw015620; Tue, 5 Jan 2010 06:40:27 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o056eRjE015617; Tue, 5 Jan 2010 06:40:27 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050640.o056eRjE015617@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 06:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201561 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 06:40:27 -0000 Author: davidxu Date: Tue Jan 5 06:40:27 2010 New Revision: 201561 URL: http://svn.freebsd.org/changeset/base/201561 Log: More cleanup, remove _libc prefix because libthr no longer has stubs referencing them. Modified: head/lib/libc/gen/Symbol.map head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Jan 5 06:34:20 2010 (r201560) +++ head/lib/libc/gen/Symbol.map Tue Jan 5 06:40:27 2010 (r201561) @@ -475,14 +475,6 @@ FBSDprivate_1.0 { __waitpid; _waitpid; - _libc_sem_destroy; - _libc_sem_init; - _libc_sem_getvalue; - _libc_sem_trywait; - _libc_sem_wait; - _libc_sem_timedwait; - _libc_sem_post; - _libc_sem_init_compat; _libc_sem_destroy_compat; _libc_sem_open_compat; Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Tue Jan 5 06:34:20 2010 (r201560) +++ head/lib/libc/gen/sem_new.c Tue Jan 5 06:40:27 2010 (r201561) @@ -48,26 +48,16 @@ #include #include "un-namespace.h" -__weak_reference(_libc_sem_close, sem_close); -__weak_reference(_libc_sem_close, _sem_close); -__weak_reference(_libc_sem_destroy, sem_destroy); -__weak_reference(_libc_sem_destroy, _sem_destroy); -__weak_reference(_libc_sem_getvalue, sem_getvalue); -__weak_reference(_libc_sem_getvalue, _sem_getvalue); -__weak_reference(_libc_sem_init, sem_init); -__weak_reference(_libc_sem_init, _sem_init); -__weak_reference(_libc_sem_open, sem_open); -__weak_reference(_libc_sem_open, _sem_open); -__weak_reference(_libc_sem_post, sem_post); -__weak_reference(_libc_sem_post, _sem_post); -__weak_reference(_libc_sem_timedwait, sem_timedwait); -__weak_reference(_libc_sem_timedwait, _sem_timedwait); -__weak_reference(_libc_sem_trywait, sem_trywait); -__weak_reference(_libc_sem_trywait, _sem_trywait); -__weak_reference(_libc_sem_unlink, sem_unlink); -__weak_reference(_libc_sem_unlink, _sem_unlink); -__weak_reference(_libc_sem_wait, sem_wait); -__weak_reference(_libc_sem_wait, _sem_wait); +__weak_reference(_sem_close, sem_close); +__weak_reference(_sem_destroy, sem_destroy); +__weak_reference(_sem_getvalue, sem_getvalue); +__weak_reference(_sem_init, sem_init); +__weak_reference(_sem_open, sem_open); +__weak_reference(_sem_post, sem_post); +__weak_reference(_sem_timedwait, sem_timedwait); +__weak_reference(_sem_trywait, sem_trywait); +__weak_reference(_sem_unlink, sem_unlink); +__weak_reference(_sem_wait, sem_wait); #define SEM_PREFIX "/tmp/SEMD" #define SEM_MAGIC ((u_int32_t)0x73656d31) @@ -127,7 +117,7 @@ sem_check_validity(sem_t *sem) } int -_libc_sem_init(sem_t *sem, int pshared, unsigned int value) +_sem_init(sem_t *sem, int pshared, unsigned int value) { if (value > SEM_VALUE_MAX) { @@ -144,7 +134,7 @@ _libc_sem_init(sem_t *sem, int pshared, } sem_t * -_libc_sem_open(const char *name, int flags, ...) +_sem_open(const char *name, int flags, ...) { char path[PATH_MAX]; @@ -251,7 +241,7 @@ error: } int -_libc_sem_close(sem_t *sem) +_sem_close(sem_t *sem) { struct sem_nameinfo *ni; @@ -287,7 +277,7 @@ _libc_sem_close(sem_t *sem) } int -_libc_sem_unlink(const char *name) +_sem_unlink(const char *name) { char path[PATH_MAX]; @@ -306,7 +296,7 @@ _libc_sem_unlink(const char *name) } int -_libc_sem_destroy(sem_t *sem) +_sem_destroy(sem_t *sem) { if (sem_check_validity(sem) != 0) @@ -321,7 +311,7 @@ _libc_sem_destroy(sem_t *sem) } int -_libc_sem_getvalue(sem_t * __restrict sem, int * __restrict sval) +_sem_getvalue(sem_t * __restrict sem, int * __restrict sval) { if (sem_check_validity(sem) != 0) @@ -352,7 +342,7 @@ usem_wait(struct _usem *sem, const struc } int -_libc_sem_trywait(sem_t *sem) +_sem_trywait(sem_t *sem) { int val; @@ -403,7 +393,7 @@ restore_async_cancel(int val) } int -_libc_sem_timedwait(sem_t * __restrict sem, +_sem_timedwait(sem_t * __restrict sem, const struct timespec * __restrict abstime) { struct timespec ts, ts2; @@ -444,9 +434,9 @@ _libc_sem_timedwait(sem_t * __restrict s } int -_libc_sem_wait(sem_t *sem) +_sem_wait(sem_t *sem) { - return _libc_sem_timedwait(sem, NULL); + return _sem_timedwait(sem, NULL); } /* @@ -456,7 +446,7 @@ _libc_sem_wait(sem_t *sem) * The implementation does not use lock, so it should be safe. */ int -_libc_sem_post(sem_t *sem) +_sem_post(sem_t *sem) { if (sem_check_validity(sem) != 0) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 07:50:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF34A1065679; Tue, 5 Jan 2010 07:50:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95ABF8FC1D; Tue, 5 Jan 2010 07:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o057oVFu031114; Tue, 5 Jan 2010 07:50:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o057oVu1031112; Tue, 5 Jan 2010 07:50:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001050750.o057oVu1031112@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 07:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201565 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 07:50:31 -0000 Author: davidxu Date: Tue Jan 5 07:50:31 2010 New Revision: 201565 URL: http://svn.freebsd.org/changeset/base/201565 Log: remove file thr_sem_new.c. Modified: head/lib/libthr/thread/Makefile.inc Modified: head/lib/libthr/thread/Makefile.inc ============================================================================== --- head/lib/libthr/thread/Makefile.inc Tue Jan 5 07:36:02 2010 (r201564) +++ head/lib/libthr/thread/Makefile.inc Tue Jan 5 07:50:31 2010 (r201565) @@ -41,7 +41,6 @@ SRCS+= \ thr_rwlockattr.c \ thr_self.c \ thr_sem.c \ - thr_sem_new.c \ thr_setprio.c \ thr_setschedparam.c \ thr_sig.c \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 10:30:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07BF61065670; Tue, 5 Jan 2010 10:30:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB4AF8FC23; Tue, 5 Jan 2010 10:30:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05AUuJf068839; Tue, 5 Jan 2010 10:30:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05AUuNC068837; Tue, 5 Jan 2010 10:30:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051030.o05AUuNC068837@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 10:30:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201566 - head/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 10:30:57 -0000 Author: mav Date: Tue Jan 5 10:30:56 2010 New Revision: 201566 URL: http://svn.freebsd.org/changeset/base/201566 Log: Move wakeup() out of mutex to reduce contention. Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Jan 5 07:50:31 2010 (r201565) +++ head/sys/geom/mirror/g_mirror.c Tue Jan 5 10:30:56 2010 (r201566) @@ -868,8 +868,8 @@ g_mirror_done(struct bio *bp) bp->bio_cflags = G_MIRROR_BIO_FLAG_REGULAR; mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); - wakeup(sc); mtx_unlock(&sc->sc_queue_mtx); + wakeup(sc); } static void @@ -954,9 +954,9 @@ g_mirror_regular_request(struct bio *bp) pbp->bio_error = 0; mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, pbp); + mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); - mtx_unlock(&sc->sc_queue_mtx); } break; case BIO_DELETE: @@ -994,8 +994,8 @@ g_mirror_sync_done(struct bio *bp) bp->bio_cflags = G_MIRROR_BIO_FLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); - wakeup(sc); mtx_unlock(&sc->sc_queue_mtx); + wakeup(sc); } static void @@ -1107,9 +1107,9 @@ g_mirror_start(struct bio *bp) } mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); + mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); - mtx_unlock(&sc->sc_queue_mtx); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 10:52:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6970F106566B; Tue, 5 Jan 2010 10:52:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 589F78FC0C; Tue, 5 Jan 2010 10:52:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05AqLKI073569; Tue, 5 Jan 2010 10:52:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05AqLwE073567; Tue, 5 Jan 2010 10:52:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051052.o05AqLwE073567@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 10:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201567 - head/sys/geom/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 10:52:21 -0000 Author: mav Date: Tue Jan 5 10:52:21 2010 New Revision: 201567 URL: http://svn.freebsd.org/changeset/base/201567 Log: Move wakeup() out of mutex to reduce contention. Modified: head/sys/geom/raid3/g_raid3.c Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Tue Jan 5 10:30:56 2010 (r201566) +++ head/sys/geom/raid3/g_raid3.c Tue Jan 5 10:52:21 2010 (r201567) @@ -1271,9 +1271,9 @@ g_raid3_done(struct bio *bp) G_RAID3_LOGREQ(3, bp, "Regular request done (error=%d).", bp->bio_error); mtx_lock(&sc->sc_queue_mtx); bioq_insert_head(&sc->sc_queue, bp); + mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); wakeup(&sc->sc_queue); - mtx_unlock(&sc->sc_queue_mtx); } static void @@ -1379,9 +1379,9 @@ g_raid3_sync_done(struct bio *bp) bp->bio_cflags |= G_RAID3_BIO_CFLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); bioq_insert_head(&sc->sc_queue, bp); + mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); wakeup(&sc->sc_queue); - mtx_unlock(&sc->sc_queue_mtx); } static void @@ -1459,9 +1459,9 @@ g_raid3_start(struct bio *bp) } mtx_lock(&sc->sc_queue_mtx); bioq_insert_tail(&sc->sc_queue, bp); + mtx_unlock(&sc->sc_queue_mtx); G_RAID3_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); - mtx_unlock(&sc->sc_queue_mtx); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 11:00:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C7121065695; Tue, 5 Jan 2010 11:00:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BBD08FC19; Tue, 5 Jan 2010 11:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05B0W5X075411; Tue, 5 Jan 2010 11:00:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05B0WF0075409; Tue, 5 Jan 2010 11:00:32 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001051100.o05B0WF0075409@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 5 Jan 2010 11:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201568 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 11:00:32 -0000 Author: luigi Date: Tue Jan 5 11:00:31 2010 New Revision: 201568 URL: http://svn.freebsd.org/changeset/base/201568 Log: this file does not require ip_dummynet.h Modified: head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jan 5 10:52:21 2010 (r201567) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Tue Jan 5 11:00:31 2010 (r201568) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 11:45:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EBC5106566B; Tue, 5 Jan 2010 11:45:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 07BE18FC16; Tue, 5 Jan 2010 11:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 6952641C64A; Tue, 5 Jan 2010 12:45:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ixZBgVAy9d9n; Tue, 5 Jan 2010 12:45:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id A2FEF41C67B; Tue, 5 Jan 2010 12:45:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id A8CDA4448EC; Tue, 5 Jan 2010 11:43:06 +0000 (UTC) Date: Tue, 5 Jan 2010 11:43:06 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Luigi Rizzo In-Reply-To: <20100104222323.GA49068@onelab2.iet.unipi.it> Message-ID: <20100105114047.I88477@maildrop.int.zabbadoz.net> References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> <20100104222323.GA49068@onelab2.iet.unipi.it> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 11:45:07 -0000 On Mon, 4 Jan 2010, Luigi Rizzo wrote: > I also think that the name of the new directory or the exact percentage of > ipv4-ness or netinet-ness of the sctp* and tcp* and multicast* stuff > is irrelevant. Moving directories with svn is so easy that we should not > worry even if we need a couple of attempts to find a good name. While moving in SVN is easy we still export to CVS and have a lot (most) of our users on that. Further a move will imho result in a delete and add by the exporter so there'll be a loss in file history there. Also moving it around often will put us into #include <> hell evenetually for everything that is "local" to files rather than a public interface at a well defined place which we'll need to be very carefull of anyway. /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 12:32:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C77910656A7; Tue, 5 Jan 2010 12:32:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A8D28FC1D; Tue, 5 Jan 2010 12:32:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05CW9P2096465; Tue, 5 Jan 2010 12:32:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05CW9v8096463; Tue, 5 Jan 2010 12:32:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001051232.o05CW9v8096463@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Jan 2010 12:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201574 - stable/8/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 12:32:09 -0000 Author: kib Date: Tue Jan 5 12:32:09 2010 New Revision: 201574 URL: http://svn.freebsd.org/changeset/base/201574 Log: MFC r201194: Use clock_gettime(CLOCK_SECOND) instead of gettimeofday(2) for implementation of time(3). CLOCK_SECOND is much faster. Modified: stable/8/lib/libc/gen/time.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/gen/time.c ============================================================================== --- stable/8/lib/libc/gen/time.c Tue Jan 5 12:29:03 2010 (r201573) +++ stable/8/lib/libc/gen/time.c Tue Jan 5 12:32:09 2010 (r201574) @@ -37,13 +37,12 @@ __FBSDID("$FreeBSD$"); #include time_t -time(t) - time_t *t; +time(time_t *t) { - struct timeval tt; + struct timespec tt; time_t retval; - if (gettimeofday(&tt, (struct timezone *)0) < 0) + if (clock_gettime(CLOCK_SECOND, &tt) < 0) retval = -1; else retval = tt.tv_sec; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 12:34:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 091BD1065670; Tue, 5 Jan 2010 12:34:14 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E14DA8FC12; Tue, 5 Jan 2010 12:34:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05CYDN3096997; Tue, 5 Jan 2010 12:34:13 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05CYDlR096994; Tue, 5 Jan 2010 12:34:13 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001051234.o05CYDlR096994@svn.freebsd.org> From: David Xu Date: Tue, 5 Jan 2010 12:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201575 - head/tools/regression/posixsem2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 12:34:14 -0000 Author: davidxu Date: Tue Jan 5 12:34:13 2010 New Revision: 201575 URL: http://svn.freebsd.org/changeset/base/201575 Log: Add test code for POSIX semaphore implementation. Added: head/tools/regression/posixsem2/ head/tools/regression/posixsem2/Makefile (contents, props changed) head/tools/regression/posixsem2/semtest.c (contents, props changed) Added: head/tools/regression/posixsem2/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/posixsem2/Makefile Tue Jan 5 12:34:13 2010 (r201575) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= semtest +SRCS= semtest.c +NO_MAN= + +WARNS?= 3 + +.include Added: head/tools/regression/posixsem2/semtest.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/posixsem2/semtest.c Tue Jan 5 12:34:13 2010 (r201575) @@ -0,0 +1,101 @@ +/* $FreeBSD$ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SEM_NAME "/semtst" + +int test_unnamed(void); +int test_named(void); + +int +test_unnamed(void) +{ + sem_t *s; + pid_t pid; + int status; + + printf("testing unnamed process-shared semaphore\n"); + s = (sem_t *)mmap(NULL, sizeof(sem_t), PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, + -1, 0); + if (s == MAP_FAILED) + err(1, "mmap failed"); + if (sem_init(s, 1, 0)) + err(2, "sem_init failed"); + if ((pid = fork()) == 0) { + printf("child: sem_wait()\n"); + if (sem_wait(s)) + err(3, "sem_wait failed"); + printf("child: sem_wait() returned\n"); + exit(0); + } else { + sleep(1); + printf("parent: sem_post()\n"); + if (sem_post(s)) + err(4, "sem_post failed"); + waitpid(pid, &status, 0); + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) + printf("OK.\n"); + else + printf("Failure."); + } + return (0); +} + +int +test_named(void) +{ + sem_t *s, *s2; + pid_t pid; + int status; + + printf("testing named process-shared semaphore\n"); + sem_unlink(SEM_NAME); + s = sem_open(SEM_NAME, O_CREAT, 0777); + if (s == SEM_FAILED) + err(1, "sem_open failed"); + s2 = sem_open(SEM_NAME, O_CREAT, 0777); + if (s2 == SEM_FAILED) + err(2, "second sem_open call failed"); + if (s != s2) + err(3, "two sem_open calls for same semaphore do not returm same address."); + if (sem_close(s2)) + err(4, "sem_close failed"); + if ((pid = fork()) == 0) { + printf("child: sem_wait()\n"); + if (sem_wait(s)) + err(5, "sem_wait failed"); + printf("child: sem_wait() returned\n"); + exit(0); + } else { + sleep(1); + printf("parent: sem_post()\n"); + if (sem_post(s)) + err(6, "sem_post failed"); + waitpid(pid, &status, 0); + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) + printf("OK.\n"); + else + printf("Failure."); + } + + if (sem_close(s)) + err(7, "sem_close failed"); + + return (0); +} + +int +main(void) +{ + test_unnamed(); + test_named(); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 12:34:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3611106568F; Tue, 5 Jan 2010 12:34:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E17AC8FC16; Tue, 5 Jan 2010 12:34:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05CYG4f097033; Tue, 5 Jan 2010 12:34:16 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05CYGLX097031; Tue, 5 Jan 2010 12:34:16 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001051234.o05CYGLX097031@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Jan 2010 12:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201576 - stable/8/sbin/mount_msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 12:34:17 -0000 Author: kib Date: Tue Jan 5 12:34:16 2010 New Revision: 201576 URL: http://svn.freebsd.org/changeset/base/201576 Log: MFC r201400: Remove reference to the bug in FreeBSD 2.0. Modified: stable/8/sbin/mount_msdosfs/mount_msdosfs.8 Directory Properties: stable/8/sbin/mount_msdosfs/ (props changed) Modified: stable/8/sbin/mount_msdosfs/mount_msdosfs.8 ============================================================================== --- stable/8/sbin/mount_msdosfs/mount_msdosfs.8 Tue Jan 5 12:34:13 2010 (r201575) +++ stable/8/sbin/mount_msdosfs/mount_msdosfs.8 Tue Jan 5 12:34:16 2010 (r201576) @@ -205,14 +205,6 @@ The use of the flag could result in damaged file systems, albeit the damage is in part taken care of by procedures similar to the ones used in Win'95. -.Pp -.Fx 2.1 -and earlier versions could not handle cluster sizes larger than 16K. -Just mounting an MS-DOS file system could cause corruption to any -mounted file system. -Cluster sizes larger than 16K are unavoidable for file system sizes -larger than 1G, and also occur when file systems larger than 1G are -shrunk to smaller than 1G using FIPS. .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 12:38:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8ED51065672; Tue, 5 Jan 2010 12:38:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6F838FC0C; Tue, 5 Jan 2010 12:38:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05CcZ4l098090; Tue, 5 Jan 2010 12:38:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05CcZPg098088; Tue, 5 Jan 2010 12:38:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001051238.o05CcZPg098088@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Jan 2010 12:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201577 - stable/7/sbin/mount_msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 12:38:35 -0000 Author: kib Date: Tue Jan 5 12:38:35 2010 New Revision: 201577 URL: http://svn.freebsd.org/changeset/base/201577 Log: MFC r201400: Remove reference to the bug in FreeBSD 2.0. Modified: stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Directory Properties: stable/7/sbin/mount_msdosfs/ (props changed) Modified: stable/7/sbin/mount_msdosfs/mount_msdosfs.8 ============================================================================== --- stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Tue Jan 5 12:34:16 2010 (r201576) +++ stable/7/sbin/mount_msdosfs/mount_msdosfs.8 Tue Jan 5 12:38:35 2010 (r201577) @@ -205,14 +205,6 @@ The use of the flag could result in damaged file systems, albeit the damage is in part taken care of by procedures similar to the ones used in Win'95. -.Pp -.Fx 2.1 -and earlier versions could not handle cluster sizes larger than 16K. -Just mounting an MS-DOS file system could cause corruption to any -mounted file system. -Cluster sizes larger than 16K are unavoidable for file system sizes -larger than 1G, and also occur when file systems larger than 1G are -shrunk to smaller than 1G using FIPS. .Sh HISTORY The .Nm From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:12:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E6901065692; Tue, 5 Jan 2010 13:12:48 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 23CF58FC0A; Tue, 5 Jan 2010 13:12:48 +0000 (UTC) Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id A3D3CC98FC; Tue, 5 Jan 2010 08:12:47 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 05 Jan 2010 08:12:47 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=ZUMiYOGZdN0uX+/d9wujcvHIs6k=; b=SLhOULiyyM3n+i2Fhv/Lg1MCIzKj51aMm75u0+zFajTofUlJV1ziY2qfNYOirvp5xQPyFSOYGRj3ZqrH1eteihPK7lDVtSO+36M2NsxMyaj3A0k9Yrzr+MQsEMX+WDNW3jwKkFOBxIjLjtBiAU++GT5UE/sEC/ZKdShyx3wUzjI= X-Sasl-enc: 50uKqePfFjUGZgBy7bv0IY+f9PoxDKtC658TR4ca7u4T 1262697167 Received: from [192.168.123.18] (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id AAAAD4A6B0F; Tue, 5 Jan 2010 08:12:46 -0500 (EST) Message-ID: <4B433ACB.5040902@incunabulum.net> Date: Tue, 05 Jan 2010 13:12:43 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Luigi Rizzo References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> <20100104222323.GA49068@onelab2.iet.unipi.it> In-Reply-To: <20100104222323.GA49068@onelab2.iet.unipi.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:12:48 -0000 On 04/01/2010 22:23, Luigi Rizzo wrote: > I also think that the name of the new directory or the exact percentage of > ipv4-ness or netinet-ness of the sctp* and tcp* and multicast* stuff > is irrelevant. Moving directories with svn is so easy that we should not > worry even if we need a couple of attempts to find a good name. > On a related, but different, note: I actually think that the mcast code could have benefitted from C++ style templates. There's a lot of code duplication between the IPv6 and IPv4 versions of those modules. It's the entry points, and argument types, which ultimately mattered, so when integrating the MLD implementation into FreeBSD back last April, I found myself doing 'cp', 'sed', and manual edits mostly to deal with only *slight* semantic differences between IPv4 and IPv6 in the kernel. Having said all that, it seems to me like the netinet/ code overall could do with being split up further into individual files, to make it more manageable. This has sort of already happened as time has gone on. cheers, BMS From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:25:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E70971065670; Tue, 5 Jan 2010 13:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC1DF8FC08; Tue, 5 Jan 2010 13:25:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DPCk3008734; Tue, 5 Jan 2010 13:25:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DPC1w008731; Tue, 5 Jan 2010 13:25:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051325.o05DPC1w008731@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201578 - head/sbin/geom/class/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:25:13 -0000 Author: mav Date: Tue Jan 5 13:25:12 2010 New Revision: 201578 URL: http://svn.freebsd.org/changeset/base/201578 Log: For completeness, add -s argument, manually specifying array block size. Modified: head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/raid3/graid3.8 Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 5 12:38:35 2010 (r201577) +++ head/sbin/geom/class/raid3/geom_raid3.c Tue Jan 5 13:25:12 2010 (r201578) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_RAID3_VERSION; +static intmax_t default_blocksize = 0; + static void raid3_main(struct gctl_req *req, unsigned f); static void raid3_clear(struct gctl_req *req); static void raid3_dump(struct gctl_req *req); @@ -87,10 +89,11 @@ struct g_command class_commands[] = { { 'F', "nofailsync", NULL, G_TYPE_BOOL }, { 'n', "noautosync", NULL, G_TYPE_BOOL }, { 'r', "round_robin", NULL, G_TYPE_BOOL }, + { 's', "blocksize", &default_blocksize, G_TYPE_NUMBER }, { 'w', "verify", NULL, G_TYPE_BOOL }, G_OPT_SENTINEL }, - NULL, "[-hFnrvw] name prov prov prov ..." + NULL, "[-hFnrvw] [-s blocksize] name prov prov prov ..." }, { "rebuild", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, NULL, "[-v] name prov" @@ -190,7 +193,7 @@ raid3_label(struct gctl_req *req) * sectorsizes of every disk and find the smallest mediasize. */ mediasize = 0; - sectorsize = 0; + sectorsize = gctl_get_intmax(req, "blocksize"); for (i = 1; i < nargs; i++) { str = gctl_get_ascii(req, "arg%d", i); msize = g_get_mediasize(str); Modified: head/sbin/geom/class/raid3/graid3.8 ============================================================================== --- head/sbin/geom/class/raid3/graid3.8 Tue Jan 5 12:38:35 2010 (r201577) +++ head/sbin/geom/class/raid3/graid3.8 Tue Jan 5 13:25:12 2010 (r201578) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd January 5, 2010 .Dt GRAID3 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm .Cm label .Op Fl Fhnrvw +.Op Fl s Ar blocksize .Ar name .Ar prov prov prov ... .Nm @@ -113,6 +114,12 @@ but sequential reads are slower. One cannot use this option if the .Fl w option is also specified. +.It Fl s +Manually specify array block size. Block size will be set equal to least +common multiple of all component's sector sizes and specified value. +Note that array sector size calculated as multiple of block size and number +of regular data components. Big values may decrease performance and compatibility, +as all I/O requests have to be multiple of sector size. .It Fl w Use verify reading feature. When reading from a device in a complete state, also read data from the parity component From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:29:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A599106566B; Tue, 5 Jan 2010 13:29:24 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEB68FC08; Tue, 5 Jan 2010 13:29:22 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so542877eye.9 for ; Tue, 05 Jan 2010 05:29:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=LuUu1Iacu4Vo6QO8gUnq33sl1xrBpzBOsxsU6aRjod0=; b=xvWboMX3wknRm4Ng/Ny1bkx7G8wvoeY3SEE2xj3YPdABAzq6lck3ePygBbcxIccrv3 bBj64f1s7XdtFogOw37IJgKp24nx7O5BF4JfmCQvrMi6wVADctJoWhhEFKrmnfzeEVE6 O0jxshs08janBH9DIk7hED1THPUWhL1EEvG+c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=xVP3/r1brXnTSLrp1Q2R2BIHC4t6HiWvJI6t2/G/gz0S5t9EXAeqjCRgVd27tjc0vq 3xi9WoGRxDeBom03hoVjCadyqJ6hGR9vH/N5ZN/aMUetGl625qp9+6Ayj1AObTTI0h3R ickinRNANhmNKnnq46X+SFaebPbVLNvNRzHRY= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.90.14 with SMTP id d14mr2074711wef.30.1262698159486; Tue, 05 Jan 2010 05:29:19 -0800 (PST) In-Reply-To: <201001050206.o05265Ln053910@svn.freebsd.org> References: <201001050206.o05265Ln053910@svn.freebsd.org> From: Ivan Voras Date: Tue, 5 Jan 2010 14:28:59 +0100 X-Google-Sender-Auth: 7a1f072c25cc3d90 Message-ID: <9bbcef731001050528k5b46b8ect2f9576f7b47e563a@mail.gmail.com> To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201545 - head/sys/geom/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:29:24 -0000 2010/1/5 Alexander Motin : > Author: mav > Date: Tue Jan =C2=A05 02:06:05 2010 > New Revision: 201545 > URL: http://svn.freebsd.org/changeset/base/201545 > > Log: > =C2=A0Slightly optimize XOR calculation. Linux has an interesting approach to RAID XOR operations - they calculate at boot time which method is faster, from a set of i386, MMX, SSE and the like and then use it for what appears to be every context requiring fast XORs. E.g. http://fxr.watson.org/fxr/source/arch/x86/include/asm/xor_64.h?v=3Dlinux-2.= 6 (I know SIMD instructions would require a FP-enabled kernel, I'm just pointing out an interesting idea) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:46:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACED6106566C; Tue, 5 Jan 2010 13:46:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B09D8FC18; Tue, 5 Jan 2010 13:46:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DkdDV013508; Tue, 5 Jan 2010 13:46:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05Dkdpt013506; Tue, 5 Jan 2010 13:46:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051346.o05Dkdpt013506@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201579 - stable/8/sys/geom/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:46:39 -0000 Author: mav Date: Tue Jan 5 13:46:39 2010 New Revision: 201579 URL: http://svn.freebsd.org/changeset/base/201579 Log: MFC r200933: Make geom_stripe report it's stripe size to upper layers. Modified: stable/8/sys/geom/stripe/g_stripe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/8/sys/geom/stripe/g_stripe.c Tue Jan 5 13:25:12 2010 (r201578) +++ stable/8/sys/geom/stripe/g_stripe.c Tue Jan 5 13:46:39 2010 (r201579) @@ -675,6 +675,8 @@ g_stripe_check_and_run(struct g_stripe_s } sc->sc_provider->sectorsize = sectorsize; sc->sc_provider->mediasize = mediasize * sc->sc_ndisks; + sc->sc_provider->stripesize = sc->sc_stripesize; + sc->sc_provider->stripeoffset = 0; g_error_provider(sc->sc_provider, 0); G_STRIPE_DEBUG(0, "Device %s activated.", sc->sc_name); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:47:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBBA0106568B; Tue, 5 Jan 2010 13:47:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9FD78FC12; Tue, 5 Jan 2010 13:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Dlt4G013851; Tue, 5 Jan 2010 13:47:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05Dlt5v013849; Tue, 5 Jan 2010 13:47:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051347.o05Dlt5v013849@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201580 - stable/8/sys/geom/mirror X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:47:55 -0000 Author: mav Date: Tue Jan 5 13:47:55 2010 New Revision: 201580 URL: http://svn.freebsd.org/changeset/base/201580 Log: MFC r200935: As soon as mirror has no own stripes, report largest stripe of unrerlying components, hoping others fit, if they are not equal. Modified: stable/8/sys/geom/mirror/g_mirror.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/8/sys/geom/mirror/g_mirror.c Tue Jan 5 13:46:39 2010 (r201579) +++ stable/8/sys/geom/mirror/g_mirror.c Tue Jan 5 13:47:55 2010 (r201580) @@ -2036,6 +2036,15 @@ g_mirror_launch_provider(struct g_mirror pp = g_new_providerf(sc->sc_geom, "mirror/%s", sc->sc_name); pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; + pp->stripesize = 0; + pp->stripeoffset = 0; + LIST_FOREACH(disk, &sc->sc_disks, d_next) { + if (disk->d_consumer && disk->d_consumer->provider && + disk->d_consumer->provider->stripesize > pp->stripesize) { + pp->stripesize = disk->d_consumer->provider->stripesize; + pp->stripeoffset = disk->d_consumer->provider->stripeoffset; + } + } sc->sc_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:49:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D031065676; Tue, 5 Jan 2010 13:49:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87BC28FC16; Tue, 5 Jan 2010 13:49:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DnInF014202; Tue, 5 Jan 2010 13:49:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DnIUs014200; Tue, 5 Jan 2010 13:49:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051349.o05DnIUs014200@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201581 - stable/8/sys/geom/raid3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:49:18 -0000 Author: mav Date: Tue Jan 5 13:49:18 2010 New Revision: 201581 URL: http://svn.freebsd.org/changeset/base/201581 Log: MFC r200940: As soon as geom_raid3 reports it's own stripe as sector size, report largest underlying provider's stripe, multiplied by number of data disks in array, due to transformation done, as array stripe. Modified: stable/8/sys/geom/raid3/g_raid3.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/raid3/g_raid3.c ============================================================================== --- stable/8/sys/geom/raid3/g_raid3.c Tue Jan 5 13:47:55 2010 (r201580) +++ stable/8/sys/geom/raid3/g_raid3.c Tue Jan 5 13:49:18 2010 (r201581) @@ -2317,6 +2317,8 @@ static void g_raid3_launch_provider(struct g_raid3_softc *sc) { struct g_provider *pp; + struct g_raid3_disk *disk; + int n; sx_assert(&sc->sc_lock, SX_LOCKED); @@ -2324,6 +2326,18 @@ g_raid3_launch_provider(struct g_raid3_s pp = g_new_providerf(sc->sc_geom, "raid3/%s", sc->sc_name); pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; + pp->stripesize = 0; + pp->stripeoffset = 0; + for (n = 0; n < sc->sc_ndisks; n++) { + disk = &sc->sc_disks[n]; + if (disk->d_consumer && disk->d_consumer->provider && + disk->d_consumer->provider->stripesize > pp->stripesize) { + pp->stripesize = disk->d_consumer->provider->stripesize; + pp->stripeoffset = disk->d_consumer->provider->stripeoffset; + } + } + pp->stripesize *= sc->sc_ndisks - 1; + pp->stripeoffset *= sc->sc_ndisks - 1; sc->sc_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:50:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02010106566B; Tue, 5 Jan 2010 13:50:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E45AA8FC0C; Tue, 5 Jan 2010 13:50:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DoEFj014454; Tue, 5 Jan 2010 13:50:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DoEIm014452; Tue, 5 Jan 2010 13:50:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051350.o05DoEIm014452@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201582 - stable/8/sys/geom/concat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:50:15 -0000 Author: mav Date: Tue Jan 5 13:50:14 2010 New Revision: 201582 URL: http://svn.freebsd.org/changeset/base/201582 Log: MFC r200942: Make geom_concat to passthrough stripe parameters of the first component, hoping that rest will fit. Modified: stable/8/sys/geom/concat/g_concat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/concat/g_concat.c ============================================================================== --- stable/8/sys/geom/concat/g_concat.c Tue Jan 5 13:49:18 2010 (r201581) +++ stable/8/sys/geom/concat/g_concat.c Tue Jan 5 13:50:14 2010 (r201582) @@ -347,14 +347,14 @@ static void g_concat_check_and_run(struct g_concat_softc *sc) { struct g_concat_disk *disk; + struct g_provider *pp; u_int no, sectorsize = 0; off_t start; if (g_concat_nvalid(sc) != sc->sc_ndisks) return; - sc->sc_provider = g_new_providerf(sc->sc_geom, "concat/%s", - sc->sc_name); + pp = g_new_providerf(sc->sc_geom, "concat/%s", sc->sc_name); start = 0; for (no = 0; no < sc->sc_ndisks; no++) { disk = &sc->sc_disks[no]; @@ -371,10 +371,13 @@ g_concat_check_and_run(struct g_concat_s disk->d_consumer->provider->sectorsize); } } - sc->sc_provider->sectorsize = sectorsize; + pp->sectorsize = sectorsize; /* We have sc->sc_disks[sc->sc_ndisks - 1].d_end in 'start'. */ - sc->sc_provider->mediasize = start; - g_error_provider(sc->sc_provider, 0); + pp->mediasize = start; + pp->stripesize = sc->sc_disks[0].d_consumer->provider->stripesize; + pp->stripeoffset = sc->sc_disks[0].d_consumer->provider->stripeoffset; + sc->sc_provider = pp; + g_error_provider(pp, 0); G_CONCAT_DEBUG(0, "Device %s activated.", sc->sc_name); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:51:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D66F81065672; Tue, 5 Jan 2010 13:51:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB26E8FC16; Tue, 5 Jan 2010 13:51:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DpNxY014770; Tue, 5 Jan 2010 13:51:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DpNtE014767; Tue, 5 Jan 2010 13:51:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051351.o05DpNtE014767@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201583 - in stable/8/sys: geom sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:51:23 -0000 Author: mav Date: Tue Jan 5 13:51:23 2010 New Revision: 201583 URL: http://svn.freebsd.org/changeset/base/201583 Log: MFC r200934: Add two disk ioctls, giving user-level tools information about disk/array stripe (optimal access block) size and offset. Modified: stable/8/sys/geom/geom_dev.c stable/8/sys/sys/disk.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/geom_dev.c ============================================================================== --- stable/8/sys/geom/geom_dev.c Tue Jan 5 13:50:14 2010 (r201582) +++ stable/8/sys/geom/geom_dev.c Tue Jan 5 13:51:23 2010 (r201583) @@ -323,7 +323,12 @@ g_dev_ioctl(struct cdev *dev, u_long cmd return (ENOENT); strlcpy(data, pp->name, i); break; - + case DIOCGSTRIPESIZE: + *(off_t *)data = cp->provider->stripesize; + break; + case DIOCGSTRIPEOFFSET: + *(off_t *)data = cp->provider->stripeoffset; + break; default: if (cp->provider->geom->ioctl != NULL) { error = cp->provider->geom->ioctl(cp->provider, cmd, data, fflag, td); Modified: stable/8/sys/sys/disk.h ============================================================================== --- stable/8/sys/sys/disk.h Tue Jan 5 13:50:14 2010 (r201582) +++ stable/8/sys/sys/disk.h Tue Jan 5 13:51:23 2010 (r201583) @@ -104,4 +104,16 @@ void disk_err(struct bio *bp, const char * must be at least MAXPATHLEN bytes long. */ +#define DIOCGSTRIPESIZE _IOR('d', 139, off_t) /* Get stripe size in bytes */ + /*- + * Get the size of the device's optimal access block in bytes. + * This should be a multiple of the sectorsize. + */ + +#define DIOCGSTRIPEOFFSET _IOR('d', 140, off_t) /* Get stripe offset in bytes */ + /*- + * Get the offset of the first device's optimal access block in bytes. + * This should be a multiple of the sectorsize. + */ + #endif /* _SYS_DISK_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:51:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12AC5106566C; Tue, 5 Jan 2010 13:51:40 +0000 (UTC) (envelope-from bms@incunabulum.net) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id C72718FC13; Tue, 5 Jan 2010 13:51:39 +0000 (UTC) Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 13F17C9510; Tue, 5 Jan 2010 08:51:39 -0500 (EST) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Tue, 05 Jan 2010 08:51:39 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=VNHKVE0/kzW3/vA7S5601Wpytv4=; b=mtSR6rcWGpPYpqcNK4at4eetyZE5+qVXk9ukgSYisvnmAgEQDe8/1hg22/EB9eHBeh6/2Jth9lHH2p0i78m2vSGlV/MAaktXowTJIQZIBHb1cyfhmnzNFD3myamICcLuIECdq3Welox8o/p/uFT8dzNkt9S7NHifiCdqSuwOKsE= X-Sasl-enc: 7RV9vN9v7Uqu88UlyAVxR3W42mLCjYs3cAkEaUbVOt6A 1262699498 Received: from [192.168.123.18] (cpc2-dals7-0-0-cust253.hari.cable.virginmedia.com [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 325414A6E6B; Tue, 5 Jan 2010 08:51:38 -0500 (EST) Message-ID: <4B4343E7.1020408@incunabulum.net> Date: Tue, 05 Jan 2010 13:51:35 +0000 From: Bruce Simpson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-GB; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: David Xu References: <201001040527.o045RoNN062634@svn.freebsd.org> In-Reply-To: <201001040527.o045RoNN062634@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201472 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:51:40 -0000 On 04/01/2010 05:27, David Xu wrote: > Log: > Add user-level semaphore synchronous type... > Nice work! Will this be MFC-able to 8.x? A lot of things could benefit from this, especially Boost.Interprocess. cheers, BMS From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:55:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 936BA1065676; Tue, 5 Jan 2010 13:55:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81BBA8FC14; Tue, 5 Jan 2010 13:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DtnAp015886; Tue, 5 Jan 2010 13:55:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05Dtnow015884; Tue, 5 Jan 2010 13:55:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051355.o05Dtnow015884@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201584 - stable/8/usr.sbin/diskinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:55:49 -0000 Author: mav Date: Tue Jan 5 13:55:49 2010 New Revision: 201584 URL: http://svn.freebsd.org/changeset/base/201584 Log: MFC r196799: Don't bother obtaining the ident if we are not going to print it. Modified: stable/8/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/8/usr.sbin/diskinfo/ (props changed) Modified: stable/8/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:51:23 2010 (r201583) +++ stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:55:49 2010 (r201584) @@ -104,9 +104,6 @@ main(int argc, char **argv) error = ioctl(fd, DIOCGFWHEADS, &fwheads); if (error) fwheads = 0; - error = ioctl(fd, DIOCGIDENT, ident); - if (error) - ident[0] = '\0'; if (!opt_v) { printf("%s", argv[i]); printf("\t%u", sectorsize); @@ -133,7 +130,7 @@ main(int argc, char **argv) printf("\t%-12u\t# Heads according to firmware.\n", fwheads); printf("\t%-12u\t# Sectors according to firmware.\n", fwsectors); } - if (ident[0] != '\0') + if (ioctl(fd, DIOCGIDENT, ident) == 0) printf("\t%-12s\t# Disk ident.\n", ident); } printf("\n"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:56:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 310E3106566B; Tue, 5 Jan 2010 13:56:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D44608FC0A; Tue, 5 Jan 2010 13:56:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Duw2O016200; Tue, 5 Jan 2010 13:56:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DuwrX016197; Tue, 5 Jan 2010 13:56:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051356.o05DuwrX016197@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201585 - stable/8/usr.sbin/diskinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:56:59 -0000 Author: mav Date: Tue Jan 5 13:56:58 2010 New Revision: 201585 URL: http://svn.freebsd.org/changeset/base/201585 Log: MFC 200968: Make diskinfo report disk stripe size and offset. It should help users to make file systems optimally aligned and tuned for better performance. Modified: stable/8/usr.sbin/diskinfo/diskinfo.8 stable/8/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/8/usr.sbin/diskinfo/ (props changed) Modified: stable/8/usr.sbin/diskinfo/diskinfo.8 ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.8 Tue Jan 5 13:55:49 2010 (r201584) +++ stable/8/usr.sbin/diskinfo/diskinfo.8 Tue Jan 5 13:56:58 2010 (r201585) @@ -46,7 +46,8 @@ and optionally runs a naive performance .Pp If given no arguments, the output will be a single line per specified device with the following fields: device name, sectorsize, media size in bytes, -media size in sectors, firmware cylinders, firmware heads, and firmware sectors. +media size in sectors, stripe size, stripe offset, firmware cylinders, +firmware heads, and firmware sectors. The last three fields are only present if the information is available. .Pp If given the Modified: stable/8/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:55:49 2010 (r201584) +++ stable/8/usr.sbin/diskinfo/diskinfo.c Tue Jan 5 13:56:58 2010 (r201585) @@ -58,7 +58,7 @@ main(int argc, char **argv) { int i, ch, fd, error; char buf[BUFSIZ], ident[DISK_IDENT_SIZE]; - off_t mediasize; + off_t mediasize, stripesize, stripeoffset; u_int sectorsize, fwsectors, fwheads; while ((ch = getopt(argc, argv, "ctv")) != -1) { @@ -104,11 +104,19 @@ main(int argc, char **argv) error = ioctl(fd, DIOCGFWHEADS, &fwheads); if (error) fwheads = 0; + error = ioctl(fd, DIOCGSTRIPESIZE, &stripesize); + if (error) + stripesize = 0; + error = ioctl(fd, DIOCGSTRIPEOFFSET, &stripeoffset); + if (error) + stripeoffset = 0; if (!opt_v) { printf("%s", argv[i]); printf("\t%u", sectorsize); printf("\t%jd", (intmax_t)mediasize); printf("\t%jd", (intmax_t)mediasize/sectorsize); + printf("\t%jd", (intmax_t)stripesize); + printf("\t%jd", (intmax_t)stripeoffset); if (fwsectors != 0 && fwheads != 0) { printf("\t%jd", (intmax_t)mediasize / (fwsectors * fwheads * sectorsize)); @@ -124,6 +132,8 @@ main(int argc, char **argv) (intmax_t)mediasize, buf); printf("\t%-12jd\t# mediasize in sectors\n", (intmax_t)mediasize/sectorsize); + printf("\t%-12jd\t# stripesize\n", stripesize); + printf("\t%-12jd\t# stripeoffset\n", stripeoffset); if (fwsectors != 0 && fwheads != 0) { printf("\t%-12jd\t# Cylinders according to firmware.\n", (intmax_t)mediasize / (fwsectors * fwheads * sectorsize)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 13:58:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C931106566B; Tue, 5 Jan 2010 13:58:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AD378FC08; Tue, 5 Jan 2010 13:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05DwIQu016561; Tue, 5 Jan 2010 13:58:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05DwII0016559; Tue, 5 Jan 2010 13:58:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051358.o05DwII0016559@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 13:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201586 - stable/8/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 13:58:18 -0000 Author: mav Date: Tue Jan 5 13:58:18 2010 New Revision: 201586 URL: http://svn.freebsd.org/changeset/base/201586 Log: MFC 200969: Report stripe size only if physical sector size is not equal to logical. Modified: stable/8/sys/cam/ata/ata_da.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Tue Jan 5 13:56:58 2010 (r201585) +++ stable/8/sys/cam/ata/ata_da.c Tue Jan 5 13:58:18 2010 (r201586) @@ -687,9 +687,14 @@ adaregister(struct cam_periph *periph, v softc->disk->d_sectorsize = softc->params.secsize; softc->disk->d_mediasize = (off_t)softc->params.sectors * softc->params.secsize; - softc->disk->d_stripesize = ata_physical_sector_size(&cgd->ident_data); - softc->disk->d_stripeoffset = softc->disk->d_stripesize - - ata_logical_sector_offset(&cgd->ident_data); + if (ata_physical_sector_size(&cgd->ident_data) != + softc->params.secsize) { + softc->disk->d_stripesize = + ata_physical_sector_size(&cgd->ident_data); + softc->disk->d_stripeoffset = (softc->disk->d_stripesize - + ata_logical_sector_offset(&cgd->ident_data)) % + softc->disk->d_stripesize; + } /* XXX: these are not actually "firmware" values, so they may be wrong */ softc->disk->d_fwsectors = softc->params.secs_per_track; softc->disk->d_fwheads = softc->params.heads; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 14:02:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06AA51065694; Tue, 5 Jan 2010 14:02:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF8368FC0A; Tue, 5 Jan 2010 14:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05E2C5w017527; Tue, 5 Jan 2010 14:02:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05E2CRq017523; Tue, 5 Jan 2010 14:02:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051402.o05E2CRq017523@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 14:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201587 - stable/8/sys/dev/twe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 14:02:13 -0000 Author: mav Date: Tue Jan 5 14:02:12 2010 New Revision: 201587 URL: http://svn.freebsd.org/changeset/base/201587 Log: MFC 200991: Teach twe driver to report array stripe size to GEOM. Modified: stable/8/sys/dev/twe/twe.c stable/8/sys/dev/twe/twe_freebsd.c stable/8/sys/dev/twe/twevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/twe/twe.c ============================================================================== --- stable/8/sys/dev/twe/twe.c Tue Jan 5 13:58:18 2010 (r201586) +++ stable/8/sys/dev/twe/twe.c Tue Jan 5 14:02:12 2010 (r201587) @@ -201,7 +201,7 @@ twe_add_unit(struct twe_softc *sc, int u int table, error = 0; u_int16_t dsize; TWE_Param *drives = NULL, *param = NULL; - TWE_Unit_Descriptor *ud; + TWE_Array_Descriptor *ud; if (unit < 0 || unit > TWE_MAX_UNITS) return (EINVAL); @@ -244,8 +244,9 @@ twe_add_unit(struct twe_softc *sc, int u error = EIO; goto out; } - ud = (TWE_Unit_Descriptor *)param->data; + ud = (TWE_Array_Descriptor *)param->data; dr->td_type = ud->configuration; + dr->td_stripe = ud->stripe_size; /* build synthetic geometry as per controller internal rules */ if (dr->td_size > 0x200000) { Modified: stable/8/sys/dev/twe/twe_freebsd.c ============================================================================== --- stable/8/sys/dev/twe/twe_freebsd.c Tue Jan 5 13:58:18 2010 (r201586) +++ stable/8/sys/dev/twe/twe_freebsd.c Tue Jan 5 14:02:12 2010 (r201587) @@ -818,6 +818,13 @@ twed_attach(device_t dev) sc->twed_disk->d_maxsize = (TWE_MAX_SGL_LENGTH - 1) * PAGE_SIZE; sc->twed_disk->d_sectorsize = TWE_BLOCK_SIZE; sc->twed_disk->d_mediasize = TWE_BLOCK_SIZE * (off_t)sc->twed_drive->td_size; + if (sc->twed_drive->td_type == TWE_UD_CONFIG_RAID0 || + sc->twed_drive->td_type == TWE_UD_CONFIG_RAID5 || + sc->twed_drive->td_type == TWE_UD_CONFIG_RAID10) { + sc->twed_disk->d_stripesize = + TWE_BLOCK_SIZE << sc->twed_drive->td_stripe; + sc->twed_disk->d_stripeoffset = 0; + } sc->twed_disk->d_fwsectors = sc->twed_drive->td_sectors; sc->twed_disk->d_fwheads = sc->twed_drive->td_heads; sc->twed_disk->d_unit = sc->twed_drive->td_sys_unit; Modified: stable/8/sys/dev/twe/twevar.h ============================================================================== --- stable/8/sys/dev/twe/twevar.h Tue Jan 5 13:58:18 2010 (r201586) +++ stable/8/sys/dev/twe/twevar.h Tue Jan 5 14:02:12 2010 (r201587) @@ -59,6 +59,7 @@ struct twe_drive /* unit state and type */ u_int8_t td_state; u_int8_t td_type; + u_int8_t td_stripe; /* handle for attached driver */ device_t td_disk; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 14:03:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9B7D106566B; Tue, 5 Jan 2010 14:03:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C84C28FC1E; Tue, 5 Jan 2010 14:03:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05E3kam017906; Tue, 5 Jan 2010 14:03:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05E3k3e017904; Tue, 5 Jan 2010 14:03:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001051403.o05E3k3e017904@svn.freebsd.org> From: Alexander Motin Date: Tue, 5 Jan 2010 14:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201588 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 14:03:47 -0000 Author: mav Date: Tue Jan 5 14:03:46 2010 New Revision: 201588 URL: http://svn.freebsd.org/changeset/base/201588 Log: MFC 200977: Avoid false positive probe on ICH6 chipsets. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Tue Jan 5 14:02:12 2010 (r201587) +++ stable/8/sys/dev/ahci/ahci.c Tue Jan 5 14:03:46 2010 (r201588) @@ -115,8 +115,8 @@ static struct { {0x43931002, "ATI IXP700", 0}, {0x43941002, "ATI IXP800", 0}, {0x43951002, "ATI IXP800", 0}, - {0x26528086, "Intel ICH6", 0}, - {0x26538086, "Intel ICH6M", 0}, + {0x26528086, "Intel ICH6", AHCI_Q_NOFORCE}, + {0x26538086, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, "Intel ESB2", 0}, {0x26828086, "Intel ESB2", 0}, {0x26838086, "Intel ESB2", 0}, From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 17:04:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70561065679; Tue, 5 Jan 2010 17:04:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A47698FC21; Tue, 5 Jan 2010 17:04:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05H4Eo7058123; Tue, 5 Jan 2010 17:04:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05H4EE2058119; Tue, 5 Jan 2010 17:04:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001051704.o05H4EE2058119@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Jan 2010 17:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201593 - in stable/8/sys: dev/cxgb/ulp/iw_cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 17:04:14 -0000 Author: jhb Date: Tue Jan 5 17:04:14 2010 New Revision: 201593 URL: http://svn.freebsd.org/changeset/base/201593 Log: MFC 200847: - Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove the leading underscores since they are now implemented. - Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info structure. Modified: stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c stable/8/sys/netinet/tcp.h stable/8/sys/netinet/tcp_usrreq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Tue Jan 5 16:49:12 2010 (r201592) +++ stable/8/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Tue Jan 5 17:04:14 2010 (r201593) @@ -203,7 +203,7 @@ static int set_tcpinfo(struct iwch_ep *e ep->snd_seq = ti.tcpi_snd_nxt; ep->rcv_seq = ti.tcpi_rcv_nxt; - ep->emss = ti.__tcpi_snd_mss - sizeof(struct tcpiphdr); + ep->emss = ti.tcpi_snd_mss - sizeof(struct tcpiphdr); ep->hwtid = TOEPCB(ep->com.so)->tp_tid; /* XXX */ if (ti.tcpi_options & TCPI_OPT_TIMESTAMPS) ep->emss -= 12; Modified: stable/8/sys/netinet/tcp.h ============================================================================== --- stable/8/sys/netinet/tcp.h Tue Jan 5 16:49:12 2010 (r201592) +++ stable/8/sys/netinet/tcp.h Tue Jan 5 17:04:14 2010 (r201593) @@ -181,10 +181,10 @@ struct tcp_info { u_int8_t tcpi_snd_wscale:4, /* RFC1323 send shift value. */ tcpi_rcv_wscale:4; /* RFC1323 recv shift value. */ - u_int32_t __tcpi_rto; + u_int32_t tcpi_rto; /* Retransmission timeout (usec). */ u_int32_t __tcpi_ato; - u_int32_t __tcpi_snd_mss; - u_int32_t __tcpi_rcv_mss; + u_int32_t tcpi_snd_mss; /* Max segment size for send. */ + u_int32_t tcpi_rcv_mss; /* Max segment size for receive. */ u_int32_t __tcpi_unacked; u_int32_t __tcpi_sacked; @@ -195,7 +195,7 @@ struct tcp_info { /* Times; measurements in usecs. */ u_int32_t __tcpi_last_data_sent; u_int32_t __tcpi_last_ack_sent; /* Also unimpl. on Linux? */ - u_int32_t __tcpi_last_data_recv; + u_int32_t tcpi_last_data_recv; /* Time since last recv data. */ u_int32_t __tcpi_last_ack_recv; /* Metrics; variable units. */ Modified: stable/8/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/8/sys/netinet/tcp_usrreq.c Tue Jan 5 16:49:12 2010 (r201592) +++ stable/8/sys/netinet/tcp_usrreq.c Tue Jan 5 17:04:14 2010 (r201593) @@ -1200,6 +1200,8 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_rcv_wscale = tp->rcv_scale; } + ti->tcpi_rto = tp->t_rxtcur * tick; + ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick; ti->tcpi_rtt = ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT; ti->tcpi_rttvar = ((u_int64_t)tp->t_rttvar * tick) >> TCP_RTTVAR_SHIFT; @@ -1214,8 +1216,8 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_snd_wnd = tp->snd_wnd; ti->tcpi_snd_bwnd = tp->snd_bwnd; ti->tcpi_snd_nxt = tp->snd_nxt; - ti->__tcpi_snd_mss = tp->t_maxseg; - ti->__tcpi_rcv_mss = tp->t_maxseg; + ti->tcpi_snd_mss = tp->t_maxseg; + ti->tcpi_rcv_mss = tp->t_maxseg; if (tp->t_flags & TF_TOE) ti->tcpi_options |= TCPI_OPT_TOE; } From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 17:04:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60AB610657C6; Tue, 5 Jan 2010 17:04:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E7798FC0C; Tue, 5 Jan 2010 17:04:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05H4deD058258; Tue, 5 Jan 2010 17:04:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05H4dPn058254; Tue, 5 Jan 2010 17:04:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001051704.o05H4dPn058254@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Jan 2010 17:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201594 - in stable/7/sys: dev/cxgb/ulp/iw_cxgb netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 17:04:40 -0000 Author: jhb Date: Tue Jan 5 17:04:39 2010 New Revision: 201594 URL: http://svn.freebsd.org/changeset/base/201594 Log: MFC 200847: - Rename the __tcpi_(snd|rcv)_mss fields of the tcp_info structure to remove the leading underscores since they are now implemented. - Implement the tcpi_rto and tcpi_last_data_recv fields in the tcp_info structure. Modified: stable/7/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c stable/7/sys/netinet/tcp.h stable/7/sys/netinet/tcp_usrreq.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- stable/7/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Tue Jan 5 17:04:14 2010 (r201593) +++ stable/7/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Tue Jan 5 17:04:39 2010 (r201594) @@ -217,7 +217,7 @@ static int set_tcpinfo(struct iwch_ep *e ep->snd_seq = ti.tcpi_snd_nxt; ep->rcv_seq = ti.tcpi_rcv_nxt; - ep->emss = ti.__tcpi_snd_mss - sizeof(struct tcpiphdr); + ep->emss = ti.tcpi_snd_mss - sizeof(struct tcpiphdr); ep->hwtid = TOEPCB(ep->com.so)->tp_tid; /* XXX */ if (ti.tcpi_options & TCPI_OPT_TIMESTAMPS) ep->emss -= 12; Modified: stable/7/sys/netinet/tcp.h ============================================================================== --- stable/7/sys/netinet/tcp.h Tue Jan 5 17:04:14 2010 (r201593) +++ stable/7/sys/netinet/tcp.h Tue Jan 5 17:04:39 2010 (r201594) @@ -181,10 +181,10 @@ struct tcp_info { u_int8_t tcpi_snd_wscale:4, /* RFC1323 send shift value. */ tcpi_rcv_wscale:4; /* RFC1323 recv shift value. */ - u_int32_t __tcpi_rto; + u_int32_t tcpi_rto; /* Retransmission timeout (usec). */ u_int32_t __tcpi_ato; - u_int32_t __tcpi_snd_mss; - u_int32_t __tcpi_rcv_mss; + u_int32_t tcpi_snd_mss; /* Max segment size for send. */ + u_int32_t tcpi_rcv_mss; /* Max segment size for receive. */ u_int32_t __tcpi_unacked; u_int32_t __tcpi_sacked; @@ -195,7 +195,7 @@ struct tcp_info { /* Times; measurements in usecs. */ u_int32_t __tcpi_last_data_sent; u_int32_t __tcpi_last_ack_sent; /* Also unimpl. on Linux? */ - u_int32_t __tcpi_last_data_recv; + u_int32_t tcpi_last_data_recv; /* Time since last recv data. */ u_int32_t __tcpi_last_ack_recv; /* Metrics; variable units. */ Modified: stable/7/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/7/sys/netinet/tcp_usrreq.c Tue Jan 5 17:04:14 2010 (r201593) +++ stable/7/sys/netinet/tcp_usrreq.c Tue Jan 5 17:04:39 2010 (r201594) @@ -1193,6 +1193,8 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_rcv_wscale = tp->rcv_scale; } + ti->tcpi_rto = tp->t_rxtcur * tick; + ti->tcpi_last_data_recv = (long)(ticks - (int)tp->t_rcvtime) * tick; ti->tcpi_rtt = ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT; ti->tcpi_rttvar = ((u_int64_t)tp->t_rttvar * tick) >> TCP_RTTVAR_SHIFT; @@ -1206,11 +1208,11 @@ tcp_fill_info(struct tcpcb *tp, struct t ti->tcpi_rcv_nxt = tp->rcv_nxt; ti->tcpi_snd_wnd = tp->snd_wnd; ti->tcpi_snd_bwnd = tp->snd_bwnd; - ti->tcpi_snd_nxt = tp->snd_nxt; - ti->__tcpi_snd_mss = tp->t_maxseg; - ti->__tcpi_rcv_mss = tp->t_maxseg; - if (tp->t_flags & TF_TOE) - ti->tcpi_options |= TCPI_OPT_TOE; + ti->tcpi_snd_nxt = tp->snd_nxt; + ti->tcpi_snd_mss = tp->t_maxseg; + ti->tcpi_rcv_mss = tp->t_maxseg; + if (tp->t_flags & TF_TOE) + ti->tcpi_options |= TCPI_OPT_TOE; } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 17:13:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12CBC1065676; Tue, 5 Jan 2010 17:13:21 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-yw0-f197.google.com (mail-yw0-f197.google.com [209.85.211.197]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2228FC0C; Tue, 5 Jan 2010 17:13:20 +0000 (UTC) Received: by ywh35 with SMTP id 35so7761527ywh.7 for ; Tue, 05 Jan 2010 09:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc; bh=k3bimljpP8/EnSHhT/2WnfAntxnQMjdju44btgez6Ms=; b=hTWu5Yq96FDv00Uq8ancJgMjbWAKhG09iT2C86KTyCEN66TxZ7rIlBkLjmqdFZQ8sT rVclq4E4XDbO7/Lup+GqoXHVlCz02HNzjgcpsYnyiXLyTnJYJ4hsTFq5m9L+Rqdb9Q9/ 0xEHgvErPKmeCmQknB9zyUmqQr5+7r3vlcjps= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc; b=u+nIGG7Yw8XGJmxLlaF7QleiEjTk8XEQtMNTIdrrq1CUbBBINlkVSG6o2R2dXVDpgS VKEJMK8Df/w9PpOqFsFz4/nRno80xMu/GfRRxqRDUWqs1MLxq/uYkY/z0zgSxeyTWr21 v7Su/UGKk+9NTq907jNR1qb7LpLocm8K+ll7M= Received: by 10.150.106.19 with SMTP id e19mr20882149ybc.323.1262711593955; Tue, 05 Jan 2010 09:13:13 -0800 (PST) Received: from ?10.68.43.79? ([166.205.5.36]) by mx.google.com with ESMTPS id 4sm6701595ywi.27.2010.01.05.09.13.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Jan 2010 09:13:12 -0800 (PST) References: <201001051234.o05CYDlR096994@svn.freebsd.org> Message-Id: <80B3618B-57A9-4524-B4E1-0955DF291344@gmail.com> From: Garrett Cooper To: David Xu In-Reply-To: <201001051234.o05CYDlR096994@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Date: Tue, 5 Jan 2010 10:12:50 -0700 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r201575 - head/tools/regression/posixsem2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 17:13:21 -0000 Sent from my iPhone On Jan 5, 2010, at 5:34 AM, David Xu wrote: > Author: davidxu > Date: Tue Jan 5 12:34:13 2010 > New Revision: 201575 > URL: http://svn.freebsd.org/changeset/base/201575 > > Log: > Add test code for POSIX semaphore implementation. > > Added: > head/tools/regression/posixsem2/ > head/tools/regression/posixsem2/Makefile (contents, props changed) > head/tools/regression/posixsem2/semtest.c (contents, props changed) > > Added: head/tools/regression/posixsem2/Makefile > === > === > === > ===================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/posixsem2/Makefile Tue Jan 5 12:34:13 > 2010 (r201575) > @@ -0,0 +1,9 @@ > +# $FreeBSD$ > + > +PROG= semtest > +SRCS= semtest.c > +NO_MAN= > + > +WARNS?= 3 > + > +.include > > Added: head/tools/regression/posixsem2/semtest.c > === > === > === > ===================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/regression/posixsem2/semtest.c Tue Jan 5 12:34:13 > 2010 (r201575) > @@ -0,0 +1,101 @@ > +/* $FreeBSD$ */ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#define SEM_NAME "/semtst" > + > +int test_unnamed(void); > +int test_named(void); > + > +int > +test_unnamed(void) > +{ > + sem_t *s; > + pid_t pid; > + int status; > + > + printf("testing unnamed process-shared semaphore\n"); > + s = (sem_t *)mmap(NULL, sizeof(sem_t), PROT_READ|PROT_WRITE, > MAP_ANON|MAP_SHARED, > + -1, 0); > + if (s == MAP_FAILED) > + err(1, "mmap failed"); > + if (sem_init(s, 1, 0)) > + err(2, "sem_init failed"); > + if ((pid = fork()) == 0) { > + printf("child: sem_wait()\n"); > + if (sem_wait(s)) > + err(3, "sem_wait failed"); > + printf("child: sem_wait() returned\n"); > + exit(0); > + } else { > + sleep(1); > + printf("parent: sem_post()\n"); > + if (sem_post(s)) > + err(4, "sem_post failed"); > + waitpid(pid, &status, 0); Same as below... > + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) > + printf("OK.\n"); > + else > + printf("Failure."); > + } > + return (0); > +} > + > +int > +test_named(void) > +{ > + sem_t *s, *s2; > + pid_t pid; > + int status; > + > + printf("testing named process-shared semaphore\n"); > + sem_unlink(SEM_NAME); > + s = sem_open(SEM_NAME, O_CREAT, 0777); > + if (s == SEM_FAILED) > + err(1, "sem_open failed"); > + s2 = sem_open(SEM_NAME, O_CREAT, 0777); > + if (s2 == SEM_FAILED) > + err(2, "second sem_open call failed"); > + if (s != s2) > + err(3, "two sem_open calls for same semaphore do not returm > same address."); > + if (sem_close(s2)) > + err(4, "sem_close failed"); > + if ((pid = fork()) == 0) { > + printf("child: sem_wait()\n"); > + if (sem_wait(s)) > + err(5, "sem_wait failed"); > + printf("child: sem_wait() returned\n"); > + exit(0); > + } else { > + sleep(1); > + printf("parent: sem_post()\n"); > + if (sem_post(s)) > + err(6, "sem_post failed"); > + waitpid(pid, &status, 0); waitpid can fail and the status reported could be completely bogus. Maybe this should be the first branch condition (check for == 0) in the if-statement below? > + if (WIFEXITED(status) && WEXITSTATUS(status) == 0) > + printf("OK.\n"); > + else > + printf("Failure."); > + } > + > + if (sem_close(s)) > + err(7, "sem_close failed"); > + > + return (0); > +} > + > +int > +main(void) > +{ > + test_unnamed(); > + test_named(); > + return (0); > +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 17:45:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B417C106568F; Tue, 5 Jan 2010 17:45:39 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8882C8FC1C; Tue, 5 Jan 2010 17:45:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Hjd8q067395; Tue, 5 Jan 2010 17:45:39 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05HjdwA067393; Tue, 5 Jan 2010 17:45:39 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201001051745.o05HjdwA067393@svn.freebsd.org> From: Ken Smith Date: Tue, 5 Jan 2010 17:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201596 - stable/7/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 17:45:39 -0000 Author: kensmith Date: Tue Jan 5 17:45:39 2010 New Revision: 201596 URL: http://svn.freebsd.org/changeset/base/201596 Log: MFS8 r201529: Add FreeBSD- to the beginning of the ISO image filenames. Modified: stable/7/release/Makefile Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) Modified: stable/7/release/Makefile ============================================================================== --- stable/7/release/Makefile Tue Jan 5 17:05:12 2010 (r201595) +++ stable/7/release/Makefile Tue Jan 5 17:45:39 2010 (r201596) @@ -1149,39 +1149,39 @@ iso.1: .if defined(CD_BOOT) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_bootonly \ - ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} .endif @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ ${CD_DISC1_PKGS} @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Packages \ - ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ ${CD_DISC2_PKGS} @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Packages_2 \ - ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ ${CD_DISC3_PKGS} .if defined(MAKE_DVD) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ ${CD_DVD1_PKGS} .endif .if !defined(NODOC) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Documentation \ - ${CD}/${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} .endif .if defined(SEPARATE_LIVEFS) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_LiveFS \ - ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} .endif @echo "Generating MD5 and SHA256 sums..." - @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) - @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) + @(cd ${CD} && md5 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) + @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) touch ${.TARGET} .else @echo "Do not know how to create an ISO for ${TARGET_ARCH}." From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 18:25:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAC7C1065695; Tue, 5 Jan 2010 18:25:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C913F8FC22; Tue, 5 Jan 2010 18:25:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05IPfjk076261; Tue, 5 Jan 2010 18:25:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05IPfG4076257; Tue, 5 Jan 2010 18:25:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001051825.o05IPfG4076257@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Jan 2010 18:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201597 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 18:25:42 -0000 Author: jhb Date: Tue Jan 5 18:25:41 2010 New Revision: 201597 URL: http://svn.freebsd.org/changeset/base/201597 Log: MFC 201196: Change vlan interfaces to cope more usefully with the parent interface being renamed. Previously the vlan interfaces would lose their configuration as if the parent interface had been physically removed. Now vlan interfaces ignore rename events. - Add a new ifnet flag (IFF_RENAMING) that is set while an ifnet is being renamed. This flag can be checked in ifnet departure/arrival event handlers to treat rename events differently. - Change the ifnet departure event handler in the if_vlan(4) driver to ignore departure events due to a trunk interface being renamed. Modified: stable/8/sys/net/if.c stable/8/sys/net/if.h stable/8/sys/net/if_vlan.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if.c ============================================================================== --- stable/8/sys/net/if.c Tue Jan 5 17:45:39 2010 (r201596) +++ stable/8/sys/net/if.c Tue Jan 5 18:25:41 2010 (r201597) @@ -2161,6 +2161,14 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (EINVAL); if (ifunit(new_name) != NULL) return (EEXIST); + + /* + * XXX: Locking. Nothing else seems to lock if_flags, + * and there are numerous other races with the + * ifunit() checks not being atomic with namespace + * changes (renames, vmoves, if_attach, etc). + */ + ifp->if_flags |= IFF_RENAMING; /* Announce the departure of the interface. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE); @@ -2195,6 +2203,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); /* Announce the return of the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); + + ifp->if_flags &= ~IFF_RENAMING; break; #ifdef VIMAGE Modified: stable/8/sys/net/if.h ============================================================================== --- stable/8/sys/net/if.h Tue Jan 5 17:45:39 2010 (r201596) +++ stable/8/sys/net/if.h Tue Jan 5 18:25:41 2010 (r201597) @@ -150,6 +150,7 @@ struct if_data { #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */ #define IFF_DYING 0x200000 /* (n) interface is winding down */ +#define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ /* * Old names for driver flags so that user space tools can continue to use Modified: stable/8/sys/net/if_vlan.c ============================================================================== --- stable/8/sys/net/if_vlan.c Tue Jan 5 17:45:39 2010 (r201596) +++ stable/8/sys/net/if_vlan.c Tue Jan 5 18:25:41 2010 (r201597) @@ -466,7 +466,8 @@ vlan_setmulti(struct ifnet *ifp) * A handler for network interface departure events. * Track departure of trunks here so that we don't access invalid * pointers or whatever if a trunk is ripped from under us, e.g., - * by ejecting its hot-plug card. + * by ejecting its hot-plug card. However, if an ifnet is simply + * being renamed, then there's no need to tear down the state. */ static void vlan_ifdetach(void *arg __unused, struct ifnet *ifp) @@ -481,6 +482,10 @@ vlan_ifdetach(void *arg __unused, struct if (ifp->if_vlantrunk == NULL) return; + /* If the ifnet is just being renamed, don't do anything. */ + if (ifp->if_flags & IFF_RENAMING) + return; + VLAN_LOCK(); /* * OK, it's a trunk. Loop over and detach all vlan's on it. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 18:26:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5310106566C; Tue, 5 Jan 2010 18:26:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C389E8FC21; Tue, 5 Jan 2010 18:26:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05IQf0I076562; Tue, 5 Jan 2010 18:26:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05IQfUP076558; Tue, 5 Jan 2010 18:26:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001051826.o05IQfUP076558@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Jan 2010 18:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201599 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 18:26:42 -0000 Author: jhb Date: Tue Jan 5 18:26:41 2010 New Revision: 201599 URL: http://svn.freebsd.org/changeset/base/201599 Log: MFC 201196: Change vlan interfaces to cope more usefully with the parent interface being renamed. Previously the vlan interfaces would lose their configuration as if the parent interface had been physically removed. Now vlan interfaces ignore rename events. - Add a new ifnet flag (IFF_RENAMING) that is set while an ifnet is being renamed. This flag can be checked in ifnet departure/arrival event handlers to treat rename events differently. - Change the ifnet departure event handler in the if_vlan(4) driver to ignore departure events due to a trunk interface being renamed. Modified: stable/7/sys/net/if.c stable/7/sys/net/if.h stable/7/sys/net/if_vlan.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if.c ============================================================================== --- stable/7/sys/net/if.c Tue Jan 5 18:26:26 2010 (r201598) +++ stable/7/sys/net/if.c Tue Jan 5 18:26:41 2010 (r201599) @@ -1754,6 +1754,14 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, return (EINVAL); if (ifunit(new_name) != NULL) return (EEXIST); + + /* + * XXX: Locking. Nothing else seems to lock if_flags, + * and there are numerous other races with the + * ifunit() checks not being atomic with namespace + * changes (renames, vmoves, if_attach, etc). + */ + ifp->if_flags |= IFF_RENAMING; /* Announce the departure of the interface. */ rt_ifannouncemsg(ifp, IFAN_DEPARTURE); @@ -1788,6 +1796,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp); /* Announce the return of the interface. */ rt_ifannouncemsg(ifp, IFAN_ARRIVAL); + + ifp->if_flags &= ~IFF_RENAMING; break; case SIOCSIFMETRIC: Modified: stable/7/sys/net/if.h ============================================================================== --- stable/7/sys/net/if.h Tue Jan 5 18:26:26 2010 (r201598) +++ stable/7/sys/net/if.h Tue Jan 5 18:26:41 2010 (r201599) @@ -150,6 +150,7 @@ struct if_data { #define IFF_MONITOR 0x40000 /* (n) user-requested monitor mode */ #define IFF_STATICARP 0x80000 /* (n) static ARP */ #define IFF_NEEDSGIANT 0x100000 /* (i) hold Giant over if_start calls */ +#define IFF_RENAMING 0x400000 /* (n) interface is being renamed */ /* * Old names for driver flags so that user space tools can continue to use Modified: stable/7/sys/net/if_vlan.c ============================================================================== --- stable/7/sys/net/if_vlan.c Tue Jan 5 18:26:26 2010 (r201598) +++ stable/7/sys/net/if_vlan.c Tue Jan 5 18:26:41 2010 (r201599) @@ -462,7 +462,8 @@ vlan_setmulti(struct ifnet *ifp) * A handler for network interface departure events. * Track departure of trunks here so that we don't access invalid * pointers or whatever if a trunk is ripped from under us, e.g., - * by ejecting its hot-plug card. + * by ejecting its hot-plug card. However, if an ifnet is simply + * being renamed, then there's no need to tear down the state. */ static void vlan_ifdetach(void *arg __unused, struct ifnet *ifp) @@ -477,6 +478,10 @@ vlan_ifdetach(void *arg __unused, struct if (ifp->if_vlantrunk == NULL) return; + /* If the ifnet is just being renamed, don't do anything. */ + if (ifp->if_flags & IFF_RENAMING) + return; + VLAN_LOCK(); /* * OK, it's a trunk. Loop over and detach all vlan's on it. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 18:28:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A73311065698 for ; Tue, 5 Jan 2010 18:28:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 508828FC2B for ; Tue, 5 Jan 2010 18:28:46 +0000 (UTC) Received: (qmail 10663 invoked by uid 399); 5 Jan 2010 18:28:45 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 5 Jan 2010 18:28:45 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B4384E3.2080600@FreeBSD.org> Date: Tue, 05 Jan 2010 10:28:51 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Stanislav Sedov References: <201001040916.o049GZ1Y013061@svn.freebsd.org> In-Reply-To: <201001040916.o049GZ1Y013061@svn.freebsd.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 18:28:47 -0000 First off, thanks for sorting these, that's a step in the right direction. :) However, a few quibbles. First, our rule is that anything which might offend someone belongs in fortunes-o, and political quotes are always in the category of "might offend someone." (FWIW, neither of these are offensive to me, I'm just pointing out the general procedure.) Second, while it's clear at this point in time who these people are, and what the context is, read through the fortune files sometime and try to place who some of the people referenced are, when the quote was relevant, etc. At minimum the quotes should be dated (IMO). Finally, let's pretend for a second that this is an international project, and not assume that titles like "defense secretary" are meaningful everywhere. :) Oh, and in the Rumsfeld quote you have "there're" twice, and in the actual quote it's spelled out both times, "there are." I would change the citation in the first quote to read: -- United States Secretary of Defense Donald Rumsfeld 12 February 2002 Personally I don't see the need to mention the context, but if you do you could add "... 2002, On the invasion of Iraq" For the second, you could do something like: -- Daniel Fass, Chairman of United States President Barack Obama's financial-industry fundraising party I'll leave finding a date for that quote up to you. :) Doug Stanislav Sedov wrote: > Author: stas > Date: Mon Jan 4 09:16:35 2010 > New Revision: 201477 > URL: http://svn.freebsd.org/changeset/base/201477 > > Log: > - Add two particulary interesting quotes from the past decade. > > Modified: > head/games/fortune/datfiles/fortunes > > Modified: head/games/fortune/datfiles/fortunes > ============================================================================== > --- head/games/fortune/datfiles/fortunes Mon Jan 4 09:02:39 2010 (r201476) > +++ head/games/fortune/datfiles/fortunes Mon Jan 4 09:16:35 2010 (r201477) > @@ -1604,6 +1604,13 @@ friends and family, and then justify thi > for doing it." > -- Bruce Feirstein, "Nice Guys Sleep Alone" > % > + As we know, there are known knowns. There are things we know we > +know. We also know there are known unknowns. That is to say, we know > +there're some things we do not know. But there're also unknown unknowns; > +the ones we don't know we don't know." > + -- Defense Secretary Donald Rumsfeld, > + about the invasion to Iraq. > +% > At a recent meeting in Snowmass, Colorado, a participant from > Los Angeles fainted from hyperoxygenation, and we had to hold his head > under the exhaust of a bus until he revived. > @@ -46372,6 +46379,13 @@ constitutions, displaying the utmost imp > overturning everything. > -- Plato, "Republic", 370 B.C. > % > +The investment community feels very putupon. They feel there is no > +reason why they shouldn't earn $1 million to $200 million a year, > +and they don't want to be held responsible for the global financial > +meltdown. > + -- Daniel Fass, chairman of Obama's > + financial-industry fundraising party > +% > The IQ of the group is the lowest IQ of a member of > the group divided by the number of people in the group. > % > -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 19:25:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80C881065695; Tue, 5 Jan 2010 19:25:57 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5575B8FC12; Tue, 5 Jan 2010 19:25:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05JPvAr090042; Tue, 5 Jan 2010 19:25:57 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05JPvR2090040; Tue, 5 Jan 2010 19:25:57 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201001051925.o05JPvR2090040@svn.freebsd.org> From: Ken Smith Date: Tue, 5 Jan 2010 19:25:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201600 - in stable/6/release: . scripts X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 19:25:57 -0000 Author: kensmith Date: Tue Jan 5 19:25:57 2010 New Revision: 201600 URL: http://svn.freebsd.org/changeset/base/201600 Log: MFS7 r201596: Add FreeBSD- to the beginning of the ISO image filenames. Modified: stable/6/release/Makefile Directory Properties: stable/6/release/ (props changed) stable/6/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/6/release/scripts/src-install.sh (props changed) Modified: stable/6/release/Makefile ============================================================================== --- stable/6/release/Makefile Tue Jan 5 18:26:41 2010 (r201599) +++ stable/6/release/Makefile Tue Jan 5 19:25:57 2010 (r201600) @@ -1120,39 +1120,39 @@ iso.1: .if defined(CD_BOOT) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_bootonly \ - ${CD}/${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-bootonly.iso ${CD_BOOT} .endif @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc1.iso ${CD_DISC1} \ ${CD_DISC1_PKGS} @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Packages \ - ${CD}/${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc2.iso ${CD_DISC2} \ ${CD_DISC2_PKGS} @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Packages_2 \ - ${CD}/${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-disc3.iso ${CD_DISC3} \ ${CD_DISC3_PKGS} .if defined(MAKE_DVD) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_Install \ - ${CD}/${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-dvd1.iso ${CD_DVD1} \ ${CD_DVD1_PKGS} .endif .if !defined(NODOC) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh \ FreeBSD_Documentation \ - ${CD}/${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-docs.iso ${CD_DOCS} .endif .if defined(SEPARATE_LIVEFS) @sh ${.CURDIR}/${TARGET_ARCH}/mkisoimages.sh ${BOOTABLE} \ FreeBSD_LiveFS \ - ${CD}/${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} + ${CD}/FreeBSD-${BUILDNAME}-${TARGET}-livefs.iso ${CD_LIVEFS} .endif @echo "Generating MD5 and SHA256 sums..." - @(cd ${CD} && md5 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) - @(cd ${CD} && sha256 *.iso > ${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) + @(cd ${CD} && md5 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.MD5) + @(cd ${CD} && sha256 *.iso > FreeBSD-${BUILDNAME}-${TARGET}-iso.CHECKSUM.SHA256) touch ${.TARGET} .else @echo "Do not know how to create an ISO for ${TARGET_ARCH}." From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 19:40:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B4C9106566B; Tue, 5 Jan 2010 19:40:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48CC38FC0C; Tue, 5 Jan 2010 19:40:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05JeYbU093372; Tue, 5 Jan 2010 19:40:34 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05JeWZu093370; Tue, 5 Jan 2010 19:40:32 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001051940.o05JeWZu093370@svn.freebsd.org> From: Doug Barton Date: Tue, 5 Jan 2010 19:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201601 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 19:40:34 -0000 Author: dougb Date: Tue Jan 5 19:40:32 2010 New Revision: 201601 URL: http://svn.freebsd.org/changeset/base/201601 Log: Remove more duplicates Minor reformatting on a few Modified: head/games/fortune/datfiles/fortunes Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Tue Jan 5 19:25:57 2010 (r201600) +++ head/games/fortune/datfiles/fortunes Tue Jan 5 19:40:32 2010 (r201601) @@ -1703,14 +1703,6 @@ the Cat. "Then it doesn't matter which way you go," said the Cat. -- Lewis Carroll % - COMMENT - -Oh, life is a glorious cycle of song, -A medley of extemporanea; -And love is thing that can never go wrong; -And I am Marie of Roumania. - -- Dorothy Parker -% Concerning the war in Vietnam, Senator George Aiken of Vermont noted in January, 1966, "I'm not very keen for doves or hawks. I think we need more owls." @@ -1930,22 +1922,6 @@ Christmas tree. The piano is missing. you rent your home and own Firearms, in which case you can go to level 4. The best way to get to level 3 is egg-nog. % - FIGHTING WORDS - -Say my love is easy had, - Say I'm bitten raw with pride, -Say I am too often sad -- - Still behold me at your side. - -Say I'm neither brave nor young, - Say I woo and coddle care, -Say the devil touched my tongue -- - Still you have my heart to wear. - -But say my verses do not scan, - And I get me another man! - -- Dorothy Parker -% "For I perceive that behind this seemingly unrelated sequence of events, there lurks a singular, sinister attitude of mind." @@ -2217,20 +2193,6 @@ full of money before." "Didn't you see it?" "Damn kid had it under his coat." % - Hug O' War - -I will not play at tug o' war. -I'd rather play at hug o' war, -Where everyone hugs -Instead of tugs, -Where everyone giggles -And rolls on the rug, -Where everyone kisses, -And everyone grins, -And everyone cuddles, -And everyone wins. - -- Shel Silverstein -% Human thinking can skip over a great deal, leap over small misunderstandings, can contain ifs and buts in untroubled corners of the mind. But the machine has no corners. Despite all the attempts to @@ -2684,33 +2646,6 @@ right any day." life-style otherwise." -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" % - Insofar as I may be heard by anything, which may or may not care -what I say, I ask, if it matters, that you be forgiven for anything you -may have done or failed to do which requires forgiveness. Conversely, if -not forgiveness but something else may be required to insure any possible -benefit for which you may be eligible after the destruction of your body, -I ask this, whatever it may be, be granted or withheld, as the case may be, -in such a manner as to insure your receiving said benefit. I ask this in my -capacity as your elected intermediary between yourself and that which may -not be yourself, but which may have an interest in the matter of your -receiving as much as it is possible for you to receive of this thing, and -which may in some way be influenced by this ceremony. - Amen. - -- Roger Zelazny, "Creatures of Light and Darkness", 1969 -% - INVENTORY -Four be the things I am wiser to know: -Idleness, sorrow, a friend, and a foe. - -Four be the things I'd been better without: -Love, curiosity, freckles, and doubt. - -Three be the things I shall never attain: -Envy, content, and sufficient champagne. - -Three be the things I shall have till I die: -Laughter and hope and a sock in the eye. -% "Is there any point to which you would wish to draw my attention?" "To the curious incident of the dog in the night-time." "The dog did nothing in the night-time." @@ -3990,28 +3925,6 @@ almost succeeded in getting a VAX to thi organization say that each time the machine fails to think it ceases to exist. % - THE LESSER-KNOWN PROGRAMMING LANGUAGES #5: VALGOL -From its modest beginnings in Southern California's San Fernando Valley, -VALGOL is enjoying a dramatic surge of popularity across the industry. - -Here is a sample program: - LIKE, Y*KNOW(I MEAN)START - IF PIZZA = LIKE BITCHEN AND GUY = LIKE TUBULAR AND - VALLEY GIRL = LIKE GRODY**MAX(FERSURE)**2 THEN - FOR I = LIKE 1 TO OH*MAYBE 100 - DO*WAH - (DITTY**2) - BARF(I)=TOTALLY GROSS(OUT) - SURE - LIKE BAG THIS PROGRAM - REALLY - LIKE TOTALLY (Y*KNOW) - IM*SURE - GOTO THE MALL - -When the user makes a syntax error, the interpreter displays the message: - - GAG ME WITH A SPOON!! -% THE LESSER-KNOWN PROGRAMMING LANGUAGES #8: LAIDBACK This language was developed at the Marin County Center for T'ai Chi, @@ -5342,9 +5255,6 @@ that he didn't force you down on the ask -- A plethora of individuals wither expertise in culinary techniques vitiated the potable concoction produced by steeping certain coupestibles. -- Eleemosynary deeds have their initial incidence intramurally. --- Male cadavers are incapable of yielding testimony. --- Individuals who make their abode in vitreous edifices would be well - advised to refrain from catapulting projectiles. % =============== ALL FRESHMEN PLEASE NOTE =============== @@ -11083,9 +10993,6 @@ Armstrong's Collection Law: If the check is truly in the mail, it is surely made out to someone else. % -Arnold's Addendum: - Anything not fitting into these categories causes cancer in rats. -% Arnold's Laws of Documentation: 1.) If it should exist, it doesn't. 2.) If it does exist, it's out of date. @@ -12661,7 +12568,7 @@ Boren's Laws: (2) When in trouble, delegate. (3) When in doubt, mumble. % -boss, n: +Boss, n: According to the Oxford English Dictionary, in the Middle Ages the words "boss" and "botch" were largely synonymous, except that boss, in addition to meaning "a supervisor of workers" also meant "an @@ -12942,7 +12849,7 @@ wrote the program. Fortunately, the second-to-last bug has just been fixed. -- Ray Simard % -bug, n: +Bug, n: An elusive creature living in a program that makes it incorrect. The activity of "debugging", or removing bugs from a program, ends when people get tired of doing it, not when the bugs are removed. @@ -13531,14 +13438,14 @@ only robust persons doing this thing is others who have tried it. -- Ambrose Bierce, "The Devil's Dictionary" % - -Certain passages in several laws have always defied interpretation and the -most inexplicable must be a matter of opinion. A judge of the Court of -Session of Scotland has sent the editors of this book his candidate which -reads, "In the Nuts (unground), (other than ground nuts) Order, the expression -nuts shall have reference to such nuts, other than ground nuts, as would -but for this amending Order not qualify as nuts (unground) (other than ground -nuts) by reason of their being nuts (unground)." +Certain passages in several laws have always defied interpretation and +the most inexplicable must be a matter of opinion. A judge of the Court +of Session of Scotland has sent the editors of this book his candidate +which reads, "In the Nuts (unground), (other than ground nuts) Order, +the expression nuts shall have reference to such nuts, other than ground +nuts, as would but for this amending Order not qualify as nuts +(unground) (other than ground nuts) by reason of their being nuts +(unground)." -- Guinness Book of World Records, 1973 % Certainly the game is rigged. @@ -15064,17 +14971,6 @@ letter, or even 25 cents on a stamp! so post it as many places as you can. -- Emily Postnews Answers Your Questions on Netiquette % -Dear Sir, - I am firmly opposed to the spread of microchips either to the home or -to the office. We have more than enough of them foisted upon us in public -places. They are a disgusting Americanism, and can only result in the farmers -being forced to grow smaller potatoes, which in turn will cause massive un- -employment in the already severely depressed agricultural industry. - Yours faithfully, - Capt. Quinton D'Arcy, J.P. - Sevenoaks - -- Letters To The Editor, The Times of London -% Death before dishonor. But neither before breakfast. % @@ -17845,9 +17741,6 @@ Finagle's Eleventh Law: it happened according to his pet theory. % Finagle's First Law: - If an experiment works, something has gone wrong. -% -Finagle's First Law: To study a subject best, understand it thoroughly before you start. Finagle's Second Law: @@ -18180,9 +18073,6 @@ For children with short attention spans: For courage mounteth with occasion. -- William Shakespeare, "King John" % -For every action, there is an equal and opposite criticism. - -- Harrison -% For every bloke who makes his mark, there's half a dozen waiting to rub it out. -- Andy Capp @@ -19527,17 +19417,6 @@ Your butt is on the menu And the check is in the mail. -- The Piranha Club Anthem, to the tune of "De Camptown Races" % -From the "Guinness Book of World Records", 1973: - -Certain passages in several laws have always defied interpretation and -the most inexplicable must be a matter of opinion. A judge of the -Court of Session of Scotland has sent the editors of this book his -candidate which reads, "In the Nuts (unground), (other than ground -nuts) Order, the expression nuts shall have reference to such nuts, -other than ground nuts, as would but for this amending Order not -qualify as nuts (unground)(other than ground nuts) by reason of their -being nuts (unground)." -% From the moment I picked your book up until I put it down I was convulsed with laughter. Some day I intend reading it. -- Groucho Marx, from "The Book of Insults" @@ -24042,21 +23921,6 @@ I may not be totally perfect, but parts I met a wonderful new man. He's fictional, but you can't have everything. -- Cecelia, "The Purple Rose of Cairo" % -I met him in a swamp down in Dagobah -Where it bubbles all the time like a giant cabinet soda - S-O-D-A soda -I saw the little runt sitting there on a log -I asked him his name and in a raspy voice he said Yoda - Y-O-D-A Yoda, Yo-Yo-Yo-Yo Yoda - -Well I've been around but I ain't never seen -A guy who looks like a Muppet but he's wrinkled and green - Oh my Yoda, Yo-Yo-Yo-Yo Yoda -Well I'm not dumb but I can't understand -How he can raise me in the air just by raising his hand - Oh my Yoda, Yo-Yo-Yo-Yo Yoda, Yo-Yo-Yo-Yo Yoda - -- The STAR WARS Song, to "Lola", by the Kinks -% I met my latest girl friend in a department store. She was looking at clothes, and I was putting Slinkys on the escalators. -- Steven Wright @@ -24531,10 +24395,6 @@ are worth considering, to wit: "When paying tolls, remember that it is necessary to release the quarter a full 3 seconds before passing the basket if you are traveling more than 60 MPH." - -[110.13]: - "When traveling on a one-way street, stay to the right, so as not - to interfere with oncoming traffic." % I suppose some of the variation between Boston drivers and the rest of the country is due to the progressive Massachusetts Driver Education Manual which @@ -24628,12 +24488,6 @@ I think that I shall never see A billboard lovely as a tree. Indeed, unless the billboards fall I'll never see a tree at all. - -- Nash -% -I think that I shall never see -A billboard lovely as a tree. -Perhaps, unless the billboards fall -I'll never see a tree at all. -- Ogden Nash % I think that I shall never see @@ -25899,21 +25753,6 @@ this is the case, then programmers stand software engineers dig each other's graves. -- Unknown % -If I have seen farther than others, it is because I was standing on the -shoulders of giants. - -- Isaac Newton - -In the sciences, we are now uniquely privileged to sit side by side -with the giants on whose shoulders we stand. - -- Gerald Holton - -If I have not seen as far as others, it is because giants were standing -on my shoulders. - -- Hal Abelson - -In computer science, we stand on each other's feet. - -- Brian K. Reid -% If I have to lay an egg for my country, I'll do it. -- Bob Hope % @@ -37641,7 +37480,7 @@ Pardo's First Postulate: fattening. Arnold's Addendum: - Everything else causes cancer in rats. + Anything not fitting into these categories causes cancer in rats. % Parents often talk about the younger generation as if they didn't have much of anything to do with it. @@ -39438,10 +39277,6 @@ A: A dope ring. Q: Why do blondes put their hair in ponytails? A: To cover up the valve stem. - -Q: Why did the blonde get so excited after she finished her jigsaw - puzzle in only 6 months? -A: Because on the box it said "From 2-4 years". % Q: What do you call a blind pre-historic animal? A: Diyathinkhesaurus. @@ -41474,25 +41309,6 @@ Spock: Affirmative. Kirk: Mr. Sulu, go to pass two. Sulu: Aye aye, sir, going to pass two. % -Scratch the disks, dump the core, Shut it down, pull the plug -Roll the tapes across the floor, Give the core an extra tug -And the system is going to crash. And the system is going to crash. -Teletypes smashed to bits. Mem'ry cards, one and all, -Give the scopes some nasty hits Toss out halfway down the hall -And the system is going to crash. And the system is going to crash. -And we've also found Just flip one switch -When you turn the power down, And the lights will cease to twitch -You turn the disk readers into trash. And the tape drives will crumble -Oh, it's so much fun, in a flash. -Now the CPU won't run When the CPU -And the system is going to crash. Can print nothing out but "foo," - The system is going to crash. - -- To The Caissons Go Rolling Along -% -Scratch the disks! -Drop the core! -Roll the tapes across the floor! -% Screw up your courage! You've screwed up everything else. % Scribline, n.: @@ -46676,7 +46492,8 @@ often turn to a related (but infinitely % THE LESSER-KNOWN PROGRAMMING LANGUAGES #14 -- VALGOL - VALGOL is enjoying a dramatic surge of popularity across the + From its modest beginnings in Southern California's San Fernando +Valley VALGOL is enjoying a dramatic surge of popularity across the industry. VALGOL commands include REALLY, LIKE, WELL, and Y*KNOW. Variables are assigned with the =LIKE and =TOTALLY operators. Other operators include the "California booleans", AX and NOWAY. Loops are @@ -48383,9 +48200,6 @@ and peculiar sort of voluntary thinking. The solution of this problem is trivial and is left as an exercise for the reader. % -The solution to a problem changes the nature of the problem. - -- Peer -% The somewhat old and crusty vicar was taking a well-earned retirement from his rather old and crusty parish. As is usual in these cases, a locum was sent to cover the transition period. This particular man was young and @@ -52054,7 +51868,7 @@ yourself and that which may have an inte as much as it is possible for you to receive of this thing, and which may in some way be influenced by this ceremony. Amen. - -- Roger Zelazny, "Creatures of Light and Darkness" + -- Roger Zelazny, "Creatures of Light and Darkness", 1969 % To understand a program you must become both the machine and the program. % @@ -56803,22 +56617,6 @@ I'd LOVE to, but... -- I'm teaching my ferret to yodel. -- My crayons all melted together. % -Why I Can't Go Out With You: - -I'd LOVE to, but ... - -- I have to floss my cat. - -- I've dedicated my life to linguini. - -- I need to spend more time with my blender. - -- it wouldn't be fair to the other Beautiful People. - -- it's my night to pet the dog/ferret/goldfish. - -- I'm going downtown to try on some gloves. - -- I have to check the freshness dates on my dairy products. - -- I'm going down to the bakery to watch the buns rise. - -- I have an appointment with a cuticle specialist. - -- I have some really hard words to look up. - -- I've got a Friends of the Lowly Rutabaga meeting. - -- I promised to help a friend fold road maps. -% Why is it called a funny bone when it hurts so much? % Why is it taking so long for her to bring out all the good in you? @@ -57873,9 +57671,6 @@ a private eye. Yeah, there are more important things in life than money, but they won't go out with you if you don't have any. % -YEAR: - A period of three hundred and sixty-five disappointments. -% Year Name James Bond Book ---- -------------------------------- -------------- ---- 50's James Bond TV Series Barry Nelson From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:17:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00291106568F; Tue, 5 Jan 2010 20:17:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A3F8FC25; Tue, 5 Jan 2010 20:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KHDRt001569; Tue, 5 Jan 2010 20:17:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KHDmw001567; Tue, 5 Jan 2010 20:17:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001052017.o05KHDmw001567@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Jan 2010 20:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201602 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:17:14 -0000 Author: kib Date: Tue Jan 5 20:17:13 2010 New Revision: 201602 URL: http://svn.freebsd.org/changeset/base/201602 Log: Move scandir(3) and alphasort(3) into XSI namespace. Noted and reviewed by: bde MFC after: 2 weeks Modified: head/include/dirent.h Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Tue Jan 5 19:40:32 2010 (r201601) +++ head/include/dirent.h Tue Jan 5 20:17:13 2010 (r201602) @@ -93,9 +93,11 @@ typedef void * DIR; #ifndef _KERNEL __BEGIN_DECLS +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 +int alphasort(const struct dirent **, const struct dirent **); +#endif #if __BSD_VISIBLE DIR *__opendir2(const char *, int); -int alphasort(const struct dirent **, const struct dirent **); int getdents(int, char *, int); int getdirentries(int, char *, int, long *); #endif @@ -107,7 +109,7 @@ struct dirent * int readdir_r(DIR *, struct dirent *, struct dirent **); #endif void rewinddir(DIR *); -#if __BSD_VISIBLE +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE >= 700 int scandir(const char *, struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **, const struct dirent **)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:18:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE4FE106568B; Tue, 5 Jan 2010 20:18:41 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8188FC0A; Tue, 5 Jan 2010 20:18:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KIf7G001902; Tue, 5 Jan 2010 20:18:41 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KIfIa001900; Tue, 5 Jan 2010 20:18:41 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001052018.o05KIfIa001900@svn.freebsd.org> From: Christian Brueffer Date: Tue, 5 Jan 2010 20:18:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201603 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:18:41 -0000 Author: brueffer Date: Tue Jan 5 20:18:41 2010 New Revision: 201603 URL: http://svn.freebsd.org/changeset/base/201603 Log: Fix a double free(). PR: 142339 Submitted by: Henning Petersen MFC after: 2 weeks Modified: head/lib/libc/rpc/getnetpath.c Modified: head/lib/libc/rpc/getnetpath.c ============================================================================== --- head/lib/libc/rpc/getnetpath.c Tue Jan 5 20:17:13 2010 (r201602) +++ head/lib/libc/rpc/getnetpath.c Tue Jan 5 20:18:41 2010 (r201603) @@ -101,7 +101,7 @@ setnetpath() if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - goto failed; + return (NULL); } np_sessionp->valid = NP_VALID; np_sessionp->ncp_list = NULL; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:20:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 377D11065676; Tue, 5 Jan 2010 20:20:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE898FC17; Tue, 5 Jan 2010 20:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KKWhL002340; Tue, 5 Jan 2010 20:20:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KKVEp002337; Tue, 5 Jan 2010 20:20:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001052020.o05KKVEp002337@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 5 Jan 2010 20:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:20:32 -0000 Author: kib Date: Tue Jan 5 20:20:31 2010 New Revision: 201604 URL: http://svn.freebsd.org/changeset/base/201604 Log: Do not rely on behaviour undefined by ANSI C, use thunks to adapt alphasort-like interface to the comparision function required by qsort() and qsort_r(). For opendir() thunk and alphasort(), comment on why we deviated from POSIX by using strcmp() instead of strcoll(). Requested and reviewed by: bde MFC after: 2 weeks Modified: head/lib/libc/gen/opendir.c head/lib/libc/gen/scandir.c Modified: head/lib/libc/gen/opendir.c ============================================================================== --- head/lib/libc/gen/opendir.c Tue Jan 5 20:18:41 2010 (r201603) +++ head/lib/libc/gen/opendir.c Tue Jan 5 20:20:31 2010 (r201604) @@ -93,6 +93,18 @@ __opendir2(const char *name, int flags) } /* + * POSIX 2008 and XSI 7 require alphasort() to call strcoll() for + * directory entries ordering. Use local copy that uses strcmp(). + */ +static int +opendir_alphasort(const void *p1, const void *p2) +{ + + return (strcmp((*(const struct dirent **)p1)->d_name, + (*(const struct dirent **)p2)->d_name)); +} + +/* * Common routine for opendir(3), __opendir2(3) and fdopendir(3). */ static DIR * @@ -240,8 +252,8 @@ __opendir_common(int fd, const char *nam /* * This sort must be stable. */ - mergesort(dpv, n, sizeof(*dpv), (int (*)(const - void *, const void *))alphasort); + mergesort(dpv, n, sizeof(*dpv), + opendir_alphasort); dpv[n] = NULL; xp = NULL; Modified: head/lib/libc/gen/scandir.c ============================================================================== --- head/lib/libc/gen/scandir.c Tue Jan 5 20:18:41 2010 (r201603) +++ head/lib/libc/gen/scandir.c Tue Jan 5 20:20:31 2010 (r201604) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" +static int alphasort_thunk(void *thunk, const void *p1, const void *p2); + /* * The DIRSIZ macro is the minimum record length which will hold the directory * entry. This requires the amount of space in struct dirent without the @@ -109,8 +111,8 @@ scandir(const char *dirname, struct dire } closedir(dirp); if (nitems && dcomp != NULL) - qsort(names, nitems, sizeof(struct dirent *), - (int (*)(const void *, const void *))dcomp); + qsort_r(names, nitems, sizeof(struct dirent *), + &dcomp, alphasort_thunk); *namelist = names; return (nitems); @@ -124,6 +126,12 @@ fail: /* * Alphabetic order comparison routine for those who want it. + * + * XXXKIB POSIX 2008 requires the alphasort() to use strcoll(). Keep + * strcmp() for now, since environment locale settings could have no + * relevance for the byte sequence of the file name. Moreover, it + * might be even invalid sequence in current locale, and then + * behaviour of alphasort would be undefined. */ int alphasort(const struct dirent **d1, const struct dirent **d2) @@ -131,3 +139,12 @@ alphasort(const struct dirent **d1, cons return (strcmp((*d1)->d_name, (*d2)->d_name)); } + +static int +alphasort_thunk(void *thunk, const void *p1, const void *p2) +{ + int (*dc)(const struct dirent **, const struct dirent **); + + dc = *(int (**)(const struct dirent **, const struct dirent **))thunk; + return (dc((const struct dirent **)p1, (const struct dirent **)p2)); +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:29:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E4A91065672; Tue, 5 Jan 2010 20:29:31 +0000 (UTC) (envelope-from iwasaki@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D63A8FC18; Tue, 5 Jan 2010 20:29:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KTVqv004352; Tue, 5 Jan 2010 20:29:31 GMT (envelope-from iwasaki@svn.freebsd.org) Received: (from iwasaki@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KTVVA004350; Tue, 5 Jan 2010 20:29:31 GMT (envelope-from iwasaki@svn.freebsd.org) Message-Id: <201001052029.o05KTVVA004350@svn.freebsd.org> From: Mitsuru IWASAKI Date: Tue, 5 Jan 2010 20:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201605 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:29:31 -0000 Author: iwasaki Date: Tue Jan 5 20:29:30 2010 New Revision: 201605 URL: http://svn.freebsd.org/changeset/base/201605 Log: Update acpi_ibm syctl nodes on resume. This should fix some Thinkpad specific problems such as connecting to a headphone jack is not functional on X41. Reviewed by: takawata MFC after: 1 week Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Tue Jan 5 20:20:31 2010 (r201604) +++ head/sys/dev/acpi_support/acpi_ibm.c Tue Jan 5 20:29:30 2010 (r201605) @@ -255,6 +255,7 @@ ACPI_SERIAL_DECL(ibm, "ACPI IBM extras") static int acpi_ibm_probe(device_t dev); static int acpi_ibm_attach(device_t dev); static int acpi_ibm_detach(device_t dev); +static int acpi_ibm_resume(device_t dev); static void ibm_led(void *softc, int onoff); static void ibm_led_task(struct acpi_ibm_softc *sc, int pending __unused); @@ -273,6 +274,7 @@ static device_method_t acpi_ibm_methods[ DEVMETHOD(device_probe, acpi_ibm_probe), DEVMETHOD(device_attach, acpi_ibm_attach), DEVMETHOD(device_detach, acpi_ibm_detach), + DEVMETHOD(device_resume, acpi_ibm_resume), {0, 0} }; @@ -435,6 +437,34 @@ acpi_ibm_detach(device_t dev) } static int +acpi_ibm_resume(device_t dev) +{ + struct acpi_ibm_softc *sc = device_get_softc(dev); + + ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); + + ACPI_SERIAL_BEGIN(ibm); + for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) { + int val; + + if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) { + continue; + } + + val = acpi_ibm_sysctl_get(sc, i); + + if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) { + continue; + } + + acpi_ibm_sysctl_set(sc, i, val); + } + ACPI_SERIAL_END(ibm); + + return (0); +} + +static int acpi_ibm_eventmask_set(struct acpi_ibm_softc *sc, int val) { ACPI_OBJECT arg[2]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:32:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E35381065696; Tue, 5 Jan 2010 20:32:08 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D278A8FC0A; Tue, 5 Jan 2010 20:32:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KW8GB004987; Tue, 5 Jan 2010 20:32:08 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KW8fU004984; Tue, 5 Jan 2010 20:32:08 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001052032.o05KW8fU004984@svn.freebsd.org> From: David Malone Date: Tue, 5 Jan 2010 20:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201606 - head/usr.bin/ctags X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:32:09 -0000 Author: dwmalone Date: Tue Jan 5 20:32:08 2010 New Revision: 201606 URL: http://svn.freebsd.org/changeset/base/201606 Log: Change a char that is used as an index into an array into an unisgned char. Add a missing new style function definition. Modified: head/usr.bin/ctags/ctags.c head/usr.bin/ctags/fortran.c Modified: head/usr.bin/ctags/ctags.c ============================================================================== --- head/usr.bin/ctags/ctags.c Tue Jan 5 20:29:30 2010 (r201605) +++ head/usr.bin/ctags/ctags.c Tue Jan 5 20:32:08 2010 (r201606) @@ -244,7 +244,7 @@ void init(void) { int i; - const char *sp; + const unsigned char *sp; for (i = 0; i < 256; i++) { _wht[i] = _etk[i] = _itk[i] = _btk[i] = NO; Modified: head/usr.bin/ctags/fortran.c ============================================================================== --- head/usr.bin/ctags/fortran.c Tue Jan 5 20:29:30 2010 (r201605) +++ head/usr.bin/ctags/fortran.c Tue Jan 5 20:32:08 2010 (r201606) @@ -52,7 +52,7 @@ static void takeprec(void); char *lbp; /* line buffer pointer */ int -PF_funcs() +PF_funcs(void) { bool pfcnt; /* pascal/fortran functions found */ char *cp; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:38:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B09B106566B; Tue, 5 Jan 2010 20:38:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89CB98FC17; Tue, 5 Jan 2010 20:38:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Kcxm2006520; Tue, 5 Jan 2010 20:38:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KcxjT006518; Tue, 5 Jan 2010 20:38:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001052038.o05KcxjT006518@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jan 2010 20:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201607 - stable/6/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:38:59 -0000 Author: bz Date: Tue Jan 5 20:38:59 2010 New Revision: 201607 URL: http://svn.freebsd.org/changeset/base/201607 Log: MFC r186834: Document the special loopback address behaviour of jails. PR: kern/103464 Submitted by: brueffer (correct markup) Reviewed by: brueffer Modified: stable/6/lib/libc/sys/jail.2 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/sys/jail.2 ============================================================================== --- stable/6/lib/libc/sys/jail.2 Tue Jan 5 20:32:08 2010 (r201606) +++ stable/6/lib/libc/sys/jail.2 Tue Jan 5 20:38:59 2010 (r201607) @@ -8,7 +8,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2003 +.Dd January 6, 2009 .Dt JAIL 2 .Os .Sh NAME @@ -97,6 +97,9 @@ or, if present, the per-jail .Pp All IP activity will be forced to happen to/from the IP number specified, which should be an alias on one of the network interfaces. +All connections to/from the loopback address +.Pq Li 127.0.0.1 +will be changed to be to/from the address of the jail. .Pp It is possible to identify a process as jailed by examining .Dq Li /proc//status : From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:40:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A82810656A8; Tue, 5 Jan 2010 20:40:41 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDD728FC26; Tue, 5 Jan 2010 20:40:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Keehb006929; Tue, 5 Jan 2010 20:40:40 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KeeaP006927; Tue, 5 Jan 2010 20:40:40 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001052040.o05KeeaP006927@svn.freebsd.org> From: David Malone Date: Tue, 5 Jan 2010 20:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201608 - head/usr.sbin/cdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:40:41 -0000 Author: dwmalone Date: Tue Jan 5 20:40:40 2010 New Revision: 201608 URL: http://svn.freebsd.org/changeset/base/201608 Log: New style function definitions. Fix constness problem - don't know that pstatus won't change a string with no whitespace. Modified: head/usr.sbin/cdcontrol/cdcontrol.c Modified: head/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.c Tue Jan 5 20:38:59 2010 (r201607) +++ head/usr.sbin/cdcontrol/cdcontrol.c Tue Jan 5 20:40:40 2010 (r201608) @@ -152,7 +152,7 @@ __const char *strstatus(int); static u_int dbprog_discid(void); __const char *cdcontrol_prompt(void); -void help () +void help (void) { struct cmdtab *c; const char *s; @@ -178,7 +178,7 @@ void help () printf ("\tThe plain target address is taken as a synonym for play.\n"); } -void usage () +void usage (void) { fprintf (stderr, "usage: cdcontrol [-sv] [-f device] [command ...]\n"); exit (1); @@ -413,8 +413,11 @@ int run (int cmd, char *arg) if (fd < 0 && !open_cd ()) return (0); - if (! strlen (arg)) - return pstatus ("volume"); + if (! strlen (arg)) { + char volume[] = "volume"; + + return pstatus (volume); + } if (! strncasecmp (arg, "left", strlen(arg))) return ioctl (fd, CDIOCSETLEFT); @@ -899,7 +902,7 @@ dbprog_sum(int n) * The integer disc ID. */ static u_int -dbprog_discid() +dbprog_discid(void) { struct ioc_toc_header h; int rc; @@ -930,7 +933,7 @@ dbprog_discid() return((n % 0xff) << 24 | t << 8 | ntr); } -int cdid () +int cdid (void) { u_int id; @@ -1130,7 +1133,7 @@ int status (int *trk, int *min, int *sec } const char * -cdcontrol_prompt() +cdcontrol_prompt(void) { return ("cdcontrol> "); } @@ -1249,7 +1252,7 @@ char *parse (char *buf, int *cmd) return p; } -int open_cd () +int open_cd (void) { char devbuf[MAXPATHLEN]; const char *dev; From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:42:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DAED1065692; Tue, 5 Jan 2010 20:42:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CA678FC15; Tue, 5 Jan 2010 20:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05KgP2E007357; Tue, 5 Jan 2010 20:42:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05KgPQ6007353; Tue, 5 Jan 2010 20:42:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001052042.o05KgPQ6007353@svn.freebsd.org> From: John Baldwin Date: Tue, 5 Jan 2010 20:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201609 - in head/sys/dev: cardbus pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:42:25 -0000 Author: jhb Date: Tue Jan 5 20:42:25 2010 New Revision: 201609 URL: http://svn.freebsd.org/changeset/base/201609 Log: Move the PCI-specific logic of removing a cardbus device into a pci_delete_child() function called by the cardbus driver. The new function uses resource_list_unreserve() to release the BARs decoded by the device being removed. Reviewed by: imp Tested by: brooks Modified: head/sys/dev/cardbus/cardbus.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Tue Jan 5 20:40:40 2010 (r201608) +++ head/sys/dev/cardbus/cardbus.c Tue Jan 5 20:42:25 2010 (r201609) @@ -80,8 +80,6 @@ static void cardbus_driver_added(device_ static int cardbus_probe(device_t cbdev); static int cardbus_read_ivar(device_t cbdev, device_t child, int which, uintptr_t *result); -static void cardbus_release_all_resources(device_t cbdev, - struct cardbus_devinfo *dinfo); /************************************************************************/ /* Probe/Attach */ @@ -226,16 +224,11 @@ cardbus_detach_card(device_t cbdev) for (tmp = 0; tmp < numdevs; tmp++) { struct cardbus_devinfo *dinfo = device_get_ivars(devlist[tmp]); - int status = device_get_state(devlist[tmp]); if (dinfo->pci.cfg.dev != devlist[tmp]) device_printf(cbdev, "devinfo dev mismatch\n"); - if (status == DS_ATTACHED || status == DS_BUSY) - device_detach(devlist[tmp]); - cardbus_release_all_resources(cbdev, dinfo); cardbus_device_destroy(dinfo); - device_delete_child(cbdev, devlist[tmp]); - pci_freecfg((struct pci_devinfo *)dinfo); + pci_delete_child(cbdev, devlist[tmp]); } POWER_DISABLE_SOCKET(device_get_parent(cbdev), cbdev); free(devlist, M_TEMP); @@ -283,28 +276,6 @@ cardbus_driver_added(device_t cbdev, dri free(devlist, M_TEMP); } -static void -cardbus_release_all_resources(device_t cbdev, struct cardbus_devinfo *dinfo) -{ - struct resource_list_entry *rle; - device_t dev; - - /* Turn off access to resources we're about to free */ - dev = dinfo->pci.cfg.dev; - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, 2) & - ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN), 2); - /* Free all allocated resources */ - STAILQ_FOREACH(rle, &dinfo->pci.resources, link) { - if (rle->res) { - BUS_RELEASE_RESOURCE(device_get_parent(cbdev), - cbdev, rle->type, rle->rid, rle->res); - rle->res = NULL; - } - } - resource_list_free(&dinfo->pci.resources); -} - /************************************************************************/ /* Other Bus Methods */ /************************************************************************/ Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Jan 5 20:40:40 2010 (r201608) +++ head/sys/dev/pci/pci.c Tue Jan 5 20:42:25 2010 (r201609) @@ -3797,6 +3797,46 @@ pci_deactivate_resource(device_t dev, de } void +pci_delete_child(device_t dev, device_t child) +{ + struct resource_list_entry *rle; + struct resource_list *rl; + struct pci_devinfo *dinfo; + + dinfo = device_get_ivars(child); + rl = &dinfo->resources; + + if (device_is_attached(child)) + device_detach(child); + + /* Turn off access to resources we're about to free */ + pci_write_config(child, PCIR_COMMAND, pci_read_config(child, + PCIR_COMMAND, 2) & ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN), 2); + + /* Free all allocated resources */ + STAILQ_FOREACH(rle, rl, link) { + if (rle->res) { + if (rman_get_flags(rle->res) & RF_ACTIVE || + resource_list_busy(rl, rle->type, rle->rid)) { + pci_printf(&dinfo->cfg, + "Resource still owned, oops. " + "(type=%d, rid=%d, addr=%lx)\n", + rle->type, rle->rid, + rman_get_start(rle->res)); + bus_release_resource(child, rle->type, rle->rid, + rle->res); + } + resource_list_unreserve(rl, dev, child, rle->type, + rle->rid); + } + } + resource_list_free(rl); + + device_delete_child(dev, child); + pci_freecfg(dinfo); +} + +void pci_delete_resource(device_t dev, device_t child, int type, int rid) { struct pci_devinfo *dinfo; Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Tue Jan 5 20:40:40 2010 (r201608) +++ head/sys/dev/pci/pci_private.h Tue Jan 5 20:42:25 2010 (r201609) @@ -43,6 +43,7 @@ void pci_add_children(device_t dev, int void pci_add_child(device_t bus, struct pci_devinfo *dinfo); void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask); +void pci_delete_child(device_t dev, device_t child); void pci_driver_added(device_t dev, driver_t *driver); int pci_print_child(device_t dev, device_t child); void pci_probe_nomatch(device_t dev, device_t child); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 20:53:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B7631065692; Tue, 5 Jan 2010 20:53:56 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 111548FC17; Tue, 5 Jan 2010 20:53:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Krt1Y010091; Tue, 5 Jan 2010 20:53:55 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05Krtmh010089; Tue, 5 Jan 2010 20:53:55 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001052053.o05Krtmh010089@svn.freebsd.org> From: David Malone Date: Tue, 5 Jan 2010 20:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201610 - head/usr.bin/xlint/xlint X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 20:53:56 -0000 Author: dwmalone Date: Tue Jan 5 20:53:55 2010 New Revision: 201610 URL: http://svn.freebsd.org/changeset/base/201610 Log: 1) Make usage() as dead2 - it helps the compiler know that some vars are not used uninitialised. 2) Fix some constness problems. 3) Avoid a signedness problem by casting to size_t. If bn != stuff, than stuff-1-bn should be > 0. Modified: head/usr.bin/xlint/xlint/xlint.c Modified: head/usr.bin/xlint/xlint/xlint.c ============================================================================== --- head/usr.bin/xlint/xlint/xlint.c Tue Jan 5 20:42:25 2010 (r201609) +++ head/usr.bin/xlint/xlint/xlint.c Tue Jan 5 20:53:55 2010 (r201610) @@ -135,7 +135,7 @@ static char *concat3(const char *, const static void terminate(int) __attribute__((__noreturn__)); static const char *lbasename(const char *, int); static void appdef(char ***, const char *); -static void usage(void); +static void usage(void) __dead2; static void fname(const char *); static void runchild(const char *, char *const *, const char *, int); static void findlibs(char *const *); @@ -304,11 +304,12 @@ int main(int argc, char *argv[]) { int c; - char flgbuf[3], *tmp, *s; + char flgbuf[3], *s; + const char *tmp; size_t len; if ((tmp = getenv("TMPDIR")) == NULL || (len = strlen(tmp)) == 0) { - tmpdir = xstrdup(_PATH_TMP); + tmpdir = _PATH_TMP; } else { s = xmalloc(len + 2); (void)sprintf(s, "%s%s", tmp, tmp[len - 1] == '/' ? "" : "/"); @@ -555,9 +556,9 @@ main(int argc, char *argv[]) terminate(0); if (!oflag) { - if ((s = getenv("LIBDIR")) == NULL || strlen(s) == 0) - s = PATH_LINTLIB; - appcstrg(&libsrchpath, s); + if ((tmp = getenv("LIBDIR")) == NULL || strlen(tmp) == 0) + tmp = PATH_LINTLIB; + appcstrg(&libsrchpath, tmp); findlibs(libs); findlibs(deflibs); } @@ -620,7 +621,7 @@ fname(const char *name) return; } ofn = xmalloc(strlen(bn) + (bn == suff ? 4 : 2)); - len = bn == suff ? strlen(bn) : (suff - 1) - bn; + len = bn == suff ? strlen(bn) : (size_t)((suff - 1) - bn); (void)sprintf(ofn, "%.*s", (int)len, bn); (void)strcat(ofn, ".ln"); } else { From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 21:00:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54D4A10656AA; Tue, 5 Jan 2010 21:00:24 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 446678FC14; Tue, 5 Jan 2010 21:00:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05L0OXj011654; Tue, 5 Jan 2010 21:00:24 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05L0OQx011652; Tue, 5 Jan 2010 21:00:24 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001052100.o05L0OQx011652@svn.freebsd.org> From: David Malone Date: Tue, 5 Jan 2010 21:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201611 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 21:00:24 -0000 Author: dwmalone Date: Tue Jan 5 21:00:23 2010 New Revision: 201611 URL: http://svn.freebsd.org/changeset/base/201611 Log: Shuffle parens to avoid type-punning warning. Modified: head/usr.bin/w/w.c Modified: head/usr.bin/w/w.c ============================================================================== --- head/usr.bin/w/w.c Tue Jan 5 20:53:55 2010 (r201610) +++ head/usr.bin/w/w.c Tue Jan 5 21:00:23 2010 (r201611) @@ -118,7 +118,7 @@ struct entry { struct kinfo_proc *dkp; /* debug option proc list */ } *ep, *ehead = NULL, **nextp = &ehead; -#define debugproc(p) *((struct kinfo_proc **)&(p)->ki_udata) +#define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata) #define W_DISPUSERSIZE 10 #define W_DISPLINESIZE 8 From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 21:10:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A036106568B; Tue, 5 Jan 2010 21:10:00 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F2078FC12; Tue, 5 Jan 2010 21:10:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05LA0pT013817; Tue, 5 Jan 2010 21:10:00 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05L9xdr013816; Tue, 5 Jan 2010 21:09:59 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001052109.o05L9xdr013816@svn.freebsd.org> From: David Malone Date: Tue, 5 Jan 2010 21:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201612 - head/usr.bin/tcopy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 21:10:00 -0000 Author: dwmalone Date: Tue Jan 5 21:09:59 2010 New Revision: 201612 URL: http://svn.freebsd.org/changeset/base/201612 Log: 1) Mark usage as dead2. 2) Deregister. 3) New style function definitions. Some WARNS still remain here - some printf format warning on some arches and the compiler can't see that a variable should always be initialised. Modified: head/usr.bin/tcopy/tcopy.c Modified: head/usr.bin/tcopy/tcopy.c ============================================================================== --- head/usr.bin/tcopy/tcopy.c Tue Jan 5 21:00:23 2010 (r201611) +++ head/usr.bin/tcopy/tcopy.c Tue Jan 5 21:09:59 2010 (r201612) @@ -70,17 +70,15 @@ FILE *msg; void *getspace(int); void intr(int); -static void usage(void); +static void usage(void) __dead2; void verify(int, int, char *); void writeop(int, int); void rewind_tape(int); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { - register int lastnread, nread, nw, inp, outp; + int lastnread, nread, nw, inp, outp; enum {READ, VERIFY, COPY, COPYVERIFY} op = READ; sig_t oldsig; int ch, needeof; @@ -227,12 +225,10 @@ r1: guesslen = 0; } void -verify(inp, outp, outb) - register int inp, outp; - register char *outb; +verify(int inp, int outp, char *outb) { - register int eot, inmaxblk, inn, outmaxblk, outn; - register char *inb; + int eot, inmaxblk, inn, outmaxblk, outn; + char *inb; inb = getspace(maxblk); inmaxblk = outmaxblk = maxblk; @@ -281,8 +277,7 @@ r2: if (inn != outn) { } void -intr(signo) - int signo __unused; +intr(int signo __unused) { if (record) { if (record - lastrec > 1) @@ -296,8 +291,7 @@ intr(signo) } void * -getspace(blk) - int blk; +getspace(int blk) { void *bp; @@ -307,8 +301,7 @@ getspace(blk) } void -writeop(fd, type) - int fd, type; +writeop(int fd, int type) { struct mtop op; @@ -319,7 +312,7 @@ writeop(fd, type) } static void -usage() +usage(void) { fprintf(stderr, "usage: tcopy [-cvx] [-s maxblk] [src [dest]]\n"); exit(1); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 21:14:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E184106568B; Tue, 5 Jan 2010 21:14:49 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F14178FC08; Tue, 5 Jan 2010 21:14:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05LEmHJ014919; Tue, 5 Jan 2010 21:14:48 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05LEmmR014916; Tue, 5 Jan 2010 21:14:48 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201001052114.o05LEmmR014916@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 5 Jan 2010 21:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201613 - head/games/pom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 21:14:49 -0000 Author: edwin Date: Tue Jan 5 21:14:48 2010 New Revision: 201613 URL: http://svn.freebsd.org/changeset/base/201613 Log: Be able to specify a certain date and/or time for which to calculate the phase of the moon. While not worlds best improvements, it will help calendar(1) later on. Modified: head/games/pom/pom.6 head/games/pom/pom.c Modified: head/games/pom/pom.6 ============================================================================== --- head/games/pom/pom.6 Tue Jan 5 21:09:59 2010 (r201612) +++ head/games/pom/pom.6 Tue Jan 5 21:14:48 2010 (r201613) @@ -32,15 +32,34 @@ .\" @(#)pom.6 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.TH POM 6 "May 31, 1993" +.Dd May 31, 1993 +.Dt POM 6 .UC 7 -.SH NAME -pom \- display the phase of the moon -.SH SYNOPSIS -.B pom -.SH DESCRIPTION +.Sh NAME +.Nm pom +.Nd display the phase of the moon +.Sh SYNOPSIS +.Nm +.Op Fl d Ar yyyy.mm.dd +.Op Fl t Ar hh:mm:ss +.Sh DESCRIPTION The -.I pom +.Nm utility displays the current phase of the moon. Useful for selecting software completion target dates and predicting managerial behavior. +.Pp +Use the arguments +.Fl d +and +.Fl o +to specify a specific date and time for which the phase of the moon +has to be calculated. +If +.Fl d +but not +.Fl t +has been specified, it will calculate the phase of the moon on that +day at midnight. +.Sh SEE ALSO +`Practical Astronomy with Your Calculator' by Duffett-Smith. Modified: head/games/pom/pom.c ============================================================================== --- head/games/pom/pom.c Tue Jan 5 21:09:59 2010 (r201612) +++ head/games/pom/pom.c Tue Jan 5 21:14:48 2010 (r201613) @@ -57,9 +57,13 @@ __FBSDID("$FreeBSD$"); * */ -#include #include +#include #include +#include +#include +#include +#include #ifndef PI #define PI 3.14159265358979323846 @@ -76,20 +80,62 @@ __FBSDID("$FreeBSD$"); static void adj360(double *); static double dtor(double); static double potm(double); +static void usage(char *progname); int -main(void) +main(int argc, char **argv) { time_t tt; - struct tm *GMT; + struct tm GMT, tmd; double days, today, tomorrow; int cnt; + char *odate = NULL, *otime = NULL, ch; + + while ((ch = getopt(argc, argv, "d:t:")) != -1) + switch (ch) { + case 'd': + odate = optarg; + break; + case 't': + otime = optarg; + break; + default: + usage(argv[0]); + } + + argc -= optind; + argv += optind; + + if (argc) + usage(argv[0]); - (void) time(&tt); - GMT = gmtime(&tt); - days = (GMT->tm_yday + 1) + ((GMT->tm_hour + - (GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0); - for (cnt = EPOCH; cnt < GMT->tm_year; ++cnt) + /* Adjust based on users preferences */ + time(&tt); + if (otime != NULL || odate != NULL) { + /* Save today in case -d isn't specified */ + localtime_r(&tt, &tmd); + + if (odate != NULL) { + tmd.tm_year = strtol(odate, NULL, 10) - 1900; + tmd.tm_mon = strtol(odate + 5, NULL, 10) - 1; + tmd.tm_mday = strtol(odate + 8, NULL, 10); + /* Use midnight as the middle of the night */ + tmd.tm_hour = 0; + tmd.tm_min = 0; + tmd.tm_sec = 0; + } + if (otime != NULL) { + tmd.tm_hour = strtol(otime, NULL, 10); + tmd.tm_min = strtol(otime + 3, NULL, 10); + tmd.tm_sec = strtol(otime + 6, NULL, 10); + } + tt = mktime(&tmd); + } + + gmtime_r(&tt, &GMT); + days = (GMT.tm_yday + 1) + ((GMT.tm_hour + + (GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0); + for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt) days += isleap(1900 + cnt) ? 366 : 365; today = potm(days) + .5; (void)printf("The Moon is "); @@ -160,6 +206,7 @@ potm(double days) static double dtor(double deg) { + return(deg * PI / 180); } @@ -170,6 +217,7 @@ dtor(double deg) static void adj360(double *deg) { + for (;;) if (*deg < 0) *deg += 360; @@ -178,3 +226,11 @@ adj360(double *deg) else break; } + +static void +usage(char *progname) +{ + + fprintf(stderr, "Usage: %s [-d yyyy.mm.dd] [-t hh:mm:ss]\n", progname); + exit(EX_USAGE); +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 22:14:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EFE3106568B; Tue, 5 Jan 2010 22:14:56 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79D168FC13; Tue, 5 Jan 2010 22:14:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05MEuJC028140; Tue, 5 Jan 2010 22:14:56 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05MEuAI028131; Tue, 5 Jan 2010 22:14:56 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001052214.o05MEuAI028131@svn.freebsd.org> From: Qing Li Date: Tue, 5 Jan 2010 22:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201614 - in stable/8: . contrib/top lib/libusb share/man/man4 sys/net sys/netinet sys/netinet6 tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/too... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 22:14:56 -0000 Author: qingli Date: Tue Jan 5 22:14:55 2010 New Revision: 201614 URL: http://svn.freebsd.org/changeset/base/201614 Log: MFC r201282, r201543 r201282 ------- The proxy arp entries could not be added into the system over the IFF_POINTOPOINT link types. The reason was due to the routing entry returned from the kernel covering the remote end is of an interface type that does not support ARP. This patch fixes this problem by providing a hint to the kernel routing code, which indicates the prefix route instead of the PPP host route should be returned to the caller. Since a host route to the local end point is also added into the routing table, and there could be multiple such instantiations due to multiple PPP links can be created with the same local end IP address, this patch also fixes the loopback route installation failure problem observed prior to this patch. The reference count of loopback route to local end would be either incremented or decremented. The first instantiation would create the entry and the last removal would delete the route entry. r201543 ------- The IFA_RTSELF address flag marks a loopback route has been installed for the interface address. This marker is necessary to properly support PPP types of links where multiple links can have the same local end IP address. The IFA_RTSELF flag bit maps to the RTF_HOST value, which was combined into the route flag bits during prefix installation in IPv6. This inclusion causing the prefix route to be unusable. This patch fixes this bug by excluding the IFA_RTSELF flag during route installation. PR: ports/141342, kern/141134 Modified: stable/8/sys/net/if_llatbl.c stable/8/sys/net/if_llatbl.h stable/8/sys/net/if_var.h stable/8/sys/net/route.c stable/8/sys/net/route.h stable/8/sys/net/rtsock.c stable/8/sys/netinet/in.c stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/nd6_rtr.c stable/8/usr.sbin/arp/arp.c Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zdb/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sys/net/if_llatbl.c ============================================================================== --- stable/8/sys/net/if_llatbl.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/if_llatbl.c Tue Jan 5 22:14:55 2010 (r201614) @@ -274,7 +274,9 @@ lla_rt_output(struct rt_msghdr *rtm, str #ifdef INET if (dst->sa_family == AF_INET && ((struct sockaddr_inarp *)dst)->sin_other != 0) { - struct rtentry *rt = rtalloc1(dst, 0, 0); + struct rtentry *rt; + ((struct sockaddr_inarp *)dst)->sin_other = 0; + rt = rtalloc1(dst, 0, 0); if (rt == NULL || !(rt->rt_flags & RTF_HOST)) { log(LOG_INFO, "%s: RTM_ADD publish " "(proxy only) is invalid\n", Modified: stable/8/sys/net/if_llatbl.h ============================================================================== --- stable/8/sys/net/if_llatbl.h Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/if_llatbl.h Tue Jan 5 22:14:55 2010 (r201614) @@ -159,7 +159,7 @@ struct lltable { const struct sockaddr *mask); struct llentry * (*llt_lookup)(struct lltable *, u_int flags, const struct sockaddr *l3addr); - int (*llt_rtcheck)(struct ifnet *, + int (*llt_rtcheck)(struct ifnet *, u_int flags, const struct sockaddr *); int (*llt_dump)(struct lltable *, struct sysctl_req *); Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/if_var.h Tue Jan 5 22:14:55 2010 (r201614) @@ -712,6 +712,7 @@ struct ifaddr { struct mtx ifa_mtx; }; #define IFA_ROUTE RTF_UP /* route installed */ +#define IFA_RTSELF RTF_HOST /* loopback route to self installed */ /* for compatibility with other BSDs */ #define ifa_list ifa_link Modified: stable/8/sys/net/route.c ============================================================================== --- stable/8/sys/net/route.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/route.c Tue Jan 5 22:14:55 2010 (r201614) @@ -98,8 +98,6 @@ VNET_DEFINE(struct rtstat, rtstat); #define V_rttrash VNET(rttrash) #define V_rtstat VNET(rtstat) -static void rt_maskedcopy(struct sockaddr *, - struct sockaddr *, struct sockaddr *); /* compare two sockaddr structures */ #define sa_equal(a1, a2) (bcmp((a1), (a2), (a1)->sa_len) == 0) @@ -1315,7 +1313,7 @@ rt_setgate(struct rtentry *rt, struct so return (0); } -static void +void rt_maskedcopy(struct sockaddr *src, struct sockaddr *dst, struct sockaddr *netmask) { register u_char *cp1 = (u_char *)src; Modified: stable/8/sys/net/route.h ============================================================================== --- stable/8/sys/net/route.h Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/route.h Tue Jan 5 22:14:55 2010 (r201614) @@ -384,6 +384,7 @@ void rt_missmsg(int, struct rt_addrinfo void rt_newaddrmsg(int, struct ifaddr *, int, struct rtentry *); void rt_newmaddrmsg(int, struct ifmultiaddr *); int rt_setgate(struct rtentry *, struct sockaddr *, struct sockaddr *); +void rt_maskedcopy(struct sockaddr *, struct sockaddr *, struct sockaddr *); /* * Note the following locking behavior: Modified: stable/8/sys/net/rtsock.c ============================================================================== --- stable/8/sys/net/rtsock.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/net/rtsock.c Tue Jan 5 22:14:55 2010 (r201614) @@ -60,6 +60,7 @@ #include #include +#include #ifdef INET6 #include #endif @@ -622,6 +623,27 @@ route_output(struct mbuf *m, struct sock } } #endif + /* + * If performing proxied L2 entry insertion, and + * the actual PPP host entry is found, perform + * another search to retrieve the prefix route of + * the local end point of the PPP link. + */ + if ((rtm->rtm_flags & RTF_ANNOUNCE) && + (rt->rt_ifp->if_flags & IFF_POINTOPOINT)) { + struct sockaddr laddr; + rt_maskedcopy(rt->rt_ifa->ifa_addr, + &laddr, + rt->rt_ifa->ifa_netmask); + /* + * refactor rt and no lock operation necessary + */ + rt = (struct rtentry *)rnh->rnh_matchaddr(&laddr, rnh); + if (rt == NULL) { + RADIX_NODE_HEAD_RUNLOCK(rnh); + senderr(ESRCH); + } + } RT_LOCK(rt); RT_ADDREF(rt); RADIX_NODE_HEAD_RUNLOCK(rnh); Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/netinet/in.c Tue Jan 5 22:14:55 2010 (r201614) @@ -924,9 +924,25 @@ in_ifinit(struct ifnet *ifp, struct in_i /* * add a loopback route to self */ - if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) - error = ifa_add_loopback_route((struct ifaddr *)ia, + if (V_useloopback && !(ifp->if_flags & IFF_LOOPBACK)) { + struct route ia_ro; + + bzero(&ia_ro, sizeof(ia_ro)); + *((struct sockaddr_in *)(&ia_ro.ro_dst)) = ia->ia_addr; + rtalloc_ign_fib(&ia_ro, 0, 0); + if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && + (ia_ro.ro_rt->rt_ifp == V_loif)) { + RT_LOCK(ia_ro.ro_rt); + RT_ADDREF(ia_ro.ro_rt); + RTFREE_LOCKED(ia_ro.ro_rt); + } else + error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags |= IFA_RTSELF; + if (ia_ro.ro_rt != NULL) + RTFREE(ia_ro.ro_rt); + } return (error); } @@ -1043,7 +1059,7 @@ in_scrubprefix(struct in_ifaddr *target) { struct in_ifaddr *ia; struct in_addr prefix, mask, p; - int error; + int error = 0; struct sockaddr_in prefix0, mask0; /* @@ -1057,9 +1073,28 @@ in_scrubprefix(struct in_ifaddr *target) * deletion is unconditional. */ if ((target->ia_addr.sin_addr.s_addr != INADDR_ANY) && - !(target->ia_ifp->if_flags & IFF_LOOPBACK)) { - error = ifa_del_loopback_route((struct ifaddr *)target, + !(target->ia_ifp->if_flags & IFF_LOOPBACK) && + (target->ia_flags & IFA_RTSELF)) { + struct route ia_ro; + int freeit = 0; + + bzero(&ia_ro, sizeof(ia_ro)); + *((struct sockaddr_in *)(&ia_ro.ro_dst)) = target->ia_addr; + rtalloc_ign_fib(&ia_ro, 0, 0); + if ((ia_ro.ro_rt != NULL) && (ia_ro.ro_rt->rt_ifp != NULL) && + (ia_ro.ro_rt->rt_ifp == V_loif)) { + RT_LOCK(ia_ro.ro_rt); + if (ia_ro.ro_rt->rt_refcnt <= 1) + freeit = 1; + else + RT_REMREF(ia_ro.ro_rt); + RTFREE_LOCKED(ia_ro.ro_rt); + } + if (freeit) + error = ifa_del_loopback_route((struct ifaddr *)target, (struct sockaddr *)&target->ia_addr); + if (error == 0) + target->ia_flags &= ~IFA_RTSELF; /* remove arp cache */ arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } @@ -1317,7 +1352,7 @@ in_lltable_prefix_free(struct lltable *l static int -in_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) +in_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { struct rtentry *rt; @@ -1326,7 +1361,8 @@ in_lltable_rtcheck(struct ifnet *ifp, co /* XXX rtalloc1 should take a const param */ rt = rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) { + if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || + ((rt->rt_ifp != ifp) && !(flags & LLE_PUB))) { #ifdef DIAGNOSTIC log(LOG_INFO, "IPv4 address: \"%s\" is not on the network\n", inet_ntoa(((const struct sockaddr_in *)l3addr)->sin_addr)); @@ -1378,7 +1414,7 @@ in_lltable_lookup(struct lltable *llt, u * verify this. */ if (!(flags & LLE_IFADDR) && - in_lltable_rtcheck(ifp, l3addr) != 0) + in_lltable_rtcheck(ifp, flags, l3addr) != 0) goto done; lle = in_lltable_new(l3addr, flags); Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/netinet6/in6.c Tue Jan 5 22:14:55 2010 (r201614) @@ -1196,8 +1196,12 @@ in6_purgeaddr(struct ifaddr *ifa) * The check for the current setting of "nd6_useloopback" * is not needed. */ - error = ifa_del_loopback_route((struct ifaddr *)ia, - (struct sockaddr *)&ia->ia_addr); + if (ia->ia_flags & IFA_RTSELF) { + error = ifa_del_loopback_route((struct ifaddr *)ia, + (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags &= ~IFA_RTSELF; + } /* stop DAD processing */ nd6_dad_stop(ifa); @@ -1758,6 +1762,8 @@ in6_ifinit(struct ifnet *ifp, struct in6 || (ifp->if_flags & IFF_LOOPBACK))) { error = ifa_add_loopback_route((struct ifaddr *)ia, (struct sockaddr *)&ia->ia_addr); + if (error == 0) + ia->ia_flags |= IFA_RTSELF; } /* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */ @@ -2340,7 +2346,9 @@ in6_lltable_prefix_free(struct lltable * } static int -in6_lltable_rtcheck(struct ifnet *ifp, const struct sockaddr *l3addr) +in6_lltable_rtcheck(struct ifnet *ifp, + u_int flags, + const struct sockaddr *l3addr) { struct rtentry *rt; char ip6buf[INET6_ADDRSTRLEN]; @@ -2408,7 +2416,7 @@ in6_lltable_lookup(struct lltable *llt, * verify this. */ if (!(flags & LLE_IFADDR) && - in6_lltable_rtcheck(ifp, l3addr) != 0) + in6_lltable_rtcheck(ifp, flags, l3addr) != 0) return NULL; lle = in6_lltable_new(l3addr, flags); Modified: stable/8/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/8/sys/netinet6/nd6_rtr.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/sys/netinet6/nd6_rtr.c Tue Jan 5 22:14:55 2010 (r201614) @@ -1631,7 +1631,7 @@ nd6_prefix_onlink(struct nd_prefix *pr) bzero(&mask6, sizeof(mask6)); mask6.sin6_len = sizeof(mask6); mask6.sin6_addr = pr->ndpr_mask; - rtflags = ifa->ifa_flags | RTF_UP; + rtflags = (ifa->ifa_flags & ~IFA_RTSELF) | RTF_UP; error = rtrequest(RTM_ADD, (struct sockaddr *)&pr->ndpr_prefix, ifa->ifa_addr, (struct sockaddr *)&mask6, rtflags, &rt); if (error == 0) { Modified: stable/8/usr.sbin/arp/arp.c ============================================================================== --- stable/8/usr.sbin/arp/arp.c Tue Jan 5 21:14:48 2010 (r201613) +++ stable/8/usr.sbin/arp/arp.c Tue Jan 5 22:14:55 2010 (r201614) @@ -326,7 +326,6 @@ set(int argc, char **argv) doing_proxy = 1; if (argc && strncmp(argv[1], "only", 3) == 0) { proxy_only = 1; - dst->sin_other = SIN_PROXY; argc--; argv++; } } else if (strncmp(argv[0], "blackhole", 9) == 0) { @@ -365,33 +364,30 @@ set(int argc, char **argv) sdl_m.sdl_alen = ETHER_ADDR_LEN; } } - for (;;) { /* try at most twice */ - rtm = rtmsg(RTM_GET, dst, &sdl_m); - if (rtm == NULL) { - warn("%s", host); - return (1); - } - addr = (struct sockaddr_inarp *)(rtm + 1); - sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); - if (addr->sin_addr.s_addr != dst->sin_addr.s_addr) - break; - if (sdl->sdl_family == AF_LINK && - !(rtm->rtm_flags & RTF_GATEWAY) && - valid_type(sdl->sdl_type) ) - break; - if (doing_proxy == 0) { - printf("set: can only proxy for %s\n", host); - return (1); - } - if (dst->sin_other & SIN_PROXY) { - printf("set: proxy entry exists for non 802 device\n"); - return (1); - } - dst->sin_other = SIN_PROXY; - proxy_only = 1; + + /* + * In the case a proxy-arp entry is being added for + * a remote end point, the RTF_ANNOUNCE flag in the + * RTM_GET command is an indication to the kernel + * routing code that the interface associated with + * the prefix route covering the local end of the + * PPP link should be returned, on which ARP applies. + */ + rtm = rtmsg(RTM_GET, dst, &sdl_m); + if (rtm == NULL) { + warn("%s", host); + return (1); + } + addr = (struct sockaddr_inarp *)(rtm + 1); + sdl = (struct sockaddr_dl *)(SA_SIZE(addr) + (char *)addr); + if (addr->sin_addr.s_addr == dst->sin_addr.s_addr) { + printf("set: proxy entry exists for non 802 device\n"); + return (1); } - if (sdl->sdl_family != AF_LINK) { + if ((sdl->sdl_family != AF_LINK) || + (rtm->rtm_flags & RTF_GATEWAY) || + !valid_type(sdl->sdl_type)) { printf("cannot intuit interface index and type for %s\n", host); return (1); } @@ -436,7 +432,11 @@ delete(char *host, int do_proxy) dst = getaddr(host); if (dst == NULL) return (1); - dst->sin_other = do_proxy; + + /* + * Perform a regular entry delete first. + */ + flags &= ~RTF_ANNOUNCE; /* * setup the data structure to notify the kernel @@ -471,11 +471,16 @@ delete(char *host, int do_proxy) break; } - if (dst->sin_other & SIN_PROXY) { + /* + * Regualar entry delete failed, now check if there + * is a proxy-arp entry to remove. + */ + if (flags & RTF_ANNOUNCE) { fprintf(stderr, "delete: cannot locate %s\n",host); return (1); } - dst->sin_other = SIN_PROXY; + + flags |= RTF_ANNOUNCE; } rtm->rtm_flags |= RTF_LLDATA; if (rtmsg(RTM_DELETE, dst, NULL) != NULL) { @@ -485,6 +490,7 @@ delete(char *host, int do_proxy) return (1); } + /* * Search the arp table and do some action on matching entries */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 22:28:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E16106566B; Tue, 5 Jan 2010 22:28:23 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BC378FC1E; Tue, 5 Jan 2010 22:28:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05MSNmD031313; Tue, 5 Jan 2010 22:28:23 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05MSN2w031311; Tue, 5 Jan 2010 22:28:23 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001052228.o05MSN2w031311@svn.freebsd.org> From: Qing Li Date: Tue, 5 Jan 2010 22:28:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201615 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 22:28:23 -0000 Author: qingli Date: Tue Jan 5 22:28:23 2010 New Revision: 201615 URL: http://svn.freebsd.org/changeset/base/201615 Log: MFC r201284 Multiple IPv6 addresses of the same prefix can be installed on the same interface. The first address will install the prefix route into the kernel routing table and that prefix will be marked as on-link. Without RADIX_MPATH enabled, the other address aliases of the same prefix will update the prefix reference count but no other routes will be installed. Consequently the prefixes associated with these addresses would not be marked as on-link. As such, incoming packets destined to these address aliases will fail the ND6 on-link check on input. This patch fixes the above problem by searching the kernel routing table and try to find an on-link prefix on the given interface. Modified: stable/8/sys/netinet6/nd6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Tue Jan 5 22:14:55 2010 (r201614) +++ stable/8/sys/netinet6/nd6.c Tue Jan 5 22:28:23 2010 (r201615) @@ -934,8 +934,28 @@ nd6_is_new_addr_neighbor(struct sockaddr if (pr->ndpr_ifp != ifp) continue; - if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) - continue; + if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { + struct rtentry *rt; + rt = rtalloc1((struct sockaddr *)&pr->ndpr_prefix, 0, 0); + if (rt == NULL) + continue; + /* + * This is the case where multiple interfaces + * have the same prefix, but only one is installed + * into the routing table and that prefix entry + * is not the one being examined here. In the case + * where RADIX_MPATH is enabled, multiple route + * entries (of the same rt_key value) will be + * installed because the interface addresses all + * differ. + */ + if (!IN6_ARE_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, + &((struct sockaddr_in6 *)rt_key(rt))->sin6_addr)) { + RTFREE_LOCKED(rt); + continue; + } + RTFREE_LOCKED(rt); + } if (IN6_ARE_MASKED_ADDR_EQUAL(&pr->ndpr_prefix.sin6_addr, &addr->sin6_addr, &pr->ndpr_mask)) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 22:33:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE561065694; Tue, 5 Jan 2010 22:33:10 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 994DA8FC22; Tue, 5 Jan 2010 22:33:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05MXA5a032481; Tue, 5 Jan 2010 22:33:10 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05MXApY032479; Tue, 5 Jan 2010 22:33:10 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001052233.o05MXApY032479@svn.freebsd.org> From: Qing Li Date: Tue, 5 Jan 2010 22:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201616 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 22:33:10 -0000 Author: qingli Date: Tue Jan 5 22:33:10 2010 New Revision: 201616 URL: http://svn.freebsd.org/changeset/base/201616 Log: MFC r201285 Consolidate the route message generation code for when address aliases were added or deleted. The announced route entry for an address alias is no longer empty because this empty route entry was causing some route daemon to fail and exit abnormally. Modified: stable/8/sys/netinet/in.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Tue Jan 5 22:28:23 2010 (r201615) +++ stable/8/sys/netinet/in.c Tue Jan 5 22:33:10 2010 (r201616) @@ -950,6 +950,49 @@ in_ifinit(struct ifnet *ifp, struct in_i #define rtinitflags(x) \ ((((x)->ia_ifp->if_flags & (IFF_LOOPBACK | IFF_POINTOPOINT)) != 0) \ ? RTF_HOST : 0) + +/* + * Generate a routing message when inserting or deleting + * an interface address alias. + */ +static void in_addralias_rtmsg(int cmd, struct in_addr *prefix, + struct in_ifaddr *target) +{ + struct route pfx_ro; + struct sockaddr_in *pfx_addr; + struct rtentry msg_rt; + + /* QL: XXX + * This is a bit questionable because there is no + * additional route entry added/deleted for an address + * alias. Therefore this route report is inaccurate. + */ + bzero(&pfx_ro, sizeof(pfx_ro)); + pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); + pfx_addr->sin_len = sizeof(*pfx_addr); + pfx_addr->sin_family = AF_INET; + pfx_addr->sin_addr = *prefix; + rtalloc_ign_fib(&pfx_ro, 0, 0); + if (pfx_ro.ro_rt != NULL) { + msg_rt = *pfx_ro.ro_rt; + + /* QL: XXX + * Point the gateway to the new interface + * address as if a new prefix route entry has + * been added through the new address alias. + * All other parts of the rtentry is accurate, + * e.g., rt_key, rt_mask, rt_ifp etc. + */ + msg_rt.rt_gateway = + (struct sockaddr *)&target->ia_addr; + rt_newaddrmsg(cmd, + (struct ifaddr *)target, + 0, &msg_rt); + RTFREE(pfx_ro.ro_rt); + } + return; +} + /* * Check if we have a route for the given prefix already or add one accordingly. */ @@ -997,40 +1040,7 @@ in_addprefix(struct in_ifaddr *target, i IN_IFADDR_RUNLOCK(); return (EEXIST); } else { - struct route pfx_ro; - struct sockaddr_in *pfx_addr; - struct rtentry msg_rt; - - /* QL: XXX - * This is a bit questionable because there is no - * additional route entry added for an address alias. - * Therefore this route report is inaccurate. Perhaps - * it's better to supply a empty rtentry as how it - * is done in in_scrubprefix(). - */ - bzero(&pfx_ro, sizeof(pfx_ro)); - pfx_addr = (struct sockaddr_in *)(&pfx_ro.ro_dst); - pfx_addr->sin_len = sizeof(*pfx_addr); - pfx_addr->sin_family = AF_INET; - pfx_addr->sin_addr = prefix; - rtalloc_ign_fib(&pfx_ro, 0, 0); - if (pfx_ro.ro_rt != NULL) { - msg_rt = *pfx_ro.ro_rt; - /* QL: XXX - * Point the gateway to the given interface - * address as if a new prefix route entry has - * been added through the new address alias. - * All other parts of the rtentry is accurate, - * e.g., rt_key, rt_mask, rt_ifp etc. - */ - msg_rt.rt_gateway = - (struct sockaddr *)&ia->ia_addr; - rt_newaddrmsg(RTM_ADD, - (struct ifaddr *)target, - 0, &msg_rt); - RTFREE(pfx_ro.ro_rt); - } - + in_addralias_rtmsg(RTM_ADD, &prefix, target); IN_IFADDR_RUNLOCK(); return (0); } @@ -1099,20 +1109,6 @@ in_scrubprefix(struct in_ifaddr *target) arp_ifscrub(target->ia_ifp, IA_SIN(target)->sin_addr.s_addr); } - if ((target->ia_flags & IFA_ROUTE) == 0) { - struct rtentry rt; - - /* QL: XXX - * Report a blank rtentry when a route has not been - * installed for the given interface address. - */ - bzero(&rt, sizeof(rt)); - rt_newaddrmsg(RTM_DELETE, - (struct ifaddr *)target, - 0, &rt); - return (0); - } - if (rtinitflags(target)) prefix = target->ia_dstaddr.sin_addr; else { @@ -1121,6 +1117,11 @@ in_scrubprefix(struct in_ifaddr *target) prefix.s_addr &= mask.s_addr; } + if ((target->ia_flags & IFA_ROUTE) == 0) { + in_addralias_rtmsg(RTM_DELETE, &prefix, target); + return (0); + } + IN_IFADDR_RLOCK(); TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { if (rtinitflags(ia)) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 22:37:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8882106566B; Tue, 5 Jan 2010 22:37:05 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6E848FC08; Tue, 5 Jan 2010 22:37:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Mb5k8033433; Tue, 5 Jan 2010 22:37:05 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05Mb5Q6033431; Tue, 5 Jan 2010 22:37:05 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001052237.o05Mb5Q6033431@svn.freebsd.org> From: Qing Li Date: Tue, 5 Jan 2010 22:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201617 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 22:37:05 -0000 Author: qingli Date: Tue Jan 5 22:37:05 2010 New Revision: 201617 URL: http://svn.freebsd.org/changeset/base/201617 Log: MFC r201319 Remove a deleted comment line that was brought back by my previous commit. Modified: stable/8/sys/net/if_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_var.h ============================================================================== --- stable/8/sys/net/if_var.h Tue Jan 5 22:33:10 2010 (r201616) +++ stable/8/sys/net/if_var.h Tue Jan 5 22:37:05 2010 (r201617) @@ -846,7 +846,6 @@ void if_ref(struct ifnet *); void if_rele(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); void if_up(struct ifnet *); -/*void ifinit(void);*/ /* declared in systm.h for main() */ int ifioctl(struct socket *, u_long, caddr_t, struct thread *); int ifpromisc(struct ifnet *, int); struct ifnet *ifunit(const char *); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 23:00:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF82106566C; Tue, 5 Jan 2010 23:00:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D85418FC15; Tue, 5 Jan 2010 22:59:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05Mxx6k039073; Tue, 5 Jan 2010 22:59:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05MxxGB039071; Tue, 5 Jan 2010 22:59:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001052259.o05MxxGB039071@svn.freebsd.org> From: Rui Paulo Date: Tue, 5 Jan 2010 22:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201620 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 23:00:00 -0000 Author: rpaulo Date: Tue Jan 5 22:59:59 2010 New Revision: 201620 URL: http://svn.freebsd.org/changeset/base/201620 Log: Add net80211 media status reporting. PR: 142197 Submitted by: Paul Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Tue Jan 5 22:53:20 2010 (r201619) +++ head/sys/dev/if_ndis/if_ndis.c Tue Jan 5 22:59:59 2010 (r201620) @@ -189,6 +189,7 @@ static int ndis_set_offload (struct ndis static void ndis_getstate_80211 (struct ndis_softc *); static void ndis_setstate_80211 (struct ndis_softc *); static void ndis_auth_and_assoc (struct ndis_softc *, struct ieee80211vap *); +static void ndis_media_status (struct ifnet *, struct ifmediareq *); static int ndis_set_cipher (struct ndis_softc *, int); static int ndis_set_wpa (struct ndis_softc *, void *, int); static int ndis_add_key (struct ieee80211vap *, @@ -993,7 +994,7 @@ ndis_vap_create(struct ieee80211com *ic, vap->iv_newstate = ndis_newstate; /* complete setup */ - ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status); + ieee80211_vap_attach(vap, ieee80211_media_change, ndis_media_status); ic->ic_opmode = opmode; /* install key handing routines */ vap->iv_key_set = ndis_add_key; @@ -2237,6 +2238,23 @@ ndis_set_wpa(sc, ie, ielen) } static void +ndis_media_status(struct ifnet *ifp, struct ifmediareq *imr) +{ + struct ieee80211vap *vap = ifp->if_softc; + struct ndis_softc *sc = vap->iv_ic->ic_ifp->if_softc; + uint32_t txrate; + size_t len; + + if (!NDIS_INITIALIZED(sc)) + return; + + len = sizeof(txrate); + if (ndis_get_info(sc, OID_GEN_LINK_SPEED, &txrate, &len) == 0) + vap->iv_bss->ni_txrate = txrate / 5000; + ieee80211_media_status(ifp, imr); +} + +static void ndis_setstate_80211(sc) struct ndis_softc *sc; { @@ -2696,13 +2714,6 @@ ndis_getstate_80211(sc) bs->nwbx_ssid.ns_ssidlen); ni->ni_esslen = bs->nwbx_ssid.ns_ssidlen; - len = sizeof(arg); - rval = ndis_get_info(sc, OID_GEN_LINK_SPEED, &arg, &len); - if (rval) - device_printf(sc->ndis_dev, "get link speed failed: %d\n", - rval); - ni->ni_txrate = arg / 5000; - if (ic->ic_caps & IEEE80211_C_PMGT) { len = sizeof(arg); rval = ndis_get_info(sc, OID_802_11_POWER_MODE, &arg, &len); From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 23:04:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57BA51065676; Tue, 5 Jan 2010 23:04:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42F448FC14; Tue, 5 Jan 2010 23:04:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05N40m2040085; Tue, 5 Jan 2010 23:04:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05N40o4040084; Tue, 5 Jan 2010 23:04:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001052304.o05N40o4040084@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jan 2010 23:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201622 - in stable/8: . contrib/top lib/libusb share/man/man4 tools/regression/lib/msun tools/regression/usr.bin/pkill tools/tools/ath/common tools/tools/termcap usr.bin/calendar/calen... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 23:04:00 -0000 Author: bz Date: Tue Jan 5 23:03:59 2010 New Revision: 201622 URL: http://svn.freebsd.org/changeset/base/201622 Log: According to basic instructions from jhb clean-up mergeinfo from r201614. Modified: Directory Properties: stable/8/ (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zdb/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/release/doc/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/zic/ (props changed) From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 23:23:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915F5106566C; Tue, 5 Jan 2010 23:23:17 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 82E218FC14; Tue, 5 Jan 2010 23:23:16 +0000 (UTC) Received: from orion.SpringDaemons.com (adsl-99-48-191-9.dsl.snfc21.sbcglobal.net [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 3F9368FC51; Wed, 6 Jan 2010 02:23:15 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id AA4AA39C24; Tue, 5 Jan 2010 15:23:00 -0800 (PST) Date: Tue, 5 Jan 2010 15:23:00 -0800 From: Stanislav Sedov To: Doug Barton Message-Id: <20100105152300.eb7a66d1.stas@FreeBSD.org> In-Reply-To: <4B4384E3.2080600@FreeBSD.org> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 23:23:17 -0000 On Tue, 05 Jan 2010 10:28:51 -0800 Doug Barton mentioned: > First off, thanks for sorting these, that's a step in the right > direction. :) However, a few quibbles. First, our rule is that > anything which might offend someone belongs in fortunes-o, and > political quotes are always in the category of "might offend someone." > (FWIW, neither of these are offensive to me, I'm just pointing out the > general procedure.) > > Second, while it's clear at this point in time who these people are, > and what the context is, read through the fortune files sometime and > try to place who some of the people referenced are, when the quote was > relevant, etc. At minimum the quotes should be dated (IMO). > > Finally, let's pretend for a second that this is an international > project, and not assume that titles like "defense secretary" are > meaningful everywhere. :) > > Oh, and in the Rumsfeld quote you have "there're" twice, and in the > actual quote it's spelled out both times, "there are." > > I would change the citation in the first quote to read: > > -- United States Secretary of Defense Donald Rumsfeld > 12 February 2002 > Personally I don't see the need to mention the context, but if you do > you could add "... 2002, On the invasion of Iraq" > > For the second, you could do something like: > > -- Daniel Fass, Chairman of United States President > Barack Obama's financial-industry fundraising party > I'll leave finding a date for that quote up to you. :) > Thanks for suggestions! What's regarding the "there're" spelling --- I'm not sure what the correct version is: I took this quote from the San Francisco Chronicle newspaper, and it saved the original spelling. -- Stanislav Sedov ST4096-RIPE From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 23:33:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4345C106566C; Tue, 5 Jan 2010 23:33:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 182998FC19; Tue, 5 Jan 2010 23:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05NXTE7047272; Tue, 5 Jan 2010 23:33:29 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05NXTrB047270; Tue, 5 Jan 2010 23:33:29 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001052333.o05NXTrB047270@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 5 Jan 2010 23:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201625 - stable/6/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 23:33:30 -0000 Author: bz Date: Tue Jan 5 23:33:29 2010 New Revision: 201625 URL: http://svn.freebsd.org/changeset/base/201625 Log: MFC r185583: Fix a credential reference leak. [1] Close subtle but relatively unlikely race conditions when propagating the vnode write error to other active sessions tracing to the same vnode, without holding a reference on the vnode anymore. [2] PR: kern/126368 [1] Submitted by: rwatson [2] Reviewed by: kib, rwatson (head) Modified: stable/6/sys/kern/kern_ktrace.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/kern/kern_ktrace.c ============================================================================== --- stable/6/sys/kern/kern_ktrace.c Tue Jan 5 23:26:45 2010 (r201624) +++ stable/6/sys/kern/kern_ktrace.c Tue Jan 5 23:33:29 2010 (r201625) @@ -891,12 +891,7 @@ ktr_writerequest(struct thread *td, stru */ mtx_lock(&ktrace_mtx); vp = td->td_proc->p_tracevp; - if (vp != NULL) - VREF(vp); cred = td->td_proc->p_tracecred; - if (cred != NULL) - crhold(cred); - mtx_unlock(&ktrace_mtx); /* * If vp is NULL, the vp has been cleared out from under this @@ -905,9 +900,13 @@ ktr_writerequest(struct thread *td, stru */ if (vp == NULL) { KASSERT(cred == NULL, ("ktr_writerequest: cred != NULL")); + mtx_unlock(&ktrace_mtx); return; } + VREF(vp); KASSERT(cred != NULL, ("ktr_writerequest: cred == NULL")); + crhold(cred); + mtx_unlock(&ktrace_mtx); kth = &req->ktr_header; datalen = data_lengths[(u_short)kth->ktr_type & ~KTR_DROP]; @@ -947,18 +946,26 @@ ktr_writerequest(struct thread *td, stru error = VOP_WRITE(vp, &auio, IO_UNIT | IO_APPEND, cred); VOP_UNLOCK(vp, 0, td); vn_finished_write(mp); - vrele(vp); - mtx_unlock(&Giant); - if (!error) + crfree(cred); + if (!error) { + vrele(vp); + mtx_unlock(&Giant); return; + } + mtx_unlock(&Giant); + /* * If error encountered, give up tracing on this vnode. We defer * all the vrele()'s on the vnode until after we are finished walking * the various lists to avoid needlessly holding locks. + * NB: at this point we still hold the vnode reference that must + * not go away as we need the valid vnode to compare with. Thus let + * vrele_count start at 1 and the reference will be freed + * by the loop at the end after our last use of vp. */ log(LOG_NOTICE, "ktrace write failed, errno %d, tracing stopped\n", error); - vrele_count = 0; + vrele_count = 1; /* * First, clear this vnode from being used by any processes in the * system. From owner-svn-src-all@FreeBSD.ORG Tue Jan 5 23:35:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDBEF106566B; Tue, 5 Jan 2010 23:35:45 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC7468FC08; Tue, 5 Jan 2010 23:35:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o05NZjM2047820; Tue, 5 Jan 2010 23:35:45 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o05NZiEC047787; Tue, 5 Jan 2010 23:35:44 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201001052335.o05NZiEC047787@svn.freebsd.org> From: Stanislav Sedov Date: Tue, 5 Jan 2010 23:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201626 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 23:35:46 -0000 Author: stas Date: Tue Jan 5 23:35:43 2010 New Revision: 201626 URL: http://svn.freebsd.org/changeset/base/201626 Log: - Move potentially offensive quotes I committed recently to fortunes-o. - Reference date. - Be more clear on context. Suggested by: dougb Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Tue Jan 5 23:33:29 2010 (r201625) +++ head/games/fortune/datfiles/fortunes Tue Jan 5 23:35:43 2010 (r201626) @@ -1604,13 +1604,6 @@ friends and family, and then justify thi for doing it." -- Bruce Feirstein, "Nice Guys Sleep Alone" % - As we know, there are known knowns. There are things we know we -know. We also know there are known unknowns. That is to say, we know -there're some things we do not know. But there're also unknown unknowns; -the ones we don't know we don't know." - -- Defense Secretary Donald Rumsfeld, - about the invasion to Iraq. -% At a recent meeting in Snowmass, Colorado, a participant from Los Angeles fainted from hyperoxygenation, and we had to hold his head under the exhaust of a bus until he revived. @@ -46195,13 +46188,6 @@ constitutions, displaying the utmost imp overturning everything. -- Plato, "Republic", 370 B.C. % -The investment community feels very putupon. They feel there is no -reason why they shouldn't earn $1 million to $200 million a year, -and they don't want to be held responsible for the global financial -meltdown. - -- Daniel Fass, chairman of Obama's - financial-industry fundraising party -% The IQ of the group is the lowest IQ of a member of the group divided by the number of people in the group. % Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Tue Jan 5 23:33:29 2010 (r201625) +++ head/games/fortune/datfiles/fortunes-o.real Tue Jan 5 23:35:43 2010 (r201626) @@ -663,6 +663,13 @@ posh hotel. "Why, yes, young man," said the gentleman. "Would you bring me a postcard?" % + As we know, there are known knowns. There are things we know we +know. We also know there are known unknowns. That is to say, we know +there're some things we do not know. But there're also unknown unknowns; +the ones we don't know we don't know." + -- United States Secretary of Defense Donald Rumsfeld + 12 February 2002, on the invasion to Iraq. +% "Are pirates an ethnic group? Or are they just people who burn illegal cds?" "Arrrr! We prefer to be called Buccaneer-Americans." @@ -12873,6 +12880,14 @@ Contraception", has been withdrawn after pull it out at the last minute. -- Not the Nine O'Clock News % +The investment community feels very putupon. They feel there is no +reason why they shouldn't earn $1 million to $200 million a year, +and they don't want to be held responsible for the global financial +meltdown. + -- Daniel Fass, Chairman of United States President + Barack Obama's financial-industry fundraising party + 20 October 2009 +% The king arranged a regal marriage for his daughter -- a bond that would unite two great kingdoms. Yet, because the young couple seemed so formal to each other, he posted a spy outside the royal wedding chamber and demanded a full From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 00:03:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 392EB1065672 for ; Wed, 6 Jan 2010 00:03:14 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id D67CE8FC18 for ; Wed, 6 Jan 2010 00:03:13 +0000 (UTC) Received: (qmail 6157 invoked by uid 399); 6 Jan 2010 00:03:13 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 6 Jan 2010 00:03:13 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B43D346.4020900@FreeBSD.org> Date: Tue, 05 Jan 2010 16:03:18 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Stanislav Sedov References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <20100105152300.eb7a66d1.stas@FreeBSD.org> In-Reply-To: <20100105152300.eb7a66d1.stas@FreeBSD.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 00:03:14 -0000 Stanislav Sedov wrote: > Thanks for suggestions! And thank you for making the changes. :) > What's regarding the "there're" spelling --- I'm not sure what the > correct version is: I took this quote from the San Francisco > Chronicle newspaper, and it saved the original spelling. Couple of things regarding that. First, "there're" is very far from being a common English construction, especially in formal speech such as the context of this quote. Second, I found numerous citations that have it spelled out on line, I didn't find any that had the contraction (although I admit that I did not do an exhaustive search). Finally, the chronicle is not who I would choose to be objective in regards to a quotation from someone with whom they share an opposite political viewpoint. :) In regards to what you appended to the date, "On" would be fine, after thinking about it "Regarding" would probably be more clear. Either way it should be capitalized. The "to" should definitely be changed to "of" however, for proper English'ification. I'm happy to make the changes if you'd rather, since I realize that it's annoying having to fix grammar nits, especially about something as trivial as the fortune files. :) Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 00:20:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B0221065692; Wed, 6 Jan 2010 00:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7558FC15; Wed, 6 Jan 2010 00:20:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o060Kbc9057780; Wed, 6 Jan 2010 00:20:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o060Kbbw057778; Wed, 6 Jan 2010 00:20:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001060020.o060Kbbw057778@svn.freebsd.org> From: Xin LI Date: Wed, 6 Jan 2010 00:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201627 - head/games/pom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 00:20:37 -0000 Author: delphij Date: Wed Jan 6 00:20:37 2010 New Revision: 201627 URL: http://svn.freebsd.org/changeset/base/201627 Log: Fix build: getopt() returns int so use an integer to get the value. Modified: head/games/pom/pom.c Modified: head/games/pom/pom.c ============================================================================== --- head/games/pom/pom.c Tue Jan 5 23:35:43 2010 (r201626) +++ head/games/pom/pom.c Wed Jan 6 00:20:37 2010 (r201627) @@ -88,8 +88,8 @@ main(int argc, char **argv) time_t tt; struct tm GMT, tmd; double days, today, tomorrow; - int cnt; - char *odate = NULL, *otime = NULL, ch; + int ch, cnt; + char *odate = NULL, *otime = NULL; while ((ch = getopt(argc, argv, "d:t:")) != -1) switch (ch) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 00:21:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 75E601065676; Wed, 6 Jan 2010 00:21:39 +0000 (UTC) Date: Wed, 6 Jan 2010 00:21:39 +0000 From: Alexey Dokuchaev To: Ken Smith Message-ID: <20100106002139.GA54290@FreeBSD.org> References: <201001051745.o05HjdwA067393@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201001051745.o05HjdwA067393@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r201596 - stable/7/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 00:21:39 -0000 On Tue, Jan 05, 2010 at 05:45:39PM +0000, Ken Smith wrote: > Author: kensmith > Date: Tue Jan 5 17:45:39 2010 > New Revision: 201596 > URL: http://svn.freebsd.org/changeset/base/201596 > > Log: > MFS8 r201529: > > Add FreeBSD- to the beginning of the ISO image filenames. On a slightly related note, if these scripts were used for building releases for project other than FreeBSD, shouldn't some sort of $(uname) assigned variable be used instead? ./danfe From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 00:25:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E2D3106566B; Wed, 6 Jan 2010 00:25:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id DC6A38FC1B; Wed, 6 Jan 2010 00:25:04 +0000 (UTC) Received: from orion.SpringDaemons.com (unknown [99.48.191.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 520EE8FC4E; Wed, 6 Jan 2010 03:25:03 +0300 (MSK) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id EEFBB39C24; Tue, 5 Jan 2010 16:24:47 -0800 (PST) Date: Tue, 5 Jan 2010 16:24:47 -0800 From: Stanislav Sedov To: Doug Barton Message-Id: <20100105162447.7deac6d7.stas@FreeBSD.org> In-Reply-To: <4B43D346.4020900@FreeBSD.org> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <20100105152300.eb7a66d1.stas@FreeBSD.org> <4B43D346.4020900@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Tue__5_Jan_2010_16_24_47_-0800_.By98Nb8oPcr5+BP" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 00:25:05 -0000 --Signature=_Tue__5_Jan_2010_16_24_47_-0800_.By98Nb8oPcr5+BP Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, 05 Jan 2010 16:03:18 -0800 Doug Barton mentioned: > Stanislav Sedov wrote: > > Thanks for suggestions! >=20 > And thank you for making the changes. :) >=20 > > What's regarding the "there're" spelling --- I'm not sure what the > > correct version is: I took this quote from the San Francisco > > Chronicle newspaper, and it saved the original spelling. >=20 > Couple of things regarding that. First, "there're" is very far from > being a common English construction, especially in formal speech such > as the context of this quote. Second, I found numerous citations that > have it spelled out on line, I didn't find any that had the > contraction (although I admit that I did not do an exhaustive search). > Finally, the chronicle is not who I would choose to be objective in > regards to a quotation from someone with whom they share an opposite > political viewpoint. :) Yeah, true :-) >=20 > In regards to what you appended to the date, "On" would be fine, after > thinking about it "Regarding" would probably be more clear. Either way > it should be capitalized. The "to" should definitely be changed to > "of" however, for proper English'ification. Hmm, I'm not by any means the English language expert [just learning], but isn't "invasion of" in this context is somewhat vague? I mean, from what I see from dictionaries "invasion of smth" could mean both the action by smth, and action against smth. Is "invasion to" grammatically incorrect? BTW, why it should be capitalized, it's not a start of a sentence? >=20 > I'm happy to make the changes if you'd rather, since I realize that > it's annoying having to fix grammar nits, especially about something > as trivial as the fortune files. :) >=20 Yeah, please do. I'm clearly not competent enough at this area. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Tue__5_Jan_2010_16_24_47_-0800_.By98Nb8oPcr5+BP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJLQ9hPAAoJEL8lojEJL9nwgzAP/1Te58ZNxo6/AyBaZ+jHS3vv WNaoxc/Cow0MIwEZMYuq4vdb5eSG4FcxbokPys1mUE7Xn4ISmW2xtHY1FU8zRHUZ sUnIb9dFCKslXMfERAnIP5qq0006BCr6VLmnIEKopOf2nloDo5turVKSyV3acOiY BbDnFfWTn04hfUfcVB8ciolUmKBNMl2mSpHEpEQ2HGDyIiYGxDIqL1JaEgSDziGX BOPZQdu30YBQ8rTgxfRQmn0s3nmJlm/rzqKCi1PRxq7XAm0MHLpmk29MJ3MAdwHU XzVtXN3Xk91vkM0ywQDlnE1p3RUVlz4sMs0BOQP1l+MGtfQJfEBwaon5eKPsjlsW shvyIQh93n3Oum8VCI20DgGh3TNI8ShGCnygmrxlI1nSBOqo7I3QuVMmUkGIYqTJ UYSeTa3Zuiga6phtRq0c56CcwT1RLHGOmDwrUfPJiB4PnwkgJDRMId3KJJD7B19T CGI6gvonCaQMOduShp9ogqe2CgvfDWAi3Y1HTtVmcqKixefTLxQmZodxOxZBXPCo CU49Rd+djm2EUiJaLvQMAJeZ1/DGI3e0bUZQw+8CiO6iIoT456m4KMGia/sGmIJ7 C7TQDXHwkhNY+vINMzEZipHQ8FGXp45ESKcg9JgPASXC+oCRnEqAJcEjp7VQCCIc VMoX1gvlqly3yonozKu7 =+Jem -----END PGP SIGNATURE----- --Signature=_Tue__5_Jan_2010_16_24_47_-0800_.By98Nb8oPcr5+BP-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 00:49:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1A411065694; Wed, 6 Jan 2010 00:49:47 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 868F38FC16; Wed, 6 Jan 2010 00:49:47 +0000 (UTC) Received: from apple.my.domain (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o060njKx099376; Wed, 6 Jan 2010 00:49:46 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4B43DE29.3070206@freebsd.org> Date: Wed, 06 Jan 2010 08:49:45 +0800 From: David Xu User-Agent: Thunderbird 2.0.0.9 (X11/20080612) MIME-Version: 1.0 To: Bruce Simpson References: <201001040527.o045RoNN062634@svn.freebsd.org> <4B4343E7.1020408@incunabulum.net> In-Reply-To: <4B4343E7.1020408@incunabulum.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201472 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 00:49:47 -0000 Bruce Simpson wrote: > On 04/01/2010 05:27, David Xu wrote: >> Log: >> Add user-level semaphore synchronous type... >> > > Nice work! Will this be MFC-able to 8.x? > A lot of things could benefit from this, especially Boost.Interprocess. > > cheers, > BMS > > This is MFC-able. ;-) From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 01:02:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FBC51065672; Wed, 6 Jan 2010 01:02:20 +0000 (UTC) (envelope-from kensmith@buffalo.edu) Received: from localmailA.acsu.buffalo.edu (localmailA.acsu.buffalo.edu [128.205.5.196]) by mx1.freebsd.org (Postfix) with ESMTP id 467D58FC0A; Wed, 6 Jan 2010 01:02:19 +0000 (UTC) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 46414B194; Tue, 5 Jan 2010 19:53:45 -0500 (EST) Received: from localmailA.acsu.buffalo.edu (localhost [127.0.0.1]) by localmailA.acsu.buffalo.edu (Postfix) with ESMTP id 96287B2BB; Tue, 5 Jan 2010 19:53:44 -0500 (EST) Received: from mweb2.acsu.buffalo.edu (mweb2.acsu.buffalo.edu [128.205.5.239]) by localmailA.acsu.buffalo.edu (Prefixe) with ESMTP id 8C422B194; Tue, 5 Jan 2010 19:53:44 -0500 (EST) Received: from [192.168.1.101] (cpe-76-180-182-44.buffalo.res.rr.com [76.180.182.44]) by mweb2.acsu.buffalo.edu (Postfix) with ESMTP id 21DB9207B6; Tue, 5 Jan 2010 19:53:44 -0500 (EST) From: Ken Smith To: Alexey Dokuchaev In-Reply-To: <20100106002139.GA54290@FreeBSD.org> References: <201001051745.o05HjdwA067393@svn.freebsd.org> <20100106002139.GA54290@FreeBSD.org> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-2VWnzENUUmKCjBQa0Cyr" Organization: U. Buffalo Date: Tue, 05 Jan 2010 19:53:39 -0500 Message-ID: <1262739219.19693.4.camel@neo.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port X-PM-EL-Spam-Prob: XX: 27% Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org, Ken Smith Subject: Re: svn commit: r201596 - stable/7/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 01:02:20 -0000 --=-2VWnzENUUmKCjBQa0Cyr Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wed, 2010-01-06 at 00:21 +0000, Alexey Dokuchaev wrote: > On Tue, Jan 05, 2010 at 05:45:39PM +0000, Ken Smith wrote: > > Author: kensmith > > Date: Tue Jan 5 17:45:39 2010 > > New Revision: 201596 > > URL: http://svn.freebsd.org/changeset/base/201596 > >=20 > > Log: > > MFS8 r201529: > > =20 > > Add FreeBSD- to the beginning of the ISO image filenames. >=20 > On a slightly related note, if these scripts were used for building > releases for project other than FreeBSD, shouldn't some sort of $(uname) > assigned variable be used instead? >=20 > ./danfe >=20 >=20 The thought hadn't occurred to me. But that said, I don't feel particularly bad about this being a handful of the zillion places they'd need to change "FreeBSD" to something else when they do their import. Presumably this file in particular would be something they'd need to pay a lot of attention to regardless. --=20 Ken Smith - From there to here, from here to | kensmith@buffalo.edu there, funny things are everywhere. | - Theodore Geisel | --=-2VWnzENUUmKCjBQa0Cyr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEABECAAYFAktD3wkACgkQ/G14VSmup/YZZACeIy/ZoSwWZqINMpz+vlnvzJ2/ n/YAn1E1ialTx88BablH3nl/Zm2m3xLg =+NOn -----END PGP SIGNATURE----- --=-2VWnzENUUmKCjBQa0Cyr-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 04:11:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id B04951065672; Wed, 6 Jan 2010 04:11:18 +0000 (UTC) Date: Wed, 6 Jan 2010 04:11:18 +0000 From: Alexey Dokuchaev To: Stanislav Sedov Message-ID: <20100106041118.GA91881@FreeBSD.org> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <20100105152300.eb7a66d1.stas@FreeBSD.org> <4B43D346.4020900@FreeBSD.org> <20100105162447.7deac6d7.stas@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20100105162447.7deac6d7.stas@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 04:11:18 -0000 On Tue, Jan 05, 2010 at 04:24:47PM -0800, Stanislav Sedov wrote: > from what I see from dictionaries "invasion of smth" could mean both > the action by smth, and action against smth. Is "invasion to" > grammatically incorrect? I'm far from being an expert either, but invasion is clearly "of". It can help to think of embracing, not intrusion. Also, simple Google check for "invasion of" vs. "invasion to" kinda proves the point. ./danfe P.S. OK, I admit, I'm too drunk to give technically-backed answer; "of" just sounds right to me. From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 06:35:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6511065694; Wed, 6 Jan 2010 06:35:11 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F13198FC0C; Wed, 6 Jan 2010 06:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o066ZAU7040887; Wed, 6 Jan 2010 06:35:10 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o066ZArO040885; Wed, 6 Jan 2010 06:35:10 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201001060635.o066ZArO040885@svn.freebsd.org> From: Tim Kientzle Date: Wed, 6 Jan 2010 06:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201630 - head/usr.bin/unzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 06:35:11 -0000 Author: kientzle Date: Wed Jan 6 06:35:10 2010 New Revision: 201630 URL: http://svn.freebsd.org/changeset/base/201630 Log: When restoring files, use the mode for the mode. Thanks to: Jun Kuriyama for pointing this out Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Wed Jan 6 05:58:07 2010 (r201629) +++ head/usr.bin/unzip/unzip.c Wed Jan 6 06:35:10 2010 (r201630) @@ -383,7 +383,7 @@ extract_dir(struct archive *a, struct ar { int mode; - mode = archive_entry_filetype(e) & 0777; + mode = archive_entry_mode(e) & 0777; if (mode == 0) mode = 0755; @@ -425,7 +425,7 @@ extract_file(struct archive *a, struct a ssize_t len; unsigned char *p, *q, *end; - mode = archive_entry_filetype(e) & 0777; + mode = archive_entry_mode(e) & 0777; if (mode == 0) mode = 0644; mtime = archive_entry_mtime(e); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 08:18:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB317106566C; Wed, 6 Jan 2010 08:18:49 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C57748FC0C; Wed, 6 Jan 2010 08:18:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o068InDS065151; Wed, 6 Jan 2010 08:18:49 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o068InhI065129; Wed, 6 Jan 2010 08:18:49 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001060818.o068InhI065129@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 08:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201633 - in stable/7/sys: cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/common/nvpair cddl/contrib/opensolaris/uts/common/fs cddl/contrib/opensolari... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 08:18:50 -0000 Author: netchild Date: Wed Jan 6 08:18:49 2010 New Revision: 201633 URL: http://svn.freebsd.org/changeset/base/201633 Log: MFC several ZFS related commits: - taskq changes - fixes for race conditions - locking fixes - bug fixes - ... r185310: ---snip--- Remove unused variable. Found with: Coverity Prevent(tm) CID: 3669,3671 ---snip--- r185319: ---snip--- Fix locking (file descriptor table and Giant around VFS). Most submitted by: kib Reviewed by: kib ---snip--- r192689: ---snip--- Fix comment. ---snip--- r193110: ---snip--- work around snapshot shutdown race reported by Henri Hennebert ---snip--- r193440: ---snip--- Support shared vnode locks for write operations when the offset is provided on filesystems that support it. This really improves mysql + innodb performance on ZFS. Reviewed by: jhb, kmacy, jeffr ---snip--- ATTENTION: this commit to releng7 does not allow shared vnode locks (there are some VFS changes needed before it can be enabled), it only provides the infrastructure and serves mostly as a diff reduction in the ZFS code. A comment has been added to the locking part to explain why no shared locks are used. r195627: ---snip--- In nvpair_native_embedded_array(), meaningless pointers are zeroed. The programmer was aware that alignment was not guaranteed in the packed structure and used bzero() to NULL out the pointers. However, on ia64, the compiler is quite agressive in finding ILP and calls to bzero() are often replaced by simple assignments (i.e. stores). Especially when the width or size in question corresponds with a store instruction (i.e. st1, st2, st4 or st8). The problem here is not a compiler bug. The address of the memory to zero-out was given by '&packed->nvl_priv' and given the type of the 'packed' pointer the compiler could assume proper alignment for the replacement of bzero() with an 8-byte wide store to be valid. The problem is with the programmer. The programmer knew that the address did not have the alignment guarantees needed for a regular assignment, but failed to inform the compiler of that fact. In fact, the programmer told the compiler the opposite: alignment is guaranteed. The fix is to avoid using a pointer of type "nvlist_t *" and instead use a "char *" pointer as the basis for calculating the address. This tells the compiler that only 1-byte alignment can be assumed and the compiler will either keep the bzero() call or instead replace it with a sequence of byte-wise stores. Both are valid. ---snip--- r195822: ---snip--- Fix extattr_list_file(2) on ZFS in case the attribute directory doesn't exist and user doesn't have write access to the file. Without this fix, it returns bogus value instead of 0. For some reason this didn't manifest on my kernel compiled with -O0. PR: kern/136601 Submitted by: Jaakko Heinonen ---snip--- r195909 ---snip--- We don't support ephemeral IDs in FreeBSD and without this fix ZFS can panic when in zfs_fuid_create_cred() when userid is negative. It is converted to unsigned value which makes IS_EPHEMERAL() macro to incorrectly report that this is ephemeral ID. The most reasonable solution for now is to always report that the given ID is not ephemeral. PR: kern/132337 Submitted by: Matthew West Tested by: Thomas Backman , Michael Reifenberger ---snip--- r196291: ---snip--- - Fix a race where /dev/zfs control device is created before ZFS is fully initialized. Also destroy /dev/zfs before doing other deinitializations. - Initialization through taskq is no longer needed and there is a race where one of the zpool/zfs command loads zfs.ko and tries to do some work immediately, but /dev/zfs is not there yet. Reported by: pav ---snip--- r196269: ---snip--- Fix misalignment in nvpair_native_embedded() caused by the compiler replacing the bzero(). See also revision 195627, which fixed the misalignment in nvpair_native_embedded_array(). ---snip--- r196295: ---snip--- Remove OpenSolaris taskq port (it performs very poorly in our kernel) and replace it with wrappers around our taskqueue(9). To make it possible implement taskqueue_member() function which returns 1 if the given thread was created by the given taskqueue. ---snip--- The taskqueue_member() function is different due to kproc/kthread changes in releng8 and head, the function was... Revieved by: jhb r196297: ---snip--- Fix panic in zfs recv code. The last vnode (mountpoint's vnode) can have 0 usecount. Reported by: Thomas Backman ---snip--- r196299: ---snip--- - We need to recycle vnode instead of freeing znode. Submitted by: avg - Add missing vnode interlock unlock. - Remove redundant znode locking. ---snip--- r196301: ---snip--- If z_buf is NULL, we should free znode immediately. Noticed by: avg ---snip--- r196307: ---snip--- Manage asynchronous vnode release just like Solaris. Discussed with: kmacy ---snip--- Added: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c - copied unchanged from r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h - copied unchanged from r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Deleted: stable/7/sys/cddl/compat/opensolaris/sys/taskq.h stable/7/sys/cddl/compat/opensolaris/sys/taskq_impl.h stable/7/sys/cddl/contrib/opensolaris/uts/common/os/taskq.c Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c stable/7/sys/cddl/compat/opensolaris/sys/vnode.h stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h stable/7/sys/cddl/dev/cyclic/cyclic.c stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c stable/7/sys/kern/subr_taskqueue.c stable/7/sys/kern/vfs_vnops.c stable/7/sys/modules/zfs/Makefile stable/7/sys/sys/mount.h stable/7/sys/sys/taskqueue.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Wed Jan 6 08:18:49 2010 (r201633) @@ -67,17 +67,25 @@ static void * kobj_open_file_vnode(const char *file) { struct thread *td = curthread; + struct filedesc *fd; struct nameidata nd; int error, flags; - if (td->td_proc->p_fd->fd_rdir == NULL) - td->td_proc->p_fd->fd_rdir = rootvnode; - if (td->td_proc->p_fd->fd_cdir == NULL) - td->td_proc->p_fd->fd_cdir = rootvnode; + fd = td->td_proc->p_fd; + FILEDESC_XLOCK(fd); + if (fd->fd_rdir == NULL) { + fd->fd_rdir = rootvnode; + vref(fd->fd_rdir); + } + if (fd->fd_cdir == NULL) { + fd->fd_cdir = rootvnode; + vref(fd->fd_cdir); + } + FILEDESC_XUNLOCK(fd); flags = FREAD; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, file, td); - error = vn_open_cred(&nd, &flags, 0, td->td_ucred, NULL); + NDINIT(&nd, LOOKUP, MPSAFE, UIO_SYSSPACE, file, td); + error = vn_open_cred(&nd, &flags, O_NOFOLLOW, td->td_ucred, NULL); NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) return (NULL); @@ -121,13 +129,15 @@ kobj_get_filesize_vnode(struct _buf *fil struct vnode *vp = file->ptr; struct thread *td = curthread; struct vattr va; - int error; + int error, vfslocked; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_GETATTR(vp, &va, td->td_ucred, td); VOP_UNLOCK(vp, 0, td); if (error == 0) *size = (uint64_t)va.va_size; + VFS_UNLOCK_GIANT(vfslocked); return (error); } @@ -160,7 +170,7 @@ kobj_read_file_vnode(struct _buf *file, struct thread *td = curthread; struct uio auio; struct iovec aiov; - int error; + int error, vfslocked; bzero(&aiov, sizeof(aiov)); bzero(&auio, sizeof(auio)); @@ -176,9 +186,11 @@ kobj_read_file_vnode(struct _buf *file, auio.uio_resid = size; auio.uio_td = td; + vfslocked = VFS_LOCK_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY, td); error = VOP_READ(vp, &auio, IO_UNIT | IO_SYNC, td->td_ucred); VOP_UNLOCK(vp, 0, td); + VFS_UNLOCK_GIANT(vfslocked); return (error != 0 ? -1 : size - auio.uio_resid); } @@ -212,9 +224,11 @@ kobj_close_file(struct _buf *file) if (file->mounted) { struct vnode *vp = file->ptr; struct thread *td = curthread; - int flags = FREAD; + int vfslocked; - vn_close(vp, flags, td->td_ucred, td); + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vn_close(vp, FREAD, td->td_ucred, td); + VFS_UNLOCK_GIANT(vfslocked); } kmem_free(file, sizeof(*file)); } Copied: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c (from r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Jan 6 08:18:49 2010 (r201633, copy of r196295, head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2009 Pawel Jakub Dawidek + * 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 AUTHORS 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 AUTHORS 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 + +static uma_zone_t taskq_zone; + +struct ostask { + struct task ost_task; + task_func_t *ost_func; + void *ost_arg; +}; + +taskq_t *system_taskq = NULL; + +static void +system_taskq_init(void *arg) +{ + + system_taskq = (taskq_t *)taskqueue_thread; + taskq_zone = uma_zcreate("taskq_zone", sizeof(struct ostask), + NULL, NULL, NULL, NULL, 0, 0); +} +SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); + +static void +system_taskq_fini(void *arg) +{ + + uma_zdestroy(taskq_zone); +} +SYSUNINIT(system_taskq_fini, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_fini, NULL); + +taskq_t * +taskq_create(const char *name, int nthreads, pri_t pri, int minalloc __unused, + int maxalloc __unused, uint_t flags) +{ + taskq_t *tq; + + if ((flags & TASKQ_THREADS_CPU_PCT) != 0) { + /* TODO: Calculate number od threads. */ + printf("%s: TASKQ_THREADS_CPU_PCT\n", __func__); + } + + tq = kmem_alloc(sizeof(*tq), KM_SLEEP); + tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, + &tq->tq_queue); + (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, name); + + return ((taskq_t *)tq); +} + +void +taskq_destroy(taskq_t *tq) +{ + + taskqueue_free(tq->tq_queue); + kmem_free(tq, sizeof(*tq)); +} + +int +taskq_member(taskq_t *tq, kthread_t *thread) +{ + + return (taskqueue_member(tq->tq_queue, thread)); +} + +static void +taskq_run(void *arg, int pending __unused) +{ + struct ostask *task = arg; + + task->ost_func(task->ost_arg); + + uma_zfree(taskq_zone, task); +} + +taskqid_t +taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t flags) +{ + struct ostask *task; + int mflag; + + if ((flags & (TQ_SLEEP | TQ_NOQUEUE)) == TQ_SLEEP) + mflag = M_WAITOK; + else + mflag = M_NOWAIT; + + task = uma_zalloc(taskq_zone, mflag); + if (task == NULL) + return (0); + + task->ost_func = func; + task->ost_arg = arg; + + TASK_INIT(&task->ost_task, 0, taskq_run, task); + taskqueue_enqueue(tq->tq_queue, &task->ost_task); + + return ((taskqid_t)(void *)task); +} Modified: stable/7/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Wed Jan 6 08:18:49 2010 (r201633) @@ -75,7 +75,6 @@ vn_is_readonly(vnode_t *vp) #define VN_HOLD(v) vref(v) #define VN_RELE(v) vrele(v) #define VN_URELE(v) vput(v) -#define VN_RELE_ASYNC(v, tq) vn_rele_async(v, tq); #define VOP_REALVP(vp, vpp, ct) (*(vpp) = (vp), 0) Modified: stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c Wed Jan 6 08:18:49 2010 (r201633) @@ -2523,14 +2523,15 @@ nvpair_native_embedded(nvstream_t *nvs, { if (nvs->nvs_op == NVS_OP_ENCODE) { nvs_native_t *native = (nvs_native_t *)nvs->nvs_private; - nvlist_t *packed = (void *) + char *packed = (void *) (native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp)); /* * Null out the pointer that is meaningless in the packed * structure. The address may not be aligned, so we have * to use bzero. */ - bzero(&packed->nvl_priv, sizeof (packed->nvl_priv)); + bzero(packed + offsetof(nvlist_t, nvl_priv), + sizeof(((nvlist_t *)NULL)->nvl_priv)); } return (nvs_embedded(nvs, EMBEDDED_NVL(nvp))); @@ -2543,7 +2544,6 @@ nvpair_native_embedded_array(nvstream_t nvs_native_t *native = (nvs_native_t *)nvs->nvs_private; char *value = native->n_curr - nvp->nvp_size + NVP_VALOFF(nvp); size_t len = NVP_NELEM(nvp) * sizeof (uint64_t); - nvlist_t *packed = (nvlist_t *)((uintptr_t)value + len); int i; /* * Null out pointers that are meaningless in the packed @@ -2552,13 +2552,17 @@ nvpair_native_embedded_array(nvstream_t */ bzero(value, len); - for (i = 0; i < NVP_NELEM(nvp); i++, packed++) + value += len; + for (i = 0; i < NVP_NELEM(nvp); i++) { /* * Null out the pointer that is meaningless in the * packed structure. The address may not be aligned, * so we have to use bzero. */ - bzero(&packed->nvl_priv, sizeof (packed->nvl_priv)); + bzero(value + offsetof(nvlist_t, nvl_priv), + sizeof(((nvlist_t *)NULL)->nvl_priv)); + value += sizeof(nvlist_t); + } } return (nvs_embedded_nvl_array(nvs, nvp, NULL)); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Wed Jan 6 08:18:49 2010 (r201633) @@ -564,8 +564,13 @@ gfs_file_inactive(vnode_t *vp) if (fp->gfs_parent == NULL || (vp->v_flag & V_XATTRDIR)) goto found; - dp = fp->gfs_parent->v_data; - + /* + * XXX cope with a FreeBSD-specific race wherein the parent's + * snapshot data can be freed before the parent is + */ + if ((dp = fp->gfs_parent->v_data) == NULL) + return (NULL); + /* * First, see if this vnode is cached in the parent. */ Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c Wed Jan 6 08:18:49 2010 (r201633) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -36,9 +36,6 @@ * contributors. */ - -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -76,15 +73,12 @@ xva_getxoptattr(xvattr_t *xvap) return (xoap); } -static STAILQ_HEAD(, vnode) vn_rele_async_list; -static struct mtx vn_rele_async_lock; -static struct cv vn_rele_async_cv; -static int vn_rele_list_length; -static int vn_rele_async_thread_exit; - -typedef struct { - struct vnode *stqe_next; -} vnode_link_t; +static void +vn_rele_inactive(vnode_t *vp) +{ + + vrele(vp); +} /* * Like vn_rele() except if we are going to call VOP_INACTIVE() then do it @@ -97,117 +91,16 @@ typedef struct { * This is because taskqs throttle back allocation if too many are created. */ void -vn_rele_async(vnode_t *vp, taskq_t *taskq /* unused */) +vn_rele_async(vnode_t *vp, taskq_t *taskq) { - - KASSERT(vp != NULL, ("vrele: null vp")); - VFS_ASSERT_GIANT(vp->v_mount); + VERIFY(vp->v_count > 0); VI_LOCK(vp); - - if (vp->v_usecount > 1 || ((vp->v_iflag & VI_DOINGINACT) && - vp->v_usecount == 1)) { - vp->v_usecount--; - vdropl(vp); - return; - } - if (vp->v_usecount != 1) { -#ifdef DIAGNOSTIC - vprint("vrele: negative ref count", vp); -#endif + if (vp->v_count == 1 && !(vp->v_iflag & VI_DOINGINACT)) { VI_UNLOCK(vp); - panic("vrele: negative ref cnt"); - } - /* - * We are exiting - */ - if (vn_rele_async_thread_exit != 0) { - vrele(vp); + VERIFY(taskq_dispatch((taskq_t *)taskq, + (task_func_t *)vn_rele_inactive, vp, TQ_SLEEP) != 0); return; } - - mtx_lock(&vn_rele_async_lock); - - /* STAILQ_INSERT_TAIL */ - (*(vnode_link_t *)&vp->v_cstart).stqe_next = NULL; - *vn_rele_async_list.stqh_last = vp; - vn_rele_async_list.stqh_last = - &((vnode_link_t *)&vp->v_cstart)->stqe_next; - - /****************************************/ - vn_rele_list_length++; - if ((vn_rele_list_length % 100) == 0) - cv_signal(&vn_rele_async_cv); - mtx_unlock(&vn_rele_async_lock); - VI_UNLOCK(vp); -} - -static void -vn_rele_async_init(void *arg) -{ - - mtx_init(&vn_rele_async_lock, "valock", NULL, MTX_DEF); - STAILQ_INIT(&vn_rele_async_list); - - /* cv_init(&vn_rele_async_cv, "vacv"); */ - vn_rele_async_cv.cv_description = "vacv"; - vn_rele_async_cv.cv_waiters = 0; -} - -void -vn_rele_async_fini(void) -{ - - mtx_lock(&vn_rele_async_lock); - vn_rele_async_thread_exit = 1; - cv_signal(&vn_rele_async_cv); - while (vn_rele_async_thread_exit != 0) - cv_wait(&vn_rele_async_cv, &vn_rele_async_lock); - mtx_unlock(&vn_rele_async_lock); - mtx_destroy(&vn_rele_async_lock); -} - - -static void -vn_rele_async_cleaner(void) -{ - STAILQ_HEAD(, vnode) vn_tmp_list; - struct vnode *curvnode; - - STAILQ_INIT(&vn_tmp_list); - mtx_lock(&vn_rele_async_lock); - while (vn_rele_async_thread_exit == 0) { - STAILQ_CONCAT(&vn_tmp_list, &vn_rele_async_list); - vn_rele_list_length = 0; - mtx_unlock(&vn_rele_async_lock); - - while (!STAILQ_EMPTY(&vn_tmp_list)) { - curvnode = STAILQ_FIRST(&vn_tmp_list); - - /* STAILQ_REMOVE_HEAD */ - STAILQ_FIRST(&vn_tmp_list) = - ((vnode_link_t *)&curvnode->v_cstart)->stqe_next; - if (STAILQ_FIRST(&vn_tmp_list) == NULL) - vn_tmp_list.stqh_last = &STAILQ_FIRST(&vn_tmp_list); - /***********************/ - vrele(curvnode); - } - mtx_lock(&vn_rele_async_lock); - if (vn_rele_list_length == 0) - cv_timedwait(&vn_rele_async_cv, &vn_rele_async_lock, - hz/10); - } - - vn_rele_async_thread_exit = 0; - cv_broadcast(&vn_rele_async_cv); - mtx_unlock(&vn_rele_async_lock); - thread_exit(); + vp->v_usecount--; + vdropl(vp); } - -static struct proc *vn_rele_async_proc; -static struct kproc_desc up_kp = { - "vaclean", - vn_rele_async_cleaner, - &vn_rele_async_proc -}; -SYSINIT(vaclean, SI_SUB_KTHREAD_UPDATE, SI_ORDER_FIRST, kproc_start, &up_kp); -SYSINIT(vn_rele_async_setup, SI_SUB_VFS, SI_ORDER_FIRST, vn_rele_async_init, NULL); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Wed Jan 6 08:18:49 2010 (r201633) @@ -1199,9 +1199,6 @@ dmu_init(void) void dmu_fini(void) { -#ifdef _KERNEL - vn_rele_async_fini(); -#endif arc_fini(); dnode_fini(); dbuf_fini(); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Wed Jan 6 08:18:49 2010 (r201633) @@ -91,6 +91,9 @@ dsl_pool_open_impl(spa_t *spa, uint64_t mutex_init(&dp->dp_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&dp->dp_scrub_cancel_lock, NULL, MUTEX_DEFAULT, NULL); + dp->dp_vnrele_taskq = taskq_create("zfs_vn_rele_taskq", 1, minclsyspri, + 1, 4, 0); + return (dp); } @@ -228,6 +231,7 @@ dsl_pool_close(dsl_pool_t *dp) rw_destroy(&dp->dp_config_rwlock); mutex_destroy(&dp->dp_lock); mutex_destroy(&dp->dp_scrub_cancel_lock); + taskq_destroy(dp->dp_vnrele_taskq); kmem_free(dp, sizeof (dsl_pool_t)); } @@ -611,3 +615,9 @@ dsl_pool_create_origin(dsl_pool_t *dp, d dsl_dataset_rele(ds, FTAG); rw_exit(&dp->dp_config_rwlock); } + +taskq_t * +dsl_pool_vnrele_taskq(dsl_pool_t *dp) +{ + return (dp->dp_vnrele_taskq); +} Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Wed Jan 6 08:18:49 2010 (r201633) @@ -57,6 +57,7 @@ typedef struct dsl_pool { struct dsl_dir *dp_mos_dir; struct dsl_dataset *dp_origin_snap; uint64_t dp_root_dir_obj; + struct taskq *dp_vnrele_taskq; /* No lock needed - sync context only */ blkptr_t dp_meta_rootbp; @@ -119,6 +120,8 @@ int dsl_pool_scrub_clean(dsl_pool_t *dp) void dsl_pool_scrub_sync(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_scrub_restart(dsl_pool_t *dp); +taskq_t *dsl_pool_vnrele_taskq(dsl_pool_t *dp); + #ifdef __cplusplus } #endif Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h Wed Jan 6 08:18:49 2010 (r201633) @@ -49,6 +49,7 @@ extern "C" { #include #include #include +#include #include #include #include Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jan 6 08:18:49 2010 (r201633) @@ -78,7 +78,11 @@ extern "C" { /* * Is ID ephemeral? */ +#ifdef TODO #define IS_EPHEMERAL(x) (x > MAXUID) +#else +#define IS_EPHEMERAL(x) (0) +#endif /* * Should we use FUIDs? Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 6 08:18:49 2010 (r201633) @@ -3057,44 +3057,35 @@ zfsdev_fini(void) destroy_dev(zfsdev); } -static struct task zfs_start_task; static struct root_hold_token *zfs_root_token; - uint_t zfs_fsyncer_key; extern uint_t rrw_tsd_key; -static void -zfs_start(void *context __unused, int pending __unused) -{ - - zfsdev_init(); - spa_init(FREAD | FWRITE); - zfs_init(); - zvol_init(); - - tsd_create(&zfs_fsyncer_key, NULL); - tsd_create(&rrw_tsd_key, NULL); - - printf("ZFS storage pool version " SPA_VERSION_STRING "\n"); - root_mount_rel(zfs_root_token); -} - static int zfs_modevent(module_t mod, int type, void *unused __unused) { - int error; + int error = 0; - error = EOPNOTSUPP; switch (type) { case MOD_LOAD: zfs_root_token = root_mount_hold("ZFS"); printf("WARNING: ZFS is considered to be an experimental " "feature in FreeBSD.\n"); - TASK_INIT(&zfs_start_task, 0, zfs_start, NULL); - taskqueue_enqueue(taskqueue_thread, &zfs_start_task); + mutex_init(&zfs_share_lock, NULL, MUTEX_DEFAULT, NULL); - error = 0; + + spa_init(FREAD | FWRITE); + zfs_init(); + zvol_init(); + + tsd_create(&zfs_fsyncer_key, NULL); + tsd_create(&rrw_tsd_key, NULL); + + printf("ZFS storage pool version " SPA_VERSION_STRING "\n"); + root_mount_rel(zfs_root_token); + + zfsdev_init(); break; case MOD_UNLOAD: if (spa_busy() || zfs_busy() || zvol_busy() || @@ -3102,14 +3093,19 @@ zfs_modevent(module_t mod, int type, voi error = EBUSY; break; } + + zfsdev_fini(); zvol_fini(); zfs_fini(); spa_fini(); - zfsdev_fini(); + tsd_destroy(&zfs_fsyncer_key); tsd_destroy(&rrw_tsd_key); + mutex_destroy(&zfs_share_lock); - error = 0; + break; + default: + error = EOPNOTSUPP; break; } return (error); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 08:18:49 2010 (r201633) @@ -576,6 +576,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_flag |= MNT_LOCAL; vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; + vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; if (error = dsl_prop_get_integer(osname, "readonly", &readonly, NULL)) goto out; @@ -924,7 +925,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea for (zp = list_head(&zfsvfs->z_all_znodes); zp != NULL; zp = list_next(&zfsvfs->z_all_znodes, zp)) if (zp->z_dbuf) { - ASSERT(ZTOV(zp)->v_count > 0); + ASSERT(ZTOV(zp)->v_count >= 0); zfs_znode_dmu_fini(zp); } mutex_exit(&zfsvfs->z_znodes_lock); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 08:18:49 2010 (r201633) @@ -925,6 +925,7 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) zgd_t *zgd = (zgd_t *)vzgd; rl_t *rl = zgd->zgd_rl; vnode_t *vp = ZTOV(rl->r_zp); + objset_t *os = rl->r_zp->z_zfsvfs->z_os; int vfslocked; vfslocked = VFS_LOCK_GIANT(vp->v_vfsp); @@ -934,7 +935,7 @@ zfs_get_done(dmu_buf_t *db, void *vzgd) * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(vp, NULL); + VN_RELE_ASYNC(vp, dsl_pool_vnrele_taskq(dmu_objset_pool(os))); zil_add_block(zgd->zgd_zilog, zgd->zgd_bp); kmem_free(zgd, sizeof (zgd_t)); VFS_UNLOCK_GIANT(vfslocked); @@ -969,8 +970,8 @@ zfs_get_data(void *arg, lr_write_t *lr, * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(ZTOV(zp), NULL); - + VN_RELE_ASYNC(ZTOV(zp), + dsl_pool_vnrele_taskq(dmu_objset_pool(os))); return (ENOENT); } @@ -1046,7 +1047,7 @@ out: * Release the vnode asynchronously as we currently have the * txg stopped from syncing. */ - VN_RELE_ASYNC(ZTOV(zp), NULL); + VN_RELE_ASYNC(ZTOV(zp), dsl_pool_vnrele_taskq(dmu_objset_pool(os))); return (error); } @@ -3709,12 +3710,11 @@ zfs_inactive(vnode_t *vp, cred_t *cr, ca * The fs has been unmounted, or we did a * suspend/resume and this file no longer exists. */ - mutex_enter(&zp->z_lock); VI_LOCK(vp); vp->v_count = 0; /* count arrives as 1 */ - mutex_exit(&zp->z_lock); + VI_UNLOCK(vp); + vrecycle(vp, curthread); rw_exit(&zfsvfs->z_teardown_inactive_lock); - zfs_znode_free(zp); return; } @@ -3963,7 +3963,7 @@ static int zfs_freebsd_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_accmode; + accmode_t a_accmode; struct ucred *a_cred; struct thread *a_td; } */ *ap; @@ -4355,7 +4355,6 @@ zfs_freebsd_reclaim(ap) { vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); - zfsvfs_t *zfsvfs; ASSERT(zp != NULL); @@ -4365,13 +4364,18 @@ zfs_freebsd_reclaim(ap) vnode_destroy_vobject(vp); mutex_enter(&zp->z_lock); - ASSERT(zp->z_phys); + ASSERT(zp->z_phys != NULL); ZTOV(zp) = NULL; - if (!zp->z_unlinked) { + mutex_exit(&zp->z_lock); + + if (zp->z_unlinked) + ; /* Do nothing. */ + else if (zp->z_dbuf == NULL) + zfs_znode_free(zp); + else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ { + zfsvfs_t *zfsvfs = zp->z_zfsvfs; int locked; - zfsvfs = zp->z_zfsvfs; - mutex_exit(&zp->z_lock); locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 : ZFS_OBJ_HOLD_TRYENTER(zfsvfs, zp->z_id); if (locked == 0) { @@ -4387,8 +4391,6 @@ zfs_freebsd_reclaim(ap) ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); zfs_znode_free(zp); } - } else { - mutex_exit(&zp->z_lock); } VI_LOCK(vp); vp->v_data = NULL; @@ -4702,6 +4704,9 @@ vop_listextattr { ZFS_ENTER(zfsvfs); + if (sizep != NULL) + *sizep = 0; + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { @@ -4726,9 +4731,6 @@ vop_listextattr { auio.uio_rw = UIO_READ; auio.uio_offset = 0; - if (sizep != NULL) - *sizep = 0; - do { u_char nlen; Copied: stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h (from r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h Wed Jan 6 08:18:49 2010 (r201633, copy of r196295, head/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h) @@ -0,0 +1,90 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_TASKQ_H +#define _SYS_TASKQ_H + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define TASKQ_NAMELEN 31 + +struct taskqueue; +struct taskq { + struct taskqueue *tq_queue; +}; + +typedef struct taskq taskq_t; +typedef uintptr_t taskqid_t; +typedef void (task_func_t)(void *); + +/* + * Public flags for taskq_create(): bit range 0-15 + */ +#define TASKQ_PREPOPULATE 0x0001 /* Prepopulate with threads and data */ +#define TASKQ_CPR_SAFE 0x0002 /* Use CPR safe protocol */ +#define TASKQ_DYNAMIC 0x0004 /* Use dynamic thread scheduling */ +#define TASKQ_THREADS_CPU_PCT 0x0008 /* number of threads as % of ncpu */ + +/* + * Flags for taskq_dispatch. TQ_SLEEP/TQ_NOSLEEP should be same as + * KM_SLEEP/KM_NOSLEEP. + */ +#define TQ_SLEEP 0x00 /* Can block for memory */ +#define TQ_NOSLEEP 0x01 /* cannot block for memory; may fail */ +#define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */ +#define TQ_NOALLOC 0x04 /* cannot allocate memory; may fail */ + +#ifdef _KERNEL + +extern taskq_t *system_taskq; + +extern void taskq_init(void); +extern void taskq_mp_init(void); + +extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t); +extern taskq_t *taskq_create_instance(const char *, int, int, pri_t, int, + int, uint_t); +extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t); +extern void nulltask(void *); +extern void taskq_destroy(taskq_t *); +extern void taskq_wait(taskq_t *); +extern void taskq_suspend(taskq_t *); +extern int taskq_suspended(taskq_t *); +extern void taskq_resume(taskq_t *); +extern int taskq_member(taskq_t *, kthread_t *); + +#endif /* _KERNEL */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_TASKQ_H */ Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Wed Jan 6 08:18:49 2010 (r201633) @@ -354,6 +354,11 @@ typedef struct caller_context { } caller_context_t; /* + * Structure tags for function prototypes, defined elsewhere. + */ +struct taskq; + +/* * Flags for VOP_LOOKUP * * Defined in file.h, but also possible, FIGNORECASE @@ -370,6 +375,13 @@ typedef struct caller_context { #define V_RDDIR_ENTFLAGS 0x01 /* request dirent flags */ /* + * Public vnode manipulation functions. + */ +#ifdef _KERNEL + +void vn_rele_async(struct vnode *vp, struct taskq *taskq); + +/* * Extensible vnode attribute (xva) routines: * xva_init() initializes an xvattr_t (zero struct, init mapsize, set AT_XATTR) * xva_getxoptattr() returns a ponter to the xoptattr_t section of xvattr_t @@ -377,10 +389,12 @@ typedef struct caller_context { void xva_init(xvattr_t *); xoptattr_t *xva_getxoptattr(xvattr_t *); /* Get ptr to xoptattr_t */ -struct taskq; -void vn_rele_async(struct vnode *vp, struct taskq *taskq); -void vn_rele_async_fini(void); - +#define VN_RELE_ASYNC(vp, taskq) { \ + vn_rele_async(vp, taskq); \ +} + +#endif /* _KERNEL */ + /* * Flags to VOP_SETATTR/VOP_GETATTR. */ Modified: stable/7/sys/cddl/dev/cyclic/cyclic.c ============================================================================== --- stable/7/sys/cddl/dev/cyclic/cyclic.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/dev/cyclic/cyclic.c Wed Jan 6 08:18:49 2010 (r201633) @@ -1341,12 +1341,11 @@ cyclic_mp_init(void) static void cyclic_uninit(void) { - struct pcpu *pc; cpu_t *c; int id; for (id = 0; id <= mp_maxid; id++) { - if ((pc = pcpu_find(id)) == NULL) + if (pcpu_find(id) == NULL) continue; c = &solaris_cpu[id]; Modified: stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Wed Jan 6 08:18:49 2010 (r201633) @@ -408,7 +408,6 @@ dtrace_gethrtime_init(void *arg) uint64_t tsc_f; cpumask_t map; int i; - struct pcpu *cp; /* * Get TSC frequency known at this moment. @@ -444,7 +443,7 @@ dtrace_gethrtime_init(void *arg) if (i == curcpu) continue; - if ((cp = pcpu_find(i)) == NULL) + if (pcpu_find(i) == NULL) continue; map = 0; Modified: stable/7/sys/kern/subr_taskqueue.c ============================================================================== --- stable/7/sys/kern/subr_taskqueue.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/kern/subr_taskqueue.c Wed Jan 6 08:18:49 2010 (r201633) @@ -463,3 +463,32 @@ taskqueue_fast_run(void *dummy) TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, 0, swi_add(NULL, "Fast task queue", taskqueue_fast_run, NULL, SWI_TQ_FAST, INTR_MPSAFE, &taskqueue_fast_ih)); + +int +taskqueue_member(struct taskqueue *queue, struct thread *td) +{ + int i, j, ret = 0; + struct thread *ptd; + + TQ_LOCK(queue); + for (i = 0, j = 0; ; i++) { + if (queue->tq_pproc[i] == NULL) + continue; + ptd = FIRST_THREAD_IN_PROC(queue->tq_pproc[i]); + /* + * In releng7 all kprocs have only one kthread, so there is + * no need to use FOREACH_THREAD_IN_PROC instead. + * If this changes at some point, only the first 'if' needs + * to be included in the FOREACH_..., the second one can + * stay as it is. + */ + if (ptd == td) { + ret = 1; + break; + } + if (++j >= queue->tq_pcount) + break; + } + TQ_UNLOCK(queue); + return (ret); +} Modified: stable/7/sys/kern/vfs_vnops.c ============================================================================== --- stable/7/sys/kern/vfs_vnops.c Wed Jan 6 07:50:27 2010 (r201632) +++ stable/7/sys/kern/vfs_vnops.c Wed Jan 6 08:18:49 2010 (r201633) @@ -351,7 +351,7 @@ vn_rdwr(rw, vp, base, len, offset, segfl struct iovec aiov; struct mount *mp; struct ucred *cred; - int error; + int error, lock_flags; VFS_ASSERT_GIANT(vp->v_mount); @@ -362,12 +362,23 @@ vn_rdwr(rw, vp, base, len, offset, segfl (error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 08:26:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B38106568F; Wed, 6 Jan 2010 08:26:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660C28FC13; Wed, 6 Jan 2010 08:26:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o068QhjC066983; Wed, 6 Jan 2010 08:26:43 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o068QhqH066981; Wed, 6 Jan 2010 08:26:43 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001060826.o068QhqH066981@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 6 Jan 2010 08:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201634 - in stable: 7/usr.bin/fetch 8/usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 08:26:43 -0000 Author: ru Date: Wed Jan 6 08:26:43 2010 New Revision: 201634 URL: http://svn.freebsd.org/changeset/base/201634 Log: MFC r201290: Treat an empty argument as an error, instead of fetching the contents of the root directory. Modified: stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Changes in other areas also in this revision: Modified: stable/7/usr.bin/fetch/fetch.c Directory Properties: stable/7/usr.bin/fetch/ (props changed) Modified: stable/8/usr.bin/fetch/fetch.c ============================================================================== --- stable/8/usr.bin/fetch/fetch.c Wed Jan 6 08:18:49 2010 (r201633) +++ stable/8/usr.bin/fetch/fetch.c Wed Jan 6 08:26:43 2010 (r201634) @@ -340,6 +340,11 @@ fetch(char *URL, const char *path) fetchDebug = 1; /* parse URL */ + url = NULL; + if (*URL == '\0') { + warnx("empty URL"); + goto failure; + } if ((url = fetchParseURL(URL)) == NULL) { warnx("%s: parse error", URL); goto failure; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 08:26:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 971161065692; Wed, 6 Jan 2010 08:26:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8593A8FC1D; Wed, 6 Jan 2010 08:26:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o068Qh5v066989; Wed, 6 Jan 2010 08:26:43 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o068QhnS066987; Wed, 6 Jan 2010 08:26:43 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001060826.o068QhnS066987@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 6 Jan 2010 08:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201634 - in stable: 7/usr.bin/fetch 8/usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 08:26:43 -0000 Author: ru Date: Wed Jan 6 08:26:43 2010 New Revision: 201634 URL: http://svn.freebsd.org/changeset/base/201634 Log: MFC r201290: Treat an empty argument as an error, instead of fetching the contents of the root directory. Modified: stable/7/usr.bin/fetch/fetch.c Directory Properties: stable/7/usr.bin/fetch/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/fetch/fetch.c Directory Properties: stable/8/usr.bin/fetch/ (props changed) Modified: stable/7/usr.bin/fetch/fetch.c ============================================================================== --- stable/7/usr.bin/fetch/fetch.c Wed Jan 6 08:18:49 2010 (r201633) +++ stable/7/usr.bin/fetch/fetch.c Wed Jan 6 08:26:43 2010 (r201634) @@ -340,6 +340,11 @@ fetch(char *URL, const char *path) fetchDebug = 1; /* parse URL */ + url = NULL; + if (*URL == '\0') { + warnx("empty URL"); + goto failure; + } if ((url = fetchParseURL(URL)) == NULL) { warnx("%s: parse error", URL); goto failure; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 08:45:55 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C86B7106566C; Wed, 6 Jan 2010 08:45:55 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 8E09A8FC1E; Wed, 6 Jan 2010 08:45:55 +0000 (UTC) Received: from dragon.nuxi.org (smmsp@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.3/8.14.3) with ESMTP id o068jiwb060784; Wed, 6 Jan 2010 00:45:55 -0800 (PST) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.3/8.14.3/Submit) id o04J0iPY065050; Mon, 4 Jan 2010 11:00:44 -0800 (PST) (envelope-from obrien) Date: Mon, 4 Jan 2010 11:00:44 -0800 From: "David O'Brien" To: "Bjoern A. Zeeb" Message-ID: <20100104190044.GA64848@dragon.NUXI.org> References: <20100104131712.W88477@maildrop.int.zabbadoz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100104131712.W88477@maildrop.int.zabbadoz.net> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: SPAM(3.9) Re: svn commit: r201494 - stable/7/usr.sbin/fifolog/fifolog_create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@NUXI.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 08:45:55 -0000 On Mon, Jan 04, 2010 at 01:18:20PM +0000, Bjoern A. Zeeb wrote: >> Log: >> Spell the full word "February". >> >> Submitted by: pluknet@gmail.com > > Is there reason not to ask ru@ to MFC 178068 and/or 190693 insetad? Nope. Just trying to [quickly] respond to a reasonable request from a user. From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 09:09:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 681C4106566B; Wed, 6 Jan 2010 09:09:31 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C60E8FC0A; Wed, 6 Jan 2010 09:09:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0699V1U076639; Wed, 6 Jan 2010 09:09:31 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0699V2T076638; Wed, 6 Jan 2010 09:09:31 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001060909.o0699V2T076638@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 09:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201635 - in stable/7/sys: . cddl/contrib/opensolaris contrib/dev/acpica contrib/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 09:09:31 -0000 Author: netchild Date: Wed Jan 6 09:09:30 2010 New Revision: 201635 URL: http://svn.freebsd.org/changeset/base/201635 Log: Fix meta data, r196309 is not merged. Modified: Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 10:21:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E734510656A3; Wed, 6 Jan 2010 10:21:17 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB97B8FC29; Wed, 6 Jan 2010 10:21:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06ALHEf092586; Wed, 6 Jan 2010 10:21:17 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06ALHKS092584; Wed, 6 Jan 2010 10:21:17 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001061021.o06ALHKS092584@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 10:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201636 - in stable/7/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 10:21:18 -0000 Author: netchild Date: Wed Jan 6 10:21:16 2010 New Revision: 201636 URL: http://svn.freebsd.org/changeset/base/201636 Log: MFC several ZFS related commits: r196456: ---snip--- - Give minclsyspri and maxclsyspri real values (consulted with kmacy). - Honour 'pri' argument for thread_create(). ---snip--- r196457: ---snip--- Set priority of vdev_geom threads and zvol threads to PRIBIO. ---snip--- Modified: stable/7/sys/cddl/compat/opensolaris/sys/mutex.h stable/7/sys/cddl/compat/opensolaris/sys/proc.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/mutex.h Wed Jan 6 09:09:30 2010 (r201635) +++ stable/7/sys/cddl/compat/opensolaris/sys/mutex.h Wed Jan 6 10:21:16 2010 (r201636) @@ -32,9 +32,9 @@ #ifdef _KERNEL #include -#include #include #include_next +#include #include typedef enum { Modified: stable/7/sys/cddl/compat/opensolaris/sys/proc.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/proc.h Wed Jan 6 09:09:30 2010 (r201635) +++ stable/7/sys/cddl/compat/opensolaris/sys/proc.h Wed Jan 6 10:21:16 2010 (r201636) @@ -34,13 +34,16 @@ #include_next #include #include +#include +#include +#include #include #ifdef _KERNEL #define CPU curcpu -#define minclsyspri 0 -#define maxclsyspri 0 +#define minclsyspri PRIBIO +#define maxclsyspri PVM #define max_ncpus mp_ncpus #define boot_max_ncpus mp_ncpus @@ -64,6 +67,7 @@ static __inline kthread_t * thread_create(caddr_t stk, size_t stksize, void (*proc)(void *), void *arg, size_t len, proc_t *pp, int state, pri_t pri) { + kthread_t *td; proc_t *p; int error; @@ -76,7 +80,15 @@ thread_create(caddr_t stk, size_t stksiz error = kthread_create(proc, arg, &p, 0, ZFS_KSTACK_PAGES, "solthread %p", proc); - return (error == 0 ? FIRST_THREAD_IN_PROC(p) : NULL); + if (error != 0) + td = NULL; + else { + td = FIRST_THREAD_IN_PROC(p); + thread_lock(td); + sched_prio(td, pri); + thread_unlock(td); + } + return (td); } #define thread_exit() kthread_exit(0) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 6 09:09:30 2010 (r201635) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 6 10:21:16 2010 (r201636) @@ -194,6 +194,10 @@ vdev_geom_worker(void *arg) zio_t *zio; struct bio *bp; + thread_lock(curthread); + sched_prio(curthread, PRIBIO); + thread_unlock(curthread); + ctx = arg; for (;;) { mtx_lock(&ctx->gc_queue_mtx); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Jan 6 09:09:30 2010 (r201635) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Jan 6 10:21:16 2010 (r201636) @@ -402,6 +402,10 @@ zvol_worker(void *arg) zvol_state_t *zv; struct bio *bp; + thread_lock(curthread); + sched_prio(curthread, PRIBIO); + thread_unlock(curthread); + zv = arg; for (;;) { mtx_lock(&zv->zv_queue_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 13:13:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 479D81065672; Wed, 6 Jan 2010 13:13:15 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3729A8FC0C; Wed, 6 Jan 2010 13:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06DDFdc033235; Wed, 6 Jan 2010 13:13:15 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06DDFaP033233; Wed, 6 Jan 2010 13:13:15 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201001061313.o06DDFaP033233@svn.freebsd.org> From: Rui Paulo Date: Wed, 6 Jan 2010 13:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201644 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 13:13:15 -0000 Author: rpaulo Date: Wed Jan 6 13:13:14 2010 New Revision: 201644 URL: http://svn.freebsd.org/changeset/base/201644 Log: len must be int, not size_t Submitted by: novel Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Wed Jan 6 12:43:59 2010 (r201643) +++ head/sys/dev/if_ndis/if_ndis.c Wed Jan 6 13:13:14 2010 (r201644) @@ -2243,7 +2243,7 @@ ndis_media_status(struct ifnet *ifp, str struct ieee80211vap *vap = ifp->if_softc; struct ndis_softc *sc = vap->iv_ic->ic_ifp->if_softc; uint32_t txrate; - size_t len; + int len; if (!NDIS_INITIALIZED(sc)) return; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 13:14:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70F7106566B; Wed, 6 Jan 2010 13:14:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CCA38FC12; Wed, 6 Jan 2010 13:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06DEbxf033570; Wed, 6 Jan 2010 13:14:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06DEb8t033566; Wed, 6 Jan 2010 13:14:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001061314.o06DEb8t033566@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jan 2010 13:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201645 - in head/sys/geom: . part uzip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 13:14:37 -0000 Author: mav Date: Wed Jan 6 13:14:37 2010 New Revision: 201645 URL: http://svn.freebsd.org/changeset/base/201645 Log: Change the way in which zero stripesize is handled. Instead of reporting zero stripeoffset in such case (as if device has no stripes), report offset from the beginning of the media (as if device has single infinite stripe). This gives partitioning tools information, required to guess better partition alignment, in case if hardware doesn't report it's stripe size. For example, it should give disklabel info about odd offset made by fdisk. Modified: head/sys/geom/geom_slice.c head/sys/geom/part/g_part.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/geom_slice.c ============================================================================== --- head/sys/geom/geom_slice.c Wed Jan 6 13:13:14 2010 (r201644) +++ head/sys/geom/geom_slice.c Wed Jan 6 13:14:37 2010 (r201645) @@ -393,10 +393,10 @@ g_slice_config(struct g_geom *gp, u_int pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; pp->flags = pp2->flags & G_PF_CANDELETE; - if (pp2->stripesize > 0) { - pp->stripesize = pp2->stripesize; - pp->stripeoffset = (pp2->stripeoffset + offset) % pp->stripesize; - } + pp->stripesize = pp2->stripesize; + pp->stripeoffset = pp2->stripeoffset + offset; + if (pp->stripesize > 0) + pp->stripeoffset %= pp->stripesize; if (0 && bootverbose) printf("GEOM: Configure %s, start %jd length %jd end %jd\n", pp->name, (intmax_t)offset, (intmax_t)length, Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Jan 6 13:13:14 2010 (r201644) +++ head/sys/geom/part/g_part.c Wed Jan 6 13:14:37 2010 (r201645) @@ -288,11 +288,10 @@ g_part_new_provider(struct g_geom *gp, s entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - entry->gpe_pp->stripesize = pp->stripesize; - entry->gpe_pp->stripeoffset = (pp->stripeoffset + - entry->gpe_offset) % pp->stripesize; - } + entry->gpe_pp->stripesize = pp->stripesize; + entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; + if (pp->stripesize > 0) + entry->gpe_pp->stripeoffset %= pp->stripesize; g_error_provider(entry->gpe_pp, 0); } Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Wed Jan 6 13:13:14 2010 (r201644) +++ head/sys/geom/uzip/g_uzip.c Wed Jan 6 13:14:37 2010 (r201645) @@ -467,10 +467,8 @@ g_uzip_taste(struct g_class *mp, struct pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->flags = pp->flags & G_PF_CANDELETE; - if (pp->stripesize > 0) { - pp2->stripesize = pp->stripesize; - pp2->stripeoffset = pp->stripeoffset; - } + pp2->stripesize = pp->stripesize; + pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 13:49:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EDC21065693; Wed, 6 Jan 2010 13:49:44 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 2452C8FC18; Wed, 6 Jan 2010 13:49:44 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 54C411FFC22; Wed, 6 Jan 2010 13:49:43 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1EB7C8448E; Wed, 6 Jan 2010 14:49:43 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Stanislav Sedov References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <20100105152300.eb7a66d1.stas@FreeBSD.org> <4B43D346.4020900@FreeBSD.org> <20100105162447.7deac6d7.stas@FreeBSD.org> Date: Wed, 06 Jan 2010 14:49:42 +0100 In-Reply-To: <20100105162447.7deac6d7.stas@FreeBSD.org> (Stanislav Sedov's message of "Tue, 5 Jan 2010 16:24:47 -0800") Message-ID: <86fx6jgx6x.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 13:49:44 -0000 Stanislav Sedov writes: > Hmm, I'm not by any means the English language expert [just learning], > but isn't "invasion of" in this context is somewhat vague? I mean, > from what I see from dictionaries "invasion of smth" could mean both > the action by smth, and action against smth. Is "invasion to" > grammatically incorrect? Either "the invasion of Iraq by the US" or "the US invasion of Iraq". Never "to". DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 13:56:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D1F61065679; Wed, 6 Jan 2010 13:56:50 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0870F8FC1E; Wed, 6 Jan 2010 13:56:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Duoe8042909; Wed, 6 Jan 2010 13:56:50 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06DunOs042896; Wed, 6 Jan 2010 13:56:49 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001061356.o06DunOs042896@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 13:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201646 - in stable/7/sys/cddl: compat/opensolaris/kern contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 13:56:50 -0000 Author: netchild Date: Wed Jan 6 13:56:49 2010 New Revision: 201646 URL: http://svn.freebsd.org/changeset/base/201646 Log: MFC several ZFS related commits: r196662: ---snip--- Add missing mountpoint vnode locking. This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when regular user tries to mount dataset owned by him. ---snip--- r196703: ---snip--- Backport the 'dirtying dbuf' panic fix from newer ZFS version. Reported by: Thomas Backman ---snip--- r196919: ---snip--- bzero() on-stack argument, so mutex_init() won't misinterpret that the lock is already initialized if we have some garbage on the stack. PR: kern/135480 Reported by: Emil Mikulic ---snip--- r196927: ---snip--- Changing provider size is not really supported by GEOM, but doing so when provider is closed should be ok. When administrator requests to change ZVOL size do it immediately if ZVOL is closed or do it on last ZVOL close. PR: kern/136942 Requested by: Bernard Buri ---snip--- r196943: ---snip--- - Avoid holding mutex around M_WAITOK allocations. - Add locking for mnt_opt field. ---snip--- r196944: ---snip--- Don't recheck ownership on update mount. This will eliminate LOR between vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway. Noticed by: kib Reviewed by: kib ---snip--- r196954: ---snip--- If we have to use avl_find(), optimize a bit and use avl_insert() instead of avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()). Fix similar case in the code that is currently commented out. ---snip--- Note: This also seems to fix a previous merge hickup. r196965: ---snip--- Fix reference count leak for a case where snapshot's mount point is updated. Such situation is not supported. This problem was triggered by something like this: # zpool create tank da0 # zfs snapshot tank@snap # cd /tank/.zfs/snapshot/snap (this will mount the snapshot) # cd # mount -u nosuid /tank/.zfs/snapshot/snap (refcount leak) # zpool export tank cannot export 'tank': pool is busy ---snip--- r196985: ---snip--- Only log successful commands! Without this fix we log even unsuccessful commands executed by unprivileged users. Action is not really taken, but it is logged to pool history, which might be confusing. Reported by: Denis Ahrens ---snip--- r197151: ---snip--- Be sure not to overflow struct fid. ---snip--- r197152: ---snip--- Extend scope of the z_teardown_lock lock for consistency and "just in case". ---snip--- r200124: ---snip--- Avoid using additional variable for storing an error if we are not going to do anything with it. ---snip--- r200158: ---snip--- We have to eventually look for provider without checking guid as this is need for attaching when there is no metadata yet. Before r200125 the order of looking for providers was wrong. It was: 1. Find provider by name. 2. Find provider by guid. 3. Find provider by name and guid. Where it should have been: 1. Find provider by name and guid. 2. Find provider by guid. 3. Find provider by name. ---snip--- Note: This was already there, but it was not recorded as merged. This commit fixes a mis-merge (reversed logic). Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jan 6 13:56:49 2010 (r201646) @@ -45,20 +45,33 @@ vfs_setmntopt(vfs_t *vfsp, const char *n { struct vfsopt *opt; size_t namesize; + int locked; + + if (!(locked = mtx_owned(MNT_MTX(vfsp)))) + MNT_ILOCK(vfsp); if (vfsp->mnt_opt == NULL) { - vfsp->mnt_opt = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); - TAILQ_INIT(vfsp->mnt_opt); + void *opts; + + MNT_IUNLOCK(vfsp); + opts = malloc(sizeof(*vfsp->mnt_opt), M_MOUNT, M_WAITOK); + MNT_ILOCK(vfsp); + if (vfsp->mnt_opt == NULL) { + vfsp->mnt_opt = opts; + TAILQ_INIT(vfsp->mnt_opt); + } else { + free(opts, M_MOUNT); + } } - opt = malloc(sizeof(*opt), M_MOUNT, M_WAITOK); + MNT_IUNLOCK(vfsp); + opt = malloc(sizeof(*opt), M_MOUNT, M_WAITOK); namesize = strlen(name) + 1; opt->name = malloc(namesize, M_MOUNT, M_WAITOK); strlcpy(opt->name, name, namesize); opt->pos = -1; opt->seen = 1; - if (arg == NULL) { opt->value = NULL; opt->len = 0; @@ -67,16 +80,23 @@ vfs_setmntopt(vfs_t *vfsp, const char *n opt->value = malloc(opt->len, M_MOUNT, M_WAITOK); bcopy(arg, opt->value, opt->len); } - /* TODO: Locking. */ + + MNT_ILOCK(vfsp); TAILQ_INSERT_TAIL(vfsp->mnt_opt, opt, link); + if (!locked) + MNT_IUNLOCK(vfsp); } void vfs_clearmntopt(vfs_t *vfsp, const char *name) { + int locked; - /* TODO: Locking. */ + if (!(locked = mtx_owned(MNT_MTX(vfsp)))) + MNT_ILOCK(vfsp); vfs_deleteopt(vfsp->mnt_opt, name); + if (!locked) + MNT_IUNLOCK(vfsp); } int Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Wed Jan 6 13:56:49 2010 (r201646) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -864,10 +864,11 @@ restore_object(struct restorearg *ra, ob /* currently allocated, want to be allocated */ dmu_tx_hold_bonus(tx, drro->drr_object); /* - * We may change blocksize, so need to - * hold_write + * We may change blocksize and delete old content, + * so need to hold_write and hold_free. */ dmu_tx_hold_write(tx, drro->drr_object, 0, 1); + dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Wed Jan 6 13:56:49 2010 (r201646) @@ -415,7 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, old_nblkptr; + int i, nblkptr; dmu_buf_impl_t *db = NULL; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); @@ -445,6 +445,8 @@ dnode_reallocate(dnode_t *dn, dmu_object dnode_free_range(dn, 0, -1ULL, tx); } + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); if (blocksize != dn->dn_datablksz && @@ -457,6 +459,8 @@ dnode_reallocate(dnode_t *dn, dmu_object dnode_setdirty(dn, tx); dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_nblkptr != nblkptr) + dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); if (db) dbuf_rele(db, FTAG); @@ -466,19 +470,15 @@ dnode_reallocate(dnode_t *dn, dmu_object /* change bonus size and type */ mutex_enter(&dn->dn_mtx); - old_nblkptr = dn->dn_nblkptr; dn->dn_bonustype = bonustype; dn->dn_bonuslen = bonuslen; - dn->dn_nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + dn->dn_nblkptr = nblkptr; dn->dn_checksum = ZIO_CHECKSUM_INHERIT; dn->dn_compress = ZIO_COMPRESS_INHERIT; ASSERT3U(dn->dn_nblkptr, <=, DN_MAX_NBLKPTR); - /* XXX - for now, we can't make nblkptr smaller */ - ASSERT3U(dn->dn_nblkptr, >=, old_nblkptr); - - /* fix up the bonus db_size if dn_nblkptr has changed */ - if (dn->dn_bonus && dn->dn_bonuslen != old_nblkptr) { + /* fix up the bonus db_size */ + if (dn->dn_bonus) { dn->dn_bonus->db.db_size = DN_MAX_BONUSLEN - (dn->dn_nblkptr-1) * sizeof (blkptr_t); ASSERT(dn->dn_bonuslen <= dn->dn_bonus->db.db_size); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Wed Jan 6 13:56:49 2010 (r201646) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -534,18 +532,12 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) /* XXX shouldn't the phys already be zeroed? */ bzero(dnp, DNODE_CORE_SIZE); dnp->dn_nlevels = 1; + dnp->dn_nblkptr = dn->dn_nblkptr; } - if (dn->dn_nblkptr > dnp->dn_nblkptr) { - /* zero the new blkptrs we are gaining */ - bzero(dnp->dn_blkptr + dnp->dn_nblkptr, - sizeof (blkptr_t) * - (dn->dn_nblkptr - dnp->dn_nblkptr)); - } dnp->dn_type = dn->dn_type; dnp->dn_bonustype = dn->dn_bonustype; dnp->dn_bonuslen = dn->dn_bonuslen; - dnp->dn_nblkptr = dn->dn_nblkptr; } ASSERT(dnp->dn_nlevels > 1 || @@ -605,6 +597,30 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) return; } + if (dn->dn_next_nblkptr[txgoff]) { + /* this should only happen on a realloc */ + ASSERT(dn->dn_allocated_txg == tx->tx_txg); + if (dn->dn_next_nblkptr[txgoff] > dnp->dn_nblkptr) { + /* zero the new blkptrs we are gaining */ + bzero(dnp->dn_blkptr + dnp->dn_nblkptr, + sizeof (blkptr_t) * + (dn->dn_next_nblkptr[txgoff] - dnp->dn_nblkptr)); +#ifdef ZFS_DEBUG + } else { + int i; + ASSERT(dn->dn_next_nblkptr[txgoff] < dnp->dn_nblkptr); + /* the blkptrs we are losing better be unallocated */ + for (i = dn->dn_next_nblkptr[txgoff]; + i < dnp->dn_nblkptr; i++) + ASSERT(BP_IS_HOLE(&dnp->dn_blkptr[i])); +#endif + } + mutex_enter(&dn->dn_mtx); + dnp->dn_nblkptr = dn->dn_next_nblkptr[txgoff]; + dn->dn_next_nblkptr[txgoff] = 0; + mutex_exit(&dn->dn_mtx); + } + if (dn->dn_next_nlevels[txgoff]) { dnode_increase_indirection(dn, tx); dn->dn_next_nlevels[txgoff] = 0; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Wed Jan 6 13:56:49 2010 (r201646) @@ -1420,6 +1420,7 @@ dsl_dataset_drain_refs(dsl_dataset_t *ds { struct refsarg arg; + bzero(&arg, sizeof(arg)); mutex_init(&arg.lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&arg.cv, NULL, CV_DEFAULT, NULL); arg.gone = FALSE; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Wed Jan 6 13:56:49 2010 (r201646) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -160,6 +160,7 @@ typedef struct dnode { uint16_t dn_datablkszsec; /* in 512b sectors */ uint32_t dn_datablksz; /* in bytes */ uint64_t dn_maxblkid; + uint8_t dn_next_nblkptr[TXG_SIZE]; uint8_t dn_next_nlevels[TXG_SIZE]; uint8_t dn_next_indblkshift[TXG_SIZE]; uint16_t dn_next_bonuslen[TXG_SIZE]; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Wed Jan 6 13:56:49 2010 (r201646) @@ -293,7 +293,7 @@ vdev_geom_read_guid(struct g_consumer *c uint64_t psize; off_t offset, size; uint64_t guid; - int error, l, len; + int l, len; g_topology_assert_not(); @@ -316,8 +316,7 @@ vdev_geom_read_guid(struct g_consumer *c if ((offset % pp->sectorsize) != 0) continue; - error = vdev_geom_io(cp, BIO_READ, label, offset, size); - if (error != 0) + if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0) continue; buf = label->vl_vdev_phys.vp_nvlist; @@ -502,7 +501,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi if ((owned = mtx_owned(&Giant))) mtx_unlock(&Giant); - cp = vdev_geom_open_by_path(vd, 0); + cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the expected guid. @@ -512,7 +511,7 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi cp = vdev_geom_open_by_guid(vd); } if (cp == NULL) - cp = vdev_geom_open_by_path(vd, 1); + cp = vdev_geom_open_by_path(vd, 0); if (cp == NULL) { ZFS_LOG(1, "Provider %s not found.", vd->vdev_path); vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jan 6 13:56:49 2010 (r201646) @@ -668,9 +668,12 @@ zfsctl_snapdir_remove(vnode_t *dvp, char if (sep) { avl_remove(&sdp->sd_snaps, sep); err = zfsctl_unmount_snap(sep, MS_FORCE, cr); - if (err) - avl_add(&sdp->sd_snaps, sep); - else + if (err) { + avl_index_t where; + + if (avl_find(&sdp->sd_snaps, sep, &where) == NULL) + avl_insert(&sdp->sd_snaps, sep, where); + } else err = dmu_objset_destroy(snapname); } else { err = ENOENT; @@ -1299,7 +1302,17 @@ zfsctl_umount_snapshots(vfs_t *vfsp, int if (vn_ismntpt(sep->se_root)) { error = zfsctl_unmount_snap(sep, fflags, cr); if (error) { - avl_add(&sdp->sd_snaps, sep); + avl_index_t where; + + /* + * Before reinserting snapshot to the tree, + * check if it was actually removed. For example + * when snapshot mount point is busy, we will + * have an error here, but there will be no need + * to reinsert snapshot. + */ + if (avl_find(&sdp->sd_snaps, sep, &where) == NULL) + avl_insert(&sdp->sd_snaps, sep, where); break; } } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Jan 6 13:56:49 2010 (r201646) @@ -3022,8 +3022,10 @@ zfsdev_ioctl(struct cdev *dev, u_long cm if (error == 0) error = zfs_ioc_vec[vec].zvec_func(zc); - if (zfs_ioc_vec[vec].zvec_his_log == B_TRUE) - zfs_log_history(zc); + if (error == 0) { + if (zfs_ioc_vec[vec].zvec_his_log == B_TRUE) + zfs_log_history(zc); + } return (error); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 13:56:49 2010 (r201646) @@ -340,6 +340,13 @@ zfs_register_callbacks(vfs_t *vfsp) os = zfsvfs->z_os; /* + * This function can be called for a snapshot when we update snapshot's + * mount point, which isn't really supported. + */ + if (dmu_objset_is_snapshot(os)) + return (EOPNOTSUPP); + + /* * The act of registering our callbacks will destroy any mount * options we may have. In order to enable temporary overrides * of mount options, we stash away the current values and @@ -727,7 +734,10 @@ zfs_mount(vfs_t *vfsp, kthread_t *td) error = secpolicy_fs_mount(cr, mvp, vfsp); if (error) { error = dsl_deleg_access(osname, ZFS_DELEG_PERM_MOUNT, cr); - if (error == 0) { + if (error != 0) + goto out; + + if (!(vfsp->vfs_flag & MS_REMOUNT)) { vattr_t vattr; /* @@ -737,7 +747,9 @@ zfs_mount(vfs_t *vfsp, kthread_t *td) vattr.va_mask = AT_UID; + vn_lock(mvp, LK_SHARED | LK_RETRY, td); if (error = VOP_GETATTR(mvp, &vattr, cr, td)) { + VOP_UNLOCK(mvp, 0, td); goto out; } @@ -749,18 +761,19 @@ zfs_mount(vfs_t *vfsp, kthread_t *td) } #else if (error = secpolicy_vnode_owner(mvp, cr, vattr.va_uid)) { + VOP_UNLOCK(mvp, 0, td); goto out; } if (error = VOP_ACCESS(mvp, VWRITE, cr, td)) { + VOP_UNLOCK(mvp, 0, td); goto out; } + VOP_UNLOCK(mvp, 0, td); #endif - - secpolicy_fs_mount_clearopts(cr, vfsp); - } else { - goto out; } + + secpolicy_fs_mount_clearopts(cr, vfsp); } /* @@ -890,6 +903,9 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea * 'z_parent' is self referential for non-snapshots. */ (void) dnlc_purge_vfsp(zfsvfs->z_parent->z_vfs, 0); +#ifdef FREEBSD_NAMECACHE + cache_purgevfs(zfsvfs->z_parent->z_vfs); +#endif } /* @@ -1114,6 +1130,9 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla return (err); } +CTASSERT(SHORT_FID_LEN <= sizeof(struct fid)); +CTASSERT(LONG_FID_LEN <= sizeof(struct fid)); + static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 13:56:49 2010 (r201646) @@ -1186,8 +1186,6 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } } - ZFS_EXIT(zfsvfs); - /* Translate errors and add SAVENAME when needed. */ if (cnp->cn_flags & ISLASTCN) { switch (nameiop) { @@ -1218,6 +1216,7 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode if (error != 0) { VN_RELE(*vpp); *vpp = NULL; + ZFS_EXIT(zfsvfs); return (error); } } @@ -1239,6 +1238,8 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode } #endif + ZFS_EXIT(zfsvfs); + return (error); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Jan 6 13:14:37 2010 (r201645) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Wed Jan 6 13:56:49 2010 (r201646) @@ -153,7 +153,22 @@ static int zvol_dump_init(zvol_state_t * static void zvol_size_changed(zvol_state_t *zv, major_t maj) { + struct g_provider *pp; + + g_topology_assert(); + pp = zv->zv_provider; + if (pp == NULL) + return; + if (zv->zv_volsize == pp->mediasize) + return; + /* + * Changing provider size is not really supported by GEOM, but it + * should be safe when provider is closed. + */ + if (zv->zv_total_opens > 0) + return; + pp->mediasize = zv->zv_volsize; } int @@ -263,6 +278,7 @@ zvol_access(struct g_provider *pp, int a } zv->zv_total_opens += acr + acw + ace; + zvol_size_changed(zv, 0); mutex_exit(&zvol_state_lock); @@ -1070,11 +1086,6 @@ zvol_set_volblocksize(const char *name, if (error == ENOTSUP) error = EBUSY; dmu_tx_commit(tx); - /* XXX: Not supported. */ -#if 0 - if (error == 0) - zv->zv_provider->sectorsize = zc->zc_volblocksize; -#endif } end: mutex_exit(&zvol_state_lock); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 14:01:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9FDA1065679; Wed, 6 Jan 2010 14:01:28 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B99F88FC0A; Wed, 6 Jan 2010 14:01:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06E1SkO044016; Wed, 6 Jan 2010 14:01:28 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06E1SbJ044014; Wed, 6 Jan 2010 14:01:28 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001061401.o06E1SbJ044014@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 6 Jan 2010 14:01:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201647 - head/sbin/dumpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 14:01:28 -0000 Author: gavin Date: Wed Jan 6 14:01:28 2010 New Revision: 201647 URL: http://svn.freebsd.org/changeset/base/201647 Log: Print leading zeros in the UFS2 FSID. PR: bin/142155 Submitted by: Efstratios Karatzas gpf.kira gmail.com Approved by: ed (mentor) MFC after: 2 weeks Modified: head/sbin/dumpfs/dumpfs.c Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Wed Jan 6 13:56:49 2010 (r201646) +++ head/sbin/dumpfs/dumpfs.c Wed Jan 6 14:01:28 2010 (r201647) @@ -160,7 +160,7 @@ dumpfs(const char *name) fstime = afs.fs_old_time; printf("magic\t%x (UFS1)\ttime\t%s", afs.fs_magic, ctime(&fstime)); - printf("id\t[ %x %x ]\n", afs.fs_id[0], afs.fs_id[1]); + printf("id\t[ %08x %08x ]\n", afs.fs_id[0], afs.fs_id[1]); printf("ncg\t%d\tsize\t%jd\tblocks\t%jd\n", afs.fs_ncg, (intmax_t)fssize, (intmax_t)afs.fs_dsize); break; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 14:13:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6627D1065694; Wed, 6 Jan 2010 14:13:58 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 24E798FC1D; Wed, 6 Jan 2010 14:13:58 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 2DF5D1FFC22; Wed, 6 Jan 2010 14:13:57 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id E7099844C2; Wed, 6 Jan 2010 15:13:56 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Doug Barton References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> Date: Wed, 06 Jan 2010 15:13:56 +0100 In-Reply-To: <4B4384E3.2080600@FreeBSD.org> (Doug Barton's message of "Tue, 05 Jan 2010 10:28:51 -0800") Message-ID: <867hrvgw2j.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 14:13:58 -0000 Doug Barton writes: > First off, thanks for sorting these, that's a step in the right > direction. :) However, a few quibbles. First, our rule is that > anything which might offend someone belongs in fortunes-o, and > political quotes are always in the category of "might offend someone." I don't see how the Rumsfeld quote could offend anyone. True, Rumsfeld is a politician (and not a particularly popular one in most parts of the world), but the quote itself is not political. It is a somewhat comically worded expression of an important truism that many people would do well to remember (cf. the classical "there are no unknown bugs in our software"). Would you have suggested moving it to -o if it had been a Steve Martin quote? The Fass quote is more borderline. I guess shys^H^H^H^Hinvestment bankers might take offense. > Personally I don't see the need to mention the context, but if you do > you could add "... 2002, On the invasion of Iraq" Like you say, "of", and not "to" which is what was committed. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 14:15:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CC7010656CD; Wed, 6 Jan 2010 14:15:00 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58A4C8FC39; Wed, 6 Jan 2010 14:15:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06EF0qw047043; Wed, 6 Jan 2010 14:15:00 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06EF0Iq047041; Wed, 6 Jan 2010 14:15:00 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001061415.o06EF0Iq047041@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 14:15:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201648 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 14:15:00 -0000 Author: netchild Date: Wed Jan 6 14:14:59 2010 New Revision: 201648 URL: http://svn.freebsd.org/changeset/base/201648 Log: - Remove doublet creation of the zio_cache which was introduced in the zpool v13 commit. - Diff reduction to 8-stable (add an empty line). Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Jan 6 14:01:28 2010 (r201647) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Wed Jan 6 14:14:59 2010 (r201648) @@ -101,9 +101,6 @@ zio_init(void) zio_cache = kmem_cache_create("zio_cache", sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); - zio_cache = kmem_cache_create("zio_cache", sizeof (zio_t), 0, - NULL, NULL, NULL, NULL, NULL, 0); - #ifdef ZIO_USE_UMA /* * For small buffers, we want a cache for each multiple of @@ -425,6 +422,7 @@ zio_create(zio_t *pio, spa_t *spa, uint6 ASSERT3U(size, <=, SPA_MAXBLOCKSIZE); ASSERT(P2PHASE(size, SPA_MINBLOCKSIZE) == 0); ASSERT(P2PHASE(offset, SPA_MINBLOCKSIZE) == 0); + ASSERT(!vd || spa_config_held(spa, SCL_STATE_ALL, RW_READER)); ASSERT(!bp || !(flags & ZIO_FLAG_CONFIG_WRITER)); ASSERT(vd || stage == ZIO_STAGE_OPEN); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:04:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D949106566C; Wed, 6 Jan 2010 16:04:57 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 441508FC17; Wed, 6 Jan 2010 16:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06G4vE2071546; Wed, 6 Jan 2010 16:04:57 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06G4v5r071544; Wed, 6 Jan 2010 16:04:57 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201001061604.o06G4v5r071544@svn.freebsd.org> From: Randall Stewart Date: Wed, 6 Jan 2010 16:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201649 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:04:57 -0000 Author: rrs Date: Wed Jan 6 16:04:56 2010 New Revision: 201649 URL: http://svn.freebsd.org/changeset/base/201649 Log: adds back missing mtuexen line, LOST in CVS->SVN merge Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Jan 6 14:14:59 2010 (r201648) +++ svnadmin/conf/mentors Wed Jan 6 16:04:56 2010 (r201649) @@ -20,6 +20,7 @@ jinmei gnn lstewart gnn neel imp nork imp +mtuexen rrs rdivacky ed remko imp sbruno scottl From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:05:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D6C01065695; Wed, 6 Jan 2010 16:05:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 443858FC18; Wed, 6 Jan 2010 16:05:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06G5YFk071743; Wed, 6 Jan 2010 16:05:34 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06G5YCX071741; Wed, 6 Jan 2010 16:05:34 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201001061605.o06G5YCX071741@svn.freebsd.org> From: Randall Stewart Date: Wed, 6 Jan 2010 16:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201650 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:05:34 -0000 Author: rrs Date: Wed Jan 6 16:05:33 2010 New Revision: 201650 URL: http://svn.freebsd.org/changeset/base/201650 Log: Remove Michael From the list, he is now a full commitor :-) Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Jan 6 16:04:56 2010 (r201649) +++ svnadmin/conf/mentors Wed Jan 6 16:05:33 2010 (r201650) @@ -20,7 +20,6 @@ jinmei gnn lstewart gnn neel imp nork imp -mtuexen rrs rdivacky ed remko imp sbruno scottl From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:09:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B5E7106566C; Wed, 6 Jan 2010 16:09:59 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 362CD8FC4F; Wed, 6 Jan 2010 16:09:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06G9xMF072743; Wed, 6 Jan 2010 16:09:59 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06G9xOe072734; Wed, 6 Jan 2010 16:09:59 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001061609.o06G9xOe072734@svn.freebsd.org> From: Alexander Leidinger Date: Wed, 6 Jan 2010 16:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201651 - in stable/7/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:09:59 -0000 Author: netchild Date: Wed Jan 6 16:09:58 2010 New Revision: 201651 URL: http://svn.freebsd.org/changeset/base/201651 Log: MFC several ZFS related commits: r196980: ---snip--- When we automatically mount snapshot we want to return vnode of the mount point from the lookup and not covered vnode. This is one of the fixes for using .zfs/ over NFS. ---snip--- r196982: ---snip--- We don't export individual snapshots, so mnt_export field in snapshot's mount point is NULL. That's why when we try to access snapshots over NFS use mnt_export field from the parent file system. ---snip--- r197131: ---snip--- Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain NULL, but also can point to dead vnode, take that into account. PR: kern/132068 Reported by: Edward Fisk" <7ogcg7g02@sneakemail.com>, kris Fix based on patch from: Jaakko Heinonen ---snip--- r197133: ---snip--- - Protect reclaim with z_teardown_inactive_lock. - Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if z_dbuf field is NULL - this might happen in case of rollback or forced unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete(). - On forced unmount wait for all znodes to be destroyed - destruction can be done asynchronously via zfs_reclaim_complete(). ---snip--- r197153: ---snip--- When zfs.ko is compiled with debug, make sure that znode and vnode point at each other. ---snip--- r197167: ---snip--- Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories by just returning EOPNOTSUPP. This will allow NFS server to fall back to regular READDIR. Note that converting inode number to snapshot's vnode is expensive operation. Snapshots are stored in AVL tree, but based on their names, not inode numbers, so to convert inode to snapshot vnode we have to interate over all snalshots. This is not a problem in OpenSolaris, because in their READDIRPLUS implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on d_fileno as we do. PR: kern/125149 Reported by: Weldon Godfrey Analysis by: Jaakko Heinonen ---snip--- r197177: ---snip--- Support both case: when snapshot is already mounted and when it is not yet mounted. ---snip--- r197201: ---snip--- - Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows ZFS route of not listing snapshots by default with 'zfs list' command. - Add UPDATING entry to note that ZFS snapshots are no longer visible in mount(8) and df(1) output by default. Reviewed by: kib ---snip--- Note: the MNT_IGNORE part is commented out in this commit and the UPDATING entry is not merged, as this would be a POLA violation on a stable branch. This revision is included here, as it also makes locking changes and makes sure that a snapshot is mounted RO. r197426: ---snip--- Restore BSD behaviour - when creating new directory entry use parent directory gid to set group ownership and not process gid. This was overlooked during v6 -> v13 switch. PR: kern/139076 Reported by: Sean Winn ---snip--- r197458: ---snip--- Close race in zfs_zget(). We have to increase usecount first and then check for VI_DOOMED flag. Before this change vnode could be reclaimed between checking for the flag and increasing usecount. ---snip--- Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/7/sys/cddl/compat/opensolaris/sys/vfs.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Wed Jan 6 16:09:58 2010 (r201651) @@ -115,12 +115,13 @@ extern struct mount *vfs_mount_alloc(str const char *fspath, struct thread *td); int -domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, +mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath, char *fspec, int fsflags) { struct mount *mp; struct vfsconf *vfsp; struct ucred *cr; + vnode_t *vp; int error; /* @@ -135,23 +136,28 @@ domount(kthread_t *td, vnode_t *vp, cons if (vfsp == NULL) return (ENODEV); + vp = *vpp; if (vp->v_type != VDIR) return (ENOTDIR); + /* + * We need vnode lock to protect v_mountedhere and vnode interlock + * to protect v_iflag. + */ + vn_lock(vp, LK_SHARED | LK_RETRY, td); VI_LOCK(vp); - if ((vp->v_iflag & VI_MOUNT) != 0 || - vp->v_mountedhere != NULL) { + if ((vp->v_iflag & VI_MOUNT) != 0 || vp->v_mountedhere != NULL) { VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0, td); return (EBUSY); } vp->v_iflag |= VI_MOUNT; VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0, td); /* * Allocate and initialize the filesystem. */ - vn_lock(vp, LK_SHARED | LK_RETRY, td); mp = vfs_mount_alloc(vp, vfsp, fspath, td); - VOP_UNLOCK(vp, 0,td); mp->mnt_optnew = NULL; vfs_setmntopt(mp, "from", fspec, 0); @@ -161,11 +167,20 @@ domount(kthread_t *td, vnode_t *vp, cons /* * Set the mount level flags. */ - if (fsflags & MNT_RDONLY) - mp->mnt_flag |= MNT_RDONLY; - mp->mnt_flag &=~ MNT_UPDATEMASK; + mp->mnt_flag &= ~MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS); /* + * Snapshots are always read-only. + */ + mp->mnt_flag |= MNT_RDONLY; +#if 0 + /* + * We don't want snapshots to be visible in regular + * mount(8) and df(1) output. + */ + mp->mnt_flag |= MNT_IGNORE; +#endif + /* * Unprivileged user can trigger mounting a snapshot, but we don't want * him to unmount it, so we switch to privileged of original mount. */ @@ -173,11 +188,6 @@ domount(kthread_t *td, vnode_t *vp, cons mp->mnt_cred = crdup(vp->v_mount->mnt_cred); mp->mnt_stat.f_owner = mp->mnt_cred->cr_uid; /* - * Mount the filesystem. - * XXX The final recipients of VFS_MOUNT just overwrite the ndp they - * get. No freeing of cn_pnbuf. - */ - /* * XXX: This is evil, but we can't mount a snapshot as a regular user. * XXX: Is is safe when snapshot is mounted from within a jail? */ @@ -186,7 +196,7 @@ domount(kthread_t *td, vnode_t *vp, cons error = VFS_MOUNT(mp, td); td->td_ucred = cr; - if (!error) { + if (error == 0) { if (mp->mnt_opt != NULL) vfs_freeopts(mp->mnt_opt); mp->mnt_opt = mp->mnt_optnew; @@ -198,42 +208,33 @@ domount(kthread_t *td, vnode_t *vp, cons */ mp->mnt_optnew = NULL; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); - /* - * Put the new filesystem on the mount list after root. - */ #ifdef FREEBSD_NAMECACHE cache_purge(vp); #endif - if (!error) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); + if (error == 0) { vnode_t *mvp; - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); vp->v_mountedhere = mp; + /* + * Put the new filesystem on the mount list. + */ mtx_lock(&mountlist_mtx); TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); mtx_unlock(&mountlist_mtx); vfs_event_signal(NULL, VQ_MOUNT, 0); if (VFS_ROOT(mp, LK_EXCLUSIVE, &mvp, td)) panic("mount: lost mount"); - mountcheckdirs(vp, mvp); - vput(mvp); - VOP_UNLOCK(vp, 0, td); - if ((mp->mnt_flag & MNT_RDONLY) == 0) - error = vfs_allocate_syncvnode(mp); + vput(vp); vfs_unbusy(mp, td); - if (error) - vrele(vp); - else - vfs_mountedfrom(mp, fspec); + *vpp = mvp; } else { - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); - VOP_UNLOCK(vp, 0, td); + vput(vp); vfs_unbusy(mp, td); vfs_mount_destroy(mp); + *vpp = NULL; } return (error); } Modified: stable/7/sys/cddl/compat/opensolaris/sys/vfs.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/vfs.h Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/compat/opensolaris/sys/vfs.h Wed Jan 6 16:09:58 2010 (r201651) @@ -110,8 +110,8 @@ void vfs_setmntopt(vfs_t *vfsp, const ch int flags __unused); void vfs_clearmntopt(vfs_t *vfsp, const char *name); int vfs_optionisset(const vfs_t *vfsp, const char *opt, char **argp); -int domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath, - char *fspec, int fsflags); +int mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, + char *fspath, char *fspec, int fsflags); typedef uint64_t vfs_feature_t; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jan 6 16:09:58 2010 (r201651) @@ -231,8 +231,27 @@ typedef struct znode { /* * Convert between znode pointers and vnode pointers */ +#ifdef DEBUG +static __inline vnode_t * +ZTOV(znode_t *zp) +{ + vnode_t *vp = zp->z_vnode; + + ASSERT(vp == NULL || vp->v_data == NULL || vp->v_data == zp); + return (vp); +} +static __inline znode_t * +VTOZ(vnode_t *vp) +{ + znode_t *zp = (znode_t *)vp->v_data; + + ASSERT(zp == NULL || zp->z_vnode == NULL || zp->z_vnode == vp); + return (zp); +} +#else #define ZTOV(ZP) ((ZP)->z_vnode) #define VTOZ(VP) ((znode_t *)(VP)->v_data) +#endif /* * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Jan 6 16:09:58 2010 (r201651) @@ -1841,7 +1841,7 @@ zfs_perm_init(znode_t *zp, znode_t *pare fgid = zfs_fuid_create_cred(zfsvfs, ZFS_GROUP, tx, cr, fuidp); #ifdef __FreeBSD__ - gid = parent->z_phys->zp_gid; + gid = fgid = parent->z_phys->zp_gid; #else gid = crgetgid(cr); #endif Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Jan 6 16:09:58 2010 (r201651) @@ -879,20 +879,20 @@ domount: mountpoint = kmem_alloc(mountpoint_len, KM_SLEEP); (void) snprintf(mountpoint, mountpoint_len, "%s/.zfs/snapshot/%s", dvp->v_vfsp->mnt_stat.f_mntonname, nm); - err = domount(curthread, *vpp, "zfs", mountpoint, snapname, 0); + err = mount_snapshot(curthread, vpp, "zfs", mountpoint, snapname, 0); kmem_free(mountpoint, mountpoint_len); - /* FreeBSD: This line was moved from below to avoid a lock recursion. */ - if (err == 0) - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread); - mutex_exit(&sdp->sd_lock); - /* - * If we had an error, drop our hold on the vnode and - * zfsctl_snapshot_inactive() will clean up. - */ - if (err) { - VN_RELE(*vpp); - *vpp = NULL; + if (err == 0) { + /* + * Fix up the root vnode mounted on .zfs/snapshot/. + * + * This is where we lie about our v_vfsp in order to + * make .zfs/snapshot/ accessible over NFS + * without requiring manual mounts of . + */ + ASSERT(VTOZ(*vpp)->z_zfsvfs != zfsvfs); + VTOZ(*vpp)->z_zfsvfs->z_parent = zfsvfs; } + mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); return (err); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Wed Jan 6 16:09:58 2010 (r201651) @@ -97,6 +97,8 @@ static int zfs_root(vfs_t *vfsp, int fla static int zfs_statfs(vfs_t *vfsp, struct statfs *statp, kthread_t *td); static int zfs_vget(vfs_t *vfsp, ino_t ino, int flags, vnode_t **vpp); static int zfs_sync(vfs_t *vfsp, int waitfor, kthread_t *td); +static int zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, + struct ucred **credanonp); static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp); static void zfs_objset_close(zfsvfs_t *zfsvfs); static void zfs_freevfs(vfs_t *vfsp); @@ -108,6 +110,7 @@ static struct vfsops zfs_vfsops = { .vfs_statfs = zfs_statfs, .vfs_vget = zfs_vget, .vfs_sync = zfs_sync, + .vfs_checkexp = zfs_checkexp, .vfs_fhtovp = zfs_fhtovp, }; @@ -955,6 +958,18 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea zfsvfs->z_unmounted = B_TRUE; rrw_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); + +#ifdef __FreeBSD__ + /* + * Some znodes might not be fully reclaimed, wait for them. + */ + mutex_enter(&zfsvfs->z_znodes_lock); + while (list_head(&zfsvfs->z_all_znodes) != NULL) { + msleep(zfsvfs, &zfsvfs->z_znodes_lock, 0, + "zteardown", 0); + } + mutex_exit(&zfsvfs->z_znodes_lock); +#endif } /* @@ -1114,6 +1129,20 @@ zfs_vget(vfs_t *vfsp, ino_t ino, int fla znode_t *zp; int err; + /* + * XXXPJD: zfs_zget() can't operate on virtual entires like .zfs/ or + * .zfs/snapshot/ directories, so for now just return EOPNOTSUPP. + * This will make NFS to fall back to using READDIR instead of + * READDIRPLUS. + * Also snapshots are stored in AVL tree, but based on their names, + * not inode numbers, so it will be very inefficient to iterate + * over all snapshots to find the right one. + * Note that OpenSolaris READDIRPLUS implementation does LOOKUP on + * d_name, and not VGET on d_fileno as we do. + */ + if (ino == ZFSCTL_INO_ROOT || ino == ZFSCTL_INO_SNAPDIR) + return (EOPNOTSUPP); + ZFS_ENTER(zfsvfs); err = zfs_zget(zfsvfs, ino, &zp); if (err == 0 && zp->z_unlinked) { @@ -1134,6 +1163,26 @@ CTASSERT(SHORT_FID_LEN <= sizeof(struct CTASSERT(LONG_FID_LEN <= sizeof(struct fid)); static int +zfs_checkexp(vfs_t *vfsp, struct sockaddr *nam, int *extflagsp, + struct ucred **credanonp) +{ + zfsvfs_t *zfsvfs = vfsp->vfs_data; + + /* + * If this is regular file system vfsp is the same as + * zfsvfs->z_parent->z_vfs, but if it is snapshot, + * zfsvfs->z_parent->z_vfs represents parent file system + * which we have to use here, because only this file system + * has mnt_export configured. + */ + vfsp = zfsvfs->z_parent->z_vfs; + + return (vfs_stdcheckexp(zfsvfs->z_parent->z_vfs, nam, extflagsp, + credanonp)); +} + + +static int zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vnode_t **vpp) { zfsvfs_t *zfsvfs = vfsp->vfs_data; @@ -1148,7 +1197,11 @@ zfs_fhtovp(vfs_t *vfsp, fid_t *fidp, vno ZFS_ENTER(zfsvfs); - if (fidp->fid_len == LONG_FID_LEN) { + /* + * On FreeBSD we can get snapshot's mount point or its parent file + * system mount point depending if snapshot is already mounted or not. + */ + if (zfsvfs->z_parent == zfsvfs && fidp->fid_len == LONG_FID_LEN) { zfid_long_t *zlfid = (zfid_long_t *)fidp; uint64_t objsetid = 0; uint64_t setgen = 0; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jan 6 16:09:58 2010 (r201651) @@ -4340,11 +4340,20 @@ zfs_reclaim_complete(void *arg, int pend znode_t *zp = arg; zfsvfs_t *zfsvfs = zp->z_zfsvfs; - ZFS_LOG(1, "zp=%p", zp); - ZFS_OBJ_HOLD_ENTER(zfsvfs, zp->z_id); - zfs_znode_dmu_fini(zp); - ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); + rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); + if (zp->z_dbuf != NULL) { + ZFS_OBJ_HOLD_ENTER(zfsvfs, zp->z_id); + zfs_znode_dmu_fini(zp); + ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id); + } zfs_znode_free(zp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); + /* + * If the file system is being unmounted, there is a process waiting + * for us, wake it up. + */ + if (zfsvfs->z_unmounted) + wakeup_one(zfsvfs); } static int @@ -4356,6 +4365,9 @@ zfs_freebsd_reclaim(ap) { vnode_t *vp = ap->a_vp; znode_t *zp = VTOZ(vp); + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + + rw_enter(&zfsvfs->z_teardown_inactive_lock, RW_READER); ASSERT(zp != NULL); @@ -4366,7 +4378,7 @@ zfs_freebsd_reclaim(ap) mutex_enter(&zp->z_lock); ASSERT(zp->z_phys != NULL); - ZTOV(zp) = NULL; + zp->z_vnode = NULL; mutex_exit(&zp->z_lock); if (zp->z_unlinked) @@ -4374,7 +4386,6 @@ zfs_freebsd_reclaim(ap) else if (zp->z_dbuf == NULL) zfs_znode_free(zp); else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ { - zfsvfs_t *zfsvfs = zp->z_zfsvfs; int locked; locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 : @@ -4397,6 +4408,7 @@ zfs_freebsd_reclaim(ap) vp->v_data = NULL; ASSERT(vp->v_holdcnt >= 1); VI_UNLOCK(vp); + rw_exit(&zfsvfs->z_teardown_inactive_lock); return (0); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jan 6 16:05:33 2010 (r201650) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jan 6 16:09:58 2010 (r201651) @@ -110,7 +110,7 @@ znode_evict_error(dmu_buf_t *dbuf, void mutex_exit(&zp->z_lock); zfs_znode_free(zp); } else if (vp->v_count == 0) { - ZTOV(zp) = NULL; + zp->z_vnode = NULL; vhold(vp); mutex_exit(&zp->z_lock); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); @@ -896,9 +896,25 @@ again: if (zp->z_unlinked) { err = ENOENT; } else { - if (ZTOV(zp) != NULL) - VN_HOLD(ZTOV(zp)); + int dying = 0; + + vp = ZTOV(zp); + if (vp == NULL) + dying = 1; else { + VN_HOLD(vp); + if ((vp->v_iflag & VI_DOOMED) != 0) { + dying = 1; + /* + * Don't VN_RELE() vnode here, because + * it can call vn_lock() which creates + * LOR between vnode lock and znode + * lock. We will VN_RELE() the vnode + * after droping znode lock. + */ + } + } + if (dying) { if (first) { ZFS_LOG(1, "dying znode detected (zp=%p)", zp); first = 0; @@ -910,6 +926,8 @@ again: dmu_buf_rele(db, NULL); mutex_exit(&zp->z_lock); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + if (vp != NULL) + VN_RELE(vp); tsleep(zp, 0, "zcollide", 1); goto again; } @@ -1531,7 +1549,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, ZTOV(rootzp)->v_data = NULL; ZTOV(rootzp)->v_count = 0; ZTOV(rootzp)->v_holdcnt = 0; - ZTOV(rootzp) = NULL; + rootzp->z_vnode = NULL; VOP_UNLOCK(vp, 0, curthread); vdestroy(vp); dmu_buf_rele(rootzp->z_dbuf, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:39:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A61011065670; Wed, 6 Jan 2010 16:39:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B39B8FC0C; Wed, 6 Jan 2010 16:39:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06GdGS9079314; Wed, 6 Jan 2010 16:39:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06GdGGw079312; Wed, 6 Jan 2010 16:39:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061639.o06GdGGw079312@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:39:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201652 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:39:16 -0000 Author: bz Date: Wed Jan 6 16:39:16 2010 New Revision: 201652 URL: http://svn.freebsd.org/changeset/base/201652 Log: MFC 182846: Convert SYSCTL_INTs for tcp_mssdflt and tcp_v6mssdflt to SYSCTL_PROCs and check that the default mss for neither v4 nor v6 goes below the minimum MSS constant (216). This prevents people from shooting themselves in the foot. Modified: stable/7/sys/netinet/tcp_subr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:09:58 2010 (r201651) +++ stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:39:16 2010 (r201652) @@ -111,14 +111,50 @@ __FBSDID("$FreeBSD$"); #include int tcp_mssdflt = TCP_MSS; -SYSCTL_INT(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLFLAG_RW, - &tcp_mssdflt, 0, "Default TCP Maximum Segment Size"); - #ifdef INET6 int tcp_v6mssdflt = TCP6_MSS; -SYSCTL_INT(_net_inet_tcp, TCPCTL_V6MSSDFLT, v6mssdflt, - CTLFLAG_RW, &tcp_v6mssdflt , 0, - "Default TCP Maximum Segment Size for IPv6"); +#endif + +static int +sysctl_net_inet_tcp_mss_check(SYSCTL_HANDLER_ARGS) +{ + int error, new; + + new = tcp_mssdflt; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (new < TCP_MINMSS) + error = EINVAL; + else + tcp_mssdflt = new; + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, TCPCTL_MSSDFLT, mssdflt, CTLTYPE_INT|CTLFLAG_RW, + &tcp_mssdflt, 0, &sysctl_net_inet_tcp_mss_check, "I", + "Default TCP Maximum Segment Size"); + +#ifdef INET6 +static int +sysctl_net_inet_tcp_mss_v6_check(SYSCTL_HANDLER_ARGS) +{ + int error, new; + + new = tcp_v6mssdflt; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr) { + if (new < TCP_MINMSS) + error = EINVAL; + else + tcp_v6mssdflt = new; + } + return (error); +} + +SYSCTL_PROC(_net_inet_tcp, TCPCTL_V6MSSDFLT, v6mssdflt, CTLTYPE_INT|CTLFLAG_RW, + &tcp_v6mssdflt, 0, &sysctl_net_inet_tcp_mss_v6_check, "I", + "Default TCP Maximum Segment Size for IPv6"); #endif /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:43:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 641E3106568B; Wed, 6 Jan 2010 16:43:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51EE48FC15; Wed, 6 Jan 2010 16:43:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06GhANf080277; Wed, 6 Jan 2010 16:43:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06GhANT080243; Wed, 6 Jan 2010 16:43:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061643.o06GhANT080243@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201653 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:43:10 -0000 Author: bz Date: Wed Jan 6 16:43:09 2010 New Revision: 201653 URL: http://svn.freebsd.org/changeset/base/201653 Log: MFC r182851: Split tcp_mss() in tcp_mss() and tcp_mss_update() where the former calls the latter. Merge tcp_mss_update() with code from tcp_mtudisc() basically doing the same thing. This gives us one central place where we calcuate and check mss values to update t_maxopd (maximum mss + options length) instead of two slightly different but almost equal implementations to maintain. Modified: stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:39:16 2010 (r201652) +++ stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:43:09 2010 (r201653) @@ -2727,13 +2727,11 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). */ void -tcp_mss(struct tcpcb *tp, int offer) +tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr) { - int rtt, mss; - u_long bufsize; + int mss; u_long maxmtu; struct inpcb *inp = tp->t_inpcb; - struct socket *so; struct hc_metrics_lite metrics; int origoffer = offer; int mtuflags = 0; @@ -2766,6 +2764,10 @@ tcp_mss(struct tcpcb *tp, int offer) if (maxmtu == 0) return; + /* Check the interface for TSO capabilities. */ + if (mtuflags & CSUM_TSO) + tp->t_flags |= TF_TSO; + /* What have we got? */ switch (offer) { case 0: @@ -2789,19 +2791,14 @@ tcp_mss(struct tcpcb *tp, int offer) * to at least minmss. */ offer = max(offer, tcp_minmss); - /* - * Sanity check: make sure that maxopd will be large - * enough to allow some data on segments even if the - * all the option space is used (40bytes). Otherwise - * funny things may happen in tcp_output. - */ - offer = max(offer, 64); } /* * rmx information is now retrieved from tcp_hostcache. */ tcp_hc_get(&inp->inp_inc, &metrics); + if (metricptr != NULL) + bcopy(&metrics, metricptr, sizeof(struct hc_metrics_lite)); /* * If there's a discovered mtu int tcp hostcache, use it @@ -2824,10 +2821,36 @@ tcp_mss(struct tcpcb *tp, int offer) !in_localaddr(inp->inp_faddr)) mss = min(mss, tcp_mssdflt); } + /* + * XXX - The above conditional (mss = maxmtu - min_protoh) + * probably violates the TCP spec. + * The problem is that, since we don't know the + * other end's MSS, we are supposed to use a conservative + * default. But, if we do that, then MTU discovery will + * never actually take place, because the conservative + * default is much less than the MTUs typically seen + * on the Internet today. For the moment, we'll sweep + * this under the carpet. + * + * The conservative default might not actually be a problem + * if the only case this occurs is when sending an initial + * SYN with options and data to a host we've never talked + * to before. Then, they will reply with an MSS value which + * will get recorded and the new parameters should get + * recomputed. For Further Study. + */ } mss = min(mss, offer); /* + * Sanity check: make sure that maxopd will be large + * enough to allow some data on segments even if the + * all the option space is used (40bytes). Otherwise + * funny things may happen in tcp_output. + */ + mss = max(mss, 64); + + /* * maxopd stores the maximum length of data AND options * in a segment; maxseg is the amount of data in a normal * segment. We need to store this value (maxopd) apart @@ -2853,6 +2876,28 @@ tcp_mss(struct tcpcb *tp, int offer) mss = mss / MCLBYTES * MCLBYTES; #endif tp->t_maxseg = mss; +} + +void +tcp_mss(struct tcpcb *tp, int offer) +{ + int rtt, mss; + u_long bufsize; + struct inpcb *inp; + struct socket *so; + struct hc_metrics_lite metrics; +#ifdef INET6 + int isipv6; +#endif + KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); + + tcp_mss_update(tp, offer, &metrics); + + mss = tp->t_maxseg; + inp = tp->t_inpcb; +#ifdef INET6 + isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; +#endif /* * If there's a pipesize, change the socket buffer to that size, @@ -2959,10 +3004,6 @@ tcp_mss(struct tcpcb *tp, int offer) tp->snd_cwnd = mss * ss_fltsz_local; else tp->snd_cwnd = mss * ss_fltsz; - - /* Check the interface for TSO capabilities. */ - if (mtuflags & CSUM_TSO) - tp->t_flags |= TF_TSO; } /* Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:39:16 2010 (r201652) +++ stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:43:09 2010 (r201653) @@ -1509,13 +1509,7 @@ struct inpcb * tcp_mtudisc(struct inpcb *inp, int errno) { struct tcpcb *tp; - struct socket *so = inp->inp_socket; - u_int maxmtu; - u_int romtu; - int mss; -#ifdef INET6 - int isipv6; -#endif /* INET6 */ + struct socket *so; INP_WLOCK_ASSERT(inp); if ((inp->inp_flags & INP_TIMEWAIT) || @@ -1525,72 +1519,14 @@ tcp_mtudisc(struct inpcb *inp, int errno tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); -#ifdef INET6 - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) != 0; -#endif - maxmtu = tcp_hc_getmtu(&inp->inp_inc); /* IPv4 and IPv6 */ - romtu = -#ifdef INET6 - isipv6 ? tcp_maxmtu6(&inp->inp_inc, NULL) : -#endif /* INET6 */ - tcp_maxmtu(&inp->inp_inc, NULL); - if (!maxmtu) - maxmtu = romtu; - else - maxmtu = min(maxmtu, romtu); - if (!maxmtu) { - tp->t_maxopd = tp->t_maxseg = -#ifdef INET6 - isipv6 ? tcp_v6mssdflt : -#endif /* INET6 */ - tcp_mssdflt; - return (inp); - } - mss = maxmtu - -#ifdef INET6 - (isipv6 ? sizeof(struct ip6_hdr) + sizeof(struct tcphdr) : -#endif /* INET6 */ - sizeof(struct tcpiphdr) -#ifdef INET6 - ) -#endif /* INET6 */ - ; - - /* - * XXX - The above conditional probably violates the TCP - * spec. The problem is that, since we don't know the - * other end's MSS, we are supposed to use a conservative - * default. But, if we do that, then MTU discovery will - * never actually take place, because the conservative - * default is much less than the MTUs typically seen - * on the Internet today. For the moment, we'll sweep - * this under the carpet. - * - * The conservative default might not actually be a problem - * if the only case this occurs is when sending an initial - * SYN with options and data to a host we've never talked - * to before. Then, they will reply with an MSS value which - * will get recorded and the new parameters should get - * recomputed. For Further Study. - */ - if (tp->t_maxopd <= mss) - return (inp); - tp->t_maxopd = mss; - - if ((tp->t_flags & (TF_REQ_TSTMP|TF_NOOPT)) == TF_REQ_TSTMP && - (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP) - mss -= TCPOLEN_TSTAMP_APPA; -#if (MCLBYTES & (MCLBYTES - 1)) == 0 - if (mss > MCLBYTES) - mss &= ~(MCLBYTES-1); -#else - if (mss > MCLBYTES) - mss = mss / MCLBYTES * MCLBYTES; -#endif - if (so->so_snd.sb_hiwat < mss) - mss = so->so_snd.sb_hiwat; - - tp->t_maxseg = mss; + tcp_mss_update(tp, -1, NULL); + + so = inp->inp_socket; + SOCKBUF_LOCK(&so->so_snd); + /* If the mss is larger than the socket buffer, decrease the mss. */ + if (so->so_snd.sb_hiwat < tp->t_maxseg) + tp->t_maxseg = so->so_snd.sb_hiwat; + SOCKBUF_UNLOCK(&so->so_snd); tcpstat.tcps_mturesent++; tp->t_rtttime = 0; Modified: stable/7/sys/netinet/tcp_var.h ============================================================================== --- stable/7/sys/netinet/tcp_var.h Wed Jan 6 16:39:16 2010 (r201652) +++ stable/7/sys/netinet/tcp_var.h Wed Jan 6 16:43:09 2010 (r201653) @@ -544,6 +544,7 @@ void tcp_reass_init(void); void tcp_input(struct mbuf *, int); u_long tcp_maxmtu(struct in_conninfo *, int *); u_long tcp_maxmtu6(struct in_conninfo *, int *); +void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *); void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:49:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A320106566B; Wed, 6 Jan 2010 16:49:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 493108FC1B; Wed, 6 Jan 2010 16:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Gn0kG081669; Wed, 6 Jan 2010 16:49:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06Gn0wd081668; Wed, 6 Jan 2010 16:49:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061649.o06Gn0wd081668@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:49:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201654 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:49:00 -0000 Author: bz Date: Wed Jan 6 16:48:59 2010 New Revision: 201654 URL: http://svn.freebsd.org/changeset/base/201654 Log: MFC r184720: Fix a bug introduced with r182851 (r201653 in stable/7) splitting tcp_mss() into tcp_mss() and tcp_mss_update() so that tcp_mtudisc() could re-use the same code. In case we return early and got a metricptr to pass the hostcache info back to the caller we need to initialize the data to a defined state (zero it) as tcp_hc_get() would do if there was no hit. Without that the caller would check on random stack garbage which could lead to undefined results. This only affected tcp_mss() if there was no routing entry for the peer, tcp_mtudisc() was not affected. Modified: stable/7/sys/netinet/tcp_input.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:43:09 2010 (r201653) +++ stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:48:59 2010 (r201654) @@ -2761,8 +2761,16 @@ tcp_mss_update(struct tcpcb *tp, int off /* * No route to sender, stay with default mss and return. */ - if (maxmtu == 0) + if (maxmtu == 0) { + /* + * In case we return early we need to intialize metrics + * to a defined state as tcp_hc_get() would do for us + * if there was no cache hit. + */ + if (metricptr != NULL) + bzero(metricptr, sizeof(struct hc_metrics_lite)); return; + } /* Check the interface for TSO capabilities. */ if (mtuflags & CSUM_TSO) From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:51:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50797106566C; Wed, 6 Jan 2010 16:51:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB4A8FC15; Wed, 6 Jan 2010 16:51:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06GpwDs082412; Wed, 6 Jan 2010 16:51:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06GpwhC082408; Wed, 6 Jan 2010 16:51:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061651.o06GpwhC082408@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:51:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201655 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:51:58 -0000 Author: bz Date: Wed Jan 6 16:51:57 2010 New Revision: 201655 URL: http://svn.freebsd.org/changeset/base/201655 Log: MFC r184722: Fix a bug introduced with r182851 (r201653 in stable/7) splitting tcp_mss() into tcp_mss() and tcp_mss_update() so that tcp_mtudisc() could re-use the same code. Move the TSO logic back to tcp_mss() and out of tcp_mss_update(). We tried to avoid that initially but if were are called from tcp_output() with EMSGSIZE, we cleared the TSO flag on the tcpcb there, called into tcp_mtudisc() and tcp_mss_update() which then would reenable TSO on the tcpcb based on TSO capabilities of the interface as learnt in tcp_maxmtu/6(). So if TSO was enabled on the (possibly new) outgoing interface it was turned back on, which lead to an endless loop between tcp_output() and tcp_mtudisc() until we overflew the stack. Reported by: kmacy Modified: stable/7/sys/netinet/tcp_input.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:48:59 2010 (r201654) +++ stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:51:57 2010 (r201655) @@ -2727,14 +2727,14 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt * segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt(). */ void -tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr) +tcp_mss_update(struct tcpcb *tp, int offer, + struct hc_metrics_lite *metricptr, int *mtuflags) { int mss; u_long maxmtu; struct inpcb *inp = tp->t_inpcb; struct hc_metrics_lite metrics; int origoffer = offer; - int mtuflags = 0; #ifdef INET6 int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; size_t min_protoh = isipv6 ? @@ -2749,12 +2749,12 @@ tcp_mss_update(struct tcpcb *tp, int off /* Initialize. */ #ifdef INET6 if (isipv6) { - maxmtu = tcp_maxmtu6(&inp->inp_inc, &mtuflags); + maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags); tp->t_maxopd = tp->t_maxseg = tcp_v6mssdflt; } else #endif { - maxmtu = tcp_maxmtu(&inp->inp_inc, &mtuflags); + maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags); tp->t_maxopd = tp->t_maxseg = tcp_mssdflt; } @@ -2772,10 +2772,6 @@ tcp_mss_update(struct tcpcb *tp, int off return; } - /* Check the interface for TSO capabilities. */ - if (mtuflags & CSUM_TSO) - tp->t_flags |= TF_TSO; - /* What have we got? */ switch (offer) { case 0: @@ -2894,12 +2890,13 @@ tcp_mss(struct tcpcb *tp, int offer) struct inpcb *inp; struct socket *so; struct hc_metrics_lite metrics; + int mtuflags = 0; #ifdef INET6 int isipv6; #endif KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); - tcp_mss_update(tp, offer, &metrics); + tcp_mss_update(tp, offer, &metrics, &mtuflags); mss = tp->t_maxseg; inp = tp->t_inpcb; @@ -3012,6 +3009,10 @@ tcp_mss(struct tcpcb *tp, int offer) tp->snd_cwnd = mss * ss_fltsz_local; else tp->snd_cwnd = mss * ss_fltsz; + + /* Check the interface for TSO capabilities. */ + if (mtuflags & CSUM_TSO) + tp->t_flags |= TF_TSO; } /* Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:48:59 2010 (r201654) +++ stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:51:57 2010 (r201655) @@ -1519,7 +1519,7 @@ tcp_mtudisc(struct inpcb *inp, int errno tp = intotcpcb(inp); KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL")); - tcp_mss_update(tp, -1, NULL); + tcp_mss_update(tp, -1, NULL, NULL); so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd); Modified: stable/7/sys/netinet/tcp_var.h ============================================================================== --- stable/7/sys/netinet/tcp_var.h Wed Jan 6 16:48:59 2010 (r201654) +++ stable/7/sys/netinet/tcp_var.h Wed Jan 6 16:51:57 2010 (r201655) @@ -544,7 +544,7 @@ void tcp_reass_init(void); void tcp_input(struct mbuf *, int); u_long tcp_maxmtu(struct in_conninfo *, int *); u_long tcp_maxmtu6(struct in_conninfo *, int *); -void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *); +void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *, int *); void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:53:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AA3B1065679; Wed, 6 Jan 2010 16:53:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 098CF8FC13; Wed, 6 Jan 2010 16:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06GrvUQ082894; Wed, 6 Jan 2010 16:53:57 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06GrvU2082892; Wed, 6 Jan 2010 16:53:57 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061653.o06GrvU2082892@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201656 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:53:58 -0000 Author: bz Date: Wed Jan 6 16:53:57 2010 New Revision: 201656 URL: http://svn.freebsd.org/changeset/base/201656 Log: MFC r184731: Fix typo and while here another one. Reviewed by: keramida Reported by: keramida Modified: stable/7/sys/netinet/tcp_input.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:51:57 2010 (r201655) +++ stable/7/sys/netinet/tcp_input.c Wed Jan 6 16:53:57 2010 (r201656) @@ -1415,7 +1415,7 @@ tcp_do_segment(struct mbuf *m, struct tc * only accepting RSTs where the sequence number is equal to * last_ack_sent. In all other states (the states in which a * RST is more likely), the more permissive check is used. - * If we have multiple segments in flight, the intial reset + * If we have multiple segments in flight, the initial reset * segment sequence numbers will be to the left of last_ack_sent, * but they will eventually catch up. * In any case, it never made sense to trim reset segments to @@ -2763,7 +2763,7 @@ tcp_mss_update(struct tcpcb *tp, int off */ if (maxmtu == 0) { /* - * In case we return early we need to intialize metrics + * In case we return early we need to initialize metrics * to a defined state as tcp_hc_get() would do for us * if there was no cache hit. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 16:56:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E101065692; Wed, 6 Jan 2010 16:56:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 178B58FC08; Wed, 6 Jan 2010 16:56:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06GuVOh083526; Wed, 6 Jan 2010 16:56:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06GuVga083524; Wed, 6 Jan 2010 16:56:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001061656.o06GuVga083524@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 16:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201657 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 16:56:32 -0000 Author: bz Date: Wed Jan 6 16:56:31 2010 New Revision: 201657 URL: http://svn.freebsd.org/changeset/base/201657 Log: MFC r184721: Adopt the comment for tcp_maxmtu(); we are returning a number not a pointer. While here update the rest of the comment to better match what we have these days. Modified: stable/7/sys/netinet/tcp_subr.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_subr.c ============================================================================== --- stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:53:57 2010 (r201656) +++ stable/7/sys/netinet/tcp_subr.c Wed Jan 6 16:56:31 2010 (r201657) @@ -1541,9 +1541,9 @@ tcp_mtudisc(struct inpcb *inp, int errno /* * Look-up the routing entry to the peer of this inpcb. If no route - * is found and it cannot be allocated, then return NULL. This routine - * is called by TCP routines that access the rmx structure and by tcp_mss - * to get the interface MTU. + * is found and it cannot be allocated, then return 0. This routine + * is called by TCP routines that access the rmx structure and by + * tcp_mss_update to get the peer/interface MTU. */ u_long tcp_maxmtu(struct in_conninfo *inc, int *flags) From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 17:12:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83D621065679; Wed, 6 Jan 2010 17:12:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72F7E8FC17; Wed, 6 Jan 2010 17:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06HCIAW087129; Wed, 6 Jan 2010 17:12:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06HCICF087127; Wed, 6 Jan 2010 17:12:18 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001061712.o06HCICF087127@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Jan 2010 17:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 17:12:18 -0000 Author: mav Date: Wed Jan 6 17:12:18 2010 New Revision: 201658 URL: http://svn.freebsd.org/changeset/base/201658 Log: Increase default block size from 4K to 64K. It was reduces 6 yeard ago, when trees were big and FAST mode was enabled by default. So small block size doesn't benefits linear I/O operations in FAST and significantly slowdowns in ECONOMIC (default) mode. For single stream random I/Os so small block doesn't give much benefits, as access time is usually bigger then transfer time there. Same time it requires all heads to seek together for every single request, reducing performance on parallel load. Modified: head/sbin/geom/class/stripe/geom_stripe.c Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Wed Jan 6 16:56:31 2010 (r201657) +++ head/sbin/geom/class/stripe/geom_stripe.c Wed Jan 6 17:12:18 2010 (r201658) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); uint32_t lib_version = G_LIB_VERSION; uint32_t version = G_STRIPE_VERSION; -static intmax_t default_stripesize = 4096; +static intmax_t default_stripesize = 65536; static void stripe_main(struct gctl_req *req, unsigned flags); static void stripe_clear(struct gctl_req *req); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 17:38:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3761A1065670; Wed, 6 Jan 2010 17:38:34 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id 48B168FC20; Wed, 6 Jan 2010 17:38:33 +0000 (UTC) Received: by ewy26 with SMTP id 26so15688705ewy.3 for ; Wed, 06 Jan 2010 09:38:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=23GwsrLpZyhJDHsw/d12ISCZG4f5e8Vrc5ic1Eo+MZU=; b=bI8u4ZHyy6FCWCxgLt6tjmG66qvJN9pIm18IGkXoFDglQ9P0i6TCUmch473MOZ8wkE yFlfSnOGu1nWiAFsGI4DOxHFhJ8g3u8kYiM2wtO2p+CQygOyxR5f/7Xy6bchMBs/h/An 2TdDcyBAYUH9IKa6X1g8AvVkoNs3lUfXEQozM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=ZkJQssAdhMo+NYuKWVuB6sMnaVA7W3hXzyY3I4TaToSno0IerKQOVhdZbss3Lce9PR /fQbjKSXqbiRaG2PAjhxMfs9jJhUcPF/xH2XFQqYAb23OSzAxdRaJ0dsXs20eARBQpuK 5e9GICSVLv8U95cTeol4SzWOFR+w/D1F1IV4M= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.90.210 with SMTP id e60mr1511911wef.120.1262799508120; Wed, 06 Jan 2010 09:38:28 -0800 (PST) In-Reply-To: <201001061712.o06HCICF087127@svn.freebsd.org> References: <201001061712.o06HCICF087127@svn.freebsd.org> From: Ivan Voras Date: Wed, 6 Jan 2010 18:38:07 +0100 X-Google-Sender-Auth: f59e6cd615f45e48 Message-ID: <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 17:38:34 -0000 2010/1/6 Alexander Motin : > Author: mav > Date: Wed Jan =C2=A06 17:12:18 2010 > New Revision: 201658 > URL: http://svn.freebsd.org/changeset/base/201658 > > Log: > =C2=A0Increase default block size from 4K to 64K. It was reduces 6 yeard = ago, > =C2=A0when trees were big and FAST mode was enabled by default. > > =C2=A0So small block size doesn't benefits linear I/O operations in FAST = and > =C2=A0significantly slowdowns in ECONOMIC (default) mode. For single stre= am random > =C2=A0I/Os so small block doesn't give much benefits, as access time is u= sually > =C2=A0bigger then transfer time there. Same time it requires all heads to= seek > =C2=A0together for every single request, reducing performance on parallel= load. I think there was one more reason - though I'm not sure if it is still valid because of your current and future work - the MAXPHYS limitation. If MAXPHYS is 128k, with 64k stripes data was only to be read from maximum of 2 drives. With 4k stripes it would have been read from 128/4=3D32 drives, though I agree 4k is too low in any case nowadays. I usually choose 16k or 32k for my setups. From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 18:40:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B6191065672; Wed, 6 Jan 2010 18:40:07 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.26]) by mx1.freebsd.org (Postfix) with ESMTP id 6725D8FC08; Wed, 6 Jan 2010 18:40:05 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so875749eye.9 for ; Wed, 06 Jan 2010 10:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=lGUiaXoEVHsC85jyvk7VhW8BwoQ9oBz7pggV+e/Syic=; b=lL3xRIajPWUeH/9lJdsrtZioMtFjDJACzaui9fmDJvZR6mGEUzHozvq2nm+vmrYfA7 KyObkcU1txLe7LzOFxh6P2rEv1QoQpX9Zd6WKJb7+J/9KgIFuJVxXuORQeFcz3y8F4n3 Kes2oqxOU8IJnf5+7kAMauiQrAPK3UB0it0jM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=SaSmg0am79CpnYYlpfZW7eVdo1P5Hh/eEYhLToJzUZN1oc43pnwjyA4uFO6F5bC6l7 2EfhLjjyOB4ZuISP42iAQ34wyVEa9UPewoYV+sVOoiQiKbUC4XZOCXm7YWSGJ0Dpk7jR /Ps2EeQcRMUCjoorI2EEObT+10CnaPRR+35/c= Received: by 10.216.85.134 with SMTP id u6mr2724995wee.213.1262803195320; Wed, 06 Jan 2010 10:39:55 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([72.14.240.162]) by mx.google.com with ESMTPS id g9sm54973359gvc.25.2010.01.06.10.39.53 (version=SSLv3 cipher=RC4-MD5); Wed, 06 Jan 2010 10:39:54 -0800 (PST) Sender: Alexander Motin Message-ID: <4B44D8FA.2000608@FreeBSD.org> Date: Wed, 06 Jan 2010 20:39:54 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Ivan Voras References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> In-Reply-To: <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 18:40:07 -0000 Ivan Voras wrote: > 2010/1/6 Alexander Motin : >> Author: mav >> Date: Wed Jan 6 17:12:18 2010 >> New Revision: 201658 >> URL: http://svn.freebsd.org/changeset/base/201658 >> >> Log: >> Increase default block size from 4K to 64K. It was reduces 6 yeard ago, >> when trees were big and FAST mode was enabled by default. >> >> So small block size doesn't benefits linear I/O operations in FAST and >> significantly slowdowns in ECONOMIC (default) mode. For single stream random >> I/Os so small block doesn't give much benefits, as access time is usually >> bigger then transfer time there. Same time it requires all heads to seek >> together for every single request, reducing performance on parallel load. > > I think there was one more reason - though I'm not sure if it is still > valid because of your current and future work - the MAXPHYS > limitation. If MAXPHYS is 128k, with 64k stripes data was only to be > read from maximum of 2 drives. With 4k stripes it would have been read > from 128/4=32 drives, though I agree 4k is too low in any case > nowadays. I usually choose 16k or 32k for my setups. While you are right about MAXPHYS influence, and I hope we can rise it not so far, IMHO it is file system business to manage deep enough read-ahead/write-back to make all drives busy, independently from MAXPHYS value. With small MAXPHYS value FS should just generate more requests in advance. Except some RAID3/5/6 cases, where short writes ineffective, MAXPHYS value should only affect processing overhead. I've chosen 64K as level, where most of modern HDDs/SSDs reaching close to maximum performance, where large request splitting with present MAXPHYS is still possible, where medium request splitting not very reduces performance on parallel load, and where interrupt rate is not so high. Definitely it is question of personal tuning, but I think it is a reasonable default. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 19:03:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B0D106568B; Wed, 6 Jan 2010 19:03:45 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id B912A8FC15; Wed, 6 Jan 2010 19:03:44 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so881196eye.9 for ; Wed, 06 Jan 2010 11:03:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:from:date:x-google-sender-auth:message-id:subject:to:cc :content-type; bh=soXwXsriCnPocEk3BSBLKLTePyGHCTAbH4C2g2zOhxM=; b=Iwjib4TdmDgVMXHpfqYU0GxPRMu1tFMhf9gIZMRvyh4p5cS7DNAcxeeyn1tNR7i+Ip qIx/2hQ2/hqAlayMGecMTcnzTI0Kz8OLxPXwDbJObxjL/H/fxidPkU64OF3cZL8IH17v pCG/gnLvokuVd02PIPzKrV+GqsqLGge6RRZnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=wK7G9CEb2w+aSzPnlYHZV3/mnt7KoReiV6g+0qG8tyBNRFAgwweSWCh3vaKlksvk/5 9CPYl+0c/2AAiT/s+AhsSvQbSybiORZnnUrvWjt3KMLdG1UfHsTL84yRjh4z//xl7cAx 4SdOpG3c8vU8a+i/cJgXsIn7vOa329mBgzzes= MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.216.86.85 with SMTP id v63mr470777wee.32.1262804617027; Wed, 06 Jan 2010 11:03:37 -0800 (PST) In-Reply-To: <4B44D8FA.2000608@FreeBSD.org> References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> From: Ivan Voras Date: Wed, 6 Jan 2010 20:03:16 +0100 X-Google-Sender-Auth: 2db26b6cfc458966 Message-ID: <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> To: Alexander Motin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 19:03:45 -0000 2010/1/6 Alexander Motin : > Ivan Voras wrote: >> I think there was one more reason - though I'm not sure if it is still >> valid because of your current and future work - the MAXPHYS >> limitation. If MAXPHYS is 128k, with 64k stripes data was only to be >> read from maximum of 2 drives. With 4k stripes it would have been read >> from 128/4=32 drives, though I agree 4k is too low in any case >> nowadays. I usually choose 16k or 32k for my setups. > > While you are right about MAXPHYS influence, and I hope we can rise it > not so far, IMHO it is file system business to manage deep enough > read-ahead/write-back to make all drives busy, independently from > MAXPHYS value. With small MAXPHYS value FS should just generate more > requests in advance. Except some RAID3/5/6 cases, where short writes > ineffective, MAXPHYS value should only affect processing overhead. Yes, my experience which lead to the post was mostly on UFS which, while AFAIK it does read-ahead, it still does it serially (I think this is implied by your experiments with NCQ and ZFS vs UFS) - so in any case only 2 drives are hit with 64k stripe size at any moment in time. In any case, as you say it is tunable so personal preferences can be applied. Thanks! From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 19:23:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A136E106568F; Wed, 6 Jan 2010 19:23:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 70C428FC2D; Wed, 6 Jan 2010 19:23:17 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1D4DE46B49; Wed, 6 Jan 2010 14:23:17 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BFF508A01D; Wed, 6 Jan 2010 14:23:04 -0500 (EST) From: John Baldwin To: "Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?=" Date: Wed, 6 Jan 2010 14:00:26 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> In-Reply-To: <867hrvgw2j.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201001061400.26082.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 06 Jan 2010 14:23:04 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 19:23:17 -0000 On Wednesday 06 January 2010 9:13:56 am Dag-Erling Sm=C3=B8rgrav wrote: > Doug Barton writes: > > First off, thanks for sorting these, that's a step in the right > > direction. :) However, a few quibbles. First, our rule is that > > anything which might offend someone belongs in fortunes-o, and > > political quotes are always in the category of "might offend someone." >=20 > I don't see how the Rumsfeld quote could offend anyone. True, Rumsfeld > is a politician (and not a particularly popular one in most parts of the > world), but the quote itself is not political. It is a somewhat > comically worded expression of an important truism that many people > would do well to remember (cf. the classical "there are no unknown bugs > in our software"). Would you have suggested moving it to -o if it had > been a Steve Martin quote? I agree that the quote isn't particularly politically partisan, just made b= y a=20 political figure. =2D-=20 John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:01:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5C5C106566C; Wed, 6 Jan 2010 20:01:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 37C3E8FC16; Wed, 6 Jan 2010 20:01:30 +0000 (UTC) Received: from c122-106-170-81.carlnfd1.nsw.optusnet.com.au (c122-106-170-81.carlnfd1.nsw.optusnet.com.au [122.106.170.81]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o06K1SwI017802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 7 Jan 2010 07:01:29 +1100 Date: Thu, 7 Jan 2010 07:01:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Ivan Voras In-Reply-To: <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> Message-ID: <20100107065127.U55530@delplex.bde.org> References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:01:31 -0000 On Wed, 6 Jan 2010, Ivan Voras wrote: > 2010/1/6 Alexander Motin : >> Ivan Voras wrote: > >>> I think there was one more reason - though I'm not sure if it is still >>> valid because of your current and future work - the MAXPHYS >>> limitation. If MAXPHYS is 128k, with 64k stripes data was only to be >>> read from maximum of 2 drives. With 4k stripes it would have been read >>> from 128/4=32 drives, though I agree 4k is too low in any case >>> nowadays. I usually choose 16k or 32k for my setups. >> >> While you are right about MAXPHYS influence, and I hope we can rise it >> not so far, IMHO it is file system business to manage deep enough >> read-ahead/write-back to make all drives busy, independently from >> MAXPHYS value. With small MAXPHYS value FS should just generate more >> requests in advance. Except some RAID3/5/6 cases, where short writes >> ineffective, MAXPHYS value should only affect processing overhead. > > Yes, my experience which lead to the post was mostly on UFS which, > while AFAIK it does read-ahead, it still does it serially (I think > this is implied by your experiments with NCQ and ZFS vs UFS) - so in > any case only 2 drives are hit with 64k stripe size at any moment in > time. fsck has no signifcant knowledge of read-ahead. Normally it uses vfs read clustering, which under the most favourable circumstances reduces to read-ahead of a maxiumum of MAXPHYS (less the initial size). If read clustering is disabled, then ffs does old-style read-ahead of a whole block (16K). Most file systems in FreeBSD are similar or worse (some support a block size of 512 and reading ahead by that amount gives interestingly slow behaviour). Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:07:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D570106566B; Wed, 6 Jan 2010 20:07:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFE028FC13; Wed, 6 Jan 2010 20:07:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06K7Im1026016; Wed, 6 Jan 2010 20:07:18 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06K7IlA026014; Wed, 6 Jan 2010 20:07:18 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001062007.o06K7IlA026014@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 20:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201663 - stable/6/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:07:19 -0000 Author: bz Date: Wed Jan 6 20:07:18 2010 New Revision: 201663 URL: http://svn.freebsd.org/changeset/base/201663 Log: MFC r186948 (w/o the IPv6 parts): Make SIOCGIFADDR and related, jail-aware. Up to now we returned the first address of the interface for SIOCGIFADDR w/o an ifr_addr in the query. This caused problems for programs querying for an address but running inside a jail, as the address returned usually did not belong to the jail. If there was an ifr_addr given on v4, you could probe for more addresses on the interfaces that you were not allowed to see from inside a jail. Return an error (EADDRNOTAVAIL) in that case now unless the address is on the given interface and valid for the jail. PR: kern/114325 Thanks to: Axel Scheepers (axel.scheepers nl.clara.net) Modified: stable/6/sys/netinet/in.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/netinet/in.c ============================================================================== --- stable/6/sys/netinet/in.c Wed Jan 6 20:04:36 2010 (r201662) +++ stable/6/sys/netinet/in.c Wed Jan 6 20:07:18 2010 (r201663) @@ -38,7 +38,9 @@ #include #include #include +#include #include +#include #include #include @@ -254,13 +256,19 @@ in_control(so, cmd, data, ifp, td) LIST_FOREACH(iap, INADDR_HASH(dst.s_addr), ia_hash) if (iap->ia_ifp == ifp && iap->ia_addr.sin_addr.s_addr == dst.s_addr) { - ia = iap; + if (td == NULL || !prison_ip( + td->td_ucred, 0, &dst.s_addr)) + ia = iap; break; } if (ia == NULL) TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { iap = ifatoia(ifa); if (iap->ia_addr.sin_family == AF_INET) { + if (td != NULL && + prison_ip(td->td_ucred, 0, + &iap->ia_addr.sin_addr.s_addr)) + continue; ia = iap; break; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:28:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E32C106566C; Wed, 6 Jan 2010 20:28:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 326F58FC27; Wed, 6 Jan 2010 20:28:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06KSm1N030883; Wed, 6 Jan 2010 20:28:48 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06KSm4R030879; Wed, 6 Jan 2010 20:28:48 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201001062028.o06KSm4R030879@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 6 Jan 2010 20:28:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201665 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:28:48 -0000 Author: jkim Date: Wed Jan 6 20:28:47 2010 New Revision: 201665 URL: http://svn.freebsd.org/changeset/base/201665 Log: MFC: r200251 - Try pre-allocating all FIBs upfront. Previously we tried pre-allocating 128 FIBs first and allocated more later if necessary. Remove now unused definitions from the header file[1]. - Force sequential bus scanning. It seems parallel scanning is in fact slower and causes more harm than good[1]. Adjust a comment to reflect that. Modified: stable/8/sys/dev/aac/aac.c stable/8/sys/dev/aac/aac_cam.c stable/8/sys/dev/aac/aacvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Wed Jan 6 20:08:20 2010 (r201664) +++ stable/8/sys/dev/aac/aac.c Wed Jan 6 20:28:47 2010 (r201665) @@ -604,7 +604,7 @@ aac_alloc(struct aac_softc *sc) TAILQ_INIT(&sc->aac_fibmap_tqh); sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command), M_AACBUF, M_WAITOK|M_ZERO); - while (sc->total_fibs < AAC_PREALLOCATE_FIBS) { + while (sc->total_fibs < sc->aac_max_fibs) { if (aac_alloc_commands(sc) != 0) break; } Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Wed Jan 6 20:08:20 2010 (r201664) +++ stable/8/sys/dev/aac/aac_cam.c Wed Jan 6 20:28:47 2010 (r201665) @@ -260,8 +260,11 @@ aac_cam_action(struct cam_sim *sim, unio cpi->hba_inquiry = PI_WIDE_16; cpi->target_sprt = 0; - /* Resetting via the passthrough causes problems. */ - cpi->hba_misc = PIM_NOBUSRESET; + /* + * Resetting via the passthrough or parallel bus scan + * causes problems. + */ + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; cpi->hba_eng_cnt = 0; cpi->max_target = camsc->inf->TargetsPerBus; cpi->max_lun = 8; /* Per the controller spec */ Modified: stable/8/sys/dev/aac/aacvar.h ============================================================================== --- stable/8/sys/dev/aac/aacvar.h Wed Jan 6 20:08:20 2010 (r201664) +++ stable/8/sys/dev/aac/aacvar.h Wed Jan 6 20:28:47 2010 (r201665) @@ -57,13 +57,6 @@ #define AAC_ADAPTER_FIBS 8 /* - * FIBs are allocated in page-size chunks and can grow up to the 512 - * limit imposed by the hardware. - */ -#define AAC_PREALLOCATE_FIBS 128 -#define AAC_NUM_MGT_FIB 8 - -/* * The controller reports status events in AIFs. We hang on to a number of * these in order to pass them out to user-space management tools. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:40:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 222D7106568B; Wed, 6 Jan 2010 20:40:42 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105358FC1B; Wed, 6 Jan 2010 20:40:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Kef0K033559; Wed, 6 Jan 2010 20:40:41 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06KefPJ033557; Wed, 6 Jan 2010 20:40:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001062040.o06KefPJ033557@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 6 Jan 2010 20:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201667 - stable/8/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:40:42 -0000 Author: gavin Date: Wed Jan 6 20:40:41 2010 New Revision: 201667 URL: http://svn.freebsd.org/changeset/base/201667 Log: MFC r200820: Support the tablet in (at least) the Toshiba Portege M200 Tablet PC. This device only appears on the ACPI bus, so isn't caught by the current entry for it in the uart(4) ISA attachment. PR: kern/140172 Reviewed by: jhb, marcel Approved by: ed (mentor, implicit) Modified: stable/8/sys/dev/uart/uart_bus_acpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_acpi.c Wed Jan 6 20:39:57 2010 (r201666) +++ stable/8/sys/dev/uart/uart_bus_acpi.c Wed Jan 6 20:40:41 2010 (r201667) @@ -59,6 +59,7 @@ static driver_t uart_acpi_driver = { static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ {0} }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:41:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C8D7106568F; Wed, 6 Jan 2010 20:41:13 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0DE8FC0A; Wed, 6 Jan 2010 20:41:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06KfDaC033696; Wed, 6 Jan 2010 20:41:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06KfCet033694; Wed, 6 Jan 2010 20:41:12 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001062041.o06KfCet033694@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 6 Jan 2010 20:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201668 - stable/7/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:41:13 -0000 Author: gavin Date: Wed Jan 6 20:41:12 2010 New Revision: 201668 URL: http://svn.freebsd.org/changeset/base/201668 Log: MFC r200820: Support the tablet in (at least) the Toshiba Portege M200 Tablet PC. This device only appears on the ACPI bus, so isn't caught by the current entry for it in the uart(4) ISA attachment. PR: kern/140172 Reviewed by: jhb, marcel Approved by: ed (mentor, implicit) Modified: stable/7/sys/dev/uart/uart_bus_acpi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_acpi.c Wed Jan 6 20:40:41 2010 (r201667) +++ stable/7/sys/dev/uart/uart_bus_acpi.c Wed Jan 6 20:41:12 2010 (r201668) @@ -59,6 +59,7 @@ static driver_t uart_acpi_driver = { static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ {0} }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:43:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95D831065672; Wed, 6 Jan 2010 20:43:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855578FC08; Wed, 6 Jan 2010 20:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Kheb1034290; Wed, 6 Jan 2010 20:43:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06KhebK034288; Wed, 6 Jan 2010 20:43:40 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201001062043.o06KhebK034288@svn.freebsd.org> From: John Baldwin Date: Wed, 6 Jan 2010 20:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201669 - head/lib/libc/stdtime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:43:40 -0000 Author: jhb Date: Wed Jan 6 20:43:40 2010 New Revision: 201669 URL: http://svn.freebsd.org/changeset/base/201669 Log: Use _pthread_once() rather than _once() for localtime() and gmtime(). These methods are only invoked when __isthreaded is true at which point it is safe to use _pthread_once() directly. MFC after: 1 week Modified: head/lib/libc/stdtime/localtime.c Modified: head/lib/libc/stdtime/localtime.c ============================================================================== --- head/lib/libc/stdtime/localtime.c Wed Jan 6 20:41:12 2010 (r201668) +++ head/lib/libc/stdtime/localtime.c Wed Jan 6 20:43:40 2010 (r201669) @@ -1426,7 +1426,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&localtime_once, localtime_key_init); + _pthread_once(&localtime_once, localtime_key_init); if (localtime_key_error != 0) { errno = localtime_key_error; return(NULL); @@ -1527,7 +1527,7 @@ const time_t * const timep; struct tm *p_tm; if (__isthreaded != 0) { - _once(&gmtime_once, gmtime_key_init); + _pthread_once(&gmtime_once, gmtime_key_init); if (gmtime_key_error != 0) { errno = gmtime_key_error; return(NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:51:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E654D106568F; Wed, 6 Jan 2010 20:51:04 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4F9C8FC0C; Wed, 6 Jan 2010 20:51:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Kp4SK036045; Wed, 6 Jan 2010 20:51:04 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06Kp4V9036041; Wed, 6 Jan 2010 20:51:04 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201001062051.o06Kp4V9036041@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 6 Jan 2010 20:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201671 - stable/7/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:51:05 -0000 Author: jkim Date: Wed Jan 6 20:51:04 2010 New Revision: 201671 URL: http://svn.freebsd.org/changeset/base/201671 Log: MFC: r200251 - Try pre-allocating all FIBs upfront. Previously we tried pre-allocating 128 FIBs first and allocated more later if necessary. Remove now unused definitions from the header file. - Force sequential bus scanning. It seems parallel scanning is in fact slower and causes more harm than good. Adjust a comment to reflect that. Modified: stable/7/sys/dev/aac/aac.c stable/7/sys/dev/aac/aac_cam.c stable/7/sys/dev/aac/aacvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac.c ============================================================================== --- stable/7/sys/dev/aac/aac.c Wed Jan 6 20:46:05 2010 (r201670) +++ stable/7/sys/dev/aac/aac.c Wed Jan 6 20:51:04 2010 (r201671) @@ -604,7 +604,7 @@ aac_alloc(struct aac_softc *sc) TAILQ_INIT(&sc->aac_fibmap_tqh); sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command), M_AACBUF, M_WAITOK|M_ZERO); - while (sc->total_fibs < AAC_PREALLOCATE_FIBS) { + while (sc->total_fibs < sc->aac_max_fibs) { if (aac_alloc_commands(sc) != 0) break; } Modified: stable/7/sys/dev/aac/aac_cam.c ============================================================================== --- stable/7/sys/dev/aac/aac_cam.c Wed Jan 6 20:46:05 2010 (r201670) +++ stable/7/sys/dev/aac/aac_cam.c Wed Jan 6 20:51:04 2010 (r201671) @@ -260,8 +260,11 @@ aac_cam_action(struct cam_sim *sim, unio cpi->hba_inquiry = PI_WIDE_16; cpi->target_sprt = 0; - /* Resetting via the passthrough causes problems. */ - cpi->hba_misc = PIM_NOBUSRESET; + /* + * Resetting via the passthrough or parallel bus scan + * causes problems. + */ + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; cpi->hba_eng_cnt = 0; cpi->max_target = camsc->inf->TargetsPerBus; cpi->max_lun = 8; /* Per the controller spec */ Modified: stable/7/sys/dev/aac/aacvar.h ============================================================================== --- stable/7/sys/dev/aac/aacvar.h Wed Jan 6 20:46:05 2010 (r201670) +++ stable/7/sys/dev/aac/aacvar.h Wed Jan 6 20:51:04 2010 (r201671) @@ -57,13 +57,6 @@ #define AAC_ADAPTER_FIBS 8 /* - * FIBs are allocated in page-size chunks and can grow up to the 512 - * limit imposed by the hardware. - */ -#define AAC_PREALLOCATE_FIBS 128 -#define AAC_NUM_MGT_FIB 8 - -/* * The controller reports status events in AIFs. We hang on to a number of * these in order to pass them out to user-space management tools. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 20:54:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3787106566C; Wed, 6 Jan 2010 20:54:04 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1D8F8FC0C; Wed, 6 Jan 2010 20:54:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Ks4id036745; Wed, 6 Jan 2010 20:54:04 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06Ks4XE036743; Wed, 6 Jan 2010 20:54:04 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001062054.o06Ks4XE036743@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 6 Jan 2010 20:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201672 - stable/8/usr.sbin/powerd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 20:54:05 -0000 Author: gavin Date: Wed Jan 6 20:54:04 2010 New Revision: 201672 URL: http://svn.freebsd.org/changeset/base/201672 Log: MFC r200819: Grammar and minor tweaks to powerd(8) man page. PR: docs/133186 Approved by: ed (mentor, implicit) Modified: stable/8/usr.sbin/powerd/powerd.8 Directory Properties: stable/8/usr.sbin/powerd/ (props changed) Modified: stable/8/usr.sbin/powerd/powerd.8 ============================================================================== --- stable/8/usr.sbin/powerd/powerd.8 Wed Jan 6 20:51:04 2010 (r201671) +++ stable/8/usr.sbin/powerd/powerd.8 Wed Jan 6 20:54:04 2010 (r201672) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2008 +.Dd December 21, 2009 .Dt POWERD 8 .Os .Sh NAME @@ -45,7 +45,7 @@ The .Nm utility monitors the system state and sets various power control options accordingly. -It offers three modes (maximum, minimum, and adaptive) that can be +It offers four modes (maximum, minimum, adaptive and hiadaptive) that can be individually selected while on AC power or batteries. The modes maximum, minimum, adaptive and hiadaptive may be abbreviated max, min, adp, hadp. @@ -57,9 +57,10 @@ Adaptive mode attempts to strike a balan the system appears idle and increasing it when the system is busy. It offers a good balance between a small performance loss for greatly increased power savings. -Hiadaptive mode is alike adaptive mode, but tuned for systems where +Hiadaptive mode is like adaptive mode, but tuned for systems where performance and interactivity are more important then power consumption. -It rises frequency faster, drops slower and keeps twice lower CPU load. +It increases frequency faster, reduces the frequency less aggressively and +will maintain full frequency for longer. The default mode is adaptive for battery power and hiadaptive for the rest. .Pp The From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 21:45:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37C7F106568B; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 233C38FC1E; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06LjVTt048826; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06LjUeT048823; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201001062145.o06LjUeT048823@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 6 Jan 2010 21:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201679 - releng/6.3 releng/6.3/contrib/bind9/bin/named releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/bind9/lib/dns/include/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf rel... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 21:45:31 -0000 Author: simon Date: Wed Jan 6 21:45:30 2010 New Revision: 201679 URL: http://svn.freebsd.org/changeset/base/201679 Log: Fix BIND named(8) cache poisoning with DNSSEC validation. [SA-10:01] Fix ntpd mode 7 denial of service. [SA-10:02] Fix ZFS ZIL playback with insecure permissions. [SA-10:03] Various FreeBSD 8.0-RELEASE improvements. [EN-10:01] Security: FreeBSD-SA-10:01.bind Security: FreeBSD-SA-10:02.ntpd Security: FreeBSD-SA-10:03.zfs Errata: FreeBSD-EN-10:01.freebsd Approved by: so (simon) Modified: stable/7/contrib/ntp/ntpd/ntp_request.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Changes in other areas also in this revision: Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/bin/named/query.c releng/6.3/contrib/bind9/lib/dns/include/dns/types.h releng/6.3/contrib/bind9/lib/dns/masterdump.c releng/6.3/contrib/bind9/lib/dns/rbtdb.c releng/6.3/contrib/bind9/lib/dns/resolver.c releng/6.3/contrib/bind9/lib/dns/validator.c releng/6.3/contrib/ntp/ntpd/ntp_request.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/bin/named/query.c releng/6.4/contrib/bind9/lib/dns/include/dns/types.h releng/6.4/contrib/bind9/lib/dns/masterdump.c releng/6.4/contrib/bind9/lib/dns/rbtdb.c releng/6.4/contrib/bind9/lib/dns/resolver.c releng/6.4/contrib/bind9/lib/dns/validator.c releng/6.4/contrib/ntp/ntpd/ntp_request.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/bin/named/query.c releng/7.1/contrib/bind9/lib/dns/include/dns/types.h releng/7.1/contrib/bind9/lib/dns/masterdump.c releng/7.1/contrib/bind9/lib/dns/rbtdb.c releng/7.1/contrib/bind9/lib/dns/resolver.c releng/7.1/contrib/bind9/lib/dns/validator.c releng/7.1/contrib/ntp/ntpd/ntp_request.c releng/7.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/bind9/bin/named/query.c releng/7.2/contrib/bind9/lib/dns/include/dns/types.h releng/7.2/contrib/bind9/lib/dns/masterdump.c releng/7.2/contrib/bind9/lib/dns/rbtdb.c releng/7.2/contrib/bind9/lib/dns/resolver.c releng/7.2/contrib/bind9/lib/dns/validator.c releng/7.2/contrib/ntp/ntpd/ntp_request.c releng/7.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.2/sys/conf/newvers.sh releng/8.0/UPDATING releng/8.0/contrib/bind9/bin/named/query.c releng/8.0/contrib/bind9/lib/dns/include/dns/types.h releng/8.0/contrib/bind9/lib/dns/masterdump.c releng/8.0/contrib/bind9/lib/dns/rbtdb.c releng/8.0/contrib/bind9/lib/dns/resolver.c releng/8.0/contrib/bind9/lib/dns/validator.c releng/8.0/contrib/ntp/ntpd/ntp_request.c releng/8.0/sys/cddl/compat/opensolaris/sys/vnode.h releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h releng/8.0/sys/conf/newvers.sh releng/8.0/sys/kern/vfs_lookup.c releng/8.0/sys/netinet/ip_mroute.c releng/8.0/sys/netinet/raw_ip.c releng/8.0/sys/netinet/sctp_input.c releng/8.0/sys/netinet6/raw_ip6.c releng/8.0/sys/rpc/clnt_vc.c stable/6/contrib/bind9/bin/named/query.c stable/6/contrib/bind9/lib/dns/include/dns/types.h stable/6/contrib/bind9/lib/dns/masterdump.c stable/6/contrib/bind9/lib/dns/rbtdb.c stable/6/contrib/bind9/lib/dns/resolver.c stable/6/contrib/bind9/lib/dns/validator.c stable/6/contrib/ntp/ntpd/ntp_request.c stable/8/contrib/ntp/ntpd/ntp_request.c Modified: stable/7/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- stable/7/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/7/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:45:30 2010 (r201679) @@ -409,6 +409,7 @@ process_private( int mod_okay ) { + static u_long quiet_until; struct req_pkt *inpkt; struct req_pkt_tail *tailinpkt; struct sockaddr_storage *srcadr; @@ -444,8 +445,14 @@ process_private( || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0) || (++ec, rbufp->recv_length < REQ_LEN_HDR) ) { - msyslog(LOG_ERR, "process_private: INFO_ERR_FMT: test %d failed, pkt from %s", ec, stoa(srcadr)); - req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); + NLOG(NLOG_SYSEVENT) + if (current_time >= quiet_until) { + msyslog(LOG_ERR, + "process_private: drop test %d" + " failed, pkt from %s", + ec, stoa(srcadr)); + quiet_until = current_time + 60; + } return; } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Wed Jan 6 21:45:30 2010 (r201679) @@ -60,10 +60,14 @@ zfs_init_vattr(vattr_t *vap, uint64_t ma { VATTR_NULL(vap); vap->va_mask = (uint_t)mask; - vap->va_type = IFTOVT(mode); - vap->va_mode = mode & MODEMASK; - vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid; - vap->va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid; + if (mask & AT_TYPE) + vap->va_type = IFTOVT(mode); + if (mask & AT_MODE) + vap->va_mode = mode & MODEMASK; + if (mask & AT_UID) + vap->va_uid = (uid_t)(IS_EPHEMERAL(uid)) ? -1 : uid; + if (mask & AT_GID) + vap->va_gid = (gid_t)(IS_EPHEMERAL(gid)) ? -1 : gid; vap->va_rdev = zfs_cmpldev(rdev); vap->va_nodeid = nodeid; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 21:45:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 587071065698; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43F488FC1F; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06LjVpw048832; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06LjVI9048830; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201001062145.o06LjVI9048830@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 6 Jan 2010 21:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201679 - releng/6.3 releng/6.3/contrib/bind9/bin/named releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/bind9/lib/dns/include/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf rel... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 21:45:31 -0000 Author: simon Date: Wed Jan 6 21:45:30 2010 New Revision: 201679 URL: http://svn.freebsd.org/changeset/base/201679 Log: Fix BIND named(8) cache poisoning with DNSSEC validation. [SA-10:01] Fix ntpd mode 7 denial of service. [SA-10:02] Fix ZFS ZIL playback with insecure permissions. [SA-10:03] Various FreeBSD 8.0-RELEASE improvements. [EN-10:01] Security: FreeBSD-SA-10:01.bind Security: FreeBSD-SA-10:02.ntpd Security: FreeBSD-SA-10:03.zfs Errata: FreeBSD-EN-10:01.freebsd Approved by: so (simon) Modified: stable/8/contrib/ntp/ntpd/ntp_request.c Changes in other areas also in this revision: Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/bin/named/query.c releng/6.3/contrib/bind9/lib/dns/include/dns/types.h releng/6.3/contrib/bind9/lib/dns/masterdump.c releng/6.3/contrib/bind9/lib/dns/rbtdb.c releng/6.3/contrib/bind9/lib/dns/resolver.c releng/6.3/contrib/bind9/lib/dns/validator.c releng/6.3/contrib/ntp/ntpd/ntp_request.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/bin/named/query.c releng/6.4/contrib/bind9/lib/dns/include/dns/types.h releng/6.4/contrib/bind9/lib/dns/masterdump.c releng/6.4/contrib/bind9/lib/dns/rbtdb.c releng/6.4/contrib/bind9/lib/dns/resolver.c releng/6.4/contrib/bind9/lib/dns/validator.c releng/6.4/contrib/ntp/ntpd/ntp_request.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/bin/named/query.c releng/7.1/contrib/bind9/lib/dns/include/dns/types.h releng/7.1/contrib/bind9/lib/dns/masterdump.c releng/7.1/contrib/bind9/lib/dns/rbtdb.c releng/7.1/contrib/bind9/lib/dns/resolver.c releng/7.1/contrib/bind9/lib/dns/validator.c releng/7.1/contrib/ntp/ntpd/ntp_request.c releng/7.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/bind9/bin/named/query.c releng/7.2/contrib/bind9/lib/dns/include/dns/types.h releng/7.2/contrib/bind9/lib/dns/masterdump.c releng/7.2/contrib/bind9/lib/dns/rbtdb.c releng/7.2/contrib/bind9/lib/dns/resolver.c releng/7.2/contrib/bind9/lib/dns/validator.c releng/7.2/contrib/ntp/ntpd/ntp_request.c releng/7.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.2/sys/conf/newvers.sh releng/8.0/UPDATING releng/8.0/contrib/bind9/bin/named/query.c releng/8.0/contrib/bind9/lib/dns/include/dns/types.h releng/8.0/contrib/bind9/lib/dns/masterdump.c releng/8.0/contrib/bind9/lib/dns/rbtdb.c releng/8.0/contrib/bind9/lib/dns/resolver.c releng/8.0/contrib/bind9/lib/dns/validator.c releng/8.0/contrib/ntp/ntpd/ntp_request.c releng/8.0/sys/cddl/compat/opensolaris/sys/vnode.h releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h releng/8.0/sys/conf/newvers.sh releng/8.0/sys/kern/vfs_lookup.c releng/8.0/sys/netinet/ip_mroute.c releng/8.0/sys/netinet/raw_ip.c releng/8.0/sys/netinet/sctp_input.c releng/8.0/sys/netinet6/raw_ip6.c releng/8.0/sys/rpc/clnt_vc.c stable/6/contrib/bind9/bin/named/query.c stable/6/contrib/bind9/lib/dns/include/dns/types.h stable/6/contrib/bind9/lib/dns/masterdump.c stable/6/contrib/bind9/lib/dns/rbtdb.c stable/6/contrib/bind9/lib/dns/resolver.c stable/6/contrib/bind9/lib/dns/validator.c stable/6/contrib/ntp/ntpd/ntp_request.c stable/7/contrib/ntp/ntpd/ntp_request.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c Modified: stable/8/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- stable/8/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/8/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:45:30 2010 (r201679) @@ -409,6 +409,7 @@ process_private( int mod_okay ) { + static u_long quiet_until; struct req_pkt *inpkt; struct req_pkt_tail *tailinpkt; struct sockaddr_storage *srcadr; @@ -444,8 +445,14 @@ process_private( || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0) || (++ec, rbufp->recv_length < REQ_LEN_HDR) ) { - msyslog(LOG_ERR, "process_private: INFO_ERR_FMT: test %d failed, pkt from %s", ec, stoa(srcadr)); - req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); + NLOG(NLOG_SYSEVENT) + if (current_time >= quiet_until) { + msyslog(LOG_ERR, + "process_private: drop test %d" + " failed, pkt from %s", + ec, stoa(srcadr)); + quiet_until = current_time + 60; + } return; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 21:45:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DACE210656A6; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C65798FC15; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06LjVCL048862; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06LjVCB048836; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201001062145.o06LjVCB048836@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 6 Jan 2010 21:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201679 - releng/6.3 releng/6.3/contrib/bind9/bin/named releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/bind9/lib/dns/include/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf rel... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 21:45:31 -0000 Author: simon Date: Wed Jan 6 21:45:30 2010 New Revision: 201679 URL: http://svn.freebsd.org/changeset/base/201679 Log: Fix BIND named(8) cache poisoning with DNSSEC validation. [SA-10:01] Fix ntpd mode 7 denial of service. [SA-10:02] Fix ZFS ZIL playback with insecure permissions. [SA-10:03] Various FreeBSD 8.0-RELEASE improvements. [EN-10:01] Security: FreeBSD-SA-10:01.bind Security: FreeBSD-SA-10:02.ntpd Security: FreeBSD-SA-10:03.zfs Errata: FreeBSD-EN-10:01.freebsd Approved by: so (simon) Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/bin/named/query.c releng/6.3/contrib/bind9/lib/dns/include/dns/types.h releng/6.3/contrib/bind9/lib/dns/masterdump.c releng/6.3/contrib/bind9/lib/dns/rbtdb.c releng/6.3/contrib/bind9/lib/dns/resolver.c releng/6.3/contrib/bind9/lib/dns/validator.c releng/6.3/contrib/ntp/ntpd/ntp_request.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/bin/named/query.c releng/6.4/contrib/bind9/lib/dns/include/dns/types.h releng/6.4/contrib/bind9/lib/dns/masterdump.c releng/6.4/contrib/bind9/lib/dns/rbtdb.c releng/6.4/contrib/bind9/lib/dns/resolver.c releng/6.4/contrib/bind9/lib/dns/validator.c releng/6.4/contrib/ntp/ntpd/ntp_request.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/bin/named/query.c releng/7.1/contrib/bind9/lib/dns/include/dns/types.h releng/7.1/contrib/bind9/lib/dns/masterdump.c releng/7.1/contrib/bind9/lib/dns/rbtdb.c releng/7.1/contrib/bind9/lib/dns/resolver.c releng/7.1/contrib/bind9/lib/dns/validator.c releng/7.1/contrib/ntp/ntpd/ntp_request.c releng/7.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/bind9/bin/named/query.c releng/7.2/contrib/bind9/lib/dns/include/dns/types.h releng/7.2/contrib/bind9/lib/dns/masterdump.c releng/7.2/contrib/bind9/lib/dns/rbtdb.c releng/7.2/contrib/bind9/lib/dns/resolver.c releng/7.2/contrib/bind9/lib/dns/validator.c releng/7.2/contrib/ntp/ntpd/ntp_request.c releng/7.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.2/sys/conf/newvers.sh releng/8.0/UPDATING releng/8.0/contrib/bind9/bin/named/query.c releng/8.0/contrib/bind9/lib/dns/include/dns/types.h releng/8.0/contrib/bind9/lib/dns/masterdump.c releng/8.0/contrib/bind9/lib/dns/rbtdb.c releng/8.0/contrib/bind9/lib/dns/resolver.c releng/8.0/contrib/bind9/lib/dns/validator.c releng/8.0/contrib/ntp/ntpd/ntp_request.c releng/8.0/sys/cddl/compat/opensolaris/sys/vnode.h releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h releng/8.0/sys/conf/newvers.sh releng/8.0/sys/kern/vfs_lookup.c releng/8.0/sys/netinet/ip_mroute.c releng/8.0/sys/netinet/raw_ip.c releng/8.0/sys/netinet/sctp_input.c releng/8.0/sys/netinet6/raw_ip6.c releng/8.0/sys/rpc/clnt_vc.c Changes in other areas also in this revision: Modified: stable/6/contrib/bind9/bin/named/query.c stable/6/contrib/bind9/lib/dns/include/dns/types.h stable/6/contrib/bind9/lib/dns/masterdump.c stable/6/contrib/bind9/lib/dns/rbtdb.c stable/6/contrib/bind9/lib/dns/resolver.c stable/6/contrib/bind9/lib/dns/validator.c stable/6/contrib/ntp/ntpd/ntp_request.c stable/7/contrib/ntp/ntpd/ntp_request.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/8/contrib/ntp/ntpd/ntp_request.c Modified: releng/6.3/UPDATING ============================================================================== --- releng/6.3/UPDATING Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/UPDATING Wed Jan 6 21:45:30 2010 (r201679) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20100106: p15 FreeBSD-SA-10:01.bind, FreeBSD-SA-10:02.ntpd + Fix BIND named(8) cache poisoning with DNSSEC validation. + [SA-10:01] + + Fix ntpd mode 7 denial of service. [SA-10:02] + 20091203: p14 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:17.freebsd-update Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Modified: releng/6.3/contrib/bind9/bin/named/query.c ============================================================================== --- releng/6.3/contrib/bind9/bin/named/query.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/bin/named/query.c Wed Jan 6 21:45:30 2010 (r201679) @@ -92,6 +92,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + static void query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype); @@ -1698,14 +1700,14 @@ query_addbestns(ns_client_t *client) { zsigrdataset = NULL; } - if ((client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0 && - (rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending))) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && + !PENDINGOK(client->query.dboptions)) goto cleanup; - if (WANTDNSSEC(client) && SECURE(client) && - (rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue))) + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && + SECURE(client) && WANTDNSSEC(client)) goto cleanup; query_addrrset(client, &fname, &rdataset, &sigrdataset, dbuf, @@ -2364,6 +2366,8 @@ query_find(ns_client_t *client, dns_fetc unsigned int options; isc_boolean_t empty_wild; dns_rdataset_t *noqname; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -2563,9 +2567,47 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: releng/6.3/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:45:30 2010 (r201679) @@ -226,40 +226,51 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /* Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) - /* Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + + /*% Received in the additional section of a response. */ + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - /* Received in a referral response. */ - dns_trust_glue = 3, + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + /* * Name checking severites. */ Modified: releng/6.3/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:45:30 2010 (r201679) @@ -763,7 +763,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: releng/6.3/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:45:30 2010 (r201679) @@ -2652,7 +2652,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3113,7 +3113,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: releng/6.3/contrib/bind9/lib/dns/resolver.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:45:30 2010 (r201679) @@ -3603,6 +3603,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3639,12 +3640,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -3964,7 +3987,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: releng/6.3/contrib/bind9/lib/dns/validator.c ============================================================================== --- releng/6.3/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:45:30 2010 (r201679) @@ -235,7 +235,7 @@ auth_nonpending(dns_message_t *message) rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link)) { - if (rdataset->trust == dns_trust_pending) + if (DNS_TRUST_PENDING(rdataset->trust)) rdataset->trust = dns_trust_authauthority; } } @@ -1146,7 +1146,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1161,7 +1161,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -1723,7 +1723,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -1736,7 +1736,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ Modified: releng/6.3/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- releng/6.3/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:45:30 2010 (r201679) @@ -404,6 +404,7 @@ process_private( int mod_okay ) { + static u_long quiet_until; struct req_pkt *inpkt; struct req_pkt_tail *tailinpkt; struct sockaddr_storage *srcadr; @@ -439,8 +440,14 @@ process_private( || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0) || (++ec, rbufp->recv_length < REQ_LEN_HDR) ) { - msyslog(LOG_ERR, "process_private: INFO_ERR_FMT: test %d failed, pkt from %s", ec, stoa(srcadr)); - req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); + NLOG(NLOG_SYSEVENT) + if (current_time >= quiet_until) { + msyslog(LOG_ERR, + "process_private: drop test %d" + " failed, pkt from %s", + ec, stoa(srcadr)); + quiet_until = current_time + 60; + } return; } Modified: releng/6.3/sys/conf/newvers.sh ============================================================================== --- releng/6.3/sys/conf/newvers.sh Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.3/sys/conf/newvers.sh Wed Jan 6 21:45:30 2010 (r201679) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.3" -BRANCH="RELEASE-p14" +BRANCH="RELEASE-p15" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/6.4/UPDATING ============================================================================== --- releng/6.4/UPDATING Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/UPDATING Wed Jan 6 21:45:30 2010 (r201679) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20100106: p9 FreeBSD-SA-10:01.bind, FreeBSD-SA-10:02.ntpd + Fix BIND named(8) cache poisoning with DNSSEC validation. + [SA-10:01] + + Fix ntpd mode 7 denial of service. [SA-10:02] + 20091203: p8 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:17.freebsd-update Disable SSL renegotiation in order to protect against a serious protocol flaw. [09:15] Modified: releng/6.4/contrib/bind9/bin/named/query.c ============================================================================== --- releng/6.4/contrib/bind9/bin/named/query.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/bin/named/query.c Wed Jan 6 21:45:30 2010 (r201679) @@ -92,6 +92,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + static void query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype); @@ -1698,14 +1700,14 @@ query_addbestns(ns_client_t *client) { zsigrdataset = NULL; } - if ((client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0 && - (rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending))) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && + !PENDINGOK(client->query.dboptions)) goto cleanup; - if (WANTDNSSEC(client) && SECURE(client) && - (rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue))) + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && + SECURE(client) && WANTDNSSEC(client)) goto cleanup; query_addrrset(client, &fname, &rdataset, &sigrdataset, dbuf, @@ -2367,6 +2369,8 @@ query_find(ns_client_t *client, dns_fetc unsigned int options; isc_boolean_t empty_wild; dns_rdataset_t *noqname; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -2566,9 +2570,47 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: releng/6.4/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:45:30 2010 (r201679) @@ -226,40 +226,51 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /* Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) - /* Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + + /*% Received in the additional section of a response. */ + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - /* Received in a referral response. */ - dns_trust_glue = 3, + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + /* * Name checking severites. */ Modified: releng/6.4/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:45:30 2010 (r201679) @@ -763,7 +763,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: releng/6.4/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:45:30 2010 (r201679) @@ -2667,7 +2667,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3129,7 +3129,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: releng/6.4/contrib/bind9/lib/dns/resolver.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:45:30 2010 (r201679) @@ -3657,6 +3657,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3693,12 +3694,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -4044,7 +4067,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: releng/6.4/contrib/bind9/lib/dns/validator.c ============================================================================== --- releng/6.4/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:45:30 2010 (r201679) @@ -238,7 +238,7 @@ auth_nonpending(dns_message_t *message) rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link)) { - if (rdataset->trust == dns_trust_pending) + if (DNS_TRUST_PENDING(rdataset->trust)) rdataset->trust = dns_trust_authauthority; } } @@ -1175,7 +1175,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1190,7 +1190,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -1758,7 +1758,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -1771,7 +1771,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -2564,7 +2564,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: releng/6.4/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- releng/6.4/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:45:30 2010 (r201679) @@ -409,6 +409,7 @@ process_private( int mod_okay ) { + static u_long quiet_until; struct req_pkt *inpkt; struct req_pkt_tail *tailinpkt; struct sockaddr_storage *srcadr; @@ -444,8 +445,14 @@ process_private( || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0) || (++ec, rbufp->recv_length < REQ_LEN_HDR) ) { - msyslog(LOG_ERR, "process_private: INFO_ERR_FMT: test %d failed, pkt from %s", ec, stoa(srcadr)); - req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); + NLOG(NLOG_SYSEVENT) + if (current_time >= quiet_until) { + msyslog(LOG_ERR, + "process_private: drop test %d" + " failed, pkt from %s", + ec, stoa(srcadr)); + quiet_until = current_time + 60; + } return; } Modified: releng/6.4/sys/conf/newvers.sh ============================================================================== --- releng/6.4/sys/conf/newvers.sh Wed Jan 6 21:36:33 2010 (r201678) +++ releng/6.4/sys/conf/newvers.sh Wed Jan 6 21:45:30 2010 (r201679) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="6.4" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/7.1/UPDATING ============================================================================== --- releng/7.1/UPDATING Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/UPDATING Wed Jan 6 21:45:30 2010 (r201679) @@ -8,6 +8,15 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20100106: p10 FreeBSD-SA-10:01.bind, FreeBSD-SA-10:02.ntpd, + FreeBSD-SA-10:03.zfs + Fix BIND named(8) cache poisoning with DNSSEC validation. + [SA-10:01] + + Fix ntpd mode 7 denial of service. [SA-10:02] + + Fix ZFS ZIL playback with insecure permissions. [SA-10:03] + 20091203: p9 FreeBSD-SA-09:15.ssl, FreeBSD-SA-09:16.rtld, FreeBSD-SA-09:17.freebsd-update Disable SSL renegotiation in order to protect against a serious Modified: releng/7.1/contrib/bind9/bin/named/query.c ============================================================================== --- releng/7.1/contrib/bind9/bin/named/query.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/contrib/bind9/bin/named/query.c Wed Jan 6 21:45:30 2010 (r201679) @@ -109,6 +109,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + typedef struct client_additionalctx { ns_client_t *client; dns_rdataset_t *rdataset; @@ -1721,8 +1723,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -1761,8 +1763,8 @@ query_addadditional2(void *arg, dns_name */ if (result == ISC_R_SUCCESS && additionaltype == dns_rdatasetadditional_fromcache && - (rdataset->trust == dns_trust_pending || - rdataset->trust == dns_trust_glue) && + (DNS_TRUST_PENDING(rdataset->trust) || + DNS_TRUST_GLUE(rdataset->trust)) && !validate(client, db, fname, rdataset, sigrdataset)) { dns_rdataset_disassociate(rdataset); if (dns_rdataset_isassociated(sigrdataset)) @@ -2547,14 +2549,14 @@ query_addbestns(ns_client_t *client) { /* * Attempt to validate RRsets that are pending or that are glue. */ - if ((rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending)) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && - (client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0) + !PENDINGOK(client->query.dboptions)) goto cleanup; - if ((rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue)) && + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && !validate(client, db, fname, rdataset, sigrdataset) && SECURE(client) && WANTDNSSEC(client)) goto cleanup; @@ -3335,6 +3337,8 @@ query_find(ns_client_t *client, dns_fetc unsigned int options; isc_boolean_t empty_wild; dns_rdataset_t *noqname; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -3544,9 +3548,49 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (validate(client, db, fname, rdataset, sigrdataset)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: releng/7.1/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:45:30 2010 (r201679) @@ -241,40 +241,52 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /*% Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) - + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) + + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + /*% Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - - /* Received in a referral response. */ - dns_trust_glue = 3, + + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) - + /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + + /*% * Name checking severites. */ Modified: releng/7.1/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:45:30 2010 (r201679) @@ -774,7 +774,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: releng/7.1/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:45:30 2010 (r201679) @@ -3070,7 +3070,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3584,7 +3584,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: releng/7.1/contrib/bind9/lib/dns/resolver.c ============================================================================== --- releng/7.1/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:36:33 2010 (r201678) +++ releng/7.1/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:45:30 2010 (r201679) @@ -3847,6 +3847,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3883,12 +3884,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -4236,7 +4259,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 21:45:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A0810656A9; Wed, 6 Jan 2010 21:45:32 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E95038FC21; Wed, 6 Jan 2010 21:45:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06LjVc2048874; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06LjVr2048866; Wed, 6 Jan 2010 21:45:31 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201001062145.o06LjVr2048866@svn.freebsd.org> From: "Simon L. Nielsen" Date: Wed, 6 Jan 2010 21:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201679 - releng/6.3 releng/6.3/contrib/bind9/bin/named releng/6.3/contrib/bind9/lib/dns releng/6.3/contrib/bind9/lib/dns/include/dns releng/6.3/contrib/ntp/ntpd releng/6.3/sys/conf rel... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 21:45:32 -0000 Author: simon Date: Wed Jan 6 21:45:30 2010 New Revision: 201679 URL: http://svn.freebsd.org/changeset/base/201679 Log: Fix BIND named(8) cache poisoning with DNSSEC validation. [SA-10:01] Fix ntpd mode 7 denial of service. [SA-10:02] Fix ZFS ZIL playback with insecure permissions. [SA-10:03] Various FreeBSD 8.0-RELEASE improvements. [EN-10:01] Security: FreeBSD-SA-10:01.bind Security: FreeBSD-SA-10:02.ntpd Security: FreeBSD-SA-10:03.zfs Errata: FreeBSD-EN-10:01.freebsd Approved by: so (simon) Modified: stable/6/contrib/bind9/bin/named/query.c stable/6/contrib/bind9/lib/dns/include/dns/types.h stable/6/contrib/bind9/lib/dns/masterdump.c stable/6/contrib/bind9/lib/dns/rbtdb.c stable/6/contrib/bind9/lib/dns/resolver.c stable/6/contrib/bind9/lib/dns/validator.c stable/6/contrib/ntp/ntpd/ntp_request.c Changes in other areas also in this revision: Modified: releng/6.3/UPDATING releng/6.3/contrib/bind9/bin/named/query.c releng/6.3/contrib/bind9/lib/dns/include/dns/types.h releng/6.3/contrib/bind9/lib/dns/masterdump.c releng/6.3/contrib/bind9/lib/dns/rbtdb.c releng/6.3/contrib/bind9/lib/dns/resolver.c releng/6.3/contrib/bind9/lib/dns/validator.c releng/6.3/contrib/ntp/ntpd/ntp_request.c releng/6.3/sys/conf/newvers.sh releng/6.4/UPDATING releng/6.4/contrib/bind9/bin/named/query.c releng/6.4/contrib/bind9/lib/dns/include/dns/types.h releng/6.4/contrib/bind9/lib/dns/masterdump.c releng/6.4/contrib/bind9/lib/dns/rbtdb.c releng/6.4/contrib/bind9/lib/dns/resolver.c releng/6.4/contrib/bind9/lib/dns/validator.c releng/6.4/contrib/ntp/ntpd/ntp_request.c releng/6.4/sys/conf/newvers.sh releng/7.1/UPDATING releng/7.1/contrib/bind9/bin/named/query.c releng/7.1/contrib/bind9/lib/dns/include/dns/types.h releng/7.1/contrib/bind9/lib/dns/masterdump.c releng/7.1/contrib/bind9/lib/dns/rbtdb.c releng/7.1/contrib/bind9/lib/dns/resolver.c releng/7.1/contrib/bind9/lib/dns/validator.c releng/7.1/contrib/ntp/ntpd/ntp_request.c releng/7.1/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.1/sys/conf/newvers.sh releng/7.2/UPDATING releng/7.2/contrib/bind9/bin/named/query.c releng/7.2/contrib/bind9/lib/dns/include/dns/types.h releng/7.2/contrib/bind9/lib/dns/masterdump.c releng/7.2/contrib/bind9/lib/dns/rbtdb.c releng/7.2/contrib/bind9/lib/dns/resolver.c releng/7.2/contrib/bind9/lib/dns/validator.c releng/7.2/contrib/ntp/ntpd/ntp_request.c releng/7.2/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/7.2/sys/conf/newvers.sh releng/8.0/UPDATING releng/8.0/contrib/bind9/bin/named/query.c releng/8.0/contrib/bind9/lib/dns/include/dns/types.h releng/8.0/contrib/bind9/lib/dns/masterdump.c releng/8.0/contrib/bind9/lib/dns/rbtdb.c releng/8.0/contrib/bind9/lib/dns/resolver.c releng/8.0/contrib/bind9/lib/dns/validator.c releng/8.0/contrib/ntp/ntpd/ntp_request.c releng/8.0/sys/cddl/compat/opensolaris/sys/vnode.h releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c releng/8.0/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h releng/8.0/sys/conf/newvers.sh releng/8.0/sys/kern/vfs_lookup.c releng/8.0/sys/netinet/ip_mroute.c releng/8.0/sys/netinet/raw_ip.c releng/8.0/sys/netinet/sctp_input.c releng/8.0/sys/netinet6/raw_ip6.c releng/8.0/sys/rpc/clnt_vc.c stable/7/contrib/ntp/ntpd/ntp_request.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/8/contrib/ntp/ntpd/ntp_request.c Modified: stable/6/contrib/bind9/bin/named/query.c ============================================================================== --- stable/6/contrib/bind9/bin/named/query.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/bin/named/query.c Wed Jan 6 21:45:30 2010 (r201679) @@ -92,6 +92,8 @@ #define DNS_GETDB_NOLOG 0x02U #define DNS_GETDB_PARTIAL 0x04U +#define PENDINGOK(x) (((x) & DNS_DBFIND_PENDINGOK) != 0) + static void query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype); @@ -1698,14 +1700,14 @@ query_addbestns(ns_client_t *client) { zsigrdataset = NULL; } - if ((client->query.dboptions & DNS_DBFIND_PENDINGOK) == 0 && - (rdataset->trust == dns_trust_pending || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_pending))) + if ((DNS_TRUST_PENDING(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_PENDING(sigrdataset->trust))) && + !PENDINGOK(client->query.dboptions)) goto cleanup; - if (WANTDNSSEC(client) && SECURE(client) && - (rdataset->trust == dns_trust_glue || - (sigrdataset != NULL && sigrdataset->trust == dns_trust_glue))) + if ((DNS_TRUST_GLUE(rdataset->trust) || + (sigrdataset != NULL && DNS_TRUST_GLUE(sigrdataset->trust))) && + SECURE(client) && WANTDNSSEC(client)) goto cleanup; query_addrrset(client, &fname, &rdataset, &sigrdataset, dbuf, @@ -2376,6 +2378,8 @@ query_find(ns_client_t *client, dns_fetc isc_boolean_t empty_wild; dns_rdataset_t *noqname; isc_boolean_t resuming; + dns_rdataset_t tmprdataset; + unsigned int dboptions; CTRACE("query_find"); @@ -2577,9 +2581,47 @@ query_find(ns_client_t *client, dns_fetc /* * Now look for an answer in the database. */ + dboptions = client->query.dboptions; + if (sigrdataset == NULL && client->view->enablednssec) { + /* + * If the client doesn't want DNSSEC we still want to + * look for any data pending validation to save a remote + * lookup if possible. + */ + dns_rdataset_init(&tmprdataset); + sigrdataset = &tmprdataset; + dboptions |= DNS_DBFIND_PENDINGOK; + } + refind: result = dns_db_find(db, client->query.qname, version, type, - client->query.dboptions, client->now, - &node, fname, rdataset, sigrdataset); + dboptions, client->now, &node, fname, + rdataset, sigrdataset); + /* + * If we have found pending data try to validate it. + * If the data does not validate as secure and we can't + * use the unvalidated data requery the database with + * pending disabled to prevent infinite looping. + */ + if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust)) + goto validation_done; + if (rdataset->trust != dns_trust_pending_answer || + !PENDINGOK(client->query.dboptions)) { + dns_rdataset_disassociate(rdataset); + if (sigrdataset != NULL && + dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + if (sigrdataset == &tmprdataset) + sigrdataset = NULL; + dns_db_detachnode(db, &node); + dboptions &= ~DNS_DBFIND_PENDINGOK; + goto refind; + } + validation_done: + if (sigrdataset == &tmprdataset) { + if (dns_rdataset_isassociated(sigrdataset)) + dns_rdataset_disassociate(sigrdataset); + sigrdataset = NULL; + } resume: CTRACE("query_find: resume"); Modified: stable/6/contrib/bind9/lib/dns/include/dns/types.h ============================================================================== --- stable/6/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/lib/dns/include/dns/types.h Wed Jan 6 21:45:30 2010 (r201679) @@ -226,40 +226,51 @@ enum { dns_trust_none = 0, #define dns_trust_none ((dns_trust_t)dns_trust_none) - /* Subject to DNSSEC validation but has not yet been validated */ - dns_trust_pending = 1, -#define dns_trust_pending ((dns_trust_t)dns_trust_pending) + /*% + * Subject to DNSSEC validation but has not yet been validated + * dns_trust_pending_additional (from the additional section). + */ + dns_trust_pending_additional = 1, +#define dns_trust_pending_additional \ + ((dns_trust_t)dns_trust_pending_additional) - /* Received in the additional section of a response. */ - dns_trust_additional = 2, + dns_trust_pending_answer = 2, +#define dns_trust_pending_answer ((dns_trust_t)dns_trust_pending_answer) + + /*% Received in the additional section of a response. */ + dns_trust_additional = 3, #define dns_trust_additional ((dns_trust_t)dns_trust_additional) - /* Received in a referral response. */ - dns_trust_glue = 3, + /* Received in a referral response. */ + dns_trust_glue = 4, #define dns_trust_glue ((dns_trust_t)dns_trust_glue) - /* Answser from a non-authoritative server */ - dns_trust_answer = 4, + /* Answer from a non-authoritative server */ + dns_trust_answer = 5, #define dns_trust_answer ((dns_trust_t)dns_trust_answer) /* Received in the authority section as part of an authoritative response */ - dns_trust_authauthority = 5, + dns_trust_authauthority = 6, #define dns_trust_authauthority ((dns_trust_t)dns_trust_authauthority) - /* Answser from an authoritative server */ - dns_trust_authanswer = 6, + /* Answer from an authoritative server */ + dns_trust_authanswer = 7, #define dns_trust_authanswer ((dns_trust_t)dns_trust_authanswer) - /* Successfully DNSSEC validated */ - dns_trust_secure = 7, + /* Successfully DNSSEC validated */ + dns_trust_secure = 8, #define dns_trust_secure ((dns_trust_t)dns_trust_secure) /* This server is authoritative */ - dns_trust_ultimate = 8 + dns_trust_ultimate = 9 #define dns_trust_ultimate ((dns_trust_t)dns_trust_ultimate) }; +#define DNS_TRUST_PENDING(x) ((x) == dns_trust_pending_answer || \ + (x) == dns_trust_pending_additional) +#define DNS_TRUST_GLUE(x) ((x) == dns_trust_glue) + /* * Name checking severites. */ Modified: stable/6/contrib/bind9/lib/dns/masterdump.c ============================================================================== --- stable/6/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/lib/dns/masterdump.c Wed Jan 6 21:45:30 2010 (r201679) @@ -763,7 +763,8 @@ dump_order_compare(const void *a, const static const char *trustnames[] = { "none", - "pending", + "pending-additional", + "pending-answer", "additional", "glue", "answer", Modified: stable/6/contrib/bind9/lib/dns/rbtdb.c ============================================================================== --- stable/6/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/lib/dns/rbtdb.c Wed Jan 6 21:45:30 2010 (r201679) @@ -2667,7 +2667,7 @@ cache_zonecut_callback(dns_rbtnode_t *no } if (dname_header != NULL && - (dname_header->trust != dns_trust_pending || + (!DNS_TRUST_PENDING(dname_header->trust) || (search->options & DNS_DBFIND_PENDINGOK) != 0)) { /* * We increment the reference count on node to ensure that @@ -3129,7 +3129,7 @@ cache_find(dns_db_t *db, dns_name_t *nam if (found == NULL || (found->trust == dns_trust_glue && ((options & DNS_DBFIND_GLUEOK) == 0)) || - (found->trust == dns_trust_pending && + (DNS_TRUST_PENDING(found->trust) && ((options & DNS_DBFIND_PENDINGOK) == 0))) { /* * If there is an NS rdataset at this node, then this is the Modified: stable/6/contrib/bind9/lib/dns/resolver.c ============================================================================== --- stable/6/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/lib/dns/resolver.c Wed Jan 6 21:45:30 2010 (r201679) @@ -3694,6 +3694,7 @@ cache_name(fetchctx_t *fctx, dns_name_t * for it, unless it is glue. */ if (secure_domain && rdataset->trust != dns_trust_glue) { + dns_trust_t trust; /* * RRSIGs are validated as part of validating the * type they cover. @@ -3730,12 +3731,34 @@ cache_name(fetchctx_t *fctx, dns_name_t } /* + * Reject out of bailiwick additional records + * without RRSIGs as they can't possibly validate + * as "secure" and as we will never never want to + * store these as "answers" after validation. + */ + if (rdataset->trust == dns_trust_additional && + sigrdataset == NULL && EXTERNAL(rdataset)) + continue; + + /* + * XXXMPA: If we store as "answer" after validating + * then we need to do bailiwick processing and + * also need to track whether RRsets are in or + * out of bailiwick. This will require a another + * pending trust level. + * * Cache this rdataset/sigrdataset pair as - * pending data. + * pending data. Track whether it was additional + * or not. */ - rdataset->trust = dns_trust_pending; + if (rdataset->trust == dns_trust_additional) + trust = dns_trust_pending_additional; + else + trust = dns_trust_pending_answer; + + rdataset->trust = trust; if (sigrdataset != NULL) - sigrdataset->trust = dns_trust_pending; + sigrdataset->trust = trust; if (!need_validation) addedrdataset = ardataset; else @@ -4081,7 +4104,7 @@ ncache_message(fetchctx_t *fctx, dns_adb for (trdataset = ISC_LIST_HEAD(tname->list); trdataset != NULL; trdataset = ISC_LIST_NEXT(trdataset, link)) - trdataset->trust = dns_trust_pending; + trdataset->trust = dns_trust_pending_answer; result = dns_message_nextname(fctx->rmessage, DNS_SECTION_AUTHORITY); } Modified: stable/6/contrib/bind9/lib/dns/validator.c ============================================================================== --- stable/6/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/bind9/lib/dns/validator.c Wed Jan 6 21:45:30 2010 (r201679) @@ -238,7 +238,7 @@ auth_nonpending(dns_message_t *message) rdataset != NULL; rdataset = ISC_LIST_NEXT(rdataset, link)) { - if (rdataset->trust == dns_trust_pending) + if (DNS_TRUST_PENDING(rdataset->trust)) rdataset->trust = dns_trust_authauthority; } } @@ -1176,7 +1176,7 @@ get_key(dns_validator_t *val, dns_rdata_ * We have an rrset for the given keyname. */ val->keyset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { /* @@ -1191,7 +1191,7 @@ get_key(dns_validator_t *val, dns_rdata_ if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * Having a pending key with no signature means that * something is broken. @@ -1760,7 +1760,7 @@ validatezonekey(dns_validator_t *val) { * We have DS records. */ val->dsset = &val->frdataset; - if (val->frdataset.trust == dns_trust_pending && + if (DNS_TRUST_PENDING(val->frdataset.trust) && dns_rdataset_isassociated(&val->fsigrdataset)) { result = create_validator(val, @@ -1773,7 +1773,7 @@ validatezonekey(dns_validator_t *val) { if (result != ISC_R_SUCCESS) return (result); return (DNS_R_WAIT); - } else if (val->frdataset.trust == dns_trust_pending) { + } else if (DNS_TRUST_PENDING(val->frdataset.trust)) { /* * There should never be an unsigned DS. */ @@ -2568,7 +2568,7 @@ proveunsecure(dns_validator_t *val, isc_ * There is no DS. If this is a delegation, * we maybe done. */ - if (val->frdataset.trust == dns_trust_pending) { + if (DNS_TRUST_PENDING(val->frdataset.trust)) { result = create_fetch(val, tname, dns_rdatatype_ds, dsfetched2, Modified: stable/6/contrib/ntp/ntpd/ntp_request.c ============================================================================== --- stable/6/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:36:33 2010 (r201678) +++ stable/6/contrib/ntp/ntpd/ntp_request.c Wed Jan 6 21:45:30 2010 (r201679) @@ -409,6 +409,7 @@ process_private( int mod_okay ) { + static u_long quiet_until; struct req_pkt *inpkt; struct req_pkt_tail *tailinpkt; struct sockaddr_storage *srcadr; @@ -444,8 +445,14 @@ process_private( || (++ec, INFO_MBZ(inpkt->mbz_itemsize) != 0) || (++ec, rbufp->recv_length < REQ_LEN_HDR) ) { - msyslog(LOG_ERR, "process_private: INFO_ERR_FMT: test %d failed, pkt from %s", ec, stoa(srcadr)); - req_ack(srcadr, inter, inpkt, INFO_ERR_FMT); + NLOG(NLOG_SYSEVENT) + if (current_time >= quiet_until) { + msyslog(LOG_ERR, + "process_private: drop test %d" + " failed, pkt from %s", + ec, stoa(srcadr)); + quiet_until = current_time + 60; + } return; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 21:46:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 062CB1065698; Wed, 6 Jan 2010 21:46:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA1228FC16; Wed, 6 Jan 2010 21:46:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06Lk8K7049039; Wed, 6 Jan 2010 21:46:08 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06Lk8Mv049037; Wed, 6 Jan 2010 21:46:08 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001062146.o06Lk8Mv049037@svn.freebsd.org> From: Andrew Thompson Date: Wed, 6 Jan 2010 21:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201680 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 21:46:09 -0000 Author: thompsa Date: Wed Jan 6 21:46:08 2010 New Revision: 201680 URL: http://svn.freebsd.org/changeset/base/201680 Log: scratch_size was incorrectly passed as language ID when retrieving the language ID table, this broke string retrieval on some devices. Submitted by: Hans Petter Selasky Reported by: Renato Botelho Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Jan 6 21:45:30 2010 (r201679) +++ head/sys/dev/usb/usb_device.c Wed Jan 6 21:46:08 2010 (r201680) @@ -1691,8 +1691,7 @@ usb_alloc_device(device_t parent_dev, st udev->ddesc.iSerialNumber) { /* read out the language ID string */ err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, scratch_size, - USB_LANGUAGE_TABLE); + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); } else { err = USB_ERR_INVAL; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 22:14:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7D52106566B; Wed, 6 Jan 2010 22:14:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B50CB8FC0C; Wed, 6 Jan 2010 22:14:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06ME5a2055265; Wed, 6 Jan 2010 22:14:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06ME5oD055260; Wed, 6 Jan 2010 22:14:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001062214.o06ME5oD055260@svn.freebsd.org> From: Andrew Thompson Date: Wed, 6 Jan 2010 22:14:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201681 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 22:14:06 -0000 Author: thompsa Date: Wed Jan 6 22:14:05 2010 New Revision: 201681 URL: http://svn.freebsd.org/changeset/base/201681 Log: Improve u3g device ejecting by providing additional methods for the eject command in the usb_msctest routines, as well as a general tidyup. This now properly ejects the ZTE MF636, Option Gi0322 and Novatel MC950D devices I have on my desk. Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Wed Jan 6 21:46:08 2010 (r201680) +++ head/sys/dev/usb/serial/u3g.c Wed Jan 6 22:14:05 2010 (r201681) @@ -86,10 +86,14 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GSP_HSPA 6 #define U3GSP_MAX 7 -#define U3GFL_HUAWEI_INIT 0x0001 /* Init command required */ -#define U3GFL_SCSI_EJECT 0x0002 /* SCSI eject command required */ -#define U3GFL_SIERRA_INIT 0x0004 /* Init command required */ -#define U3GFL_SAEL_M460_INIT 0x0008 /* Init device */ +#define U3GINIT_HUAWEI 1 /* Requires Huawei init command */ +#define U3GINIT_SIERRA 2 /* Requires Sierra init command */ +#define U3GINIT_SCSIEJECT 3 /* Requires SCSI eject command */ +#define U3GINIT_REZERO 4 /* Requires SCSI rezero command */ +#define U3GINIT_ZTESTOR 5 /* Requires ZTE SCSI command */ +#define U3GINIT_CMOTECH 6 /* Requires CMOTECH SCSI command */ +#define U3GINIT_WAIT 7 /* Device reappears after a delay */ +#define U3GINIT_SAEL_M460 8 /* Requires vendor init */ enum { U3G_BULK_WR, @@ -192,6 +196,7 @@ static const struct usb_device_id u3g_de U3G_DEV(ANYDATA, ADU_E100X, 0), U3G_DEV(AXESSTEL, DATAMODEM, 0), U3G_DEV(CMOTECH, CDMA_MODEM1, 0), + U3G_DEV(CMOTECH, CGU628, U3GINIT_CMOTECH), U3G_DEV(DELL, U5500, 0), U3G_DEV(DELL, U5505, 0), U3G_DEV(DELL, U5510, 0), @@ -211,73 +216,73 @@ static const struct usb_device_id u3g_de U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), - U3G_DEV(HUAWEI, E1401, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1402, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1403, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1404, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1405, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1406, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1407, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1408, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1409, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E140A, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E140B, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E140D, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E140E, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E140F, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1410, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1411, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1412, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1413, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1414, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1415, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1416, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1417, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1418, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1419, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141A, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141B, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141C, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141D, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141E, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E141F, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1420, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1421, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1422, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1423, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1424, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1425, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1426, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1427, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1428, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1429, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142A, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142B, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142C, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142D, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142E, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E142F, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1430, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1431, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1432, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1433, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1434, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1435, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1436, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1437, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1438, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E1439, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143A, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143B, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143C, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143D, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143E, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E143F, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E14AC, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E180V, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E220, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, E220BIS, U3GFL_HUAWEI_INIT), - U3G_DEV(HUAWEI, MOBILE, U3GFL_HUAWEI_INIT), + U3G_DEV(HUAWEI, E1401, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1402, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1403, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1404, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1405, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1406, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1407, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1408, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1409, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E140A, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E140B, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E140D, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E140E, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E140F, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1410, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1411, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1412, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1413, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1414, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1415, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1416, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1417, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1418, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1419, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141A, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141B, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141C, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141D, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141E, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E141F, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1420, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1421, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1422, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1423, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1424, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1425, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1426, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1427, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1428, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1429, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142A, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142B, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142C, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142D, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142E, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E142F, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1430, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1431, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1432, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1433, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1434, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1435, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1436, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1437, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1438, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1439, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143A, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143B, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143C, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143D, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143E, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E143F, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E14AC, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E180V, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(MERLIN, V620, 0), @@ -294,7 +299,7 @@ static const struct usb_device_id u3g_de U3G_DEV(NOVATEL, U727_2, 0), U3G_DEV(NOVATEL, U740, 0), U3G_DEV(NOVATEL, U740_2, 0), - U3G_DEV(NOVATEL, U760, U3GFL_SCSI_EJECT), + U3G_DEV(NOVATEL, U760, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, U870, 0), U3G_DEV(NOVATEL, V620, 0), U3G_DEV(NOVATEL, V640, 0), @@ -338,7 +343,7 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, AC2726, 0), U3G_DEV(QUALCOMMINC, AC8700, 0), U3G_DEV(QUALCOMMINC, AC8710, 0), - U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GFL_SCSI_EJECT), + U3G_DEV(QUALCOMMINC, CDMA_MSM, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, E0002, 0), U3G_DEV(QUALCOMMINC, E0003, 0), U3G_DEV(QUALCOMMINC, E0004, 0), @@ -405,7 +410,6 @@ static const struct usb_device_id u3g_de U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), - U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GFL_SCSI_EJECT), U3G_DEV(QUANTA, GKE, 0), U3G_DEV(QUANTA, GLE, 0), U3G_DEV(QUANTA, GLX, 0), @@ -466,7 +470,7 @@ static const struct usb_device_id u3g_de U3G_DEV(SIERRA, MINI5725, 0), U3G_DEV(SIERRA, T11, 0), U3G_DEV(SIERRA, T598, 0), - U3G_DEV(SILABS, SAEL, U3GFL_SAEL_M460_INIT), + U3G_DEV(SILABS, SAEL, U3GINIT_SAEL_M460), U3G_DEV(STELERA, C105, 0), U3G_DEV(STELERA, E1003, 0), U3G_DEV(STELERA, E1004, 0), @@ -492,12 +496,14 @@ static const struct usb_device_id u3g_de U3G_DEV(TOSHIBA, HSDPA, 0), U3G_DEV(YISO, C893, 0), /* Autoinstallers */ - U3G_DEV(NOVATEL, ZEROCD, U3GFL_SCSI_EJECT), - U3G_DEV(SIERRA, TRUINSTALL, U3GFL_SIERRA_INIT), + U3G_DEV(NOVATEL, ZEROCD, U3GINIT_SCSIEJECT), + U3G_DEV(OPTION, GTICON322, U3GINIT_REZERO), + U3G_DEV(QUALCOMMINC, ZTE_STOR, U3GINIT_ZTESTOR), + U3G_DEV(SIERRA, TRUINSTALL, U3GINIT_SIERRA), #undef U3G_DEV }; -static void +static int u3g_sierra_init(struct usb_device *udev) { struct usb_device_request req; @@ -512,10 +518,10 @@ u3g_sierra_init(struct usb_device *udev) NULL, 0, NULL, USB_MS_HZ)) { /* ignore any errors */ } - return; + return (0); } -static void +static int u3g_huawei_init(struct usb_device *udev) { struct usb_device_request req; @@ -530,7 +536,7 @@ u3g_huawei_init(struct usb_device *udev) NULL, 0, NULL, USB_MS_HZ)) { /* ignore any errors */ } - return; + return (0); } static void @@ -625,7 +631,7 @@ u3g_test_autoinst(void *arg, struct usb_ { struct usb_interface *iface; struct usb_interface_descriptor *id; - uint32_t flags; + int error; if (uaa->dev_state != UAA_DEV_READY) return; @@ -636,25 +642,41 @@ u3g_test_autoinst(void *arg, struct usb_ id = iface->idesc; if (id == NULL || id->bInterfaceClass != UICLASS_MASS) return; - if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) { - /* no device match */ - return; - } - flags = USB_GET_DRIVER_INFO(uaa); + if (usbd_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa)) + return; /* no device match */ - if (flags & U3GFL_HUAWEI_INIT) { - u3g_huawei_init(udev); - } else if (flags & U3GFL_SCSI_EJECT) { - if (usb_test_autoinstall(udev, 0, 1) != 0) - return; - } else if (flags & U3GFL_SIERRA_INIT) { - u3g_sierra_init(udev); - } else { - /* no quirks */ - return; + switch (USB_GET_DRIVER_INFO(uaa)) { + case U3GINIT_HUAWEI: + error = u3g_huawei_init(udev); + break; + case U3GINIT_SCSIEJECT: + error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); + break; + case U3GINIT_REZERO: + error = usb_msc_eject(udev, 0, MSC_EJECT_REZERO); + break; + case U3GINIT_ZTESTOR: + error = usb_msc_eject(udev, 0, MSC_EJECT_ZTESTOR); + break; + case U3GINIT_CMOTECH: + error = usb_msc_eject(udev, 0, MSC_EJECT_CMOTECH); + break; + case U3GINIT_SIERRA: + error = u3g_sierra_init(udev); + break; + case U3GINIT_WAIT: + /* Just pretend we ejected, the card will timeout */ + error = 0; + break; + default: + /* no 3G eject quirks */ + error = EOPNOTSUPP; + break; + } + if (error == 0) { + /* success, mark the udev as disappearing */ + uaa->dev_state = UAA_DEV_EJECTING; } - uaa->dev_state = UAA_DEV_EJECTING; - return; /* success */ } static int @@ -701,15 +723,14 @@ u3g_attach(device_t dev) struct usb_interface *iface; struct usb_interface_descriptor *id; uint32_t iface_valid; - int error, flags, nports; + int error, type, nports; int ep, n; uint8_t i; DPRINTF("sc=%p\n", sc); - flags = USB_GET_DRIVER_INFO(uaa); - - if (flags & U3GFL_SAEL_M460_INIT) + type = USB_GET_DRIVER_INFO(uaa); + if (type == U3GINIT_SAEL_M460) u3g_sael_m460_init(uaa->device); /* copy in USB config */ @@ -781,8 +802,8 @@ u3g_attach(device_t dev) DPRINTF("ucom_attach failed\n"); goto detach; } - if (sc->sc_numports > 1) - device_printf(dev, "Found %u ports.\n", sc->sc_numports); + device_printf(dev, "Found %u port%s.\n", sc->sc_numports, + sc->sc_numports > 1 ? "s":""); return (0); detach: Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Wed Jan 6 21:46:08 2010 (r201680) +++ head/sys/dev/usb/usb_device.c Wed Jan 6 22:14:05 2010 (r201681) @@ -1805,7 +1805,7 @@ repeat_set_config: * Try to figure out if we have an * auto-install disk there: */ - if (usb_test_autoinstall(udev, 0, 0) == 0) { + if (usb_iface_is_cdrom(udev, 0)) { DPRINTFN(0, "Found possible auto-install " "disk (trying next config)\n"); config_index++; Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Wed Jan 6 21:46:08 2010 (r201680) +++ head/sys/dev/usb/usb_msctest.c Wed Jan 6 22:14:05 2010 (r201681) @@ -67,8 +67,7 @@ #include #include #include - -#include +#include enum { ST_COMMAND, @@ -86,7 +85,18 @@ enum { DIR_NONE, }; +#define SCSI_INQ_LEN 0x24 +static uint8_t scsi_test_unit_ready[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_inquiry[] = { 0x12, 0x00, 0x00, 0x00, SCSI_INQ_LEN, 0x00 }; +static uint8_t scsi_rezero_init[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static uint8_t scsi_start_stop_unit[] = { 0x1b, 0x00, 0x00, 0x00, 0x02, 0x00 }; +static uint8_t scsi_ztestor_eject[] = { 0x85, 0x01, 0x01, 0x01, 0x18, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; +static uint8_t scsi_cmotech_eject[] = { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43, + 0x48, 0x47 }; + #define BULK_SIZE 64 /* dummy */ +#define ERR_CSW_FAILED -1 /* Command Block Wrapper */ struct bbb_cbw { @@ -134,8 +144,8 @@ struct bbb_transfer { uint8_t dir; uint8_t lun; uint8_t state; - uint8_t error; uint8_t status_try; + int error; uint8_t buffer[256]; }; @@ -147,6 +157,15 @@ static usb_callback_t bbb_data_write_cal static usb_callback_t bbb_data_wr_cs_callback; static usb_callback_t bbb_status_callback; +static void bbb_done(struct bbb_transfer *, int); +static void bbb_transfer_start(struct bbb_transfer *, uint8_t); +static void bbb_data_clear_stall_callback(struct usb_xfer *, uint8_t, + uint8_t); +static uint8_t bbb_command_start(struct bbb_transfer *, uint8_t, uint8_t, + void *, size_t, void *, size_t, usb_timeout_t); +static struct bbb_transfer *bbb_attach(struct usb_device *, uint8_t); +static void bbb_detach(struct bbb_transfer *); + static const struct usb_config bbb_config[ST_MAX] = { [ST_COMMAND] = { @@ -208,25 +227,9 @@ static const struct usb_config bbb_confi }; static void -bbb_done(struct bbb_transfer *sc, uint8_t error) +bbb_done(struct bbb_transfer *sc, int error) { - struct usb_xfer *xfer; - - xfer = sc->xfer[sc->state]; - - /* verify the error code */ - if (error) { - switch (USB_GET_STATE(xfer)) { - case USB_ST_SETUP: - case USB_ST_TRANSFERRED: - error = 1; - break; - default: - error = 2; - break; - } - } sc->error = error; sc->state = ST_COMMAND; sc->status_try = 1; @@ -253,7 +256,7 @@ bbb_data_clear_stall_callback(struct usb bbb_transfer_start(sc, next_xfer); break; default: - bbb_done(sc, 1); + bbb_done(sc, USB_ERR_STALLED); break; } } @@ -291,7 +294,7 @@ bbb_command_callback(struct usb_xfer *xf break; default: /* Error */ - bbb_done(sc, 1); + bbb_done(sc, error); break; } } @@ -333,7 +336,7 @@ bbb_data_read_callback(struct usb_xfer * default: /* Error */ if (error == USB_ERR_CANCELLED) { - bbb_done(sc, 1); + bbb_done(sc, error); } else { bbb_transfer_start(sc, ST_DATA_RD_CS); } @@ -385,7 +388,7 @@ bbb_data_write_callback(struct usb_xfer default: /* Error */ if (error == USB_ERR_CANCELLED) { - bbb_done(sc, 1); + bbb_done(sc, error); } else { bbb_transfer_start(sc, ST_DATA_WR_CS); } @@ -415,11 +418,11 @@ bbb_status_callback(struct usb_xfer *xfe /* very simple status check */ if (actlen < sizeof(sc->csw)) { - bbb_done(sc, 1);/* error */ + bbb_done(sc, USB_ERR_SHORT_XFER); } else if (sc->csw.bCSWStatus == CSWSTATUS_GOOD) { - bbb_done(sc, 0);/* success */ + bbb_done(sc, 0); /* success */ } else { - bbb_done(sc, 1);/* error */ + bbb_done(sc, ERR_CSW_FAILED); /* error */ } break; @@ -429,11 +432,11 @@ bbb_status_callback(struct usb_xfer *xfe break; default: - DPRINTFN(0, "Failed to read CSW: %s, try %d\n", + DPRINTF("Failed to read CSW: %s, try %d\n", usbd_errstr(error), sc->status_try); if (error == USB_ERR_CANCELLED || sc->status_try) { - bbb_done(sc, 1); + bbb_done(sc, error); } else { sc->status_try = 1; bbb_transfer_start(sc, ST_DATA_RD_CS); @@ -451,7 +454,7 @@ bbb_status_callback(struct usb_xfer *xfe *------------------------------------------------------------------------*/ static uint8_t bbb_command_start(struct bbb_transfer *sc, uint8_t dir, uint8_t lun, - void *data_ptr, usb_size_t data_len, uint8_t cmd_len, + void *data_ptr, size_t data_len, void *cmd_ptr, size_t cmd_len, usb_timeout_t data_timeout) { sc->lun = lun; @@ -461,54 +464,46 @@ bbb_command_start(struct bbb_transfer *s sc->data_rem = data_len; sc->data_timeout = (data_timeout + USB_MS_HZ); sc->actlen = 0; + sc->data_ptr = data_ptr; sc->cmd_len = cmd_len; + bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); + bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); + DPRINTFN(1, "SCSI cmd = %*D\n", cmd_len, &sc->cbw.CBWCDB, ":"); + mtx_lock(&sc->mtx); usbd_transfer_start(sc->xfer[sc->state]); while (usbd_transfer_pending(sc->xfer[sc->state])) { cv_wait(&sc->cv, &sc->mtx); } + mtx_unlock(&sc->mtx); return (sc->error); } -/*------------------------------------------------------------------------* - * usb_test_autoinstall - * - * Return values: - * 0: This interface is an auto install disk (CD-ROM) - * Else: Not an auto install disk. - *------------------------------------------------------------------------*/ -usb_error_t -usb_test_autoinstall(struct usb_device *udev, uint8_t iface_index, - uint8_t do_eject) +static struct bbb_transfer * +bbb_attach(struct usb_device *udev, uint8_t iface_index) { struct usb_interface *iface; struct usb_interface_descriptor *id; - usb_error_t err; - uint8_t timeout; - uint8_t sid_type; struct bbb_transfer *sc; + usb_error_t err; - if (udev == NULL) { - return (USB_ERR_INVAL); - } iface = usbd_get_iface(udev, iface_index); - if (iface == NULL) { - return (USB_ERR_INVAL); - } + if (iface == NULL) + return (NULL); + id = iface->idesc; - if (id == NULL) { - return (USB_ERR_INVAL); - } - if (id->bInterfaceClass != UICLASS_MASS) { - return (USB_ERR_INVAL); - } + if (id == NULL || id->bInterfaceClass != UICLASS_MASS) + return (NULL); + switch (id->bInterfaceSubClass) { case UISUBCLASS_SCSI: case UISUBCLASS_UFI: + case UISUBCLASS_SFF8020I: + case UISUBCLASS_SFF8070I: break; default: - return (USB_ERR_INVAL); + return (NULL); } switch (id->bInterfaceProtocol) { @@ -516,75 +511,112 @@ usb_test_autoinstall(struct usb_device * case UIPROTO_MASS_BBB: break; default: - return (USB_ERR_INVAL); + return (NULL); } sc = malloc(sizeof(*sc), M_USB, M_WAITOK | M_ZERO); - if (sc == NULL) { - return (USB_ERR_NOMEM); - } mtx_init(&sc->mtx, "USB autoinstall", NULL, MTX_DEF); cv_init(&sc->cv, "WBBB"); - err = usbd_transfer_setup(udev, - &iface_index, sc->xfer, bbb_config, + err = usbd_transfer_setup(udev, &iface_index, sc->xfer, bbb_config, ST_MAX, sc, &sc->mtx); - if (err) { - goto done; + bbb_detach(sc); + return (NULL); } - mtx_lock(&sc->mtx); - - timeout = 4; /* tries */ - -repeat_inquiry: - - sc->cbw.CBWCDB[0] = 0x12; /* INQUIRY */ - sc->cbw.CBWCDB[1] = 0; - sc->cbw.CBWCDB[2] = 0; - sc->cbw.CBWCDB[3] = 0; - sc->cbw.CBWCDB[4] = 0x24; /* length */ - sc->cbw.CBWCDB[5] = 0; - err = bbb_command_start(sc, DIR_IN, 0, - sc->buffer, 0x24, 6, USB_MS_HZ); - - if ((sc->actlen != 0) && (err == 0)) { - sid_type = sc->buffer[0] & 0x1F; - if (sid_type == 0x05) { - /* CD-ROM */ - if (do_eject) { - /* 0: opcode: SCSI START/STOP */ - sc->cbw.CBWCDB[0] = 0x1b; - /* 1: byte2: Not immediate */ - sc->cbw.CBWCDB[1] = 0x00; - /* 2..3: reserved */ - sc->cbw.CBWCDB[2] = 0x00; - sc->cbw.CBWCDB[3] = 0x00; - /* 4: Load/Eject command */ - sc->cbw.CBWCDB[4] = 0x02; - /* 5: control */ - sc->cbw.CBWCDB[5] = 0x00; - err = bbb_command_start(sc, DIR_OUT, 0, - NULL, 0, 6, USB_MS_HZ); - - DPRINTFN(0, "Eject CD command " - "status: %s\n", usbd_errstr(err)); - } - err = 0; - goto done; - } - } else if ((err != 2) && --timeout) { - usb_pause_mtx(&sc->mtx, hz); - goto repeat_inquiry; - } - err = USB_ERR_INVAL; - goto done; + return (sc); +} -done: - mtx_unlock(&sc->mtx); +static void +bbb_detach(struct bbb_transfer *sc) +{ usbd_transfer_unsetup(sc->xfer, ST_MAX); mtx_destroy(&sc->mtx); cv_destroy(&sc->cv); free(sc, M_USB); - return (err); +} + +/*------------------------------------------------------------------------* + * usb_iface_is_cdrom + * + * Return values: + * 1: This interface is an auto install disk (CD-ROM) + * 0: Not an auto install disk. + *------------------------------------------------------------------------*/ +int +usb_iface_is_cdrom(struct usb_device *udev, uint8_t iface_index) +{ + struct bbb_transfer *sc; + usb_error_t err; + uint8_t timeout, is_cdrom; + uint8_t sid_type; + + sc = bbb_attach(udev, iface_index); + if (sc == NULL) + return (0); + + is_cdrom = 0; + timeout = 4; /* tries */ + while (--timeout) { + err = bbb_command_start(sc, DIR_IN, 0, sc->buffer, + SCSI_INQ_LEN, &scsi_inquiry, sizeof(scsi_inquiry), + USB_MS_HZ); + + if (err == 0 && sc->actlen > 0) { + sid_type = sc->buffer[0] & 0x1F; + if (sid_type == 0x05) + is_cdrom = 1; + break; + } else if (err != ERR_CSW_FAILED) + break; /* non retryable error */ + usb_pause_mtx(NULL, hz); + } + bbb_detach(sc); + return (is_cdrom); +} + +usb_error_t +usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method) +{ + struct bbb_transfer *sc; + usb_error_t err; + + sc = bbb_attach(udev, iface_index); + if (sc == NULL) + return (USB_ERR_INVAL); + + err = 0; + switch (method) { + case MSC_EJECT_STOPUNIT: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_test_unit_ready, sizeof(scsi_test_unit_ready), + USB_MS_HZ); + DPRINTF("Test unit ready status: %s\n", usbd_errstr(err)); + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_start_stop_unit, sizeof(scsi_start_stop_unit), + USB_MS_HZ); + break; + case MSC_EJECT_REZERO: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_rezero_init, sizeof(scsi_rezero_init), + USB_MS_HZ); + break; + case MSC_EJECT_ZTESTOR: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_ztestor_eject, sizeof(scsi_ztestor_eject), + USB_MS_HZ); + break; + case MSC_EJECT_CMOTECH: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_cmotech_eject, sizeof(scsi_cmotech_eject), + USB_MS_HZ); + break; + default: + printf("usb_msc_eject: unknown eject method (%d)\n", method); + break; + } + DPRINTF("Eject CD command status: %s\n", usbd_errstr(err)); + + bbb_detach(sc); + return (0); } Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Wed Jan 6 21:46:08 2010 (r201680) +++ head/sys/dev/usb/usb_msctest.h Wed Jan 6 22:14:05 2010 (r201681) @@ -27,7 +27,16 @@ #ifndef _USB_MSCTEST_H_ #define _USB_MSCTEST_H_ -usb_error_t usb_test_autoinstall(struct usb_device *udev, - uint8_t iface_index, uint8_t do_eject); +enum { + MSC_EJECT_STOPUNIT, + MSC_EJECT_REZERO, + MSC_EJECT_ZTESTOR, + MSC_EJECT_CMOTECH +}; + +int usb_iface_is_cdrom(struct usb_device *udev, + uint8_t iface_index); +usb_error_t usb_msc_eject(struct usb_device *udev, + uint8_t iface_index, int method); #endif /* _USB_MSCTEST_H_ */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 22:31:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FEC81065676; Wed, 6 Jan 2010 22:31:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 80B948FC13; Wed, 6 Jan 2010 22:31:19 +0000 (UTC) Received: by bwz5 with SMTP id 5so11322380bwz.3 for ; Wed, 06 Jan 2010 14:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=GGgRMC5o7xd9M0yC7ks/1n9JbSTpmIR/cs7HKiOQ194=; b=L6u1+YP2ZvutzQYsTkMw3HREJHuVFdADx/cqcNzfFjGA06KbX735EcZwyxfSTxoz6a DLIQXfd9UHpzeGpx+V95NnLz9UwfCGcm79H0xryYv+1j9//J7OR0CLQfqDtdc/yoOD/K Eq97zvWosCScHFgQwrzQrhwEFPnh4VmxKeZ5o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=t0zgP4GZq4lYENG5gpcY5kP3vqKn5cj42iNKaKUjEtCl9xgpVU/ZQgR31Sf4paxRjy SxUgXWGsHKGYxkQrnMGFinhOqgoMbRlAt/0OYRJtkbc1sSf5gtQUSwuwNvyFDqFg+OGJ xw76ku/PaNRaDXdDdlc96C76D9QGoi7BNQG68= Received: by 10.204.153.202 with SMTP id l10mr1942566bkw.92.1262817073809; Wed, 06 Jan 2010 14:31:13 -0800 (PST) Received: from mavbook.mavhome.dp.ua ([72.14.240.162]) by mx.google.com with ESMTPS id 13sm6853096bwz.10.2010.01.06.14.31.12 (version=SSLv3 cipher=RC4-MD5); Wed, 06 Jan 2010 14:31:13 -0800 (PST) Sender: Alexander Motin Message-ID: <4B450F30.20705@FreeBSD.org> Date: Thu, 07 Jan 2010 00:31:12 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Ivan Voras References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> In-Reply-To: <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 22:31:20 -0000 Ivan Voras wrote: > 2010/1/6 Alexander Motin : >> Ivan Voras wrote: > >>> I think there was one more reason - though I'm not sure if it is still >>> valid because of your current and future work - the MAXPHYS >>> limitation. If MAXPHYS is 128k, with 64k stripes data was only to be >>> read from maximum of 2 drives. With 4k stripes it would have been read >>> from 128/4=32 drives, though I agree 4k is too low in any case >>> nowadays. I usually choose 16k or 32k for my setups. >> While you are right about MAXPHYS influence, and I hope we can rise it >> not so far, IMHO it is file system business to manage deep enough >> read-ahead/write-back to make all drives busy, independently from >> MAXPHYS value. With small MAXPHYS value FS should just generate more >> requests in advance. Except some RAID3/5/6 cases, where short writes >> ineffective, MAXPHYS value should only affect processing overhead. > > Yes, my experience which lead to the post was mostly on UFS which, > while AFAIK it does read-ahead, it still does it serially (I think > this is implied by your experiments with NCQ and ZFS vs UFS) - so in > any case only 2 drives are hit with 64k stripe size at any moment in > time. I do not think it is true. On system with default MAXPHYS I've made gstripe with 64K block of 4 equal drives with 108MB/s of maximal read speed. Reads with dd from large pre-written file on UFS shown: vfs.read_max=8 (default) - 235090074 bytes/sec vfs.read_max=16 - 378385148 bytes/sec vfs.read_max=32 - 386620109 bytes/sec I've put some printfs into the clustering read code and found enough read-ahead there. So it works. One thing IMHO would be nice to see there is the alignment of the read-ahead requests to the array stripe size/offset. Dirty hack I've tried there, reduced number of requests to the array components by 30%. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 22:39:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020E6106568F; Wed, 6 Jan 2010 22:39:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5DAB8FC19; Wed, 6 Jan 2010 22:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06MdeqK061079; Wed, 6 Jan 2010 22:39:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06MdeSA061078; Wed, 6 Jan 2010 22:39:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201001062239.o06MdeSA061078@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 6 Jan 2010 22:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201684 - head/sys/cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 22:39:41 -0000 Author: pjd Date: Wed Jan 6 22:39:40 2010 New Revision: 201684 URL: http://svn.freebsd.org/changeset/base/201684 Log: Teach the (gpt)zfsboot and zfsloader raidz code to use its buffers more efficiently. Before this patch, in the worst case memory use would increase exponentially on the number of drives in the raidz vdev. Submitted by: Matt Reimer Sponsored by: VPOP Technologies, Inc. Silence from: dfr Modified: head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/cddl/boot/zfs/zfssubr.c ============================================================================== --- head/sys/cddl/boot/zfs/zfssubr.c Wed Jan 6 22:19:57 2010 (r201683) +++ head/sys/cddl/boot/zfs/zfssubr.c Wed Jan 6 22:39:40 2010 (r201684) @@ -454,7 +454,7 @@ vdev_raidz_reconstruct_q(raidz_col_t *co static void vdev_raidz_reconstruct_pq(raidz_col_t *cols, int nparity, int acols, - int x, int y) + int x, int y, void *temp_p, void *temp_q) { uint8_t *p, *q, *pxy, *qxy, *xd, *yd, tmp, a, b, aexp, bexp; void *pdata, *qdata; @@ -478,10 +478,8 @@ vdev_raidz_reconstruct_pq(raidz_col_t *c xsize = cols[x].rc_size; ysize = cols[y].rc_size; - cols[VDEV_RAIDZ_P].rc_data = - zfs_alloc_temp(cols[VDEV_RAIDZ_P].rc_size); - cols[VDEV_RAIDZ_Q].rc_data = - zfs_alloc_temp(cols[VDEV_RAIDZ_Q].rc_size); + cols[VDEV_RAIDZ_P].rc_data = temp_p; + cols[VDEV_RAIDZ_Q].rc_data = temp_q; cols[x].rc_size = 0; cols[y].rc_size = 0; @@ -551,9 +549,12 @@ vdev_raidz_read(vdev_t *vdev, const blkp uint64_t f = b % dcols; uint64_t o = (b / dcols) << unit_shift; uint64_t q, r, coff; - int c, c1, bc, col, acols, devidx, asize, n; + int c, c1, bc, col, acols, devidx, asize, n, max_rc_size; static raidz_col_t cols[16]; raidz_col_t *rc, *rc1; + void *orig, *orig1, *temp_p, *temp_q; + + orig = orig1 = temp_p = temp_q = NULL; q = s / (dcols - nparity); r = s - q * (dcols - nparity); @@ -561,6 +562,7 @@ vdev_raidz_read(vdev_t *vdev, const blkp acols = (q == 0 ? bc : dcols); asize = 0; + max_rc_size = 0; for (c = 0; c < acols; c++) { col = f + c; @@ -577,6 +579,8 @@ vdev_raidz_read(vdev_t *vdev, const blkp cols[c].rc_tried = 0; cols[c].rc_skipped = 0; asize += cols[c].rc_size; + if (cols[c].rc_size > max_rc_size) + max_rc_size = cols[c].rc_size; } asize = roundup(asize, (nparity + 1) << unit_shift); @@ -777,8 +781,13 @@ reconstruct: //ASSERT(c != acols); //ASSERT(!rc->rc_skipped || rc->rc_error == ENXIO || rc->rc_error == ESTALE); + if (temp_p == NULL) + temp_p = zfs_alloc_temp(max_rc_size); + if (temp_q == NULL) + temp_q = zfs_alloc_temp(max_rc_size); + vdev_raidz_reconstruct_pq(cols, nparity, acols, - c1, c); + c1, c, temp_p, temp_q); if (zio_checksum_error(bp, buf) == 0) return (0); @@ -845,18 +854,12 @@ reconstruct: return (EIO); } - asize = 0; - for (c = 0; c < acols; c++) { - rc = &cols[c]; - if (rc->rc_size > asize) - asize = rc->rc_size; - } if (cols[VDEV_RAIDZ_P].rc_error == 0) { /* * Attempt to reconstruct the data from parity P. */ - void *orig; - orig = zfs_alloc_temp(asize); + if (orig == NULL) + orig = zfs_alloc_temp(max_rc_size); for (c = nparity; c < acols; c++) { rc = &cols[c]; @@ -874,8 +877,8 @@ reconstruct: /* * Attempt to reconstruct the data from parity Q. */ - void *orig; - orig = zfs_alloc_temp(asize); + if (orig == NULL) + orig = zfs_alloc_temp(max_rc_size); for (c = nparity; c < acols; c++) { rc = &cols[c]; @@ -895,9 +898,14 @@ reconstruct: /* * Attempt to reconstruct the data from both P and Q. */ - void *orig, *orig1; - orig = zfs_alloc_temp(asize); - orig1 = zfs_alloc_temp(asize); + if (orig == NULL) + orig = zfs_alloc_temp(max_rc_size); + if (orig1 == NULL) + orig1 = zfs_alloc_temp(max_rc_size); + if (temp_p == NULL) + temp_p = zfs_alloc_temp(max_rc_size); + if (temp_q == NULL) + temp_q = zfs_alloc_temp(max_rc_size); for (c = nparity; c < acols - 1; c++) { rc = &cols[c]; @@ -909,7 +917,7 @@ reconstruct: memcpy(orig1, rc1->rc_data, rc1->rc_size); vdev_raidz_reconstruct_pq(cols, nparity, - acols, c, c1); + acols, c, c1, temp_p, temp_q); if (zio_checksum_error(bp, buf) == 0) return (0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 22:45:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E041C1065672; Wed, 6 Jan 2010 22:45:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDF958FC0C; Wed, 6 Jan 2010 22:45:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06MjnYr062535; Wed, 6 Jan 2010 22:45:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06Mjn4T062532; Wed, 6 Jan 2010 22:45:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062245.o06Mjn4T062532@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 22:45:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201685 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 22:45:50 -0000 Author: yongari Date: Wed Jan 6 22:45:49 2010 New Revision: 201685 URL: http://svn.freebsd.org/changeset/base/201685 Log: MFC r198923-198924,198927-198928 r198923: Use correct dma tag for jumbo buffer. r198924: Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note, bge_newbuf_std still has a bug for handling dma map load failure under high network load. Just reusing mbuf is not enough as driver already unloaded the dma map of the mbuf. Graceful recovery needs more work. Ideally we can just update dma address part of a Rx descriptor because the controller never overwrite the Rx descriptor. This requires some Rx initialization code changes and it would be done later after fixing other incorrect bus_dma(9) usages. r198927: Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag and Rx DMA tag separately. Previously it used a common mbuf DMA tag for both Tx and Rx path but Rx buffer(standard ring case) should have a single DMA segment and maximum buffer size of the segment should be less than or equal to MCLBYTES. This change also make it possible to add TSO with minor changes. r198928: Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code for buffer allocation. If driver know we are out of Rx buffers let controller stop. This should fix panic when interface is run even if it had no configured Rx buffers. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 6 22:39:40 2010 (r201684) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 6 22:45:49 2010 (r201685) @@ -916,8 +916,8 @@ bge_newbuf_std(struct bge_softc *sc, int { struct mbuf *m_new = NULL; struct bge_rx_bd *r; - struct bge_dmamap_arg ctx; - int error; + bus_dma_segment_t segs[1]; + int error, nsegs; if (m == NULL) { m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); @@ -932,27 +932,24 @@ bge_newbuf_std(struct bge_softc *sc, int if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) m_adj(m_new, ETHER_ALIGN); - sc->bge_cdata.bge_rx_std_chain[i] = m_new; - r = &sc->bge_ldata.bge_rx_std_ring[i]; - ctx.bge_maxsegs = 1; - ctx.sc = sc; - error = bus_dmamap_load(sc->bge_cdata.bge_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], mtod(m_new, void *), - m_new->m_len, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - if (error || ctx.bge_maxsegs == 0) { + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i], m_new, segs, &nsegs, 0); + if (error != 0) { if (m == NULL) { sc->bge_cdata.bge_rx_std_chain[i] = NULL; m_freem(m_new); } - return (ENOMEM); + return (error); } - r->bge_addr.bge_addr_lo = BGE_ADDR_LO(ctx.bge_busaddr); - r->bge_addr.bge_addr_hi = BGE_ADDR_HI(ctx.bge_busaddr); + sc->bge_cdata.bge_rx_std_chain[i] = m_new; + r = &sc->bge_ldata.bge_rx_std_ring[i]; + r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); + r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_flags = BGE_RXBDFLAG_END; - r->bge_len = m_new->m_len; + r->bge_len = segs[0].ds_len; r->bge_idx = i; - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_PREREAD); @@ -1031,7 +1028,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i panic("%s: %d segments\n", __func__, nsegs); } - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_PREREAD); @@ -1047,11 +1044,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i static int bge_init_rx_ring_std(struct bge_softc *sc) { - int i; + int error, i; for (i = 0; i < BGE_SSLOTS; i++) { - if (bge_newbuf_std(sc, i, NULL) == ENOBUFS) - return (ENOBUFS); + if ((error = bge_newbuf_std(sc, i, NULL)) != 0) + return (error); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, @@ -1071,10 +1068,10 @@ bge_free_rx_ring_std(struct bge_softc *s for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); m_freem(sc->bge_cdata.bge_rx_std_chain[i]); sc->bge_cdata.bge_rx_std_chain[i] = NULL; @@ -1088,11 +1085,11 @@ static int bge_init_rx_ring_jumbo(struct bge_softc *sc) { struct bge_rcb *rcb; - int i; + int error, i; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { - if (bge_newbuf_jumbo(sc, i, NULL) == ENOBUFS) - return (ENOBUFS); + if ((error = bge_newbuf_jumbo(sc, i, NULL)) != 0) + return (error); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, @@ -1141,10 +1138,10 @@ bge_free_tx_ring(struct bge_softc *sc) for (i = 0; i < BGE_TX_RING_CNT; i++) { if (sc->bge_cdata.bge_tx_chain[i] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i]); m_freem(sc->bge_cdata.bge_tx_chain[i]); sc->bge_cdata.bge_tx_chain[i] = NULL; @@ -1979,7 +1976,7 @@ bge_dma_free(struct bge_softc *sc) /* Destroy DMA maps for RX buffers. */ for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if (sc->bge_cdata.bge_rx_std_dmamap[i]) - bus_dmamap_destroy(sc->bge_cdata.bge_mtag, + bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); } @@ -1993,12 +1990,14 @@ bge_dma_free(struct bge_softc *sc) /* Destroy DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { if (sc->bge_cdata.bge_tx_dmamap[i]) - bus_dmamap_destroy(sc->bge_cdata.bge_mtag, + bus_dmamap_destroy(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i]); } - if (sc->bge_cdata.bge_mtag) - bus_dma_tag_destroy(sc->bge_cdata.bge_mtag); + if (sc->bge_cdata.bge_rx_mtag) + bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); + if (sc->bge_cdata.bge_tx_mtag) + bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); /* Destroy standard RX ring. */ @@ -2109,21 +2108,33 @@ bge_dma_alloc(device_t dev) } /* - * Create tag for mbufs. + * Create tag for Tx mbufs. */ error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * BGE_NSEG_NEW, BGE_NSEG_NEW, MCLBYTES, - BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_mtag); + BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); + device_printf(sc->bge_dev, "could not allocate TX dma tag\n"); + return (ENOMEM); + } + + /* + * Create tag for Rx mbufs. + */ + error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + + if (error) { + device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); return (ENOMEM); } /* Create DMA maps for RX buffers. */ for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { - error = bus_dmamap_create(sc->bge_cdata.bge_mtag, 0, + error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, &sc->bge_cdata.bge_rx_std_dmamap[i]); if (error) { device_printf(sc->bge_dev, @@ -2134,11 +2145,11 @@ bge_dma_alloc(device_t dev) /* Create DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { - error = bus_dmamap_create(sc->bge_cdata.bge_mtag, 0, + error = bus_dmamap_create(sc->bge_cdata.bge_tx_mtag, 0, &sc->bge_cdata.bge_tx_dmamap[i]); if (error) { device_printf(sc->bge_dev, - "can't create DMA map for RX\n"); + "can't create DMA map for TX\n"); return (ENOMEM); } } @@ -3168,18 +3179,17 @@ bge_rxeof(struct bge_softc *sc) bge_newbuf_jumbo(sc, sc->bge_jumbo, m); continue; } - if (bge_newbuf_jumbo(sc, - sc->bge_jumbo, NULL) == ENOBUFS) { + if (bge_newbuf_jumbo(sc, sc->bge_jumbo, NULL) != 0) { ifp->if_ierrors++; bge_newbuf_jumbo(sc, sc->bge_jumbo, m); continue; } } else { BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[rxidx], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[rxidx]); m = sc->bge_cdata.bge_rx_std_chain[rxidx]; sc->bge_cdata.bge_rx_std_chain[rxidx] = NULL; @@ -3189,8 +3199,7 @@ bge_rxeof(struct bge_softc *sc) bge_newbuf_std(sc, sc->bge_std, m); continue; } - if (bge_newbuf_std(sc, sc->bge_std, - NULL) == ENOBUFS) { + if (bge_newbuf_std(sc, sc->bge_std, NULL) != 0) { ifp->if_ierrors++; bge_newbuf_std(sc, sc->bge_std, m); continue; @@ -3309,10 +3318,10 @@ bge_txeof(struct bge_softc *sc) if (cur_tx->bge_flags & BGE_TXBDFLAG_END) ifp->if_opackets++; if (sc->bge_cdata.bge_tx_chain[idx] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx]); m_freem(sc->bge_cdata.bge_tx_chain[idx]); sc->bge_cdata.bge_tx_chain[idx] = NULL; @@ -3645,7 +3654,7 @@ bge_encap(struct bge_softc *sc, struct m } map = sc->bge_cdata.bge_tx_dmamap[idx]; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, segs, + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW); @@ -3655,8 +3664,8 @@ bge_encap(struct bge_softc *sc, struct m return (ENOBUFS); } *m_head = m; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, - segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, + m, segs, &nsegs, BUS_DMA_NOWAIT); if (error) { m_freem(m); *m_head = NULL; @@ -3670,11 +3679,11 @@ bge_encap(struct bge_softc *sc, struct m * of the end of the ring. */ if (nsegs > (BGE_TX_RING_CNT - sc->bge_txcnt - 16)) { - bus_dmamap_unload(sc->bge_cdata.bge_mtag, map); + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); return (ENOBUFS); } - bus_dmamap_sync(sc->bge_cdata.bge_mtag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3886,7 +3895,11 @@ bge_init_locked(struct bge_softc *sc) bge_setvlan(sc); /* Init RX ring. */ - bge_init_rx_ring_std(sc); + if (bge_init_rx_ring_std(sc) != 0) { + device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + bge_stop(sc); + return; + } /* * Workaround for a bug in 5705 ASIC rev A0. Poll the NIC's @@ -3907,8 +3920,13 @@ bge_init_locked(struct bge_softc *sc) } /* Init jumbo RX ring. */ - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) - bge_init_rx_ring_jumbo(sc); + if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) { + if (bge_init_rx_ring_jumbo(sc) != 0) { + device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + bge_stop(sc); + return; + } + } /* Init our RX return ring index. */ sc->bge_rx_saved_considx = 0; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 22:39:40 2010 (r201684) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 22:45:49 2010 (r201685) @@ -2543,8 +2543,9 @@ struct bge_chain_data { bus_dma_tag_t bge_tx_ring_tag; bus_dma_tag_t bge_status_tag; bus_dma_tag_t bge_stats_tag; - bus_dma_tag_t bge_mtag; /* mbuf mapping tag */ - bus_dma_tag_t bge_mtag_jumbo; /* mbuf mapping tag */ + bus_dma_tag_t bge_rx_mtag; /* Rx mbuf mapping tag */ + bus_dma_tag_t bge_tx_mtag; /* Tx mbuf mapping tag */ + bus_dma_tag_t bge_mtag_jumbo; /* Jumbo mbuf mapping tag */ bus_dmamap_t bge_tx_dmamap[BGE_TX_RING_CNT]; bus_dmamap_t bge_rx_std_dmamap[BGE_STD_RX_RING_CNT]; bus_dmamap_t bge_rx_jumbo_dmamap[BGE_JUMBO_RX_RING_CNT]; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 22:49:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B18A106568B; Wed, 6 Jan 2010 22:49:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4904D8FC12; Wed, 6 Jan 2010 22:49:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06MnBUP063366; Wed, 6 Jan 2010 22:49:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06MnBnf063363; Wed, 6 Jan 2010 22:49:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062249.o06MnBnf063363@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 22:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201686 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 22:49:11 -0000 Author: yongari Date: Wed Jan 6 22:49:10 2010 New Revision: 201686 URL: http://svn.freebsd.org/changeset/base/201686 Log: MFC r198923-198924,198927-198928 r198923: Use correct dma tag for jumbo buffer. r198924: Covert bge_newbuf_std to use bus_dmamap_load_mbuf_sg(9). Note, bge_newbuf_std still has a bug for handling dma map load failure under high network load. Just reusing mbuf is not enough as driver already unloaded the dma map of the mbuf. Graceful recovery needs more work. Ideally we can just update dma address part of a Rx descriptor because the controller never overwrite the Rx descriptor. This requires some Rx initialization code changes and it would be done later after fixing other incorrect bus_dma(9) usages. r198927: Remove common DMA tag used for TX/RX mbufs and create Tx DMA tag and Rx DMA tag separately. Previously it used a common mbuf DMA tag for both Tx and Rx path but Rx buffer(standard ring case) should have a single DMA segment and maximum buffer size of the segment should be less than or equal to MCLBYTES. This change also make it possible to add TSO with minor changes. r198928: Make bge_newbuf_std()/bge_newbuf_jumbo() returns actual error code for buffer allocation. If driver know we are out of Rx buffers let controller stop. This should fix panic when interface is run even if it had no configured Rx buffers. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 22:45:49 2010 (r201685) +++ stable/7/sys/dev/bge/if_bge.c Wed Jan 6 22:49:10 2010 (r201686) @@ -916,8 +916,8 @@ bge_newbuf_std(struct bge_softc *sc, int { struct mbuf *m_new = NULL; struct bge_rx_bd *r; - struct bge_dmamap_arg ctx; - int error; + bus_dma_segment_t segs[1]; + int error, nsegs; if (m == NULL) { m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); @@ -932,27 +932,24 @@ bge_newbuf_std(struct bge_softc *sc, int if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) m_adj(m_new, ETHER_ALIGN); - sc->bge_cdata.bge_rx_std_chain[i] = m_new; - r = &sc->bge_ldata.bge_rx_std_ring[i]; - ctx.bge_maxsegs = 1; - ctx.sc = sc; - error = bus_dmamap_load(sc->bge_cdata.bge_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], mtod(m_new, void *), - m_new->m_len, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); - if (error || ctx.bge_maxsegs == 0) { + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i], m_new, segs, &nsegs, 0); + if (error != 0) { if (m == NULL) { sc->bge_cdata.bge_rx_std_chain[i] = NULL; m_freem(m_new); } - return (ENOMEM); + return (error); } - r->bge_addr.bge_addr_lo = BGE_ADDR_LO(ctx.bge_busaddr); - r->bge_addr.bge_addr_hi = BGE_ADDR_HI(ctx.bge_busaddr); + sc->bge_cdata.bge_rx_std_chain[i] = m_new; + r = &sc->bge_ldata.bge_rx_std_ring[i]; + r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); + r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_flags = BGE_RXBDFLAG_END; - r->bge_len = m_new->m_len; + r->bge_len = segs[0].ds_len; r->bge_idx = i; - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_PREREAD); @@ -1031,7 +1028,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i panic("%s: %d segments\n", __func__, nsegs); } - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_PREREAD); @@ -1047,11 +1044,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, i static int bge_init_rx_ring_std(struct bge_softc *sc) { - int i; + int error, i; for (i = 0; i < BGE_SSLOTS; i++) { - if (bge_newbuf_std(sc, i, NULL) == ENOBUFS) - return (ENOBUFS); + if ((error = bge_newbuf_std(sc, i, NULL)) != 0) + return (error); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, @@ -1071,10 +1068,10 @@ bge_free_rx_ring_std(struct bge_softc *s for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); m_freem(sc->bge_cdata.bge_rx_std_chain[i]); sc->bge_cdata.bge_rx_std_chain[i] = NULL; @@ -1088,11 +1085,11 @@ static int bge_init_rx_ring_jumbo(struct bge_softc *sc) { struct bge_rcb *rcb; - int i; + int error, i; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { - if (bge_newbuf_jumbo(sc, i, NULL) == ENOBUFS) - return (ENOBUFS); + if ((error = bge_newbuf_jumbo(sc, i, NULL)) != 0) + return (error); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, @@ -1141,10 +1138,10 @@ bge_free_tx_ring(struct bge_softc *sc) for (i = 0; i < BGE_TX_RING_CNT; i++) { if (sc->bge_cdata.bge_tx_chain[i] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i]); m_freem(sc->bge_cdata.bge_tx_chain[i]); sc->bge_cdata.bge_tx_chain[i] = NULL; @@ -1979,7 +1976,7 @@ bge_dma_free(struct bge_softc *sc) /* Destroy DMA maps for RX buffers. */ for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { if (sc->bge_cdata.bge_rx_std_dmamap[i]) - bus_dmamap_destroy(sc->bge_cdata.bge_mtag, + bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); } @@ -1993,12 +1990,14 @@ bge_dma_free(struct bge_softc *sc) /* Destroy DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { if (sc->bge_cdata.bge_tx_dmamap[i]) - bus_dmamap_destroy(sc->bge_cdata.bge_mtag, + bus_dmamap_destroy(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[i]); } - if (sc->bge_cdata.bge_mtag) - bus_dma_tag_destroy(sc->bge_cdata.bge_mtag); + if (sc->bge_cdata.bge_rx_mtag) + bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); + if (sc->bge_cdata.bge_tx_mtag) + bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); /* Destroy standard RX ring. */ @@ -2109,21 +2108,33 @@ bge_dma_alloc(device_t dev) } /* - * Create tag for mbufs. + * Create tag for Tx mbufs. */ error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES * BGE_NSEG_NEW, BGE_NSEG_NEW, MCLBYTES, - BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_mtag); + BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); + device_printf(sc->bge_dev, "could not allocate TX dma tag\n"); + return (ENOMEM); + } + + /* + * Create tag for Rx mbufs. + */ + error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, + BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, + MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + + if (error) { + device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); return (ENOMEM); } /* Create DMA maps for RX buffers. */ for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { - error = bus_dmamap_create(sc->bge_cdata.bge_mtag, 0, + error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, &sc->bge_cdata.bge_rx_std_dmamap[i]); if (error) { device_printf(sc->bge_dev, @@ -2134,11 +2145,11 @@ bge_dma_alloc(device_t dev) /* Create DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { - error = bus_dmamap_create(sc->bge_cdata.bge_mtag, 0, + error = bus_dmamap_create(sc->bge_cdata.bge_tx_mtag, 0, &sc->bge_cdata.bge_tx_dmamap[i]); if (error) { device_printf(sc->bge_dev, - "can't create DMA map for RX\n"); + "can't create DMA map for TX\n"); return (ENOMEM); } } @@ -3168,18 +3179,17 @@ bge_rxeof(struct bge_softc *sc) bge_newbuf_jumbo(sc, sc->bge_jumbo, m); continue; } - if (bge_newbuf_jumbo(sc, - sc->bge_jumbo, NULL) == ENOBUFS) { + if (bge_newbuf_jumbo(sc, sc->bge_jumbo, NULL) != 0) { ifp->if_ierrors++; bge_newbuf_jumbo(sc, sc->bge_jumbo, m); continue; } } else { BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[rxidx], BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[rxidx]); m = sc->bge_cdata.bge_rx_std_chain[rxidx]; sc->bge_cdata.bge_rx_std_chain[rxidx] = NULL; @@ -3189,8 +3199,7 @@ bge_rxeof(struct bge_softc *sc) bge_newbuf_std(sc, sc->bge_std, m); continue; } - if (bge_newbuf_std(sc, sc->bge_std, - NULL) == ENOBUFS) { + if (bge_newbuf_std(sc, sc->bge_std, NULL) != 0) { ifp->if_ierrors++; bge_newbuf_std(sc, sc->bge_std, m); continue; @@ -3306,10 +3315,10 @@ bge_txeof(struct bge_softc *sc) if (cur_tx->bge_flags & BGE_TXBDFLAG_END) ifp->if_opackets++; if (sc->bge_cdata.bge_tx_chain[idx] != NULL) { - bus_dmamap_sync(sc->bge_cdata.bge_mtag, + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx], BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(sc->bge_cdata.bge_mtag, + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, sc->bge_cdata.bge_tx_dmamap[idx]); m_freem(sc->bge_cdata.bge_tx_chain[idx]); sc->bge_cdata.bge_tx_chain[idx] = NULL; @@ -3640,7 +3649,7 @@ bge_encap(struct bge_softc *sc, struct m } map = sc->bge_cdata.bge_tx_dmamap[idx]; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, segs, + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW); @@ -3650,8 +3659,8 @@ bge_encap(struct bge_softc *sc, struct m return (ENOBUFS); } *m_head = m; - error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag, map, m, - segs, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, + m, segs, &nsegs, BUS_DMA_NOWAIT); if (error) { m_freem(m); *m_head = NULL; @@ -3665,11 +3674,11 @@ bge_encap(struct bge_softc *sc, struct m * of the end of the ring. */ if (nsegs > (BGE_TX_RING_CNT - sc->bge_txcnt - 16)) { - bus_dmamap_unload(sc->bge_cdata.bge_mtag, map); + bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); return (ENOBUFS); } - bus_dmamap_sync(sc->bge_cdata.bge_mtag, map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; @@ -3881,7 +3890,11 @@ bge_init_locked(struct bge_softc *sc) bge_setvlan(sc); /* Init RX ring. */ - bge_init_rx_ring_std(sc); + if (bge_init_rx_ring_std(sc) != 0) { + device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + bge_stop(sc); + return; + } /* * Workaround for a bug in 5705 ASIC rev A0. Poll the NIC's @@ -3902,8 +3915,13 @@ bge_init_locked(struct bge_softc *sc) } /* Init jumbo RX ring. */ - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) - bge_init_rx_ring_jumbo(sc); + if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) { + if (bge_init_rx_ring_jumbo(sc) != 0) { + device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + bge_stop(sc); + return; + } + } /* Init our RX return ring index. */ sc->bge_rx_saved_considx = 0; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 22:45:49 2010 (r201685) +++ stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 22:49:10 2010 (r201686) @@ -2543,8 +2543,9 @@ struct bge_chain_data { bus_dma_tag_t bge_tx_ring_tag; bus_dma_tag_t bge_status_tag; bus_dma_tag_t bge_stats_tag; - bus_dma_tag_t bge_mtag; /* mbuf mapping tag */ - bus_dma_tag_t bge_mtag_jumbo; /* mbuf mapping tag */ + bus_dma_tag_t bge_rx_mtag; /* Rx mbuf mapping tag */ + bus_dma_tag_t bge_tx_mtag; /* Tx mbuf mapping tag */ + bus_dma_tag_t bge_mtag_jumbo; /* Jumbo mbuf mapping tag */ bus_dmamap_t bge_tx_dmamap[BGE_TX_RING_CNT]; bus_dmamap_t bge_rx_std_dmamap[BGE_STD_RX_RING_CNT]; bus_dmamap_t bge_rx_jumbo_dmamap[BGE_JUMBO_RX_RING_CNT]; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:02:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E927106568F; Wed, 6 Jan 2010 23:02:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06888FC1C; Wed, 6 Jan 2010 23:02:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06N2Zqr066473; Wed, 6 Jan 2010 23:02:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06N2ZXh066470; Wed, 6 Jan 2010 23:02:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062302.o06N2ZXh066470@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201687 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:02:36 -0000 Author: yongari Date: Wed Jan 6 23:02:35 2010 New Revision: 201687 URL: http://svn.freebsd.org/changeset/base/201687 Log: MFC r198967,199009-199011,199014,199020,199035-199036,199054 r198967: Correct MSI mode register bits. r199009: bge(4) already switched to use UMA backed page allocator and local memory allocator for jumbo frame was removed long time ago. Remove no more used macros. r199010: Do bus_dmamap_sync call only if frame size is greater than standard buffer size. If controller is not capable of handling jumbo frame, interface MTU couldn't be larger than standard MTU which in turn the received should be fit in standard buffer. This fixes bus_dmamap_sync call for jumbo ring is called even if interface is configured to use standard MTU. Also if total frame size could be fit into standard buffer don't use jumbo buffers. r199011: Reimplement Rx buffer allocation to handle dma map load failure. Introduce two spare dma maps for standard buffer and jumbo buffer respectively. If loading a dma map failed reuse previously loaded dma map. This should fix unloaded dma map is used in case of dma map load failure. Also don't blindly unload dma map and defer dma map sync and unloading operation until we know dma map for new buffer is successfully loaded. This change saves unnecessary dma load/unload operation. Previously bge(4) tried to reuse mbuf with unloaded dma map which is really bad thing in bus_dma(9) perspective. While I'm here update if_iqdrops if we can't allocate Rx buffers. r199014: Fix I mssied in r199011. Rx ring index also should be updated. If we fill Rx ring full instead of half we can simplify this logic but this requires more experimentation. r199020: Tell upper layer we support long frames. ether_ifattach() initializes it to ETHER_HDR_LEN so we have to override it after calling ether_ifattch(). While I'm here remove setting if_mtu value, it's initialized in ether_ifattach(). r199035: Don't count input errors twice, we always read input errors from MAC in bge_tick. Previously it used to show more number of input errors. I noticed actual input errors were less than 8% even for 64 bytes UDP frames generated by netperf. Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in bge_tick, remove useless code protected by #ifdef notyet. r199036: Count number of inbound packets which were chosen to be discarded as input errors. Also count out of receive BDs as input errors. r199054: Partially revert r199035. Revision 1.158 says only lower ten bits of BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it seems the controller maintains 16bits value for the register. However 16bits are still too small to count all dropped packets happened in a second. To get a correct counter we have to read the register in bge_rxeof() which would be too expensive. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 6 22:49:10 2010 (r201686) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:02:35 2010 (r201687) @@ -393,8 +393,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); -static int bge_newbuf_std(struct bge_softc *, int, struct mbuf *); -static int bge_newbuf_jumbo(struct bge_softc *, int, struct mbuf *); +static int bge_newbuf_std(struct bge_softc *, int); +static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); static void bge_free_rx_ring_std(struct bge_softc *); static int bge_init_rx_ring_jumbo(struct bge_softc *); @@ -912,37 +912,38 @@ bge_miibus_statchg(device_t dev) * Intialize a standard receive ring descriptor. */ static int -bge_newbuf_std(struct bge_softc *sc, int i, struct mbuf *m) +bge_newbuf_std(struct bge_softc *sc, int i) { - struct mbuf *m_new = NULL; + struct mbuf *m; struct bge_rx_bd *r; bus_dma_segment_t segs[1]; + bus_dmamap_t map; int error, nsegs; - if (m == NULL) { - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m_new == NULL) - return (ENOBUFS); - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; - } - + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) - m_adj(m_new, ETHER_ALIGN); + m_adj(m, ETHER_ALIGN); + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], m_new, segs, &nsegs, 0); + sc->bge_cdata.bge_rx_std_sparemap, m, segs, &nsegs, 0); if (error != 0) { - if (m == NULL) { - sc->bge_cdata.bge_rx_std_chain[i] = NULL; - m_freem(m_new); - } + m_freem(m); return (error); } - sc->bge_cdata.bge_rx_std_chain[i] = m_new; - r = &sc->bge_ldata.bge_rx_std_ring[i]; + if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) { + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i]); + } + map = sc->bge_cdata.bge_rx_std_dmamap[i]; + sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; + sc->bge_cdata.bge_rx_std_sparemap = map; + sc->bge_cdata.bge_rx_std_chain[i] = m; + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_flags = BGE_RXBDFLAG_END; @@ -950,8 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int r->bge_idx = i; bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], - BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_PREREAD); return (0); } @@ -961,48 +961,49 @@ bge_newbuf_std(struct bge_softc *sc, int * a jumbo buffer from the pool managed internally by the driver. */ static int -bge_newbuf_jumbo(struct bge_softc *sc, int i, struct mbuf *m) +bge_newbuf_jumbo(struct bge_softc *sc, int i) { bus_dma_segment_t segs[BGE_NSEG_JUMBO]; + bus_dmamap_t map; struct bge_extrx_bd *r; - struct mbuf *m_new = NULL; - int nsegs; - int error; + struct mbuf *m; + int error, nsegs; - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) + return (ENOBUFS); - m_cljget(m_new, M_DONTWAIT, MJUM9BYTES); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); - } - m_new->m_len = m_new->m_pkthdr.len = MJUM9BYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MJUM9BYTES; - m_new->m_data = m_new->m_ext.ext_buf; + m_cljget(m, M_DONTWAIT, MJUM9BYTES); + if (!(m->m_flags & M_EXT)) { + m_freem(m); + return (ENOBUFS); } - + m->m_len = m->m_pkthdr.len = MJUM9BYTES; if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) - m_adj(m_new, ETHER_ALIGN); + m_adj(m, ETHER_ALIGN); error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[i], - m_new, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { - if (m == NULL) - m_freem(m_new); + sc->bge_cdata.bge_rx_jumbo_sparemap, m, segs, &nsegs, 0); + if (error != 0) { + m_freem(m); return (error); } - sc->bge_cdata.bge_rx_jumbo_chain[i] = m_new; + if (sc->bge_cdata.bge_rx_jumbo_chain[i] == NULL) { + bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_dmamap[i]); + } + map = sc->bge_cdata.bge_rx_jumbo_dmamap[i]; + sc->bge_cdata.bge_rx_jumbo_dmamap[i] = + sc->bge_cdata.bge_rx_jumbo_sparemap; + sc->bge_cdata.bge_rx_jumbo_sparemap = map; + sc->bge_cdata.bge_rx_jumbo_chain[i] = m; /* * Fill in the extended RX buffer descriptor. */ - r = &sc->bge_ldata.bge_rx_jumbo_ring[i]; + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; r->bge_idx = i; r->bge_len3 = r->bge_len2 = r->bge_len1 = 0; @@ -1029,8 +1030,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i } bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[i], - BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_PREREAD); return (0); } @@ -1046,9 +1046,11 @@ bge_init_rx_ring_std(struct bge_softc *s { int error, i; + sc->bge_std = 0; for (i = 0; i < BGE_SSLOTS; i++) { - if ((error = bge_newbuf_std(sc, i, NULL)) != 0) + if ((error = bge_newbuf_std(sc, i)) != 0) return (error); + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, @@ -1087,9 +1089,11 @@ bge_init_rx_ring_jumbo(struct bge_softc struct bge_rcb *rcb; int error, i; + sc->bge_jumbo = 0; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { - if ((error = bge_newbuf_jumbo(sc, i, NULL)) != 0) + if ((error = bge_newbuf_jumbo(sc, i)) != 0) return (error); + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, @@ -1979,6 +1983,9 @@ bge_dma_free(struct bge_softc *sc) bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); } + if (sc->bge_cdata.bge_rx_std_sparemap) + bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_sparemap); /* Destroy DMA maps for jumbo RX buffers. */ for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { @@ -1986,6 +1993,9 @@ bge_dma_free(struct bge_softc *sc) bus_dmamap_destroy(sc->bge_cdata.bge_mtag_jumbo, sc->bge_cdata.bge_rx_jumbo_dmamap[i]); } + if (sc->bge_cdata.bge_rx_jumbo_sparemap) + bus_dmamap_destroy(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_sparemap); /* Destroy DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { @@ -2133,6 +2143,13 @@ bge_dma_alloc(device_t dev) } /* Create DMA maps for RX buffers. */ + error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, + &sc->bge_cdata.bge_rx_std_sparemap); + if (error) { + device_printf(sc->bge_dev, + "can't create spare DMA map for RX\n"); + return (ENOMEM); + } for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, &sc->bge_cdata.bge_rx_std_dmamap[i]); @@ -2234,6 +2251,13 @@ bge_dma_alloc(device_t dev) sc->bge_ldata.bge_rx_jumbo_ring_paddr = ctx.bge_busaddr; /* Create DMA maps for jumbo RX buffers. */ + error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, + 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); + if (error) { + device_printf(sc->bge_dev, + "can't create sapre DMA map for jumbo RX\n"); + return (ENOMEM); + } for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, 0, &sc->bge_cdata.bge_rx_jumbo_dmamap[i]); @@ -2699,7 +2723,6 @@ bge_attach(device_t dev) ifp->if_ioctl = bge_ioctl; ifp->if_start = bge_start; ifp->if_init = bge_init; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -2814,6 +2837,9 @@ again: ether_ifattach(ifp, eaddr); callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); + /* Tell upper layer we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* * Hookup IRQ last. */ @@ -3134,7 +3160,8 @@ bge_rxeof(struct bge_softc *sc) sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); - if (BGE_IS_JUMBO_CAPABLE(sc)) + if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + (MCLBYTES - ETHER_ALIGN)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); @@ -3165,45 +3192,31 @@ bge_rxeof(struct bge_softc *sc) } if (cur_rx->bge_flags & BGE_RXBDFLAG_JUMBO_RING) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[rxidx], - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[rxidx]); - m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; - sc->bge_cdata.bge_rx_jumbo_chain[rxidx] = NULL; jumbocnt++; + m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - ifp->if_ierrors++; - bge_newbuf_jumbo(sc, sc->bge_jumbo, m); + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); continue; } - if (bge_newbuf_jumbo(sc, sc->bge_jumbo, NULL) != 0) { - ifp->if_ierrors++; - bge_newbuf_jumbo(sc, sc->bge_jumbo, m); + if (bge_newbuf_jumbo(sc, rxidx) != 0) { + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + ifp->if_iqdrops++; continue; } + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[rxidx], - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[rxidx]); - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; - sc->bge_cdata.bge_rx_std_chain[rxidx] = NULL; stdcnt++; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - ifp->if_ierrors++; - bge_newbuf_std(sc, sc->bge_std, m); + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); continue; } - if (bge_newbuf_std(sc, sc->bge_std, NULL) != 0) { - ifp->if_ierrors++; - bge_newbuf_std(sc, sc->bge_std, m); + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; + if (bge_newbuf_std(sc, rxidx) != 0) { + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + ifp->if_iqdrops++; continue; } + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); } ifp->if_ipackets++; @@ -3266,7 +3279,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - if (BGE_IS_JUMBO_CAPABLE(sc) && jumbocnt > 0) + if (jumbocnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); @@ -3542,7 +3555,9 @@ bge_stats_update_regs(struct bge_softc * ifp->if_collisions += CSR_READ_4(sc, BGE_MAC_STATS + offsetof(struct bge_mac_stats_regs, etherStatsCollisions)); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS); ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS); } static void @@ -3920,7 +3935,8 @@ bge_init_locked(struct bge_softc *sc) } /* Init jumbo RX ring. */ - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) { + if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); bge_stop(sc); Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 22:49:10 2010 (r201686) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:02:35 2010 (r201687) @@ -1705,11 +1705,8 @@ /* MSI mode register */ #define BGE_MSIMODE_RESET 0x00000001 #define BGE_MSIMODE_ENABLE 0x00000002 -#define BGE_MSIMODE_PCI_TGT_ABRT_ATTN 0x00000004 -#define BGE_MSIMODE_PCI_MSTR_ABRT_ATTN 0x00000008 -#define BGE_MSIMODE_PCI_PERR_ATTN 0x00000010 -#define BGE_MSIMODE_MSI_FIFOUFLOW_ATTN 0x00000020 -#define BGE_MSIMODE_MSI_FIFOOFLOW_ATTN 0x00000040 +#define BGE_MSIMODE_ONE_SHOT_DISABLE 0x00000020 +#define BGE_MSIMODE_MULTIVEC_ENABLE 0x00000080 /* MSI status register */ #define BGE_MSISTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -2484,13 +2481,6 @@ struct bge_gib { #define BGE_MSLOTS 256 #define BGE_JSLOTS 384 -#define BGE_JRAWLEN (BGE_JUMBO_FRAMELEN + ETHER_ALIGN) -#define BGE_JLEN (BGE_JRAWLEN + (sizeof(uint64_t) - \ - (BGE_JRAWLEN % sizeof(uint64_t)))) -#define BGE_JPAGESZ PAGE_SIZE -#define BGE_RESID (BGE_JPAGESZ - (BGE_JLEN * BGE_JSLOTS) % BGE_JPAGESZ) -#define BGE_JMEM ((BGE_JLEN * BGE_JSLOTS) + BGE_RESID) - #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 @@ -2547,7 +2537,9 @@ struct bge_chain_data { bus_dma_tag_t bge_tx_mtag; /* Tx mbuf mapping tag */ bus_dma_tag_t bge_mtag_jumbo; /* Jumbo mbuf mapping tag */ bus_dmamap_t bge_tx_dmamap[BGE_TX_RING_CNT]; + bus_dmamap_t bge_rx_std_sparemap; bus_dmamap_t bge_rx_std_dmamap[BGE_STD_RX_RING_CNT]; + bus_dmamap_t bge_rx_jumbo_sparemap; bus_dmamap_t bge_rx_jumbo_dmamap[BGE_JUMBO_RX_RING_CNT]; bus_dmamap_t bge_rx_std_ring_map; bus_dmamap_t bge_rx_jumbo_ring_map; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:05:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AD4C1065693; Wed, 6 Jan 2010 23:05:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 039208FC1C; Wed, 6 Jan 2010 23:05:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06N50bg067142; Wed, 6 Jan 2010 23:05:00 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06N50Cd067140; Wed, 6 Jan 2010 23:05:00 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001062305.o06N50Cd067140@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 6 Jan 2010 23:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201688 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:05:01 -0000 Author: bz Date: Wed Jan 6 23:05:00 2010 New Revision: 201688 URL: http://svn.freebsd.org/changeset/base/201688 Log: Correct a typo. Submitted by: sn_ (sn_ gmx.net) on hackers@ MFC after: 3 days Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Wed Jan 6 23:02:35 2010 (r201687) +++ head/sys/netinet6/icmp6.c Wed Jan 6 23:05:00 2010 (r201688) @@ -296,7 +296,7 @@ icmp6_error(struct mbuf *m, int type, in * we should basically suppress sending an error (RFC 2463, Section * 2.4). * We have two exceptions (the item e.2 in that section): - * - the Pakcet Too Big message can be sent for path MTU discovery. + * - the Packet Too Big message can be sent for path MTU discovery. * - the Parameter Problem Message that can be allowed an icmp6 error * in the option type field. This check has been done in * ip6_unknown_opt(), so we can just check the type and code. From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:09:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 299921065696; Wed, 6 Jan 2010 23:09:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 101F98FC13; Wed, 6 Jan 2010 23:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06N9NGa068127; Wed, 6 Jan 2010 23:09:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06N9NpH068124; Wed, 6 Jan 2010 23:09:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001062309.o06N9NpH068124@svn.freebsd.org> From: Xin LI Date: Wed, 6 Jan 2010 23:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201689 - in head/sys: boot/zfs cddl/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:09:24 -0000 Author: delphij Date: Wed Jan 6 23:09:23 2010 New Revision: 201689 URL: http://svn.freebsd.org/changeset/base/201689 Log: Instead of assuming all vdevs are healthy, check the newest vdev label for each vdev's status. Booting from a degraded vdev should now be more robust. Submitted by: Matt Reimer Sponsored by: VPOP Technologies, Inc. MFC after: 2 weeks Modified: head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Jan 6 23:05:00 2010 (r201688) +++ head/sys/boot/zfs/zfsimpl.c Wed Jan 6 23:09:23 2010 (r201689) @@ -404,7 +404,7 @@ vdev_create(uint64_t guid, vdev_read_t * } static int -vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp) +vdev_init_from_nvlist(const unsigned char *nvlist, vdev_t **vdevp, int is_newer) { int rc; uint64_t guid, id, ashift, nparity; @@ -412,7 +412,8 @@ vdev_init_from_nvlist(const unsigned cha const char *path; vdev_t *vdev, *kid; const unsigned char *kids; - int nkids, i; + int nkids, i, is_new; + uint64_t is_offline, is_faulted, is_degraded, is_removed; if (nvlist_find(nvlist, ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, 0, &guid) @@ -424,17 +425,6 @@ vdev_init_from_nvlist(const unsigned cha return (ENOENT); } - /* - * Assume that if we've seen this vdev tree before, this one - * will be identical. - */ - vdev = vdev_find(guid); - if (vdev) { - if (vdevp) - *vdevp = vdev; - return (0); - } - if (strcmp(type, VDEV_TYPE_MIRROR) && strcmp(type, VDEV_TYPE_DISK) && strcmp(type, VDEV_TYPE_RAIDZ)) { @@ -442,6 +432,21 @@ vdev_init_from_nvlist(const unsigned cha return (EIO); } + is_offline = is_removed = is_faulted = is_degraded = 0; + + nvlist_find(nvlist, ZPOOL_CONFIG_OFFLINE, DATA_TYPE_UINT64, 0, + &is_offline); + nvlist_find(nvlist, ZPOOL_CONFIG_REMOVED, DATA_TYPE_UINT64, 0, + &is_removed); + nvlist_find(nvlist, ZPOOL_CONFIG_FAULTED, DATA_TYPE_UINT64, 0, + &is_faulted); + nvlist_find(nvlist, ZPOOL_CONFIG_DEGRADED, DATA_TYPE_UINT64, 0, + &is_degraded); + + vdev = vdev_find(guid); + if (!vdev) { + is_new = 1; + if (!strcmp(type, VDEV_TYPE_MIRROR)) vdev = vdev_create(guid, vdev_mirror_read); else if (!strcmp(type, VDEV_TYPE_RAIDZ)) @@ -480,6 +485,39 @@ vdev_init_from_nvlist(const unsigned cha vdev->v_name = strdup(type); } } + + if (is_offline) + vdev->v_state = VDEV_STATE_OFFLINE; + else if (is_removed) + vdev->v_state = VDEV_STATE_REMOVED; + else if (is_faulted) + vdev->v_state = VDEV_STATE_FAULTED; + else if (is_degraded) + vdev->v_state = VDEV_STATE_DEGRADED; + else + vdev->v_state = VDEV_STATE_HEALTHY; + } else { + is_new = 0; + + if (is_newer) { + /* + * We've already seen this vdev, but from an older + * vdev label, so let's refresh its state from the + * newer label. + */ + if (is_offline) + vdev->v_state = VDEV_STATE_OFFLINE; + else if (is_removed) + vdev->v_state = VDEV_STATE_REMOVED; + else if (is_faulted) + vdev->v_state = VDEV_STATE_FAULTED; + else if (is_degraded) + vdev->v_state = VDEV_STATE_DEGRADED; + else + vdev->v_state = VDEV_STATE_HEALTHY; + } + } + rc = nvlist_find(nvlist, ZPOOL_CONFIG_CHILDREN, DATA_TYPE_NVLIST_ARRAY, &nkids, &kids); /* @@ -488,10 +526,12 @@ vdev_init_from_nvlist(const unsigned cha if (rc == 0) { vdev->v_nchildren = nkids; for (i = 0; i < nkids; i++) { - rc = vdev_init_from_nvlist(kids, &kid); + rc = vdev_init_from_nvlist(kids, &kid, is_newer); if (rc) return (rc); - STAILQ_INSERT_TAIL(&vdev->v_children, kid, v_childlink); + if (is_new) + STAILQ_INSERT_TAIL(&vdev->v_children, kid, + v_childlink); kids = nvlist_next(kids); } } else { @@ -593,7 +633,9 @@ state_name(vdev_state_t state) "UNKNOWN", "CLOSED", "OFFLINE", + "REMOVED", "CANT_OPEN", + "FAULTED", "DEGRADED", "ONLINE" }; @@ -711,7 +753,7 @@ vdev_probe(vdev_phys_read_t *read, void uint64_t pool_txg, pool_guid; const char *pool_name; const unsigned char *vdevs; - int i, rc; + int i, rc, is_newer; char upbuf[1024]; const struct uberblock *up; @@ -793,12 +835,15 @@ vdev_probe(vdev_phys_read_t *read, void spa = spa_create(pool_guid); spa->spa_name = strdup(pool_name); } - if (pool_txg > spa->spa_txg) + if (pool_txg > spa->spa_txg) { spa->spa_txg = pool_txg; + is_newer = 1; + } else + is_newer = 0; /* * Get the vdev tree and create our in-core copy of it. - * If we already have a healthy vdev with this guid, this must + * If we already have a vdev with this guid, this must * be some kind of alias (overlapping slices, dangerously dedicated * disks etc). */ @@ -808,16 +853,16 @@ vdev_probe(vdev_phys_read_t *read, void return (EIO); } vdev = vdev_find(guid); - if (vdev && vdev->v_state == VDEV_STATE_HEALTHY) { + if (vdev && vdev->v_phys_read) /* Has this vdev already been inited? */ return (EIO); - } if (nvlist_find(nvlist, ZPOOL_CONFIG_VDEV_TREE, DATA_TYPE_NVLIST, 0, &vdevs)) { return (EIO); } - rc = vdev_init_from_nvlist(vdevs, &top_vdev); + + rc = vdev_init_from_nvlist(vdevs, &top_vdev, is_newer); if (rc) return (rc); @@ -838,7 +883,6 @@ vdev_probe(vdev_phys_read_t *read, void if (vdev) { vdev->v_phys_read = read; vdev->v_read_priv = read_priv; - vdev->v_state = VDEV_STATE_HEALTHY; } else { printf("ZFS: inconsistent nvlist contents\n"); return (EIO); Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Wed Jan 6 23:05:00 2010 (r201688) +++ head/sys/cddl/boot/zfs/zfsimpl.h Wed Jan 6 23:09:23 2010 (r201689) @@ -548,7 +548,6 @@ typedef enum { #define ZPOOL_CONFIG_DTL "DTL" #define ZPOOL_CONFIG_STATS "stats" #define ZPOOL_CONFIG_WHOLE_DISK "whole_disk" -#define ZPOOL_CONFIG_OFFLINE "offline" #define ZPOOL_CONFIG_ERRCOUNT "error_count" #define ZPOOL_CONFIG_NOT_PRESENT "not_present" #define ZPOOL_CONFIG_SPARES "spares" @@ -558,6 +557,16 @@ typedef enum { #define ZPOOL_CONFIG_HOSTNAME "hostname" #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ +/* + * The persistent vdev state is stored as separate values rather than a single + * 'vdev_state' entry. This is because a device can be in multiple states, such + * as offline and degraded. + */ +#define ZPOOL_CONFIG_OFFLINE "offline" +#define ZPOOL_CONFIG_FAULTED "faulted" +#define ZPOOL_CONFIG_DEGRADED "degraded" +#define ZPOOL_CONFIG_REMOVED "removed" + #define VDEV_TYPE_ROOT "root" #define VDEV_TYPE_MIRROR "mirror" #define VDEV_TYPE_REPLACING "replacing" @@ -590,7 +599,9 @@ typedef enum vdev_state { VDEV_STATE_UNKNOWN = 0, /* Uninitialized vdev */ VDEV_STATE_CLOSED, /* Not currently open */ VDEV_STATE_OFFLINE, /* Not allowed to open */ + VDEV_STATE_REMOVED, /* Explicitly removed from system */ VDEV_STATE_CANT_OPEN, /* Tried to open, but failed */ + VDEV_STATE_FAULTED, /* External request to fault device */ VDEV_STATE_DEGRADED, /* Replicated vdev with unhealthy kids */ VDEV_STATE_HEALTHY /* Presumed good */ } vdev_state_t; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:11:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7A210656B0; Wed, 6 Jan 2010 23:11:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 575CD8FC2E; Wed, 6 Jan 2010 23:11:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NBuqk068758; Wed, 6 Jan 2010 23:11:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NBuBB068756; Wed, 6 Jan 2010 23:11:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001062311.o06NBuBB068756@svn.freebsd.org> From: Xin LI Date: Wed, 6 Jan 2010 23:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201690 - head/sys/boot/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:11:56 -0000 Author: delphij Date: Wed Jan 6 23:11:56 2010 New Revision: 201690 URL: http://svn.freebsd.org/changeset/base/201690 Log: Space cleanup for revision 201689 committed separately for easier review. This commit is purely space changes. Submitted by: Matt Reimer Sponsored by: VPOP Technologies, Inc. MFC after: 2 weeks Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Jan 6 23:09:23 2010 (r201689) +++ head/sys/boot/zfs/zfsimpl.c Wed Jan 6 23:11:56 2010 (r201690) @@ -447,44 +447,44 @@ vdev_init_from_nvlist(const unsigned cha if (!vdev) { is_new = 1; - if (!strcmp(type, VDEV_TYPE_MIRROR)) - vdev = vdev_create(guid, vdev_mirror_read); - else if (!strcmp(type, VDEV_TYPE_RAIDZ)) - vdev = vdev_create(guid, vdev_raidz_read); - else - vdev = vdev_create(guid, vdev_disk_read); + if (!strcmp(type, VDEV_TYPE_MIRROR)) + vdev = vdev_create(guid, vdev_mirror_read); + else if (!strcmp(type, VDEV_TYPE_RAIDZ)) + vdev = vdev_create(guid, vdev_raidz_read); + else + vdev = vdev_create(guid, vdev_disk_read); - vdev->v_id = id; - if (nvlist_find(nvlist, ZPOOL_CONFIG_ASHIFT, - DATA_TYPE_UINT64, 0, &ashift) == 0) - vdev->v_ashift = ashift; - else - vdev->v_ashift = 0; - if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, - DATA_TYPE_UINT64, 0, &nparity) == 0) - vdev->v_nparity = nparity; - else - vdev->v_nparity = 0; - if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, - DATA_TYPE_STRING, 0, &path) == 0) { - if (strlen(path) > 5 - && path[0] == '/' - && path[1] == 'd' - && path[2] == 'e' - && path[3] == 'v' - && path[4] == '/') - path += 5; - vdev->v_name = strdup(path); - } else { - if (!strcmp(type, "raidz")) { - if (vdev->v_nparity == 1) - vdev->v_name = "raidz1"; - else - vdev->v_name = "raidz2"; + vdev->v_id = id; + if (nvlist_find(nvlist, ZPOOL_CONFIG_ASHIFT, + DATA_TYPE_UINT64, 0, &ashift) == 0) + vdev->v_ashift = ashift; + else + vdev->v_ashift = 0; + if (nvlist_find(nvlist, ZPOOL_CONFIG_NPARITY, + DATA_TYPE_UINT64, 0, &nparity) == 0) + vdev->v_nparity = nparity; + else + vdev->v_nparity = 0; + if (nvlist_find(nvlist, ZPOOL_CONFIG_PATH, + DATA_TYPE_STRING, 0, &path) == 0) { + if (strlen(path) > 5 + && path[0] == '/' + && path[1] == 'd' + && path[2] == 'e' + && path[3] == 'v' + && path[4] == '/') + path += 5; + vdev->v_name = strdup(path); } else { - vdev->v_name = strdup(type); + if (!strcmp(type, "raidz")) { + if (vdev->v_nparity == 1) + vdev->v_name = "raidz1"; + else + vdev->v_name = "raidz2"; + } else { + vdev->v_name = strdup(type); + } } - } if (is_offline) vdev->v_state = VDEV_STATE_OFFLINE; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:15:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C99F1065697; Wed, 6 Jan 2010 23:15:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A49C8FC14; Wed, 6 Jan 2010 23:15:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NF7Pi069493; Wed, 6 Jan 2010 23:15:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NF7Z9069490; Wed, 6 Jan 2010 23:15:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062315.o06NF7Z9069490@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201691 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:15:07 -0000 Author: yongari Date: Wed Jan 6 23:15:07 2010 New Revision: 201691 URL: http://svn.freebsd.org/changeset/base/201691 Log: MFC r198967,199009-199011,199014,199020,199035-199036,199054 r198967: Correct MSI mode register bits. r199009: bge(4) already switched to use UMA backed page allocator and local memory allocator for jumbo frame was removed long time ago. Remove no more used macros. r199010: Do bus_dmamap_sync call only if frame size is greater than standard buffer size. If controller is not capable of handling jumbo frame, interface MTU couldn't be larger than standard MTU which in turn the received should be fit in standard buffer. This fixes bus_dmamap_sync call for jumbo ring is called even if interface is configured to use standard MTU. Also if total frame size could be fit into standard buffer don't use jumbo buffers. r199011: Reimplement Rx buffer allocation to handle dma map load failure. Introduce two spare dma maps for standard buffer and jumbo buffer respectively. If loading a dma map failed reuse previously loaded dma map. This should fix unloaded dma map is used in case of dma map load failure. Also don't blindly unload dma map and defer dma map sync and unloading operation until we know dma map for new buffer is successfully loaded. This change saves unnecessary dma load/unload operation. Previously bge(4) tried to reuse mbuf with unloaded dma map which is really bad thing in bus_dma(9) perspective. While I'm here update if_iqdrops if we can't allocate Rx buffers. r199014: Fix I mssied in r199011. Rx ring index also should be updated. If we fill Rx ring full instead of half we can simplify this logic but this requires more experimentation. r199020: Tell upper layer we support long frames. ether_ifattach() initializes it to ETHER_HDR_LEN so we have to override it after calling ether_ifattch(). While I'm here remove setting if_mtu value, it's initialized in ether_ifattach(). r199035: Don't count input errors twice, we always read input errors from MAC in bge_tick. Previously it used to show more number of input errors. I noticed actual input errors were less than 8% even for 64 bytes UDP frames generated by netperf. Since we always access BGE_RXLP_LOCSTAT_IFIN_DROPS register in bge_tick, remove useless code protected by #ifdef notyet. r199036: Count number of inbound packets which were chosen to be discarded as input errors. Also count out of receive BDs as input errors. r199054: Partially revert r199035. Revision 1.158 says only lower ten bits of BGE_RXLP_LOCSTAT_IFIN_DROPS register is valid. For BCM5761 case it seems the controller maintains 16bits value for the register. However 16bits are still too small to count all dropped packets happened in a second. To get a correct counter we have to read the register in bge_rxeof() which would be too expensive. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:11:56 2010 (r201690) +++ stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:15:07 2010 (r201691) @@ -393,8 +393,8 @@ static void bge_setpromisc(struct bge_so static void bge_setmulti(struct bge_softc *); static void bge_setvlan(struct bge_softc *); -static int bge_newbuf_std(struct bge_softc *, int, struct mbuf *); -static int bge_newbuf_jumbo(struct bge_softc *, int, struct mbuf *); +static int bge_newbuf_std(struct bge_softc *, int); +static int bge_newbuf_jumbo(struct bge_softc *, int); static int bge_init_rx_ring_std(struct bge_softc *); static void bge_free_rx_ring_std(struct bge_softc *); static int bge_init_rx_ring_jumbo(struct bge_softc *); @@ -912,37 +912,38 @@ bge_miibus_statchg(device_t dev) * Intialize a standard receive ring descriptor. */ static int -bge_newbuf_std(struct bge_softc *sc, int i, struct mbuf *m) +bge_newbuf_std(struct bge_softc *sc, int i) { - struct mbuf *m_new = NULL; + struct mbuf *m; struct bge_rx_bd *r; bus_dma_segment_t segs[1]; + bus_dmamap_t map; int error, nsegs; - if (m == NULL) { - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (m_new == NULL) - return (ENOBUFS); - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; - m_new->m_data = m_new->m_ext.ext_buf; - } - + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + m->m_len = m->m_pkthdr.len = MCLBYTES; if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) - m_adj(m_new, ETHER_ALIGN); + m_adj(m, ETHER_ALIGN); + error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], m_new, segs, &nsegs, 0); + sc->bge_cdata.bge_rx_std_sparemap, m, segs, &nsegs, 0); if (error != 0) { - if (m == NULL) { - sc->bge_cdata.bge_rx_std_chain[i] = NULL; - m_freem(m_new); - } + m_freem(m); return (error); } - sc->bge_cdata.bge_rx_std_chain[i] = m_new; - r = &sc->bge_ldata.bge_rx_std_ring[i]; + if (sc->bge_cdata.bge_rx_std_chain[i] != NULL) { + bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_dmamap[i]); + } + map = sc->bge_cdata.bge_rx_std_dmamap[i]; + sc->bge_cdata.bge_rx_std_dmamap[i] = sc->bge_cdata.bge_rx_std_sparemap; + sc->bge_cdata.bge_rx_std_sparemap = map; + sc->bge_cdata.bge_rx_std_chain[i] = m; + r = &sc->bge_ldata.bge_rx_std_ring[sc->bge_std]; r->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[0].ds_addr); r->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[0].ds_addr); r->bge_flags = BGE_RXBDFLAG_END; @@ -950,8 +951,7 @@ bge_newbuf_std(struct bge_softc *sc, int r->bge_idx = i; bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[i], - BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_rx_std_dmamap[i], BUS_DMASYNC_PREREAD); return (0); } @@ -961,48 +961,49 @@ bge_newbuf_std(struct bge_softc *sc, int * a jumbo buffer from the pool managed internally by the driver. */ static int -bge_newbuf_jumbo(struct bge_softc *sc, int i, struct mbuf *m) +bge_newbuf_jumbo(struct bge_softc *sc, int i) { bus_dma_segment_t segs[BGE_NSEG_JUMBO]; + bus_dmamap_t map; struct bge_extrx_bd *r; - struct mbuf *m_new = NULL; - int nsegs; - int error; + struct mbuf *m; + int error, nsegs; - if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); - if (m_new == NULL) - return (ENOBUFS); + MGETHDR(m, M_DONTWAIT, MT_DATA); + if (m == NULL) + return (ENOBUFS); - m_cljget(m_new, M_DONTWAIT, MJUM9BYTES); - if (!(m_new->m_flags & M_EXT)) { - m_freem(m_new); - return (ENOBUFS); - } - m_new->m_len = m_new->m_pkthdr.len = MJUM9BYTES; - } else { - m_new = m; - m_new->m_len = m_new->m_pkthdr.len = MJUM9BYTES; - m_new->m_data = m_new->m_ext.ext_buf; + m_cljget(m, M_DONTWAIT, MJUM9BYTES); + if (!(m->m_flags & M_EXT)) { + m_freem(m); + return (ENOBUFS); } - + m->m_len = m->m_pkthdr.len = MJUM9BYTES; if ((sc->bge_flags & BGE_FLAG_RX_ALIGNBUG) == 0) - m_adj(m_new, ETHER_ALIGN); + m_adj(m, ETHER_ALIGN); error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[i], - m_new, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { - if (m == NULL) - m_freem(m_new); + sc->bge_cdata.bge_rx_jumbo_sparemap, m, segs, &nsegs, 0); + if (error != 0) { + m_freem(m); return (error); } - sc->bge_cdata.bge_rx_jumbo_chain[i] = m_new; + if (sc->bge_cdata.bge_rx_jumbo_chain[i] == NULL) { + bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_dmamap[i]); + } + map = sc->bge_cdata.bge_rx_jumbo_dmamap[i]; + sc->bge_cdata.bge_rx_jumbo_dmamap[i] = + sc->bge_cdata.bge_rx_jumbo_sparemap; + sc->bge_cdata.bge_rx_jumbo_sparemap = map; + sc->bge_cdata.bge_rx_jumbo_chain[i] = m; /* * Fill in the extended RX buffer descriptor. */ - r = &sc->bge_ldata.bge_rx_jumbo_ring[i]; + r = &sc->bge_ldata.bge_rx_jumbo_ring[sc->bge_jumbo]; r->bge_flags = BGE_RXBDFLAG_JUMBO_RING | BGE_RXBDFLAG_END; r->bge_idx = i; r->bge_len3 = r->bge_len2 = r->bge_len1 = 0; @@ -1029,8 +1030,7 @@ bge_newbuf_jumbo(struct bge_softc *sc, i } bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[i], - BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_rx_jumbo_dmamap[i], BUS_DMASYNC_PREREAD); return (0); } @@ -1046,9 +1046,11 @@ bge_init_rx_ring_std(struct bge_softc *s { int error, i; + sc->bge_std = 0; for (i = 0; i < BGE_SSLOTS; i++) { - if ((error = bge_newbuf_std(sc, i, NULL)) != 0) + if ((error = bge_newbuf_std(sc, i)) != 0) return (error); + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, @@ -1087,9 +1089,11 @@ bge_init_rx_ring_jumbo(struct bge_softc struct bge_rcb *rcb; int error, i; + sc->bge_jumbo = 0; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { - if ((error = bge_newbuf_jumbo(sc, i, NULL)) != 0) + if ((error = bge_newbuf_jumbo(sc, i)) != 0) return (error); + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, @@ -1979,6 +1983,9 @@ bge_dma_free(struct bge_softc *sc) bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, sc->bge_cdata.bge_rx_std_dmamap[i]); } + if (sc->bge_cdata.bge_rx_std_sparemap) + bus_dmamap_destroy(sc->bge_cdata.bge_rx_mtag, + sc->bge_cdata.bge_rx_std_sparemap); /* Destroy DMA maps for jumbo RX buffers. */ for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { @@ -1986,6 +1993,9 @@ bge_dma_free(struct bge_softc *sc) bus_dmamap_destroy(sc->bge_cdata.bge_mtag_jumbo, sc->bge_cdata.bge_rx_jumbo_dmamap[i]); } + if (sc->bge_cdata.bge_rx_jumbo_sparemap) + bus_dmamap_destroy(sc->bge_cdata.bge_mtag_jumbo, + sc->bge_cdata.bge_rx_jumbo_sparemap); /* Destroy DMA maps for TX buffers. */ for (i = 0; i < BGE_TX_RING_CNT; i++) { @@ -2133,6 +2143,13 @@ bge_dma_alloc(device_t dev) } /* Create DMA maps for RX buffers. */ + error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, + &sc->bge_cdata.bge_rx_std_sparemap); + if (error) { + device_printf(sc->bge_dev, + "can't create spare DMA map for RX\n"); + return (ENOMEM); + } for (i = 0; i < BGE_STD_RX_RING_CNT; i++) { error = bus_dmamap_create(sc->bge_cdata.bge_rx_mtag, 0, &sc->bge_cdata.bge_rx_std_dmamap[i]); @@ -2234,6 +2251,13 @@ bge_dma_alloc(device_t dev) sc->bge_ldata.bge_rx_jumbo_ring_paddr = ctx.bge_busaddr; /* Create DMA maps for jumbo RX buffers. */ + error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, + 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); + if (error) { + device_printf(sc->bge_dev, + "can't create sapre DMA map for jumbo RX\n"); + return (ENOMEM); + } for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { error = bus_dmamap_create(sc->bge_cdata.bge_mtag_jumbo, 0, &sc->bge_cdata.bge_rx_jumbo_dmamap[i]); @@ -2699,7 +2723,6 @@ bge_attach(device_t dev) ifp->if_ioctl = bge_ioctl; ifp->if_start = bge_start; ifp->if_init = bge_init; - ifp->if_mtu = ETHERMTU; ifp->if_snd.ifq_drv_maxlen = BGE_TX_RING_CNT - 1; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -2814,6 +2837,9 @@ again: ether_ifattach(ifp, eaddr); callout_init_mtx(&sc->bge_stat_ch, &sc->bge_mtx, 0); + /* Tell upper layer we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* * Hookup IRQ last. */ @@ -3132,7 +3158,8 @@ bge_rxeof(struct bge_softc *sc) sc->bge_cdata.bge_rx_return_ring_map, BUS_DMASYNC_POSTREAD); bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_POSTWRITE); - if (BGE_IS_JUMBO_CAPABLE(sc)) + if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + (MCLBYTES - ETHER_ALIGN)) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); @@ -3165,45 +3192,31 @@ bge_rxeof(struct bge_softc *sc) } if (cur_rx->bge_flags & BGE_RXBDFLAG_JUMBO_RING) { - BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[rxidx], - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_mtag_jumbo, - sc->bge_cdata.bge_rx_jumbo_dmamap[rxidx]); - m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; - sc->bge_cdata.bge_rx_jumbo_chain[rxidx] = NULL; jumbocnt++; + m = sc->bge_cdata.bge_rx_jumbo_chain[rxidx]; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - ifp->if_ierrors++; - bge_newbuf_jumbo(sc, sc->bge_jumbo, m); + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); continue; } - if (bge_newbuf_jumbo(sc, sc->bge_jumbo, NULL) != 0) { - ifp->if_ierrors++; - bge_newbuf_jumbo(sc, sc->bge_jumbo, m); + if (bge_newbuf_jumbo(sc, rxidx) != 0) { + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); + ifp->if_iqdrops++; continue; } + BGE_INC(sc->bge_jumbo, BGE_JUMBO_RX_RING_CNT); } else { - BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); - bus_dmamap_sync(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[rxidx], - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->bge_cdata.bge_rx_mtag, - sc->bge_cdata.bge_rx_std_dmamap[rxidx]); - m = sc->bge_cdata.bge_rx_std_chain[rxidx]; - sc->bge_cdata.bge_rx_std_chain[rxidx] = NULL; stdcnt++; if (cur_rx->bge_flags & BGE_RXBDFLAG_ERROR) { - ifp->if_ierrors++; - bge_newbuf_std(sc, sc->bge_std, m); + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); continue; } - if (bge_newbuf_std(sc, sc->bge_std, NULL) != 0) { - ifp->if_ierrors++; - bge_newbuf_std(sc, sc->bge_std, m); + m = sc->bge_cdata.bge_rx_std_chain[rxidx]; + if (bge_newbuf_std(sc, rxidx) != 0) { + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); + ifp->if_iqdrops++; continue; } + BGE_INC(sc->bge_std, BGE_STD_RX_RING_CNT); } ifp->if_ipackets++; @@ -3265,7 +3278,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); - if (BGE_IS_JUMBO_CAPABLE(sc) && jumbocnt > 0) + if (jumbocnt > 0) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); @@ -3537,7 +3550,9 @@ bge_stats_update_regs(struct bge_softc * ifp->if_collisions += CSR_READ_4(sc, BGE_MAC_STATS + offsetof(struct bge_mac_stats_regs, etherStatsCollisions)); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_OUT_OF_BDS); ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); + ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_ERRORS); } static void @@ -3915,7 +3930,8 @@ bge_init_locked(struct bge_softc *sc) } /* Init jumbo RX ring. */ - if (ifp->if_mtu > (ETHERMTU + ETHER_HDR_LEN + ETHER_CRC_LEN)) { + if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > + (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); bge_stop(sc); Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:11:56 2010 (r201690) +++ stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:15:07 2010 (r201691) @@ -1705,11 +1705,8 @@ /* MSI mode register */ #define BGE_MSIMODE_RESET 0x00000001 #define BGE_MSIMODE_ENABLE 0x00000002 -#define BGE_MSIMODE_PCI_TGT_ABRT_ATTN 0x00000004 -#define BGE_MSIMODE_PCI_MSTR_ABRT_ATTN 0x00000008 -#define BGE_MSIMODE_PCI_PERR_ATTN 0x00000010 -#define BGE_MSIMODE_MSI_FIFOUFLOW_ATTN 0x00000020 -#define BGE_MSIMODE_MSI_FIFOOFLOW_ATTN 0x00000040 +#define BGE_MSIMODE_ONE_SHOT_DISABLE 0x00000020 +#define BGE_MSIMODE_MULTIVEC_ENABLE 0x00000080 /* MSI status register */ #define BGE_MSISTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -2484,13 +2481,6 @@ struct bge_gib { #define BGE_MSLOTS 256 #define BGE_JSLOTS 384 -#define BGE_JRAWLEN (BGE_JUMBO_FRAMELEN + ETHER_ALIGN) -#define BGE_JLEN (BGE_JRAWLEN + (sizeof(uint64_t) - \ - (BGE_JRAWLEN % sizeof(uint64_t)))) -#define BGE_JPAGESZ PAGE_SIZE -#define BGE_RESID (BGE_JPAGESZ - (BGE_JLEN * BGE_JSLOTS) % BGE_JPAGESZ) -#define BGE_JMEM ((BGE_JLEN * BGE_JSLOTS) + BGE_RESID) - #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 @@ -2547,7 +2537,9 @@ struct bge_chain_data { bus_dma_tag_t bge_tx_mtag; /* Tx mbuf mapping tag */ bus_dma_tag_t bge_mtag_jumbo; /* Jumbo mbuf mapping tag */ bus_dmamap_t bge_tx_dmamap[BGE_TX_RING_CNT]; + bus_dmamap_t bge_rx_std_sparemap; bus_dmamap_t bge_rx_std_dmamap[BGE_STD_RX_RING_CNT]; + bus_dmamap_t bge_rx_jumbo_sparemap; bus_dmamap_t bge_rx_jumbo_dmamap[BGE_JUMBO_RX_RING_CNT]; bus_dmamap_t bge_rx_std_ring_map; bus_dmamap_t bge_rx_jumbo_ring_map; From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:26:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C74C7106566B; Wed, 6 Jan 2010 23:26:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B56D48FC21; Wed, 6 Jan 2010 23:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NQ9Mr072032; Wed, 6 Jan 2010 23:26:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NQ9se072029; Wed, 6 Jan 2010 23:26:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062326.o06NQ9se072029@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201692 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:26:09 -0000 Author: yongari Date: Wed Jan 6 23:26:09 2010 New Revision: 201692 URL: http://svn.freebsd.org/changeset/base/201692 Log: MFC r199065,199115-199116,199153,199661-199662 r199065: Correct disabling checksum offloading for BCM5700 B0. r199115: Add missing bus_dmamap_sync(9) before issuing kick command. r199116: Zero out Tx/Rx descriptors before using them. Also add missing bus_dmamap_sync(9) after Tx descriptor initialization. r199153: Controller does not update Tx descriptors(send BDs) after sending frames so remove unnecessary BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9). r199661: Remove extra white space. r199662: Fix typo introduced in r199011. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:15:07 2010 (r201691) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:26:09 2010 (r201692) @@ -238,7 +238,7 @@ static const struct bge_vendor { { 0, NULL } }; - + static const struct bge_revision { uint32_t br_chipid; const char *br_name; @@ -295,7 +295,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ - { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, + { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, @@ -1046,6 +1046,7 @@ bge_init_rx_ring_std(struct bge_softc *s { int error, i; + bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; for (i = 0; i < BGE_SSLOTS; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) @@ -1089,6 +1090,7 @@ bge_init_rx_ring_jumbo(struct bge_softc struct bge_rcb *rcb; int error, i; + bzero(sc->bge_ldata.bge_rx_jumbo_ring, BGE_JUMBO_RX_RING_SZ); sc->bge_jumbo = 0; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { if ((error = bge_newbuf_jumbo(sc, i)) != 0) @@ -1161,6 +1163,10 @@ bge_init_tx_ring(struct bge_softc *sc) sc->bge_txcnt = 0; sc->bge_tx_saved_considx = 0; + bzero(sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ); + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Initialize transmit producer index for host-memory send ring. */ sc->bge_tx_prodidx = 0; bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, sc->bge_tx_prodidx); @@ -1278,11 +1284,11 @@ bge_sig_post_reset(sc, type) if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); /* START DONE */ break; case BGE_RESET_STOP: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); break; } } @@ -1674,7 +1680,7 @@ bge_blockinit(struct bge_softc *sc) RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0x00000000); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, - BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); + BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, @@ -1904,7 +1910,7 @@ bge_lookup_vendor(uint16_t vid) for (v = bge_vendors; v->v_name != NULL; v++) if (v->v_id == vid) return (v); - + panic("%s: unknown vendor %d", __func__, vid); return (NULL); } @@ -2255,7 +2261,7 @@ bge_dma_alloc(device_t dev) 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); if (error) { device_printf(sc->bge_dev, - "can't create sapre DMA map for jumbo RX\n"); + "can't create spare DMA map for jumbo RX\n"); return (ENOMEM); } for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { @@ -2743,7 +2749,7 @@ bge_attach(device_t dev) */ if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) { ifp->if_capabilities &= ~IFCAP_HWCSUM; - ifp->if_capenable &= IFCAP_HWCSUM; + ifp->if_capenable &= ~IFCAP_HWCSUM; ifp->if_hwassist = 0; } @@ -2989,7 +2995,7 @@ bge_reset(struct bge_softc *sc) } } - /* + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. */ @@ -3316,8 +3322,7 @@ bge_txeof(struct bge_softc *sc) ifp = sc->bge_ifp; bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_POSTWRITE); /* * Go through our tx ring and free mbufs for those * frames that have been sent. @@ -3625,7 +3630,7 @@ bge_cksum_pad(struct mbuf *m) last = n; } } - + /* Now zero the pad area, to avoid the bge cksum-assist bug. */ memset(mtod(last, caddr_t) + last->m_len, 0, padlen); last->m_len += padlen; @@ -3826,6 +3831,8 @@ bge_start_locked(struct ifnet *ifp) /* No packets were dequeued. */ return; + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); /* Transmit. */ bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); /* 5700 b2 errata */ @@ -3977,7 +3984,7 @@ bge_init_locked(struct bge_softc *sc) BGE_CLRBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - + bge_ifmedia_upd_locked(ifp); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -4360,7 +4367,7 @@ bge_stop(struct bge_softc *sc) bge_sig_legacy(sc, BGE_RESET_STOP); bge_sig_post_reset(sc, BGE_RESET_STOP); - /* + /* * Keep the ASF firmware running if up. */ if (sc->bge_asf_mode & ASF_STACKUP) @@ -4700,7 +4707,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Multiple Collision Frames", children, txstats.dot3StatsMultipleCollisionFrames, "MultipleCollisionFrames"); - BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", + BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", children, txstats.dot3StatsDeferredTransmissions, "DeferredTransmissions"); BGE_SYSCTL_STAT(sc, ctx, "Excessive Collisions", @@ -4709,7 +4716,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Late Collisions", children, txstats.dot3StatsLateCollisions, "LateCollisions"); - BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", + BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", children, txstats.ifHCOutUcastPkts, "UcastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Multicast Packets", children, txstats.ifHCOutMulticastPkts, "MulticastPkts"); Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:15:07 2010 (r201691) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:26:09 2010 (r201692) @@ -1907,7 +1907,7 @@ /* * This magic number is written to the firmware mailbox at 0xb50 * before a software reset is issued. After the internal firmware - * has completed its initialization it will write the opposite of + * has completed its initialization it will write the opposite of * this value, ~BGE_MAGIC_NUMBER, to the same location, allowing the * driver to synchronize with the firmware. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:28:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAC99106568B; Wed, 6 Jan 2010 23:28:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A906E8FC1D; Wed, 6 Jan 2010 23:28:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NSde1072698; Wed, 6 Jan 2010 23:28:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NSdrl072695; Wed, 6 Jan 2010 23:28:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062328.o06NSdrl072695@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201693 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:28:39 -0000 Author: yongari Date: Wed Jan 6 23:28:39 2010 New Revision: 201693 URL: http://svn.freebsd.org/changeset/base/201693 Log: MFC r199065,199115-199116,199153,199661-199662 r199065: Correct disabling checksum offloading for BCM5700 B0. r199115: Add missing bus_dmamap_sync(9) before issuing kick command. r199116: Zero out Tx/Rx descriptors before using them. Also add missing bus_dmamap_sync(9) after Tx descriptor initialization. r199153: Controller does not update Tx descriptors(send BDs) after sending frames so remove unnecessary BUS_DMASYNC_PREREAD and BUS_DMASYNC_POSTREAD of bus_dmamap_sync(9). r199661: Remove extra white space. r199662: Fix typo introduced in r199011. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:26:09 2010 (r201692) +++ stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:28:39 2010 (r201693) @@ -238,7 +238,7 @@ static const struct bge_vendor { { 0, NULL } }; - + static const struct bge_revision { uint32_t br_chipid; const char *br_name; @@ -295,7 +295,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5784_A0, "BCM5784 A0" }, { BGE_CHIPID_BCM5784_A1, "BCM5784 A1" }, /* 5754 and 5787 share the same ASIC ID */ - { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, + { BGE_CHIPID_BCM5787_A0, "BCM5754/5787 A0" }, { BGE_CHIPID_BCM5787_A1, "BCM5754/5787 A1" }, { BGE_CHIPID_BCM5787_A2, "BCM5754/5787 A2" }, { BGE_CHIPID_BCM5906_A1, "BCM5906 A1" }, @@ -1046,6 +1046,7 @@ bge_init_rx_ring_std(struct bge_softc *s { int error, i; + bzero(sc->bge_ldata.bge_rx_std_ring, BGE_STD_RX_RING_SZ); sc->bge_std = 0; for (i = 0; i < BGE_SSLOTS; i++) { if ((error = bge_newbuf_std(sc, i)) != 0) @@ -1089,6 +1090,7 @@ bge_init_rx_ring_jumbo(struct bge_softc struct bge_rcb *rcb; int error, i; + bzero(sc->bge_ldata.bge_rx_jumbo_ring, BGE_JUMBO_RX_RING_SZ); sc->bge_jumbo = 0; for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { if ((error = bge_newbuf_jumbo(sc, i)) != 0) @@ -1161,6 +1163,10 @@ bge_init_tx_ring(struct bge_softc *sc) sc->bge_txcnt = 0; sc->bge_tx_saved_considx = 0; + bzero(sc->bge_ldata.bge_tx_ring, BGE_TX_RING_SZ); + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Initialize transmit producer index for host-memory send ring. */ sc->bge_tx_prodidx = 0; bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, sc->bge_tx_prodidx); @@ -1278,11 +1284,11 @@ bge_sig_post_reset(sc, type) if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000001); /* START DONE */ break; case BGE_RESET_STOP: - bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); + bge_writemem_ind(sc, BGE_SDI_STATUS, 0x80000002); break; } } @@ -1674,7 +1680,7 @@ bge_blockinit(struct bge_softc *sc) RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); RCB_WRITE_4(sc, vrcb, bge_nicaddr, 0x00000000); RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, - BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); + BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, @@ -1904,7 +1910,7 @@ bge_lookup_vendor(uint16_t vid) for (v = bge_vendors; v->v_name != NULL; v++) if (v->v_id == vid) return (v); - + panic("%s: unknown vendor %d", __func__, vid); return (NULL); } @@ -2255,7 +2261,7 @@ bge_dma_alloc(device_t dev) 0, &sc->bge_cdata.bge_rx_jumbo_sparemap); if (error) { device_printf(sc->bge_dev, - "can't create sapre DMA map for jumbo RX\n"); + "can't create spare DMA map for jumbo RX\n"); return (ENOMEM); } for (i = 0; i < BGE_JUMBO_RX_RING_CNT; i++) { @@ -2743,7 +2749,7 @@ bge_attach(device_t dev) */ if (sc->bge_chipid == BGE_CHIPID_BCM5700_B0) { ifp->if_capabilities &= ~IFCAP_HWCSUM; - ifp->if_capenable &= IFCAP_HWCSUM; + ifp->if_capenable &= ~IFCAP_HWCSUM; ifp->if_hwassist = 0; } @@ -2989,7 +2995,7 @@ bge_reset(struct bge_softc *sc) } } - /* + /* * Set GPHY Power Down Override to leave GPHY * powered up in D0 uninitialized. */ @@ -3313,8 +3319,7 @@ bge_txeof(struct bge_softc *sc) ifp = sc->bge_ifp; bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_POSTWRITE); /* * Go through our tx ring and free mbufs for those * frames that have been sent. @@ -3620,7 +3625,7 @@ bge_cksum_pad(struct mbuf *m) last = n; } } - + /* Now zero the pad area, to avoid the bge cksum-assist bug. */ memset(mtod(last, caddr_t) + last->m_len, 0, padlen); last->m_len += padlen; @@ -3821,6 +3826,8 @@ bge_start_locked(struct ifnet *ifp) /* No packets were dequeued. */ return; + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); /* Transmit. */ bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); /* 5700 b2 errata */ @@ -3972,7 +3979,7 @@ bge_init_locked(struct bge_softc *sc) BGE_CLRBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); } - + bge_ifmedia_upd_locked(ifp); ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -4355,7 +4362,7 @@ bge_stop(struct bge_softc *sc) bge_sig_legacy(sc, BGE_RESET_STOP); bge_sig_post_reset(sc, BGE_RESET_STOP); - /* + /* * Keep the ASF firmware running if up. */ if (sc->bge_asf_mode & ASF_STACKUP) @@ -4695,7 +4702,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Multiple Collision Frames", children, txstats.dot3StatsMultipleCollisionFrames, "MultipleCollisionFrames"); - BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", + BGE_SYSCTL_STAT(sc, ctx, "Deferred Transmissions", children, txstats.dot3StatsDeferredTransmissions, "DeferredTransmissions"); BGE_SYSCTL_STAT(sc, ctx, "Excessive Collisions", @@ -4704,7 +4711,7 @@ bge_add_sysctls(struct bge_softc *sc) BGE_SYSCTL_STAT(sc, ctx, "Late Collisions", children, txstats.dot3StatsLateCollisions, "LateCollisions"); - BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", + BGE_SYSCTL_STAT(sc, ctx, "Outbound Unicast Packets", children, txstats.ifHCOutUcastPkts, "UcastPkts"); BGE_SYSCTL_STAT(sc, ctx, "Outbound Multicast Packets", children, txstats.ifHCOutMulticastPkts, "MulticastPkts"); Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:26:09 2010 (r201692) +++ stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:28:39 2010 (r201693) @@ -1907,7 +1907,7 @@ /* * This magic number is written to the firmware mailbox at 0xb50 * before a software reset is issued. After the internal firmware - * has completed its initialization it will write the opposite of + * has completed its initialization it will write the opposite of * this value, ~BGE_MAGIC_NUMBER, to the same location, allowing the * driver to synchronize with the firmware. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:34:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B95410656B0; Wed, 6 Jan 2010 23:34:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1952F8FC1C; Wed, 6 Jan 2010 23:34:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NYrSQ074172; Wed, 6 Jan 2010 23:34:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NYr8j074168; Wed, 6 Jan 2010 23:34:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062334.o06NYr8j074168@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201694 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:34:54 -0000 Author: yongari Date: Wed Jan 6 23:34:53 2010 New Revision: 201694 URL: http://svn.freebsd.org/changeset/base/201694 Log: MFC 199663-199666 r199663: Due to newly added PCIe capabilities fallback code for finding the PCIe capability did not work right on recent controllers. Remove FreeBSD 6.x support code. r199664: Use capability pointer to access PCIe registers rather than directly access them at fixed address. While I'm here don't touch other bits of PCIe device control register except max payload size. r199665: Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD. r199666: Rearrange bge_start_locked to see we can send more frames by checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we have less than 16 free send BDs set IFF_DRV_OACTIVE and try it later. Previously bge(4) used to reserve 16 free send BDs after loading dma maps but hardware just need one reserved send BD. If prouder index has the same value of consumer index it means the Tx queue is empty. While I'm here check IFQ_DRV_IS_EMPTY first to save one lock operation. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:28:39 2010 (r201693) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:34:53 2010 (r201694) @@ -414,7 +414,7 @@ static uint32_t bge_readreg_ind(struct b #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *, int); +static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -558,25 +558,23 @@ bge_writemem_ind(struct bge_softc *sc, i * PCI Express only */ static void -bge_set_max_readrq(struct bge_softc *sc, int expr_ptr) +bge_set_max_readrq(struct bge_softc *sc) { device_t dev; uint16_t val; - KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0, - ("%s: not applicable", __func__)); - dev = sc->bge_dev; - val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2); - if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) != + val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != BGE_PCIE_DEVCTL_MAX_READRQ_4096) { if (bootverbose) device_printf(dev, "adjust device control 0x%04x ", val); - val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK; + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2); + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + val, 2); if (bootverbose) printf("-> 0x%04x\n", val); } @@ -1055,8 +1053,7 @@ bge_init_rx_ring_std(struct bge_softc *s }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_std = i - 1; bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); @@ -1099,8 +1096,7 @@ bge_init_rx_ring_jumbo(struct bge_softc }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_jumbo = i - 1; @@ -2413,7 +2409,6 @@ bge_dma_alloc(device_t dev) return (0); } -#if __FreeBSD_version > 602105 /* * Return true if this device has more than one port. */ @@ -2462,7 +2457,6 @@ bge_can_use_msi(struct bge_softc *sc) } return (can_use_msi); } -#endif static int bge_attach(device_t dev) @@ -2471,7 +2465,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, reg, rid, trys; + int error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2580,42 +2574,34 @@ bge_attach(device_t dev) /* * Check if this is a PCI-X or PCI Express device. */ -#if __FreeBSD_version > 602101 if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { /* * Found a PCI Express capabilities register, this * must be a PCI Express device. */ - if (reg != 0) { - sc->bge_flags |= BGE_FLAG_PCIE; -#else - if (BGE_IS_5705_PLUS(sc)) { - reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); - if ((reg & 0xFF) == BGE_PCIE_CAPID) { - sc->bge_flags |= BGE_FLAG_PCIE; - reg = BGE_PCIE_CAPID; -#endif - bge_set_max_readrq(sc, reg); - } + sc->bge_flags |= BGE_FLAG_PCIE; + sc->bge_expcap = reg; + bge_set_max_readrq(sc); } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ + if (pci_find_extcap(dev, PCIY_PCIX, ®) == 0) + sc->bge_pcixcap = reg; if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) & BGE_PCISTATE_PCI_BUSMODE) == 0) sc->bge_flags |= BGE_FLAG_PCIX; } -#if __FreeBSD_version > 602105 - { - int msicount; - - /* - * Allocate the interrupt, using MSI if possible. These devices - * support 8 MSI messages, but only the first one is used in - * normal operation. - */ + /* + * Allocate the interrupt, using MSI if possible. These devices + * support 8 MSI messages, but only the first one is used in + * normal operation. + */ + rid = 0; + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + sc->bge_msicap = reg; if (bge_can_use_msi(sc)) { msicount = pci_msi_count(dev); if (msicount > 1) @@ -2625,12 +2611,8 @@ bge_attach(device_t dev) if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { rid = 1; sc->bge_flags |= BGE_FLAG_MSI; - } else - rid = 0; + } } -#else - rid = 0; -#endif sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2921,10 +2903,8 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_IRQ, sc->bge_flags & BGE_FLAG_MSI ? 1 : 0, sc->bge_irq); -#if __FreeBSD_version > 602105 if (sc->bge_flags & BGE_FLAG_MSI) pci_release_msi(dev); -#endif if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, @@ -2945,6 +2925,7 @@ bge_reset(struct bge_softc *sc) device_t dev; uint32_t cachesize, command, pcistate, reset, val; void (*write_op)(struct bge_softc *, int, int); + uint16_t devctl; int i; dev = sc->bge_dev; @@ -3023,11 +3004,17 @@ bge_reset(struct bge_softc *sc) val = pci_read_config(dev, 0xC4, 4); pci_write_config(dev, 0xC4, val | (1 << 15), 4); } - /* - * Set PCIE max payload size to 128 bytes and clear error - * status. - */ - pci_write_config(dev, 0xD8, 0xF5000, 4); + devctl = pci_read_config(dev, + sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + /* Clear enable no snoop and disable relaxed ordering. */ + devctl &= ~(0x0010 | 0x0800); + /* Set PCIE max payload size to 128. */ + devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl, 2); + /* Clear error status. */ + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, + 0, 2); } /* Reset some of the PCI state that got zapped by reset. */ @@ -3042,8 +3029,10 @@ bge_reset(struct bge_softc *sc) if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { - val = pci_read_config(dev, BGE_PCI_MSI_CTL, 2); - pci_write_config(dev, BGE_PCI_MSI_CTL, + val = pci_read_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, 2); + pci_write_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, val | PCIM_MSICTRL_MSI_ENABLE, 2); val = CSR_READ_4(sc, BGE_MSI_MODE); CSR_WRITE_4(sc, BGE_MSI_MODE, @@ -3694,11 +3683,8 @@ bge_encap(struct bge_softc *sc, struct m } else if (error != 0) return (error); - /* - * Sanity check: avoid coming within 16 descriptors - * of the end of the ring. - */ - if (nsegs > (BGE_TX_RING_CNT - sc->bge_txcnt - 16)) { + /* Check if we have enough free send BDs. */ + if (sc->bge_txcnt + nsegs >= BGE_TX_RING_CNT) { bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); return (ENOBUFS); } @@ -3763,18 +3749,25 @@ static void bge_start_locked(struct ifnet *ifp) { struct bge_softc *sc; - struct mbuf *m_head = NULL; + struct mbuf *m_head; uint32_t prodidx; - int count = 0; + int count; sc = ifp->if_softc; + BGE_LOCK_ASSERT(sc); - if (!sc->bge_link || IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!sc->bge_link || + (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; prodidx = sc->bge_tx_prodidx; - while(sc->bge_cdata.bge_tx_chain[prodidx] == NULL) { + for (count = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->bge_txcnt > BGE_TX_RING_CNT - 16) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -3827,24 +3820,22 @@ bge_start_locked(struct ifnet *ifp) #endif } - if (count == 0) - /* No packets were dequeued. */ - return; - - bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); - /* Transmit. */ - bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - /* 5700 b2 errata */ - if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + if (count > 0) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Transmit. */ bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); + /* 5700 b2 errata */ + if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - sc->bge_tx_prodidx = prodidx; + sc->bge_tx_prodidx = prodidx; - /* - * Set a timeout in case the chip goes out to lunch. - */ - sc->bge_timer = 5; + /* + * Set a timeout in case the chip goes out to lunch. + */ + sc->bge_timer = 5; + } } /* Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:28:39 2010 (r201693) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:34:53 2010 (r201694) @@ -2584,6 +2584,9 @@ struct bge_softc { struct resource *bge_irq; struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ + int bge_expcap; + int bge_msicap; + int bge_pcixcap; uint32_t bge_flags; #define BGE_FLAG_TBI 0x00000001 #define BGE_FLAG_JUMBO 0x00000002 From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:37:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 241E010656B1; Wed, 6 Jan 2010 23:37:14 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 121AF8FC22; Wed, 6 Jan 2010 23:37:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NbDGD074854; Wed, 6 Jan 2010 23:37:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NbDVF074851; Wed, 6 Jan 2010 23:37:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062337.o06NbDVF074851@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201696 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:37:14 -0000 Author: yongari Date: Wed Jan 6 23:37:13 2010 New Revision: 201696 URL: http://svn.freebsd.org/changeset/base/201696 Log: MFC 199663-199666 r199663: Due to newly added PCIe capabilities fallback code for finding the PCIe capability did not work right on recent controllers. Remove FreeBSD 6.x support code. r199664: Use capability pointer to access PCIe registers rather than directly access them at fixed address. While I'm here don't touch other bits of PCIe device control register except max payload size. r199665: Controller does not write Rx descriptors, remove BUS_DMASYNC_PREREAD. r199666: Rearrange bge_start_locked to see we can send more frames by checking IFF_DRV_RUNNING and IFF_DRV_OACTIVE flags. Also if we have less than 16 free send BDs set IFF_DRV_OACTIVE and try it later. Previously bge(4) used to reserve 16 free send BDs after loading dma maps but hardware just need one reserved send BD. If prouder index has the same value of consumer index it means the Tx queue is empty. While I'm here check IFQ_DRV_IS_EMPTY first to save one lock operation. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:36:14 2010 (r201695) +++ stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:37:13 2010 (r201696) @@ -414,7 +414,7 @@ static uint32_t bge_readreg_ind(struct b #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *, int); +static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -558,25 +558,23 @@ bge_writemem_ind(struct bge_softc *sc, i * PCI Express only */ static void -bge_set_max_readrq(struct bge_softc *sc, int expr_ptr) +bge_set_max_readrq(struct bge_softc *sc) { device_t dev; uint16_t val; - KASSERT((sc->bge_flags & BGE_FLAG_PCIE) && expr_ptr != 0, - ("%s: not applicable", __func__)); - dev = sc->bge_dev; - val = pci_read_config(dev, expr_ptr + BGE_PCIE_DEVCTL, 2); - if ((val & BGE_PCIE_DEVCTL_MAX_READRQ_MASK) != + val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != BGE_PCIE_DEVCTL_MAX_READRQ_4096) { if (bootverbose) device_printf(dev, "adjust device control 0x%04x ", val); - val &= ~BGE_PCIE_DEVCTL_MAX_READRQ_MASK; + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, expr_ptr + BGE_PCIE_DEVCTL, val, 2); + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + val, 2); if (bootverbose) printf("-> 0x%04x\n", val); } @@ -1055,8 +1053,7 @@ bge_init_rx_ring_std(struct bge_softc *s }; bus_dmamap_sync(sc->bge_cdata.bge_rx_std_ring_tag, - sc->bge_cdata.bge_rx_std_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_std_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_std = i - 1; bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); @@ -1099,8 +1096,7 @@ bge_init_rx_ring_jumbo(struct bge_softc }; bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, - sc->bge_cdata.bge_rx_jumbo_ring_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); sc->bge_jumbo = i - 1; @@ -2413,7 +2409,6 @@ bge_dma_alloc(device_t dev) return (0); } -#if __FreeBSD_version > 602105 /* * Return true if this device has more than one port. */ @@ -2462,7 +2457,6 @@ bge_can_use_msi(struct bge_softc *sc) } return (can_use_msi); } -#endif static int bge_attach(device_t dev) @@ -2471,7 +2465,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, reg, rid, trys; + int error, msicount, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2580,42 +2574,34 @@ bge_attach(device_t dev) /* * Check if this is a PCI-X or PCI Express device. */ -#if __FreeBSD_version > 602101 if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { /* * Found a PCI Express capabilities register, this * must be a PCI Express device. */ - if (reg != 0) { - sc->bge_flags |= BGE_FLAG_PCIE; -#else - if (BGE_IS_5705_PLUS(sc)) { - reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); - if ((reg & 0xFF) == BGE_PCIE_CAPID) { - sc->bge_flags |= BGE_FLAG_PCIE; - reg = BGE_PCIE_CAPID; -#endif - bge_set_max_readrq(sc, reg); - } + sc->bge_flags |= BGE_FLAG_PCIE; + sc->bge_expcap = reg; + bge_set_max_readrq(sc); } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ + if (pci_find_extcap(dev, PCIY_PCIX, ®) == 0) + sc->bge_pcixcap = reg; if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) & BGE_PCISTATE_PCI_BUSMODE) == 0) sc->bge_flags |= BGE_FLAG_PCIX; } -#if __FreeBSD_version > 602105 - { - int msicount; - - /* - * Allocate the interrupt, using MSI if possible. These devices - * support 8 MSI messages, but only the first one is used in - * normal operation. - */ + /* + * Allocate the interrupt, using MSI if possible. These devices + * support 8 MSI messages, but only the first one is used in + * normal operation. + */ + rid = 0; + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + sc->bge_msicap = reg; if (bge_can_use_msi(sc)) { msicount = pci_msi_count(dev); if (msicount > 1) @@ -2625,12 +2611,8 @@ bge_attach(device_t dev) if (msicount == 1 && pci_alloc_msi(dev, &msicount) == 0) { rid = 1; sc->bge_flags |= BGE_FLAG_MSI; - } else - rid = 0; + } } -#else - rid = 0; -#endif sc->bge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -2921,10 +2903,8 @@ bge_release_resources(struct bge_softc * bus_release_resource(dev, SYS_RES_IRQ, sc->bge_flags & BGE_FLAG_MSI ? 1 : 0, sc->bge_irq); -#if __FreeBSD_version > 602105 if (sc->bge_flags & BGE_FLAG_MSI) pci_release_msi(dev); -#endif if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, @@ -2945,6 +2925,7 @@ bge_reset(struct bge_softc *sc) device_t dev; uint32_t cachesize, command, pcistate, reset, val; void (*write_op)(struct bge_softc *, int, int); + uint16_t devctl; int i; dev = sc->bge_dev; @@ -3023,11 +3004,17 @@ bge_reset(struct bge_softc *sc) val = pci_read_config(dev, 0xC4, 4); pci_write_config(dev, 0xC4, val | (1 << 15), 4); } - /* - * Set PCIE max payload size to 128 bytes and clear error - * status. - */ - pci_write_config(dev, 0xD8, 0xF5000, 4); + devctl = pci_read_config(dev, + sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + /* Clear enable no snoop and disable relaxed ordering. */ + devctl &= ~(0x0010 | 0x0800); + /* Set PCIE max payload size to 128. */ + devctl &= ~PCIM_EXP_CTL_MAX_PAYLOAD; + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, + devctl, 2); + /* Clear error status. */ + pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_STA, + 0, 2); } /* Reset some of the PCI state that got zapped by reset. */ @@ -3042,8 +3029,10 @@ bge_reset(struct bge_softc *sc) if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { - val = pci_read_config(dev, BGE_PCI_MSI_CTL, 2); - pci_write_config(dev, BGE_PCI_MSI_CTL, + val = pci_read_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, 2); + pci_write_config(dev, + sc->bge_msicap + PCIR_MSI_CTRL, val | PCIM_MSICTRL_MSI_ENABLE, 2); val = CSR_READ_4(sc, BGE_MSI_MODE); CSR_WRITE_4(sc, BGE_MSI_MODE, @@ -3689,11 +3678,8 @@ bge_encap(struct bge_softc *sc, struct m } else if (error != 0) return (error); - /* - * Sanity check: avoid coming within 16 descriptors - * of the end of the ring. - */ - if (nsegs > (BGE_TX_RING_CNT - sc->bge_txcnt - 16)) { + /* Check if we have enough free send BDs. */ + if (sc->bge_txcnt + nsegs >= BGE_TX_RING_CNT) { bus_dmamap_unload(sc->bge_cdata.bge_tx_mtag, map); return (ENOBUFS); } @@ -3758,18 +3744,25 @@ static void bge_start_locked(struct ifnet *ifp) { struct bge_softc *sc; - struct mbuf *m_head = NULL; + struct mbuf *m_head; uint32_t prodidx; - int count = 0; + int count; sc = ifp->if_softc; + BGE_LOCK_ASSERT(sc); - if (!sc->bge_link || IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + if (!sc->bge_link || + (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != + IFF_DRV_RUNNING) return; prodidx = sc->bge_tx_prodidx; - while(sc->bge_cdata.bge_tx_chain[prodidx] == NULL) { + for (count = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd);) { + if (sc->bge_txcnt > BGE_TX_RING_CNT - 16) { + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + break; + } IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); if (m_head == NULL) break; @@ -3822,24 +3815,22 @@ bge_start_locked(struct ifnet *ifp) #endif } - if (count == 0) - /* No packets were dequeued. */ - return; - - bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, - sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); - /* Transmit. */ - bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - /* 5700 b2 errata */ - if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + if (count > 0) { + bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, + sc->bge_cdata.bge_tx_ring_map, BUS_DMASYNC_PREWRITE); + /* Transmit. */ bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); + /* 5700 b2 errata */ + if (sc->bge_chiprev == BGE_CHIPREV_5700_BX) + bge_writembx(sc, BGE_MBX_TX_HOST_PROD0_LO, prodidx); - sc->bge_tx_prodidx = prodidx; + sc->bge_tx_prodidx = prodidx; - /* - * Set a timeout in case the chip goes out to lunch. - */ - sc->bge_timer = 5; + /* + * Set a timeout in case the chip goes out to lunch. + */ + sc->bge_timer = 5; + } } /* Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:36:14 2010 (r201695) +++ stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:37:13 2010 (r201696) @@ -2584,6 +2584,9 @@ struct bge_softc { struct resource *bge_irq; struct resource *bge_res; struct ifmedia bge_ifmedia; /* TBI media info */ + int bge_expcap; + int bge_msicap; + int bge_pcixcap; uint32_t bge_flags; #define BGE_FLAG_TBI 0x00000001 #define BGE_FLAG_JUMBO 0x00000002 From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:42:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 002FF106566B; Wed, 6 Jan 2010 23:42:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E23B48FC14; Wed, 6 Jan 2010 23:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NgF5R076015; Wed, 6 Jan 2010 23:42:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NgF7D076012; Wed, 6 Jan 2010 23:42:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062342.o06NgF7D076012@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201697 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:42:16 -0000 Author: yongari Date: Wed Jan 6 23:42:15 2010 New Revision: 201697 URL: http://svn.freebsd.org/changeset/base/201697 Log: MFC r199667-199668 r199667: Cache Rx producer/Tx consumer index as soon as we know status block update and then clear status block. Previously it used to access these index without synchronization which may cause problems when bounce buffers are used. Also add missing bus_dmamap_sync(9) in polling handler. Since we now update status block in driver, adjust bus_dmamap_sync(9) for status block. r199668: For MSI case, interrupt is not shared and we don't need to force PCI flush to get correct status block update. Add an optimized interrupt handler that is activated for MSI case. Actual interrupt handling is done by taskqueue such that the handler does not require driver lock for Rx path. The MSI capable bge(4) controllers automatically disables further interrupt once it enters interrupt state so we don't need PIO access to disable interrupt in interrupt handler. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:37:13 2010 (r201696) +++ stable/8/sys/dev/bge/if_bge.c Wed Jan 6 23:42:15 2010 (r201697) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -361,8 +362,8 @@ static int bge_get_eaddr_nvram(struct bg static int bge_get_eaddr_eeprom(struct bge_softc *, uint8_t[]); static int bge_get_eaddr(struct bge_softc *, uint8_t[]); -static void bge_txeof(struct bge_softc *); -static int bge_rxeof(struct bge_softc *); +static void bge_txeof(struct bge_softc *, uint16_t); +static int bge_rxeof(struct bge_softc *, uint16_t, int); static void bge_asf_driver_up (struct bge_softc *); static void bge_tick(void *); @@ -371,6 +372,8 @@ static void bge_stats_update_regs(struct static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); +static int bge_msi_intr(void *); +static void bge_intr_task(void *, int); static void bge_start_locked(struct ifnet *); static void bge_start(struct ifnet *); static int bge_ioctl(struct ifnet *, u_long, caddr_t); @@ -2470,6 +2473,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + /* * Map control/status registers. */ @@ -2832,8 +2837,27 @@ again: * Hookup IRQ last. */ #if __FreeBSD_version > 700030 - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, bge_intr, sc, &sc->bge_intrhand); + if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { + /* Take advantage of single-shot MSI. */ + sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->bge_tq); + if (sc->bge_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->bge_dev)); + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, + &sc->bge_intrhand); + if (error) + ether_ifdetach(ifp); + } else + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, + &sc->bge_intrhand); #else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_intr, sc, &sc->bge_intrhand); @@ -2875,6 +2899,8 @@ bge_detach(device_t dev) callout_drain(&sc->bge_stat_ch); + if (sc->bge_tq) + taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { @@ -2896,6 +2922,9 @@ bge_release_resources(struct bge_softc * dev = sc->bge_dev; + if (sc->bge_tq != NULL) + taskqueue_free(sc->bge_tq); + if (sc->bge_intrhand != NULL) bus_teardown_intr(dev, sc->bge_irq, sc->bge_intrhand); @@ -3135,15 +3164,13 @@ bge_reset(struct bge_softc *sc) */ static int -bge_rxeof(struct bge_softc *sc) +bge_rxeof(struct bge_softc *sc, uint16_t rx_prod, int holdlck) { struct ifnet *ifp; int rx_npkts = 0, stdcnt = 0, jumbocnt = 0; - uint16_t rx_prod, rx_cons; + uint16_t rx_cons; - BGE_LOCK_ASSERT(sc); rx_cons = sc->bge_rx_saved_considx; - rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; /* Nothing to do. */ if (rx_cons == rx_prod) @@ -3259,9 +3286,12 @@ bge_rxeof(struct bge_softc *sc) #endif } - BGE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - BGE_LOCK(sc); + if (holdlck != 0) { + BGE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + BGE_LOCK(sc); + } else + (*ifp->if_input)(ifp, m); rx_npkts++; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) @@ -3296,7 +3326,7 @@ bge_rxeof(struct bge_softc *sc) } static void -bge_txeof(struct bge_softc *sc) +bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { struct bge_tx_bd *cur_tx = NULL; struct ifnet *ifp; @@ -3304,8 +3334,7 @@ bge_txeof(struct bge_softc *sc) BGE_LOCK_ASSERT(sc); /* Nothing to do. */ - if (sc->bge_tx_saved_considx == - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) + if (sc->bge_tx_saved_considx == tx_cons) return; ifp = sc->bge_ifp; @@ -3316,8 +3345,7 @@ bge_txeof(struct bge_softc *sc) * Go through our tx ring and free mbufs for those * frames that have been sent. */ - while (sc->bge_tx_saved_considx != - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) { + while (sc->bge_tx_saved_considx != tx_cons) { uint32_t idx = 0; idx = sc->bge_tx_saved_considx; @@ -3348,6 +3376,7 @@ static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct bge_softc *sc = ifp->if_softc; + uint16_t rx_prod, tx_cons; uint32_t statusword; int rx_npkts = 0; @@ -3358,13 +3387,17 @@ bge_poll(struct ifnet *ifp, enum poll_cm } bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = atomic_readandclear_32( &sc->bge_ldata.bge_status_block->bge_status); bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Note link event. It will be processed by POLL_AND_CHECK_STATUS. */ if (statusword & BGE_STATFLAG_LINKSTATE_CHANGED) @@ -3377,12 +3410,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bge_link_upd(sc); sc->rxcycles = count; - rx_npkts = bge_rxeof(sc); + rx_npkts = bge_rxeof(sc, rx_prod, 1); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); return (rx_npkts); } - bge_txeof(sc); + bge_txeof(sc, tx_cons); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); @@ -3391,12 +3424,76 @@ bge_poll(struct ifnet *ifp, enum poll_cm } #endif /* DEVICE_POLLING */ +static int +bge_msi_intr(void *arg) +{ + struct bge_softc *sc; + + sc = (struct bge_softc *)arg; + /* + * This interrupt is not shared and controller already + * disabled further interrupt. + */ + taskqueue_enqueue(sc->bge_tq, &sc->bge_intr_task); + return (FILTER_HANDLED); +} + +static void +bge_intr_task(void *arg, int pending) +{ + struct bge_softc *sc; + struct ifnet *ifp; + uint32_t status; + uint16_t rx_prod, tx_cons; + + sc = (struct bge_softc *)arg; + ifp = sc->bge_ifp; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + /* Get updated status block. */ + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + /* Save producer/consumer indexess. */ + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + status = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* Let controller work. */ + bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); + + if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) { + BGE_LOCK(sc); + bge_link_upd(sc); + BGE_UNLOCK(sc); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* Check RX return ring producer/consumer. */ + bge_rxeof(sc, rx_prod, 0); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + BGE_LOCK(sc); + /* Check TX ring producer/consumer. */ + bge_txeof(sc, tx_cons); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + bge_start_locked(ifp); + BGE_UNLOCK(sc); + } +} + static void bge_intr(void *xsc) { struct bge_softc *sc; struct ifnet *ifp; uint32_t statusword; + uint16_t rx_prod, tx_cons; sc = xsc; @@ -3440,7 +3537,14 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3449,21 +3553,18 @@ bge_intr(void *xsc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer. */ - bge_rxeof(sc); + bge_rxeof(sc, rx_prod, 1); } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check TX ring producer/consumer. */ - bge_txeof(sc); + bge_txeof(sc, tx_cons); } if (ifp->if_drv_flags & IFF_DRV_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); - BGE_UNLOCK(sc); } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:37:13 2010 (r201696) +++ stable/8/sys/dev/bge/if_bgereg.h Wed Jan 6 23:42:15 2010 (r201697) @@ -2641,6 +2641,8 @@ struct bge_softc { #ifdef DEVICE_POLLING int rxcycles; #endif /* DEVICE_POLLING */ + struct task bge_intr_task; + struct taskqueue *bge_tq; }; #define BGE_LOCK_INIT(_sc, _name) \ From owner-svn-src-all@FreeBSD.ORG Wed Jan 6 23:57:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 413FB1065695; Wed, 6 Jan 2010 23:57:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16CAC8FC29; Wed, 6 Jan 2010 23:57:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o06NvHsw079413; Wed, 6 Jan 2010 23:57:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o06NvHwc079411; Wed, 6 Jan 2010 23:57:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001062357.o06NvHwc079411@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 6 Jan 2010 23:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201698 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 23:57:18 -0000 Author: yongari Date: Wed Jan 6 23:57:17 2010 New Revision: 201698 URL: http://svn.freebsd.org/changeset/base/201698 Log: MFC r196370: - Do not try to reevaluate current RX production index on each loop iteration as it can be updated by the card while we process the RX ring forcing us to process RX descriptors for which DMA synchronisation operation has not been performed. This fixes the bug when bge(4) drops packets under high load. Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:42:15 2010 (r201697) +++ stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:57:17 2010 (r201698) @@ -3139,12 +3139,14 @@ bge_rxeof(struct bge_softc *sc) { struct ifnet *ifp; int stdcnt = 0, jumbocnt = 0; + uint16_t rx_prod, rx_cons; BGE_LOCK_ASSERT(sc); + rx_cons = sc->bge_rx_saved_considx; + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; /* Nothing to do. */ - if (sc->bge_rx_saved_considx == - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) + if (rx_cons == rx_prod) return; ifp = sc->bge_ifp; @@ -3158,8 +3160,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_POSTWRITE); - while(sc->bge_rx_saved_considx != - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) { + while (rx_cons != rx_prod) { struct bge_rx_bd *cur_rx; uint32_t rxidx; struct mbuf *m = NULL; @@ -3174,11 +3175,10 @@ bge_rxeof(struct bge_softc *sc) } #endif - cur_rx = - &sc->bge_ldata.bge_rx_return_ring[sc->bge_rx_saved_considx]; + cur_rx = &sc->bge_ldata.bge_rx_return_ring[rx_cons]; rxidx = cur_rx->bge_idx; - BGE_INC(sc->bge_rx_saved_considx, sc->bge_return_ring_cnt); + BGE_INC(rx_cons, sc->bge_return_ring_cnt); if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING && cur_rx->bge_flags & BGE_RXBDFLAG_VLAN_TAG) { @@ -3277,6 +3277,7 @@ bge_rxeof(struct bge_softc *sc) bus_dmamap_sync(sc->bge_cdata.bge_rx_jumbo_ring_tag, sc->bge_cdata.bge_rx_jumbo_ring_map, BUS_DMASYNC_PREWRITE); + sc->bge_rx_saved_considx = rx_cons; bge_writembx(sc, BGE_MBX_RX_CONS0_LO, sc->bge_rx_saved_considx); if (stdcnt) bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, sc->bge_std); From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:04:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B02AD106566B; Thu, 7 Jan 2010 00:04:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E0A68FC15; Thu, 7 Jan 2010 00:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0704TiX081081; Thu, 7 Jan 2010 00:04:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0704TdQ081078; Thu, 7 Jan 2010 00:04:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001070004.o0704TdQ081078@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jan 2010 00:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201699 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:04:29 -0000 Author: yongari Date: Thu Jan 7 00:04:29 2010 New Revision: 201699 URL: http://svn.freebsd.org/changeset/base/201699 Log: MFC r199667-199668 r199667: Cache Rx producer/Tx consumer index as soon as we know status block update and then clear status block. Previously it used to access these index without synchronization which may cause problems when bounce buffers are used. Also add missing bus_dmamap_sync(9) in polling handler. Since we now update status block in driver, adjust bus_dmamap_sync(9) for status block. r199668: For MSI case, interrupt is not shared and we don't need to force PCI flush to get correct status block update. Add an optimized interrupt handler that is activated for MSI case. Actual interrupt handling is done by taskqueue such that the handler does not require driver lock for Rx path. The MSI capable bge(4) controllers automatically disables further interrupt once it enters interrupt state so we don't need PIO access to disable interrupt in interrupt handler. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Wed Jan 6 23:57:17 2010 (r201698) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 7 00:04:29 2010 (r201699) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -361,8 +362,8 @@ static int bge_get_eaddr_nvram(struct bg static int bge_get_eaddr_eeprom(struct bge_softc *, uint8_t[]); static int bge_get_eaddr(struct bge_softc *, uint8_t[]); -static void bge_txeof(struct bge_softc *); -static void bge_rxeof(struct bge_softc *); +static void bge_txeof(struct bge_softc *, uint16_t); +static void bge_rxeof(struct bge_softc *, uint16_t, int); static void bge_asf_driver_up (struct bge_softc *); static void bge_tick(void *); @@ -371,6 +372,8 @@ static void bge_stats_update_regs(struct static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); +static int bge_msi_intr(void *); +static void bge_intr_task(void *, int); static void bge_start_locked(struct ifnet *); static void bge_start(struct ifnet *); static int bge_ioctl(struct ifnet *, u_long, caddr_t); @@ -2470,6 +2473,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); + /* * Map control/status registers. */ @@ -2832,8 +2837,27 @@ again: * Hookup IRQ last. */ #if __FreeBSD_version > 700030 - error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, - NULL, bge_intr, sc, &sc->bge_intrhand); + if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { + /* Take advantage of single-shot MSI. */ + sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, + taskqueue_thread_enqueue, &sc->bge_tq); + if (sc->bge_tq == NULL) { + device_printf(dev, "could not create taskqueue.\n"); + ether_ifdetach(ifp); + error = ENXIO; + goto fail; + } + taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(sc->bge_dev)); + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, + &sc->bge_intrhand); + if (error) + ether_ifdetach(ifp); + } else + error = bus_setup_intr(dev, sc->bge_irq, + INTR_TYPE_NET | INTR_MPSAFE, NULL, bge_intr, sc, + &sc->bge_intrhand); #else error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_intr, sc, &sc->bge_intrhand); @@ -2875,6 +2899,8 @@ bge_detach(device_t dev) callout_drain(&sc->bge_stat_ch); + if (sc->bge_tq) + taskqueue_drain(sc->bge_tq, &sc->bge_intr_task); ether_ifdetach(ifp); if (sc->bge_flags & BGE_FLAG_TBI) { @@ -2896,6 +2922,9 @@ bge_release_resources(struct bge_softc * dev = sc->bge_dev; + if (sc->bge_tq != NULL) + taskqueue_free(sc->bge_tq); + if (sc->bge_intrhand != NULL) bus_teardown_intr(dev, sc->bge_irq, sc->bge_intrhand); @@ -3135,15 +3164,13 @@ bge_reset(struct bge_softc *sc) */ static void -bge_rxeof(struct bge_softc *sc) +bge_rxeof(struct bge_softc *sc, uint16_t rx_prod, int holdlck) { struct ifnet *ifp; int stdcnt = 0, jumbocnt = 0; - uint16_t rx_prod, rx_cons; + uint16_t rx_cons; - BGE_LOCK_ASSERT(sc); rx_cons = sc->bge_rx_saved_considx; - rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; /* Nothing to do. */ if (rx_cons == rx_prod) @@ -3259,9 +3286,12 @@ bge_rxeof(struct bge_softc *sc) #endif } - BGE_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - BGE_LOCK(sc); + if (holdlck != 0) { + BGE_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + BGE_LOCK(sc); + } else + (*ifp->if_input)(ifp, m); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) return; @@ -3294,7 +3324,7 @@ bge_rxeof(struct bge_softc *sc) } static void -bge_txeof(struct bge_softc *sc) +bge_txeof(struct bge_softc *sc, uint16_t tx_cons) { struct bge_tx_bd *cur_tx = NULL; struct ifnet *ifp; @@ -3302,8 +3332,7 @@ bge_txeof(struct bge_softc *sc) BGE_LOCK_ASSERT(sc); /* Nothing to do. */ - if (sc->bge_tx_saved_considx == - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) + if (sc->bge_tx_saved_considx == tx_cons) return; ifp = sc->bge_ifp; @@ -3314,8 +3343,7 @@ bge_txeof(struct bge_softc *sc) * Go through our tx ring and free mbufs for those * frames that have been sent. */ - while (sc->bge_tx_saved_considx != - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) { + while (sc->bge_tx_saved_considx != tx_cons) { uint32_t idx = 0; idx = sc->bge_tx_saved_considx; @@ -3346,6 +3374,7 @@ static void bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct bge_softc *sc = ifp->if_softc; + uint16_t rx_prod, tx_cons; uint32_t statusword; BGE_LOCK(sc); @@ -3355,13 +3384,17 @@ bge_poll(struct ifnet *ifp, enum poll_cm } bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; statusword = atomic_readandclear_32( &sc->bge_ldata.bge_status_block->bge_status); bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Note link event. It will be processed by POLL_AND_CHECK_STATUS. */ if (statusword & BGE_STATFLAG_LINKSTATE_CHANGED) @@ -3374,12 +3407,12 @@ bge_poll(struct ifnet *ifp, enum poll_cm bge_link_upd(sc); sc->rxcycles = count; - bge_rxeof(sc); + bge_rxeof(sc, rx_prod, 1); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); return; } - bge_txeof(sc); + bge_txeof(sc, tx_cons); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); @@ -3387,12 +3420,76 @@ bge_poll(struct ifnet *ifp, enum poll_cm } #endif /* DEVICE_POLLING */ +static int +bge_msi_intr(void *arg) +{ + struct bge_softc *sc; + + sc = (struct bge_softc *)arg; + /* + * This interrupt is not shared and controller already + * disabled further interrupt. + */ + taskqueue_enqueue(sc->bge_tq, &sc->bge_intr_task); + return (FILTER_HANDLED); +} + +static void +bge_intr_task(void *arg, int pending) +{ + struct bge_softc *sc; + struct ifnet *ifp; + uint32_t status; + uint16_t rx_prod, tx_cons; + + sc = (struct bge_softc *)arg; + ifp = sc->bge_ifp; + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + /* Get updated status block. */ + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + /* Save producer/consumer indexess. */ + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + status = sc->bge_ldata.bge_status_block->bge_status; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* Let controller work. */ + bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); + + if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) { + BGE_LOCK(sc); + bge_link_upd(sc); + BGE_UNLOCK(sc); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + /* Check RX return ring producer/consumer. */ + bge_rxeof(sc, rx_prod, 0); + } + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + BGE_LOCK(sc); + /* Check TX ring producer/consumer. */ + bge_txeof(sc, tx_cons); + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + bge_start_locked(ifp); + BGE_UNLOCK(sc); + } +} + static void bge_intr(void *xsc) { struct bge_softc *sc; struct ifnet *ifp; uint32_t statusword; + uint16_t rx_prod, tx_cons; sc = xsc; @@ -3436,7 +3533,14 @@ bge_intr(void *xsc) /* Make sure the descriptor ring indexes are coherent. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + rx_prod = sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx; + tx_cons = sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx; + sc->bge_ldata.bge_status_block->bge_status = 0; + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || @@ -3445,21 +3549,18 @@ bge_intr(void *xsc) if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check RX return ring producer/consumer. */ - bge_rxeof(sc); + bge_rxeof(sc, rx_prod, 1); } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { /* Check TX ring producer/consumer. */ - bge_txeof(sc); + bge_txeof(sc, tx_cons); } if (ifp->if_drv_flags & IFF_DRV_RUNNING && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); - bus_dmamap_sync(sc->bge_cdata.bge_status_tag, - sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD); - BGE_UNLOCK(sc); } Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Wed Jan 6 23:57:17 2010 (r201698) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 7 00:04:29 2010 (r201699) @@ -2641,6 +2641,8 @@ struct bge_softc { #ifdef DEVICE_POLLING int rxcycles; #endif /* DEVICE_POLLING */ + struct task bge_intr_task; + struct taskqueue *bge_tq; }; #define BGE_LOCK_INIT(_sc, _name) \ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:17:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05E56106566C; Thu, 7 Jan 2010 00:17:37 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9D498FC1E; Thu, 7 Jan 2010 00:17:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070HaZx084010; Thu, 7 Jan 2010 00:17:36 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070HaSF084008; Thu, 7 Jan 2010 00:17:36 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001070017.o070HaSF084008@svn.freebsd.org> From: Kirk McKusick Date: Thu, 7 Jan 2010 00:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201700 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:17:37 -0000 Author: mckusick Date: Thu Jan 7 00:17:36 2010 New Revision: 201700 URL: http://svn.freebsd.org/changeset/base/201700 Log: This corrects a bug that manifested itself as identifying the last cylinder group of a UFS1 filesystem as bad. The error was in the check and not in the cylinder group itself. So even though fsck fixed the cylinder group correctly, it was still endlessly reported as bad. PR: 141992 MFC after: 2 weeks Reported by: Dan Strick Modified: head/sbin/fsck_ffs/fsutil.c Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Thu Jan 7 00:04:29 2010 (r201699) +++ head/sbin/fsck_ffs/fsutil.c Thu Jan 7 00:17:36 2010 (r201700) @@ -436,7 +436,7 @@ check_cgmagic(int cg, struct cg *cgp) ((sblock.fs_magic == FS_UFS1_MAGIC && cgp->cg_old_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && - cgp->cg_old_ncyl == sblock.fs_old_cpg) || + cgp->cg_old_ncyl <= sblock.fs_old_cpg) || (sblock.fs_magic == FS_UFS2_MAGIC && cgp->cg_niblk == sblock.fs_ipg && cgp->cg_ndblk <= sblock.fs_fpg && From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:30:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1051065672; Thu, 7 Jan 2010 00:30:59 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A15C58FC23; Thu, 7 Jan 2010 00:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070UxWD087032; Thu, 7 Jan 2010 00:30:59 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070Uxen087029; Thu, 7 Jan 2010 00:30:59 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001070030.o070Uxen087029@svn.freebsd.org> From: Andrew Thompson Date: Thu, 7 Jan 2010 00:30:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201701 - in head/sys/dev/usb: . quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:30:59 -0000 Author: thompsa Date: Thu Jan 7 00:30:59 2010 New Revision: 201701 URL: http://svn.freebsd.org/changeset/base/201701 Log: Add new umass quirks for Western Digital MYBook and JMicron JM20337. PR: usb/142225, usb/142228 Submitted by: Thomas Ward, Yoshikazu GOTO MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Jan 7 00:17:36 2010 (r201700) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Jan 7 00:30:59 2010 (r201701) @@ -225,6 +225,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(IOMEGA, ZIP100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_TEST_UNIT_READY), /* XXX ZIP drives can also use ATAPI */ + USB_QUIRK(JMICRON, JM20337, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, + UQ_MSC_FORCE_PROTO_SCSI, + UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(KYOCERA, FINECAM_L3, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(KYOCERA, FINECAM_S3X, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI, @@ -413,7 +416,8 @@ static struct usb_quirk_entry usb_quirks UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE), USB_QUIRK(WESTERN, MYBOOK, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY_EVPD), + UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY_EVPD, + UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(WESTERN, MYPASSWORD, 0x0000, 0xffff, UQ_MSC_FORCE_SHORT_INQ), USB_QUIRK(WINMAXGROUP, FLASH64MC, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jan 7 00:17:36 2010 (r201700) +++ head/sys/dev/usb/usbdevs Thu Jan 7 00:30:59 2010 (r201701) @@ -603,6 +603,7 @@ vendor SUPERTOP 0x14cd Super Top vendor PLANEX3 0x14ea Planex Communications vendor SILICONPORTALS 0x1527 Silicon Portals vendor UBIQUAM 0x1529 UBIQUAM Co., Ltd. +vendor JMICRON 0x152d JMicron vendor UBLOX 0x1546 U-blox vendor PNY 0x154b PNY vendor OQO 0x1557 OQO @@ -1671,6 +1672,9 @@ product JABLOTRON PC60B 0x0001 PC-60B /* Jaton products */ product JATON EDA 0x5704 Ethernet +/* JMicron products */ +product JMICRON JM20337 0x2338 USB to ATA/ATAPI Bridge + /* JVC products */ product JVC GR_DX95 0x000a GR-DX95 product JVC MP_PRX1 0x3008 MP-PRX1 Ethernet From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:44:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CAA01065670; Thu, 7 Jan 2010 00:44:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79A608FC12; Thu, 7 Jan 2010 00:44:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070isuT090251; Thu, 7 Jan 2010 00:44:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070isAH090224; Thu, 7 Jan 2010 00:44:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001070044.o070isAH090224@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jan 2010 00:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201702 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:44:54 -0000 Author: yongari Date: Thu Jan 7 00:44:54 2010 New Revision: 201702 URL: http://svn.freebsd.org/changeset/base/201702 Log: MFC r199670-199671,199674,199679,199761,199807-199808 r199670: Fix two long standing bugs on bge(4). Most pre BCM5755 controllers have a DMA bug when buffer address crosses a multiple of the 4GB boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within 4GB address for these controllers. The second DMA bug limits DMA address to be within 40bit address space. This bug applies to BCM5714 and BCM5715 and 5708(bce(4) controller). This is not actually a MAC controller bug but an issue with the embedded PCIe to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers also limit the DMA address to be within 40bit address space. Special thanks to davidch@ who gave me detailed errata information. I think this change will fix long standing bge(4) instability issues on systems with more than 4GB memory. r199671: Implement TSO for BCM5755 or newer controllers. Some controllers seem to require a special firmware to use TSO. But the firmware is not available to FreeBSD and Linux claims that the TSO performed by the firmware is slower than hardware based TSO. Moreover the firmware based TSO has one known bug which can't handle TSO if ethernet header + IP/TCP header is greater than 80 bytes. The workaround for the TSO bug exist but it seems it's too expensive than not using TSO at all. Some hardwares also have the TSO bug so limit the TSO to the controllers that are not affected TSO issues (e.g. 5755 or higher). While I'm here set VLAN tag bit to all descriptors that belengs to a frame instead of the first descriptor of a frame. The datasheet is not clear how to handle VLAN tag bit but it worked either way in my testing. This makes it simplify TSO configuration a little bit. Big thanks to davidch@ who sent me detailed TSO information. Without this I was not able to implement it. r199674: Add missing function prototype in r199671. r199679: Reduce status block size DMAed by controller. bge(4) uses single Tx/Rx/Rx return ring such that large part of status block was not used at all. All bge(4) controllers except BCM5700 AX/BX has a feature to control the size of status block. So use minimum status block size allowed in controller. This reduces number of DMAed status block size to 32 bytes from 80 bytes. r199761: BGE_FLAG_40BIT_BUG should be set before creating DMA tags. r199807: Make sure one shot MSI is enabled. r199808: Fix typo which inversed the logic which in turn disabled MSI. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Thu Jan 7 00:30:59 2010 (r201701) +++ stable/8/sys/dev/bge/if_bge.c Thu Jan 7 00:44:54 2010 (r201702) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -369,6 +370,8 @@ static void bge_asf_driver_up (struct bg static void bge_tick(void *); static void bge_stats_update(struct bge_softc *); static void bge_stats_update_regs(struct bge_softc *); +static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *, + uint16_t *); static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); @@ -1754,8 +1757,15 @@ bge_blockinit(struct bge_softc *sc) sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; + /* Set up status block size. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + val = BGE_STATBLKSZ_FULL; + else + val = BGE_STATBLKSZ_32BYTE; + /* Turn on host coalescing state machine */ - CSR_WRITE_4(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); + CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); /* Turn on RX BD completion state machine and enable attentions */ CSR_WRITE_4(sc, BGE_RBDC_MODE, @@ -1811,6 +1821,8 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; + if (sc->bge_flags & BGE_FLAG_TSO) + val |= BGE_RDMAMODE_TSO4_ENABLE; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -1837,7 +1849,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ - CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); + if (sc->bge_flags & BGE_FLAG_TSO) + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08); + else + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); /* Turn on send BD initiator state machine */ CSR_WRITE_4(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE); @@ -2104,15 +2119,22 @@ bge_dma_alloc(device_t dev) { struct bge_dmamap_arg ctx; struct bge_softc *sc; + bus_addr_t lowaddr; + bus_size_t sbsz, txsegsz, txmaxsegsz; int i, error; sc = device_get_softc(dev); + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) + lowaddr = BGE_DMA_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, + 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); @@ -2125,10 +2147,17 @@ bge_dma_alloc(device_t dev) /* * Create tag for Tx mbufs. */ + if (sc->bge_flags & BGE_FLAG_TSO) { + txsegsz = BGE_TSOSEG_SZ; + txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); + } else { + txsegsz = MCLBYTES; + txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; + } error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * BGE_NSEG_NEW, BGE_NSEG_NEW, MCLBYTES, - BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, + &sc->bge_cdata.bge_tx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate TX dma tag\n"); @@ -2140,7 +2169,7 @@ bge_dma_alloc(device_t dev) */ error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, - MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); @@ -2343,14 +2372,25 @@ bge_dma_alloc(device_t dev) sc->bge_ldata.bge_tx_ring_paddr = ctx.bge_busaddr; - /* Create tag for status block. */ + /* + * Create tag for status block. + * Because we only use single Tx/Rx/Rx return ring, use + * minimum status block size except BCM5700 AX/BX which + * seems to want to see full status block size regardless + * of configured number of ring. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sbsz = BGE_STATUS_BLK_SZ; + else + sbsz = 32; error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STATUS_BLK_SZ, 1, BGE_STATUS_BLK_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_status_tag); + NULL, sbsz, 1, sbsz, 0, NULL, NULL, &sc->bge_cdata.bge_status_tag); if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); + device_printf(sc->bge_dev, + "could not allocate status dma tag\n"); return (ENOMEM); } @@ -2361,7 +2401,7 @@ bge_dma_alloc(device_t dev) if (error) return (ENOMEM); - bzero((char *)sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + bzero((char *)sc->bge_ldata.bge_status_block, sbsz); /* Load the address of the status block. */ ctx.sc = sc; @@ -2369,7 +2409,7 @@ bge_dma_alloc(device_t dev) error = bus_dmamap_load(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, sc->bge_ldata.bge_status_block, - BGE_STATUS_BLK_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); + sbsz, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); if (error) return (ENOMEM); @@ -2566,6 +2606,16 @@ bge_attach(device_t dev) sc->bge_flags |= BGE_FLAG_BER_BUG; } + /* + * All controllers that are not 5755 or higher have 4GB + * boundary DMA bug. + * Whenever an address crosses a multiple of the 4GB boundary + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA + * state machine will lockup and cause the device to hang. + */ + if (BGE_IS_5755_PLUS(sc) == 0) + sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; /* * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() @@ -2576,6 +2626,21 @@ bge_attach(device_t dev) misccfg == BGE_MISCCFG_BOARD_ID_5788M) sc->bge_flags |= BGE_FLAG_5788; + /* + * Some controllers seem to require a special firmware to use + * TSO. But the firmware is not available to FreeBSD and Linux + * claims that the TSO performed by the firmware is slower than + * hardware based TSO. Moreover the firmware based TSO has one + * known bug which can't handle TSO if ethernet header + IP/TCP + * header is greater than 80 bytes. The workaround for the TSO + * bug exist but it seems it's too expensive than not using + * TSO at all. Some hardwares also have the TSO bug so limit + * the TSO to the controllers that are not affected TSO issues + * (e.g. 5755 or higher). + */ + if (BGE_IS_5755_PLUS(sc)) + sc->bge_flags |= BGE_FLAG_TSO; + /* * Check if this is a PCI-X or PCI Express device. */ @@ -2600,12 +2665,19 @@ bge_attach(device_t dev) } /* + * The 40bit DMA bug applies to the 5714/5715 controllers and is + * not actually a MAC controller bug but an issue with the embedded + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. + */ + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) + sc->bge_flags |= BGE_FLAG_40BIT_BUG; + /* * Allocate the interrupt, using MSI if possible. These devices * support 8 MSI messages, but only the first one is used in * normal operation. */ rid = 0; - if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) == 0) { sc->bge_msicap = reg; if (bge_can_use_msi(sc)) { msicount = pci_msi_count(dev); @@ -2722,6 +2794,10 @@ bge_attach(device_t dev) ifp->if_hwassist = BGE_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { + ifp->if_hwassist |= CSUM_TSO; + ifp->if_capabilities |= IFCAP_TSO4; + } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; #endif @@ -2839,6 +2915,8 @@ again: #if __FreeBSD_version > 700030 if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { /* Take advantage of single-shot MSI. */ + CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) & + ~BGE_MSIMODE_ONE_SHOT_DISABLE); sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->bge_tq); if (sc->bge_tq == NULL) { @@ -3729,6 +3807,72 @@ bge_cksum_pad(struct mbuf *m) return (0); } +static struct mbuf * +bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) +{ + struct ether_header *eh; + struct ip *ip; + struct tcphdr *tcp; + struct mbuf *n; + uint16_t hlen; + uint32_t ip_off, poff; + + if (M_WRITABLE(m) == 0) { + /* Get a writable copy. */ + n = m_dup(m, M_DONTWAIT); + m_freem(m); + if (n == NULL) + return (NULL); + m = n; + } + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + eh = mtod(m, struct ether_header *); + /* Check the existence of VLAN tag. */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) + return (NULL); + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); + m = m_pullup(m, poff + sizeof(struct tcphdr)); + if (m == NULL) + return (NULL); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + if (m == NULL) + return (NULL); + /* + * It seems controller doesn't modify IP length and TCP pseudo + * checksum. These checksum computed by upper stack should be 0. + */ + *mss = m->m_pkthdr.tso_segsz; + ip->ip_sum = 0; + ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); + /* Clear pseudo checksum computed by TCP stack. */ + tcp->th_sum = 0; + /* + * Broadcom controllers uses different descriptor format for + * TSO depending on ASIC revision. Due to TSO-capable firmware + * license issue and lower performance of firmware based TSO + * we only support hardware based TSO which is applicable for + * BCM5755 or newer controllers. Hardware based TSO uses 11 + * bits to store MSS and upper 5 bits are used to store IP/TCP + * header length(including IP/TCP options). The header length + * is expressed as 32 bits unit. + */ + hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2; + *mss |= (hlen << 11); + return (m); +} + /* * Encapsulate an mbuf chain in the tx ring by coupling the mbuf data * pointers to descriptors. @@ -3741,11 +3885,19 @@ bge_encap(struct bge_softc *sc, struct m struct bge_tx_bd *d; struct mbuf *m = *m_head; uint32_t idx = *txidx; - uint16_t csum_flags; + uint16_t csum_flags, mss, vlan_tag; int nsegs, i, error; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { + mss = 0; + vlan_tag = 0; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + *m_head = m = bge_setup_tso(sc, m, &mss); + if (*m_head == NULL) + return (ENOBUFS); + csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | + BGE_TXBDFLAG_CPU_POST_DMA; + } else if ((m->m_pkthdr.csum_flags & BGE_CSUM_FEATURES) != 0) { if (m->m_pkthdr.csum_flags & CSUM_IP) csum_flags |= BGE_TXBDFLAG_IP_CSUM; if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { @@ -3792,12 +3944,29 @@ bge_encap(struct bge_softc *sc, struct m bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); +#if __FreeBSD_version > 700022 + if (m->m_flags & M_VLANTAG) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = m->m_pkthdr.ether_vtag; + } +#else + { + struct m_tag *mtag; + + if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = VLAN_TAG_VALUE(mtag); + } + } +#endif for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); d->bge_len = segs[i].ds_len; d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; if (i == nsegs - 1) break; BGE_INC(idx, BGE_TX_RING_CNT); @@ -3806,26 +3975,6 @@ bge_encap(struct bge_softc *sc, struct m /* Mark the last segment as end of packet... */ d->bge_flags |= BGE_TXBDFLAG_END; - /* ... and put VLAN tag into first segment. */ - d = &sc->bge_ldata.bge_tx_ring[*txidx]; -#if __FreeBSD_version > 700022 - if (m->m_flags & M_VLANTAG) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = m->m_pkthdr.ether_vtag; - } else - d->bge_vlan_tag = 0; -#else - { - struct m_tag *mtag; - - if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = VLAN_TAG_VALUE(mtag); - } else - d->bge_vlan_tag = 0; - } -#endif - /* * Insure that the map for this transmission * is placed at the array index of the last descriptor @@ -4332,14 +4481,23 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_HWCSUM; if (IFCAP_HWCSUM & ifp->if_capenable && IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = BGE_CSUM_FEATURES; + ifp->if_hwassist |= BGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~BGE_CSUM_FEATURES; #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); #endif } + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO4) != 0) { + ifp->if_capenable ^= IFCAP_TSO4; + if ((ifp->if_capenable & IFCAP_TSO4) != 0) + ifp->if_hwassist |= CSUM_TSO; + else + ifp->if_hwassist &= ~CSUM_TSO; + } + if (mask & IFCAP_VLAN_MTU) { ifp->if_capenable ^= IFCAP_VLAN_MTU; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Thu Jan 7 00:30:59 2010 (r201701) +++ stable/8/sys/dev/bge/if_bgereg.h Thu Jan 7 00:44:54 2010 (r201702) @@ -1402,6 +1402,8 @@ #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 +#define BGE_RDMAMODE_TSO4_ENABLE 0x08000000 +#define BGE_RDMAMODE_TSO6_ENABLE 0x10000000 /* Read DMA status register */ #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -1949,11 +1951,11 @@ struct bge_tx_bd { uint16_t bge_flags; uint16_t bge_len; uint16_t bge_vlan_tag; - uint16_t bge_rsvd; + uint16_t bge_mss; #else uint16_t bge_len; uint16_t bge_flags; - uint16_t bge_rsvd; + uint16_t bge_mss; uint16_t bge_vlan_tag; #endif }; @@ -2482,7 +2484,15 @@ struct bge_gib { #define BGE_JSLOTS 384 #define BGE_NSEG_JUMBO 4 -#define BGE_NSEG_NEW 32 +#define BGE_NSEG_NEW 32 +#define BGE_TSOSEG_SZ 4096 + +/* Maximum DMA address for controllers that have 40bit DMA address bug. */ +#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) +#define BGE_DMA_MAXADDR BUS_SPACE_MAXADDR +#else +#define BGE_DMA_MAXADDR 0xFFFFFFFFFF +#endif /* * Ring structures. Most of these reside in host memory and we tell @@ -2595,11 +2605,14 @@ struct bge_softc { #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 +#define BGE_FLAG_TSO 0x00000800 #define BGE_FLAG_5700_FAMILY 0x00001000 #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 #define BGE_FLAG_5755_PLUS 0x00010000 +#define BGE_FLAG_40BIT_BUG 0x00020000 +#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:47:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4F02106566B; Thu, 7 Jan 2010 00:47:50 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AD9D8FC08; Thu, 7 Jan 2010 00:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070lok9091016; Thu, 7 Jan 2010 00:47:50 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070looW091014; Thu, 7 Jan 2010 00:47:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001070047.o070looW091014@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Jan 2010 00:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201703 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:47:50 -0000 Author: attilio Date: Thu Jan 7 00:47:50 2010 New Revision: 201703 URL: http://svn.freebsd.org/changeset/base/201703 Log: Exclusive waiters sleeping with LK_SLEEPFAIL on and using interruptible sleeps/timeout may have left spourious lk_exslpfail counts on, so clean it up even when accessing a shared queue acquisition, giving to lk_exslpfail the value of 'upper limit'. In the worst case scenario, infact (mixed interruptible sleep / LK_SLEEPFAIL waiters) what may happen is that both queues are awaken even if that's not necessary, but still no harm. Reported by: Lucius Windschuh Reviewed by: kib Tested by: pho, Lucius Windschuh Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Thu Jan 7 00:44:54 2010 (r201702) +++ head/sys/kern/kern_lock.c Thu Jan 7 00:47:50 2010 (r201703) @@ -300,7 +300,14 @@ wakeupshlk(struct lock *lk, const char * } } else { - MPASS(lk->lk_exslpfail == 0); + + /* + * Exclusive waiters sleeping with LK_SLEEPFAIL on + * and using interruptible sleeps/timeout may have + * left spourious lk_exslpfail counts on, so clean + * it up anyway. + */ + lk->lk_exslpfail = 0; queue = SQ_SHARED_QUEUE; } @@ -959,7 +966,14 @@ __lockmgr_args(struct lock *lk, u_int fl queue = SQ_SHARED_QUEUE; } } else { - MPASS(lk->lk_exslpfail == 0); + + /* + * Exclusive waiters sleeping with LK_SLEEPFAIL + * on and using interruptible sleeps/timeout + * may have left spourious lk_exslpfail counts + * on, so clean it up anyway. + */ + lk->lk_exslpfail = 0; queue = SQ_SHARED_QUEUE; } @@ -1037,8 +1051,16 @@ __lockmgr_args(struct lock *lk, u_int fl queue = SQ_EXCLUSIVE_QUEUE; v &= ~LK_EXCLUSIVE_WAITERS; } else { + + /* + * Exclusive waiters sleeping with + * LK_SLEEPFAIL on and using + * interruptible sleeps/timeout may + * have left spourious lk_exslpfail + * counts on, so clean it up anyway. + */ MPASS(v & LK_SHARED_WAITERS); - MPASS(lk->lk_exslpfail == 0); + lk->lk_exslpfail = 0; queue = SQ_SHARED_QUEUE; v &= ~LK_SHARED_WAITERS; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:48:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D7DF10656B6; Thu, 7 Jan 2010 00:48:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AF5B8FC21; Thu, 7 Jan 2010 00:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070mA99091126; Thu, 7 Jan 2010 00:48:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070mApM091123; Thu, 7 Jan 2010 00:48:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001070048.o070mApM091123@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jan 2010 00:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201704 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:48:10 -0000 Author: yongari Date: Thu Jan 7 00:48:10 2010 New Revision: 201704 URL: http://svn.freebsd.org/changeset/base/201704 Log: MFC r199670-199671,199674,199679,199761,199807-199808 r199670: Fix two long standing bugs on bge(4). Most pre BCM5755 controllers have a DMA bug when buffer address crosses a multiple of the 4GB boundary(e.g. 4GB, 8GB, 12GB etc). Limit DMA address to be within 4GB address for these controllers. The second DMA bug limits DMA address to be within 40bit address space. This bug applies to BCM5714 and BCM5715 and 5708(bce(4) controller). This is not actually a MAC controller bug but an issue with the embedded PCIe to PCI-X bridge in the device. So for BCM5714/BCM5715 controllers also limit the DMA address to be within 40bit address space. Special thanks to davidch@ who gave me detailed errata information. I think this change will fix long standing bge(4) instability issues on systems with more than 4GB memory. r199671: Implement TSO for BCM5755 or newer controllers. Some controllers seem to require a special firmware to use TSO. But the firmware is not available to FreeBSD and Linux claims that the TSO performed by the firmware is slower than hardware based TSO. Moreover the firmware based TSO has one known bug which can't handle TSO if ethernet header + IP/TCP header is greater than 80 bytes. The workaround for the TSO bug exist but it seems it's too expensive than not using TSO at all. Some hardwares also have the TSO bug so limit the TSO to the controllers that are not affected TSO issues (e.g. 5755 or higher). While I'm here set VLAN tag bit to all descriptors that belengs to a frame instead of the first descriptor of a frame. The datasheet is not clear how to handle VLAN tag bit but it worked either way in my testing. This makes it simplify TSO configuration a little bit. Big thanks to davidch@ who sent me detailed TSO information. Without this I was not able to implement it. r199674: Add missing function prototype in r199671. r199679: Reduce status block size DMAed by controller. bge(4) uses single Tx/Rx/Rx return ring such that large part of status block was not used at all. All bge(4) controllers except BCM5700 AX/BX has a feature to control the size of status block. So use minimum status block size allowed in controller. This reduces number of DMAed status block size to 32 bytes from 80 bytes. r199761: BGE_FLAG_40BIT_BUG should be set before creating DMA tags. r199807: Make sure one shot MSI is enabled. r199808: Fix typo which inversed the logic which in turn disabled MSI. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 7 00:47:50 2010 (r201703) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 7 00:48:10 2010 (r201704) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -369,6 +370,8 @@ static void bge_asf_driver_up (struct bg static void bge_tick(void *); static void bge_stats_update(struct bge_softc *); static void bge_stats_update_regs(struct bge_softc *); +static struct mbuf *bge_setup_tso(struct bge_softc *, struct mbuf *, + uint16_t *); static int bge_encap(struct bge_softc *, struct mbuf **, uint32_t *); static void bge_intr(void *); @@ -1754,8 +1757,15 @@ bge_blockinit(struct bge_softc *sc) sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; + /* Set up status block size. */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + val = BGE_STATBLKSZ_FULL; + else + val = BGE_STATBLKSZ_32BYTE; + /* Turn on host coalescing state machine */ - CSR_WRITE_4(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); + CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); /* Turn on RX BD completion state machine and enable attentions */ CSR_WRITE_4(sc, BGE_RBDC_MODE, @@ -1811,6 +1821,8 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; + if (sc->bge_flags & BGE_FLAG_TSO) + val |= BGE_RDMAMODE_TSO4_ENABLE; CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -1837,7 +1849,10 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_SDC_MODE, val); /* Turn on send data initiator state machine */ - CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); + if (sc->bge_flags & BGE_FLAG_TSO) + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE | 0x08); + else + CSR_WRITE_4(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); /* Turn on send BD initiator state machine */ CSR_WRITE_4(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE); @@ -2104,15 +2119,22 @@ bge_dma_alloc(device_t dev) { struct bge_dmamap_arg ctx; struct bge_softc *sc; + bus_addr_t lowaddr; + bus_size_t sbsz, txsegsz, txmaxsegsz; int i, error; sc = device_get_softc(dev); + lowaddr = BUS_SPACE_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_40BIT_BUG) != 0) + lowaddr = BGE_DMA_MAXADDR; + if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) + lowaddr = BUS_SPACE_MAXADDR_32BIT; /* * Allocate the parent bus DMA tag appropriate for PCI. */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, + 1, 0, lowaddr, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_parent_tag); @@ -2125,10 +2147,17 @@ bge_dma_alloc(device_t dev) /* * Create tag for Tx mbufs. */ + if (sc->bge_flags & BGE_FLAG_TSO) { + txsegsz = BGE_TSOSEG_SZ; + txmaxsegsz = 65535 + sizeof(struct ether_vlan_header); + } else { + txsegsz = MCLBYTES; + txmaxsegsz = MCLBYTES * BGE_NSEG_NEW; + } error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * BGE_NSEG_NEW, BGE_NSEG_NEW, MCLBYTES, - BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_tx_mtag); + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, + txmaxsegsz, BGE_NSEG_NEW, txsegsz, 0, NULL, NULL, + &sc->bge_cdata.bge_tx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate TX dma tag\n"); @@ -2140,7 +2169,7 @@ bge_dma_alloc(device_t dev) */ error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, 1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, 1, - MCLBYTES, BUS_DMA_ALLOCNOW, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); + MCLBYTES, 0, NULL, NULL, &sc->bge_cdata.bge_rx_mtag); if (error) { device_printf(sc->bge_dev, "could not allocate RX dma tag\n"); @@ -2343,14 +2372,25 @@ bge_dma_alloc(device_t dev) sc->bge_ldata.bge_tx_ring_paddr = ctx.bge_busaddr; - /* Create tag for status block. */ + /* + * Create tag for status block. + * Because we only use single Tx/Rx/Rx return ring, use + * minimum status block size except BCM5700 AX/BX which + * seems to want to see full status block size regardless + * of configured number of ring. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sbsz = BGE_STATUS_BLK_SZ; + else + sbsz = 32; error = bus_dma_tag_create(sc->bge_cdata.bge_parent_tag, PAGE_SIZE, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, - NULL, BGE_STATUS_BLK_SZ, 1, BGE_STATUS_BLK_SZ, 0, - NULL, NULL, &sc->bge_cdata.bge_status_tag); + NULL, sbsz, 1, sbsz, 0, NULL, NULL, &sc->bge_cdata.bge_status_tag); if (error) { - device_printf(sc->bge_dev, "could not allocate dma tag\n"); + device_printf(sc->bge_dev, + "could not allocate status dma tag\n"); return (ENOMEM); } @@ -2361,7 +2401,7 @@ bge_dma_alloc(device_t dev) if (error) return (ENOMEM); - bzero((char *)sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + bzero((char *)sc->bge_ldata.bge_status_block, sbsz); /* Load the address of the status block. */ ctx.sc = sc; @@ -2369,7 +2409,7 @@ bge_dma_alloc(device_t dev) error = bus_dmamap_load(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, sc->bge_ldata.bge_status_block, - BGE_STATUS_BLK_SZ, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); + sbsz, bge_dma_map_addr, &ctx, BUS_DMA_NOWAIT); if (error) return (ENOMEM); @@ -2566,6 +2606,16 @@ bge_attach(device_t dev) sc->bge_flags |= BGE_FLAG_BER_BUG; } + /* + * All controllers that are not 5755 or higher have 4GB + * boundary DMA bug. + * Whenever an address crosses a multiple of the 4GB boundary + * (including 4GB, 8Gb, 12Gb, etc.) and makes the transition + * from 0xX_FFFF_FFFF to 0x(X+1)_0000_0000 an internal DMA + * state machine will lockup and cause the device to hang. + */ + if (BGE_IS_5755_PLUS(sc) == 0) + sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; /* * We could possibly check for BCOM_DEVICEID_BCM5788 in bge_probe() @@ -2576,6 +2626,21 @@ bge_attach(device_t dev) misccfg == BGE_MISCCFG_BOARD_ID_5788M) sc->bge_flags |= BGE_FLAG_5788; + /* + * Some controllers seem to require a special firmware to use + * TSO. But the firmware is not available to FreeBSD and Linux + * claims that the TSO performed by the firmware is slower than + * hardware based TSO. Moreover the firmware based TSO has one + * known bug which can't handle TSO if ethernet header + IP/TCP + * header is greater than 80 bytes. The workaround for the TSO + * bug exist but it seems it's too expensive than not using + * TSO at all. Some hardwares also have the TSO bug so limit + * the TSO to the controllers that are not affected TSO issues + * (e.g. 5755 or higher). + */ + if (BGE_IS_5755_PLUS(sc)) + sc->bge_flags |= BGE_FLAG_TSO; + /* * Check if this is a PCI-X or PCI Express device. */ @@ -2600,12 +2665,19 @@ bge_attach(device_t dev) } /* + * The 40bit DMA bug applies to the 5714/5715 controllers and is + * not actually a MAC controller bug but an issue with the embedded + * PCIe to PCI-X bridge in the device. Use 40bit DMA workaround. + */ + if (BGE_IS_5714_FAMILY(sc) && (sc->bge_flags & BGE_FLAG_PCIX)) + sc->bge_flags |= BGE_FLAG_40BIT_BUG; + /* * Allocate the interrupt, using MSI if possible. These devices * support 8 MSI messages, but only the first one is used in * normal operation. */ rid = 0; - if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) != 0) { + if (pci_find_extcap(sc->bge_dev, PCIY_MSI, ®) == 0) { sc->bge_msicap = reg; if (bge_can_use_msi(sc)) { msicount = pci_msi_count(dev); @@ -2722,6 +2794,10 @@ bge_attach(device_t dev) ifp->if_hwassist = BGE_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { + ifp->if_hwassist |= CSUM_TSO; + ifp->if_capabilities |= IFCAP_TSO4; + } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; #endif @@ -2839,6 +2915,8 @@ again: #if __FreeBSD_version > 700030 if (BGE_IS_5755_PLUS(sc) && sc->bge_flags & BGE_FLAG_MSI) { /* Take advantage of single-shot MSI. */ + CSR_WRITE_4(sc, BGE_MSI_MODE, CSR_READ_4(sc, BGE_MSI_MODE) & + ~BGE_MSIMODE_ONE_SHOT_DISABLE); sc->bge_tq = taskqueue_create_fast("bge_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->bge_tq); if (sc->bge_tq == NULL) { @@ -3725,6 +3803,72 @@ bge_cksum_pad(struct mbuf *m) return (0); } +static struct mbuf * +bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss) +{ + struct ether_header *eh; + struct ip *ip; + struct tcphdr *tcp; + struct mbuf *n; + uint16_t hlen; + uint32_t ip_off, poff; + + if (M_WRITABLE(m) == 0) { + /* Get a writable copy. */ + n = m_dup(m, M_DONTWAIT); + m_freem(m); + if (n == NULL) + return (NULL); + m = n; + } + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + eh = mtod(m, struct ether_header *); + /* Check the existence of VLAN tag. */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) + return (NULL); + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) + return (NULL); + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); + m = m_pullup(m, poff + sizeof(struct tcphdr)); + if (m == NULL) + return (NULL); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + if (m == NULL) + return (NULL); + /* + * It seems controller doesn't modify IP length and TCP pseudo + * checksum. These checksum computed by upper stack should be 0. + */ + *mss = m->m_pkthdr.tso_segsz; + ip->ip_sum = 0; + ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); + /* Clear pseudo checksum computed by TCP stack. */ + tcp->th_sum = 0; + /* + * Broadcom controllers uses different descriptor format for + * TSO depending on ASIC revision. Due to TSO-capable firmware + * license issue and lower performance of firmware based TSO + * we only support hardware based TSO which is applicable for + * BCM5755 or newer controllers. Hardware based TSO uses 11 + * bits to store MSS and upper 5 bits are used to store IP/TCP + * header length(including IP/TCP options). The header length + * is expressed as 32 bits unit. + */ + hlen = ((ip->ip_hl << 2) + (tcp->th_off << 2)) >> 2; + *mss |= (hlen << 11); + return (m); +} + /* * Encapsulate an mbuf chain in the tx ring by coupling the mbuf data * pointers to descriptors. @@ -3737,11 +3881,19 @@ bge_encap(struct bge_softc *sc, struct m struct bge_tx_bd *d; struct mbuf *m = *m_head; uint32_t idx = *txidx; - uint16_t csum_flags; + uint16_t csum_flags, mss, vlan_tag; int nsegs, i, error; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { + mss = 0; + vlan_tag = 0; + if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { + *m_head = m = bge_setup_tso(sc, m, &mss); + if (*m_head == NULL) + return (ENOBUFS); + csum_flags |= BGE_TXBDFLAG_CPU_PRE_DMA | + BGE_TXBDFLAG_CPU_POST_DMA; + } else if ((m->m_pkthdr.csum_flags & BGE_CSUM_FEATURES) != 0) { if (m->m_pkthdr.csum_flags & CSUM_IP) csum_flags |= BGE_TXBDFLAG_IP_CSUM; if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) { @@ -3788,12 +3940,29 @@ bge_encap(struct bge_softc *sc, struct m bus_dmamap_sync(sc->bge_cdata.bge_tx_mtag, map, BUS_DMASYNC_PREWRITE); +#if __FreeBSD_version > 700022 + if (m->m_flags & M_VLANTAG) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = m->m_pkthdr.ether_vtag; + } +#else + { + struct m_tag *mtag; + + if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { + csum_flags |= BGE_TXBDFLAG_VLAN_TAG; + vlan_tag = VLAN_TAG_VALUE(mtag); + } + } +#endif for (i = 0; ; i++) { d = &sc->bge_ldata.bge_tx_ring[idx]; d->bge_addr.bge_addr_lo = BGE_ADDR_LO(segs[i].ds_addr); d->bge_addr.bge_addr_hi = BGE_ADDR_HI(segs[i].ds_addr); d->bge_len = segs[i].ds_len; d->bge_flags = csum_flags; + d->bge_vlan_tag = vlan_tag; + d->bge_mss = mss; if (i == nsegs - 1) break; BGE_INC(idx, BGE_TX_RING_CNT); @@ -3802,26 +3971,6 @@ bge_encap(struct bge_softc *sc, struct m /* Mark the last segment as end of packet... */ d->bge_flags |= BGE_TXBDFLAG_END; - /* ... and put VLAN tag into first segment. */ - d = &sc->bge_ldata.bge_tx_ring[*txidx]; -#if __FreeBSD_version > 700022 - if (m->m_flags & M_VLANTAG) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = m->m_pkthdr.ether_vtag; - } else - d->bge_vlan_tag = 0; -#else - { - struct m_tag *mtag; - - if ((mtag = VLAN_OUTPUT_TAG(sc->bge_ifp, m)) != NULL) { - d->bge_flags |= BGE_TXBDFLAG_VLAN_TAG; - d->bge_vlan_tag = VLAN_TAG_VALUE(mtag); - } else - d->bge_vlan_tag = 0; - } -#endif - /* * Insure that the map for this transmission * is placed at the array index of the last descriptor @@ -4328,14 +4477,23 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_capenable ^= IFCAP_HWCSUM; if (IFCAP_HWCSUM & ifp->if_capenable && IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = BGE_CSUM_FEATURES; + ifp->if_hwassist |= BGE_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~BGE_CSUM_FEATURES; #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); #endif } + if ((mask & IFCAP_TSO4) != 0 && + (ifp->if_capabilities & IFCAP_TSO4) != 0) { + ifp->if_capenable ^= IFCAP_TSO4; + if ((ifp->if_capenable & IFCAP_TSO4) != 0) + ifp->if_hwassist |= CSUM_TSO; + else + ifp->if_hwassist &= ~CSUM_TSO; + } + if (mask & IFCAP_VLAN_MTU) { ifp->if_capenable ^= IFCAP_VLAN_MTU; ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 7 00:47:50 2010 (r201703) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 7 00:48:10 2010 (r201704) @@ -1402,6 +1402,8 @@ #define BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN 0x00002000 #define BGE_RDMAMODE_FIFO_SIZE_128 0x00020000 #define BGE_RDMAMODE_FIFO_LONG_BURST 0x00030000 +#define BGE_RDMAMODE_TSO4_ENABLE 0x08000000 +#define BGE_RDMAMODE_TSO6_ENABLE 0x10000000 /* Read DMA status register */ #define BGE_RDMASTAT_PCI_TGT_ABRT_ATTN 0x00000004 @@ -1949,11 +1951,11 @@ struct bge_tx_bd { uint16_t bge_flags; uint16_t bge_len; uint16_t bge_vlan_tag; - uint16_t bge_rsvd; + uint16_t bge_mss; #else uint16_t bge_len; uint16_t bge_flags; - uint16_t bge_rsvd; + uint16_t bge_mss; uint16_t bge_vlan_tag; #endif }; @@ -2482,7 +2484,15 @@ struct bge_gib { #define BGE_JSLOTS 384 #define BGE_NSEG_JUMBO 4 -#define BGE_NSEG_NEW 32 +#define BGE_NSEG_NEW 32 +#define BGE_TSOSEG_SZ 4096 + +/* Maximum DMA address for controllers that have 40bit DMA address bug. */ +#if (BUS_SPACE_MAXADDR < 0xFFFFFFFFFF) +#define BGE_DMA_MAXADDR BUS_SPACE_MAXADDR +#else +#define BGE_DMA_MAXADDR 0xFFFFFFFFFF +#endif /* * Ring structures. Most of these reside in host memory and we tell @@ -2595,11 +2605,14 @@ struct bge_softc { #define BGE_FLAG_MSI 0x00000100 #define BGE_FLAG_PCIX 0x00000200 #define BGE_FLAG_PCIE 0x00000400 +#define BGE_FLAG_TSO 0x00000800 #define BGE_FLAG_5700_FAMILY 0x00001000 #define BGE_FLAG_5705_PLUS 0x00002000 #define BGE_FLAG_5714_FAMILY 0x00004000 #define BGE_FLAG_575X_PLUS 0x00008000 #define BGE_FLAG_5755_PLUS 0x00010000 +#define BGE_FLAG_40BIT_BUG 0x00020000 +#define BGE_FLAG_4G_BNDRY_BUG 0x00040000 #define BGE_FLAG_RX_ALIGNBUG 0x00100000 #define BGE_FLAG_NO_3LED 0x00200000 #define BGE_FLAG_ADC_BUG 0x00400000 From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:50:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18E55106568F; Thu, 7 Jan 2010 00:50:46 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 073A58FC15; Thu, 7 Jan 2010 00:50:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070okmX091742; Thu, 7 Jan 2010 00:50:46 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070ojEZ091737; Thu, 7 Jan 2010 00:50:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001070050.o070ojEZ091737@svn.freebsd.org> From: Andrew Thompson Date: Thu, 7 Jan 2010 00:50:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201705 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:50:46 -0000 Author: thompsa Date: Thu Jan 7 00:50:45 2010 New Revision: 201705 URL: http://svn.freebsd.org/changeset/base/201705 Log: Sync to p4 - Add new quirks commands and the '-d' option optionally to specify the ugen device. Submitted by: Hans Petter Selasky Modified: head/usr.sbin/usbconfig/dump.c head/usr.sbin/usbconfig/dump.h head/usr.sbin/usbconfig/usbconfig.8 head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/dump.c ============================================================================== --- head/usr.sbin/usbconfig/dump.c Thu Jan 7 00:48:10 2010 (r201704) +++ head/usr.sbin/usbconfig/dump.c Thu Jan 7 00:50:45 2010 (r201705) @@ -365,3 +365,40 @@ dump_config(struct libusb20_device *pdev } return; } + +void +dump_string_by_index(struct libusb20_device *pdev, uint8_t str_index) +{ + char *pbuf; + uint8_t n; + uint8_t len; + + pbuf = malloc(256); + if (pbuf == NULL) + err(1, "out of memory"); + + if (str_index == 0) { + /* language table */ + if (libusb20_dev_req_string_sync(pdev, + str_index, 0, pbuf, 256)) { + printf("STRING_0x%02x = \n", str_index); + } else { + printf("STRING_0x%02x = ", str_index); + len = (uint8_t)pbuf[0]; + for (n = 0; n != len; n++) { + printf("0x%02x%s", (uint8_t)pbuf[n], + (n != (len-1)) ? ", " : ""); + } + printf("\n"); + } + } else { + /* ordinary string */ + if (libusb20_dev_req_string_simple_sync(pdev, + str_index, pbuf, 256)) { + printf("STRING_0x%02x = \n", str_index); + } else { + printf("STRING_0x%02x = <%s>\n", str_index, pbuf); + } + } + free(pbuf); +} Modified: head/usr.sbin/usbconfig/dump.h ============================================================================== --- head/usr.sbin/usbconfig/dump.h Thu Jan 7 00:48:10 2010 (r201704) +++ head/usr.sbin/usbconfig/dump.h Thu Jan 7 00:50:45 2010 (r201705) @@ -24,11 +24,17 @@ * SUCH DAMAGE. */ +#ifndef _DUMP_H_ +#define _DUMP_H_ + const char *dump_mode(uint8_t value); const char *dump_speed(uint8_t value); const char *dump_power_mode(uint8_t value); +void dump_string_by_index(struct libusb20_device *pdev, uint8_t index); void dump_device_info(struct libusb20_device *pdev, uint8_t show_drv); void dump_be_quirk_names(struct libusb20_backend *pbe); void dump_be_dev_quirks(struct libusb20_backend *pbe); void dump_device_desc(struct libusb20_device *pdev); void dump_config(struct libusb20_device *pdev, uint8_t all_cfg); + +#endif /* _DUMP_H_ */ Modified: head/usr.sbin/usbconfig/usbconfig.8 ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.8 Thu Jan 7 00:48:10 2010 (r201704) +++ head/usr.sbin/usbconfig/usbconfig.8 Thu Jan 7 00:50:45 2010 (r201705) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.\" Copyright (c) 2008 Hans Petter Selasky. All rights reserved. +.\" Copyright (c) 2008-2010 Hans Petter Selasky. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 1, 2009 +.Dd January 6, 2010 .Dt USBCONFIG 8 .Os .Sh NAME @@ -34,6 +34,9 @@ .Op Fl u Ar unit .Op Fl a Ar addr .Op cmds... +.Nm +.Op Fl d Ar [ugen]. +.Op cmds... .Sh DESCRIPTION The .Nm @@ -46,6 +49,9 @@ Limit device range to USB devices connec .It Fl a Ar addr Limit device range to the given USB device index. Should only be used in conjunction with the unit argument. +.It Fl d Ar [ugen]. +Limit device range to USB devices connected to the given unit and address. +The unit and address coordinates may be prefixed by the lowercased word "ugen". .It Fl h Show help and available commands. .El @@ -57,5 +63,34 @@ prints a list of all available USB devic Show information about the device on USB bus 1 at address 2: .Pp .Dl usbconfig -u 1 -a 2 dump_info +.Pp +Dump HID descriptor for device on USB bus 1 at address 2: +.Pp +.Dl usbconfig -u 1 -a 2 do_request 0x81 0x06 0x2200 0 0x100 +.Pp +Dump string descriptor at index Z for device on USB bus 1 at address 2: +.Pp +.Dl usbconfig -u 1 -a 2 dump_string Z +.Pp +Dump current configuration descriptor for device on USB bus 1 at address 2: +.Pp +.Dl usbconfig -u 1 -a 2 dump_curr_config_desc +.Pp +Dump device descriptor for device on USB bus 1 at address 2: +.Pp +.Dl usbconfig -u 1 -a 2 dump_device_desc +.Pp +Program the device on USB bus 1 at address 2 to suspend, resume, power off, go into power save, or power on: +.Pp +.Dl usbconfig -u 1 -a 2 suspend +.Dl usbconfig -u 1 -a 2 resume +.Dl usbconfig -u 1 -a 2 power_off +.Dl usbconfig -u 1 -a 2 power_save +.Dl usbconfig -u 1 -a 2 power_on +.Pp +Display a list of available quirk names: +.Pp +.Dl usbconfig dump_quirk_names +.Pp .Sh SEE ALSO .Xr usb 4 Modified: head/usr.sbin/usbconfig/usbconfig.c ============================================================================== --- head/usr.sbin/usbconfig/usbconfig.c Thu Jan 7 00:48:10 2010 (r201704) +++ head/usr.sbin/usbconfig/usbconfig.c Thu Jan 7 00:50:45 2010 (r201705) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2009 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -81,6 +81,8 @@ struct options { uint8_t got_show_iface_driver:1; uint8_t got_remove_device_quirk:1; uint8_t got_add_device_quirk:1; + uint8_t got_remove_quirk:1; + uint8_t got_add_quirk:1; uint8_t got_dump_string:1; uint8_t got_do_request:1; }; @@ -94,6 +96,7 @@ struct token { enum { T_UNIT, T_ADDR, + T_UGEN, T_IFACE, T_SET_CONFIG, T_SET_ALT, @@ -101,6 +104,8 @@ enum { T_GET_TEMPLATE, T_ADD_DEVICE_QUIRK, T_REMOVE_DEVICE_QUIRK, + T_ADD_QUIRK, + T_REMOVE_QUIRK, T_SHOW_IFACE_DRIVER, T_DUMP_QUIRK_NAMES, T_DUMP_DEVICE_QUIRKS, @@ -124,6 +129,7 @@ static struct options options; static const struct token token[] = { {"-u", T_UNIT, 1}, {"-a", T_ADDR, 1}, + {"-d", T_UGEN, 1}, {"-i", T_IFACE, 1}, {"set_config", T_SET_CONFIG, 1}, {"set_alt", T_SET_ALT, 1}, @@ -131,6 +137,8 @@ static const struct token token[] = { {"get_template", T_GET_TEMPLATE, 0}, {"add_dev_quirk_vplh", T_ADD_DEVICE_QUIRK, 5}, {"remove_dev_quirk_vplh", T_REMOVE_DEVICE_QUIRK, 5}, + {"add_quirk", T_ADD_QUIRK, 1}, + {"remove_quirk", T_REMOVE_QUIRK, 1}, {"dump_quirk_names", T_DUMP_QUIRK_NAMES, 0}, {"dump_device_quirks", T_DUMP_DEVICE_QUIRKS, 0}, {"dump_device_desc", T_DUMP_DEVICE_DESC, 0}, @@ -247,11 +255,20 @@ get_int(const char *s) } static void +duplicate_option(const char *ptr) +{ + printf("Syntax error: " + "Duplicate option: '%s'\n", ptr); + exit(1); +} + +static void usage(void) { printf("" "usbconfig - configure the USB subsystem" "\n" "usage: usbconfig -u -a -i [cmds...]" "\n" + "usage: usbconfig -d [ugen]. -i [cmds...]" "\n" "commands:" "\n" " set_config " "\n" " set_alt " "\n" @@ -259,6 +276,8 @@ usage(void) " get_template" "\n" " add_dev_quirk_vplh " "\n" " remove_dev_quirk_vplh " "\n" + " add_quirk " "\n" + " remove_quirk " "\n" " dump_quirk_names" "\n" " dump_device_quirks" "\n" " dump_device_desc" "\n" @@ -360,25 +379,33 @@ flush_command(struct libusb20_backend *p } matches++; + if (opt->got_remove_quirk) { + struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + + ddesc = libusb20_dev_get_device_desc(pdev); + + be_dev_remove_quirk(pbe, + ddesc->idVendor, ddesc->idProduct, + ddesc->bcdDevice, ddesc->bcdDevice, + opt->quirkname); + } + + if (opt->got_add_quirk) { + struct LIBUSB20_DEVICE_DESC_DECODED *ddesc; + + ddesc = libusb20_dev_get_device_desc(pdev); + + be_dev_add_quirk(pbe, + ddesc->idVendor, ddesc->idProduct, + ddesc->bcdDevice, ddesc->bcdDevice, + opt->quirkname); + } + if (libusb20_dev_open(pdev, 0)) { err(1, "could not open device"); } if (opt->got_dump_string) { - char *pbuf; - - pbuf = malloc(256); - if (pbuf == NULL) { - err(1, "out of memory"); - } - if (libusb20_dev_req_string_simple_sync(pdev, - opt->string_index, pbuf, 256)) { - printf("STRING_0x%02x = \n", - opt->string_index); - } else { - printf("STRING_0x%02x = <%s>\n", - opt->string_index, pbuf); - } - free(pbuf); + dump_string_by_index(pdev, opt->string_index); } if (opt->got_do_request) { uint16_t actlen; @@ -501,6 +528,9 @@ main(int argc, char **argv) { struct libusb20_backend *pbe; struct options *opt = &options; + const char *ptr; + int unit; + int addr; int n; int t; @@ -518,6 +548,28 @@ main(int argc, char **argv) if (t > 255) t = 255; switch (get_token(argv[n], t)) { + case T_ADD_QUIRK: + if (opt->got_add_quirk) { + flush_command(pbe, opt); + } + opt->quirkname = argv[n + 1]; + n++; + + opt->got_add_quirk = 1; + opt->got_any++; + break; + + case T_REMOVE_QUIRK: + if (opt->got_remove_quirk) { + flush_command(pbe, opt); + } + opt->quirkname = argv[n + 1]; + n++; + + opt->got_remove_quirk = 1; + opt->got_any++; + break; + case T_ADD_DEVICE_QUIRK: if (opt->got_add_device_quirk) { flush_command(pbe, opt); @@ -548,11 +600,15 @@ main(int argc, char **argv) break; case T_DUMP_QUIRK_NAMES: + if (opt->got_dump_quirk_names) + duplicate_option(argv[n]); opt->got_dump_quirk_names = 1; opt->got_any++; break; case T_DUMP_DEVICE_QUIRKS: + if (opt->got_dump_device_quirks) + duplicate_option(argv[n]); opt->got_dump_device_quirks = 1; opt->got_any++; break; @@ -561,6 +617,33 @@ main(int argc, char **argv) opt->got_show_iface_driver = 1; break; + case T_UGEN: + if (opt->got_any) { + /* allow multiple commands on the same line */ + flush_command(pbe, opt); + } + ptr = argv[n + 1]; + + if ((ptr[0] == 'u') && + (ptr[1] == 'g') && + (ptr[2] == 'e') && + (ptr[3] == 'n')) + ptr += 4; + + if ((sscanf(ptr, "%d.%d", + &unit, &addr) != 2) || + (unit < 0) || (unit > 65535) || + (addr < 0) || (addr > 65535)) { + errx(1, "cannot " + "parse '%s'", argv[n + 1]); + } + opt->bus = unit; + opt->addr = addr; + opt->got_bus = 1; +; opt->got_addr = 1; + n++; + break; + case T_UNIT: if (opt->got_any) { /* allow multiple commands on the same line */ @@ -581,84 +664,112 @@ main(int argc, char **argv) n++; break; case T_SET_CONFIG: + if (opt->got_set_config) + duplicate_option(argv[n]); opt->config_index = num_id(argv[n + 1], "cfg_index"); opt->got_set_config = 1; opt->got_any++; n++; break; case T_SET_ALT: + if (opt->got_set_alt) + duplicate_option(argv[n]); opt->alt_index = num_id(argv[n + 1], "cfg_index"); opt->got_set_alt = 1; opt->got_any++; n++; break; case T_SET_TEMPLATE: + if (opt->got_set_template) + duplicate_option(argv[n]); opt->template = get_int(argv[n + 1]); opt->got_set_template = 1; opt->got_any++; n++; break; case T_GET_TEMPLATE: + if (opt->got_get_template) + duplicate_option(argv[n]); opt->got_get_template = 1; opt->got_any++; break; case T_DUMP_DEVICE_DESC: + if (opt->got_dump_device_desc) + duplicate_option(argv[n]); opt->got_dump_device_desc = 1; opt->got_any++; break; case T_DUMP_CURR_CONFIG_DESC: + if (opt->got_dump_curr_config) + duplicate_option(argv[n]); opt->got_dump_curr_config = 1; opt->got_any++; break; case T_DUMP_ALL_CONFIG_DESC: + if (opt->got_dump_all_config) + duplicate_option(argv[n]); opt->got_dump_all_config = 1; opt->got_any++; break; case T_DUMP_INFO: + if (opt->got_dump_info) + duplicate_option(argv[n]); opt->got_dump_info = 1; opt->got_any++; break; case T_DUMP_STRING: - if (opt->got_dump_string) { - flush_command(pbe, opt); - } + if (opt->got_dump_string) + duplicate_option(argv[n]); opt->string_index = num_id(argv[n + 1], "str_index"); opt->got_dump_string = 1; opt->got_any++; n++; break; case T_SUSPEND: + if (opt->got_suspend) + duplicate_option(argv[n]); opt->got_suspend = 1; opt->got_any++; break; case T_RESUME: + if (opt->got_resume) + duplicate_option(argv[n]); opt->got_resume = 1; opt->got_any++; break; case T_POWER_OFF: + if (opt->got_power_off) + duplicate_option(argv[n]); opt->got_power_off = 1; opt->got_any++; break; case T_POWER_SAVE: + if (opt->got_power_save) + duplicate_option(argv[n]); opt->got_power_save = 1; opt->got_any++; break; case T_POWER_ON: + if (opt->got_power_on) + duplicate_option(argv[n]); opt->got_power_on = 1; opt->got_any++; break; case T_RESET: + if (opt->got_reset) + duplicate_option(argv[n]); opt->got_reset = 1; opt->got_any++; break; case T_LIST: + if (opt->got_list) + duplicate_option(argv[n]); opt->got_list = 1; opt->got_any++; break; case T_DO_REQUEST: - if (opt->got_do_request) { - flush_command(pbe, opt); - } + if (opt->got_do_request) + duplicate_option(argv[n]); LIBUSB20_INIT(LIBUSB20_CONTROL_SETUP, &opt->setup); opt->setup.bmRequestType = num_id(argv[n + 1], "bmReqTyp"); opt->setup.bRequest = num_id(argv[n + 2], "bReq"); From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:55:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30A4D106566C; Thu, 7 Jan 2010 00:55:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E83F8FC14; Thu, 7 Jan 2010 00:55:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070t8gh092828; Thu, 7 Jan 2010 00:55:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070t7oW092825; Thu, 7 Jan 2010 00:55:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001070055.o070t7oW092825@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jan 2010 00:55:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201706 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:55:08 -0000 Author: yongari Date: Thu Jan 7 00:55:07 2010 New Revision: 201706 URL: http://svn.freebsd.org/changeset/base/201706 Log: MFC r200088,200227-200228,200246,200264,201446 r200088: Add workaround to overcome hardware limitation which allows only a single outstanding DMA read operation. Most controllers targeted to client with PCIe bus interface(e.g. BCM5761) may have this limitation. All controllers for servers does not have this limitation. Collapsing mbuf chains to reduce number of memory reads before transmitting was most effective way to workaround this. I got about 940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it takes a lot of CPU cycles to collapse mbuf chains so add tunable to control the number of allowed TX buffers before collapsing. The default value is 0 which effectively disables the forced collapsing. For most cases 2 would yield best performance(about 930Mbps) without much sacrificing CPU cycles. Note the collapsing is only activated when the controller is on PCIe bus and the frame does not need TSO operation. TSO does not seem to suffer from the hardware limitation because the payload size is much bigger than normal IP datagram. Thanks to davidch@ who told me the limitation of client controllers and actually gave possible workarounds to mitigate the limitation. r200227: Remove PHY isolate/power down code in bge_stop(). The isolation handler in brgphy(4) does not exist and brgphy(4) just resets the PHY and returns EINVAL as it has no isolation handler. I also agree on Marius's opinion that stop handler of every NIC driver seems to be the wrong place for implementing PHY isolate/power down. If we need PHY isolate/power down it should be implemented in brgphy(4) and users should administratively down the PHY. r200228: Don't access jumbo frame related registers if controller lacks the feature. These registers are reserved on controllers that have no support for jumbo frame. Only BCM5700 has mini ring so do not poke mini ring related registers if controller is not BCM5700. r200246: Partially revert r200228. For mini RCB case, bge(4) still have to disable mini ring withtout regard to mini ring support. r200264: Create sysctl node(dev.bge.%d.focred_collapse) instead of hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4) controllers on system which may not desirable behavior of the sysctl node. Also allow the sysctl node could be modified at any time. r201446: Fix regression introduced in r198318. BCM5754/BCM5754M uses the same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special firmware to enable TSO and bge(4) does not support firmware based TSO. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Thu Jan 7 00:50:45 2010 (r201705) +++ stable/8/sys/dev/bge/if_bge.c Thu Jan 7 00:55:07 2010 (r201706) @@ -1625,7 +1625,9 @@ bge_blockinit(struct bge_softc *sc) else val = BGE_STD_RX_RING_CNT / 8; CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, val); - CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8); + if (BGE_IS_JUMBO_CAPABLE(sc)) + CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, + BGE_JUMBO_RX_RING_CNT/8); /* * Disable all unused send rings by setting the 'ring disabled' @@ -1667,8 +1669,10 @@ bge_blockinit(struct bge_softc *sc) /* Initialize RX ring indexes */ bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); + if (BGE_IS_JUMBO_CAPABLE(sc)) + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); + if (sc->bge_asicrev == BGE_ASICREV_BCM5700) + bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); /* * Set up RX return ring 0 @@ -2638,8 +2642,15 @@ bge_attach(device_t dev) * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ - if (BGE_IS_5755_PLUS(sc)) - sc->bge_flags |= BGE_FLAG_TSO; + if (BGE_IS_5755_PLUS(sc)) { + /* + * BCM5754 and BCM5787 shares the same ASIC id so + * explicit device id check is required. + */ + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5754 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5754M) + sc->bge_flags |= BGE_FLAG_TSO; + } /* * Check if this is a PCI-X or PCI Express device. @@ -3915,6 +3926,26 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_IP_FRAG; } + if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && + sc->bge_forced_collapse > 0 && + (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { + /* + * Forcedly collapse mbuf chains to overcome hardware + * limitation which only support a single outstanding + * DMA read operation. + */ + if (sc->bge_forced_collapse == 1) + m = m_defrag(m, M_DONTWAIT); + else + m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + map = sc->bge_cdata.bge_tx_dmamap[idx]; error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -4551,17 +4582,11 @@ static void bge_stop(struct bge_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; BGE_LOCK_ASSERT(sc); ifp = sc->bge_ifp; - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) - mii = device_get_softc(sc->bge_miibus); - callout_stop(&sc->bge_stat_ch); /* Disable host interrupts. */ @@ -4635,27 +4660,6 @@ bge_stop(struct bge_softc *sc) /* Free TX buffers. */ bge_free_tx_ring(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - /* - * If we are called from bge_detach(), mii is already NULL. - */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - ifp->if_flags = itmp; - } - sc->bge_tx_saved_considx = BGE_TXCONS_UNSET; /* Clear MAC's link state (PHY may still have link UP). */ @@ -4861,6 +4865,26 @@ bge_add_sysctls(struct bge_softc *sc) #endif + /* + * A common design characteristic for many Broadcom client controllers + * is that they only support a single outstanding DMA read operation + * on the PCIe bus. This means that it will take twice as long to fetch + * a TX frame that is split into header and payload buffers as it does + * to fetch a single, contiguous TX frame (2 reads vs. 1 read). For + * these controllers, coalescing buffers to reduce the number of memory + * reads is effective way to get maximum performance(about 940Mbps). + * Without collapsing TX buffers the maximum TCP bulk transfer + * performance is about 850Mbps. However forcing coalescing mbufs + * consumes a lot of CPU cycles, so leave it off by default. + */ + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse", + CTLFLAG_RW, &sc->bge_forced_collapse, 0, + "Number of fragmented TX buffers of a frame allowed before " + "forced collapsing"); + resource_int_value(device_get_name(sc->bge_dev), + device_get_unit(sc->bge_dev), "forced_collapse", + &sc->bge_forced_collapse); + if (BGE_IS_5705_PLUS(sc)) return; Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Thu Jan 7 00:50:45 2010 (r201705) +++ stable/8/sys/dev/bge/if_bgereg.h Thu Jan 7 00:55:07 2010 (r201706) @@ -2647,6 +2647,7 @@ struct bge_softc { int bge_link; /* link state */ int bge_link_evt; /* pending link event */ int bge_timer; + int bge_forced_collapse; struct callout bge_stat_ch; uint32_t bge_rx_discards; uint32_t bge_tx_discards; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 00:57:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D50AC106568B; Thu, 7 Jan 2010 00:57:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C2B728FC1F; Thu, 7 Jan 2010 00:57:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o070veOu093491; Thu, 7 Jan 2010 00:57:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o070veNQ093488; Thu, 7 Jan 2010 00:57:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001070057.o070veNQ093488@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 7 Jan 2010 00:57:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201707 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 00:57:40 -0000 Author: yongari Date: Thu Jan 7 00:57:40 2010 New Revision: 201707 URL: http://svn.freebsd.org/changeset/base/201707 Log: MFC r200088,200227-200228,200246,200264,201446 r200088: Add workaround to overcome hardware limitation which allows only a single outstanding DMA read operation. Most controllers targeted to client with PCIe bus interface(e.g. BCM5761) may have this limitation. All controllers for servers does not have this limitation. Collapsing mbuf chains to reduce number of memory reads before transmitting was most effective way to workaround this. I got about 940Mbps from 850Mbps with mbuf collapsing on BCM5761. However it takes a lot of CPU cycles to collapse mbuf chains so add tunable to control the number of allowed TX buffers before collapsing. The default value is 0 which effectively disables the forced collapsing. For most cases 2 would yield best performance(about 930Mbps) without much sacrificing CPU cycles. Note the collapsing is only activated when the controller is on PCIe bus and the frame does not need TSO operation. TSO does not seem to suffer from the hardware limitation because the payload size is much bigger than normal IP datagram. Thanks to davidch@ who told me the limitation of client controllers and actually gave possible workarounds to mitigate the limitation. r200227: Remove PHY isolate/power down code in bge_stop(). The isolation handler in brgphy(4) does not exist and brgphy(4) just resets the PHY and returns EINVAL as it has no isolation handler. I also agree on Marius's opinion that stop handler of every NIC driver seems to be the wrong place for implementing PHY isolate/power down. If we need PHY isolate/power down it should be implemented in brgphy(4) and users should administratively down the PHY. r200228: Don't access jumbo frame related registers if controller lacks the feature. These registers are reserved on controllers that have no support for jumbo frame. Only BCM5700 has mini ring so do not poke mini ring related registers if controller is not BCM5700. r200246: Partially revert r200228. For mini RCB case, bge(4) still have to disable mini ring withtout regard to mini ring support. r200264: Create sysctl node(dev.bge.%d.focred_collapse) instead of hw.bge.forced_collapse. hw.bge.forced_collapse affects all bge(4) controllers on system which may not desirable behavior of the sysctl node. Also allow the sysctl node could be modified at any time. r201446: Fix regression introduced in r198318. BCM5754/BCM5754M uses the same ASIC ID of BCM5758 such that r198318 incorecctly enabled TSO on BCM5754.BCM5754M controllers. BCM5754/BCM5754M needs a special firmware to enable TSO and bge(4) does not support firmware based TSO. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Thu Jan 7 00:55:07 2010 (r201706) +++ stable/7/sys/dev/bge/if_bge.c Thu Jan 7 00:57:40 2010 (r201707) @@ -1625,7 +1625,9 @@ bge_blockinit(struct bge_softc *sc) else val = BGE_STD_RX_RING_CNT / 8; CSR_WRITE_4(sc, BGE_RBDI_STD_REPL_THRESH, val); - CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, BGE_JUMBO_RX_RING_CNT/8); + if (BGE_IS_JUMBO_CAPABLE(sc)) + CSR_WRITE_4(sc, BGE_RBDI_JUMBO_REPL_THRESH, + BGE_JUMBO_RX_RING_CNT/8); /* * Disable all unused send rings by setting the 'ring disabled' @@ -1667,8 +1669,10 @@ bge_blockinit(struct bge_softc *sc) /* Initialize RX ring indexes */ bge_writembx(sc, BGE_MBX_RX_STD_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); - bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); + if (BGE_IS_JUMBO_CAPABLE(sc)) + bge_writembx(sc, BGE_MBX_RX_JUMBO_PROD_LO, 0); + if (sc->bge_asicrev == BGE_ASICREV_BCM5700) + bge_writembx(sc, BGE_MBX_RX_MINI_PROD_LO, 0); /* * Set up RX return ring 0 @@ -2638,8 +2642,15 @@ bge_attach(device_t dev) * the TSO to the controllers that are not affected TSO issues * (e.g. 5755 or higher). */ - if (BGE_IS_5755_PLUS(sc)) - sc->bge_flags |= BGE_FLAG_TSO; + if (BGE_IS_5755_PLUS(sc)) { + /* + * BCM5754 and BCM5787 shares the same ASIC id so + * explicit device id check is required. + */ + if (pci_get_device(dev) != BCOM_DEVICEID_BCM5754 && + pci_get_device(dev) != BCOM_DEVICEID_BCM5754M) + sc->bge_flags |= BGE_FLAG_TSO; + } /* * Check if this is a PCI-X or PCI Express device. @@ -3911,6 +3922,26 @@ bge_encap(struct bge_softc *sc, struct m csum_flags |= BGE_TXBDFLAG_IP_FRAG; } + if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0 && + sc->bge_forced_collapse > 0 && + (sc->bge_flags & BGE_FLAG_PCIE) != 0 && m->m_next != NULL) { + /* + * Forcedly collapse mbuf chains to overcome hardware + * limitation which only support a single outstanding + * DMA read operation. + */ + if (sc->bge_forced_collapse == 1) + m = m_defrag(m, M_DONTWAIT); + else + m = m_collapse(m, M_DONTWAIT, sc->bge_forced_collapse); + if (m == NULL) { + m_freem(*m_head); + *m_head = NULL; + return (ENOBUFS); + } + *m_head = m; + } + map = sc->bge_cdata.bge_tx_dmamap[idx]; error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -4547,17 +4578,11 @@ static void bge_stop(struct bge_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; BGE_LOCK_ASSERT(sc); ifp = sc->bge_ifp; - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) - mii = device_get_softc(sc->bge_miibus); - callout_stop(&sc->bge_stat_ch); /* Disable host interrupts. */ @@ -4631,27 +4656,6 @@ bge_stop(struct bge_softc *sc) /* Free TX buffers. */ bge_free_tx_ring(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - if ((sc->bge_flags & BGE_FLAG_TBI) == 0) { - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - /* - * If we are called from bge_detach(), mii is already NULL. - */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - ifp->if_flags = itmp; - } - sc->bge_tx_saved_considx = BGE_TXCONS_UNSET; /* Clear MAC's link state (PHY may still have link UP). */ @@ -4857,6 +4861,26 @@ bge_add_sysctls(struct bge_softc *sc) #endif + /* + * A common design characteristic for many Broadcom client controllers + * is that they only support a single outstanding DMA read operation + * on the PCIe bus. This means that it will take twice as long to fetch + * a TX frame that is split into header and payload buffers as it does + * to fetch a single, contiguous TX frame (2 reads vs. 1 read). For + * these controllers, coalescing buffers to reduce the number of memory + * reads is effective way to get maximum performance(about 940Mbps). + * Without collapsing TX buffers the maximum TCP bulk transfer + * performance is about 850Mbps. However forcing coalescing mbufs + * consumes a lot of CPU cycles, so leave it off by default. + */ + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse", + CTLFLAG_RW, &sc->bge_forced_collapse, 0, + "Number of fragmented TX buffers of a frame allowed before " + "forced collapsing"); + resource_int_value(device_get_name(sc->bge_dev), + device_get_unit(sc->bge_dev), "forced_collapse", + &sc->bge_forced_collapse); + if (BGE_IS_5705_PLUS(sc)) return; Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Thu Jan 7 00:55:07 2010 (r201706) +++ stable/7/sys/dev/bge/if_bgereg.h Thu Jan 7 00:57:40 2010 (r201707) @@ -2647,6 +2647,7 @@ struct bge_softc { int bge_link; /* link state */ int bge_link_evt; /* pending link event */ int bge_timer; + int bge_forced_collapse; struct callout bge_stat_ch; uint32_t bge_rx_discards; uint32_t bge_tx_discards; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:10:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEC12106568F; Thu, 7 Jan 2010 01:10:50 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3278FC28; Thu, 7 Jan 2010 01:10:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071AoQN096477; Thu, 7 Jan 2010 01:10:50 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071AoeD096476; Thu, 7 Jan 2010 01:10:50 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001070110.o071AoeD096476@svn.freebsd.org> From: Kirk McKusick Date: Thu, 7 Jan 2010 01:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201708 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:10:51 -0000 Author: mckusick Date: Thu Jan 7 01:10:49 2010 New Revision: 201708 URL: http://svn.freebsd.org/changeset/base/201708 Log: Add some error messages suggested in PR bin/138043. The code to correct the problem was added in r176575 by delphij on 2008-02-25. PR: 138043 Reported by: Heikki Suonsivu Modified: head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass1.c Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Thu Jan 7 00:57:40 2010 (r201707) +++ head/sbin/fsck_ffs/main.c Thu Jan 7 01:10:49 2010 (r201708) @@ -406,7 +406,10 @@ checkfilesys(char *filesys) */ if (duplist) { if (preen || usedsoftdep) - pfatal("INTERNAL ERROR: dups with -p"); + pfatal("INTERNAL ERROR: dups with %s%s%s", + preen ? "-p" : "", + (preen && usedsoftdep) ? " and " : "", + usedsoftdep ? "softupdates" : ""); printf("** Phase 1b - Rescan For More DUPS\n"); pass1b(); } Modified: head/sbin/fsck_ffs/pass1.c ============================================================================== --- head/sbin/fsck_ffs/pass1.c Thu Jan 7 00:57:40 2010 (r201707) +++ head/sbin/fsck_ffs/pass1.c Thu Jan 7 01:10:49 2010 (r201708) @@ -98,10 +98,16 @@ pass1(void) rebuildcg = 1; if (!rebuildcg && sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; - if (inosused > sblock.fs_ipg) + if (inosused > sblock.fs_ipg) { + pfatal("%s (%d > %d) %s %d\nReset to %d\n", + "Too many initialized inodes", inosused, + sblock.fs_ipg, "in cylinder group", c, + sblock.fs_ipg); inosused = sblock.fs_ipg; - } else + } + } else { inosused = sblock.fs_ipg; + } if (got_siginfo) { printf("%s: phase 1: cyl group %d of %d (%d%%)\n", cdevname, c, sblock.fs_ncg, From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:19:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91DDA106566B; Thu, 7 Jan 2010 01:19:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67B348FC1C; Thu, 7 Jan 2010 01:19:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071J1t4098307; Thu, 7 Jan 2010 01:19:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071J1V9098305; Thu, 7 Jan 2010 01:19:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001070119.o071J1V9098305@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Jan 2010 01:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201709 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:19:01 -0000 Author: attilio Date: Thu Jan 7 01:19:01 2010 New Revision: 201709 URL: http://svn.freebsd.org/changeset/base/201709 Log: Tweak comments. Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Thu Jan 7 01:10:49 2010 (r201708) +++ head/sys/kern/kern_lock.c Thu Jan 7 01:19:01 2010 (r201709) @@ -277,6 +277,11 @@ wakeupshlk(struct lock *lk, const char * * avoid a starvation for the threads sleeping on the shared * queue by giving them precedence and cleaning up the * exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be lying about + * the real number of waiters with the LK_SLEEPFAIL flag on + * because they may be used in conjuction with interruptible + * sleeps so lk_exslpfail is consider as a 'upper limit' + * bound, considering the edge cases. */ realexslp = sleepq_sleepcnt(&lk->lock_object, SQ_EXCLUSIVE_QUEUE); @@ -943,6 +948,12 @@ __lockmgr_args(struct lock *lk, u_int fl * empty avoid a starvation for the threads sleeping * on the shared queue by giving them precedence * and cleaning up the exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be lying + * about the real number of waiters with the + * LK_SLEEPFAIL flag on because they may be used in + * conjuction with interruptible sleeps so + * lk_exslpfail is consider as a 'upper limit' bound, + * considering the edge cases. */ MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); realexslp = sleepq_sleepcnt(&lk->lock_object, @@ -1046,6 +1057,13 @@ __lockmgr_args(struct lock *lk, u_int fl * threads sleeping on the shared queue by * giving them precedence and cleaning up the * exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be + * lying about the real number of waiters with + * the LK_SLEEPFAIL flag on because they may + * be used in conjuction with interruptible + * sleeps so lk_exslpfail is consider as a + * 'upper limit' bound, considering the edge + * cases. */ if (v & LK_EXCLUSIVE_WAITERS) { queue = SQ_EXCLUSIVE_QUEUE; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:24:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C4A41065694; Thu, 7 Jan 2010 01:24:09 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BCBD8FC14; Thu, 7 Jan 2010 01:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071O92w099467; Thu, 7 Jan 2010 01:24:09 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071O9XX099465; Thu, 7 Jan 2010 01:24:09 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001070124.o071O9XX099465@svn.freebsd.org> From: Attilio Rao Date: Thu, 7 Jan 2010 01:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201710 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:24:09 -0000 Author: attilio Date: Thu Jan 7 01:24:09 2010 New Revision: 201710 URL: http://svn.freebsd.org/changeset/base/201710 Log: Fix typos. Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Thu Jan 7 01:19:01 2010 (r201709) +++ head/sys/kern/kern_lock.c Thu Jan 7 01:24:09 2010 (r201710) @@ -280,8 +280,8 @@ wakeupshlk(struct lock *lk, const char * * Please note that lk_exslpfail count may be lying about * the real number of waiters with the LK_SLEEPFAIL flag on * because they may be used in conjuction with interruptible - * sleeps so lk_exslpfail is consider as a 'upper limit' - * bound, considering the edge cases. + * sleeps so lk_exslpfail might be considered an 'upper limit' + * bound, including the edge cases. */ realexslp = sleepq_sleepcnt(&lk->lock_object, SQ_EXCLUSIVE_QUEUE); @@ -952,8 +952,8 @@ __lockmgr_args(struct lock *lk, u_int fl * about the real number of waiters with the * LK_SLEEPFAIL flag on because they may be used in * conjuction with interruptible sleeps so - * lk_exslpfail is consider as a 'upper limit' bound, - * considering the edge cases. + * lk_exslpfail might be considered an 'upper limit' + * bound, including the edge cases. */ MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); realexslp = sleepq_sleepcnt(&lk->lock_object, @@ -1061,8 +1061,8 @@ __lockmgr_args(struct lock *lk, u_int fl * lying about the real number of waiters with * the LK_SLEEPFAIL flag on because they may * be used in conjuction with interruptible - * sleeps so lk_exslpfail is consider as a - * 'upper limit' bound, considering the edge + * sleeps so lk_exslpfail might be considered + * an 'upper limit' bound, including the edge * cases. */ if (v & LK_EXCLUSIVE_WAITERS) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:55:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA711106566C; Thu, 7 Jan 2010 01:55:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8DD48FC1D; Thu, 7 Jan 2010 01:55:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071tYkU006597; Thu, 7 Jan 2010 01:55:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071tYTi006595; Thu, 7 Jan 2010 01:55:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001070155.o071tYTi006595@svn.freebsd.org> From: Xin LI Date: Thu, 7 Jan 2010 01:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201711 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:55:34 -0000 Author: delphij Date: Thu Jan 7 01:55:34 2010 New Revision: 201711 URL: http://svn.freebsd.org/changeset/base/201711 Log: MFC r176575: In pass1(), cap inosused to fs_ipg rather than allowing arbitrary number read from cylinder group. Chances that we read a smarshed cylinder group, and we can not 100% trust information it has supplied. fsck_ffs(8) will crash otherwise for some cases. PR: bin/138043 Reminded by: mckusick Modified: stable/7/sbin/fsck_ffs/pass1.c Directory Properties: stable/7/sbin/fsck_ffs/ (props changed) Modified: stable/7/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/7/sbin/fsck_ffs/pass1.c Thu Jan 7 01:24:09 2010 (r201710) +++ stable/7/sbin/fsck_ffs/pass1.c Thu Jan 7 01:55:34 2010 (r201711) @@ -93,9 +93,11 @@ pass1(void) inumber = c * sblock.fs_ipg; setinodebuf(inumber); getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); - if (sblock.fs_magic == FS_UFS2_MAGIC) + if (sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; - else + if (inosused > sblock.fs_ipg) + inosused = sblock.fs_ipg; + } else inosused = sblock.fs_ipg; if (got_siginfo) { printf("%s: phase 1: cyl group %d of %d (%d%%)\n", From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:56:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E703106566B; Thu, 7 Jan 2010 01:56:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CCB58FC17; Thu, 7 Jan 2010 01:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071uaGw006887; Thu, 7 Jan 2010 01:56:36 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071uagp006885; Thu, 7 Jan 2010 01:56:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001070156.o071uagp006885@svn.freebsd.org> From: Xin LI Date: Thu, 7 Jan 2010 01:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201712 - stable/6/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:56:36 -0000 Author: delphij Date: Thu Jan 7 01:56:35 2010 New Revision: 201712 URL: http://svn.freebsd.org/changeset/base/201712 Log: MFC r176575: In pass1(), cap inosused to fs_ipg rather than allowing arbitrary number read from cylinder group. Chances that we read a smarshed cylinder group, and we can not 100% trust information it has supplied. fsck_ffs(8) will crash otherwise for some cases. PR: bin/138043 Reminded by: mckusick Modified: stable/6/sbin/fsck_ffs/pass1.c Directory Properties: stable/6/sbin/fsck_ffs/ (props changed) Modified: stable/6/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/6/sbin/fsck_ffs/pass1.c Thu Jan 7 01:55:34 2010 (r201711) +++ stable/6/sbin/fsck_ffs/pass1.c Thu Jan 7 01:56:35 2010 (r201712) @@ -93,9 +93,11 @@ pass1(void) inumber = c * sblock.fs_ipg; setinodebuf(inumber); getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); - if (sblock.fs_magic == FS_UFS2_MAGIC) + if (sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; - else + if (inosused > sblock.fs_ipg) + inosused = sblock.fs_ipg; + } else inosused = sblock.fs_ipg; if (got_siginfo) { printf("%s: phase 1: cyl group %d of %d (%d%%)\n", From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 01:57:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6CD1065670; Thu, 7 Jan 2010 01:57:13 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79AD08FC12; Thu, 7 Jan 2010 01:57:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o071vDD8007077; Thu, 7 Jan 2010 01:57:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o071vDd6007075; Thu, 7 Jan 2010 01:57:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001070157.o071vDd6007075@svn.freebsd.org> From: Xin LI Date: Thu, 7 Jan 2010 01:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-other@freebsd.org X-SVN-Group: stable-other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201713 - stable/5/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 01:57:13 -0000 Author: delphij Date: Thu Jan 7 01:57:13 2010 New Revision: 201713 URL: http://svn.freebsd.org/changeset/base/201713 Log: MFC r176575: In pass1(), cap inosused to fs_ipg rather than allowing arbitrary number read from cylinder group. Chances that we read a smarshed cylinder group, and we can not 100% trust information it has supplied. fsck_ffs(8) will crash otherwise for some cases. PR: bin/138043 Reminded by: mckusick Modified: stable/5/sbin/fsck_ffs/pass1.c Directory Properties: stable/5/sbin/fsck_ffs/ (props changed) Modified: stable/5/sbin/fsck_ffs/pass1.c ============================================================================== --- stable/5/sbin/fsck_ffs/pass1.c Thu Jan 7 01:56:35 2010 (r201712) +++ stable/5/sbin/fsck_ffs/pass1.c Thu Jan 7 01:57:13 2010 (r201713) @@ -93,9 +93,11 @@ pass1(void) inumber = c * sblock.fs_ipg; setinodebuf(inumber); getblk(&cgblk, cgtod(&sblock, c), sblock.fs_cgsize); - if (sblock.fs_magic == FS_UFS2_MAGIC) + if (sblock.fs_magic == FS_UFS2_MAGIC) { inosused = cgrp.cg_initediblk; - else + if (inosused > sblock.fs_ipg) + inosused = sblock.fs_ipg; + } else inosused = sblock.fs_ipg; if (got_siginfo) { printf("%s: phase 1: cyl group %d of %d (%d%%)\n", From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 02:25:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22017106568F; Thu, 7 Jan 2010 02:25:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10C0F8FC0A; Thu, 7 Jan 2010 02:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o072PJqF013267; Thu, 7 Jan 2010 02:25:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o072PJjC013265; Thu, 7 Jan 2010 02:25:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001070225.o072PJjC013265@svn.freebsd.org> From: Andrew Thompson Date: Thu, 7 Jan 2010 02:25:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201714 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 02:25:20 -0000 Author: thompsa Date: Thu Jan 7 02:25:19 2010 New Revision: 201714 URL: http://svn.freebsd.org/changeset/base/201714 Log: Fix debug printf on 64bit arches. Spotted by: b. f. Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Thu Jan 7 01:57:13 2010 (r201713) +++ head/sys/dev/usb/usb_msctest.c Thu Jan 7 02:25:19 2010 (r201714) @@ -468,7 +468,7 @@ bbb_command_start(struct bbb_transfer *s sc->cmd_len = cmd_len; bzero(&sc->cbw.CBWCDB, sizeof(sc->cbw.CBWCDB)); bcopy(cmd_ptr, &sc->cbw.CBWCDB, cmd_len); - DPRINTFN(1, "SCSI cmd = %*D\n", cmd_len, &sc->cbw.CBWCDB, ":"); + DPRINTFN(1, "SCSI cmd = %*D\n", (int)cmd_len, &sc->cbw.CBWCDB, ":"); mtx_lock(&sc->mtx); usbd_transfer_start(sc->xfer[sc->state]); From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 04:15:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5571065696; Thu, 7 Jan 2010 04:15:49 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAB48FC1C; Thu, 7 Jan 2010 04:15:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o074Fn8X037683; Thu, 7 Jan 2010 04:15:49 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o074Fnvw037680; Thu, 7 Jan 2010 04:15:49 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001070415.o074Fnvw037680@svn.freebsd.org> From: David Xu Date: Thu, 7 Jan 2010 04:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201715 - in head: lib/libc/gen tools/regression/posixsem2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 04:15:49 -0000 Author: davidxu Date: Thu Jan 7 04:15:49 2010 New Revision: 201715 URL: http://svn.freebsd.org/changeset/base/201715 Log: Don't forget to use fourth argument if O_CREAT is set in argument oflag. The fourth specifies initial value for the semaphore. Modified: head/lib/libc/gen/sem_new.c head/tools/regression/posixsem2/semtest.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Thu Jan 7 02:25:19 2010 (r201714) +++ head/lib/libc/gen/sem_new.c Thu Jan 7 04:15:49 2010 (r201715) @@ -143,6 +143,7 @@ _sem_open(const char *name, int flags, . struct sem_nameinfo *ni = NULL; sem_t *sem = NULL; int fd = -1, mode, len; + int value = 0; if (name[0] != '/') { errno = EINVAL; @@ -170,6 +171,7 @@ _sem_open(const char *name, int flags, . if (flags & O_CREAT) { va_start(ap, flags); mode = va_arg(ap, int); + value = va_arg(ap, int); va_end(ap); } @@ -203,7 +205,7 @@ _sem_open(const char *name, int flags, . tmp._magic = SEM_MAGIC; tmp._kern._has_waiters = 0; - tmp._kern._count = 0; + tmp._kern._count = value; tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED; if (_write(fd, &tmp, sizeof(tmp)) != sizeof(tmp)) { flock(fd, LOCK_UN); Modified: head/tools/regression/posixsem2/semtest.c ============================================================================== --- head/tools/regression/posixsem2/semtest.c Thu Jan 7 02:25:19 2010 (r201714) +++ head/tools/regression/posixsem2/semtest.c Thu Jan 7 04:15:49 2010 (r201715) @@ -58,10 +58,10 @@ test_named(void) printf("testing named process-shared semaphore\n"); sem_unlink(SEM_NAME); - s = sem_open(SEM_NAME, O_CREAT, 0777); + s = sem_open(SEM_NAME, O_CREAT, 0777, 0); if (s == SEM_FAILED) err(1, "sem_open failed"); - s2 = sem_open(SEM_NAME, O_CREAT, 0777); + s2 = sem_open(SEM_NAME, O_CREAT, 0777, 0); if (s2 == SEM_FAILED) err(2, "second sem_open call failed"); if (s != s2) From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 04:47:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1F51065672; Thu, 7 Jan 2010 04:47:09 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA0748FC19; Thu, 7 Jan 2010 04:47:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o074l9m3044656; Thu, 7 Jan 2010 04:47:09 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o074l918044653; Thu, 7 Jan 2010 04:47:09 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001070447.o074l918044653@svn.freebsd.org> From: Alan Cox Date: Thu, 7 Jan 2010 04:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201716 - in head/sys/i386: i386 xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 04:47:09 -0000 Author: alc Date: Thu Jan 7 04:47:09 2010 New Revision: 201716 URL: http://svn.freebsd.org/changeset/base/201716 Log: Eliminate unused variables (see r137912). Modified: head/sys/i386/i386/locore.s head/sys/i386/xen/locore.s Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Thu Jan 7 04:15:49 2010 (r201715) +++ head/sys/i386/i386/locore.s Thu Jan 7 04:47:09 2010 (r201716) @@ -110,9 +110,7 @@ IdlePDPT: .long 0 /* phys addr of kerne KPTphys: .long 0 /* phys addr of kernel page tables */ .globl proc0kstack -proc0uarea: .long 0 /* address of proc 0 uarea (unused)*/ proc0kstack: .long 0 /* address of proc 0 kstack space */ -p0upa: .long 0 /* phys addr of proc0 UAREA (unused) */ p0kpa: .long 0 /* phys addr of proc0's STACK */ vm86phystk: .long 0 /* PA of vm86/bios stack */ Modified: head/sys/i386/xen/locore.s ============================================================================== --- head/sys/i386/xen/locore.s Thu Jan 7 04:15:49 2010 (r201715) +++ head/sys/i386/xen/locore.s Thu Jan 7 04:47:09 2010 (r201716) @@ -152,9 +152,7 @@ KPTphys: .long 0 /* phys addr of kernel gdtset: .long 0 /* GDT is valid */ .globl proc0kstack -proc0uarea: .long 0 /* address of proc 0 uarea (unused)*/ proc0kstack: .long 0 /* address of proc 0 kstack space */ -p0upa: .long 0 /* phys addr of proc0 UAREA (unused) */ p0kpa: .long 0 /* phys addr of proc0's STACK */ vm86phystk: .long 0 /* PA of vm86/bios stack */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 05:04:15 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5588A1065693; Thu, 7 Jan 2010 05:04:15 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 888B48FC1A; Thu, 7 Jan 2010 05:04:14 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o0754CGd085737; Thu, 7 Jan 2010 08:04:12 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1262840652; bh=l3kyg3rPFbynmV0cAUesUeu3I4E8lSugddtOu/ECFAY=; l=1078; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=fyjlfFU9Cpor/queBDrjGZ9Nt6qFpZ0iPaJfUW4Uqi+vrojgiDn9pb8SPqc+xULZU RqriVa7rk90fXekuNf1BS8+LI0bM+hU08yoQ1BN9QlB2mSpI9mnk3eUaU5WrlaUawy rX/5LEwH0bCL3cmwDUGdkCu4nzySHmsWBRNQRtZ4= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o0754Bx7085736; Thu, 7 Jan 2010 08:04:11 +0300 (MSK) (envelope-from ache) Date: Thu, 7 Jan 2010 08:04:10 +0300 From: Andrey Chernov To: Konstantin Belousov Message-ID: <20100107050409.GA85573@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Konstantin Belousov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201001052020.o05KKVEp002337@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001052020.o05KKVEp002337@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 05:04:15 -0000 On Tue, Jan 05, 2010 at 08:20:31PM +0000, Konstantin Belousov wrote: > * Alphabetic order comparison routine for those who want it. > + * > + * XXXKIB POSIX 2008 requires the alphasort() to use strcoll(). Keep > + * strcmp() for now, since environment locale settings could have no > + * relevance for the byte sequence of the file name. Moreover, it > + * might be even invalid sequence in current locale, and then > + * behaviour of alphasort would be undefined. > */ This is wrong turn. Exact the same can be said about text files: "environment locale settings could have no relevance for the byte sequence of the text. Moreover, it might be even invalid sequence in current locale, and then behaviour of sort would be undefined". Despite of this, we use localized sort in the system. You made result of something like 'ls | sort' and alphasort() differs. Please use strcoll() as POSIX said. It is user responsibility to set correct locale for non-suid programs, and for suid ones locale can't be set by user. -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 06:20:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF64D1065672; Thu, 7 Jan 2010 06:20:07 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD63F8FC21; Thu, 7 Jan 2010 06:20:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o076K7Ba064980; Thu, 7 Jan 2010 06:20:07 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o076K7uA064978; Thu, 7 Jan 2010 06:20:07 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201001070620.o076K7uA064978@svn.freebsd.org> From: Kirk McKusick Date: Thu, 7 Jan 2010 06:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201717 - head/sys/ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 06:20:08 -0000 Author: mckusick Date: Thu Jan 7 06:20:07 2010 New Revision: 201717 URL: http://svn.freebsd.org/changeset/base/201717 Log: KASSERT that condition raised by Coverity cannot happen. Found by: Coverity Prevent (tm) KASSERT by: sam Modified: head/sys/ufs/ufs/ufs_dirhash.c Modified: head/sys/ufs/ufs/ufs_dirhash.c ============================================================================== --- head/sys/ufs/ufs/ufs_dirhash.c Thu Jan 7 04:47:09 2010 (r201716) +++ head/sys/ufs/ufs/ufs_dirhash.c Thu Jan 7 06:20:07 2010 (r201717) @@ -632,6 +632,7 @@ restart: goto fail; } } + KASSERT(bp != NULL, ("no buffer allocated")); dp = (struct direct *)(bp->b_data + (offset & bmask)); if (dp->d_reclen == 0 || dp->d_reclen > DIRBLKSIZ - (offset & (DIRBLKSIZ - 1))) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:02:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5583F1065679; Thu, 7 Jan 2010 09:02:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439428FC27; Thu, 7 Jan 2010 09:02:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0792VQf001043; Thu, 7 Jan 2010 09:02:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0792VFw001042; Thu, 7 Jan 2010 09:02:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001070902.o0792VFw001042@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jan 2010 09:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201719 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:02:31 -0000 Author: mav Date: Thu Jan 7 09:02:30 2010 New Revision: 201719 URL: http://svn.freebsd.org/changeset/base/201719 Log: MFC r200353: Limit maximum I/O size, depending on command set supported by device. It is required to suppot non-LBA48 devices with MAXPHYS above 128K. Modified: stable/7/sys/dev/ata/ata-disk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-disk.c ============================================================================== --- stable/7/sys/dev/ata/ata-disk.c Thu Jan 7 06:59:16 2010 (r201718) +++ stable/7/sys/dev/ata/ata-disk.c Thu Jan 7 09:02:30 2010 (r201719) @@ -155,6 +155,10 @@ ad_attach(device_t dev) adp->disk->d_maxsize = ch->dma->max_iosize; else adp->disk->d_maxsize = DFLTPHYS; + if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 65536 * DEV_BSIZE); + else /* 28bit ATA command limit */ + adp->disk->d_maxsize = min(adp->disk->d_maxsize, 256 * DEV_BSIZE); adp->disk->d_sectorsize = DEV_BSIZE; adp->disk->d_mediasize = DEV_BSIZE * (off_t)adp->total_secs; adp->disk->d_fwsectors = adp->sectors; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:07:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 860E71065670; Thu, 7 Jan 2010 09:07:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74D868FC13; Thu, 7 Jan 2010 09:07:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0797pbK002302; Thu, 7 Jan 2010 09:07:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0797pxY002300; Thu, 7 Jan 2010 09:07:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001070907.o0797pxY002300@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jan 2010 09:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201720 - stable/7/sys/dev/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:07:51 -0000 Author: mav Date: Thu Jan 7 09:07:51 2010 New Revision: 201720 URL: http://svn.freebsd.org/changeset/base/201720 Log: MFC rev. 198487: Round timeout up when converting CAM milliseconds to ATA seconds. Modified: stable/7/sys/dev/ata/atapi-cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/atapi-cam.c ============================================================================== --- stable/7/sys/dev/ata/atapi-cam.c Thu Jan 7 09:02:30 2010 (r201719) +++ stable/7/sys/dev/ata/atapi-cam.c Thu Jan 7 09:07:51 2010 (r201720) @@ -633,7 +633,7 @@ atapi_action(struct cam_sim *sim, union request->data = buf; request->bytecount = len; request->transfersize = min(request->bytecount, 65534); - request->timeout = ccb_h->timeout / 1000; /* XXX lost granularity */ + request->timeout = (ccb_h->timeout + 999) / 1000; request->callback = &atapi_cb; request->flags = request_flags; @@ -738,7 +738,7 @@ atapi_cb(struct ata_request *request) request->data = (caddr_t)&csio->sense_data; request->bytecount = sizeof(struct atapi_sense); request->transfersize = min(request->bytecount, 65534); - request->timeout = csio->ccb_h.timeout / 1000; + request->timeout = (csio->ccb_h.timeout + 999) / 1000; request->retries = 2; request->flags = ATA_R_QUIET|ATA_R_ATAPI|ATA_R_IMMEDIATE; hcb->flags |= AUTOSENSE; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:21:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C74D1065672; Thu, 7 Jan 2010 09:21:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF50F8FC0A; Thu, 7 Jan 2010 09:21:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079LDm2005455; Thu, 7 Jan 2010 09:21:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079LDF2005453; Thu, 7 Jan 2010 09:21:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001070921.o079LDF2005453@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jan 2010 09:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201721 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:21:14 -0000 Author: mav Date: Thu Jan 7 09:21:13 2010 New Revision: 201721 URL: http://svn.freebsd.org/changeset/base/201721 Log: MFC r200668: Remove duplicate devstat_start_transaction_bio() call. It is already called from geom_disk. Dulicate call causes wrong queue depth and busy accounting. Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Thu Jan 7 09:07:51 2010 (r201720) +++ stable/7/sys/cam/scsi/scsi_cd.c Thu Jan 7 09:21:13 2010 (r201721) @@ -1454,8 +1454,6 @@ cdstart(struct cam_periph *periph, union } else { bioq_remove(&softc->bio_queue, bp); - devstat_start_transaction_bio(softc->disk->d_devstat, bp); - scsi_read_write(&start_ccb->csio, /*retries*/cd_retry_count, /* cbfcnp */ cddone, From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:28:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3DD5106566C; Thu, 7 Jan 2010 09:28:17 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 939708FC15; Thu, 7 Jan 2010 09:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079SHqZ007079; Thu, 7 Jan 2010 09:28:17 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079SHKU007077; Thu, 7 Jan 2010 09:28:17 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001070928.o079SHKU007077@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 09:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201722 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:28:17 -0000 Author: luigi Date: Thu Jan 7 09:28:17 2010 New Revision: 201722 URL: http://svn.freebsd.org/changeset/base/201722 Log: put ip_len in correct order for ip_output(). This prevents a panic when ipfw generates packets on its own (such as reject or keepalives for dynamic rules). Reported by: Chagin Dmitry Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Thu Jan 7 09:21:13 2010 (r201721) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Thu Jan 7 09:28:17 2010 (r201722) @@ -1002,7 +1002,8 @@ ipfw_send_pkt(struct mbuf *replyto, stru h->ip_hl = sizeof(*h) >> 2; h->ip_tos = IPTOS_LOWDELAY; h->ip_off = 0; - h->ip_len = htons(len); + /* ip_len must be in host format for ip_output */ + h->ip_len = len; h->ip_ttl = V_ip_defttl; h->ip_sum = 0; break; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:37:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAA231065672; Thu, 7 Jan 2010 09:37:59 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D56E58FC1D; Thu, 7 Jan 2010 09:37:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079bxpc009535; Thu, 7 Jan 2010 09:37:59 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079bxHC009520; Thu, 7 Jan 2010 09:37:59 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001070937.o079bxHC009520@svn.freebsd.org> From: Alexander Leidinger Date: Thu, 7 Jan 2010 09:37:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201723 - in stable/7/sys/cddl: compat/opensolaris/sys contrib/opensolaris/uts/common/fs contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/fs/zfs/sys contrib/opensola... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:38:00 -0000 Author: netchild Date: Thu Jan 7 09:37:59 2010 New Revision: 201723 URL: http://svn.freebsd.org/changeset/base/201723 Log: MFC several ZFS related commits: r197459: ---snip--- Before calling vflush(FORCECLOSE) mark file system as unmounted so the following vnops will fail. This is very important, because without this change vnode could be reclaimed at any point, even if we increased usecount. The only way to ensure that vnode won't be reclaimed was to lock it, which would be very hard to do in ZFS without changing a lot of code. With this change simply increasing usecount is enough to be sure vnode won't be reclaimed from under us. To be precise it can still be reclaimed but we won't be able to see it, because every try to enter ZFS through VFS will result in EIO. The only function that cannot return EIO, because it is needed for vflush() is zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks z_teardown_lock and never returns EIO. ---snip--- r197512: ---snip--- - Don't depend on value returned by gfs_*_inactive(), it doesn't work well with forced unmounts when GFS vnodes are referenced. - Make other preparations to GFS for forced unmounts. PR: kern/139062 Reported by: trasz ---snip--- r197513: ---snip--- Use traverse() function to find and return mount point's vnode instead of cov ered vnode when snapshot is already mounted. ---snip--- r197513: ---snip--- Handle cases where virtual (GFS) vnodes are referenced when doing forced unmount. In that case we cannot depend on the proper order of invalidating vnodes, so we have to free resources when we have a chance. PR: kern/139062 Reported by: trasz ---snip--- r197683: ---snip--- Return EOPNOTSUPP instead of EINVAL when doing chflags(2) over an old format ZFS, as defined in the manual page. Submitted by: pjd (response of my original patch but bugs are mine) ---snip--- r198703: ---snip--- - zfs_zaccess() can handle VAPPEND too, so map V_APPEND to VAPPEND and call zfs_access() instead of vaccess() in this case as well. - If VADMIN is specified with another V* flag (unlikely) call both zfs_access() and vaccess() after spliting V* flags. This fixes "dirtying snapshot!" panic. PR: kern/139806 Reported by: Carl Chave In co-operation with: jh ---snip--- While I'm here: fix two comments regarding the members of vop_access_args to comply what is in RELENG_7. r199156: ---snip--- Avoid passing invalid mountpoint to getnewvnode(). Reported by: rwatson Tested by: rwatson ---snip--- r200724: ---snip--- Apply fix Solaris bug 6462803 zfs snapshot -r failed because filesystem was busy. (onnv-gate revision 8989) Submitted by: mm Approved by: pjd ---snip--- r200726: ---snip--- Apply fix for Solaris bug 6801979: zfs recv can fail with E2BIG (onnv revision 8986) Requested by: mm Submitted by: pjd Obtained from: OpenSolaris ---snip--- r200727 (following is the corrected commit log): ---snip--- Apply fix for Solaris bug 6764159: restore_object() makes a call that can block while having a tx open but not yet committed (onnv revision 7994) Submitted by: mm Obtained from: OpenSolaris ---snip--- Modified: stable/7/sys/cddl/compat/opensolaris/sys/vnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 09:37:59 2010 (r201723) @@ -57,6 +57,8 @@ typedef struct vop_vector vnodeops_t; #define v_count v_usecount +#define V_APPEND VAPPEND + static __inline int vn_is_readonly(vnode_t *vp) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Thu Jan 7 09:37:59 2010 (r201723) @@ -595,7 +595,6 @@ found: if (vp->v_flag & V_XATTRDIR) VI_LOCK(fp->gfs_parent); VI_LOCK(vp); - ASSERT(vp->v_count < 2); /* * Really remove this vnode */ @@ -607,12 +606,7 @@ found: */ ge->gfse_vnode = NULL; } - if (vp->v_count == 1) { - vp->v_usecount--; - vdropl(vp); - } else { - VI_UNLOCK(vp); - } + VI_UNLOCK(vp); /* * Free vnode and release parent @@ -1084,18 +1078,16 @@ gfs_vop_inactive(ap) { vnode_t *vp = ap->a_vp; gfs_file_t *fp = vp->v_data; - void *data; if (fp->gfs_type == GFS_DIR) - data = gfs_dir_inactive(vp); + gfs_dir_inactive(vp); else - data = gfs_file_inactive(vp); - - if (data != NULL) - kmem_free(data, fp->gfs_size); + gfs_file_inactive(vp); VI_LOCK(vp); vp->v_data = NULL; VI_UNLOCK(vp); + kmem_free(fp, fp->gfs_size); + return (0); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Thu Jan 7 09:37:59 2010 (r201723) @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #include #include @@ -108,19 +106,51 @@ dmu_object_claim(objset_t *os, uint64_t int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) + int blocksize, dmu_object_type_t bonustype, int bonuslen) { dnode_t *dn; + dmu_tx_t *tx; + int nblkptr; int err; - if (object == DMU_META_DNODE_OBJECT && !dmu_tx_private_ok(tx)) + if (object == DMU_META_DNODE_OBJECT) return (EBADF); err = dnode_hold_impl(os->os, object, DNODE_MUST_BE_ALLOCATED, FTAG, &dn); if (err) return (err); + + if (dn->dn_type == ot && dn->dn_datablksz == blocksize && + dn->dn_bonustype == bonustype && dn->dn_bonuslen == bonuslen) { + /* nothing is changing, this is a noop */ + dnode_rele(dn, FTAG); + return (0); + } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + dnode_rele(dn, FTAG); + return (err); + } + + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); + + /* + * If we are losing blkptrs or changing the block size this must + * be a new file instance. We must clear out the previous file + * contents before we can change this type of metadata in the dnode. + */ + if (dn->dn_nblkptr > nblkptr || dn->dn_datablksz != blocksize) + dmu_free_long_range(os, object, 0, DMU_OBJECT_END); + dnode_reallocate(dn, ot, blocksize, bonustype, bonuslen, tx); + + dmu_tx_commit(tx); + dnode_rele(dn, FTAG); return (0); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Jan 7 09:37:59 2010 (r201723) @@ -828,11 +828,7 @@ restore_object(struct restorearg *ra, ob { int err; dmu_tx_t *tx; - - err = dmu_object_info(os, drro->drr_object, NULL); - - if (err != 0 && err != ENOENT) - return (EINVAL); + void *data = NULL; if (drro->drr_type == DMU_OT_NONE || drro->drr_type >= DMU_OT_NUMTYPES || @@ -846,12 +842,15 @@ restore_object(struct restorearg *ra, ob return (EINVAL); } - tx = dmu_tx_create(os); + err = dmu_object_info(os, drro->drr_object, NULL); + + if (err != 0 && err != ENOENT) + return (EINVAL); if (err == ENOENT) { /* currently free, want to be allocated */ + tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, DMU_NEW_OBJECT); - dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, 1); err = dmu_tx_assign(tx, TXG_WAIT); if (err) { dmu_tx_abort(tx); @@ -860,45 +859,41 @@ restore_object(struct restorearg *ra, ob err = dmu_object_claim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen, tx); + dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - dmu_tx_hold_bonus(tx, drro->drr_object); - /* - * We may change blocksize and delete old content, - * so need to hold_write and hold_free. - */ - dmu_tx_hold_write(tx, drro->drr_object, 0, 1); - dmu_tx_hold_free(tx, drro->drr_object, 0, DMU_OBJECT_END); - err = dmu_tx_assign(tx, TXG_WAIT); - if (err) { - dmu_tx_abort(tx); - return (err); - } err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, - drro->drr_bonustype, drro->drr_bonuslen, tx); + drro->drr_bonustype, drro->drr_bonuslen); } - if (err) { - dmu_tx_commit(tx); + if (err) return (EINVAL); + + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + + tx = dmu_tx_create(os); + dmu_tx_hold_bonus(tx, drro->drr_object); + err = dmu_tx_assign(tx, TXG_WAIT); + if (err) { + dmu_tx_abort(tx); + return (err); } dmu_object_set_checksum(os, drro->drr_object, drro->drr_checksum, tx); dmu_object_set_compress(os, drro->drr_object, drro->drr_compress, tx); - if (drro->drr_bonuslen) { + if (data != NULL) { dmu_buf_t *db; - void *data; + VERIFY(0 == dmu_bonus_hold(os, drro->drr_object, FTAG, &db)); dmu_buf_will_dirty(db, tx); ASSERT3U(db->db_size, >=, drro->drr_bonuslen); - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (data == NULL) { - dmu_tx_commit(tx); - return (ra->err); - } bcopy(data, db->db_data, drro->drr_bonuslen); if (ra->byteswap) { dmu_ot[drro->drr_bonustype].ot_byteswap(db->db_data, Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Jan 7 09:37:59 2010 (r201723) @@ -415,8 +415,7 @@ void dnode_reallocate(dnode_t *dn, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { - int i, nblkptr; - dmu_buf_impl_t *db = NULL; + int nblkptr; ASSERT3U(blocksize, >=, SPA_MINBLOCKSIZE); ASSERT3U(blocksize, <=, SPA_MAXBLOCKSIZE); @@ -428,42 +427,25 @@ dnode_reallocate(dnode_t *dn, dmu_object ASSERT3U(bonustype, <, DMU_OT_NUMTYPES); ASSERT3U(bonuslen, <=, DN_MAX_BONUSLEN); - for (i = 0; i < TXG_SIZE; i++) - ASSERT(!list_link_active(&dn->dn_dirty_link[i])); - /* clean up any unreferenced dbufs */ dnode_evict_dbufs(dn); - ASSERT3P(list_head(&dn->dn_dbufs), ==, NULL); - - /* - * XXX I should really have a generation number to tell if we - * need to do this... - */ - if (blocksize != dn->dn_datablksz || - dn->dn_bonustype != bonustype || dn->dn_bonuslen != bonuslen) { - /* free all old data */ - dnode_free_range(dn, 0, -1ULL, tx); - } - - nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); - /* change blocksize */ rw_enter(&dn->dn_struct_rwlock, RW_WRITER); - if (blocksize != dn->dn_datablksz && - (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || - list_head(&dn->dn_dbufs) != NULL)) { - db = dbuf_hold(dn, 0, FTAG); - dbuf_new_size(db, blocksize, tx); - } - dnode_setdblksz(dn, blocksize); dnode_setdirty(dn, tx); - dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; - dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + if (dn->dn_datablksz != blocksize) { + /* change blocksize */ + ASSERT(dn->dn_maxblkid == 0 && + (BP_IS_HOLE(&dn->dn_phys->dn_blkptr[0]) || + dnode_block_freed(dn, 0))); + dnode_setdblksz(dn, blocksize); + dn->dn_next_blksz[tx->tx_txg&TXG_MASK] = blocksize; + } + if (dn->dn_bonuslen != bonuslen) + dn->dn_next_bonuslen[tx->tx_txg&TXG_MASK] = bonuslen; + nblkptr = 1 + ((DN_MAX_BONUSLEN - bonuslen) >> SPA_BLKPTRSHIFT); if (dn->dn_nblkptr != nblkptr) dn->dn_next_nblkptr[tx->tx_txg&TXG_MASK] = nblkptr; rw_exit(&dn->dn_struct_rwlock); - if (db) - dbuf_rele(db, FTAG); /* change type */ dn->dn_type = ot; @@ -1187,11 +1169,6 @@ dnode_block_freed(dnode_t *dn, uint64_t if (dn->dn_free_txg) return (TRUE); - /* - * If dn_datablkshift is not set, then there's only a single - * block, in which case there will never be a free range so it - * won't matter. - */ range_tofind.fr_blkid = blkid; mutex_enter(&dn->dn_mtx); for (i = 0; i < TXG_SIZE; i++) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Thu Jan 7 09:37:59 2010 (r201723) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -237,7 +237,7 @@ uint64_t dmu_object_alloc(objset_t *os, int dmu_object_claim(objset_t *os, uint64_t object, dmu_object_type_t ot, int blocksize, dmu_object_type_t bonus_type, int bonus_len, dmu_tx_t *tx); int dmu_object_reclaim(objset_t *os, uint64_t object, dmu_object_type_t ot, - int blocksize, dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx); + int blocksize, dmu_object_type_t bonustype, int bonuslen); /* * Free an object from this objset. Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jan 7 09:37:59 2010 (r201723) @@ -255,6 +255,7 @@ VTOZ(vnode_t *vp) /* * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. + * ZFS_ENTER_NOERROR() is called when we can't return EIO. * ZFS_EXIT() must be called before exitting the vop. * ZFS_VERIFY_ZP() verifies the znode is valid. */ @@ -267,6 +268,9 @@ VTOZ(vnode_t *vp) } \ } +#define ZFS_ENTER_NOERROR(zfsvfs) \ + rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) + #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) #define ZFS_VERIFY_ZP(zp) \ Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Thu Jan 7 09:37:59 2010 (r201723) @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -56,10 +56,16 @@ typedef struct zil_header { uint64_t zh_replay_seq; /* highest replayed sequence number */ blkptr_t zh_log; /* log chain */ uint64_t zh_claim_seq; /* highest claimed sequence number */ - uint64_t zh_pad[5]; + uint64_t zh_flags; /* header flags */ + uint64_t zh_pad[4]; } zil_header_t; /* + * zh_flags bit settings + */ +#define ZIL_REPLAY_NEEDED 0x1 /* replay needed - internal only */ + +/* * Log block trailer - structure at the end of the header and each log block * * The zit_bt contains a zbt_cksum which for the intent log is Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 09:37:59 2010 (r201723) @@ -252,7 +252,7 @@ static int zfsctl_common_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_accmode; + int a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; @@ -817,7 +817,11 @@ zfsctl_snapdir_lookup(ap) if ((sep = avl_find(&sdp->sd_snaps, &search, &where)) != NULL) { *vpp = sep->se_root; VN_HOLD(*vpp); - if ((*vpp)->v_mountedhere == NULL) { + err = traverse(vpp, LK_EXCLUSIVE | LK_RETRY); + if (err) { + VN_RELE(*vpp); + *vpp = NULL; + } else if (*vpp == sep->se_root) { /* * The snapshot was unmounted behind our backs, * try to remount it. @@ -831,10 +835,9 @@ zfsctl_snapdir_lookup(ap) */ (*vpp)->v_flag &= ~VROOT; } - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread); mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); - return (0); + return (err); } /* @@ -1001,15 +1004,24 @@ zfsctl_snapdir_inactive(ap) { vnode_t *vp = ap->a_vp; zfsctl_snapdir_t *sdp = vp->v_data; - void *private; + zfs_snapentry_t *sep; - private = gfs_dir_inactive(vp); - if (private != NULL) { - ASSERT(avl_numnodes(&sdp->sd_snaps) == 0); - mutex_destroy(&sdp->sd_lock); - avl_destroy(&sdp->sd_snaps); - kmem_free(private, sizeof (zfsctl_snapdir_t)); + /* + * On forced unmount we have to free snapshots from here. + */ + mutex_enter(&sdp->sd_lock); + while ((sep = avl_first(&sdp->sd_snaps)) != NULL) { + avl_remove(&sdp->sd_snaps, sep); + kmem_free(sep->se_name, strlen(sep->se_name) + 1); + kmem_free(sep, sizeof (zfs_snapentry_t)); } + mutex_exit(&sdp->sd_lock); + gfs_dir_inactive(vp); + ASSERT(avl_numnodes(&sdp->sd_snaps) == 0); + mutex_destroy(&sdp->sd_lock); + avl_destroy(&sdp->sd_snaps); + kmem_free(sdp, sizeof (zfsctl_snapdir_t)); + return (0); } @@ -1066,6 +1078,9 @@ zfsctl_snapshot_inactive(ap) int locked; vnode_t *dvp; + if (vp->v_count > 0) + goto end; + VERIFY(gfs_dir_lookup(vp, "..", &dvp, cr, 0, NULL, NULL) == 0); sdp = dvp->v_data; VOP_UNLOCK(dvp, 0, curthread); @@ -1073,11 +1088,6 @@ zfsctl_snapshot_inactive(ap) if (!(locked = MUTEX_HELD(&sdp->sd_lock))) mutex_enter(&sdp->sd_lock); - if (vp->v_count > 1) { - if (!locked) - mutex_exit(&sdp->sd_lock); - return (0); - } ASSERT(!vn_ismntpt(vp)); sep = avl_first(&sdp->sd_snaps); @@ -1097,6 +1107,7 @@ zfsctl_snapshot_inactive(ap) if (!locked) mutex_exit(&sdp->sd_lock); VN_RELE(dvp); +end: VFS_RELE(vp->v_vfsp); /* Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 09:37:59 2010 (r201723) @@ -872,7 +872,7 @@ zfs_root(vfs_t *vfsp, int flags, vnode_t znode_t *rootzp; int error; - ZFS_ENTER(zfsvfs); + ZFS_ENTER_NOERROR(zfsvfs); error = zfs_zget(zfsvfs, zfsvfs->z_root, &rootzp); if (error == 0) { @@ -1045,6 +1045,17 @@ zfs_umount(vfs_t *vfsp, int fflag, kthre ASSERT(zfsvfs->z_ctldir == NULL); } + if (fflag & MS_FORCE) { + /* + * Mark file system as unmounted before calling + * vflush(FORCECLOSE). This way we ensure no future vnops + * will be called and risk operating on DOOMED vnodes. + */ + rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + zfsvfs->z_unmounted = B_TRUE; + rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + } + /* * Flush all the files. */ @@ -1111,10 +1122,7 @@ zfs_umount(vfs_t *vfsp, int fflag, kthre if (zfsvfs->z_issnap) { vnode_t *svp = vfsp->mnt_vnodecovered; - /* - * We don't need an extra vn_rele if this is a manual snapshot mount - */ - if (svp->v_count == 2) + if (svp->v_count >= 2) VN_RELE(svp); } zfs_freevfs(vfsp); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 09:37:59 2010 (r201723) @@ -3964,26 +3964,38 @@ static int zfs_freebsd_access(ap) struct vop_access_args /* { struct vnode *a_vp; - accmode_t a_accmode; + accmode_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { + accmode_t accmode; + int error = 0; /* - * ZFS itself only knowns about VREAD, VWRITE and VEXEC, the rest - * we have to handle by calling vaccess(). + * ZFS itself only knowns about VREAD, VWRITE, VEXEC and VAPPEND, */ - if ((ap->a_mode & ~(VREAD|VWRITE|VEXEC)) != 0) { - vnode_t *vp = ap->a_vp; - znode_t *zp = VTOZ(vp); - znode_phys_t *zphys = zp->z_phys; + accmode = ap->a_mode & (VREAD|VWRITE|VEXEC|VAPPEND); + if (accmode != 0) + error = zfs_access(ap->a_vp, accmode, 0, ap->a_cred, NULL); - return (vaccess(vp->v_type, zphys->zp_mode, zphys->zp_uid, - zphys->zp_gid, ap->a_mode, ap->a_cred, NULL)); + /* + * VADMIN has to be handled by vaccess(). + */ + if (error == 0) { + accmode = ap->a_mode & ~(VREAD|VWRITE|VEXEC|VAPPEND); + if (accmode != 0) { + vnode_t *vp = ap->a_vp; + znode_t *zp = VTOZ(vp); + znode_phys_t *zphys = zp->z_phys; + + error = vaccess(vp->v_type, zphys->zp_mode, + zphys->zp_uid, zphys->zp_gid, accmode, ap->a_cred, + NULL); + } } - return (zfs_access(ap->a_vp, ap->a_mode, 0, ap->a_cred, NULL)); + return (error); } static int @@ -4176,8 +4188,12 @@ zfs_freebsd_setattr(ap) zflags = VTOZ(vp)->z_phys->zp_flags; if (vap->va_flags != VNOVAL) { + zfsvfs_t *zfsvfs = VTOZ(vp)->z_zfsvfs; int error; + if (zfsvfs->z_use_fuids == B_FALSE) + return (EOPNOTSUPP); + fflags = vap->va_flags; if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0) return (EOPNOTSUPP); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jan 7 09:37:59 2010 (r201723) @@ -143,16 +143,19 @@ zfs_znode_cache_constructor(void *buf, v POINTER_INVALIDATE(&zp->z_zfsvfs); ASSERT(!POINTER_IS_VALID(zp->z_zfsvfs)); - ASSERT(vfsp != NULL); - error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); - if (error != 0 && (kmflags & KM_NOSLEEP)) - return (-1); - ASSERT(error == 0); - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); - zp->z_vnode = vp; - vp->v_data = (caddr_t)zp; - VN_LOCK_AREC(vp); + if (vfsp != NULL) { + error = getnewvnode("zfs", vfsp, &zfs_vnodeops, &vp); + if (error != 0 && (kmflags & KM_NOSLEEP)) + return (-1); + ASSERT(error == 0); + vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); + zp->z_vnode = vp; + vp->v_data = (caddr_t)zp; + VN_LOCK_AREC(vp); + } else { + zp->z_vnode = NULL; + } list_link_init(&zp->z_link_node); @@ -1441,7 +1444,7 @@ zfs_create_fs(objset_t *os, cred_t *cr, nvpair_t *elem; int error; znode_t *rootzp = NULL; - vnode_t *vp; + vnode_t vnode; vattr_t vattr; znode_t *zp; @@ -1510,13 +1513,13 @@ zfs_create_fs(objset_t *os, cred_t *cr, vattr.va_gid = crgetgid(cr); rootzp = kmem_cache_alloc(znode_cache, KM_SLEEP); - zfs_znode_cache_constructor(rootzp, &zfsvfs, 0); + zfs_znode_cache_constructor(rootzp, NULL, 0); rootzp->z_unlinked = 0; rootzp->z_atime_dirty = 0; - vp = ZTOV(rootzp); - vp->v_type = VDIR; - VN_LOCK_ASHARE(vp); + vnode.v_type = VDIR; + vnode.v_data = rootzp; + rootzp->z_vnode = &vnode; bzero(&zfsvfs, sizeof (zfsvfs_t)); @@ -1545,16 +1548,10 @@ zfs_create_fs(objset_t *os, cred_t *cr, ASSERT(error == 0); POINTER_INVALIDATE(&rootzp->z_zfsvfs); - VI_LOCK(vp); - ZTOV(rootzp)->v_data = NULL; - ZTOV(rootzp)->v_count = 0; - ZTOV(rootzp)->v_holdcnt = 0; - rootzp->z_vnode = NULL; - VOP_UNLOCK(vp, 0, curthread); - vdestroy(vp); dmu_buf_rele(rootzp->z_dbuf, NULL); rootzp->z_dbuf = NULL; mutex_destroy(&zfsvfs.z_znodes_lock); + rootzp->z_vnode = NULL; kmem_cache_free(znode_cache, rootzp); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Thu Jan 7 09:37:59 2010 (r201723) @@ -506,6 +506,25 @@ zil_rollback_destroy(zilog_t *zilog, dmu tx, zh->zh_claim_txg); } +/* + * return true if the initial log block is not valid + */ +static boolean_t +zil_empty(zilog_t *zilog) +{ + const zil_header_t *zh = zilog->zl_header; + arc_buf_t *abuf = NULL; + + if (BP_IS_HOLE(&zh->zh_log)) + return (B_TRUE); + + if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) + return (B_TRUE); + + VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); + return (B_FALSE); +} + int zil_claim(char *osname, void *txarg) { @@ -526,6 +545,21 @@ zil_claim(char *osname, void *txarg) zh = zil_header_in_syncing_context(zilog); /* + * Record here whether the zil has any records to replay. + * If the header block pointer is null or the block points + * to the stubby then we know there are no valid log records. + * We use the header to store this state as the the zilog gets + * freed later in dmu_objset_close(). + * The flags (and the rest of the header fields) are cleared in + * zil_sync() as a result of a zil_destroy(), after replaying the log. + * + * Note, the intent log can be empty but still need the + * stubby to be claimed. + */ + if (!zil_empty(zilog)) + zh->zh_flags |= ZIL_REPLAY_NEEDED; + + /* * Claim all log blocks if we haven't already done so, and remember * the highest claimed sequence number. This ensures that if we can * read only part of the log now (e.g. due to a missing device), @@ -1349,25 +1383,6 @@ zil_free(zilog_t *zilog) } /* - * return true if the initial log block is not valid - */ -static boolean_t -zil_empty(zilog_t *zilog) -{ - const zil_header_t *zh = zilog->zl_header; - arc_buf_t *abuf = NULL; - - if (BP_IS_HOLE(&zh->zh_log)) - return (B_TRUE); - - if (zil_read_log_block(zilog, &zh->zh_log, &abuf) != 0) - return (B_TRUE); - - VERIFY(arc_buf_remove_ref(abuf, &abuf) == 1); - return (B_FALSE); -} - -/* * Open an intent log. */ zilog_t * @@ -1422,7 +1437,7 @@ zil_suspend(zilog_t *zilog) const zil_header_t *zh = zilog->zl_header; mutex_enter(&zilog->zl_lock); - if (zh->zh_claim_txg != 0) { /* unplayed log */ + if (zh->zh_flags & ZIL_REPLAY_NEEDED) { /* unplayed log */ mutex_exit(&zilog->zl_lock); return (EBUSY); } @@ -1649,7 +1664,7 @@ zil_replay(objset_t *os, void *arg, uint const zil_header_t *zh = zilog->zl_header; zil_replay_arg_t zr; - if (zil_empty(zilog)) { + if ((zh->zh_flags & ZIL_REPLAY_NEEDED) == 0) { zil_destroy(zilog, B_TRUE); return; } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Thu Jan 7 09:28:17 2010 (r201722) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h Thu Jan 7 09:37:59 2010 (r201723) @@ -304,7 +304,6 @@ typedef struct xvattr { * VOP_ACCESS flags */ #define V_ACE_MASK 0x1 /* mask represents NFSv4 ACE permissions */ -#define V_APPEND 0x2 /* want to do append only check */ /* * Flags for vnode operations. From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:40:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3230C1065694; Thu, 7 Jan 2010 09:40:35 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 059F18FC1B; Thu, 7 Jan 2010 09:40:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079eYv7010175; Thu, 7 Jan 2010 09:40:34 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079eYav010173; Thu, 7 Jan 2010 09:40:34 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001070940.o079eYav010173@svn.freebsd.org> From: David Malone Date: Thu, 7 Jan 2010 09:40:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201724 - head/usr.sbin/cdcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:40:35 -0000 Author: dwmalone Date: Thu Jan 7 09:40:34 2010 New Revision: 201724 URL: http://svn.freebsd.org/changeset/base/201724 Log: This now passes a make universe with WARNS=6. Modified: head/usr.sbin/cdcontrol/Makefile Modified: head/usr.sbin/cdcontrol/Makefile ============================================================================== --- head/usr.sbin/cdcontrol/Makefile Thu Jan 7 09:37:59 2010 (r201723) +++ head/usr.sbin/cdcontrol/Makefile Thu Jan 7 09:40:34 2010 (r201724) @@ -2,8 +2,6 @@ PROG= cdcontrol -WARNS?= 3 - DPADD= ${LIBEDIT} ${LIBTERMCAP} LDADD= -ledit -ltermcap From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:45:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6081F106566B; Thu, 7 Jan 2010 09:45:15 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5057D8FC25; Thu, 7 Jan 2010 09:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079jF8m011265; Thu, 7 Jan 2010 09:45:15 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079jFHn011263; Thu, 7 Jan 2010 09:45:15 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001070945.o079jFHn011263@svn.freebsd.org> From: David Malone Date: Thu, 7 Jan 2010 09:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201725 - head/usr.bin/xlint/xlint X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:45:15 -0000 Author: dwmalone Date: Thu Jan 7 09:45:15 2010 New Revision: 201725 URL: http://svn.freebsd.org/changeset/base/201725 Log: This now passes a make universe with WARNS=6. Modified: head/usr.bin/xlint/xlint/Makefile Modified: head/usr.bin/xlint/xlint/Makefile ============================================================================== --- head/usr.bin/xlint/xlint/Makefile Thu Jan 7 09:40:34 2010 (r201724) +++ head/usr.bin/xlint/xlint/Makefile Thu Jan 7 09:45:15 2010 (r201725) @@ -11,7 +11,5 @@ MAN= lint.1 CFLAGS+=-I${.CURDIR}/../lint1 CFLAGS+= -DPREFIX=\"${TOOLS_PREFIX}\" -WARNS?= 2 - .include "${.CURDIR}/../../Makefile.inc" .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:45:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE65E1065676; Thu, 7 Jan 2010 09:45:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3BAB8FC19; Thu, 7 Jan 2010 09:45:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079jHv6011298; Thu, 7 Jan 2010 09:45:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079jHVR011296; Thu, 7 Jan 2010 09:45:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201001070945.o079jHVR011296@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Jan 2010 09:45:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201726 - stable/7/sys/geom/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:45:18 -0000 Author: mav Date: Thu Jan 7 09:45:17 2010 New Revision: 201726 URL: http://svn.freebsd.org/changeset/base/201726 Log: MFC r196837: Remove artificial MAX_IO_SIZE constant, equal to DFLTPHYS * 2. Use MAXPHYS instead. It is NULL change for GENERIC kernel, but allows 'fast' mode to work on systems with increased MAXPHYS. Modified: stable/7/sys/geom/stripe/g_stripe.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/geom/stripe/g_stripe.c ============================================================================== --- stable/7/sys/geom/stripe/g_stripe.c Thu Jan 7 09:45:15 2010 (r201725) +++ stable/7/sys/geom/stripe/g_stripe.c Thu Jan 7 09:45:17 2010 (r201726) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include -#define MAX_IO_SIZE (DFLTPHYS * 2) static MALLOC_DEFINE(M_STRIPE, "stripe_data", "GEOM_STRIPE Data"); static uma_zone_t g_stripe_zone; @@ -87,7 +86,7 @@ g_sysctl_stripe_fast(SYSCTL_HANDLER_ARGS } SYSCTL_PROC(_kern_geom_stripe, OID_AUTO, fast, CTLTYPE_INT | CTLFLAG_RW, NULL, 0, g_sysctl_stripe_fast, "I", "Fast, but memory-consuming, mode"); -static u_int g_stripe_maxmem = MAX_IO_SIZE * 100; +static u_int g_stripe_maxmem = MAXPHYS * 100; TUNABLE_INT("kern.geom.stripe.maxmem", &g_stripe_maxmem); SYSCTL_UINT(_kern_geom_stripe, OID_AUTO, maxmem, CTLFLAG_RD, &g_stripe_maxmem, 0, "Maximum memory that can be allocated in \"fast\" mode (in bytes)"); @@ -125,10 +124,10 @@ static void g_stripe_init(struct g_class *mp __unused) { - g_stripe_zone = uma_zcreate("g_stripe_zone", MAX_IO_SIZE, NULL, NULL, + g_stripe_zone = uma_zcreate("g_stripe_zone", MAXPHYS, NULL, NULL, NULL, NULL, 0, 0); - g_stripe_maxmem -= g_stripe_maxmem % MAX_IO_SIZE; - uma_zone_set_max(g_stripe_zone, g_stripe_maxmem / MAX_IO_SIZE); + g_stripe_maxmem -= g_stripe_maxmem % MAXPHYS; + uma_zone_set_max(g_stripe_zone, g_stripe_maxmem / MAXPHYS); } static void @@ -613,14 +612,14 @@ g_stripe_start(struct bio *bp) * Do use "fast" mode when: * 1. "Fast" mode is ON. * and - * 2. Request size is less than or equal to MAX_IO_SIZE (128kB), + * 2. Request size is less than or equal to MAXPHYS, * which should always be true. * and * 3. Request size is bigger than stripesize * ndisks. If it isn't, * there will be no need to send more than one I/O request to * a provider, so there is nothing to optmize. */ - if (g_stripe_fast && bp->bio_length <= MAX_IO_SIZE && + if (g_stripe_fast && bp->bio_length <= MAXPHYS && bp->bio_length >= stripesize * sc->sc_ndisks) { fast = 1; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 09:47:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48730106566C; Thu, 7 Jan 2010 09:47:06 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1D48FC23; Thu, 7 Jan 2010 09:47:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o079l6bv011769; Thu, 7 Jan 2010 09:47:06 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o079l6et011767; Thu, 7 Jan 2010 09:47:06 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001070947.o079l6et011767@svn.freebsd.org> From: David Malone Date: Thu, 7 Jan 2010 09:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201727 - head/usr.bin/w X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 09:47:06 -0000 Author: dwmalone Date: Thu Jan 7 09:47:05 2010 New Revision: 201727 URL: http://svn.freebsd.org/changeset/base/201727 Log: This now passes a make universe with WARNS=6. Modified: head/usr.bin/w/Makefile Modified: head/usr.bin/w/Makefile ============================================================================== --- head/usr.bin/w/Makefile Thu Jan 7 09:45:17 2010 (r201726) +++ head/usr.bin/w/Makefile Thu Jan 7 09:47:05 2010 (r201727) @@ -10,8 +10,6 @@ LDADD= -lkvm -lulog -lutil #BINMODE=2555 LINKS= ${BINDIR}/w ${BINDIR}/uptime -WARNS?= 1 - .PATH: ${.CURDIR}/../../bin/ps .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 10:08:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F17FB106566C; Thu, 7 Jan 2010 10:08:05 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0C598FC13; Thu, 7 Jan 2010 10:08:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07A8556016709; Thu, 7 Jan 2010 10:08:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07A85KV016703; Thu, 7 Jan 2010 10:08:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071008.o07A85KV016703@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 10:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201732 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 10:08:06 -0000 Author: luigi Date: Thu Jan 7 10:08:05 2010 New Revision: 201732 URL: http://svn.freebsd.org/changeset/base/201732 Log: some header shuffling to help decoupling ip_divert from ipfw Modified: head/sys/netinet/ipfw/ip_dummynet.c head/sys/netinet/ipfw/ip_fw_log.c head/sys/netinet/ipfw/ip_fw_pfil.c head/sys/netinet/ipfw/ip_fw_sockopt.c head/sys/netinet/ipfw/ip_fw_table.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 10:06:09 2010 (r201731) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 10:08:05 2010 (r201732) @@ -52,8 +52,6 @@ __FBSDID("$FreeBSD$"); * 000601: WF2Q support * 000106: large rewrite, use heaps to handle very many pipes. * 980513: initial release - * - * include files marked with XXX are probably not needed */ #include @@ -75,10 +73,10 @@ __FBSDID("$FreeBSD$"); #include #include #include /* ip_len, ip_off */ +#include /* ip_output(), IP_FORWARDING */ #include #include #include -#include /* ip_output(), IP_FORWARDING */ #include /* various ether_* routines */ Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Thu Jan 7 10:06:09 2010 (r201731) +++ head/sys/netinet/ipfw/ip_fw_log.c Thu Jan 7 10:08:05 2010 (r201732) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Thu Jan 7 10:06:09 2010 (r201731) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Thu Jan 7 10:08:05 2010 (r201732) @@ -73,12 +73,6 @@ static VNET_DEFINE(int, fw6_enable) = 1; int ipfw_chg_hook(SYSCTL_HANDLER_ARGS); -/* Divert hooks. */ -void (*ip_divert_ptr)(struct mbuf *m, int incoming); - -/* ng_ipfw hooks. */ -ng_ipfw_input_t *ng_ipfw_input_p = NULL; - /* Forward declarations. */ static int ipfw_divert(struct mbuf **, int, struct ipfw_rule_ref *, int); @@ -219,7 +213,7 @@ again: case IP_FW_NGTEE: case IP_FW_NETGRAPH: - if (!NG_IPFW_LOADED) { + if (ng_ipfw_input_p == NULL) { ret = EACCES; break; /* i.e. drop */ } Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Thu Jan 7 10:06:09 2010 (r201731) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Thu Jan 7 10:08:05 2010 (r201732) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* hooks */ #include #include @@ -676,7 +677,7 @@ check_ipfw_struct(struct ip_fw *rule, in goto check_size; case O_NETGRAPH: case O_NGTEE: - if (!NG_IPFW_LOADED) + if (ng_ipfw_input_p == NULL) return EINVAL; else goto check_size; Modified: head/sys/netinet/ipfw/ip_fw_table.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_table.c Thu Jan 7 10:06:09 2010 (r201731) +++ head/sys/netinet/ipfw/ip_fw_table.c Thu Jan 7 10:08:05 2010 (r201732) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* struct ipfw_rule_ref */ #include #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 10:27:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B20AC1065679; Thu, 7 Jan 2010 10:27:52 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A20CC8FC12; Thu, 7 Jan 2010 10:27:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07ARqu1021116; Thu, 7 Jan 2010 10:27:52 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07ARqaR021114; Thu, 7 Jan 2010 10:27:52 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071027.o07ARqaR021114@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 10:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201734 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 10:27:52 -0000 Author: luigi Date: Thu Jan 7 10:27:52 2010 New Revision: 201734 URL: http://svn.freebsd.org/changeset/base/201734 Log: put ip_var before ip_fw_private.h as this will be needed in the near future Modified: head/sys/net/if_ethersubr.c Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Jan 7 10:23:07 2010 (r201733) +++ head/sys/net/if_ethersubr.c Thu Jan 7 10:27:52 2010 (r201734) @@ -70,10 +70,10 @@ #include #include #include +#include #include #include #include -#include #endif #ifdef INET6 #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 10:39:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C121065692; Thu, 7 Jan 2010 10:39:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11FE38FC1A; Thu, 7 Jan 2010 10:39:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07AdFU8025878; Thu, 7 Jan 2010 10:39:15 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07AdF6m025873; Thu, 7 Jan 2010 10:39:15 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071039.o07AdF6m025873@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 10:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201735 - in head/sys/netinet: . ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 10:39:16 -0000 Author: luigi Date: Thu Jan 7 10:39:15 2010 New Revision: 201735 URL: http://svn.freebsd.org/changeset/base/201735 Log: Following up on a request from Ermal Luci to make ip_divert work as a client of pf(4), make ip_divert not depend on ipfw. This is achieved by moving to ip_var.h the struct ipfw_rule_ref (which is part of the mtag for all reinjected packets) and other declarations of global variables, and moving to raw_ip.c global variables for filter and divert hooks. Note that names and locations could be made more generic (ipfw_rule_ref is really a generic reference robust to reconfigurations; the packet filter is not necessarily ipfw; filters and their clients are not necessarily limited to ipv4), but _right now_ most of this stuff works on ipfw and ipv4, so i don't feel like doing a gratuitous renaming, at least for the time being. Modified: head/sys/netinet/ip_divert.c head/sys/netinet/ip_var.h head/sys/netinet/ipfw/ip_fw_private.h head/sys/netinet/raw_ip.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Jan 7 10:27:52 2010 (r201734) +++ head/sys/netinet/ip_divert.c Thu Jan 7 10:39:15 2010 (r201735) @@ -32,14 +32,10 @@ __FBSDID("$FreeBSD$"); #if !defined(KLD_MODULE) #include "opt_inet.h" -#include "opt_ipfw.h" #include "opt_sctp.h" #ifndef INET #error "IPDIVERT requires INET." #endif -#ifndef IPFIREWALL -#error "IPDIVERT requires IPFIREWALL" -#endif #endif #include @@ -55,10 +51,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include @@ -66,8 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include #ifdef SCTP #include #endif @@ -85,27 +79,29 @@ __FBSDID("$FreeBSD$"); #define DIVRCVQ (65536 + 100) /* - * Divert sockets work in conjunction with ipfw, see the divert(4) - * manpage for features. - * Internally, packets selected by ipfw in ip_input() or ip_output(), - * and never diverted before, are passed to the input queue of the - * divert socket with a given 'divert_port' number (as specified in - * the matching ipfw rule), and they are tagged with a 16 bit cookie - * (representing the rule number of the matching ipfw rule), which - * is passed to process reading from the socket. + * Divert sockets work in conjunction with ipfw or other packet filters, + * see the divert(4) manpage for features. + * Packets are selected by the packet filter and tagged with an + * MTAG_IPFW_RULE tag carrying the 'divert port' number (as set by + * the packet filter) and information on the matching filter rule for + * subsequent reinjection. The divert_port is used to put the packet + * on the corresponding divert socket, while the rule number is passed + * up (at least partially) as the sin_port in the struct sockaddr. * - * Packets written to the divert socket are again tagged with a cookie - * (usually the same as above) and a destination address. - * If the destination address is INADDR_ANY then the packet is - * treated as outgoing and sent to ip_output(), otherwise it is - * treated as incoming and sent to ip_input(). - * In both cases, the packet is tagged with the cookie. + * Packets written to the divert socket carry in sin_addr a + * destination address, and in sin_port the number of the filter rule + * after which to continue processing. + * If the destination address is INADDR_ANY, the packet is treated as + * as outgoing and sent to ip_output(); otherwise it is treated as + * incoming and sent to ip_input(). + * Further, sin_zero carries some information on the interface, + * which can be used in the reinject -- see comments in the code. * * On reinjection, processing in ip_input() and ip_output() * will be exactly the same as for the original packet, except that - * ipfw processing will start at the rule number after the one - * written in the cookie (so, tagging a packet with a cookie of 0 - * will cause it to be effectively considered as a standard packet). + * packet filter processing will start at the rule number after the one + * written in the sin_port (ipfw does not allow a rule #0, so sin_port=0 + * will apply the entire ruleset to the packet). */ /* Internal variables. */ Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Thu Jan 7 10:27:52 2010 (r201734) +++ head/sys/netinet/ip_var.h Thu Jan 7 10:39:15 2010 (r201735) @@ -249,7 +249,43 @@ VNET_DECLARE(struct pfil_head, inet_pfil void in_delayed_cksum(struct mbuf *m); -/* ipfw and dummynet hooks. Most are declared in raw_ip.c */ +/* Hooks for ipfw, dummynet, divert etc. Most are declared in raw_ip.c */ +/* + * Reference to an ipfw or packet filter rule that can be carried + * outside critical sections. + * A rule is identified by rulenum:rule_id which is ordered. + * In version chain_id the rule can be found in slot 'slot', so + * we don't need a lookup if chain_id == chain->id. + * + * On exit from the firewall this structure refers to the rule after + * the matching one (slot points to the new rule; rulenum:rule_id-1 + * is the matching rule), and additional info (e.g. info often contains + * the insn argument or tablearg in the low 16 bits, in host format). + * On entry, the structure is valid if slot>0, and refers to the starting + * rules. 'info' contains the reason for reinject, e.g. divert port, + * divert direction, and so on. + */ +struct ipfw_rule_ref { + uint32_t slot; /* slot for matching rule */ + uint32_t rulenum; /* matching rule number */ + uint32_t rule_id; /* matching rule id */ + uint32_t chain_id; /* ruleset id */ + uint32_t info; /* see below */ +}; + +enum { + IPFW_INFO_MASK = 0x0000ffff, + IPFW_INFO_OUT = 0x00000000, /* outgoing, just for convenience */ + IPFW_INFO_IN = 0x80000000, /* incoming, overloads dir */ + IPFW_ONEPASS = 0x40000000, /* One-pass, do not reinject */ + IPFW_IS_MASK = 0x30000000, /* which source ? */ + IPFW_IS_DIVERT = 0x20000000, + IPFW_IS_DUMMYNET =0x10000000, + IPFW_IS_PIPE = 0x08000000, /* pip1=1, queue = 0 */ +}; +#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ +#define MTAG_IPFW_RULE 1262273568 /* rule reference */ + struct ip_fw_args; typedef int (*ip_fw_chk_ptr_t)(struct ip_fw_args *args); typedef int (*ip_fw_ctl_ptr_t)(struct sockopt *); @@ -258,9 +294,14 @@ VNET_DECLARE(ip_fw_ctl_ptr_t, ip_fw_ctl_ #define V_ip_fw_chk_ptr VNET(ip_fw_chk_ptr) #define V_ip_fw_ctl_ptr VNET(ip_fw_ctl_ptr) +/* Divert hooks. */ +extern void (*ip_divert_ptr)(struct mbuf *m, int incoming); +/* ng_ipfw hooks -- XXX make it the same as divert and dummynet */ +extern int (*ng_ipfw_input_p)(struct mbuf **, int, + struct ip_fw_args *, int); + extern int (*ip_dn_ctl_ptr)(struct sockopt *); -extern int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa); -extern void (*ip_dn_ruledel_ptr)(void *); /* in ip_fw2.c */ +extern int (*ip_dn_io_ptr)(struct mbuf **, int, struct ip_fw_args *); VNET_DECLARE(int, ip_do_randomid); #define V_ip_do_randomid VNET(ip_do_randomid) Modified: head/sys/netinet/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netinet/ipfw/ip_fw_private.h Thu Jan 7 10:27:52 2010 (r201734) +++ head/sys/netinet/ipfw/ip_fw_private.h Thu Jan 7 10:39:15 2010 (r201735) @@ -35,8 +35,6 @@ #ifdef _KERNEL -#define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ -#define MTAG_IPFW_RULE 1262273568 /* rule reference */ /* Return values from ipfw_chk() */ enum { @@ -66,38 +64,6 @@ struct _ip6dn_args { struct route_in6 ro_pmtu_or; }; -/* - * Reference to an ipfw rule that can be carried outside critical sections. - * A rule is identified by rulenum:rule_id which is ordered. - * In version chain_id the rule can be found in slot 'slot', so - * we don't need a lookup if chain_id == chain->id. - * - * On exit from the firewall this structure refers to the rule after - * the matching one (slot points to the new rule; rulenum:rule_id-1 - * is the matching rule), and additional info (e.g. info often contains - * the insn argument or tablearg in the low 16 bits, in host format). - * On entry, the structure is valid if slot>0, and refers to the starting - * rules. 'info' contains the reason for reinject, e.g. divert port, - * divert direction, and so on. - */ -struct ipfw_rule_ref { - uint32_t slot; /* slot for matching rule */ - uint32_t rulenum; /* matching rule number */ - uint32_t rule_id; /* matching rule id */ - uint32_t chain_id; /* ruleset id */ - uint32_t info; /* see below */ -}; - -enum { - IPFW_INFO_MASK = 0x0000ffff, - IPFW_INFO_OUT = 0x00000000, /* outgoing, just for convenience */ - IPFW_INFO_IN = 0x80000000, /* incoming, overloads dir */ - IPFW_ONEPASS = 0x40000000, /* One-pass, do not reinject */ - IPFW_IS_MASK = 0x30000000, /* which source ? */ - IPFW_IS_DIVERT = 0x20000000, - IPFW_IS_DUMMYNET =0x10000000, - IPFW_IS_PIPE = 0x08000000, /* pip1=1, queue = 0 */ -}; /* * Arguments for calling ipfw_chk() and dummynet_io(). We put them @@ -289,10 +255,7 @@ int ipfw_del_table_entry(struct ip_fw_ch int ipfw_count_table(struct ip_fw_chain *ch, uint32_t tbl, uint32_t *cnt); int ipfw_dump_table(struct ip_fw_chain *ch, ipfw_table *tbl); -/* hooks for divert */ -extern void (*ip_divert_ptr)(struct mbuf *m, int incoming); - -/* In ip_fw_nat.c */ +/* In ip_fw_nat.c -- XXX to be moved to ip_var.h */ extern struct cfg_nat *(*lookup_nat_ptr)(struct nat_list *, int); @@ -307,14 +270,5 @@ extern ipfw_nat_cfg_t *ipfw_nat_del_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_cfg_ptr; extern ipfw_nat_cfg_t *ipfw_nat_get_log_ptr; -/* netgraph prototypes */ - -typedef int ng_ipfw_input_t(struct mbuf **, int, struct ip_fw_args *, int); -extern ng_ipfw_input_t *ng_ipfw_input_p; -#define NG_IPFW_LOADED (ng_ipfw_input_p != NULL) - -#define TAGSIZ (sizeof(struct ng_ipfw_tag) - sizeof(struct m_tag)) - - #endif /* _KERNEL */ #endif /* _IPFW2_PRIVATE_H */ Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Jan 7 10:27:52 2010 (r201734) +++ head/sys/netinet/raw_ip.c Thu Jan 7 10:39:15 2010 (r201735) @@ -80,14 +80,18 @@ VNET_DEFINE(struct inpcbinfo, ripcbinfo) #define V_ripcbinfo VNET(ripcbinfo) /* - * Control and data hooks for ipfw and dummynet. + * Control and data hooks for ipfw, dummynet, divert and so on. * The data hooks are not used here but it is convenient * to keep them all in one place. */ VNET_DEFINE(ip_fw_chk_ptr_t, ip_fw_chk_ptr) = NULL; VNET_DEFINE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr) = NULL; -int (*ip_dn_ctl_ptr)(struct sockopt *) = NULL; -int (*ip_dn_io_ptr)(struct mbuf **m, int dir, struct ip_fw_args *fwa) = NULL; + +int (*ip_dn_ctl_ptr)(struct sockopt *); +int (*ip_dn_io_ptr)(struct mbuf **, int, struct ip_fw_args *); +void (*ip_divert_ptr)(struct mbuf *, int); +int (*ng_ipfw_input_p)(struct mbuf **, int, + struct ip_fw_args *, int); /* * Hooks for multicast routing. They all default to NULL, so leave them not From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:29:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B00861065670; Thu, 7 Jan 2010 11:29:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 889A58FC12; Thu, 7 Jan 2010 11:29:36 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 1232E46B2E; Thu, 7 Jan 2010 06:29:36 -0500 (EST) Date: Thu, 7 Jan 2010 11:29:35 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <20100104190024.GA47532@onelab2.iet.unipi.it> Message-ID: References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:29:36 -0000 On Mon, 4 Jan 2010, Luigi Rizzo wrote: > taking a random commit to this tree -- would you guys consider moving the > sctp sources to its own directory, e.g. netinet/sctp/ or something that > suits better ? > > It would help to browse through the directory: > > NAME FILES LINES > > netinet/ 156 153k > sctp* 36 66k > tcp* 24 16k > ipfw/ 9 9k > > > I understand that some of the headers should remain in netinet/ but surely > the code is not bound to a specific place... Keep in mind that every file rename invalidates outstanding patch sets against those files maintained in our own branches, and at external vendors. I think we should be cautious about gratuitous renaming, as it increases the work factor both inside and outside the project significantly for relatively little gain. Especially when the files already have a quite consistent naming scheme that makes it easy to know which files belong to which component -- tcp_*, sctp_*, udp_*, etc. Robert N M Watson Computer Laboratory University of Cambridge > > cheers > luigi > > On Mon, Jan 04, 2010 at 06:25:38PM +0000, Michael Tuexen wrote: >> Author: tuexen >> Date: Mon Jan 4 18:25:38 2010 >> New Revision: 201523 >> URL: http://svn.freebsd.org/changeset/base/201523 >> >> Log: >> Correct usage of parenthesis. >> >> PR: kern/142066 >> Approved by: rrs (mentor) >> Obtained from: Henning Petersen, Bruce Cran. >> MFC after: 2 weeks >> >> Modified: >> head/sys/netinet/sctp_pcb.c >> >> Modified: head/sys/netinet/sctp_pcb.c >> ============================================================================== >> --- head/sys/netinet/sctp_pcb.c Mon Jan 4 18:21:27 2010 (r201522) >> +++ head/sys/netinet/sctp_pcb.c Mon Jan 4 18:25:38 2010 (r201523) >> @@ -5528,7 +5528,7 @@ sctp_pcb_init() >> >> /* Init the TIMEWAIT list */ >> for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { >> - LIST_INIT(&SCTP_BASE_INFO(vtag_timewait[i])); >> + LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); >> } >> >> #if defined(SCTP_USE_THREAD_BASED_ITERATOR) >> @@ -6385,7 +6385,7 @@ sctp_is_vtag_good(struct sctp_inpcb *inp >> } >> skip_vtag_check: >> >> - chain = &SCTP_BASE_INFO(vtag_timewait[(tag % SCTP_STACK_VTAG_HASH_SIZE))]; >> + chain = &SCTP_BASE_INFO(vtag_timewait)[(tag % SCTP_STACK_VTAG_HASH_SIZE)]; >> /* Now what about timed wait ? */ >> if (!LIST_EMPTY(chain)) { >> /* > From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:30:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C88E41065672; Thu, 7 Jan 2010 11:30:54 +0000 (UTC) (envelope-from danger@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B80AD8FC12; Thu, 7 Jan 2010 11:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07BUsMO037290; Thu, 7 Jan 2010 11:30:54 GMT (envelope-from danger@svn.freebsd.org) Received: (from danger@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07BUsOv037288; Thu, 7 Jan 2010 11:30:54 GMT (envelope-from danger@svn.freebsd.org) Message-Id: <201001071130.o07BUsOv037288@svn.freebsd.org> From: Daniel Gerzo Date: Thu, 7 Jan 2010 11:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201736 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:30:54 -0000 Author: danger (doc committer) Date: Thu Jan 7 11:30:54 2010 New Revision: 201736 URL: http://svn.freebsd.org/changeset/base/201736 Log: - s/unsecure/insecure/ as this is the correct keyword Modified: head/share/man/man7/security.7 Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Thu Jan 7 10:39:15 2010 (r201735) +++ head/share/man/man7/security.7 Thu Jan 7 11:30:54 2010 (r201736) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2006 +.Dd January 7, 2010 .Dt SECURITY 7 .Os .Sh NAME @@ -175,7 +175,7 @@ outside of the console or possibly even .Xr su 1 utility. For example, make sure that your PTYs are specified as being -.Dq Li unsecure +.Dq Li insecure in the .Pa /etc/ttys file From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:32:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB3A1106566B; Thu, 7 Jan 2010 11:32:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B26918FC14; Thu, 7 Jan 2010 11:32:30 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 60C0F46B38; Thu, 7 Jan 2010 06:32:30 -0500 (EST) Date: Thu, 7 Jan 2010 11:32:30 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Luigi Rizzo In-Reply-To: <20100104222323.GA49068@onelab2.iet.unipi.it> Message-ID: References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> <20100104222323.GA49068@onelab2.iet.unipi.it> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:32:31 -0000 On Mon, 4 Jan 2010, Luigi Rizzo wrote: > I also think that the name of the new directory or the exact percentage of > ipv4-ness or netinet-ness of the sctp* and tcp* and multicast* stuff is > irrelevant. Moving directories with svn is so easy that we should not worry > even if we need a couple of attempts to find a good name. This is simply not the case. It's easy to rename in the parent branch, but that rename is propagated poorly to children branches, where developers will have to manually reconstruct changes made to the old file and apply them by hand to the new file. It's even worse when things are propagated from one repository to another, as all of our downstream vendors do, importing them into some vast combination of {CVS, SVN, P4, git, ..}. Why create unnecessary work for everyone? Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:33:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7241065694; Thu, 7 Jan 2010 11:33:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECCA8FC21; Thu, 7 Jan 2010 11:33:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07BXvEc038010; Thu, 7 Jan 2010 11:33:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07BXvfJ038008; Thu, 7 Jan 2010 11:33:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001071133.o07BXvfJ038008@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Jan 2010 11:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201737 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:33:57 -0000 Author: kib Date: Thu Jan 7 11:33:57 2010 New Revision: 201737 URL: http://svn.freebsd.org/changeset/base/201737 Log: MFC r201504: PG_NOSYNC is called VPO_NOSYNC for long time. Modified: stable/8/share/man/man9/vm_page_bits.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/vm_page_bits.9 ============================================================================== --- stable/8/share/man/man9/vm_page_bits.9 Thu Jan 7 11:30:54 2010 (r201736) +++ stable/8/share/man/man9/vm_page_bits.9 Thu Jan 7 11:33:57 2010 (r201737) @@ -94,7 +94,7 @@ is zero and .Fa size is one page, the modified bit in the page map is cleared; as well, the -.Dv PG_NOSYNC +.Dv VPO_NOSYNC flag is cleared. .Pp .Fn vm_page_clear_dirty From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:41:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E270E106566C; Thu, 7 Jan 2010 11:41:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D10FE8FC19; Thu, 7 Jan 2010 11:41:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07BflIx039750; Thu, 7 Jan 2010 11:41:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07Bflpa039747; Thu, 7 Jan 2010 11:41:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001071141.o07Bflpa039747@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Jan 2010 11:41:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201738 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:41:48 -0000 Author: kib Date: Thu Jan 7 11:41:47 2010 New Revision: 201738 URL: http://svn.freebsd.org/changeset/base/201738 Log: MFC r201347: Allow swap out of the kernel stack for the thread with priority greater or equial then PSOCK, not less or equial. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Thu Jan 7 11:33:57 2010 (r201737) +++ stable/8/sys/kern/sched_4bsd.c Thu Jan 7 11:41:47 2010 (r201738) @@ -913,7 +913,7 @@ sched_sleep(struct thread *td, int pri) td->td_sched->ts_slptime = 0; if (pri) sched_prio(td, pri); - if (TD_IS_SUSPENDED(td) || pri <= PSOCK) + if (TD_IS_SUSPENDED(td) || pri >= PSOCK) td->td_flags |= TDF_CANSWAP; } Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Thu Jan 7 11:33:57 2010 (r201737) +++ stable/8/sys/kern/sched_ule.c Thu Jan 7 11:41:47 2010 (r201738) @@ -1909,7 +1909,7 @@ sched_sleep(struct thread *td, int prio) THREAD_LOCK_ASSERT(td, MA_OWNED); td->td_slptick = ticks; - if (TD_IS_SUSPENDED(td) || prio <= PSOCK) + if (TD_IS_SUSPENDED(td) || prio >= PSOCK) td->td_flags |= TDF_CANSWAP; if (static_boost == 1 && prio) sched_prio(td, prio); From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 11:54:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B9D0106566C; Thu, 7 Jan 2010 11:54:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A6E98FC18; Thu, 7 Jan 2010 11:54:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07Bsasl042663; Thu, 7 Jan 2010 11:54:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07BsaVb042661; Thu, 7 Jan 2010 11:54:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001071154.o07BsaVb042661@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Jan 2010 11:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201739 - stable/7/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 11:54:36 -0000 Author: kib Date: Thu Jan 7 11:54:36 2010 New Revision: 201739 URL: http://svn.freebsd.org/changeset/base/201739 Log: MFC r201504: PG_NOSYNC is called VPO_NOSYNC for long time. Modified: stable/7/share/man/man9/vm_page_bits.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/share/man/man9/vm_page_bits.9 ============================================================================== --- stable/7/share/man/man9/vm_page_bits.9 Thu Jan 7 11:41:47 2010 (r201738) +++ stable/7/share/man/man9/vm_page_bits.9 Thu Jan 7 11:54:36 2010 (r201739) @@ -94,7 +94,7 @@ is zero and .Fa size is one page, the modified bit in the page map is cleared; as well, the -.Dv PG_NOSYNC +.Dv VPO_NOSYNC flag is cleared. .Pp .Fn vm_page_clear_dirty From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 12:00:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 898E61065679; Thu, 7 Jan 2010 12:00:54 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793BA8FC1F; Thu, 7 Jan 2010 12:00:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07C0sVa044095; Thu, 7 Jan 2010 12:00:54 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07C0sKR044093; Thu, 7 Jan 2010 12:00:54 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071200.o07C0sKR044093@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 12:00:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201740 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 12:00:54 -0000 Author: luigi Date: Thu Jan 7 12:00:54 2010 New Revision: 201740 URL: http://svn.freebsd.org/changeset/base/201740 Log: check that we have an ipv4 packet before swapping ip_len and ip_off. This should fix the handling of ipv6 packets which i broke when i made ipfw operate on packets in network format. Reported by: Hajimu UMEMOTO Modified: head/sys/netinet/ipfw/ip_fw_pfil.c Modified: head/sys/netinet/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_pfil.c Thu Jan 7 11:54:36 2010 (r201739) +++ head/sys/netinet/ipfw/ip_fw_pfil.c Thu Jan 7 12:00:54 2010 (r201740) @@ -104,7 +104,8 @@ ipfw_check_hook(void *arg, struct mbuf * int ret; /* all the processing now uses ip_len in net format */ - SET_NET_IPLEN(mtod(*m0, struct ip *)); + if (mtod(*m0, struct ip *)->ip_v == 4) + SET_NET_IPLEN(mtod(*m0, struct ip *)); /* convert dir to IPFW values */ dir = (dir == PFIL_IN) ? DIR_IN : DIR_OUT; @@ -236,7 +237,7 @@ again: FREE_PKT(*m0); *m0 = NULL; } - if (*m0) + if (*m0 && mtod(*m0, struct ip *)->ip_v == 4) SET_HOST_IPLEN(mtod(*m0, struct ip *)); return ret; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 12:58:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CCB310656A5; Thu, 7 Jan 2010 12:58:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C3648FC0A; Thu, 7 Jan 2010 12:58:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07Cw3l2056859; Thu, 7 Jan 2010 12:58:03 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07Cw39U056857; Thu, 7 Jan 2010 12:58:03 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001071258.o07Cw39U056857@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 7 Jan 2010 12:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201742 - head/sys/modules/crypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 12:58:03 -0000 Author: bz Date: Thu Jan 7 12:58:03 2010 New Revision: 201742 URL: http://svn.freebsd.org/changeset/base/201742 Log: After adding an SDT provider for opencrypto in r199884 we should also depend on opt_kdtrace.h for the module build. Submitted by: (Andre.Albsmeier siemens.com) MFC after: 3 days Modified: head/sys/modules/crypto/Makefile Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Thu Jan 7 12:06:32 2010 (r201741) +++ head/sys/modules/crypto/Makefile Thu Jan 7 12:58:03 2010 (r201742) @@ -16,6 +16,6 @@ SRCS += skipjack.c bf_enc.c bf_skey.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h -SRCS += opt_ddb.h +SRCS += opt_ddb.h opt_kdtrace.h SRCS += camellia.c camellia-api.c .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 13:31:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 435D41065679; Thu, 7 Jan 2010 13:31:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 330038FC1C; Thu, 7 Jan 2010 13:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07DV1Ql064232; Thu, 7 Jan 2010 13:31:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07DV1r7064230; Thu, 7 Jan 2010 13:31:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001071331.o07DV1r7064230@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Jan 2010 13:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201743 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 13:31:01 -0000 Author: kib Date: Thu Jan 7 13:31:00 2010 New Revision: 201743 URL: http://svn.freebsd.org/changeset/base/201743 Log: Give some information on SF_MNOWAIT flag. MFC after: 3 days Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Thu Jan 7 12:58:03 2010 (r201742) +++ head/lib/libc/sys/sendfile.2 Thu Jan 7 13:31:00 2010 (r201743) @@ -116,9 +116,17 @@ Busy servers may benefit by transferring block to a separate I/O worker thread. .It .Dv SF_MNOWAIT . -(description missing) +Do not wait for some kernel resource to become available, +in particular, +.Vt mbuf +and +.Vt sf_buf . +The flag does not make the +.Fn sendfile +syscall trully non-blocking, since other resources are still allocated +in blocking fashion. .It -.Dv SF_SYNC , +.Dv SF_SYNC . .Nm sleeps until the network stack no longer references the VM pages of the file, making subsequent modifications to it safe. From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 13:42:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA8E11065679; Thu, 7 Jan 2010 13:42:28 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5C248FC18; Thu, 7 Jan 2010 13:42:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07DgSpr066844; Thu, 7 Jan 2010 13:42:28 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07DgSv3066824; Thu, 7 Jan 2010 13:42:28 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001071342.o07DgSv3066824@svn.freebsd.org> From: Alexander Leidinger Date: Thu, 7 Jan 2010 13:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201744 - in stable/7/sys/cddl: compat/opensolaris/kern compat/opensolaris/sys contrib/opensolaris/uts/common/fs/zfs contrib/opensolaris/uts/common/sys/fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 13:42:29 -0000 Author: netchild Date: Thu Jan 7 13:42:28 2010 New Revision: 201744 URL: http://svn.freebsd.org/changeset/base/201744 Log: Diff reduction to 8-stable: - whitespace - fix harmless mismerges - comments or (harmless) code which was there twice - fix not so harmless mismerges (mem leak - double mtx_init) MFC r197842: whitespace fix Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c stable/7/sys/cddl/compat/opensolaris/sys/kmem.h stable/7/sys/cddl/compat/opensolaris/sys/time.h stable/7/sys/cddl/compat/opensolaris/sys/types.h stable/7/sys/cddl/compat/opensolaris/sys/vnode.h stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Thu Jan 7 13:42:28 2010 (r201744) @@ -127,7 +127,6 @@ secpolicy_vnode_access(struct ucred *cre if ((accmode & VREAD) && priv_check_cred(cred, PRIV_VFS_READ, 0) != 0) return (EACCES); - if ((accmode & VWRITE) && priv_check_cred(cred, PRIV_VFS_WRITE, 0) != 0) { return (EACCES); Modified: stable/7/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/kmem.h Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/compat/opensolaris/sys/kmem.h Thu Jan 7 13:42:28 2010 (r201744) @@ -40,7 +40,6 @@ #define KM_SLEEP M_WAITOK #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT -#define KM_ZERO M_ZERO #define KMC_NODEBUG 0 typedef struct kmem_cache { Modified: stable/7/sys/cddl/compat/opensolaris/sys/time.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/time.h Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/compat/opensolaris/sys/time.h Thu Jan 7 13:42:28 2010 (r201744) @@ -30,6 +30,7 @@ #define _OPENSOLARIS_SYS_TIME_H_ #include_next + #define SEC 1 #define MILLISEC 1000 #define MICROSEC 1000000 Modified: stable/7/sys/cddl/compat/opensolaris/sys/types.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/types.h Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/compat/opensolaris/sys/types.h Thu Jan 7 13:42:28 2010 (r201744) @@ -62,8 +62,8 @@ typedef uint64_t pgcnt_t; typedef short index_t; typedef off_t offset_t; typedef long ptrdiff_t; /* pointer difference */ -typedef int major_t; typedef int64_t rlim64_t; +typedef int major_t; #else #ifdef NEED_SOLARIS_BOOLEAN Modified: stable/7/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/compat/opensolaris/sys/vnode.h Thu Jan 7 13:42:28 2010 (r201744) @@ -245,7 +245,6 @@ zfs_vop_fsync(vnode_t *vp, int flag, cre vfslocked = VFS_LOCK_GIANT(vp->v_mount); if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0) goto drop; - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread); error = VOP_FSYNC(vp, MNT_WAIT, curthread); VOP_UNLOCK(vp, 0, curthread); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jan 7 13:42:28 2010 (r201744) @@ -2965,7 +2965,7 @@ arc_release(arc_buf_t *buf, void *tag) mutex_exit(hash_lock); - nhdr = kmem_cache_alloc(hdr_cache, (KM_PUSHPAGE|KM_ZERO)); + nhdr = kmem_cache_alloc(hdr_cache, KM_PUSHPAGE); nhdr->b_size = blksz; nhdr->b_spa = spa; nhdr->b_type = type; @@ -2976,7 +2976,6 @@ arc_release(arc_buf_t *buf, void *tag) nhdr->b_l2hdr = NULL; nhdr->b_datacnt = 1; nhdr->b_freeze_cksum = NULL; - mutex_init(&nhdr->b_freeze_lock, NULL, MUTEX_DEFAULT, NULL); (void) refcount_add(&nhdr->b_refcnt, tag); buf->b_hdr = nhdr; rw_exit(&buf->b_lock); @@ -3412,7 +3411,6 @@ arc_lowmem(void *arg __unused, int howto /* Serialize access via arc_lowmem_lock. */ mutex_enter(&arc_lowmem_lock); needfree = 1; - cv_signal(&arc_reclaim_thr_cv); while (needfree) tsleep(&needfree, 0, "zfs:lowmem", hz / 5); @@ -3449,7 +3447,6 @@ arc_init(void) arc_c_max = (arc_c * 8) - (1<<30); else arc_c_max = arc_c_min; - arc_c_max = MAX(arc_c * 5, arc_c_max); #ifdef _KERNEL /* Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Thu Jan 7 13:42:28 2010 (r201744) @@ -1966,10 +1966,6 @@ dbuf_sync_leaf(dbuf_dirty_record_t *dr, list_destroy(&dr->dt.di.dr_children); mutex_destroy(&dr->dt.di.dr_mtx); } - if (dr->dr_dbuf->db_level != 0) { - list_destroy(&dr->dt.di.dr_children); - mutex_destroy(&dr->dt.di.dr_mtx); - } kmem_free(dr, sizeof (dbuf_dirty_record_t)); ASSERT(db->db_dirtycnt > 0); db->db_dirtycnt -= 1; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Thu Jan 7 13:42:28 2010 (r201744) @@ -1131,7 +1131,6 @@ dmu_objset_find_spa(spa_t *spa, const ch dsl_dir_close(dd, FTAG); return (0); } - attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); thisobj = dd->dd_phys->dd_head_dataset_obj; attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Thu Jan 7 13:42:28 2010 (r201744) @@ -864,7 +864,6 @@ dsl_snapshot_destroy_one(char *name, voi (void) strcat(name, da->snapname); err = dsl_dataset_own(name, DS_MODE_READONLY | DS_MODE_INCONSISTENT, da->dstg, &ds); - cp = strchr(name, '@'); *cp = '\0'; if (err == 0) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Thu Jan 7 13:42:28 2010 (r201744) @@ -85,6 +85,7 @@ rrn_find(rrwlock_t *rrl) if (refcount_count(&rrl->rr_linked_rcount) == 0) return (NULL); + for (rn = tsd_get(rrw_tsd_key); rn != NULL; rn = rn->rn_next) { if (rn->rn_rrl == rrl) return (rn); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Thu Jan 7 13:42:28 2010 (r201744) @@ -87,6 +87,7 @@ spa_config_load(void) (void) snprintf(pathname, MAXPATHLEN, "%s", spa_config_path); file = kobj_open_file(pathname); + if (file == (struct _buf *)-1) { ZFS_LOG(1, "Cannot open %s.", pathname); goto out; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Jan 7 13:42:28 2010 (r201744) @@ -432,7 +432,7 @@ vdev_geom_open_by_guid(vdev_t *vd) if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); - + snprintf(buf, len, "/dev/%s", cp->provider->name); spa_strfree(vd->vdev_path); vd->vdev_path = buf; @@ -662,11 +662,11 @@ static void vdev_geom_io_done(zio_t *zio) { - /* - * If the device returned ENXIO, then attempt we should verify if GEOM - * provider has been removed. If this is the case, then we trigger an - * asynchronous removal of the device. - */ + /* + * If the device returned ENXIO, then attempt we should verify if GEOM + * provider has been removed. If this is the case, then we trigger an + * asynchronous removal of the device. + */ if (zio->io_error == ENXIO) { vdev_t *vd = zio->io_vd; vdev_geom_ctx_t *ctx; Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jan 7 13:42:28 2010 (r201744) @@ -870,15 +870,6 @@ vdev_raidz_io_done(zio_t *zio) * so we can write it out to the failed device * later. */ - - /* - * If we read parity information (unnecessarily - * as it happens since no reconstruction was - * needed) regenerate and verify the parity. - * We also regenerate parity when resilvering - * so we can write it out to the failed device - * later. - */ if (parity_errors + parity_untried < rm->rm_firstdatacol || (zio->io_flags & ZIO_FLAG_RESILVER)) { Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Thu Jan 7 13:42:28 2010 (r201744) @@ -653,8 +653,8 @@ zfsctl_snapdir_remove(vnode_t *dvp, char } } - ZFS_EXIT(zfsvfs); + err = zfsctl_snapshot_zname(dvp, name, MAXNAMELEN, snapname); if (!err) err = zfs_secpolicy_destroy_perms(snapname, cr); @@ -1060,6 +1060,7 @@ zfsctl_snapshot_mknode(vnode_t *pvp, uin zcp->zc_id = objset; VFS_HOLD(vp->v_vfsp); VOP_UNLOCK(vp, 0, curthread); + return (vp); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jan 7 13:42:28 2010 (r201744) @@ -24,7 +24,6 @@ */ #include -#include #include #include #include Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Thu Jan 7 13:42:28 2010 (r201744) @@ -451,7 +451,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * { itx_wr_state_t write_state; boolean_t slogging; - uintptr_t fsync_cnt = 0; + uintptr_t fsync_cnt; if (zilog == NULL || zp->z_unlinked) return; @@ -486,6 +486,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * write_state = WR_COPIED; else write_state = WR_NEED_COPY; + if ((fsync_cnt = (uintptr_t)tsd_get(zfs_fsyncer_key)) != 0) { (void) tsd_set(zfs_fsyncer_key, (void *)(fsync_cnt - 1)); } Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Thu Jan 7 13:42:28 2010 (r201744) @@ -710,12 +710,6 @@ zfs_mount(vfs_t *vfsp, kthread_t *td) int error = 0; int canwrite; -#if 0 - /* TODO: For now deny user mounts. */ - if ((error = priv_check(td, PRIV_VFS_MOUNT)) != 0) - return (error); - -#endif if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL)) return (EINVAL); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jan 7 13:42:28 2010 (r201744) @@ -23,7 +23,6 @@ * Use is subject to license terms. */ - /* Portions Copyright 2007 Jeremy Teo */ #include @@ -2301,6 +2300,7 @@ zfs_fsync(vnode_t *vp, int syncflag, cre zfsvfs_t *zfsvfs = zp->z_zfsvfs; (void) tsd_set(zfs_fsyncer_key, (void *)zfs_fsync_sync_cnt); + ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); zil_commit(zfsvfs->z_log, zp->z_last_itx, zp->z_id); Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Jan 7 13:31:00 2010 (r201743) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Thu Jan 7 13:42:28 2010 (r201744) @@ -363,6 +363,7 @@ typedef enum zfs_cache_type { #define ZPOOL_CONFIG_FAULTED "faulted" #define ZPOOL_CONFIG_DEGRADED "degraded" #define ZPOOL_CONFIG_REMOVED "removed" + #define VDEV_TYPE_ROOT "root" #define VDEV_TYPE_MIRROR "mirror" #define VDEV_TYPE_REPLACING "replacing" From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 13:53:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5DAB1065692; Thu, 7 Jan 2010 13:53:47 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CD008FC15; Thu, 7 Jan 2010 13:53:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07DrltZ069395; Thu, 7 Jan 2010 13:53:47 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07Drl2F069393; Thu, 7 Jan 2010 13:53:47 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071353.o07Drl2F069393@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 13:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201745 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 13:53:47 -0000 Author: luigi Date: Thu Jan 7 13:53:47 2010 New Revision: 201745 URL: http://svn.freebsd.org/changeset/base/201745 Log: we don't use dummynet_drain! Modified: head/sys/netinet/ipfw/ip_dummynet.c Modified: head/sys/netinet/ipfw/ip_dummynet.c ============================================================================== --- head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 13:42:28 2010 (r201744) +++ head/sys/netinet/ipfw/ip_dummynet.c Thu Jan 7 13:53:47 2010 (r201745) @@ -103,7 +103,7 @@ static int red_lookup_depth = 256; /* RE static int red_avg_pkt_size = 512; /* RED - default medium packet size */ static int red_max_pkt_size = 1500; /* RED - default max packet size */ -static struct timeval prev_t, t; +static struct timeval prev_t; static long tick_last; /* Last tick duration (usec). */ static long tick_delta; /* Last vs standard tick diff (usec). */ static long tick_delta_sum; /* Accumulated tick difference (usec).*/ @@ -239,7 +239,6 @@ static int ip_dn_ctl(struct sockopt *sop static void dummynet(void *); static void dummynet_flush(void); static void dummynet_send(struct mbuf *); -void dummynet_drain(void); static int dummynet_io(struct mbuf **, int , struct ip_fw_args *); /* @@ -851,7 +850,9 @@ dummynet(void * __unused unused) } /* - * The main dummynet processing function. + * The timer handler for dummynet. Time is computed in ticks, but + * but the code is tolerant to the actual rate at which this is called. + * Once complete, the function reschedules itself for the next tick. */ static void dummynet_task(void *context, int pending) @@ -862,6 +863,7 @@ dummynet_task(void *context, int pending struct dn_heap *h; void *p; /* generic parameter to handler */ int i; + struct timeval t; DUMMYNET_LOCK(); @@ -1955,35 +1957,6 @@ pipe_remove_from_heap(struct dn_heap *h, } /* - * drain all queues. Called in case of severe mbuf shortage. - */ -void -dummynet_drain(void) -{ - struct dn_flow_set *fs; - struct dn_pipe *pipe; - int i; - - DUMMYNET_LOCK_ASSERT(); - - heap_free(&ready_heap); - heap_free(&wfq_ready_heap); - heap_free(&extract_heap); - /* remove all references to this pipe from flow_sets */ - for (i = 0; i < HASHSIZE; i++) - SLIST_FOREACH(fs, &flowsethash[i], next) - purge_flow_set(fs, 0); - - for (i = 0; i < HASHSIZE; i++) { - SLIST_FOREACH(pipe, &pipehash[i], next) { - purge_flow_set(&(pipe->fs), 0); - dn_free_pkts(pipe->head); - pipe->head = pipe->tail = NULL; - } - } -} - -/* * Fully delete a pipe or a queue, cleaning up associated info. */ static int From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 14:15:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB00106568F; Thu, 7 Jan 2010 14:15:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id CEDD08FC1D; Thu, 7 Jan 2010 14:15:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id B4FB441C707; Thu, 7 Jan 2010 15:15:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id KsCAsXxeyn7w; Thu, 7 Jan 2010 15:15:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 2822C41C6A7; Thu, 7 Jan 2010 15:15:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 77C3C4448EC; Thu, 7 Jan 2010 14:13:01 +0000 (UTC) Date: Thu, 7 Jan 2010 14:13:01 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Luigi Rizzo In-Reply-To: <201001071353.o07Drl2F069393@svn.freebsd.org> Message-ID: <20100107141227.T50938@maildrop.int.zabbadoz.net> References: <201001071353.o07Drl2F069393@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201745 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 14:15:08 -0000 On Thu, 7 Jan 2010, Luigi Rizzo wrote: > Author: luigi > Date: Thu Jan 7 13:53:47 2010 > New Revision: 201745 > URL: http://svn.freebsd.org/changeset/base/201745 > > Log: > we don't use dummynet_drain! I think this doesn't fix all... 40 9418664 1197140 2515480 13131284 c85e14 kernel.debug 41 In file included from /scratch/tmp/bz/HEAD.commit/sys/modules/netgraph/ipfw/../../../netgraph/ng_ipfw.c:47: 42 @/netinet/ipfw/ip_fw_private.h:85: error: field 'rule' has incomplete type 43 *** Error code 1 -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 14:15:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB8A106568B; Thu, 7 Jan 2010 14:15:35 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48A538FC1D; Thu, 7 Jan 2010 14:15:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07EFZnL074329; Thu, 7 Jan 2010 14:15:35 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07EFZZF074326; Thu, 7 Jan 2010 14:15:35 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201001071415.o07EFZZF074326@svn.freebsd.org> From: Bruce M Simpson Date: Thu, 7 Jan 2010 14:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201747 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 14:15:35 -0000 Author: bms Date: Thu Jan 7 14:15:34 2010 New Revision: 201747 URL: http://svn.freebsd.org/changeset/base/201747 Log: MFC r200871: Use ALLOW_NEW_SOURCES and BLOCK_OLD_SOURCES to signal a join or leave with SSM MLDv2 by default. This is current practice and complies with RFC 4604, as well as being required by production IPv6 networks in Japan. The behaviour may be disabled by setting the net.inet6.mld.use_allow sysctl/tunable to 0. Requested by: Hideki Yamamoto, dikshie Modified: stable/8/sys/netinet6/mld6.c stable/8/sys/netinet6/mld6_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/mld6.c ============================================================================== --- stable/8/sys/netinet6/mld6.c Thu Jan 7 14:05:40 2010 (r201746) +++ stable/8/sys/netinet6/mld6.c Thu Jan 7 14:15:34 2010 (r201747) @@ -132,7 +132,8 @@ static struct mbuf * static int mld_v2_enqueue_filter_change(struct ifqueue *, struct in6_multi *); static int mld_v2_enqueue_group_record(struct ifqueue *, - struct in6_multi *, const int, const int, const int); + struct in6_multi *, const int, const int, const int, + const int); static int mld_v2_input_query(struct ifnet *, const struct ip6_hdr *, struct mbuf *, const int, const int); static int mld_v2_merge_state_changes(struct in6_multi *, @@ -236,6 +237,11 @@ SYSCTL_INT(_net_inet6_mld, OID_AUTO, v1e &mld_v1enable, 0, "Enable fallback to MLDv1"); TUNABLE_INT("net.inet6.mld.v1enable", &mld_v1enable); +static int mld_use_allow = 1; +SYSCTL_INT(_net_inet6_mld, OID_AUTO, use_allow, CTLFLAG_RW, + &mld_use_allow, 0, "Use ALLOW/BLOCK for RFC 4604 SSM joins/leaves"); +TUNABLE_INT("net.inet6.mld.use_allow", &mld_use_allow); + /* * Packed Router Alert option structure declaration. */ @@ -461,6 +467,8 @@ mld_domifattach(struct ifnet *ifp) mli = mli_alloc_locked(ifp); if (!(ifp->if_flags & IFF_MULTICAST)) mli->mli_flags |= MLIF_SILENT; + if (mld_use_allow) + mli->mli_flags |= MLIF_USEALLOW; MLD_UNLOCK(); @@ -1550,7 +1558,8 @@ mld_v2_process_group_timers(struct mld_i int retval; retval = mld_v2_enqueue_group_record(qrq, inm, 0, 1, - (inm->in6m_state == MLD_SG_QUERY_PENDING_MEMBER)); + (inm->in6m_state == MLD_SG_QUERY_PENDING_MEMBER), + 0); CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval); inm->in6m_state = MLD_REPORTING_MEMBER; @@ -2025,7 +2034,7 @@ mld_initial_join(struct in6_multi *inm, ifq = &inm->in6m_scq; _IF_DRAIN(ifq); retval = mld_v2_enqueue_group_record(ifq, inm, 1, - 0, 0); + 0, 0, (mli->mli_flags & MLIF_USEALLOW)); CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval); if (retval <= 0) { @@ -2118,7 +2127,8 @@ mld_handle_state_change(struct in6_multi _IF_DRAIN(&inm->in6m_scq); - retval = mld_v2_enqueue_group_record(&inm->in6m_scq, inm, 1, 0, 0); + retval = mld_v2_enqueue_group_record(&inm->in6m_scq, inm, 1, 0, 0, + (mli->mli_flags & MLIF_USEALLOW)); CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval); if (retval <= 0) return (-retval); @@ -2203,7 +2213,8 @@ mld_final_leave(struct in6_multi *inm, s in6m_acquire_locked(inm); retval = mld_v2_enqueue_group_record( - &inm->in6m_scq, inm, 1, 0, 0); + &inm->in6m_scq, inm, 1, 0, 0, + (mli->mli_flags & MLIF_USEALLOW)); KASSERT(retval != 0, ("%s: enqueue record = %d", __func__, retval)); @@ -2250,6 +2261,10 @@ mld_final_leave(struct in6_multi *inm, s * it was recorded for a Group-Source query, and will be omitted if * it is not both in-mode and recorded. * + * If use_block_allow is non-zero, state change reports for initial join + * and final leave, on an inclusive mode group with a source list, will be + * rewritten to use the ALLOW_NEW and BLOCK_OLD record types, respectively. + * * The function will attempt to allocate leading space in the packet * for the IPv6+ICMP headers to be prepended without fragmenting the chain. * @@ -2260,7 +2275,7 @@ mld_final_leave(struct in6_multi *inm, s static int mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, const int is_state_change, const int is_group_query, - const int is_source_query) + const int is_source_query, const int use_block_allow) { struct mldv2_record mr; struct mldv2_record *pmr; @@ -2308,10 +2323,16 @@ mld_v2_enqueue_group_record(struct ifque * If the mode did not change, and there are non-ASM * listeners or source filters present, * we potentially need to issue two records for the group. - * If we are transitioning to MCAST_UNDEFINED, we need - * not send any sources. * If there are ASM listeners, and there was no filter * mode transition of any kind, do nothing. + * + * If we are transitioning to MCAST_UNDEFINED, we need + * not send any sources. A transition to/from this state is + * considered inclusive with some special treatment. + * + * If we are rewriting initial joins/leaves to use + * ALLOW/BLOCK, and the group's membership is inclusive, + * we need to send sources in all cases. */ if (mode != inm->in6m_st[0].iss_fmode) { if (mode == MCAST_EXCLUDE) { @@ -2321,9 +2342,26 @@ mld_v2_enqueue_group_record(struct ifque } else { CTR1(KTR_MLD, "%s: change to INCLUDE", __func__); - type = MLD_CHANGE_TO_INCLUDE_MODE; - if (mode == MCAST_UNDEFINED) - record_has_sources = 0; + if (use_block_allow) { + /* + * XXX + * Here we're interested in state + * edges either direction between + * MCAST_UNDEFINED and MCAST_INCLUDE. + * Perhaps we should just check + * the group state, rather than + * the filter mode. + */ + if (mode == MCAST_UNDEFINED) { + type = MLD_BLOCK_OLD_SOURCES; + } else { + type = MLD_ALLOW_NEW_SOURCES; + } + } else { + type = MLD_CHANGE_TO_INCLUDE_MODE; + if (mode == MCAST_UNDEFINED) + record_has_sources = 0; + } } } else { if (record_has_sources) { @@ -2436,9 +2474,12 @@ mld_v2_enqueue_group_record(struct ifque * If we are appending to an existing packet, we need to obtain * a pointer to the group record after m_append(), in case a new * mbuf was allocated. + * * Only append sources which are in-mode at t1. If we are - * transitioning to MCAST_UNDEFINED state on the group, do not - * include source entries. + * transitioning to MCAST_UNDEFINED state on the group, and + * use_block_allow is zero, do not include source entries. + * Otherwise, we need to include this source in the report. + * * Only report recorded sources in our filter set when responding * to a group-source query. */ @@ -2460,7 +2501,8 @@ mld_v2_enqueue_group_record(struct ifque now = im6s_get_mode(inm, ims, 1); CTR2(KTR_MLD, "%s: node is %d", __func__, now); if ((now != mode) || - (now == mode && mode == MCAST_UNDEFINED)) { + (now == mode && + (!use_block_allow && mode == MCAST_UNDEFINED))) { CTR1(KTR_MLD, "%s: skip node", __func__); continue; } @@ -2550,7 +2592,8 @@ mld_v2_enqueue_group_record(struct ifque __func__, ip6_sprintf(ip6tbuf, &ims->im6s_addr)); now = im6s_get_mode(inm, ims, 1); if ((now != mode) || - (now == mode && mode == MCAST_UNDEFINED)) { + (now == mode && + (!use_block_allow && mode == MCAST_UNDEFINED))) { CTR1(KTR_MLD, "%s: skip node", __func__); continue; } @@ -2961,7 +3004,7 @@ mld_v2_dispatch_general_query(struct mld case MLD_AWAKENING_MEMBER: inm->in6m_state = MLD_REPORTING_MEMBER; retval = mld_v2_enqueue_group_record(&mli->mli_gq, - inm, 0, 0, 0); + inm, 0, 0, 0, 0); CTR2(KTR_MLD, "%s: enqueue record = %d", __func__, retval); break; Modified: stable/8/sys/netinet6/mld6_var.h ============================================================================== --- stable/8/sys/netinet6/mld6_var.h Thu Jan 7 14:05:40 2010 (r201746) +++ stable/8/sys/netinet6/mld6_var.h Thu Jan 7 14:15:34 2010 (r201747) @@ -55,6 +55,7 @@ struct mld_ifinfo { struct ifqueue mli_gq; /* queue of general query responses */ }; #define MLIF_SILENT 0x00000001 /* Do not use MLD on this ifp */ +#define MLIF_USEALLOW 0x00000002 /* Use ALLOW/BLOCK for joins/leaves */ #define MLD_RANDOM_DELAY(X) (arc4random() % (X) + 1) #define MLD_MAX_STATE_CHANGES 24 /* Max pending changes per group */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 14:23:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3050106568B; Thu, 7 Jan 2010 14:23:19 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 927978FC08; Thu, 7 Jan 2010 14:23:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07ENJKj076086; Thu, 7 Jan 2010 14:23:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07ENJnO076084; Thu, 7 Jan 2010 14:23:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001071423.o07ENJnO076084@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 7 Jan 2010 14:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201748 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 14:23:19 -0000 Author: luigi Date: Thu Jan 7 14:23:19 2010 New Revision: 201748 URL: http://svn.freebsd.org/changeset/base/201748 Log: ip_var.h now needs to be before ip_fw_private.h Modified: head/sys/netgraph/ng_ipfw.c Modified: head/sys/netgraph/ng_ipfw.c ============================================================================== --- head/sys/netgraph/ng_ipfw.c Thu Jan 7 14:15:34 2010 (r201747) +++ head/sys/netgraph/ng_ipfw.c Thu Jan 7 14:23:19 2010 (r201748) @@ -43,10 +43,10 @@ #include #include #include +#include #include #include #include -#include #include #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 14:23:48 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BE2E1065672; Thu, 7 Jan 2010 14:23:48 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 18F6A8FC15; Thu, 7 Jan 2010 14:23:46 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 408C6730A1; Thu, 7 Jan 2010 15:31:45 +0100 (CET) Date: Thu, 7 Jan 2010 15:31:45 +0100 From: Luigi Rizzo To: "Bjoern A. Zeeb" Message-ID: <20100107143145.GA28781@onelab2.iet.unipi.it> References: <201001071353.o07Drl2F069393@svn.freebsd.org> <20100107141227.T50938@maildrop.int.zabbadoz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100107141227.T50938@maildrop.int.zabbadoz.net> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r201745 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 14:23:48 -0000 On Thu, Jan 07, 2010 at 02:13:01PM +0000, Bjoern A. Zeeb wrote: > On Thu, 7 Jan 2010, Luigi Rizzo wrote: > > >Author: luigi > >Date: Thu Jan 7 13:53:47 2010 > >New Revision: 201745 > >URL: http://svn.freebsd.org/changeset/base/201745 > > > >Log: > > we don't use dummynet_drain! > > I think this doesn't fix all... fixed , thanks -- i thought i had done it already but it was in my branch instead. > 40 9418664 1197140 2515480 13131284 c85e14 kernel.debug > 41 In file included from > /scratch/tmp/bz/HEAD.commit/sys/modules/netgraph/ipfw/../../../netgraph/ng_ipfw.c:47: > 42 @/netinet/ipfw/ip_fw_private.h:85: error: field 'rule' has incomplete > type > 43 *** Error code 1 > > > -- > Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 15:15:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C71D1065672; Thu, 7 Jan 2010 15:15:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id AF6888FC08; Thu, 7 Jan 2010 15:15:13 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o07FFAWp021843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jan 2010 02:15:11 +1100 Date: Fri, 8 Jan 2010 02:15:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Alexander Motin In-Reply-To: <4B450F30.20705@FreeBSD.org> Message-ID: <20100108013737.S56162@delplex.bde.org> References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> <4B450F30.20705@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 15:15:14 -0000 On Thu, 7 Jan 2010, Alexander Motin wrote: > Ivan Voras wrote: >> Yes, my experience which lead to the post was mostly on UFS which, >> while AFAIK it does read-ahead, it still does it serially (I think >> this is implied by your experiments with NCQ and ZFS vs UFS) - so in >> any case only 2 drives are hit with 64k stripe size at any moment in >> time. > > I do not think it is true. On system with default MAXPHYS I've made > gstripe with 64K block of 4 equal drives with 108MB/s of maximal read > speed. Reads with dd from large pre-written file on UFS shown: > > vfs.read_max=8 (default) - 235090074 bytes/sec > vfs.read_max=16 - 378385148 bytes/sec > vfs.read_max=32 - 386620109 bytes/sec Maybe I'm wrong about it being limited by MAXPHYS. 'racluster' is limited by MAXPHYS, but 'maxra' (vfs.read_max) is not, and these interact confusingly. BTW, vfs.read_max has bogus units -- fs blocks (bsize not fsize for ffs IIRC). The default of 8 works very badly when the fs block size is small (512 say). In my version, the units are DEV_BSIZE blocks and the default is the default MAXPHYS/DEV_BSIZE (should be MAXPHYS/DEV_BSIZE). > I've put some printfs into the clustering read code and found enough > read-ahead there. So it works. > > One thing IMHO would be nice to see there is the alignment of the > read-ahead requests to the array stripe size/offset. Dirty hack I've > tried there, reduced number of requests to the array components by 30%. ffs thinks that bsize alignment is adequate. It doesn't try to align files any more than that. Then for sequential reads from the beginning of the file, vfs read clustering tries to read MAXPHYS bytes at a time, so it perfectly preserves any initial misalignment. I'm not sure what happens for large random reads. Does seeking ouside of the read-ahead reset the alignment to the seek point? It shouldn't, if alignment done by the file system is to work right. However, vfs should re-align if the file system or user i/o doesn't, so that all of its reads of mnt_iosize_max bytes start on an alignment boundary. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 15:37:14 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4273D1065670; Thu, 7 Jan 2010 15:37:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 90EF28FC12; Thu, 7 Jan 2010 15:37:13 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o07Fb9Bf004779 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jan 2010 02:37:11 +1100 Date: Fri, 8 Jan 2010 02:37:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Konstantin Belousov In-Reply-To: <201001052020.o05KKVEp002337@svn.freebsd.org> Message-ID: <20100108023003.L56206@delplex.bde.org> References: <201001052020.o05KKVEp002337@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 15:37:14 -0000 On Tue, 5 Jan 2010, Konstantin Belousov wrote: > Log: > Do not rely on behaviour undefined by ANSI C, use thunks to adapt > alphasort-like interface to the comparision function required by > qsort() and qsort_r(). > > For opendir() thunk and alphasort(), comment on why we deviated from > POSIX by using strcmp() instead of strcoll(). > > Requested and reviewed by: bde > MFC after: 2 weeks Thanks. FreeBSD (wollman) fixed the corresponding undefined behaviour (which was inherited from 4.4BSD) in fts's comparison function in 2002. fts uses extra indirections and mostly-wasted space instead of qsort_r(). Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 16:18:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D3C6106566C; Thu, 7 Jan 2010 16:18:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3428FC18; Thu, 7 Jan 2010 16:18:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07GIkRO001600; Thu, 7 Jan 2010 16:18:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07GIkeb001598; Thu, 7 Jan 2010 16:18:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001071618.o07GIkeb001598@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 7 Jan 2010 16:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201749 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 16:18:46 -0000 Author: bz Date: Thu Jan 7 16:18:46 2010 New Revision: 201749 URL: http://svn.freebsd.org/changeset/base/201749 Log: Bump __FreeBSD_version to 800500 which should have happened already after r198460 but was missed. Note: that 800108 should have been 800501 with that but as there is no functional problem here, it'll just stay as is. [1] This will make pkg_add -r use packages-8-stable for stable/8 rather than packages-8.0-release. Reported by: Paride Legovini (pl ninthfloor.org) on stable@, (pluknet gmail.com), jhb Discussed with: rwatson [1] Modified: stable/8/sys/sys/param.h Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Thu Jan 7 14:23:19 2010 (r201748) +++ stable/8/sys/sys/param.h Thu Jan 7 16:18:46 2010 (r201749) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 800108 /* Master, propagated to newvers */ +#define __FreeBSD_version 800500 /* Master, propagated to newvers */ #ifndef LOCORE #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 16:29:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EA71106568B; Thu, 7 Jan 2010 16:29:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by mx1.freebsd.org (Postfix) with ESMTP id 140AE8FC12; Thu, 7 Jan 2010 16:29:10 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o07GT78s004851 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jan 2010 03:29:09 +1100 Date: Fri, 8 Jan 2010 03:29:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Andrey Chernov In-Reply-To: <20100107050409.GA85573@nagual.pp.ru> Message-ID: <20100108030937.Q56559@delplex.bde.org> References: <201001052020.o05KKVEp002337@svn.freebsd.org> <20100107050409.GA85573@nagual.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 16:29:11 -0000 On Thu, 7 Jan 2010, Andrey Chernov wrote: > On Tue, Jan 05, 2010 at 08:20:31PM +0000, Konstantin Belousov wrote: >> * Alphabetic order comparison routine for those who want it. >> + * >> + * XXXKIB POSIX 2008 requires the alphasort() to use strcoll(). Keep >> + * strcmp() for now, since environment locale settings could have no >> + * relevance for the byte sequence of the file name. Moreover, it >> + * might be even invalid sequence in current locale, and then >> + * behaviour of alphasort would be undefined. >> */ > > This is wrong turn. Nothing has turned here yet. We just didn't want to risk changing alphasort() yet. > Exact the same can be said about text files: "environment locale > settings could have no relevance for the byte sequence of the text. > Moreover, it might be even invalid sequence in current locale, and then > behaviour of sort would be undefined". Despite of this, we use > localized sort in the system. > > You made result of something like 'ls | sort' and alphasort() differs. alphasort() has always used strcmp(). It became inconsistent with plain ls when you changed ls to use strcoll() in 2006. (ls has never used scandir() or alphasort() in FreeBSD; it uses fts). "| sort" might be useable to give the same ordering for both ls and utilities using alphasort(). POSIX adds an EINVAL error and a requirement that errno no be modified if there is no error, so that errors from strcoll() can be detected (still messily -- you have to set errno to != EINVAL before the call). Maybe falling back to strcmp() is good enough for the errnor handling. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 16:52:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FCCC1065695; Thu, 7 Jan 2010 16:52:00 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F3F28FC18; Thu, 7 Jan 2010 16:52:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07Gq0Qf008959; Thu, 7 Jan 2010 16:52:00 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07Gq0gQ008957; Thu, 7 Jan 2010 16:52:00 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001071652.o07Gq0gQ008957@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 7 Jan 2010 16:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201750 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 16:52:00 -0000 Author: trasz Date: Thu Jan 7 16:52:00 2010 New Revision: 201750 URL: http://svn.freebsd.org/changeset/base/201750 Log: Remove BUGS section that no longer applies after recent changes to semaphore code. OK-ed by: davidxu Modified: head/lib/libc/gen/sem_init.3 Modified: head/lib/libc/gen/sem_init.3 ============================================================================== --- head/lib/libc/gen/sem_init.3 Thu Jan 7 16:18:46 2010 (r201749) +++ head/lib/libc/gen/sem_init.3 Thu Jan 7 16:52:00 2010 (r201750) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2009 +.Dd January 7, 2010 .Dt SEM_INIT 3 .Os .Sh NAME @@ -90,10 +90,3 @@ The .Fn sem_init function conforms to .St -p1003.1-96 . -.Sh BUGS -A sem_t is a pointer to a separately allocated structure, -therefore process shared semaphores only work between related processes -and do not perform very well -(each operation is a system call, -while single-process semaphores only do a system call -if they need to block or wake up a thread). From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 16:59:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0831106566C; Thu, 7 Jan 2010 16:59:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id C41528FC16; Thu, 7 Jan 2010 16:59:23 +0000 (UTC) Received: by fxm27 with SMTP id 27so3890663fxm.3 for ; Thu, 07 Jan 2010 08:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=uO5WrjrkHwEqGKdd6QQgcOYfxqdlYkBSa4ylknVw9l4=; b=O0xEU34l7SNxrCvYMvTX6HhjKmi4bs4L/tPIKutWYUDWAE/6iqwh8CgFS1pzqk/eSk u1teJwChOUW9vgEIq23arT9yv+q4UKWQbgtB58BUJnQWqf6dL1ohHvqYyv38Cv3+wdOk hBuwtfz9hJvSneodbrJmKacpBvP1OFptvZt0s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=oCUztKdJoP4QsjVT+KzSXfUlKjeEv4GrB4KyieCf4/tfuCds3s62TJXRsXPcxWRilA V/g4lmdOn3u5TS7F1o1uPA0F1qj21o5KY+3W4gYoubIV7CeZDr5rUiemFCNNDFR9nTGP tXWusc96IJCWTuizKnVfUa/T0IuUf8oJ9/BXE= Received: by 10.223.29.193 with SMTP id r1mr289509fac.29.1262883557063; Thu, 07 Jan 2010 08:59:17 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 13sm7796508fxm.1.2010.01.07.08.59.14 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Jan 2010 08:59:15 -0800 (PST) Sender: Alexander Motin Message-ID: <4B4612E2.70506@FreeBSD.org> Date: Thu, 07 Jan 2010 18:59:14 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Bruce Evans References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> <4B450F30.20705@FreeBSD.org> <20100108013737.S56162@delplex.bde.org> In-Reply-To: <20100108013737.S56162@delplex.bde.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 16:59:24 -0000 Bruce Evans wrote: > On Thu, 7 Jan 2010, Alexander Motin wrote: >> One thing IMHO would be nice to see there is the alignment of the >> read-ahead requests to the array stripe size/offset. Dirty hack I've >> tried there, reduced number of requests to the array components by 30%. > > ffs thinks that bsize alignment is adequate. Alignment definitely should be adequate, but it is a different task. I say that bsize and stripe size are not needed to be equal, as they serve different purposes. Even with perfectly aligned usual 16K bsize and 64K stripe size we will have 75% chance of misaligned I/O. > It doesn't try to align > files any more than that. Then for sequential reads from the beginning > of the file, vfs read clustering tries to read MAXPHYS bytes at a time, > so it perfectly preserves any initial misalignment. I think we would benefit, if vfs could shrink first request of long read-ahead session a bit, to get all further MAXPHYS-sized reads to not cross more stripe boundaries then really required. In worst case it can generate one extra request to array, in best case it can twice reduce number of requests to the array components. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 17:34:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E0C6106566C; Thu, 7 Jan 2010 17:34:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63ED68FC08; Thu, 7 Jan 2010 17:34:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07HYjsd018390; Thu, 7 Jan 2010 17:34:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07HYjIr018386; Thu, 7 Jan 2010 17:34:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001071734.o07HYjIr018386@svn.freebsd.org> From: Alan Cox Date: Thu, 7 Jan 2010 17:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201751 - in head/sys/i386: i386 include xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 17:34:45 -0000 Author: alc Date: Thu Jan 7 17:34:45 2010 New Revision: 201751 URL: http://svn.freebsd.org/changeset/base/201751 Log: Make pmap_set_pg() static. Modified: head/sys/i386/i386/pmap.c head/sys/i386/include/pmap.h head/sys/i386/xen/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jan 7 16:52:00 2010 (r201750) +++ head/sys/i386/i386/pmap.c Thu Jan 7 17:34:45 2010 (r201751) @@ -321,6 +321,7 @@ static vm_offset_t pmap_kmem_choose(vm_o #ifdef PAE static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); #endif +static void pmap_set_pg(void); CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); @@ -548,7 +549,7 @@ pmap_init_pat(void) /* * Set PG_G on kernel pages. Only the BSP calls this when SMP is turned on. */ -void +static void pmap_set_pg(void) { pd_entry_t pdir; Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Thu Jan 7 16:52:00 2010 (r201750) +++ head/sys/i386/include/pmap.h Thu Jan 7 17:34:45 2010 (r201751) @@ -480,7 +480,6 @@ boolean_t pmap_page_is_mapped(vm_page_t void pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma); void pmap_unmapdev(vm_offset_t, vm_size_t); pt_entry_t *pmap_pte(pmap_t, vm_offset_t) __pure2; -void pmap_set_pg(void); void pmap_invalidate_page(pmap_t, vm_offset_t); void pmap_invalidate_range(pmap_t, vm_offset_t, vm_offset_t); void pmap_invalidate_all(pmap_t); Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Jan 7 16:52:00 2010 (r201750) +++ head/sys/i386/xen/pmap.c Thu Jan 7 17:34:45 2010 (r201751) @@ -318,6 +318,7 @@ static __inline void pagezero(void *page #if defined(PAE) && !defined(XEN) static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); #endif +static void pmap_set_pg(void); CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); @@ -552,7 +553,7 @@ pmap_init_pat(void) /* * Set PG_G on kernel pages. Only the BSP calls this when SMP is turned on. */ -void +static void pmap_set_pg(void) { pd_entry_t pdir; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 17:46:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C8621065692; Thu, 7 Jan 2010 17:46:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C5278FC17; Thu, 7 Jan 2010 17:46:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07HkPJx020990; Thu, 7 Jan 2010 17:46:25 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07HkP8g020988; Thu, 7 Jan 2010 17:46:25 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201001071746.o07HkP8g020988@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 7 Jan 2010 17:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201752 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 17:46:25 -0000 Author: ume Date: Thu Jan 7 17:46:25 2010 New Revision: 201752 URL: http://svn.freebsd.org/changeset/base/201752 Log: Since the IPv4 rule allows ICMP_TIMXCEED, allow ICMP6_TIME_EXCEEDED as well for workstation type firewall. It makes traceroute6 work. Modified: head/etc/rc.firewall Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Thu Jan 7 17:34:45 2010 (r201751) +++ head/etc/rc.firewall Thu Jan 7 17:46:25 2010 (r201752) @@ -505,7 +505,10 @@ case ${firewall_type} in # Allow "mandatory" ICMP in. ${fwcmd} add pass icmp from any to any icmptype 3,4,11 - + if [ $ipv6_available -eq 0 ]; then + ${fwcmd} add pass ipv6-icmp from any to any icmp6type 3 + fi + # Add permits for this workstations published services below # Only IPs and nets in firewall_allowservices is allowed in. # If you really wish to let anyone use services on your From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 18:43:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46A241065672; Thu, 7 Jan 2010 18:43:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id CDB928FC12; Thu, 7 Jan 2010 18:43:22 +0000 (UTC) Received: from besplex.bde.org (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o07IhJQ3014812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 8 Jan 2010 05:43:20 +1100 Date: Fri, 8 Jan 2010 05:43:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexander Motin In-Reply-To: <4B4612E2.70506@FreeBSD.org> Message-ID: <20100108052300.P4481@besplex.bde.org> References: <201001061712.o06HCICF087127@svn.freebsd.org> <9bbcef731001060938k2b0014a2m15eef911b9922b2c@mail.gmail.com> <4B44D8FA.2000608@FreeBSD.org> <9bbcef731001061103u33fd289q727179454b21ce18@mail.gmail.com> <4B450F30.20705@FreeBSD.org> <20100108013737.S56162@delplex.bde.org> <4B4612E2.70506@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ivan Voras , Bruce Evans Subject: Re: svn commit: r201658 - head/sbin/geom/class/stripe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 18:43:23 -0000 On Thu, 7 Jan 2010, Alexander Motin wrote: > Bruce Evans wrote: >> On Thu, 7 Jan 2010, Alexander Motin wrote: >>> One thing IMHO would be nice to see there is the alignment of the >>> read-ahead requests to the array stripe size/offset. Dirty hack I've >>> tried there, reduced number of requests to the array components by 30%. >> >> ffs thinks that bsize alignment is adequate. > > Alignment definitely should be adequate, but it is a different task. I > say that bsize and stripe size are not needed to be equal, as they serve > different purposes. Even with perfectly aligned usual 16K bsize and 64K > stripe size we will have 75% chance of misaligned I/O. That's what I meant by bsize alignment (only) being thought to be adequate (by ffs, not us). >> It doesn't try to align >> files any more than that. Then for sequential reads from the beginning >> of the file, vfs read clustering tries to read MAXPHYS bytes at a time, >> so it perfectly preserves any initial misalignment. Even with alignment by vfs, with misalignment by ffs we would get things like an inital 64K read being split up into 48K (to reach a stripe alignment boundary), then 16K (since that is all that is left to read). For larger files starting with this misalignment, we would get i/o sizes like 48K+128K+...+128K+trailingK, except with ffs there is also the pessimal allocation of indirect blocks, which will put a bubble in the i/o at 12*bsize (default 192K) to seek far away to the indirect block. > I think we would benefit, if vfs could shrink first request of long > read-ahead session a bit, to get all further MAXPHYS-sized reads to not > cross more stripe boundaries then really required. In worst case it can > generate one extra request to array, in best case it can twice reduce > number of requests to the array components. Yes, that is the only relatively easy thing to change. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 19:37:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB601065672; Thu, 7 Jan 2010 19:37:21 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADED38FC17; Thu, 7 Jan 2010 19:37:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07JbLpl045525; Thu, 7 Jan 2010 19:37:21 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07JbL8Z045523; Thu, 7 Jan 2010 19:37:21 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001071937.o07JbL8Z045523@svn.freebsd.org> From: Antoine Brodin Date: Thu, 7 Jan 2010 19:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201754 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 19:37:21 -0000 Author: antoine Date: Thu Jan 7 19:37:21 2010 New Revision: 201754 URL: http://svn.freebsd.org/changeset/base/201754 Log: MFC r200129 to stable/8: Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros. Modified: stable/8/sys/vm/uma_int.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/uma_int.h ============================================================================== --- stable/8/sys/vm/uma_int.h Thu Jan 7 18:11:03 2010 (r201753) +++ stable/8/sys/vm/uma_int.h Thu Jan 7 19:37:21 2010 (r201754) @@ -144,10 +144,10 @@ #define UMA_HASH_INSERT(h, s, mem) \ SLIST_INSERT_HEAD(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), us_hlink); + (mem))], (s), us_hlink) #define UMA_HASH_REMOVE(h, s, mem) \ SLIST_REMOVE(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), uma_slab, us_hlink); + (mem))], (s), uma_slab, us_hlink) /* Hash table for freed address -> slab translation */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 19:40:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B9591065670; Thu, 7 Jan 2010 19:40:12 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A3EE8FC13; Thu, 7 Jan 2010 19:40:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07JeCEd046195; Thu, 7 Jan 2010 19:40:12 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07JeCdh046193; Thu, 7 Jan 2010 19:40:12 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001071940.o07JeCdh046193@svn.freebsd.org> From: Antoine Brodin Date: Thu, 7 Jan 2010 19:40:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201755 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 19:40:12 -0000 Author: antoine Date: Thu Jan 7 19:40:11 2010 New Revision: 201755 URL: http://svn.freebsd.org/changeset/base/201755 Log: MFC r200129 to stable/7: Remove trailing ";" in UMA_HASH_INSERT and UMA_HASH_REMOVE macros. Modified: stable/7/sys/vm/uma_int.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/uma_int.h ============================================================================== --- stable/7/sys/vm/uma_int.h Thu Jan 7 19:37:21 2010 (r201754) +++ stable/7/sys/vm/uma_int.h Thu Jan 7 19:40:11 2010 (r201755) @@ -144,10 +144,10 @@ #define UMA_HASH_INSERT(h, s, mem) \ SLIST_INSERT_HEAD(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), us_hlink); + (mem))], (s), us_hlink) #define UMA_HASH_REMOVE(h, s, mem) \ SLIST_REMOVE(&(h)->uh_slab_hash[UMA_HASH((h), \ - (mem))], (s), uma_slab, us_hlink); + (mem))], (s), uma_slab, us_hlink) /* Hash table for freed address -> slab translation */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 20:10:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 529E21065676; Thu, 7 Jan 2010 20:10:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40F198FC24; Thu, 7 Jan 2010 20:10:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07KAN1H053041; Thu, 7 Jan 2010 20:10:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07KANrI053039; Thu, 7 Jan 2010 20:10:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001072010.o07KANrI053039@svn.freebsd.org> From: Xin LI Date: Thu, 7 Jan 2010 20:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201756 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 20:10:23 -0000 Author: delphij Date: Thu Jan 7 20:10:22 2010 New Revision: 201756 URL: http://svn.freebsd.org/changeset/base/201756 Log: Re-apply onnv-gate revisions 7994 and 8986 (corresponds to FreeBSD revision 200726 and 200727). It looks like that the two revisions were not applied in the right sequence, I found this when comparing with the OpenSolaris code. MFC after: 3 days Reviewed by: mm@ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Jan 7 19:40:11 2010 (r201755) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Jan 7 20:10:22 2010 (r201756) @@ -847,6 +847,12 @@ restore_object(struct restorearg *ra, ob if (err != 0 && err != ENOENT) return (EINVAL); + if (drro->drr_bonuslen) { + data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); + if (ra->err) + return (ra->err); + } + if (err == ENOENT) { /* currently free, want to be allocated */ tx = dmu_tx_create(os); @@ -862,7 +868,6 @@ restore_object(struct restorearg *ra, ob dmu_tx_commit(tx); } else { /* currently allocated, want to be allocated */ - err = dmu_object_reclaim(os, drro->drr_object, drro->drr_type, drro->drr_blksz, drro->drr_bonustype, drro->drr_bonuslen); @@ -870,12 +875,6 @@ restore_object(struct restorearg *ra, ob if (err) return (EINVAL); - if (drro->drr_bonuslen) { - data = restore_read(ra, P2ROUNDUP(drro->drr_bonuslen, 8)); - if (ra->err) - return (ra->err); - } - tx = dmu_tx_create(os); dmu_tx_hold_bonus(tx, drro->drr_object); err = dmu_tx_assign(tx, TXG_WAIT); From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 20:35:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27794106568B; Thu, 7 Jan 2010 20:35:37 +0000 (UTC) (envelope-from philip@paeps.cx) Received: from rincewind.paeps.cx (rincewind.paeps.cx [IPv6:2002:596a:f092::149]) by mx1.freebsd.org (Postfix) with ESMTP id D92688FC18; Thu, 7 Jan 2010 20:35:36 +0000 (UTC) Received: by rincewind.paeps.cx (Postfix, from userid 1001) id 46AF2D74404; Thu, 7 Jan 2010 21:35:36 +0100 (CET) Date: Thu, 7 Jan 2010 21:35:36 +0100 From: Philip Paeps To: Luigi Rizzo Message-ID: <20100107203536.GB8230@rincewind.paeps.cx> Mail-Followup-To: Luigi Rizzo , Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> <20100104222323.GA49068@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100104222323.GA49068@onelab2.iet.unipi.it> X-PGP-Fingerprint: 356B AE02 4763 F739 2FA2 E438 2649 E628 C5D3 4D05 X-Date: Today is Boomtime, the 7th day of Chaos in the YOLD 3176 X-Phase-of-Moon: The Moon is Waning Crescent (46% of Full) X-Philip-Conspiracy: There is no conspiracy Organization: Happily Disorganized User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 20:35:37 -0000 On 2010-01-04 23:23:23 (+0100), Luigi Rizzo wrote: > This was the reason why I moved ipfw-related stuff out of the way > and plan to do the same with tcp unless someone precedes me. Please discuss this on -net or so first. I have worked in an environment where tcp was moved out of netinet when it was imported (around 2.2.8-time) and it opens the door to a number of strange phenomena. What do you do with udp, for instance? Compared to tcp and sctp, it's trivial in terms of code, but it's an upper layer protocol from the perspective of netinet/netinet6 - do we put it in its own directory too? Also note that this won't only cause churn for people who have patches against or (out-of-tree) branches from netinet/, but also in other kernel subsystems which rely on tcp -- nfs, for instance. I would be very hesitant to do this... > Just checked, in 2.2 (which was some 12 years ago) netinet/ > had 46 files and 21k lines, of which tcp accounted for 13 files/6K lines. > Compare with 156 files/153k lines (tcp: 24 files, 16k lines) in HEAD now. TCP has got a bit more complicated in its old age. :-) I think the naming convention we have under netinet/ is clear enough... We don't pay per dirent these days. - Philip -- Philip Paeps Please don't Cc me, I am philip@freebsd.org subscribed to the list. From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 20:58:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7345106568F; Thu, 7 Jan 2010 20:58:02 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 95BB28FC14; Thu, 7 Jan 2010 20:58:01 +0000 (UTC) Received: by bwz5 with SMTP id 5so12014533bwz.3 for ; Thu, 07 Jan 2010 12:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=By5xbYPMdZ0J5E681/gOrEaBA2HvaDCxQc3JIJS6XoM=; b=V1JjjrkXQPUgN85GVa6YaGQ3Lfffz2Gb91qdSfWNBmsyqjc6W4tOTiq0qdVr6dkzr8 ZsPL37wCZN8OlBO342S4DpKFfZsR0+iFN/ivzjA77xYgBxIoLiJSKfzIdGyk9Kzzmvq9 hW+M/iVWf7sSm2Ioimj87aA2Y/yXmRBHASkXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=r8nPfxrZ5kKD8TLODlofV3NEINppmio8IO4UcY3/RZe8Ec4xRnaOZDJ9I6rvM06G1q 1EpSyhJxH5wHWOmOQdsO3GOZRssfo1FXDFR3GXDUul8uDIpX+05+bu/nT4GIaFXz2Yhc dfmtP33EHr2uESw5CeDN0ZkQQvjI8h+wfG1WI= MIME-Version: 1.0 Received: by 10.204.152.200 with SMTP id h8mr405950bkw.150.1262897877818; Thu, 07 Jan 2010 12:57:57 -0800 (PST) In-Reply-To: <201001071618.o07GIkeb001598@svn.freebsd.org> References: <201001071618.o07GIkeb001598@svn.freebsd.org> Date: Thu, 7 Jan 2010 23:57:57 +0300 Message-ID: From: pluknet To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r201749 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 20:58:02 -0000 2010/1/7 Bjoern A. Zeeb : > Author: bz > Date: Thu Jan =A07 16:18:46 2010 > New Revision: 201749 > URL: http://svn.freebsd.org/changeset/base/201749 > > Log: > =A0Bump __FreeBSD_version to 800500 which should have happened already > =A0after r198460 but was missed. > > =A0Note: that 800108 should have been 800501 with that but as there is no > =A0functional problem here, it'll just stay as is. [1] > > =A0This will make pkg_add -r use packages-8-stable for stable/8 rather > =A0than packages-8.0-release. > > =A0Reported by: =A0Paride Legovini (pl ninthfloor.org) on stable@, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(pluknet gmail.com), jhb > =A0Discussed with: =A0 =A0 =A0 rwatson [1] > > Modified: > =A0stable/8/sys/sys/param.h > > Modified: stable/8/sys/sys/param.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/8/sys/sys/param.h =A0 =A0Thu Jan =A07 14:23:19 2010 =A0 =A0 = =A0 =A0(r201748) > +++ stable/8/sys/sys/param.h =A0 =A0Thu Jan =A07 16:18:46 2010 =A0 =A0 = =A0 =A0(r201749) > @@ -58,7 +58,7 @@ > =A0* =A0 =A0 =A0 =A0 =A0 =A0 in the range 5 to 9. > =A0*/ > =A0#undef __FreeBSD_version > -#define __FreeBSD_version 800108 =A0 =A0 =A0 /* Master, propagated to ne= wvers */ > +#define __FreeBSD_version 800500 =A0 =A0 =A0 /* Master, propagated to ne= wvers */ > > =A0#ifndef LOCORE > =A0#include Thank you! --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 21:01:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 371CA106566C; Thu, 7 Jan 2010 21:01:39 +0000 (UTC) (envelope-from mbr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217828FC17; Thu, 7 Jan 2010 21:01:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07L1drr064461; Thu, 7 Jan 2010 21:01:39 GMT (envelope-from mbr@svn.freebsd.org) Received: (from mbr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07L1c6m064401; Thu, 7 Jan 2010 21:01:38 GMT (envelope-from mbr@svn.freebsd.org) Message-Id: <201001072101.o07L1c6m064401@svn.freebsd.org> From: Martin Blapp Date: Thu, 7 Jan 2010 21:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201758 - in head/sys: cam/scsi compat/linux dev/aac dev/agp dev/amd dev/amr dev/arcmsr dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5211 dev/ath/ath_hal/ar5212 dev/ath/ath_hal/ar5416 dev... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 21:01:39 -0000 Author: mbr Date: Thu Jan 7 21:01:37 2010 New Revision: 201758 URL: http://svn.freebsd.org/changeset/base/201758 Log: Remove extraneous semicolons, no functional changes. Submitted by: Marc Balmer MFC after: 1 week Modified: head/sys/cam/scsi/scsi_ses.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/compat/linux/linux_futex.c head/sys/dev/aac/aac.c head/sys/dev/agp/agp.c head/sys/dev/amd/amd.c head/sys/dev/amr/amr.c head/sys/dev/arcmsr/arcmsr.c head/sys/dev/ata/ata-raid.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-siliconimage.c head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c head/sys/dev/bktr/bktr_i2c.c head/sys/dev/cs/if_cs.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/de/if_de.c head/sys/dev/e1000/if_em.c head/sys/dev/fatm/if_fatm.c head/sys/dev/firewire/sbp.c head/sys/dev/hatm/if_hatm.c head/sys/dev/hptmv/entry.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/dev/iscsi/initiator/isc_sm.c head/sys/dev/isp/isp.c head/sys/dev/isp/isp_library.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/malo/if_malo.c head/sys/dev/mge/if_mge.c head/sys/dev/mxge/if_mxge.c head/sys/dev/patm/if_patm_intr.c head/sys/dev/pdq/if_fea.c head/sys/dev/safe/safe.c head/sys/dev/sound/pci/maestro3.c head/sys/dev/ste/if_ste.c head/sys/dev/trm/trm.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/storage/umass.c head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c head/sys/isa/pnp.c head/sys/kern/kern_fail.c head/sys/kern/subr_firmware.c head/sys/mips/adm5120/if_admsw.c head/sys/mips/mips/elf_machdep.c head/sys/net/flowtable.c head/sys/net80211/ieee80211_node.c head/sys/netinet/libalias/alias_db.c head/sys/netinet/libalias/alias_mod.c head/sys/netinet/sctp_asconf.c head/sys/netinet/sctputil.c head/sys/nfsclient/bootp_subr.c head/sys/pci/ncr.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/rpc/clnt_dg.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/xen/xenbus/xenbus_probe.c Modified: head/sys/cam/scsi/scsi_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_ses.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/cam/scsi/scsi_ses.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1555,7 +1555,7 @@ ses_encode(char *b, int amt, uint8_t *ep */ static int safte_getconfig(ses_softc_t *); -static int safte_rdstat(ses_softc_t *, int);; +static int safte_rdstat(ses_softc_t *, int); static int set_objstat_sel(ses_softc_t *, ses_objstat *, int); static int wrbuf16(ses_softc_t *, uint8_t, uint8_t, uint8_t, uint8_t, int); static void wrslot_stat(ses_softc_t *, int); @@ -2257,7 +2257,7 @@ safte_rdstat(ses_softc_t *ssc, int slpfl ssc->ses_objmap[oid].encstat[0] = SES_OBJSTAT_NOTAVAIL; ssc->ses_objmap[oid].encstat[1] = 0; ssc->ses_objmap[oid].encstat[2] = sdata[r]; - ssc->ses_objmap[oid].encstat[3] = 0;; + ssc->ses_objmap[oid].encstat[3] = 0; ssc->ses_objmap[oid++].svalid = 1; r++; } Modified: head/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- head/sys/cam/scsi/scsi_targ_bh.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/cam/scsi/scsi_targ_bh.c Thu Jan 7 21:01:37 2010 (r201758) @@ -429,7 +429,7 @@ targbhdtor(struct cam_periph *periph) switch (softc->init_level) { case 0: - panic("targdtor - impossible init level");; + panic("targdtor - impossible init level"); case 1: /* FALLTHROUGH */ default: Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/compat/linux/linux_futex.c Thu Jan 7 21:01:37 2010 (r201758) @@ -493,7 +493,7 @@ linux_sys_futex(struct thread *td, struc return (error); if (f == NULL) { td->td_retval[0] = 0; - return (error);; + return (error); } td->td_retval[0] = futex_wake(f, args->val); futex_put(f, NULL); Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/aac/aac.c Thu Jan 7 21:01:37 2010 (r201758) @@ -553,7 +553,7 @@ aac_alloc(struct aac_softc *sc) 0, /* flags */ NULL, NULL, /* No locking needed */ &sc->aac_fib_dmat)) { - device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n");; + device_printf(sc->aac_dev, "can't allocate FIB DMA tag\n"); return (ENOMEM); } Modified: head/sys/dev/agp/agp.c ============================================================================== --- head/sys/dev/agp/agp.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/agp/agp.c Thu Jan 7 21:01:37 2010 (r201758) @@ -763,7 +763,7 @@ agp_allocate_user(device_t dev, agp_allo static int agp_deallocate_user(device_t dev, int id) { - struct agp_memory *mem = agp_find_memory(dev, id);; + struct agp_memory *mem = agp_find_memory(dev, id); if (mem) { AGP_FREE_MEMORY(dev, mem); Modified: head/sys/dev/amd/amd.c ============================================================================== --- head/sys/dev/amd/amd.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/amd/amd.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1657,7 +1657,7 @@ amdhandlemsgreject(struct amd_softc *amd tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.goal.offset = pDCB->SyncOffset; pDCB->tinfo.current.period = - tinfo_sync_period[pDCB->SyncPeriod - 4];; + tinfo_sync_period[pDCB->SyncPeriod - 4]; pDCB->tinfo.current.offset = pDCB->SyncOffset; /* Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/amr/amr.c Thu Jan 7 21:01:37 2010 (r201758) @@ -221,7 +221,7 @@ amr_attach(struct amr_softc *sc) sc->amr_submit_command = amr_std_submit_command; sc->amr_get_work = amr_std_get_work; sc->amr_poll_command = amr_std_poll_command; - amr_std_attach_mailbox(sc);; + amr_std_attach_mailbox(sc); } #ifdef AMR_BOARD_INIT Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/arcmsr/arcmsr.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1940,7 +1940,7 @@ static void arcmsr_handle_virtual_comman switch (pccb->csio.cdb_io.cdb_bytes[0]) { case INQUIRY: { unsigned char inqdata[36]; - char *buffer=pccb->csio.data_ptr;; + char *buffer=pccb->csio.data_ptr; if (pccb->ccb_h.target_lun) { pccb->ccb_h.status |= CAM_SEL_TIMEOUT; Modified: head/sys/dev/ata/ata-raid.c ============================================================================== --- head/sys/dev/ata/ata-raid.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ata/ata-raid.c Thu Jan 7 21:01:37 2010 (r201758) @@ -407,7 +407,7 @@ ata_raid_strategy(struct bio *bp) if (rdp->status & AR_S_REBUILDING) blk = ((lba / rdp->interleave) * rdp->width) * rdp->interleave + (rdp->interleave * (drv % rdp->width)) + - lba % rdp->interleave;; + lba % rdp->interleave; if (bp->bio_cmd == BIO_READ) { int src_online = Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ata/chipsets/ata-ahci.c Thu Jan 7 21:01:37 2010 (r201758) @@ -656,9 +656,9 @@ ata_ahci_pm_write(device_t dev, int port ctp->cfis[3] = reg; ctp->cfis[7] = port | ATA_D_LBA; ctp->cfis[12] = value & 0xff; - ctp->cfis[4] = (value >> 8) & 0xff;; - ctp->cfis[5] = (value >> 16) & 0xff;; - ctp->cfis[6] = (value >> 24) & 0xff;; + ctp->cfis[4] = (value >> 8) & 0xff; + ctp->cfis[5] = (value >> 16) & 0xff; + ctp->cfis[6] = (value >> 24) & 0xff; ctp->cfis[15] = ATA_A_4BIT; if (ata_ahci_issue_cmd(dev, 0, 100)) { Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Thu Jan 7 21:01:37 2010 (r201758) @@ -716,9 +716,9 @@ ata_siiprb_pm_write(device_t dev, int po prb->fis[3] = reg; prb->fis[7] = port; prb->fis[12] = value & 0xff; - prb->fis[4] = (value >> 8) & 0xff;; - prb->fis[5] = (value >> 16) & 0xff;; - prb->fis[6] = (value >> 24) & 0xff;; + prb->fis[4] = (value >> 8) & 0xff; + prb->fis[5] = (value >> 16) & 0xff; + prb->fis[6] = (value >> 24) & 0xff; if (ata_siiprb_issue_cmd(dev)) { device_printf(dev, "error writing PM port\n"); return ATA_E_ABORT; Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ath/ath_hal/ar5211/ar5211_reset.c Thu Jan 7 21:01:37 2010 (r201758) @@ -136,7 +136,7 @@ static void ar5211GetLowerUpperPcdacs(ui uint16_t channel, const PCDACS_EEPROM *pSrcStruct, uint16_t *pLowerPcdac, uint16_t *pUpperPcdac); -static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *);; +static void ar5211SetRfgain(struct ath_hal *, const GAIN_VALUES *); static void ar5211RequestRfgain(struct ath_hal *); static HAL_BOOL ar5211InvalidGainReadback(struct ath_hal *, GAIN_VALUES *); static HAL_BOOL ar5211IsGainAdjustNeeded(struct ath_hal *, const GAIN_VALUES *); Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c Thu Jan 7 21:01:37 2010 (r201758) @@ -76,7 +76,7 @@ ar5212GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c Thu Jan 7 21:01:37 2010 (r201758) @@ -104,7 +104,7 @@ ar5416GetPendingInterrupts(struct ath_ha isr = OS_REG_READ(ah, AR_ISR_RAC); if (isr == 0xffffffff) { *masked = 0; - return AH_FALSE;; + return AH_FALSE; } *masked = isr & HAL_INT_COMMON; Modified: head/sys/dev/bktr/bktr_i2c.c ============================================================================== --- head/sys/dev/bktr/bktr_i2c.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/bktr/bktr_i2c.c Thu Jan 7 21:01:37 2010 (r201758) @@ -331,7 +331,7 @@ bti2c_smb_readb(device_t dev, u_char sla /* clear status bits */ OUTL(sc,BKTR_INT_STAT, (BT848_INT_RACK | BT848_INT_I2CDONE)); - OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd);; + OUTL(sc,BKTR_I2C_DATA_CTL, ((slave & 0xff) << 24) | (u_char)cmd); BTI2C_DEBUG(printf("r%lx/", (u_long)(((slave & 0xff) << 24) | (u_char)cmd))); Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/cs/if_cs.c Thu Jan 7 21:01:37 2010 (r201758) @@ -475,7 +475,7 @@ int cs_attach(device_t dev) { int error, media=0; - struct cs_softc *sc = device_get_softc(dev);; + struct cs_softc *sc = device_get_softc(dev); struct ifnet *ifp; sc->dev = dev; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Jan 7 21:01:37 2010 (r201758) @@ -152,7 +152,7 @@ struct rx_desc { uint32_t len_gen; uint32_t gen2; uint32_t addr_hi; -} __packed;; +} __packed; struct rsp_desc { /* response queue descriptor */ struct rss_header rss_hdr; Modified: head/sys/dev/de/if_de.c ============================================================================== --- head/sys/dev/de/if_de.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/de/if_de.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2290,7 +2290,7 @@ tulip_identify_asante_nic(tulip_softc_t mi->mi_gpr_length = 0; mi->mi_gpr_offset = 0; mi->mi_reset_length = 0; - mi->mi_reset_offset = 0;; + mi->mi_reset_offset = 0; mi->mi_phyaddr = TULIP_MII_NOPHY; for (idx = 20; idx > 0 && mi->mi_phyaddr == TULIP_MII_NOPHY; idx--) { Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/e1000/if_em.c Thu Jan 7 21:01:37 2010 (r201758) @@ -4346,7 +4346,7 @@ em_free_receive_structures(struct adapte static int em_rxeof(struct adapter *adapter, int count) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct mbuf *mp; u8 status, accept_frame = 0, eop = 0; u16 len, desc_len, prev_len_adj; Modified: head/sys/dev/fatm/if_fatm.c ============================================================================== --- head/sys/dev/fatm/if_fatm.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/fatm/if_fatm.c Thu Jan 7 21:01:37 2010 (r201758) @@ -858,7 +858,7 @@ fatm_getprom(struct fatm_softc *sc) NEXT_QUEUE_ENTRY(sc->cmdqueue.head, FATM_CMD_QLEN); q->error = 0; - q->cb = NULL;; + q->cb = NULL; H_SETSTAT(q->q.statp, FATM_STAT_PENDING); H_SYNCSTAT_PREWRITE(sc, q->q.statp); Modified: head/sys/dev/firewire/sbp.c ============================================================================== --- head/sys/dev/firewire/sbp.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/firewire/sbp.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1573,7 +1573,7 @@ END_DEBUG bcopy(&sbp_cmd_status->s_keydep[0], &sense->sense_key_spec[0], 3); - ocb->ccb->csio.scsi_status = sbp_cmd_status->status;; + ocb->ccb->csio.scsi_status = sbp_cmd_status->status; ocb->ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; /* @@ -2148,7 +2148,7 @@ sbp_free_target(struct sbp_target *targe } STAILQ_INIT(&target->xferlist); free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; } @@ -2318,7 +2318,7 @@ sbp_timeout(void *arg) sbp_cam_detach_target(target); if (target->luns != NULL) free(target->luns, M_SBP); - target->num_lun = 0;; + target->num_lun = 0; target->luns = NULL; target->fwdev = NULL; #endif Modified: head/sys/dev/hatm/if_hatm.c ============================================================================== --- head/sys/dev/hatm/if_hatm.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/hatm/if_hatm.c Thu Jan 7 21:01:37 2010 (r201758) @@ -836,7 +836,7 @@ hatm_init_rx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; @@ -889,7 +889,7 @@ hatm_init_tx_buffer_pool(struct hatm_sof uint32_t lbuf_addr; /* address of current buffer */ u_int i; - row_size = sc->bytes_per_row;; + row_size = sc->bytes_per_row; row_addr = start * row_size; lbuf_size = sc->cells_per_lbuf * 48; lbufs_per_row = sc->cells_per_row / sc->cells_per_lbuf; Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/hptmv/entry.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1341,7 +1341,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter) #endif &pAdapter->io_dma_parent /* tag */)) { - return ENXIO;; + return ENXIO; } Modified: head/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis_usb.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/if_ndis/if_ndis_usb.c Thu Jan 7 21:01:37 2010 (r201758) @@ -205,7 +205,7 @@ ndisusb_detach(device_t self) { int i; struct ndis_softc *sc = device_get_softc(self); - struct ndisusb_ep *ne;; + struct ndisusb_ep *ne; sc->ndisusb_status |= NDISUSB_STATUS_DETACH; Modified: head/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_sm.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/iscsi/initiator/isc_sm.c Thu Jan 7 21:01:37 2010 (r201758) @@ -399,7 +399,7 @@ ism_recv(isc_session_t *sp, pduq_t *pq) if(sp->flags & ISC_STALLED) { sdebug(4, "window opened: max=0x%x exp=0x%x opcode=0x%x cmd=0x%x cws=%d.", sn->maxCmd, sn->expCmd, bhs->opcode, sn->cmd, sp->cws); - sp->flags &= ~ISC_STALLED;; + sp->flags &= ~ISC_STALLED; } } } Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/isp/isp.c Thu Jan 7 21:01:37 2010 (r201758) @@ -6658,8 +6658,8 @@ isp_mbox_continue(ispsoftc_t *isp) ptr = isp->isp_mbxworkp; switch (isp->isp_lastmbxcmd) { case MBOX_WRITE_RAM_WORD: - mbs.param[1] = isp->isp_mbxwrk1++;; - mbs.param[2] = *ptr++;; + mbs.param[1] = isp->isp_mbxwrk1++; + mbs.param[2] = *ptr++; break; case MBOX_READ_RAM_WORD: *ptr++ = isp->isp_mboxtmp[2]; @@ -6669,7 +6669,7 @@ isp_mbox_continue(ispsoftc_t *isp) offset = isp->isp_mbxwrk1; offset |= isp->isp_mbxwrk8 << 16; - mbs.param[2] = *ptr++;; + mbs.param[2] = *ptr++; mbs.param[1] = offset; mbs.param[8] = offset >> 16; isp->isp_mbxwrk1 = ++offset; Modified: head/sys/dev/isp/isp_library.c ============================================================================== --- head/sys/dev/isp/isp_library.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/isp/isp_library.c Thu Jan 7 21:01:37 2010 (r201758) @@ -670,7 +670,7 @@ isp_clear_commands(ispsoftc_t *isp) } else { ct_entry_t *ctio = (ct_entry_t *) local; ctio->ct_syshandle = handle & 0xffff; - ctio->ct_status = CT_HBA_RESET & 0xff;; + ctio->ct_status = CT_HBA_RESET & 0xff; ctio->ct_header.rqs_entry_type = RQSTYPE_CTIO; } isp_async(isp, ISPASYNC_TARGET_ACTION, local); Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jan 7 21:01:37 2010 (r201758) @@ -4743,7 +4743,7 @@ static void ixgbe_reinit_fdir(void *context, int pending) { struct adapter *adapter = context; - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; if (adapter->fdir_reinit != 1) /* Shouldn't happen */ return; @@ -4763,7 +4763,7 @@ ixgbe_reinit_fdir(void *context, int pen static void ixgbe_update_stats_counters(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp;; + struct ifnet *ifp = adapter->ifp; struct ixgbe_hw *hw = &adapter->hw; u32 missed_rx = 0, bprc, lxon, lxoff, total; u64 total_missed_rx = 0; Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/malo/if_malo.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2108,7 +2108,7 @@ malo_rx_proc(void *arg, int npending) * payload prior to constructing the header. */ m = bf->bf_m; - data = mtod(m, uint8_t *);; + data = mtod(m, uint8_t *); hdrlen = ieee80211_anyhdrsize(data + sizeof(uint16_t)); off = sizeof(uint16_t) + sizeof(struct ieee80211_frame_addr4); Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/mge/if_mge.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1150,7 +1150,7 @@ mge_intr_tx_locked(struct mge_softc *sc) break; sc->tx_desc_used_idx = - (++sc->tx_desc_used_idx) % MGE_TX_DESC_NUM;; + (++sc->tx_desc_used_idx) % MGE_TX_DESC_NUM; sc->tx_desc_used_count--; /* Update collision statistics */ Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/mxge/if_mxge.c Thu Jan 7 21:01:37 2010 (r201758) @@ -3173,23 +3173,23 @@ mxge_alloc_slice_rings(struct mxge_slice bytes = rx_ring_entries * sizeof (*ss->rx_small.shadow); ss->rx_small.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); if (ss->rx_small.shadow == NULL) - return err;; + return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.shadow); ss->rx_big.shadow = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); if (ss->rx_big.shadow == NULL) - return err;; + return err; /* allocate the rx host info rings */ bytes = rx_ring_entries * sizeof (*ss->rx_small.info); ss->rx_small.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); if (ss->rx_small.info == NULL) - return err;; + return err; bytes = rx_ring_entries * sizeof (*ss->rx_big.info); ss->rx_big.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); if (ss->rx_big.info == NULL) - return err;; + return err; /* allocate the rx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3207,7 +3207,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d allocating rx_small dmat\n", err); - return err;; + return err; } err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3234,7 +3234,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d allocating rx_big dmat\n", err); - return err;; + return err; } for (i = 0; i <= ss->rx_small.mask; i++) { err = bus_dmamap_create(ss->rx_small.dmat, 0, @@ -3242,7 +3242,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d rx_small dmamap\n", err); - return err;; + return err; } } err = bus_dmamap_create(ss->rx_small.dmat, 0, @@ -3250,7 +3250,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d extra rx_small dmamap\n", err); - return err;; + return err; } for (i = 0; i <= ss->rx_big.mask; i++) { @@ -3259,7 +3259,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d rx_big dmamap\n", err); - return err;; + return err; } } err = bus_dmamap_create(ss->rx_big.dmat, 0, @@ -3267,7 +3267,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d extra rx_big dmamap\n", err); - return err;; + return err; } /* now allocate TX resouces */ @@ -3287,7 +3287,7 @@ mxge_alloc_slice_rings(struct mxge_slice sizeof (*ss->tx.req_list) * (ss->tx.max_desc + 4); ss->tx.req_bytes = malloc(bytes, M_DEVBUF, M_WAITOK); if (ss->tx.req_bytes == NULL) - return err;; + return err; /* ensure req_list entries are aligned to 8 bytes */ ss->tx.req_list = (mcp_kreq_ether_send_t *) ((unsigned long)(ss->tx.req_bytes + 7) & ~7UL); @@ -3297,13 +3297,13 @@ mxge_alloc_slice_rings(struct mxge_slice ss->tx.seg_list = (bus_dma_segment_t *) malloc(bytes, M_DEVBUF, M_WAITOK); if (ss->tx.seg_list == NULL) - return err;; + return err; /* allocate the tx host info ring */ bytes = tx_ring_entries * sizeof (*ss->tx.info); ss->tx.info = malloc(bytes, M_DEVBUF, M_ZERO|M_WAITOK); if (ss->tx.info == NULL) - return err;; + return err; /* allocate the tx busdma resources */ err = bus_dma_tag_create(sc->parent_dmat, /* parent */ @@ -3322,7 +3322,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d allocating tx dmat\n", err); - return err;; + return err; } /* now use these tags to setup dmamaps for each slot @@ -3333,7 +3333,7 @@ mxge_alloc_slice_rings(struct mxge_slice if (err != 0) { device_printf(sc->dev, "Err %d tx dmamap\n", err); - return err;; + return err; } } return 0; Modified: head/sys/dev/patm/if_patm_intr.c ============================================================================== --- head/sys/dev/patm/if_patm_intr.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/patm/if_patm_intr.c Thu Jan 7 21:01:37 2010 (r201758) @@ -381,7 +381,7 @@ patm_feed_lbufs(struct patm_softc *sc) static void patm_intr_tsif(struct patm_softc *sc) { - struct idt_tsqe *tsqe = sc->tsq_next;; + struct idt_tsqe *tsqe = sc->tsq_next; struct idt_tsqe *prev = NULL; uint32_t stamp; Modified: head/sys/dev/pdq/if_fea.c ============================================================================== --- head/sys/dev/pdq/if_fea.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/pdq/if_fea.c Thu Jan 7 21:01:37 2010 (r201758) @@ -140,7 +140,7 @@ pdq_eisa_probe (dev) u_int32_t maddr; u_int32_t msize; - u_int32_t eisa_id = eisa_get_id(dev);; + u_int32_t eisa_id = eisa_get_id(dev); desc = pdq_eisa_match(eisa_id); if (!desc) { Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/safe/safe.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1902,7 +1902,7 @@ safe_init_board(struct safe_softc *sc) { u_int32_t v, dwords; - v = READ_REG(sc, SAFE_PE_DMACFG);; + v = READ_REG(sc, SAFE_PE_DMACFG); v &=~ SAFE_PE_DMACFG_PEMODE; v |= SAFE_PE_DMACFG_FSENA /* failsafe enable */ | SAFE_PE_DMACFG_GPRPCI /* gather ring on PCI */ Modified: head/sys/dev/sound/pci/maestro3.c ============================================================================== --- head/sys/dev/sound/pci/maestro3.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/sound/pci/maestro3.c Thu Jan 7 21:01:37 2010 (r201758) @@ -353,7 +353,7 @@ m3_wrcd(kobj_t kobj, void *devinfo, int struct sc_info *sc = (struct sc_info *)devinfo; if (m3_wait(sc)) { device_printf(sc->dev, "m3_wrcd timed out.\n"); - return -1;; + return -1; } m3_wr_2(sc, CODEC_DATA, data); m3_wr_1(sc, CODEC_COMMAND, regno & 0x7f); Modified: head/sys/dev/ste/if_ste.c ============================================================================== --- head/sys/dev/ste/if_ste.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/ste/if_ste.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1125,7 +1125,7 @@ ste_attach(device_t dev) if (ste_read_eeprom(sc, eaddr, STE_EEADDR_NODE0, 3, 0)) { device_printf(dev, "failed to read station address\n"); - error = ENXIO;; + error = ENXIO; goto fail; } ste_sysctl_node(sc); Modified: head/sys/dev/trm/trm.c ============================================================================== --- head/sys/dev/trm/trm.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/trm/trm.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2770,7 +2770,7 @@ trm_DoingSRB_Done(PACB pACB) xpt_done(pccb); psrb = psrb2; } - pdcb->GoingSRBCnt = 0;; + pdcb->GoingSRBCnt = 0; pdcb->pGoingSRB = NULL; pdcb = pdcb->pNextDCB; } Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/usb/controller/musb_otg.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1799,7 +1799,7 @@ musbotg_init(struct musbotg_softc *sc) MUSB2_WRITE_1(sc, MUSB2_REG_EPINDEX, temp); fsize = MUSB2_READ_1(sc, MUSB2_REG_FSIZE); - frx = (fsize & MUSB2_MASK_RX_FSIZE) / 16;; + frx = (fsize & MUSB2_MASK_RX_FSIZE) / 16; ftx = (fsize & MUSB2_MASK_TX_FSIZE); DPRINTF("Endpoint %u FIFO size: IN=%u, OUT=%u, DYN=%d\n", Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/dev/usb/storage/umass.c Thu Jan 7 21:01:37 2010 (r201758) @@ -3036,7 +3036,7 @@ umass_atapi_transform(struct umass_softc case 0xad: /* READ_DVD_STRUCTURE */ case 0xbb: /* SET_CD_SPEED */ case 0xe5: /* READ_TRACK_INFO_PHILIPS */ - break;; + break; case READ_12: case WRITE_12: @@ -3044,7 +3044,7 @@ umass_atapi_transform(struct umass_softc DPRINTF(sc, UDMASS_SCSI, "Unsupported ATAPI " "command 0x%02x - trying anyway\n", cmd_ptr[0]); - break;; + break; } bcopy(cmd_ptr, sc->sc_transfer.cmd_data, cmd_len); Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c ============================================================================== --- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1117,7 +1117,7 @@ _xfs_strategy( } */ *ap) { daddr_t blkno; - struct buf *bp;; + struct buf *bp; struct bufobj *bo; struct vnode *vp; struct xfs_mount *xmp; Modified: head/sys/isa/pnp.c ============================================================================== --- head/sys/isa/pnp.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/isa/pnp.c Thu Jan 7 21:01:37 2010 (r201758) @@ -480,7 +480,7 @@ pnp_create_devices(device_t parent, pnp_ } resinfo = resp; resp += PNP_SRES_LEN(tag); - scanning -= PNP_SRES_LEN(tag);; + scanning -= PNP_SRES_LEN(tag); switch (PNP_SRES_NUM(tag)) { case PNP_TAG_LOGICAL_DEVICE: Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/kern/kern_fail.c Thu Jan 7 21:01:37 2010 (r201758) @@ -452,7 +452,7 @@ parse_term(struct fail_point_entries *en } else if (*p == '*') { if (!units || decimal) return 0; - ent->fe_count = units;; + ent->fe_count = units; } else { return 0; @@ -497,7 +497,7 @@ parse_number(int *out_units, int *out_de /* whole part */ old_p = p; - *out_units = strtol(p, &p, 10);; + *out_units = strtol(p, &p, 10); if (p == old_p && *p != '.') return 0; Modified: head/sys/kern/subr_firmware.c ============================================================================== --- head/sys/kern/subr_firmware.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/kern/subr_firmware.c Thu Jan 7 21:01:37 2010 (r201758) @@ -500,7 +500,7 @@ firmware_modevent(module_t mod, int type mtx_lock(&firmware_mtx); for (i = 0; i < FIRMWARE_MAX; i++) { fp = &firmware_table[i]; - fp->flags |= FW_UNLOAD;; + fp->flags |= FW_UNLOAD; } mtx_unlock(&firmware_mtx); taskqueue_enqueue(firmware_tq, &firmware_unload_task); Modified: head/sys/mips/adm5120/if_admsw.c ============================================================================== --- head/sys/mips/adm5120/if_admsw.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/mips/adm5120/if_admsw.c Thu Jan 7 21:01:37 2010 (r201758) @@ -528,7 +528,7 @@ admsw_attach(device_t dev) ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO, 0, NULL); ifmedia_set(&sc->sc_ifmedia[i], IFM_ETHER|IFM_AUTO); - ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER);; + ifp = sc->sc_ifnet[i] = if_alloc(IFT_ETHER); /* Setup interface parameters */ ifp->if_softc = sc; Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/mips/mips/elf_machdep.c Thu Jan 7 21:01:37 2010 (r201758) @@ -105,7 +105,7 @@ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) { - Elf_Addr *where = (Elf_Addr *)NULL;; + Elf_Addr *where = (Elf_Addr *)NULL; Elf_Addr addr; Elf_Addr addend = (Elf_Addr)0; Elf_Word rtype = (Elf_Word)0, symidx; Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/net/flowtable.c Thu Jan 7 21:01:37 2010 (r201758) @@ -404,7 +404,7 @@ ipv4_flow_lookup_hash_internal(struct mb if (*flags & FL_HASH_PORTS) goto noop; /* no port - hence not a protocol we care about */ - break;; + break; } *protop = proto; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/net80211/ieee80211_node.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1739,7 +1739,7 @@ ieee80211_node_delucastkey(struct ieee80 status = ieee80211_crypto_delkey(ni->ni_vap, &ni->ni_ucastkey); if (nt->nt_keyixmap != NULL && keyix < nt->nt_keyixmax) { nikey = nt->nt_keyixmap[keyix]; - nt->nt_keyixmap[keyix] = NULL;; + nt->nt_keyixmap[keyix] = NULL; } } if (!isowned) Modified: head/sys/netinet/libalias/alias_db.c ============================================================================== --- head/sys/netinet/libalias/alias_db.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/netinet/libalias/alias_db.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2136,7 +2136,7 @@ void SetProtocolFlags(struct alias_link *lnk, int pflags) { - lnk->pflags = pflags;; + lnk->pflags = pflags; } int Modified: head/sys/netinet/libalias/alias_mod.c ============================================================================== --- head/sys/netinet/libalias/alias_mod.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/netinet/libalias/alias_mod.c Thu Jan 7 21:01:37 2010 (r201758) @@ -158,7 +158,7 @@ _attach_handler(struct proto_handler *p) static int _detach_handler(struct proto_handler *p) { - struct proto_handler *b, *b_tmp;; + struct proto_handler *b, *b_tmp; LIBALIAS_WLOCK_ASSERT(); LIST_FOREACH_SAFE(b, &handler_chain, entries, b_tmp) { Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/netinet/sctp_asconf.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2224,7 +2224,7 @@ sctp_asconf_iterator_stcb(struct sctp_in } if (stcb->asoc.ipv4_local_scope == 0 && IN4_ISPRIVATE_ADDRESS(&sin->sin_addr)) { - continue;; + continue; } if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) && SCTP_IPV6_V6ONLY(inp6)) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/netinet/sctputil.c Thu Jan 7 21:01:37 2010 (r201758) @@ -4382,7 +4382,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp m = SCTP_BUF_NEXT(prev); } if (m == NULL) { - control->tail_mbuf = prev;; + control->tail_mbuf = prev; } continue; } Modified: head/sys/nfsclient/bootp_subr.c ============================================================================== --- head/sys/nfsclient/bootp_subr.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/nfsclient/bootp_subr.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1332,7 +1332,7 @@ bootpc_compose_query(struct bootpc_ifcon *vendp++ = TAG_VENDOR_INDENTIFIER; *vendp++ = vendor_client_len; memcpy(vendp, vendor_client, vendor_client_len); - vendp += vendor_client_len;; + vendp += vendor_client_len; ifctx->dhcpquerytype = DHCP_NOMSG; switch (ifctx->state) { case IF_DHCP_UNRESOLVED: Modified: head/sys/pci/ncr.c ============================================================================== --- head/sys/pci/ncr.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/pci/ncr.c Thu Jan 7 21:01:37 2010 (r201758) @@ -3992,7 +3992,7 @@ ncr_action (struct cam_sim *sim, union c msgptr[msglen++] = MSG_EXT_SDTR_LEN; msgptr[msglen++] = MSG_EXT_SDTR; msgptr[msglen++] = tp->tinfo.goal.period; - msgptr[msglen++] = tp->tinfo.goal.offset;; + msgptr[msglen++] = tp->tinfo.goal.offset; if (DEBUG_FLAGS & DEBUG_NEGO) { PRINT_ADDR(ccb); printf ("sync msgout: "); Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/powerpc/aim/mmu_oea.c Thu Jan 7 21:01:37 2010 (r201758) @@ -922,7 +922,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k thread0.td_kstack = va; thread0.td_kstack_pages = KSTACK_PAGES; for (i = 0; i < KSTACK_PAGES; i++) { - moea_kenter(mmup, va, pa);; + moea_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } @@ -935,7 +935,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k va = virtual_avail; virtual_avail += round_page(MSGBUF_SIZE); while (va < virtual_avail) { - moea_kenter(mmup, va, pa);; + moea_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } @@ -948,7 +948,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k va = virtual_avail; virtual_avail += DPCPU_SIZE; while (va < virtual_avail) { - moea_kenter(mmup, va, pa);; + moea_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Jan 7 21:01:37 2010 (r201758) @@ -1019,7 +1019,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o thread0.td_kstack = va; thread0.td_kstack_pages = KSTACK_PAGES; for (i = 0; i < KSTACK_PAGES; i++) { - moea64_kenter(mmup, va, pa);; + moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } @@ -1032,7 +1032,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o va = virtual_avail; virtual_avail += round_page(MSGBUF_SIZE); while (va < virtual_avail) { - moea64_kenter(mmup, va, pa);; + moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } @@ -1045,7 +1045,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o va = virtual_avail; virtual_avail += DPCPU_SIZE; while (va < virtual_avail) { - moea64_kenter(mmup, va, pa);; + moea64_kenter(mmup, va, pa); pa += PAGE_SIZE; va += PAGE_SIZE; } Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/powerpc/booke/pmap.c Thu Jan 7 21:01:37 2010 (r201758) @@ -2307,7 +2307,7 @@ make_sure_to_unlock: static void mmu_booke_change_wiring(mmu_t mmu, pmap_t pmap, vm_offset_t va, boolean_t wired) { - pte_t *pte;; + pte_t *pte; PMAP_LOCK(pmap); if ((pte = pte_find(mmu, pmap, va)) != NULL) { @@ -2791,7 +2791,7 @@ tlb1_write_entry(unsigned int idx) mtspr(SPR_MAS7, mas7); __asm __volatile("isync; tlbwe; isync; msync"); - //debugf("tlb1_write_entry: e\n");; + //debugf("tlb1_write_entry: e\n"); } /* Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/rpc/clnt_dg.c Thu Jan 7 21:01:37 2010 (r201758) @@ -258,7 +258,7 @@ clnt_dg_create( rpc_createerr.cf_error.re_errno = 0; goto err2; } - cu->cu_mcalllen = XDR_GETPOS(&xdrs);; + cu->cu_mcalllen = XDR_GETPOS(&xdrs); /* * By default, closeit is always FALSE. It is users responsibility Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Jan 7 21:01:37 2010 (r201758) @@ -739,7 +739,7 @@ out1: auio.uio_iovcnt = 1; aiov.iov_base = (void *)snapblklist; aiov.iov_len = snaplistsize * sizeof(daddr_t); - auio.uio_resid = aiov.iov_len;; + auio.uio_resid = aiov.iov_len; auio.uio_offset = ip->i_size; auio.uio_segflg = UIO_SYSSPACE; auio.uio_rw = UIO_WRITE; Modified: head/sys/xen/xenbus/xenbus_probe.c ============================================================================== --- head/sys/xen/xenbus/xenbus_probe.c Thu Jan 7 20:40:38 2010 (r201757) +++ head/sys/xen/xenbus/xenbus_probe.c Thu Jan 7 21:01:37 2010 (r201758) @@ -330,7 +330,7 @@ xenbus_devices_changed(struct xenbus_wat device_t dev = sc->xs_dev; char *node, *bus, *type, *id, *p; - node = strdup(vec[XS_WATCH_PATH], M_DEVBUF);; + node = strdup(vec[XS_WATCH_PATH], M_DEVBUF); p = strchr(node, '/'); if (!p) goto out; From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 21:08:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA5F3106566C; Thu, 7 Jan 2010 21:08:22 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8CCC8FC08; Thu, 7 Jan 2010 21:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07L8M66065990; Thu, 7 Jan 2010 21:08:22 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07L8MB8065988; Thu, 7 Jan 2010 21:08:22 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001072108.o07L8MB8065988@svn.freebsd.org> From: Christian Brueffer Date: Thu, 7 Jan 2010 21:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201759 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 21:08:22 -0000 Author: brueffer Date: Thu Jan 7 21:08:22 2010 New Revision: 201759 URL: http://svn.freebsd.org/changeset/base/201759 Log: Fix a typo and bump date for the previous commit. Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Thu Jan 7 21:01:37 2010 (r201758) +++ head/lib/libc/sys/sendfile.2 Thu Jan 7 21:08:22 2010 (r201759) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2006 +.Dd January 7, 2010 .Dt SENDFILE 2 .Os .Sh NAME @@ -123,7 +123,7 @@ and .Vt sf_buf . The flag does not make the .Fn sendfile -syscall trully non-blocking, since other resources are still allocated +syscall truly non-blocking, since other resources are still allocated in blocking fashion. .It .Dv SF_SYNC . From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 21:14:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356E41065670; Thu, 7 Jan 2010 21:14:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23F798FC08; Thu, 7 Jan 2010 21:14:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07LElPl067424; Thu, 7 Jan 2010 21:14:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07LElxx067422; Thu, 7 Jan 2010 21:14:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001072114.o07LElxx067422@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 7 Jan 2010 21:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201760 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 21:14:47 -0000 Author: kib Date: Thu Jan 7 21:14:46 2010 New Revision: 201760 URL: http://svn.freebsd.org/changeset/base/201760 Log: Further fix grammar. Suggested by: alc MFC after: 3 days Modified: head/lib/libc/sys/sendfile.2 Modified: head/lib/libc/sys/sendfile.2 ============================================================================== --- head/lib/libc/sys/sendfile.2 Thu Jan 7 21:08:22 2010 (r201759) +++ head/lib/libc/sys/sendfile.2 Thu Jan 7 21:14:46 2010 (r201760) @@ -124,7 +124,7 @@ and The flag does not make the .Fn sendfile syscall truly non-blocking, since other resources are still allocated -in blocking fashion. +in a blocking fashion. .It .Dv SF_SYNC . .Nm From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 21:35:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA881065670; Thu, 7 Jan 2010 21:35:35 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE358FC0C; Thu, 7 Jan 2010 21:35:35 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 682D2730A1; Thu, 7 Jan 2010 22:43:34 +0100 (CET) Date: Thu, 7 Jan 2010 22:43:34 +0100 From: Luigi Rizzo To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100107214334.GA35184@onelab2.iet.unipi.it> References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100104190024.GA47532@onelab2.iet.unipi.it> <517EF225-7EEB-4844-A0AD-019AD72F9403@freebsd.org> <20100104222323.GA49068@onelab2.iet.unipi.it> <20100107203536.GB8230@rincewind.paeps.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100107203536.GB8230@rincewind.paeps.cx> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 21:35:35 -0000 On Thu, Jan 07, 2010 at 09:35:36PM +0100, Philip Paeps wrote: > On 2010-01-04 23:23:23 (+0100), Luigi Rizzo wrote: > > This was the reason why I moved ipfw-related stuff out of the way > > and plan to do the same with tcp unless someone precedes me. > > Please discuss this on -net or so first. I have worked in an environment here we are :) > where tcp was moved out of netinet when it was imported (around 2.2.8-time) > and it opens the door to a number of strange phenomena. I think i know pretty well the problems involved, because I have done the process already for ipfw/ (so you can see how i proceeded) and this is not just related to the number of files but also to their size. I know that adding a few lines to a header, or a few functions to a file, is often quicker for the programmer than partitioning the files. But when files and directories become 3..10 times larger than their original version at least calls for a scrutiny of whether the content still fits the original design. > What do you do with udp, for instance? Compared to tcp and sctp, it's > trivial in terms of code, but it's an upper layer protocol from the > perspective of netinet/netinet6 - do we put it in its own directory too? > Also note that this won't only cause churn for people who have patches against > or (out-of-tree) branches from netinet/, but also in other kernel subsystems > which rely on tcp -- nfs, for instance. + I have no intention to move headers whose name constitutes a de-facto standard for userland apps; that would be stupid, as it would break a lot of stuff over which we have no control. + there is also no reason to move single files (such as udp) somewhere else. + i don't much follow the issue churn on nfs or kernel subsystems: .c files are not #included, and headers will be handled with due care, see above. Plus, we usually try to make the kernel buildable after such changes. + i find the concern about churn in external patchsets a bit weak, first of all because this is bound to happen unless we stop all development, and secondly because this kind of file moving or splitting happens once every 10-15 years which is well beyond the lifetime of a patchset. cheers luigi From owner-svn-src-all@FreeBSD.ORG Thu Jan 7 23:30:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453A910656B7; Thu, 7 Jan 2010 23:30:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 33FB98FC17; Thu, 7 Jan 2010 23:30:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o07NUBvM097465; Thu, 7 Jan 2010 23:30:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o07NUB0K097463; Thu, 7 Jan 2010 23:30:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001072330.o07NUB0K097463@svn.freebsd.org> From: Doug Barton Date: Thu, 7 Jan 2010 23:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201764 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jan 2010 23:30:11 -0000 Author: dougb Date: Thu Jan 7 23:30:10 2010 New Revision: 201764 URL: http://svn.freebsd.org/changeset/base/201764 Log: For the now-infamous Rumsfeld quote: Change "there're" to "there are" which is consistent with the vast majority of on line references. Remove a spurious trailing " Update the citation text with a suggestion from des. Modified: head/games/fortune/datfiles/fortunes-o.real Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Thu Jan 7 23:28:58 2010 (r201763) +++ head/games/fortune/datfiles/fortunes-o.real Thu Jan 7 23:30:10 2010 (r201764) @@ -665,10 +665,10 @@ a postcard?" % As we know, there are known knowns. There are things we know we know. We also know there are known unknowns. That is to say, we know -there're some things we do not know. But there're also unknown unknowns; -the ones we don't know we don't know." +there are some things we do not know. But there are also unknown +unknowns; the ones we don't know we don't know. -- United States Secretary of Defense Donald Rumsfeld - 12 February 2002, on the invasion to Iraq. + 12 February 2002, Regarding the US invasion of Iraq % "Are pirates an ethnic group? Or are they just people who burn illegal cds?" From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 00:05:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 828201065670; Fri, 8 Jan 2010 00:05:10 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 716368FC08; Fri, 8 Jan 2010 00:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0805Ais005291; Fri, 8 Jan 2010 00:05:10 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0805Ad4005288; Fri, 8 Jan 2010 00:05:10 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201001080005.o0805Ad4005288@svn.freebsd.org> From: Doug Barton Date: Fri, 8 Jan 2010 00:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201765 - head/usr.sbin/mergemaster X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 00:05:10 -0000 Author: dougb Date: Fri Jan 8 00:05:10 2010 New Revision: 201765 URL: http://svn.freebsd.org/changeset/base/201765 Log: Update copyright date Update delete_temproot() to include the error message if it fails, and clean up the places where it's called. If there are no files left in temproot when the comparison is done delete it without prompting. This should make "automated" runs of mergemaster without -a a little easier. Document the new behavior in the man page. Modified: head/usr.sbin/mergemaster/mergemaster.8 head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.8 ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.8 Thu Jan 7 23:30:10 2010 (r201764) +++ head/usr.sbin/mergemaster/mergemaster.8 Fri Jan 8 00:05:10 2010 (r201765) @@ -1,4 +1,4 @@ -.\" Copyright (c) 1998-2009 Douglas Barton +.\" Copyright (c) 1998-2010 Douglas Barton .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 30, 2009 +.Dd January 7, 2010 .Dt MERGEMASTER 8 .Os .Sh NAME @@ -165,6 +165,14 @@ which will be read before Options specified on the command line are updated last, and therefore can override both files. .Pp +When the comparison is done if there are any files remaining +in the temproot directory they will be listed, and if the +.Fl a +option is not in use the user will be given the option of +deleting the temproot directory. +If there are no files remaining in the temproot directory +it will be deleted. +.Pp The options are as follows: .Bl -tag -width Fl .It Fl s Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Thu Jan 7 23:30:10 2010 (r201764) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri Jan 8 00:05:10 2010 (r201765) @@ -5,7 +5,7 @@ # Compare files created by /usr/src/etc/Makefile (or the directory # the user specifies) with the currently installed copies. -# Copyright 1998-2009 Douglas Barton +# Copyright 1998-2010 Douglas Barton # DougB@FreeBSD.org # $FreeBSD$ @@ -511,7 +511,7 @@ CVS_ID_TAG=FreeBSD delete_temproot () { rm -rf "${TEMPROOT}" 2>/dev/null chflags -R 0 "${TEMPROOT}" 2>/dev/null - rm -rf "${TEMPROOT}" || exit 1 + rm -rf "${TEMPROOT}" || { echo "*** Unable to delete ${TEMPROOT}"; exit 1; } } case "${RERUN}" in @@ -542,7 +542,7 @@ case "${RERUN}" in echo '' echo " *** Deleting the old ${TEMPROOT}" echo '' - delete_temproot || exit 1 + delete_temproot unset TEST_TEMP_ROOT ;; [tT]) @@ -1144,28 +1144,26 @@ if [ -n "${TEST_FOR_FILES}" ]; then echo "*** Files that remain for you to merge by hand:" find "${TEMPROOT}" -type f -size +0 | sort echo '' -fi - -case "${AUTO_RUN}" in -'') - echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " - read DEL_TEMPROOT - case "${DEL_TEMPROOT}" in - [yY]*) - if delete_temproot; then - echo " *** ${TEMPROOT} has been deleted" - else - echo " *** Unable to delete ${TEMPROOT}" - fi - ;; - *) - echo " *** ${TEMPROOT} will remain" + case "${AUTO_RUN}" in + '') + echo -n "Do you wish to delete what is left of ${TEMPROOT}? [no] " + read DEL_TEMPROOT + case "${DEL_TEMPROOT}" in + [yY]*) + delete_temproot + ;; + *) + echo " *** ${TEMPROOT} will remain" + ;; + esac ;; + *) ;; esac - ;; -*) ;; -esac +else + echo "*** ${TEMPROOT} is empty, deleting" + delete_temproot +fi case "${AUTO_INSTALLED_FILES}" in '') ;; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 01:41:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81AF71065670; Fri, 8 Jan 2010 01:41:58 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70EE98FC0C; Fri, 8 Jan 2010 01:41:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o081fwkx026687; Fri, 8 Jan 2010 01:41:58 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o081fwVp026685; Fri, 8 Jan 2010 01:41:58 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001080141.o081fwVp026685@svn.freebsd.org> From: Andrew Thompson Date: Fri, 8 Jan 2010 01:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201766 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 01:41:58 -0000 Author: thompsa Date: Fri Jan 8 01:41:58 2010 New Revision: 201766 URL: http://svn.freebsd.org/changeset/base/201766 Log: Remove unneeded includes. Modified: head/sys/dev/usb/serial/u3g.c Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Jan 8 00:05:10 2010 (r201765) +++ head/sys/dev/usb/serial/u3g.c Fri Jan 8 01:41:58 2010 (r201766) @@ -59,9 +59,7 @@ #define USB_DEBUG_VAR u3g_debug #include #include -#include #include -#include #include From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 02:39:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06224106566B; Fri, 8 Jan 2010 02:39:56 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD9E08FC15; Fri, 8 Jan 2010 02:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o082dt5c039374; Fri, 8 Jan 2010 02:39:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o082drqe039372; Fri, 8 Jan 2010 02:39:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001080239.o082drqe039372@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 02:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201767 - head/sys/dev/ste X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 02:39:56 -0000 Author: yongari Date: Fri Jan 8 02:39:53 2010 New Revision: 201767 URL: http://svn.freebsd.org/changeset/base/201767 Log: Fix EEPROM access code to return data in host byte order. EEPROM on ST201 always returns 16bits data with little endian format so conversion to host order is required. This change fixes inversed ethernet address on sparc64. Modified: head/sys/dev/ste/if_ste.c Modified: head/sys/dev/ste/if_ste.c ============================================================================== --- head/sys/dev/ste/if_ste.c Fri Jan 8 01:41:58 2010 (r201766) +++ head/sys/dev/ste/if_ste.c Fri Jan 8 02:39:53 2010 (r201767) @@ -120,7 +120,7 @@ static int ste_miibus_readreg(device_t, static void ste_miibus_statchg(device_t); static int ste_miibus_writereg(device_t, int, int, int); static int ste_newbuf(struct ste_softc *, struct ste_chain_onefrag *); -static int ste_read_eeprom(struct ste_softc *, caddr_t, int, int, int); +static int ste_read_eeprom(struct ste_softc *, uint16_t *, int, int); static void ste_reset(struct ste_softc *); static void ste_restart_tx(struct ste_softc *); static int ste_rxeof(struct ste_softc *, int); @@ -538,9 +538,8 @@ ste_eeprom_wait(struct ste_softc *sc) * data is stored in the EEPROM in network byte order. */ static int -ste_read_eeprom(struct ste_softc *sc, caddr_t dest, int off, int cnt, int swap) +ste_read_eeprom(struct ste_softc *sc, uint16_t *dest, int off, int cnt) { - uint16_t word, *ptr; int err = 0, i; if (ste_eeprom_wait(sc)) @@ -551,12 +550,8 @@ ste_read_eeprom(struct ste_softc *sc, ca err = ste_eeprom_wait(sc); if (err) break; - word = CSR_READ_2(sc, STE_EEPROM_DATA); - ptr = (uint16_t *)(dest + (i * 2)); - if (swap) - *ptr = ntohs(word); - else - *ptr = word; + *dest = le16toh(CSR_READ_2(sc, STE_EEPROM_DATA)); + dest++; } return (err ? 1 : 0); @@ -1063,7 +1058,7 @@ ste_attach(device_t dev) { struct ste_softc *sc; struct ifnet *ifp; - u_char eaddr[6]; + uint16_t eaddr[ETHER_ADDR_LEN / 2]; int error = 0, pmc, rid; sc = device_get_softc(dev); @@ -1122,8 +1117,7 @@ ste_attach(device_t dev) /* * Get station address from the EEPROM. */ - if (ste_read_eeprom(sc, eaddr, - STE_EEADDR_NODE0, 3, 0)) { + if (ste_read_eeprom(sc, eaddr, STE_EEADDR_NODE0, ETHER_ADDR_LEN / 2)) { device_printf(dev, "failed to read station address\n"); error = ENXIO; goto fail; @@ -1163,7 +1157,7 @@ ste_attach(device_t dev) /* * Call MI attach routine. */ - ether_ifattach(ifp, eaddr); + ether_ifattach(ifp, (uint8_t *)eaddr); /* * Tell the upper layer(s) we support long frames. From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 02:43:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 691511065672; Fri, 8 Jan 2010 02:43:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5883F8FC13; Fri, 8 Jan 2010 02:43:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o082hKxW040137; Fri, 8 Jan 2010 02:43:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o082hKkb040135; Fri, 8 Jan 2010 02:43:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001080243.o082hKkb040135@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 02:43:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201768 - head/sys/dev/ste X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 02:43:20 -0000 Author: yongari Date: Fri Jan 8 02:43:20 2010 New Revision: 201768 URL: http://svn.freebsd.org/changeset/base/201768 Log: Make sure to store dma address of RX buffer in little endian form. This fixes the last bug which keeps ste(4) from working on sparc64. Modified: head/sys/dev/ste/if_ste.c Modified: head/sys/dev/ste/if_ste.c ============================================================================== --- head/sys/dev/ste/if_ste.c Fri Jan 8 02:39:53 2010 (r201767) +++ head/sys/dev/ste/if_ste.c Fri Jan 8 02:43:20 2010 (r201768) @@ -1573,12 +1573,14 @@ ste_init_rx_list(struct ste_softc *sc) return (error); if (i == (STE_RX_LIST_CNT - 1)) { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[0]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * 0); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * 0)); } else { cd->ste_rx_chain[i].ste_next = &cd->ste_rx_chain[i + 1]; - ld->ste_rx_list[i].ste_next = ld->ste_rx_list_paddr + - (sizeof(struct ste_desc_onefrag) * (i + 1)); + ld->ste_rx_list[i].ste_next = + htole32(ld->ste_rx_list_paddr + + (sizeof(struct ste_desc_onefrag) * (i + 1))); } } From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 02:46:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD1E8106566B; Fri, 8 Jan 2010 02:46:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5DD8FC08; Fri, 8 Jan 2010 02:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o082kY5w040902; Fri, 8 Jan 2010 02:46:34 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o082kYsj040900; Fri, 8 Jan 2010 02:46:34 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001080246.o082kYsj040900@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 02:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201769 - head/sys/sparc64/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 02:46:34 -0000 Author: yongari Date: Fri Jan 8 02:46:34 2010 New Revision: 201769 URL: http://svn.freebsd.org/changeset/base/201769 Log: Enable ste(4). ste(4) should work on all architectures. Modified: head/sys/sparc64/conf/GENERIC Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Fri Jan 8 02:43:20 2010 (r201768) +++ head/sys/sparc64/conf/GENERIC Fri Jan 8 02:46:34 2010 (r201769) @@ -190,7 +190,7 @@ device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') #device sis # Silicon Integrated Systems SiS 900/SiS 7016 device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet -#device ste # Sundance ST201 (D-Link DFE-550TX) +device ste # Sundance ST201 (D-Link DFE-550TX) device stge # Sundance/Tamarack TC9021 gigabit Ethernet #device tl # Texas Instruments ThunderLAN #device tx # SMC EtherPower II (83c170 ``EPIC'') From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 06:11:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD908106566C; Fri, 8 Jan 2010 06:11:26 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 424248FC13; Fri, 8 Jan 2010 06:11:25 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o086BOuQ013651; Fri, 8 Jan 2010 09:11:24 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1262931084; bh=QTuze42duKMnF2ri105X2/q9xZMPei0vMk2y6GKTkzY=; l=698; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=ggaPd/pkzcNlJ9CQIPUMQ+Q34H7Pc7cAHaDXIoJgpvP9V3lHcAb3azThWvicjleQX Kx2h+yIimAOqZqrBbEFNw2AM4iD7WXW/5lTlGmZInoZ9W5XOzWE038qnFEcgg7ao1k fNan2pHpP5QKw8nqbMhNHxJmk4QS+mwKJVQSPbmU= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o086BNuP013650; Fri, 8 Jan 2010 09:11:24 +0300 (MSK) (envelope-from ache) Date: Fri, 8 Jan 2010 09:11:23 +0300 From: Andrey Chernov To: Bruce Evans Message-ID: <20100108061123.GA13136@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001052020.o05KKVEp002337@svn.freebsd.org> <20100107050409.GA85573@nagual.pp.ru> <20100108030937.Q56559@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100108030937.Q56559@delplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 06:11:26 -0000 On Fri, Jan 08, 2010 at 03:29:07AM +1100, Bruce Evans wrote: > Nothing has turned here yet. We just didn't want to risk changing > alphasort() yet. I mean the comment itself. > POSIX adds an EINVAL error and a requirement that errno no be modified > if there is no error, so that errors from strcoll() can be detected > (still messily -- you have to set errno to != EINVAL before the call). > Maybe falling back to strcmp() is good enough for the errnor handling. Currently strcoll() never use EILSEQ and always falback to ASCII when ordering is equal. In the future, when EILSEQ will be used, it can fallback to ASCII too, producing stable ordering. -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 06:25:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB67F1065676 for ; Fri, 8 Jan 2010 06:25:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 747AE8FC0C for ; Fri, 8 Jan 2010 06:25:46 +0000 (UTC) Received: (qmail 23313 invoked by uid 399); 8 Jan 2010 06:25:46 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Jan 2010 06:25:46 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B46CFE8.8000501@FreeBSD.org> Date: Thu, 07 Jan 2010 22:25:44 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> In-Reply-To: <867hrvgw2j.fsf@ds4.des.no> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 06:25:46 -0000 Dag-Erling Smørgrav wrote: > I don't see how the Rumsfeld quote could offend anyone. A) Better safe than sorry B) Regardless of my own opinions I can easily see how someone could be offended by anything having to do with Rumsfeld, the Iraq war, etc. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 06:26:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28BCE106566C; Fri, 8 Jan 2010 06:26:39 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 7A6748FC20; Fri, 8 Jan 2010 06:26:38 +0000 (UTC) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.3/8.14.3) with ESMTP id o086QZ5f015087; Fri, 8 Jan 2010 09:26:35 +0300 (MSK) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nagual.pp.ru; s=default; t=1262931995; bh=hGyLPH9fzOB6E1q2tUdE7G6KP4AtZIw6sdtmIOCTsW8=; l=559; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=sWeeRCUhcRsSaUU0420hy+Y++ih5Gp7mw4CA27AeIbFR0zJuUAaXj3YGXfOH1SjV2 9B8br2Jyllp40tdeAouoIaubJKKSF82RdFweonBP8dhs4Nqsjz4cBHq2K2sf4lTSiV DAg/iYFw5OegEfM2kJtlAZIE6yu7wbXDajZWW0ic= Received: (from ache@localhost) by nagual.pp.ru (8.14.3/8.14.3/Submit) id o086QYM1015085; Fri, 8 Jan 2010 09:26:35 +0300 (MSK) (envelope-from ache) Date: Fri, 8 Jan 2010 09:26:34 +0300 From: Andrey Chernov To: Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100108062634.GA14489@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Bruce Evans , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201001052020.o05KKVEp002337@svn.freebsd.org> <20100107050409.GA85573@nagual.pp.ru> <20100108030937.Q56559@delplex.bde.org> <20100108061123.GA13136@nagual.pp.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100108061123.GA13136@nagual.pp.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r201604 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 06:26:39 -0000 On Fri, Jan 08, 2010 at 09:11:23AM +0300, Andrey Chernov wrote: > On Fri, Jan 08, 2010 at 03:29:07AM +1100, Bruce Evans wrote: > > Nothing has turned here yet. We just didn't want to risk changing > > alphasort() yet. > > I mean the comment itself. I.e. instead of making this doubtful comment, it will be more logical to commit strcmp() -> strcoll() replacement, while someone (kib@) in that area. Lack of strcoll() in alphasort() is just missed change and not risk area. ls proved to pass this risk area well. -- http://ache.pp.ru/ From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 07:57:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08DCF106566B; Fri, 8 Jan 2010 07:57:44 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECB9F8FC12; Fri, 8 Jan 2010 07:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o087vh1h009801; Fri, 8 Jan 2010 07:57:43 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o087vhrr009799; Fri, 8 Jan 2010 07:57:43 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201001080757.o087vhrr009799@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 8 Jan 2010 07:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201773 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 07:57:44 -0000 Author: jh Date: Fri Jan 8 07:57:43 2010 New Revision: 201773 URL: http://svn.freebsd.org/changeset/base/201773 Log: - Change the type of size_max to u_quad_t because its value is converted with vfs_scanopt(9) using the "%qu" format string. - Limit the maximum value of size_max to (SIZE_MAX - PAGE_SIZE) to prevent overflow in howmany() macro. PR: kern/141194 Approved by: trasz (mentor) MFC after: 2 weeks Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Jan 8 07:42:01 2010 (r201772) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Jan 8 07:57:43 2010 (r201773) @@ -185,8 +185,8 @@ tmpfs_mount(struct mount *mp) ino_t nodes; int error; /* Size counters. */ - ino_t nodes_max; - size_t size_max; + ino_t nodes_max; + u_quad_t size_max; /* Root node attributes. */ uid_t root_uid; @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max >= SIZE_MAX) + if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) pages = SIZE_MAX; else pages = howmany(size_max, PAGE_SIZE); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 09:16:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71F1106566B; Fri, 8 Jan 2010 09:16:37 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A73C88FC18; Fri, 8 Jan 2010 09:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o089GbSt027073; Fri, 8 Jan 2010 09:16:37 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o089Gblb027071; Fri, 8 Jan 2010 09:16:37 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001080916.o089Gblb027071@svn.freebsd.org> From: Alan Cox Date: Fri, 8 Jan 2010 09:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201774 - head/sys/i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 09:16:37 -0000 Author: alc Date: Fri Jan 8 09:16:37 2010 New Revision: 201774 URL: http://svn.freebsd.org/changeset/base/201774 Log: Catch up with r183101 that added "device acpi" to GENERIC. Modified: head/sys/i386/conf/PAE Modified: head/sys/i386/conf/PAE ============================================================================== --- head/sys/i386/conf/PAE Fri Jan 8 07:57:43 2010 (r201773) +++ head/sys/i386/conf/PAE Fri Jan 8 09:16:37 2010 (r201774) @@ -10,10 +10,6 @@ ident PAE-GENERIC # To make a PAE kernel, the next option is needed options PAE # Physical Address Extensions Kernel -# Compile acpi in statically since the module isn't built properly. Most -# machines which support large amounts of memory require acpi. -device acpi - # Don't build modules with this kernel config, since they are not built with # the correct options headers. makeoptions NO_MODULES=yes From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 09:59:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D2B61065672; Fri, 8 Jan 2010 09:59:14 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF91F8FC15; Fri, 8 Jan 2010 09:59:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o089xDZW036495; Fri, 8 Jan 2010 09:59:13 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o089xDqc036493; Fri, 8 Jan 2010 09:59:13 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001080959.o089xDqc036493@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 8 Jan 2010 09:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201777 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 09:59:14 -0000 Author: netchild Date: Fri Jan 8 09:59:13 2010 New Revision: 201777 URL: http://svn.freebsd.org/changeset/base/201777 Log: MFC r197816: ---snip--- Prevent paging pressure from draining arc too much - always drain arc if above arc_c_max - never drain arc if arc is below arc_c_max ---snip--- Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jan 8 09:31:19 2010 (r201776) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jan 8 09:59:13 2010 (r201777) @@ -1821,6 +1821,12 @@ arc_reclaim_needed(void) #endif #ifdef _KERNEL + if (needfree) + return (1); + if (arc_size > arc_c_max) + return (1); + if (arc_size <= arc_c_min) + return (0); /* * If pages are needed or we're within 2048 pages @@ -1829,9 +1835,6 @@ arc_reclaim_needed(void) if (vm_pages_needed || (vm_paging_target() > -2048)) return (1); - if (needfree) - return (1); - #if 0 /* * take 'desfree' extra pages, so we reclaim sooner, rather than later From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 10:13:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90F46106566B; Fri, 8 Jan 2010 10:13:27 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FFFD8FC0A; Fri, 8 Jan 2010 10:13:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08ADR3b041677; Fri, 8 Jan 2010 10:13:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08ADRWr041675; Fri, 8 Jan 2010 10:13:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001081013.o08ADRWr041675@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 8 Jan 2010 10:13:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201778 - stable/8/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 10:13:27 -0000 Author: gavin Date: Fri Jan 8 10:13:27 2010 New Revision: 201778 URL: http://svn.freebsd.org/changeset/base/201778 Log: MFC r200994: Set the locally-assigned bit in the randomly generated Ethernet address if we end up having to generate one. PR: kern/133239 Discussed with: yongari Approved by: ed (mentor, implicit) Modified: stable/8/sys/dev/jme/if_jme.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Fri Jan 8 09:59:13 2010 (r201777) +++ stable/8/sys/dev/jme/if_jme.c Fri Jan 8 10:13:27 2010 (r201778) @@ -465,7 +465,7 @@ jme_reg_macaddr(struct jme_softc *sc) "generating fake ethernet address.\n"); par0 = arc4random(); /* Set OUI to JMicron. */ - sc->jme_eaddr[0] = 0x00; + sc->jme_eaddr[0] = 0x02; /* U/L bit set. */ sc->jme_eaddr[1] = 0x1B; sc->jme_eaddr[2] = 0x8C; sc->jme_eaddr[3] = (par0 >> 16) & 0xff; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 10:14:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98BCB1065693; Fri, 8 Jan 2010 10:14:27 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 880078FC12; Fri, 8 Jan 2010 10:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08AERUC041950; Fri, 8 Jan 2010 10:14:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08AEROp041948; Fri, 8 Jan 2010 10:14:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001081014.o08AEROp041948@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 8 Jan 2010 10:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201779 - stable/7/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 10:14:27 -0000 Author: gavin Date: Fri Jan 8 10:14:27 2010 New Revision: 201779 URL: http://svn.freebsd.org/changeset/base/201779 Log: MFC r200994: Set the locally-assigned bit in the randomly generated Ethernet address if we end up having to generate one. PR: kern/133239 Discussed with: yongari Approved by: ed (mentor, implicit) Modified: stable/7/sys/dev/jme/if_jme.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Fri Jan 8 10:13:27 2010 (r201778) +++ stable/7/sys/dev/jme/if_jme.c Fri Jan 8 10:14:27 2010 (r201779) @@ -465,7 +465,7 @@ jme_reg_macaddr(struct jme_softc *sc) "generating fake ethernet address.\n"); par0 = arc4random(); /* Set OUI to JMicron. */ - sc->jme_eaddr[0] = 0x00; + sc->jme_eaddr[0] = 0x02; /* U/L bit set. */ sc->jme_eaddr[1] = 0x1B; sc->jme_eaddr[2] = 0x8C; sc->jme_eaddr[3] = (par0 >> 16) & 0xff; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 10:32:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC241065696; Fri, 8 Jan 2010 10:32:27 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D286F8FC1F; Fri, 8 Jan 2010 10:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08AWR7m045969; Fri, 8 Jan 2010 10:32:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08AWROo045967; Fri, 8 Jan 2010 10:32:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201001081032.o08AWROo045967@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 8 Jan 2010 10:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201781 - head/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 10:32:28 -0000 Author: gavin Date: Fri Jan 8 10:32:27 2010 New Revision: 201781 URL: http://svn.freebsd.org/changeset/base/201781 Log: If we fail to read the Ethernet address from the card, just print an warning message and attach without setting the Ethernet address to a random address. It is not believed that this code can actually be executed, and if it does, we're better off printing an error message than faking up an Ethernet address. PR: kern/133239 Reviewed by: yongari (earlier version of patch) Approved by: ed (mentor) Modified: head/sys/dev/jme/if_jme.c Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Jan 8 10:15:11 2010 (r201780) +++ head/sys/dev/jme/if_jme.c Fri Jan 8 10:32:27 2010 (r201781) @@ -462,15 +462,7 @@ jme_reg_macaddr(struct jme_softc *sc) if ((par0 == 0 && par1 == 0) || (par0 == 0xFFFFFFFF && par1 == 0xFFFF)) { device_printf(sc->jme_dev, - "generating fake ethernet address.\n"); - par0 = arc4random(); - /* Set OUI to JMicron. */ - sc->jme_eaddr[0] = 0x02; /* U/L bit set. */ - sc->jme_eaddr[1] = 0x1B; - sc->jme_eaddr[2] = 0x8C; - sc->jme_eaddr[3] = (par0 >> 16) & 0xff; - sc->jme_eaddr[4] = (par0 >> 8) & 0xff; - sc->jme_eaddr[5] = par0 & 0xff; + "Failed to retrieve Ethernet address.\n"); } else { sc->jme_eaddr[0] = (par0 >> 0) & 0xFF; sc->jme_eaddr[1] = (par0 >> 8) & 0xFF; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 10:54:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 656111065672; Fri, 8 Jan 2010 10:54:15 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54EB28FC13; Fri, 8 Jan 2010 10:54:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08AsF7p050833; Fri, 8 Jan 2010 10:54:15 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08AsFVA050831; Fri, 8 Jan 2010 10:54:15 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201001081054.o08AsFVA050831@svn.freebsd.org> From: Maxim Sobolev Date: Fri, 8 Jan 2010 10:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201782 - head/contrib/tcp_wrappers X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 10:54:15 -0000 Author: sobomax Date: Fri Jan 8 10:54:15 2010 New Revision: 201782 URL: http://svn.freebsd.org/changeset/base/201782 Log: Allow comment (#) to be placed anywhere in the line, not only at the beginning, so it's consistent with other configuration files. MFC after: 3 weeks Modified: head/contrib/tcp_wrappers/hosts_access.c Modified: head/contrib/tcp_wrappers/hosts_access.c ============================================================================== --- head/contrib/tcp_wrappers/hosts_access.c Fri Jan 8 10:32:27 2010 (r201781) +++ head/contrib/tcp_wrappers/hosts_access.c Fri Jan 8 10:54:15 2010 (r201782) @@ -148,6 +148,7 @@ struct request_info *request; char *sh_cmd; /* becomes optional shell command */ int match = NO; struct tcpd_context saved_context; + char *cp; saved_context = tcpd_context; /* stupid compilers */ @@ -164,7 +165,16 @@ struct request_info *request; tcpd_warn("missing newline or line too long"); continue; } - if (sv_list[0] == '#' || sv_list[strspn(sv_list, " \t\r\n")] == 0) + /* Ignore anything after unescaped # character */ + for (cp = strchr(sv_list, '#'); cp != NULL;) { + if (cp > sv_list && cp[-1] == '\\') { + cp = strchr(cp + 1, '#'); + continue; + } + *cp = '\0'; + break; + } + if (sv_list[strspn(sv_list, " \t\r\n")] == 0) continue; if ((cl_list = split_at(sv_list, ':')) == 0) { tcpd_warn("missing \":\" separator"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 11:06:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2812F1065672; Fri, 8 Jan 2010 11:06:14 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F0B1F8FC0C; Fri, 8 Jan 2010 11:06:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08B6DkW053510; Fri, 8 Jan 2010 11:06:13 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08B6D7l053507; Fri, 8 Jan 2010 11:06:13 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201001081106.o08B6D7l053507@svn.freebsd.org> From: Alexander Leidinger Date: Fri, 8 Jan 2010 11:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201783 - stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 11:06:14 -0000 Author: netchild Date: Fri Jan 8 11:06:13 2010 New Revision: 201783 URL: http://svn.freebsd.org/changeset/base/201783 Log: MFC r197514: ---snip--- On lookup error VFS expects *vpp to be set to NULL, be sure to do that. ---snip--- r197816: ---snip--- Prevent paging pressure from draining arc too much - always drain arc if above arc_c_max - never drain arc if arc is below arc_c_max ---snip--- Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jan 8 10:54:15 2010 (r201782) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jan 8 11:06:13 2010 (r201783) @@ -1820,6 +1820,12 @@ arc_reclaim_needed(void) #endif #ifdef _KERNEL + if (needfree) + return (1); + if (arc_size > arc_c_max) + return (1); + if (arc_size <= arc_c_min) + return (0); /* * If pages are needed or we're within 2048 pages @@ -1828,9 +1834,6 @@ arc_reclaim_needed(void) if (vm_pages_needed || (vm_paging_target() > -2048)) return (1); - if (needfree) - return (1); - #if 0 /* * take 'desfree' extra pages, so we reclaim sooner, rather than later Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jan 8 10:54:15 2010 (r201782) +++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jan 8 11:06:13 2010 (r201783) @@ -897,6 +897,8 @@ domount: } mutex_exit(&sdp->sd_lock); ZFS_EXIT(zfsvfs); + if (err != 0) + *vpp = NULL; return (err); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 11:16:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D45B7106568B; Fri, 8 Jan 2010 11:16:58 +0000 (UTC) (envelope-from dwmalone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E2B08FC0A; Fri, 8 Jan 2010 11:16:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08BGwsw055919; Fri, 8 Jan 2010 11:16:58 GMT (envelope-from dwmalone@svn.freebsd.org) Received: (from dwmalone@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08BGw3c055917; Fri, 8 Jan 2010 11:16:58 GMT (envelope-from dwmalone@svn.freebsd.org) Message-Id: <201001081116.o08BGw3c055917@svn.freebsd.org> From: David Malone Date: Fri, 8 Jan 2010 11:16:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201784 - head/usr.bin/ctags X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 11:16:58 -0000 Author: dwmalone Date: Fri Jan 8 11:16:58 2010 New Revision: 201784 URL: http://svn.freebsd.org/changeset/base/201784 Log: This now passes a make universe with WARNS=6. Modified: head/usr.bin/ctags/Makefile Modified: head/usr.bin/ctags/Makefile ============================================================================== --- head/usr.bin/ctags/Makefile Fri Jan 8 11:06:13 2010 (r201783) +++ head/usr.bin/ctags/Makefile Fri Jan 8 11:16:58 2010 (r201784) @@ -5,6 +5,4 @@ PROG= ctags SRCS= C.c ctags.c fortran.c lisp.c print.c tree.c yacc.c CFLAGS+=-I${.CURDIR} -WARNS?= 1 - .include From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 11:43:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0AE106566B; Fri, 8 Jan 2010 11:43:48 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 886908FC0C; Fri, 8 Jan 2010 11:43:47 +0000 (UTC) Received: by fxm27 with SMTP id 27so4579794fxm.3 for ; Fri, 08 Jan 2010 03:43:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pK/zzBRyYSX+7I3LfKnjitKNTx7zy11JSzJOREXnSk4=; b=maWl010nZA9cMr91wGjkIjY/aqCk9cV3hleXdyroYUpt3xmLYIj8TRPIRbd3Jy14zN tF4GnhjUMh0K2DfKKo+9G3t3yAZdk6wXuTjC3c6yjLFcAheyZjiogkpDOt/XSspIFDAr nDQlENb3TB698koDHQuIR4mTuYlEaQ1S3lfFk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=B28pt0SAp0N22Jr0HmE5xhhHrjF5/ou+IjvjJzoaBLUyQwYiT4NuXK/UaKgYd+kDFJ 3emzO+Ww6URJCVEEPChoKtSESX7PoxLzrDVlAeWIPHTuCVvPfaasw+H8dKkIfCaFsiFy 3RQ+WSnI3cea6JJiQ8DJf/nvAQfG8y9qBBsDY= MIME-Version: 1.0 Received: by 10.239.168.9 with SMTP id i9mr1499424hbe.76.1262951021644; Fri, 08 Jan 2010 03:43:41 -0800 (PST) In-Reply-To: <4B46CFE8.8000501@FreeBSD.org> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> Date: Fri, 8 Jan 2010 09:43:41 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Stanislav Sedov , =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 11:43:48 -0000 2010/1/8 Doug Barton : > Dag-Erling Sm=F8rgrav wrote: >> I don't see how the Rumsfeld quote could offend anyone. > > A) Better safe than sorry > B) Regardless of my own opinions I can easily see how someone could be > offended by anything having to do with Rumsfeld, the Iraq war, etc. Perhaps, at the moment. Five to ten years from now that quotation will be just history, like the ones from/about JFK, Richard Nixon, and Spiro Agnew. Are you whiling to apply such rule to all supposedly political fortunes? Looks like political correctness started to infect the BSD culture. Once upon a time this was the OS with guts to have a function called "die_you_gravy_sucking_pig_dog". From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 13:47:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFDF3106566C; Fri, 8 Jan 2010 13:47:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A02A88FC14; Fri, 8 Jan 2010 13:47:16 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5A2DA46B23; Fri, 8 Jan 2010 08:47:16 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 60D7F8A01F; Fri, 8 Jan 2010 08:47:15 -0500 (EST) From: John Baldwin To: Luigi Rizzo Date: Fri, 8 Jan 2010 08:12:21 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20091103; KDE/4.3.1; amd64; ; ) References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100107203536.GB8230@rincewind.paeps.cx> <20100107214334.GA35184@onelab2.iet.unipi.it> In-Reply-To: <20100107214334.GA35184@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201001080812.21124.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 08 Jan 2010 08:47:15 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Michael Tuexen Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 13:47:16 -0000 On Thursday 07 January 2010 4:43:34 pm Luigi Rizzo wrote: > > What do you do with udp, for instance? Compared to tcp and sctp, it's > > trivial in terms of code, but it's an upper layer protocol from the > > perspective of netinet/netinet6 - do we put it in its own directory too? > > Also note that this won't only cause churn for people who have patches against > > or (out-of-tree) branches from netinet/, but also in other kernel subsystems > > which rely on tcp -- nfs, for instance. > > + i find the concern about churn in external patchsets a bit weak, first of > all because this is bound to happen unless we stop all development, > and secondly because this kind of file moving or splitting happens > once every 10-15 years which is well beyond the lifetime of a patchset. Having the files rename is entirely different from merging changes. At least for svn and p4 I believe that merging a rename into a branch is not smart enough to merge your local changes into the new files. Instead it involves a big manual fixup. Also, the 10-15 years thing is completely non-relevant. What is relevant is if you are working on a project in a branch and someone renames files before you have finished your branch and merged it up to HEAD. For example, assume that someone else renamed the ipfw files in HEAD next week. That would create an utter mess for you to resolve in your current ipfw3 branch. Moving TCP would create similar a headache, except much more widespread since TCP is one of the most widely worked-on subsystems. FWIW, I do think it would be cleaner to have netinet more split up perhaps, but I do not think it is worth the pain that would be involved. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 14:30:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B49741065672; Fri, 8 Jan 2010 14:30:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26C38FC15; Fri, 8 Jan 2010 14:30:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08EU314098515; Fri, 8 Jan 2010 14:30:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08EU36P098513; Fri, 8 Jan 2010 14:30:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001081430.o08EU36P098513@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 8 Jan 2010 14:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201787 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 14:30:03 -0000 Author: jilles Date: Fri Jan 8 14:30:03 2010 New Revision: 201787 URL: http://svn.freebsd.org/changeset/base/201787 Log: MFC r201354: sh(1): Correct two places where "$@" lacked necessary quotes. Modified: stable/8/bin/sh/sh.1 Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/sh.1 ============================================================================== --- stable/8/bin/sh/sh.1 Fri Jan 8 12:08:41 2010 (r201786) +++ stable/8/bin/sh/sh.1 Fri Jan 8 14:30:03 2010 (r201787) @@ -862,7 +862,7 @@ command is: If .Ic in and the following words are omitted, -.Ic in Li $@ +.Ic in Li \&"$@\&" is used instead. The words are expanded, and then the list is executed repeatedly with the variable set to each word in turn. @@ -1077,7 +1077,7 @@ and is .Dq Li "def ghi" , then -.Dq Li $@ +.Li \&"$@\&" expands to the two arguments: .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 14:33:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A161106566C; Fri, 8 Jan 2010 14:33:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87C258FC14; Fri, 8 Jan 2010 14:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08EX3Z6099231; Fri, 8 Jan 2010 14:33:03 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08EX37o099229; Fri, 8 Jan 2010 14:33:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001081433.o08EX37o099229@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 8 Jan 2010 14:33:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201788 - stable/8/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 14:33:03 -0000 Author: jilles Date: Fri Jan 8 14:33:03 2010 New Revision: 201788 URL: http://svn.freebsd.org/changeset/base/201788 Log: MFC r201355: sh(1): document ulimit -w (swapuse rlimit). Modified: stable/8/bin/sh/sh.1 Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/sh.1 ============================================================================== --- stable/8/bin/sh/sh.1 Fri Jan 8 14:30:03 2010 (r201787) +++ stable/8/bin/sh/sh.1 Fri Jan 8 14:33:03 2010 (r201788) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 31, 2009 +.Dd January 8, 2010 .Dt SH 1 .Os .Sh NAME @@ -2131,7 +2131,7 @@ and not found. For aliases the alias expansion is printed; for commands and tracked aliases the complete pathname of the command is printed. -.It Ic ulimit Oo Fl HSabcdflmnpstuv Oc Op Ar limit +.It Ic ulimit Oo Fl HSabcdflmnpstuvw Oc Op Ar limit Set or display resource limits (see .Xr getrlimit 2 ) . If @@ -2195,6 +2195,9 @@ The maximal amount of CPU time to be use The maximal number of simultaneous processes for this user ID. .It Fl v Ar virtualmem The maximal virtual size of a process, in kilobytes. +.It Fl w Ar swapuse +The maximum amount of swap space reserved or used for this user ID, +in kilobytes. .El .It Ic umask Oo Fl S Oc Op Ar mask Set the file creation mask (see From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 14:55:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FE45106566C; Fri, 8 Jan 2010 14:55:11 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E12E8FC0A; Fri, 8 Jan 2010 14:55:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08EtBw9004347; Fri, 8 Jan 2010 14:55:11 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08EtB0b004344; Fri, 8 Jan 2010 14:55:11 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001081455.o08EtB0b004344@svn.freebsd.org> From: Attilio Rao Date: Fri, 8 Jan 2010 14:55:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201790 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 14:55:11 -0000 Author: attilio Date: Fri Jan 8 14:55:11 2010 New Revision: 201790 URL: http://svn.freebsd.org/changeset/base/201790 Log: - Fix a bug in sched_4bsd where the timestamp for the sleeping operation is not cleaned up on the wakeup but reset. This is harmless mostly because td_slptick (and ki_slptime from userland) should be analyzed only with the assumption that the thread is actually sleeping (thus while the td_slptick is correctly set) but without this invariant the number is nomore consistent. - Move td_slptick from u_int to int in order to follow 'ticks' signedness and wrap up accordingly [0] [0] Submitted by: emaste Sponsored by: Sandvine Incorporated MFC 1 week Modified: head/sys/kern/sched_4bsd.c head/sys/sys/proc.h Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Jan 8 14:55:10 2010 (r201789) +++ head/sys/kern/sched_4bsd.c Fri Jan 8 14:55:11 2010 (r201790) @@ -1050,7 +1050,7 @@ sched_wakeup(struct thread *td) updatepri(td); resetpriority(td); } - td->td_slptick = ticks; + td->td_slptick = 0; ts->ts_slptime = 0; sched_add(td, SRQ_BORING); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Jan 8 14:55:10 2010 (r201789) +++ head/sys/sys/proc.h Fri Jan 8 14:55:11 2010 (r201790) @@ -217,7 +217,7 @@ struct thread { int td_pinned; /* (k) Temporary cpu pin count. */ struct ucred *td_ucred; /* (k) Reference to credentials. */ u_int td_estcpu; /* (t) estimated cpu utilization */ - u_int td_slptick; /* (t) Time at sleep. */ + int td_slptick; /* (t) Time at sleep. */ struct rusage td_ru; /* (t) rusage information */ uint64_t td_incruntime; /* (t) Cpu ticks to transfer to proc. */ uint64_t td_runtime; /* (t) How many cpu ticks we've run. */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:41:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 579ED10656A3; Fri, 8 Jan 2010 15:41:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 460F58FC1E; Fri, 8 Jan 2010 15:41:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08FfOSt014566; Fri, 8 Jan 2010 15:41:24 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08FfOHb014564; Fri, 8 Jan 2010 15:41:24 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081541.o08FfOHb014564@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201793 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:41:24 -0000 Author: trasz Date: Fri Jan 8 15:41:24 2010 New Revision: 201793 URL: http://svn.freebsd.org/changeset/base/201793 Log: Fix #ifdefs so that GCC 4.4 doesn't complain about it. Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Jan 8 15:28:22 2010 (r201792) +++ head/sys/net80211/ieee80211_var.h Fri Jan 8 15:41:24 2010 (r201793) @@ -32,11 +32,11 @@ * Definitions for IEEE 802.11 drivers. */ /* NB: portability glue must go first */ -#ifdef __NetBSD__ +#if defined(__NetBSD__) #include -#elif __FreeBSD__ +#elif defined(__FreeBSD__) #include -#elif __linux__ +#elif defined(__linux__) #include #else #error "No support for your operating system!" From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:44:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA1181065670; Fri, 8 Jan 2010 15:44:49 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE64C8FC0C; Fri, 8 Jan 2010 15:44:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08Fincv015364; Fri, 8 Jan 2010 15:44:49 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08FinVh015359; Fri, 8 Jan 2010 15:44:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081544.o08FinVh015359@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:44:50 -0000 Author: trasz Date: Fri Jan 8 15:44:49 2010 New Revision: 201794 URL: http://svn.freebsd.org/changeset/base/201794 Log: Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order to silence newer GCC versions. Modified: head/sys/ddb/db_ps.c head/sys/dev/ep/if_ep.c head/sys/dev/ex/if_ex.c head/sys/netinet6/ip6_input.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Fri Jan 8 15:41:24 2010 (r201793) +++ head/sys/ddb/db_ps.c Fri Jan 8 15:44:49 2010 (r201794) @@ -136,7 +136,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, if (TD_ON_LOCK(td)) lflag++; if (TD_IS_SLEEPING(td)) { - if (!td->td_flags & TDF_SINTR) + if (!(td->td_flags & TDF_SINTR)) dflag++; else sflag++; @@ -171,7 +171,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, state[1] = '\0'; /* Additional process state flags. */ - if (!p->p_flag & P_INMEM) + if (!(p->p_flag & P_INMEM)) strlcat(state, "W", sizeof(state)); if (p->p_flag & P_TRACED) strlcat(state, "X", sizeof(state)); Modified: head/sys/dev/ep/if_ep.c ============================================================================== --- head/sys/dev/ep/if_ep.c Fri Jan 8 15:41:24 2010 (r201793) +++ head/sys/dev/ep/if_ep.c Fri Jan 8 15:44:49 2010 (r201794) @@ -815,7 +815,7 @@ read_again: #endif EP_FRST(sc, F_RX_FIRST); status = CSR_READ_2(sc, EP_W1_RX_STATUS); - if (!status & ERR_RX_INCOMPLETE) { + if (!(status & ERR_RX_INCOMPLETE)) { /* * We see if by now, the packet has completly * arrived Modified: head/sys/dev/ex/if_ex.c ============================================================================== --- head/sys/dev/ex/if_ex.c Fri Jan 8 15:41:24 2010 (r201793) +++ head/sys/dev/ex/if_ex.c Fri Jan 8 15:44:49 2010 (r201794) @@ -677,7 +677,7 @@ ex_tx_intr(struct ex_softc *sc) while (sc->tx_head != sc->tx_tail) { CSR_WRITE_2(sc, HOST_ADDR_REG, sc->tx_head); - if (! CSR_READ_2(sc, IO_PORT_REG) & Done_bit) + if (!(CSR_READ_2(sc, IO_PORT_REG) & Done_bit)) break; tx_status = CSR_READ_2(sc, IO_PORT_REG); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri Jan 8 15:41:24 2010 (r201793) +++ head/sys/netinet6/ip6_input.c Fri Jan 8 15:44:49 2010 (r201794) @@ -1406,7 +1406,7 @@ ip6_savecontrol(struct inpcb *in6p, stru mp = &(*mp)->m_next; break; case IPPROTO_ROUTING: - if (!in6p->inp_flags & IN6P_RTHDR) + if (!(in6p->inp_flags & IN6P_RTHDR)) break; *mp = sbcreatecontrol((caddr_t)ip6e, elen, From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:46:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E5B21065670; Fri, 8 Jan 2010 15:46:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CEFB8FC1C; Fri, 8 Jan 2010 15:46:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08FkRGV015764; Fri, 8 Jan 2010 15:46:27 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08FkRIp015762; Fri, 8 Jan 2010 15:46:27 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081546.o08FkRIp015762@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:46:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201795 - head/sys/dev/mly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:46:28 -0000 Author: trasz Date: Fri Jan 8 15:46:27 2010 New Revision: 201795 URL: http://svn.freebsd.org/changeset/base/201795 Log: Put mly_timeout() under MLY_DEBUG, so that newer GCC versions don't complain about unused static function. Reviewed by: scottl Modified: head/sys/dev/mly/mly.c Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Fri Jan 8 15:44:49 2010 (r201794) +++ head/sys/dev/mly/mly.c Fri Jan 8 15:46:27 2010 (r201795) @@ -117,9 +117,9 @@ static void mly_printstate(struct mly_so static void mly_print_command(struct mly_command *mc); static void mly_print_packet(struct mly_command *mc); static void mly_panic(struct mly_softc *sc, char *reason); +static int mly_timeout(struct mly_softc *sc); #endif void mly_print_controller(int controller); -static int mly_timeout(struct mly_softc *sc); static d_open_t mly_user_open; @@ -2981,6 +2981,7 @@ mly_user_health(struct mly_softc *sc, st return(error); } +#ifdef MLY_DEBUG static int mly_timeout(struct mly_softc *sc) { @@ -3000,3 +3001,4 @@ mly_timeout(struct mly_softc *sc) return (0); } +#endif From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:47:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C9631065695; Fri, 8 Jan 2010 15:47:23 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B36A8FC20; Fri, 8 Jan 2010 15:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08FlNEJ015997; Fri, 8 Jan 2010 15:47:23 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08FlNux015995; Fri, 8 Jan 2010 15:47:23 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081547.o08FlNux015995@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201796 - head/sys/dev/iir X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:47:23 -0000 Author: trasz Date: Fri Jan 8 15:47:23 2010 New Revision: 201796 URL: http://svn.freebsd.org/changeset/base/201796 Log: Remove unused iir_watchdog(). Reviewed by: scottl Modified: head/sys/dev/iir/iir.c Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Fri Jan 8 15:46:27 2010 (r201795) +++ head/sys/dev/iir/iir.c Fri Jan 8 15:47:23 2010 (r201796) @@ -153,7 +153,6 @@ static void iir_action(struct cam_si static void iir_poll(struct cam_sim *sim); static void iir_shutdown(void *arg, int howto); static void iir_timeout(void *arg); -static void iir_watchdog(void *arg); static void gdt_eval_mapping(u_int32_t size, int *cyls, int *heads, int *secs); @@ -1484,40 +1483,6 @@ iir_timeout(void *arg) GDT_DPRINTF(GDT_D_TIMEOUT, ("iir_timeout(%p)\n", gccb)); } -static void -iir_watchdog(void *arg) -{ - struct gdt_softc *gdt; - - gdt = (struct gdt_softc *)arg; - GDT_DPRINTF(GDT_D_DEBUG, ("iir_watchdog(%p)\n", gdt)); - - { - int ccbs = 0, ucmds = 0, frees = 0, pends = 0; - struct gdt_ccb *p; - struct ccb_hdr *h; - struct gdt_ucmd *u; - - for (h = TAILQ_FIRST(&gdt->sc_ccb_queue); h != NULL; - h = TAILQ_NEXT(h, sim_links.tqe)) - ccbs++; - for (u = TAILQ_FIRST(&gdt->sc_ucmd_queue); u != NULL; - u = TAILQ_NEXT(u, links)) - ucmds++; - for (p = SLIST_FIRST(&gdt->sc_free_gccb); p != NULL; - p = SLIST_NEXT(p, sle)) - frees++; - for (p = SLIST_FIRST(&gdt->sc_pending_gccb); p != NULL; - p = SLIST_NEXT(p, sle)) - pends++; - - GDT_DPRINTF(GDT_D_TIMEOUT, ("ccbs %d ucmds %d frees %d pends %d\n", - ccbs, ucmds, frees, pends)); - } - - timeout(iir_watchdog, (caddr_t)gdt, hz * 15); -} - static void iir_shutdown( void *arg, int howto ) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:52:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65B82106566C; Fri, 8 Jan 2010 15:52:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53C408FC20; Fri, 8 Jan 2010 15:52:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08Fq6Ul017082; Fri, 8 Jan 2010 15:52:06 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Fq69e017080; Fri, 8 Jan 2010 15:52:06 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081552.o08Fq69e017080@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201797 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:52:07 -0000 Author: trasz Date: Fri Jan 8 15:52:06 2010 New Revision: 201797 URL: http://svn.freebsd.org/changeset/base/201797 Log: Remove unused uhci_dump_qhs(). Reviewed by: hps Modified: head/sys/dev/usb/controller/uhci.c Modified: head/sys/dev/usb/controller/uhci.c ============================================================================== --- head/sys/dev/usb/controller/uhci.c Fri Jan 8 15:47:23 2010 (r201796) +++ head/sys/dev/usb/controller/uhci.c Fri Jan 8 15:52:06 2010 (r201797) @@ -830,33 +830,6 @@ uhci_dump_all(uhci_softc_t *sc) } static void -uhci_dump_qhs(uhci_qh_t *sqh) -{ - uint8_t temp; - - temp = uhci_dump_qh(sqh); - - /* - * uhci_dump_qhs displays all the QHs and TDs from the given QH - * onwards Traverses sideways first, then down. - * - * QH1 QH2 No QH TD2.1 TD2.2 TD1.1 etc. - * - * TD2.x being the TDs queued at QH2 and QH1 being referenced from QH1. - */ - - if (temp & 1) - uhci_dump_qhs(sqh->h_next); - else - DPRINTF("No QH\n"); - - if (temp & 2) - uhci_dump_tds(sqh->e_next); - else - DPRINTF("No TD\n"); -} - -static void uhci_dump_tds(uhci_td_t *td) { for (; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:53:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8778D106568B; Fri, 8 Jan 2010 15:53:07 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 755818FC15; Fri, 8 Jan 2010 15:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08Fr72n017315; Fri, 8 Jan 2010 15:53:07 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Fr7S7017313; Fri, 8 Jan 2010 15:53:07 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081553.o08Fr7S7017313@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201798 - head/sys/fs/smbfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:53:07 -0000 Author: trasz Date: Fri Jan 8 15:53:07 2010 New Revision: 201798 URL: http://svn.freebsd.org/changeset/base/201798 Log: Remove unused smbfs_smb_qpathinfo(). Modified: head/sys/fs/smbfs/smbfs_smb.c Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Fri Jan 8 15:52:06 2010 (r201797) +++ head/sys/fs/smbfs/smbfs_smb.c Fri Jan 8 15:53:07 2010 (r201798) @@ -139,116 +139,6 @@ smbfs_smb_lock(struct smbnode *np, int o return smbfs_smb_lockandx(np, op, (uintptr_t)id, start, end, scred); } -static int -smbfs_smb_qpathinfo(struct smbnode *np, struct smbfattr *fap, - struct smb_cred *scred, short infolevel) -{ - struct smb_share *ssp = np->n_mount->sm_share; - struct smb_vc *vcp = SSTOVC(ssp); - struct smb_t2rq *t2p; - int error, svtz, timesok = 1; - struct mbchain *mbp; - struct mdchain *mdp; - u_int16_t date, time, wattr; - int64_t lint; - u_int32_t size, dattr; - - error = smb_t2_alloc(SSTOCP(ssp), SMB_TRANS2_QUERY_PATH_INFORMATION, - scred, &t2p); - if (error) - return error; - mbp = &t2p->t2_tparam; - mb_init(mbp); - if (!infolevel) { - if (SMB_DIALECT(vcp) < SMB_DIALECT_NTLM0_12) - infolevel = SMB_QUERY_FILE_STANDARD; - else - infolevel = SMB_QUERY_FILE_BASIC_INFO; - } - mb_put_uint16le(mbp, infolevel); - mb_put_uint32le(mbp, 0); - /* mb_put_uint8(mbp, SMB_DT_ASCII); specs are wrong */ - error = smbfs_fullpath(mbp, vcp, np, NULL, 0); - if (error) { - smb_t2_done(t2p); - return error; - } - t2p->t2_maxpcount = 2; - t2p->t2_maxdcount = vcp->vc_txmax; - error = smb_t2_request(t2p); - if (error) { - smb_t2_done(t2p); - if (infolevel == SMB_QUERY_FILE_STANDARD || error != EINVAL) - return error; - return smbfs_smb_qpathinfo(np, fap, scred, - SMB_QUERY_FILE_STANDARD); - } - mdp = &t2p->t2_rdata; - svtz = vcp->vc_sopt.sv_tz; - switch (infolevel) { - case SMB_QUERY_FILE_STANDARD: - timesok = 0; - md_get_uint16le(mdp, NULL); - md_get_uint16le(mdp, NULL); /* creation time */ - md_get_uint16le(mdp, &date); - md_get_uint16le(mdp, &time); /* access time */ - if (date || time) { - timesok++; - smb_dos2unixtime(date, time, 0, svtz, &fap->fa_atime); - } - md_get_uint16le(mdp, &date); - md_get_uint16le(mdp, &time); /* modify time */ - if (date || time) { - timesok++; - smb_dos2unixtime(date, time, 0, svtz, &fap->fa_mtime); - } - md_get_uint32le(mdp, &size); - fap->fa_size = size; - md_get_uint32(mdp, NULL); /* allocation size */ - md_get_uint16le(mdp, &wattr); - fap->fa_attr = wattr; - break; - case SMB_QUERY_FILE_BASIC_INFO: - timesok = 0; - md_get_int64(mdp, NULL); /* creation time */ - md_get_int64le(mdp, &lint); - if (lint) { - timesok++; - smb_time_NT2local(lint, svtz, &fap->fa_atime); - } - md_get_int64le(mdp, &lint); - if (lint) { - timesok++; - smb_time_NT2local(lint, svtz, &fap->fa_mtime); - } - md_get_int64le(mdp, &lint); - if (lint) { - timesok++; - smb_time_NT2local(lint, svtz, &fap->fa_ctime); - } - md_get_uint32le(mdp, &dattr); - fap->fa_attr = dattr; - md_get_uint32(mdp, NULL); - /* XXX could use ALL_INFO to get size */ - break; - default: - SMBERROR("unexpected info level %d\n", infolevel); - error = EINVAL; - } - smb_t2_done(t2p); - /* - * if all times are zero (observed with FAT on NT4SP6) - * then fall back to older info level - */ - if (!timesok) { - if (infolevel != SMB_QUERY_FILE_STANDARD) - return smbfs_smb_qpathinfo(np, fap, scred, - SMB_QUERY_FILE_STANDARD); - error = EINVAL; - } - return error; -} - int smbfs_smb_statfs2(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 15:57:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E02106566C; Fri, 8 Jan 2010 15:57:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714418FC1B; Fri, 8 Jan 2010 15:57:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08FvuHB018405; Fri, 8 Jan 2010 15:57:56 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Fvu4D018403; Fri, 8 Jan 2010 15:57:56 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081557.o08Fvu4D018403@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 15:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201799 - head/sys/dev/lmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 15:57:56 -0000 Author: trasz Date: Fri Jan 8 15:57:56 2010 New Revision: 201799 URL: http://svn.freebsd.org/changeset/base/201799 Log: One more #ifdef fix for GCC 4.4. Modified: head/sys/dev/lmc/if_lmc.c Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Jan 8 15:53:07 2010 (r201798) +++ head/sys/dev/lmc/if_lmc.c Fri Jan 8 15:57:56 2010 (r201799) @@ -4842,7 +4842,7 @@ setup_ifnet(struct ifnet *ifp) if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); # elif defined(__NetBSD__) strcpy(ifp->if_xname, sc->dev.dv_xname); -# elif __OpenBSD__ +# elif defined(__OpenBSD__) bcopy(sc->dev.dv_xname, ifp->if_xname, IFNAMSIZ); # elif defined(__bsdi__) ifp->if_name = sc->dev.dv_cfdata->cf_driver->cd_name; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:12:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76C1F1065679; Fri, 8 Jan 2010 16:12:15 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep15-int.chello.at (viefep15-int.chello.at [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id DE3908FC17; Fri, 8 Jan 2010 16:12:13 +0000 (UTC) Received: from edge04.upc.biz ([192.168.13.239]) by viefep15-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20100108161212.DRGA18259.viefep15-int.chello.at@edge04.upc.biz>; Fri, 8 Jan 2010 17:12:12 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge04.upc.biz with edge id T4CB1d01n0a5KZh044CCM7; Fri, 08 Jan 2010 17:12:12 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id AF2A66D41B; Fri, 8 Jan 2010 17:12:10 +0100 (CET) Date: Fri, 8 Jan 2010 17:12:10 +0100 From: Stefan Farfeleder To: Edward Tomasz Napierala Message-ID: <20100108161210.GC1610@mole.fafoe.narf.at> References: <201001081544.o08FinVh015359@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201001081544.o08FinVh015359@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:12:15 -0000 On Fri, Jan 08, 2010 at 03:44:49PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Jan 8 15:44:49 2010 > New Revision: 201794 > URL: http://svn.freebsd.org/changeset/base/201794 > > Log: > Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order > to silence newer GCC versions. They are not identical, !a & b is parsed as (!a) & b. The code now seems more correct however. From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:14:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 124221065694; Fri, 8 Jan 2010 16:14:42 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00AAD8FC21; Fri, 8 Jan 2010 16:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08GEfa9022217; Fri, 8 Jan 2010 16:14:41 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08GEf6A022214; Fri, 8 Jan 2010 16:14:41 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001081614.o08GEf6A022214@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 8 Jan 2010 16:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201801 - in head: share/man/man4 sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:14:42 -0000 Author: ru Date: Fri Jan 8 16:14:41 2010 New Revision: 201801 URL: http://svn.freebsd.org/changeset/base/201801 Log: Complete the swap of carp(4) log levels and document the change. MFC after: 3 days Modified: head/share/man/man4/carp.4 head/sys/netinet/ip_carp.c Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Fri Jan 8 16:07:39 2010 (r201800) +++ head/share/man/man4/carp.4 Fri Jan 8 16:14:41 2010 (r201801) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2006 +.Dd January 5, 2010 .Dt CARP 4 .Os .Sh NAME @@ -118,12 +118,12 @@ See also the first example. Disabled by default. .It Va net.inet.carp.log Value of 0 disables any logging. -Value of 1 enables logging of bad -.Nm -packets. -Values above 1 enable logging state changes of +Value of 1 enables logging state changes of .Nm interfaces. +Values above 1 enable logging of bad +.Nm +packets. Default value is 1. .It Va net.inet.carp.arpbalance Balance local traffic using ARP (see below). Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Jan 8 16:07:39 2010 (r201800) +++ head/sys/netinet/ip_carp.c Fri Jan 8 16:14:41 2010 (r201801) @@ -560,7 +560,7 @@ carp_input(struct mbuf *m, int hlen) /* verify that the IP TTL is 255. */ if (ip->ip_ttl != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG("carp_input: received ttl %d != 255i on %s\n", + CARP_DEBUG("carp_input: received ttl %d != 255 on %s\n", ip->ip_ttl, m->m_pkthdr.rcvif->if_xname); m_freem(m); @@ -739,7 +739,7 @@ carp_input_c(struct mbuf *m, struct carp CARPSTATS_INC(carps_badauth); SC2IFP(sc)->if_ierrors++; CARP_UNLOCK(ifp->if_carp); - CARP_LOG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); + CARP_DEBUG("%s: incorrect hash\n", SC2IFP(sc)->if_xname); m_freem(m); return; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:28:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 983D3106566B; Fri, 8 Jan 2010 16:28:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85D768FC0A; Fri, 8 Jan 2010 16:28:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08GSH0x025287; Fri, 8 Jan 2010 16:28:17 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08GSHrR025285; Fri, 8 Jan 2010 16:28:17 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201001081628.o08GSHrR025285@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 8 Jan 2010 16:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201802 - stable/7/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:28:18 -0000 Author: jilles Date: Fri Jan 8 16:28:17 2010 New Revision: 201802 URL: http://svn.freebsd.org/changeset/base/201802 Log: MFC r201354: sh(1): Correct two places where "$@" lacked necessary quotes. Modified: stable/7/bin/sh/sh.1 Directory Properties: stable/7/bin/sh/ (props changed) Modified: stable/7/bin/sh/sh.1 ============================================================================== --- stable/7/bin/sh/sh.1 Fri Jan 8 16:14:41 2010 (r201801) +++ stable/7/bin/sh/sh.1 Fri Jan 8 16:28:17 2010 (r201802) @@ -856,7 +856,7 @@ command is: If .Ic in and the following words are omitted, -.Ic in Li $@ +.Ic in Li \&"$@\&" is used instead. The words are expanded, and then the list is executed repeatedly with the variable set to each word in turn. @@ -1071,7 +1071,7 @@ and is .Dq Li "def ghi" , then -.Dq Li $@ +.Li \&"$@\&" expands to the two arguments: .Bd -literal -offset indent From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:44:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4501E106566B; Fri, 8 Jan 2010 16:44:34 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32F208FC14; Fri, 8 Jan 2010 16:44:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08GiYgK028860; Fri, 8 Jan 2010 16:44:34 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08GiYLN028858; Fri, 8 Jan 2010 16:44:34 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081644.o08GiYLN028858@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 16:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201803 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:44:34 -0000 Author: trasz Date: Fri Jan 8 16:44:33 2010 New Revision: 201803 URL: http://svn.freebsd.org/changeset/base/201803 Log: Stop GCC from complaining about lagg_port_checkstacking() being unused. Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Jan 8 16:28:17 2010 (r201802) +++ head/sys/net/if_lagg.c Fri Jan 8 16:44:33 2010 (r201803) @@ -95,7 +95,9 @@ static int lagg_port_ioctl(struct ifnet static int lagg_port_output(struct ifnet *, struct mbuf *, struct sockaddr *, struct route *); static void lagg_port_ifdetach(void *arg __unused, struct ifnet *); +#ifdef LAGG_PORT_STACKING static int lagg_port_checkstacking(struct lagg_softc *); +#endif static void lagg_port2req(struct lagg_port *, struct lagg_reqport *); static void lagg_init(void *); static void lagg_stop(struct lagg_softc *); @@ -456,7 +458,8 @@ lagg_port_create(struct lagg_softc *sc, mtx_unlock(&lagg_list_mtx); free(lp, M_DEVBUF); return (EINVAL); - /* XXX disable stacking for the moment, its untested + /* XXX disable stacking for the moment, its untested */ +#ifdef LAGG_PORT_STACKING lp->lp_flags |= LAGG_PORT_STACK; if (lagg_port_checkstacking(sc_ptr) >= LAGG_MAX_STACKING) { @@ -464,7 +467,7 @@ lagg_port_create(struct lagg_softc *sc, free(lp, M_DEVBUF); return (E2BIG); } - */ +#endif } } mtx_unlock(&lagg_list_mtx); @@ -515,6 +518,7 @@ lagg_port_create(struct lagg_softc *sc, return (error); } +#ifdef LAGG_PORT_STACKING static int lagg_port_checkstacking(struct lagg_softc *sc) { @@ -533,6 +537,7 @@ lagg_port_checkstacking(struct lagg_soft return (m + 1); } +#endif static int lagg_port_destroy(struct lagg_port *lp, int runpd) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:45:32 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28AE11065676; Fri, 8 Jan 2010 16:45:32 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 94E5C8FC20; Fri, 8 Jan 2010 16:45:31 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o08GjUql062907; Fri, 8 Jan 2010 11:45:30 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o08GjUp1062906; Fri, 8 Jan 2010 11:45:30 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 8 Jan 2010 11:45:30 -0500 From: David Schultz To: Jaakko Heinonen Message-ID: <20100108164530.GA62775@zim.MIT.EDU> Mail-Followup-To: Jaakko Heinonen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <200912171703.nBHH3mEn041893@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912171703.nBHH3mEn041893@svn.freebsd.org> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r200633 - head/usr.bin/uniq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:45:32 -0000 On Thu, Dec 17, 2009, Jaakko Heinonen wrote: > Sync getline() with comm(1): > > - Prevent overflowing of the buffer length variable in getline() by > limiting its maximum value. > - Exit if reallocf(3) fails in getline(). Failure was silently > considered as end-of-file. We should consider using getline(3) from libc, rather than hand-rolled versions of almost the same thing that are copy-pasted in multiple places. The only catch is I need to check in the wide character version of getline() I've had sitting in my tree for months. I'll try to get on that this weekend. From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:56:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B59E51065693; Fri, 8 Jan 2010 16:56:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A46DC8FC13; Fri, 8 Jan 2010 16:56:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08GuBou031437; Fri, 8 Jan 2010 16:56:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08GuB2C031435; Fri, 8 Jan 2010 16:56:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001081656.o08GuB2C031435@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 8 Jan 2010 16:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201804 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:56:11 -0000 Author: bz Date: Fri Jan 8 16:56:11 2010 New Revision: 201804 URL: http://svn.freebsd.org/changeset/base/201804 Log: Unbreak the XEN build after r201751. Modified: head/sys/i386/xen/pmap.c Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Fri Jan 8 16:44:33 2010 (r201803) +++ head/sys/i386/xen/pmap.c Fri Jan 8 16:56:11 2010 (r201804) @@ -318,7 +318,9 @@ static __inline void pagezero(void *page #if defined(PAE) && !defined(XEN) static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); #endif +#ifndef XEN static void pmap_set_pg(void); +#endif CTASSERT(1 << PDESHIFT == sizeof(pd_entry_t)); CTASSERT(1 << PTESHIFT == sizeof(pt_entry_t)); @@ -550,6 +552,7 @@ pmap_init_pat(void) wrmsr(MSR_PAT, pat_msr); } +#ifndef XEN /* * Set PG_G on kernel pages. Only the BSP calls this when SMP is turned on. */ @@ -588,6 +591,7 @@ pmap_set_pg(void) } } } +#endif /* * Initialize a vm_page's machine-dependent fields. From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:56:29 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 787CA106566C; Fri, 8 Jan 2010 16:56:29 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 334B78FC15; Fri, 8 Jan 2010 16:56:28 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o08GuSjW062968; Fri, 8 Jan 2010 11:56:28 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o08GuRmL062967; Fri, 8 Jan 2010 11:56:27 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 8 Jan 2010 11:56:27 -0500 From: David Schultz To: "M. Warner Losh" Message-ID: <20100108165627.GB62775@zim.MIT.EDU> Mail-Followup-To: "M. Warner Losh" , brooks@freebsd.org, ume@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-rc@freebsd.org References: <4B2DD2A1.8060907@FreeBSD.org> <20091220183519.GB64667@lor.one-eyed-alien.net> <20091221.210850.220301508585541755.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091221.210850.220301508585541755.imp@bsdimp.com> Cc: brooks@FreeBSD.ORG, freebsd-rc@FreeBSD.ORG, ume@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, dougb@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r200743 - in head/usr.sbin: . service X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:56:29 -0000 On Mon, Dec 21, 2009, M. Warner Losh wrote: > In message: <20091220183519.GB64667@lor.one-eyed-alien.net> > Brooks Davis writes: > : This is where the value of service(8) would lie for me. The ability > : to not have things work by accident due to my environment and then break > : at reboot would be be very helful. > > I'd love to have some way to say 'If the daemon dies, please restart > it. But don't be so eager about it that your attempts to keep it > running interfere with things like service' The service management stuff introduced in Solaris 10 has this capability, as well as some other nice bits of sophistication. For instance, when a service is restarted, it will automatically restart any services whose operation depends on that service. Anyone working on services might want to peruse their svcs(1) and smf(5) for ideas. From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 16:59:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AD1D1065676; Fri, 8 Jan 2010 16:59:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88E798FC18; Fri, 8 Jan 2010 16:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08GxSJG032232; Fri, 8 Jan 2010 16:59:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08GxS5O032229; Fri, 8 Jan 2010 16:59:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001081659.o08GxS5O032229@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 8 Jan 2010 16:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201806 - head/usr.sbin/traceroute X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 16:59:28 -0000 Author: bz Date: Fri Jan 8 16:59:28 2010 New Revision: 201806 URL: http://svn.freebsd.org/changeset/base/201806 Log: Switch traceroute over to make use of proper in-kernel source address selection. Reviewed by: rwatson, fenner MFC after: 1 week X-MFCable to: stable/8, stable/7 (after r183571). PR: kern/139454 Tested by: Frank Steinborn (steinex nognu.de) Added: head/usr.sbin/traceroute/findsaddr-udp.c (contents, props changed) Modified: head/usr.sbin/traceroute/Makefile Modified: head/usr.sbin/traceroute/Makefile ============================================================================== --- head/usr.sbin/traceroute/Makefile Fri Jan 8 16:58:37 2010 (r201805) +++ head/usr.sbin/traceroute/Makefile Fri Jan 8 16:59:28 2010 (r201806) @@ -5,7 +5,7 @@ TRACEROUTE_DISTDIR?= ${.CURDIR}/../../co PROG= traceroute MAN= traceroute.8 -SRCS= as.c version.c traceroute.c ifaddrlist.c findsaddr-socket.c +SRCS= as.c version.c traceroute.c ifaddrlist.c findsaddr-udp.c BINOWN= root BINMODE=4555 CLEANFILES= version.c @@ -29,7 +29,7 @@ DPADD= ${LIBIPSEC} LDADD= -lipsec .endif -CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl +CFLAGS+= -I${TRACEROUTE_DISTDIR}/lbl -I${TRACEROUTE_DISTDIR} WARNS?= 0 Added: head/usr.sbin/traceroute/findsaddr-udp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/traceroute/findsaddr-udp.c Fri Jan 8 16:59:28 2010 (r201806) @@ -0,0 +1,94 @@ +/*- + * Copyright (c) 2010 Bjoern A. Zeeb + * 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 +#include + +#include +#include + +#include + +#include "findsaddr.h" +#include "traceroute.h" + +/* + * Return the source address for the given destination address. + * + * This makes use of proper source address seclection in the FreeBSD kernel + * even taking jails into account (sys/netinet/in_pcb.c:in_pcbladdr()). + * We open a UDP socket, and connect to the destination, letting the kernel + * do the bind and then read the source IPv4 address using getsockname(2). + * This has multiple advantages: no need to do PF_ROUTE operations possibly + * needing special privileges, jails properly taken into account and most + * important - getting the result the kernel would give us rather than + * best-guessing ourselves. + */ +const char * +findsaddr(register const struct sockaddr_in *to, + register struct sockaddr_in *from) +{ + const char *errstr; + struct sockaddr_in cto, cfrom; + int s; + socklen_t len; + + s = socket(AF_INET, SOCK_DGRAM, 0); + if (s == -1) + return ("failed to open DGRAM socket for src addr selection."); + + errstr = NULL; + len = sizeof(struct sockaddr_in); + memcpy(&cto, to, len); + cto.sin_port = htons(65535); /* Dummy port for connect(2). */ + if (connect(s, (struct sockaddr *)&cto, len) == -1) { + errstr = "failed to connect to peer for src addr selection."; + goto err; + } + + if (getsockname(s, (struct sockaddr *)&cfrom, &len) == -1) { + errstr = "failed to get socket name for src addr selection."; + goto err; + } + + if (len != sizeof(struct sockaddr_in) || cfrom.sin_family != AF_INET) { + errstr = "unexpected address family in src addr selection."; + goto err; + } + + /* Update source address for traceroute. */ + setsin(from, cfrom.sin_addr.s_addr); + +err: + (void) close(s); + + /* No error (string) to return. */ + return (errstr); +} + +/* end */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 17:08:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 258A81065694; Fri, 8 Jan 2010 17:08:42 +0000 (UTC) (envelope-from etnapierala@googlemail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 32DB08FC12; Fri, 8 Jan 2010 17:08:40 +0000 (UTC) Received: by fxm27 with SMTP id 27so4881596fxm.3 for ; Fri, 08 Jan 2010 09:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=xc8WOQqwh+N47PPjwZhbLKcqLKaS1t4N2hr92+4yXQ4=; b=xbrRWmrlnUoE8pnJtoYdd4qgm9ksWB9UOpeZCtcDey/TW2dsC6aZ9UmXYA9QY9xvG3 wTl5kxbM7IEFKSZUR7ODsMWShjzVZHkPx7iTtWjzC8ZpaDpG7bs/I/m9PwJKeZG6qLLg sxwXWWYRfi+xTA6LWZvUOAHcaFGCE6SoLYaMI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=nvQ11tnC9NTyXh05BER0zJZQa3ilDWrBa9y6ptJJgMnfs1UES1HGhZWIAOh0VtAXd3 AVbsjw3jDANUrkiBM/NvH/vOcP+Evd0+TP98YCmfXchP2672R8XZAwRSzHzqib8RLlDl YYxQeO4j5nKP3iFYKy9LE6W8qY2ihBFg65OI8= Received: by 10.86.239.21 with SMTP id m21mr9030982fgh.27.1262968906890; Fri, 08 Jan 2010 08:41:46 -0800 (PST) Received: from ?192.168.1.100? (45.81.datacomsa.pl [195.34.81.45]) by mx.google.com with ESMTPS id d4sm49359889fga.21.2010.01.08.08.41.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Jan 2010 08:41:46 -0800 (PST) Sender: =?UTF-8?Q?Edward_Napiera=C5=82a?= Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=iso-8859-2 From: =?iso-8859-2?Q?Edward_Tomasz_Napiera=B3a?= In-Reply-To: <20100108161210.GC1610@mole.fafoe.narf.at> Date: Fri, 8 Jan 2010 17:41:42 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201001081544.o08FinVh015359@svn.freebsd.org> <20100108161210.GC1610@mole.fafoe.narf.at> To: Stefan Farfeleder X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 17:08:42 -0000 Wiadomo=B6=E6 napisana przez Stefan Farfeleder w dniu 2010-01-08, o = godz. 17:12: > On Fri, Jan 08, 2010 at 03:44:49PM +0000, Edward Tomasz Napierala = wrote: >> Author: trasz >> Date: Fri Jan 8 15:44:49 2010 >> New Revision: 201794 >> URL: http://svn.freebsd.org/changeset/base/201794 >>=20 >> Log: >> Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in = order >> to silence newer GCC versions. >=20 > They are not identical, !a & b is parsed as (!a) & b. The code now > seems more correct however. Looks like I've got the operator precedence backwards there - I assumed there was no functional change involved. But yes, the code now looks = more correct - logical 'and' of a constant with the truth value is pointless. -- If you cut off my head, what would I say? Me and my head, or me and my = body? From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 17:20:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36F1E1065676; Fri, 8 Jan 2010 17:20:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2571E8FC18; Fri, 8 Jan 2010 17:20:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08HKgQT038622; Fri, 8 Jan 2010 17:20:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08HKgSg038619; Fri, 8 Jan 2010 17:20:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081720.o08HKgSg038619@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 17:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201807 - head/sys/dev/dpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 17:20:42 -0000 Author: trasz Date: Fri Jan 8 17:20:41 2010 New Revision: 201807 URL: http://svn.freebsd.org/changeset/base/201807 Log: Get rid of #ident, GCC 4.4 warns about it being deprecated. OK-ed by: scottl Modified: head/sys/dev/dpt/dpt.h head/sys/dev/dpt/dpt_scsi.c Modified: head/sys/dev/dpt/dpt.h ============================================================================== --- head/sys/dev/dpt/dpt.h Fri Jan 8 16:59:28 2010 (r201806) +++ head/sys/dev/dpt/dpt.h Fri Jan 8 17:20:41 2010 (r201807) @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ /* @@ -39,9 +40,6 @@ * FreeBSD.ORG; Great O/S to work on and for. */ - -#ident "$FreeBSD$" - #ifndef _DPT_H #define _DPT_H Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Fri Jan 8 16:59:28 2010 (r201806) +++ head/sys/dev/dpt/dpt_scsi.c Fri Jan 8 17:20:41 2010 (r201807) @@ -27,7 +27,6 @@ * SUCH DAMAGE. */ -#ident "$FreeBSD$" #include __FBSDID("$FreeBSD$"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 17:38:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD093106568F; Fri, 8 Jan 2010 17:38:40 +0000 (UTC) (envelope-from alc@cs.rice.edu) Received: from mail.cs.rice.edu (mail.cs.rice.edu [128.42.1.31]) by mx1.freebsd.org (Postfix) with ESMTP id B19018FC14; Fri, 8 Jan 2010 17:38:40 +0000 (UTC) Received: from mail.cs.rice.edu (localhost.localdomain [127.0.0.1]) by mail.cs.rice.edu (Postfix) with ESMTP id 3592C2C2DB3; Fri, 8 Jan 2010 11:38:40 -0600 (CST) X-Virus-Scanned: by amavis-2.4.0 at mail.cs.rice.edu Received: from mail.cs.rice.edu ([127.0.0.1]) by mail.cs.rice.edu (mail.cs.rice.edu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id YSGG6mzMo6dW; Fri, 8 Jan 2010 11:38:32 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.cs.rice.edu (Postfix) with ESMTP id 404532C2D3F; Fri, 8 Jan 2010 11:38:32 -0600 (CST) Message-ID: <4B476D97.2050009@cs.rice.edu> Date: Fri, 08 Jan 2010 11:38:31 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.23 (X11/20100102) MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201001081656.o08GuB2C031435@svn.freebsd.org> In-Reply-To: <201001081656.o08GuB2C031435@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201804 - head/sys/i386/xen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 17:38:41 -0000 Bjoern A. Zeeb wrote: > Author: bz > Date: Fri Jan 8 16:56:11 2010 > New Revision: 201804 > URL: http://svn.freebsd.org/changeset/base/201804 > > Log: > Unbreak the XEN build after r201751. > Thanks for fixing this. Alan From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 17:47:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 307671065759; Fri, 8 Jan 2010 17:47:38 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC088FC2A; Fri, 8 Jan 2010 17:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08HlcgX046363; Fri, 8 Jan 2010 17:47:38 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08HlckB046361; Fri, 8 Jan 2010 17:47:38 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001081747.o08HlckB046361@svn.freebsd.org> From: Christian Brueffer Date: Fri, 8 Jan 2010 17:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201810 - head/release/doc/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 17:47:38 -0000 Author: brueffer Date: Fri Jan 8 17:47:37 2010 New Revision: 201810 URL: http://svn.freebsd.org/changeset/base/201810 Log: Remove ste(4), it should work on all architectures now. Modified: head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Fri Jan 8 17:46:27 2010 (r201809) +++ head/release/doc/share/misc/dev.archlist.txt Fri Jan 8 17:47:37 2010 (r201810) @@ -139,7 +139,6 @@ snd_t4dwave i386,amd64 snd_via8233 i386,amd64 snd_via82c686 i386,amd64 snd_vibes i386,amd64 -ste i386,pc98,amd64 stg i386,pc98 stge i386,amd64,sparc64 ti i386,pc98,amd64,sparc64 From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 17:49:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8D9E1065672; Fri, 8 Jan 2010 17:49:24 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7C2A8FC16; Fri, 8 Jan 2010 17:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08HnO10046800; Fri, 8 Jan 2010 17:49:24 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08HnONs046798; Fri, 8 Jan 2010 17:49:24 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201001081749.o08HnONs046798@svn.freebsd.org> From: Qing Li Date: Fri, 8 Jan 2010 17:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201811 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 17:49:25 -0000 Author: qingli Date: Fri Jan 8 17:49:24 2010 New Revision: 201811 URL: http://svn.freebsd.org/changeset/base/201811 Log: Ensure an address is removed from the interface address list when the installation of that address fails. PR: 139559 Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Fri Jan 8 17:47:37 2010 (r201810) +++ head/sys/netinet/in.c Fri Jan 8 17:49:24 2010 (r201811) @@ -562,7 +562,7 @@ in_control(struct socket *so, u_long cmd (hostIsNew || maskIsNew)) error = in_ifinit(ifp, ia, &ifra->ifra_addr, 0); if (error != 0 && iaIsNew) - goto out; + break; if ((ifp->if_flags & IFF_BROADCAST) && (ifra->ifra_broadaddr.sin_family == AF_INET)) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 18:43:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C126106566C for ; Fri, 8 Jan 2010 18:43:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 31BB38FC15 for ; Fri, 8 Jan 2010 18:43:11 +0000 (UTC) Received: (qmail 2953 invoked by uid 399); 8 Jan 2010 18:43:11 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 8 Jan 2010 18:43:11 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B477CBE.6090000@FreeBSD.org> Date: Fri, 08 Jan 2010 10:43:10 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: "Carlos A. M. dos Santos" References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 18:43:12 -0000 Carlos A. M. dos Santos wrote: > 2010/1/8 Doug Barton : >> Dag-Erling Smørgrav wrote: >>> I don't see how the Rumsfeld quote could offend anyone. >> A) Better safe than sorry >> B) Regardless of my own opinions I can easily see how someone could be >> offended by anything having to do with Rumsfeld, the Iraq war, etc. > > Perhaps, at the moment. Which is where we are now, yes. > Five to ten years from now that quotation will > be just history, like the ones from/about JFK, Richard Nixon, and > Spiro Agnew. Actually there are several things in the main fortunes file that I find offensive related to political stuff of the 60's and 70's (although not for the reasons that I think most people would find them offensive). Note, I am not however suggesting that we do a wholesale move of potentially offensive stuff. > Are you whiling to apply such rule to all supposedly > political fortunes? My very first post on this was, "Anything that may offend someone belongs in fortunes-o, and all political commentary belongs in this category." FWIW, while I am definitely in favor of treating all people with courtesy and respect, I am just about as anti-mindless-political-correctness as you can possibly be. In fact, in both my .bashrc and my xscreensaver config I use fortune -a because as much as some of the things in there offend me, I find it refreshing to be challenged by other viewpoints. OTOH, I am also in favor of us building a professional-quality operating system, and while I actually _voiced_ my objection to the removal of "die_you_gravy_sucking_pig_dog" because that is not something that is user-visible, I think that if we SAY there is a distinction between fortunes and fortunes-o that we ought to follow through on that. Putting something that we know could (and almost certainly will) be found offensive in the fortunes file because WE are smarter and more sophisticated than those fools who would be offended by it is childish, foolish, and unprofessional. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 18:57:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDDD106568F; Fri, 8 Jan 2010 18:57:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 186588FC0C; Fri, 8 Jan 2010 18:57:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08IvVoO061893; Fri, 8 Jan 2010 18:57:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08IvVtn061885; Fri, 8 Jan 2010 18:57:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001081857.o08IvVtn061885@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 8 Jan 2010 18:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201813 - in head/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 18:57:32 -0000 Author: bz Date: Fri Jan 8 18:57:31 2010 New Revision: 201813 URL: http://svn.freebsd.org/changeset/base/201813 Log: In sys//conf/Makefile set TARGET to . That allows sys/conf/makeLINT.mk to only do certain things for certain architectures. Note that neither arm nor mips have the Makefile there, thus essentially not (yet) supporting LINT. This would enable them do add special treatment to sys/conf/makeLINT.mk as well chosing one of the many configurations as LINT. This is a hack of doing this and keeping it in a separate commit will allow us to more easily identify and back it out. Discussed on/with: arch, jhb (as part of the LINT-VIMAGE thread) MFC after: 1 month Modified: head/sys/amd64/conf/Makefile head/sys/i386/conf/Makefile head/sys/ia64/conf/Makefile head/sys/pc98/conf/Makefile head/sys/powerpc/conf/Makefile head/sys/sparc64/conf/Makefile head/sys/sun4v/conf/Makefile Modified: head/sys/amd64/conf/Makefile ============================================================================== --- head/sys/amd64/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/amd64/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=amd64 + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/i386/conf/Makefile ============================================================================== --- head/sys/i386/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/i386/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=i386 + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/ia64/conf/Makefile ============================================================================== --- head/sys/ia64/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/ia64/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=ia64 + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/pc98/conf/Makefile ============================================================================== --- head/sys/pc98/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/pc98/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=pc98 + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/powerpc/conf/Makefile ============================================================================== --- head/sys/powerpc/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/powerpc/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=powerpc + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/sparc64/conf/Makefile ============================================================================== --- head/sys/sparc64/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/sparc64/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=sparc64 + .include "${.CURDIR}/../../conf/makeLINT.mk" Modified: head/sys/sun4v/conf/Makefile ============================================================================== --- head/sys/sun4v/conf/Makefile Fri Jan 8 18:29:04 2010 (r201812) +++ head/sys/sun4v/conf/Makefile Fri Jan 8 18:57:31 2010 (r201813) @@ -1,3 +1,5 @@ # $FreeBSD$ +TARGET=sun4v + .include "${.CURDIR}/../../conf/makeLINT.mk" From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 19:00:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96C641065692; Fri, 8 Jan 2010 19:00:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 863758FC21; Fri, 8 Jan 2010 19:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08J0KlW062546; Fri, 8 Jan 2010 19:00:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08J0Kb7062544; Fri, 8 Jan 2010 19:00:20 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001081900.o08J0Kb7062544@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 8 Jan 2010 19:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201814 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 19:00:20 -0000 Author: bz Date: Fri Jan 8 19:00:20 2010 New Revision: 201814 URL: http://svn.freebsd.org/changeset/base/201814 Log: Generate a second LINT configuration for i386 and amd64 in sys/conf/makeLINT.mk, which includes LINT and sets options VIMAGE so that we will have VIMAGE LINT builds[1]. For now only do it for those two architectures to avoid massive universe times for archs, where people will less likely use VIMAGE or not at all. Requested by: jhb [1] Discussed on/with: arch, jhb, rwatson MFC after: 1 month Modified: head/sys/conf/makeLINT.mk Modified: head/sys/conf/makeLINT.mk ============================================================================== --- head/sys/conf/makeLINT.mk Fri Jan 8 18:57:31 2010 (r201813) +++ head/sys/conf/makeLINT.mk Fri Jan 8 19:00:20 2010 (r201814) @@ -5,7 +5,15 @@ all: clean: rm -f LINT +.if ${TARGET} == "amd64" || ${TARGET} == "i386" + rm -f LINT-VIMAGE +.endif NOTES= ../../conf/NOTES NOTES LINT: ${NOTES} ../../conf/makeLINT.sed cat ${NOTES} | sed -E -n -f ../../conf/makeLINT.sed > ${.TARGET} +.if ${TARGET} == "amd64" || ${TARGET} == "i386" + echo "include ${.TARGET}" > ${.TARGET}-VIMAGE + echo "ident ${.TARGET}-VIMAGE" >> ${.TARGET}-VIMAGE + echo "options VIMAGE" >> ${.TARGET}-VIMAGE +.endif From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 19:01:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 437561065670; Fri, 8 Jan 2010 19:01:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32E918FC12; Fri, 8 Jan 2010 19:01:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08J1pBW062911; Fri, 8 Jan 2010 19:01:51 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08J1pjc062909; Fri, 8 Jan 2010 19:01:51 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001081901.o08J1pjc062909@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 8 Jan 2010 19:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201815 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 19:01:51 -0000 Author: bz Date: Fri Jan 8 19:01:50 2010 New Revision: 201815 URL: http://svn.freebsd.org/changeset/base/201815 Log: To avoid hardcoding further kernel configuration names for make universe, split the logic into two parts: - 1st to build worlds and generate kernel configs like LINT. - 2nd to build kernels for a given TARGET architecture correctly finding all newly generated configs, not knowing anything about LINT anymore. (*) (*) If you know better/cleaner/... ways to do this, let me know. Discussed on/with: arch, jhb, rwatson MFC after: 1 month Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Fri Jan 8 19:00:20 2010 (r201814) +++ head/Makefile Fri Jan 8 19:01:50 2010 (r201815) @@ -278,7 +278,7 @@ tinderbox: # with a reasonable chance of success, regardless of how old your # existing system is. # -.if make(universe) || make(tinderbox) +.if make(universe) || make(universe_kernels) || make(tinderbox) TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v .if defined(DOING_TINDERBOX) @@ -297,10 +297,6 @@ universe_prologue: rm -f ${FAILFILE} .endif .for target in ${TARGETS} -KERNCONFS!= cd ${.CURDIR}/sys/${target}/conf && \ - find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ - ! -name DEFAULTS ! -name LINT -KERNCONFS:= ${KERNCONFS:S/^NOTES$/LINT/} universe: universe_${target} .ORDER: universe_prologue universe_${target} universe_epilogue universe_${target}: @@ -320,16 +316,25 @@ universe_${target}: (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif + @cd ${.CURDIR} && ${MAKE} ${.MAKEFLAGS} TARGET=${target} \ + universe_kernels + @echo ">> ${target} completed on `LC_ALL=C date`" +.endfor +universe_kernels: universe_kernconfs +BUILD_ARCH!= uname -p +TARGET?= ${BUILD_ARCH} +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ + ! -name DEFAULTS ! -name NOTES +universe_kernconfs: .for kernel in ${KERNCONFS} @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${MAKE} ${JFLAG} buildkernel \ - TARGET=${target} \ + TARGET=${TARGET} \ KERNCONF=${kernel} \ - > _.${target}.${kernel} 2>&1 || \ - (echo "${target} ${kernel} kernel failed," \ - "check _.${target}.${kernel} for details"| ${MAKEFAIL})) -.endfor - @echo ">> ${target} completed on `LC_ALL=C date`" + > _.${TARGET}.${kernel} 2>&1 || \ + (echo "${TARGET} ${kernel} kernel failed," \ + "check _.${TARGET}.${kernel} for details"| ${MAKEFAIL})) .endfor universe: universe_epilogue universe_epilogue: From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 19:33:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDA93106566C; Fri, 8 Jan 2010 19:33:48 +0000 (UTC) (envelope-from marc@msys.ch) Received: from sleipnir.msys.ch (unknown [IPv6:2001:4060:c0de:f000::3]) by mx1.freebsd.org (Postfix) with ESMTP id 5110A8FC13; Fri, 8 Jan 2010 19:33:47 +0000 (UTC) Received: from mail.msys.ch (smtp.msys.ch [157.161.101.10]) by sleipnir.msys.ch (8.14.3/8.14.1) with ESMTP id o08JXfZE003370 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 8 Jan 2010 20:33:41 +0100 (CET) Received: from [10.0.1.3] (gw.vnode.ch [62.12.170.129]) (authenticated bits=0) by mail.msys.ch (8.14.3/8.14.1) with ESMTP id o08JXdag005915 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 8 Jan 2010 20:33:40 +0100 (CET) Message-Id: <0F2B2EB1-C91F-459D-BE93-A81B7FF4173C@msys.ch> From: Marc Balmer To: Doug Barton In-Reply-To: <4B477CBE.6090000@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Date: Fri, 8 Jan 2010 20:33:39 +0100 References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> <4B477CBE.6090000@FreeBSD.org> X-Mailer: Apple Mail (2.936) X-SMTP-Vilter-Version: 1.3.6 X-Spamd-Symbols: AWL,FH_DATE_PAST_20XX Cc: "Carlos A. M. dos Santos" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 19:33:49 -0000 Am 08.01.2010 um 19:43 schrieb Doug Barton: > Carlos A. M. dos Santos wrote: >> 2010/1/8 Doug Barton : >>> Dag-Erling Sm=F8rgrav wrote: >>>> I don't see how the Rumsfeld quote could offend anyone. >>> A) Better safe than sorry >>> B) Regardless of my own opinions I can easily see how someone =20 >>> could be >>> offended by anything having to do with Rumsfeld, the Iraq war, etc. >> >> Perhaps, at the moment. > > Which is where we are now, yes. > >> Five to ten years from now that quotation will >> be just history, like the ones from/about JFK, Richard Nixon, and >> Spiro Agnew. > > Actually there are several things in the main fortunes file that I > find offensive related to political stuff of the 60's and 70's > (although not for the reasons that I think most people would find them > offensive). Note, I am not however suggesting that we do a wholesale > move of potentially offensive stuff. > >> Are you whiling to apply such rule to all supposedly >> political fortunes? > > My very first post on this was, "Anything that may offend someone > belongs in fortunes-o, and all political commentary belongs in this > category." > > FWIW, while I am definitely in favor of treating all people with > courtesy and respect, I am just about as > anti-mindless-political-correctness as you can possibly be. In fact, > in both my .bashrc and my xscreensaver config I use fortune -a because > as much as some of the things in there offend me, I find it refreshing > to be challenged by other viewpoints. OTOH, I am also in favor of us > building a professional-quality operating system, and while I actually > _voiced_ my objection to the removal of > "die_you_gravy_sucking_pig_dog" because that is not something that is > user-visible, I think that if we SAY there is a distinction between > fortunes and fortunes-o that we ought to follow through on that. > Putting something that we know could (and almost certainly will) be > found offensive in the fortunes file because WE are smarter and more > sophisticated than those fools who would be offended by it is > childish, foolish, and unprofessional. > Actually I think -o should be the default for fortune. I think it =20 would be funnier. There should of course be an option like maybe -f ("faint at heart" or =20= so) for people without a sense or humour or who are easily offended by =20= a good joke.... -mb From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 19:46:11 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C446B106566B; Fri, 8 Jan 2010 19:46:11 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 42AAC8FC12; Fri, 8 Jan 2010 19:46:10 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o08Jk7Aa006987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Jan 2010 06:46:08 +1100 Date: Sat, 9 Jan 2010 06:46:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Jaakko Heinonen In-Reply-To: <201001080757.o087vhrr009799@svn.freebsd.org> Message-ID: <20100109051536.R57595@delplex.bde.org> References: <201001080757.o087vhrr009799@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201773 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 19:46:11 -0000 On Fri, 8 Jan 2010, Jaakko Heinonen wrote: > Author: jh > Date: Fri Jan 8 07:57:43 2010 > New Revision: 201773 > URL: http://svn.freebsd.org/changeset/base/201773 > > Log: > - Change the type of size_max to u_quad_t because its value is converted > with vfs_scanopt(9) using the "%qu" format string. %qu should never be used, since there are no correct uses of u_quad_t. However, there seems to be nothing much better, due to API design and implementation bugs. (%lu and u_long would work, but is a bit fragile. I thought at first that size_max was a page count, so that it should have type u_int like all page counts in vm, and thus easily scanned using %u.) > - Limit the maximum value of size_max to (SIZE_MAX - PAGE_SIZE) to > prevent overflow in howmany() macro. Overflow still occurs, since `pages' remains "infinite" when howmany() would overflow. > Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c > ============================================================================== > --- head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Jan 8 07:42:01 2010 (r201772) > +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Fri Jan 8 07:57:43 2010 (r201773) > @@ -185,8 +185,8 @@ tmpfs_mount(struct mount *mp) > ino_t nodes; > int error; > /* Size counters. */ > - ino_t nodes_max; Indentation error in old version. Local variables are not indented in KNF. The local variables before here are normally indented. > - size_t size_max; Indentation error, as above. > + ino_t nodes_max; Even larger indentation error in new version. Now the variable name doesn't even line up with the other 1-fold-excessively indented variables. There are also many type errors associated with this variable. ino_t is a reasonable type for a limit on the number of inodes (unless you want to support inodes numbered 0 to the maximum -- then you need a larger type to hold the maximum plus 1), but there is no scanf letter for ino_t and thus no correct way to scan an ino_t in vfs_scanopt(). The current incorrect way is to use %d. Since ino_t happens to have type uint32_t and u_int happens to have type uint32_t on all supported machines, %u would work but %d gives undefined behaviour when the value exceeds INT_MAX. The simplest fix is to use u_int and %u. > + u_quad_t size_max; Even larger indentation error, as above. The technically correct type to use here is vm_size_t, but this cannot be used either since it cannot be scanned, as for ino_t. vm types and size_t are also more machine-dependent than ino_t, so u_int would not work here. There is a scanf letter for size_t in scanf(3); however, this is not supported by scanf(9) (only printf(9) supports the C99 letters). scanf(9) does support u_quad_t, though this depends on undefined or implementation-defined behaviour when the value exceeds QUAD_MAX. scanf also doesn't support the most general type and easist to use correctly type that could be used here -- uintmax_t. Most uses of u_quad_t and %qu are for when the user really wants the largest integral type but hasn't caught up with C99. The bugs in scanf(9) should be fixed by removing scanf(9) from the kernel and only using strto*() and something special for string scanning in the couple of places it is needed. It is unfortunately too late to remove scanf(3). scanf is unusable for almost all purposes since it gives undefined behaviour on overflow, unlike strto*(). kenv and its uses have similar type problems, but at least it doesn't use scanf. It hasn't caught up with C99 either, and uses the quad mistake via strtoq() for all numeric input, with null error handling to get implementation-defined instead of undefined behaviour on overflow (large values get truncated to QUAD_MAX, which is even less than ULONG_MAX on 64-bit machines). > > /* Root node attributes. */ > uid_t root_uid; This and the remaining loal variables have typedefed types, so they too cannot be scanned correctly. > @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) > * allowed to use, based on the maximum size the user passed in > * the mount structure. A value of zero is treated as if the > * maximum available space was requested. */ The comment doesn't match the code. Values between 1 and PAGE_SIZE-1 are also treated as if the maximum available space were requested. The comment is not formatted in KNF (leading and trailing delimiters). > - if (size_max < PAGE_SIZE || size_max >= SIZE_MAX) > + if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) Style bug: extra (). > pages = SIZE_MAX; This is the "infinite" setting of `pages' > else > pages = howmany(size_max, PAGE_SIZE); > Page counts are normally divided by PAGE_SIZE like they are here, so they are far from infinite. tmpfs consistently uses the bogus type size_t for page counts. This at least allows it to represent the above "infinite" value. But using this value risks overflow. Overflow first occurs a few lines later: % if (nodes_max <= 3) % nodes = 3 + pages * PAGE_SIZE / 1024; ^^^^^^^^^^^^^^^^^ % else % nodes = nodes_max; Elsewhere, `pages' seems to only be used as a limit, so overflow doesn't occur but the limit has no effect, unlike the limit given by a size_max of SIZE_MAX - PAGE_SIZE. However, this limit probably has no effect either, since it is impossible to use use all pages except 1 in an address space for tmpfs on any supported machine. Apart from overflow problems, SIZE_MAX is a better limit on the number of pages than howmany(SIZE_MAX - PAGE_SIZE, PAGE_SIZE), since there might be more pages than can be mapped. vm already supports this (for PAE). It uses u_int for all page counts and APIs (struct vmmeter and too many sysctls). This barely works for PAE, since 2^32 pages is 4096 times as many as can be mapped and no one can afford that many and/or PAE hardware is limited to that many. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 19:56:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A83971065670; Fri, 8 Jan 2010 19:56:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 976968FC0A; Fri, 8 Jan 2010 19:56:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08JubwS075265; Fri, 8 Jan 2010 19:56:37 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Jubn9075263; Fri, 8 Jan 2010 19:56:37 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001081956.o08Jubn9075263@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 19:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201818 - head/sys/contrib/ngatm/netnatm/api X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 19:56:37 -0000 Author: trasz Date: Fri Jan 8 19:56:37 2010 New Revision: 201818 URL: http://svn.freebsd.org/changeset/base/201818 Log: Fix array overflow. Reviewed by: philip Modified: head/sys/contrib/ngatm/netnatm/api/cc_conn.c Modified: head/sys/contrib/ngatm/netnatm/api/cc_conn.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/api/cc_conn.c Fri Jan 8 19:40:29 2010 (r201817) +++ head/sys/contrib/ngatm/netnatm/api/cc_conn.c Fri Jan 8 19:56:37 2010 (r201818) @@ -768,7 +768,7 @@ cc_party_drop_ack_ind(struct ccconn *con party = cc_party_find(conn, drop->epref.epref); if (party == NULL) { cc_party_log(party, "no party for %s", - ptab[CONN_SIG_DROP_PARTY_ACK_IND]); + cc_conn_sigtab[CONN_SIG_DROP_PARTY_ACK_IND]); return; } switch (party->state) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:25:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD6591065670; Fri, 8 Jan 2010 20:25:20 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184]) by mx1.freebsd.org (Postfix) with ESMTP id 8D0328FC1D; Fri, 8 Jan 2010 20:25:20 +0000 (UTC) Received: from cpc1-cdif1-0-0-cust63.cdif.cable.ntl.com ([81.104.164.64] helo=shrike.submonkey.net) by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NTKtI-0006lR-Dn; Fri, 08 Jan 2010 19:53:00 +0000 Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1NTKtF-000L6x-Rz; Fri, 08 Jan 2010 19:52:57 +0000 Date: Fri, 8 Jan 2010 19:52:57 +0000 From: Ceri Davies To: Doug Barton Message-ID: <20100108195257.GB29586@submonkey.net> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> <4B477CBE.6090000@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BXVAT5kNtrzKuDFl" Content-Disposition: inline In-Reply-To: <4B477CBE.6090000@FreeBSD.org> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.20 (2009-06-14) Sender: Ceri Davies Cc: "Carlos A. M. dos Santos" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:25:20 -0000 --BXVAT5kNtrzKuDFl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 08, 2010 at 10:43:10AM -0800, Doug Barton wrote: > FWIW, while I am definitely in favor of treating all people with > courtesy and respect, I am just about as > anti-mindless-political-correctness as you can possibly be. *feels tickle in brain-stem*... *clickety-click*... Ah, yes. If any proof of this were needed, I can supply the appropriate Message-ID headers :) Ceri --=20 That must be wonderful! I don't understand it at all. -- Moliere --BXVAT5kNtrzKuDFl Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iD8DBQFLR40ZocfcwTS3JF8RAsbqAJ9jHjaZX2z4BZQrzD5Jzi1iu9NqAACfce3W y5eViIp5+rPBNhCZXFa38Cc= =0i/3 -----END PGP SIGNATURE----- --BXVAT5kNtrzKuDFl-- From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:25:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D906C106566B; Fri, 8 Jan 2010 20:25:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C66BA8FC14; Fri, 8 Jan 2010 20:25:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08KPxYo081972; Fri, 8 Jan 2010 20:25:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08KPxp8081967; Fri, 8 Jan 2010 20:25:59 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201001082025.o08KPxp8081967@svn.freebsd.org> From: Rick Macklem Date: Fri, 8 Jan 2010 20:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201819 - in stable/8/sys/fs: nfs nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:26:00 -0000 Author: rmacklem Date: Fri Jan 8 20:25:59 2010 New Revision: 201819 URL: http://svn.freebsd.org/changeset/base/201819 Log: MFC: r200999 Modify the experimental server so that it uses VOP_ACCESSX(). This is necessary in order to enable NFSv4 ACL support. The argument to nfsvno_accchk() was changed to an accmode_t and the function nfsrv_aclaccess() was no longer needed and, therefore, deleted. Reviewed by: trasz Modified: stable/8/sys/fs/nfs/nfs_commonacl.c stable/8/sys/fs/nfs/nfs_var.h stable/8/sys/fs/nfsserver/nfs_nfsdport.c stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonacl.c Fri Jan 8 19:56:37 2010 (r201818) +++ stable/8/sys/fs/nfs/nfs_commonacl.c Fri Jan 8 20:25:59 2010 (r201819) @@ -620,70 +620,6 @@ nfsrv_buildacl(struct nfsrv_descript *nd } /* - * Check access for an NFSv4 acl. - * The vflags are the basic VREAD, VWRITE, VEXEC. The mask is the NFSV4ACE - * mask bits for the more detailed check. - * If the more detailed check fails, due to no acl, do a basic one. - */ -APPLESTATIC int -nfsrv_aclaccess(vnode_t vp, accmode_t vflags, u_int32_t mask, - struct ucred *cred, NFSPROC_T *p) -{ - int error = 0; - accmode_t access; - - if (nfsrv_useacl == 0) { - error = VOP_ACCESS(vp, vflags, cred, p); - return (error); - } - - /* Convert NFSV4ACE mask to vaccess_t */ - access = 0; - if (mask & NFSV4ACE_READDATA) - access |= VREAD; - if (mask & NFSV4ACE_LISTDIRECTORY) - access |= VREAD; - if (mask & NFSV4ACE_WRITEDATA) - access |= VWRITE; - if (mask & NFSV4ACE_ADDFILE) - access |= VWRITE; - if (mask & NFSV4ACE_APPENDDATA) - access |= VAPPEND; - if (mask & NFSV4ACE_ADDSUBDIRECTORY) - access |= VAPPEND; - if (mask & NFSV4ACE_READNAMEDATTR) - access |= VREAD_NAMED_ATTRS; - if (mask & NFSV4ACE_WRITENAMEDATTR) - access |= VWRITE_NAMED_ATTRS; - if (mask & NFSV4ACE_EXECUTE) - access |= VEXEC; - if (mask & NFSV4ACE_SEARCH) - access |= VEXEC; - if (mask & NFSV4ACE_DELETECHILD) - access |= VDELETE_CHILD; - if (mask & NFSV4ACE_READATTRIBUTES) - access |= VREAD_ATTRIBUTES; - if (mask & NFSV4ACE_WRITEATTRIBUTES) - access |= VWRITE_ATTRIBUTES; - if (mask & NFSV4ACE_DELETE) - access |= VDELETE; - if (mask & NFSV4ACE_READACL) - access |= VREAD_ACL; - if (mask & NFSV4ACE_WRITEACL) - access |= VWRITE_ACL; - if (mask & NFSV4ACE_WRITEOWNER) - access |= VWRITE_OWNER; - if (mask & NFSV4ACE_SYNCHRONIZE) - access |= VSYNCHRONIZE; - - if (access != 0) - error = VOP_ACCESS(vp, access, cred, p); - else - error = VOP_ACCESS(vp, vflags, cred, p); - return (error); -} - -/* * Set an NFSv4 acl. */ APPLESTATIC int Modified: stable/8/sys/fs/nfs/nfs_var.h ============================================================================== --- stable/8/sys/fs/nfs/nfs_var.h Fri Jan 8 19:56:37 2010 (r201818) +++ stable/8/sys/fs/nfs/nfs_var.h Fri Jan 8 20:25:59 2010 (r201819) @@ -332,8 +332,6 @@ int nfsrv_dissectace(struct nfsrv_descri #ifdef NFS4_ACL_EXTATTR_NAME int nfsrv_buildacl(struct nfsrv_descript *, NFSACL_T *, enum vtype, NFSPROC_T *); -int nfsrv_aclaccess(vnode_t, accmode_t, u_int32_t, struct ucred *, - NFSPROC_T *); int nfsrv_setacl(vnode_t, NFSACL_T *, struct ucred *, NFSPROC_T *); int nfsrv_compareacl(NFSACL_T *, NFSACL_T *); @@ -516,8 +514,8 @@ int nfsvno_getattr(vnode_t, struct nfsva int nfsvno_setattr(vnode_t, struct nfsvattr *, struct ucred *, NFSPROC_T *, struct nfsexstuff *); int nfsvno_getfh(vnode_t, fhandle_t *, NFSPROC_T *); -int nfsvno_accchk(vnode_t, u_int32_t, struct ucred *, - struct nfsexstuff *, NFSPROC_T *, int, int); +int nfsvno_accchk(vnode_t, accmode_t, struct ucred *, + struct nfsexstuff *, NFSPROC_T *, int, int, u_int32_t *); int nfsvno_namei(struct nfsrv_descript *, struct nameidata *, vnode_t, int, struct nfsexstuff *, NFSPROC_T *, vnode_t *); void nfsvno_setpathbuf(struct nameidata *, char **, u_long **); Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 8 19:56:37 2010 (r201818) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Fri Jan 8 20:25:59 2010 (r201819) @@ -131,32 +131,20 @@ nfsvno_getfh(struct vnode *vp, fhandle_t /* * Perform access checking for vnodes obtained from file handles that would * refer to files already opened by a Unix client. You cannot just use - * vn_writechk() and VOP_ACCESS() for two reasons. - * 1 - You must check for exported rdonly as well as MNT_RDONLY for the write case + * vn_writechk() and VOP_ACCESSX() for two reasons. + * 1 - You must check for exported rdonly as well as MNT_RDONLY for the write + * case. * 2 - The owner is to be given access irrespective of mode bits for some * operations, so that processes that chmod after opening a file don't * break. */ int -nfsvno_accchk(struct vnode *vp, u_int32_t accessbits, struct ucred *cred, - struct nfsexstuff *exp, struct thread *p, int override, int vpislocked) +nfsvno_accchk(struct vnode *vp, accmode_t accmode, struct ucred *cred, + struct nfsexstuff *exp, struct thread *p, int override, int vpislocked, + u_int32_t *supportedtypep) { struct vattr vattr; int error = 0, getret = 0; - accmode_t accmode; - - /* - * Convert accessbits to Vxxx flags. - */ - if (accessbits & (NFSV4ACE_WRITEDATA | NFSV4ACE_APPENDDATA | - NFSV4ACE_ADDFILE | NFSV4ACE_ADDSUBDIRECTORY | - NFSV4ACE_DELETECHILD | NFSV4ACE_WRITEATTRIBUTES | - NFSV4ACE_DELETE | NFSV4ACE_WRITEACL | NFSV4ACE_WRITEOWNER)) - accmode = VWRITE; - else if (accessbits & (NFSV4ACE_EXECUTE | NFSV4ACE_SEARCH)) - accmode = VEXEC; - else - accmode = VREAD; if (accmode & VWRITE) { /* Just vn_writechk() changed to check rdonly */ @@ -166,7 +154,7 @@ nfsvno_accchk(struct vnode *vp, u_int32_ * device resident on the file system. */ if (NFSVNO_EXRDONLY(exp) || - (vp->v_mount->mnt_flag & MNT_RDONLY)) { + (vp->v_mount->mnt_flag & MNT_RDONLY)) { switch (vp->v_type) { case VREG: case VDIR: @@ -187,22 +175,26 @@ nfsvno_accchk(struct vnode *vp, u_int32_ if (vpislocked == 0) NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY, p); -#if defined(NFS4_ACL_EXTATTR_NAME) && defined(notyet) - /* - * This function should be called once FFS has NFSv4 ACL support - * in it. - */ /* * Should the override still be applied when ACLs are enabled? */ - if (nfsrv_useacl != 0 && NFSHASNFS4ACL(vp->v_mount)) - error = nfsrv_aclaccess(vp, accmode, accessbits, cred, p); - else -#endif - if (accessbits == NFSV4ACE_READATTRIBUTES) - error = 0; - else - error = VOP_ACCESS(vp, accmode, cred, p); + error = VOP_ACCESSX(vp, accmode, cred, p); + if (error != 0 && (accmode & (VDELETE | VDELETE_CHILD))) { + /* + * Try again with VEXPLICIT_DENY, to see if the test for + * deletion is supported. + */ + error = VOP_ACCESSX(vp, accmode | VEXPLICIT_DENY, cred, p); + if (error == 0) { + if (vp->v_type == VDIR) { + accmode &= ~(VDELETE | VDELETE_CHILD); + accmode |= VWRITE; + error = VOP_ACCESSX(vp, accmode, cred, p); + } else if (supportedtypep != NULL) { + *supportedtypep &= ~NFSACCESS_DELETE; + } + } + } /* * Allow certain operations for the owner (reads and writes @@ -790,9 +782,9 @@ nfsvno_createsub(struct nfsrv_descript * else vput(ndp->ni_dvp); if (!error && nvap->na_size != VNOVAL) { - error = nfsvno_accchk(*vpp, NFSV4ACE_ADDFILE, + error = nfsvno_accchk(*vpp, VWRITE, nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); if (!error) { tempsize = nvap->na_size; NFSVNO_ATTRINIT(nvap); @@ -1334,8 +1326,9 @@ nfsvno_open(struct nfsrv_descript *nd, s else NFSVNO_EXINIT(&nes); nd->nd_repstat = nfsvno_accchk(vp, - NFSV4ACE_ADDFILE, cred, &nes, p, - NFSACCCHK_NOOVERRIDE,NFSACCCHK_VPISLOCKED); + VWRITE, cred, &nes, p, + NFSACCCHK_NOOVERRIDE, + NFSACCCHK_VPISLOCKED, NULL); nd->nd_repstat = nfsrv_opencheck(clientid, stateidp, stp, vp, nd, p, nd->nd_repstat); if (!nd->nd_repstat) { @@ -1481,9 +1474,9 @@ nfsrvd_readdir(struct nfsrv_descript *nd #endif } if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_SEARCH, + nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) { vput(vp); if (nd->nd_flag & ND_NFSV3) @@ -1752,9 +1745,9 @@ nfsrvd_readdirplus(struct nfsrv_descript if (!nd->nd_repstat && cnt == 0) nd->nd_repstat = NFSERR_TOOSMALL; if (!nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_SEARCH, + nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) { vput(vp); if (nd->nd_flag & ND_NFSV3) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 8 19:56:37 2010 (r201818) +++ stable/8/sys/fs/nfsserver/nfs_nfsdserv.c Fri Jan 8 20:25:59 2010 (r201819) @@ -88,6 +88,7 @@ nfsrvd_access(struct nfsrv_descript *nd, int getret, error = 0; struct nfsvattr nva; u_int32_t testmode, nfsmode, supported = 0; + accmode_t deletebit; if (nd->nd_repstat) { nfsrv_postopattr(nd, 1, &nva); @@ -105,26 +106,30 @@ nfsrvd_access(struct nfsrv_descript *nd, } if (nfsmode & NFSACCESS_READ) { supported |= NFSACCESS_READ; - if (nfsvno_accchk(vp, NFSV4ACE_READDATA, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED)) + if (nfsvno_accchk(vp, VREAD, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED, &supported)) nfsmode &= ~NFSACCESS_READ; } if (nfsmode & NFSACCESS_MODIFY) { supported |= NFSACCESS_MODIFY; - if (nfsvno_accchk(vp, NFSV4ACE_WRITEDATA, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED)) + if (nfsvno_accchk(vp, VWRITE, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED, &supported)) nfsmode &= ~NFSACCESS_MODIFY; } if (nfsmode & NFSACCESS_EXTEND) { supported |= NFSACCESS_EXTEND; - if (nfsvno_accchk(vp, NFSV4ACE_APPENDDATA, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED)) + if (nfsvno_accchk(vp, VWRITE | VAPPEND, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED, &supported)) nfsmode &= ~NFSACCESS_EXTEND; } if (nfsmode & NFSACCESS_DELETE) { supported |= NFSACCESS_DELETE; - if (nfsvno_accchk(vp, NFSV4ACE_DELETE, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED)) + if (vp->v_type == VDIR) + deletebit = VDELETE_CHILD; + else + deletebit = VDELETE; + if (nfsvno_accchk(vp, deletebit, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED, &supported)) nfsmode &= ~NFSACCESS_DELETE; } if (vnode_vtype(vp) == VDIR) @@ -133,8 +138,8 @@ nfsrvd_access(struct nfsrv_descript *nd, testmode = NFSACCESS_EXECUTE; if (nfsmode & testmode) { supported |= (nfsmode & testmode); - if (nfsvno_accchk(vp, NFSV4ACE_EXECUTE, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED)) + if (nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED, &supported)) nfsmode &= ~testmode; } nfsmode &= supported; @@ -189,9 +194,9 @@ nfsrvd_getattr(struct nfsrv_descript *nd } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_accchk(vp, - NFSV4ACE_READATTRIBUTES, - nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE, NFSACCCHK_VPISLOCKED); + VREAD_ATTRIBUTES, + nd->nd_cred, exp, p, NFSACCCHK_NOOVERRIDE, + NFSACCCHK_VPISLOCKED, NULL); } if (!nd->nd_repstat) nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p); @@ -291,8 +296,9 @@ nfsrvd_setattr(struct nfsrv_descript *nd else if (nva2.na_uid != nd->nd_cred->cr_uid || NFSVNO_EXSTRICTACCESS(exp)) nd->nd_repstat = nfsvno_accchk(vp, - NFSV4ACE_WRITEDATA, nd->nd_cred, exp, p, - NFSACCCHK_NOOVERRIDE,NFSACCCHK_VPISLOCKED); + VWRITE, nd->nd_cred, exp, p, + NFSACCCHK_NOOVERRIDE, + NFSACCCHK_VPISLOCKED, NULL); } } if (!nd->nd_repstat && (nd->nd_flag & ND_NFSV4)) @@ -612,13 +618,13 @@ nfsrvd_read(struct nfsrv_descript *nd, _ if (!nd->nd_repstat && (nva.na_uid != nd->nd_cred->cr_uid || NFSVNO_EXSTRICTACCESS(exp))) { - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_READDATA, + nd->nd_repstat = nfsvno_accchk(vp, VREAD, nd->nd_cred, exp, p, - NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED); + NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_EXECUTE, - nd->nd_cred, exp, p, - NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED); + nd->nd_repstat = nfsvno_accchk(vp, VEXEC, + nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, + NFSACCCHK_VPISLOCKED, NULL); } if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, NULL, clientid, @@ -788,9 +794,9 @@ nfsrvd_write(struct nfsrv_descript *nd, if (!nd->nd_repstat && (forat.na_uid != nd->nd_cred->cr_uid || NFSVNO_EXSTRICTACCESS(exp))) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_WRITEDATA, + nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, exp, p, - NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED); + NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); if ((nd->nd_flag & ND_NFSV4) && !nd->nd_repstat) { nd->nd_repstat = nfsrv_lockctrl(vp, &stp, &lop, NULL, clientid, &stateid, exp, nd, p); @@ -2146,17 +2152,17 @@ nfsrvd_lock(struct nfsrv_descript *nd, _ } if (!nd->nd_repstat) { if (lflags & NFSLCK_WRITE) { - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_WRITEDATA, + nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); } else { - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_READDATA, + nd->nd_repstat = nfsvno_accchk(vp, VREAD, nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_EXECUTE, + nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); } } @@ -2672,15 +2678,15 @@ nfsrvd_open(struct nfsrv_descript *nd, _ nd->nd_repstat = NFSERR_INVAL; } if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_WRITEACCESS)) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_WRITEDATA, nd->nd_cred, - exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED); + nd->nd_repstat = nfsvno_accchk(vp, VWRITE, nd->nd_cred, + exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); if (!nd->nd_repstat && (stp->ls_flags & NFSLCK_READACCESS)) { - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_READDATA, nd->nd_cred, - exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED); + nd->nd_repstat = nfsvno_accchk(vp, VREAD, nd->nd_cred, + exp, p, NFSACCCHK_ALLOWOWNER, NFSACCCHK_VPISLOCKED, NULL); if (nd->nd_repstat) - nd->nd_repstat = nfsvno_accchk(vp, NFSV4ACE_EXECUTE, + nd->nd_repstat = nfsvno_accchk(vp, VEXEC, nd->nd_cred, exp, p, NFSACCCHK_ALLOWOWNER, - NFSACCCHK_VPISLOCKED); + NFSACCCHK_VPISLOCKED, NULL); } if (!nd->nd_repstat) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:33:55 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D595B1065672; Fri, 8 Jan 2010 20:33:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 544438FC22; Fri, 8 Jan 2010 20:33:55 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o08KXphW017110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Jan 2010 07:33:53 +1100 Date: Sat, 9 Jan 2010 07:33:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Edward Tomasz Napierala In-Reply-To: <201001081541.o08FfOHb014564@svn.freebsd.org> Message-ID: <20100109071832.H57772@delplex.bde.org> References: <201001081541.o08FfOHb014564@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201793 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:33:55 -0000 On Fri, 8 Jan 2010, Edward Tomasz Napierala wrote: > Log: > Fix #ifdefs so that GCC 4.4 doesn't complain about it. > > Reviewed by: rpaulo > > Modified: > head/sys/net80211/ieee80211_var.h > > Modified: head/sys/net80211/ieee80211_var.h > ============================================================================== > --- head/sys/net80211/ieee80211_var.h Fri Jan 8 15:28:22 2010 (r201792) > +++ head/sys/net80211/ieee80211_var.h Fri Jan 8 15:41:24 2010 (r201793) > @@ -32,11 +32,11 @@ > * Definitions for IEEE 802.11 drivers. > */ > /* NB: portability glue must go first */ > -#ifdef __NetBSD__ > +#if defined(__NetBSD__) "#if defined()" instead of "#ifdef" is a style bug. > #include > -#elif __FreeBSD__ > +#elif defined(__FreeBSD__) "defined()" is unfortunately needed with #elif (or if multple #ifdefs in a single statement are needed). > #include > -#elif __linux__ > +#elif defined(__linux__) > #include > #else > #error "No support for your operating system!" > It is a compiler bug to complain about undefined identifiers in cpp expressions, or a user bug to configure the compiler to have this bug. It is a standard C feature (6.10 [#3] in C99) that undefined identifiers are replaced by 0 in preprocessor expressions. This feature is very useful for avoiding ugliness like the above defined()'s. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:38:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7836B1065670; Fri, 8 Jan 2010 20:38:41 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67BF28FC15; Fri, 8 Jan 2010 20:38:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08KcfDD084777; Fri, 8 Jan 2010 20:38:41 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Kcfwp084775; Fri, 8 Jan 2010 20:38:41 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001082038.o08Kcfwp084775@svn.freebsd.org> From: Christian Brueffer Date: Fri, 8 Jan 2010 20:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201820 - head/release/doc/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:38:41 -0000 Author: brueffer Date: Fri Jan 8 20:38:41 2010 New Revision: 201820 URL: http://svn.freebsd.org/changeset/base/201820 Log: sk(4), stge(4) and vge(4) should work on all architectures, snd_t4dwave(4) works on sparc64. Submitted by: yongari Modified: head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Fri Jan 8 20:25:59 2010 (r201819) +++ head/release/doc/share/misc/dev.archlist.txt Fri Jan 8 20:38:41 2010 (r201820) @@ -107,7 +107,6 @@ rum i386,amd64 safe i386,pc98,amd64 sbp i386,sparc64,ia64,amd64 sis i386,pc98,ia64,amd64 -sk i386,sparc64,pc98,amd64 sn i386,amd64 snc pc98 snd_ad1816 i386,amd64 @@ -135,12 +134,11 @@ snd_neomagic i386,amd64 snd_sbc i386,amd64 snd_solo i386,amd64 snd_spicds i386,amd64 -snd_t4dwave i386,amd64 +snd_t4dwave i386,amd64,sparc64 snd_via8233 i386,amd64 snd_via82c686 i386,amd64 snd_vibes i386,amd64 stg i386,pc98 -stge i386,amd64,sparc64 ti i386,pc98,amd64,sparc64 tl i386,pc98,amd64 trm i386,amd64 @@ -161,7 +159,6 @@ ural i386,amd64 urio i386,pc98,amd64,powerpc uvisor i386,pc98,amd64 uvscom i386,pc98,amd64 -vge i386,pc98,amd64 vpo i386 vx i386,pc98,ia64,amd64 wb i386,pc98,amd64 From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:40:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AA9A1065692; Fri, 8 Jan 2010 20:40:29 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E56C38FC0C; Fri, 8 Jan 2010 20:40:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08KeSub085210; Fri, 8 Jan 2010 20:40:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08KeS2q085208; Fri, 8 Jan 2010 20:40:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001082040.o08KeS2q085208@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 20:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201821 - head/sys/dev/iir X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:40:29 -0000 Author: trasz Date: Fri Jan 8 20:40:28 2010 New Revision: 201821 URL: http://svn.freebsd.org/changeset/base/201821 Log: Get rid of #ident. Modified: head/sys/dev/iir/iir_pci.c Modified: head/sys/dev/iir/iir_pci.c ============================================================================== --- head/sys/dev/iir/iir_pci.c Fri Jan 8 20:38:41 2010 (r201820) +++ head/sys/dev/iir/iir_pci.c Fri Jan 8 20:40:28 2010 (r201821) @@ -29,7 +29,6 @@ * SUCH DAMAGE. */ -#ident "$Id: iir_pci.c 1.2 2003/08/26 12:29:55 achim Exp $" #include __FBSDID("$FreeBSD$"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 20:56:13 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84533106568B; Fri, 8 Jan 2010 20:56:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 1E44E8FC1B; Fri, 8 Jan 2010 20:56:12 +0000 (UTC) Received: from c122-106-155-90.carlnfd1.nsw.optusnet.com.au (c122-106-155-90.carlnfd1.nsw.optusnet.com.au [122.106.155.90]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o08KuAjB015357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 9 Jan 2010 07:56:11 +1100 Date: Sat, 9 Jan 2010 07:56:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Edward Tomasz Napierala In-Reply-To: <201001081544.o08FinVh015359@svn.freebsd.org> Message-ID: <20100109073716.E57804@delplex.bde.org> References: <201001081544.o08FinVh015359@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 20:56:13 -0000 On Fri, 8 Jan 2010, Edward Tomasz Napierala wrote: > Log: > Replace several instances of 'if (!a & b)' with 'if (!(a &b))' in order > to silence newer GCC versions. I don't like compilers warning about simple logical expressions (especially && vs || and & vs | precedence :-(), but as stefanf pointed out, the reason to change this (or almost anything) is not to silence a broken compiler, but to fix a bug. > Modified: head/sys/ddb/db_ps.c > ============================================================================== > --- head/sys/ddb/db_ps.c Fri Jan 8 15:41:24 2010 (r201793) > +++ head/sys/ddb/db_ps.c Fri Jan 8 15:44:49 2010 (r201794) > @@ -136,7 +136,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, > if (TD_ON_LOCK(td)) > lflag++; > if (TD_IS_SLEEPING(td)) { > - if (!td->td_flags & TDF_SINTR) > + if (!(td->td_flags & TDF_SINTR)) > dflag++; > else > sflag++; All of these bugs should have been avoided by using normal style. KNF doesn't even use the "!" operator for testing simple booleans! Older KNF code in kern uses comparisions with 0 fairly consistently for testing flags in a bitmap being 0. Even the not-so-old KNF code in kern that tests the not-so-old flag TDF_SINTR does this (there is only one instance, in kern_sig.c, where the above is spelled correctly as ((td->td_flags & TDF_SINTR) == 0). I like to use ! for testing even sets of flags so I prefer the above, but this is not KNF. Spelling for testing the opposite sense is more mixed. Omitting the != 0 seems to be most common. > @@ -171,7 +171,7 @@ db_ps(db_expr_t addr, boolean_t hasaddr, > state[1] = '\0'; > > /* Additional process state flags. */ > - if (!p->p_flag & P_INMEM) > + if (!(p->p_flag & P_INMEM)) > strlcat(state, "W", sizeof(state)); > if (p->p_flag & P_TRACED) > strlcat(state, "X", sizeof(state)); Also spelled correctly in kern (1 instance). Other tests of P_INMEM in kern show the mixed style for putting parentheses around the test for the opposite sense. Then the parentheses are optional and are sometimes omitted in expressions like (p->p_flag & P_INMEM && p->p_pid == pid). Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:02:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0698A106566B; Fri, 8 Jan 2010 21:02:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EABDC8FC0C; Fri, 8 Jan 2010 21:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08L2CQl090057; Fri, 8 Jan 2010 21:02:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08L2CuZ090055; Fri, 8 Jan 2010 21:02:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201001082102.o08L2CuZ090055@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 8 Jan 2010 21:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201822 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:02:13 -0000 Author: trasz Date: Fri Jan 8 21:02:12 2010 New Revision: 201822 URL: http://svn.freebsd.org/changeset/base/201822 Log: Fix array overflow. Reviewed by: rpaulo Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Jan 8 20:40:28 2010 (r201821) +++ head/sys/dev/iwn/if_iwn.c Fri Jan 8 21:02:12 2010 (r201822) @@ -3928,7 +3928,7 @@ iwn5000_get_rssi(struct iwn_softc *sc, s DPRINTF(sc, IWN_DEBUG_RECV, "%s: agc %d rssi %d %d %d " "result %d\n", __func__, agc, - phy->rssi[0], phy->rssi[2], phy->rssi[4], + phy->rssi[0], phy->rssi[1], phy->rssi[2], rssi - agc - IWN_RSSI_TO_DBM); return rssi - agc - IWN_RSSI_TO_DBM; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:15:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0E03106568B; Fri, 8 Jan 2010 21:15:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEEF88FC08; Fri, 8 Jan 2010 21:15:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LF99w092935; Fri, 8 Jan 2010 21:15:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LF9YT092932; Fri, 8 Jan 2010 21:15:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082115.o08LF9YT092932@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201823 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:15:09 -0000 Author: yongari Date: Fri Jan 8 21:15:09 2010 New Revision: 201823 URL: http://svn.freebsd.org/changeset/base/201823 Log: MFC r198987,199414,199543,200422 Partial merge r198987: Use device_printf() and if_printf() instead of printf() with an explicit unit number and remove 'unit' members from softc. Partial merge r199414: Use the bus_*() routines rather than bus_space_*() for register operations. r199543: Several fixes to this driver: - Overhaul the locking to avoid recursion and add missing locking in a few places. - Don't schedule a task to call vge_start() from contexts that are safe to call vge_start() directly. Just invoke the routine directly instead (this is what all of the other NIC drivers I am familiar with do). Note that vge(4) does not use an interrupt filter handler which is the primary reason some other drivers use tasks. - Add a new private timer to drive the watchdog timer instead of using if_watchdog and if_timer. - Fixup detach by calling ether_ifdetach() before stopping the interface. r200422: Remove driver lock assertion in MII register access. This change was made in r199543 to remove MTX_RECURSE. These routines can be called in device attach phase(e.g. mii_phy_probe()) so checking assertion here is not right as caller does not hold a driver lock. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:02:12 2010 (r201822) +++ stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:15:09 2010 (r201823) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -160,12 +159,13 @@ static int vge_rxeof (struct vge_softc static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); -static void vge_tx_task (void *, int); static void vge_start (struct ifnet *); +static void vge_start_locked (struct ifnet *); static int vge_ioctl (struct ifnet *, u_long, caddr_t); static void vge_init (void *); +static void vge_init_locked (struct vge_softc *); static void vge_stop (struct vge_softc *); -static void vge_watchdog (struct ifnet *); +static void vge_watchdog (void *); static int vge_suspend (device_t); static int vge_resume (device_t); static int vge_shutdown (device_t); @@ -378,7 +378,6 @@ vge_miibus_readreg(dev, phy, reg) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK(sc); vge_miipoll_stop(sc); /* Specify the register we want to read. */ @@ -400,7 +399,6 @@ vge_miibus_readreg(dev, phy, reg) rval = CSR_READ_2(sc, VGE_MIIDATA); vge_miipoll_start(sc); - VGE_UNLOCK(sc); return (rval); } @@ -418,7 +416,6 @@ vge_miibus_writereg(dev, phy, reg, data) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK(sc); vge_miipoll_stop(sc); /* Specify the register we want to write. */ @@ -443,7 +440,6 @@ vge_miibus_writereg(dev, phy, reg, data) } vge_miipoll_start(sc); - VGE_UNLOCK(sc); return (rval); } @@ -929,7 +925,9 @@ vge_attach(dev) sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, - MTX_DEF | MTX_RECURSE); + MTX_DEF); + callout_init_mtx(&sc->vge_watchdog, &sc->vge_mtx, 0); + /* * Map control/status registers. */ @@ -945,9 +943,6 @@ vge_attach(dev) goto fail; } - sc->vge_btag = rman_get_bustag(sc->vge_res); - sc->vge_bhandle = rman_get_bushandle(sc->vge_res); - /* Allocate interrupt */ rid = 0; sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, @@ -967,8 +962,6 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - sc->vge_unit = unit; - /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -993,7 +986,7 @@ vge_attach(dev) ifp = sc->vge_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - printf("vge%d: can not if_alloc()\n", sc->vge_unit); + device_printf(dev, "can not if_alloc()\n"); error = ENOSPC; goto fail; } @@ -1001,7 +994,7 @@ vge_attach(dev) /* Do MII setup */ if (mii_phy_probe(dev, &sc->vge_miibus, vge_ifmedia_upd, vge_ifmedia_sts)) { - printf("vge%d: MII without any phy!\n", sc->vge_unit); + device_printf(dev, "MII without any phy!\n"); error = ENXIO; goto fail; } @@ -1019,14 +1012,11 @@ vge_attach(dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif - ifp->if_watchdog = vge_watchdog; ifp->if_init = vge_init; IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->vge_txtask, 0, vge_tx_task, ifp); - /* * Call MI attach routine. */ @@ -1075,21 +1065,11 @@ vge_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { - vge_stop(sc); - /* - * Force off the IFF_UP flag here, in case someone - * still had a BPF descriptor attached to this - * interface. If they do, ether_ifattach() will cause - * the BPF code to try and clear the promisc mode - * flag, which will bubble down to vge_ioctl(), - * which will try to call vge_init() again. This will - * turn the NIC back on and restart the MII ticker, - * which will panic the system when the kernel tries - * to invoke the vge_tick() function that isn't there - * anymore. - */ - ifp->if_flags &= ~IFF_UP; ether_ifdetach(ifp); + VGE_LOCK(sc); + vge_stop(sc); + VGE_UNLOCK(sc); + callout_drain(&sc->vge_watchdog); } if (sc->vge_miibus) device_delete_child(dev, sc->vge_miibus); @@ -1528,7 +1508,7 @@ vge_txeof(sc) if (idx != sc->vge_ldata.vge_tx_considx) { sc->vge_ldata.vge_tx_considx = idx; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->vge_timer = 0; } /* @@ -1554,7 +1534,7 @@ vge_tick(xsc) sc = xsc; ifp = sc->vge_ifp; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); mii_tick(mii); @@ -1571,13 +1551,10 @@ vge_tick(xsc) if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, - &sc->vge_txtask); + vge_start_locked(ifp); } } - VGE_UNLOCK(sc); - return; } @@ -1597,7 +1574,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, &sc->vge_txtask); + vge_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int32_t status; @@ -1613,7 +1590,7 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & VGE_ISR_TXDMA_STALL || status & VGE_ISR_RXDMA_STALL) - vge_init(sc); + vge_init_locked(sc); if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc); @@ -1686,7 +1663,7 @@ vge_intr(arg) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) - vge_init(sc); + vge_init_locked(sc); if (status & VGE_ISR_LINKSTS) vge_tick(sc); @@ -1695,10 +1672,10 @@ vge_intr(arg) /* Re-enable interrupts */ CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - VGE_UNLOCK(sc); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, &sc->vge_txtask); + vge_start_locked(ifp); + + VGE_UNLOCK(sc); return; } @@ -1736,8 +1713,7 @@ vge_encap(sc, m_head, idx) m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error && error != EFBIG) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", error); return (ENOBUFS); } @@ -1758,8 +1734,8 @@ vge_encap(sc, m_head, idx) error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, map, m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", + error); return (EFBIG); } } @@ -1780,19 +1756,6 @@ vge_encap(sc, m_head, idx) return (0); } -static void -vge_tx_task(arg, npending) - void *arg; - int npending; -{ - struct ifnet *ifp; - - ifp = arg; - vge_start(ifp); - - return; -} - /* * Main transmit routine. */ @@ -1802,21 +1765,29 @@ vge_start(ifp) struct ifnet *ifp; { struct vge_softc *sc; + + sc = ifp->if_softc; + VGE_LOCK(sc); + vge_start_locked(ifp); + VGE_UNLOCK(sc); +} + +static void +vge_start_locked(ifp) + struct ifnet *ifp; +{ + struct vge_softc *sc; struct mbuf *m_head = NULL; int idx, pidx = 0; sc = ifp->if_softc; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); - if (!sc->vge_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) { - VGE_UNLOCK(sc); + if (!sc->vge_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - } - if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - VGE_UNLOCK(sc); + if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) return; - } idx = sc->vge_ldata.vge_tx_prodidx; @@ -1849,10 +1820,8 @@ vge_start(ifp) ETHER_BPF_MTAP(ifp, m_head); } - if (idx == sc->vge_ldata.vge_tx_prodidx) { - VGE_UNLOCK(sc); + if (idx == sc->vge_ldata.vge_tx_prodidx) return; - } /* Flush the TX descriptors */ @@ -1876,12 +1845,10 @@ vge_start(ifp) */ CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - VGE_UNLOCK(sc); - /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->vge_timer = 5; return; } @@ -1891,11 +1858,20 @@ vge_init(xsc) void *xsc; { struct vge_softc *sc = xsc; + + VGE_LOCK(sc); + vge_init_locked(sc); + VGE_UNLOCK(sc); +} + +static void +vge_init_locked(struct vge_softc *sc) +{ struct ifnet *ifp = sc->vge_ifp; struct mii_data *mii; int i; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); /* @@ -2051,12 +2027,11 @@ vge_init(xsc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); sc->vge_if_flags = 0; sc->vge_link = 0; - VGE_UNLOCK(sc); - return; } @@ -2093,7 +2068,9 @@ vge_ifmedia_sts(ifp, ifmr) sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); + VGE_LOCK(sc); mii_pollstat(mii); + VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -2168,6 +2145,7 @@ vge_ioctl(ifp, command, data) ifp->if_mtu = ifr->ifr_mtu; break; case SIOCSIFFLAGS: + VGE_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && @@ -2182,16 +2160,19 @@ vge_ioctl(ifp, command, data) VGE_RXCTL_RX_PROMISC); vge_setmulti(sc); } else - vge_init(sc); + vge_init_locked(sc); } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) vge_stop(sc); } sc->vge_if_flags = ifp->if_flags; + VGE_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: + VGE_LOCK(sc); vge_setmulti(sc); + VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -2225,6 +2206,7 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ + VGE_LOCK(sc); if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; @@ -2236,6 +2218,7 @@ vge_ioctl(ifp, command, data) if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + VGE_UNLOCK(sc); } break; default: @@ -2247,22 +2230,25 @@ vge_ioctl(ifp, command, data) } static void -vge_watchdog(ifp) - struct ifnet *ifp; +vge_watchdog(void *arg) { - struct vge_softc *sc; + struct vge_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - VGE_LOCK(sc); - printf("vge%d: watchdog timeout\n", sc->vge_unit); + sc = arg; + VGE_LOCK_ASSERT(sc); + callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); + if (sc->vge_timer == 0 || --sc->vge_timer > 0) + return; + + ifp = sc->vge_ifp; + if_printf(ifp, "watchdog timeout\n"); ifp->if_oerrors++; vge_txeof(sc); vge_rxeof(sc); - vge_init(sc); - - VGE_UNLOCK(sc); + vge_init_locked(sc); return; } @@ -2278,9 +2264,10 @@ vge_stop(sc) register int i; struct ifnet *ifp; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; - ifp->if_timer = 0; + sc->vge_timer = 0; + callout_stop(&sc->vge_watchdog); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -2318,8 +2305,6 @@ vge_stop(sc) } } - VGE_UNLOCK(sc); - return; } @@ -2336,9 +2321,11 @@ vge_suspend(dev) sc = device_get_softc(dev); + VGE_LOCK(sc); vge_stop(sc); sc->suspended = 1; + VGE_UNLOCK(sc); return (0); } @@ -2363,10 +2350,12 @@ vge_resume(dev) pci_enable_io(dev, SYS_RES_MEMORY); /* reinitialize interface if necessary */ + VGE_LOCK(sc); if (ifp->if_flags & IFF_UP) - vge_init(sc); + vge_init_locked(sc); sc->suspended = 0; + VGE_UNLOCK(sc); return (0); } @@ -2383,7 +2372,9 @@ vge_shutdown(dev) sc = device_get_softc(dev); + VGE_LOCK(sc); vge_stop(sc); + VGE_UNLOCK(sc); return (0); } Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 21:02:12 2010 (r201822) +++ stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 21:15:09 2010 (r201823) @@ -100,22 +100,20 @@ struct vge_list_data { struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; - bus_space_handle_t vge_bhandle; /* bus space handle */ - bus_space_tag_t vge_btag; /* bus space tag */ struct resource *vge_res; struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; bus_dma_tag_t vge_parent_tag; bus_dma_tag_t vge_tag; - u_int8_t vge_unit; /* interface number */ u_int8_t vge_type; int vge_if_flags; int vge_rx_consumed; int vge_link; int vge_camidx; - struct task vge_txtask; struct mtx vge_mtx; + struct callout vge_watchdog; + int vge_timer; struct mbuf *vge_head; struct mbuf *vge_tail; @@ -135,20 +133,20 @@ struct vge_softc { * register space access macros */ #define CSR_WRITE_STREAM_4(sc, reg, val) \ - bus_space_write_stream_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_stream_4(sc->vge_res, reg, val) #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_4(sc->vge_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_2(sc->vge_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_1(sc->vge_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_4(sc->vge_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_2(sc->vge_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_1(sc->vge_res, reg) #define CSR_SETBIT_1(sc, reg, x) \ CSR_WRITE_1(sc, reg, CSR_READ_1(sc, reg) | (x)) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:19:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B57671065672; Fri, 8 Jan 2010 21:19:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A38F98FC17; Fri, 8 Jan 2010 21:19:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LJfBO093998; Fri, 8 Jan 2010 21:19:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LJfAD093995; Fri, 8 Jan 2010 21:19:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082119.o08LJfAD093995@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201824 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:19:41 -0000 Author: yongari Date: Fri Jan 8 21:19:41 2010 New Revision: 201824 URL: http://svn.freebsd.org/changeset/base/201824 Log: MFC r198987,199414,199543,200422 Partial merge r198987: Use device_printf() and if_printf() instead of printf() with an explicit unit number and remove 'unit' members from softc. Partial merge r199414: Use the bus_*() routines rather than bus_space_*() for register operations. r199543: Several fixes to this driver: - Overhaul the locking to avoid recursion and add missing locking in a few places. - Don't schedule a task to call vge_start() from contexts that are safe to call vge_start() directly. Just invoke the routine directly instead (this is what all of the other NIC drivers I am familiar with do). Note that vge(4) does not use an interrupt filter handler which is the primary reason some other drivers use tasks. - Add a new private timer to drive the watchdog timer instead of using if_watchdog and if_timer. - Fixup detach by calling ether_ifdetach() before stopping the interface. r200422: Remove driver lock assertion in MII register access. This change was made in r199543 to remove MTX_RECURSE. These routines can be called in device attach phase(e.g. mii_phy_probe()) so checking assertion here is not right as caller does not hold a driver lock. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:15:09 2010 (r201823) +++ stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:19:41 2010 (r201824) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -160,12 +159,13 @@ static void vge_rxeof (struct vge_softc static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); -static void vge_tx_task (void *, int); static void vge_start (struct ifnet *); +static void vge_start_locked (struct ifnet *); static int vge_ioctl (struct ifnet *, u_long, caddr_t); static void vge_init (void *); +static void vge_init_locked (struct vge_softc *); static void vge_stop (struct vge_softc *); -static void vge_watchdog (struct ifnet *); +static void vge_watchdog (void *); static int vge_suspend (device_t); static int vge_resume (device_t); static int vge_shutdown (device_t); @@ -379,7 +379,6 @@ vge_miibus_readreg(dev, phy, reg) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK(sc); vge_miipoll_stop(sc); /* Specify the register we want to read. */ @@ -401,7 +400,6 @@ vge_miibus_readreg(dev, phy, reg) rval = CSR_READ_2(sc, VGE_MIIDATA); vge_miipoll_start(sc); - VGE_UNLOCK(sc); return (rval); } @@ -419,7 +417,6 @@ vge_miibus_writereg(dev, phy, reg, data) if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) return(0); - VGE_LOCK(sc); vge_miipoll_stop(sc); /* Specify the register we want to write. */ @@ -444,7 +441,6 @@ vge_miibus_writereg(dev, phy, reg, data) } vge_miipoll_start(sc); - VGE_UNLOCK(sc); return (rval); } @@ -932,7 +928,9 @@ vge_attach(dev) sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, - MTX_DEF | MTX_RECURSE); + MTX_DEF); + callout_init_mtx(&sc->vge_watchdog, &sc->vge_mtx, 0); + /* * Map control/status registers. */ @@ -948,9 +946,6 @@ vge_attach(dev) goto fail; } - sc->vge_btag = rman_get_bustag(sc->vge_res); - sc->vge_bhandle = rman_get_bushandle(sc->vge_res); - /* Allocate interrupt */ rid = 0; sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, @@ -970,8 +965,6 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - sc->vge_unit = unit; - /* * Allocate the parent bus DMA tag appropriate for PCI. */ @@ -996,7 +989,7 @@ vge_attach(dev) ifp = sc->vge_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - printf("vge%d: can not if_alloc()\n", sc->vge_unit); + device_printf(dev, "can not if_alloc()\n"); error = ENOSPC; goto fail; } @@ -1004,7 +997,7 @@ vge_attach(dev) /* Do MII setup */ if (mii_phy_probe(dev, &sc->vge_miibus, vge_ifmedia_upd, vge_ifmedia_sts)) { - printf("vge%d: MII without any phy!\n", sc->vge_unit); + device_printf(dev, "MII without any phy!\n"); error = ENXIO; goto fail; } @@ -1022,14 +1015,11 @@ vge_attach(dev) #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif - ifp->if_watchdog = vge_watchdog; ifp->if_init = vge_init; IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->vge_txtask, 0, vge_tx_task, ifp); - /* * Call MI attach routine. */ @@ -1078,21 +1068,11 @@ vge_detach(dev) /* These should only be active if attach succeeded */ if (device_is_attached(dev)) { - vge_stop(sc); - /* - * Force off the IFF_UP flag here, in case someone - * still had a BPF descriptor attached to this - * interface. If they do, ether_ifattach() will cause - * the BPF code to try and clear the promisc mode - * flag, which will bubble down to vge_ioctl(), - * which will try to call vge_init() again. This will - * turn the NIC back on and restart the MII ticker, - * which will panic the system when the kernel tries - * to invoke the vge_tick() function that isn't there - * anymore. - */ - ifp->if_flags &= ~IFF_UP; ether_ifdetach(ifp); + VGE_LOCK(sc); + vge_stop(sc); + VGE_UNLOCK(sc); + callout_drain(&sc->vge_watchdog); } if (sc->vge_miibus) device_delete_child(dev, sc->vge_miibus); @@ -1531,7 +1511,7 @@ vge_txeof(sc) if (idx != sc->vge_ldata.vge_tx_considx) { sc->vge_ldata.vge_tx_considx = idx; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_timer = 0; + sc->vge_timer = 0; } /* @@ -1557,7 +1537,7 @@ vge_tick(xsc) sc = xsc; ifp = sc->vge_ifp; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); mii_tick(mii); @@ -1574,13 +1554,10 @@ vge_tick(xsc) if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, - &sc->vge_txtask); + vge_start_locked(ifp); } } - VGE_UNLOCK(sc); - return; } @@ -1599,7 +1576,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, &sc->vge_txtask); + vge_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int32_t status; @@ -1615,7 +1592,7 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & VGE_ISR_TXDMA_STALL || status & VGE_ISR_RXDMA_STALL) - vge_init(sc); + vge_init_locked(sc); if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc); @@ -1687,7 +1664,7 @@ vge_intr(arg) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) - vge_init(sc); + vge_init_locked(sc); if (status & VGE_ISR_LINKSTS) vge_tick(sc); @@ -1696,10 +1673,10 @@ vge_intr(arg) /* Re-enable interrupts */ CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - VGE_UNLOCK(sc); - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue(taskqueue_swi, &sc->vge_txtask); + vge_start_locked(ifp); + + VGE_UNLOCK(sc); return; } @@ -1737,8 +1714,7 @@ vge_encap(sc, m_head, idx) m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error && error != EFBIG) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", error); return (ENOBUFS); } @@ -1759,8 +1735,8 @@ vge_encap(sc, m_head, idx) error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, map, m_head, vge_dma_map_tx_desc, &arg, BUS_DMA_NOWAIT); if (error) { - printf("vge%d: can't map mbuf (error %d)\n", - sc->vge_unit, error); + if_printf(sc->vge_ifp, "can't map mbuf (error %d)\n", + error); return (EFBIG); } } @@ -1781,19 +1757,6 @@ vge_encap(sc, m_head, idx) return (0); } -static void -vge_tx_task(arg, npending) - void *arg; - int npending; -{ - struct ifnet *ifp; - - ifp = arg; - vge_start(ifp); - - return; -} - /* * Main transmit routine. */ @@ -1803,21 +1766,29 @@ vge_start(ifp) struct ifnet *ifp; { struct vge_softc *sc; + + sc = ifp->if_softc; + VGE_LOCK(sc); + vge_start_locked(ifp); + VGE_UNLOCK(sc); +} + +static void +vge_start_locked(ifp) + struct ifnet *ifp; +{ + struct vge_softc *sc; struct mbuf *m_head = NULL; int idx, pidx = 0; sc = ifp->if_softc; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); - if (!sc->vge_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) { - VGE_UNLOCK(sc); + if (!sc->vge_link || ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - } - if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - VGE_UNLOCK(sc); + if (IFQ_DRV_IS_EMPTY(&ifp->if_snd)) return; - } idx = sc->vge_ldata.vge_tx_prodidx; @@ -1850,10 +1821,8 @@ vge_start(ifp) ETHER_BPF_MTAP(ifp, m_head); } - if (idx == sc->vge_ldata.vge_tx_prodidx) { - VGE_UNLOCK(sc); + if (idx == sc->vge_ldata.vge_tx_prodidx) return; - } /* Flush the TX descriptors */ @@ -1877,12 +1846,10 @@ vge_start(ifp) */ CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - VGE_UNLOCK(sc); - /* * Set a timeout in case the chip goes out to lunch. */ - ifp->if_timer = 5; + sc->vge_timer = 5; return; } @@ -1892,11 +1859,20 @@ vge_init(xsc) void *xsc; { struct vge_softc *sc = xsc; + + VGE_LOCK(sc); + vge_init_locked(sc); + VGE_UNLOCK(sc); +} + +static void +vge_init_locked(struct vge_softc *sc) +{ struct ifnet *ifp = sc->vge_ifp; struct mii_data *mii; int i; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); /* @@ -2052,12 +2028,11 @@ vge_init(xsc) ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); sc->vge_if_flags = 0; sc->vge_link = 0; - VGE_UNLOCK(sc); - return; } @@ -2094,7 +2069,9 @@ vge_ifmedia_sts(ifp, ifmr) sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); + VGE_LOCK(sc); mii_pollstat(mii); + VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -2169,6 +2146,7 @@ vge_ioctl(ifp, command, data) ifp->if_mtu = ifr->ifr_mtu; break; case SIOCSIFFLAGS: + VGE_LOCK(sc); if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING && ifp->if_flags & IFF_PROMISC && @@ -2183,16 +2161,19 @@ vge_ioctl(ifp, command, data) VGE_RXCTL_RX_PROMISC); vge_setmulti(sc); } else - vge_init(sc); + vge_init_locked(sc); } else { if (ifp->if_drv_flags & IFF_DRV_RUNNING) vge_stop(sc); } sc->vge_if_flags = ifp->if_flags; + VGE_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: + VGE_LOCK(sc); vge_setmulti(sc); + VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: case SIOCSIFMEDIA: @@ -2226,6 +2207,7 @@ vge_ioctl(ifp, command, data) } } #endif /* DEVICE_POLLING */ + VGE_LOCK(sc); if ((mask & IFCAP_TXCSUM) != 0 && (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { ifp->if_capenable ^= IFCAP_TXCSUM; @@ -2237,6 +2219,7 @@ vge_ioctl(ifp, command, data) if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + VGE_UNLOCK(sc); } break; default: @@ -2248,22 +2231,25 @@ vge_ioctl(ifp, command, data) } static void -vge_watchdog(ifp) - struct ifnet *ifp; +vge_watchdog(void *arg) { - struct vge_softc *sc; + struct vge_softc *sc; + struct ifnet *ifp; - sc = ifp->if_softc; - VGE_LOCK(sc); - printf("vge%d: watchdog timeout\n", sc->vge_unit); + sc = arg; + VGE_LOCK_ASSERT(sc); + callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); + if (sc->vge_timer == 0 || --sc->vge_timer > 0) + return; + + ifp = sc->vge_ifp; + if_printf(ifp, "watchdog timeout\n"); ifp->if_oerrors++; vge_txeof(sc); vge_rxeof(sc); - vge_init(sc); - - VGE_UNLOCK(sc); + vge_init_locked(sc); return; } @@ -2279,9 +2265,10 @@ vge_stop(sc) register int i; struct ifnet *ifp; - VGE_LOCK(sc); + VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; - ifp->if_timer = 0; + sc->vge_timer = 0; + callout_stop(&sc->vge_watchdog); ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); @@ -2319,8 +2306,6 @@ vge_stop(sc) } } - VGE_UNLOCK(sc); - return; } @@ -2337,9 +2322,11 @@ vge_suspend(dev) sc = device_get_softc(dev); + VGE_LOCK(sc); vge_stop(sc); sc->suspended = 1; + VGE_UNLOCK(sc); return (0); } @@ -2364,10 +2351,12 @@ vge_resume(dev) pci_enable_io(dev, SYS_RES_MEMORY); /* reinitialize interface if necessary */ + VGE_LOCK(sc); if (ifp->if_flags & IFF_UP) - vge_init(sc); + vge_init_locked(sc); sc->suspended = 0; + VGE_UNLOCK(sc); return (0); } @@ -2384,7 +2373,9 @@ vge_shutdown(dev) sc = device_get_softc(dev); + VGE_LOCK(sc); vge_stop(sc); + VGE_UNLOCK(sc); return (0); } Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 21:15:09 2010 (r201823) +++ stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 21:19:41 2010 (r201824) @@ -100,22 +100,20 @@ struct vge_list_data { struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; - bus_space_handle_t vge_bhandle; /* bus space handle */ - bus_space_tag_t vge_btag; /* bus space tag */ struct resource *vge_res; struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; bus_dma_tag_t vge_parent_tag; bus_dma_tag_t vge_tag; - u_int8_t vge_unit; /* interface number */ u_int8_t vge_type; int vge_if_flags; int vge_rx_consumed; int vge_link; int vge_camidx; - struct task vge_txtask; struct mtx vge_mtx; + struct callout vge_watchdog; + int vge_timer; struct mbuf *vge_head; struct mbuf *vge_tail; @@ -135,20 +133,20 @@ struct vge_softc { * register space access macros */ #define CSR_WRITE_STREAM_4(sc, reg, val) \ - bus_space_write_stream_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_stream_4(sc->vge_res, reg, val) #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_4(sc->vge_res, reg, val) #define CSR_WRITE_2(sc, reg, val) \ - bus_space_write_2(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_2(sc->vge_res, reg, val) #define CSR_WRITE_1(sc, reg, val) \ - bus_space_write_1(sc->vge_btag, sc->vge_bhandle, reg, val) + bus_write_1(sc->vge_res, reg, val) #define CSR_READ_4(sc, reg) \ - bus_space_read_4(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_4(sc->vge_res, reg) #define CSR_READ_2(sc, reg) \ - bus_space_read_2(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_2(sc->vge_res, reg) #define CSR_READ_1(sc, reg) \ - bus_space_read_1(sc->vge_btag, sc->vge_bhandle, reg) + bus_read_1(sc->vge_res, reg) #define CSR_SETBIT_1(sc, reg, x) \ CSR_WRITE_1(sc, reg, CSR_READ_1(sc, reg) | (x)) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:25:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1E01106566C; Fri, 8 Jan 2010 21:25:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90BC38FC08; Fri, 8 Jan 2010 21:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LPqpa095491; Fri, 8 Jan 2010 21:25:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LPqHQ095489; Fri, 8 Jan 2010 21:25:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082125.o08LPqHQ095489@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201825 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:25:52 -0000 Author: yongari Date: Fri Jan 8 21:25:52 2010 New Revision: 201825 URL: http://svn.freebsd.org/changeset/base/201825 Log: MFC r200519-200522 r200519: Remove register keyword. r200520: Prefer device_printf(9) to printf(9). r200521: Fix spelling in comment. r200522: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). Modified: stable/8/sys/dev/vge/if_vge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:19:41 2010 (r201824) +++ stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:25:52 2010 (r201825) @@ -233,7 +233,7 @@ vge_eeprom_getword(sc, addr, dest) int addr; u_int16_t *dest; { - register int i; + int i; u_int16_t word = 0; /* @@ -536,7 +536,7 @@ fail: /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, - * we use the hash filter insted. + * we use the hash filter instead. */ static void vge_setmulti(sc) @@ -602,7 +602,7 @@ static void vge_reset(sc) struct vge_softc *sc; { - register int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -918,10 +918,9 @@ vge_attach(dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int unit, error = 0, rid; + int error = 0, rid; sc = device_get_softc(dev); - unit = device_get_unit(dev); sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -934,22 +933,22 @@ vge_attach(dev) pci_enable_busmaster(dev); rid = VGE_PCI_LOMEM; - sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->vge_res == NULL) { - printf ("vge%d: couldn't map ports/memory\n", unit); + device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } /* Allocate interrupt */ rid = 0; - sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { - printf("vge%d: couldn't map interrupt\n", unit); + device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; goto fail; } @@ -1027,7 +1026,7 @@ vge_attach(dev) NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { - printf("vge%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); goto fail; } @@ -1179,7 +1178,7 @@ vge_newbuf(sc, idx, m) /* * Note: the manual fails to document the fact that for - * proper opration, the driver needs to replentish the RX + * proper operation, the driver needs to replenish the RX * DMA ring 4 descriptors at a time (rather than one at a * time, like most chips). We can allocate the new buffers * but we should not set the OWN bits until we're ready @@ -1971,7 +1970,7 @@ vge_init_locked(struct vge_softc *sc) /* * Configure one-shot timer for microsecond - * resulution and load it for 500 usecs. + * resolution and load it for 500 usecs. */ CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); CSR_WRITE_2(sc, VGE_SSTIMER, 400); @@ -2261,7 +2260,7 @@ static void vge_stop(sc) struct vge_softc *sc; { - register int i; + int i; struct ifnet *ifp; VGE_LOCK_ASSERT(sc); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:27:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EA9A106568D; Fri, 8 Jan 2010 21:27:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 144F58FC23; Fri, 8 Jan 2010 21:27:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LR9CM095880; Fri, 8 Jan 2010 21:27:09 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LR9cc095879; Fri, 8 Jan 2010 21:27:09 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082127.o08LR9cc095879@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 21:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201826 - in stable/8/sys: . cddl/contrib/opensolaris contrib/pf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:27:10 -0000 Author: brooks Date: Fri Jan 8 21:27:09 2010 New Revision: 201826 URL: http://svn.freebsd.org/changeset/base/201826 Log: MFC r201349: Ignore .glimpse_* files as generated by the glimpse target. Also ignore cscope.* files. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:27:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8423410656A4; Fri, 8 Jan 2010 21:27:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 732C28FC1D; Fri, 8 Jan 2010 21:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LRZPh096012; Fri, 8 Jan 2010 21:27:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LRZxb096010; Fri, 8 Jan 2010 21:27:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082127.o08LRZxb096010@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201827 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:27:35 -0000 Author: yongari Date: Fri Jan 8 21:27:35 2010 New Revision: 201827 URL: http://svn.freebsd.org/changeset/base/201827 Log: MFC r200519-200522 r200519: Remove register keyword. r200520: Prefer device_printf(9) to printf(9). r200521: Fix spelling in comment. r200522: Prefer bus_alloc_resource_any(9) to bus_alloc_resource(9). Modified: stable/7/sys/dev/vge/if_vge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:27:09 2010 (r201826) +++ stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:27:35 2010 (r201827) @@ -234,7 +234,7 @@ vge_eeprom_getword(sc, addr, dest) int addr; u_int16_t *dest; { - register int i; + int i; u_int16_t word = 0; /* @@ -537,7 +537,7 @@ fail: /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, - * we use the hash filter insted. + * we use the hash filter instead. */ static void vge_setmulti(sc) @@ -603,7 +603,7 @@ static void vge_reset(sc) struct vge_softc *sc; { - register int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -921,10 +921,9 @@ vge_attach(dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int unit, error = 0, rid; + int error = 0, rid; sc = device_get_softc(dev); - unit = device_get_unit(dev); sc->vge_dev = dev; mtx_init(&sc->vge_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, @@ -937,22 +936,22 @@ vge_attach(dev) pci_enable_busmaster(dev); rid = VGE_PCI_LOMEM; - sc->vge_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, - 0, ~0, 1, RF_ACTIVE); + sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); if (sc->vge_res == NULL) { - printf ("vge%d: couldn't map ports/memory\n", unit); + device_printf(dev, "couldn't map ports/memory\n"); error = ENXIO; goto fail; } /* Allocate interrupt */ rid = 0; - sc->vge_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, - 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->vge_irq == NULL) { - printf("vge%d: couldn't map interrupt\n", unit); + device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; goto fail; } @@ -1030,7 +1029,7 @@ vge_attach(dev) NULL, vge_intr, sc, &sc->vge_intrhand); if (error) { - printf("vge%d: couldn't set up irq\n", unit); + device_printf(dev, "couldn't set up irq\n"); ether_ifdetach(ifp); goto fail; } @@ -1182,7 +1181,7 @@ vge_newbuf(sc, idx, m) /* * Note: the manual fails to document the fact that for - * proper opration, the driver needs to replentish the RX + * proper operation, the driver needs to replenish the RX * DMA ring 4 descriptors at a time (rather than one at a * time, like most chips). We can allocate the new buffers * but we should not set the OWN bits until we're ready @@ -1972,7 +1971,7 @@ vge_init_locked(struct vge_softc *sc) /* * Configure one-shot timer for microsecond - * resulution and load it for 500 usecs. + * resolution and load it for 500 usecs. */ CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); CSR_WRITE_2(sc, VGE_SSTIMER, 400); @@ -2262,7 +2261,7 @@ static void vge_stop(sc) struct vge_softc *sc; { - register int i; + int i; struct ifnet *ifp; VGE_LOCK_ASSERT(sc); From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:28:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D1210656C7; Fri, 8 Jan 2010 21:28:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9A08FC15; Fri, 8 Jan 2010 21:28:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LSAMO096187; Fri, 8 Jan 2010 21:28:10 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LSAkA096186; Fri, 8 Jan 2010 21:28:10 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082128.o08LSAkA096186@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 21:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201828 - in stable/7/sys: . cddl/contrib/opensolaris contrib/pf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:28:10 -0000 Author: brooks Date: Fri Jan 8 21:28:10 2010 New Revision: 201828 URL: http://svn.freebsd.org/changeset/base/201828 Log: MFC r201349: Ignore .glimpse_* files as generated by the glimpse target. Also ignore cscope.* files. Modified: Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:28:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B54910656C2; Fri, 8 Jan 2010 21:28:20 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51AE28FC20; Fri, 8 Jan 2010 21:28:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LSKFB096255; Fri, 8 Jan 2010 21:28:20 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LSK5t096254; Fri, 8 Jan 2010 21:28:20 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082128.o08LSK5t096254@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 21:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201829 - in stable/6/sys: . contrib/pf sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:28:20 -0000 Author: brooks Date: Fri Jan 8 21:28:20 2010 New Revision: 201829 URL: http://svn.freebsd.org/changeset/base/201829 Log: MFC r201349: Ignore .glimpse_* files as generated by the glimpse target. Also ignore cscope.* files. Modified: Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:37:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80E201065670; Fri, 8 Jan 2010 21:37:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E0A08FC1A; Fri, 8 Jan 2010 21:37:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LbGbC098421; Fri, 8 Jan 2010 21:37:16 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LbG5G098418; Fri, 8 Jan 2010 21:37:16 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082137.o08LbG5G098418@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201832 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:37:16 -0000 Author: yongari Date: Fri Jan 8 21:37:16 2010 New Revision: 201832 URL: http://svn.freebsd.org/changeset/base/201832 Log: MFC r200525: Overhaul bus_dma(9) usage and fix various things. o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag. o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA tag has different restriction compared to TX DMA tag. o Add 40bit DMA address support. o Adjust TX/RX descriptor ring alignment to 64 bytes from 256 bytes as documented in datasheet. o Added check to ensure TX/RX ring reside within a 4GB boundary. Since TX/RX ring shares the same high address register they should have the same high address. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Add lock assertion to vge_setmulti(). o Add RX spare DMA map to recover from DMA map load failure. o Add optimized RX buffer handler, vge_discard_rxbuf which is activated when vge(4) sees bad frames. o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet says the register should be updated only when number of available RX descriptors are multiple of 4. o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which is only set for i386 architecture. Previously vge(4) also performed expensive copy operation to align IP header on amd64. This change should give RX performance boost on amd64 architecture. o Don't reinitialize controller if driver is already running. This should reduce number of link state flipping. o Since vge(4) drops a driver lock before passing received frame to upper layer, make sure vge(4) is still running after re-acquiring driver lock. o Add second argument count to vge_rxeof(). The argument will limit number of packets could be processed in RX handler. o Rearrange vge_rxeof() not to allocate RX buffer if received frame was bad packet. o Removed if_printf that prints DMA map failure. This type of message shouldn't be used in fast path of driver. o Reduce number of allowed TX buffer fragments to 6 from 7. A TX descriptor allows 7 fragments of a frame. However the CMZ field of descriptor has just 3bits and the controller wants to see fragment + 1 in the field. So if we have 7 fragments the field value would be 0 which seems to cause unexpected results under certain conditions. This change should fix occasional TX hang observed on vge(4). o Simplify vge_stat_locked() and add number of available TX descriptor check. o vge(4) controllers lack padding short frames. Make sure to fill zero for the padded bytes. This closes unintended information disclosure. o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether this bit should be set by driver or write-back status bit after transmission. At least vendor's driver does not set this bit so remove it. Without this bit vge(4) still can send jumbo frames. o Don't start driver when vge(4) know there are not enough RX buffers. o Remove volatile keyword in RX descriptor structure. This should be handled by bus_dma(9). o Collapse two 16bits member of TX/RX descriptor into single 32bits member. o Reduce number of RX descriptors to 252 from 256. The VGE_RXDESCNUM is 16bits register but only lower 8bits are valid. So the maximum number of RX descriptors would be 255. However the number of should be multiple of 4 as controller wants to update 4 RX descriptors at a time. This limits the maximum number of RX descriptor to be 252. PR: kern/141276, kern/141414 Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgereg.h stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:35:03 2010 (r201831) +++ stable/8/sys/dev/vge/if_vge.c Fri Jan 8 21:37:16 2010 (r201832) @@ -140,22 +140,21 @@ static int vge_probe (device_t); static int vge_attach (device_t); static int vge_detach (device_t); -static int vge_encap (struct vge_softc *, struct mbuf *, int); +static int vge_encap (struct vge_softc *, struct mbuf **); -static void vge_dma_map_addr (void *, bus_dma_segment_t *, int, int); -static void vge_dma_map_rx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static void vge_dma_map_tx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static int vge_allocmem (device_t, struct vge_softc *); -static int vge_newbuf (struct vge_softc *, int, struct mbuf *); +static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); +static int vge_dma_alloc (struct vge_softc *); +static void vge_dma_free (struct vge_softc *); +static void vge_discard_rxbuf (struct vge_softc *, int); +static int vge_newbuf (struct vge_softc *, int); static int vge_rx_list_init (struct vge_softc *); static int vge_tx_list_init (struct vge_softc *); -#ifdef VGE_FIXUP_RX +static void vge_freebufs (struct vge_softc *); +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx (struct mbuf *); #endif -static int vge_rxeof (struct vge_softc *); +static int vge_rxeof (struct vge_softc *, int); static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); @@ -547,6 +546,8 @@ vge_setmulti(sc) struct ifmultiaddr *ifma; u_int32_t h, hashes[2] = { 0, 0 }; + VGE_LOCK_ASSERT(sc); + ifp = sc->vge_ifp; /* First, zot all the multicast entries. */ @@ -662,249 +663,326 @@ vge_probe(dev) return (ENXIO); } -static void -vge_dma_map_rx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - - struct vge_dmaload_arg *ctx; - struct vge_rx_desc *d = NULL; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* - * Map the segment array into descriptors. - */ - - d = &ctx->sc->vge_ldata.vge_rx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_RDSTS_OWN) { - device_printf(ctx->sc->vge_dev, - "tried to map busy descriptor\n"); - ctx->vge_maxsegs = 0; - return; - } - - d->vge_buflen = htole16(VGE_BUFLEN(segs[0].ds_len) | VGE_RXDESC_I); - d->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - d->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - d->vge_sts = 0; - d->vge_ctl = 0; - - ctx->vge_maxsegs = 1; - - return; -} - -static void -vge_dma_map_tx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - struct vge_dmaload_arg *ctx; - struct vge_tx_desc *d = NULL; - struct vge_tx_frag *f; - int i = 0; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* Map the segment array into descriptors. */ - - d = &ctx->sc->vge_ldata.vge_tx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_TDSTS_OWN) { - ctx->vge_maxsegs = 0; - return; - } - - for (i = 0; i < nseg; i++) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(segs[i].ds_len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[i].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[i].ds_addr) & 0xFFFF); - } - - /* Argh. This chip does not autopad short frames */ - - if (ctx->vge_m0->m_pkthdr.len < VGE_MIN_FRAMELEN) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(VGE_MIN_FRAMELEN - - ctx->vge_m0->m_pkthdr.len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - ctx->vge_m0->m_pkthdr.len = VGE_MIN_FRAMELEN; - i++; - } - - /* - * When telling the chip how many segments there are, we - * must use nsegs + 1 instead of just nsegs. Darned if I - * know why. - */ - i++; - - d->vge_sts = ctx->vge_m0->m_pkthdr.len << 16; - d->vge_ctl = ctx->vge_flags|(i << 28)|VGE_TD_LS_NORM; - - if (ctx->vge_m0->m_pkthdr.len > ETHERMTU + ETHER_HDR_LEN) - d->vge_ctl |= VGE_TDCTL_JUMBO; - - ctx->vge_maxsegs = nseg; - - return; -} - /* * Map a single buffer address. */ +struct vge_dmamap_arg { + bus_addr_t vge_busaddr; +}; + static void -vge_dma_map_addr(arg, segs, nseg, error) +vge_dmamap_cb(arg, segs, nsegs, error) void *arg; bus_dma_segment_t *segs; - int nseg; + int nsegs; int error; { - bus_addr_t *addr; + struct vge_dmamap_arg *ctx; - if (error) + if (error != 0) return; - KASSERT(nseg == 1, ("too many DMA segments, %d should be 1", nseg)); - addr = arg; - *addr = segs->ds_addr; + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - return; + ctx = (struct vge_dmamap_arg *)arg; + ctx->vge_busaddr = segs[0].ds_addr; } static int -vge_allocmem(dev, sc) - device_t dev; - struct vge_softc *sc; +vge_dma_alloc(sc) + struct vge_softc *sc; { - int error; - int nseg; - int i; - - /* - * Allocate map for RX mbufs. - */ - nseg = 32; - error = bus_dma_tag_create(sc->vge_parent_tag, ETHER_ALIGN, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * nseg, nseg, MCLBYTES, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_mtag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; + + lowaddr = BUS_SPACE_MAXADDR; + +again: + /* Create parent ring tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent DMA tag.\n"); + goto fail; } - /* - * Allocate map for TX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_tx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Tx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_TX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Tx ring DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the TX ring */ - - error = bus_dmamem_alloc(sc->vge_ldata.vge_tx_list_tag, - (void **)&sc->vge_ldata.vge_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_tx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_RX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Rx ring DMA tag.\n"); + goto fail; + } - /* Load the map for the TX ring. */ + /* Allocate DMA'able memory and load the DMA map for Tx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_tx_ring_tag, + (void **)&sc->vge_rdata.vge_tx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_tx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Tx ring.\n"); + goto fail; + } - error = bus_dmamap_load(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, sc->vge_ldata.vge_tx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_tx_list_addr, BUS_DMA_NOWAIT); + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, sc->vge_rdata.vge_tx_ring, + VGE_TX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Tx ring.\n"); + goto fail; + } + sc->vge_rdata.vge_tx_ring_paddr = ctx.vge_busaddr; - /* Create DMA maps for TX buffers */ + /* Allocate DMA'able memory and load the DMA map for Rx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_rx_ring_tag, + (void **)&sc->vge_rdata.vge_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_rx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Rx ring.\n"); + goto fail; + } - for (i = 0; i < VGE_TX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_tx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for TX\n"); - return (ENOMEM); - } + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, sc->vge_rdata.vge_rx_ring, + VGE_RX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Rx ring.\n"); + goto fail; } + sc->vge_rdata.vge_rx_ring_paddr = ctx.vge_busaddr; - /* - * Allocate map for RX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_rx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->vge_rdata.vge_tx_ring_paddr + VGE_TX_LIST_SZ; + rx_ring_end = sc->vge_rdata.vge_rx_ring_paddr + VGE_RX_LIST_SZ; + if ((VGE_ADDR_HI(tx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_tx_ring_paddr)) || + (VGE_ADDR_HI(rx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_rx_ring_paddr)) || + VGE_ADDR_HI(tx_ring_end) != VGE_ADDR_HI(rx_ring_end)) { + device_printf(sc->vge_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + vge_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + + /* Create parent buffer tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + VGE_BUF_DMA_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_buffer_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent buffer DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the RX ring */ + /* Create tag for Tx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * VGE_MAXTXSEGS, /* maxsize */ + VGE_MAXTXSEGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - error = bus_dmamem_alloc(sc->vge_ldata.vge_rx_list_tag, - (void **)&sc->vge_ldata.vge_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_rx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + VGE_RX_BUF_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Rx DMA tag.\n"); + goto fail; + } - /* Load the map for the RX ring. */ + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_tx_tag, 0, + &txd->tx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &sc->vge_cdata.vge_rx_sparemap)) != 0) { + device_printf(sc->vge_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &rxd->rx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Rx dmamap.\n"); + goto fail; + } + } - error = bus_dmamap_load(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, sc->vge_ldata.vge_rx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_rx_list_addr, BUS_DMA_NOWAIT); +fail: + return (error); +} - /* Create DMA maps for RX buffers */ +static void +vge_dma_free(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; - for (i = 0; i < VGE_RX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_rx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for RX\n"); - return (ENOMEM); + /* Tx ring. */ + if (sc->vge_cdata.vge_tx_ring_tag != NULL) { + if (sc->vge_cdata.vge_tx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map); + if (sc->vge_cdata.vge_tx_ring_map && + sc->vge_rdata.vge_tx_ring) + bus_dmamem_free(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_rdata.vge_tx_ring, + sc->vge_cdata.vge_tx_ring_map); + sc->vge_rdata.vge_tx_ring = NULL; + sc->vge_cdata.vge_tx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_ring_tag); + sc->vge_cdata.vge_tx_ring_tag = NULL; + } + /* Rx ring. */ + if (sc->vge_cdata.vge_rx_ring_tag != NULL) { + if (sc->vge_cdata.vge_rx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map); + if (sc->vge_cdata.vge_rx_ring_map && + sc->vge_rdata.vge_rx_ring) + bus_dmamem_free(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_rdata.vge_rx_ring, + sc->vge_cdata.vge_rx_ring_map); + sc->vge_rdata.vge_rx_ring = NULL; + sc->vge_cdata.vge_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_ring_tag); + sc->vge_cdata.vge_rx_ring_tag = NULL; + } + /* Tx buffers. */ + if (sc->vge_cdata.vge_tx_tag != NULL) { + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + txd->tx_dmamap = NULL; + } } + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_tag); + sc->vge_cdata.vge_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->vge_cdata.vge_rx_tag != NULL) { + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; + } + } + if (sc->vge_cdata.vge_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap); + sc->vge_cdata.vge_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_tag); + sc->vge_cdata.vge_rx_tag = NULL; + } + + if (sc->vge_cdata.vge_buffer_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_buffer_tag); + sc->vge_cdata.vge_buffer_tag = NULL; + } + if (sc->vge_cdata.vge_ring_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_ring_tag); + sc->vge_cdata.vge_ring_tag = NULL; } - - return (0); } /* @@ -961,25 +1039,7 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define VGE_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, VGE_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->vge_parent_tag); - if (error) - goto fail; - - error = vge_allocmem(dev, sc); - + error = vge_dma_alloc(sc); if (error) goto fail; @@ -1051,7 +1111,6 @@ vge_detach(dev) { struct vge_softc *sc; struct ifnet *ifp; - int i; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1084,97 +1143,93 @@ vge_detach(dev) if (ifp) if_free(ifp); - /* Unload and free the RX DMA ring memory and map */ + vge_dma_free(sc); + mtx_destroy(&sc->vge_mtx); - if (sc->vge_ldata.vge_rx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list, - sc->vge_ldata.vge_rx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_rx_list_tag); - } - - /* Unload and free the TX DMA ring memory and map */ - - if (sc->vge_ldata.vge_tx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list, - sc->vge_ldata.vge_tx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_tx_list_tag); - } - - /* Destroy all the RX and TX buffer maps */ - - if (sc->vge_ldata.vge_mtag) { - for (i = 0; i < VGE_TX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_tx_dmamap[i]); - for (i = 0; i < VGE_RX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[i]); - bus_dma_tag_destroy(sc->vge_ldata.vge_mtag); - } + return (0); +} - if (sc->vge_parent_tag) - bus_dma_tag_destroy(sc->vge_parent_tag); +static void +vge_discard_rxbuf(sc, prod) + struct vge_softc *sc; + int prod; +{ + struct vge_rxdesc *rxd; + int i; - mtx_destroy(&sc->vge_mtx); + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; - return (0); + /* + * Note: the manual fails to document the fact that for + * proper opration, the driver needs to replentish the RX + * DMA ring 4 descriptors at a time (rather than one at a + * time, like most chips). We can allocate the new buffers + * but we should not set the OWN bits until we're ready + * to hand back 4 of them in one shot. + */ + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; + } } static int -vge_newbuf(sc, idx, m) +vge_newbuf(sc, prod) struct vge_softc *sc; - int idx; - struct mbuf *m; + int prod; { - struct vge_dmaload_arg arg; - struct mbuf *n = NULL; - int i, error; - - if (m == NULL) { - n = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (n == NULL) - return (ENOBUFS); - m = n; - } else - m->m_data = m->m_ext.ext_buf; - - -#ifdef VGE_FIXUP_RX - /* - * This is part of an evil trick to deal with non-x86 platforms. - * The VIA chip requires RX buffers to be aligned on 32-bit - * boundaries, but that will hose non-x86 machines. To get around - * this, we leave some empty space at the start of each buffer - * and for non-x86 hosts, we copy the buffer back two bytes - * to achieve word alignment. This is slightly more efficient - * than allocating a new buffer, copying the contents, and - * discarding the old buffer. + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + /* + * This is part of an evil trick to deal with strict-alignment + * architectures. The VIA chip requires RX buffers to be aligned + * on 32-bit boundaries, but that will hose strict-alignment + * architectures. To get around this, we leave some empty space + * at the start of each buffer and for non-strict-alignment hosts, + * we copy the buffer back two bytes to achieve word alignment. + * This is slightly more efficient than allocating a new buffer, + * copying the contents, and discarding the old buffer. */ - m->m_len = m->m_pkthdr.len = MCLBYTES - VGE_ETHER_ALIGN; - m_adj(m, VGE_ETHER_ALIGN); -#else m->m_len = m->m_pkthdr.len = MCLBYTES; -#endif + m_adj(m, VGE_RX_BUF_ALIGN); - arg.sc = sc; - arg.vge_idx = idx; - arg.vge_maxsegs = 1; - arg.vge_flags = 0; - - error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], m, vge_dma_map_rx_desc, - &arg, BUS_DMA_NOWAIT); - if (error || arg.vge_maxsegs != 1) { - if (n != NULL) - m_freem(n); - return (ENOMEM); + if (bus_dmamap_load_mbuf_sg(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap, m, segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->vge_cdata.vge_rx_sparemap; + sc->vge_cdata.vge_rx_sparemap = map; + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; + rxd->rx_desc->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->vge_addrhi = htole32(VGE_ADDR_HI(segs[0].ds_addr) | + (VGE_BUFLEN(segs[0].ds_len) << 16) | VGE_RXDESC_I); /* * Note: the manual fails to document the fact that for @@ -1184,73 +1239,127 @@ vge_newbuf(sc, idx, m) * but we should not set the OWN bits until we're ready * to hand back 4 of them in one shot. */ - -#define VGE_RXCHUNK 4 - sc->vge_rx_consumed++; - if (sc->vge_rx_consumed == VGE_RXCHUNK) { - for (i = idx; i != idx - sc->vge_rx_consumed; i--) - sc->vge_ldata.vge_rx_list[i].vge_sts |= - htole32(VGE_RDSTS_OWN); - sc->vge_rx_consumed = 0; + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; } - sc->vge_ldata.vge_rx_mbuf[idx] = m; - - bus_dmamap_sync(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], - BUS_DMASYNC_PREREAD); - return (0); } static int vge_tx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { - bzero ((char *)sc->vge_ldata.vge_tx_list, VGE_TX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_tx_mbuf, - (VGE_TX_DESC_CNT * sizeof(struct mbuf *))); - - bus_dmamap_sync(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, BUS_DMASYNC_PREWRITE); - sc->vge_ldata.vge_tx_prodidx = 0; - sc->vge_ldata.vge_tx_considx = 0; - sc->vge_ldata.vge_tx_free = VGE_TX_DESC_CNT; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; + + VGE_LOCK_ASSERT(sc); + + sc->vge_cdata.vge_tx_prodidx = 0; + sc->vge_cdata.vge_tx_considx = 0; + sc->vge_cdata.vge_tx_cnt = 0; + + rd = &sc->vge_rdata; + bzero(rd->vge_tx_ring, VGE_TX_LIST_SZ); + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_desc = &rd->vge_tx_ring[i]; + } + + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } static int vge_rx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; int i; - bzero ((char *)sc->vge_ldata.vge_rx_list, VGE_RX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_rx_mbuf, - (VGE_RX_DESC_CNT * sizeof(struct mbuf *))); + VGE_LOCK_ASSERT(sc); - sc->vge_rx_consumed = 0; + sc->vge_cdata.vge_rx_prodidx = 0; + sc->vge_cdata.vge_head = NULL; + sc->vge_cdata.vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; + rd = &sc->vge_rdata; + bzero(rd->vge_rx_ring, VGE_RX_LIST_SZ); for (i = 0; i < VGE_RX_DESC_CNT; i++) { - if (vge_newbuf(sc, i, NULL) == ENOBUFS) + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_desc = &rd->vge_rx_ring[i]; + if (i == 0) + rxd->rxd_prev = + &sc->vge_cdata.vge_rxdesc[VGE_RX_DESC_CNT - 1]; + else + rxd->rxd_prev = &sc->vge_cdata.vge_rxdesc[i - 1]; + if (vge_newbuf(sc, i) != 0) return (ENOBUFS); } - /* Flush the RX descriptors */ + bus_dmamap_sync(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD); - - sc->vge_ldata.vge_rx_prodidx = 0; - sc->vge_rx_consumed = 0; - sc->vge_head = sc->vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; return (0); } -#ifdef VGE_FIXUP_RX +static void +vge_freebufs(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + /* + * Free RX and TX mbufs still in the queues. + */ + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; + } + } + + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + ifp->if_oerrors++; + } + } +} + +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx(m) struct mbuf *m; @@ -1265,8 +1374,6 @@ vge_fixup_rx(m) *dst++ = *src++; m->m_data -= ETHER_ALIGN; - - return; } #endif @@ -1275,49 +1382,39 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc) +vge_rxeof(sc, count) struct vge_softc *sc; + int count; { struct mbuf *m; struct ifnet *ifp; - int i, total_len; - int lim = 0; + int prod, prog, total_len; + struct vge_rxdesc *rxd; struct vge_rx_desc *cur_rx; - u_int32_t rxstat, rxctl; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - i = sc->vge_ldata.vge_rx_prodidx; - - /* Invalidate the descriptor memory */ - - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_POSTREAD); - - while (!VGE_OWN(&sc->vge_ldata.vge_rx_list[i])) { -#ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) - break; - sc->rxcycles--; - } -#endif + ifp = sc->vge_ifp; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:55:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67CDD106566B; Fri, 8 Jan 2010 21:55:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 553D98FC18; Fri, 8 Jan 2010 21:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LtijM002741; Fri, 8 Jan 2010 21:55:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LtiuX002738; Fri, 8 Jan 2010 21:55:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082155.o08LtiuX002738@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 21:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201834 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:55:44 -0000 Author: yongari Date: Fri Jan 8 21:55:44 2010 New Revision: 201834 URL: http://svn.freebsd.org/changeset/base/201834 Log: MFC r200525: Overhaul bus_dma(9) usage and fix various things. o Separate TX/RX buffer DMA tag from TX/RX descriptor ring DMA tag. o Separate RX buffer DMA tag from common buffer DMA tag. RX DMA tag has different restriction compared to TX DMA tag. o Add 40bit DMA address support. o Adjust TX/RX descriptor ring alignment to 64 bytes from 256 bytes as documented in datasheet. o Added check to ensure TX/RX ring reside within a 4GB boundary. Since TX/RX ring shares the same high address register they should have the same high address. o TX/RX side bus_dmamap_load_mbuf_sg(9) support. o Add lock assertion to vge_setmulti(). o Add RX spare DMA map to recover from DMA map load failure. o Add optimized RX buffer handler, vge_discard_rxbuf which is activated when vge(4) sees bad frames. o Don't blindly update VGE_RXDESC_RESIDUECNT register. Datasheet says the register should be updated only when number of available RX descriptors are multiple of 4. o Use __NO_STRICT_ALIGNMENT instead of defining VGE_FIXUP_RX which is only set for i386 architecture. Previously vge(4) also performed expensive copy operation to align IP header on amd64. This change should give RX performance boost on amd64 architecture. o Don't reinitialize controller if driver is already running. This should reduce number of link state flipping. o Since vge(4) drops a driver lock before passing received frame to upper layer, make sure vge(4) is still running after re-acquiring driver lock. o Add second argument count to vge_rxeof(). The argument will limit number of packets could be processed in RX handler. o Rearrange vge_rxeof() not to allocate RX buffer if received frame was bad packet. o Removed if_printf that prints DMA map failure. This type of message shouldn't be used in fast path of driver. o Reduce number of allowed TX buffer fragments to 6 from 7. A TX descriptor allows 7 fragments of a frame. However the CMZ field of descriptor has just 3bits and the controller wants to see fragment + 1 in the field. So if we have 7 fragments the field value would be 0 which seems to cause unexpected results under certain conditions. This change should fix occasional TX hang observed on vge(4). o Simplify vge_stat_locked() and add number of available TX descriptor check. o vge(4) controllers lack padding short frames. Make sure to fill zero for the padded bytes. This closes unintended information disclosure. o Don't set VGE_TDCTL_JUMBO flag. Datasheet is not clear whether this bit should be set by driver or write-back status bit after transmission. At least vendor's driver does not set this bit so remove it. Without this bit vge(4) still can send jumbo frames. o Don't start driver when vge(4) know there are not enough RX buffers. o Remove volatile keyword in RX descriptor structure. This should be handled by bus_dma(9). o Collapse two 16bits member of TX/RX descriptor into single 32bits member. o Reduce number of RX descriptors to 252 from 256. The VGE_RXDESCNUM is 16bits register but only lower 8bits are valid. So the maximum number of RX descriptors would be 255. However the number of should be multiple of 4 as controller wants to update 4 RX descriptors at a time. This limits the maximum number of RX descriptor to be 252. PR: kern/141276, kern/141414 Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgereg.h stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:42:00 2010 (r201833) +++ stable/7/sys/dev/vge/if_vge.c Fri Jan 8 21:55:44 2010 (r201834) @@ -140,22 +140,21 @@ static int vge_probe (device_t); static int vge_attach (device_t); static int vge_detach (device_t); -static int vge_encap (struct vge_softc *, struct mbuf *, int); +static int vge_encap (struct vge_softc *, struct mbuf **); -static void vge_dma_map_addr (void *, bus_dma_segment_t *, int, int); -static void vge_dma_map_rx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static void vge_dma_map_tx_desc (void *, bus_dma_segment_t *, int, - bus_size_t, int); -static int vge_allocmem (device_t, struct vge_softc *); -static int vge_newbuf (struct vge_softc *, int, struct mbuf *); +static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); +static int vge_dma_alloc (struct vge_softc *); +static void vge_dma_free (struct vge_softc *); +static void vge_discard_rxbuf (struct vge_softc *, int); +static int vge_newbuf (struct vge_softc *, int); static int vge_rx_list_init (struct vge_softc *); static int vge_tx_list_init (struct vge_softc *); -#ifdef VGE_FIXUP_RX +static void vge_freebufs (struct vge_softc *); +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx (struct mbuf *); #endif -static void vge_rxeof (struct vge_softc *); +static int vge_rxeof (struct vge_softc *, int); static void vge_txeof (struct vge_softc *); static void vge_intr (void *); static void vge_tick (void *); @@ -548,6 +547,8 @@ vge_setmulti(sc) struct ifmultiaddr *ifma; u_int32_t h, hashes[2] = { 0, 0 }; + VGE_LOCK_ASSERT(sc); + ifp = sc->vge_ifp; /* First, zot all the multicast entries. */ @@ -665,249 +666,326 @@ vge_probe(dev) return (ENXIO); } -static void -vge_dma_map_rx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - - struct vge_dmaload_arg *ctx; - struct vge_rx_desc *d = NULL; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* - * Map the segment array into descriptors. - */ - - d = &ctx->sc->vge_ldata.vge_rx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_RDSTS_OWN) { - device_printf(ctx->sc->vge_dev, - "tried to map busy descriptor\n"); - ctx->vge_maxsegs = 0; - return; - } - - d->vge_buflen = htole16(VGE_BUFLEN(segs[0].ds_len) | VGE_RXDESC_I); - d->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - d->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - d->vge_sts = 0; - d->vge_ctl = 0; - - ctx->vge_maxsegs = 1; - - return; -} - -static void -vge_dma_map_tx_desc(arg, segs, nseg, mapsize, error) - void *arg; - bus_dma_segment_t *segs; - int nseg; - bus_size_t mapsize; - int error; -{ - struct vge_dmaload_arg *ctx; - struct vge_tx_desc *d = NULL; - struct vge_tx_frag *f; - int i = 0; - - if (error) - return; - - ctx = arg; - - /* Signal error to caller if there's too many segments */ - if (nseg > ctx->vge_maxsegs) { - ctx->vge_maxsegs = 0; - return; - } - - /* Map the segment array into descriptors. */ - - d = &ctx->sc->vge_ldata.vge_tx_list[ctx->vge_idx]; - - /* If this descriptor is still owned by the chip, bail. */ - - if (le32toh(d->vge_sts) & VGE_TDSTS_OWN) { - ctx->vge_maxsegs = 0; - return; - } - - for (i = 0; i < nseg; i++) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(segs[i].ds_len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[i].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[i].ds_addr) & 0xFFFF); - } - - /* Argh. This chip does not autopad short frames */ - - if (ctx->vge_m0->m_pkthdr.len < VGE_MIN_FRAMELEN) { - f = &d->vge_frag[i]; - f->vge_buflen = htole16(VGE_BUFLEN(VGE_MIN_FRAMELEN - - ctx->vge_m0->m_pkthdr.len)); - f->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); - f->vge_addrhi = htole16(VGE_ADDR_HI(segs[0].ds_addr) & 0xFFFF); - ctx->vge_m0->m_pkthdr.len = VGE_MIN_FRAMELEN; - i++; - } - - /* - * When telling the chip how many segments there are, we - * must use nsegs + 1 instead of just nsegs. Darned if I - * know why. - */ - i++; - - d->vge_sts = ctx->vge_m0->m_pkthdr.len << 16; - d->vge_ctl = ctx->vge_flags|(i << 28)|VGE_TD_LS_NORM; - - if (ctx->vge_m0->m_pkthdr.len > ETHERMTU + ETHER_HDR_LEN) - d->vge_ctl |= VGE_TDCTL_JUMBO; - - ctx->vge_maxsegs = nseg; - - return; -} - /* * Map a single buffer address. */ +struct vge_dmamap_arg { + bus_addr_t vge_busaddr; +}; + static void -vge_dma_map_addr(arg, segs, nseg, error) +vge_dmamap_cb(arg, segs, nsegs, error) void *arg; bus_dma_segment_t *segs; - int nseg; + int nsegs; int error; { - bus_addr_t *addr; + struct vge_dmamap_arg *ctx; - if (error) + if (error != 0) return; - KASSERT(nseg == 1, ("too many DMA segments, %d should be 1", nseg)); - addr = arg; - *addr = segs->ds_addr; + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); - return; + ctx = (struct vge_dmamap_arg *)arg; + ctx->vge_busaddr = segs[0].ds_addr; } static int -vge_allocmem(dev, sc) - device_t dev; - struct vge_softc *sc; +vge_dma_alloc(sc) + struct vge_softc *sc; { - int error; - int nseg; - int i; - - /* - * Allocate map for RX mbufs. - */ - nseg = 32; - error = bus_dma_tag_create(sc->vge_parent_tag, ETHER_ALIGN, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, MCLBYTES * nseg, nseg, MCLBYTES, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_mtag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; + + lowaddr = BUS_SPACE_MAXADDR; + +again: + /* Create parent ring tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + lowaddr, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent DMA tag.\n"); + goto fail; } - /* - * Allocate map for TX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_tx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Create tag for Tx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_TX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_TX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_TX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Tx ring DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the TX ring */ - - error = bus_dmamem_alloc(sc->vge_ldata.vge_tx_list_tag, - (void **)&sc->vge_ldata.vge_tx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_tx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx ring. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_ring_tag,/* parent */ + VGE_RX_RING_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + VGE_RX_LIST_SZ, /* maxsize */ + 1, /* nsegments */ + VGE_RX_LIST_SZ, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_ring_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate Rx ring DMA tag.\n"); + goto fail; + } - /* Load the map for the TX ring. */ + /* Allocate DMA'able memory and load the DMA map for Tx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_tx_ring_tag, + (void **)&sc->vge_rdata.vge_tx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_tx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Tx ring.\n"); + goto fail; + } - error = bus_dmamap_load(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, sc->vge_ldata.vge_tx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_tx_list_addr, BUS_DMA_NOWAIT); + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, sc->vge_rdata.vge_tx_ring, + VGE_TX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Tx ring.\n"); + goto fail; + } + sc->vge_rdata.vge_tx_ring_paddr = ctx.vge_busaddr; - /* Create DMA maps for TX buffers */ + /* Allocate DMA'able memory and load the DMA map for Rx ring. */ + error = bus_dmamem_alloc(sc->vge_cdata.vge_rx_ring_tag, + (void **)&sc->vge_rdata.vge_rx_ring, + BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->vge_cdata.vge_rx_ring_map); + if (error != 0) { + device_printf(sc->vge_dev, + "could not allocate DMA'able memory for Rx ring.\n"); + goto fail; + } - for (i = 0; i < VGE_TX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_tx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for TX\n"); - return (ENOMEM); - } + ctx.vge_busaddr = 0; + error = bus_dmamap_load(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, sc->vge_rdata.vge_rx_ring, + VGE_RX_LIST_SZ, vge_dmamap_cb, &ctx, BUS_DMA_NOWAIT); + if (error != 0 || ctx.vge_busaddr == 0) { + device_printf(sc->vge_dev, + "could not load DMA'able memory for Rx ring.\n"); + goto fail; } + sc->vge_rdata.vge_rx_ring_paddr = ctx.vge_busaddr; - /* - * Allocate map for RX descriptor list. - */ - error = bus_dma_tag_create(sc->vge_parent_tag, VGE_RING_ALIGN, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, - NULL, VGE_TX_LIST_SZ, 1, VGE_TX_LIST_SZ, BUS_DMA_ALLOCNOW, - NULL, NULL, &sc->vge_ldata.vge_rx_list_tag); - if (error) { - device_printf(dev, "could not allocate dma tag\n"); - return (ENOMEM); + /* Tx/Rx descriptor queue should reside within 4GB boundary. */ + tx_ring_end = sc->vge_rdata.vge_tx_ring_paddr + VGE_TX_LIST_SZ; + rx_ring_end = sc->vge_rdata.vge_rx_ring_paddr + VGE_RX_LIST_SZ; + if ((VGE_ADDR_HI(tx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_tx_ring_paddr)) || + (VGE_ADDR_HI(rx_ring_end) != + VGE_ADDR_HI(sc->vge_rdata.vge_rx_ring_paddr)) || + VGE_ADDR_HI(tx_ring_end) != VGE_ADDR_HI(rx_ring_end)) { + device_printf(sc->vge_dev, "4GB boundary crossed, " + "switching to 32bit DMA address mode.\n"); + vge_dma_free(sc); + /* Limit DMA address space to 32bit and try again. */ + lowaddr = BUS_SPACE_MAXADDR_32BIT; + goto again; + } + + /* Create parent buffer tag. */ + error = bus_dma_tag_create(bus_get_dma_tag(sc->vge_dev),/* parent */ + 1, 0, /* algnmnt, boundary */ + VGE_BUF_DMA_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsize */ + 0, /* nsegments */ + BUS_SPACE_MAXSIZE_32BIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_buffer_tag); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create parent buffer DMA tag.\n"); + goto fail; } - /* Allocate DMA'able memory for the RX ring */ + /* Create tag for Tx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + 1, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES * VGE_MAXTXSEGS, /* maxsize */ + VGE_MAXTXSEGS, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_tx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Tx DMA tag.\n"); + goto fail; + } - error = bus_dmamem_alloc(sc->vge_ldata.vge_rx_list_tag, - (void **)&sc->vge_ldata.vge_rx_list, BUS_DMA_NOWAIT | BUS_DMA_ZERO, - &sc->vge_ldata.vge_rx_list_map); - if (error) - return (ENOMEM); + /* Create tag for Rx buffers. */ + error = bus_dma_tag_create(sc->vge_cdata.vge_buffer_tag,/* parent */ + VGE_RX_BUF_ALIGN, 0, /* algnmnt, boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MCLBYTES, /* maxsize */ + 1, /* nsegments */ + MCLBYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->vge_cdata.vge_rx_tag); + if (error != 0) { + device_printf(sc->vge_dev, "could not create Rx DMA tag.\n"); + goto fail; + } - /* Load the map for the RX ring. */ + /* Create DMA maps for Tx buffers. */ + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_tx_tag, 0, + &txd->tx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Tx dmamap.\n"); + goto fail; + } + } + /* Create DMA maps for Rx buffers. */ + if ((error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &sc->vge_cdata.vge_rx_sparemap)) != 0) { + device_printf(sc->vge_dev, + "could not create spare Rx dmamap.\n"); + goto fail; + } + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_dmamap = NULL; + error = bus_dmamap_create(sc->vge_cdata.vge_rx_tag, 0, + &rxd->rx_dmamap); + if (error != 0) { + device_printf(sc->vge_dev, + "could not create Rx dmamap.\n"); + goto fail; + } + } - error = bus_dmamap_load(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, sc->vge_ldata.vge_rx_list, - VGE_TX_LIST_SZ, vge_dma_map_addr, - &sc->vge_ldata.vge_rx_list_addr, BUS_DMA_NOWAIT); +fail: + return (error); +} - /* Create DMA maps for RX buffers */ +static void +vge_dma_free(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; - for (i = 0; i < VGE_RX_DESC_CNT; i++) { - error = bus_dmamap_create(sc->vge_ldata.vge_mtag, 0, - &sc->vge_ldata.vge_rx_dmamap[i]); - if (error) { - device_printf(dev, "can't create DMA map for RX\n"); - return (ENOMEM); + /* Tx ring. */ + if (sc->vge_cdata.vge_tx_ring_tag != NULL) { + if (sc->vge_cdata.vge_tx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map); + if (sc->vge_cdata.vge_tx_ring_map && + sc->vge_rdata.vge_tx_ring) + bus_dmamem_free(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_rdata.vge_tx_ring, + sc->vge_cdata.vge_tx_ring_map); + sc->vge_rdata.vge_tx_ring = NULL; + sc->vge_cdata.vge_tx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_ring_tag); + sc->vge_cdata.vge_tx_ring_tag = NULL; + } + /* Rx ring. */ + if (sc->vge_cdata.vge_rx_ring_tag != NULL) { + if (sc->vge_cdata.vge_rx_ring_map) + bus_dmamap_unload(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map); + if (sc->vge_cdata.vge_rx_ring_map && + sc->vge_rdata.vge_rx_ring) + bus_dmamem_free(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_rdata.vge_rx_ring, + sc->vge_cdata.vge_rx_ring_map); + sc->vge_rdata.vge_rx_ring = NULL; + sc->vge_cdata.vge_rx_ring_map = NULL; + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_ring_tag); + sc->vge_cdata.vge_rx_ring_tag = NULL; + } + /* Tx buffers. */ + if (sc->vge_cdata.vge_tx_tag != NULL) { + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + txd->tx_dmamap = NULL; + } } + bus_dma_tag_destroy(sc->vge_cdata.vge_tx_tag); + sc->vge_cdata.vge_tx_tag = NULL; + } + /* Rx buffers. */ + if (sc->vge_cdata.vge_rx_tag != NULL) { + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_dmamap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + rxd->rx_dmamap = NULL; + } + } + if (sc->vge_cdata.vge_rx_sparemap != NULL) { + bus_dmamap_destroy(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap); + sc->vge_cdata.vge_rx_sparemap = NULL; + } + bus_dma_tag_destroy(sc->vge_cdata.vge_rx_tag); + sc->vge_cdata.vge_rx_tag = NULL; + } + + if (sc->vge_cdata.vge_buffer_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_buffer_tag); + sc->vge_cdata.vge_buffer_tag = NULL; + } + if (sc->vge_cdata.vge_ring_tag != NULL) { + bus_dma_tag_destroy(sc->vge_cdata.vge_ring_tag); + sc->vge_cdata.vge_ring_tag = NULL; } - - return (0); } /* @@ -964,25 +1042,7 @@ vge_attach(dev) */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - /* - * Allocate the parent bus DMA tag appropriate for PCI. - */ -#define VGE_NSEG_NEW 32 - error = bus_dma_tag_create(NULL, /* parent */ - 1, 0, /* alignment, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - MAXBSIZE, VGE_NSEG_NEW, /* maxsize, nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->vge_parent_tag); - if (error) - goto fail; - - error = vge_allocmem(dev, sc); - + error = vge_dma_alloc(sc); if (error) goto fail; @@ -1054,7 +1114,6 @@ vge_detach(dev) { struct vge_softc *sc; struct ifnet *ifp; - int i; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1087,97 +1146,93 @@ vge_detach(dev) if (ifp) if_free(ifp); - /* Unload and free the RX DMA ring memory and map */ + vge_dma_free(sc); + mtx_destroy(&sc->vge_mtx); - if (sc->vge_ldata.vge_rx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list, - sc->vge_ldata.vge_rx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_rx_list_tag); - } - - /* Unload and free the TX DMA ring memory and map */ - - if (sc->vge_ldata.vge_tx_list_tag) { - bus_dmamap_unload(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map); - bus_dmamem_free(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list, - sc->vge_ldata.vge_tx_list_map); - bus_dma_tag_destroy(sc->vge_ldata.vge_tx_list_tag); - } - - /* Destroy all the RX and TX buffer maps */ - - if (sc->vge_ldata.vge_mtag) { - for (i = 0; i < VGE_TX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_tx_dmamap[i]); - for (i = 0; i < VGE_RX_DESC_CNT; i++) - bus_dmamap_destroy(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[i]); - bus_dma_tag_destroy(sc->vge_ldata.vge_mtag); - } + return (0); +} - if (sc->vge_parent_tag) - bus_dma_tag_destroy(sc->vge_parent_tag); +static void +vge_discard_rxbuf(sc, prod) + struct vge_softc *sc; + int prod; +{ + struct vge_rxdesc *rxd; + int i; - mtx_destroy(&sc->vge_mtx); + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; - return (0); + /* + * Note: the manual fails to document the fact that for + * proper opration, the driver needs to replentish the RX + * DMA ring 4 descriptors at a time (rather than one at a + * time, like most chips). We can allocate the new buffers + * but we should not set the OWN bits until we're ready + * to hand back 4 of them in one shot. + */ + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; + } } static int -vge_newbuf(sc, idx, m) +vge_newbuf(sc, prod) struct vge_softc *sc; - int idx; - struct mbuf *m; + int prod; { - struct vge_dmaload_arg arg; - struct mbuf *n = NULL; - int i, error; - - if (m == NULL) { - n = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); - if (n == NULL) - return (ENOBUFS); - m = n; - } else - m->m_data = m->m_ext.ext_buf; - - -#ifdef VGE_FIXUP_RX - /* - * This is part of an evil trick to deal with non-x86 platforms. - * The VIA chip requires RX buffers to be aligned on 32-bit - * boundaries, but that will hose non-x86 machines. To get around - * this, we leave some empty space at the start of each buffer - * and for non-x86 hosts, we copy the buffer back two bytes - * to achieve word alignment. This is slightly more efficient - * than allocating a new buffer, copying the contents, and - * discarding the old buffer. + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; + + m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (ENOBUFS); + /* + * This is part of an evil trick to deal with strict-alignment + * architectures. The VIA chip requires RX buffers to be aligned + * on 32-bit boundaries, but that will hose strict-alignment + * architectures. To get around this, we leave some empty space + * at the start of each buffer and for non-strict-alignment hosts, + * we copy the buffer back two bytes to achieve word alignment. + * This is slightly more efficient than allocating a new buffer, + * copying the contents, and discarding the old buffer. */ - m->m_len = m->m_pkthdr.len = MCLBYTES - VGE_ETHER_ALIGN; - m_adj(m, VGE_ETHER_ALIGN); -#else m->m_len = m->m_pkthdr.len = MCLBYTES; -#endif + m_adj(m, VGE_RX_BUF_ALIGN); - arg.sc = sc; - arg.vge_idx = idx; - arg.vge_maxsegs = 1; - arg.vge_flags = 0; - - error = bus_dmamap_load_mbuf(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], m, vge_dma_map_rx_desc, - &arg, BUS_DMA_NOWAIT); - if (error || arg.vge_maxsegs != 1) { - if (n != NULL) - m_freem(n); - return (ENOMEM); + if (bus_dmamap_load_mbuf_sg(sc->vge_cdata.vge_rx_tag, + sc->vge_cdata.vge_rx_sparemap, m, segs, &nsegs, 0) != 0) { + m_freem(m); + return (ENOBUFS); } + KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); + + rxd = &sc->vge_cdata.vge_rxdesc[prod]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap); + } + map = rxd->rx_dmamap; + rxd->rx_dmamap = sc->vge_cdata.vge_rx_sparemap; + sc->vge_cdata.vge_rx_sparemap = map; + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, rxd->rx_dmamap, + BUS_DMASYNC_PREREAD); + rxd->rx_m = m; + + rxd->rx_desc->vge_sts = 0; + rxd->rx_desc->vge_ctl = 0; + rxd->rx_desc->vge_addrlo = htole32(VGE_ADDR_LO(segs[0].ds_addr)); + rxd->rx_desc->vge_addrhi = htole32(VGE_ADDR_HI(segs[0].ds_addr) | + (VGE_BUFLEN(segs[0].ds_len) << 16) | VGE_RXDESC_I); /* * Note: the manual fails to document the fact that for @@ -1187,73 +1242,127 @@ vge_newbuf(sc, idx, m) * but we should not set the OWN bits until we're ready * to hand back 4 of them in one shot. */ - -#define VGE_RXCHUNK 4 - sc->vge_rx_consumed++; - if (sc->vge_rx_consumed == VGE_RXCHUNK) { - for (i = idx; i != idx - sc->vge_rx_consumed; i--) - sc->vge_ldata.vge_rx_list[i].vge_sts |= - htole32(VGE_RDSTS_OWN); - sc->vge_rx_consumed = 0; + if ((prod % VGE_RXCHUNK) == (VGE_RXCHUNK - 1)) { + for (i = VGE_RXCHUNK; i > 0; i--) { + rxd->rx_desc->vge_sts = htole32(VGE_RDSTS_OWN); + rxd = rxd->rxd_prev; + } + sc->vge_cdata.vge_rx_commit += VGE_RXCHUNK; } - sc->vge_ldata.vge_rx_mbuf[idx] = m; - - bus_dmamap_sync(sc->vge_ldata.vge_mtag, - sc->vge_ldata.vge_rx_dmamap[idx], - BUS_DMASYNC_PREREAD); - return (0); } static int vge_tx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { - bzero ((char *)sc->vge_ldata.vge_tx_list, VGE_TX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_tx_mbuf, - (VGE_TX_DESC_CNT * sizeof(struct mbuf *))); - - bus_dmamap_sync(sc->vge_ldata.vge_tx_list_tag, - sc->vge_ldata.vge_tx_list_map, BUS_DMASYNC_PREWRITE); - sc->vge_ldata.vge_tx_prodidx = 0; - sc->vge_ldata.vge_tx_considx = 0; - sc->vge_ldata.vge_tx_free = VGE_TX_DESC_CNT; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; + + VGE_LOCK_ASSERT(sc); + + sc->vge_cdata.vge_tx_prodidx = 0; + sc->vge_cdata.vge_tx_considx = 0; + sc->vge_cdata.vge_tx_cnt = 0; + + rd = &sc->vge_rdata; + bzero(rd->vge_tx_ring, VGE_TX_LIST_SZ); + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + txd->tx_m = NULL; + txd->tx_desc = &rd->vge_tx_ring[i]; + } + + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); } static int vge_rx_list_init(sc) - struct vge_softc *sc; + struct vge_softc *sc; { + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; int i; - bzero ((char *)sc->vge_ldata.vge_rx_list, VGE_RX_LIST_SZ); - bzero ((char *)&sc->vge_ldata.vge_rx_mbuf, - (VGE_RX_DESC_CNT * sizeof(struct mbuf *))); + VGE_LOCK_ASSERT(sc); - sc->vge_rx_consumed = 0; + sc->vge_cdata.vge_rx_prodidx = 0; + sc->vge_cdata.vge_head = NULL; + sc->vge_cdata.vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; + rd = &sc->vge_rdata; + bzero(rd->vge_rx_ring, VGE_RX_LIST_SZ); for (i = 0; i < VGE_RX_DESC_CNT; i++) { - if (vge_newbuf(sc, i, NULL) == ENOBUFS) + rxd = &sc->vge_cdata.vge_rxdesc[i]; + rxd->rx_m = NULL; + rxd->rx_desc = &rd->vge_rx_ring[i]; + if (i == 0) + rxd->rxd_prev = + &sc->vge_cdata.vge_rxdesc[VGE_RX_DESC_CNT - 1]; + else + rxd->rxd_prev = &sc->vge_cdata.vge_rxdesc[i - 1]; + if (vge_newbuf(sc, i) != 0) return (ENOBUFS); } - /* Flush the RX descriptors */ + bus_dmamap_sync(sc->vge_cdata.vge_rx_ring_tag, + sc->vge_cdata.vge_rx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD); - - sc->vge_ldata.vge_rx_prodidx = 0; - sc->vge_rx_consumed = 0; - sc->vge_head = sc->vge_tail = NULL; + sc->vge_cdata.vge_rx_commit = 0; return (0); } -#ifdef VGE_FIXUP_RX +static void +vge_freebufs(sc) + struct vge_softc *sc; +{ + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + /* + * Free RX and TX mbufs still in the queues. + */ + for (i = 0; i < VGE_RX_DESC_CNT; i++) { + rxd = &sc->vge_cdata.vge_rxdesc[i]; + if (rxd->rx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->vge_cdata.vge_rx_tag, + rxd->rx_dmamap); + m_freem(rxd->rx_m); + rxd->rx_m = NULL; + } + } + + for (i = 0; i < VGE_TX_DESC_CNT; i++) { + txd = &sc->vge_cdata.vge_txdesc[i]; + if (txd->tx_m != NULL) { + bus_dmamap_sync(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap, BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(sc->vge_cdata.vge_tx_tag, + txd->tx_dmamap); + m_freem(txd->tx_m); + txd->tx_m = NULL; + ifp->if_oerrors++; + } + } +} + +#ifndef __NO_STRICT_ALIGNMENT static __inline void vge_fixup_rx(m) struct mbuf *m; @@ -1268,8 +1377,6 @@ vge_fixup_rx(m) *dst++ = *src++; m->m_data -= ETHER_ALIGN; - - return; } #endif @@ -1277,50 +1384,40 @@ vge_fixup_rx(m) * RX handler. We support the reception of jumbo frames that have * been fragmented across multiple 2K mbuf cluster buffers. */ -static void -vge_rxeof(sc) +static int +vge_rxeof(sc, count) struct vge_softc *sc; + int count; { struct mbuf *m; struct ifnet *ifp; - int i, total_len; - int lim = 0; + int prod, prog, total_len; + struct vge_rxdesc *rxd; struct vge_rx_desc *cur_rx; - u_int32_t rxstat, rxctl; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - i = sc->vge_ldata.vge_rx_prodidx; - - /* Invalidate the descriptor memory */ - - bus_dmamap_sync(sc->vge_ldata.vge_rx_list_tag, - sc->vge_ldata.vge_rx_list_map, - BUS_DMASYNC_POSTREAD); - - while (!VGE_OWN(&sc->vge_ldata.vge_rx_list[i])) { -#ifdef DEVICE_POLLING - if (ifp->if_capenable & IFCAP_POLLING) { - if (sc->rxcycles <= 0) - break; - sc->rxcycles--; - } -#endif *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 21:58:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD3C106568B; Fri, 8 Jan 2010 21:58:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE30E8FC15; Fri, 8 Jan 2010 21:58:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08LwCS8003301; Fri, 8 Jan 2010 21:58:12 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08LwCjc003299; Fri, 8 Jan 2010 21:58:12 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082158.o08LwCjc003299@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 21:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201835 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 21:58:13 -0000 Author: brooks Date: Fri Jan 8 21:58:12 2010 New Revision: 201835 URL: http://svn.freebsd.org/changeset/base/201835 Log: MFC r201352 If a filter has already been added, actually return EEXIST when trying at add it again. Modified: stable/8/sys/kern/kern_event.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_event.c ============================================================================== --- stable/8/sys/kern/kern_event.c Fri Jan 8 21:55:44 2010 (r201834) +++ stable/8/sys/kern/kern_event.c Fri Jan 8 21:58:12 2010 (r201835) @@ -852,6 +852,7 @@ kqueue_add_filteropts(int filt, struct f { int error; + error = 0; if (filt > 0 || filt + EVFILT_SYSCOUNT < 0) { printf( "trying to add a filterop that is out of range: %d is beyond %d\n", @@ -868,7 +869,7 @@ kqueue_add_filteropts(int filt, struct f } mtx_unlock(&filterops_lock); - return (0); + return (error); } int From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:02:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28CC110656E2; Fri, 8 Jan 2010 22:02:43 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 182D68FC1A; Fri, 8 Jan 2010 22:02:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08M2g17004450; Fri, 8 Jan 2010 22:02:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08M2glH004448; Fri, 8 Jan 2010 22:02:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001082202.o08M2glH004448@svn.freebsd.org> From: Christian Brueffer Date: Fri, 8 Jan 2010 22:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201836 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:02:43 -0000 Author: brueffer Date: Fri Jan 8 22:02:42 2010 New Revision: 201836 URL: http://svn.freebsd.org/changeset/base/201836 Log: Remove unnecessary quoting and markup, add missing punctuation. PR: 140494 Submitted by: Jeremy Huddleston , bde MFC after: 1 week Modified: head/lib/libc/stdio/getc.3 Modified: head/lib/libc/stdio/getc.3 ============================================================================== --- head/lib/libc/stdio/getc.3 Fri Jan 8 21:58:12 2010 (r201835) +++ head/lib/libc/stdio/getc.3 Fri Jan 8 22:02:42 2010 (r201836) @@ -56,7 +56,7 @@ .Ft int .Fn getchar void .Ft int -.Fn getchar_unlocked "void" +.Fn getchar_unlocked void .Ft int .Fn getw "FILE *stream" .Sh DESCRIPTION @@ -141,7 +141,7 @@ until the condition is cleared with .Sh STANDARDS The .Fn fgetc , -.Fn getc +.Fn getc , and .Fn getchar functions @@ -167,4 +167,3 @@ The size and byte order of an varies from one machine to another, and .Fn getw is not recommended for portable applications. -.Pp From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:07:29 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC98106568D; Fri, 8 Jan 2010 22:07:29 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id D26658FC1E; Fri, 8 Jan 2010 22:07:28 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 1621A151592; Fri, 8 Jan 2010 23:48:22 +0200 (EET) Date: Fri, 8 Jan 2010 23:48:21 +0200 From: Jaakko Heinonen To: Bruce Evans Message-ID: <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> References: <201001080757.o087vhrr009799@svn.freebsd.org> <20100109051536.R57595@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100109051536.R57595@delplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201773 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:07:29 -0000 Thank you for looking at this. On 2010-01-09, Bruce Evans wrote: > The current incorrect way is to use %d. Since ino_t happens to have > type uint32_t and u_int happens to have type uint32_t on all supported > machines, %u would work but %d gives undefined behaviour when the > value exceeds INT_MAX. > > The simplest fix is to use u_int and %u. > > > + u_quad_t size_max; > > Even larger indentation error, as above. Does following patch look reasonable? - Fix style bugs introduced in r201773. - Change the type of nodes_max to u_int and use "%u" format string to convert its value. %%% Index: sys/fs/tmpfs/tmpfs_vfsops.c =================================================================== --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 201818) +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) @@ -185,8 +185,8 @@ tmpfs_mount(struct mount *mp) ino_t nodes; int error; /* Size counters. */ - ino_t nodes_max; - u_quad_t size_max; + u_int nodes_max; + u_quad_t size_max; /* Root node attributes. */ uid_t root_uid; @@ -223,7 +223,7 @@ tmpfs_mount(struct mount *mp) if (mp->mnt_cred->cr_ruid != 0 || vfs_scanopt(mp->mnt_optnew, "mode", "%ho", &root_mode) != 1) root_mode = va.va_mode; - if (vfs_scanopt(mp->mnt_optnew, "inodes", "%d", &nodes_max) != 1) + if (vfs_scanopt(mp->mnt_optnew, "inodes", "%u", &nodes_max) != 1) nodes_max = 0; if (vfs_scanopt(mp->mnt_optnew, "size", "%qu", &size_max) != 1) size_max = 0; @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) * allowed to use, based on the maximum size the user passed in * the mount structure. A value of zero is treated as if the * maximum available space was requested. */ - if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) + if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE) pages = SIZE_MAX; else pages = howmany(size_max, PAGE_SIZE); %%% -- Jaakko From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:08:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE9B6106568D; Fri, 8 Jan 2010 22:08:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC5D88FC1D; Fri, 8 Jan 2010 22:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08M8I4c005730; Fri, 8 Jan 2010 22:08:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08M8IFV005726; Fri, 8 Jan 2010 22:08:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082208.o08M8IFV005726@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 22:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201837 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:08:19 -0000 Author: yongari Date: Fri Jan 8 22:08:18 2010 New Revision: 201837 URL: http://svn.freebsd.org/changeset/base/201837 Log: MFC r200526-200527,200529,200531-200533,200536 r200526: Use PCIR_BAR instead of hard-coded value. r200527: Fix typo in register definition. r200529: Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit seems to work like a tag that indicates 'not list end' of queued frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So the last frame of multiple queued frames has no VGE_TXDESC_Q bit. The hardware has peculiar behavior for VGE_TXDESC_Q bit handling. If the VGE_TXDESC_Q bit of descriptor was set the controller would fetch next descriptor. However if next descriptor's OWN bit was cleared but VGE_TXDESC_Q was set, it could confuse controller. Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct behavior. r200531: Use ANSI function definations. r200532: Remove unnecessary return statement. r200533: s/u_intXX_t/uintXX_t/g r200536: style(9). Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgereg.h stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Fri Jan 8 22:02:42 2010 (r201836) +++ stable/8/sys/dev/vge/if_vge.c Fri Jan 8 22:08:18 2010 (r201837) @@ -172,7 +172,7 @@ static int vge_ifmedia_upd (struct ifnet static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, u_int16_t *); +static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); #endif static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); @@ -187,9 +187,6 @@ static int vge_cam_set (struct vge_soft static void vge_setmulti (struct vge_softc *); static void vge_reset (struct vge_softc *); -#define VGE_PCI_LOIO 0x10 -#define VGE_PCI_LOMEM 0x14 - static device_method_t vge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vge_probe), @@ -227,13 +224,10 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(sc, addr, dest) - struct vge_softc *sc; - int addr; - u_int16_t *dest; +vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { - int i; - u_int16_t word = 0; + int i; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -269,8 +263,6 @@ vge_eeprom_getword(sc, addr, dest) CSR_CLRBIT_1(sc, VGE_CHIPCFG2, VGE_CHIPCFG2_EELOAD); *dest = word; - - return; } #endif @@ -278,20 +270,15 @@ vge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -vge_read_eeprom(sc, dest, off, cnt, swap) - struct vge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int i; + int i; #ifdef VGE_EEPROM - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -304,10 +291,9 @@ vge_read_eeprom(sc, dest, off, cnt, swap } static void -vge_miipoll_stop(sc) - struct vge_softc *sc; +vge_miipoll_stop(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_MIICMD, 0); @@ -319,15 +305,12 @@ vge_miipoll_stop(sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to idle MII autopoll\n"); - - return; } static void -vge_miipoll_start(sc) - struct vge_softc *sc; +vge_miipoll_start(struct vge_softc *sc) { - int i; + int i; /* First, make sure we're idle. */ @@ -359,23 +342,19 @@ vge_miipoll_start(sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to start MII autopoll\n"); - - return; } static int -vge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; -{ - struct vge_softc *sc; - int i; - u_int16_t rval = 0; +vge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct vge_softc *sc; + int i; + uint16_t rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -403,17 +382,15 @@ vge_miibus_readreg(dev, phy, reg) } static int -vge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +vge_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct vge_softc *sc; - int i, rval = 0; + struct vge_softc *sc; + int i, rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -444,10 +421,9 @@ vge_miibus_writereg(dev, phy, reg, data) } static void -vge_cam_clear(sc) - struct vge_softc *sc; +vge_cam_clear(struct vge_softc *sc) { - int i; + int i; /* * Turn off all the mask bits. This tells the chip @@ -472,19 +448,15 @@ vge_cam_clear(sc) CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); sc->vge_camidx = 0; - - return; } static int -vge_cam_set(sc, addr) - struct vge_softc *sc; - uint8_t *addr; +vge_cam_set(struct vge_softc *sc, uint8_t *addr) { - int i, error = 0; + int i, error = 0; if (sc->vge_camidx == VGE_CAM_MAXADDRS) - return(ENOSPC); + return (ENOSPC); /* Select the CAM data page. */ CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); @@ -538,13 +510,12 @@ fail: * we use the hash filter instead. */ static void -vge_setmulti(sc) - struct vge_softc *sc; +vge_setmulti(struct vge_softc *sc) { - struct ifnet *ifp; - int error = 0/*, h = 0*/; - struct ifmultiaddr *ifma; - u_int32_t h, hashes[2] = { 0, 0 }; + struct ifnet *ifp; + int error = 0/*, h = 0*/; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -595,15 +566,12 @@ vge_setmulti(sc) CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); - - return; } static void -vge_reset(sc) - struct vge_softc *sc; +vge_reset(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -635,8 +603,6 @@ vge_reset(sc) } CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); - - return; } /* @@ -644,10 +610,9 @@ vge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -vge_probe(dev) - device_t dev; +vge_probe(device_t dev) { - struct vge_type *t; + struct vge_type *t; t = vge_devs; @@ -672,13 +637,9 @@ struct vge_dmamap_arg { }; static void -vge_dmamap_cb(arg, segs, nsegs, error) - void *arg; - bus_dma_segment_t *segs; - int nsegs; - int error; +vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - struct vge_dmamap_arg *ctx; + struct vge_dmamap_arg *ctx; if (error != 0) return; @@ -690,14 +651,13 @@ vge_dmamap_cb(arg, segs, nsegs, error) } static int -vge_dma_alloc(sc) - struct vge_softc *sc; +vge_dma_alloc(struct vge_softc *sc) { - struct vge_dmamap_arg ctx; - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - bus_addr_t lowaddr, tx_ring_end, rx_ring_end; - int error, i; + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; lowaddr = BUS_SPACE_MAXADDR; @@ -906,12 +866,11 @@ fail: } static void -vge_dma_free(sc) - struct vge_softc *sc; +vge_dma_free(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; /* Tx ring. */ if (sc->vge_cdata.vge_tx_ring_tag != NULL) { @@ -990,13 +949,12 @@ vge_dma_free(sc) * setup and ethernet/BPF attach. */ static int -vge_attach(dev) - device_t dev; +vge_attach(device_t dev) { - u_char eaddr[ETHER_ADDR_LEN]; - struct vge_softc *sc; - struct ifnet *ifp; - int error = 0, rid; + u_char eaddr[ETHER_ADDR_LEN]; + struct vge_softc *sc; + struct ifnet *ifp; + int error = 0, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1010,7 +968,7 @@ vge_attach(dev) */ pci_enable_busmaster(dev); - rid = VGE_PCI_LOMEM; + rid = PCIR_BAR(1); sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1106,11 +1064,10 @@ fail: * allocated. */ static int -vge_detach(dev) - device_t dev; +vge_detach(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1139,7 +1096,7 @@ vge_detach(dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, - VGE_PCI_LOMEM, sc->vge_res); + PCIR_BAR(1), sc->vge_res); if (ifp) if_free(ifp); @@ -1150,12 +1107,10 @@ vge_detach(dev) } static void -vge_discard_rxbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_discard_rxbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - int i; + struct vge_rxdesc *rxd; + int i; rxd = &sc->vge_cdata.vge_rxdesc[prod]; rxd->rx_desc->vge_sts = 0; @@ -1179,15 +1134,13 @@ vge_discard_rxbuf(sc, prod) } static int -vge_newbuf(sc, prod) - struct vge_softc *sc; - int prod; -{ - struct vge_rxdesc *rxd; - struct mbuf *m; - bus_dma_segment_t segs[1]; - bus_dmamap_t map; - int i, nsegs; +vge_newbuf(struct vge_softc *sc, int prod) +{ + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1251,12 +1204,11 @@ vge_newbuf(sc, prod) } static int -vge_tx_list_init(sc) - struct vge_softc *sc; +vge_tx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_txdesc *txd; - int i; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; VGE_LOCK_ASSERT(sc); @@ -1280,12 +1232,11 @@ vge_tx_list_init(sc) } static int -vge_rx_list_init(sc) - struct vge_softc *sc; +vge_rx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_rxdesc *rxd; - int i; + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; + int i; VGE_LOCK_ASSERT(sc); @@ -1319,13 +1270,12 @@ vge_rx_list_init(sc) } static void -vge_freebufs(sc) - struct vge_softc *sc; +vge_freebufs(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - struct ifnet *ifp; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; VGE_LOCK_ASSERT(sc); @@ -1361,11 +1311,10 @@ vge_freebufs(sc) #ifndef __NO_STRICT_ALIGNMENT static __inline void -vge_fixup_rx(m) - struct mbuf *m; +vge_fixup_rx(struct mbuf *m) { - int i; - uint16_t *src, *dst; + int i; + uint16_t *src, *dst; src = mtod(m, uint16_t *); dst = src - 1; @@ -1382,16 +1331,14 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc, count) - struct vge_softc *sc; - int count; -{ - struct mbuf *m; - struct ifnet *ifp; - int prod, prog, total_len; - struct vge_rxdesc *rxd; - struct vge_rx_desc *cur_rx; - uint32_t rxstat, rxctl; +vge_rxeof(struct vge_softc *sc, int count) +{ + struct mbuf *m; + struct ifnet *ifp; + int prod, prog, total_len; + struct vge_rxdesc *rxd; + struct vge_rx_desc *cur_rx; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); @@ -1556,14 +1503,13 @@ vge_rxeof(sc, count) } static void -vge_txeof(sc) - struct vge_softc *sc; +vge_txeof(struct vge_softc *sc) { - struct ifnet *ifp; - struct vge_tx_desc *cur_tx; - struct vge_txdesc *txd; - uint32_t txstat; - int cons, prod; + struct ifnet *ifp; + struct vge_tx_desc *cur_tx; + struct vge_txdesc *txd; + uint32_t txstat; + int cons, prod; VGE_LOCK_ASSERT(sc); @@ -1599,8 +1545,11 @@ vge_txeof(sc) __func__)); m_freem(txd->tx_m); txd->tx_m = NULL; + txd->tx_desc->vge_frag[0].vge_addrhi = 0; } - + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; @@ -1616,12 +1565,11 @@ vge_txeof(sc) } static void -vge_tick(xsc) - void *xsc; +vge_tick(void *xsc) { - struct vge_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct vge_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; ifp = sc->vge_ifp; @@ -1645,8 +1593,6 @@ vge_tick(xsc) vge_start_locked(ifp); } } - - return; } #ifdef DEVICE_POLLING @@ -1667,7 +1613,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ - u_int32_t status; + uint32_t status; status = CSR_READ_4(sc, VGE_ISR); if (status == 0xFFFFFFFF) goto done; @@ -1698,12 +1644,11 @@ done: #endif /* DEVICE_POLLING */ static void -vge_intr(arg) - void *arg; +vge_intr(void *arg) { - struct vge_softc *sc; - struct ifnet *ifp; - u_int32_t status; + struct vge_softc *sc; + struct ifnet *ifp; + uint32_t status; sc = arg; @@ -1770,21 +1715,17 @@ vge_intr(arg) vge_start_locked(ifp); VGE_UNLOCK(sc); - - return; } static int -vge_encap(sc, m_head) - struct vge_softc *sc; - struct mbuf **m_head; -{ - struct vge_txdesc *txd; - struct vge_tx_frag *frag; - struct mbuf *m; - bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; - int error, i, nsegs, padlen; - uint32_t cflags; +vge_encap(struct vge_softc *sc, struct mbuf **m_head) +{ + struct vge_txdesc *txd; + struct vge_tx_frag *frag; + struct mbuf *m; + bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; + int error, i, nsegs, padlen; + uint32_t cflags; VGE_LOCK_ASSERT(sc); @@ -1904,10 +1845,9 @@ vge_encap(sc, m_head) */ static void -vge_start(ifp) - struct ifnet *ifp; +vge_start(struct ifnet *ifp) { - struct vge_softc *sc; + struct vge_softc *sc; sc = ifp->if_softc; VGE_LOCK(sc); @@ -1917,13 +1857,12 @@ vge_start(ifp) static void -vge_start_locked(ifp) - struct ifnet *ifp; +vge_start_locked(struct ifnet *ifp) { - struct vge_softc *sc; - struct vge_txdesc *txd; - struct mbuf *m_head; - int enq, idx; + struct vge_softc *sc; + struct vge_txdesc *txd; + struct mbuf *m_head; + int enq, idx; sc = ifp->if_softc; @@ -1991,10 +1930,9 @@ vge_start_locked(ifp) } static void -vge_init(xsc) - void *xsc; +vge_init(void *xsc) { - struct vge_softc *sc = xsc; + struct vge_softc *sc = xsc; VGE_LOCK(sc); vge_init_locked(sc); @@ -2004,9 +1942,9 @@ vge_init(xsc) static void vge_init_locked(struct vge_softc *sc) { - struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; - int error, i; + struct ifnet *ifp = sc->vge_ifp; + struct mii_data *mii; + int error, i; VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); @@ -2182,11 +2120,10 @@ vge_init_locked(struct vge_softc *sc) * Set media options. */ static int -vge_ifmedia_upd(ifp) - struct ifnet *ifp; +vge_ifmedia_upd(struct ifnet *ifp) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; VGE_LOCK(sc); @@ -2201,12 +2138,10 @@ vge_ifmedia_upd(ifp) * Report current media status. */ static void -vge_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); @@ -2216,17 +2151,14 @@ vge_ifmedia_sts(ifp, ifmr) VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - - return; } static void -vge_miibus_statchg(dev) - device_t dev; +vge_miibus_statchg(device_t dev) { - struct vge_softc *sc; - struct mii_data *mii; - struct ifmedia_entry *ife; + struct vge_softc *sc; + struct mii_data *mii; + struct ifmedia_entry *ife; sc = device_get_softc(dev); mii = device_get_softc(sc->vge_miibus); @@ -2266,20 +2198,15 @@ vge_miibus_statchg(dev) IFM_SUBTYPE(ife->ifm_media)); break; } - - return; } static int -vge_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; -{ - struct vge_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *) data; - struct mii_data *mii; - int error = 0; +vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct vge_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *) data; + struct mii_data *mii; + int error = 0; switch (command) { case SIOCSIFMTU: @@ -2331,7 +2258,7 @@ vge_ioctl(ifp, command, data) if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(vge_poll, ifp); if (error) - return(error); + return (error); VGE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, VGE_IMR, 0); @@ -2394,8 +2321,6 @@ vge_watchdog(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); - - return; } /* @@ -2403,10 +2328,9 @@ vge_watchdog(void *arg) * RX and TX lists. */ static void -vge_stop(sc) - struct vge_softc *sc; +vge_stop(struct vge_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; @@ -2433,10 +2357,9 @@ vge_stop(sc) * resume. */ static int -vge_suspend(dev) - device_t dev; +vge_suspend(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); @@ -2455,11 +2378,10 @@ vge_suspend(dev) * appropriate. */ static int -vge_resume(dev) - device_t dev; +vge_resume(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); ifp = sc->vge_ifp; @@ -2485,10 +2407,9 @@ vge_resume(dev) * get confused by errant DMAs when rebooting. */ static int -vge_shutdown(dev) - device_t dev; +vge_shutdown(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); Modified: stable/8/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/8/sys/dev/vge/if_vgereg.h Fri Jan 8 22:02:42 2010 (r201836) +++ stable/8/sys/dev/vge/if_vgereg.h Fri Jan 8 22:08:18 2010 (r201837) @@ -339,19 +339,19 @@ #define VGE_TXQCSR_RUN0 0x0001 /* Enable TX queue 0 */ #define VGE_TXQCSR_ACT0 0x0002 /* queue 0 active indicator */ #define VGE_TXQCSR_WAK0 0x0004 /* Wake up (poll) queue 0 */ -#define VGE_TXQCST_DEAD0 0x0008 /* queue 0 dead indicator */ +#define VGE_TXQCSR_DEAD0 0x0008 /* queue 0 dead indicator */ #define VGE_TXQCSR_RUN1 0x0010 /* Enable TX queue 1 */ #define VGE_TXQCSR_ACT1 0x0020 /* queue 1 active indicator */ #define VGE_TXQCSR_WAK1 0x0040 /* Wake up (poll) queue 1 */ -#define VGE_TXQCST_DEAD1 0x0080 /* queue 1 dead indicator */ +#define VGE_TXQCSR_DEAD1 0x0080 /* queue 1 dead indicator */ #define VGE_TXQCSR_RUN2 0x0100 /* Enable TX queue 2 */ #define VGE_TXQCSR_ACT2 0x0200 /* queue 2 active indicator */ #define VGE_TXQCSR_WAK2 0x0400 /* Wake up (poll) queue 2 */ -#define VGE_TXQCST_DEAD2 0x0800 /* queue 2 dead indicator */ +#define VGE_TXQCSR_DEAD2 0x0800 /* queue 2 dead indicator */ #define VGE_TXQCSR_RUN3 0x1000 /* Enable TX queue 3 */ #define VGE_TXQCSR_ACT3 0x2000 /* queue 3 active indicator */ #define VGE_TXQCSR_WAK3 0x4000 /* Wake up (poll) queue 3 */ -#define VGE_TXQCST_DEAD3 0x8000 /* queue 3 dead indicator */ +#define VGE_TXQCSR_DEAD3 0x8000 /* queue 3 dead indicator */ /* RX descriptor queue control/status register */ Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 22:02:42 2010 (r201836) +++ stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 22:08:18 2010 (r201837) @@ -139,7 +139,7 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - u_int8_t vge_type; + uint8_t vge_type; int vge_if_flags; int vge_link; int vge_camidx; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:13:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E46A6106566B; Fri, 8 Jan 2010 22:13:15 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3BD18FC12; Fri, 8 Jan 2010 22:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08MDFsb007006; Fri, 8 Jan 2010 22:13:15 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08MDFvH007004; Fri, 8 Jan 2010 22:13:15 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082213.o08MDFvH007004@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 22:13:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201838 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:13:16 -0000 Author: brooks Date: Fri Jan 8 22:13:15 2010 New Revision: 201838 URL: http://svn.freebsd.org/changeset/base/201838 Log: MFC r201352 If a filter has already been added, actually return EEXIST when trying at add it again. Modified: stable/7/sys/kern/kern_event.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_event.c ============================================================================== --- stable/7/sys/kern/kern_event.c Fri Jan 8 22:08:18 2010 (r201837) +++ stable/7/sys/kern/kern_event.c Fri Jan 8 22:13:15 2010 (r201838) @@ -757,6 +757,7 @@ kqueue_add_filteropts(int filt, struct f { int error; + error = 0; if (filt > 0 || filt + EVFILT_SYSCOUNT < 0) { printf( "trying to add a filterop that is out of range: %d is beyond %d\n", @@ -773,7 +774,7 @@ kqueue_add_filteropts(int filt, struct f } mtx_unlock(&filterops_lock); - return (0); + return (error); } int From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:18:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7578F1065670; Fri, 8 Jan 2010 22:18:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62E098FC0C; Fri, 8 Jan 2010 22:18:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08MIFiM008145; Fri, 8 Jan 2010 22:18:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08MIFpm008141; Fri, 8 Jan 2010 22:18:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082218.o08MIFpm008141@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 22:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201839 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:18:15 -0000 Author: yongari Date: Fri Jan 8 22:18:15 2010 New Revision: 201839 URL: http://svn.freebsd.org/changeset/base/201839 Log: MFC r200526-200527,200529,200531-200533,200536 r200526: Use PCIR_BAR instead of hard-coded value. r200527: Fix typo in register definition. r200529: Clear VGE_TXDESC_Q bit for transmitted frames. The VGE_TXDESC_Q bit seems to work like a tag that indicates 'not list end' of queued frames. Without having a VGE_TXDESC_Q bit indicates 'list end'. So the last frame of multiple queued frames has no VGE_TXDESC_Q bit. The hardware has peculiar behavior for VGE_TXDESC_Q bit handling. If the VGE_TXDESC_Q bit of descriptor was set the controller would fetch next descriptor. However if next descriptor's OWN bit was cleared but VGE_TXDESC_Q was set, it could confuse controller. Clearing VGE_TXDESC_Q bit for transmitted frames ensure correct behavior. r200531: Use ANSI function definations. r200532: Remove unnecessary return statement. r200533: s/u_intXX_t/uintXX_t/g r200536: style(9). Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgereg.h stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Fri Jan 8 22:13:15 2010 (r201838) +++ stable/7/sys/dev/vge/if_vge.c Fri Jan 8 22:18:15 2010 (r201839) @@ -172,7 +172,7 @@ static int vge_ifmedia_upd (struct ifnet static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, u_int16_t *); +static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); #endif static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); @@ -187,9 +187,6 @@ static int vge_cam_set (struct vge_soft static void vge_setmulti (struct vge_softc *); static void vge_reset (struct vge_softc *); -#define VGE_PCI_LOIO 0x10 -#define VGE_PCI_LOMEM 0x14 - static device_method_t vge_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vge_probe), @@ -228,13 +225,10 @@ DRIVER_MODULE(miibus, vge, miibus_driver * Read a word of data stored in the EEPROM at address 'addr.' */ static void -vge_eeprom_getword(sc, addr, dest) - struct vge_softc *sc; - int addr; - u_int16_t *dest; +vge_eeprom_getword(struct vge_softc *sc, int addr, uint16_t *dest) { - int i; - u_int16_t word = 0; + int i; + uint16_t word = 0; /* * Enter EEPROM embedded programming mode. In order to @@ -270,8 +264,6 @@ vge_eeprom_getword(sc, addr, dest) CSR_CLRBIT_1(sc, VGE_CHIPCFG2, VGE_CHIPCFG2_EELOAD); *dest = word; - - return; } #endif @@ -279,20 +271,15 @@ vge_eeprom_getword(sc, addr, dest) * Read a sequence of words from the EEPROM. */ static void -vge_read_eeprom(sc, dest, off, cnt, swap) - struct vge_softc *sc; - caddr_t dest; - int off; - int cnt; - int swap; +vge_read_eeprom(struct vge_softc *sc, caddr_t dest, int off, int cnt, int swap) { - int i; + int i; #ifdef VGE_EEPROM - u_int16_t word = 0, *ptr; + uint16_t word = 0, *ptr; for (i = 0; i < cnt; i++) { vge_eeprom_getword(sc, off + i, &word); - ptr = (u_int16_t *)(dest + (i * 2)); + ptr = (uint16_t *)(dest + (i * 2)); if (swap) *ptr = ntohs(word); else @@ -305,10 +292,9 @@ vge_read_eeprom(sc, dest, off, cnt, swap } static void -vge_miipoll_stop(sc) - struct vge_softc *sc; +vge_miipoll_stop(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_MIICMD, 0); @@ -320,15 +306,12 @@ vge_miipoll_stop(sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to idle MII autopoll\n"); - - return; } static void -vge_miipoll_start(sc) - struct vge_softc *sc; +vge_miipoll_start(struct vge_softc *sc) { - int i; + int i; /* First, make sure we're idle. */ @@ -360,23 +343,19 @@ vge_miipoll_start(sc) if (i == VGE_TIMEOUT) device_printf(sc->vge_dev, "failed to start MII autopoll\n"); - - return; } static int -vge_miibus_readreg(dev, phy, reg) - device_t dev; - int phy, reg; +vge_miibus_readreg(device_t dev, int phy, int reg) { - struct vge_softc *sc; - int i; - u_int16_t rval = 0; + struct vge_softc *sc; + int i; + uint16_t rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -404,17 +383,15 @@ vge_miibus_readreg(dev, phy, reg) } static int -vge_miibus_writereg(dev, phy, reg, data) - device_t dev; - int phy, reg, data; +vge_miibus_writereg(device_t dev, int phy, int reg, int data) { - struct vge_softc *sc; - int i, rval = 0; + struct vge_softc *sc; + int i, rval = 0; sc = device_get_softc(dev); if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) - return(0); + return (0); vge_miipoll_stop(sc); @@ -445,10 +422,9 @@ vge_miibus_writereg(dev, phy, reg, data) } static void -vge_cam_clear(sc) - struct vge_softc *sc; +vge_cam_clear(struct vge_softc *sc) { - int i; + int i; /* * Turn off all the mask bits. This tells the chip @@ -473,19 +449,15 @@ vge_cam_clear(sc) CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); sc->vge_camidx = 0; - - return; } static int -vge_cam_set(sc, addr) - struct vge_softc *sc; - uint8_t *addr; +vge_cam_set(struct vge_softc *sc, uint8_t *addr) { - int i, error = 0; + int i, error = 0; if (sc->vge_camidx == VGE_CAM_MAXADDRS) - return(ENOSPC); + return (ENOSPC); /* Select the CAM data page. */ CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); @@ -539,13 +511,12 @@ fail: * we use the hash filter instead. */ static void -vge_setmulti(sc) - struct vge_softc *sc; +vge_setmulti(struct vge_softc *sc) { - struct ifnet *ifp; - int error = 0/*, h = 0*/; - struct ifmultiaddr *ifma; - u_int32_t h, hashes[2] = { 0, 0 }; + struct ifnet *ifp; + int error = 0/*, h = 0*/; + struct ifmultiaddr *ifma; + uint32_t h, hashes[2] = { 0, 0 }; VGE_LOCK_ASSERT(sc); @@ -596,15 +567,12 @@ vge_setmulti(sc) CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } IF_ADDR_UNLOCK(ifp); - - return; } static void -vge_reset(sc) - struct vge_softc *sc; +vge_reset(struct vge_softc *sc) { - int i; + int i; CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_SOFTRESET); @@ -636,8 +604,6 @@ vge_reset(sc) } CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); - - return; } /* @@ -645,10 +611,9 @@ vge_reset(sc) * IDs against our list and return a device name if we find a match. */ static int -vge_probe(dev) - device_t dev; +vge_probe(device_t dev) { - struct vge_type *t; + struct vge_type *t; struct vge_softc *sc; t = vge_devs; @@ -675,13 +640,9 @@ struct vge_dmamap_arg { }; static void -vge_dmamap_cb(arg, segs, nsegs, error) - void *arg; - bus_dma_segment_t *segs; - int nsegs; - int error; +vge_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) { - struct vge_dmamap_arg *ctx; + struct vge_dmamap_arg *ctx; if (error != 0) return; @@ -693,14 +654,13 @@ vge_dmamap_cb(arg, segs, nsegs, error) } static int -vge_dma_alloc(sc) - struct vge_softc *sc; +vge_dma_alloc(struct vge_softc *sc) { - struct vge_dmamap_arg ctx; - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - bus_addr_t lowaddr, tx_ring_end, rx_ring_end; - int error, i; + struct vge_dmamap_arg ctx; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + bus_addr_t lowaddr, tx_ring_end, rx_ring_end; + int error, i; lowaddr = BUS_SPACE_MAXADDR; @@ -909,12 +869,11 @@ fail: } static void -vge_dma_free(sc) - struct vge_softc *sc; +vge_dma_free(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + int i; /* Tx ring. */ if (sc->vge_cdata.vge_tx_ring_tag != NULL) { @@ -993,13 +952,12 @@ vge_dma_free(sc) * setup and ethernet/BPF attach. */ static int -vge_attach(dev) - device_t dev; +vge_attach(device_t dev) { - u_char eaddr[ETHER_ADDR_LEN]; - struct vge_softc *sc; - struct ifnet *ifp; - int error = 0, rid; + u_char eaddr[ETHER_ADDR_LEN]; + struct vge_softc *sc; + struct ifnet *ifp; + int error = 0, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -1013,7 +971,7 @@ vge_attach(dev) */ pci_enable_busmaster(dev); - rid = VGE_PCI_LOMEM; + rid = PCIR_BAR(1); sc->vge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -1109,11 +1067,10 @@ fail: * allocated. */ static int -vge_detach(dev) - device_t dev; +vge_detach(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); KASSERT(mtx_initialized(&sc->vge_mtx), ("vge mutex not initialized")); @@ -1142,7 +1099,7 @@ vge_detach(dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, - VGE_PCI_LOMEM, sc->vge_res); + PCIR_BAR(1), sc->vge_res); if (ifp) if_free(ifp); @@ -1153,12 +1110,10 @@ vge_detach(dev) } static void -vge_discard_rxbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_discard_rxbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - int i; + struct vge_rxdesc *rxd; + int i; rxd = &sc->vge_cdata.vge_rxdesc[prod]; rxd->rx_desc->vge_sts = 0; @@ -1182,15 +1137,13 @@ vge_discard_rxbuf(sc, prod) } static int -vge_newbuf(sc, prod) - struct vge_softc *sc; - int prod; +vge_newbuf(struct vge_softc *sc, int prod) { - struct vge_rxdesc *rxd; - struct mbuf *m; - bus_dma_segment_t segs[1]; - bus_dmamap_t map; - int i, nsegs; + struct vge_rxdesc *rxd; + struct mbuf *m; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; + int i, nsegs; m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); if (m == NULL) @@ -1254,12 +1207,11 @@ vge_newbuf(sc, prod) } static int -vge_tx_list_init(sc) - struct vge_softc *sc; +vge_tx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_txdesc *txd; - int i; + struct vge_ring_data *rd; + struct vge_txdesc *txd; + int i; VGE_LOCK_ASSERT(sc); @@ -1283,12 +1235,11 @@ vge_tx_list_init(sc) } static int -vge_rx_list_init(sc) - struct vge_softc *sc; +vge_rx_list_init(struct vge_softc *sc) { - struct vge_ring_data *rd; - struct vge_rxdesc *rxd; - int i; + struct vge_ring_data *rd; + struct vge_rxdesc *rxd; + int i; VGE_LOCK_ASSERT(sc); @@ -1322,13 +1273,12 @@ vge_rx_list_init(sc) } static void -vge_freebufs(sc) - struct vge_softc *sc; +vge_freebufs(struct vge_softc *sc) { - struct vge_txdesc *txd; - struct vge_rxdesc *rxd; - struct ifnet *ifp; - int i; + struct vge_txdesc *txd; + struct vge_rxdesc *rxd; + struct ifnet *ifp; + int i; VGE_LOCK_ASSERT(sc); @@ -1364,11 +1314,10 @@ vge_freebufs(sc) #ifndef __NO_STRICT_ALIGNMENT static __inline void -vge_fixup_rx(m) - struct mbuf *m; +vge_fixup_rx(struct mbuf *m) { - int i; - uint16_t *src, *dst; + int i; + uint16_t *src, *dst; src = mtod(m, uint16_t *); dst = src - 1; @@ -1385,16 +1334,14 @@ vge_fixup_rx(m) * been fragmented across multiple 2K mbuf cluster buffers. */ static int -vge_rxeof(sc, count) - struct vge_softc *sc; - int count; +vge_rxeof(struct vge_softc *sc, int count) { - struct mbuf *m; - struct ifnet *ifp; - int prod, prog, total_len; - struct vge_rxdesc *rxd; - struct vge_rx_desc *cur_rx; - uint32_t rxstat, rxctl; + struct mbuf *m; + struct ifnet *ifp; + int prod, prog, total_len; + struct vge_rxdesc *rxd; + struct vge_rx_desc *cur_rx; + uint32_t rxstat, rxctl; VGE_LOCK_ASSERT(sc); @@ -1559,14 +1506,13 @@ vge_rxeof(sc, count) } static void -vge_txeof(sc) - struct vge_softc *sc; +vge_txeof(struct vge_softc *sc) { - struct ifnet *ifp; - struct vge_tx_desc *cur_tx; - struct vge_txdesc *txd; - uint32_t txstat; - int cons, prod; + struct ifnet *ifp; + struct vge_tx_desc *cur_tx; + struct vge_txdesc *txd; + uint32_t txstat; + int cons, prod; VGE_LOCK_ASSERT(sc); @@ -1602,8 +1548,11 @@ vge_txeof(sc) __func__)); m_freem(txd->tx_m); txd->tx_m = NULL; + txd->tx_desc->vge_frag[0].vge_addrhi = 0; } - + bus_dmamap_sync(sc->vge_cdata.vge_tx_ring_tag, + sc->vge_cdata.vge_tx_ring_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; @@ -1619,12 +1568,11 @@ vge_txeof(sc) } static void -vge_tick(xsc) - void *xsc; +vge_tick(void *xsc) { - struct vge_softc *sc; - struct ifnet *ifp; - struct mii_data *mii; + struct vge_softc *sc; + struct ifnet *ifp; + struct mii_data *mii; sc = xsc; ifp = sc->vge_ifp; @@ -1648,8 +1596,6 @@ vge_tick(xsc) vge_start_locked(ifp); } } - - return; } #ifdef DEVICE_POLLING @@ -1669,7 +1615,7 @@ vge_poll (struct ifnet *ifp, enum poll_c vge_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ - u_int32_t status; + uint32_t status; status = CSR_READ_4(sc, VGE_ISR); if (status == 0xFFFFFFFF) goto done; @@ -1699,12 +1645,11 @@ done: #endif /* DEVICE_POLLING */ static void -vge_intr(arg) - void *arg; +vge_intr(void *arg) { - struct vge_softc *sc; - struct ifnet *ifp; - u_int32_t status; + struct vge_softc *sc; + struct ifnet *ifp; + uint32_t status; sc = arg; @@ -1771,21 +1716,17 @@ vge_intr(arg) vge_start_locked(ifp); VGE_UNLOCK(sc); - - return; } static int -vge_encap(sc, m_head) - struct vge_softc *sc; - struct mbuf **m_head; +vge_encap(struct vge_softc *sc, struct mbuf **m_head) { - struct vge_txdesc *txd; - struct vge_tx_frag *frag; - struct mbuf *m; - bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; - int error, i, nsegs, padlen; - uint32_t cflags; + struct vge_txdesc *txd; + struct vge_tx_frag *frag; + struct mbuf *m; + bus_dma_segment_t txsegs[VGE_MAXTXSEGS]; + int error, i, nsegs, padlen; + uint32_t cflags; VGE_LOCK_ASSERT(sc); @@ -1905,10 +1846,9 @@ vge_encap(sc, m_head) */ static void -vge_start(ifp) - struct ifnet *ifp; +vge_start(struct ifnet *ifp) { - struct vge_softc *sc; + struct vge_softc *sc; sc = ifp->if_softc; VGE_LOCK(sc); @@ -1918,13 +1858,12 @@ vge_start(ifp) static void -vge_start_locked(ifp) - struct ifnet *ifp; +vge_start_locked(struct ifnet *ifp) { - struct vge_softc *sc; - struct vge_txdesc *txd; - struct mbuf *m_head; - int enq, idx; + struct vge_softc *sc; + struct vge_txdesc *txd; + struct mbuf *m_head; + int enq, idx; sc = ifp->if_softc; @@ -1992,10 +1931,9 @@ vge_start_locked(ifp) } static void -vge_init(xsc) - void *xsc; +vge_init(void *xsc) { - struct vge_softc *sc = xsc; + struct vge_softc *sc = xsc; VGE_LOCK(sc); vge_init_locked(sc); @@ -2005,9 +1943,9 @@ vge_init(xsc) static void vge_init_locked(struct vge_softc *sc) { - struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; - int error, i; + struct ifnet *ifp = sc->vge_ifp; + struct mii_data *mii; + int error, i; VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); @@ -2183,11 +2121,10 @@ vge_init_locked(struct vge_softc *sc) * Set media options. */ static int -vge_ifmedia_upd(ifp) - struct ifnet *ifp; +vge_ifmedia_upd(struct ifnet *ifp) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; VGE_LOCK(sc); @@ -2202,12 +2139,10 @@ vge_ifmedia_upd(ifp) * Report current media status. */ static void -vge_ifmedia_sts(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +vge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct vge_softc *sc; - struct mii_data *mii; + struct vge_softc *sc; + struct mii_data *mii; sc = ifp->if_softc; mii = device_get_softc(sc->vge_miibus); @@ -2217,17 +2152,14 @@ vge_ifmedia_sts(ifp, ifmr) VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - - return; } static void -vge_miibus_statchg(dev) - device_t dev; +vge_miibus_statchg(device_t dev) { - struct vge_softc *sc; - struct mii_data *mii; - struct ifmedia_entry *ife; + struct vge_softc *sc; + struct mii_data *mii; + struct ifmedia_entry *ife; sc = device_get_softc(dev); mii = device_get_softc(sc->vge_miibus); @@ -2267,20 +2199,15 @@ vge_miibus_statchg(dev) IFM_SUBTYPE(ife->ifm_media)); break; } - - return; } static int -vge_ioctl(ifp, command, data) - struct ifnet *ifp; - u_long command; - caddr_t data; -{ - struct vge_softc *sc = ifp->if_softc; - struct ifreq *ifr = (struct ifreq *) data; - struct mii_data *mii; - int error = 0; +vge_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +{ + struct vge_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *) data; + struct mii_data *mii; + int error = 0; switch (command) { case SIOCSIFMTU: @@ -2332,7 +2259,7 @@ vge_ioctl(ifp, command, data) if (ifr->ifr_reqcap & IFCAP_POLLING) { error = ether_poll_register(vge_poll, ifp); if (error) - return(error); + return (error); VGE_LOCK(sc); /* Disable interrupts */ CSR_WRITE_4(sc, VGE_IMR, 0); @@ -2395,8 +2322,6 @@ vge_watchdog(void *arg) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); - - return; } /* @@ -2404,10 +2329,9 @@ vge_watchdog(void *arg) * RX and TX lists. */ static void -vge_stop(sc) - struct vge_softc *sc; +vge_stop(struct vge_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp; VGE_LOCK_ASSERT(sc); ifp = sc->vge_ifp; @@ -2434,10 +2358,9 @@ vge_stop(sc) * resume. */ static int -vge_suspend(dev) - device_t dev; +vge_suspend(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); @@ -2456,11 +2379,10 @@ vge_suspend(dev) * appropriate. */ static int -vge_resume(dev) - device_t dev; +vge_resume(device_t dev) { - struct vge_softc *sc; - struct ifnet *ifp; + struct vge_softc *sc; + struct ifnet *ifp; sc = device_get_softc(dev); ifp = sc->vge_ifp; @@ -2486,10 +2408,9 @@ vge_resume(dev) * get confused by errant DMAs when rebooting. */ static int -vge_shutdown(dev) - device_t dev; +vge_shutdown(device_t dev) { - struct vge_softc *sc; + struct vge_softc *sc; sc = device_get_softc(dev); Modified: stable/7/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/7/sys/dev/vge/if_vgereg.h Fri Jan 8 22:13:15 2010 (r201838) +++ stable/7/sys/dev/vge/if_vgereg.h Fri Jan 8 22:18:15 2010 (r201839) @@ -339,19 +339,19 @@ #define VGE_TXQCSR_RUN0 0x0001 /* Enable TX queue 0 */ #define VGE_TXQCSR_ACT0 0x0002 /* queue 0 active indicator */ #define VGE_TXQCSR_WAK0 0x0004 /* Wake up (poll) queue 0 */ -#define VGE_TXQCST_DEAD0 0x0008 /* queue 0 dead indicator */ +#define VGE_TXQCSR_DEAD0 0x0008 /* queue 0 dead indicator */ #define VGE_TXQCSR_RUN1 0x0010 /* Enable TX queue 1 */ #define VGE_TXQCSR_ACT1 0x0020 /* queue 1 active indicator */ #define VGE_TXQCSR_WAK1 0x0040 /* Wake up (poll) queue 1 */ -#define VGE_TXQCST_DEAD1 0x0080 /* queue 1 dead indicator */ +#define VGE_TXQCSR_DEAD1 0x0080 /* queue 1 dead indicator */ #define VGE_TXQCSR_RUN2 0x0100 /* Enable TX queue 2 */ #define VGE_TXQCSR_ACT2 0x0200 /* queue 2 active indicator */ #define VGE_TXQCSR_WAK2 0x0400 /* Wake up (poll) queue 2 */ -#define VGE_TXQCST_DEAD2 0x0800 /* queue 2 dead indicator */ +#define VGE_TXQCSR_DEAD2 0x0800 /* queue 2 dead indicator */ #define VGE_TXQCSR_RUN3 0x1000 /* Enable TX queue 3 */ #define VGE_TXQCSR_ACT3 0x2000 /* queue 3 active indicator */ #define VGE_TXQCSR_WAK3 0x4000 /* Wake up (poll) queue 3 */ -#define VGE_TXQCST_DEAD3 0x8000 /* queue 3 dead indicator */ +#define VGE_TXQCSR_DEAD3 0x8000 /* queue 3 dead indicator */ /* RX descriptor queue control/status register */ Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 22:13:15 2010 (r201838) +++ stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 22:18:15 2010 (r201839) @@ -139,7 +139,7 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - u_int8_t vge_type; + uint8_t vge_type; int vge_if_flags; int vge_link; int vge_camidx; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:26:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 166DE106566B; Fri, 8 Jan 2010 22:26:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 040E88FC0C; Fri, 8 Jan 2010 22:26:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08MQODO010075; Fri, 8 Jan 2010 22:26:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08MQOv6010072; Fri, 8 Jan 2010 22:26:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082226.o08MQOv6010072@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 22:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201840 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:26:25 -0000 Author: yongari Date: Fri Jan 8 22:26:24 2010 New Revision: 201840 URL: http://svn.freebsd.org/changeset/base/201840 Log: MFC r200538,200540-200541,200543,200545,200548 r200538: Introduce vge_flags member in softc. The vge_flags member will record device specific bits. Remove vge_link and use vge_flags. While here, move clearing link state before mii_mediachg() as mii_mediachg() may affect link state. r200540: Save PHY address by reading VGE_MIICFG register. For PCIe controllers(VT613x), we assume the PHY address is 1. Use the saved PHY address in MII register access routines and remove accessing VGE_MIICFG register. While I'm here save PCI express capability register which will be used in near future. r200541: Add MSI support for VT613x controllers. r200543: Increase output queue size from 64 to 255. r200545: We don't have to reload EEPROM in vge_reset(). Because vge_reset() is called in vge_init_lock(), vge(4) always used to reload EEPROM. Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit. While I'm here add missing new line in vge_reset(). r200548: Sort function prototyes. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Fri Jan 8 22:18:15 2010 (r201839) +++ stable/8/sys/dev/vge/if_vge.c Fri Jan 8 22:26:24 2010 (r201840) @@ -127,6 +127,10 @@ MODULE_DEPEND(vge, miibus, 1, 1, 1); #define VGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) +/* Tunables */ +static int msi_disable = 0; +TUNABLE_INT("hw.vge.msi_disable", &msi_disable); + /* * Various supported device vendors/types and their names. */ @@ -136,56 +140,52 @@ static struct vge_type vge_devs[] = { { 0, 0, NULL } }; -static int vge_probe (device_t); -static int vge_attach (device_t); -static int vge_detach (device_t); - -static int vge_encap (struct vge_softc *, struct mbuf **); - -static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); -static int vge_dma_alloc (struct vge_softc *); -static void vge_dma_free (struct vge_softc *); -static void vge_discard_rxbuf (struct vge_softc *, int); -static int vge_newbuf (struct vge_softc *, int); -static int vge_rx_list_init (struct vge_softc *); -static int vge_tx_list_init (struct vge_softc *); -static void vge_freebufs (struct vge_softc *); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void vge_fixup_rx - (struct mbuf *); -#endif -static int vge_rxeof (struct vge_softc *, int); -static void vge_txeof (struct vge_softc *); -static void vge_intr (void *); -static void vge_tick (void *); -static void vge_start (struct ifnet *); -static void vge_start_locked (struct ifnet *); -static int vge_ioctl (struct ifnet *, u_long, caddr_t); -static void vge_init (void *); -static void vge_init_locked (struct vge_softc *); -static void vge_stop (struct vge_softc *); -static void vge_watchdog (void *); -static int vge_suspend (device_t); -static int vge_resume (device_t); -static int vge_shutdown (device_t); -static int vge_ifmedia_upd (struct ifnet *); -static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); - +static int vge_attach(device_t); +static int vge_detach(device_t); +static int vge_probe(device_t); +static int vge_resume(device_t); +static int vge_shutdown(device_t); +static int vge_suspend(device_t); + +static void vge_cam_clear(struct vge_softc *); +static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_discard_rxbuf(struct vge_softc *, int); +static int vge_dma_alloc(struct vge_softc *); +static void vge_dma_free(struct vge_softc *); +static void vge_dmamap_cb(void *, bus_dma_segment_t *, int, int); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); +static void vge_eeprom_getword(struct vge_softc *, int, uint16_t *); #endif -static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); - -static void vge_miipoll_start (struct vge_softc *); -static void vge_miipoll_stop (struct vge_softc *); -static int vge_miibus_readreg (device_t, int, int); -static int vge_miibus_writereg (device_t, int, int, int); -static void vge_miibus_statchg (device_t); - -static void vge_cam_clear (struct vge_softc *); -static int vge_cam_set (struct vge_softc *, uint8_t *); -static void vge_setmulti (struct vge_softc *); -static void vge_reset (struct vge_softc *); +static int vge_encap(struct vge_softc *, struct mbuf **); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void + vge_fixup_rx(struct mbuf *); +#endif +static void vge_freebufs(struct vge_softc *); +static void vge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int vge_ifmedia_upd(struct ifnet *); +static void vge_init(void *); +static void vge_init_locked(struct vge_softc *); +static void vge_intr(void *); +static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static int vge_miibus_readreg(device_t, int, int); +static void vge_miibus_statchg(device_t); +static int vge_miibus_writereg(device_t, int, int, int); +static void vge_miipoll_start(struct vge_softc *); +static void vge_miipoll_stop(struct vge_softc *); +static int vge_newbuf(struct vge_softc *, int); +static void vge_read_eeprom(struct vge_softc *, caddr_t, int, int, int); +static void vge_reset(struct vge_softc *); +static int vge_rx_list_init(struct vge_softc *); +static int vge_rxeof(struct vge_softc *, int); +static void vge_setmulti(struct vge_softc *); +static void vge_start(struct ifnet *); +static void vge_start_locked(struct ifnet *); +static void vge_stop(struct vge_softc *); +static void vge_tick(void *); +static int vge_tx_list_init(struct vge_softc *); +static void vge_txeof(struct vge_softc *); +static void vge_watchdog(void *); static device_method_t vge_methods[] = { /* Device interface */ @@ -353,7 +353,7 @@ vge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -389,7 +389,7 @@ vge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -582,27 +582,12 @@ vge_reset(struct vge_softc *sc) } if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "soft reset timed out"); + device_printf(sc->vge_dev, "soft reset timed out\n"); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_STOP_FORCE); DELAY(2000); } DELAY(5000); - - CSR_SETBIT_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); - - for (i = 0; i < VGE_TIMEOUT; i++) { - DELAY(5); - if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) - break; - } - - if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "EEPROM reload timed out\n"); - return; - } - - CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); } /* @@ -954,7 +939,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, rid; + int error = 0, cap, i, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -978,11 +963,28 @@ vge_attach(device_t dev) goto fail; } - /* Allocate interrupt */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PCIE; + sc->vge_expcap = cap; + } rid = 0; - sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + msic = pci_msi_count(dev); + if (msi_disable == 0 && msic > 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + sc->vge_flags |= VGE_FLAG_MSI; + device_printf(dev, "Using %d MSI message\n", + msic); + rid = 1; + } else + pci_release_msi(dev); + } + } + /* Allocate interrupt */ + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + ((sc->vge_flags & VGE_FLAG_MSI) ? 0 : RF_SHAREABLE) | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; @@ -991,12 +993,37 @@ vge_attach(device_t dev) /* Reset the adapter. */ vge_reset(sc); + /* Reload EEPROM. */ + CSR_WRITE_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); + for (i = 0; i < VGE_TIMEOUT; i++) { + DELAY(5); + if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) + break; + } + if (i == VGE_TIMEOUT) + device_printf(dev, "EEPROM reload timed out\n"); + /* + * Clear PACPI as EEPROM reload will set the bit. Otherwise + * MAC will receive magic packet which in turn confuses + * controller. + */ + CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); /* * Get station address from the EEPROM. */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - + /* + * Save configured PHY address. + * It seems the PHY address of PCIe controllers just + * reflects media jump strapping status so we assume the + * internal PHY address of PCIe controller is at 1. + */ + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + sc->vge_phyaddr = 1; + else + sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & + VGE_MIICFG_PHYADDR; error = vge_dma_alloc(sc); if (error) goto fail; @@ -1030,8 +1057,8 @@ vge_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif ifp->if_init = vge_init; - IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, VGE_TX_DESC_CNT - 1); + ifp->if_snd.ifq_drv_maxlen = VGE_TX_DESC_CNT - 1; IFQ_SET_READY(&ifp->if_snd); /* @@ -1093,7 +1120,10 @@ vge_detach(device_t dev) if (sc->vge_intrhand) bus_teardown_intr(dev, sc->vge_irq, sc->vge_intrhand); if (sc->vge_irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); + bus_release_resource(dev, SYS_RES_IRQ, + sc->vge_flags & VGE_FLAG_MSI ? 1 : 0, sc->vge_irq); + if (sc->vge_flags & VGE_FLAG_MSI) + pci_release_msi(dev); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(1), sc->vge_res); @@ -1577,16 +1607,16 @@ vge_tick(void *xsc) mii = device_get_softc(sc->vge_miibus); mii_tick(mii); - if (sc->vge_link) { + if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { - sc->vge_link = 0; + sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); } } else { if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->vge_link = 1; + sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1868,7 +1898,7 @@ vge_start_locked(struct ifnet *ifp) VGE_LOCK_ASSERT(sc); - if (sc->vge_link == 0 || + if ((sc->vge_flags & VGE_FLAG_LINK) == 0 || (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; @@ -2107,13 +2137,12 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } + sc->vge_flags &= ~VGE_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); - - sc->vge_link = 0; } /* Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 22:18:15 2010 (r201839) +++ stable/8/sys/dev/vge/if_vgevar.h Fri Jan 8 22:26:24 2010 (r201840) @@ -34,8 +34,6 @@ #define VGE_JUMBO_MTU 9000 -#define VGE_IFQ_MAXLEN 64 - #define VGE_TX_DESC_CNT 256 #define VGE_RX_DESC_CNT 252 /* Must be a multiple of 4!! */ #define VGE_TX_RING_ALIGN 64 @@ -141,7 +139,12 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; - int vge_link; + int vge_phyaddr; + int vge_flags; +#define VGE_FLAG_PCIE 0x0001 +#define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_LINK 0x8000 + int vge_expcap; int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:28:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2168D1065670; Fri, 8 Jan 2010 22:28:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2718FC19; Fri, 8 Jan 2010 22:28:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08MSsbA010717; Fri, 8 Jan 2010 22:28:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08MSsvr010714; Fri, 8 Jan 2010 22:28:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001082228.o08MSsvr010714@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 8 Jan 2010 22:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201841 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:28:56 -0000 Author: yongari Date: Fri Jan 8 22:28:54 2010 New Revision: 201841 URL: http://svn.freebsd.org/changeset/base/201841 Log: MFC r200538,200540-200541,200543,200545,200548 r200538: Introduce vge_flags member in softc. The vge_flags member will record device specific bits. Remove vge_link and use vge_flags. While here, move clearing link state before mii_mediachg() as mii_mediachg() may affect link state. r200540: Save PHY address by reading VGE_MIICFG register. For PCIe controllers(VT613x), we assume the PHY address is 1. Use the saved PHY address in MII register access routines and remove accessing VGE_MIICFG register. While I'm here save PCI express capability register which will be used in near future. r200541: Add MSI support for VT613x controllers. r200543: Increase output queue size from 64 to 255. r200545: We don't have to reload EEPROM in vge_reset(). Because vge_reset() is called in vge_init_lock(), vge(4) always used to reload EEPROM. Also add more comment why vge(4) clears VGE_CHIPCFG0_PACPI bit. While I'm here add missing new line in vge_reset(). r200548: Sort function prototyes. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Fri Jan 8 22:26:24 2010 (r201840) +++ stable/7/sys/dev/vge/if_vge.c Fri Jan 8 22:28:54 2010 (r201841) @@ -127,6 +127,10 @@ MODULE_DEPEND(vge, miibus, 1, 1, 1); #define VGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) +/* Tunables */ +static int msi_disable = 0; +TUNABLE_INT("hw.vge.msi_disable", &msi_disable); + /* * Various supported device vendors/types and their names. */ @@ -136,56 +140,52 @@ static struct vge_type vge_devs[] = { { 0, 0, NULL } }; -static int vge_probe (device_t); -static int vge_attach (device_t); -static int vge_detach (device_t); - -static int vge_encap (struct vge_softc *, struct mbuf **); - -static void vge_dmamap_cb (void *, bus_dma_segment_t *, int, int); -static int vge_dma_alloc (struct vge_softc *); -static void vge_dma_free (struct vge_softc *); -static void vge_discard_rxbuf (struct vge_softc *, int); -static int vge_newbuf (struct vge_softc *, int); -static int vge_rx_list_init (struct vge_softc *); -static int vge_tx_list_init (struct vge_softc *); -static void vge_freebufs (struct vge_softc *); -#ifndef __NO_STRICT_ALIGNMENT -static __inline void vge_fixup_rx - (struct mbuf *); -#endif -static int vge_rxeof (struct vge_softc *, int); -static void vge_txeof (struct vge_softc *); -static void vge_intr (void *); -static void vge_tick (void *); -static void vge_start (struct ifnet *); -static void vge_start_locked (struct ifnet *); -static int vge_ioctl (struct ifnet *, u_long, caddr_t); -static void vge_init (void *); -static void vge_init_locked (struct vge_softc *); -static void vge_stop (struct vge_softc *); -static void vge_watchdog (void *); -static int vge_suspend (device_t); -static int vge_resume (device_t); -static int vge_shutdown (device_t); -static int vge_ifmedia_upd (struct ifnet *); -static void vge_ifmedia_sts (struct ifnet *, struct ifmediareq *); - +static int vge_attach(device_t); +static int vge_detach(device_t); +static int vge_probe(device_t); +static int vge_resume(device_t); +static int vge_shutdown(device_t); +static int vge_suspend(device_t); + +static void vge_cam_clear(struct vge_softc *); +static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_discard_rxbuf(struct vge_softc *, int); +static int vge_dma_alloc(struct vge_softc *); +static void vge_dma_free(struct vge_softc *); +static void vge_dmamap_cb(void *, bus_dma_segment_t *, int, int); #ifdef VGE_EEPROM -static void vge_eeprom_getword (struct vge_softc *, int, uint16_t *); +static void vge_eeprom_getword(struct vge_softc *, int, uint16_t *); #endif -static void vge_read_eeprom (struct vge_softc *, caddr_t, int, int, int); - -static void vge_miipoll_start (struct vge_softc *); -static void vge_miipoll_stop (struct vge_softc *); -static int vge_miibus_readreg (device_t, int, int); -static int vge_miibus_writereg (device_t, int, int, int); -static void vge_miibus_statchg (device_t); - -static void vge_cam_clear (struct vge_softc *); -static int vge_cam_set (struct vge_softc *, uint8_t *); -static void vge_setmulti (struct vge_softc *); -static void vge_reset (struct vge_softc *); +static int vge_encap(struct vge_softc *, struct mbuf **); +#ifndef __NO_STRICT_ALIGNMENT +static __inline void + vge_fixup_rx(struct mbuf *); +#endif +static void vge_freebufs(struct vge_softc *); +static void vge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int vge_ifmedia_upd(struct ifnet *); +static void vge_init(void *); +static void vge_init_locked(struct vge_softc *); +static void vge_intr(void *); +static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static int vge_miibus_readreg(device_t, int, int); +static void vge_miibus_statchg(device_t); +static int vge_miibus_writereg(device_t, int, int, int); +static void vge_miipoll_start(struct vge_softc *); +static void vge_miipoll_stop(struct vge_softc *); +static int vge_newbuf(struct vge_softc *, int); +static void vge_read_eeprom(struct vge_softc *, caddr_t, int, int, int); +static void vge_reset(struct vge_softc *); +static int vge_rx_list_init(struct vge_softc *); +static int vge_rxeof(struct vge_softc *, int); +static void vge_setmulti(struct vge_softc *); +static void vge_start(struct ifnet *); +static void vge_start_locked(struct ifnet *); +static void vge_stop(struct vge_softc *); +static void vge_tick(void *); +static int vge_tx_list_init(struct vge_softc *); +static void vge_txeof(struct vge_softc *); +static void vge_watchdog(void *); static device_method_t vge_methods[] = { /* Device interface */ @@ -354,7 +354,7 @@ vge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -390,7 +390,7 @@ vge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != (CSR_READ_1(sc, VGE_MIICFG) & 0x1F)) + if (phy != sc->vge_phyaddr) return (0); vge_miipoll_stop(sc); @@ -583,27 +583,12 @@ vge_reset(struct vge_softc *sc) } if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "soft reset timed out"); + device_printf(sc->vge_dev, "soft reset timed out\n"); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_STOP_FORCE); DELAY(2000); } DELAY(5000); - - CSR_SETBIT_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); - - for (i = 0; i < VGE_TIMEOUT; i++) { - DELAY(5); - if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) - break; - } - - if (i == VGE_TIMEOUT) { - device_printf(sc->vge_dev, "EEPROM reload timed out\n"); - return; - } - - CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); } /* @@ -957,7 +942,7 @@ vge_attach(device_t dev) u_char eaddr[ETHER_ADDR_LEN]; struct vge_softc *sc; struct ifnet *ifp; - int error = 0, rid; + int error = 0, cap, i, msic, rid; sc = device_get_softc(dev); sc->vge_dev = dev; @@ -981,11 +966,28 @@ vge_attach(device_t dev) goto fail; } - /* Allocate interrupt */ + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PCIE; + sc->vge_expcap = cap; + } rid = 0; - sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); + msic = pci_msi_count(dev); + if (msi_disable == 0 && msic > 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + sc->vge_flags |= VGE_FLAG_MSI; + device_printf(dev, "Using %d MSI message\n", + msic); + rid = 1; + } else + pci_release_msi(dev); + } + } + /* Allocate interrupt */ + sc->vge_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + ((sc->vge_flags & VGE_FLAG_MSI) ? 0 : RF_SHAREABLE) | RF_ACTIVE); if (sc->vge_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); error = ENXIO; @@ -994,12 +996,37 @@ vge_attach(device_t dev) /* Reset the adapter. */ vge_reset(sc); + /* Reload EEPROM. */ + CSR_WRITE_1(sc, VGE_EECSR, VGE_EECSR_RELOAD); + for (i = 0; i < VGE_TIMEOUT; i++) { + DELAY(5); + if ((CSR_READ_1(sc, VGE_EECSR) & VGE_EECSR_RELOAD) == 0) + break; + } + if (i == VGE_TIMEOUT) + device_printf(dev, "EEPROM reload timed out\n"); + /* + * Clear PACPI as EEPROM reload will set the bit. Otherwise + * MAC will receive magic packet which in turn confuses + * controller. + */ + CSR_CLRBIT_1(sc, VGE_CHIPCFG0, VGE_CHIPCFG0_PACPI); /* * Get station address from the EEPROM. */ vge_read_eeprom(sc, (caddr_t)eaddr, VGE_EE_EADDR, 3, 0); - + /* + * Save configured PHY address. + * It seems the PHY address of PCIe controllers just + * reflects media jump strapping status so we assume the + * internal PHY address of PCIe controller is at 1. + */ + if ((sc->vge_flags & VGE_FLAG_PCIE) != 0) + sc->vge_phyaddr = 1; + else + sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & + VGE_MIICFG_PHYADDR; error = vge_dma_alloc(sc); if (error) goto fail; @@ -1033,8 +1060,8 @@ vge_attach(device_t dev) ifp->if_capabilities |= IFCAP_POLLING; #endif ifp->if_init = vge_init; - IFQ_SET_MAXLEN(&ifp->if_snd, VGE_IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = VGE_IFQ_MAXLEN; + IFQ_SET_MAXLEN(&ifp->if_snd, VGE_TX_DESC_CNT - 1); + ifp->if_snd.ifq_drv_maxlen = VGE_TX_DESC_CNT - 1; IFQ_SET_READY(&ifp->if_snd); /* @@ -1096,7 +1123,10 @@ vge_detach(device_t dev) if (sc->vge_intrhand) bus_teardown_intr(dev, sc->vge_irq, sc->vge_intrhand); if (sc->vge_irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->vge_irq); + bus_release_resource(dev, SYS_RES_IRQ, + sc->vge_flags & VGE_FLAG_MSI ? 1 : 0, sc->vge_irq); + if (sc->vge_flags & VGE_FLAG_MSI) + pci_release_msi(dev); if (sc->vge_res) bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(1), sc->vge_res); @@ -1580,16 +1610,16 @@ vge_tick(void *xsc) mii = device_get_softc(sc->vge_miibus); mii_tick(mii); - if (sc->vge_link) { + if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { - sc->vge_link = 0; + sc->vge_flags &= ~VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_DOWN); } } else { if (mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - sc->vge_link = 1; + sc->vge_flags |= VGE_FLAG_LINK; if_link_state_change(sc->vge_ifp, LINK_STATE_UP); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) @@ -1869,7 +1899,7 @@ vge_start_locked(struct ifnet *ifp) VGE_LOCK_ASSERT(sc); - if (sc->vge_link == 0 || + if ((sc->vge_flags & VGE_FLAG_LINK) == 0 || (ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) return; @@ -2108,13 +2138,12 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } + sc->vge_flags &= ~VGE_FLAG_LINK; mii_mediachg(mii); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); - - sc->vge_link = 0; } /* Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 22:26:24 2010 (r201840) +++ stable/7/sys/dev/vge/if_vgevar.h Fri Jan 8 22:28:54 2010 (r201841) @@ -34,8 +34,6 @@ #define VGE_JUMBO_MTU 9000 -#define VGE_IFQ_MAXLEN 64 - #define VGE_TX_DESC_CNT 256 #define VGE_RX_DESC_CNT 252 /* Must be a multiple of 4!! */ #define VGE_TX_RING_ALIGN 64 @@ -141,7 +139,12 @@ struct vge_softc { device_t vge_miibus; uint8_t vge_type; int vge_if_flags; - int vge_link; + int vge_phyaddr; + int vge_flags; +#define VGE_FLAG_PCIE 0x0001 +#define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_LINK 0x8000 + int vge_expcap; int vge_camidx; struct mtx vge_mtx; struct callout vge_watchdog; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 22:58:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F8710656A9; Fri, 8 Jan 2010 22:58:50 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9913D8FC0A; Fri, 8 Jan 2010 22:58:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08Mwo4L017692; Fri, 8 Jan 2010 22:58:50 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08MworN017690; Fri, 8 Jan 2010 22:58:50 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001082258.o08MworN017690@svn.freebsd.org> From: Christian Brueffer Date: Fri, 8 Jan 2010 22:58:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201848 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 22:58:50 -0000 Author: brueffer Date: Fri Jan 8 22:58:50 2010 New Revision: 201848 URL: http://svn.freebsd.org/changeset/base/201848 Log: Free allocated sbufs before returning ENOMEM. PR: 128335 Submitted by: Mateusz Guzik MFC after: 2 week Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Fri Jan 8 22:56:46 2010 (r201847) +++ head/sys/kern/kern_cpu.c Fri Jan 8 22:58:50 2010 (r201848) @@ -935,8 +935,10 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG /* Get settings from the device and generate the output string. */ count = CF_MAX_LEVELS; levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT); - if (levels == NULL) + if (levels == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_LEVELS(sc->dev, levels, &count); if (error) { if (error == E2BIG) @@ -974,8 +976,10 @@ cpufreq_settings_sysctl(SYSCTL_HANDLER_A /* Get settings from the device and generate the output string. */ set_count = MAX_SETTINGS; sets = malloc(set_count * sizeof(*sets), M_TEMP, M_NOWAIT); - if (sets == NULL) + if (sets == NULL) { + sbuf_delete(&sb); return (ENOMEM); + } error = CPUFREQ_DRV_SETTINGS(dev, sets, &set_count); if (error) goto out; From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:02:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A49E1065676; Fri, 8 Jan 2010 23:02:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 199C88FC15; Fri, 8 Jan 2010 23:02:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08N2Hdw018515; Fri, 8 Jan 2010 23:02:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08N2HBY018513; Fri, 8 Jan 2010 23:02:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082302.o08N2HBY018513@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201849 - head/gnu/usr.bin/cc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:02:18 -0000 Author: imp Date: Fri Jan 8 23:02:17 2010 New Revision: 201849 URL: http://svn.freebsd.org/changeset/base/201849 Log: Back-merge (by hand) r195668: r195668 | gonzo | 2009-07-13 17:01:12 -0600 (Mon, 13 Jul 2009) | 3 lines - Get rid of ugly TARGET_CPU_DEFAULT default. 16 is MASK_DSP and was set there due to my ignroance. Modified: head/gnu/usr.bin/cc/Makefile.tgt Modified: head/gnu/usr.bin/cc/Makefile.tgt ============================================================================== --- head/gnu/usr.bin/cc/Makefile.tgt Fri Jan 8 22:58:50 2010 (r201848) +++ head/gnu/usr.bin/cc/Makefile.tgt Fri Jan 8 23:02:17 2010 (r201849) @@ -15,9 +15,6 @@ GCC_CPU= ${TARGET_ARCH} .if ${TARGET_ARCH} == "ia64" TARGET_CPU_DEFAULT= MASK_GNU_AS|MASK_GNU_LD .endif -.if ${TARGET_ARCH} == "mips" -TARGET_CPU_DEFAULT= 16 -.endif .if ${TARGET_ARCH} == "sparc64" TARGET_CPU_DEFAULT= TARGET_CPU_ultrasparc .endif From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:06:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A21011065670; Fri, 8 Jan 2010 23:06:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 916038FC16; Fri, 8 Jan 2010 23:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08N6um0019589; Fri, 8 Jan 2010 23:06:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08N6uh2019587; Fri, 8 Jan 2010 23:06:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082306.o08N6uh2019587@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201850 - head/gnu/usr.bin/binutils X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:06:56 -0000 Author: imp Date: Fri Jan 8 23:06:56 2010 New Revision: 201850 URL: http://svn.freebsd.org/changeset/base/201850 Log: Merge from project/mips r195021: r195021 | gonzo | 2009-06-25 18:44:23 -0600 (Thu, 25 Jun 2009) | 2 lines - Add MIPS to the list of 32-bit architectures Modified: head/gnu/usr.bin/binutils/Makefile.inc0 Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Fri Jan 8 23:02:17 2010 (r201849) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Fri Jan 8 23:06:56 2010 (r201850) @@ -22,7 +22,8 @@ RELTOP:= .. RELSRC= ${RELTOP}/../../../contrib/binutils SRCDIR= ${.CURDIR}/${RELSRC} -.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc" +.if ${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "i386" || \ + ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "mips" CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:09:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EAC8106568F; Fri, 8 Jan 2010 23:09:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1438FC14; Fri, 8 Jan 2010 23:09:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08N9B3Q020119; Fri, 8 Jan 2010 23:09:11 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08N9Brs020117; Fri, 8 Jan 2010 23:09:11 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082309.o08N9Brs020117@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201851 - head/gnu/usr.bin/binutils/ld X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:09:11 -0000 Author: imp Date: Fri Jan 8 23:09:11 2010 New Revision: 201851 URL: http://svn.freebsd.org/changeset/base/201851 Log: Merge r195575 and 195530 from projects/mips to head by hand: r195575 | imp | 2009-07-10 12:24:02 -0600 (Fri, 10 Jul 2009) | 2 lines quick hack for the problem gonzo is seeing. r195530 | imp | 2009-07-10 01:18:30 -0600 (Fri, 10 Jul 2009) | 5 lines Always build all 4 emulators into the mips toolchain. # I think we have a gcc spec file issue with abi=64 since I have to do other # hacks to get it mostly kinda right. Modified: head/gnu/usr.bin/binutils/ld/Makefile.mips Modified: head/gnu/usr.bin/binutils/ld/Makefile.mips ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jan 8 23:06:56 2010 (r201850) +++ head/gnu/usr.bin/binutils/ld/Makefile.mips Fri Jan 8 23:09:11 2010 (r201851) @@ -10,15 +10,22 @@ NATIVE_EMULATION=elf${_sz}btsmip_fbsd NATIVE_EMULATION=elf${_sz}ltsmip_fbsd .endif -SRCS+= e${NATIVE_EMULATION}.c -CLEANFILES+= e${NATIVE_EMULATION}.c - +MIPS_ABIS=elf32btsmip_fbsd elf32ltsmip_fbsd elf64btsmip_fbsd elf64ltsmip_fbsd +.for abi in ${MIPS_ABIS} +#.if (${abi} != ${NATIVE_EMULATION}) +EMS+= ${abi} +#.endif +.for ext in ${ELF_SCR_EXT} +LDSCRIPTS+= ${abi}.${ext} +.endfor +SRCS+= e${abi}.c +CLEANFILES+= e${abi}.c # nb: elf32 handles both elf32 and elf64 targets -e${NATIVE_EMULATION}.c: ${.CURDIR}/${NATIVE_EMULATION}.sh emultempl/elf32.em \ +e${abi}.c: ${.CURDIR}/${abi}.sh emultempl/elf32.em \ scripttempl/elf.sc genscripts.sh stringify.sed sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${LIBSERACHPATH} \ ${TOOLS_PREFIX}/usr \ ${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \ - ${NATIVE_EMULATION} "" no ${NATIVE_EMULATION} ${TARGET_TUPLE} \ - ${.CURDIR}/${NATIVE_EMULATION}.sh - + ${abi} "" no ${abi} ${TARGET_TUPLE} \ + ${.CURDIR}/${abi}.sh +.endfor From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:11:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 458231065670; Fri, 8 Jan 2010 23:11:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34EDC8FC14; Fri, 8 Jan 2010 23:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08NBOMS020666; Fri, 8 Jan 2010 23:11:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08NBOlN020664; Fri, 8 Jan 2010 23:11:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082311.o08NBOlN020664@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201852 - head/gnu/lib/libgcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:11:24 -0000 Author: imp Date: Fri Jan 8 23:11:23 2010 New Revision: 201852 URL: http://svn.freebsd.org/changeset/base/201852 Log: Merge r195030 from project/mips into head by hand: r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines - Switch to libc softfloat from libgcc implementation. The problem with latter is that it is not complete, fpsetXXX/fpgetXXX functions are missing. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Fri Jan 8 23:09:11 2010 (r201851) +++ head/gnu/lib/libgcc/Makefile Fri Jan 8 23:11:23 2010 (r201852) @@ -115,6 +115,10 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns # _fixsfsi _fixunssfsi _floatdidf _floatdisf .endif +.if ${TARGET_ARCH} == "mips" +LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c +.endif + .if ${TARGET_ARCH} == "ia64" # from config/ia64/t-ia64 LIB1ASMSRC = lib1funcs.asm @@ -179,7 +183,7 @@ OBJ_GRPS = STD DIV # # Floating point emulation functions # -.if ${TARGET_ARCH} == "armNOT_YET" || ${TARGET_ARCH} == "mips" || \ +.if ${TARGET_ARCH} == "armNOT_YET" || \ ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "sparc64" FPBIT_CFLAGS = -DFINE_GRAINED_LIBRARIES -DFLOAT From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:26:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E98C106568F; Fri, 8 Jan 2010 23:26:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C04F8FC0A; Fri, 8 Jan 2010 23:26:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08NQB0d023965; Fri, 8 Jan 2010 23:26:11 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08NQA6w023961; Fri, 8 Jan 2010 23:26:10 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001082326.o08NQA6w023961@svn.freebsd.org> From: Brooks Davis Date: Fri, 8 Jan 2010 23:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201853 - in head/sys: conf rpc/rpcsec_gss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:26:11 -0000 Author: brooks Date: Fri Jan 8 23:26:10 2010 New Revision: 201853 URL: http://svn.freebsd.org/changeset/base/201853 Log: Make options KGSSAPI build and add it to NOTES. rpcsec_gss_prot.c: Use kernel printf and headers. vc_rpcsec_gss.c: Use a local RPCAUTH_UNIXGIDS definition for 16 instead of using NGROUPS. Modified: head/sys/conf/NOTES head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Jan 8 23:11:23 2010 (r201852) +++ head/sys/conf/NOTES Fri Jan 8 23:26:10 2010 (r201853) @@ -973,6 +973,7 @@ options NFSSERVER #Network File System options NFSLOCKD #Network Lock Manager options NFSCL #experimental NFS client with NFSv4 options NFSD #experimental NFS server with NFSv4 +options KGSSAPI #Kernel GSSAPI implementaion # NT File System. Read-mostly, see mount_ntfs(8) for details. # For a full read-write NTFS support consider sysutils/fusefs-ntfs Modified: head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c ============================================================================== --- head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Fri Jan 8 23:11:23 2010 (r201852) +++ head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c Fri Jan 8 23:26:10 2010 (r201853) @@ -307,7 +307,7 @@ xdr_rpc_gss_unwrap_data(struct mbuf **re } #ifdef DEBUG -#include +#include void rpc_gss_log_debug(const char *fmt, ...) @@ -315,9 +315,9 @@ rpc_gss_log_debug(const char *fmt, ...) va_list ap; va_start(ap, fmt); - fprintf(stderr, "rpcsec_gss: "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + printf("rpcsec_gss: "); + vprintf(fmt, ap); + printf("\n"); va_end(ap); } @@ -328,7 +328,7 @@ rpc_gss_log_status(const char *m, gss_OI gss_buffer_desc msg; int msg_ctx = 0; - fprintf(stderr, "rpcsec_gss: %s: ", m); + printf("rpcsec_gss: %s: ", m); gss_display_status(&min, maj_stat, GSS_C_GSS_CODE, GSS_C_NULL_OID, &msg_ctx, &msg); Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c ============================================================================== --- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri Jan 8 23:11:23 2010 (r201852) +++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Fri Jan 8 23:26:10 2010 (r201853) @@ -121,6 +121,9 @@ enum svc_rpc_gss_client_state { }; #define SVC_RPC_GSS_SEQWINDOW 128 +#ifndef RPCAUTH_UNIXGIDS +#define RPCAUTH_UNIXGIDS 16 +#endif struct svc_rpc_gss_clientid { unsigned long ci_hostid; @@ -147,7 +150,7 @@ struct svc_rpc_gss_client { int cl_rpcflavor; /* RPC pseudo sec flavor */ bool_t cl_done_callback; /* TRUE after call */ void *cl_cookie; /* user cookie from callback */ - gid_t cl_gid_storage[NGROUPS]; + gid_t cl_gid_storage[RPCAUTH_UNIXGIDS]; gss_OID cl_mech; /* mechanism */ gss_qop_t cl_qop; /* quality of protection */ uint32_t cl_seqlast; /* sequence window origin */ @@ -735,7 +738,7 @@ svc_rpc_gss_build_ucred(struct svc_rpc_g uc->gid = 65534; uc->gidlist = client->cl_gid_storage; - numgroups = NGROUPS; + numgroups = RPCAUTH_UNIXGIDS; maj_stat = gss_pname_to_unix_cred(&min_stat, name, client->cl_mech, &uc->uid, &uc->gid, &numgroups, &uc->gidlist[0]); if (GSS_ERROR(maj_stat)) @@ -932,7 +935,7 @@ svc_rpc_gss_accept_sec_context(struct sv "", client->cl_rawcred.client_principal->name, mechname.length, (char *)mechname.value, - client->cl_qop, client->rawcred.service); + client->cl_qop, client->cl_rawcred.service); gss_release_buffer(&min_stat, &mechname); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:37:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0229C106566C; Fri, 8 Jan 2010 23:37:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57358FC12; Fri, 8 Jan 2010 23:37:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08NbUXq026523; Fri, 8 Jan 2010 23:37:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08NbUUb026521; Fri, 8 Jan 2010 23:37:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082337.o08NbUUb026521@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201855 - head/contrib/gcc/config/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:37:31 -0000 Author: imp Date: Fri Jan 8 23:37:30 2010 New Revision: 201855 URL: http://svn.freebsd.org/changeset/base/201855 Log: Merge r194519 from projects/mips to head by hand: r194519 | gonzo | 2009-06-19 17:28:26 -0600 (Fri, 19 Jun 2009) | 3 lines - set -mabicalls and -msoft-float as a default in order to simplify building ports Modified: head/contrib/gcc/config/mips/freebsd.h Modified: head/contrib/gcc/config/mips/freebsd.h ============================================================================== --- head/contrib/gcc/config/mips/freebsd.h Fri Jan 8 23:30:43 2010 (r201854) +++ head/contrib/gcc/config/mips/freebsd.h Fri Jan 8 23:37:30 2010 (r201855) @@ -97,6 +97,9 @@ Boston, MA 02110-1301, USA. */ Needs to agree with . GCC defaults come from c-decl.c, c-common.c, and config//.h. */ +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_ABICALLS | MASK_SOFT_FLOAT) + #if TARGET_ENDIAN_DEFAULT != 0 #define TARGET_VERSION fprintf (stderr, " (FreeBSD/mips)"); #else From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:50:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB260106566C; Fri, 8 Jan 2010 23:50:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8B8F8FC15; Fri, 8 Jan 2010 23:50:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08NodqG029477; Fri, 8 Jan 2010 23:50:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08NodWn029470; Fri, 8 Jan 2010 23:50:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082350.o08NodWn029470@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201856 - in head/lib/libc/mips/gen: . hardfloat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:50:40 -0000 Author: imp Date: Fri Jan 8 23:50:39 2010 New Revision: 201856 URL: http://svn.freebsd.org/changeset/base/201856 Log: Merge r195025 from projects/mips to head by hand: r195025 | gonzo | 2009-06-25 19:01:50 -0600 (Thu, 25 Jun 2009) | 4 lines - Move fpgetXXX.c/fpsetXXX.c sources to hardfloat subdir/ to prevenmt them from being mixed up with lib/libc/softfloat files with the same names Added: head/lib/libc/mips/gen/hardfloat/ head/lib/libc/mips/gen/hardfloat/fpgetmask.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetmask.c head/lib/libc/mips/gen/hardfloat/fpgetround.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetround.c head/lib/libc/mips/gen/hardfloat/fpgetsticky.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpgetsticky.c head/lib/libc/mips/gen/hardfloat/fpsetmask.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetmask.c head/lib/libc/mips/gen/hardfloat/fpsetround.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetround.c head/lib/libc/mips/gen/hardfloat/fpsetsticky.c - copied unchanged from r201686, head/lib/libc/mips/gen/fpsetsticky.c Deleted: head/lib/libc/mips/gen/fpgetmask.c head/lib/libc/mips/gen/fpgetround.c head/lib/libc/mips/gen/fpgetsticky.c head/lib/libc/mips/gen/fpsetmask.c head/lib/libc/mips/gen/fpsetround.c head/lib/libc/mips/gen/fpsetsticky.c Copied: head/lib/libc/mips/gen/hardfloat/fpgetmask.c (from r201686, head/lib/libc/mips/gen/fpgetmask.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpgetmask.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpgetmask.c) @@ -0,0 +1,29 @@ +/* $NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpgetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpgetmask,_fpgetmask) +#endif + +fp_except_t +fpgetmask() +{ + int x; + + __asm("cfc1 %0,$31" : "=r" (x)); + return (x >> 7) & 0x1f; +} Copied: head/lib/libc/mips/gen/hardfloat/fpgetround.c (from r201686, head/lib/libc/mips/gen/fpgetround.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpgetround.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpgetround.c) @@ -0,0 +1,29 @@ +/* $NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpgetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpgetround,_fpgetround) +#endif + +fp_rnd_t +fpgetround() +{ + int x; + + __asm("cfc1 %0,$31" : "=r" (x)); + return x & 0x03; +} Copied: head/lib/libc/mips/gen/hardfloat/fpgetsticky.c (from r201686, head/lib/libc/mips/gen/fpgetsticky.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpgetsticky.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpgetsticky.c) @@ -0,0 +1,29 @@ +/* $NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpgetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpgetsticky,_fpgetsticky) +#endif + +fp_except_t +fpgetsticky() +{ + int x; + + __asm("cfc1 %0,$31" : "=r" (x)); + return (x >> 2) & 0x1f; +} Copied: head/lib/libc/mips/gen/hardfloat/fpsetmask.c (from r201686, head/lib/libc/mips/gen/fpsetmask.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpsetmask.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpsetmask.c) @@ -0,0 +1,38 @@ +/* $NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpsetmask.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpsetmask,_fpsetmask) +#endif + +fp_except_t +fpsetmask(mask) + fp_except_t mask; +{ + fp_except_t old; + fp_except_t new; + + __asm("cfc1 %0,$31" : "=r" (old)); + + new = old; + new &= ~(0x1f << 7); + new |= ((mask & 0x1f) << 7); + + __asm("ctc1 %0,$31" : : "r" (new)); + + return (old >> 7) & 0x1f; +} Copied: head/lib/libc/mips/gen/hardfloat/fpsetround.c (from r201686, head/lib/libc/mips/gen/fpsetround.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpsetround.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpsetround.c) @@ -0,0 +1,37 @@ +/* $NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpsetround.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpsetround,_fpsetround) +#endif + +fp_rnd_t +fpsetround(fp_rnd_t rnd_dir) +{ + fp_rnd_t old; + fp_rnd_t new; + + __asm("cfc1 %0,$31" : "=r" (old)); + + new = old; + new &= ~0x03; + new |= (rnd_dir & 0x03); + + __asm("ctc1 %0,$31" : : "r" (new)); + + return old & 0x03; +} Copied: head/lib/libc/mips/gen/hardfloat/fpsetsticky.c (from r201686, head/lib/libc/mips/gen/fpsetsticky.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/mips/gen/hardfloat/fpsetsticky.c Fri Jan 8 23:50:39 2010 (r201856, copy of r201686, head/lib/libc/mips/gen/fpsetsticky.c) @@ -0,0 +1,38 @@ +/* $NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $ */ + +/* + * Written by J.T. Conklin, Apr 11, 1995 + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: fpsetsticky.c,v 1.5 2005/12/24 23:10:08 perry Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" + +#include + +#ifdef __weak_alias +__weak_alias(fpsetsticky,_fpsetsticky) +#endif + +fp_except +fpsetsticky(sticky) + fp_except sticky; +{ + fp_except old; + fp_except new; + + __asm("cfc1 %0,$31" : "=r" (old)); + + new = old; + new &= ~(0x1f << 2); + new |= ((sticky & 0x1f) << 2); + + __asm("ctc1 %0,$31" : : "r" (new)); + + return (old >> 2) & 0x1f; +} From owner-svn-src-all@FreeBSD.ORG Fri Jan 8 23:59:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A32701065670; Fri, 8 Jan 2010 23:59:04 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 923B58FC21; Fri, 8 Jan 2010 23:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o08Nx4jS031375; Fri, 8 Jan 2010 23:59:04 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o08Nx4FC031372; Fri, 8 Jan 2010 23:59:04 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001082359.o08Nx4FC031372@svn.freebsd.org> From: Warner Losh Date: Fri, 8 Jan 2010 23:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201858 - in head/lib/libc/mips: . sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2010 23:59:04 -0000 Author: imp Date: Fri Jan 8 23:59:04 2010 New Revision: 201858 URL: http://svn.freebsd.org/changeset/base/201858 Log: Merge r197800 from projects/mips to head by hand: r197800 | gonzo | 2009-10-06 00:35:52 -0600 (Tue, 06 Oct 2009) | 3 lines - curbrk variable for sbrk and brk should be the same - Add correct variable names to Symbol.map Modified: head/lib/libc/mips/Symbol.map head/lib/libc/mips/sys/brk.S Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Fri Jan 8 23:57:30 2010 (r201857) +++ head/lib/libc/mips/Symbol.map Fri Jan 8 23:59:04 2010 (r201858) @@ -56,8 +56,8 @@ FBSDprivate_1.0 { __siglongjmp; __sys_vfork; _vfork; - end; /* XXX - Should this be _end (see sys/brk.S)? */ - curbrk; + _end; + __curbrk; minbrk; _brk; _sbrk; Modified: head/lib/libc/mips/sys/brk.S ============================================================================== --- head/lib/libc/mips/sys/brk.S Fri Jan 8 23:57:30 2010 (r201857) +++ head/lib/libc/mips/sys/brk.S Fri Jan 8 23:59:04 2010 (r201858) @@ -42,15 +42,12 @@ __FBSDID("$FreeBSD$"); #endif /* LIBC_SCCS and not lint */ .globl _C_LABEL(minbrk) - .globl _C_LABEL(curbrk) + .globl _C_LABEL(__curbrk) .globl _C_LABEL(_end) .data _C_LABEL(minbrk): .word _C_LABEL(_end) -_C_LABEL(curbrk): - .word _C_LABEL(_end) - .text LEAF(__sys_brk) WEAK_ALIAS(brk, __sys_brk) @@ -67,7 +64,7 @@ LEAF(__sys_brk) li v0, SYS_break syscall bne a3, zero, 2f - sw a0, _C_LABEL(curbrk) + sw a0, _C_LABEL(__curbrk) move v0, zero j ra 2: From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:01:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C561065698; Sat, 9 Jan 2010 00:01:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B89668FC15; Sat, 9 Jan 2010 00:01:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0901ZEe032011; Sat, 9 Jan 2010 00:01:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0901Z3E032008; Sat, 9 Jan 2010 00:01:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001090001.o0901Z3E032008@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 00:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201859 - in head/lib/libc: . mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:01:35 -0000 Author: imp Date: Sat Jan 9 00:01:35 2010 New Revision: 201859 URL: http://svn.freebsd.org/changeset/base/201859 Log: Merge r195030 from project/mips to head by hand r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 lines - Switch to libc softfloat from libgcc implementation. The problem with latter is that it is not complete, fpsetXXX/fpgetXXX functions are missing. Modified: head/lib/libc/Makefile head/lib/libc/mips/Symbol.map Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Fri Jan 8 23:59:04 2010 (r201858) +++ head/lib/libc/Makefile Sat Jan 9 00:01:35 2010 (r201859) @@ -64,7 +64,7 @@ NOASM= .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/uuid/Makefile.inc" .include "${.CURDIR}/xdr/Makefile.inc" -.if ${MACHINE_ARCH} == "arm" +.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "mips" .include "${.CURDIR}/softfloat/Makefile.inc" .endif .if ${MK_NIS} != "no" Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Fri Jan 8 23:59:04 2010 (r201858) +++ head/lib/libc/mips/Symbol.map Sat Jan 9 00:01:35 2010 (r201859) @@ -61,4 +61,22 @@ FBSDprivate_1.0 { minbrk; _brk; _sbrk; + + /* softfloat */ + __addsf3; + __adddf3; + __subsf3; + __subdf3; + __mulsf3; + __muldf3; + __divsf3; + __divdf3; + __floatsisf; + __floatsidf; + __fixsfsi; + __fixdfsi; + __fixunssfsi; + __fixunsdfsi; + __extendsfdf2; + __truncdfsf2; }; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:02:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 156F4106568B; Sat, 9 Jan 2010 00:02:41 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02CB88FC24; Sat, 9 Jan 2010 00:02:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0902eQo032280; Sat, 9 Jan 2010 00:02:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0902evS032278; Sat, 9 Jan 2010 00:02:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090002.o0902evS032278@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201860 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:02:41 -0000 Author: yongari Date: Sat Jan 9 00:02:40 2010 New Revision: 201860 URL: http://svn.freebsd.org/changeset/base/201860 Log: MFC r200551-200552,200555,200558,200609,200613 r200551: Whenever link state change interrupt is raised, vge_tick() is called and vge(4) used to drive auto-negotiation timer(mii_tick) in vge_tick(). Therefore the mii_tick was not called for every hz such that auto-negotiation complete was never handled in vge(4). Use mii_pollstat to extract current negotiated speed/duplex instead of mii_tick. The latter is valid only for auto-negotiation case. While I'm here change the confusing function name vge_tick() to vge_link_statchg(). r200552: Report media change result to caller instead of returning success without regard to the result. r200555: Don't report current link status if interface is not UP. If interface is not UP, the current link status wouldn't reflect the negotiated status. r200558: Tell upper layer vge(4) supports long frames. This should be done after ether_ifattach(), as ether_ifattach() initializes it with ETHER_HDR_LEN. While I'm here remove setting if_mtu, it's already handled in ether_ifattach(). r200609: All vge(4) controllers support RX/TX checksum offloading for VLAN tagged frames so add checksum offloading capabilities. Also add missing VLAN hardware tagging control in ioctl handler and let upper stack know current VLAN capabilities. r200613: Rewrite RX filter setup and simplify code. Now promiscuous mode and multicast handling is performed in single function, vge_rxfilter(). Modified: stable/8/sys/dev/vge/if_vge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:01:35 2010 (r201859) +++ stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:02:40 2010 (r201860) @@ -168,6 +168,7 @@ static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); @@ -178,11 +179,11 @@ static void vge_read_eeprom(struct vge_s static void vge_reset(struct vge_softc *); static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); -static void vge_setmulti(struct vge_softc *); +static void vge_rxfilter(struct vge_softc *); +static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); -static void vge_tick(void *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -504,38 +505,66 @@ fail: return (error); } +static void +vge_setvlan(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint8_t cfg; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + cfg = CSR_READ_1(sc, VGE_RXCFG); + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + cfg |= VGE_VTAG_OPT2; + else + cfg &= ~VGE_VTAG_OPT2; + CSR_WRITE_1(sc, VGE_RXCFG, cfg); +} + /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, * we use the hash filter instead. */ static void -vge_setmulti(struct vge_softc *sc) +vge_rxfilter(struct vge_softc *sc) { struct ifnet *ifp; - int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2]; + uint8_t rxcfg; + int error = 0; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - /* First, zot all the multicast entries. */ - vge_cam_clear(sc); - CSR_WRITE_4(sc, VGE_MAR0, 0); - CSR_WRITE_4(sc, VGE_MAR1, 0); + hashes[0] = 0; + hashes[1] = 0; + rxcfg = CSR_READ_1(sc, VGE_RXCTL); + rxcfg &= ~(VGE_RXCTL_RX_MCAST | VGE_RXCTL_RX_BCAST | + VGE_RXCTL_RX_PROMISC); /* - * If the user wants allmulti or promisc mode, enable reception - * of all multicast frames. + * Always allow VLAN oversized frames and frames for + * this host. */ - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - CSR_WRITE_4(sc, VGE_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, VGE_MAR1, 0xFFFFFFFF); - return; + rxcfg |= VGE_RXCTL_RX_GIANT | VGE_RXCTL_RX_UCAST; + + ifp = sc->vge_ifp; + if ((ifp->if_flags & IFF_BROADCAST) != 0) + rxcfg |= VGE_RXCTL_RX_BCAST; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= VGE_RXCTL_RX_PROMISC; + if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } + goto done; } + vge_cam_clear(sc); /* Now program new ones */ if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -561,11 +590,15 @@ vge_setmulti(struct vge_softc *sc) else hashes[1] |= (1 << (h - 32)); } - - CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); - CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } if_maddr_runlock(ifp); + +done: + if (hashes[0] != 0 || hashes[1] != 0) + rxcfg |= VGE_RXCTL_RX_MCAST; + CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); + CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); + CSR_WRITE_1(sc, VGE_RXCTL, rxcfg); } static void @@ -1045,13 +1078,13 @@ vge_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = vge_ioctl; ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_start = vge_start; ifp->if_hwassist = VGE_CSUM_FEATURES; - ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTAGGING; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1066,6 +1099,9 @@ vge_attach(device_t dev) */ ether_ifattach(ifp, eaddr); + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE, NULL, vge_intr, sc, &sc->vge_intrhand); @@ -1595,7 +1631,7 @@ vge_txeof(struct vge_softc *sc) } static void -vge_tick(void *xsc) +vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1606,7 +1642,7 @@ vge_tick(void *xsc) VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); - mii_tick(mii); + mii_pollstat(mii); if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { sc->vge_flags &= ~VGE_FLAG_LINK; @@ -1735,7 +1771,7 @@ vge_intr(void *arg) } if (status & VGE_ISR_LINKSTS) - vge_tick(sc); + vge_link_statchg(sc); } /* Re-enable interrupts */ @@ -2008,7 +2044,7 @@ vge_init_locked(struct vge_softc *sc) * reception of VLAN tagged frames. */ CSR_CLRBIT_1(sc, VGE_RXCFG, VGE_RXCFG_FIFO_THR|VGE_RXCFG_VTAGOPT); - CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES|VGE_VTAG_OPT2); + CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES); /* Set DMA burst length */ CSR_CLRBIT_1(sc, VGE_DMACFG0, VGE_DMACFG0_BURSTLEN); @@ -2047,29 +2083,12 @@ vge_init_locked(struct vge_softc *sc) /* Enable the TX descriptor queue */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_RUN0); - /* Set up the receive filter -- allow large frames for VLANs. */ - CSR_WRITE_1(sc, VGE_RXCTL, VGE_RXCTL_RX_UCAST|VGE_RXCTL_RX_GIANT); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_BCAST); - } - - /* Set multicast bit to capture multicast frames. */ - if (ifp->if_flags & IFF_MULTICAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_MCAST); - } - /* Init the cam filter. */ vge_cam_clear(sc); - /* Init the multicast filter. */ - vge_setmulti(sc); + /* Set up receiver filter. */ + vge_rxfilter(sc); + vge_setvlan(sc); /* Enable flow control */ @@ -2153,14 +2172,15 @@ vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; VGE_LOCK(sc); mii = device_get_softc(sc->vge_miibus); - mii_mediachg(mii); + error = mii_mediachg(mii); VGE_UNLOCK(sc); - return (0); + return (error); } /* @@ -2176,6 +2196,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->vge_miibus); VGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VGE_UNLOCK(sc); + return; + } mii_pollstat(mii); VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; @@ -2235,7 +2259,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFMTU: @@ -2245,25 +2269,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCSIFFLAGS: VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->vge_if_flags & IFF_PROMISC)) { - CSR_SETBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->vge_if_flags & IFF_PROMISC) { - CSR_CLRBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->vge_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + vge_rxfilter(sc); + else vge_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + vge_stop(sc); sc->vge_if_flags = ifp->if_flags; VGE_UNLOCK(sc); break; @@ -2271,7 +2285,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm case SIOCDELMULTI: VGE_LOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_setmulti(sc); + vge_rxfilter(sc); VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2280,8 +2294,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { @@ -2318,8 +2331,16 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + vge_setvlan(sc); + } VGE_UNLOCK(sc); - } + VLAN_CAPABILITIES(ifp); break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:05:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 242FA106566C; Sat, 9 Jan 2010 00:05:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 117598FC2B; Sat, 9 Jan 2010 00:05:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09052EF032908; Sat, 9 Jan 2010 00:05:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09052on032906; Sat, 9 Jan 2010 00:05:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090005.o09052on032906@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201861 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:05:03 -0000 Author: yongari Date: Sat Jan 9 00:05:02 2010 New Revision: 201861 URL: http://svn.freebsd.org/changeset/base/201861 Log: MFC r200551-200552,200555,200558,200609,200613 r200551: Whenever link state change interrupt is raised, vge_tick() is called and vge(4) used to drive auto-negotiation timer(mii_tick) in vge_tick(). Therefore the mii_tick was not called for every hz such that auto-negotiation complete was never handled in vge(4). Use mii_pollstat to extract current negotiated speed/duplex instead of mii_tick. The latter is valid only for auto-negotiation case. While I'm here change the confusing function name vge_tick() to vge_link_statchg(). r200552: Report media change result to caller instead of returning success without regard to the result. r200555: Don't report current link status if interface is not UP. If interface is not UP, the current link status wouldn't reflect the negotiated status. r200558: Tell upper layer vge(4) supports long frames. This should be done after ether_ifattach(), as ether_ifattach() initializes it with ETHER_HDR_LEN. While I'm here remove setting if_mtu, it's already handled in ether_ifattach(). r200609: All vge(4) controllers support RX/TX checksum offloading for VLAN tagged frames so add checksum offloading capabilities. Also add missing VLAN hardware tagging control in ioctl handler and let upper stack know current VLAN capabilities. r200613: Rewrite RX filter setup and simplify code. Now promiscuous mode and multicast handling is performed in single function, vge_rxfilter(). Modified: stable/7/sys/dev/vge/if_vge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:02:40 2010 (r201860) +++ stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:05:02 2010 (r201861) @@ -168,6 +168,7 @@ static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); +static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); static void vge_miibus_statchg(device_t); static int vge_miibus_writereg(device_t, int, int, int); @@ -178,11 +179,11 @@ static void vge_read_eeprom(struct vge_s static void vge_reset(struct vge_softc *); static int vge_rx_list_init(struct vge_softc *); static int vge_rxeof(struct vge_softc *, int); -static void vge_setmulti(struct vge_softc *); +static void vge_rxfilter(struct vge_softc *); +static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stop(struct vge_softc *); -static void vge_tick(void *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -505,38 +506,66 @@ fail: return (error); } +static void +vge_setvlan(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint8_t cfg; + + VGE_LOCK_ASSERT(sc); + + ifp = sc->vge_ifp; + cfg = CSR_READ_1(sc, VGE_RXCFG); + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) + cfg |= VGE_VTAG_OPT2; + else + cfg &= ~VGE_VTAG_OPT2; + CSR_WRITE_1(sc, VGE_RXCFG, cfg); +} + /* * Program the multicast filter. We use the 64-entry CAM filter * for perfect filtering. If there's more than 64 multicast addresses, * we use the hash filter instead. */ static void -vge_setmulti(struct vge_softc *sc) +vge_rxfilter(struct vge_softc *sc) { struct ifnet *ifp; - int error = 0/*, h = 0*/; struct ifmultiaddr *ifma; - uint32_t h, hashes[2] = { 0, 0 }; + uint32_t h, hashes[2]; + uint8_t rxcfg; + int error = 0; VGE_LOCK_ASSERT(sc); - ifp = sc->vge_ifp; - /* First, zot all the multicast entries. */ - vge_cam_clear(sc); - CSR_WRITE_4(sc, VGE_MAR0, 0); - CSR_WRITE_4(sc, VGE_MAR1, 0); + hashes[0] = 0; + hashes[1] = 0; + rxcfg = CSR_READ_1(sc, VGE_RXCTL); + rxcfg &= ~(VGE_RXCTL_RX_MCAST | VGE_RXCTL_RX_BCAST | + VGE_RXCTL_RX_PROMISC); /* - * If the user wants allmulti or promisc mode, enable reception - * of all multicast frames. + * Always allow VLAN oversized frames and frames for + * this host. */ - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - CSR_WRITE_4(sc, VGE_MAR0, 0xFFFFFFFF); - CSR_WRITE_4(sc, VGE_MAR1, 0xFFFFFFFF); - return; + rxcfg |= VGE_RXCTL_RX_GIANT | VGE_RXCTL_RX_UCAST; + + ifp = sc->vge_ifp; + if ((ifp->if_flags & IFF_BROADCAST) != 0) + rxcfg |= VGE_RXCTL_RX_BCAST; + if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { + if ((ifp->if_flags & IFF_PROMISC) != 0) + rxcfg |= VGE_RXCTL_RX_PROMISC; + if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + hashes[0] = 0xFFFFFFFF; + hashes[1] = 0xFFFFFFFF; + } + goto done; } + vge_cam_clear(sc); /* Now program new ones */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -562,11 +591,15 @@ vge_setmulti(struct vge_softc *sc) else hashes[1] |= (1 << (h - 32)); } - - CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); - CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); } IF_ADDR_UNLOCK(ifp); + +done: + if (hashes[0] != 0 || hashes[1] != 0) + rxcfg |= VGE_RXCTL_RX_MCAST; + CSR_WRITE_4(sc, VGE_MAR0, hashes[0]); + CSR_WRITE_4(sc, VGE_MAR1, hashes[1]); + CSR_WRITE_1(sc, VGE_RXCTL, rxcfg); } static void @@ -1048,13 +1081,13 @@ vge_attach(device_t dev) ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = vge_ioctl; ifp->if_capabilities = IFCAP_VLAN_MTU; ifp->if_start = vge_start; ifp->if_hwassist = VGE_CSUM_FEATURES; - ifp->if_capabilities |= IFCAP_HWCSUM|IFCAP_VLAN_HWTAGGING; + ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | + IFCAP_VLAN_HWTAGGING; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1069,6 +1102,9 @@ vge_attach(device_t dev) */ ether_ifattach(ifp, eaddr); + /* Tell the upper layer(s) we support long frames. */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + /* Hook interrupt last to avoid having to lock softc */ error = bus_setup_intr(dev, sc->vge_irq, INTR_TYPE_NET|INTR_MPSAFE, NULL, vge_intr, sc, &sc->vge_intrhand); @@ -1598,7 +1634,7 @@ vge_txeof(struct vge_softc *sc) } static void -vge_tick(void *xsc) +vge_link_statchg(void *xsc) { struct vge_softc *sc; struct ifnet *ifp; @@ -1609,7 +1645,7 @@ vge_tick(void *xsc) VGE_LOCK_ASSERT(sc); mii = device_get_softc(sc->vge_miibus); - mii_tick(mii); + mii_pollstat(mii); if ((sc->vge_flags & VGE_FLAG_LINK) != 0) { if (!(mii->mii_media_status & IFM_ACTIVE)) { sc->vge_flags &= ~VGE_FLAG_LINK; @@ -1736,7 +1772,7 @@ vge_intr(void *arg) } if (status & VGE_ISR_LINKSTS) - vge_tick(sc); + vge_link_statchg(sc); } /* Re-enable interrupts */ @@ -2009,7 +2045,7 @@ vge_init_locked(struct vge_softc *sc) * reception of VLAN tagged frames. */ CSR_CLRBIT_1(sc, VGE_RXCFG, VGE_RXCFG_FIFO_THR|VGE_RXCFG_VTAGOPT); - CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES|VGE_VTAG_OPT2); + CSR_SETBIT_1(sc, VGE_RXCFG, VGE_RXFIFOTHR_128BYTES); /* Set DMA burst length */ CSR_CLRBIT_1(sc, VGE_DMACFG0, VGE_DMACFG0_BURSTLEN); @@ -2048,29 +2084,12 @@ vge_init_locked(struct vge_softc *sc) /* Enable the TX descriptor queue */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_RUN0); - /* Set up the receive filter -- allow large frames for VLANs. */ - CSR_WRITE_1(sc, VGE_RXCTL, VGE_RXCTL_RX_UCAST|VGE_RXCTL_RX_GIANT); - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_PROMISC); - } - - /* Set capture broadcast bit to capture broadcast frames. */ - if (ifp->if_flags & IFF_BROADCAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_BCAST); - } - - /* Set multicast bit to capture multicast frames. */ - if (ifp->if_flags & IFF_MULTICAST) { - CSR_SETBIT_1(sc, VGE_RXCTL, VGE_RXCTL_RX_MCAST); - } - /* Init the cam filter. */ vge_cam_clear(sc); - /* Init the multicast filter. */ - vge_setmulti(sc); + /* Set up receiver filter. */ + vge_rxfilter(sc); + vge_setvlan(sc); /* Enable flow control */ @@ -2154,14 +2173,15 @@ vge_ifmedia_upd(struct ifnet *ifp) { struct vge_softc *sc; struct mii_data *mii; + int error; sc = ifp->if_softc; VGE_LOCK(sc); mii = device_get_softc(sc->vge_miibus); - mii_mediachg(mii); + error = mii_mediachg(mii); VGE_UNLOCK(sc); - return (0); + return (error); } /* @@ -2177,6 +2197,10 @@ vge_ifmedia_sts(struct ifnet *ifp, struc mii = device_get_softc(sc->vge_miibus); VGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + VGE_UNLOCK(sc); + return; + } mii_pollstat(mii); VGE_UNLOCK(sc); ifmr->ifm_active = mii->mii_media_active; @@ -2236,7 +2260,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm struct vge_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; struct mii_data *mii; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFMTU: @@ -2246,25 +2270,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm break; case SIOCSIFFLAGS: VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING && - ifp->if_flags & IFF_PROMISC && - !(sc->vge_if_flags & IFF_PROMISC)) { - CSR_SETBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING && - !(ifp->if_flags & IFF_PROMISC) && - sc->vge_if_flags & IFF_PROMISC) { - CSR_CLRBIT_1(sc, VGE_RXCTL, - VGE_RXCTL_RX_PROMISC); - vge_setmulti(sc); - } else + if ((ifp->if_flags & IFF_UP) != 0) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + ((ifp->if_flags ^ sc->vge_if_flags) & + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + vge_rxfilter(sc); + else vge_init_locked(sc); - } else { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_stop(sc); - } + } else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + vge_stop(sc); sc->vge_if_flags = ifp->if_flags; VGE_UNLOCK(sc); break; @@ -2272,7 +2286,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm case SIOCDELMULTI: VGE_LOCK(sc); if (ifp->if_drv_flags & IFF_DRV_RUNNING) - vge_setmulti(sc); + vge_rxfilter(sc); VGE_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2281,8 +2295,7 @@ vge_ioctl(struct ifnet *ifp, u_long comm error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: - { - int mask = ifr->ifr_reqcap ^ ifp->if_capenable; + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (mask & IFCAP_POLLING) { if (ifr->ifr_reqcap & IFCAP_POLLING) { @@ -2319,8 +2332,16 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_VLAN_HWCSUM) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (IFCAP_VLAN_HWTAGGING & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + vge_setvlan(sc); + } VGE_UNLOCK(sc); - } + VLAN_CAPABILITIES(ifp); break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:07:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7446C10656A4; Sat, 9 Jan 2010 00:07:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 612218FC1A; Sat, 9 Jan 2010 00:07:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09073Hf033385; Sat, 9 Jan 2010 00:07:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09073g7033381; Sat, 9 Jan 2010 00:07:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090007.o09073g7033381@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201862 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:07:03 -0000 Author: yongari Date: Sat Jan 9 00:07:03 2010 New Revision: 201862 URL: http://svn.freebsd.org/changeset/base/201862 Log: MFC 200615: Add hardware MAC statistics support. This statistics could be extracted from dev.vge.%d.stats sysctl node. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgereg.h stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:05:02 2010 (r201861) +++ stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:07:03 2010 (r201862) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -132,6 +133,13 @@ static int msi_disable = 0; TUNABLE_INT("hw.vge.msi_disable", &msi_disable); /* + * The SQE error counter of MIB seems to report bogus value. + * Vendor's workaround does not seem to work on PCIe based + * controllers. Disable it until we find better workaround. + */ +#undef VGE_ENABLE_SQEERR + +/* * Various supported device vendors/types and their names. */ static struct vge_type vge_devs[] = { @@ -183,7 +191,10 @@ static void vge_rxfilter(struct vge_soft static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); +static void vge_stats_clear(struct vge_softc *); +static void vge_stats_update(struct vge_softc *); static void vge_stop(struct vge_softc *); +static void vge_sysctl_node(struct vge_softc *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1057,6 +1068,7 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) goto fail; @@ -1698,7 +1710,6 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, count); - ifp->if_ierrors++; CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } @@ -2034,7 +2045,8 @@ vge_init_locked(struct vge_softc *sc) return; } vge_tx_list_init(sc); - + /* Clear MAC statistics. */ + vge_stats_clear(sc); /* Set our station address */ for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]); @@ -2358,6 +2370,7 @@ vge_watchdog(void *arg) sc = arg; VGE_LOCK_ASSERT(sc); + vge_stats_update(sc); callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); if (sc->vge_timer == 0 || --sc->vge_timer > 0) return; @@ -2396,6 +2409,7 @@ vge_stop(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_RXQCSRC, 0xFF); CSR_WRITE_4(sc, VGE_RXDESC_ADDR_LO, 0); + vge_stats_update(sc); VGE_CHAIN_RESET(sc); vge_txeof(sc); vge_freebufs(sc); @@ -2469,3 +2483,223 @@ vge_shutdown(device_t dev) return (0); } + +#define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +vge_sysctl_node(struct vge_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct vge_hw_stats *stats; + + stats = &sc->vge_stats; + ctx = device_get_sysctl_ctx(sc->vge_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "VGE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "RX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->rx_frames, "frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts_errs", + &stats->rx_runts_errs, "Too short frames with errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max_errs", + &stats->rx_pkts_1519_max_errs, "1519 to max frames with error"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->rx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "crcerrs", + &stats->rx_crcerrs, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "nobufs", + &stats->rx_nobufs, "Frames with no buffer event"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "sym_errs", + &stats->rx_symerrs, "Frames with symbol errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "TX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->tx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "colls", + &stats->tx_colls, "Collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_latecolls, "Late collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause, "Pause frames"); +#ifdef VGE_ENABLE_SQEERR + VGE_SYSCTL_STAT_ADD32(ctx, child, "sqeerrs", + &stats->tx_sqeerrs, "SQE errors"); +#endif + /* Clear MAC statistics. */ + vge_stats_clear(sc); +} + +#undef VGE_SYSCTL_STAT_ADD32 + +static void +vge_stats_clear(struct vge_softc *sc) +{ + int i; + + VGE_LOCK_ASSERT(sc); + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_CLR); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_CLR) == 0) + break; + } + if (i == 0) + device_printf(sc->vge_dev, "MIB clear timed out!\n"); + CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) & + ~VGE_MIBCSR_FREEZE); +} + +static void +vge_stats_update(struct vge_softc *sc) +{ + struct vge_hw_stats *stats; + struct ifnet *ifp; + uint32_t mib[VGE_MIB_CNT], val; + int i; + + VGE_LOCK_ASSERT(sc); + + stats = &sc->vge_stats; + ifp = sc->vge_ifp; + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FLUSH); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_FLUSH) == 0) + break; + } + if (i == 0) { + device_printf(sc->vge_dev, "MIB counter dump timed out!\n"); + vge_stats_clear(sc); + return; + } + + bzero(mib, sizeof(mib)); +reset_idx: + /* Set MIB read index to 0. */ + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_RINI); + for (i = 0; i < VGE_MIB_CNT; i++) { + val = CSR_READ_4(sc, VGE_MIBDATA); + if (i != VGE_MIB_DATA_IDX(val)) { + /* Reading interrupted. */ + goto reset_idx; + } + mib[i] = val & VGE_MIB_DATA_MASK; + } + + /* Rx stats. */ + stats->rx_frames += mib[VGE_MIB_RX_FRAMES]; + stats->rx_good_frames += mib[VGE_MIB_RX_GOOD_FRAMES]; + stats->rx_fifo_oflows += mib[VGE_MIB_RX_FIFO_OVERRUNS]; + stats->rx_runts += mib[VGE_MIB_RX_RUNTS]; + stats->rx_runts_errs += mib[VGE_MIB_RX_RUNTS_ERRS]; + stats->rx_pkts_64 += mib[VGE_MIB_RX_PKTS_64]; + stats->rx_pkts_65_127 += mib[VGE_MIB_RX_PKTS_65_127]; + stats->rx_pkts_128_255 += mib[VGE_MIB_RX_PKTS_128_255]; + stats->rx_pkts_256_511 += mib[VGE_MIB_RX_PKTS_256_511]; + stats->rx_pkts_512_1023 += mib[VGE_MIB_RX_PKTS_512_1023]; + stats->rx_pkts_1024_1518 += mib[VGE_MIB_RX_PKTS_1024_1518]; + stats->rx_pkts_1519_max += mib[VGE_MIB_RX_PKTS_1519_MAX]; + stats->rx_pkts_1519_max_errs += mib[VGE_MIB_RX_PKTS_1519_MAX_ERRS]; + stats->rx_jumbos += mib[VGE_MIB_RX_JUMBOS]; + stats->rx_crcerrs += mib[VGE_MIB_RX_CRCERRS]; + stats->rx_pause_frames += mib[VGE_MIB_RX_PAUSE]; + stats->rx_alignerrs += mib[VGE_MIB_RX_ALIGNERRS]; + stats->rx_nobufs += mib[VGE_MIB_RX_NOBUFS]; + stats->rx_symerrs += mib[VGE_MIB_RX_SYMERRS]; + stats->rx_lenerrs += mib[VGE_MIB_RX_LENERRS]; + + /* Tx stats. */ + stats->tx_good_frames += mib[VGE_MIB_TX_GOOD_FRAMES]; + stats->tx_pkts_64 += mib[VGE_MIB_TX_PKTS_64]; + stats->tx_pkts_65_127 += mib[VGE_MIB_TX_PKTS_65_127]; + stats->tx_pkts_128_255 += mib[VGE_MIB_TX_PKTS_128_255]; + stats->tx_pkts_256_511 += mib[VGE_MIB_TX_PKTS_256_511]; + stats->tx_pkts_512_1023 += mib[VGE_MIB_TX_PKTS_512_1023]; + stats->tx_pkts_1024_1518 += mib[VGE_MIB_TX_PKTS_1024_1518]; + stats->tx_jumbos += mib[VGE_MIB_TX_JUMBOS]; + stats->tx_colls += mib[VGE_MIB_TX_COLLS]; + stats->tx_pause += mib[VGE_MIB_TX_PAUSE]; +#ifdef VGE_ENABLE_SQEERR + stats->tx_sqeerrs += mib[VGE_MIB_TX_SQEERRS]; +#endif + stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; + + /* Update counters in ifnet. */ + ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + + ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + + ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + mib[VGE_MIB_RX_RUNTS] + + mib[VGE_MIB_RX_RUNTS_ERRS] + + mib[VGE_MIB_RX_CRCERRS] + + mib[VGE_MIB_RX_ALIGNERRS] + + mib[VGE_MIB_RX_NOBUFS] + + mib[VGE_MIB_RX_SYMERRS] + + mib[VGE_MIB_RX_LENERRS]; +} Modified: stable/8/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:05:02 2010 (r201861) +++ stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:07:03 2010 (r201862) @@ -301,7 +301,7 @@ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_MIBOFLOW|VGE_ISR_TIMER0) + VGE_ISR_TIMER0) /* Interrupt mask register */ @@ -543,6 +543,54 @@ #define VGE_TXBLOCK_128PKTS 0x08 #define VGE_TXBLOCK_8PKTS 0x0C +/* MIB control/status register */ +#define VGE_MIBCSR_CLR 0x01 +#define VGE_MIBCSR_RINI 0x02 +#define VGE_MIBCSR_FLUSH 0x04 +#define VGE_MIBCSR_FREEZE 0x08 +#define VGE_MIBCSR_HI_80 0x00 +#define VGE_MIBCSR_HI_C0 0x10 +#define VGE_MIBCSR_BISTGO 0x40 +#define VGE_MIBCSR_BISTOK 0x80 + +/* MIB data index. */ +#define VGE_MIB_RX_FRAMES 0 +#define VGE_MIB_RX_GOOD_FRAMES 1 +#define VGE_MIB_TX_GOOD_FRAMES 2 +#define VGE_MIB_RX_FIFO_OVERRUNS 3 +#define VGE_MIB_RX_RUNTS 4 +#define VGE_MIB_RX_RUNTS_ERRS 5 +#define VGE_MIB_RX_PKTS_64 6 +#define VGE_MIB_TX_PKTS_64 7 +#define VGE_MIB_RX_PKTS_65_127 8 +#define VGE_MIB_TX_PKTS_65_127 9 +#define VGE_MIB_RX_PKTS_128_255 10 +#define VGE_MIB_TX_PKTS_128_255 11 +#define VGE_MIB_RX_PKTS_256_511 12 +#define VGE_MIB_TX_PKTS_256_511 13 +#define VGE_MIB_RX_PKTS_512_1023 14 +#define VGE_MIB_TX_PKTS_512_1023 15 +#define VGE_MIB_RX_PKTS_1024_1518 16 +#define VGE_MIB_TX_PKTS_1024_1518 17 +#define VGE_MIB_TX_COLLS 18 +#define VGE_MIB_RX_CRCERRS 19 +#define VGE_MIB_RX_JUMBOS 20 +#define VGE_MIB_TX_JUMBOS 21 +#define VGE_MIB_RX_PAUSE 22 +#define VGE_MIB_TX_PAUSE 23 +#define VGE_MIB_RX_ALIGNERRS 24 +#define VGE_MIB_RX_PKTS_1519_MAX 25 +#define VGE_MIB_RX_PKTS_1519_MAX_ERRS 26 +#define VGE_MIB_TX_SQEERRS 27 +#define VGE_MIB_RX_NOBUFS 28 +#define VGE_MIB_RX_SYMERRS 29 +#define VGE_MIB_RX_LENERRS 30 +#define VGE_MIB_TX_LATECOLLS 31 + +#define VGE_MIB_CNT (VGE_MIB_TX_LATECOLLS - VGE_MIB_RX_FRAMES + 1) +#define VGE_MIB_DATA_MASK 0x00FFFFFF +#define VGE_MIB_DATA_IDX(x) ((x) >> 24) + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:05:02 2010 (r201861) +++ stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:07:03 2010 (r201862) @@ -130,6 +130,42 @@ struct vge_ring_data { bus_addr_t vge_rx_ring_paddr; }; +struct vge_hw_stats { + uint32_t rx_frames; + uint32_t rx_good_frames; + uint32_t rx_fifo_oflows; + uint32_t rx_runts; + uint32_t rx_runts_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_1519_max_errs; + uint32_t rx_jumbos; + uint32_t rx_crcerrs; + uint32_t rx_pause_frames; + uint32_t rx_alignerrs; + uint32_t rx_nobufs; + uint32_t rx_symerrs; + uint32_t rx_lenerrs; + + uint32_t tx_good_frames; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_jumbos; + uint32_t tx_colls; + uint32_t tx_pause; + uint32_t tx_sqeerrs; + uint32_t tx_latecolls; +}; + struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; @@ -152,6 +188,7 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; + struct vge_hw_stats vge_stats; int suspended; /* 0 = normal 1 = suspended */ }; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:07:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F2A71065692; Sat, 9 Jan 2010 00:07:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4708FC17; Sat, 9 Jan 2010 00:07:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0907mi1033639; Sat, 9 Jan 2010 00:07:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0907mfI033637; Sat, 9 Jan 2010 00:07:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001090007.o0907mfI033637@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 00:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201864 - head/lib/libthr/arch/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:07:48 -0000 Author: imp Date: Sat Jan 9 00:07:47 2010 New Revision: 201864 URL: http://svn.freebsd.org/changeset/base/201864 Log: Merge r195129 from project/mips to head by hand: r195129 | gonzo | 2009-06-27 17:28:56 -0600 (Sat, 27 Jun 2009) | 2 lines - Use sysarch(2) in MIPS version of _tcb_set/_tcb_get Modified: head/lib/libthr/arch/mips/include/pthread_md.h Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Sat Jan 9 00:07:46 2010 (r201863) +++ head/lib/libthr/arch/mips/include/pthread_md.h Sat Jan 9 00:07:47 2010 (r201864) @@ -60,7 +60,8 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - mips_tcb_set(tcb); + + sysarch(MIPS_SET_TLS, tcb); } /* @@ -69,7 +70,10 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - return (mips_tcb_get()); + void *tcb; + + sysarch(MIPS_GET_TLS, &tcb); + return tcb; } extern struct pthread *_thr_initial; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:08:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E27F10656A8; Sat, 9 Jan 2010 00:08:16 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF0E78FC08; Sat, 9 Jan 2010 00:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0908Fmt033810; Sat, 9 Jan 2010 00:08:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0908F3w033806; Sat, 9 Jan 2010 00:08:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090008.o0908F3w033806@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201865 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:08:16 -0000 Author: yongari Date: Sat Jan 9 00:08:15 2010 New Revision: 201865 URL: http://svn.freebsd.org/changeset/base/201865 Log: MFC 200615: Add hardware MAC statistics support. This statistics could be extracted from dev.vge.%d.stats sysctl node. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgereg.h stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:07:47 2010 (r201864) +++ stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:08:15 2010 (r201865) @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -132,6 +133,13 @@ static int msi_disable = 0; TUNABLE_INT("hw.vge.msi_disable", &msi_disable); /* + * The SQE error counter of MIB seems to report bogus value. + * Vendor's workaround does not seem to work on PCIe based + * controllers. Disable it until we find better workaround. + */ +#undef VGE_ENABLE_SQEERR + +/* * Various supported device vendors/types and their names. */ static struct vge_type vge_devs[] = { @@ -183,7 +191,10 @@ static void vge_rxfilter(struct vge_soft static void vge_setvlan(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); +static void vge_stats_clear(struct vge_softc *); +static void vge_stats_update(struct vge_softc *); static void vge_stop(struct vge_softc *); +static void vge_sysctl_node(struct vge_softc *); static int vge_tx_list_init(struct vge_softc *); static void vge_txeof(struct vge_softc *); static void vge_watchdog(void *); @@ -1060,6 +1071,7 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) goto fail; @@ -1700,7 +1712,6 @@ vge_poll (struct ifnet *ifp, enum poll_c if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, count); - ifp->if_ierrors++; CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } @@ -2035,7 +2046,8 @@ vge_init_locked(struct vge_softc *sc) return; } vge_tx_list_init(sc); - + /* Clear MAC statistics. */ + vge_stats_clear(sc); /* Set our station address */ for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, VGE_PAR0 + i, IF_LLADDR(sc->vge_ifp)[i]); @@ -2359,6 +2371,7 @@ vge_watchdog(void *arg) sc = arg; VGE_LOCK_ASSERT(sc); + vge_stats_update(sc); callout_reset(&sc->vge_watchdog, hz, vge_watchdog, sc); if (sc->vge_timer == 0 || --sc->vge_timer > 0) return; @@ -2397,6 +2410,7 @@ vge_stop(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_RXQCSRC, 0xFF); CSR_WRITE_4(sc, VGE_RXDESC_ADDR_LO, 0); + vge_stats_update(sc); VGE_CHAIN_RESET(sc); vge_txeof(sc); vge_freebufs(sc); @@ -2470,3 +2484,223 @@ vge_shutdown(device_t dev) return (0); } + +#define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ + SYSCTL_ADD_UINT(c, h, OID_AUTO, n, CTLFLAG_RD, p, 0, d) + +static void +vge_sysctl_node(struct vge_softc *sc) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *child, *parent; + struct sysctl_oid *tree; + struct vge_hw_stats *stats; + + stats = &sc->vge_stats; + ctx = device_get_sysctl_ctx(sc->vge_dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, + NULL, "VGE statistics"); + parent = SYSCTL_CHILDREN(tree); + + /* Rx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx", CTLFLAG_RD, + NULL, "RX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames", + &stats->rx_frames, "frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->rx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "fifo_oflows", + &stats->rx_fifo_oflows, "FIFO overflows"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts", + &stats->rx_runts, "Too short frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "runts_errs", + &stats->rx_runts_errs, "Too short frames with errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->rx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->rx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->rx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->rx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->rx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->rx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max", + &stats->rx_pkts_1519_max, "1519 to max frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1519_max_errs", + &stats->rx_pkts_1519_max_errs, "1519 to max frames with error"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->rx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "crcerrs", + &stats->rx_crcerrs, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->rx_pause_frames, "CRC errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "align_errs", + &stats->rx_alignerrs, "Alignment errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "nobufs", + &stats->rx_nobufs, "Frames with no buffer event"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "sym_errs", + &stats->rx_symerrs, "Frames with symbol errors"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "len_errs", + &stats->rx_lenerrs, "Frames with length mismatched"); + + /* Tx statistics. */ + tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "tx", CTLFLAG_RD, + NULL, "TX MAC statistics"); + child = SYSCTL_CHILDREN(tree); + VGE_SYSCTL_STAT_ADD32(ctx, child, "good_frames", + &stats->tx_good_frames, "Good frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_64", + &stats->tx_pkts_64, "64 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_65_127", + &stats->tx_pkts_65_127, "65 to 127 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_128_255", + &stats->tx_pkts_128_255, "128 to 255 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_256_511", + &stats->tx_pkts_256_511, "256 to 511 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_512_1023", + &stats->tx_pkts_512_1023, "512 to 1023 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_1024_1518", + &stats->tx_pkts_1024_1518, "1024 to 1518 bytes frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "frames_jumbo", + &stats->tx_jumbos, "Jumbo frames"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "colls", + &stats->tx_colls, "Collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "late_colls", + &stats->tx_latecolls, "Late collisions"); + VGE_SYSCTL_STAT_ADD32(ctx, child, "pause_frames", + &stats->tx_pause, "Pause frames"); +#ifdef VGE_ENABLE_SQEERR + VGE_SYSCTL_STAT_ADD32(ctx, child, "sqeerrs", + &stats->tx_sqeerrs, "SQE errors"); +#endif + /* Clear MAC statistics. */ + vge_stats_clear(sc); +} + +#undef VGE_SYSCTL_STAT_ADD32 + +static void +vge_stats_clear(struct vge_softc *sc) +{ + int i; + + VGE_LOCK_ASSERT(sc); + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_CLR); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_CLR) == 0) + break; + } + if (i == 0) + device_printf(sc->vge_dev, "MIB clear timed out!\n"); + CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) & + ~VGE_MIBCSR_FREEZE); +} + +static void +vge_stats_update(struct vge_softc *sc) +{ + struct vge_hw_stats *stats; + struct ifnet *ifp; + uint32_t mib[VGE_MIB_CNT], val; + int i; + + VGE_LOCK_ASSERT(sc); + + stats = &sc->vge_stats; + ifp = sc->vge_ifp; + + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FLUSH); + for (i = VGE_TIMEOUT; i > 0; i--) { + DELAY(1); + if ((CSR_READ_1(sc, VGE_MIBCSR) & VGE_MIBCSR_FLUSH) == 0) + break; + } + if (i == 0) { + device_printf(sc->vge_dev, "MIB counter dump timed out!\n"); + vge_stats_clear(sc); + return; + } + + bzero(mib, sizeof(mib)); +reset_idx: + /* Set MIB read index to 0. */ + CSR_WRITE_1(sc, VGE_MIBCSR, + CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_RINI); + for (i = 0; i < VGE_MIB_CNT; i++) { + val = CSR_READ_4(sc, VGE_MIBDATA); + if (i != VGE_MIB_DATA_IDX(val)) { + /* Reading interrupted. */ + goto reset_idx; + } + mib[i] = val & VGE_MIB_DATA_MASK; + } + + /* Rx stats. */ + stats->rx_frames += mib[VGE_MIB_RX_FRAMES]; + stats->rx_good_frames += mib[VGE_MIB_RX_GOOD_FRAMES]; + stats->rx_fifo_oflows += mib[VGE_MIB_RX_FIFO_OVERRUNS]; + stats->rx_runts += mib[VGE_MIB_RX_RUNTS]; + stats->rx_runts_errs += mib[VGE_MIB_RX_RUNTS_ERRS]; + stats->rx_pkts_64 += mib[VGE_MIB_RX_PKTS_64]; + stats->rx_pkts_65_127 += mib[VGE_MIB_RX_PKTS_65_127]; + stats->rx_pkts_128_255 += mib[VGE_MIB_RX_PKTS_128_255]; + stats->rx_pkts_256_511 += mib[VGE_MIB_RX_PKTS_256_511]; + stats->rx_pkts_512_1023 += mib[VGE_MIB_RX_PKTS_512_1023]; + stats->rx_pkts_1024_1518 += mib[VGE_MIB_RX_PKTS_1024_1518]; + stats->rx_pkts_1519_max += mib[VGE_MIB_RX_PKTS_1519_MAX]; + stats->rx_pkts_1519_max_errs += mib[VGE_MIB_RX_PKTS_1519_MAX_ERRS]; + stats->rx_jumbos += mib[VGE_MIB_RX_JUMBOS]; + stats->rx_crcerrs += mib[VGE_MIB_RX_CRCERRS]; + stats->rx_pause_frames += mib[VGE_MIB_RX_PAUSE]; + stats->rx_alignerrs += mib[VGE_MIB_RX_ALIGNERRS]; + stats->rx_nobufs += mib[VGE_MIB_RX_NOBUFS]; + stats->rx_symerrs += mib[VGE_MIB_RX_SYMERRS]; + stats->rx_lenerrs += mib[VGE_MIB_RX_LENERRS]; + + /* Tx stats. */ + stats->tx_good_frames += mib[VGE_MIB_TX_GOOD_FRAMES]; + stats->tx_pkts_64 += mib[VGE_MIB_TX_PKTS_64]; + stats->tx_pkts_65_127 += mib[VGE_MIB_TX_PKTS_65_127]; + stats->tx_pkts_128_255 += mib[VGE_MIB_TX_PKTS_128_255]; + stats->tx_pkts_256_511 += mib[VGE_MIB_TX_PKTS_256_511]; + stats->tx_pkts_512_1023 += mib[VGE_MIB_TX_PKTS_512_1023]; + stats->tx_pkts_1024_1518 += mib[VGE_MIB_TX_PKTS_1024_1518]; + stats->tx_jumbos += mib[VGE_MIB_TX_JUMBOS]; + stats->tx_colls += mib[VGE_MIB_TX_COLLS]; + stats->tx_pause += mib[VGE_MIB_TX_PAUSE]; +#ifdef VGE_ENABLE_SQEERR + stats->tx_sqeerrs += mib[VGE_MIB_TX_SQEERRS]; +#endif + stats->tx_latecolls += mib[VGE_MIB_TX_LATECOLLS]; + + /* Update counters in ifnet. */ + ifp->if_opackets += mib[VGE_MIB_TX_GOOD_FRAMES]; + + ifp->if_collisions += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_oerrors += mib[VGE_MIB_TX_COLLS] + + mib[VGE_MIB_TX_LATECOLLS]; + + ifp->if_ipackets += mib[VGE_MIB_RX_GOOD_FRAMES]; + + ifp->if_ierrors += mib[VGE_MIB_RX_FIFO_OVERRUNS] + + mib[VGE_MIB_RX_RUNTS] + + mib[VGE_MIB_RX_RUNTS_ERRS] + + mib[VGE_MIB_RX_CRCERRS] + + mib[VGE_MIB_RX_ALIGNERRS] + + mib[VGE_MIB_RX_NOBUFS] + + mib[VGE_MIB_RX_SYMERRS] + + mib[VGE_MIB_RX_LENERRS]; +} Modified: stable/7/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:07:47 2010 (r201864) +++ stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:08:15 2010 (r201865) @@ -301,7 +301,7 @@ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_MIBOFLOW|VGE_ISR_TIMER0) + VGE_ISR_TIMER0) /* Interrupt mask register */ @@ -543,6 +543,54 @@ #define VGE_TXBLOCK_128PKTS 0x08 #define VGE_TXBLOCK_8PKTS 0x0C +/* MIB control/status register */ +#define VGE_MIBCSR_CLR 0x01 +#define VGE_MIBCSR_RINI 0x02 +#define VGE_MIBCSR_FLUSH 0x04 +#define VGE_MIBCSR_FREEZE 0x08 +#define VGE_MIBCSR_HI_80 0x00 +#define VGE_MIBCSR_HI_C0 0x10 +#define VGE_MIBCSR_BISTGO 0x40 +#define VGE_MIBCSR_BISTOK 0x80 + +/* MIB data index. */ +#define VGE_MIB_RX_FRAMES 0 +#define VGE_MIB_RX_GOOD_FRAMES 1 +#define VGE_MIB_TX_GOOD_FRAMES 2 +#define VGE_MIB_RX_FIFO_OVERRUNS 3 +#define VGE_MIB_RX_RUNTS 4 +#define VGE_MIB_RX_RUNTS_ERRS 5 +#define VGE_MIB_RX_PKTS_64 6 +#define VGE_MIB_TX_PKTS_64 7 +#define VGE_MIB_RX_PKTS_65_127 8 +#define VGE_MIB_TX_PKTS_65_127 9 +#define VGE_MIB_RX_PKTS_128_255 10 +#define VGE_MIB_TX_PKTS_128_255 11 +#define VGE_MIB_RX_PKTS_256_511 12 +#define VGE_MIB_TX_PKTS_256_511 13 +#define VGE_MIB_RX_PKTS_512_1023 14 +#define VGE_MIB_TX_PKTS_512_1023 15 +#define VGE_MIB_RX_PKTS_1024_1518 16 +#define VGE_MIB_TX_PKTS_1024_1518 17 +#define VGE_MIB_TX_COLLS 18 +#define VGE_MIB_RX_CRCERRS 19 +#define VGE_MIB_RX_JUMBOS 20 +#define VGE_MIB_TX_JUMBOS 21 +#define VGE_MIB_RX_PAUSE 22 +#define VGE_MIB_TX_PAUSE 23 +#define VGE_MIB_RX_ALIGNERRS 24 +#define VGE_MIB_RX_PKTS_1519_MAX 25 +#define VGE_MIB_RX_PKTS_1519_MAX_ERRS 26 +#define VGE_MIB_TX_SQEERRS 27 +#define VGE_MIB_RX_NOBUFS 28 +#define VGE_MIB_RX_SYMERRS 29 +#define VGE_MIB_RX_LENERRS 30 +#define VGE_MIB_TX_LATECOLLS 31 + +#define VGE_MIB_CNT (VGE_MIB_TX_LATECOLLS - VGE_MIB_RX_FRAMES + 1) +#define VGE_MIB_DATA_MASK 0x00FFFFFF +#define VGE_MIB_DATA_IDX(x) ((x) >> 24) + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:07:47 2010 (r201864) +++ stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:08:15 2010 (r201865) @@ -130,6 +130,42 @@ struct vge_ring_data { bus_addr_t vge_rx_ring_paddr; }; +struct vge_hw_stats { + uint32_t rx_frames; + uint32_t rx_good_frames; + uint32_t rx_fifo_oflows; + uint32_t rx_runts; + uint32_t rx_runts_errs; + uint32_t rx_pkts_64; + uint32_t rx_pkts_65_127; + uint32_t rx_pkts_128_255; + uint32_t rx_pkts_256_511; + uint32_t rx_pkts_512_1023; + uint32_t rx_pkts_1024_1518; + uint32_t rx_pkts_1519_max; + uint32_t rx_pkts_1519_max_errs; + uint32_t rx_jumbos; + uint32_t rx_crcerrs; + uint32_t rx_pause_frames; + uint32_t rx_alignerrs; + uint32_t rx_nobufs; + uint32_t rx_symerrs; + uint32_t rx_lenerrs; + + uint32_t tx_good_frames; + uint32_t tx_pkts_64; + uint32_t tx_pkts_65_127; + uint32_t tx_pkts_128_255; + uint32_t tx_pkts_256_511; + uint32_t tx_pkts_512_1023; + uint32_t tx_pkts_1024_1518; + uint32_t tx_jumbos; + uint32_t tx_colls; + uint32_t tx_pause; + uint32_t tx_sqeerrs; + uint32_t tx_latecolls; +}; + struct vge_softc { struct ifnet *vge_ifp; /* interface info */ device_t vge_dev; @@ -152,6 +188,7 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; + struct vge_hw_stats vge_stats; int suspended; /* 0 = normal 1 = suspended */ }; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:10:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 279A8106566B; Sat, 9 Jan 2010 00:10:57 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 88C958FC15; Sat, 9 Jan 2010 00:10:56 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so4470373qwb.7 for ; Fri, 08 Jan 2010 16:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=D9TKbl7Zv5gVmHu8Sjv9DnMjPn+vQChAwE/ZVGJR5og=; b=OYDVUJFXfSdUCIDjdnl0Jc4tz0LIdEYiWJRHsA7L/Cdex3vSaIjCtSnLWoCVY0vPtG YJbxSWv7eRhv+Cp4kubr//lcuvuJxAsfUMCRBV87ksFvDcHfv50I6hTHP+Sj9Y+PEG+Q Doqa67aU9IPfBUJqhdMbEezV/JMvjCO0Bs3Fc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=pr8uZSL/zO3f1JUpRUcE2Ucx1k7Iy0q+Q9yqV0nD9dKbl2yshDXqf7UF2KL0Uhv4xy PMWjrouF0/oc4NgHERfnZTyfJXsPsBXmVGrWrUKYPb4PWbcEBUiZn5IIhhAF9bCNgs00 DeOmqu7/6rhpqI3wr3ndsfbs4fCEN9w/qUGzw= Received: by 10.224.62.233 with SMTP id y41mr14979373qah.11.1262995846876; Fri, 08 Jan 2010 16:10:46 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 8sm64032812qwj.43.2010.01.08.16.10.45 (version=SSLv3 cipher=RC4-MD5); Fri, 08 Jan 2010 16:10:45 -0800 (PST) Date: Fri, 8 Jan 2010 19:10:39 -0500 From: Alexander Kabaev To: Warner Losh Message-ID: <20100108191039.0143fa1d@kan.dnsalias.net> In-Reply-To: <201001090001.o0901Z3E032008@svn.freebsd.org> References: <201001090001.o0901Z3E032008@svn.freebsd.org> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/gL7MYCDjOeG+IeLdgDbVdqU"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201859 - in head/lib/libc: . mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:10:57 -0000 --Sig_/gL7MYCDjOeG+IeLdgDbVdqU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sat, 9 Jan 2010 00:01:35 +0000 (UTC) Warner Losh wrote: > Author: imp > Date: Sat Jan 9 00:01:35 2010 > New Revision: 201859 > URL: http://svn.freebsd.org/changeset/base/201859 >=20 > Log: > Merge r195030 from project/mips to head by hand > =20 > r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 > lines > - Switch to libc softfloat from libgcc implementation. The problem > with latter is that it is not complete, fpsetXXX/fpgetXXX > functions are missing. >=20 ... yet fpsetXXX is missing from the list of exported symbols? --=20 Alexander Kabaev --Sig_/gL7MYCDjOeG+IeLdgDbVdqU Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLR8mEQ6z1jMm+XZYRArfIAKCgVPdN+U2drtjtpTy07vFN1k31kgCgtE0q u33cGAxb5C0M2fcNiTNPLl4= =1Muh -----END PGP SIGNATURE----- --Sig_/gL7MYCDjOeG+IeLdgDbVdqU-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:13:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 512371065679; Sat, 9 Jan 2010 00:13:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3AA8FC15; Sat, 9 Jan 2010 00:13:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090D0WA034968; Sat, 9 Jan 2010 00:13:00 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090D0Jl034965; Sat, 9 Jan 2010 00:13:00 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090013.o090D0Jl034965@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201866 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:13:00 -0000 Author: yongari Date: Sat Jan 9 00:12:59 2010 New Revision: 201866 URL: http://svn.freebsd.org/changeset/base/201866 Log: MFC r200616-200617,200635,200639,200644 r200616: Add new flag VGE_FLAG_SUSPENDED to mark suspended state and remove suspended member in softc. r200617: Add "Velocity" to probe message which will make it clearer which ethernet controller was recognized. VIA consistently calls "Velocity" family for gigabit ethernet controllers. For fast ethernet controllers they uses "Rhine" family(vr(4) controllers)) and vr(4) already shows "Rhine" in probe message. r200635: Remove unused VGE_ETHER_ALIGN definition. r200639: Actually clear interrupts. Writing 0 has no effect. r200644: Remove unused member variable of softc. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:08:15 2010 (r201865) +++ stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:12:59 2010 (r201866) @@ -144,7 +144,7 @@ TUNABLE_INT("hw.vge.msi_disable", &msi_d */ static struct vge_type vge_devs[] = { { VIA_VENDORID, VIA_DEVICEID_61XX, - "VIA Networking Gigabit Ethernet" }, + "VIA Networking Velocity Gigabit Ethernet" }, { 0, 0, NULL } }; @@ -1728,15 +1728,11 @@ vge_intr(void *arg) uint32_t status; sc = arg; - - if (sc->suspended) { - return; - } - VGE_LOCK(sc); - ifp = sc->vge_ifp; - if (!(ifp->if_flags & IFF_UP)) { + ifp = sc->vge_ifp; + if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 || + (ifp->if_flags & IFF_UP) == 0) { VGE_UNLOCK(sc); return; } @@ -2164,7 +2160,7 @@ vge_init_locked(struct vge_softc *sc) * Enable interrupts. */ CSR_WRITE_4(sc, VGE_IMR, VGE_INTRS); - CSR_WRITE_4(sc, VGE_ISR, 0); + CSR_WRITE_4(sc, VGE_ISR, 0xFFFFFFFF); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } @@ -2430,7 +2426,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - sc->suspended = 1; + sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); @@ -2460,7 +2456,7 @@ vge_resume(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } - sc->suspended = 0; + sc->vge_flags &= ~VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:08:15 2010 (r201865) +++ stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:12:59 2010 (r201866) @@ -65,12 +65,6 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 -#ifdef VGE_FIXUP_RX -#define VGE_ETHER_ALIGN sizeof(uint32_t) -#else -#define VGE_ETHER_ALIGN 0 -#endif - struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -173,12 +167,12 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - uint8_t vge_type; int vge_if_flags; int vge_phyaddr; int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; @@ -189,8 +183,6 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; struct vge_hw_stats vge_stats; - - int suspended; /* 0 = normal 1 = suspended */ }; #define VGE_LOCK(_sc) mtx_lock(&(_sc)->vge_mtx) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:14:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC92E106566B; Sat, 9 Jan 2010 00:14:50 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CAFC08FC0A; Sat, 9 Jan 2010 00:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090EoV0035453; Sat, 9 Jan 2010 00:14:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090Eoua035450; Sat, 9 Jan 2010 00:14:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090014.o090Eoua035450@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201867 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:14:51 -0000 Author: yongari Date: Sat Jan 9 00:14:50 2010 New Revision: 201867 URL: http://svn.freebsd.org/changeset/base/201867 Log: MFC r200616-200617,200635,200639,200644 r200616: Add new flag VGE_FLAG_SUSPENDED to mark suspended state and remove suspended member in softc. r200617: Add "Velocity" to probe message which will make it clearer which ethernet controller was recognized. VIA consistently calls "Velocity" family for gigabit ethernet controllers. For fast ethernet controllers they uses "Rhine" family(vr(4) controllers)) and vr(4) already shows "Rhine" in probe message. r200635: Remove unused VGE_ETHER_ALIGN definition. r200639: Actually clear interrupts. Writing 0 has no effect. r200644: Remove unused member variable of softc. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:12:59 2010 (r201866) +++ stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:14:50 2010 (r201867) @@ -144,7 +144,7 @@ TUNABLE_INT("hw.vge.msi_disable", &msi_d */ static struct vge_type vge_devs[] = { { VIA_VENDORID, VIA_DEVICEID_61XX, - "VIA Networking Gigabit Ethernet" }, + "VIA Networking Velocity Gigabit Ethernet" }, { 0, 0, NULL } }; @@ -1729,15 +1729,11 @@ vge_intr(void *arg) uint32_t status; sc = arg; - - if (sc->suspended) { - return; - } - VGE_LOCK(sc); - ifp = sc->vge_ifp; - if (!(ifp->if_flags & IFF_UP)) { + ifp = sc->vge_ifp; + if ((sc->vge_flags & VGE_FLAG_SUSPENDED) != 0 || + (ifp->if_flags & IFF_UP) == 0) { VGE_UNLOCK(sc); return; } @@ -2165,7 +2161,7 @@ vge_init_locked(struct vge_softc *sc) * Enable interrupts. */ CSR_WRITE_4(sc, VGE_IMR, VGE_INTRS); - CSR_WRITE_4(sc, VGE_ISR, 0); + CSR_WRITE_4(sc, VGE_ISR, 0xFFFFFFFF); CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); } @@ -2431,7 +2427,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - sc->suspended = 1; + sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); @@ -2461,7 +2457,7 @@ vge_resume(device_t dev) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } - sc->suspended = 0; + sc->vge_flags &= ~VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); return (0); Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:12:59 2010 (r201866) +++ stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:14:50 2010 (r201867) @@ -65,12 +65,6 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 -#ifdef VGE_FIXUP_RX -#define VGE_ETHER_ALIGN sizeof(uint32_t) -#else -#define VGE_ETHER_ALIGN 0 -#endif - struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -173,12 +167,12 @@ struct vge_softc { struct resource *vge_irq; void *vge_intrhand; device_t vge_miibus; - uint8_t vge_type; int vge_if_flags; int vge_phyaddr; int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; @@ -189,8 +183,6 @@ struct vge_softc { struct vge_chain_data vge_cdata; struct vge_ring_data vge_rdata; struct vge_hw_stats vge_stats; - - int suspended; /* 0 = normal 1 = suspended */ }; #define VGE_LOCK(_sc) mtx_lock(&(_sc)->vge_mtx) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:17:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A69D106568B; Sat, 9 Jan 2010 00:17:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 374578FC25; Sat, 9 Jan 2010 00:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090HirY036136; Sat, 9 Jan 2010 00:17:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090HiUX036132; Sat, 9 Jan 2010 00:17:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090017.o090HiUX036132@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201868 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:17:44 -0000 Author: yongari Date: Sat Jan 9 00:17:43 2010 New Revision: 201868 URL: http://svn.freebsd.org/changeset/base/201868 Log: MFC r200638: Implement interrupt moderation scheme supported by VT61xx controllers. TX/RX interrupt mitigation is controlled by VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress generation of interrupts until the programmed frames counter equals to the registers. VT61xx also supports interrupt hold off timer register. If this interrupt hold off timer is active all interrupts would be disabled until the timer reaches to 0. The timer value is reloaded whenever VGE_ISR register written. The timer resolution is about 20us. Previously vge(4) used single shot timer to reduce Tx completion interrupts. This required VGE_CRS1 register access in Tx start/completion handler to rearm new timeout value and it did not show satisfactory result(more than 50k interrupts under load). Rx interrupts was not moderated at all such that vge(4) used to generate too many interrupts which in turn made polling(4) better approach under high network load. This change activates all interrupt moderation mechanism and initial values were tuned to generate interrupt less than 8k per second. That number of interrupts wouldn't add additional packet latencies compared to polling(4). These interrupt parameters could be changed with sysctl. dev.vge.%d.int_holdoff dev.vge.%d.rx_coal_pkt dev.vge.%d.tx_coal_pkt Interface has be brought down and up again before change take effect. With interrupt moderation there is no more need to loop in interrupt handler. This loop always added one more register access. While I'm here remove dead code which tried to implement subset of interrupt moderation. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgereg.h stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:14:50 2010 (r201867) +++ stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:17:43 2010 (r201868) @@ -175,6 +175,7 @@ static int vge_ifmedia_upd(struct ifnet static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); +static void vge_intr_holdoff(struct vge_softc *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); @@ -1631,15 +1632,6 @@ vge_txeof(struct vge_softc *sc) sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; - else { - /* - * If not all descriptors have been released reaped yet, - * reload the timer so that we will eventually get another - * interrupt that will cause us to re-enter this routine. - * This is done in case the transmitter has gone idle. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - } } static void @@ -1746,30 +1738,21 @@ vge_intr(void *arg) /* Disable interrupts */ CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_GMSK); - - for (;;) { - - status = CSR_READ_4(sc, VGE_ISR); - /* If the card has gone away the read returns 0xffff. */ - if (status == 0xFFFFFFFF) - break; - - if (status) - CSR_WRITE_4(sc, VGE_ISR, status); - - if ((status & VGE_INTRS) == 0) - break; - + status = CSR_READ_4(sc, VGE_ISR); + CSR_WRITE_4(sc, VGE_ISR, status | VGE_ISR_HOLDOFF_RELOAD); + /* If the card has gone away the read returns 0xffff. */ + if (status == 0xFFFFFFFF || (status & VGE_INTRS) == 0) + goto done; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (status & (VGE_ISR_RXOK|VGE_ISR_RXOK_HIPRIO)) vge_rxeof(sc, VGE_RX_DESC_CNT); - if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, VGE_RX_DESC_CNT); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } - if (status & (VGE_ISR_TXOK0|VGE_ISR_TIMER0)) + if (status & (VGE_ISR_TXOK0|VGE_ISR_TXOK_HIPRIO)) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) { @@ -1780,13 +1763,14 @@ vge_intr(void *arg) if (status & VGE_ISR_LINKSTS) vge_link_statchg(sc); } +done: + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + /* Re-enable interrupts */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - /* Re-enable interrupts */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vge_start_locked(ifp); - + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vge_start_locked(ifp); + } VGE_UNLOCK(sc); } @@ -1985,17 +1969,6 @@ vge_start_locked(struct ifnet *ifp) /* Issue a transmit command. */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_WAK0); /* - * Use the countdown timer for interrupt moderation. - * 'TX done' interrupts are disabled. Instead, we reset the - * countdown timer, which will begin counting until it hits - * the value in the SSTIMER register, and then trigger an - * interrupt. Each time we set the TIMER0_ENABLE bit, the - * the timer count is reloaded. Only when the transmitter - * is idle will the timer hit 0 and an interrupt fire. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - - /* * Set a timeout in case the chip goes out to lunch. */ sc->vge_timer = 5; @@ -2084,6 +2057,9 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_2(sc, VGE_RXDESCNUM, VGE_RX_DESC_CNT - 1); CSR_WRITE_2(sc, VGE_RXDESC_RESIDUECNT, VGE_RX_DESC_CNT); + /* Configure interrupt moderation. */ + vge_intr_holdoff(sc); + /* Enable and wake up the RX descriptor queue */ CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); @@ -2110,42 +2086,6 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS0, VGE_CR0_TX_ENABLE|VGE_CR0_RX_ENABLE|VGE_CR0_START); - /* - * Configure one-shot timer for microsecond - * resolution and load it for 500 usecs. - */ - CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); - CSR_WRITE_2(sc, VGE_SSTIMER, 400); - - /* - * Configure interrupt moderation for receive. Enable - * the holdoff counter and load it, and set the RX - * suppression count to the number of descriptors we - * want to allow before triggering an interrupt. - * The holdoff timer is in units of 20 usecs. - */ - -#ifdef notyet - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_TXINTSUP_DISABLE); - /* Select the interrupt holdoff timer page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); - CSR_WRITE_1(sc, VGE_INTHOLDOFF, 10); /* ~200 usecs */ - - /* Enable use of the holdoff timer. */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_SC_RELOAD); - - /* Select the RX suppression threshold page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); - CSR_WRITE_1(sc, VGE_RXSUPPTHR, 64); /* interrupt after 64 packets */ - - /* Restore the page select bits. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); -#endif - #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. @@ -2494,6 +2434,25 @@ vge_sysctl_node(struct vge_softc *sc) stats = &sc->vge_stats; ctx = device_get_sysctl_ctx(sc->vge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_holdoff", + CTLFLAG_RW, &sc->vge_int_holdoff, 0, "interrupt holdoff"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLFLAG_RW, &sc->vge_rx_coal_pkt, 0, "rx coalescing packet"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLFLAG_RW, &sc->vge_tx_coal_pkt, 0, "tx coalescing packet"); + + /* Pull in device tunables. */ + sc->vge_int_holdoff = VGE_INT_HOLDOFF_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "int_holdoff", &sc->vge_int_holdoff); + sc->vge_rx_coal_pkt = VGE_RX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "rx_coal_pkt", &sc->vge_rx_coal_pkt); + sc->vge_tx_coal_pkt = VGE_TX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "tx_coal_pkt", &sc->vge_tx_coal_pkt); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "VGE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2699,3 +2658,51 @@ reset_idx: mib[VGE_MIB_RX_SYMERRS] + mib[VGE_MIB_RX_LENERRS]; } + +static void +vge_intr_holdoff(struct vge_softc *sc) +{ + uint8_t intctl; + + VGE_LOCK_ASSERT(sc); + + /* + * Set Tx interrupt supression threshold. + * It's possible to use single-shot timer in VGE_CRS1 register + * in Tx path such that driver can remove most of Tx completion + * interrupts. However this requires additional access to + * VGE_CRS1 register to reload the timer in addintion to + * activating Tx kick command. Another downside is we don't know + * what single-shot timer value should be used in advance so + * reclaiming transmitted mbufs could be delayed a lot which in + * turn slows down Tx operation. + */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_TXSUPPTHR); + CSR_WRITE_1(sc, VGE_TXSUPPTHR, sc->vge_tx_coal_pkt); + + /* Set Rx interrupt suppresion threshold. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); + CSR_WRITE_1(sc, VGE_RXSUPPTHR, sc->vge_rx_coal_pkt); + + intctl = CSR_READ_1(sc, VGE_INTCTL1); + intctl &= ~VGE_INTCTL_SC_RELOAD; + intctl |= VGE_INTCTL_HC_RELOAD; + if (sc->vge_tx_coal_pkt <= 0) + intctl |= VGE_INTCTL_TXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_TXINTSUP_DISABLE; + if (sc->vge_rx_coal_pkt <= 0) + intctl |= VGE_INTCTL_RXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_RXINTSUP_DISABLE; + CSR_WRITE_1(sc, VGE_INTCTL1, intctl); + CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_HOLDOFF); + if (sc->vge_int_holdoff > 0) { + /* Set interrupt holdoff timer. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); + CSR_WRITE_1(sc, VGE_INTHOLDOFF, + VGE_INT_HOLDOFF_USEC(sc->vge_int_holdoff)); + /* Enable holdoff timer. */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); + } +} Modified: stable/8/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:14:50 2010 (r201867) +++ stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:17:43 2010 (r201868) @@ -300,8 +300,7 @@ #define VGE_INTRS (VGE_ISR_TXOK0|VGE_ISR_RXOK|VGE_ISR_STOPPED| \ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ - VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_TIMER0) + VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL) /* Interrupt mask register */ Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:14:50 2010 (r201867) +++ stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:17:43 2010 (r201868) @@ -65,6 +65,20 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 +#define VGE_INT_HOLDOFF_TICK 20 +#define VGE_INT_HOLDOFF_USEC(x) ((x) / VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_MIN 0 +#define VGE_INT_HOLDOFF_MAX (255 * VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_DEFAULT 150 + +#define VGE_RX_COAL_PKT_MIN 1 +#define VGE_RX_COAL_PKT_MAX VGE_RX_DESC_CNT +#define VGE_RX_COAL_PKT_DEFAULT 64 + +#define VGE_TX_COAL_PKT_MIN 1 +#define VGE_TX_COAL_PKT_MAX VGE_TX_DESC_CNT +#define VGE_TX_COAL_PKT_DEFAULT 128 + struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -176,6 +190,9 @@ struct vge_softc { #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; + int vge_int_holdoff; + int vge_rx_coal_pkt; + int vge_tx_coal_pkt; struct mtx vge_mtx; struct callout vge_watchdog; int vge_timer; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:20:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7912D106568B; Sat, 9 Jan 2010 00:20:17 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.24]) by mx1.freebsd.org (Postfix) with ESMTP id EF4838FC1D; Sat, 9 Jan 2010 00:20:16 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so4471808qwb.7 for ; Fri, 08 Jan 2010 16:20:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type; bh=9A6+m8Ws8ocKyQxsKGIzNtb2QozRmp7LTiUvj9vXh3Y=; b=YUt+vPtVwWINj2ohQ+GzYeChuBvbadT9jTwkOQr5opi9WXXr+nTwtjrUcQN+mVCGNO KwfdKRV5g68h+dGZL1PKR2VqG79BXHoZnfx/ll4uZnKjOWuGnTFInmjNWNdCfNJkBmUq ua1+RfCVWW5sEVtp2ivNUuemoemwaN+1L1Wqw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=OJfXjAg4xY6itttvobJA7Ldookcz4Q2JB5bsr4kW+Xz6kNWZARViSxmNkh9o6Zmw3e WDZta8CHXDJoIBUDLrbXXwaf+9lw+JWO3OjbLtdcupQerBwJhtt8IynZBiMNWrnxhax+ BSNIQEMVUar1PsV5VJeYCxdCaeVnx7dP/sq5U= Received: by 10.224.72.11 with SMTP id k11mr1677665qaj.5.1262996416028; Fri, 08 Jan 2010 16:20:16 -0800 (PST) Received: from kan.dnsalias.net (c-24-91-218-112.hsd1.ma.comcast.net [24.91.218.112]) by mx.google.com with ESMTPS id 7sm13803170qwf.14.2010.01.08.16.20.14 (version=SSLv3 cipher=RC4-MD5); Fri, 08 Jan 2010 16:20:14 -0800 (PST) Date: Fri, 8 Jan 2010 19:20:04 -0500 From: Alexander Kabaev To: Alexander Kabaev Message-ID: <20100108192004.5089586f@kan.dnsalias.net> In-Reply-To: <20100108191039.0143fa1d@kan.dnsalias.net> References: <201001090001.o0901Z3E032008@svn.freebsd.org> <20100108191039.0143fa1d@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.3 (GTK+ 2.18.5; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/L75gtXDQ_F.qbkw0a1swrTy"; protocol="application/pgp-signature" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r201859 - in head/lib/libc: . mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:20:17 -0000 --Sig_/L75gtXDQ_F.qbkw0a1swrTy Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 8 Jan 2010 19:10:39 -0500 Alexander Kabaev wrote: > On Sat, 9 Jan 2010 00:01:35 +0000 (UTC) > Warner Losh wrote: >=20 > > Author: imp > > Date: Sat Jan 9 00:01:35 2010 > > New Revision: 201859 > > URL: http://svn.freebsd.org/changeset/base/201859 > >=20 > > Log: > > Merge r195030 from project/mips to head by hand > > =20 > > r195030 | gonzo | 2009-06-25 19:27:31 -0600 (Thu, 25 Jun 2009) | 4 > > lines > > - Switch to libc softfloat from libgcc implementation. The problem > > with latter is that it is not complete, fpsetXXX/fpgetXXX > > functions are missing. > >=20 > ... yet fpsetXXX is missing from the list of exported symbols? >=20 > --=20 > Alexander Kabaev Never mind, softloat subdir exports them. --=20 Alexander Kabaev --Sig_/L75gtXDQ_F.qbkw0a1swrTy Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iD8DBQFLR8u9Q6z1jMm+XZYRAuXYAKCRttJ3s7Qy1SvlELeSeBFzepjD0wCg2h/o Alug3ho52MZVpHdiPfpW1cI= =PIQL -----END PGP SIGNATURE----- --Sig_/L75gtXDQ_F.qbkw0a1swrTy-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:20:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20BB9106568F; Sat, 9 Jan 2010 00:20:34 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D8C78FC1D; Sat, 9 Jan 2010 00:20:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090KXCe036810; Sat, 9 Jan 2010 00:20:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090KXjq036806; Sat, 9 Jan 2010 00:20:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090020.o090KXjq036806@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201869 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:20:34 -0000 Author: yongari Date: Sat Jan 9 00:20:33 2010 New Revision: 201869 URL: http://svn.freebsd.org/changeset/base/201869 Log: MFC r200638: Implement interrupt moderation scheme supported by VT61xx controllers. TX/RX interrupt mitigation is controlled by VGE_TXSUPPTHR and VGE_RXSUPPTHR register. These registers suppress generation of interrupts until the programmed frames counter equals to the registers. VT61xx also supports interrupt hold off timer register. If this interrupt hold off timer is active all interrupts would be disabled until the timer reaches to 0. The timer value is reloaded whenever VGE_ISR register written. The timer resolution is about 20us. Previously vge(4) used single shot timer to reduce Tx completion interrupts. This required VGE_CRS1 register access in Tx start/completion handler to rearm new timeout value and it did not show satisfactory result(more than 50k interrupts under load). Rx interrupts was not moderated at all such that vge(4) used to generate too many interrupts which in turn made polling(4) better approach under high network load. This change activates all interrupt moderation mechanism and initial values were tuned to generate interrupt less than 8k per second. That number of interrupts wouldn't add additional packet latencies compared to polling(4). These interrupt parameters could be changed with sysctl. dev.vge.%d.int_holdoff dev.vge.%d.rx_coal_pkt dev.vge.%d.tx_coal_pkt Interface has be brought down and up again before change take effect. With interrupt moderation there is no more need to loop in interrupt handler. This loop always added one more register access. While I'm here remove dead code which tried to implement subset of interrupt moderation. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgereg.h stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:17:43 2010 (r201868) +++ stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:20:33 2010 (r201869) @@ -175,6 +175,7 @@ static int vge_ifmedia_upd(struct ifnet static void vge_init(void *); static void vge_init_locked(struct vge_softc *); static void vge_intr(void *); +static void vge_intr_holdoff(struct vge_softc *); static int vge_ioctl(struct ifnet *, u_long, caddr_t); static void vge_link_statchg(void *); static int vge_miibus_readreg(device_t, int, int); @@ -1634,15 +1635,6 @@ vge_txeof(struct vge_softc *sc) sc->vge_cdata.vge_tx_considx = cons; if (sc->vge_cdata.vge_tx_cnt == 0) sc->vge_timer = 0; - else { - /* - * If not all descriptors have been released reaped yet, - * reload the timer so that we will eventually get another - * interrupt that will cause us to re-enter this routine. - * This is done in case the transmitter has gone idle. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - } } static void @@ -1747,30 +1739,21 @@ vge_intr(void *arg) /* Disable interrupts */ CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_GMSK); - - for (;;) { - - status = CSR_READ_4(sc, VGE_ISR); - /* If the card has gone away the read returns 0xffff. */ - if (status == 0xFFFFFFFF) - break; - - if (status) - CSR_WRITE_4(sc, VGE_ISR, status); - - if ((status & VGE_INTRS) == 0) - break; - + status = CSR_READ_4(sc, VGE_ISR); + CSR_WRITE_4(sc, VGE_ISR, status | VGE_ISR_HOLDOFF_RELOAD); + /* If the card has gone away the read returns 0xffff. */ + if (status == 0xFFFFFFFF || (status & VGE_INTRS) == 0) + goto done; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (status & (VGE_ISR_RXOK|VGE_ISR_RXOK_HIPRIO)) vge_rxeof(sc, VGE_RX_DESC_CNT); - if (status & (VGE_ISR_RXOFLOW|VGE_ISR_RXNODESC)) { vge_rxeof(sc, VGE_RX_DESC_CNT); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); } - if (status & (VGE_ISR_TXOK0|VGE_ISR_TIMER0)) + if (status & (VGE_ISR_TXOK0|VGE_ISR_TXOK_HIPRIO)) vge_txeof(sc); if (status & (VGE_ISR_TXDMA_STALL|VGE_ISR_RXDMA_STALL)) { @@ -1781,13 +1764,14 @@ vge_intr(void *arg) if (status & VGE_ISR_LINKSTS) vge_link_statchg(sc); } +done: + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + /* Re-enable interrupts */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - /* Re-enable interrupts */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_GMSK); - - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - vge_start_locked(ifp); - + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + vge_start_locked(ifp); + } VGE_UNLOCK(sc); } @@ -1986,17 +1970,6 @@ vge_start_locked(struct ifnet *ifp) /* Issue a transmit command. */ CSR_WRITE_2(sc, VGE_TXQCSRS, VGE_TXQCSR_WAK0); /* - * Use the countdown timer for interrupt moderation. - * 'TX done' interrupts are disabled. Instead, we reset the - * countdown timer, which will begin counting until it hits - * the value in the SSTIMER register, and then trigger an - * interrupt. Each time we set the TIMER0_ENABLE bit, the - * the timer count is reloaded. Only when the transmitter - * is idle will the timer hit 0 and an interrupt fire. - */ - CSR_WRITE_1(sc, VGE_CRS1, VGE_CR1_TIMER0_ENABLE); - - /* * Set a timeout in case the chip goes out to lunch. */ sc->vge_timer = 5; @@ -2085,6 +2058,9 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_2(sc, VGE_RXDESCNUM, VGE_RX_DESC_CNT - 1); CSR_WRITE_2(sc, VGE_RXDESC_RESIDUECNT, VGE_RX_DESC_CNT); + /* Configure interrupt moderation. */ + vge_intr_holdoff(sc); + /* Enable and wake up the RX descriptor queue */ CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_RUN); CSR_WRITE_1(sc, VGE_RXQCSRS, VGE_RXQCSR_WAK); @@ -2111,42 +2087,6 @@ vge_init_locked(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS0, VGE_CR0_TX_ENABLE|VGE_CR0_RX_ENABLE|VGE_CR0_START); - /* - * Configure one-shot timer for microsecond - * resolution and load it for 500 usecs. - */ - CSR_SETBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_TIMER0_RES); - CSR_WRITE_2(sc, VGE_SSTIMER, 400); - - /* - * Configure interrupt moderation for receive. Enable - * the holdoff counter and load it, and set the RX - * suppression count to the number of descriptors we - * want to allow before triggering an interrupt. - * The holdoff timer is in units of 20 usecs. - */ - -#ifdef notyet - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_TXINTSUP_DISABLE); - /* Select the interrupt holdoff timer page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); - CSR_WRITE_1(sc, VGE_INTHOLDOFF, 10); /* ~200 usecs */ - - /* Enable use of the holdoff timer. */ - CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); - CSR_WRITE_1(sc, VGE_INTCTL1, VGE_INTCTL_SC_RELOAD); - - /* Select the RX suppression threshold page. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); - CSR_WRITE_1(sc, VGE_RXSUPPTHR, 64); /* interrupt after 64 packets */ - - /* Restore the page select bits. */ - CSR_CLRBIT_1(sc, VGE_CAMCTL, VGE_CAMCTL_PAGESEL); - CSR_SETBIT_1(sc, VGE_CAMCTL, VGE_PAGESEL_MAR); -#endif - #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. @@ -2495,6 +2435,25 @@ vge_sysctl_node(struct vge_softc *sc) stats = &sc->vge_stats; ctx = device_get_sysctl_ctx(sc->vge_dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->vge_dev)); + + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "int_holdoff", + CTLFLAG_RW, &sc->vge_int_holdoff, 0, "interrupt holdoff"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_coal_pkt", + CTLFLAG_RW, &sc->vge_rx_coal_pkt, 0, "rx coalescing packet"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "tx_coal_pkt", + CTLFLAG_RW, &sc->vge_tx_coal_pkt, 0, "tx coalescing packet"); + + /* Pull in device tunables. */ + sc->vge_int_holdoff = VGE_INT_HOLDOFF_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "int_holdoff", &sc->vge_int_holdoff); + sc->vge_rx_coal_pkt = VGE_RX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "rx_coal_pkt", &sc->vge_rx_coal_pkt); + sc->vge_tx_coal_pkt = VGE_TX_COAL_PKT_DEFAULT; + resource_int_value(device_get_name(sc->vge_dev), + device_get_unit(sc->vge_dev), "tx_coal_pkt", &sc->vge_tx_coal_pkt); + tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "stats", CTLFLAG_RD, NULL, "VGE statistics"); parent = SYSCTL_CHILDREN(tree); @@ -2700,3 +2659,51 @@ reset_idx: mib[VGE_MIB_RX_SYMERRS] + mib[VGE_MIB_RX_LENERRS]; } + +static void +vge_intr_holdoff(struct vge_softc *sc) +{ + uint8_t intctl; + + VGE_LOCK_ASSERT(sc); + + /* + * Set Tx interrupt supression threshold. + * It's possible to use single-shot timer in VGE_CRS1 register + * in Tx path such that driver can remove most of Tx completion + * interrupts. However this requires additional access to + * VGE_CRS1 register to reload the timer in addintion to + * activating Tx kick command. Another downside is we don't know + * what single-shot timer value should be used in advance so + * reclaiming transmitted mbufs could be delayed a lot which in + * turn slows down Tx operation. + */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_TXSUPPTHR); + CSR_WRITE_1(sc, VGE_TXSUPPTHR, sc->vge_tx_coal_pkt); + + /* Set Rx interrupt suppresion threshold. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_RXSUPPTHR); + CSR_WRITE_1(sc, VGE_RXSUPPTHR, sc->vge_rx_coal_pkt); + + intctl = CSR_READ_1(sc, VGE_INTCTL1); + intctl &= ~VGE_INTCTL_SC_RELOAD; + intctl |= VGE_INTCTL_HC_RELOAD; + if (sc->vge_tx_coal_pkt <= 0) + intctl |= VGE_INTCTL_TXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_TXINTSUP_DISABLE; + if (sc->vge_rx_coal_pkt <= 0) + intctl |= VGE_INTCTL_RXINTSUP_DISABLE; + else + intctl &= ~VGE_INTCTL_RXINTSUP_DISABLE; + CSR_WRITE_1(sc, VGE_INTCTL1, intctl); + CSR_WRITE_1(sc, VGE_CRC3, VGE_CR3_INT_HOLDOFF); + if (sc->vge_int_holdoff > 0) { + /* Set interrupt holdoff timer. */ + CSR_WRITE_1(sc, VGE_CAMCTL, VGE_PAGESEL_INTHLDOFF); + CSR_WRITE_1(sc, VGE_INTHOLDOFF, + VGE_INT_HOLDOFF_USEC(sc->vge_int_holdoff)); + /* Enable holdoff timer. */ + CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); + } +} Modified: stable/7/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:17:43 2010 (r201868) +++ stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:20:33 2010 (r201869) @@ -300,8 +300,7 @@ #define VGE_INTRS (VGE_ISR_TXOK0|VGE_ISR_RXOK|VGE_ISR_STOPPED| \ VGE_ISR_RXOFLOW|VGE_ISR_PHYINT| \ VGE_ISR_LINKSTS|VGE_ISR_RXNODESC| \ - VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL| \ - VGE_ISR_TIMER0) + VGE_ISR_RXDMA_STALL|VGE_ISR_TXDMA_STALL) /* Interrupt mask register */ Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:17:43 2010 (r201868) +++ stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:20:33 2010 (r201869) @@ -65,6 +65,20 @@ #define VGE_RXBYTES(x) (((x) & VGE_RDSTS_BUFSIZ) >> 16) #define VGE_MIN_FRAMELEN 60 +#define VGE_INT_HOLDOFF_TICK 20 +#define VGE_INT_HOLDOFF_USEC(x) ((x) / VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_MIN 0 +#define VGE_INT_HOLDOFF_MAX (255 * VGE_INT_HOLDOFF_TICK) +#define VGE_INT_HOLDOFF_DEFAULT 150 + +#define VGE_RX_COAL_PKT_MIN 1 +#define VGE_RX_COAL_PKT_MAX VGE_RX_DESC_CNT +#define VGE_RX_COAL_PKT_DEFAULT 64 + +#define VGE_TX_COAL_PKT_MIN 1 +#define VGE_TX_COAL_PKT_MAX VGE_TX_DESC_CNT +#define VGE_TX_COAL_PKT_DEFAULT 128 + struct vge_type { uint16_t vge_vid; uint16_t vge_did; @@ -176,6 +190,9 @@ struct vge_softc { #define VGE_FLAG_LINK 0x8000 int vge_expcap; int vge_camidx; + int vge_int_holdoff; + int vge_rx_coal_pkt; + int vge_tx_coal_pkt; struct mtx vge_mtx; struct callout vge_watchdog; int vge_timer; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:24:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1243106568D; Sat, 9 Jan 2010 00:24:54 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 964C28FC25; Sat, 9 Jan 2010 00:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090Os1E037870; Sat, 9 Jan 2010 00:24:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090OsmW037868; Sat, 9 Jan 2010 00:24:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001090024.o090OsmW037868@svn.freebsd.org> From: Christian Brueffer Date: Sat, 9 Jan 2010 00:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201870 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:24:54 -0000 Author: brueffer Date: Sat Jan 9 00:24:54 2010 New Revision: 201870 URL: http://svn.freebsd.org/changeset/base/201870 Log: Various language fixes. PR: 38061 Submitted by: Chris Pepper MFC after: 1 week Modified: head/share/man/man4/faith.4 Modified: head/share/man/man4/faith.4 ============================================================================== --- head/share/man/man4/faith.4 Sat Jan 9 00:20:33 2010 (r201869) +++ head/share/man/man4/faith.4 Sat Jan 9 00:24:54 2010 (r201870) @@ -58,15 +58,15 @@ variable in .Xr rc.conf 5 . .Pp Special action will be taken when IPv6 TCP traffic is seen on a router, -and routing table suggests to route it to +and the routing table suggests to route it to the .Nm interface. In this case, the packet will be accepted by the router, -regardless of list of IPv6 interface addresses assigned to the router. -The packet will be captured by an IPv6 TCP socket, if it has +regardless of the list of IPv6 interface addresses assigned to the router. +The packet will be captured by an IPv6 TCP socket, if it has the .Dv IN6P_FAITH -flag turned on and it has matching address/port pairs. -In result, +flag turned on and matching address/port pairs. +As a result, .Nm will let you capture IPv6 TCP traffic to some specific destination addresses. Userland programs, such as @@ -79,43 +79,42 @@ and perform application-specific address .Pp The .Dv IN6P_FAITH -flag on IPv6 TCP socket can be set by using +flag on a IPv6 TCP socket can be set by using .Xr setsockopt 2 , -with level equals to +with level .Dv IPPROTO_IPV6 -and optname equals to +and optname .Dv IPv6_FAITH . .Pp -To handle error reports by ICMPv6, some of ICMPv6 packets routed to +To handle error reports by ICMPv6, some ICMPv6 packets routed to an .Nm interface will be delivered to IPv6 TCP, as well. .Pp To understand how .Nm -can be used, take a look at source code of +can be used, take a look at the source code of .Xr faithd 8 . .Pp -As +As the .Nm -interface implements potentially dangerous operation, -great care must be taken when configuring -.Nm -interface. -To avoid possible misuse, +interface implements potentially dangerous operations, +great care must be taken when configuring it. +To avoid possible misuse, the .Xr sysctl 8 variable .Li net.inet6.ip6.keepfaith must be set to .Li 1 -prior to the use of the interface. +prior to using the interface. When .Li net.inet6.ip6.keepfaith is .Li 0 , -no packet will be captured by +no packets will be captured by the .Nm interface. .Pp +The .Nm interface is intended to be used on routers, not on hosts. .\" @@ -130,5 +129,5 @@ interface is intended to be used on rout .%O RFC3142 .Re .Sh HISTORY -The FAITH IPv6-to-IPv4 TCP relay translator was first appeared in +The FAITH IPv6-to-IPv4 TCP relay translator first appeared in the WIDE hydrangea IPv6 stack. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:26:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5C681065676; Sat, 9 Jan 2010 00:26:57 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B32F28FC12; Sat, 9 Jan 2010 00:26:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090Qvqo038401; Sat, 9 Jan 2010 00:26:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090Qv1d038397; Sat, 9 Jan 2010 00:26:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090026.o090Qv1d038397@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201871 - stable/8/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:26:57 -0000 Author: yongari Date: Sat Jan 9 00:26:57 2010 New Revision: 201871 URL: http://svn.freebsd.org/changeset/base/201871 Log: MFC r200696,200740,200756,200758-200759,200972 r200696: Add rudimentary WOL support. While I'm here remove enabling busmastering/memory address in resume path. Bus driver will handle that. r200740: Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending timer for Tx queue is at 0x3E. r200756: Correct fragment bit definition in comments. r200758: VT6130 datasheet was wrong. If VT6130 receive a jumbo frame the controller will split the jumbo frame into multiple RX buffers. However it seems the hardware always dma the frame to 8 bytes boundary for the split frames. Only the first part of the fragment can have 4 byte alignment and subsequent buffers should be 8 bytes aligned. Change RX buffer the alignment requirement to 8 bytes from 4 bytes. r200759: Disable jumbo frame support for PCIe VT6130/VT6132 controllers. Quite contrary to VT6130 datasheet which says it supports up to 8K jumbo frame, VT6130 does not seem to send jumbo frame that is larger than 4K in length. Trying to send a frame that is larger than 4K cause TX MAC hang. Even though it's possible to allow 4K jumbo frame for VT6130, I think it's meaningless to allow 4K jumbo frame. I'm not sure VT6132 also has the same limitation but I guess it uses the same MAC of VT6130. r200972: Remove wrong assertion. Modified: stable/8/sys/dev/vge/if_vge.c stable/8/sys/dev/vge/if_vgereg.h stable/8/sys/dev/vge/if_vgevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/vge/if_vge.c ============================================================================== --- stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:24:54 2010 (r201870) +++ stable/8/sys/dev/vge/if_vge.c Sat Jan 9 00:26:57 2010 (r201871) @@ -157,6 +157,7 @@ static int vge_suspend(device_t); static void vge_cam_clear(struct vge_softc *); static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_clrwol(struct vge_softc *); static void vge_discard_rxbuf(struct vge_softc *, int); static int vge_dma_alloc(struct vge_softc *); static void vge_dma_free(struct vge_softc *); @@ -190,6 +191,7 @@ static int vge_rx_list_init(struct vge_s static int vge_rxeof(struct vge_softc *, int); static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); +static void vge_setwol(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stats_clear(struct vge_softc *); @@ -1011,6 +1013,11 @@ vge_attach(device_t dev) if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; + } else + sc->vge_flags |= VGE_FLAG_JUMBO; + if (pci_find_extcap(dev, PCIY_PMG, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PMCAP; + sc->vge_pmcap = cap; } rid = 0; msic = pci_msi_count(dev); @@ -1069,6 +1076,8 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + /* Clear WOL and take hardware from powerdown. */ + vge_clrwol(sc); vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) @@ -1098,6 +1107,8 @@ vge_attach(device_t dev) ifp->if_hwassist = VGE_CSUM_FEATURES; ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTAGGING; + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) + ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2211,9 +2222,17 @@ vge_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFMTU: - if (ifr->ifr_mtu > VGE_JUMBO_MTU) + VGE_LOCK(sc); + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > VGE_JUMBO_MTU) error = EINVAL; - ifp->if_mtu = ifr->ifr_mtu; + else if (ifp->if_mtu != ifr->ifr_mtu) { + if (ifr->ifr_mtu > ETHERMTU && + (sc->vge_flags & VGE_FLAG_JUMBO) == 0) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + } + VGE_UNLOCK(sc); break; case SIOCSIFFLAGS: VGE_LOCK(sc); @@ -2279,6 +2298,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_WOL_UCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -2365,7 +2393,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - + vge_setwol(sc); sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); @@ -2382,17 +2410,26 @@ vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; + uint16_t pmstat; sc = device_get_softc(dev); - ifp = sc->vge_ifp; - - /* reenable busmastering */ - pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - /* reinitialize interface if necessary */ VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, pmstat, 2); + } + } + vge_clrwol(sc); + /* Restart MII auto-polling. */ + vge_miipoll_start(sc); + ifp = sc->vge_ifp; + /* Reinitialize interface if necessary. */ + if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } @@ -2409,15 +2446,8 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; - sc = device_get_softc(dev); - - VGE_LOCK(sc); - vge_stop(sc); - VGE_UNLOCK(sc); - - return (0); + return (vge_suspend(dev)); } #define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ @@ -2543,8 +2573,6 @@ vge_stats_clear(struct vge_softc *sc) { int i; - VGE_LOCK_ASSERT(sc); - CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); CSR_WRITE_1(sc, VGE_MIBCSR, @@ -2706,3 +2734,154 @@ vge_intr_holdoff(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); } } + +static void +vge_setlinkspeed(struct vge_softc *sc) +{ + struct mii_data *mii; + int aneg, i; + + VGE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->vge_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + default: + break; + } + } + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_100T2CR, 0); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_ANAR, + ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* Poll link state until vge(4) get a 10/100 link. */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + return; + default: + break; + } + } + VGE_UNLOCK(sc); + pause("vgelnk", hz); + VGE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->vge_dev, "establishing link failed, " + "WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; +} + +static void +vge_setwol(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + + VGE_LOCK_ASSERT(sc); + + if ((sc->vge_flags & VGE_FLAG_PMCAP) == 0) { + /* No PME capability, PHY power down. */ + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_PDOWN); + vge_miipoll_stop(sc); + return; + } + + ifp = sc->vge_ifp; + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + vge_setlinkspeed(sc); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= VGE_WOLCR1_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= VGE_WOLCR1_MAGIC; + CSR_WRITE_1(sc, VGE_WOLCR1S, val); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= VGE_WOLCFG_SAM | VGE_WOLCFG_SAB; + CSR_WRITE_1(sc, VGE_WOLCFGS, val | VGE_WOLCFG_PMEOVR); + /* Disable MII auto-polling. */ + vge_miipoll_stop(sc); + } + CSR_SETBIT_1(sc, VGE_DIAGCTL, + VGE_DIAGCTL_MACFORCE | VGE_DIAGCTL_FDXFORCE); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Put hardware into sleep. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_DS0 | VGE_STICKHW_DS1; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->vge_dev, sc->vge_pmcap + + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, sc->vge_pmcap + PCIR_POWER_STATUS, + pmstat, 2); +} + +static void +vge_clrwol(struct vge_softc *sc) +{ + uint8_t val; + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Disable WOL and clear power state indicator. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~(VGE_STICKHW_DS0 | VGE_STICKHW_DS1); + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE); + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); +} Modified: stable/8/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:24:54 2010 (r201870) +++ stable/8/sys/dev/vge/if_vgereg.h Sat Jan 9 00:26:57 2010 (r201871) @@ -89,8 +89,8 @@ #define VGE_RXQCSRC 0x36 /* RX queue ctl/status clear */ #define VGE_RXDESC_ADDR_LO 0x38 /* RX desc base addr (lo 32 bits) */ #define VGE_RXDESC_CONSIDX 0x3C /* Current RX descriptor index */ -#define VGE_RXQTIMER 0x3E /* RX queue timer pend register */ -#define VGE_TXQTIMER 0x3F /* TX queue timer pend register */ +#define VGE_TXQTIMER 0x3E /* TX queue timer pend register */ +#define VGE_RXQTIMER 0x3F /* RX queue timer pend register */ #define VGE_TXDESC_ADDR_LO0 0x40 /* TX desc0 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO1 0x44 /* TX desc1 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO2 0x48 /* TX desc2 base addr (lo 32 bits) */ @@ -590,6 +590,42 @@ #define VGE_MIB_DATA_MASK 0x00FFFFFF #define VGE_MIB_DATA_IDX(x) ((x) >> 24) +/* Sticky bit shadow register */ + +#define VGE_STICKHW_DS0 0x01 +#define VGE_STICKHW_DS1 0x02 +#define VGE_STICKHW_WOL_ENB 0x04 +#define VGE_STICKHW_WOL_STS 0x08 +#define VGE_STICKHW_SWPTAG 0x10 + +/* WOL pattern control */ +#define VGE_WOLCR0_PATTERN0 0x01 +#define VGE_WOLCR0_PATTERN1 0x02 +#define VGE_WOLCR0_PATTERN2 0x04 +#define VGE_WOLCR0_PATTERN3 0x08 +#define VGE_WOLCR0_PATTERN4 0x10 +#define VGE_WOLCR0_PATTERN5 0x20 +#define VGE_WOLCR0_PATTERN6 0x40 +#define VGE_WOLCR0_PATTERN7 0x80 +#define VGE_WOLCR0_PATTERN_ALL 0xFF + +/* WOL event control */ +#define VGE_WOLCR1_UCAST 0x01 +#define VGE_WOLCR1_MAGIC 0x02 +#define VGE_WOLCR1_LINKON 0x04 +#define VGE_WOLCR1_LINKOFF 0x08 + +/* Poweer management config */ +#define VGE_PWRCFG_LEGACY_WOLEN 0x01 +#define VGE_PWRCFG_WOL_PULSE 0x20 +#define VGE_PWRCFG_WOL_BUTTON 0x00 + +/* WOL config register */ +#define VGE_WOLCFG_PHYINT_ENB 0x01 +#define VGE_WOLCFG_SAB 0x10 +#define VGE_WOLCFG_SAM 0x20 +#define VGE_WOLCFG_PMEOVR 0x80 + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ @@ -725,8 +761,8 @@ struct vge_rx_desc { #define VGE_RDSTS_OWN 0x80000000 /* own bit. */ #define VGE_RXPKT_ONEFRAG 0x00000000 /* only one fragment */ -#define VGE_RXPKT_EOF 0x00000100 /* first frag in frame */ -#define VGE_RXPKT_SOF 0x00000200 /* last frag in frame */ +#define VGE_RXPKT_EOF 0x00000100 /* last frag in frame */ +#define VGE_RXPKT_SOF 0x00000200 /* first frag in frame */ #define VGE_RXPKT_MOF 0x00000300 /* intermediate frag */ #define VGE_RDCTL_VLANID 0x0000FFFF /* VLAN ID info */ Modified: stable/8/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:24:54 2010 (r201870) +++ stable/8/sys/dev/vge/if_vgevar.h Sat Jan 9 00:26:57 2010 (r201871) @@ -39,7 +39,7 @@ #define VGE_TX_RING_ALIGN 64 #define VGE_RX_RING_ALIGN 64 #define VGE_MAXTXSEGS 6 -#define VGE_RX_BUF_ALIGN sizeof(uint32_t) +#define VGE_RX_BUF_ALIGN sizeof(uint64_t) /* * VIA Velocity allows 64bit DMA addressing but high 16bits @@ -186,9 +186,12 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_PMCAP 0x0004 +#define VGE_FLAG_JUMBO 0x0008 #define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; + int vge_pmcap; int vge_camidx; int vge_int_holdoff; int vge_rx_coal_pkt; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:27:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3300106568F; Sat, 9 Jan 2010 00:27:23 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913698FC15; Sat, 9 Jan 2010 00:27:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090RNZg038552; Sat, 9 Jan 2010 00:27:23 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090RNDK038550; Sat, 9 Jan 2010 00:27:23 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001090027.o090RNDK038550@svn.freebsd.org> From: Christian Brueffer Date: Sat, 9 Jan 2010 00:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201872 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:27:23 -0000 Author: brueffer Date: Sat Jan 9 00:27:23 2010 New Revision: 201872 URL: http://svn.freebsd.org/changeset/base/201872 Log: MFC: r201397 Add one more supported controller. Modified: stable/8/share/man/man4/mfi.4 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/mfi.4 ============================================================================== --- stable/8/share/man/man4/mfi.4 Sat Jan 9 00:26:57 2010 (r201871) +++ stable/8/share/man/man4/mfi.4 Sat Jan 9 00:27:23 2010 (r201872) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2009 +.Dd January 2, 2010 .Dt MFI 4 .Os .Sh NAME @@ -92,6 +92,8 @@ Dell PERC5 Dell PERC6 .It IBM ServeRAID-MR10i +.It +Intel RAID Controller SROMBSAS18E .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:28:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E9E41065672; Sat, 9 Jan 2010 00:28:06 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39E318FC1E; Sat, 9 Jan 2010 00:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090S6WS038791; Sat, 9 Jan 2010 00:28:06 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090S6V1038789; Sat, 9 Jan 2010 00:28:06 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001090028.o090S6V1038789@svn.freebsd.org> From: Christian Brueffer Date: Sat, 9 Jan 2010 00:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201873 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:28:06 -0000 Author: brueffer Date: Sat Jan 9 00:28:05 2010 New Revision: 201873 URL: http://svn.freebsd.org/changeset/base/201873 Log: MFC: r201397 Add one more supported controller. Modified: stable/7/share/man/man4/mfi.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/mfi.4 ============================================================================== --- stable/7/share/man/man4/mfi.4 Sat Jan 9 00:27:23 2010 (r201872) +++ stable/7/share/man/man4/mfi.4 Sat Jan 9 00:28:05 2010 (r201873) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2009 +.Dd January 2, 2010 .Dt MFI 4 .Os .Sh NAME @@ -92,6 +92,8 @@ Dell PERC5 Dell PERC6 .It IBM ServeRAID-MR10i +.It +Intel RAID Controller SROMBSAS18E .El .Sh FILES .Bl -tag -width ".Pa /dev/mfid?" -compact From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:29:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FB79106566B; Sat, 9 Jan 2010 00:29:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F12D48FC0A; Sat, 9 Jan 2010 00:29:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090T4Mm039086; Sat, 9 Jan 2010 00:29:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090T4mc039082; Sat, 9 Jan 2010 00:29:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090029.o090T4mc039082@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201874 - stable/7/sys/dev/vge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:29:05 -0000 Author: yongari Date: Sat Jan 9 00:29:04 2010 New Revision: 201874 URL: http://svn.freebsd.org/changeset/base/201874 Log: MFC r200696,200740,200756,200758-200759,200972 r200696: Add rudimentary WOL support. While I'm here remove enabling busmastering/memory address in resume path. Bus driver will handle that. r200740: Swap VGE_TXQTIMER and VGE_RXQTIMER register definition. Pending timer for Tx queue is at 0x3E. r200756: Correct fragment bit definition in comments. r200758: VT6130 datasheet was wrong. If VT6130 receive a jumbo frame the controller will split the jumbo frame into multiple RX buffers. However it seems the hardware always dma the frame to 8 bytes boundary for the split frames. Only the first part of the fragment can have 4 byte alignment and subsequent buffers should be 8 bytes aligned. Change RX buffer the alignment requirement to 8 bytes from 4 bytes. r200759: Disable jumbo frame support for PCIe VT6130/VT6132 controllers. Quite contrary to VT6130 datasheet which says it supports up to 8K jumbo frame, VT6130 does not seem to send jumbo frame that is larger than 4K in length. Trying to send a frame that is larger than 4K cause TX MAC hang. Even though it's possible to allow 4K jumbo frame for VT6130, I think it's meaningless to allow 4K jumbo frame. I'm not sure VT6132 also has the same limitation but I guess it uses the same MAC of VT6130. r200972: Remove wrong assertion. Modified: stable/7/sys/dev/vge/if_vge.c stable/7/sys/dev/vge/if_vgereg.h stable/7/sys/dev/vge/if_vgevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/vge/if_vge.c ============================================================================== --- stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:28:05 2010 (r201873) +++ stable/7/sys/dev/vge/if_vge.c Sat Jan 9 00:29:04 2010 (r201874) @@ -157,6 +157,7 @@ static int vge_suspend(device_t); static void vge_cam_clear(struct vge_softc *); static int vge_cam_set(struct vge_softc *, uint8_t *); +static void vge_clrwol(struct vge_softc *); static void vge_discard_rxbuf(struct vge_softc *, int); static int vge_dma_alloc(struct vge_softc *); static void vge_dma_free(struct vge_softc *); @@ -190,6 +191,7 @@ static int vge_rx_list_init(struct vge_s static int vge_rxeof(struct vge_softc *, int); static void vge_rxfilter(struct vge_softc *); static void vge_setvlan(struct vge_softc *); +static void vge_setwol(struct vge_softc *); static void vge_start(struct ifnet *); static void vge_start_locked(struct ifnet *); static void vge_stats_clear(struct vge_softc *); @@ -1014,6 +1016,11 @@ vge_attach(device_t dev) if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { sc->vge_flags |= VGE_FLAG_PCIE; sc->vge_expcap = cap; + } else + sc->vge_flags |= VGE_FLAG_JUMBO; + if (pci_find_extcap(dev, PCIY_PMG, &cap) == 0) { + sc->vge_flags |= VGE_FLAG_PMCAP; + sc->vge_pmcap = cap; } rid = 0; msic = pci_msi_count(dev); @@ -1072,6 +1079,8 @@ vge_attach(device_t dev) else sc->vge_phyaddr = CSR_READ_1(sc, VGE_MIICFG) & VGE_MIICFG_PHYADDR; + /* Clear WOL and take hardware from powerdown. */ + vge_clrwol(sc); vge_sysctl_node(sc); error = vge_dma_alloc(sc); if (error) @@ -1101,6 +1110,8 @@ vge_attach(device_t dev) ifp->if_hwassist = VGE_CSUM_FEATURES; ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWTAGGING; + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) + ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -2212,9 +2223,17 @@ vge_ioctl(struct ifnet *ifp, u_long comm switch (command) { case SIOCSIFMTU: - if (ifr->ifr_mtu > VGE_JUMBO_MTU) + VGE_LOCK(sc); + if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > VGE_JUMBO_MTU) error = EINVAL; - ifp->if_mtu = ifr->ifr_mtu; + else if (ifp->if_mtu != ifr->ifr_mtu) { + if (ifr->ifr_mtu > ETHERMTU && + (sc->vge_flags & VGE_FLAG_JUMBO) == 0) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + } + VGE_UNLOCK(sc); break; case SIOCSIFFLAGS: VGE_LOCK(sc); @@ -2280,6 +2299,15 @@ vge_ioctl(struct ifnet *ifp, u_long comm if ((mask & IFCAP_RXCSUM) != 0 && (ifp->if_capabilities & IFCAP_RXCSUM) != 0) ifp->if_capenable ^= IFCAP_RXCSUM; + if ((mask & IFCAP_WOL_UCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0 && + (ifp->if_capabilities & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; if ((mask & IFCAP_VLAN_HWCSUM) != 0 && (ifp->if_capabilities & IFCAP_VLAN_HWCSUM) != 0) ifp->if_capenable ^= IFCAP_VLAN_HWCSUM; @@ -2366,7 +2394,7 @@ vge_suspend(device_t dev) VGE_LOCK(sc); vge_stop(sc); - + vge_setwol(sc); sc->vge_flags |= VGE_FLAG_SUSPENDED; VGE_UNLOCK(sc); @@ -2383,17 +2411,26 @@ vge_resume(device_t dev) { struct vge_softc *sc; struct ifnet *ifp; + uint16_t pmstat; sc = device_get_softc(dev); - ifp = sc->vge_ifp; - - /* reenable busmastering */ - pci_enable_busmaster(dev); - pci_enable_io(dev, SYS_RES_MEMORY); - - /* reinitialize interface if necessary */ VGE_LOCK(sc); - if (ifp->if_flags & IFF_UP) { + if ((sc->vge_flags & VGE_FLAG_PMCAP) != 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, + sc->vge_pmcap + PCIR_POWER_STATUS, pmstat, 2); + } + } + vge_clrwol(sc); + /* Restart MII auto-polling. */ + vge_miipoll_start(sc); + ifp = sc->vge_ifp; + /* Reinitialize interface if necessary. */ + if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; vge_init_locked(sc); } @@ -2410,15 +2447,8 @@ vge_resume(device_t dev) static int vge_shutdown(device_t dev) { - struct vge_softc *sc; - sc = device_get_softc(dev); - - VGE_LOCK(sc); - vge_stop(sc); - VGE_UNLOCK(sc); - - return (0); + return (vge_suspend(dev)); } #define VGE_SYSCTL_STAT_ADD32(c, h, n, p, d) \ @@ -2544,8 +2574,6 @@ vge_stats_clear(struct vge_softc *sc) { int i; - VGE_LOCK_ASSERT(sc); - CSR_WRITE_1(sc, VGE_MIBCSR, CSR_READ_1(sc, VGE_MIBCSR) | VGE_MIBCSR_FREEZE); CSR_WRITE_1(sc, VGE_MIBCSR, @@ -2707,3 +2735,154 @@ vge_intr_holdoff(struct vge_softc *sc) CSR_WRITE_1(sc, VGE_CRS3, VGE_CR3_INT_HOLDOFF); } } + +static void +vge_setlinkspeed(struct vge_softc *sc) +{ + struct mii_data *mii; + int aneg, i; + + VGE_LOCK_ASSERT(sc); + + mii = device_get_softc(sc->vge_miibus); + mii_pollstat(mii); + aneg = 0; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch IFM_SUBTYPE(mii->mii_media_active) { + case IFM_10_T: + case IFM_100_TX: + return; + case IFM_1000_T: + aneg++; + default: + break; + } + } + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_100T2CR, 0); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_ANAR, + ANAR_TX_FD | ANAR_TX | ANAR_10_FD | ANAR_10 | ANAR_CSMA); + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_AUTOEN | BMCR_STARTNEG); + DELAY(1000); + if (aneg != 0) { + /* Poll link state until vge(4) get a 10/100 link. */ + for (i = 0; i < MII_ANEGTICKS_GIGE; i++) { + mii_pollstat(mii); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) + == (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + return; + default: + break; + } + } + VGE_UNLOCK(sc); + pause("vgelnk", hz); + VGE_LOCK(sc); + } + if (i == MII_ANEGTICKS_GIGE) + device_printf(sc->vge_dev, "establishing link failed, " + "WOL may not work!"); + } + /* + * No link, force MAC to have 100Mbps, full-duplex link. + * This is the last resort and may/may not work. + */ + mii->mii_media_status = IFM_AVALID | IFM_ACTIVE; + mii->mii_media_active = IFM_ETHER | IFM_100_TX | IFM_FDX; +} + +static void +vge_setwol(struct vge_softc *sc) +{ + struct ifnet *ifp; + uint16_t pmstat; + uint8_t val; + + VGE_LOCK_ASSERT(sc); + + if ((sc->vge_flags & VGE_FLAG_PMCAP) == 0) { + /* No PME capability, PHY power down. */ + vge_miibus_writereg(sc->vge_dev, sc->vge_phyaddr, MII_BMCR, + BMCR_PDOWN); + vge_miipoll_stop(sc); + return; + } + + ifp = sc->vge_ifp; + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + if ((ifp->if_capenable & IFCAP_WOL) != 0) { + vge_setlinkspeed(sc); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + val |= VGE_WOLCR1_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + val |= VGE_WOLCR1_MAGIC; + CSR_WRITE_1(sc, VGE_WOLCR1S, val); + val = 0; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + val |= VGE_WOLCFG_SAM | VGE_WOLCFG_SAB; + CSR_WRITE_1(sc, VGE_WOLCFGS, val | VGE_WOLCFG_PMEOVR); + /* Disable MII auto-polling. */ + vge_miipoll_stop(sc); + } + CSR_SETBIT_1(sc, VGE_DIAGCTL, + VGE_DIAGCTL_MACFORCE | VGE_DIAGCTL_FDXFORCE); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Put hardware into sleep. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val |= VGE_STICKHW_DS0 | VGE_STICKHW_DS1; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->vge_dev, sc->vge_pmcap + + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->vge_dev, sc->vge_pmcap + PCIR_POWER_STATUS, + pmstat, 2); +} + +static void +vge_clrwol(struct vge_softc *sc) +{ + uint8_t val; + + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~VGE_STICKHW_SWPTAG; + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + /* Disable WOL and clear power state indicator. */ + val = CSR_READ_1(sc, VGE_PWRSTAT); + val &= ~(VGE_STICKHW_DS0 | VGE_STICKHW_DS1); + CSR_WRITE_1(sc, VGE_PWRSTAT, val); + + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_GMII); + CSR_CLRBIT_1(sc, VGE_DIAGCTL, VGE_DIAGCTL_MACFORCE); + + /* Clear WOL on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLCR0C, VGE_WOLCR0_PATTERN_ALL); + /* Disable WOL on magic/unicast packet. */ + CSR_WRITE_1(sc, VGE_WOLCR1C, 0x0F); + CSR_WRITE_1(sc, VGE_WOLCFGC, VGE_WOLCFG_SAB | VGE_WOLCFG_SAM | + VGE_WOLCFG_PMEOVR); + /* Clear WOL status on pattern match. */ + CSR_WRITE_1(sc, VGE_WOLSR0C, 0xFF); + CSR_WRITE_1(sc, VGE_WOLSR1C, 0xFF); +} Modified: stable/7/sys/dev/vge/if_vgereg.h ============================================================================== --- stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:28:05 2010 (r201873) +++ stable/7/sys/dev/vge/if_vgereg.h Sat Jan 9 00:29:04 2010 (r201874) @@ -89,8 +89,8 @@ #define VGE_RXQCSRC 0x36 /* RX queue ctl/status clear */ #define VGE_RXDESC_ADDR_LO 0x38 /* RX desc base addr (lo 32 bits) */ #define VGE_RXDESC_CONSIDX 0x3C /* Current RX descriptor index */ -#define VGE_RXQTIMER 0x3E /* RX queue timer pend register */ -#define VGE_TXQTIMER 0x3F /* TX queue timer pend register */ +#define VGE_TXQTIMER 0x3E /* TX queue timer pend register */ +#define VGE_RXQTIMER 0x3F /* RX queue timer pend register */ #define VGE_TXDESC_ADDR_LO0 0x40 /* TX desc0 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO1 0x44 /* TX desc1 base addr (lo 32 bits) */ #define VGE_TXDESC_ADDR_LO2 0x48 /* TX desc2 base addr (lo 32 bits) */ @@ -590,6 +590,42 @@ #define VGE_MIB_DATA_MASK 0x00FFFFFF #define VGE_MIB_DATA_IDX(x) ((x) >> 24) +/* Sticky bit shadow register */ + +#define VGE_STICKHW_DS0 0x01 +#define VGE_STICKHW_DS1 0x02 +#define VGE_STICKHW_WOL_ENB 0x04 +#define VGE_STICKHW_WOL_STS 0x08 +#define VGE_STICKHW_SWPTAG 0x10 + +/* WOL pattern control */ +#define VGE_WOLCR0_PATTERN0 0x01 +#define VGE_WOLCR0_PATTERN1 0x02 +#define VGE_WOLCR0_PATTERN2 0x04 +#define VGE_WOLCR0_PATTERN3 0x08 +#define VGE_WOLCR0_PATTERN4 0x10 +#define VGE_WOLCR0_PATTERN5 0x20 +#define VGE_WOLCR0_PATTERN6 0x40 +#define VGE_WOLCR0_PATTERN7 0x80 +#define VGE_WOLCR0_PATTERN_ALL 0xFF + +/* WOL event control */ +#define VGE_WOLCR1_UCAST 0x01 +#define VGE_WOLCR1_MAGIC 0x02 +#define VGE_WOLCR1_LINKON 0x04 +#define VGE_WOLCR1_LINKOFF 0x08 + +/* Poweer management config */ +#define VGE_PWRCFG_LEGACY_WOLEN 0x01 +#define VGE_PWRCFG_WOL_PULSE 0x20 +#define VGE_PWRCFG_WOL_BUTTON 0x00 + +/* WOL config register */ +#define VGE_WOLCFG_PHYINT_ENB 0x01 +#define VGE_WOLCFG_SAB 0x10 +#define VGE_WOLCFG_SAM 0x20 +#define VGE_WOLCFG_PMEOVR 0x80 + /* EEPROM control/status register */ #define VGE_EECSR_EDO 0x01 /* data out pin */ @@ -725,8 +761,8 @@ struct vge_rx_desc { #define VGE_RDSTS_OWN 0x80000000 /* own bit. */ #define VGE_RXPKT_ONEFRAG 0x00000000 /* only one fragment */ -#define VGE_RXPKT_EOF 0x00000100 /* first frag in frame */ -#define VGE_RXPKT_SOF 0x00000200 /* last frag in frame */ +#define VGE_RXPKT_EOF 0x00000100 /* last frag in frame */ +#define VGE_RXPKT_SOF 0x00000200 /* first frag in frame */ #define VGE_RXPKT_MOF 0x00000300 /* intermediate frag */ #define VGE_RDCTL_VLANID 0x0000FFFF /* VLAN ID info */ Modified: stable/7/sys/dev/vge/if_vgevar.h ============================================================================== --- stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:28:05 2010 (r201873) +++ stable/7/sys/dev/vge/if_vgevar.h Sat Jan 9 00:29:04 2010 (r201874) @@ -39,7 +39,7 @@ #define VGE_TX_RING_ALIGN 64 #define VGE_RX_RING_ALIGN 64 #define VGE_MAXTXSEGS 6 -#define VGE_RX_BUF_ALIGN sizeof(uint32_t) +#define VGE_RX_BUF_ALIGN sizeof(uint64_t) /* * VIA Velocity allows 64bit DMA addressing but high 16bits @@ -186,9 +186,12 @@ struct vge_softc { int vge_flags; #define VGE_FLAG_PCIE 0x0001 #define VGE_FLAG_MSI 0x0002 +#define VGE_FLAG_PMCAP 0x0004 +#define VGE_FLAG_JUMBO 0x0008 #define VGE_FLAG_SUSPENDED 0x4000 #define VGE_FLAG_LINK 0x8000 int vge_expcap; + int vge_pmcap; int vge_camidx; int vge_int_holdoff; int vge_rx_coal_pkt; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:36:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9D9F106568F; Sat, 9 Jan 2010 00:36:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C78A18FC12; Sat, 9 Jan 2010 00:36:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090aSZ1040799; Sat, 9 Jan 2010 00:36:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090aSSx040797; Sat, 9 Jan 2010 00:36:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090036.o090aSSx040797@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201875 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:36:29 -0000 Author: yongari Date: Sat Jan 9 00:36:28 2010 New Revision: 201875 URL: http://svn.freebsd.org/changeset/base/201875 Log: MFC r200641,200676 r200641: Document newly added loader tunable and sysctl variables. o hw.vge.msi_disable o dev.vge.%d.int_holdoff o dev.vge.%d.rx_coal_pkt o dev.vge.%d.tx_coal_pkt r200676: Document more VIA Velocity family controllers to vge(4). Previously it mentioned only VT6122. While I'm here remove the mention of VT3119 which seems to be VIA's internal model name and VT3119 wouldn't be available to end users. Reviewed by: brueffer Modified: stable/8/share/man/man4/vge.4 Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) Modified: stable/8/share/man/man4/vge.4 ============================================================================== --- stable/8/share/man/man4/vge.4 Sat Jan 9 00:29:04 2010 (r201874) +++ stable/8/share/man/man4/vge.4 Sat Jan 9 00:36:28 2010 (r201875) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2007 +.Dd December 18, 2009 .Dt VGE 4 .Os .Sh NAME .Nm vge -.Nd "VIA Networking Technologies VT6122 PCI Gigabit Ethernet adapter driver" +.Nd "VIA Networking Technologies Velocity Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -55,22 +55,23 @@ if_vge_load="YES" The .Nm driver provides support for various NICs and embedded Ethernet interfaces -based on the VIA Networking Technologies VT6122 Gigabit Ethernet -controller chips. +based on the VIA Technologies VT6120, VT6122, VT6130 and VT6132 Velocity +Family Gigabit Ethernet controller chips. .Pp -The VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed MAC with -an integrated 10/100/1000 copper PHY. +The VT6120/VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed +MAC with an integrated 10/100/1000 copper PHY. (Some older cards use an external PHY.) +The VT6130/VT6132 is the PCI express version of Velocity family. The MAC supports TCP/IP hardware checksums (IPv4 only), TCP large send, VLAN tag insertion and stripping, as well as VLAN filtering, a 64-entry CAM filter and a 64-entry VLAN filter, 64-bit multicast hash filter, 4 separate transmit DMA queues, flow control and jumbo frames up to 16K in size. -The VT6122 has a 16K receive FIFO and 48K transmit FIFO. +The Velocity family controllers have a 16K receive FIFO and 48K transmit FIFO. .Pp The .Nm -driver takes advantage of the VT6122's checksum offload and VLAN +driver takes advantage of the controller's checksum offload and VLAN tagging features, as well as the jumbo frame and CAM filter support. The CAM filter is used for multicast address filtering to provide 64 perfect multicast address filter support. @@ -162,7 +163,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports VIA Networking VT3119 and VT6122 based +driver supports VIA Networking VT6120, VT6122, VT6130 and VT6132 based Gigabit Ethernet adapters including: .Pp .Bl -bullet -compact @@ -173,6 +174,38 @@ ZyXEL GN650-T 64-bit PCI Gigabit Etherne .It ZyXEL GN670-T 32-bit PCI Gigabit Ethernet NIC (ZX1702) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vge.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.vge.%d.int_holdoff +Maximum number of time to delay interrupts. +The valid range is 0 to 5100 in units of 1us, the default is +150 (150us). +The resolution of of timer is about 20us so finer tuning than +20us wouldn't be available. +The interface should be brought down and up again before a change +takes effect. +.It Va dev.vge.%d.rx_coal_pkt +Maximum number of packets to fire Rx completion interrupt. +The valid range is 1 to 255, the default is 64. +.It Va dev.vge.%d.tx_coal_pkt +Maximum number of packets to fire Tx completion interrupt. +The valid range is 1 to 255, the default is 128. +.El .Sh DIAGNOSTICS .Bl -diag .It "vge%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:39:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31513106568F; Sat, 9 Jan 2010 00:39:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0CF8FC1B; Sat, 9 Jan 2010 00:39:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o090dXb6041513; Sat, 9 Jan 2010 00:39:33 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o090dXjl041511; Sat, 9 Jan 2010 00:39:33 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090039.o090dXjl041511@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 00:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201876 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:39:33 -0000 Author: yongari Date: Sat Jan 9 00:39:32 2010 New Revision: 201876 URL: http://svn.freebsd.org/changeset/base/201876 Log: MFC r200641,200676 r200641: Document newly added loader tunable and sysctl variables. o hw.vge.msi_disable o dev.vge.%d.int_holdoff o dev.vge.%d.rx_coal_pkt o dev.vge.%d.tx_coal_pkt r200676: Document more VIA Velocity family controllers to vge(4). Previously it mentioned only VT6122. While I'm here remove the mention of VT3119 which seems to be VIA's internal model name and VT3119 wouldn't be available to end users. Reviewed by: brueffer Modified: stable/7/share/man/man4/vge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/vge.4 ============================================================================== --- stable/7/share/man/man4/vge.4 Sat Jan 9 00:36:28 2010 (r201875) +++ stable/7/share/man/man4/vge.4 Sat Jan 9 00:39:32 2010 (r201876) @@ -30,12 +30,12 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2007 +.Dd December 18, 2009 .Dt VGE 4 .Os .Sh NAME .Nm vge -.Nd "VIA Networking Technologies VT6122 PCI Gigabit Ethernet adapter driver" +.Nd "VIA Networking Technologies Velocity Gigabit Ethernet adapter driver" .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -55,22 +55,23 @@ if_vge_load="YES" The .Nm driver provides support for various NICs and embedded Ethernet interfaces -based on the VIA Networking Technologies VT6122 Gigabit Ethernet -controller chips. +based on the VIA Technologies VT6120, VT6122, VT6130 and VT6132 Velocity +Family Gigabit Ethernet controller chips. .Pp -The VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed MAC with -an integrated 10/100/1000 copper PHY. +The VT6120/VT6122 is a 33/66Mhz 64-bit PCI device which combines a tri-speed +MAC with an integrated 10/100/1000 copper PHY. (Some older cards use an external PHY.) +The VT6130/VT6132 is the PCI express version of Velocity family. The MAC supports TCP/IP hardware checksums (IPv4 only), TCP large send, VLAN tag insertion and stripping, as well as VLAN filtering, a 64-entry CAM filter and a 64-entry VLAN filter, 64-bit multicast hash filter, 4 separate transmit DMA queues, flow control and jumbo frames up to 16K in size. -The VT6122 has a 16K receive FIFO and 48K transmit FIFO. +The Velocity family controllers have a 16K receive FIFO and 48K transmit FIFO. .Pp The .Nm -driver takes advantage of the VT6122's checksum offload and VLAN +driver takes advantage of the controller's checksum offload and VLAN tagging features, as well as the jumbo frame and CAM filter support. The CAM filter is used for multicast address filtering to provide 64 perfect multicast address filter support. @@ -162,7 +163,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports VIA Networking VT3119 and VT6122 based +driver supports VIA Networking VT6120, VT6122, VT6130 and VT6132 based Gigabit Ethernet adapters including: .Pp .Bl -bullet -compact @@ -173,6 +174,38 @@ ZyXEL GN650-T 64-bit PCI Gigabit Etherne .It ZyXEL GN670-T 32-bit PCI Gigabit Ethernet NIC (ZX1702) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vge.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.vge.%d.int_holdoff +Maximum number of time to delay interrupts. +The valid range is 0 to 5100 in units of 1us, the default is +150 (150us). +The resolution of of timer is about 20us so finer tuning than +20us wouldn't be available. +The interface should be brought down and up again before a change +takes effect. +.It Va dev.vge.%d.rx_coal_pkt +Maximum number of packets to fire Rx completion interrupt. +The valid range is 1 to 255, the default is 64. +.It Va dev.vge.%d.tx_coal_pkt +Maximum number of packets to fire Tx completion interrupt. +The valid range is 1 to 255, the default is 128. +.El .Sh DIAGNOSTICS .Bl -diag .It "vge%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 00:49:10 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCED3106566B; Sat, 9 Jan 2010 00:49:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 613418FC13; Sat, 9 Jan 2010 00:49:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o090i9qa009031; Fri, 8 Jan 2010 17:44:09 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 08 Jan 2010 17:44:57 -0700 (MST) Message-Id: <20100108.174457.1108826596265063191.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201001061400.26082.jhb@freebsd.org> References: <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <201001061400.26082.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: dougb@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 00:49:10 -0000 In message: <201001061400.26082.jhb@freebsd.org> John Baldwin writes: : On Wednesday 06 January 2010 9:13:56 am Dag-Erling Sm=F8rgrav wrote: : > Doug Barton writes: : > > First off, thanks for sorting these, that's a step in the right : > > direction. :) However, a few quibbles. First, our rule is that : > > anything which might offend someone belongs in fortunes-o, and : > > political quotes are always in the category of "might offend some= one." : > = : > I don't see how the Rumsfeld quote could offend anyone. True, Rums= feld : > is a politician (and not a particularly popular one in most parts o= f the : > world), but the quote itself is not political. It is a somewhat : > comically worded expression of an important truism that many people= : > would do well to remember (cf. the classical "there are no unknown = bugs : > in our software"). Would you have suggested moving it to -o if it = had : > been a Steve Martin quote? : = : I agree that the quote isn't particularly politically partisan, just = made by a = : political figure. There are fortunes that are offensive. There are fortunes that are political. Political doesn't imply offensive, and it shouldn't be move to the fortunes-o file unless it is also offensive. Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 01:05:49 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85A291065672; Sat, 9 Jan 2010 01:05:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 140778FC0A; Sat, 9 Jan 2010 01:05:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o090tpZM009120; Fri, 8 Jan 2010 17:55:51 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 08 Jan 2010 17:56:40 -0700 (MST) Message-Id: <20100108.175640.1104512900458971844.imp@bsdimp.com> To: jhb@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201001080812.21124.jhb@freebsd.org> References: <20100107203536.GB8230@rincewind.paeps.cx> <20100107214334.GA35184@onelab2.iet.unipi.it> <201001080812.21124.jhb@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, tuexen@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, rizzo@iet.unipi.it Subject: Re: moving sctp to a separate directory ? X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 01:05:49 -0000 In message: <201001080812.21124.jhb@freebsd.org> John Baldwin writes: : On Thursday 07 January 2010 4:43:34 pm Luigi Rizzo wrote: : > > What do you do with udp, for instance? Compared to tcp and sctp, it's : > > trivial in terms of code, but it's an upper layer protocol from the : > > perspective of netinet/netinet6 - do we put it in its own directory too? : > > Also note that this won't only cause churn for people who have patches against : > > or (out-of-tree) branches from netinet/, but also in other kernel subsystems : > > which rely on tcp -- nfs, for instance. : > : > + i find the concern about churn in external patchsets a bit weak, first of : > all because this is bound to happen unless we stop all development, : > and secondly because this kind of file moving or splitting happens : > once every 10-15 years which is well beyond the lifetime of a patchset. : : Having the files rename is entirely different from merging changes. At least : for svn and p4 I believe that merging a rename into a branch is not smart : enough to merge your local changes into the new files. Instead it involves a : big manual fixup. : : Also, the 10-15 years thing is completely non-relevant. What is relevant is : if you are working on a project in a branch and someone renames files before : you have finished your branch and merged it up to HEAD. For example, assume : that someone else renamed the ipfw files in HEAD next week. That would : create an utter mess for you to resolve in your current ipfw3 branch. Moving : TCP would create similar a headache, except much more widespread since TCP is : one of the most widely worked-on subsystems. : : FWIW, I do think it would be cleaner to have netinet more split up perhaps, : but I do not think it is worth the pain that would be involved. It is painful enough moving drivers around. I think that while well intentioned, it will cause us nothing but grief. Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 01:06:02 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FC5010657D2; Sat, 9 Jan 2010 01:06:02 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 33FAA8FC18; Sat, 9 Jan 2010 01:06:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o090sOmv009078; Fri, 8 Jan 2010 17:54:24 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Fri, 08 Jan 2010 17:55:12 -0700 (MST) Message-Id: <20100108.175512.706189011738064018.imp@bsdimp.com> To: unixmania@gmail.com From: "M. Warner Losh" In-Reply-To: References: <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: dougb@FreeBSD.org, svn-src-all@FreeBSD.org, stas@FreeBSD.org, src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 01:06:02 -0000 In message: = "Carlos A. M. dos Santos" writes: : 2010/1/8 Doug Barton : : > Dag-Erling Sm=F8rgrav wrote: : >> I don't see how the Rumsfeld quote could offend anyone. : > : > A) Better safe than sorry : > B) Regardless of my own opinions I can easily see how someone could= be : > offended by anything having to do with Rumsfeld, the Iraq war, etc.= : = : Perhaps, at the moment. Five to ten years from now that quotation wil= l : be just history, like the ones from/about JFK, Richard Nixon, and : Spiro Agnew. Are you whiling to apply such rule to all supposedly : political fortunes? : = : : Looks like political correctness started to infect the BSD culture. : Once upon a time this was the OS with guts to have a function called : "die_you_gravy_sucking_pig_dog". : It should be moved back. Doug is being too sensitive here. IMHO. Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 01:17:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76DEB1065670; Sat, 9 Jan 2010 01:17:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650EE8FC19; Sat, 9 Jan 2010 01:17:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o091HVoA049956; Sat, 9 Jan 2010 01:17:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o091HVlE049954; Sat, 9 Jan 2010 01:17:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090117.o091HVlE049954@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 01:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201877 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 01:17:31 -0000 Author: yongari Date: Sat Jan 9 01:17:31 2010 New Revision: 201877 URL: http://svn.freebsd.org/changeset/base/201877 Log: MFC r200693: Make sure to enable Next Page bit for IP1001. Otherwise the PHY fails to re-establishe 1000baseT link after downgrading to 10/100Mbps link. Modified: stable/8/sys/dev/mii/ip1000phy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/8/sys/dev/mii/ip1000phy.c Sat Jan 9 00:39:32 2010 (r201876) +++ stable/8/sys/dev/mii/ip1000phy.c Sat Jan 9 01:17:31 2010 (r201877) @@ -398,8 +398,10 @@ ip1000phy_mii_phy_auto(struct mii_softc isc = (struct ip1000phy_softc *)sc; reg = 0; - if (isc->model == MII_MODEL_ICPLUS_IP1001) + if (isc->model == MII_MODEL_ICPLUS_IP1001) { reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_NP; + } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 01:20:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9EA3106566C; Sat, 9 Jan 2010 01:20:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A78608FC36; Sat, 9 Jan 2010 01:20:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o091K1mB050526; Sat, 9 Jan 2010 01:20:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o091K13Y050524; Sat, 9 Jan 2010 01:20:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201001090120.o091K13Y050524@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 9 Jan 2010 01:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201878 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 01:20:01 -0000 Author: yongari Date: Sat Jan 9 01:20:01 2010 New Revision: 201878 URL: http://svn.freebsd.org/changeset/base/201878 Log: MFC r200693: Make sure to enable Next Page bit for IP1001. Otherwise the PHY fails to re-establishe 1000baseT link after downgrading to 10/100Mbps link. Modified: stable/7/sys/dev/mii/ip1000phy.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Sat Jan 9 01:17:31 2010 (r201877) +++ stable/7/sys/dev/mii/ip1000phy.c Sat Jan 9 01:20:01 2010 (r201878) @@ -398,8 +398,10 @@ ip1000phy_mii_phy_auto(struct mii_softc isc = (struct ip1000phy_softc *)sc; reg = 0; - if (isc->model == MII_MODEL_ICPLUS_IP1001) + if (isc->model == MII_MODEL_ICPLUS_IP1001) { reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_NP; + } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 01:46:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12555106568D; Sat, 9 Jan 2010 01:46:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38078FC1B; Sat, 9 Jan 2010 01:46:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o091kcfR056379; Sat, 9 Jan 2010 01:46:38 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o091kc2i056369; Sat, 9 Jan 2010 01:46:38 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201001090146.o091kc2i056369@svn.freebsd.org> From: Attilio Rao Date: Sat, 9 Jan 2010 01:46:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201879 - in head: . share/man/man9 sys/conf sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 01:46:39 -0000 Author: attilio Date: Sat Jan 9 01:46:38 2010 New Revision: 201879 URL: http://svn.freebsd.org/changeset/base/201879 Log: Introduce the new kernel thread called "deadlock resolver". While the name is pretentious, a good explanation of its targets is reported in this 17 months old presentation e-mail: http://lists.freebsd.org/pipermail/freebsd-arch/2008-August/008452.html In order to implement it, the sq_type in sleepqueues is mandatory and not only compiled along with INVARIANTS option. Additively, a new sleepqueue function, sleepq_type() is added, returning the type of the sleepqueue linked to a wchan. Three new sysctls are added in order to configure the thread: debug.deadlkres.slptime_threshold debug.deadlkres.blktime_threshold debug.deadlkres.sleepfreq rappresenting the thresholds for sleep and block time that will lead to a deadlock matching (when exceeded), while the sleepfreq rappresents the number of seconds between 2 consecutive thread runnings. In order to enable the deadlock resolver thread recompile your kernel with the option DEADLKRES. Reviewed by: jeff Tested by: pho, Giovanni Trematerra Sponsored by: Nokia Incorporated, Sandvine Incorporated MFC after: 2 weeks Modified: head/UPDATING head/share/man/man9/sleepqueue.9 head/sys/conf/NOTES head/sys/conf/options head/sys/kern/kern_clock.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_turnstile.c head/sys/sys/proc.h head/sys/sys/sleepqueue.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jan 9 01:20:01 2010 (r201878) +++ head/UPDATING Sat Jan 9 01:46:38 2010 (r201879) @@ -22,6 +22,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20100108: + Introduce the kernel thread "deadlock resolver" (which can be enabled + via the DEADLKRES option, see NOTES for more details) and the + sleepq_type() function for sleepqueues. + 20091202: The rc.firewall and rc.firewall6 were unified, and rc.firewall6 and rc.d/ip6fw were removed. Modified: head/share/man/man9/sleepqueue.9 ============================================================================== --- head/share/man/man9/sleepqueue.9 Sat Jan 9 01:20:01 2010 (r201878) +++ head/share/man/man9/sleepqueue.9 Sat Jan 9 01:46:38 2010 (r201879) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 12, 2009 +.Dd January 8, 2010 .Dt SLEEPQUEUE 9 .Os .Sh NAME @@ -44,6 +44,7 @@ .Nm sleepq_sleepcnt , .Nm sleepq_timedwait , .Nm sleepq_timedwait_sig , +.Nm sleepq_type , .Nm sleepq_wait , .Nm sleepq_wait_sig .Nd manage the queues of sleeping threads @@ -84,6 +85,8 @@ .Fn sleepq_timedwait "void *wchan" .Ft int .Fn sleepq_timedwait_sig "void *wchan" "int signal_caught" +.Ft int +.Fn sleepq_type "void *wchan" .Ft void .Fn sleepq_wait "void *wchan" .Ft int @@ -366,6 +369,12 @@ given a .Fa wchan . .Pp The +.Fn sleepq_type +function returns the type of +.Fa wchan +associated to a sleepqueue. +.Pp +The .Fn sleepq_abort , .Fn sleepq_broadcast , and Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/conf/NOTES Sat Jan 9 01:46:38 2010 (r201879) @@ -2531,6 +2531,11 @@ options BOOTP_BLOCKSIZE=8192 # Override options SW_WATCHDOG # +# Add the software deadlock resolver thread. +# +options DEADLKRES + +# # Disable swapping of stack pages. This option removes all # code which actually performs swapping, so it's not possible to turn # it back on at run-time. Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/conf/options Sat Jan 9 01:46:38 2010 (r201879) @@ -72,6 +72,7 @@ COMPAT_FREEBSD6 opt_compat.h COMPAT_FREEBSD7 opt_compat.h COMPILING_LINT opt_global.h CY_PCI_FASTINTR +DEADLKRES opt_watchdog.h DIRECTIO FULL_PREEMPTION opt_sched.h IPI_PREEMPTION opt_sched.h Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/kern/kern_clock.c Sat Jan 9 01:46:38 2010 (r201879) @@ -48,14 +48,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -159,6 +161,124 @@ sysctl_kern_cp_times(SYSCTL_HANDLER_ARGS SYSCTL_PROC(_kern, OID_AUTO, cp_times, CTLTYPE_LONG|CTLFLAG_RD|CTLFLAG_MPSAFE, 0,0, sysctl_kern_cp_times, "LU", "per-CPU time statistics"); +#ifdef DEADLKRES +static int slptime_threshold = 1800; +static int blktime_threshold = 900; +static int sleepfreq = 3; + +static void +deadlkres(void) +{ + struct proc *p; + struct thread *td; + void *wchan; + int blkticks, slpticks, slptype, tryl, tticks; + + tryl = 0; + for (;;) { + blkticks = blktime_threshold * hz; + slpticks = slptime_threshold * hz; + + /* + * Avoid to sleep on the sx_lock in order to avoid a possible + * priority inversion problem leading to starvation. + * If the lock can't be held after 100 tries, panic. + */ + if (!sx_try_slock(&allproc_lock)) { + if (tryl > 100) + panic("%s: possible deadlock detected on allproc_lock\n", + __func__); + tryl++; + pause("allproc_lock deadlkres", sleepfreq * hz); + continue; + } + tryl = 0; + FOREACH_PROC_IN_SYSTEM(p) { + PROC_LOCK(p); + FOREACH_THREAD_IN_PROC(p, td) { + thread_lock(td); + if (TD_ON_LOCK(td)) { + + /* + * The thread should be blocked on a + * turnstile, simply check if the + * turnstile channel is in good state. + */ + MPASS(td->td_blocked != NULL); + tticks = ticks - td->td_blktick; + thread_unlock(td); + if (tticks > blkticks) { + + /* + * Accordingly with provided + * thresholds, this thread is + * stuck for too long on a + * turnstile. + */ + PROC_UNLOCK(p); + sx_sunlock(&allproc_lock); + panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", + __func__, td, tticks); + } + } else if (TD_IS_SLEEPING(td)) { + + /* + * Check if the thread is sleeping on a + * lock, otherwise skip the check. + * Drop the thread lock in order to + * avoid a LOR with the sleepqueue + * spinlock. + */ + wchan = td->td_wchan; + tticks = ticks - td->td_slptick; + thread_unlock(td); + slptype = sleepq_type(wchan); + if ((slptype == SLEEPQ_SX || + slptype == SLEEPQ_LK) && + tticks > slpticks) { + + /* + * Accordingly with provided + * thresholds, this thread is + * stuck for too long on a + * sleepqueue. + */ + PROC_UNLOCK(p); + sx_sunlock(&allproc_lock); + panic("%s: possible deadlock detected for %p, blocked for %d ticks\n", + __func__, td, tticks); + } + } else + thread_unlock(td); + } + PROC_UNLOCK(p); + } + sx_sunlock(&allproc_lock); + + /* Sleep for sleepfreq seconds. */ + pause("deadlkres", sleepfreq * hz); + } +} + +static struct kthread_desc deadlkres_kd = { + "deadlkres", + deadlkres, + (struct thread **)NULL +}; + +SYSINIT(deadlkres, SI_SUB_CLOCKS, SI_ORDER_ANY, kthread_start, &deadlkres_kd); + +SYSCTL_NODE(_debug, OID_AUTO, deadlkres, CTLFLAG_RW, 0, "Deadlock resolver"); +SYSCTL_INT(_debug_deadlkres, OID_AUTO, slptime_threshold, CTLFLAG_RW, + &slptime_threshold, 0, + "Number of seconds within is valid to sleep on a sleepqueue"); +SYSCTL_INT(_debug_deadlkres, OID_AUTO, blktime_threshold, CTLFLAG_RW, + &blktime_threshold, 0, + "Number of seconds within is valid to block on a turnstile"); +SYSCTL_INT(_debug_deadlkres, OID_AUTO, sleepfreq, CTLFLAG_RW, &sleepfreq, 0, + "Number of seconds between any deadlock resolver thread run"); +#endif /* DEADLKRES */ + void read_cpu_time(long *cp_time) { Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/kern/subr_sleepqueue.c Sat Jan 9 01:46:38 2010 (r201879) @@ -122,8 +122,8 @@ struct sleepqueue { LIST_ENTRY(sleepqueue) sq_hash; /* (c) Chain and free list. */ LIST_HEAD(, sleepqueue) sq_free; /* (c) Free queues. */ void *sq_wchan; /* (c) Wait channel. */ -#ifdef INVARIANTS int sq_type; /* (c) Queue type. */ +#ifdef INVARIANTS struct lock_object *sq_lock; /* (c) Associated lock. */ #endif }; @@ -317,7 +317,6 @@ sleepq_add(void *wchan, struct lock_obje ("thread's sleep queue has a non-empty free list")); KASSERT(sq->sq_wchan == NULL, ("stale sq_wchan pointer")); sq->sq_lock = lock; - sq->sq_type = flags & SLEEPQ_TYPE; #endif #ifdef SLEEPQUEUE_PROFILING sc->sc_depth++; @@ -330,6 +329,7 @@ sleepq_add(void *wchan, struct lock_obje sq = td->td_sleepqueue; LIST_INSERT_HEAD(&sc->sc_queues, sq, sq_hash); sq->sq_wchan = wchan; + sq->sq_type = flags & SLEEPQ_TYPE; } else { MPASS(wchan == sq->sq_wchan); MPASS(lock == sq->sq_lock); @@ -669,6 +669,28 @@ sleepq_timedwait_sig(void *wchan, int pr } /* + * Returns the type of sleepqueue given a waitchannel. + */ +int +sleepq_type(void *wchan) +{ + struct sleepqueue *sq; + int type; + + MPASS(wchan != NULL); + + sleepq_lock(wchan); + sq = sleepq_lookup(wchan); + if (sq == NULL) { + sleepq_release(wchan); + return (-1); + } + type = sq->sq_type; + sleepq_release(wchan); + return (type); +} + +/* * Removes a thread from a sleep queue and makes it * runnable. */ @@ -1176,8 +1198,8 @@ DB_SHOW_COMMAND(sleepq, db_show_sleepque return; found: db_printf("Wait channel: %p\n", sq->sq_wchan); -#ifdef INVARIANTS db_printf("Queue type: %d\n", sq->sq_type); +#ifdef INVARIANTS if (sq->sq_lock) { lock = sq->sq_lock; db_printf("Associated Interlock: %p - (%s) %s\n", lock, Modified: head/sys/kern/subr_turnstile.c ============================================================================== --- head/sys/kern/subr_turnstile.c Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/kern/subr_turnstile.c Sat Jan 9 01:46:38 2010 (r201879) @@ -733,6 +733,7 @@ turnstile_wait(struct turnstile *ts, str td->td_tsqueue = queue; td->td_blocked = ts; td->td_lockname = lock->lo_name; + td->td_blktick = ticks; TD_SET_LOCK(td); mtx_unlock_spin(&tc->tc_lock); propagate_priority(td); @@ -925,6 +926,7 @@ turnstile_unpend(struct turnstile *ts, i MPASS(TD_CAN_RUN(td)); td->td_blocked = NULL; td->td_lockname = NULL; + td->td_blktick = 0; #ifdef INVARIANTS td->td_tsqueue = 0xff; #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/sys/proc.h Sat Jan 9 01:46:38 2010 (r201879) @@ -218,6 +218,7 @@ struct thread { struct ucred *td_ucred; /* (k) Reference to credentials. */ u_int td_estcpu; /* (t) estimated cpu utilization */ int td_slptick; /* (t) Time at sleep. */ + int td_blktick; /* (t) Time spent blocked. */ struct rusage td_ru; /* (t) rusage information */ uint64_t td_incruntime; /* (t) Cpu ticks to transfer to proc. */ uint64_t td_runtime; /* (t) How many cpu ticks we've run. */ Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Sat Jan 9 01:20:01 2010 (r201878) +++ head/sys/sys/sleepqueue.h Sat Jan 9 01:46:38 2010 (r201879) @@ -112,6 +112,7 @@ void sleepq_set_timeout(void *wchan, int u_int sleepq_sleepcnt(void *wchan, int queue); int sleepq_timedwait(void *wchan, int pri); int sleepq_timedwait_sig(void *wchan, int pri); +int sleepq_type(void *wchan); void sleepq_wait(void *wchan, int pri); int sleepq_wait_sig(void *wchan, int pri); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 04:00:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFEE4106566B; Sat, 9 Jan 2010 04:00:22 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADEFA8FC08; Sat, 9 Jan 2010 04:00:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0940M8Y086235; Sat, 9 Jan 2010 04:00:22 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0940MPm086232; Sat, 9 Jan 2010 04:00:22 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201001090400.o0940MPm086232@svn.freebsd.org> From: Giorgos Keramidas Date: Sat, 9 Jan 2010 04:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201882 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 04:00:22 -0000 Author: keramida (doc committer) Date: Sat Jan 9 04:00:22 2010 New Revision: 201882 URL: http://svn.freebsd.org/changeset/base/201882 Log: Revert iwn channel-argument handling of set_txpower() to r201822 Pass the channel argument as a real argument and not through RXON. The RXON version seems to have problem with both the older 228.57.2.23 firmware and the latest 228.61.2.24 version resulting in device initialization errors like: wpa_supplicant[2928]: Failed to initiate AP scan. kernel: firmware error log: kernel: error type = "SYSASSERT" (0x00000005) kernel: program counter = 0x0000147C kernel: source line = 0x0000058B kernel: error data = 0x0000058B00000000 kernel: branch link = 0x0000145A00001492 kernel: interrupt link = 0x000006DE00000000 kernel: time = 7310 ... kernel: iwn0: iwn_config: could not set TX power kernel: iwn0: iwn_init_locked: could not configure device, error 35 By passing the current channel to hal->set_txpower() the firmware error is fixed, at least for the 4965 chipset of my Thinkpad and the ones tested by Bernhard. Submitted by: Bernhard Schmidt Approved by: rpaulo Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Jan 9 03:08:22 2010 (r201881) +++ head/sys/dev/iwn/if_iwn.c Sat Jan 9 04:00:22 2010 (r201882) @@ -171,8 +171,10 @@ void iwn_set_led(struct iwn_softc *, ui int iwn_set_critical_temp(struct iwn_softc *); int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *); void iwn4965_power_calibration(struct iwn_softc *, int); -int iwn4965_set_txpower(struct iwn_softc *, int); -int iwn5000_set_txpower(struct iwn_softc *, int); +int iwn4965_set_txpower(struct iwn_softc *, + struct ieee80211_channel *, int); +int iwn5000_set_txpower(struct iwn_softc *, + struct ieee80211_channel *, int); int iwn4965_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); int iwn5000_get_rssi(struct iwn_softc *, struct iwn_rx_stat *); int iwn_get_noise(const struct iwn_rx_general_stats *); @@ -3694,13 +3696,16 @@ iwn_set_timing(struct iwn_softc *sc, str void iwn4965_power_calibration(struct iwn_softc *sc, int temp) { + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + /* Adjust TX power if need be (delta >= 3 degC.) */ DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: temperature %d->%d\n", __func__, sc->temp, temp); if (abs(temp - sc->temp) >= 3) { /* Record temperature of last calibration. */ sc->temp = temp; - (void)iwn4965_set_txpower(sc, 1); + (void)iwn4965_set_txpower(sc, ic->ic_bsschan, 1); } } @@ -3710,7 +3715,8 @@ iwn4965_power_calibration(struct iwn_sof * the current temperature and the current voltage. */ int -iwn4965_set_txpower(struct iwn_softc *sc, int async) +iwn4965_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch, + int async) { /* Fixed-point arithmetic division using a n-bit fractional part. */ #define fdivround(a, b, n) \ @@ -3723,7 +3729,6 @@ iwn4965_set_txpower(struct iwn_softc *sc struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct iwn_ucode_info *uc = &sc->ucode_info; - struct ieee80211_channel *ch; struct iwn4965_cmd_txpower cmd; struct iwn4965_eeprom_chan_samples *chans; int32_t vdiff, tdiff; @@ -3731,11 +3736,10 @@ iwn4965_set_txpower(struct iwn_softc *sc const uint8_t *rf_gain, *dsp_gain; uint8_t chan; - /* Retrieve current channel from last RXON. */ - chan = sc->rxon.chan; + /* Retrieve channel number. */ + chan = ieee80211_chan2ieee(ic, ch); DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n", chan); - ch = &ic->ic_channels[chan]; memset(&cmd, 0, sizeof cmd); cmd.band = IEEE80211_IS_CHAN_5GHZ(ch) ? 0 : 1; @@ -3863,7 +3867,8 @@ iwn4965_set_txpower(struct iwn_softc *sc } int -iwn5000_set_txpower(struct iwn_softc *sc, int async) +iwn5000_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch, + int async) { struct iwn5000_cmd_txpower cmd; @@ -4519,7 +4524,7 @@ iwn_config(struct iwn_softc *sc) } /* Configuration has changed, set TX power accordingly. */ - error = hal->set_txpower(sc, 0); + error = hal->set_txpower(sc, ic->ic_curchan, 0); if (error != 0) { device_printf(sc->sc_dev, "%s: could not set TX power\n", __func__); @@ -4765,7 +4770,7 @@ iwn_auth(struct iwn_softc *sc, struct ie } /* Configuration has changed, set TX power accordingly. */ - error = hal->set_txpower(sc, 1); + error = hal->set_txpower(sc, ni->ni_chan, 1); if (error != 0) { device_printf(sc->sc_dev, "%s: could not set Tx power, error %d\n", __func__, error); @@ -4882,7 +4887,7 @@ iwn_run(struct iwn_softc *sc, struct iee /* Configuration has changed, set TX power accordingly. */ - error = hal->set_txpower(sc, 1); + error = hal->set_txpower(sc, ni->ni_chan, 1); if (error != 0) { device_printf(sc->sc_dev, "%s: could not set Tx power, error %d\n", __func__, error); Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sat Jan 9 03:08:22 2010 (r201881) +++ head/sys/dev/iwn/if_iwnvar.h Sat Jan 9 04:00:22 2010 (r201882) @@ -166,7 +166,8 @@ struct iwn_hal { uint16_t); int (*get_temperature)(struct iwn_softc *); int (*get_rssi)(struct iwn_softc *, struct iwn_rx_stat *); - int (*set_txpower)(struct iwn_softc *, int); + int (*set_txpower)(struct iwn_softc *, + struct ieee80211_channel *, int); int (*init_gains)(struct iwn_softc *); int (*set_gains)(struct iwn_softc *); int (*add_node)(struct iwn_softc *, struct iwn_node_info *, From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 04:36:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75B63106566C; Sat, 9 Jan 2010 04:36:49 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 7ADAE8FC0C; Sat, 9 Jan 2010 04:36:48 +0000 (UTC) Received: by fxm27 with SMTP id 27so5260228fxm.3 for ; Fri, 08 Jan 2010 20:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dNQJbjJ6odeFu79IlS6zfXOo1B3VOnZF3TZkfyWDq+M=; b=wMpAinf6C0qzKGVZrLDdBQhmWKf9vROB3iXo0Ra/j9YcJNNJhaPVr5R+AQynN0QdLQ rVQ0q+IXDksCYuWKsSLGczo+fNAaNuP6heC+dc6oRp4yx7/ggQ836fy/8akyOx5uTVLX xCIDl4klndW81swbow8EMhfB6B0jCIvjV1OgA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=vpGtk0nRU+/vOBQ0CfSDyxiBnb3Y0GRVGXRBxL5leEMu3Nogez9/yITssrXyjlw0IW foIHnePi9iL1viynyJFZETrI9uao3UlK10X28zFci59vQ4dAJFt7oQobu36R3pPfUUU2 o7EZWBREeteXGKq7H54NjgEEC9NBl6sHNbdks= MIME-Version: 1.0 Received: by 10.239.185.132 with SMTP id c4mr611517hbh.20.1263011796599; Fri, 08 Jan 2010 20:36:36 -0800 (PST) In-Reply-To: <4B477CBE.6090000@FreeBSD.org> References: <201001040916.o049GZ1Y013061@svn.freebsd.org> <4B4384E3.2080600@FreeBSD.org> <867hrvgw2j.fsf@ds4.des.no> <4B46CFE8.8000501@FreeBSD.org> <4B477CBE.6090000@FreeBSD.org> Date: Sat, 9 Jan 2010 02:36:36 -0200 Message-ID: From: "Carlos A. M. dos Santos" To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201477 - head/games/fortune/datfiles X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 04:36:49 -0000 On Fri, Jan 8, 2010 at 4:43 PM, Doug Barton wrote: > Carlos A. M. dos Santos wrote: [...] >> Five to ten years from now that quotation will >> be just history, like the ones from/about JFK, Richard Nixon, and >> Spiro Agnew. > > Actually there are several things in the main fortunes file that I > find offensive related to political stuff of the 60's and 70's > (although not for the reasons that I think most people would find them > offensive). Note, I am not however suggesting that we do a wholesale > move of potentially offensive stuff. Have somebody *ever* complained about this? Is there any PR asking that offensive stuff be removed from the default fortunes file? If not, you are overzealously attempting to solve a non-existing problem. >> Are you whiling to apply such rule to all supposedly >> political fortunes? > > My very first post on this was, "Anything that may offend someone > belongs in fortunes-o, and all political commentary belongs in this > category." All business is based on the mutual trust of one of the parts. -- Poul Henningsen [1894-1967] Verdict: offensive to businessmen Women are always anxious to urge bachelors to matrimony; is it from charity, or revenge? -- Gustave Vapereau Verdict: sexist It's the same old story; boy meets beer, boy drinks beer... boy gets another beer. -- Cheers Verdict: offensive to young men (and to alcoholics) It's amazing how much "mature wisdom" resembles being too tired. Verdict: offensive to elders There is not much to choose between a woman who deceives us for another, and a woman who deceives another for ourselves. -- Augier Verdict: sexist Home is the place where, when you have to go there, they have to take you in. -- Robert Frost, "The Death of the Hired Man" Verdict: offensive to the concepts of family and home And so on. > FWIW, while I am definitely in favor of treating all people with > courtesy and respect, =A0I am just about as > anti-mindless-political-correctness as you can possibly be. In fact, > in both my .bashrc and my xscreensaver config I use fortune -a because > as much as some of the things in there offend me, I find it refreshing > to be challenged by other viewpoints. OTOH, I am also in favor of us > building a professional-quality operating system, and while I actually > _voiced_ my objection to the removal of > "die_you_gravy_sucking_pig_dog" because that is not something that is > user-visible Fortune is also not visible unless explicitly invoked by the user. It is not invoked by the default /etc/csh.cshrc, /etc/csh.login or /etc/profile. Moreover, the skeleton .login and .profile files, in /usr/src/share/skel, invoke "fortune freebsd-tips", which is pretty much harmless. > I think that if we SAY there is a distinction between > fortunes and fortunes-o that we ought to follow through on that. Too late. See the verdicts above. And you are aiming an impossible goal. People can feel offended by almost anything. > Putting something that we know could (and almost certainly will) be > found offensive in the fortunes file because WE are smarter and more > sophisticated than those fools who would be offended by it is > childish, foolish, and unprofessional. The only possible solution would be creating a custom BSD, the "Boring Software Distribution": # cd /usr/src # echo WITHOUT_GAMES=3D1 >> /etc/src.conf # make love (yes, FreeBSD's make knows how to make love!) # make buildworld # ... > =A0 =A0 =A0 =A0Computers are useless. They can only give you answers. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Pablo Picasso As a computer scientist and software developer, I feel irremediably offended by this quotation. ;-) --=20 My preferred quotation of Robert Louis Stevenson is "You cannot make an omelette without breaking eggs". Not because I like the omelettes, but because I like the sound of eggs being broken. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 04:59:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56A9B1065676; Sat, 9 Jan 2010 04:59:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 460408FC12; Sat, 9 Jan 2010 04:59:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o094xwwD099436; Sat, 9 Jan 2010 04:59:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o094xwH1099434; Sat, 9 Jan 2010 04:59:58 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001090459.o094xwH1099434@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 04:59:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201883 - head/sys/mips/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 04:59:58 -0000 Author: imp Date: Sat Jan 9 04:59:57 2010 New Revision: 201883 URL: http://svn.freebsd.org/changeset/base/201883 Log: Merge r195128 from project/mips to head. r195128 | gonzo | 2009-06-27 17:27:41 -0600 (Sat, 27 Jun 2009) | 4 lines - Add support for handling TLS area address in kernel space. From the userland point of view get/set operations are performed using sysarch(2) call. Modified: head/sys/mips/include/sysarch.h Modified: head/sys/mips/include/sysarch.h ============================================================================== --- head/sys/mips/include/sysarch.h Sat Jan 9 04:00:22 2010 (r201882) +++ head/sys/mips/include/sysarch.h Sat Jan 9 04:59:57 2010 (r201883) @@ -35,16 +35,12 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#define MIPS_SET_TLS 1 +#define MIPS_GET_TLS 2 + #ifndef _KERNEL #include -#if 0 -/* Something useful for each MIPS platform. */ -#else -#define mips_tcb_set(tcb) do {} while (0) -#define mips_tcb_get() NULL -#endif /* _MIPS_ARCH_XLR */ - __BEGIN_DECLS int sysarch(int, void *); __END_DECLS From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 05:40:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6AC01065676; Sat, 9 Jan 2010 05:40:46 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CA228FC0A; Sat, 9 Jan 2010 05:40:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o095ek0o008551; Sat, 9 Jan 2010 05:40:46 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o095ekeT008548; Sat, 9 Jan 2010 05:40:46 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001090540.o095ekeT008548@svn.freebsd.org> From: David Xu Date: Sat, 9 Jan 2010 05:40:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201884 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 05:40:46 -0000 Author: davidxu Date: Sat Jan 9 05:40:46 2010 New Revision: 201884 URL: http://svn.freebsd.org/changeset/base/201884 Log: Update manual for sem_init and sem_open, restrictions of shared semaphore and 14 characters in name length no longer exist. Reviewed by: deischen@ Modified: head/lib/libc/gen/sem_init.3 head/lib/libc/gen/sem_open.3 Modified: head/lib/libc/gen/sem_init.3 ============================================================================== --- head/lib/libc/gen/sem_init.3 Sat Jan 9 04:59:57 2010 (r201883) +++ head/lib/libc/gen/sem_init.3 Sat Jan 9 05:40:46 2010 (r201884) @@ -46,9 +46,19 @@ function initializes the unnamed semapho .Fa sem to have the value .Fa value . +.Pp A non-zero value for .Fa pshared -specifies a shared semaphore that can be used by multiple processes. +specifies a shared semaphore that can be used by multiple processes, +the semaphore should be located in shared memory region (see +.Xr mmap 2 , +.Xr shm_open 2 , +and +.Xr shmget 2 ) , +any process having read and write access to address +.Fa sem +can perform semaphore operations on +.Fa sem . .Pp Following a successful call to .Fn sem_init , Modified: head/lib/libc/gen/sem_open.3 ============================================================================== --- head/lib/libc/gen/sem_open.3 Sat Jan 9 04:59:57 2010 (r201883) +++ head/lib/libc/gen/sem_open.3 Sat Jan 9 05:40:46 2010 (r201884) @@ -58,6 +58,12 @@ The returned semaphore may be used in su and .Fn sem_close . .Pp +This implementation places strict requirements on the value of +.Fa name : +it must begin with a slash +.Pq Ql / , +contain no other slash characters. +.Pp The following bits may be set in the .Fa oflag argument: @@ -217,11 +223,3 @@ functions conform to .Sh HISTORY Support for named semaphores first appeared in .Fx 5.0 . -.Sh BUGS -This implementation places strict requirements on the value of -.Fa name : -it must begin with a slash -.Pq Ql / , -contain no other slash characters, -and be less than 14 characters in length -not including the terminating null character. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 06:05:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6864106566C; Sat, 9 Jan 2010 06:05:31 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95E9F8FC0C; Sat, 9 Jan 2010 06:05:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0965Vto013972; Sat, 9 Jan 2010 06:05:31 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0965Vr8013970; Sat, 9 Jan 2010 06:05:31 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001090605.o0965Vr8013970@svn.freebsd.org> From: David Xu Date: Sat, 9 Jan 2010 06:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201885 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 06:05:31 -0000 Author: davidxu Date: Sat Jan 9 06:05:31 2010 New Revision: 201885 URL: http://svn.freebsd.org/changeset/base/201885 Log: Add key type TYPE_SEM. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Jan 9 05:40:46 2010 (r201884) +++ head/sys/kern/kern_umtx.c Sat Jan 9 06:05:31 2010 (r201885) @@ -59,12 +59,13 @@ __FBSDID("$FreeBSD$"); #endif #define TYPE_SIMPLE_WAIT 0 -#define TYPE_CV 1 -#define TYPE_SIMPLE_LOCK 2 -#define TYPE_NORMAL_UMUTEX 3 -#define TYPE_PI_UMUTEX 4 -#define TYPE_PP_UMUTEX 5 -#define TYPE_RWLOCK 6 +#define TYPE_CV (TYPE_SIMPLE_WAIT+1) +#define TYPE_SEM (TYPE_CV+1) +#define TYPE_SIMPLE_LOCK (TYPE_SEM+1) +#define TYPE_NORMAL_UMUTEX (TYPE_SIMPLE_LOCK+1) +#define TYPE_PI_UMUTEX (TYPE_NORMAL_UMUTEX+1) +#define TYPE_PP_UMUTEX (TYPE_PI_UMUTEX+1) +#define TYPE_RWLOCK (TYPE_PP_UMUTEX+1) #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2 @@ -2770,7 +2771,7 @@ do_sem_wait(struct thread *td, struct _u uq = td->td_umtxq; flags = fuword32(&sem->_flags); - error = umtx_key_get(sem, TYPE_CV, GET_SHARE(flags), &uq->uq_key); + error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key); if (error != 0) return (error); umtxq_lock(&uq->uq_key); @@ -2845,7 +2846,7 @@ do_sem_wake(struct thread *td, struct _u uint32_t flags; flags = fuword32(&sem->_flags); - if ((error = umtx_key_get(sem, TYPE_CV, GET_SHARE(flags), &key)) != 0) + if ((error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &key)) != 0) return (error); umtxq_lock(&key); umtxq_busy(&key); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 06:12:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB3A01065692; Sat, 9 Jan 2010 06:12:44 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5D28FC0A; Sat, 9 Jan 2010 06:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o096Cihf015553; Sat, 9 Jan 2010 06:12:44 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o096CiZG015551; Sat, 9 Jan 2010 06:12:44 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001090612.o096CiZG015551@svn.freebsd.org> From: David Xu Date: Sat, 9 Jan 2010 06:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201886 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 06:12:44 -0000 Author: davidxu Date: Sat Jan 9 06:12:44 2010 New Revision: 201886 URL: http://svn.freebsd.org/changeset/base/201886 Log: put semaphore waiter in long term list. Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Jan 9 06:05:31 2010 (r201885) +++ head/sys/kern/kern_umtx.c Sat Jan 9 06:12:44 2010 (r201886) @@ -292,7 +292,7 @@ umtx_key_match(const struct umtx_key *k1 static inline struct umtxq_chain * umtxq_getchain(struct umtx_key *key) { - if (key->type <= TYPE_CV) + if (key->type <= TYPE_SEM) return (&umtxq_chains[1][key->hash]); return (&umtxq_chains[0][key->hash]); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 06:14:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9131910656A6; Sat, 9 Jan 2010 06:14:48 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5D4EA8FC15; Sat, 9 Jan 2010 06:14:48 +0000 (UTC) Received: by pxi12 with SMTP id 12so13486188pxi.3 for ; Fri, 08 Jan 2010 22:14:29 -0800 (PST) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.142.1.27 with SMTP id 27mr3125721wfa.33.1263017669057; Fri, 08 Jan 2010 22:14:29 -0800 (PST) In-Reply-To: <201001090605.o0965Vr8013970@svn.freebsd.org> References: <201001090605.o0965Vr8013970@svn.freebsd.org> From: Juli Mallett Date: Fri, 8 Jan 2010 22:14:09 -0800 X-Google-Sender-Auth: 932e51e83bb5edef Message-ID: To: David Xu Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201885 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 06:14:48 -0000 On Fri, Jan 8, 2010 at 22:05, David Xu wrote: > #define TYPE_SIMPLE_WAIT 0 > -#define TYPE_CV 1 > -#define TYPE_SIMPLE_LOCK 2 > -#define TYPE_NORMAL_UMUTEX 3 > -#define TYPE_PI_UMUTEX 4 > -#define TYPE_PP_UMUTEX 5 > -#define TYPE_RWLOCK 6 > +#define TYPE_CV (TYPE_SIMPLE_WAIT+1) > +#define TYPE_SEM (TYPE_CV+1) > +#define TYPE_SIMPLE_LOCK (TYPE_SEM+1) > +#define TYPE_NORMAL_UMUTEX (TYPE_SIMPLE_LOCK+1) > +#define TYPE_PI_UMUTEX (TYPE_NORMAL_UMUTEX+1) > +#define TYPE_PP_UMUTEX (TYPE_PI_UMUTEX+1) > +#define TYPE_RWLOCK (TYPE_PP_UMUTEX+1) > I am not sure I get the benefit of defining them this way. Certainly it does nothing to improve stability in the face of additions, removals or re-sorting (in the latter case, it makes figuring out how to define a new one exceptionally hard.) I am not aware of a trend towards defining constants this way in the kernel (there are none in sys/ that I see) and find it kind of baffling and needlessly obtuse. If there is a need to define them in such an unusual manner, it would be nice to see a comment that says why. If you don't need to use #defines and have a dislike assigning numbers by hand, why not simply use 'enum'? From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 06:30:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D63AF106566B; Sat, 9 Jan 2010 06:30:40 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5F998FC12; Sat, 9 Jan 2010 06:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o096Ue1M019504; Sat, 9 Jan 2010 06:30:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o096UeOT019502; Sat, 9 Jan 2010 06:30:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201001090630.o096UeOT019502@svn.freebsd.org> From: David Xu Date: Sat, 9 Jan 2010 06:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201887 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 06:30:40 -0000 Author: davidxu Date: Sat Jan 9 06:30:40 2010 New Revision: 201887 URL: http://svn.freebsd.org/changeset/base/201887 Log: Use enum to define key types. Suggested by: jmallett Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Sat Jan 9 06:12:44 2010 (r201886) +++ head/sys/kern/kern_umtx.c Sat Jan 9 06:30:40 2010 (r201887) @@ -58,14 +58,16 @@ __FBSDID("$FreeBSD$"); #include #endif -#define TYPE_SIMPLE_WAIT 0 -#define TYPE_CV (TYPE_SIMPLE_WAIT+1) -#define TYPE_SEM (TYPE_CV+1) -#define TYPE_SIMPLE_LOCK (TYPE_SEM+1) -#define TYPE_NORMAL_UMUTEX (TYPE_SIMPLE_LOCK+1) -#define TYPE_PI_UMUTEX (TYPE_NORMAL_UMUTEX+1) -#define TYPE_PP_UMUTEX (TYPE_PI_UMUTEX+1) -#define TYPE_RWLOCK (TYPE_PP_UMUTEX+1) +enum { + TYPE_SIMPLE_WAIT, + TYPE_CV, + TYPE_SEM, + TYPE_SIMPLE_LOCK, + TYPE_NORMAL_UMUTEX, + TYPE_PI_UMUTEX, + TYPE_PP_UMUTEX, + TYPE_RWLOCK +}; #define _UMUTEX_TRY 1 #define _UMUTEX_WAIT 2 From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 07:45:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63C0C1065670; Sat, 9 Jan 2010 07:45:10 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213]) by mx1.freebsd.org (Postfix) with ESMTP id 4AC988FC13; Sat, 9 Jan 2010 07:45:09 +0000 (UTC) Received: by ewy5 with SMTP id 5so8814822ewy.14 for ; Fri, 08 Jan 2010 23:45:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=uC8beMhbuB7ZObAcY/BGmDEA4tjjp9qI3HlgelK2bX8=; b=A9vJOpMSRmA69PYbgdqQafV2rT4JK7zeRzErgD/QeQdS/U3VHOa20htAZiwmesF+YQ Rq2qR4FXRu6ceKLJzbpCdw9T6yarc+1zNCyNRgEp3/Zi47OGveapUNXGQQfZIsVs5Ftd QbTZU7pbaqCWKljnPh8MFOCNEskZJHVmfIDhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=wFG7p5DSIayrWDu+iPraoVed6zr1MubqgpSP6z9EfCYu09T0Egod13mwZyBbdw8qz2 RwhYGCzK3/cYZ3hBjPwleFGv3rXfwmQEd7vEHafNMLwdB2lwcGHofnjSNhdu70SM2LgO UA0zQshbXS96IxXItdsyV99eTdc1iBfOk8uPE= Received: by 10.213.0.151 with SMTP id 23mr424398ebb.43.1263023101363; Fri, 08 Jan 2010 23:45:01 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id 13sm2227517ewy.9.2010.01.08.23.45.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Jan 2010 23:45:00 -0800 (PST) Date: Sat, 9 Jan 2010 09:44:48 +0200 From: Gleb Kurtsou To: Jaakko Heinonen Message-ID: <20100109074448.GA1865@tops.skynet.lt> References: <201001080757.o087vhrr009799@svn.freebsd.org> <20100109051536.R57595@delplex.bde.org> <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20100108214821.GA985@a91-153-117-195.elisa-laajakaista.fi> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r201773 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 07:45:10 -0000 On (08/01/2010 23:48), Jaakko Heinonen wrote: > > Thank you for looking at this. > > On 2010-01-09, Bruce Evans wrote: > > The current incorrect way is to use %d. Since ino_t happens to have > > type uint32_t and u_int happens to have type uint32_t on all supported > > machines, %u would work but %d gives undefined behaviour when the > > value exceeds INT_MAX. > > > > The simplest fix is to use u_int and %u. > > > > > + u_quad_t size_max; There is also kern/138367 which tries to address the same issue, although in a bit different way. It also introduces maximum file size, fixes possible nodes and pages overflows. Thanks, Gleb > > Even larger indentation error, as above. > > Does following patch look reasonable? > > - Fix style bugs introduced in r201773. > - Change the type of nodes_max to u_int and use "%u" format string to > convert its value. > > %%% > Index: sys/fs/tmpfs/tmpfs_vfsops.c > =================================================================== > --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 201818) > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > @@ -185,8 +185,8 @@ tmpfs_mount(struct mount *mp) > ino_t nodes; > int error; > /* Size counters. */ > - ino_t nodes_max; > - u_quad_t size_max; > + u_int nodes_max; > + u_quad_t size_max; > > /* Root node attributes. */ > uid_t root_uid; > @@ -223,7 +223,7 @@ tmpfs_mount(struct mount *mp) > if (mp->mnt_cred->cr_ruid != 0 || > vfs_scanopt(mp->mnt_optnew, "mode", "%ho", &root_mode) != 1) > root_mode = va.va_mode; > - if (vfs_scanopt(mp->mnt_optnew, "inodes", "%d", &nodes_max) != 1) > + if (vfs_scanopt(mp->mnt_optnew, "inodes", "%u", &nodes_max) != 1) > nodes_max = 0; > if (vfs_scanopt(mp->mnt_optnew, "size", "%qu", &size_max) != 1) > size_max = 0; > @@ -239,7 +239,7 @@ tmpfs_mount(struct mount *mp) > * allowed to use, based on the maximum size the user passed in > * the mount structure. A value of zero is treated as if the > * maximum available space was requested. */ > - if (size_max < PAGE_SIZE || size_max > (SIZE_MAX - PAGE_SIZE)) > + if (size_max < PAGE_SIZE || size_max > SIZE_MAX - PAGE_SIZE) > pages = SIZE_MAX; > else > pages = howmany(size_max, PAGE_SIZE); > %%% > > -- > Jaakko > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 09:30:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E44106566C; Sat, 9 Jan 2010 09:30:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 301548FC08; Sat, 9 Jan 2010 09:30:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o099UAMe058860; Sat, 9 Jan 2010 09:30:10 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o099UATp058858; Sat, 9 Jan 2010 09:30:10 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001090930.o099UATp058858@svn.freebsd.org> From: Christian Brueffer Date: Sat, 9 Jan 2010 09:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201888 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 09:30:10 -0000 Author: brueffer Date: Sat Jan 9 09:30:09 2010 New Revision: 201888 URL: http://svn.freebsd.org/changeset/base/201888 Log: bridge(4) acts like a switch, not like a hub. PR: 141350 Submitted by: brucec Reviewed by: thompsa MFC after: 1 week Modified: head/share/man/man4/bridge.4 Modified: head/share/man/man4/bridge.4 ============================================================================== --- head/share/man/man4/bridge.4 Sat Jan 9 06:30:40 2010 (r201887) +++ head/share/man/man4/bridge.4 Sat Jan 9 09:30:09 2010 (r201888) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd January 9, 2010 .Dt IF_BRIDGE 4 .Os .Sh NAME @@ -111,7 +111,7 @@ by-default. A bridge can be used to provide several services, such as a simple 802.11-to-Ethernet bridge for wireless hosts, and traffic isolation. .Pp -A bridge works like a hub, forwarding traffic from one interface +A bridge works like a switch, forwarding traffic from one interface to another. Multicast and broadcast packets are always forwarded to all interfaces that are part of the bridge. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 10:24:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAF41065692; Sat, 9 Jan 2010 10:24:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9F48FC12; Sat, 9 Jan 2010 10:24:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09AO94u072586; Sat, 9 Jan 2010 10:24:09 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09AO9HR072584; Sat, 9 Jan 2010 10:24:09 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201001091024.o09AO9HR072584@svn.freebsd.org> From: Christian Brueffer Date: Sat, 9 Jan 2010 10:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201889 - head/usr.sbin/faithd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 10:24:09 -0000 Author: brueffer Date: Sat Jan 9 10:24:09 2010 New Revision: 201889 URL: http://svn.freebsd.org/changeset/base/201889 Log: Various language fixes. Also fixed the URL to totd, obtained from NetBSD. PR: 38061 Submitted by: Chris Pepper MFC after: 1 week Modified: head/usr.sbin/faithd/faithd.8 Modified: head/usr.sbin/faithd/faithd.8 ============================================================================== --- head/usr.sbin/faithd/faithd.8 Sat Jan 9 09:30:09 2010 (r201888) +++ head/usr.sbin/faithd/faithd.8 Sat Jan 9 10:24:09 2010 (r201889) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 1998 +.Dd January 9, 2010 .Dt FAITHD 8 .Os .Sh NAME @@ -44,20 +44,18 @@ .Sh DESCRIPTION The .Nm -utility provides IPv6-to-IPv4 TCP relay. -It must be used on an IPv4/v6 dual stack router. +utility provides IPv6-to-IPv4 TCP relaying. +It can only be used on an IPv4/v6 dual stack router. .Pp When .Nm receives .Tn TCPv6 -traffic, -.Nm -will relay the +traffic, it will relay the .Tn TCPv6 traffic to .Tn TCPv4 . -Destination for relayed +The destination for the relayed .Tn TCPv4 connection will be determined by the last 4 octets of the original .Tn IPv6 @@ -73,14 +71,14 @@ destination address is the traffic will be relayed to IPv4 destination .Li 10.1.1.1 . .Pp -To use +To use the .Nm translation service, an IPv6 address prefix must be reserved for mapping IPv4 addresses into. -Kernel must be properly configured to route all the TCP connection +The kernel must be properly configured to route all the TCP connections toward the reserved IPv6 address prefix into the .Xr faith 4 -pseudo interface, by using +pseudo interface, using the .Xr route 8 command. Also, @@ -91,7 +89,7 @@ to .Dv 1 . .Pp The router must be configured to capture all the TCP traffic -toward reserved +for the reserved .Tn IPv6 address prefix, by using .Xr route 8 @@ -101,21 +99,20 @@ commands. .Pp The .Nm -utility needs a special name-to-address translation logic, so that -hostnames gets resolved into special +utility needs special name-to-address translation logic, so that +hostnames get resolved into the special .Tn IPv6 address prefix. -For small-scale installation, use -.Xr hosts 5 . -For large-scale installation, it is useful to have +For small-scale installations, use +.Xr hosts 5 ; +For large-scale installations, it is useful to have a DNS server with special address translation support. An implementation called .Nm totd -is available -at -.Pa http://www.vermicelli.pasta.cs.uit.no/ipv6/software.html . -Make sure you do not propagate translated DNS records to normal DNS cloud, -it is highly harmful. +is available at +.Pa http://www.vermicelli.pasta.cs.uit.no/software/totd.html . +Make sure you do not propagate translated DNS records over to normal +DNS, as it can cause severe problems. .Ss Daemon mode When .Nm @@ -150,9 +147,9 @@ to you can run local daemons on the router. The .Nm -utility will invoke local daemon at +utility will invoke a local daemon at .Ar serverpath -if the destination address is local interface address, +if the destination address is a local interface address, and will perform translation to IPv4 TCP in other cases. You can also specify .Ar serverargs @@ -182,7 +179,7 @@ The .Nm utility includes special support for protocols used by .Xr ftp 1 . -When translating FTP protocol, +When translating the FTP protocol, .Nm translates network level addresses in .Li PORT/LPRT/EPRT @@ -191,8 +188,8 @@ and commands. .Pp Inactive sessions will be disconnected in 30 minutes, -to avoid stale sessions from chewing up resources. -This may be inappropriate for some of the services +to prevent stale sessions from chewing up resources. +This may be inappropriate for some services (should this be configurable?). .Ss inetd mode When @@ -200,13 +197,13 @@ When is invoked via .Xr inetd 8 , .Nm -will handle connection passed from standard input. +will handle connections passed from standard input. If the connection endpoint is in the reserved IPv6 address prefix, .Nm will relay the connection. Otherwise, .Nm -will invoke service-specific daemon like +will invoke a service-specific daemon like .Xr telnetd 8 , by using the command argument passed from .Xr inetd 8 . @@ -219,16 +216,16 @@ For example, if .Nm is invoked via .Xr inetd 8 -on FTP port, it will operate as a FTP relay. +on the FTP port, it will operate as an FTP relay. .Pp The operation mode requires special support for .Nm in .Xr inetd 8 . .Ss Access control -To prevent malicious accesses, +To prevent malicious access, .Nm -implements a simple address-based access control. +implements simple address-based access control. With .Pa /etc/faithd.conf (or @@ -239,7 +236,7 @@ specified by will avoid relaying unwanted traffic. The .Pa faithd.conf -contains directives with the following format: +configuration file contains directives of the following format: .Bl -bullet .It .Ar src Ns / Ns Ar slen Cm deny Ar dst Ns / Ns Ar dlen @@ -281,6 +278,7 @@ on error. .Sh EXAMPLES Before invoking .Nm , +the .Xr faith 4 interface has to be configured properly. .Bd -literal -offset @@ -334,12 +332,12 @@ ssh stream tcp6/faith nowait root .Ed .Pp .Xr inetd 8 -will open listening sockets with enabling kernel TCP relay support. -Whenever connection comes in, +will open listening sockets with kernel TCP relay support enabled. +Whenever a connection comes in, .Nm will be invoked by .Xr inetd 8 . -If it the connection endpoint is in the reserved IPv6 address prefix. +If the connection endpoint is in the reserved IPv6 address prefix. The .Nm utility will relay the connection. @@ -377,12 +375,12 @@ setting. .Sh HISTORY The .Nm -utility first appeared in WIDE Hydrangea IPv6 protocol stack kit. +utility first appeared in the WIDE Hydrangea IPv6 protocol stack kit. .\" .Pp IPv6 and IPsec support based on the KAME Project (http://www.kame.net/) stack was initially integrated into -.Fx 4.0 +.Fx 4.0 . .Sh SECURITY CONSIDERATIONS It is very insecure to use IP-address based authentication, for connections relayed by .Nm , @@ -392,16 +390,15 @@ Administrators are advised to limit acce .Nm using .Pa faithd.conf , -or by using IPv6 packet filters. -It is to protect +or by using IPv6 packet filters, to protect the .Nm -service from malicious parties and avoid theft of service/bandwidth. -IPv6 destination address can be limited by -carefully configuring routing entries that points to +service from malicious parties, and to avoid theft of service/bandwidth. +IPv6 destination addresses can be limited by +carefully configuring routing entries that point to .Xr faith 4 , using .Xr route 8 . -IPv6 source address needs to be filtered by using packet filters. -Documents listed in +The IPv6 source address needs to be filtered using packet filters. +The documents listed in .Sx SEE ALSO -have more discussions on this topic. +have more information on this topic. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 11:28:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C56D01065676; Sat, 9 Jan 2010 11:28:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B47DE8FC12; Sat, 9 Jan 2010 11:28:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09BS1CY086740; Sat, 9 Jan 2010 11:28:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09BS1MQ086738; Sat, 9 Jan 2010 11:28:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201001091128.o09BS1MQ086738@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 9 Jan 2010 11:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201890 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 11:28:01 -0000 Author: kib Date: Sat Jan 9 11:28:01 2010 New Revision: 201890 URL: http://svn.freebsd.org/changeset/base/201890 Log: Set md_ldt (pointer to the LDT) after md_ldt_sd (system segment descriptor for the LDT) is populated. md_ldt is used by context-switch code as indicator that LDT segment register shall be loaded with GUSERLDT segment instead of 0, so context switch at the wrong time may cause attempt to load non-populated descriptor. Use store with the barrier to prevent other CPUs from seeing updated md_ldt but not seeing updated md_ldt_sd. Multithreaded process may context-switch to another thread of the process on another CPU and read md_ldt. MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Sat Jan 9 10:24:09 2010 (r201889) +++ head/sys/amd64/amd64/sys_machdep.c Sat Jan 9 11:28:01 2010 (r201890) @@ -420,13 +420,14 @@ user_ldt_alloc(struct proc *p, int force return (pldt); } - mdp->md_ldt = new_ldt; if (pldt != NULL) { bcopy(pldt->ldt_base, new_ldt->ldt_base, max_ldt_segment * sizeof(struct user_segment_descriptor)); user_ldt_derefl(pldt); } ssdtosyssd(&sldt, &p->p_md.md_ldt_sd); + atomic_store_rel_ptr((volatile uintptr_t *)&mdp->md_ldt, + (uintptr_t)new_ldt); if (p == curproc) set_user_ldt(mdp); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 12:31:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2A52106566B; Sat, 9 Jan 2010 12:31:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF8BB8FC13; Sat, 9 Jan 2010 12:31:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09CVBrp000792; Sat, 9 Jan 2010 12:31:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09CVBKa000784; Sat, 9 Jan 2010 12:31:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001091231.o09CVBKa000784@svn.freebsd.org> From: Xin LI Date: Sat, 9 Jan 2010 12:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201892 - in head: lib/libc/sys share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 12:31:11 -0000 Author: delphij Date: Sat Jan 9 12:31:11 2010 New Revision: 201892 URL: http://svn.freebsd.org/changeset/base/201892 Log: Add a set of manual pages for pthread[_attr]_[sg]etaffinity(3). Reviewed by: davidxu MFC after: 2 weeks Added: head/share/man/man3/pthread_affinity_np.3 (contents, props changed) head/share/man/man3/pthread_attr_affinity_np.3 (contents, props changed) Modified: head/lib/libc/sys/cpuset.2 head/lib/libc/sys/cpuset_getaffinity.2 head/share/man/man3/Makefile head/share/man/man3/pthread.3 head/share/man/man3/pthread_attr.3 Modified: head/lib/libc/sys/cpuset.2 ============================================================================== --- head/lib/libc/sys/cpuset.2 Sat Jan 9 12:28:42 2010 (r201891) +++ head/lib/libc/sys/cpuset.2 Sat Jan 9 12:31:11 2010 (r201892) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 29, 2008 +.Dd January 8, 2010 .Dt CPUSET 2 .Os .Sh NAME @@ -216,7 +216,9 @@ for allocation. .Xr cpuset 1 , .Xr cpuset_getaffinity 2 , .Xr cpuset_setaffinity 2 , -.Xr CPU_SET 3 +.Xr CPU_SET 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 .Sh HISTORY The .Nm Modified: head/lib/libc/sys/cpuset_getaffinity.2 ============================================================================== --- head/lib/libc/sys/cpuset_getaffinity.2 Sat Jan 9 12:28:42 2010 (r201891) +++ head/lib/libc/sys/cpuset_getaffinity.2 Sat Jan 9 12:31:11 2010 (r201892) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 8, 2010 .Dt CPUSET 2 .Os .Sh NAME @@ -147,7 +147,9 @@ operation. .Xr cpuset 2 , .Xr cpuset_getid 2 , .Xr cpuset_setid 2 , -.Xr CPU_SET 3 +.Xr CPU_SET 3 , +.Xr pthread_affinity_np 3 , +.Xr pthread_attr_affinity_np 3 .Sh HISTORY The .Nm Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Sat Jan 9 12:28:42 2010 (r201891) +++ head/share/man/man3/Makefile Sat Jan 9 12:31:11 2010 (r201892) @@ -155,8 +155,10 @@ MLINKS+= tree.3 RB_EMPTY.3 \ .if ${MK_LIBTHR} != "no" PTHREAD_MAN= pthread.3 \ + pthread_affinity_np.3 \ pthread_atfork.3 \ pthread_attr.3 \ + pthread_attr_affinity_np.3 \ pthread_attr_get_np.3 \ pthread_attr_setcreatesuspend_np.3 \ pthread_barrierattr.3 \ @@ -218,7 +220,9 @@ PTHREAD_MAN= pthread.3 \ pthread_testcancel.3 \ pthread_yield.3 -PTHREAD_MLINKS= pthread_attr.3 pthread_attr_destroy.3 \ +PTHREAD_MLINKS= pthread_affinity_np.3 pthread_getaffinity_np.3 \ + pthread_affinity_np.3 pthread_setaffinity_np.3 +PTHREAD_MLINKS+=pthread_attr.3 pthread_attr_destroy.3 \ pthread_attr.3 pthread_attr_getdetachstate.3 \ pthread_attr.3 pthread_attr_getguardsize.3 \ pthread_attr.3 pthread_attr_getinheritsched.3 \ @@ -238,6 +242,8 @@ PTHREAD_MLINKS= pthread_attr.3 pthread_a pthread_attr.3 pthread_attr_setstack.3 \ pthread_attr.3 pthread_attr_setstackaddr.3 \ pthread_attr.3 pthread_attr_setstacksize.3 +PTHREAD_MLINKS+=pthread_attr_affinity_np.3 pthread_attr_getaffinity_np.3 \ + pthread_attr_affinity_np.3 pthread_attr_setaffinity_np.3 PTHREAD_MLINKS+=pthread_barrierattr.3 pthread_barrierattr_destroy.3 \ pthread_barrierattr.3 pthread_barrierattr_getpshared.3 \ pthread_barrierattr.3 pthread_barrierattr_init.3 \ Modified: head/share/man/man3/pthread.3 ============================================================================== --- head/share/man/man3/pthread.3 Sat Jan 9 12:28:42 2010 (r201891) +++ head/share/man/man3/pthread.3 Sat Jan 9 12:31:11 2010 (r201892) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 1, 2009 +.Dd January 8, 2010 .Dt PTHREAD 3 .Os .Sh NAME @@ -478,7 +478,9 @@ functions and the thread functions. Threaded applications are linked with this library. .Sh SEE ALSO .Xr libthr 3 , +.Xr pthread_affinity_np 3 , .Xr pthread_atfork 3 , +.Xr pthread_attr 3 , .Xr pthread_cancel 3 , .Xr pthread_cleanup_pop 3 , .Xr pthread_cleanup_push 3 , Added: head/share/man/man3/pthread_affinity_np.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/pthread_affinity_np.3 Sat Jan 9 12:31:11 2010 (r201892) @@ -0,0 +1,157 @@ +.\"- +.\" Copyright (c) 2010 Xin LI +.\" 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$ +.\" +.Dd January 8, 2010 +.Dt PTHREAD_AFFINITY_NP 3 +.Os +.Sh NAME +.Nm pthread_getaffinity_np , +.Nm pthread_setaffinity_np +.Nd manage CPU affinity +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Ft int +.Fn pthread_getaffinity_np "pthread_t td" "size_t cpusetsize" "cpuset_t *cpusetp" +.Ft int +.Fn pthread_setaffinity_np "pthread_t td" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Sh DESCRIPTION +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +allow the manipulation of sets of CPUs available to specified thread. +.Pp +Masks of type +.Ft cpuset_t +are composed using the +.Xr CPU_SET 2 +macros. +The kernel tolerates large sets as long as all CPUs specified +in the set exist. +Sets smaller than the kernel uses generate an error on calls to +.Fn pthread_getaffinity_np +even if the result set would fit within the user supplied set. +Calls to +.Fn pthread_setaffinity_np +tolerate small sets with no restrictions. +.Pp +The supplied mask should have a size of +.Fa cpusetsize +bytes. +This size is usually provided by calling +.Li sizeof(cpuset_t) +which is ultimately determined by the value of +.Dv CPU_SETSIZE +as defined in +.In sys/cpuset.h . +.Pp +.Fn pthread_getaffinity_np +retrieves the +mask from the thread specified by +.Fa td , +and stores it in the space provided by +.Fa cpumaskp . +.Pp +.Fn pthread_setaffinity_np +attempts to set the mask for the thread specified by +.Fa td +to the value in +.Fa cpumaskp . +.Pp +.Sh RETURN VALUES +If successful, the +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +functions will return zero. +Otherwise an error number will be returned +to indicate the error. +.Sh ERRORS +The +.Fn pthread_getaffinity_np +and +.Fn pthread_setaffinity_np +functions may fail if: +.Bl -tag -width Er +.It Bq Er EDEADLK +The +.Fn pthread_setaffinity_np +call would leave a thread without a valid CPU to run on because the set +does not overlap with the thread's anonymous mask. +.It Bq Er EFAULT +The +.Fa cpumaskp +pointer passed was invalid. +.It Bq Er ESRCH +The thread specified by the +.Fa td +argument could not be found. +.It Bq Er ERANGE +The +.Fa cpusetsize +was either preposterously large or smaller than the kernel set size. +.It Bq Er EPERM +The calling thread did not have the credentials required to complete the +operation. +.El +.Sh SEE ALSO +.Xr cpuset 1 , +.Xr cpuset 2 , +.Xr cpuset_getid 2 , +.Xr cpuset_setid 2 , +.Xr CPU_SET 3 , +.Xr pthread 3 , +.Xr pthread_attr_get_affinity_np 3 , +.Xr pthread_attr_set_affinity_np 3 . +.Sh STANDARDS +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +functions are non-standard +.Fx +extensions and may be not available on other operating systems. +.Sh HISTORY +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +function first appeared in +.Fx 7.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm pthread_getaffinity_np +and +.Nm pthread_setaffinity_np +functions were written by +.An David Xu +.Aq davidxu@FreeBSD.org , +and this manpage was written by +.An Xin LI +.Aq delphij@FreeBSD.org . Modified: head/share/man/man3/pthread_attr.3 ============================================================================== --- head/share/man/man3/pthread_attr.3 Sat Jan 9 12:28:42 2010 (r201891) +++ head/share/man/man3/pthread_attr.3 Sat Jan 9 12:31:11 2010 (r201892) @@ -26,7 +26,7 @@ .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd April 28, 2000 +.Dd January 8, 2010 .Dt PTHREAD_ATTR 3 .Os .Sh NAME @@ -209,9 +209,9 @@ Invalid or unsupported value for .El .Sh SEE ALSO .Xr pthread_attr_get_np 3 , +.Xr pthread_attr_affinity_np 3 , .Xr pthread_create 3 .Sh STANDARDS -The .Fn pthread_attr_init , .Fn pthread_attr_destroy , .Fn pthread_attr_setstacksize , Added: head/share/man/man3/pthread_attr_affinity_np.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/pthread_attr_affinity_np.3 Sat Jan 9 12:31:11 2010 (r201892) @@ -0,0 +1,150 @@ +.\"- +.\" Copyright (c) 2010 Xin LI +.\" 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$ +.\" +.Dd January 8, 2010 +.Dt PTHREAD_ATTR_AFFINITY_NP 3 +.Os +.Sh NAME +.Nm pthread_attr_getaffinity_np , +.Nm pthread_attr_setaffinity_np +.Nd manage CPU affinity in thread attribute object +.Sh LIBRARY +.Lb libpthread +.Sh SYNOPSIS +.In pthread_np.h +.Ft int +.Fn pthread_attr_getaffinity_np "const pthread_attr_t *pattr" "size_t cpusetsize" "cpuset_t *cpusetp" +.Ft int +.Fn pthread_attr_setaffinity_np "pthread_attr_t *pattr" "size_t cpusetsize" "const cpuset_t *cpusetp" +.Sh DESCRIPTION +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +allow the manipulation of sets of CPUs available to specified thread attribute object. +.Pp +Masks of type +.Ft cpuset_t +are composed using the +.Xr CPU_SET 2 +macros. +The kernel tolerates large sets as long as all CPUs specified +in the set exist. +Sets smaller than the kernel uses generate an error on calls to +.Fn pthread_attr_getaffinity_np +even if the result set would fit within the user supplied set. +Calls to +.Fn pthread_attr_setaffinity_np +tolerate small sets with no restrictions. +.Pp +The supplied mask should have a size of +.Fa cpusetsize +bytes. +This size is usually provided by calling +.Li sizeof(cpuset_t) +which is ultimately determined by the value of +.Dv CPU_SETSIZE +as defined in +.In sys/cpuset.h . +.Pp +.Fn pthread_attr_getaffinity_np +retrieves the +mask from the thread attribute object specified by +.Fa pattr , +and stores it in the space provided by +.Fa cpumaskp . +.Pp +.Fn pthread_attr_setaffinity_np +set the mask for the thread attribute object specified by +.Fa pattr +to the value in +.Fa cpumaskp . +.Pp +.Sh RETURN VALUES +If successful, the +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +functions will return zero. +Otherwise an error number will be returned +to indicate the error. +.Sh ERRORS +The +.Fn pthread_attr_getaffinity_np +and +.Fn pthread_attr_setaffinity_np +functions will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa pattr +or the attribute specified by it is NULL. +.El +.Pp +The +.Fn pthread_attr_setaffinity_np +function will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa pattr +or the attribute specified by it is NULL. +.It Bq Er ENOMEM +Insufficient memory exists to store the cpuset mask. +.El +.Sh SEE ALSO +.Xr cpuset 1 , +.Xr cpuset 2 , +.Xr cpuset_getid 2 , +.Xr cpuset_setid 2 , +.Xr CPU_SET 3 , +.Xr pthread_get_affinity_np 3 , +.Xr pthread_set_affinity_np 3 . +.Sh STANDARDS +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions are non-standard +.Fx +extensions and may be not available on other operating systems. +.Sh HISTORY +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions first appeared in +.Fx 7.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm pthread_attr_getaffinity_np +and +.Nm pthread_attr_setaffinity_np +functions were written by +.An David Xu Aq davidxu@FreeBSD.org , +and this manpage was written by +.An Xin LI Aq delphij@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 12:34:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 440A3106566B; Sat, 9 Jan 2010 12:34:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3329C8FC16; Sat, 9 Jan 2010 12:34:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09CYGwn001570; Sat, 9 Jan 2010 12:34:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09CYGXi001568; Sat, 9 Jan 2010 12:34:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201001091234.o09CYGXi001568@svn.freebsd.org> From: Xin LI Date: Sat, 9 Jan 2010 12:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201894 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 12:34:16 -0000 Author: delphij Date: Sat Jan 9 12:34:15 2010 New Revision: 201894 URL: http://svn.freebsd.org/changeset/base/201894 Log: Fix formatting. MFC after: 2 weeks Modified: head/share/man/man4/uart.4 Modified: head/share/man/man4/uart.4 ============================================================================== --- head/share/man/man4/uart.4 Sat Jan 9 12:32:07 2010 (r201893) +++ head/share/man/man4/uart.4 Sat Jan 9 12:34:15 2010 (r201894) @@ -28,11 +28,9 @@ .Dd March 12, 2008 .Dt UART 4 .Os -.\" .Sh NAME .Nm uart .Nd driver for Universal Asynchronous Receiver/Transmitter (UART) devices -.\" .Sh SYNOPSIS .Cd "device uart" .Pp @@ -42,7 +40,6 @@ .Cd "device scc" .Cd "device uart" .Pp -.Bd -ragged offset -compact In .Pa /boot/device.hints : .Cd hint.uart.0.disabled="1" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 13:00:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2AC106566B; Sat, 9 Jan 2010 13:00:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 43BA68FC0A; Sat, 9 Jan 2010 13:00:19 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D388946B06; Sat, 9 Jan 2010 08:00:18 -0500 (EST) Date: Sat, 9 Jan 2010 13:00:18 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Baldwin In-Reply-To: <201001080812.21124.jhb@freebsd.org> Message-ID: References: <201001041825.o04IPcXb043347@svn.freebsd.org> <20100107203536.GB8230@rincewind.paeps.cx> <20100107214334.GA35184@onelab2.iet.unipi.it> <201001080812.21124.jhb@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Michael Tuexen , svn-src-all@freebsd.org, src-committers@freebsd.org, Luigi Rizzo Subject: Re: moving sctp to a separate directory ? (Re: svn commit: r201523 - head/sys/netinet) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 13:00:19 -0000 On Fri, 8 Jan 2010, John Baldwin wrote: > Also, the 10-15 years thing is completely non-relevant. What is relevant is > if you are working on a project in a branch and someone renames files before > you have finished your branch and merged it up to HEAD. For example, assume > that someone else renamed the ipfw files in HEAD next week. That would > create an utter mess for you to resolve in your current ipfw3 branch. > Moving TCP would create similar a headache, except much more widespread > since TCP is one of the most widely worked-on subsystems. > > FWIW, I do think it would be cleaner to have netinet more split up perhaps, > but I do not think it is worth the pain that would be involved. Right, I'm very much in the same camp here. I also think our directory layout could stand to be improved and that it would make things easier to find. For less-modified (and especially, more recent) things like SCTP, I don't see harm in moving them now. But a lot of people have extensive local diffs against TCP, UDP, and their shared infrastructure. I know I do, and that many of our firewall/router/appliance/etc shops do as well. Also, having worked with a couple of trees that moved TCP around, I have to say that it's quite annoying to have the TCP headers and implementation in different spots. Every one grep turns into two, etc. :-) Finally, "Moving directories with svn is so easy that we should not worry even if we need a couple of attempts to find a good name" sends shivers down my spine. Robert N M Watson Computer Laboratory University of Cambridge From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 14:56:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6664106566C; Sat, 9 Jan 2010 14:56:38 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF0B8FC0A; Sat, 9 Jan 2010 14:56:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09EucXH032848; Sat, 9 Jan 2010 14:56:38 GMT (envelope-from zec@svn.freebsd.org) Received: (from zec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09EucEs032845; Sat, 9 Jan 2010 14:56:38 GMT (envelope-from zec@svn.freebsd.org) Message-Id: <201001091456.o09EucEs032845@svn.freebsd.org> From: Marko Zec Date: Sat, 9 Jan 2010 14:56:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201895 - head/sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 14:56:38 -0000 Author: zec Date: Sat Jan 9 14:56:38 2010 New Revision: 201895 URL: http://svn.freebsd.org/changeset/base/201895 Log: Reduce recursions on curvnet and thus spamming the console with warning messages for kernels built with options VIMAGE and VNET_DEBUG enabled. Reviewed by: bz MFC after: 3 days Modified: head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Sat Jan 9 12:34:15 2010 (r201894) +++ head/sys/nfsclient/nfs_vfsops.c Sat Jan 9 14:56:38 2010 (r201895) @@ -423,14 +423,18 @@ nfs_mountroot(struct mount *mp) char buf[128]; char *cp; + CURVNET_SET(TD_TO_VNET(td)); + #if defined(BOOTP_NFSROOT) && defined(BOOTP) bootpc_init(); /* use bootp to get nfs_diskless filled in */ #elif defined(NFS_ROOT) nfs_setup_diskless(); #endif - if (nfs_diskless_valid == 0) + if (nfs_diskless_valid == 0) { + CURVNET_RESTORE(); return (-1); + } if (nfs_diskless_valid == 1) nfs_convert_diskless(); @@ -516,6 +520,7 @@ nfs_mountroot(struct mount *mp) nd->root_args.hostname = buf; if ((error = nfs_mountdiskless(buf, &nd->root_saddr, &nd->root_args, td, &vp, mp)) != 0) { + CURVNET_RESTORE(); return (error); } @@ -529,6 +534,7 @@ nfs_mountroot(struct mount *mp) sizeof (prison0.pr_hostname)); mtx_unlock(&prison0.pr_mtx); inittodr(ntohl(nd->root_time)); + CURVNET_RESTORE(); return (0); } @@ -827,8 +833,6 @@ nfs_mount(struct mount *mp) has_fh_opt = 0; has_hostname_opt = 0; - CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); - if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; goto out; @@ -1128,7 +1132,6 @@ out: mp->mnt_kern_flag |= (MNTK_MPSAFE|MNTK_LOOKUP_SHARED); MNT_IUNLOCK(mp); } - CURVNET_RESTORE(); return (error); } Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Sat Jan 9 12:34:15 2010 (r201894) +++ head/sys/nfsclient/nfs_vnops.c Sat Jan 9 14:56:38 2010 (r201895) @@ -1555,19 +1555,15 @@ nfs_create(struct vop_create_args *ap) struct vattr vattr; int v3 = NFS_ISV3(dvp); - CURVNET_SET(CRED_TO_VNET(curthread->td_ucred)); - /* * Oops, not for me.. */ if (vap->va_type == VSOCK) { error = nfs_mknodrpc(dvp, ap->a_vpp, cnp, vap); - CURVNET_RESTORE(); return (error); } if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred)) != 0) { - CURVNET_RESTORE(); return (error); } if (vap->va_vaflags & VA_EXCLUSIVE) @@ -1665,7 +1661,6 @@ nfsmout: KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(dvp); } mtx_unlock(&(VTONFS(dvp))->n_mtx); - CURVNET_RESTORE(); return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 15:14:45 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09981106568B; Sat, 9 Jan 2010 15:14:45 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id A35BC8FC13; Sat, 9 Jan 2010 15:14:44 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id o09FEeOn056295; Sun, 10 Jan 2010 00:14:42 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sun, 10 Jan 2010 00:14:29 +0900 (JST) Message-Id: <20100110.001429.173527971.nyan@FreeBSD.org> To: bz@FreeBSD.org From: TAKAHASHI Yoshihiro In-Reply-To: <201001081901.o08J1pjc062909@svn.freebsd.org> References: <201001081901.o08J1pjc062909@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r201815 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 15:14:45 -0000 In article <201001081901.o08J1pjc062909@svn.freebsd.org> "Bjoern A. Zeeb" writes: > To avoid hardcoding further kernel configuration names for > make universe, split the logic into two parts: > - 1st to build worlds and generate kernel configs like LINT. > - 2nd to build kernels for a given TARGET architecture correctly > finding all newly generated configs, not knowing anything about > LINT anymore. (*) > +universe_kernels: universe_kernconfs > +BUILD_ARCH!= uname -p Should this be "uname -m"? > +TARGET?= ${BUILD_ARCH} > +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ > + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ > + ! -name DEFAULTS ! -name NOTES --- TAKAHASHI Yoshihiro From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 15:31:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AAC1065693; Sat, 9 Jan 2010 15:31:28 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CE818FC20; Sat, 9 Jan 2010 15:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09FVRT8040507; Sat, 9 Jan 2010 15:31:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09FVREK040503; Sat, 9 Jan 2010 15:31:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001091531.o09FVREK040503@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Jan 2010 15:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201896 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 15:31:28 -0000 Author: marius Date: Sat Jan 9 15:31:27 2010 New Revision: 201896 URL: http://svn.freebsd.org/changeset/base/201896 Log: Exclude options COMPAT_FREEBSD4 now that the MD freebsd4_sigreturn() is gone since r201396 and which is also in line with the fact that FreeBSD 4 didn't supported sparc64. PR: 142102 (second part) MFC after: 1 week Modified: head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Sat Jan 9 14:56:38 2010 (r201895) +++ head/sys/nfsserver/nfs.h Sat Jan 9 15:31:27 2010 (r201896) @@ -240,6 +240,7 @@ extern int nfs_debug; #endif +void nfs_realign(struct mbuf **); struct mbuf *nfs_rephead(int, struct nfsrv_descript *, int, struct mbuf **, caddr_t *); void nfsm_srvfattr(struct nfsrv_descript *, struct vattr *, Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Sat Jan 9 14:56:38 2010 (r201895) +++ head/sys/nfsserver/nfs_fha.c Sat Jan 9 15:31:27 2010 (r201896) @@ -158,9 +158,9 @@ SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ static void fha_extract_info(struct svc_req *req, struct fha_info *i) { - struct mbuf *md = req->rq_args; + struct mbuf *md; nfsfh_t fh; - caddr_t dpos = mtod(md, caddr_t); + caddr_t dpos; static u_int64_t random_fh = 0; int error; int v3 = (req->rq_vers == 3); @@ -201,6 +201,10 @@ fha_extract_info(struct svc_req *req, st procnum == NFSPROC_NULL) goto out; + nfs_realign(&req->rq_args); + md = req->rq_args; + dpos = mtod(md, caddr_t); + /* Grab the filehandle. */ error = nfsm_srvmtofh_xx(&fh.fh_generic, v3, &md, &dpos); if (error) Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sat Jan 9 14:56:38 2010 (r201895) +++ head/sys/nfsserver/nfs_srvkrpc.c Sat Jan 9 15:31:27 2010 (r201896) @@ -266,7 +266,7 @@ nfs_rephead(int siz, struct nfsrv_descri * not occur with NFS/UDP and is supposed to only occassionally occur * with TCP. Use vfs.nfs.realign_count and realign_test to check this. */ -static void +void nfs_realign(struct mbuf **pm) /* XXX COMMON */ { struct mbuf *m; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 15:37:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0F91065670; Sat, 9 Jan 2010 15:37:24 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2988FC23; Sat, 9 Jan 2010 15:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09FbOjt041863; Sat, 9 Jan 2010 15:37:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09FbODM041861; Sat, 9 Jan 2010 15:37:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001091537.o09FbODM041861@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jan 2010 15:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201897 - head/usr.sbin/traceroute X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 15:37:24 -0000 Author: bz Date: Sat Jan 9 15:37:24 2010 New Revision: 201897 URL: http://svn.freebsd.org/changeset/base/201897 Log: Correct spelling. Submitted by: (pluknet gmail.com) MFC after: 4 days X-MFC with: r201806 Modified: head/usr.sbin/traceroute/findsaddr-udp.c Modified: head/usr.sbin/traceroute/findsaddr-udp.c ============================================================================== --- head/usr.sbin/traceroute/findsaddr-udp.c Sat Jan 9 15:31:27 2010 (r201896) +++ head/usr.sbin/traceroute/findsaddr-udp.c Sat Jan 9 15:37:24 2010 (r201897) @@ -40,7 +40,7 @@ /* * Return the source address for the given destination address. * - * This makes use of proper source address seclection in the FreeBSD kernel + * This makes use of proper source address selection in the FreeBSD kernel * even taking jails into account (sys/netinet/in_pcb.c:in_pcbladdr()). * We open a UDP socket, and connect to the destination, letting the kernel * do the bind and then read the source IPv4 address using getsockname(2). From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 15:43:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CDF01065679; Sat, 9 Jan 2010 15:43:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6C48FC15; Sat, 9 Jan 2010 15:43:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09FhmQ7043280; Sat, 9 Jan 2010 15:43:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09FhliQ043278; Sat, 9 Jan 2010 15:43:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001091543.o09FhliQ043278@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jan 2010 15:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201898 - head/sys/opencrypto X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 15:43:48 -0000 Author: bz Date: Sat Jan 9 15:43:47 2010 New Revision: 201898 URL: http://svn.freebsd.org/changeset/base/201898 Log: Add comments trying to explain what bad things happen here, i.e. how hashed MD5/SHA are implemented, abusing Final() for padding and sw_octx to transport the key from the beginning to the end. Enlightened about what was going on here by: cperciva Reviewed by: cperciva MFC After: 3 days X-MFC with: r187826 PR: kern/126468 Modified: head/sys/opencrypto/cryptosoft.c Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Sat Jan 9 15:37:24 2010 (r201897) +++ head/sys/opencrypto/cryptosoft.c Sat Jan 9 15:43:47 2010 (r201898) @@ -434,7 +434,16 @@ swcr_authprepare(struct auth_hash *axf, case CRYPTO_MD5_KPDK: case CRYPTO_SHA1_KPDK: { - /* We need a buffer that can hold an md5 and a sha1 result. */ + /* + * We need a buffer that can hold an md5 and a sha1 result + * just to throw it away. + * What we do here is the initial part of: + * ALGO( key, keyfill, .. ) + * adding the key to sw_ictx and abusing Final() to get the + * "keyfill" padding. + * In addition we abuse the sw_octx to save the key to have + * it to be able to append it at the end in swcr_authcompute(). + */ u_char buf[SHA1_RESULTLEN]; sw->sw_klen = klen; @@ -495,9 +504,17 @@ swcr_authcompute(struct cryptodesc *crd, case CRYPTO_MD5_KPDK: case CRYPTO_SHA1_KPDK: + /* If we have no key saved, return error. */ if (sw->sw_octx == NULL) return EINVAL; + /* + * Add the trailing copy of the key (see comment in + * swcr_authprepare()) after the data: + * ALGO( .., key, algofill ) + * and let Final() do the proper, natural "algofill" + * padding. + */ axf->Update(&ctx, sw->sw_octx, sw->sw_klen); axf->Final(aalg, &ctx); break; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 15:59:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3FB1065676; Sat, 9 Jan 2010 15:59:15 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B41E8FC20; Sat, 9 Jan 2010 15:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09FxF4p046689; Sat, 9 Jan 2010 15:59:15 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09FxFuE046685; Sat, 9 Jan 2010 15:59:15 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001091559.o09FxFuE046685@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Jan 2010 15:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201899 - head/sys/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 15:59:15 -0000 Author: marius Date: Sat Jan 9 15:59:15 2010 New Revision: 201899 URL: http://svn.freebsd.org/changeset/base/201899 Log: Some style(9) fixes in order to fabricate a commit to denote that the commit message for r201896 actually should have read: As nfsm_srvmtofh_xx() assumes the 4-byte alignment required by XDR ensure the mbuf data is aligned accordingly by calling nfs_realign() in fha_extract_info(). This fix is orthogonal to the problem solved by r199274/r199284. PR: 142102 (second part) MFC after: 1 week Modified: head/sys/nfsserver/nfs.h head/sys/nfsserver/nfs_fha.c head/sys/nfsserver/nfs_srvkrpc.c Modified: head/sys/nfsserver/nfs.h ============================================================================== --- head/sys/nfsserver/nfs.h Sat Jan 9 15:43:47 2010 (r201898) +++ head/sys/nfsserver/nfs.h Sat Jan 9 15:59:15 2010 (r201899) @@ -82,14 +82,13 @@ #define IO_METASYNC 0 #endif - /* NFS state flags XXX -Wunused */ #define NFSRV_SNDLOCK 0x01000000 /* Send socket lock */ #define NFSRV_WANTSND 0x02000000 /* Want above */ /* - * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and mount_nfs - * should ever try and use it. + * Structures for the nfssvc(2) syscall. Not that anyone but nfsd and + * mount_nfs should ever try and use it. */ /* Modified: head/sys/nfsserver/nfs_fha.c ============================================================================== --- head/sys/nfsserver/nfs_fha.c Sat Jan 9 15:43:47 2010 (r201898) +++ head/sys/nfsserver/nfs_fha.c Sat Jan 9 15:59:15 2010 (r201899) @@ -71,16 +71,17 @@ static struct fha_global { u_long hashmask; } g_fha; -/* - * These are the entries in the filehandle hash. They talk about a specific - * file, requests against which are being handled by one or more nfsds. We keep - * a chain of nfsds against the file. We only have more than one if reads are - * ongoing, and then only if the reads affect disparate regions of the file. +/* + * These are the entries in the filehandle hash. They talk about a specific + * file, requests against which are being handled by one or more nfsds. We + * keep a chain of nfsds against the file. We only have more than one if reads + * are ongoing, and then only if the reads affect disparate regions of the + * file. * - * In general, we want to assign a new request to an existing nfsd if it is - * going to contend with work happening already on that nfsd, or if the - * operation is a read and the nfsd is already handling a proximate read. We - * do this to avoid jumping around in the read stream unnecessarily, and to + * In general, we want to assign a new request to an existing nfsd if it is + * going to contend with work happening already on that nfsd, or if the + * operation is a read and the nfsd is already handling a proximate read. We + * do this to avoid jumping around in the read stream unnecessarily, and to * avoid contention between threads over single files. */ struct fha_hash_entry { @@ -101,7 +102,7 @@ struct fha_info { }; static int fhe_stats_sysctl(SYSCTL_HANDLER_ARGS); - + static void nfs_fha_init(void *foo) { @@ -136,7 +137,7 @@ nfs_fha_init(void *foo) &fha_ctls.max_reqs_per_nfsd, 0, "Maximum requests that " "single nfsd thread should be working on at any time"); - SYSCTL_ADD_OID(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), + SYSCTL_ADD_OID(&fha_clist, SYSCTL_STATIC_CHILDREN(_vfs_nfsrv_fha), OID_AUTO, "fhe_stats", CTLTYPE_STRING | CTLFLAG_RD, 0, 0, fhe_stats_sysctl, "A", ""); } @@ -151,7 +152,7 @@ nfs_fha_uninit(void *foo) SYSINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_init, NULL); SYSUNINIT(nfs_fha, SI_SUB_ROOT_CONF, SI_ORDER_ANY, nfs_fha_uninit, NULL); -/* +/* * This just specifies that offsets should obey affinity when within * the same 1Mbyte (1<<20) chunk for the file (reads only for now). */ @@ -167,18 +168,18 @@ fha_extract_info(struct svc_req *req, st u_int32_t *tl; rpcproc_t procnum; - /* - * We start off with a random fh. If we get a reasonable - * procnum, we set the fh. If there's a concept of offset + /* + * We start off with a random fh. If we get a reasonable + * procnum, we set the fh. If there's a concept of offset * that we're interested in, we set that. */ i->fh = ++random_fh; i->offset = 0; i->locktype = LK_EXCLUSIVE; - + /* * Extract the procnum and convert to v3 form if necessary, - * taking care to deal with out-of-range procnums. Caller will + * taking care to deal with out-of-range procnums. Caller will * ensure that rq_vers is either 2 or 3. */ procnum = req->rq_proc; @@ -188,19 +189,19 @@ fha_extract_info(struct svc_req *req, st procnum = nfsrv_nfsv3_procid[procnum]; } - /* - * We do affinity for most. However, we divide a realm of affinity - * by file offset so as to allow for concurrent random access. We - * only do this for reads today, but this may change when IFS supports + /* + * We do affinity for most. However, we divide a realm of affinity + * by file offset so as to allow for concurrent random access. We + * only do this for reads today, but this may change when IFS supports * efficient concurrent writes. */ if (procnum == NFSPROC_FSSTAT || procnum == NFSPROC_FSINFO || procnum == NFSPROC_PATHCONF || - procnum == NFSPROC_NOOP || + procnum == NFSPROC_NOOP || procnum == NFSPROC_NULL) goto out; - + nfs_realign(&req->rq_args); md = req->rq_args; dpos = mtod(md, caddr_t); @@ -270,8 +271,8 @@ fha_hash_entry_new(u_int64_t fh) e->num_writes = 0; e->num_threads = 0; LIST_INIT(&e->threads); - - return e; + + return (e); } static void @@ -296,10 +297,9 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_i { struct fha_hash_entry *fhe, *new_fhe; - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) { + LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) if (fhe->fh == fh) break; - } if (!fhe) { /* Allocate a new entry. */ @@ -308,25 +308,24 @@ fha_hash_entry_lookup(SVCPOOL *pool, u_i mtx_lock(&pool->sp_lock); /* Double-check to make sure we still need the new entry. */ - LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) { + LIST_FOREACH(fhe, &g_fha.hashtable[fh % g_fha.hashmask], link) if (fhe->fh == fh) break; - } if (!fhe) { fhe = new_fhe; LIST_INSERT_HEAD(&g_fha.hashtable[fh % g_fha.hashmask], fhe, link); - } else { + } else fha_hash_entry_destroy(new_fhe); - } } - return fhe; + return (fhe); } static void fha_hash_entry_add_thread(struct fha_hash_entry *fhe, SVCTHREAD *thread) { + LIST_INSERT_HEAD(&fhe->threads, thread, st_alink); fhe->num_threads++; } @@ -339,7 +338,7 @@ fha_hash_entry_remove_thread(struct fha_ fhe->num_threads--; } -/* +/* * Account for an ongoing operation associated with this file. */ static void @@ -365,7 +364,7 @@ get_idle_thread(SVCPOOL *pool) } -/* +/* * Get the service thread currently associated with the fhe that is * appropriate to handle this operation. */ @@ -387,15 +386,15 @@ fha_hash_entry_choose_thread(SVCPOOL *po /* If there are any writes in progress, use the first thread. */ if (fhe->num_writes) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)w", thread, req_count); #endif return (thread); } - /* - * Check for read locality, making sure that we won't - * exceed our per-thread load limit in the process. + /* + * Check for read locality, making sure that we won't + * exceed our per-thread load limit in the process. */ offset1 = i->offset >> fha_ctls.bin_shift; offset2 = STAILQ_FIRST(&thread->st_reqs)->rq_p3 @@ -404,21 +403,21 @@ fha_hash_entry_choose_thread(SVCPOOL *po if ((fha_ctls.max_reqs_per_nfsd == 0) || (req_count < fha_ctls.max_reqs_per_nfsd)) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)r", thread, req_count); #endif return (thread); } } - /* + /* * We don't have a locality match, so skip this thread, - * but keep track of the most attractive thread in case + * but keep track of the most attractive thread in case * we need to come back to it later. */ #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, - "fha: %p(%d)s off1 %llu off2 %llu", thread, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + "fha: %p(%d)s off1 %llu off2 %llu", thread, req_count, offset1, offset2); #endif if ((min_thread == NULL) || (req_count < min_count)) { @@ -427,38 +426,38 @@ fha_hash_entry_choose_thread(SVCPOOL *po } } - /* - * We didn't find a good match yet. See if we can add + /* + * We didn't find a good match yet. See if we can add * a new thread to this file handle entry's thread list. */ - if ((fha_ctls.max_nfsds_per_fh == 0) || + if ((fha_ctls.max_nfsds_per_fh == 0) || (fhe->num_threads < fha_ctls.max_nfsds_per_fh)) { - /* - * We can add a new thread, so try for an idle thread - * first, and fall back to this_thread if none are idle. + /* + * We can add a new thread, so try for an idle thread + * first, and fall back to this_thread if none are idle. */ if (STAILQ_EMPTY(&this_thread->st_reqs)) { thread = this_thread; #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)t", thread, thread->st_reqcount); #endif } else if ((thread = get_idle_thread(pool))) { #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)i", thread, thread->st_reqcount); #endif - } else { + } else { thread = this_thread; #if 0 - ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, + ITRACE_CURPROC(ITRACE_NFS, ITRACE_INFO, "fha: %p(%d)b", thread, thread->st_reqcount); #endif } fha_hash_entry_add_thread(fhe, thread); } else { - /* - * We don't want to use any more threads for this file, so + /* + * We don't want to use any more threads for this file, so * go back to the most attractive nfsd we're already using. */ thread = min_thread; @@ -467,8 +466,8 @@ fha_hash_entry_choose_thread(SVCPOOL *po return (thread); } -/* - * After getting a request, try to assign it to some thread. Usually we +/* + * After getting a request, try to assign it to some thread. Usually we * handle it ourselves. */ SVCTHREAD * @@ -491,16 +490,16 @@ fha_assign(SVCTHREAD *this_thread, struc pool = req->rq_xprt->xp_pool; fha_extract_info(req, &i); - /* - * We save the offset associated with this request for later + /* + * We save the offset associated with this request for later * nfsd matching. */ fhe = fha_hash_entry_lookup(pool, i.fh); req->rq_p1 = fhe; req->rq_p2 = i.locktype; req->rq_p3 = i.offset; - - /* + + /* * Choose a thread, taking into consideration locality, thread load, * and the number of threads already working on this file. */ @@ -511,8 +510,8 @@ fha_assign(SVCTHREAD *this_thread, struc return (thread); } -/* - * Called when we're done with an operation. The request has already +/* + * Called when we're done with an operation. The request has already * been de-queued. */ void Modified: head/sys/nfsserver/nfs_srvkrpc.c ============================================================================== --- head/sys/nfsserver/nfs_srvkrpc.c Sat Jan 9 15:43:47 2010 (r201898) +++ head/sys/nfsserver/nfs_srvkrpc.c Sat Jan 9 15:59:15 2010 (r201899) @@ -187,19 +187,18 @@ nfssvc_nfsserver(struct thread *td, stru } error = nfssvc_addsock(fp, td); fdrop(fp, td); - } else if (uap->flag & NFSSVC_OLDNFSD) { + } else if (uap->flag & NFSSVC_OLDNFSD) error = nfssvc_nfsd(td, NULL); - } else if (uap->flag & NFSSVC_NFSD) { - if (!uap->argp) + else if (uap->flag & NFSSVC_NFSD) { + if (!uap->argp) return (EINVAL); error = copyin(uap->argp, (caddr_t)&nfsdarg, sizeof(nfsdarg)); if (error) return (error); error = nfssvc_nfsd(td, &nfsdarg); - } else { + } else error = ENXIO; - } return (error); } @@ -447,9 +446,8 @@ nfssvc_addsock(struct file *fp, struct t siz = sb_max_adj; error = soreserve(so, siz, siz); - if (error) { + if (error) return (error); - } /* * Steal the socket from userland so that it doesn't close @@ -471,7 +469,7 @@ nfssvc_addsock(struct file *fp, struct t } /* - * Called by nfssvc() for nfsds. Just loops around servicing rpc requests + * Called by nfssvc() for nfsds. Just loops around servicing rpc requests * until it is killed by a signal. */ static int @@ -496,9 +494,9 @@ nfssvc_nfsd(struct thread *td, struct nf #endif /* - * Only the first nfsd actually does any work. The RPC code - * adds threads to it as needed. Any extra processes offered - * by nfsd just exit. If nfsd is new enough, it will call us + * Only the first nfsd actually does any work. The RPC code + * adds threads to it as needed. Any extra processes offered + * by nfsd just exit. If nfsd is new enough, it will call us * once with a structure that specifies how many threads to * use. */ @@ -522,7 +520,7 @@ nfssvc_nfsd(struct thread *td, struct nf nfsrv_pool->sp_minthreads = 4; nfsrv_pool->sp_maxthreads = 4; } - + svc_run(nfsrv_pool); #ifdef KGSSAPI @@ -541,7 +539,7 @@ nfssvc_nfsd(struct thread *td, struct nf /* * Size the NFS server's duplicate request cache at 1/2 the - * nmbclusters, floating within a (64, 2048) range. This is to + * nmbclusters, floating within a (64, 2048) range. This is to * prevent all mbuf clusters being tied up in the NFS dupreq * cache for small values of nmbclusters. */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 16:16:58 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC693106568F; Sat, 9 Jan 2010 16:16:58 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 739248FC26; Sat, 9 Jan 2010 16:16:58 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id E311F730A1; Sat, 9 Jan 2010 17:24:58 +0100 (CET) Date: Sat, 9 Jan 2010 17:24:58 +0100 From: Luigi Rizzo To: "M. Warner Losh" Message-ID: <20100109162458.GA8270@onelab2.iet.unipi.it> References: <20100107203536.GB8230@rincewind.paeps.cx> <20100107214334.GA35184@onelab2.iet.unipi.it> <201001080812.21124.jhb@freebsd.org> <20100108.175640.1104512900458971844.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100108.175640.1104512900458971844.imp@bsdimp.com> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, tuexen@FreeBSD.org, jhb@FreeBSD.org Subject: Re: moving sctp to a separate directory ? X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 16:16:58 -0000 On Fri, Jan 08, 2010 at 05:56:40PM -0700, M. Warner Losh wrote: > In message: <201001080812.21124.jhb@freebsd.org> > John Baldwin writes: > : On Thursday 07 January 2010 4:43:34 pm Luigi Rizzo wrote: > : > > What do you do with udp, for instance? Compared to tcp and sctp, it's > : > > trivial in terms of code, but it's an upper layer protocol from the > : > > perspective of netinet/netinet6 - do we put it in its own directory too? > : > > Also note that this won't only cause churn for people who have patches against > : > > or (out-of-tree) branches from netinet/, but also in other kernel subsystems > : > > which rely on tcp -- nfs, for instance. > : > > : > + i find the concern about churn in external patchsets a bit weak, first of > : > all because this is bound to happen unless we stop all development, > : > and secondly because this kind of file moving or splitting happens > : > once every 10-15 years which is well beyond the lifetime of a patchset. > : > : Having the files rename is entirely different from merging changes. At least > : for svn and p4 I believe that merging a rename into a branch is not smart > : enough to merge your local changes into the new files. Instead it involves a > : big manual fixup. > : > : Also, the 10-15 years thing is completely non-relevant. What is relevant is > : if you are working on a project in a branch and someone renames files before > : you have finished your branch and merged it up to HEAD. For example, assume > : that someone else renamed the ipfw files in HEAD next week. That would > : create an utter mess for you to resolve in your current ipfw3 branch. Moving > : TCP would create similar a headache, except much more widespread since TCP is > : one of the most widely worked-on subsystems. > : > : FWIW, I do think it would be cleaner to have netinet more split up perhaps, > : but I do not think it is worth the pain that would be involved. > > It is painful enough moving drivers around. I think that while well > intentioned, it will cause us nothing but grief. given the overwhelming response, i give up :) > Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 17:09:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 625C91065670; Sat, 9 Jan 2010 17:09:57 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50EBC8FC0A; Sat, 9 Jan 2010 17:09:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09H9vmt062331; Sat, 9 Jan 2010 17:09:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09H9vhK062329; Sat, 9 Jan 2010 17:09:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001091709.o09H9vhK062329@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Jan 2010 17:09:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201901 - head/sys/boot/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 17:09:57 -0000 Author: marius Date: Sat Jan 9 17:09:57 2010 New Revision: 201901 URL: http://svn.freebsd.org/changeset/base/201901 Log: Remove clause 3 and 4 from TNF licenses (this was the only 4-clause TNF license FreeBSD had in sys/boot). Obtained from: NetBSD Modified: head/sys/boot/common/dev_net.c Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Sat Jan 9 16:15:10 2010 (r201900) +++ head/sys/boot/common/dev_net.c Sat Jan 9 17:09:57 2010 (r201901) @@ -1,6 +1,4 @@ -/* - * $NetBSD: dev_net.c,v 1.12 1997/12/10 20:38:37 gwr Exp $ - */ +/* $NetBSD: dev_net.c,v 1.23 2008/04/28 20:24:06 martin Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -17,13 +15,6 @@ * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 17:10:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4DD0106566C; Sat, 9 Jan 2010 17:10:50 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7248FC17; Sat, 9 Jan 2010 17:10:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o09H4MtH018769; Sat, 9 Jan 2010 10:04:22 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 09 Jan 2010 10:05:12 -0700 (MST) Message-Id: <20100109.100512.623571555980925615.imp@bsdimp.com> To: nyan@freebsd.org From: "M. Warner Losh" In-Reply-To: <20100110.001429.173527971.nyan@FreeBSD.org> References: <201001081901.o08J1pjc062909@svn.freebsd.org> <20100110.001429.173527971.nyan@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, bz@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r201815 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 17:10:50 -0000 In message: <20100110.001429.173527971.nyan@FreeBSD.org> TAKAHASHI Yoshihiro writes: : In article <201001081901.o08J1pjc062909@svn.freebsd.org> : "Bjoern A. Zeeb" writes: : : > To avoid hardcoding further kernel configuration names for : > make universe, split the logic into two parts: : > - 1st to build worlds and generate kernel configs like LINT. : > - 2nd to build kernels for a given TARGET architecture correctly : > finding all newly generated configs, not knowing anything about : > LINT anymore. (*) : : > +universe_kernels: universe_kernconfs : > +BUILD_ARCH!= uname -p : : Should this be "uname -m"? : : : > +TARGET?= ${BUILD_ARCH} : > +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ : > + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ : > + ! -name DEFAULTS ! -name NOTES Yes. Also, the name BUILD_ARCH is misleading, since it corresponds to MACHINE, not to MACHINE_ARCH. it is clear that it is used in the MACHINE context, not the MACHINE_ARCH context. These two are often confused, but many of the embedded platforms have added to the confusion and it is unclear where the sharp dividing line should be here anymore. It used to be separate boot environment, but even that has gotten fuzzy for architectures like mips and arm that boot with a huge variety of boot loaders... Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 17:21:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA17A1065670; Sat, 9 Jan 2010 17:21:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 996928FC1C; Sat, 9 Jan 2010 17:21:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09HLatT064950; Sat, 9 Jan 2010 17:21:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09HLaw9064948; Sat, 9 Jan 2010 17:21:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091721.o09HLaw9064948@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 17:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201903 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 17:21:36 -0000 Author: imp Date: Sat Jan 9 17:21:36 2010 New Revision: 201903 URL: http://svn.freebsd.org/changeset/base/201903 Log: Merge r201902 and r195669 from projects/mips into head by hand: r201902 | imp | 2010-01-09 10:16:19 -0700 (Sat, 09 Jan 2010) | 2 lines Fix comment, which was missed in an earlier commit... r195669 | gonzo | 2009-07-13 17:03:44 -0600 (Mon, 13 Jul 2009) | 3 lines - Remove -mno-dsp from CFLAGS. MIPS DSP ASE is off by default now (as it should be) Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Jan 9 17:16:19 2010 (r201902) +++ head/sys/conf/kern.mk Sat Jan 9 17:21:36 2010 (r201903) @@ -86,11 +86,10 @@ INLINE_LIMIT?= 15000 .endif # -# For MIPS we also tell gcc to use floating point emulation and -# disable MIPS DSP ASE Instruction set. +# For MIPS we also tell gcc to use floating point emulation # .if ${MACHINE_ARCH} == "mips" -CFLAGS+= -msoft-float -mno-dsp +CFLAGS+= -msoft-float INLINE_LIMIT?= 8000 .endif From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 17:40:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91F0D106568B; Sat, 9 Jan 2010 17:40:09 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4328FC17; Sat, 9 Jan 2010 17:40:09 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 3191D41C67E; Sat, 9 Jan 2010 18:40:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id WaH4QUA6xe9R; Sat, 9 Jan 2010 18:40:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 76FCE41C679; Sat, 9 Jan 2010 18:40:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 579114448EC; Sat, 9 Jan 2010 17:36:32 +0000 (UTC) Date: Sat, 9 Jan 2010 17:36:32 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: "M. Warner Losh" In-Reply-To: <20100109.100512.623571555980925615.imp@bsdimp.com> Message-ID: <20100109173314.V50938@maildrop.int.zabbadoz.net> References: <201001081901.o08J1pjc062909@svn.freebsd.org> <20100110.001429.173527971.nyan@FreeBSD.org> <20100109.100512.623571555980925615.imp@bsdimp.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, nyan@freebsd.org Subject: Re: svn commit: r201815 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 17:40:09 -0000 On Sat, 9 Jan 2010, M. Warner Losh wrote: > In message: <20100110.001429.173527971.nyan@FreeBSD.org> > TAKAHASHI Yoshihiro writes: > : In article <201001081901.o08J1pjc062909@svn.freebsd.org> > : "Bjoern A. Zeeb" writes: > : > : > To avoid hardcoding further kernel configuration names for > : > make universe, split the logic into two parts: > : > - 1st to build worlds and generate kernel configs like LINT. > : > - 2nd to build kernels for a given TARGET architecture correctly > : > finding all newly generated configs, not knowing anything about > : > LINT anymore. (*) > : > : > +universe_kernels: universe_kernconfs > : > +BUILD_ARCH!= uname -p > : > : Should this be "uname -m"? > : > : > : > +TARGET?= ${BUILD_ARCH} > : > +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ > : > + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ > : > + ! -name DEFAULTS ! -name NOTES > > Yes. Also, the name BUILD_ARCH is misleading, since it corresponds to > MACHINE, not to MACHINE_ARCH. it is clear that it is used in the > MACHINE context, not the MACHINE_ARCH context. > > These two are often confused, but many of the embedded platforms have > added to the confusion and it is unclear where the sharp dividing line > should be here anymore. It used to be separate boot environment, but > even that has gotten fuzzy for architectures like mips and arm that > boot with a huge variety of boot loaders... I guess the intial problem I had it from was introduced in r54311 to Makefile.inc1, which nowadays reads like: BUILD_ARCH!= uname -p So, the suggested correction would be: MACHINE!= uname -m I wonder if I should use XMACHINE but that usually means "cross"(building). I could use _MACHINE!= to not confuse it with MACHINE from Makefile.inc1? /bz -- Bjoern A. Zeeb It will not break if you know what you are doing. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 17:56:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55E53106566B; Sat, 9 Jan 2010 17:56:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE788FC13; Sat, 9 Jan 2010 17:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09HuQDt072662; Sat, 9 Jan 2010 17:56:26 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09HuQvK072661; Sat, 9 Jan 2010 17:56:26 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091756.o09HuQvK072661@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 17:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201905 - head/sys/mips/sibyte X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 17:56:26 -0000 Author: imp Date: Sat Jan 9 17:56:25 2010 New Revision: 201905 URL: http://svn.freebsd.org/changeset/base/201905 Log: Merge from projects/mips to head by hand: Copy the files for the sibyte support (except files in sys/conf and sys/mips/conf). This targets the Broadcom SWARM board (bcm91250) and the SB-1 core in the BCM1250 SoC. This work was done by Neel Natu. Added: - copied from r201903, projects/mips/sys/mips/sibyte/ Directory Properties: head/sys/mips/sibyte/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:02:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABBD91065694; Sat, 9 Jan 2010 18:02:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 821678FC1F; Sat, 9 Jan 2010 18:02:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09I2VMn074073; Sat, 9 Jan 2010 18:02:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09I2VHG074072; Sat, 9 Jan 2010 18:02:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091802.o09I2VHG074072@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201906 - head/sys/mips/atheros X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:02:31 -0000 Author: imp Date: Sat Jan 9 18:02:31 2010 New Revision: 201906 URL: http://svn.freebsd.org/changeset/base/201906 Log: Merge from projects/mips to head by hand: Merge support files for the Atheros AR71xx (and soon AR9xxx) processors, except files from sys/conf and sys/mips/conf. This work was done primarily by Olecksandr Tymoshenko and works on the RouterStation and RouterStation PRO. Other AR71xx-based boards have been reported as working as well (RouterBoard, for example). Added: - copied from r201905, projects/mips/sys/mips/atheros/ Directory Properties: head/sys/mips/atheros/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:07:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6DFD1065679; Sat, 9 Jan 2010 18:07:10 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965BE8FC08; Sat, 9 Jan 2010 18:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09I7At6075175; Sat, 9 Jan 2010 18:07:10 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09I7A0u075173; Sat, 9 Jan 2010 18:07:10 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201001091807.o09I7A0u075173@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 9 Jan 2010 18:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201907 - head/sys/dev/cxgb/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:07:10 -0000 Author: np Date: Sat Jan 9 18:07:10 2010 New Revision: 201907 URL: http://svn.freebsd.org/changeset/base/201907 Log: Extra parantheses to keep certain compilers happy. Submitted by: trasz@ Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Sat Jan 9 18:02:31 2010 (r201906) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Sat Jan 9 18:07:10 2010 (r201907) @@ -4443,7 +4443,7 @@ int __devinit t3_prep_adapter(adapter_t adapter->params.info = ai; adapter->params.nports = ai->nports0 + ai->nports1; - adapter->params.chan_map = !!ai->nports0 | (!!ai->nports1 << 1); + adapter->params.chan_map = (!!ai->nports0) | (!!ai->nports1 << 1); adapter->params.rev = t3_read_reg(adapter, A_PL_REV); /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:08:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E4D106568B; Sat, 9 Jan 2010 18:08:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F35E8FC14; Sat, 9 Jan 2010 18:08:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09I8WLo075511; Sat, 9 Jan 2010 18:08:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09I8WhB075509; Sat, 9 Jan 2010 18:08:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091808.o09I8WhB075509@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201908 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:08:32 -0000 Author: imp Date: Sat Jan 9 18:08:31 2010 New Revision: 201908 URL: http://svn.freebsd.org/changeset/base/201908 Log: Merge from pprojects/mips to head by hand. Copy over the SWARM config file. Added: - copied unchanged from r201907, projects/mips/sys/mips/conf/SWARM Directory Properties: head/sys/mips/conf/SWARM (props changed) Copied: head/sys/mips/conf/SWARM (from r201907, projects/mips/sys/mips/conf/SWARM) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM Sat Jan 9 18:08:31 2010 (r201908, copy of r201907, projects/mips/sys/mips/conf/SWARM) @@ -0,0 +1,81 @@ +# +# $Id: //depot/user/neelnatu/freebsd_sibyte/src/sys/mips/conf/SWARM#7 $ +# + +ident SWARM +options CPU_SB1 + +files "../sibyte/files.sibyte" +hints "SWARM.hints" + +options PCI_IOSPACE_ADDR=0xFC000000 +options PCI_IOSPACE_SIZE=0x02000000 + +# +# 32-bit kernel cannot deal with physical memory beyond 4GB +# XXX pmap assumes that all the memory can be mapped using KSEG0 +# +options MAXMEM=512*1024 + +options CFE +options CFE_CONSOLE +options CFE_ENV +options ALT_BREAK_TO_DEBUGGER + +# cfe loader expects kernel at 0x80001000 for mips32 w/o backwards +# offsets in the linked elf image (see ldscript hack) +# XXX can we conditionalize the linker stuff on options CFE? +options KERNVIRTADDR=0x80001000 + +makeoptions LDSCRIPT_NAME= ldscript.mips.cfe + +#cpu CPU_MIPS64 +#options ISA_MIPS64 +#makeoptions ARCH_FLAGS="-march=mips64 -mgp64 -mabi=o64" +cpu CPU_MIPS32 +options ISA_MIPS32 +makeoptions ARCH_FLAGS="-march=mips32" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# Debugging for use in -current +options INVARIANTS +options INVARIANT_SUPPORT +options WITNESS + +options FFS #Fast filesystem + +device pci +device miibus +device bge +device loop +device ether +device md +device random + +options USB_DEBUG +device usb +device ohci +device uhci +device ehci + +device umass + +device scbus +device da + +device ata +device atadisk +device atapicd +options ATA_STATIC_ID From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:09:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17FFD106568B; Sat, 9 Jan 2010 18:09:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 076A58FC16; Sat, 9 Jan 2010 18:09:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09I9UrZ075791; Sat, 9 Jan 2010 18:09:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09I9UrN075789; Sat, 9 Jan 2010 18:09:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091809.o09I9UrN075789@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:09:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201909 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:09:31 -0000 Author: imp Date: Sat Jan 9 18:09:30 2010 New Revision: 201909 URL: http://svn.freebsd.org/changeset/base/201909 Log: Merge from projects/mips to head by hand. Copy over the SWARM.hints file. Added: - copied unchanged from r201908, projects/mips/sys/mips/conf/SWARM.hints Directory Properties: head/sys/mips/conf/SWARM.hints (props changed) Copied: head/sys/mips/conf/SWARM.hints (from r201908, projects/mips/sys/mips/conf/SWARM.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/SWARM.hints Sat Jan 9 18:09:30 2010 (r201909, copy of r201908, projects/mips/sys/mips/conf/SWARM.hints) @@ -0,0 +1,17 @@ +# $FreeBSD$ +hint.zbbus.0.at="nexus0" +hint.zbpci.0.at="zbbus0" +hint.scd.0.at="zbbus0" + +# +# SWARM IDE interface is on the generic bus at chip select 4. +# The CS4 region is 64KB in size and starts at 0x100B0000. +# The IDE interrupt is wired to GPIO4 (intsrc 36 to the interrupt mapper) +# +hint.ata.0.at="zbbus0" +hint.ata.0.maddr=0x100B0000 +hint.ata.0.msize=0x10000 +hint.ata.0.irq=36 +#hint.ata.0.disabled=0 +#hint.ata.0.regoffset=0x1F0 +#hint.ata.0.regshift=5 From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:10:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C45EB1065697; Sat, 9 Jan 2010 18:10:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE1D8FC19; Sat, 9 Jan 2010 18:10:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IAkJQ076144; Sat, 9 Jan 2010 18:10:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IAk14076142; Sat, 9 Jan 2010 18:10:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091810.o09IAk14076142@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201910 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:10:46 -0000 Author: imp Date: Sat Jan 9 18:10:46 2010 New Revision: 201910 URL: http://svn.freebsd.org/changeset/base/201910 Log: Merge from projects/mips to head by hand: Copy over the AR71XX config file. Added: - copied unchanged from r201909, projects/mips/sys/mips/conf/AR71XX Directory Properties: head/sys/mips/conf/AR71XX (props changed) Copied: head/sys/mips/conf/AR71XX (from r201909, projects/mips/sys/mips/conf/AR71XX) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR71XX Sat Jan 9 18:10:46 2010 (r201910, copy of r201909, projects/mips/sys/mips/conf/AR71XX) @@ -0,0 +1,86 @@ +# +# $FreeBSD$ +# + +ident AR71XX +cpu CPU_MIPS4KC +options ISA_MIPS32 +makeoptions TARGET_BIG_ENDIAN +makeoptions KERNLOADADDR=0x80050000 +options HZ=1000 + +files "../atheros/files.ar71xx" +hints "AR71XX.hints" + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols +makeoptions MODULES_OVERRIDE="" + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +# options NFS_LEGACYRPC +# Debugging for use in -current +# options INVARIANTS +# options INVARIANT_SUPPORT +# options WITNESS +# options WITNESS_SKIPSPIN +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories + + +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=arge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:192.168.10.1:/mnt/bsd\" + +device pci + +# Wireless NIC cards +options IEEE80211_DEBUG +options IEEE80211_SUPPORT_MESH +options IEEE80211_SUPPORT_TDMA +device wlan # 802.11 support +device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support + +device ath # Atheros pci/cardbus NIC's +options ATH_DEBUG +device ath_hal +option AH_SUPPORT_AR5416 +device ath_rate_sample + +device mii +device arge + +# device usb +# options USB_EHCI_BIG_ENDIAN_DESC # handle big-endian byte order +# options USB_DEBUG +# device ehci + +device spibus +device ar71xx_spi +device mx25l +# device geom_redboot + +device ar71xx_wdog + +device uart + +device loop +device ether +device md +device bpf +device random +device if_bridge From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:11:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75AEE106568D; Sat, 9 Jan 2010 18:11:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64F138FC1D; Sat, 9 Jan 2010 18:11:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IBjUO076424; Sat, 9 Jan 2010 18:11:45 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IBjnv076422; Sat, 9 Jan 2010 18:11:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091811.o09IBjnv076422@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201911 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:11:45 -0000 Author: imp Date: Sat Jan 9 18:11:45 2010 New Revision: 201911 URL: http://svn.freebsd.org/changeset/base/201911 Log: Merge from projects/mips to head by hand: Copy over AR71XX.hints file. Added: - copied unchanged from r201910, projects/mips/sys/mips/conf/AR71XX.hints Directory Properties: head/sys/mips/conf/AR71XX.hints (props changed) Copied: head/sys/mips/conf/AR71XX.hints (from r201910, projects/mips/sys/mips/conf/AR71XX.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/AR71XX.hints Sat Jan 9 18:11:45 2010 (r201911, copy of r201910, projects/mips/sys/mips/conf/AR71XX.hints) @@ -0,0 +1,59 @@ +# $FreeBSD$ +hint.apb.0.at="nexus0" +hint.apb.0.irq=4 + +# uart0 +hint.uart.0.at="apb0" +# see atheros/uart_cpu_ar71xx.c why +3 +hint.uart.0.maddr=0x18020003 +hint.uart.0.msize=0x18 +hint.uart.0.irq=3 + +#ohci +hint.ohci.0.at="apb0" +hint.ohci.0.maddr=0x1c000000 +hint.ohci.0.msize=0x01000000 +hint.ohci.0.irq=6 + +#ehci +hint.ehci.0.at="nexus0" +hint.ehci.0.maddr=0x1b000000 +hint.ehci.0.msize=0x01000000 +hint.ehci.0.irq=1 + +# pci +hint.pcib.0.at="nexus0" +hint.pcib.0.irq=0 + +hint.arge.0.at="nexus0" +hint.arge.0.maddr=0x19000000 +hint.arge.0.msize=0x1000 +hint.arge.0.irq=2 +# PHY4 = 1 << 4 +hint.arge.0.phymask=0x10 +# Uncomment this hint for RS (not PRO) +# PHY20 = 1 << 20 +# hint.arge.0.phymask=0x100000 + +hint.arge.1.at="nexus0" +hint.arge.1.maddr=0x1a000000 +hint.arge.1.msize=0x1000 +hint.arge.1.irq=3 +# PHY1, PHY2, PHY3 +hint.arge.1.phymask=0x0e +# should be 100 for RS +hint.arge.1.media=1000 +hint.arge.1.fduplex=1 +# Uncomment this hint for RS (not PRO) +# hint.arge.0.phymask=70000 + +# SPI flash +hint.spi.0.at="nexus0" +hint.spi.0.maddr=0x1f000000 +hint.spi.0.msize=0x10 + +hint.mx25l.0.at="spibus0" +hint.mx25l.0.cs=0 + +# Watchdog +hint.ar71xx_wdog.0.at="nexus0" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:13:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CF801065670; Sat, 9 Jan 2010 18:13:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C4768FC16; Sat, 9 Jan 2010 18:13:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IDEbk076756; Sat, 9 Jan 2010 18:13:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IDEwP076755; Sat, 9 Jan 2010 18:13:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091813.o09IDEwP076755@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201912 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:13:14 -0000 Author: imp Date: Sat Jan 9 18:13:13 2010 New Revision: 201912 URL: http://svn.freebsd.org/changeset/base/201912 Log: Merge from projects/mips to head by hand: Copy over OCTEON1-32 file: the 32-bit variant of the octeon kernel config file. Added: - copied unchanged from r201911, projects/mips/sys/mips/conf/OCTEON1-32 Directory Properties: head/sys/mips/conf/OCTEON1-32 (props changed) Copied: head/sys/mips/conf/OCTEON1-32 (from r201911, projects/mips/sys/mips/conf/OCTEON1-32) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/OCTEON1-32 Sat Jan 9 18:13:13 2010 (r201912, copy of r201911, projects/mips/sys/mips/conf/OCTEON1-32) @@ -0,0 +1,92 @@ +# OCTEON1 -- Configuration kernel for all Octeon1 SoCs from Cavium Networks +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident OCTEON1 + +#makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +#makeoptions LDSCRIPT_NAME= ldscript.mips.mips64 + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN=defined +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 +#makeoptions TARGET_64BIT=defined + +options KERNVIRTADDR=0x80100000 +makeoptions KERNLOADADDR=0x80100000 +include "../octeon1/std.octeon1" + +hints "OCTEON1.hints" #Default places to look for devices. + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +#XXXimp: Need to make work with 64-bit too +#options ISA_MIPS64 +options ISA_MIPS32 + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options ROOTDEVNAME=\"ufs:ad0s1a\" # Original +options NO_SWAPPING + + +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories + + +# Debugging for use in -current +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +#XXXimp device genclock +device loop +device ether +device md +device uart +nodevice uart_ns8250 +device rgmii +#options VERBOSE_SYSINIT + + +# +# Use the following for Compact Flash file-system +device cf +options ROOTDEVNAME = \"ufs:cf0s2\" # Unmask if compact flash is needed as RFS + +# +# Use the following for RFS in mem-device +#options MD_ROOT +#options ROOTDEVNAME = \"ufs:md0\" + +#options MD_ROOT_SIZE = 21264 +#XXX: Bring up UP first, then generalize. +#options SMP From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:14:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82C5E106568F; Sat, 9 Jan 2010 18:14:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7258A8FC1D; Sat, 9 Jan 2010 18:14:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IERHd077055; Sat, 9 Jan 2010 18:14:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IEROb077054; Sat, 9 Jan 2010 18:14:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091814.o09IEROb077054@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201913 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:14:27 -0000 Author: imp Date: Sat Jan 9 18:14:27 2010 New Revision: 201913 URL: http://svn.freebsd.org/changeset/base/201913 Log: Merge from projects/mips to head by hand: Copy over OCTEON1.hints file. Added: - copied unchanged from r201912, projects/mips/sys/mips/conf/OCTEON1.hints Directory Properties: head/sys/mips/conf/OCTEON1.hints (props changed) Copied: head/sys/mips/conf/OCTEON1.hints (from r201912, projects/mips/sys/mips/conf/OCTEON1.hints) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/OCTEON1.hints Sat Jan 9 18:14:27 2010 (r201913, copy of r201912, projects/mips/sys/mips/conf/OCTEON1.hints) @@ -0,0 +1,13 @@ +# /* +# * This product includes software developed by the University of + +# * California, Berkeley and its contributors." +# */ +# device.hints +hw.uart.console="io:0x1" +hint.obio.0.at="nexus" +hint.obio.0.maddr="0x1" +hint.obio.0.flags="0x1" +hint.uart.0.at="obio" +hint.uart.0.maddr="0x1" +hint.uart.0.flags="0x1" From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:14:35 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2FC106568B; Sat, 9 Jan 2010 18:14:35 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 411388FC14; Sat, 9 Jan 2010 18:14:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o09I79cD023114; Sat, 9 Jan 2010 11:07:09 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Sat, 09 Jan 2010 11:07:58 -0700 (MST) Message-Id: <20100109.110758.29593248145802975.imp@bsdimp.com> To: bz@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <20100109173314.V50938@maildrop.int.zabbadoz.net> References: <20100110.001429.173527971.nyan@FreeBSD.org> <20100109.100512.623571555980925615.imp@bsdimp.com> <20100109173314.V50938@maildrop.int.zabbadoz.net> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, nyan@FreeBSD.org Subject: Re: svn commit: r201815 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:14:35 -0000 In message: <20100109173314.V50938@maildrop.int.zabbadoz.net> "Bjoern A. Zeeb" writes: : On Sat, 9 Jan 2010, M. Warner Losh wrote: : : > In message: <20100110.001429.173527971.nyan@FreeBSD.org> : > TAKAHASHI Yoshihiro writes: : > : In article <201001081901.o08J1pjc062909@svn.freebsd.org> : > : "Bjoern A. Zeeb" writes: : > : : > : > To avoid hardcoding further kernel configuration names for : > : > make universe, split the logic into two parts: : > : > - 1st to build worlds and generate kernel configs like LINT. : > : > - 2nd to build kernels for a given TARGET architecture correctly : > : > finding all newly generated configs, not knowing anything about : > : > LINT anymore. (*) : > : : > : > +universe_kernels: universe_kernconfs : > : > +BUILD_ARCH!= uname -p : > : : > : Should this be "uname -m"? : > : : > : : > : > +TARGET?= ${BUILD_ARCH} : > : > +KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ : > : > + find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ : > : > + ! -name DEFAULTS ! -name NOTES : > : > Yes. Also, the name BUILD_ARCH is misleading, since it corresponds to : > MACHINE, not to MACHINE_ARCH. it is clear that it is used in the : > MACHINE context, not the MACHINE_ARCH context. : > : > These two are often confused, but many of the embedded platforms have : > added to the confusion and it is unclear where the sharp dividing line : > should be here anymore. It used to be separate boot environment, but : > even that has gotten fuzzy for architectures like mips and arm that : > boot with a huge variety of boot loaders... : : I guess the intial problem I had it from was introduced in r54311 to : Makefile.inc1, which nowadays reads like: : : BUILD_ARCH!= uname -p : : : So, the suggested correction would be: : : MACHINE!= uname -m : : I wonder if I should use XMACHINE but that usually means : "cross"(building). I could use _MACHINE!= to not confuse it with : MACHINE from Makefile.inc1? XMACHINE might be best. MACHINE and MACHINE_ARCH are really magic and special and shouldn't ever be set (well, almost never). Warner From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:15:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DFD71065694; Sat, 9 Jan 2010 18:15:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D5528FC14; Sat, 9 Jan 2010 18:15:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IFTH7077338; Sat, 9 Jan 2010 18:15:29 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IFTgr077336; Sat, 9 Jan 2010 18:15:29 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091815.o09IFTgr077336@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201914 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:15:29 -0000 Author: imp Date: Sat Jan 9 18:15:28 2010 New Revision: 201914 URL: http://svn.freebsd.org/changeset/base/201914 Log: Merge from projects/mips to head by hand: Copy over the OCTEON1 kernel config file. This is the 64-bit version. Added: - copied unchanged from r201913, projects/mips/sys/mips/conf/OCTEON1 Directory Properties: head/sys/mips/conf/OCTEON1 (props changed) Copied: head/sys/mips/conf/OCTEON1 (from r201913, projects/mips/sys/mips/conf/OCTEON1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/OCTEON1 Sat Jan 9 18:15:28 2010 (r201914, copy of r201913, projects/mips/sys/mips/conf/OCTEON1) @@ -0,0 +1,90 @@ +# OCTEON1 -- Configuration kernel for all Octeon1 SoCs from Cavium Networks +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident OCTEON1 + +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.64 + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN=defined +makeoptions TARGET_64BIT=defined +makeoptions KERNLOADADDR=0xffffffff80100000 + +options KERNVIRTADDR=0xffffffff80100000 +include "../octeon1/std.octeon1" + +hints "OCTEON1.hints" #Default places to look for devices. + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +#XXXimp: Need to make work with 64-bit too +options ISA_MIPS64 + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +#options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions +#options ROOTDEVNAME=\"ufs:ad0s1a\" # Original +options NO_SWAPPING + + +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories + + +# Debugging for use in -current +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +#XXXimp device genclock +device loop +device ether +device md +device uart +nodevice uart_ns8250 +device rgmii +#options VERBOSE_SYSINIT + + +# +# Use the following for Compact Flash file-system +device cf +options ROOTDEVNAME = \"ufs:cf0s2\" # Unmask if compact flash is needed as RFS + +# +# Use the following for RFS in mem-device +#options MD_ROOT +#options ROOTDEVNAME = \"ufs:md0\" + +#options MD_ROOT_SIZE = 21264 +#XXX: Bring up UP first, then generalize. +#options SMP From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:17:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC712106566C; Sat, 9 Jan 2010 18:17:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B6138FC08; Sat, 9 Jan 2010 18:17:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IHdXa077871; Sat, 9 Jan 2010 18:17:39 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IHdW4077870; Sat, 9 Jan 2010 18:17:39 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091817.o09IHdW4077870@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201915 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:17:39 -0000 Author: imp Date: Sat Jan 9 18:17:39 2010 New Revision: 201915 URL: http://svn.freebsd.org/changeset/base/201915 Log: Merge from projects/mips to head by hand: Copy over XLR kernel config file. Added: - copied unchanged from r201914, projects/mips/sys/mips/conf/XLR Directory Properties: head/sys/mips/conf/XLR (props changed) Copied: head/sys/mips/conf/XLR (from r201914, projects/mips/sys/mips/conf/XLR) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/XLR Sat Jan 9 18:17:39 2010 (r201915, copy of r201914, projects/mips/sys/mips/conf/XLR) @@ -0,0 +1,160 @@ +#################################RMI_BSD##################################### +# Copyright (c) 2003-2009 RMI Corporation +# 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. +# 3. Neither the name of RMI Corporation, nor the names of its contributors, +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# 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. +#################################RMI_BSD##################################### +# XLR -- Generic kernel configuration file for FreeBSD/mips +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +machine mips +cpu CPU_MIPS4KC +ident XLR + +makeoptions MODULES_OVERRIDE="" +makeoptions TARGET_BIG_ENDIAN +# + +options KERNVIRTADDR=0x80100000 +include "../rmi/std.xlr" + + +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +#profile 2 + +#options SCHED_ULE # ULE scheduler +#options VERBOSE_SYSINIT +options SCHED_4BSD # 4BSD scheduler +#options PREEMPTION # Enable kernel thread preemption +#options FULL_PREEMPTION # Enable kernel thread preemption +options INET # InterNETworking +options INET6 # IPv6 communications protocols +options FFS # Berkeley Fast Filesystem +#options SOFTUPDATES # Enable FFS soft updates support +options UFS_ACL # Support for access control lists +options UFS_DIRHASH # Improve performance on big directories +options NFSCLIENT +options NFS_ROOT +# +options BOOTP +options BOOTP_NFSROOT +options BOOTP_NFSV3 +options BOOTP_WIRED_TO=rge0 +options BOOTP_COMPAT +options ROOTDEVNAME=\"nfs:10.1.1.15:/extra/nfsroot\" +# +#options MD_ROOT # MD is a potential root device +#options MD_ROOT_SIZE=21264 +#options MD_ROOT_SIZE=5120 +#options ROOTDEVNAME=\"ufs:md0\" +options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions +options HZ=1000 +options PHYS_ADDR_64BIT +options NO_SWAPPING + +#Debugging options +options KTRACE # ktrace(1) support +options DDB +options KDB +options GDB +options ALT_BREAK_TO_DEBUGGER +#options INVARIANTS #Enable calls of extra sanity checking +#options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +#options KTR # ktr(4) and ktrdump(8) support +#options KTR_COMPILE=(KTR_LOCK|KTR_PROC|KTR_INTR|KTR_CALLOUT|KTR_UMA|KTR_SYSC|KTR_CRITICAL) +#options KTR_ENTRIES=131072 +#options MUTEX_DEBUG +#options MUTEX_PROFILING + +device pci +#device ata +#device atadisk +#options XLR_PERFMON # Enable XLR processor activity monitoring + +#device genclock +device uart + +# Pseudo +device loop +device random +device md +device mem +device pty +device bpf + +# Network +device miibus +device rge +device ether +device re +device msk + +device da +device scbus +#device ohci # OHCI PCI->USB interface +device ehci # EHCI PCI->USB interface (USB 2.0) +device usb # USB Bus (required) +#device udbp # USB Double Bulk Pipe devices +#device ugen # Generic +#device uhid # "Human Interface Devices" +device umass # Disks/Mass storage - Requires scbus and da + +#device cfi + +#i2c +# Not yet +#device ic +#device iic +#device iicbb +#device iicbus +#device xlr_rtc +#device xlr_temperature +#device xlr_eeprom + +#crypto +# Not yet +#device cryptodev +#device crypto +#device rmisec +options ISA_MIPS32 +makeoptions KERNLOADADDR=0x80100000 From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:19:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF1A2106566C; Sat, 9 Jan 2010 18:19:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6DE8FC13; Sat, 9 Jan 2010 18:19:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09IJVlC078303; Sat, 9 Jan 2010 18:19:31 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IJVRw078301; Sat, 9 Jan 2010 18:19:31 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091819.o09IJVRw078301@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201916 - head/sys/mips/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:19:32 -0000 Author: imp Date: Sat Jan 9 18:19:31 2010 New Revision: 201916 URL: http://svn.freebsd.org/changeset/base/201916 Log: Merge from projects/mips to head by hand: Copy over MALTA64, the 64-bit varianat of the malta board... Added: - copied unchanged from r201915, projects/mips/sys/mips/conf/MALTA64 Directory Properties: head/sys/mips/conf/MALTA64 (props changed) Copied: head/sys/mips/conf/MALTA64 (from r201915, projects/mips/sys/mips/conf/MALTA64) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/conf/MALTA64 Sat Jan 9 18:19:31 2010 (r201916, copy of r201915, projects/mips/sys/mips/conf/MALTA64) @@ -0,0 +1,72 @@ +# MALTA -- Kernel config for MALTA boards +# +# For more information on this file, please read the handbook section on +# Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD: projects/mips/sys/mips/conf/MALTA 192819 2009-05-26 17:01:12Z gonzo $ + +ident MALTA + +makeoptions ARCH_FLAGS="-march=mips64 -mabi=64" +makeoptions MIPS_LITTLE_ENDIAN=defined +makeoptions TARGET_64BIT=t +makeoptions LDSCRIPT_NAME= ldscript.mips.mips64 + +options YAMON + +# Don't build any modules yet. +makeoptions MODULES_OVERRIDE="" + +options KERNVIRTADDR=0x80100000 +options TICK_USE_YAMON_FREQ=defined +#options TICK_USE_MALTA_RTC=defined + +include "../malta/std.malta" + +options ISA_MIPS64 + +hints "MALTA.hints" #Default places to look for devices. + +makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols + +options DDB +options KDB + +options SCHED_4BSD #4BSD scheduler +options INET #InterNETworking +options NFSCLIENT #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options PSEUDOFS #Pseudo-filesystem framework +options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions + +options FFS #Berkeley Fast Filesystem +options SOFTUPDATES #Enable FFS soft updates support +options UFS_ACL #Support for access control lists +options UFS_DIRHASH #Improve performance on big directories +options ROOTDEVNAME=\"ufs:ad0s1a\" + + +# Debugging for use in -current +options INVARIANTS #Enable calls of extra sanity checking +options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS +#options WITNESS #Enable checks to detect deadlocks and cycles +#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed + +device loop +device ether +device le +device miibus +device md +device uart From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:29:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78E6B1065679; Sat, 9 Jan 2010 18:29:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8538FC12; Sat, 9 Jan 2010 18:29:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09ITZ4L080589; Sat, 9 Jan 2010 18:29:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09ITZ6l080588; Sat, 9 Jan 2010 18:29:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091829.o09ITZ6l080588@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201917 - head/sys/mips/rmi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:29:35 -0000 Author: imp Date: Sat Jan 9 18:29:35 2010 New Revision: 201917 URL: http://svn.freebsd.org/changeset/base/201917 Log: Merge from projects/mips to head by hand: Copy over the support files (except sys/conf and sys/mips/conf) for RMI XLR processor support. This port has been contributed by RMI and brought up to date by Randal Stewart (rrs@). This port is a work in progress, and there might still be significant changes. The port makes it to multi-user, but is still early beta. Added: - copied from r201916, projects/mips/sys/mips/rmi/ Directory Properties: head/sys/mips/rmi/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:51:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5BF8106566B; Sat, 9 Jan 2010 18:51:50 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A53088FC13; Sat, 9 Jan 2010 18:51:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Ipog8085467; Sat, 9 Jan 2010 18:51:50 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09IpoHu085465; Sat, 9 Jan 2010 18:51:50 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091851.o09IpoHu085465@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 18:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201918 - head/kerberos5/usr.bin/kdestroy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:51:50 -0000 Author: antoine Date: Sat Jan 9 18:51:50 2010 New Revision: 201918 URL: http://svn.freebsd.org/changeset/base/201918 Log: Fix a typo. MFC after: 1 month Modified: head/kerberos5/usr.bin/kdestroy/Makefile Modified: head/kerberos5/usr.bin/kdestroy/Makefile ============================================================================== --- head/kerberos5/usr.bin/kdestroy/Makefile Sat Jan 9 18:29:35 2010 (r201917) +++ head/kerberos5/usr.bin/kdestroy/Makefile Sat Jan 9 18:51:50 2010 (r201918) @@ -2,7 +2,7 @@ PROG= kdestroy CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509) ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKAFS5} ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkafs5 -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:53:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E73B71065672; Sat, 9 Jan 2010 18:53:03 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D69F88FC08; Sat, 9 Jan 2010 18:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Ir3V0085763; Sat, 9 Jan 2010 18:53:03 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Ir3Hx085761; Sat, 9 Jan 2010 18:53:03 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091853.o09Ir3Hx085761@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 18:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201919 - head/kerberos5/usr.bin/kpasswd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:53:04 -0000 Author: antoine Date: Sat Jan 9 18:53:03 2010 New Revision: 201919 URL: http://svn.freebsd.org/changeset/base/201919 Log: Fix a typo. MFC after: 1 month Modified: head/kerberos5/usr.bin/kpasswd/Makefile Modified: head/kerberos5/usr.bin/kpasswd/Makefile ============================================================================== --- head/kerberos5/usr.bin/kpasswd/Makefile Sat Jan 9 18:51:50 2010 (r201918) +++ head/kerberos5/usr.bin/kpasswd/Makefile Sat Jan 9 18:53:03 2010 (r201919) @@ -2,7 +2,7 @@ PROG= kpasswd CFLAGS+=-I${KRB5DIR}/lib/roken -DPADD= ${LIBKRB5} ${LIBHX509 ${LIBROKEN} ${LIBVERS} \ +DPADD= ${LIBKRB5} ${LIBHX509} ${LIBROKEN} ${LIBVERS} \ ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} LDADD= -lkrb5 -lhx509 -lroken ${LIBVERS} \ -lasn1 -lcrypto -lcrypt -lcom_err From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:55:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F07D8106568F; Sat, 9 Jan 2010 18:55:29 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E02F58FC16; Sat, 9 Jan 2010 18:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09ItT9H086343; Sat, 9 Jan 2010 18:55:29 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09ItTh1086341; Sat, 9 Jan 2010 18:55:29 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091855.o09ItTh1086341@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 18:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201920 - head/share/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:55:30 -0000 Author: antoine Date: Sat Jan 9 18:55:29 2010 New Revision: 201920 URL: http://svn.freebsd.org/changeset/base/201920 Log: libusb20 was renamed libusb several months ago. MFC after: 1 month Modified: head/share/mk/bsd.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Sat Jan 9 18:53:03 2010 (r201919) +++ head/share/mk/bsd.libnames.mk Sat Jan 9 18:55:29 2010 (r201920) @@ -150,7 +150,7 @@ LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a -LIBUSB20?= ${DESTDIR}${LIBDIR}/libusb20.a +LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:59:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622831065672; Sat, 9 Jan 2010 18:59:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5215E8FC0C; Sat, 9 Jan 2010 18:59:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Ix3sg087174; Sat, 9 Jan 2010 18:59:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Ix3dm087173; Sat, 9 Jan 2010 18:59:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201001091859.o09Ix3dm087173@svn.freebsd.org> From: Warner Losh Date: Sat, 9 Jan 2010 18:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201921 - head/sys/mips/cavium X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:59:03 -0000 Author: imp Date: Sat Jan 9 18:59:03 2010 New Revision: 201921 URL: http://svn.freebsd.org/changeset/base/201921 Log: Merge from projects/mips to head by hand: Copy the support files for the Octeon 1 CPU from sys/mips/octeon1 on the projects/mips side to sys/mips/cavium on the head side to conform to the other vendor code. This code was contributed by Cavium to the project and forward ported by Warner Losh, with some additional code from Randal Stewart. # I'll fix the building problems the move creates in a future commit. Added: - copied from r201919, projects/mips/sys/mips/octeon1/ Directory Properties: head/sys/mips/cavium/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 18:59:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71051065676; Sat, 9 Jan 2010 18:59:03 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A70278FC14; Sat, 9 Jan 2010 18:59:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Ix3if087189; Sat, 9 Jan 2010 18:59:03 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Ix31D087187; Sat, 9 Jan 2010 18:59:03 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091859.o09Ix31D087187@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 18:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201922 - head/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 18:59:03 -0000 Author: antoine Date: Sat Jan 9 18:59:03 2010 New Revision: 201922 URL: http://svn.freebsd.org/changeset/base/201922 Log: Add missing library dependency. MFC after: 1 month Modified: head/usr.sbin/usbconfig/Makefile Modified: head/usr.sbin/usbconfig/Makefile ============================================================================== --- head/usr.sbin/usbconfig/Makefile Sat Jan 9 18:59:03 2010 (r201921) +++ head/usr.sbin/usbconfig/Makefile Sat Jan 9 18:59:03 2010 (r201922) @@ -4,6 +4,7 @@ PROG= usbconfig MAN= usbconfig.8 SRCS= usbconfig.c dump.c +DPADD+= ${LIBUSB} LDADD+= -lusb .include From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:02:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6B9A1065670; Sat, 9 Jan 2010 19:02:33 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C64F18FC17; Sat, 9 Jan 2010 19:02:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09J2Xn1088002; Sat, 9 Jan 2010 19:02:33 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09J2Xfh088000; Sat, 9 Jan 2010 19:02:33 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091902.o09J2Xfh088000@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201923 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:02:33 -0000 Author: antoine Date: Sat Jan 9 19:02:33 2010 New Revision: 201923 URL: http://svn.freebsd.org/changeset/base/201923 Log: Add files to remove when MK_ACCT=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 18:59:03 2010 (r201922) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:02:33 2010 (r201923) @@ -5,6 +5,17 @@ # the check-old and delete-old* targets. # +.if ${MK_ACCT} == no +OLD_FILES+=etc/periodic/daily/310.accounting +OLD_FILES+=etc/periodic/monthly/200.accounting +OLD_FILES+=usr/sbin/ac +OLD_FILES+=usr/sbin/accton +OLD_FILES+=usr/sbin/sa +OLD_FILES+=usr/share/man/man8/ac.8.gz +OLD_FILES+=usr/share/man/man8/accton.8.gz +OLD_FILES+=usr/share/man/man8/sa.8.gz +.endif + .if ${MK_ACPI} == no OLD_FILES+=usr/sbin/acpiconf OLD_FILES+=usr/sbin/acpidb From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:03:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483D9106566C; Sat, 9 Jan 2010 19:03:49 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 384A88FC17; Sat, 9 Jan 2010 19:03:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09J3nPI088306; Sat, 9 Jan 2010 19:03:49 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09J3ngu088304; Sat, 9 Jan 2010 19:03:49 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201001091903.o09J3ngu088304@svn.freebsd.org> From: Max Khon Date: Sat, 9 Jan 2010 19:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201924 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:03:49 -0000 Author: fjoe Date: Sat Jan 9 19:03:48 2010 New Revision: 201924 URL: http://svn.freebsd.org/changeset/base/201924 Log: Send link state change control messages to "orphans" hook as well. MFC after: 1 week Modified: head/sys/netgraph/ng_ether.c Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Sat Jan 9 19:02:33 2010 (r201923) +++ head/sys/netgraph/ng_ether.c Sat Jan 9 19:03:48 2010 (r201924) @@ -359,9 +359,6 @@ ng_ether_link_state(struct ifnet *ifp, i struct ng_mesg *msg; int cmd, dummy_error = 0; - if (priv->lower == NULL) - return; - if (state == LINK_STATE_UP) cmd = NGM_LINK_IS_UP; else if (state == LINK_STATE_DOWN) @@ -369,9 +366,16 @@ ng_ether_link_state(struct ifnet *ifp, i else return; - NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); - if (msg != NULL) - NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0); + if (priv->lower != NULL) { + NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); + if (msg != NULL) + NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->lower, 0); + } + if (priv->orphan != NULL) { + NG_MKMESSAGE(msg, NGM_FLOW_COOKIE, cmd, 0, M_NOWAIT); + if (msg != NULL) + NG_SEND_MSG_HOOK(dummy_error, node, msg, priv->orphan, 0); + } } /****************************************************************** From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:04:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790A61065697; Sat, 9 Jan 2010 19:04:38 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68B468FC0C; Sat, 9 Jan 2010 19:04:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09J4cTM088534; Sat, 9 Jan 2010 19:04:38 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09J4cb0088532; Sat, 9 Jan 2010 19:04:38 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091904.o09J4cb0088532@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201925 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:04:38 -0000 Author: antoine Date: Sat Jan 9 19:04:38 2010 New Revision: 201925 URL: http://svn.freebsd.org/changeset/base/201925 Log: Add files to remove when MK_AMD=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:03:48 2010 (r201924) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:04:38 2010 (r201925) @@ -27,6 +27,29 @@ OLD_FILES+=usr/share/man/man8/acpidump.8 OLD_FILES+=usr/share/man/man8/iasl.8.gz .endif +.if ${MK_AMD} == no +OLD_FILES+=etc/amd.map +OLD_FILES+=usr/bin/pawd +OLD_FILES+=usr/sbin/amd +OLD_FILES+=usr/sbin/amq +OLD_FILES+=usr/sbin/fixmount +OLD_FILES+=usr/sbin/fsinfo +OLD_FILES+=usr/sbin/hlfsd +OLD_FILES+=usr/sbin/mk-amd-map +OLD_FILES+=usr/sbin/wire-test +OLD_FILES+=usr/share/examples/etc/amd.map +OLD_FILES+=usr/share/info/am-utils.info.gz +OLD_FILES+=usr/share/man/man1/pawd.1.gz +OLD_FILES+=usr/share/man/man5/amd.conf.5.gz +OLD_FILES+=usr/share/man/man8/amd.8.gz +OLD_FILES+=usr/share/man/man8/amq.8.gz +OLD_FILES+=usr/share/man/man8/fixmount.8.gz +OLD_FILES+=usr/share/man/man8/fsinfo.8.gz +OLD_FILES+=usr/share/man/man8/hlfsd.8.gz +OLD_FILES+=usr/share/man/man8/mk-amd-map.8.gz +OLD_FILES+=usr/share/man/man8/wire-test.8.gz +.endif + #.if ${MK_ATM} == no # to be filled in #.endif From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:07:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12E9A1065670; Sat, 9 Jan 2010 19:07:05 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D268FC16; Sat, 9 Jan 2010 19:07:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09J74MI089111; Sat, 9 Jan 2010 19:07:04 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09J74gs089109; Sat, 9 Jan 2010 19:07:04 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091907.o09J74gs089109@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201926 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:07:05 -0000 Author: antoine Date: Sat Jan 9 19:07:04 2010 New Revision: 201926 URL: http://svn.freebsd.org/changeset/base/201926 Log: Add files to remove when MK_APM=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:04:38 2010 (r201925) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:07:04 2010 (r201926) @@ -50,6 +50,14 @@ OLD_FILES+=usr/share/man/man8/mk-amd-map OLD_FILES+=usr/share/man/man8/wire-test.8.gz .endif +.if ${MK_APM} == no +OLD_FILES+=etc/apmd.conf +OLD_FILES+=usr/sbin/apm +OLD_FILES+=usr/share/examples/etc/apmd.conf +OLD_FILES+=usr/share/man/man8/amd64/apm.8.gz +OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz +.endif + #.if ${MK_ATM} == no # to be filled in #.endif From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:09:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C03C106566B; Sat, 9 Jan 2010 19:09:16 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B85A8FC0C; Sat, 9 Jan 2010 19:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09J9GsR089636; Sat, 9 Jan 2010 19:09:16 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09J9GYt089634; Sat, 9 Jan 2010 19:09:16 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091909.o09J9GYt089634@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201927 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:09:16 -0000 Author: antoine Date: Sat Jan 9 19:09:16 2010 New Revision: 201927 URL: http://svn.freebsd.org/changeset/base/201927 Log: Add files to remove when MK_AT=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:07:04 2010 (r201926) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:09:16 2010 (r201927) @@ -58,6 +58,19 @@ OLD_FILES+=usr/share/man/man8/amd64/apm. OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz .endif +.if ${MK_AT} == no +OLD_FILES+=usr/bin/at +OLD_FILES+=usr/bin/atq +OLD_FILES+=usr/bin/atrm +OLD_FILES+=usr/bin/batch +OLD_FILES+=usr/libexec/atrun +OLD_FILES+=usr/share/man/man1/at.1.gz +OLD_FILES+=usr/share/man/man1/atq.1.gz +OLD_FILES+=usr/share/man/man1/atrm.1.gz +OLD_FILES+=usr/share/man/man1/batch.1.gz +OLD_FILES+=usr/share/man/man8/atrun.8.gz +.endif + #.if ${MK_ATM} == no # to be filled in #.endif From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:12:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5606A106566C; Sat, 9 Jan 2010 19:12:33 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 457308FC14; Sat, 9 Jan 2010 19:12:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09JCXFH090390; Sat, 9 Jan 2010 19:12:33 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09JCXr2090388; Sat, 9 Jan 2010 19:12:33 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091912.o09JCXr2090388@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201928 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:12:33 -0000 Author: antoine Date: Sat Jan 9 19:12:33 2010 New Revision: 201928 URL: http://svn.freebsd.org/changeset/base/201928 Log: Add files to remove when MK_ATM=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:09:16 2010 (r201927) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:12:33 2010 (r201928) @@ -71,9 +71,58 @@ OLD_FILES+=usr/share/man/man1/batch.1.gz OLD_FILES+=usr/share/man/man8/atrun.8.gz .endif -#.if ${MK_ATM} == no -# to be filled in -#.endif +.if ${MK_ATM} == no +OLD_FILES+=rescue/atmconfig +OLD_FILES+=sbin/atmconfig +OLD_FILES+=usr/bin/sscop +OLD_FILES+=usr/include/bsnmp/snmp_atm.h +OLD_FILES+=usr/include/netnatm/addr.h +OLD_FILES+=usr/include/netnatm/api/atmapi.h +OLD_FILES+=usr/include/netnatm/api/ccatm.h +OLD_FILES+=usr/include/netnatm/api/unisap.h +OLD_FILES+=usr/include/netnatm/msg/uni_config.h +OLD_FILES+=usr/include/netnatm/msg/uni_hdr.h +OLD_FILES+=usr/include/netnatm/msg/uni_ie.h +OLD_FILES+=usr/include/netnatm/msg/uni_msg.h +OLD_FILES+=usr/include/netnatm/msg/unimsglib.h +OLD_FILES+=usr/include/netnatm/msg/uniprint.h +OLD_FILES+=usr/include/netnatm/msg/unistruct.h +OLD_FILES+=usr/include/netnatm/saal/sscfu.h +OLD_FILES+=usr/include/netnatm/saal/sscfudef.h +OLD_FILES+=usr/include/netnatm/saal/sscop.h +OLD_FILES+=usr/include/netnatm/saal/sscopdef.h +OLD_FILES+=usr/include/netnatm/sig/uni.h +OLD_FILES+=usr/include/netnatm/sig/unidef.h +OLD_FILES+=usr/include/netnatm/sig/unisig.h +OLD_FILES+=usr/include/netnatm/unimsg.h +OLD_FILES+=usr/lib/libngatm.a +OLD_FILES+=usr/lib/libngatm.so +OLD_LIBS+=usr/lib/libngatm.so.4 +OLD_FILES+=usr/lib/libngatm_p.a +OLD_FILES+=usr/lib/snmp_atm.so +OLD_LIBS+=usr/lib/snmp_atm.so.6 +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib32/libngatm.a +OLD_FILES+=usr/lib32/libngatm.so +OLD_LIBS+=usr/lib32/libngatm.so.4 +OLD_FILES+=usr/lib32/libngatm_p.a +.endif +OLD_FILES+=usr/share/doc/atm/atmconfig.help +OLD_FILES+=usr/share/doc/atm/atmconfig_device.help +OLD_FILES+=usr/share/man/man1/sscop.1.gz +OLD_FILES+=usr/share/man/man3/libngatm.3.gz +OLD_FILES+=usr/share/man/man3/snmp_atm.3.gz +OLD_FILES+=usr/share/man/man3/uniaddr.3.gz +OLD_FILES+=usr/share/man/man3/unifunc.3.gz +OLD_FILES+=usr/share/man/man3/unimsg.3.gz +OLD_FILES+=usr/share/man/man3/unisap.3.gz +OLD_FILES+=usr/share/man/man3/unistruct.3.gz +OLD_FILES+=usr/share/man/man8/atmconfig.8.gz +OLD_FILES+=usr/share/snmp/defs/atm_freebsd.def +OLD_FILES+=usr/share/snmp/defs/atm_tree.def +OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-ATM-FREEBSD-MIB.txt +OLD_FILES+=usr/share/snmp/mibs/BEGEMOT-ATM.txt +.endif .if ${MK_AUDIT} == no OLD_FILES+=usr/sbin/audit From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:13:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01F51065700; Sat, 9 Jan 2010 19:13:56 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFE058FC16; Sat, 9 Jan 2010 19:13:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09JDuYI090754; Sat, 9 Jan 2010 19:13:56 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09JDueE090752; Sat, 9 Jan 2010 19:13:56 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091913.o09JDueE090752@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201929 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:13:56 -0000 Author: antoine Date: Sat Jan 9 19:13:56 2010 New Revision: 201929 URL: http://svn.freebsd.org/changeset/base/201929 Log: Add files to remove when MK_AUTHPF=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:12:33 2010 (r201928) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:13:56 2010 (r201929) @@ -135,9 +135,10 @@ OLD_FILES+=usr/share/man/man8/audit.8.gz OLD_FILES+=usr/share/man/man8/auditd.8.gz .endif -#.if ${MK_AUTHPF} == no -# to be filled in -#.endif +.if ${MK_AUTHPF} == no +OLD_FILES+=usr/sbin/authpf +OLD_FILES+=usr/share/man/man8/authpf.8.gz +.endif .if ${MK_BIND} == no OLD_FILES+=usr/bin/dig From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:16:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C9451065672; Sat, 9 Jan 2010 19:16:28 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CF838FC16; Sat, 9 Jan 2010 19:16:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09JGSjA091327; Sat, 9 Jan 2010 19:16:28 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09JGRwd091325; Sat, 9 Jan 2010 19:16:27 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201001091916.o09JGRwd091325@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 9 Jan 2010 19:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201930 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:16:28 -0000 Author: ume Date: Sat Jan 9 19:16:27 2010 New Revision: 201930 URL: http://svn.freebsd.org/changeset/base/201930 Log: The client type rule allows DHCP, implicitly. Since DHCPv6 uses link-local address unlike with DHCP, we need one more rule to allow the DHCPv6. Reported by: David Horn Modified: head/etc/rc.firewall Modified: head/etc/rc.firewall ============================================================================== --- head/etc/rc.firewall Sat Jan 9 19:13:56 2010 (r201929) +++ head/etc/rc.firewall Sat Jan 9 19:16:27 2010 (r201930) @@ -220,6 +220,8 @@ case ${firewall_type} in # Allow any link-local multicast traffic ${fwcmd} add pass all from fe80::/10 to ff02::/16 ${fwcmd} add pass all from ${net6} to ff02::/16 + # Allow DHCPv6 + ${fwcmd} add pass udp from fe80::/10 to me6 546 fi # Allow TCP through if setup succeeded From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 19:52:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9416A106566B; Sat, 9 Jan 2010 19:52:42 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B2D8FC0C; Sat, 9 Jan 2010 19:52:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09JqgXe099347; Sat, 9 Jan 2010 19:52:42 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Jqgvu099345; Sat, 9 Jan 2010 19:52:42 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201001091952.o09Jqgvu099345@svn.freebsd.org> From: Antoine Brodin Date: Sat, 9 Jan 2010 19:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201931 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 19:52:42 -0000 Author: antoine Date: Sat Jan 9 19:52:42 2010 New Revision: 201931 URL: http://svn.freebsd.org/changeset/base/201931 Log: Update files to remove when MK_BLUETOOTH=no. Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:16:27 2010 (r201930) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Jan 9 19:52:42 2010 (r201931) @@ -338,33 +338,50 @@ OLD_DIRS+=var/named/etc/namedb/dynamic #.endif .if ${MK_BLUETOOTH} == no +OLD_FILES+=etc/bluetooth/hcsecd.conf +OLD_FILES+=etc/bluetooth/hosts +OLD_FILES+=etc/bluetooth/protocols OLD_FILES+=usr/bin/bthost OLD_FILES+=usr/bin/btsockstat OLD_FILES+=usr/bin/rfcomm_sppd +OLD_FILES+=usr/include/bluetooth.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_bluetooth.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_bt3c.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_btsocket.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_btsocket_hci_raw.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_btsocket_l2cap.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_btsocket_rfcomm.h +OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_btsocket_sco.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_h4.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_hci.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_l2cap.h OLD_FILES+=usr/include/netgraph/bluetooth/include/ng_ubt.h OLD_DIRS+=usr/include/netgraph/bluetooth/include OLD_DIRS+=usr/include/netgraph/bluetooth -OLD_FILES+=usr/include/bluetooth.h OLD_FILES+=usr/include/sdp.h OLD_FILES+=usr/lib/libbluetooth.a -OLD_FILES+=usr/lib/libbluetooth_p.a -OLD_LIBS+=usr/lib/libbluetooth.so.2 OLD_FILES+=usr/lib/libbluetooth.so +OLD_LIBS+=usr/lib/libbluetooth.so.4 +OLD_FILES+=usr/lib/libbluetooth_p.a OLD_FILES+=usr/lib/libsdp.a -OLD_FILES+=usr/lib/libsdp_p.a -OLD_LIBS+=usr/lib/libsdp.so.2 OLD_FILES+=usr/lib/libsdp.so +OLD_LIBS+=usr/lib/libsdp.so.4 +OLD_FILES+=usr/lib/libsdp_p.a +.if ${TARGET_ARCH} == "amd64" +OLD_FILES+=usr/lib32/libbluetooth.a +OLD_FILES+=usr/lib32/libbluetooth.so +OLD_LIBS+=usr/lib32/libbluetooth.so.4 +OLD_FILES+=usr/lib32/libbluetooth_p.a +OLD_FILES+=usr/lib32/libsdp.a +OLD_FILES+=usr/lib32/libsdp.so +OLD_LIBS+=usr/lib32/libsdp.so.4 +OLD_FILES+=usr/lib32/libsdp_p.a +.endif OLD_FILES+=usr/sbin/bcmfw OLD_FILES+=usr/sbin/bt3cfw +OLD_FILES+=usr/sbin/bthidcontrol +OLD_FILES+=usr/sbin/bthidd +OLD_FILES+=usr/sbin/btpand OLD_FILES+=usr/sbin/hccontrol OLD_FILES+=usr/sbin/hcsecd OLD_FILES+=usr/sbin/hcseriald @@ -376,45 +393,67 @@ OLD_FILES+=usr/sbin/sdpd OLD_FILES+=usr/share/man/man1/bthost.1.gz OLD_FILES+=usr/share/man/man1/btsockstat.1.gz OLD_FILES+=usr/share/man/man1/rfcomm_sppd.1.gz +OLD_FILES+=usr/share/man/man3/SDP_GET128.3.gz +OLD_FILES+=usr/share/man/man3/SDP_GET16.3.gz +OLD_FILES+=usr/share/man/man3/SDP_GET32.3.gz +OLD_FILES+=usr/share/man/man3/SDP_GET64.3.gz +OLD_FILES+=usr/share/man/man3/SDP_GET8.3.gz +OLD_FILES+=usr/share/man/man3/SDP_PUT128.3.gz +OLD_FILES+=usr/share/man/man3/SDP_PUT16.3.gz +OLD_FILES+=usr/share/man/man3/SDP_PUT32.3.gz +OLD_FILES+=usr/share/man/man3/SDP_PUT64.3.gz +OLD_FILES+=usr/share/man/man3/SDP_PUT8.3.gz +OLD_FILES+=usr/share/man/man3/bdaddr_any.3.gz +OLD_FILES+=usr/share/man/man3/bdaddr_copy.3.gz +OLD_FILES+=usr/share/man/man3/bdaddr_same.3.gz OLD_FILES+=usr/share/man/man3/bluetooth.3.gz -OLD_FILES+=usr/share/man/man3/bt_gethostbyname.3.gz +OLD_FILES+=usr/share/man/man3/bt_aton.3.gz +OLD_FILES+=usr/share/man/man3/bt_devaddr.3.gz +OLD_FILES+=usr/share/man/man3/bt_devclose.3.gz +OLD_FILES+=usr/share/man/man3/bt_devenum.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_evt_clr.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_evt_set.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_evt_tst.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_pkt_clr.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_pkt_set.3.gz +OLD_FILES+=usr/share/man/man3/bt_devfilter_pkt_tst.3.gz +OLD_FILES+=usr/share/man/man3/bt_devinfo.3.gz +OLD_FILES+=usr/share/man/man3/bt_devinquiry.3.gz +OLD_FILES+=usr/share/man/man3/bt_devname.3.gz +OLD_FILES+=usr/share/man/man3/bt_devopen.3.gz +OLD_FILES+=usr/share/man/man3/bt_devreq.3.gz +OLD_FILES+=usr/share/man/man3/bt_devsend.3.gz +OLD_FILES+=usr/share/man/man3/bt_endhostent.3.gz +OLD_FILES+=usr/share/man/man3/bt_endprotoent.3.gz OLD_FILES+=usr/share/man/man3/bt_gethostbyaddr.3.gz +OLD_FILES+=usr/share/man/man3/bt_gethostbyname.3.gz OLD_FILES+=usr/share/man/man3/bt_gethostent.3.gz -OLD_FILES+=usr/share/man/man3/bt_sethostent.3.gz -OLD_FILES+=usr/share/man/man3/bt_endhostent.3.gz OLD_FILES+=usr/share/man/man3/bt_getprotobyname.3.gz OLD_FILES+=usr/share/man/man3/bt_getprotobynumber.3.gz OLD_FILES+=usr/share/man/man3/bt_getprotoent.3.gz -OLD_FILES+=usr/share/man/man3/bt_setprotoent.3.gz -OLD_FILES+=usr/share/man/man3/bt_endprotoent.3.gz OLD_FILES+=usr/share/man/man3/bt_ntoa.3.gz -OLD_FILES+=usr/share/man/man3/bt_aton.3.gz +OLD_FILES+=usr/share/man/man3/bt_sethostent.3.gz +OLD_FILES+=usr/share/man/man3/bt_setprotoent.3.gz OLD_FILES+=usr/share/man/man3/sdp.3.gz -OLD_FILES+=usr/share/man/man3/SDP_GET8.3.gz -OLD_FILES+=usr/share/man/man3/SDP_GET16.3.gz -OLD_FILES+=usr/share/man/man3/SDP_GET32.3.gz -OLD_FILES+=usr/share/man/man3/SDP_GET64.3.gz -OLD_FILES+=usr/share/man/man3/SDP_GET128.3.gz -OLD_FILES+=usr/share/man/man3/SDP_PUT8.3.gz -OLD_FILES+=usr/share/man/man3/SDP_PUT16.3.gz -OLD_FILES+=usr/share/man/man3/SDP_PUT32.3.gz -OLD_FILES+=usr/share/man/man3/SDP_PUT64.3.gz -OLD_FILES+=usr/share/man/man3/SDP_PUT128.3.gz -OLD_FILES+=usr/share/man/man3/sdp_open.3.gz -OLD_FILES+=usr/share/man/man3/sdp_open_local.3.gz +OLD_FILES+=usr/share/man/man3/sdp_attr2desc.3.gz +OLD_FILES+=usr/share/man/man3/sdp_change_service.3.gz OLD_FILES+=usr/share/man/man3/sdp_close.3.gz OLD_FILES+=usr/share/man/man3/sdp_error.3.gz -OLD_FILES+=usr/share/man/man3/sdp_search.3.gz -OLD_FILES+=usr/share/man/man3/sdp_attr2desc.3.gz -OLD_FILES+=usr/share/man/man3/sdp_uuid2desc.3.gz +OLD_FILES+=usr/share/man/man3/sdp_open.3.gz +OLD_FILES+=usr/share/man/man3/sdp_open_local.3.gz OLD_FILES+=usr/share/man/man3/sdp_register_service.3.gz +OLD_FILES+=usr/share/man/man3/sdp_search.3.gz OLD_FILES+=usr/share/man/man3/sdp_unregister_service.3.gz -OLD_FILES+=usr/share/man/man3/sdp_change_service.3.gz +OLD_FILES+=usr/share/man/man3/sdp_uuid2desc.3.gz OLD_FILES+=usr/share/man/man5/hcsecd.conf.5.gz OLD_FILES+=usr/share/man/man8/bcmfw.8.gz OLD_FILES+=usr/share/man/man8/bt3cfw.8.gz -OLD_FILES+=usr/share/man/man8/hcsecd.8.gz +OLD_FILES+=usr/share/man/man8/bthidcontrol.8.gz +OLD_FILES+=usr/share/man/man8/bthidd.8.gz +OLD_FILES+=usr/share/man/man8/btpand.8.gz OLD_FILES+=usr/share/man/man8/hccontrol.8.gz +OLD_FILES+=usr/share/man/man8/hcsecd.8.gz OLD_FILES+=usr/share/man/man8/hcseriald.8.gz OLD_FILES+=usr/share/man/man8/l2control.8.gz OLD_FILES+=usr/share/man/man8/l2ping.8.gz From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 21:23:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89A8D106566C; Sat, 9 Jan 2010 21:23:39 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78BFE8FC13; Sat, 9 Jan 2010 21:23:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09LNd95019547; Sat, 9 Jan 2010 21:23:39 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09LNdt3019544; Sat, 9 Jan 2010 21:23:39 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201001092123.o09LNdt3019544@svn.freebsd.org> From: Marius Strobl Date: Sat, 9 Jan 2010 21:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201932 - in head/sys/boot: common sparc64/loader X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 21:23:39 -0000 Author: marius Date: Sat Jan 9 21:23:39 2010 New Revision: 201932 URL: http://svn.freebsd.org/changeset/base/201932 Log: - Add code allowing a network device to only be open and closed once by keeping it opened after the first open and closing it via the cleanup handler when NETIF_OPEN_CLOSE_ONCE is defined in order to avoid the open-close-dance on every file access which with firmware that for example performs an auto-negotiation on every open causes netbooting to take horribly long. Basically the behavior with this knob enabled resembles the one employed between r60506 and r177108 (and for sparc64 also again since r182919) with the addition that the network device now is closed eventually before entering the kernel and before rebooting. Actually I think this should be the desired MI behavior, however the U-Boot loader actually requires net_close() to be called after every transaction in order for some local shutdown operations to be performed (and which I think thus will break on concurrent opens, i.e. when netdev_opens is > 1, like the loader does at least for disks when LOADER_GZIP_SUPPORT is enabled). - Use NETIF_OPEN_CLOSE_ONCE to replace the hack, which artificially increased netdev_opens for sparc64 in order to keep the network device opened forever, as at least some firmware versions require the network device to be closed eventually before entering the kernel or otherwise will DMA received packets to stale memory. The powerpc OFW loader probably wants NETIF_OPEN_CLOSE_ONCE to be set as well for the same reasons. Modified: head/sys/boot/common/dev_net.c head/sys/boot/sparc64/loader/Makefile Modified: head/sys/boot/common/dev_net.c ============================================================================== --- head/sys/boot/common/dev_net.c Sat Jan 9 19:52:42 2010 (r201931) +++ head/sys/boot/common/dev_net.c Sat Jan 9 21:23:39 2010 (r201932) @@ -71,12 +71,14 @@ __FBSDID("$FreeBSD$"); int debug = 0; #endif +static char *netdev_name; static int netdev_sock = -1; static int netdev_opens; static int net_init(void); static int net_open(struct open_file *, ...); static int net_close(struct open_file *); +static void net_cleanup(void); static int net_strategy(); static void net_print(int); @@ -90,7 +92,8 @@ struct devsw netdev = { net_open, net_close, noioctl, - net_print + net_print, + net_cleanup }; static int @@ -116,6 +119,12 @@ net_open(struct open_file *f, ...) devname = va_arg(args, char*); va_end(args); +#ifdef NETIF_OPEN_CLOSE_ONCE + /* Before opening another interface, close the previous one first. */ + if (netdev_sock >= 0 && strcmp(devname, netdev_name) != 0) + net_cleanup(); +#endif + /* On first open, do netif open, mount, etc. */ if (netdev_opens == 0) { /* Find network interface. */ @@ -125,6 +134,7 @@ net_open(struct open_file *f, ...) printf("net_open: netif_open() failed\n"); return (ENXIO); } + netdev_name = strdup(devname); #ifdef NETIF_DEBUG if (debug) printf("net_open: netif_open() succeeded\n"); @@ -135,14 +145,12 @@ net_open(struct open_file *f, ...) error = net_getparams(netdev_sock); if (error) { /* getparams makes its own noise */ + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; return (error); } } -#if defined(__sparc64__) - netdev_opens++; -#endif } netdev_opens++; f->f_devdata = &netdev_sock; @@ -152,30 +160,46 @@ net_open(struct open_file *f, ...) static int net_close(struct open_file *f) { + #ifdef NETIF_DEBUG if (debug) printf("net_close: opens=%d\n", netdev_opens); #endif - /* On last close, do netif close, etc. */ f->f_devdata = NULL; + +#ifndef NETIF_OPEN_CLOSE_ONCE /* Extra close call? */ if (netdev_opens <= 0) return (0); netdev_opens--; /* Not last close? */ if (netdev_opens > 0) - return(0); - rootip.s_addr = 0; + return (0); + /* On last close, do netif close, etc. */ +#ifdef NETIF_DEBUG + if (debug) + printf("net_close: calling net_cleanup()\n"); +#endif + net_cleanup(); +#endif + return (0); +} + +static void +net_cleanup(void) +{ + if (netdev_sock >= 0) { #ifdef NETIF_DEBUG if (debug) - printf("net_close: calling netif_close()\n"); + printf("net_cleanup: calling netif_close()\n"); #endif + rootip.s_addr = 0; + free(netdev_name); netif_close(netdev_sock); netdev_sock = -1; } - return (0); } static int Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Sat Jan 9 19:52:42 2010 (r201931) +++ head/sys/boot/sparc64/loader/Makefile Sat Jan 9 21:23:39 2010 (r201932) @@ -51,11 +51,15 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE CLEANFILES+= vers.c loader.help From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:09:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62A691065670; Sat, 9 Jan 2010 22:09:10 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51F5C8FC0A; Sat, 9 Jan 2010 22:09:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09M9AF2029555; Sat, 9 Jan 2010 22:09:10 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09M9AKi029553; Sat, 9 Jan 2010 22:09:10 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201001092209.o09M9AKi029553@svn.freebsd.org> From: Alan Cox Date: Sat, 9 Jan 2010 22:09:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201934 - head/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:09:10 -0000 Author: alc Date: Sat Jan 9 22:09:10 2010 New Revision: 201934 URL: http://svn.freebsd.org/changeset/base/201934 Log: Long ago, in r120654, the rounding of KERNend and physfree in locore was changed from a small page boundary to a large page boundary. As a consequence pmap_kmem_choose() became a pointless waste of address space. Eliminate it. Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Jan 9 21:57:41 2010 (r201933) +++ head/sys/i386/i386/pmap.c Sat Jan 9 22:09:10 2010 (r201934) @@ -317,7 +317,6 @@ static int _pmap_unwire_pte_hold(pmap_t static pt_entry_t *pmap_pte_quick(pmap_t pmap, vm_offset_t va); static void pmap_pte_release(pt_entry_t *pte); static int pmap_unuse_pt(pmap_t, vm_offset_t, vm_page_t *); -static vm_offset_t pmap_kmem_choose(vm_offset_t addr); #ifdef PAE static void *pmap_pdpt_allocf(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); #endif @@ -334,24 +333,6 @@ CTASSERT(1 << PTESHIFT == sizeof(pt_entr CTASSERT(KERNBASE % (1 << 24) == 0); /* - * Move the kernel virtual free pointer to the next - * 4MB. This is used to help improve performance - * by using a large (4MB) page for much of the kernel - * (.text, .data, .bss) - */ -static vm_offset_t -pmap_kmem_choose(vm_offset_t addr) -{ - vm_offset_t newaddr = addr; - -#ifndef DISABLE_PSE - if (cpu_feature & CPUID_PSE) - newaddr = (addr + PDRMASK) & ~PDRMASK; -#endif - return newaddr; -} - -/* * Bootstrap the system enough to run with virtual memory. * * On the i386 this is called after mapping has already been enabled @@ -378,7 +359,6 @@ pmap_bootstrap(vm_paddr_t firstaddr) * in this calculation. */ virtual_avail = (vm_offset_t) KERNBASE + firstaddr; - virtual_avail = pmap_kmem_choose(virtual_avail); virtual_end = VM_MAX_KERNEL_ADDRESS; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:30:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DF6D106566B; Sat, 9 Jan 2010 22:30:36 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 440D18FC15; Sat, 9 Jan 2010 22:30:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09MUaY3034350; Sat, 9 Jan 2010 22:30:36 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09MUa1Q034348; Sat, 9 Jan 2010 22:30:36 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092230.o09MUa1Q034348@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 22:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201935 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:30:36 -0000 Author: ru Date: Sat Jan 9 22:30:34 2010 New Revision: 201935 URL: http://svn.freebsd.org/changeset/base/201935 Log: Allow commits to vendor/one-true-awk. Modified: svnadmin/conf/paths Modified: svnadmin/conf/paths ============================================================================== --- svnadmin/conf/paths Sat Jan 9 22:09:10 2010 (r201934) +++ svnadmin/conf/paths Sat Jan 9 22:30:34 2010 (r201935) @@ -71,6 +71,7 @@ ^vendor/ncurses ^vendor/netcat ^vendor/ntp +^vendor/one-true-awk ^vendor/openbsm ^vendor/openpam ^vendor/opensolaris From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:31:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A302310656A5; Sat, 9 Jan 2010 22:31:11 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5E48FC1A; Sat, 9 Jan 2010 22:31:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09MVBAf034525; Sat, 9 Jan 2010 22:31:11 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09MVBoV034520; Sat, 9 Jan 2010 22:31:11 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092231.o09MVBoV034520@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 22:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201936 - in vendor/one-true-awk: 20001115 20001115/contrib 20020101 20020101/contrib 20020210 20020210/contrib 20021129 20021129/contrib 20021213 20021213/contrib 20030314 20030314/con... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:31:11 -0000 Author: ru Date: Sat Jan 9 22:31:11 2010 New Revision: 201936 URL: http://svn.freebsd.org/changeset/base/201936 Log: Flatten out vendor tree. Added: vendor/one-true-awk/20001115/FIXES - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/FIXES vendor/one-true-awk/20001115/README - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/README vendor/one-true-awk/20001115/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/awk.1 vendor/one-true-awk/20001115/awk.h - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/awk.h vendor/one-true-awk/20001115/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20001115/b.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/b.c vendor/one-true-awk/20001115/buildwin.bat - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/buildwin.bat vendor/one-true-awk/20001115/lex.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/lex.c vendor/one-true-awk/20001115/lib.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/lib.c vendor/one-true-awk/20001115/mac.code - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/mac.code vendor/one-true-awk/20001115/main.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/main.c vendor/one-true-awk/20001115/makefile - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/makefile vendor/one-true-awk/20001115/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/maketab.c vendor/one-true-awk/20001115/parse.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/parse.c vendor/one-true-awk/20001115/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/proctab.c vendor/one-true-awk/20001115/proto.h - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/proto.h vendor/one-true-awk/20001115/run.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/run.c vendor/one-true-awk/20001115/tran.c - copied unchanged from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/tran.c vendor/one-true-awk/20020101/FIXES - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/FIXES vendor/one-true-awk/20020101/README - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/README vendor/one-true-awk/20020101/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/awk.1 vendor/one-true-awk/20020101/awk.h - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/awk.h vendor/one-true-awk/20020101/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20020101/b.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/b.c vendor/one-true-awk/20020101/lex.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/lex.c vendor/one-true-awk/20020101/lib.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/lib.c vendor/one-true-awk/20020101/mac.code - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/mac.code vendor/one-true-awk/20020101/main.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/main.c vendor/one-true-awk/20020101/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/maketab.c vendor/one-true-awk/20020101/parse.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/parse.c vendor/one-true-awk/20020101/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/proctab.c vendor/one-true-awk/20020101/proto.h - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/proto.h vendor/one-true-awk/20020101/run.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/run.c vendor/one-true-awk/20020101/tran.c - copied unchanged from r201903, vendor/one-true-awk/20020101/contrib/one-true-awk/tran.c vendor/one-true-awk/20020210/FIXES - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/FIXES vendor/one-true-awk/20020210/README - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/README vendor/one-true-awk/20020210/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/awk.1 vendor/one-true-awk/20020210/awk.h - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/awk.h vendor/one-true-awk/20020210/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20020210/b.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/b.c vendor/one-true-awk/20020210/lex.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/lex.c vendor/one-true-awk/20020210/lib.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/lib.c vendor/one-true-awk/20020210/mac.code - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/mac.code vendor/one-true-awk/20020210/main.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/main.c vendor/one-true-awk/20020210/makefile - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/makefile vendor/one-true-awk/20020210/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/maketab.c vendor/one-true-awk/20020210/parse.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/parse.c vendor/one-true-awk/20020210/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/proctab.c vendor/one-true-awk/20020210/proto.h - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/proto.h vendor/one-true-awk/20020210/run.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/run.c vendor/one-true-awk/20020210/tran.c - copied unchanged from r201903, vendor/one-true-awk/20020210/contrib/one-true-awk/tran.c vendor/one-true-awk/20021129/FIXES - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/FIXES vendor/one-true-awk/20021129/README - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/README vendor/one-true-awk/20021129/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/awk.1 vendor/one-true-awk/20021129/awk.h - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/awk.h vendor/one-true-awk/20021129/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20021129/b.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/b.c vendor/one-true-awk/20021129/lex.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/lex.c vendor/one-true-awk/20021129/lib.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/lib.c vendor/one-true-awk/20021129/mac.code - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/mac.code vendor/one-true-awk/20021129/main.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/main.c vendor/one-true-awk/20021129/makefile - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/makefile vendor/one-true-awk/20021129/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/maketab.c vendor/one-true-awk/20021129/parse.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/parse.c vendor/one-true-awk/20021129/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/proctab.c vendor/one-true-awk/20021129/proto.h - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/proto.h vendor/one-true-awk/20021129/run.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/run.c vendor/one-true-awk/20021129/tran.c - copied unchanged from r201903, vendor/one-true-awk/20021129/contrib/one-true-awk/tran.c vendor/one-true-awk/20021213/FIXES - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/FIXES vendor/one-true-awk/20021213/README - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/README vendor/one-true-awk/20021213/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/awk.1 vendor/one-true-awk/20021213/awk.h - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/awk.h vendor/one-true-awk/20021213/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20021213/b.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/b.c vendor/one-true-awk/20021213/lex.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/lex.c vendor/one-true-awk/20021213/lib.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/lib.c vendor/one-true-awk/20021213/mac.code - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/mac.code vendor/one-true-awk/20021213/main.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/main.c vendor/one-true-awk/20021213/makefile - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/makefile vendor/one-true-awk/20021213/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/maketab.c vendor/one-true-awk/20021213/parse.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/parse.c vendor/one-true-awk/20021213/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/proctab.c vendor/one-true-awk/20021213/proto.h - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/proto.h vendor/one-true-awk/20021213/run.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/run.c vendor/one-true-awk/20021213/tran.c - copied unchanged from r201903, vendor/one-true-awk/20021213/contrib/one-true-awk/tran.c vendor/one-true-awk/20030314/FIXES - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/FIXES vendor/one-true-awk/20030314/README - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/README vendor/one-true-awk/20030314/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/awk.1 vendor/one-true-awk/20030314/awk.h - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/awk.h vendor/one-true-awk/20030314/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20030314/b.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/b.c vendor/one-true-awk/20030314/lex.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/lex.c vendor/one-true-awk/20030314/lib.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/lib.c vendor/one-true-awk/20030314/mac.code - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/mac.code vendor/one-true-awk/20030314/main.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/main.c vendor/one-true-awk/20030314/makefile - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/makefile vendor/one-true-awk/20030314/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/maketab.c vendor/one-true-awk/20030314/parse.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/parse.c vendor/one-true-awk/20030314/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/proctab.c vendor/one-true-awk/20030314/proto.h - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/proto.h vendor/one-true-awk/20030314/run.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/run.c vendor/one-true-awk/20030314/tran.c - copied unchanged from r201903, vendor/one-true-awk/20030314/contrib/one-true-awk/tran.c vendor/one-true-awk/20030729/FIXES - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/FIXES vendor/one-true-awk/20030729/README - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/README vendor/one-true-awk/20030729/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/awk.1 vendor/one-true-awk/20030729/awk.h - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/awk.h vendor/one-true-awk/20030729/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20030729/b.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/b.c vendor/one-true-awk/20030729/lex.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/lex.c vendor/one-true-awk/20030729/lib.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/lib.c vendor/one-true-awk/20030729/mac.code - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/mac.code vendor/one-true-awk/20030729/main.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/main.c vendor/one-true-awk/20030729/makefile - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/makefile vendor/one-true-awk/20030729/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/maketab.c vendor/one-true-awk/20030729/parse.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/parse.c vendor/one-true-awk/20030729/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/proctab.c vendor/one-true-awk/20030729/proto.h - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/proto.h vendor/one-true-awk/20030729/run.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/run.c vendor/one-true-awk/20030729/tran.c - copied unchanged from r201903, vendor/one-true-awk/20030729/contrib/one-true-awk/tran.c vendor/one-true-awk/20030731/FIXES - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/FIXES vendor/one-true-awk/20030731/README - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/README vendor/one-true-awk/20030731/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/awk.1 vendor/one-true-awk/20030731/awk.h - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/awk.h vendor/one-true-awk/20030731/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20030731/b.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/b.c vendor/one-true-awk/20030731/lex.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/lex.c vendor/one-true-awk/20030731/lib.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/lib.c vendor/one-true-awk/20030731/mac.code - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/mac.code vendor/one-true-awk/20030731/main.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/main.c vendor/one-true-awk/20030731/makefile - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/makefile vendor/one-true-awk/20030731/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/maketab.c vendor/one-true-awk/20030731/parse.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/parse.c vendor/one-true-awk/20030731/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/proctab.c vendor/one-true-awk/20030731/proto.h - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/proto.h vendor/one-true-awk/20030731/run.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/run.c vendor/one-true-awk/20030731/tran.c - copied unchanged from r201903, vendor/one-true-awk/20030731/contrib/one-true-awk/tran.c vendor/one-true-awk/20040207/FIXES - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/FIXES vendor/one-true-awk/20040207/README - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/README vendor/one-true-awk/20040207/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/awk.1 vendor/one-true-awk/20040207/awk.h - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/awk.h vendor/one-true-awk/20040207/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20040207/b.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/b.c vendor/one-true-awk/20040207/lex.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/lex.c vendor/one-true-awk/20040207/lib.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/lib.c vendor/one-true-awk/20040207/mac.code - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/mac.code vendor/one-true-awk/20040207/main.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/main.c vendor/one-true-awk/20040207/makefile - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/makefile vendor/one-true-awk/20040207/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/maketab.c vendor/one-true-awk/20040207/parse.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/parse.c vendor/one-true-awk/20040207/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/proctab.c vendor/one-true-awk/20040207/proto.h - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/proto.h vendor/one-true-awk/20040207/run.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/run.c vendor/one-true-awk/20040207/tran.c - copied unchanged from r201903, vendor/one-true-awk/20040207/contrib/one-true-awk/tran.c vendor/one-true-awk/20050424/FIXES - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/FIXES vendor/one-true-awk/20050424/README - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/README vendor/one-true-awk/20050424/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/awk.1 vendor/one-true-awk/20050424/awk.h - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/awk.h vendor/one-true-awk/20050424/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20050424/b.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/b.c vendor/one-true-awk/20050424/lex.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/lex.c vendor/one-true-awk/20050424/lib.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/lib.c vendor/one-true-awk/20050424/mac.code - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/mac.code vendor/one-true-awk/20050424/main.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/main.c vendor/one-true-awk/20050424/makefile - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/makefile vendor/one-true-awk/20050424/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/maketab.c vendor/one-true-awk/20050424/parse.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/parse.c vendor/one-true-awk/20050424/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/proctab.c vendor/one-true-awk/20050424/proto.h - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/proto.h vendor/one-true-awk/20050424/run.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/run.c vendor/one-true-awk/20050424/tran.c - copied unchanged from r201903, vendor/one-true-awk/20050424/contrib/one-true-awk/tran.c vendor/one-true-awk/20070501/FIXES - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/FIXES vendor/one-true-awk/20070501/README - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/README vendor/one-true-awk/20070501/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/awk.1 vendor/one-true-awk/20070501/awk.h - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/awk.h vendor/one-true-awk/20070501/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20070501/b.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/b.c vendor/one-true-awk/20070501/lex.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/lex.c vendor/one-true-awk/20070501/lib.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/lib.c vendor/one-true-awk/20070501/mac.code - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/mac.code vendor/one-true-awk/20070501/main.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/main.c vendor/one-true-awk/20070501/makefile - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/makefile vendor/one-true-awk/20070501/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/maketab.c vendor/one-true-awk/20070501/parse.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/parse.c vendor/one-true-awk/20070501/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/proctab.c vendor/one-true-awk/20070501/proto.h - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/proto.h vendor/one-true-awk/20070501/run.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/run.c vendor/one-true-awk/20070501/tran.c - copied unchanged from r201903, vendor/one-true-awk/20070501/contrib/one-true-awk/tran.c vendor/one-true-awk/20071023/FIXES - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/FIXES vendor/one-true-awk/20071023/README - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/README vendor/one-true-awk/20071023/awk.1 - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/awk.1 vendor/one-true-awk/20071023/awk.h - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/awk.h vendor/one-true-awk/20071023/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/awkgram.y vendor/one-true-awk/20071023/b.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/b.c vendor/one-true-awk/20071023/lex.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/lex.c vendor/one-true-awk/20071023/lib.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/lib.c vendor/one-true-awk/20071023/main.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/main.c vendor/one-true-awk/20071023/makefile - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/makefile vendor/one-true-awk/20071023/maketab.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/maketab.c vendor/one-true-awk/20071023/parse.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/parse.c vendor/one-true-awk/20071023/proctab.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/proctab.c vendor/one-true-awk/20071023/proto.h - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/proto.h vendor/one-true-awk/20071023/run.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/run.c vendor/one-true-awk/20071023/tran.c - copied unchanged from r201903, vendor/one-true-awk/20071023/contrib/one-true-awk/tran.c vendor/one-true-awk/dist/FIXES - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/FIXES vendor/one-true-awk/dist/README - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/README vendor/one-true-awk/dist/awk.1 - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/awk.1 vendor/one-true-awk/dist/awk.h - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/awk.h vendor/one-true-awk/dist/awkgram.y - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/awkgram.y vendor/one-true-awk/dist/b.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/b.c vendor/one-true-awk/dist/buildwin.bat - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/buildwin.bat vendor/one-true-awk/dist/lex.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/lex.c vendor/one-true-awk/dist/lib.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/lib.c vendor/one-true-awk/dist/mac.code - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/mac.code vendor/one-true-awk/dist/main.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/main.c vendor/one-true-awk/dist/makefile - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/makefile vendor/one-true-awk/dist/maketab.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/maketab.c vendor/one-true-awk/dist/parse.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/parse.c vendor/one-true-awk/dist/proctab.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/proctab.c vendor/one-true-awk/dist/proto.h - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/proto.h vendor/one-true-awk/dist/run.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/run.c vendor/one-true-awk/dist/tran.c - copied unchanged from r201903, vendor/one-true-awk/dist/contrib/one-true-awk/tran.c Deleted: vendor/one-true-awk/20001115/contrib/ vendor/one-true-awk/20020101/contrib/ vendor/one-true-awk/20020210/contrib/ vendor/one-true-awk/20021129/contrib/ vendor/one-true-awk/20021213/contrib/ vendor/one-true-awk/20030314/contrib/ vendor/one-true-awk/20030729/contrib/ vendor/one-true-awk/20030731/contrib/ vendor/one-true-awk/20040207/contrib/ vendor/one-true-awk/20050424/contrib/ vendor/one-true-awk/20070501/contrib/ vendor/one-true-awk/20071023/contrib/ vendor/one-true-awk/dist/contrib/ Copied: vendor/one-true-awk/20001115/FIXES (from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/FIXES) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/20001115/FIXES Sat Jan 9 22:31:11 2010 (r201936, copy of r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/FIXES) @@ -0,0 +1,703 @@ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +This file lists all bug fixes, changes, etc., made since the AWK book +was sent to the printers in August, 1987. + +Nov 15, 2000: + fixed a bug introduced in august 1997 that caused expressions + like $f[1] to be syntax errors. thanks to arnold robbins for + noticing this and providing a fix. + +Oct 30, 2000: + fixed some nextfile bugs: not handling all cases. thanks to + arnold robbins for pointing this out. new regressions added. + + close() is now a function. it returns whatever the library + fclose returns, and -1 for closing a file or pipe that wasn't + opened. + +Sep 24, 2000: + permit \n explicitly in character classes; won't work right + if comes in as "[\n]" but ok as /[\n]/, because of multiple + processing of \'s. thanks to arnold robbins. + +July 5, 2000: + minor fiddles in tran.c to keep compilers happy about uschar. + thanks to norman wilson. + +May 25, 2000: + yet another attempt at making 8-bit input work, with another + band-aid in b.c (member()), and some (uschar) casts to head + off potential errors in subscripts (like isdigit). also + changed HAT to NCHARS-2. thanks again to santiago vila. + + changed maketab.c to ignore apparently out of range definitions + instead of halting; new freeBSD generates one. thanks to + jon snader for pointing out the problem. + +May 2, 2000: + fixed an 8-bit problem in b.c by making several char*'s into + unsigned char*'s. not clear i have them all yet. thanks to + Santiago Vila for the bug report. + +Apr 21, 2000: + finally found and fixed a memory leak in function call; it's + been there since functions were added ~1983. thanks to + jon bentley for the test case that found it. + + added test in envinit to catch environment "variables" with + names begining with '='; thanks to Berend Hasselman. + +Jul 28, 1999: + added test in defn() to catch function foo(foo), which + otherwise recurses until core dump. thanks to arnold + robbins for noticing this. + +Jun 20, 1999: + added *bp in gettok in lex.c; appears possible to exit function + without terminating the string. thanks to russ cox. + +Jun 2, 1999: + added function stdinit() to run to initialize files[] array, + in case stdin, etc., are not constants; some compilers care. + +May 10, 1999: + replaced the ERROR ... FATAL, etc., macros with functions + based on vprintf, to avoid problems caused by overrunning + fixed-size errbuf array. thanks to ralph corderoy for the + impetus, and for pointing out a string termination bug in + qstring as well. + +Apr 21, 1999: + fixed bug that caused occasional core dumps with commandline + variable with value ending in \. (thanks to nelson beebe for + the test case.) + +Apr 16, 1999: + with code kindly provided by Bruce Lilly, awk now parses + /=/ and similar constructs more sensibly in more places. + Bruce also provided some helpful test cases. + +Apr 5, 1999: + changed true/false to True/False in run.c to make it + easier to compile with C++. Added some casts on malloc + and realloc to be honest about casts; ditto. changed + ltype int to long in struct rrow to reduce some 64-bit + complaints; other changes scattered throughout for the + same purpose. thanks to Nelson Beebe for these portability + improvements. + + removed some horrible pointer-int casting in b.c and elsewhere + by adding ptoi and itonp to localize the casts, which are + all benign. fixed one incipient bug that showed up on sgi + in 64-bit mode. + + reset lineno for new source file; include filename in error + message. also fixed line number error in continuation lines. + (thanks to Nelson Beebe for both of these.) + +Mar 24, 1999: + Nelson Beebe notes that irix 5.3 yacc dies with a bogus + error; use a newer version or switch to bison, since sgi + is unlikely to fix it. + +Mar 5, 1999: + changed isnumber to is_number to avoid the problem caused by + versions of ctype.h that include the name isnumber. + + distribution now includes a script for building on a Mac, + thanks to Dan Allen. + +Feb 20, 1999: + fixed memory leaks in run.c (call) and tran.c (setfval). + thanks to Stephen Nutt for finding these and providing the fixes. + +Jan 13, 1999: + replaced srand argument by (unsigned int) in run.c; + avoids problem on Mac and potentially on Unix & Windows. + thanks to Dan Allen. + + added a few (int) casts to silence useless compiler warnings. + e.g., errorflag= in run.c jump(). + + added proctab.c to the bundle outout; one less thing + to have to compile out of the box. + + added calls to _popen and _pclose to the win95 stub for + pipes (thanks to Steve Adams for this helpful suggestion). + seems to work, though properties are not well understood + by me, and it appears that under some circumstances the + pipe output is truncated. Be careful. + +Oct 19, 1998: + fixed a couple of bugs in getrec: could fail to update $0 + after a getline var; because inputFS wasn't initialized, + could split $0 on every character, a misleading diversion. + + fixed caching bug in makedfa: LRU was actually removing + least often used. + + thanks to ross ridge for finding these, and for providing + great bug reports. + +May 12, 1998: + fixed potential bug in readrec: might fail to update record + pointer after growing. thanks to dan levy for spotting this + and suggesting the fix. + +Mar 12, 1998: + added -V to print version number and die. + +Feb 11, 1998: + subtle silent bug in lex.c: if the program ended with a number + longer than 1 digit, part of the input would be pushed back and + parsed again because token buffer wasn't terminated right. + example: awk 'length($0) > 10'. blush. at least i found it + myself. + +Aug 31, 1997: + s/adelete/awkdelete/: SGI uses this in malloc.h. + thanks to nelson beebe for pointing this one out. + +Aug 21, 1997: + fixed some bugs in sub and gsub when replacement includes \\. + this is a dark, horrible corner, but at least now i believe that + the behavior is the same as gawk and the intended posix standard. + thanks to arnold robbins for advice here. + +Aug 9, 1997: + somewhat regretfully, replaced the ancient lex-based lexical + analyzer with one written in C. it's longer, generates less code, + and more portable; the old one depended too much on mysterious + properties of lex that were not preserved in other environments. + in theory these recognize the same language. + + now using strtod to test whether a string is a number, instead of + the convoluted original function. should be more portable and + reliable if strtod is implemented right. + + removed now-pointless optimization in makefile that tries to avoid + recompilation when awkgram.y is changed but symbols are not. + + removed most fixed-size arrays, though a handful remain, some + of which are unchecked. you have been warned. + +Aug 4, 1997: + with some trepidation, replaced the ancient code that managed + fields and $0 in fixed-size arrays with arrays that grow on + demand. there is still some tension between trying to make this + run fast and making it clean; not sure it's right yet. + + the ill-conceived -mr and -mf arguments are now useful only + for debugging. previous dynamic string code removed. + + numerous other minor cleanups along the way. + +Jul 30, 1997: + using code provided by dan levy (to whom profuse thanks), replaced + fixed-size arrays and awkward kludges by a fairly uniform mechanism + to grow arrays as needed for printf, sub, gsub, etc. + +Jul 23, 1997: + falling off the end of a function returns "" and 0, not 0. + thanks to arnold robbins. + +Jun 17, 1997: + replaced several fixed-size arrays by dynamically-created ones + in run.c; added overflow tests to some previously unchecked cases. + getline, toupper, tolower. + + getline code is still broken in that recursive calls may wind + up using the same space. [fixed later] + + increased RECSIZE to 8192 to push problems further over the horizon. + + added \r to \n as input line separator for programs, not data. + damn CRLFs. + + modified format() to permit explicit printf("%c", 0) to include + a null byte in output. thanks to ken stailey for the fix. + + added a "-safe" argument that disables file output (print >, + print >>), process creation (cmd|getline, print |, system), and + access to the environment (ENVIRON). this is a first approximation + to a "safe" version of awk, but don't rely on it too much. thanks + to joan feigenbaum and matt blaze for the inspiration long ago. + +Jul 8, 1996: + fixed long-standing bug in sub, gsub(/a/, "\\\\&"); thanks to + ralph corderoy. + +Jun 29, 1996: + fixed awful bug in new field splitting; didn't get all the places + where input was done. + +Jun 28, 1996: + changed field-splitting to conform to posix definition: fields are + split using the value of FS at the time of input; it used to be + the value when the field or NF was first referred to, a much less + predictable definition. thanks to arnold robbins for encouragement + to do the right thing. + +May 28, 1996: + fixed appalling but apparently unimportant bug in parsing octal + numbers in reg exprs. + + explicit hex in reg exprs now limited to 2 chars: \xa, \xaa. + +May 27, 1996: + cleaned up some declarations so gcc -Wall is now almost silent. + + makefile now includes backup copies of ytab.c and lexyy.c in case + one makes before looking; it also avoids recreating lexyy.c unless + really needed. + + s/aprintf/awkprint, s/asprintf/awksprintf/ to avoid some name clashes + with unwisely-written header files. + + thanks to jeffrey friedl for several of these. + +May 26, 1996: + an attempt to rationalize the (unsigned) char issue. almost all + instances of unsigned char have been removed; the handful of places + in b.c where chars are used as table indices have been hand-crafted. + added some latin-1 tests to the regression, but i'm not confident; + none of my compilers seem to care much. thanks to nelson beebe for + pointing out some others that do care. + +May 2, 1996: + removed all register declarations. + + enhanced split(), as in gawk, etc: split(s, a, "") splits s into + a[1]...a[length(s)] with each character a single element. + + made the same changes for field-splitting if FS is "". + + added nextfile, as in gawk: causes immediate advance to next + input file. (thanks to arnold robbins for inspiration and code). + + small fixes to regexpr code: can now handle []], [[], and + variants; [] is now a syntax error, rather than matching + everything; [z-a] is now empty, not z. far from complete + or correct, however. (thanks to jeffrey friedl for pointing out + some awful behaviors.) + +Apr 29, 1996: + replaced uchar by uschar everwhere; apparently some compilers + usurp this name and this causes conflicts. + + fixed call to time in run.c (bltin); arg is time_t *. + + replaced horrible pointer/long punning in b.c by a legitimate + union. should be safer on 64-bit machines and cleaner everywhere. + (thanks to nelson beebe for pointing out some of these problems.) + + replaced nested comments by #if 0...#endif in run.c, lib.c. + + removed getsval, setsval, execute macros from run.c and lib.c. + machines are 100x faster than they were when these macros were + first used. + + revised filenames: awk.g.y => awkgram.y, awk.lx.l => awklex.l, + y.tab.[ch] => ytab.[ch], lex.yy.c => lexyy.c, all in the aid of + portability to nameless systems. + + "make bundle" now includes yacc and lex output files for recipients + who don't have yacc or lex. + +Aug 15, 1995: + initialized Cells in setsymtab more carefully; some fields + were not set. (thanks to purify, all of whose complaints i + think i now understand.) + + fixed at least one error in gsub that looked at -1-th element + of an array when substituting for a null match (e.g., $). + + delete arrayname is now legal; it clears the elements but leaves + the array, which may not be the right behavior. + + modified makefile: my current make can't cope with the test used + to avoid unnecessary yacc invocations. + +Jul 17, 1995: + added dynamically growing strings to awk.lx.l and b.c + to permit regular expressions to be much bigger. + the state arrays can still overflow. + +Aug 24, 1994: + detect duplicate arguments in function definitions (mdm). + +May 11, 1994: + trivial fix to printf to limit string size in sub(). + +Apr 22, 1994: + fixed yet another subtle self-assignment problem: + $1 = $2; $1 = $1 clobbered $1. + + Regression tests now use private echo, to avoid quoting problems. + +Feb 2, 1994: + changed error() to print line number as %d, not %g. + +Jul 23, 1993: + cosmetic changes: increased sizes of some arrays, + reworded some error messages. + + added CONVFMT as in posix (just replaced OFMT in getsval) + + FILENAME is now "" until the first thing that causes a file + to be opened. + +Nov 28, 1992: + deleted yyunput and yyoutput from proto.h; + different versions of lex give these different declarations. + +May 31, 1992: + added -mr N and -mf N options: more record and fields. + these really ought to adjust automatically. + + cleaned up some error messages; "out of space" now means + malloc returned NULL in all cases. + + changed rehash so that if it runs out, it just returns; + things will continue to run slow, but maybe a bit longer. + +Apr 24, 1992: + remove redundant close of stdin when using -f -. + + got rid of core dump with -d; awk -d just prints date. + +Apr 12, 1992: + added explicit check for /dev/std(in,out,err) in redirection. + unlike gawk, no /dev/fd/n yet. + + added (file/pipe) builtin. hard to test satisfactorily. + not posix. + +Feb 20, 1992: + recompile after abortive changes; should be unchanged. + +Dec 2, 1991: + die-casting time: converted to ansi C, installed that. + +Nov 30, 1991: + fixed storage leak in freefa, failing to recover [N]CCL. + thanks to Bill Jones (jones@cs.usask.ca) + +Nov 19, 1991: + use RAND_MAX instead of literal in builtin(). + +Nov 12, 1991: + cranked up some fixed-size arrays in b.c, and added a test for + overflow in penter. thanks to mark larsen. + +Sep 24, 1991: + increased buffer in gsub. a very crude fix to a general problem. + and again on Sep 26. + +Aug 18, 1991: + enforce variable name syntax for commandline variables: has to + start with letter or _. + +Jul 27, 1991: + allow newline after ; in for statements. + +Jul 21, 1991: + fixed so that in self-assignment like $1=$1, side effects + like recomputing $0 take place. (this is getting subtle.) + +Jun 30, 1991: + better test for detecting too-long output record. + +Jun 2, 1991: + better defense against very long printf strings. + made break and continue illegal outside of loops. + +May 13, 1991: + removed extra arg on gettemp, tempfree. minor error message rewording. + +May 6, 1991: + fixed silly bug in hex parsing in hexstr(). + removed an apparently unnecessary test in isnumber(). + warn about weird printf conversions. + fixed unchecked array overwrite in relex(). + + changed for (i in array) to access elements in sorted order. + then unchanged it -- it really does run slower in too many cases. + left the code in place, commented out. + +Feb 10, 1991: + check error status on all writes, to avoid banging on full disks. + +Jan 28, 1991: + awk -f - reads the program from stdin. + +Jan 11, 1991: + failed to set numeric state on $0 in cmd|getline context in run.c. + +Nov 2, 1990: + fixed sleazy test for integrality in getsval; use modf. + +Oct 29, 1990: + fixed sleazy buggy code in lib.c that looked (incorrectly) for + too long input lines. + +Oct 14, 1990: + fixed the bug on p. 198 in which it couldn't deduce that an + argument was an array in some contexts. replaced the error + message in intest() by code that damn well makes it an array. + +Oct 8, 1990: + fixed horrible bug: types and values were not preserved in + some kinds of self-assignment. (in assign().) + +Aug 24, 1990: + changed NCHARS to 256 to handle 8-bit characters in strings + presented to match(), etc. + +Jun 26, 1990: + changed struct rrow (awk.h) to use long instead of int for lval, + since cfoll() stores a pointer in it. now works better when int's + are smaller than pointers! + +May 6, 1990: + AVA fixed the grammar so that ! is uniformly of the same precedence as + unary + and -. This renders illegal some constructs like !x=y, which + now has to be parenthesized as !(x=y), and makes others work properly: + !x+y is (!x)+y, and x!y is x !y, not two pattern-action statements. + (These problems were pointed out by Bob Lenk of Posix.) + + Added \x to regular expressions (already in strings). + Limited octal to octal digits; \8 and \9 are not octal. + Centralized the code for parsing escapes in regular expressions. + Added a bunch of tests to T.re and T.sub to verify some of this. + +Feb 9, 1990: + fixed null pointer dereference bug in main.c: -F[nothing]. sigh. + + restored srand behavior: it returns the current seed. + +Jan 18, 1990: + srand now returns previous seed value (0 to start). + +Jan 5, 1990: + fix potential problem in tran.c -- something was freed, + then used in freesymtab. + +Oct 18, 1989: + another try to get the max number of open files set with + relatively machine-independent code. + + small fix to input() in case of multiple reads after EOF. + +Oct 11, 1989: + FILENAME is now defined in the BEGIN block -- too many old + programs broke. + + "-" means stdin in getline as well as on the commandline. + + added a bunch of casts to the code to tell the truth about + char * vs. unsigned char *, a right royal pain. added a + setlocale call to the front of main, though probably no one + has it usefully implemented yet. + +Aug 24, 1989: + removed redundant relational tests against nullnode if parse + tree already had a relational at that point. + +Aug 11, 1989: + fixed bug: commandline variable assignment has to look like + var=something. (consider the man page for =, in file =.1) + + changed number of arguments to functions to static arrays + to avoid repeated malloc calls. + +Aug 2, 1989: + restored -F (space) separator + +Jul 30, 1989: + added -v x=1 y=2 ... for immediate commandline variable assignment; + done before the BEGIN block for sure. they have to precede the + program if the program is on the commandline. + Modified Aug 2 to require a separate -v for each assignment. + +Jul 10, 1989: + fixed ref-thru-zero bug in environment code in tran.c + +Jun 23, 1989: + add newline to usage message. + +Jun 14, 1989: + added some missing ansi printf conversion letters: %i %X %E %G. + no sensible meaning for h or L, so they may not do what one expects. + + made %* conversions work. + + changed x^y so that if n is a positive integer, it's done + by explicit multiplication, thus achieving maximum accuracy. + (this should be done by pow() but it seems not to be locally.) + done to x ^= y as well. + +Jun 4, 1989: + ENVIRON array contains environment: if shell variable V=thing, + ENVIRON["V"] is "thing" + + multiple -f arguments permitted. error reporting is naive. + (they were permitted before, but only the last was used.) + + fixed a really stupid botch in the debugging macro dprintf + + fixed order of evaluation of commandline assignments to match + what the book claims: an argument of the form x=e is evaluated + at the time it would have been opened if it were a filename (p 63). + this invalidates the suggested answer to ex 4-1 (p 195). + + removed some code that permitted -F (space) fieldseparator, + since it didn't quite work right anyway. (restored aug 2) + +Apr 27, 1989: + Line number now accumulated correctly for comment lines. + +Apr 26, 1989: + Debugging output now includes a version date, + if one compiles it into the source each time. + +Apr 9, 1989: + Changed grammar to prohibit constants as 3rd arg of sub and gsub; + prevents class of overwriting-a-constant errors. (Last one?) + This invalidates the "banana" example on page 43 of the book. + + Added \a ("alert"), \v (vertical tab), \xhhh (hexadecimal), + as in ANSI, for strings. Rescinded the sloppiness that permitted + non-octal digits in \ooo. Warning: not all compilers and libraries + will be able to deal with \x correctly. + +Jan 9, 1989: + Fixed bug that caused tempcell list to contain a duplicate. + The fix is kludgy. + +Dec 17, 1988: + Catches some more commandline errors in main. + Removed redundant decl of modf in run.c (confuses some compilers). + Warning: there's no single declaration of malloc, etc., in awk.h + that seems to satisfy all compilers. + +Dec 7, 1988: + Added a bit of code to error printing to avoid printing nulls. + (Not clear that it actually would.) + +Nov 27, 1988: + With fear and trembling, modified the grammar to permit + multiple pattern-action statements on one line without + an explicit separator. By definition, this capitulation + to the ghost of ancient implementations remains undefined + and thus subject to change without notice or apology. + DO NOT COUNT ON IT. + +Oct 30, 1988: + Fixed bug in call() that failed to recover storage. + + A warning is now generated if there are more arguments + in the call than in the definition (in lieu of fixing + another storage leak). + +Oct 20, 1988: + Fixed %c: if expr is numeric, use numeric value; + otherwise print 1st char of string value. still + doesn't work if the value is 0 -- won't print \0. + + Added a few more checks for running out of malloc. + +Oct 12, 1988: + Fixed bug in call() that freed local arrays twice. + + Fixed to handle deletion of non-existent array right; + complains about attempt to delete non-array element. + +Sep 30, 1988: + Now guarantees to evaluate all arguments of built-in + functions, as in C; the appearance is that arguments + are evaluated before the function is called. Places + affected are sub (gsub was ok), substr, printf, and + all the built-in arithmetic functions in bltin(). + A warning is generated if a bltin() is called with + the wrong number of arguments. + + This requires changing makeprof on p167 of the book. + +Aug 23, 1988: + setting FILENAME in BEGIN caused core dump, apparently + because it was freeing space not allocated by malloc. + +July 24, 1988: + fixed egregious error in toupper/tolower functions. + still subject to rescinding, however. + +July 2, 1988: + flush stdout before opening file or pipe + +July 2, 1988: + performance bug in b.c/cgoto(): not freeing some sets of states. + partial fix only right now, and the number of states increased + to make it less obvious. + +June 1, 1988: + check error status on close + +May 28, 1988: + srand returns seed value it's using. + see 1/18/90 + +May 22, 1988: + Removed limit on depth of function calls. + +May 10, 1988: + Fixed lib.c to permit _ in commandline variable names. + +Mar 25, 1988: + main.c fixed to recognize -- as terminator of command- + line options. Illegal options flagged. + Error reporting slightly cleaned up. + +Dec 2, 1987: + Newer C compilers apply a strict scope rule to extern + declarations within functions. Two extern declarations in + lib.c and tran.c have been moved to obviate this problem. + +Oct xx, 1987: + Reluctantly added toupper and tolower functions. + Subject to rescinding without notice. + +Sep 17, 1987: + Error-message printer had printf(s) instead of + printf("%s",s); got core dumps when the message + included a %. + +Sep 12, 1987: + Very long printf strings caused core dump; + fixed aprintf, asprintf, format to catch them. + Can still get a core dump in printf itself. + + Copied: vendor/one-true-awk/20001115/README (from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/20001115/README Sat Jan 9 22:31:11 2010 (r201936, copy of r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/README) @@ -0,0 +1,83 @@ +/**************************************************************** +Copyright (C) Lucent Technologies 1997 +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +****************************************************************/ + +This is the version of awk described in "The AWK Programming Language", +by Al Aho, Brian Kernighan, and Peter Weinberger +(Addison-Wesley, 1988, ISBN 0-201-07981-X). + +Changes, mostly bug fixes and occasional enhancements, are listed +in FIXES. If you distribute this code further, please please please +distribute FIXES with it. If you find errors, please report them +to bwk@bell-labs.com. Thanks. + +The program itself is created by + make +which should produce a sequence of messages roughly like this: + + yacc -d awkgram.y + +conflicts: 43 shift/reduce, 85 reduce/reduce + mv y.tab.c ytab.c + mv y.tab.h ytab.h + cc -O -c ytab.c + cc -O -c b.c + cc -O -c main.c + cc -O -c parse.c + cc -O maketab.c -o maketab + ./maketab >proctab.c + cc -O -c proctab.c + cc -O -c tran.c + cc -O -c lib.c + cc -O -c run.c + cc -O -c lex.c + cc -O ytab.o b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o -lm + +This produces an executable a.out; you will eventually want to +move this to some place like /usr/bin/awk. + +If your system is does not have yacc or bison (the GNU +equivalent), you must compile the pieces manually. We have +included yacc output in ytab.c and ytab.h, and backup copies in +case you overwrite them. We have also included a copy of +proctab.c so you do not need to run maketab. + +NOTE: This version uses ANSI C, as you should also. We have +compiled this without any changes using gcc -Wall and/or local C +compilers on a variety of systems, but new systems or compilers +may raise some new complaint; reports of difficulties are +welcome. + +This also compiles with Visual C++ on Windows 95 and Windows NT, +*if* you provide versions of popen and pclose. The file +missing95.c contains versions that can be used to get started +with, though the underlying support has mysterious properties, +the symptom of which can be truncated pipe output. Beware. + +This is also said to compile on Macintosh systems, using the +file "buildmac" provided by Dan Allen (danallen@microsoft.com), +to whom many thanks. Dan also provided buildwin.bat, a simple +script for compiling on NT if you prefer. + +The version of malloc that comes with some systems is sometimes +astonishly slow. If awk seems slow, you might try fixing that. Copied: vendor/one-true-awk/20001115/awk.1 (from r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/awk.1) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/one-true-awk/20001115/awk.1 Sat Jan 9 22:31:11 2010 (r201936, copy of r201903, vendor/one-true-awk/20001115/contrib/one-true-awk/awk.1) @@ -0,0 +1,529 @@ +.de EX +.nf +.ft CW +.. +.de EE +.br +.fi +.ft 1 +.. +awk +.TH AWK 1 +.CT 1 files prog_other +.SH NAME +awk \- pattern-directed scanning and processing language +.SH SYNOPSIS +.B awk +[ +.BI \-F +.I fs +] +[ +.BI \-v +.I var=value +] +[ +.I 'prog' +| +.BI \-f +.I progfile +] +[ +.I file ... +] +.SH DESCRIPTION +.I Awk +scans each input +.I file +for lines that match any of a set of patterns specified literally in +.IR prog +or in one or more files +specified as +.B \-f +.IR progfile . +With each pattern +there can be an associated action that will be performed +when a line of a +.I file +matches the pattern. +Each line is matched against the +pattern portion of every pattern-action statement; +the associated action is performed for each matched pattern. +The file name +.B \- +means the standard input. +Any +.IR file +of the form +.I var=value +is treated as an assignment, not a filename, +and is executed at the time it would have been opened if it were a filename. +The option +.B \-v +followed by +.I var=value +is an assignment to be done before +.I prog +is executed; +any number of +.B \-v +options may be present. +The +.B \-F +.IR fs +option defines the input field separator to be the regular expression +.IR fs. +.PP +An input line is normally made up of fields separated by white space, +or by regular expression +.BR FS . +The fields are denoted +.BR $1 , +.BR $2 , +\&..., while +.B $0 +refers to the entire line. +If +.BR FS +is null, the input line is split into one field per character. +.PP +A pattern-action statement has the form +.IP +.IB pattern " { " action " } +.PP +A missing +.BI { " action " } +means print the line; +a missing pattern always matches. +Pattern-action statements are separated by newlines or semicolons. +.PP +An action is a sequence of statements. +A statement can be one of the following: +.PP +.EX +.ta \w'\f(CWdelete array[expression]'u +.RS +.nf +.ft CW +if(\fI expression \fP)\fI statement \fP\fR[ \fPelse\fI statement \fP\fR]\fP +while(\fI expression \fP)\fI statement\fP +for(\fI expression \fP;\fI expression \fP;\fI expression \fP)\fI statement\fP +for(\fI var \fPin\fI array \fP)\fI statement\fP +do\fI statement \fPwhile(\fI expression \fP) +break +continue +{\fR [\fP\fI statement ... \fP\fR] \fP} +\fIexpression\fP #\fR commonly\fP\fI var = expression\fP +print\fR [ \fP\fIexpression-list \fP\fR] \fP\fR[ \fP>\fI expression \fP\fR]\fP +printf\fI format \fP\fR[ \fP,\fI expression-list \fP\fR] \fP\fR[ \fP>\fI expression \fP\fR]\fP +return\fR [ \fP\fIexpression \fP\fR]\fP +next #\fR skip remaining patterns on this input line\fP +nextfile #\fR skip rest of this file, open next, start at top\fP +delete\fI array\fP[\fI expression \fP] #\fR delete an array element\fP +delete\fI array\fP #\fR delete all elements of array\fP +exit\fR [ \fP\fIexpression \fP\fR]\fP #\fR exit immediately; status is \fP\fIexpression\fP +.fi +.RE +.EE +.DT +.PP +Statements are terminated by +semicolons, newlines or right braces. +An empty +.I expression-list +stands for +.BR $0 . +String constants are quoted \&\f(CW"\ "\fR, +with the usual C escapes recognized within. +Expressions take on string or numeric values as appropriate, +and are built using the operators +.B + \- * / % ^ +(exponentiation), and concatenation (indicated by white space). +The operators +.B +! ++ \-\- += \-= *= /= %= ^= > >= < <= == != ?: +are also available in expressions. +Variables may be scalars, array elements +(denoted +.IB x [ i ] ) +or fields. +Variables are initialized to the null string. +Array subscripts may be any string, +not necessarily numeric; +this allows for a form of associative memory. +Multiple subscripts such as +.B [i,j,k] +are permitted; the constituents are concatenated, +separated by the value of +.BR SUBSEP . +.PP +The +.B print +statement prints its arguments on the standard output +(or on a file if +.BI > file +or +.BI >> file +is present or on a pipe if +.BI | cmd +is present), separated by the current output field separator, +and terminated by the output record separator. +.I file +and +.I cmd +may be literal names or parenthesized expressions; +identical string values in different statements denote +the same open file. +The +.B printf +statement formats its expression list according to the format +(see +.IR printf (3)) . +The built-in function +.BI close( expr ) +closes the file or pipe +.IR expr . +The built-in function +.BI fflush( expr ) +flushes any buffered output for the file or pipe +.IR expr . +.PP +The mathematical functions +.BR exp , +.BR log , +.BR sqrt , +.BR sin , +.BR cos , +and +.BR atan2 +are built in. +Other built-in functions: +.TF length +.TP +.B length +the length of its argument +taken as a string, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:33:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1CDE1065670; Sat, 9 Jan 2010 22:33:34 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C72F08FC12; Sat, 9 Jan 2010 22:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09MXYbp035078; Sat, 9 Jan 2010 22:33:34 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09MXY5K035076; Sat, 9 Jan 2010 22:33:34 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001092233.o09MXY5K035076@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 9 Jan 2010 22:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201937 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:33:35 -0000 Author: marcel Date: Sat Jan 9 22:33:34 2010 New Revision: 201937 URL: http://svn.freebsd.org/changeset/base/201937 Log: Implement the fo_readdir method. This does not support long file names. Obtained from: Juniper Networks, Inc. MFC after: 1 week Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Sat Jan 9 22:31:11 2010 (r201936) +++ head/lib/libstand/dosfs.c Sat Jan 9 22:33:34 2010 (r201937) @@ -47,6 +47,7 @@ static int dos_close(struct open_file *f static int dos_read(struct open_file *fd, void *buf, size_t size, size_t *resid); static off_t dos_seek(struct open_file *fd, off_t offset, int whence); static int dos_stat(struct open_file *fd, struct stat *sb); +static int dos_readdir(struct open_file *fd, struct dirent *d); struct fs_ops dosfs_fsops = { "dosfs", @@ -56,7 +57,7 @@ struct fs_ops dosfs_fsops = { null_write, dos_seek, dos_stat, - null_readdir + dos_readdir }; #define SECSIZ 512 /* sector size */ @@ -354,6 +355,72 @@ dos_stat(struct open_file *fd, struct st return (0); } +static int +dos_readdir(struct open_file *fd, struct dirent *d) +{ + DOS_FILE *f = (DOS_FILE *)fd->f_fsdata; + u_char fn[261]; + DOS_DIR dd; + size_t res; + u_int chk, i, x, xdn; + int err; + + x = chk = 0; + while (1) { + xdn = x; + x = 0; + err = dos_read(fd, &dd, sizeof(dd), &res); + if (err) + return (err); + if (res == sizeof(dd)) + return (ENOENT); + if (dd.de.name[0] == 0) + return (ENOENT); + + /* Skip deleted entries */ + if (dd.de.name[0] == 0xe5) + continue; + + /* Skip volume labels */ + if (dd.de.attr & FA_LABEL) + continue; + + if ((dd.de.attr & FA_MASK) == FA_XDE) { + if (dd.xde.seq & 0x40) + chk = dd.xde.chk; + else if (dd.xde.seq != xdn - 1 || dd.xde.chk != chk) + continue; + x = dd.xde.seq & ~0x40; + if (x < 1 || x > 20) { + x = 0; + continue; + } + cp_xdnm(fn, &dd.xde); + } else { + if (xdn == 1) { + x = 0; + for (i = 0; i < 11; i++) { + x = ((x & 1) << 7) | (x >> 1); + x += dd.de.name[i]; + x &= 0xff; + } + if (x == chk) + break; + } else { + cp_sfn(fn, &dd.de); + break; + } + x = 0; + } + } + + d->d_fileno = dd.de.clus[1] << 8 + dd.de.clus[0]; + d->d_reclen = sizeof(*d); + d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; + memcpy(d->d_name, fn, sizeof(d->d_name)); + return(0); +} + /* * Parse DOS boot sector */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:39:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF1A81065670; Sat, 9 Jan 2010 22:39:01 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DADD18FC14; Sat, 9 Jan 2010 22:39:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Md1F1036326; Sat, 9 Jan 2010 22:39:01 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Md1ZM036325; Sat, 9 Jan 2010 22:39:01 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092239.o09Md1ZM036325@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 22:39:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201938 - in vendor/one-true-awk: 20001115 20020101 20020210 20021129 20021213 20030314 20030729 20030731 20040207 20050424 20070501 20071023 dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:39:02 -0000 Author: ru Date: Sat Jan 9 22:39:01 2010 New Revision: 201938 URL: http://svn.freebsd.org/changeset/base/201938 Log: Clean up. Deleted: vendor/one-true-awk/dist/buildwin.bat vendor/one-true-awk/dist/mac.code Modified: Directory Properties: vendor/one-true-awk/20001115/FIXES (props changed) vendor/one-true-awk/20001115/README (props changed) vendor/one-true-awk/20001115/awk.1 (props changed) vendor/one-true-awk/20001115/awk.h (props changed) vendor/one-true-awk/20001115/awkgram.y (props changed) vendor/one-true-awk/20001115/b.c (props changed) vendor/one-true-awk/20001115/buildwin.bat (props changed) vendor/one-true-awk/20001115/lex.c (props changed) vendor/one-true-awk/20001115/lib.c (props changed) vendor/one-true-awk/20001115/mac.code (props changed) vendor/one-true-awk/20001115/main.c (props changed) vendor/one-true-awk/20001115/makefile (props changed) vendor/one-true-awk/20001115/maketab.c (props changed) vendor/one-true-awk/20001115/parse.c (props changed) vendor/one-true-awk/20001115/proctab.c (props changed) vendor/one-true-awk/20001115/proto.h (props changed) vendor/one-true-awk/20001115/run.c (props changed) vendor/one-true-awk/20001115/tran.c (props changed) vendor/one-true-awk/20020101/FIXES (props changed) vendor/one-true-awk/20020101/README (props changed) vendor/one-true-awk/20020101/awk.1 (props changed) vendor/one-true-awk/20020101/awk.h (props changed) vendor/one-true-awk/20020101/awkgram.y (props changed) vendor/one-true-awk/20020101/b.c (props changed) vendor/one-true-awk/20020101/lex.c (props changed) vendor/one-true-awk/20020101/lib.c (props changed) vendor/one-true-awk/20020101/mac.code (props changed) vendor/one-true-awk/20020101/main.c (props changed) vendor/one-true-awk/20020101/maketab.c (props changed) vendor/one-true-awk/20020101/parse.c (props changed) vendor/one-true-awk/20020101/proctab.c (props changed) vendor/one-true-awk/20020101/proto.h (props changed) vendor/one-true-awk/20020101/run.c (props changed) vendor/one-true-awk/20020101/tran.c (props changed) vendor/one-true-awk/20020210/FIXES (props changed) vendor/one-true-awk/20020210/README (props changed) vendor/one-true-awk/20020210/awk.1 (props changed) vendor/one-true-awk/20020210/awk.h (props changed) vendor/one-true-awk/20020210/awkgram.y (props changed) vendor/one-true-awk/20020210/b.c (props changed) vendor/one-true-awk/20020210/lex.c (props changed) vendor/one-true-awk/20020210/lib.c (props changed) vendor/one-true-awk/20020210/mac.code (props changed) vendor/one-true-awk/20020210/main.c (props changed) vendor/one-true-awk/20020210/makefile (props changed) vendor/one-true-awk/20020210/maketab.c (props changed) vendor/one-true-awk/20020210/parse.c (props changed) vendor/one-true-awk/20020210/proctab.c (props changed) vendor/one-true-awk/20020210/proto.h (props changed) vendor/one-true-awk/20020210/run.c (props changed) vendor/one-true-awk/20020210/tran.c (props changed) vendor/one-true-awk/20021129/FIXES (props changed) vendor/one-true-awk/20021129/README (props changed) vendor/one-true-awk/20021129/awk.1 (props changed) vendor/one-true-awk/20021129/awk.h (props changed) vendor/one-true-awk/20021129/awkgram.y (props changed) vendor/one-true-awk/20021129/b.c (props changed) vendor/one-true-awk/20021129/lex.c (props changed) vendor/one-true-awk/20021129/lib.c (props changed) vendor/one-true-awk/20021129/mac.code (props changed) vendor/one-true-awk/20021129/main.c (props changed) vendor/one-true-awk/20021129/makefile (props changed) vendor/one-true-awk/20021129/maketab.c (props changed) vendor/one-true-awk/20021129/parse.c (props changed) vendor/one-true-awk/20021129/proctab.c (props changed) vendor/one-true-awk/20021129/proto.h (props changed) vendor/one-true-awk/20021129/run.c (props changed) vendor/one-true-awk/20021129/tran.c (props changed) vendor/one-true-awk/20021213/FIXES (props changed) vendor/one-true-awk/20021213/README (props changed) vendor/one-true-awk/20021213/awk.1 (props changed) vendor/one-true-awk/20021213/awk.h (props changed) vendor/one-true-awk/20021213/awkgram.y (props changed) vendor/one-true-awk/20021213/b.c (props changed) vendor/one-true-awk/20021213/lex.c (props changed) vendor/one-true-awk/20021213/lib.c (props changed) vendor/one-true-awk/20021213/mac.code (props changed) vendor/one-true-awk/20021213/main.c (props changed) vendor/one-true-awk/20021213/makefile (props changed) vendor/one-true-awk/20021213/maketab.c (props changed) vendor/one-true-awk/20021213/parse.c (props changed) vendor/one-true-awk/20021213/proctab.c (props changed) vendor/one-true-awk/20021213/proto.h (props changed) vendor/one-true-awk/20021213/run.c (props changed) vendor/one-true-awk/20021213/tran.c (props changed) vendor/one-true-awk/20030314/FIXES (props changed) vendor/one-true-awk/20030314/README (props changed) vendor/one-true-awk/20030314/awk.1 (props changed) vendor/one-true-awk/20030314/awk.h (props changed) vendor/one-true-awk/20030314/awkgram.y (props changed) vendor/one-true-awk/20030314/b.c (props changed) vendor/one-true-awk/20030314/lex.c (props changed) vendor/one-true-awk/20030314/lib.c (props changed) vendor/one-true-awk/20030314/mac.code (props changed) vendor/one-true-awk/20030314/main.c (props changed) vendor/one-true-awk/20030314/makefile (props changed) vendor/one-true-awk/20030314/maketab.c (props changed) vendor/one-true-awk/20030314/parse.c (props changed) vendor/one-true-awk/20030314/proctab.c (props changed) vendor/one-true-awk/20030314/proto.h (props changed) vendor/one-true-awk/20030314/run.c (props changed) vendor/one-true-awk/20030314/tran.c (props changed) vendor/one-true-awk/20030729/FIXES (props changed) vendor/one-true-awk/20030729/README (props changed) vendor/one-true-awk/20030729/awk.1 (props changed) vendor/one-true-awk/20030729/awk.h (props changed) vendor/one-true-awk/20030729/awkgram.y (props changed) vendor/one-true-awk/20030729/b.c (props changed) vendor/one-true-awk/20030729/lex.c (props changed) vendor/one-true-awk/20030729/lib.c (props changed) vendor/one-true-awk/20030729/mac.code (props changed) vendor/one-true-awk/20030729/main.c (props changed) vendor/one-true-awk/20030729/makefile (props changed) vendor/one-true-awk/20030729/maketab.c (props changed) vendor/one-true-awk/20030729/parse.c (props changed) vendor/one-true-awk/20030729/proctab.c (props changed) vendor/one-true-awk/20030729/proto.h (props changed) vendor/one-true-awk/20030729/run.c (props changed) vendor/one-true-awk/20030729/tran.c (props changed) vendor/one-true-awk/20030731/FIXES (props changed) vendor/one-true-awk/20030731/README (props changed) vendor/one-true-awk/20030731/awk.1 (props changed) vendor/one-true-awk/20030731/awk.h (props changed) vendor/one-true-awk/20030731/awkgram.y (props changed) vendor/one-true-awk/20030731/b.c (props changed) vendor/one-true-awk/20030731/lex.c (props changed) vendor/one-true-awk/20030731/lib.c (props changed) vendor/one-true-awk/20030731/mac.code (props changed) vendor/one-true-awk/20030731/main.c (props changed) vendor/one-true-awk/20030731/makefile (props changed) vendor/one-true-awk/20030731/maketab.c (props changed) vendor/one-true-awk/20030731/parse.c (props changed) vendor/one-true-awk/20030731/proctab.c (props changed) vendor/one-true-awk/20030731/proto.h (props changed) vendor/one-true-awk/20030731/run.c (props changed) vendor/one-true-awk/20030731/tran.c (props changed) vendor/one-true-awk/20040207/FIXES (props changed) vendor/one-true-awk/20040207/README (props changed) vendor/one-true-awk/20040207/awk.1 (props changed) vendor/one-true-awk/20040207/awk.h (props changed) vendor/one-true-awk/20040207/awkgram.y (props changed) vendor/one-true-awk/20040207/b.c (props changed) vendor/one-true-awk/20040207/lex.c (props changed) vendor/one-true-awk/20040207/lib.c (props changed) vendor/one-true-awk/20040207/mac.code (props changed) vendor/one-true-awk/20040207/main.c (props changed) vendor/one-true-awk/20040207/makefile (props changed) vendor/one-true-awk/20040207/maketab.c (props changed) vendor/one-true-awk/20040207/parse.c (props changed) vendor/one-true-awk/20040207/proctab.c (props changed) vendor/one-true-awk/20040207/proto.h (props changed) vendor/one-true-awk/20040207/run.c (props changed) vendor/one-true-awk/20040207/tran.c (props changed) vendor/one-true-awk/20050424/FIXES (props changed) vendor/one-true-awk/20050424/README (props changed) vendor/one-true-awk/20050424/awk.1 (props changed) vendor/one-true-awk/20050424/awk.h (props changed) vendor/one-true-awk/20050424/awkgram.y (props changed) vendor/one-true-awk/20050424/b.c (props changed) vendor/one-true-awk/20050424/lex.c (props changed) vendor/one-true-awk/20050424/lib.c (props changed) vendor/one-true-awk/20050424/mac.code (props changed) vendor/one-true-awk/20050424/main.c (props changed) vendor/one-true-awk/20050424/makefile (props changed) vendor/one-true-awk/20050424/maketab.c (props changed) vendor/one-true-awk/20050424/parse.c (props changed) vendor/one-true-awk/20050424/proctab.c (props changed) vendor/one-true-awk/20050424/proto.h (props changed) vendor/one-true-awk/20050424/run.c (props changed) vendor/one-true-awk/20050424/tran.c (props changed) vendor/one-true-awk/20070501/FIXES (props changed) vendor/one-true-awk/20070501/README (props changed) vendor/one-true-awk/20070501/awk.1 (props changed) vendor/one-true-awk/20070501/awk.h (props changed) vendor/one-true-awk/20070501/awkgram.y (props changed) vendor/one-true-awk/20070501/b.c (props changed) vendor/one-true-awk/20070501/lex.c (props changed) vendor/one-true-awk/20070501/lib.c (props changed) vendor/one-true-awk/20070501/mac.code (props changed) vendor/one-true-awk/20070501/main.c (props changed) vendor/one-true-awk/20070501/makefile (props changed) vendor/one-true-awk/20070501/maketab.c (props changed) vendor/one-true-awk/20070501/parse.c (props changed) vendor/one-true-awk/20070501/proctab.c (props changed) vendor/one-true-awk/20070501/proto.h (props changed) vendor/one-true-awk/20070501/run.c (props changed) vendor/one-true-awk/20070501/tran.c (props changed) vendor/one-true-awk/20071023/FIXES (props changed) vendor/one-true-awk/20071023/README (props changed) vendor/one-true-awk/20071023/awk.1 (props changed) vendor/one-true-awk/20071023/awk.h (props changed) vendor/one-true-awk/20071023/awkgram.y (props changed) vendor/one-true-awk/20071023/b.c (props changed) vendor/one-true-awk/20071023/lex.c (props changed) vendor/one-true-awk/20071023/lib.c (props changed) vendor/one-true-awk/20071023/main.c (props changed) vendor/one-true-awk/20071023/makefile (props changed) vendor/one-true-awk/20071023/maketab.c (props changed) vendor/one-true-awk/20071023/parse.c (props changed) vendor/one-true-awk/20071023/proctab.c (props changed) vendor/one-true-awk/20071023/proto.h (props changed) vendor/one-true-awk/20071023/run.c (props changed) vendor/one-true-awk/20071023/tran.c (props changed) vendor/one-true-awk/dist/FIXES (props changed) vendor/one-true-awk/dist/README (props changed) vendor/one-true-awk/dist/awk.1 (props changed) vendor/one-true-awk/dist/awk.h (props changed) vendor/one-true-awk/dist/awkgram.y (props changed) vendor/one-true-awk/dist/b.c (props changed) vendor/one-true-awk/dist/lex.c (props changed) vendor/one-true-awk/dist/lib.c (props changed) vendor/one-true-awk/dist/main.c (props changed) vendor/one-true-awk/dist/makefile (props changed) vendor/one-true-awk/dist/maketab.c (props changed) vendor/one-true-awk/dist/parse.c (props changed) vendor/one-true-awk/dist/proctab.c (props changed) vendor/one-true-awk/dist/proto.h (props changed) vendor/one-true-awk/dist/run.c (props changed) vendor/one-true-awk/dist/tran.c (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:45:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87612106566C; Sat, 9 Jan 2010 22:45:06 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D0268FC08; Sat, 9 Jan 2010 22:45:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Mj6WV037685; Sat, 9 Jan 2010 22:45:06 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09Mj6kF037684; Sat, 9 Jan 2010 22:45:06 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092245.o09Mj6kF037684@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 22:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201939 - head/contrib/one-true-awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:45:06 -0000 Author: ru Date: Sat Jan 9 22:45:06 2010 New Revision: 201939 URL: http://svn.freebsd.org/changeset/base/201939 Log: Bootstrap merge history. Modified: Directory Properties: head/contrib/one-true-awk/ (props changed) From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:47:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F12F106566B; Sat, 9 Jan 2010 22:47:41 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 351F58FC18; Sat, 9 Jan 2010 22:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09MlfVQ038275; Sat, 9 Jan 2010 22:47:41 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09MlfoL038274; Sat, 9 Jan 2010 22:47:41 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092247.o09MlfoL038274@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 22:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201940 - head/contrib/one-true-awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:47:41 -0000 Author: ru Date: Sat Jan 9 22:47:40 2010 New Revision: 201940 URL: http://svn.freebsd.org/changeset/base/201940 Log: Clean up import. Deleted: head/contrib/one-true-awk/mac.code From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 22:54:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 134C9106568F; Sat, 9 Jan 2010 22:54:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F41CD8FC08; Sat, 9 Jan 2010 22:54:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09MsTYR039782; Sat, 9 Jan 2010 22:54:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09MsTYj039775; Sat, 9 Jan 2010 22:54:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201001092254.o09MsTYj039775@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 9 Jan 2010 22:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201941 - in head/sys/boot: common efi/include efi/libefi ia64/efi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 22:54:30 -0000 Author: marcel Date: Sat Jan 9 22:54:29 2010 New Revision: 201941 URL: http://svn.freebsd.org/changeset/base/201941 Log: Remove file system support based on the simple file system protocol as this only allows us to access file systems that EFI knows about. With a loader that can only use EFI-supported file systems, we're forced to put /boot on the EFI system partition. This is suboptimal in the following ways: 1. With /boot a symlink to /efi/boot, mergemaster complains about the mismatch and there's no quick solution. 2. The EFI loader can only boot a single version of FreeBSD. There's no way to install multiple versions of FreeBSD and select one at the loader prompt. 3. ZFS maintains /boot/zfs/zpool.cache and with /boot a symlink we end up with the file on a MSDOS file system. ZFS does not have proper handling of file systems that are under Giant. Implement a disk device based on the block I/O protocol instead and pull in file system code from libstand. The disk devices are really the partitions that EFI knows about. This change is backward compatible. MFC after: 1 week Added: head/sys/boot/efi/libefi/efipart.c (contents, props changed) Deleted: head/sys/boot/efi/libefi/efifs.c Modified: head/sys/boot/common/bootstrap.h head/sys/boot/efi/include/efilib.h head/sys/boot/efi/libefi/Makefile head/sys/boot/ia64/efi/conf.c head/sys/boot/ia64/efi/version Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Sat Jan 9 22:47:40 2010 (r201940) +++ head/sys/boot/common/bootstrap.h Sat Jan 9 22:54:29 2010 (r201941) @@ -45,6 +45,7 @@ struct devdesc #define DEVT_CD 3 #define DEVT_ZFS 4 int d_unit; + void *d_opendata; }; /* Commands and return values; nonzero return sets command_errmsg != NULL */ Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Sat Jan 9 22:47:40 2010 (r201940) +++ head/sys/boot/efi/include/efilib.h Sat Jan 9 22:54:29 2010 (r201941) @@ -34,9 +34,7 @@ extern EFI_SYSTEM_TABLE *ST; extern EFI_BOOT_SERVICES *BS; extern EFI_RUNTIME_SERVICES *RS; -extern struct devsw efifs_dev; -extern struct fs_ops efifs_fsops; - +extern struct devsw efipart_dev; extern struct devsw efinet_dev; extern struct netif_driver efinetif; Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Sat Jan 9 22:47:40 2010 (r201940) +++ head/sys/boot/efi/libefi/Makefile Sat Jan 9 22:54:29 2010 (r201941) @@ -3,8 +3,8 @@ LIB= efi INTERNALLIB= -SRCS= delay.c efi_console.c efifs.c efinet.c errno.c handles.c libefi.c \ - time.c +SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \ + libefi.c time.c CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE_ARCH:S/amd64/i386/} Added: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/efi/libefi/efipart.c Sat Jan 9 22:54:29 2010 (r201941) @@ -0,0 +1,265 @@ +/*- + * Copyright (c) 2010 Marcel Moolenaar + * 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 + +static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL; + +static int efipart_init(void); +static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *); +static int efipart_open(struct open_file *, ...); +static int efipart_close(struct open_file *); +static void efipart_print(int); + +struct devsw efipart_dev = { + .dv_name = "part", + .dv_type = DEVT_DISK, + .dv_init = efipart_init, + .dv_strategy = efipart_strategy, + .dv_open = efipart_open, + .dv_close = efipart_close, + .dv_ioctl = noioctl, + .dv_print = efipart_print, + .dv_cleanup = NULL +}; + +static int +efipart_init(void) +{ + EFI_BLOCK_IO *blkio; + EFI_HANDLE *hin, *hout; + EFI_STATUS status; + UINTN sz; + u_int n, nin, nout; + int err; + + sz = 0; + status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0); + if (status == EFI_BUFFER_TOO_SMALL) { + hin = (EFI_HANDLE *)malloc(sz * 2); + status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, + hin); + if (EFI_ERROR(status)) + free(hin); + } + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + /* Filter handles to only include FreeBSD partitions. */ + nin = sz / sizeof(EFI_HANDLE); + hout = hin + nin; + nout = 0; + + for (n = 0; n < nin; n++) { + status = BS->HandleProtocol(hin[n], &blkio_guid, &blkio); + if (EFI_ERROR(status)) + continue; + if (!blkio->Media->LogicalPartition) + continue; + hout[nout] = hin[n]; + nout++; + } + + err = efi_register_handles(&efipart_dev, hout, nout); + free(hin); + return (err); +} + +static void +efipart_print(int verbose) +{ + char line[80]; + EFI_BLOCK_IO *blkio; + EFI_HANDLE h; + EFI_STATUS status; + u_int unit; + + for (unit = 0, h = efi_find_handle(&efipart_dev, 0); + h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) { + sprintf(line, " %s%d:", efipart_dev.dv_name, unit); + pager_output(line); + + status = BS->HandleProtocol(h, &blkio_guid, &blkio); + if (!EFI_ERROR(status)) { + sprintf(line, " %llu blocks", + (unsigned long long)(blkio->Media->LastBlock + 1)); + pager_output(line); + if (blkio->Media->RemovableMedia) + pager_output(" (removable)"); + } + pager_output("\n"); + } +} + +static int +efipart_open(struct open_file *f, ...) +{ + va_list args; + struct devdesc *dev; + EFI_BLOCK_IO *blkio; + EFI_HANDLE h; + EFI_STATUS status; + + va_start(args, f); + dev = va_arg(args, struct devdesc*); + va_end(args); + + h = efi_find_handle(&efipart_dev, dev->d_unit); + if (h == NULL) + return (EINVAL); + + status = BS->HandleProtocol(h, &blkio_guid, &blkio); + if (EFI_ERROR(status)) + return (efi_status_to_errno(status)); + + if (!blkio->Media->MediaPresent) + return (EAGAIN); + + dev->d_opendata = blkio; + return (0); +} + +static int +efipart_close(struct open_file *f) +{ + struct devdesc *dev; + + dev = (struct devdesc *)(f->f_devdata); + if (dev->d_opendata == NULL) + return (EINVAL); + + dev->d_opendata = NULL; + return (0); +} + +/* + * efipart_readwrite() + * Internal equivalent of efipart_strategy(), which operates on the + * media-native block size. This function expects all I/O requests + * to be within the media size and returns an error if such is not + * the case. + */ +static int +efipart_readwrite(EFI_BLOCK_IO *blkio, int rw, daddr_t blk, daddr_t nblks, + char *buf) +{ + EFI_STATUS status; + + if (blkio == NULL) + return (ENXIO); + if (blk < 0 || blk > blkio->Media->LastBlock) + return (EIO); + if ((blk + nblks - 1) > blkio->Media->LastBlock) + return (EIO); + + switch (rw) { + case F_READ: + status = blkio->ReadBlocks(blkio, blkio->Media->MediaId, blk, + nblks * blkio->Media->BlockSize, buf); + break; + case F_WRITE: + if (blkio->Media->ReadOnly) + return (EROFS); + status = blkio->WriteBlocks(blkio, blkio->Media->MediaId, blk, + nblks * blkio->Media->BlockSize, buf); + break; + default: + return (ENOSYS); + } + + if (EFI_ERROR(status)) + printf("%s: rw=%d, status=%lu\n", __func__, rw, status); + return (efi_status_to_errno(status)); +} + +static int +efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf, + size_t *rsize) +{ + struct devdesc *dev = (struct devdesc *)devdata; + EFI_BLOCK_IO *blkio; + off_t off; + char *blkbuf; + size_t blkoff, blksz; + int error; + + if (dev == NULL || blk < 0) + return (EINVAL); + + blkio = dev->d_opendata; + if (blkio == NULL) + return (ENXIO); + + if (size == 0 || (size % 512) != 0) + return (EIO); + + if (rsize != NULL) + *rsize = size; + + if (blkio->Media->BlockSize == 512) + return (efipart_readwrite(blkio, rw, blk, size / 512, buf)); + + /* + * The block size of the media is not 512B per sector. + */ + blkbuf = malloc(blkio->Media->BlockSize); + if (blkbuf == NULL) + return (ENOMEM); + + error = 0; + off = blk * 512; + blk = off / blkio->Media->BlockSize; + blkoff = off % blkio->Media->BlockSize; + blksz = blkio->Media->BlockSize - blkoff; + while (size > 0) { + error = efipart_readwrite(blkio, rw, blk, 1, blkbuf); + if (error) + break; + if (size < blksz) + blksz = size; + bcopy(blkbuf + blkoff, buf, blksz); + buf += blksz; + size -= blksz; + blk++; + blkoff = 0; + blksz = blkio->Media->BlockSize; + } + + free(blkbuf); + return (error); +} Modified: head/sys/boot/ia64/efi/conf.c ============================================================================== --- head/sys/boot/ia64/efi/conf.c Sat Jan 9 22:47:40 2010 (r201940) +++ head/sys/boot/ia64/efi/conf.c Sat Jan 9 22:54:29 2010 (r201941) @@ -49,15 +49,16 @@ __FBSDID("$FreeBSD$"); /* Exported for libstand */ struct devsw *devsw[] = { - &efifs_dev, + &efipart_dev, &efinet_dev, NULL }; struct fs_ops *file_system[] = { - &efifs_fsops, - &nfs_fsops, + &dosfs_fsops, &ufs_fsops, + &cd9660_fsops, + &nfs_fsops, &gzipfs_fsops, NULL }; Modified: head/sys/boot/ia64/efi/version ============================================================================== --- head/sys/boot/ia64/efi/version Sat Jan 9 22:47:40 2010 (r201940) +++ head/sys/boot/ia64/efi/version Sat Jan 9 22:54:29 2010 (r201941) @@ -3,6 +3,9 @@ $FreeBSD$ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important. Make sure the current version number is on line 6. +2.0: Provide devices based on the block I/O protocol, rather than the + simple file services protocol. Use the FreeBSD file system code + on top of those devices to access files. 1.2: Restructured. Has some user visible differences. 1.1: Pass the HCDP table address to the kernel via bootinfo if one is present in the EFI system table. From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:04:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1E5F1065672; Sat, 9 Jan 2010 23:04:24 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FE998FC13; Sat, 9 Jan 2010 23:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09N4Opk042167; Sat, 9 Jan 2010 23:04:24 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09N4OxO042157; Sat, 9 Jan 2010 23:04:24 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092304.o09N4OxO042157@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 23:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201945 - vendor/one-true-awk/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:04:24 -0000 Author: ru Date: Sat Jan 9 23:04:24 2010 New Revision: 201945 URL: http://svn.freebsd.org/changeset/base/201945 Log: Vendor import of bwk's 26-Nov-2009 release. Modified: vendor/one-true-awk/dist/FIXES vendor/one-true-awk/dist/b.c vendor/one-true-awk/dist/lib.c vendor/one-true-awk/dist/main.c vendor/one-true-awk/dist/makefile vendor/one-true-awk/dist/maketab.c vendor/one-true-awk/dist/proctab.c vendor/one-true-awk/dist/proto.h vendor/one-true-awk/dist/run.c Modified: vendor/one-true-awk/dist/FIXES ============================================================================== --- vendor/one-true-awk/dist/FIXES Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/FIXES Sat Jan 9 23:04:24 2010 (r201945) @@ -25,6 +25,23 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Nov 26, 2009: + fixed a long-standing issue with when FS takes effect. a + change to FS is now noticed immediately for subsequent splits. + + changed the name getline() to awkgetline() to avoid yet another + name conflict somewhere. + +Feb 11, 2009: + temporarily for now defined HAS_ISBLANK, since that seems to + be the best way through the thicket. isblank arrived in C99, + but seems to be arriving at different systems at different + times. + +Oct 8, 2008: + fixed typo in b.c that set tmpvec wrongly. no one had ever + run into the problem, apparently. thanks to alistair crooks. + Oct 23, 2007: minor fix in lib.c: increase inputFS to 100, change malloc for fields to n+1. Modified: vendor/one-true-awk/dist/b.c ============================================================================== --- vendor/one-true-awk/dist/b.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/b.c Sat Jan 9 23:04:24 2010 (r201945) @@ -731,6 +731,7 @@ Node *unary(Node *np) * to nelson beebe for the suggestion; let's see if it works everywhere. */ +/* #define HAS_ISBLANK */ #ifndef HAS_ISBLANK int (isblank)(int c) @@ -876,7 +877,7 @@ int cgoto(fa *f, int s, int c) if (q[j] >= maxsetvec) { maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); - tmpset = (int *) realloc(setvec, maxsetvec * sizeof(int)); + tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); if (setvec == 0 || tmpset == 0) overflo("cgoto overflow"); } Modified: vendor/one-true-awk/dist/lib.c ============================================================================== --- vendor/one-true-awk/dist/lib.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/lib.c Sat Jan 9 23:04:24 2010 (r201945) @@ -274,6 +274,7 @@ void fldbld(void) /* create fields from } fr = fields; i = 0; /* number of fields accumulated here */ + strcpy(inputFS, *FS); if (strlen(inputFS) > 1) { /* it's a regular expression */ i = refldbld(r, inputFS); } else if ((sep = *inputFS) == ' ') { /* default whitespace */ Modified: vendor/one-true-awk/dist/main.c ============================================================================== --- vendor/one-true-awk/dist/main.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/main.c Sat Jan 9 23:04:24 2010 (r201945) @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20070501"; +const char *version = "version 20091126"; #define DEBUG #include Modified: vendor/one-true-awk/dist/makefile ============================================================================== --- vendor/one-true-awk/dist/makefile Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/makefile Sat Jan 9 23:04:24 2010 (r201945) @@ -31,7 +31,6 @@ CC = gcc -fprofile-arcs -ftest-coverage CC = gcc -Wall -g CC = cc CC = gcc -O4 -CC = gcc -Wall -g YACC = bison -y Modified: vendor/one-true-awk/dist/maketab.c ============================================================================== --- vendor/one-true-awk/dist/maketab.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/maketab.c Sat Jan 9 23:04:24 2010 (r201945) @@ -102,7 +102,7 @@ struct xx { CALL, "call", "call" }, { ARG, "arg", "arg" }, { VARNF, "getnf", "NF" }, - { GETLINE, "getline", "getline" }, + { GETLINE, "awkgetline", "getline" }, { 0, "", "" }, }; Modified: vendor/one-true-awk/dist/proctab.c ============================================================================== --- vendor/one-true-awk/dist/proctab.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/proctab.c Sat Jan 9 23:04:24 2010 (r201945) @@ -180,7 +180,7 @@ Cell *(*proctab[93])(Node **, int) = { nullproc, /* NUMBER */ nullproc, /* STRING */ nullproc, /* REGEXPR */ - getline, /* GETLINE */ + awkgetline, /* GETLINE */ substr, /* SUBSTR */ split, /* SPLIT */ jump, /* RETURN */ Modified: vendor/one-true-awk/dist/proto.h ============================================================================== --- vendor/one-true-awk/dist/proto.h Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/proto.h Sat Jan 9 23:04:24 2010 (r201945) @@ -149,7 +149,7 @@ extern Cell *call(Node **, int); extern Cell *copycell(Cell *); extern Cell *arg(Node **, int); extern Cell *jump(Node **, int); -extern Cell *getline(Node **, int); +extern Cell *awkgetline(Node **, int); extern Cell *getnf(Node **, int); extern Cell *array(Node **, int); extern Cell *awkdelete(Node **, int); Modified: vendor/one-true-awk/dist/run.c ============================================================================== --- vendor/one-true-awk/dist/run.c Sat Jan 9 23:02:49 2010 (r201944) +++ vendor/one-true-awk/dist/run.c Sat Jan 9 23:04:24 2010 (r201945) @@ -388,7 +388,7 @@ Cell *jump(Node **a, int n) /* break, co return 0; /* not reached */ } -Cell *getline(Node **a, int n) /* get next line from specific input */ +Cell *awkgetline(Node **a, int n) /* get next line from specific input */ { /* a[0] is variable, a[1] is operator, a[2] is filename */ Cell *r, *x; extern Cell **fldtab; @@ -1159,11 +1159,11 @@ Cell *cat(Node **a, int q) /* a[0] cat a x->sval, y->sval); strcpy(s, x->sval); strcpy(s+n1, y->sval); + tempfree(x); tempfree(y); z = gettemp(); z->sval = s; z->tval = STR; - tempfree(x); return(z); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:06:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13560106566B; Sat, 9 Jan 2010 23:06:20 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB79E8FC15; Sat, 9 Jan 2010 23:06:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09N6JSe042637; Sat, 9 Jan 2010 23:06:19 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09N6J3a042636; Sat, 9 Jan 2010 23:06:19 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092306.o09N6J3a042636@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 23:06:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201946 - vendor/one-true-awk/20091126 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:06:20 -0000 Author: ru Date: Sat Jan 9 23:06:19 2010 New Revision: 201946 URL: http://svn.freebsd.org/changeset/base/201946 Log: Tag a 20091126 release. Added: vendor/one-true-awk/20091126/ - copied from r201945, vendor/one-true-awk/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:19:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795C3106577F; Sat, 9 Jan 2010 23:19:01 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 672B68FC21; Sat, 9 Jan 2010 23:19:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NJ15P045635; Sat, 9 Jan 2010 23:19:01 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NJ1c8045624; Sat, 9 Jan 2010 23:19:01 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092319.o09NJ1c8045624@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 23:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201951 - in head: contrib/one-true-awk usr.bin/awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:19:01 -0000 Author: ru Date: Sat Jan 9 23:19:01 2010 New Revision: 201951 URL: http://svn.freebsd.org/changeset/base/201951 Log: Update to a 26-Nov-2009 release. Modified: head/contrib/one-true-awk/FIXES head/contrib/one-true-awk/b.c head/contrib/one-true-awk/lib.c head/contrib/one-true-awk/main.c head/contrib/one-true-awk/makefile head/contrib/one-true-awk/maketab.c head/contrib/one-true-awk/proctab.c head/contrib/one-true-awk/proto.h head/contrib/one-true-awk/run.c head/usr.bin/awk/main.c.diff Directory Properties: head/contrib/one-true-awk/ (props changed) Modified: head/contrib/one-true-awk/FIXES ============================================================================== --- head/contrib/one-true-awk/FIXES Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/FIXES Sat Jan 9 23:19:01 2010 (r201951) @@ -25,6 +25,23 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Nov 26, 2009: + fixed a long-standing issue with when FS takes effect. a + change to FS is now noticed immediately for subsequent splits. + + changed the name getline() to awkgetline() to avoid yet another + name conflict somewhere. + +Feb 11, 2009: + temporarily for now defined HAS_ISBLANK, since that seems to + be the best way through the thicket. isblank arrived in C99, + but seems to be arriving at different systems at different + times. + +Oct 8, 2008: + fixed typo in b.c that set tmpvec wrongly. no one had ever + run into the problem, apparently. thanks to alistair crooks. + Oct 23, 2007: minor fix in lib.c: increase inputFS to 100, change malloc for fields to n+1. Modified: head/contrib/one-true-awk/b.c ============================================================================== --- head/contrib/one-true-awk/b.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/b.c Sat Jan 9 23:19:01 2010 (r201951) @@ -731,6 +731,7 @@ Node *unary(Node *np) * to nelson beebe for the suggestion; let's see if it works everywhere. */ +/* #define HAS_ISBLANK */ #ifndef HAS_ISBLANK int (isblank)(int c) @@ -876,7 +877,7 @@ int cgoto(fa *f, int s, int c) if (q[j] >= maxsetvec) { maxsetvec *= 4; setvec = (int *) realloc(setvec, maxsetvec * sizeof(int)); - tmpset = (int *) realloc(setvec, maxsetvec * sizeof(int)); + tmpset = (int *) realloc(tmpset, maxsetvec * sizeof(int)); if (setvec == 0 || tmpset == 0) overflo("cgoto overflow"); } Modified: head/contrib/one-true-awk/lib.c ============================================================================== --- head/contrib/one-true-awk/lib.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/lib.c Sat Jan 9 23:19:01 2010 (r201951) @@ -274,6 +274,7 @@ void fldbld(void) /* create fields from } fr = fields; i = 0; /* number of fields accumulated here */ + strcpy(inputFS, *FS); if (strlen(inputFS) > 1) { /* it's a regular expression */ i = refldbld(r, inputFS); } else if ((sep = *inputFS) == ' ') { /* default whitespace */ Modified: head/contrib/one-true-awk/main.c ============================================================================== --- head/contrib/one-true-awk/main.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/main.c Sat Jan 9 23:19:01 2010 (r201951) @@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE THIS SOFTWARE. ****************************************************************/ -const char *version = "version 20070501"; +const char *version = "version 20091126"; #define DEBUG #include Modified: head/contrib/one-true-awk/makefile ============================================================================== --- head/contrib/one-true-awk/makefile Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/makefile Sat Jan 9 23:19:01 2010 (r201951) @@ -31,7 +31,6 @@ CC = gcc -fprofile-arcs -ftest-coverage CC = gcc -Wall -g CC = cc CC = gcc -O4 -CC = gcc -Wall -g YACC = bison -y Modified: head/contrib/one-true-awk/maketab.c ============================================================================== --- head/contrib/one-true-awk/maketab.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/maketab.c Sat Jan 9 23:19:01 2010 (r201951) @@ -102,7 +102,7 @@ struct xx { CALL, "call", "call" }, { ARG, "arg", "arg" }, { VARNF, "getnf", "NF" }, - { GETLINE, "getline", "getline" }, + { GETLINE, "awkgetline", "getline" }, { 0, "", "" }, }; Modified: head/contrib/one-true-awk/proctab.c ============================================================================== --- head/contrib/one-true-awk/proctab.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/proctab.c Sat Jan 9 23:19:01 2010 (r201951) @@ -180,7 +180,7 @@ Cell *(*proctab[93])(Node **, int) = { nullproc, /* NUMBER */ nullproc, /* STRING */ nullproc, /* REGEXPR */ - getline, /* GETLINE */ + awkgetline, /* GETLINE */ substr, /* SUBSTR */ split, /* SPLIT */ jump, /* RETURN */ Modified: head/contrib/one-true-awk/proto.h ============================================================================== --- head/contrib/one-true-awk/proto.h Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/proto.h Sat Jan 9 23:19:01 2010 (r201951) @@ -149,7 +149,7 @@ extern Cell *call(Node **, int); extern Cell *copycell(Cell *); extern Cell *arg(Node **, int); extern Cell *jump(Node **, int); -extern Cell *getline(Node **, int); +extern Cell *awkgetline(Node **, int); extern Cell *getnf(Node **, int); extern Cell *array(Node **, int); extern Cell *awkdelete(Node **, int); Modified: head/contrib/one-true-awk/run.c ============================================================================== --- head/contrib/one-true-awk/run.c Sat Jan 9 23:18:49 2010 (r201950) +++ head/contrib/one-true-awk/run.c Sat Jan 9 23:19:01 2010 (r201951) @@ -388,7 +388,7 @@ Cell *jump(Node **a, int n) /* break, co return 0; /* not reached */ } -Cell *getline(Node **a, int n) /* get next line from specific input */ +Cell *awkgetline(Node **a, int n) /* get next line from specific input */ { /* a[0] is variable, a[1] is operator, a[2] is filename */ Cell *r, *x; extern Cell **fldtab; @@ -1159,11 +1159,11 @@ Cell *cat(Node **a, int q) /* a[0] cat a x->sval, y->sval); strcpy(s, x->sval); strcpy(s+n1, y->sval); + tempfree(x); tempfree(y); z = gettemp(); z->sval = s; z->tval = STR; - tempfree(x); return(z); } Modified: head/usr.bin/awk/main.c.diff ============================================================================== --- head/usr.bin/awk/main.c.diff Sat Jan 9 23:18:49 2010 (r201950) +++ head/usr.bin/awk/main.c.diff Sat Jan 9 23:19:01 2010 (r201951) @@ -11,8 +11,8 @@ diff -u -p -r1.1.1.10 main.c THIS SOFTWARE. ****************************************************************/ --const char *version = "version 20070501"; -+const char *version = "version 20070501 (FreeBSD)"; +-const char *version = "version 20091126"; ++const char *version = "version 20091126 (FreeBSD)"; #define DEBUG #include From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:22:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ACD2106566B; Sat, 9 Jan 2010 23:22:32 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19C518FC15; Sat, 9 Jan 2010 23:22:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NMVCb046509; Sat, 9 Jan 2010 23:22:31 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NMVSg046507; Sat, 9 Jan 2010 23:22:31 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001092322.o09NMVSg046507@svn.freebsd.org> From: Brooks Davis Date: Sat, 9 Jan 2010 23:22:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201953 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:22:32 -0000 Author: brooks Date: Sat Jan 9 23:22:31 2010 New Revision: 201953 URL: http://svn.freebsd.org/changeset/base/201953 Log: Correct the explination text for the kern.ngroups. It reflects the number of supplemental groups, not the total number of groups. MFC after: 3 days Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Jan 9 23:19:38 2010 (r201952) +++ head/sys/kern/kern_mib.c Sat Jan 9 23:22:31 2010 (r201953) @@ -125,7 +125,8 @@ SYSCTL_INT(_kern, KERN_POSIX1, posix1ver 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, - 0, NGROUPS_MAX, "Maximum number of groups a user can belong to"); + 0, NGROUPS_MAX, + "Maximum number of supplemental groups a user can belong to"); SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD, 0, 1, "Whether job control is available"); From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:23:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B3D31065670; Sat, 9 Jan 2010 23:23:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1898FC1E; Sat, 9 Jan 2010 23:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NNrsQ046844; Sat, 9 Jan 2010 23:23:53 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NNrOC046842; Sat, 9 Jan 2010 23:23:53 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001092323.o09NNrOC046842@svn.freebsd.org> From: Brooks Davis Date: Sat, 9 Jan 2010 23:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201954 - head/sys/fs/procfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:23:53 -0000 Author: brooks Date: Sat Jan 9 23:23:52 2010 New Revision: 201954 URL: http://svn.freebsd.org/changeset/base/201954 Log: Update the comment on printing group membership to reflect that fact that each groupt the process is a member of is printed rather than an entry for each group the user could be a member of. MFC after: 3 days Modified: head/sys/fs/procfs/procfs_status.c Modified: head/sys/fs/procfs/procfs_status.c ============================================================================== --- head/sys/fs/procfs/procfs_status.c Sat Jan 9 23:22:31 2010 (r201953) +++ head/sys/fs/procfs/procfs_status.c Sat Jan 9 23:23:52 2010 (r201954) @@ -82,7 +82,7 @@ procfs_doprocstatus(PFS_FILL_ARGS) sid = sess->s_leader ? sess->s_leader->p_pid : 0; /* comm pid ppid pgid sid tty ctty,sldr start ut st wmsg - euid ruid rgid,egid,groups[1 .. NGROUPS] + euid ruid rgid,egid,groups[1 .. ngroups] */ pc = p->p_comm; From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:24:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240551065672; Sat, 9 Jan 2010 23:24:50 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12F6F8FC1A; Sat, 9 Jan 2010 23:24:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NOnGe047078; Sat, 9 Jan 2010 23:24:49 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NOn2h047076; Sat, 9 Jan 2010 23:24:49 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001092324.o09NOn2h047076@svn.freebsd.org> From: Brooks Davis Date: Sat, 9 Jan 2010 23:24:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201955 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:24:50 -0000 Author: brooks Date: Sat Jan 9 23:24:49 2010 New Revision: 201955 URL: http://svn.freebsd.org/changeset/base/201955 Log: Improve the comment about CMGROUP_MAX. MFC after: 3 days Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sat Jan 9 23:23:52 2010 (r201954) +++ head/sys/sys/socket.h Sat Jan 9 23:24:49 2010 (r201955) @@ -462,8 +462,8 @@ struct cmsghdr { #if __BSD_VISIBLE /* * While we may have more groups than this, the cmsgcred struct must - * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow - * this. + * be able to fit in an mbuf and we have historically supported a + * maximum of 16 groups. */ #define CMGROUP_MAX 16 From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:34:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16DA510656BE; Sat, 9 Jan 2010 23:34:46 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0536F8FC1E; Sat, 9 Jan 2010 23:34:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NYj2b049334; Sat, 9 Jan 2010 23:34:45 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NYjuN049330; Sat, 9 Jan 2010 23:34:45 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201001092334.o09NYjuN049330@svn.freebsd.org> From: Ruslan Ermilov Date: Sat, 9 Jan 2010 23:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201957 - head/usr.bin/awk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:34:46 -0000 Author: ru Date: Sat Jan 9 23:34:45 2010 New Revision: 201957 URL: http://svn.freebsd.org/changeset/base/201957 Log: Regen diffs. Modified: head/usr.bin/awk/b.c.diff head/usr.bin/awk/main.c.diff head/usr.bin/awk/run.c.diff Modified: head/usr.bin/awk/b.c.diff ============================================================================== --- head/usr.bin/awk/b.c.diff Sat Jan 9 23:34:40 2010 (r201956) +++ head/usr.bin/awk/b.c.diff Sat Jan 9 23:34:45 2010 (r201957) @@ -2,12 +2,9 @@ $FreeBSD$ Index: b.c =================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/b.c,v -retrieving revision 1.1.1.8 -diff -u -p -r1.1.1.8 b.c ---- b.c 16 May 2005 19:11:31 -0000 1.1.1.8 -+++ b.c 16 May 2005 19:12:40 -0000 -@@ -282,9 +282,21 @@ int quoted(char **pp) /* pick up next th +--- b.c (revision 201951) ++++ b.c (working copy) +@@ -285,9 +285,21 @@ int quoted(char **pp) /* pick up next thing after return c; } @@ -29,10 +26,10 @@ diff -u -p -r1.1.1.8 b.c uschar *p = (uschar *) argp; uschar *op, *bp; static uschar *buf = 0; -@@ -303,15 +315,18 @@ char *cclenter(const char *argp) /* add +@@ -306,15 +318,18 @@ char *cclenter(const char *argp) /* add a characte c2 = *p++; if (c2 == '\\') - c2 = quoted((char **) &p); + c2 = quoted((char **) &p); - if (c > c2) { /* empty; ignore */ + if (collate_range_cmp(c, c2) > 0) { bp--; @@ -44,8 +41,8 @@ diff -u -p -r1.1.1.8 b.c + if ((collate_range_cmp(c, j) > 0) || + collate_range_cmp(j, c2) > 0) + continue; - if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) - FATAL("out of space for character class [%.10s...] 2", p); + if (!adjbuf((char **) &buf, &bufsz, bp-buf+2, 100, (char **) &bp, "cclenter1")) + FATAL("out of space for character class [%.10s...] 2", p); - *bp++ = ++c; + *bp++ = j; i++; Modified: head/usr.bin/awk/main.c.diff ============================================================================== --- head/usr.bin/awk/main.c.diff Sat Jan 9 23:34:40 2010 (r201956) +++ head/usr.bin/awk/main.c.diff Sat Jan 9 23:34:45 2010 (r201957) @@ -2,12 +2,9 @@ $FreeBSD$ Index: main.c =================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/main.c,v -retrieving revision 1.1.1.10 -diff -u -p -r1.1.1.10 main.c ---- main.c 16 May 2005 19:11:31 -0000 1.1.1.10 -+++ main.c 15 Sep 2006 13:21:30 -0000 -@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE +--- main.c (revision 201951) ++++ main.c (working copy) +@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PE THIS SOFTWARE. ****************************************************************/ @@ -24,7 +21,7 @@ diff -u -p -r1.1.1.10 main.c setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = argv[0]; if (argc == 1) { -@@ -79,13 +80,18 @@ int main(int argc, char *argv[]) +@@ -86,13 +87,18 @@ int main(int argc, char *argv[]) safe = 1; break; case 'f': /* next argument is program filename */ @@ -50,7 +47,7 @@ diff -u -p -r1.1.1.10 main.c break; case 'F': /* set field separator */ if (argv[1][2] != 0) { /* arg is -Fsomething */ -@@ -104,8 +110,14 @@ int main(int argc, char *argv[]) +@@ -111,8 +117,14 @@ int main(int argc, char *argv[]) WARNING("field separator FS is empty"); break; case 'v': /* -v a=1 to be done NOW. one -v for each */ @@ -65,5 +62,5 @@ diff -u -p -r1.1.1.10 main.c + setclvar(argv[1]); + } break; - case 'm': /* more memory: -mr=record, -mf=fields */ - /* no longer supported */ + case 'd': + dbg = atoi(&argv[1][2]); Modified: head/usr.bin/awk/run.c.diff ============================================================================== --- head/usr.bin/awk/run.c.diff Sat Jan 9 23:34:40 2010 (r201956) +++ head/usr.bin/awk/run.c.diff Sat Jan 9 23:34:45 2010 (r201957) @@ -2,12 +2,9 @@ $FreeBSD$ Index: run.c =================================================================== -RCS file: /home/ncvs/src/contrib/one-true-awk/run.c,v -retrieving revision 1.1.1.8 -diff -u -p -r1.1.1.8 run.c ---- run.c 16 May 2005 19:11:35 -0000 1.1.1.8 -+++ run.c 16 May 2005 19:12:47 -0000 -@@ -651,7 +651,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[ +--- run.c (revision 201951) ++++ run.c (working copy) +@@ -653,7 +653,7 @@ Cell *relop(Node **a, int n) /* a[0 < a[1], etc. * j = x->fval - y->fval; i = j<0? -1: (j>0? 1: 0); } else { From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:36:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11A12106568F; Sat, 9 Jan 2010 23:36:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 007B18FC20; Sat, 9 Jan 2010 23:36:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09Naph9049872; Sat, 9 Jan 2010 23:36:51 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NapP4049870; Sat, 9 Jan 2010 23:36:51 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201001092336.o09NapP4049870@svn.freebsd.org> From: Brooks Davis Date: Sat, 9 Jan 2010 23:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201959 - head/lib/libc/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:36:52 -0000 Author: brooks Date: Sat Jan 9 23:36:51 2010 New Revision: 201959 URL: http://svn.freebsd.org/changeset/base/201959 Log: Use the correct types to store uids and gids in the credential cache. Modified: head/lib/libc/rpc/svc_auth_des.c Modified: head/lib/libc/rpc/svc_auth_des.c ============================================================================== --- head/lib/libc/rpc/svc_auth_des.c Sat Jan 9 23:36:15 2010 (r201958) +++ head/lib/libc/rpc/svc_auth_des.c Sat Jan 9 23:36:51 2010 (r201959) @@ -449,10 +449,10 @@ cache_spot(key, name, timestamp) #define INVALID -1 /* grouplen, if cache entry is invalid */ struct bsdcred { - short uid; /* cached uid */ - short gid; /* cached gid */ - short grouplen; /* length of cached groups */ - short groups[NGROUPS]; /* cached groups */ + uid_t uid; /* cached uid */ + gid_t gid; /* cached gid */ + int grouplen; /* length of cached groups */ + gid_t groups[NGRPS]; /* cached groups */ }; /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 9 23:37:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE7C106568D; Sat, 9 Jan 2010 23:37:29 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9FE18FC1A; Sat, 9 Jan 2010 23:37:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o09NbTat050044; Sat, 9 Jan 2010 23:37:29 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o09NbTtd050042; Sat, 9 Jan 2010 23:37:29 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201001092337.o09NbTtd050042@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 9 Jan 2010 23:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201960 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2010 23:37:29 -0000 Author: bz Date: Sat Jan 9 23:37:29 2010 New Revision: 201960 URL: http://svn.freebsd.org/changeset/base/201960 Log: Use uname -m [1] and rename BUILD_ARCH to XMACHINE[2]. Submitted by: nyan[1], imp[2] MFC after: 27 days X-MFC with: r201815 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Jan 9 23:36:51 2010 (r201959) +++ head/Makefile Sat Jan 9 23:37:29 2010 (r201960) @@ -321,8 +321,8 @@ universe_${target}: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs -BUILD_ARCH!= uname -p -TARGET?= ${BUILD_ARCH} +XMACHINE!= uname -m +TARGET?= ${XMACHINE} KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES