Re: svn commit: r249334 - head/usr.bin/ctlstat
On Wed, 10 Apr 2013, Kenneth D. Merry wrote: Log: Fix a time calculation error in ctlstat_standard(). ctlstat.c: When converting a timeval to a floating point number in ctlstat_standard(), cast the nanoseconds calculation to a long double, so we don't lose precision. Without the cast, we wind up with a time in whole seconds only. ... Modified: head/usr.bin/ctlstat/ctlstat.c == --- head/usr.bin/ctlstat/ctlstat.c Wed Apr 10 11:26:30 2013 (r249333) +++ head/usr.bin/ctlstat/ctlstat.c Wed Apr 10 16:01:45 2013 (r249334) @@ -416,9 +416,10 @@ ctlstat_standard(struct ctlstat_context if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) errx(1, "error returned from getcpu()"); - cur_secs = ctx->cur_time.tv_sec + (ctx->cur_time.tv_nsec / 10); + cur_secs = ctx->cur_time.tv_sec + + ((long double)ctx->cur_time.tv_nsec / 10); prev_secs = ctx->prev_time.tv_sec + -(ctx->prev_time.tv_nsec / 10); +((long double)ctx->prev_time.tv_nsec / 10); etime = cur_secs - prev_secs; long double is rarely necessary. It mainly asks for slowness (10-50%) on i386 and extreme slowness (hundreds of times slower) on space64. Double precision is plenty. Many arches in FreeBSD have long double == double, so you can't depend on long double being more precise than double, and statistics utilities are especially not in need of much precision. (Float precision would be enough here. It would be accurate to 1/16 of a microsecond. Not to 1 nanosecond, but you don't need that. The integer division was only accurate to 1/4 second, so ist error was noticeable.) There is no need for any casts. There is no need for any divisions. Simply multiply by 1 nanosecond. This must be in floating point, since integers can't represent 1 nanosecond (neither can floating, but the error of ~2**-53 nanosecnds for double precision is neglogible). When 1 nanosecond is in a floating point literal, the whole expression is automatically promoted correctly. Other style bugs in the above: - non-KNF indentation (1 tab) for the newly split line - different non-KNF indentation (5 spaces) for the previously split line - exessive parentheses around the division operation - bogus blank line which splits up the etime initialization - general verboseness from the above. Fixing these gives: cur_secs = ctx->cur_time.tv_sec + ctx->cur_time.tv_nsec * 1e-9; prev_secs = ctx->prev_time.tv_sec + ctx->prev_time.tv_nsec * 1e-9 etime = cur_secs - prev_secs; It is now clear that this is still too verbose, since cur_secs and prev_secs are not used except to initialize etime. Simplifying this gives: etime = ctx->cur_time.tv_sec - ctx->prev_time.tv_sec + (ctx->prev_time.tv_nsec - ctx->cur_time.tv_nsec) * 1e-9; This might need casting to double of ctx->cur_time.tv_sec, in case time_t is unsigned and the time went backwards. Otherwise, this should be the usual expression for subtracting timespecs. Bruce ___ 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-unsubscr...@freebsd.org"
svn commit: r249355 - head/lib/libkvm
Author: glebius Date: Thu Apr 11 07:30:49 2013 New Revision: 249355 URL: http://svnweb.freebsd.org/changeset/base/249355 Log: Include types.h for C99 uintXX_t types. Modified: head/lib/libkvm/kvm.h Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Thu Apr 11 07:02:27 2013(r249354) +++ head/lib/libkvm/kvm.h Thu Apr 11 07:30:49 2013(r249355) @@ -34,7 +34,7 @@ #define_KVM_H_ #include -#include +#include #include /* Default version symbol. */ ___ 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-unsubscr...@freebsd.org"
svn commit: r249356 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: mm Date: Thu Apr 11 07:40:30 2013 New Revision: 249356 URL: http://svnweb.freebsd.org/changeset/base/249356 Log: MFV r249354: Merge bugfixes accepted and integrated by vendor. Underlying problems have been reported by us and fixed in r240942 and r249196. Illumos ZFS issues: 3645 dmu_send_impl: possibilty of pool hold leak 3692 Panic on zfs receive of a recursive deduplicated stream MFC after:8 days Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) 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 Apr 11 07:30:49 2013(r249355) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Thu Apr 11 07:40:30 2013(r249356) @@ -1692,7 +1692,7 @@ add_ds_to_guidmap(const char *name, avl_ err = dsl_pool_hold(name, FTAG, &dp); if (err != 0) return (err); - gmep = kmem_alloc(sizeof (guid_map_entry_t), KM_SLEEP); + gmep = kmem_alloc(sizeof (*gmep), KM_SLEEP); err = dsl_dataset_hold_obj(dp, snapobj, gmep, &snapds); if (err == 0) { gmep->guid = snapds->ds_phys->ds_guid; @@ -1700,7 +1700,7 @@ add_ds_to_guidmap(const char *name, avl_ avl_add(guid_map, gmep); dsl_dataset_long_hold(snapds, gmep); } else - kmem_free(gmep, sizeof (guid_map_entry_t)); + kmem_free(gmep, sizeof (*gmep)); dsl_pool_rele(dp, FTAG); return (err); ___ 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-unsubscr...@freebsd.org"
svn commit: r249357 - head/cddl/contrib/opensolaris/lib/libzfs/common
Author: mm Date: Thu Apr 11 07:49:16 2013 New Revision: 249357 URL: http://svnweb.freebsd.org/changeset/base/249357 Log: Fix libzfs to report error instead of returning zero if trying to hold or release a non-existing snapshot of a existing dataset. In recursive case error is reported if no snapshots with the requested name have been found. Problem and proposed solution reported to illumos: 3699 zfs hold or release of a non-existent snapshot does not output error MFC after:8 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c == --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cThu Apr 11 07:40:30 2013(r249356) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.cThu Apr 11 07:49:16 2013(r249357) @@ -4203,6 +4203,17 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.tag = tag; ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); + + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + fnvlist_free(ha.nvl); + ret = ENOENT; + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + return (ret); + } + ret = lzc_hold(ha.nvl, cleanup_fd, &errors); fnvlist_free(ha.nvl); @@ -4304,12 +4315,25 @@ zfs_release(zfs_handle_t *zhp, const cha nvlist_t *errors; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); + + if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + fnvlist_free(ha.nvl); + ret = ENOENT; + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot release hold from snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + return (ret); + } + ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); @@ -4318,8 +4342,6 @@ zfs_release(zfs_handle_t *zhp, const cha if (nvlist_next_nvpair(errors, NULL) == NULL) { /* no hold-specific errors */ - char errbuf[1024]; - (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); switch (errno) { @@ -4336,8 +4358,6 @@ zfs_release(zfs_handle_t *zhp, const cha for (elem = nvlist_next_nvpair(errors, NULL); elem != NULL; elem = nvlist_next_nvpair(errors, elem)) { - char errbuf[1024]; - (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s'"), ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
Log: Include types.h for C99 uintXX_t types. This adds namespace pollution that was carefully left out. Modified: head/lib/libkvm/kvm.h Modified: head/lib/libkvm/kvm.h == --- head/lib/libkvm/kvm.h Thu Apr 11 07:02:27 2013(r249354) +++ head/lib/libkvm/kvm.h Thu Apr 11 07:30:49 2013(r249355) @@ -34,7 +34,7 @@ #define _KVM_H_ #include -#include The __uintXX_t types are declared here, and should be used, like the __Xsize_t types already are. +#include #include /* Default version symbol. */ Hmm, I never got around to committing the cleaning of . It only takes 1 forward declaration and perhaps fixing clients that depend on the pollution. % Index: kvm.h % === % RCS file: /home/ncvs/src/lib/libkvm/kvm.h,v % retrieving revision 1.16 % diff -u -2 -r1.16 kvm.h % --- kvm.h 13 Oct 2003 04:44:55 - 1.16 % +++ kvm.h 13 Oct 2003 04:46:29 - % @@ -40,5 +40,4 @@ % #include % #include % -#include % % /* Default version symbol. */ % @@ -59,4 +58,5 @@ % % struct kinfo_proc; % +struct nlist; % struct proc; % Bruce ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
Bruce, On Thu, Apr 11, 2013 at 05:59:24PM +1000, Bruce Evans wrote: B> > Modified: B> > head/lib/libkvm/kvm.h B> > B> > Modified: head/lib/libkvm/kvm.h B> > == B> > --- head/lib/libkvm/kvm.h Thu Apr 11 07:02:27 2013(r249354) B> > +++ head/lib/libkvm/kvm.h Thu Apr 11 07:30:49 2013(r249355) B> > @@ -34,7 +34,7 @@ B> > #define_KVM_H_ B> > B> > #include B> > -#include B> B> The __uintXX_t types are declared here, and should be used, like the B> __Xsize_t types already are. Why non-standard types should be used instead of standard ones? -- Totus tuus, Glebius. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On Thu, 11 Apr 2013, Gleb Smirnoff wrote: On Thu, Apr 11, 2013 at 05:59:24PM +1000, Bruce Evans wrote: B> > Modified: B> > head/lib/libkvm/kvm.h B> > B> > Modified: head/lib/libkvm/kvm.h B> > == B> > --- head/lib/libkvm/kvm.hThu Apr 11 07:02:27 2013(r249354) B> > +++ head/lib/libkvm/kvm.hThu Apr 11 07:30:49 2013(r249355) B> > @@ -34,7 +34,7 @@ B> > #define _KVM_H_ B> > B> > #include B> > -#include B> B> The __uintXX_t types are declared here, and should be used, like the B> __Xsize_t types already are. Why non-standard types should be used instead of standard ones? Sometimes because the namespace doesn't allow the standard ones, but here I was just saying to typedef just the standard ones that you need (only uint64_t?) as is done for size_t and ssize_t. Including also turns the careful ifdefs for the latter into no-ops. Bruce ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On Thu, Apr 11, 2013 at 06:49:02PM +1000, Bruce Evans wrote: B> > On Thu, Apr 11, 2013 at 05:59:24PM +1000, Bruce Evans wrote: B> > B> > Modified: B> > B> > head/lib/libkvm/kvm.h B> > B> > B> > B> > Modified: head/lib/libkvm/kvm.h B> > B> > == B> > B> > --- head/lib/libkvm/kvm.h Thu Apr 11 07:02:27 2013 (r249354) B> > B> > +++ head/lib/libkvm/kvm.h Thu Apr 11 07:30:49 2013 (r249355) B> > B> > @@ -34,7 +34,7 @@ B> > B> > #define _KVM_H_ B> > B> > B> > B> > #include B> > B> > -#include B> > B> B> > B> The __uintXX_t types are declared here, and should be used, like the B> > B> __Xsize_t types already are. B> > B> > Why non-standard types should be used instead of standard ones? B> B> Sometimes because the namespace doesn't allow the standard ones, but B> here I was just saying to typedef just the standard ones that you need B> (only uint64_t?) as is done for size_t and ssize_t. Including B> also turns the careful ifdefs for the latter into B> no-ops. What was the reason to avoid including types.h and typedefing size_t and ssize_t manually? -- Totus tuus, Glebius. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249352 - head/sys/cam/scsi
woohoo! -Alfred On 4/10/13 11:34 PM, Alexander Motin wrote: Author: mav Date: Thu Apr 11 06:34:41 2013 New Revision: 249352 URL: http://svnweb.freebsd.org/changeset/base/249352 Log: Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses. Some failing disks tend to return vendor-specific ASC/ASCQ codes with NOT READY sense key. It caused extremely long recovery attempts, repeating these 120 TURs (it takes at least 1 minute) for every I/O request. Instead of that use default error handling, doing just few retries. Reviewed by: ken, gibbs MFC after: 1 month Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c == --- head/sys/cam/scsi/scsi_all.cThu Apr 11 04:29:45 2013 (r249351) +++ head/sys/cam/scsi/scsi_all.cThu Apr 11 06:34:41 2013 (r249352) @@ -699,10 +699,7 @@ const struct sense_key_table_entry sense { { SSD_KEY_NO_SENSE, SS_NOP, "NO SENSE" }, { SSD_KEY_RECOVERED_ERROR, SS_NOP|SSQ_PRINT_SENSE, "RECOVERED ERROR" }, - { - SSD_KEY_NOT_READY, SS_TUR|SSQ_MANY|SSQ_DECREMENT_COUNT|EBUSY, - "NOT READY" - }, + { SSD_KEY_NOT_READY, SS_RDEF, "NOT READY" }, { SSD_KEY_MEDIUM_ERROR, SS_RDEF, "MEDIUM ERROR" }, { SSD_KEY_HARDWARE_ERROR, SS_RDEF, "HARDWARE FAILURE" }, { SSD_KEY_ILLEGAL_REQUEST, SS_FATAL|EINVAL, "ILLEGAL REQUEST" }, @@ -877,7 +874,7 @@ static struct asc_table_entry asc_table[ { SST(0x03, 0x02, SS_RDEF, "Excessive write errors") }, /* DTLPWROMAEBKVF */ - { SST(0x04, 0x00, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EIO, + { SST(0x04, 0x00, SS_RDEF, "Logical unit not ready, cause not reportable") }, /* DTLPWROMAEBKVF */ { SST(0x04, 0x01, SS_TUR | SSQ_MANY | SSQ_DECREMENT_COUNT | EBUSY, ___ 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-unsubscr...@freebsd.org"
svn commit: r249358 - head/lib/libkvm
Author: glebius Date: Thu Apr 11 10:14:28 2013 New Revision: 249358 URL: http://svnweb.freebsd.org/changeset/base/249358 Log: Fix typo. Modified: head/lib/libkvm/Makefile Modified: head/lib/libkvm/Makefile == --- head/lib/libkvm/MakefileThu Apr 11 07:49:16 2013(r249357) +++ head/lib/libkvm/MakefileThu Apr 11 10:14:28 2013(r249358) @@ -28,7 +28,7 @@ MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 MLINKS+=kvm_getpcpu.3 kvm_getmaxcpu.3 \ kvm_getpcpu.3 kvm_dpcpu_setcpu.3 \ kvm_getpcpu.3 kvm_read_zpcpu.3 \ - kvm_getpcpu.3 kvm_counter_u64_fetch + kvm_getpcpu.3 kvm_counter_u64_fetch.3 MLINKS+=kvm_getprocs.3 kvm_getargv.3 kvm_getprocs.3 kvm_getenvv.3 MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_openfiles.3 MLINKS+=kvm_read.3 kvm_write.3 ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On Thu, 11 Apr 2013, Gleb Smirnoff wrote: On Thu, Apr 11, 2013 at 06:49:02PM +1000, Bruce Evans wrote: B> > On Thu, Apr 11, 2013 at 05:59:24PM +1000, Bruce Evans wrote: B> > B> > Modified: B> > B> > head/lib/libkvm/kvm.h B> > B> > B> > B> > Modified: head/lib/libkvm/kvm.h B> > B> > == B> > B> > --- head/lib/libkvm/kvm.h Thu Apr 11 07:02:27 2013(r249354) B> > B> > +++ head/lib/libkvm/kvm.h Thu Apr 11 07:30:49 2013(r249355) B> > B> > @@ -34,7 +34,7 @@ B> > B> > #define _KVM_H_ B> > B> > B> > B> > #include B> > B> > -#include B> > B> B> > B> The __uintXX_t types are declared here, and should be used, like the B> > B> __Xsize_t types already are. B> > B> > Why non-standard types should be used instead of standard ones? B> B> Sometimes because the namespace doesn't allow the standard ones, but B> here I was just saying to typedef just the standard ones that you need B> (only uint64_t?) as is done for size_t and ssize_t. Including B> also turns the careful ifdefs for the latter into B> no-ops. What was the reason to avoid including types.h and typedefing size_t and ssize_t manually? Just routine avoidance of namespace pollution. This is easy in such a simple header. In 4.4BSD, kvm.h only included nlist.h and (redundantly) sys/cdefs.h. Its read/write functions returned int and took unsigned count args, with the latter not abbreviated as u_int, so it didn't need size_t or ssize_t and didn't depend on sys/types.h. FreeBSD broke this by using size_t and ssize_t for its read/write functions, without even polluting it by including sys/types.h, so it grew a dependency on sys/types.h. Its old and new dependencies were and remain undocumented. I fixed this using the typedefs (the old 4.4BSD ones in , where many fewer than now had underscored versions but ones for these 2 were already there). I was fixing lots of namespace pollution at the time including automatically detecting new prerequisites but not new pollution for many headers. So its namespace grew minimally. Its old and new namespace were and remain undocumented. If it were a POSIX header, then it would be specified to to declare size_t and ssize_t and to reserve kvm_, and not much else. Except newer versions of POSIX tend to be broken and say "the foo.h header may make visible all of the symbols in [a long list of headers]". POSIX has always allowed all symbols ending in _t to be declared as a typedef in any header, so including sys/types.h would not be not namespace pollution for it. However, FreeBSD's sys/types.h declares many other symbols. So many that they are hard to list and harder to document. The list of symbols declared in or reserved for for kvm.h is fairly short: - size_t, ssize_t and kvm_*, as above - all symbols in nlist.h. This is a bug, but nlist.h is fairly clean - VRS_SYM and VRS_KEY. These probably shouldn't be public. They are not documented in kvm.h of course. - struct tags kinfo_proc and proc - struct member names ksw_* - SWIF_DEV_PREFIX. This is needed for using kvm_getswapinfo(), but it is not documented. More precisely, it is misdocumented as "the flags argument is currently unused and must be 0", but the flags argument is used for this flag. This flag is passed mainly by pstat/pstat.c. Your change to use uint64_t without declaring it gave a new prerequisite just like the old change that I fixed. It is interesting that the problem was found much more quickly. It lived for 3 months in 1998. Now there is the tinderbox to find such problems, and apparently less pollution that hides them. Bruce ___ 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-unsubscr...@freebsd.org"
svn commit: r249359 - head/usr.bin/fstat
Author: eadler Date: Thu Apr 11 12:24:29 2013 New Revision: 249359 URL: http://svnweb.freebsd.org/changeset/base/249359 Log: fuser(1) requires a filename. Reviewed by: lstewart Approved by: bcr (mentor) MFC after:3 days Modified: head/usr.bin/fstat/fuser.1 Modified: head/usr.bin/fstat/fuser.1 == --- head/usr.bin/fstat/fuser.1 Thu Apr 11 10:14:28 2013(r249358) +++ head/usr.bin/fstat/fuser.1 Thu Apr 11 12:24:29 2013(r249359) @@ -36,7 +36,7 @@ .Op Fl M Ar core .Op Fl N Ar system .Op Fl s Ar signal -.Op Ar +.Ar .Sh DESCRIPTION The .Nm ___ 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-unsubscr...@freebsd.org"
svn commit: r249360 - head/lib/libc/stdio
Author: emaste Date: Thu Apr 11 12:49:42 2013 New Revision: 249360 URL: http://svnweb.freebsd.org/changeset/base/249360 Log: Remove unused atomic header Modified: head/lib/libc/stdio/fwalk.c Modified: head/lib/libc/stdio/fwalk.c == --- head/lib/libc/stdio/fwalk.c Thu Apr 11 12:24:29 2013(r249359) +++ head/lib/libc/stdio/fwalk.c Thu Apr 11 12:49:42 2013(r249360) @@ -37,7 +37,6 @@ static char sccsid[] = "@(#)fwalk.c 8.1 __FBSDID("$FreeBSD$"); #include -#include #include #include "local.h" #include "glue.h" ___ 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-unsubscr...@freebsd.org"
svn commit: r249361 - in head: lib/libkvm share/man/man4
Author: joel (doc committer) Date: Thu Apr 11 13:05:38 2013 New Revision: 249361 URL: http://svnweb.freebsd.org/changeset/base/249361 Log: Remove EOL whitespace. Modified: head/lib/libkvm/kvm_getpcpu.3 head/share/man/man4/ciss.4 Modified: head/lib/libkvm/kvm_getpcpu.3 == --- head/lib/libkvm/kvm_getpcpu.3 Thu Apr 11 12:49:42 2013 (r249360) +++ head/lib/libkvm/kvm_getpcpu.3 Thu Apr 11 13:05:38 2013 (r249361) @@ -94,7 +94,7 @@ function is used to obtain private per-C .Xr zone 9 . It takes .Fa base -argument as base address of an allocation and copyies +argument as base address of an allocation and copyies .Fa size bytes into .Fa buf Modified: head/share/man/man4/ciss.4 == --- head/share/man/man4/ciss.4 Thu Apr 11 12:49:42 2013(r249360) +++ head/share/man/man4/ciss.4 Thu Apr 11 13:05:38 2013(r249361) @@ -80,7 +80,7 @@ drives) are only exposed as .Xr pass 4 devices. Hot-insertion and removal of devices is supported and notification messages -will be reported to the console and logs. +will be reported to the console and logs. .Pp The problem which adapter freezes with the message .Dq ADAPTER HEARTBEAT FAILED ___ 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-unsubscr...@freebsd.org"
svn commit: r249367 - in head: cddl/contrib/opensolaris/cmd/dtrace cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs cddl/contrib/opensol...
Author: pfg Date: Thu Apr 11 16:24:36 2013 New Revision: 249367 URL: http://svnweb.freebsd.org/changeset/base/249367 Log: DTrace: option for time-ordered output Merge changes from illumos: 3021 option for time-ordered output from dtrace(1M) 3022 DTrace: keys should not affect the sort order when sorting by value 3023 it should be possible to dereference dynamic variables 3024 D integer narrowing needs some work 3025 register leak in D code generation 3026 libdtrace should set LD_NOLAZYLOAD=1 to help the pid provider This brings yet another feature implemented in upstream DTrace. A complete description is available here: http://dtrace.org/blogs/ahl/2012/07/28/my-new-dtrace-favorite/ This change bumps the DT_VERS_* number to 1.9.1 in accordance to what is done in illumos. This change was somewhat complicated because upstream is mixed many changes in an individual commit and some of the tests don't really apply to us. There are also appear to be differences in timestamping with Solaris so we had to workaround some assertions making sure no regression happened. Special thanks to Fabian Keil for changes and testing. Illumos Revisions:13758:23432da34147 Reference: https://www.illumos.org/issues/3021 https://www.illumos.org/issues/3022 https://www.illumos.org/issues/3023 https://www.illumos.org/issues/3024 https://www.illumos.org/issues/3025 https://www.illumos.org/issues/1694 Tested by:Fabian Keil Obtained from:Illumos MFC after:1 months Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/aggs/tst.sizedkeys.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.basics.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compcast.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.compnarrowassign.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/arithmetic/tst.execcast.d.out head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/cg/ - copied from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/cg/ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast1.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/pointers/tst.assigncast2.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal2.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/pragma/tst.temporal3.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.dyn.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.dyn.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d - copied unchanged from r249291, vendor/illumos/dist/cmd/dtrace/test/tst/common/print/tst.xlate.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out - copied unchanged from r
svn commit: r249368 - head/tools/tools/cxgbetool
Author: np Date: Thu Apr 11 16:50:58 2013 New Revision: 249368 URL: http://svnweb.freebsd.org/changeset/base/249368 Log: Set and display the IP fragment bit correctly when dealing with the filter mode. MFC after:3 days. Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c == --- head/tools/tools/cxgbetool/cxgbetool.c Thu Apr 11 16:24:36 2013 (r249367) +++ head/tools/tools/cxgbetool/cxgbetool.c Thu Apr 11 16:50:58 2013 (r249368) @@ -867,6 +867,9 @@ get_filter_mode(void) if (mode & T4_FILTER_IP_DPORT) printf("dport "); + if (mode & T4_FILTER_IP_FRAGMENT) + printf("frag "); + if (mode & T4_FILTER_MPS_HIT_TYPE) printf("matchtype "); @@ -886,7 +889,7 @@ get_filter_mode(void) printf("vlan "); if (mode & T4_FILTER_VNIC) - printf("vnic "); + printf("vnic/ovlan "); if (mode & T4_FILTER_PORT) printf("iport "); @@ -905,6 +908,9 @@ set_filter_mode(int argc, const char *ar uint32_t mode = 0; for (; argc; argc--, argv++) { + if (!strcmp(argv[0], "frag")) + mode |= T4_FILTER_IP_FRAGMENT; + if (!strcmp(argv[0], "matchtype")) mode |= T4_FILTER_MPS_HIT_TYPE; ___ 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-unsubscr...@freebsd.org"
svn commit: r249369 - head/share/misc
Author: gavin Date: Thu Apr 11 17:16:08 2013 New Revision: 249369 URL: http://svnweb.freebsd.org/changeset/base/249369 Log: - Add entries for alc and akoszek, alredy referenced elsewhere - Add phk -> mux relationship, confirmed by mux@ - Add scottl -> sbruno relationship - Move four ex-committers to the alumni section - Sort. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Thu Apr 11 16:50:58 2013 (r249368) +++ head/share/misc/committers-src.dot Thu Apr 11 17:16:08 2013 (r249369) @@ -45,6 +45,7 @@ cjc [label="Crist J. Clark\ncjc@FreeBSD. dds [label="Diomidis Spinellis\n...@freebsd.org\n2003/06/20\n2010/09/22"] dhartmei [label="Daniel Hartmeier\ndhart...@freebsd.org\n2004/04/06\n2008/12/08"] dmlb [label="Duncan Barclay\nd...@freebsd.org\n2001/12/14\n2008/11/10"] +dougb [label="Doug Barton\ndo...@freebsd.org\n2000/10/26\n2012/10/08"] eik [label="Oliver Eikemeier\n...@freebsd.org\n2004/05/20\n2008/11/10"] furuta [label="Atsushi Furuta\nfur...@freebsd.org\n2000/06/21\n2003/03/08"] groudier [label="Gerard Roudier\ngroud...@freebsd.org\n1999/12/30\n2006/04/06"] @@ -71,6 +72,7 @@ nate [label="Nate Willams\nnate@FreeBSD. njl [label="Nate Lawson\n...@freebsd.org\n2002/08/07\n2008/02/16"] non [label="Noriaki Mitsnaga\n...@freebsd.org\n2000/06/19\n2007/03/06"] onoe [label="Atsushi Onoe\no...@freebsd.org\n2000/07/21\n2008/11/10"] +rafan [label="Rong-En Fan\nra...@freebsd.org\n2007/01/31\n2012/07/23"] randi [label="Randi Harper\nra...@freebsd.org\n2010/04/20\n2012/05/10"] rgrimes [label="Rod Grimes\nrgri...@freebsd.org\n1993/06/12\n2003/03/08"] rink [label="Rink Springer\nr...@freebsd.org\n2006/01/16\n2010/11/04"] @@ -85,7 +87,9 @@ tmm [label="Thomas Moestl\ntmm@FreeBSD.o toshi [label="Toshihiko Arai\nto...@freebsd.org\n2000/07/06\n2003/03/08"] tshiozak [label="Takuya SHIOZAKI\ntshio...@freebsd.org\n2001/04/25\n2003/03/08"] uch [label="UCHIYAMA Yasushi\n...@freebsd.org\n2000/06/21\n2002/04/24"] +wilko [label="Wilko Bulte\nwi...@freebsd.org\n2000/01/13\n2013/01/17"] yar [label="Yar Tikhiy\n...@freebsd.org\n2001/03/25\n2012/05/23"] +zack [label="Zack Kirsch\nz...@freebsd.org\n2010/11/05\n2012/09/08"] node [color=lightblue2, style=filled, bgcolor=black]; @@ -97,6 +101,7 @@ achim [label="Achim Leubner\nachim@FreeB adrian [label="Adrian Chadd\nadr...@freebsd.org\n2000/07/03"] ae [label="Andrey V. Elsukov\n...@freebsd.org\n2010/06/03"] akiyama [label="Shunsuke Akiyama\nakiy...@freebsd.org\n2000/06/19"] +alc [label="Alan Cox\n...@freebsd.org\n1999/02/23"] ambrisko [label="Doug Ambrisko\nambri...@freebsd.org\n2001/12/19"] anchie [label="Ana Kukec\nanc...@freebsd.org\n2010/04/14"] andre [label="Andre Oppermann\nan...@freebsd.org\n2003/11/12"] @@ -132,7 +137,6 @@ des [label="Dag-Erling Smorgrav\ndes@Fre dfr [label="Doug Rabson\n...@freebsd.org\n/??/??"] dg [label="David Greenman\n...@freebsd.org\n1993/06/14"] dim [label="Dimitry Andric\n...@freebsd.org\n2010/08/30"] -dougb [label="Doug Barton\ndo...@freebsd.org\n2000/10/26"] dteske [label="Devin Teske\ndte...@freebsd.org\n2012/04/10"] dumbbell [label="Jean-Sebastien Pedron\ndumbb...@freebsd.org\n2004/11/29"] dwmalone [label="David Malone\ndwmal...@freebsd.org\n2000/07/11"] @@ -229,7 +233,6 @@ pjd [label="Pawel Jakub Dawidek\npjd@Fre pluknet [label="Sergey Kandaurov\npluk...@freebsd.org\n2010/10/05"] ps [label="Paul Saab\n...@freebsd.org\n2000/02/23"] qingli [label="Qing Li\nqin...@freebsd.org\n2005/04/13"] -rafan [label="Rong-En Fan\nra...@freebsd.org\n2007/01/31"] ray [label="Aleksandr Rybalko\n...@freebsd.org\n2011/05/25"] rdivacky [label="Roman Divacky\nrdiva...@freebsd.org\n2008/03/13"] remko [label="Remko Lodder\nre...@freebsd.org\n2007/02/23"] @@ -245,8 +248,8 @@ rstone [label="Ryan Stone\nrstone@FreeBS ru [label="Ruslan Ermilov\n...@freebsd.org\n1999/05/27"] rwatson [label="Robert N. M. Watson\nrwat...@freebsd.org\n1999/12/16"] sam [label="Sam Leffler\n...@freebsd.org\n2002/07/02"] -sbruno [label="Sean Bruno\nsbr...@freebsd.org\n/??/??"] sanpei [label="MIHIRA Sanpei Yoshiro\nsan...@freebsd.org\n2000/06/19"] +sbruno [label="Sean Bruno\nsbr...@freebsd.org\n2008/08/02"] scf [label="Sean C. Farley\n...@freebsd.org\n2007/06/24"] schweikh [label="Jens Schweikhardt\nschwe...@freebsd.org\n2001/04/06"] scottl [label="Scott Long\nsco...@freebsd.org\n2000/09/28"] @@ -276,11 +279,10 @@ vanhu [label="Yvan Vanhullebus\nvanhu@Fr versus [label="Konrad Jankowski\nver...@freebsd.org\n2008/10/27"] weongyo [label="Weongyo Jeong\nweon...@freebsd.org\n2007/12/21"] wes [label="Wes Peters\n...@freebsd.org\n1998/11/25"] -wilko [label="Wilko Bulte\nwi...@freebsd.org\n2000/01/13"] +wkoszek [label="Wojciech A. Koszek\nwkos...@freebsd.org\n2006/02/21"] wollman [label="Garrett Wollman\nwoll...@freebsd.org\n/??/??"] wsalamon [label="Wayne Salamon\nw
svn commit: r249370 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 17:50:50 2013 New Revision: 249370 URL: http://svnweb.freebsd.org/changeset/base/249370 Log: cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or t5nex attach to their devices. MFC after:3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 17:16:08 2013 (r249369) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 17:50:50 2013 (r249370) @@ -418,7 +418,7 @@ static int read_i2c(struct adapter *, st #ifdef TCP_OFFLOAD static int toe_capability(struct port_info *, int); #endif -static int t4_mod_event(module_t, int, void *); +static int mod_event(module_t, int, void *); struct { uint16_t device; @@ -6997,12 +6997,15 @@ tweak_tunables(void) } static int -t4_mod_event(module_t mod, int cmd, void *arg) +mod_event(module_t mod, int cmd, void *arg) { int rc = 0; + static int loaded = 0; switch (cmd) { case MOD_LOAD: + if (atomic_fetchadd_int(&loaded, 1)) + break; t4_sge_modload(); mtx_init(&t4_list_lock, "T4 adapters", 0, MTX_DEF); SLIST_INIT(&t4_list); @@ -7014,6 +7017,8 @@ t4_mod_event(module_t mod, int cmd, void break; case MOD_UNLOAD: + if (atomic_fetchadd_int(&loaded, -1) > 1) + break; #ifdef TCP_OFFLOAD mtx_lock(&t4_uld_list_lock); if (!SLIST_EMPTY(&t4_uld_list)) { @@ -7041,10 +7046,10 @@ t4_mod_event(module_t mod, int cmd, void static devclass_t t4_devclass, t5_devclass; static devclass_t cxgbe_devclass, cxl_devclass; -DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, t4_mod_event, 0); +DRIVER_MODULE(t4nex, pci, t4_driver, t4_devclass, mod_event, 0); MODULE_VERSION(t4nex, 1); -DRIVER_MODULE(t5nex, pci, t5_driver, t5_devclass, 0, 0); +DRIVER_MODULE(t5nex, pci, t5_driver, t5_devclass, mod_event, 0); MODULE_VERSION(t5nex, 1); DRIVER_MODULE(cxgbe, t4nex, cxgbe_driver, cxgbe_devclass, 0, 0); ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
Bruce, On Thu, Apr 11, 2013 at 09:07:25PM +1000, Bruce Evans wrote: B> Just routine avoidance of namespace pollution. This is easy in such a B> simple header. Sorry, with all respect, but I can't call including sys/types.h a namespace pollution. Ok, even you force me to name it that way, still I would prefer namespace pollution instead of handmade copy pasted typedefs. Thus, I'd prefer to leave include as is, moreover I'd like to remove handmade typedefs for size_t and ssize_t. -- Totus tuus, Glebius. ___ 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-unsubscr...@freebsd.org"
svn commit: r249371 - head/sbin/geom/class/part
Author: joel (doc committer) Date: Thu Apr 11 18:02:42 2013 New Revision: 249371 URL: http://svnweb.freebsd.org/changeset/base/249371 Log: Remove kernel options from the SYNOPSIS. They are already documented in the geom(4) manual page SYNOPSIS. Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 == --- head/sbin/geom/class/part/gpart.8 Thu Apr 11 17:50:50 2013 (r249370) +++ head/sbin/geom/class/part/gpart.8 Thu Apr 11 18:02:42 2013 (r249371) @@ -31,33 +31,6 @@ .Nm gpart .Nd "control utility for the disk partitioning GEOM class" .Sh SYNOPSIS -To add support for the disk partitioning GEOM class, -place one or more of the following -lines in the kernel configuration file: -.Bd -ragged -offset indent -.Cd "options GEOM_PART_APM" -.Cd "options GEOM_PART_BSD" -.Cd "options GEOM_PART_GPT" -.Cd "options GEOM_PART_LDM" -.Cd "options GEOM_PART_MBR" -.Cd "options GEOM_PART_EBR" -.Cd "options GEOM_PART_EBR_COMPAT" -.Cd "options GEOM_PART_PC98" -.Cd "options GEOM_PART_VTOC8" -.Ed -.Pp -These options provide support for the various types of partitioning -schemes supported by the -.Ns Nm -utility. -See -.Sx "PARTITIONING SCHEMES" -below for more details. -.Pp -Usage of the -.Ns Nm -utility: -.Pp .\" ADD .Nm .Cm add ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On Thu, Apr 11, 2013 at 11:00 AM, Gleb Smirnoff wrote: > Bruce, > > On Thu, Apr 11, 2013 at 09:07:25PM +1000, Bruce Evans wrote: > B> Just routine avoidance of namespace pollution. This is easy in such a > B> simple header. > > Sorry, with all respect, but I can't call including sys/types.h > a namespace pollution. > > Ok, even you force me to name it that way, still I would prefer > namespace pollution instead of handmade copy pasted typedefs. But Gleb, making such changes unilaterally is a bit of a leap. The project has mostly accepted Bruce's wisdom about trying to minimize and reduce namespace pollution. Now, this isn't a standard header so it's quite a bit less of a concern, but it's not no concern. If you think that we should reverse our trend on including namespace-polluting headers in system headers, we should discuss that on arch@, and it shouldn't be something that's done without any discussion or consideration. Should we expect further changes of this nature (and of the proposed nature removing __size_t and __ssize_t use) if you make changes to other headers as part of your work? Are you going to add to every header currently using in a single go, or will you be doing that a little at a time when making functional changes? Thanks, Juli. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
Juli, On Thu, Apr 11, 2013 at 11:05:28AM -0700, Juli Mallett wrote: J> > On Thu, Apr 11, 2013 at 09:07:25PM +1000, Bruce Evans wrote: J> > B> Just routine avoidance of namespace pollution. This is easy in such a J> > B> simple header. J> > J> > Sorry, with all respect, but I can't call including sys/types.h J> > a namespace pollution. J> > J> > Ok, even you force me to name it that way, still I would prefer J> > namespace pollution instead of handmade copy pasted typedefs. J> J> But Gleb, making such changes unilaterally is a bit of a leap. The J> project has mostly accepted Bruce's wisdom about trying to minimize J> and reduce namespace pollution. Now, this isn't a standard header so J> it's quite a bit less of a concern, but it's not no concern. If you J> think that we should reverse our trend on including J> namespace-polluting headers in system headers, we should discuss that J> on arch@, and it shouldn't be something that's done without any J> discussion or consideration. J> J> Should we expect further changes of this nature (and of the proposed J> nature removing __size_t and __ssize_t use) if you make changes to J> other headers as part of your work? Are you going to add J> to every header currently using in a J> single go, or will you be doing that a little at a time when making J> functional changes? Your suggestion? Typedef standard uint64_t manually as size_t and ssize_t already are done? Can you please define amount of standard types needed for kvm.h (or any abstract header) that would give a permission to include sys/types.h instead of typedefing all these types via a cut-n-paste surrounded by ifdefs? I am all against namespace pollution, but not when it comes to sys/types.h. -- Totus tuus, Glebius. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249355 - head/lib/libkvm
On 04/11/13 00:59, Bruce Evans wrote: >> Log: >> Include types.h for C99 uintXX_t types. > > This adds namespace pollution that was carefully left out. ... and as a developer, I wish we left out such namespace pollution more often. I write code on FreeBSD which I then publish with the intention that people will be able to use it on any POSIX-compliant system, and I've lost count of the number of times I've been hit by "this won't build on OS X or Linux because you forgot to #include ". Namespace pollution has a very real cost in wasted developer time. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid ___ 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-unsubscr...@freebsd.org"
svn commit: r249372 - head/sys/netinet
Author: glebius Date: Thu Apr 11 18:23:56 2013 New Revision: 249372 URL: http://svnweb.freebsd.org/changeset/base/249372 Log: Fix tcp_output() so that tcpcb is updated in the same manner when an mbuf allocation fails, as in a case when ip_output() returns error. To achieve that, move large block of code that updates tcpcb below the out: label. This fixes a panic, that requires the following sequence to happen: 1) The SYN was sent to the network, tp->snd_nxt = iss + 1, tp->snd_una = iss 2) The retransmit timeout happened for the SYN we had sent, tcp_timer_rexmt() sets tp->snd_nxt = tp->snd_una, and calls tcp_output(). In tcp_output m_get() fails. 3) Later on the SYN|ACK for the SYN sent in step 1) came, tcp_input sets tp->snd_una += 1, which leads to tp->snd_una > tp->snd_nxt inconsistency, that later panics in socket buffer code. For reference, this bug fixed in DragonflyBSD repo: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1ff9b7d322dc5a26f7173aa8c38ecb79da80e419 Reviewed by: andre Tested by:pho Sponsored by: Nginx, Inc. PR: kern/177456 Submitted by: HouYeFei&XiBoLiu Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c == --- head/sys/netinet/tcp_output.c Thu Apr 11 18:02:42 2013 (r249371) +++ head/sys/netinet/tcp_output.c Thu Apr 11 18:23:56 2013 (r249372) @@ -852,6 +852,7 @@ send: if (m == NULL) { SOCKBUF_UNLOCK(&so->so_snd); error = ENOBUFS; + sack_rxmit = 0; goto out; } @@ -874,6 +875,7 @@ send: SOCKBUF_UNLOCK(&so->so_snd); (void) m_free(m); error = ENOBUFS; + sack_rxmit = 0; goto out; } } @@ -901,6 +903,7 @@ send: m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; + sack_rxmit = 0; goto out; } #ifdef INET6 @@ -1123,75 +1126,6 @@ send: __func__, len, hdrlen, ipoptlen, m_length(m, NULL))); #endif - /* -* In transmit state, time the transmission and arrange for -* the retransmit. In persist state, just set snd_max. -*/ - if ((tp->t_flags & TF_FORCEDATA) == 0 || - !tcp_timer_active(tp, TT_PERSIST)) { - tcp_seq startseq = tp->snd_nxt; - - /* -* Advance snd_nxt over sequence space of this segment. -*/ - if (flags & (TH_SYN|TH_FIN)) { - if (flags & TH_SYN) - tp->snd_nxt++; - if (flags & TH_FIN) { - tp->snd_nxt++; - tp->t_flags |= TF_SENTFIN; - } - } - if (sack_rxmit) - goto timer; - tp->snd_nxt += len; - if (SEQ_GT(tp->snd_nxt, tp->snd_max)) { - tp->snd_max = tp->snd_nxt; - /* -* Time this transmission if not a retransmission and -* not currently timing anything. -*/ - if (tp->t_rtttime == 0) { - tp->t_rtttime = ticks; - tp->t_rtseq = startseq; - TCPSTAT_INC(tcps_segstimed); - } - } - - /* -* Set retransmit timer if not currently set, -* and not doing a pure ack or a keep-alive probe. -* Initial value for retransmit timer is smoothed -* round-trip time + 2 * round-trip time variance. -* Initialize shift counter which is used for backoff -* of retransmit time. -*/ -timer: - if (!tcp_timer_active(tp, TT_REXMT) && - ((sack_rxmit && tp->snd_nxt != tp->snd_max) || -(tp->snd_nxt != tp->snd_una))) { - if (tcp_timer_active(tp, TT_PERSIST)) { - tcp_timer_activate(tp, TT_PERSIST, 0); - tp->t_rxtshift = 0; - } - tcp_timer_activate(tp, TT_REXMT, tp->t_rxtcur); - } - } else { - /* -* Persist case, update snd_max but since we are in -* persist mode (no window) we do not update snd_nxt. -*/ - int xlen = len; -
Re: svn commit: r249355 - head/lib/libkvm
On Apr 11, 2013, at 11:13 AM, Colin Percival wrote: > On 04/11/13 00:59, Bruce Evans wrote: >>> Log: >>> Include types.h for C99 uintXX_t types. >> >> This adds namespace pollution that was carefully left out. > > ... and as a developer, I wish we left out such namespace pollution more > often. > > I write code on FreeBSD which I then publish with the intention that people > will > be able to use it on any POSIX-compliant system, and I've lost count of the > number of times I've been hit by "this won't build on OS X or Linux because > you > forgot to #include ". Funny this would be mentioned. I've seen the converse a lot with Linux devs because they fail to understand that headers on Linux #include a lot more crud than they need to.. Devs in general don't read the [POSIX] manpages like they should to figure out what needs to be #include'd in order to get function/constant definitions. Third party devs are usually the worst offenders. Thanks, -Garrett ___ 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-unsubscr...@freebsd.org"
svn commit: r249373 - in head: sbin/camcontrol sbin/kldload sbin/newfs share/man/man3 share/man/man4 share/man/man9 usr.bin/patch usr.sbin/bluetooth/l2ping usr.sbin/ctladm usr.sbin/makefs usr.sbin/...
Author: joel (doc committer) Date: Thu Apr 11 18:46:41 2013 New Revision: 249373 URL: http://svnweb.freebsd.org/changeset/base/249373 Log: Remove contractions. Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/kldload/kldload.8 head/sbin/newfs/newfs.8 head/share/man/man3/fpgetround.3 head/share/man/man4/ng_tag.4 head/share/man/man4/sdhci.4 head/share/man/man9/locking.9 head/share/man/man9/zone.9 head/usr.bin/patch/patch.1 head/usr.sbin/bluetooth/l2ping/l2ping.8 head/usr.sbin/ctladm/ctladm.8 head/usr.sbin/makefs/makefs.8 head/usr.sbin/mptutil/mptutil.8 head/usr.sbin/services_mkdb/services_mkdb.8 Modified: head/sbin/camcontrol/camcontrol.8 == --- head/sbin/camcontrol/camcontrol.8 Thu Apr 11 18:23:56 2013 (r249372) +++ head/sbin/camcontrol/camcontrol.8 Thu Apr 11 18:46:41 2013 (r249373) @@ -376,7 +376,7 @@ There are a couple of options to modify .It Fl c Just print out a count of LUNs, not the actual LUN numbers. .It Fl l -Just print out the LUNs, and don't print out the count. +Just print out the LUNs, and do not print out the count. .It Fl r Ar reporttype Specify the type of report to request from the target: .Bl -tag -width 012345678 Modified: head/sbin/kldload/kldload.8 == --- head/sbin/kldload/kldload.8 Thu Apr 11 18:23:56 2013(r249372) +++ head/sbin/kldload/kldload.8 Thu Apr 11 18:46:41 2013(r249373) @@ -63,7 +63,7 @@ in the current directory. The following options are available: .Bl -tag -width indent .It Fl n -Don't try to load module if already loaded. +Do not try to load module if already loaded. .It Fl v Be more verbose. .It Fl q Modified: head/sbin/newfs/newfs.8 == --- head/sbin/newfs/newfs.8 Thu Apr 11 18:23:56 2013(r249372) +++ head/sbin/newfs/newfs.8 Thu Apr 11 18:46:41 2013(r249373) @@ -226,7 +226,7 @@ See for more details on how to set this option. .It Fl p Ar partition The partition name (a..h) you want to use in case the underlying image -is a file, so you don't have access to individual partitions through the +is a file, so you do not have access to individual partitions through the filesystem. Can also be used with a device, e.g. .Nm Modified: head/share/man/man3/fpgetround.3 == --- head/share/man/man3/fpgetround.3Thu Apr 11 18:23:56 2013 (r249372) +++ head/share/man/man3/fpgetround.3Thu Apr 11 18:46:41 2013 (r249373) @@ -164,7 +164,7 @@ and .Fn fpsetprec functions provide functionality unavailable on many platforms. At present, they are implemented only on the i386 and amd64 platforms. -Changing precision isn't a supported feature: +Changing precision is not a supported feature: it may be ineffective when code is compiled to take advantage of SSE, and many library functions and compiler optimizations depend upon the default precision for correct behavior. Modified: head/share/man/man4/ng_tag.4 == --- head/share/man/man4/ng_tag.4Thu Apr 11 18:23:56 2013 (r249372) +++ head/share/man/man4/ng_tag.4Thu Apr 11 18:46:41 2013 (r249373) @@ -284,7 +284,7 @@ ngctl msg ngdc: sethookout { thisHook=\e tag_id=412 } .Ed .Pp -Don't forget to program +Do not forget to program .Xr ng_bpf 4 .Dq Li ipfw hook with the above expression (see Modified: head/share/man/man4/sdhci.4 == --- head/share/man/man4/sdhci.4 Thu Apr 11 18:23:56 2013(r249372) +++ head/share/man/man4/sdhci.4 Thu Apr 11 18:46:41 2013(r249373) @@ -85,4 +85,4 @@ TI PCIXX21/XX11 Many of existing SD controller chips have some nonstandard requirements, proprietary registers and hardware bugs, requiring additional handling. ENE chips are handled to work fine, while some revisions of RICOH and TI -controllers still don't see cards without some additional initialization. +controllers still do not see cards without some additional initialization. Modified: head/share/man/man9/locking.9 == --- head/share/man/man9/locking.9 Thu Apr 11 18:23:56 2013 (r249372) +++ head/share/man/man9/locking.9 Thu Apr 11 18:46:41 2013 (r249373) @@ -128,7 +128,7 @@ between them is that shared/exclusive lo (and may thus perform an unbounded sleep). They are inherently less efficient than mutexes, reader/writer locks and read-mostly locks. -They don't support priority propagation. +They do not support priority propagation. They should be considered to be closely related to .Xr sleep 9 . They could in some cases b
svn commit: r249375 - in head: sbin/ipfw usr.bin/rctl usr.sbin/bsnmpd/tools/bsnmptools usr.sbin/pmcannotate
Author: joel (doc committer) Date: Thu Apr 11 19:05:24 2013 New Revision: 249375 URL: http://svnweb.freebsd.org/changeset/base/249375 Log: Minor spelling and grammar fixes. Modified: head/sbin/ipfw/ipfw.8 head/usr.bin/rctl/rctl.8 head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 head/usr.sbin/pmcannotate/pmcannotate.8 Modified: head/sbin/ipfw/ipfw.8 == --- head/sbin/ipfw/ipfw.8 Thu Apr 11 18:47:16 2013(r249374) +++ head/sbin/ipfw/ipfw.8 Thu Apr 11 19:05:24 2013(r249375) @@ -854,7 +854,7 @@ So, to prevent endless loops in case of and .Cm return actions don't do any jumps and simply go to the next rule if memory -can't be allocated or stack overflowed/undeflowed. +cannot be allocated or stack overflowed/underflowed. .Pp Internally stack for rule numbers is implemented using .Xr mbuf_tags 9 Modified: head/usr.bin/rctl/rctl.8 == --- head/usr.bin/rctl/rctl.8Thu Apr 11 18:47:16 2013(r249374) +++ head/usr.bin/rctl/rctl.8Thu Apr 11 19:05:24 2013(r249375) @@ -162,7 +162,7 @@ See for a list of supported signals. .Pp Not all actions are supported for all resources. -Attempt to add rule with action not supported by a given resouce will result +Attempt to add rule with action not supported by a given resource will result in error. .Pp Note that limiting RSS may kill the machine due to thrashing. Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 == --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1Thu Apr 11 18:47:16 2013(r249374) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1Thu Apr 11 19:05:24 2013(r249375) @@ -108,7 +108,7 @@ Depending on the options .Nm bsnmpget constructs either a SMNP GetRequest, GetNextRequest or a GetBulkRequest packet, fills in the object identifiers (OIDs) of the -objects whose values will be retrived, waits for a response and prints it if +objects whose values will be retrieved, waits for a response and prints it if received successfully. .Pp .Nm Bsnmpwalk @@ -259,7 +259,7 @@ for and getnext for .Nm bsnmpwalk . Getbulk allows executing the so called SNMP "bulkwalks" allowing the values of -multiple columns to be retrived in a single PDU by +multiple columns to be retrieved in a single PDU by .Nm bsnmpwalk . .It Fl r Ar retries Number of resends of request packets before giving up if the agent does @@ -332,7 +332,7 @@ will use version 2. Note that GetBulkRequest-PDUs were introduced in SNMPv2 thus setting the version to 1 is incompatiable with sending a GetBulk PDU. .It OID -The object identifier whose value to retrive. +The object identifier whose value to retrieve. At least one OID should be provided for .Nm bsnmpget to be able to send a request. @@ -340,7 +340,7 @@ to be able to send a request. For .Nm bsnmpwalk this is the root object identifier of the subtree whose values are to be -retrived. +retrieved. If no OID is provided .Nm bsnmpwalk will walk the mib2 subtree rooted Modified: head/usr.sbin/pmcannotate/pmcannotate.8 == --- head/usr.sbin/pmcannotate/pmcannotate.8 Thu Apr 11 18:47:16 2013 (r249374) +++ head/usr.sbin/pmcannotate/pmcannotate.8 Thu Apr 11 19:05:24 2013 (r249375) @@ -45,7 +45,7 @@ The .Nm utility can produce both C sources or assembly sources of a program with a line-by-line based profiling. -The profiling informations are retrieved through a +The profiling information is retrieved through a .Xr pmcstat 8 raw output while the program operations are retrieved through the .Xr objdump 1 @@ -71,9 +71,9 @@ The following options are available: .Bl -tag -width indent .It Fl a Shows the program profiling inlined in the assembly code only. -No C informations involving C sources are provided. +No C information involving C sources is provided. .It Fl h -Prints out informations about the usage of the tool. +Prints out information about the usage of the tool. .It Fl l Ar level Changes the lower bound (expressed in percentage) for traced functions that will be printed out in the report. ___ 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-unsubscr...@freebsd.org"
svn commit: r249376 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 19:39:40 2013 New Revision: 249376 URL: http://svnweb.freebsd.org/changeset/base/249376 Log: - Explain clearly why a different firmware is being installed (if/when it is being installed). Improve other error messages while here. - Select special FPGA specific configuration profile when appropriate. MFC after:3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 19:05:24 2013 (r249375) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 19:39:40 2013 (r249376) @@ -255,6 +255,7 @@ TUNABLE_INT("hw.cxgbe.interrupt_types", #define DEFAULT_CF "default" #define FLASH_CF "flash" #define UWIRE_CF "uwire" +#define FPGA_CF"fpga" static char t4_cfg_file[32] = DEFAULT_CF; TUNABLE_STR("hw.cxgbe.config_file", t4_cfg_file, sizeof(t4_cfg_file)); @@ -1885,6 +1886,46 @@ fw_compatible(const struct fw_hdr *hdr1, } /* + * The firmware in the KLD is usable and can be installed. But should it be? + * This routine explains itself in detail if it indicates the KLD firmware + * should be installed. + */ +static int +should_install_kld_fw(struct adapter *sc, int card_fw_usable, int k, int c) +{ + const char *reason; + + KASSERT(t4_fw_install != 0, ("%s: Can't install; shouldn't be asked " + "to evaluate if install is a good idea.", __func__)); + + if (!card_fw_usable) { + reason = "incompatible or unusable"; + goto install; + } + + if (k > c) { + reason = "older than the version bundled with this driver"; + goto install; + } + + if (t4_fw_install == 2 && k != c) { + reason = "different than the version bundled with this driver"; + goto install; + } + + return (0); + +install: + device_printf(sc->dev, "firmware on card (%u.%u.%u.%u) is %s, " + "installing firmware %u.%u.%u.%u on card.\n", + G_FW_HDR_FW_VER_MAJOR(c), G_FW_HDR_FW_VER_MINOR(c), + G_FW_HDR_FW_VER_MICRO(c), G_FW_HDR_FW_VER_BUILD(c), reason, + G_FW_HDR_FW_VER_MAJOR(k), G_FW_HDR_FW_VER_MINOR(k), + G_FW_HDR_FW_VER_MICRO(k), G_FW_HDR_FW_VER_BUILD(k)); + + return (1); +} +/* * Establish contact with the firmware and determine if we are the master driver * or not, and whether we are responsible for chip initialization. */ @@ -1972,15 +2013,8 @@ prep_firmware(struct adapter *sc) * on the card. */ } else if (kld_fw_usable && state == DEV_STATE_UNINIT && - (!card_fw_usable || - be32toh(kld_fw->fw_ver) > be32toh(card_fw->fw_ver) || - (t4_fw_install == 2 && kld_fw->fw_ver != card_fw->fw_ver))) { - uint32_t v = ntohl(kld_fw->fw_ver); - - device_printf(sc->dev, - "installing firmware %d.%d.%d.%d on card.\n", - G_FW_HDR_FW_VER_MAJOR(v), G_FW_HDR_FW_VER_MINOR(v), - G_FW_HDR_FW_VER_MICRO(v), G_FW_HDR_FW_VER_BUILD(v)); + should_install_kld_fw(sc, card_fw_usable, be32toh(kld_fw->fw_ver), + be32toh(card_fw->fw_ver))) { rc = -t4_load_fw(sc, fw->data, fw->datasize); if (rc != 0) { @@ -2101,6 +2135,8 @@ partition_resources(struct adapter *sc, /* Card specific overrides go here. */ if (pci_get_device(sc->dev) == 0x440a) snprintf(sc->cfg_file, sizeof(sc->cfg_file), UWIRE_CF); + if (is_fpga(sc)) + snprintf(sc->cfg_file, sizeof(sc->cfg_file), FPGA_CF); } /* @@ -2114,17 +2150,20 @@ partition_resources(struct adapter *sc, snprintf(s, sizeof(s), "%s_%s", name_prefix, sc->cfg_file); cfg = firmware_get(s); if (cfg == NULL) { - device_printf(sc->dev, "unable to load module \"%s\" " - "for configuration profile \"%s\", ", - s, sc->cfg_file); if (default_cfg != NULL) { - device_printf(sc->dev, "will use the default " - "config file instead.\n"); + device_printf(sc->dev, + "unable to load module \"%s\" for " + "configuration profile \"%s\", will use " + "the default config file instead.\n", + s, sc->cfg_file); snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", DEFAULT_CF); } else { - device_printf(sc->dev, "will use the co
svn commit: r249377 - in head/sys: kern sys
Author: trociny Date: Thu Apr 11 19:49:18 2013 New Revision: 249377 URL: http://svnweb.freebsd.org/changeset/base/249377 Log: Add sbuf_start_section() and sbuf_end_section() functions, which can be used for automatic section alignment. Discussed with: kib Reviewed by: kib MFC after:1 month Modified: head/sys/kern/subr_sbuf.c head/sys/sys/sbuf.h Modified: head/sys/kern/subr_sbuf.c == --- head/sys/kern/subr_sbuf.c Thu Apr 11 19:39:40 2013(r249376) +++ head/sys/kern/subr_sbuf.c Thu Apr 11 19:49:18 2013(r249377) @@ -69,6 +69,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "st #defineSBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1) #defineSBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #defineSBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) +#defineSBUF_ISSECTION(s) ((s)->s_flags & SBUF_INSECTION) /* * Set / clear flags @@ -254,6 +255,8 @@ sbuf_uionew(struct sbuf *s, struct uio * return (NULL); } s->s_len = s->s_size - 1; + if (SBUF_ISSECTION(s)) + s->s_sect_len = s->s_size - 1; *error = 0; return (s); } @@ -272,6 +275,7 @@ sbuf_clear(struct sbuf *s) SBUF_CLEARFLAG(s, SBUF_FINISHED); s->s_error = 0; s->s_len = 0; + s->s_sect_len = 0; } /* @@ -290,6 +294,8 @@ sbuf_setpos(struct sbuf *s, ssize_t pos) KASSERT(pos < s->s_size, ("attempt to seek past end of sbuf (%jd >= %jd)", (intmax_t)pos, (intmax_t)s->s_size)); + KASSERT(!SBUF_ISSECTION(s), + ("attempt to seek when in a section")); if (pos < 0 || pos > s->s_len) return (-1); @@ -372,6 +378,8 @@ sbuf_put_byte(struct sbuf *s, int c) return; } s->s_buf[s->s_len++] = c; + if (SBUF_ISSECTION(s)) + s->s_sect_len++; } /* @@ -491,6 +499,8 @@ sbuf_copyin(struct sbuf *s, const void * /* fall through */ case 0: s->s_len += done - 1; + if (SBUF_ISSECTION(s)) + s->s_sect_len += done - 1; break; default: return (-1);/* XXX */ @@ -601,6 +611,8 @@ sbuf_vprintf(struct sbuf *s, const char if (SBUF_FREESPACE(s) < len) len = SBUF_FREESPACE(s); s->s_len += len; + if (SBUF_ISSECTION(s)) + s->s_sect_len += len; if (!SBUF_HASROOM(s) && !SBUF_CANEXTEND(s)) s->s_error = ENOMEM; @@ -656,8 +668,11 @@ sbuf_trim(struct sbuf *s) if (s->s_error != 0) return (-1); - while (s->s_len > 0 && isspace(s->s_buf[s->s_len-1])) + while (s->s_len > 0 && isspace(s->s_buf[s->s_len-1])) { --s->s_len; + if (SBUF_ISSECTION(s)) + s->s_sect_len--; + } return (0); } @@ -758,3 +773,58 @@ sbuf_done(const struct sbuf *s) return (SBUF_ISFINISHED(s)); } + +/* + * Start a section. + */ +void +sbuf_start_section(struct sbuf *s, ssize_t *old_lenp) +{ + + assert_sbuf_integrity(s); + assert_sbuf_state(s, 0); + + if (!SBUF_ISSECTION(s)) { + KASSERT(s->s_sect_len == 0, + ("s_sect_len != 0 when starting a section")); + if (old_lenp != NULL) + *old_lenp = -1; + SBUF_SETFLAG(s, SBUF_INSECTION); + } else { + KASSERT(old_lenp != NULL, + ("s_sect_len should be saved when starting a subsection")); + *old_lenp = s->s_sect_len; + s->s_sect_len = 0; + } +} + +/* + * End the section padding to the specified length with the specified + * character. + */ +ssize_t +sbuf_end_section(struct sbuf *s, ssize_t old_len, size_t pad, int c) +{ + ssize_t len; + + assert_sbuf_integrity(s); + assert_sbuf_state(s, 0); + KASSERT(SBUF_ISSECTION(s), + ("attempt to end a section when not in a section")); + + if (pad > 1) { + len = roundup(s->s_sect_len, pad) - s->s_sect_len; + for (; s->s_error == 0 && len > 0; len--) + sbuf_put_byte(s, c); + } + len = s->s_sect_len; + if (old_len == -1) { + s->s_sect_len = 0; + SBUF_CLEARFLAG(s, SBUF_INSECTION); + } else { + s->s_sect_len += old_len; + } + if (s->s_error != 0) + return (-1); + return (len); +} Modified: head/sys/sys/sbuf.h == --- head/sys/sys/sbuf.h Thu Apr 11 19:39:40 2013(r249376) +++ head/sys/sys/sbuf.h Thu Apr 11 19:49:18 2013(r249377) @@ -52,7 +52,9 @@ struct sbuf { #defineSBUF_DYNAMIC0x0001 /* s_bu
svn commit: r249378 - head/lib/libsbuf
Author: trociny Date: Thu Apr 11 19:50:10 2013 New Revision: 249378 URL: http://svnweb.freebsd.org/changeset/base/249378 Log: Add sbuf_start_section and sbuf_end_section to the libsbuf symbol map. MFC after:1 month Modified: head/lib/libsbuf/Symbol.map head/lib/libsbuf/Version.def Modified: head/lib/libsbuf/Symbol.map == --- head/lib/libsbuf/Symbol.map Thu Apr 11 19:49:18 2013(r249377) +++ head/lib/libsbuf/Symbol.map Thu Apr 11 19:50:10 2013(r249378) @@ -22,3 +22,8 @@ FBSD_1.2 { sbuf_done; sbuf_delete; }; + +FBSD_1.3 { + sbuf_start_section; + sbuf_end_section; +}; Modified: head/lib/libsbuf/Version.def == --- head/lib/libsbuf/Version.defThu Apr 11 19:49:18 2013 (r249377) +++ head/lib/libsbuf/Version.defThu Apr 11 19:50:10 2013 (r249378) @@ -2,3 +2,6 @@ FBSD_1.2 { }; + +FBSD_1.3 { +} FBSD_1.2; ___ 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-unsubscr...@freebsd.org"
svn commit: r249379 - head/share/man/man9
Author: trociny Date: Thu Apr 11 19:51:53 2013 New Revision: 249379 URL: http://svnweb.freebsd.org/changeset/base/249379 Log: Document sbuf_start_section() and sbuf_end_section() functions. MFC after:1 month Modified: head/share/man/man9/sbuf.9 Modified: head/share/man/man9/sbuf.9 == --- head/share/man/man9/sbuf.9 Thu Apr 11 19:50:10 2013(r249378) +++ head/share/man/man9/sbuf.9 Thu Apr 11 19:51:53 2013(r249379) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2011 +.Dd April 11, 2013 .Dt SBUF 9 .Os .Sh NAME @@ -51,7 +51,9 @@ .Nm sbuf_data , .Nm sbuf_len , .Nm sbuf_done , -.Nm sbuf_delete +.Nm sbuf_delete , +.Nm sbuf_start_section , +.Nm sbuf_end_section .Nd safe string composition .Sh SYNOPSIS .In sys/types.h @@ -100,6 +102,10 @@ .Fn sbuf_done "struct sbuf *s" .Ft void .Fn sbuf_delete "struct sbuf *s" +.Ft void +.Fn sbuf_start_section "struct sbuf *s" "ssize_t *old_lenp" +.Ft ssize_t +.Fn sbuf_end_section "struct sbuf *s" "ssize_t old_len" "size_t pad" "int c" .In sys/sysctl.h .Ft struct sbuf * .Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" @@ -402,6 +408,30 @@ returns the length of the un-drained dat returns non-zero if the .Fa sbuf is finished. +.Pp +The +.Fn sbuf_start_section +and +.Fn sbuf_end_section +functions may be used for automatic section alignment. +The arguments +.Fa pad +and +.Fa c +specify the padding size and a character used for padding. +The arguments +.Fa old_lenp +and +.Fa old_len +are to save and restore the current section length when nested sections +are used. +For the top level section +.Dv NULL +and \-1 can be specified for +.Fa old_lenp +and +.Fa old_len +respectively. .Sh NOTES If an operation caused an .Fa sbuf @@ -473,6 +503,10 @@ returns \-1 if copying string from userl copied otherwise. .Pp The +.Fn sbuf_end_section +function returns the section length or \-1 if the buffer has an error. +.Pp +The .Fn sbuf_finish 9 function (the kernel version) returns ENOMEM if the sbuf overflowed before being finished, ___ 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-unsubscr...@freebsd.org"
svn commit: r249381 - in head/lib/libc: gen stdio
Author: emaste Date: Thu Apr 11 20:15:37 2013 New Revision: 249381 URL: http://svnweb.freebsd.org/changeset/base/249381 Log: Spelling correction Modified: head/lib/libc/gen/glob.c head/lib/libc/stdio/fgetln.c Modified: head/lib/libc/gen/glob.c == --- head/lib/libc/gen/glob.cThu Apr 11 20:12:28 2013(r249380) +++ head/lib/libc/gen/glob.cThu Apr 11 20:15:37 2013(r249381) @@ -738,7 +738,7 @@ glob3(Char *pathbuf, Char *pathend, Char /* - * Extend the gl_pathv member of a glob_t structure to accomodate a new item, + * Extend the gl_pathv member of a glob_t structure to accommodate a new item, * add the new item, and update gl_pathc. * * This assumes the BSD realloc, which only copies the block when its size Modified: head/lib/libc/stdio/fgetln.c == --- head/lib/libc/stdio/fgetln.cThu Apr 11 20:12:28 2013 (r249380) +++ head/lib/libc/stdio/fgetln.cThu Apr 11 20:15:37 2013 (r249381) @@ -115,7 +115,7 @@ fgetln(FILE *fp, size_t *lenp) * As a bonus, though, we can leave off the __SMOD. * * OPTIMISTIC is length that we (optimistically) expect will -* accomodate the `rest' of the string, on each trip through the +* accommodate the `rest' of the string, on each trip through the * loop below. */ #define OPTIMISTIC 80 ___ 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-unsubscr...@freebsd.org"
svn commit: r249382 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 21:15:35 2013 New Revision: 249382 URL: http://svnweb.freebsd.org/changeset/base/249382 Log: There is no need for elaborate queries and error checking when trying to set FW4MSG_ENCAP. MFC after:3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 20:15:37 2013 (r249381) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 21:15:35 2013 (r249382) @@ -2480,27 +2480,13 @@ static int set_params__post_init(struct adapter *sc) { uint32_t param, val; - int rc; + /* ask for encapsulated CPLs */ param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); - rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); - if (rc == 0) { - /* ask for encapsulated CPLs */ - param = FW_PARAM_PFVF(CPLFW4MSG_ENCAP); - val = 1; - rc = -t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); - if (rc != 0) { - device_printf(sc->dev, - "failed to set parameter (post_init): %d.\n", rc); - return (rc); - } - } else if (rc != FW_EINVAL) { - device_printf(sc->dev, - "failed to check for encapsulated CPLs: %d.\n", rc); - } else - rc = 0; /* the firmware doesn't support the param, no worries */ + val = 1; + (void)t4_set_params(sc, sc->mbox, sc->pf, 0, 1, ¶m, &val); - return (rc); + return (0); } #undef FW_PARAM_PFVF ___ 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-unsubscr...@freebsd.org"
svn commit: r249383 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 21:17:49 2013 New Revision: 249383 URL: http://svnweb.freebsd.org/changeset/base/249383 Log: Get rid of a couple of stray \n's. MFC after:3 days. Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 21:15:35 2013 (r249382) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 21:17:49 2013 (r249383) @@ -5760,11 +5760,11 @@ sysctl_wrwc_stats(SYSCTL_HANDLER_ARGS) v = t4_read_reg(sc, A_SGE_STAT_CFG); if (G_STATSOURCE_T5(v) == 7) { if (G_STATMODE(v) == 0) { - sbuf_printf(sb, "\ntotal %d, incomplete %d", + sbuf_printf(sb, "total %d, incomplete %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); } else if (G_STATMODE(v) == 1) { - sbuf_printf(sb, "\ntotal %d, data overflow %d", + sbuf_printf(sb, "total %d, data overflow %d", t4_read_reg(sc, A_SGE_STAT_TOTAL), t4_read_reg(sc, A_SGE_STAT_MATCH)); } ___ 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-unsubscr...@freebsd.org"
svn commit: r249384 - head/usr.bin/ctlstat
Author: ken Date: Thu Apr 11 21:18:04 2013 New Revision: 249384 URL: http://svnweb.freebsd.org/changeset/base/249384 Log: Fix bugs in the elapsed time calculation in ctlstat_standard() pointed out by bde: - Casting to long double isn't needed. - The division isn't needed, multiplication can be used. "When 1 nanosecond is in a floating point literal, the whole expression is automatically promoted correctly." - non-KNF indentation (1 tab) for the newly split line - different non-KNF indentation (5 spaces) for the previously split line - exessive parentheses around the division operation - bogus blank line which splits up the etime initialization - general verboseness from the above. Submitted by: bde MFC after:3 days Modified: head/usr.bin/ctlstat/ctlstat.c Modified: head/usr.bin/ctlstat/ctlstat.c == --- head/usr.bin/ctlstat/ctlstat.c Thu Apr 11 21:17:49 2013 (r249383) +++ head/usr.bin/ctlstat/ctlstat.c Thu Apr 11 21:18:04 2013 (r249384) @@ -404,7 +404,7 @@ ctlstat_json(struct ctlstat_context *ctx static void ctlstat_standard(struct ctlstat_context *ctx) { - long double cur_secs, prev_secs, etime; + long double etime; uint64_t delta_jiffies, delta_idle; uint32_t port; long double cpu_percentage; @@ -416,12 +416,8 @@ ctlstat_standard(struct ctlstat_context if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) errx(1, "error returned from getcpu()"); - cur_secs = ctx->cur_time.tv_sec + - ((long double)ctx->cur_time.tv_nsec / 10); - prev_secs = ctx->prev_time.tv_sec + -((long double)ctx->prev_time.tv_nsec / 10); - - etime = cur_secs - prev_secs; + etime = ctx->cur_time.tv_sec - ctx->prev_time.tv_sec + + (ctx->prev_time.tv_nsec - ctx->cur_time.tv_nsec) * 1e-9; if (F_CPU(ctx)) { ctx->prev_total_jiffies = ctx->cur_total_jiffies; ___ 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-unsubscr...@freebsd.org"
svn commit: r249385 - head/sys/dev/cxgbe/tom
Author: np Date: Thu Apr 11 21:36:01 2013 New Revision: 249385 URL: http://svnweb.freebsd.org/changeset/base/249385 Log: cxgbe/tom: Slight simplification of code that calculates options2. MFC after:3 days Modified: head/sys/dev/cxgbe/tom/t4_connect.c head/sys/dev/cxgbe/tom/t4_listen.c Modified: head/sys/dev/cxgbe/tom/t4_connect.c == --- head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 11 21:18:04 2013 (r249384) +++ head/sys/dev/cxgbe/tom/t4_connect.c Thu Apr 11 21:36:01 2013 (r249385) @@ -226,7 +226,10 @@ calc_opt2a(struct socket *so, struct toe struct tcpcb *tp = so_sototcpcb(so); struct port_info *pi = toep->port; struct adapter *sc = pi->adapter; - uint32_t opt2 = 0; + uint32_t opt2; + + opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | + F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); if (tp->t_flags & TF_SACK_PERMIT) opt2 |= F_SACK_EN; @@ -240,12 +243,12 @@ calc_opt2a(struct socket *so, struct toe if (V_tcp_do_ecn) opt2 |= F_CCTRL_ECN; - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(toep->ofld_rxq->iq.abs_id); + /* RX_COALESCE is always a valid value (M_RX_COALESCE). */ if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_RX_COALESCE_VALID; else - opt2 |= F_T5_OPT_2_VALID | V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_T5_OPT_2_VALID; + opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL if (toep->ulp_mode == ULP_MODE_TCPDDP) Modified: head/sys/dev/cxgbe/tom/t4_listen.c == --- head/sys/dev/cxgbe/tom/t4_listen.c Thu Apr 11 21:18:04 2013 (r249384) +++ head/sys/dev/cxgbe/tom/t4_listen.c Thu Apr 11 21:36:01 2013 (r249385) @@ -990,8 +990,11 @@ static uint32_t calc_opt2p(struct adapter *sc, struct port_info *pi, int rxqid, const struct tcp_options *tcpopt, struct tcphdr *th, int ulp_mode) { - uint32_t opt2 = 0; struct sge_ofld_rxq *ofld_rxq = &sc->sge.ofld_rxq[rxqid]; + uint32_t opt2; + + opt2 = V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]) | + F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id); if (V_tcp_do_rfc1323) { if (tcpopt->tstamp) @@ -1005,12 +1008,12 @@ calc_opt2p(struct adapter *sc, struct po if (V_tcp_do_ecn && th->th_flags & (TH_ECE | TH_CWR)) opt2 |= F_CCTRL_ECN; - opt2 |= V_TX_QUEUE(sc->params.tp.tx_modq[pi->tx_chan]); - opt2 |= F_RSS_QUEUE_VALID | V_RSS_QUEUE(ofld_rxq->iq.abs_id); + /* RX_COALESCE is always a valid value (0 or M_RX_COALESCE). */ if (is_t4(sc)) - opt2 |= F_RX_COALESCE_VALID | V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_RX_COALESCE_VALID; else - opt2 |= F_T5_OPT_2_VALID | V_RX_COALESCE(M_RX_COALESCE); + opt2 |= F_T5_OPT_2_VALID; + opt2 |= V_RX_COALESCE(M_RX_COALESCE); #ifdef USE_DDP_RX_FLOW_CONTROL if (ulp_mode == ULP_MODE_TCPDDP) ___ 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-unsubscr...@freebsd.org"
svn commit: r249386 - head/sys/dev/ath
Author: adrian Date: Thu Apr 11 22:02:35 2013 New Revision: 249386 URL: http://svnweb.freebsd.org/changeset/base/249386 Log: Always enable TXOK interrupts when setting up TX queues for EDMA NICs. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c == --- head/sys/dev/ath/if_ath.c Thu Apr 11 21:36:01 2013(r249385) +++ head/sys/dev/ath/if_ath.c Thu Apr 11 22:02:35 2013(r249386) @@ -3468,7 +3468,13 @@ ath_txq_setup(struct ath_softc *sc, int * up in which case the top half of the kernel may backup * due to a lack of tx descriptors. */ - qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE | HAL_TXQ_TXDESCINT_ENABLE; + if (sc->sc_isedma) + qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE | + HAL_TXQ_TXOKINT_ENABLE; + else + qi.tqi_qflags = HAL_TXQ_TXEOLINT_ENABLE | + HAL_TXQ_TXDESCINT_ENABLE; + qnum = ath_hal_setuptxqueue(ah, qtype, &qi); if (qnum == -1) { /* ___ 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-unsubscr...@freebsd.org"
svn commit: r249390 - in head/sys: conf powerpc/conf
Author: bz Date: Thu Apr 11 22:18:20 2013 New Revision: 249390 URL: http://svnweb.freebsd.org/changeset/base/249390 Log: Generate a LINT for powerpc and for powerpc64. Discussed with: nwhitehorn Modified: head/sys/conf/makeLINT.mk head/sys/powerpc/conf/Makefile Modified: head/sys/conf/makeLINT.mk == --- head/sys/conf/makeLINT.mk Thu Apr 11 22:10:15 2013(r249389) +++ head/sys/conf/makeLINT.mk Thu Apr 11 22:18:20 2013(r249390) @@ -46,6 +46,12 @@ LINT: ${NOTES} ../../conf/makeLINT.sed echo "nodevice txp" >> ${.TARGET}-NOIP echo "nodevice vxge">> ${.TARGET}-NOIP .endif -.if ${TARGET} == "powerpc" || ${TARGET} == "mips" +.if ${TARGET} == "mips" echo "machine ${TARGET} ${TARGET_ARCH}" >> ${.TARGET} .endif +.if ${TARGET} == "powerpc" + # cat is available, not sure if cp is? + cat ${.TARGET} > ${.TARGET}64 + echo "machine ${TARGET} powerpc" >> ${.TARGET} + echo "machine ${TARGET} powerpc64" >> ${.TARGET}64 +.endif Modified: head/sys/powerpc/conf/Makefile == --- head/sys/powerpc/conf/Makefile Thu Apr 11 22:10:15 2013 (r249389) +++ head/sys/powerpc/conf/Makefile Thu Apr 11 22:18:20 2013 (r249390) @@ -1,8 +1,5 @@ # $FreeBSD$ TARGET=powerpc -.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpc64 -TARGET_ARCH?=${MACHINE_ARCH} -.endif .include "${.CURDIR}/../../conf/makeLINT.mk" ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r249334 - head/usr.bin/ctlstat
On Thu, Apr 11, 2013 at 17:06:44 +1000, Bruce Evans wrote: > On Wed, 10 Apr 2013, Kenneth D. Merry wrote: > > >Log: > > Fix a time calculation error in ctlstat_standard(). > > > > ctlstat.c: When converting a timeval to a floating point > > number in ctlstat_standard(), cast the nanoseconds > > calculation to a long double, so we don't lose > > precision. Without the cast, we wind up with a > > time in whole seconds only. > >... > >Modified: head/usr.bin/ctlstat/ctlstat.c > >== > >--- head/usr.bin/ctlstat/ctlstat.c Wed Apr 10 11:26:30 2013 (r249333) > >+++ head/usr.bin/ctlstat/ctlstat.c Wed Apr 10 16:01:45 2013 (r249334) > >@@ -416,9 +416,10 @@ ctlstat_standard(struct ctlstat_context > > if (F_CPU(ctx) && (getcpu(&ctx->cur_cpu) != 0)) > > errx(1, "error returned from getcpu()"); > > > >-cur_secs = ctx->cur_time.tv_sec + (ctx->cur_time.tv_nsec / > >10); > >+cur_secs = ctx->cur_time.tv_sec + > >+((long double)ctx->cur_time.tv_nsec / 10); > > prev_secs = ctx->prev_time.tv_sec + > >- (ctx->prev_time.tv_nsec / 10); > >+ ((long double)ctx->prev_time.tv_nsec / 10); > > > > etime = cur_secs - prev_secs; > > long double is rarely necessary. It mainly asks for slowness (10-50%) > on i386 and extreme slowness (hundreds of times slower) on space64. > Double precision is plenty. Many arches in FreeBSD have long double == > double, so you can't depend on long double being more precise than double, > and statistics utilities are especially not in need of much precision. > (Float precision would be enough here. It would be accurate to 1/16 > of a microsecond. Not to 1 nanosecond, but you don't need that. The > integer division was only accurate to 1/4 second, so ist error was > noticeable.) > > There is no need for any casts. There is no need for any divisions. > Simply multiply by 1 nanosecond. This must be in floating point, since > integers can't represent 1 nanosecond (neither can floating, but the > error of ~2**-53 nanosecnds for double precision is neglogible). When > 1 nanosecond is in a floating point literal, the whole expression is > automatically promoted correctly. > > Other style bugs in the above: > - non-KNF indentation (1 tab) for the newly split line > - different non-KNF indentation (5 spaces) for the previously split line > - exessive parentheses around the division operation > - bogus blank line which splits up the etime initialization > - general verboseness from the above. > > Fixing these gives: > > cur_secs = ctx->cur_time.tv_sec + ctx->cur_time.tv_nsec * 1e-9; > prev_secs = ctx->prev_time.tv_sec + ctx->prev_time.tv_nsec * 1e-9 > etime = cur_secs - prev_secs; > > It is now clear that this is still too verbose, since cur_secs and prev_secs > are not used except to initialize etime. Simplifying this gives: > > etime = ctx->cur_time.tv_sec - ctx->prev_time.tv_sec + > (ctx->prev_time.tv_nsec - ctx->cur_time.tv_nsec) * 1e-9; > > This might need casting to double of ctx->cur_time.tv_sec, in case time_t > is unsigned and the time went backwards. Otherwise, this should be the > usual expression for subtracting timespecs. The time can't go backwards in this case, because it is the system uptime. Using wall clock time causes problems measuring performance when NTP decides that the system time needs to change. I have a local patch to dd to fix instances of bogus performance numbers due to its using wall clock time to measure elapsed time. This should be fixed now, thanks for the review! Ken -- Kenneth Merry k...@freebsd.org ___ 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-unsubscr...@freebsd.org"
svn commit: r249391 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 22:46:39 2013 New Revision: 249391 URL: http://svnweb.freebsd.org/changeset/base/249391 Log: Auto-reduce the holdoff timers that are greater than the maximum value allowed by the hardware. MFC after:3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c == --- head/sys/dev/cxgbe/t4_sge.c Thu Apr 11 22:18:20 2013(r249390) +++ head/sys/dev/cxgbe/t4_sge.c Thu Apr 11 22:46:39 2013(r249391) @@ -280,12 +280,16 @@ t4_init_sge_cpl_handlers(struct adapter t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } +/* + * adap->params.vpd.cclk must be set up before this is called. + */ void t4_tweak_chip_settings(struct adapter *sc) { int i; uint32_t v, m; int intr_timer[SGE_NTIMERS] = {1, 5, 10, 50, 100, 200}; + int timer_max = M_TIMERVALUE0 * 1000 / sc->params.vpd.cclk; int intr_pktcount[SGE_NCOUNTERS] = {1, 8, 16, 32}; /* 63 max */ uint16_t indsz = min(RX_COPY_THRESHOLD - 1, M_INDICATESIZE); @@ -318,7 +322,24 @@ t4_tweak_chip_settings(struct adapter *s V_THRESHOLD_2(intr_pktcount[2]) | V_THRESHOLD_3(intr_pktcount[3]); t4_write_reg(sc, A_SGE_INGRESS_RX_THRESHOLD, v); - /* adap->params.vpd.cclk must be set up before this */ + KASSERT(intr_timer[0] <= timer_max, + ("%s: not a single usable timer (%d, %d)", __func__, intr_timer[0], + timer_max)); + for (i = 1; i < nitems(intr_timer); i++) { + KASSERT(intr_timer[i] >= intr_timer[i - 1], + ("%s: timers not listed in increasing order (%d)", + __func__, i)); + + while (intr_timer[i] > timer_max) { + if (i == nitems(intr_timer) - 1) { + intr_timer[i] = timer_max; + break; + } + intr_timer[i] += intr_timer[i - 1]; + intr_timer[i] /= 2; + } + } + v = V_TIMERVALUE0(us_to_core_ticks(sc, intr_timer[0])) | V_TIMERVALUE1(us_to_core_ticks(sc, intr_timer[1])); t4_write_reg(sc, A_SGE_TIMER_VALUE_0_AND_1, v); ___ 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-unsubscr...@freebsd.org"
svn commit: r249392 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 22:49:29 2013 New Revision: 249392 URL: http://svnweb.freebsd.org/changeset/base/249392 Log: Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/). MFC after:3 days. Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h == --- head/sys/dev/cxgbe/adapter.hThu Apr 11 22:46:39 2013 (r249391) +++ head/sys/dev/cxgbe/adapter.hThu Apr 11 22:49:29 2013 (r249392) @@ -319,7 +319,7 @@ enum { }; /* Listed in order of preference. Update t4_sysctls too if you change these */ -enum {DOORBELL_UDB, DOORBELL_WRWC, DOORBELL_UDBWC, DOORBELL_KDB}; +enum {DOORBELL_UDB, DOORBELL_WCWR, DOORBELL_UDBWC, DOORBELL_KDB}; /* * Egress Queue: driver is producer, T4 is consumer. Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 22:46:39 2013 (r249391) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 22:49:29 2013 (r249392) @@ -397,7 +397,7 @@ static int sysctl_tcp_stats(SYSCTL_HANDL static int sysctl_tids(SYSCTL_HANDLER_ARGS); static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); -static int sysctl_wrwc_stats(SYSCTL_HANDLER_ARGS); +static int sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS); #endif static inline void txq_start(struct ifnet *, struct sge_txq *); static uint32_t fconf_to_mode(uint32_t); @@ -1413,7 +1413,7 @@ map_bar_2(struct adapter *sc) rman_get_size(sc->udbs_res), PAT_WRITE_COMBINING); if (rc == 0) { clrbit(&sc->doorbells, DOORBELL_UDB); - setbit(&sc->doorbells, DOORBELL_WRWC); + setbit(&sc->doorbells, DOORBELL_WCWR); setbit(&sc->doorbells, DOORBELL_UDBWC); } else { device_printf(sc->dev, @@ -4054,7 +4054,7 @@ t4_sysctls(struct adapter *sc) "\5INITIATOR_SSNOFLD\6TARGET_SSNOFLD", "\20\1INITIATOR\2TARGET\3CTRL_OFLD" /* caps[5] fcoecaps */ }; - static char *doorbells = {"\20\1UDB\2WRWC\3UDBWC\4KDB"}; + static char *doorbells = {"\20\1UDB\2WCWR\3UDBWC\4KDB"}; ctx = device_get_sysctl_ctx(sc->dev); @@ -4260,9 +4260,9 @@ t4_sysctls(struct adapter *sc) sysctl_tx_rate, "A", "Tx rate"); if (is_t5(sc)) { - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wrwc_stats", + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "wcwr_stats", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, - sysctl_wrwc_stats, "A", "work request (WC) statistics"); + sysctl_wcwr_stats, "A", "write combined work requests"); } #endif @@ -5743,7 +5743,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) } static int -sysctl_wrwc_stats(SYSCTL_HANDLER_ARGS) +sysctl_wcwr_stats(SYSCTL_HANDLER_ARGS) { struct adapter *sc = arg1; struct sbuf *sb; Modified: head/sys/dev/cxgbe/t4_sge.c == --- head/sys/dev/cxgbe/t4_sge.c Thu Apr 11 22:46:39 2013(r249391) +++ head/sys/dev/cxgbe/t4_sge.c Thu Apr 11 22:49:29 2013(r249392) @@ -2305,7 +2305,7 @@ alloc_eq(struct adapter *sc, struct port if (isset(&eq->doorbells, DOORBELL_UDB) || isset(&eq->doorbells, DOORBELL_UDBWC) || - isset(&eq->doorbells, DOORBELL_WRWC)) { + isset(&eq->doorbells, DOORBELL_WCWR)) { uint32_t s_qpp = sc->sge.s_qpp; uint32_t mask = (1 << s_qpp) - 1; volatile uint8_t *udb; @@ -2314,7 +2314,7 @@ alloc_eq(struct adapter *sc, struct port udb += (eq->cntxt_id >> s_qpp) << PAGE_SHIFT; /* pg offset */ eq->udb_qid = eq->cntxt_id & mask; /* id in page */ if (eq->udb_qid > PAGE_SIZE / UDBS_SEG_SIZE) - clrbit(&eq->doorbells, DOORBELL_WRWC); + clrbit(&eq->doorbells, DOORBELL_WCWR); else { udb += eq->udb_qid << UDBS_SEG_SHIFT; /* seg offset */ eq->udb_qid = 0; @@ -3451,7 +3451,7 @@ ring_eq_db(struct adapter *sc, struct sg db = eq->doorbells; pending = eq->pending; if (pending > 1) - clrbit(&db, DOORBELL_WRWC); + clrbit(&db, DOORBELL_WCWR); eq->pending = 0; wmb(); @@ -3460,14 +3460,14 @@ ring_eq_db(struct adapter *sc, struct sg *eq->udb = htole32(V_QID(eq->udb_qid) | V_PIDX(pending)); return; - case DOORBELL_WRWC: { + case DOORBELL_WCWR: { vola
svn commit: r249393 - head/sys/dev/cxgbe
Author: np Date: Thu Apr 11 23:40:05 2013 New Revision: 249393 URL: http://svnweb.freebsd.org/changeset/base/249393 Log: Add pciids of the T5 based cards. The ones that I haven't tested with cxgbe(4) are disabled for now. This will change. MFC after:2 weeks Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c == --- head/sys/dev/cxgbe/t4_main.cThu Apr 11 22:49:29 2013 (r249392) +++ head/sys/dev/cxgbe/t4_main.cThu Apr 11 23:40:05 2013 (r249393) @@ -441,6 +441,27 @@ struct { }, t5_pciids[] = { {0xb000, "Chelsio Terminator 5 FPGA"}, {0x5400, "Chelsio T580-dbg"}, + {0x5401, "Chelsio T520-CR"}, + {0x5407, "Chelsio T520-SO"}, + {0x5408, "Chelsio T520-CX"}, + {0x5411, "Chelsio T520-LL-CR"}, +#ifdef notyet + {0x5402, "Chelsio T522-CR"}, + {0x5403, "Chelsio T540-CR"}, + {0x5404, "Chelsio T520-BCH"}, + {0x5405, "Chelsio T540-BCH"}, + {0x5406, "Chelsio T540-CH"}, + {0x5409, "Chelsio T520-BT"}, + {0x540a, "Chelsio T504-BT"}, + {0x540b, "Chelsio B520-SR"}, + {0x540c, "Chelsio B504-BT"}, + {0x540d, "Chelsio T580-CR"}, + {0x540e, "Chelsio T540-LP-CR"}, + {0x540f, "Chelsio Amsterdam"}, + {0x5410, "Chelsio T580-LP-CR"}, + {0x5412, "Chelsio T560-CR"}, + {0x5413, "Chelsio T580-CR"}, +#endif }; #ifdef TCP_OFFLOAD ___ 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-unsubscr...@freebsd.org"
svn commit: r249395 - head
Author: sjg Date: Fri Apr 12 00:34:19 2013 New Revision: 249395 URL: http://svnweb.freebsd.org/changeset/base/249395 Log: If doing buildworld -DWITH_BMAKE make sure bmake does the build. Modified: head/Makefile Modified: head/Makefile == --- head/Makefile Thu Apr 11 23:45:40 2013(r249394) +++ head/Makefile Fri Apr 12 00:34:19 2013(r249395) @@ -281,6 +281,9 @@ kernel: buildkernel installkernel # upgrade_checks: .if !defined(.PARSEDIR) +.if defined(WITH_BMAKE) + (cd ${.CURDIR} && ${MAKE} bmake) +.else @if ! (cd ${.CURDIR}/tools/build/make_check && \ PATH=${PATH} ${BINMAKE} obj >/dev/null 2>&1 && \ PATH=${PATH} ${BINMAKE} >/dev/null 2>&1); \ @@ -288,6 +291,7 @@ upgrade_checks: (cd ${.CURDIR} && ${MAKE} make); \ fi .endif +.endif # # Upgrade make(1) to the current version using the installed @@ -302,12 +306,12 @@ MMAKE=${MMAKEENV} ${MAKE} \ -DNOMAN -DNO_MAN -DNOSHARED -DNO_SHARED \ -DNO_CPU_CFLAGS -DNO_WERROR -make: .PHONY +make bmake: .PHONY @echo @echo "--" @echo ">>> Building an up-to-date make(1)" @echo "--" - ${_+_}@cd ${.CURDIR}/usr.bin/make; \ + ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ ${MMAKE} obj && \ ${MMAKE} depend && \ ${MMAKE} all && \ ___ 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-unsubscr...@freebsd.org"
svn commit: r249396 - in head/sys/amd64: include vmm
Author: neel Date: Fri Apr 12 01:16:52 2013 New Revision: 249396 URL: http://svnweb.freebsd.org/changeset/base/249396 Log: If vmm.ko could not be initialized correctly then prevent the creation of virtual machines subsequently. Submitted by: Chris Torek Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c Modified: head/sys/amd64/include/vmm.h == --- head/sys/amd64/include/vmm.hFri Apr 12 00:34:19 2013 (r249395) +++ head/sys/amd64/include/vmm.hFri Apr 12 01:16:52 2013 (r249396) @@ -87,7 +87,7 @@ struct vmm_ops { extern struct vmm_ops vmm_ops_intel; extern struct vmm_ops vmm_ops_amd; -struct vm *vm_create(const char *name); +int vm_create(const char *name, struct vm **retvm); void vm_destroy(struct vm *vm); const char *vm_name(struct vm *vm); int vm_malloc(struct vm *vm, vm_paddr_t gpa, size_t len); Modified: head/sys/amd64/vmm/vmm.c == --- head/sys/amd64/vmm/vmm.cFri Apr 12 00:34:19 2013(r249395) +++ head/sys/amd64/vmm/vmm.cFri Apr 12 01:16:52 2013(r249396) @@ -103,6 +103,8 @@ struct vm { cpuset_tactive_cpus; }; +static int vmm_initialized; + static struct vmm_ops *ops; #defineVMM_INIT() (ops != NULL ? (*ops->init)() : 0) #defineVMM_CLEANUP() (ops != NULL ? (*ops->cleanup)() : 0) @@ -213,6 +215,8 @@ vmm_handler(module_t mod, int what, void vmmdev_init(); iommu_init(); error = vmm_init(); + if (error == 0) + vmm_initialized = 1; break; case MOD_UNLOAD: error = vmmdev_cleanup(); @@ -221,6 +225,7 @@ vmm_handler(module_t mod, int what, void vmm_ipi_cleanup(); error = VMM_CLEANUP(); } + vmm_initialized = 0; break; default: error = 0; @@ -249,8 +254,8 @@ MODULE_VERSION(vmm, 1); SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL); -struct vm * -vm_create(const char *name) +int +vm_create(const char *name, struct vm **retvm) { int i; struct vm *vm; @@ -258,8 +263,15 @@ vm_create(const char *name) const int BSP = 0; + /* +* If vmm.ko could not be successfully initialized then don't attempt +* to create the virtual machine. +*/ + if (!vmm_initialized) + return (ENXIO); + if (name == NULL || strlen(name) >= VM_MAX_NAMELEN) - return (NULL); + return (EINVAL); vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO); strcpy(vm->name, name); @@ -274,7 +286,8 @@ vm_create(const char *name) vm->iommu = iommu_create_domain(maxaddr); vm_activate_cpu(vm, BSP); - return (vm); + *retvm = vm; + return (0); } static void Modified: head/sys/amd64/vmm/vmm_dev.c == --- head/sys/amd64/vmm/vmm_dev.cFri Apr 12 00:34:19 2013 (r249395) +++ head/sys/amd64/vmm/vmm_dev.cFri Apr 12 01:16:52 2013 (r249396) @@ -475,9 +475,9 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS) if (sc != NULL) return (EEXIST); - vm = vm_create(buf); - if (vm == NULL) - return (EINVAL); + error = vm_create(buf, &vm); + if (error != 0) + return (error); sc = malloc(sizeof(struct vmmdev_softc), M_VMMDEV, M_WAITOK | M_ZERO); sc->vm = vm; ___ 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-unsubscr...@freebsd.org"
svn commit: r249397 - head/release/doc/en_US.ISO8859-1/hardware
Author: delphij Date: Fri Apr 12 02:01:17 2013 New Revision: 249397 URL: http://svnweb.freebsd.org/changeset/base/249397 Log: Fix a few typos. Reviewed by: gjb MFC after:3 days Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml == --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Apr 12 01:16:52 2013(r249396) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Apr 12 02:01:17 2013(r249397) @@ -171,7 +171,7 @@ There is a wide variety of motherboards available for this architecture. Motherboards using the ISA, VLB, EISA, AGP, and - PCI expansion busses are well-supported. There is some + PCI expansion buses are well-supported. There is some limited support for the MCA (MicroChannel) expansion bus used in the IBM PS/2 line of PCs. @@ -200,7 +200,7 @@ memory above 4 gigabytes and allow it to be used by the system. This feature places constraints on the device drivers and other features of &os; which may be used; consult the - &man.pae.4; manpage for more details. + &man.pae.4; manual page for more details. &os; will generally run on i386-based laptops, albeit with varying levels of support for certain hardware features such @@ -533,7 +533,7 @@ The following systems are partially supported by &os;. In - particular the fibre channel controllers in SBus-based systems are not + particular the fiber channel controllers in SBus-based systems are not supported. However, it is possible to use these with a SCSI controller supported by the &man.esp.4 driver (Sun ESP SCSI, Sun FAS Fast-SCSI and Sun FAS366 Fast-Wide SCSI controllers). ___ 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-unsubscr...@freebsd.org"