From owner-svn-src-all@FreeBSD.ORG Sun May 5 06:20:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7B8F0DDE; Sun, 5 May 2013 06:20:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 60A34175; Sun, 5 May 2013 06:20:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r456KrFB043177; Sun, 5 May 2013 06:20:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r456KnAU041737; Sun, 5 May 2013 06:20:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305050620.r456KnAU041737@svn.freebsd.org> From: Xin LI Date: Sun, 5 May 2013 06:20:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250261 - in head/lib/libz: . contrib test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 06:20:53 -0000 Author: delphij Date: Sun May 5 06:20:49 2013 New Revision: 250261 URL: http://svnweb.freebsd.org/changeset/base/250261 Log: MFV: Update zlib to 1.2.8. MFC after: 1 month Modified: head/lib/libz/ChangeLog head/lib/libz/README head/lib/libz/Symbol.map head/lib/libz/Versions.def head/lib/libz/compress.c head/lib/libz/contrib/README.contrib head/lib/libz/deflate.c head/lib/libz/deflate.h head/lib/libz/gzguts.h head/lib/libz/gzlib.c head/lib/libz/gzread.c head/lib/libz/gzwrite.c head/lib/libz/infback.c head/lib/libz/inffast.c head/lib/libz/inflate.c head/lib/libz/inftrees.c head/lib/libz/test/example.c head/lib/libz/test/minigzip.c head/lib/libz/trees.c head/lib/libz/uncompr.c head/lib/libz/zconf.h head/lib/libz/zlib.3 head/lib/libz/zlib.h head/lib/libz/zutil.c head/lib/libz/zutil.h Directory Properties: head/lib/libz/ (props changed) Modified: head/lib/libz/ChangeLog ============================================================================== --- head/lib/libz/ChangeLog Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/ChangeLog Sun May 5 06:20:49 2013 (r250261) @@ -1,6 +1,69 @@ ChangeLog file for zlib +Changes in 1.2.8 (28 Apr 2013) +- Update contrib/minizip/iowin32.c for Windows RT [Vollant] +- Do not force Z_CONST for C++ +- Clean up contrib/vstudio [Ro§] +- Correct spelling error in zlib.h +- Fix mixed line endings in contrib/vstudio + +Changes in 1.2.7.3 (13 Apr 2013) +- Fix version numbers and DLL names in contrib/vstudio/*/zlib.rc + +Changes in 1.2.7.2 (13 Apr 2013) +- Change check for a four-byte type back to hexadecimal +- Fix typo in win32/Makefile.msc +- Add casts in gzwrite.c for pointer differences + +Changes in 1.2.7.1 (24 Mar 2013) +- Replace use of unsafe string functions with snprintf if available +- Avoid including stddef.h on Windows for Z_SOLO compile [Niessink] +- Fix gzgetc undefine when Z_PREFIX set [Turk] +- Eliminate use of mktemp in Makefile (not always available) +- Fix bug in 'F' mode for gzopen() +- Add inflateGetDictionary() function +- Correct comment in deflate.h +- Use _snprintf for snprintf in Microsoft C +- On Darwin, only use /usr/bin/libtool if libtool is not Apple +- Delete "--version" file if created by "ar --version" [Richard G.] +- Fix configure check for veracity of compiler error return codes +- Fix CMake compilation of static lib for MSVC2010 x64 +- Remove unused variable in infback9.c +- Fix argument checks in gzlog_compress() and gzlog_write() +- Clean up the usage of z_const and respect const usage within zlib +- Clean up examples/gzlog.[ch] comparisons of different types +- Avoid shift equal to bits in type (caused endless loop) +- Fix unintialized value bug in gzputc() introduced by const patches +- Fix memory allocation error in examples/zran.c [Nor] +- Fix bug where gzopen(), gzclose() would write an empty file +- Fix bug in gzclose() when gzwrite() runs out of memory +- Check for input buffer malloc failure in examples/gzappend.c +- Add note to contrib/blast to use binary mode in stdio +- Fix comparisons of differently signed integers in contrib/blast +- Check for invalid code length codes in contrib/puff +- Fix serious but very rare decompression bug in inftrees.c +- Update inflateBack() comments, since inflate() can be faster +- Use underscored I/O function names for WINAPI_FAMILY +- Add _tr_flush_bits to the external symbols prefixed by --zprefix +- Add contrib/vstudio/vc10 pre-build step for static only +- Quote --version-script argument in CMakeLists.txt +- Don't specify --version-script on Apple platforms in CMakeLists.txt +- Fix casting error in contrib/testzlib/testzlib.c +- Fix types in contrib/minizip to match result of get_crc_table() +- Simplify contrib/vstudio/vc10 with 'd' suffix +- Add TOP support to win32/Makefile.msc +- Suport i686 and amd64 assembler builds in CMakeLists.txt +- Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h +- Add vc11 and vc12 build files to contrib/vstudio +- Add gzvprintf() as an undocumented function in zlib +- Fix configure for Sun shell +- Remove runtime check in configure for four-byte integer type +- Add casts and consts to ease user conversion to C++ +- Add man pages for minizip and miniunzip +- In Makefile uninstall, don't rm if preceding cd fails +- Do not return Z_BUF_ERROR if deflateParam() has nothing to write + Changes in 1.2.7 (2 May 2012) - Replace use of memmove() with a simple copy for portability - Test for existence of strerror Modified: head/lib/libz/README ============================================================================== --- head/lib/libz/README Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/README Sun May 5 06:20:49 2013 (r250261) @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.7 is a general purpose data compression library. All the code is +zlib 1.2.8 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and @@ -31,7 +31,7 @@ Mark Nelson wrote an ar issue of Dr. Dobb's Journal; a copy of the article is available at http://marknelson.us/1997/01/01/zlib-engine/ . -The changes made in version 1.2.7 are documented in the file ChangeLog. +The changes made in version 1.2.8 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory contrib/ . @@ -84,7 +84,7 @@ Acknowledgments: Copyright notice: - (C) 1995-2012 Jean-loup Gailly and Mark Adler + (C) 1995-2013 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages Modified: head/lib/libz/Symbol.map ============================================================================== --- head/lib/libz/Symbol.map Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/Symbol.map Sun May 5 06:20:49 2013 (r250261) @@ -2,6 +2,11 @@ * $FreeBSD: head/lib/libz/Symbol.map 206709 2010-04-16 20:07:24Z delphij $ */ +ZLIB_1.2.7.1 { + inflateGetDictionary; + gzvprintf; +}; + ZLIB_1.2.7.0 { deflatePending; deflateResetKeep; Modified: head/lib/libz/Versions.def ============================================================================== --- head/lib/libz/Versions.def Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/Versions.def Sun May 5 06:20:49 2013 (r250261) @@ -6,6 +6,9 @@ ZLIB_1.2.4.0 { ZLIB_1.2.7.0 { } ZLIB_1.2.4.0; +ZLIB_1.2.7.1 { +} ZLIB_1.2.7.0; + FBSD_1.2 { } ZLIB_1.2.4.0; Modified: head/lib/libz/compress.c ============================================================================== --- head/lib/libz/compress.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/compress.c Sun May 5 06:20:49 2013 (r250261) @@ -29,7 +29,7 @@ int ZEXPORT compress2 (dest, destLen, so z_stream stream; int err; - stream.next_in = (Bytef*)source; + stream.next_in = (z_const Bytef *)source; stream.avail_in = (uInt)sourceLen; #ifdef MAXSEG_64K /* Check for source > 64K on 16-bit machine: */ Modified: head/lib/libz/contrib/README.contrib ============================================================================== --- head/lib/libz/contrib/README.contrib Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/contrib/README.contrib Sun May 5 06:20:49 2013 (r250261) @@ -75,3 +75,4 @@ untgz/ by Pedro A. Aranda Gutierrez vstudio/ by Gilles Vollant Building a minizip-enhanced zlib with Microsoft Visual Studio + Includes vc11 from kreuzerkrieg and vc12 from davispuh Modified: head/lib/libz/deflate.c ============================================================================== --- head/lib/libz/deflate.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/deflate.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2012 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.7 Copyright 1995-2012 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -305,7 +305,7 @@ int ZEXPORT deflateInit2_(strm, level, m if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL || s->pending_buf == Z_NULL) { s->status = FINISH_STATE; - strm->msg = (char*)ERR_MSG(Z_MEM_ERROR); + strm->msg = ERR_MSG(Z_MEM_ERROR); deflateEnd (strm); return Z_MEM_ERROR; } @@ -329,7 +329,7 @@ int ZEXPORT deflateSetDictionary (strm, uInt str, n; int wrap; unsigned avail; - unsigned char *next; + z_const unsigned char *next; if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) return Z_STREAM_ERROR; @@ -359,7 +359,7 @@ int ZEXPORT deflateSetDictionary (strm, avail = strm->avail_in; next = strm->next_in; strm->avail_in = dictLength; - strm->next_in = (Bytef *)dictionary; + strm->next_in = (z_const Bytef *)dictionary; fill_window(s); while (s->lookahead >= MIN_MATCH) { str = s->strstart; @@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, s strm->total_in != 0) { /* Flush the last buffer: */ err = deflate(strm, Z_BLOCK); + if (err == Z_BUF_ERROR && s->pending == 0) + err = Z_OK; } if (s->level != level) { s->level = level; Modified: head/lib/libz/deflate.h ============================================================================== --- head/lib/libz/deflate.h Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/deflate.h Sun May 5 06:20:49 2013 (r250261) @@ -104,7 +104,7 @@ typedef struct internal_state { int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ + Byte method; /* can only be DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ /* used by deflate.c: */ Modified: head/lib/libz/gzguts.h ============================================================================== --- head/lib/libz/gzguts.h Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/gzguts.h Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* gzguts.h -- zlib internal header definitions for gz* operations - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -35,6 +35,13 @@ # include #endif +#ifdef WINAPI_FAMILY +# define open _open +# define read _read +# define write _write +# define close _close +#endif + #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif @@ -60,7 +67,7 @@ #ifndef HAVE_VSNPRINTF # ifdef MSDOS /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ + but for now we just assume it doesn't. */ # define NO_vsnprintf # endif # ifdef __TURBOC__ @@ -88,6 +95,14 @@ # endif #endif +/* unlike snprintf (which is required in C99, yet still not supported by + Microsoft more than a decade later!), _snprintf does not guarantee null + termination of the result -- however this is only used in gzlib.c where + the result is assured to fit in the space provided */ +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + #ifndef local # define local static #endif @@ -127,7 +142,8 @@ # define DEF_MEM_LEVEL MAX_MEM_LEVEL #endif -/* default i/o buffer size -- double this for output when reading */ +/* default i/o buffer size -- double this for output when reading (this and + twice this must be able to fit in an unsigned type) */ #define GZBUFSIZE 8192 /* gzip modes, also provide a little integrity check on the passed structure */ Modified: head/lib/libz/gzlib.c ============================================================================== --- head/lib/libz/gzlib.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/gzlib.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* gzlib.c -- zlib functions common to reading and writing gzip files - * Copyright (C) 2004, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -111,7 +111,7 @@ local gzFile gz_open(path, fd, mode) return NULL; /* allocate gzFile structure to return */ - state = malloc(sizeof(gz_state)); + state = (gz_statep)malloc(sizeof(gz_state)); if (state == NULL) return NULL; state->size = 0; /* no buffers allocated yet */ @@ -165,8 +165,10 @@ local gzFile gz_open(path, fd, mode) break; case 'F': state->strategy = Z_FIXED; + break; case 'T': state->direct = 1; + break; default: /* could consider as an error, but just ignore */ ; } @@ -197,8 +199,8 @@ local gzFile gz_open(path, fd, mode) } else #endif - len = strlen(path); - state->path = malloc(len + 1); + len = strlen((const char *)path); + state->path = (char *)malloc(len + 1); if (state->path == NULL) { free(state); return NULL; @@ -211,7 +213,11 @@ local gzFile gz_open(path, fd, mode) *(state->path) = 0; else #endif +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(state->path, len + 1, "%s", (const char *)path); +#else strcpy(state->path, path); +#endif /* compute the flags for open() */ oflag = @@ -239,7 +245,7 @@ local gzFile gz_open(path, fd, mode) #ifdef _WIN32 fd == -2 ? _wopen(path, oflag, 0666) : #endif - open(path, oflag, 0666)); + open((const char *)path, oflag, 0666)); if (state->fd == -1) { free(state->path); free(state); @@ -285,9 +291,13 @@ gzFile ZEXPORT gzdopen(fd, mode) char *path; /* identifier for error messages */ gzFile gz; - if (fd == -1 || (path = malloc(7 + 3 * sizeof(int))) == NULL) + if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) return NULL; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(path, 7 + 3 * sizeof(int), "", fd); /* for debugging */ +#else sprintf(path, "", fd); /* for debugging */ +#endif gz = gz_open(path, fd, mode); free(path); return gz; @@ -534,7 +544,8 @@ const char * ZEXPORT gzerror(file, errnu /* return error information */ if (errnum != NULL) *errnum = state->err; - return state->msg == NULL ? "" : state->msg; + return state->err == Z_MEM_ERROR ? "out of memory" : + (state->msg == NULL ? "" : state->msg); } /* -- see zlib.h -- */ @@ -585,21 +596,24 @@ void ZLIB_INTERNAL gz_error(state, err, if (msg == NULL) return; - /* for an out of memory error, save as static string */ - if (err == Z_MEM_ERROR) { - state->msg = (char *)msg; + /* for an out of memory error, return literal string when requested */ + if (err == Z_MEM_ERROR) return; - } /* construct error message with path */ - if ((state->msg = malloc(strlen(state->path) + strlen(msg) + 3)) == NULL) { + if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == + NULL) { state->err = Z_MEM_ERROR; - state->msg = (char *)"out of memory"; return; } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, + "%s%s%s", state->path, ": ", msg); +#else strcpy(state->msg, state->path); strcat(state->msg, ": "); strcat(state->msg, msg); +#endif return; } Modified: head/lib/libz/gzread.c ============================================================================== --- head/lib/libz/gzread.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/gzread.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* gzread.c -- zlib functions for reading gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -61,7 +61,8 @@ local int gz_avail(state) return -1; if (state->eof == 0) { if (strm->avail_in) { /* copy what's there to the start */ - unsigned char *p = state->in, *q = strm->next_in; + unsigned char *p = state->in; + unsigned const char *q = strm->next_in; unsigned n = strm->avail_in; do { *p++ = *q++; @@ -93,8 +94,8 @@ local int gz_look(state) /* allocate read buffers and inflate memory */ if (state->size == 0) { /* allocate buffers */ - state->in = malloc(state->want); - state->out = malloc(state->want << 1); + state->in = (unsigned char *)malloc(state->want); + state->out = (unsigned char *)malloc(state->want << 1); if (state->in == NULL || state->out == NULL) { if (state->out != NULL) free(state->out); @@ -355,14 +356,14 @@ int ZEXPORT gzread(file, buf, len) /* large len -- read directly into user buffer */ else if (state->how == COPY) { /* read directly */ - if (gz_load(state, buf, len, &n) == -1) + if (gz_load(state, (unsigned char *)buf, len, &n) == -1) return -1; } /* large len -- decompress directly into user buffer */ else { /* state->how == GZIP */ strm->avail_out = len; - strm->next_out = buf; + strm->next_out = (unsigned char *)buf; if (gz_decomp(state) == -1) return -1; n = state->x.have; @@ -381,7 +382,11 @@ int ZEXPORT gzread(file, buf, len) } /* -- see zlib.h -- */ -#undef gzgetc +#ifdef Z_PREFIX_SET +# undef z_gzgetc +#else +# undef gzgetc +#endif int ZEXPORT gzgetc(file) gzFile file; { @@ -521,7 +526,7 @@ char * ZEXPORT gzgets(file, buf, len) /* look for end-of-line in current output buffer */ n = state->x.have > left ? left : state->x.have; - eol = memchr(state->x.next, '\n', n); + eol = (unsigned char *)memchr(state->x.next, '\n', n); if (eol != NULL) n = (unsigned)(eol - state->x.next) + 1; Modified: head/lib/libz/gzwrite.c ============================================================================== --- head/lib/libz/gzwrite.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/gzwrite.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* gzwrite.c -- zlib functions for writing gzip files - * Copyright (C) 2004, 2005, 2010, 2011, 2012 Mark Adler + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -22,7 +22,7 @@ local int gz_init(state) z_streamp strm = &(state->strm); /* allocate input buffer */ - state->in = malloc(state->want); + state->in = (unsigned char *)malloc(state->want); if (state->in == NULL) { gz_error(state, Z_MEM_ERROR, "out of memory"); return -1; @@ -31,7 +31,7 @@ local int gz_init(state) /* only need output buffer and deflate state if compressing */ if (!state->direct) { /* allocate output buffer */ - state->out = malloc(state->want); + state->out = (unsigned char *)malloc(state->want); if (state->out == NULL) { free(state->in); gz_error(state, Z_MEM_ERROR, "out of memory"); @@ -171,7 +171,6 @@ int ZEXPORT gzwrite(file, buf, len) unsigned len; { unsigned put = len; - unsigned n; gz_statep state; z_streamp strm; @@ -211,16 +210,19 @@ int ZEXPORT gzwrite(file, buf, len) if (len < state->size) { /* copy to input buffer, compress when full */ do { + unsigned have, copy; + if (strm->avail_in == 0) strm->next_in = state->in; - n = state->size - strm->avail_in; - if (n > len) - n = len; - memcpy(strm->next_in + strm->avail_in, buf, n); - strm->avail_in += n; - state->x.pos += n; - buf = (char *)buf + n; - len -= n; + have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + copy = state->size - have; + if (copy > len) + copy = len; + memcpy(state->in + have, buf, copy); + strm->avail_in += copy; + state->x.pos += copy; + buf = (const char *)buf + copy; + len -= copy; if (len && gz_comp(state, Z_NO_FLUSH) == -1) return 0; } while (len); @@ -232,7 +234,7 @@ int ZEXPORT gzwrite(file, buf, len) /* directly compress user buffer to file */ strm->avail_in = len; - strm->next_in = (voidp)buf; + strm->next_in = (z_const Bytef *)buf; state->x.pos += len; if (gz_comp(state, Z_NO_FLUSH) == -1) return 0; @@ -247,6 +249,7 @@ int ZEXPORT gzputc(file, c) gzFile file; int c; { + unsigned have; unsigned char buf[1]; gz_statep state; z_streamp strm; @@ -270,12 +273,16 @@ int ZEXPORT gzputc(file, c) /* try writing to input buffer for speed (state->size == 0 if buffer not initialized) */ - if (strm->avail_in < state->size) { + if (state->size) { if (strm->avail_in == 0) strm->next_in = state->in; - strm->next_in[strm->avail_in++] = c; - state->x.pos++; - return c & 0xff; + have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + if (have < state->size) { + state->in[have] = c; + strm->avail_in++; + state->x.pos++; + return c & 0xff; + } } /* no room in buffer or not initialized, use gz_write() */ @@ -303,12 +310,11 @@ int ZEXPORT gzputs(file, str) #include /* -- see zlib.h -- */ -int ZEXPORTVA gzprintf (gzFile file, const char *format, ...) +int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) { int size, len; gz_statep state; z_streamp strm; - va_list va; /* get internal structure */ if (file == NULL) @@ -338,25 +344,20 @@ int ZEXPORTVA gzprintf (gzFile file, con /* do the printf() into the input buffer, put length in len */ size = (int)(state->size); state->in[size - 1] = 0; - va_start(va, format); #ifdef NO_vsnprintf # ifdef HAS_vsprintf_void (void)vsprintf((char *)(state->in), format, va); - va_end(va); for (len = 0; len < size; len++) if (state->in[len] == 0) break; # else len = vsprintf((char *)(state->in), format, va); - va_end(va); # endif #else # ifdef HAS_vsnprintf_void (void)vsnprintf((char *)(state->in), size, format, va); - va_end(va); len = strlen((char *)(state->in)); # else len = vsnprintf((char *)(state->in), size, format, va); - va_end(va); # endif #endif @@ -371,6 +372,17 @@ int ZEXPORTVA gzprintf (gzFile file, con return len; } +int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) +{ + va_list va; + int ret; + + va_start(va, format); + ret = gzvprintf(file, format, va); + va_end(va); + return ret; +} + #else /* !STDC && !Z_HAVE_STDARG_H */ /* -- see zlib.h -- */ @@ -550,9 +562,9 @@ int ZEXPORT gzclose_w(file) } /* flush, free memory, and close file */ + if (gz_comp(state, Z_FINISH) == -1) + ret = state->err; if (state->size) { - if (gz_comp(state, Z_FINISH) == -1) - ret = state->err; if (!state->direct) { (void)deflateEnd(&(state->strm)); free(state->out); Modified: head/lib/libz/infback.c ============================================================================== --- head/lib/libz/infback.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/infback.c Sun May 5 06:20:49 2013 (r250261) @@ -255,7 +255,7 @@ out_func out; void FAR *out_desc; { struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ + z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ Modified: head/lib/libz/inffast.c ============================================================================== --- head/lib/libz/inffast.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/inffast.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010 Mark Adler + * Copyright (C) 1995-2008, 2010, 2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -69,8 +69,8 @@ z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ + z_const unsigned char FAR *in; /* local strm->next_in */ + z_const unsigned char FAR *last; /* have enough input while in < last */ unsigned char FAR *out; /* local strm->next_out */ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ Modified: head/lib/libz/inflate.c ============================================================================== --- head/lib/libz/inflate.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/inflate.c Sun May 5 06:20:49 2013 (r250261) @@ -93,11 +93,12 @@ /* function prototypes */ local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); +local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, + unsigned copy)); #ifdef BUILDFIXED void makefixed OF((void)); #endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, +local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); int ZEXPORT inflateResetKeep(strm) @@ -375,12 +376,13 @@ void makefixed() output will fall in the output data, making match copies simpler and faster. The advantage may be dependent on the size of the processor's data caches. */ -local int updatewindow(strm, out) +local int updatewindow(strm, end, copy) z_streamp strm; -unsigned out; +const Bytef *end; +unsigned copy; { struct inflate_state FAR *state; - unsigned copy, dist; + unsigned dist; state = (struct inflate_state FAR *)strm->state; @@ -400,19 +402,18 @@ unsigned out; } /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); + zmemcpy(state->window, end - state->wsize, state->wsize); state->wnext = 0; state->whave = state->wsize; } else { dist = state->wsize - state->wnext; if (dist > copy) dist = copy; - zmemcpy(state->window + state->wnext, strm->next_out - copy, dist); + zmemcpy(state->window + state->wnext, end - copy, dist); copy -= dist; if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); + zmemcpy(state->window, end - copy, copy); state->wnext = copy; state->whave = state->wsize; } @@ -606,7 +607,7 @@ z_streamp strm; int flush; { struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ + z_const unsigned char FAR *next; /* next input */ unsigned char FAR *put; /* next output */ unsigned have, left; /* available input and output */ unsigned long hold; /* bit buffer */ @@ -920,7 +921,7 @@ int flush; while (state->have < 19) state->lens[order[state->have++]] = 0; state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (const code FAR *)(state->next); state->lenbits = 7; ret = inflate_table(CODES, state->lens, 19, &(state->next), &(state->lenbits), state->work); @@ -994,7 +995,7 @@ int flush; values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ state->next = state->codes; - state->lencode = (code const FAR *)(state->next); + state->lencode = (const code FAR *)(state->next); state->lenbits = 9; ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), &(state->lenbits), state->work); @@ -1003,7 +1004,7 @@ int flush; state->mode = BAD; break; } - state->distcode = (code const FAR *)(state->next); + state->distcode = (const code FAR *)(state->next); state->distbits = 6; ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, &(state->next), &(state->distbits), state->work); @@ -1230,7 +1231,7 @@ int flush; RESTORE(); if (state->wsize || (out != strm->avail_out && state->mode < BAD && (state->mode < CHECK || flush != Z_FINISH))) - if (updatewindow(strm, out)) { + if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { state->mode = MEM; return Z_MEM_ERROR; } @@ -1264,6 +1265,29 @@ z_streamp strm; return Z_OK; } +int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) +z_streamp strm; +Bytef *dictionary; +uInt *dictLength; +{ + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + + /* copy dictionary */ + if (state->whave && dictionary != Z_NULL) { + zmemcpy(dictionary, state->window + state->wnext, + state->whave - state->wnext); + zmemcpy(dictionary + state->whave - state->wnext, + state->window, state->wnext); + } + if (dictLength != Z_NULL) + *dictLength = state->whave; + return Z_OK; +} + int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) z_streamp strm; const Bytef *dictionary; @@ -1271,8 +1295,6 @@ uInt dictLength; { struct inflate_state FAR *state; unsigned long dictid; - unsigned char *next; - unsigned avail; int ret; /* check state */ @@ -1291,13 +1313,7 @@ uInt dictLength; /* copy dictionary to window using updatewindow(), which will amend the existing dictionary if appropriate */ - next = strm->next_out; - avail = strm->avail_out; - strm->next_out = (Bytef *)dictionary + dictLength; - strm->avail_out = 0; - ret = updatewindow(strm, dictLength); - strm->avail_out = avail; - strm->next_out = next; + ret = updatewindow(strm, dictionary + dictLength, dictLength); if (ret) { state->mode = MEM; return Z_MEM_ERROR; @@ -1337,7 +1353,7 @@ gz_headerp head; */ local unsigned syncsearch(have, buf, len) unsigned FAR *have; -unsigned char FAR *buf; +const unsigned char FAR *buf; unsigned len; { unsigned got; Modified: head/lib/libz/inftrees.c ============================================================================== --- head/lib/libz/inftrees.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/inftrees.c Sun May 5 06:20:49 2013 (r250261) @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2012 Mark Adler + * Copyright (C) 1995-2013 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.7 Copyright 1995-2012 Mark Adler "; + " inflate 1.2.8 Copyright 1995-2013 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 78, 68}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -208,8 +208,8 @@ unsigned short FAR *work; mask = used - 1; /* mask for comparing low */ /* check available table space */ - if ((type == LENS && used >= ENOUGH_LENS) || - (type == DISTS && used >= ENOUGH_DISTS)) + if ((type == LENS && used > ENOUGH_LENS) || + (type == DISTS && used > ENOUGH_DISTS)) return 1; /* process all codes and make table entries */ @@ -277,8 +277,8 @@ unsigned short FAR *work; /* check for enough space */ used += 1U << curr; - if ((type == LENS && used >= ENOUGH_LENS) || - (type == DISTS && used >= ENOUGH_DISTS)) + if ((type == LENS && used > ENOUGH_LENS) || + (type == DISTS && used > ENOUGH_DISTS)) return 1; /* point entry in root table to sub-table */ Modified: head/lib/libz/test/example.c ============================================================================== --- head/lib/libz/test/example.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/test/example.c Sun May 5 06:20:49 2013 (r250261) @@ -26,7 +26,7 @@ } \ } -const char hello[] = "hello, hello!"; +z_const char hello[] = "hello, hello!"; /* "hello world" would be more standard, but the repeated "hello" * stresses the compression code better, sorry... */ @@ -212,7 +212,7 @@ void test_deflate(compr, comprLen) err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); CHECK_ERR(err, "deflateInit"); - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.next_out = compr; while (c_stream.total_in != len && c_stream.total_out < comprLen) { @@ -387,7 +387,7 @@ void test_flush(compr, comprLen) err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION); CHECK_ERR(err, "deflateInit"); - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.next_out = compr; c_stream.avail_in = 3; c_stream.avail_out = (uInt)*comprLen; @@ -476,7 +476,7 @@ void test_dict_deflate(compr, comprLen) c_stream.next_out = compr; c_stream.avail_out = (uInt)comprLen; - c_stream.next_in = (Bytef*)hello; + c_stream.next_in = (z_const unsigned char *)hello; c_stream.avail_in = (uInt)strlen(hello)+1; err = deflate(&c_stream, Z_FINISH); Modified: head/lib/libz/test/minigzip.c ============================================================================== --- head/lib/libz/test/minigzip.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/test/minigzip.c Sun May 5 06:20:49 2013 (r250261) @@ -40,6 +40,10 @@ # define SET_BINARY_MODE(file) #endif +#ifdef _MSC_VER +# define snprintf _snprintf +#endif + #ifdef VMS # define unlink delete # define GZ_SUFFIX "-gz" @@ -463,8 +467,12 @@ void file_compress(file, mode) exit(1); } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(outfile, sizeof(outfile), "%s%s", file, GZ_SUFFIX); +#else strcpy(outfile, file); strcat(outfile, GZ_SUFFIX); +#endif in = fopen(file, "rb"); if (in == NULL) { @@ -499,7 +507,11 @@ void file_uncompress(file) exit(1); } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(buf, sizeof(buf), "%s", file); +#else strcpy(buf, file); +#endif if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) { infile = file; @@ -508,7 +520,11 @@ void file_uncompress(file) } else { outfile = file; infile = buf; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(buf + len, sizeof(buf) - len, "%s", GZ_SUFFIX); +#else strcat(infile, GZ_SUFFIX); +#endif } in = gzopen(infile, "rb"); if (in == NULL) { @@ -546,7 +562,11 @@ int main(argc, argv) gzFile file; char *bname, outmode[20]; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + snprintf(outmode, sizeof(outmode), "%s", "wb6 "); +#else strcpy(outmode, "wb6 "); +#endif prog = argv[0]; bname = strrchr(argv[0], '/'); Modified: head/lib/libz/trees.c ============================================================================== --- head/lib/libz/trees.c Sat May 4 23:33:54 2013 (r250260) +++ head/lib/libz/trees.c Sun May 5 06:20:49 2013 (r250261) @@ -146,8 +146,8 @@ local void send_tree OF((deflate_st local int build_bl_tree OF((deflate_state *s)); local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes, int blcodes)); -local void compress_block OF((deflate_state *s, ct_data *ltree, - ct_data *dtree)); +local void compress_block OF((deflate_state *s, const ct_data *ltree, + const ct_data *dtree)); local int detect_data_type OF((deflate_state *s)); local unsigned bi_reverse OF((unsigned value, int length)); local void bi_windup OF((deflate_state *s)); @@ -972,7 +972,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, bu } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+last, 3); - compress_block(s, (ct_data *)static_ltree, (ct_data *)static_dtree); + compress_block(s, (const ct_data *)static_ltree, + (const ct_data *)static_dtree); #ifdef DEBUG s->compressed_len += 3 + s->static_len; #endif @@ -980,7 +981,8 @@ void ZLIB_INTERNAL _tr_flush_block(s, bu send_bits(s, (DYN_TREES<<1)+last, 3); send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1, max_blindex+1); - compress_block(s, (ct_data *)s->dyn_ltree, (ct_data *)s->dyn_dtree); + compress_block(s, (const ct_data *)s->dyn_ltree, + (const ct_data *)s->dyn_dtree); #ifdef DEBUG s->compressed_len += 3 + s->opt_len; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun May 5 06:25:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C1AD6F8E; Sun, 5 May 2013 06:25:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B45B0196; Sun, 5 May 2013 06:25:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r456PTEa044192; Sun, 5 May 2013 06:25:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r456PT7g044191; Sun, 5 May 2013 06:25:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305050625.r456PT7g044191@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 5 May 2013 06:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250262 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 06:25:29 -0000 Author: kib Date: Sun May 5 06:25:28 2013 New Revision: 250262 URL: http://svnweb.freebsd.org/changeset/base/250262 Log: MFC r250026: Convert panic() into KASSERT(). Modified: stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Sun May 5 06:20:49 2013 (r250261) +++ stable/9/sys/vm/vnode_pager.c Sun May 5 06:25:28 2013 (r250262) @@ -213,8 +213,7 @@ retry: msleep(object, VM_OBJECT_MTX(object), PDROP | PVM, "vadead", 0); } - if (vp->v_usecount == 0) - panic("vnode_pager_alloc: no vnode reference"); + KASSERT(vp->v_usecount != 0, ("vnode_pager_alloc: no vnode reference")); if (object == NULL) { /* From owner-svn-src-all@FreeBSD.ORG Sun May 5 06:32:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1CAEF1B1; Sun, 5 May 2013 06:32:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEF51B2; Sun, 5 May 2013 06:32:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r456WDcJ047024; Sun, 5 May 2013 06:32:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r456WDUm047023; Sun, 5 May 2013 06:32:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305050632.r456WDUm047023@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 5 May 2013 06:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250263 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 06:32:14 -0000 Author: kib Date: Sun May 5 06:32:13 2013 New Revision: 250263 URL: http://svnweb.freebsd.org/changeset/base/250263 Log: MFC r250028: Assert that the object type for the vnode' non-NULL v_object, passed to vnode_pager_setsize(), is either OBJT_VNODE, or, if vnode was already reclaimed, OBJT_DEAD. More, if the object is terminated, do not perform the resizing operation. Modified: stable/9/sys/vm/vnode_pager.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vnode_pager.c ============================================================================== --- stable/9/sys/vm/vnode_pager.c Sun May 5 06:25:28 2013 (r250262) +++ stable/9/sys/vm/vnode_pager.c Sun May 5 06:32:13 2013 (r250263) @@ -380,6 +380,12 @@ vnode_pager_setsize(vp, nsize) return; /* ASSERT_VOP_ELOCKED(vp, "vnode_pager_setsize and not locked vnode"); */ VM_OBJECT_LOCK(object); + if (object->type == OBJT_DEAD) { + VM_OBJECT_UNLOCK(object); + return; + } + KASSERT(object->type == OBJT_VNODE, + ("not vnode-backed object %p", object)); if (nsize == object->un_pager.vnp.vnp_size) { /* * Hasn't changed size From owner-svn-src-all@FreeBSD.ORG Sun May 5 08:00:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4DF7A1B4; Sun, 5 May 2013 08:00:17 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4162435D; Sun, 5 May 2013 08:00:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4580HBk076304; Sun, 5 May 2013 08:00:17 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4580HrN076303; Sun, 5 May 2013 08:00:17 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201305050800.r4580HrN076303@svn.freebsd.org> From: Stanislav Sedov Date: Sun, 5 May 2013 08:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250264 - head/sys/geom/label X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 08:00:17 -0000 Author: stas Date: Sun May 5 08:00:16 2013 New Revision: 250264 URL: http://svnweb.freebsd.org/changeset/base/250264 Log: - Use int8_t type for the mftrecsz field in g_label_ntfs. char type used previously caused probe failure on platforms where char is unsigned (e.g. ARM), as mftrecsz can be negative. Submitted by: Ilya Bakulin MFC after: 2 weeks Modified: head/sys/geom/label/g_label_ntfs.c Modified: head/sys/geom/label/g_label_ntfs.c ============================================================================== --- head/sys/geom/label/g_label_ntfs.c Sun May 5 06:32:13 2013 (r250263) +++ head/sys/geom/label/g_label_ntfs.c Sun May 5 08:00:16 2013 (r250264) @@ -86,7 +86,7 @@ struct ntfs_bootfile { uint64_t bf_spv; uint64_t bf_mftcn; uint64_t bf_mftmirrcn; - uint8_t bf_mftrecsz; + int8_t bf_mftrecsz; uint32_t bf_ibsz; uint32_t bf_volsn; } __packed; @@ -100,7 +100,8 @@ g_label_ntfs_taste(struct g_consumer *cp struct ntfs_attr *atr; off_t voloff; char *filerecp, *ap; - char mftrecsz, vnchar; + int8_t mftrecsz; + char vnchar; int recsize, j; g_topology_assert_not(); @@ -113,7 +114,7 @@ g_label_ntfs_taste(struct g_consumer *cp if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; - mftrecsz = (char)bf->bf_mftrecsz; + mftrecsz = bf->bf_mftrecsz; recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); if (recsize == 0 || recsize % pp->sectorsize != 0) goto done; From owner-svn-src-all@FreeBSD.ORG Sun May 5 09:38:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A315897; Sun, 5 May 2013 09:38:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 93DC17E5; Sun, 5 May 2013 09:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r459c2i7010966; Sun, 5 May 2013 09:38:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r459c2tu010965; Sun, 5 May 2013 09:38:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305050938.r459c2tu010965@svn.freebsd.org> From: Adrian Chadd Date: Sun, 5 May 2013 09:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250265 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 09:38:02 -0000 Author: adrian Date: Sun May 5 09:38:02 2013 New Revision: 250265 URL: http://svnweb.freebsd.org/changeset/base/250265 Log: This is a simple script to output the delta between each TX and TXSTATUS. Useful for debugging TDMA. Added: head/tools/tools/ath/athalq/txdiff.pl (contents, props changed) Added: head/tools/tools/ath/athalq/txdiff.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athalq/txdiff.pl Sun May 5 09:38:02 2013 (r250265) @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +use strict; + +# $FreeBSD$ + +# [1360537229.753890] [100494] TXD +# [1360537229.754292] [100494] TXSTATUS: TxDone=1, TS=0x5ccfa5c7 + +my ($tv_sec) = 0; +my ($tv_usec) = 0; + +sub tvdiff($$$$) { + my ($tv1_sec, $tv1_usec, $tv2_sec, $tv2_usec) = @_; + + if ($tv2_usec < $tv1_usec) { + $tv2_usec += 1000000; + $tv1_sec = $tv1_sec + 1; + } + + return ($tv2_sec - $tv1_sec) * 1000000 + ($tv2_usec - $tv1_usec); +} + +while (<>) { + chomp; + m/^\[(.*?)\.(.*?)\]/ || next; + printf "%d\t| %s\n", tvdiff($tv_sec, $tv_usec, $1, $2), $_; +# if (tvdiff($tv_sec, $tv_usec, $1, $2) > 500) { +# printf "%d\t| %s\n", tvdiff($tv_sec, $tv_usec, $1, $2), $_; +# } + $tv_sec = $1; + $tv_usec = $2; +} + From owner-svn-src-all@FreeBSD.ORG Sun May 5 09:38:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDC4E205; Sun, 5 May 2013 09:38:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E01C17E8; Sun, 5 May 2013 09:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r459cQUo011067; Sun, 5 May 2013 09:38:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r459cQ53011064; Sun, 5 May 2013 09:38:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305050938.r459cQ53011064@svn.freebsd.org> From: Adrian Chadd Date: Sun, 5 May 2013 09:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250266 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 09:38:27 -0000 Author: adrian Date: Sun May 5 09:38:25 2013 New Revision: 250266 URL: http://svnweb.freebsd.org/changeset/base/250266 Log: Add the AR9300 descriptor decoding code. Modified: head/tools/tools/ath/athalq/Makefile head/tools/tools/ath/athalq/ar9300_ds.c head/tools/tools/ath/athalq/main.c Modified: head/tools/tools/ath/athalq/Makefile ============================================================================== --- head/tools/tools/ath/athalq/Makefile Sun May 5 09:38:02 2013 (r250265) +++ head/tools/tools/ath/athalq/Makefile Sun May 5 09:38:25 2013 (r250266) @@ -3,8 +3,10 @@ PROG= athalq NOMAN= yes +CFLAGS+= -I../../../../sys/contrib + SRCS= main.c ar5210_ds.c ar5211_ds.c ar5212_ds.c ar5416_ds.c tdma.c -# SRCS+= ar9300_ds.c +SRCS+= ar9300_ds.c .include <../Makefile.inc> Modified: head/tools/tools/ath/athalq/ar9300_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar9300_ds.c Sun May 5 09:38:02 2013 (r250265) +++ head/tools/tools/ath/athalq/ar9300_ds.c Sun May 5 09:38:25 2013 (r250266) @@ -29,7 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "ar9300_ds.h" Modified: head/tools/tools/ath/athalq/main.c ============================================================================== --- head/tools/tools/ath/athalq/main.c Sun May 5 09:38:02 2013 (r250265) +++ head/tools/tools/ath/athalq/main.c Sun May 5 09:38:25 2013 (r250266) @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include -#if 0 +#if 1 #include "ar9300_ds.h" #endif #include "ar5210_ds.h" @@ -156,7 +156,7 @@ main(int argc, const char *argv[]) ar5212_alq_payload(a); else if (be32toh(hdr.sc_hal_magic) == AR5416_MAGIC) ar5416_alq_payload(a); -#if 0 +#if 1 else if (be32toh(hdr.sc_hal_magic) == AR9300_MAGIC) ar9300_alq_payload(a); #endif From owner-svn-src-all@FreeBSD.ORG Sun May 5 10:51:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B100CDB4; Sun, 5 May 2013 10:51:41 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3A4C955; Sun, 5 May 2013 10:51:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45Apfnu037529; Sun, 5 May 2013 10:51:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45Apewp037524; Sun, 5 May 2013 10:51:40 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305051051.r45Apewp037524@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 5 May 2013 10:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250267 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 10:51:41 -0000 Author: jilles Date: Sun May 5 10:51:40 2013 New Revision: 250267 URL: http://svnweb.freebsd.org/changeset/base/250267 Log: sh: Use O_CLOEXEC and F_DUPFD_CLOEXEC instead of separate fcntl() call. Modified: head/bin/sh/input.c head/bin/sh/jobs.c head/bin/sh/main.c head/bin/sh/redir.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sun May 5 09:38:25 2013 (r250266) +++ head/bin/sh/input.c Sun May 5 10:51:40 2013 (r250267) @@ -397,10 +397,10 @@ setinputfile(const char *fname, int push int fd2; INTOFF; - if ((fd = open(fname, O_RDONLY)) < 0) + if ((fd = open(fname, O_RDONLY | O_CLOEXEC)) < 0) error("cannot open %s: %s", fname, strerror(errno)); if (fd < 10) { - fd2 = fcntl(fd, F_DUPFD, 10); + fd2 = fcntl(fd, F_DUPFD_CLOEXEC, 10); close(fd); if (fd2 < 0) error("Out of file descriptors"); @@ -412,14 +412,13 @@ setinputfile(const char *fname, int push /* - * Like setinputfile, but takes an open file descriptor. Call this with - * interrupts off. + * Like setinputfile, but takes an open file descriptor (which should have + * its FD_CLOEXEC flag already set). Call this with interrupts off. */ void setinputfd(int fd, int push) { - (void)fcntl(fd, F_SETFD, FD_CLOEXEC); if (push) { pushfile(); parsefile->buf = ckmalloc(BUFSIZ + 1); Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun May 5 09:38:25 2013 (r250266) +++ head/bin/sh/jobs.c Sun May 5 10:51:40 2013 (r250267) @@ -127,11 +127,12 @@ setjobctl(int on) if (on) { if (ttyfd != -1) close(ttyfd); - if ((ttyfd = open(_PATH_TTY, O_RDWR)) < 0) { + if ((ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC)) < 0) { i = 0; while (i <= 2 && !isatty(i)) i++; - if (i > 2 || (ttyfd = fcntl(i, F_DUPFD, 10)) < 0) + if (i > 2 || + (ttyfd = fcntl(i, F_DUPFD_CLOEXEC, 10)) < 0) goto out; } if (ttyfd < 10) { @@ -139,7 +140,7 @@ setjobctl(int on) * Keep our TTY file descriptor out of the way of * the user's redirections. */ - if ((i = fcntl(ttyfd, F_DUPFD, 10)) < 0) { + if ((i = fcntl(ttyfd, F_DUPFD_CLOEXEC, 10)) < 0) { close(ttyfd); ttyfd = -1; goto out; @@ -147,11 +148,6 @@ setjobctl(int on) close(ttyfd); ttyfd = i; } - if (fcntl(ttyfd, F_SETFD, FD_CLOEXEC) < 0) { - close(ttyfd); - ttyfd = -1; - goto out; - } do { /* while we are in the background */ initialpgrp = tcgetpgrp(ttyfd); if (initialpgrp < 0) { Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun May 5 09:38:25 2013 (r250266) +++ head/bin/sh/main.c Sun May 5 10:51:40 2013 (r250267) @@ -248,7 +248,7 @@ read_profile(const char *name) if (expandedname == NULL) return; INTOFF; - if ((fd = open(expandedname, O_RDONLY)) >= 0) + if ((fd = open(expandedname, O_RDONLY | O_CLOEXEC)) >= 0) setinputfd(fd, 1); INTON; if (fd < 0) Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Sun May 5 09:38:25 2013 (r250266) +++ head/bin/sh/redir.c Sun May 5 10:51:40 2013 (r250267) @@ -121,7 +121,7 @@ redirect(union node *redir, int flags) if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { INTOFF; - if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { + if ((i = fcntl(fd, F_DUPFD_CLOEXEC, 10)) == -1) { switch (errno) { case EBADF: i = CLOSED; @@ -131,8 +131,7 @@ redirect(union node *redir, int flags) error("%d: %s", fd, strerror(errno)); break; } - } else - (void)fcntl(i, F_SETFD, FD_CLOEXEC); + } sv->renamed[fd] = i; INTON; } From owner-svn-src-all@FreeBSD.ORG Sun May 5 15:04:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7888DF70; Sun, 5 May 2013 15:04:49 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 69774133; Sun, 5 May 2013 15:04:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45F4nfi025253; Sun, 5 May 2013 15:04:49 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45F4mTf025244; Sun, 5 May 2013 15:04:48 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051504.r45F4mTf025244@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 15:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250274 - in vendor/tnftp/dist: . buildaux libedit libnetbsd src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 15:04:49 -0000 Author: gavin Date: Sun May 5 15:04:47 2013 New Revision: 250274 URL: http://svnweb.freebsd.org/changeset/base/250274 Log: Vendor import of tnftp-20130505. Added: vendor/tnftp/dist/buildaux/ax_check_openssl.m4 (contents, props changed) vendor/tnftp/dist/buildaux/libtool.m4 (contents, props changed) vendor/tnftp/dist/buildaux/ltoptions.m4 (contents, props changed) vendor/tnftp/dist/buildaux/ltsugar.m4 (contents, props changed) vendor/tnftp/dist/buildaux/ltversion.m4 (contents, props changed) vendor/tnftp/dist/buildaux/lt~obsolete.m4 (contents, props changed) vendor/tnftp/dist/src/ssl.c (contents, props changed) vendor/tnftp/dist/src/ssl.h (contents, props changed) Modified: vendor/tnftp/dist/ChangeLog vendor/tnftp/dist/Makefile.am vendor/tnftp/dist/Makefile.in vendor/tnftp/dist/NEWS vendor/tnftp/dist/THANKS vendor/tnftp/dist/aclocal.m4 vendor/tnftp/dist/buildaux/config.guess vendor/tnftp/dist/buildaux/config.sub vendor/tnftp/dist/buildaux/install-sh vendor/tnftp/dist/buildaux/ltmain.sh vendor/tnftp/dist/configure vendor/tnftp/dist/configure.ac vendor/tnftp/dist/libedit/Makefile.in vendor/tnftp/dist/libnetbsd/Makefile.in vendor/tnftp/dist/libnetbsd/ftpglob.h vendor/tnftp/dist/libnetbsd/glob.c vendor/tnftp/dist/src/Makefile.am vendor/tnftp/dist/src/Makefile.in vendor/tnftp/dist/src/cmds.c vendor/tnftp/dist/src/cmdtab.c vendor/tnftp/dist/src/extern.h vendor/tnftp/dist/src/fetch.c vendor/tnftp/dist/src/ftp.1 vendor/tnftp/dist/src/ftp.c vendor/tnftp/dist/src/ftp_var.h vendor/tnftp/dist/src/main.c vendor/tnftp/dist/src/progressbar.c vendor/tnftp/dist/src/util.c vendor/tnftp/dist/src/version.h vendor/tnftp/dist/tnftp.h vendor/tnftp/dist/tnftp_config.h.in vendor/tnftp/dist/todo Modified: vendor/tnftp/dist/ChangeLog ============================================================================== --- vendor/tnftp/dist/ChangeLog Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/ChangeLog Sun May 5 15:04:47 2013 (r250274) @@ -1,4 +1,34 @@ -$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $ +$NetBSD: ChangeLog,v 1.62 2013/05/05 13:53:38 lukem Exp $ + +Sun May 5 13:51:47 UTC 2013 lukem + + * Release as "tnftp 20130505" + + * Implement --enable-ssl (and --with-openssl) to enable + https:// fetch support. + + * Merge NetBSD ftp from 20090520 to 20130220. Changes: + - https:// support. + NetBSD problem report 47276 from NONAKA Kimihiro. + - Allow -R to restart non-existent ftp:// URIs. + - Don't assume AF_INET support is available. + FreeBSD problem report 162661. + - Parse HTTP 'Date' entries in the `C' locale rather than the + user's. + NetBSD problem report 42917 from KAMADA Ken'ichi. + - Improve error handling when parsing of URI scheme. + - Silence connection warnings to multi-homed hosts in + non-verbose mode. + - Fix compile warnings. + - In ftpvis(), prevent incomplete escape sequences at end of + dst, and ensure NUL-termination of dst. + Fix from Uwe Stuehler and Stefan Sperling, via Marc Balmer. + - When using the response to SYST to decide whether to + default to 'binary' be a lot less specific. + + * Replace glob with newer copy from NetBSD that does not suffer + from DoS exhaustion attacks. + Fix in NetBSD from Maksymilian Arciemowicz. See CVE-2011-0418 Tue Jan 12 06:58:15 UTC 2010 lukem Modified: vendor/tnftp/dist/Makefile.am ============================================================================== --- vendor/tnftp/dist/Makefile.am Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/Makefile.am Sun May 5 15:04:47 2013 (r250274) @@ -1,4 +1,6 @@ -## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:58 lukem Exp $ +## $NetBSD: Makefile.am,v 1.3 2013/05/05 13:06:37 lukem Exp $ + +ACLOCAL_AMFLAGS = -I buildaux SUBDIRS = libnetbsd Modified: vendor/tnftp/dist/Makefile.in ============================================================================== --- vendor/tnftp/dist/Makefile.in Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/Makefile.in Sun May 5 15:04:47 2013 (r250274) @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -41,7 +41,13 @@ DIST_COMMON = README $(am__configure_dep buildaux/config.guess buildaux/config.sub buildaux/depcomp \ buildaux/install-sh buildaux/ltmain.sh buildaux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/buildaux/ax_check_openssl.m4 \ + $(top_srcdir)/buildaux/libtool.m4 \ + $(top_srcdir)/buildaux/ltoptions.m4 \ + $(top_srcdir)/buildaux/ltsugar.m4 \ + $(top_srcdir)/buildaux/ltversion.m4 \ + $(top_srcdir)/buildaux/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -123,39 +129,45 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ +NM = @NM@ NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ +OPENSSL_INCLUDES = @OPENSSL_INCLUDES@ +OPENSSL_LDFLAGS = @OPENSSL_LDFLAGS@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -164,6 +176,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -174,9 +187,9 @@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -222,6 +235,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I buildaux SUBDIRS = libnetbsd $(am__append_1) src EXTRA_DIST = \ todo \ @@ -299,7 +313,7 @@ distclean-libtool: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -324,7 +338,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -488,7 +502,8 @@ distdir: $(DISTFILES) fi; \ done -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ @@ -532,17 +547,17 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac Modified: vendor/tnftp/dist/NEWS ============================================================================== --- vendor/tnftp/dist/NEWS Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/NEWS Sun May 5 15:04:47 2013 (r250274) @@ -1,4 +1,23 @@ -This is tnftp version 20091122. +$NetBSD: NEWS,v 1.9 2013/05/05 13:53:38 lukem Exp $ + +This is tnftp version 20130505. + +Changes in tnftp from 20100108 to 20130505: + + Support https:// fetch if OpenSSL is available and enabled. + + Allow -R to restart non-existent ftp:// URIs. + + Parse HTTP 'Date' entries in the `C' locale rather than the user's. + + When using the response to SYST to decide whether to default + to 'binary' be a lot less specific. + + Portability fixes. + +Changes in tnftp from 20091122 to 20100108: + + Portability fixes. Changes in tnftp from 20090606 to 20091122: @@ -22,7 +41,6 @@ Changes in tnftp from 20070806 to 200905 Fix various compiler warnings. - Changes in tnftp from 20050625 to 20070806: Implement '-s srcaddr' to set the local IP address for @@ -33,4 +51,3 @@ Changes in tnftp from 20050625 to 200708 Use IEC 60027-2 "KiB", "MiB" (etc) instead of "KB", "MB", ... Portability fixes, including for FreeBSD, Mac OS X, and Solaris. - Modified: vendor/tnftp/dist/THANKS ============================================================================== --- vendor/tnftp/dist/THANKS Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/THANKS Sun May 5 15:04:47 2013 (r250274) @@ -2,52 +2,59 @@ Whilst a lot of the work in tnftp (both and this port) was done by Luke Mewburn, it would not be as usable without the enhancements, bug fixes, or input from the following people: -Amitai Schlair -Anders Dinsen -Anders Magnusson -Arkadiusz Miskiewicz -Brian Stark -Chris G. Demetriou -Christos Zoulas -Dan Winship -Darren Reed -David Brownlee -David Carrel -DervishD -Douwe Kiela -Eugene Kotlyarov -Geoff Wing -Giles Lean -Havard Eidnes -Hubert Feyrer -ITOH Yasufumi -Jason R. Thorpe -John Hawkinson -Joseph S. Myers -Jun-ichiro itojun Hagino -Kimmo Suominen -Klaus Klein -Launey Thomas -Luke Mewburn -Marc Horowitz -Mathieu Arnold -Matthew R. Green -Matthias Pfaller -Matthias Scheler -Maxim Konovalov -Maxime Henrion -Michael L. Hitch -Mike Heffner -Onno van der Linden -Ruslan Ermilov -Ryoji Kanai -Scott Aaron Bamford -Simon Burge -Steve McClellan -TAMURA Kent -Stoned Elipot -Todd C. Miller -YAMANO Yuji -Yar Tikhiy +Adam Sampson +Amitai Schlair +Anders Dinsen +Anders Magnusson +Arkadiusz Miskiewicz +Brian Stark +Chris G. Demetriou +Christos Zoulas +Dan Winship +Darren Reed +David Brownlee +David Carrel +DervishD +Douwe Kiela +Eugene Kotlyarov +Geoff Wing +Giles Lean +Havard Eidnes +Hubert Feyrer +ITOH Yasufumi +Jason R. Thorpe +John Hawkinson +Joseph S. Myers +Jun-ichiro itojun Hagino +KAMADA Ken'ichi +Kimmo Suominen +Klaus Klein +Launey Thomas +Luke Mewburn +Maksymilian Arciemowicz +Marc Balmer +Marc Horowitz +Mathieu Arnold +Matthew R. Green +Matthias Pfaller +Matthias Scheler +Maxim Konovalov +Maxime Henrion +Michael L. Hitch +Mike Heffner +NONAKA Kimihiro +Onno van der Linden +Ruslan Ermilov +Ryoji Kanai +Scott Aaron Bamford +Simon Burge +Stefan Sperling +Steve McClellan +Stoned Elipot +TAMURA Kent +Todd C. Miller +Uwe Stuehler +YAMANO Yuji +Yar Tikhiy Apologies to anyone missed. Modified: vendor/tnftp/dist/aclocal.m4 ============================================================================== --- vendor/tnftp/dist/aclocal.m4 Sun May 5 14:57:28 2013 (r250273) +++ vendor/tnftp/dist/aclocal.m4 Sun May 5 15:04:47 2013 (r250274) @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -13,6648 +13,12 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, -[m4_warning([this file was generated for autoconf 2.64. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 52 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -_LT_REQUIRED_DARWIN_CHECKS - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# -------------------------- -# Check for some things on darwin -AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - echo "int foo(void){return 1;}" > conftest.c - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib ${wl}-single_module conftest.c - if test -f libconftest.dylib; then - lt_cv_apple_cc_single_mod=yes - rm -rf libconftest.dylib* - fi - rm conftest.c - fi]) - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS="$save_LDFLAGS" - ]) - case $host_os in - rhapsody* | darwin1.[[0123]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" - fi - if test "$DSYMUTIL" != ":"; then - _lt_dsymutil="~$DSYMUTIL \$lib || :" - else - _lt_dsymutil= - fi - ;; - esac -]) - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` -fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun May 5 15:06:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3A505151; Sun, 5 May 2013 15:06:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13B07140; Sun, 5 May 2013 15:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45F66e6025603; Sun, 5 May 2013 15:06:06 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45F66Qp025602; Sun, 5 May 2013 15:06:06 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051506.r45F66Qp025602@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 15:06:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250275 - vendor/tnftp/20130505 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 15:06:07 -0000 Author: gavin Date: Sun May 5 15:06:06 2013 New Revision: 250275 URL: http://svnweb.freebsd.org/changeset/base/250275 Log: Tag for tnftp-20130505. Added: vendor/tnftp/20130505/ - copied from r250274, vendor/tnftp/dist/ From owner-svn-src-all@FreeBSD.ORG Sun May 5 16:42:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47074DB4; Sun, 5 May 2013 16:42:07 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 398F7363; Sun, 5 May 2013 16:42:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45Gg66R059281; Sun, 5 May 2013 16:42:06 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45Gg6DF059280; Sun, 5 May 2013 16:42:06 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051642.r45Gg6DF059280@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 16:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250277 - stable/9/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 16:42:07 -0000 Author: gavin Date: Sun May 5 16:42:06 2013 New Revision: 250277 URL: http://svnweb.freebsd.org/changeset/base/250277 Log: Merge r246619 from head: Correct spelling of "daemon". No .Dd bump. Noticed by: Nathan Rich Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Directory Properties: stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 5 15:40:34 2013 (r250276) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun May 5 16:42:06 2013 (r250277) @@ -1193,7 +1193,7 @@ When the .Sy sharenfs property is changed for a dataset, the .Xr mountd 8 -dameon is reloaded. +daemon is reloaded. .It Sy logbias Ns = Ns Cm latency | throughput Provide a hint to .Tn ZFS From owner-svn-src-all@FreeBSD.ORG Sun May 5 16:44:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 599E191; Sun, 5 May 2013 16:44:04 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE6A386; Sun, 5 May 2013 16:44:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45Gi4no059722; Sun, 5 May 2013 16:44:04 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45Gi4YS059721; Sun, 5 May 2013 16:44:04 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051644.r45Gi4YS059721@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 16:44:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250278 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 16:44:04 -0000 Author: gavin Date: Sun May 5 16:44:03 2013 New Revision: 250278 URL: http://svnweb.freebsd.org/changeset/base/250278 Log: Merge r247915 from head: The ZyXEL ZyAIR G-202 is also supported by zyd(4) Modified: stable/9/share/man/man4/zyd.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/zyd.4 ============================================================================== --- stable/9/share/man/man4/zyd.4 Sun May 5 16:42:06 2013 (r250277) +++ stable/9/share/man/man4/zyd.4 Sun May 5 16:44:03 2013 (r250278) @@ -32,7 +32,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF .\" THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 2, 2009 +.Dd March 7, 2013 .Dt ZYD 4 .Os .Sh NAME @@ -121,6 +121,7 @@ driver: .It X-Micro XWL-11GUZX .It Yakumo QuickWLAN USB .It Zonet ZEW2501 +.It ZyXEL ZyAIR G-202 .It ZyXEL ZyAIR G-220 .El .Sh EXAMPLES From owner-svn-src-all@FreeBSD.ORG Sun May 5 18:31:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A36B7760 for ; Sun, 5 May 2013 18:31:57 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5E890C for ; Sun, 5 May 2013 18:31:56 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id w10so2772622lbi.26 for ; Sun, 05 May 2013 11:31:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=CYmLoizk3CMeAycDYKi5XLIsNFSkF9OufGcq7UEH5Zw=; b=D6/2ImsAiKYy8UPs9IrZDU71yuyXI2BxNkO7SZmz5Qaw9PhA88QMaeZRQBV/lnX9lU ZCJxe9BO5xcUyadlBwCqytYREZS4fSm5CjCVqbjjg3dE865VZxnLx3lwWxiiG7t5iXYL xzlYBLxbTbwddz8llRC/M6Y4GoERGfH/swIENAOj6+VkG8CsJDppy5bTTuG1hJJK9O3G ip8+V7NvrZzToI2srkkoIt2klzo3FJAO01mgo9kcSjL5O+78bHsK8NfmWWpCNPdp3pbT V3yw2A/3AuxiCj92IZp4ywRADohSTT/QwJTKTf72jMeynWWKNyiSrMqe5+KMmSb0hYwp 8U8Q== X-Received: by 10.152.1.232 with SMTP id 8mr6995539lap.33.1367778715700; Sun, 05 May 2013 11:31:55 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id u4sm7448677lbq.2.2013.05.05.11.31.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 05 May 2013 11:31:55 -0700 (PDT) Message-ID: <5186A598.8040403@freebsd.org> Date: Sun, 05 May 2013 22:31:52 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Sergey Kandaurov Subject: Re: svn commit: r250245 - head/lib/libc/locale References: <201305041721.r44HLiXb066291@svn.freebsd.org> In-Reply-To: <201305041721.r44HLiXb066291@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlEuTtC4bBKV4SkChUKafzMKQA2oNYXFAiij0jnzckqREzjtD0aEcrlXyFxH+ZwqFxY3FJ+ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 18:31:57 -0000 On 04.05.2013 21:21, Sergey Kandaurov wrote: > Log: > Document that the return type is different from 1003.1-2008. > It is better to fix this function return type to match POSIX standard rather than to document its non-standard behavior. We try to follow POSIX when possible and this is the case. > MFC after: 1 week > > Modified: > head/lib/libc/locale/freelocale.3 > > Modified: head/lib/libc/locale/freelocale.3 > ============================================================================== > --- head/lib/libc/locale/freelocale.3 Sat May 4 17:06:47 2013 (r250244) > +++ head/lib/libc/locale/freelocale.3 Sat May 4 17:21:44 2013 (r250245) > @@ -57,5 +57,12 @@ Returns 0 on success or -1 on error. > .Xr uselocale 3 , > .Xr xlocale 3 > .Sh STANDARDS > -This function conforms to > -.St -p1003.1-2008 . > +The > +.Fn freelocale > +function > +differs from > +.St -p1003.1-2008 > +in that its return type is > +.Vt int > +rather than > +.Vt void . > -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Sun May 5 18:54:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 84DFCC43; Sun, 5 May 2013 18:54:26 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73D569C8; Sun, 5 May 2013 18:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45IsQhV005145; Sun, 5 May 2013 18:54:26 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45IsQ2s005144; Sun, 5 May 2013 18:54:26 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305051854.r45IsQ2s005144@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 5 May 2013 18:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250285 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 18:54:26 -0000 Author: luigi Date: Sun May 5 18:54:25 2013 New Revision: 250285 URL: http://svnweb.freebsd.org/changeset/base/250285 Log: remove a leftover comment Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun May 5 18:18:58 2013 (r250284) +++ head/release/picobsd/build/picobsd Sun May 5 18:54:25 2013 (r250285) @@ -445,8 +445,6 @@ do_kernel() { # OK ${BINMAKE} ${o_par} KERNCONF=${l_kernconf} \ -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel -# -DWITHOUT_CLANG_IS_CC \ - } # Populate the variable part of the floppy filesystem. Must be done before From owner-svn-src-all@FreeBSD.ORG Sun May 5 19:09:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 66136E39; Sun, 5 May 2013 19:09:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4975BA0B; Sun, 5 May 2013 19:09:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45J9Zfo009860; Sun, 5 May 2013 19:09:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45J9Ygn009857; Sun, 5 May 2013 19:09:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305051909.r45J9Ygn009857@svn.freebsd.org> From: Alexander Motin Date: Sun, 5 May 2013 19:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250286 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 19:09:35 -0000 Author: mav Date: Sun May 5 19:09:34 2013 New Revision: 250286 URL: http://svnweb.freebsd.org/changeset/base/250286 Log: Some fixes to snd_envy24ht(4) driver: - Allow DMA addresses anywhere in the lower 4GB; Envy24HT has a 32-bit DMA engine, not 28-bit like Envy24. - Mark interrupt handler as MPSAFE, seems to be correctly synchronized. PR: kern/152378 Submitted by: Jason Harmening MFC after: 1 month Modified: head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/envy24ht.h Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Sun May 5 18:54:25 2013 (r250285) +++ head/sys/dev/sound/pci/envy24ht.c Sun May 5 19:09:34 2013 (r250286) @@ -2080,7 +2080,7 @@ envy24ht_pci_probe(device_t dev) static void envy24ht_dmapsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - /* struct sc_info *sc = (struct sc_info *)arg; */ + struct sc_info *sc = arg; #if(0) device_printf(sc->dev, "envy24ht_dmapsetmap()\n"); @@ -2088,15 +2088,16 @@ envy24ht_dmapsetmap(void *arg, bus_dma_s printf("envy24ht(play): setmap %lx, %lx; ", (unsigned long)segs->ds_addr, (unsigned long)segs->ds_len); - printf("%p -> %lx\n", sc->pmap, (unsigned long)vtophys(sc->pmap)); } #endif + envy24ht_wrmt(sc, ENVY24HT_MT_PADDR, (uint32_t)segs->ds_addr, 4); + envy24ht_wrmt(sc, ENVY24HT_MT_PCNT, (uint32_t)(segs->ds_len / 4 - 1), 2); } static void envy24ht_dmarsetmap(void *arg, bus_dma_segment_t *segs, int nseg, int error) { - /* struct sc_info *sc = (struct sc_info *)arg; */ + struct sc_info *sc = arg; #if(0) device_printf(sc->dev, "envy24ht_dmarsetmap()\n"); @@ -2104,9 +2105,10 @@ envy24ht_dmarsetmap(void *arg, bus_dma_s printf("envy24ht(record): setmap %lx, %lx; ", (unsigned long)segs->ds_addr, (unsigned long)segs->ds_len); - printf("%p -> %lx\n", sc->rmap, (unsigned long)vtophys(sc->pmap)); } #endif + envy24ht_wrmt(sc, ENVY24HT_MT_RADDR, (uint32_t)segs->ds_addr, 4); + envy24ht_wrmt(sc, ENVY24HT_MT_RCNT, (uint32_t)(segs->ds_len / 4 - 1), 2); } static void @@ -2149,7 +2151,6 @@ envy24ht_dmafree(struct sc_info *sc) static int envy24ht_dmainit(struct sc_info *sc) { - u_int32_t addr; #if(0) device_printf(sc->dev, "envy24ht_dmainit()\n"); @@ -2176,34 +2177,16 @@ envy24ht_dmainit(struct sc_info *sc) #if(0) device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->pmap\n"); #endif - if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24ht_dmapsetmap, sc, 0)) + if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24ht_dmapsetmap, sc, BUS_DMA_NOWAIT)) goto bad; #if(0) device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->rmap\n"); #endif - if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24ht_dmarsetmap, sc, 0)) + if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24ht_dmarsetmap, sc, BUS_DMA_NOWAIT)) goto bad; bzero(sc->pbuf, sc->psize); bzero(sc->rbuf, sc->rsize); - /* set values to register */ - addr = vtophys(sc->pbuf); -#if(0) - device_printf(sc->dev, "pbuf(0x%08x)\n", addr); -#endif - envy24ht_wrmt(sc, ENVY24HT_MT_PADDR, addr, 4); -#if(0) - device_printf(sc->dev, "PADDR-->(0x%08x)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PADDR, 4)); - device_printf(sc->dev, "psize(%ld)\n", sc->psize / 4 - 1); -#endif - envy24ht_wrmt(sc, ENVY24HT_MT_PCNT, sc->psize / 4 - 1, 2); -#if(0) - device_printf(sc->dev, "PCNT-->(%ld)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PCNT, 2)); -#endif - addr = vtophys(sc->rbuf); - envy24ht_wrmt(sc, ENVY24HT_MT_RADDR, addr, 4); - envy24ht_wrmt(sc, ENVY24HT_MT_RCNT, sc->rsize / 4 - 1, 2); - return 0; bad: envy24ht_dmafree(sc); @@ -2441,7 +2424,7 @@ envy24ht_alloc_resource(struct sc_info * sc->irq = bus_alloc_resource(sc->dev, SYS_RES_IRQ, &sc->irqid, 0, ~0, 1, RF_ACTIVE | RF_SHAREABLE); if (!sc->irq || - snd_setup_intr(sc->dev, sc->irq, 0, envy24ht_intr, sc, &sc->ih)) { + snd_setup_intr(sc->dev, sc->irq, INTR_MPSAFE, envy24ht_intr, sc, &sc->ih)) { device_printf(sc->dev, "unable to map interrupt\n"); return ENXIO; } @@ -2450,13 +2433,13 @@ envy24ht_alloc_resource(struct sc_info * if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(sc->dev), /*alignment*/4, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR_ENVY24, - /*highaddr*/BUS_SPACE_MAXADDR_ENVY24, + /*lowaddr*/BUS_SPACE_MAXADDR_32BIT, + /*highaddr*/BUS_SPACE_MAXADDR, /*filter*/NULL, /*filterarg*/NULL, /*maxsize*/BUS_SPACE_MAXSIZE_ENVY24, /*nsegments*/1, /*maxsegsz*/0x3ffff, - /*flags*/0, /*lockfunc*/busdma_lock_mutex, - /*lockarg*/&Giant, &sc->dmat) != 0) { + /*flags*/0, /*lockfunc*/NULL, + /*lockarg*/NULL, &sc->dmat) != 0) { device_printf(sc->dev, "unable to create dma tag\n"); return ENXIO; } Modified: head/sys/dev/sound/pci/envy24ht.h ============================================================================== --- head/sys/dev/sound/pci/envy24ht.h Sun May 5 18:54:25 2013 (r250285) +++ head/sys/dev/sound/pci/envy24ht.h Sun May 5 19:09:34 2013 (r250286) @@ -176,8 +176,6 @@ #define ENVY24HT_VOL_MIN 96 /* -144db(negate) */ #define ENVY24HT_VOL_MUTE 127 /* mute */ -#define BUS_SPACE_MAXADDR_ENVY24 0x0fffffff /* Address space beyond 256MB is not - supported */ #define BUS_SPACE_MAXSIZE_ENVY24 0x3fffc /* 64k x 4byte(1dword) */ #define ENVY24HT_CCS_GPIO_HDATA 0x1E From owner-svn-src-all@FreeBSD.ORG Sun May 5 19:24:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4382827A; Sun, 5 May 2013 19:24:53 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8EBA7B; Sun, 5 May 2013 19:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45JOqak015949; Sun, 5 May 2013 19:24:52 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45JOqLW015945; Sun, 5 May 2013 19:24:52 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051924.r45JOqLW015945@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 19:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250287 - in stable/9/sys: geom/part sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 19:24:53 -0000 Author: gavin Date: Sun May 5 19:24:51 2013 New Revision: 250287 URL: http://svnweb.freebsd.org/changeset/base/250287 Log: Merge r247961 from head: Support the FAT16 partition type in gpart(8) PR: kern/174714 Submitted by: 4721 at hushmail dot com Modified: stable/9/sys/geom/part/g_part.c stable/9/sys/geom/part/g_part.h stable/9/sys/geom/part/g_part_mbr.c stable/9/sys/sys/diskmbr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Sun May 5 19:09:34 2013 (r250286) +++ stable/9/sys/geom/part/g_part.c Sun May 5 19:24:51 2013 (r250287) @@ -80,6 +80,7 @@ struct g_part_alias_list { { "bios-boot", G_PART_ALIAS_BIOS_BOOT }, { "ebr", G_PART_ALIAS_EBR }, { "efi", G_PART_ALIAS_EFI }, + { "fat16", G_PART_ALIAS_MS_FAT16 }, { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, Modified: stable/9/sys/geom/part/g_part.h ============================================================================== --- stable/9/sys/geom/part/g_part.h Sun May 5 19:09:34 2013 (r250286) +++ stable/9/sys/geom/part/g_part.h Sun May 5 19:24:51 2013 (r250287) @@ -68,6 +68,7 @@ enum g_part_alias { G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ G_PART_ALIAS_EBR, /* A EBR partition entry. */ + G_PART_ALIAS_MS_FAT16, /* A Microsoft FAT16 partition entry. */ G_PART_ALIAS_MS_FAT32, /* A Microsoft FAT32 partition entry. */ G_PART_ALIAS_BIOS_BOOT, /* A GRUB 2 boot partition entry. */ G_PART_ALIAS_VMFS, /* A VMware VMFS partition entry */ Modified: stable/9/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/9/sys/geom/part/g_part_mbr.c Sun May 5 19:09:34 2013 (r250286) +++ stable/9/sys/geom/part/g_part_mbr.c Sun May 5 19:24:51 2013 (r250287) @@ -118,6 +118,7 @@ static struct g_part_mbr_alias { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_EXT, G_PART_ALIAS_EBR }, { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_FAT16, G_PART_ALIAS_MS_FAT16 }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, Modified: stable/9/sys/sys/diskmbr.h ============================================================================== --- stable/9/sys/sys/diskmbr.h Sun May 5 19:09:34 2013 (r250286) +++ stable/9/sys/sys/diskmbr.h Sun May 5 19:24:51 2013 (r250287) @@ -45,6 +45,7 @@ #define DOSMAGIC 0xAA55 #define DOSPTYP_EXT 0x05 /* DOS extended partition */ +#define DOSPTYP_FAT16 0x06 /* FAT16 partition */ #define DOSPTYP_NTFS 0x07 /* NTFS partition */ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ From owner-svn-src-all@FreeBSD.ORG Sun May 5 19:53:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 765BF946; Sun, 5 May 2013 19:53:54 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D0C0B39; Sun, 5 May 2013 19:53:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45Jrs7Z026152; Sun, 5 May 2013 19:53:54 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45JrrRe026150; Sun, 5 May 2013 19:53:53 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201305051953.r45JrrRe026150@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 5 May 2013 19:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250288 - in stable/9/sys/dev/usb: . serial X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 19:53:54 -0000 Author: gavin Date: Sun May 5 19:53:53 2013 New Revision: 250288 URL: http://svnweb.freebsd.org/changeset/base/250288 Log: Merge r248175 from head: Add support for Optoelectronics USB barcode readers to uftdi(4). Add entries for other Optoelectronics devices to usbdevs. Modified: stable/9/sys/dev/usb/serial/uftdi.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/serial/uftdi.c ============================================================================== --- stable/9/sys/dev/usb/serial/uftdi.c Sun May 5 19:24:51 2013 (r250287) +++ stable/9/sys/dev/usb/serial/uftdi.c Sun May 5 19:53:53 2013 (r250288) @@ -753,6 +753,8 @@ static const STRUCT_USB_HOST_ID uftdi_de UFTDI_DEV(MOBILITY, USB_SERIAL, UFTDI_TYPE_AUTO), UFTDI_DEV(OLIMEX, ARM_USB_OCD, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), UFTDI_DEV(OLIMEX, ARM_USB_OCD_H, UFTDI_TYPE_AUTO | UFTDI_FLAG_JTAG), + UFTDI_DEV(OPTO, CRD7734, UFTDI_TYPE_AUTO), + UFTDI_DEV(OPTO, CRD7734_1, UFTDI_TYPE_AUTO), UFTDI_DEV(PAPOUCH, AD4USB, UFTDI_TYPE_AUTO), UFTDI_DEV(PAPOUCH, AP485, UFTDI_TYPE_AUTO), UFTDI_DEV(PAPOUCH, AP485_2, UFTDI_TYPE_AUTO), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Sun May 5 19:24:51 2013 (r250287) +++ stable/9/sys/dev/usb/usbdevs Sun May 5 19:53:53 2013 (r250288) @@ -323,6 +323,7 @@ vendor GUNZE 0x0637 Gunze Electronics U vendor AVISION 0x0638 Avision vendor TEAC 0x0644 TEAC vendor ACTON 0x0647 Acton Research Corp. +vendor OPTO 0x065a Optoelectronics Co., Ltd vendor SGI 0x065e Silicon Graphics vendor SANWASUPPLY 0x0663 Sanwa Supply vendor MEGATEC 0x0665 Megatec @@ -3140,6 +3141,13 @@ product OPTION ICON321 0xd031 Globetrot product OPTION ICON505 0xd055 Globetrotter iCON 505 product OPTION ICON452 0x7901 Globetrotter iCON 452 +/* Optoelectronics Co., Ltd */ +product OPTO BARCODE 0x0001 Barcode Reader +product OPTO OPTICONCODE 0x0009 Opticon Code Reader +product OPTO BARCODE_1 0xa002 Barcode Reader +product OPTO CRD7734 0xc000 USB Cradle CRD-7734-RU +product OPTO CRD7734_1 0xc001 USB Cradle CRD-7734-RU + /* OvisLink product */ product OVISLINK RT3072 0x3072 RT3072 From owner-svn-src-all@FreeBSD.ORG Sun May 5 20:59:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 07C187C4; Sun, 5 May 2013 20:59:23 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF448DD9; Sun, 5 May 2013 20:59:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45KxMnw048374; Sun, 5 May 2013 20:59:22 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45KxMA9048373; Sun, 5 May 2013 20:59:22 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305052059.r45KxMA9048373@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 5 May 2013 20:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250289 - head/release/picobsd/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 20:59:23 -0000 Author: luigi Date: Sun May 5 20:59:22 2013 New Revision: 250289 URL: http://svnweb.freebsd.org/changeset/base/250289 Log: use a plain 'make toolchain' to build toolchain, and support parallel make on this stage. Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun May 5 19:53:53 2013 (r250288) +++ head/release/picobsd/build/picobsd Sun May 5 20:59:22 2013 (r250289) @@ -175,17 +175,10 @@ create_includes_and_libraries2() { # opt if [ -d "$1" ] ; then cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else - MAKEOBJDIRPREFIX=${l_objtree} - export MAKEOBJDIRPREFIX - # export WITH_RESCUE=yes # build crunchide - # ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries - ( - # eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V BMAKEENV` - eval "export XMAKE=\"`cd ${SRC}; make -f Makefile -V XMAKE`\"" - ${BINMAKE} ${o_par} _+_= $no toolchain - ) + export MAKEOBJDIRPREFIX=${l_objtree} + make ${o_par} $no toolchain + # XXX do we need any of these ? eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` - ${BINMAKE} ${o_par} _+_= $no _includes _libraries [ ${o_arch} != `uname -m` ] && \ (cd ${l_objtree}; ln -s . ${o_arch}.${o_arch} || true ) fi @@ -442,7 +435,8 @@ do_kernel() { # OK # export CONFIG export WARNS CWARNFLAGS [ "${o_do_modules}" = "yes" ] && export MODULES="" - ${BINMAKE} ${o_par} KERNCONF=${l_kernconf} \ + # kernel build not parallelizable yet + ${BINMAKE} KERNCONF=${l_kernconf} \ -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel } From owner-svn-src-all@FreeBSD.ORG Sun May 5 21:03:28 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EE8AC963; Sun, 5 May 2013 21:03:27 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id C320FDF3; Sun, 5 May 2013 21:03:27 +0000 (UTC) Received: from [192.168.0.2] (cpc10-cmbg15-2-0-cust123.5-4.cable.virginmedia.com [86.30.246.124]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r45L3ITm013956 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 5 May 2013 21:03:20 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r250245 - head/lib/libc/locale From: David Chisnall In-Reply-To: <5186A598.8040403@freebsd.org> Date: Sun, 5 May 2013 22:03:13 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <90B8EC0D-C669-4345-AAB7-DE880E667260@FreeBSD.org> References: <201305041721.r44HLiXb066291@svn.freebsd.org> <5186A598.8040403@freebsd.org> To: Andrey Chernov X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 21:03:28 -0000 On 5 May 2013, at 19:31, Andrey Chernov wrote: > It is better to fix this function return type to match POSIX standard > rather than to document its non-standard behavior. We try to follow > POSIX when possible and this is the case. We follow Darwin in this case, which returns 0 on success or -1 on = error. 'Fixing' this will break code written for Darwin and testing the = return value. Not fixing it will not break POSIX code that ignores the = (unexpected) return value. David From owner-svn-src-all@FreeBSD.ORG Sun May 5 22:42:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4BB50D8B; Sun, 5 May 2013 22:42:11 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 24D4D71; Sun, 5 May 2013 22:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r45MgBvL086008; Sun, 5 May 2013 22:42:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r45MgBJA086007; Sun, 5 May 2013 22:42:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201305052242.r45MgBJA086007@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 May 2013 22:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250290 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 22:42:11 -0000 Author: nwhitehorn Date: Sun May 5 22:42:10 2013 New Revision: 250290 URL: http://svnweb.freebsd.org/changeset/base/250290 Log: Only check fan type once. Not only is continuously rechecking pointless, a single random failure can reprogram what control mechanism we try to use. MFC after: 2 weeks Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Sun May 5 20:59:22 2013 (r250289) +++ head/sys/powerpc/powermac/smu.c Sun May 5 22:42:10 2013 (r250290) @@ -78,8 +78,8 @@ struct smu_fan { SMU_FAN_RPM, SMU_FAN_PWM } type; - int old_style; int setpoint; + int old_style; int rpm; }; @@ -123,6 +123,7 @@ struct smu_softc { struct smu_fan *sc_fans; int sc_nfans; + int old_style_fans; struct smu_sensor *sc_sensors; int sc_nsensors; @@ -654,6 +655,37 @@ doorbell_attach(device_t dev) */ static int +smu_fan_check_old_style(struct smu_fan *fan) +{ + device_t smu = fan->dev; + struct smu_softc *sc = device_get_softc(smu); + struct smu_cmd cmd; + int error; + + if (sc->old_style_fans != -1) + return (sc->old_style_fans); + + /* + * Apple has two fan control mechanisms. We can't distinguish + * them except by seeing if the new one fails. If the new one + * fails, use the old one. + */ + + cmd.cmd = SMU_FAN; + cmd.len = 2; + cmd.data[0] = 0x31; + cmd.data[1] = fan->reg; + + do { + error = smu_run_cmd(smu, &cmd, 1); + } while (error == EWOULDBLOCK); + + sc->old_style_fans = (error != 0); + + return (sc->old_style_fans); +} + +static int smu_fan_set_rpm(struct smu_fan *fan, int rpm) { device_t smu = fan->dev; @@ -667,12 +699,8 @@ smu_fan_set_rpm(struct smu_fan *fan, int rpm = max(fan->fan.min_rpm, rpm); rpm = min(fan->fan.max_rpm, rpm); - /* - * Apple has two fan control mechanisms. We can't distinguish - * them except by seeing if the new one fails. If the new one - * fails, use the old one. - */ - + smu_fan_check_old_style(fan); + if (!fan->old_style) { cmd.len = 4; cmd.data[0] = 0x30; @@ -683,9 +711,7 @@ smu_fan_set_rpm(struct smu_fan *fan, int error = smu_run_cmd(smu, &cmd, 1); if (error && error != EWOULDBLOCK) fan->old_style = 1; - } - - if (fan->old_style) { + } else { cmd.len = 14; cmd.data[0] = 0x00; /* RPM fan. */ cmd.data[1] = 1 << fan->reg; @@ -707,6 +733,8 @@ smu_fan_read_rpm(struct smu_fan *fan) struct smu_cmd cmd; int rpm, error; + smu_fan_check_old_style(fan); + if (!fan->old_style) { cmd.cmd = SMU_FAN; cmd.len = 2; @@ -944,9 +972,10 @@ smu_count_fans(device_t dev) child = OF_peer(child)) { nfans++; /* When allocated, fill the fan properties. */ - if (sc->sc_fans != NULL) + if (sc->sc_fans != NULL) { smu_fill_fan_prop(dev, child, nfans - 1); + } } } if (nfans == 0) { From owner-svn-src-all@FreeBSD.ORG Mon May 6 10:18:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4B8B249D; Mon, 6 May 2013 10:18:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2888E64C; Mon, 6 May 2013 10:18:07 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-244.nwrknj.fios.verizon.net [173.70.85.244]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 763B5B983; Mon, 6 May 2013 06:18:06 -0400 (EDT) From: John Baldwin To: Mikolaj Golub Subject: Re: svn commit: r250223 - in head: lib/libprocstat sys/kern sys/sys usr.bin/fstat Date: Mon, 6 May 2013 06:17:58 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201305032111.r43LBvZ3040508@svn.freebsd.org> <20130504185419.GA32075@gmail.com> In-Reply-To: <20130504185419.GA32075@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305060617.59143.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 May 2013 06:18:06 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 10:18:07 -0000 On Saturday, May 04, 2013 02:54:20 PM Mikolaj Golub wrote: > On Fri, May 03, 2013 at 09:11:57PM +0000, John Baldwin wrote: > > +static int > > +procstat_get_sem_info_kvm(kvm_t *kd, struct filestat *fst, > > + struct semstat *sem, char *errbuf) > > +{ > > + struct ksem ksem; > > + void *ksemp; > > + char *path; > > + int i; > > + > > + assert(kd); > > + assert(sem); > > + assert(fst); > > + bzero(sem, sizeof(*sem)); > > + ksemp = fst->fs_typedep; > > + if (ksemp == NULL) > > + goto fail; > > + if (!kvm_read_all(kd, (unsigned long)ksemp, &ksem, > > + sizeof(struct ksem))) { > > + warnx("can't read ksem at %p", (void *)ksemp); > > + goto fail; > > + } > > + sem->mode = S_IFREG | ksem.ks_mode; > > + sem->value = ksem.ks_value; > > + if (fst->fs_path == NULL && ksem.ks_path != NULL) { > > + path = malloc(MAXPATHLEN); > > + for (i = 0; i < MAXPATHLEN - 1; i++) { > > + if (!kvm_read_all(kd, (unsigned long)ksem.ks_path + i, > > + path + i, 1)) > > + break; > > + if (path[i] == '\0') > > + break; > > + } > > + path[i] = '\0'; > > + if (i == 0) > > + free(path); > > + else > > + fst->fs_path = path; > > + } > > + return (0); > > + > > +fail: > > + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); > > + return (1); > > +} > > I would like to make errbuf optional (for all libprocstat functions > that provide it) adding a check before printing to errbuf: > > if (errbuf != NULL) > snprintf(errbuf, ... > > It looks like there are callers who are not interested in errbuf > content. E.g. currently procstat(1) passes NULL when calling functions > that require errbuf, namely procstat_get_socket_info and > procstat_get_vnode_info, potentially crashing here if an error occurs. > > Do you (anyone) have objections? Oh, no not at all. I just used the shm_info version as my template, so it probably has the same issue as well. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 6 10:35:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6D2A0F95 for ; Mon, 6 May 2013 10:35:56 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id E76EC7B7 for ; Mon, 6 May 2013 10:35:55 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id fk20so3187190lab.33 for ; Mon, 06 May 2013 03:35:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:openpgp:content-type :content-transfer-encoding:x-gm-message-state; bh=RueVXOQ2eT98322XBYkZ9G1uHf54pl5+A/8hCdtbriE=; b=EiVkFO4MRDxq0klsv1THHmuXYWwmGPHozdTA9lBP/5aR7y/eex1ZQvB8QQEctq4qad japygJUo7fXbJmFjZuxmqgjByU0byC5GklKnATw5eGxXfQGUDF4YD/T/lqwcGgEy/n7o Ubnzk8n5GjRzlbhKF1/TmZ2SSvYCfQiCOvgtUifVlIwz9/sdon4pQEuaPdiwsHzKhTup 386ybSgzdeRvgBmAAZusPcZ7EsHOaJukCrI5jiE2Sk+oV/1+6+1d8J/g+Df+ne0itn8X Ihi79gOeWXeDVSFfMH3L3ihAXnpbPfk5tLhee5Jd6GtXAMK4Jsdm5VsMf+k71jZ2SZcE /hrQ== X-Received: by 10.112.75.134 with SMTP id c6mr7841581lbw.46.1367836554869; Mon, 06 May 2013 03:35:54 -0700 (PDT) Received: from [192.168.1.2] ([89.169.163.3]) by mx.google.com with ESMTPSA id c15sm8373552lbj.17.2013.05.06.03.35.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 03:35:54 -0700 (PDT) Message-ID: <51878784.40207@freebsd.org> Date: Mon, 06 May 2013 14:35:48 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r250245 - head/lib/libc/locale References: <201305041721.r44HLiXb066291@svn.freebsd.org> <5186A598.8040403@freebsd.org> <90B8EC0D-C669-4345-AAB7-DE880E667260@FreeBSD.org> In-Reply-To: <90B8EC0D-C669-4345-AAB7-DE880E667260@FreeBSD.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnHtuhhAAo/I46t7yKCsiLgBgTxDpnBuezethNsSVyj5ZjnPSH7igw8aKNfKPswTNfLwb6o Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 10:35:56 -0000 On 06.05.2013 1:03, David Chisnall wrote: > On 5 May 2013, at 19:31, Andrey Chernov wrote: > >> It is better to fix this function return type to match POSIX standard >> rather than to document its non-standard behavior. We try to follow >> POSIX when possible and this is the case. > > We follow Darwin in this case, which returns 0 on success or -1 on error. > 'Fixing' this will break code written for Darwin and testing the return value. Well, keeping in mind that POSIX now 'owns' almost all of the same interface, how many 3rd party soft authors will follow Darwin instead of POSIX, which claims cross-platform compatibility? Darwin is live as implementation but already dead as interface in its common parts differences with POSIX. I remember almost the same discussion about free(3) return code which was int, but finally changed to POSIX void. > Not fixing it will not break POSIX code that ignores the (unexpected) return value. Not always so. I.e. passing freelocale() by pointer breaks POSIX compatibility in case calling function expects pointer to void function. -- http://ache.vniz.net/ bitcoin:13fGiNutKNHcVSsgtGQ7bQ5kgUKgEQHn7N From owner-svn-src-all@FreeBSD.ORG Mon May 6 13:34:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2CDBFF74; Mon, 6 May 2013 13:34:38 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E489617; Mon, 6 May 2013 13:34:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46DYbUK004819; Mon, 6 May 2013 13:34:37 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46DYasu004813; Mon, 6 May 2013 13:34:36 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061334.r46DYasu004813@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 13:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250291 - in head/sys: arm/mv boot/fdt/dts dev/cesa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 13:34:38 -0000 Author: gber Date: Mon May 6 13:34:36 2013 New Revision: 250291 URL: http://svnweb.freebsd.org/changeset/base/250291 Log: Move initialization of CESA decoding windows from common section to driver specific files. - window initialization is done during device attach - CESA TDMA decoding windows values are set based on DTS, not copied from CPU registers - remove unnecessary virtual mapping - update dts file Obtained from: Semihalf Modified: head/sys/arm/mv/common.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvwin.h head/sys/boot/fdt/dts/db78460.dts head/sys/dev/cesa/cesa.c head/sys/dev/cesa/cesa.h Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Sun May 5 22:42:10 2013 (r250290) +++ head/sys/arm/mv/common.c Mon May 6 13:34:36 2013 (r250291) @@ -83,7 +83,7 @@ static int decode_win_usb_valid(void); static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); static int decode_win_sata_valid(void); -static int decode_win_cesa_valid(void); + static int decode_win_idma_valid(void); static int decode_win_xor_valid(void); @@ -93,11 +93,10 @@ static void decode_win_cpu_setup(void); static void decode_win_usb_setup(u_long); static void decode_win_eth_setup(u_long); static void decode_win_sata_setup(u_long); -static void decode_win_cesa_setup(u_long); + static void decode_win_idma_setup(u_long); static void decode_win_xor_setup(u_long); -static void decode_win_cesa_dump(u_long); static void decode_win_usb_dump(u_long); static void decode_win_eth_dump(u_long base); static void decode_win_idma_dump(u_long base); @@ -127,7 +126,6 @@ struct soc_node_spec { }; static struct soc_node_spec soc_nodes[] = { - { "mrvl,cesa", &decode_win_cesa_setup, &decode_win_cesa_dump }, { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump }, { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, { "mrvl,sata", &decode_win_sata_setup, NULL }, @@ -143,7 +141,6 @@ struct fdt_pm_mask_entry fdt_pm_mask_tab { "mrvl,usb-ehci", CPU_PM_CTRL_USB(0) }, { "mrvl,usb-ehci", CPU_PM_CTRL_USB(1) }, { "mrvl,usb-ehci", CPU_PM_CTRL_USB(2) }, - { "mrvl,cesa", CPU_PM_CTRL_CRYPTO }, { "mrvl,xor", CPU_PM_CTRL_XOR }, { "mrvl,sata", CPU_PM_CTRL_SATA }, @@ -529,7 +526,7 @@ soc_decode_win(void) if (!decode_win_cpu_valid() || !decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_cesa_valid() || !decode_win_xor_valid()) + !decode_win_xor_valid()) return (EINVAL); decode_win_cpu_setup(); @@ -537,7 +534,7 @@ soc_decode_win(void) if (!decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_cesa_valid() || !decode_win_xor_valid()) + !decode_win_xor_valid()) return (EINVAL); #endif if (MV_DUMP_WIN) @@ -570,11 +567,6 @@ WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_ WIN_REG_BASE_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL) WIN_REG_BASE_IDX_WR(win_usb, br, MV_WIN_USB_BASE) -WIN_REG_BASE_IDX_RD(win_cesa, cr, MV_WIN_CESA_CTRL) -WIN_REG_BASE_IDX_RD(win_cesa, br, MV_WIN_CESA_BASE) -WIN_REG_BASE_IDX_WR(win_cesa, cr, MV_WIN_CESA_CTRL) -WIN_REG_BASE_IDX_WR(win_cesa, br, MV_WIN_CESA_BASE) - WIN_REG_BASE_IDX_RD(win_eth, br, MV_WIN_ETH_BASE) WIN_REG_BASE_IDX_RD(win_eth, sz, MV_WIN_ETH_SIZE) WIN_REG_BASE_IDX_RD(win_eth, har, MV_WIN_ETH_REMAP) @@ -1791,98 +1783,6 @@ decode_win_xor_dump(u_long base) #endif /************************************************************************** - * CESA TDMA windows routines - **************************************************************************/ -#if defined(SOC_MV_KIRKWOOD) || defined(SOC_MV_DISCOVERY) -/* - * Dump CESA TDMA decode windows. - */ -static void -decode_win_cesa_dump(u_long base) -{ - int i; - - if (pm_is_disabled(CPU_PM_CTRL_CRYPTO)) - return; - - for (i = 0; i < MV_WIN_CESA_MAX; i++) - printf("CESA window#%d: c 0x%08x, b 0x%08x\n", i, - win_cesa_cr_read(base, i), win_cesa_br_read(base, i)); -} - - -/* - * Set CESA TDMA decode windows. - */ -static void -decode_win_cesa_setup(u_long base) -{ - uint32_t br, cr; - int i, j; - - if (pm_is_disabled(CPU_PM_CTRL_CRYPTO)) - return; - - /* Disable and clear all CESA windows */ - for (i = 0; i < MV_WIN_CESA_MAX; i++) { - win_cesa_cr_write(base, i, 0); - win_cesa_br_write(base, i, 0); - } - - /* Only access to active DRAM banks is required. */ - for (i = 0; i < MV_WIN_DDR_MAX; i++) - if (ddr_is_active(i)) { - br = ddr_base(i); - cr = (((ddr_size(i) - 1) & 0xffff0000) | - (ddr_attr(i) << 8) | (ddr_target(i) << 4) | 1); - - /* Set the first available CESA window */ - for (j = 0; j < MV_WIN_CESA_MAX; j++) { - if (win_cesa_cr_read(base, j) & 0x1) - continue; - - win_cesa_br_write(base, j, br); - win_cesa_cr_write(base, j, cr); - break; - } - } -} - -/* - * Check CESA TDMA decode windows. - */ -static int -decode_win_cesa_valid(void) -{ - - return (decode_win_can_cover_ddr(MV_WIN_CESA_MAX)); -} -#else - -/* - * Provide dummy functions to satisfy the build for SoCs not equipped with - * CESA - */ - -static int -decode_win_cesa_valid(void) -{ - - return (1); -} - -static void -decode_win_cesa_setup(u_long base) -{ -} - -static void -decode_win_cesa_dump(u_long base) -{ -} -#endif - -/************************************************************************** * SATA windows routines **************************************************************************/ static void @@ -1979,33 +1879,34 @@ static int win_cpu_from_dt(void) { pcell_t ranges[48]; - u_long sram_base, sram_size; phandle_t node; int i, entry_size, err, t, tuple_size, tuples; + u_long sram_base, sram_size; + t = 0; /* Retrieve 'ranges' property of '/localbus' node. */ if ((err = fdt_get_ranges("/localbus", ranges, sizeof(ranges), - &tuples, &tuple_size)) != 0) - return (0); - - /* - * Fill CPU decode windows table. - */ - bzero((void *)&cpu_win_tbl, sizeof(cpu_win_tbl)); + &tuples, &tuple_size)) == 0) { + /* + * Fill CPU decode windows table. + */ + bzero((void *)&cpu_win_tbl, sizeof(cpu_win_tbl)); - entry_size = tuple_size / sizeof(pcell_t); - cpu_wins_no = tuples; + entry_size = tuple_size / sizeof(pcell_t); + cpu_wins_no = tuples; - for (i = 0, t = 0; t < tuples; i += entry_size, t++) { - cpu_win_tbl[t].target = 1; - cpu_win_tbl[t].attr = fdt32_to_cpu(ranges[i + 1]); - cpu_win_tbl[t].base = fdt32_to_cpu(ranges[i + 2]); - cpu_win_tbl[t].size = fdt32_to_cpu(ranges[i + 3]); - cpu_win_tbl[t].remap = ~0; - debugf("target = 0x%0x attr = 0x%0x base = 0x%0x " - "size = 0x%0x remap = 0x%0x\n", cpu_win_tbl[t].target, - cpu_win_tbl[t].attr, cpu_win_tbl[t].base, - cpu_win_tbl[t].size, cpu_win_tbl[t].remap); + for (i = 0, t = 0; t < tuples; i += entry_size, t++) { + cpu_win_tbl[t].target = 1; + cpu_win_tbl[t].attr = fdt32_to_cpu(ranges[i + 1]); + cpu_win_tbl[t].base = fdt32_to_cpu(ranges[i + 2]); + cpu_win_tbl[t].size = fdt32_to_cpu(ranges[i + 3]); + cpu_win_tbl[t].remap = ~0; + debugf("target = 0x%0x attr = 0x%0x base = 0x%0x " + "size = 0x%0x remap = 0x%0x\n", + cpu_win_tbl[t].target, + cpu_win_tbl[t].attr, cpu_win_tbl[t].base, + cpu_win_tbl[t].size, cpu_win_tbl[t].remap); + } } /* @@ -2015,7 +1916,7 @@ win_cpu_from_dt(void) if (fdt_is_compatible(node, "mrvl,cesa-sram")) goto moveon; - if ((node = OF_finddevice("/")) == -1) + if ((node = OF_finddevice("/")) == 0) return (ENXIO); if ((node = fdt_find_compatible(node, "mrvl,cesa-sram", 0)) == 0) @@ -2026,11 +1927,12 @@ moveon: if (fdt_regsize(node, &sram_base, &sram_size) != 0) return (EINVAL); - cpu_win_tbl[++t].target = MV_WIN_CESA_TARGET; - cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR; + cpu_win_tbl[t].target = MV_WIN_CESA_TARGET; + cpu_win_tbl[t].attr = MV_WIN_CESA_ATTR(1); cpu_win_tbl[t].base = sram_base; cpu_win_tbl[t].size = sram_size; cpu_win_tbl[t].remap = ~0; + cpu_wins_no++; debugf("sram: base = 0x%0lx size = 0x%0lx\n", sram_base, sram_size); return (0); Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Sun May 5 22:42:10 2013 (r250290) +++ head/sys/arm/mv/mv_machdep.c Mon May 6 13:34:36 2013 (r250291) @@ -310,7 +310,6 @@ platform_devmap_init(void) { phandle_t root, child; pcell_t bank_count; - u_long base, size; int i, num_mapped; i = 0; @@ -381,29 +380,6 @@ platform_devmap_init(void) } } - /* - * CESA SRAM range. - */ - if ((child = OF_finddevice("sram")) != -1) - if (fdt_is_compatible(child, "mrvl,cesa-sram")) - goto moveon; - - if ((child = fdt_find_compatible(root, "mrvl,cesa-sram", 0)) == 0) - /* No CESA SRAM node. */ - return (0); -moveon: - if (i >= FDT_DEVMAP_MAX) - return (ENOMEM); - - if (fdt_regsize(child, &base, &size) != 0) - return (EINVAL); - - fdt_devmap[i].pd_va = MV_CESA_SRAM_BASE; /* XXX */ - fdt_devmap[i].pd_pa = base; - fdt_devmap[i].pd_size = size; - fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; - fdt_devmap[i].pd_cache = PTE_NOCACHE; - return (0); } Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Sun May 5 22:42:10 2013 (r250290) +++ head/sys/arm/mv/mvwin.h Mon May 6 13:34:36 2013 (r250291) @@ -208,16 +208,28 @@ #define MV_WIN_DDR_MAX 4 #endif /* SOC_MV_DOVE */ -#define MV_WIN_CESA_CTRL(n) (0x8 * (n) + 0xa04) -#define MV_WIN_CESA_BASE(n) (0x8 * (n) + 0xa00) -#define MV_WIN_CESA_MAX 4 +/* + * These values are valid only for peripherals decoding windows + * Bit in ATTR is zeroed according to CS bank number + */ +#define MV_WIN_DDR_ATTR(cs) (0x0F & ~(0x01 << (cs))) +#define MV_WIN_DDR_TARGET 0x0 #if defined(SOC_MV_DISCOVERY) #define MV_WIN_CESA_TARGET 9 -#define MV_WIN_CESA_ATTR 1 +#define MV_WIN_CESA_ATTR(eng_sel) 1 +#elif defined(SOC_MV_ARMADAXP) +#define MV_WIN_CESA_TARGET 9 +/* + * Bits [2:3] of cesa attribute select engine: + * eng_sel: + * 1: engine1 + * 2: engine0 + */ +#define MV_WIN_CESA_ATTR(eng_sel) (1 | ((eng_sel) << 2)) #else #define MV_WIN_CESA_TARGET 3 -#define MV_WIN_CESA_ATTR 0 +#define MV_WIN_CESA_ATTR(eng_sel) 0 #endif #define MV_WIN_USB_CTRL(n) (0x10 * (n) + 0x320) Modified: head/sys/boot/fdt/dts/db78460.dts ============================================================================== --- head/sys/boot/fdt/dts/db78460.dts Sun May 5 22:42:10 2013 (r250290) +++ head/sys/boot/fdt/dts/db78460.dts Mon May 6 13:34:36 2013 (r250291) @@ -303,6 +303,11 @@ >; }; + sram@ffff0000 { + compatible = "mrvl,cesa-sram"; + reg = <0xffff0000 0x00010000>; + }; + chosen { stdin = "serial0"; stdout = "serial0"; Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Sun May 5 22:42:10 2013 (r250290) +++ head/sys/dev/cesa/cesa.c Mon May 6 13:34:36 2013 (r250291) @@ -80,6 +80,7 @@ static void cesa_intr(void *); static int cesa_newsession(device_t, u_int32_t *, struct cryptoini *); static int cesa_freesession(device_t, u_int64_t); static int cesa_process(device_t, struct cryptop *, int); +static int decode_win_cesa_setup(struct cesa_softc *sc); static struct resource_spec cesa_res_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -995,10 +996,10 @@ cesa_attach(device_t dev) sc->sc_error = 0; sc->sc_dev = dev; - error = cesa_setup_sram(sc); - if (error) { - device_printf(dev, "could not setup SRAM\n"); - return (error); + /* Check if CESA peripheral device has power turned on */ + if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) != CPU_PM_CTRL_CRYPTO) { + device_printf(dev, "not powered on\n"); + return (ENXIO); } soc_id(&d, &r); @@ -1038,6 +1039,20 @@ cesa_attach(device_t dev) sc->sc_bsh = rman_get_bushandle(*(sc->sc_res)); sc->sc_bst = rman_get_bustag(*(sc->sc_res)); + /* Setup CESA decoding windows */ + error = decode_win_cesa_setup(sc); + if (error) { + device_printf(dev, "could not setup decoding windows\n"); + goto err1; + } + + /* Acquire SRAM base address */ + error = cesa_setup_sram(sc); + if (error) { + device_printf(dev, "could not setup SRAM\n"); + goto err1; + } + /* Setup interrupt handler */ error = bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_NET | INTR_MPSAFE, NULL, cesa_intr, sc, &(sc->sc_icookie)); @@ -1609,3 +1624,50 @@ cesa_process(device_t dev, struct crypto return (0); } + +/* + * Set CESA TDMA decode windows. + */ +static int +decode_win_cesa_setup(struct cesa_softc *sc) +{ + struct mem_region availmem_regions[FDT_MEM_REGIONS]; + int availmem_regions_sz; + uint32_t memsize, br, cr, i; + + /* Grab physical memory regions information from DTS */ + if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz, + &memsize) != 0) + return (ENXIO); + + if (availmem_regions_sz > MV_WIN_CESA_MAX) { + device_printf(sc->sc_dev, "Too much memory regions, cannot " + " set CESA windows to cover whole DRAM \n"); + return (ENXIO); + } + + /* Disable and clear all CESA windows */ + for (i = 0; i < MV_WIN_CESA_MAX; i++) { + CESA_WRITE(sc, MV_WIN_CESA_BASE(i), 0); + CESA_WRITE(sc, MV_WIN_CESA_CTRL(i), 0); + } + + /* Fill CESA TDMA decoding windows with information acquired from DTS */ + for (i = 0; i < availmem_regions_sz; i++) { + br = availmem_regions[i].mr_start; + cr = availmem_regions[i].mr_size; + + /* Don't add entries with size lower than 64KB */ + if (cr & 0xffff0000) { + cr = (((cr - 1) & 0xffff0000) | + (MV_WIN_DDR_ATTR(i) << MV_WIN_CPU_ATTR_SHIFT) | + (MV_WIN_DDR_TARGET << MV_WIN_CPU_TARGET_SHIFT) | + MV_WIN_CPU_ENABLE_BIT); + CESA_WRITE(sc, MV_WIN_CESA_BASE(i), br); + CESA_WRITE(sc, MV_WIN_CESA_CTRL(i), cr); + } + } + + return (0); +} + Modified: head/sys/dev/cesa/cesa.h ============================================================================== --- head/sys/dev/cesa/cesa.h Sun May 5 22:42:10 2013 (r250290) +++ head/sys/dev/cesa/cesa.h Mon May 6 13:34:36 2013 (r250291) @@ -333,6 +333,11 @@ struct cesa_chain_info { #define CESA_TDMA_EMR_BOTH_HIT CESA_TDMA_ECR_BOTH_HIT #define CESA_TDMA_EMR_DATA_ERROR CESA_TDMA_ECR_DATA_ERROR +/* CESA TDMA address decoding registers */ +#define MV_WIN_CESA_CTRL(n) (0x8 * (n) + 0xA04) +#define MV_WIN_CESA_BASE(n) (0x8 * (n) + 0xA00) +#define MV_WIN_CESA_MAX 4 + /* CESA SA registers definitions */ #define CESA_SA_CMD 0xDE00 #define CESA_SA_CMD_ACTVATE (1 << 0) From owner-svn-src-all@FreeBSD.ORG Mon May 6 13:52:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7AE3783; Mon, 6 May 2013 13:52:50 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8F9B756; Mon, 6 May 2013 13:52:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46DqoEG011423; Mon, 6 May 2013 13:52:50 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46DqoRO011420; Mon, 6 May 2013 13:52:50 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061352.r46DqoRO011420@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 13:52:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250292 - in head/sys/arm/mv: . armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 13:52:50 -0000 Author: gber Date: Mon May 6 13:52:49 2013 New Revision: 250292 URL: http://svnweb.freebsd.org/changeset/base/250292 Log: Initialize L2 cache for Armada XP. Obtained from: Semihalf Modified: head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/mv/armadaxp/std.armadaxp head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Mon May 6 13:34:36 2013 (r250291) +++ head/sys/arm/mv/armadaxp/armadaxp.c Mon May 6 13:52:49 2013 (r250292) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -51,6 +52,33 @@ __FBSDID("$FreeBSD$"); static uint32_t count_l2clk(void); +#define ARMADAXP_L2_BASE (MV_BASE + 0x8000) +#define ARMADAXP_L2_CTRL 0x100 +#define L2_ENABLE (1 << 0) +#define ARMADAXP_L2_AUX_CTRL 0x104 +#define L2_WBWT_MODE_MASK (3 << 0) +#define L2_WBWT_MODE_PAGE 0 +#define L2_WBWT_MODE_WB 1 +#define L2_WBWT_MODE_WT 2 +#define L2_REP_STRAT_MASK (3 << 27) +#define L2_REP_STRAT_LSFR (1 << 27) +#define L2_REP_STRAT_SEMIPLRU (3 << 27) + +#define ARMADAXP_L2_CNTR_CTRL 0x200 +#define ARMADAXP_L2_CNTR_CONF(x) (0x204 + (x) * 0xc) +#define ARMADAXP_L2_CNTR2_VAL_LOW (0x208 + (x) * 0xc) +#define ARMADAXP_L2_CNTR2_VAL_HI (0x20c + (x) * 0xc) + +#define ARMADAXP_L2_INT_CAUSE 0x220 + +#define ARMADAXP_L2_SYNC_BARRIER 0x700 +#define ARMADAXP_L2_INV_WAY 0x778 +#define ARMADAXP_L2_CLEAN_WAY 0x7BC +#define ARMADAXP_L2_FLUSH_PHYS 0x7F0 +#define ARMADAXP_L2_FLUSH_WAY 0x7FC + +#define COHER_FABRIC_CFU 0x228 + /* XXX Make gpio driver optional and remove it */ struct resource_spec mv_gpio_res[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -160,3 +188,76 @@ get_l2clk(void) return (l2clk_freq); } +void armadaxp_l2_init(void); +void armadaxp_l2_idcache_inv_all(void); + +#define ALL_WAYS 0xffffffff + +/* L2 cache configuration registers */ +static uint32_t +read_l2_cache(uint32_t reg) +{ + + return (bus_space_read_4(fdtbus_bs_tag, ARMADAXP_L2_BASE, reg)); +} + +static void +write_l2_cache(uint32_t reg, uint32_t val) +{ + + bus_space_write_4(fdtbus_bs_tag, ARMADAXP_L2_BASE, reg, val); +} + +void +armadaxp_l2_idcache_inv_all(void) +{ + write_l2_cache(ARMADAXP_L2_INV_WAY, ALL_WAYS); +} + +void +armadaxp_l2_init(void) +{ + u_int32_t reg; + + /* Set L2 policy */ + reg = read_l2_cache(ARMADAXP_L2_AUX_CTRL); + reg &= ~(L2_WBWT_MODE_MASK); + reg &= ~(L2_REP_STRAT_MASK); + reg |= L2_REP_STRAT_SEMIPLRU; + reg |= L2_WBWT_MODE_WT; + write_l2_cache(ARMADAXP_L2_AUX_CTRL, reg); + + /* Invalidate l2 cache */ + armadaxp_l2_idcache_inv_all(); + + /* Clear pending L2 interrupts */ + write_l2_cache(ARMADAXP_L2_INT_CAUSE, 0x1ff); + + /* Enable Cache and TLB maintenance broadcast */ + __asm__ __volatile__ ("mrc p15, 1, %0, c15, c2, 0" : "=r"(reg)); + reg |= (1 << 8); + __asm__ __volatile__ ("mcr p15, 1, %0, c15, c2, 0" : :"r"(reg)); + + /* Enable l2 cache */ + reg = read_l2_cache(ARMADAXP_L2_CTRL); + write_l2_cache(ARMADAXP_L2_CTRL, reg | L2_ENABLE); + + /* + * For debug purposes + * Configure and enable counter + */ + write_l2_cache(ARMADAXP_L2_CNTR_CONF(0), 0xf0000 | (4 << 2)); + write_l2_cache(ARMADAXP_L2_CNTR_CONF(1), 0xf0000 | (2 << 2)); + write_l2_cache(ARMADAXP_L2_CNTR_CTRL, 0x303); + + /* + * Enable Cache maintenance operation propagation in coherency fabric + * Change point of coherency and point of unification to DRAM. + */ + reg = bus_space_read_4(fdtbus_bs_tag, MV_MBUS_BRIDGE_BASE, + COHER_FABRIC_CFU); + reg |= (1 << 17) | (1 << 18); + bus_space_write_4(fdtbus_bs_tag, MV_MBUS_BRIDGE_BASE, COHER_FABRIC_CFU, + reg); +} + Modified: head/sys/arm/mv/armadaxp/std.armadaxp ============================================================================== --- head/sys/arm/mv/armadaxp/std.armadaxp Mon May 6 13:34:36 2013 (r250291) +++ head/sys/arm/mv/armadaxp/std.armadaxp Mon May 6 13:52:49 2013 (r250292) @@ -13,3 +13,5 @@ options KERNPHYSADDR=0x00f00000 options KERNVIRTADDR=0xc0f00000 options PHYSADDR=0x00000000 options STARTUP_PAGETABLE_ADDR=0x00100000 + +options ARM_L2_PIPT Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Mon May 6 13:34:36 2013 (r250291) +++ head/sys/arm/mv/mv_machdep.c Mon May 6 13:52:49 2013 (r250292) @@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$"); #include static int platform_mpp_init(void); +#if defined(SOC_MV_ARMADAXP) +void armadaxp_l2_init(void); +#endif #define MPP_PIN_MAX 68 #define MPP_PIN_CELLS 2 @@ -233,6 +236,9 @@ initarm_late_init(void) /* Disable watchdog and timers */ write_cpu_ctrl(CPU_TIMERS_BASE + CPU_TIMER_CONTROL, 0); #endif +#if defined(SOC_MV_ARMADAXP) + armadaxp_l2_init(); +#endif } #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) From owner-svn-src-all@FreeBSD.ORG Mon May 6 14:12:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8914AD95; Mon, 6 May 2013 14:12:38 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78FC8828; Mon, 6 May 2013 14:12:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46ECcZe018942; Mon, 6 May 2013 14:12:38 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46ECbkj018935; Mon, 6 May 2013 14:12:37 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061412.r46ECbkj018935@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 14:12:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250293 - in head/sys/arm: arm mv mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 14:12:38 -0000 Author: gber Date: Mon May 6 14:12:36 2013 New Revision: 250293 URL: http://svnweb.freebsd.org/changeset/base/250293 Log: Properly initialize Armada XP MP subsystem. - correct setting of Auxiliary Control Register for MP mode - correct setting of Auxiliarty Debug registers - cleanup management of memory contains bootup code - early initialization of Coherency Fabric (MP and not-MP mode) - enable Snoop Filtering Obtained from: Semihalf Modified: head/sys/arm/arm/cpufunc_asm_pj4b.S head/sys/arm/arm/locore.S head/sys/arm/arm/mp_machdep.c head/sys/arm/mv/armadaxp/armadaxp.c head/sys/arm/mv/armadaxp/armadaxp_mp.c head/sys/arm/mv/mv_machdep.c Modified: head/sys/arm/arm/cpufunc_asm_pj4b.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_pj4b.S Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/arm/cpufunc_asm_pj4b.S Mon May 6 14:12:36 2013 (r250293) @@ -37,6 +37,10 @@ __FBSDID("$FreeBSD$"); .Lpj4b_cache_line_size: .word _C_LABEL(arm_pdcache_line_size) +.Lpj4b_sf_ctrl_reg: + .word 0xf1021820 + + ENTRY(pj4b_setttb) /* Cache synchronization is not required as this core has PIPT caches */ mcr p15, 0, r1, c7, c10, 4 /* drain the write buffer */ @@ -198,13 +202,42 @@ ENTRY(get_core_id) END(get_core_id) ENTRY(pj4b_config) + + /* Set Auxiliary Debug Modes Control 0 register */ + mrc p15, 1, r0, c15, c1, 0 + /* ARMADAXP errata fix: ARM-CPU-6136 */ + bic r0, r0, #(1 << 12) /* LDSTM first issue is single word */ + + orr r0, r0, #(1 << 22) /* DVM_WAKEUP disable */ + mcr p15, 1, r0, c15, c1, 0 + + /* Set Auxiliary Debug Modes Control 1 register */ + mrc p15, 1, r0, c15, c1, 1 + /* ARMADAXP errata fix: ARM-CPU-6409 */ + bic r0, r0, #(1 << 2) /* Disable static branch prediction */ + + orr r0, r0, #(1 << 5) /* STREX backoff disable */ + orr r0, r0, #(1 << 8) /* Internal parity handling disable */ + orr r0, r0, #(1 << 16) /* Disable data transfer for clean line */ + mcr p15, 1, r0, c15, c1, 1 + + /* Set Auxiliary Function Modes Control 0 register */ + mrc p15, 1, r0, c15, c2, 0 +#if defined(SMP) + orr r0, r0, #(1 << 1) /* SMP/nAMP enabled (coherency) */ +#endif + orr r0, r0, #(1 << 2) /* L1 parite enable */ + orr r0, r0, #(1 << 8) /* Cache and TLB maintenance broadcast enable */ + mcr p15, 1, r0, c15, c2, 0 + /* Set Auxiliary Debug Modes Control 2 register */ mrc p15, 1, r0, c15, c1, 2 - bic r0, r0, #(1 << 23) - orr r0, r0, #(1 << 25) - orr r0, r0, #(1 << 27) - orr r0, r0, #(1 << 29) - orr r0, r0, #(1 << 30) + bic r0, r0, #(1 << 23) /* Enable fast LDR */ + orr r0, r0, #(1 << 25) /* Intervention Interleave disable */ + orr r0, r0, #(1 << 27) /* Critical word first sequencing disable */ + orr r0, r0, #(1 << 29) /* Disable MO device read / write */ + orr r0, r0, #(1 << 30) /* L1 cache strict round-robin replacement policy*/ + orr r0, r0, #(1 << 31) /* Enable write evict */ mcr p15, 1, r0, c15, c1, 2 #if defined(SMP) /* Set SMP mode in Auxiliary Control Register */ @@ -212,6 +245,18 @@ ENTRY(pj4b_config) orr r0, r0, #(1 << 5) mcr p15, 0, r0, c1, c0, 1 #endif + + /* Load CPU number */ + mrc p15, 0, r0, c0, c0, 5 + and r0, r0, #0xf + + /* SF Enable and invalidate */ + ldr r1, .Lpj4b_sf_ctrl_reg + ldr r2, [r1, r0, lsl #8] + orr r2, r2, #(1 << 0) + bic r2, r2, #(1 << 8) + str r2, [r1, r0, lsl #8] + RET END(pj4b_config) Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/arm/locore.S Mon May 6 14:12:36 2013 (r250293) @@ -265,7 +265,11 @@ mmu_init_table: /* map VA 0xc0000000..0xc3ffffff to PA */ MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) -#endif +#if defined(CPU_MV_PJ4B) + /* map VA 0xf1000000..0xd0000000 to PA */ + MMU_INIT(0xf1000000, 0xd0000000, 1, L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)) +#endif /* CPU_MV_PJ4B */ +#endif /* SMP */ .word 0 /* end of table */ #endif .Lstart: Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/arm/mp_machdep.c Mon May 6 14:12:36 2013 (r250293) @@ -127,6 +127,13 @@ cpu_mp_start(void) KERNPHYSADDR + KERNVIRTADDR) >> L1_S_SHIFT] = L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)|L1_S_DOM(PMAP_DOMAIN_KERNEL)|addr; } + +#if defined(CPU_MV_PJ4B) + /* Add ARMADAXP registers required for snoop filter initialization */ + ((int *)(temp_pagetable_va))[0xf1000000 >> L1_S_SHIFT] = + L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)|0xd0000000; +#endif + temp_pagetable = (void*)(vtophys(temp_pagetable_va)); cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); Modified: head/sys/arm/mv/armadaxp/armadaxp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/mv/armadaxp/armadaxp.c Mon May 6 14:12:36 2013 (r250293) @@ -51,6 +51,9 @@ __FBSDID("$FreeBSD$"); (0x0F & (sar >> 24))) static uint32_t count_l2clk(void); +void armadaxp_l2_init(void); +void armadaxp_init_coher_fabric(void); +int platform_get_ncpus(void); #define ARMADAXP_L2_BASE (MV_BASE + 0x8000) #define ARMADAXP_L2_CTRL 0x100 @@ -77,7 +80,11 @@ static uint32_t count_l2clk(void); #define ARMADAXP_L2_FLUSH_PHYS 0x7F0 #define ARMADAXP_L2_FLUSH_WAY 0x7FC -#define COHER_FABRIC_CFU 0x228 +#define MV_COHERENCY_FABRIC_BASE (MV_MBUS_BRIDGE_BASE + 0x200) +#define COHER_FABRIC_CTRL 0x00 +#define COHER_FABRIC_CONF 0x04 +#define COHER_FABRIC_CFU 0x28 +#define COHER_FABRIC_CIB_CTRL 0x80 /* XXX Make gpio driver optional and remove it */ struct resource_spec mv_gpio_res[] = { @@ -188,8 +195,46 @@ get_l2clk(void) return (l2clk_freq); } -void armadaxp_l2_init(void); -void armadaxp_l2_idcache_inv_all(void); +static uint32_t +read_coher_fabric(uint32_t reg) +{ + + return (bus_space_read_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg)); +} + +static void +write_coher_fabric(uint32_t reg, uint32_t val) +{ + + bus_space_write_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg, val); +} + +int +platform_get_ncpus(void) +{ +#if !defined(SMP) + return (1); +#else + return ((read_coher_fabric(COHER_FABRIC_CONF) & 0xf) + 1); +#endif +} + +void +armadaxp_init_coher_fabric(void) +{ + uint32_t val, cpus, mask; + + cpus = platform_get_ncpus(); + mask = (1 << cpus) - 1; + val = read_coher_fabric(COHER_FABRIC_CTRL); + val |= (mask << 24); + write_coher_fabric(COHER_FABRIC_CTRL, val); + + val = read_coher_fabric(COHER_FABRIC_CONF); + val |= (mask << 24); + val |= (1 << 15); + write_coher_fabric(COHER_FABRIC_CONF, val); +} #define ALL_WAYS 0xffffffff @@ -208,7 +253,7 @@ write_l2_cache(uint32_t reg, uint32_t va bus_space_write_4(fdtbus_bs_tag, ARMADAXP_L2_BASE, reg, val); } -void +static void armadaxp_l2_idcache_inv_all(void) { write_l2_cache(ARMADAXP_L2_INV_WAY, ALL_WAYS); @@ -233,11 +278,6 @@ armadaxp_l2_init(void) /* Clear pending L2 interrupts */ write_l2_cache(ARMADAXP_L2_INT_CAUSE, 0x1ff); - /* Enable Cache and TLB maintenance broadcast */ - __asm__ __volatile__ ("mrc p15, 1, %0, c15, c2, 0" : "=r"(reg)); - reg |= (1 << 8); - __asm__ __volatile__ ("mcr p15, 1, %0, c15, c2, 0" : :"r"(reg)); - /* Enable l2 cache */ reg = read_l2_cache(ARMADAXP_L2_CTRL); write_l2_cache(ARMADAXP_L2_CTRL, reg | L2_ENABLE); @@ -254,10 +294,14 @@ armadaxp_l2_init(void) * Enable Cache maintenance operation propagation in coherency fabric * Change point of coherency and point of unification to DRAM. */ - reg = bus_space_read_4(fdtbus_bs_tag, MV_MBUS_BRIDGE_BASE, - COHER_FABRIC_CFU); + reg = read_coher_fabric(COHER_FABRIC_CFU); reg |= (1 << 17) | (1 << 18); - bus_space_write_4(fdtbus_bs_tag, MV_MBUS_BRIDGE_BASE, COHER_FABRIC_CFU, - reg); + write_coher_fabric(COHER_FABRIC_CFU, reg); + + /* Coherent IO Bridge initialization */ + reg = read_coher_fabric(COHER_FABRIC_CIB_CTRL); + reg &= ~(7 << 16); + reg |= (7 << 16); + write_coher_fabric(COHER_FABRIC_CIB_CTRL, reg); } Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Mon May 6 14:12:36 2013 (r250293) @@ -33,21 +33,21 @@ #include #include +#include +#include +#include + #include #include +#include #include -static int platform_get_ncpus(void); - #define MV_AXP_CPU_DIVCLK_BASE (MV_BASE + 0x18700) #define CPU_DIVCLK_CTRL0 0x00 #define CPU_DIVCLK_CTRL2_RATIO_FULL0 0x08 #define CPU_DIVCLK_CTRL2_RATIO_FULL1 0x0c - -#define MV_COHERENCY_FABRIC_BASE (MV_MBUS_BRIDGE_BASE + 0x200) -#define COHER_FABRIC_CTRL 0x00 -#define COHER_FABRIC_CONF 0x04 +#define CPU_DIVCLK_MASK(x) (~(0xff << (8 * (x)))) #define CPU_PMU(x) (MV_BASE + 0x22100 + (0x100 * (x))) #define CPU_PMU_BOOT 0x24 @@ -57,20 +57,8 @@ static int platform_get_ncpus(void); #define CPU_RESUME_CONTROL (0x20988) -/* Coherency Fabric registers */ -static uint32_t -read_coher_fabric(uint32_t reg) -{ - - return (bus_space_read_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg)); -} - -static void -write_coher_fabric(uint32_t reg, uint32_t val) -{ - - bus_space_write_4(fdtbus_bs_tag, MV_COHERENCY_FABRIC_BASE, reg, val); -} +void armadaxp_init_coher_fabric(void); +int platform_get_ncpus(void); /* Coherency Fabric registers */ static uint32_t @@ -111,56 +99,58 @@ platform_mp_init_secondary(void) void mpentry(void); void mptramp(void); -static void -initialize_coherency_fabric(void) -{ - uint32_t val, cpus, mask; - - cpus = platform_get_ncpus(); - mask = (1 << cpus) - 1; - val = read_coher_fabric(COHER_FABRIC_CTRL); - val |= (mask << 24); - write_coher_fabric(COHER_FABRIC_CTRL, val); - - val = read_coher_fabric(COHER_FABRIC_CONF); - val |= (mask << 24); - write_coher_fabric(COHER_FABRIC_CONF, val); -} void platform_mp_start_ap(void) { - uint32_t reg, *ptr, cpu_num; - - /* Copy boot code to SRAM */ - *((unsigned int*)(0xf1020240)) = 0xffff0101; - *((unsigned int*)(0xf1008500)) = 0xffff0003; - - pmap_kenter_nocache(0x880f0000, 0xffff0000); - reg = 0x880f0000; - - for (ptr = (uint32_t *)mptramp; ptr < (uint32_t *)mpentry; - ptr++, reg += 4) - *((uint32_t *)reg) = *ptr; - - if (mp_ncpus > 1) { - reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL0); - reg &= 0x00ffffff; - reg |= 0x01000000; - write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL0, reg); + uint32_t reg, *src, *dst, cpu_num, div_val, cputype; + vm_offset_t smp_boot; + /* + * Initialization procedure depends on core revision, + * in this step CHIP ID is checked to choose proper procedure + */ + cputype = cpufunc_id(); + cputype &= CPU_ID_CPU_MASK; + + smp_boot = kmem_alloc_nofault(kernel_map, PAGE_SIZE); + pmap_kenter_nocache(smp_boot, 0xffff0000); + dst = (uint32_t *) smp_boot; + + for (src = (uint32_t *)mptramp; src < (uint32_t *)mpentry; + src++, dst++) { + *dst = *src; } - if (mp_ncpus > 2) { - reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); - reg &= 0xff00ffff; - reg |= 0x00010000; - write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); - } - if (mp_ncpus > 3) { - reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); - reg &= 0x00ffffff; - reg |= 0x01000000; - write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); + kmem_free(kernel_map, smp_boot, PAGE_SIZE); + + if (cputype == CPU_ID_MV88SV584X_V7) { + /* Core rev A0 */ + div_val = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); + div_val &= 0x3f; + + for (cpu_num = 1; cpu_num < mp_ncpus; cpu_num++ ) { + reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); + reg &= CPU_DIVCLK_MASK(cpu_num); + reg |= div_val << (cpu_num * 8); + write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); + } + } else { + /* Core rev Z1 */ + div_val = 0x01; + + if (mp_ncpus > 1) { + reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL0); + reg &= CPU_DIVCLK_MASK(3); + reg |= div_val << 24; + write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL0, reg); + } + + for (cpu_num = 2; cpu_num < mp_ncpus; cpu_num++ ) { + reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); + reg &= CPU_DIVCLK_MASK(cpu_num); + reg |= div_val << (cpu_num * 8); + write_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1, reg); + } } reg = read_cpu_clkdiv(CPU_DIVCLK_CTRL0); @@ -190,14 +180,7 @@ platform_mp_start_ap(void) wmb(); DELAY(10); - initialize_coherency_fabric(); -} - -static int -platform_get_ncpus(void) -{ - - return ((read_coher_fabric(COHER_FABRIC_CONF) & 0xf) + 1); + armadaxp_init_coher_fabric(); } void Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Mon May 6 13:52:49 2013 (r250292) +++ head/sys/arm/mv/mv_machdep.c Mon May 6 14:12:36 2013 (r250293) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); static int platform_mpp_init(void); #if defined(SOC_MV_ARMADAXP) +void armadaxp_init_coher_fabric(void); void armadaxp_l2_init(void); #endif @@ -237,6 +238,10 @@ initarm_late_init(void) write_cpu_ctrl(CPU_TIMERS_BASE + CPU_TIMER_CONTROL, 0); #endif #if defined(SOC_MV_ARMADAXP) +#if !defined(SMP) + /* For SMP case it should be initialized after APs are booted */ + armadaxp_init_coher_fabric(); +#endif armadaxp_l2_init(); #endif } From owner-svn-src-all@FreeBSD.ORG Mon May 6 14:27:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7DC1B2E4; Mon, 6 May 2013 14:27:47 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 700918C9; Mon, 6 May 2013 14:27:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46ERlH6023244; Mon, 6 May 2013 14:27:47 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46ERlbV023243; Mon, 6 May 2013 14:27:47 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061427.r46ERlbV023243@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 14:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250294 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 14:27:47 -0000 Author: gber Date: Mon May 6 14:27:46 2013 New Revision: 250294 URL: http://svnweb.freebsd.org/changeset/base/250294 Log: Avoid calling pcpu_init() simultaneously. pcpu_init() updates queue, so cannot be called by multiple cores at the same time Obtained from: Semihalf Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c ============================================================================== --- head/sys/arm/arm/mp_machdep.c Mon May 6 14:12:36 2013 (r250293) +++ head/sys/arm/arm/mp_machdep.c Mon May 6 14:27:46 2013 (r250294) @@ -173,8 +173,15 @@ init_secondary(int cpu) pc = &__pcpu[cpu]; set_pcpu(pc); - pcpu_init(pc, cpu, sizeof(struct pcpu)); + /* + * pcpu_init() updates queue, so it should not be executed in parallel + * on several cores + */ + while(mp_naps < (cpu - 1)) + ; + + pcpu_init(pc, cpu, sizeof(struct pcpu)); dpcpu_init(dpcpu[cpu - 1], cpu); /* Provide stack pointers for other processor modes. */ From owner-svn-src-all@FreeBSD.ORG Mon May 6 14:54:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 03A7296F; Mon, 6 May 2013 14:54:18 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8D43A3F; Mon, 6 May 2013 14:54:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46EsHD4032765; Mon, 6 May 2013 14:54:17 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46EsHNt032762; Mon, 6 May 2013 14:54:17 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061454.r46EsHNt032762@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 14:54:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250295 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 14:54:18 -0000 Author: gber Date: Mon May 6 14:54:17 2013 New Revision: 250295 URL: http://svnweb.freebsd.org/changeset/base/250295 Log: Disable decoding windows with no FDT entry. - On ARMADAXP B0 (GP development board) we are not able to use PCI due to whole 32-bit address space used by 4GB of RAM memory. - Change is required to destroy unnecessary window to free address space for PCI and other devices - Fix offset value for SDRAM decoding windows Obtained from: Semihalf Modified: head/sys/arm/mv/common.c head/sys/arm/mv/mvvar.h head/sys/arm/mv/mvwin.h Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Mon May 6 14:27:46 2013 (r250294) +++ head/sys/arm/mv/common.c Mon May 6 14:54:17 2013 (r250295) @@ -89,6 +89,7 @@ static int decode_win_xor_valid(void); #ifndef SOC_MV_FREY static void decode_win_cpu_setup(void); +static int decode_win_sdram_fixup(void); #endif static void decode_win_usb_setup(u_long); static void decode_win_eth_setup(u_long); @@ -522,6 +523,11 @@ soc_decode_win(void) /* Retrieve our ID: some windows facilities vary between SoC models */ soc_id(&dev, &rev); +#ifdef SOC_MV_ARMADAXP + if ((err = decode_win_sdram_fixup()) != 0) + return(err); +#endif + #ifndef SOC_MV_FREY if (!decode_win_cpu_valid() || !decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || @@ -617,6 +623,8 @@ WIN_REG_BASE_IDX_WR(win_sata, br, MV_WIN #ifndef SOC_MV_DOVE WIN_REG_IDX_RD(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) WIN_REG_IDX_RD(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) +WIN_REG_IDX_WR(ddr, br, MV_WIN_DDR_BASE, MV_DDR_CADR_BASE) +WIN_REG_IDX_WR(ddr, sz, MV_WIN_DDR_SIZE, MV_DDR_CADR_BASE) #else /* * On 88F6781 (Dove) SoC DDR Controller is accessed through @@ -871,6 +879,48 @@ decode_win_cpu_setup(void) cpu_wins[i].size, cpu_wins[i].remap); } + +static int +decode_win_sdram_fixup(void) +{ + struct mem_region mr[FDT_MEM_REGIONS]; + uint8_t window_valid[MV_WIN_DDR_MAX]; + int mr_cnt, memsize, err, i, j; + uint32_t valid_win_num = 0; + + /* Grab physical memory regions information from device tree. */ + err = fdt_get_mem_regions(mr, &mr_cnt, &memsize); + if (err != 0) + return (err); + + for (i = 0; i < MV_WIN_DDR_MAX; i++) + window_valid[i] = 0; + + /* Try to match entries from device tree with settings from u-boot */ + for (i = 0; i < mr_cnt; i++) { + for (j = 0; j < MV_WIN_DDR_MAX; j++) { + if (ddr_is_active(j) && + (ddr_base(j) == mr[i].mr_start) && + (ddr_size(j) == mr[i].mr_size)) { + window_valid[j] = 1; + valid_win_num++; + } + } + } + + if (mr_cnt != valid_win_num) + return (EINVAL); + + /* Destroy windows without corresponding device tree entry */ + for (j = 0; j < MV_WIN_DDR_MAX; j++) { + if (ddr_is_active(j) && (window_valid[j] != 1)) { + printf("Disabling SDRAM decoding window: %d\n", j); + ddr_disable(j); + } + } + + return (0); +} #endif /* * Check if we're able to cover all active DDR banks. @@ -907,6 +957,14 @@ ddr_is_active(int i) return (0); } +void +ddr_disable(int i) +{ + + ddr_sz_write(i, 0); + ddr_br_write(i, 0); +} + uint32_t ddr_base(int i) { Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Mon May 6 14:27:46 2013 (r250294) +++ head/sys/arm/mv/mvvar.h Mon May 6 14:54:17 2013 (r250295) @@ -97,6 +97,7 @@ int decode_win_overlap(int, int, const s int win_cpu_can_remap(int); void decode_win_pcie_setup(u_long); +void ddr_disable(int i); int ddr_is_active(int i); uint32_t ddr_base(int i); uint32_t ddr_size(int i); Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Mon May 6 14:27:46 2013 (r250294) +++ head/sys/arm/mv/mvwin.h Mon May 6 14:54:17 2013 (r250295) @@ -122,6 +122,8 @@ #define MV_DDR_CADR_BASE (MV_AXI_BASE + 0x100) #elif defined(SOC_MV_LOKIPLUS) #define MV_DDR_CADR_BASE (MV_BASE + 0xF1500) +#elif defined(SOC_MV_ARMADAXP) +#define MV_DDR_CADR_BASE (MV_BASE + 0x20180) #else #define MV_DDR_CADR_BASE (MV_BASE + 0x1500) #endif From owner-svn-src-all@FreeBSD.ORG Mon May 6 14:57:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F833BE7; Mon, 6 May 2013 14:57:03 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62181A7A; Mon, 6 May 2013 14:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46Ev3os033327; Mon, 6 May 2013 14:57:03 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46Ev3Sd033326; Mon, 6 May 2013 14:57:03 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061457.r46Ev3Sd033326@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 14:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250296 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 14:57:03 -0000 Author: gber Date: Mon May 6 14:57:02 2013 New Revision: 250296 URL: http://svnweb.freebsd.org/changeset/base/250296 Log: Correct comment about initial VA=>PA mapping Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Mon May 6 14:54:17 2013 (r250295) +++ head/sys/arm/arm/locore.S Mon May 6 14:57:02 2013 (r250296) @@ -266,7 +266,7 @@ mmu_init_table: MMU_INIT(KERNBASE, PHYSADDR, 64, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) MMU_INIT(0x48000000, 0x48000000, 1, L1_TYPE_S|L1_SHARED|L1_S_C|L1_S_AP(AP_KRW)) #if defined(CPU_MV_PJ4B) - /* map VA 0xf1000000..0xd0000000 to PA */ + /* map VA 0xf1000000..0xf1100000 to PA 0xd0000000 */ MMU_INIT(0xf1000000, 0xd0000000, 1, L1_TYPE_S|L1_SHARED|L1_S_B|L1_S_AP(AP_KRW)) #endif /* CPU_MV_PJ4B */ #endif /* SMP */ From owner-svn-src-all@FreeBSD.ORG Mon May 6 15:30:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06AEB744; Mon, 6 May 2013 15:30:35 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DDA26D39; Mon, 6 May 2013 15:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46FUYEx045026; Mon, 6 May 2013 15:30:34 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46FUYLh045024; Mon, 6 May 2013 15:30:34 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061530.r46FUYLh045024@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 15:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250297 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 15:30:35 -0000 Author: gber Date: Mon May 6 15:30:34 2013 New Revision: 250297 URL: http://svnweb.freebsd.org/changeset/base/250297 Log: Fix L2 PTE access permissions management. Keep following access permissions: APX AP Kernel User 1 01 R N 1 10 R R 0 01 R/W N 0 11 R/W R/W Avoid using reserved in ARMv6 APX|AP settings: - In case of unprivileged (user) access without permission to write, the access permission bits were being set to reserved for ARMv6 (but valid for ARMv7) value of APX|AP = 111. Fix-up faulting userland accesses properly: - Wrong condition statement in pmap_fault_fixup() caused that any genuine, unprivileged access was being fixed-up instead of just skip doing anything and return. Staring from now we ensure proper reaction for illicit user accesses. L2_S_PROT_R and L2_S_PROT_U names might be misleading as they do not reflect real permission levels. It will be clarified in following patches (switch to AP[2:1] permissions model). Obtained from: Semihalf Modified: head/sys/arm/arm/pmap-v6.c head/sys/arm/include/pmap.h Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon May 6 14:57:02 2013 (r250296) +++ head/sys/arm/arm/pmap-v6.c Mon May 6 15:30:34 2013 (r250297) @@ -983,6 +983,7 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ if (!(prot & VM_PROT_EXECUTE)) *ptep |= L2_XN; + *ptep |= L2_APX; *ptep |= L2_S_PROT_R; if (user) @@ -990,6 +991,8 @@ pmap_set_prot(pt_entry_t *ptep, vm_prot_ if (prot & VM_PROT_WRITE) *ptep &= ~(L2_APX); + else if (user) + *ptep &= ~(L2_S_PROT_R); } /* @@ -1216,7 +1219,7 @@ pmap_fault_fixup(pmap_t pm, vm_offset_t /* * Catch a userland access to the vector page mapped at 0x0 */ - if (user && ((pte & L2_S_PROT_MASK) == L2_S_PROT_U)) + if (user && !(pte & L2_S_PROT_U)) goto out; if (va == vector_page) goto out; @@ -2649,7 +2652,10 @@ do_l2b_alloc: npte |= L2_TYPE_INV; } + npte |= L2_APX; npte |= L2_S_PROT_R; + if (user) + npte |= L2_S_PROT_U; if (prot & VM_PROT_WRITE) { npte &= ~(L2_APX); @@ -2657,11 +2663,8 @@ do_l2b_alloc: if (m != NULL && (m->oflags & VPO_UNMANAGED) == 0) vm_page_aflag_set(m, PGA_WRITEABLE); - } - - if (user) - npte |= L2_S_PROT_U; - + } else if (user) + npte &= ~(L2_S_PROT_R); if (!(prot & VM_PROT_EXECUTE) && m) npte |= L2_XN; Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon May 6 14:57:02 2013 (r250296) +++ head/sys/arm/include/pmap.h Mon May 6 15:30:34 2013 (r250297) @@ -352,7 +352,7 @@ extern int pmap_needs_pte_sync; #elif (ARM_MMU_V6 + ARM_MMU_V7) != 0 #define L2_S_PROT_U (L2_AP0(2)) /* user access */ -#define L2_S_PROT_R (L2_APX|L2_AP0(1)) /* read access */ +#define L2_S_PROT_R (L2_AP0(1)) /* read access */ #define L2_S_PROT_MASK (L2_S_PROT_U|L2_S_PROT_R) #define L2_S_WRITABLE(pte) (!(pte & L2_APX)) From owner-svn-src-all@FreeBSD.ORG Mon May 6 15:58:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A1CE2AA; Mon, 6 May 2013 15:58:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE08E75; Mon, 6 May 2013 15:58:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46FwsmZ056328; Mon, 6 May 2013 15:58:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46Fws6i056327; Mon, 6 May 2013 15:58:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305061558.r46Fws6i056327@svn.freebsd.org> From: Alexander Motin Date: Mon, 6 May 2013 15:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250298 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 15:58:54 -0000 Author: mav Date: Mon May 6 15:58:53 2013 New Revision: 250298 URL: http://svnweb.freebsd.org/changeset/base/250298 Log: Fix byte order of ATA WWN when converting it to SCSI LUN ID. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon May 6 15:30:34 2013 (r250297) +++ head/sys/cam/ata/ata_xpt.c Mon May 6 15:58:53 2013 (r250298) @@ -834,6 +834,7 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; + int i; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -913,8 +914,10 @@ noerror: path->device->device_id_len = 16; bcopy(&fake_device_id_hdr, path->device->device_id, 8); - bcopy(ident_buf->wwn, - path->device->device_id + 8, 8); + for (i = 0; i < 4; i++) { + ptr = (int16_t *)(path->device->device_id + 8); + ptr[i] = bswap16(ident_buf->wwn[i]); + } } } From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:11:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B8F6669C; Mon, 6 May 2013 16:11:53 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA7AFED8; Mon, 6 May 2013 16:11:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46GBrcP062552; Mon, 6 May 2013 16:11:53 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46GBrJp062551; Mon, 6 May 2013 16:11:53 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305061611.r46GBrJp062551@svn.freebsd.org> From: Grzegorz Bernacki Date: Mon, 6 May 2013 16:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250299 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:11:53 -0000 Author: gber Date: Mon May 6 16:11:53 2013 New Revision: 250299 URL: http://svnweb.freebsd.org/changeset/base/250299 Log: Fix page reference emulation on ARMv6 and v7 Submitted by: Zbigniew Bodek Obtained from: Semihalf Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Mon May 6 15:58:53 2013 (r250298) +++ head/sys/arm/arm/pmap-v6.c Mon May 6 16:11:53 2013 (r250299) @@ -2649,6 +2649,7 @@ do_l2b_alloc: /* * Need to do page referenced emulation. */ + npte &= ~L2_TYPE_MASK; npte |= L2_TYPE_INV; } From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:16:09 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABB7586A; Mon, 6 May 2013 16:16:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) by mx1.freebsd.org (Postfix) with ESMTP id 859C1F04; Mon, 6 May 2013 16:16:09 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UZO5A-000PKY-Dk; Mon, 06 May 2013 16:16:08 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r46GG6Cn014664; Mon, 6 May 2013 10:16:06 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18PIUuUiykk4SiHY6Dwf9aG Subject: Re: svn commit: r250298 - head/sys/cam/ata From: Ian Lepore To: Alexander Motin In-Reply-To: <201305061558.r46Fws6i056327@svn.freebsd.org> References: <201305061558.r46Fws6i056327@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 06 May 2013 10:16:06 -0600 Message-ID: <1367856966.1180.168.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:16:09 -0000 On Mon, 2013-05-06 at 15:58 +0000, Alexander Motin wrote: > Author: mav > Date: Mon May 6 15:58:53 2013 > New Revision: 250298 > URL: http://svnweb.freebsd.org/changeset/base/250298 > > Log: > Fix byte order of ATA WWN when converting it to SCSI LUN ID. > > Modified: > head/sys/cam/ata/ata_xpt.c > > Modified: head/sys/cam/ata/ata_xpt.c > ============================================================================== > --- head/sys/cam/ata/ata_xpt.c Mon May 6 15:30:34 2013 (r250297) > +++ head/sys/cam/ata/ata_xpt.c Mon May 6 15:58:53 2013 (r250298) > @@ -834,6 +834,7 @@ noerror: > { > struct ccb_pathinq cpi; > int16_t *ptr; > + int i; > > ident_buf = &softc->ident_data; > for (ptr = (int16_t *)ident_buf; > @@ -913,8 +914,10 @@ noerror: > path->device->device_id_len = 16; > bcopy(&fake_device_id_hdr, > path->device->device_id, 8); > - bcopy(ident_buf->wwn, > - path->device->device_id + 8, 8); > + for (i = 0; i < 4; i++) { > + ptr = (int16_t *)(path->device->device_id + 8); > + ptr[i] = bswap16(ident_buf->wwn[i]); > + } > } > } > Shouldn't this use ata_bswap()? If not that, then shouldn't it be one of the conditional swap routines (be16dec() or similar)? -- Ian From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:42:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D75AFF36; Mon, 6 May 2013 16:42:20 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B94FAFFD; Mon, 6 May 2013 16:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46GgKUL072945; Mon, 6 May 2013 16:42:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46GgIWP072931; Mon, 6 May 2013 16:42:18 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201305061642.r46GgIWP072931@svn.freebsd.org> From: Andre Oppermann Date: Mon, 6 May 2013 16:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250300 - in head/sys: kern net netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:42:20 -0000 Author: andre Date: Mon May 6 16:42:18 2013 New Revision: 250300 URL: http://svnweb.freebsd.org/changeset/base/250300 Log: Back out r249318, r249320 and r249327 due to a heisenbug most likely related to a race condition in the ipi_hash_lock with the exact cause currently unknown but under investigation. Modified: head/sys/kern/uipc_socket.c head/sys/net/if.c head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h head/sys/net/if_var.h head/sys/netinet/in_pcb.h head/sys/netinet/in_var.h head/sys/netinet/ip_id.c head/sys/netinet/ip_input.c head/sys/netinet/tcp_subr.c head/sys/sys/socketvar.h Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/kern/uipc_socket.c Mon May 6 16:42:18 2013 (r250300) @@ -240,14 +240,14 @@ SYSCTL_INT(_kern_ipc_zero_copy, OID_AUTO * accept_mtx locks down per-socket fields relating to accept queues. See * socketvar.h for an annotation of the protected fields of struct socket. */ -struct mtx_padalign accept_mtx; +struct mtx accept_mtx; MTX_SYSINIT(accept_mtx, &accept_mtx, "accept", MTX_DEF); /* * so_global_mtx protects so_gencnt, numopensockets, and the per-socket * so_gencnt field. */ -static struct mtx_padalign so_global_mtx; +static struct mtx so_global_mtx; MTX_SYSINIT(so_global_mtx, &so_global_mtx, "so_glabel", MTX_DEF); /* Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/net/if.c Mon May 6 16:42:18 2013 (r250300) @@ -206,7 +206,7 @@ VNET_DEFINE(struct ifindex_entry *, ifin * also to stablize it over long-running ioctls, without introducing priority * inversions and deadlocks. */ -struct rwlock_padalign ifnet_rwlock; +struct rwlock ifnet_rwlock; struct sx ifnet_sxlock; /* Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/net/if_llatbl.c Mon May 6 16:42:18 2013 (r250300) @@ -67,7 +67,7 @@ static VNET_DEFINE(SLIST_HEAD(, lltable) static void vnet_lltable_init(void); -struct rwlock_padalign lltable_rwlock; +struct rwlock lltable_rwlock; RW_SYSINIT(lltable_rwlock, &lltable_rwlock, "lltable_rwlock"); /* Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Mon May 6 16:11:53 2013 (r250299) +++ head/sys/net/if_llatbl.h Mon May 6 16:42:18 2013 (r250300) @@ -43,7 +43,7 @@ struct rt_addrinfo; struct llentry; LIST_HEAD(llentries, llentry); -extern struct rwlock_padalign lltable_rwlock; +extern struct rwlock lltable_rwlock; #define LLTABLE_RLOCK() rw_rlock(&lltable_rwlock) #define LLTABLE_RUNLOCK() rw_runlock(&lltable_rwlock) #define LLTABLE_WLOCK() rw_wlock(&lltable_rwlock) Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon May 6 16:11:53 2013 (r250299) +++ head/sys/net/if_var.h Mon May 6 16:42:18 2013 (r250300) @@ -191,9 +191,9 @@ struct ifnet { void *if_unused[2]; void *if_afdata[AF_MAX]; int if_afdata_initialized; + struct rwlock if_afdata_lock; struct task if_linktask; /* task for link change events */ - struct rwlock_padalign if_afdata_lock; - struct rwlock_padalign if_addr_lock; /* lock to protect address lists */ + struct rwlock if_addr_lock; /* lock to protect address lists */ LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ @@ -832,7 +832,7 @@ struct ifmultiaddr { #ifdef _KERNEL -extern struct rwlock_padalign ifnet_rwlock; +extern struct rwlock ifnet_rwlock; extern struct sx ifnet_sxlock; #define IFNET_LOCK_INIT() do { \ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon May 6 16:11:53 2013 (r250299) +++ head/sys/netinet/in_pcb.h Mon May 6 16:42:18 2013 (r250300) @@ -330,7 +330,7 @@ struct inpcbinfo { /* * Global lock protecting non-pcbgroup hash lookup tables. */ - struct rwlock_padalign ipi_hash_lock; + struct rwlock ipi_hash_lock; /* * Global hash of inpcbs, hashed by local and foreign addresses and Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Mon May 6 16:11:53 2013 (r250299) +++ head/sys/netinet/in_var.h Mon May 6 16:42:18 2013 (r250300) @@ -116,7 +116,7 @@ VNET_DECLARE(u_long, in_ifaddrhmask); / #define INADDR_HASH(x) \ (&V_in_ifaddrhashtbl[INADDR_HASHVAL(x) & V_in_ifaddrhmask]) -extern struct rwlock_padalign in_ifaddr_lock; +extern struct rwlock in_ifaddr_lock; #define IN_IFADDR_LOCK_ASSERT() rw_assert(&in_ifaddr_lock, RA_LOCKED) #define IN_IFADDR_RLOCK() rw_rlock(&in_ifaddr_lock) Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/netinet/ip_id.c Mon May 6 16:42:18 2013 (r250300) @@ -97,7 +97,7 @@ static int array_ptr = 0; static int array_size = 8192; static int random_id_collisions = 0; static int random_id_total = 0; -static struct mtx_padalign ip_id_mtx; +static struct mtx ip_id_mtx; static void ip_initid(void); static int sysctl_ip_id_change(SYSCTL_HANDLER_ARGS); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/netinet/ip_input.c Mon May 6 16:42:18 2013 (r250300) @@ -85,7 +85,7 @@ __FBSDID("$FreeBSD$"); CTASSERT(sizeof(struct ip) == 20); #endif -struct rwlock_padalign in_ifaddr_lock; +struct rwlock in_ifaddr_lock; RW_SYSINIT(in_ifaddr_lock, &in_ifaddr_lock, "in_ifaddr_lock"); VNET_DEFINE(int, rsvp_on); @@ -155,7 +155,7 @@ VNET_DEFINE(u_long, in_ifaddrhmask); /* static VNET_DEFINE(uma_zone_t, ipq_zone); static VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); -static struct mtx_padalign ipqlock; +static struct mtx ipqlock; #define V_ipq_zone VNET(ipq_zone) #define V_ipq VNET(ipq) Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon May 6 16:11:53 2013 (r250299) +++ head/sys/netinet/tcp_subr.c Mon May 6 16:42:18 2013 (r250300) @@ -255,7 +255,7 @@ static VNET_DEFINE(uma_zone_t, tcpcb_zon #define V_tcpcb_zone VNET(tcpcb_zone) MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); -static struct mtx_padalign isn_mtx; +static struct mtx isn_mtx; #define ISN_LOCK_INIT() mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF) #define ISN_LOCK() mtx_lock(&isn_mtx) Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Mon May 6 16:11:53 2013 (r250299) +++ head/sys/sys/socketvar.h Mon May 6 16:42:18 2013 (r250300) @@ -133,7 +133,7 @@ struct socket { * avoid defining a lock order between listen and accept sockets * until such time as it proves to be a good idea. */ -extern struct mtx_padalign accept_mtx; +extern struct mtx accept_mtx; #define ACCEPT_LOCK_ASSERT() mtx_assert(&accept_mtx, MA_OWNED) #define ACCEPT_UNLOCK_ASSERT() mtx_assert(&accept_mtx, MA_NOTOWNED) #define ACCEPT_LOCK() mtx_lock(&accept_mtx) From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:50:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E8DF23C8; Mon, 6 May 2013 16:50:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBDEBFA; Mon, 6 May 2013 16:50:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46GodUw075889; Mon, 6 May 2013 16:50:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46GodEK075888; Mon, 6 May 2013 16:50:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305061650.r46GodEK075888@svn.freebsd.org> From: Alexander Motin Date: Mon, 6 May 2013 16:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250301 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:50:40 -0000 Author: mav Date: Mon May 6 16:50:39 2013 New Revision: 250301 URL: http://svnweb.freebsd.org/changeset/base/250301 Log: Rework r250298 in more correct way. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Mon May 6 16:42:18 2013 (r250300) +++ head/sys/cam/ata/ata_xpt.c Mon May 6 16:50:39 2013 (r250301) @@ -834,7 +834,6 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; - int i; ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; @@ -914,10 +913,9 @@ noerror: path->device->device_id_len = 16; bcopy(&fake_device_id_hdr, path->device->device_id, 8); - for (i = 0; i < 4; i++) { - ptr = (int16_t *)(path->device->device_id + 8); - ptr[i] = bswap16(ident_buf->wwn[i]); - } + bcopy(ident_buf->wwn, + path->device->device_id + 8, 8); + ata_bswap(path->device->device_id + 8, 8); } } From owner-svn-src-all@FreeBSD.ORG Mon May 6 16:51:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8A964538; Mon, 6 May 2013 16:51:20 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f49.google.com (mail-ee0-f49.google.com [74.125.83.49]) by mx1.freebsd.org (Postfix) with ESMTP id 9E244FF; Mon, 6 May 2013 16:51:19 +0000 (UTC) Received: by mail-ee0-f49.google.com with SMTP id c41so1837013eek.8 for ; Mon, 06 May 2013 09:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ojjqX4Od+Nd+DxUVtfn0TEB3SJjVq58NXaMyd48shs8=; b=c3TVx770ivoF5nbFZjEX6XR8t5cF71ilNM4IIpDIDb6Tz2kdnsEk239i5xpR+Tu2SF SZQf+DPWaPU5w5+6dzcziQAsEJz/3qIW/MKBYp6WOsUW7hqJfZzCtwd9DsTiDYCyGi0R CQRxs4z0wVLynTH0TLzjggd9WO7Hdc1EtZ8pssUPqcWuCx1Q0m3w+lj6e3aa+iUaC95D TJAxchgQYclC4I/984xVZo1tWr0E5dw4FblrHuBoREdlf5f/ZA3SKBLPe0/t2SvF3EYH 5ZtOEhqh6U2vVHa8mF8db4Oj1YTrmyxvzK96jgjS130VTc3rRwX81V2GC4aEys9+XyHG pDMw== X-Received: by 10.15.23.69 with SMTP id g45mr62186111eeu.25.1367859078335; Mon, 06 May 2013 09:51:18 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPSA id bn53sm34449572eeb.7.2013.05.06.09.51.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 06 May 2013 09:51:17 -0700 (PDT) Sender: Alexander Motin Message-ID: <5187DF81.8030706@FreeBSD.org> Date: Mon, 06 May 2013 19:51:13 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130413 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r250298 - head/sys/cam/ata References: <201305061558.r46Fws6i056327@svn.freebsd.org> <1367856966.1180.168.camel@revolution.hippie.lan> In-Reply-To: <1367856966.1180.168.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 16:51:20 -0000 On 06.05.2013 19:16, Ian Lepore wrote: > On Mon, 2013-05-06 at 15:58 +0000, Alexander Motin wrote: >> Author: mav >> Date: Mon May 6 15:58:53 2013 >> New Revision: 250298 >> URL: http://svnweb.freebsd.org/changeset/base/250298 >> >> Log: >> Fix byte order of ATA WWN when converting it to SCSI LUN ID. >> >> Modified: >> head/sys/cam/ata/ata_xpt.c >> >> Modified: head/sys/cam/ata/ata_xpt.c >> ============================================================================== >> --- head/sys/cam/ata/ata_xpt.c Mon May 6 15:30:34 2013 (r250297) >> +++ head/sys/cam/ata/ata_xpt.c Mon May 6 15:58:53 2013 (r250298) >> @@ -834,6 +834,7 @@ noerror: >> { >> struct ccb_pathinq cpi; >> int16_t *ptr; >> + int i; >> >> ident_buf = &softc->ident_data; >> for (ptr = (int16_t *)ident_buf; >> @@ -913,8 +914,10 @@ noerror: >> path->device->device_id_len = 16; >> bcopy(&fake_device_id_hdr, >> path->device->device_id, 8); >> - bcopy(ident_buf->wwn, >> - path->device->device_id + 8, 8); >> + for (i = 0; i < 4; i++) { >> + ptr = (int16_t *)(path->device->device_id + 8); >> + ptr[i] = bswap16(ident_buf->wwn[i]); >> + } >> } >> } >> > > Shouldn't this use ata_bswap()? If not that, then shouldn't it be one > of the conditional swap routines (be16dec() or similar)? You are right. Thank you. Remade. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon May 6 17:21:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 91A1719E; Mon, 6 May 2013 17:21:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84407292; Mon, 6 May 2013 17:21:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46HLSEO086950; Mon, 6 May 2013 17:21:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46HLSup086949; Mon, 6 May 2013 17:21:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305061721.r46HLSup086949@svn.freebsd.org> From: Eitan Adler Date: Mon, 6 May 2013 17:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250302 - head/usr.sbin/rtadvd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 17:21:28 -0000 Author: eadler Date: Mon May 6 17:21:28 2013 New Revision: 250302 URL: http://svnweb.freebsd.org/changeset/base/250302 Log: Fix a typo in an error message. Obtained From: DragonFlyBSD (commit 66e72101cc32272ae370b895ca3d9e3e99c5c3a8) Modified: head/usr.sbin/rtadvd/rrenum.c Modified: head/usr.sbin/rtadvd/rrenum.c ============================================================================== --- head/usr.sbin/rtadvd/rrenum.c Mon May 6 16:50:39 2013 (r250301) +++ head/usr.sbin/rtadvd/rrenum.c Mon May 6 17:21:28 2013 (r250302) @@ -325,7 +325,7 @@ do_rr(int len, struct icmp6_router_renum if ((size_t)len < sizeof(struct rr_pco_match)) { tooshort: syslog(LOG_ERR, "<%s> pkt too short. left len = %d. " - "gabage at end of pkt?", __func__, len); + "garbage at end of pkt?", __func__, len); return (1); } rpmlen = rpm->rpm_len << 3; From owner-svn-src-all@FreeBSD.ORG Mon May 6 17:44:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C7A2ACE; Mon, 6 May 2013 17:44:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D98183ED; Mon, 6 May 2013 17:44:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46HiDZo094126; Mon, 6 May 2013 17:44:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46HiCip094117; Mon, 6 May 2013 17:44:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305061744.r46HiCip094117@svn.freebsd.org> From: Eitan Adler Date: Mon, 6 May 2013 17:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250303 - head/sbin/iscontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 17:44:14 -0000 Author: eadler Date: Mon May 6 17:44:12 2013 New Revision: 250303 URL: http://svnweb.freebsd.org/changeset/base/250303 Log: Remove includes for old versions of FreeBSD. Reviewed by: stass Obtained From: DragonFlyBSD MFC After: 1 week Modified: head/sbin/iscontrol/auth_subr.c head/sbin/iscontrol/fsm.c head/sbin/iscontrol/login.c head/sbin/iscontrol/misc.c Modified: head/sbin/iscontrol/auth_subr.c ============================================================================== --- head/sbin/iscontrol/auth_subr.c Mon May 6 17:21:28 2013 (r250302) +++ head/sbin/iscontrol/auth_subr.c Mon May 6 17:44:12 2013 (r250303) @@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if __FreeBSD_version < 500000 -#include -#endif #include #include #include Modified: head/sbin/iscontrol/fsm.c ============================================================================== --- head/sbin/iscontrol/fsm.c Mon May 6 17:21:28 2013 (r250302) +++ head/sbin/iscontrol/fsm.c Mon May 6 17:44:12 2013 (r250303) @@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if __FreeBSD_version < 500000 -#include -#endif #include #include #include Modified: head/sbin/iscontrol/login.c ============================================================================== --- head/sbin/iscontrol/login.c Mon May 6 17:21:28 2013 (r250302) +++ head/sbin/iscontrol/login.c Mon May 6 17:44:12 2013 (r250303) @@ -39,9 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if __FreeBSD_version < 500000 -#include -#endif #include #include #include Modified: head/sbin/iscontrol/misc.c ============================================================================== --- head/sbin/iscontrol/misc.c Mon May 6 17:21:28 2013 (r250302) +++ head/sbin/iscontrol/misc.c Mon May 6 17:44:12 2013 (r250303) @@ -40,9 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if __FreeBSD_version < 500000 -#include -#endif #include #include #include From owner-svn-src-all@FreeBSD.ORG Mon May 6 17:49:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8C115E4F; Mon, 6 May 2013 17:49:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 65C1C641; Mon, 6 May 2013 17:49:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7ED53B911; Mon, 6 May 2013 13:49:38 -0400 (EDT) From: John Baldwin To: Dimitry Andric Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern Date: Mon, 6 May 2013 09:59:52 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305041849.r44In5HK095619@svn.freebsd.org> <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> In-Reply-To: <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305060959.52379.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 May 2013 13:49:38 -0400 (EDT) Cc: mdf@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-8@freebsd.org, svn-src-stable@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 17:49:39 -0000 On Saturday, May 04, 2013 3:06:12 pm Dimitry Andric wrote: > On May 4, 2013, at 20:51, mdf@FreeBSD.org wrote: > > On Sat, May 4, 2013 at 11:49 AM, Matthew D Fleming wrote: > > Author: mdf > > Date: Sat May 4 18:49:04 2013 > > New Revision: 250249 > > URL: http://svnweb.freebsd.org/changeset/base/250249 > ...lots of changed properties... > > stable/8/sys/xen/ (props changed) > > > > This seems like an excessive amount of mergeinfo properties. Is stable/8 just borked that way (compared to 9) or did my svn client mess up somehow (which wouldn't make much sense since it worked for stable/9 okay)? > > > > I'm using svn 1.6.13 on this laptop. > > It will probably help if you upgrade to svn 1.7, which has marginally better merge logic. For some reason, 1.6 tends to add lots of property changes to each subdirectory, when merging. This was mostly fixed in 1.7. Also, because of 1.7 merges adding more subdir mergeinfo, 1.6 merges now add a lot more mergeinfo. 1.6 should really be avoided at this point for merges if at all possible. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 6 17:55:24 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5CD2728E; Mon, 6 May 2013 17:55:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 395916A8; Mon, 6 May 2013 17:55:24 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A0681B94A; Mon, 6 May 2013 13:55:23 -0400 (EDT) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r250220 - head/sys/kern Date: Mon, 6 May 2013 13:55:20 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305031908.r43J8xnI094418@svn.freebsd.org> <20130504184721.E619@etaplex.bde.org> In-Reply-To: <20130504184721.E619@etaplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305061355.20826.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 May 2013 13:55:23 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 17:55:24 -0000 On Saturday, May 04, 2013 4:47:43 am Bruce Evans wrote: > > Log: > > Fix FIONREAD on regular files. The computed result was being ignored and > > it was being passed down to VOP_IOCTL() where it promptly resulted in > > ENOTTY due to a missing else for the past 8 years. While here, use a > > shared vnode lock while fetching the current file's size. > > In another thread I complained to kib about using the bad style of not > returning as soon as possible, but instead sometimes returning and sometimes > falling through a complicated if-else ladder to get to the return at the > end. What about this: static int vn_ioctl(fp, com, data, active_cred, td) struct file *fp; u_long com; void *data; struct ucred *active_cred; struct thread *td; { struct vnode *vp = fp->f_vnode; struct vattr vattr; switch (vp->v_type) { case VREG: case VDIR: switch (com) { case FIONREAD: vn_lock(vp, LK_SHARED | LK_RETRY); error = VOP_GETATTR(vp, &vattr, active_cred); VOP_UNLOCK(vp, 0); if (!error) *(int *)data = vattr.va_size - fp->f_offset; return (error); case FIONBIO: case FIOASYNC: return (0); /* XXX */ default: return (VOP_IOCTL(vp, com, data, fp->f_flag, active_cred, td)); } default: return (ENOTTY); } } (The 'XXX' comment could perhaps be expanded to something along the lines of 'Allow fcntl() to toggle FNONBLOCK and FASYNC.') -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon May 6 18:13:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8A90A9D; Mon, 6 May 2013 18:13:44 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 39F63899; Mon, 6 May 2013 18:13:43 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E7374584; Mon, 6 May 2013 20:09:47 +0200 (CEST) Date: Mon, 6 May 2013 20:16:11 +0200 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r250027 - head/sys/kern Message-ID: <20130506181610.GA1390@garage.freebsd.pl> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline In-Reply-To: <201304281912.r3SJC9bL030636@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 18:13:44 -0000 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sun Apr 28 19:12:09 2013 > New Revision: 250027 > URL: http://svnweb.freebsd.org/changeset/base/250027 >=20 > Log: > Eliminate the layering violation in the kern_sendfile(). When quering > the file size, use VOP_GETATTR() instead of accessing vnode vm_object > un_pager.vnp.vnp_size. Doesn't it add extra I/O to query file system about file's attributes? If it does, does it matter here? > Take the shared vnode lock earlier to cover the added VOP_GETATTR() > call and, as consequence, the whole internal sendfile loop. Reduce vm > object lock scope to not protect the local calculations. > =20 > Note that this is the last misuse of the vnp_size in the tree, the > others were removed from the ELF image activator by r230246. > =20 > Reviewed by: alc > Tested by: pho, bf (previous version) > MFC after: 1 week >=20 > Modified: > head/sys/kern/uipc_syscalls.c >=20 > Modified: head/sys/kern/uipc_syscalls.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/uipc_syscalls.c Sun Apr 28 18:40:55 2013 (r250026) > +++ head/sys/kern/uipc_syscalls.c Sun Apr 28 19:12:09 2013 (r250027) > @@ -1902,8 +1902,10 @@ kern_sendfile(struct thread *td, struct=20 > struct mbuf *m =3D NULL; > struct sf_buf *sf; > struct vm_page *pg; > + struct vattr va; > off_t off, xfsize, fsbytes =3D 0, sbytes =3D 0, rem =3D 0; > int error, hdrlen =3D 0, mnw =3D 0; > + int bsize; > struct sendfile_sync *sfs =3D NULL; > =20 > /* > @@ -2102,6 +2104,16 @@ retry_space: > */ > space -=3D hdrlen; > =20 > + error =3D vn_lock(vp, LK_SHARED); > + if (error !=3D 0) > + goto done; > + error =3D VOP_GETATTR(vp, &va, td->td_ucred); > + if (error !=3D 0) { > + VOP_UNLOCK(vp, 0); > + goto done; > + } > + bsize =3D vp->v_mount->mnt_stat.f_iosize; > + > /* > * Loop and construct maximum sized mbuf chain to be bulk > * dumped into socket buffer. > @@ -2111,7 +2123,6 @@ retry_space: > vm_offset_t pgoff; > struct mbuf *m0; > =20 > - VM_OBJECT_WLOCK(obj); > /* > * Calculate the amount to transfer. > * Not to exceed a page, the EOF, > @@ -2121,12 +2132,11 @@ retry_space: > if (uap->nbytes) > rem =3D (uap->nbytes - fsbytes - loopbytes); > else > - rem =3D obj->un_pager.vnp.vnp_size - > + rem =3D va.va_size - > uap->offset - fsbytes - loopbytes; > xfsize =3D omin(PAGE_SIZE - pgoff, rem); > xfsize =3D omin(space - loopbytes, xfsize); > if (xfsize <=3D 0) { > - VM_OBJECT_WUNLOCK(obj); > done =3D 1; /* all data sent */ > break; > } > @@ -2136,7 +2146,6 @@ retry_space: > * Let the outer loop figure out how to handle it. > */ > if (space <=3D loopbytes) { > - VM_OBJECT_WUNLOCK(obj); > done =3D 0; > break; > } > @@ -2146,6 +2155,7 @@ retry_space: > * if not found or wait and loop if busy. > */ > pindex =3D OFF_TO_IDX(off); > + VM_OBJECT_WLOCK(obj); > pg =3D vm_page_grab(obj, pindex, VM_ALLOC_NOBUSY | > VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_RETRY); > =20 > @@ -2163,7 +2173,6 @@ retry_space: > else if (uap->flags & SF_NODISKIO) > error =3D EBUSY; > else { > - int bsize; > ssize_t resid; > =20 > /* > @@ -2175,13 +2184,6 @@ retry_space: > =20 > /* > * Get the page from backing store. > - */ > - error =3D vn_lock(vp, LK_SHARED); > - if (error !=3D 0) > - goto after_read; > - bsize =3D vp->v_mount->mnt_stat.f_iosize; > - > - /* > * XXXMAC: Because we don't have fp->f_cred > * here, we pass in NOCRED. This is probably > * wrong, but is consistent with our original > @@ -2191,8 +2193,6 @@ retry_space: > trunc_page(off), UIO_NOCOPY, IO_NODELOCKED | > IO_VMIO | ((MAXBSIZE / bsize) << IO_SEQSHIFT), > td->td_ucred, NOCRED, &resid, td); > - VOP_UNLOCK(vp, 0); > - after_read: > VM_OBJECT_WLOCK(obj); > vm_page_io_finish(pg); > if (!error) > @@ -2281,6 +2281,8 @@ retry_space: > } > } > =20 > + VOP_UNLOCK(vp, 0); > + > /* Add the buffer chain to the socket buffer. */ > if (m !=3D NULL) { > int mlen, err; --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --AqsLC8rIMeq19msA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGH82oACgkQForvXbEpPzSldQCdGnw/MPq5gVdX94Y31lxwqoKW iXAAoIgOhuoEX1ZaUU9AYyZIYYKX6ef0 =Yuzy -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA-- From owner-svn-src-all@FreeBSD.ORG Mon May 6 18:27:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4948DF; Mon, 6 May 2013 18:27:27 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qe0-f48.google.com (mail-qe0-f48.google.com [209.85.128.48]) by mx1.freebsd.org (Postfix) with ESMTP id 5106A95C; Mon, 6 May 2013 18:27:27 +0000 (UTC) Received: by mail-qe0-f48.google.com with SMTP id 9so2200375qea.21 for ; Mon, 06 May 2013 11:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=rE0TVLmZ3MFClp9mUMK2Ng6gP7ETFDFXOFteSQG396k=; b=AkXqNsR+q40H3CUF5uYTBz6BuxhwHEDjFsnOqnDN5japwC7ZU/JMc09ESQbfvOe1C7 ErbfOShKVhuzNTULGP0y9DvSLYxqyO+ptEzQ0YI7l2qIz+8N9rfPAX0l9f4NL9Q4dEhV CY6kw1TLB5OZ71RUs39wT8pX2bSAjKbc98g13Cy+itlg8fikg36CtwXG4AoH9S4d7VFq Okezcj8VCN1oRgAxRhQuOjtPId12aZT9FVsUejF+VzvVviThbMRKFDLxoJwx9rh8o/G/ zCl6nS+Y1uo/w8W7h3pweknfbzKYROuj9BFIn2Wrhs/Xrtezyi+w/eMRs9HYrx46qfQZ 6QKA== MIME-Version: 1.0 X-Received: by 10.49.104.7 with SMTP id ga7mr7430339qeb.27.1367864841445; Mon, 06 May 2013 11:27:21 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.127.152 with HTTP; Mon, 6 May 2013 11:27:21 -0700 (PDT) In-Reply-To: <201305060959.52379.jhb@freebsd.org> References: <201305041849.r44In5HK095619@svn.freebsd.org> <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> <201305060959.52379.jhb@freebsd.org> Date: Mon, 6 May 2013 11:27:21 -0700 X-Google-Sender-Auth: mbR_C0OWhTWX59STl697Zu9G1w8 Message-ID: Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern From: mdf@FreeBSD.org To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Dimitry Andric , svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 18:27:28 -0000 On Mon, May 6, 2013 at 6:59 AM, John Baldwin wrote: > On Saturday, May 04, 2013 3:06:12 pm Dimitry Andric wrote: > > On May 4, 2013, at 20:51, mdf@FreeBSD.org wrote: > > > On Sat, May 4, 2013 at 11:49 AM, Matthew D Fleming > wrote: > > > Author: mdf > > > Date: Sat May 4 18:49:04 2013 > > > New Revision: 250249 > > > URL: http://svnweb.freebsd.org/changeset/base/250249 > > ...lots of changed properties... > > > stable/8/sys/xen/ (props changed) > > > > > > This seems like an excessive amount of mergeinfo properties. Is > stable/8 > just borked that way (compared to 9) or did my svn client mess up somehow > (which wouldn't make much sense since it worked for stable/9 okay)? > > > > > > I'm using svn 1.6.13 on this laptop. > > > > It will probably help if you upgrade to svn 1.7, which has marginally > better > merge logic. For some reason, 1.6 tends to add lots of property changes to > each subdirectory, when merging. This was mostly fixed in 1.7. > > Also, because of 1.7 merges adding more subdir mergeinfo, 1.6 merges now > add > a lot more mergeinfo. 1.6 should really be avoided at this point for > merges > if at all possible. > Should I back this out, then, and re-do? And why did this happen on stable/8, but not stable/9 for the same MFC? Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Mon May 6 18:30:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 093ED54F; Mon, 6 May 2013 18:30:50 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EE8F7997; Mon, 6 May 2013 18:30:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46IUnem010205; Mon, 6 May 2013 18:30:49 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46IUnnE010204; Mon, 6 May 2013 18:30:49 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201305061830.r46IUnnE010204@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 6 May 2013 18:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250304 - head/usr.sbin/pmcannotate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 18:30:50 -0000 Author: hiren Date: Mon May 6 18:30:49 2013 New Revision: 250304 URL: http://svnweb.freebsd.org/changeset/base/250304 Log: objdump output changed indentation from 1 space to 2 spaces somewhere between FreeBSD9 and CURRENT. Removing this rather unnecessary check which expects the second character of assembly line to be a hex number to make pmcannotate actually annotate the code and assembly. PR: 165654 Submitted by: Vitaly Magerya Reviewed by: attilio Approved by: sbruno (mentor) MFC after: 3 weeks Modified: head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Mon May 6 17:44:12 2013 (r250303) +++ head/usr.sbin/pmcannotate/pmcannotate.c Mon May 6 18:30:49 2013 (r250304) @@ -118,8 +118,6 @@ isasminline(const char *str) void *ptr; int nbytes; - if (isxdigit(str[1]) == 0) - return (0); if (sscanf(str, " %p%n", &ptr, &nbytes) != 1) return (0); if (str[nbytes] != ':' || isspace(str[nbytes + 1]) == 0) From owner-svn-src-all@FreeBSD.ORG Mon May 6 18:45:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3C18FC; Mon, 6 May 2013 18:45:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) by mx1.freebsd.org (Postfix) with ESMTP id E8E4FA8B; Mon, 6 May 2013 18:45:48 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id b13so3759844wgh.18 for ; Mon, 06 May 2013 11:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=5hBzZdTD0xEDcA1qdYuetWcVgXK1Tp56jAu1tSKJT+A=; b=LoV966a6uxtunYAKwAQsVzGz7jSEGOaZY8tabXDBjnUHQkleTzKlEG0xXNnhiUez7f Nv6YWo/ySxhjUami+++ygnQXwXswOfYNUtLLr0Uvde+a8NC5XNvoPnmXWNg/AzHJOxCR 5W17RSnCQFXhw8jrkrImRfSPrSodhJ0IakEsBbTf/iggUI1keSIz995NNOZb6MmT4gvT NWOfnq1vxyA/yMrA/Jlpt97bJ5tMTplnRLZ8PejaBeeCp9145zncCHcjj1XcHYxzDauz OBP6crqzvRPvAB878x4zYaEwnirywzSclBUu+1EgOzd6KajT+RfJt7haikRpBf1szYuw c97g== MIME-Version: 1.0 X-Received: by 10.180.93.134 with SMTP id cu6mr10226387wib.8.1367865948165; Mon, 06 May 2013 11:45:48 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Mon, 6 May 2013 11:45:48 -0700 (PDT) In-Reply-To: <201305061427.r46ERlbV023243@svn.freebsd.org> References: <201305061427.r46ERlbV023243@svn.freebsd.org> Date: Mon, 6 May 2013 11:45:48 -0700 X-Google-Sender-Auth: 1atxt37qllJv-S3Uw_DSF4mg9xI Message-ID: Subject: Re: svn commit: r250294 - head/sys/arm/arm From: Adrian Chadd To: Grzegorz Bernacki Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 18:45:49 -0000 .. is this really the only way to do this reliably? adrian On 6 May 2013 07:27, Grzegorz Bernacki wrote: > Author: gber > Date: Mon May 6 14:27:46 2013 > New Revision: 250294 > URL: http://svnweb.freebsd.org/changeset/base/250294 > > Log: > Avoid calling pcpu_init() simultaneously. > > pcpu_init() updates queue, so cannot be called by multiple cores > at the same time > > Obtained from: Semihalf > > Modified: > head/sys/arm/arm/mp_machdep.c > > Modified: head/sys/arm/arm/mp_machdep.c > ============================================================================== > --- head/sys/arm/arm/mp_machdep.c Mon May 6 14:12:36 2013 (r250293) > +++ head/sys/arm/arm/mp_machdep.c Mon May 6 14:27:46 2013 (r250294) > @@ -173,8 +173,15 @@ init_secondary(int cpu) > > pc = &__pcpu[cpu]; > set_pcpu(pc); > - pcpu_init(pc, cpu, sizeof(struct pcpu)); > > + /* > + * pcpu_init() updates queue, so it should not be executed in parallel > + * on several cores > + */ > + while(mp_naps < (cpu - 1)) > + ; > + > + pcpu_init(pc, cpu, sizeof(struct pcpu)); > dpcpu_init(dpcpu[cpu - 1], cpu); > > /* Provide stack pointers for other processor modes. */ From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:02:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97DF3667; Mon, 6 May 2013 19:02:20 +0000 (UTC) (envelope-from dim@freebsd.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4DFB7E; Mon, 6 May 2013 19:02:20 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::cd6b:c604:1989:9c5c] (unknown [IPv6:2001:7b8:3a7:0:cd6b:c604:1989:9c5c]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 512DE5C5B; Mon, 6 May 2013 21:02:12 +0200 (CEST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern From: Dimitry Andric In-Reply-To: Date: Mon, 6 May 2013 21:02:08 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305041849.r44In5HK095619@svn.freebsd.org> <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> <201305060959.52379.jhb@freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1503) Cc: svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , svn-src-stable-8@freebsd.org, John Baldwin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:02:20 -0000 On May 6, 2013, at 20:27, mdf@FreeBSD.org wrote: > On Mon, May 6, 2013 at 6:59 AM, John Baldwin wrote: ... > Also, because of 1.7 merges adding more subdir mergeinfo, 1.6 merges = now add > a lot more mergeinfo. 1.6 should really be avoided at this point for = merges > if at all possible. >=20 > Should I back this out, then, and re-do? And why did this happen on = stable/8, but not stable/9 for the same MFC? No, the spurious mergeinfo is not harmful, just a bit ugly. It should = be removed manually, by an svn expert (with a tiny bit of OCD... ;-). I think the stable/8 tree just contains more of this spurious merge = info, simply because a lot of that tree was created when svn 1.6 was the = current version. From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:47:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BC543AA; Mon, 6 May 2013 19:47:07 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 0198CED6; Mon, 6 May 2013 19:47:07 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id CFE30C4159; Mon, 6 May 2013 19:37:20 +0000 (UTC) Date: Mon, 6 May 2013 21:37:20 +0200 From: Jeremie Le Hen To: Chris Rees Subject: Re: svn commit: r250235 - in head: etc/rc.d sbin/mount Message-ID: <20130506193720.GA4437@caravan.chchile.org> Mail-Followup-To: Chris Rees , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201305041400.r44E0GvD093597@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305041400.r44E0GvD093597@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:47:07 -0000 Hi Chris, On Sat, May 04, 2013 at 02:00:16PM +0000, Chris Rees wrote: > > Log: > Introduce and use new flag -L to mount for mounting only late filesystems. > > Previously, rc.d/mountlate mounted *all* filesystems, causing problems with > background NFS mounts being mounted twice. Does that mean that "mount -l" is now completely useless? In that case, can we start deprecating it in 10.x and remove it entirely in 11.x? Regards, -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:50:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 033C0575; Mon, 6 May 2013 19:50:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB74CF08; Mon, 6 May 2013 19:50:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46JoMYu037889; Mon, 6 May 2013 19:50:22 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46JoM6J037888; Mon, 6 May 2013 19:50:22 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305061950.r46JoM6J037888@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 May 2013 19:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250305 - releng/8.4/libexec/rtld-elf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:50:23 -0000 Author: kib Date: Mon May 6 19:50:22 2013 New Revision: 250305 URL: http://svnweb.freebsd.org/changeset/base/250305 Log: MFC r249525: Rewrite origin_subst_one() to get rid of the wrong limit on the length of the resulting string. MFC r250075: Properly terminate the result string for intermediate results. Approved by: re (jpaetzel) Modified: releng/8.4/libexec/rtld-elf/rtld.c Directory Properties: releng/8.4/libexec/rtld-elf/ (props changed) Modified: releng/8.4/libexec/rtld-elf/rtld.c ============================================================================== --- releng/8.4/libexec/rtld-elf/rtld.c Mon May 6 18:30:49 2013 (r250304) +++ releng/8.4/libexec/rtld-elf/rtld.c Mon May 6 19:50:22 2013 (r250305) @@ -135,9 +135,8 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); -static int origin_subst_one(char **, const char *, const char *, - const char *, char *); -static char *origin_subst(const char *, const char *); +static char *origin_subst_one(char *, const char *, const char *, bool); +static char *origin_subst(char *, const char *); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); static void object_add_name(Obj_Entry *, const char *); @@ -661,79 +660,81 @@ basename(const char *name) static struct utsname uts; -static int -origin_subst_one(char **res, const char *real, const char *kw, const char *subst, - char *may_free) +static char * +origin_subst_one(char *real, const char *kw, const char *subst, + bool may_free) { - const char *p, *p1; - char *res1; - int subst_len; - int kw_len; - - res1 = *res = NULL; - p = real; - subst_len = kw_len = 0; - for (;;) { - p1 = strstr(p, kw); - if (p1 != NULL) { - if (subst_len == 0) { - subst_len = strlen(subst); - kw_len = strlen(kw); - } - if (*res == NULL) { - *res = xmalloc(PATH_MAX); - res1 = *res; - } - if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) { - _rtld_error("Substitution of %s in %s cannot be performed", - kw, real); - if (may_free != NULL) - free(may_free); - free(res); - return (false); - } - memcpy(res1, p, p1 - p); - res1 += p1 - p; - memcpy(res1, subst, subst_len); - res1 += subst_len; - p = p1 + kw_len; - } else { - if (*res == NULL) { - if (may_free != NULL) - *res = may_free; - else - *res = xstrdup(real); - return (true); - } - *res1 = '\0'; - if (may_free != NULL) - free(may_free); - if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) { - free(res); - return (false); - } - return (true); - } - } + char *p, *p1, *res, *resp; + int subst_len, kw_len, subst_count, old_len, new_len; + + kw_len = strlen(kw); + + /* + * First, count the number of the keyword occurences, to + * preallocate the final string. + */ + for (p = real, subst_count = 0;; p = p1 + kw_len, subst_count++) { + p1 = strstr(p, kw); + if (p1 == NULL) + break; + } + + /* + * If the keyword is not found, just return. + */ + if (subst_count == 0) + return (may_free ? real : xstrdup(real)); + + /* + * There is indeed something to substitute. Calculate the + * length of the resulting string, and allocate it. + */ + subst_len = strlen(subst); + old_len = strlen(real); + new_len = old_len + (subst_len - kw_len) * subst_count; + res = xmalloc(new_len + 1); + + /* + * Now, execute the substitution loop. + */ + for (p = real, resp = res, *resp = '\0';;) { + p1 = strstr(p, kw); + if (p1 != NULL) { + /* Copy the prefix before keyword. */ + memcpy(resp, p, p1 - p); + resp += p1 - p; + /* Keyword replacement. */ + memcpy(resp, subst, subst_len); + resp += subst_len; + *resp = '\0'; + p = p1 + kw_len; + } else + break; + } + + /* Copy to the end of string and finish. */ + strcat(resp, p); + if (may_free) + free(real); + return (res); } static char * -origin_subst(const char *real, const char *origin_path) +origin_subst(char *real, const char *origin_path) { - char *res1, *res2, *res3, *res4; + char *res1, *res2, *res3, *res4; - if (uts.sysname[0] == '\0') { - if (uname(&uts) != 0) { - _rtld_error("utsname failed: %d", errno); - return (NULL); - } - } - if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) || - !origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) || - !origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) || - !origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3)) - return (NULL); - return (res4); + if (uts.sysname[0] == '\0') { + if (uname(&uts) != 0) { + _rtld_error("utsname failed: %d", errno); + return (NULL); + } + } + res1 = origin_subst_one(real, "$ORIGIN", origin_path, false); + res2 = origin_subst_one(res1, "$OSNAME", uts.sysname, true); + res3 = origin_subst_one(res2, "$OSREL", uts.release, true); + res4 = origin_subst_one(res3, "$PLATFORM", uts.machine, true); + return (res4); } static void @@ -1144,10 +1145,12 @@ find_library(const char *xname, const Ob xname); return NULL; } - if (refobj != NULL && refobj->z_origin) - return origin_subst(xname, refobj->origin_path); - else - return xstrdup(xname); + if (refobj != NULL && refobj->z_origin) { + return (origin_subst(__DECONST(char *, xname), + refobj->origin_path)); + } else { + return (xstrdup(xname)); + } } if (libmap_disable || (refobj == NULL) || From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:50:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2514680A; Mon, 6 May 2013 19:50:52 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x234.google.com (mail-ie0-x234.google.com [IPv6:2607:f8b0:4001:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id D4065F26; Mon, 6 May 2013 19:50:51 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id ar20so4503200iec.25 for ; Mon, 06 May 2013 12:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=f2ELH7AWIxqTraOZ1bCw3u1cRrjnSh3LwhSo7qtPnvA=; b=Qxhg+O/3/zn6b7xhE5HXsLmsyKNkHE9BPlnIDUdSq/DK4qz23PjqrfEbvkZnXkUbh2 9yZ2lOb42moX+Yl878P6E71WRA3d+wAQANadxSwKnCYk8/OK/s6W1sefoCIbzRm7zI27 Jzer6RoTlCpSmuKrKyiLeBKC1ZbxX49ij3Z5JdN2GlNJLYeHnLVreuV/da6SSvRDQEJt 3UT0PiaJqbNRk3TnLWX9Do47Sg1Qxf5hz/MPOIsmOZNopVps7SZZgciPMbgAwMg/HGcG Cm61x6m0FxXYC4RZiJS1q+vZw8YAHl2c1ES09Pb8+7Ez6BRkoOPNzpBLV8RbuACM+j9C 16Jw== MIME-Version: 1.0 X-Received: by 10.50.47.10 with SMTP id z10mr3230009igm.15.1367869851543; Mon, 06 May 2013 12:50:51 -0700 (PDT) Received: by 10.64.44.76 with HTTP; Mon, 6 May 2013 12:50:51 -0700 (PDT) Received: by 10.64.44.76 with HTTP; Mon, 6 May 2013 12:50:51 -0700 (PDT) In-Reply-To: <20130506193720.GA4437@caravan.chchile.org> References: <201305041400.r44E0GvD093597@svn.freebsd.org> <20130506193720.GA4437@caravan.chchile.org> Date: Mon, 6 May 2013 20:50:51 +0100 Message-ID: Subject: Re: svn commit: r250235 - in head: etc/rc.d sbin/mount From: Chris Rees To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:50:52 -0000 On 6 May 2013 20:47, "Jeremie Le Hen" wrote: > > Hi Chris, > > On Sat, May 04, 2013 at 02:00:16PM +0000, Chris Rees wrote: > > > > Log: > > Introduce and use new flag -L to mount for mounting only late filesystems. > > > > Previously, rc.d/mountlate mounted *all* filesystems, causing problems with > > background NFS mounts being mounted twice. > > Does that mean that "mount -l" is now completely useless? In that case, > can we start deprecating it in 10.x and remove it entirely in 11.x? Hm, that's probably true. I suppose there's no use for it, except that it is equivalent to; mount -a mount -aL I think it may be useful on rare occasions, perhaps in single user when you want to *really* mount *everything*. Chris From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:56:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A7912B16; Mon, 6 May 2013 19:56:33 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from caravan.chchile.org (caravan.chchile.org [178.32.125.136]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4B5FB0; Mon, 6 May 2013 19:56:33 +0000 (UTC) Received: by caravan.chchile.org (Postfix, from userid 1000) id BBB66C41B4; Mon, 6 May 2013 19:56:32 +0000 (UTC) Date: Mon, 6 May 2013 21:56:32 +0200 From: Jeremie Le Hen To: Chris Rees Subject: Re: svn commit: r250235 - in head: etc/rc.d sbin/mount Message-ID: <20130506195632.GB4437@caravan.chchile.org> Mail-Followup-To: Chris Rees , Chris Rees , svn-src-head@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org References: <201305041400.r44E0GvD093597@svn.freebsd.org> <20130506193720.GA4437@caravan.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Chris Rees , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:56:33 -0000 On Mon, May 06, 2013 at 08:50:51PM +0100, Chris Rees wrote: > > Hm, that's probably true. I suppose there's no use for it, except that it > is equivalent to; > > mount -a > mount -aL Yes, that's my point. > I think it may be useful on rare occasions, perhaps in single user when you > want to *really* mount *everything*. I prefer to avoid option clutteing ususaly. On the other hand, I don't know if it is worth to undergo the burden of the deprecation for this sole purpose. -- Jeremie Le Hen Scientists say the world is made up of Protons, Neutrons and Electrons. They forgot to mention Morons. From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:59:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 24FE2DB0; Mon, 6 May 2013 19:59:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17A52FD5; Mon, 6 May 2013 19:59:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46JxEPk041113; Mon, 6 May 2013 19:59:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46JxEUA041105; Mon, 6 May 2013 19:59:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305061959.r46JxEUA041105@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 May 2013 19:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250306 - in stable/8/sys: net sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:59:15 -0000 Author: dim Date: Mon May 6 19:59:13 2013 New Revision: 250306 URL: http://svnweb.freebsd.org/changeset/base/250306 Log: MFC r215137: Revert r103230, which depended on ld preserving the __start_xxx and __stop_xxx symbols for custom sections, even when these were not referenced (at link time). This behaviour was changed again in binutils commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. This time, put the __GLOBL macro definition in cdefs.h, so it can be reused in a few other places where it will be needed. Reviewed by: kib MFC r215138: Use the same treatment as in linker_set.h for the __start and __stop symbols of the set_vnet and set_pcpu sections, so those symbols will always be emitted in kernel modules, if they use vnet.h or pcpu.h. Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and associated macros invisible to userland, to prevent it picking up these symbols. Reviewed by: kib Modified: stable/8/sys/net/vnet.h stable/8/sys/sys/cdefs.h stable/8/sys/sys/linker_set.h stable/8/sys/sys/pcpu.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/net/vnet.h ============================================================================== --- stable/8/sys/net/vnet.h Mon May 6 19:50:22 2013 (r250305) +++ stable/8/sys/net/vnet.h Mon May 6 19:59:13 2013 (r250306) @@ -95,7 +95,9 @@ struct vnet { * Location of the kernel's 'set_vnet' linker set. */ extern uintptr_t *__start_set_vnet; +__GLOBL(__start_set_vnet); extern uintptr_t *__stop_set_vnet; +__GLOBL(__stop_set_vnet); #define VNET_START (uintptr_t)&__start_set_vnet #define VNET_STOP (uintptr_t)&__stop_set_vnet Modified: stable/8/sys/sys/cdefs.h ============================================================================== --- stable/8/sys/sys/cdefs.h Mon May 6 19:50:22 2013 (r250305) +++ stable/8/sys/sys/cdefs.h Mon May 6 19:59:13 2013 (r250306) @@ -396,6 +396,9 @@ #endif /* __STDC__ */ #endif /* __GNUC__ || __INTEL_COMPILER */ +#define __GLOBL1(sym) __asm__(".globl " #sym) +#define __GLOBL(sym) __GLOBL1(sym) + #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else Modified: stable/8/sys/sys/linker_set.h ============================================================================== --- stable/8/sys/sys/linker_set.h Mon May 6 19:50:22 2013 (r250305) +++ stable/8/sys/sys/linker_set.h Mon May 6 19:59:13 2013 (r250306) @@ -45,6 +45,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET(set, sym) \ + __GLOBL(__CONCAT(__start_set_,set)); \ + __GLOBL(__CONCAT(__stop_set_,set)); \ static void const * const __set_##set##_sym_##sym \ __section("set_" #set) __used = &sym #else /* !__GNUCLIKE___SECTION */ Modified: stable/8/sys/sys/pcpu.h ============================================================================== --- stable/8/sys/sys/pcpu.h Mon May 6 19:50:22 2013 (r250305) +++ stable/8/sys/sys/pcpu.h Mon May 6 19:59:13 2013 (r250306) @@ -42,11 +42,15 @@ #include #include +#ifdef _KERNEL + /* * Define a set for pcpu data. */ extern uintptr_t *__start_set_pcpu; +__GLOBL(__start_set_pcpu); extern uintptr_t *__stop_set_pcpu; +__GLOBL(__stop_set_pcpu); /* * Array of dynamic pcpu base offsets. Indexed by id. @@ -127,6 +131,8 @@ extern uintptr_t dpcpu_off[]; } \ } while(0) +#endif /* _KERNEL */ + /* * XXXUPS remove as soon as we have per cpu variable * linker sets and can define rm_queue in _rm_lock.h From owner-svn-src-all@FreeBSD.ORG Mon May 6 19:59:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2F1DEDE; Mon, 6 May 2013 19:59:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6760FD8; Mon, 6 May 2013 19:59:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46Jxc2K041212; Mon, 6 May 2013 19:59:38 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46Jxcwx041211; Mon, 6 May 2013 19:59:38 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201305061959.r46Jxcwx041211@svn.freebsd.org> From: Glen Barber Date: Mon, 6 May 2013 19:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r250307 - releng/8.4/sys/conf X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 19:59:38 -0000 Author: gjb (doc,ports committer) Date: Mon May 6 19:59:38 2013 New Revision: 250307 URL: http://svnweb.freebsd.org/changeset/base/250307 Log: Update releng/8.4 to -RC3 status. Approved by: re (implicit) Modified: releng/8.4/sys/conf/newvers.sh Modified: releng/8.4/sys/conf/newvers.sh ============================================================================== --- releng/8.4/sys/conf/newvers.sh Mon May 6 19:59:13 2013 (r250306) +++ releng/8.4/sys/conf/newvers.sh Mon May 6 19:59:38 2013 (r250307) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.4" -BRANCH="RC2" +BRANCH="RC3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:05:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6DF931F; Mon, 6 May 2013 20:05:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3699E; Mon, 6 May 2013 20:05:38 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r46K5UnP040761; Mon, 6 May 2013 23:05:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r46K5UnP040761 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r46K5UtK040758; Mon, 6 May 2013 23:05:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 6 May 2013 23:05:30 +0300 From: Konstantin Belousov To: Pawel Jakub Dawidek Subject: Re: svn commit: r250027 - head/sys/kern Message-ID: <20130506200530.GD3047@kib.kiev.ua> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UxbNYeHgyZbry9TP" Content-Disposition: inline In-Reply-To: <20130506181610.GA1390@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:05:38 -0000 --UxbNYeHgyZbry9TP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote: > On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Apr 28 19:12:09 2013 > > New Revision: 250027 > > URL: http://svnweb.freebsd.org/changeset/base/250027 > >=20 > > Log: > > Eliminate the layering violation in the kern_sendfile(). When quering > > the file size, use VOP_GETATTR() instead of accessing vnode vm_object > > un_pager.vnp.vnp_size. >=20 > Doesn't it add extra I/O to query file system about file's attributes? > If it does, does it matter here? It should not, typically. E.g. UFS always keeps the unpacked inode in memory for any non-reclaimed vnode. For NFS, vnode usually caches the attributes. Anyway, using VOP_GETATTR() is the only sanctioned way to get file size. Directly accessing vm_object assumes that vm_object is of OBJT_VNODE type, which is no longer true. --UxbNYeHgyZbry9TP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRiA0JAAoJEJDCuSvBvK1B10MP/i4gYi1YAdTccTbjcskPR6A2 c0jV67YroTrggYP83xOvjMmijvXcDonWayj2z/OndBcNrc4ciNdUhpL+FWChKTtO +aNB3uexoM8LP1J7j0r44+4K4bZ5hv81LMjtdVVCYMWlBNeq6YqOkkX053XZm7D/ c547hPsDBfmS/UVsHr2Tm9WNPkMfkXAD4cx0WPKDkL6N4PI87e/Yclweqk6YqVlL yt3sVrCNU0dxagWdnRTLmtS0aVytp/f3sCIhX8F34Wf0lmQQW+x3ybjXN9OY7QLk oC4XC7KFRZ5OASZxjKjtWTQbRs9AKWJJgT7qbUC2SaZN2jnGbT62bjpNw2gQlhMs UdkyLv9WgWmNr24ldlOL+tOXbhLODqjxahevLPgMWMjSjkuce12YPy3EzqOBOgK1 75B2et19uDpwoGpAtSw+IWehBOHkTHBTwSLcDhHlBkhaN+Zt6d3uI66lzUDS00eT 3HsKr9anZRtcw1j8luhcX7XLh4WscYAXQ5xRKoMgAZ7PPPGfxtJmzYzd1uUWfeIz dy+3pVRg7q12YM+X9dc+hOtD8QqMRDCyQoHv6E8i3TQqJ5p6Ke9L0f4rp57W5yxh GU6d3UORaFsAHKBEPs6anlvQaP3p2JfqNzXy/3PfVRnTnw8bNykKLSPB4qz6Rmvo UHTkkXLE4vWJLWTyqpz0 =bu9x -----END PGP SIGNATURE----- --UxbNYeHgyZbry9TP-- From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:10:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65246803; Mon, 6 May 2013 20:10:45 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 2B7E6FD; Mon, 6 May 2013 20:10:45 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::cd6b:c604:1989:9c5c] (unknown [IPv6:2001:7b8:3a7:0:cd6b:c604:1989:9c5c]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 213835C5B; Mon, 6 May 2013 22:10:42 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250306 - in stable/8/sys: net sys From: Dimitry Andric In-Reply-To: <201305061959.r46JxEUA041105@svn.freebsd.org> Date: Mon, 6 May 2013 22:10:37 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <201305061959.r46JxEUA041105@svn.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-Mailer: Apple Mail (2.1503) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:10:45 -0000 On May 6, 2013, at 21:59, Dimitry Andric wrote: > Author: dim > Date: Mon May 6 19:59:13 2013 > New Revision: 250306 > URL: http://svnweb.freebsd.org/changeset/base/250306 > > Log: > MFC r215137: > > Revert r103230, which depended on ld preserving the __start_xxx and > __stop_xxx symbols for custom sections, even when these were not > referenced (at link time). This behaviour was changed again in binutils > commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. > > This time, put the __GLOBL macro definition in cdefs.h, so it can be > reused in a few other places where it will be needed. > > Reviewed by: kib > > MFC r215138: > > Use the same treatment as in linker_set.h for the __start and __stop > symbols of the set_vnet and set_pcpu sections, so those symbols will > always be emitted in kernel modules, if they use vnet.h or pcpu.h. > > Also, for pcpu.h, make the __(start|stop)_set_pcpu declarations, and > associated macros invisible to userland, to prevent it picking up these > symbols. > > Reviewed by: kib See the following discussion for the reason to merge these changes: http://docs.freebsd.org/cgi/mid.cgi?20130416121135.GA81519 From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:27:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 303DFE23; Mon, 6 May 2013 20:27:30 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id EF45F1F1; Mon, 6 May 2013 20:27:29 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 5DD4E5FB; Mon, 6 May 2013 22:23:28 +0200 (CEST) Date: Mon, 6 May 2013 22:29:52 +0200 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r250027 - head/sys/kern Message-ID: <20130506202951.GB1390@garage.freebsd.pl> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl> <20130506200530.GD3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VrqPEDrXMn8OVzN4" Content-Disposition: inline In-Reply-To: <20130506200530.GD3047@kib.kiev.ua> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:27:30 -0000 --VrqPEDrXMn8OVzN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 06, 2013 at 11:05:30PM +0300, Konstantin Belousov wrote: > On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote: > > On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Sun Apr 28 19:12:09 2013 > > > New Revision: 250027 > > > URL: http://svnweb.freebsd.org/changeset/base/250027 > > >=20 > > > Log: > > > Eliminate the layering violation in the kern_sendfile(). When quer= ing > > > the file size, use VOP_GETATTR() instead of accessing vnode vm_obje= ct > > > un_pager.vnp.vnp_size. > >=20 > > Doesn't it add extra I/O to query file system about file's attributes? > > If it does, does it matter here? >=20 > It should not, typically. >=20 > E.g. UFS always keeps the unpacked inode in memory for any non-reclaimed > vnode. For NFS, vnode usually caches the attributes. I remember criticism on security.bsd.hardlink_check_[ug]id, because it added extra VOP_GETATTR() to the code path of link(2), which could hurt performance. sendfile(2) is different, as the file is open, so it should be fine indeed. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --VrqPEDrXMn8OVzN4 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGIEr8ACgkQForvXbEpPzS9nwCeK3lE99kxonIFc6SSqdscihzt pewAn1BiuTD3qvSJIN6feHxXwEzvDsyb =tdEP -----END PGP SIGNATURE----- --VrqPEDrXMn8OVzN4-- From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:32:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E074EC9; Mon, 6 May 2013 20:32:15 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C39E8249; Mon, 6 May 2013 20:32:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46KWFot054330; Mon, 6 May 2013 20:32:15 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46KWEkl054322; Mon, 6 May 2013 20:32:14 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305062032.r46KWEkl054322@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 6 May 2013 20:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250308 - in stable/9: lib/libsbuf share/man/man9 sys/kern sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:32:16 -0000 Author: trociny Date: Mon May 6 20:32:14 2013 New Revision: 250308 URL: http://svnweb.freebsd.org/changeset/base/250308 Log: MFC r249377, r249378, r249379: r249377: Add sbuf_start_section() and sbuf_end_section() functions, which can be used for automatic section alignment. Discussed with: kib Reviewed by: kib r249378: Add sbuf_start_section and sbuf_end_section to the libsbuf symbol map. r249379: Document sbuf_start_section() and sbuf_end_section() functions. Modified: stable/9/lib/libsbuf/Symbol.map stable/9/lib/libsbuf/Version.def stable/9/share/man/man9/sbuf.9 stable/9/sys/kern/subr_sbuf.c stable/9/sys/sys/sbuf.h Directory Properties: stable/9/lib/libsbuf/ (props changed) stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/lib/libsbuf/Symbol.map ============================================================================== --- stable/9/lib/libsbuf/Symbol.map Mon May 6 19:59:38 2013 (r250307) +++ stable/9/lib/libsbuf/Symbol.map Mon May 6 20:32:14 2013 (r250308) @@ -22,3 +22,8 @@ FBSD_1.2 { sbuf_done; sbuf_delete; }; + +FBSD_1.3 { + sbuf_start_section; + sbuf_end_section; +}; Modified: stable/9/lib/libsbuf/Version.def ============================================================================== --- stable/9/lib/libsbuf/Version.def Mon May 6 19:59:38 2013 (r250307) +++ stable/9/lib/libsbuf/Version.def Mon May 6 20:32:14 2013 (r250308) @@ -2,3 +2,6 @@ FBSD_1.2 { }; + +FBSD_1.3 { +} FBSD_1.2; Modified: stable/9/share/man/man9/sbuf.9 ============================================================================== --- stable/9/share/man/man9/sbuf.9 Mon May 6 19:59:38 2013 (r250307) +++ stable/9/share/man/man9/sbuf.9 Mon May 6 20:32:14 2013 (r250308) @@ -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, Modified: stable/9/sys/kern/subr_sbuf.c ============================================================================== --- stable/9/sys/kern/subr_sbuf.c Mon May 6 19:59:38 2013 (r250307) +++ stable/9/sys/kern/subr_sbuf.c Mon May 6 20:32:14 2013 (r250308) @@ -69,6 +69,7 @@ static MALLOC_DEFINE(M_SBUF, "sbuf", "st #define SBUF_HASROOM(s) ((s)->s_len < (s)->s_size - 1) #define SBUF_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define SBUF_CANEXTEND(s) ((s)->s_flags & SBUF_AUTOEXTEND) +#define SBUF_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: stable/9/sys/sys/sbuf.h ============================================================================== --- stable/9/sys/sys/sbuf.h Mon May 6 19:59:38 2013 (r250307) +++ stable/9/sys/sys/sbuf.h Mon May 6 20:32:14 2013 (r250308) @@ -52,7 +52,9 @@ struct sbuf { #define SBUF_DYNAMIC 0x00010000 /* s_buf must be freed */ #define SBUF_FINISHED 0x00020000 /* set by sbuf_finish() */ #define SBUF_DYNSTRUCT 0x00080000 /* sbuf must be freed */ +#define SBUF_INSECTION 0x00100000 /* set by sbuf_start_section() */ int s_flags; /* flags */ + ssize_t s_sect_len; /* current length of section */ }; __BEGIN_DECLS @@ -81,6 +83,8 @@ char *sbuf_data(struct sbuf *); ssize_t sbuf_len(struct sbuf *); int sbuf_done(const struct sbuf *); void sbuf_delete(struct sbuf *); +void sbuf_start_section(struct sbuf *, ssize_t *); +ssize_t sbuf_end_section(struct sbuf *, ssize_t, size_t, int); #ifdef _KERNEL struct uio; From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:34:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D5086286 for ; Mon, 6 May 2013 20:34:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x22d.google.com (mail-pb0-x22d.google.com [IPv6:2607:f8b0:400e:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id ABB4C272 for ; Mon, 6 May 2013 20:34:02 +0000 (UTC) Received: by mail-pb0-f45.google.com with SMTP id ro12so2181289pbb.32 for ; Mon, 06 May 2013 13:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=iDoYrkrwGk53PFUJutGCGbVigL/vYAvldj6P7b3it5Y=; b=b5/FyfiSG280yvj01cymv9uL7wk+elJSyIQxxG8HMTLVL2fLQkndn2QYMfMPLwCrLY L3jxxBXsnbmu7F9svkIqPxp9Eub4nenn1ZiW17/B7rI/c15SNogw0SIKHV6I0FNQUA54 /1kmsYhRPglxR/AArREQfwo8c5nTzQAmqspzI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=iDoYrkrwGk53PFUJutGCGbVigL/vYAvldj6P7b3it5Y=; b=hmomCdKsgvBjxoqD4fObJUVNAOBD6DfD9EDswJxmLB4C7npORgxK3fss7B+jAf+hp7 3+S3ntcjsoNh45Rfrx2R8+yAZSPxjd1TCrWfeEX0PgNyOVhPTAhF5Azgq18czYJRTnU6 bZRPQ5EoHtDtCRPGTHRQemNpPhC7/tqIFZB4dKg4izeuc4DFitG4TKdkURE4XKaJueVy yux7/25TcA0RbgZgeGPYVid9TnVuaGxS9bJ7jSgkkcZJBJVK5hBVpNY16+mXnwyyYegV tq0bLPktoE9h3twp1HSd32/Sg+FdnvTx1my6ZxAOkSbZeBaxUnk2JpjZRN9vmVA2kM+P ULUw== X-Received: by 10.68.255.130 with SMTP id aq2mr26841226pbd.164.1367872442314; Mon, 06 May 2013 13:34:02 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Mon, 6 May 2013 13:33:31 -0700 (PDT) In-Reply-To: References: <201305041849.r44In5HK095619@svn.freebsd.org> <9AFDCE3E-8967-428A-89C2-4C9F9888E040@FreeBSD.org> <201305060959.52379.jhb@freebsd.org> From: Eitan Adler Date: Mon, 6 May 2013 16:33:31 -0400 X-Google-Sender-Auth: GNkMtM2eodX3ZSWjrL7UhseGOBc Message-ID: Subject: Re: svn commit: r250249 - in stable/8/sys: . amd64/amd64 dev/sound i386/i386 kern To: Dimitry Andric Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQn8sEB6qzkZ5FA5PIXo6hRt4/FLc2D3mqufEtpBaaWJxGHRjPC5XJSB4jgg8PBh9mCHE8AK Cc: mdf@freebsd.org, "src-committers@freebsd.org" , John Baldwin , svn-src-stable@freebsd.org, "svn-src-all@freebsd.org" , svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:34:02 -0000 On 6 May 2013 15:02, Dimitry Andric wrote: > On May 6, 2013, at 20:27, mdf@FreeBSD.org wrote: >> On Mon, May 6, 2013 at 6:59 AM, John Baldwin wrote: > ... >> Also, because of 1.7 merges adding more subdir mergeinfo, 1.6 merges now add >> a lot more mergeinfo. 1.6 should really be avoided at this point for merges >> if at all possible. >> >> Should I back this out, then, and re-do? And why did this happen on stable/8, but not stable/9 for the same MFC? > > No, the spurious mergeinfo is not harmful, just a bit ugly. It should be removed manually, by an svn expert (with a tiny bit of OCD... ;-). > > I think the stable/8 tree just contains more of this spurious merge info, simply because a lot of that tree was created when svn 1.6 was the current version. It may be useful to block these commits using a pre-commit hook? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Mon May 6 20:58:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3C1F8FE; Mon, 6 May 2013 20:58:02 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5475616; Mon, 6 May 2013 20:58:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46Kw2Fp062132; Mon, 6 May 2013 20:58:02 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46Kw20t062131; Mon, 6 May 2013 20:58:02 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305062058.r46Kw20t062131@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 6 May 2013 20:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250309 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 20:58:02 -0000 Author: trociny Date: Mon May 6 20:58:02 2013 New Revision: 250309 URL: http://svnweb.freebsd.org/changeset/base/250309 Log: MFC r249486: Re-factor coredump routines. For each type of notes an output function is provided, which is used either to calculate the note size or output it to sbuf. On the first pass the notes are registered in a list and the resulting size is found, on the second pass the list is traversed outputing notes to sbuf. For the sbuf a drain routine is provided that writes data to a core file. The main goal of the change is to make coredump to write notes directly to the core file, without preliminary preparing them all in a memory buffer. Storing notes in memory is not a problem for the current, rather small, set of notes we write to the core, but it may becomes an issue when we start to store procstat notes. Reviewed by: jhb (initial version), kib Discussed with: jhb, kib Modified: stable/9/sys/kern/imgact_elf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/imgact_elf.c ============================================================================== --- stable/9/sys/kern/imgact_elf.c Mon May 6 20:32:14 2013 (r250308) +++ stable/9/sys/kern/imgact_elf.c Mon May 6 20:58:02 2013 (r250309) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,8 +105,8 @@ SYSCTL_NODE(_kern, OID_AUTO, __CONCAT(el #ifdef COMPRESS_USER_CORES static int compress_core(gzFile, char *, char *, unsigned int, struct thread * td); -#define CORE_BUF_SIZE (16 * 1024) #endif +#define CORE_BUF_SIZE (16 * 1024) int __elfN(fallback_brand) = -1; SYSCTL_INT(__CONCAT(_kern_elf, __ELF_WORD_SIZE), OID_AUTO, @@ -1040,14 +1041,35 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +typedef void (*outfunc_t)(void *, struct sbuf *, size_t *); + +struct note_info { + int type; /* Note type. */ + outfunc_t outfunc; /* Output function. */ + void *outarg; /* Argument for the output function. */ + size_t outsize; /* Output size. */ + TAILQ_ENTRY(note_info) link; /* Link to the next note info. */ +}; + +TAILQ_HEAD(note_info_list, note_info); + static void cb_put_phdr(vm_map_entry_t, void *); static void cb_size_segment(vm_map_entry_t, void *); static void each_writable_segment(struct thread *, segment_callback, void *); static int __elfN(corehdr)(struct thread *, struct vnode *, struct ucred *, - int, void *, size_t, gzFile); -static void __elfN(puthdr)(struct thread *, void *, size_t *, int); -static void __elfN(putnote)(void *, size_t *, const char *, int, - const void *, size_t); + int, void *, size_t, struct note_info_list *, size_t, gzFile); +static void __elfN(prepare_notes)(struct thread *, struct note_info_list *, + size_t *); +static void __elfN(puthdr)(struct thread *, void *, size_t, int, size_t); +static void __elfN(putnote)(struct note_info *, struct sbuf *); +static size_t register_note(struct note_info_list *, int, outfunc_t, void *); +static int sbuf_drain_core_output(void *, const char *, int); + +static void __elfN(note_fpregset)(void *, struct sbuf *, size_t *); +static void __elfN(note_prpsinfo)(void *, struct sbuf *, size_t *); +static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); +static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); +static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); #ifdef COMPRESS_USER_CORES extern int compress_user_cores; @@ -1074,14 +1096,54 @@ core_output(struct vnode *vp, void *base return (error); } +/* Coredump output parameters for sbuf drain routine. */ +struct sbuf_drain_core_params { + off_t offset; + struct ucred *active_cred; + struct ucred *file_cred; + struct thread *td; + struct vnode *vp; +#ifdef COMPRESS_USER_CORES + gzFile gzfile; +#endif +}; + +/* + * Drain into a core file. + */ +static int +sbuf_drain_core_output(void *arg, const char *data, int len) +{ + struct sbuf_drain_core_params *p; + int error; + + p = (struct sbuf_drain_core_params *)arg; +#ifdef COMPRESS_USER_CORES + if (p->gzfile != Z_NULL) + error = compress_core(p->gzfile, NULL, __DECONST(char *, data), + len, p->td); + else +#endif + error = vn_rdwr_inchunks(UIO_WRITE, p->vp, + __DECONST(void *, data), len, p->offset, UIO_SYSSPACE, + IO_UNIT | IO_DIRECT, p->active_cred, p->file_cred, NULL, + p->td); + if (error != 0) + return (-error); + p->offset += len; + return (len); +} + int __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) { struct ucred *cred = td->td_ucred; int error = 0; struct sseg_closure seginfo; + struct note_info_list notelst; + struct note_info *ninfo; void *hdr; - size_t hdrsize; + size_t hdrsize, notesz, coresize; gzFile gzfile = Z_NULL; char *core_buf = NULL; @@ -1092,6 +1154,7 @@ __elfN(coredump)(struct thread *td, stru #endif hdr = NULL; + TAILQ_INIT(¬elst); #ifdef COMPRESS_USER_CORES if (doing_compress) { @@ -1120,30 +1183,29 @@ __elfN(coredump)(struct thread *td, stru each_writable_segment(td, cb_size_segment, &seginfo); /* - * Calculate the size of the core file header area by making - * a dry run of generating it. Nothing is written, but the - * size is calculated. + * Collect info about the core file header area. */ - hdrsize = 0; - __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); + hdrsize = sizeof(Elf_Ehdr) + sizeof(Elf_Phdr) * (1 + seginfo.count); + __elfN(prepare_notes)(td, ¬elst, ¬esz); + coresize = round_page(hdrsize + notesz) + seginfo.size; #ifdef RACCT PROC_LOCK(td->td_proc); - error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size); + error = racct_add(td->td_proc, RACCT_CORE, coresize); PROC_UNLOCK(td->td_proc); if (error != 0) { error = EFAULT; goto done; } #endif - if (hdrsize + seginfo.size >= limit) { + if (coresize >= limit) { error = EFAULT; goto done; } /* * Allocate memory for building the header, fill it up, - * and write it out. + * and write it out following the notes. */ hdr = malloc(hdrsize, M_TEMP, M_WAITOK); if (hdr == NULL) { @@ -1151,7 +1213,7 @@ __elfN(coredump)(struct thread *td, stru goto done; } error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, - gzfile); + ¬elst, notesz, gzfile); /* Write the contents of all of the writable segments. */ if (error == 0) { @@ -1160,7 +1222,7 @@ __elfN(coredump)(struct thread *td, stru int i; php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1; - offset = hdrsize; + offset = round_page(hdrsize + notesz); for (i = 0; i < seginfo.count; i++) { error = core_output(vp, (caddr_t)(uintptr_t)php->p_vaddr, php->p_filesz, offset, cred, NOCRED, curthread, core_buf, gzfile); @@ -1183,8 +1245,12 @@ done: if (gzfile) gzclose(gzfile); #endif - - free(hdr, M_TEMP); + while ((ninfo = TAILQ_FIRST(¬elst)) != NULL) { + TAILQ_REMOVE(¬elst, ninfo, link); + free(ninfo, M_TEMP); + } + if (hdr != NULL) + free(hdr, M_TEMP); return (error); } @@ -1301,44 +1367,194 @@ each_writable_segment(td, func, closure) * the page boundary. */ static int -__elfN(corehdr)(td, vp, cred, numsegs, hdr, hdrsize, gzfile) - struct thread *td; - struct vnode *vp; - struct ucred *cred; - int numsegs; - size_t hdrsize; - void *hdr; - gzFile gzfile; -{ - size_t off; +__elfN(corehdr)(struct thread *td, struct vnode *vp, struct ucred *cred, + int numsegs, void *hdr, size_t hdrsize, struct note_info_list *notelst, + size_t notesz, gzFile gzfile) +{ + struct sbuf_drain_core_params params; + struct note_info *ninfo; + struct sbuf *sb; + int error; /* Fill in the header. */ bzero(hdr, hdrsize); - off = 0; - __elfN(puthdr)(td, hdr, &off, numsegs); + __elfN(puthdr)(td, hdr, hdrsize, numsegs, notesz); - if (!gzfile) { - /* Write it to the core file. */ - return (vn_rdwr_inchunks(UIO_WRITE, vp, hdr, hdrsize, (off_t)0, - UIO_SYSSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, - td)); - } else { + params.offset = 0; + params.active_cred = cred; + params.file_cred = NOCRED; + params.td = td; + params.vp = vp; #ifdef COMPRESS_USER_CORES - if (gzwrite(gzfile, hdr, hdrsize) != hdrsize) { - log(LOG_WARNING, - "Failed to compress core file header for process" - " %s.\n", curproc->p_comm); - return (EFAULT); - } - else { - return (0); - } -#else - panic("shouldn't be here"); + params.gzfile = gzfile; #endif + sb = sbuf_new(NULL, NULL, CORE_BUF_SIZE, SBUF_FIXEDLEN); + sbuf_set_drain(sb, sbuf_drain_core_output, ¶ms); + sbuf_start_section(sb, NULL); + sbuf_bcat(sb, hdr, hdrsize); + TAILQ_FOREACH(ninfo, notelst, link) + __elfN(putnote)(ninfo, sb); + /* Align up to a page boundary for the program segments. */ + sbuf_end_section(sb, -1, PAGE_SIZE, 0); + error = sbuf_finish(sb); + sbuf_delete(sb); + + return (error); +} + +static void +__elfN(prepare_notes)(struct thread *td, struct note_info_list *list, + size_t *sizep) +{ + struct proc *p; + struct thread *thr; + size_t size; + + p = td->td_proc; + size = 0; + + size += register_note(list, NT_PRPSINFO, __elfN(note_prpsinfo), p); + + /* + * To have the debugger select the right thread (LWP) as the initial + * thread, we dump the state of the thread passed to us in td first. + * This is the thread that causes the core dump and thus likely to + * be the right thread one wants to have selected in the debugger. + */ + thr = td; + while (thr != NULL) { + size += register_note(list, NT_PRSTATUS, + __elfN(note_prstatus), thr); + size += register_note(list, NT_FPREGSET, + __elfN(note_fpregset), thr); + size += register_note(list, NT_THRMISC, + __elfN(note_thrmisc), thr); + size += register_note(list, -1, + __elfN(note_threadmd), thr); + + thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : + TAILQ_NEXT(thr, td_plist); + if (thr == td) + thr = TAILQ_NEXT(thr, td_plist); } + + *sizep = size; +} + +static void +__elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs, + size_t notesz) +{ + Elf_Ehdr *ehdr; + Elf_Phdr *phdr; + struct phdr_closure phc; + + ehdr = (Elf_Ehdr *)hdr; + phdr = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)); + + ehdr->e_ident[EI_MAG0] = ELFMAG0; + ehdr->e_ident[EI_MAG1] = ELFMAG1; + ehdr->e_ident[EI_MAG2] = ELFMAG2; + ehdr->e_ident[EI_MAG3] = ELFMAG3; + ehdr->e_ident[EI_CLASS] = ELF_CLASS; + ehdr->e_ident[EI_DATA] = ELF_DATA; + ehdr->e_ident[EI_VERSION] = EV_CURRENT; + ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; + ehdr->e_ident[EI_ABIVERSION] = 0; + ehdr->e_ident[EI_PAD] = 0; + ehdr->e_type = ET_CORE; +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 + ehdr->e_machine = ELF_ARCH32; +#else + ehdr->e_machine = ELF_ARCH; +#endif + ehdr->e_version = EV_CURRENT; + ehdr->e_entry = 0; + ehdr->e_phoff = sizeof(Elf_Ehdr); + ehdr->e_flags = 0; + ehdr->e_ehsize = sizeof(Elf_Ehdr); + ehdr->e_phentsize = sizeof(Elf_Phdr); + ehdr->e_phnum = numsegs + 1; + ehdr->e_shentsize = sizeof(Elf_Shdr); + ehdr->e_shnum = 0; + ehdr->e_shstrndx = SHN_UNDEF; + + /* + * Fill in the program header entries. + */ + + /* The note segement. */ + phdr->p_type = PT_NOTE; + phdr->p_offset = hdrsize; + phdr->p_vaddr = 0; + phdr->p_paddr = 0; + phdr->p_filesz = notesz; + phdr->p_memsz = 0; + phdr->p_flags = PF_R; + phdr->p_align = sizeof(Elf32_Size); + phdr++; + + /* All the writable segments from the program. */ + phc.phdr = phdr; + phc.offset = round_page(hdrsize + notesz); + each_writable_segment(td, cb_put_phdr, &phc); +} + +static size_t +register_note(struct note_info_list *list, int type, outfunc_t out, void *arg) +{ + struct note_info *ninfo; + size_t size, notesize; + + size = 0; + out(arg, NULL, &size); + ninfo = malloc(sizeof(*ninfo), M_TEMP, M_ZERO | M_WAITOK); + ninfo->type = type; + ninfo->outfunc = out; + ninfo->outarg = arg; + ninfo->outsize = size; + TAILQ_INSERT_TAIL(list, ninfo, link); + + if (type == -1) + return (size); + + notesize = sizeof(Elf_Note) + /* note header */ + roundup2(8, sizeof(Elf32_Size)) + /* note name ("FreeBSD") */ + roundup2(size, sizeof(Elf32_Size)); /* note description */ + + return (notesize); +} + +static void +__elfN(putnote)(struct note_info *ninfo, struct sbuf *sb) +{ + Elf_Note note; + ssize_t old_len; + + if (ninfo->type == -1) { + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + return; + } + + note.n_namesz = 8; /* strlen("FreeBSD") + 1 */ + note.n_descsz = ninfo->outsize; + note.n_type = ninfo->type; + + sbuf_bcat(sb, ¬e, sizeof(note)); + sbuf_start_section(sb, &old_len); + sbuf_bcat(sb, "FreeBSD", note.n_namesz); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); + if (note.n_descsz == 0) + return; + sbuf_start_section(sb, &old_len); + ninfo->outfunc(ninfo->outarg, sb, &ninfo->outsize); + sbuf_end_section(sb, old_len, sizeof(Elf32_Size), 0); } +/* + * Miscellaneous note out functions. + */ + #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 #include @@ -1358,50 +1574,15 @@ typedef thrmisc_t elf_thrmisc_t; #endif static void -__elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) +__elfN(note_prpsinfo)(void *arg, struct sbuf *sb, size_t *sizep) { - struct { - elf_prstatus_t status; - elf_prfpregset_t fpregset; - elf_prpsinfo_t psinfo; - elf_thrmisc_t thrmisc; - } *tempdata; - elf_prstatus_t *status; - elf_prfpregset_t *fpregset; - elf_prpsinfo_t *psinfo; - elf_thrmisc_t *thrmisc; struct proc *p; - struct thread *thr; - size_t ehoff, noteoff, notesz, phoff; - - p = td->td_proc; - - ehoff = *off; - *off += sizeof(Elf_Ehdr); - - phoff = *off; - *off += (numsegs + 1) * sizeof(Elf_Phdr); - - noteoff = *off; - /* - * Don't allocate space for the notes if we're just calculating - * the size of the header. We also don't collect the data. - */ - if (dst != NULL) { - tempdata = malloc(sizeof(*tempdata), M_TEMP, M_ZERO|M_WAITOK); - status = &tempdata->status; - fpregset = &tempdata->fpregset; - psinfo = &tempdata->psinfo; - thrmisc = &tempdata->thrmisc; - } else { - tempdata = NULL; - status = NULL; - fpregset = NULL; - psinfo = NULL; - thrmisc = NULL; - } + elf_prpsinfo_t *psinfo; - if (dst != NULL) { + p = (struct proc *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*psinfo), ("invalid size")); + psinfo = malloc(sizeof(*psinfo), M_TEMP, M_ZERO | M_WAITOK); psinfo->pr_version = PRPSINFO_VERSION; psinfo->pr_psinfosz = sizeof(elf_prpsinfo_t); strlcpy(psinfo->pr_fname, p->p_comm, sizeof(psinfo->pr_fname)); @@ -1411,139 +1592,100 @@ __elfN(puthdr)(struct thread *td, void * */ strlcpy(psinfo->pr_psargs, p->p_comm, sizeof(psinfo->pr_psargs)); + + sbuf_bcat(sb, psinfo, sizeof(*psinfo)); + free(psinfo, M_TEMP); } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRPSINFO, psinfo, - sizeof *psinfo); + *sizep = sizeof(*psinfo); +} - /* - * To have the debugger select the right thread (LWP) as the initial - * thread, we dump the state of the thread passed to us in td first. - * This is the thread that causes the core dump and thus likely to - * be the right thread one wants to have selected in the debugger. - */ - thr = td; - while (thr != NULL) { - if (dst != NULL) { - status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(elf_prstatus_t); - status->pr_gregsetsz = sizeof(elf_gregset_t); - status->pr_fpregsetsz = sizeof(elf_fpregset_t); - status->pr_osreldate = osreldate; - status->pr_cursig = p->p_sig; - status->pr_pid = thr->td_tid; +static void +__elfN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prstatus_t *status; + + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*status), ("invalid size")); + status = malloc(sizeof(*status), M_TEMP, M_ZERO | M_WAITOK); + status->pr_version = PRSTATUS_VERSION; + status->pr_statussz = sizeof(elf_prstatus_t); + status->pr_gregsetsz = sizeof(elf_gregset_t); + status->pr_fpregsetsz = sizeof(elf_fpregset_t); + status->pr_osreldate = osreldate; + status->pr_cursig = td->td_proc->p_sig; + status->pr_pid = td->td_tid; #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - fill_regs32(thr, &status->pr_reg); - fill_fpregs32(thr, fpregset); + fill_regs32(td, &status->pr_reg); #else - fill_regs(thr, &status->pr_reg); - fill_fpregs(thr, fpregset); + fill_regs(td, &status->pr_reg); #endif - memset(&thrmisc->_pad, 0, sizeof (thrmisc->_pad)); - strcpy(thrmisc->pr_tname, thr->td_name); - } - __elfN(putnote)(dst, off, "FreeBSD", NT_PRSTATUS, status, - sizeof *status); - __elfN(putnote)(dst, off, "FreeBSD", NT_FPREGSET, fpregset, - sizeof *fpregset); - __elfN(putnote)(dst, off, "FreeBSD", NT_THRMISC, thrmisc, - sizeof *thrmisc); - /* - * Allow for MD specific notes, as well as any MD - * specific preparations for writing MI notes. - */ - __elfN(dump_thread)(thr, dst, off); - - thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) : - TAILQ_NEXT(thr, td_plist); - if (thr == td) - thr = TAILQ_NEXT(thr, td_plist); + sbuf_bcat(sb, status, sizeof(*status)); + free(status, M_TEMP); } + *sizep = sizeof(*status); +} - notesz = *off - noteoff; - - if (dst != NULL) - free(tempdata, M_TEMP); - - /* Align up to a page boundary for the program segments. */ - *off = round_page(*off); - - if (dst != NULL) { - Elf_Ehdr *ehdr; - Elf_Phdr *phdr; - struct phdr_closure phc; +static void +__elfN(note_fpregset)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_prfpregset_t *fpregset; - /* - * Fill in the ELF header. - */ - ehdr = (Elf_Ehdr *)((char *)dst + ehoff); - ehdr->e_ident[EI_MAG0] = ELFMAG0; - ehdr->e_ident[EI_MAG1] = ELFMAG1; - ehdr->e_ident[EI_MAG2] = ELFMAG2; - ehdr->e_ident[EI_MAG3] = ELFMAG3; - ehdr->e_ident[EI_CLASS] = ELF_CLASS; - ehdr->e_ident[EI_DATA] = ELF_DATA; - ehdr->e_ident[EI_VERSION] = EV_CURRENT; - ehdr->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; - ehdr->e_ident[EI_ABIVERSION] = 0; - ehdr->e_ident[EI_PAD] = 0; - ehdr->e_type = ET_CORE; + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(*fpregset), ("invalid size")); + fpregset = malloc(sizeof(*fpregset), M_TEMP, M_ZERO | M_WAITOK); #if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 - ehdr->e_machine = ELF_ARCH32; + fill_fpregs32(td, fpregset); #else - ehdr->e_machine = ELF_ARCH; + fill_fpregs(td, fpregset); #endif - ehdr->e_version = EV_CURRENT; - ehdr->e_entry = 0; - ehdr->e_phoff = phoff; - ehdr->e_flags = 0; - ehdr->e_ehsize = sizeof(Elf_Ehdr); - ehdr->e_phentsize = sizeof(Elf_Phdr); - ehdr->e_phnum = numsegs + 1; - ehdr->e_shentsize = sizeof(Elf_Shdr); - ehdr->e_shnum = 0; - ehdr->e_shstrndx = SHN_UNDEF; + sbuf_bcat(sb, fpregset, sizeof(*fpregset)); + free(fpregset, M_TEMP); + } + *sizep = sizeof(*fpregset); +} - /* - * Fill in the program header entries. - */ - phdr = (Elf_Phdr *)((char *)dst + phoff); +static void +__elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + elf_thrmisc_t thrmisc; - /* The note segement. */ - phdr->p_type = PT_NOTE; - phdr->p_offset = noteoff; - phdr->p_vaddr = 0; - phdr->p_paddr = 0; - phdr->p_filesz = notesz; - phdr->p_memsz = 0; - phdr->p_flags = PF_R; - phdr->p_align = sizeof(Elf32_Size); - phdr++; - - /* All the writable segments from the program. */ - phc.phdr = phdr; - phc.offset = *off; - each_writable_segment(td, cb_put_phdr, &phc); + td = (struct thread *)arg; + if (sb != NULL) { + KASSERT(*sizep == sizeof(thrmisc), ("invalid size")); + bzero(&thrmisc._pad, sizeof(thrmisc._pad)); + strcpy(thrmisc.pr_tname, td->td_name); + sbuf_bcat(sb, &thrmisc, sizeof(thrmisc)); } + *sizep = sizeof(thrmisc); } +/* + * Allow for MD specific notes, as well as any MD + * specific preparations for writing MI notes. + */ static void -__elfN(putnote)(void *dst, size_t *off, const char *name, int type, - const void *desc, size_t descsz) +__elfN(note_threadmd)(void *arg, struct sbuf *sb, size_t *sizep) { - Elf_Note note; + struct thread *td; + void *buf; + size_t size; - note.n_namesz = strlen(name) + 1; - note.n_descsz = descsz; - note.n_type = type; - if (dst != NULL) - bcopy(¬e, (char *)dst + *off, sizeof note); - *off += sizeof note; - if (dst != NULL) - bcopy(name, (char *)dst + *off, note.n_namesz); - *off += roundup2(note.n_namesz, sizeof(Elf32_Size)); - if (dst != NULL) - bcopy(desc, (char *)dst + *off, note.n_descsz); - *off += roundup2(note.n_descsz, sizeof(Elf32_Size)); + td = (struct thread *)arg; + size = *sizep; + buf = NULL; + if (size != 0 && sb != NULL) + buf = malloc(size, M_TEMP, M_ZERO | M_WAITOK); + size = 0; + __elfN(dump_thread)(td, buf, &size); + KASSERT(*sizep == size, ("invalid size")); + if (size != 0 && sb != NULL) + sbuf_bcat(sb, buf, size); + *sizep = size; } static boolean_t @@ -1638,6 +1780,8 @@ EXEC_SET(__CONCAT(elf, __ELF_WORD_SIZE), * routine gzwrite(). This copying is necessary because the content of the VM * segment may change between the compression pass and the crc-computation pass * in gzwrite(). This is because realtime threads may preempt the UNIX kernel. + * + * If inbuf is NULL it is assumed that data is already copied to 'dest_buf'. */ static int compress_core (gzFile file, char *inbuf, char *dest_buf, unsigned int len, @@ -1648,8 +1792,13 @@ compress_core (gzFile file, char *inbuf, unsigned int chunk_len; while (len) { - chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; - copyin(inbuf, dest_buf, chunk_len); + if (inbuf != NULL) { + chunk_len = (len > CORE_BUF_SIZE) ? CORE_BUF_SIZE : len; + copyin(inbuf, dest_buf, chunk_len); + inbuf += chunk_len; + } else { + chunk_len = len; + } len_compressed = gzwrite(file, dest_buf, chunk_len); EVENTHANDLER_INVOKE(app_coredump_progress, td, len_compressed); @@ -1664,7 +1813,6 @@ compress_core (gzFile file, char *inbuf, error = EFAULT; break; } - inbuf += chunk_len; len -= chunk_len; maybe_yield(); } From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:04:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5951BE0; Mon, 6 May 2013 21:04:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A84956A2; Mon, 6 May 2013 21:04:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46L4gsY065256; Mon, 6 May 2013 21:04:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46L4gS1065255; Mon, 6 May 2013 21:04:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305062104.r46L4gS1065255@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 May 2013 21:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250310 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:04:42 -0000 Author: kib Date: Mon May 6 21:04:42 2013 New Revision: 250310 URL: http://svnweb.freebsd.org/changeset/base/250310 Log: Avoid deactivating the page if it is already on a queue, only requeue the page. This both reduces the number of queues locking and avoids moving the active page to inactive list just because the page was read or written. Based on the suggestion by: alc Reviewed by: alc Tested by: pho Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Mon May 6 20:58:02 2013 (r250309) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Mon May 6 21:04:42 2013 (r250310) @@ -493,10 +493,12 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p VM_OBJECT_WLOCK(tobj); vm_page_lock(m); vm_page_unhold(m); - vm_page_deactivate(m); - /* Requeue to maintain LRU ordering. */ - if (m->queue != PQ_NONE) + if (m->queue == PQ_NONE) { + vm_page_deactivate(m); + } else { + /* Requeue to maintain LRU ordering. */ vm_page_requeue(m); + } vm_page_unlock(m); VM_OBJECT_WUNLOCK(tobj); @@ -609,10 +611,12 @@ tmpfs_mappedwrite(vm_object_t tobj, size vm_page_dirty(tpg); vm_page_lock(tpg); vm_page_unhold(tpg); - vm_page_deactivate(tpg); - /* Requeue to maintain LRU ordering. */ - if (tpg->queue != PQ_NONE) + if (tpg->queue == PQ_NONE) { + vm_page_deactivate(tpg); + } else { + /* Requeue to maintain LRU ordering. */ vm_page_requeue(tpg); + } vm_page_unlock(tpg); VM_OBJECT_WUNLOCK(tobj); From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:13:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F21D8EE0; Mon, 6 May 2013 21:13:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CAB947AF; Mon, 6 May 2013 21:13:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46LDMTL068764; Mon, 6 May 2013 21:13:22 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46LDM7A068762; Mon, 6 May 2013 21:13:22 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305062113.r46LDM7A068762@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 6 May 2013 21:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250311 - stable/8/sys/compat/x86bios X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:13:23 -0000 Author: jkim Date: Mon May 6 21:13:22 2013 New Revision: 250311 URL: http://svnweb.freebsd.org/changeset/base/250311 Log: MFC: r210877 (partial) Decrease emulated stack size from 64K to 4K bytes. Modified: stable/8/sys/compat/x86bios/x86bios.c stable/8/sys/compat/x86bios/x86bios.h Modified: stable/8/sys/compat/x86bios/x86bios.c ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.c Mon May 6 21:04:42 2013 (r250310) +++ stable/8/sys/compat/x86bios/x86bios.c Mon May 6 21:13:22 2013 (r250311) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_PAGE_SIZE 0x00001000 /* 4K */ #define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ -#define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ #define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ #define X86BIOS_IVT_BASE 0x00000000 @@ -63,11 +62,12 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_ROM_BASE 0x000a0000 #define X86BIOS_ROM_SIZE (X86BIOS_MEM_SIZE - (uint32_t)x86bios_rom_phys) +#define X86BIOS_SEG_SIZE X86BIOS_PAGE_SIZE #define X86BIOS_PAGES (X86BIOS_MEM_SIZE / X86BIOS_PAGE_SIZE) -#define X86BIOS_R_DS _pad1 #define X86BIOS_R_SS _pad2 +#define X86BIOS_R_SP _pad3.I16_reg.x_reg static struct x86emu x86bios_emu; @@ -332,8 +332,8 @@ x86bios_init_regs(struct x86regs *regs) { bzero(regs, sizeof(*regs)); - regs->X86BIOS_R_DS = 0x40; - regs->X86BIOS_R_SS = x86bios_seg_phys >> 4; + regs->X86BIOS_R_SS = X86BIOS_PHYSTOSEG(x86bios_seg_phys); + regs->X86BIOS_R_SP = X86BIOS_PAGE_SIZE - 2; } void Modified: stable/8/sys/compat/x86bios/x86bios.h ============================================================================== --- stable/8/sys/compat/x86bios/x86bios.h Mon May 6 21:04:42 2013 (r250310) +++ stable/8/sys/compat/x86bios/x86bios.h Mon May 6 21:13:22 2013 (r250311) @@ -138,8 +138,8 @@ typedef struct x86regs x86regs_t; #define R_FS register_fs #define R_GS register_gs -#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xffff) -#define X86BIOS_PHYSTOOFF(x) ((x) & 0x000f) +#define X86BIOS_PHYSTOSEG(x) (((x) >> 4) & 0xff00) +#define X86BIOS_PHYSTOOFF(x) ((x) & 0x0fff) __BEGIN_DECLS void *x86bios_alloc(uint32_t *offset, size_t size); From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:43:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F5B5A74; Mon, 6 May 2013 21:43:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 521DA93A; Mon, 6 May 2013 21:43:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46LhGjY078952; Mon, 6 May 2013 21:43:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46LhGoG078951; Mon, 6 May 2013 21:43:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305062143.r46LhGoG078951@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 May 2013 21:43:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250312 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:43:16 -0000 Author: glebius Date: Mon May 6 21:43:15 2013 New Revision: 250312 URL: http://svnweb.freebsd.org/changeset/base/250312 Log: Simplify printf(). Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon May 6 21:13:22 2013 (r250311) +++ head/sys/netpfil/pf/pf.c Mon May 6 21:43:15 2013 (r250312) @@ -1103,10 +1103,9 @@ pf_state_insert(struct pfi_kif *kif, str PF_HASHROW_UNLOCK(ih); if (V_pf_status.debug >= PF_DEBUG_MISC) { printf("pf: state insert failed: " - "id: %016llx creatorid: %08x", + "id: %016llx creatorid: %08x\n", (unsigned long long)be64toh(s->id), ntohl(s->creatorid)); - printf("\n"); } pf_detach_state(s); return (-1); From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:44:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 01BABBFD; Mon, 6 May 2013 21:44:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8B48949; Mon, 6 May 2013 21:44:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46Li6lP079176; Mon, 6 May 2013 21:44:06 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46Li6aG079175; Mon, 6 May 2013 21:44:06 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305062144.r46Li6aG079175@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 May 2013 21:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250313 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:44:07 -0000 Author: glebius Date: Mon May 6 21:44:06 2013 New Revision: 250313 URL: http://svnweb.freebsd.org/changeset/base/250313 Log: Improve KASSERT() message. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Mon May 6 21:43:15 2013 (r250312) +++ head/sys/netpfil/pf/if_pfsync.c Mon May 6 21:44:06 2013 (r250313) @@ -1643,7 +1643,7 @@ pfsync_insert_state(struct pf_state *st) } KASSERT(st->sync_state == PFSYNC_S_NONE, - ("%s: st->sync_state == PFSYNC_S_NONE", __func__)); + ("%s: st->sync_state %u", __func__, st->sync_state)); PFSYNC_LOCK(sc); if (sc->sc_len == PFSYNC_MINPKT) @@ -1966,7 +1966,7 @@ pfsync_q_ins(struct pf_state *st, int q) PFSYNC_LOCK_ASSERT(sc); KASSERT(st->sync_state == PFSYNC_S_NONE, - ("%s: st->sync_state == PFSYNC_S_NONE", __func__)); + ("%s: st->sync_state %u", __func__, st->sync_state)); KASSERT(sc->sc_len >= PFSYNC_MINPKT, ("pfsync pkt len is too low %zu", sc->sc_len)); From owner-svn-src-all@FreeBSD.ORG Mon May 6 21:57:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8E01E15A; Mon, 6 May 2013 21:57:44 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F6F6A10; Mon, 6 May 2013 21:57:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r46Lvi1n083335; Mon, 6 May 2013 21:57:44 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r46LviO0083334; Mon, 6 May 2013 21:57:44 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201305062157.r46LviO0083334@svn.freebsd.org> From: Hiren Panchasara Date: Mon, 6 May 2013 21:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250314 - head/sys/dev/bwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 21:57:44 -0000 Author: hiren Date: Mon May 6 21:57:44 2013 New Revision: 250314 URL: http://svnweb.freebsd.org/changeset/base/250314 Log: Fixing a clang warning about using uninitialized variable. PR: 176712 Suggested by: jhb Approved by: sbruno (mentor) Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon May 6 21:44:06 2013 (r250313) +++ head/sys/dev/bwn/if_bwn.c Mon May 6 21:57:44 2013 (r250314) @@ -9242,7 +9242,7 @@ back: /* * Setup RX buf descriptor */ - dr->setdesc(dr, desc, paddr, meta->mt_m->m_len - + dr->setdesc(dr, desc, meta->mt_paddr, meta->mt_m->m_len - sizeof(*hdr), 0, 0, 0); return (error); } From owner-svn-src-all@FreeBSD.ORG Mon May 6 23:13:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8D186841; Mon, 6 May 2013 23:13:53 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 61B47E86; Mon, 6 May 2013 23:13:53 +0000 (UTC) Received: from Julian-MBP3.local (50-196-156-133-static.hfc.comcastbusiness.net [50.196.156.133]) (authenticated bits=0) by vps1.elischer.org (8.14.5/8.14.5) with ESMTP id r46NDiOW048484 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 6 May 2013 16:13:46 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <51883923.8050505@freebsd.org> Date: Mon, 06 May 2013 16:13:39 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Dimitry Andric Subject: Re: svn commit: r250306 - in stable/8/sys: net sys References: <201305061959.r46JxEUA041105@svn.freebsd.org> In-Reply-To: <201305061959.r46JxEUA041105@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 23:13:53 -0000 On 5/6/13 12:59 PM, Dimitry Andric wrote: > Author: dim > Date: Mon May 6 19:59:13 2013 > New Revision: 250306 > URL: http://svnweb.freebsd.org/changeset/base/250306 > > Log: > MFC r215137: > > Revert r103230, which depended on ld preserving the __start_xxx and > __stop_xxx symbols for custom sections, even when these were not > referenced (at link time). This behaviour was changed again in binutils > commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. > > This time, put the __GLOBL macro definition in cdefs.h, so it can be > reused in a few other places where it will be needed. > Is this stuff documented anywhere? From owner-svn-src-all@FreeBSD.ORG Tue May 7 01:25:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 4DA2A191; Tue, 7 May 2013 01:25:18 +0000 (UTC) Date: Tue, 7 May 2013 01:25:18 +0000 From: Alexey Dokuchaev To: Dimitry Andric Subject: Re: svn commit: r250306 - in stable/8/sys: net sys Message-ID: <20130507012518.GA14600@FreeBSD.org> References: <201305061959.r46JxEUA041105@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 01:25:18 -0000 On Mon, May 06, 2013 at 10:10:37PM +0200, Dimitry Andric wrote: > On May 6, 2013, at 21:59, Dimitry Andric wrote: > > New Revision: 250306 > > URL: http://svnweb.freebsd.org/changeset/base/250306 > > > > Log: > > MFC r215137: > > [...] > > > > MFC r215138: > > [...] > > See the following discussion for the reason to merge these changes: > http://docs.freebsd.org/cgi/mid.cgi?20130416121135.GA81519 Thank you! ./danfe From owner-svn-src-all@FreeBSD.ORG Tue May 7 02:03:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B60067B0; Tue, 7 May 2013 02:03:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A7B296EB; Tue, 7 May 2013 02:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47230F9071387; Tue, 7 May 2013 02:03:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47230ro071386; Tue, 7 May 2013 02:03:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305070203.r47230ro071386@svn.freebsd.org> From: Eitan Adler Date: Tue, 7 May 2013 02:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250315 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 02:03:00 -0000 Author: eadler Date: Tue May 7 02:03:00 2013 New Revision: 250315 URL: http://svnweb.freebsd.org/changeset/base/250315 Log: Add two missing NetBSD releases Obtained from: NetBSD Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon May 6 21:57:44 2013 (r250314) +++ head/share/misc/bsd-family-tree Tue May 7 02:03:00 2013 (r250315) @@ -537,6 +537,7 @@ NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] Mac OS X 10.6 2009-06-08 [APL] +NetBSD 5.0.1 2010-02-12 [NBD] (security/critical release) DragonFly 2.4.0 2009-09-16 [DFB] OpenBSD 4.6 2009-10-18 [OBD] FreeBSD 8.0 2009-11-26 [FBD] @@ -554,6 +555,7 @@ OpenBSD 4.9 2011-05-01 [OBD] Mac OS X 10.7 2011-07-20 [APL] OpenBSD 5.0 2011-11-01 [OBD] FreeBSD 9.0 2012-01-12 [FBD] +NetBSD 5.1.2 2012-02-02 [NBD] (security/critical release) DragonFly 3.0.1 2012-02-21 [DFB] FreeBSD 8.3 2012-04-18 [FBD] OpenBSD 5.1 2012-05-01 [OBD] From owner-svn-src-all@FreeBSD.ORG Tue May 7 02:05:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2032EA1D; Tue, 7 May 2013 02:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1416B754; Tue, 7 May 2013 02:05:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47250Mv071861; Tue, 7 May 2013 02:05:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47250wU071860; Tue, 7 May 2013 02:05:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305070205.r47250wU071860@svn.freebsd.org> From: Eitan Adler Date: Tue, 7 May 2013 02:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250316 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 02:05:01 -0000 Author: eadler Date: Tue May 7 02:05:00 2013 New Revision: 250316 URL: http://svnweb.freebsd.org/changeset/base/250316 Log: I miscopied the previous date. Also add another NetBSD release. Obtained from: NetBSD Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 7 02:03:00 2013 (r250315) +++ head/share/misc/bsd-family-tree Tue May 7 02:05:00 2013 (r250316) @@ -537,10 +537,11 @@ NetBSD 5.0 2009-04-29 [NBD] OpenBSD 4.5 2009-05-01 [OBD] FreeBSD 7.2 2009-05-04 [FBD] Mac OS X 10.6 2009-06-08 [APL] -NetBSD 5.0.1 2010-02-12 [NBD] (security/critical release) +NetBSD 5.0.1 2009-08-02 [NBD] (security/critical release) DragonFly 2.4.0 2009-09-16 [DFB] OpenBSD 4.6 2009-10-18 [OBD] FreeBSD 8.0 2009-11-26 [FBD] +NetBSD 5.0.2 2010-02-12 [NBD] (security/critical release) FreeBSD 7.3 2010-03-23 [FBD] DragonFly 2.6.0 2010-03-28 [DFB] OpenBSD 4.7 2010-05-19 [OBD] From owner-svn-src-all@FreeBSD.ORG Tue May 7 03:57:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0D066824; Tue, 7 May 2013 03:57:46 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F380EB8B; Tue, 7 May 2013 03:57:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r473vjE4011314; Tue, 7 May 2013 03:57:45 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r473vjZH011311; Tue, 7 May 2013 03:57:45 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070357.r473vjZH011311@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 03:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250317 - in head/usr.sbin/bsdconfig: share startup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 03:57:46 -0000 Author: dteske Date: Tue May 7 03:57:45 2013 New Revision: 250317 URL: http://svnweb.freebsd.org/changeset/base/250317 Log: Add f_isset() utility subroutine for checking if a variable is set but in a more readable fashion. Modified: head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/startup/rcdelete Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Tue May 7 02:05:00 2013 (r250316) +++ head/usr.sbin/bsdconfig/share/common.subr Tue May 7 03:57:45 2013 (r250317) @@ -195,6 +195,16 @@ f_getvar() return $__retval } +# f_isset $var +# +# Check if variable $var is set. Returns success if variable is set, otherwise +# returns failure. +# +f_isset() +{ + eval [ \"\${${1%%[$IFS]*}+set}\" ] +} + # f_die [ $status [ $fmt [ $opts ... ]]] # # Abruptly terminate due to an error optionally displaying a message in a Modified: head/usr.sbin/bsdconfig/startup/rcdelete ============================================================================== --- head/usr.sbin/bsdconfig/startup/rcdelete Tue May 7 02:05:00 2013 (r250316) +++ head/usr.sbin/bsdconfig/startup/rcdelete Tue May 7 03:57:45 2013 (r250317) @@ -388,7 +388,7 @@ while :; do var="${mtag# }" # Toggle the state-variable and loop back to menu - if eval [ \"\${_${var}_delete+set}\" ]; then + if f_isset _${var}_delete; then unset _${var}_delete else setvar _${var}_delete 1 From owner-svn-src-all@FreeBSD.ORG Tue May 7 04:04:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 660A9A39; Tue, 7 May 2013 04:04:00 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E89AC19; Tue, 7 May 2013 04:04:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r474407A014345; Tue, 7 May 2013 04:04:00 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r474402M014339; Tue, 7 May 2013 04:04:00 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070404.r474402M014339@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 04:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250318 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 04:04:00 -0000 Author: dteske Date: Tue May 7 04:03:59 2013 New Revision: 250318 URL: http://svnweb.freebsd.org/changeset/base/250318 Log: Re-organize and add missing installVarDefaults and mediaSetDirectory. Modified: head/usr.sbin/bsdconfig/share/script.subr Modified: head/usr.sbin/bsdconfig/share/script.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/script.subr Tue May 7 03:57:45 2013 (r250317) +++ head/usr.sbin/bsdconfig/share/script.subr Tue May 7 04:03:59 2013 (r250318) @@ -151,26 +151,42 @@ f_script_load() # # Reserved words meant for scripting # -f_resword_new deviceRescan f_device_rescan + +# this file +f_resword_new loadConfig f_script_load + +# device.subr +f_resword_new deviceRescan f_device_rescan + +# variable.subr +f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables -f_resword_new loadConfig f_script_load -f_resword_new mediaClose f_media_close -f_resword_new mediaGetType f_media_get_type -f_resword_new mediaOpen f_media_open -f_resword_new mediaSetCDROM f_media_set_cdrom -f_resword_new mediaSetDOS f_media_set_dos + +# media/common.subr +f_resword_new mediaOpen f_media_open +f_resword_new mediaClose f_media_close + +# media includes +f_resword_new mediaGetType f_media_get_type # media/any.subr +f_resword_new mediaSetCDROM f_media_set_cdrom # media/cdrom.subr +f_resword_new mediaSetDOS f_media_set_dos # media/dos.subr +f_resword_new mediaSetDirectory f_media_set_directory # media/directory.subr +f_resword_new mediaSetFloppy f_media_set_floppy # media/floppy.subr +f_resword_new mediaSetNFS f_media_set_nfs # media/nfs.subr +f_resword_new mediaSetUFS f_media_set_ufs # media/ufs.subr +f_resword_new mediaSetUSB f_media_set_usb # media/usb.subr +f_resword_new optionsEditor f_media_options_menu # media/options.subr +f_resword_new tcpMenuSelect f_dialog_menu_select_tcp # media/tcp.subr + +# media/ftp.subr f_resword_new mediaSetFTP f_media_set_ftp f_resword_new mediaSetFTPActive f_media_set_ftp_active f_resword_new mediaSetFTPPassive f_media_set_ftp_passive f_resword_new mediaSetFTPUserPass f_media_set_ftp_userpass -f_resword_new mediaSetFloppy f_media_set_floppy -f_resword_new mediaSetHTTP f_media_set_http_proxy -f_resword_new mediaSetHTTPProxy f_media_set_http_proxy -f_resword_new mediaSetNFS f_media_set_nfs -f_resword_new mediaSetUFS f_media_set_ufs -f_resword_new mediaSetUSB f_media_set_usb -f_resword_new optionsEditor f_media_options_menu -f_resword_new tcpMenuSelect f_dialog_menu_select_tcp + +# media/httpproxy.subr +f_resword_new mediaSetHTTP f_media_set_http_proxy +f_resword_new mediaSetHTTPProxy f_media_set_http_proxy f_dprintf "%s: Successfully loaded." script.subr From owner-svn-src-all@FreeBSD.ORG Tue May 7 04:23:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB832EDC; Tue, 7 May 2013 04:23:50 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BD941D34; Tue, 7 May 2013 04:23:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r474Nof7021397; Tue, 7 May 2013 04:23:50 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r474NokW021395; Tue, 7 May 2013 04:23:50 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070423.r474NokW021395@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 04:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250319 - head/usr.sbin/bsdconfig/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 04:23:50 -0000 Author: dteske Date: Tue May 7 04:23:50 2013 New Revision: 250319 URL: http://svnweb.freebsd.org/changeset/base/250319 Log: Alphabetize strings by variable names. Modified: head/usr.sbin/bsdconfig/include/messages.subr Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue May 7 04:03:59 2013 (r250318) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue May 7 04:23:50 2013 (r250319) @@ -25,8 +25,8 @@ # # $FreeBSD$ -field_username="Username:" field_password="Password:" +field_username="Username:" hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" @@ -66,8 +66,8 @@ msg_could_not_unmount_the_cdrom_dvd="Cou msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s" msg_could_not_unmount_the_nfs_partition="Could not unmount the NFS partition from %s: %s" msg_could_not_unmount_the_ufs_partition="Could not unmount the UFS partition from %s: %s" -msg_couldnt_connect_to_proxy="Couldn't connect to proxy" msg_couldnt_connect_to_ftp_server="Couldn't connect to FTP server" +msg_couldnt_connect_to_proxy="Couldn't connect to proxy" msg_couldnt_open_ftp_connection="Couldn't open FTP connection to %s:\n %s." msg_created_path="Created %s" msg_croatia="Croatia" @@ -114,8 +114,8 @@ msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" msg_install_from_a_floppy_disk_set="Install from a floppy disk set" msg_install_from_a_freebsd_cd_dvd="Install from a FreeBSD CD/DVD" -msg_install_from_a_usb_drive="Install from a USB drive" msg_install_from_a_ufs_partition="Install from a UFS partition" +msg_install_from_a_usb_drive="Install from a USB drive" msg_install_from_an_ftp_server="Install from an FTP server" msg_install_from_an_ftp_server_thru_firewall="Install from an FTP server through a firewall" msg_install_from_an_ftp_server_thru_proxy="Install from an FTP server through an HTTP proxy" @@ -136,8 +136,8 @@ msg_israel="Israel" msg_italy="Italy" msg_japan="Japan" msg_korea="Korea" -msg_lithuania="Lithuania" msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." +msg_lithuania="Lithuania" msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_up_host="Looking up host %s" msg_main_menu="Main Menu" @@ -150,8 +150,8 @@ msg_must_be_root_to_execute="%s: must be msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" msg_net_device_init_failed="Net device init failed." -msg_netmask="Netmask" msg_netherlands="Netherlands" +msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" msg_nfailed_attempts="%u incorrect password attempts" @@ -181,21 +181,21 @@ msg_other="other" msg_permission_denied="%s: %s: Permission denied" msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again." msg_please_enter_password="Please enter your password for sudo(8):" -msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_please_enter_the_address_of_the_http_proxy="Please enter the address of the HTTP proxy in this format:\n hostname:port (the ':port' is optional, default is 3128)" msg_please_enter_the_full_nfs_file_specification="Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir" msg_please_enter_the_password_for_this_user="Please enter the password for this user:" msg_please_enter_the_username_you_wish_to_login_as="Please enter the username you wish to login as:" -msg_please_insert_floppy_in_drive="Please insert floppy in %s" +msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_please_insert_floppy_containing="Please insert floppy containing %s in %s" +msg_please_insert_floppy_in_drive="Please insert floppy in %s" msg_please_select_a_cd_dvd_drive="FreeBSD can be installed directly from a CD/DVD containing a valid\nFreeBSD distribution. If you are seeing this menu it is because\nmore than one CD/DVD drive was found on your system. Please select\none of the following CD/DVD drives as your installation drive." msg_please_select_a_floppy_drive="You have more than one floppy drive. Please choose which drive\nyou would like to use." msg_please_select_a_freebsd_ftp_distribution_site="Please select a FreeBSD FTP distribution site" -msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation. If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions. Otherwise, please select the DOS\npartition containing the FreeBSD distribution files." -msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." msg_please_select_a_usb_drive="You have more than one USB drive. Please choose which drive\nyou would like to use." +msg_please_select_dos_partition="FreeBSD can be installed directly from a DOS partition assuming,\nof course, that you have copied the relevant distributions into\nyour DOS partition before starting this installation. If this is\nnot the case then you should reboot DOS at this time and copy the\ndistributions you wish to install into a \"FREEBSD\" subdirectory\non one of your DOS partitions. Otherwise, please select the DOS\npartition containing the FreeBSD distribution files." msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure." msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice. Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions." +msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:" msg_please_specify_the_number_of_seconds_to_wait="Please specify the number of seconds to wait for slow media:" msg_please_specify_the_release_you_wish_to_load="Please specify the release you wish to load or\n\"any\" for a generic release install:" @@ -216,8 +216,8 @@ msg_romania="Romania" msg_russia="Russia" msg_scanning_for_dhcp_servers="Scanning for DHCP servers..." msg_scanning_for_ra_servers="Scanning for RA servers..." -msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_secure_mode_requires_root="Secure-mode requires root-access!" +msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" msg_select_a_site_thats_close="Select a site that's close!" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" msg_singapore="Singapore" From owner-svn-src-all@FreeBSD.ORG Tue May 7 04:40:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 263021E8; Tue, 7 May 2013 04:40:58 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1839ADCF; Tue, 7 May 2013 04:40:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r474ev4i027589; Tue, 7 May 2013 04:40:57 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r474evlf027588; Tue, 7 May 2013 04:40:57 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070440.r474evlf027588@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 04:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250320 - head/usr.sbin/bsdconfig/dot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 04:40:58 -0000 Author: dteske Date: Tue May 7 04:40:57 2013 New Revision: 250320 URL: http://svnweb.freebsd.org/changeset/base/250320 Log: Remove unused variables. Modified: head/usr.sbin/bsdconfig/dot/dot Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:23:50 2013 (r250319) +++ head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:40:57 2013 (r250320) @@ -260,8 +260,7 @@ if [ "$SHOW_INCLUDES" ]; then include_file_list= for file in $file_list; do include_file_list="$include_file_list $( - awk -v file="$file" -v item="${file%%/*}" \ - "$print_includes_awk" $file + awk "$print_includes_awk" $file )" done @@ -279,8 +278,7 @@ if [ "$SHOW_INCLUDES" ]; then # for file in $include_file_list; do include_file_list="$include_file_list $( - awk -v file="$file" -v item="${file%%/*}" \ - "$print_includes_awk" $BSDCFG_SHARE/$file + awk "$print_includes_awk" $BSDCFG_SHARE/$file )" done From owner-svn-src-all@FreeBSD.ORG Tue May 7 04:46:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 98374447; Tue, 7 May 2013 04:46:09 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7281AE0E; Tue, 7 May 2013 04:46:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r474k9qi028585; Tue, 7 May 2013 04:46:09 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r474k9F8028584; Tue, 7 May 2013 04:46:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070446.r474k9F8028584@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 04:46:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250321 - head/usr.sbin/bsdconfig/dot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 04:46:09 -0000 Author: dteske Date: Tue May 7 04:46:08 2013 New Revision: 250321 URL: http://svnweb.freebsd.org/changeset/base/250321 Log: Recursively calculate includes. This solves the problem of some includes missing from the graph, but it also unfortunately forces yet another bug in graphviz dot(1) to appear. When edge labels are enabled (using '\T') with this many edges, dot(1) will do bad things in init_rank() and often crash. So while we're here, let's disable edge labels for the include- relationship graph feature. Modified: head/usr.sbin/bsdconfig/dot/dot Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:40:57 2013 (r250320) +++ head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:46:08 2013 (r250321) @@ -276,20 +276,26 @@ if [ "$SHOW_INCLUDES" ]; then # # Search previously-discovered include files for further includes # - for file in $include_file_list; do - include_file_list="$include_file_list $( - awk "$print_includes_awk" $BSDCFG_SHARE/$file - )" - done + before="$include_file_list" + while :; do + for file in $include_file_list; do + include_file_list="$include_file_list $( + awk "$print_includes_awk" $BSDCFG_SHARE/$file + )" + done - # - # Sort the list of includes and remove duplicate entries [again] - # - include_file_list=$( - for include_file in $include_file_list; do - echo "$include_file" - done | sort -u - ) + # + # Sort list of includes and remove duplicate entries [again] + # + include_file_list=$( + for include_file in $include_file_list; do + echo "$include_file" + done | sort -u + ) + + [ "$include_file_list" = "$before" ] && break + before="$include_file_list" + done fi # @@ -435,7 +441,8 @@ if [ "$SHOW_INCLUDES" ]; then shape=oval color=black fillcolor=white style=filled edge_color=grey begin_nodelist "$shape" "$color" "$fillcolor" "$style" print_node edge "style = dashed" "color = $edge_color" - print_node edge "label = \"\\T\"" "fontsize = 9" + #print_node edge "label = \"\\T\"" "fontsize = 9" + # NOTE: Edge labels are buggy on large graphs file_list=$( for file in \ $BSDCONFIG \ From owner-svn-src-all@FreeBSD.ORG Tue May 7 04:47:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C825A5C9; Tue, 7 May 2013 04:47:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9E5BE19; Tue, 7 May 2013 04:47:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r474luSW028905; Tue, 7 May 2013 04:47:56 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r474lu0N028904; Tue, 7 May 2013 04:47:56 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070447.r474lu0N028904@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 04:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250322 - head/usr.sbin/bsdconfig/dot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 04:47:56 -0000 Author: dteske Date: Tue May 7 04:47:56 2013 New Revision: 250322 URL: http://svnweb.freebsd.org/changeset/base/250322 Log: Explicitly track "script.subr" which wasn't showing up in the graph because it's not used by anything within bsdconfig nor any modules (rather, the script.subr include is designed to be used externally -- nonetheless we want to track it in the modular graph outputs showing includes). Modified: head/usr.sbin/bsdconfig/dot/dot Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:46:08 2013 (r250321) +++ head/usr.sbin/bsdconfig/dot/dot Tue May 7 04:47:56 2013 (r250322) @@ -299,6 +299,12 @@ if [ "$SHOW_INCLUDES" ]; then fi # +# Add script.subr to includes if it exists +# +[ -f $BSDCFG_SHARE/script.subr ] && + include_file_list="$include_file_list script.subr" + +# # Start the directional-graph (digraph) output # printf 'strict digraph "" { // Empty name to prevent SVG Auto-Tooltip\n' From owner-svn-src-all@FreeBSD.ORG Tue May 7 05:30:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EC6213B; Tue, 7 May 2013 05:30:42 +0000 (UTC) (envelope-from joel@freebsd.org) Received: from mail.vnode.se (mail.vnode.se [212.247.52.13]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5B7F98; Tue, 7 May 2013 05:30:41 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id B7F7AE3F07A; Tue, 7 May 2013 07:24:04 +0200 (CEST) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0moAFApqI34r; Tue, 7 May 2013 07:24:02 +0200 (CEST) Received: from devbox.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 0A0C8E3F079; Tue, 7 May 2013 07:24:01 +0200 (CEST) Date: Tue, 7 May 2013 07:23:59 +0200 From: Joel Dahl To: Eitan Adler Subject: Re: svn commit: r250315 - head/share/misc Message-ID: <20130507052359.GA42445@devbox.vnode.local> References: <201305070203.r47230ro071386@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305070203.r47230ro071386@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 05:30:42 -0000 On Tue, May 07, 2013 at 02:03:00AM +0000, Eitan Adler wrote: > Author: eadler > Date: Tue May 7 02:03:00 2013 > New Revision: 250315 > URL: http://svnweb.freebsd.org/changeset/base/250315 > > Log: > Add two missing NetBSD releases You didn't add them to the family tree. -- Joel From owner-svn-src-all@FreeBSD.ORG Tue May 7 05:40:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CD1C400; Tue, 7 May 2013 05:40:23 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0B1FD4; Tue, 7 May 2013 05:40:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r475eNGD048494; Tue, 7 May 2013 05:40:23 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r475eKmC048470; Tue, 7 May 2013 05:40:20 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305070540.r475eKmC048470@svn.freebsd.org> From: Devin Teske Date: Tue, 7 May 2013 05:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250323 - in head/usr.sbin/bsdconfig: . include packages packages/include share share/media share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 05:40:23 -0000 Author: dteske Date: Tue May 7 05:40:20 2013 New Revision: 250323 URL: http://svnweb.freebsd.org/changeset/base/250323 Log: Commit first portion of package module -- this includes the ability to view categories, view packages, mark packages for installation, de-installation, or re-installation, calculate and track dependencies, as well as ability to review selections. Still to come is the actual processing of selections (performing the various actions associated with the user's selections, such as installing dependencies first, then selections, etc.). Added: head/usr.sbin/bsdconfig/packages/ head/usr.sbin/bsdconfig/packages/INDEX (contents, props changed) head/usr.sbin/bsdconfig/packages/Makefile (contents, props changed) head/usr.sbin/bsdconfig/packages/USAGE (contents, props changed) head/usr.sbin/bsdconfig/packages/include/ head/usr.sbin/bsdconfig/packages/include/Makefile (contents, props changed) head/usr.sbin/bsdconfig/packages/include/messages.subr (contents, props changed) head/usr.sbin/bsdconfig/packages/packages (contents, props changed) head/usr.sbin/bsdconfig/share/packages/ head/usr.sbin/bsdconfig/share/packages/Makefile (contents, props changed) head/usr.sbin/bsdconfig/share/packages/categories.subr (contents, props changed) head/usr.sbin/bsdconfig/share/packages/index.subr (contents, props changed) head/usr.sbin/bsdconfig/share/packages/packages.subr (contents, props changed) Modified: head/usr.sbin/bsdconfig/Makefile head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/include/options.hlp head/usr.sbin/bsdconfig/share/Makefile head/usr.sbin/bsdconfig/share/media/options.subr head/usr.sbin/bsdconfig/share/script.subr head/usr.sbin/bsdconfig/share/variable.subr Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Tue May 7 04:47:56 2013 (r250322) +++ head/usr.sbin/bsdconfig/Makefile Tue May 7 05:40:20 2013 (r250323) @@ -8,6 +8,7 @@ SUBDIR= console \ include \ mouse \ networking \ + packages \ password \ security \ share \ Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue May 7 04:47:56 2013 (r250322) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue May 7 05:40:20 2013 (r250323) @@ -30,17 +30,34 @@ field_username="Username:" hline_alnum_arrows_punc_tab_enter="Use alnum, arrows, punctuation, TAB or ENTER" hline_alnum_punc_tab_enter="Use alpha-numeric, punctuation, TAB or ENTER" hline_arrows_tab_enter="Press arrows, TAB or ENTER" +hline_arrows_tab_punc_enter="Use arrows, TAB, punctuation, ENTER" hline_choose_help_for_more_information_on_media_types="Choose Help for more information on the various media types" msg_accept_continue="Accept/Continue" +msg_accessibility_desc="Ports to help disabled users." +msg_afterstep_desc="Ports to support the AfterStep window manager." +msg_all="All" +msg_all_available_packages_in_all_categories="All available packages in all categories." +msg_all_desc="All available packages in all categories." msg_always_try_sudo_when_run_as="Always try sudo(8) when run as %s" +msg_arabic_desc="Ported software for Arab countries." +msg_archivers_desc="Utilities for archiving and unarchiving data." msg_argentina="Argentina" msg_assume_network_is_already_configured="Running multi-user, assume that the network is already configured?" +msg_assume_yes_to_all_non_critical_dialogs="Assume \"Yes\" answers to all non-critical dialogs" +msg_astro_desc="Applications related to astronomy." msg_attempt_automatic_dhcp_configuration="Attempt automatic DHCP configuration of interfaces" msg_attempt_ipv6_configuration_of_interfaces="Attempt IPv6 configuration of interfaces" +msg_attempting_to_fetch_file_from_selected_media="Attempting to fetch %s file from selected media." +msg_audio_desc="Audio utilities - most require a supported sound card." msg_australia="Australia" msg_austria="Austria" +msg_back="Back" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." +msg_benchmarks_desc="Utilities for measuring system performance." +msg_biology_desc="Software related to biology." msg_brazil="Brazil" +msg_building_package_menus="Building package menu(s)..." +msg_cad_desc="Computer Aided Design utilities." msg_canada="Canada" msg_cancel="Cancel" msg_cancel_exit="Cancel/Exit" @@ -52,6 +69,7 @@ msg_cd_dvd="CD/DVD" msg_cdrom="CDROM" msg_checking_access_to="Checking access to\n %s" msg_china="China" +msg_chinese_desc="Ported software for the Chinese market." msg_choose_a_cd_dvd_type="Choose a CD/DVD type" msg_choose_a_dos_partition="Choose a DOS partition" msg_choose_a_floppy_drive="Choose a Floppy drive" @@ -61,7 +79,9 @@ msg_choose_installation_media="Choose In msg_choose_installation_media_description="FreeBSD can be installed from a variety of different installation\nmedia, ranging from floppies to an Internet FTP server. If you're\ninstalling FreeBSD from a supported CD/DVD drive then this is generally\nthe best media to use if you have no overriding reason for using other\nmedia." msg_client_error="Client error, you could try an other server" msg_command_failed_rest_of_script_aborted="Command \`%s' failed - rest of script aborted." +msg_comms_desc="Communications utilities." msg_configuration_for_interface="Configuration for Interface" +msg_converters_desc="Format conversion utilities." msg_could_not_unmount_the_cdrom_dvd="Could not unmount the CDROM/DVD from %s: %s" msg_could_not_unmount_the_dos_partition="Could not unmount the DOS partition from %s: %s" msg_could_not_unmount_the_nfs_partition="Could not unmount the NFS partition from %s: %s" @@ -72,17 +92,27 @@ msg_couldnt_open_ftp_connection="Couldn' msg_created_path="Created %s" msg_croatia="Croatia" msg_czech_republic="Czech Republic" +msg_databases_desc="Database software." msg_debugging="Debugging" msg_denmark="Denmark" +msg_deskutils_desc="Various Desktop utilities." +msg_devel_desc="Software development utilities and libraries." msg_device_is_not_configured="The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding." msg_dhcp="DHCP" msg_dialog_mixedform_navigation_help="Use / arrows to navigate between fields, TAB to focus buttons, and Enter for OK/Cancel." msg_directory="Directory" msg_directory_not_found="%s: Directory not found." +msg_directory_where_package_temporary_files_go="The directory where package temporary files should go" +msg_dns_desc="Domain Name Service tools." +msg_docs_desc="Meta-ports for FreeBSD documentation." msg_done="Done" msg_dos="DOS" msg_editor="Editor" +msg_editors_desc="Editors." +msg_elisp_desc="Things related to Emacs Lisp." msg_emit_extra_debugging_output="Emit extra debugging output" +msg_emulators_desc="Utilities for emulating other operating systems." +msg_enlightenment_desc="Software for the Enlightenment Desktop Environment." msg_enter_a_fully_qualified_pathname_for_the_directory="Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:" msg_enter_the_device_name_of_a_ufs_formatted_partition="Enter the device-name of a UFS formatted partition" msg_error="Error" @@ -96,19 +126,32 @@ msg_exit_bsdconfig="Exit bsdconfig" msg_extra_options_to_ifconfig="Extra options to ifconfig (usually empty):" msg_failed_to_add_default_route="Failed to add a default route; please check your network configuration" msg_file_system="File System" +msg_finance_desc="Monetary, financial and related applications." msg_finland="Finland" msg_floppy="Floppy" msg_france="France" +msg_french_desc="Ported software for French countries." msg_ftp="FTP" +msg_ftp_desc="FTP client and server utilities." msg_ftp_passive="FTP Passive" msg_ftp_username="FTP username" +msg_games_desc="Various games and sundry amusements." +msg_geography_desc="Geography-related software." +msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" +msg_gnome_desc="Components of the Gnome Desktop environment." +msg_gnustep_desc="Software for GNUstep desktop environment." +msg_graphics_desc="Graphics libraries and utilities." msg_greece="Greece" +msg_hamradio_desc="Software for amateur radio." +msg_haskell_desc="Software related to the Haskell language." +msg_hebrew_desc="Ported software for Hebrew language." msg_help="Help" msg_host_name_including_domain="Host name (including domain)" msg_hostname_variable_not_set="WARNING: hostname variable not set and is a non-optional\nparameter. Please add this to your installation script\nor set the netInteractive variable (see bsdconfig man page)" msg_http="HTTP" msg_http_proxy="HTTP Proxy" +msg_hungarian_desc="Ported software for the Hungarian market." msg_hungary="Hungary" msg_iceland="Iceland" msg_install_from_a_dos_partition="Install from a DOS partition" @@ -121,39 +164,64 @@ msg_install_from_an_ftp_server_thru_fire msg_install_from_an_ftp_server_thru_proxy="Install from an FTP server through an HTTP proxy" msg_install_from_the_existing_filesystem="Install from the existing filesystem" msg_install_over_nfs="Install over NFS" +msg_installed="Installed" +msg_installed_desc="Leave package as-is, installed" msg_invalid_gateway_ipv4_address_specified="Invalid gateway IPv4 address specified" msg_invalid_hostname_value="Invalid hostname value" msg_invalid_ipv4_address="Invalid IPv4 address" msg_invalid_name_server_ip_address_specified="Invalid name server IP address specified" msg_invalid_netmask_value="Invalid netmask value" msg_invalid_nfs_path_specification="Invalid NFS path specification. Must be of the form:\nhost:/full/pathname/to/FreeBSD/distdir" +msg_io_or_format_error_on_index_file="I/O or format error on %s file.\nPlease verify media (or path to media) and try again." msg_ipv4_address="IPv4 Address" msg_ipv4_gateway="IPv4 Gateway" msg_ipv6="IPv6" +msg_ipv6_desc="IPv6-related software." msg_ipv6_ready="IPv6 ready" +msg_irc_desc="Internet Relay Chat utilities." msg_ireland="Ireland" msg_israel="Israel" msg_italy="Italy" msg_japan="Japan" +msg_japanese_desc="Ported software for the Japanese market." +msg_java_desc="Java language support." +msg_kde_desc="Software for the K Desktop Environment." +msg_kld_desc="Kernel loadable modules." msg_korea="Korea" +msg_korean_desc="Ported software for the Korean market." +msg_lang_desc="Computer languages." msg_length_of_specified_url_is_too_long="Length of specified URL is %u characters. Allowable maximum is %u." +msg_linux_desc="Linux programs that can run under binary compatibility." +msg_lisp_desc="Software related to the Lisp language." msg_lithuania="Lithuania" +msg_located_index_now_reading_package_data_from_it="Located INDEX, now reading package data from it..." msg_logging_in_to_user_at_host="Logging in to %s@%s.." msg_looking_up_host="Looking up host %s" +msg_mail_desc="Electronic mail packages and utilities." msg_main_menu="Main Menu" msg_main_site="Main Site" +msg_math_desc="Mathematical computation software." +msg_mbone_desc="Applications and utilities for the MBONE." msg_media_timeout="Media Timeout" msg_media_type="Media Type" msg_menu_text="If you've already installed FreeBSD, you may use\nthis menu to customize it somewhat to suit your\nparticular configuration. Most importantly, you\ncan use the Packages utility to load extra '3rd\nparty' software not provided in the base\ndistributions." +msg_misc_desc="Miscellaneous utilities." msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." +msg_multimedia_desc="Multimedia software." msg_must_be_root_to_execute="%s: must be root to execute" msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" +msg_net_desc="Networking utilities." msg_net_device_init_failed="Net device init failed." +msg_net_im_desc="Instant messaging software." +msg_net_mgmt_desc="Network management tools." +msg_net_p2p_desc="Peer to peer network applications." msg_netherlands="Netherlands" msg_netmask="Netmask" msg_network_configuration="Network Configuration" msg_network_interface_information_required="Network interface information required" +msg_news_desc="USENET News support software." +msg_next_page="Next page" msg_nfailed_attempts="%u incorrect password attempts" msg_nfs="NFS" msg_nfs_secure="NFS Secure" @@ -163,10 +231,12 @@ msg_nfs_tcp="NFS TCP" msg_nfs_version_3="NFS version 3" msg_no="No" msg_no_cd_dvd_devices_found="No CD/DVD devices found! Please check that your system's\nconfiguration is correct and that the CD/DVD drive is of a\nsupported type. For more information, consult the hardware\nguide in the Doc menu." +msg_no_description_provided="No description provided" msg_no_dos_primary_partitions_found="No DOS primary partitions found! This installation method is unavailable" msg_no_floppy_devices_found="No floppy devices found! Please check that your system's configuration\nis correct. For more information, consult the hardware guide in the Doc\nmenu." msg_no_gateway_has_been_set="No gateway has been set. You will be unable to access hosts\nnot on your local network" msg_no_network_devices="No network devices available!" +msg_no_packages_were_selected_for_extraction="No packages were selected for extraction." msg_no_such_file_or_directory="%s: %s: No such file or directory" msg_no_usb_devices_found="No USB devices found (try Options/Re-scan Devices)" msg_no_username="No username provided!" @@ -178,7 +248,14 @@ msg_ok="OK" msg_options="Options" msg_options_editor="Options Editor" msg_other="other" +msg_package_temp="Package Temp" +msg_page_of_npages="(Page %s of %s)" +msg_palm_desc="Software support for the Palm(tm) series." +msg_parallel_desc="Applications dealing with parallelism in computing." +msg_pear_desc="Software related to the Pear PHP framework." +msg_perl5_desc="Utilities/modules for the PERL5 language." msg_permission_denied="%s: %s: Permission denied" +msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again." msg_please_enter_password="Please enter your password for sudo(8):" msg_please_enter_the_address_of_the_http_proxy="Please enter the address of the HTTP proxy in this format:\n hostname:port (the ':port' is optional, default is 3128)" @@ -188,6 +265,7 @@ msg_please_enter_the_username_you_wish_t msg_please_enter_username_password="Please enter a username and password for sudo(8):" msg_please_insert_floppy_containing="Please insert floppy containing %s in %s" msg_please_insert_floppy_in_drive="Please insert floppy in %s" +msg_please_select_a_category_to_display="Please select a category to display." msg_please_select_a_cd_dvd_drive="FreeBSD can be installed directly from a CD/DVD containing a valid\nFreeBSD distribution. If you are seeing this menu it is because\nmore than one CD/DVD drive was found on your system. Please select\none of the following CD/DVD drives as your installation drive." msg_please_select_a_floppy_drive="You have more than one floppy drive. Please choose which drive\nyou would like to use." msg_please_select_a_freebsd_ftp_distribution_site="Please select a FreeBSD FTP distribution site" @@ -196,30 +274,53 @@ msg_please_select_dos_partition="FreeBSD msg_please_select_ethernet_device_to_configure="Please select the ethernet or PLIP device to configure." msg_please_select_the_site_closest_to_you_or_other="Please select the site closest to you or \"other\" if you'd like to\nspecify a different choice. Also note that not every site listed here\ncarries more than the base distribution kits. Only Primary sites are\nguaranteed to carry the full range of possible distributions." msg_please_select_ufs_partition="FreeBSD can be installed directly from another FreeBSD partition\nthat is UFS formatted assuming, of course, that you have copied\nthe relevant distributions into said partition before starting\ninstallation." +msg_please_specify_a_temporary_directory="Please specify a temporary directory with lots of free space:" msg_please_specify_the_name_of_the_text_editor="Please specify the name of the text editor you wish to use:" msg_please_specify_the_number_of_seconds_to_wait="Please specify the number of seconds to wait for slow media:" msg_please_specify_the_release_you_wish_to_load="Please specify the release you wish to load or\n\"any\" for a generic release install:" msg_please_specify_url_of_a_freebsd_distribution="Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options screen.\n\nA URL looks like this: ftp:///\nWhere is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as." msg_poland="Poland" +msg_polish_desc="Ported software for the Polish market." +msg_ports_mgmt_desc="Utilities for managing ports and packages." msg_portugal="Portugal" +msg_portuguese_desc="Ported software for the Portuguese market." +msg_previous_page="Previous page" msg_previous_syntax_errors="%s: Not overwriting \`%s' due to previous syntax errors" msg_primary="Primary" +msg_print_desc="Utilities for dealing with printing." msg_probing_devices_please_wait_this_can_take_a_while="Probing devices, please wait (this can take a while)..." +msg_proceed="Proceed" +msg_processing_selection="Processing selection..." +msg_python_desc="Software related to the Python language." msg_quick_start_how_to_use_this_menu_system="Quick start - How to use this menu system" +msg_reinstall="Reinstall" +msg_reinstall_desc="Mark this package for reinstall" msg_release_name="Release Name" msg_rerun_bsdconfig_initial_device_probe="Re-run bsdconfig initial device probe" msg_rescan_devices="Re-scan Devices" msg_reset="RESET!" msg_reset_all_values_to_startup_defaults="Reset all values to startup defaults" msg_reuse_old_ftp_site_selection_values="Re-use old FTP site selection values?" +msg_review="Review" +msg_review_desc="Review/perform pending actions" +msg_review_help="Install, Re-Install, or Un-install selected packages and dependencies" +msg_reviewing_selected_packages="Reviewing %u selected packages:" msg_romania="Romania" +msg_ruby_desc="Software related to the Ruby language." +msg_rubygems_desc="Ports of RubyGems packages." msg_russia="Russia" +msg_russian_desc="Ported software for the Russian market." msg_scanning_for_dhcp_servers="Scanning for DHCP servers..." msg_scanning_for_ra_servers="Scanning for RA servers..." +msg_scheme_desc="Software related to the Scheme language." +msg_science_desc="Scientific software." msg_secure_mode_requires_root="Secure-mode requires root-access!" msg_secure_mode_requires_x11="Secure-mode requires X11 (use \`-X')!" +msg_security_desc="System security software." +msg_select="Select" msg_select_a_site_thats_close="Select a site that's close!" msg_server_error_when_requesting_url="Server error when requesting %s, you could try an other server" +msg_shells_desc="Various shells (tcsh, bash, etc)." msg_singapore="Singapore" msg_slovak_republic="Slovak Republic" msg_slovenia="Slovenia" @@ -229,12 +330,17 @@ msg_sorry_invalid_url="Sorry, %s is an i msg_sorry_try_again="Sorry, try again." msg_south_africa="South Africa" msg_spain="Spain" +msg_spanish_desc="Ported software for the Spanish market." msg_specify_some_other_ftp_site="Specify some other ftp site by URL" msg_sweden="Sweden" msg_switzerland="Switzerland" +msg_sysutils_desc="Various system utilities." msg_taiwan="Taiwan" +msg_tcl_desc="TCL and packages that depend on it." +msg_textproc_desc="Text processing/search utilities." msg_the_current_installation_media_type="The current installation media type." msg_timeout_value_in_seconds_for_slow_media="Timeout value in seconds for slow media." +msg_tk_desc="Tk and packages that depend on it." msg_try_dhcp_configuration="Do you want to try DHCP configuration of the interface?" msg_try_ipv6_configuration="Do you want to try IPv6 configuration of the interface?" msg_try_sudo_only_this_once="Try sudo(8) only this once" @@ -242,10 +348,14 @@ msg_turkey="Turkey" msg_ufs="UFS" msg_uk="UK" msg_ukraine="Ukraine" +msg_ukrainian_desc="Ported software for the Ukrainian market." msg_unable_to_configure_device="Unable to configure the %s interface!\nThis installation method cannot be used." +msg_unable_to_get_file_from_selected_media="Unable to get %s file from selected media.\n\nThis may be because the packages collection is not available\non the distribution media you've chosen, most likely an FTP site\nwithout the packages collection mirrored. Please verify that\nyour media, or your path to the media, is correct and try again." msg_unable_to_get_proper_ftp_path="Unable to get proper FTP path. FTP media not initialized." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" +msg_uninstall="Uninstall" +msg_uninstall_desc="Mark this package for deletion" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" @@ -260,14 +370,30 @@ msg_user_is_using_a_slow_pc_or_ethernet_ msg_username_and_password_to_use="Username and password to use instead of anonymous" msg_using_interface="Using interface %s" msg_using_usb_device="Using USB device: %s" +msg_vietnamese_desc="Ported software for the Vietnamese market." msg_view_set_various_media_options="View/Set various media options" +msg_what_would_you_like_to_do_with="What would you like to do with %s?" msg_which_release_to_attempt_to_load="Which release to attempt to load from installation media" msg_which_text_editor_to_use="Which text editor to use during installation" +msg_windowmaker_desc="Ports to support the WindowMaker window manager." msg_would_you_like_to_bring_interface_up="Would you like to bring the %s interface up right now?" +msg_www_desc="Web utilities (browsers, HTTP servers, etc)." +msg_x11_clocks_desc="X Window System based clocks." +msg_x11_desc="X Window System based utilities." +msg_x11_drivers_desc="X Window System drivers." +msg_x11_fm_desc="X Window System based file managers." +msg_x11_fonts_desc="X Window System fonts and font utilties." +msg_x11_servers_desc="X Window System servers." +msg_x11_themes_desc="X Window System themes." +msg_x11_toolkits_desc="X Window System based development toolkits." +msg_x11_wm_desc="X Window System window managers." +msg_xfce_desc="Software related to the Xfce Desktop Environment." msg_yes="Yes" +msg_yes_to_all="Yes to All" msg_you_are_not_root_but="You are not root but %s can use sudo(8).\nWhat would you like to do?" msg_you_may_remove_the_floppy="You may remove the floppy from %s" msg_youve_already_done_the_network_configuration="You've already done the network configuration once,\nwould you like to skip over it now?" +msg_zope_desc="Software related to the Zope platform." tcplayout_extras_help="Any interface-specific options to ifconfig you would like to add" tcplayout_extras_help_for_plip="For PLIP configuration, you must enter the peer's IP address here." tcplayout_gateway_help="IPv4 address of host forwarding packets to non-local destinations" Modified: head/usr.sbin/bsdconfig/include/options.hlp ============================================================================== --- head/usr.sbin/bsdconfig/include/options.hlp Tue May 7 04:47:56 2013 (r250322) +++ head/usr.sbin/bsdconfig/include/options.hlp Tue May 7 05:40:20 2013 (r250323) @@ -40,6 +40,15 @@ Debugging: Turn on the extra debuggin to the developers in tracking such problems down! +Yes To All: Assume "Yes" answers to all non-critical dialogs + + This flag should be used with caution. It will essentially + decide NOT to ask the user about any "boundary" conditions that + might not constitute actual errors but may be warnings indicative + of other problems. It's most useful to those who are doing unattended + installs. + + DHCP: Enable DHCP configuration of interfaces This option specifies whether DHCP configuration of interfaces @@ -88,6 +97,14 @@ Media Type: Which media type is being to the media menu itself. +Package Temp: Where package temporary files should go + + Some packages, like emacs, can use a LOT of temporary space - up to + 20 or 30MB. If you are going to configure a small / directory and no + separate /var (and hence a small /var/tmp), then you may wish to set + this to point at another location (say, /usr/tmp). + + Re-scan Devices: Reprobe the system for devices. Added: head/usr.sbin/bsdconfig/packages/INDEX ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/INDEX Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,52 @@ +# Copyright (c) 2013 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +# +# Title that will be shown on the bsdconfig menu +menu_title="Packages" +# +# a short descriptive line shown at the bottom of the bsdconfig menu. +# keep it short because any line longer than the terminal width will +# be truncated. +menu_help="Install pre-packaged software for FreeBSD" +# +# two-part variable that defines an action to take when 'keyword' +# is passed on a bsdconfig command line. variable takes the form +# "keyword|command" and multiple occurrences of the variable +# (with different 'keyword's, or different 'keyword's AND 'command's) +# are allowed. If 'command' begins with a '/' then the full +# path to the program is needed. If 'command' begins with anything +# else it is a path relative to the directory this INDEX file is in. +# 'keyword' can be i18n'ed but 'command' is the name of a script. +menu_selection="packages|packages" +# +# Items below this line do NOT need i18n translation---------------------- +# +# Name of the program to be run when this menu choice is selected. +# if it begins with a '/' then the full path to the program is needed. +# if it begins with anything else it is a path relative to the directory +# this INDEX file is in. +menu_program="packages" Added: head/usr.sbin/bsdconfig/packages/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/Makefile Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +NO_OBJ= + +SUBDIR= include + +FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages +FILES= INDEX USAGE + +SCRIPTSDIR= ${FILESDIR} +SCRIPTS= packages + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/packages/USAGE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/USAGE Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,37 @@ +# Copyright (c) 2013 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +Usage: bsdconfig @PROGRAM_NAME@ [OPTIONS] + +OPTIONS: + -d Provide lots of debugging info on standard-out when running. + -D file Send debugging info to file. If file begins with a plus-sign + debug info is sent to both standard-out and file (minus the + leading plus). + -h Print this usage statement and exit. + -S Secure X11 mode (implies `-X'). As root, always prompt-for + and validate sudo(8) username/password before starting. + -X Use Xdialog(1) in place of dialog(1). Added: head/usr.sbin/bsdconfig/packages/include/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/include/Makefile Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${LIBEXECDIR}/bsdconfig/030.packages/include +FILES= messages.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/packages/include/messages.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/include/messages.subr Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,27 @@ +# Copyright (c) 2013 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +msg_package_selection="Package Selection" Added: head/usr.sbin/bsdconfig/packages/packages ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/packages/packages Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,76 @@ +#!/bin/sh +#- +# Copyright (c) 2013 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +# Prevent device.subr (included indirectly via media/*.subr below) from auto +# scanning; we'll perform this manually using f_device_get_all() during init +# but only after we've successfully completed f_mustberoot_init(). +# +DEVICE_SELF_SCAN_ALL=NO + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." "$0" +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr +f_include $BSDCFG_SHARE/packages/packages.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" APP_DIR="030.packages" +f_include_lang $BSDCFG_LIBE/$APP_DIR/include/messages.subr + +ipgm=$( f_index_menusel_keyword $BSDCFG_LIBE/$APP_DIR/INDEX "$pgm" ) +[ $? -eq $SUCCESS -a "$ipgm" ] && pgm="$ipgm" + +############################################################ MAIN + +# Incorporate rc-file if it exists +[ -f "$HOME/.bsdconfigrc" ] && f_include "$HOME/.bsdconfigrc" + +# +# Process command-line arguments +# +while getopts dD:hSX flag; do + case "$flag" in + h|\?) f_usage $BSDCFG_LIBE/$APP_DIR/USAGE "PROGRAM_NAME" "$pgm";; + esac +done +shift $(( $OPTIND - 1 )) + +# +# Initialize +# +f_dialog_title "$msg_package_selection" +f_dialog_backtitle "${ipgm:+bsdconfig }$pgm" +f_mustberoot_init +f_device_get_all + +# +# Display the package configuration menu and exit +# +f_package_config Modified: head/usr.sbin/bsdconfig/share/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/Makefile Tue May 7 04:47:56 2013 (r250322) +++ head/usr.sbin/bsdconfig/share/Makefile Tue May 7 05:40:20 2013 (r250323) @@ -2,7 +2,7 @@ NO_OBJ= -SUBDIR= media +SUBDIR= media packages FILESDIR= ${SHAREDIR}/bsdconfig FILES= common.subr device.subr dialog.subr mustberoot.subr \ Modified: head/usr.sbin/bsdconfig/share/media/options.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/options.subr Tue May 7 04:47:56 2013 (r250322) +++ head/usr.sbin/bsdconfig/share/media/options.subr Tue May 7 05:40:20 2013 (r250323) @@ -111,6 +111,15 @@ f_media_options_menu() '$msg_emit_extra_debugging_output'" fi + f_getvar $VAR_NO_CONFIRM cp + if [ "$cp" ]; then menu_list="$menu_list + ' $msg_yes_to_all' 'YES' + '$msg_assume_yes_to_all_non_critical_dialogs'" + else menu_list="$menu_list + ' $msg_yes_to_all' 'NO' + '$msg_assume_yes_to_all_non_critical_dialogs'" + fi + f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then menu_list="$menu_list ' $msg_dhcp' 'YES' @@ -179,6 +188,11 @@ f_media_options_menu() ' $msg_media_timeout' '$cp' '$msg_timeout_value_in_seconds_for_slow_media'" + f_getvar $VAR_PKG_TMPDIR cp + menu_list="$menu_list + ' $msg_package_temp' '$cp' + '$msg_directory_where_package_temporary_files_go'" + menu_list="$menu_list ' $msg_rescan_devices' '<*>' '$msg_rerun_bsdconfig_initial_device_probe' @@ -260,6 +274,12 @@ f_media_options_menu() else export $VAR_DEBUG=1 fi ;; + " $msg_yes_to_all") + if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then + unset $VAR_NO_CONFIRM + else + export $VAR_NO_CONFIRM=1 + fi ;; " $msg_dhcp") f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then @@ -290,6 +310,10 @@ f_media_options_menu() f_variable_get_value $VAR_MEDIA_TIMEOUT \ "$msg_please_specify_the_number_of_seconds_to_wait" ;; + " $msg_package_temp") + f_variable_get_value $VAR_PKG_TMPDIR \ + "$msg_please_specify_a_temporary_directory" + ;; " $msg_rescan_devices") f_device_rescan ;; " $msg_use_defaults") Added: head/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/packages/Makefile Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +NO_OBJ= + +FILESDIR= ${SHAREDIR}/bsdconfig/packages +FILES= categories.subr index.subr packages.subr + +beforeinstall: + mkdir -p ${DESTDIR}${FILESDIR} + +.include Added: head/usr.sbin/bsdconfig/share/packages/categories.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/packages/categories.subr Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,203 @@ +if [ ! "$_PACKAGES_CATEGORIES_SUBR" ]; then _PACKAGES_CATEGORIES_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." packages/categories.subr +f_include $BSDCFG_SHARE/strings.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +f_include_lang $BSDCFG_LIBE/include/messages.subr + +############################################################ GLOBALS + +CATEGORIES= + +############################################################ FUNCTIONS + +# f_category_desc_get $category [$var_to_set] +# +# Fetch the description of a given category. Returns success if a match was +# found, otherwise failure. +# +# If $var_to_set is missing or NULL, the category description is printed to +# standard out for capturing in a sub-shell (which is less-recommended because +# of performance degredation; for example, when called in a loop). +# +f_category_desc_get() +{ + local __category="$1" __var_to_set="$2" __cat __varcat + + # Return failure if $category + [ "$__category" ] || return $FAILURE + + for __cat in $CATEGORIES; do + [ "$__cat" = "$__category" ] || continue + f_str2varname $__cat __varcat + f_getvar _category_$__varcat $__var_to_set + return $? + done + return $FAILURE +} + +# f_category_desc_set $category $desc +# +# Store a description in-association with a category. $category should be +# alphanumeric and can include the underscore [_] but should not contain +# whitespace. Returns success unless $category is NULL or no arguments. Use the +# f_category_desc_get() routine with the same $category to retrieve the stored +# description. +# +f_category_desc_set() +{ + local category="$1" desc="$2" + local cat varcat found= + [ "$category" ] || return $FAILURE + for cat in $CATEGORIES; do + [ "$cat" = "$category" ] || continue + f_str2varname $cat varcat + f_quietly f_getvar _category_$varcat || continue + found=1 && break + done + if [ ! "$found" ]; then + CATEGORIES="$CATEGORIES $category" + fi + f_str2varname $category varcat + setvar "_category_$varcat" "$desc" + # Export the variable for awk(1) ENVIRON visibility + export "_category_$varcat" + return $SUCCESS +} + +############################################################ MAIN + +# +# Load descriptions for package categories +# +f_category() { f_category_desc_set "$1" "$2"; } +f_category All "$msg_all_available_packages_in_all_categories" +f_category accessibility "$msg_accessibility_desc" +f_category afterstep "$msg_afterstep_desc" +f_category arabic "$msg_arabic_desc" +f_category archivers "$msg_archivers_desc" +f_category astro "$msg_astro_desc" +f_category audio "$msg_audio_desc" +f_category benchmarks "$msg_benchmarks_desc" +f_category biology "$msg_biology_desc" +f_category cad "$msg_cad_desc" +f_category chinese "$msg_chinese_desc" +f_category comms "$msg_comms_desc" +f_category converters "$msg_converters_desc" +f_category databases "$msg_databases_desc" +f_category deskutils "$msg_deskutils_desc" +f_category devel "$msg_devel_desc" +f_category dns "$msg_dns_desc" +f_category docs "$msg_docs_desc" +f_category editors "$msg_editors_desc" +f_category elisp "$msg_elisp_desc" +f_category emulators "$msg_emulators_desc" +f_category enlightenment "$msg_enlightenment_desc" +f_category finance "$msg_finance_desc" +f_category french "$msg_french_desc" +f_category ftp "$msg_ftp_desc" +f_category games "$msg_games_desc" +f_category geography "$msg_geography_desc" +f_category german "$msg_german_desc" +f_category gnome "$msg_gnome_desc" +f_category gnustep "$msg_gnustep_desc" +f_category graphics "$msg_graphics_desc" +f_category hamradio "$msg_hamradio_desc" +f_category haskell "$msg_haskell_desc" +f_category hebrew "$msg_hebrew_desc" +f_category hungarian "$msg_hungarian_desc" +f_category ipv6 "$msg_ipv6_desc" +f_category irc "$msg_irc_desc" +f_category japanese "$msg_japanese_desc" +f_category java "$msg_java_desc" +f_category kde "$msg_kde_desc" +f_category kld "$msg_kld_desc" +f_category korean "$msg_korean_desc" +f_category lang "$msg_lang_desc" +f_category linux "$msg_linux_desc" +f_category lisp "$msg_lisp_desc" +f_category mail "$msg_mail_desc" +f_category math "$msg_math_desc" +f_category mbone "$msg_mbone_desc" +f_category misc "$msg_misc_desc" +f_category multimedia "$msg_multimedia_desc" +f_category net "$msg_net_desc" +f_category net-im "$msg_net_im_desc" +f_category net-mgmt "$msg_net_mgmt_desc" +f_category net-p2p "$msg_net_p2p_desc" +f_category news "$msg_news_desc" +f_category palm "$msg_palm_desc" +f_category parallel "$msg_parallel_desc" +f_category pear "$msg_pear_desc" +f_category perl5 "$msg_perl5_desc" +f_category plan9 "$msg_plan9_desc" +f_category polish "$msg_polish_desc" +f_category ports-mgmt "$msg_ports_mgmt_desc" +f_category portuguese "$msg_portuguese_desc" +f_category print "$msg_print_desc" +f_category python "$msg_python_desc" +f_category ruby "$msg_ruby_desc" +f_category rubygems "$msg_rubygems_desc" +f_category russian "$msg_russian_desc" +f_category scheme "$msg_scheme_desc" +f_category science "$msg_science_desc" +f_category security "$msg_security_desc" +f_category shells "$msg_shells_desc" +f_category spanish "$msg_spanish_desc" +f_category sysutils "$msg_sysutils_desc" +f_category tcl "$msg_tcl_desc" +f_category textproc "$msg_textproc_desc" +f_category tk "$msg_tk_desc" +f_category ukrainian "$msg_ukrainian_desc" +f_category vietnamese "$msg_vietnamese_desc" +f_category windowmaker "$msg_windowmaker_desc" +f_category www "$msg_www_desc" +f_category x11 "$msg_x11_desc" +f_category x11-clocks "$msg_x11_clocks_desc" +f_category x11-drivers "$msg_x11_drivers_desc" +f_category x11-fm "$msg_x11_fm_desc" +f_category x11-fonts "$msg_x11_fonts_desc" +f_category x11-servers "$msg_x11_servers_desc" +f_category x11-themes "$msg_x11_themes_desc" +f_category x11-toolkits "$msg_x11_toolkits_desc" +f_category x11-wm "$msg_x11_wm_desc" +f_category xfce "$msg_xfce_desc" +f_category zope "$msg_zope_desc" + +f_dprintf "%s: Initialized %u package category descriptions." \ + packages/categories.subr "$( set -- $CATEGORIES; echo $# )" + +f_dprintf "%s: Successfully loaded." packages/categories.subr + +fi # ! $_PACKAGES_CATEGORIES_SUBR Added: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Tue May 7 05:40:20 2013 (r250323) @@ -0,0 +1,244 @@ +if [ ! "$_PACKAGES_INDEX_SUBR" ]; then _PACKAGES_INDEX_SUBR=1 +# +# Copyright (c) 2013 Devin Teske +# All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." packages/index.subr +f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/media/common.subr +f_include $BSDCFG_SHARE/strings.subr + +BSDCFG_LIBE="/usr/libexec/bsdconfig" +f_include_lang $BSDCFG_LIBE/include/messages.subr + +############################################################ GLOBALS + +PACKAGE_INDEX= +_INDEX_INITTED= + +############################################################ FUNCTIONS + +# f_index_initialize $path [$var_to_set] +# +# Read and initialize the global index. $path is to be relative to the chosen +# media (not necessarily the filesystem; e.g. FTP) -- this is usually going to +# be `packages/INDEX'. Returns success unless media cannot be initialized for +# any reason (e.g. user cancels media selection dialog) or an error occurs. The +# index is sorted before being loaded into $var_to_set. +# +# NOTE: The index is processed with f_index_read() [below] after being loaded. +# +f_index_initialize() +{ + local __path="$1" __var_to_set="${2:-PACKAGE_INDEX}" + + [ "$_INDEX_INITTED" ] && return $SUCCESS + [ "$__path" ] || return $FAILURE + + # Got any media? + f_media_verify || return $FAILURE + + # Does it move when you kick it? + f_device_init media || return $FAILURE + + f_show_info "$msg_attempting_to_fetch_file_from_selected_media" \ + "$__path" + eval "$__var_to_set"='$( f_device_get media "$__path" | sort )' + if [ $? -ne $SUCCESS ]; then + f_show_msg "$msg_unable_to_get_file_from_selected_media" \ + "$__path" + f_device_shutdown media + return $FAILURE + fi + + f_show_info "$msg_located_index_now_reading_package_data_from_it" + if ! f_index_read "$__var_to_set"; then + f_show_msg "$msg_io_or_format_error_on_index_file" "$__path" + return $FAILURE + fi + + _INDEX_INITTED=1 + return $SUCCESS +} + +# f_index_read [$var_to_get] +# +# Process the INDEX file (contents contained in $var_to_get) and... +# +# 1. create a list ($CATEGORY_MENU_LIST) of categories with package counts +# 2. For convenience, create $_npkgs holding the total number of all packages +# 3. extract associative categories for each package into $_categories_$varpkg *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue May 7 06:22:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6004BC3; Tue, 7 May 2013 06:22:09 +0000 (UTC) (envelope-from gber@freebsd.org) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB2B182; Tue, 7 May 2013 06:22:09 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 5C39EEBDCD; Tue, 7 May 2013 08:22:08 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id igltE1diWEFK; Tue, 7 May 2013 08:22:07 +0200 (CEST) Received: from [10.0.0.93] (cardhu.semihalf.com [213.17.239.108]) by smtp.semihalf.com (Postfix) with ESMTPSA id ACC0CEBDB4; Tue, 7 May 2013 08:22:07 +0200 (CEST) Message-ID: <5188B90A.7070205@freebsd.org> Date: Tue, 07 May 2013 10:19:22 +0200 From: Grzegorz Bernacki User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.24) Gecko/20120127 Thunderbird/3.1.16 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r250294 - head/sys/arm/arm References: <201305061427.r46ERlbV023243@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 06:22:09 -0000 In my opinion this is the simplest way to do it, however if you think it should be done other way I can change it. grzesiek On 05/06/13 20:45, Adrian Chadd wrote: > .. is this really the only way to do this reliably? > > > > adrian > > On 6 May 2013 07:27, Grzegorz Bernacki wrote: >> Author: gber >> Date: Mon May 6 14:27:46 2013 >> New Revision: 250294 >> URL: http://svnweb.freebsd.org/changeset/base/250294 >> >> Log: >> Avoid calling pcpu_init() simultaneously. >> >> pcpu_init() updates queue, so cannot be called by multiple cores >> at the same time >> >> Obtained from: Semihalf >> >> Modified: >> head/sys/arm/arm/mp_machdep.c >> >> Modified: head/sys/arm/arm/mp_machdep.c >> ============================================================================== >> --- head/sys/arm/arm/mp_machdep.c Mon May 6 14:12:36 2013 (r250293) >> +++ head/sys/arm/arm/mp_machdep.c Mon May 6 14:27:46 2013 (r250294) >> @@ -173,8 +173,15 @@ init_secondary(int cpu) >> >> pc =&__pcpu[cpu]; >> set_pcpu(pc); >> - pcpu_init(pc, cpu, sizeof(struct pcpu)); >> >> + /* >> + * pcpu_init() updates queue, so it should not be executed in parallel >> + * on several cores >> + */ >> + while(mp_naps< (cpu - 1)) >> + ; >> + >> + pcpu_init(pc, cpu, sizeof(struct pcpu)); >> dpcpu_init(dpcpu[cpu - 1], cpu); >> >> /* Provide stack pointers for other processor modes. */ From owner-svn-src-all@FreeBSD.ORG Tue May 7 06:42:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9EB5B3BC; Tue, 7 May 2013 06:42:08 +0000 (UTC) (envelope-from gber@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9203F22E; Tue, 7 May 2013 06:42:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r476g7Qe069902; Tue, 7 May 2013 06:42:07 GMT (envelope-from gber@svn.freebsd.org) Received: (from gber@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r476g7dn069901; Tue, 7 May 2013 06:42:07 GMT (envelope-from gber@svn.freebsd.org) Message-Id: <201305070642.r476g7dn069901@svn.freebsd.org> From: Grzegorz Bernacki Date: Tue, 7 May 2013 06:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250324 - head/sys/arm/mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 06:42:08 -0000 Author: gber Date: Tue May 7 06:42:07 2013 New Revision: 250324 URL: http://svnweb.freebsd.org/changeset/base/250324 Log: decode_win_sdram_fixup() function should be declared, defined and used only by Armada XP Obtained from: Semihalf Modified: head/sys/arm/mv/common.c Modified: head/sys/arm/mv/common.c ============================================================================== --- head/sys/arm/mv/common.c Tue May 7 05:40:20 2013 (r250323) +++ head/sys/arm/mv/common.c Tue May 7 06:42:07 2013 (r250324) @@ -89,6 +89,8 @@ static int decode_win_xor_valid(void); #ifndef SOC_MV_FREY static void decode_win_cpu_setup(void); +#endif +#ifdef SOC_MV_ARMADAXP static int decode_win_sdram_fixup(void); #endif static void decode_win_usb_setup(u_long); @@ -879,7 +881,9 @@ decode_win_cpu_setup(void) cpu_wins[i].size, cpu_wins[i].remap); } +#endif +#ifdef SOC_MV_ARMADAXP static int decode_win_sdram_fixup(void) { From owner-svn-src-all@FreeBSD.ORG Tue May 7 07:04:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAE2F864 for ; Tue, 7 May 2013 07:04:43 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm17.bullet.mail.bf1.yahoo.com (nm17.bullet.mail.bf1.yahoo.com [98.139.212.176]) by mx1.freebsd.org (Postfix) with SMTP id 8E84C2CC for ; Tue, 7 May 2013 07:04:43 +0000 (UTC) Received: from [98.139.215.140] by nm17.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2013 07:04:35 -0000 Received: from [98.139.213.6] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 07 May 2013 07:04:35 -0000 Received: from [127.0.0.1] by smtp106.mail.bf1.yahoo.com with NNFMP; 07 May 2013 07:04:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1367910275; bh=It8LGqfZ/xzFqAIwVEbBH/t6h7s4fFpgbsmlDJ1pwDY=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=2nGaQMsj+DF/r5KYYL9h/04jGtksRi0ClACEqvXPutNr5NoCYJgvyFnubC9NHw3oIdRGrYcMgtDOYsFGAQJRDNUfbYy0LQ/7ei4d0fa9iBKWOSamx3RxHQfBZklLVKKF6LdugVbUguCMC4kowOOQIO19XGfpo5bI9ZLex/Yjwjk= X-Yahoo-Newman-Id: 854853.4454.bm@smtp106.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: x2RaBcUVM1nMIdWwgkTRl.U62XhcQkYu_apUHbYmJUJ5s1w Ytj70v.J.tHcj5dACB7ltExWkUWCgfzmCm_T0XJYH4MirJO8KgsqbG06JvPO 5UONfneXv_voALRW2qUvxEQaHDNY_8RG5TtbqEq2NBD9NIMaJLciXjc4qHg2 kTkE0J9nuFnciSIKD6UtedfixCXEC3OS4FNE5rWQbGTEmoGjqyNQkBgvuVqx kMUCpfo3gMt0yJoif4VxmEGauCcESBuSM82gCBAIuTkvX6vx4rk.SNwP2TrT 6IxQuyjuu9gkWA.6hP_AY.gadVzpaOBfe_xORzJhQaxkjhOGiA02eHc9MR5Z 7OXMQxI2CxKBNshxd3noNdgWg3978wZ_T1z4zumr4xwqeeQILIDm9RfVte2P CgV7E7Gz2AEp6nUaF1DQcFGKEBNo24fjhdzfbOKBz8PY0Sj0gQeiWnifuc9j JJQkfEF8Qeq5WC6gsjit7hG7zJ2xhSxBSVZVLCBxyMP.p91SDfm.YKuwLvXH eVJf2u.y52l8v6URvam6Q7UZ9mYVW_NgaiZPI8johuB3Nytc- X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from phobos.samsco.home (scott4long@168.103.85.57 with ) by smtp106.mail.bf1.yahoo.com with SMTP; 07 May 2013 00:04:35 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250027 - head/sys/kern From: Scott Long In-Reply-To: <20130506200530.GD3047@kib.kiev.ua> Date: Tue, 7 May 2013 01:04:35 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <166D5005-9B80-4B72-BF6C-80DA0F5D6DCD@yahoo.com> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl> <20130506200530.GD3047@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1503) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 07:04:44 -0000 On May 6, 2013, at 2:05 PM, Konstantin Belousov = wrote: > On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote: >> On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Sun Apr 28 19:12:09 2013 >>> New Revision: 250027 >>> URL: http://svnweb.freebsd.org/changeset/base/250027 >>>=20 >>> Log: >>> Eliminate the layering violation in the kern_sendfile(). When = quering >>> the file size, use VOP_GETATTR() instead of accessing vnode = vm_object >>> un_pager.vnp.vnp_size. >>=20 >> Doesn't it add extra I/O to query file system about file's = attributes? >> If it does, does it matter here? >=20 > It should not, typically. Whenever you say the word "typically", I get nervous. I take this to = mean that under pressure, the syscall may likely synchronously block to complete this = call. If so, then it makes sendfile() pretty much unusable for us at Netflix, and it = means that we will either need to revert this or resort to a hack. >=20 > E.g. UFS always keeps the unpacked inode in memory for any = non-reclaimed > vnode. For NFS, vnode usually caches the attributes. >=20 > Anyway, using VOP_GETATTR() is the only sanctioned way to get file = size. > Directly accessing vm_object assumes that vm_object is of OBJT_VNODE = type, > which is no longer true. How about just testing for this assumption and only performing the = VOP_GETATTR if it's not true? Scott From owner-svn-src-all@FreeBSD.ORG Tue May 7 07:41:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 342362E8; Tue, 7 May 2013 07:41:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9E508630; Tue, 7 May 2013 07:41:14 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r477f3ln091620; Tue, 7 May 2013 10:41:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.2 kib.kiev.ua r477f3ln091620 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r477f2m1091618; Tue, 7 May 2013 10:41:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 May 2013 10:41:02 +0300 From: Konstantin Belousov To: Scott Long Subject: Re: svn commit: r250027 - head/sys/kern Message-ID: <20130507074102.GE3047@kib.kiev.ua> References: <201304281912.r3SJC9bL030636@svn.freebsd.org> <20130506181610.GA1390@garage.freebsd.pl> <20130506200530.GD3047@kib.kiev.ua> <166D5005-9B80-4B72-BF6C-80DA0F5D6DCD@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1nHxr/DJDVCa1lM8" Content-Disposition: inline In-Reply-To: <166D5005-9B80-4B72-BF6C-80DA0F5D6DCD@yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 07:41:15 -0000 --1nHxr/DJDVCa1lM8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 07, 2013 at 01:04:35AM -0600, Scott Long wrote: >=20 > On May 6, 2013, at 2:05 PM, Konstantin Belousov wro= te: >=20 > > On Mon, May 06, 2013 at 08:16:11PM +0200, Pawel Jakub Dawidek wrote: > >> On Sun, Apr 28, 2013 at 07:12:09PM +0000, Konstantin Belousov wrote: > >>> Author: kib > >>> Date: Sun Apr 28 19:12:09 2013 > >>> New Revision: 250027 > >>> URL: http://svnweb.freebsd.org/changeset/base/250027 > >>>=20 > >>> Log: > >>> Eliminate the layering violation in the kern_sendfile(). When queri= ng > >>> the file size, use VOP_GETATTR() instead of accessing vnode vm_object > >>> un_pager.vnp.vnp_size. > >>=20 > >> Doesn't it add extra I/O to query file system about file's attributes? > >> If it does, does it matter here? > >=20 > > It should not, typically. >=20 > Whenever you say the word "typically", I get nervous. I take this to > mean that under pressure, the syscall may likely synchronously block > to complete this call. If so, then it makes sendfile() pretty much > unusable for us at Netflix, and it means that we will either need to > revert this or resort to a hack. Typical there is quantified by the filesystem type. If you read my previous response, you should note that I claimed that UFS never performs disk access when executing VOP_GETATTR(). The UFS inode is always kept in memory while vnode is not reclaimed. For NFS indeed, if the attribute cache is expired, the rpc is fired. >=20 > >=20 > > E.g. UFS always keeps the unpacked inode in memory for any non-reclaimed > > vnode. For NFS, vnode usually caches the attributes. > >=20 > > Anyway, using VOP_GETATTR() is the only sanctioned way to get file size. > > Directly accessing vm_object assumes that vm_object is of OBJT_VNODE ty= pe, > > which is no longer true. >=20 > How about just testing for this assumption and only performing the VOP_GE= TATTR > if it's not true? This might be done, I will look at this later. --1nHxr/DJDVCa1lM8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRiLANAAoJEJDCuSvBvK1BAg8P+wfQKw+k1/P3aJi1N4poglK/ 7oIR8xMg1xqz1rVjS25lCIMAB8/E5TmGfvJSUULo1aymKD2LIA20K41M08scQbC2 j/vq3tcKxAmNACGNccYiSOaA6rsVQjeq7xCiPUZ8Kbk5uVcLoSezjvwY3RX5BxPF A+/qtxMSbww3ScQ2X9sExNXQAYuIqJF7ICIbfAW5qUYrF8+tRu8/oO6W0FFJ0n0d +uD8cbiUO2W058uJhrxw8/cPPLcCh9dVwowvCWuRm8RmL7T3ZEVfDshY3YtmrxqL V//xsZVFv5YVg0p2OtagVHWLiU5QanxObFge+sGZMfcnI++lBLMbRju+k1MMU7BF M1TIuh3csijaQtv7XPVFfFJ/a1CqpZtCdR+y7Ovre0hZF3cdZ2AS6U3dszufVbtS cu5FLU7KfZ9aOb9g7wS9sAS3917fEyU9XiwA1aE2wCNebgkaX/kG8x5mgsDAY+s2 wD23Vr8sWVpON7GVQITAXkuTxwkMMnRYnED5hfbs45YfXyowYzJJxVqV8W425mmf Sirj0agortK/ZjYg6VTG8KjbQRQkSiecCFjnW7gFfXWmnY2u/n2gvjy2je2wkJiV 4giXvd6Bw0W99UveU6GMy/9Rp3HYjklVBX5jOAbLAkxhZ83O5dhO04DxR/OJZWT3 KLLf9J6JWrmScuJE/xBN =KlTg -----END PGP SIGNATURE----- --1nHxr/DJDVCa1lM8-- From owner-svn-src-all@FreeBSD.ORG Tue May 7 07:44:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 459E4479; Tue, 7 May 2013 07:44:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39607641; Tue, 7 May 2013 07:44:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r477i82V091364; Tue, 7 May 2013 07:44:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r477i8nA091363; Tue, 7 May 2013 07:44:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305070744.r477i8nA091363@svn.freebsd.org> From: Adrian Chadd Date: Tue, 7 May 2013 07:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250325 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 07:44:08 -0000 Author: adrian Date: Tue May 7 07:44:07 2013 New Revision: 250325 URL: http://svnweb.freebsd.org/changeset/base/250325 Log: Simplify this bit of code! Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue May 7 06:42:07 2013 (r250324) +++ head/sys/dev/ath/if_ath_tx.c Tue May 7 07:44:07 2013 (r250325) @@ -1821,11 +1821,8 @@ ath_tx_start(struct ath_softc *sc, struc if (sc->sc_cabq->axq_depth + sc->sc_cabq->fifo.axq_depth > sc->sc_txq_mcastq_maxdepth) { sc->sc_stats.ast_tx_mcastq_overflow++; - r = ENOBUFS; - } - if (r != 0) { m_freem(m0); - return r; + return (ENOBUFS); } } From owner-svn-src-all@FreeBSD.ORG Tue May 7 07:52:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CBC896EA; Tue, 7 May 2013 07:52:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BE0E8686; Tue, 7 May 2013 07:52:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r477qJoi094439; Tue, 7 May 2013 07:52:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r477qJfA094432; Tue, 7 May 2013 07:52:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305070752.r477qJfA094432@svn.freebsd.org> From: Adrian Chadd Date: Tue, 7 May 2013 07:52:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250326 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 07:52:19 -0000 Author: adrian Date: Tue May 7 07:52:18 2013 New Revision: 250326 URL: http://svnweb.freebsd.org/changeset/base/250326 Log: Re-work how transmit buffer limits are enforced - partly to fix the PR, but partly to just tidy up things. The problem here - there are too many TX buffers in the queue! By the time one needs to transmit an EAPOL frame (for this PR, it's the response to the group rekey notification from the AP) there are no ath_buf entries free and the EAPOL frame doesn't go out. Now, the problem! * Enforcing the TX buffer limitation _before_ we dequeue the frame? Bad idea. Because.. * .. it means I can't check whether the mbuf has M_EAPOL set. The solution(s): * De-queue the frame first * Don't bother doing the TX buffer minimum free check until after we know whether it's an EAPOL frame or not. * If it's an EAPOL frame, allocate the buffer from the mgmt pool rather than the default pool. Whilst I'm here: * Add a tweak to limit how many buffers a single node can acquire. * Don't enforce that for EAPOL frames. * .. set that to default to 1/4 of the available buffers, or 32, whichever is more sane. This doesn't fix issues due to a sleeping node or a very poor performing node; but this doesn't make it worse. Tested: * AR5416 STA, TX'ing 100+ mbit UDP to an AP, but only 50mbit being received (thus the TX queue fills up.) * .. with CCMP / WPA2 encryption configured * .. and the group rekey time set to 10 seconds, just to elicit the behaviour very quickly. PR: kern/138379 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue May 7 07:44:07 2013 (r250325) +++ head/sys/dev/ath/if_ath.c Tue May 7 07:52:18 2013 (r250326) @@ -694,6 +694,13 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_txq_mcastq_maxdepth = ath_txbuf; + /* + * Default the maximum queue depth for a given node + * to 1/4'th the TX buffers, or 64, whichever + * is larger. + */ + sc->sc_txq_node_maxdepth = MAX(64, ath_txbuf / 4); + /* Enable CABQ by default */ sc->sc_cabq_enable = 1; @@ -2661,33 +2668,98 @@ ath_start(struct ifnet *ifp) ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start: called"); for (;;) { - ATH_TXBUF_LOCK(sc); - if (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree) { - /* XXX increment counter? */ - ATH_TXBUF_UNLOCK(sc); + /* + * Grab the frame that we're going to try and transmit. + */ + IFQ_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + + /* + * Enforce how deep a node queue can get. + * + * XXX it would be nicer if we kept an mbuf queue per + * node and only whacked them into ath_bufs when we + * are ready to schedule some traffic from them. + * .. that may come later. + * + * XXX we should also track the per-node hardware queue + * depth so it is easy to limit the _SUM_ of the swq and + * hwq frames. Since we only schedule two HWQ frames + * at a time, this should be OK for now. + */ + if ((!(m->m_flags & M_EAPOL)) && + (ATH_NODE(ni)->an_swq_depth > sc->sc_txq_node_maxdepth)) { + sc->sc_stats.ast_tx_nodeq_overflow++; + if (ni != NULL) + ieee80211_free_node(ni); + m_freem(m); + m = NULL; + continue; + } + + /* + * Check how many TX buffers are available. + * + * If this is for non-EAPOL traffic, just leave some + * space free in order for buffer cloning and raw + * frame transmission to occur. + * + * If it's for EAPOL traffic, ignore this for now. + * Management traffic will be sent via the raw transmit + * method which bypasses this check. + * + * This is needed to ensure that EAPOL frames during + * (re) keying have a chance to go out. + * + * See kern/138379 for more information. + */ + if ((!(m->m_flags & M_EAPOL)) && + (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree)) { + sc->sc_stats.ast_tx_nobuf++; IF_LOCK(&ifp->if_snd); + _IF_PREPEND(&ifp->if_snd, m); ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); + m = NULL; break; } - ATH_TXBUF_UNLOCK(sc); - + /* * Grab a TX buffer and associated resources. + * + * If it's an EAPOL frame, allocate a MGMT ath_buf. + * That way even with temporary buffer exhaustion due to + * the data path doesn't leave us without the ability + * to transmit management frames. + * + * Otherwise allocate a normal buffer. */ - bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - if (bf == NULL) - break; + if (m->m_flags & M_EAPOL) + bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); + else + bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) { - ATH_TXBUF_LOCK(sc); - ath_returnbuf_head(sc, bf); - ATH_TXBUF_UNLOCK(sc); + if (bf == NULL) { + /* + * If we failed to allocate a buffer, prepend it + * and continue. + * + * We shouldn't fail normally, due to the check + * above. + */ + sc->sc_stats.ast_tx_nobuf++; + IF_LOCK(&ifp->if_snd); + _IF_PREPEND(&ifp->if_snd, m); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + m = NULL; break; } - ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + npkts ++; + /* * Check for fragmentation. If this frame * has been broken up verify we have enough Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue May 7 07:44:07 2013 (r250325) +++ head/sys/dev/ath/if_ath_sysctl.c Tue May 7 07:52:18 2013 (r250326) @@ -748,11 +748,14 @@ ath_sysctlattach(struct ath_softc *sc) "txq_data_minfree", CTLFLAG_RW, &sc->sc_txq_data_minfree, 0, "Minimum free buffers before adding a data frame" " to the TX queue"); - SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "txq_mcastq_maxdepth", CTLFLAG_RW, &sc->sc_txq_mcastq_maxdepth, 0, "Maximum buffer depth for multicast/broadcast frames"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "txq_node_maxdepth", CTLFLAG_RW, + &sc->sc_txq_node_maxdepth, 0, + "Maximum buffer depth for a single node"); #if 0 SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue May 7 07:44:07 2013 (r250325) +++ head/sys/dev/ath/if_athioctl.h Tue May 7 07:52:18 2013 (r250326) @@ -163,8 +163,9 @@ struct ath_stats { u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ u_int32_t ast_rx_keymiss; u_int32_t ast_tx_swfiltered; + u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ - u_int32_t ast_pad[15]; + u_int32_t ast_pad[14]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue May 7 07:44:07 2013 (r250325) +++ head/sys/dev/ath/if_athvar.h Tue May 7 07:52:18 2013 (r250326) @@ -799,6 +799,7 @@ struct ath_softc { * * + mcastq_maxdepth is the maximum depth allowed of the cabq. */ + int sc_txq_node_maxdepth; int sc_txq_data_minfree; int sc_txq_mcastq_maxdepth; From owner-svn-src-all@FreeBSD.ORG Tue May 7 08:16:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1D419CFA; Tue, 7 May 2013 08:16:22 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E91357A5; Tue, 7 May 2013 08:16:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r478GL3X002833; Tue, 7 May 2013 08:16:21 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r478GL1X002832; Tue, 7 May 2013 08:16:21 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305070816.r478GL1X002832@svn.freebsd.org> From: Scott Long Date: Tue, 7 May 2013 08:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250327 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 08:16:22 -0000 Author: scottl Date: Tue May 7 08:16:21 2013 New Revision: 250327 URL: http://svnweb.freebsd.org/changeset/base/250327 Log: Add a sysctl vfs.read_min to complement the exiting vfs.read_max. It defaults to 1, meaning that it's off. When read-ahead is enabled on a file, the vfs cluster code deliberately breaks a read into 2 I/O transactions; one to satisfy the actual read, and one to perform read-ahead. This makes sense in low-latency circumstances, but often produces unbalanced i/o transactions that penalize disks. By setting vfs.read_min, we can tell the algorithm to fetch a larger transaction that what we asked for, achieving the same effect as the read-ahead but without the doubled, unbalanced transaction and the slightly lower latency. This significantly helps our workloads with video streaming. Submitted by: emax Reviewed by: kib Obtained from: Netflix Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Tue May 7 07:52:18 2013 (r250326) +++ head/sys/kern/vfs_cluster.c Tue May 7 08:16:21 2013 (r250327) @@ -76,6 +76,10 @@ static int read_max = 64; SYSCTL_INT(_vfs, OID_AUTO, read_max, CTLFLAG_RW, &read_max, 0, "Cluster read-ahead max block count"); +static int read_min = 1; +SYSCTL_INT(_vfs, OID_AUTO, read_min, CTLFLAG_RW, &read_min, 0, + "Cluster read min block count"); + /* Page expended to mark partially backed buffers */ extern vm_page_t bogus_page; @@ -166,6 +170,7 @@ cluster_read(struct vnode *vp, u_quad_t } else { off_t firstread = bp->b_offset; int nblks; + long minread; KASSERT(bp->b_offset != NOOFFSET, ("cluster_read: no buffer offset")); @@ -173,6 +178,13 @@ cluster_read(struct vnode *vp, u_quad_t ncontig = 0; /* + * Adjust totread if needed + */ + minread = read_min * size; + if (minread > totread) + totread = minread; + + /* * Compute the total number of blocks that we should read * synchronously. */ From owner-svn-src-all@FreeBSD.ORG Tue May 7 09:47:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3BCC3CFB; Tue, 7 May 2013 09:47:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6FCC26; Tue, 7 May 2013 09:47:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r479lC19035243; Tue, 7 May 2013 09:47:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r479lCMq035242; Tue, 7 May 2013 09:47:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305070947.r479lCMq035242@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 May 2013 09:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250328 - stable/9/bin/dd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 09:47:13 -0000 Author: kib Date: Tue May 7 09:47:12 2013 New Revision: 250328 URL: http://svnweb.freebsd.org/changeset/base/250328 Log: MFC r249811: Literally follow POSIX: If the bs= expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block. PR: standards/177742 Modified: stable/9/bin/dd/dd.c Directory Properties: stable/9/bin/dd/ (props changed) Modified: stable/9/bin/dd/dd.c ============================================================================== --- stable/9/bin/dd/dd.c Tue May 7 08:16:21 2013 (r250327) +++ stable/9/bin/dd/dd.c Tue May 7 09:47:12 2013 (r250328) @@ -351,7 +351,7 @@ dd_in(void) * than noerror, notrunc or sync are specified, the block * is output without buffering as it is read. */ - if (ddflags & C_BS) { + if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) { out.dbcnt = in.dbcnt; dd_out(1); in.dbcnt = 0; From owner-svn-src-all@FreeBSD.ORG Tue May 7 09:48:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1D33E88; Tue, 7 May 2013 09:48:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D42D4C3B; Tue, 7 May 2013 09:48:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r479mgMP035588; Tue, 7 May 2013 09:48:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r479mg8q035587; Tue, 7 May 2013 09:48:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305070948.r479mg8q035587@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 May 2013 09:48:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250329 - stable/8/bin/dd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 09:48:43 -0000 Author: kib Date: Tue May 7 09:48:42 2013 New Revision: 250329 URL: http://svnweb.freebsd.org/changeset/base/250329 Log: MFC r249811: Literally follow POSIX: If the bs= expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block. PR: standards/177742 Modified: stable/8/bin/dd/dd.c Directory Properties: stable/8/bin/dd/ (props changed) Modified: stable/8/bin/dd/dd.c ============================================================================== --- stable/8/bin/dd/dd.c Tue May 7 09:47:12 2013 (r250328) +++ stable/8/bin/dd/dd.c Tue May 7 09:48:42 2013 (r250329) @@ -351,7 +351,7 @@ dd_in(void) * than noerror, notrunc or sync are specified, the block * is output without buffering as it is read. */ - if (ddflags & C_BS) { + if ((ddflags & ~(C_NOERROR | C_NOTRUNC | C_SYNC)) == C_BS) { out.dbcnt = in.dbcnt; dd_out(1); in.dbcnt = 0; From owner-svn-src-all@FreeBSD.ORG Tue May 7 12:39:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 07ED9EB2; Tue, 7 May 2013 12:39:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EDA8A3CA; Tue, 7 May 2013 12:39:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47CdEvN095002; Tue, 7 May 2013 12:39:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47CdEBk095000; Tue, 7 May 2013 12:39:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305071239.r47CdEBk095000@svn.freebsd.org> From: Eitan Adler Date: Tue, 7 May 2013 12:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250330 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 12:39:15 -0000 Author: eadler Date: Tue May 7 12:39:14 2013 New Revision: 250330 URL: http://svnweb.freebsd.org/changeset/base/250330 Log: By request, add an arrow from NetBSD-0.8 to FreeBSD-1.0. While here, add a few more NetBSD versions to the tree itself. Submitted by: Alan Barrett Submitted by: Thomas Klausner Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue May 7 09:48:42 2013 (r250329) +++ head/share/misc/bsd-family-tree Tue May 7 12:39:14 2013 (r250330) @@ -62,9 +62,9 @@ Tenth Edition | | | 4.4BSD | | | / | | | | 4.4BSD-Encumbered | | - | NetBSD 0.8 | BSD/386 1.0 - | | | | -FreeBSD 1.0 NetBSD 0.9 | BSD/386 1.1 + | -NetBSD 0.8 | BSD/386 1.0 + | / | | | +FreeBSD 1.0 <-----' NetBSD 0.9 | BSD/386 1.1 | | .----- 4.4BSD Lite | FreeBSD 1.1 | / / | \ | | | / / | \ | @@ -216,12 +216,12 @@ FreeBSD 5.2 | | | | 10.5 | | | | | | | OpenBSD 4.2 | | | | NetBSD 4.0 | | - | FreeBSD 6.3 | | | | - | \ | | | | - *--FreeBSD | | | | DragonFly 1.12.0 - | 7.0 | | | | | - | | | | | OpenBSD 4.3 | - | | | | | | DragonFly 2.0.0 + | FreeBSD 6.3 | | | | | + | \ | | | | | + *--FreeBSD | | | | | DragonFly 1.12.0 + | 7.0 | | | | | | + | | | | | | OpenBSD 4.3 | + | | | | | NetBSD 4.0.1 | DragonFly 2.0.0 | | FreeBSD | | OpenBSD 4.4 | | | 6.4 | | | | | | | | | | @@ -244,14 +244,14 @@ FreeBSD 5.2 | | | | | | | | | DragonFly 2.8.2 | | | | | | OpenBSD 4.8 | | | | | | NetBSD 5.1 | | - | FreeBSD FreeBSD | | | | - | 8.2 7.4 | | | DragonFly 2.10.1 - | | | | OpenBSD 4.9 | - | `-----. Mac OS X | | | - | \ 10.7 | | | - | | | | OpenBSD 5.0 | - *--FreeBSD | | | | | - | 9.0 | | | | DragonFly 3.0.1 + | FreeBSD FreeBSD | | | | | + | 8.2 7.4 | | | | DragonFly 2.10.1 + | | | | | OpenBSD 4.9 | + | `-----. Mac OS X | | | | + | \ 10.7 | | | | + | | | | | OpenBSD 5.0 | + *--FreeBSD | | | | | | + | 9.0 | | | NetBSD 5.1.2 | DragonFly 3.0.1 | | FreeBSD | | | | | | 8.3 | | OpenBSD 5.1 | | | Mac OS X | | | From owner-svn-src-all@FreeBSD.ORG Tue May 7 12:43:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 91A24124 for ; Tue, 7 May 2013 12:43:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by mx1.freebsd.org (Postfix) with ESMTP id 6C55D3FB for ; Tue, 7 May 2013 12:43:16 +0000 (UTC) Received: by mail-pd0-f172.google.com with SMTP id 6so346337pdd.3 for ; Tue, 07 May 2013 05:43:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=n9zkelB3mgCeZykuO0hOKagmyZ6wbwvQR9D+07+M7Ws=; b=sIr3nEpIguYCCtU4PLJlJcSA5my53KMVHMgSYW8n/8iggieQGd0Cc/MUPQVgYThLdk ueGJuTuJPpVjS2/4oyG3H80bGYcvY9wn/dkmTCyCZp7Cxxbe3dXxYSX3P5sU2lyrDv5K QDjqz/oKIK2+qgEEDku/XHoOq9m6D3M4aqc0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=n9zkelB3mgCeZykuO0hOKagmyZ6wbwvQR9D+07+M7Ws=; b=HGci6ECdZ7mjfjZ460Q8trBZlZSbZSg+oPyKvK2SKqqRBH/WrpMHHJFl9g1XKQ0d4Z 8QhUo6LysqXFfPjKsAfQX1+BlMpe8gYr5/6rvZ1by1bB3fiJFhZ4BFPSXPO0dS52yrU2 ErJI5Okb2xwogboaPmOiUnDsVP1L7M23FkMy+lFABw87sF45WrkcBtHbH9CBtVpBmc/C if7Quh6zQcf0rJY4ORhijoXLs/XecAF5T5kCq+4E23L6plKQ+iRHaZFcq0wPX5QoYtvd vm40bwK8IST5IxUf87Dgq37t1/afITZrkR8JIz5TXt8ZcTvsRdrJnKpUJeeAssBDQxBD R4YA== X-Received: by 10.68.223.10 with SMTP id qq10mr2198520pbc.57.1367930595367; Tue, 07 May 2013 05:43:15 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Tue, 7 May 2013 05:42:45 -0700 (PDT) In-Reply-To: <20130507052359.GA42445@devbox.vnode.local> References: <201305070203.r47230ro071386@svn.freebsd.org> <20130507052359.GA42445@devbox.vnode.local> From: Eitan Adler Date: Tue, 7 May 2013 08:42:45 -0400 X-Google-Sender-Auth: of53pdkcDJkvLu5qQ5PzUBSAzgI Message-ID: Subject: Re: svn commit: r250315 - head/share/misc To: Joel Dahl Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnVQtX1GruQOzrsD15eMKOl09+j6aJ3HFS0lkDkTvuHvqB6ow2c6Q9lwQ4CcrXqYTL7xh2G Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 12:43:16 -0000 On 7 May 2013 01:23, Joel Dahl wrote: > On Tue, May 07, 2013 at 02:03:00AM +0000, Eitan Adler wrote: >> Author: eadler >> Date: Tue May 7 02:03:00 2013 >> New Revision: 250315 >> URL: http://svnweb.freebsd.org/changeset/base/250315 >> >> Log: >> Add two missing NetBSD releases > > You didn't add them to the family tree. This was somewhat intentional. I'm trying to integrate all the changes that { Open, Net, DragonFly } made. Not all of their releases are in the tree itself. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Tue May 7 18:08:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 44E9B6BC; Tue, 7 May 2013 18:08:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37235911; Tue, 7 May 2013 18:08:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47I8ofQ011848; Tue, 7 May 2013 18:08:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47I8onG011847; Tue, 7 May 2013 18:08:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305071808.r47I8onG011847@svn.freebsd.org> From: John Baldwin Date: Tue, 7 May 2013 18:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250333 - head/sys/boot/pc98/libpc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 18:08:50 -0000 Author: jhb Date: Tue May 7 18:08:49 2013 New Revision: 250333 URL: http://svnweb.freebsd.org/changeset/base/250333 Log: Don't pad disk partition sizes with leading zeros. This was already fixed in a different way by the new disk code used for other platforms. MFC after: 1 week Modified: head/sys/boot/pc98/libpc98/biosdisk.c Modified: head/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- head/sys/boot/pc98/libpc98/biosdisk.c Tue May 7 13:46:22 2013 (r250332) +++ head/sys/boot/pc98/libpc98/biosdisk.c Tue May 7 18:08:49 2013 (r250333) @@ -296,7 +296,7 @@ display_size(uint64_t size) size /= 1024; unit = 'M'; } - sprintf(buf, "%.6ld%cB", (long)size, unit); + sprintf(buf, "%6ld%cB", (long)size, unit); return (buf); } From owner-svn-src-all@FreeBSD.ORG Tue May 7 18:45:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B8E0F88; Tue, 7 May 2013 18:45:34 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7DFB3B00; Tue, 7 May 2013 18:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47IjYRi024872; Tue, 7 May 2013 18:45:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47IjYgw024871; Tue, 7 May 2013 18:45:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305071845.r47IjYgw024871@svn.freebsd.org> From: Alan Cox Date: Tue, 7 May 2013 18:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250334 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 18:45:34 -0000 Author: alc Date: Tue May 7 18:45:34 2013 New Revision: 250334 URL: http://svnweb.freebsd.org/changeset/base/250334 Log: Remove a redundant call to panic() from vm_radix_keydiff(). The assertion before the loop accomplishes the same thing. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Tue May 7 18:08:49 2013 (r250333) +++ head/sys/vm/vm_radix.c Tue May 7 18:45:34 2013 (r250334) @@ -234,11 +234,9 @@ vm_radix_keydiff(vm_pindex_t index1, vm_ __func__, (uintmax_t)index1)); index1 ^= index2; - for (clev = 0; clev <= VM_RADIX_LIMIT ; clev++) - if (vm_radix_slot(index1, clev)) + for (clev = 0;; clev++) + if (vm_radix_slot(index1, clev) != 0) return (clev); - panic("%s: cannot reach this point", __func__); - return (0); } /* From owner-svn-src-all@FreeBSD.ORG Tue May 7 19:00:08 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1E284503; Tue, 7 May 2013 19:00:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9DEBFA; Tue, 7 May 2013 19:00:07 +0000 (UTC) Received: from spaceball.andric.com (spaceball.andric.com [IPv6:2001:7b8:3a7:0:204:4bff:fe01:de8a]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 459655C44; Tue, 7 May 2013 21:00:06 +0200 (CEST) Message-ID: <51894F2D.7030708@FreeBSD.org> Date: Tue, 07 May 2013 20:59:57 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:21.0) Gecko/20100101 Thunderbird/21.0 MIME-Version: 1.0 To: Julian Elischer Subject: Re: svn commit: r250306 - in stable/8/sys: net sys References: <201305061959.r46JxEUA041105@svn.freebsd.org> <51883923.8050505@freebsd.org> In-Reply-To: <51883923.8050505@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 19:00:08 -0000 On 2013-05-07 01:13, Julian Elischer wrote: > On 5/6/13 12:59 PM, Dimitry Andric wrote: >> Author: dim >> Date: Mon May 6 19:59:13 2013 >> New Revision: 250306 >> URL: http://svnweb.freebsd.org/changeset/base/250306 >> >> Log: >> MFC r215137: >> >> Revert r103230, which depended on ld preserving the __start_xxx and >> __stop_xxx symbols for custom sections, even when these were not >> referenced (at link time). This behaviour was changed again in binutils >> commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. >> >> This time, put the __GLOBL macro definition in cdefs.h, so it can be >> reused in a few other places where it will be needed. > > Is this stuff documented anywhere? If you mean the specifics of , I don't think so. The documentation for the things that use it, are mostly in SYSINIT(9), DECLARE_MODULE(9) and module(9). In any case, the idea is that you tell the compiler and linker to add a few custom sections to the output, which contain metadata, for example to initialize a kernel module. Take the section headers of mpt.ko, for instance: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk Inf Al [ 0] NULL 00000000 000000 000000 00 0 0 0 [ 1] .hash HASH 000000b4 0000b4 00038c 04 A 2 0 4 [ 2] .dynsym DYNSYM 00000440 000440 000800 10 A 3 1 4 [ 3] .dynstr STRTAB 00000c40 000c40 000792 00 A 0 0 1 [ 4] .rel.dyn REL 000013d4 0013d4 004b80 08 A 2 0 4 [ 5] .text PROGBITS 00005f60 005f60 01258a 00 AX 0 0 16 [ 6] .rodata PROGBITS 000184f0 0184f0 00561d 00 A 0 0 16 [ 7] set_modmetadata_set PROGBITS 0001db10 01db10 000054 00 A 0 0 4 [ 8] set_sysinit_set PROGBITS 0001db64 01db64 000020 00 A 0 0 4 [ 9] set_sysuninit_set PROGBITS 0001db84 01db84 000004 00 A 0 0 4 [10] .dynamic DYNAMIC 0001e000 01e000 000078 08 WA 3 0 4 [11] .got.plt PROGBITS 0001e078 01e078 00000c 04 WA 0 0 4 [12] .data PROGBITS 0001e084 01e084 000478 00 WA 0 0 4 [13] .bss NOBITS 0001e4fc 01e4fc 000310 00 WA 0 0 4 [14] .comment PROGBITS 00000000 01e4fc 0001b3 01 MS 0 0 1 [15] .SUNW_ctf PROGBITS 00000000 01e6b0 0065f7 00 0 0 4 [16] .gnu_debuglink PROGBITS 00000000 024ca7 000014 00 0 0 1 [17] .shstrtab STRTAB 00000000 024cbb 0000bd 00 0 0 1 [18] .symtab SYMTAB 00000000 025098 0018d0 10 19 270 4 [19] .strtab STRTAB 00000000 026968 001e9f 00 0 0 1 Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings) I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) O (extra OS processing required) o (OS specific), p (processor specific) The 'set_*' sections are added by the linker_set macros, and are marked as used, so the compiler will not optimize them away. However, in some versions of binutils, the linker still optimizes them away, so we have to resort to inserting assembler directives to force it to keep them. This is what r103230 and r215137 were about. -Dimitry From owner-svn-src-all@FreeBSD.ORG Tue May 7 20:12:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C08A6D2; Tue, 7 May 2013 20:12:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 9352AF7B; Tue, 7 May 2013 20:12:45 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0AC31B94A; Tue, 7 May 2013 16:12:45 -0400 (EDT) From: John Baldwin To: Dimitry Andric Subject: Re: svn commit: r250306 - in stable/8/sys: net sys Date: Tue, 7 May 2013 16:12:34 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305061959.r46JxEUA041105@svn.freebsd.org> <51883923.8050505@freebsd.org> <51894F2D.7030708@FreeBSD.org> In-Reply-To: <51894F2D.7030708@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305071612.34947.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 07 May 2013 16:12:45 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Julian Elischer , svn-src-stable-8@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 20:12:45 -0000 On Tuesday, May 07, 2013 2:59:57 pm Dimitry Andric wrote: > On 2013-05-07 01:13, Julian Elischer wrote: > > On 5/6/13 12:59 PM, Dimitry Andric wrote: > >> Author: dim > >> Date: Mon May 6 19:59:13 2013 > >> New Revision: 250306 > >> URL: http://svnweb.freebsd.org/changeset/base/250306 > >> > >> Log: > >> MFC r215137: > >> > >> Revert r103230, which depended on ld preserving the __start_xxx and > >> __stop_xxx symbols for custom sections, even when these were not > >> referenced (at link time). This behaviour was changed again in binutils > >> commit 0b8ed435c3fe8bd09a08c23920e65bfb03251221. > >> > >> This time, put the __GLOBL macro definition in cdefs.h, so it can be > >> reused in a few other places where it will be needed. > > > > Is this stuff documented anywhere? > > If you mean the specifics of , I don't think so. The > documentation for the things that use it, are mostly in SYSINIT(9), > DECLARE_MODULE(9) and module(9). > > In any case, the idea is that you tell the compiler and linker to add a > few custom sections to the output, which contain metadata, for example > to initialize a kernel module. > > Take the section headers of mpt.ko, for instance: > > Section Headers: > [Nr] Name Type Addr Off Size ES Flg Lk Inf Al > [ 0] NULL 00000000 000000 000000 00 0 0 0 > [ 1] .hash HASH 000000b4 0000b4 00038c 04 A 2 0 4 > [ 2] .dynsym DYNSYM 00000440 000440 000800 10 A 3 1 4 > [ 3] .dynstr STRTAB 00000c40 000c40 000792 00 A 0 0 1 > [ 4] .rel.dyn REL 000013d4 0013d4 004b80 08 A 2 0 4 > [ 5] .text PROGBITS 00005f60 005f60 01258a 00 AX 0 0 16 > [ 6] .rodata PROGBITS 000184f0 0184f0 00561d 00 A 0 0 16 > [ 7] set_modmetadata_set PROGBITS 0001db10 01db10 000054 00 A 0 0 4 > [ 8] set_sysinit_set PROGBITS 0001db64 01db64 000020 00 A 0 0 4 > [ 9] set_sysuninit_set PROGBITS 0001db84 01db84 000004 00 A 0 0 4 > [10] .dynamic DYNAMIC 0001e000 01e000 000078 08 WA 3 0 4 > [11] .got.plt PROGBITS 0001e078 01e078 00000c 04 WA 0 0 4 > [12] .data PROGBITS 0001e084 01e084 000478 00 WA 0 0 4 > [13] .bss NOBITS 0001e4fc 01e4fc 000310 00 WA 0 0 4 > [14] .comment PROGBITS 00000000 01e4fc 0001b3 01 MS 0 0 1 > [15] .SUNW_ctf PROGBITS 00000000 01e6b0 0065f7 00 0 0 4 > [16] .gnu_debuglink PROGBITS 00000000 024ca7 000014 00 0 0 1 > [17] .shstrtab STRTAB 00000000 024cbb 0000bd 00 0 0 1 > [18] .symtab SYMTAB 00000000 025098 0018d0 10 19 270 4 > [19] .strtab STRTAB 00000000 026968 001e9f 00 0 0 1 > Key to Flags: > W (write), A (alloc), X (execute), M (merge), S (strings) > I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown) > O (extra OS processing required) o (OS specific), p (processor specific) > > The 'set_*' sections are added by the linker_set macros, and are marked > as used, so the compiler will not optimize them away. > > However, in some versions of binutils, the linker still optimizes them > away, so we have to resort to inserting assembler directives to force it > to keep them. This is what r103230 and r215137 were about. You can use linker sets in userland as well. I used them in mfiutil and mptutil to build nested command tables. I've also used linker sets to build lists of unit tests in kernel modules. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue May 7 20:35:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B802544E; Tue, 7 May 2013 20:35:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 90AEF8E; Tue, 7 May 2013 20:35:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47KZmn4064103; Tue, 7 May 2013 20:35:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47KZmbc064099; Tue, 7 May 2013 20:35:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305072035.r47KZmbc064099@svn.freebsd.org> From: Ed Maste Date: Tue, 7 May 2013 20:35:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250335 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 20:35:48 -0000 Author: emaste Date: Tue May 7 20:35:47 2013 New Revision: 250335 URL: http://svnweb.freebsd.org/changeset/base/250335 Log: Constify libusb_get_pollfds return The correct return type, per our libusb(3) man page and the libusb.org and libusbx projects (whose interface we intend to follow for our libusb), is const struct libusb_pollfd **. Unfortunately the doxygen-generated libusbx API documentation[1] omits[2] the const for some reason. [1] http://libusbx.sourceforge.net/api-1.0/group__poll.html#gab1a72869a926552b27a6c667695df3a2 [2] http://sourceforge.net/mailarchive/forum.php?thread_name=497D10BE.8090007%40n-dimensional.de&forum_name=libusb-devel Reviewed by: hselasky@ Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10_io.c Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Tue May 7 18:45:34 2013 (r250334) +++ head/lib/libusb/libusb.h Tue May 7 20:35:47 2013 (r250335) @@ -441,7 +441,7 @@ int libusb_handle_events(libusb_context int libusb_handle_events_locked(libusb_context * ctx, struct timeval *tv); int libusb_get_next_timeout(libusb_context * ctx, struct timeval *tv); void libusb_set_pollfd_notifiers(libusb_context * ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data); -struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx); +const struct libusb_pollfd **libusb_get_pollfds(libusb_context * ctx); /* Synchronous device I/O */ Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Tue May 7 18:45:34 2013 (r250334) +++ head/lib/libusb/libusb10_io.c Tue May 7 20:35:47 2013 (r250335) @@ -397,7 +397,7 @@ libusb_set_pollfd_notifiers(libusb_conte ctx->fd_cb_user_data = user_data; } -struct libusb_pollfd ** +const struct libusb_pollfd ** libusb_get_pollfds(libusb_context *ctx) { struct libusb_super_pollfd *pollfd; @@ -423,7 +423,7 @@ libusb_get_pollfds(libusb_context *ctx) done: CTX_UNLOCK(ctx); - return (ret); + return ((const struct libusb_pollfd **)ret); } From owner-svn-src-all@FreeBSD.ORG Tue May 7 22:05:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C26E45AD; Tue, 7 May 2013 22:05:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4AB85E8; Tue, 7 May 2013 22:05:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47M5GGX094955; Tue, 7 May 2013 22:05:16 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47M5Gq0094954; Tue, 7 May 2013 22:05:16 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305072205.r47M5Gq0094954@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 May 2013 22:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r250336 - vendor-sys/acpica/dist/source/components/namespace X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 22:05:16 -0000 Author: jkim Date: Tue May 7 22:05:15 2013 New Revision: 250336 URL: http://svnweb.freebsd.org/changeset/base/250336 Log: Fix for _INI regression introduced in version 20130328. This change fixes a problem introduced in 20130328 where _INI methods are no longer executed properly because of a memory block that is not initialized correctly. https://github.com/acpica/acpica/commit/637accd073a205eb4acac935f34d0eaee0c301a8 Modified: vendor-sys/acpica/dist/source/components/namespace/nsinit.c Modified: vendor-sys/acpica/dist/source/components/namespace/nsinit.c ============================================================================== --- vendor-sys/acpica/dist/source/components/namespace/nsinit.c Tue May 7 20:35:47 2013 (r250335) +++ vendor-sys/acpica/dist/source/components/namespace/nsinit.c Tue May 7 22:05:15 2013 (r250336) @@ -609,6 +609,7 @@ AcpiNsInitOneDevice ( ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname ( ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI)); + ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); Info->PrefixNode = DeviceNode; Info->RelativePathname = METHOD_NAME__INI; Info->Parameters = NULL; From owner-svn-src-all@FreeBSD.ORG Tue May 7 22:05:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 779D9735; Tue, 7 May 2013 22:05:58 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A72C607; Tue, 7 May 2013 22:05:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47M5wI4095133; Tue, 7 May 2013 22:05:58 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47M5wYq095132; Tue, 7 May 2013 22:05:58 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305072205.r47M5wYq095132@svn.freebsd.org> From: Brooks Davis Date: Tue, 7 May 2013 22:05:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250337 - head/cddl/lib/drti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 22:05:58 -0000 Author: brooks Date: Tue May 7 22:05:57 2013 New Revision: 250337 URL: http://svnweb.freebsd.org/changeset/base/250337 Log: Work around the implementation of LIBRARIES_ONLY. It causes drti.o to not be installed in /usr/lib32 on systems with compat-32 support. This fix has two parts. First, the build is forced by linking drti.o into a dummy internal library. Second, the object file is installed manually in the LIBRARIES_ONLY case. MFC after: 3 days Modified: head/cddl/lib/drti/Makefile Modified: head/cddl/lib/drti/Makefile ============================================================================== --- head/cddl/lib/drti/Makefile Tue May 7 22:05:15 2013 (r250336) +++ head/cddl/lib/drti/Makefile Tue May 7 22:05:57 2013 (r250337) @@ -9,6 +9,8 @@ FILESGRP= ${LIBGRP} FILESMODE= ${LIBMODE} FILESDIR= ${LIBDIR}/dtrace CLEANFILES= ${FILES} +LIB= drti-dummy +INTERNALLIB= CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ -I${.CURDIR}/../../../cddl/compat/opensolaris/include \ @@ -18,4 +20,10 @@ CFLAGS+= -I${.CURDIR}/../../../sys/cddl/ -I${OPENSOLARIS_SYS_DISTDIR}/uts/common \ -DPIC ${PICFLAG} +.if make(install) && defined(LIBRARIES_ONLY) +install: + ${INSTALL} -o ${FILESOWN} -g ${FILESGRP} -m ${FILESMODE} \ + ${FILES} ${DESTDIR}${FILESDIR} +.endif + .include From owner-svn-src-all@FreeBSD.ORG Tue May 7 22:46:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6BDDFC4; Tue, 7 May 2013 22:46:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B72B778F; Tue, 7 May 2013 22:46:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47MkSjZ009255; Tue, 7 May 2013 22:46:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47MkPUH009225; Tue, 7 May 2013 22:46:25 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305072246.r47MkPUH009225@svn.freebsd.org> From: Attilio Rao Date: Tue, 7 May 2013 22:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250338 - in head/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include vm x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 22:46:28 -0000 Author: attilio Date: Tue May 7 22:46:24 2013 New Revision: 250338 URL: http://svnweb.freebsd.org/changeset/base/250338 Log: Rename VM_NDOMAIN into MAXMEMDOM and move it into machine/param.h in order to match the MAXCPU concept. The change should also be useful for consolidation and consistency. Sponsored by: EMC / Isilon storage division Obtained from: jeff Reviewed by: alc Modified: head/sys/amd64/include/param.h head/sys/amd64/include/vmparam.h head/sys/arm/include/param.h head/sys/arm/include/vmparam.h head/sys/conf/NOTES head/sys/conf/options head/sys/i386/include/param.h head/sys/i386/include/vmparam.h head/sys/ia64/include/param.h head/sys/ia64/include/vmparam.h head/sys/mips/include/param.h head/sys/mips/include/vmparam.h head/sys/powerpc/include/param.h head/sys/powerpc/include/vmparam.h head/sys/sparc64/include/param.h head/sys/sparc64/include/vmparam.h head/sys/vm/vm_phys.c head/sys/x86/acpica/srat.c Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/amd64/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -71,6 +71,10 @@ #define MAXCPU 1 #endif +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) /* Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/amd64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -121,13 +121,6 @@ #define VM_NFREEORDER 13 /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/arm/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -80,6 +80,10 @@ #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) /* Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/arm/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -109,13 +109,6 @@ #define VM_NFREEORDER 9 /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Disable superpage reservations. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue May 7 22:05:57 2013 (r250337) +++ head/sys/conf/NOTES Tue May 7 22:46:24 2013 (r250338) @@ -224,6 +224,10 @@ options SMP # Symmetric MultiProcesso # A default value should be already present, for every architecture. options MAXCPU=32 +# MAXMEMDOM defines the maximum number of memory domains that can boot in the +# system. A default value should already be defined by every architecture. +options MAXMEMDOM=1 + # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin # if the thread that currently owns the mutex is executing on another # CPU. This behavior is enabled by default, so this option can be used Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue May 7 22:05:57 2013 (r250337) +++ head/sys/conf/options Tue May 7 22:46:24 2013 (r250338) @@ -568,6 +568,7 @@ DIAGNOSTIC opt_global.h INVARIANT_SUPPORT opt_global.h INVARIANTS opt_global.h MAXCPU opt_global.h +MAXMEMDOM opt_global.h MAXPHYS opt_global.h MCLSHIFT opt_global.h MUTEX_DEBUG opt_global.h @@ -584,7 +585,6 @@ VFS_BIO_DEBUG opt_global.h VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h -VM_NDOMAIN opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/i386/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -64,6 +64,10 @@ #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) /* Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/i386/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -107,13 +107,6 @@ #endif /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/ia64/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -69,6 +69,10 @@ #define MAXCPU 1 #endif +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) /* Modified: head/sys/ia64/include/vmparam.h ============================================================================== --- head/sys/ia64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/ia64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -103,13 +103,6 @@ #define VM_NFREEORDER 16 /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Disable superpage reservations. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/mips/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -101,6 +101,10 @@ #define MAXCPU 1 #endif +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + /* * Round p (pointer or byte index) up to a correctly-aligned value for all * data types (int, long, ...). The result is u_int and must be cast to Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/mips/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -101,13 +101,6 @@ #endif /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Disable superpage reservations. (not sure if this is right * I copied it from ARM) */ Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/powerpc/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -75,6 +75,10 @@ #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define ALIGNBYTES _ALIGNBYTES #define ALIGN(p) _ALIGN(p) /* Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/powerpc/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -163,13 +163,6 @@ struct pmap_physseg { #define VM_NFREEORDER 11 /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Disable superpage reservations. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/sparc64/include/param.h Tue May 7 22:46:24 2013 (r250338) @@ -57,6 +57,10 @@ #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ +#ifndef MAXMEMDOM +#define MAXMEMDOM 1 +#endif + #define INT_SHIFT 2 #define PTR_SHIFT 3 Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) +++ head/sys/sparc64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) @@ -106,13 +106,6 @@ #define VM_NFREEORDER 12 /* - * Only one memory domain. - */ -#ifndef VM_NDOMAIN -#define VM_NDOMAIN 1 -#endif - -/* * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Tue May 7 22:05:57 2013 (r250337) +++ head/sys/vm/vm_phys.c Tue May 7 22:46:24 2013 (r250338) @@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$"); #include /* - * VM_FREELIST_DEFAULT is split into VM_NDOMAIN lists, one for each + * VM_FREELIST_DEFAULT is split into MAXMEMDOM lists, one for each * domain. These extra lists are stored at the end of the regular * free lists starting with VM_NFREELIST. */ -#define VM_RAW_NFREELIST (VM_NFREELIST + VM_NDOMAIN - 1) +#define VM_RAW_NFREELIST (VM_NFREELIST + MAXMEMDOM - 1) struct vm_freelist { struct pglist pl; @@ -100,7 +100,7 @@ MALLOC_DEFINE(M_FICT_PAGES, "", ""); static struct vm_freelist vm_phys_free_queues[VM_RAW_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER]; static struct vm_freelist -(*vm_phys_lookup_lists[VM_NDOMAIN][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER]; +(*vm_phys_lookup_lists[MAXMEMDOM][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER]; static int vm_nfreelists = VM_FREELIST_DEFAULT + 1; @@ -116,7 +116,7 @@ static int sysctl_vm_phys_segs(SYSCTL_HA SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 static int sysctl_vm_phys_lookup_lists(SYSCTL_HANDLER_ARGS); SYSCTL_OID(_vm, OID_AUTO, phys_lookup_lists, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); @@ -200,7 +200,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) return (error); } -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 /* * Outputs the set of free list lookup lists. */ @@ -255,7 +255,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm #else seg->first_page = PHYS_TO_VM_PAGE(start); #endif -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 if (flind == VM_FREELIST_DEFAULT && domain != 0) { flind = VM_NFREELIST + (domain - 1); if (flind >= vm_nfreelists) @@ -302,7 +302,7 @@ vm_phys_init(void) { struct vm_freelist *fl; int flind, i, oind, pind; -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 int ndomains, j; #endif @@ -347,7 +347,7 @@ vm_phys_init(void) TAILQ_INIT(&fl[oind].pl); } } -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 /* * Build a free list lookup list for each domain. All of the * memory domain lists are inserted at the VM_FREELIST_DEFAULT @@ -444,7 +444,7 @@ vm_phys_alloc_pages(int pool, int order) KASSERT(order < VM_NFREEORDER, ("vm_phys_alloc_pages: order %d is out of range", order)); -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 domain = PCPU_GET(domain); #else domain = 0; @@ -925,7 +925,7 @@ vm_phys_alloc_contig(u_long npages, vm_p int domain, flind, oind, order, pind; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 domain = PCPU_GET(domain); #else domain = 0; Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Tue May 7 22:05:57 2013 (r250337) +++ head/sys/x86/acpica/srat.c Tue May 7 22:46:24 2013 (r250338) @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_vm.h" - #include #include #include @@ -47,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 struct cpu_info { int enabled:1; int has_memory:1; @@ -265,7 +263,7 @@ renumber_domains(void) domains[j] = domains[j - 1]; domains[slot] = mem_info[i].domain; ndomain++; - if (ndomain > VM_NDOMAIN) { + if (ndomain > MAXMEMDOM) { printf("SRAT: Too many memory domains\n"); return (EFBIG); } @@ -362,4 +360,4 @@ srat_set_cpus(void *dummy) } } SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); -#endif /* VM_NDOMAIN > 1 */ +#endif /* MAXMEMDOM > 1 */ From owner-svn-src-all@FreeBSD.ORG Tue May 7 22:49:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D912203; Tue, 7 May 2013 22:49:57 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F2BB7AA; Tue, 7 May 2013 22:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47MnvEL009847; Tue, 7 May 2013 22:49:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47MnvrO009846; Tue, 7 May 2013 22:49:57 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305072249.r47MnvrO009846@svn.freebsd.org> From: Attilio Rao Date: Tue, 7 May 2013 22:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250339 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 22:49:57 -0000 Author: attilio Date: Tue May 7 22:49:56 2013 New Revision: 250339 URL: http://svnweb.freebsd.org/changeset/base/250339 Log: Add functions to do ACPI System Locality Information Table parsing and printing at boot. For reference on table informations and purposes please review ACPI specs. Sponsored by: EMC / Isilon storage division Obtained from: jeff Reviewed by: jhb (earlier version) Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Tue May 7 22:46:24 2013 (r250338) +++ head/sys/x86/acpica/srat.c Tue May 7 22:49:56 2013 (r250339) @@ -331,6 +331,48 @@ srat_walk_table(acpi_subtable_handler *h acpi_walk_subtables(srat + 1, (char *)srat + srat->Header.Length, handler, arg); } + +static void +acpi_handle_slit(ACPI_TABLE_SLIT *slit) +{ + UINT64 i, j; + + printf("ACPI System Locality Information Table: %ju localities\n", + (uintmax_t)slit->LocalityCount); + printf(" "); + for (i = 0; i < slit->LocalityCount; i++) + printf(" %3ju", (uintmax_t)i); + printf("\n +"); + for (i = 0; i < slit->LocalityCount; i++) + printf("----"); + printf("\n"); + for (i = 0; i < slit->LocalityCount; i++) { + printf(" %3ju |", (uintmax_t)i); + for (j = 0; j < slit->LocalityCount; j++) + printf(" %3u", + slit->Entry[i * slit->LocalityCount + j]); + printf("\n"); + } +} + +static void +parse_slit(void *arg __unused) +{ + ACPI_TABLE_SLIT *slit; + vm_paddr_t slit_physaddr; + + if (resource_disabled("slit", 0)) + return; + + slit_physaddr = acpi_find_table(ACPI_SIG_SLIT); + if (slit_physaddr == 0) + return; + slit = acpi_map_table(slit_physaddr, ACPI_SIG_SLIT); + acpi_handle_slit(slit); + acpi_unmap_table(slit); +} + +SYSINIT(parse_slit, SI_SUB_VM - 1, SI_ORDER_SECOND, parse_slit, NULL); /* * Setup per-CPU ACPI IDs. From owner-svn-src-all@FreeBSD.ORG Tue May 7 22:58:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2ADA83F2; Tue, 7 May 2013 22:58:46 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBBD7E5; Tue, 7 May 2013 22:58:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r47MwktZ013008; Tue, 7 May 2013 22:58:46 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r47Mwh0u012989; Tue, 7 May 2013 22:58:43 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201305072258.r47Mwh0u012989@svn.freebsd.org> From: David C Somayajulu Date: Tue, 7 May 2013 22:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250340 - head/sys/dev/qlxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 22:58:46 -0000 Author: davidcs Date: Tue May 7 22:58:42 2013 New Revision: 250340 URL: http://svnweb.freebsd.org/changeset/base/250340 Log: 1. Updated Copyright Information 2. Added Flash Read/Update Support 3. Fixed TSO Handling Submitted by: David C Somayajulu (davidcs@freebsd.org) Reviewed by: George Neville-Neil (gnn@freebsd.org) Approved by: George Neville-Neil (gnn@freebsd.org) Modified: head/sys/dev/qlxgb/README.txt head/sys/dev/qlxgb/qla_dbg.c head/sys/dev/qlxgb/qla_dbg.h head/sys/dev/qlxgb/qla_def.h head/sys/dev/qlxgb/qla_glbl.h head/sys/dev/qlxgb/qla_hw.c head/sys/dev/qlxgb/qla_hw.h head/sys/dev/qlxgb/qla_inline.h head/sys/dev/qlxgb/qla_ioctl.c head/sys/dev/qlxgb/qla_ioctl.h head/sys/dev/qlxgb/qla_isr.c head/sys/dev/qlxgb/qla_misc.c head/sys/dev/qlxgb/qla_os.c head/sys/dev/qlxgb/qla_os.h head/sys/dev/qlxgb/qla_reg.h head/sys/dev/qlxgb/qla_ver.h Modified: head/sys/dev/qlxgb/README.txt ============================================================================== --- head/sys/dev/qlxgb/README.txt Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/README.txt Tue May 7 22:58:42 2013 (r250340) @@ -93,7 +93,7 @@ Technical Support at any phase of integr Technical Support can be reached by the following methods: Web: http://support.qlogic.com E-mail: support@qlogic.com -(c) Copyright 2011. All rights reserved worldwide. QLogic, the QLogic +(c) Copyright 2013. All rights reserved worldwide. QLogic, the QLogic logo, and the Powered by QLogic logo are registered trademarks of QLogic Corporation. All other brand and product names are trademarks or registered trademarks of their respective owners. Modified: head/sys/dev/qlxgb/qla_dbg.c ============================================================================== --- head/sys/dev/qlxgb/qla_dbg.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_dbg.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_dbg.h ============================================================================== --- head/sys/dev/qlxgb/qla_dbg.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_dbg.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_def.h ============================================================================== --- head/sys/dev/qlxgb/qla_def.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_def.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -194,6 +194,8 @@ struct qla_host { /* debug stuff */ volatile const char *qla_lock; volatile const char *qla_unlock; + + uint8_t fw_ver_str[32]; }; typedef struct qla_host qla_host_t; Modified: head/sys/dev/qlxgb/qla_glbl.h ============================================================================== --- head/sys/dev/qlxgb/qla_glbl.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_glbl.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -56,14 +56,6 @@ extern void qla_start(struct ifnet *ifp) extern int qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp, uint32_t jumbo); - -/* - * from qla_flash.c - */ -extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr, - uint32_t *val, uint32_t num); -extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val); - /* * from qla_hw.c */ @@ -97,6 +89,14 @@ extern int qla_init_hw(qla_host_t *ha); extern int qla_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val, uint32_t rd); extern int qla_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data); +extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr, + uint32_t *val, uint32_t num); +extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val); +extern int qla_fw_update(qla_host_t *ha, void *fdata, uint32_t off, + uint32_t size); +extern int qla_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size); +extern int qla_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size, + void *buf, uint32_t pattern); /* * from qla_ioctl.c Modified: head/sys/dev/qlxgb/qla_hw.c ============================================================================== --- head/sys/dev/qlxgb/qla_hw.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_hw.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2012 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -711,20 +711,18 @@ qla_config_ipv4_addr(qla_host_t *ha, uin * Ring Structure are plugged in. */ static int -qla_tx_tso(qla_host_t *ha, struct mbuf *mp, q80_tx_cmd_t *tx_cmd) +qla_tx_tso(qla_host_t *ha, struct mbuf *mp, q80_tx_cmd_t *tx_cmd, uint8_t *hdr) { struct ether_vlan_header *eh; struct ip *ip = NULL; struct tcphdr *th = NULL; - uint32_t ehdrlen, hdrlen, ip_hlen, tcp_hlen; + uint32_t ehdrlen, hdrlen = 0, ip_hlen, tcp_hlen, tcp_opt_off; uint16_t etype, opcode, offload = 1; + uint8_t *tcp_opt; device_t dev; dev = ha->pci_dev; - if (mp->m_pkthdr.len <= ha->max_frame_size) - return (-1); - eh = mtod(mp, struct ether_vlan_header *); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { @@ -737,14 +735,26 @@ qla_tx_tso(qla_host_t *ha, struct mbuf * switch (etype) { case ETHERTYPE_IP: - ip = (struct ip *)(mp->m_data + ehdrlen); + + tcp_opt_off = ehdrlen + sizeof(struct ip) + + sizeof(struct tcphdr); + + if (mp->m_len < tcp_opt_off) { + m_copydata(mp, 0, tcp_opt_off, hdr); + ip = (struct ip *)hdr; + } else { + ip = (struct ip *)(mp->m_data + ehdrlen); + } + ip_hlen = ip->ip_hl << 2; opcode = Q8_TX_CMD_OP_XMT_TCP_LSO; - if (ip->ip_p != IPPROTO_TCP) { + if ((ip->ip_p != IPPROTO_TCP) || + (ip_hlen != sizeof (struct ip))) { offload = 0; - } else + } else { th = (struct tcphdr *)((caddr_t)ip + ip_hlen); + } break; default: @@ -758,11 +768,43 @@ qla_tx_tso(qla_host_t *ha, struct mbuf * tcp_hlen = th->th_off << 2; + hdrlen = ehdrlen + ip_hlen + tcp_hlen; if (mp->m_len < hdrlen) { - device_printf(dev, "%s: (mp->m_len < hdrlen)\n", __func__); - return (-1); + if (mp->m_len < tcp_opt_off) { + if (tcp_hlen > sizeof(struct tcphdr)) { + m_copydata(mp, tcp_opt_off, + (tcp_hlen - sizeof(struct tcphdr)), + &hdr[tcp_opt_off]); + } + } else { + m_copydata(mp, 0, hdrlen, hdr); + } + } + + if ((mp->m_pkthdr.csum_flags & CSUM_TSO) == 0) { + + /* If TCP options are preset only time stamp option is supported */ + if ((tcp_hlen - sizeof(struct tcphdr)) != 10) + return -1; + else { + + if (mp->m_len < hdrlen) { + tcp_opt = &hdr[tcp_opt_off]; + } else { + tcp_opt = (uint8_t *)(mp->m_data + tcp_opt_off); + } + + if ((*tcp_opt != 0x01) || (*(tcp_opt + 1) != 0x01) || + (*(tcp_opt + 2) != 0x08) || (*(tcp_opt + 2) != 10)) { + return -1; + } + } + + tx_cmd->mss = ha->max_frame_size - ETHER_CRC_LEN - hdrlen; + } else { + tx_cmd->mss = mp->m_pkthdr.tso_segsz; } tx_cmd->flags_opcode = opcode ; @@ -776,6 +818,10 @@ qla_tx_tso(qla_host_t *ha, struct mbuf * tx_cmd->flags_opcode = Q8_TX_CMD_FLAGS_MULTICAST; } + if (mp->m_len < hdrlen) { + return (1); + } + return (0); } @@ -815,7 +861,7 @@ qla_tx_chksum(qla_host_t *ha, struct mbu case ETHERTYPE_IP: ip = (struct ip *)(mp->m_data + ehdrlen); - ip_hlen = ip->ip_hl << 2; + ip_hlen = sizeof (struct ip); if (mp->m_len < (ehdrlen + ip_hlen)) { device_printf(dev, "%s: ipv4 mlen\n", __func__); @@ -886,7 +932,8 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm uint32_t num_tx_cmds, hdr_len = 0; uint32_t total_length = 0, bytes, tx_cmd_count = 0; device_t dev; - int i; + int i, ret; + uint8_t *src = NULL, *dst = NULL; dev = ha->pci_dev; @@ -902,26 +949,36 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm __func__, total_length); return (-1); } + eh = mtod(mp, struct ether_vlan_header *); - bzero((void *)&tso_cmd, sizeof(q80_tx_cmd_t)); + if ((mp->m_pkthdr.len > ha->max_frame_size)||(nsegs > Q8_TX_MAX_SEGMENTS)) { - if (qla_tx_tso(ha, mp, &tso_cmd) == 0) { - /* find the additional tx_cmd descriptors required */ + bzero((void *)&tso_cmd, sizeof(q80_tx_cmd_t)); - hdr_len = tso_cmd.total_hdr_len; + src = ha->hw.frame_hdr; + ret = qla_tx_tso(ha, mp, &tso_cmd, src); - bytes = sizeof(q80_tx_cmd_t) - Q8_TX_CMD_TSO_ALIGN; - bytes = QL_MIN(bytes, hdr_len); + if (!(ret & ~1)) { + /* find the additional tx_cmd descriptors required */ - num_tx_cmds++; - hdr_len -= bytes; + hdr_len = tso_cmd.total_hdr_len; - while (hdr_len) { - bytes = QL_MIN((sizeof(q80_tx_cmd_t)), hdr_len); - hdr_len -= bytes; + bytes = sizeof(q80_tx_cmd_t) - Q8_TX_CMD_TSO_ALIGN; + bytes = QL_MIN(bytes, hdr_len); + num_tx_cmds++; + hdr_len -= bytes; + + while (hdr_len) { + bytes = QL_MIN((sizeof(q80_tx_cmd_t)), hdr_len); + hdr_len -= bytes; + num_tx_cmds++; + } + hdr_len = tso_cmd.total_hdr_len; + + if (ret == 0) + src = (uint8_t *)eh; } - hdr_len = tso_cmd.total_hdr_len; } if (hw->txr_free <= (num_tx_cmds + QLA_TX_MIN_FREE)) { @@ -957,7 +1014,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm bcopy(&tso_cmd, tx_cmd, sizeof(q80_tx_cmd_t)); } - eh = mtod(mp, struct ether_vlan_header *); if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) tx_cmd->flags_opcode |= Q8_TX_CMD_FLAGS_VLAN_TAGGED; else if (mp->m_flags & M_VLANTAG) { @@ -1015,9 +1071,6 @@ qla_hw_send(qla_host_t *ha, bus_dma_segm if (hdr_len) { /* TSO : Copy the header in the following tx cmd descriptors */ - uint8_t *src, *dst; - - src = (uint8_t *)eh; tx_cmd = &hw->tx_ring_base[hw->txr_next]; bzero((void *)tx_cmd, sizeof(q80_tx_cmd_t)); @@ -1704,6 +1757,7 @@ void qla_update_link_state(qla_host_t *ha) { uint32_t link_state; + uint32_t prev_link_state; if (!(ha->ifp->if_drv_flags & IFF_DRV_RUNNING)) { ha->hw.flags.link_up = 0; @@ -1711,10 +1765,20 @@ qla_update_link_state(qla_host_t *ha) } link_state = READ_REG32(ha, Q8_LINK_STATE); - if (ha->pci_func == 0) + prev_link_state = ha->hw.flags.link_up; + + if (ha->pci_func == 0) ha->hw.flags.link_up = (((link_state & 0xF) == 1)? 1 : 0); else ha->hw.flags.link_up = ((((link_state >> 4)& 0xF) == 1)? 1 : 0); + + if (prev_link_state != ha->hw.flags.link_up) { + if (ha->hw.flags.link_up) { + if_link_state_change(ha->ifp, LINK_STATE_UP); + } else { + if_link_state_change(ha->ifp, LINK_STATE_DOWN); + } + } } int Modified: head/sys/dev/qlxgb/qla_hw.h ============================================================================== --- head/sys/dev/qlxgb/qla_hw.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_hw.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -724,6 +724,8 @@ typedef struct _qla_sds { volatile uint32_t rcv_active; } qla_sds_t; +#define QL_FRAME_HDR_SIZE (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN +\ + sizeof (struct ip) + sizeof (struct tcphdr) + 16) /* * struct for storing hardware specific information for a given interface */ @@ -791,6 +793,8 @@ typedef struct _qla_hw { bus_addr_t rx_cntxt_rsp_paddr; qla_sds_t sds[MAX_SDS_RINGS]; + + uint8_t frame_hdr[QL_FRAME_HDR_SIZE]; } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, i, val) \ Modified: head/sys/dev/qlxgb/qla_inline.h ============================================================================== --- head/sys/dev/qlxgb/qla_inline.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_inline.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_ioctl.c ============================================================================== --- head/sys/dev/qlxgb/qla_ioctl.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_ioctl.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -82,10 +82,15 @@ qla_eioctl(struct cdev *dev, u_long cmd, int rval = 0; qla_reg_val_t *rv; qla_rd_flash_t *rdf; + qla_wr_flash_t *wrf; + qla_rd_pci_ids_t *pci_ids; + device_t pci_dev; if ((ha = (qla_host_t *)dev->si_drv1) == NULL) return ENXIO; + pci_dev= ha->pci_dev; + switch(cmd) { case QLA_RDWR_REG: @@ -110,6 +115,30 @@ qla_eioctl(struct cdev *dev, u_long cmd, if ((rval = qla_rd_flash32(ha, rdf->off, &rdf->data))) rval = ENXIO; break; + + case QLA_WR_FLASH: + wrf = (qla_wr_flash_t *)data; + if ((rval = qla_wr_flash_buffer(ha, wrf->off, wrf->size, + wrf->buffer, wrf->pattern))) + rval = ENXIO; + break; + + + case QLA_ERASE_FLASH: + if (qla_erase_flash(ha, ((qla_erase_flash_t *)data)->off, + ((qla_erase_flash_t *)data)->size)) + rval = ENXIO; + break; + + case QLA_RD_PCI_IDS: + pci_ids = (qla_rd_pci_ids_t *)data; + pci_ids->ven_id = pci_get_vendor(pci_dev); + pci_ids->dev_id = pci_get_device(pci_dev); + pci_ids->subsys_ven_id = pci_get_subvendor(pci_dev); + pci_ids->subsys_dev_id = pci_get_subdevice(pci_dev); + pci_ids->rev_id = pci_read_config(pci_dev, PCIR_REVID, 1); + break; + default: break; } Modified: head/sys/dev/qlxgb/qla_ioctl.h ============================================================================== --- head/sys/dev/qlxgb/qla_ioctl.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_ioctl.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,28 @@ struct qla_rd_flash { }; typedef struct qla_rd_flash qla_rd_flash_t; +struct qla_wr_flash { + uint32_t off; + uint32_t size; + void *buffer; + uint32_t pattern; +}; +typedef struct qla_wr_flash qla_wr_flash_t; + +struct qla_erase_flash { + uint32_t off; + uint32_t size; +}; +typedef struct qla_erase_flash qla_erase_flash_t; + +struct qla_rd_pci_ids { + uint16_t ven_id; + uint16_t dev_id; + uint16_t subsys_ven_id; + uint16_t subsys_dev_id; + uint8_t rev_id; +}; +typedef struct qla_rd_pci_ids qla_rd_pci_ids_t; /* * Read/Write Register @@ -61,4 +83,19 @@ typedef struct qla_rd_flash qla_rd_flash */ #define QLA_RD_FLASH _IOWR('q', 2, qla_rd_flash_t) +/* + * Write Flash + */ +#define QLA_WR_FLASH _IOWR('q', 3, qla_wr_flash_t) + +/* + * Erase Flash + */ +#define QLA_ERASE_FLASH _IOWR('q', 5, qla_erase_flash_t) + +/* + * Read PCI IDs + */ +#define QLA_RD_PCI_IDS _IOWR('q', 6, qla_rd_pci_ids_t) + #endif /* #ifndef _QLA_IOCTL_H_ */ Modified: head/sys/dev/qlxgb/qla_isr.c ============================================================================== --- head/sys/dev/qlxgb/qla_isr.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_isr.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_misc.c ============================================================================== --- head/sys/dev/qlxgb/qla_misc.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_misc.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -344,6 +344,17 @@ qla_rd_flash32(qla_host_t *ha, uint32_t return 0; } +static int +qla_p3p_sem_lock2(qla_host_t *ha) +{ + if (qla_sem_lock(ha, Q8_SEM2_LOCK, 0, 0)) { + device_printf(ha->pci_dev, "%s: SEM2_LOCK failed\n", __func__); + return (-1); + } + WRITE_OFFSET32(ha, Q8_ROM_LOCKID, 0xa5a5a5a5); + return (0); +} + /* * Name: qla_int_to_pci_addr_map * Function: Convert's Internal(CRB) Address to Indirect Address @@ -402,7 +413,7 @@ qla_filter_pci_addr(qla_host_t *ha, uint static int qla_crb_init(qla_host_t *ha) { - uint32_t val, sig; + uint32_t val = 0, sig = 0; uint32_t offset, count, i; addr_val_t *addr_val_map, *avmap; @@ -611,6 +622,21 @@ qla_init_hw(qla_host_t *ha) if (val != CMDPEG_PHAN_INIT_COMPLETE) { ret = qla_init_from_flash(ha); qla_mdelay(__func__, 100); + } else { + ha->fw_ver_major = READ_OFFSET32(ha, Q8_FW_VER_MAJOR); + ha->fw_ver_minor = READ_OFFSET32(ha, Q8_FW_VER_MINOR); + ha->fw_ver_sub = READ_OFFSET32(ha, Q8_FW_VER_SUB); + + if (qla_rd_flash32(ha, 0x100004, &val) == 0) { + + if (((val & 0xFF) != ha->fw_ver_major) || + (((val >> 8) & 0xFF) != ha->fw_ver_minor) || + (((val >> 16) & 0xFF) != ha->fw_ver_sub)) { + + ret = qla_init_from_flash(ha); + qla_mdelay(__func__, 100); + } + } } qla_init_exit: @@ -622,3 +648,403 @@ qla_init_exit: return (ret); } +static int +qla_wait_for_flash_busy(qla_host_t *ha) +{ + uint32_t count = 100; + uint32_t val; + + QLA_USEC_DELAY(100); + + while (count--) { + val = READ_OFFSET32(ha, Q8_ROM_STATUS); + + if (val & BIT_1) + return 0; + qla_mdelay(__func__, 1); + } + return -1; +} + +static int +qla_flash_write_enable(qla_host_t *ha) +{ + uint32_t val, rval; + + val = 0; + qla_rdwr_indreg32(ha, Q8_ROM_ADDR_BYTE_COUNT, &val, 0); + + val = ROM_OPCODE_WR_ENABLE; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) + device_printf(ha->pci_dev, "%s: failed \n", __func__); + + return (rval); +} + +static int +qla_flash_unprotect(qla_host_t *ha) +{ + uint32_t val, rval; + + if (qla_flash_write_enable(ha) != 0) + return(-1); + + val = 0; + qla_rdwr_indreg32(ha, Q8_ROM_WR_DATA, &val, 0); + + val = ROM_OPCODE_WR_STATUS_REG; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) { + device_printf(ha->pci_dev, "%s: failed \n", __func__); + return rval; + } + + if (qla_flash_write_enable(ha) != 0) + return(-1); + + val = 0; + qla_rdwr_indreg32(ha, Q8_ROM_WR_DATA, &val, 0); + + val = ROM_OPCODE_WR_STATUS_REG; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) + device_printf(ha->pci_dev, "%s: failed \n", __func__); + + return rval; +} + +static int +qla_flash_protect(qla_host_t *ha) +{ + uint32_t val, rval; + + if (qla_flash_write_enable(ha) != 0) + return(-1); + + val = 0x9C; + qla_rdwr_indreg32(ha, Q8_ROM_WR_DATA, &val, 0); + + val = ROM_OPCODE_WR_STATUS_REG; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) + device_printf(ha->pci_dev, "%s: failed \n", __func__); + + return rval; +} + +static uint32_t +qla_flash_get_status(qla_host_t *ha) +{ + uint32_t count = 1000; + uint32_t val, rval; + + while (count--) { + val = 0; + qla_rdwr_indreg32(ha, Q8_ROM_ADDR_BYTE_COUNT, &val, 0); + + val = ROM_OPCODE_RD_STATUS_REG; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval == 0) { + qla_rdwr_indreg32(ha, Q8_ROM_RD_DATA, &val, 1); + + if ((val & BIT_0) == 0) + return (val); + } + qla_mdelay(__func__, 1); + } + return -1; +} + +static int +qla_wait_for_flash_unprotect(qla_host_t *ha) +{ + uint32_t delay = 1000; + + while (delay--) { + + if (qla_flash_get_status(ha) == 0) + return 0; + + qla_mdelay(__func__, 1); + } + + return -1; +} + +static int +qla_wait_for_flash_protect(qla_host_t *ha) +{ + uint32_t delay = 1000; + + while (delay--) { + + if (qla_flash_get_status(ha) == 0x9C) + return 0; + + qla_mdelay(__func__, 1); + } + + return -1; +} + +static int +qla_erase_flash_sector(qla_host_t *ha, uint32_t start) +{ + uint32_t val; + int rval; + + if (qla_flash_write_enable(ha) != 0) + return(-1); + + val = start; + qla_rdwr_indreg32(ha, Q8_ROM_ADDRESS, &val, 0); + + val = 3; + qla_rdwr_indreg32(ha, Q8_ROM_ADDR_BYTE_COUNT, &val, 0); + + val = ROM_OPCODE_SECTOR_ERASE; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) + device_printf(ha->pci_dev, "%s: failed \n", __func__); + return rval; +} + +#define Q8_FLASH_SECTOR_SIZE 0x10000 +int +qla_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size) +{ + int rval = 0; + uint32_t start; + + if (off & (Q8_FLASH_SECTOR_SIZE -1)) + return -1; + + if ((rval = qla_p3p_sem_lock2(ha))) + goto qla_erase_flash_exit; + + if ((rval = qla_flash_unprotect(ha))) + goto qla_erase_flash_unlock_exit; + + if ((rval = qla_wait_for_flash_unprotect(ha))) + goto qla_erase_flash_unlock_exit; + + for (start = off; start < (off + size); start = start + 0x10000) { + if (qla_erase_flash_sector(ha, start)) { + rval = -1; + break; + } + } + + rval = qla_flash_protect(ha); + +qla_erase_flash_unlock_exit: + qla_sem_unlock(ha, Q8_SEM2_UNLOCK); + +qla_erase_flash_exit: + return (rval); +} + +static int +qla_flash_write32(qla_host_t *ha, uint32_t off, uint32_t data) +{ + uint32_t val; + int rval = 0; + + val = data; + qla_rdwr_indreg32(ha, Q8_ROM_WR_DATA, &val, 0); + + val = off; + qla_rdwr_indreg32(ha, Q8_ROM_ADDRESS, &val, 0); + + val = 3; + qla_rdwr_indreg32(ha, Q8_ROM_ADDR_BYTE_COUNT, &val, 0); + + val = ROM_OPCODE_PROG_PAGE; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + rval = qla_wait_for_flash_busy(ha); + + if (rval) + device_printf(ha->pci_dev, "%s: failed \n", __func__); + + return rval; +} + +static int +qla_flash_wait_for_write_complete(qla_host_t *ha) +{ + uint32_t val, count = 1000; + int rval = 0; + + while (count--) { + + val = 0; + qla_rdwr_indreg32(ha, Q8_ROM_ADDR_BYTE_COUNT, &val, 0); + + val = ROM_OPCODE_RD_STATUS_REG; + qla_rdwr_indreg32(ha, Q8_ROM_INSTR_OPCODE, &val, 0); + + + rval = qla_wait_for_flash_busy(ha); + + if (rval == 0) { + qla_rdwr_indreg32(ha, Q8_ROM_RD_DATA, &val, 1); + + if ((val & BIT_0) == 0) + return (0); + } + qla_mdelay(__func__, 1); + } + return -1; +} + +static int +qla_flash_write(qla_host_t *ha, uint32_t off, uint32_t data) +{ + if (qla_flash_write_enable(ha) != 0) + return(-1); + + if (qla_flash_write32(ha, off, data) != 0) + return -1; + + if (qla_flash_wait_for_write_complete(ha)) + return -1; + + return 0; +} + + +static int +qla_flash_write_pattern(qla_host_t *ha, uint32_t off, uint32_t size, + uint32_t pattern) +{ + int rval = 0; + uint32_t start; + + + if ((rval = qla_p3p_sem_lock2(ha))) + goto qla_wr_pattern_exit; + + if ((rval = qla_flash_unprotect(ha))) + goto qla_wr_pattern_unlock_exit; + + if ((rval = qla_wait_for_flash_unprotect(ha))) + goto qla_wr_pattern_unlock_exit; + + for (start = off; start < (off + size); start = start + 4) { + if (qla_flash_write(ha, start, pattern)) { + rval = -1; + break; + } + } + + rval = qla_flash_protect(ha); + + if (rval == 0) + rval = qla_wait_for_flash_protect(ha); + +qla_wr_pattern_unlock_exit: + qla_sem_unlock(ha, Q8_SEM2_UNLOCK); + +qla_wr_pattern_exit: + return (rval); +} + +static int +qla_flash_write_data(qla_host_t *ha, uint32_t off, uint32_t size, + void *data) +{ + int rval = 0; + uint32_t start; + uint32_t *data32 = data; + + + if ((rval = qla_p3p_sem_lock2(ha))) + goto qla_wr_pattern_exit; + + if ((rval = qla_flash_unprotect(ha))) + goto qla_wr_pattern_unlock_exit; + + if ((rval = qla_wait_for_flash_unprotect(ha))) + goto qla_wr_pattern_unlock_exit; + + for (start = off; start < (off + size); start = start + 4) { + + if (*data32 != 0xFFFFFFFF) { + if (qla_flash_write(ha, start, *data32)) { + rval = -1; + break; + } + } + data32++; + } + + rval = qla_flash_protect(ha); + + if (rval == 0) + rval = qla_wait_for_flash_protect(ha); + +qla_wr_pattern_unlock_exit: + qla_sem_unlock(ha, Q8_SEM2_UNLOCK); + +qla_wr_pattern_exit: + return (rval); +} + +int +qla_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size, void *buf, + uint32_t pattern) +{ + int rval = 0; + void *data; + + + if (size == 0) + return 0; + + size = size << 2; + + if (buf == NULL) { + rval = qla_flash_write_pattern(ha, off, size, pattern); + return (rval); + } + + if ((data = malloc(size, M_QLA8XXXBUF, M_NOWAIT)) == NULL) { + device_printf(ha->pci_dev, "%s: malloc failed \n", __func__); + rval = -1; + goto qla_wr_flash_buffer_exit; + } + + if ((rval = copyin(buf, data, size))) { + device_printf(ha->pci_dev, "%s copyin failed\n", __func__); + goto qla_wr_flash_buffer_free_exit; + } + + rval = qla_flash_write_data(ha, off, size, data); + +qla_wr_flash_buffer_free_exit: + free(data, M_QLA8XXXBUF); + +qla_wr_flash_buffer_exit: + return (rval); +} + Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_os.c Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -154,6 +154,11 @@ qla_add_sysctls(qla_host_t *ha) (void *)ha, 0, qla_sysctl_get_stats, "I", "Statistics"); + SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLFLAG_RD, + &ha->fw_ver_str, 0, "firmware version"); + dbg_level = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -347,6 +352,10 @@ qla_pci_attach(device_t dev) ha->fw_ver_major, ha->fw_ver_minor, ha->fw_ver_sub, ha->fw_ver_build); + snprintf(ha->fw_ver_str, sizeof(ha->fw_ver_str), "%d.%d.%d.%d", + ha->fw_ver_major, ha->fw_ver_minor, ha->fw_ver_sub, + ha->fw_ver_build); + //qla_get_hw_caps(ha); qla_read_mac_addr(ha); @@ -660,6 +669,7 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + ifp->if_mtu = ETHERMTU; ifp->if_baudrate = (1 * 1000 * 1000 *1000); ifp->if_init = qla_init; ifp->if_softc = ha; Modified: head/sys/dev/qlxgb/qla_os.h ============================================================================== --- head/sys/dev/qlxgb/qla_os.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_os.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/qlxgb/qla_reg.h ============================================================================== --- head/sys/dev/qlxgb/qla_reg.h Tue May 7 22:49:56 2013 (r250339) +++ head/sys/dev/qlxgb/qla_reg.h Tue May 7 22:58:42 2013 (r250340) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2011 Qlogic Corporation + * Copyright (c) 2011-2013 Qlogic Corporation * All rights reserved. * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 8 00:20:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45B36BC; Wed, 8 May 2013 00:20:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3861EA3B; Wed, 8 May 2013 00:20:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r480Kavi042819; Wed, 8 May 2013 00:20:36 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r480KaIG042818; Wed, 8 May 2013 00:20:36 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201305080020.r480KaIG042818@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 May 2013 00:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250341 - head/sys/contrib/dev/acpica/components/namespace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 00:20:36 -0000 Author: jkim Date: Wed May 8 00:20:35 2013 New Revision: 250341 URL: http://svnweb.freebsd.org/changeset/base/250341 Log: MFV: r250336 Fix for _INI regression introduced in version 20130328. Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/dev/acpica/components/namespace/ (props changed) Modified: head/sys/contrib/dev/acpica/components/namespace/nsinit.c ============================================================================== --- head/sys/contrib/dev/acpica/components/namespace/nsinit.c Tue May 7 22:58:42 2013 (r250340) +++ head/sys/contrib/dev/acpica/components/namespace/nsinit.c Wed May 8 00:20:35 2013 (r250341) @@ -609,6 +609,7 @@ AcpiNsInitOneDevice ( ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname ( ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI)); + ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); Info->PrefixNode = DeviceNode; Info->RelativePathname = METHOD_NAME__INI; Info->Parameters = NULL; From owner-svn-src-all@FreeBSD.ORG Wed May 8 00:55:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 56055560; Wed, 8 May 2013 00:55:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7F7B47; Wed, 8 May 2013 00:55:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r480tUfZ053991; Wed, 8 May 2013 00:55:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r480tTxY053988; Wed, 8 May 2013 00:55:29 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305080055.r480tTxY053988@svn.freebsd.org> From: Ed Maste Date: Wed, 8 May 2013 00:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250342 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 00:55:30 -0000 Author: emaste Date: Wed May 8 00:55:29 2013 New Revision: 250342 URL: http://svnweb.freebsd.org/changeset/base/250342 Log: Add libusb_get_port_path wrapper This follows the libusbx API reference at http://libusbx.sourceforge.net/api-1.0/group__dev.html Reviewed by: hselasky@ Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Wed May 8 00:20:35 2013 (r250341) +++ head/lib/libusb/libusb.3 Wed May 8 00:55:29 2013 (r250342) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 7, 2012 +.Dd May 7, 2013 .Dt LIBUSB 3 .Os .Sh NAME @@ -102,6 +102,15 @@ counter decremented once. Returns the number of the bus contained by the device .Fa dev . .Pp +.Ft int +.Fn libusb_get_port_path "libusb_context *ctx" "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" +Stores, in the buffer +.Fa buf +of size +.Fa bufsize , +the list of all port numbers from root for the device +.Fa dev . +.Pp .Ft uint8_t .Fn libusb_get_device_address "libusb_device *dev" Returns the device_address contained by the device Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Wed May 8 00:20:35 2013 (r250341) +++ head/lib/libusb/libusb.h Wed May 8 00:55:29 2013 (r250342) @@ -369,6 +369,7 @@ void libusb_exit(struct libusb_context * ssize_t libusb_get_device_list(libusb_context * ctx, libusb_device *** list); void libusb_free_device_list(libusb_device ** list, int unref_devices); uint8_t libusb_get_bus_number(libusb_device * dev); +int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, uint8_t bufsize); uint8_t libusb_get_device_address(libusb_device * dev); enum libusb_speed libusb_get_device_speed(libusb_device * dev); int libusb_clear_halt(libusb_device_handle *devh, uint8_t endpoint); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Wed May 8 00:20:35 2013 (r250341) +++ head/lib/libusb/libusb10.c Wed May 8 00:55:29 2013 (r250342) @@ -290,6 +290,13 @@ libusb_get_bus_number(libusb_device *dev return (libusb20_dev_get_bus_number(dev->os_priv)); } +int +libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *buf, + uint8_t bufsize) +{ + return (libusb20_dev_get_port_path(dev->os_priv, buf, bufsize)); +} + uint8_t libusb_get_device_address(libusb_device *dev) { From owner-svn-src-all@FreeBSD.ORG Wed May 8 01:11:27 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 211C6B14; Wed, 8 May 2013 01:11:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 135E0BF7; Wed, 8 May 2013 01:11:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r481BQni060853; Wed, 8 May 2013 01:11:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r481BPRn060841; Wed, 8 May 2013 01:11:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305080111.r481BPRn060841@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 01:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250346 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 01:11:27 -0000 Author: adrian Date: Wed May 8 01:11:25 2013 New Revision: 250346 URL: http://svnweb.freebsd.org/changeset/base/250346 Log: Implement STBC receive frame statistics. The AR9280 and later can receive STBC. This adds some statistics tracking to count these frames. A patch to athstats will be forthcoming. Modified: head/sys/dev/ath/ath_hal/ah_desc.h head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h head/sys/dev/ath/if_ath_rx.c head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/ath_hal/ah_desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_desc.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ah_desc.h Wed May 8 01:11:25 2013 (r250346) @@ -155,6 +155,7 @@ struct ath_rx_status { #define HAL_RX_DECRYPT_BUSY 0x0040 /* decrypt was too slow */ #define HAL_RX_HI_RX_CHAIN 0x0080 /* SM power save: hi Rx chain control */ #define HAL_RX_IS_APSD 0x0100 /* Is ASPD trigger frame */ +#define HAL_RX_STBC 0x0200 /* Is an STBC frame */ enum { HAL_PHYERR_UNDERRUN = 0, /* Transmit underrun */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c Wed May 8 01:11:25 2013 (r250346) @@ -209,6 +209,14 @@ ar5416ProcRxDesc(struct ath_hal *ah, str if (ads->ds_rxstatus3 & AR_2040) rs->rs_flags |= HAL_RX_2040; + /* + * Only the AR9280 and later chips support STBC RX, so + * ensure we only set this bit for those chips. + */ + if (AR_SREV_MERLIN_10_OR_LATER(ah) + && ads->ds_rxstatus3 & AR_STBCFrame) + rs->rs_flags |= HAL_RX_STBC; + if (ads->ds_rxstatus8 & AR_PreDelimCRCErr) rs->rs_flags |= HAL_RX_DELIM_CRC_PRE; if (ads->ds_rxstatus8 & AR_PostDelimCRCErr) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416desc.h Wed May 8 01:11:25 2013 (r250346) @@ -357,6 +357,7 @@ struct ar5416_desc { #define AR_RxStatusRsvd30 0xfffff800 /* Owl 2.x only */ #define AR_DupFrame 0x00000004 +#define AR_STBCFrame 0x00000008 #define AR_RxAntenna 0xffffff00 #define AR_RxAntenna_S 8 Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_ath_rx.c Wed May 8 01:11:25 2013 (r250346) @@ -545,6 +545,8 @@ ath_rx_pkt(struct ath_softc *sc, struct sc->sc_stats.ast_rx_decrypt_busy_err++; if (rs->rs_flags & HAL_RX_HI_RX_CHAIN) sc->sc_stats.ast_rx_hi_rx_chain++; + if (rs->rs_flags & HAL_RX_STBC) + sc->sc_stats.ast_rx_stbc++; #endif /* AH_SUPPORT_AR5416 */ if (rs->rs_status != 0) { Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_ath_sysctl.c Wed May 8 01:11:25 2013 (r250346) @@ -1076,6 +1076,9 @@ ath_sysctl_stats_attach(struct ath_softc &sc->sc_stats.ast_rx_keymiss, 0, ""); SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_swfiltered", CTLFLAG_RD, &sc->sc_stats.ast_tx_swfiltered, 0, ""); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_stbc", + CTLFLAG_RD, &sc->sc_stats.ast_rx_stbc, 0, + "Number of STBC frames received"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Wed May 8 01:03:41 2013 (r250345) +++ head/sys/dev/ath/if_athioctl.h Wed May 8 01:11:25 2013 (r250346) @@ -163,9 +163,9 @@ struct ath_stats { u_int32_t ast_tx_mcastq_overflow; /* multicast queue overflow */ u_int32_t ast_rx_keymiss; u_int32_t ast_tx_swfiltered; + u_int32_t ast_rx_stbc; /* RX STBC frame */ u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ - - u_int32_t ast_pad[14]; + u_int32_t ast_pad[13]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-all@FreeBSD.ORG Wed May 8 03:21:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 023FCA7A; Wed, 8 May 2013 03:21:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) by mx1.freebsd.org (Postfix) with ESMTP id 06BD4122; Wed, 8 May 2013 03:21:07 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id h11so4759171wiv.2 for ; Tue, 07 May 2013 20:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=3lIliZfZRZ1aCSDsklnavQDAKIL0SD17rl1GJJym7j0=; b=lvMJLDtpLGYKY3HH3MrxvDtsOLKZXHmYO935biO5G1oTEWtYJDu4LmXSHFj8p4q5YG VolP/+kAw9q37IopOks3toKl3UfUoIV/TkFTrBDWG15eO0a2USSgUhme3MgmKH1Fbh4o ZilBnrbpVeuLOIZCvp2bKDTsTfh+MQu7sylKQ2dHBw2IOtbBCsqM3PbZKKHiU5q4w5Ja Z4UODZodSZLuxritjSTcliOjucoxOHDguFvkahC09RqJYPar9J8sZty47MwQ9obs/k1E p3AK4+OpJbeNnFa3Mm6dUOpFA5AOTjSM3FdRsIgubMh+FIAn3UOrtYiB2o2hSgghX0DH PiGQ== MIME-Version: 1.0 X-Received: by 10.180.212.3 with SMTP id ng3mr7121136wic.22.1367983267074; Tue, 07 May 2013 20:21:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Tue, 7 May 2013 20:21:06 -0700 (PDT) In-Reply-To: <201305072246.r47MkPUH009225@svn.freebsd.org> References: <201305072246.r47MkPUH009225@svn.freebsd.org> Date: Tue, 7 May 2013 20:21:06 -0700 X-Google-Sender-Auth: AzRZkmcToH8LzffEL6O6c1l7F5c Message-ID: Subject: Re: svn commit: r250338 - in head/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include vm x86/acpica From: Adrian Chadd To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 03:21:09 -0000 Hi, This broke a fresh buildworld for me. sys/vm/vm_phys.c still references VM_NDOMAIN. Thanks, Adrian On 7 May 2013 15:46, Attilio Rao wrote: > Author: attilio > Date: Tue May 7 22:46:24 2013 > New Revision: 250338 > URL: http://svnweb.freebsd.org/changeset/base/250338 > > Log: > Rename VM_NDOMAIN into MAXMEMDOM and move it into machine/param.h in > order to match the MAXCPU concept. The change should also be useful > for consolidation and consistency. > > Sponsored by: EMC / Isilon storage division > Obtained from: jeff > Reviewed by: alc > > Modified: > head/sys/amd64/include/param.h > head/sys/amd64/include/vmparam.h > head/sys/arm/include/param.h > head/sys/arm/include/vmparam.h > head/sys/conf/NOTES > head/sys/conf/options > head/sys/i386/include/param.h > head/sys/i386/include/vmparam.h > head/sys/ia64/include/param.h > head/sys/ia64/include/vmparam.h > head/sys/mips/include/param.h > head/sys/mips/include/vmparam.h > head/sys/powerpc/include/param.h > head/sys/powerpc/include/vmparam.h > head/sys/sparc64/include/param.h > head/sys/sparc64/include/vmparam.h > head/sys/vm/vm_phys.c > head/sys/x86/acpica/srat.c > > Modified: head/sys/amd64/include/param.h > ============================================================================== > --- head/sys/amd64/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/amd64/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -71,6 +71,10 @@ > #define MAXCPU 1 > #endif > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define ALIGNBYTES _ALIGNBYTES > #define ALIGN(p) _ALIGN(p) > /* > > Modified: head/sys/amd64/include/vmparam.h > ============================================================================== > --- head/sys/amd64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/amd64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -121,13 +121,6 @@ > #define VM_NFREEORDER 13 > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Enable superpage reservations: 1 level. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/arm/include/param.h > ============================================================================== > --- head/sys/arm/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/arm/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -80,6 +80,10 @@ > #define MAXCPU 1 > #endif /* SMP || KLD_MODULE */ > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define ALIGNBYTES _ALIGNBYTES > #define ALIGN(p) _ALIGN(p) > /* > > Modified: head/sys/arm/include/vmparam.h > ============================================================================== > --- head/sys/arm/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/arm/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -109,13 +109,6 @@ > #define VM_NFREEORDER 9 > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Disable superpage reservations. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/conf/NOTES Tue May 7 22:46:24 2013 (r250338) > @@ -224,6 +224,10 @@ options SMP # Symmetric MultiProcesso > # A default value should be already present, for every architecture. > options MAXCPU=32 > > +# MAXMEMDOM defines the maximum number of memory domains that can boot in the > +# system. A default value should already be defined by every architecture. > +options MAXMEMDOM=1 > + > # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin > # if the thread that currently owns the mutex is executing on another > # CPU. This behavior is enabled by default, so this option can be used > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/conf/options Tue May 7 22:46:24 2013 (r250338) > @@ -568,6 +568,7 @@ DIAGNOSTIC opt_global.h > INVARIANT_SUPPORT opt_global.h > INVARIANTS opt_global.h > MAXCPU opt_global.h > +MAXMEMDOM opt_global.h > MAXPHYS opt_global.h > MCLSHIFT opt_global.h > MUTEX_DEBUG opt_global.h > @@ -584,7 +585,6 @@ VFS_BIO_DEBUG opt_global.h > VM_KMEM_SIZE opt_vm.h > VM_KMEM_SIZE_SCALE opt_vm.h > VM_KMEM_SIZE_MAX opt_vm.h > -VM_NDOMAIN opt_vm.h > VM_NRESERVLEVEL opt_vm.h > VM_LEVEL_0_ORDER opt_vm.h > NO_SWAPPING opt_vm.h > > Modified: head/sys/i386/include/param.h > ============================================================================== > --- head/sys/i386/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/i386/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -64,6 +64,10 @@ > #define MAXCPU 1 > #endif /* SMP || KLD_MODULE */ > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define ALIGNBYTES _ALIGNBYTES > #define ALIGN(p) _ALIGN(p) > /* > > Modified: head/sys/i386/include/vmparam.h > ============================================================================== > --- head/sys/i386/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/i386/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -107,13 +107,6 @@ > #endif > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Enable superpage reservations: 1 level. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/ia64/include/param.h > ============================================================================== > --- head/sys/ia64/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/ia64/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -69,6 +69,10 @@ > #define MAXCPU 1 > #endif > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define ALIGNBYTES _ALIGNBYTES > #define ALIGN(p) _ALIGN(p) > /* > > Modified: head/sys/ia64/include/vmparam.h > ============================================================================== > --- head/sys/ia64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/ia64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -103,13 +103,6 @@ > #define VM_NFREEORDER 16 > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Disable superpage reservations. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/mips/include/param.h > ============================================================================== > --- head/sys/mips/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/mips/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -101,6 +101,10 @@ > #define MAXCPU 1 > #endif > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > /* > * Round p (pointer or byte index) up to a correctly-aligned value for all > * data types (int, long, ...). The result is u_int and must be cast to > > Modified: head/sys/mips/include/vmparam.h > ============================================================================== > --- head/sys/mips/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/mips/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -101,13 +101,6 @@ > #endif > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Disable superpage reservations. (not sure if this is right > * I copied it from ARM) > */ > > Modified: head/sys/powerpc/include/param.h > ============================================================================== > --- head/sys/powerpc/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/powerpc/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -75,6 +75,10 @@ > #define MAXCPU 1 > #endif /* SMP || KLD_MODULE */ > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define ALIGNBYTES _ALIGNBYTES > #define ALIGN(p) _ALIGN(p) > /* > > Modified: head/sys/powerpc/include/vmparam.h > ============================================================================== > --- head/sys/powerpc/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/powerpc/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -163,13 +163,6 @@ struct pmap_physseg { > #define VM_NFREEORDER 11 > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Disable superpage reservations. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/sparc64/include/param.h > ============================================================================== > --- head/sys/sparc64/include/param.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/sparc64/include/param.h Tue May 7 22:46:24 2013 (r250338) > @@ -57,6 +57,10 @@ > #define MAXCPU 1 > #endif /* SMP || KLD_MODULE */ > > +#ifndef MAXMEMDOM > +#define MAXMEMDOM 1 > +#endif > + > #define INT_SHIFT 2 > #define PTR_SHIFT 3 > > > Modified: head/sys/sparc64/include/vmparam.h > ============================================================================== > --- head/sys/sparc64/include/vmparam.h Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/sparc64/include/vmparam.h Tue May 7 22:46:24 2013 (r250338) > @@ -106,13 +106,6 @@ > #define VM_NFREEORDER 12 > > /* > - * Only one memory domain. > - */ > -#ifndef VM_NDOMAIN > -#define VM_NDOMAIN 1 > -#endif > - > -/* > * Enable superpage reservations: 1 level. > */ > #ifndef VM_NRESERVLEVEL > > Modified: head/sys/vm/vm_phys.c > ============================================================================== > --- head/sys/vm/vm_phys.c Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/vm/vm_phys.c Tue May 7 22:46:24 2013 (r250338) > @@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$"); > #include > > /* > - * VM_FREELIST_DEFAULT is split into VM_NDOMAIN lists, one for each > + * VM_FREELIST_DEFAULT is split into MAXMEMDOM lists, one for each > * domain. These extra lists are stored at the end of the regular > * free lists starting with VM_NFREELIST. > */ > -#define VM_RAW_NFREELIST (VM_NFREELIST + VM_NDOMAIN - 1) > +#define VM_RAW_NFREELIST (VM_NFREELIST + MAXMEMDOM - 1) > > struct vm_freelist { > struct pglist pl; > @@ -100,7 +100,7 @@ MALLOC_DEFINE(M_FICT_PAGES, "", ""); > static struct vm_freelist > vm_phys_free_queues[VM_RAW_NFREELIST][VM_NFREEPOOL][VM_NFREEORDER]; > static struct vm_freelist > -(*vm_phys_lookup_lists[VM_NDOMAIN][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER]; > +(*vm_phys_lookup_lists[MAXMEMDOM][VM_RAW_NFREELIST])[VM_NFREEPOOL][VM_NFREEORDER]; > > static int vm_nfreelists = VM_FREELIST_DEFAULT + 1; > > @@ -116,7 +116,7 @@ static int sysctl_vm_phys_segs(SYSCTL_HA > SYSCTL_OID(_vm, OID_AUTO, phys_segs, CTLTYPE_STRING | CTLFLAG_RD, > NULL, 0, sysctl_vm_phys_segs, "A", "Phys Seg Info"); > > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > static int sysctl_vm_phys_lookup_lists(SYSCTL_HANDLER_ARGS); > SYSCTL_OID(_vm, OID_AUTO, phys_lookup_lists, CTLTYPE_STRING | CTLFLAG_RD, > NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); > @@ -200,7 +200,7 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) > return (error); > } > > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > /* > * Outputs the set of free list lookup lists. > */ > @@ -255,7 +255,7 @@ _vm_phys_create_seg(vm_paddr_t start, vm > #else > seg->first_page = PHYS_TO_VM_PAGE(start); > #endif > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > if (flind == VM_FREELIST_DEFAULT && domain != 0) { > flind = VM_NFREELIST + (domain - 1); > if (flind >= vm_nfreelists) > @@ -302,7 +302,7 @@ vm_phys_init(void) > { > struct vm_freelist *fl; > int flind, i, oind, pind; > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > int ndomains, j; > #endif > > @@ -347,7 +347,7 @@ vm_phys_init(void) > TAILQ_INIT(&fl[oind].pl); > } > } > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > /* > * Build a free list lookup list for each domain. All of the > * memory domain lists are inserted at the VM_FREELIST_DEFAULT > @@ -444,7 +444,7 @@ vm_phys_alloc_pages(int pool, int order) > KASSERT(order < VM_NFREEORDER, > ("vm_phys_alloc_pages: order %d is out of range", order)); > > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > domain = PCPU_GET(domain); > #else > domain = 0; > @@ -925,7 +925,7 @@ vm_phys_alloc_contig(u_long npages, vm_p > int domain, flind, oind, order, pind; > > mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > domain = PCPU_GET(domain); > #else > domain = 0; > > Modified: head/sys/x86/acpica/srat.c > ============================================================================== > --- head/sys/x86/acpica/srat.c Tue May 7 22:05:57 2013 (r250337) > +++ head/sys/x86/acpica/srat.c Tue May 7 22:46:24 2013 (r250338) > @@ -28,8 +28,6 @@ > #include > __FBSDID("$FreeBSD$"); > > -#include "opt_vm.h" > - > #include > #include > #include > @@ -47,7 +45,7 @@ __FBSDID("$FreeBSD$"); > > #include > > -#if VM_NDOMAIN > 1 > +#if MAXMEMDOM > 1 > struct cpu_info { > int enabled:1; > int has_memory:1; > @@ -265,7 +263,7 @@ renumber_domains(void) > domains[j] = domains[j - 1]; > domains[slot] = mem_info[i].domain; > ndomain++; > - if (ndomain > VM_NDOMAIN) { > + if (ndomain > MAXMEMDOM) { > printf("SRAT: Too many memory domains\n"); > return (EFBIG); > } > @@ -362,4 +360,4 @@ srat_set_cpus(void *dummy) > } > } > SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); > -#endif /* VM_NDOMAIN > 1 */ > +#endif /* MAXMEMDOM > 1 */ From owner-svn-src-all@FreeBSD.ORG Wed May 8 07:30:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0E43478; Wed, 8 May 2013 07:30:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 99F96AE1; Wed, 8 May 2013 07:30:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r487UYNH093674; Wed, 8 May 2013 07:30:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r487UXMc093672; Wed, 8 May 2013 07:30:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305080730.r487UXMc093672@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 07:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250355 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 07:30:34 -0000 Author: adrian Date: Wed May 8 07:30:33 2013 New Revision: 250355 URL: http://svnweb.freebsd.org/changeset/base/250355 Log: Revert a previous commit - this is causing hardware errors. I'm not sure why this is failing. The holding descriptor should be being re-read when starting DMA of the next frame. Obviously something here isn't totally correct. I'll review the TX queue handling and see if I can figure out why this is failing. I'll then re-revert this patch out and use the holding descriptor again. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 8 07:14:07 2013 (r250354) +++ head/sys/dev/ath/if_ath.c Wed May 8 07:30:33 2013 (r250355) @@ -4000,20 +4000,19 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); - - /* - * Always mark the last buffer in this list as busy. - * - * The hardware may re-read the holding descriptor - * even if we hit the end of the list and try writing - * a new TxDP. - * - * If there's no holding descriptor then this is the - * last buffer in the list of buffers after a fresh - * reset; it'll soon become the holding buffer. - */ - bf->bf_last->bf_flags |= ATH_BUF_BUSY; - + if (txq->axq_depth > 0) { + /* + * More frames follow. Mark the buffer busy + * so it's not re-used while the hardware may + * still re-read the link field in the descriptor. + * + * Use the last buffer in an aggregate as that + * is where the hardware may be - intermediate + * descriptors won't be "busy". + */ + bf->bf_last->bf_flags |= ATH_BUF_BUSY; + } else + txq->axq_link = NULL; if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed May 8 07:14:07 2013 (r250354) +++ head/sys/dev/ath/if_ath_misc.h Wed May 8 07:30:33 2013 (r250355) @@ -131,10 +131,16 @@ extern void ath_start_task(void *arg, in static inline void ath_tx_kick(struct ath_softc *sc) { + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + IEEE80211_TX_UNLOCK_ASSERT(ic); + ATH_TX_UNLOCK_ASSERT(sc); + + IEEE80211_TX_LOCK(ic); ATH_TX_LOCK(sc); ath_start(sc->sc_ifp); ATH_TX_UNLOCK(sc); + IEEE80211_TX_UNLOCK(ic); } /* From owner-svn-src-all@FreeBSD.ORG Wed May 8 08:53:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB66060F; Wed, 8 May 2013 08:53:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEBBFEEB; Wed, 8 May 2013 08:53:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r488ru66022124; Wed, 8 May 2013 08:53:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r488ru71022123; Wed, 8 May 2013 08:53:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305080853.r488ru71022123@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 08:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250356 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 08:53:56 -0000 Author: adrian Date: Wed May 8 08:53:55 2013 New Revision: 250356 URL: http://svnweb.freebsd.org/changeset/base/250356 Log: This shouldn't have made it into this commit, sorry. Modified: head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed May 8 07:30:33 2013 (r250355) +++ head/sys/dev/ath/if_ath_misc.h Wed May 8 08:53:55 2013 (r250356) @@ -131,16 +131,10 @@ extern void ath_start_task(void *arg, in static inline void ath_tx_kick(struct ath_softc *sc) { - struct ieee80211com *ic = sc->sc_ifp->if_l2com; - IEEE80211_TX_UNLOCK_ASSERT(ic); - ATH_TX_UNLOCK_ASSERT(sc); - - IEEE80211_TX_LOCK(ic); ATH_TX_LOCK(sc); ath_start(sc->sc_ifp); ATH_TX_UNLOCK(sc); - IEEE80211_TX_UNLOCK(ic); } /* From owner-svn-src-all@FreeBSD.ORG Wed May 8 09:42:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A2A8B63E; Wed, 8 May 2013 09:42:55 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94F341BB; Wed, 8 May 2013 09:42:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r489gtXg039765; Wed, 8 May 2013 09:42:55 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r489gov5039729; Wed, 8 May 2013 09:42:50 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201305080942.r489gov5039729@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 8 May 2013 09:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250357 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 09:42:55 -0000 Author: ray Date: Wed May 8 09:42:50 2013 New Revision: 250357 URL: http://svnweb.freebsd.org/changeset/base/250357 Log: Update copyright date. Modified: head/sys/arm/freescale/imx/bus_space.c head/sys/arm/freescale/imx/common.c head/sys/arm/freescale/imx/console.c head/sys/arm/freescale/imx/i2c.c head/sys/arm/freescale/imx/imx51_ccm.c head/sys/arm/freescale/imx/imx51_ccmreg.h head/sys/arm/freescale/imx/imx51_ccmvar.h head/sys/arm/freescale/imx/imx51_dpllreg.h head/sys/arm/freescale/imx/imx51_gpio.c head/sys/arm/freescale/imx/imx51_iomux.c head/sys/arm/freescale/imx/imx51_iomuxreg.h head/sys/arm/freescale/imx/imx51_iomuxvar.h head/sys/arm/freescale/imx/imx51_ipuv3.c head/sys/arm/freescale/imx/imx51_ipuv3reg.h head/sys/arm/freescale/imx/imx51_sdmareg.h head/sys/arm/freescale/imx/imx51_ssireg.h head/sys/arm/freescale/imx/imx51_tzicreg.h head/sys/arm/freescale/imx/imx_gpt.c head/sys/arm/freescale/imx/imx_gptreg.h head/sys/arm/freescale/imx/imx_gptvar.h head/sys/arm/freescale/imx/imx_machdep.c head/sys/arm/freescale/imx/imx_wdog.c head/sys/arm/freescale/imx/imx_wdogreg.h head/sys/arm/freescale/imx/tzic.c Modified: head/sys/arm/freescale/imx/bus_space.c ============================================================================== --- head/sys/arm/freescale/imx/bus_space.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/bus_space.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 FreeBSD Foundation + * Copyright (C) 2012, 2013 FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Tymoshenko under sponsorship Modified: head/sys/arm/freescale/imx/common.c ============================================================================== --- head/sys/arm/freescale/imx/common.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/common.c Wed May 8 09:42:50 2013 (r250357) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Developed by Semihalf. Modified: head/sys/arm/freescale/imx/console.c ============================================================================== --- head/sys/arm/freescale/imx/console.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/console.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/i2c.c ============================================================================== --- head/sys/arm/freescale/imx/i2c.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/i2c.c Wed May 8 09:42:50 2013 (r250357) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2008-2009 Semihalf, Michal Hajduk - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_ccm.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccm.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ccm.c Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_ccmreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccmreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ccmreg.h Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_ccmvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ccmvar.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ccmvar.h Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_dpllreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_dpllreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_dpllreg.h Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_gpio.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_gpio.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_iomux.c Wed May 8 09:42:50 2013 (r250357) @@ -27,7 +27,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_iomuxreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomuxreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_iomuxreg.h Wed May 8 09:42:50 2013 (r250357) @@ -4,7 +4,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_iomuxvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomuxvar.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_iomuxvar.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_ipuv3.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ipuv3.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_ipuv3reg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ipuv3reg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ipuv3reg.h Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx51_sdmareg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_sdmareg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_sdmareg.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx51_ssireg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_ssireg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_ssireg.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx51_tzicreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx51_tzicreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx51_tzicreg.h Wed May 8 09:42:50 2013 (r250357) @@ -26,7 +26,7 @@ */ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Oleksandr Rybalko Modified: head/sys/arm/freescale/imx/imx_gpt.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpt.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_gpt.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx_gptreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx_gptreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_gptreg.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx_gptvar.h ============================================================================== --- head/sys/arm/freescale/imx/imx_gptvar.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_gptvar.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_machdep.c Wed May 8 09:42:50 2013 (r250357) @@ -1,7 +1,7 @@ /*- * Copyright (c) 1994-1998 Mark Brinicombe. * Copyright (c) 1994 Brini. - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * Modified: head/sys/arm/freescale/imx/imx_wdog.c ============================================================================== --- head/sys/arm/freescale/imx/imx_wdog.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_wdog.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/imx_wdogreg.h ============================================================================== --- head/sys/arm/freescale/imx/imx_wdogreg.h Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/imx_wdogreg.h Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship Modified: head/sys/arm/freescale/imx/tzic.c ============================================================================== --- head/sys/arm/freescale/imx/tzic.c Wed May 8 08:53:55 2013 (r250356) +++ head/sys/arm/freescale/imx/tzic.c Wed May 8 09:42:50 2013 (r250357) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. * * This software was developed by Oleksandr Rybalko under sponsorship From owner-svn-src-all@FreeBSD.ORG Wed May 8 10:11:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B81C8BC5; Wed, 8 May 2013 10:11:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AACD32FC; Wed, 8 May 2013 10:11:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48ABWCl050139; Wed, 8 May 2013 10:11:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48ABVOH050137; Wed, 8 May 2013 10:11:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305081011.r48ABVOH050137@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 May 2013 10:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250358 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 10:11:32 -0000 Author: kib Date: Wed May 8 10:11:31 2013 New Revision: 250358 URL: http://svnweb.freebsd.org/changeset/base/250358 Log: MFC r250152: The check to ensure that xstate_bv always has XFEATURE_ENABLED_X87 and XFEATURE_ENABLED_SSE bits set is not needed. CPU correctly handles any bitmask which is subset of the enabled bits in %XCR0. More, CPU instructions XSAVE and XSAVEOPT could write the mask without e.g. XFEATURE_ENABLED_SSE, after the VZEROALL. The check prevents the restoration of the otherwise valid FPU save area. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Wed May 8 09:42:50 2013 (r250357) +++ stable/9/sys/amd64/amd64/fpu.c Wed May 8 10:11:31 2013 (r250358) @@ -743,9 +743,6 @@ fpusetxstate(struct thread *td, char *xf */ if (bv & ~xsave_mask) return (EINVAL); - if ((bv & (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) != - (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE)) - return (EINVAL); hdr = (struct xstate_hdr *)(get_pcb_user_save_td(td) + 1); From owner-svn-src-all@FreeBSD.ORG Wed May 8 10:14:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48E7ED94; Wed, 8 May 2013 10:14:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1DA31F; Wed, 8 May 2013 10:14:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48AElhB050898; Wed, 8 May 2013 10:14:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48AElS3050897; Wed, 8 May 2013 10:14:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305081014.r48AElS3050897@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 May 2013 10:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250359 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 10:14:47 -0000 Author: kib Date: Wed May 8 10:14:46 2013 New Revision: 250359 URL: http://svnweb.freebsd.org/changeset/base/250359 Log: MFC r250153: Partially saved extended state must be handled always, i.e. for both fpu-owned context, and for pcb-saved one. More, the XSAVE could do partial save, same as XSAVEOPT, so qualifier for the handler should be use_xsave and not use_xsaveopt. Since xsave_area_desc is now needed regardless of the XSAVEOPT use, remove the write-only use_xsaveopt variable. Modified: stable/9/sys/amd64/amd64/fpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/fpu.c ============================================================================== --- stable/9/sys/amd64/amd64/fpu.c Wed May 8 10:11:31 2013 (r250358) +++ stable/9/sys/amd64/amd64/fpu.c Wed May 8 10:14:46 2013 (r250359) @@ -132,7 +132,6 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, NULL, 1, "Floating point instructions executed in hardware"); -static int use_xsaveopt; int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -198,7 +197,6 @@ fpuinit_bsp1(void) * REX byte, and set the bit 4 of the r/m byte. */ ctx_switch_xsave[3] |= 0x10; - use_xsaveopt = 1; } } @@ -296,7 +294,7 @@ fpuinitstate(void *arg __unused) * Create a table describing the layout of the CPU Extended * Save Area. */ - if (use_xsaveopt) { + if (use_xsave) { max_ext_n = flsl(xsave_mask); xsave_area_desc = malloc(max_ext_n * sizeof(struct xsave_area_elm_descr), M_DEVBUF, M_WAITOK | M_ZERO); @@ -661,7 +659,7 @@ fpugetregs(struct thread *td) struct pcb *pcb; uint64_t *xstate_bv, bit; char *sa; - int max_ext_n, i; + int max_ext_n, i, owned; pcb = td->td_pcb; if ((pcb->pcb_flags & PCB_USERFPUINITDONE) == 0) { @@ -675,31 +673,31 @@ fpugetregs(struct thread *td) critical_enter(); if (td == PCPU_GET(fpcurthread) && PCB_USER_FPU(pcb)) { fpusave(get_pcb_user_save_pcb(pcb)); - critical_exit(); - return (_MC_FPOWNED_FPU); + owned = _MC_FPOWNED_FPU; } else { - critical_exit(); - if (use_xsaveopt) { - /* - * Handle partially saved state. - */ - sa = (char *)get_pcb_user_save_pcb(pcb); - xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + - offsetof(struct xstate_hdr, xstate_bv)); - max_ext_n = flsl(xsave_mask); - for (i = 0; i < max_ext_n; i++) { - bit = 1 << i; - if ((*xstate_bv & bit) != 0) - continue; - bcopy((char *)fpu_initialstate + - xsave_area_desc[i].offset, - sa + xsave_area_desc[i].offset, - xsave_area_desc[i].size); - *xstate_bv |= bit; - } + owned = _MC_FPOWNED_PCB; + } + critical_exit(); + if (use_xsave) { + /* + * Handle partially saved state. + */ + sa = (char *)get_pcb_user_save_pcb(pcb); + xstate_bv = (uint64_t *)(sa + sizeof(struct savefpu) + + offsetof(struct xstate_hdr, xstate_bv)); + max_ext_n = flsl(xsave_mask); + for (i = 0; i < max_ext_n; i++) { + bit = 1 << i; + if ((*xstate_bv & bit) != 0) + continue; + bcopy((char *)fpu_initialstate + + xsave_area_desc[i].offset, + sa + xsave_area_desc[i].offset, + xsave_area_desc[i].size); + *xstate_bv |= bit; } - return (_MC_FPOWNED_PCB); } + return (owned); } void From owner-svn-src-all@FreeBSD.ORG Wed May 8 10:55:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AC6B19F5; Wed, 8 May 2013 10:55:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E7E977F; Wed, 8 May 2013 10:55:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48AtdXZ064504; Wed, 8 May 2013 10:55:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48AtdtH064502; Wed, 8 May 2013 10:55:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305081055.r48AtdtH064502@svn.freebsd.org> From: Attilio Rao Date: Wed, 8 May 2013 10:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250361 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 10:55:39 -0000 Author: attilio Date: Wed May 8 10:55:39 2013 New Revision: 250361 URL: http://svnweb.freebsd.org/changeset/base/250361 Log: Fix-up r250338 by completing the removal of VM_NDOMAIN in favor of MAXMEMDOM. This unbreak builds. Sponsored by: EMC / Isilon storage division Reported by: adrian, jeli Modified: head/sys/vm/vm_phys.c Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed May 8 10:53:17 2013 (r250360) +++ head/sys/vm/vm_phys.c Wed May 8 10:55:39 2013 (r250361) @@ -464,7 +464,7 @@ vm_phys_alloc_pages(int pool, int order) vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order) { -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 vm_page_t m; int i, ndomains; #endif @@ -477,7 +477,7 @@ vm_phys_alloc_freelist_pages(int flind, KASSERT(order < VM_NFREEORDER, ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); -#if VM_NDOMAIN > 1 +#if MAXMEMDOM > 1 /* * This routine expects to be called with a VM_FREELIST_* constant. * On a system with multiple domains we need to adjust the flind From owner-svn-src-all@FreeBSD.ORG Wed May 8 10:56:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42595B84; Wed, 8 May 2013 10:56:37 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id EF865796; Wed, 8 May 2013 10:56:36 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id k5so2859282iea.4 for ; Wed, 08 May 2013 03:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=7ASq83DzhSGKuitZ4cPddtkRc1JaVFVijrdrVBO4P5Y=; b=FIusCjJ12/32x8DLSNtN2oSKBoUVjQ8w6jiAkcnuVuKYVlW2l1LJJi/LLsuJ1DDk8N FR3U273MDCLG+1b4VuJSJfY1ch6pGOR0eA1bOh0Hx7KTZw4e97+NREQu69jYGW5mLAkt ZysuHIUtyIVzOF1WnRcOTi5vnoGIWQ8zrOL4EdOo5mFnytxZ7hXw1z3I3OFAX0aBc6KC emYzCqjYt+C0eAQtgWgPbo4e3bN9wskgMTCbaF/6wqWHS+A2MQKD9LyBhAsle1hp8Dgv 5o8JvHsF8uUJSkscJaGNiqAk1jbx7CrHa08v7BKDUJIQ+Zi4ptJNL+3CnQRdcsCNFP3Z hBFQ== MIME-Version: 1.0 X-Received: by 10.50.147.100 with SMTP id tj4mr5616962igb.19.1368010596664; Wed, 08 May 2013 03:56:36 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Wed, 8 May 2013 03:56:36 -0700 (PDT) In-Reply-To: References: <201305072246.r47MkPUH009225@svn.freebsd.org> Date: Wed, 8 May 2013 12:56:36 +0200 X-Google-Sender-Auth: MyGJGYi2cS9rYgue5mZKrtyyb10 Message-ID: Subject: Re: svn commit: r250338 - in head/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include vm x86/acpica From: Attilio Rao To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 10:56:37 -0000 On Wed, May 8, 2013 at 5:21 AM, Adrian Chadd wrote: > Hi, > > This broke a fresh buildworld for me. sys/vm/vm_phys.c still > references VM_NDOMAIN. Fixed in r250361. Sorry for the breakage. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed May 8 12:53:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 96AA1ED2; Wed, 8 May 2013 12:53:22 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78843D6B; Wed, 8 May 2013 12:53:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48CrM2n006980; Wed, 8 May 2013 12:53:22 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48CrMGX006978; Wed, 8 May 2013 12:53:22 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201305081253.r48CrMGX006978@svn.freebsd.org> From: Takanori Watanabe Date: Wed, 8 May 2013 12:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250363 - in head/sys: dev/acpi_support modules/acpi/acpi_rapidstart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 12:53:22 -0000 Author: takawata Date: Wed May 8 12:53:21 2013 New Revision: 250363 URL: http://svnweb.freebsd.org/changeset/base/250363 Log: A driver for Intel Rapid Start Technology ACPI device. Note that it is just for 'Advanced' configuration for Rapid start technology. Added: head/sys/dev/acpi_support/acpi_rapidstart.c (contents, props changed) head/sys/modules/acpi/acpi_rapidstart/ head/sys/modules/acpi/acpi_rapidstart/Makefile (contents, props changed) Added: head/sys/dev/acpi_support/acpi_rapidstart.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/acpi_support/acpi_rapidstart.c Wed May 8 12:53:21 2013 (r250363) @@ -0,0 +1,133 @@ +/*- + * Copyright (c) 2013 Takanori Watanabe + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_acpi.h" +#include +#include +#include + +#include + +#include "acpi_if.h" +#include +#include +#include +static int sysctl_acpi_rapidstart_gen_handler(SYSCTL_HANDLER_ARGS); + + +static struct acpi_rapidstart_name_list +{ + char *nodename; + char *getmethod; + char *setmethod; + char *comment; +} acpi_rapidstart_oids[] ={ + {"ffs","GFFS","SFFS","Flash Fast Store Flag"}, + {"ftv","GFTV","SFTV","Time value"}, + {NULL, NULL, NULL, NULL} +}; + +struct acpi_rapidstart_softc { + struct sysctl_ctx_list *sysctl_ctx; + struct sysctl_oid *sysctl_tree; + +}; +static char *rapidstart_ids[] = {"INT3392", NULL}; +static int +acpi_rapidstart_probe(device_t dev) +{ + if (acpi_disabled("rapidstart") || + ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids) == NULL || + device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "Intel Rapid Start ACPI device"); + + return (0); + +} + +static int +acpi_rapidstart_attach(device_t dev) +{ + struct acpi_rapidstart_softc *sc; + int i; + + sc = device_get_softc(dev); + + sc->sysctl_ctx = device_get_sysctl_ctx(dev); + sc->sysctl_tree = device_get_sysctl_tree(dev); + for (i = 0 ; acpi_rapidstart_oids[i].nodename != NULL; i++){ + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + i, acpi_rapidstart_oids[i].nodename , CTLTYPE_INT | + ((acpi_rapidstart_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD), + dev, i, sysctl_acpi_rapidstart_gen_handler, "I", + acpi_rapidstart_oids[i].comment); + } + return (0); +} + +static int +sysctl_acpi_rapidstart_gen_handler(SYSCTL_HANDLER_ARGS) +{ + device_t dev = arg1; + int function = oidp->oid_arg2; + int error = 0, val; + + acpi_GetInteger(acpi_get_handle(dev), + acpi_rapidstart_oids[function].getmethod, &val); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error || !req->newptr || !acpi_rapidstart_oids[function].setmethod) + return (error); + acpi_SetInteger(acpi_get_handle(dev), + acpi_rapidstart_oids[function].setmethod, val); + return (0); +} + +static device_method_t acpi_rapidstart_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, acpi_rapidstart_probe), + DEVMETHOD(device_attach, acpi_rapidstart_attach), + + DEVMETHOD_END +}; + +static driver_t acpi_rapidstart_driver = { + "acpi_rapidstart", + acpi_rapidstart_methods, + sizeof(struct acpi_rapidstart_softc), +}; + +static devclass_t acpi_rapidstart_devclass; + +DRIVER_MODULE(acpi_rapidstart, acpi, acpi_rapidstart_driver, acpi_rapidstart_devclass, + 0, 0); +MODULE_DEPEND(acpi_rapidstart, acpi, 1, 1, 1); + Added: head/sys/modules/acpi/acpi_rapidstart/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/acpi/acpi_rapidstart/Makefile Wed May 8 12:53:21 2013 (r250363) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../dev/acpi_support + +KMOD= acpi_rapidstart +SRCS= acpi_rapidstart.c opt_acpi.h device_if.h bus_if.h acpi_if.h + +.include From owner-svn-src-all@FreeBSD.ORG Wed May 8 13:26:18 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DCA9D3CB; Wed, 8 May 2013 13:26:18 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEA02E99; Wed, 8 May 2013 13:26:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48DQI1x018243; Wed, 8 May 2013 13:26:18 GMT (envelope-from takawata@svn.freebsd.org) Received: (from takawata@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48DQIWZ018242; Wed, 8 May 2013 13:26:18 GMT (envelope-from takawata@svn.freebsd.org) Message-Id: <201305081326.r48DQIWZ018242@svn.freebsd.org> From: Takanori Watanabe Date: Wed, 8 May 2013 13:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250364 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 13:26:18 -0000 Author: takawata Date: Wed May 8 13:26:17 2013 New Revision: 250364 URL: http://svnweb.freebsd.org/changeset/base/250364 Log: Manual page for acpi_rapidstart(4) driver. ---- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > Security: Vulnerability reference (one per line) or description. > Empty fields above will be automatically removed. AM acpi_rapidstart.4 Added: head/share/man/man4/acpi_rapidstart.4 (contents, props changed) Added: head/share/man/man4/acpi_rapidstart.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/acpi_rapidstart.4 Wed May 8 13:26:17 2013 (r250364) @@ -0,0 +1,82 @@ +.\" Copyright (c) 2013 Takanori Watanabe +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 8, 2013 +.Dt ACPI_RAPIDSTART 4 +.Os +.Sh NAME +.Nm acpi_rapidstart +.Nd "Intel rapid start technology ACPI driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device acpi_rapidstart" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +acpi_rapidstart_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Intel Rapid Start technology ACPI device interface. +Note that this is only for ACPI device interface . This has _CID PNP0C02 so +should be loaded in boot time to avoid attaching acpi_sysresource driver. + +.Sh SYSCTLS +The following sysctl nodes are currently implemented: +.Bl -tag -width indent +.It Va dev.acpi_rapidstart.0.ffs +Rapid start flag. +It is a bitwise OR of the following: +.Pp +.Bl -tag -width indent-two -compact +.It Li 1 +Enter Fast Flash Standby in RTC wake. +.It Li 2 +Enter Fast Flash Standby in Critical Battery Wake enable +.El +.It Va dev.acpi_rapidstart.0.ftv +Fast Flash Standby timer value in minutes. +.El +.Sh SEE ALSO +.Xr acpi 4 , +.Xr sysctl 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Takanori Watanabe Aq takawata@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Wed May 8 14:13:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C5C8D4; Wed, 8 May 2013 14:13:15 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0F30A138; Wed, 8 May 2013 14:13:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48EDEH5035221; Wed, 8 May 2013 14:13:14 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48EDEJV035220; Wed, 8 May 2013 14:13:14 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201305081413.r48EDEJV035220@svn.freebsd.org> From: Andre Oppermann Date: Wed, 8 May 2013 14:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250365 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 14:13:15 -0000 Author: andre Date: Wed May 8 14:13:14 2013 New Revision: 250365 URL: http://svnweb.freebsd.org/changeset/base/250365 Log: When the accept queue is full print the number of already pending new connections instead of by how many we're over the limit, which is always 1. Noticed by: jmallet MFC after: 1 week Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Wed May 8 13:26:17 2013 (r250364) +++ head/sys/kern/uipc_socket.c Wed May 8 14:13:14 2013 (r250365) @@ -515,7 +515,7 @@ sonewconn(struct socket *head, int conns #endif log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " "%i already in queue awaiting acceptance\n", - __func__, head->so_pcb, over); + __func__, head->so_pcb, head->so_qlen); return (NULL); } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", From owner-svn-src-all@FreeBSD.ORG Wed May 8 15:45:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30512D3; Wed, 8 May 2013 15:45:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 201029C1; Wed, 8 May 2013 15:45:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48FjrlL069864; Wed, 8 May 2013 15:45:53 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48FjqJP069862; Wed, 8 May 2013 15:45:52 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081545.r48FjqJP069862@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 15:45:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250366 - in stable/9/sys: cam conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 15:45:53 -0000 Author: sbruno Date: Wed May 8 15:45:52 2013 New Revision: 250366 URL: http://svnweb.freebsd.org/changeset/base/250366 Log: MFC r249664 Expose CAM_BOOT_DELAY as a kernel conf item now. This allows users who boot without loader to adjust their environments around slightly buggy or slow hardware. Modified: stable/9/sys/cam/cam_xpt.c stable/9/sys/conf/options Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed May 8 14:13:14 2013 (r250365) +++ stable/9/sys/cam/cam_xpt.c Wed May 8 15:45:52 2013 (r250366) @@ -908,6 +908,13 @@ xpt_init(void *dummy) mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); +#ifdef CAM_BOOT_DELAY + /* + * Override this value at compile time to assist our users + * who don't use loader to boot a kernel. + */ + xsoftc.boot_delay = CAM_BOOT_DELAY; +#endif /* * The xpt layer is, itself, the equivelent of a SIM. * Allow 16 ccbs in the ccb pool for it. This should Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Wed May 8 14:13:14 2013 (r250365) +++ stable/9/sys/conf/options Wed May 8 15:45:52 2013 (r250366) @@ -308,6 +308,7 @@ CAM_DEBUG_BUS opt_cam.h CAM_DEBUG_TARGET opt_cam.h CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h +CAM_BOOT_DELAY opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h From owner-svn-src-all@FreeBSD.ORG Wed May 8 15:47:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 104C6352; Wed, 8 May 2013 15:47:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0180E9D5; Wed, 8 May 2013 15:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Flpeg070388; Wed, 8 May 2013 15:47:51 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48Flpf4070387; Wed, 8 May 2013 15:47:51 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081547.r48Flpf4070387@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 15:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250367 - stable/9/sys/dev/ciss X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 15:47:52 -0000 Author: sbruno Date: Wed May 8 15:47:51 2013 New Revision: 250367 URL: http://svnweb.freebsd.org/changeset/base/250367 Log: MFC r249815 Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS command on a disk device. This quieseces some noise on the console that recently appeared. Modified: stable/9/sys/dev/ciss/ciss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ciss/ciss.c ============================================================================== --- stable/9/sys/dev/ciss/ciss.c Wed May 8 15:45:52 2013 (r250366) +++ stable/9/sys/dev/ciss/ciss.c Wed May 8 15:47:51 2013 (r250367) @@ -3208,6 +3208,19 @@ ciss_cam_emulate(struct ciss_softc *sc, } } + /* + * A CISS target can only ever have one lun per target. REPORT_LUNS requires + * at least one LUN field to be pre created for us, so snag it and fill in + * the least significant byte indicating 1 LUN here. Emulate the command + * return to shut up warning on console of a CDB error. swb + */ + if (opcode == REPORT_LUNS && csio->dxfer_len > 0) { + csio->data_ptr[3] = 8; + csio->ccb_h.status |= CAM_REQ_CMP; + xpt_done((union ccb *)csio); + return(1); + } + return(0); } From owner-svn-src-all@FreeBSD.ORG Wed May 8 15:48:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3A4814F3; Wed, 8 May 2013 15:48:37 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C47E9DE; Wed, 8 May 2013 15:48:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48FmbGX070574; Wed, 8 May 2013 15:48:37 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48FmbPm070573; Wed, 8 May 2013 15:48:37 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081548.r48FmbPm070573@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 15:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r250368 - stable/8/sys/dev/ciss X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 15:48:37 -0000 Author: sbruno Date: Wed May 8 15:48:36 2013 New Revision: 250368 URL: http://svnweb.freebsd.org/changeset/base/250368 Log: MFC r249815 Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS command on a disk device. This quieseces some noise on the console that recently appeared. Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ciss/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Wed May 8 15:47:51 2013 (r250367) +++ stable/8/sys/dev/ciss/ciss.c Wed May 8 15:48:36 2013 (r250368) @@ -3207,6 +3207,19 @@ ciss_cam_emulate(struct ciss_softc *sc, } } + /* + * A CISS target can only ever have one lun per target. REPORT_LUNS requires + * at least one LUN field to be pre created for us, so snag it and fill in + * the least significant byte indicating 1 LUN here. Emulate the command + * return to shut up warning on console of a CDB error. swb + */ + if (opcode == REPORT_LUNS && csio->dxfer_len > 0) { + csio->data_ptr[3] = 8; + csio->ccb_h.status |= CAM_REQ_CMP; + xpt_done((union ccb *)csio); + return(1); + } + return(0); } From owner-svn-src-all@FreeBSD.ORG Wed May 8 15:50:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6D9817A4; Wed, 8 May 2013 15:50:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC4A9F1; Wed, 8 May 2013 15:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48FoPu8071054; Wed, 8 May 2013 15:50:25 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48FoPUw071053; Wed, 8 May 2013 15:50:25 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081550.r48FoPUw071053@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 15:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r250369 - stable/7/sys/dev/ciss X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 15:50:25 -0000 Author: sbruno Date: Wed May 8 15:50:24 2013 New Revision: 250369 URL: http://svnweb.freebsd.org/changeset/base/250369 Log: MFC r249815 Return a lun count of 1 and a lun id of 0 when CAM attempts a REPORT_LUNS command on a disk device. This quieseces some noise on the console that recently appeared. Modified: stable/7/sys/dev/ciss/ciss.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/ciss/ciss.c ============================================================================== --- stable/7/sys/dev/ciss/ciss.c Wed May 8 15:48:36 2013 (r250368) +++ stable/7/sys/dev/ciss/ciss.c Wed May 8 15:50:24 2013 (r250369) @@ -2919,6 +2919,19 @@ ciss_cam_emulate(struct ciss_softc *sc, } } + /* + * A CISS target can only ever have one lun per target. REPORT_LUNS requires + * at least one LUN field to be pre created for us, so snag it and fill in + * the least significant byte indicating 1 LUN here. Emulate the command + * return to shut up warning on console of a CDB error. swb + */ + if (opcode == REPORT_LUNS && csio->dxfer_len > 0) { + csio->data_ptr[3] = 8; + csio->ccb_h.status |= CAM_REQ_CMP; + xpt_done((union ccb *)csio); + return(1); + } + return(0); } From owner-svn-src-all@FreeBSD.ORG Wed May 8 15:55:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 343B8C7F; Wed, 8 May 2013 15:55:30 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD71A63; Wed, 8 May 2013 15:55:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48FtTfM073744; Wed, 8 May 2013 15:55:29 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48FtTAG073742; Wed, 8 May 2013 15:55:29 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081555.r48FtTAG073742@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 15:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250370 - in stable/9: share/man/man4 sys/dev/e1000 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 15:55:30 -0000 Author: sbruno Date: Wed May 8 15:55:29 2013 New Revision: 250370 URL: http://svnweb.freebsd.org/changeset/base/250370 Log: MFC r249070 Update man page for igb(4) with a little bit of information about hw.igb.num_queues for those so inclined. Modified: stable/9/share/man/man4/igb.4 stable/9/sys/dev/e1000/if_igb.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/share/man/man4/igb.4 ============================================================================== --- stable/9/share/man/man4/igb.4 Wed May 8 15:50:24 2013 (r250369) +++ stable/9/share/man/man4/igb.4 Wed May 8 15:55:29 2013 (r250370) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 12, 2012 +.Dd March 25, 2013 .Dt IGB 4 .Os .Sh NAME @@ -160,6 +160,11 @@ The minimum is 80, and the maximum is 40 .It Va hw.igb.enable_aim If set to 1, enable Adaptive Interrupt Moderation. The default is to enable Adaptive Interrupt Moderation. +.It Va hw.igb.num_queues +Numer of queues used for data transfer. +If set to 0, number of queues will be configured +automatically based on number of CPUs and max +supported MSI-X messages on the device. .It Va kern.ipc.nmbclusters The maximum number of mbuf clusters allowed. If the system has more than one igb card or jumbo frames are Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Wed May 8 15:50:24 2013 (r250369) +++ stable/9/sys/dev/e1000/if_igb.c Wed May 8 15:55:29 2013 (r250370) @@ -375,7 +375,8 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_spl /* ** This will autoconfigure based on -** the number of CPUs if left at 0. +** the number of CPUs and max supported MSI-X messages +** if left at 0. */ static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); From owner-svn-src-all@FreeBSD.ORG Wed May 8 16:26:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E3E6AB7; Wed, 8 May 2013 16:26:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id F0CF2D98; Wed, 8 May 2013 16:26:40 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4DF02B917; Wed, 8 May 2013 12:26:40 -0400 (EDT) From: John Baldwin To: Attilio Rao Subject: Re: svn commit: r250339 - head/sys/x86/acpica Date: Wed, 8 May 2013 12:01:16 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305072249.r47MnvrO009846@svn.freebsd.org> In-Reply-To: <201305072249.r47MnvrO009846@svn.freebsd.org> MIME-Version: 1.0 Message-Id: <201305081201.16405.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 08 May 2013 12:26:40 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 16:26:41 -0000 On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote: > Author: attilio > Date: Tue May 7 22:49:56 2013 > New Revision: 250339 > URL: http://svnweb.freebsd.org/changeset/base/250339 > > Log: > Add functions to do ACPI System Locality Information Table parsing > and printing at boot. > For reference on table informations and purposes please review ACPI specs. > > Sponsored by: EMC / Isilon storage division > Obtained from: jeff > Reviewed by: jhb (earlier version) Eh, I don't recall reviewing this. However, acpidump already dumps this table, and we should dump tables via acpidump, not in dmesg. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed May 8 16:29:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3666DF7; Wed, 8 May 2013 16:29:12 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5611DE0; Wed, 8 May 2013 16:29:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48GTCjS086187; Wed, 8 May 2013 16:29:12 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48GTCfS086186; Wed, 8 May 2013 16:29:12 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081629.r48GTCfS086186@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 16:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250371 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 16:29:12 -0000 Author: sbruno Date: Wed May 8 16:29:12 2013 New Revision: 250371 URL: http://svnweb.freebsd.org/changeset/base/250371 Log: s/Numer/Number/ Submitted by: Jeremy Chadwick Modified: head/share/man/man4/igb.4 Modified: head/share/man/man4/igb.4 ============================================================================== --- head/share/man/man4/igb.4 Wed May 8 15:55:29 2013 (r250370) +++ head/share/man/man4/igb.4 Wed May 8 16:29:12 2013 (r250371) @@ -161,7 +161,7 @@ The minimum is 80, and the maximum is 40 If set to 1, enable Adaptive Interrupt Moderation. The default is to enable Adaptive Interrupt Moderation. .It Va hw.igb.num_queues -Numer of queues used for data transfer. +Number of queues used for data transfer. If set to 0, number of queues will be configured automatically based on number of CPUs and max supported MSI-X messages on the device. From owner-svn-src-all@FreeBSD.ORG Wed May 8 16:31:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4F9DF3; Wed, 8 May 2013 16:31:11 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B70D9DFB; Wed, 8 May 2013 16:31:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48GVBYb088340; Wed, 8 May 2013 16:31:11 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48GVBpT088339; Wed, 8 May 2013 16:31:11 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201305081631.r48GVBpT088339@svn.freebsd.org> From: Sean Bruno Date: Wed, 8 May 2013 16:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250372 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 16:31:11 -0000 Author: sbruno Date: Wed May 8 16:31:11 2013 New Revision: 250372 URL: http://svnweb.freebsd.org/changeset/base/250372 Log: MFC r250371 s/Numer/Number/ Modified: stable/9/share/man/man4/igb.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/igb.4 ============================================================================== --- stable/9/share/man/man4/igb.4 Wed May 8 16:29:12 2013 (r250371) +++ stable/9/share/man/man4/igb.4 Wed May 8 16:31:11 2013 (r250372) @@ -161,7 +161,7 @@ The minimum is 80, and the maximum is 40 If set to 1, enable Adaptive Interrupt Moderation. The default is to enable Adaptive Interrupt Moderation. .It Va hw.igb.num_queues -Numer of queues used for data transfer. +Number of queues used for data transfer. If set to 0, number of queues will be configured automatically based on number of CPUs and max supported MSI-X messages on the device. From owner-svn-src-all@FreeBSD.ORG Wed May 8 16:43:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8856151E; Wed, 8 May 2013 16:43:53 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7A829E96; Wed, 8 May 2013 16:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Ghrq6092249; Wed, 8 May 2013 16:43:53 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48GhrU6092247; Wed, 8 May 2013 16:43:53 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201305081643.r48GhrU6092247@svn.freebsd.org> From: Hiren Panchasara Date: Wed, 8 May 2013 16:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250373 - stable/9/sys/dev/hwpmc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 16:43:53 -0000 Author: hiren Date: Wed May 8 16:43:52 2013 New Revision: 250373 URL: http://svnweb.freebsd.org/changeset/base/250373 Log: MFC: 233569 Fix crash on VirtualBox (and probably on some real hardware): - Do not cover error returned by pmc_core_initialize with the result of pmc_uncore_initialize, fail right away. - Give a user something to report instead failing silently. Submitted by: gonzo Reported by: Alexandr Kovalenko Approved by: sbruno (mentor) Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c stable/9/sys/dev/hwpmc/hwpmc_intel.c Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_core.c Wed May 8 16:31:11 2013 (r250372) +++ stable/9/sys/dev/hwpmc/hwpmc_core.c Wed May 8 16:43:52 2013 (r250373) @@ -2613,8 +2613,12 @@ pmc_core_initialize(struct pmc_mdep *md, PMCDBG(MDP,INI,1,"core-init cputype=%d ncpu=%d ipa-version=%d", md->pmd_cputype, maxcpu, ipa_version); - if (ipa_version < 1 || ipa_version > 3) /* Unknown PMC architecture. */ + if (ipa_version < 1 || ipa_version > 3) { + /* Unknown PMC architecture. */ + printf("hwpc_core: unknown PMC architecture: %d\n", + ipa_version); return (EPROGMISMATCH); + } core_cputype = md->pmd_cputype; Modified: stable/9/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_intel.c Wed May 8 16:31:11 2013 (r250372) +++ stable/9/sys/dev/hwpmc/hwpmc_intel.c Wed May 8 16:43:52 2013 (r250373) @@ -250,6 +250,9 @@ pmc_intel_initialize(void) KASSERT(0, ("[intel,%d] Unknown CPU type", __LINE__)); } + if (error) + goto error; + /* * Init the uncore class. */ From owner-svn-src-all@FreeBSD.ORG Wed May 8 17:45:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2E04719; Wed, 8 May 2013 17:45:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BAD817C; Wed, 8 May 2013 17:45:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48HjMdY013534; Wed, 8 May 2013 17:45:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48HjMGN013533; Wed, 8 May 2013 17:45:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305081745.r48HjMGN013533@svn.freebsd.org> From: Xin LI Date: Wed, 8 May 2013 17:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250374 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 17:45:22 -0000 Author: delphij Date: Wed May 8 17:45:22 2013 New Revision: 250374 URL: http://svnweb.freebsd.org/changeset/base/250374 Log: According to the documentation, on Linux, cancel_delayed_work() does not do drain (flush_workqueue() in Linux terms) but instead returns true if the work was removed before it is run, or false otherwise. Simulate this by removing the taskqueue_drain() and return the value derived from taskqueue_cancel()'s return value. This would solve a witness warning caused by calling taskqueue_drain() with a non-sleepable lock held, like: taskqueue_drain with the following non-sleepable locks held: exclusive rw lle (lle) r = 0 (0xfffffe001450b410) locked @ /usr/src/sys/netinet/in.c:1484 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffff848d4f7690 kdb_backtrace() at kdb_backtrace+0x39/frame 0xffffff848d4f7740 witness_warn() at witness_warn+0x4a8/frame 0xffffff848d4f7800 taskqueue_drain() at taskqueue_drain+0x3a/frame 0xffffff848d4f7840 set_timeout() at set_timeout+0x4a/frame 0xffffff848d4f7860 netevent_callback() at netevent_callback+0x16/frame 0xffffff848d4f7870 arpintr() at arpintr+0x9b5/frame 0xffffff848d4f7930 This do not affect kernel without OFED compiled in. Reported by: Garrett Cooper (who also tested an earlier version of this patch, but bugs are mine) MFC after: 2 weeks Modified: head/sys/ofed/include/linux/workqueue.h Modified: head/sys/ofed/include/linux/workqueue.h ============================================================================== --- head/sys/ofed/include/linux/workqueue.h Wed May 8 16:43:52 2013 (r250373) +++ head/sys/ofed/include/linux/workqueue.h Wed May 8 17:45:22 2013 (r250374) @@ -184,9 +184,9 @@ cancel_delayed_work(struct delayed_work { callout_stop(&work->timer); - if (work->work.taskqueue && - taskqueue_cancel(work->work.taskqueue, &work->work.work_task, NULL)) - taskqueue_drain(work->work.taskqueue, &work->work.work_task); + if (work->work.taskqueue) + return (taskqueue_cancel(work->work.taskqueue, + &work->work.work_task, NULL) == 0); return 0; } From owner-svn-src-all@FreeBSD.ORG Wed May 8 18:21:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 907AD29A; Wed, 8 May 2013 18:21:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ia0-x232.google.com (mail-ia0-x232.google.com [IPv6:2607:f8b0:4001:c02::232]) by mx1.freebsd.org (Postfix) with ESMTP id 49B08343; Wed, 8 May 2013 18:21:13 +0000 (UTC) Received: by mail-ia0-f178.google.com with SMTP id t29so2212597iag.23 for ; Wed, 08 May 2013 11:21:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ULB8ZMHFILCJ0+o2ceWI1dnnJGLthl7P1gtuv0hOlFY=; b=CFIMUhTspOFql23klcKmLZEw8f3d86SO9efV5dfg+qDroaGf7kwTwkV3smBx5X6H7S nusDMsgglpQuX3+DQ7Bd8idkCfgoC1bBZihFEITrawzprE3vIhWYxSXjVvOlSk45vc9w Nu/VPDzAXlklqSWHIE/E04sI4NJHSnO8QZaeKgD/qwo6qtX2S4hL3MolWc5oeso5Avl7 eBWZ5HHsXfKIXj4q5rfUD75rXPVxYwydwE+sCcfIlplRJ6sDMF21jvnCFsQoL3Y2JqtX rQrElYWn+qEty+aJfw0L/OgiOqO56PLOl5Myb+qenbDY7vWcg7WYRipNUMZmIVoGJOZN 9BIw== MIME-Version: 1.0 X-Received: by 10.50.7.36 with SMTP id g4mr3019798iga.64.1368037273042; Wed, 08 May 2013 11:21:13 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Wed, 8 May 2013 11:21:12 -0700 (PDT) In-Reply-To: <201305081201.16405.jhb@freebsd.org> References: <201305072249.r47MnvrO009846@svn.freebsd.org> <201305081201.16405.jhb@freebsd.org> Date: Wed, 8 May 2013 20:21:12 +0200 X-Google-Sender-Auth: Aj3R6Q386rXpHzOyr9FPnywGIkw Message-ID: Subject: Re: svn commit: r250339 - head/sys/x86/acpica From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 18:21:13 -0000 On Wed, May 8, 2013 at 6:01 PM, John Baldwin wrote: > On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote: >> Author: attilio >> Date: Tue May 7 22:49:56 2013 >> New Revision: 250339 >> URL: http://svnweb.freebsd.org/changeset/base/250339 >> >> Log: >> Add functions to do ACPI System Locality Information Table parsing >> and printing at boot. >> For reference on table informations and purposes please review ACPI specs. >> >> Sponsored by: EMC / Isilon storage division >> Obtained from: jeff >> Reviewed by: jhb (earlier version) > > Eh, I don't recall reviewing this. However, acpidump already dumps this > table, and we should dump tables via acpidump, not in dmesg. Now that I read better this patch is based upon a patch you submitted originally (see the private thread NUMA WIP). We already print some useful ACPI table information at boot really (APIC ACPI table case) and this is only printed out when having MAXMEMDOM > 1. Finally I have also sent you this patch and you didn't object. However if you really dislike it I can print under bootverbose maybe? Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed May 8 18:25:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C9D245A; Wed, 8 May 2013 18:25:47 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9EB373; Wed, 8 May 2013 18:25:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48IPkt3027934; Wed, 8 May 2013 18:25:46 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48IPk8X027933; Wed, 8 May 2013 18:25:46 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201305081825.r48IPk8X027933@svn.freebsd.org> From: David C Somayajulu Date: Wed, 8 May 2013 18:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250375 - head/sys/dev/qlxgb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 18:25:47 -0000 Author: davidcs Date: Wed May 8 18:25:46 2013 New Revision: 250375 URL: http://svnweb.freebsd.org/changeset/base/250375 Log: No need to set if_mtu since it automatically updated by ether_ifattach(). Use if_initbaudrate() to set baudrate. Add IFCAP_LINKSTATE to if_capabilities. Submitted by: David C Somayajulu Approved by: George Neville-Neil Modified: head/sys/dev/qlxgb/qla_os.c Modified: head/sys/dev/qlxgb/qla_os.c ============================================================================== --- head/sys/dev/qlxgb/qla_os.c Wed May 8 17:45:22 2013 (r250374) +++ head/sys/dev/qlxgb/qla_os.c Wed May 8 18:25:46 2013 (r250375) @@ -669,8 +669,7 @@ qla_init_ifnet(device_t dev, qla_host_t if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_mtu = ETHERMTU; - ifp->if_baudrate = (1 * 1000 * 1000 *1000); + if_initbaudrate(ifp, IF_Gbps(10)); ifp->if_init = qla_init; ifp->if_softc = ha; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -690,6 +689,7 @@ qla_init_ifnet(device_t dev, qla_host_t IFCAP_JUMBO_MTU; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU; + ifp->if_capabilities |= IFCAP_LINKSTATE; #if defined(__FreeBSD_version) && (__FreeBSD_version < 900002) ifp->if_timer = 0; From owner-svn-src-all@FreeBSD.ORG Wed May 8 18:39:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 57A2BB1D; Wed, 8 May 2013 18:39:13 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48760615; Wed, 8 May 2013 18:39:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48IdCfB032055; Wed, 8 May 2013 18:39:12 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48IdCvk032050; Wed, 8 May 2013 18:39:12 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305081839.r48IdCvk032050@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 8 May 2013 18:39:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250376 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 18:39:13 -0000 Author: trociny Date: Wed May 8 18:39:12 2013 New Revision: 250376 URL: http://svnweb.freebsd.org/changeset/base/250376 Log: MFC r249487: Re-factor the code to provide kern_proc_filedesc_out(), kern_proc_out(), and kern_proc_vmmap_out() functions to output process kinfo structures to sbuf, to make the code reusable. The functions are going to be used in the coredump routine to store procstat info in the core program header notes. Reviewed by: kib Modified: stable/9/sys/kern/kern_descrip.c stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Wed May 8 18:25:46 2013 (r250375) +++ stable/9/sys/kern/kern_descrip.c Wed May 8 18:39:12 2013 (r250376) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -3226,9 +3227,9 @@ CTASSERT(sizeof(struct kinfo_file) == KI #endif static int -export_fd_for_sysctl(void *data, int type, int fd, int fflags, int refcnt, +export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, int64_t offset, int fd_is_cap, cap_rights_t fd_cap_rights, - struct kinfo_file *kif, struct sysctl_req *req) + struct kinfo_file *kif, struct sbuf *sb, ssize_t *remainder) { struct { int fflag; @@ -3255,6 +3256,8 @@ export_fd_for_sysctl(void *data, int typ int error, vfslocked; unsigned int i; + if (*remainder == 0) + return (0); bzero(kif, sizeof(*kif)); switch (type) { case KF_TYPE_FIFO: @@ -3304,32 +3307,40 @@ export_fd_for_sysctl(void *data, int typ kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kif, kif->kf_structsize); + if (*remainder != -1) { + if (*remainder < kif->kf_structsize) { + /* Terminate export. */ + *remainder = 0; + return (0); + } + *remainder -= kif->kf_structsize; + } + error = sbuf_bcat(sb, kif, kif->kf_structsize); return (error); } /* - * Get per-process file descriptors for use by procstat(1), et al. + * Store a process file descriptor information to sbuf. + * + * Takes a locked proc as argument, and returns with the proc unlocked. */ -static int -sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +int +kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen) { struct file *fp; struct filedesc *fdp; struct kinfo_file *kif; - struct proc *p; struct vnode *cttyvp, *textvp, *tracevp; - size_t oldidx; int64_t offset; void *data; - int error, i, *name; + ssize_t remainder; + int error, i; int fd_is_cap, type, refcnt, fflags; cap_rights_t fd_cap_rights; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + remainder = maxlen; /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) @@ -3349,14 +3360,15 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER PROC_UNLOCK(p); kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); if (tracevp != NULL) - export_fd_for_sysctl(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, 0, kif, req); + export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, + FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); if (textvp != NULL) - export_fd_for_sysctl(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, 0, kif, req); + export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, + FREAD, -1, -1, 0, 0, kif, sb, &remainder); if (cttyvp != NULL) - export_fd_for_sysctl(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, 0, kif, req); + export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, + FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); + error = 0; if (fdp == NULL) goto fail; FILEDESC_SLOCK(fdp); @@ -3365,8 +3377,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_cdir); data = fdp->fd_cdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, 0, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, + FREAD, -1, -1, 0, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* root directory */ @@ -3374,8 +3386,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_rdir); data = fdp->fd_rdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, 0, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, + FREAD, -1, -1, 0, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } /* jail directory */ @@ -3383,8 +3395,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER vref(fdp->fd_jdir); data = fdp->fd_jdir; FILEDESC_SUNLOCK(fdp); - export_fd_for_sysctl(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, 0, 0, kif, req); + export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, + FREAD, -1, -1, 0, 0, kif, sb, &remainder); FILEDESC_SLOCK(fdp); } for (i = 0; i < fdp->fd_nfiles; i++) { @@ -3479,26 +3491,14 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER * re-validate and re-evaluate its properties when * the loop continues. */ - oldidx = req->oldidx; if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SUNLOCK(fdp); - error = export_fd_for_sysctl(data, type, i, fflags, refcnt, - offset, fd_is_cap, fd_cap_rights, kif, req); + error = export_fd_to_sb(data, type, i, fflags, refcnt, + offset, fd_is_cap, fd_cap_rights, kif, sb, &remainder); if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) FILEDESC_SLOCK(fdp); - if (error) { - if (error == ENOMEM) { - /* - * The hack to keep the ABI of sysctl - * kern.proc.filedesc intact, but not - * to account a partially copied - * kinfo_file into the oldidx. - */ - req->oldidx = oldidx; - error = 0; - } + if (error) break; - } } FILEDESC_SUNLOCK(fdp); fail: @@ -3508,6 +3508,34 @@ fail: return (error); } +#define FILEDESC_SBUF_SIZE (sizeof(struct kinfo_file) * 5) + +/* + * Get per-process file descriptors for use by procstat(1), et al. + */ +static int +sysctl_kern_proc_filedesc(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct proc *p; + ssize_t maxlen; + int error, error2, *name; + + name = (int *)arg1; + + sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); + error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + maxlen = req->oldptr != NULL ? req->oldlen : -1; + error = kern_proc_filedesc_out(p, &sb, maxlen); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + int vntype_to_kinfo(int vtype) { Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Wed May 8 18:25:46 2013 (r250375) +++ stable/9/sys/kern/kern_proc.c Wed May 8 18:39:12 2013 (r250376) @@ -1090,9 +1090,6 @@ zpfind(pid_t pid) return (p); } -#define KERN_PROC_ZOMBMASK 0x3 -#define KERN_PROC_NOTHREADS 0x4 - #ifdef COMPAT_FREEBSD32 /* @@ -1192,59 +1189,69 @@ freebsd32_kinfo_proc_out(const struct ki CP(*ki, *ki32, ki_sflag); CP(*ki, *ki32, ki_tdflags); } - -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - struct kinfo_proc32 ki32; - int error; - - if (req->flags & SCTL_MASK32) { - freebsd32_kinfo_proc_out(ki, &ki32); - error = SYSCTL_OUT(req, &ki32, sizeof(struct kinfo_proc32)); - } else - error = SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc)); - return (error); -} -#else -static int -sysctl_out_proc_copyout(struct kinfo_proc *ki, struct sysctl_req *req) -{ - - return (SYSCTL_OUT(req, ki, sizeof(struct kinfo_proc))); -} #endif -/* - * Must be called with the process locked and will return with it unlocked. - */ -static int -sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags) +int +kern_proc_out(struct proc *p, struct sbuf *sb, int flags) { struct thread *td; - struct kinfo_proc kinfo_proc; - int error = 0; - struct proc *np; - pid_t pid = p->p_pid; + struct kinfo_proc ki; +#ifdef COMPAT_FREEBSD32 + struct kinfo_proc32 ki32; +#endif + int error; PROC_LOCK_ASSERT(p, MA_OWNED); MPASS(FIRST_THREAD_IN_PROC(p) != NULL); - fill_kinfo_proc(p, &kinfo_proc); - if (flags & KERN_PROC_NOTHREADS) - error = sysctl_out_proc_copyout(&kinfo_proc, req); - else { + error = 0; + fill_kinfo_proc(p, &ki); + if ((flags & KERN_PROC_NOTHREADS) != 0) { +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); + } else { FOREACH_THREAD_IN_PROC(p, td) { - fill_kinfo_thread(td, &kinfo_proc, 1); - error = sysctl_out_proc_copyout(&kinfo_proc, req); + fill_kinfo_thread(td, &ki, 1); +#ifdef COMPAT_FREEBSD32 + if ((flags & KERN_PROC_MASK32) != 0) { + freebsd32_kinfo_proc_out(&ki, &ki32); + error = sbuf_bcat(sb, &ki32, sizeof(ki32)); + } else +#endif + error = sbuf_bcat(sb, &ki, sizeof(ki)); if (error) break; } } PROC_UNLOCK(p); - if (error) + return (error); +} + +static int +sysctl_out_proc(struct proc *p, struct sysctl_req *req, int flags, + int doingzomb) +{ + struct sbuf sb; + struct kinfo_proc ki; + struct proc *np; + int error, error2; + pid_t pid; + + pid = p->p_pid; + sbuf_new_for_sysctl(&sb, (char *)&ki, sizeof(ki), req); + error = kern_proc_out(p, &sb, flags); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + if (error != 0) return (error); - if (flags & KERN_PROC_ZOMBMASK) + else if (error2 != 0) + return (error2); + if (doingzomb) np = zpfind(pid); else { if (pid == 0) @@ -1278,6 +1285,10 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) flags = 0; oid_number &= ~KERN_PROC_INC_THREAD; } +#ifdef COMPAT_FREEBSD32 + if (req->flags & SCTL_MASK32) + flags |= KERN_PROC_MASK32; +#endif if (oid_number == KERN_PROC_PID) { if (namelen != 1) return (EINVAL); @@ -1287,7 +1298,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error != 0) return (error); - error = sysctl_out_proc(p, req, flags); + error = sysctl_out_proc(p, req, flags, 0); return (error); } @@ -1416,7 +1427,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } - error = sysctl_out_proc(p, req, flags | doingzomb); + error = sysctl_out_proc(p, req, flags, doingzomb); if (error) { sx_sunlock(&allproc_lock); return (error); @@ -2125,8 +2136,11 @@ sysctl_kern_proc_ovmmap(SYSCTL_HANDLER_A CTASSERT(sizeof(struct kinfo_vmentry) == KINFO_VMENTRY_SIZE); #endif -static int -sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +/* + * Must be called with the process locked and will return unlocked. + */ +int +kern_proc_vmmap_out(struct proc *p, struct sbuf *sb) { vm_map_entry_t entry, tmp_entry; unsigned int last_timestamp; @@ -2134,16 +2148,15 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR struct kinfo_vmentry *kve; struct vattr va; struct ucred *cred; - int error, *name; + int error; struct vnode *vp; - struct proc *p; struct vmspace *vm; vm_map_t map; - name = (int *)arg1; - error = pget((pid_t)name[0], PGET_WANTREAD, &p); - if (error != 0) - return (error); + PROC_LOCK_ASSERT(p, MA_OWNED); + + _PHOLD(p); + PROC_UNLOCK(p); vm = vmspace_acquire_ref(p); if (vm == NULL) { PRELE(p); @@ -2151,6 +2164,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR } kve = malloc(sizeof(*kve), M_TEMP, M_WAITOK); + error = 0; map = &vm->vm_map; /* XXXRW: More locking required? */ vm_map_lock_read(map); for (entry = map->header.next; entry != &map->header; @@ -2292,7 +2306,7 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR strlen(kve->kve_path) + 1; kve->kve_structsize = roundup(kve->kve_structsize, sizeof(uint64_t)); - error = SYSCTL_OUT(req, kve, kve->kve_structsize); + error = sbuf_bcat(sb, kve, kve->kve_structsize); vm_map_lock_read(map); if (error) break; @@ -2308,6 +2322,26 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR return (error); } +static int +sysctl_kern_proc_vmmap(SYSCTL_HANDLER_ARGS) +{ + struct proc *p; + struct sbuf sb; + int error, error2, *name; + + name = (int *)arg1; + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct kinfo_vmentry), req); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); + if (error != 0) { + sbuf_delete(&sb); + return (error); + } + error = kern_proc_vmmap_out(p, &sb); + error2 = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error != 0 ? error : error2); +} + #if defined(STACK) || defined(DDB) static int sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) Modified: stable/9/sys/sys/user.h ============================================================================== --- stable/9/sys/sys/user.h Wed May 8 18:25:46 2013 (r250375) +++ stable/9/sys/sys/user.h Wed May 8 18:39:12 2013 (r250376) @@ -493,6 +493,25 @@ struct kinfo_kstack { }; #ifdef _KERNEL +/* Flags for kern_proc_out function. */ +#define KERN_PROC_NOTHREADS 0x1 +#define KERN_PROC_MASK32 0x2 + +struct sbuf; + +/* + * The kern_proc out functions are helper functions to dump process + * miscellaneous kinfo structures to sbuf. The main consumers are KERN_PROC + * sysctls but they may also be used by other kernel subsystems. + * + * The functions manipulate the process locking state and expect the process + * to be locked on enter. On return the process is unlocked. + */ + +int kern_proc_filedesc_out(struct proc *p, struct sbuf *sb, ssize_t maxlen); +int kern_proc_out(struct proc *p, struct sbuf *sb, int flags); +int kern_proc_vmmap_out(struct proc *p, struct sbuf *sb); + int vntype_to_kinfo(int vtype); #endif /* !_KERNEL */ From owner-svn-src-all@FreeBSD.ORG Wed May 8 18:55:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9A4503F4; Wed, 8 May 2013 18:55:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8BBB5779; Wed, 8 May 2013 18:55:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Itc4o038248; Wed, 8 May 2013 18:55:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48ItcD1038245; Wed, 8 May 2013 18:55:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305081855.r48ItcD1038245@svn.freebsd.org> From: Eitan Adler Date: Wed, 8 May 2013 18:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250377 - head/sbin/growfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 18:55:38 -0000 Author: eadler Date: Wed May 8 18:55:38 2013 New Revision: 250377 URL: http://svnweb.freebsd.org/changeset/base/250377 Log: Allow the use of lowercase 'yes' PR: bin/178422 Submitted by: Garrett Cooper Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Wed May 8 18:39:12 2013 (r250376) +++ head/sbin/growfs/growfs.c Wed May 8 18:55:38 2013 (r250377) @@ -1544,7 +1544,7 @@ main(int argc, char **argv) printf(" from %s to %s? [Yes/No] ", oldsizebuf, newsizebuf); fflush(stdout); fgets(reply, (int)sizeof(reply), stdin); - if (strcmp(reply, "Yes\n")){ + if (strcasecmp(reply, "Yes\n")){ printf("\nNothing done\n"); exit (0); } From owner-svn-src-all@FreeBSD.ORG Wed May 8 19:11:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 816E78DC; Wed, 8 May 2013 19:11:48 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 73D6A840; Wed, 8 May 2013 19:11:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48JBmhU044853; Wed, 8 May 2013 19:11:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48JBmJY044852; Wed, 8 May 2013 19:11:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305081911.r48JBmJY044852@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 8 May 2013 19:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250378 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 19:11:48 -0000 Author: trociny Date: Wed May 8 19:11:47 2013 New Revision: 250378 URL: http://svnweb.freebsd.org/changeset/base/250378 Log: Make errbuf optional, so if a caller is not interested in an error message she can pass NULL (procstat(1) already does this). MFC after: 2 weeks Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Wed May 8 18:55:38 2013 (r250377) +++ head/lib/libprocstat/libprocstat.c Wed May 8 19:11:47 2013 (r250378) @@ -897,7 +897,8 @@ procstat_get_pipe_info(struct procstat * return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -926,7 +927,8 @@ procstat_get_pipe_info_kvm(kvm_t *kd, st return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -962,7 +964,8 @@ procstat_get_pts_info(struct procstat *p return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -990,7 +993,8 @@ procstat_get_pts_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1025,7 +1029,8 @@ procstat_get_sem_info(struct procstat *p return (procstat_get_sem_info_sysctl(fst, sem, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1071,7 +1076,8 @@ procstat_get_sem_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1106,7 +1112,8 @@ procstat_get_shm_info(struct procstat *p return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1152,7 +1159,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1187,7 +1195,8 @@ procstat_get_vnode_info(struct procstat return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1254,7 +1263,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s break; } if (i == NTYPES) { - snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); return (1); } vn->vn_mntdir = getmnton(kd, vnode.v_mount); @@ -1268,7 +1278,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1349,7 +1360,10 @@ procstat_get_vnode_info_sysctl(struct fi if (vntype == PS_FST_VTYPE_VNON || vntype == PS_FST_VTYPE_VBAD) return (0); if ((status & KF_ATTR_VALID) == 0) { - snprintf(errbuf, _POSIX2_LINE_MAX, "? (no info available)"); + if (errbuf != NULL) { + snprintf(errbuf, _POSIX2_LINE_MAX, + "? (no info available)"); + } return (1); } if (path && *path) { @@ -1390,7 +1404,8 @@ procstat_get_socket_info(struct procstat return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1488,7 +1503,8 @@ procstat_get_socket_info_kvm(kvm_t *kd, return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:03:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41AF9F26; Wed, 8 May 2013 20:03:39 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 238699D6; Wed, 8 May 2013 20:03:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48K3d1x062267; Wed, 8 May 2013 20:03:39 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48K3cYv062256; Wed, 8 May 2013 20:03:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305082003.r48K3cYv062256@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 8 May 2013 20:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:03:39 -0000 Author: trociny Date: Wed May 8 20:03:37 2013 New Revision: 250379 URL: http://svnweb.freebsd.org/changeset/base/250379 Log: HAST module for bsnmpd(1). Reviewed by: harti, pjd MFC after: 2 weeks Added: head/usr.sbin/bsnmpd/modules/snmp_hast/ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def (contents, props changed) head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 (contents, props changed) Modified: head/usr.sbin/bsnmpd/modules/Makefile Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Wed May 8 19:11:47 2013 (r250378) +++ head/usr.sbin/bsnmpd/modules/Makefile Wed May 8 20:03:37 2013 (r250379) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf \ Added: head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Wed May 8 20:03:37 2013 (r250379) @@ -0,0 +1,298 @@ +-- +-- Copyright (c) 2013 Mikolaj Golub +-- All rights reserved. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. +-- +-- $FreeBSD$ +-- + +BEGEMOT-HAST-MIB DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, + Counter64, Integer32 + FROM SNMPv2-SMI + TEXTUAL-CONVENTION, RowStatus + FROM SNMPv2-TC + InterfaceIndex, ifIndex + FROM IF-MIB + begemot + FROM BEGEMOT-MIB; + +begemotHast MODULE-IDENTITY + LAST-UPDATED "201304130000Z" + ORGANIZATION "FreeBSD" + CONTACT-INFO + " Mikolaj Golub + + Postal: Bluhera 27v 11 + 61146 Kharkiv + Ukraine + + Fax: N/A + + E-Mail: trociny@FreeBSD.org" + DESCRIPTION + "The Begemot MIB for managing HAST." + REVISION "201304130000Z" + DESCRIPTION + "Initial revision." + ::= { begemot 220 } + +begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } + +-- ---------------------------------------------------------- -- +-- Configuration parameters +-- ---------------------------------------------------------- -- + +hastConfig OBJECT IDENTIFIER ::= { begemotHastObjects 1 } + +hastConfigFile OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "HAST configuration file location." + ::= { hastConfig 1 } + +-- ---------------------------------------------------------- -- +-- Resource Table +-- ---------------------------------------------------------- -- +hastResourceTable OBJECT-TYPE + SYNTAX SEQUENCE OF HastResourceEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "A table containing information about all HAST resources." + ::= { begemotHastObjects 2 } + +hastResourceEntry OBJECT-TYPE + SYNTAX HastResourceEntry + MAX-ACCESS not-accessible + STATUS current + DESCRIPTION + "Table entry that describes one HAST resource." + INDEX { hastResourceIndex } + ::= { hastResourceTable 1 } + +HastResourceEntry ::= SEQUENCE { + hastResourceIndex Integer32, + hastResourceName OCTET STRING, + hastResourceRole INTEGER, + hastResourceProvName OCTET STRING, + hastResourceLocalPath OCTET STRING, + hastResourceExtentSize Integer32, + hastResourceKeepDirty Integer32, + hastResourceRemoteAddr OCTET STRING, + hastResourceSourceAddr OCTET STRING, + hastResourceReplication INTEGER, + hastResourceStatus INTEGER, + hastResourceDirty Counter64, + hastResourceReads Counter64, + hastResourceWrites Counter64, + hastResourceDeletes Counter64, + hastResourceFlushes Counter64, + hastResourceActivemapUpdates Counter64, + hastResourceReadErrors Counter64, + hastResourceWriteErrors Counter64, + hastResourceDeleteErrors Counter64, + hastResourceFlushErrors Counter64 +} + +hastResourceIndex OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Resource index." + ::= { hastResourceEntry 1 } + +hastResourceName OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Resource name." + ::= { hastResourceEntry 2 } + +hastResourceRole OBJECT-TYPE + SYNTAX INTEGER { undef(0), init(1), primary(2), secondary(3) } + MAX-ACCESS read-write + STATUS current + DESCRIPTION + "Resource role." + ::= { hastResourceEntry 3 } + +hastResourceProvName OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Resource GEOM provider name that appears as /dev/hast/." + ::= { hastResourceEntry 4 } + +hastResourceLocalPath OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Path to the local component which is used as a backend + provider for the resource." + ::= { hastResourceEntry 5 } + +hastResourceExtentSize OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Size of an extent. Extent is a block which is + used for synchronization. hastd(8) maintains a + map of dirty extents and extent is the smallest + region that can be marked as dirty. If any part + of an extent is modified, entire extent will be + synchronized when nodes connect." + ::= { hastResourceEntry 6 } + +hastResourceKeepDirty OBJECT-TYPE + SYNTAX Integer32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Maximum number of dirty extents to keep dirty all + the time. Most recently used extents are kept + dirty to reduce number of metadata updates." + ::= { hastResourceEntry 7 } + +hastResourceRemoteAddr OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Address of the remote hastd(8) daemon for the resource." + ::= { hastResourceEntry 8 } + +hastResourceSourceAddr OBJECT-TYPE + SYNTAX OCTET STRING + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Local address the resource is bound to." + ::= { hastResourceEntry 9 } + +hastResourceReplication OBJECT-TYPE + SYNTAX INTEGER { fullsync(0), memsync(1), async(2) } + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Resource replication mode." + ::= { hastResourceEntry 10 } + +hastResourceStatus OBJECT-TYPE + SYNTAX INTEGER { complete(0), degraded(1) } + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Resource replication status." + ::= { hastResourceEntry 11 } + +hastResourceDirty OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Current number of dirty extents for the resource." + ::= { hastResourceEntry 12 } + +hastResourceReads OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local read operations." + ::= { hastResourceEntry 13 } + +hastResourceWrites OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local write operations." + ::= { hastResourceEntry 14 } + +hastResourceDeletes OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local delete operations." + ::= { hastResourceEntry 15 } + +hastResourceFlushes OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local flush operations." + ::= { hastResourceEntry 16 } + +hastResourceActivemapUpdates OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local activemap updates." + ::= { hastResourceEntry 17 } + +hastResourceReadErrors OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local read operations that failed." + ::= { hastResourceEntry 18 } + +hastResourceWriteErrors OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local write operations that failed." + ::= { hastResourceEntry 19 } + +hastResourceDeleteErrors OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local delete operations that failed." + ::= { hastResourceEntry 20 } + +hastResourceFlushErrors OBJECT-TYPE + SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Count of resource local flush operations that failed." + ::= { hastResourceEntry 21 } + +END Added: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) @@ -0,0 +1,43 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../../../sbin/hastd + +MOD= hast +SRCS= ebuf.c +SRCS+= hast_compression.c hast_proto.c hast_snmp.c +SRCS+= lzf.c +SRCS+= nv.c +SRCS+= parse.y pjdlog.c +SRCS+= proto.c proto_common.c proto_uds.c +SRCS+= token.l +SRCS+= y.tab.h +MAN= snmp_hast.8 + +NO_WFORMAT= +NO_WCAST_ALIGN= +NO_WMISSING_VARIABLE_DECLARATIONS= +CFLAGS+=-I${.CURDIR}/../../../../sbin/hastd +CFLAGS+=-DHAVE_CAPSICUM +CFLAGS+=-DINET +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif +# This is needed to have WARNS > 1. +CFLAGS+=-DYY_NO_UNPUT +CFLAGS+=-DYY_NO_INPUT +CFLAGS+= -DSNMPTREE_TYPES + +DPADD= ${LIBL} ${LIBUTIL} +LDADD= -ll -lutil + +XSYM= begemotHast +DEFS= ${MOD}_tree.def +BMIBS= BEGEMOT-HAST-MIB.txt + +YFLAGS+=-v + +CLEANFILES=y.tab.c y.tab.h y.output + +.include Added: head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Wed May 8 20:03:37 2013 (r250379) @@ -0,0 +1,506 @@ +/*- + * Copyright (c) 2013 Mikolaj Golub + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include + +#include "hast.h" +#include "hast_oid.h" +#include "hast_proto.h" +#include "hast_tree.h" +#include "nv.h" +#include "pjdlog.h" +#include "proto.h" + +#define UPDATE_INTERVAL 500 /* update interval in ticks */ + +static struct lmodule *module; + +static const struct asn_oid oid_hast = OIDX_begemotHast; + +/* the Object Resource registration index */ +static u_int hast_index = 0; + +/* + * Structure that describes single resource. + */ +struct hast_snmp_resource { + TAILQ_ENTRY(hast_snmp_resource) link; + int32_t index; + char name[NAME_MAX]; + int error; + int role; + char provname[NAME_MAX]; + char localpath[PATH_MAX]; + int32_t extentsize; + int32_t keepdirty; + char remoteaddr[HAST_ADDRSIZE]; + char sourceaddr[HAST_ADDRSIZE]; + int replication; + int status; + uint64_t dirty; + uint64_t reads; + uint64_t writes; + uint64_t deletes; + uint64_t flushes; + uint64_t activemap_updates; + uint64_t read_errors; + uint64_t write_errors; + uint64_t delete_errors; + uint64_t flush_errors; +}; + +static TAILQ_HEAD(, hast_snmp_resource) resources = + TAILQ_HEAD_INITIALIZER(resources); + +/* Path to configuration file. */ +static u_char *cfgpath; +/* Ticks of the last hast resources update. */ +static uint64_t last_resources_update; + +static void free_resources(void); +static int hastctl(struct nv *nvin, struct nv **nvout); +static int hast_fini(void); +static int hast_init(struct lmodule *mod, int argc, char *argv[]); +static void hast_start(void); +static int set_role(const char *resource, int role); +static int str2role(const char *str); +static int str2replication(const char *str); +static int str2status(const char *str); +static int update_resources(void); + +const struct snmp_module config = { + .comment = "This module implements the BEGEMOT MIB for HAST.", + .init = hast_init, + .start = hast_start, + .fini = hast_fini, + .tree = hast_ctree, + .tree_size = hast_CTREE_SIZE, +}; + +static int +hast_init(struct lmodule *mod, int argc __unused, char *argv[] __unused) +{ + + module = mod; + + pjdlog_init(PJDLOG_MODE_SYSLOG); + pjdlog_debug_set(0); + + cfgpath = malloc(sizeof(HAST_CONFIG)); + if (cfgpath == NULL) { + pjdlog_error("Unable to allocate %zu bytes for cfgpath", + sizeof(HAST_CONFIG)); + return (-1); + } + strcpy(cfgpath, HAST_CONFIG); + return(0); +} + +static void +hast_start(void) +{ + hast_index = or_register(&oid_hast, + "The MIB module for BEGEMOT-HAST-MIB.", module); +} + +static int +hast_fini(void) +{ + + or_unregister(hast_index); + free_resources(); + free(cfgpath); + return (0); +} + +static void +free_resources(void) +{ + struct hast_snmp_resource *res; + + while ((res = TAILQ_FIRST(&resources)) != NULL) { + TAILQ_REMOVE(&resources, res, link); + free(res); + } +} + +static int +str2role(const char *str) +{ + + if (strcmp(str, "init") == 0) + return (HAST_ROLE_INIT); + if (strcmp(str, "primary") == 0) + return (HAST_ROLE_PRIMARY); + if (strcmp(str, "secondary") == 0) + return (HAST_ROLE_SECONDARY); + return (HAST_ROLE_UNDEF); +} + +static int +str2replication(const char *str) +{ + + if (strcmp(str, "fullsync") == 0) + return (HAST_REPLICATION_FULLSYNC); + if (strcmp(str, "memsync") == 0) + return (HAST_REPLICATION_MEMSYNC); + if (strcmp(str, "async") == 0) + return (HAST_REPLICATION_ASYNC); + return (-1); +} + +static int +str2status(const char *str) +{ + + if (strcmp(str, "complete") == 0) + return (0); + if (strcmp(str, "degraded") == 0) + return (1); + return (-1); +} + +static int +hastctl(struct nv *nvin, struct nv **nvout) +{ + struct hastd_config *cfg; + struct proto_conn *conn; + struct nv *nv; + int error; + + cfg = yy_config_parse(cfgpath, true); + if (cfg == NULL) + return (-1); + + /* Setup control connection... */ + if (proto_client(NULL, cfg->hc_controladdr, &conn) == -1) { + pjdlog_error("Unable to setup control connection to %s", + cfg->hc_controladdr); + return (-1); + } + /* ...and connect to hastd. */ + if (proto_connect(conn, HAST_TIMEOUT) == -1) { + pjdlog_error("Unable to connect to hastd via %s", + cfg->hc_controladdr); + proto_close(conn); + return (-1); + } + /* Send the command to the server... */ + if (hast_proto_send(NULL, conn, nvin, NULL, 0) == -1) { + pjdlog_error("Unable to send command to hastd via %s", + cfg->hc_controladdr); + proto_close(conn); + return (-1); + } + /* ...and receive reply. */ + if (hast_proto_recv_hdr(conn, &nv) == -1) { + pjdlog_error("cannot receive reply from hastd via %s", + cfg->hc_controladdr); + proto_close(conn); + return (-1); + } + proto_close(conn); + error = nv_get_int16(nv, "error"); + if (error != 0) { + pjdlog_error("Error %d received from hastd.", error); + nv_free(nv); + return (-1); + } + nv_set_error(nv, 0); + *nvout = nv; + return (0); +} + +static int +set_role(const char *resource, int role) +{ + struct nv *nvin, *nvout; + int error; + + nvin = nv_alloc(); + nv_add_string(nvin, resource, "resource%d", 0); + nv_add_uint8(nvin, HASTCTL_CMD_SETROLE, "cmd"); + nv_add_uint8(nvin, role, "role"); + error = hastctl(nvin, &nvout); + nv_free(nvin); + if (error != 0) + return (-1); + nv_free(nvout); + return (SNMP_ERR_NOERROR); +} + +static int +update_resources(void) +{ + struct hast_snmp_resource *res; + struct nv *nvin, *nvout; + static uint64_t now; + unsigned int i; + const char *str; + int error; + + now = get_ticks(); + if (now - last_resources_update < UPDATE_INTERVAL) + return (0); + + last_resources_update = now; + + free_resources(); + + nvin = nv_alloc(); + nv_add_uint8(nvin, HASTCTL_CMD_STATUS, "cmd"); + nv_add_string(nvin, "all", "resource%d", 0); + error = hastctl(nvin, &nvout); + nv_free(nvin); + if (error != 0) + return (-1); + + for (i = 0; ; i++) { + str = nv_get_string(nvout, "resource%u", i); + if (str == NULL) + break; + res = calloc(1, sizeof(*res)); + if (res == NULL) { + pjdlog_error("Unable to allocate %zu bytes for " + "resource", sizeof(*res)); + return (-1); + } + res->index = i + 1; + strncpy(res->name, str, sizeof(res->name) - 1); + error = nv_get_int16(nvout, "error%u", i); + if (error != 0) + continue; + str = nv_get_string(nvout, "role%u", i); + res->role = str != NULL ? str2role(str) : HAST_ROLE_UNDEF; + str = nv_get_string(nvout, "provname%u", i); + if (str != NULL) + strncpy(res->provname, str, sizeof(res->provname) - 1); + str = nv_get_string(nvout, "localpath%u", i); + if (str != NULL) { + strncpy(res->localpath, str, + sizeof(res->localpath) - 1); + } + res->extentsize = nv_get_uint32(nvout, "extentsize%u", i); + res->keepdirty = nv_get_uint32(nvout, "keepdirty%u", i); + str = nv_get_string(nvout, "remoteaddr%u", i); + if (str != NULL) { + strncpy(res->remoteaddr, str, + sizeof(res->remoteaddr) - 1); + } + str = nv_get_string(nvout, "sourceaddr%u", i); + if (str != NULL) { + strncpy(res->sourceaddr, str, + sizeof(res->sourceaddr) - 1); + } + str = nv_get_string(nvout, "replication%u", i); + res->replication = str != NULL ? str2replication(str) : -1; + str = nv_get_string(nvout, "status%u", i); + res->status = str != NULL ? str2status(str) : -1; + res->dirty = nv_get_uint64(nvout, "dirty%u", i); + res->reads = nv_get_uint64(nvout, "stat_read%u", i); + res->writes = nv_get_uint64(nvout, "stat_write%u", i); + res->deletes = nv_get_uint64(nvout, "stat_delete%u", i); + res->flushes = nv_get_uint64(nvout, "stat_flush%u", i); + res->activemap_updates = + nv_get_uint64(nvout, "stat_activemap_update%u", i); + res->read_errors = + nv_get_uint64(nvout, "stat_read_error%u", i); + res->write_errors = + nv_get_uint64(nvout, "stat_write_error%u", i); + res->delete_errors = + nv_get_uint64(nvout, "stat_delete_error%u", i); + res->flush_errors = + nv_get_uint64(nvout, "stat_flush_error%u", i); + TAILQ_INSERT_TAIL(&resources, res, link); + } + nv_free(nvout); + return (0); +} + +int +op_hastConfig(struct snmp_context *context, struct snmp_value *value, + u_int sub, u_int iidx __unused, enum snmp_op op) +{ + asn_subid_t which; + + which = value->var.subs[sub - 1]; + + switch (op) { + case SNMP_OP_GET: + switch (which) { + case LEAF_hastConfigFile: + return (string_get(value, cfgpath, -1)); + default: + return (SNMP_ERR_RES_UNAVAIL); + } + case SNMP_OP_SET: + switch (which) { + case LEAF_hastConfigFile: + return (string_save(value, context, -1, + (u_char **)&cfgpath)); + default: + return (SNMP_ERR_RES_UNAVAIL); + } + case SNMP_OP_GETNEXT: + case SNMP_OP_ROLLBACK: + case SNMP_OP_COMMIT: + return (SNMP_ERR_NOERROR); + default: + return (SNMP_ERR_RES_UNAVAIL); + } +} + +int +op_hastResourceTable(struct snmp_context *context __unused, + struct snmp_value *value, u_int sub, u_int iidx __unused, enum snmp_op op) +{ + struct hast_snmp_resource *res; + asn_subid_t which; + int ret; + + if (update_resources() == -1) + return (SNMP_ERR_RES_UNAVAIL); + + which = value->var.subs[sub - 1]; + + switch (op) { + case SNMP_OP_GETNEXT: + res = NEXT_OBJECT_INT(&resources, &value->var, sub); + if (res == NULL) + return (SNMP_ERR_NOSUCHNAME); + value->var.len = sub + 1; + value->var.subs[sub] = res->index; + break; + case SNMP_OP_GET: + if (value->var.len - sub != 1) + return (SNMP_ERR_NOSUCHNAME); + res = FIND_OBJECT_INT(&resources, &value->var, sub); + if (res == NULL) + return (SNMP_ERR_NOSUCHNAME); + break; + case SNMP_OP_SET: + res = FIND_OBJECT_INT(&resources, &value->var, sub); + if (res == NULL) + return (SNMP_ERR_NOSUCHNAME); + switch (which) { + case LEAF_hastResourceRole: + ret = set_role(res->name, value->v.integer); + /* force update on next run */ + last_resources_update = 0; + break; + default: + ret = SNMP_ERR_NOT_WRITEABLE; + break; + } + return ret; + case SNMP_OP_ROLLBACK: + case SNMP_OP_COMMIT: + return (SNMP_ERR_NOERROR); + default: + return (SNMP_ERR_RES_UNAVAIL); + } + + ret = SNMP_ERR_NOERROR; + + switch (which) { + case LEAF_hastResourceIndex: + value->v.integer = res->index; + break; + case LEAF_hastResourceName: + ret = string_get(value, res->name, -1); + break; + case LEAF_hastResourceRole: + value->v.integer = res->role; + break; + case LEAF_hastResourceProvName: + ret = string_get(value, res->provname, -1); + break; + case LEAF_hastResourceLocalPath: + ret = string_get(value, res->localpath, -1); + break; + case LEAF_hastResourceExtentSize: + value->v.integer = res->extentsize; + break; + case LEAF_hastResourceKeepDirty: + value->v.integer = res->keepdirty; + break; + case LEAF_hastResourceRemoteAddr: + ret = string_get(value, res->remoteaddr, -1); + break; + case LEAF_hastResourceSourceAddr: + ret = string_get(value, res->sourceaddr, -1); + break; + case LEAF_hastResourceReplication: + value->v.integer = res->replication; + break; + case LEAF_hastResourceStatus: + value->v.integer = res->status; + break; + case LEAF_hastResourceDirty: + value->v.counter64 = res->dirty; + break; + case LEAF_hastResourceReads: + value->v.counter64 = res->reads; + break; + case LEAF_hastResourceWrites: + value->v.counter64 = res->writes; + break; + case LEAF_hastResourceDeletes: + value->v.counter64 = res->deletes; + break; + case LEAF_hastResourceFlushes: + value->v.counter64 = res->flushes; + break; + case LEAF_hastResourceActivemapUpdates: + value->v.counter64 = res->activemap_updates; + break; + case LEAF_hastResourceReadErrors: + value->v.counter64 = res->read_errors; + break; + case LEAF_hastResourceWriteErrors: + value->v.counter64 = res->write_errors; + break; + case LEAF_hastResourceDeleteErrors: + value->v.counter64 = res->delete_errors; + break; + case LEAF_hastResourceFlushErrors: + value->v.counter64 = res->flush_errors; + break; + default: + ret = SNMP_ERR_RES_UNAVAIL; + break; + } + return (ret); +} Added: head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Wed May 8 20:03:37 2013 (r250379) @@ -0,0 +1,70 @@ +#- +# Copyright (c) 2013 Mikolaj Golub +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +(1 internet + (4 private + (1 enterprises + (12325 fokus + (1 begemot + (220 begemotHast + (1 begemotHastObjects + (1 hastConfig + (1 hastConfigFile OCTETSTRING op_hastConfig GET) + ) + (2 hastResourceTable + (1 hastResourceEntry : OCTETSTRING op_hastResourceTable + (1 hastResourceIndex INTEGER32 GET) + (2 hastResourceName OCTETSTRING GET) + (3 hastResourceRole INTEGER GET SET) + (4 hastResourceProvName OCTETSTRING GET) + (5 hastResourceLocalPath OCTETSTRING GET) + (6 hastResourceExtentSize INTEGER32 GET) + (7 hastResourceKeepDirty INTEGER32 GET) + (8 hastResourceRemoteAddr OCTETSTRING GET) + (9 hastResourceSourceAddr OCTETSTRING GET) + (10 hastResourceReplication INTEGER GET) + (11 hastResourceStatus INTEGER GET) + (12 hastResourceDirty COUNTER64 GET) + (13 hastResourceReads COUNTER64 GET) + (14 hastResourceWrites COUNTER64 GET) + (15 hastResourceDeletes COUNTER64 GET) + (16 hastResourceFlushes COUNTER64 GET) + (17 hastResourceActivemapUpdates COUNTER64 GET) + (18 hastResourceReadErrors COUNTER64 GET) + (19 hastResourceWriteErrors COUNTER64 GET) + (20 hastResourceDeleteErrors COUNTER64 GET) + (21 hastResourceFlushErrors COUNTER64 GET) + ) + ) + ) + ) + ) + ) + ) + ) +) Added: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Wed May 8 20:03:37 2013 (r250379) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 1, 2013 +.Dt SNMP_HAST 8 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:04:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1CD68160; Wed, 8 May 2013 20:04:33 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0FF999E3; Wed, 8 May 2013 20:04:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48K4WLN062512; Wed, 8 May 2013 20:04:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48K4WTI062510; Wed, 8 May 2013 20:04:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305082004.r48K4WTI062510@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 8 May 2013 20:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250380 - head/contrib/bsnmp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:04:33 -0000 Author: trociny Date: Wed May 8 20:04:32 2013 New Revision: 250380 URL: http://svnweb.freebsd.org/changeset/base/250380 Log: Register OID for HAST module. MFC after: 2 weeks Modified: head/contrib/bsnmp/oid-list Modified: head/contrib/bsnmp/oid-list ============================================================================== --- head/contrib/bsnmp/oid-list Wed May 8 20:03:37 2013 (r250379) +++ head/contrib/bsnmp/oid-list Wed May 8 20:04:32 2013 (r250380) @@ -24,6 +24,7 @@ enterprises 204 pingData bsnmp-ping (Nate Nielsen ) 205 begemotBridge bridge module 210 begemotWlan WLAN module + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project 303 BEGEMOT-WLINK DLR WLINK simulator From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:46:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31351B6F; Wed, 8 May 2013 20:46:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12758B62; Wed, 8 May 2013 20:46:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48KksIs076928; Wed, 8 May 2013 20:46:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48KksB9076925; Wed, 8 May 2013 20:46:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082046.r48KksB9076925@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250381 - head/sys/dev/etherswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:46:55 -0000 Author: adrian Date: Wed May 8 20:46:54 2013 New Revision: 250381 URL: http://svnweb.freebsd.org/changeset/base/250381 Log: Add the ability to change the vlan operation mode. This adds a vlan capability field to etherswitch_info structure and some definitions of ports flags. It adds the support to global config parameters which right now is used only to switch between the vlan modes, but it is intended to be extended to support the setup of others parameters (STP, mirror, etc.). Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sys/dev/etherswitch/etherswitch.c head/sys/dev/etherswitch/etherswitch.h head/sys/dev/etherswitch/etherswitch_if.m Modified: head/sys/dev/etherswitch/etherswitch.c ============================================================================== --- head/sys/dev/etherswitch/etherswitch.c Wed May 8 20:04:32 2013 (r250380) +++ head/sys/dev/etherswitch/etherswitch.c Wed May 8 20:46:54 2013 (r250381) @@ -200,6 +200,7 @@ etherswitchioctl(struct cdev *cdev, u_lo struct etherswitch_softc *sc = cdev->si_drv1; device_t dev = sc->sc_dev; device_t etherswitch = device_get_parent(dev); + etherswitch_conf_t conf; etherswitch_info_t *info; etherswitch_reg_t *reg; etherswitch_phyreg_t *phyreg; @@ -251,6 +252,16 @@ etherswitchioctl(struct cdev *cdev, u_lo error = ETHERSWITCH_WRITEPHYREG(etherswitch, phyreg->phy, phyreg->reg, phyreg->val); break; + case IOETHERSWITCHGETCONF: + bzero(&conf, sizeof(etherswitch_conf_t)); + error = ETHERSWITCH_GETCONF(etherswitch, &conf); + bcopy(&conf, data, sizeof(etherswitch_conf_t)); + break; + + case IOETHERSWITCHSETCONF: + error = ETHERSWITCH_SETCONF(etherswitch, (etherswitch_conf_t *)data); + break; + default: error = ENOTTY; } Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Wed May 8 20:04:32 2013 (r250380) +++ head/sys/dev/etherswitch/etherswitch.h Wed May 8 20:46:54 2013 (r250381) @@ -25,18 +25,47 @@ struct etherswitch_phyreg { }; typedef struct etherswitch_phyreg etherswitch_phyreg_t; -#define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_VLAN_ISL (1 << 0) /* ISL */ +#define ETHERSWITCH_VLAN_PORT (1 << 1) /* Port based vlan */ +#define ETHERSWITCH_VLAN_DOT1Q (1 << 2) /* 802.1q */ +#define ETHERSWITCH_VLAN_DOT1Q_4K (1 << 3) /* 4k support on 802.1q */ +#define ETHERSWITCH_VLAN_DOUBLE_TAG (1 << 4) /* Q-in-Q */ +#define ETHERSWITCH_VLAN_CAPS_BITS \ +"\020\1ISL\2PORT\3DOT1Q\4DOT1Q4K\5QinQ" struct etherswitch_info { int es_nports; int es_nvlangroups; char es_name[ETHERSWITCH_NAMEMAX]; + uint32_t es_vlan_caps; }; typedef struct etherswitch_info etherswitch_info_t; +#define ETHERSWITCH_CONF_FLAGS (1 << 0) +#define ETHERSWITCH_CONF_MIRROR (1 << 1) +#define ETHERSWITCH_CONF_VLAN_MODE (1 << 2) + +struct etherswitch_conf { + uint32_t cmd; /* What to configure */ + uint32_t vlan_mode; /* Switch VLAN mode */ +}; +typedef struct etherswitch_conf etherswitch_conf_t; + +#define ETHERSWITCH_PORT_CPU (1 << 0) +#define ETHERSWITCH_PORT_STRIPTAG (1 << 1) +#define ETHERSWITCH_PORT_ADDTAG (1 << 2) +#define ETHERSWITCH_PORT_FIRSTLOCK (1 << 3) +#define ETHERSWITCH_PORT_DROPUNTAGGED (1 << 4) +#define ETHERSWITCH_PORT_DOUBLE_TAG (1 << 5) +#define ETHERSWITCH_PORT_INGRESS (1 << 6) +#define ETHERSWITCH_PORT_FLAGS_BITS \ +"\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" + struct etherswitch_port { int es_port; int es_pvid; + uint32_t es_flags; union { struct ifreq es_uifr; struct ifmediareq es_uifmr; @@ -66,5 +95,7 @@ typedef struct etherswitch_vlangroup eth #define IOETHERSWITCHSETVLANGROUP _IOW('i', 7, etherswitch_vlangroup_t) #define IOETHERSWITCHGETPHYREG _IOWR('i', 8, etherswitch_phyreg_t) #define IOETHERSWITCHSETPHYREG _IOW('i', 9, etherswitch_phyreg_t) +#define IOETHERSWITCHGETCONF _IOR('i', 10, etherswitch_conf_t) +#define IOETHERSWITCHSETCONF _IOW('i', 11, etherswitch_conf_t) #endif Modified: head/sys/dev/etherswitch/etherswitch_if.m ============================================================================== --- head/sys/dev/etherswitch/etherswitch_if.m Wed May 8 20:04:32 2013 (r250380) +++ head/sys/dev/etherswitch/etherswitch_if.m Wed May 8 20:46:54 2013 (r250381) @@ -23,6 +23,18 @@ CODE { null_etherswitch_unlock(device_t dev) { } + + static int + null_etherswitch_getconf(device_t dev, etherswitch_conf_t *conf) + { + return (0); + } + + static int + null_etherswitch_setconf(device_t dev, etherswitch_conf_t *conf) + { + return (0); + } }; # @@ -113,3 +125,19 @@ METHOD int setvgroup { device_t dev; etherswitch_vlangroup_t *vg; } + +# +# Get the Switch configuration +# +METHOD int getconf { + device_t dev; + etherswitch_conf_t *conf; +} DEFAULT null_etherswitch_getconf; + +# +# Set the Switch configuration +# +METHOD int setconf { + device_t dev; + etherswitch_conf_t *conf; +} DEFAULT null_etherswitch_setconf; From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:52:23 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A3E2E7D; Wed, 8 May 2013 20:52:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1BAF7C21; Wed, 8 May 2013 20:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48KqMPL079482; Wed, 8 May 2013 20:52:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48KqMQ9079480; Wed, 8 May 2013 20:52:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082052.r48KqMQ9079480@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:52:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250382 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:52:23 -0000 Author: adrian Date: Wed May 8 20:52:22 2013 New Revision: 250382 URL: http://svnweb.freebsd.org/changeset/base/250382 Log: Add vlan configuration support to etherswitchcfg. This adds the support to the config keyword (vlan operation mode), ports flags, prints the vlan mode and vlan capabilities. It also adds some basic information to usage() and support the keyword 'help' as a shortcut to usage(). The manual page is also updated with the new options. Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Wed May 8 20:46:54 2013 (r250381) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Wed May 8 20:52:22 2013 (r250382) @@ -11,12 +11,16 @@ .Ar info .Nm .Op Fl "f control file" +.Ar config +.Ar command parameter +.Nm +.Op Fl "f control file" .Ar phy .Ar phy.register[=value] .Nm .Op Fl "f control file" .Ar port%d -.Ar command parameter +.Ar [flags] command parameter .Nm .Op Fl "f control file" .Ar reg @@ -46,6 +50,14 @@ Produce more verbose output. Without this flag, lines that represent inactive or empty configuration options are omitted. .El +.Ss config +The config command provides access to global switch configuration +parameters. +It support the following commands: +.Bl -tag -width ".Ar vlan_mode mode" -compact +.It Ar vlan_mode mode +Sets the switch VLAN mode (depends on the hardware). +.El .Ss phy The phy command provides access to the registers of the PHYs attached to or integrated into the switch controller. @@ -75,6 +87,37 @@ for details on and .Ar mediaopt . .El +And the following flags (please note that not all flags +are supporterd by all switch drivers): +.Bl -tag -width ".Ar addtag" -compact +.It Ar addtag +Add VLAN tag to each packet sent by the port. +.It Ar -addtag +Disable the add VLAN tag option. +.It Ar striptag +Strip the VLAN tags from the packets sent by the port. +.It Ar -striptag +Disable the strip VLAN tag option. +.It Ar firstlock +This options makes the switch port lock on the first MAC address it seems. +After that, usually you need to reset the switch to learn different +MAC addresses. +.It Ar -firstlock +Disable the first lock option. Note that sometimes you need to reset the +switch to really disable this option. +.It Ar dropuntagged +Drop packets without a VLAN tag. +.It Ar -dropuntagged +Disable the drop untagged packets option. +.It Ar doubletag +Enable QinQ for the port. +.It Ar -doubletag +Disable QinQ for the port. +.It Ar ingress +Enable the ingress filter on the port. +.It Ar -ingress +Disable the ingress filter. +.El .Ss reg The reg command provides access to the registers of the switch controller. .Ss vlangroup Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Wed May 8 20:46:54 2013 (r250381) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Wed May 8 20:52:22 2013 (r250382) @@ -58,6 +58,7 @@ void print_media_word_ifconfig(int); enum cmdmode { MODE_NONE = 0, MODE_PORT, + MODE_CONFIG, MODE_VLANGROUP, MODE_REGISTER, MODE_PHYREG @@ -68,6 +69,7 @@ struct cfg { int verbose; int mediatypes; const char *controlfile; + etherswitch_conf_t conf; etherswitch_info_t info; enum cmdmode mode; int unit; @@ -82,7 +84,37 @@ struct cmds { static struct cmds cmds[]; -static void usage(void); +/* + * Print a value a la the %b format of the kernel's printf. + * Stolen from ifconfig.c. + */ +static void +printb(const char *s, unsigned v, const char *bits) +{ + int i, any = 0; + char c; + + if (bits && *bits == 8) + printf("%s=%o", s, v); + else + printf("%s=%x", s, v); + bits++; + if (bits) { + putchar('<'); + while ((i = *bits++) != '\0') { + if (v & (1 << (i-1))) { + if (any) + putchar(','); + any = 1; + for (; (c = *bits) > 32; bits++) + putchar(c); + } else + for (; *bits > 32; bits++) + ; + } + putchar('>'); + } +} static int read_register(struct cfg *cfg, int r) @@ -150,6 +182,47 @@ set_port_vid(struct cfg *cfg, char *argv } static void +set_port_flag(struct cfg *cfg, char *argv[]) +{ + char *flag; + int n; + uint32_t f; + etherswitch_port_t p; + + n = 0; + f = 0; + flag = argv[0]; + if (strcmp(flag, "none") != 0) { + if (*flag == '-') { + n++; + flag++; + } + if (strcasecmp(flag, "striptag") == 0) + f = ETHERSWITCH_PORT_STRIPTAG; + else if (strcasecmp(flag, "addtag") == 0) + f = ETHERSWITCH_PORT_ADDTAG; + else if (strcasecmp(flag, "firstlock") == 0) + f = ETHERSWITCH_PORT_FIRSTLOCK; + else if (strcasecmp(flag, "dropuntagged") == 0) + f = ETHERSWITCH_PORT_DROPUNTAGGED; + else if (strcasecmp(flag, "doubletag") == 0) + f = ETHERSWITCH_PORT_DOUBLE_TAG; + else if (strcasecmp(flag, "ingress") == 0) + f = ETHERSWITCH_PORT_INGRESS; + } + bzero(&p, sizeof(p)); + p.es_port = cfg->unit; + if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); + if (n) + p.es_flags &= ~f; + else + p.es_flags |= f; + if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHSETPORT)"); +} + +static void set_port_media(struct cfg *cfg, char *argv[]) { etherswitch_port_t p; @@ -290,6 +363,66 @@ set_phyregister(struct cfg *cfg, char *a } static void +set_vlan_mode(struct cfg *cfg, char *argv[]) +{ + etherswitch_conf_t conf; + + bzero(&conf, sizeof(conf)); + conf.cmd = ETHERSWITCH_CONF_VLAN_MODE; + if (strcasecmp(argv[1], "isl") == 0) + conf.vlan_mode = ETHERSWITCH_VLAN_ISL; + else if (strcasecmp(argv[1], "port") == 0) + conf.vlan_mode = ETHERSWITCH_VLAN_PORT; + else if (strcasecmp(argv[1], "dot1q") == 0) + conf.vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + else if (strcasecmp(argv[1], "dot1q4k") == 0) + conf.vlan_mode = ETHERSWITCH_VLAN_DOT1Q_4K; + else if (strcasecmp(argv[1], "qinq") == 0) + conf.vlan_mode = ETHERSWITCH_VLAN_DOUBLE_TAG; + else + conf.vlan_mode = 0; + if (ioctl(cfg->fd, IOETHERSWITCHSETCONF, &conf) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHSETCONF)"); +} + +static void +print_config(struct cfg *cfg) +{ + const char *c; + + /* Get the device name. */ + c = strrchr(cfg->controlfile, '/'); + if (c != NULL) + c = c + 1; + else + c = cfg->controlfile; + + /* Print VLAN mode. */ + if (cfg->conf.cmd & ETHERSWITCH_CONF_VLAN_MODE) { + printf("%s: VLAN mode: ", c); + switch (cfg->conf.vlan_mode) { + case ETHERSWITCH_VLAN_ISL: + printf("ISL\n"); + break; + case ETHERSWITCH_VLAN_PORT: + printf("PORT\n"); + break; + case ETHERSWITCH_VLAN_DOT1Q: + printf("DOT1Q\n"); + break; + case ETHERSWITCH_VLAN_DOT1Q_4K: + printf("DOT1Q4K\n"); + break; + case ETHERSWITCH_VLAN_DOUBLE_TAG: + printf("QinQ\n"); + break; + default: + printf("none\n"); + } + } +} + +static void print_port(struct cfg *cfg, int port) { etherswitch_port_t p; @@ -303,7 +436,10 @@ print_port(struct cfg *cfg, int port) if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); printf("port%d:\n", port); - printf("\tpvid: %d\n", p.es_pvid); + if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_DOT1Q) + printf("\tpvid: %d\n", p.es_pvid); + printb("\tflags", p.es_flags, ETHERSWITCH_PORT_FLAGS_BITS); + printf("\n"); printf("\tmedia: "); print_media_word(p.es_ifmr.ifm_current, 1); if (p.es_ifmr.ifm_active != p.es_ifmr.ifm_current) { @@ -335,10 +471,13 @@ print_vlangroup(struct cfg *cfg, int vla vg.es_vlangroup = vlangroup; if (ioctl(cfg->fd, IOETHERSWITCHGETVLANGROUP, &vg) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETVLANGROUP)"); - if (cfg->verbose == 0 && vg.es_member_ports == 0) + if (vg.es_vid == 0 && vg.es_member_ports == 0) return; printf("vlangroup%d:\n", vlangroup); - printf("\tvlan: %d\n", vg.es_vid); + if (cfg->conf.vlan_mode == ETHERSWITCH_VLAN_PORT) + printf("\tport: %d\n", vg.es_vid); + else + printf("\tvlan: %d\n", vg.es_vid); printf("\tmembers "); comma = 0; if (vg.es_member_ports != 0) @@ -368,9 +507,16 @@ print_info(struct cfg *cfg) c = c + 1; else c = cfg->controlfile; - if (cfg->verbose) - printf("%s: %s with %d ports and %d VLAN groups\n", - c, cfg->info.es_name, cfg->info.es_nports, cfg->info.es_nvlangroups); + if (cfg->verbose) { + printf("%s: %s with %d ports and %d VLAN groups\n", c, + cfg->info.es_name, cfg->info.es_nports, + cfg->info.es_nvlangroups); + printf("%s: ", c); + printb("VLAN capabilities", cfg->info.es_vlan_caps, + ETHERSWITCH_VLAN_CAPS_BITS); + printf("\n"); + } + print_config(cfg); for (i=0; iinfo.es_nports; i++) { print_port(cfg, i); } @@ -380,9 +526,23 @@ print_info(struct cfg *cfg) } static void -usage(void) +usage(struct cfg *cfg __unused, char *argv[] __unused) { fprintf(stderr, "usage: etherswitchctl\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] info\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] config " + "command parameter\n"); + fprintf(stderr, "\t\tconfig commands: vlan_mode\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] phy " + "phy.register[=value]\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] portX " + "[flags] command parameter\n"); + fprintf(stderr, "\t\tport commands: pvid, media, mediaopt\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] reg " + "register[=value]\n"); + fprintf(stderr, "\tetherswitchcfg [-f control file] vlangroupX " + "command parameter\n"); + fprintf(stderr, "\t\tvlangroup commands: vlan, members\n"); exit(EX_USAGE); } @@ -394,6 +554,15 @@ newmode(struct cfg *cfg, enum cmdmode mo switch (cfg->mode) { case MODE_NONE: break; + case MODE_CONFIG: + /* + * Read the updated the configuration (it can be different + * from the last time we read it). + */ + if (ioctl(cfg->fd, IOETHERSWITCHGETCONF, &cfg->conf) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHGETCONF)"); + print_config(cfg); + break; case MODE_PORT: print_port(cfg, cfg->unit); break; @@ -430,7 +599,7 @@ main(int argc, char *argv[]) case '?': /* FALLTHROUGH */ default: - usage(); + usage(&cfg, argv); } argc -= optind; argv += optind; @@ -439,6 +608,8 @@ main(int argc, char *argv[]) err(EX_UNAVAILABLE, "Can't open control file: %s", cfg.controlfile); if (ioctl(cfg.fd, IOETHERSWITCHGETINFO, &cfg.info) != 0) err(EX_OSERR, "ioctl(IOETHERSWITCHGETINFO)"); + if (ioctl(cfg.fd, IOETHERSWITCHGETCONF, &cfg.conf) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHGETCONF)"); if (argc == 0) { print_info(&cfg); return (0); @@ -457,15 +628,20 @@ main(int argc, char *argv[]) if (cfg.unit < 0 || cfg.unit >= cfg.info.es_nvlangroups) errx(EX_USAGE, "port unit must be between 0 and %d", cfg.info.es_nvlangroups); newmode(&cfg, MODE_VLANGROUP); + } else if (strcmp(argv[0], "config") == 0) { + newmode(&cfg, MODE_CONFIG); } else if (strcmp(argv[0], "phy") == 0) { newmode(&cfg, MODE_PHYREG); } else if (strcmp(argv[0], "reg") == 0) { newmode(&cfg, MODE_REGISTER); + } else if (strcmp(argv[0], "help") == 0) { + usage(&cfg, argv); } else { errx(EX_USAGE, "Unknown command \"%s\"", argv[0]); } break; case MODE_PORT: + case MODE_CONFIG: case MODE_VLANGROUP: for(i=0; cmds[i].name != NULL; i++) { if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0) { @@ -510,6 +686,19 @@ static struct cmds cmds[] = { { MODE_PORT, "pvid", 1, set_port_vid }, { MODE_PORT, "media", 1, set_port_media }, { MODE_PORT, "mediaopt", 1, set_port_mediaopt }, + { MODE_PORT, "addtag", 0, set_port_flag }, + { MODE_PORT, "-addtag", 0, set_port_flag }, + { MODE_PORT, "ingress", 0, set_port_flag }, + { MODE_PORT, "-ingress", 0, set_port_flag }, + { MODE_PORT, "striptag", 0, set_port_flag }, + { MODE_PORT, "-striptag", 0, set_port_flag }, + { MODE_PORT, "doubletag", 0, set_port_flag }, + { MODE_PORT, "-doubletag", 0, set_port_flag }, + { MODE_PORT, "firstlock", 0, set_port_flag }, + { MODE_PORT, "-firstlock", 0, set_port_flag }, + { MODE_PORT, "dropuntagged", 0, set_port_flag }, + { MODE_PORT, "-dropuntagged", 0, set_port_flag }, + { MODE_CONFIG, "vlan_mode", 1, set_vlan_mode }, { MODE_VLANGROUP, "vlan", 1, set_vlangroup_vid }, { MODE_VLANGROUP, "members", 1, set_vlangroup_members }, { 0, NULL, 0, NULL } From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:53:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 98DD8A0; Wed, 8 May 2013 20:53:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 765C9C36; Wed, 8 May 2013 20:53:39 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C5679B992; Wed, 8 May 2013 16:53:38 -0400 (EDT) From: John Baldwin To: attilio@freebsd.org Subject: Re: svn commit: r250339 - head/sys/x86/acpica Date: Wed, 8 May 2013 16:53:33 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305072249.r47MnvrO009846@svn.freebsd.org> <201305081201.16405.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Message-Id: <201305081653.33646.jhb@freebsd.org> Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 08 May 2013 16:53:38 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:53:39 -0000 On Wednesday, May 08, 2013 2:21:12 pm Attilio Rao wrote: > On Wed, May 8, 2013 at 6:01 PM, John Baldwin wrote: > > On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote: > >> Author: attilio > >> Date: Tue May 7 22:49:56 2013 > >> New Revision: 250339 > >> URL: http://svnweb.freebsd.org/changeset/base/250339 > >> > >> Log: > >> Add functions to do ACPI System Locality Information Table parsing > >> and printing at boot. > >> For reference on table informations and purposes please review ACPI specs. > >> > >> Sponsored by: EMC / Isilon storage division > >> Obtained from: jeff > >> Reviewed by: jhb (earlier version) > > > > Eh, I don't recall reviewing this. However, acpidump already dumps this > > table, and we should dump tables via acpidump, not in dmesg. > > Now that I read better this patch is based upon a patch you submitted > originally (see the private thread NUMA WIP). > We already print some useful ACPI table information at boot really > (APIC ACPI table case) and this is only printed out when having > MAXMEMDOM > 1. Finally I have also sent you this patch and you didn't > object. Humm, that was in an old thread, and I never responded to say "ok" to this. However, the patch I posted in that thread is the patch to dump the SLIT in acpidump and it was comitted back in r241198. That is the place to dump these tables, not in dmesg. We do not dump the raw contents of any other ACPI tables in dmesg, and have actively moved other tables out to userland (e.g. $PIR is dumped via a userland tool only). > However if you really dislike it I can print under bootverbose maybe? No, it does not belong in dmesg at all. Code to use its contents and honor it when setting the domain lists would be fine :), but printing it when you can more easily get it via acpidump -t is just clutter. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:54:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B85C23E; Wed, 8 May 2013 20:54:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E34CCB0; Wed, 8 May 2013 20:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Ksxsx079938; Wed, 8 May 2013 20:54:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48KsxnX079937; Wed, 8 May 2013 20:54:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082054.r48KsxnX079937@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250383 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:54:59 -0000 Author: adrian Date: Wed May 8 20:54:59 2013 New Revision: 250383 URL: http://svnweb.freebsd.org/changeset/base/250383 Log: Correctly mark the CPU port. Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Wed May 8 20:52:22 2013 (r250382) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Wed May 8 20:54:59 2013 (r250383) @@ -440,6 +440,7 @@ arswitch_getport(device_t dev, etherswit mii = arswitch_miiforport(sc, p->es_port); if (p->es_port == 0) { /* fill in fixed values for CPU port */ + p->es_flags |= ETHERSWITCH_PORT_CPU; ifmr->ifm_count = 0; ifmr->ifm_current = ifmr->ifm_active = IFM_ETHER | IFM_1000_T | IFM_FDX; From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:56:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CAA503D9; Wed, 8 May 2013 20:56:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3960CCA; Wed, 8 May 2013 20:56:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Kuhnf080380; Wed, 8 May 2013 20:56:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48Kuhxe080379; Wed, 8 May 2013 20:56:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082056.r48Kuhxe080379@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250384 - head/sys/dev/etherswitch/ukswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:56:43 -0000 Author: adrian Date: Wed May 8 20:56:43 2013 New Revision: 250384 URL: http://svnweb.freebsd.org/changeset/base/250384 Log: Fix the ukswitch code to work with the new vlan changes: * Fix API changes; * remove unused code; * Allow some switches to be used that don't expose a set of PHY registers for the CPU facing port (eg the ADM6996 for the Ubiquiti Routerstation.) Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c Modified: head/sys/dev/etherswitch/ukswitch/ukswitch.c ============================================================================== --- head/sys/dev/etherswitch/ukswitch/ukswitch.c Wed May 8 20:54:59 2013 (r250383) +++ head/sys/dev/etherswitch/ukswitch/ukswitch.c Wed May 8 20:56:43 2013 (r250384) @@ -120,8 +120,6 @@ ukswitch_attach_phys(struct ukswitch_sof continue; sc->ifpport[phy] = port; sc->portphy[port] = phy; -// if (phy == sc->cpuport) -// sc->info.es_cpuport = port; sc->ifp[port] = if_alloc(IFT_ETHER); sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | @@ -166,7 +164,7 @@ ukswitch_attach(device_t dev) /* XXX Defaults */ sc->numports = 6; sc->phymask = 0x0f; - sc->cpuport = 5; + sc->cpuport = -1; sc->media = 100; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), @@ -182,9 +180,9 @@ ukswitch_attach(device_t dev) if (sc->media != 100 && sc->media != 1000) sc->media = 100; - /* Always attach the cpu port. */ - sc->phymask |= (1 << sc->cpuport); -// sc->info.es_cpuport = sc->cpuport; + if (sc->cpuport != -1) + /* Always attach the cpu port. */ + sc->phymask |= (1 << sc->cpuport); /* We do not support any vlan groups. */ sc->info.es_nvlangroups = 0; @@ -347,15 +345,17 @@ ukswitch_getport(device_t dev, etherswit struct ukswitch_softc *sc = device_get_softc(dev); struct mii_data *mii; struct ifmediareq *ifmr = &p->es_ifmr; - int err; + int err, phy; if (p->es_port < 0 || p->es_port >= sc->numports) return (ENXIO); - p->es_vlangroup = 0; + p->es_pvid = 0; + phy = sc->portphy[p->es_port]; mii = ukswitch_miiforport(sc, p->es_port); - if (sc->portphy[p->es_port] == sc->cpuport) { + if (sc->cpuport != -1 && phy == sc->cpuport) { /* fill in fixed values for CPU port */ + p->es_flags |= ETHERSWITCH_PORT_CPU; ifmr->ifm_count = 0; if (sc->media == 100) ifmr->ifm_current = ifmr->ifm_active = From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:57:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 54E8E55C; Wed, 8 May 2013 20:57:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47676CD5; Wed, 8 May 2013 20:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Kvc4i080599; Wed, 8 May 2013 20:57:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48Kvbpp080595; Wed, 8 May 2013 20:57:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082057.r48Kvbpp080595@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250385 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:57:38 -0000 Author: adrian Date: Wed May 8 20:57:37 2013 New Revision: 250385 URL: http://svnweb.freebsd.org/changeset/base/250385 Log: Modify the routerstation config to use ukswitch for now. Until an ADM6996 driver shows up, this allows for the two switch ports to be used. Submitted by: Luiz Otavio O Souza Reviewed by: ray Modified: head/sys/mips/conf/ROUTERSTATION head/sys/mips/conf/ROUTERSTATION.hints Modified: head/sys/mips/conf/ROUTERSTATION ============================================================================== --- head/sys/mips/conf/ROUTERSTATION Wed May 8 20:56:43 2013 (r250384) +++ head/sys/mips/conf/ROUTERSTATION Wed May 8 20:57:37 2013 (r250385) @@ -18,5 +18,11 @@ options GEOM_UZIP # For DOS options MSDOSFS +# Etherswitch support +options ARGE_MDIO +device miiproxy +device etherswitch +device ukswitch + # Boot path - redboot MFS options ROOTDEVNAME=\"ufs:redboot/rootfs.uzip\" Modified: head/sys/mips/conf/ROUTERSTATION.hints ============================================================================== --- head/sys/mips/conf/ROUTERSTATION.hints Wed May 8 20:56:43 2013 (r250384) +++ head/sys/mips/conf/ROUTERSTATION.hints Wed May 8 20:57:37 2013 (r250385) @@ -5,12 +5,17 @@ # Uncomment this hint for RS (not PRO) # PHY20 = 1 << 20 hint.arge.0.phymask=0x100000 +hint.arge.0.mdio=mdioproxy1 # .. off of the switch mdiobus # should be 100 for RS hint.arge.1.media=100 hint.arge.1.fduplex=1 -# Uncomment this hint for RS (not PRO) -hint.arge.1.phymask=0x30000 +hint.arge.1.phymask=0x0 +hint.arge.1.mdio=mdioproxy1 # .. off of the switch mdiobus + +# ukswitch +hint.ukswitch.0.at="mdio0" +hint.ukswitch.0.phymask=0x30000 # RF led hint.gpioled.0.at="gpiobus0" From owner-svn-src-all@FreeBSD.ORG Wed May 8 20:58:42 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4CA46E4; Wed, 8 May 2013 20:58:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6168CE3; Wed, 8 May 2013 20:58:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Kwg8u080822; Wed, 8 May 2013 20:58:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48KwfTI080812; Wed, 8 May 2013 20:58:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082058.r48KwfTI080812@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 20:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250386 - in head/sys: conf dev/etherswitch/ip17x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 20:58:42 -0000 Author: adrian Date: Wed May 8 20:58:41 2013 New Revision: 250386 URL: http://svnweb.freebsd.org/changeset/base/250386 Log: Bring in a basic ethernet switch driver for the IP17x series of switches. These are notably found on some AR71xx based Mikrotik boards. Submitted by: Luiz Otavio O Souza Reviewed by: ray Added: head/sys/dev/etherswitch/ip17x/ head/sys/dev/etherswitch/ip17x/ip175c.c (contents, props changed) head/sys/dev/etherswitch/ip17x/ip175c.h (contents, props changed) head/sys/dev/etherswitch/ip17x/ip175d.c (contents, props changed) head/sys/dev/etherswitch/ip17x/ip175d.h (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x.c (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_phy.c (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_phy.h (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_reg.h (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_var.h (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_vlans.c (contents, props changed) head/sys/dev/etherswitch/ip17x/ip17x_vlans.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed May 8 20:57:37 2013 (r250385) +++ head/sys/conf/files Wed May 8 20:58:41 2013 (r250386) @@ -1331,6 +1331,11 @@ dev/etherswitch/arswitch/arswitch_8316.c dev/etherswitch/arswitch/arswitch_7240.c optional arswitch dev/etherswitch/etherswitch.c optional etherswitch dev/etherswitch/etherswitch_if.m optional etherswitch +dev/etherswitch/ip17x/ip17x.c optional ip17x +dev/etherswitch/ip17x/ip175c.c optional ip17x +dev/etherswitch/ip17x/ip175d.c optional ip17x +dev/etherswitch/ip17x/ip17x_phy.c optional ip17x +dev/etherswitch/ip17x/ip17x_vlans.c optional ip17x dev/etherswitch/mdio_if.m optional miiproxy dev/etherswitch/mdio.c optional miiproxy dev/etherswitch/miiproxy.c optional miiproxy Added: head/sys/dev/etherswitch/ip17x/ip175c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ip17x/ip175c.c Wed May 8 20:58:41 2013 (r250386) @@ -0,0 +1,249 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* + * IP175C specific functions. + */ + +/* + * Reset the switch. + */ +static int +ip175c_reset(struct ip17x_softc *sc) +{ + uint32_t data; + + /* Reset all the switch settings. */ + if (ip17x_writephy(sc->sc_dev, IP175C_RESET_PHY, IP175C_RESET_REG, + 0x175c)) + return (-1); + DELAY(2); + + /* Force IP175C mode. */ + data = ip17x_readphy(sc->sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG); + if (data == 0x175a) { + if (ip17x_writephy(sc->sc_dev, IP175C_MODE_PHY, IP175C_MODE_REG, + 0x175c)) + return (-1); + } + + return (0); +} + +static int +ip175c_port_vlan_setup(struct ip17x_softc *sc) +{ + struct ip17x_vlan *v; + uint32_t ports[IP175X_NUM_PORTS], reg[IP175X_NUM_PORTS/2]; + int i, err, phy; + + KASSERT(sc->cpuport == 5, ("cpuport != 5 not supported for IP175C")); + KASSERT(sc->numports == 6, ("numports != 6 not supported for IP175C")); + + /* Build the port access masks. */ + memset(ports, 0, sizeof(ports)); + for (i = 0; i < sc->info.es_nports; i++) { + phy = sc->portphy[i]; + v = &sc->vlan[i]; + ports[phy] = v->ports; + } + + /* Move the cpuport bit to its correct place. */ + for (i = 0; i < sc->numports; i++) { + if (ports[i] & (1 << sc->cpuport)) { + ports[i] |= (1 << 7); + ports[i] &= ~(1 << sc->cpuport); + } + } + + /* And now build the switch register data. */ + memset(reg, 0, sizeof(reg)); + for (i = 0; i < (sc->numports / 2); i++) + reg[i] = ports[i * 2] << 8 | ports[i * 2 + 1]; + + /* Update the switch resgisters. */ + err = ip17x_writephy(sc->sc_dev, 29, 19, reg[0]); + if (err == 0) + err = ip17x_writephy(sc->sc_dev, 29, 20, reg[1]); + if (err == 0) + err = ip17x_updatephy(sc->sc_dev, 29, 21, 0xff00, reg[2]); + if (err == 0) + err = ip17x_updatephy(sc->sc_dev, 30, 18, 0x00ff, reg[2]); + return (err); +} + +static int +ip175c_dot1q_vlan_setup(struct ip17x_softc *sc) +{ + struct ip17x_vlan *v; + uint32_t data; + uint32_t vlans[IP17X_MAX_VLANS]; + int i, j; + + KASSERT(sc->cpuport == 5, ("cpuport != 5 not supported for IP175C")); + KASSERT(sc->numports == 6, ("numports != 6 not supported for IP175C")); + + /* Add and strip VLAN tags. */ + data = (sc->addtag & ~(1 << IP175X_CPU_PORT)) << 11; + data |= (sc->striptag & ~(1 << IP175X_CPU_PORT)) << 6; + if (sc->addtag & (1 << IP175X_CPU_PORT)) + data |= (1 << 1); + if (sc->striptag & (1 << IP175X_CPU_PORT)) + data |= (1 << 0); + if (ip17x_writephy(sc->sc_dev, 29, 23, data)) + return (-1); + + /* Set the VID_IDX_SEL to 0. */ + if (ip17x_updatephy(sc->sc_dev, 30, 9, 0x70, 0)) + return (-1); + + /* Calculate the port masks. */ + memset(vlans, 0, sizeof(vlans)); + for (i = 0; i < IP17X_MAX_VLANS; i++) { + v = &sc->vlan[i]; + if (v->vlanid == 0) + continue; + vlans[v->vlanid] = v->ports; + } + + for (j = 0, i = 1; i <= IP17X_MAX_VLANS / 2; i++) { + data = vlans[j++] & 0x3f; + data |= (vlans[j++] & 0x3f) << 8; + if (ip17x_writephy(sc->sc_dev, 30, i, data)) + return (-1); + } + + /* Port default VLAN ID. */ + for (i = 0; i < sc->numports; i++) { + if (i == IP175X_CPU_PORT) { + if (ip17x_writephy(sc->sc_dev, 29, 30, sc->pvid[i])) + return (-1); + } else { + if (ip17x_writephy(sc->sc_dev, 29, 24 + i, sc->pvid[i])) + return (-1); + } + } + + return (0); +} + +/* + * Set the Switch configuration. + */ +static int +ip175c_hw_setup(struct ip17x_softc *sc) +{ + + switch (sc->vlan_mode) { + case ETHERSWITCH_VLAN_PORT: + return (ip175c_port_vlan_setup(sc)); + break; + case ETHERSWITCH_VLAN_DOT1Q: + return (ip175c_dot1q_vlan_setup(sc)); + break; + } + return (-1); +} + +/* + * Set the switch VLAN mode. + */ +static int +ip175c_set_vlan_mode(struct ip17x_softc *sc, uint32_t mode) +{ + + switch (mode) { + case ETHERSWITCH_VLAN_DOT1Q: + /* Enable VLAN tag processing. */ + ip17x_updatephy(sc->sc_dev, 30, 9, 0x80, 0x80); + sc->vlan_mode = mode; + break; + case ETHERSWITCH_VLAN_PORT: + default: + /* Disable VLAN tag processing. */ + ip17x_updatephy(sc->sc_dev, 30, 9, 0x80, 0); + sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + break; + }; + + /* Reset vlans. */ + ip17x_reset_vlans(sc, sc->vlan_mode); + + /* Update switch configuration. */ + ip175c_hw_setup(sc); + + return (0); +} + +/* + * Get the switch VLAN mode. + */ +static int +ip175c_get_vlan_mode(struct ip17x_softc *sc) +{ + + return (sc->vlan_mode); +} + +void +ip175c_attach(struct ip17x_softc *sc) +{ + + sc->hal.ip17x_reset = ip175c_reset; + sc->hal.ip17x_hw_setup = ip175c_hw_setup; + sc->hal.ip17x_get_vlan_mode = ip175c_get_vlan_mode; + sc->hal.ip17x_set_vlan_mode = ip175c_set_vlan_mode; + + /* Defaults for IP175C. */ + sc->cpuport = IP175X_CPU_PORT; + sc->numports = IP175X_NUM_PORTS; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT | ETHERSWITCH_VLAN_DOT1Q; + + device_printf(sc->sc_dev, "type: IP175C\n"); +} Added: head/sys/dev/etherswitch/ip17x/ip175c.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ip17x/ip175c.h Wed May 8 20:58:41 2013 (r250386) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __IP175C_H__ +#define __IP175C_H__ + +#define IP175C_MODE_PHY 29 +#define IP175C_MODE_REG 31 +#define IP175C_RESET_PHY 30 +#define IP175C_RESET_REG 0 + +#define IP175C_LAST_VLAN 15 + +void ip175c_attach(struct ip17x_softc *sc); + +#endif /* __IP175C_H__ */ Added: head/sys/dev/etherswitch/ip17x/ip175d.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ip17x/ip175d.c Wed May 8 20:58:41 2013 (r250386) @@ -0,0 +1,219 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * Copyright (C) 2008 Patrick Horn. + * Copyright (C) 2008, 2010 Martin Mares. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* + * IP175D specific functions. + */ + +/* + * Reset the switch to default state. + */ +static int +ip175d_reset(struct ip17x_softc *sc) +{ + + /* Reset all the switch settings. */ + ip17x_writephy(sc->sc_dev, IP175D_RESET_PHY, IP175D_RESET_REG, 0x175d); + DELAY(2); + + /* Disable the special tagging mode. */ + ip17x_updatephy(sc->sc_dev, 21, 22, 0x3, 0x0); + + /* Set 802.1q protocol type. */ + ip17x_writephy(sc->sc_dev, 22, 3, 0x8100); + + return (0); +} + +/* + * Set the Switch configuration. + */ +static int +ip175d_hw_setup(struct ip17x_softc *sc) +{ + struct ip17x_vlan *v; + uint32_t ports[IP17X_MAX_VLANS]; + uint32_t addtag[IP17X_MAX_VLANS]; + uint32_t striptag[IP17X_MAX_VLANS]; + uint32_t vlan_mask; + int i, j; + + vlan_mask = 0; + for (i = 0; i < IP17X_MAX_VLANS; i++) { + + ports[i] = 0; + addtag[i] = 0; + striptag[i] = 0; + + v = &sc->vlan[i]; + if (v->vlanid == 0 || sc->vlan_mode == 0) { + /* Vlangroup disabled. Reset the filter. */ + ip17x_writephy(sc->sc_dev, 22, 14 + i, i + 1); + ports[i] = 0x3f; + continue; + } + + vlan_mask |= (1 << i); + ports[i] = v->ports; + + /* Setup the filter, write the VLAN id. */ + ip17x_writephy(sc->sc_dev, 22, 14 + i, v->vlanid); + + for (j = 0; j < MII_NPHY; j++) { + if ((ports[i] & (1 << j)) == 0) + continue; + if (sc->addtag & (1 << j)) + addtag[i] |= (1 << j); + if (sc->striptag & (1 << j)) + striptag[i] |= (1 << j); + } + } + + /* Write the port masks, tag adds and removals. */ + for (i = 0; i < IP17X_MAX_VLANS / 2; i++) { + ip17x_writephy(sc->sc_dev, 23, i, + ports[2 * i] | (ports[2 * i + 1] << 8)); + ip17x_writephy(sc->sc_dev, 23, i + 8, + addtag[2 * i] | (addtag[2 * i + 1] << 8)); + ip17x_writephy(sc->sc_dev, 23, i + 16, + striptag[2 * i] | (striptag[2 * i + 1] << 8)); + } + + /* Write the in use vlan mask. */ + ip17x_writephy(sc->sc_dev, 22, 10, vlan_mask); + + /* Write the PVID of each port. */ + for (i = 0; i < sc->numports; i++) + ip17x_writephy(sc->sc_dev, 22, 4 + i, sc->pvid[i]); + + return (0); +} + +/* + * Set the switch VLAN mode. + */ +static int +ip175d_set_vlan_mode(struct ip17x_softc *sc, uint32_t mode) +{ + + switch (mode) { + case ETHERSWITCH_VLAN_DOT1Q: + /* + * VLAN classification rules: tag-based VLANs, + * use VID to classify, drop packets that cannot + * be classified. + */ + ip17x_updatephy(sc->sc_dev, 22, 0, 0x3fff, 0x003f); + sc->vlan_mode = mode; + break; + case ETHERSWITCH_VLAN_PORT: + sc->vlan_mode = mode; + /* fallthrough */ + default: + /* + * VLAN classification rules: everything off & + * clear table. + */ + ip17x_updatephy(sc->sc_dev, 22, 0, 0xbfff, 0x8000); + sc->vlan_mode = 0; + break; + }; + + if (sc->vlan_mode != 0) { + /* + * Ingress rules: CFI=1 dropped, null VID is untagged, VID=1 passed, + * VID=0xfff discarded, admin both tagged and untagged, ingress + * filters enabled. + */ + ip17x_updatephy(sc->sc_dev, 22, 1, 0x0fff, 0x0c3f); + + /* Egress rules: IGMP processing off, keep VLAN header off. */ + ip17x_updatephy(sc->sc_dev, 22, 2, 0x0fff, 0x0000); + } else { + ip17x_updatephy(sc->sc_dev, 22, 1, 0x0fff, 0x043f); + ip17x_updatephy(sc->sc_dev, 22, 2, 0x0fff, 0x0020); + } + + /* Reset vlans. */ + ip17x_reset_vlans(sc, sc->vlan_mode); + + /* Update switch configuration. */ + ip175d_hw_setup(sc); + + return (0); +} + +/* + * Get the switch VLAN mode. + */ +static int +ip175d_get_vlan_mode(struct ip17x_softc *sc) +{ + + return (sc->vlan_mode); +} + +void +ip175d_attach(struct ip17x_softc *sc) +{ + + sc->hal.ip17x_reset = ip175d_reset; + sc->hal.ip17x_hw_setup = ip175d_hw_setup; + sc->hal.ip17x_get_vlan_mode = ip175d_get_vlan_mode; + sc->hal.ip17x_set_vlan_mode = ip175d_set_vlan_mode; + + /* Defaults for IP175C. */ + sc->cpuport = IP175X_CPU_PORT; + sc->numports = IP175X_NUM_PORTS; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q; + + device_printf(sc->sc_dev, "type: IP175D\n"); +} Added: head/sys/dev/etherswitch/ip17x/ip175d.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ip17x/ip175d.h Wed May 8 20:58:41 2013 (r250386) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * Copyright (C) 2008 Patrick Horn. + * Copyright (C) 2008, 2010 Martin Mares. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __IP175D_H__ +#define __IP175D_H__ + +#define IP175D_ID_PHY 20 +#define IP175D_ID_REG 0 +#define IP175D_RESET_PHY 20 +#define IP175D_RESET_REG 2 + +void ip175d_attach(struct ip17x_softc *sc); + +#endif /* __IP175D_H__ */ Added: head/sys/dev/etherswitch/ip17x/ip17x.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/etherswitch/ip17x/ip17x.c Wed May 8 20:58:41 2013 (r250386) @@ -0,0 +1,614 @@ +/*- + * Copyright (c) 2013 Luiz Otavio O Souza. + * Copyright (c) 2011-2012 Stefan Bethke. + * Copyright (c) 2012 Adrian Chadd. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "mdio_if.h" +#include "miibus_if.h" +#include "etherswitch_if.h" + +MALLOC_DECLARE(M_IP17X); +MALLOC_DEFINE(M_IP17X, "ip17x", "ip17x data structures"); + +static void ip17x_tick(void *); +static int ip17x_ifmedia_upd(struct ifnet *); +static void ip17x_ifmedia_sts(struct ifnet *, struct ifmediareq *); + +static int +ip17x_probe(device_t dev) +{ + struct ip17x_softc *sc; + uint32_t oui, model, phy_id1, phy_id2; + + sc = device_get_softc(dev); + + /* Read ID from PHY 0. */ + phy_id1 = MDIO_READREG(device_get_parent(dev), 0, MII_PHYIDR1); + phy_id2 = MDIO_READREG(device_get_parent(dev), 0, MII_PHYIDR2); + + oui = MII_OUI(phy_id1, phy_id2), + model = MII_MODEL(phy_id2); + /* We only care about IC+ devices. */ + if (oui != IP17X_OUI) { + device_printf(dev, + "Unsupported IC+ switch. Unknown OUI: %#x\n", oui); + return (ENXIO); + } + + switch (model) { + case IP17X_IP175A: + sc->sc_switchtype = IP17X_SWITCH_IP175A; + break; + case IP17X_IP175C: + sc->sc_switchtype = IP17X_SWITCH_IP175C; + break; + default: + device_printf(dev, "Unsupported IC+ switch model: %#x\n", + model); + return (ENXIO); + } + + /* IP175D has a specific ID register. */ + model = MDIO_READREG(device_get_parent(dev), IP175D_ID_PHY, + IP175D_ID_REG); + if (model == 0x175d) + sc->sc_switchtype = IP17X_SWITCH_IP175D; + else { + /* IP178 has more PHYs. Try it. */ + model = MDIO_READREG(device_get_parent(dev), 5, MII_PHYIDR1); + if (phy_id1 == model) + sc->sc_switchtype = IP17X_SWITCH_IP178C; + } + + device_set_desc_copy(dev, "IC+ IP17x switch driver"); + return (BUS_PROBE_DEFAULT); +} + +static int +ip17x_attach_phys(struct ip17x_softc *sc) +{ + int err, phy, port; + char name[IFNAMSIZ]; + + port = err = 0; + + /* PHYs need an interface, so we generate a dummy one */ + snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); + for (phy = 0; phy < MII_NPHY; phy++) { + if (((1 << phy) & sc->phymask) == 0) + continue; + sc->phyport[phy] = port; + sc->portphy[port] = phy; + sc->ifp[port] = if_alloc(IFT_ETHER); + sc->ifp[port]->if_softc = sc; + sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | + IFF_DRV_RUNNING | IFF_SIMPLEX; + sc->ifname[port] = malloc(strlen(name)+1, M_IP17X, M_WAITOK); + bcopy(name, sc->ifname[port], strlen(name)+1); + if_initname(sc->ifp[port], sc->ifname[port], port); + sc->miibus[port] = malloc(sizeof(device_t), M_IP17X, + M_WAITOK | M_ZERO); + err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], + ip17x_ifmedia_upd, ip17x_ifmedia_sts, \ + BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", + device_get_nameunit(*sc->miibus[port]), + sc->ifp[port]->if_xname); + if (err != 0) { + device_printf(sc->sc_dev, + "attaching PHY %d failed\n", + phy); + break; + } + sc->info.es_nports = port + 1; + if (++port >= sc->numports) + break; + } + return (err); +} + +static int +ip17x_attach(device_t dev) +{ + struct ip17x_softc *sc; + int err; + + sc = device_get_softc(dev); + + sc->sc_dev = dev; + mtx_init(&sc->sc_mtx, "ip17x", NULL, MTX_DEF); + strlcpy(sc->info.es_name, device_get_desc(dev), + sizeof(sc->info.es_name)); + + /* XXX Defaults */ + sc->phymask = 0x0f; + sc->media = 100; + + (void) resource_int_value(device_get_name(dev), device_get_unit(dev), + "phymask", &sc->phymask); + + /* Number of vlans supported by the switch. */ + sc->info.es_nvlangroups = IP17X_MAX_VLANS; + + /* Attach the switch related functions. */ + if (IP17X_IS_SWITCH(sc, IP175C)) + ip175c_attach(sc); + else if (IP17X_IS_SWITCH(sc, IP175D)) + ip175d_attach(sc); + else + /* We don't have support to all the models yet :-/ */ + return (ENXIO); + + /* Always attach the cpu port. */ + sc->phymask |= (1 << sc->cpuport); + + sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_IP17X, + M_WAITOK | M_ZERO); + sc->pvid = malloc(sizeof(uint32_t) * sc->numports, M_IP17X, + M_WAITOK | M_ZERO); + sc->ifname = malloc(sizeof(char *) * sc->numports, M_IP17X, + M_WAITOK | M_ZERO); + sc->miibus = malloc(sizeof(device_t *) * sc->numports, M_IP17X, + M_WAITOK | M_ZERO); + sc->portphy = malloc(sizeof(int) * sc->numports, M_IP17X, + M_WAITOK | M_ZERO); + + /* Initialize the switch. */ + sc->hal.ip17x_reset(sc); + + /* + * Attach the PHYs and complete the bus enumeration. + */ + err = ip17x_attach_phys(sc); + if (err != 0) + return (err); + + /* + * Set the switch to port based vlans or disabled (if not supported + * on this model). + */ + sc->hal.ip17x_set_vlan_mode(sc, ETHERSWITCH_VLAN_PORT); + + bus_generic_probe(dev); + bus_enumerate_hinted_children(dev); + err = bus_generic_attach(dev); + if (err != 0) + return (err); + + callout_init(&sc->callout_tick, 0); + + ip17x_tick(sc); + + return (0); +} + +static int +ip17x_detach(device_t dev) +{ + struct ip17x_softc *sc; + int i, port; + + sc = device_get_softc(dev); + callout_drain(&sc->callout_tick); + + for (i=0; i < MII_NPHY; i++) { + if (((1 << i) & sc->phymask) == 0) + continue; + port = sc->phyport[i]; + if (sc->miibus[port] != NULL) + device_delete_child(dev, (*sc->miibus[port])); + if (sc->ifp[port] != NULL) + if_free(sc->ifp[port]); + free(sc->ifname[port], M_IP17X); + free(sc->miibus[port], M_IP17X); + } + + free(sc->portphy, M_IP17X); + free(sc->miibus, M_IP17X); + free(sc->ifname, M_IP17X); + free(sc->pvid, M_IP17X); + free(sc->ifp, M_IP17X); + + /* Reset the switch. */ + sc->hal.ip17x_reset(sc); + + bus_generic_detach(dev); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static inline struct mii_data * +ip17x_miiforport(struct ip17x_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + return (device_get_softc(*sc->miibus[port])); +} + +static inline struct ifnet * +ip17x_ifpforport(struct ip17x_softc *sc, int port) +{ + + if (port < 0 || port > sc->numports) + return (NULL); + return (sc->ifp[port]); +} + +/* + * Poll the status for all PHYs. + */ +static void +ip17x_miipollstat(struct ip17x_softc *sc) +{ + struct mii_softc *miisc; + struct mii_data *mii; + int i, port; + + IP17X_LOCK_ASSERT(sc, MA_NOTOWNED); + + for (i = 0; i < MII_NPHY; i++) { + if (((1 << i) & sc->phymask) == 0) + continue; + port = sc->phyport[i]; + if ((*sc->miibus[port]) == NULL) + continue; + mii = device_get_softc(*sc->miibus[port]); + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) != + miisc->mii_inst) + continue; + ukphy_status(miisc); + mii_phy_update(miisc, MII_POLLSTAT); + } + } +} + +static void +ip17x_tick(void *arg) +{ + struct ip17x_softc *sc; + + sc = arg; + ip17x_miipollstat(sc); + callout_reset(&sc->callout_tick, hz, ip17x_tick, sc); +} + +static void +ip17x_lock(device_t dev) +{ + struct ip17x_softc *sc; + + sc = device_get_softc(dev); + IP17X_LOCK_ASSERT(sc, MA_NOTOWNED); + IP17X_LOCK(sc); +} + +static void +ip17x_unlock(device_t dev) +{ + struct ip17x_softc *sc; + + sc = device_get_softc(dev); + IP17X_LOCK_ASSERT(sc, MA_OWNED); + IP17X_UNLOCK(sc); +} + +static etherswitch_info_t * +ip17x_getinfo(device_t dev) +{ + struct ip17x_softc *sc; + + sc = device_get_softc(dev); + return (&sc->info); +} + +static int +ip17x_getport(device_t dev, etherswitch_port_t *p) +{ + struct ip17x_softc *sc; + struct ifmediareq *ifmr; + struct mii_data *mii; + int err, phy; + + sc = device_get_softc(dev); + if (p->es_port < 0 || p->es_port >= sc->numports) + return (ENXIO); + + phy = sc->portphy[p->es_port]; + + /* Retrieve the PVID. */ + p->es_pvid = sc->pvid[phy]; + + /* Port flags. */ + if (sc->addtag & (1 << phy)) + p->es_flags |= ETHERSWITCH_PORT_ADDTAG; + if (sc->striptag & (1 << phy)) + p->es_flags |= ETHERSWITCH_PORT_STRIPTAG; + + ifmr = &p->es_ifmr; + + /* No media settings ? */ + if (p->es_ifmr.ifm_count == 0) + return (0); + + mii = ip17x_miiforport(sc, p->es_port); + if (mii == NULL) + return (ENXIO); + if (phy == sc->cpuport) { + /* fill in fixed values for CPU port */ + p->es_flags |= ETHERSWITCH_PORT_CPU; + ifmr->ifm_count = 0; + if (sc->media == 100) + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_100_TX | IFM_FDX; + else + ifmr->ifm_current = ifmr->ifm_active = + IFM_ETHER | IFM_1000_T | IFM_FDX; + ifmr->ifm_mask = 0; + ifmr->ifm_status = IFM_ACTIVE | IFM_AVALID; + } else { + err = ifmedia_ioctl(mii->mii_ifp, &p->es_ifr, + &mii->mii_media, SIOCGIFMEDIA); + if (err) + return (err); + } + return (0); +} + +static int +ip17x_setport(device_t dev, etherswitch_port_t *p) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:02:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7862D8EA; Wed, 8 May 2013 21:02:49 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8789ED09; Wed, 8 May 2013 21:02:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48L2mRR083418; Wed, 8 May 2013 21:02:48 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48L2mVw083417; Wed, 8 May 2013 21:02:48 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201305082102.r48L2mVw083417@svn.freebsd.org> From: Joel Dahl Date: Wed, 8 May 2013 21:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250387 - head/sbin/etherswitchcfg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:02:49 -0000 Author: joel (doc committer) Date: Wed May 8 21:02:48 2013 New Revision: 250387 URL: http://svnweb.freebsd.org/changeset/base/250387 Log: mdoc: new sentence, new line. Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 Modified: head/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.8 Wed May 8 20:58:41 2013 (r250386) +++ head/sbin/etherswitchcfg/etherswitchcfg.8 Wed May 8 21:02:48 2013 (r250387) @@ -80,7 +80,8 @@ Sets the default port VID that is used t .It Ar media mediaspec Specifies the physical media configuration to be configured for a port. .It Ar mediaopt mediaoption -Specifies a list of media options for a port. See +Specifies a list of media options for a port. +See .Xr ifconfig 8 for details on .Ar media @@ -103,7 +104,8 @@ This options makes the switch port lock After that, usually you need to reset the switch to learn different MAC addresses. .It Ar -firstlock -Disable the first lock option. Note that sometimes you need to reset the +Disable the first lock option. +Note that sometimes you need to reset the switch to really disable this option. .It Ar dropuntagged Drop packets without a VLAN tag. From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:04:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E01AA9A; Wed, 8 May 2013 21:04:20 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 50E14D1B; Wed, 8 May 2013 21:04:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48L4J72083784; Wed, 8 May 2013 21:04:19 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48L4JIH083783; Wed, 8 May 2013 21:04:19 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201305082104.r48L4JIH083783@svn.freebsd.org> From: Joel Dahl Date: Wed, 8 May 2013 21:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250388 - head/sbin/ping6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:04:20 -0000 Author: joel (doc committer) Date: Wed May 8 21:04:19 2013 New Revision: 250388 URL: http://svnweb.freebsd.org/changeset/base/250388 Log: Remove EOL whitespace. Modified: head/sbin/ping6/ping6.8 Modified: head/sbin/ping6/ping6.8 ============================================================================== --- head/sbin/ping6/ping6.8 Wed May 8 21:02:48 2013 (r250387) +++ head/sbin/ping6/ping6.8 Wed May 8 21:04:19 2013 (r250388) @@ -234,7 +234,7 @@ is used instead. The former is in RFC 4620, the latter is in an old Internet Draft draft-ietf-ipngwg-icmp-name-lookup. Note that KAME-derived implementations including -.Fx +.Fx use the latter. .It Fl o Exit successfully after receiving one reply packet. From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:06:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FF9DC4E; Wed, 8 May 2013 21:06:48 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52C40D42; Wed, 8 May 2013 21:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48L6mPP084371; Wed, 8 May 2013 21:06:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48L6mul084370; Wed, 8 May 2013 21:06:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305082106.r48L6mul084370@svn.freebsd.org> From: Attilio Rao Date: Wed, 8 May 2013 21:06:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250389 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:06:48 -0000 Author: attilio Date: Wed May 8 21:06:47 2013 New Revision: 250389 URL: http://svnweb.freebsd.org/changeset/base/250389 Log: Revert r250339 as apparently it is more clutter than help. Sponsored by: EMC / Isilon storage division Requested by: jhb Modified: head/sys/x86/acpica/srat.c Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Wed May 8 21:04:19 2013 (r250388) +++ head/sys/x86/acpica/srat.c Wed May 8 21:06:47 2013 (r250389) @@ -331,48 +331,6 @@ srat_walk_table(acpi_subtable_handler *h acpi_walk_subtables(srat + 1, (char *)srat + srat->Header.Length, handler, arg); } - -static void -acpi_handle_slit(ACPI_TABLE_SLIT *slit) -{ - UINT64 i, j; - - printf("ACPI System Locality Information Table: %ju localities\n", - (uintmax_t)slit->LocalityCount); - printf(" "); - for (i = 0; i < slit->LocalityCount; i++) - printf(" %3ju", (uintmax_t)i); - printf("\n +"); - for (i = 0; i < slit->LocalityCount; i++) - printf("----"); - printf("\n"); - for (i = 0; i < slit->LocalityCount; i++) { - printf(" %3ju |", (uintmax_t)i); - for (j = 0; j < slit->LocalityCount; j++) - printf(" %3u", - slit->Entry[i * slit->LocalityCount + j]); - printf("\n"); - } -} - -static void -parse_slit(void *arg __unused) -{ - ACPI_TABLE_SLIT *slit; - vm_paddr_t slit_physaddr; - - if (resource_disabled("slit", 0)) - return; - - slit_physaddr = acpi_find_table(ACPI_SIG_SLIT); - if (slit_physaddr == 0) - return; - slit = acpi_map_table(slit_physaddr, ACPI_SIG_SLIT); - acpi_handle_slit(slit); - acpi_unmap_table(slit); -} - -SYSINIT(parse_slit, SI_SUB_VM - 1, SI_ORDER_SECOND, parse_slit, NULL); /* * Setup per-CPU ACPI IDs. From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:07:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35D7EDDD; Wed, 8 May 2013 21:07:12 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 29015D4B; Wed, 8 May 2013 21:07:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48L7CCt084506; Wed, 8 May 2013 21:07:12 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48L7CIi084505; Wed, 8 May 2013 21:07:12 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201305082107.r48L7CIi084505@svn.freebsd.org> From: Joel Dahl Date: Wed, 8 May 2013 21:07:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250390 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:07:12 -0000 Author: joel (doc committer) Date: Wed May 8 21:07:11 2013 New Revision: 250390 URL: http://svnweb.freebsd.org/changeset/base/250390 Log: Minor improvements. Modified: head/share/man/man4/acpi_rapidstart.4 Modified: head/share/man/man4/acpi_rapidstart.4 ============================================================================== --- head/share/man/man4/acpi_rapidstart.4 Wed May 8 21:06:47 2013 (r250389) +++ head/share/man/man4/acpi_rapidstart.4 Wed May 8 21:07:11 2013 (r250390) @@ -48,11 +48,13 @@ acpi_rapidstart_load="YES" The .Nm driver provides support for Intel Rapid Start technology ACPI device interface. -Note that this is only for ACPI device interface . This has _CID PNP0C02 so -should be loaded in boot time to avoid attaching acpi_sysresource driver. - +Note that this is only for the ACPI device interface. +This has _CID PNP0C02 so it should be loaded at boot time to avoid attaching +to the acpi_sysresource driver. .Sh SYSCTLS -The following sysctl nodes are currently implemented: +The following +.Xr sysctl 8 +nodes are currently implemented: .Bl -tag -width indent .It Va dev.acpi_rapidstart.0.ffs Rapid start flag. From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:07:34 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA294F4E; Wed, 8 May 2013 21:07:34 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id A43A7D50; Wed, 8 May 2013 21:07:34 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id at1so4125670iec.21 for ; Wed, 08 May 2013 14:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Br1AJTFNiNLZi/ZFYRnEn8UPEoRMV3QAJo9e4V+ee68=; b=uO/LxoaSk0wu71uoSWYkPnNLU3tXcBXNWqSJ5ZFHzTP9UNFOAvBAdnNzhHC2vn4VxK gvWpPUNo+0ksLX+THzVFyILNEaOX4RDsUzgJRbQvLKaVTWqVHQTl0eW7O7tQDJnUCjw/ fC+Eyw4vwXwQW+BhaOhJ0qBINZFQEkVwogAUguCpn5/nV4fL0IAr+kNQsbtzQ3RbYLm4 BsNMxxoHU2sJ4VywCSpd9HHK4omX8TGAx3HpXTkmtd02P6E20JzYcHwAUt42cCBMMZMI 0EDsJ21lB5l5ZG/Ww2TeNs98BxBOmPLno//bxn9FUMB3bD3ynLZAZRBFzcRsVch8yZEf 8gsQ== MIME-Version: 1.0 X-Received: by 10.43.158.3 with SMTP id ls3mr2694979icc.55.1368047254442; Wed, 08 May 2013 14:07:34 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Wed, 8 May 2013 14:07:34 -0700 (PDT) In-Reply-To: <201305081653.33646.jhb@freebsd.org> References: <201305072249.r47MnvrO009846@svn.freebsd.org> <201305081201.16405.jhb@freebsd.org> <201305081653.33646.jhb@freebsd.org> Date: Wed, 8 May 2013 23:07:34 +0200 X-Google-Sender-Auth: 2Zq_x0_tUWODwdHAb8KdaHFkQ9w Message-ID: Subject: Re: svn commit: r250339 - head/sys/x86/acpica From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:07:35 -0000 On Wed, May 8, 2013 at 10:53 PM, John Baldwin wrote: > On Wednesday, May 08, 2013 2:21:12 pm Attilio Rao wrote: >> On Wed, May 8, 2013 at 6:01 PM, John Baldwin wrote: >> > On Tuesday, May 07, 2013 6:49:57 pm Attilio Rao wrote: >> >> Author: attilio >> >> Date: Tue May 7 22:49:56 2013 >> >> New Revision: 250339 >> >> URL: http://svnweb.freebsd.org/changeset/base/250339 >> >> >> >> Log: >> >> Add functions to do ACPI System Locality Information Table parsing >> >> and printing at boot. >> >> For reference on table informations and purposes please review ACPI specs. >> >> >> >> Sponsored by: EMC / Isilon storage division >> >> Obtained from: jeff >> >> Reviewed by: jhb (earlier version) >> > >> > Eh, I don't recall reviewing this. However, acpidump already dumps this >> > table, and we should dump tables via acpidump, not in dmesg. >> >> Now that I read better this patch is based upon a patch you submitted >> originally (see the private thread NUMA WIP). >> We already print some useful ACPI table information at boot really >> (APIC ACPI table case) and this is only printed out when having >> MAXMEMDOM > 1. Finally I have also sent you this patch and you didn't >> object. > > Humm, that was in an old thread, and I never responded to say "ok" to > this. > > However, the patch I posted in that thread is the patch to dump the SLIT > in acpidump and it was comitted back in r241198. That is the place to dump > these tables, not in dmesg. We do not dump the raw contents of any other > ACPI tables in dmesg, and have actively moved other tables out to userland > (e.g. $PIR is dumped via a userland tool only). > >> However if you really dislike it I can print under bootverbose maybe? > > No, it does not belong in dmesg at all. Code to use its contents and honor > it when setting the domain lists would be fine :), but printing it when you > can more easily get it via acpidump -t is just clutter. Reverted in r 250389. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Wed May 8 21:23:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 362FF41B; Wed, 8 May 2013 21:23:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 18196DE0; Wed, 8 May 2013 21:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48LNp02091037; Wed, 8 May 2013 21:23:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48LNpw9091035; Wed, 8 May 2013 21:23:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305082123.r48LNpw9091035@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 May 2013 21:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250391 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 21:23:52 -0000 Author: adrian Date: Wed May 8 21:23:51 2013 New Revision: 250391 URL: http://svnweb.freebsd.org/changeset/base/250391 Log: Fix the holding descriptor logic to actually be "right" (for values of "right".) Flip back on the "always continue TX DMA using the holding descriptor" code - by always setting ATH_BUF_BUSY and never setting axq_link to NULL. Since the holding descriptor is accessed via txq->axq_link and _that_ is done behind the TXQ lock rather than the TX path lock, the holding descriptor stuff itself needs to be behind the TXQ lock. So, do the mental gymnastics needed to do this. I've not seen any of the hardware failures that I was seeing when I last tried to do this. Tested: * AR5416, STA mode Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 8 21:07:11 2013 (r250390) +++ head/sys/dev/ath/if_ath.c Wed May 8 21:23:51 2013 (r250391) @@ -3896,6 +3896,7 @@ ath_tx_process_buf_completion(struct ath struct ath_node *an = NULL; ATH_TX_UNLOCK_ASSERT(sc); + ATH_TXQ_UNLOCK_ASSERT(txq); /* If unicast frame, update general statistics */ if (ni != NULL) { @@ -4000,6 +4001,28 @@ ath_tx_processq(struct ath_softc *sc, st break; } ATH_TXQ_REMOVE(txq, bf, bf_list); + + /* + * Sanity check. + */ + if (txq->axq_qnum != bf->bf_state.bfs_tx_queue) { + device_printf(sc->sc_dev, + "%s: TXQ=%d: bf=%p, bfs_tx_queue=%d\n", + __func__, + txq->axq_qnum, + bf, + bf->bf_state.bfs_tx_queue); + } + if (txq->axq_qnum != bf->bf_last->bf_state.bfs_tx_queue) { + device_printf(sc->sc_dev, + "%s: TXQ=%d: bf_last=%p, bfs_tx_queue=%d\n", + __func__, + txq->axq_qnum, + bf->bf_last, + bf->bf_last->bf_state.bfs_tx_queue); + } + +#if 0 if (txq->axq_depth > 0) { /* * More frames follow. Mark the buffer busy @@ -4013,6 +4036,9 @@ ath_tx_processq(struct ath_softc *sc, st bf->bf_last->bf_flags |= ATH_BUF_BUSY; } else txq->axq_link = NULL; +#else + bf->bf_last->bf_flags |= ATH_BUF_BUSY; +#endif if (bf->bf_state.bfs_aggr) txq->axq_aggr_depth--; @@ -4288,13 +4314,18 @@ ath_returnbuf_head(struct ath_softc *sc, void ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq) { - ATH_TXBUF_LOCK_ASSERT(sc); + ATH_TXBUF_UNLOCK_ASSERT(sc); + ATH_TXQ_LOCK_ASSERT(txq); if (txq->axq_holdingbf == NULL) return; txq->axq_holdingbf->bf_flags &= ~ATH_BUF_BUSY; + + ATH_TXBUF_LOCK(sc); ath_returnbuf_tail(sc, txq->axq_holdingbf); + ATH_TXBUF_UNLOCK(sc); + txq->axq_holdingbf = NULL; } @@ -4307,7 +4338,10 @@ ath_txq_addholdingbuf(struct ath_softc * { struct ath_txq *txq; - ATH_TXBUF_LOCK_ASSERT(sc); + txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue]; + + ATH_TXBUF_UNLOCK_ASSERT(sc); + ATH_TXQ_LOCK_ASSERT(txq); /* XXX assert ATH_BUF_BUSY is set */ @@ -4321,7 +4355,6 @@ ath_txq_addholdingbuf(struct ath_softc * ath_returnbuf_tail(sc, bf); return; } - txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue]; ath_txq_freeholdingbuf(sc, txq); txq->axq_holdingbf = bf; } @@ -4336,20 +4369,30 @@ ath_txq_addholdingbuf(struct ath_softc * * for restart (eg for TDMA.) * * The caller must free the mbuf and recycle the node reference. + * + * XXX This method of handling busy / holding buffers is insanely stupid. + * It requires bf_state.bfs_tx_queue to be correctly assigned. It would + * be much nicer if buffers in the processq() methods would instead be + * always completed there (pushed onto a txq or ath_bufhead) so we knew + * exactly what hardware queue they came from in the first place. */ void ath_freebuf(struct ath_softc *sc, struct ath_buf *bf) { + struct ath_txq *txq; + + txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue]; + KASSERT((bf->bf_node == NULL), ("%s: bf->bf_node != NULL\n", __func__)); KASSERT((bf->bf_m == NULL), ("%s: bf->bf_m != NULL\n", __func__)); /* - * If this buffer is busy, push it onto the holding queue + * If this buffer is busy, push it onto the holding queue. */ if (bf->bf_flags & ATH_BUF_BUSY) { - ATH_TXBUF_LOCK(sc); + ATH_TXQ_LOCK(txq); ath_txq_addholdingbuf(sc, bf); - ATH_TXBUF_UNLOCK(sc); + ATH_TXQ_UNLOCK(txq); return; } @@ -4521,9 +4564,9 @@ ath_tx_draintxq(struct ath_softc *sc, st /* * Free the holding buffer if it exists */ - ATH_TXBUF_LOCK(sc); + ATH_TXQ_LOCK(txq); ath_txq_freeholdingbuf(sc, txq); - ATH_TXBUF_UNLOCK(sc); + ATH_TXQ_UNLOCK(txq); /* * Drain software queued frames which are on Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed May 8 21:07:11 2013 (r250390) +++ head/sys/dev/ath/if_athvar.h Wed May 8 21:23:51 2013 (r250391) @@ -381,6 +381,8 @@ struct ath_txq { #define ATH_TXQ_LOCK(_tq) mtx_lock(&(_tq)->axq_lock) #define ATH_TXQ_UNLOCK(_tq) mtx_unlock(&(_tq)->axq_lock) #define ATH_TXQ_LOCK_ASSERT(_tq) mtx_assert(&(_tq)->axq_lock, MA_OWNED) +#define ATH_TXQ_UNLOCK_ASSERT(_tq) mtx_assert(&(_tq)->axq_lock, \ + MA_NOTOWNED) #define ATH_NODE_LOCK(_an) mtx_lock(&(_an)->an_mtx) @@ -964,6 +966,8 @@ struct ath_softc { #define ATH_TXBUF_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_txbuflock) #define ATH_TXBUF_LOCK_ASSERT(_sc) \ mtx_assert(&(_sc)->sc_txbuflock, MA_OWNED) +#define ATH_TXBUF_UNLOCK_ASSERT(_sc) \ + mtx_assert(&(_sc)->sc_txbuflock, MA_NOTOWNED) #define ATH_TXSTATUS_LOCK_INIT(_sc) do { \ snprintf((_sc)->sc_txcompname, sizeof((_sc)->sc_txcompname), \ From owner-svn-src-all@FreeBSD.ORG Wed May 8 22:50:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35E99BDD; Wed, 8 May 2013 22:50:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 186A217A; Wed, 8 May 2013 22:50:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48MoacA022465; Wed, 8 May 2013 22:50:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48Moaj8022464; Wed, 8 May 2013 22:50:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305082250.r48Moaj8022464@svn.freebsd.org> From: Dimitry Andric Date: Wed, 8 May 2013 22:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250392 - head/contrib/gcc/config/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 22:50:37 -0000 Author: dim Date: Wed May 8 22:50:36 2013 New Revision: 250392 URL: http://svnweb.freebsd.org/changeset/base/250392 Log: For some reason, the gcc intrinsics header tmmintrin.h was imported with two copies of itself pasted together. Remove the extraneous copy. MFC after: 3 days Modified: head/contrib/gcc/config/i386/tmmintrin.h Modified: head/contrib/gcc/config/i386/tmmintrin.h ============================================================================== --- head/contrib/gcc/config/i386/tmmintrin.h Wed May 8 21:23:51 2013 (r250391) +++ head/contrib/gcc/config/i386/tmmintrin.h Wed May 8 22:50:36 2013 (r250392) @@ -222,227 +222,3 @@ _mm_abs_pi32 (__m64 __X) #endif /* __SSSE3__ */ #endif /* _TMMINTRIN_H_INCLUDED */ -/* Copyright (C) 2006 Free Software Foundation, Inc. - - This file is part of GCC. - - GCC is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - GCC is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you include this header file into source - files compiled by GCC, this header file does not by itself cause - the resulting executable to be covered by the GNU General Public - License. This exception does not however invalidate any other - reasons why the executable file might be covered by the GNU General - Public License. */ - -/* Implemented from the specification included in the Intel C++ Compiler - User Guide and Reference, version 9.1. */ - -#ifndef _TMMINTRIN_H_INCLUDED -#define _TMMINTRIN_H_INCLUDED - -#ifdef __SSSE3__ -#include - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hadd_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phaddw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hadd_epi32 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phaddd128 ((__v4si)__X, (__v4si)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hadds_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phaddsw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hadd_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phaddw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hadd_pi32 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phaddd ((__v2si)__X, (__v2si)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hadds_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phaddsw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hsub_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phsubw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hsub_epi32 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phsubd128 ((__v4si)__X, (__v4si)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_hsubs_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_phsubsw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hsub_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phsubw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hsub_pi32 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phsubd ((__v2si)__X, (__v2si)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_hsubs_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_phsubsw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_maddubs_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_pmaddubsw128 ((__v16qi)__X, (__v16qi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_maddubs_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_pmaddubsw ((__v8qi)__X, (__v8qi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_mulhrs_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_pmulhrsw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_mulhrs_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_pmulhrsw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_shuffle_epi8 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_pshufb128 ((__v16qi)__X, (__v16qi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_shuffle_pi8 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_pshufb ((__v8qi)__X, (__v8qi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_sign_epi8 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_psignb128 ((__v16qi)__X, (__v16qi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_sign_epi16 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_psignw128 ((__v8hi)__X, (__v8hi)__Y); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_sign_epi32 (__m128i __X, __m128i __Y) -{ - return (__m128i) __builtin_ia32_psignd128 ((__v4si)__X, (__v4si)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_sign_pi8 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_psignb ((__v8qi)__X, (__v8qi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_sign_pi16 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_psignw ((__v4hi)__X, (__v4hi)__Y); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_sign_pi32 (__m64 __X, __m64 __Y) -{ - return (__m64) __builtin_ia32_psignd ((__v2si)__X, (__v2si)__Y); -} - -#define _mm_alignr_epi8(__X, __Y, __N) \ - ((__m128i)__builtin_ia32_palignr128 ((__v2di) __X, (__v2di) __Y, (__N) * 8)) - -#define _mm_alignr_pi8(__X, __Y, __N) \ - ((__m64)__builtin_ia32_palignr ((long long) (__X), (long long) (__Y), (__N) * 8)) - -static __inline __m128i __attribute__((__always_inline__)) -_mm_abs_epi8 (__m128i __X) -{ - return (__m128i) __builtin_ia32_pabsb128 ((__v16qi)__X); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_abs_epi16 (__m128i __X) -{ - return (__m128i) __builtin_ia32_pabsw128 ((__v8hi)__X); -} - -static __inline __m128i __attribute__((__always_inline__)) -_mm_abs_epi32 (__m128i __X) -{ - return (__m128i) __builtin_ia32_pabsd128 ((__v4si)__X); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_abs_pi8 (__m64 __X) -{ - return (__m64) __builtin_ia32_pabsb ((__v8qi)__X); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_abs_pi16 (__m64 __X) -{ - return (__m64) __builtin_ia32_pabsw ((__v4hi)__X); -} - -static __inline __m64 __attribute__((__always_inline__)) -_mm_abs_pi32 (__m64 __X) -{ - return (__m64) __builtin_ia32_pabsd ((__v2si)__X); -} - -#endif /* __SSSE3__ */ - -#endif /* _TMMINTRIN_H_INCLUDED */ From owner-svn-src-all@FreeBSD.ORG Wed May 8 22:54:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E49A2E59; Wed, 8 May 2013 22:54:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7465198; Wed, 8 May 2013 22:54:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48Msrmr023671; Wed, 8 May 2013 22:54:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48MsrtT023669; Wed, 8 May 2013 22:54:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305082254.r48MsrtT023669@svn.freebsd.org> From: Dimitry Andric Date: Wed, 8 May 2013 22:54:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250393 - head/gnu/usr.bin/cc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 22:54:54 -0000 Author: dim Date: Wed May 8 22:54:53 2013 New Revision: 250393 URL: http://svnweb.freebsd.org/changeset/base/250393 Log: When gcc 4.2.0 was imported, the 3DNow intrinsics header was not added to the list of intrinsics headers to install, so belatedly (5 years :) add it. MFC after: 1 week Modified: head/gnu/usr.bin/cc/include/Makefile Modified: head/gnu/usr.bin/cc/include/Makefile ============================================================================== --- head/gnu/usr.bin/cc/include/Makefile Wed May 8 22:50:36 2013 (r250392) +++ head/gnu/usr.bin/cc/include/Makefile Wed May 8 22:54:53 2013 (r250393) @@ -9,7 +9,8 @@ INCSDIR=${INCLUDEDIR}/gcc/${GCCVER} .PATH: ${GCCDIR}/config/${GCC_CPU} .if ${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "amd64" -INCS= emmintrin.h mmintrin.h pmmintrin.h tmmintrin.h xmmintrin.h mm_malloc.h +INCS= emmintrin.h mmintrin.h mm3dnow.h pmmintrin.h tmmintrin.h xmmintrin.h \ + mm_malloc.h .elif ${TARGET_ARCH} == "ia64" INCS= ia64intrin.h .elif ${TARGET_ARCH} == "arm" From owner-svn-src-all@FreeBSD.ORG Wed May 8 23:25:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64E1E658 for ; Wed, 8 May 2013 23:25:49 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-ve0-x232.google.com (mail-ve0-x232.google.com [IPv6:2607:f8b0:400c:c01::232]) by mx1.freebsd.org (Postfix) with ESMTP id 259AE272 for ; Wed, 8 May 2013 23:25:49 +0000 (UTC) Received: by mail-ve0-f178.google.com with SMTP id jy13so2354885veb.37 for ; Wed, 08 May 2013 16:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=IPCHDNc8xScZ2x03hiJ4ZOcDDAKw0wbwMgcssciNqCo=; b=Bre2/7xLD/Wf54O+xW9RPJdOEGz0OQHZTaulVUlI/BnfZEwCgNkkOCA4cil+GKTbAO L+0YZ/aHeT+KWtF3vVxkDH1u90f7gMe4MjEuBq3vjoTqWRZuIBqizAY+RtO+BzOhEk5G U4GL49wjJL4hkNxcV2ElyZBNYy+3p4d1yjzp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=IPCHDNc8xScZ2x03hiJ4ZOcDDAKw0wbwMgcssciNqCo=; b=DishDLnr9RWhc5tgohCqhQQjOiPHDfi0VmMI4tvJIqI98cuSiQJ7gzKRPQZbXq4D03 ReoaljE7S8QIK8ktNUTchPVbB+/krr+Akmen8auQwl9SeFAYXvfeGBgOh7j2/Yx842Xi hLBfpBWVPKukQexwbiJpb/J3s3iVZS/J8j8V9w6a3YaHJHYnI7Qwnr0nUZNkZWqdWrve pS9kCqLbbXFpGRmcF/7njugeH9ONyT0m9UAecCiXFiQ1i3oO0WZR95/mBMuvq5pJQlNW iX9xSWGLbxLYBAEZIa8WRuwlpUmzUmHr2P0HuC1RnJcjggPXUPlQbeifx5EV6D4tS48M q30g== MIME-Version: 1.0 X-Received: by 10.52.24.113 with SMTP id t17mr5354081vdf.30.1368055548642; Wed, 08 May 2013 16:25:48 -0700 (PDT) Received: by 10.220.197.66 with HTTP; Wed, 8 May 2013 16:25:48 -0700 (PDT) In-Reply-To: <201305082003.r48K3cYv062256@svn.freebsd.org> References: <201305082003.r48K3cYv062256@svn.freebsd.org> Date: Wed, 8 May 2013 16:25:48 -0700 Message-ID: Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast From: Peter Wemm To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQk6T4lG8c/Z+rOS2RjiPuS9Kkp1Jk8h4moFxzeFn3NIBE+GTCyL2+mBFxa+uIkoMxi1RWPK Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:25:49 -0000 On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub wrote: > Author: trociny > Date: Wed May 8 20:03:37 2013 > New Revision: 250379 > URL: http://svnweb.freebsd.org/changeset/base/250379 > > Log: > HAST module for bsnmpd(1). > > Reviewed by: harti, pjd > MFC after: 2 weeks This breaks world on just about everything other than i386, and it is technically broken there too but doesn't actually cause a build failure. You cannot link a .so file against a non-pic library, libl.a in this case. ===> usr.sbin/bsnmpd/modules/snmp_hast (all)^M /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o ): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC^M /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M *** [snmp_hast.so.6] Error code 1^M -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Wed May 8 23:30:25 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 48823859; Wed, 8 May 2013 23:30:25 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A60229D; Wed, 8 May 2013 23:30:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r48NUPa3045921; Wed, 8 May 2013 23:30:25 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r48NUPGn045914; Wed, 8 May 2013 23:30:25 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201305082330.r48NUPGn045914@svn.freebsd.org> From: Peter Wemm Date: Wed, 8 May 2013 23:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250394 - head/usr.sbin/bsnmpd/modules X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:30:25 -0000 Author: peter Date: Wed May 8 23:30:24 2013 New Revision: 250394 URL: http://svnweb.freebsd.org/changeset/base/250394 Log: Unbreak build - this can only build on i386 as-is due to use of libl in a .so file, and we currently (intentionally) only build libl.a. Modified: head/usr.sbin/bsnmpd/modules/Makefile Modified: head/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/Makefile Wed May 8 22:54:53 2013 (r250393) +++ head/usr.sbin/bsnmpd/modules/Makefile Wed May 8 23:30:24 2013 (r250394) @@ -10,7 +10,6 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ - snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf \ From owner-svn-src-all@FreeBSD.ORG Wed May 8 23:44:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22C40AF9 for ; Wed, 8 May 2013 23:44:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-ve0-x22e.google.com (mail-ve0-x22e.google.com [IPv6:2607:f8b0:400c:c01::22e]) by mx1.freebsd.org (Postfix) with ESMTP id D77A231E for ; Wed, 8 May 2013 23:44:54 +0000 (UTC) Received: by mail-ve0-f174.google.com with SMTP id pb11so2351883veb.5 for ; Wed, 08 May 2013 16:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=c23ZaRZbGcl1IhdaeHUkXlHJn3qyZURUNNu7x+rfcg4=; b=VXlP7LqwJlAcgh/Xj/Xp6DV/wsVBuDUAMr7QfOMlda+NAsAnrMvmt2jLzXda90L26S zW+rV2TqMNENq9PtXy46sxqL9JZZ9++v0qCIobFopt7/y5MTA6NPOyRhHcwlxLyy3qUU oRNnK+AOaZdW0wsxgDfNU0DEWsP22c6E2eOQo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=c23ZaRZbGcl1IhdaeHUkXlHJn3qyZURUNNu7x+rfcg4=; b=faoSTr5wtABUXJPTuUoyWVg4bj9cx/ztHijVxus81ztyIdwUdOY/frk8VD4rPZA15k kPfIeotfyWEpFsdh5N6NiR+c03eZN1mrm1WD75YYFb+8gh5kQOSMyuBo20KTOrz8z+zP kYDp8sXvLVUjZ+jQWz/Tm2M++eeMk9Uo05ltf24fMw9jkqlGsbYuLYXI3SybYIUSJ97D x2OUA4Qn9oR8sc77RA+yu365E6kwhVk50OvkzAK1h68mTY3DsKkoFmTmtSAuytbBxfN4 d+UIrpnldJmTLdfhaOf3J0kyksvrCpYP1eqURBYNjhRwcPMhc6p9Ge+tnkesBWeWMoRF 3FlA== MIME-Version: 1.0 X-Received: by 10.59.11.199 with SMTP id ek7mr6363436ved.19.1368056694168; Wed, 08 May 2013 16:44:54 -0700 (PDT) Received: by 10.220.197.66 with HTTP; Wed, 8 May 2013 16:44:54 -0700 (PDT) In-Reply-To: References: <201305082003.r48K3cYv062256@svn.freebsd.org> Date: Wed, 8 May 2013 16:44:54 -0700 Message-ID: Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast From: Peter Wemm To: Mikolaj Golub Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkT7sEZsYElU/meEKCHU07NPzNfIpjrLrH90shPrZ9iJvZDwzjbBr6qgJ3bMu4sVzQKw/Ij Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:44:55 -0000 On Wed, May 8, 2013 at 4:25 PM, Peter Wemm wrote: > On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub wrote: >> Author: trociny >> Date: Wed May 8 20:03:37 2013 >> New Revision: 250379 >> URL: http://svnweb.freebsd.org/changeset/base/250379 >> >> Log: >> HAST module for bsnmpd(1). >> >> Reviewed by: harti, pjd >> MFC after: 2 weeks > > This breaks world on just about everything other than i386, and it is > technically broken there too but doesn't actually cause a build > failure. > > You cannot link a .so file against a non-pic library, libl.a in this case. > > ===> usr.sbin/bsnmpd/modules/snmp_hast (all)^M > /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o > ): relocation R_X86_64_32 against `a local symbol' can not be used when making a > shared object; recompile with -fPIC^M > /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M > *** [snmp_hast.so.6] Error code 1^M Hmm. It seems clang optimizes something away that gcc doesn't. When building with clang the problem doesn't show up. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV From owner-svn-src-all@FreeBSD.ORG Wed May 8 23:48:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 199F2CB2; Wed, 8 May 2013 23:48:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id E417833D; Wed, 8 May 2013 23:48:36 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 3752423F804; Wed, 8 May 2013 19:48:35 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 3752423F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Wed, 8 May 2013 19:48:32 -0400 From: Glen Barber To: Peter Wemm Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130508234832.GA1617@glenbarber.us> References: <201305082003.r48K3cYv062256@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mikolaj Golub , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:48:37 -0000 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote: > Hmm. It seems clang optimizes something away that gcc doesn't. When > building with clang the problem doesn't show up. >=20 This is becoming more and more common of a problem... :( Glen --azLHFNyN32YCQGCU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQEcBAEBCAAGBQJRiuRQAAoJEFJPDDeguUajuHQH/ifw9ORf8PSEkqTM/bl+H0g+ 3KBrk+hK5rLJR50b6q+Teuoip68IzkGMH2G8Ee4KWYNtHIhR4+7KjTfR1PERpge4 gIzr/2IEgjhsAymx8d5tDL3G1QmRDmpcyubNsX2Wf/eTEBZUShccFwszQnpSshVr r+7c3L5qsvLRlaZm5GFS3BR08SB57H64kJB5MAS7UZU6C/MIgcy8mO3yrDbFhH4g Ewndd9acXWgZD+s/z3nvfkKznA8XKFxW1pno5ySsTRImhvZYQ9ilCqPS2sgkkyMW q9q27RL4G0YBE5/QvPVdd/B20qeH9AZG3lsBwUL1lP9gkJ2tvrQ3wUjbGsxTpkU= =8i5i -----END PGP SIGNATURE----- --azLHFNyN32YCQGCU-- From owner-svn-src-all@FreeBSD.ORG Thu May 9 00:05:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24866FF1; Thu, 9 May 2013 00:05:01 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16F7B3CB; Thu, 9 May 2013 00:05:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49050QJ052963; Thu, 9 May 2013 00:05:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49050BV052951; Thu, 9 May 2013 00:05:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305090005.r49050BV052951@svn.freebsd.org> From: Attilio Rao Date: Thu, 9 May 2013 00:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250395 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 00:05:01 -0000 Author: attilio Date: Thu May 9 00:04:59 2013 New Revision: 250395 URL: http://svnweb.freebsd.org/changeset/base/250395 Log: Generalize the bitset operations, present in cpuset and offer a KPI to redefine such operations for different consumers. This will be used when NUMA support will be finished and numaset will need to be used. Sponsored by: EMC / Isilon storage division Obtained from: jeff Reviewed by: alc Added: head/sys/sys/_bitset.h (contents, props changed) head/sys/sys/bitset.h (contents, props changed) Modified: head/sys/sys/_cpuset.h head/sys/sys/cpuset.h Added: head/sys/sys/_bitset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/_bitset.h Thu May 9 00:04:59 2013 (r250395) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2008, Jeffrey Roberson + * All rights reserved. + * + * Copyright (c) 2008 Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS__BITSET_H_ +#define _SYS__BITSET_H_ + +/* + * Macros addressing word and bit within it, tuned to make compiler + * optimize cases when SETSIZE fits into single machine word. + */ +#define _BITSET_BITS (sizeof(long) * NBBY) + +#define __bitset_words(_s) (howmany(_s, _BITSET_BITS)) + +#define __bitset_mask(_s, n) \ + (1L << ((__bitset_words((_s)) == 1) ? \ + (__size_t)(n) : ((n) % _BITSET_BITS))) + +#define __bitset_word(_s, n) \ + ((__bitset_words((_s)) == 1) ? 0 : ((n) / _BITSET_BITS)) + +#define BITSET_DEFINE(t, _s) \ +struct t { \ + long __bits[__bitset_words((_s))]; \ +}; + +#define BITSET_T_INITIALIZER(x) \ + { .__bits = { x } } + +#define BITSET_FSET(n) \ + [ 0 ... ((n) - 1) ] = (-1L) + +#endif /* !_SYS__BITSET_H_ */ Modified: head/sys/sys/_cpuset.h ============================================================================== --- head/sys/sys/_cpuset.h Wed May 8 23:30:24 2013 (r250394) +++ head/sys/sys/_cpuset.h Thu May 9 00:04:59 2013 (r250395) @@ -32,6 +32,8 @@ #ifndef _SYS__CPUSET_H_ #define _SYS__CPUSET_H_ +#include + #ifdef _KERNEL #define CPU_SETSIZE MAXCPU #endif @@ -42,17 +44,13 @@ #define CPU_SETSIZE CPU_MAXSIZE #endif -#define _NCPUBITS (sizeof(long) * NBBY) /* bits per mask */ -#define _NCPUWORDS howmany(CPU_SETSIZE, _NCPUBITS) - -typedef struct _cpuset { - long __bits[howmany(CPU_SETSIZE, _NCPUBITS)]; -} cpuset_t; +#define _NCPUBITS _BITSET_BITS +#define _NCPUWORDS __bitset_words(CPU_SETSIZE) -#define CPUSET_FSET \ - [ 0 ... (_NCPUWORDS - 1) ] = (-1L) +BITSET_DEFINE(_cpuset, CPU_SETSIZE); +typedef struct _cpuset cpuset_t; -#define CPUSET_T_INITIALIZER(x) \ - { .__bits = { x } } +#define CPUSET_FSET BITSET_FSET(_NCPUWORDS) +#define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER #endif /* !_SYS__CPUSET_H_ */ Added: head/sys/sys/bitset.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/bitset.h Thu May 9 00:04:59 2013 (r250395) @@ -0,0 +1,153 @@ +/*- + * Copyright (c) 2008, Jeffrey Roberson + * All rights reserved. + * + * Copyright (c) 2008 Nokia Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SYS_BITSET_H_ +#define _SYS_BITSET_H_ + +#define BIT_CLR(_s, n, p) \ + ((p)->__bits[__bitset_word(_s, n)] &= ~__bitset_mask((_s), (n))) + +#define BIT_COPY(_s, f, t) (void)(*(t) = *(f)) + +#define BIT_ISSET(_s, n, p) \ + ((((p)->__bits[__bitset_word(_s, n)] & __bitset_mask((_s), (n))) != 0)) + +#define BIT_SET(_s, n, p) \ + ((p)->__bits[__bitset_word(_s, n)] |= __bitset_mask((_s), (n))) + +#define BIT_ZERO(_s, p) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (p)->__bits[__i] = 0L; \ +} while (0) + +#define BIT_FILL(_s, p) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (p)->__bits[__i] = -1L; \ +} while (0) + +#define BIT_SETOF(_s, n, p) do { \ + BIT_ZERO(_s, p); \ + (p)->__bits[__bitset_word(_s, n)] = __bitset_mask((_s), (n)); \ +} while (0) + +/* Is p empty. */ +#define BIT_EMPTY(_s, p) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if ((p)->__bits[__i]) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Is p full set. */ +#define BIT_ISFULLSET(_s, p) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if ((p)->__bits[__i] != (long)-1) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Is c a subset of p. */ +#define BIT_SUBSET(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] & \ + (p)->__bits[__i]) != \ + (c)->__bits[__i]) \ + break; \ + __i == __bitset_words((_s)); \ +}) + +/* Are there any common bits between b & c? */ +#define BIT_OVERLAP(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] & \ + (p)->__bits[__i]) != 0) \ + break; \ + __i != __bitset_words((_s)); \ +}) + +/* Compare two sets, returns 0 if equal 1 otherwise. */ +#define BIT_CMP(_s, p, c) __extension__ ({ \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + if (((c)->__bits[__i] != \ + (p)->__bits[__i])) \ + break; \ + __i != __bitset_words((_s)); \ +}) + +#define BIT_OR(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] |= (s)->__bits[__i]; \ +} while (0) + +#define BIT_AND(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] &= (s)->__bits[__i]; \ +} while (0) + +#define BIT_NAND(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + (d)->__bits[__i] &= ~(s)->__bits[__i]; \ +} while (0) + +#define BIT_CLR_ATOMIC(_s, n, p) \ + atomic_clear_long(&(p)->__bits[__bitset_word(_s, n)], \ + __bitset_mask((_s), n)) + +#define BIT_SET_ATOMIC(_s, n, p) \ + atomic_set_long(&(p)->__bits[__bitset_word(_s, n)], \ + __bitset_mask((_s), n)) + +/* Convenience functions catering special cases. */ +#define BIT_OR_ATOMIC(_s, d, s) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + atomic_set_long(&(d)->__bits[__i], \ + (s)->__bits[__i]); \ +} while (0) + +#define BIT_COPY_STORE_REL(_s, f, t) do { \ + __size_t __i; \ + for (__i = 0; __i < __bitset_words((_s)); __i++) \ + atomic_store_rel_long(&(t)->__bits[__i], \ + (f)->__bits[__i]); \ +} while (0) + +#endif /* !_SYS_BITSET_H_ */ Modified: head/sys/sys/cpuset.h ============================================================================== --- head/sys/sys/cpuset.h Wed May 8 23:30:24 2013 (r250394) +++ head/sys/sys/cpuset.h Thu May 9 00:04:59 2013 (r250395) @@ -34,124 +34,29 @@ #include +#include + #define CPUSETBUFSIZ ((2 + sizeof(long) * 2) * _NCPUWORDS) -/* - * Macros addressing word and bit within it, tuned to make compiler - * optimize cases when CPU_SETSIZE fits into single machine word. - */ -#define __cpuset_mask(n) \ - ((long)1 << ((_NCPUWORDS == 1) ? (__size_t)(n) : ((n) % _NCPUBITS))) -#define __cpuset_word(n) ((_NCPUWORDS == 1) ? 0 : ((n) / _NCPUBITS)) - -#define CPU_CLR(n, p) ((p)->__bits[__cpuset_word(n)] &= ~__cpuset_mask(n)) -#define CPU_COPY(f, t) (void)(*(t) = *(f)) -#define CPU_ISSET(n, p) (((p)->__bits[__cpuset_word(n)] & __cpuset_mask(n)) != 0) -#define CPU_SET(n, p) ((p)->__bits[__cpuset_word(n)] |= __cpuset_mask(n)) -#define CPU_ZERO(p) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (p)->__bits[__i] = 0; \ -} while (0) - -#define CPU_FILL(p) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (p)->__bits[__i] = -1; \ -} while (0) - -#define CPU_SETOF(n, p) do { \ - CPU_ZERO(p); \ - ((p)->__bits[__cpuset_word(n)] = __cpuset_mask(n)); \ -} while (0) - -/* Is p empty. */ -#define CPU_EMPTY(p) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if ((p)->__bits[__i]) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Is p full set. */ -#define CPU_ISFULLSET(p) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if ((p)->__bits[__i] != (long)-1) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Is c a subset of p. */ -#define CPU_SUBSET(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] & \ - (p)->__bits[__i]) != \ - (c)->__bits[__i]) \ - break; \ - __i == _NCPUWORDS; \ -}) - -/* Are there any common bits between b & c? */ -#define CPU_OVERLAP(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] & \ - (p)->__bits[__i]) != 0) \ - break; \ - __i != _NCPUWORDS; \ -}) - -/* Compare two sets, returns 0 if equal 1 otherwise. */ -#define CPU_CMP(p, c) __extension__ ({ \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - if (((c)->__bits[__i] != \ - (p)->__bits[__i])) \ - break; \ - __i != _NCPUWORDS; \ -}) - -#define CPU_OR(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] |= (s)->__bits[__i]; \ -} while (0) - -#define CPU_AND(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] &= (s)->__bits[__i]; \ -} while (0) - -#define CPU_NAND(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - (d)->__bits[__i] &= ~(s)->__bits[__i]; \ -} while (0) - -#define CPU_CLR_ATOMIC(n, p) \ - atomic_clear_long(&(p)->__bits[__cpuset_word(n)], __cpuset_mask(n)) - -#define CPU_SET_ATOMIC(n, p) \ - atomic_set_long(&(p)->__bits[__cpuset_word(n)], __cpuset_mask(n)) - -/* Convenience functions catering special cases. */ -#define CPU_OR_ATOMIC(d, s) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - atomic_set_long(&(d)->__bits[__i], \ - (s)->__bits[__i]); \ -} while (0) - -#define CPU_COPY_STORE_REL(f, t) do { \ - __size_t __i; \ - for (__i = 0; __i < _NCPUWORDS; __i++) \ - atomic_store_rel_long(&(t)->__bits[__i], \ - (f)->__bits[__i]); \ -} while (0) +#define CPU_CLR(n, p) BIT_CLR(CPU_SETSIZE, n, p) +#define CPU_COPY(f, t) BIT_COPY(CPU_SETSIZE, f, t) +#define CPU_ISSET(n, p) BIT_ISSET(CPU_SETSIZE, n, p) +#define CPU_SET(n, p) BIT_SET(CPU_SETSIZE, n, p) +#define CPU_ZERO(p) BIT_ZERO(CPU_SETSIZE, p) +#define CPU_FILL(p) BIT_FILL(CPU_SETSIZE, p) +#define CPU_SETOF(n, p) BIT_SETOF(CPU_SETSIZE, n, p) +#define CPU_EMPTY(p) BIT_EMPTY(CPU_SETSIZE, p) +#define CPU_ISFULLSET(p) BIT_ISFULLSET(CPU_SETSIZE, p) +#define CPU_SUBSET(p, c) BIT_SUBSET(CPU_SETSIZE, p, c) +#define CPU_OVERLAP(p, c) BIT_OVERLAP(CPU_SETSIZE, p, c) +#define CPU_CMP(p, c) BIT_CMP(CPU_SETSIZE, p, c) +#define CPU_OR(d, s) BIT_OR(CPU_SETSIZE, d, s) +#define CPU_AND(d, s) BIT_AND(CPU_SETSIZE, d, s) +#define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) +#define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) +#define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) +#define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) /* * Valid cpulevel_t values. From owner-svn-src-all@FreeBSD.ORG Thu May 9 02:04:29 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A2D673A1; Thu, 9 May 2013 02:04:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 908FD154D; Thu, 9 May 2013 02:04:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4924T1r041229; Thu, 9 May 2013 02:04:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4924TnT041228; Thu, 9 May 2013 02:04:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305090204.r4924TnT041228@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 May 2013 02:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250400 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 02:04:29 -0000 Author: eadler Date: Thu May 9 02:04:28 2013 New Revision: 250400 URL: http://svnweb.freebsd.org/changeset/base/250400 Log: Start sentences on new lines. Modified: head/share/man/man3/queue.3 Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Thu May 9 00:26:20 2013 (r250399) +++ head/share/man/man3/queue.3 Thu May 9 02:04:28 2013 (r250400) @@ -404,7 +404,8 @@ The macro .Nm SLIST_REMOVE_AFTER removes the element after .Fa elm -from the list. Unlike +from the list. +Unlike .Fa SLIST_REMOVE , this macro does not traverse the entire list. .Pp @@ -595,7 +596,8 @@ The macro .Nm STAILQ_REMOVE_AFTER removes the element after .Fa elm -from the tail queue. Unlike +from the tail queue. +Unlike .Fa STAILQ_REMOVE , this macro does not traverse the entire tail queue. .Pp From owner-svn-src-all@FreeBSD.ORG Thu May 9 04:41:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1EC9556D; Thu, 9 May 2013 04:41:04 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10D681CF5; Thu, 9 May 2013 04:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r494f3uV095826; Thu, 9 May 2013 04:41:03 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r494f3Cv095825; Thu, 9 May 2013 04:41:03 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201305090441.r494f3Cv095825@svn.freebsd.org> From: David Xu Date: Thu, 9 May 2013 04:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250402 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 04:41:04 -0000 Author: davidxu Date: Thu May 9 04:41:03 2013 New Revision: 250402 URL: http://svnweb.freebsd.org/changeset/base/250402 Log: Fix return value for setcontext and swapcontext. Modified: head/lib/libthr/thread/thr_sig.c Modified: head/lib/libthr/thread/thr_sig.c ============================================================================== --- head/lib/libthr/thread/thr_sig.c Thu May 9 02:23:02 2013 (r250401) +++ head/lib/libthr/thread/thr_sig.c Thu May 9 04:41:03 2013 (r250402) @@ -725,8 +725,10 @@ _setcontext(const ucontext_t *ucp) { ucontext_t uc; - if (ucp == NULL) - return (EINVAL); + if (ucp == NULL) { + errno = EINVAL; + return (-1); + } if (!SIGISMEMBER(uc.uc_sigmask, SIGCANCEL)) return __sys_setcontext(ucp); (void) memcpy(&uc, ucp, sizeof(uc)); @@ -740,8 +742,10 @@ _swapcontext(ucontext_t *oucp, const uco { ucontext_t uc; - if (oucp == NULL || ucp == NULL) - return (EINVAL); + if (oucp == NULL || ucp == NULL) { + errno = EINVAL; + return (-1); + } if (SIGISMEMBER(ucp->uc_sigmask, SIGCANCEL)) { (void) memcpy(&uc, ucp, sizeof(uc)); SIGDELSET(uc.uc_sigmask, SIGCANCEL); From owner-svn-src-all@FreeBSD.ORG Thu May 9 07:14:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FBDB876; Thu, 9 May 2013 07:14:19 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-x230.google.com (mail-ea0-x230.google.com [IPv6:2a00:1450:4013:c01::230]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8803D8; Thu, 9 May 2013 07:14:18 +0000 (UTC) Received: by mail-ea0-f176.google.com with SMTP id h14so1403111eak.35 for ; Thu, 09 May 2013 00:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=4pBq9VH5SfXWexG8QaXCPebGloY/55bBgVGQOi16VV8=; b=PrMsFRVPJ65Ko39ir97yXOnHo/SYfH5aLiQ9/rGn6S1FERzPalOCrnl41oa2oboFa5 5BcOJaZUzS5ErOCHWsNvmHBWTAH1fRWfpfOqynysQUlxXUCvGBMufg3QiuNhtpX1TevG BoyWSs40rwdjujWWU619oC0DDIns6o85OukxulnCJJ4t/KWuES6kxOPCbs61qFGou70s 30NJuSJ3ygc3sasDvD7VBy2MHjY754WUP6fts3SalJRaOcdO/0qtR0ej+pvoBgrxKDBY 5beepBQYXagL9Gfq46/TeTxJgs7c4OIs2QTcx9z9FYrpiXlTvYRwS+7W2q3BzFQEnesH baLA== X-Received: by 10.14.179.133 with SMTP id h5mr25967630eem.34.1368083657684; Thu, 09 May 2013 00:14:17 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id w43sm2221457eeg.14.2013.05.09.00.14.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 00:14:16 -0700 (PDT) Sender: Mikolaj Golub Date: Thu, 9 May 2013 10:14:14 +0300 From: Mikolaj Golub To: Peter Wemm Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130509071412.GA94250@gmail.com> References: <201305082003.r48K3cYv062256@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 07:14:19 -0000 On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote: > On Wed, May 8, 2013 at 4:25 PM, Peter Wemm wrote: > > On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub wrote: > >> Author: trociny > >> Date: Wed May 8 20:03:37 2013 > >> New Revision: 250379 > >> URL: http://svnweb.freebsd.org/changeset/base/250379 > >> > >> Log: > >> HAST module for bsnmpd(1). > >> > >> Reviewed by: harti, pjd > >> MFC after: 2 weeks > > > > This breaks world on just about everything other than i386, and it is > > technically broken there too but doesn't actually cause a build > > failure. > > > > You cannot link a .so file against a non-pic library, libl.a in this case. > > > > ===> usr.sbin/bsnmpd/modules/snmp_hast (all)^M > > /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o > > ): relocation R_X86_64_32 against `a local symbol' can not be used when making a > > shared object; recompile with -fPIC^M > > /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M > > *** [snmp_hast.so.6] Error code 1^M > > > Hmm. It seems clang optimizes something away that gcc doesn't. When > building with clang the problem doesn't show up. Sorry for breaking build. I am always running tinderbox before commits like this, which did not help this time. Now I will run it twice, with both clang and gcc. Thank you for r250394. I will investigate how to fix this. Any suggestions are highly appreciated. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Thu May 9 08:22:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A5D544D; Thu, 9 May 2013 08:22:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id DD27A827; Thu, 9 May 2013 08:22:48 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r498MiUJ023196; Thu, 9 May 2013 11:22:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r498MiUJ023196 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r498Mhik023195; Thu, 9 May 2013 11:22:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 May 2013 11:22:43 +0300 From: Konstantin Belousov To: Mikolaj Golub Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130509082243.GP3047@kib.kiev.ua> References: <201305082003.r48K3cYv062256@svn.freebsd.org> <20130509071412.GA94250@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aXQ9qeeh/qQh3JeE" Content-Disposition: inline In-Reply-To: <20130509071412.GA94250@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 08:22:49 -0000 --aXQ9qeeh/qQh3JeE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 09, 2013 at 10:14:14AM +0300, Mikolaj Golub wrote: > On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote: > > On Wed, May 8, 2013 at 4:25 PM, Peter Wemm wrote: > > > On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub w= rote: > > >> Author: trociny > > >> Date: Wed May 8 20:03:37 2013 > > >> New Revision: 250379 > > >> URL: http://svnweb.freebsd.org/changeset/base/250379 > > >> > > >> Log: > > >> HAST module for bsnmpd(1). > > >> > > >> Reviewed by: harti, pjd > > >> MFC after: 2 weeks > > > > > > This breaks world on just about everything other than i386, and it is > > > technically broken there too but doesn't actually cause a build > > > failure. > > > > > > You cannot link a .so file against a non-pic library, libl.a in this = case. > > > > > > =3D=3D=3D> usr.sbin/bsnmpd/modules/snmp_hast (all)^M > > > /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(= libyywrap.o > > > ): relocation R_X86_64_32 against `a local symbol' can not be used wh= en making a > > > shared object; recompile with -fPIC^M > > > /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad valu= e^M > > > *** [snmp_hast.so.6] Error code 1^M > >=20 > >=20 > > Hmm. It seems clang optimizes something away that gcc doesn't. When > > building with clang the problem doesn't show up. >=20 > Sorry for breaking build. I am always running tinderbox before commits > like this, which did not help this time. Now I will run it twice, with > both clang and gcc. >=20 > Thank you for r250394. I will investigate how to fix this. Any > suggestions are highly appreciated. Why do you need libl.a ? If only for yywrap(), then re-implementing it for the module seems to be trivial. --aXQ9qeeh/qQh3JeE Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRi1zTAAoJEJDCuSvBvK1BNpYP/1J8V107T2J1jBv6AsP7oanY C3/RrLRxV3eIJmxx9d++eyR5grFra3o0Q0aRsM/2rQG0a8T4xolTXF2wkGprrw1P sYGUEQ7PXoMH/GgM7jbkripBuqQ3MGubRQIJpxq2FjWoYbe2mJPwSbTw3zxZN23V FWVg39eckmBnaLN1oRFOI541pKwU+r/AM2aUpj9doPxSH8EcGBEK79oPYGQm1q/a EI8aSZ6GiCQHkMMYyk0AcQwhbQC9LKMYSnMO4KprYQTA9vTIm6JKVYZhdFGufRYs nurRHM0GREZ2c+Gke0Yv746zKT+2UnLDkWLT025CSJ40AgfXAzq9TLi8BW6C0/DQ 0/3mHkMPd1Hj263ZPq1+2DtZ2KaBoPqehp5F5ES8w48SkqC9m2Zj9tRaxW4am5yQ QsQ8KZRirvzWHnEzCbpvK9XfPsQ0j9GklRqlJJLPZhSWAHkHA2Nn8jP7Us9XfHGU Llq52x0f2pOg8hXMZt2YgsaiAHv8rB6Q2lZs3XqbWTm9goTwF72m29Gfzkaw2ZdI 8ojiuWfzEikj7xwJ7BOf0+lHJ5piPgm48hKKCA4cqGxjapSYgQQ1Aq6OdMM5VQ9F Iz4PHvkJSL203rsZPHmmsezPNvg4w9/rSw2nHDjEfxd4wjQzpCeBC0a5FTsKcaTz ILH1W1ekzjVHB1IUcdSV =Zhrj -----END PGP SIGNATURE----- --aXQ9qeeh/qQh3JeE-- From owner-svn-src-all@FreeBSD.ORG Thu May 9 10:05:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 60BCA15B; Thu, 9 May 2013 10:05:40 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ea0-x22a.google.com (mail-ea0-x22a.google.com [IPv6:2a00:1450:4013:c01::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 6FBD7D4E; Thu, 9 May 2013 10:05:39 +0000 (UTC) Received: by mail-ea0-f170.google.com with SMTP id q16so932865ead.15 for ; Thu, 09 May 2013 03:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=dBsiSY3T30su1j56XNAmbuZUGbvEov3+RMRTkstB8QA=; b=0Qid2Thhsbph8LtaOEn7TsPTaklTuwv7bLwua5wnnMI7YeHgU6VBFE28X4KFMWeCUf dEIftQZouwwdwuGmEuIcDiim/Y6dFDNJsUFTZ9HMrTIIl3mGRIfbG8jnyQ5wu7Wtum4I nqt5ItyNFGEsI/AS+vkei5XyHNXCr/QdCJUfCDXUU5gTrCykojMMjlPio3Cl27+yCmtq DdRcM9uZIx53CE52/6hZ5tQ5EFhSS2v3DSlSQSJZMTvJ1rLLe5qtllUxUeL/86Cd2eAj V7REzvcneSmGCSh+PGFQsZaGY20XKYcRsu9aCc8zmzGZrZMEXAcvjCUni7b+5KrNyiIK Nf4A== X-Received: by 10.14.111.5 with SMTP id v5mr27602964eeg.27.1368093938467; Thu, 09 May 2013 03:05:38 -0700 (PDT) Received: from localhost ([178.150.115.244]) by mx.google.com with ESMTPSA id w43sm3094861eeg.14.2013.05.09.03.05.36 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 09 May 2013 03:05:37 -0700 (PDT) Sender: Mikolaj Golub Date: Thu, 9 May 2013 13:05:35 +0300 From: Mikolaj Golub To: Konstantin Belousov Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130509100533.GC94250@gmail.com> References: <201305082003.r48K3cYv062256@svn.freebsd.org> <20130509071412.GA94250@gmail.com> <20130509082243.GP3047@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline In-Reply-To: <20130509082243.GP3047@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 10:05:40 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 09, 2013 at 11:22:43AM +0300, Konstantin Belousov wrote: > On Thu, May 09, 2013 at 10:14:14AM +0300, Mikolaj Golub wrote: > > On Wed, May 08, 2013 at 04:44:54PM -0700, Peter Wemm wrote: > > > On Wed, May 8, 2013 at 4:25 PM, Peter Wemm wrote: > > > > On Wed, May 8, 2013 at 1:03 PM, Mikolaj Golub wrote: > > > >> Author: trociny > > > >> Date: Wed May 8 20:03:37 2013 > > > >> New Revision: 250379 > > > >> URL: http://svnweb.freebsd.org/changeset/base/250379 > > > >> > > > >> Log: > > > >> HAST module for bsnmpd(1). > > > >> > > > >> Reviewed by: harti, pjd > > > >> MFC after: 2 weeks > > > > > > > > This breaks world on just about everything other than i386, and it is > > > > technically broken there too but doesn't actually cause a build > > > > failure. > > > > > > > > You cannot link a .so file against a non-pic library, libl.a in this case. > > > > > > > > ===> usr.sbin/bsnmpd/modules/snmp_hast (all)^M > > > > /usr/obj/usr/src/tmp/usr/bin/ld: /usr/obj/usr/src/tmp/usr/lib/libl.a(libyywrap.o > > > > ): relocation R_X86_64_32 against `a local symbol' can not be used when making a > > > > shared object; recompile with -fPIC^M > > > > /usr/obj/usr/src/tmp/usr/lib/libl.a: could not read symbols: Bad value^M > > > > *** [snmp_hast.so.6] Error code 1^M > > > > > > > > > Hmm. It seems clang optimizes something away that gcc doesn't. When > > > building with clang the problem doesn't show up. > > > > Sorry for breaking build. I am always running tinderbox before commits > > like this, which did not help this time. Now I will run it twice, with > > both clang and gcc. > > > > Thank you for r250394. I will investigate how to fix this. Any > > suggestions are highly appreciated. > > Why do you need libl.a ? If only for yywrap(), then re-implementing > it for the module seems to be trivial. Yes, it is like so. Thanks! I am now considering two possible solutions: 1) As it is suggested above, add trivial yywrap() and link without -ll. 2) Add '%option noyywrap' to hastd/token.l, and link hastd, hastctl and snmp_hast without -ll (it looks like yywrap is needed only when parsing more than one file). See the patches below. It looks both solutions work for me and I personally prefer the second one. -- Mikolaj Golub --a8Wt8u1KmwUX3Y2C Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="snmp_hast.ll.1.patch" Index: usr.sbin/bsnmpd/modules/snmp_hast/yywrap.c =================================================================== --- usr.sbin/bsnmpd/modules/snmp_hast/yywrap.c (revision 0) +++ usr.sbin/bsnmpd/modules/snmp_hast/yywrap.c (working copy) @@ -0,0 +1,8 @@ +int yywrap(void); + +int +yywrap(void) +{ + + return (1); +} Index: usr.sbin/bsnmpd/modules/snmp_hast/Makefile =================================================================== --- usr.sbin/bsnmpd/modules/snmp_hast/Makefile (revision 250379) +++ usr.sbin/bsnmpd/modules/snmp_hast/Makefile (working copy) @@ -12,7 +12,7 @@ SRCS+= nv.c SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l -SRCS+= y.tab.h +SRCS+= y.tab.h yywrap.c MAN= snmp_hast.8 NO_WFORMAT= @@ -30,7 +30,7 @@ CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def --a8Wt8u1KmwUX3Y2C Content-Type: text/x-diff; charset=us-ascii Content-Disposition: inline; filename="hast.ll.1.patch" Index: sbin/hastd/Makefile =================================================================== --- sbin/hastd/Makefile (revision 250377) +++ sbin/hastd/Makefile (working copy) @@ -31,7 +31,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Index: sbin/hastd/token.l =================================================================== --- sbin/hastd/token.l (revision 250377) +++ sbin/hastd/token.l (working copy) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } Index: sbin/hastctl/Makefile =================================================================== --- sbin/hastctl/Makefile (revision 250377) +++ sbin/hastctl/Makefile (working copy) @@ -32,8 +32,8 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Index: usr.sbin/bsnmpd/modules/snmp_hast/Makefile =================================================================== --- usr.sbin/bsnmpd/modules/snmp_hast/Makefile (revision 250379) +++ usr.sbin/bsnmpd/modules/snmp_hast/Makefile (working copy) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def --a8Wt8u1KmwUX3Y2C-- From owner-svn-src-all@FreeBSD.ORG Thu May 9 11:10:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 195F9E15; Thu, 9 May 2013 11:10:47 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6A62FB1; Thu, 9 May 2013 11:10:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49BAkf5029981; Thu, 9 May 2013 11:10:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49BAk2K029977; Thu, 9 May 2013 11:10:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305091110.r49BAk2K029977@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 9 May 2013 11:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250405 - head/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 11:10:47 -0000 Author: trociny Date: Thu May 9 11:10:46 2013 New Revision: 250405 URL: http://svnweb.freebsd.org/changeset/base/250405 Log: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Requested by: joel X-MFC with: r250379 Added: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied, changed from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Deleted: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Thu May 9 08:30:28 2013 (r250404) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Thu May 9 11:10:46 2013 (r250405) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied and modified: head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8) ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Wed May 8 20:03:37 2013 (r250379, copy source) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Thu May 9 11:10:46 2013 (r250405) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2013 -.Dt SNMP_HAST 8 +.Dd May 9, 2013 +.Dt SNMP_HAST 3 .Os .Sh NAME .Nm snmp_hast From owner-svn-src-all@FreeBSD.ORG Thu May 9 11:43:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 304B35AE; Thu, 9 May 2013 11:43:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2284112E; Thu, 9 May 2013 11:43:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49BhkDF042064; Thu, 9 May 2013 11:43:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Bhk4L042063; Thu, 9 May 2013 11:43:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305091143.r49Bhk4L042063@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 9 May 2013 11:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250406 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 11:43:46 -0000 Author: jilles Date: Thu May 9 11:43:45 2013 New Revision: 250406 URL: http://svnweb.freebsd.org/changeset/base/250406 Log: wordexp(): Simplify code by deferring work to sh. Modified: head/lib/libc/gen/wordexp.c Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Thu May 9 11:10:46 2013 (r250405) +++ head/lib/libc/gen/wordexp.c Thu May 9 11:43:45 2013 (r250406) @@ -139,25 +139,15 @@ we_askshell(const char *words, wordexp_t * We are the child; just get /bin/sh to run the wordexp * builtin on `words'. */ - int devnull; - char *cmd; - (void)_sigprocmask(SIG_SETMASK, &oldsigblock, NULL); _close(pdes[0]); if (_dup2(pdes[1], STDOUT_FILENO) < 0) _exit(1); _close(pdes[1]); - if (asprintf(&cmd, "wordexp %s\n", words) < 0) - _exit(1); - if ((flags & WRDE_SHOWERR) == 0) { - if ((devnull = _open(_PATH_DEVNULL, O_RDWR, 0666)) < 0) - _exit(1); - if (_dup2(devnull, STDERR_FILENO) < 0) - _exit(1); - _close(devnull); - } execl(_PATH_BSHELL, "sh", flags & WRDE_UNDEF ? "-u" : "+u", - "-c", cmd, (char *)NULL); + "-c", "eval \"$1\";eval \"wordexp $2\"", "", + flags & WRDE_SHOWERR ? "" : "exec 2>/dev/null", words, + (char *)NULL); _exit(1); } From owner-svn-src-all@FreeBSD.ORG Thu May 9 12:08:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3EEAADF4; Thu, 9 May 2013 12:08:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id A3CE8271; Thu, 9 May 2013 12:08:31 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r49C8STb068919; Thu, 9 May 2013 15:08:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r49C8STb068919 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r49C8RNf068917; Thu, 9 May 2013 15:08:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 May 2013 15:08:27 +0300 From: Konstantin Belousov To: Mikolaj Golub Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130509120827.GR3047@kib.kiev.ua> References: <201305082003.r48K3cYv062256@svn.freebsd.org> <20130509071412.GA94250@gmail.com> <20130509082243.GP3047@kib.kiev.ua> <20130509100533.GC94250@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AeeUtFwBxAlMaHsO" Content-Disposition: inline In-Reply-To: <20130509100533.GC94250@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek , Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 12:08:32 -0000 --AeeUtFwBxAlMaHsO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 09, 2013 at 01:05:35PM +0300, Mikolaj Golub wrote: > Yes, it is like so. Thanks! I am now considering two possible > solutions: >=20 > 1) As it is suggested above, add trivial yywrap() and link without -ll. >=20 > 2) Add '%option noyywrap' to hastd/token.l, and link hastd, hastctl > and snmp_hast without -ll (it looks like yywrap is needed only when > parsing more than one file). >=20 > See the patches below. It looks both solutions work for me and I > personally prefer the second one. I do not have any opinion, use what you prefer. --AeeUtFwBxAlMaHsO Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRi5G7AAoJEJDCuSvBvK1B0I0P+gKcRfbTG8Hlw5d0ynhDkhvo MA3CyPWHiS5haIOCF97T3ANe7mv62Vvn9hOdTzHrMnhVS+FTQTn78Mk+NuR3d5EK iwoBpCzFE6D95pcdkNtcd+9zMI8M4xRyRwG4ZzFHhsJtopQ9XmSUc1p87DZX+dxh 1jzsO7hswmOyexv2My/LMuwuDYC/PTkrCNy2ZqfldCAdwu4RutHT0V3d+K3wFhPF EkJHAtl5xFis8SAOnAmGpCOBvT1LFWIS5NzaEnH6c9x8sGpMh77c8dpsupppXDXr DfobKgX5/eMzw7PMXzqSmfn92SNN2nzQsR0kjAGj7pB3+2mkpgbQAksG/M1F8I+Y fxGQXQ47x8HVl+fEJsjrEWdKpt1MzuI+1vmODNM6MpYGT+y5mlwikstBslKgAywY 5PNfXqqolhnrbptK5z1Sy+Yt0NFA7xA3USgnI9R22Fv6UCIAyB3B99nn8XlyRm5f MfWsVhpYPek6pYt928Yf84NzRn3SKzktI6WcZxQmtfhwgcqgRQIdzT1wt0aZ4tK0 hrt4QmiVrWDvnmaNjKF1905VJocakztCBbc7st6jsnQNgYVVZq/5L/JPPJftGXr8 8Dc881/1uB5J6TXgp2GQqNZC/BCrGY7R0T2waCUcUXmR4I3+NBZ0VmGq4O95ywnn 9x3QZ7wnJt7QLRqkBNpp =MGFj -----END PGP SIGNATURE----- --AeeUtFwBxAlMaHsO-- From owner-svn-src-all@FreeBSD.ORG Thu May 9 12:20:19 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D046A3C3; Thu, 9 May 2013 12:20:19 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 6294F2FC; Thu, 9 May 2013 12:20:19 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 245B812013A; Thu, 9 May 2013 14:20:05 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id ECEC128493; Thu, 9 May 2013 14:20:01 +0200 (CEST) Date: Thu, 9 May 2013 14:20:01 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale Message-ID: <20130509122001.GB48322@stack.nl> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> <5184ED7E.3040703@freebsd.org> <51851969.6020802@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andrey Chernov , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 12:20:19 -0000 On Sat, May 04, 2013 at 08:42:18PM +0400, Sergey Kandaurov wrote: > On 4 May 2013 18:21, Andrey Chernov wrote: > > On 04.05.2013 16:03, Sergey Kandaurov wrote: > >>> BTW, I don't run tests and look in asm code for sure, but it seems > >>> property[0] == p[0] is unneeded because almost every compiler tries to > >>> inline strcmp(). > >> Doesn't seem so (in-lining), see below. > > Yes, system's GNU cc don't inline strcmp() but inlines memcmp(): > > repz > > cmpsb > > I don't have clang nearby right now to test what it does. > I've checked gcc46 and clang3.2, and they behave similarly (poor). > It's worth to note that inlined memcmp didn't help with performance > relative to strcmp(). > note2 - it's surprising that only base gcc inlined memcmp. This explains > the difference between base gcc and {gcc46, clang} in the table below. > 1 - base gcc 4.2 > 2 - gcc46 > 3 - base clang 3.2 > a - if (property[0] == p[0] && strcmp(property, p) == 0) > b - if (property[0] == p[0] && memcmp(property, p, *len2) == 0) > c - if (memcmp(property, p, *len2) == 0) I also tried gperf and it is faster and more consistent; however, gperf generates a 256-byte table in addition to the expected hash table and I consider that too big. > Time spend for 2097152 wctype() calls for each of wctype property > 1a 2a 3a 1b 2b 3b 1c 2c 3c > alnum 0.034 0.036 0.034 0.049 0.071 0.073 0.046 0.068 0.069 > alpha 0.045 0.049 0.046 0.111 0.156 0.158 0.107 0.153 0.154 > blank 0.037 0.041 0.038 0.053 0.075 0.079 0.153 0.224 0.223 > cntrl 0.039 0.044 0.042 0.058 0.078 0.081 0.206 0.300 0.301 > digit 0.039 0.044 0.043 0.059 0.080 0.085 0.259 0.378 0.378 > graph 0.043 0.049 0.050 0.061 0.082 0.087 0.313 0.455 0.455 > lower 0.044 0.049 0.051 0.062 0.085 0.090 0.365 0.532 0.533 > print 0.048 0.054 0.059 0.067 0.088 0.092 0.419 0.610 0.610 > punct 0.060 0.067 0.103 0.127 0.183 0.211 0.477 0.692 0.692 > space 0.053 0.059 0.067 0.072 0.092 0.097 0.525 0.764 0.765 > upper 0.054 0.059 0.068 0.074 0.094 0.100 0.578 0.841 0.842 > xdigit 0.060 0.066 0.077 0.079 0.099 0.106 0.635 0.922 0.985 > ideogram 0.068 0.074 0.084 0.087 0.089 0.094 0.695 0.986 0.985 > special 0.098 0.104 0.113 0.169 0.210 0.212 0.753 1.116 1.118 > phonogram 0.136 0.156 0.187 0.240 0.285 0.325 0.815 1.181 1.183 > rune 0.064 0.070 0.087 0.099 0.104 0.113 0.842 1.293 1.283 I think newer compilers don't use the REPZ CMPSB because they know it is very slow. Intel optimization manuals discourage all string instructions except repeated MOVS and STOS. For example, agner.org's tables say REPZ CMPSB takes 80+2n cycles on an Intel Sandy Bridge. That's so slow you can take a few branch mispredictions from a simple loop and still come out ahead. On other CPUs it may not be as slow but generally still slower than a simple loop (and you can do better than a simple loop). The only reason to use REPZ CMPSB is its small size: it is itself smaller than a call and requires fewer instructions to save and restore registers, set up parameters, etc. The i386 and amd64 versions of memcmp() use REPZ CMPSL or CMPSQ followed by REPZ CMPSB for the remainder. This cuts down on the 2n part but the 80 cycles setup time is paid twice. I think architecture-specific memcmp() for i386 and amd64 can still be beneficial because of the fast unaligned access offered by these CPUs, which allows comparison of 4 or 8 bytes at a time. SSE2 allows comparison of 16 bytes at a time but is somewhat harder: not all i386 CPUs support SSE2, unaligned access is slow on some older CPUs and it requires assembly so it only uses %xmm8-%xmm15 so rtld does not trash function parameters (or rtld needs to use non-SSE2 code). -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Thu May 9 12:37:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9CC639EB; Thu, 9 May 2013 12:37:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 260C1405; Thu, 9 May 2013 12:37:02 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r49CaxDX075191; Thu, 9 May 2013 15:36:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r49CaxDX075191 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r49CaxhW075190; Thu, 9 May 2013 15:36:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 May 2013 15:36:59 +0300 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r250215 - stable/9/lib/libc/locale Message-ID: <20130509123659.GU3047@kib.kiev.ua> References: <201305031552.r43FqiPN024580@svn.freebsd.org> <5183E899.4000503@freebsd.org> <20130503195540.GA52657@stack.nl> <5184ED7E.3040703@freebsd.org> <51851969.6020802@freebsd.org> <20130509122001.GB48322@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d4EsLEyG6LnpJRR1" Content-Disposition: inline In-Reply-To: <20130509122001.GB48322@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org, Sergey Kandaurov X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 12:37:03 -0000 --d4EsLEyG6LnpJRR1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 09, 2013 at 02:20:01PM +0200, Jilles Tjoelker wrote: > I think architecture-specific memcmp() for i386 and amd64 can still be > beneficial because of the fast unaligned access offered by these CPUs, > which allows comparison of 4 or 8 bytes at a time. SSE2 allows > comparison of 16 bytes at a time but is somewhat harder: not all i386 > CPUs support SSE2, unaligned access is slow on some older CPUs and it > requires assembly so it only uses %xmm8-%xmm15 so rtld does not trash > function parameters (or rtld needs to use non-SSE2 code). FWIW, rtld is not allowed to modify any registers in the bind code called from the PLT trampoline. The C ABI is not mandated for the functions resolved through the PLT, so our rtld care to not destroy even caller-save or scratch registers, at least on x86*. --d4EsLEyG6LnpJRR1 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRi5hrAAoJEJDCuSvBvK1BstkQAID36MQef02L1sLclvSn5i5y blSLjtVhcD2W1rg8fzbQEQSc3JQ8Bg9We/4RoXEG3BIATrLNgd6DHD+LwtmbVzLy JriOeTkcDiLurLpKrYKhWWzxME6z5hhK9nSXy38cDNw1IhOWp+nxaKOm2F1xpYnu ZEQYgU9YCfP5IOjdHuibAS7HSyxMgMh2/B2yNbyyFWyhsgnqGEi2ET89GnjtaxE2 TIsOwz0asvRkT64MdBLsJBFIGokQ9p31/yZX3XxgJJi4vOYDHiTGeF4Iqx9G5maI h5UUfkhJk+oyCoEaYbmdndVYfLSnZsxFeWIZH8HRcN6ugX6LGQkbpiX7IXKMO5B3 c6/Ud5tbF7dVAvDan8VocIkgx4hFWMQLFG2U3kMiKkf8ZVNSgNn0DNWjUHGXPo8T MdOfCcFKNNUq1F50Aj+GRe6FAA+Cu03rECPPbCWRhmQC/NX+7PZEhptU0aN7VK/c LgHpMmqZGAtOPsGx+0NZReGY4MMzpgIO5+ju1xxD0IK2DAeFh3nZzTH3ebKHNCgj vcYzx/6JWyX91tCEfWHIv6KuK79C+c2jElzL9O09/vanzQZasbRuhWCq6YiZIUck SvUq5liL4CdzU08sjvtEGNCU32iYNKlVnqQb2MOaKokTw/2EOpIiR5uc5sEPhNJX KyTOf+hF1tyddRSIB2P+ =S+1P -----END PGP SIGNATURE----- --d4EsLEyG6LnpJRR1-- From owner-svn-src-all@FreeBSD.ORG Thu May 9 14:43:38 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06D2D212; Thu, 9 May 2013 14:43:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC82DB20; Thu, 9 May 2013 14:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49EhbO0004232; Thu, 9 May 2013 14:43:37 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Ehbf9004229; Thu, 9 May 2013 14:43:37 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305091443.r49Ehbf9004229@svn.freebsd.org> From: Brooks Davis Date: Thu, 9 May 2013 14:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250407 - in head/usr.sbin/makefs: . compat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 14:43:38 -0000 Author: brooks Date: Thu May 9 14:43:36 2013 New Revision: 250407 URL: http://svnweb.freebsd.org/changeset/base/250407 Log: Remove duplicated copies of various NetBSD compatibility shims used by makefs and use libnetbsd, contrib/mtree, and contrib/mknod instead. Sponsored by: DARPA, AFRLo MFC after: 1 month Deleted: head/usr.sbin/makefs/compat/ head/usr.sbin/makefs/getid.c Modified: head/usr.sbin/makefs/Makefile head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/Makefile ============================================================================== --- head/usr.sbin/makefs/Makefile Thu May 9 11:43:45 2013 (r250406) +++ head/usr.sbin/makefs/Makefile Thu May 9 14:43:36 2013 (r250407) @@ -5,7 +5,6 @@ PROG= makefs CFLAGS+=-I${.CURDIR} SRCS= cd9660.c ffs.c \ - getid.c \ makefs.c \ mtree.c \ walk.c @@ -15,19 +14,28 @@ WARNS?= 2 .include "${.CURDIR}/cd9660/Makefile.inc" .include "${.CURDIR}/ffs/Makefile.inc" -.include "${.CURDIR}/compat/Makefile.inc" CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -.PATH: ${.CURDIR}/../mtree -CFLAGS+=-I${.CURDIR}/../mtree -SRCS+= misc.c spec.c +.PATH: ${.CURDIR}/../../contrib/mtree +CFLAGS+=-I${.CURDIR}/../../contrib/mtree +SRCS+= getid.c misc.c spec.c + +.PATH: ${.CURDIR}/../../contrib/mknod +CFLAGS+=-I${.CURDIR}/../../contrib/mknod +SRCS+= pack_dev.c .PATH: ${.CURDIR}/../../sys/ufs/ffs SRCS+= ffs_tables.c -DPADD= ${LIBSBUF} -LDADD= -lsbuf +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd +LIBNETBSDDIR= ${.OBJDIR}/../../lib/libnetbsd +LIBNETBSD= ${LIBNETBSDDIR}/libnetbsd.a +DPADD+= ${LIBNETBSD} +LDADD+= ${LIBNETBSD} + +DPADD+= ${LIBSBUF} ${LIBUTIL} +LDADD+= -lsbuf -lutil .include Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Thu May 9 11:43:45 2013 (r250406) +++ head/usr.sbin/makefs/makefs.h Thu May 9 14:43:36 2013 (r250407) @@ -282,22 +282,4 @@ void ffs_fragacct_swap(struct fs *, in fsinode *link_check(fsinode *); -/* - * Declarations for compat routines. - */ -long long strsuftoll(const char *, const char *, long long, long long); -long long strsuftollx(const char *, const char *, - long long, long long, char *, size_t); - -struct passwd; -int uid_from_user(const char *, uid_t *); -int pwcache_userdb(int (*)(int), void (*)(void), - struct passwd * (*)(const char *), struct passwd * (*)(uid_t)); -struct group; -int gid_from_group(const char *, gid_t *); -int pwcache_groupdb(int (*)(int), void (*)(void), - struct group * (*)(const char *), struct group * (*)(gid_t)); - -int setup_getid(const char *dir); - #endif /* _MAKEFS_H */ Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Thu May 9 11:43:45 2013 (r250406) +++ head/usr.sbin/makefs/walk.c Thu May 9 14:43:36 2013 (r250407) @@ -304,7 +304,7 @@ apply_specfile(const char *specfile, con if ((fp = fopen(specfile, "r")) == NULL) err(1, "Can't open `%s'", specfile); TIMER_START(start); - root = mtree_readspec(fp); + root = spec(fp); TIMER_RESULTS(start, "spec"); if (fclose(fp) == EOF) err(1, "Can't close `%s'", specfile); @@ -320,33 +320,6 @@ apply_specfile(const char *specfile, con } -static u_int -nodetoino(u_int type) -{ - - switch (type) { - case F_BLOCK: - return S_IFBLK; - case F_CHAR: - return S_IFCHR; - case F_DIR: - return S_IFDIR; - case F_FIFO: - return S_IFIFO; - case F_FILE: - return S_IFREG; - case F_LINK: - return S_IFLNK; - case F_SOCK: - return S_IFSOCK; - default: - printf("unknown type %d", type); - abort(); - } - /* NOTREACHED */ -} - - static void apply_specdir(const char *dir, NODE *specnode, fsnode *dirnode, int speconly) { From owner-svn-src-all@FreeBSD.ORG Thu May 9 15:57:55 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA35C208; Thu, 9 May 2013 15:57:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AACFDECF; Thu, 9 May 2013 15:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49FvtgV029023; Thu, 9 May 2013 15:57:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49FvtEr029022; Thu, 9 May 2013 15:57:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305091557.r49FvtEr029022@svn.freebsd.org> From: Adrian Chadd Date: Thu, 9 May 2013 15:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250408 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 15:57:55 -0000 Author: adrian Date: Thu May 9 15:57:55 2013 New Revision: 250408 URL: http://svnweb.freebsd.org/changeset/base/250408 Log: Update the holding buffer locking for EDMA. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Thu May 9 14:43:36 2013 (r250407) +++ head/sys/dev/ath/if_ath_tx_edma.c Thu May 9 15:57:55 2013 (r250408) @@ -409,7 +409,7 @@ ath_edma_xmit_handoff_mcast(struct ath_s wh = mtod(bf_last->bf_m, struct ieee80211_frame *); wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA; - /* sync descriptor to memory */ + /* re-sync buffer to memory */ bus_dmamap_sync(sc->sc_dmat, bf_last->bf_dmamap, BUS_DMASYNC_PREWRITE); @@ -734,9 +734,9 @@ ath_edma_tx_processq(struct ath_softc *s * buffer any longer. */ if (bf->bf_flags & ATH_BUF_FIFOEND) { - ATH_TXBUF_LOCK(sc); + ATH_TXQ_LOCK(txq); ath_txq_freeholdingbuf(sc, txq); - ATH_TXBUF_UNLOCK(sc); + ATH_TXQ_UNLOCK(txq); } /* From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:05:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 52088621; Thu, 9 May 2013 16:05:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3362EF57; Thu, 9 May 2013 16:05:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49G5qo4032339; Thu, 9 May 2013 16:05:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49G5q8M032338; Thu, 9 May 2013 16:05:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305091605.r49G5q8M032338@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 9 May 2013 16:05:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250409 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:05:52 -0000 Author: kib Date: Thu May 9 16:05:51 2013 New Revision: 250409 URL: http://svnweb.freebsd.org/changeset/base/250409 Log: Item 1 in r248830 causes earlier exits from the sendfile(2), before all requested data was sent. The reason is that xfsize <= 0 condition must not be tested at all if space == loopbytes. Otherwise, the done is set to 1, and sendfile(2) is aborted too early. Instead of moving the condition to exiting the inner loop after the xfersize check, directly check for the completed transfer before the testing of the available space in the socket buffer, and revert item 1 of r248830. It is arguably another bug to sleep waiting for socket buffer space (or return EAGAIN for non-blocking socket) if all bytes are already transferred. Reported by: pho Discussed with: scottl, gibbs Tested by: scottl (stable/9 backport), pho Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu May 9 15:57:55 2013 (r250408) +++ head/sys/kern/uipc_syscalls.c Thu May 9 16:05:51 2013 (r250409) @@ -1956,6 +1956,17 @@ kern_sendfile(struct thread *td, struct goto out; vn_lock(vp, LK_SHARED | LK_RETRY); if (vp->v_type == VREG) { + bsize = vp->v_mount->mnt_stat.f_iosize; + if (uap->nbytes == 0) { + error = VOP_GETATTR(vp, &va, td->td_ucred); + if (error != 0) { + VOP_UNLOCK(vp, 0); + obj = NULL; + goto out; + } + rem = va.va_size; + } else + rem = uap->nbytes; obj = vp->v_object; if (obj != NULL) { /* @@ -1973,7 +1984,8 @@ kern_sendfile(struct thread *td, struct obj = NULL; } } - } + } else + bsize = 0; /* silence gcc */ VOP_UNLOCK(vp, 0); if (obj == NULL) { error = EINVAL; @@ -2065,11 +2077,20 @@ kern_sendfile(struct thread *td, struct * The outer loop checks the state and available space of the socket * and takes care of the overall progress. */ - for (off = uap->offset, rem = uap->nbytes; ; ) { - struct mbuf *mtail = NULL; - int loopbytes = 0; - int space = 0; - int done = 0; + for (off = uap->offset; ; ) { + struct mbuf *mtail; + int loopbytes; + int space; + int done; + + if ((uap->nbytes != 0 && uap->nbytes == fsbytes) || + (uap->nbytes == 0 && va.va_size == fsbytes)) + break; + + mtail = NULL; + loopbytes = 0; + space = 0; + done = 0; /* * Check the socket state for ongoing connection, @@ -2141,17 +2162,16 @@ retry_space: if (error != 0) goto done; error = VOP_GETATTR(vp, &va, td->td_ucred); - if (error != 0) { + if (error != 0 || off >= va.va_size) { VOP_UNLOCK(vp, 0); goto done; } - bsize = vp->v_mount->mnt_stat.f_iosize; /* * Loop and construct maximum sized mbuf chain to be bulk * dumped into socket buffer. */ - while (1) { + while (space > loopbytes) { vm_pindex_t pindex; vm_offset_t pgoff; struct mbuf *m0; @@ -2175,15 +2195,6 @@ retry_space: } /* - * We've already overfilled the socket. - * Let the outer loop figure out how to handle it. - */ - if (space <= loopbytes) { - done = 0; - break; - } - - /* * Attempt to look up the page. Allocate * if not found or wait and loop if busy. */ From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:09:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AD085872; Thu, 9 May 2013 16:09:39 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EBA4F86; Thu, 9 May 2013 16:09:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49G9d1H033153; Thu, 9 May 2013 16:09:39 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49G9dpM033152; Thu, 9 May 2013 16:09:39 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201305091609.r49G9dpM033152@svn.freebsd.org> From: Devin Teske Date: Thu, 9 May 2013 16:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250410 - head/usr.sbin/bsdconfig/share/packages X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:09:39 -0000 Author: dteske Date: Thu May 9 16:09:39 2013 New Revision: 250410 URL: http://svnweb.freebsd.org/changeset/base/250410 Log: Fix a bug that would cause the category menu to display the wrong value for number of packages available in the "All" category. Problem caused by re-using a variable that was still needed; fixed by variable name change. Modified: head/usr.sbin/bsdconfig/share/packages/index.subr Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Thu May 9 16:05:51 2013 (r250409) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Thu May 9 16:09:39 2013 (r250410) @@ -146,11 +146,11 @@ f_index_read() BEGIN { valid_chars = ENVIRON["VALID_VARNAME_CHARS"] default_desc = ENVIRON["msg_no_description_provided"] - npkgs = 0 + tpkgs = 0 prefix = "" } { - npkgs++ + tpkgs++ varpkg = $1 gsub("[^" valid_chars "]", "_", varpkg) print "_categories_" varpkg "=\"" $7 "\"" @@ -160,7 +160,7 @@ f_index_read() print "_rundeps_" varpkg "=\"" $9 "\"" } END { - print "_npkgs=" npkgs # For convenience, total package count + print "_npkgs=" tpkgs # For convenience, total package count n = asorti(categories, categories_sorted) @@ -175,7 +175,7 @@ f_index_read() # Create menu list and generate list of categories at same time print "CATEGORY_MENU_LIST=\"" - print_category(ENVIRON["msg_all"], npkgs, + print_category(ENVIRON["msg_all"], tpkgs, ENVIRON["msg_all_desc"]) category_list = "" for (i = 1; i <= n; i++) From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:28:20 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F29B2D17; Thu, 9 May 2013 16:28:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E41E5B5; Thu, 9 May 2013 16:28:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49GSJhf039882; Thu, 9 May 2013 16:28:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49GSI33039873; Thu, 9 May 2013 16:28:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201305091628.r49GSI33039873@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 9 May 2013 16:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250411 - in head/sys: conf kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:28:20 -0000 Author: marcel Date: Thu May 9 16:28:18 2013 New Revision: 250411 URL: http://svnweb.freebsd.org/changeset/base/250411 Log: Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE locks. To support this, VNODE locks are created with the LK_IS_VNODE flag. This flag is propagated down using the LO_IS_VNODE flag. Note that WITNESS still records the LOR. Only the printing and the optional entering into the kernel debugger is bypassed with the WITNESS_NO_VNODE option. Modified: head/sys/conf/options head/sys/kern/kern_lock.c head/sys/kern/subr_witness.c head/sys/kern/vfs_subr.c head/sys/sys/lock.h head/sys/sys/lockmgr.h Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu May 9 16:09:39 2013 (r250410) +++ head/sys/conf/options Thu May 9 16:28:18 2013 (r250411) @@ -672,6 +672,7 @@ KTR_ENTRIES opt_global.h KTR_VERBOSE opt_ktr.h WITNESS opt_global.h WITNESS_KDB opt_witness.h +WITNESS_NO_VNODE opt_witness.h WITNESS_SKIPSPIN opt_witness.h # options for ACPI support Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Thu May 9 16:09:39 2013 (r250410) +++ head/sys/kern/kern_lock.c Thu May 9 16:28:18 2013 (r250411) @@ -393,6 +393,8 @@ lockinit(struct lock *lk, int pri, const iflags |= LO_WITNESS; if (flags & LK_QUIET) iflags |= LO_QUIET; + if (flags & LK_IS_VNODE) + iflags |= LO_IS_VNODE; iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE); lk->lk_lock = LK_UNLOCKED; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Thu May 9 16:09:39 2013 (r250410) +++ head/sys/kern/subr_witness.c Thu May 9 16:28:18 2013 (r250411) @@ -1289,7 +1289,19 @@ witness_checkorder(struct lock_object *l w->w_reversed = w1->w_reversed = 1; witness_increment_graph_generation(); mtx_unlock_spin(&w_mtx); - + +#ifdef WITNESS_NO_VNODE + /* + * There are known LORs between VNODE locks. They are + * not an indication of a bug. VNODE locks are flagged + * as such (LO_IS_VNODE) and we don't yell if the LOR + * is between 2 VNODE locks. + */ + if ((lock->lo_flags & LO_IS_VNODE) != 0 && + (lock1->li_lock->lo_flags & LO_IS_VNODE) != 0) + return; +#endif + /* * Ok, yell about it. */ Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu May 9 16:09:39 2013 (r250410) +++ head/sys/kern/vfs_subr.c Thu May 9 16:28:18 2013 (r250411) @@ -1037,7 +1037,7 @@ alloc: * By default, don't allow shared locks unless filesystems * opt-in. */ - lockinit(vp->v_vnlock, PVFS, tag, VLKTIMEOUT, LK_NOSHARE); + lockinit(vp->v_vnlock, PVFS, tag, VLKTIMEOUT, LK_NOSHARE | LK_IS_VNODE); /* * Initialize bufobj. */ Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Thu May 9 16:09:39 2013 (r250410) +++ head/sys/sys/lock.h Thu May 9 16:28:18 2013 (r250411) @@ -79,6 +79,7 @@ struct lock_class { #define LO_SLEEPABLE 0x00100000 /* Lock may be held while sleeping. */ #define LO_UPGRADABLE 0x00200000 /* Lock may be upgraded/downgraded. */ #define LO_DUPOK 0x00400000 /* Don't check for duplicate acquires */ +#define LO_IS_VNODE 0x00800000 /* Tell WITNESS about a VNODE lock */ #define LO_CLASSMASK 0x0f000000 /* Class index bitmask. */ #define LO_NOPROFILE 0x10000000 /* Don't profile this lock */ Modified: head/sys/sys/lockmgr.h ============================================================================== --- head/sys/sys/lockmgr.h Thu May 9 16:09:39 2013 (r250410) +++ head/sys/sys/lockmgr.h Thu May 9 16:28:18 2013 (r250411) @@ -146,6 +146,7 @@ _lockmgr_args_rw(struct lock *lk, u_int #define LK_NOWITNESS 0x000010 #define LK_QUIET 0x000020 #define LK_ADAPTIVE 0x000040 +#define LK_IS_VNODE 0x000080 /* Tell WITNESS about a VNODE lock */ /* * Additional attributes to be used in lockmgr(). From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:42:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B67917E; Thu, 9 May 2013 16:42:02 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C253147; Thu, 9 May 2013 16:42:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49Gg2qn045483; Thu, 9 May 2013 16:42:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Gg23g045482; Thu, 9 May 2013 16:42:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305091642.r49Gg23g045482@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 9 May 2013 16:42:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250412 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:42:02 -0000 Author: jilles Date: Thu May 9 16:42:01 2013 New Revision: 250412 URL: http://svnweb.freebsd.org/changeset/base/250412 Log: posix_spawn_file_actions_addopen(3): Correct error for bad file descriptor. As per POSIX.1-2008, posix_spawn_file_actions_add* return [EBADF] if a file descriptor is negative, not [EINVAL]. The bug was only in the manual page; the code is correct. MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 ============================================================================== --- head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 16:28:18 2013 (r250411) +++ head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 16:42:01 2013 (r250412) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 24, 2008 +.Dd May 9, 2013 .Dt POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 3 .Os .Sh NAME @@ -145,7 +145,7 @@ otherwise, an error number is returned t These functions fail if: .Bl -tag -width Er -.It Bq Er EINVAL +.It Bq Er EBADF The value specified by .Fa fildes or From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:46:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2FE3A59B; Thu, 9 May 2013 16:46:28 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x22d.google.com (mail-ie0-x22d.google.com [IPv6:2607:f8b0:4001:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id DE9162C1; Thu, 9 May 2013 16:46:27 +0000 (UTC) Received: by mail-ie0-f173.google.com with SMTP id k5so5959752iea.4 for ; Thu, 09 May 2013 09:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=kwpbDvQEZZIxx2l5a35KZAnDjKkq4ZkS5LKOhgBklw4=; b=Y5NCVcfNSx2E5EibaRvE5qHRNh1WoaFKVAMEn4EzIlJnw0U+e8ZpxA4fkhOxWK44jZ MJ6PEejhAH0N6yy6uBFb+zHWdoUHWqXwbiigGXhiE1DcM0OdyCWATvUT4bxrGjLC/2M5 5SvEvcndzWtCjZmPwXeQbrUgop1SSEHEZyoFGbZoAwqPj4/PETDD814Eg9fgqX1zMEem P6x42gP/LUKC/tej26Kk3jp6C8PX3qG3sSq59gWHP4nSDE6+vVmmF0YlWb7IzshsKg0o P2s+VexPdqSo3eV1J1zV3b3h9IBROQYLRlHtjzSAs/WQhyZuhIzm81JGMs3wszeGlqyv /gIA== MIME-Version: 1.0 X-Received: by 10.50.17.8 with SMTP id k8mr10412677igd.1.1368117987625; Thu, 09 May 2013 09:46:27 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Thu, 9 May 2013 09:46:27 -0700 (PDT) In-Reply-To: <201305091628.r49GSI33039873@svn.freebsd.org> References: <201305091628.r49GSI33039873@svn.freebsd.org> Date: Thu, 9 May 2013 18:46:27 +0200 X-Google-Sender-Auth: VMga2UBSSWjXg6MxcJmqIBIq4zc Message-ID: Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:46:28 -0000 On Thu, May 9, 2013 at 6:28 PM, Marcel Moolenaar wrote: > Author: marcel > Date: Thu May 9 16:28:18 2013 > New Revision: 250411 > URL: http://svnweb.freebsd.org/changeset/base/250411 > > Log: > Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE > locks. To support this, VNODE locks are created with the LK_IS_VNODE > flag. This flag is propagated down using the LO_IS_VNODE flag. > > Note that WITNESS still records the LOR. Only the printing and the > optional entering into the kernel debugger is bypassed with the > WITNESS_NO_VNODE option. This is the wrong way to deal with such problem and I avoided to do something like that on purpose. The way to fix this is to implement LK_NOWITNESS on a per-lock basis into lockmgr, propagate the same concept to the vn_lock() (which should be basically done automatically) and finally identify the false-positive case and commit for them explicitely LK_NOWITNESS on a per-call basis, explaining in detail why the single case reported is a false-positive. Please revert this patch asap. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu May 9 16:57:03 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 73F50FB1; Thu, 9 May 2013 16:57:03 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4C159AAD; Thu, 9 May 2013 16:57:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49Gv3D9049991; Thu, 9 May 2013 16:57:03 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Gv2GK049987; Thu, 9 May 2013 16:57:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305091657.r49Gv2GK049987@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 9 May 2013 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250413 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 16:57:03 -0000 Author: luigi Date: Thu May 9 16:57:02 2013 New Revision: 250413 URL: http://svnweb.freebsd.org/changeset/base/250413 Log: simplify the code to initialize the RDT while in netmap mode. Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu May 9 16:42:01 2013 (r250412) +++ head/sys/dev/e1000/if_em.c Thu May 9 16:57:02 2013 (r250413) @@ -4333,6 +4333,8 @@ em_initialize_receive_unit(struct adapte for (int i = 0; i < adapter->num_queues; i++, rxr++) { /* Setup the Base and Length of the Rx Descriptor Ring */ + u32 rdt = adapter->num_rx_desc - 1; /* default */ + bus_addr = rxr->rxdma.dma_paddr; E1000_WRITE_REG(hw, E1000_RDLEN(i), adapter->num_rx_desc * sizeof(struct e1000_rx_desc)); @@ -4344,18 +4346,11 @@ em_initialize_receive_unit(struct adapte /* * an init() while a netmap client is active must * preserve the rx buffers passed to userspace. - * In this driver it means we adjust RDT to - * something different from na->num_rx_desc - 1. */ - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[i]; - int t = na->num_rx_desc - 1 - kring->nr_hwavail; - - E1000_WRITE_REG(hw, E1000_RDT(i), t); - } else + if (ifp->if_capenable & IFCAP_NETMAP) + rdt -= NA(adapter->ifp)->rx_rings[i].nr_hwavail; #endif /* DEV_NETMAP */ - E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); + E1000_WRITE_REG(hw, E1000_RDT(i), rdt); } /* Set PTHRESH for improved jumbo performance */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu May 9 16:42:01 2013 (r250412) +++ head/sys/dev/e1000/if_lem.c Thu May 9 16:57:02 2013 (r250413) @@ -3361,19 +3361,13 @@ lem_initialize_receive_unit(struct adapt * Tail Descriptor Pointers */ E1000_WRITE_REG(&adapter->hw, E1000_RDH(0), 0); + rctl = adapter->num_rx_desc - 1; /* default RDT value */ #ifdef DEV_NETMAP /* preserve buffers already made available to clients */ - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[0]; - int t = na->num_rx_desc - 1 - kring->nr_hwavail; - - if (t >= na->num_rx_desc) - t -= na->num_rx_desc; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), t); - } else + if (ifp->if_capenable & IFCAP_NETMAP) + rctl -= NA(adapter->ifp)->rx_rings[0].nr_hwavail; #endif /* DEV_NETMAP */ - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), adapter->num_rx_desc - 1); + E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), rctl); return; } From owner-svn-src-all@FreeBSD.ORG Thu May 9 17:07:32 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 39E5ACA1; Thu, 9 May 2013 17:07:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1B800937; Thu, 9 May 2013 17:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49H7Vh9053809; Thu, 9 May 2013 17:07:31 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49H7Vv6053804; Thu, 9 May 2013 17:07:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305091707.r49H7Vv6053804@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 9 May 2013 17:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250414 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 17:07:32 -0000 Author: luigi Date: Thu May 9 17:07:30 2013 New Revision: 250414 URL: http://svnweb.freebsd.org/changeset/base/250414 Log: if_lem.c: make sure that lem_rxeof() can drain the entire rx queue irrespective of the setting of lem_rx_process_limit, while giving a chance to the taskqueue scheduler to act after each chunk. This makes lem_rxeof similar to the one in if_em.c and if_igb.c . if_lem.c and if_em.c: add a sysctl to manually configure the 'itr' moderation register. Approved by: Jack Vogel Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/if_lem.c head/sys/dev/e1000/if_lem.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu May 9 16:57:02 2013 (r250413) +++ head/sys/dev/e1000/if_em.c Thu May 9 17:07:30 2013 (r250414) @@ -335,6 +335,9 @@ MODULE_DEPEND(em, ether, 1, 1, 1); #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) #define M_TSO_LEN 66 +#define MAX_INTS_PER_SEC 8000 +#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) + /* Allow common code without TSO */ #ifndef CSUM_TSO #define CSUM_TSO 0 @@ -570,6 +573,11 @@ em_attach(device_t dev) &adapter->tx_abs_int_delay, E1000_REGISTER(hw, E1000_TADV), em_tx_abs_int_delay_dflt); + em_add_int_delay_sysctl(adapter, "itr", + "interrupt delay limit in usecs/4", + &adapter->tx_itr, + E1000_REGISTER(hw, E1000_ITR), + DEFAULT_ITR); /* Sysctl for limiting the amount of work done in the taskqueue */ em_set_sysctl_value(adapter, "rx_processing_limit", @@ -4271,8 +4279,6 @@ em_free_receive_buffers(struct rx_ring * * Enable receive unit. * **********************************************************************/ -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256) static void em_initialize_receive_unit(struct adapter *adapter) @@ -5618,6 +5624,8 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS) return (EINVAL); info->value = usecs; ticks = EM_USECS_TO_TICKS(usecs); + if (info->offset == E1000_ITR) /* units are 256ns here */ + ticks *= 4; adapter = info->adapter; Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Thu May 9 16:57:02 2013 (r250413) +++ head/sys/dev/e1000/if_em.h Thu May 9 17:07:30 2013 (r250414) @@ -429,6 +429,7 @@ struct adapter { struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; struct em_int_delay_info rx_abs_int_delay; + struct em_int_delay_info tx_itr; /* Misc stats maintained by the driver */ unsigned long dropped_pkts; Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Thu May 9 16:57:02 2013 (r250413) +++ head/sys/dev/e1000/if_lem.c Thu May 9 17:07:30 2013 (r250414) @@ -281,6 +281,9 @@ MODULE_DEPEND(lem, ether, 1, 1, 1); #define EM_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) +#define MAX_INTS_PER_SEC 8000 +#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) + static int lem_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int lem_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); static int lem_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV); @@ -442,6 +445,11 @@ lem_attach(device_t dev) &adapter->tx_abs_int_delay, E1000_REGISTER(&adapter->hw, E1000_TADV), lem_tx_abs_int_delay_dflt); + lem_add_int_delay_sysctl(adapter, "itr", + "interrupt delay limit in usecs/4", + &adapter->tx_itr, + E1000_REGISTER(&adapter->hw, E1000_ITR), + DEFAULT_ITR); } /* Sysctls for limiting the amount of work done in the taskqueue */ @@ -1337,12 +1345,16 @@ lem_handle_rxtx(void *context, int pendi if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - lem_rxeof(adapter, adapter->rx_process_limit, NULL); + bool more = lem_rxeof(adapter, adapter->rx_process_limit, NULL); EM_TX_LOCK(adapter); lem_txeof(adapter); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) lem_start_locked(ifp); EM_TX_UNLOCK(adapter); + if (more) { + taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); + return; + } } if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -3269,8 +3281,6 @@ lem_setup_receive_structures(struct adap * Enable receive unit. * **********************************************************************/ -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256) static void lem_initialize_receive_unit(struct adapter *adapter) @@ -4596,6 +4606,8 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS return (EINVAL); info->value = usecs; ticks = EM_USECS_TO_TICKS(usecs); + if (info->offset == E1000_ITR) /* units are 256ns here */ + ticks *= 4; adapter = info->adapter; Modified: head/sys/dev/e1000/if_lem.h ============================================================================== --- head/sys/dev/e1000/if_lem.h Thu May 9 16:57:02 2013 (r250413) +++ head/sys/dev/e1000/if_lem.h Thu May 9 17:07:30 2013 (r250414) @@ -363,6 +363,7 @@ struct adapter { struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; struct em_int_delay_info rx_abs_int_delay; + struct em_int_delay_info tx_itr; /* * Transmit definitions From owner-svn-src-all@FreeBSD.ORG Thu May 9 17:25:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2F2531FA; Thu, 9 May 2013 17:25:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21A36E99; Thu, 9 May 2013 17:25:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49HPUo5060455; Thu, 9 May 2013 17:25:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49HPTOr060454; Thu, 9 May 2013 17:25:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305091725.r49HPTOr060454@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 9 May 2013 17:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250415 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 17:25:30 -0000 Author: kib Date: Thu May 9 17:25:29 2013 New Revision: 250415 URL: http://svnweb.freebsd.org/changeset/base/250415 Log: Correct the type for the literal used on the left side of the shift up to 63 bit positions. Do not fill the save area and do not set the saved bit in the xstate bit vector for the state which is not marked as enabled in xsave_mask. Reported and tested by: Jim Ohlstein MFC after: 3 days Modified: head/sys/amd64/amd64/fpu.c Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Thu May 9 17:07:30 2013 (r250414) +++ head/sys/amd64/amd64/fpu.c Thu May 9 17:25:29 2013 (r250415) @@ -687,8 +687,8 @@ fpugetregs(struct thread *td) offsetof(struct xstate_hdr, xstate_bv)); max_ext_n = flsl(xsave_mask); for (i = 0; i < max_ext_n; i++) { - bit = 1 << i; - if ((*xstate_bv & bit) != 0) + bit = 1ULL << i; + if ((xsave_mask & bit) == 0 || (*xstate_bv & bit) != 0) continue; bcopy((char *)fpu_initialstate + xsave_area_desc[i].offset, From owner-svn-src-all@FreeBSD.ORG Thu May 9 18:38:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4012EF96; Thu, 9 May 2013 18:38:50 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1872BB6E; Thu, 9 May 2013 18:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49Icnm4087717; Thu, 9 May 2013 18:38:49 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49IcnF7087713; Thu, 9 May 2013 18:38:49 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305091838.r49IcnF7087713@svn.freebsd.org> From: Mikolaj Golub Date: Thu, 9 May 2013 18:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250416 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 18:38:50 -0000 Author: trociny Date: Thu May 9 18:38:49 2013 New Revision: 250416 URL: http://svnweb.freebsd.org/changeset/base/250416 Log: MFC r249488: Similarly to proc_getargv() and proc_getenvv(), export proc_getauxv() to be able to reuse the code. Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/proc.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Thu May 9 17:25:29 2013 (r250415) +++ stable/9/sys/kern/kern_proc.c Thu May 9 18:38:49 2013 (r250416) @@ -1760,6 +1760,27 @@ proc_getenvv(struct thread *td, struct p return (get_ps_strings(curthread, p, sb, PROC_ENV)); } +int +proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb) +{ + size_t vsize, size; + char **auxv; + int error; + + error = get_proc_vector(td, p, &auxv, &vsize, PROC_AUX); + if (error == 0) { +#ifdef COMPAT_FREEBSD32 + if (SV_PROC_FLAG(p, SV_ILP32) != 0) + size = vsize * sizeof(Elf32_Auxinfo); + else +#endif + size = vsize * sizeof(Elf_Auxinfo); + error = sbuf_bcat(sb, auxv, size); + free(auxv, M_TEMP); + } + return (error); +} + /* * This sysctl allows a process to retrieve the argument list or process * title for another process without groping around in the address space @@ -1865,9 +1886,8 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG int *name = (int *)arg1; u_int namelen = arg2; struct proc *p; - size_t vsize, size; - char **auxv; - int error; + struct sbuf sb; + int error, error2; if (namelen != 1) return (EINVAL); @@ -1879,21 +1899,12 @@ sysctl_kern_proc_auxv(SYSCTL_HANDLER_ARG PRELE(p); return (0); } - error = get_proc_vector(curthread, p, &auxv, &vsize, PROC_AUX); - if (error == 0) { -#ifdef COMPAT_FREEBSD32 - if (SV_PROC_FLAG(p, SV_ILP32) != 0) - size = vsize * sizeof(Elf32_Auxinfo); - else -#endif - size = vsize * sizeof(Elf_Auxinfo); - PRELE(p); - error = SYSCTL_OUT(req, auxv, size); - free(auxv, M_TEMP); - } else { - PRELE(p); - } - return (error); + sbuf_new_for_sysctl(&sb, NULL, GET_PS_STRINGS_CHUNK_SZ, req); + error = proc_getauxv(curthread, p, &sb); + error2 = sbuf_finish(&sb); + PRELE(p); + sbuf_delete(&sb); + return (error != 0 ? error : error2); } /* Modified: stable/9/sys/sys/proc.h ============================================================================== --- stable/9/sys/sys/proc.h Thu May 9 17:25:29 2013 (r250415) +++ stable/9/sys/sys/proc.h Thu May 9 18:38:49 2013 (r250416) @@ -884,6 +884,7 @@ struct pargs *pargs_alloc(int len); void pargs_drop(struct pargs *pa); void pargs_hold(struct pargs *pa); int proc_getargv(struct thread *td, struct proc *p, struct sbuf *sb); +int proc_getauxv(struct thread *td, struct proc *p, struct sbuf *sb); int proc_getenvv(struct thread *td, struct proc *p, struct sbuf *sb); void procinit(void); void proc_linkup0(struct proc *p, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Thu May 9 18:43:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3496E2FC; Thu, 9 May 2013 18:43:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27388C04; Thu, 9 May 2013 18:43:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49Ih2do090157; Thu, 9 May 2013 18:43:02 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Ih2Ii090156; Thu, 9 May 2013 18:43:02 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201305091843.r49Ih2Ii090156@svn.freebsd.org> From: Brooks Davis Date: Thu, 9 May 2013 18:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250417 - stable/9/etc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 18:43:02 -0000 Author: brooks Date: Thu May 9 18:43:01 2013 New Revision: 250417 URL: http://svnweb.freebsd.org/changeset/base/250417 Log: MFC r250116: Make an attempt to detect missing MTREE files in distrib-dirs. Not perfect, but this is just a developer seatbelt PR: conf/176897 Submitted by: Garrett Cooper Modified: stable/9/etc/Makefile Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Thu May 9 18:38:49 2013 (r250416) +++ stable/9/etc/Makefile Thu May 9 18:43:01 2013 (r250417) @@ -310,7 +310,7 @@ MTREES+= mtree/BSD.sendmail.dist / MTREES+= ../${mtree} / .endfor -distrib-dirs: +distrib-dirs: ${MTREES:N/*} @set ${MTREES}; \ while test $$# -ge 2; do \ m=${.CURDIR}/$$1; \ From owner-svn-src-all@FreeBSD.ORG Thu May 9 19:24:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0BB91858; Thu, 9 May 2013 19:24:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E08ACDAC; Thu, 9 May 2013 19:24:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49JOoW2004650; Thu, 9 May 2013 19:24:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49JOo7E004649; Thu, 9 May 2013 19:24:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305091924.r49JOo7E004649@svn.freebsd.org> From: John Baldwin Date: Thu, 9 May 2013 19:24:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250418 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 19:24:51 -0000 Author: jhb Date: Thu May 9 19:24:50 2013 New Revision: 250418 URL: http://svnweb.freebsd.org/changeset/base/250418 Log: Revision 233677 broke certain machines. Specifically, if the firmware/BIOS assigned conflicting ranges to BARs then leaving the BARs alone could result in one device stealing mmio accesses intended to go to a second device. Prior to 233677 the PCI bus driver attempted to handle this case by clearing the BAR to 0 depending on BARs based at 0 not decoding (which is not guaranteed to be true). Now when a conflicting BAR is detected the following steps are taken: 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is enabled), then ignore the current BAR setting from the firmware and attempt to allocate a fresh resource range for the BAR. 2) If 1) failed (or was disabled), disable decoding for the relevant BAR type (e.g. disable mem decoding for a memory BAR) and emit a warning if booting verbose. Tested by: Alex Keda MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Thu May 9 18:43:01 2013 (r250417) +++ head/sys/dev/pci/pci.c Thu May 9 19:24:50 2013 (r250418) @@ -280,6 +280,12 @@ SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_ enable these bits correctly. We'd like to do this all the time, but there\n\ are some peripherals that this causes problems with."); +static int pci_do_realloc_bars = 1; +TUNABLE_INT("hw.pci.realloc_bars", &pci_do_realloc_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW, + &pci_do_realloc_bars, 0, + "Attempt to allocate a new range for any BARs whose original firmware-assigned ranges fail to allocate during the initial device scan."); + static int pci_do_power_nodriver = 0; TUNABLE_INT("hw.pci.do_power_nodriver", &pci_do_power_nodriver); SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RW, @@ -2816,13 +2822,34 @@ pci_add_map(device_t bus, device_t dev, */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); + if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { + /* + * If the allocation fails, try to allocate a resource for + * this BAR using any available range. The firmware felt + * it was important enough to assign a resource, so don't + * disable decoding if we can help it. + */ + resource_list_delete(rl, type, reg); + resource_list_add(rl, type, reg, 0, ~0ul, count); + res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, + count, prefetch ? RF_PREFETCHABLE : 0); + } if (res == NULL) { /* * If the allocation fails, delete the resource list entry - * to force pci_alloc_resource() to allocate resources - * from the parent. + * and disable decoding for this device. + * + * If the driver requests this resource in the future, + * pci_reserve_map() will try to allocate a fresh + * resource range. */ resource_list_delete(rl, type, reg); + pci_disable_io(dev, type); + if (bootverbose) + device_printf(bus, + "pci%d:%d:%d:%d bar %#x failed to allocate\n", + pci_get_domain(dev), pci_get_bus(dev), + pci_get_slot(dev), pci_get_function(dev), reg); } else { start = rman_get_start(res); pci_write_bar(dev, pm, start); From owner-svn-src-all@FreeBSD.ORG Thu May 9 19:26:53 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 59B47A86; Thu, 9 May 2013 19:26:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ve0-x229.google.com (mail-ve0-x229.google.com [IPv6:2607:f8b0:400c:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id DC762DCD; Thu, 9 May 2013 19:26:52 +0000 (UTC) Received: by mail-ve0-f169.google.com with SMTP id jz10so3158002veb.14 for ; Thu, 09 May 2013 12:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=iLgXSKUmmmLkQG7DUrLUfBDhBFTm3yi3UiZ2POI9+WQ=; b=Z53dTJU78gA7A5bl1Cpu1KdSIvvat/kt4esS8uIMxPglgghE2skzUWSF39LYjoxYGd csvTnZIs5m6/+2/ncX48ESW7oTeS3kk9xo8xtA4rp2LuPlTp7OjLJDnveABBCWCnBY1K DgxXaqKcz1WOiH3yadhB8OeHc9uoYcTHWsftQcTZAlM1ZxnB6VnjmTqtuvl239GFNK1t DzHj9vyGKpIDqEDLyIrtjAfMN7MHMPa032vBIF6AawJm3YStnzTf+j3yjveZ4Z+YOpd1 p2dfYsX26FrQnUDD+W3p5sZEAUQdYfpOUqks83sfa7OY/ljTccY3sPnxa4Tm4cRxsPF6 Hpkg== MIME-Version: 1.0 X-Received: by 10.220.253.8 with SMTP id my8mr9010714vcb.23.1368127612455; Thu, 09 May 2013 12:26:52 -0700 (PDT) Received: by 10.220.141.72 with HTTP; Thu, 9 May 2013 12:26:52 -0700 (PDT) In-Reply-To: <201305091443.r49Ehbf9004229@svn.freebsd.org> References: <201305091443.r49Ehbf9004229@svn.freebsd.org> Date: Thu, 9 May 2013 12:26:52 -0700 Message-ID: Subject: Re: svn commit: r250407 - in head/usr.sbin/makefs: . compat From: Garrett Cooper To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 19:26:53 -0000 On Thu, May 9, 2013 at 7:43 AM, Brooks Davis wrote: > Author: brooks > Date: Thu May 9 14:43:36 2013 > New Revision: 250407 > URL: http://svnweb.freebsd.org/changeset/base/250407 > > Log: > Remove duplicated copies of various NetBSD compatibility shims used by > makefs and use libnetbsd, contrib/mtree, and contrib/mknod instead. > > Sponsored by: DARPA, AFRLo > MFC after: 1 month > > Deleted: > head/usr.sbin/makefs/compat/ > head/usr.sbin/makefs/getid.c > Modified: > head/usr.sbin/makefs/Makefile > head/usr.sbin/makefs/makefs.h > head/usr.sbin/makefs/walk.c I like the idea of libnetbsd, but there really isn't a clean way to designate whether or not something needs to use the compat shims without extensively hacking imported sources. Some of the concerns are over: 1. __arraycount (NetBSD) vs nitems (FreeBSD/OpenBSD). 2. __DECONST (FreeBSD) vs __UNCONST (NetBSD). Also, nitems live in sys/param.h instead of sys/cdefs.h which causes issues when porting over code from NetBSD. Could we improve this to match NetBSD a bit more in the base system without having to extensively involve libnetbsd? Also, could we make a make snippet for interfacing with libnetbsd to avoid code duplication? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Thu May 9 19:37:01 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A712C98; Thu, 9 May 2013 19:37:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C3D6E1F; Thu, 9 May 2013 19:37:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49Jb0F1008443; Thu, 9 May 2013 19:37:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Jb0pa008442; Thu, 9 May 2013 19:37:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305091937.r49Jb0pa008442@svn.freebsd.org> From: Adrian Chadd Date: Thu, 9 May 2013 19:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250419 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 19:37:01 -0000 Author: adrian Date: Thu May 9 19:37:00 2013 New Revision: 250419 URL: http://svnweb.freebsd.org/changeset/base/250419 Log: Add some missing arge MDIO hints. Submitted by: Luiz Otavio O Souza Modified: head/sys/mips/conf/ROUTERSTATION.hints Modified: head/sys/mips/conf/ROUTERSTATION.hints ============================================================================== --- head/sys/mips/conf/ROUTERSTATION.hints Thu May 9 19:24:50 2013 (r250418) +++ head/sys/mips/conf/ROUTERSTATION.hints Thu May 9 19:37:00 2013 (r250419) @@ -2,6 +2,12 @@ # $FreeBSD$ # +# arge0 mdio bus +hint.argemdio.0.at="nexus0" +hint.argemdio.0.maddr=0x19000000 +hint.argemdio.0.msize=0x1000 +hint.argemdio.0.order=0 + # Uncomment this hint for RS (not PRO) # PHY20 = 1 << 20 hint.arge.0.phymask=0x100000 From owner-svn-src-all@FreeBSD.ORG Thu May 9 20:13:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B4EB4909; Thu, 9 May 2013 20:13:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E528F88; Thu, 9 May 2013 20:13:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49KDibh022498; Thu, 9 May 2013 20:13:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49KDhE0022496; Thu, 9 May 2013 20:13:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201305092013.r49KDhE0022496@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 9 May 2013 20:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250420 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 20:13:44 -0000 Author: bz Date: Thu May 9 20:13:43 2013 New Revision: 250420 URL: http://svnweb.freebsd.org/changeset/base/250420 Log: MFp4 CH=227440: Convert the structures to C99 style initialisation, which makes it a lot easier to check that all of them are set and to generate a derived template from them. Sponsored by: DARPA, AFRL MFC after: 2 weeks Modified: head/sys/mips/mips/bus_space_fdt.c head/sys/mips/mips/bus_space_generic.c Modified: head/sys/mips/mips/bus_space_fdt.c ============================================================================== --- head/sys/mips/mips/bus_space_fdt.c Thu May 9 19:37:00 2013 (r250419) +++ head/sys/mips/mips/bus_space_fdt.c Thu May 9 20:13:43 2013 (r250420) @@ -94,109 +94,109 @@ static int fdt_bs_map(void *, bus_addr_t static struct bus_space fdt_space = { /* cookie */ - (void *) 0, + .bs_cookie = (void *) 0, /* mapping/unmapping */ - fdt_bs_map, - generic_bs_unmap, - generic_bs_subregion, + .bs_map = fdt_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - generic_bs_alloc, - generic_bs_free, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - generic_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - generic_bs_r_8, + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = generic_bs_r_8, /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - generic_bs_rm_8, + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = generic_bs_rm_8, /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - generic_bs_rr_8, + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = generic_bs_rr_8, /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - generic_bs_w_8, + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = generic_bs_w_8, /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - generic_bs_wm_8, + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = generic_bs_wm_8, /* write region */ - generic_bs_wr_1, - generic_bs_wr_2, - generic_bs_wr_4, - generic_bs_wr_8, + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = generic_bs_wr_8, /* set multiple */ - generic_bs_sm_1, - generic_bs_sm_2, - generic_bs_sm_4, - generic_bs_sm_8, + .bs_sm_1 = generic_bs_sm_1, + .bs_sm_2 = generic_bs_sm_2, + .bs_sm_4 = generic_bs_sm_4, + .bs_sm_8 = generic_bs_sm_8, /* set region */ - generic_bs_sr_1, - generic_bs_sr_2, - generic_bs_sr_4, - generic_bs_sr_8, + .bs_sr_1 = generic_bs_sr_1, + .bs_sr_2 = generic_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = generic_bs_sr_8, /* copy */ - generic_bs_c_1, - generic_bs_c_2, - generic_bs_c_4, - generic_bs_c_8, + .bs_c_1 = generic_bs_c_1, + .bs_c_2 = generic_bs_c_2, + .bs_c_4 = generic_bs_c_4, + .bs_c_8 = generic_bs_c_8, /* read (single) stream */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - generic_bs_r_8, + .bs_r_1_s = generic_bs_r_1, + .bs_r_2_s = generic_bs_r_2, + .bs_r_4_s = generic_bs_r_4, + .bs_r_8_s = generic_bs_r_8, /* read multiple stream */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - generic_bs_rm_8, + .bs_rm_1_s = generic_bs_rm_1, + .bs_rm_2_s = generic_bs_rm_2, + .bs_rm_4_s = generic_bs_rm_4, + .bs_rm_8_s = generic_bs_rm_8, /* read region stream */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - generic_bs_rr_8, + .bs_rr_1_s = generic_bs_rr_1, + .bs_rr_2_s = generic_bs_rr_2, + .bs_rr_4_s = generic_bs_rr_4, + .bs_rr_8_s = generic_bs_rr_8, /* write (single) stream */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - generic_bs_w_8, + .bs_w_1_s = generic_bs_w_1, + .bs_w_2_s = generic_bs_w_2, + .bs_w_4_s = generic_bs_w_4, + .bs_w_8_s = generic_bs_w_8, /* write multiple stream */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - generic_bs_wm_8, + .bs_wm_1_s = generic_bs_wm_1, + .bs_wm_2_s = generic_bs_wm_2, + .bs_wm_4_s = generic_bs_wm_4, + .bs_wm_8_s = generic_bs_wm_8, /* write region stream */ - generic_bs_wr_1, - generic_bs_wr_2, - generic_bs_wr_4, - generic_bs_wr_8, + .bs_wr_1_s = generic_bs_wr_1, + .bs_wr_2_s = generic_bs_wr_2, + .bs_wr_4_s = generic_bs_wr_4, + .bs_wr_8_s = generic_bs_wr_8, }; /* generic bus_space tag */ Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Thu May 9 19:37:00 2013 (r250419) +++ head/sys/mips/mips/bus_space_generic.c Thu May 9 20:13:43 2013 (r250420) @@ -91,109 +91,109 @@ __FBSDID("$FreeBSD$"); static struct bus_space generic_space = { /* cookie */ - (void *) 0, + .bs_cookie = (void *) 0, /* mapping/unmapping */ - generic_bs_map, - generic_bs_unmap, - generic_bs_subregion, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ - generic_bs_alloc, - generic_bs_free, + .bs_alloc = generic_bs_alloc, + .bs_free = generic_bs_free, /* barrier */ - generic_bs_barrier, + .bs_barrier = generic_bs_barrier, /* read (single) */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - generic_bs_r_8, + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = generic_bs_r_8, /* read multiple */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - generic_bs_rm_8, + .bs_rm_1 = generic_bs_rm_1, + .bs_rm_2 = generic_bs_rm_2, + .bs_rm_4 = generic_bs_rm_4, + .bs_rm_8 = generic_bs_rm_8, /* read region */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - generic_bs_rr_8, + .bs_rr_1 = generic_bs_rr_1, + .bs_rr_2 = generic_bs_rr_2, + .bs_rr_4 = generic_bs_rr_4, + .bs_rr_8 = generic_bs_rr_8, /* write (single) */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - generic_bs_w_8, + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = generic_bs_w_8, /* write multiple */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - generic_bs_wm_8, + .bs_wm_1 = generic_bs_wm_1, + .bs_wm_2 = generic_bs_wm_2, + .bs_wm_4 = generic_bs_wm_4, + .bs_wm_8 = generic_bs_wm_8, /* write region */ - generic_bs_wr_1, - generic_bs_wr_2, - generic_bs_wr_4, - generic_bs_wr_8, + .bs_wr_1 = generic_bs_wr_1, + .bs_wr_2 = generic_bs_wr_2, + .bs_wr_4 = generic_bs_wr_4, + .bs_wr_8 = generic_bs_wr_8, /* set multiple */ - generic_bs_sm_1, - generic_bs_sm_2, - generic_bs_sm_4, - generic_bs_sm_8, + .bs_sm_1 = generic_bs_sm_1, + .bs_sm_2 = generic_bs_sm_2, + .bs_sm_4 = generic_bs_sm_4, + .bs_sm_8 = generic_bs_sm_8, /* set region */ - generic_bs_sr_1, - generic_bs_sr_2, - generic_bs_sr_4, - generic_bs_sr_8, + .bs_sr_1 = generic_bs_sr_1, + .bs_sr_2 = generic_bs_sr_2, + .bs_sr_4 = generic_bs_sr_4, + .bs_sr_8 = generic_bs_sr_8, /* copy */ - generic_bs_c_1, - generic_bs_c_2, - generic_bs_c_4, - generic_bs_c_8, + .bs_c_1 = generic_bs_c_1, + .bs_c_2 = generic_bs_c_2, + .bs_c_4 = generic_bs_c_4, + .bs_c_8 = generic_bs_c_8, /* read (single) stream */ - generic_bs_r_1, - generic_bs_r_2, - generic_bs_r_4, - generic_bs_r_8, + .bs_r_1_s = generic_bs_r_1, + .bs_r_2_s = generic_bs_r_2, + .bs_r_4_s = generic_bs_r_4, + .bs_r_8_s = generic_bs_r_8, /* read multiple stream */ - generic_bs_rm_1, - generic_bs_rm_2, - generic_bs_rm_4, - generic_bs_rm_8, + .bs_rm_1_s = generic_bs_rm_1, + .bs_rm_2_s = generic_bs_rm_2, + .bs_rm_4_s = generic_bs_rm_4, + .bs_rm_8_s = generic_bs_rm_8, /* read region stream */ - generic_bs_rr_1, - generic_bs_rr_2, - generic_bs_rr_4, - generic_bs_rr_8, + .bs_rr_1_s = generic_bs_rr_1, + .bs_rr_2_s = generic_bs_rr_2, + .bs_rr_4_s = generic_bs_rr_4, + .bs_rr_8_s = generic_bs_rr_8, /* write (single) stream */ - generic_bs_w_1, - generic_bs_w_2, - generic_bs_w_4, - generic_bs_w_8, + .bs_w_1_s = generic_bs_w_1, + .bs_w_2_s = generic_bs_w_2, + .bs_w_4_s = generic_bs_w_4, + .bs_w_8_s = generic_bs_w_8, /* write multiple stream */ - generic_bs_wm_1, - generic_bs_wm_2, - generic_bs_wm_4, - generic_bs_wm_8, + .bs_wm_1_s = generic_bs_wm_1, + .bs_wm_2_s = generic_bs_wm_2, + .bs_wm_4_s = generic_bs_wm_4, + .bs_wm_8_s = generic_bs_wm_8, /* write region stream */ - generic_bs_wr_1, - generic_bs_wr_2, - generic_bs_wr_4, - generic_bs_wr_8, + .bs_wr_1_s = generic_bs_wr_1, + .bs_wr_2_s = generic_bs_wr_2, + .bs_wr_4_s = generic_bs_wr_4, + .bs_wr_8_s = generic_bs_wr_8, }; /* Ultra-gross kludge */ From owner-svn-src-all@FreeBSD.ORG Thu May 9 20:56:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD4F81B9; Thu, 9 May 2013 20:56:46 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 807E115C; Thu, 9 May 2013 20:56:46 +0000 (UTC) Received: from jsiegel-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.6/8.14.6) with ESMTP id r49Kuds1097150 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 9 May 2013 13:56:40 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Marcel Moolenaar In-Reply-To: Date: Thu, 9 May 2013 13:56:33 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305091628.r49GSI33039873@svn.freebsd.org> To: attilio@FreeBSD.org X-Mailer: Apple Mail (2.1503) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 20:56:46 -0000 On May 9, 2013, at 9:46 AM, Attilio Rao wrote: > On Thu, May 9, 2013 at 6:28 PM, Marcel Moolenaar = wrote: >> Author: marcel >> Date: Thu May 9 16:28:18 2013 >> New Revision: 250411 >> URL: http://svnweb.freebsd.org/changeset/base/250411 >>=20 >> Log: >> Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE >> locks. To support this, VNODE locks are created with the LK_IS_VNODE >> flag. This flag is propagated down using the LO_IS_VNODE flag. >>=20 >> Note that WITNESS still records the LOR. Only the printing and the >> optional entering into the kernel debugger is bypassed with the >> WITNESS_NO_VNODE option. >=20 > This is the wrong way to deal with such problem and I avoided to do > something like that on purpose. I disagree. We have known LOR messages between VNODE locks that pollute the console and so far we haven't fixed the root cause in some form or shape. Silencing this known case is good to maximize the attention LORs need to be given while still have witness involved to catch locking problems with vnodes that are of a different nature. >=20 > The way to fix this is to implement LK_NOWITNESS on a per-lock basis > into lockmgr, propagate the same concept to the vn_lock() (which > should be basically done automatically) and finally identify the > false-positive case and commit for them explicitely LK_NOWITNESS on a > per-call basis, explaining in detail why the single case reported is a > false-positive. This is worse. You want witness involved. > Please revert this patch asap. This change does not inhibit people from fixing the problem at the root cause, and in the mean time maximize witness' effectiveness. Calling for a backout is unwarranted and unnecessarily aggressive. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Thu May 9 21:29:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6938A6D5; Thu, 9 May 2013 21:29:14 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AAFC2B5; Thu, 9 May 2013 21:29:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49LTE8g047913; Thu, 9 May 2013 21:29:14 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49LTEFa047912; Thu, 9 May 2013 21:29:14 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305092129.r49LTEFa047912@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 9 May 2013 21:29:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250421 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 21:29:14 -0000 Author: jilles Date: Thu May 9 21:29:13 2013 New Revision: 250421 URL: http://svnweb.freebsd.org/changeset/base/250421 Log: posix_spawn_file_actions_adddup2(3): Document difference with dup2(). The ability to clear a file descriptor's close-on-exec flag via posix_spawn_file_actions_adddup2() is in fact proposed in Austin Group issue #411. MFC after: 1 week Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Modified: head/lib/libc/gen/posix_spawn_file_actions_addopen.3 ============================================================================== --- head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 20:13:43 2013 (r250420) +++ head/lib/libc/gen/posix_spawn_file_actions_addopen.3 Thu May 9 21:29:13 2013 (r250421) @@ -123,7 +123,19 @@ to be duplicated as dup2(fildes, newfildes) .Ed .Pp -had been called) when a new process is spawned using this file actions object. +had been called) when a new process is spawned using this file actions object, +except that the +.Dv FD_CLOEXEC +flag for +.Fa newfildes +is cleared even if +.Fa fildes +is equal to +.Fa newfildes . +The difference from +.Fn dup2 +is useful for passing a particular file descriptor +to a particular child process. .Pp The .Fn posix_spawn_file_actions_addclose @@ -169,7 +181,16 @@ The and .Fn posix_spawn_file_actions_addclose functions conform to -.St -p1003.1-2001 . +.St -p1003.1-2001 , +with the exception of the behavior of +.Fn posix_spawn_file_actions_adddup2 +if +.Fa fildes +is equal to +.Fa newfildes +(clearing +.Dv FD_CLOEXEC ) . +A future update of the Standard is expected to require this behavior, .Sh HISTORY The .Fn posix_spawn_file_actions_addopen , From owner-svn-src-all@FreeBSD.ORG Thu May 9 21:29:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EFEF26D6; Thu, 9 May 2013 21:29:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E18272B6; Thu, 9 May 2013 21:29:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49LTG4S047952; Thu, 9 May 2013 21:29:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49LTGB8047951; Thu, 9 May 2013 21:29:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305092129.r49LTGB8047951@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 May 2013 21:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250422 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 21:29:17 -0000 Author: eadler Date: Thu May 9 21:29:16 2013 New Revision: 250422 URL: http://svnweb.freebsd.org/changeset/base/250422 Log: Fix two typos Reviewed by: jilles Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu May 9 21:29:13 2013 (r250421) +++ head/bin/sh/var.c Thu May 9 21:29:16 2013 (r250422) @@ -877,7 +877,7 @@ unsetvar(const char *s) /* - * Returns true if the two strings specify the same varable. The first + * Returns true if the two strings specify the same variable. The first * variable name is terminated by '='; the second may be terminated by * either '=' or '\0'. */ @@ -898,7 +898,7 @@ varequal(const char *p, const char *q) * Search for a variable. * 'name' may be terminated by '=' or a NUL. * vppp is set to the pointer to vp, or the list head if vp isn't found - * lenp is set to the number of charactets in 'name' + * lenp is set to the number of characters in 'name' */ static struct var * From owner-svn-src-all@FreeBSD.ORG Thu May 9 21:42:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D9932C73; Thu, 9 May 2013 21:42:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB170358; Thu, 9 May 2013 21:42:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r49LgiqN053708; Thu, 9 May 2013 21:42:44 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r49Lghs0053702; Thu, 9 May 2013 21:42:43 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201305092142.r49Lghs0053702@svn.freebsd.org> From: Dmitry Chagin Date: Thu, 9 May 2013 21:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250423 - in head/sys/amd64: amd64 ia32 include linux32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 21:42:44 -0000 Author: dchagin Date: Thu May 9 21:42:43 2013 New Revision: 250423 URL: http://svnweb.freebsd.org/changeset/base/250423 Log: Retire write-only PCB_GS32BIT pcb flag on amd64. Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/include/pcb.h head/sys/amd64/linux32/linux32_machdep.c head/sys/amd64/linux32/linux32_sysvec.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/amd64/genassym.c Thu May 9 21:42:43 2013 (r250423) @@ -167,7 +167,6 @@ ASSYM(PCB_FPUSUSPEND, offsetof(struct pc ASSYM(PCB_SIZE, sizeof(struct pcb)); ASSYM(PCB_FULL_IRET, PCB_FULL_IRET); ASSYM(PCB_DBREGS, PCB_DBREGS); -ASSYM(PCB_GS32BIT, PCB_GS32BIT); ASSYM(PCB_32BIT, PCB_32BIT); ASSYM(COMMON_TSS_RSP0, offsetof(struct amd64tss, tss_rsp0)); Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/amd64/machdep.c Thu May 9 21:42:43 2013 (r250423) @@ -964,7 +964,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; - clear_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT); + clear_pcb_flags(pcb, PCB_32BIT); pcb->pcb_initial_fpucw = __INITIAL_FPUCW__; set_pcb_flags(pcb, PCB_FULL_IRET); Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/ia32/ia32_signal.c Thu May 9 21:42:43 2013 (r250423) @@ -1001,6 +1001,5 @@ ia32_setregs(struct thread *td, struct i /* Return via doreti so that we can change to a different %cs */ set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET); - clear_pcb_flags(pcb, PCB_GS32BIT); td->td_retval[1] = 0; } Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/include/pcb.h Thu May 9 21:42:43 2013 (r250423) @@ -77,7 +77,6 @@ struct pcb { #define PCB_KERNFPU 0x04 /* kernel uses fpu */ #define PCB_FPUINITDONE 0x08 /* fpu state is initialized */ #define PCB_USERFPUINITDONE 0x10 /* fpu user state is initialized */ -#define PCB_GS32BIT 0x20 /* linux gs switch */ #define PCB_32BIT 0x40 /* process has 32 bit context (segs etc) */ uint16_t pcb_initial_fpucw; Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/linux32/linux32_machdep.c Thu May 9 21:42:43 2013 (r250423) @@ -447,7 +447,7 @@ linux_set_cloned_tls(struct thread *td, pcb->pcb_gsbase = (register_t)info.base_addr; /* XXXKIB pcb->pcb_gs32sd = sd; */ td->td_frame->tf_gs = GSEL(GUGS32_SEL, SEL_UPL); - set_pcb_flags(pcb, PCB_GS32BIT | PCB_32BIT); + set_pcb_flags(pcb, PCB_32BIT); } return (error); @@ -1026,7 +1026,7 @@ linux_set_thread_area(struct thread *td, pcb = td->td_pcb; pcb->pcb_gsbase = (register_t)info.base_addr; - set_pcb_flags(pcb, PCB_32BIT | PCB_GS32BIT); + set_pcb_flags(pcb, PCB_32BIT); update_gdt_gsbase(td, info.base_addr); return (0); Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu May 9 21:29:16 2013 (r250422) +++ head/sys/amd64/linux32/linux32_sysvec.c Thu May 9 21:42:43 2013 (r250423) @@ -868,7 +868,6 @@ exec_linux_setregs(struct thread *td, st /* Do full restore on return so that we can change to a different %cs */ set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET); - clear_pcb_flags(pcb, PCB_GS32BIT); td->td_retval[1] = 0; } From owner-svn-src-all@FreeBSD.ORG Thu May 9 22:14:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 829FE58C; Thu, 9 May 2013 22:14:00 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x22f.google.com (mail-ie0-x22f.google.com [IPv6:2607:f8b0:4001:c03::22f]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7006C5; Thu, 9 May 2013 22:14:00 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id s9so6604287iec.20 for ; Thu, 09 May 2013 15:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=u/56ihiFd14c/mK0xsmylOhR6Amf2K2F+zHpzpY41Xo=; b=Z4CCqjhkMsfOXyDoKlc/OBvvSH16iXhgOLHkACOKAkIru+RauoyiPn5d6YU7+flAhd 8BGEYwMPAI+pUkQkYTf67Q9XZ+eQvKN/VzJUzs7EdZLldXqwEX11P3W3oF8zVj0Oc1kG wA5y2WomoUTslzfDd1N5dsDsQDQkWI8DxWozLpZa4vKxOcOZ8TwPb8gp3/z+nvBe+0KV Oj0ptN5J+jEI5ePIQEizX4+GAbCmxRtHiWmvxP4qWO08CTDXF7NcZPUl4snzH+UjB7aH XxKzY0MD5dlgZrdm3ptmAjwPxqlwB232mLMjLAaGFp7JfYn+aHHjjRCjNLCjaiTDqSHS Irmg== MIME-Version: 1.0 X-Received: by 10.50.1.102 with SMTP id 6mr9392038igl.64.1368137639822; Thu, 09 May 2013 15:13:59 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Thu, 9 May 2013 15:13:59 -0700 (PDT) In-Reply-To: References: <201305091628.r49GSI33039873@svn.freebsd.org> Date: Fri, 10 May 2013 00:13:59 +0200 X-Google-Sender-Auth: NwvuRr9GpLBwIUrVzYLhki39W2A Message-ID: Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 22:14:00 -0000 On Thu, May 9, 2013 at 10:56 PM, Marcel Moolenaar wrote: > > On May 9, 2013, at 9:46 AM, Attilio Rao wrote: > >> On Thu, May 9, 2013 at 6:28 PM, Marcel Moolenaar wrote: >>> Author: marcel >>> Date: Thu May 9 16:28:18 2013 >>> New Revision: 250411 >>> URL: http://svnweb.freebsd.org/changeset/base/250411 >>> >>> Log: >>> Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE >>> locks. To support this, VNODE locks are created with the LK_IS_VNODE >>> flag. This flag is propagated down using the LO_IS_VNODE flag. >>> >>> Note that WITNESS still records the LOR. Only the printing and the >>> optional entering into the kernel debugger is bypassed with the >>> WITNESS_NO_VNODE option. >> >> This is the wrong way to deal with such problem and I avoided to do >> something like that on purpose. > > I disagree. We have known LOR messages between VNODE locks that > pollute the console and so far we haven't fixed the root cause > in some form or shape. Silencing this known case is good to > maximize the attention LORs need to be given while still have > witness involved to catch locking problems with vnodes that are > of a different nature. > >> >> The way to fix this is to implement LK_NOWITNESS on a per-lock basis >> into lockmgr, propagate the same concept to the vn_lock() (which >> should be basically done automatically) and finally identify the >> false-positive case and commit for them explicitely LK_NOWITNESS on a >> per-call basis, explaining in detail why the single case reported is a >> false-positive. > > This is worse. You want witness involved. > >> Please revert this patch asap. > > This change does not inhibit people from fixing the problem at the > root cause, and in the mean time maximize witness' effectiveness. > Calling for a backout is unwarranted and unnecessarily aggressive. I completely disagree with the whole content of your e-mail. Thanks for disrupting a useful tool along with other commits which happened in the past by other people about invariants effectiveness. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-all@FreeBSD.ORG Thu May 9 22:28:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6B4EC84; Thu, 9 May 2013 22:28:33 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B222F7F3; Thu, 9 May 2013 22:28:33 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id E24941A3C6B; Thu, 9 May 2013 15:28:29 -0700 (PDT) Message-ID: <518C22FD.3020902@mu.org> Date: Thu, 09 May 2013 15:28:13 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r250411 - in head/sys: conf kern sys References: <201305091628.r49GSI33039873@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Marcel Moolenaar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 22:28:33 -0000 On 5/9/13 3:13 PM, Attilio Rao wrote: > On Thu, May 9, 2013 at 10:56 PM, Marcel Moolenaar wrote: >> On May 9, 2013, at 9:46 AM, Attilio Rao wrote: >> >>> On Thu, May 9, 2013 at 6:28 PM, Marcel Moolenaar wrote: >>>> Author: marcel >>>> Date: Thu May 9 16:28:18 2013 >>>> New Revision: 250411 >>>> URL: http://svnweb.freebsd.org/changeset/base/250411 >>>> >>>> Log: >>>> Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE >>>> locks. To support this, VNODE locks are created with the LK_IS_VNODE >>>> flag. This flag is propagated down using the LO_IS_VNODE flag. >>>> >>>> Note that WITNESS still records the LOR. Only the printing and the >>>> optional entering into the kernel debugger is bypassed with the >>>> WITNESS_NO_VNODE option. >>> This is the wrong way to deal with such problem and I avoided to do >>> something like that on purpose. >> I disagree. We have known LOR messages between VNODE locks that >> pollute the console and so far we haven't fixed the root cause >> in some form or shape. Silencing this known case is good to >> maximize the attention LORs need to be given while still have >> witness involved to catch locking problems with vnodes that are >> of a different nature. >> >>> The way to fix this is to implement LK_NOWITNESS on a per-lock basis >>> into lockmgr, propagate the same concept to the vn_lock() (which >>> should be basically done automatically) and finally identify the >>> false-positive case and commit for them explicitely LK_NOWITNESS on a >>> per-call basis, explaining in detail why the single case reported is a >>> false-positive. >> This is worse. You want witness involved. >> >>> Please revert this patch asap. >> This change does not inhibit people from fixing the problem at the >> root cause, and in the mean time maximize witness' effectiveness. >> Calling for a backout is unwarranted and unnecessarily aggressive. > I completely disagree with the whole content of your e-mail. > Thanks for disrupting a useful tool along with other commits which > happened in the past by other people about invariants effectiveness. This should be taken offline. Marcel has some needs which without such a change are hard to manage I encourage you to assist him and meeting half-way on this as it will greatly help the project. Please discuss this offline a bit so you can see where each are coming from. If you would like to cc me about this I can help mediate and explain this pragmatic approach to assertions. Will you both be at BSDCan? That would be even better. -Alfred From owner-svn-src-all@FreeBSD.ORG Fri May 10 02:57:47 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F378F985; Fri, 10 May 2013 02:57:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E66EC290; Fri, 10 May 2013 02:57:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A2vkfV062812; Fri, 10 May 2013 02:57:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A2vkfd062811; Fri, 10 May 2013 02:57:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100257.r4A2vkfd062811@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 02:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250426 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 02:57:47 -0000 Author: imp Date: Fri May 10 02:57:46 2013 New Revision: 250426 URL: http://svnweb.freebsd.org/changeset/base/250426 Log: Both my EBH5200 and GE WANIC 6354 have a RTC as well. It looks from the Linux tree that they always include this chip in their FDT, so make support for the ds1337 opt-out rather than opt-in. Now my boards boot with the correct time. Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-rtc.h Thu May 9 22:29:33 2013 (r250425) +++ head/sys/contrib/octeon-sdk/cvmx-rtc.h Fri May 10 02:57:46 2013 (r250426) @@ -87,13 +87,8 @@ static inline cvmx_rtc_options_t cvmx_rt supported = CVMX_RTC_READ | CVMX_RTC_WRITE | CVMX_RTC_TIME_EPOCH; break; - case CVMX_BOARD_TYPE_EBH3000: - case CVMX_BOARD_TYPE_CN3010_EVB_HS5: - supported = CVMX_RTC_READ | CVMX_RTC_WRITE | CVMX_RTC_TIME_CAL; - break; - default: - supported = 0; + supported = CVMX_RTC_READ | CVMX_RTC_WRITE | CVMX_RTC_TIME_CAL; break; } @@ -122,14 +117,9 @@ static inline uint32_t cvmx_rtc_read(voi return cvmx_rtc_ds1374_read(); break; - case CVMX_BOARD_TYPE_EBH3000: - case CVMX_BOARD_TYPE_CN3010_EVB_HS5: + default: return cvmx_rtc_ds1337_read(); break; - - default: - return 0; - break; } } @@ -148,14 +138,9 @@ static inline uint32_t cvmx_rtc_write(ui return cvmx_rtc_ds1374_write(time); break; - case CVMX_BOARD_TYPE_EBH3000: - case CVMX_BOARD_TYPE_CN3010_EVB_HS5: + default: return cvmx_rtc_ds1337_write(time); break; - - default: - return 0; - break; } } From owner-svn-src-all@FreeBSD.ORG Fri May 10 02:59:50 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EE14EB08; Fri, 10 May 2013 02:59:50 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDDEE29E; Fri, 10 May 2013 02:59:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A2xoqH063197; Fri, 10 May 2013 02:59:50 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A2xonP063188; Fri, 10 May 2013 02:59:50 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201305100259.r4A2xonP063188@svn.freebsd.org> From: Neel Natu Date: Fri, 10 May 2013 02:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250427 - in head/sys/amd64/vmm: . io X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 02:59:51 -0000 Author: neel Date: Fri May 10 02:59:49 2013 New Revision: 250427 URL: http://svnweb.freebsd.org/changeset/base/250427 Log: Support array-type of stats in bhyve. An array-type stat in vmm.ko is defined as follows: VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); It is incremented as follows: vmm_stat_array_incr(vm, vcpuid, IPIS_SENT, array_index, 1); And output of 'bhyvectl --get-stats' looks like: ipis sent to vcpu[0] 3114 ipis sent to vcpu[1] 0 Reviewed by: grehan Obtained from: NetApp Modified: head/sys/amd64/vmm/io/vlapic.c head/sys/amd64/vmm/vmm_dev.c head/sys/amd64/vmm/vmm_stat.c head/sys/amd64/vmm/vmm_stat.h Modified: head/sys/amd64/vmm/io/vlapic.c ============================================================================== --- head/sys/amd64/vmm/io/vlapic.c Fri May 10 02:57:46 2013 (r250426) +++ head/sys/amd64/vmm/io/vlapic.c Fri May 10 02:59:49 2013 (r250427) @@ -430,6 +430,8 @@ vlapic_fire_timer(struct vlapic *vlapic) } } +static VMM_STAT_ARRAY(IPIS_SENT, VM_MAXCPU, "ipis sent to vcpu"); + static int lapic_process_icr(struct vlapic *vlapic, uint64_t icrval) { @@ -466,9 +468,11 @@ lapic_process_icr(struct vlapic *vlapic, while ((i = cpusetobj_ffs(&dmask)) != 0) { i--; CPU_CLR(i, &dmask); - if (mode == APIC_DELMODE_FIXED) + if (mode == APIC_DELMODE_FIXED) { lapic_set_intr(vlapic->vm, i, vec); - else + vmm_stat_array_incr(vlapic->vm, vlapic->vcpuid, + IPIS_SENT, i, 1); + } else vm_inject_nmi(vlapic->vm, i); } Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri May 10 02:57:46 2013 (r250426) +++ head/sys/amd64/vmm/vmm_dev.c Fri May 10 02:59:49 2013 (r250427) @@ -235,18 +235,13 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = vm_run(sc->vm, vmrun); break; case VM_STAT_DESC: { - const char *desc; statdesc = (struct vm_stat_desc *)data; - desc = vmm_stat_desc(statdesc->index); - if (desc != NULL) { - error = 0; - strlcpy(statdesc->desc, desc, sizeof(statdesc->desc)); - } else - error = EINVAL; + error = vmm_stat_desc_copy(statdesc->index, + statdesc->desc, sizeof(statdesc->desc)); break; } case VM_STATS: { - CTASSERT(MAX_VM_STATS >= MAX_VMM_STAT_TYPES); + CTASSERT(MAX_VM_STATS >= MAX_VMM_STAT_ELEMS); vmstats = (struct vm_stats *)data; getmicrotime(&vmstats->tv); error = vmm_stat_copy(sc->vm, vmstats->cpuid, Modified: head/sys/amd64/vmm/vmm_stat.c ============================================================================== --- head/sys/amd64/vmm/vmm_stat.c Fri May 10 02:57:46 2013 (r250426) +++ head/sys/amd64/vmm/vmm_stat.c Fri May 10 02:59:49 2013 (r250427) @@ -39,8 +39,16 @@ __FBSDID("$FreeBSD$"); #include "vmm_util.h" #include "vmm_stat.h" -static int vstnum; -static struct vmm_stat_type *vsttab[MAX_VMM_STAT_TYPES]; +/* + * 'vst_num_elems' is the total number of addressable statistic elements + * 'vst_num_types' is the number of unique statistic types + * + * It is always true that 'vst_num_elems' is greater than or equal to + * 'vst_num_types'. This is because a stat type may represent more than + * one element (for e.g. VMM_STAT_ARRAY). + */ +static int vst_num_elems, vst_num_types; +static struct vmm_stat_type *vsttab[MAX_VMM_STAT_ELEMS]; static MALLOC_DEFINE(M_VMM_STAT, "vmm stat", "vmm stat"); @@ -59,13 +67,15 @@ vmm_stat_init(void *arg) if (vst->scope == VMM_STAT_SCOPE_AMD && !vmm_is_amd()) return; - if (vstnum >= MAX_VMM_STAT_TYPES) { + if (vst_num_elems + vst->nelems >= MAX_VMM_STAT_ELEMS) { printf("Cannot accomodate vmm stat type \"%s\"!\n", vst->desc); return; } - vst->index = vstnum; - vsttab[vstnum++] = vst; + vst->index = vst_num_elems; + vst_num_elems += vst->nelems; + + vsttab[vst_num_types++] = vst; } int @@ -78,9 +88,9 @@ vmm_stat_copy(struct vm *vm, int vcpu, i return (EINVAL); stats = vcpu_stats(vm, vcpu); - for (i = 0; i < vstnum; i++) + for (i = 0; i < vst_num_elems; i++) buf[i] = stats[i]; - *num_stats = vstnum; + *num_stats = vst_num_elems; return (0); } @@ -89,7 +99,7 @@ vmm_stat_alloc(void) { u_long size; - size = vstnum * sizeof(uint64_t); + size = vst_num_elems * sizeof(uint64_t); return (malloc(size, M_VMM_STAT, M_ZERO | M_WAITOK)); } @@ -100,14 +110,26 @@ vmm_stat_free(void *vp) free(vp, M_VMM_STAT); } -const char * -vmm_stat_desc(int index) +int +vmm_stat_desc_copy(int index, char *buf, int bufsize) { + int i; + struct vmm_stat_type *vst; + + for (i = 0; i < vst_num_types; i++) { + vst = vsttab[i]; + if (index >= vst->index && index < vst->index + vst->nelems) { + if (vst->nelems > 1) { + snprintf(buf, bufsize, "%s[%d]", + vst->desc, index - vst->index); + } else { + strlcpy(buf, vst->desc, bufsize); + } + return (0); /* found it */ + } + } - if (index >= 0 && index < vstnum) - return (vsttab[index]->desc); - else - return (NULL); + return (EINVAL); } /* global statistics */ Modified: head/sys/amd64/vmm/vmm_stat.h ============================================================================== --- head/sys/amd64/vmm/vmm_stat.h Fri May 10 02:57:46 2013 (r250426) +++ head/sys/amd64/vmm/vmm_stat.h Fri May 10 02:59:49 2013 (r250427) @@ -34,7 +34,7 @@ struct vm; -#define MAX_VMM_STAT_TYPES 64 /* arbitrary */ +#define MAX_VMM_STAT_ELEMS 64 /* arbitrary */ enum vmm_stat_scope { VMM_STAT_SCOPE_ANY, @@ -44,15 +44,16 @@ enum vmm_stat_scope { struct vmm_stat_type { int index; /* position in the stats buffer */ + int nelems; /* standalone or array */ const char *desc; /* description of statistic */ enum vmm_stat_scope scope; }; void vmm_stat_init(void *arg); -#define VMM_STAT_DEFINE(type, desc, scope) \ +#define VMM_STAT_DEFINE(type, nelems, desc, scope) \ struct vmm_stat_type type[1] = { \ - { -1, desc, scope } \ + { -1, nelems, desc, scope } \ }; \ SYSINIT(type##_stat, SI_SUB_KLD, SI_ORDER_ANY, vmm_stat_init, type) @@ -60,11 +61,14 @@ void vmm_stat_init(void *arg); extern struct vmm_stat_type type[1] #define VMM_STAT(type, desc) \ - VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_ANY) + VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_ANY) #define VMM_STAT_INTEL(type, desc) \ - VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_INTEL) + VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_INTEL) #define VMM_STAT_AMD(type, desc) \ - VMM_STAT_DEFINE(type, desc, VMM_STAT_SCOPE_AMD) + VMM_STAT_DEFINE(type, 1, desc, VMM_STAT_SCOPE_AMD) + +#define VMM_STAT_ARRAY(type, nelems, desc) \ + VMM_STAT_DEFINE(type, nelems, desc, VMM_STAT_SCOPE_ANY) void *vmm_stat_alloc(void); void vmm_stat_free(void *vp); @@ -73,15 +77,29 @@ void vmm_stat_free(void *vp); * 'buf' should be at least fit 'MAX_VMM_STAT_TYPES' entries */ int vmm_stat_copy(struct vm *vm, int vcpu, int *num_stats, uint64_t *buf); -const char *vmm_stat_desc(int index); +int vmm_stat_desc_copy(int index, char *buf, int buflen); + +static void __inline +vmm_stat_array_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, + int statidx, uint64_t x) +{ +#ifdef VMM_KEEP_STATS + uint64_t *stats; + + stats = vcpu_stats(vm, vcpu); + + if (vst->index >= 0 && statidx < vst->nelems) + stats[vst->index + statidx] += x; +#endif +} + static void __inline vmm_stat_incr(struct vm *vm, int vcpu, struct vmm_stat_type *vst, uint64_t x) { -#ifdef VMM_KEEP_STATS - uint64_t *stats = vcpu_stats(vm, vcpu); - if (vst->index >= 0) - stats[vst->index] += x; + +#ifdef VMM_KEEP_STATS + vmm_stat_array_incr(vm, vcpu, vst, 0, x); #endif } From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:04:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7FC04DA3; Fri, 10 May 2013 03:04:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 718F3398; Fri, 10 May 2013 03:04:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A34kW8067219; Fri, 10 May 2013 03:04:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A34jUg067210; Fri, 10 May 2013 03:04:45 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100304.r4A34jUg067210@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 03:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250428 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:04:46 -0000 Author: imp Date: Fri May 10 03:04:45 2013 New Revision: 250428 URL: http://svnweb.freebsd.org/changeset/base/250428 Log: Add support from GE Intelligent Platform Cavium Octeon boards. Add options OCTEON_VENDOR_GEFES to enable support for these boards, to match changes that GE publishes to the Octeon Simple Executive. Since board types overlap with other boards, it is unlikely that we will properly boot on other Octeon boards with OCTEON_VENDOR_GEFES enabled. Tested extensively on the WANIC 6354, but I retained support for all the other models. Some features need changes in the base kernel, and those are in progress. Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h head/sys/contrib/octeon-sdk/cvmx-helper-board.c head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c head/sys/contrib/octeon-sdk/cvmx-pcie.c Modified: head/sys/contrib/octeon-sdk/cvmx-app-init.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-app-init.h Fri May 10 02:59:49 2013 (r250427) +++ head/sys/contrib/octeon-sdk/cvmx-app-init.h Fri May 10 03:04:45 2013 (r250428) @@ -120,6 +120,9 @@ struct cvmx_bootinfo { uint32_t dfa_ref_clock_hz; /**< DFA reference clock in hz (if applicable)*/ uint32_t config_flags; /**< flags indicating various configuration options. These flags supercede ** the 'flags' variable and should be used instead if available */ +#if defined(OCTEON_VENDOR_GEFES) + uint32_t dfm_size; /**< DFA Size */ +#endif #endif #if (CVMX_BOOTINFO_MIN_VER >= 3) uint64_t fdt_addr; /**< Address of the OF Flattened Device Tree structure describing the board. */ @@ -216,10 +219,17 @@ enum cvmx_board_types_enum { CVMX_BOARD_TYPE_HIKARI = 10, CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11, CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12, +#if defined(OCTEON_VENDOR_GEFES) + CVMX_BOARD_TYPE_TNPA3804 = 13, + CVMX_BOARD_TYPE_AT5810 = 14, + CVMX_BOARD_TYPE_WNPA3850 = 15, + CVMX_BOARD_TYPE_W3860 = 16, +#else CVMX_BOARD_TYPE_KBP = 13, CVMX_BOARD_TYPE_CN3020_EVB_HS5 = 14, /* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */ CVMX_BOARD_TYPE_EBT5800 = 15, CVMX_BOARD_TYPE_NICPRO2 = 16, +#endif CVMX_BOARD_TYPE_EBH5600 = 17, CVMX_BOARD_TYPE_EBH5601 = 18, CVMX_BOARD_TYPE_EBH5200 = 19, @@ -305,6 +315,16 @@ enum cvmx_board_types_enum { #if defined(OCTEON_VENDOR_RADISYS) CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE=20002, #endif +#if defined(OCTEON_VENDOR_GEFES) + CVMX_BOARD_TYPE_CUST_TNPA5804 = 20005, + CVMX_BOARD_TYPE_CUST_W5434 = 20006, + CVMX_BOARD_TYPE_CUST_W5650 = 20007, + CVMX_BOARD_TYPE_CUST_W5800 = 20008, + CVMX_BOARD_TYPE_CUST_W5651X = 20009, + CVMX_BOARD_TYPE_CUST_TNPA5651X = 20010, + CVMX_BOARD_TYPE_CUST_TNPA56X4 = 20011, + CVMX_BOARD_TYPE_CUST_W63XX = 20013, +#endif CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, @@ -352,10 +372,17 @@ static inline const char *cvmx_board_typ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_HIKARI) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3010_EVB_HS5) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3005_EVB_HS5) +#if defined(OCTEON_VENDOR_GEFES) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_TNPA3804) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_AT5810) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_WNPA3850) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_W3860) +#else ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KBP) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3020_EVB_HS5) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5800) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NICPRO2) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5600) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5601) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5200) @@ -420,7 +447,6 @@ static inline const char *cvmx_board_typ #else ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_L2_ZINWELL) #endif - ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX) /* Customer private range */ @@ -435,6 +461,16 @@ static inline const char *cvmx_board_typ #if defined(OCTEON_VENDOR_RADISYS) ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_RADISYS_RSYS4GBE) #endif +#if defined(OCTEON_VENDOR_GEFES) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_TNPA5804) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_W5434) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_W5650) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_W5800) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_W5651X) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_TNPA5651X) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_TNPA56X4) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_W63XX) +#endif ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) /* Module range */ Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri May 10 02:59:49 2013 (r250427) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Fri May 10 03:04:45 2013 (r250428) @@ -385,10 +385,12 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_SIM: /* Simulator doesn't have MII */ return -1; - case CVMX_BOARD_TYPE_EBT3000: +#if !defined(OCTEON_VENDOR_GEFES) case CVMX_BOARD_TYPE_EBT5800: - case CVMX_BOARD_TYPE_THUNDER: case CVMX_BOARD_TYPE_NICPRO2: +#endif + case CVMX_BOARD_TYPE_EBT3000: + case CVMX_BOARD_TYPE_THUNDER: /* Interface 0 is SPI4, interface 1 is RGMII */ if ((ipd_port >= 16) && (ipd_port < 20)) return ipd_port - 16; @@ -410,7 +412,9 @@ int cvmx_helper_board_get_mii_address(in case CVMX_BOARD_TYPE_HIKARI: case CVMX_BOARD_TYPE_CN3010_EVB_HS5: case CVMX_BOARD_TYPE_CN3005_EVB_HS5: +#if !defined(OCTEON_VENDOR_GEFES) case CVMX_BOARD_TYPE_CN3020_EVB_HS5: +#endif /* Port 0 is WAN connected to a PHY, Port 1 is GMII connected to a switch */ if (ipd_port == 0) @@ -603,6 +607,30 @@ int cvmx_helper_board_get_mii_address(in /* No MII. */ return -1; #endif +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_AT5810: + return -1; + case CVMX_BOARD_TYPE_TNPA3804: + case CVMX_BOARD_TYPE_CUST_TNPA5804: + case CVMX_BOARD_TYPE_CUST_W5800: + case CVMX_BOARD_TYPE_WNPA3850: + case CVMX_BOARD_TYPE_W3860: + return -1;// RGMII boards should use inbad status + case CVMX_BOARD_TYPE_CUST_W5651X: + case CVMX_BOARD_TYPE_CUST_W5650: + case CVMX_BOARD_TYPE_CUST_TNPA56X4: + case CVMX_BOARD_TYPE_CUST_TNPA5651X: + case CVMX_BOARD_TYPE_CUST_W63XX: + return -1; /* No PHYs are connected to Octeon, PHYs inside of SFPs which is accessed over TWSI */ + case CVMX_BOARD_TYPE_CUST_W5434: + /* Board has 4 SGMII ports. 4 connect out + * must return the MII address of the PHY connected to each IPD port + */ + if ((ipd_port >= 16) && (ipd_port < 20)) + return ipd_port - 16 + 0x40; + else + return -1; +#endif } /* Some unknown board. Somebody forgot to update this function... */ @@ -991,7 +1019,9 @@ cvmx_helper_link_info_t __cvmx_helper_bo case CVMX_BOARD_TYPE_EBH3100: case CVMX_BOARD_TYPE_CN3010_EVB_HS5: case CVMX_BOARD_TYPE_CN3005_EVB_HS5: +#if !defined(OCTEON_VENDOR_GEFES) case CVMX_BOARD_TYPE_CN3020_EVB_HS5: +#endif /* Port 1 on these boards is always Gigabit */ if (ipd_port == 1) { @@ -1077,6 +1107,15 @@ cvmx_helper_link_info_t __cvmx_helper_bo } break; #endif +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_CUST_TNPA5651X: + /* Since we don't auto-negotiate... 1Gbps full duplex link */ + result.s.link_up = 1; + result.s.full_duplex = 1; + result.s.speed = 1000; + return result; + break; +#endif } #endif @@ -1103,6 +1142,44 @@ cvmx_helper_link_info_t __cvmx_helper_bo here. Reading broken in-band status tends to do bad things */ result = __get_inband_link_state(ipd_port); } +#if defined(OCTEON_VENDOR_GEFES) + else if( (OCTEON_IS_MODEL(OCTEON_CN56XX)) || (OCTEON_IS_MODEL(OCTEON_CN63XX)) ) + { + int interface = cvmx_helper_get_interface_num(ipd_port); + int index = cvmx_helper_get_interface_index_num(ipd_port); + cvmx_pcsx_miscx_ctl_reg_t mode_type; + cvmx_pcsx_mrx_status_reg_t mrx_status; + cvmx_pcsx_anx_adv_reg_t anxx_adv; + cvmx_pcsx_sgmx_lp_adv_reg_t sgmii_inband_status; + + anxx_adv.u64 = cvmx_read_csr(CVMX_PCSX_ANX_ADV_REG(index, interface)); + mrx_status.u64 = cvmx_read_csr(CVMX_PCSX_MRX_STATUS_REG(index, interface)); + + mode_type.u64 = cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); + + /* Read Octeon's inband status */ + sgmii_inband_status.u64 = cvmx_read_csr(CVMX_PCSX_SGMX_LP_ADV_REG(index, interface)); + + result.s.link_up = sgmii_inband_status.s.link; + result.s.full_duplex = sgmii_inband_status.s.dup; + switch (sgmii_inband_status.s.speed) + { + case 0: /* 10 Mbps */ + result.s.speed = 10; + break; + case 1: /* 100 Mbps */ + result.s.speed = 100; + break; + case 2: /* 1 Gbps */ + result.s.speed = 1000; + break; + case 3: /* Illegal */ + result.s.speed = 0; + result.s.link_up = 0; + break; + } + } +#endif else { /* We don't have a PHY address and we don't have in-band status. There @@ -1319,6 +1396,33 @@ int __cvmx_helper_board_interface_probe( return 12; break; #endif +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_CUST_TNPA5651X: + if (interface < 2) /* interface can be EITHER 0 or 1 */ + return 1;//always return 1 for XAUI and SGMII mode. + break; + case CVMX_BOARD_TYPE_CUST_TNPA56X4: + if ((interface == 0) && + (cvmx_helper_interface_get_mode(interface) == CVMX_HELPER_INTERFACE_MODE_SGMII)) + { + cvmx_pcsx_miscx_ctl_reg_t pcsx_miscx_ctl_reg; + + /* For this port we need to set the mode to 1000BaseX */ + pcsx_miscx_ctl_reg.u64 = + cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(0, interface)); + pcsx_miscx_ctl_reg.cn56xx.mode = 1; + cvmx_write_csr(CVMX_PCSX_MISCX_CTL_REG(0, interface), + pcsx_miscx_ctl_reg.u64); + pcsx_miscx_ctl_reg.u64 = + cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(1, interface)); + pcsx_miscx_ctl_reg.cn56xx.mode = 1; + cvmx_write_csr(CVMX_PCSX_MISCX_CTL_REG(1, interface), + pcsx_miscx_ctl_reg.u64); + + return 2; + } + break; +#endif } #ifdef CVMX_BUILD_FOR_UBOOT if (CVMX_HELPER_INTERFACE_MODE_SPI == cvmx_helper_interface_get_mode(interface) && getenv("disable_spi")) @@ -1481,15 +1585,29 @@ cvmx_helper_board_usb_clock_types_t __cv case CVMX_BOARD_TYPE_LANAI2_U: case CVMX_BOARD_TYPE_LANAI2_G: #if defined(OCTEON_VENDOR_LANNER) - case CVMX_BOARD_TYPE_CUST_LANNER_MR320: - case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: + case CVMX_BOARD_TYPE_CUST_LANNER_MR320: + case CVMX_BOARD_TYPE_CUST_LANNER_MR321X: #endif #if defined(OCTEON_VENDOR_UBIQUITI) - case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: + case CVMX_BOARD_TYPE_CUST_UBIQUITI_E100: #endif #if defined(OCTEON_BOARD_CAPK_0100ND) case CVMX_BOARD_TYPE_CN3010_EVB_HS5: #endif +#if defined(OCTEON_VENDOR_GEFES) /* All GEFES' boards use same xtal type */ + case CVMX_BOARD_TYPE_TNPA3804: + case CVMX_BOARD_TYPE_AT5810: + case CVMX_BOARD_TYPE_WNPA3850: + case CVMX_BOARD_TYPE_W3860: + case CVMX_BOARD_TYPE_CUST_TNPA5804: + case CVMX_BOARD_TYPE_CUST_W5434: + case CVMX_BOARD_TYPE_CUST_W5650: + case CVMX_BOARD_TYPE_CUST_W5800: + case CVMX_BOARD_TYPE_CUST_W5651X: + case CVMX_BOARD_TYPE_CUST_TNPA5651X: + case CVMX_BOARD_TYPE_CUST_TNPA56X4: + case CVMX_BOARD_TYPE_CUST_W63XX: +#endif case CVMX_BOARD_TYPE_NIC10E_66: return USB_CLOCK_TYPE_CRYSTAL_12; case CVMX_BOARD_TYPE_NIC10E: Modified: head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c Fri May 10 02:59:49 2013 (r250427) +++ head/sys/contrib/octeon-sdk/cvmx-helper-sgmii.c Fri May 10 03:04:45 2013 (r250428) @@ -116,7 +116,13 @@ static int __cvmx_helper_sgmii_hardware_ interval. */ pcsx_miscx_ctl_reg.u64 = cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); pcsx_linkx_timer_count_reg.u64 = cvmx_read_csr(CVMX_PCSX_LINKX_TIMER_COUNT_REG(index, interface)); - if (pcsx_miscx_ctl_reg.s.mode) + if (pcsx_miscx_ctl_reg.s.mode +#if defined(OCTEON_VENDOR_GEFES) + /* GEF Fiber SFP testing on W5650 showed this to cause link issues for 1000BASE-X*/ + && (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CUST_W5650) + && (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_CUST_W63XX) +#endif + ) { /* 1000BASE-X */ pcsx_linkx_timer_count_reg.s.count = (10000ull * clock_mhz) >> 10; @@ -200,7 +206,15 @@ static int __cvmx_helper_need_g15618(voi static int __cvmx_helper_sgmii_hardware_init_link(int interface, int index) { cvmx_pcsx_mrx_control_reg_t control_reg; + uint64_t link_timeout; + +#if defined(OCTEON_VENDOR_GEFES) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_TNPA5651X) { + return 0; /* no auto-negotiation */ + } +#endif + /* Take PCS through a reset sequence. PCS*_MR*_CONTROL_REG[PWR_DN] should be cleared to zero. Write PCS*_MR*_CONTROL_REG[RESET]=1 (while not changing the value of @@ -211,9 +225,16 @@ static int __cvmx_helper_sgmii_hardware_ /* Errata G-15618 requires disabling PCS soft reset in CN63XX pass upto 2.1. */ if (!__cvmx_helper_need_g15618()) { + link_timeout = 200000; +#if defined(OCTEON_VENDOR_GEFES) + if( (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_TNPA56X4) && (interface == 0) ) + { + link_timeout = 5000000; + } +#endif control_reg.s.reset = 1; cvmx_write_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface), control_reg.u64); - if (CVMX_WAIT_FOR_FIELD64(CVMX_PCSX_MRX_CONTROL_REG(index, interface), cvmx_pcsx_mrx_control_reg_t, reset, ==, 0, 10000)) + if (CVMX_WAIT_FOR_FIELD64(CVMX_PCSX_MRX_CONTROL_REG(index, interface), cvmx_pcsx_mrx_control_reg_t, reset, ==, 0, link_timeout)) { cvmx_dprintf("SGMII%d: Timeout waiting for port %d to finish reset\n", interface, index); return -1; @@ -256,6 +277,11 @@ static int __cvmx_helper_sgmii_hardware_ cvmx_gmxx_prtx_cfg_t gmxx_prtx_cfg; cvmx_pcsx_miscx_ctl_reg_t pcsx_miscx_ctl_reg; +#if defined(OCTEON_VENDOR_GEFES) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_CUST_TNPA5651X) + return 0; /* no auto-negotiation */ +#endif + /* Disable GMX before we make any changes. Remember the enable state */ gmxx_prtx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface)); is_enabled = gmxx_prtx_cfg.s.en; @@ -586,8 +612,42 @@ cvmx_helper_link_info_t __cvmx_helper_sg pcsx_miscx_ctl_reg.u64 = cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); if (pcsx_miscx_ctl_reg.s.mode) { +#if defined(OCTEON_VENDOR_GEFES) /* 1000BASE-X */ - // FIXME + int interface = cvmx_helper_get_interface_num(ipd_port); + int index = cvmx_helper_get_interface_index_num(ipd_port); + cvmx_pcsx_miscx_ctl_reg_t mode_type; + cvmx_pcsx_anx_results_reg_t inband_status; + cvmx_pcsx_mrx_status_reg_t mrx_status; + cvmx_pcsx_anx_adv_reg_t anxx_adv; + + anxx_adv.u64 = cvmx_read_csr(CVMX_PCSX_ANX_ADV_REG(index, interface)); + mrx_status.u64 = cvmx_read_csr(CVMX_PCSX_MRX_STATUS_REG(index, interface)); + mode_type.u64 = cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface)); + + /* Read Octeon's inband status */ + inband_status.u64 = cvmx_read_csr(CVMX_PCSX_ANX_RESULTS_REG(index, interface)); + + result.s.link_up = inband_status.s.link_ok;/* this is only accurate for 1000-base x */ + + result.s.full_duplex = inband_status.s.dup; + switch (inband_status.s.spd) + { + case 0: /* 10 Mbps */ + result.s.speed = 10; + break; + case 1: /* 100 Mbps */ + result.s.speed = 100; + break; + case 2: /* 1 Gbps */ + result.s.speed = 1000; + break; + case 3: /* Illegal */ + result.s.speed = 0; + result.s.link_up = 0; + break; + } +#endif /* Actually not 100% this is GEFES specific */ } else { Modified: head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Fri May 10 02:59:49 2013 (r250427) +++ head/sys/contrib/octeon-sdk/cvmx-mgmt-port.c Fri May 10 03:04:45 2013 (r250428) @@ -116,12 +116,16 @@ CVMX_SHARED cvmx_mgmt_port_state_t *cvmx */ static int __cvmx_mgmt_port_num_ports(void) { +#if defined(OCTEON_VENDOR_GEFES) + return 0; /* none of the GEFES boards have mgmt ports */ +#else if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN68XX)) return 1; else if (OCTEON_IS_MODEL(OCTEON_CN52XX) || OCTEON_IS_MODEL(OCTEON_CN6XXX)) return 2; else return 0; +#endif } Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri May 10 02:59:49 2013 (r250427) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri May 10 03:04:45 2013 (r250428) @@ -422,12 +422,12 @@ static int __cvmx_pcie_rc_initialize_lin start_cycle = cvmx_get_cycle(); do { - if (cvmx_get_cycle() - start_cycle > 2*cvmx_clock_get_rate(CVMX_CLOCK_CORE)) + if (cvmx_get_cycle() - start_cycle > 100*cvmx_clock_get_rate(CVMX_CLOCK_CORE)) { cvmx_dprintf("PCIe: Port %d link timeout\n", pcie_port); return -1; } - cvmx_wait(10000); + cvmx_wait(50000); pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); } while (pciercx_cfg032.s.dlla == 0); @@ -518,6 +518,41 @@ retry: return -1; } +#if defined(CONFIG_GEFES_SUPPORT) /* Commented out for now */ + /* check if we should initialize this port */ + if ((cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA56X4) || + (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA5651X)) { + unsigned char fpga_ekeylanes0 = 0; + unsigned char fpga_ekeylanes1 = 0; + + cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); + /* For pcie_port 0 - QLM0 (& optionally QLM1) + x4 PCIe AMC ports 4-7 via QLM0 + x8 PCIe AMC ports 4-7 via QLM0 and AMC ports 8-11 via QLM1 + root complex or end point configuration + must be root complex via "if (npei_ctl_status.s.host_mode) {" + */ + + if ((pcie_port == 0) && (fpga_ekeylanes1 == 0)) { + return -1; + } + + /* For pcie_port 1 - QLM2 in RC only connected to 82571 ethernet */ + /* always enabled, don't check ekeying lanes */ + } + else /* all other GEFES boards(maybe just WANIC?)*/ + { + cvmx_npei_ctl_status_t npei_ctl_status; + + npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); + if ( (pcie_port == 1) && (!npei_ctl_status.s.host_mode) ) + { + cvmx_dprintf("PCIe: Port 1 not used (RC only), skipping.\\n"); + return -1; + } + } +#endif /* CONFIG_GEFES_SUPPORT */ + /* PCIe switch arbitration mode. '0' == fixed priority NPEI, PCIe0, then PCIe1. '1' == round robin. */ npei_ctl_status.s.arb = 1; /* Allow up to 0x20 config retries */ @@ -988,6 +1023,27 @@ static int __cvmx_pcie_rc_initialize_gen return -1; } +#ifdef CONFIG_GEFES_SUPPORT /* commented out for now */ + /* check if we should initialize this port */ + if ((cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA56X4) || + (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA5651X)) { + unsigned char fpga_ekeylanes0; + unsigned char fpga_ekeylanes1; + + cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); + /* For pcie_port 0 - QLM0 (& optionally QLM1) + x4 PCIe AMC ports 4-7 via QLM0 + x8 PCIe AMC ports 4-7 via QLM0 and AMC ports 8-11 via QLM1 + root complex or end point configuration + must be endpoint via "if (npei_ctl_status.s.host_mode) {" + */ + if (( pcie_port == 0) && (fpga_ekeylanes1 == 0)) { + return -1; + } + /* can't get here for pcie_port 1 as is always only root complex configured */ + } +#endif /* CONFIG_GEFES_SUPPORT */ + /* CN63XX Pass 1.0 errata G-14395 requires the QLM De-emphasis be programmed */ if (OCTEON_IS_MODEL(OCTEON_CN63XX_PASS1_0)) { @@ -1340,7 +1396,46 @@ uint16_t cvmx_pcie_config_read16(int pci */ uint32_t cvmx_pcie_config_read32(int pcie_port, int bus, int dev, int fn, int reg) { - uint64_t address = __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); + uint64_t address; + +#ifdef CONFIG_GEFES_SUPPORT /* Commented out for now */ + + int result; + + /* if U-boot initializes the PCIe ports, then to Linux + it looks as if the ports are up, when in fact, the + port 0 link could be down because there is no endpoint + configured card present. If that is the case, U-boot + would not have configured the access to the PCIe config + space for that port and Linux would crash when it tries + to access that memory space. This code checks to see + if root complex mode is configured, and if it is, if + the link is up for the port before trying to access + the config space. + */ + + /* root complex ? */ + result = cvmx_pcie_dogetinfo(pcie_port, 2); + if (result == 1) { + //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d in root complex mode\n", pcie_port); + } else { + //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d in end point mode\n", pcie_port); + } + + if (result == 1) { + /* link up? */ + result = cvmx_pcie_dogetinfo(pcie_port, 0); + + if (result == 1) { + //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d link UP\n", pcie_port); + } else { + cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d link DOWN\n", pcie_port); + return 0xffffffff; + } + } +#endif /* CONFIG_GEFES_SUPPORT */ + + address = __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); if (address) return cvmx_le32_to_cpu(cvmx_read64_uint32(address)); else @@ -1698,3 +1793,135 @@ void cvmx_pcie_wait_for_pending(int pcie } } } + +#ifdef CONFIG_GEFES_SUPPORT +/* eastestdebug - add ekeying from MMC routine */ +/* support routine for CVMX_BOARD_TYPE_TNPA56X4 ekeying */ +void cvmx_get_mmc_ekeying(unsigned char *fpga_ekeylanes0, unsigned char *fpga_ekeylanes1) +{ + switch (cvmx_sysinfo_get()->board_type) { + case CVMX_BOARD_TYPE_TNPA56X4: + case CVMX_BOARD_TYPE_TNPA5651X: + /*TODO: need to check AMC shelf response for 4-7 and 8-11*/ + /*TODO: get rid of magic numbers for FPGA access*/ + /* IPMI define = BOARD_FPGA_DPRAM_PORT_EN_0 */ + /* base ports 0 & 1, fabric xaui 4-7 */ + *fpga_ekeylanes0 = *(char*)0x8000000016000080; + /* IPMI define = BOARD_FPGA_DPRAM_PORT_EN_1 */ + /* fabric pcie 4-7, fabric pcie 8-11 */ + *fpga_ekeylanes1 = *(char*)0x8000000016000082; + default: + /* TBD for other board types */ + break; + } +} + +/* eastestdebug - add cvmx_pcie_getinfo for PCIe /proc/ data */ +/** + * Get desired info for a PCIe port on our Octeon. + * Note not possible to have multiple devObj from caller. + * + * @param pcie_port PCIe port to get info for + * + * @return uint8_t value for desired info + */ +int cvmx_pcie_dogetinfo(int pcie_port, int infotype) +{ +cvmx_pciercx_cfg032_t pciercx_cfg032; +cvmx_npei_ctl_status_t npei_ctl_status; +unsigned char fpga_ekeylanes0 = 0; +unsigned char fpga_ekeylanes1 = 0; +uint64_t start_cycle; + + switch (cvmx_sysinfo_get()->board_type) { + case CVMX_BOARD_TYPE_TNPA56X4: + case CVMX_BOARD_TYPE_TNPA5651X: + switch (infotype) { + case 0: /* link up (1) /down (0) */ +#if 0 + pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); + if (pciercx_cfg032.s.nlw) { + /* link up */ + return(1); + } + return(0); +#endif + /* Wait for the link to come up */ + //cvmx_dprintf("PCIe: Waiting for port %d link\n", pcie_port); + start_cycle = cvmx_get_cycle(); + pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); + while (pciercx_cfg032.s.dlla == 0) { + /* if (cvmx_get_cycle() - start_cycle > 2*cvmx_sysinfo_get()->cpu_clock_hz) */ + if (cvmx_get_cycle() - start_cycle > 100 * cvmx_sysinfo_get()->cpu_clock_hz) + { + cvmx_dprintf("PCIe: Port %d link timeout\n", pcie_port); + return 0; + } + /* cvmx_wait(10000); */ + cvmx_wait(50000); + pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); + } + + /* Display the link status */ + //cvmx_dprintf("PCIe: Port %d link active, %d lanes\n", pcie_port, pciercx_cfg032.s.nlw); + return(1); + + case 1: /* link valid (1) / disabled (0) */ + /* CVMX_BOARD_TYPE_TNPA56X4 specific */ + if (pcie_port == 1) { + /* port 1 - QLM2 RC x4 always enabled */ + return (1); + } + cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); + if (fpga_ekeylanes1) { + /* ekeying on for something - i.e. valid */ + return(1); + } + return(0); + case 2: /* link type root complex (1) /end point (0) */ + if (pcie_port == 1) { + /* port 1 - QLM2 RC x4 always enabled */ + return (1); + } + /* check if port 0 host (rc) or endpoint */ + npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); + if (npei_ctl_status.s.host_mode) { + return(1); + } + return(0); + case 3: /* desired link size x8 (8) /x4 (4) */ + cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); + if (fpga_ekeylanes1 & 0xf0) { + return (8); /* x8 */ + } else if (fpga_ekeylanes1 & 0x0f) { + return (4); /* x4 */ + } + break; /* disabled */ + case 4: /* actual configured link size x32 (32)/ x16 (16) /x8 (8) /x4 (4) /x2 (2) x1 (1) */ + pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); + switch (pciercx_cfg032.s.nlw) { + case 1: /* 1 lane */ + return(1); + case 2: /* 2 lanes */ + return(2); + case 4: /* 4 lanes */ + return(4); + case 8: /* 8 lanes */ + return(8); + default: + break; + } + /* unknown, return x4 */ + return(4); + default: + /* TBD for other info types */ + return 0; + } + break; + default: + /* TBD for other board types */ + break; + } + return 0; +} +#endif /* CONFIG_GEFES_SUPPORT */ From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:05:44 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DF99AF2E; Fri, 10 May 2013 03:05:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D31403CD; Fri, 10 May 2013 03:05:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A35iv7067485; Fri, 10 May 2013 03:05:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A35igb067484; Fri, 10 May 2013 03:05:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100305.r4A35igb067484@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 03:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250429 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:05:45 -0000 Author: imp Date: Fri May 10 03:05:44 2013 New Revision: 250429 URL: http://svnweb.freebsd.org/changeset/base/250429 Log: Add commented out OCTEON_VENDOR_GEFES Modified: head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Fri May 10 03:04:45 2013 (r250428) +++ head/sys/mips/conf/OCTEON1 Fri May 10 03:05:44 2013 (r250429) @@ -40,6 +40,7 @@ makeoptions DEBUG=-g #Build kernel with #options OCTEON_VENDOR_LANNER # Support for Lanner boards. #options OCTEON_VENDOR_RADISYS # Support for Radisys boards. #options OCTEON_VENDOR_UBIQUITI # Support for Ubiquiti boards. +#options OCTEON_VENDOR_GEFES # Support for GE LANIC boards #options OCTEON_BOARD_CAPK_0100ND # Support for CAPK-0100nd. # Compile for a specified Octeon model. If not specified, support for From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:12:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15504193; Fri, 10 May 2013 03:12:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx07.syd.optusnet.com.au (fallbackmx07.syd.optusnet.com.au [211.29.132.9]) by mx1.freebsd.org (Postfix) with ESMTP id A94E95EE; Fri, 10 May 2013 03:12:09 +0000 (UTC) Received: from mail10.syd.optusnet.com.au (mail10.syd.optusnet.com.au [211.29.132.191]) by fallbackmx07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4A363KB002733; Fri, 10 May 2013 13:06:03 +1000 Received: from etaplex.bde.org ([139.218.225.48]) (authenticated sender brde) by mail10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r4A35dfF016972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 May 2013 13:05:55 +1000 Date: Fri, 10 May 2013 13:05:46 +1000 (EST) From: Bruce Evans X-X-Sender: bde@etaplex.bde.org To: John Baldwin Subject: Re: svn commit: r250220 - head/sys/kern In-Reply-To: <201305061355.20826.jhb@freebsd.org> Message-ID: <20130510123842.B637@etaplex.bde.org> References: <201305031908.r43J8xnI094418@svn.freebsd.org> <20130504184721.E619@etaplex.bde.org> <201305061355.20826.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=e/de0tV/ c=1 sm=1 a=5CeyE4nVUmB46QZCKVgZLQ==:17 a=8aH1kwsY6JcA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=M4roAWbnUW4A:10 a=BqGE20DC9-uUo3ouRuIA:9 a=CjuIK1q_8ugA:10 a=5CeyE4nVUmB46QZCKVgZLQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:12:10 -0000 On Mon, 6 May 2013, John Baldwin wrote: > On Saturday, May 04, 2013 4:47:43 am Bruce Evans wrote: >>> Log: >>> Fix FIONREAD on regular files. The computed result was being ignored and >>> it was being passed down to VOP_IOCTL() where it promptly resulted in >>> ENOTTY due to a missing else for the past 8 years. While here, use a >>> shared vnode lock while fetching the current file's size. >> >> In another thread I complained to kib about using the bad style of not >> returning as soon as possible, but instead sometimes returning and sometimes >> falling through a complicated if-else ladder to get to the return at the >> end. > > What about this: My mail is barely working while I'm away. This is the only reply that I received recently. > static int > vn_ioctl(fp, com, data, active_cred, td) > struct file *fp; > u_long com; > void *data; > struct ucred *active_cred; > struct thread *td; > { > struct vnode *vp = fp->f_vnode; > struct vattr vattr; > > switch (vp->v_type) { > case VREG: > case VDIR: > switch (com) { > case FIONREAD: > vn_lock(vp, LK_SHARED | LK_RETRY); > error = VOP_GETATTR(vp, &vattr, active_cred); > VOP_UNLOCK(vp, 0); > if (!error) > *(int *)data = vattr.va_size - fp->f_offset; > return (error); > case FIONBIO: > case FIOASYNC: > return (0); /* XXX */ > default: > return (VOP_IOCTL(vp, com, data, fp->f_flag, > active_cred, td)); > } > default: > return (ENOTTY); > } > } Yes, that is the simplification for the logic that I want. This function has many other style bugs, starting witht the unsorting of vp relative to vattr and the initialization of vp in its declaration. I don't count the old-style function definition as a style bug :). Also, the case statment is unsorted (which used to be needed for the logic of falling through), and !error is used for the non-boolean 'error'. !error is near the overflow bug in *(int *) for large files. INT_MAX should probably be returned when the correct value is unrepresentable. This can't be worse than overflowing to a garbage (possibly small or negative value). Testing 'error' is not even needed, since *(int *)data is indeterminate after an error. > (The 'XXX' comment could perhaps be expanded to something along the lines of > 'Allow fcntl() to toggle FNONBLOCK and FASYNC.') Is that what it is about? IIRC, upper layers do some partial handling and then call lower layers to possibly do some more handling. But here and in some other places there is nothing more to be done. No comment is needed, but maybe the XXX's were reminders to clean up the layering. FreeBSD has cleaned up the layering a bit, by using differnt fops for different file types. Bruce From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:26:31 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F29A93B2 for ; Fri, 10 May 2013 03:26:30 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx1.freebsd.org (Postfix) with ESMTP id 7EE6E66A for ; Fri, 10 May 2013 03:26:30 +0000 (UTC) Received: by mail-lb0-f177.google.com with SMTP id 13so3711676lba.8 for ; Thu, 09 May 2013 20:26:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=CJf7D9m0RqMGIwcPMa8b4N6JRXm9R+TMzOJDgGAZvko=; b=WZnUrZcN7zZYagU2zYI4fTox+xjojcBheAE4HGpGMRYiQeUFcjjaRMBMKOJ9ZVNBNo taTGBiUTCISTWlXghk6fqPeSsmA7rC6CExAq2gi7TG8vOHVzdWwRCXBpInXsEuptaSX5 2hAmgG+cl8xVWpDGxOKsR0Yu/D4OmvqZhWn/dHtdWEnPpCffHAkn+pLs9EFHQsUKC9bf rwlgxiQVjPNRCHQKxOlippGe4441RLnUgtWq/6TOw3mdMDsrmwc4juTySufkbh6yBGa9 M1EQwPffmgyTNSVadew1CNZ6WsEAMTDZUtAs8H/aWNfJjTZoZbhkeJ7AhjqHtZYhGwrA K/yg== X-Received: by 10.112.184.226 with SMTP id ex2mr6696257lbc.33.1368156389068; Thu, 09 May 2013 20:26:29 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.128.67 with HTTP; Thu, 9 May 2013 20:26:08 -0700 (PDT) In-Reply-To: <201305100257.r4A2vkfd062811@svn.freebsd.org> References: <201305100257.r4A2vkfd062811@svn.freebsd.org> From: Juli Mallett Date: Thu, 9 May 2013 20:26:08 -0700 X-Google-Sender-Auth: P0NnyCJC2_fSZzJIXlkadynOYLY Message-ID: Subject: Re: svn commit: r250426 - head/sys/contrib/octeon-sdk To: Warner Losh Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkgpYz+iyL5ExIwZdIhwljqcbDXo/io79ObZVRjYSemJR2iRvRDbAH2egioSfr6+zD1sz0Y Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:26:31 -0000 On Thu, May 9, 2013 at 7:57 PM, Warner Losh wrote: > Log: > Both my EBH5200 and GE WANIC 6354 have a RTC as well. It looks from > the Linux tree that they always include this chip in their FDT, so > make support for the ds1337 opt-out rather than opt-in. Now my boards > boot with the correct time. What boards did you test on without RTCs to verify that it doesn't cause hangs? The fact that there are two boards not enumerated which did have an RTC doesn't say anything about the boards that truly don't. Likewise, Linux's FDT is not authoritative for all boards. I'd feel better knowing this at least won't have a negative effect on boards without an RTC. From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:42:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 65D3FDDE; Fri, 10 May 2013 03:42:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3FFCE94A; Fri, 10 May 2013 03:42:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A3gnUS080598; Fri, 10 May 2013 03:42:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A3gmc9080595; Fri, 10 May 2013 03:42:48 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305100342.r4A3gmc9080595@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 03:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250430 - head/sbin/dmesg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:42:49 -0000 Author: eadler Date: Fri May 10 03:42:48 2013 New Revision: 250430 URL: http://svnweb.freebsd.org/changeset/base/250430 Log: Add support for 'dmesg -c' which clears the dmesg buffer after it has been printed. This provides compatibility with other *nix systems (including Linux). While here use stdbool booleans for 'all'. PR: bin/178295 Submitted by: Levent Serinol Reviewed by: will Modified: head/sbin/dmesg/dmesg.8 head/sbin/dmesg/dmesg.c Modified: head/sbin/dmesg/dmesg.8 ============================================================================== --- head/sbin/dmesg/dmesg.8 Fri May 10 03:05:44 2013 (r250429) +++ head/sbin/dmesg/dmesg.8 Fri May 10 03:42:48 2013 (r250430) @@ -36,7 +36,7 @@ .Nd "display the system message buffer" .Sh SYNOPSIS .Nm -.Op Fl a +.Op Fl ac .Op Fl M Ar core Op Fl N Ar system .Sh DESCRIPTION The @@ -59,6 +59,8 @@ Show all data in the message buffer. This includes any syslog records and .Pa /dev/console output. +.It Fl c +Clear the kernel buffer after printing. .It Fl M Extract values associated with the name list from the specified core. .It Fl N Modified: head/sbin/dmesg/dmesg.c ============================================================================== --- head/sbin/dmesg/dmesg.c Fri May 10 03:05:44 2013 (r250429) +++ head/sbin/dmesg/dmesg.c Fri May 10 03:42:48 2013 (r250430) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -79,15 +80,20 @@ main(int argc, char *argv[]) kvm_t *kd; size_t buflen, bufpos; long pri; - int all, ch; + int ch, clear; + bool all; - all = 0; + all = false; + clear = false; (void) setlocale(LC_CTYPE, ""); memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "aM:N:")) != -1) + while ((ch = getopt(argc, argv, "acM:N:")) != -1) switch(ch) { case 'a': - all++; + all = true; + break; + case 'c': + clear = true; break; case 'M': memf = optarg; @@ -190,12 +196,16 @@ main(int argc, char *argv[]) (void)strvisx(visbp, p, nextp - p, 0); (void)printf("%s", visbp); } + if (clear) + if (sysctlbyname("kern.msgbuf_clear", NULL, NULL, &clear, sizeof(int))) + err(1, "sysctl kern.msgbuf_clear"); + exit(0); } void usage(void) { - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); + fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); exit(1); } From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:49:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0377718F; Fri, 10 May 2013 03:49:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EAB3B9AB; Fri, 10 May 2013 03:49:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A3n5B5081768; Fri, 10 May 2013 03:49:05 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A3n5qh081766; Fri, 10 May 2013 03:49:05 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305100349.r4A3n5qh081766@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 03:49:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250431 - head/usr.bin/xargs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:49:06 -0000 Author: eadler Date: Fri May 10 03:49:05 2013 New Revision: 250431 URL: http://svnweb.freebsd.org/changeset/base/250431 Log: Style(9) changes fo xargs.c Modified: head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Fri May 10 03:42:48 2013 (r250430) +++ head/usr.bin/xargs/xargs.c Fri May 10 03:49:05 2013 (r250431) @@ -670,12 +670,14 @@ pids_init(void) static int pids_empty(void) { + return (curprocs == 0); } static int pids_full(void) { + return (curprocs >= maxprocs); } @@ -709,7 +711,6 @@ findfreeslot(void) if ((slot = findslot(NOPID)) < 0) errx(1, "internal error: no free pid slot"); - return (slot); } @@ -721,13 +722,13 @@ findslot(pid_t pid) for (slot = 0; slot < maxprocs; slot++) if (childpids[slot] == pid) return (slot); - return (-1); } static void clearslot(int slot) { + childpids[slot] = NOPID; } @@ -762,6 +763,7 @@ prompt(void) static void usage(void) { + fprintf(stderr, "usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]\n" " [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n" From owner-svn-src-all@FreeBSD.ORG Fri May 10 03:55:48 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E6F73B2 for ; Fri, 10 May 2013 03:55:48 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2949D3 for ; Fri, 10 May 2013 03:55:48 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id v10so2488399pde.4 for ; Thu, 09 May 2013 20:55:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=j9DRdfLblcNORyVx1sZ1vYLltie8Pe/vx81Vjf3yrZI=; b=Hv1gLnKk8k6dwTRMI5TsG/2ioRUgkLHN3d/kdUGogaHJa6neyXZbTQhoJoQNxiATlB PseYWR9h643ifWA/UOI40wdcr+Wn5REUFOaYf9t/qX84XISTYp9ERaM7UdpWF47hwM0j qUTfjgtIly5RZ0BQiyTchPDvi1+An6FVjHItpMbObRWQpfA4ieMCvgxKVopdMwrvI6Ga 43X6Dxj0zmySJN1j0soMiUz+dKdRchXRMQELu83BqO5Iuja9VofdKeu4kPofq4aVoyeb QvlpyJWcangNAVRot9kncnI7CB5BWZHOcoe5ti9pEFjMiMxgWBlFOZGrLvuVr948hGC0 u8UQ== X-Received: by 10.68.189.8 with SMTP id ge8mr755590pbc.199.1368158147555; Thu, 09 May 2013 20:55:47 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id lq5sm1004964pab.19.2013.05.09.20.55.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 09 May 2013 20:55:46 -0700 (PDT) Sender: Warner Losh Subject: Re: svn commit: r250426 - head/sys/contrib/octeon-sdk Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Thu, 9 May 2013 21:55:43 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7E5E7D8A-C8BB-4660-89C2-5ED38F16F484@bsdimp.com> References: <201305100257.r4A2vkfd062811@svn.freebsd.org> To: Juli Mallett X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQkJj1DpylhfeMp3uIQKcz34oMoJCz5wxHP7oAE0iPJVYFDOikA8lsWR+vcNNJycZDknYsYU Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:55:48 -0000 On May 9, 2013, at 9:26 PM, Juli Mallett wrote: > On Thu, May 9, 2013 at 7:57 PM, Warner Losh wrote: >> Log: >> Both my EBH5200 and GE WANIC 6354 have a RTC as well. It looks from >> the Linux tree that they always include this chip in their FDT, so >> make support for the ds1337 opt-out rather than opt-in. Now my = boards >> boot with the correct time. >=20 > What boards did you test on without RTCs to verify that it doesn't > cause hangs? The fact that there are two boards not enumerated which > did have an RTC doesn't say anything about the boards that truly > don't. Likewise, Linux's FDT is not authoritative for all boards. > I'd feel better knowing this at least won't have a negative effect on > boards without an RTC. I don't have any boards without an RTC, but I can try wiring the RTC to = a bugs address to see what happens. If that's an acceptable level of = testing, I'll do that. If not, I'll enumerate. Warner From owner-svn-src-all@FreeBSD.ORG Fri May 10 04:23:04 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 877FE831; Fri, 10 May 2013 04:23:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79753B36; Fri, 10 May 2013 04:23:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A4N4Gv094728; Fri, 10 May 2013 04:23:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A4N44u094726; Fri, 10 May 2013 04:23:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305100423.r4A4N44u094726@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 04:23:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250432 - head/usr.bin/split X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 04:23:04 -0000 Author: eadler Date: Fri May 10 04:23:03 2013 New Revision: 250432 URL: http://svnweb.freebsd.org/changeset/base/250432 Log: Implement 'split -d' which allows a numeric suffix instead of an alphabetic one. PR: bin/116209 Submitted by: Marcin Gryszkalis (adapted from) Reviewed by: will MFC after: 1 week Modified: head/usr.bin/split/split.1 head/usr.bin/split/split.c Modified: head/usr.bin/split/split.1 ============================================================================== --- head/usr.bin/split/split.1 Fri May 10 03:49:05 2013 (r250431) +++ head/usr.bin/split/split.1 Fri May 10 04:23:03 2013 (r250432) @@ -36,10 +36,12 @@ .Nd split a file into pieces .Sh SYNOPSIS .Nm +.Fl d .Op Fl l Ar line_count .Op Fl a Ar suffix_length .Op Ar file Op Ar prefix .Nm +.Fl d .Fl b Ar byte_count Ns .Oo .Sm off @@ -49,10 +51,12 @@ .Op Fl a Ar suffix_length .Op Ar file Op Ar prefix .Nm +.Fl d .Fl n Ar chunk_count .Op Fl a Ar suffix_length .Op Ar file Op Ar prefix .Nm +.Fl d .Fl p Ar pattern .Op Fl a Ar suffix_length .Op Ar file Op Ar prefix @@ -108,6 +112,8 @@ or is appended to the number, the file is split into .Ar byte_count gigabyte pieces. +.It Fl d +Use a numeric suffix instead of a alphabetic suffix. .It Fl l Ar line_count Create split files .Ar line_count Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Fri May 10 03:49:05 2013 (r250431) +++ head/usr.bin/split/split.c Fri May 10 04:23:03 2013 (r250432) @@ -51,6 +51,7 @@ static const char sccsid[] = "@(#)split. #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ static char bfr[MAXBSIZE]; /* I/O buff static char fname[MAXPATHLEN]; /* File name prefix. */ static regex_t rgx; static int pflag; +static bool dflag; static long sufflen = 2; /* File name suffix length. */ static void newfile(void); @@ -88,7 +90,8 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "0123456789a:b:l:n:p:")) != -1) + dflag = false; + while ((ch = getopt(argc, argv, "0123456789a:b:dl:n:p:")) != -1) switch (ch) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -131,6 +134,9 @@ main(int argc, char **argv) errx(EX_USAGE, "%s: offset too large", optarg); bytecnt = (off_t)(bytecnti * scale); break; + case 'd': /* Decimal suffix */ + dflag = true; + break; case 'l': /* Line count. */ if (numlines != 0) usage(); @@ -348,6 +354,8 @@ newfile(void) long i, maxfiles, tfnum; static long fnum; static char *fpnt; + char beg, end; + int pattlen; if (ofd == -1) { if (fname[0] == '\0') { @@ -359,9 +367,19 @@ newfile(void) ofd = fileno(stdout); } - /* maxfiles = 26^sufflen, but don't use libm. */ + if (dflag) { + beg = '0'; + end = '9'; + } + else { + beg = 'a'; + end = 'z'; + } + pattlen = end - beg + 1; + + /* maxfiles = pattlen^sufflen, but don't use libm. */ for (maxfiles = 1, i = 0; i < sufflen; i++) - if ((maxfiles *= 26) <= 0) + if ((maxfiles *= pattlen) <= 0) errx(EX_USAGE, "suffix is too long (max %ld)", i); if (fnum == maxfiles) @@ -371,8 +389,8 @@ newfile(void) tfnum = fnum; i = sufflen - 1; do { - fpnt[i] = tfnum % 26 + 'a'; - tfnum /= 26; + fpnt[i] = tfnum % pattlen + beg; + tfnum /= pattlen; } while (i-- > 0); fpnt[sufflen] = '\0'; From owner-svn-src-all@FreeBSD.ORG Fri May 10 04:30:15 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F0CA4AE1; Fri, 10 May 2013 04:30:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E28D3B81; Fri, 10 May 2013 04:30:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A4UEnH096021; Fri, 10 May 2013 04:30:14 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A4UEoa096020; Fri, 10 May 2013 04:30:14 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100430.r4A4UEoa096020@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 04:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250433 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 04:30:15 -0000 Author: imp Date: Fri May 10 04:30:14 2013 New Revision: 250433 URL: http://svnweb.freebsd.org/changeset/base/250433 Log: Remove the commented out code I just committed. If we need it, I'll bring it back uncommented our, or rewrite it. Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri May 10 04:23:03 2013 (r250432) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri May 10 04:30:14 2013 (r250433) @@ -518,41 +518,6 @@ retry: return -1; } -#if defined(CONFIG_GEFES_SUPPORT) /* Commented out for now */ - /* check if we should initialize this port */ - if ((cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA56X4) || - (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA5651X)) { - unsigned char fpga_ekeylanes0 = 0; - unsigned char fpga_ekeylanes1 = 0; - - cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); - /* For pcie_port 0 - QLM0 (& optionally QLM1) - x4 PCIe AMC ports 4-7 via QLM0 - x8 PCIe AMC ports 4-7 via QLM0 and AMC ports 8-11 via QLM1 - root complex or end point configuration - must be root complex via "if (npei_ctl_status.s.host_mode) {" - */ - - if ((pcie_port == 0) && (fpga_ekeylanes1 == 0)) { - return -1; - } - - /* For pcie_port 1 - QLM2 in RC only connected to 82571 ethernet */ - /* always enabled, don't check ekeying lanes */ - } - else /* all other GEFES boards(maybe just WANIC?)*/ - { - cvmx_npei_ctl_status_t npei_ctl_status; - - npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); - if ( (pcie_port == 1) && (!npei_ctl_status.s.host_mode) ) - { - cvmx_dprintf("PCIe: Port 1 not used (RC only), skipping.\\n"); - return -1; - } - } -#endif /* CONFIG_GEFES_SUPPORT */ - /* PCIe switch arbitration mode. '0' == fixed priority NPEI, PCIe0, then PCIe1. '1' == round robin. */ npei_ctl_status.s.arb = 1; /* Allow up to 0x20 config retries */ @@ -1023,27 +988,6 @@ static int __cvmx_pcie_rc_initialize_gen return -1; } -#ifdef CONFIG_GEFES_SUPPORT /* commented out for now */ - /* check if we should initialize this port */ - if ((cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA56X4) || - (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_TNPA5651X)) { - unsigned char fpga_ekeylanes0; - unsigned char fpga_ekeylanes1; - - cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); - /* For pcie_port 0 - QLM0 (& optionally QLM1) - x4 PCIe AMC ports 4-7 via QLM0 - x8 PCIe AMC ports 4-7 via QLM0 and AMC ports 8-11 via QLM1 - root complex or end point configuration - must be endpoint via "if (npei_ctl_status.s.host_mode) {" - */ - if (( pcie_port == 0) && (fpga_ekeylanes1 == 0)) { - return -1; - } - /* can't get here for pcie_port 1 as is always only root complex configured */ - } -#endif /* CONFIG_GEFES_SUPPORT */ - /* CN63XX Pass 1.0 errata G-14395 requires the QLM De-emphasis be programmed */ if (OCTEON_IS_MODEL(OCTEON_CN63XX_PASS1_0)) { @@ -1398,43 +1342,6 @@ uint32_t cvmx_pcie_config_read32(int pci { uint64_t address; -#ifdef CONFIG_GEFES_SUPPORT /* Commented out for now */ - - int result; - - /* if U-boot initializes the PCIe ports, then to Linux - it looks as if the ports are up, when in fact, the - port 0 link could be down because there is no endpoint - configured card present. If that is the case, U-boot - would not have configured the access to the PCIe config - space for that port and Linux would crash when it tries - to access that memory space. This code checks to see - if root complex mode is configured, and if it is, if - the link is up for the port before trying to access - the config space. - */ - - /* root complex ? */ - result = cvmx_pcie_dogetinfo(pcie_port, 2); - if (result == 1) { - //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d in root complex mode\n", pcie_port); - } else { - //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d in end point mode\n", pcie_port); - } - - if (result == 1) { - /* link up? */ - result = cvmx_pcie_dogetinfo(pcie_port, 0); - - if (result == 1) { - //cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d link UP\n", pcie_port); - } else { - cvmx_dprintf("cvmx_pcie_config_read32: pcie_port %d link DOWN\n", pcie_port); - return 0xffffffff; - } - } -#endif /* CONFIG_GEFES_SUPPORT */ - address = __cvmx_pcie_build_config_addr(pcie_port, bus, dev, fn, reg); if (address) return cvmx_le32_to_cpu(cvmx_read64_uint32(address)); @@ -1793,135 +1700,3 @@ void cvmx_pcie_wait_for_pending(int pcie } } } - -#ifdef CONFIG_GEFES_SUPPORT -/* eastestdebug - add ekeying from MMC routine */ -/* support routine for CVMX_BOARD_TYPE_TNPA56X4 ekeying */ -void cvmx_get_mmc_ekeying(unsigned char *fpga_ekeylanes0, unsigned char *fpga_ekeylanes1) -{ - switch (cvmx_sysinfo_get()->board_type) { - case CVMX_BOARD_TYPE_TNPA56X4: - case CVMX_BOARD_TYPE_TNPA5651X: - /*TODO: need to check AMC shelf response for 4-7 and 8-11*/ - /*TODO: get rid of magic numbers for FPGA access*/ - /* IPMI define = BOARD_FPGA_DPRAM_PORT_EN_0 */ - /* base ports 0 & 1, fabric xaui 4-7 */ - *fpga_ekeylanes0 = *(char*)0x8000000016000080; - /* IPMI define = BOARD_FPGA_DPRAM_PORT_EN_1 */ - /* fabric pcie 4-7, fabric pcie 8-11 */ - *fpga_ekeylanes1 = *(char*)0x8000000016000082; - default: - /* TBD for other board types */ - break; - } -} - -/* eastestdebug - add cvmx_pcie_getinfo for PCIe /proc/ data */ -/** - * Get desired info for a PCIe port on our Octeon. - * Note not possible to have multiple devObj from caller. - * - * @param pcie_port PCIe port to get info for - * - * @return uint8_t value for desired info - */ -int cvmx_pcie_dogetinfo(int pcie_port, int infotype) -{ -cvmx_pciercx_cfg032_t pciercx_cfg032; -cvmx_npei_ctl_status_t npei_ctl_status; -unsigned char fpga_ekeylanes0 = 0; -unsigned char fpga_ekeylanes1 = 0; -uint64_t start_cycle; - - switch (cvmx_sysinfo_get()->board_type) { - case CVMX_BOARD_TYPE_TNPA56X4: - case CVMX_BOARD_TYPE_TNPA5651X: - switch (infotype) { - case 0: /* link up (1) /down (0) */ -#if 0 - pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); - if (pciercx_cfg032.s.nlw) { - /* link up */ - return(1); - } - return(0); -#endif - /* Wait for the link to come up */ - //cvmx_dprintf("PCIe: Waiting for port %d link\n", pcie_port); - start_cycle = cvmx_get_cycle(); - pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); - while (pciercx_cfg032.s.dlla == 0) { - /* if (cvmx_get_cycle() - start_cycle > 2*cvmx_sysinfo_get()->cpu_clock_hz) */ - if (cvmx_get_cycle() - start_cycle > 100 * cvmx_sysinfo_get()->cpu_clock_hz) - { - cvmx_dprintf("PCIe: Port %d link timeout\n", pcie_port); - return 0; - } - /* cvmx_wait(10000); */ - cvmx_wait(50000); - pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); - } - - /* Display the link status */ - //cvmx_dprintf("PCIe: Port %d link active, %d lanes\n", pcie_port, pciercx_cfg032.s.nlw); - return(1); - - case 1: /* link valid (1) / disabled (0) */ - /* CVMX_BOARD_TYPE_TNPA56X4 specific */ - if (pcie_port == 1) { - /* port 1 - QLM2 RC x4 always enabled */ - return (1); - } - cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); - if (fpga_ekeylanes1) { - /* ekeying on for something - i.e. valid */ - return(1); - } - return(0); - case 2: /* link type root complex (1) /end point (0) */ - if (pcie_port == 1) { - /* port 1 - QLM2 RC x4 always enabled */ - return (1); - } - /* check if port 0 host (rc) or endpoint */ - npei_ctl_status.u64 = cvmx_read_csr(CVMX_PEXP_NPEI_CTL_STATUS); - if (npei_ctl_status.s.host_mode) { - return(1); - } - return(0); - case 3: /* desired link size x8 (8) /x4 (4) */ - cvmx_get_mmc_ekeying(&fpga_ekeylanes0, &fpga_ekeylanes1); - if (fpga_ekeylanes1 & 0xf0) { - return (8); /* x8 */ - } else if (fpga_ekeylanes1 & 0x0f) { - return (4); /* x4 */ - } - break; /* disabled */ - case 4: /* actual configured link size x32 (32)/ x16 (16) /x8 (8) /x4 (4) /x2 (2) x1 (1) */ - pciercx_cfg032.u32 = cvmx_pcie_cfgx_read(pcie_port, CVMX_PCIERCX_CFG032(pcie_port)); - switch (pciercx_cfg032.s.nlw) { - case 1: /* 1 lane */ - return(1); - case 2: /* 2 lanes */ - return(2); - case 4: /* 4 lanes */ - return(4); - case 8: /* 8 lanes */ - return(8); - default: - break; - } - /* unknown, return x4 */ - return(4); - default: - /* TBD for other info types */ - return 0; - } - break; - default: - /* TBD for other board types */ - break; - } - return 0; -} -#endif /* CONFIG_GEFES_SUPPORT */ From owner-svn-src-all@FreeBSD.ORG Fri May 10 04:49:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5684BF5E; Fri, 10 May 2013 04:49:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A4C0CCD; Fri, 10 May 2013 04:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A4ne3G002720; Fri, 10 May 2013 04:49:40 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A4nePn002719; Fri, 10 May 2013 04:49:40 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100449.r4A4nePn002719@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 04:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250434 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 04:49:41 -0000 Author: imp Date: Fri May 10 04:49:40 2013 New Revision: 250434 URL: http://svnweb.freebsd.org/changeset/base/250434 Log: As requested, move this back to opt-in and list my boards. Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-rtc.h Fri May 10 04:30:14 2013 (r250433) +++ head/sys/contrib/octeon-sdk/cvmx-rtc.h Fri May 10 04:49:40 2013 (r250434) @@ -87,9 +87,18 @@ static inline cvmx_rtc_options_t cvmx_rt supported = CVMX_RTC_READ | CVMX_RTC_WRITE | CVMX_RTC_TIME_EPOCH; break; - default: + case CVMX_BOARD_TYPE_EBH3000: + case CVMX_BOARD_TYPE_CN3010_EVB_HS5: + case CVMX_BOARD_TYPE_EBH5200: +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_CUST_W63XX: +#endif supported = CVMX_RTC_READ | CVMX_RTC_WRITE | CVMX_RTC_TIME_CAL; break; + + default: + supported = 0; + break; } #ifdef CVMX_RTC_DEBUG @@ -117,9 +126,18 @@ static inline uint32_t cvmx_rtc_read(voi return cvmx_rtc_ds1374_read(); break; - default: + case CVMX_BOARD_TYPE_EBH3000: + case CVMX_BOARD_TYPE_CN3010_EVB_HS5: + case CVMX_BOARD_TYPE_EBH5200: +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_CUST_W63XX: +#endif return cvmx_rtc_ds1337_read(); break; + + default: + return 0; + break; } } @@ -138,9 +156,18 @@ static inline uint32_t cvmx_rtc_write(ui return cvmx_rtc_ds1374_write(time); break; - default: + case CVMX_BOARD_TYPE_EBH3000: + case CVMX_BOARD_TYPE_CN3010_EVB_HS5: + case CVMX_BOARD_TYPE_EBH5200: +#if defined(OCTEON_VENDOR_GEFES) + case CVMX_BOARD_TYPE_CUST_W63XX: +#endif return cvmx_rtc_ds1337_write(time); break; + + default: + return 0; + break; } } From owner-svn-src-all@FreeBSD.ORG Fri May 10 05:34:09 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6C2DD74E; Fri, 10 May 2013 05:34:09 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB16E2A; Fri, 10 May 2013 05:34:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A5Y9W5019094; Fri, 10 May 2013 05:34:09 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A5Y8qQ019091; Fri, 10 May 2013 05:34:08 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201305100534.r4A5Y8qQ019091@svn.freebsd.org> From: Tim Kientzle Date: Fri, 10 May 2013 05:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250435 - head/sys/boot/fdt/dts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 05:34:09 -0000 Author: kientzle Date: Fri May 10 05:34:08 2013 New Revision: 250435 URL: http://svnweb.freebsd.org/changeset/base/250435 Log: Move 'compatible' line out of the common am335x.dtsi and into the beaglebone-specific .dts file. Add a new .dts for the BeagleBone Black with more memory, slightly different pinmux initialization, and with mmchs1 configured (though the latter doesn't quite work yet). Added: head/sys/boot/fdt/dts/beaglebone-black.dts - copied, changed from r250434, head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi head/sys/boot/fdt/dts/beaglebone.dts Modified: head/sys/boot/fdt/dts/am335x.dtsi ============================================================================== --- head/sys/boot/fdt/dts/am335x.dtsi Fri May 10 04:49:40 2013 (r250434) +++ head/sys/boot/fdt/dts/am335x.dtsi Fri May 10 05:34:08 2013 (r250435) @@ -27,7 +27,6 @@ */ / { - compatible = "ti,am335x"; #address-cells = <1>; #size-cells = <1>; @@ -107,7 +106,7 @@ interrupt-parent = <&AINTC>; }; - mmchs0@4809C000 { + mmchs0@48060000 { compatible = "ti,mmchs"; reg =<0x48060000 0x1000 >; interrupts = <64>; @@ -115,6 +114,15 @@ mmchs-device-id = <0>; }; + mmchs1@481D8000 { + compatible = "ti,mmchs"; + reg =<0x481D8000 0x1000 >; + interrupts = <28>; + interrupt-parent = <&AINTC>; + mmchs-device-id = <1>; + status = "disabled"; + }; + enet0: ethernet@4A100000 { #address-cells = <1>; #size-cells = <1>; Copied and modified: head/sys/boot/fdt/dts/beaglebone-black.dts (from r250434, head/sys/boot/fdt/dts/beaglebone.dts) ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Fri May 10 04:49:40 2013 (r250434, copy source) +++ head/sys/boot/fdt/dts/beaglebone-black.dts Fri May 10 05:34:08 2013 (r250435) @@ -31,7 +31,9 @@ /include/ "am335x.dtsi" / { - model = "beaglebone"; + model = "beaglebone-black"; + compatible = "beaglebone-black", "beaglebone", "ti,am335x"; + aliases { soc = &SOC; @@ -40,7 +42,7 @@ memory { device_type = "memory"; - reg = < 0x80000000 0x10000000 >; /* 256MB RAM */ + reg = < 0x80000000 0x20000000 >; /* 512MB RAM */ }; am335x { @@ -73,18 +75,21 @@ "MMC0_DAT1", "mmc0_dat1", "input_pullup", "MMC0_DAT2", "mmc0_dat2", "input_pullup", "MMC0_DAT3", "mmc0_dat3", "input_pullup", + /* MMC1 */ + "GPMC_CSn1", "mmc1_clk", "input_pulldown", + "GPMC_CSn2", "mmc1_cmd", "input_pulldown", + "GPMC_AD0", "mmc1_dat0", "input_pulldown", + "GPMC_AD1", "mmc1_dat1", "input_pulldown", + "GPMC_AD2", "mmc1_dat2", "input_pulldown", + "GPMC_AD3", "mmc1_dat3", "input_pulldown", + "GPMC_AD4", "mmc1_dat4", "input_pulldown", + "GPMC_AD5", "mmc1_dat5", "input_pulldown", + "GPMC_AD6", "mmc1_dat6", "input_pulldown", + "GPMC_AD7", "mmc1_dat7", "input_pulldown", /* GPIO */ "ECAP0_IN_PWM0_OUT", "gpio0_7", "input_pulldown", "GPMC_AD10", "gpio0_26", "input_pulldown", "GPMC_AD11", "gpio0_27", "input_pulldown", - "GPMC_AD0", "gpio1_0", "input_pulldown", - "GPMC_AD1", "gpio1_1", "input_pulldown", - "GPMC_AD2", "gpio1_2", "input_pulldown", - "GPMC_AD3", "gpio1_3", "input_pulldown", - "GPMC_AD4", "gpio1_4", "input_pulldown", - "GPMC_AD5", "gpio1_5", "input_pulldown", - "GPMC_AD6", "gpio1_6", "input_pulldown", - "GPMC_AD7", "gpio1_7", "input_pulldown", "GPMC_AD12", "gpio1_12", "input_pulldown", "GPMC_AD13", "gpio1_13", "input_pulldown", "GPMC_AD14", "gpio1_14", "input_pulldown", @@ -97,8 +102,6 @@ "GPMC_A8", "gpio1_24", "output", /* User LED 4 */ "GPMC_BEn1", "gpio1_28", "input_pulldown", "GPMC_CSn0", "gpio1_29", "input_pulldown", - "GPMC_CSn1", "gpio1_30", "input_pulldown", - "GPMC_CSn2", "gpio1_31", "input_pulldown", "GPMC_CLK", "gpio2_1", "input_pulldown", "LCD_DATA0", "gpio2_6", "input_pulldown", "LCD_DATA1", "gpio2_7", "input_pulldown", @@ -125,6 +128,11 @@ "GPMC_AD8", "ehrpwm2A", "output", "GPMC_AD9", "ehrpwm2B", "output"; }; + + mmchs1@481D8000 { + status = "ok"; + }; + i2c@44e0b000 { pmic@24 { Modified: head/sys/boot/fdt/dts/beaglebone.dts ============================================================================== --- head/sys/boot/fdt/dts/beaglebone.dts Fri May 10 04:49:40 2013 (r250434) +++ head/sys/boot/fdt/dts/beaglebone.dts Fri May 10 05:34:08 2013 (r250435) @@ -32,6 +32,7 @@ / { model = "beaglebone"; + compatible = "beaglebone", "ti,am335x"; aliases { soc = &SOC; From owner-svn-src-all@FreeBSD.ORG Fri May 10 06:14:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAD5DF09; Fri, 10 May 2013 06:14:14 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 71C43F8D; Fri, 10 May 2013 06:14:14 +0000 (UTC) Received: from [207.6.254.8] (helo=[192.168.1.66]) by id.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Uagaj-0006zn-9V; Thu, 09 May 2013 23:14:07 -0700 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250435 - head/sys/boot/fdt/dts From: Oleksandr Tymoshenko In-Reply-To: <201305100534.r4A5Y8qQ019091@svn.freebsd.org> Date: Thu, 9 May 2013 23:13:46 -0700 Content-Transfer-Encoding: 7bit Message-Id: <5949F774-BC61-429B-BC85-70D51D9D1B64@freebsd.org> References: <201305100534.r4A5Y8qQ019091@svn.freebsd.org> To: Tim Kientzle X-Mailer: Apple Mail (2.1503) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 2013-05-09, at 10:34 PM, Tim Kientzle wrote: > Author: kientzle > Date: Fri May 10 05:34:08 2013 > New Revision: 250435 > URL: http://svnweb.freebsd.org/changeset/base/250435 > > Log: > Move 'compatible' line out of the common am335x.dtsi and into > the beaglebone-specific .dts file. > > Add a new .dts for the BeagleBone Black with more memory, > slightly different pinmux initialization, and with mmchs1 > configured (though the latter doesn't quite work yet). [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 06:14:14 -0000 On 2013-05-09, at 10:34 PM, Tim Kientzle wrote: > Author: kientzle > Date: Fri May 10 05:34:08 2013 > New Revision: 250435 > URL: http://svnweb.freebsd.org/changeset/base/250435 > > Log: > Move 'compatible' line out of the common am335x.dtsi and into > the beaglebone-specific .dts file. > > Add a new .dts for the BeagleBone Black with more memory, > slightly different pinmux initialization, and with mmchs1 > configured (though the latter doesn't quite work yet). Thanks for sorting this out, Tim. From owner-svn-src-all@FreeBSD.ORG Fri May 10 06:28:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2341B318; Fri, 10 May 2013 06:28:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14CE3A6; Fri, 10 May 2013 06:28:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A6S1g6037008; Fri, 10 May 2013 06:28:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A6S1nt037007; Fri, 10 May 2013 06:28:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201305100628.r4A6S1nt037007@svn.freebsd.org> From: Warner Losh Date: Fri, 10 May 2013 06:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250436 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 06:28:02 -0000 Author: imp Date: Fri May 10 06:28:01 2013 New Revision: 250436 URL: http://svnweb.freebsd.org/changeset/base/250436 Log: Make the read/write routines default to the newer DS1337 part, but keep the supported bits board specific. Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h Modified: head/sys/contrib/octeon-sdk/cvmx-rtc.h ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-rtc.h Fri May 10 05:34:08 2013 (r250435) +++ head/sys/contrib/octeon-sdk/cvmx-rtc.h Fri May 10 06:28:01 2013 (r250436) @@ -126,18 +126,9 @@ static inline uint32_t cvmx_rtc_read(voi return cvmx_rtc_ds1374_read(); break; - case CVMX_BOARD_TYPE_EBH3000: - case CVMX_BOARD_TYPE_CN3010_EVB_HS5: - case CVMX_BOARD_TYPE_EBH5200: -#if defined(OCTEON_VENDOR_GEFES) - case CVMX_BOARD_TYPE_CUST_W63XX: -#endif + default: return cvmx_rtc_ds1337_read(); break; - - default: - return 0; - break; } } @@ -156,18 +147,9 @@ static inline uint32_t cvmx_rtc_write(ui return cvmx_rtc_ds1374_write(time); break; - case CVMX_BOARD_TYPE_EBH3000: - case CVMX_BOARD_TYPE_CN3010_EVB_HS5: - case CVMX_BOARD_TYPE_EBH5200: -#if defined(OCTEON_VENDOR_GEFES) - case CVMX_BOARD_TYPE_CUST_W63XX: -#endif + default: return cvmx_rtc_ds1337_write(time); break; - - default: - return 0; - break; } } From owner-svn-src-all@FreeBSD.ORG Fri May 10 07:42:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1BD2E798; Fri, 10 May 2013 07:42:35 +0000 (UTC) Date: Fri, 10 May 2013 07:42:35 +0000 From: Alexey Dokuchaev To: Eitan Adler Subject: Re: svn commit: r250430 - head/sbin/dmesg Message-ID: <20130510074235.GA19945@FreeBSD.org> References: <201305100342.r4A3gmc9080595@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305100342.r4A3gmc9080595@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 07:42:35 -0000 On Fri, May 10, 2013 at 03:42:48AM +0000, Eitan Adler wrote: > New Revision: 250430 > URL: http://svnweb.freebsd.org/changeset/base/250430 > > @@ -79,15 +80,20 @@ main(int argc, char *argv[]) > kvm_t *kd; > size_t buflen, bufpos; > long pri; > - int all, ch; > + int ch, clear; > + bool all; > > - all = 0; > + all = false; > + clear = false; > (void) setlocale(LC_CTYPE, ""); It's a bit weird that you've left the cast here... > @@ -190,12 +196,16 @@ main(int argc, char *argv[]) > (void)strvisx(visbp, p, nextp - p, 0); > (void)printf("%s", visbp); ... and here (also: notice inconsistent spacing), > } > + if (clear) > + if (sysctlbyname("kern.msgbuf_clear", NULL, NULL, &clear, sizeof(int))) > + err(1, "sysctl kern.msgbuf_clear"); > + > exit(0); > } > > void > usage(void) > { > - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); > + fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); but removed it here for no particular reason. ./danfe From owner-svn-src-all@FreeBSD.ORG Fri May 10 07:51:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 86568A23 for ; Fri, 10 May 2013 07:51:16 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) by mx1.freebsd.org (Postfix) with ESMTP id 1062E7C4 for ; Fri, 10 May 2013 07:51:15 +0000 (UTC) Received: by mail-la0-f52.google.com with SMTP id fm20so3706180lab.11 for ; Fri, 10 May 2013 00:51:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=6cON1t5I+4TLaoAoMw+V6/HhG9XxRhlrzw/b7Oxc1Qc=; b=aPdV5HdNKRPo+R5CubO1SNRV8SX7l2XPMv6ZR3DFnrctbp9vn7Ewyp8vGv/Ci0/++W O4TN0sknQ8hS+ApEITCr4l+EEjDT0cnhc+Xmawj68Vl0SXY+LyU45to0KGOSP9U9zn5a sPt70WeKZ6oLd21d++qjtljirKYGii0Fz410O24zKU0fOyPdljmiJgQF2j0l5in7DZdV CT9qV3trmM9GUQzALZTsxDwUM2NcEpjRgND4/Z98j6mEMNx0i4zAXPKnEc2KMP7g2cPu fMdlTEscuCh2HuWdQfJXkCzpIhREqVn7xoKuyYOO4zdHm7X8wU41CGWp7UrJmSV73sQn N3eQ== X-Received: by 10.112.72.233 with SMTP id g9mr6986525lbv.131.1368172274917; Fri, 10 May 2013 00:51:14 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.128.67 with HTTP; Fri, 10 May 2013 00:50:54 -0700 (PDT) In-Reply-To: <201305100349.r4A3n5qh081766@svn.freebsd.org> References: <201305100349.r4A3n5qh081766@svn.freebsd.org> From: Juli Mallett Date: Fri, 10 May 2013 00:50:54 -0700 X-Google-Sender-Auth: pTpyFMROmDahDcGrLM_HEFW5fVg Message-ID: Subject: Re: svn commit: r250431 - head/usr.bin/xargs To: Eitan Adler Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlaGjl/gQHlbph2AsbyEWuu84pa12+t8Nfk/h7RTcbH5POaA6q7Awto52K5f+nxF09NDiPy Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 07:51:16 -0000 Eitan, Are other changes coming to xargs for which these style changes make sense? If not, I'd say that style changes which only adjust vertical whitespace, especially those which mostly add vertical whitespace at the start of functions with no local variables (which is one of the most archaic and unusual things style(9) requires), are probably the most gratuitous and silly style changes to make. That doesn't even rise to being a style change, it's just a whitespace change. And I really do believe that vertical whitespace changes are much, much sillier than horizontal whitespace changes. Curious what the motivation was here; was xargs the only utility in usr.bin which didn't conform to style(9) in this regard? (No.) Was this part of a tree-wide sweep to finally bring conformity to these rules? (I hope not.) What's the point?* Juli. *: Not that I've never made changes equally-gratuitous; I certainly have, and so would more strongly discourage people from making them given the regret and embarrassment I feel about having done so with the aid of years of hindsight, and a greater awareness of how easy it is to make minor functional improvements, or at least do refactoring with some purpose in mind, if one just wants to leave one's thumbprint. (Watch for standalone commits from people who used to be very active developers who have recently hit the threshold for getting commit bit reaper E-Mails. They're fairly instructive in the art of making occasional insignificant changes for the sake of making changes.) On Thu, May 9, 2013 at 8:49 PM, Eitan Adler wrote: > Author: eadler > Date: Fri May 10 03:49:05 2013 > New Revision: 250431 > URL: http://svnweb.freebsd.org/changeset/base/250431 > > Log: > Style(9) changes fo xargs.c > > Modified: > head/usr.bin/xargs/xargs.c > > Modified: head/usr.bin/xargs/xargs.c > ============================================================================== > --- head/usr.bin/xargs/xargs.c Fri May 10 03:42:48 2013 (r250430) > +++ head/usr.bin/xargs/xargs.c Fri May 10 03:49:05 2013 (r250431) > @@ -670,12 +670,14 @@ pids_init(void) > static int > pids_empty(void) > { > + > return (curprocs == 0); > } > > static int > pids_full(void) > { > + > return (curprocs >= maxprocs); > } > > @@ -709,7 +711,6 @@ findfreeslot(void) > > if ((slot = findslot(NOPID)) < 0) > errx(1, "internal error: no free pid slot"); > - > return (slot); > } > > @@ -721,13 +722,13 @@ findslot(pid_t pid) > for (slot = 0; slot < maxprocs; slot++) > if (childpids[slot] == pid) > return (slot); > - > return (-1); > } > > static void > clearslot(int slot) > { > + > childpids[slot] = NOPID; > } > > @@ -762,6 +763,7 @@ prompt(void) > static void > usage(void) > { > + > fprintf(stderr, > "usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements] [-S replsize]]\n" > " [-J replstr] [-L number] [-n number [-x]] [-P maxprocs]\n" From owner-svn-src-all@FreeBSD.ORG Fri May 10 08:46:11 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28565715; Fri, 10 May 2013 08:46:11 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4FEA9E; Fri, 10 May 2013 08:46:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A8kAd0086433; Fri, 10 May 2013 08:46:10 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A8kAW3086432; Fri, 10 May 2013 08:46:10 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305100846.r4A8kAW3086432@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 10 May 2013 08:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250441 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 08:46:11 -0000 Author: luigi Date: Fri May 10 08:46:10 2013 New Revision: 250441 URL: http://svnweb.freebsd.org/changeset/base/250441 Log: another minor bugfix in the memory allocator, this time in the free routine. Modified: head/sys/dev/netmap/netmap_mem2.c Modified: head/sys/dev/netmap/netmap_mem2.c ============================================================================== --- head/sys/dev/netmap/netmap_mem2.c Fri May 10 06:46:52 2013 (r250440) +++ head/sys/dev/netmap/netmap_mem2.c Fri May 10 08:46:10 2013 (r250441) @@ -381,7 +381,7 @@ netmap_obj_free_va(struct netmap_obj_poo ssize_t relofs = (ssize_t) vaddr - (ssize_t) base; /* Given address, is out of the scope of the current cluster.*/ - if (vaddr < base || relofs > p->_clustsize) + if (vaddr < base || relofs >= p->_clustsize) continue; j = j + relofs / p->_objsize; From owner-svn-src-all@FreeBSD.ORG Fri May 10 09:37:58 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4E575F0; Fri, 10 May 2013 09:37:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D5916D86; Fri, 10 May 2013 09:37:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A9bwcs004736; Fri, 10 May 2013 09:37:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A9bwNq004735; Fri, 10 May 2013 09:37:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305100937.r4A9bwNq004735@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 May 2013 09:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250442 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 09:37:59 -0000 Author: adrian Date: Fri May 10 09:37:58 2013 New Revision: 250442 URL: http://svnweb.freebsd.org/changeset/base/250442 Log: Fix a VAP BSS node reference in the HT code to actually take a reference before using said node. The "blessed" way here is to take a node reference before referencing anything inside the node, otherwise the node can be freed between the time the pointer is copied/dereferenced and the time the node contents are used. This mirrors fixes that I've done elsewhere in the net80211/driver stack. PR: kern/178470 Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Fri May 10 08:46:10 2013 (r250441) +++ head/sys/net80211/ieee80211_ht.c Fri May 10 09:37:58 2013 (r250442) @@ -2773,11 +2773,15 @@ ieee80211_ht_update_beacon(struct ieee80 struct ieee80211_beacon_offsets *bo) { #define PROTMODE (IEEE80211_HTINFO_OPMODE|IEEE80211_HTINFO_NONHT_PRESENT) - const struct ieee80211_channel *bsschan = vap->iv_bss->ni_chan; + struct ieee80211_node *ni; + const struct ieee80211_channel *bsschan; struct ieee80211com *ic = vap->iv_ic; struct ieee80211_ie_htinfo *ht = (struct ieee80211_ie_htinfo *) bo->bo_htinfo; + ni = ieee80211_ref_node(vap->iv_bss); + bsschan = ni->ni_chan; + /* XXX only update on channel change */ ht->hi_ctrlchannel = ieee80211_chan2ieee(ic, bsschan); if (vap->iv_flags_ht & IEEE80211_FHT_RIFS) @@ -2796,6 +2800,8 @@ ieee80211_ht_update_beacon(struct ieee80 /* protection mode */ ht->hi_byte2 = (ht->hi_byte2 &~ PROTMODE) | ic->ic_curhtprotmode; + ieee80211_free_node(ni); + /* XXX propagate to vendor ie's */ #undef PROTMODE } From owner-svn-src-all@FreeBSD.ORG Fri May 10 09:58:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11141950; Fri, 10 May 2013 09:58:33 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 036CAE33; Fri, 10 May 2013 09:58:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4A9wWGh011615; Fri, 10 May 2013 09:58:32 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4A9wWPd011614; Fri, 10 May 2013 09:58:32 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201305100958.r4A9wWPd011614@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 10 May 2013 09:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250443 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 09:58:33 -0000 Author: jh Date: Fri May 10 09:58:32 2013 New Revision: 250443 URL: http://svnweb.freebsd.org/changeset/base/250443 Log: Check the return value of sbuf_finish(). MFC after: 1 week Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Fri May 10 09:37:58 2013 (r250442) +++ head/usr.sbin/ctladm/ctladm.c Fri May 10 09:58:32 2013 (r250443) @@ -546,7 +546,8 @@ retry: } if (xml != 0) { sbuf_printf(sb, "\n"); - sbuf_finish(sb); + if (sbuf_finish(sb) != 0) + err(1, "%s: sbuf_finish", __func__); printf("%s", sbuf_data(sb)); sbuf_delete(sb); } @@ -3493,7 +3494,8 @@ cctl_end_element(void *user_data, const errx(1, "%s: no valid sbuf at level %d (name %s)", __func__, devlist->level, name); - sbuf_finish(devlist->cur_sb[devlist->level]); + if (sbuf_finish(devlist->cur_sb[devlist->level]) != 0) + err(1, "%s: sbuf_finish", __func__); str = strdup(sbuf_data(devlist->cur_sb[devlist->level])); if (str == NULL) err(1, "%s can't allocate %zd bytes for string", __func__, From owner-svn-src-all@FreeBSD.ORG Fri May 10 10:06:46 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BC146DBA; Fri, 10 May 2013 10:06:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94A3EEB8; Fri, 10 May 2013 10:06:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AA6kur015138; Fri, 10 May 2013 10:06:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AA6kRh015135; Fri, 10 May 2013 10:06:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201305101006.r4AA6kRh015135@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 May 2013 10:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250444 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 10:06:46 -0000 Author: adrian Date: Fri May 10 10:06:45 2013 New Revision: 250444 URL: http://svnweb.freebsd.org/changeset/base/250444 Log: Make sure the holding descriptor and link pointer are both freed during a non-loss reset. When the drain functions are called, the holding descriptor and link pointers are NULLed out. But when the processq function is called during a non-loss reset, this doesn't occur. So the next time a DMA occurs, it's chained to a descriptor that no longer exists and the hardware gets angry. Tested: * AR5416, STA mode; use sysctl dev.ath.X.forcebstuck=1 to force a non-loss reset. TODO: * Further AR9380 testing just to check that the behaviour for the EDMA chips is sane. PR: kern/178477 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 10 09:58:32 2013 (r250443) +++ head/sys/dev/ath/if_ath.c Fri May 10 10:06:45 2013 (r250444) @@ -4668,9 +4668,21 @@ ath_legacy_tx_drain(struct ath_softc *sc if (sc->sc_debug & ATH_DEBUG_RESET) ath_tx_dump(sc, &sc->sc_txq[i]); #endif /* ATH_DEBUG */ - if (reset_type == ATH_RESET_NOLOSS) + if (reset_type == ATH_RESET_NOLOSS) { ath_tx_processq(sc, &sc->sc_txq[i], 0); - else + ATH_TXQ_LOCK(&sc->sc_txq[i]); + /* + * Free the holding buffer; DMA is now + * stopped. + */ + ath_txq_freeholdingbuf(sc, &sc->sc_txq[i]); + /* + * Reset the link pointer to NULL; there's + * no frames to chain DMA to. + */ + sc->sc_txq[i].axq_link = NULL; + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } else ath_tx_draintxq(sc, &sc->sc_txq[i]); } } Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Fri May 10 09:58:32 2013 (r250443) +++ head/sys/dev/ath/if_ath_tx_edma.c Fri May 10 10:06:45 2013 (r250444) @@ -551,6 +551,22 @@ ath_edma_tx_drain(struct ath_softc *sc, */ if (reset_type == ATH_RESET_NOLOSS) { ath_edma_tx_processq(sc, 0); + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + ATH_TXQ_LOCK(&sc->sc_txq[i]); + /* + * Free the holding buffer; DMA is now + * stopped. + */ + ath_txq_freeholdingbuf(sc, &sc->sc_txq[i]); + /* + * Reset the link pointer to NULL; there's + * no frames to chain DMA to. + */ + sc->sc_txq[i].axq_link = NULL; + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } + } } else { for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { if (ATH_TXQ_SETUP(sc, i)) From owner-svn-src-all@FreeBSD.ORG Fri May 10 10:21:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA95840F; Fri, 10 May 2013 10:21:45 +0000 (UTC) (envelope-from smckay@internode.on.net) Received: from ipmail06.adl2.internode.on.net (ipmail06.adl2.internode.on.net [IPv6:2001:44b8:8060:ff02:300:1:2:6]) by mx1.freebsd.org (Postfix) with ESMTP id 70891F55; Fri, 10 May 2013 10:21:44 +0000 (UTC) Received: from vm-mail26.internode.on.net (HELO localhost) ([150.101.137.111]) by ipmail06.adl2.internode.on.net with ESMTP; 10 May 2013 19:51:43 +0930 MIME-Version: 1.0 X-Mailer: AtMail PHP 5.3 Message-ID: <65172.1368181303@internode.on.net> To: "Eitan Adler" , "Juli Mallett" Content-Type: text/plain; charset="utf-8" X-Origin: 144.131.35.110 X-Atmail-Account: smckay@internode.on.net Date: Fri, 10 May 2013 19:51:43 +0930 Subject: Re: svn commit: r250431 - head/usr.bin/xargs From: smckay@internode.on.net Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: smckay@internode.on.net List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 10:21:45 -0000 =20 =20 On Fri 10/05/13 17:50 , Juli Mallett jmallett@FreeBSD.org sent:=20 > Eitan,=20 >=20=20 > Are other changes coming to xargs for which these style changes make=20 > sense? If not, I'd say that style changes which only adjust vertical=20 > whitespace, especially those which mostly add vertical whitespace at=20 > the start of functions with no local variables (which is one of the=20 > most archaic and unusual things style(9) requires), are probably the=20 > most gratuitous and silly style changes to make. That doesn't even=20 > rise to being a style change, it's just a whitespace change. And I=20 > really do believe that vertical whitespace changes are much, much=20 > sillier than horizontal whitespace changes.=20 =20 Juli, it seems we're bothered by the same thing here: that at least=20 some of the vertical white space requirements of style(9) are=20 silly and (rightly) widely ignored. So I think we should change=20 the guide to fix this rather than damaging a lot of perfectly=20 readable code.=20 =20 I'd like to emphasise that I'm not even slightly cranky at Eitan for=20 his commit since we committers are presumed to have agreed to follow=20 style(9) and he's just changing code to match the official style. My=20 complaint is that the official style isn't useful in this small regard=20 and should be changed.=20 =20 > (Watch for standalone commits from people who used to be=20 > very active developers who have recently hit the threshold for getting=20 > commit bit reaper E-Mails. They're fairly instructive in the art of=20 > making occasional insignificant changes for the sake of making=20 > changes.)=20 =20 Well, I used to be a low activity developer and have transitioned to=20 being a very low activity developer, so I know the reaper and the=20 temptation of a quick fix to get it off your back. However it's better=20 to let the reaper pester you than to make a low quality commit. After=20 all, if you haven't anything new and interesting to add, there is always=20 that convenient list of bugs that could be fixed...=20 =20 Cheers,=20 =20 Stephen.=20 From owner-svn-src-all@FreeBSD.ORG Fri May 10 12:44:07 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D188AB61 for ; Fri, 10 May 2013 12:44:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-da0-x22a.google.com (mail-da0-x22a.google.com [IPv6:2607:f8b0:400e:c00::22a]) by mx1.freebsd.org (Postfix) with ESMTP id AB62C7A2 for ; Fri, 10 May 2013 12:44:07 +0000 (UTC) Received: by mail-da0-f42.google.com with SMTP id r6so2212892dad.29 for ; Fri, 10 May 2013 05:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=6W1EL1mIL7G7tZ2U7BFbzKuFNlMLw0HxhYs/CBKnjXc=; b=jQMzD6JWt1WumkjVSc3ko3tH7B5P8Q9/JFKnp+f4dErhf7zV2sKSWCcfwvp2E7idAG Cd2YXalQroHn8asXetBDIVz28RcySvC7ADi4Cr5gyJAeHQGLpeIXDUmU531YhHn47mvd b7bkO1fEHnHPxAYVUYcUyt6R6eNqRp8ChkwcE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=6W1EL1mIL7G7tZ2U7BFbzKuFNlMLw0HxhYs/CBKnjXc=; b=QlbbrEmiGpPFs/0ZCWXcHjSVkJ1CdjqFZsfwUhAdftMQMMR07pksUj/H4LLt87Lckw wLGRL8Bq3oGjPLWor+KF3zcXKULfmeJAkwU5Z2X0LQ8QcTEubBZVutg/u/Redj3QewFT KSRZk5lRQ7oYI2RqU62l+y8jznc3wM9dLX2f/NB1LSdy3F5A7ZrAjZX0sZkKTiIAXSWf 0z6COWzuwQnI6zjfUkWlMQ/Y0FFY3AMl1AKS3OEpj/KUvolxrOWBHp16PMP7VPd8etiB 4xDGLLl0LUOqrBCfg/NCd7YvIwmpk/KHXC53heKm5G56+fWhHEBHPvx+PeCtfK6zUNZh BDUg== X-Received: by 10.66.121.234 with SMTP id ln10mr16909965pab.129.1368189847447; Fri, 10 May 2013 05:44:07 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 10 May 2013 05:43:37 -0700 (PDT) In-Reply-To: <20130510074235.GA19945@FreeBSD.org> References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> From: Eitan Adler Date: Fri, 10 May 2013 08:43:37 -0400 X-Google-Sender-Auth: Su1AY8ekaWXjIILs86R-Kc4_hQc Message-ID: Subject: Re: svn commit: r250430 - head/sbin/dmesg To: Alexey Dokuchaev Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkIeulJ0JVzYwFRwxRLn5YabMsX2BY2WWPStPylONAVwGaJD0pPMyOj5dyS9qnvj1xXhb9h Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 12:44:07 -0000 On 10 May 2013 03:42, Alexey Dokuchaev wrote: > On Fri, May 10, 2013 at 03:42:48AM +0000, Eitan Adler wrote: >> New Revision: 250430 >> URL: http://svnweb.freebsd.org/changeset/base/250430 >> >> @@ -79,15 +80,20 @@ main(int argc, char *argv[]) >> kvm_t *kd; >> size_t buflen, bufpos; >> long pri; >> - int all, ch; >> + int ch, clear; >> + bool all; >> >> - all = 0; >> + all = false; >> + clear = false; >> (void) setlocale(LC_CTYPE, ""); > > It's a bit weird that you've left the cast here... I didn't modify this line > > ... and here (also: notice inconsistent spacing), Or this one. >> void >> usage(void) >> { >> - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); >> + fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); > > but removed it here for no particular reason. Notice the additional 'c' in usage(). -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri May 10 12:49:17 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39173ED8; Fri, 10 May 2013 12:49:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B0C07ED; Fri, 10 May 2013 12:49:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ACnGkE071849; Fri, 10 May 2013 12:49:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ACnGh6071847; Fri, 10 May 2013 12:49:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101249.r4ACnGh6071847@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 12:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250451 - in head: sbin/dmesg usr.bin/split X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 12:49:17 -0000 Author: eadler Date: Fri May 10 12:49:16 2013 New Revision: 250451 URL: http://svnweb.freebsd.org/changeset/base/250451 Log: Bump .Dd for recent content change. Reported by: delphij Modified: head/sbin/dmesg/dmesg.8 head/usr.bin/split/split.1 Modified: head/sbin/dmesg/dmesg.8 ============================================================================== --- head/sbin/dmesg/dmesg.8 Fri May 10 11:17:58 2013 (r250450) +++ head/sbin/dmesg/dmesg.8 Fri May 10 12:49:16 2013 (r250451) @@ -28,7 +28,7 @@ .\" @(#)dmesg.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 5, 1993 +.Dd May 9, 2013 .Dt DMESG 8 .Os .Sh NAME Modified: head/usr.bin/split/split.1 ============================================================================== --- head/usr.bin/split/split.1 Fri May 10 11:17:58 2013 (r250450) +++ head/usr.bin/split/split.1 Fri May 10 12:49:16 2013 (r250451) @@ -28,7 +28,7 @@ .\" @(#)split.1 8.3 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd September 2, 2010 +.Dd May 9, 2013 .Dt SPLIT 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri May 10 13:09:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 591D84EB; Fri, 10 May 2013 13:09:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49354890; Fri, 10 May 2013 13:09:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AD9jtS079186; Fri, 10 May 2013 13:09:45 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AD9jgK079185; Fri, 10 May 2013 13:09:45 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305101309.r4AD9jgK079185@svn.freebsd.org> From: Bryan Drewery Date: Fri, 10 May 2013 13:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250452 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 13:09:45 -0000 Author: bdrewery (ports committer) Date: Fri May 10 13:09:44 2013 New Revision: 250452 URL: http://svnweb.freebsd.org/changeset/base/250452 Log: MFC r249807,249893 Fix installkernel requiring users/groups defined in CHECK_UIDS and CHECK_GIDS to exist since r152680. This is only needed for installworld. The documented procedure of running mergemaster -p to check for missing users is only needed for installworld, not for installkernel. This fixes auditdistd incorrectly being required for installkernel. PR: misc/174405 Modified: stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri May 10 12:49:16 2013 (r250451) +++ stable/9/Makefile.inc1 Fri May 10 13:09:44 2013 (r250452) @@ -600,6 +600,7 @@ kernel-toolchain: ${TOOLCHAIN_TGTS:N_inc # Checks to be sure system is ready for installworld/installkernel. # installcheck: +installcheck_UGID: # # Require DESTDIR to be set if installing for a different architecture or @@ -631,7 +632,6 @@ CHECK_GIDS+= smmsp CHECK_UIDS+= proxy CHECK_GIDS+= proxy authpf .endif -installcheck: installcheck_UGID installcheck_UGID: .for uid in ${CHECK_UIDS} @if ! `id -u ${uid} >/dev/null 2>&1`; then \ @@ -685,7 +685,7 @@ EXTRA_DISTRIBUTIONS+= games EXTRA_DISTRIBUTIONS+= lib32 .endif -distributeworld installworld: installcheck +distributeworld installworld: installcheck installcheck_UGID mkdir -p ${INSTALLTMP} progs=$$(for prog in ${ITOOLS}; do \ if progpath=`which $$prog`; then \ From owner-svn-src-all@FreeBSD.ORG Fri May 10 13:36:37 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id CFD8E119; Fri, 10 May 2013 13:36:37 +0000 (UTC) Date: Fri, 10 May 2013 13:36:37 +0000 From: Alexey Dokuchaev To: Eitan Adler Subject: Re: svn commit: r250430 - head/sbin/dmesg Message-ID: <20130510133637.GA1679@FreeBSD.org> References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 13:36:37 -0000 On Fri, May 10, 2013 at 08:43:37AM -0400, Eitan Adler wrote: > On 10 May 2013 03:42, Alexey Dokuchaev wrote: > > On Fri, May 10, 2013 at 03:42:48AM +0000, Eitan Adler wrote: > >> New Revision: 250430 > >> URL: http://svnweb.freebsd.org/changeset/base/250430 > >> > >> (void) setlocale(LC_CTYPE, ""); > > > > It's a bit weird that you've left the cast here... > > I didn't modify this line OK. > >> - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); > >> + fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); > > > > but removed it here for no particular reason. > > Notice the additional 'c' in usage(). Of course. But my question was about dropping the cast, not adding new option. Adding a new option should have resulted in the following diff: - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); + (void)fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); ./danfe From owner-svn-src-all@FreeBSD.ORG Fri May 10 13:57:45 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC445940; Fri, 10 May 2013 13:57:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF272AE8; Fri, 10 May 2013 13:57:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ADvjG9096474; Fri, 10 May 2013 13:57:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ADvjvD096473; Fri, 10 May 2013 13:57:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101357.r4ADvjvD096473@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 13:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250453 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 13:57:45 -0000 Author: eadler Date: Fri May 10 13:57:44 2013 New Revision: 250453 URL: http://svnweb.freebsd.org/changeset/base/250453 Log: Bring /etc/protocols up to date. PR: conf/175397 Submitted by: ak Modified: head/etc/protocols Modified: head/etc/protocols ============================================================================== --- head/etc/protocols Fri May 10 13:09:44 2013 (r250452) +++ head/etc/protocols Fri May 10 13:57:44 2013 (r250453) @@ -92,6 +92,7 @@ vmtp 81 VMTP # Versatile Message Transp secure-vmtp 82 SECURE-VMTP # SECURE-VMTP vines 83 VINES # VINES ttp 84 TTP # TTP +#iptm 84 IPTM # Protocol Internet Protocol Traffic nsfnet-igp 85 NSFNET-IGP # NSFNET-IGP dgp 86 DGP # Dissimilar Gateway Protocol tcf 87 TCF # TCF @@ -145,7 +146,13 @@ rsvp-e2e-ignore 134 RSVP-E2E-IGNORE # Ag mobility-header 135 Mobility-Header # Mobility Support in IPv6 udplite 136 UDPLite # The UDP-Lite Protocol mpls-in-ip 137 MPLS-IN-IP # Encapsulating MPLS in IP +manet 138 MANET # MANET Protocols (RFC5498) +hip 139 HIP # Host Identity Protocol (RFC5201) +shim6 140 SHIM6 # Shim6 Protocol (RFC5533) +wesp 141 WESP # Wrapped Encapsulating Security Payload (RFC5840) +rohc 142 ROHC # Robust Header Compression (RFC5858) # 138-254 # Unassigned pfsync 240 PFSYNC # PF Synchronization +# 253-254 # Use for experimentation and testing (RFC3692) # 255 # Reserved divert 258 DIVERT # Divert pseudo-protocol [non IANA] From owner-svn-src-all@FreeBSD.ORG Fri May 10 13:58:51 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A35EBAC3; Fri, 10 May 2013 13:58:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3D2AF6; Fri, 10 May 2013 13:58:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CDFB7B960; Fri, 10 May 2013 09:58:50 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Subject: Re: svn commit: r250411 - in head/sys: conf kern sys Date: Fri, 10 May 2013 09:52:44 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305091628.r49GSI33039873@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305100952.45101.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 10 May 2013 09:58:50 -0400 (EDT) Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 13:58:51 -0000 On Thursday, May 09, 2013 4:56:33 pm Marcel Moolenaar wrote: > > On May 9, 2013, at 9:46 AM, Attilio Rao wrote: > > > On Thu, May 9, 2013 at 6:28 PM, Marcel Moolenaar wrote: > >> Author: marcel > >> Date: Thu May 9 16:28:18 2013 > >> New Revision: 250411 > >> URL: http://svnweb.freebsd.org/changeset/base/250411 > >> > >> Log: > >> Add option WITNESS_NO_VNODE to suppress printing LORs between VNODE > >> locks. To support this, VNODE locks are created with the LK_IS_VNODE > >> flag. This flag is propagated down using the LO_IS_VNODE flag. > >> > >> Note that WITNESS still records the LOR. Only the printing and the > >> optional entering into the kernel debugger is bypassed with the > >> WITNESS_NO_VNODE option. > > > > This is the wrong way to deal with such problem and I avoided to do > > something like that on purpose. > > I disagree. We have known LOR messages between VNODE locks that > pollute the console and so far we haven't fixed the root cause > in some form or shape. Silencing this known case is good to > maximize the attention LORs need to be given while still have > witness involved to catch locking problems with vnodes that are > of a different nature. > > > > > The way to fix this is to implement LK_NOWITNESS on a per-lock basis > > into lockmgr, propagate the same concept to the vn_lock() (which > > should be basically done automatically) and finally identify the > > false-positive case and commit for them explicitely LK_NOWITNESS on a > > per-call basis, explaining in detail why the single case reported is a > > false-positive. > > This is worse. You want witness involved. Well, I disagree with both of you a bit. I mostly agree with Attilio in that the committed change is a really large sledgehammer. If we want to ignore all LORs for a large number of locks in the system we might as well remove WITNESS altogether. However, I think LK_NOWITNESS is also too large of a sledgehammer for this as well. AFAIK there are two vnode-related LORs that I can think of: 1) between bufwait vs dirhash (so not even vnode locks) which is well documented in ufs_dirhash.c. I would much prefer to add a flag (maybe have somethign set a flag in the thread) to disable witness checking for the few known safe reversals and let WITNESS still check all other operations for the relevant locks. 2) vnode locks from a local filesystem that report a LOR with a "devfs" vnode. Typical reports are either "ufs" -> "devfs" or in some cases "ufs" -> "devfs" -> "ufs". As with 1), I would much rather tag the offending location than to disable all WITNESS checking on vnode locks. I had originally thought of doing this by passing a flag in the relevant lock call, but that requires having a "flags" variant of all lock calls and passing the flag down, etc. While writing this I thought of an alternative which would be to have a WITNESS_SUSPEND/WITNESS_RESUME pair of macros that either set a per-thread flag that we can invoke around known cases where a reversal is ok. When witness is suspended it would still remember that the lock was acquired, but it would not report a LOR due to that acquisition (we may have to set a flag in the lock instance so that future LORs related to that acquisition are also ignored) and it would not learn any new orders from that acquisition. So in code it would look like: WITNESS_SUSPEND(); vn_lock(...); WITNESS_RESTORE(); Does this sound agreeable? If so, I definitely think Marcel's change should be reverted in favor of this (more general yet more fine-grained) approach instead. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 10 14:02:13 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85C83ECA for ; Fri, 10 May 2013 14:02:13 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x231.google.com (mail-pb0-x231.google.com [IPv6:2607:f8b0:400e:c01::231]) by mx1.freebsd.org (Postfix) with ESMTP id 5F42DB29 for ; Fri, 10 May 2013 14:02:13 +0000 (UTC) Received: by mail-pb0-f49.google.com with SMTP id rp2so100819pbb.36 for ; Fri, 10 May 2013 07:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=v7IBQH2AUEQDvVI7+PswhpGD1JGgn8Z3SzbkSOXOwpQ=; b=E33xfee9WuXA5rCJGlzAOR4LrRGM+29smMzAFWa81ZqMpp7PBqvoRQHCPvEq+rMYKR FUhohe3ldGUwwbX8qXCslXPnASa7OmEOd4BZDxD6AUBcTRXNjjYXdfteaAz1ttep1JNW QEAp9FQ5OcT6n2CYORIqdmOLZBSF5ECo80/EE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=v7IBQH2AUEQDvVI7+PswhpGD1JGgn8Z3SzbkSOXOwpQ=; b=dElSq0z9gKch2T7Zjr3nnw1h0aHbVtQPLLYTFLf2/iEpxx1jY7YkIL7PHIC+oKxNa7 fzAZIdpmVIRAUqQemkZM3M+buK8tsV9QixXlBynogyW4hXlfgK1rzD+WtjY1NoWCMWZ5 PmTob04BQkV0KrDsXxUlTLTHSOBXHxyhyrCC8soF/ptdHRwwKghSH79sNfhd0UPLCsUd BMxTXog1zuvjacNYkcAkoukX9OZ/ru/pBMW5XploKkPX04/v9bsYW+yN3REzLzsLgMgX mNipLDr0HvdeXnko+CZOUGDBdqX0IwgxlnIFDm2R4CMHp9qCLl6vEmVtqZc8OcfvM28c PRow== X-Received: by 10.68.97.130 with SMTP id ea2mr17040323pbb.129.1368194532876; Fri, 10 May 2013 07:02:12 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 10 May 2013 07:01:42 -0700 (PDT) In-Reply-To: <20130510133637.GA1679@FreeBSD.org> References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> <20130510133637.GA1679@FreeBSD.org> From: Eitan Adler Date: Fri, 10 May 2013 10:01:42 -0400 X-Google-Sender-Auth: elxpMuVP0fPhDBjqiqp-AAopEBI Message-ID: Subject: Re: svn commit: r250430 - head/sbin/dmesg To: Alexey Dokuchaev Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnFL/FRMwrgS3jpFfg2CG9FAPyGwmmdYzWpzdFQghsx0Re/x6tibJm7wXDKgElGBrY+Z4xV Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 14:02:13 -0000 On 10 May 2013 09:36, Alexey Dokuchaev wrote: > Of course. But my question was about dropping the cast, not adding new > option. Adding a new option should have resulted in the following diff: > > - (void)fprintf(stderr, "usage: dmesg [-a] [-M core [-N system]]\n"); > + (void)fprintf(stderr, "usage: dmesg [-ac] [-M core [-N system]]\n"); I thought style(9) disliked the leading (void) but I could be wrong. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri May 10 14:08:12 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC15C2E8; Fri, 10 May 2013 14:08:12 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) by mx1.freebsd.org (Postfix) with ESMTP id BF722BDA; Fri, 10 May 2013 14:08:12 +0000 (UTC) Received: from [172.20.9.19] ([12.202.122.2]) (authenticated bits=0) by theravensnest.org (8.14.5/8.14.5) with ESMTP id r4AE85Sr039804 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 10 May 2013 14:08:06 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r250430 - head/sbin/dmesg From: David Chisnall In-Reply-To: Date: Fri, 10 May 2013 10:08:05 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> <20130510133637.GA1679@FreeBSD.org> To: Eitan Adler X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@FreeBSD.org, Alexey Dokuchaev , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 14:08:13 -0000 On 10 May 2013, at 10:01, Eitan Adler wrote: > I thought style(9) disliked the leading (void) but I could be wrong. The cast to (void) tells the compiler that you are ignoring the return = result. Without it, you will introduce new warnings and break the build = on certain compiler versions with -Werror. David From owner-svn-src-all@FreeBSD.ORG Fri May 10 14:13:06 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 10A1254C for ; Fri, 10 May 2013 14:13:06 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by mx1.freebsd.org (Postfix) with ESMTP id DCC94C1E for ; Fri, 10 May 2013 14:13:05 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id hz10so2974928pad.30 for ; Fri, 10 May 2013 07:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=5ht09uj8lCFEdJ4ymD9Tbn3FZOdsq/y7R2DPmqkY454=; b=FtgesT11sIfeTGmJqn18e/Geehm/tJVVzxHk0vYwXVqnBP1e34abBxC5rAj9CI48Ao eGjxyTS/INavpgyu3bjorg4j13eYnsDcqoblrpsBivpgWi/lupRtUNhvbYr0cUEGUUj8 eoAO+cQ0AO0ZKlbvUDzBZbeG2FGAB5XWz+L2A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=5ht09uj8lCFEdJ4ymD9Tbn3FZOdsq/y7R2DPmqkY454=; b=Idapz269iQ47GiBw9bV3D9tRRq4/oJw259WK8RiTSnGIUhroPwMOsQOqSVaVx4RUpK jwX/7c5XqXpevXJjZtiPps6jITntgW2GL+55ZfDigjs3Brz4HZ0oqISaKJDTS0qPjxTu Dl04otKrwfwN2mIPX6dZZ+JFE9kl26eS8BCjrNjc8D22gwQLpKxO6rncb8cMpRxmMKwo 7FliJzFTq9ytray1AB7P2ByvS2a6FtNsoa8fN3pFsD2Q5WQPa67B/J5qiaxSu5CBb2y5 VfIj4VQDyk4za26bHDntIIb4MUYzfTLekW4c3KU8YeweFaPOI1M+/tsiC5eyjd0L/Q7N yU5g== X-Received: by 10.66.144.170 with SMTP id sn10mr17966495pab.42.1368195185344; Fri, 10 May 2013 07:13:05 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 10 May 2013 07:12:34 -0700 (PDT) In-Reply-To: References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> <20130510133637.GA1679@FreeBSD.org> From: Eitan Adler Date: Fri, 10 May 2013 10:12:34 -0400 X-Google-Sender-Auth: d9kKuQaI7SBuKSWtv2M9yE1sT9k Message-ID: Subject: Re: svn commit: r250430 - head/sbin/dmesg To: David Chisnall Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQlhm3fwFHq4zIE2zWFI8RimIMajwfcOiR9m+dUqp9o+iuR0zGfXbqTNB4d0T6jnXJg+Koc6 Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 14:13:06 -0000 On 10 May 2013 10:08, David Chisnall wrote: > On 10 May 2013, at 10:01, Eitan Adler wrote: > >> I thought style(9) disliked the leading (void) but I could be wrong. > > The cast to (void) tells the compiler that you are ignoring the return result. Without it, you will introduce new warnings and break the build on certain compiler versions with -Werror. I know why the (void) is there. lint(1) is the main program which cares about it. I don't remember any recent tool which uses that cast to remove errors. This has nothing to do with my change though. That said I remembered some prior discussion claiming that style(9) does not require them. A quick recheck shows (void)fprintf(stderr, "usage: f [-ab]\n"); as an example, so clearly I was wrong. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri May 10 14:14:36 2013 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E9DE89E; Fri, 10 May 2013 14:14:36 +0000 (UTC) (envelope-from dc552@hermes.cam.ac.uk) Received: from ppsw-42.csi.cam.ac.uk (ppsw-42.csi.cam.ac.uk [IPv6:2001:630:212:8::e:f42]) by mx1.freebsd.org (Postfix) with ESMTP id 15040C39; Fri, 10 May 2013 14:14:36 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from [12.202.122.2] (port=60930 helo=[172.20.9.19]) by ppsw-42.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (PLAIN:dc552) (TLSv1:AES128-SHA:128) id 1Uao5h-0006rW-8a (Exim 4.80_167-5a66dd3) (return-path ); Fri, 10 May 2013 15:14:35 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r250430 - head/sbin/dmesg From: David Chisnall In-Reply-To: Date: Fri, 10 May 2013 10:14:32 -0400 Content-Transfer-Encoding: 7bit Message-Id: <187FE41A-30AF-4F99-AD0E-9AAF83FDD947@cl.cam.ac.uk> References: <201305100342.r4A3gmc9080595@svn.freebsd.org> <20130510074235.GA19945@FreeBSD.org> <20130510133637.GA1679@FreeBSD.org> To: Eitan Adler X-Mailer: Apple Mail (2.1499) Sender: "Dr D. Chisnall" Cc: svn-src-head@FreeBSD.org, Alexey Dokuchaev , src-committers@FreeBSD.org, David Chisnall , svn-src-all@FreeBSD.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 14:14:36 -0000 On 10 May 2013, at 10:12, Eitan Adler wrote: > I don't remember any recent tool which uses that cast > to remove errors. clang -Wunused-result gcc -Wunused-result David From owner-svn-src-all@FreeBSD.ORG Fri May 10 15:46:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 50BD2F6A; Fri, 10 May 2013 15:46:56 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3B2290; Fri, 10 May 2013 15:46:55 +0000 (UTC) Received: from jsiegel-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.6/8.14.6) with ESMTP id r4AFkrgP001371 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 10 May 2013 08:46:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Marcel Moolenaar In-Reply-To: <201305100952.45101.jhb@freebsd.org> Date: Fri, 10 May 2013 08:46:54 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305100952.45101.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1503) Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 15:46:56 -0000 On May 10, 2013, at 6:52 AM, John Baldwin wrote: >>>=20 >>> The way to fix this is to implement LK_NOWITNESS on a per-lock basis >>> into lockmgr, propagate the same concept to the vn_lock() (which >>> should be basically done automatically) and finally identify the >>> false-positive case and commit for them explicitely LK_NOWITNESS on = a >>> per-call basis, explaining in detail why the single case reported is = a >>> false-positive. >>=20 >> This is worse. You want witness involved. >=20 > Well, I disagree with both of you a bit. I mostly agree with Attilio = in > that the committed change is a really large sledgehammer. I do not disagree that it isn't a fix. I wasn't aiming to fix it. > However, I think LK_NOWITNESS is also too large > of a sledgehammer for this as well. I agree. I think it's worse, by virtue of it being presented as both better as well as a fix. >=20 > 2) vnode locks from a local filesystem that report a LOR with a = "devfs" > vnode. Typical reports are either "ufs" -> "devfs" or in some cases > "ufs" -> "devfs" -> "ufs". As with 1), I would much rather tag the > offending location than to disable all WITNESS checking on vnode = locks. With more file system types in use, this will get mixed up with the other file systems and noise you get is rather severe. It is a big problem for us at Juniper. > I had originally thought of doing this by passing a flag in the = relevant > lock call, but that requires having a "flags" variant of all lock = calls > and passing the flag down, etc. While writing this I thought of an > alternative which would be to have a WITNESS_SUSPEND/WITNESS_RESUME = pair > of macros that either set a per-thread flag that we can invoke around > known cases where a reversal is ok. When witness is suspended it = would > still remember that the lock was acquired, but it would not report a > LOR due to that acquisition (we may have to set a flag in the lock = instance > so that future LORs related to that acquisition are also ignored) and = it > would not learn any new orders from that acquisition. So in code it > would look like: >=20 > WITNESS_SUSPEND(); > vn_lock(...); > WITNESS_RESTORE(); >=20 > Does this sound agreeable? If so, I definitely think Marcel's change = should > be reverted in favor of this (more general yet more fine-grained) = approach=20 > instead. This is a similar approach to what Attilio suggested (IMO) and I'm very concerned on 2 grounds: 1. Disable/suspending witness and making it easy to do so has known side-effects: people will use it simple to get rid of witness warnings and not even bother to understand the root cause of the witness complaints and thus fix the root cause problem. Fixing the root cause could be improving witness, or fixing the locks. If we add means and ways to have locks not checked by witness then witness stops being the useful tool it mostly is now. 2. This, to me, also doesn't come close to fixing the root cause problem. It's a just a different bandaid. What I would like to see is a statement as to why witness reports LORs (in this case) and why they are not, so that we can improve witness. For example, a statement could go like this: witness operates on lock names. All vnode structures have a lock and they bare the name of the file system. Consequently, we have many instances of a particular lock type that share the same name. This causes, ... (please complete this statement appropriately). If our root cause problem is fundamentally that witness cannot distinguish 1 UFS vnode lock from another UFS vnode lock then we should fix that. Either: 1. Construct unique lock names when witness is enabled, or 2. Create the lock with a flag to tell witness that there are multiple locks of the same name and as such does not have enough the knowledge to report LORs adequately. How we change witness in the face of such a flag is another story and a good subject for ongoing discussion. I'm all for fixing this. My change should be backed out if we have a real fix. But I must say that I'm disappointed by the responses of both you and Attilio. I do not get a sense that either of you knows what the problem is. I definitely do not have had time to understand the problem, let alone work up a real fix, so I claim ignorance without prejudice and I'm the first to admit that this is not a fix. But the best suggestion I get is to exclude the locks from any consideration by witness and that's worse than what I did. I merely added a kernel option to supressing the printing. Not even the checking. And all I did is to allow someone (=3D Juniper) to not print the LOR for this well-known and mostly ignored case that is impacting our ability to keep witness enabled. And the reason I had to do that is that this is a long-standing LOR that isn't being addressed. The FreeBSD community apparently has settled on just ignoring it. Let's do better. Let's understand the root cause and work up a real fix that doesn't involve disabling witness or excluding them from witness. I have no problem doing the grunt work on that in due time and rip out my hack at the same time. --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri May 10 15:56:35 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AFA9C4ED; Fri, 10 May 2013 15:56:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A1678300; Fri, 10 May 2013 15:56:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AFuZb2040054; Fri, 10 May 2013 15:56:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AFuZJu040052; Fri, 10 May 2013 15:56:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305101556.r4AFuZJu040052@svn.freebsd.org> From: Bryan Drewery Date: Fri, 10 May 2013 15:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250457 - in stable/9/share: examples/etc man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 15:56:35 -0000 Author: bdrewery (ports committer) Date: Fri May 10 15:56:34 2013 New Revision: 250457 URL: http://svnweb.freebsd.org/changeset/base/250457 Log: MFC r249952: Fix examples for overriding INSTALL to not suggest hardcoding 'install' since it breaks buildworld after the introduction and use of 'install -l' in r245752. Overriding INSTALL causes /usr/bin/install to be used instead of the proper /usr/src/tools/install.sh which handles the new flag. Modified: stable/9/share/examples/etc/make.conf stable/9/share/man/man5/make.conf.5 Directory Properties: stable/9/share/examples/ (props changed) stable/9/share/examples/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Fri May 10 14:39:22 2013 (r250456) +++ stable/9/share/examples/etc/make.conf Fri May 10 15:56:34 2013 (r250457) @@ -91,7 +91,7 @@ #COPTFLAGS= -O -pipe # # Compare before install -#INSTALL=install -C +#INSTALL+= -C # # Mtree will follow symlinks #MTREE_FOLLOWS_SYMLINKS= -L Modified: stable/9/share/man/man5/make.conf.5 ============================================================================== --- stable/9/share/man/man5/make.conf.5 Fri May 10 14:39:22 2013 (r250456) +++ stable/9/share/man/man5/make.conf.5 Fri May 10 15:56:34 2013 (r250457) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2013 +.Dd April 26, 2013 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -205,7 +205,7 @@ instead of the default install command. To install only files for which the target differs or does not exist, use .Bd -literal -offset indent -INSTALL="install -C" +INSTALL+= -C .Ed Note that some makefiles (including those in .Pa /usr/share/mk ) From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:12:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 55E55B07; Fri, 10 May 2013 16:12:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id F244E60A; Fri, 10 May 2013 16:12:01 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0C0B1B91A; Fri, 10 May 2013 12:12:00 -0400 (EDT) From: John Baldwin To: Bruce Evans Subject: Re: svn commit: r250220 - head/sys/kern Date: Fri, 10 May 2013 11:42:31 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305031908.r43J8xnI094418@svn.freebsd.org> <201305061355.20826.jhb@freebsd.org> <20130510123842.B637@etaplex.bde.org> In-Reply-To: <20130510123842.B637@etaplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305101142.32086.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 10 May 2013 12:12:00 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:12:02 -0000 On Thursday, May 09, 2013 11:05:46 pm Bruce Evans wrote: > On Mon, 6 May 2013, John Baldwin wrote: > > > On Saturday, May 04, 2013 4:47:43 am Bruce Evans wrote: > >>> Log: > >>> Fix FIONREAD on regular files. The computed result was being ignored and > >>> it was being passed down to VOP_IOCTL() where it promptly resulted in > >>> ENOTTY due to a missing else for the past 8 years. While here, use a > >>> shared vnode lock while fetching the current file's size. > >> > >> In another thread I complained to kib about using the bad style of not > >> returning as soon as possible, but instead sometimes returning and sometimes > >> falling through a complicated if-else ladder to get to the return at the > >> end. > > > > What about this: > > My mail is barely working while I'm away. This is the only reply that > I received recently. > > > static int > > vn_ioctl(fp, com, data, active_cred, td) > > struct file *fp; > > u_long com; > > void *data; > > struct ucred *active_cred; > > struct thread *td; > > { > > struct vnode *vp = fp->f_vnode; > > struct vattr vattr; > > > > switch (vp->v_type) { > > case VREG: > > case VDIR: > > switch (com) { > > case FIONREAD: > > vn_lock(vp, LK_SHARED | LK_RETRY); > > error = VOP_GETATTR(vp, &vattr, active_cred); > > VOP_UNLOCK(vp, 0); > > if (!error) > > *(int *)data = vattr.va_size - fp->f_offset; > > return (error); > > case FIONBIO: > > case FIOASYNC: > > return (0); /* XXX */ > > default: > > return (VOP_IOCTL(vp, com, data, fp->f_flag, > > active_cred, td)); > > } > > default: > > return (ENOTTY); > > } > > } > > Yes, that is the simplification for the logic that I want. > > This function has many other style bugs, starting witht the unsorting of > vp relative to vattr and the initialization of vp in its declaration. > I don't count the old-style function definition as a style bug :). > > Also, the case statment is unsorted (which used to be needed for the > logic of falling through), and !error is used for the non-boolean > 'error'. !error is near the overflow bug in *(int *) for large files. > INT_MAX should probably be returned when the correct value is > unrepresentable. This can't be worse than overflowing to a garbage > (possibly small or negative value). Testing 'error' is not even needed, > since *(int *)data is indeterminate after an error. I'll do only style fixes first and then the overflow check. > > (The 'XXX' comment could perhaps be expanded to something along the lines of > > 'Allow fcntl() to toggle FNONBLOCK and FASYNC.') > > Is that what it is about? IIRC, upper layers do some partial handling > and then call lower layers to possibly do some more handling. But here > and in some other places there is nothing more to be done. No comment > is needed, but maybe the XXX's were reminders to clean up the layering. > FreeBSD has cleaned up the layering a bit, by using differnt fops for > different file types. The problem is this code in fcntl() which I ran into when working on a tutorial for writing character devices: case F_SETFL: error = fget_unlocked(fdp, fd, CAP_FCNTL, F_SETFL, &fp, NULL); if (error != 0) break; do { tmp = flg = fp->f_flag; tmp &= ~FCNTLFLAGS; tmp |= FFLAGS(arg & ~O_ACCMODE) & FCNTLFLAGS; } while(atomic_cmpset_int(&fp->f_flag, flg, tmp) == 0); tmp = fp->f_flag & FNONBLOCK; error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); if (error != 0) { fdrop(fp, td); break; } tmp = fp->f_flag & FASYNC; error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); if (error == 0) { fdrop(fp, td); break; } atomic_clear_int(&fp->f_flag, FNONBLOCK); tmp = 0; (void)fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); fdrop(fp, td); break; Hmm, this seems to have the bug that if you had FNONBLOCK set and tried to set FASYNC via fcntl() but FIOASYNC isn't supported, FNONBLOCK is cleared. It seems we should only clear FNONBLOCK if it wasn't set in 'flg'. I think this would fix that: Index: kern_descrip.c =================================================================== --- kern_descrip.c (revision 250451) +++ kern_descrip.c (working copy) @@ -539,7 +539,7 @@ kern_fcntl(struct thread *td, int fd, int cmd, int } tmp = fp->f_flag & FASYNC; error = fo_ioctl(fp, FIOASYNC, &tmp, td->td_ucred, td); - if (error == 0) { + if (error == 0 || (flg & FNONBLOCK)) { fdrop(fp, td); break; } This would mean you would no longer have to support the FIOASYNC ioctl just to allow FIONBLOCK to be set. Note, btw, that kern_ioctl() doesn't enforce quite the same requirement as F_SETFL in that FIONBIO doesn't check for FASYNC and vice versa. ioctl() also doesn't revert the change if the backing fo_ioctl method fails. I actually think that fcntl should probably ignore ENOTTY errors if the flag is not set. Otherwise using fcntl to toggle some other flag can succeed but still return an error. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:12:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 88E0EB08; Fri, 10 May 2013 16:12:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0F660B; Fri, 10 May 2013 16:12:02 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8C250B953; Fri, 10 May 2013 12:12:01 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Subject: Re: svn commit: r250411 - in head/sys: conf kern sys Date: Fri, 10 May 2013 12:11:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305100952.45101.jhb@freebsd.org> <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> In-Reply-To: <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305101211.35808.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 10 May 2013 12:12:01 -0400 (EDT) Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:12:02 -0000 On Friday, May 10, 2013 11:46:54 am Marcel Moolenaar wrote: > > > > 2) vnode locks from a local filesystem that report a LOR with a "devfs" > > vnode. Typical reports are either "ufs" -> "devfs" or in some cases > > "ufs" -> "devfs" -> "ufs". As with 1), I would much rather tag the > > offending location than to disable all WITNESS checking on vnode locks. > > With more file system types in use, this will get mixed up with the > other file systems and noise you get is rather severe. It is a big > problem for us at Juniper. Note, it is very specific that the second lock is always "devfs". I think that points to this being isolated to a few specific places, not a generic ordering problem. > This is a similar approach to what Attilio suggested (IMO) and I'm > very concerned on 2 grounds: > 1. Disable/suspending witness and making it easy to do so has known > side-effects: people will use it simple to get rid of witness > warnings and not even bother to understand the root cause of the > witness complaints and thus fix the root cause problem. Fixing > the root cause could be improving witness, or fixing the locks. > If we add means and ways to have locks not checked by witness > then witness stops being the useful tool it mostly is now. The goal is to make the disabling as fine-grained as possible because... > 2. This, to me, also doesn't come close to fixing the root cause > problem. It's a just a different bandaid. What I would like to > see is a statement as to why witness reports LORs (in this case) > and why they are not, so that we can improve witness. > For example, a statement could go like this: witness operates on > lock names. All vnode structures have a lock and they bare the > name of the file system. Consequently, we have many instances of > a particular lock type that share the same name. This causes, > ... (please complete this statement appropriately). > If our root cause problem is fundamentally that witness cannot > distinguish 1 UFS vnode lock from another UFS vnode lock then > we should fix that. Either: > 1. Construct unique lock names when witness is enabled, or > 2. Create the lock with a flag to tell witness that there are > multiple locks of the same name and as such does not have > enough the knowledge to report LORs adequately. How we > change witness in the face of such a flag is another story > and a good subject for ongoing discussion. Some things witness can't really grok (at least not well). It's really that simple. Take the dirhash case. Here is the comment in the code: /* * Locking: * * The relationship between inode and dirhash is protected either by an * exclusive vnode lock or the vnode interlock where a shared vnode lock * may be used. The dirhash_mtx is acquired after the dirhash lock. To * handle teardown races, code wishing to lock the dirhash for an inode * when using a shared vnode lock must obtain a private reference on the * dirhash while holding the vnode interlock. They can drop it once they * have obtained the dirhash lock and verified that the dirhash wasn't * recycled while they waited for the dirhash lock. * * ufsdirhash_build() acquires a shared lock on the dirhash when it is * successful. This lock is released after a call to ufsdirhash_lookup(). * * Functions requiring exclusive access use ufsdirhash_acquire() which may * free a dirhash structure that was recycled by ufsdirhash_recycle(). * * The dirhash lock may be held across io operations. * * WITNESS reports a lock order reversal between the "bufwait" lock * and the "dirhash" lock. However, this specific reversal will not * cause a deadlock. To get a deadlock, one would have to lock a * buffer followed by the dirhash while a second thread locked a * buffer while holding the dirhash lock. The second order can happen * under a shared or exclusive vnode lock for the associated directory * in lookup(). The first order, however, can only happen under an * exclusive vnode lock (e.g. unlink(), rename(), etc.). Thus, for * a thread to be doing a "bufwait" -> "dirhash" order, it has to hold * an exclusive vnode lock. That exclusive vnode lock will prevent * any other threads from doing a "dirhash" -> "bufwait" order. */ So the issue here is that shared locks and exclusive locks are not quite the same. Perhaps this is something that WITNESS could "know" generically, and one solution might be to use separate witness "objects" for shared acquires on a lock vs exclusive acquires on a lock, but I'm not sure that wouldn't result in false negatives (i.e. WITNESS not reporting a LOR that can deadlock). My intuition is that the general rule would not be safe, so I would rather annotate the specific false positive in this case to remove the noise of a known-false-positive. Note that there are other instances where we make WITNESS less specific because it doesn't know about details. For example, almost all uses of the "DUPOK" flags err on the side of false negatives. For PROC_LOCK, acquiring duplicate locks is only ok if the second PROC_LOCK is a parent (or ancestor) of the first PROC_LOCK. However, for WITNESS we just allow any duplicate lock pairing (partly because there is no support for adding rules to the duplicate check currently). Vnode locks are another example of this actually. You can lock a child of a directory while holding the vnode lock of the parent directory but not vice versa. That particular rule would be very hard to verify in WITNESS directly (given two vnode lock pointers, could you "prove" that one is a parent directory of the other non-trivially in witness_checkorder()? I seriously doubt it), so we accept some false-negatives to avoid false-positive LORs on every path lookup. Thus, in practice I think your goal of having WITNESS understand every possible nuance is a bit unrealistic and not consistent with our use of it historically. If you accept the notion that we're going to have to cope with imperfection, then I hope you can appreciate my desire to make that as fine-grained as possible. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:16:36 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 849B2D95; Fri, 10 May 2013 16:16:36 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 756E265E; Fri, 10 May 2013 16:16:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AGGaqq047876; Fri, 10 May 2013 16:16:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AGGXm2047857; Fri, 10 May 2013 16:16:33 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201305101616.r4AGGXm2047857@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 10 May 2013 16:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250458 - in stable/9: . sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:16:36 -0000 Author: luigi Date: Fri May 10 16:16:33 2013 New Revision: 250458 URL: http://svnweb.freebsd.org/changeset/base/250458 Log: MFC: sync the version of netmap with the one in HEAD, including device drivers (mostly simplifying the code in the interrupt handlers). On passing, also merge r250414, which is related to netmap and the use of lem/em in virtual machines. Added: stable/9/tools/tools/netmap/nm_util.c (contents, props changed) stable/9/tools/tools/netmap/nm_util.h (contents, props changed) Modified: stable/9/README stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_em.h stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/e1000/if_lem.h stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/netmap/if_em_netmap.h stable/9/sys/dev/netmap/if_igb_netmap.h stable/9/sys/dev/netmap/if_lem_netmap.h stable/9/sys/dev/netmap/if_re_netmap.h stable/9/sys/dev/netmap/ixgbe_netmap.h stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h stable/9/sys/dev/netmap/netmap_mem2.c stable/9/sys/dev/re/if_re.c stable/9/sys/net/netmap.h stable/9/sys/net/netmap_user.h stable/9/tools/tools/netmap/Makefile stable/9/tools/tools/netmap/README stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pcap.c stable/9/tools/tools/netmap/pkt-gen.c Modified: stable/9/README ============================================================================== --- stable/9/README Fri May 10 15:56:34 2013 (r250457) +++ stable/9/README Fri May 10 16:16:33 2013 (r250458) @@ -1,4 +1,4 @@ -This is the top level of the FreeBSD source directory. This file +$FreeBSD$ was last revised on: $FreeBSD$ Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/e1000/if_em.c Fri May 10 16:16:33 2013 (r250458) @@ -335,6 +335,9 @@ MODULE_DEPEND(em, ether, 1, 1, 1); #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) #define M_TSO_LEN 66 +#define MAX_INTS_PER_SEC 8000 +#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) + /* Allow common code without TSO */ #ifndef CSUM_TSO #define CSUM_TSO 0 @@ -570,6 +573,11 @@ em_attach(device_t dev) &adapter->tx_abs_int_delay, E1000_REGISTER(hw, E1000_TADV), em_tx_abs_int_delay_dflt); + em_add_int_delay_sysctl(adapter, "itr", + "interrupt delay limit in usecs/4", + &adapter->tx_itr, + E1000_REGISTER(hw, E1000_ITR), + DEFAULT_ITR); /* Sysctl for limiting the amount of work done in the taskqueue */ em_set_sysctl_value(adapter, "rx_processing_limit", @@ -3803,17 +3811,9 @@ em_txeof(struct tx_ring *txr) EM_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - EM_TX_UNLOCK(txr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - EM_TX_LOCK(txr); + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ /* No work, make sure watchdog is off */ @@ -4254,8 +4254,6 @@ em_free_receive_buffers(struct rx_ring * * Enable receive unit. * **********************************************************************/ -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256) static void em_initialize_receive_unit(struct adapter *adapter) @@ -4315,6 +4313,8 @@ em_initialize_receive_unit(struct adapte for (int i = 0; i < adapter->num_queues; i++, rxr++) { /* Setup the Base and Length of the Rx Descriptor Ring */ + u32 rdt = adapter->num_rx_desc - 1; /* default */ + bus_addr = rxr->rxdma.dma_paddr; E1000_WRITE_REG(hw, E1000_RDLEN(i), adapter->num_rx_desc * sizeof(struct e1000_rx_desc)); @@ -4326,18 +4326,11 @@ em_initialize_receive_unit(struct adapte /* * an init() while a netmap client is active must * preserve the rx buffers passed to userspace. - * In this driver it means we adjust RDT to - * something different from na->num_rx_desc - 1. */ - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[i]; - int t = na->num_rx_desc - 1 - kring->nr_hwavail; - - E1000_WRITE_REG(hw, E1000_RDT(i), t); - } else + if (ifp->if_capenable & IFCAP_NETMAP) + rdt -= NA(adapter->ifp)->rx_rings[i].nr_hwavail; #endif /* DEV_NETMAP */ - E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); + E1000_WRITE_REG(hw, E1000_RDT(i), rdt); } /* Set PTHRESH for improved jumbo performance */ @@ -4414,17 +4407,8 @@ em_rxeof(struct rx_ring *rxr, int count, EM_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - EM_RX_UNLOCK(rxr); - EM_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - EM_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ for (i = rxr->next_to_check, processed = 0; count != 0;) { @@ -5622,6 +5606,8 @@ em_sysctl_int_delay(SYSCTL_HANDLER_ARGS) return (EINVAL); info->value = usecs; ticks = EM_USECS_TO_TICKS(usecs); + if (info->offset == E1000_ITR) /* units are 256ns here */ + ticks *= 4; adapter = info->adapter; Modified: stable/9/sys/dev/e1000/if_em.h ============================================================================== --- stable/9/sys/dev/e1000/if_em.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/e1000/if_em.h Fri May 10 16:16:33 2013 (r250458) @@ -429,6 +429,7 @@ struct adapter { struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; struct em_int_delay_info rx_abs_int_delay; + struct em_int_delay_info tx_itr; /* Misc stats maintained by the driver */ unsigned long dropped_pkts; Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/e1000/if_igb.c Fri May 10 16:16:33 2013 (r250458) @@ -3872,17 +3872,9 @@ igb_txeof(struct tx_ring *txr) IGB_TX_LOCK_ASSERT(txr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IGB_TX_UNLOCK(txr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - IGB_TX_LOCK(txr); - return FALSE; - } + if (netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) + return (FALSE); #endif /* DEV_NETMAP */ if (txr->tx_avail == adapter->num_tx_desc) { txr->queue_status = IGB_QUEUE_IDLE; @@ -4736,17 +4728,8 @@ igb_rxeof(struct igb_queue *que, int cou BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IGB_RX_UNLOCK(rxr); - IGB_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IGB_CORE_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) + return (FALSE); #endif /* DEV_NETMAP */ /* Main clean loop */ Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/e1000/if_lem.c Fri May 10 16:16:33 2013 (r250458) @@ -281,6 +281,9 @@ MODULE_DEPEND(lem, ether, 1, 1, 1); #define EM_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) #define EM_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) +#define MAX_INTS_PER_SEC 8000 +#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) + static int lem_tx_int_delay_dflt = EM_TICKS_TO_USECS(EM_TIDV); static int lem_rx_int_delay_dflt = EM_TICKS_TO_USECS(EM_RDTR); static int lem_tx_abs_int_delay_dflt = EM_TICKS_TO_USECS(EM_TADV); @@ -442,6 +445,11 @@ lem_attach(device_t dev) &adapter->tx_abs_int_delay, E1000_REGISTER(&adapter->hw, E1000_TADV), lem_tx_abs_int_delay_dflt); + lem_add_int_delay_sysctl(adapter, "itr", + "interrupt delay limit in usecs/4", + &adapter->tx_itr, + E1000_REGISTER(&adapter->hw, E1000_ITR), + DEFAULT_ITR); } /* Sysctls for limiting the amount of work done in the taskqueue */ @@ -1337,12 +1345,16 @@ lem_handle_rxtx(void *context, int pendi if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - lem_rxeof(adapter, adapter->rx_process_limit, NULL); + bool more = lem_rxeof(adapter, adapter->rx_process_limit, NULL); EM_TX_LOCK(adapter); lem_txeof(adapter); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) lem_start_locked(ifp); EM_TX_UNLOCK(adapter); + if (more) { + taskqueue_enqueue(adapter->tq, &adapter->rxtx_task); + return; + } } if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2955,10 +2967,8 @@ lem_txeof(struct adapter *adapter) EM_TX_LOCK_ASSERT(adapter); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->tx_rings[0].si, PI_NET); + if (netmap_tx_irq(ifp, 0 | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT))) return; - } #endif /* DEV_NETMAP */ if (adapter->num_tx_desc_avail == adapter->num_tx_desc) return; @@ -3246,8 +3256,6 @@ lem_setup_receive_structures(struct adap * Enable receive unit. * **********************************************************************/ -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR 1000000000/(MAX_INTS_PER_SEC * 256) static void lem_initialize_receive_unit(struct adapter *adapter) @@ -3338,19 +3346,13 @@ lem_initialize_receive_unit(struct adapt * Tail Descriptor Pointers */ E1000_WRITE_REG(&adapter->hw, E1000_RDH(0), 0); + rctl = adapter->num_rx_desc - 1; /* default RDT value */ #ifdef DEV_NETMAP /* preserve buffers already made available to clients */ - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_kring *kring = &na->rx_rings[0]; - int t = na->num_rx_desc - 1 - kring->nr_hwavail; - - if (t >= na->num_rx_desc) - t -= na->num_rx_desc; - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), t); - } else + if (ifp->if_capenable & IFCAP_NETMAP) + rctl -= NA(adapter->ifp)->rx_rings[0].nr_hwavail; #endif /* DEV_NETMAP */ - E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), adapter->num_rx_desc - 1); + E1000_WRITE_REG(&adapter->hw, E1000_RDT(0), rctl); return; } @@ -3434,13 +3436,8 @@ lem_rxeof(struct adapter *adapter, int c BUS_DMASYNC_POSTREAD); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - struct netmap_adapter *na = NA(ifp); - na->rx_rings[0].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[0].si, PI_NET); - EM_RX_UNLOCK(adapter); - return (0); - } + if (netmap_rx_irq(ifp, 0 | NETMAP_LOCKED_ENTER, &rx_sent)) + return (FALSE); #endif /* DEV_NETMAP */ if (!((current_desc->status) & E1000_RXD_STAT_DD)) { @@ -4584,6 +4581,8 @@ lem_sysctl_int_delay(SYSCTL_HANDLER_ARGS return (EINVAL); info->value = usecs; ticks = EM_USECS_TO_TICKS(usecs); + if (info->offset == E1000_ITR) /* units are 256ns here */ + ticks *= 4; adapter = info->adapter; Modified: stable/9/sys/dev/e1000/if_lem.h ============================================================================== --- stable/9/sys/dev/e1000/if_lem.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/e1000/if_lem.h Fri May 10 16:16:33 2013 (r250458) @@ -363,6 +363,7 @@ struct adapter { struct em_int_delay_info tx_abs_int_delay; struct em_int_delay_info rx_int_delay; struct em_int_delay_info rx_abs_int_delay; + struct em_int_delay_info tx_itr; /* * Transmit definitions Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/ixgbe/ixgbe.c Fri May 10 16:16:33 2013 (r250458) @@ -3573,13 +3573,8 @@ ixgbe_txeof(struct tx_ring *txr) if (!netmap_mitigate || (kring->nr_kflags < kring->nkr_num_slots && txd[kring->nr_kflags].wb.status & IXGBE_TXD_STAT_DD)) { - kring->nr_kflags = kring->nkr_num_slots; - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IXGBE_TX_UNLOCK(txr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->tx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); - IXGBE_TX_LOCK(txr); + netmap_tx_irq(ifp, txr->me | + (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); } return FALSE; } @@ -4364,23 +4359,9 @@ ixgbe_rxeof(struct ix_queue *que) IXGBE_RX_LOCK(rxr); #ifdef DEV_NETMAP - if (ifp->if_capenable & IFCAP_NETMAP) { - /* - * Same as the txeof routine: only wakeup clients on intr. - * NKR_PENDINTR in nr_kflags is used to implement interrupt - * mitigation (ixgbe_rxsync() will not look for new packets - * unless NKR_PENDINTR is set). - */ - struct netmap_adapter *na = NA(ifp); - - na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; - selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); - IXGBE_RX_UNLOCK(rxr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->rx_si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); + /* Same as the txeof routine: wakeup clients on intr. */ + if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) return (FALSE); - } #endif /* DEV_NETMAP */ for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mp; Modified: stable/9/sys/dev/netmap/if_em_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_em_netmap.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/if_em_netmap.h Fri May 10 16:16:33 2013 (r250458) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_em_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for em. * @@ -277,7 +276,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); - + if (do_lock) EM_RX_LOCK(rxr); Modified: stable/9/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_igb_netmap.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/if_igb_netmap.h Fri May 10 16:16:33 2013 (r250458) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_igb_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * Netmap support for igb, partly contributed by Ahmed Kooli * For details on netmap support please see ixgbe_netmap.h Modified: stable/9/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_lem_netmap.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/if_lem_netmap.h Fri May 10 16:16:33 2013 (r250458) @@ -26,7 +26,6 @@ /* * $FreeBSD$ - * $Id: if_lem_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap support for "lem" * Modified: stable/9/sys/dev/netmap/if_re_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_re_netmap.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/if_re_netmap.h Fri May 10 16:16:33 2013 (r250458) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: if_re_netmap.h 10609 2012-02-22 19:44:58Z luigi $ * * netmap support for "re" * For details on netmap support please see ixgbe_netmap.h @@ -151,7 +150,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; - + j = kring->nr_hwcur; if (j != k) { /* we have new packets to send */ l = sc->rl_ldata.rl_tx_prodidx; @@ -170,7 +169,7 @@ re_netmap_txsync(struct ifnet *ifp, u_in // XXX what about prodidx ? return netmap_ring_reinit(kring); } - + if (l == lim) /* mark end of ring */ cmd |= RL_TDESC_CMD_EOR; @@ -335,7 +334,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in */ static void re_netmap_tx_init(struct rl_softc *sc) -{ +{ struct rl_txdesc *txd; struct rl_desc *desc; int i, n; Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/ixgbe_netmap.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/ixgbe_netmap.h Fri May 10 16:16:33 2013 (r250458) @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: ixgbe_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * * netmap modifications for ixgbe * @@ -226,7 +225,8 @@ ixgbe_netmap_txsync(struct ifnet *ifp, u struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - u_int j, k = ring->cur, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, l, n = 0; + u_int const k = ring->cur, lim = kring->nkr_num_slots - 1; /* * ixgbe can generate an interrupt on every tx packet, but it @@ -393,11 +393,10 @@ ring_reset: if (ix_use_dd) { struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; - + u_int k1 = netmap_idx_k2n(kring, kring->nr_hwcur); l = txr->next_to_clean; - k = netmap_idx_k2n(kring, kring->nr_hwcur); delta = 0; - while (l != k && + while (l != k1 && txd[l].upper.fields.status & IXGBE_TXD_STAT_DD) { delta++; l = (l == lim) ? 0 : l + 1; Modified: stable/9/sys/dev/netmap/netmap.c ============================================================================== --- stable/9/sys/dev/netmap/netmap.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/netmap.c Fri May 10 16:16:33 2013 (r250458) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include /* PROT_EXEC */ #include #include +#include #include /* vtophys */ #include /* vtophys */ #include /* sockaddrs */ @@ -98,6 +99,7 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo #include #include +/* XXX the following variables must be deprecated and included in nm_mem */ u_int netmap_total_buffers; u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ @@ -121,12 +123,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen int netmap_drop = 0; /* debugging */ int netmap_flags = 0; /* debug flags */ int netmap_fwd = 0; /* force transparent mode */ -int netmap_copy = 0; /* debugging, copy content */ SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); -SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); #ifdef NM_BRIDGE /* support for netmap bridge */ @@ -147,22 +147,33 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, copy, #define NM_BDG_HASH 1024 /* forwarding table entries */ #define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ #define NM_BRIDGES 4 /* number of bridges */ + + int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); #ifdef linux -#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) -#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) + +#define refcount_acquire(_a) atomic_add(1, (atomic_t *)_a) +#define refcount_release(_a) atomic_dec_and_test((atomic_t *)_a) + #else /* !linux */ -#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ -#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) + #ifdef __FreeBSD__ #include #include #endif /* __FreeBSD__ */ + #define prefetch(x) __builtin_prefetch(x) + #endif /* !linux */ +/* + * These are used to handle reference counters for bridge ports. + */ +#define ADD_BDG_REF(ifp) refcount_acquire(&NA(ifp)->na_bdg_refcount) +#define DROP_BDG_REF(ifp) refcount_release(&NA(ifp)->na_bdg_refcount) + static void bdg_netmap_attach(struct ifnet *ifp); static int bdg_netmap_reg(struct ifnet *ifp, int onoff); /* per-tx-queue entry */ @@ -179,9 +190,14 @@ struct nm_hash_ent { }; /* - * Interfaces for a bridge are all in ports[]. + * Interfaces for a bridge are all in bdg_ports[]. * The array has fixed size, an empty entry does not terminate - * the search. + * the search. But lookups only occur on attach/detach so we + * don't mind if they are slow. + * + * The bridge is non blocking on the transmit ports. + * + * bdg_lock protects accesses to the bdg_ports array. */ struct nm_bridge { struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; @@ -297,7 +313,7 @@ netmap_update_config(struct netmap_adapt txd = na->num_tx_desc; rxr = na->num_rx_rings; rxd = na->num_rx_desc; - } + } if (na->num_tx_rings == txr && na->num_tx_desc == txd && na->num_rx_rings == rxr && na->num_rx_desc == rxd) @@ -323,11 +339,7 @@ netmap_update_config(struct netmap_adapt } /*------------- memory allocator -----------------*/ -#ifdef NETMAP_MEM2 #include "netmap_mem2.c" -#else /* !NETMAP_MEM2 */ -#include "netmap_mem1.c" -#endif /* !NETMAP_MEM2 */ /*------------ end of memory allocator ----------*/ @@ -497,16 +509,16 @@ netmap_dtor(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; - struct netmap_adapter *na; NMA_LOCK(); if (ifp) { - na = NA(ifp); + struct netmap_adapter *na = NA(ifp); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); netmap_dtor_locked(data); na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - nm_if_rele(ifp); + nm_if_rele(ifp); /* might also destroy *na */ } if (priv->ref_done) { netmap_memory_deref(); @@ -1668,19 +1680,25 @@ netmap_attach(struct netmap_adapter *arg ND("using default locks for %s", ifp->if_xname); na->nm_lock = netmap_lock_wrapper; } + #ifdef linux - if (ifp->netdev_ops) { - ND("netdev_ops %p", ifp->netdev_ops); - /* prepare a clone of the netdev ops */ - na->nm_ndo = *ifp->netdev_ops; + if (!ifp->netdev_ops) { + D("ouch, we cannot override netdev_ops"); + goto fail; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) + /* if needed, prepare a clone of the entire netdev ops */ + na->nm_ndo = *ifp->netdev_ops; +#endif /* 2.6.28 and above */ na->nm_ndo.ndo_start_xmit = linux_netmap_start; -#endif +#endif /* linux */ + D("success for %s", ifp->if_xname); return 0; fail: D("fail, arg %p ifp %p na %p", arg, ifp, na); + netmap_detach(ifp); return (na ? EINVAL : ENOMEM); } @@ -1726,17 +1744,18 @@ netmap_start(struct ifnet *ifp, struct m if (netmap_verbose & NM_VERB_HOST) D("%s packet %d len %d from the stack", ifp->if_xname, kring->nr_hwcur + kring->nr_hwavail, len); + if (len > NETMAP_BUF_SIZE) { /* too long for us */ + D("%s from_host, drop packet size %d > %d", ifp->if_xname, + len, NETMAP_BUF_SIZE); + m_freem(m); + return EINVAL; + } na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); if (kring->nr_hwavail >= lim) { if (netmap_verbose) D("stack ring %s full\n", ifp->if_xname); goto done; /* no space */ } - if (len > NETMAP_BUF_SIZE) { - D("%s from_host, drop packet size %d > %d", ifp->if_xname, - len, NETMAP_BUF_SIZE); - goto done; /* too long for us */ - } /* compute the insert position */ i = kring->nr_hwcur + kring->nr_hwavail; @@ -1837,6 +1856,10 @@ netmap_reset(struct netmap_adapter *na, * N rings, separate locks: * lock(i); wake(i); unlock(i); lock(core) wake(N+1) unlock(core) * work_done is non-null on the RX path. + * + * The 'q' argument also includes flag to tell whether the queue is + * already locked on enter, and whether it should remain locked on exit. + * This helps adapting to different defaults in drivers and OSes. */ int netmap_rx_irq(struct ifnet *ifp, int q, int *work_done) @@ -1844,9 +1867,14 @@ netmap_rx_irq(struct ifnet *ifp, int q, struct netmap_adapter *na; struct netmap_kring *r; NM_SELINFO_T *main_wq; + int locktype, unlocktype, lock; if (!(ifp->if_capenable & IFCAP_NETMAP)) return 0; + + lock = q & (NETMAP_LOCKED_ENTER | NETMAP_LOCKED_EXIT); + q = q & NETMAP_RING_MASK; + ND(5, "received %s queue %d", work_done ? "RX" : "TX" , q); na = NA(ifp); if (na->na_flags & NAF_SKIP_INTR) { @@ -1856,32 +1884,42 @@ netmap_rx_irq(struct ifnet *ifp, int q, if (work_done) { /* RX path */ if (q >= na->num_rx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->rx_rings + q; r->nr_kflags |= NKR_PENDINTR; main_wq = (na->num_rx_rings > 1) ? &na->rx_si : NULL; - } else { /* tx path */ + locktype = NETMAP_RX_LOCK; + unlocktype = NETMAP_RX_UNLOCK; + } else { /* TX path */ if (q >= na->num_tx_rings) - return 0; // regular queue + return 0; // not a physical queue r = na->tx_rings + q; main_wq = (na->num_tx_rings > 1) ? &na->tx_si : NULL; work_done = &q; /* dummy */ + locktype = NETMAP_TX_LOCK; + unlocktype = NETMAP_TX_UNLOCK; } if (na->separate_locks) { - mtx_lock(&r->q_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, locktype, q); selwakeuppri(&r->si, PI_NET); - mtx_unlock(&r->q_lock); + na->nm_lock(ifp, unlocktype, q); if (main_wq) { - mtx_lock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } + /* lock the queue again if requested */ + if (lock & NETMAP_LOCKED_EXIT) + na->nm_lock(ifp, locktype, q); } else { - mtx_lock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_ENTER)) + na->nm_lock(ifp, NETMAP_CORE_LOCK, 0); selwakeuppri(&r->si, PI_NET); if (main_wq) selwakeuppri(main_wq, PI_NET); - mtx_unlock(&na->core_lock); + if (!(lock & NETMAP_LOCKED_EXIT)) + na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); } *work_done = 1; /* do not fire napi again */ return 1; @@ -1902,7 +1940,9 @@ netmap_rx_irq(struct ifnet *ifp, int q, static u_int linux_netmap_poll(struct file * file, struct poll_table_struct *pwait) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) + int events = POLLIN | POLLOUT; /* XXX maybe... */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0) int events = pwait ? pwait->key : POLLIN | POLLOUT; #else /* in 3.4.0 field 'key' was renamed to '_key' */ int events = pwait ? pwait->_key : POLLIN | POLLOUT; @@ -1942,7 +1982,7 @@ linux_netmap_mmap(struct file *f, struct * vtophys mapping in lut[k] so we use that, scanning * the lut[] array in steps of clustentries, * and we map each cluster (not individual pages, - * it would be overkill). + * it would be overkill -- XXX slow ? 20130415). */ /* Modified: stable/9/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/9/sys/dev/netmap/netmap_kern.h Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/netmap_kern.h Fri May 10 16:16:33 2013 (r250458) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2013 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,7 +25,6 @@ /* * $FreeBSD$ - * $Id: netmap_kern.h 11829 2012-09-26 04:06:34Z luigi $ * * The header contains the definitions of constants and function * prototypes used only in kernelspace. @@ -34,9 +33,8 @@ #ifndef _NET_NETMAP_KERN_H_ #define _NET_NETMAP_KERN_H_ -#define NETMAP_MEM2 // use the new memory allocator - #if defined(__FreeBSD__) + #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -44,8 +42,10 @@ #define NM_SELINFO_T struct selinfo #define MBUF_LEN(m) ((m)->m_pkthdr.len) #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) + #elif defined (linux) -#define NM_LOCK_T spinlock_t + +#define NM_LOCK_T safe_spinlock_t // see bsd_glue.h #define NM_SELINFO_T wait_queue_head_t #define MBUF_LEN(m) ((m)->len) #define NM_SEND_UP(ifp, m) netif_rx(m) @@ -67,6 +67,7 @@ #endif #elif defined (__APPLE__) + #warning apple support is incomplete. #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) @@ -76,8 +77,10 @@ #define NM_SEND_UP(ifp, m) ((ifp)->if_input)(ifp, m) #else + #error unsupported platform -#endif + +#endif /* end - platform-specific code */ #define ND(format, ...) #define D(format, ...) \ @@ -207,10 +210,20 @@ struct netmap_adapter { int (*nm_config)(struct ifnet *, u_int *txr, u_int *txd, u_int *rxr, u_int *rxd); + /* + * Bridge support: + * + * bdg_port is the port number used in the bridge; + * na_bdg_refcount is a refcount used for bridge ports, + * when it goes to 0 we can detach+free this port + * (a bridge port is always attached if it exists; + * it is not always registered) + */ int bdg_port; + int na_bdg_refcount; + #ifdef linux struct net_device_ops nm_ndo; - int if_refcount; // XXX additions for bridge #endif /* linux */ }; @@ -245,6 +258,10 @@ enum { #endif }; +/* How to handle locking support in netmap_rx_irq/netmap_tx_irq */ +#define NETMAP_LOCKED_ENTER 0x10000000 /* already locked on enter */ +#define NETMAP_LOCKED_EXIT 0x20000000 /* keep locked on exit */ + /* * The following are support routines used by individual drivers to * support netmap operation. @@ -272,7 +289,7 @@ struct netmap_slot *netmap_reset(struct int netmap_ring_reinit(struct netmap_kring *); extern u_int netmap_buf_size; -#define NETMAP_BUF_SIZE netmap_buf_size +#define NETMAP_BUF_SIZE netmap_buf_size // XXX remove extern int netmap_mitigate; extern int netmap_no_pendintr; extern u_int netmap_total_buffers; @@ -431,20 +448,16 @@ netmap_idx_k2n(struct netmap_kring *kr, } -#ifdef NETMAP_MEM2 /* Entries of the look-up table. */ struct lut_entry { void *vaddr; /* virtual address. */ - vm_paddr_t paddr; /* phisical address. */ + vm_paddr_t paddr; /* physical address. */ }; struct netmap_obj_pool; extern struct lut_entry *netmap_buffer_lut; #define NMB_VA(i) (netmap_buffer_lut[i].vaddr) #define NMB_PA(i) (netmap_buffer_lut[i].paddr) -#else /* NETMAP_MEM1 */ -#define NMB_VA(i) (netmap_buffer_base + (i * NETMAP_BUF_SIZE) ) -#endif /* NETMAP_MEM2 */ /* * NMB return the virtual address of a buffer (buffer 0 on bad index) @@ -462,11 +475,8 @@ PNMB(struct netmap_slot *slot, uint64_t { uint32_t i = slot->buf_idx; void *ret = (i >= netmap_total_buffers) ? NMB_VA(0) : NMB_VA(i); -#ifdef NETMAP_MEM2 + *pp = (i >= netmap_total_buffers) ? NMB_PA(0) : NMB_PA(i); -#else - *pp = vtophys(ret); -#endif return ret; } @@ -474,5 +484,4 @@ PNMB(struct netmap_slot *slot, uint64_t int netmap_rx_irq(struct ifnet *, int, int *); #define netmap_tx_irq(_n, _q) netmap_rx_irq(_n, _q, NULL) -extern int netmap_copy; #endif /* _NET_NETMAP_KERN_H_ */ Modified: stable/9/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_mem2.c Fri May 10 15:56:34 2013 (r250457) +++ stable/9/sys/dev/netmap/netmap_mem2.c Fri May 10 16:16:33 2013 (r250458) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. + * Copyright (C) 2012-2013 Matteo Landi, Luigi Rizzo, Giuseppe Lettieri. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -25,22 +25,23 @@ /* * $FreeBSD$ - * $Id: netmap_mem2.c 11881 2012-10-18 23:24:15Z luigi $ * * (New) memory allocator for netmap */ /* - * This allocator creates three memory regions: + * This allocator creates three memory pools: * nm_if_pool for the struct netmap_if * nm_ring_pool for the struct netmap_ring * nm_buf_pool for the packet buffers. * - * All regions need to be multiple of a page size as we export them to - * userspace through mmap. Only the latter needs to be dma-able, + * that contain netmap objects. Each pool is made of a number of clusters, + * multiple of a page size, each containing an integer number of objects. + * The clusters are contiguous in user space but not in the kernel. + * Only nm_buf_pool needs to be dma-able, * but for convenience use the same type of allocator for all. * - * Once mapped, the three regions are exported to userspace + * Once mapped, the three pools are exported to userspace * as a contiguous block, starting from nm_if_pool. Each * cluster (and pool) is an integral number of pages. * [ . . . ][ . . . . . .][ . . . . . . . . . .] @@ -56,7 +57,7 @@ * The pool is split into smaller clusters, whose size is a * multiple of the page size. The cluster size is chosen * to minimize the waste for a given max cluster size - * (we do it by brute force, as we have relatively few object + * (we do it by brute force, as we have relatively few objects * per cluster). * * Objects are aligned to the cache line (64 bytes) rounding up object @@ -80,7 +81,7 @@ * In the worst case we have one netmap_if per ring in the system. * * struct netmap_ring - * variable too, 8 byte per slot plus some fixed amount. + * variable size, 8 byte per slot plus some fixed amount. * Rings can be large (e.g. 4k slots, or >32Kbytes). * We default to 36 KB (9 pages), and a few hundred rings. * @@ -93,16 +94,14 @@ * the size to multiple of 1K or so. Default to 2K */ -#ifndef CONSERVATIVE #define NETMAP_BUF_MAX_NUM 20*4096*2 /* large machine */ -#else /* CONSERVATIVE */ -#define NETMAP_BUF_MAX_NUM 20000 /* 40MB */ -#endif #ifdef linux +// XXX a mtx would suffice here 20130415 lr +// #define NMA_LOCK_T safe_spinlock_t #define NMA_LOCK_T struct semaphore #define NMA_LOCK_INIT() sema_init(&nm_mem.nm_mtx, 1) -#define NMA_LOCK_DESTROY() +#define NMA_LOCK_DESTROY() #define NMA_LOCK() down(&nm_mem.nm_mtx) #define NMA_UNLOCK() up(&nm_mem.nm_mtx) #else /* !linux */ @@ -178,7 +177,11 @@ struct netmap_mem_d { struct netmap_obj_pool pools[NETMAP_POOLS_NR]; }; - +/* + * nm_mem is the memory allocator used for all physical interfaces + * running in netmap mode. + * Virtual (VALE) ports will have each its own allocator. + */ static struct netmap_mem_d nm_mem = { /* Our memory allocator. */ .pools = { [NETMAP_IF_POOL] = { @@ -205,6 +208,7 @@ static struct netmap_mem_d nm_mem = { /* }, }; +// XXX logically belongs to nm_mem struct lut_entry *netmap_buffer_lut; /* exported */ /* memory allocator related sysctls */ @@ -212,12 +216,10 @@ struct lut_entry *netmap_buffer_lut; /* #define STRINGIFY(x) #x #define DECLARE_SYSCTLS(id, name) \ - /* TUNABLE_INT("hw.netmap." STRINGIFY(name) "_size", &netmap_params[id].size); */ \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_size, \ CTLFLAG_RW, &netmap_params[id].size, 0, "Requested size of netmap " STRINGIFY(name) "s"); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_curr_size, \ CTLFLAG_RD, &nm_mem.pools[id]._objsize, 0, "Current size of netmap " STRINGIFY(name) "s"); \ - /* TUNABLE_INT("hw.netmap." STRINGIFY(name) "_num", &netmap_params[id].num); */ \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_num, \ CTLFLAG_RW, &netmap_params[id].num, 0, "Requested number of netmap " STRINGIFY(name) "s"); \ SYSCTL_INT(_dev_netmap, OID_AUTO, name##_curr_num, \ @@ -228,14 +230,12 @@ DECLARE_SYSCTLS(NETMAP_RING_POOL, ring); DECLARE_SYSCTLS(NETMAP_BUF_POOL, buf); /* - * Convert a userspace offset to a phisical address. - * XXX re-do in a simpler way. + * Convert a userspace offset to a physical address. + * XXX only called in the FreeBSD's netmap_mmap() + * because in linux we map everything at once. * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:30:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BF1FA354; Fri, 10 May 2013 16:30:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B1B5078A; Fri, 10 May 2013 16:30:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AGUdjc053867; Fri, 10 May 2013 16:30:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AGUdV9053866; Fri, 10 May 2013 16:30:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101630.r4AGUdV9053866@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 16:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250459 - head/share/syscons/fonts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:30:39 -0000 Author: eadler Date: Fri May 10 16:30:39 2013 New Revision: 250459 URL: http://svnweb.freebsd.org/changeset/base/250459 Log: Add the letter 'q' to the font iso05-8x16.fnt PR: 72585 PR: 169797 Submitted by: Takefu Submitted by: Satoshi KImura Modified: head/share/syscons/fonts/iso05-8x16.fnt Modified: head/share/syscons/fonts/iso05-8x16.fnt ============================================================================== --- head/share/syscons/fonts/iso05-8x16.fnt Fri May 10 16:16:33 2013 (r250458) +++ head/share/syscons/fonts/iso05-8x16.fnt Fri May 10 16:30:39 2013 (r250459) @@ -40,7 +40,7 @@ M`'S&_L#`QGP````````X;&1@\&!@8&#P``````` M`.!@8&QV9F9F9N8````````8&``X&!@8&!@\````````!@8`#@8&!@8&!F9F M/````.!@8&9L>'AL9N8````````X&!@8&!@8&!@\````````````[/[6UM;6 MQ@```````````-QF9F9F9F8```````````!\QL;&QL9\````````````W&9F -M9F9F?&!@\`````````````````````````````#<=F9@8&#P```````````` +M9F9F?&!@\````````';,S,S,S'P,#!X```````#<=F9@8&#P```````````` M?,9@.`S&?````````!`P,/PP,#`P-AP```````````#,S,S,S,QV```````` M````9F9F9F8\&````````````,;&UM;6_FP```````````#&;#@X.&S&```` M````````QL;&QL;&?@8,^````````/[,&#!@QOX````````.&!@8 Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCDA673B; Fri, 10 May 2013 16:41:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EF00831; Fri, 10 May 2013 16:41:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AGfVwr057395; Fri, 10 May 2013 16:41:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AGfRJb057368; Fri, 10 May 2013 16:41:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101641.r4AGfRJb057368@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 16:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250460 - in head: share/examples/ppi share/misc sys/cam/ctl sys/cam/scsi sys/dev/aic7xxx sys/dev/cp sys/dev/ctau sys/dev/cx sys/dev/hptmv sys/dev/isci/scil sys/dev/nsp sys/dev/sfxge/co... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:41:31 -0000 Author: eadler Date: Fri May 10 16:41:26 2013 New Revision: 250460 URL: http://svnweb.freebsd.org/changeset/base/250460 Log: Fxi a bunch of typos. PR: misc/174625 Submitted by: Jeremy Chadwick Modified: head/share/examples/ppi/ppilcd.c head/share/misc/pci_vendors head/sys/cam/ctl/scsi_ctl.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_pt.c head/sys/dev/aic7xxx/aic7xxx.h head/sys/dev/cp/if_cp.c head/sys/dev/ctau/if_ct.c head/sys/dev/cx/csigma.c head/sys/dev/cx/if_cx.c head/sys/dev/hptmv/entry.c head/sys/dev/isci/scil/scif_sas_domain.c head/sys/dev/nsp/nsp.c head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sn/if_sn.c head/sys/dev/stg/tmc18c30.c head/sys/kern/uipc_usrreq.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c head/sys/ofed/drivers/net/mlx4/eq.c head/usr.sbin/bluetooth/hccontrol/link_control.c head/usr.sbin/dumpcis/printcis.c Modified: head/share/examples/ppi/ppilcd.c ============================================================================== --- head/share/examples/ppi/ppilcd.c Fri May 10 16:30:39 2013 (r250459) +++ head/share/examples/ppi/ppilcd.c Fri May 10 16:41:26 2013 (r250460) @@ -269,7 +269,7 @@ do_char(struct lcd_driver *driver, char * one of the ground pins (eg. pin 25). * * Note that the pinning on some LCD modules has the odd and even pins - * arranged as though reversed; check carefully before conecting a module + * arranged as though reversed; check carefully before connecting a module * as it is possible to toast the HD44780 if the power is reversed. */ Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Fri May 10 16:30:39 2013 (r250459) +++ head/share/misc/pci_vendors Fri May 10 16:41:26 2013 (r250460) @@ -11402,7 +11402,7 @@ 0040 QSC-200/300 0050 ESC-100D 0060 ESC-100M - 00f0 MPAC-100 Syncronous Serial Card (Zilog 85230) + 00f0 MPAC-100 Synchronous Serial Card (Zilog 85230) 0170 QSCLP-100 0180 DSCLP-100 0190 SSCLP-100 Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/cam/ctl/scsi_ctl.c Fri May 10 16:41:26 2013 (r250460) @@ -2137,7 +2137,7 @@ ctlfe_dump_queue(struct ctlfe_lun_softc xpt_print(periph->path, "%d requests total waiting for CCBs\n", num_items); - xpt_print(periph->path, "%ju CCBs oustanding (%ju allocated, %ju " + xpt_print(periph->path, "%ju CCBs outstanding (%ju allocated, %ju " "freed)\n", (uintmax_t)(softc->ccbs_alloced - softc->ccbs_freed), (uintmax_t)softc->ccbs_alloced, (uintmax_t)softc->ccbs_freed); Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/cam/scsi/scsi_da.c Fri May 10 16:41:26 2013 (r250460) @@ -2328,7 +2328,7 @@ skipstate: out: /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_INSERT_HEAD(&softc->pending_ccbs, @@ -2729,7 +2729,7 @@ dadone(struct cam_periph *periph, union } /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/cam/scsi/scsi_pt.c Fri May 10 16:41:26 2013 (r250460) @@ -455,7 +455,7 @@ ptstart(struct cam_periph *periph, union start_ccb->ccb_h.ccb_state = PT_CCB_BUFFER_IO_UA; /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_INSERT_HEAD(&softc->pending_ccbs, &start_ccb->ccb_h, @@ -549,7 +549,7 @@ ptdone(struct cam_periph *periph, union } /* - * Block out any asyncronous callbacks + * Block out any asynchronous callbacks * while we touch the pending ccb list. */ LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); Modified: head/sys/dev/aic7xxx/aic7xxx.h ============================================================================== --- head/sys/dev/aic7xxx/aic7xxx.h Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/aic7xxx/aic7xxx.h Fri May 10 16:41:26 2013 (r250460) @@ -768,7 +768,7 @@ struct ahc_syncrate { #define AHC_ULTRA2_XFER_PERIOD 0x0a /* - * Indexes into our table of syncronous transfer rates. + * Indexes into our table of synchronous transfer rates. */ #define AHC_SYNCRATE_DT 0 #define AHC_SYNCRATE_ULTRA2 1 Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/cp/if_cp.c Fri May 10 16:41:26 2013 (r250460) @@ -1,7 +1,7 @@ /*- * Cronyx-Tau-PCI adapter driver for FreeBSD. * Supports PPP/HDLC, Cisco/HDLC and FrameRelay protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1999-2004 Cronyx Engineering. Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/ctau/if_ct.c Fri May 10 16:41:26 2013 (r250460) @@ -1,7 +1,7 @@ /*- * Cronyx-Tau adapter driver for FreeBSD. * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1994-2002 Cronyx Engineering. Modified: head/sys/dev/cx/csigma.c ============================================================================== --- head/sys/dev/cx/csigma.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/cx/csigma.c Fri May 10 16:41:26 2013 (r250460) @@ -1168,7 +1168,7 @@ void cx_set_dtr (cx_chan_t *c, int on) switch (c->num) { default: - /* Channels 4..7 and 12..15 in syncronous mode + /* Channels 4..7 and 12..15 in synchronous mode * have no DTR signal. */ break; Modified: head/sys/dev/cx/if_cx.c ============================================================================== --- head/sys/dev/cx/if_cx.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/cx/if_cx.c Fri May 10 16:41:26 2013 (r250460) @@ -1,7 +1,7 @@ /*- * Cronyx-Sigma adapter driver for FreeBSD. * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode, - * and asyncronous channels with full modem control. + * and asynchronous channels with full modem control. * Keepalive protocol implemented in both Cisco and PPP modes. * * Copyright (C) 1994-2002 Cronyx Engineering. Modified: head/sys/dev/hptmv/entry.c ============================================================================== --- head/sys/dev/hptmv/entry.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/hptmv/entry.c Fri May 10 16:41:26 2013 (r250460) @@ -914,8 +914,8 @@ hptmv_event_notify(MV_SATA_ADAPTER *pMvS else { - MV_ERROR("RR18xx: illigal value for param1(%d) at " - "connect/disconect event, host=%d\n", param1, + MV_ERROR("RR18xx: illegal value for param1(%d) at " + "connect/disconnect event, host=%d\n", param1, pMvSataAdapter->adapterId ); } @@ -983,7 +983,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T if ((pAdapter->responsesArrayBaseDmaAlignedAddr - pAdapter->responsesArrayBaseDmaAddr) != (pAdapter->responsesArrayBaseAlignedAddr - pAdapter->responsesArrayBaseAddr)) { - MV_ERROR("RR18xx[%d]: Error in Response Quueues Alignment\n", + MV_ERROR("RR18xx[%d]: Error in Response Queues Alignment\n", pAdapter->mvSataAdapter.adapterId); contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); Modified: head/sys/dev/isci/scil/scif_sas_domain.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_domain.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/isci/scil/scif_sas_domain.c Fri May 10 16:41:26 2013 (r250460) @@ -637,7 +637,7 @@ void scif_sas_domain_terminate_requests( SCIF_SAS_REQUEST_T * request = NULL; // Cycle through the fast list of IO requests. Terminate each - // oustanding requests that matches the criteria supplied by the + // outstanding requests that matches the criteria supplied by the // caller. while (element != NULL) { @@ -1275,7 +1275,7 @@ U8 scif_sas_domain_get_smp_request_count SCIC_TRANSPORT_PROTOCOL protocol; // Cycle through the fast list of IO requests. Terminate each - // oustanding requests that matches the criteria supplied by the + // outstanding requests that matches the criteria supplied by the // caller. while (element != NULL) { Modified: head/sys/dev/nsp/nsp.c ============================================================================== --- head/sys/dev/nsp/nsp.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/nsp/nsp.c Fri May 10 16:41:26 2013 (r250460) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); ***************************************************/ /* DEVICE CONFIGURATION FLAGS (MINOR) * - * 0x01 DISCONECT OFF + * 0x01 DISCONNECT OFF * 0x02 PARITY LINE OFF * 0x04 IDENTIFY MSG OFF ( = single lun) * 0x08 SYNC TRANSFER OFF Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri May 10 16:41:26 2013 (r250460) @@ -86,7 +86,7 @@ efx_mcdi_request_start( /* * efx_mcdi_request_start() is naturally serialised against both * efx_mcdi_request_poll() and efx_mcdi_ev_cpl()/efx_mcdi_ev_death(), - * by virtue of there only being one oustanding MCDI request. + * by virtue of there only being one outstanding MCDI request. * Unfortunately, upper layers may also call efx_mcdi_request_abort() * at any time, to timeout a pending mcdi request, That request may * then subsequently complete, meaning efx_mcdi_ev_cpl() or @@ -439,7 +439,7 @@ efx_mcdi_ev_death( * The MCDI request (if there is one) has been terminated, either * by a BADASSERT or REBOOT event. * - * If there is an oustanding event-completed MCDI operation, then we + * If there is an outstanding event-completed MCDI operation, then we * will never receive the completion event (because both MCDI * completions and BADASSERT events are sent to the same evq). So * complete this MCDI op. Modified: head/sys/dev/sn/if_sn.c ============================================================================== --- head/sys/dev/sn/if_sn.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/sn/if_sn.c Fri May 10 16:41:26 2013 (r250460) @@ -443,7 +443,7 @@ startagain: /* * Wait a short amount of time to see if the allocation request * completes. Otherwise, I enable the interrupt and wait for - * completion asyncronously. + * completion asynchronously. */ time_out = MEMORY_WAIT_TIME; Modified: head/sys/dev/stg/tmc18c30.c ============================================================================== --- head/sys/dev/stg/tmc18c30.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/dev/stg/tmc18c30.c Fri May 10 16:41:26 2013 (r250460) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); ***************************************************/ /* DEVICE CONFIGURATION FLAGS (MINOR) * - * 0x01 DISCONECT OFF + * 0x01 DISCONNECT OFF * 0x02 PARITY LINE OFF * 0x04 IDENTIFY MSG OFF ( = single lun) * 0x08 SYNC TRANSFER OFF Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/kern/uipc_usrreq.c Fri May 10 16:41:26 2013 (r250460) @@ -1370,7 +1370,7 @@ unp_connectat(int fd, struct socket *so, } /* - * The connecter's (client's) credentials are copied from its + * The connector's (client's) credentials are copied from its * process structure at the time of connect() (which is now). */ cru2x(td->td_ucred, &unp3->unp_peercred); Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Fri May 10 16:41:26 2013 (r250460) @@ -306,7 +306,7 @@ ng_l2cap_con_fail(ng_l2cap_con_p con, u_ /* * There still might be channels (in OPEN state?) that - * did not submit any commands, so diconnect them + * did not submit any commands, so disconnect them */ LIST_FOREACH(ch, &l2cap->chan_list, next) Modified: head/sys/ofed/drivers/net/mlx4/eq.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/eq.c Fri May 10 16:30:39 2013 (r250459) +++ head/sys/ofed/drivers/net/mlx4/eq.c Fri May 10 16:41:26 2013 (r250460) @@ -705,7 +705,7 @@ int mlx4_test_interrupts(struct mlx4_dev /* Temporary use polling for command completions */ mlx4_cmd_use_polling(dev); - /* Map the new eq to handle all asyncronous events */ + /* Map the new eq to handle all asynchronous events */ err = mlx4_MAP_EQ(dev, MLX4_ASYNC_EVENT_MASK, 0, priv->eq_table.eq[i].eqn); if (err) { Modified: head/usr.sbin/bluetooth/hccontrol/link_control.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/link_control.c Fri May 10 16:30:39 2013 (r250459) +++ head/usr.sbin/bluetooth/hccontrol/link_control.c Fri May 10 16:41:26 2013 (r250460) @@ -357,7 +357,7 @@ again: goto again; return (OK); -} /* hci_diconnect */ +} /* hci_disconnect */ /* Send Add_SCO_Connection command to the unit */ static int Modified: head/usr.sbin/dumpcis/printcis.c ============================================================================== --- head/usr.sbin/dumpcis/printcis.c Fri May 10 16:30:39 2013 (r250459) +++ head/usr.sbin/dumpcis/printcis.c Fri May 10 16:41:26 2013 (r250460) @@ -969,7 +969,7 @@ dump_network_ext(u_char *p, int len) printf(" %02x", p[i + 2]); putchar('\n'); break; - case 5: /* Connecter type */ + case 5: /* Connector type */ if (len < 2) goto err; printf("\tNetwork connector: %s connector standard\n", From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:48:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 21BC1BBC; Fri, 10 May 2013 16:48:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 145668A2; Fri, 10 May 2013 16:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AGmLOi058897; Fri, 10 May 2013 16:48:21 GMT (envelope-from asomers@svn.freebsd.org) Received: (from asomers@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AGmLId058896; Fri, 10 May 2013 16:48:21 GMT (envelope-from asomers@svn.freebsd.org) Message-Id: <201305101648.r4AGmLId058896@svn.freebsd.org> From: Alan Somers Date: Fri, 10 May 2013 16:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250461 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:48:22 -0000 Author: asomers Date: Fri May 10 16:48:21 2013 New Revision: 250461 URL: http://svnweb.freebsd.org/changeset/base/250461 Log: MFC r249951 According to devctl(4), clients must read events whole; they may not piece them together from multiple reads(). It's as if /dev/devctl is a datagram device instead of a stream device. However, devd's internal buffer was too small (1025 bytes) to read an entire ereport.fs.zfs.checksum event (variable, up to ~1300 bytes). This commit enlarges the buffer to 8k. Approved by: ken (mentor) Modified: stable/9/sbin/devd/devd.h Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.h ============================================================================== --- stable/9/sbin/devd/devd.h Fri May 10 16:41:26 2013 (r250460) +++ stable/9/sbin/devd/devd.h Fri May 10 16:48:21 2013 (r250461) @@ -53,6 +53,6 @@ int yyparse(void); __END_DECLS #define PATH_DEVCTL "/dev/devctl" -#define DEVCTL_MAXBUF 1025 +#define DEVCTL_MAXBUF 8192 #endif /* DEVD_H */ From owner-svn-src-all@FreeBSD.ORG Fri May 10 16:55:41 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6625A114; Fri, 10 May 2013 16:55:41 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 51CBB91D; Fri, 10 May 2013 16:55:41 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (c-67-180-208-218.hsd1.ca.comcast.net [67.180.208.218]) by elvis.mu.org (Postfix) with ESMTPSA id 26D0F1A3CEC; Fri, 10 May 2013 09:55:34 -0700 (PDT) Message-ID: <518D2673.4010109@mu.org> Date: Fri, 10 May 2013 09:55:15 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Marcel Moolenaar Subject: Re: svn commit: r250411 - in head/sys: conf kern sys References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305100952.45101.jhb@freebsd.org> <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> In-Reply-To: <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcel Moolenaar , John Baldwin , svn-src-all@freebsd.org, attilio@freebsd.org, src-committers@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 16:55:41 -0000 On 5/10/13 8:46 AM, Marcel Moolenaar wrote: > > And all I did is to allow someone (= Juniper) to not print the LOR > for this well-known and mostly ignored case that is impacting our > ability to keep witness enabled. And the reason I had to do that is > that this is a long-standing LOR that isn't being addressed. The > FreeBSD community apparently has settled on just ignoring it. This whole issue about not allowing developers to mute warnings stems from some FreeBSD developers inability to imagine that they are not locus of architecture at an organization. We really need to gain the ability to put ourselves in the shoes of someone that is just one of MANY people working on a product, a product that can choose its platform, FreeBSD, or if FreeBSD fails, then Linux or whatever works. Allowing people to customize and/or mute these error messages, when they are often superfluous is good. It allows the team to work on the parts that they need to work on and ignore the noise from other broken parts of FreeBSD that will eventually be fixed by the community. If FreeBSD is supposed to be for the community, then why does it have portions (WITNESS/INVARIANTS/etc?) that are not for the community? -Alfred From owner-svn-src-all@FreeBSD.ORG Fri May 10 17:11:26 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E09317BD; Fri, 10 May 2013 17:11:26 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) by mx1.freebsd.org (Postfix) with ESMTP id 728DBA71; Fri, 10 May 2013 17:11:26 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id f11so436193qae.8 for ; Fri, 10 May 2013 10:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ugYvxMd17T9Y7f68QESZUwoUwilzT67GgiX4T2h1dxc=; b=WCO/kuxw8jBafY+20fPeeo8XYy4DX4a1QWJhpksRxunHj88+KNoDeA3B2h9uFDElXZ AlK3oL17dC8zBQ3J52aXKIG6nVo6YBmd0i4f6PGdb59o5kv3TofuqreWaB5LtruGh8fT qxUJUctI5X4q6LGtONgu5HV5sGqZv5LIlPrBfp2tn8ynnRiG/N7uee0DH9yDNXySWC83 4NwdZl2U0vYAGs7kiUS7m/jkx83Jfw8q/l8VL3fJOG+eDHElbxEwVUmCXcPFtrY284Gn VB4Ls9A7ekzn0xWIGkIm6aFRGnIqhO117kryJvdS2qVegl3zR/JpuQeZTBn/IcxW0v8c j24A== MIME-Version: 1.0 X-Received: by 10.224.179.148 with SMTP id bq20mr12658011qab.30.1368205526179; Fri, 10 May 2013 10:05:26 -0700 (PDT) Received: by 10.49.18.193 with HTTP; Fri, 10 May 2013 10:05:26 -0700 (PDT) In-Reply-To: <201305100423.r4A4N44u094726@svn.freebsd.org> References: <201305100423.r4A4N44u094726@svn.freebsd.org> Date: Fri, 10 May 2013 13:05:26 -0400 Message-ID: Subject: Re: svn commit: r250432 - head/usr.bin/split From: Benjamin Kaduk To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 17:11:27 -0000 On Fri, May 10, 2013 at 12:23 AM, Eitan Adler wrote: > Modified: head/usr.bin/split/split.c > > ============================================================================== > --- head/usr.bin/split/split.c Fri May 10 03:49:05 2013 (r250431) > +++ head/usr.bin/split/split.c Fri May 10 04:23:03 2013 (r250432) > @@ -359,9 +367,19 @@ newfile(void) > ofd = fileno(stdout); > } > > - /* maxfiles = 26^sufflen, but don't use libm. */ > + if (dflag) { > + beg = '0'; > + end = '9'; > + } > + else { > + beg = 'a'; > + end = 'z'; > + } > + pattlen = end - beg + 1; > + > + /* maxfiles = pattlen^sufflen, but don't use libm. */ > for (maxfiles = 1, i = 0; i < sufflen; i++) > - if ((maxfiles *= 26) <= 0) > + if ((maxfiles *= pattlen) <= 0) > This check relies on signed integer overflow, which is undefined behavior. Furthermore, even if one assumes a non-evil compiler and two's complement representation, this check fails for pattlen == 10. 10**9 is representable as both a signed and unsigned 32-bit integer, but 10**10 overflows both variants and ends up in the positive side of the signed space. With a fixed number of bases to be exponentiated here (10 or 26), it would seem much simpler to do the logarithm manually out-of-band and just hardcode a check on sufflen (noting that maxfiles is of type long which can be either 32 or 64 bits). -Ben > errx(EX_USAGE, "suffix is too long (max %ld)", i); > > if (fnum == maxfiles) > From owner-svn-src-all@FreeBSD.ORG Fri May 10 17:30:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E00AE8A; Fri, 10 May 2013 17:30:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4A8C05; Fri, 10 May 2013 17:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AHUUqC075109; Fri, 10 May 2013 17:30:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AHUUUs075105; Fri, 10 May 2013 17:30:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101730.r4AHUUUs075105@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 17:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250462 - head/usr.bin/lockf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 17:30:30 -0000 Author: eadler Date: Fri May 10 17:30:29 2013 New Revision: 250462 URL: http://svnweb.freebsd.org/changeset/base/250462 Log: Add option to lockf to avoid creating a file if it does not exist. PR: bin/170775 Submitted by: Matthew Story Reviewed by: scottl MFC after: 1 week Modified: head/usr.bin/lockf/lockf.1 head/usr.bin/lockf/lockf.c Modified: head/usr.bin/lockf/lockf.1 ============================================================================== --- head/usr.bin/lockf/lockf.1 Fri May 10 16:48:21 2013 (r250461) +++ head/usr.bin/lockf/lockf.1 Fri May 10 17:30:29 2013 (r250462) @@ -32,7 +32,7 @@ .Nd execute a command while holding a file lock .Sh SYNOPSIS .Nm -.Op Fl ks +.Op Fl kns .Op Fl t Ar seconds .Ar file .Ar command @@ -90,6 +90,18 @@ Causes .Nm to operate silently. Failure to acquire the lock is indicated only in the exit status. +.It Fl n +Causes +.Nm +to fail if the specified lock +.Ar file +does not exist. If +.Fl n +is not specified, +.Nm +will create +.Ar file +if necessary. .It Fl t Ar seconds Specifies a timeout for waiting for the lock. By default, @@ -130,6 +142,10 @@ The utility was unable to create the lock file, e.g., because of insufficient access privileges. +.It Dv EX_UNAVAILABLE +The +.Fl n +option is specified and the specified lock file does not exist. .It Dv EX_USAGE There was an error on the .Nm Modified: head/usr.bin/lockf/lockf.c ============================================================================== --- head/usr.bin/lockf/lockf.c Fri May 10 16:48:21 2013 (r250461) +++ head/usr.bin/lockf/lockf.c Fri May 10 17:30:29 2013 (r250462) @@ -56,16 +56,20 @@ static volatile sig_atomic_t timed_out; int main(int argc, char **argv) { - int ch, silent, status, waitsec; + int ch, flags, silent, status, waitsec; pid_t child; silent = keep = 0; + flags = O_CREAT; waitsec = -1; /* Infinite. */ - while ((ch = getopt(argc, argv, "skt:")) != -1) { + while ((ch = getopt(argc, argv, "sknt:")) != -1) { switch (ch) { case 'k': keep = 1; break; + case 'n': + flags &= ~O_CREAT; + break; case 's': silent = 1; break; @@ -118,13 +122,13 @@ main(int argc, char **argv) * avoiding the separate step of waiting for the lock. This * yields fairness and improved performance. */ - lockfd = acquire_lock(lockname, O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK); while (lockfd == -1 && !timed_out && waitsec != 0) { if (keep) - lockfd = acquire_lock(lockname, 0); + lockfd = acquire_lock(lockname, flags); else { wait_for_lock(lockname); - lockfd = acquire_lock(lockname, O_NONBLOCK); + lockfd = acquire_lock(lockname, flags | O_NONBLOCK); } } if (waitsec > 0) @@ -165,7 +169,7 @@ acquire_lock(const char *name, int flags { int fd; - if ((fd = open(name, O_RDONLY|O_CREAT|O_EXLOCK|flags, 0666)) == -1) { + if ((fd = open(name, flags|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { if (errno == EAGAIN || errno == EINTR) return (-1); err(EX_CANTCREAT, "cannot open %s", name); @@ -215,7 +219,7 @@ usage(void) { fprintf(stderr, - "usage: lockf [-ks] [-t seconds] file command [arguments]\n"); + "usage: lockf [-kns] [-t seconds] file command [arguments]\n"); exit(EX_USAGE); } From owner-svn-src-all@FreeBSD.ORG Fri May 10 17:42:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A6DB7624; Fri, 10 May 2013 17:42:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 996EDD49; Fri, 10 May 2013 17:42:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AHgENr079104; Fri, 10 May 2013 17:42:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AHgEbQ079103; Fri, 10 May 2013 17:42:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101742.r4AHgEbQ079103@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 17:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250463 - head/usr.sbin/mergemaster X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 17:42:14 -0000 Author: eadler Date: Fri May 10 17:42:13 2013 New Revision: 250463 URL: http://svnweb.freebsd.org/changeset/base/250463 Log: Permit relative paths with mergemaster -m Reviewed by: dim, brooks MFC after: 3 days Modified: head/usr.sbin/mergemaster/mergemaster.sh Modified: head/usr.sbin/mergemaster/mergemaster.sh ============================================================================== --- head/usr.sbin/mergemaster/mergemaster.sh Fri May 10 17:30:29 2013 (r250462) +++ head/usr.sbin/mergemaster/mergemaster.sh Fri May 10 17:42:13 2013 (r250463) @@ -483,6 +483,7 @@ if [ ! -f ${SOURCEDIR}/Makefile.inc1 -a sleep 3 SOURCEDIR=${SOURCEDIR}/.. fi +SOURCEDIR=$(realpath "$SOURCEDIR") # Setup make to use system files from SOURCEDIR MM_MAKE="make ${ARCHSTRING} -m ${SOURCEDIR}/share/mk" From owner-svn-src-all@FreeBSD.ORG Fri May 10 18:01:30 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66494D30; Fri, 10 May 2013 18:01:30 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-we0-x22d.google.com (mail-we0-x22d.google.com [IPv6:2a00:1450:400c:c03::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 5B286E47; Fri, 10 May 2013 18:01:29 +0000 (UTC) Received: by mail-we0-f173.google.com with SMTP id q54so4220745wes.18 for ; Fri, 10 May 2013 11:01:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=w0eEqRn88ny0ViC38HDE3SSRgdmny6TENOY7GECJWB4=; b=G/6Vz+Rryrrw4oU3wK3oZwdrQ6xRoPrHvKR9w7S8tgpUuUk8jwsxeh6IGulDB7O7D7 HY2ROGpUCLBxbHUnR7+Q9GnViiegGyrDg1URV7oDm6sHl85b23Pou6JwN6IY90V2NTjD kVMYZeCFxUOqwfYO0NR+JRDXpSzd/bb7mcg8U0kb5ldzNh1lcbqd/uJjoXBGh21GkTF6 NdUiR5M7xsecbD5faVt3XQcLCiWHjkQQ/k7E0xnA0Dl54hnhNv9zwWklId9rhvi9SJPC f9khebYSF+ChruZrvE5adZNWxQ+nU9/hn/3xX2vc8844K0W9SNYji+cUAE4Nr4WKXY/a TaHQ== X-Received: by 10.194.248.200 with SMTP id yo8mr26352780wjc.36.1368208888584; Fri, 10 May 2013 11:01:28 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by mx.google.com with ESMTPSA id e8sm4956671wic.5.2013.05.10.11.01.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 10 May 2013 11:01:27 -0700 (PDT) Date: Fri, 10 May 2013 20:01:25 +0200 From: Mateusz Guzik To: Eitan Adler Subject: Re: svn commit: r250462 - head/usr.bin/lockf Message-ID: <20130510180124.GA11396@dft-labs.eu> References: <201305101730.r4AHUUUs075105@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201305101730.r4AHUUUs075105@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 18:01:30 -0000 On Fri, May 10, 2013 at 05:30:30PM +0000, Eitan Adler wrote: > Author: eadler > Date: Fri May 10 17:30:29 2013 > New Revision: 250462 > URL: http://svnweb.freebsd.org/changeset/base/250462 > > Log: > Add option to lockf to avoid creating a file if it does not exist. > Patch seems to be incomplete. > +.It Dv EX_UNAVAILABLE > +The > +.Fl n > +option is specified and the specified lock file does not exist. > .It Dv EX_USAGE > There was an error on the > .Nm > > > - if ((fd = open(name, O_RDONLY|O_CREAT|O_EXLOCK|flags, 0666)) == -1) { > + if ((fd = open(name, flags|O_RDONLY|O_EXLOCK|flags, 0666)) == -1) { > if (errno == EAGAIN || errno == EINTR) > return (-1); > err(EX_CANTCREAT, "cannot open %s", name); EX_UNAVAILABLE is never returned. -- Mateusz Guzik From owner-svn-src-all@FreeBSD.ORG Fri May 10 18:09:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AC8FB14A; Fri, 10 May 2013 18:09:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8553FEB3; Fri, 10 May 2013 18:09:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AI9dGh087650; Fri, 10 May 2013 18:09:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AI9dqX087647; Fri, 10 May 2013 18:09:39 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201305101809.r4AI9dqX087647@svn.freebsd.org> From: Michael Tuexen Date: Fri, 10 May 2013 18:09:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250466 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 18:09:39 -0000 Author: tuexen Date: Fri May 10 18:09:38 2013 New Revision: 250466 URL: http://svnweb.freebsd.org/changeset/base/250466 Log: Honor the net.inet6.ip6.v6only sysctl variable and the IPV6_V6ONLY socket option for SCTP sockets in the same way as for UDP or TCP sockets. MFC after: 2 weeks Modified: head/sys/netinet/sctp_pcb.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Fri May 10 18:05:45 2013 (r250465) +++ head/sys/netinet/sctp_pcb.c Fri May 10 18:09:38 2013 (r250466) @@ -2376,8 +2376,13 @@ sctp_inpcb_alloc(struct socket *so, uint inp->sctp_socket = so; inp->ip_inp.inp.inp_socket = so; #ifdef INET6 - if (MODULE_GLOBAL(ip6_auto_flowlabel)) { - inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + if (INP_SOCKAF(so) == AF_INET6) { + if (MODULE_GLOBAL(ip6_auto_flowlabel)) { + inp->ip_inp.inp.inp_flags |= IN6P_AUTOFLOWLABEL; + } + if (MODULE_GLOBAL(ip6_v6only)) { + inp->ip_inp.inp.inp_flags |= IN6P_IPV6_V6ONLY; + } } #endif inp->sctp_associd_counter = 1; Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Fri May 10 18:05:45 2013 (r250465) +++ head/sys/netinet6/sctp6_usrreq.c Fri May 10 18:09:38 2013 (r250466) @@ -787,18 +787,11 @@ sctp6_send(struct socket *so, int flags, } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - struct sockaddr_in sin; + struct sockaddr_in sin; - /* convert v4-mapped into v4 addr and send */ - in6_sin6_2_sin(&sin, sin6); - return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, - control, p)); - } else { - /* mapped addresses aren't enabled */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr and send */ + in6_sin6_2_sin(&sin, sin6); + return (sctp_sendm(so, flags, m, (struct sockaddr *)&sin, control, p)); } #endif /* INET */ connected_type: @@ -932,17 +925,9 @@ sctp6_connect(struct socket *so, struct } } if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { - if (!MODULE_GLOBAL(ip6_v6only)) { - /* convert v4-mapped into v4 addr */ - in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); - addr = (struct sockaddr *)&ss; - } else { - /* mapped addresses aren't enabled */ - SCTP_INP_RUNLOCK(inp); - SCTP_ASOC_CREATE_UNLOCK(inp); - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP6_USRREQ, EINVAL); - return (EINVAL); - } + /* convert v4-mapped into v4 addr */ + in6_sin6_2_sin((struct sockaddr_in *)&ss, sin6); + addr = (struct sockaddr *)&ss; } #endif /* INET */ /* Now do we connect? */ From owner-svn-src-all@FreeBSD.ORG Fri May 10 18:43:39 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F243B190; Fri, 10 May 2013 18:43:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D548097; Fri, 10 May 2013 18:43:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AIhcwo000509; Fri, 10 May 2013 18:43:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AIhbtx000503; Fri, 10 May 2013 18:43:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305101843.r4AIhbtx000503@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 18:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250469 - head/bin/dd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 18:43:39 -0000 Author: eadler Date: Fri May 10 18:43:36 2013 New Revision: 250469 URL: http://svnweb.freebsd.org/changeset/base/250469 Log: Make dd's signal handler async safe. PR: bin/75258 Submitted by: "Oleg V. Nauman" Arrival Date: Sun Dec 19 14:50:21 GMT 2004 Reviewed by: mjg, jhb Reviewed by: jilles (earlier version) MFC after: 1 week Modified: head/bin/dd/args.c head/bin/dd/conv_tab.c head/bin/dd/dd.c head/bin/dd/extern.h head/bin/dd/misc.c head/bin/dd/position.c Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/args.c Fri May 10 18:43:36 2013 (r250469) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/bin/dd/conv_tab.c ============================================================================== --- head/bin/dd/conv_tab.c Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/conv_tab.c Fri May 10 18:43:36 2013 (r250469) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "dd.h" Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/dd.c Fri May 10 18:43:36 2013 (r250469) @@ -81,6 +81,7 @@ size_t cbsz; /* conversion block size uintmax_t files_cnt = 1; /* # of files to copy */ const u_char *ctab; /* conversion table */ char fill_char; /* Character to fill with if defined */ +volatile sig_atomic_t need_summary; int main(int argc __unused, char *argv[]) @@ -89,7 +90,7 @@ main(int argc __unused, char *argv[]) jcl(argv); setup(); - (void)signal(SIGINFO, summaryx); + (void)signal(SIGINFO, siginfo_handler); (void)signal(SIGINT, terminate); atexit(summary); @@ -375,6 +376,9 @@ dd_in(void) in.dbp += in.dbrcnt; (*cfunc)(); + if (need_summary) { + summary(); + } } } Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/extern.h Fri May 10 18:43:36 2013 (r250469) @@ -43,7 +43,7 @@ void jcl(char **); void pos_in(void); void pos_out(void); void summary(void); -void summaryx(int); +void siginfo_handler(int); void terminate(int); void unblock(void); void unblock_close(void); @@ -61,3 +61,4 @@ extern const u_char e2a_32V[], e2a_POSIX extern const u_char a2ibm_32V[], a2ibm_POSIX[]; extern u_char casetab[]; extern char fill_char; +extern volatile sig_atomic_t need_summary; Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/misc.c Fri May 10 18:43:36 2013 (r250469) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -57,41 +58,32 @@ summary(void) { struct timeval tv; double secs; - char buf[100]; (void)gettimeofday(&tv, NULL); secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start; if (secs < 1e-6) secs = 1e-6; - /* Use snprintf(3) so that we don't reenter stdio(3). */ - (void)snprintf(buf, sizeof(buf), + (void)fprintf(stderr, "%ju+%ju records in\n%ju+%ju records out\n", st.in_full, st.in_part, st.out_full, st.out_part); - (void)write(STDERR_FILENO, buf, strlen(buf)); - if (st.swab) { - (void)snprintf(buf, sizeof(buf), "%ju odd length swab %s\n", + if (st.swab) + (void)fprintf(stderr, "%ju odd length swab %s\n", st.swab, (st.swab == 1) ? "block" : "blocks"); - (void)write(STDERR_FILENO, buf, strlen(buf)); - } - if (st.trunc) { - (void)snprintf(buf, sizeof(buf), "%ju truncated %s\n", + if (st.trunc) + (void)fprintf(stderr, "%ju truncated %s\n", st.trunc, (st.trunc == 1) ? "block" : "blocks"); - (void)write(STDERR_FILENO, buf, strlen(buf)); - } - (void)snprintf(buf, sizeof(buf), + (void)fprintf(stderr, "%ju bytes transferred in %.6f secs (%.0f bytes/sec)\n", st.bytes, secs, st.bytes / secs); - (void)write(STDERR_FILENO, buf, strlen(buf)); + need_summary = 0; } /* ARGSUSED */ void -summaryx(int notused __unused) +siginfo_handler(int signo __unused) { - int save_errno = errno; - summary(); - errno = save_errno; + need_summary = 1; } /* ARGSUSED */ Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Fri May 10 18:41:14 2013 (r250468) +++ head/bin/dd/position.c Fri May 10 18:43:36 2013 (r250469) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "dd.h" @@ -91,6 +92,8 @@ pos_in(void) } } else --cnt; + if (need_summary) + summary(); continue; } From owner-svn-src-all@FreeBSD.ORG Fri May 10 18:51:22 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E7874DF; Fri, 10 May 2013 18:51:22 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 5D063FD; Fri, 10 May 2013 18:51:21 +0000 (UTC) Received: from jsiegel-sslvpn-nc.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.6/8.14.6) with ESMTP id r4AIpJa6001919 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 10 May 2013 11:51:21 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Marcel Moolenaar In-Reply-To: <201305101211.35808.jhb@freebsd.org> Date: Fri, 10 May 2013 11:51:20 -0700 Content-Transfer-Encoding: 7bit Message-Id: <6CBEB766-087B-41F4-B549-2D60F4FD2701@xcllnt.net> References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305100952.45101.jhb@freebsd.org> <405C7C78-A626-4836-BD90-16FD08DD3196@xcllnt.net> <201305101211.35808.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1503) Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 18:51:22 -0000 On May 10, 2013, at 9:11 AM, John Baldwin wrote: > On Friday, May 10, 2013 11:46:54 am Marcel Moolenaar wrote: >>> >>> 2) vnode locks from a local filesystem that report a LOR with a "devfs" >>> vnode. Typical reports are either "ufs" -> "devfs" or in some cases >>> "ufs" -> "devfs" -> "ufs". As with 1), I would much rather tag the >>> offending location than to disable all WITNESS checking on vnode locks. >> >> With more file system types in use, this will get mixed up with the >> other file systems and noise you get is rather severe. It is a big >> problem for us at Juniper. > > Note, it is very specific that the second lock is always "devfs". I think > that points to this being isolated to a few specific places, not a generic > ordering problem. Alas, that's not the case. These LORs are reported between ufs and unionfs, or ufs and isofs, etc. It's not just between something and devfs. > /* > * Locking: > * > * The relationship between inode and dirhash is protected either by an > * exclusive vnode lock or the vnode interlock where a shared vnode lock > * may be used. The dirhash_mtx is acquired after the dirhash lock. To > * handle teardown races, code wishing to lock the dirhash for an inode > * when using a shared vnode lock must obtain a private reference on the > * dirhash while holding the vnode interlock. They can drop it once they > * have obtained the dirhash lock and verified that the dirhash wasn't > * recycled while they waited for the dirhash lock. > * > * ufsdirhash_build() acquires a shared lock on the dirhash when it is > * successful. This lock is released after a call to ufsdirhash_lookup(). > * > * Functions requiring exclusive access use ufsdirhash_acquire() which may > * free a dirhash structure that was recycled by ufsdirhash_recycle(). > * > * The dirhash lock may be held across io operations. > * > * WITNESS reports a lock order reversal between the "bufwait" lock > * and the "dirhash" lock. However, this specific reversal will not > * cause a deadlock. To get a deadlock, one would have to lock a > * buffer followed by the dirhash while a second thread locked a > * buffer while holding the dirhash lock. The second order can happen > * under a shared or exclusive vnode lock for the associated directory > * in lookup(). The first order, however, can only happen under an > * exclusive vnode lock (e.g. unlink(), rename(), etc.). Thus, for > * a thread to be doing a "bufwait" -> "dirhash" order, it has to hold > * an exclusive vnode lock. That exclusive vnode lock will prevent > * any other threads from doing a "dirhash" -> "bufwait" order. > */ > > So the issue here is that shared locks and exclusive locks are not quite > the same. Perhaps this is something that WITNESS could "know" generically, > and one solution might be to use separate witness "objects" for shared > acquires on a lock vs exclusive acquires on a lock, but I'm not sure > that wouldn't result in false negatives (i.e. WITNESS not reporting a > LOR that can deadlock). My intuition is that the general rule would not > be safe, so I would rather annotate the specific false positive in this > case to remove the noise of a known-false-positive. I'm not sure the only options we have are to ignore the problem or implement a general fix. If we set out to silence witness for the known false positives then it's ok to handle them on a case by case basis. We'll see patterns soon enough and then re-code the solutions in terms of those patterns. If we're lucky we see a single general solution, but if not, then it's fine to have a handful of special case. The worse we can do is not address it at all. My commit was met with a statement that comes really close to "you made witness useless", after which the argument changed to we can't make witness better. At this time my change seems like the best of all possible suggestions. > rules to the duplicate check currently). Vnode locks are another example > of this actually. You can lock a child of a directory while holding the > vnode lock of the parent directory but not vice versa. That particular > rule would be very hard to verify in WITNESS directly (given two vnode > lock pointers, could you "prove" that one is a parent directory of the > other non-trivially in witness_checkorder()? I seriously doubt it), so we > accept some false-negatives to avoid false-positive LORs on every path > lookup. Thus, in practice I think your goal of having WITNESS understand > every possible nuance is a bit unrealistic and not consistent with our > use of it historically. I'm not sure where you get the notion that my goal is to have witness understand every possible nuance. My commit certainly is not achieving such a goal. In fact, it's accepting the imperfections we have by not have those imperfections render to tool unusable. All I want is for witness to be silent about false positives or known uncertainties so that we can establish clear processes in case witness does warn. The extend to which we can be successful is not known to me, but I do know that keeping silent for LORs between vnode locks is good enough for me now and useful to FreeBSD users in general. If a vnode lock is an example of class of locking paradigms, then we just need to rename the flags I committed and have it naturally cover the entire class. If we can add complexity to witness to handle some nuances then it's good to have it available with a kernel option. People writing file systems are helped by having vnode locks checked properly and as completely as possible (i.e. with all possible nuances if such is doable). This is not to say that such is a mode of operation then must be used or work as a default. In short: we need more flexibility in general -- at the minimum in what witness reports or keeps quiet about, but ideally we need more flexibility in the amount of checking we allow witness to do for classes or kinds of locks. Such implies providing it with more of the nuances in some cases and it also implies that it'll be more costly in general. That's all fine. We just need a good default that works for most people and kernel options to allow people to tune it further to their needs. -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-all@FreeBSD.ORG Fri May 10 18:58:14 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 993C46F6; Fri, 10 May 2013 18:58:14 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 60429151; Fri, 10 May 2013 18:58:13 +0000 (UTC) Received: from localhost (host-89-230-160-233.ostrowmaz.mm.pl [89.230.160.233]) by mail.dawidek.net (Postfix) with ESMTPSA id D07F432F; Fri, 10 May 2013 20:54:08 +0200 (CEST) Date: Fri, 10 May 2013 21:00:40 +0200 From: Pawel Jakub Dawidek To: Mikolaj Golub Subject: Re: svn commit: r250379 - in head/usr.sbin/bsnmpd/modules: . snmp_hast Message-ID: <20130510190039.GA1404@garage.freebsd.pl> References: <201305082003.r48K3cYv062256@svn.freebsd.org> <20130509071412.GA94250@gmail.com> <20130509082243.GP3047@kib.kiev.ua> <20130509100533.GC94250@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline In-Reply-To: <20130509100533.GC94250@gmail.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Peter Wemm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 18:58:14 -0000 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 09, 2013 at 01:05:35PM +0300, Mikolaj Golub wrote: > On Thu, May 09, 2013 at 11:22:43AM +0300, Konstantin Belousov wrote: > > Why do you need libl.a ? If only for yywrap(), then re-implementing > > it for the module seems to be trivial. >=20 > Yes, it is like so. Thanks! I am now considering two possible > solutions: >=20 > 1) As it is suggested above, add trivial yywrap() and link without -ll. >=20 > 2) Add '%option noyywrap' to hastd/token.l, and link hastd, hastctl > and snmp_hast without -ll (it looks like yywrap is needed only when > parsing more than one file). >=20 > See the patches below. It looks both solutions work for me and I > personally prefer the second one. Me too. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://mobter.com --AqsLC8rIMeq19msA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlGNQ9cACgkQForvXbEpPzRipACdH1aQq/niehW19Zv7Cyt9+4Y1 tW4AoJmlbCZjz/EdZxfbqdIptlfeS7TR =c/2z -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA-- From owner-svn-src-all@FreeBSD.ORG Fri May 10 19:09:56 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0AEFCB3; Fri, 10 May 2013 19:09:56 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-vb0-x230.google.com (mail-vb0-x230.google.com [IPv6:2607:f8b0:400c:c02::230]) by mx1.freebsd.org (Postfix) with ESMTP id 30C491FD; Fri, 10 May 2013 19:09:56 +0000 (UTC) Received: by mail-vb0-f48.google.com with SMTP id q16so3741729vbe.35 for ; Fri, 10 May 2013 12:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=+YxFoRWcCfgxmcD00CnCgRs4mV4y732pHY3aRxYjjuc=; b=mGqv59JffPyUojBUwnDy0fXsjrG94v+2hnIWmi+DGk+5W1vt1SxxYq4E4Q4b7h0USY c0RkHzX7ur/l+G8qWZPk64lXcgZ02OprcFfOrRvrqNOu9ZAFSbZo2pbdSa6+IX5zhp8a uVT701EQTm2Dz+YrJT8bZkVl5nZJaZlaNPaWbDUFK/UnIENzSiXrCi94caT5ehRwYYfs GUx+y4LlL87ljWq/fhfiFTTIB9a6hg3nhnWZUUh/vAoCA/NoygRJnNzHBn65jc+qb7bK c++snqEHZLtSCu1f1+RNEhEmTAasJP1Sx+BR8qlp9QYLTNx3dWzmVkLXIg0lV8usz0V1 pl2w== MIME-Version: 1.0 X-Received: by 10.58.90.5 with SMTP id bs5mr11841939veb.60.1368212995737; Fri, 10 May 2013 12:09:55 -0700 (PDT) Received: by 10.220.141.72 with HTTP; Fri, 10 May 2013 12:09:55 -0700 (PDT) In-Reply-To: <201305101742.r4AHgEbQ079103@svn.freebsd.org> References: <201305101742.r4AHgEbQ079103@svn.freebsd.org> Date: Fri, 10 May 2013 12:09:55 -0700 Message-ID: Subject: Re: svn commit: r250463 - head/usr.sbin/mergemaster From: Garrett Cooper To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 19:09:56 -0000 On Fri, May 10, 2013 at 10:42 AM, Eitan Adler wrote: > Author: eadler > Date: Fri May 10 17:42:13 2013 > New Revision: 250463 > URL: http://svnweb.freebsd.org/changeset/base/250463 > > Log: > Permit relative paths with mergemaster -m > > Reviewed by: dim, brooks > MFC after: 3 days > > Modified: > head/usr.sbin/mergemaster/mergemaster.sh > > Modified: head/usr.sbin/mergemaster/mergemaster.sh bin/173929 ? From owner-svn-src-all@FreeBSD.ORG Fri May 10 19:22:43 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D6AA92C6; Fri, 10 May 2013 19:22:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C98DC264; Fri, 10 May 2013 19:22:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AJMhK9014667; Fri, 10 May 2013 19:22:43 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AJMhfW014666; Fri, 10 May 2013 19:22:43 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201305101922.r4AJMhfW014666@svn.freebsd.org> From: Ed Maste Date: Fri, 10 May 2013 19:22:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r250474 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 19:22:43 -0000 Author: emaste Date: Fri May 10 19:22:43 2013 New Revision: 250474 URL: http://svnweb.freebsd.org/changeset/base/250474 Log: Release Mark Johnston (markj@) from mentorship. He's ready to collect his own pointy hats. Congrats! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Fri May 10 19:19:09 2013 (r250473) +++ svnadmin/conf/mentors Fri May 10 19:22:43 2013 (r250474) @@ -27,7 +27,6 @@ jinmei gnn jonathan rwatson jwd rmacklem kargl das -markj emaste Co-mentor: rstone miwi rwatson monthadar adrian nork imp From owner-svn-src-all@FreeBSD.ORG Fri May 10 19:33:02 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB61296E for ; Fri, 10 May 2013 19:33:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x22d.google.com (mail-pb0-x22d.google.com [IPv6:2607:f8b0:400e:c01::22d]) by mx1.freebsd.org (Postfix) with ESMTP id 853C32EE for ; Fri, 10 May 2013 19:33:02 +0000 (UTC) Received: by mail-pb0-f45.google.com with SMTP id mc8so1095728pbc.32 for ; Fri, 10 May 2013 12:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=fgygQY8EW/LXZ2dxaU1O9Pf5NQ2ZK2fPRBEmJR/4t/E=; b=TBjBCdjmXPJoSiFwYC35b/0FeJ2VxxWkotQjFXMp7OohhO4deEXOdSx2oha+PpqXHc sGj5QLyS0e7YV0KyWlhD95yGvsgEwELWXJNMKnhF8hvpTnPcAyP1UZ8Ii9KY61DFzgIY o4/brJbzQPFsXIz0N78VuKPhiHXfSGsFnoWDI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=fgygQY8EW/LXZ2dxaU1O9Pf5NQ2ZK2fPRBEmJR/4t/E=; b=O6EY53sffw8FIEt8ZZ/7MATmaw6AyLuJ4G12hD1q4+MXjplZRAPM5wUHnd8e5JJnXO BcYllC1OgSNFo0OQwyjJyEKWWu477G0DLzvbpKukW68GmVXn/bxQncYCgKro4Z/ub4cV l53IK3WadNSOdEkZ6+MO1qMoIxRMkygyCmpyDnXIS8V44IUtcg8QXVMQC8wiGVoG8YoC Em4lRaMrsPPySs44GI/pp4ceiTOar6R0es75FY9XlKwjdVpfIpB3px4y+ezXFhJ+Vt2J /BmkC6wGPrsOUpYalvZDW30hx2x5SZmJEOAp6hQ14yaTk5MScrdLlPeVyBp2j8cKcpNK a/Kw== X-Received: by 10.68.97.130 with SMTP id ea2mr18228228pbb.129.1368214382133; Fri, 10 May 2013 12:33:02 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 10 May 2013 12:32:32 -0700 (PDT) In-Reply-To: References: <201305101742.r4AHgEbQ079103@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 May 2013 15:32:32 -0400 X-Google-Sender-Auth: UQpqXIHDLUxK2jx18tptaCOkDM8 Message-ID: Subject: Re: svn commit: r250463 - head/usr.sbin/mergemaster To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQkhXnhPhf65ZOwvh/yRX4AfQSzkZAe6+haujk9Txx9lq+peY2GgWtDra5dE+QhDd0TBaBHm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 19:33:02 -0000 On 10 May 2013 15:09, Garrett Cooper wrote: > On Fri, May 10, 2013 at 10:42 AM, Eitan Adler wrote: >> Author: eadler >> Date: Fri May 10 17:42:13 2013 >> New Revision: 250463 >> URL: http://svnweb.freebsd.org/changeset/base/250463 >> >> Log: >> Permit relative paths with mergemaster -m >> >> Reviewed by: dim, brooks >> MFC after: 3 days >> >> Modified: >> head/usr.sbin/mergemaster/mergemaster.sh >> >> Modified: head/usr.sbin/mergemaster/mergemaster.sh > > bin/173929 ? Yes, sorry for not including the PR number. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@FreeBSD.ORG Fri May 10 19:37:05 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 752F9B49; Fri, 10 May 2013 19:37:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id B0CB331A; Fri, 10 May 2013 19:37:04 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id ia10so3976765vcb.41 for ; Fri, 10 May 2013 12:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=LCHteiLAP+iDYCClv/+NKNjmxBuNuq2WPzHcsHqcjQs=; b=JW1fm/vs5GWcHcwikW6Pj9g9DN+Rr3vj9kz8a/2WaVNFDEN/vDwUeKiGiLr6EjfuuG 3QZiEOyuO3fI2h0ODw7FzvQ0gES8HKo+zUjWIql7p+ie4cK0OfJnGaZUKdtDBojkyQkT HihdeYhb6pucQ0ZMhWfVHI7kYx+kAib4SbxEOXtUiqfD3FLE75zYqaS3fieN+SHeDzr8 zVImTDqPtU/R/M6hx77iw0Etp9QHnDYO8fCV4MN59TXEe6gpAlxqbm2E8a8ltlDU4CE+ H69kTWYtouGg5cOoiCLrg0cO9Bilz8SwaLz3xIp6b2JXteU7h1NmnVT5SGLauc98LxwH KJtg== MIME-Version: 1.0 X-Received: by 10.58.90.5 with SMTP id bs5mr11908965veb.60.1368214624118; Fri, 10 May 2013 12:37:04 -0700 (PDT) Received: by 10.220.141.72 with HTTP; Fri, 10 May 2013 12:37:04 -0700 (PDT) In-Reply-To: References: <201305101742.r4AHgEbQ079103@svn.freebsd.org> Date: Fri, 10 May 2013 12:37:04 -0700 Message-ID: Subject: Re: svn commit: r250463 - head/usr.sbin/mergemaster From: Garrett Cooper To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 19:37:05 -0000 On Fri, May 10, 2013 at 12:32 PM, Eitan Adler wrote: ... > Yes, sorry for not including the PR number. No worries :). Thanks for the fix! -Garrett From owner-svn-src-all@FreeBSD.ORG Fri May 10 20:02:16 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 72CE82AF; Fri, 10 May 2013 20:02:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6416E3ED; Fri, 10 May 2013 20:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AK2GZZ028495; Fri, 10 May 2013 20:02:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AK2Gmv028494; Fri, 10 May 2013 20:02:16 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305102002.r4AK2Gmv028494@svn.freebsd.org> From: Xin LI Date: Fri, 10 May 2013 20:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250477 - head/usr.bin/calendar/calendars X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 20:02:16 -0000 Author: delphij Date: Fri May 10 20:02:15 2013 New Revision: 250477 URL: http://svnweb.freebsd.org/changeset/base/250477 Log: REST IN PEACE Alexander Botero-Lowry Born June 2, 1986 in Austin, Texas Died August 24, 2012 in San Francisco, California Thank you for your contributions, you will be greatly missed. Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Fri May 10 19:44:02 2013 (r250476) +++ head/usr.bin/calendar/calendars/calendar.freebsd Fri May 10 20:02:15 2013 (r250477) @@ -258,6 +258,7 @@ 08/19 Pav Lucistnik born in Kutna Hora, Czech Republic, 1980 08/20 Michael Heffner born in Cleona, Pennsylvania, United States, 1981 08/24 Mark Linimon born in Houston, Texas, United States, 1955 +08/24 Alexander Botero-Lowry died in San Francisco, California, United States, 2012 08/25 Beech Rintoul born in Oakland, California, United States, 1952 08/25 Jean Milanez Melo born in Divinopolis, Minas Gerais, Brazil, 1982 08/26 Dima Ruban born in Nalchik, USSR, 1970 From owner-svn-src-all@FreeBSD.ORG Fri May 10 20:02:33 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5624E419; Fri, 10 May 2013 20:02:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2755F3EE; Fri, 10 May 2013 20:02:32 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1572B926; Fri, 10 May 2013 16:02:28 -0400 (EDT) From: John Baldwin To: Marcel Moolenaar Subject: Re: svn commit: r250411 - in head/sys: conf kern sys Date: Fri, 10 May 2013 15:33:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305101211.35808.jhb@freebsd.org> <6CBEB766-087B-41F4-B549-2D60F4FD2701@xcllnt.net> In-Reply-To: <6CBEB766-087B-41F4-B549-2D60F4FD2701@xcllnt.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201305101533.26992.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 10 May 2013 16:02:28 -0400 (EDT) Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 20:02:33 -0000 On Friday, May 10, 2013 2:51:20 pm Marcel Moolenaar wrote: > > On May 10, 2013, at 9:11 AM, John Baldwin wrote: > > > On Friday, May 10, 2013 11:46:54 am Marcel Moolenaar wrote: > >>> > >>> 2) vnode locks from a local filesystem that report a LOR with a "devfs" > >>> vnode. Typical reports are either "ufs" -> "devfs" or in some cases > >>> "ufs" -> "devfs" -> "ufs". As with 1), I would much rather tag the > >>> offending location than to disable all WITNESS checking on vnode locks. > >> > >> With more file system types in use, this will get mixed up with the > >> other file systems and noise you get is rather severe. It is a big > >> problem for us at Juniper. > > > > Note, it is very specific that the second lock is always "devfs". I think > > that points to this being isolated to a few specific places, not a generic > > ordering problem. > > Alas, that's not the case. These LORs are reported between ufs and unionfs, > or ufs and isofs, etc. It's not just between something and devfs. Ugh, I have only seen them with devfs so had presumed them to be more localized (and thus more easily targeted). In that case your change may be as fine-grained as we can get. I would also like to still keep WITNESS checking between vnode locks and other lock types, and LK_NOWITNESS would remove that, so between your change and Attilio's approach I do prefer yours. > I'm not sure the only options we have are to ignore the problem > or implement a general fix. If we set out to silence witness for > the known false positives then it's ok to handle them on a case > by case basis. We'll see patterns soon enough and then re-code > the solutions in terms of those patterns. If we're lucky we see > a single general solution, but if not, then it's fine to have a > handful of special case. The worse we can do is not address it > at all. I was assuming that the reversals were far more specific, and knowing about other false positives like the dirhash one, I want a generic way to do more fine-grained marking of false positives. If there were only a few places we would need to mark to fix the reversals you see, then I would prefer the suspend/resume approach for your case. However, the reversals you are masking sound too widespread to support that. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri May 10 20:55:40 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D6324DB; Fri, 10 May 2013 20:55:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE6A847; Fri, 10 May 2013 20:55:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4AKteI9046836; Fri, 10 May 2013 20:55:40 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AKtdCv046835; Fri, 10 May 2013 20:55:40 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305102055.r4AKtdCv046835@svn.freebsd.org> From: Mark Johnston Date: Fri, 10 May 2013 20:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250478 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 20:55:40 -0000 Author: markj Date: Fri May 10 20:55:39 2013 New Revision: 250478 URL: http://svnweb.freebsd.org/changeset/base/250478 Log: MFC r248776: Fix interval-based rotations when the -t flag is used. In this case, find the most-recently archived logfile and use its mtime to determine whether or not to rotate, as in the non-timestamped case. Previously we would just try to use the mtime of .0, which always results in a rotation since it generally doesn't exist in the -t case. Approved by: emaste Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Fri May 10 20:02:15 2013 (r250477) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Fri May 10 20:55:39 2013 (r250478) @@ -274,7 +274,7 @@ static void parse_args(int argc, char ** static int parse_doption(const char *doption); static void usage(void); static int log_trim(const char *logname, const struct conf_entry *log_ent); -static int age_old_log(char *file); +static int age_old_log(const char *file); static void savelog(char *from, char *to); static void createdir(const struct conf_entry *ent, char *dirpart); static void createlog(const struct conf_entry *ent); @@ -1445,6 +1445,66 @@ oldlog_entry_compare(const void *a, cons } /* + * Check whether the file corresponding to dp is an archive of the logfile + * logfname, based on the timefnamefmt format string. Return true and fill out + * tm if this is the case; otherwise return false. + */ +static int +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +{ + size_t logfname_len; + char *s; + int c; + + logfname_len = strlen(logfname); + + if (dp->d_type != DT_REG) + return (0); + /* Ignore everything but files with our logfile prefix. */ + if (strncmp(dp->d_name, logfname, logfname_len) != 0) + return (0); + /* Ignore the actual non-rotated logfile. */ + if (dp->d_namlen == logfname_len) + return (0); + + /* + * Make sure we created have found a logfile, so the + * postfix is valid, IE format is: '.