From owner-svn-src-head@FreeBSD.ORG Sun May 5 06:20:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 08:00:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 09:38:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 09:38:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 10:51:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 18:32:03 2013 Return-Path: Delivered-To: svn-src-head@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 43FCF763 for ; Sun, 5 May 2013 18:32:03 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx1.freebsd.org (Postfix) with ESMTP id C061F90E for ; Sun, 5 May 2013 18:32:02 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id v1so2810424lbd.39 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=cxZ+abVdDlYK2fT1213a/ZIBGzEAw3KrKN8tJ+IuQPDVWya9/LMQEmq5hKNGO0SFPY H/Rc0cw+QVyLsDdfZ/8jLki/VbVHc+a3CEu1fzUHRNJFAPXHkgd4w2/9p5zZehOCNFYp UN17A0h4DKZW4koKooEXUgfNLJ6UwsJSXsxd+e3htB206wzUfywlKJOIEyRvdre+7aV/ poMgx+82gzf5I4hU2VHWmsZMZ8C2RqrirtaRIywqw5jizoXABQFDqXWWmWl/EQIOpUEe UtWp6mbIRnp8L2EqBkOWIJsHDrWPrKbbEHZbB+umeE45TYh8EOHU+mNCLSPqezwtOABP baMA== 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: ALoCoQlSPDlCnbrwVVcbFPhrVBaX0fITztgwdRsvSISR8Ol3uG0ewBvAIBpORdWSzIl1ZP/o8vu3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 18:32:03 -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-head@FreeBSD.ORG Sun May 5 18:54:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 19:09:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 20:59:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 21:03:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Sun May 5 22:42:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 10:18:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 10:35:56 2013 Return-Path: Delivered-To: svn-src-head@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 C2AB3F9B for ; Mon, 6 May 2013 10:35:56 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com [209.85.217.172]) by mx1.freebsd.org (Postfix) with ESMTP id 4A9C37BB for ; Mon, 6 May 2013 10:35:55 +0000 (UTC) Received: by mail-lb0-f172.google.com with SMTP id y6so3247526lbh.3 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=csqRbPi/JX6U33jwJk6zilPFqiLFKnGHr+B3Q6Lzg93W/DechYGTdd2c0jJ/RDx0Rc gjjJ3IMZ96dhhjlGIw+tPsHWLMMPGdTOjWmBb+1FkZnza2QuLTLfD+3ThE7BnQmLJAau ChSBGbl+68aKNnHGC4AVHLVBvqyJksVQx7EY08c4xKVJYTlL2Gf//biw5vi0sfL3lC1a Coenp9gqjliumvlEuyy5WKHbEf6M0Kv8x+OS3ATQi8RjrKoaWuT9iy9j+P45OzS5O/JO WtyoSyX72fjQQCfS7h066h7b7Ax67t92i2KqidHW8wYVPBtuyHHVtrhechxA2dCHmy7g CGCg== 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: ALoCoQkI6GOoBNaUZXqFauyLM+wJoSuqmZwM/oMwVGB/L3UrJWsEReA8xE8kaW1+j/gkIsqRlVT2 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Sergey Kandaurov , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 13:34:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 13:52:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 14:12:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 14:27:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 14:37:05 2013 Return-Path: Delivered-To: svn-src-head@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 0ADBC5D7; Mon, 6 May 2013 14:37:05 +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 D8A20936; Mon, 6 May 2013 14:37:04 +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 1UZMXC-000425-DZ; Mon, 06 May 2013 14:36:58 +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 r46EauhZ014556; Mon, 6 May 2013 08:36:56 -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: U2FsdGVkX19Zijvh0wAiDWLxA8CnYWwk Subject: Re: svn commit: r250293 - in head/sys/arm: arm mv mv/armadaxp From: Ian Lepore To: Grzegorz Bernacki In-Reply-To: <201305061412.r46ECbkj018935@svn.freebsd.org> References: <201305061412.r46ECbkj018935@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 06 May 2013 08:36:56 -0600 Message-ID: <1367851016.1180.166.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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 May 2013 14:37:05 -0000 On Mon, 2013-05-06 at 14:12 +0000, Grzegorz Bernacki wrote: > 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: The comment for the added mapping is misleading, it should read something like "map VA 0xf1000000..0xf1100000 to PA 0xd0000000". Sorry I missed that in the pre-commit review. -- Ian From owner-svn-src-head@FreeBSD.ORG Mon May 6 14:54:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 14:57:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 15:30:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 15:58:54 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 16:11:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 16:16:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 16:42:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 16:50:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 16:51:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 17:21:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 17:44:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 17:55:24 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 18:13:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 18:30:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 18:45:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 19:47:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 19:50:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 19:56:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 20:05:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 20:27:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 21:04:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 21:43:16 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 21:44:07 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Mon May 6 21:57:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 02:03:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 02:05:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 03:57:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 04:04:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 04:23:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 04:40:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 04:46:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 04:47:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 05:30:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 05:40:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 06:22:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 06:42:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 07:04:43 2013 Return-Path: Delivered-To: svn-src-head@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 F2934865 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 985DA2CE 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 07:41:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 07:44:08 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 07:52:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 08:16:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 12:39:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 12:43:15 2013 Return-Path: Delivered-To: svn-src-head@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 B794B120 for ; Tue, 7 May 2013 12:43:15 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-da0-x22b.google.com (mail-da0-x22b.google.com [IPv6:2607:f8b0:400e:c00::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 91F5F3F7 for ; Tue, 7 May 2013 12:43:15 +0000 (UTC) Received: by mail-da0-f43.google.com with SMTP id u7so315951dae.30 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=oCVEjuD0jFnhFtBgU1kydsjfnN8eCTIrw7+9KT6ZFtKjYu4pCcJD0KO8dD2XygBjs8 tGdnZHdNyBt5j7QpjwPSN5t9HMF1i52xtsF6USdfqhUdRffR5BZY4c7bPXg9Cy+Gxxm1 0K9fwVc+eudpOtQyLY0XdacRYJzJ0/yUMfys9mpt2tRLtl2wDM/DhTGDlopCStvGz/Bt uJ6Gc2pywt5p552MElt7mFrbzE+IytkJgFD0dWwuOz40mCbIlaNpiYU95UhsMVA2Uat2 oze1Jl5qYLe7WSjalvIdiakPE+92TXhzh/dFxKv3vf5EcNBESttI31ulkJbUk/Ti5UnE 87fA== 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: ALoCoQmPh1wU36qdpx8M2f5ZyS8odz/scI1jZ+HVJXy4noDw/1o5Vatbh1J7p6bTsjzy4WSFP+JO Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 May 2013 12:43:15 -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-head@FreeBSD.ORG Tue May 7 18:08:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 18:45:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 20:35:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 22:05:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 22:46:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 22:49:57 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Tue May 7 22:58:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 00:20:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 00:55:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 01:11:27 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 03:21:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 07:30:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 08:53:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 09:42:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 10:55:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 10:56:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 12:53:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 13:26:18 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 14:13:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 16:26:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 16:29:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 17:45:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 18:21:13 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 18:25:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 18:55:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 19:11:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:03:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:04:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:46:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:52:23 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:53:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:54:59 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:56:43 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:57:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 20:58:42 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:02:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:04:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:06:48 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:07:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:07:34 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 21:23:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 22:50:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 22:54:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 23:25:55 2013 Return-Path: Delivered-To: svn-src-head@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 4BBC16E2 for ; Wed, 8 May 2013 23:25:55 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx1.freebsd.org (Postfix) with ESMTP id C4B27275 for ; Wed, 8 May 2013 23:25:54 +0000 (UTC) Received: by mail-vc0-f178.google.com with SMTP id kw10so2218000vcb.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=E3MCOX0xNbwKwO5avO+efnrCK5rIZXqoGm3LARqg0qK00JEdB4xAMoX7dtnCooVjV8 lZ6TNqznXC5fjKlrKw9JAs0op8C+F9ft2B1ho7YmyF6oFncJFiH+AL/bFCiDrpO3yaS4 coSFmtk3vDk0qhNvFdvOIknm82aRJny2ZKrwED9t/Dns5nKDRKaInQUpz5JEVZcE2Ouu PF7XnKNgf/+kvnRZAsd8h3p2jII62KcKQPHSVf2HuZcsUTJKnXNwFGh8NZYgWokyO8ZC qKy4AGEwqmPututw2wGmHNzAUKc5Zzg9D5PbGYpS2lJIaWCYVLMSdxGUNLM0F2qbc2+Q Tg+w== 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: ALoCoQkbH3UHwRIqCTGxyOPnTZB2xfrfXsQmZ73CblMvna6t7/uXT8mitqUiU+Jk5BX/JeY5bvdi Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:25:55 -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-head@FreeBSD.ORG Wed May 8 23:30:25 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Wed May 8 23:45:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4FFD9BCD for ; Wed, 8 May 2013 23:45:00 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx1.freebsd.org (Postfix) with ESMTP id 86359320 for ; Wed, 8 May 2013 23:45:00 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id m17so2286190vca.3 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=Xz/o+QEsmpeCwTSkHx/U+iSgbfb8Rj8mQsxpYRfBILpjYmlVPIQwwPvrRXDBWbZZv1 xDe6Zc6P2pMrR0FsYhwiJfxejMVJtf4ZTLBFerTqUwt8AoezinM3Wua3uCFBoe3YNTF8 hkEmyCDUZBq97VkqXZ68Fu5/LJQZzTc6m4DLNerhLEy46luZk7R2hs9brV/FFN03GsBz Nqp4U4n2oJDFKegWxI6yKD1GfB9z6LK39Vhm2FdMQB5VFcCxeaRltkX7pgjklyB29+Cs /Tva7VsKqIJsMJwgrDNnRxLaJl06ZwuQnGtAZgyusyoF1kBUb8oZ07PUUABy8HkhUVIa EbWA== 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: ALoCoQnWG5AFcJ6jXNHtNAOjdiqNDu5XSyMmq9zk5vm5jXnglHeCjNWFtUaI6FGH3SmUxvGCIyXQ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 May 2013 23:45:01 -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-head@FreeBSD.ORG Wed May 8 23:48:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 00:05:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 01:09:25 2013 Return-Path: Delivered-To: svn-src-head@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 82A86FDC for ; Thu, 9 May 2013 01:09:25 +0000 (UTC) (envelope-from bordjukov@gmail.com) Received: from mail-qc0-x231.google.com (mail-qc0-x231.google.com [IPv6:2607:f8b0:400d:c01::231]) by mx1.freebsd.org (Postfix) with ESMTP id 4CB5211EC for ; Thu, 9 May 2013 01:09:25 +0000 (UTC) Received: by mail-qc0-f177.google.com with SMTP id e1so1380265qcy.8 for ; Wed, 08 May 2013 18:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=CzGEKtNMxONJVjOU50t2tqVFAmOxb81gGvNYdwrK7ew=; b=ybqn1wqcy9AQX4fyVFck633/pAKNrPJRT1R8vMJslo1EsdbnHqjy3UkyJ/ZfWTS4r0 dSHFpt3dukCaF74qjf5Kyv6sS1SpTmSPbEmsm2neWY0nriUEKF85XxmSWQZDyN5IeXqI PWKJ9/2OuFrkgYcEOy2AiGYDFpgdQEx5W84Ox2wl2/w0x1KW32/M8oWLiLI+bF9oy93S iYpPYW3/dcS3Tqn2keDJF9w+erasVity5xFBhSB7hPBvsBFdIJOXupw+W03YgfZIf5xY vyJwaiXLVZW/6130gO9GEl5F3KHuEZpWL1xS1j/MJ42nWgYU8qadOANpIG5b6z+wIDFk OTRg== MIME-Version: 1.0 X-Received: by 10.229.157.201 with SMTP id c9mr2758751qcx.60.1368061764876; Wed, 08 May 2013 18:09:24 -0700 (PDT) Received: by 10.49.53.42 with HTTP; Wed, 8 May 2013 18:09:24 -0700 (PDT) Date: Thu, 9 May 2013 04:09:24 +0300 Message-ID: Subject: svn commit: r250385 - head/sys/mips/conf From: Petko Bordjukov To: svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 01:09:25 -0000 Hello, This commit leads to a TLB miss at device_get_parent on boot on the RS. RedBoot> load -p 6969 kernel/kernel Using default protocol (TFTP) Entry point: 0x80050100, address range: 0x80050000-0x8056ae38 RedBoot> exec Now booting linux kernel: Base address 0x80050000 Entry 0x80050100 Cmdline : console=ttyS0,115200 init=/init CPU platform: Atheros AR7161 rev 2 CPU Frequency=680 MHz CPU DDR Frequency=170 MHz CPU AHB Frequency=85 MHz platform frequency: 680000000 CPU reference clock: 40 MHz arguments: a0 = 00000002 a1 = 80050028 a2 = 80050000 a3 = 0000001b Cmd line: console=ttyS0,115200 init=/init Environment: memsize = 0x04000000 modetty0 = 0,n,8,1,hw ethaddr = ommitted board = Ubiquiti AR71xx-based board Cache info: picache_stride = 4096 picache_loopcount = 16 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: MIPS Technologies processor v116.147 MMU: Standard TLB, 16 entries L1 i-cache: 4 ways of 512 sets, 32 bytes per line L1 d-cache: 4 ways of 256 sets, 32 bytes per line Config1=0x9ee3519e Config3=0x20 KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2013 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #1 r250385: Thu May 9 04:04:12 EEST 2013 root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION mips gcc version 4.2.1 20070831 patched [FreeBSD] WARNING: WITNESS option enabled, expect reduced performance. MEMGUARD DEBUGGING ALLOCATOR INITIALIZED: MEMGUARD map base: 0xc0400000 MEMGUARD map limit: 0xc6a67000 MEMGUARD map size: 104860 KBytes real memory = 67108864 (65536K bytes) avail memory = 56496128 (53MB) random device not loaded; using insecure entropy nexus0: clock0: on nexus0 Timecounter "MIPS32" frequency 340000000 Hz quality 800 Event timer "MIPS32" frequency 340000000 Hz quality 800 apb0 at irq 4 on nexus0 uart0: <16550 or compatible> on apb0 uart0: console (115200,n,8,1) gpio0: on apb0 gpio0: [GIANT-LOCKED] gpio0: gpio pinmask=0x0 gpioc0: on gpio0 gpiobus0: on gpio0 gpioled0: at pin(s) 2 on gpiobus0 ehci0: at mem 0x1b000000-0x1bffffff irq 1 on nexus0 usbus0: set host controller mode usbus0: EHCI version 1.0 usbus0: set host controller mode usbus0 on ehci0 pcib0 at irq 0 on nexus0 pcib0: ar71xx_pci_attach: missing hint 'baseslot', default to AR71XX_PCI_BASE_SLOT pci0: on pcib0 ath0: irq 1 at device 18.0 on pci0 ath0: AR2413 mac 7.8 RF2413 phy 4.5 ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0056 ath1: irq 2 at device 19.0 on pci0 ath1: [HT] enabling HT modes ath1: [HT] 1 stream STBC receive enabled ath1: [HT] 1 stream STBC transmit enabled ath1: [HT] 2 RX streams; 2 TX streams ath1: AR9220 mac 128.2 RF5133 phy 13.0 ath1: 2GHz radio: 0x0000; 5GHz radio: 0x00c0 arge0: at mem 0x19000000-0x19000fff irq 2 on nexus0 miiproxy0: on arge0 arge0: can't attach proxy arge0: finishing attachment, phymask 100000, proxy null arge0: unable to attach PHY 20: 6 device_attach: arge0 attach returned 6 arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0 miiproxy1: on arge1 Trap cause = 2 (TLB miss (load or instr. fetch) - kernel mode) [ thread pid 0 tid 100000 ] Stopped at device_get_parent: jr ra db> where Tracing pid 0 tid 100000 td 0x80570170 db_trace_thread+30 (?,?,?,?) ra 807057b800000018 sp 0 sz 0 8007b19c+114 (0,?,ffffffff,?) ra 807057d000000020 sp 100000000 sz 1 8007a4e4+388 (?,?,?,?) ra 807057f0000000a8 sp 0 sz 0 db_command_loop+70 (?,?,?,?) ra 8070589800000018 sp 0 sz 0 8007cfe0+f4 (?,?,?,?) ra 807058b0000001a8 sp 0 sz 0 kdb_trap+110 (?,?,?,?) ra 80705a5800000030 sp 0 sz 0 trap+f18 (?,?,?,?) ra 80705a88000000b8 sp 0 sz 0 MipsKernGenException+134 (0,8100d880,8049ece8,fa) ra 80705b40000000c8 sp 100000001 sz 1 device_get_parent+0 (?,?,?,?) ra 80705c0800000000 sp 0 sz 0 pid 0 db> From owner-svn-src-head@FreeBSD.ORG Thu May 9 02:04:29 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 04:41:04 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 07:14:19 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 08:22:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 10:05:40 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 11:10:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 11:43:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 12:08:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 14:43:38 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 15:57:55 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:05:52 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:09:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:28:20 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:42:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:46:28 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 16:57:03 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 17:07:32 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 17:25:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 19:24:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 19:26:53 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 19:37:01 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 20:08:55 2013 Return-Path: Delivered-To: svn-src-head@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 404FA7A7; Thu, 9 May 2013 20:08:55 +0000 (UTC) (envelope-from bordjukov@gmail.com) Received: from mail-qa0-x234.google.com (mail-qa0-x234.google.com [IPv6:2607:f8b0:400d:c00::234]) by mx1.freebsd.org (Postfix) with ESMTP id CE9F6F47; Thu, 9 May 2013 20:08:54 +0000 (UTC) Received: by mail-qa0-f52.google.com with SMTP id g10so1900312qah.11 for ; Thu, 09 May 2013 13:08:54 -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=Pdj+yHhmxZy3NoUnp7+mzOPaIEwce1vLYptopqeTIsk=; b=Stc3dyK/5JXzlo0kcGrQQ7bYoo3rngilyHLQvdG50sxxZTTatioBL+OkU4kuo6FWen NV+7p7I+dBG8nHyVXA852MgHZAk4fuQPYMEF+RmBC6JM6vVb13ZEBc+oOc91Ff+ElNoD MjgUEcOsY4cNmMm/aWbygLx17cDy2wFq2oM/cHRDbEg1Q8T1mHw756It5fkmg4oiM721 O7t639sx6wY3lw4b+hhOseKPafgK9YwGYXul8i2xBdqEet0kpag0KzfxpAylXQPGkNdT qNULTRnScvy7kMDXm15vau4JThpr7dmOxMSyzX3rAvYpEwupFjmvSelA+w0vRXQqGb95 o+wg== MIME-Version: 1.0 X-Received: by 10.49.88.105 with SMTP id bf9mr10986272qeb.52.1368130133882; Thu, 09 May 2013 13:08:53 -0700 (PDT) Received: by 10.49.53.42 with HTTP; Thu, 9 May 2013 13:08:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 9 May 2013 23:08:53 +0300 Message-ID: Subject: Fwd: svn commit: r250385 - head/sys/mips/conf From: Petko Bordjukov To: svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: adrian@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 May 2013 20:08:55 -0000 FYI ---------- Forwarded message ---------- From: Luiz Otavio O Souza Date: Thu, May 9, 2013 at 10:24 PM Subject: Re: svn commit: r250385 - head/sys/mips/conf To: Petko Bordjukov Petko, Thanks! Well, there isn't too much to do or test with this driver, but you can see and set the media options for each port with etherswitchcfg(8). Soon i'll try to write the driver for the switch on routerstation, i'm now working on the RSPRO switch driver. Regards, Luiz On May 9, 2013, at 3:47 PM, Petko Bordjukov wrote: > Hello Luiz, > > Thank you, this patch fixed it. I will play around with it and report if something goes > wrong (testing is the least I cloud do). It looks OK though. > > > On Thu, May 9, 2013 at 7:49 PM, Luiz Otavio O Souza wrote: > Hello Petko and Adrian, > > Sorry for the delay... > > I guess i forgot to add the arge mdio hints, this is why it fail on device_get_parent() while attaching the miiproxy. > > Please verify if the attached patch fix your issue. > > And thanks for testing it. > > Luiz > > > > > > > On May 9, 2013, at 1:06 PM, Adrian Chadd wrote: > > > Can you do a 'show regs' ? > > > > > > > > > > Adrian > > > > > > On 9 May 2013 01:08, Petko Bordjukov wrote: > >> I guess I forgot to CC you :) > >> > >> ---------- Forwarded message ---------- > >> From: Petko Bordjukov > >> Date: Thu, May 9, 2013 at 4:09 AM > >> Subject: svn commit: r250385 - head/sys/mips/conf > >> To: svn-src-head@freebsd.org > >> > >> > >> Hello, > >> > >> This commit leads to a TLB miss at device_get_parent on boot on the RS. > >> > >> RedBoot> load -p 6969 kernel/kernel > >> Using default protocol (TFTP) > >> Entry point: 0x80050100, address range: 0x80050000-0x8056ae38 > >> RedBoot> exec > >> Now booting linux kernel: > >> Base address 0x80050000 Entry 0x80050100 > >> Cmdline : console=ttyS0,115200 init=/init > >> CPU platform: Atheros AR7161 rev 2 > >> CPU Frequency=680 MHz > >> CPU DDR Frequency=170 MHz > >> CPU AHB Frequency=85 MHz > >> platform frequency: 680000000 > >> CPU reference clock: 40 MHz > >> arguments: > >> a0 = 00000002 > >> a1 = 80050028 > >> a2 = 80050000 > >> a3 = 0000001b > >> Cmd line: console=ttyS0,115200 init=/init > >> Environment: > >> memsize = 0x04000000 > >> modetty0 = 0,n,8,1,hw > >> ethaddr = ommitted > >> board = Ubiquiti AR71xx-based board > >> Cache info: > >> picache_stride = 4096 > >> picache_loopcount = 16 > >> pdcache_stride = 4096 > >> pdcache_loopcount = 8 > >> cpu0: MIPS Technologies processor v116.147 > >> MMU: Standard TLB, 16 entries > >> L1 i-cache: 4 ways of 512 sets, 32 bytes per line > >> L1 d-cache: 4 ways of 256 sets, 32 bytes per line > >> Config1=0x9ee3519e > >> Config3=0x20 > >> KDB: debugger backends: ddb > >> KDB: current backend: ddb > >> Copyright (c) 1992-2013 The FreeBSD Project. > >> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > >> The Regents of the University of California. All rights reserved. > >> FreeBSD is a registered trademark of The FreeBSD Foundation. > >> FreeBSD 10.0-CURRENT #1 r250385: Thu May 9 04:04:12 EEST 2013 > >> root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION mips > >> gcc version 4.2.1 20070831 patched [FreeBSD] > >> WARNING: WITNESS option enabled, expect reduced performance. > >> MEMGUARD DEBUGGING ALLOCATOR INITIALIZED: > >> MEMGUARD map base: 0xc0400000 > >> MEMGUARD map limit: 0xc6a67000 > >> MEMGUARD map size: 104860 KBytes > >> real memory = 67108864 (65536K bytes) > >> avail memory = 56496128 (53MB) > >> random device not loaded; using insecure entropy > >> nexus0: > >> clock0: on nexus0 > >> Timecounter "MIPS32" frequency 340000000 Hz quality 800 > >> Event timer "MIPS32" frequency 340000000 Hz quality 800 > >> apb0 at irq 4 on nexus0 > >> uart0: <16550 or compatible> on apb0 > >> uart0: console (115200,n,8,1) > >> gpio0: on apb0 > >> gpio0: [GIANT-LOCKED] > >> gpio0: gpio pinmask=0x0 > >> gpioc0: on gpio0 > >> gpiobus0: on gpio0 > >> gpioled0: at pin(s) 2 on gpiobus0 > >> ehci0: at mem 0x1b000000-0x1bffffff > >> irq 1 on nexus0 > >> usbus0: set host controller mode > >> usbus0: EHCI version 1.0 > >> usbus0: set host controller mode > >> usbus0 on ehci0 > >> pcib0 at irq 0 on nexus0 > >> pcib0: ar71xx_pci_attach: missing hint 'baseslot', default to > >> AR71XX_PCI_BASE_SLOT > >> pci0: on pcib0 > >> ath0: irq 1 at device 18.0 on pci0 > >> ath0: AR2413 mac 7.8 RF2413 phy 4.5 > >> ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0056 > >> ath1: irq 2 at device 19.0 on pci0 > >> ath1: [HT] enabling HT modes > >> ath1: [HT] 1 stream STBC receive enabled > >> ath1: [HT] 1 stream STBC transmit enabled > >> ath1: [HT] 2 RX streams; 2 TX streams > >> ath1: AR9220 mac 128.2 RF5133 phy 13.0 > >> ath1: 2GHz radio: 0x0000; 5GHz radio: 0x00c0 > >> arge0: at mem > >> 0x19000000-0x19000fff irq 2 on nexus0 > >> miiproxy0: on arge0 > >> arge0: can't attach proxy > >> arge0: finishing attachment, phymask 100000, proxy null > >> arge0: unable to attach PHY 20: 6 > >> device_attach: arge0 attach returned 6 > >> arge1: at mem > >> 0x1a000000-0x1a000fff irq 3 on nexus0 > >> miiproxy1: on arge1 > >> Trap cause = 2 (TLB miss (load or instr. fetch) - kernel mode) > >> [ thread pid 0 tid 100000 ] > >> Stopped at device_get_parent: jr ra > >> db> where > >> Tracing pid 0 tid 100000 td 0x80570170 > >> db_trace_thread+30 (?,?,?,?) ra 807057b800000018 sp 0 sz 0 > >> 8007b19c+114 (0,?,ffffffff,?) ra 807057d000000020 sp 100000000 sz 1 > >> 8007a4e4+388 (?,?,?,?) ra 807057f0000000a8 sp 0 sz 0 > >> db_command_loop+70 (?,?,?,?) ra 8070589800000018 sp 0 sz 0 > >> 8007cfe0+f4 (?,?,?,?) ra 807058b0000001a8 sp 0 sz 0 > >> kdb_trap+110 (?,?,?,?) ra 80705a5800000030 sp 0 sz 0 > >> trap+f18 (?,?,?,?) ra 80705a88000000b8 sp 0 sz 0 > >> MipsKernGenException+134 (0,8100d880,8049ece8,fa) ra 80705b40000000c8 sp > >> 100000001 sz 1 > >> device_get_parent+0 (?,?,?,?) ra 80705c0800000000 sp 0 sz 0 > >> pid 0 > >> db> > >> > > > From owner-svn-src-head@FreeBSD.ORG Thu May 9 20:13:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 20:56:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 21:29:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 21:29:16 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 21:42:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 22:14:00 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Thu May 9 22:28:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 02:57:47 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 02:59:50 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:04:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:05:44 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:12:10 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:26:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9B083AF for ; Fri, 10 May 2013 03:26:30 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) by mx1.freebsd.org (Postfix) with ESMTP id 45B18666 for ; Fri, 10 May 2013 03:26:30 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id lx15so1110195lab.0 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=MU5rfb3X/p5NcwpE3z6lFq+n3l/aMKZD3oxgrhy4qJ4VyB9wPBqc+XWStyDPdCmdRb Z+f3NRZu1Y4ZwDxo94yuDL4n/Ed6HbdYPPlBdJL2tFfajJ/YbY7vuFzdtthPzYJn9SSl 6egfXs8KQa8KPidcZ8MjXwcOkweEa1ns06f8Tot6iM8tVOVmTeLvwz0M3Uuau1QRz8o0 IJlUedr/u3/PVAU8ctv82kaqD6Ynmp24Ag0xZM4dxRsG+wX6WthKOAZ+cNuTNmxtPrmP T2qQ8HXdBytB4TxZ4SPXtfsJb3k4DNGnMoiaSVVWdxJ9QACJkGYooXA7m40YpIPz4Hdc FJ5w== 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: ALoCoQmUqz0s83FjJq+i+ViRtFsNxMxVPt7AvUuuOm2hq6nANM0iApOI9tQlutiZQewYcvO0mvKh Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:26:30 -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-head@FreeBSD.ORG Fri May 10 03:42:49 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:49:06 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 03:55:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF94B3AC for ; Fri, 10 May 2013 03:55:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-da0-x230.google.com (mail-da0-x230.google.com [IPv6:2607:f8b0:400e:c00::230]) by mx1.freebsd.org (Postfix) with ESMTP id B73909CF for ; Fri, 10 May 2013 03:55:47 +0000 (UTC) Received: by mail-da0-f48.google.com with SMTP id h32so693714dak.7 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=MpTUmnJhQu+V8j+g1oE3HiwG7iFSgHPzP9pwtQd6Ce3a6lPedC9kqgQ38yTtR+4JZ8 9ts7FRfMApF0Uq8r9yZd1DU5Kw1G90ACXiW/th7vSufN2L7bVYElGoY2FgMTi/SPJ7Jr SG1Wjmm0/xueNYN3OC1rR0WnuEzlMCuZ69bfcIofLjVxZ/Y2IQbKhuJ+V7fKBskGAewj u0kyyzV4w/gCldWfJWxc2txBIWNSbUNDd5pvICJRhAO7L+BBImZtBu/NjzGPBhpNll2i aWD4Mra5Du3GQuTFxgSzZ4wbAR8uJDPEH6oGt283+hju2t6lbzj4GdKHy/w+tqWK7F6s pNnQ== 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: ALoCoQl4POkNqlEjHJx8nGGVCND9iK/kmMY6+OVch+62+SEQlu7ETh23LfU6gcVZv+kFilvMVUj3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 03:55:47 -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-head@FreeBSD.ORG Fri May 10 04:23:04 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 04:30:15 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 04:49:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 05:34:09 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 06:14:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 06:28:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 07:42:35 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 07:51:23 2013 Return-Path: Delivered-To: svn-src-head@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 0BEC0B28 for ; Fri, 10 May 2013 07:51:22 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx1.freebsd.org (Postfix) with ESMTP id D577E7C7 for ; Fri, 10 May 2013 07:51:21 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id v1so3942444lbd.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=gVHpjxt/jR1fKTcsVPa7jEopf4kiWS61D2n7tDlsBlFLH8l523ghXUP5ScLQiWbR0O JqMNXzz3sReggwWzA4k9/iwdx3PwszpHQ/6hdxwaEVjPLmuIvXmQ/XeC3tv/tLj1TuwK YZfCS4UoZ9aTCSYBARIKArEBa1QUkR40iGmUV5CJhm6FjZlTxGOL2O3YeG5H7Xr/ms5A MeMK8IO84JAaQj+0VnJ16KcP9iAIxEi8LW7nU5TB8BFnCyHzOFUxoBI/X0Of+i/T8X4R huU7CMCZ77NFuVA9If3Hk09P58rXaxi8Y4If2YLUKbxk/5gzRCilwnp8sUUVNXS9oNQX k6rA== 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: ALoCoQmFXUyNET7meP3NdDEQGc1W7TWHhpfVxeisrHZM2p/2Qqdbu15kBDK6qGiy3oV2reuwjt0/ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 07:51:23 -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-head@FreeBSD.ORG Fri May 10 08:46:11 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 09:37:58 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 09:58:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 10:06:46 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 10:21:45 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: smckay@internode.on.net List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 12:44:08 2013 Return-Path: Delivered-To: svn-src-head@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 16EDDB65 for ; Fri, 10 May 2013 12:44:08 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id E4CF77A4 for ; Fri, 10 May 2013 12:44:07 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id kx1so2897856pab.27 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=PLEIIr1Yn8OztbEUHqb57cf3yCy+zgPKujGxrRg+795MAnxjR2E6Ii1EdQjITA31FB SCQS4/DJE1wLCZDju+DIp13trG5lr6VW0sGKCwDmeo5aPfQW8+O3RI/4f73VINnoy+L+ J4QH2TL6UwTKc2ehhL/qmTXOmILZaxw86raIGFmQVhuDLFQbBy5b8tNfuEcJ44n16FyG qripOzSO1XovnSMEaxEA9ANHDvFhKYcONMmIqvh7qr3J9WAQUp/dFiLEaMiJb2zvQZ+m CtvqhqEk6X7p7XtG/lkZO5kgFqwfwZ8lPvTNMHoj7cG/5i1YXKQxwmKf/lT5VM+zHjyz moBA== 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: ALoCoQmbXE+dWopj/8v9WLMy2ii7r/p+JcKPwuykMWf8rfV/jxTt9SzcW7c29KTgQMqSeKFlINF3 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 12:44:08 -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-head@FreeBSD.ORG Fri May 10 12:49:17 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 13:36:37 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 13:57:45 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 13:58:51 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 14:02:13 2013 Return-Path: Delivered-To: svn-src-head@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 C986DECB for ; Fri, 10 May 2013 14:02:13 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx1.freebsd.org (Postfix) with ESMTP id A308BB2A for ; Fri, 10 May 2013 14:02:13 +0000 (UTC) Received: by mail-pa0-f45.google.com with SMTP id lj1so2968133pab.4 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=V1/kCVQvDKAW73CyJOAT95o9zoTGl5rbMnBjP1n9PXvSocy1MYItEwUdd+axCJHmUx ZzoVKdjb2zv2L++hzT4pekEoudNsgAf3s16ZlPtb8SqSfO4OldbvpHF7scXZrwDuXF/9 klymmnh0jJemP5+dL5MLlZzokiMnQAu5mTXnHtgaiHjB/zOi0zj/4JLBsS63GPBbb9S5 LClnd2+fIG0LmeXOrqKOPtQMXp9Ceq13eCuwjAlqboiTrSwbf8yJR6/CBKiYHXZAMa6X 1c4OBsO/uGbEAUMzLhWuDul5WMEgxmCG2RzYhK3wcjJPrGTh2max1lp2ckB6/F+upOyu bq2A== 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: ALoCoQni5Dl0RsWDhpO/y3VhvAggchkWdsvUk/uzh7eHDdeccmBeq3j9hmSr+qt4eJvN1FKJza0a Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 14:08:12 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 14:13:06 2013 Return-Path: Delivered-To: svn-src-head@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 0ED1354B for ; Fri, 10 May 2013 14:13:06 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id DB3C4C1D for ; Fri, 10 May 2013 14:13:05 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id kx1so2955498pab.27 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=hZWek2ELiCRKKCzCxszQoTuRFZ7w5wjbGQPit9RyADZG6/EudMg4wGxJ1LIP5u5k7e 1mZUa9tvbmQh54eye5Mc0R9623FjjPGMFfVrt1+b5/YtjqPcKkMc8r9AWII+cw2+wPdF zgvjRoizcPTVWqqGE2hVacaRItWyFgp5v4WnYRBjCoMpfY0CXaKq72dvlAx92/nnKKe9 llvdZ8vf2Q+633C6MzXt0EUllgctndNuLGS0ZHRQqemr4QseelJUMSEdH1p+s19Ey+iz Ql38lX5fLXKfpSgtxITOvINTfIaDdYir2q54OEYbGiC2LBeTGiPDxS8uoHjUrJQxhu0g jZGQ== 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: ALoCoQl8Vr05cGrbHEqnr+OPmZS7JDwGvxW8CMhv+fQJLm3Z2CDr30t50CehbiJgTcTQJGUT0dqg Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 14:14:36 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 15:46:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 16:12:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 16:12:02 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 16:30:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 16:55:41 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 17:11:26 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 17:30:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 17:42:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 18:01:30 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 18:09:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 18:43:39 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 18:51:22 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 18:58:14 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 19:09:56 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 19:33:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 716B296D for ; Fri, 10 May 2013 19:33:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pb0-x234.google.com (mail-pb0-x234.google.com [IPv6:2607:f8b0:400e:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id 49FB52ED for ; Fri, 10 May 2013 19:33:02 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id xa7so3002146pbc.39 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=NCEEazMh5GY+xQ3/IzeDQGZjAja6Imm6vJiO3Xmoygj4sQGs03+zlsVLV40Mr1Q/b9 o72ivXxdfByA2+6S7Fiy6S2znVqwxm6eaqPieBIDbVxnY/dg8KoLD6tifMgjJLsnei1E urkStj7nrTgOqwmeWnZuDCiaqzjvOUC3YW9s5bRwQlFAKiAo/xjgvNfiDj8pyP+hcVXl DTD3ZLUFuDcFAYrqHqRz1TdQ1DyKcPij2wEq9JPpmHNfBN2amwrji0+rKdhazwoYvbWD MT35luuS/u9xcueAgHC5cktsFiSWHbwOgB895FDW1R2EUMp8lao5WkYljgcbRvJcMNCk 8Qhg== 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: ALoCoQkM/fzhUAGCHoQf4vxu8dQpyIfplL5fRNjPTTcsbrBeV+Zi3tCWGfboSx/JjdiMwuRs2IKa Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 19:37:05 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 20:02:16 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 20:02:33 2013 Return-Path: Delivered-To: svn-src-head@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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@FreeBSD.ORG Fri May 10 22:43:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A97044EF; Fri, 10 May 2013 22:43:27 +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 9B4A3C1E; Fri, 10 May 2013 22:43: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 r4AMhRe1086269; Fri, 10 May 2013 22:43:27 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4AMhRQh086268; Fri, 10 May 2013 22:43:27 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201305102243.r4AMhRQh086268@svn.freebsd.org> From: Hiren Panchasara Date: Fri, 10 May 2013 22:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250487 - head/sys/x86/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 May 2013 22:43:27 -0000 Author: hiren Date: Fri May 10 22:43:27 2013 New Revision: 250487 URL: http://svnweb.freebsd.org/changeset/base/250487 Log: Adding a detach method to p4tcc driver. PR: 118739 Submitted by: Dan Lukes (earlier version) Reviewed by: jhb Approved by: sbruno (mentor) MFC after: 1 week Modified: head/sys/x86/cpufreq/p4tcc.c Modified: head/sys/x86/cpufreq/p4tcc.c ============================================================================== --- head/sys/x86/cpufreq/p4tcc.c Fri May 10 21:39:41 2013 (r250486) +++ head/sys/x86/cpufreq/p4tcc.c Fri May 10 22:43:27 2013 (r250487) @@ -73,6 +73,7 @@ static int p4tcc_features(driver_t *driv static void p4tcc_identify(driver_t *driver, device_t parent); static int p4tcc_probe(device_t dev); static int p4tcc_attach(device_t dev); +static int p4tcc_detach(device_t dev); static int p4tcc_settings(device_t dev, struct cf_setting *sets, int *count); static int p4tcc_set(device_t dev, const struct cf_setting *set); @@ -84,6 +85,7 @@ static device_method_t p4tcc_methods[] = DEVMETHOD(device_identify, p4tcc_identify), DEVMETHOD(device_probe, p4tcc_probe), DEVMETHOD(device_attach, p4tcc_attach), + DEVMETHOD(device_detach, p4tcc_detach), /* cpufreq interface */ DEVMETHOD(cpufreq_drv_set, p4tcc_set), @@ -213,6 +215,24 @@ p4tcc_attach(device_t dev) } static int +p4tcc_detach(device_t dev) +{ + struct cf_setting set; + int error; + + error = cpufreq_unregister(dev); + if (error) + return (error); + + /* + * Before we finish detach, switch to Automatic mode. + */ + set.freq = 10000; + p4tcc_set(dev, &set); + return(0); +} + +static int p4tcc_settings(device_t dev, struct cf_setting *sets, int *count) { struct p4tcc_softc *sc; From owner-svn-src-head@FreeBSD.ORG Sat May 11 01:31:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 77381E64; Sat, 11 May 2013 01:31:52 +0000 (UTC) (envelope-from rpaulo@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 6A0621A0; Sat, 11 May 2013 01:31: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 r4B1Vqh6048242; Sat, 11 May 2013 01:31:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4B1VqOM048241; Sat, 11 May 2013 01:31:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201305110131.r4B1VqOM048241@svn.freebsd.org> From: Rui Paulo Date: Sat, 11 May 2013 01:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250495 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 01:31:52 -0000 Author: rpaulo Date: Sat May 11 01:31:51 2013 New Revision: 250495 URL: http://svnweb.freebsd.org/changeset/base/250495 Log: Fix several standard extended feature bits. Submitted by: Oliver Pinter Modified: head/sys/amd64/amd64/identcpu.c Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Sat May 11 01:03:29 2013 (r250494) +++ head/sys/amd64/amd64/identcpu.c Sat May 11 01:31:51 2013 (r250495) @@ -407,11 +407,11 @@ printcpuinfo(void) /* Restricted Transactional Memory */ "\014RTM" /* Enhanced NRBG */ - "\022RDSEED" + "\023RDSEED" /* ADCX + ADOX */ - "\023ADX" + "\024ADX" /* Supervisor Mode Access Prevention */ - "\024SMAP" + "\025SMAP" ); } From owner-svn-src-head@FreeBSD.ORG Sat May 11 05:54:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EC8E84CF for ; Sat, 11 May 2013 05:54:05 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by mx1.freebsd.org (Postfix) with ESMTP id C3EE096B for ; Sat, 11 May 2013 05:54:05 +0000 (UTC) Received: by mail-pa0-f49.google.com with SMTP id bi5so3350208pad.8 for ; Fri, 10 May 2013 22:54: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=HOMSDtYF6sgbUW38bGsXA/ROZP97MkEuzVyAlaHs6/Y=; b=kSBCCJZsu7QmGdYAinRYhPB4aJ4TFlyIUtAFcjPpTGs/2FNVgECE5WpvJe3cK6Bpf1 oUpSSAlGQkHnDU0irGXiirz3fP6wX3Oo/Kjthx+dUF2uCOfceb4J94Nuc8452xcLAcIw cspxq17clpVi/jTa71Z6G3ZtXAfQsY9UFcxq4= 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=HOMSDtYF6sgbUW38bGsXA/ROZP97MkEuzVyAlaHs6/Y=; b=MZ7E1tJeBPY2m7FPfT/H25VqVQ/qvTrQckSPYD3SxIVvl7Rdn98Wbvs5W7b1s2Pkr8 6MpRtO23oo8FUxeAQpBq4QjtYaOLTScTvLEyPY+IWkazzEwSoWbUEn4zDmB14NomX0Ud utEBW+6fDttICoWpeFGbFugTmwM+2bBAmDJyYEHf//vKPKzz1wycfRaZNeCg6Q+14nMx 1E3tr8Tth5kw3BR2tCzWSOf6Yl0EFJGTvd19zCJZTHShfmW5NGYg4pUSgqR91GbCo0Da BEXC+tK06DBZF1+jc7Mm3CRe3ruM6d56awchaZOdKWyTQp3ixSoc9X0H8jU7OfudPCWK RwoA== X-Received: by 10.68.247.68 with SMTP id yc4mr20116156pbc.54.1368251644865; Fri, 10 May 2013 22:54:04 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.66.159.97 with HTTP; Fri, 10 May 2013 22:53:34 -0700 (PDT) In-Reply-To: References: <201305100423.r4A4N44u094726@svn.freebsd.org> From: Eitan Adler Date: Sat, 11 May 2013 01:53:34 -0400 X-Google-Sender-Auth: 4JVCRVDamF97sSG5W7iMvces-80 Message-ID: Subject: Re: svn commit: r250432 - head/usr.bin/split To: Benjamin Kaduk Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnVfT8MDymS0mA8w7Hx0BZjXyc4PLMNrxznHt9SmCuco3vJ7RhO/gmFZIVeqxykEAwALgiS Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 05:54:06 -0000 On 10 May 2013 13:05, Benjamin Kaduk wrote: > 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). ... Good point. I did not look closely at this code and assumed it was correct. I shall fix it. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Sat May 11 09:51:46 2013 Return-Path: Delivered-To: svn-src-head@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 2CA72363; Sat, 11 May 2013 09:51:46 +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 03D21F2; Sat, 11 May 2013 09:51: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 r4B9pjQu023317; Sat, 11 May 2013 09:51:45 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4B9piv0023310; Sat, 11 May 2013 09:51:44 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305110951.r4B9piv0023310@svn.freebsd.org> From: Mikolaj Golub Date: Sat, 11 May 2013 09:51:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250503 - in head: sbin/hastctl sbin/hastd 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 09:51:46 -0000 Author: trociny Date: Sat May 11 09:51:44 2013 New Revision: 250503 URL: http://svnweb.freebsd.org/changeset/base/250503 Log: Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: head/sbin/hastctl/Makefile head/sbin/hastd/Makefile head/sbin/hastd/token.l head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Modified: head/sbin/hastctl/Makefile ============================================================================== --- head/sbin/hastctl/Makefile Sat May 11 08:15:56 2013 (r250502) +++ head/sbin/hastctl/Makefile Sat May 11 09:51:44 2013 (r250503) @@ -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 Modified: head/sbin/hastd/Makefile ============================================================================== --- head/sbin/hastd/Makefile Sat May 11 08:15:56 2013 (r250502) +++ head/sbin/hastd/Makefile Sat May 11 09:51:44 2013 (r250503) @@ -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 Modified: head/sbin/hastd/token.l ============================================================================== --- head/sbin/hastd/token.l Sat May 11 08:15:56 2013 (r250502) +++ head/sbin/hastd/token.l Sat May 11 09:51:44 2013 (r250503) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } Modified: head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sat May 11 08:15:56 2013 (r250502) +++ head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sat May 11 09:51:44 2013 (r250503) @@ -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 From owner-svn-src-head@FreeBSD.ORG Sat May 11 10:51:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9EF9ACB; Sat, 11 May 2013 10:51:32 +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 BB2DF22E; Sat, 11 May 2013 10:51: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 r4BApW8P044108; Sat, 11 May 2013 10:51:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BApWEn044106; Sat, 11 May 2013 10:51:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305111051.r4BApWEn044106@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 11 May 2013 10:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250504 - in head: sys/netinet usr.sbin/arp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 10:51:32 -0000 Author: glebius Date: Sat May 11 10:51:32 2013 New Revision: 250504 URL: http://svnweb.freebsd.org/changeset/base/250504 Log: Rate limit the number of remotely triggered ARP log messages to 1 log message per second. Modified: head/sys/netinet/if_ether.c head/usr.sbin/arp/arp.4 Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sat May 11 09:51:44 2013 (r250503) +++ head/sys/netinet/if_ether.c Sat May 11 10:51:32 2013 (r250504) @@ -505,6 +505,9 @@ static int log_arp_wrong_iface = 1; static int log_arp_movements = 1; static int log_arp_permanent_modify = 1; static int allow_multicast = 0; +static struct timeval arp_lastlog; +static int arp_curpps; +static int arp_maxpps = 1; SYSCTL_INT(_net_link_ether_inet, OID_AUTO, log_arp_wrong_iface, CTLFLAG_RW, &log_arp_wrong_iface, 0, @@ -517,6 +520,15 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT "log arp replies from MACs different than the one in the permanent arp entry"); SYSCTL_INT(_net_link_ether_inet, OID_AUTO, allow_multicast, CTLFLAG_RW, &allow_multicast, 0, "accept multicast addresses"); +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_log_per_second, + CTLFLAG_RW, &arp_maxpps, 0, + "Maximum number of remotely triggered ARP messages that can be " + "logged per second"); + +#define ARP_LOG(pri, ...) do { \ + if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ + log((pri), "arp: " __VA_ARGS__); \ +} while (0) static void in_arpinput(struct mbuf *m) @@ -546,7 +558,7 @@ in_arpinput(struct mbuf *m) req_len = arphdr_len2(ifp->if_addrlen, sizeof(struct in_addr)); if (m->m_len < req_len && (m = m_pullup(m, req_len)) == NULL) { - log(LOG_NOTICE, "in_arp: runt packet -- m_pullup failed\n"); + ARP_LOG(LOG_NOTICE, "runt packet -- m_pullup failed\n"); return; } @@ -556,13 +568,13 @@ in_arpinput(struct mbuf *m) * a protocol length not equal to an IPv4 address. */ if (ah->ar_pln != sizeof(struct in_addr)) { - log(LOG_NOTICE, "in_arp: requested protocol length != %zu\n", + ARP_LOG(LOG_NOTICE, "requested protocol length != %zu\n", sizeof(struct in_addr)); goto drop; } if (allow_multicast == 0 && ETHER_IS_MULTICAST(ar_sha(ah))) { - log(LOG_NOTICE, "arp: %*D is multicast\n", + ARP_LOG(LOG_NOTICE, "%*D is multicast\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":"); goto drop; } @@ -658,9 +670,8 @@ match: if (!bcmp(ar_sha(ah), enaddr, ifp->if_addrlen)) goto drop; /* it's from me, ignore it. */ if (!bcmp(ar_sha(ah), ifp->if_broadcastaddr, ifp->if_addrlen)) { - log(LOG_NOTICE, - "arp: link address is broadcast for IP address %s!\n", - inet_ntoa(isaddr)); + ARP_LOG(LOG_NOTICE, "link address is broadcast for IP address " + "%s!\n", inet_ntoa(isaddr)); goto drop; } /* @@ -671,7 +682,7 @@ match: */ if (!bridged && !carped && isaddr.s_addr == myaddr.s_addr && myaddr.s_addr != 0) { - log(LOG_ERR, "arp: %*D is using my IP address %s on %s!\n", + ARP_LOG(LOG_ERR, "%*D is using my IP address %s on %s!\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":", inet_ntoa(isaddr), ifp->if_xname); itaddr = myaddr; @@ -694,7 +705,7 @@ match: /* the following is not an error when doing bridging */ if (!bridged && la->lle_tbl->llt_ifp != ifp) { if (log_arp_wrong_iface) - log(LOG_WARNING, "arp: %s is on %s " + ARP_LOG(LOG_WARNING, "%s is on %s " "but got reply from %*D on %s\n", inet_ntoa(isaddr), la->lle_tbl->llt_ifp->if_xname, @@ -708,8 +719,8 @@ match: if (la->la_flags & LLE_STATIC) { LLE_WUNLOCK(la); if (log_arp_permanent_modify) - log(LOG_ERR, - "arp: %*D attempts to modify " + ARP_LOG(LOG_ERR, + "%*D attempts to modify " "permanent entry for %s on %s\n", ifp->if_addrlen, (u_char *)ar_sha(ah), ":", @@ -717,7 +728,7 @@ match: goto reply; } if (log_arp_movements) { - log(LOG_INFO, "arp: %s moved from %*D " + ARP_LOG(LOG_INFO, "%s moved from %*D " "to %*D on %s\n", inet_ntoa(isaddr), ifp->if_addrlen, @@ -729,7 +740,7 @@ match: if (ifp->if_addrlen != ah->ar_hln) { LLE_WUNLOCK(la); - log(LOG_WARNING, "arp from %*D: addr len: new %d, " + ARP_LOG(LOG_WARNING, "from %*D: addr len: new %d, " "i/f %d (ignored)\n", ifp->if_addrlen, (u_char *) ar_sha(ah), ":", ah->ar_hln, ifp->if_addrlen); @@ -837,7 +848,7 @@ reply: if (!rt) goto drop; if (rt->rt_ifp != ifp) { - log(LOG_INFO, "arp_proxy: ignoring request" + ARP_LOG(LOG_INFO, "proxy: ignoring request" " from %s via %s, expecting %s\n", inet_ntoa(isaddr), ifp->if_xname, rt->rt_ifp->if_xname); Modified: head/usr.sbin/arp/arp.4 ============================================================================== --- head/usr.sbin/arp/arp.4 Sat May 11 09:51:44 2013 (r250503) +++ head/usr.sbin/arp/arp.4 Sat May 11 10:51:32 2013 (r250504) @@ -28,7 +28,7 @@ .\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 3, 2012 +.Dd May 11, 2013 .Dt ARP 4 .Os .Sh NAME @@ -148,6 +148,10 @@ See .Sx DIAGNOSTICS below. Turned on by default. +.It Va max_log_per_second +Limit number of remotely triggered logging events to a configured value +per second. +Default is 1 log message per second. .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. Default is 1200 seconds. From owner-svn-src-head@FreeBSD.ORG Sat May 11 11:17:45 2013 Return-Path: Delivered-To: svn-src-head@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 E894B24C; Sat, 11 May 2013 11:17:45 +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 DA9C82CA; Sat, 11 May 2013 11:17: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 r4BBHj1m052781; Sat, 11 May 2013 11:17:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BBHidt052772; Sat, 11 May 2013 11:17:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305111117.r4BBHidt052772@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 May 2013 11:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250505 - in head/sys: fs/nullfs 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 11:17:46 -0000 Author: kib Date: Sat May 11 11:17:44 2013 New Revision: 250505 URL: http://svnweb.freebsd.org/changeset/base/250505 Log: - Fix nullfs vnode reference leak in nullfs_reclaim_lowervp(). The null_hashget() obtains the reference on the nullfs vnode, which must be dropped. - Fix a wart which existed from the introduction of the nullfs caching, do not unlock lower vnode in the nullfs_reclaim_lowervp(). It should be innocent, but now it is also formally safe. Inform the nullfs_reclaim() about this using the NULLV_NOUNLOCK flag set on nullfs inode. - Add a callback to the upper filesystems for the lower vnode unlinking. When inactivating a nullfs vnode, check if the lower vnode was unlinked, indicated by nullfs flag NULLV_DROP or VV_NOSYNC on the lower vnode, and reclaim upper vnode if so. This allows nullfs to purge cached vnodes for the unlinked lower vnode, avoiding excessive caching. Reported by: G??ran L??wkrantz Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/fs/nullfs/null.h head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/nullfs/null_vnops.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/sys/mount.h Modified: head/sys/fs/nullfs/null.h ============================================================================== --- head/sys/fs/nullfs/null.h Sat May 11 10:51:32 2013 (r250504) +++ head/sys/fs/nullfs/null.h Sat May 11 11:17:44 2013 (r250505) @@ -53,8 +53,12 @@ struct null_node { LIST_ENTRY(null_node) null_hash; /* Hash list */ struct vnode *null_lowervp; /* VREFed once */ struct vnode *null_vnode; /* Back pointer */ + u_int null_flags; }; +#define NULLV_NOUNLOCK 0x0001 +#define NULLV_DROP 0x0002 + #define MOUNTTONULLMOUNT(mp) ((struct null_mount *)((mp)->mnt_data)) #define VTONULL(vp) ((struct null_node *)(vp)->v_data) #define NULLTOV(xp) ((xp)->null_vnode) Modified: head/sys/fs/nullfs/null_subr.c ============================================================================== --- head/sys/fs/nullfs/null_subr.c Sat May 11 10:51:32 2013 (r250504) +++ head/sys/fs/nullfs/null_subr.c Sat May 11 11:17:44 2013 (r250505) @@ -247,6 +247,7 @@ null_nodeget(mp, lowervp, vpp) xp->null_vnode = vp; xp->null_lowervp = lowervp; + xp->null_flags = 0; vp->v_type = lowervp->v_type; vp->v_data = xp; vp->v_vnlock = lowervp->v_vnlock; Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Sat May 11 10:51:32 2013 (r250504) +++ head/sys/fs/nullfs/null_vfsops.c Sat May 11 11:17:44 2013 (r250505) @@ -65,7 +65,6 @@ static vfs_statfs_t nullfs_statfs; static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; static vfs_extattrctl_t nullfs_extattrctl; -static vfs_reclaim_lowervp_t nullfs_reclaim_lowervp; /* * Mount null layer @@ -391,8 +390,37 @@ nullfs_reclaim_lowervp(struct mount *mp, vp = null_hashget(mp, lowervp); if (vp == NULL) return; + VTONULL(vp)->null_flags |= NULLV_NOUNLOCK; vgone(vp); - vn_lock(lowervp, LK_EXCLUSIVE | LK_RETRY); + vput(vp); +} + +static void +nullfs_unlink_lowervp(struct mount *mp, struct vnode *lowervp) +{ + struct vnode *vp; + struct null_node *xp; + + vp = null_hashget(mp, lowervp); + if (vp == NULL) + return; + xp = VTONULL(vp); + xp->null_flags |= NULLV_DROP | NULLV_NOUNLOCK; + vhold(vp); + vunref(vp); + + /* + * If vunref() dropped the last use reference on the nullfs + * vnode, it must be reclaimed, and its lock was split from + * the lower vnode lock. Need to do extra unlock before + * allowing the final vdrop() to free the vnode. + */ + if (vp->v_usecount == 0) { + KASSERT((vp->v_iflag & VI_DOOMED) != 0, + ("not reclaimed %p", vp)); + VOP_UNLOCK(vp, 0); + } + vdrop(vp); } static struct vfsops null_vfsops = { @@ -408,6 +436,7 @@ static struct vfsops null_vfsops = { .vfs_unmount = nullfs_unmount, .vfs_vget = nullfs_vget, .vfs_reclaim_lowervp = nullfs_reclaim_lowervp, + .vfs_unlink_lowervp = nullfs_unlink_lowervp, }; VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK | VFCF_JAIL); Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sat May 11 10:51:32 2013 (r250504) +++ head/sys/fs/nullfs/null_vnops.c Sat May 11 11:17:44 2013 (r250505) @@ -692,18 +692,24 @@ null_unlock(struct vop_unlock_args *ap) static int null_inactive(struct vop_inactive_args *ap __unused) { - struct vnode *vp; + struct vnode *vp, *lvp; + struct null_node *xp; struct mount *mp; struct null_mount *xmp; vp = ap->a_vp; + xp = VTONULL(vp); + lvp = NULLVPTOLOWERVP(vp); mp = vp->v_mount; xmp = MOUNTTONULLMOUNT(mp); - if ((xmp->nullm_flags & NULLM_CACHE) == 0) { + if ((xmp->nullm_flags & NULLM_CACHE) == 0 || + (xp->null_flags & NULLV_DROP) != 0 || + (lvp->v_vflag & VV_NOSYNC) != 0) { /* * If this is the last reference and caching of the - * nullfs vnodes is not enabled, then free up the - * vnode so as not to tie up the lower vnodes. + * nullfs vnodes is not enabled, or the lower vnode is + * deleted, then free up the vnode so as not to tie up + * the lower vnodes. */ vp->v_object = NULL; vrecycle(vp); @@ -748,7 +754,10 @@ null_reclaim(struct vop_reclaim_args *ap */ if (vp->v_writecount > 0) VOP_ADD_WRITECOUNT(lowervp, -1); - vput(lowervp); + if ((xp->null_flags & NULLV_NOUNLOCK) != 0) + vunref(lowervp); + else + vput(lowervp); free(xp, M_NULLFSNODE); return (0); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sat May 11 10:51:32 2013 (r250504) +++ head/sys/kern/vfs_subr.c Sat May 11 11:17:44 2013 (r250505) @@ -2700,19 +2700,20 @@ vgone(struct vnode *vp) } static void -vgonel_reclaim_lowervp_vfs(struct mount *mp __unused, +notify_lowervp_vfs_dummy(struct mount *mp __unused, struct vnode *lowervp __unused) { } /* - * Notify upper mounts about reclaimed vnode. + * Notify upper mounts about reclaimed or unlinked vnode. */ -static void -vgonel_reclaim_lowervp(struct vnode *vp) +void +vfs_notify_upper(struct vnode *vp, int event) { static struct vfsops vgonel_vfsops = { - .vfs_reclaim_lowervp = vgonel_reclaim_lowervp_vfs + .vfs_reclaim_lowervp = notify_lowervp_vfs_dummy, + .vfs_unlink_lowervp = notify_lowervp_vfs_dummy, }; struct mount *mp, *ump, *mmp; @@ -2736,7 +2737,17 @@ vgonel_reclaim_lowervp(struct vnode *vp) } TAILQ_INSERT_AFTER(&mp->mnt_uppers, ump, mmp, mnt_upper_link); MNT_IUNLOCK(mp); - VFS_RECLAIM_LOWERVP(ump, vp); + switch (event) { + case VFS_NOTIFY_UPPER_RECLAIM: + VFS_RECLAIM_LOWERVP(ump, vp); + break; + case VFS_NOTIFY_UPPER_UNLINK: + VFS_UNLINK_LOWERVP(ump, vp); + break; + default: + KASSERT(0, ("invalid event %d", event)); + break; + } MNT_ILOCK(mp); ump = TAILQ_NEXT(mmp, mnt_upper_link); TAILQ_REMOVE(&mp->mnt_uppers, mmp, mnt_upper_link); @@ -2783,7 +2794,7 @@ vgonel(struct vnode *vp) active = vp->v_usecount; oweinact = (vp->v_iflag & VI_OWEINACT); VI_UNLOCK(vp); - vgonel_reclaim_lowervp(vp); + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_RECLAIM); /* * Clean out any buffers associated with the vnode. Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sat May 11 10:51:32 2013 (r250504) +++ head/sys/kern/vfs_syscalls.c Sat May 11 11:17:44 2013 (r250505) @@ -1846,6 +1846,7 @@ restart: if (error) goto out; #endif + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK); error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); #ifdef MAC out: @@ -3825,6 +3826,7 @@ restart: return (error); goto restart; } + vfs_notify_upper(vp, VFS_NOTIFY_UPPER_UNLINK); error = VOP_RMDIR(nd.ni_dvp, nd.ni_vp, &nd.ni_cnd); vn_finished_write(mp); out: Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat May 11 10:51:32 2013 (r250504) +++ head/sys/sys/mount.h Sat May 11 11:17:44 2013 (r250505) @@ -608,7 +608,7 @@ typedef int vfs_mount_t(struct mount *mp typedef int vfs_sysctl_t(struct mount *mp, fsctlop_t op, struct sysctl_req *req); typedef void vfs_susp_clean_t(struct mount *mp); -typedef void vfs_reclaim_lowervp_t(struct mount *mp, struct vnode *lowervp); +typedef void vfs_notify_lowervp_t(struct mount *mp, struct vnode *lowervp); struct vfsops { vfs_mount_t *vfs_mount; @@ -626,7 +626,8 @@ struct vfsops { vfs_extattrctl_t *vfs_extattrctl; vfs_sysctl_t *vfs_sysctl; vfs_susp_clean_t *vfs_susp_clean; - vfs_reclaim_lowervp_t *vfs_reclaim_lowervp; + vfs_notify_lowervp_t *vfs_reclaim_lowervp; + vfs_notify_lowervp_t *vfs_unlink_lowervp; }; vfs_statfs_t __vfs_statfs; @@ -747,6 +748,14 @@ vfs_statfs_t __vfs_statfs; } \ } while (0) +#define VFS_UNLINK_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ @@ -759,6 +768,9 @@ vfs_statfs_t __vfs_statfs; VN_KNOTE((vp), (hint), 0); \ } while (0) +#define VFS_NOTIFY_UPPER_RECLAIM 1 +#define VFS_NOTIFY_UPPER_UNLINK 2 + #include /* @@ -840,6 +852,7 @@ int vfs_modevent(module_t, int, void *); void vfs_mount_error(struct mount *, const char *, ...); void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); +void vfs_notify_upper(struct vnode *, int); void vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp); void vfs_ref(struct mount *); From owner-svn-src-head@FreeBSD.ORG Sat May 11 13:21:31 2013 Return-Path: Delivered-To: svn-src-head@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 A26CAEF6; Sat, 11 May 2013 13:21:31 +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 84868849; Sat, 11 May 2013 13:21: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 r4BDLVfa097544; Sat, 11 May 2013 13:21:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BDLVWX097543; Sat, 11 May 2013 13:21:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305111321.r4BDLVWX097543@svn.freebsd.org> From: Alexander Motin Date: Sat, 11 May 2013 13:21:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250508 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 13:21:31 -0000 Author: mav Date: Sat May 11 13:21:31 2013 New Revision: 250508 URL: http://svnweb.freebsd.org/changeset/base/250508 Log: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Submitted by: Rich Futyma MFC after: 2 weeks Modified: head/sys/cam/ata/ata_pmp.c Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Sat May 11 12:43:26 2013 (r250507) +++ head/sys/cam/ata/ata_pmp.c Sat May 11 13:21:31 2013 (r250508) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -317,7 +320,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -427,7 +434,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -457,6 +467,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -466,6 +502,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -575,7 +613,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -618,10 +659,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-head@FreeBSD.ORG Sat May 11 13:32:38 2013 Return-Path: Delivered-To: svn-src-head@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 D8EDD307; Sat, 11 May 2013 13:32: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 CB43389B; Sat, 11 May 2013 13:32: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 r4BDWc9D001225; Sat, 11 May 2013 13:32:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BDWcsn001224; Sat, 11 May 2013 13:32:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305111332.r4BDWcsn001224@svn.freebsd.org> From: Eitan Adler Date: Sat, 11 May 2013 13:32:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250509 - head/usr.sbin/vidcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 13:32:38 -0000 Author: eadler Date: Sat May 11 13:32:38 2013 New Revision: 250509 URL: http://svnweb.freebsd.org/changeset/base/250509 Log: The M_VESA_MODE_MAX is latest valid mode - not the first invalid. Permit its use in vidcontrol -i PR: bin/119483 Submitted by: Dan Lukes Arrival-Date: Wed Jan 09 10:30:01 UTC 2008 Reviewed by: ed MFC after: 3 days Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Sat May 11 13:21:31 2013 (r250508) +++ head/usr.sbin/vidcontrol/vidcontrol.c Sat May 11 13:32:38 2013 (r250509) @@ -959,7 +959,7 @@ show_mode_info(void) printf("---------------------------------------" "---------------------------------------\n"); - for (mode = 0; mode < M_VESA_MODE_MAX; ++mode) { + for (mode = 0; mode <= M_VESA_MODE_MAX; ++mode) { _info.vi_mode = mode; if (ioctl(0, CONS_MODEINFO, &_info)) continue; From owner-svn-src-head@FreeBSD.ORG Sat May 11 13:44:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E640C752; Sat, 11 May 2013 13:44:11 +0000 (UTC) (envelope-from antoine@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 D8C61917; Sat, 11 May 2013 13:44: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 r4BDiBQb004883; Sat, 11 May 2013 13:44:11 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BDiBq4004882; Sat, 11 May 2013 13:44:11 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201305111344.r4BDiBq4004882@svn.freebsd.org> From: Antoine Brodin Date: Sat, 11 May 2013 13:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250510 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 13:44:12 -0000 Author: antoine Date: Sat May 11 13:44:11 2013 New Revision: 250510 URL: http://svnweb.freebsd.org/changeset/base/250510 Log: Add compile_et to kerberos bootstrap tools. This makes it possible to build a regular world on a host without kerberos. PR: conf/178421 Submitted by: Garrett Cooper MFC after: 1 month Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 11 13:32:38 2013 (r250509) +++ head/Makefile.inc1 Sat May 11 13:44:11 2013 (r250510) @@ -1176,7 +1176,8 @@ _kerberos5_bootstrap_tools= \ kerberos5/lib/libroken \ kerberos5/lib/libvers \ kerberos5/tools/asn1_compile \ - kerberos5/tools/slc + kerberos5/tools/slc \ + usr.bin/compile_et .endif # Please document (add comment) why something is in 'bootstrap-tools'. From owner-svn-src-head@FreeBSD.ORG Sat May 11 13:46:07 2013 Return-Path: Delivered-To: svn-src-head@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 2773A8E0; Sat, 11 May 2013 13:46:07 +0000 (UTC) (envelope-from antoine@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 F263C925; Sat, 11 May 2013 13:46: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 r4BDk67u005277; Sat, 11 May 2013 13:46:06 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BDk6ff005271; Sat, 11 May 2013 13:46:06 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201305111346.r4BDk6ff005271@svn.freebsd.org> From: Antoine Brodin Date: Sat, 11 May 2013 13:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250511 - in head: usr.bin/gcore usr.sbin/bsdinstall/distextract usr.sbin/bsdinstall/distfetch usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 13:46:07 -0000 Author: antoine Date: Sat May 11 13:46:05 2013 New Revision: 250511 URL: http://svnweb.freebsd.org/changeset/base/250511 Log: Add some missing DPADD. Modified: head/usr.bin/gcore/Makefile head/usr.sbin/bsdinstall/distextract/Makefile head/usr.sbin/bsdinstall/distfetch/Makefile head/usr.sbin/bsdinstall/partedit/Makefile Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Sat May 11 13:44:11 2013 (r250510) +++ head/usr.bin/gcore/Makefile Sat May 11 13:46:05 2013 (r250511) @@ -3,7 +3,7 @@ PROG= gcore SRCS= elfcore.c gcore.c -DPADD= ${LIBUTIL} +DPADD= ${LIBSBUF} ${LIBUTIL} LDADD= -lsbuf -lutil WARNS?= 1 Modified: head/usr.sbin/bsdinstall/distextract/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distextract/Makefile Sat May 11 13:44:11 2013 (r250510) +++ head/usr.sbin/bsdinstall/distextract/Makefile Sat May 11 13:46:05 2013 (r250511) @@ -2,6 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= distextract +DPADD= ${LIBARCHIVE} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} LDADD= -larchive -lncursesw -ldialog -lm WARNS?= 6 Modified: head/usr.sbin/bsdinstall/distfetch/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/Makefile Sat May 11 13:44:11 2013 (r250510) +++ head/usr.sbin/bsdinstall/distfetch/Makefile Sat May 11 13:46:05 2013 (r250511) @@ -2,6 +2,7 @@ BINDIR= /usr/libexec/bsdinstall PROG= distfetch +DPADD= ${LIBFETCH} ${LIBNCURSESW} ${LIBDIALOG} ${LIBM} LDADD= -lfetch -lncursesw -ldialog -lm WARNS?= 6 Modified: head/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/partedit/Makefile Sat May 11 13:44:11 2013 (r250510) +++ head/usr.sbin/bsdinstall/partedit/Makefile Sat May 11 13:46:05 2013 (r250511) @@ -5,6 +5,7 @@ PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade +DPADD= ${LIBGEOM} ${LIBNCURSESW} ${LIBUTIL} ${LIBDIALOG} ${LIBM} LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} From owner-svn-src-head@FreeBSD.ORG Sat May 11 14:31:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F62DAF6; Sat, 11 May 2013 14:31:41 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) by mx1.freebsd.org (Postfix) with ESMTP id 13CDAAD2; Sat, 11 May 2013 14:31:40 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id e11so9888182iej.30 for ; Sat, 11 May 2013 07:31:39 -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=O0EvQuEncgUsvICj/5YYeTvFPZzwvpMruD9I3z+OjO4=; b=Zc5ZW/GGGSIzh8nWpVEfDHTDrfvcDQgnVibzYwhKbVny2EzLuQJAHhdm38E54IQpPI l7lDj6uJUAh6PDQCF5uWlvuND1Drp7XFBmkoMhGLWwGqCpThWNQwmnRjBV2j5bKc+Kac qZ2ENunlWaVBRTBTONTkZKQ0NepqbHPPryvmjw2aJentlVdWBbKpMsead3s2ZKXX8q+K zXLd/5Vvn/sEAsPAmp0DuA2HBIQc4/Do8yACWvzZMBRoplHxpuFIM7ALFjuH6kcRKJ/I f4kbrrJpyUDRGcjyxqqswCo1Z+BVW1jokpyZR6M/0MoSCLDRYp8dLBun1w3Dh7oSCtVu 6jNA== MIME-Version: 1.0 X-Received: by 10.50.7.36 with SMTP id g4mr5312100iga.64.1368282699064; Sat, 11 May 2013 07:31:39 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 11 May 2013 07:31:38 -0700 (PDT) In-Reply-To: <201305100952.45101.jhb@freebsd.org> References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305100952.45101.jhb@freebsd.org> Date: Sat, 11 May 2013 16:31:38 +0200 X-Google-Sender-Auth: nYgbHWWl8Xa4Nxf-IbZiV3bKMRQ Message-ID: Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 14:31:41 -0000 On Fri, May 10, 2013 at 3:52 PM, John Baldwin wrote: > 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: At this point I think that my e-mail is completely ambiguous because what I'm proposing is the same way we shut down specific LOR with mutexes using mtx_lock_flags(). I don't really understand what are you objecting about. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat May 11 14:34:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CDE2FD69; Sat, 11 May 2013 14:34:50 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ia0-x231.google.com (mail-ia0-x231.google.com [IPv6:2607:f8b0:4001:c02::231]) by mx1.freebsd.org (Postfix) with ESMTP id 7A75FAE8; Sat, 11 May 2013 14:34:50 +0000 (UTC) Received: by mail-ia0-f177.google.com with SMTP id z3so2954236iad.22 for ; Sat, 11 May 2013 07:34:50 -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=jjnUH/JB0EdRHxlbRZrYZbc17BAEodUoVLNMvJhE0Bg=; b=XjrKTWuhyFl/qEQG1NZE0mhZkHs/g6/zS3f49irIMbLtZ6gR327M/1UADzIavcSSEp z8jKAGkLfzrxuy3imQkIm1ToofeCIA/CwXfcNJg0iZyy0tlSFv17Bpipo575H0qj8lmN 0cPW2oMAadYG3I3WLebLFyYBJeaqQT+IV2aVv7eb9WRo7yt9UPOPSQrbqnL1kJfz0Uyn E4iVheyWXdPxN6sXcT1xYjYEKzzw0a6af6ULMWBQ1Rqn2ougzkWAXecgVxjy7LYAuaAd TNLJuTE8oBqBqhlNZAYyJgNcA00UfjOd8jFCd6HaiZF8fF9Av8vc+24PHk2wS5iI3xpe 438g== MIME-Version: 1.0 X-Received: by 10.43.138.196 with SMTP id it4mr365819icc.3.1368282890152; Sat, 11 May 2013 07:34:50 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 11 May 2013 07:34:50 -0700 (PDT) In-Reply-To: <201305101533.26992.jhb@freebsd.org> References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305101211.35808.jhb@freebsd.org> <6CBEB766-087B-41F4-B549-2D60F4FD2701@xcllnt.net> <201305101533.26992.jhb@freebsd.org> Date: Sat, 11 May 2013 16:34:50 +0200 X-Google-Sender-Auth: A71mmGbiYm6IQlZ3fU2Vg6G6rP8 Message-ID: Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 14:34:50 -0000 On Fri, May 10, 2013 at 9:33 PM, John Baldwin wrote: > 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. The solution to this is what I proposed: pass down a LK_NOWITNESS for instances where you don't want to check for witness. This is per lock-call. You localize the fix to the instance you want to shut down and you skip witness for every false-positive. When you commit the LK_NOWITNESS you mention explicitely the reason why the reported LOR is a false positive so it is also documented on svn. I still don't understand what you are objecting. Marcel objections' were completely no-sense (Don't want to involve Witness) but at least I expect some decent one by you. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat May 11 15:05:32 2013 Return-Path: Delivered-To: svn-src-head@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 68F26633; Sat, 11 May 2013 15:05:32 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ia0-x233.google.com (mail-ia0-x233.google.com [IPv6:2607:f8b0:4001:c02::233]) by mx1.freebsd.org (Postfix) with ESMTP id 1536DBFE; Sat, 11 May 2013 15:05:32 +0000 (UTC) Received: by mail-ia0-f179.google.com with SMTP id h37so635038iak.38 for ; Sat, 11 May 2013 08:05:31 -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=WriXFwawu8xaNzxg9M/MF3yVa/R9cWVHL1WnPJzMBkc=; b=JcT6CFrwO500KOqVPUBQJATlLPhInaYWqA0DnDLq5W4CvRlXzhgSyV2JwkDqygizlQ hsnYLmUjj0S5WL9VZZMkpl2vc0cO2L3JXuClwCXwdgvHUcBBjM45EvX9O+3BDQMbfP61 2Tqek92EabKZE2NjNaD05H62JcherGJ0kE4ex9Q8ugWmOAR/JKbkO2nPqTf0Y9Szkp0/ k3vN5UO8MKH7OKmxBCo4s7NrGZJW5UeSGEy+trfj/JSY50C5vpuq0xQT1V2nLXbQTyS3 JlmD25qa1Tpa2xwVD9hXJFP7r9pxKBH2rD7FgbXLxZiyZuIDae5UHlb00P8jEb5SO2t4 N2ag== MIME-Version: 1.0 X-Received: by 10.50.7.36 with SMTP id g4mr5380683iga.64.1368284731730; Sat, 11 May 2013 08:05:31 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.42.117.134 with HTTP; Sat, 11 May 2013 08:05:31 -0700 (PDT) In-Reply-To: References: <201305091628.r49GSI33039873@svn.freebsd.org> <201305101211.35808.jhb@freebsd.org> <6CBEB766-087B-41F4-B549-2D60F4FD2701@xcllnt.net> <201305101533.26992.jhb@freebsd.org> Date: Sat, 11 May 2013 17:05:31 +0200 X-Google-Sender-Auth: wEMri70znE8dEzV9sK4n-COjvJk Message-ID: Subject: Re: svn commit: r250411 - in head/sys: conf kern sys From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Marcel Moolenaar , src-committers@freebsd.org, Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 15:05:32 -0000 On Sat, May 11, 2013 at 4:34 PM, Attilio Rao wrote: > On Fri, May 10, 2013 at 9:33 PM, John Baldwin wrote: >> 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. > > The solution to this is what I proposed: pass down a LK_NOWITNESS for > instances where you don't want to check for witness. > This is per lock-call. > You localize the fix to the instance you want to shut down and you > skip witness for every false-positive. > When you commit the LK_NOWITNESS you mention explicitely the reason > why the reported LOR is a false positive so it is also documented on > svn. > > I still don't understand what you are objecting. Marcel objections' > were completely no-sense (Don't want to involve Witness) but at least > I expect some decent one by you. And finally, all the logic to do this seems already implemented. I didn't recall that. See this: http://svnweb.freebsd.org/base?view=revision&revision=179554 What is missing is similar logic for sx(9) and rwlock(9). We can simply add _flags() variant of such functions if we need it. But Marcel's approach is not helping on that side as well, if not for a simple red-herring effect. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Sat May 11 15:45:45 2013 Return-Path: Delivered-To: svn-src-head@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 5E2DA718; Sat, 11 May 2013 15:45:45 +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 4F6B6DC8; Sat, 11 May 2013 15:45: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 r4BFjjFI049254; Sat, 11 May 2013 15:45:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BFjjE8049253; Sat, 11 May 2013 15:45:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305111545.r4BFjjE8049253@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 May 2013 15:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250512 - head/tools/regression/file/dup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 15:45:45 -0000 Author: jilles Date: Sat May 11 15:45:44 2013 New Revision: 250512 URL: http://svnweb.freebsd.org/changeset/base/250512 Log: Add missing argument to fcntl(F_DUPFD) in regression test. Modified: head/tools/regression/file/dup/dup.c Modified: head/tools/regression/file/dup/dup.c ============================================================================== --- head/tools/regression/file/dup/dup.c Sat May 11 13:46:05 2013 (r250511) +++ head/tools/regression/file/dup/dup.c Sat May 11 15:45:44 2013 (r250512) @@ -144,9 +144,13 @@ main(int __unused argc, char __unused *a printf("ok %d - dup2(2) didn't clear close-on-exec\n", test); /* Does fcntl(F_DUPFD) work? */ - if ((fd2 = fcntl(fd1, F_DUPFD)) < 0) + if ((fd2 = fcntl(fd1, F_DUPFD, 10)) < 0) err(1, "fcntl(F_DUPFD)"); - printf("ok %d - fcntl(F_DUPFD) works\n", ++test); + if (fd2 < 10) + printf("not ok %d - fcntl(F_DUPFD) returned wrong fd %d\n", + ++test, fd2); + else + printf("ok %d - fcntl(F_DUPFD) works\n", ++test); /* Was close-on-exec cleared? */ ++test; From owner-svn-src-head@FreeBSD.ORG Sat May 11 16:31:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E42DBFBE; Sat, 11 May 2013 16:31: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 D66E5EF2; Sat, 11 May 2013 16:31: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 r4BGVfY2065865; Sat, 11 May 2013 16:31:41 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BGVfO7065864; Sat, 11 May 2013 16:31:41 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305111631.r4BGVfO7065864@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 May 2013 16:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250513 - head/tools/regression/file/dup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 16:31:42 -0000 Author: jilles Date: Sat May 11 16:31:41 2013 New Revision: 250513 URL: http://svnweb.freebsd.org/changeset/base/250513 Log: Add simple testcases for fcntl(F_DUPFD_CLOEXEC). Modified: head/tools/regression/file/dup/dup.c Modified: head/tools/regression/file/dup/dup.c ============================================================================== --- head/tools/regression/file/dup/dup.c Sat May 11 15:45:44 2013 (r250512) +++ head/tools/regression/file/dup/dup.c Sat May 11 16:31:41 2013 (r250513) @@ -29,6 +29,9 @@ * duped fd. * Test #17: check if fcntl(F_DUP2FD) to a fd > current maximum number of open * files limit work. + * Test #18: check if fcntl(F_DUPFD_CLOEXEC) works. + * Test #19: check if fcntl(F_DUPFD_CLOEXEC) set close-on-exec flag for duped + * fd. */ #include @@ -65,7 +68,7 @@ main(int __unused argc, char __unused *a orgfd = getafile(); - printf("1..17\n"); + printf("1..19\n"); /* If dup(2) ever work? */ if ((fd1 = dup(orgfd)) < 0) @@ -229,5 +232,24 @@ main(int __unused argc, char __unused *a printf("ok %d - fcntl(F_DUP2FD) didn't bypass NOFILE limit\n", test); + /* Does fcntl(F_DUPFD_CLOEXEC) work? */ + if ((fd2 = fcntl(fd1, F_DUPFD_CLOEXEC, 10)) < 0) + err(1, "fcntl(F_DUPFD_CLOEXEC)"); + if (fd2 < 10) + printf("not ok %d - fcntl(F_DUPFD_CLOEXEC) returned wrong fd %d\n", + ++test, fd2); + else + printf("ok %d - fcntl(F_DUPFD_CLOEXEC) works\n", ++test); + + /* Was close-on-exec cleared? */ + ++test; + if (fcntl(fd2, F_GETFD) != 1) + printf( + "not ok %d - fcntl(F_DUPFD_CLOEXEC) didn't set close-on-exec\n", + test); + else + printf("ok %d - fcntl(F_DUPFD_CLOEXEC) set close-on-exec\n", + test); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sat May 11 17:57:52 2013 Return-Path: Delivered-To: svn-src-head@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 D980D798; Sat, 11 May 2013 17:57:52 +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 CB30D1C8; Sat, 11 May 2013 17:57: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 r4BHvqCR095998; Sat, 11 May 2013 17:57:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BHvqKu095997; Sat, 11 May 2013 17:57:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305111757.r4BHvqKu095997@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 11 May 2013 17:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250518 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 17:57:52 -0000 Author: glebius Date: Sat May 11 17:57:52 2013 New Revision: 250518 URL: http://svnweb.freebsd.org/changeset/base/250518 Log: Invalid creatorid is always EINVAL, not only when we are in verbose mode. Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Sat May 11 16:47:42 2013 (r250517) +++ head/sys/netpfil/pf/if_pfsync.c Sat May 11 17:57:52 2013 (r250518) @@ -408,9 +408,10 @@ pfsync_state_import(struct pfsync_state PF_RULES_RASSERT(); - if (sp->creatorid == 0 && V_pf_status.debug >= PF_DEBUG_MISC) { - printf("%s: invalid creator id: %08x\n", __func__, - ntohl(sp->creatorid)); + if (sp->creatorid == 0) { + if (V_pf_status.debug >= PF_DEBUG_MISC) + printf("%s: invalid creator id: %08x\n", __func__, + ntohl(sp->creatorid)); return (EINVAL); } From owner-svn-src-head@FreeBSD.ORG Sat May 11 17:58:26 2013 Return-Path: Delivered-To: svn-src-head@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 91F32905; Sat, 11 May 2013 17:58:26 +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 831911CB; Sat, 11 May 2013 17:58: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 r4BHwQN9096148; Sat, 11 May 2013 17:58:26 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BHwQjK096147; Sat, 11 May 2013 17:58:26 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305111758.r4BHwQjK096147@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 11 May 2013 17:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250519 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 17:58:26 -0000 Author: glebius Date: Sat May 11 17:58:26 2013 New Revision: 250519 URL: http://svnweb.freebsd.org/changeset/base/250519 Log: Fix DIOCADDSTATE operation. Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Sat May 11 17:57:52 2013 (r250518) +++ head/sys/netpfil/pf/pf_ioctl.c Sat May 11 17:58:26 2013 (r250519) @@ -1691,7 +1691,7 @@ relock_DIOCKILLSTATES: PF_RULES_RLOCK(); error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); PF_RULES_RUNLOCK(); - } + } else error = EOPNOTSUPP; break; } From owner-svn-src-head@FreeBSD.ORG Sat May 11 18:01:42 2013 Return-Path: Delivered-To: svn-src-head@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 30CCBBD5; Sat, 11 May 2013 18:01:42 +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 237B41EC; Sat, 11 May 2013 18:01: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 r4BI1gAX000540; Sat, 11 May 2013 18:01:42 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BI1gpu000539; Sat, 11 May 2013 18:01:42 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201305111801.r4BI1gpu000539@svn.freebsd.org> From: Alan Cox Date: Sat, 11 May 2013 18:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250520 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 18:01:42 -0000 Author: alc Date: Sat May 11 18:01:41 2013 New Revision: 250520 URL: http://svnweb.freebsd.org/changeset/base/250520 Log: To reduce the amount of arithmetic performed in the various radix tree functions, reverse the numbering scheme for the levels. The highest numbered level in the tree now appears near the root instead of the leaves. 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 Sat May 11 17:58:26 2013 (r250519) +++ head/sys/vm/vm_radix.c Sat May 11 18:01:41 2013 (r250520) @@ -91,7 +91,7 @@ __FBSDID("$FreeBSD$"); /* Returns one unit associated with specified level. */ #define VM_RADIX_UNITLEVEL(lev) \ - ((vm_pindex_t)1 << ((VM_RADIX_LIMIT - (lev)) * VM_RADIX_WIDTH)) + ((vm_pindex_t)1 << ((lev) * VM_RADIX_WIDTH)) struct vm_radix_node { vm_pindex_t rn_owner; /* Owner of record. */ @@ -150,8 +150,7 @@ static __inline int vm_radix_slot(vm_pindex_t index, uint16_t level) { - return ((index >> ((VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH)) & - VM_RADIX_MASK); + return ((index >> (level * VM_RADIX_WIDTH)) & VM_RADIX_MASK); } /* Trims the key after the specified level. */ @@ -161,9 +160,9 @@ vm_radix_trimkey(vm_pindex_t index, uint vm_pindex_t ret; ret = index; - if (level < VM_RADIX_LIMIT) { - ret >>= (VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH; - ret <<= (VM_RADIX_LIMIT - level) * VM_RADIX_WIDTH; + if (level > 0) { + ret >>= level * VM_RADIX_WIDTH; + ret <<= level * VM_RADIX_WIDTH; } return (ret); } @@ -234,7 +233,7 @@ vm_radix_keydiff(vm_pindex_t index1, vm_ __func__, (uintmax_t)index1)); index1 ^= index2; - for (clev = 0;; clev++) + for (clev = VM_RADIX_LIMIT;; clev--) if (vm_radix_slot(index1, clev) != 0) return (clev); } @@ -247,8 +246,8 @@ static __inline boolean_t vm_radix_keybarr(struct vm_radix_node *rnode, vm_pindex_t idx) { - if (rnode->rn_clev > 0) { - idx = vm_radix_trimkey(idx, rnode->rn_clev - 1); + if (rnode->rn_clev < VM_RADIX_LIMIT) { + idx = vm_radix_trimkey(idx, rnode->rn_clev + 1); return (idx != rnode->rn_owner); } return (FALSE); @@ -384,7 +383,7 @@ vm_radix_insert(struct vm_radix *rtree, __func__, (uintmax_t)index); clev = vm_radix_keydiff(m->pindex, index); tmp = vm_radix_node_get(vm_radix_trimkey(index, - clev - 1), 2, clev); + clev + 1), 2, clev); *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); vm_radix_addpage(tmp, m->pindex, clev, m); @@ -408,7 +407,7 @@ vm_radix_insert(struct vm_radix *rtree, */ newind = rnode->rn_owner; clev = vm_radix_keydiff(newind, index); - tmp = vm_radix_node_get(vm_radix_trimkey(index, clev - 1), 2, + tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev); *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); @@ -545,7 +544,7 @@ ascend: */ goto ascend; descend: - KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + KASSERT(rnode->rn_clev > 0, ("vm_radix_lookup_ge: pushing leaf's parent")); KASSERT(tos < VM_RADIX_LIMIT, ("vm_radix_lookup_ge: stack overflow")); @@ -658,7 +657,7 @@ ascend: */ goto ascend; descend: - KASSERT(rnode->rn_clev < VM_RADIX_LIMIT, + KASSERT(rnode->rn_clev > 0, ("vm_radix_lookup_le: pushing leaf's parent")); KASSERT(tos < VM_RADIX_LIMIT, ("vm_radix_lookup_le: stack overflow")); From owner-svn-src-head@FreeBSD.ORG Sat May 11 18:03:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5D8EDE4A; Sat, 11 May 2013 18:03:37 +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 502D9202; Sat, 11 May 2013 18:03: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 r4BI3btC001054; Sat, 11 May 2013 18:03:37 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BI3b8J001053; Sat, 11 May 2013 18:03:37 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305111803.r4BI3b8J001053@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 11 May 2013 18:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250521 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 18:03:37 -0000 Author: glebius Date: Sat May 11 18:03:36 2013 New Revision: 250521 URL: http://svnweb.freebsd.org/changeset/base/250521 Log: Better debug message. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat May 11 18:01:41 2013 (r250520) +++ head/sys/netpfil/pf/pf.c Sat May 11 18:03:36 2013 (r250521) @@ -1102,7 +1102,7 @@ pf_state_insert(struct pfi_kif *kif, str if (cur != NULL) { PF_HASHROW_UNLOCK(ih); if (V_pf_status.debug >= PF_DEBUG_MISC) { - printf("pf: state insert failed: " + printf("pf: state ID collision: " "id: %016llx creatorid: %08x\n", (unsigned long long)be64toh(s->id), ntohl(s->creatorid)); From owner-svn-src-head@FreeBSD.ORG Sat May 11 18:06:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8FCFEFED; Sat, 11 May 2013 18:06:51 +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 8297C21D; Sat, 11 May 2013 18:06:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4BI6pxl001880; Sat, 11 May 2013 18:06:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BI6pqG001879; Sat, 11 May 2013 18:06:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201305111806.r4BI6pqG001879@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 11 May 2013 18:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250522 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 18:06:51 -0000 Author: glebius Date: Sat May 11 18:06:51 2013 New Revision: 250522 URL: http://svnweb.freebsd.org/changeset/base/250522 Log: Return meaningful error code from pf_state_key_attach() and pf_state_insert(). Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat May 11 18:03:36 2013 (r250521) +++ head/sys/netpfil/pf/pf.c Sat May 11 18:06:51 2013 (r250522) @@ -915,7 +915,7 @@ keyattach: uma_zfree(V_pf_state_key_z, sk); if (idx == PF_SK_STACK) pf_detach_state(s); - return (-1); /* collision! */ + return (EEXIST); /* collision! */ } } PF_HASHROW_UNLOCK(ih); @@ -1072,6 +1072,7 @@ pf_state_insert(struct pfi_kif *kif, str { struct pf_idhash *ih; struct pf_state *cur; + int error; KASSERT(TAILQ_EMPTY(&sks->states[0]) && TAILQ_EMPTY(&sks->states[1]), ("%s: sks not pristine", __func__)); @@ -1090,8 +1091,8 @@ pf_state_insert(struct pfi_kif *kif, str s->creatorid = V_pf_status.hostid; } - if (pf_state_key_attach(skw, sks, s)) - return (-1); + if ((error = pf_state_key_attach(skw, sks, s)) != 0) + return (error); ih = &V_pf_idhash[PF_IDHASH(s)]; PF_HASHROW_LOCK(ih); @@ -1108,7 +1109,7 @@ pf_state_insert(struct pfi_kif *kif, str ntohl(s->creatorid)); } pf_detach_state(s); - return (-1); + return (EEXIST); } LIST_INSERT_HEAD(&ih->states, s, entry); /* One for keys, one for ID hash. */ From owner-svn-src-head@FreeBSD.ORG Sat May 11 19:05:39 2013 Return-Path: Delivered-To: svn-src-head@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 620E5D3E; Sat, 11 May 2013 19:05:39 +0000 (UTC) (envelope-from hrs@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 545383D8; Sat, 11 May 2013 19:05: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 r4BJ5dlF022986; Sat, 11 May 2013 19:05:39 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BJ5cFO022984; Sat, 11 May 2013 19:05:39 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201305111905.r4BJ5cFO022984@svn.freebsd.org> From: Hiroki Sato Date: Sat, 11 May 2013 19:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250523 - in head/sys: net netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 19:05:39 -0000 Author: hrs Date: Sat May 11 19:05:38 2013 New Revision: 250523 URL: http://svnweb.freebsd.org/changeset/base/250523 Log: Add IFF_MONITOR support to gre(4). Tested by: Chip Marshall MFC after: 1 week Modified: head/sys/net/if_gre.c head/sys/netinet/ip_gre.c Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Sat May 11 18:06:51 2013 (r250522) +++ head/sys/net/if_gre.c Sat May 11 19:05:38 2013 (r250523) @@ -341,6 +341,12 @@ gre_output(struct ifnet *ifp, struct mbu if (bpf_peers_present(ifp->if_bpf)) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); + if ((ifp->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + error = ENETDOWN; + goto end; + } + m->m_flags &= ~(M_BCAST|M_MCAST); if (sc->g_proto == IPPROTO_MOBILE) { Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Sat May 11 18:06:51 2013 (r250522) +++ head/sys/netinet/ip_gre.c Sat May 11 19:05:38 2013 (r250523) @@ -205,6 +205,11 @@ gre_input2(struct mbuf *m ,int hlen, u_c bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m); } + if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + return(NULL); + } + m->m_pkthdr.rcvif = GRE2IFP(sc); netisr_queue(isr, m); @@ -287,6 +292,11 @@ gre_mobile_input(struct mbuf *m, int hle bpf_mtap2(GRE2IFP(sc)->if_bpf, &af, sizeof(af), m); } + if ((GRE2IFP(sc)->if_flags & IFF_MONITOR) != 0) { + m_freem(m); + return; + } + m->m_pkthdr.rcvif = GRE2IFP(sc); netisr_queue(NETISR_IP, m); From owner-svn-src-head@FreeBSD.ORG Sat May 11 20:51:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9AC6135E; Sat, 11 May 2013 20:51:01 +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 7346A874; Sat, 11 May 2013 20:51: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 r4BKp1B8061815; Sat, 11 May 2013 20:51:01 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BKp1O9061805; Sat, 11 May 2013 20:51:01 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305112051.r4BKp1O9061805@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 May 2013 20:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250527 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 20:51:01 -0000 Author: jilles Date: Sat May 11 20:51:00 2013 New Revision: 250527 URL: http://svnweb.freebsd.org/changeset/base/250527 Log: sh: Remove linked list of stack marks. The linked list of stack marks may cause problems if the allocation stack is used between an exception and a higher-level popstackmark(), as it may then touch a stack mark that is local to a function which has returned. Also, the adjustment compares to a pointer passed to realloc(), which is undefined behaviour. Instead of adjusting stack marks when reallocating stack blocks, ensure that such an adjustment is never necessary by fixing a small piece of memory in place at a stack mark. This also simplifies the code. To avoid the problems reported in bin/175922, it remains necessary to call setstackmark() after popstackmark() if the stack mark remains in use. Modified: head/bin/sh/memalloc.c head/bin/sh/memalloc.h Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Sat May 11 19:46:15 2013 (r250526) +++ head/bin/sh/memalloc.c Sat May 11 20:51:00 2013 (r250527) @@ -124,7 +124,6 @@ struct stack_block { #define SPACE(sp) ((char*)(sp) + ALIGN(sizeof(struct stack_block))) static struct stack_block *stackp; -static struct stackmark *markp; char *stacknxt; int stacknleft; char *sstrend; @@ -186,8 +185,9 @@ setstackmark(struct stackmark *mark) mark->stackp = stackp; mark->stacknxt = stacknxt; mark->stacknleft = stacknleft; - mark->marknext = markp; - markp = mark; + /* Ensure this block stays in place. */ + if (stackp != NULL && stacknxt == SPACE(stackp)) + stalloc(1); } @@ -197,7 +197,6 @@ popstackmark(struct stackmark *mark) struct stack_block *sp; INTOFF; - markp = mark->marknext; while (stackp != mark->stackp) { sp = stackp; stackp = sp->prev; @@ -229,7 +228,6 @@ growstackblock(int min) int oldlen; struct stack_block *sp; struct stack_block *oldstackp; - struct stackmark *xmark; if (min < stacknleft) min = stacknleft; @@ -254,18 +252,6 @@ growstackblock(int min) stacknxt = SPACE(sp); stacknleft = newlen - (stacknxt - (char*)sp); sstrend = stacknxt + stacknleft; - - /* - * Stack marks pointing to the start of the old block - * must be relocated to point to the new block - */ - xmark = markp; - while (xmark != NULL && xmark->stackp == oldstackp) { - xmark->stackp = stackp; - xmark->stacknxt = stacknxt; - xmark->stacknleft = stacknleft; - xmark = xmark->marknext; - } INTON; } else { newlen -= ALIGN(sizeof(struct stack_block)); Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Sat May 11 19:46:15 2013 (r250526) +++ head/bin/sh/memalloc.h Sat May 11 20:51:00 2013 (r250527) @@ -39,7 +39,6 @@ struct stackmark { struct stack_block *stackp; char *stacknxt; int stacknleft; - struct stackmark *marknext; }; From owner-svn-src-head@FreeBSD.ORG Sat May 11 20:55:15 2013 Return-Path: Delivered-To: svn-src-head@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 7C38E644; Sat, 11 May 2013 20:55: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 6E8CF892; Sat, 11 May 2013 20:55: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 r4BKtFl9062875; Sat, 11 May 2013 20:55:15 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BKtFif062874; Sat, 11 May 2013 20:55:15 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305112055.r4BKtFif062874@svn.freebsd.org> From: Eitan Adler Date: Sat, 11 May 2013 20:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250528 - head/usr.sbin/wpa/wpa_supplicant X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 20:55:15 -0000 Author: eadler Date: Sat May 11 20:55:14 2013 New Revision: 250528 URL: http://svnweb.freebsd.org/changeset/base/250528 Log: Teach wpa_supplicant to properly compute wireless signal strength. PR: bin/170631 Submitted by: Daan Vreeken Reviewed by: adrian Modified: head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Modified: head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Sat May 11 20:51:00 2013 (r250527) +++ head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Sat May 11 20:55:14 2013 (r250528) @@ -693,6 +693,11 @@ wpa_driver_bsd_add_scan_entry(struct wpa result->caps = sr->isr_capinfo; result->qual = sr->isr_rssi; result->noise = sr->isr_noise; + /* + * the rssi value reported by the kernel is in 0.5dB steps relative to + * the reported noise floor. see ieee80211_node.h for details. + */ + result->level = sr->isr_rssi / 2 + sr->isr_noise; pos = (u8 *)(result + 1); From owner-svn-src-head@FreeBSD.ORG Sat May 11 22:00:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6DD5ED1; Sat, 11 May 2013 22:00:14 +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 621D8B52; Sat, 11 May 2013 22:00:13 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id h11so1859583wiv.2 for ; Sat, 11 May 2013 15:00:12 -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=UApw2vWb5qSprMubIVLb4Rxikv4m9LcVe/CVQvESstk=; b=H1Rb35shou3r0d538txJ/LuNyOXVoS//ykvMkrsOx/RVvDfzdtleTzYmscxolFoFSR FFDiyLhZNrIbhGhhd2/pWFTlXXiR/9+JRx/Cx37D68P+p54ZCZ2aAROTZzvocNHoQNKd jflFEz/V+mGOHcYv2v3ckBoXbyPhSjhsBmMb3qDY/XAfEV7RQztHEQy5l+G5YikRrLQT 1xl/tVjknr9X/Wop/v+I0MFvZsdIx6CGux8xuiyaEOQmqWAxcNxSNYgB+x+z20b/ZB/n 5Q1Nh10oZlDkc7eU8fCUjbHX/nObNEOwG80uhCFRdyBtS6HitYu8baS3wkCBoTlkO4lN CJkw== MIME-Version: 1.0 X-Received: by 10.180.93.134 with SMTP id cu6mr10586099wib.8.1368309612501; Sat, 11 May 2013 15:00:12 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.58.138 with HTTP; Sat, 11 May 2013 15:00:12 -0700 (PDT) In-Reply-To: <201305112055.r4BKtFif062874@svn.freebsd.org> References: <201305112055.r4BKtFif062874@svn.freebsd.org> Date: Sat, 11 May 2013 15:00:12 -0700 X-Google-Sender-Auth: jzot77f1mCyBjC1qsHKCPOU5wa8 Message-ID: Subject: Re: svn commit: r250528 - head/usr.sbin/wpa/wpa_supplicant From: Adrian Chadd 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, freebsd-wireless@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 22:00:14 -0000 oh thank _god_ someone fixed this. It's been bugging me for about a year, but I've been too slack (hah!) to figure out why. Next, teaching it about whether to prefer 2ghz or 5ghz APs.. Adrian On 11 May 2013 13:55, Eitan Adler wrote: > Author: eadler > Date: Sat May 11 20:55:14 2013 > New Revision: 250528 > URL: http://svnweb.freebsd.org/changeset/base/250528 > > Log: > Teach wpa_supplicant to properly compute wireless signal strength. > > PR: bin/170631 > Submitted by: Daan Vreeken > Reviewed by: adrian > > Modified: > head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c > > Modified: head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c > ============================================================================== > --- head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Sat May 11 20:51:00 2013 (r250527) > +++ head/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c Sat May 11 20:55:14 2013 (r250528) > @@ -693,6 +693,11 @@ wpa_driver_bsd_add_scan_entry(struct wpa > result->caps = sr->isr_capinfo; > result->qual = sr->isr_rssi; > result->noise = sr->isr_noise; > + /* > + * the rssi value reported by the kernel is in 0.5dB steps relative to > + * the reported noise floor. see ieee80211_node.h for details. > + */ > + result->level = sr->isr_rssi / 2 + sr->isr_noise; > > pos = (u8 *)(result + 1); > From owner-svn-src-head@FreeBSD.ORG Sat May 11 22:13:24 2013 Return-Path: Delivered-To: svn-src-head@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 CDC153AA; Sat, 11 May 2013 22:13:24 +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 A5B3BCB6; Sat, 11 May 2013 22:13:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4BMDO2w093396; Sat, 11 May 2013 22:13:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BMDOT9093395; Sat, 11 May 2013 22:13:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201305112213.r4BMDOT9093395@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 May 2013 22:13:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250530 - head/tools/regression/file/dup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 22:13:24 -0000 Author: jilles Date: Sat May 11 22:13:24 2013 New Revision: 250530 URL: http://svnweb.freebsd.org/changeset/base/250530 Log: Add simple testcases for fcntl(F_DUP2FD_CLOEXEC). Modified: head/tools/regression/file/dup/dup.c Modified: head/tools/regression/file/dup/dup.c ============================================================================== --- head/tools/regression/file/dup/dup.c Sat May 11 21:23:55 2013 (r250529) +++ head/tools/regression/file/dup/dup.c Sat May 11 22:13:24 2013 (r250530) @@ -32,6 +32,12 @@ * Test #18: check if fcntl(F_DUPFD_CLOEXEC) works. * Test #19: check if fcntl(F_DUPFD_CLOEXEC) set close-on-exec flag for duped * fd. + * Test #20: check if fcntl(F_DUP2FD_CLOEXEC) works. + * Test #21: check if fcntl(F_DUP2FD_CLOEXEC) returned a fd we asked for. + * Test #22: check if fcntl(F_DUP2FD_CLOEXEC) set close-on-exec flag for duped + * fd. + * Test #23: check if fcntl(F_DUP2FD_CLOEXEC) to a fd > current maximum number + * of open files limit work. */ #include @@ -68,7 +74,7 @@ main(int __unused argc, char __unused *a orgfd = getafile(); - printf("1..19\n"); + printf("1..23\n"); /* If dup(2) ever work? */ if ((fd1 = dup(orgfd)) < 0) @@ -251,5 +257,45 @@ main(int __unused argc, char __unused *a printf("ok %d - fcntl(F_DUPFD_CLOEXEC) set close-on-exec\n", test); + /* If fcntl(F_DUP2FD_CLOEXEC) ever work? */ + if ((fd2 = fcntl(fd1, F_DUP2FD_CLOEXEC, fd1 + 1)) < 0) + err(1, "fcntl(F_DUP2FD_CLOEXEC)"); + printf("ok %d - fcntl(F_DUP2FD_CLOEXEC) works\n", ++test); + + /* Do we get the right fd? */ + ++test; + if (fd2 != fd1 + 1) + printf( + "no ok %d - fcntl(F_DUP2FD_CLOEXEC) didn't give us the right fd\n", + test); + else + printf("ok %d - fcntl(F_DUP2FD_CLOEXEC) returned a correct fd\n", + test); + + /* Was close-on-exec set? */ + ++test; + if (fcntl(fd2, F_GETFD) != FD_CLOEXEC) + printf( + "not ok %d - fcntl(F_DUP2FD_CLOEXEC) didn't set close-on-exec\n", + test); + else + printf("ok %d - fcntl(F_DUP2FD_CLOEXEC) set close-on-exec\n", + test); + + /* + * It is unclear what F_DUP2FD_CLOEXEC should do when duplicating a + * file descriptor onto itself. + */ + + ++test; + if (getrlimit(RLIMIT_NOFILE, &rlp) < 0) + err(1, "getrlimit"); + if ((fd2 = fcntl(fd1, F_DUP2FD_CLOEXEC, rlp.rlim_cur + 1)) >= 0) + printf("not ok %d - fcntl(F_DUP2FD_CLOEXEC) bypassed NOFILE limit\n", + test); + else + printf("ok %d - fcntl(F_DUP2FD_CLOEXEC) didn't bypass NOFILE limit\n", + test); + return (0); } From owner-svn-src-head@FreeBSD.ORG Sat May 11 22:32:44 2013 Return-Path: Delivered-To: svn-src-head@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 5810C82E; Sat, 11 May 2013 22:32:44 +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 493C0D2C; Sat, 11 May 2013 22:32: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 r4BMWiIu000473; Sat, 11 May 2013 22:32:44 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BMWiUW000472; Sat, 11 May 2013 22:32:44 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201305112232.r4BMWiUW000472@svn.freebsd.org> From: Tim Kientzle Date: Sat, 11 May 2013 22:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250531 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 22:32:44 -0000 Author: kientzle Date: Sat May 11 22:32:43 2013 New Revision: 250531 URL: http://svnweb.freebsd.org/changeset/base/250531 Log: Don't use the old stack-walking code with EABI ARM kernels or clang-compiled ARM kernels. This fixes a crash seen in clang-compiled ARM kernels that include WITNESS. This code could be easily modified to walk the stack for current clang-generated code (including EABI) but Andrew Turner has raised concerns that the stack frame currently emitted by clang isn't actually required by EABI so such a change might cause problems down the road. In case anyone wants to experiment, the change to support current clang-compiled kernels involves simply setting FR_RFP=0 and FR_SCP=1. Modified: head/sys/arm/arm/stack_machdep.c Modified: head/sys/arm/arm/stack_machdep.c ============================================================================== --- head/sys/arm/arm/stack_machdep.c Sat May 11 22:13:24 2013 (r250530) +++ head/sys/arm/arm/stack_machdep.c Sat May 11 22:32:43 2013 (r250531) @@ -39,17 +39,16 @@ __FBSDID("$FreeBSD$"); static void stack_capture(struct stack *st, u_int32_t *frame) { +#if !defined(__ARM_EABI__) && !defined(__clang__) vm_offset_t callpc; - stack_zero(st); - while (1) { - if (!INKERNEL(frame)) - break; + while (INKERNEL(frame)) { callpc = frame[FR_SCP]; if (stack_put(st, callpc) == -1) break; frame = (u_int32_t *)(frame[FR_RFP]); } +#endif } void @@ -63,6 +62,7 @@ stack_save_td(struct stack *st, struct t panic("stack_save_td: running"); frame = (u_int32_t *)td->td_pcb->un_32.pcb32_r11; + stack_zero(st); stack_capture(st, frame); } @@ -72,5 +72,6 @@ stack_save(struct stack *st) u_int32_t *frame; frame = (u_int32_t *)__builtin_frame_address(0); + stack_zero(st); stack_capture(st, frame); } From owner-svn-src-head@FreeBSD.ORG Sat May 11 23:13:50 2013 Return-Path: Delivered-To: svn-src-head@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 1DB3CF3F; Sat, 11 May 2013 23:13:50 +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 107EDE6C; Sat, 11 May 2013 23:13: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 r4BNDnRh014729; Sat, 11 May 2013 23:13:49 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BNDniE014728; Sat, 11 May 2013 23:13:49 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305112313.r4BNDniE014728@svn.freebsd.org> From: Eitan Adler Date: Sat, 11 May 2013 23:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250532 - 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-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 23:13:50 -0000 Author: eadler Date: Sat May 11 23:13:49 2013 New Revision: 250532 URL: http://svnweb.freebsd.org/changeset/base/250532 Log: Intel's 320-series and 510-series SSDs advertise 512-byte sectors sizes for both logical and physical. Add ADA_Q_4K quirks for both. PR: kern/178040 Submitted by: Jeremy Chadwick Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat May 11 22:32:43 2013 (r250531) +++ head/sys/cam/ata/ata_da.c Sat May 11 23:13:49 2013 (r250532) @@ -350,6 +350,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Intel 320 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSA2CW*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * Intel 330 Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned * Submitted by: Steven Hartland @@ -360,6 +368,14 @@ static struct ada_quirk_entry ada_quirk_ }, { /* + * Intel 510 Series SSDs + * 4k optimised & trim only works in 4k requests + 4k aligned + */ + { T_DIRECT, SIP_MEDIA_FIXED, "*", "INTEL SSDSC2MH*", "*" }, + /*quirks*/ADA_Q_4K + }, + { + /* * OCZ Deneva R Series SSDs * 4k optimised & trim only works in 4k requests + 4k aligned * Submitted by: Steven Hartland From owner-svn-src-head@FreeBSD.ORG Sat May 11 23:55:44 2013 Return-Path: Delivered-To: svn-src-head@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 359898BD; Sat, 11 May 2013 23:55:44 +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 242B9FA5; Sat, 11 May 2013 23:55: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 r4BNtio5028764; Sat, 11 May 2013 23:55:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4BNthVW028762; Sat, 11 May 2013 23:55:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201305112355.r4BNthVW028762@svn.freebsd.org> From: Eitan Adler Date: Sat, 11 May 2013 23:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r250533 - in head: etc/periodic/daily tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 May 2013 23:55:44 -0000 Author: eadler Date: Sat May 11 23:55:43 2013 New Revision: 250533 URL: http://svnweb.freebsd.org/changeset/base/250533 Log: Unconditionally install 210.backup-aliases as many MTAs other than sendmail support the use of /etc/aliases. PR: conf/176098 Submitted by: ak MFC after: 2 weeks Modified: head/etc/periodic/daily/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/etc/periodic/daily/Makefile ============================================================================== --- head/etc/periodic/daily/Makefile Sat May 11 23:13:49 2013 (r250532) +++ head/etc/periodic/daily/Makefile Sat May 11 23:55:43 2013 (r250533) @@ -6,6 +6,7 @@ FILES= 100.clean-disks \ 110.clean-tmps \ 120.clean-preserve \ 200.backup-passwd \ + 210.backup-aliases \ 330.news \ 400.status-disks \ 401.status-graid \ @@ -51,7 +52,6 @@ FILES+= 140.clean-rwho \ .if ${MK_SENDMAIL} != "no" FILES+= 150.clean-hoststat \ - 210.backup-aliases \ 440.status-mailq \ 460.status-mail-rejects \ 500.queuerun Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 11 23:13:49 2013 (r250532) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 11 23:55:43 2013 (r250533) @@ -4017,7 +4017,6 @@ OLD_FILES+=usr/share/man/man8/rtquery.8. .if ${MK_SENDMAIL} == no OLD_FILES+=etc/periodic/daily/150.clean-hoststat -OLD_FILES+=etc/periodic/daily/210.backup-aliases OLD_FILES+=etc/periodic/daily/440.status-mailq OLD_FILES+=etc/periodic/daily/460.status-mail-rejects OLD_FILES+=etc/periodic/daily/500.queuerun