From 5f6a0f033f2c9871dcb86ce93de2b8e90d682b8e Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Fri, 5 Oct 2012 22:30:16 +0000 Subject: [PATCH 001/513] Vendor import of NetBSD's (un)vis(3) as of 2012-10-05 --- unvis.3 | 244 ++++++++++++++++++++++++ unvis.c | 553 +++++++++++++++++++++++++++++++++++++++++++++++++++++ vis.3 | 441 +++++++++++++++++++++++++++++++++++++++++++ vis.c | 574 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ vis.h | 112 +++++++++++ 5 files changed, 1924 insertions(+) create mode 100644 unvis.3 create mode 100644 unvis.c create mode 100644 vis.3 create mode 100644 vis.c create mode 100644 vis.h diff --git a/unvis.3 b/unvis.3 new file mode 100644 index 000000000000..69e1f729a01c --- /dev/null +++ b/unvis.3 @@ -0,0 +1,244 @@ +.\" $NetBSD: unvis.3,v 1.23 2011/03/17 14:06:29 wiz Exp $ +.\" +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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. +.\" +.\" @(#)unvis.3 8.2 (Berkeley) 12/11/93 +.\" +.Dd March 12, 2011 +.Dt UNVIS 3 +.Os +.Sh NAME +.Nm unvis , +.Nm strunvis +.Nd decode a visual representation of characters +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In vis.h +.Ft int +.Fn unvis "char *cp" "int c" "int *astate" "int flag" +.Ft int +.Fn strunvis "char *dst" "const char *src" +.Ft int +.Fn strnunvis "char *dst" "size_t dlen" "const char *src" +.Ft int +.Fn strunvisx "char *dst" "const char *src" "int flag" +.Ft int +.Fn strnunvisx "char *dst" "size_t dlen" "const char *src" "int flag" +.Sh DESCRIPTION +The +.Fn unvis , +.Fn strunvis +and +.Fn strunvisx +functions +are used to decode a visual representation of characters, as produced +by the +.Xr vis 3 +function, back into +the original form. +.Pp +The +.Fn unvis +function is called with successive characters in +.Ar c +until a valid sequence is recognized, at which time the decoded +character is available at the character pointed to by +.Ar cp . +.Pp +The +.Fn strunvis +function decodes the characters pointed to by +.Ar src +into the buffer pointed to by +.Ar dst . +The +.Fn strunvis +function simply copies +.Ar src +to +.Ar dst , +decoding any escape sequences along the way, +and returns the number of characters placed into +.Ar dst , +or \-1 if an +invalid escape sequence was detected. +The size of +.Ar dst +should be equal to the size of +.Ar src +(that is, no expansion takes place during decoding). +.Pp +The +.Fn strunvisx +function does the same as the +.Fn strunvis +function, +but it allows you to add a flag that specifies the style the string +.Ar src +is encoded with. +Currently, the supported flags are: +.Dv VIS_HTTPSTYLE +and +.Dv VIS_MIMESTYLE . +.Pp +The +.Fn unvis +function implements a state machine that can be used to decode an +arbitrary stream of bytes. +All state associated with the bytes being decoded is stored outside the +.Fn unvis +function (that is, a pointer to the state is passed in), so +calls decoding different streams can be freely intermixed. +To start decoding a stream of bytes, first initialize an integer to zero. +Call +.Fn unvis +with each successive byte, along with a pointer +to this integer, and a pointer to a destination character. +The +.Fn unvis +function has several return codes that must be handled properly. +They are: +.Bl -tag -width UNVIS_VALIDPUSH +.It Li \&0 (zero) +Another character is necessary; nothing has been recognized yet. +.It Dv UNVIS_VALID +A valid character has been recognized and is available at the location +pointed to by cp. +.It Dv UNVIS_VALIDPUSH +A valid character has been recognized and is available at the location +pointed to by cp; however, the character currently passed in should +be passed in again. +.It Dv UNVIS_NOCHAR +A valid sequence was detected, but no character was produced. +This return code is necessary to indicate a logical break between characters. +.It Dv UNVIS_SYNBAD +An invalid escape sequence was detected, or the decoder is in an unknown state. +The decoder is placed into the starting state. +.El +.Pp +When all bytes in the stream have been processed, call +.Fn unvis +one more time with flag set to +.Dv UNVIS_END +to extract any remaining character (the character passed in is ignored). +.Pp +The +.Ar flag +argument is also used to specify the encoding style of the source. +If set to +.Dv VIS_HTTPSTYLE +or +.Dv VIS_HTTP1808 , +.Fn unvis +will decode URI strings as specified in RFC 1808. +If set to +.Dv VIS_HTTP1866 , +.Fn unvis +will decode URI strings as specified in RFC 1866. +If set to +.Dv VIS_MIMESTYLE , +.Fn unvis +will decode MIME Quoted-Printable strings as specified in RFC 2045. +If set to +.Dv VIS_NOESCAPE , +.Fn unvis +will not decode \e quoted characters. +.Pp +The following code fragment illustrates a proper use of +.Fn unvis . +.Bd -literal -offset indent +int state = 0; +char out; + +while ((ch = getchar()) != EOF) { +again: + switch(unvis(\*[Am]out, ch, \*[Am]state, 0)) { + case 0: + case UNVIS_NOCHAR: + break; + case UNVIS_VALID: + (void)putchar(out); + break; + case UNVIS_VALIDPUSH: + (void)putchar(out); + goto again; + case UNVIS_SYNBAD: + errx(EXIT_FAILURE, "Bad character sequence!"); + } +} +if (unvis(\*[Am]out, '\e0', \*[Am]state, UNVIS_END) == UNVIS_VALID) + (void)putchar(out); +.Ed +.Sh ERRORS +The functions +.Fn strunvis , +.Fn strnunvis , +.Fn strunvisx , +and +.Fn strnunvisx +will return \-1 on error and set +.Va errno +to: +.Bl -tag -width Er +.It Bq Er EINVAL +An invalid escape sequence was detected, or the decoder is in an unknown state. +.El +.Pp +In addition the functions +.Fn strnunvis +and +.Fn strnunvisx +will can also set +.Va errno +on error to: +.Bl -tag -width Er +.It Bq Er ENOSPC +Not enough space to perform the conversion. +.El +.Sh SEE ALSO +.Xr unvis 1 , +.Xr vis 1 , +.Xr vis 3 +.Rs +.%A R. Fielding +.%T Relative Uniform Resource Locators +.%O RFC1808 +.Re +.Sh HISTORY +The +.Fn unvis +function +first appeared in +.Bx 4.4 . +The +.Fn strnunvis +and +.Fn strnunvisx +functions appeared in +.Nx 6.0 . diff --git a/unvis.c b/unvis.c new file mode 100644 index 000000000000..8d460c34b158 --- /dev/null +++ b/unvis.c @@ -0,0 +1,553 @@ +/* $NetBSD: unvis.c,v 1.39 2012/03/13 21:13:37 christos Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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 +#if defined(LIBC_SCCS) && !defined(lint) +#if 0 +static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; +#else +__RCSID("$NetBSD: unvis.c,v 1.39 2012/03/13 21:13:37 christos Exp $"); +#endif +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" +#include + +#include +#include +#include +#include +#include +#include + +#ifdef __weak_alias +__weak_alias(strnunvisx,_strnunvisx) +#endif + +#if !HAVE_VIS +/* + * decode driven by state machine + */ +#define S_GROUND 0 /* haven't seen escape char */ +#define S_START 1 /* start decoding special sequence */ +#define S_META 2 /* metachar started (M) */ +#define S_META1 3 /* metachar more, regular char (-) */ +#define S_CTRL 4 /* control char started (^) */ +#define S_OCTAL2 5 /* octal digit 2 */ +#define S_OCTAL3 6 /* octal digit 3 */ +#define S_HEX 7 /* mandatory hex digit */ +#define S_HEX1 8 /* http hex digit */ +#define S_HEX2 9 /* http hex digit 2 */ +#define S_MIME1 10 /* mime hex digit 1 */ +#define S_MIME2 11 /* mime hex digit 2 */ +#define S_EATCRNL 12 /* mime eating CRNL */ +#define S_AMP 13 /* seen & */ +#define S_NUMBER 14 /* collecting number */ +#define S_STRING 15 /* collecting string */ + +#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') +#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10)) +#define XTOD(c) (isdigit(c) ? (c - '0') : ((c - 'A') + 10)) + +/* + * RFC 1866 + */ +static const struct nv { + const char *name; + uint8_t value; +} nv[] = { + { "AElig", 198 }, /* capital AE diphthong (ligature) */ + { "Aacute", 193 }, /* capital A, acute accent */ + { "Acirc", 194 }, /* capital A, circumflex accent */ + { "Agrave", 192 }, /* capital A, grave accent */ + { "Aring", 197 }, /* capital A, ring */ + { "Atilde", 195 }, /* capital A, tilde */ + { "Auml", 196 }, /* capital A, dieresis or umlaut mark */ + { "Ccedil", 199 }, /* capital C, cedilla */ + { "ETH", 208 }, /* capital Eth, Icelandic */ + { "Eacute", 201 }, /* capital E, acute accent */ + { "Ecirc", 202 }, /* capital E, circumflex accent */ + { "Egrave", 200 }, /* capital E, grave accent */ + { "Euml", 203 }, /* capital E, dieresis or umlaut mark */ + { "Iacute", 205 }, /* capital I, acute accent */ + { "Icirc", 206 }, /* capital I, circumflex accent */ + { "Igrave", 204 }, /* capital I, grave accent */ + { "Iuml", 207 }, /* capital I, dieresis or umlaut mark */ + { "Ntilde", 209 }, /* capital N, tilde */ + { "Oacute", 211 }, /* capital O, acute accent */ + { "Ocirc", 212 }, /* capital O, circumflex accent */ + { "Ograve", 210 }, /* capital O, grave accent */ + { "Oslash", 216 }, /* capital O, slash */ + { "Otilde", 213 }, /* capital O, tilde */ + { "Ouml", 214 }, /* capital O, dieresis or umlaut mark */ + { "THORN", 222 }, /* capital THORN, Icelandic */ + { "Uacute", 218 }, /* capital U, acute accent */ + { "Ucirc", 219 }, /* capital U, circumflex accent */ + { "Ugrave", 217 }, /* capital U, grave accent */ + { "Uuml", 220 }, /* capital U, dieresis or umlaut mark */ + { "Yacute", 221 }, /* capital Y, acute accent */ + { "aacute", 225 }, /* small a, acute accent */ + { "acirc", 226 }, /* small a, circumflex accent */ + { "acute", 180 }, /* acute accent */ + { "aelig", 230 }, /* small ae diphthong (ligature) */ + { "agrave", 224 }, /* small a, grave accent */ + { "amp", 38 }, /* ampersand */ + { "aring", 229 }, /* small a, ring */ + { "atilde", 227 }, /* small a, tilde */ + { "auml", 228 }, /* small a, dieresis or umlaut mark */ + { "brvbar", 166 }, /* broken (vertical) bar */ + { "ccedil", 231 }, /* small c, cedilla */ + { "cedil", 184 }, /* cedilla */ + { "cent", 162 }, /* cent sign */ + { "copy", 169 }, /* copyright sign */ + { "curren", 164 }, /* general currency sign */ + { "deg", 176 }, /* degree sign */ + { "divide", 247 }, /* divide sign */ + { "eacute", 233 }, /* small e, acute accent */ + { "ecirc", 234 }, /* small e, circumflex accent */ + { "egrave", 232 }, /* small e, grave accent */ + { "eth", 240 }, /* small eth, Icelandic */ + { "euml", 235 }, /* small e, dieresis or umlaut mark */ + { "frac12", 189 }, /* fraction one-half */ + { "frac14", 188 }, /* fraction one-quarter */ + { "frac34", 190 }, /* fraction three-quarters */ + { "gt", 62 }, /* greater than */ + { "iacute", 237 }, /* small i, acute accent */ + { "icirc", 238 }, /* small i, circumflex accent */ + { "iexcl", 161 }, /* inverted exclamation mark */ + { "igrave", 236 }, /* small i, grave accent */ + { "iquest", 191 }, /* inverted question mark */ + { "iuml", 239 }, /* small i, dieresis or umlaut mark */ + { "laquo", 171 }, /* angle quotation mark, left */ + { "lt", 60 }, /* less than */ + { "macr", 175 }, /* macron */ + { "micro", 181 }, /* micro sign */ + { "middot", 183 }, /* middle dot */ + { "nbsp", 160 }, /* no-break space */ + { "not", 172 }, /* not sign */ + { "ntilde", 241 }, /* small n, tilde */ + { "oacute", 243 }, /* small o, acute accent */ + { "ocirc", 244 }, /* small o, circumflex accent */ + { "ograve", 242 }, /* small o, grave accent */ + { "ordf", 170 }, /* ordinal indicator, feminine */ + { "ordm", 186 }, /* ordinal indicator, masculine */ + { "oslash", 248 }, /* small o, slash */ + { "otilde", 245 }, /* small o, tilde */ + { "ouml", 246 }, /* small o, dieresis or umlaut mark */ + { "para", 182 }, /* pilcrow (paragraph sign) */ + { "plusmn", 177 }, /* plus-or-minus sign */ + { "pound", 163 }, /* pound sterling sign */ + { "quot", 34 }, /* double quote */ + { "raquo", 187 }, /* angle quotation mark, right */ + { "reg", 174 }, /* registered sign */ + { "sect", 167 }, /* section sign */ + { "shy", 173 }, /* soft hyphen */ + { "sup1", 185 }, /* superscript one */ + { "sup2", 178 }, /* superscript two */ + { "sup3", 179 }, /* superscript three */ + { "szlig", 223 }, /* small sharp s, German (sz ligature) */ + { "thorn", 254 }, /* small thorn, Icelandic */ + { "times", 215 }, /* multiply sign */ + { "uacute", 250 }, /* small u, acute accent */ + { "ucirc", 251 }, /* small u, circumflex accent */ + { "ugrave", 249 }, /* small u, grave accent */ + { "uml", 168 }, /* umlaut (dieresis) */ + { "uuml", 252 }, /* small u, dieresis or umlaut mark */ + { "yacute", 253 }, /* small y, acute accent */ + { "yen", 165 }, /* yen sign */ + { "yuml", 255 }, /* small y, dieresis or umlaut mark */ +}; + +/* + * unvis - decode characters previously encoded by vis + */ +int +unvis(char *cp, int c, int *astate, int flag) +{ + unsigned char uc = (unsigned char)c; + unsigned char st, ia, is, lc; + +/* + * Bottom 8 bits of astate hold the state machine state. + * Top 8 bits hold the current character in the http 1866 nv string decoding + */ +#define GS(a) ((a) & 0xff) +#define SS(a, b) (((uint32_t)(a) << 24) | (b)) +#define GI(a) ((uint32_t)(a) >> 24) + + _DIAGASSERT(cp != NULL); + _DIAGASSERT(astate != NULL); + st = GS(*astate); + + if (flag & UNVIS_END) { + switch (st) { + case S_OCTAL2: + case S_OCTAL3: + case S_HEX2: + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case S_GROUND: + return UNVIS_NOCHAR; + default: + return UNVIS_SYNBAD; + } + } + + switch (st) { + + case S_GROUND: + *cp = 0; + if ((flag & VIS_NOESCAPE) == 0 && c == '\\') { + *astate = SS(0, S_START); + return UNVIS_NOCHAR; + } + if ((flag & VIS_HTTP1808) && c == '%') { + *astate = SS(0, S_HEX1); + return UNVIS_NOCHAR; + } + if ((flag & VIS_HTTP1866) && c == '&') { + *astate = SS(0, S_AMP); + return UNVIS_NOCHAR; + } + if ((flag & VIS_MIMESTYLE) && c == '=') { + *astate = SS(0, S_MIME1); + return UNVIS_NOCHAR; + } + *cp = c; + return UNVIS_VALID; + + case S_START: + switch(c) { + case '\\': + *cp = c; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + *cp = (c - '0'); + *astate = SS(0, S_OCTAL2); + return UNVIS_NOCHAR; + case 'M': + *cp = (char)0200; + *astate = SS(0, S_META); + return UNVIS_NOCHAR; + case '^': + *astate = SS(0, S_CTRL); + return UNVIS_NOCHAR; + case 'n': + *cp = '\n'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'r': + *cp = '\r'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'b': + *cp = '\b'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'a': + *cp = '\007'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'v': + *cp = '\v'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 't': + *cp = '\t'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'f': + *cp = '\f'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 's': + *cp = ' '; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'E': + *cp = '\033'; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + case 'x': + *astate = SS(0, S_HEX); + return UNVIS_NOCHAR; + case '\n': + /* + * hidden newline + */ + *astate = SS(0, S_GROUND); + return UNVIS_NOCHAR; + case '$': + /* + * hidden marker + */ + *astate = SS(0, S_GROUND); + return UNVIS_NOCHAR; + } + goto bad; + + case S_META: + if (c == '-') + *astate = SS(0, S_META1); + else if (c == '^') + *astate = SS(0, S_CTRL); + else + goto bad; + return UNVIS_NOCHAR; + + case S_META1: + *astate = SS(0, S_GROUND); + *cp |= c; + return UNVIS_VALID; + + case S_CTRL: + if (c == '?') + *cp |= 0177; + else + *cp |= c & 037; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + + case S_OCTAL2: /* second possible octal digit */ + if (isoctal(uc)) { + /* + * yes - and maybe a third + */ + *cp = (*cp << 3) + (c - '0'); + *astate = SS(0, S_OCTAL3); + return UNVIS_NOCHAR; + } + /* + * no - done with current sequence, push back passed char + */ + *astate = SS(0, S_GROUND); + return UNVIS_VALIDPUSH; + + case S_OCTAL3: /* third possible octal digit */ + *astate = SS(0, S_GROUND); + if (isoctal(uc)) { + *cp = (*cp << 3) + (c - '0'); + return UNVIS_VALID; + } + /* + * we were done, push back passed char + */ + return UNVIS_VALIDPUSH; + + case S_HEX: + if (!isxdigit(uc)) + goto bad; + /*FALLTHROUGH*/ + case S_HEX1: + if (isxdigit(uc)) { + *cp = xtod(uc); + *astate = SS(0, S_HEX2); + return UNVIS_NOCHAR; + } + /* + * no - done with current sequence, push back passed char + */ + *astate = SS(0, S_GROUND); + return UNVIS_VALIDPUSH; + + case S_HEX2: + *astate = S_GROUND; + if (isxdigit(uc)) { + *cp = xtod(uc) | (*cp << 4); + return UNVIS_VALID; + } + return UNVIS_VALIDPUSH; + + case S_MIME1: + if (uc == '\n' || uc == '\r') { + *astate = SS(0, S_EATCRNL); + return UNVIS_NOCHAR; + } + if (isxdigit(uc) && (isdigit(uc) || isupper(uc))) { + *cp = XTOD(uc); + *astate = SS(0, S_MIME2); + return UNVIS_NOCHAR; + } + goto bad; + + case S_MIME2: + if (isxdigit(uc) && (isdigit(uc) || isupper(uc))) { + *astate = SS(0, S_GROUND); + *cp = XTOD(uc) | (*cp << 4); + return UNVIS_VALID; + } + goto bad; + + case S_EATCRNL: + switch (uc) { + case '\r': + case '\n': + return UNVIS_NOCHAR; + case '=': + *astate = SS(0, S_MIME1); + return UNVIS_NOCHAR; + default: + *cp = uc; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + } + + case S_AMP: + *cp = 0; + if (uc == '#') { + *astate = SS(0, S_NUMBER); + return UNVIS_NOCHAR; + } + *astate = SS(0, S_STRING); + /*FALLTHROUGH*/ + + case S_STRING: + ia = *cp; /* index in the array */ + is = GI(*astate); /* index in the string */ + lc = is == 0 ? 0 : nv[ia].name[is - 1]; /* last character */ + + if (uc == ';') + uc = '\0'; + + for (; ia < __arraycount(nv); ia++) { + if (is != 0 && nv[ia].name[is - 1] != lc) + goto bad; + if (nv[ia].name[is] == uc) + break; + } + + if (ia == __arraycount(nv)) + goto bad; + + if (uc != 0) { + *cp = ia; + *astate = SS(is + 1, S_STRING); + return UNVIS_NOCHAR; + } + + *cp = nv[ia].value; + *astate = SS(0, S_GROUND); + return UNVIS_VALID; + + case S_NUMBER: + if (uc == ';') + return UNVIS_VALID; + if (!isdigit(uc)) + goto bad; + *cp += (*cp * 10) + uc - '0'; + return UNVIS_NOCHAR; + + default: + bad: + /* + * decoder in unknown state - (probably uninitialized) + */ + *astate = SS(0, S_GROUND); + return UNVIS_SYNBAD; + } +} + +/* + * strnunvisx - decode src into dst + * + * Number of chars decoded into dst is returned, -1 on error. + * Dst is null terminated. + */ + +int +strnunvisx(char *dst, size_t dlen, const char *src, int flag) +{ + char c; + char t = '\0', *start = dst; + int state = 0; + + _DIAGASSERT(src != NULL); + _DIAGASSERT(dst != NULL); +#define CHECKSPACE() \ + do { \ + if (dlen-- == 0) { \ + errno = ENOSPC; \ + return -1; \ + } \ + } while (/*CONSTCOND*/0) + + while ((c = *src++) != '\0') { + again: + switch (unvis(&t, c, &state, flag)) { + case UNVIS_VALID: + CHECKSPACE(); + *dst++ = t; + break; + case UNVIS_VALIDPUSH: + CHECKSPACE(); + *dst++ = t; + goto again; + case 0: + case UNVIS_NOCHAR: + break; + case UNVIS_SYNBAD: + errno = EINVAL; + return -1; + default: + _DIAGASSERT(/*CONSTCOND*/0); + errno = EINVAL; + return -1; + } + } + if (unvis(&t, c, &state, UNVIS_END) == UNVIS_VALID) { + CHECKSPACE(); + *dst++ = t; + } + CHECKSPACE(); + *dst = '\0'; + return (int)(dst - start); +} + +int +strunvisx(char *dst, const char *src, int flag) +{ + return strnunvisx(dst, (size_t)~0, src, flag); +} + +int +strunvis(char *dst, const char *src) +{ + return strnunvisx(dst, (size_t)~0, src, 0); +} + +int +strnunvis(char *dst, size_t dlen, const char *src) +{ + return strnunvisx(dst, dlen, src, 0); +} +#endif diff --git a/vis.3 b/vis.3 new file mode 100644 index 000000000000..6f1e9d5fa847 --- /dev/null +++ b/vis.3 @@ -0,0 +1,441 @@ +.\" $NetBSD: vis.3,v 1.27 2011/05/17 07:10:39 joerg Exp $ +.\" +.\" Copyright (c) 1989, 1991, 1993 +.\" The Regents of the University of California. All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE 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. +.\" +.\" @(#)vis.3 8.1 (Berkeley) 6/9/93 +.\" +.Dd March 12, 2011 +.Dt VIS 3 +.Os +.Sh NAME +.Nm vis , +.Nm nvis , +.Nm strvis , +.Nm strnvis , +.Nm strvisx , +.Nm strnvisx , +.Nm svis , +.Nm snvis , +.Nm strsvis , +.Nm strsnvis , +.Nm strsvisx +.Nm strsnvisx +.Nd visually encode characters +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In vis.h +.Ft char * +.Fn vis "char *dst" "int c" "int flag" "int nextc" +.Ft char * +.Fn nvis "char *dst" "size_t dlen" "int c" "int flag" "int nextc" +.Ft int +.Fn strvis "char *dst" "const char *src" "int flag" +.Ft int +.Fn strnvis "char *dst" "size_t dlen" "const char *src" "int flag" +.Ft int +.Fn strvisx "char *dst" "const char *src" "size_t len" "int flag" +.Ft int +.Fn strnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" +.Ft char * +.Fn svis "char *dst" "int c" "int flag" "int nextc" "const char *extra" +.Ft char * +.Fn snvis "char *dst" "size_t dlen" "int c" "int flag" "int nextc" "const char *extra" +.Ft int +.Fn strsvis "char *dst" "const char *src" "int flag" "const char *extra" +.Ft int +.Fn strsnvis "char *dst" "size_t dlen" "const char *src" "int flag" "const char *extra" +.Ft int +.Fn strsvisx "char *dst" "const char *src" "size_t len" "int flag" "const char *extra" +.Ft int +.Fn strsnvisx "char *dst" "size_t dlen" "const char *src" "size_t len" "int flag" "const char *extra" +.Sh DESCRIPTION +The +.Fn vis +function +copies into +.Fa dst +a string which represents the character +.Fa c . +If +.Fa c +needs no encoding, it is copied in unaltered. +The string is null terminated, and a pointer to the end of the string is +returned. +The maximum length of any encoding is four +characters (not including the trailing +.Dv NUL ) ; +thus, when +encoding a set of characters into a buffer, the size of the buffer should +be four times the number of characters encoded, plus one for the trailing +.Dv NUL . +The flag parameter is used for altering the default range of +characters considered for encoding and for altering the visual +representation. +The additional character, +.Fa nextc , +is only used when selecting the +.Dv VIS_CSTYLE +encoding format (explained below). +.Pp +The +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +and +.Fn strnvisx +functions copy into +.Fa dst +a visual representation of +the string +.Fa src . +The +.Fn strvis +and +.Fn strnvis +functions encode characters from +.Fa src +up to the +first +.Dv NUL . +The +.Fn strvisx +and +.Fn strnvisx +functions encode exactly +.Fa len +characters from +.Fa src +(this +is useful for encoding a block of data that may contain +.Dv NUL Ns 's ) . +Both forms +.Dv NUL +terminate +.Fa dst . +The size of +.Fa dst +must be four times the number +of characters encoded from +.Fa src +(plus one for the +.Dv NUL ) . +Both +forms return the number of characters in dst (not including +the trailing +.Dv NUL ) . +The +.Dq n +versions of the functions also take an additional argument +.Fa dlen +that indicates the length of the +.Fa dst +buffer. +If +.Fa dlen +is not large enough to fix the converted string then the +.Fn strnvis +and +.Fn strnvisx +functions return \-1 and set +.Va errno +to +.Dv ENOSPC . +.Pp +The functions +.Fn svis , +.Fn snvis , +.Fn strsvis , +.Fn strsnvis , +.Fn strsvisx , +and +.Fn strsnvisx +correspond to +.Fn vis , +.Fn nvis , +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +and +.Fn strnvisx +but have an additional argument +.Fa extra , +pointing to a +.Dv NUL +terminated list of characters. +These characters will be copied encoded or backslash-escaped into +.Fa dst . +These functions are useful e.g. to remove the special meaning +of certain characters to shells. +.Pp +The encoding is a unique, invertible representation composed entirely of +graphic characters; it can be decoded back into the original form using +the +.Xr unvis 3 , +.Xr strunvis 3 +or +.Xr strnunvis 3 +functions. +.Pp +There are two parameters that can be controlled: the range of +characters that are encoded (applies only to +.Fn vis , +.Fn nvis , +.Fn strvis , +.Fn strnvis , +.Fn strvisx , +and +.Fn strnvisx ) , +and the type of representation used. +By default, all non-graphic characters, +except space, tab, and newline are encoded. +(See +.Xr isgraph 3 . ) +The following flags +alter this: +.Bl -tag -width VIS_WHITEX +.It Dv VIS_SP +Also encode space. +.It Dv VIS_TAB +Also encode tab. +.It Dv VIS_NL +Also encode newline. +.It Dv VIS_WHITE +Synonym for +.Dv VIS_SP +\&| +.Dv VIS_TAB +\&| +.Dv VIS_NL . +.It Dv VIS_SAFE +Only encode "unsafe" characters. +Unsafe means control characters which may cause common terminals to perform +unexpected functions. +Currently this form allows space, tab, newline, backspace, bell, and +return - in addition to all graphic characters - unencoded. +.El +.Pp +(The above flags have no effect for +.Fn svis , +.Fn snvis , +.Fn strsvis , +.Fn strsnvis , +.Fn strsvisx , +and +.Fn strsnvisx . +When using these functions, place all graphic characters to be +encoded in an array pointed to by +.Fa extra . +In general, the backslash character should be included in this array, see the +warning on the use of the +.Dv VIS_NOSLASH +flag below). +.Pp +There are four forms of encoding. +All forms use the backslash character +.Ql \e +to introduce a special +sequence; two backslashes are used to represent a real backslash, +except +.Dv VIS_HTTPSTYLE +that uses +.Ql % , +or +.Dv VIS_MIMESTYLE +that uses +.Ql = . +These are the visual formats: +.Bl -tag -width VIS_CSTYLE +.It (default) +Use an +.Ql M +to represent meta characters (characters with the 8th +bit set), and use caret +.Ql ^ +to represent control characters see +.Pf ( Xr iscntrl 3 ) . +The following formats are used: +.Bl -tag -width xxxxx +.It Dv \e^C +Represents the control character +.Ql C . +Spans characters +.Ql \e000 +through +.Ql \e037 , +and +.Ql \e177 +(as +.Ql \e^? ) . +.It Dv \eM-C +Represents character +.Ql C +with the 8th bit set. +Spans characters +.Ql \e241 +through +.Ql \e376 . +.It Dv \eM^C +Represents control character +.Ql C +with the 8th bit set. +Spans characters +.Ql \e200 +through +.Ql \e237 , +and +.Ql \e377 +(as +.Ql \eM^? ) . +.It Dv \e040 +Represents +.Tn ASCII +space. +.It Dv \e240 +Represents Meta-space. +.El +.Pp +.It Dv VIS_CSTYLE +Use C-style backslash sequences to represent standard non-printable +characters. +The following sequences are used to represent the indicated characters: +.Bd -unfilled -offset indent +.Li \ea Tn - BEL No (007) +.Li \eb Tn - BS No (010) +.Li \ef Tn - NP No (014) +.Li \en Tn - NL No (012) +.Li \er Tn - CR No (015) +.Li \es Tn - SP No (040) +.Li \et Tn - HT No (011) +.Li \ev Tn - VT No (013) +.Li \e0 Tn - NUL No (000) +.Ed +.Pp +When using this format, the nextc parameter is looked at to determine +if a +.Dv NUL +character can be encoded as +.Ql \e0 +instead of +.Ql \e000 . +If +.Fa nextc +is an octal digit, the latter representation is used to +avoid ambiguity. +.It Dv VIS_OCTAL +Use a three digit octal sequence. +The form is +.Ql \eddd +where +.Em d +represents an octal digit. +.It Dv VIS_HTTPSTYLE +Use URI encoding as described in RFC 1738. +The form is +.Ql %xx +where +.Em x +represents a lower case hexadecimal digit. +.It Dv VIS_MIMESTYLE +Use MIME Quoted-Printable encoding as described in RFC 2045, only don't +break lines and don't handle CRLF. +The form is: +.Ql %XX +where +.Em X +represents an upper case hexadecimal digit. +.El +.Pp +There is one additional flag, +.Dv VIS_NOSLASH , +which inhibits the +doubling of backslashes and the backslash before the default +format (that is, control characters are represented by +.Ql ^C +and +meta characters as +.Ql M-C ) . +With this flag set, the encoding is +ambiguous and non-invertible. +.Sh ERRORS +The functions +.Fn nvis +and +.Fn snvis +will return +.Dv NULL +and the functions +.Fn strnvis , +.Fn strnvisx , +.Fn strsnvis , +and +.Fn strsnvisx , +will return \-1 when the +.Fa dlen +destination buffer length size is not enough to perform the conversion while +setting +.Va errno +to: +.Bl -tag -width Er +.It Bq Er ENOSPC +The destination buffer size is not large enough to perform the conversion. +.El +.Sh SEE ALSO +.Xr unvis 1 , +.Xr vis 1 , +.Xr unvis 3 +.Rs +.%A T. Berners-Lee +.%T Uniform Resource Locators (URL) +.%O RFC1738 +.Re +.Sh HISTORY +The +.Fn vis , +.Fn strvis , +and +.Fa strvisx +functions first appeared in +.Bx 4.4 . +The +.Fn svis , +.Fn strsvis , +and +.Fn strsvisx +functions appeared in +.Nx 1.5 . +The buffer size limited versions of the functions +.Po Fn nvis , +.Fn strnvis , +.Fn strnvisx , +.Fn snvis , +.Fn strsnvis , +and +.Fn strsnvisx Pc +appeared in +.Nx 6.0 . diff --git a/vis.c b/vis.c new file mode 100644 index 000000000000..d20694410942 --- /dev/null +++ b/vis.c @@ -0,0 +1,574 @@ +/* $NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $ */ + +/*- + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +/*- + * Copyright (c) 1999, 2005 The NetBSD Foundation, Inc. + * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: vis.c,v 1.44 2011/03/12 19:52:48 christos Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include "namespace.h" +#include + +#include +#include +#include +#include + +#ifdef __weak_alias +__weak_alias(strvisx,_strvisx) +#endif + +#if !HAVE_VIS || !HAVE_SVIS +#include +#include +#include +#include + +static char *do_svis(char *, size_t *, int, int, int, const char *); + +#undef BELL +#define BELL '\a' + +#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7') +#define iswhite(c) (c == ' ' || c == '\t' || c == '\n') +#define issafe(c) (c == '\b' || c == BELL || c == '\r') +#define xtoa(c) "0123456789abcdef"[c] +#define XTOA(c) "0123456789ABCDEF"[c] + +#define MAXEXTRAS 5 + +#define MAKEEXTRALIST(flag, extra, orig_str) \ +do { \ + const char *orig = orig_str; \ + const char *o = orig; \ + char *e; \ + while (*o++) \ + continue; \ + extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \ + if (!extra) break; \ + for (o = orig, e = extra; (*e++ = *o++) != '\0';) \ + continue; \ + e--; \ + if (flag & VIS_SP) *e++ = ' '; \ + if (flag & VIS_TAB) *e++ = '\t'; \ + if (flag & VIS_NL) *e++ = '\n'; \ + if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \ + *e = '\0'; \ +} while (/*CONSTCOND*/0) + +/* + * This is do_hvis, for HTTP style (RFC 1808) + */ +static char * +do_hvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +{ + + if ((isascii(c) && isalnum(c)) + /* safe */ + || c == '$' || c == '-' || c == '_' || c == '.' || c == '+' + /* extra */ + || c == '!' || c == '*' || c == '\'' || c == '(' || c == ')' + || c == ',') { + dst = do_svis(dst, dlen, c, flag, nextc, extra); + } else { + if (dlen) { + if (*dlen < 3) + return NULL; + *dlen -= 3; + } + *dst++ = '%'; + *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); + *dst++ = xtoa((unsigned int)c & 0xf); + } + + return dst; +} + +/* + * This is do_mvis, for Quoted-Printable MIME (RFC 2045) + * NB: No handling of long lines or CRLF. + */ +static char * +do_mvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +{ + if ((c != '\n') && + /* Space at the end of the line */ + ((isspace(c) && (nextc == '\r' || nextc == '\n')) || + /* Out of range */ + (!isspace(c) && (c < 33 || (c > 60 && c < 62) || c > 126)) || + /* Specific char to be escaped */ + strchr("#$@[\\]^`{|}~", c) != NULL)) { + if (dlen) { + if (*dlen < 3) + return NULL; + *dlen -= 3; + } + *dst++ = '='; + *dst++ = XTOA(((unsigned int)c >> 4) & 0xf); + *dst++ = XTOA((unsigned int)c & 0xf); + } else { + dst = do_svis(dst, dlen, c, flag, nextc, extra); + } + return dst; +} + +/* + * This is do_vis, the central code of vis. + * dst: Pointer to the destination buffer + * c: Character to encode + * flag: Flag word + * nextc: The character following 'c' + * extra: Pointer to the list of extra characters to be + * backslash-protected. + */ +static char * +do_svis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +{ + int isextra; + size_t odlen = dlen ? *dlen : 0; + + isextra = strchr(extra, c) != NULL; +#define HAVE(x) \ + do { \ + if (dlen) { \ + if (*dlen < (x)) \ + goto out; \ + *dlen -= (x); \ + } \ + } while (/*CONSTCOND*/0) + if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || + ((flag & VIS_SAFE) && issafe(c)))) { + HAVE(1); + *dst++ = c; + return dst; + } + if (flag & VIS_CSTYLE) { + HAVE(2); + switch (c) { + case '\n': + *dst++ = '\\'; *dst++ = 'n'; + return dst; + case '\r': + *dst++ = '\\'; *dst++ = 'r'; + return dst; + case '\b': + *dst++ = '\\'; *dst++ = 'b'; + return dst; + case BELL: + *dst++ = '\\'; *dst++ = 'a'; + return dst; + case '\v': + *dst++ = '\\'; *dst++ = 'v'; + return dst; + case '\t': + *dst++ = '\\'; *dst++ = 't'; + return dst; + case '\f': + *dst++ = '\\'; *dst++ = 'f'; + return dst; + case ' ': + *dst++ = '\\'; *dst++ = 's'; + return dst; + case '\0': + *dst++ = '\\'; *dst++ = '0'; + if (isoctal(nextc)) { + HAVE(2); + *dst++ = '0'; + *dst++ = '0'; + } + return dst; + default: + if (isgraph(c)) { + *dst++ = '\\'; *dst++ = c; + return dst; + } + if (dlen) + *dlen = odlen; + } + } + if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { + HAVE(4); + *dst++ = '\\'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 6) & 03) + '0'; + *dst++ = (u_char)(((u_int32_t)(u_char)c >> 3) & 07) + '0'; + *dst++ = (c & 07) + '0'; + } else { + if ((flag & VIS_NOSLASH) == 0) { + HAVE(1); + *dst++ = '\\'; + } + + if (c & 0200) { + HAVE(1); + c &= 0177; *dst++ = 'M'; + } + + if (iscntrl(c)) { + HAVE(2); + *dst++ = '^'; + if (c == 0177) + *dst++ = '?'; + else + *dst++ = c + '@'; + } else { + HAVE(2); + *dst++ = '-'; *dst++ = c; + } + } + return dst; +out: + *dlen = odlen; + return NULL; +} + +typedef char *(*visfun_t)(char *, size_t *, int, int, int, const char *); + +/* + * Return the appropriate encoding function depending on the flags given. + */ +static visfun_t +getvisfun(int flag) +{ + if (flag & VIS_HTTPSTYLE) + return do_hvis; + if (flag & VIS_MIMESTYLE) + return do_mvis; + return do_svis; +} + +/* + * isnvis - visually encode characters, also encoding the characters + * pointed to by `extra' + */ +static char * +isnvis(char *dst, size_t *dlen, int c, int flag, int nextc, const char *extra) +{ + char *nextra = NULL; + visfun_t f; + + _DIAGASSERT(dst != NULL); + _DIAGASSERT(extra != NULL); + MAKEEXTRALIST(flag, nextra, extra); + if (!nextra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + return NULL; + } + *dst = '\0'; /* can't create nextra, return "" */ + return dst; + } + f = getvisfun(flag); + dst = (*f)(dst, dlen, c, flag, nextc, nextra); + free(nextra); + if (dst == NULL || (dlen && *dlen == 0)) { + errno = ENOSPC; + return NULL; + } + *dst = '\0'; + return dst; +} + +char * +svis(char *dst, int c, int flag, int nextc, const char *extra) +{ + return isnvis(dst, NULL, c, flag, nextc, extra); +} + +char * +snvis(char *dst, size_t dlen, int c, int flag, int nextc, const char *extra) +{ + return isnvis(dst, &dlen, c, flag, nextc, extra); +} + + +/* + * strsvis, strsvisx - visually encode characters from src into dst + * + * Extra is a pointer to a \0-terminated list of characters to + * be encoded, too. These functions are useful e. g. to + * encode strings in such a way so that they are not interpreted + * by a shell. + * + * Dst must be 4 times the size of src to account for possible + * expansion. The length of dst, not including the trailing NULL, + * is returned. + * + * Strsvisx encodes exactly len bytes from src into dst. + * This is useful for encoding a block of data. + */ +static int +istrsnvis(char *dst, size_t *dlen, const char *csrc, int flag, const char *extra) +{ + int c; + char *start; + char *nextra = NULL; + const unsigned char *src = (const unsigned char *)csrc; + visfun_t f; + + _DIAGASSERT(dst != NULL); + _DIAGASSERT(src != NULL); + _DIAGASSERT(extra != NULL); + MAKEEXTRALIST(flag, nextra, extra); + if (!nextra) { + *dst = '\0'; /* can't create nextra, return "" */ + return 0; + } + f = getvisfun(flag); + for (start = dst; (c = *src++) != '\0'; /* empty */) { + dst = (*f)(dst, dlen, c, flag, *src, nextra); + if (dst == NULL) { + errno = ENOSPC; + return -1; + } + } + free(nextra); + if (dlen && *dlen == 0) { + errno = ENOSPC; + return -1; + } + *dst = '\0'; + return (int)(dst - start); +} + +int +strsvis(char *dst, const char *csrc, int flag, const char *extra) +{ + return istrsnvis(dst, NULL, csrc, flag, extra); +} + +int +strsnvis(char *dst, size_t dlen, const char *csrc, int flag, const char *extra) +{ + return istrsnvis(dst, &dlen, csrc, flag, extra); +} + +static int +istrsnvisx(char *dst, size_t *dlen, const char *csrc, size_t len, int flag, + const char *extra) +{ + unsigned char c; + char *start; + char *nextra = NULL; + const unsigned char *src = (const unsigned char *)csrc; + visfun_t f; + + _DIAGASSERT(dst != NULL); + _DIAGASSERT(src != NULL); + _DIAGASSERT(extra != NULL); + MAKEEXTRALIST(flag, nextra, extra); + if (! nextra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + return -1; + } + *dst = '\0'; /* can't create nextra, return "" */ + return 0; + } + + f = getvisfun(flag); + for (start = dst; len > 0; len--) { + c = *src++; + dst = (*f)(dst, dlen, c, flag, len > 1 ? *src : '\0', nextra); + if (dst == NULL) { + errno = ENOSPC; + return -1; + } + } + free(nextra); + if (dlen && *dlen == 0) { + errno = ENOSPC; + return -1; + } + *dst = '\0'; + return (int)(dst - start); +} + +int +strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra) +{ + return istrsnvisx(dst, NULL, csrc, len, flag, extra); +} + +int +strsnvisx(char *dst, size_t dlen, const char *csrc, size_t len, int flag, + const char *extra) +{ + return istrsnvisx(dst, &dlen, csrc, len, flag, extra); +} +#endif + +#if !HAVE_VIS +/* + * vis - visually encode characters + */ +static char * +invis(char *dst, size_t *dlen, int c, int flag, int nextc) +{ + char *extra = NULL; + unsigned char uc = (unsigned char)c; + visfun_t f; + + _DIAGASSERT(dst != NULL); + + MAKEEXTRALIST(flag, extra, ""); + if (! extra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + return NULL; + } + *dst = '\0'; /* can't create extra, return "" */ + return dst; + } + f = getvisfun(flag); + dst = (*f)(dst, dlen, uc, flag, nextc, extra); + free(extra); + if (dst == NULL || (dlen && *dlen == 0)) { + errno = ENOSPC; + return NULL; + } + *dst = '\0'; + return dst; +} + +char * +vis(char *dst, int c, int flag, int nextc) +{ + return invis(dst, NULL, c, flag, nextc); +} + +char * +nvis(char *dst, size_t dlen, int c, int flag, int nextc) +{ + return invis(dst, &dlen, c, flag, nextc); +} + + +/* + * strvis, strvisx - visually encode characters from src into dst + * + * Dst must be 4 times the size of src to account for possible + * expansion. The length of dst, not including the trailing NULL, + * is returned. + * + * Strvisx encodes exactly len bytes from src into dst. + * This is useful for encoding a block of data. + */ +static int +istrnvis(char *dst, size_t *dlen, const char *src, int flag) +{ + char *extra = NULL; + int rv; + + MAKEEXTRALIST(flag, extra, ""); + if (!extra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + return -1; + } + *dst = '\0'; /* can't create extra, return "" */ + return 0; + } + rv = istrsnvis(dst, dlen, src, flag, extra); + free(extra); + return rv; +} + +int +strvis(char *dst, const char *src, int flag) +{ + return istrnvis(dst, NULL, src, flag); +} + +int +strnvis(char *dst, size_t dlen, const char *src, int flag) +{ + return istrnvis(dst, &dlen, src, flag); +} + +static int +istrnvisx(char *dst, size_t *dlen, const char *src, size_t len, int flag) +{ + char *extra = NULL; + int rv; + + MAKEEXTRALIST(flag, extra, ""); + if (!extra) { + if (dlen && *dlen == 0) { + errno = ENOSPC; + return -1; + } + *dst = '\0'; /* can't create extra, return "" */ + return 0; + } + rv = istrsnvisx(dst, dlen, src, len, flag, extra); + free(extra); + return rv; +} + +int +strvisx(char *dst, const char *src, size_t len, int flag) +{ + return istrnvisx(dst, NULL, src, len, flag); +} + +int +strnvisx(char *dst, size_t dlen, const char *src, size_t len, int flag) +{ + return istrnvisx(dst, &dlen, src, len, flag); +} + +#endif diff --git a/vis.h b/vis.h new file mode 100644 index 000000000000..5e8d1d31e85a --- /dev/null +++ b/vis.h @@ -0,0 +1,112 @@ +/* $NetBSD: vis.h,v 1.19 2011/03/12 19:52:45 christos Exp $ */ + +/*- + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + * + * @(#)vis.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _VIS_H_ +#define _VIS_H_ + +#include + +/* + * to select alternate encoding format + */ +#define VIS_OCTAL 0x001 /* use octal \ddd format */ +#define VIS_CSTYLE 0x002 /* use \[nrft0..] where appropiate */ + +/* + * to alter set of characters encoded (default is to encode all + * non-graphic except space, tab, and newline). + */ +#define VIS_SP 0x004 /* also encode space */ +#define VIS_TAB 0x008 /* also encode tab */ +#define VIS_NL 0x010 /* also encode newline */ +#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL) +#define VIS_SAFE 0x020 /* only encode "unsafe" characters */ + +/* + * other + */ +#define VIS_NOSLASH 0x040 /* inhibit printing '\' */ +#define VIS_HTTP1808 0x080 /* http-style escape % hex hex */ +#define VIS_HTTPSTYLE 0x080 /* http-style escape % hex hex */ +#define VIS_MIMESTYLE 0x100 /* mime-style escape = HEX HEX */ +#define VIS_HTTP1866 0x200 /* http-style &#num; or &string; */ +#define VIS_NOESCAPE 0x400 /* don't decode `\' */ +#define _VIS_END 0x800 /* for unvis */ + +/* + * unvis return codes + */ +#define UNVIS_VALID 1 /* character valid */ +#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */ +#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */ +#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */ +#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */ + +/* + * unvis flags + */ +#define UNVIS_END _VIS_END /* no more characters */ + +#include + +__BEGIN_DECLS +char *vis(char *, int, int, int); +char *nvis(char *, size_t, int, int, int); + +char *svis(char *, int, int, int, const char *); +char *snvis(char *, size_t, int, int, int, const char *); + +int strvis(char *, const char *, int); +int strnvis(char *, size_t, const char *, int); + +int strsvis(char *, const char *, int, const char *); +int strsnvis(char *, size_t, const char *, int, const char *); + +int strvisx(char *, const char *, size_t, int); +int strnvisx(char *, size_t, const char *, size_t, int); + +int strsvisx(char *, const char *, size_t, int, const char *); +int strsnvisx(char *, size_t, const char *, size_t, int, const char *); + +int strunvis(char *, const char *); +int strnunvis(char *, size_t, const char *); + +int strunvisx(char *, const char *, int); +int strnunvisx(char *, size_t, const char *, int); + +#ifndef __LIBC12_SOURCE__ +int unvis(char *, int, int *, int) __RENAME(__unvis50); +#endif +__END_DECLS + +#endif /* !_VIS_H_ */ From f506aeda9b061801a7679280309b1c70b3465c76 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 3 Dec 2012 23:36:03 +0000 Subject: [PATCH 002/513] Include if_ath_alq.c, which only gets actually compiled if ATH_DEBUG_ALQ is enabled. --- sys/modules/ath/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile index 6c27c0a669fc..1b011b490d72 100644 --- a/sys/modules/ath/Makefile +++ b/sys/modules/ath/Makefile @@ -35,7 +35,7 @@ ATH_RATE?= sample # tx rate control algorithm .PATH: ${.CURDIR}/../../dev/ath/ath_hal KMOD= if_ath -SRCS= if_ath.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c +SRCS= if_ath.c if_ath_alq.c if_ath_debug.c if_ath_keycache.c if_ath_sysctl.c SRCS+= if_ath_tx.c if_ath_tx_ht.c if_ath_led.c if_ath_rx.c if_ath_tdma.c SRCS+= if_ath_beacon.c if_ath_rx_edma.c if_ath_tx_edma.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it From 8db3411759373c59193d26b6c9aa35759a331e7f Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 3 Dec 2012 23:38:08 +0000 Subject: [PATCH 003/513] Add the btcoex code into the module compilation. --- sys/modules/ath/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/modules/ath/Makefile b/sys/modules/ath/Makefile index 1b011b490d72..dcd64233fed2 100644 --- a/sys/modules/ath/Makefile +++ b/sys/modules/ath/Makefile @@ -86,8 +86,8 @@ SRCS+= ar5413.c # + 5416 (Owl) .PATH: ${.CURDIR}/../../dev/ath/ath_hal/ar5416 SRCS+= ah_eeprom_v14.c ah_eeprom_v4k.c \ - ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_cal.c \ - ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \ + ar5416_ani.c ar5416_attach.c ar5416_beacon.c ar5416_btcoex.c \ + ar5416_cal.c ar5416_cal_iq.c ar5416_cal_adcgain.c ar5416_cal_adcdc.c \ ar5416_eeprom.c ar5416_gpio.c ar5416_interrupts.c ar5416_keycache.c \ ar5416_misc.c ar5416_phy.c ar5416_power.c ar5416_radar.c \ ar5416_recv.c ar5416_reset.c ar5416_xmit.c @@ -115,7 +115,7 @@ SRCS+= ar9280.c ar9280_attach.c ar9280_olc.c # + AR9285 - Kite SRCS+= ar9285.c ar9285_reset.c ar9285_attach.c ar9285_cal.c ar9285_phy.c -SRCS+= ar9285_diversity.c +SRCS+= ar9285_diversity.c ar9285_btcoex.c # + AR9287 - Kiwi .PATH: ${.CURDIR}/../../dev/ath/ath_hal From 4516888b72b7ab0578976750f51871cbfbef26ea Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 3 Dec 2012 23:43:23 +0000 Subject: [PATCH 004/513] Add the AR5416/AR9285 bluetooth coexistence code into the main kernel build. --- sys/conf/files | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/conf/files b/sys/conf/files index f80f76e9e583..c742db3478ac 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -858,6 +858,10 @@ dev/ath/ath_hal/ar5416/ar5416_beacon.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ ath_ar9287 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar5416/ar5416_btcoex.c \ + optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ + ath_ar9287 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar5416_cal.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 | \ ath_ar9287 \ @@ -941,6 +945,8 @@ dev/ath/ath_hal/ar9002/ar9280_olc.c optional ath_hal | ath_ar9280 | \ # ar9285 (depends on ar5416 and ar9280) dev/ath/ath_hal/ar9002/ar9285_attach.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar9002/ar9285_btcoex.c optional ath_hal | ath_ar9285 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285_reset.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar9002/ar9285_cal.c optional ath_hal | ath_ar9285 \ From 24a8406b99b17841511f75e2972ce8bf4cb42136 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Mon, 3 Dec 2012 23:45:06 +0000 Subject: [PATCH 005/513] Add and tie in the AR5416 bluetooth coexistence methods into the HAL. --- sys/dev/ath/ath_hal/ah.h | 16 ++++++++++++++++ sys/dev/ath/ath_hal/ar5416/ar5416_attach.c | 10 ++++++++++ 2 files changed, 26 insertions(+) diff --git a/sys/dev/ath/ath_hal/ah.h b/sys/dev/ath/ath_hal/ah.h index 54cef23e1071..8a71450c1d42 100644 --- a/sys/dev/ath/ath_hal/ah.h +++ b/sys/dev/ath/ath_hal/ah.h @@ -1514,6 +1514,22 @@ struct ath_hal { HAL_BOOL __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*); HAL_INT __ahdecl(*ah_getInterrupts)(struct ath_hal*); HAL_INT __ahdecl(*ah_setInterrupts)(struct ath_hal*, HAL_INT); + + /* Bluetooth Coexistence functions */ + void __ahdecl(*ah_btCoexSetInfo)(struct ath_hal *, + HAL_BT_COEX_INFO *); + void __ahdecl(*ah_btCoexSetConfig)(struct ath_hal *, + HAL_BT_COEX_CONFIG *); + void __ahdecl(*ah_btCoexSetQcuThresh)(struct ath_hal *, + int); + void __ahdecl(*ah_btCoexSetWeights)(struct ath_hal *, + uint32_t); + void __ahdecl(*ah_btCoexSetBmissThresh)(struct ath_hal *, + uint32_t); + void __ahdecl(*ah_btcoexSetParameter)(struct ath_hal *, + uint32_t, uint32_t); + void __ahdecl(*ah_btCoexDisable)(struct ath_hal *); + int __ahdecl(*ah_btCoexEnable)(struct ath_hal *); }; /* diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c index 603dfc28be73..a7cb06d1c7eb 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c @@ -191,6 +191,16 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc, ah->ah_getPendingInterrupts = ar5416GetPendingInterrupts; ah->ah_setInterrupts = ar5416SetInterrupts; + /* Bluetooth Coexistence functions */ + ah->ah_btCoexSetInfo = ar5416SetBTCoexInfo; + ah->ah_btCoexSetConfig = ar5416BTCoexConfig; + ah->ah_btCoexSetQcuThresh = ar5416BTCoexSetQcuThresh; + ah->ah_btCoexSetWeights = ar5416BTCoexSetWeights; + ah->ah_btCoexSetBmissThresh = ar5416BTCoexSetupBmissThresh; + ah->ah_btcoexSetParameter = ar5416BTCoexSetParameter; + ah->ah_btCoexDisable = ar5416BTCoexDisable; + ah->ah_btCoexEnable = ar5416BTCoexEnable; + ahp->ah_priv.ah_getWirelessModes= ar5416GetWirelessModes; ahp->ah_priv.ah_eepromRead = ar5416EepromRead; #ifdef AH_SUPPORT_WRITE_EEPROM From 87a85d8a490478e0c92fd1d5aade88e44d6d91ee Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 4 Dec 2012 00:01:24 +0000 Subject: [PATCH 006/513] Reformat/reindent. --- sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c | 111 +++++++++++---------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c index 256039c47e55..093b2b417fd4 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c @@ -24,7 +24,7 @@ #include "ah_internal.h" #include "ah_devid.h" #ifdef AH_DEBUG -#include "ah_desc.h" /* NB: for HAL_PHYERR* */ +#include "ah_desc.h" /* NB: for HAL_PHYERR* */ #endif #include "ar5416/ar5416.h" @@ -47,64 +47,75 @@ ar9285BTCoexAntennaDiversity(struct ath_hal *ah) u_int32_t regVal; u_int8_t ant_div_control1, ant_div_control2; - if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) || - (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) { - if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE) && - (AH5212(ah)->ah_diversity == HAL_ANT_VARIABLE)) { - /* Enable antenna diversity */ - ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE; - ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE; + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ALLOW) || + (AH5212(ah)->ah_diversity != HAL_ANT_VARIABLE)) { + if ((ahp->ah_btCoexFlag & HAL_BT_COEX_FLAG_ANT_DIV_ENABLE) && + (AH5212(ah)->ah_diversity == HAL_ANT_VARIABLE)) { + /* Enable antenna diversity */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_ENABLE; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_ENABLE; - /* Don't disable BT ant to allow BB to control SWCOM */ - ahp->ah_btCoexMode2 &= (~(AR_BT_DISABLE_BT_ANT)); - OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + /* Don't disable BT ant to allow BB to control SWCOM */ + ahp->ah_btCoexMode2 &= (~(AR_BT_DISABLE_BT_ANT)); + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); - /* Program the correct SWCOM table */ - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, - HAL_BT_COEX_ANT_DIV_SWITCH_COM); - OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); - } else if (AH5212(ah)->ah_diversity == HAL_ANT_FIXED_B) { - /* Disable antenna diversity. Use antenna B(LNA2) only. */ - ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B; - ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B; + /* Program the correct SWCOM table */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, + HAL_BT_COEX_ANT_DIV_SWITCH_COM); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); + } else if (AH5212(ah)->ah_diversity == HAL_ANT_FIXED_B) { + /* Disable antenna diversity. Use antenna B(LNA2) only. */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_B; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_B; - /* Disable BT ant to allow concurrent BT and WLAN receive */ - ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; - OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + /* Disable BT ant to allow concurrent BT and WLAN receive */ + ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); - /* Program SWCOM talbe to make sure RF switch always parks at WLAN side */ - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, HAL_BT_COEX_ANT_DIV_SWITCH_COM); - OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0x60000000, 0xf0000000); - } else { - /* Disable antenna diversity. Use antenna A(LNA1) only */ - ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A; - ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A; + /* + * Program SWCOM table to make sure RF switch always parks + * at WLAN side + */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, + HAL_BT_COEX_ANT_DIV_SWITCH_COM); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0x60000000, 0xf0000000); + } else { + /* Disable antenna diversity. Use antenna A(LNA1) only */ + ant_div_control1 = HAL_BT_COEX_ANTDIV_CONTROL1_FIXED_A; + ant_div_control2 = HAL_BT_COEX_ANTDIV_CONTROL2_FIXED_A; - /* Disable BT ant to allow concurrent BT and WLAN receive */ - ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; - OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); + /* Disable BT ant to allow concurrent BT and WLAN receive */ + ahp->ah_btCoexMode2 |= AR_BT_DISABLE_BT_ANT; + OS_REG_WRITE(ah, AR_BT_COEX_MODE2, ahp->ah_btCoexMode2); - /* Program SWCOM talbe to make sure RF switch always parks at BT side */ - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, 0); - OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); - } + /* + * Program SWCOM table to make sure RF switch always + * parks at BT side + */ + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, 0); + OS_REG_RMW(ah, AR_PHY_SWITCH_CHAIN_0, 0, 0xf0000000); + } - regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); - regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); - /* Clear ant_fast_div_bias [14:9] since for Janus the main LNA is always LNA1. */ - regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); + /* + * Clear ant_fast_div_bias [14:9] since for Janus the main LNA is + * always LNA1. + */ + regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); - regVal |= SM(ant_div_control1, AR_PHY_9285_ANT_DIV_CTL); - regVal |= SM(ant_div_control2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM((ant_div_control2 >> 2), AR_PHY_9285_ANT_DIV_MAIN_LNACONF); - regVal |= SM((ant_div_control1 >> 1), AR_PHY_9285_ANT_DIV_ALT_GAINTB); - regVal |= SM((ant_div_control1 >> 2), AR_PHY_9285_ANT_DIV_MAIN_GAINTB); - OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); + regVal |= SM(ant_div_control1, AR_PHY_9285_ANT_DIV_CTL); + regVal |= SM(ant_div_control2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM((ant_div_control2 >> 2), AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM((ant_div_control1 >> 1), AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM((ant_div_control1 >> 2), AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); - regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); - regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); - regVal |= SM((ant_div_control1 >> 3), AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); - OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + regVal |= SM((ant_div_control1 >> 3), + AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); } } From 96b59d60c858a3b924d46c5895e8686d5417a13d Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 4 Dec 2012 00:01:42 +0000 Subject: [PATCH 007/513] Override the BT coex parameter function for the AR9285. --- sys/dev/ath/ath_hal/ar9002/ar9285_attach.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c index 97e6823a7b49..863fcd96fc13 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c @@ -148,15 +148,16 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc, ah->ah_eepromdata = eepromdata; } - /* XXX override with 9285 specific state */ - /* override 5416 methods for our needs */ + /* override with 9285 specific state */ AH5416(ah)->ah_initPLL = ar9280InitPLL; + AH5416(ah)->ah_btCoexSetDiversity = ar5416BTCoexAntennaDiversity; ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; ah->ah_configPCIE = ar9285ConfigPCIE; ah->ah_disablePCIE = ar9285DisablePCIE; ah->ah_setTxPower = ar9285SetTransmitPower; ah->ah_setBoardValues = ar9285SetBoardValues; + ah->ah_btcoexSetParameter = ar9285BTCoexSetParameter; AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal; From e89812c3798e4f82a7e7499d1bf17880195a81c4 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 4 Dec 2012 00:02:46 +0000 Subject: [PATCH 008/513] Methodise the BT diversity configuration function; so the AR9285 can correctly override it. This was missed in the previous commit. --- sys/dev/ath/ath_hal/ar5416/ar5416.h | 4 ++++ sys/dev/ath/ath_hal/ar5416/ar5416_attach.c | 1 + sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c | 10 +++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416.h b/sys/dev/ath/ath_hal/ar5416/ar5416.h index 4920922daa47..90397aa75feb 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416.h +++ b/sys/dev/ath/ath_hal/ar5416/ar5416.h @@ -107,6 +107,9 @@ struct ath_hal_5416 { void (*ah_initPLL) (struct ath_hal *ah, const struct ieee80211_channel *chan); + /* bluetooth coexistence operations */ + void (*ah_btCoexSetDiversity)(struct ath_hal *ah); + u_int ah_globaltxtimeout; /* global tx timeout */ u_int ah_gpioMask; int ah_hangs; /* h/w hangs state */ @@ -200,6 +203,7 @@ extern void ar5416SetBTCoexInfo(struct ath_hal *ah, HAL_BT_COEX_INFO *btinfo); extern void ar5416BTCoexConfig(struct ath_hal *ah, HAL_BT_COEX_CONFIG *btconf); +extern void ar5416BTCoexAntennaDiversity(struct ath_hal *ah); extern void ar5416BTCoexSetQcuThresh(struct ath_hal *ah, int qnum); extern void ar5416BTCoexSetWeights(struct ath_hal *ah, uint32_t stompType); extern void ar5416BTCoexSetupBmissThresh(struct ath_hal *ah, diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c index a7cb06d1c7eb..5a48481ecefd 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c @@ -200,6 +200,7 @@ ar5416InitState(struct ath_hal_5416 *ahp5416, uint16_t devid, HAL_SOFTC sc, ah->ah_btcoexSetParameter = ar5416BTCoexSetParameter; ah->ah_btCoexDisable = ar5416BTCoexDisable; ah->ah_btCoexEnable = ar5416BTCoexEnable; + AH5416(ah)->ah_btCoexSetDiversity = ar5416BTCoexAntennaDiversity; ahp->ah_priv.ah_getWirelessModes= ar5416GetWirelessModes; ahp->ah_priv.ah_eepromRead = ar5416EepromRead; diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c b/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c index b7ac1184cb01..14cdf699c06e 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c +++ b/sys/dev/ath/ath_hal/ar5416/ar5416_btcoex.c @@ -173,7 +173,7 @@ ar5416BTCoexSetupBmissThresh(struct ath_hal *ah, u_int32_t thresh) * * Kite will override this particular method. */ -static void +void ar5416BTCoexAntennaDiversity(struct ath_hal *ah) { } @@ -350,8 +350,12 @@ ar5416InitBTCoex(struct ath_hal *ah) ar5416GpioCfgInput(ah, ahp->ah_btActiveGpioSelect); ar5416GpioCfgInput(ah, ahp->ah_btPriorityGpioSelect); - if (AR_SREV_KITE(ah)) - ar5416BTCoexAntennaDiversity(ah); + /* + * Configure the antenna diversity setup. + * It's a no-op for AR9287; AR9285 overrides this + * as required. + */ + AH5416(ah)->ah_btCoexSetDiversity(ah); if (ahp->ah_btCoexEnabled) ar5416BTCoexEnable(ah); From 471af3a8dfed09c6a57c3972b2c725bea3f9ddc4 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 4 Dec 2012 00:32:12 +0000 Subject: [PATCH 009/513] Document the interpretation of the negative value of ticks for taskqueue_enqueue_timeout(9). MFC after: 3 days --- share/man/man9/taskqueue.9 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9 index f1a43b609cfb..cce1fba29477 100644 --- a/share/man/man9/taskqueue.9 +++ b/share/man/man9/taskqueue.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 26, 2011 +.Dd December 4, 2012 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -180,6 +180,13 @@ is used to schedule the enqueue after the specified amount of Only non-fast task queues can be used for .Va timeout_task scheduling. +If the +.Va ticks +argument is negative, the already scheduled enqueueing is not re-scheduled. +Otherwise, the task is schedules for enqueueing in the future, +after the absolute value of +.Va ticks +is passed. .Pp The .Fn taskqueue_cancel From 08e90c149154ca3388f8bb5398c19efc89f72df3 Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 4 Dec 2012 00:37:17 +0000 Subject: [PATCH 010/513] Tidy up bsd.cpu.mk for X86 CPUs: - Do not limit recent processors to "prescott" class for i386 target. There is no reason for this hack because clang is default now. On top of that, it will only grow indefinitely over time. - Add more CPUTYPEs, i.e., "athlon-fx", "core-avx2", "atom", "penryn", and "yonah". Note "penryn" and "yonah" are intentionally undocumented because they are not supported by gcc and marked deprecated by clang. - Add more CPUTYPE aliases, i.e., "barcelona" (-> amdfam10), "westmere" and "nehalem" (-> corei7). Note these are intentionally undocumented because they are not supported by (base) gcc and/or clang. However, LLVM (backend) seems to "know" the differences. Most likely, they were deprecated with other vendor code names and clang did not bother implementing them at all. - Add i686 to MACHINE_CPU for "c3-2" (VIA Nehemiah). Both gcc & clang treat it like an i686-class processor. - Add IDT "winchip2" and "winchip-c6" for completeness (undocumented). - Order processors per make.conf example, i.e., CPU vendors and models. - Tidy up make.conf example, i.e., remove "by gcc" (because we have aliases) and remove "prescott" from AMD64 architecture (because it is not correct). --- share/examples/etc/make.conf | 11 +++--- share/mk/bsd.cpu.mk | 74 +++++++++++++++++++++--------------- 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf index 6ba5a4ee5c7d..df5e225bd244 100644 --- a/share/examples/etc/make.conf +++ b/share/examples/etc/make.conf @@ -28,24 +28,25 @@ # of CFLAGS to contain the appropriate optimization directive to cc. # The automatic setting of CFLAGS may be overridden using the # NO_CPU_CFLAGS variable below. -# Currently the following CPU types are recognized by gcc: +# Currently the following CPU types are recognized: # Intel x86 architecture: # (AMD CPUs) opteron-sse3, athlon64-sse3, k8-sse3, opteron, -# athlon64, k8, athlon-mp, athlon-xp, athlon-4, -# athlon-tbird, athlon, k7, geode, k6-3, k6-2, k6, k5 +# athlon64, athlon-fx, k8, athlon-mp, athlon-xp, +# athlon-4, athlon-tbird, athlon, k7, geode, k6-3, +# k6-2, k6 # (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott, # pentium3m, pentium3, pentium-m, pentium2, # pentiumpro, pentium-mmx, pentium, i486 # (VIA CPUs) c7, c3-2, c3 # AMD64 architecture: opteron-sse3, athlon64-sse3, k8-sse3, opteron, -# athlon64, k8, core2, nocona, prescott +# athlon64, k8, core2, nocona # Intel ia64 architecture: itanium2, itanium # SPARC-V9 architecture: v9 (generic 64-bit V9), ultrasparc (default # if omitted), ultrasparc3 # Additionally the following CPU types are recognized by clang: # Intel x86 architecture (for both amd64 and i386): # (AMD CPUs) bdver2, bdver1, btver1, amdfam10 -# (Intel CPUs) core-avx-i, corei7-avx, corei7 +# (Intel CPUs) core-avx2, core-avx-i, corei7-avx, corei7, atom # # (?= allows to buildworld for a different CPUTYPE.) # diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index af395613b82f..2b5d4521ad21 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -27,9 +27,13 @@ MACHINE_CPU = mips # between e.g. i586 and pentium) . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "nocona" || ${CPUTYPE} == "core" || \ - ${CPUTYPE} == "core2" || ${CPUTYPE} == "corei7" || \ - ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. if ${CPUTYPE} == "barcelona" +CPUTYPE = amdfam10 +. elif ${CPUTYPE} == "k7" +CPUTYPE = athlon +. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" +CPUTYPE = corei7 +. elif ${CPUTYPE} == "core" CPUTYPE = prescott . elif ${CPUTYPE} == "p4" CPUTYPE = pentium4 @@ -49,18 +53,13 @@ CPUTYPE = pentiumpro CPUTYPE = pentium-mmx . elif ${CPUTYPE} == "i586" CPUTYPE = pentium -. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \ - ${CPUTYPE} == "k8-sse3" || ${CPUTYPE} == "amdfam10" || \ - ${CPUTYPE} == "btver1" || ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" -CPUTYPE = prescott -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" -CPUTYPE = athlon-mp -. elif ${CPUTYPE} == "k7" -CPUTYPE = athlon . endif . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "prescott" +. if ${CPUTYPE} == "barcelona" +CPUTYPE = amdfam10 +. elif ${CPUTYPE} == "westmere" || ${CPUTYPE} == "nehalem" +CPUTYPE = corei7 +. elif ${CPUTYPE} == "prescott" CPUTYPE = nocona . endif . elif ${MACHINE_ARCH} == "sparc64" @@ -87,11 +86,11 @@ CPUTYPE = ultrasparc3 _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 . elif ${CPUTYPE} == "k5" _CPUCFLAGS = -march=pentium -. elif ${CPUTYPE} == "core2" -_CPUCFLAGS = -march=prescott +. elif ${CPUTYPE} == "c7" +_CPUCFLAGS = -march=c3-2 . else _CPUCFLAGS = -march=${CPUTYPE} -. endif # GCC on 'i386' +. endif . elif ${MACHINE_CPUARCH} == "amd64" _CPUCFLAGS = -march=${CPUTYPE} . elif ${MACHINE_CPUARCH} == "arm" @@ -143,7 +142,7 @@ _CPUCFLAGS = -mcpu=ultrasparc3 # presence of a CPU feature. . if ${MACHINE_CPUARCH} == "i386" -. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "btver1" MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 @@ -151,7 +150,8 @@ MACHINE_CPU = ssse3 sse4a sse3 sse2 sse mmx k6 k5 i586 MACHINE_CPU = athlon-xp athlon k7 3dnow sse4a sse3 sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 -. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" +. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ + ${CPUTYPE} == "athlon-fx" MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ ${CPUTYPE} == "athlon-4" @@ -164,19 +164,17 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "c3" -MACHINE_CPU = 3dnow mmx i586 -. elif ${CPUTYPE} == "c3-2" -MACHINE_CPU = sse mmx i586 -. elif ${CPUTYPE} == "c7" -MACHINE_CPU = sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. elif ${CPUTYPE} == "corei-avx2" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "penryn" +MACHINE_CPU = sse41 ssse3 sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "atom" || ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 -. elif ${CPUTYPE} == "prescott" +. elif ${CPUTYPE} == "yonah" || ${CPUTYPE} == "prescott" MACHINE_CPU = sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || \ ${CPUTYPE} == "pentium-m" @@ -191,10 +189,20 @@ MACHINE_CPU = i686 i586 MACHINE_CPU = mmx i586 . elif ${CPUTYPE} == "pentium" MACHINE_CPU = i586 +. elif ${CPUTYPE} == "c7" +MACHINE_CPU = sse3 sse2 sse i686 mmx i586 +. elif ${CPUTYPE} == "c3-2" +MACHINE_CPU = sse i686 mmx i586 +. elif ${CPUTYPE} == "c3" +MACHINE_CPU = 3dnow mmx i586 +. elif ${CPUTYPE} == "winchip2" +MACHINE_CPU = 3dnow mmx +. elif ${CPUTYPE} == "winchip-c6" +MACHINE_CPU = mmx . endif MACHINE_CPU += i486 . elif ${MACHINE_CPUARCH} == "amd64" -. if ${CPUTYPE} == "bdver1" || ${CPUTYPE} == "bdver2" +. if ${CPUTYPE} == "bdver2" || ${CPUTYPE} == "bdver1" MACHINE_CPU = xop avx sse42 sse41 ssse3 sse4a sse3 . elif ${CPUTYPE} == "btver1" MACHINE_CPU = ssse3 sse4a sse3 @@ -204,13 +212,17 @@ MACHINE_CPU = k8 3dnow sse4a sse3 ${CPUTYPE} == "k8-sse3" MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ - ${CPUTYPE} == "k8" + ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "corei7-avx" || ${CPUTYPE} == "core-avx-i" +. elif ${CPUTYPE} == "corei-avx2" +MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 +. elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "corei7" MACHINE_CPU = sse42 sse41 ssse3 sse3 -. elif ${CPUTYPE} == "core2" +. elif ${CPUTYPE} == "penryn" +MACHINE_CPU = sse41 ssse3 sse3 +. elif ${CPUTYPE} == "atom" || ${CPUTYPE} == "core2" MACHINE_CPU = ssse3 sse3 . elif ${CPUTYPE} == "nocona" MACHINE_CPU = sse3 From cea10e1d3b2d2177745e4a9e079f397128ea5e1b Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 4 Dec 2012 00:44:31 +0000 Subject: [PATCH 011/513] Fix typos in the previous commit. --- share/mk/bsd.cpu.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 2b5d4521ad21..21e70ad8a8bf 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -164,7 +164,7 @@ MACHINE_CPU = 3dnow mmx k6 k5 i586 MACHINE_CPU = mmx k6 k5 i586 . elif ${CPUTYPE} == "k5" MACHINE_CPU = k5 i586 -. elif ${CPUTYPE} == "corei-avx2" +. elif ${CPUTYPE} == "core-avx2" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 sse2 sse i686 mmx i586 @@ -214,7 +214,7 @@ MACHINE_CPU = k8 3dnow sse3 . elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \ ${CPUTYPE} == "athlon-fx" || ${CPUTYPE} == "k8" MACHINE_CPU = k8 3dnow -. elif ${CPUTYPE} == "corei-avx2" +. elif ${CPUTYPE} == "core-avx2" MACHINE_CPU = avx2 avx sse42 sse41 ssse3 sse3 . elif ${CPUTYPE} == "core-avx-i" || ${CPUTYPE} == "corei7-avx" MACHINE_CPU = avx sse42 sse41 ssse3 sse3 From 0a44395e2d2a86a60fc582249f4ac1d4dd218f26 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Tue, 4 Dec 2012 00:53:20 +0000 Subject: [PATCH 012/513] - Move EXAMPLES descriptions to before the actual command - Add mdoc macros for EXAMPLES Reviewed by: eadler Approved by: gjb MFC after: 3 days --- usr.bin/rctl/rctl.8 | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/usr.bin/rctl/rctl.8 b/usr.bin/rctl/rctl.8 index e570f57fc3ba..8ae685d1bd14 100644 --- a/usr.bin/rctl/rctl.8 +++ b/usr.bin/rctl/rctl.8 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 26, 2012 +.Dd December 3, 2012 .Dt RCTL 8 .Os .Sh NAME @@ -169,21 +169,18 @@ Note that limiting RSS may kill the machine due to thrashing. .Sh EXIT STATUS .Ex -std .Sh EXAMPLES -.Dl rctl -a user:joe:vmemoryuse:deny=1g +Prevent user "joe" from allocating more than 1GB of virtual memory: +.Dl Nm Fl a Ar user:joe:vmemoryuse:deny=1g .Pp -Prevent user "joe" from allocating more than 1GB of virtual memory. +Remove all RCTL rules: +.Dl Nm Fl r Ar \&: .Pp -.Dl rctl -r : +Display resource usage information for jail named "www": +.Dl Nm Fl hu Ar jail:www .Pp -Remove all RCTL rules. +Display all the rules applicable to process with PID 512: +.Dl Nm Fl l Ar process:512 .Pp -.Dl rctl -hu jail:www -.Pp -Display resource usage information for jail named "www". -.Pp -.Dl rctl -l process:512 -.Pp -Display all the rules applicable to process with PID 512. .Sh SEE ALSO .Xr rctl.conf 5 .Sh HISTORY From 922314f018a7b2d7352f4572c275db94e90d6e89 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Tue, 4 Dec 2012 05:28:20 +0000 Subject: [PATCH 013/513] replace bit shifting loop with 1<cc_callout = (struct callout *)v; From 43b54fd4fb9e3b2cace860b91e94d606fa319172 Mon Sep 17 00:00:00 2001 From: Joel Dahl Date: Tue, 4 Dec 2012 07:22:15 +0000 Subject: [PATCH 014/513] Remove snapshots.jp.freebsd.org. It stopped working years ago. Discussed with: hrs --- usr.sbin/bsdinstall/scripts/mirrorselect | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect index d17a16a68ea2..5df45dcd815b 100755 --- a/usr.sbin/bsdinstall/scripts/mirrorselect +++ b/usr.sbin/bsdinstall/scripts/mirrorselect @@ -39,7 +39,6 @@ MIRROR=`dialog --backtitle "FreeBSD Installer" \ --menu "Please select the site closest to you or \"other\" if you'd like to specify a different choice. Also note that not every site listed here carries more than the base distribution kits. Only Primary sites are guaranteed to carry the full range of possible distributions. Select a site that's close!" \ 0 0 0 \ ftp://ftp.freebsd.org "Main Site"\ - ftp://snapshots.jp.freebsd.org "Snapshots Server Japan"\ ftp://ftp.freebsd.org "IPv6 Main Site"\ ftp://ftp3.ie.freebsd.org "IPv6 Ireland"\ ftp://ftp.il.freebsd.org "IPv6 Israel"\ From 8ca5c3fae7d077e4e6460a251160585709f6e37e Mon Sep 17 00:00:00 2001 From: Joel Dahl Date: Tue, 4 Dec 2012 09:02:49 +0000 Subject: [PATCH 015/513] Remove superfluous paragraph macro. --- usr.bin/rctl/rctl.8 | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/rctl/rctl.8 b/usr.bin/rctl/rctl.8 index 8ae685d1bd14..556c73a5802e 100644 --- a/usr.bin/rctl/rctl.8 +++ b/usr.bin/rctl/rctl.8 @@ -180,7 +180,6 @@ Display resource usage information for jail named "www": .Pp Display all the rules applicable to process with PID 512: .Dl Nm Fl l Ar process:512 -.Pp .Sh SEE ALSO .Xr rctl.conf 5 .Sh HISTORY From c6499eccad497913a5025fbde8ae76da70e08043 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 4 Dec 2012 09:32:43 +0000 Subject: [PATCH 016/513] Mechanically substitute flags from historic mbuf allocator with malloc(9) flags in sys/dev. --- sys/dev/age/if_age.c | 6 +++--- sys/dev/alc/if_alc.c | 8 ++++---- sys/dev/ale/if_ale.c | 6 +++--- sys/dev/an/if_an.c | 8 ++++---- sys/dev/ath/if_ath_rx.c | 2 +- sys/dev/ath/if_ath_rx_edma.c | 2 +- sys/dev/ath/if_ath_tx.c | 2 +- sys/dev/bce/if_bce.c | 10 +++++----- sys/dev/bfe/if_bfe.c | 4 ++-- sys/dev/bge/if_bge.c | 20 ++++++++++---------- sys/dev/bm/if_bm.c | 6 +++--- sys/dev/bwi/if_bwi.c | 10 +++++----- sys/dev/bwn/if_bwn.c | 8 ++++---- sys/dev/bxe/if_bxe.c | 10 +++++----- sys/dev/cas/if_cas.c | 10 +++++----- sys/dev/ce/if_ce.c | 4 ++-- sys/dev/cm/smc90cx6.c | 4 ++-- sys/dev/cp/if_cp.c | 4 ++-- sys/dev/cs/if_cs.c | 4 ++-- sys/dev/ctau/if_ct.c | 4 ++-- sys/dev/cx/if_cx.c | 8 ++++---- sys/dev/cxgb/cxgb_main.c | 2 +- sys/dev/cxgb/cxgb_sge.c | 8 ++++---- sys/dev/cxgb/sys/uipc_mvec.c | 2 +- sys/dev/cxgbe/t4_sge.c | 2 +- sys/dev/cxgbe/tom/t4_ddp.c | 2 +- sys/dev/cxgbe/tom/t4_listen.c | 2 +- sys/dev/dc/if_dc.c | 8 ++++---- sys/dev/de/if_de.c | 8 ++++---- sys/dev/e1000/if_em.c | 10 +++++----- sys/dev/e1000/if_igb.c | 12 ++++++------ sys/dev/e1000/if_lem.c | 6 +++--- sys/dev/ed/if_ed.c | 4 ++-- sys/dev/en/midway.c | 12 ++++++------ sys/dev/ep/if_ep.c | 8 ++++---- sys/dev/et/if_et.c | 6 +++--- sys/dev/ex/if_ex.c | 6 +++--- sys/dev/fatm/if_fatm.c | 10 +++++----- sys/dev/fe/if_fe.c | 4 ++-- sys/dev/firewire/fwohci.c | 2 +- sys/dev/firewire/if_fwe.c | 6 +++--- sys/dev/firewire/if_fwip.c | 10 +++++----- sys/dev/fxp/if_fxp.c | 6 +++--- sys/dev/gem/if_gem.c | 6 +++--- sys/dev/gxemul/ether/if_gx.c | 2 +- sys/dev/hatm/if_hatm_intr.c | 4 ++-- sys/dev/hatm/if_hatm_tx.c | 2 +- sys/dev/hifn/hifn7751.c | 12 ++++++------ sys/dev/hme/if_hme.c | 6 +++--- sys/dev/ie/if_ie.c | 6 +++--- sys/dev/if_ndis/if_ndis.c | 6 +++--- sys/dev/ipw/if_ipw.c | 6 +++--- sys/dev/iwi/if_iwi.c | 6 +++--- sys/dev/iwn/if_iwn.c | 10 +++++----- sys/dev/ixgb/if_ixgb.c | 2 +- sys/dev/ixgbe/ixgbe.c | 2 +- sys/dev/ixgbe/ixv.c | 6 +++--- sys/dev/jme/if_jme.c | 6 +++--- sys/dev/le/lance.c | 6 +++--- sys/dev/lge/if_lge.c | 2 +- sys/dev/lmc/if_lmc.c | 6 +++--- sys/dev/malo/if_malo.c | 4 ++-- sys/dev/mge/if_mge.c | 4 ++-- sys/dev/mn/if_mn.c | 14 +++++++------- sys/dev/msk/if_msk.c | 8 ++++---- sys/dev/mwl/if_mwl.c | 6 +++--- sys/dev/mxge/if_mxge.c | 6 +++--- sys/dev/my/if_my.c | 8 ++++---- sys/dev/nfe/if_nfe.c | 6 +++--- sys/dev/nge/if_nge.c | 4 ++-- sys/dev/nve/if_nve.c | 6 +++--- sys/dev/nxge/if_nxge.c | 6 +++--- sys/dev/oce/oce_if.c | 6 +++--- sys/dev/patm/if_patm_intr.c | 2 +- sys/dev/patm/if_patm_rx.c | 6 +++--- sys/dev/patm/if_patm_tx.c | 4 ++-- sys/dev/pcn/if_pcn.c | 4 ++-- sys/dev/pdq/pdq_freebsd.h | 4 ++-- sys/dev/pdq/pdq_ifsubr.c | 4 ++-- sys/dev/pdq/pdqvar.h | 4 ++-- sys/dev/qlxgb/qla_os.c | 6 +++--- sys/dev/ral/rt2560.c | 6 +++--- sys/dev/ral/rt2661.c | 6 +++--- sys/dev/ral/rt2860.c | 8 ++++---- sys/dev/re/if_re.c | 12 ++++++------ sys/dev/rt/if_rt.c | 6 +++--- sys/dev/safe/safe.c | 12 ++++++------ sys/dev/sbni/if_sbni.c | 4 ++-- sys/dev/sf/if_sf.c | 4 ++-- sys/dev/sfxge/sfxge_dma.c | 2 +- sys/dev/sfxge/sfxge_tx.c | 2 +- sys/dev/sge/if_sge.c | 6 +++--- sys/dev/sis/if_sis.c | 8 ++++---- sys/dev/sk/if_sk.c | 6 +++--- sys/dev/smc/if_smc.c | 4 ++-- sys/dev/sn/if_sn.c | 4 ++-- sys/dev/snc/dp83932.c | 6 +++--- sys/dev/ste/if_ste.c | 4 ++-- sys/dev/stge/if_stge.c | 6 +++--- sys/dev/ti/if_ti.c | 16 ++++++++-------- sys/dev/tl/if_tl.c | 6 +++--- sys/dev/tsec/if_tsec.c | 6 +++--- sys/dev/tx/if_tx.c | 8 ++++---- sys/dev/txp/if_txp.c | 6 +++--- sys/dev/ubsec/ubsec.c | 12 ++++++------ sys/dev/usb/misc/udbp.c | 4 ++-- sys/dev/usb/net/if_axe.c | 2 +- sys/dev/usb/net/if_cdce.c | 6 +++--- sys/dev/usb/net/if_usie.c | 6 +++--- sys/dev/usb/net/uhso.c | 6 +++--- sys/dev/usb/net/usb_ethernet.c | 2 +- sys/dev/usb/wlan/if_rum.c | 2 +- sys/dev/usb/wlan/if_run.c | 4 ++-- sys/dev/usb/wlan/if_uath.c | 4 ++-- sys/dev/usb/wlan/if_upgt.c | 2 +- sys/dev/usb/wlan/if_ural.c | 2 +- sys/dev/usb/wlan/if_urtw.c | 4 ++-- sys/dev/usb/wlan/if_zyd.c | 4 ++-- sys/dev/vge/if_vge.c | 8 ++++---- sys/dev/virtio/network/if_vtnet.c | 6 +++--- sys/dev/vr/if_vr.c | 10 +++++----- sys/dev/vte/if_vte.c | 10 +++++----- sys/dev/vx/if_vx.c | 8 ++++---- sys/dev/vxge/vxge.c | 4 ++-- sys/dev/wb/if_wb.c | 6 +++--- sys/dev/wi/if_wi.c | 4 ++-- sys/dev/wl/if_wl.c | 2 +- sys/dev/wpi/if_wpi.c | 8 ++++---- sys/dev/wtap/if_wtap.c | 4 ++-- sys/dev/wtap/plugins/visibility.c | 2 +- sys/dev/xe/if_xe.c | 4 ++-- sys/dev/xen/netfront/netfront.c | 6 +++--- sys/dev/xl/if_xl.c | 4 ++-- 133 files changed, 389 insertions(+), 389 deletions(-) diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index 7bc56a75da0c..829f350b08f5 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -1521,7 +1521,7 @@ age_encap(struct age_softc *sc, struct mbuf **m_head) if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -1599,7 +1599,7 @@ age_encap(struct age_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->age_cdata.age_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, AGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, AGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -3061,7 +3061,7 @@ age_newbuf(struct age_softc *sc, struct age_rxdesc *rxd) AGE_LOCK_ASSERT(sc); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index 9fa29b8db137..2ee9513009c6 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -2047,7 +2047,7 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -2125,7 +2125,7 @@ alc_encap(struct alc_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->alc_cdata.alc_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, ALC_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, ALC_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2803,7 +2803,7 @@ alc_newbuf(struct alc_softc *sc, struct alc_rxdesc *rxd) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = RX_BUF_SIZE_MAX; @@ -2923,7 +2923,7 @@ alc_fixup_rx(struct ifnet *ifp, struct mbuf *m) * header from the mbuf chain. This can save lots of CPU * cycles for jumbo frame. */ - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { ifp->if_iqdrops++; m_freem(m); diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index f1f35ed9d529..9537388d3e56 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -1640,7 +1640,7 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head) if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbufs. */ m_freem(*m_head); if (m == NULL) { @@ -1657,7 +1657,7 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head) if ((sc->ale_flags & ALE_FLAG_TXCSUM_BUG) != 0 && (m->m_pkthdr.csum_flags & ALE_CSUM_FEATURES) != 0 && (mtod(m, intptr_t) & 3) != 0) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { *m_head = NULL; return (ENOBUFS); @@ -1742,7 +1742,7 @@ ale_encap(struct ale_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->ale_cdata.ale_tx_tag, map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, ALE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, ALE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c index 5d90850086e1..b2a13df8447a 100644 --- a/sys/dev/an/if_an.c +++ b/sys/dev/an/if_an.c @@ -946,12 +946,12 @@ an_rxeof(struct an_softc *sc) /* dump raw 802.11 packet to bpf and skip ip stack */ BPF_TAP(ifp, bpf_buf, len); } else { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ifp->if_ierrors++; return; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); ifp->if_ierrors++; @@ -1037,12 +1037,12 @@ an_rxeof(struct an_softc *sc) if (an_rx_desc.an_done && !an_rx_desc.an_valid) { buf = sc->an_rx_buffer[count].an_dma_vaddr; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ifp->if_ierrors++; return; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); ifp->if_ierrors++; diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c index 3ebfb2ffe0bc..543ba4381808 100644 --- a/sys/dev/ath/if_ath_rx.c +++ b/sys/dev/ath/if_ath_rx.c @@ -232,7 +232,7 @@ ath_legacy_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) * multiple of the cache line size. Not doing this * causes weird stuff to happen (for the 5210 at least). */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF(sc, ATH_DEBUG_ANY, "%s: no mbuf/cluster\n", __func__); diff --git a/sys/dev/ath/if_ath_rx_edma.c b/sys/dev/ath/if_ath_rx_edma.c index dc7fd9ac4fcc..301a22cc060f 100644 --- a/sys/dev/ath/if_ath_rx_edma.c +++ b/sys/dev/ath/if_ath_rx_edma.c @@ -518,7 +518,7 @@ ath_edma_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) ATH_RX_LOCK_ASSERT(sc); - m = m_getm(NULL, sc->sc_edma_bufsize, M_DONTWAIT, MT_DATA); + m = m_getm(NULL, sc->sc_edma_bufsize, M_NOWAIT, MT_DATA); if (! m) return (ENOBUFS); /* XXX ?*/ diff --git a/sys/dev/ath/if_ath_tx.c b/sys/dev/ath/if_ath_tx.c index 7f97af40ca78..199d890029d2 100644 --- a/sys/dev/ath/if_ath_tx.c +++ b/sys/dev/ath/if_ath_tx.c @@ -325,7 +325,7 @@ ath_tx_dmasetup(struct ath_softc *sc, struct ath_buf *bf, struct mbuf *m0) */ if (bf->bf_nseg > ATH_TXDESC) { /* too many desc's, linearize */ sc->sc_stats.ast_tx_linear++; - m = m_collapse(m0, M_DONTWAIT, ATH_TXDESC); + m = m_collapse(m0, M_NOWAIT, ATH_TXDESC); if (m == NULL) { ath_freetx(m0); sc->sc_stats.ast_tx_nombuf++; diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 1fb583f713cb..2471f1926ccd 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -5437,9 +5437,9 @@ bce_get_rx_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, /* This is a new mbuf allocation. */ if (bce_hdr_split == TRUE) - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); else - m_new = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + m_new = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->rx_bd_mbuf_alloc_size); if (m_new == NULL) { @@ -5559,7 +5559,7 @@ bce_get_pg_buf(struct bce_softc *sc, struct mbuf *m, u16 *prod, goto bce_get_pg_buf_exit); /* This is a new mbuf allocation. */ - m_new = m_getcl(M_DONTWAIT, MT_DATA, 0); + m_new = m_getcl(M_NOWAIT, MT_DATA, 0); if (m_new == NULL) { sc->mbuf_alloc_failed_count++; rc = ENOBUFS; @@ -7320,7 +7320,7 @@ bce_tso_setup(struct bce_softc *sc, struct mbuf **m_head, u16 *flags) /* Controller may modify mbuf chains. */ if (M_WRITABLE(*m_head) == 0) { - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { sc->mbuf_alloc_failed_count++; @@ -7486,7 +7486,7 @@ bce_tx_encap(struct bce_softc *sc, struct mbuf **m_head) sc->mbuf_frag_count++; /* Try to defrag the mbuf. */ - m0 = m_collapse(*m_head, M_DONTWAIT, BCE_MAX_SEGMENTS); + m0 = m_collapse(*m_head, M_NOWAIT, BCE_MAX_SEGMENTS); if (m0 == NULL) { /* Defrag was unsuccessful */ m_freem(*m_head); diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index 06c8fdab14ad..be7e2a4053bf 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -791,7 +791,7 @@ bfe_list_newbuf(struct bfe_softc *sc, int c) u_int32_t ctrl; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); m->m_len = m->m_pkthdr.len = MCLBYTES; if (bus_dmamap_load_mbuf_sg(sc->bfe_rxmbuf_tag, sc->bfe_rx_sparemap, @@ -1519,7 +1519,7 @@ bfe_encap(struct bfe_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->bfe_txmbuf_tag, r->bfe_map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, BFE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, BFE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 9855bbd2ae86..e7cb2f7a5e26 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1312,12 +1312,12 @@ bge_newbuf_std(struct bge_softc *sc, int i) if (sc->bge_flags & BGE_FLAG_JUMBO_STD && (sc->bge_ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN))) { - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MJUM9BYTES; } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1368,11 +1368,11 @@ bge_newbuf_jumbo(struct bge_softc *sc, int i) struct mbuf *m; int error, nsegs; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); - m_cljget(m, M_DONTWAIT, MJUM9BYTES); + m_cljget(m, M_NOWAIT, MJUM9BYTES); if (!(m->m_flags & M_EXT)) { m_freem(m); return (ENOBUFS); @@ -4946,7 +4946,7 @@ bge_cksum_pad(struct mbuf *m) /* Allocate new empty mbuf, pad it. Compact later. */ struct mbuf *n; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) return (ENOBUFS); n->m_len = 0; @@ -4988,7 +4988,7 @@ bge_check_short_dma(struct mbuf *m) } if (found > 1) { - n = m_defrag(m, M_DONTWAIT); + n = m_defrag(m, M_NOWAIT); if (n == NULL) m_freem(m); } else @@ -5008,7 +5008,7 @@ bge_setup_tso(struct bge_softc *sc, struct mbuf *m, uint16_t *mss, if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - n = m_dup(m, M_DONTWAIT); + n = m_dup(m, M_NOWAIT); m_freem(m); if (n == NULL) return (NULL); @@ -5125,9 +5125,9 @@ bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx) * DMA read operation. */ if (sc->bge_forced_collapse == 1) - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); else - m = m_collapse(m, M_DONTWAIT, + m = m_collapse(m, M_NOWAIT, sc->bge_forced_collapse); if (m == NULL) m = *m_head; @@ -5139,7 +5139,7 @@ bge_encap(struct bge_softc *sc, struct mbuf **m_head, uint32_t *txidx) error = bus_dmamap_load_mbuf_sg(sc->bge_cdata.bge_tx_mtag, map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(m, M_DONTWAIT, BGE_NSEG_NEW); + m = m_collapse(m, M_NOWAIT, BGE_NSEG_NEW); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/bm/if_bm.c b/sys/dev/bm/if_bm.c index 01706dfeb5e1..cce5ee387e59 100644 --- a/sys/dev/bm/if_bm.c +++ b/sys/dev/bm/if_bm.c @@ -539,7 +539,7 @@ bm_dummypacket(struct bm_softc *sc) ifp = sc->sc_ifp; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; @@ -793,7 +793,7 @@ bm_encap(struct bm_softc *sc, struct mbuf **m_head) *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, nsegs); + m = m_collapse(*m_head, M_NOWAIT, nsegs); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1238,7 +1238,7 @@ bm_add_rxbuf(struct bm_softc *sc, int idx) bus_dma_segment_t segs[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index cb4805b258af..25b5f2bc16d4 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -2534,7 +2534,7 @@ bwi_newbuf(struct bwi_softc *sc, int buf_idx, int init) KASSERT(buf_idx < BWI_RX_NDESC, ("buf_idx %d", buf_idx)); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; @@ -3015,7 +3015,7 @@ bwi_encap(struct bwi_softc *sc, int idx, struct mbuf *m, /* * Setup the embedded TX header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m == NULL) { if_printf(ifp, "%s: prepend TX header failed\n", __func__); return ENOBUFS; @@ -3074,7 +3074,7 @@ bwi_encap(struct bwi_softc *sc, int idx, struct mbuf *m, if (error) { /* error == EFBIG */ struct mbuf *m_new; - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); @@ -3195,7 +3195,7 @@ bwi_encap_raw(struct bwi_softc *sc, int idx, struct mbuf *m, /* * Setup the embedded TX header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m == NULL) { if_printf(ifp, "%s: prepend TX header failed\n", __func__); return ENOBUFS; @@ -3249,7 +3249,7 @@ bwi_encap_raw(struct bwi_softc *sc, int idx, struct mbuf *m, __func__, error); goto back; } - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index b2cd52731cb7..94797b319851 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -1428,7 +1428,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, struct ieee80211_node *ni, struct mbuf *m) /* * XXX please removes m_defrag(9) */ - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { device_printf(sc->sc_dev, "%s: can't defrag TX buffer\n", @@ -1544,7 +1544,7 @@ bwn_dma_tx_start(struct bwn_mac *mac, struct ieee80211_node *ni, struct mbuf *m) if (error) { /* error == EFBIG */ struct mbuf *m_new; - m_new = m_defrag(m, M_DONTWAIT); + m_new = m_defrag(m, M_NOWAIT); if (m_new == NULL) { if_printf(ifp, "%s: can't defrag TX buffer\n", __func__); @@ -9124,7 +9124,7 @@ bwn_pio_rxeof(struct bwn_pio_rxqueue *prq) padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0; totlen = len + padding; KASSERT(totlen <= MCLBYTES, ("too big..\n")); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "%s: out of memory", __func__); goto error; @@ -9183,7 +9183,7 @@ bwn_dma_newbuf(struct bwn_dma_ring *dr, struct bwn_dmadesc_generic *desc, struct mbuf *m; int error; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { error = ENOBUFS; diff --git a/sys/dev/bxe/if_bxe.c b/sys/dev/bxe/if_bxe.c index 1193865a1cf0..52d2c1bc174e 100644 --- a/sys/dev/bxe/if_bxe.c +++ b/sys/dev/bxe/if_bxe.c @@ -3757,7 +3757,7 @@ bxe_alloc_buf_rings(struct bxe_softc *sc) if (fp != NULL) { fp->br = buf_ring_alloc(BXE_BR_SIZE, - M_DEVBUF, M_DONTWAIT, &fp->mtx); + M_DEVBUF, M_NOWAIT, &fp->mtx); if (fp->br == NULL) { rc = ENOMEM; goto bxe_alloc_buf_rings_exit; @@ -8960,7 +8960,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_head) } else if (error == EFBIG) { /* Possibly recoverable with defragmentation. */ fp->mbuf_defrag_attempts++; - m0 = m_defrag(*m_head, M_DONTWAIT); + m0 = m_defrag(*m_head, M_NOWAIT); if (m0 == NULL) { fp->mbuf_defrag_failures++; rc = ENOBUFS; @@ -10467,7 +10467,7 @@ bxe_alloc_tpa_mbuf(struct bxe_fastpath *fp, int queue) #endif /* Allocate the new TPA mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); if (__predict_false(m == NULL)) { fp->mbuf_tpa_alloc_failed++; rc = ENOBUFS; @@ -10661,7 +10661,7 @@ bxe_alloc_rx_sge_mbuf(struct bxe_fastpath *fp, uint16_t index) #endif /* Allocate a new SGE mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, SGE_PAGE_SIZE); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, SGE_PAGE_SIZE); if (__predict_false(m == NULL)) { fp->mbuf_sge_alloc_failed++; rc = ENOMEM; @@ -10851,7 +10851,7 @@ bxe_alloc_rx_bd_mbuf(struct bxe_fastpath *fp, uint16_t index) #endif /* Allocate the new RX BD mbuf. */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, sc->mbuf_alloc_size); if (__predict_false(m == NULL)) { fp->mbuf_rx_bd_alloc_failed++; rc = ENOBUFS; diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 8705ac709101..f846350eee54 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -1192,7 +1192,7 @@ cas_load_txmbuf(struct cas_softc *sc, struct mbuf **m_head) cflags = 0; if (((*m_head)->m_pkthdr.csum_flags & CAS_CSUM_FEATURES) != 0) { if (M_WRITABLE(*m_head) == 0) { - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); *m_head = m; if (m == NULL) @@ -1215,7 +1215,7 @@ cas_load_txmbuf(struct cas_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sc_tdmatag, txs->txs_dmamap, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, CAS_NTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, CAS_NTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1714,7 +1714,7 @@ cas_rint(struct cas_softc *sc) __func__, idx, off, len); #endif rxds = &sc->sc_rxdsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, @@ -1759,7 +1759,7 @@ cas_rint(struct cas_softc *sc) __func__, idx, off, len); #endif rxds = &sc->sc_rxdsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { refcount_acquire(&rxds->rxds_refcount); off += ETHER_ALIGN; @@ -1796,7 +1796,7 @@ cas_rint(struct cas_softc *sc) #endif rxds2 = &sc->sc_rxdsoft[idx2]; if (m != NULL) { - MGET(m2, M_DONTWAIT, MT_DATA); + MGET(m2, M_NOWAIT, MT_DATA); if (m2 != NULL) { refcount_acquire( &rxds2->rxds_refcount); diff --git a/sys/dev/ce/if_ce.c b/sys/dev/ce/if_ce.c index 7fb208a02d8d..700ab80a8899 100644 --- a/sys/dev/ce/if_ce.c +++ b/sys/dev/ce/if_ce.c @@ -319,10 +319,10 @@ static struct mbuf *makembuf (void *buf, unsigned len) { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; diff --git a/sys/dev/cm/smc90cx6.c b/sys/dev/cm/smc90cx6.c index eb8967576cc8..f7ceae601354 100644 --- a/sys/dev/cm/smc90cx6.c +++ b/sys/dev/cm/smc90cx6.c @@ -502,7 +502,7 @@ cm_srint_locked(vsc) buffer = sc->sc_rx_act ^ 1; /* Allocate header mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == 0) { /* @@ -539,7 +539,7 @@ cm_srint_locked(vsc) */ if ((len + 2 + 2) > MHLEN) { /* attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c index 49e329e85af3..4ff0bccd5c9d 100644 --- a/sys/dev/cp/if_cp.c +++ b/sys/dev/cp/if_cp.c @@ -203,10 +203,10 @@ static struct mbuf *makembuf (void *buf, unsigned len) { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; diff --git a/sys/dev/cs/if_cs.c b/sys/dev/cs/if_cs.c index 3789ea48e076..c89760abcfaf 100644 --- a/sys/dev/cs/if_cs.c +++ b/sys/dev/cs/if_cs.c @@ -726,12 +726,12 @@ cs_get_packet(struct cs_softc *sc) return (-1); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m==NULL) return (-1); if (length > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); return (-1); diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c index dbdca97411d0..7b4abc3f0131 100644 --- a/sys/dev/ctau/if_ct.c +++ b/sys/dev/ctau/if_ct.c @@ -205,10 +205,10 @@ static struct mbuf *makembuf (void *buf, u_int len) { struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); if (! (m->m_flags & M_EXT)) { m_freem (m); return 0; diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c index c8f53a00bec7..cb154867dff4 100644 --- a/sys/dev/cx/if_cx.c +++ b/sys/dev/cx/if_cx.c @@ -252,13 +252,13 @@ static struct mbuf *makembuf (void *buf, u_int len) { struct mbuf *m, *o, *p; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return 0; if (len >= MINCLSIZE) - MCLGET (m, M_DONTWAIT); + MCLGET (m, M_NOWAIT); m->m_pkthdr.len = len; m->m_len = 0; @@ -271,13 +271,13 @@ static struct mbuf *makembuf (void *buf, u_int len) if (! n) { /* Allocate new mbuf. */ o = p; - MGET (p, M_DONTWAIT, MT_DATA); + MGET (p, M_NOWAIT, MT_DATA); if (! p) { m_freem (m); return 0; } if (len >= MINCLSIZE) - MCLGET (p, M_DONTWAIT); + MCLGET (p, M_NOWAIT); p->m_len = 0; o->m_next = p; diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 455c7235747d..fee0653fbfd9 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1442,7 +1442,7 @@ send_pktsched_cmd(struct adapter *adap, int sched, int qidx, int lo, struct mbuf *m; struct mngt_pktsched_wr *req; - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) { req = mtod(m, struct mngt_pktsched_wr *); req->wr.wrh_hi = htonl(V_WR_OP(FW_WROPCODE_MNGT)); diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 0108339ffd56..3a5d8f6fbfdc 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2710,7 +2710,7 @@ get_packet(adapter_t *adap, unsigned int drop_thres, struct sge_qset *qs, if (recycle_enable && len <= SGE_RX_COPY_THRES && sopeop == RSPQ_SOP_EOP) { - if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) + if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) goto skip_recycle; cl = mtod(m, void *); memcpy(cl, sd->rxsd_cl, len); @@ -2866,10 +2866,10 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget) printf("async notification\n"); if (mh->mh_head == NULL) { - mh->mh_head = m_gethdr(M_DONTWAIT, MT_DATA); + mh->mh_head = m_gethdr(M_NOWAIT, MT_DATA); m = mh->mh_head; } else { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); } if (m == NULL) goto no_mem; @@ -2882,7 +2882,7 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget) rspq->async_notif++; goto skip; } else if (flags & F_RSPD_IMM_DATA_VALID) { - struct mbuf *m = m_gethdr(M_DONTWAIT, MT_DATA); + struct mbuf *m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { no_mem: diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index f52daa681b13..dea5500c2ed9 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -98,7 +98,7 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, printf("mbuf chain too long: %d max allowed %d\n", seg_count, TX_MAX_SEGS); if (!defragged) { - n = m_defrag(*m, M_DONTWAIT); + n = m_defrag(*m, M_NOWAIT); if (n == NULL) { err = ENOBUFS; goto err_out; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index fa33d1833a68..62d9eb3902ed 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -2761,7 +2761,7 @@ start: sgl->nsegs = 0; rc = bus_dmamap_load_mbuf_sg(txq->tx_tag, txm->map, m, sgl->seg, &sgl->nsegs, BUS_DMA_NOWAIT); if (rc == EFBIG && defragged == 0) { - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) return (EFBIG); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 31eb607fcf66..16eb707c70cf 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -1207,7 +1207,7 @@ t4_soreceive_ddp(struct socket *so, struct sockaddr **psa, struct uio *uio, KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index e5c457d0a777..523f7f345503 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -1164,7 +1164,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss, * or may not be stashed in the original SYN mbuf passed to us. * Just copy it over instead of dealing with all possibilities. */ - m = m_dup(synqe->syn, M_DONTWAIT); + m = m_dup(synqe->syn, M_NOWAIT); if (m) m->m_pkthdr.rcvif = ifp; diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 01f49749f3eb..2c8d1ca250de 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2650,7 +2650,7 @@ dc_newbuf(struct dc_softc *sc, int i) bus_dma_segment_t segs[1]; int error, nseg; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -3387,7 +3387,7 @@ dc_encap(struct dc_softc *sc, struct mbuf **m_head) defragged = 0; if (sc->dc_flags & DC_TX_COALESCE && ((*m_head)->m_next != NULL || sc->dc_flags & DC_TX_ALIGN)) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); defragged = 1; } else { /* @@ -3402,7 +3402,7 @@ dc_encap(struct dc_softc *sc, struct mbuf **m_head) if (i > DC_TX_LIST_CNT / 4 || DC_TX_LIST_CNT - i + sc->dc_cdata.dc_tx_cnt <= DC_TX_LIST_RSVD) { - m = m_collapse(*m_head, M_DONTWAIT, DC_MAXFRAGS); + m = m_collapse(*m_head, M_NOWAIT, DC_MAXFRAGS); defragged = 1; } } @@ -3419,7 +3419,7 @@ dc_encap(struct dc_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->dc_tx_mtag, sc->dc_cdata.dc_tx_map[idx], *m_head, segs, &nseg, 0); if (error == EFBIG) { - if (defragged != 0 || (m = m_collapse(*m_head, M_DONTWAIT, + if (defragged != 0 || (m = m_collapse(*m_head, M_NOWAIT, DC_MAXFRAGS)) == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c index 2503961bc36f..ace5542c5014 100644 --- a/sys/dev/de/if_de.c +++ b/sys/dev/de/if_de.c @@ -257,7 +257,7 @@ tulip_txprobe(tulip_softc_t * const sc) * to verify the connectivity. */ TULIP_LOCK_ASSERT(sc); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return 0; /* @@ -3517,7 +3517,7 @@ tulip_rx_intr(tulip_softc_t * const sc) ms->m_pkthdr.len = total_len; ms->m_pkthdr.rcvif = ifp; m0 = ms; - ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + ms = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); #endif TULIP_UNLOCK(sc); CTR1(KTR_TULIP, "tulip_rx_intr: passing %p to upper layer", m0); @@ -3528,7 +3528,7 @@ tulip_rx_intr(tulip_softc_t * const sc) * If we are priming the TULIP with mbufs, then allocate * a new cluster for the next descriptor. */ - ms = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + ms = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); #ifndef __NO_STRICT_ALIGNMENT skip_input: @@ -3970,7 +3970,7 @@ tulip_txput(tulip_softc_t * const sc, struct mbuf *m) * to recopy it into one mbuf and then try again. If * we can't recopy it, try again later. */ - m0 = m_defrag(m, M_DONTWAIT); + m0 = m_defrag(m, M_NOWAIT); if (m0 == NULL) { sc->tulip_flags |= TULIP_WANTTXSTART; #if defined(TULIP_DEBUG) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 112b538f5585..8ba32e00d834 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1831,7 +1831,7 @@ em_xmit(struct tx_ring *txr, struct mbuf **m_headp) if (do_tso || (m_head->m_next != NULL && m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD)) { if (M_WRITABLE(*m_headp) == 0) { - m_head = m_dup(*m_headp, M_DONTWAIT); + m_head = m_dup(*m_headp, M_NOWAIT); m_freem(*m_headp); if (m_head == NULL) { *m_headp = NULL; @@ -1948,7 +1948,7 @@ em_xmit(struct tx_ring *txr, struct mbuf **m_headp) if (error == EFBIG && remap) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_alloc_failed++; m_freem(*m_headp); @@ -3930,7 +3930,7 @@ em_refresh_mbufs(struct rx_ring *rxr, int limit) while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->m_head == NULL) { - m = m_getjcl(M_DONTWAIT, MT_DATA, + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); /* ** If we have a temporary resource shortage @@ -4100,7 +4100,7 @@ em_setup_receive_ring(struct rx_ring *rxr) continue; } #endif /* DEV_NETMAP */ - rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA, + rxbuf->m_head = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_head == NULL) { error = ENOBUFS; @@ -4579,7 +4579,7 @@ em_fixup_rx(struct rx_ring *rxr) bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, m->m_len); m->m_data += ETHER_HDR_LEN; } else { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n != NULL) { bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); m->m_data += ETHER_HDR_LEN; diff --git a/sys/dev/e1000/if_igb.c b/sys/dev/e1000/if_igb.c index cf70965232ca..8eb3011799e9 100644 --- a/sys/dev/e1000/if_igb.c +++ b/sys/dev/e1000/if_igb.c @@ -1830,7 +1830,7 @@ igb_xmit(struct tx_ring *txr, struct mbuf **m_headp) if (do_tso || (m_head->m_next != NULL && m_head->m_pkthdr.csum_flags & CSUM_OFFLOAD)) { if (M_WRITABLE(*m_headp) == 0) { - m_head = m_dup(*m_headp, M_DONTWAIT); + m_head = m_dup(*m_headp, M_NOWAIT); m_freem(*m_headp); if (m_head == NULL) { *m_headp = NULL; @@ -1935,7 +1935,7 @@ igb_xmit(struct tx_ring *txr, struct mbuf **m_headp) if (error == EFBIG && remap) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_defrag_failed++; m_freem(*m_headp); @@ -3983,7 +3983,7 @@ igb_refresh_mbufs(struct rx_ring *rxr, int limit) if (rxr->hdr_split == FALSE) goto no_split; if (rxbuf->m_head == NULL) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); + mh = m_gethdr(M_NOWAIT, MT_DATA); if (mh == NULL) goto update; } else @@ -4009,7 +4009,7 @@ igb_refresh_mbufs(struct rx_ring *rxr, int limit) htole64(hseg[0].ds_addr); no_split: if (rxbuf->m_pack == NULL) { - mp = m_getjcl(M_DONTWAIT, MT_DATA, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (mp == NULL) goto update; @@ -4225,7 +4225,7 @@ igb_setup_receive_ring(struct rx_ring *rxr) goto skip_head; /* First the header */ - rxbuf->m_head = m_gethdr(M_DONTWAIT, MT_DATA); + rxbuf->m_head = m_gethdr(M_NOWAIT, MT_DATA); if (rxbuf->m_head == NULL) { error = ENOBUFS; goto fail; @@ -4247,7 +4247,7 @@ igb_setup_receive_ring(struct rx_ring *rxr) skip_head: /* Now the payload cluster */ - rxbuf->m_pack = m_getjcl(M_DONTWAIT, MT_DATA, + rxbuf->m_pack = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_pack == NULL) { error = ENOBUFS; diff --git a/sys/dev/e1000/if_lem.c b/sys/dev/e1000/if_lem.c index aeb32952de68..58e6c7eefba0 100644 --- a/sys/dev/e1000/if_lem.c +++ b/sys/dev/e1000/if_lem.c @@ -1566,7 +1566,7 @@ lem_xmit(struct adapter *adapter, struct mbuf **m_headp) if (error == EFBIG) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_alloc_failed++; m_freem(*m_headp); @@ -3075,7 +3075,7 @@ lem_get_buf(struct adapter *adapter, int i) struct em_buffer *rx_buffer; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { adapter->mbuf_cluster_failed++; return (ENOBUFS); @@ -3633,7 +3633,7 @@ lem_fixup_rx(struct adapter *adapter) bcopy(m->m_data, m->m_data + ETHER_HDR_LEN, m->m_len); m->m_data += ETHER_HDR_LEN; } else { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n != NULL) { bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); m->m_data += ETHER_HDR_LEN; diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c index 80446a6fe120..a84fc758f0b3 100644 --- a/sys/dev/ed/if_ed.c +++ b/sys/dev/ed/if_ed.c @@ -1268,7 +1268,7 @@ ed_get_packet(struct ed_softc *sc, bus_size_t buf, u_short len) struct mbuf *m; /* Allocate a header mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; m->m_pkthdr.rcvif = ifp; @@ -1282,7 +1282,7 @@ ed_get_packet(struct ed_softc *sc, bus_size_t buf, u_short len) */ if ((len + 2) > MHLEN) { /* Attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); /* Insist on getting a cluster */ if ((m->m_flags & M_EXT) == 0) { diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c index 3b57ce3569ef..ee12b201b97a 100644 --- a/sys/dev/en/midway.c +++ b/sys/dev/en/midway.c @@ -837,15 +837,15 @@ copy_mbuf(struct mbuf *m) { struct mbuf *new; - MGET(new, M_WAIT, MT_DATA); + MGET(new, M_WAITOK, MT_DATA); if (m->m_flags & M_PKTHDR) { M_MOVE_PKTHDR(new, m); if (m->m_len > MHLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } else { if (m->m_len > MLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } bcopy(m->m_data, new->m_data, m->m_len); @@ -1925,7 +1925,7 @@ en_mget(struct en_softc *sc, u_int pktlen) * words at the begin. */ /* called from interrupt context */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); @@ -1940,7 +1940,7 @@ en_mget(struct en_softc *sc, u_int pktlen) totlen -= m->m_len; /* called from interrupt context */ - tmp = m_getm(m, totlen, M_DONTWAIT, MT_DATA); + tmp = m_getm(m, totlen, M_NOWAIT, MT_DATA); if (tmp == NULL) { m_free(m); return (NULL); @@ -2924,7 +2924,7 @@ en_attach(struct en_softc *sc) &en_utopia_methods); utopia_init_media(&sc->utopia); - MGET(sc->padbuf, M_WAIT, MT_DATA); + MGET(sc->padbuf, M_WAITOK, MT_DATA); bzero(sc->padbuf->m_data, MLEN); if (bus_dma_tag_create(bus_get_dma_tag(sc->dev), 1, 0, diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index 7be1f80daecb..183c5f484227 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -746,11 +746,11 @@ epread(struct ep_softc *sc) rx_fifo = rx_fifo2 = status & RX_BYTES_MASK; if (EP_FTST(sc, F_RX_FIRST)) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) goto out; if (rx_fifo >= MINCLSIZE) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); sc->top = sc->mcur = top = m; #define EROUND ((sizeof(struct ether_header) + 3) & ~3) #define EOFF (EROUND - sizeof(struct ether_header)) @@ -774,11 +774,11 @@ epread(struct ep_softc *sc) lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); if (lenthisone == 0) { /* no room in this one */ mcur = m; - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (!m) goto out; if (rx_fifo >= MINCLSIZE) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); m->m_len = 0; mcur->m_next = m; lenthisone = min(rx_fifo, M_TRAILINGSPACE(m)); diff --git a/sys/dev/et/if_et.c b/sys/dev/et/if_et.c index dfdcde73438b..3d73c9c5c147 100644 --- a/sys/dev/et/if_et.c +++ b/sys/dev/et/if_et.c @@ -2169,7 +2169,7 @@ et_encap(struct et_softc *sc, struct mbuf **m0) error = bus_dmamap_load_mbuf_sg(sc->sc_tx_tag, map, *m0, segs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m0, M_DONTWAIT, ET_NSEG_MAX); + m = m_collapse(*m0, M_NOWAIT, ET_NSEG_MAX); if (m == NULL) { m_freem(*m0); *m0 = NULL; @@ -2331,7 +2331,7 @@ et_newbuf_cluster(struct et_rxbuf_data *rbd, int buf_idx) int nsegs; MPASS(buf_idx < ET_RX_NDESC); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -2390,7 +2390,7 @@ et_newbuf_hdr(struct et_rxbuf_data *rbd, int buf_idx) int nsegs; MPASS(buf_idx < ET_RX_NDESC); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MHLEN; diff --git a/sys/dev/ex/if_ex.c b/sys/dev/ex/if_ex.c index 1034dacdd5de..a91a3cc2dcd4 100644 --- a/sys/dev/ex/if_ex.c +++ b/sys/dev/ex/if_ex.c @@ -733,7 +733,7 @@ ex_rx_intr(struct ex_softc *sc) QQQ = pkt_len = CSR_READ_2(sc, IO_PORT_REG); if (rx_status & RCV_OK_bit) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); ipkt = m; if (ipkt == NULL) { ifp->if_iqdrops++; @@ -744,7 +744,7 @@ ex_rx_intr(struct ex_softc *sc) while (pkt_len > 0) { if (pkt_len >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (m->m_flags & M_EXT) { m->m_len = MCLBYTES; } else { @@ -769,7 +769,7 @@ ex_rx_intr(struct ex_softc *sc) pkt_len -= m->m_len; if (pkt_len > 0) { - MGET(m->m_next, M_DONTWAIT, MT_DATA); + MGET(m->m_next, M_NOWAIT, MT_DATA); if (m->m_next == NULL) { m_freem(ipkt); ifp->if_iqdrops++; diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c index 8ddda95d7b43..9020d22d5884 100644 --- a/sys/dev/fatm/if_fatm.c +++ b/sys/dev/fatm/if_fatm.c @@ -1099,7 +1099,7 @@ fatm_supply_small_buffers(struct fatm_softc *sc) if_printf(sc->ifp, "out of rbufs\n"); break; } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { LIST_INSERT_HEAD(&sc->rbuf_free, rb, link); break; @@ -1189,7 +1189,7 @@ fatm_supply_large_buffers(struct fatm_softc *sc) if_printf(sc->ifp, "out of rbufs\n"); break; } - if ((m = m_getcl(M_DONTWAIT, MT_DATA, + if ((m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) { LIST_INSERT_HEAD(&sc->rbuf_free, rb, link); break; @@ -1768,17 +1768,17 @@ copy_mbuf(struct mbuf *m) { struct mbuf *new; - MGET(new, M_DONTWAIT, MT_DATA); + MGET(new, M_NOWAIT, MT_DATA); if (new == NULL) return (NULL); if (m->m_flags & M_PKTHDR) { M_MOVE_PKTHDR(new, m); if (m->m_len > MHLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } else { if (m->m_len > MLEN) - MCLGET(new, M_WAIT); + MCLGET(new, M_WAITOK); } bcopy(m->m_data, new->m_data, m->m_len); diff --git a/sys/dev/fe/if_fe.c b/sys/dev/fe/if_fe.c index 7bfca2ab4ff4..5883b6bc54b5 100644 --- a/sys/dev/fe/if_fe.c +++ b/sys/dev/fe/if_fe.c @@ -1870,13 +1870,13 @@ fe_get_packet (struct fe_softc * sc, u_short len) */ /* Allocate an mbuf with packet header info. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return -1; /* Attach a cluster if this packet doesn't fit in a normal mbuf. */ if (len > MHLEN - NFS_MAGIC_OFFSET) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); return -1; diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c index 4b147b2ab139..77886d3adfa8 100644 --- a/sys/dev/firewire/fwohci.c +++ b/sys/dev/firewire/fwohci.c @@ -977,7 +977,7 @@ fwohci_start(struct fwohci_softc *sc, struct fwohci_dbch *dbch) if (firewire_debug) device_printf(sc->fc.dev, "EFBIG.\n"); - m0 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m0 != NULL) { m_copydata(xfer->mbuf, 0, xfer->mbuf->m_pkthdr.len, diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index fa51026a1de1..615cb07bbbef 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -357,7 +357,7 @@ fwe_init(void *arg) STAILQ_INIT(&xferq->stdma); xferq->stproc = NULL; for (i = 0; i < xferq->bnchunk; i ++) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); xferq->bulkxfer[i].mbuf = m; m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; STAILQ_INSERT_TAIL(&xferq->stfree, @@ -606,7 +606,7 @@ fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp) #endif /* keep ip packet alignment for alpha */ - M_PREPEND(m, ETHER_ALIGN, M_DONTWAIT); + M_PREPEND(m, ETHER_ALIGN, M_NOWAIT); fp = &xfer->send.hdr; *(uint32_t *)&xfer->send.hdr = *(int32_t *)&fwe->pkt_hdr; fp->mode.stream.len = m->m_pkthdr.len; @@ -657,7 +657,7 @@ fwe_as_input(struct fw_xferq *xferq) m = sxfer->mbuf; /* insert new rbuf */ - sxfer->mbuf = m0 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sxfer->mbuf = m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m0 != NULL) { m0->m_len = m0->m_pkthdr.len = m0->m_ext.ext_size; STAILQ_INSERT_TAIL(&xferq->stfree, sxfer, link); diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index e7c4a669e6e8..7010bc9c7ff3 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -333,7 +333,7 @@ fwip_init(void *arg) STAILQ_INIT(&xferq->stdma); xferq->stproc = NULL; for (i = 0; i < xferq->bnchunk; i ++) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); xferq->bulkxfer[i].mbuf = m; m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; STAILQ_INSERT_TAIL(&xferq->stfree, @@ -349,7 +349,7 @@ fwip_init(void *arg) xfer = fw_xfer_alloc(M_FWIP); if (xfer == NULL) break; - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); xfer->recv.payload = mtod(m, uint32_t *); xfer->recv.pay_len = MCLBYTES; xfer->hand = fwip_unicast_input; @@ -657,7 +657,7 @@ fwip_async_output(struct fwip_softc *fwip, struct ifnet *ifp) */ uint32_t *p; - M_PREPEND(m, 2*sizeof(uint32_t), M_DONTWAIT); + M_PREPEND(m, 2*sizeof(uint32_t), M_NOWAIT); p = mtod(m, uint32_t *); fp->mode.stream.len = m->m_pkthdr.len; fp->mode.stream.chtag = broadcast_channel; @@ -778,7 +778,7 @@ fwip_stream_input(struct fw_xferq *xferq) m = sxfer->mbuf; /* insert new rbuf */ - sxfer->mbuf = m0 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sxfer->mbuf = m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m0 != NULL) { m0->m_len = m0->m_pkthdr.len = m0->m_ext.ext_size; STAILQ_INSERT_TAIL(&xferq->stfree, sxfer, link); @@ -871,7 +871,7 @@ fwip_unicast_input_recycle(struct fwip_softc *fwip, struct fw_xfer *xfer) * We have finished with a unicast xfer. Allocate a new * cluster and stick it on the back of the input queue. */ - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); xfer->mbuf = m; xfer->recv.payload = mtod(m, uint32_t *); xfer->recv.pay_len = MCLBYTES; diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 364df90ebcc5..ba63af734406 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1447,7 +1447,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) if (M_WRITABLE(*m_head) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1563,7 +1563,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->fxp_txmtag, txp->tx_map, *m_head, segs, &nseg, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, sc->maxtxseg); + m = m_collapse(*m_head, M_NOWAIT, sc->maxtxseg); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2628,7 +2628,7 @@ fxp_new_rfabuf(struct fxp_softc *sc, struct fxp_rx *rxp) bus_dmamap_t tmp_map; int error; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index d75e1ab8dc61..4aa9c6d34f1f 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -1120,7 +1120,7 @@ gem_load_txmbuf(struct gem_softc *sc, struct mbuf **m_head) cflags = 0; if (((*m_head)->m_pkthdr.csum_flags & sc->sc_csum_features) != 0) { if (M_WRITABLE(*m_head) == 0) { - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); *m_head = m; if (m == NULL) @@ -1143,7 +1143,7 @@ gem_load_txmbuf(struct gem_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sc_tdmatag, txs->txs_dmamap, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, GEM_NTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, GEM_NTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1663,7 +1663,7 @@ gem_add_rxbuf(struct gem_softc *sc, int idx) GEM_LOCK_ASSERT(sc, MA_OWNED); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; diff --git a/sys/dev/gxemul/ether/if_gx.c b/sys/dev/gxemul/ether/if_gx.c index b98cc7ce3c01..321882f5fd8f 100644 --- a/sys/dev/gxemul/ether/if_gx.c +++ b/sys/dev/gxemul/ether/if_gx.c @@ -370,7 +370,7 @@ gx_rx_intr(void *arg) continue; } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "no memory for receive mbuf.\n"); sc->sc_ifp->if_iqdrops++; diff --git a/sys/dev/hatm/if_hatm_intr.c b/sys/dev/hatm/if_hatm_intr.c index 35bbd57638bf..b6a53680eb15 100644 --- a/sys/dev/hatm/if_hatm_intr.c +++ b/sys/dev/hatm/if_hatm_intr.c @@ -330,7 +330,7 @@ he_intr_rbp(struct hatm_softc *sc, struct herbp *rbp, u_int large, if (large) { /* allocate the MBUF */ - if ((m = m_getcl(M_DONTWAIT, MT_DATA, + if ((m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) { if_printf(sc->ifp, "no mbuf clusters\n"); @@ -437,7 +437,7 @@ hatm_rx_buffer(struct hatm_softc *sc, u_int group, u_int handle) DBG(sc, RX, ("RX group=%u handle=%x page=%u chunk=%u", group, handle, pageno, chunkno)); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (group == 0) { struct mbuf0_chunk *c0; diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c index 868b5a3d43d6..455dbb4db327 100644 --- a/sys/dev/hatm/if_hatm_tx.c +++ b/sys/dev/hatm/if_hatm_tx.c @@ -466,7 +466,7 @@ hatm_start(struct ifnet *ifp) if (error == EFBIG) { /* try to defragment the packet */ sc->istats.defrag++; - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) { tpd->mbuf = NULL; hatm_free_txmbuf(sc); diff --git a/sys/dev/hifn/hifn7751.c b/sys/dev/hifn/hifn7751.c index ecb12397cda9..c5c5af1b3fa4 100644 --- a/sys/dev/hifn/hifn7751.c +++ b/sys/dev/hifn/hifn7751.c @@ -1878,14 +1878,14 @@ hifn_crypto( totlen = cmd->src_mapsize; if (cmd->src_m->m_flags & M_PKTHDR) { len = MHLEN; - MGETHDR(m0, M_DONTWAIT, MT_DATA); - if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_DONTWAIT)) { + MGETHDR(m0, M_NOWAIT, MT_DATA); + if (m0 && !m_dup_pkthdr(m0, cmd->src_m, M_NOWAIT)) { m_free(m0); m0 = NULL; } } else { len = MLEN; - MGET(m0, M_DONTWAIT, MT_DATA); + MGET(m0, M_NOWAIT, MT_DATA); } if (m0 == NULL) { hifnstats.hst_nomem_mbuf++; @@ -1893,7 +1893,7 @@ hifn_crypto( goto err_srcmap; } if (totlen >= MINCLSIZE) { - MCLGET(m0, M_DONTWAIT); + MCLGET(m0, M_NOWAIT); if ((m0->m_flags & M_EXT) == 0) { hifnstats.hst_nomem_mcl++; err = sc->sc_cmdu ? ERESTART : ENOMEM; @@ -1907,7 +1907,7 @@ hifn_crypto( mlast = m0; while (totlen > 0) { - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { hifnstats.hst_nomem_mbuf++; err = sc->sc_cmdu ? ERESTART : ENOMEM; @@ -1916,7 +1916,7 @@ hifn_crypto( } len = MLEN; if (totlen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { hifnstats.hst_nomem_mcl++; err = sc->sc_cmdu ? ERESTART : ENOMEM; diff --git a/sys/dev/hme/if_hme.c b/sys/dev/hme/if_hme.c index 63d27d145449..9f310ee4f11e 100644 --- a/sys/dev/hme/if_hme.c +++ b/sys/dev/hme/if_hme.c @@ -564,7 +564,7 @@ hme_add_rxbuf(struct hme_softc *sc, unsigned int ri, int keepold) hme_discard_rxbuf(sc, ri); return (0); } - if ((m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; b = mtod(m, uintptr_t); @@ -951,7 +951,7 @@ hme_load_txmbuf(struct hme_softc *sc, struct mbuf **m0) cflags = 0; if (((*m0)->m_pkthdr.csum_flags & sc->sc_csum_features) != 0) { if (M_WRITABLE(*m0) == 0) { - m = m_dup(*m0, M_DONTWAIT); + m = m_dup(*m0, M_NOWAIT); m_freem(*m0); *m0 = m; if (m == NULL) @@ -974,7 +974,7 @@ hme_load_txmbuf(struct hme_softc *sc, struct mbuf **m0) error = bus_dmamap_load_mbuf_sg(sc->sc_tdmatag, htx->htx_dmamap, *m0, segs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m0, M_DONTWAIT, HME_NTXSEGS); + m = m_collapse(*m0, M_NOWAIT, HME_NTXSEGS); if (m == NULL) { m_freem(*m0); *m0 = NULL; diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c index fb0d9871dc41..e945a060c5e5 100644 --- a/sys/dev/ie/if_ie.c +++ b/sys/dev/ie/if_ie.c @@ -698,7 +698,7 @@ ieget(struct ie_softc *sc, struct mbuf **mp) return (-1); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) { ie_drop_packet_buffer(sc); /* XXXX if_ierrors++; */ @@ -727,7 +727,7 @@ ieget(struct ie_softc *sc, struct mbuf **mp) * single mbuf which may or may not be big enough. Got that? */ if (top) { - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (!m) { m_freem(top); ie_drop_packet_buffer(sc); @@ -736,7 +736,7 @@ ieget(struct ie_softc *sc, struct mbuf **mp) m->m_len = MLEN; } if (resid >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (m->m_flags & M_EXT) m->m_len = min(resid, MCLBYTES); } else { diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c index 10fc01885149..a62b9138abc0 100644 --- a/sys/dev/if_ndis/if_ndis.c +++ b/sys/dev/if_ndis/if_ndis.c @@ -1174,7 +1174,7 @@ ndis_rxeof_eth(adapter, ctx, addr, hdr, hdrlen, lookahead, lookaheadlen, pktlen) block = adapter; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return; @@ -1418,7 +1418,7 @@ ndis_rxeof(adapter, packets, pktcnt) } else { #ifdef notdef if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) { - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); /* * NOTE: we want to destroy the mbuf here, but * we don't actually want to return it to the @@ -1436,7 +1436,7 @@ ndis_rxeof(adapter, packets, pktcnt) } else p->np_oob.npo_status = NDIS_STATUS_PENDING; #endif - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) p->np_refcnt++; else diff --git a/sys/dev/ipw/if_ipw.c b/sys/dev/ipw/if_ipw.c index 01e30127ec49..28fa0fd10af5 100644 --- a/sys/dev/ipw/if_ipw.c +++ b/sys/dev/ipw/if_ipw.c @@ -709,7 +709,7 @@ ipw_dma_alloc(struct ipw_softc *sc) sbuf = &sc->rx_sbuf_list[i]; sbd->bd = &sc->rbd_list[i]; - sbuf->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sbuf->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sbuf->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -1207,7 +1207,7 @@ ipw_rx_data_intr(struct ipw_softc *sc, struct ipw_status *status, * drop the received packet and reuse the old mbuf. In the unlikely * case that the old mbuf can't be reloaded either, explicitly panic. */ - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { ifp->if_ierrors++; return; @@ -1651,7 +1651,7 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni) return error; } if (error != 0) { - mnew = m_defrag(m0, M_DONTWAIT); + mnew = m_defrag(m0, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 8571d6107e47..fe1c6436dca8 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -788,7 +788,7 @@ iwi_alloc_rx_ring(struct iwi_softc *sc, struct iwi_rx_ring *ring, int count) goto fail; } - data->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -1236,7 +1236,7 @@ iwi_frame_intr(struct iwi_softc *sc, struct iwi_rx_data *data, int i, * drop the received packet and reuse the old mbuf. In the unlikely * case that the old mbuf can't be reloaded either, explicitly panic. */ - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { ifp->if_ierrors++; return; @@ -1884,7 +1884,7 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni, return error; } if (error != 0) { - mnew = m_defrag(m0, M_DONTWAIT); + mnew = m_defrag(m0, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c index 6c292d7382a7..b6b523a7edd0 100644 --- a/sys/dev/iwn/if_iwn.c +++ b/sys/dev/iwn/if_iwn.c @@ -1377,7 +1377,7 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, struct iwn_rx_ring *ring) goto fail; } - data->m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + data->m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE); if (data->m == NULL) { device_printf(sc->sc_dev, @@ -2334,7 +2334,7 @@ iwn_rx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, return; } - m1 = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE); + m1 = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE); if (m1 == NULL) { DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n", __func__); @@ -3539,7 +3539,7 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) return error; } /* Too many DMA segments, linearize mbuf. */ - m1 = m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER); + m1 = m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER); if (m1 == NULL) { device_printf(sc->sc_dev, "%s: could not defrag mbuf\n", __func__); @@ -3743,7 +3743,7 @@ iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, return error; } /* Too many DMA segments, linearize mbuf. */ - m1 = m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER); + m1 = m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER); if (m1 == NULL) { device_printf(sc->sc_dev, "%s: could not defrag mbuf\n", __func__); @@ -3976,7 +3976,7 @@ iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) /* Command is too large to fit in a descriptor. */ if (totlen > MCLBYTES) return EINVAL; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (m == NULL) return ENOMEM; cmd = mtod(m, struct iwn_tx_cmd *); diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index 544e8e370cae..e9acae088709 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -1790,7 +1790,7 @@ ixgb_get_buf(int i, struct adapter * adapter, if (mp == NULL) { - mp = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mp = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mp == NULL) { adapter->mbuf_alloc_failed++; diff --git a/sys/dev/ixgbe/ixgbe.c b/sys/dev/ixgbe/ixgbe.c index 27d3d0ae06d4..f84644011077 100644 --- a/sys/dev/ixgbe/ixgbe.c +++ b/sys/dev/ixgbe/ixgbe.c @@ -3707,7 +3707,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, int limit) while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf == NULL) { - mp = m_getjcl(M_DONTWAIT, MT_DATA, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rxr->mbuf_sz); if (mp == NULL) goto update; diff --git a/sys/dev/ixgbe/ixv.c b/sys/dev/ixgbe/ixv.c index 37f602b6b196..b9aff8000989 100644 --- a/sys/dev/ixgbe/ixv.c +++ b/sys/dev/ixgbe/ixv.c @@ -1235,7 +1235,7 @@ ixv_xmit(struct tx_ring *txr, struct mbuf **m_headp) if (error == EFBIG) { struct mbuf *m; - m = m_defrag(*m_headp, M_DONTWAIT); + m = m_defrag(*m_headp, M_NOWAIT); if (m == NULL) { adapter->mbuf_defrag_failed++; m_freem(*m_headp); @@ -2723,7 +2723,7 @@ ixv_refresh_mbufs(struct rx_ring *rxr, int limit) while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if ((rxbuf->m_head == NULL) && (rxr->hdr_split)) { - mh = m_gethdr(M_DONTWAIT, MT_DATA); + mh = m_gethdr(M_NOWAIT, MT_DATA); if (mh == NULL) goto update; mh->m_pkthdr.len = mh->m_len = MHLEN; @@ -2747,7 +2747,7 @@ ixv_refresh_mbufs(struct rx_ring *rxr, int limit) } if (rxbuf->m_pack == NULL) { - mp = m_getjcl(M_DONTWAIT, MT_DATA, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (mp == NULL) goto update; diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c index 13270b78d40c..832acef0e5c0 100644 --- a/sys/dev/jme/if_jme.c +++ b/sys/dev/jme/if_jme.c @@ -1712,7 +1712,7 @@ jme_encap(struct jme_softc *sc, struct mbuf **m_head) if (M_WRITABLE(*m_head) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1774,7 +1774,7 @@ jme_encap(struct jme_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, JME_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, JME_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -3181,7 +3181,7 @@ jme_newbuf(struct jme_softc *sc, struct jme_rxdesc *rxd) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); /* diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index 8700aa2cd436..e2cc30e23716 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -394,7 +394,7 @@ lance_get(struct lance_softc *sc, int boff, int totlen) return (NULL); } - MGETHDR(m0, M_DONTWAIT, MT_DATA); + MGETHDR(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) return (NULL); m0->m_pkthdr.rcvif = ifp; @@ -404,7 +404,7 @@ lance_get(struct lance_softc *sc, int boff, int totlen) while (totlen > 0) { if (totlen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) goto bad; len = MCLBYTES; @@ -423,7 +423,7 @@ lance_get(struct lance_softc *sc, int boff, int totlen) totlen -= len; if (totlen > 0) { - MGET(newm, M_DONTWAIT, MT_DATA); + MGET(newm, M_NOWAIT, MT_DATA); if (newm == 0) goto bad; len = MLEN; diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index 09ceea12d0e1..d9948672d306 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -691,7 +691,7 @@ lge_newbuf(sc, c, m) caddr_t *buf = NULL; if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { device_printf(sc->lge_dev, "no memory for rx list " "-- packet dropped!\n"); diff --git a/sys/dev/lmc/if_lmc.c b/sys/dev/lmc/if_lmc.c index 62f6017af597..9d1ec8cdc847 100644 --- a/sys/dev/lmc/if_lmc.c +++ b/sys/dev/lmc/if_lmc.c @@ -2916,7 +2916,7 @@ rxintr_cleanup(softc_t *sc) /* Optimization: copy a small pkt into a small mbuf. */ if (first_mbuf->m_pkthdr.len <= COPY_BREAK) { - MGETHDR(new_mbuf, M_DONTWAIT, MT_DATA); + MGETHDR(new_mbuf, M_NOWAIT, MT_DATA); if (new_mbuf != NULL) { new_mbuf->m_pkthdr.rcvif = first_mbuf->m_pkthdr.rcvif; @@ -3016,7 +3016,7 @@ rxintr_setup(softc_t *sc) return 0; /* ring is full; nothing to do */ /* Allocate a small mbuf and attach an mbuf cluster. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { sc->status.cntrs.rxdma++; @@ -3024,7 +3024,7 @@ rxintr_setup(softc_t *sc) printf("%s: rxintr_setup: MGETHDR() failed\n", NAME_UNIT); return 0; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); diff --git a/sys/dev/malo/if_malo.c b/sys/dev/malo/if_malo.c index 7305d12ddc7d..9f298de0d7ad 100644 --- a/sys/dev/malo/if_malo.c +++ b/sys/dev/malo/if_malo.c @@ -854,7 +854,7 @@ malo_tx_dmasetup(struct malo_softc *sc, struct malo_txbuf *bf, struct mbuf *m0) */ if (error == EFBIG) { /* too many desc's, linearize */ sc->malo_stats.mst_tx_linear++; - m = m_defrag(m0, M_DONTWAIT); + m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); sc->malo_stats.mst_tx_nombuf++; @@ -1396,7 +1396,7 @@ malo_getrxmbuf(struct malo_softc *sc, struct malo_rxbuf *bf) int error; /* XXX don't need mbuf, just dma buffer */ - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (m == NULL) { sc->malo_stats.mst_rx_nombuf++; /* XXX */ return NULL; diff --git a/sys/dev/mge/if_mge.c b/sys/dev/mge/if_mge.c index a76fee435503..3195b239988e 100644 --- a/sys/dev/mge/if_mge.c +++ b/sys/dev/mge/if_mge.c @@ -389,7 +389,7 @@ mge_new_rxbuf(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **mbufp, KASSERT(mbufp != NULL, ("NULL mbuf pointer!")); - new_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + new_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (new_mbuf == NULL) return (ENOBUFS); new_mbuf->m_len = new_mbuf->m_pkthdr.len = new_mbuf->m_ext.ext_size; @@ -1549,7 +1549,7 @@ mge_start_locked(struct ifnet *ifp) if (m0 == NULL) break; - mtmp = m_defrag(m0, M_DONTWAIT); + mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; diff --git a/sys/dev/mn/if_mn.c b/sys/dev/mn/if_mn.c index 07c2a98db6e4..48fc3dc0a9b6 100644 --- a/sys/dev/mn/if_mn.c +++ b/sys/dev/mn/if_mn.c @@ -693,7 +693,7 @@ ngmn_connect(hook_p hook) /* Setup a transmit chain with one descriptor */ /* XXX: we actually send a 1 byte packet */ dp = mn_alloc_desc(); - MGETHDR(m, M_WAIT, MT_DATA); + MGETHDR(m, M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; dp->m = m; dp->flags = 0xc0000000 + (1 << 16); @@ -708,8 +708,8 @@ ngmn_connect(hook_p hook) dp = mn_alloc_desc(); m = NULL; - MGETHDR(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGETHDR(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); dp->m = m; dp->data = vtophys(m->m_data); dp->flags = 0x40000000; @@ -722,8 +722,8 @@ ngmn_connect(hook_p hook) dp2 = dp; dp = mn_alloc_desc(); m = NULL; - MGETHDR(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGETHDR(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); dp->m = m; dp->data = vtophys(m->m_data); dp->flags = 0x00000000; @@ -1160,12 +1160,12 @@ mn_rx_intr(struct mn_softc *sc, u_int32_t vector) /* Replenish desc + mbuf supplies */ if (!m) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { mn_free_desc(dp); return; /* ENOBUFS */ } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if((m->m_flags & M_EXT) == 0) { mn_free_desc(dp); m_freem(m); diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 93292e52e760..d0ca808c8ef3 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -897,7 +897,7 @@ msk_newbuf(struct msk_if_softc *sc_if, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); @@ -955,7 +955,7 @@ msk_jumbo_newbuf(struct msk_if_softc *sc_if, int idx) bus_dmamap_t map; int nsegs; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); if ((m->m_flags & M_EXT) == 0) { @@ -2653,7 +2653,7 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head) if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -2732,7 +2732,7 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc_if->msk_cdata.msk_tx_tag, map, *m_head, txsegs, &nseg, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, MSK_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, MSK_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/mwl/if_mwl.c b/sys/dev/mwl/if_mwl.c index 79393c8d8f16..1d2b6e38b011 100644 --- a/sys/dev/mwl/if_mwl.c +++ b/sys/dev/mwl/if_mwl.c @@ -2810,7 +2810,7 @@ mwl_rx_proc(void *arg, int npending) * be a net loss. The tradeoff might be system * dependent (cache architecture is important). */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { DPRINTF(sc, MWL_DEBUG_ANY, "%s: no rx mbuf\n", __func__); @@ -3087,9 +3087,9 @@ mwl_tx_dmasetup(struct mwl_softc *sc, struct mwl_txbuf *bf, struct mbuf *m0) if (error == EFBIG) { /* too many desc's, linearize */ sc->sc_stats.mst_tx_linear++; #if MWL_TXDESC > 1 - m = m_collapse(m0, M_DONTWAIT, MWL_TXDESC); + m = m_collapse(m0, M_NOWAIT, MWL_TXDESC); #else - m = m_defrag(m0, M_DONTWAIT); + m = m_defrag(m0, M_NOWAIT); #endif if (m == NULL) { m_freem(m0); diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c index c8dea6b06a63..c04e0df2bdbb 100644 --- a/sys/dev/mxge/if_mxge.c +++ b/sys/dev/mxge/if_mxge.c @@ -2004,7 +2004,7 @@ mxge_vlan_tag_insert(struct mbuf *m) { struct ether_vlan_header *evl; - M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_NOWAIT); if (__predict_false(m == NULL)) return NULL; if (m->m_len < sizeof(*evl)) { @@ -2376,7 +2376,7 @@ mxge_get_buf_small(struct mxge_slice_state *ss, bus_dmamap_t map, int idx) mxge_rx_ring_t *rx = &ss->rx_small; int cnt, err; - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { rx->alloc_fail++; err = ENOBUFS; @@ -2409,7 +2409,7 @@ mxge_get_buf_big(struct mxge_slice_state *ss, bus_dmamap_t map, int idx) mxge_rx_ring_t *rx = &ss->rx_big; int cnt, err, i; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, rx->cl_size); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, rx->cl_size); if (m == NULL) { rx->alloc_fail++; err = ENOBUFS; diff --git a/sys/dev/my/if_my.c b/sys/dev/my/if_my.c index c7c0ad488c79..964841242fc0 100644 --- a/sys/dev/my/if_my.c +++ b/sys/dev/my/if_my.c @@ -1085,13 +1085,13 @@ my_newbuf(struct my_softc * sc, struct my_chain_onefrag * c) struct mbuf *m_new = NULL; MY_LOCK_ASSERT(sc); - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { device_printf(sc->my_dev, "no memory for rx list -- packet dropped!\n"); return (ENOBUFS); } - MCLGET(m_new, M_DONTWAIT); + MCLGET(m_new, M_NOWAIT); if (!(m_new->m_flags & M_EXT)) { device_printf(sc->my_dev, "no memory for rx list -- packet dropped!\n"); @@ -1352,13 +1352,13 @@ my_encap(struct my_softc * sc, struct my_chain * c, struct mbuf * m_head) * chain. */ m = m_head; - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { device_printf(sc->my_dev, "no memory for tx list"); return (1); } if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(m_new, M_DONTWAIT); + MCLGET(m_new, M_NOWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); device_printf(sc->my_dev, "no memory for tx list"); diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index fe072f33f7fc..13099e9fa9e9 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -1975,7 +1975,7 @@ nfe_newbuf(struct nfe_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); @@ -2031,7 +2031,7 @@ nfe_jnewbuf(struct nfe_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); if ((m->m_flags & M_EXT) == 0) { @@ -2400,7 +2400,7 @@ nfe_encap(struct nfe_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->txq.tx_data_tag, map, *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, NFE_MAX_SCATTER); + m = m_collapse(*m_head, M_NOWAIT, NFE_MAX_SCATTER); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/nge/if_nge.c b/sys/dev/nge/if_nge.c index 7cf3eea8cd17..6f680c38ea24 100644 --- a/sys/dev/nge/if_nge.c +++ b/sys/dev/nge/if_nge.c @@ -1381,7 +1381,7 @@ nge_newbuf(struct nge_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1894,7 +1894,7 @@ nge_encap(struct nge_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->nge_cdata.nge_tx_tag, map, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, NGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, NGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c index fe26666d8144..839cfb6ad748 100644 --- a/sys/dev/nve/if_nve.c +++ b/sys/dev/nve/if_nve.c @@ -764,7 +764,7 @@ nve_init_rings(struct nve_softc *sc) struct nve_rx_desc *desc = sc->rx_desc + i; struct nve_map_buffer *buf = &desc->buf; - buf->mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + buf->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (buf->mbuf == NULL) { device_printf(sc->dev, "couldn't allocate mbuf\n"); nve_free_rings(sc); @@ -918,7 +918,7 @@ nve_ifstart_locked(struct ifnet *ifp) * cluster */ if (error) { - m = m_defrag(m0, M_DONTWAIT); + m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); sc->tx_errors++; @@ -1480,7 +1480,7 @@ nve_osallocrxbuf(PNV_VOID ctx, PMEMORY_BLOCK mem, PNV_VOID *id) buf = &desc->buf; if (buf->mbuf == NULL) { - buf->mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + buf->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (buf->mbuf == NULL) { device_printf(sc->dev, "failed to allocate memory\n"); goto fail; diff --git a/sys/dev/nxge/if_nxge.c b/sys/dev/nxge/if_nxge.c index 8c3ca5d29062..c7dbeb620055 100644 --- a/sys/dev/nxge/if_nxge.c +++ b/sys/dev/nxge/if_nxge.c @@ -3024,7 +3024,7 @@ xge_send_locked(struct ifnet *ifnetp, int qindex) } if(count >= max_fragments) { - m_buf = m_defrag(m_head, M_DONTWAIT); + m_buf = m_defrag(m_head, M_NOWAIT); if(m_buf != NULL) m_head = m_buf; XGE_DRV_STATS(tx_defrag); } @@ -3132,7 +3132,7 @@ xge_get_buf(xge_hal_dtr_h dtrh, xge_rx_priv_t *rxd_priv, if(buffer_size <= MCLBYTES) { cluster_size = MCLBYTES; - mp = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mp = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); } else { cluster_size = MJUMPAGESIZE; @@ -3140,7 +3140,7 @@ xge_get_buf(xge_hal_dtr_h dtrh, xge_rx_priv_t *rxd_priv, (buffer_size > MJUMPAGESIZE)) { cluster_size = MJUM9BYTES; } - mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, cluster_size); + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, cluster_size); } if(!mp) { xge_trace(XGE_ERR, "Out of memory to allocate mbuf"); diff --git a/sys/dev/oce/oce_if.c b/sys/dev/oce/oce_if.c index 79ba41045163..7d15fcc094e8 100644 --- a/sys/dev/oce/oce_if.c +++ b/sys/dev/oce/oce_if.c @@ -902,7 +902,7 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, int wq_index) } else if (rc == EFBIG) { if (retry_cnt == 0) { - m_temp = m_defrag(m, M_DONTWAIT); + m_temp = m_defrag(m, M_NOWAIT); if (m_temp == NULL) goto free_ret; m = m_temp; @@ -995,7 +995,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp) m = *mpp; if (M_WRITABLE(m) == 0) { - m = m_dup(*mpp, M_DONTWAIT); + m = m_dup(*mpp, M_NOWAIT); if (!m) return NULL; m_freem(*mpp); @@ -1481,7 +1481,7 @@ oce_alloc_rx_bufs(struct oce_rq *rq, int count) break; /* no more room */ pd = &rq->pckts[rq->packets_in]; - pd->mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + pd->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (pd->mbuf == NULL) break; diff --git a/sys/dev/patm/if_patm_intr.c b/sys/dev/patm/if_patm_intr.c index 79cb248966ba..12ef9958c1da 100644 --- a/sys/dev/patm/if_patm_intr.c +++ b/sys/dev/patm/if_patm_intr.c @@ -324,7 +324,7 @@ patm_lmbuf_alloc(struct patm_softc *sc) struct mbuf *m; struct lmbuf *b; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (NULL); m->m_data += LMBUF_OFFSET; diff --git a/sys/dev/patm/if_patm_rx.c b/sys/dev/patm/if_patm_rx.c index 024d8ef1fb76..f739b9cfa4a4 100644 --- a/sys/dev/patm/if_patm_rx.c +++ b/sys/dev/patm/if_patm_rx.c @@ -396,9 +396,9 @@ patm_rcv_mbuf(struct patm_softc *sc, void *buf, u_int h, int hdr) return ((struct mbuf *)buf); if (hdr) - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); else - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { patm_rcv_free(sc, buf, h); return (NULL); @@ -458,7 +458,7 @@ patm_rx_raw(struct patm_softc *sc, u_char *cell) } } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { sc->stats.raw_no_buf++; return; diff --git a/sys/dev/patm/if_patm_tx.c b/sys/dev/patm/if_patm_tx.c index cb40aa530fc5..81a1efceb71b 100644 --- a/sys/dev/patm/if_patm_tx.c +++ b/sys/dev/patm/if_patm_tx.c @@ -438,7 +438,7 @@ patm_tx_pad(struct patm_softc *sc, struct mbuf *m0) return (m0); } } - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == 0) { m_freem(m0); sc->ifp->if_oerrors++; @@ -532,7 +532,7 @@ patm_launch(struct patm_softc *sc, struct patm_scd *scd) error = bus_dmamap_load_mbuf(sc->tx_tag, map->map, m, patm_load_txbuf, &a, BUS_DMA_NOWAIT); if (error == EFBIG) { - if ((m = m_defrag(m, M_DONTWAIT)) == NULL) { + if ((m = m_defrag(m, M_NOWAIT)) == NULL) { sc->ifp->if_oerrors++; continue; } diff --git a/sys/dev/pcn/if_pcn.c b/sys/dev/pcn/if_pcn.c index 4aaabc055752..a9cff3c22fdb 100644 --- a/sys/dev/pcn/if_pcn.c +++ b/sys/dev/pcn/if_pcn.c @@ -798,11 +798,11 @@ pcn_newbuf(sc, idx, m) c = &sc->pcn_ldata->pcn_rx_list[idx]; if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) return(ENOBUFS); - MCLGET(m_new, M_DONTWAIT); + MCLGET(m_new, M_NOWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); return(ENOBUFS); diff --git a/sys/dev/pdq/pdq_freebsd.h b/sys/dev/pdq/pdq_freebsd.h index 6efd6849b4e7..02bb9ca5ab6f 100644 --- a/sys/dev/pdq/pdq_freebsd.h +++ b/sys/dev/pdq/pdq_freebsd.h @@ -187,9 +187,9 @@ typedef struct _pdq_os_ctx_t { #define PDQ_OS_DATABUF_ALLOC(pdq, b) do { \ PDQ_OS_DATABUF_T *x_m0; \ - MGETHDR(x_m0, M_DONTWAIT, MT_DATA); \ + MGETHDR(x_m0, M_NOWAIT, MT_DATA); \ if (x_m0 != NULL) { \ - MCLGET(x_m0, M_DONTWAIT); \ + MCLGET(x_m0, M_NOWAIT); \ if ((x_m0->m_flags & M_EXT) == 0) { \ m_free(x_m0); \ (b) = NULL; \ diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index 4df00825fe4c..00e42b0edec7 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -742,12 +742,12 @@ pdq_os_databuf_alloc( struct mbuf *m; bus_dmamap_t map; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { printf("%s: can't alloc small buf\n", sc->sc_dev.dv_xname); return NULL; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { printf("%s: can't alloc cluster\n", sc->sc_dev.dv_xname); m_free(m); diff --git a/sys/dev/pdq/pdqvar.h b/sys/dev/pdq/pdqvar.h index d978809c2326..7eb6324543e3 100644 --- a/sys/dev/pdq/pdqvar.h +++ b/sys/dev/pdq/pdqvar.h @@ -214,9 +214,9 @@ typedef struct mbuf PDQ_OS_DATABUF_T; #ifndef PDQ_OS_DATABUF_ALLOC #define PDQ_OS_DATABUF_ALLOC(pdq, b) do { \ PDQ_OS_DATABUF_T *x_m0; \ - MGETHDR(x_m0, M_DONTWAIT, MT_DATA); \ + MGETHDR(x_m0, M_NOWAIT, MT_DATA); \ if (x_m0 != NULL) { \ - MCLGET(x_m0, M_DONTWAIT); \ + MCLGET(x_m0, M_NOWAIT); \ if ((x_m0->m_flags & M_EXT) == 0) { \ m_free(x_m0); \ (b) = NULL; \ diff --git a/sys/dev/qlxgb/qla_os.c b/sys/dev/qlxgb/qla_os.c index 546a81a1875d..b22fa9fc7d7d 100644 --- a/sys/dev/qlxgb/qla_os.c +++ b/sys/dev/qlxgb/qla_os.c @@ -1063,7 +1063,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp) QL_DPRINT8((ha->pci_dev, "%s: EFBIG [%d]\n", __func__, m_head->m_pkthdr.len)); - m = m_defrag(m_head, M_DONTWAIT); + m = m_defrag(m_head, M_NOWAIT); if (m == NULL) { ha->err_tx_defrag++; m_freem(m_head); @@ -1405,7 +1405,7 @@ qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp, if (mp == NULL) { if (!jumbo) { - mp = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mp = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mp == NULL) { ha->err_m_getcl++; @@ -1416,7 +1416,7 @@ qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp, } mp->m_len = mp->m_pkthdr.len = MCLBYTES; } else { - mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (mp == NULL) { ha->err_m_getjcl++; diff --git a/sys/dev/ral/rt2560.c b/sys/dev/ral/rt2560.c index 9fdc15770c61..c67f1f790145 100644 --- a/sys/dev/ral/rt2560.c +++ b/sys/dev/ral/rt2560.c @@ -673,7 +673,7 @@ rt2560_alloc_rx_ring(struct rt2560_softc *sc, struct rt2560_rx_ring *ring, goto fail; } - data->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -1160,7 +1160,7 @@ rt2560_decryption_intr(struct rt2560_softc *sc) * mbuf. In the unlikely case that the old mbuf can't be * reloaded either, explicitly panic. */ - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { ifp->if_ierrors++; goto skip; @@ -1844,7 +1844,7 @@ rt2560_tx_data(struct rt2560_softc *sc, struct mbuf *m0, return error; } if (error != 0) { - mnew = m_defrag(m0, M_DONTWAIT); + mnew = m_defrag(m0, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); diff --git a/sys/dev/ral/rt2661.c b/sys/dev/ral/rt2661.c index c4e8fe79930d..8ae2515c21b9 100644 --- a/sys/dev/ral/rt2661.c +++ b/sys/dev/ral/rt2661.c @@ -682,7 +682,7 @@ rt2661_alloc_rx_ring(struct rt2661_softc *sc, struct rt2661_rx_ring *ring, goto fail; } - data->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -1030,7 +1030,7 @@ rt2661_rx_intr(struct rt2661_softc *sc) * mbuf. In the unlikely case that the old mbuf can't be * reloaded either, explicitly panic. */ - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { ifp->if_ierrors++; goto skip; @@ -1534,7 +1534,7 @@ rt2661_tx_data(struct rt2661_softc *sc, struct mbuf *m0, return error; } if (error != 0) { - mnew = m_defrag(m0, M_DONTWAIT); + mnew = m_defrag(m0, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); diff --git a/sys/dev/ral/rt2860.c b/sys/dev/ral/rt2860.c index 4a5aa259c0e6..4207d7556d27 100644 --- a/sys/dev/ral/rt2860.c +++ b/sys/dev/ral/rt2860.c @@ -743,7 +743,7 @@ rt2860_alloc_rx_ring(struct rt2860_softc *sc, struct rt2860_rx_ring *ring) goto fail; } - data->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -1237,7 +1237,7 @@ rt2860_rx_intr(struct rt2860_softc *sc) } #endif - m1 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m1 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m1 == NULL)) { ifp->if_ierrors++; goto skip; @@ -1625,7 +1625,7 @@ rt2860_tx(struct rt2860_softc *sc, struct mbuf *m, struct ieee80211_node *ni) } } if (__predict_false(error != 0)) { - m1 = m_defrag(m, M_DONTWAIT); + m1 = m_defrag(m, M_NOWAIT); if (m1 == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); @@ -1877,7 +1877,7 @@ rt2860_tx_raw(struct rt2860_softc *sc, struct mbuf *m, } } if (__predict_false(error != 0)) { - m1 = m_defrag(m, M_DONTWAIT); + m1 = m_defrag(m, M_NOWAIT); if (m1 == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 5f543181785b..9ec914af412f 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -758,7 +758,7 @@ re_diag(struct rl_softc *sc) u_int8_t src[] = { 0x00, 'w', 'o', 'r', 'l', 'd' }; /* Allocate a single mbuf */ - MGETHDR(m0, M_DONTWAIT, MT_DATA); + MGETHDR(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) return (ENOBUFS); @@ -1886,7 +1886,7 @@ re_newbuf(struct rl_softc *sc, int idx) uint32_t cmdstat; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); @@ -1950,7 +1950,7 @@ re_jumbo_newbuf(struct rl_softc *sc, int idx) uint32_t cmdstat; int error, nsegs; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MJUM9BYTES; @@ -2700,7 +2700,7 @@ re_encap(struct rl_softc *sc, struct mbuf **m_head) padlen = RL_MIN_FRAMELEN - (*m_head)->m_pkthdr.len; if (M_WRITABLE(*m_head) == 0) { /* Get a writable copy. */ - m_new = m_dup(*m_head, M_DONTWAIT); + m_new = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m_new == NULL) { *m_head = NULL; @@ -2710,7 +2710,7 @@ re_encap(struct rl_softc *sc, struct mbuf **m_head) } if ((*m_head)->m_next != NULL || M_TRAILINGSPACE(*m_head) < padlen) { - m_new = m_defrag(*m_head, M_DONTWAIT); + m_new = m_defrag(*m_head, M_NOWAIT); if (m_new == NULL) { m_freem(*m_head); *m_head = NULL; @@ -2734,7 +2734,7 @@ re_encap(struct rl_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->rl_ldata.rl_tx_mtag, txd->tx_dmamap, *m_head, segs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m_new = m_collapse(*m_head, M_DONTWAIT, RL_NTXSEGS); + m_new = m_collapse(*m_head, M_NOWAIT, RL_NTXSEGS); if (m_new == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/rt/if_rt.c b/sys/dev/rt/if_rt.c index 664978202a55..ebbbba5e9d57 100644 --- a/sys/dev/rt/if_rt.c +++ b/sys/dev/rt/if_rt.c @@ -892,7 +892,7 @@ rt_tx_data(struct rt_softc *sc, struct mbuf *m, int qid) "mbuf: ndmasegs=%d, len=%d, error=%d\n", ndmasegs, m->m_pkthdr.len, error); - m_d = m_collapse(m, M_DONTWAIT, 16); + m_d = m_collapse(m, M_NOWAIT, 16); if (m_d == NULL) { m_freem(m); m = NULL; @@ -1637,7 +1637,7 @@ rt_rx_eof(struct rt_softc *sc, int limit) nframes++; - mnew = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + mnew = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (mnew == NULL) { sc->rx_mbuf_alloc_errors++; @@ -2009,7 +2009,7 @@ rt_alloc_rx_ring(struct rt_softc *sc, struct rt_softc_rx_ring *ring) goto fail; } - data->m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + data->m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (data->m == NULL) { device_printf(sc->dev, "could not allocate Rx mbuf\n"); diff --git a/sys/dev/safe/safe.c b/sys/dev/safe/safe.c index 6095aa385766..396a93ccd9d3 100644 --- a/sys/dev/safe/safe.c +++ b/sys/dev/safe/safe.c @@ -1325,15 +1325,15 @@ safe_process(device_t dev, struct cryptop *crp, int hint) totlen = re->re_src_mapsize; if (re->re_src_m->m_flags & M_PKTHDR) { len = MHLEN; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && !m_dup_pkthdr(m, re->re_src_m, - M_DONTWAIT)) { + M_NOWAIT)) { m_free(m); m = NULL; } } else { len = MLEN; - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); } if (m == NULL) { safestats.st_nombuf++; @@ -1341,7 +1341,7 @@ safe_process(device_t dev, struct cryptop *crp, int hint) goto errout; } if (totlen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); safestats.st_nomcl++; @@ -1357,7 +1357,7 @@ safe_process(device_t dev, struct cryptop *crp, int hint) while (totlen > 0) { if (top) { - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(top); safestats.st_nombuf++; @@ -1368,7 +1368,7 @@ safe_process(device_t dev, struct cryptop *crp, int hint) len = MLEN; } if (top && totlen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { *mp = m; m_freem(top); diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 7ca46d31115c..dc1b6eb56474 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -863,7 +863,7 @@ get_rx_buf(struct sbni_softc *sc) { struct mbuf *m; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { if_printf(sc->ifp, "cannot allocate header mbuf\n"); return (0); @@ -877,7 +877,7 @@ get_rx_buf(struct sbni_softc *sc) */ if (ETHER_MAX_LEN + 2 > MHLEN) { /* Attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (0); diff --git a/sys/dev/sf/if_sf.c b/sys/dev/sf/if_sf.c index ec3aa27abb20..7280801bcf67 100644 --- a/sys/dev/sf/if_sf.c +++ b/sys/dev/sf/if_sf.c @@ -1455,7 +1455,7 @@ sf_newbuf(struct sf_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -2171,7 +2171,7 @@ sf_encap(struct sf_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sf_cdata.sf_tx_tag, map, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, SF_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, SF_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/sfxge/sfxge_dma.c b/sys/dev/sfxge/sfxge_dma.c index 076c7c68a9ad..f0d17544a0de 100644 --- a/sys/dev/sfxge/sfxge_dma.c +++ b/sys/dev/sfxge/sfxge_dma.c @@ -97,7 +97,7 @@ sfxge_dma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, goto err_out; } else if (err == EFBIG || seg_count >= maxsegs) { if (!defragged) { - m = m_defrag(*mp, M_DONTWAIT); + m = m_defrag(*mp, M_NOWAIT); if (m == NULL) { err = ENOBUFS; goto err_out; diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 801787a7add3..33f26d904ef4 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -262,7 +262,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, struct mbuf *mbuf) mbuf, dma_seg, &n_dma_seg, 0); if (rc == EFBIG) { /* Try again. */ - struct mbuf *new_mbuf = m_collapse(mbuf, M_DONTWAIT, + struct mbuf *new_mbuf = m_collapse(mbuf, M_NOWAIT, SFXGE_TX_MAPPING_MAX_SEG); if (new_mbuf == NULL) goto reject; diff --git a/sys/dev/sge/if_sge.c b/sys/dev/sge/if_sge.c index 68679fe89340..8482bb27486f 100644 --- a/sys/dev/sge/if_sge.c +++ b/sys/dev/sge/if_sge.c @@ -1083,7 +1083,7 @@ sge_newbuf(struct sge_softc *sc, int prod) SGE_LOCK_ASSERT(sc); cd = &sc->sge_cdata; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1407,7 +1407,7 @@ sge_encap(struct sge_softc *sc, struct mbuf **m_head) if (M_WRITABLE(*m_head) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1464,7 +1464,7 @@ sge_encap(struct sge_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sge_cdata.sge_txmbuf_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, SGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, SGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/sis/if_sis.c b/sys/dev/sis/if_sis.c index 2e93afa06424..456c3d4fd2b8 100644 --- a/sys/dev/sis/if_sis.c +++ b/sys/dev/sis/if_sis.c @@ -1411,7 +1411,7 @@ sis_newbuf(struct sis_softc *sc, struct sis_rxdesc *rxd) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = SIS_RXLEN; @@ -1771,7 +1771,7 @@ sis_encap(struct sis_softc *sc, struct mbuf **m_head) padlen = SIS_MIN_FRAMELEN - m->m_pkthdr.len; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1780,7 +1780,7 @@ sis_encap(struct sis_softc *sc, struct mbuf **m_head) *m_head = m; } if (m->m_next != NULL || M_TRAILINGSPACE(m) < padlen) { - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1799,7 +1799,7 @@ sis_encap(struct sis_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sis_tx_tag, txd->tx_dmamap, *m_head, segs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, SIS_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, SIS_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c index 836c34d4eab9..120810d3ca8f 100644 --- a/sys/dev/sk/if_sk.c +++ b/sys/dev/sk/if_sk.c @@ -965,7 +965,7 @@ sk_newbuf(sc_if, idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1010,7 +1010,7 @@ sk_jumbo_newbuf(sc_if, idx) bus_dmamap_t map; int nsegs; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); if ((m->m_flags & M_EXT) == 0) { @@ -2393,7 +2393,7 @@ sk_encap(sc_if, m_head) error = bus_dmamap_load_mbuf_sg(sc_if->sk_cdata.sk_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nseg, 0); if (error == EFBIG) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/smc/if_smc.c b/sys/dev/smc/if_smc.c index cece5b7e0691..06f6ca0a3c59 100644 --- a/sys/dev/smc/if_smc.c +++ b/sys/dev/smc/if_smc.c @@ -688,11 +688,11 @@ smc_task_rx(void *context, int pending) /* * Grab an mbuf and attach a cluster. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { break; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); break; diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index 8aef549dcc15..d7cc20d0b611 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -1056,7 +1056,7 @@ snread(struct ifnet *ifp) /* * Allocate a header mbuf from the kernel. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) goto out; @@ -1066,7 +1066,7 @@ snread(struct ifnet *ifp) /* * Attach an mbuf cluster */ - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); /* * Insist on getting a cluster diff --git a/sys/dev/snc/dp83932.c b/sys/dev/snc/dp83932.c index 17b67cd418f7..a41ceedca1f9 100644 --- a/sys/dev/snc/dp83932.c +++ b/sys/dev/snc/dp83932.c @@ -1108,7 +1108,7 @@ sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) * Our sonic_read() and sonic_get() require it. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == 0) return (0); m->m_pkthdr.rcvif = sc->sc_ifp; @@ -1119,7 +1119,7 @@ sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) while (datalen > 0) { if (top) { - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == 0) { m_freem(top); return (0); @@ -1127,7 +1127,7 @@ sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) len = MLEN; } if (datalen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { if (top) m_freem(top); return (0); diff --git a/sys/dev/ste/if_ste.c b/sys/dev/ste/if_ste.c index 742d497665b7..be2e8b2f2d00 100644 --- a/sys/dev/ste/if_ste.c +++ b/sys/dev/ste/if_ste.c @@ -1385,7 +1385,7 @@ ste_newbuf(struct ste_softc *sc, struct ste_chain_onefrag *rxc) bus_dmamap_t map; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1824,7 +1824,7 @@ ste_encap(struct ste_softc *sc, struct mbuf **m_head, struct ste_chain *txc) error = bus_dmamap_load_mbuf_sg(sc->ste_cdata.ste_tx_tag, txc->ste_map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, STE_MAXFRAGS); + m = m_collapse(*m_head, M_NOWAIT, STE_MAXFRAGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c index 7d22540c7161..96860a88827d 100644 --- a/sys/dev/stge/if_stge.c +++ b/sys/dev/stge/if_stge.c @@ -1081,7 +1081,7 @@ stge_encap(struct stge_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sc_cdata.stge_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, STGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, STGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1609,7 +1609,7 @@ stge_fixup_rx(struct stge_softc *sc, struct mbuf *m) m->m_data += ETHER_HDR_LEN; n = m; } else { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n != NULL) { bcopy(m->m_data, n->m_data, ETHER_HDR_LEN); m->m_data += ETHER_HDR_LEN; @@ -2439,7 +2439,7 @@ stge_newbuf(struct stge_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/dev/ti/if_ti.c b/sys/dev/ti/if_ti.c index d31af291c682..f8142b476018 100644 --- a/sys/dev/ti/if_ti.c +++ b/sys/dev/ti/if_ti.c @@ -1381,7 +1381,7 @@ ti_newbuf_std(struct ti_softc *sc, int i) struct ti_rx_desc *r; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1436,7 +1436,7 @@ ti_newbuf_mini(struct ti_softc *sc, int i) struct ti_rx_desc *r; int error, nsegs; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MHLEN; @@ -1495,7 +1495,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int i, struct mbuf *dummy) (void)dummy; - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MJUM9BYTES; @@ -1577,19 +1577,19 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old) } } else { /* Allocate the mbufs. */ - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { device_printf(sc->ti_dev, "mbuf allocation failed " "-- packet dropped!\n"); goto nobufs; } - MGET(m[NPAYLOAD], M_DONTWAIT, MT_DATA); + MGET(m[NPAYLOAD], M_NOWAIT, MT_DATA); if (m[NPAYLOAD] == NULL) { device_printf(sc->ti_dev, "cluster mbuf allocation " "failed -- packet dropped!\n"); goto nobufs; } - MCLGET(m[NPAYLOAD], M_DONTWAIT); + MCLGET(m[NPAYLOAD], M_NOWAIT); if ((m[NPAYLOAD]->m_flags & M_EXT) == 0) { device_printf(sc->ti_dev, "mbuf allocation failed " "-- packet dropped!\n"); @@ -1598,7 +1598,7 @@ ti_newbuf_jumbo(struct ti_softc *sc, int idx, struct mbuf *m_old) m[NPAYLOAD]->m_len = MCLBYTES; for (i = 0; i < NPAYLOAD; i++){ - MGET(m[i], M_DONTWAIT, MT_DATA); + MGET(m[i], M_NOWAIT, MT_DATA); if (m[i] == NULL) { device_printf(sc->ti_dev, "mbuf allocation " "failed -- packet dropped!\n"); @@ -3051,7 +3051,7 @@ ti_encap(struct ti_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->ti_cdata.ti_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nseg, 0); if (error == EFBIG) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/tl/if_tl.c b/sys/dev/tl/if_tl.c index 0c8725dbecce..30969e2aef15 100644 --- a/sys/dev/tl/if_tl.c +++ b/sys/dev/tl/if_tl.c @@ -1365,7 +1365,7 @@ tl_newbuf(sc, c) { struct mbuf *m_new = NULL; - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m_new == NULL) return(ENOBUFS); @@ -1806,13 +1806,13 @@ tl_encap(sc, c, m_head) if (m != NULL) { struct mbuf *m_new = NULL; - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { if_printf(ifp, "no memory for tx list\n"); return(1); } if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(m_new, M_DONTWAIT); + MCLGET(m_new, M_NOWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); if_printf(ifp, "no memory for tx list\n"); diff --git a/sys/dev/tsec/if_tsec.c b/sys/dev/tsec/if_tsec.c index 1d87b30d5e86..804177685823 100644 --- a/sys/dev/tsec/if_tsec.c +++ b/sys/dev/tsec/if_tsec.c @@ -727,7 +727,7 @@ tsec_start_locked(struct ifnet *ifp) csum_flags = m0->m_pkthdr.csum_flags; if (csum_flags) { - M_PREPEND(m0, sizeof(struct tsec_tx_fcb), M_DONTWAIT); + M_PREPEND(m0, sizeof(struct tsec_tx_fcb), M_NOWAIT); if (m0 == NULL) break; @@ -751,7 +751,7 @@ tsec_start_locked(struct ifnet *ifp) fcb_inserted = 1; } - mtmp = m_defrag(m0, M_DONTWAIT); + mtmp = m_defrag(m0, M_NOWAIT); if (mtmp) m0 = mtmp; @@ -1029,7 +1029,7 @@ tsec_new_rxbuf(bus_dma_tag_t tag, bus_dmamap_t map, struct mbuf **mbufp, KASSERT(mbufp != NULL, ("NULL mbuf pointer!")); - new_mbuf = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MCLBYTES); + new_mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MCLBYTES); if (new_mbuf == NULL) return (ENOBUFS); new_mbuf->m_len = new_mbuf->m_pkthdr.len = new_mbuf->m_ext.ext_size; diff --git a/sys/dev/tx/if_tx.c b/sys/dev/tx/if_tx.c index c977909222e5..66f54802a4fe 100644 --- a/sys/dev/tx/if_tx.c +++ b/sys/dev/tx/if_tx.c @@ -682,7 +682,7 @@ epic_ifstart_locked(struct ifnet * ifp) * recopy packet to a newly allocated mbuf cluster. */ if (error) { - m = m_defrag(m0, M_DONTWAIT); + m = m_defrag(m0, M_NOWAIT); if (m == NULL) { m_freem(m0); ifp->if_oerrors++; @@ -761,7 +761,7 @@ epic_rx_done(epic_softc_t *sc) m = buf->mbuf; /* Try to get an mbuf cluster. */ - buf->mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + buf->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (buf->mbuf == NULL) { buf->mbuf = m; desc->status = 0x8000; @@ -1495,7 +1495,7 @@ epic_queue_last_packet(epic_softc_t *sc) if ((desc->status & 0x8000) || (buf->mbuf != NULL)) return (EBUSY); - MGETHDR(m0, M_DONTWAIT, MT_DATA); + MGETHDR(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) return (ENOBUFS); @@ -1644,7 +1644,7 @@ epic_init_rings(epic_softc_t *sc) return (EFAULT); } - buf->mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + buf->mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (buf->mbuf == NULL) { epic_free_rings(sc); return (ENOBUFS); diff --git a/sys/dev/txp/if_txp.c b/sys/dev/txp/if_txp.c index e51489f54899..bc6f016ef633 100644 --- a/sys/dev/txp/if_txp.c +++ b/sys/dev/txp/if_txp.c @@ -1015,7 +1015,7 @@ txp_rxbuf_reclaim(struct txp_softc *sc) break; rbd = sc->sc_rxbufs + prod; bcopy((u_long *)&rbd->rb_vaddrlo, &sd, sizeof(sd)); - sd->sd_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sd->sd_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sd->sd_mbuf == NULL) break; sd->sd_mbuf->m_pkthdr.len = sd->sd_mbuf->m_len = MCLBYTES; @@ -1792,7 +1792,7 @@ txp_rxring_fill(struct txp_softc *sc) bcopy(&sd, (u_long *)&rbd->rb_vaddrlo, sizeof(sd)); KASSERT(sd->sd_mbuf == NULL, ("%s : Rx buffer ring corrupted", __func__)); - sd->sd_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + sd->sd_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sd->sd_mbuf == NULL) return (ENOMEM); sd->sd_mbuf->m_pkthdr.len = sd->sd_mbuf->m_len = MCLBYTES; @@ -2105,7 +2105,7 @@ txp_encap(struct txp_softc *sc, struct txp_tx_ring *r, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->sc_cdata.txp_tx_tag, sd->sd_map, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, TXP_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, TXP_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/ubsec/ubsec.c b/sys/dev/ubsec/ubsec.c index ee5a5b9de64c..40e6d5eccc2d 100644 --- a/sys/dev/ubsec/ubsec.c +++ b/sys/dev/ubsec/ubsec.c @@ -1375,18 +1375,18 @@ ubsec_process(device_t dev, struct cryptop *crp, int hint) ubsecstats.hst_unaligned++; totlen = q->q_src_mapsize; if (totlen >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, MT_DATA, + m = m_getcl(M_NOWAIT, MT_DATA, q->q_src_m->m_flags & M_PKTHDR); len = MCLBYTES; } else if (q->q_src_m->m_flags & M_PKTHDR) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); len = MHLEN; } else { - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); len = MLEN; } if (m && q->q_src_m->m_flags & M_PKTHDR && - !m_dup_pkthdr(m, q->q_src_m, M_DONTWAIT)) { + !m_dup_pkthdr(m, q->q_src_m, M_NOWAIT)) { m_free(m); m = NULL; } @@ -1402,11 +1402,11 @@ ubsec_process(device_t dev, struct cryptop *crp, int hint) while (totlen > 0) { if (totlen >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, + m = m_getcl(M_NOWAIT, MT_DATA, 0); len = MCLBYTES; } else { - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); len = MLEN; } if (m == NULL) { diff --git a/sys/dev/usb/misc/udbp.c b/sys/dev/usb/misc/udbp.c index 150985e8e781..56f86ae4897b 100644 --- a/sys/dev/usb/misc/udbp.c +++ b/sys/dev/usb/misc/udbp.c @@ -410,12 +410,12 @@ udbp_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) /* allocate new mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { goto tr_setup; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_freem(m); diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index 2f9929f92264..694e5a5c845a 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -1114,7 +1114,7 @@ axe_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset, return (EINVAL); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { ifp->if_iqdrops++; return (ENOMEM); diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index 780efe867895..6e0ce97c36f8 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -753,7 +753,7 @@ cdce_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) } } if (m->m_len != m->m_pkthdr.len) { - mt = m_defrag(m, M_DONTWAIT); + mt = m_defrag(m, M_NOWAIT); if (mt == NULL) { m_freem(m); ifp->if_oerrors++; @@ -1369,9 +1369,9 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) /* silently ignore this frame */ continue; } else if (temp > (int)(MHLEN - ETHER_ALIGN)) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); } else { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); } DPRINTFN(16, "frame %u, offset = %u, length = %u \n", diff --git a/sys/dev/usb/net/if_usie.c b/sys/dev/usb/net/if_usie.c index cdbdd6b9c4e3..f3dbd9e15430 100644 --- a/sys/dev/usb/net/if_usie.c +++ b/sys/dev/usb/net/if_usie.c @@ -796,7 +796,7 @@ usie_if_rx_callback(struct usb_xfer *xfer, usb_error_t error) tr_setup: if (sc->sc_rxm == NULL) { - sc->sc_rxm = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + sc->sc_rxm = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE /* could be bigger than MCLBYTES */ ); } if (sc->sc_rxm == NULL) { @@ -892,7 +892,7 @@ usie_if_rx_callback(struct usb_xfer *xfer, usb_error_t error) break; } /* copy aggregated frames to another mbuf */ - m0 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { DPRINTF("could not allocate mbuf\n"); err++; @@ -1388,7 +1388,7 @@ usie_cns_req(struct usie_softc *sc, uint32_t id, uint16_t obj) uint8_t *tmp; uint8_t cns_len; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { DPRINTF("could not allocate mbuf\n"); ifp->if_ierrors++; diff --git a/sys/dev/usb/net/uhso.c b/sys/dev/usb/net/uhso.c index 40dd1f4848cd..96c633533405 100644 --- a/sys/dev/usb/net/uhso.c +++ b/sys/dev/usb/net/uhso.c @@ -1619,7 +1619,7 @@ uhso_ifnet_read_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_TRANSFERRED: if (actlen > 0 && (sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)) { pc = usbd_xfer_get_frame(xfer, 0); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); usbd_copy_out(pc, 0, mtod(m, uint8_t *), actlen); m->m_pkthdr.len = m->m_len = actlen; /* Enqueue frame for further processing */ @@ -1752,13 +1752,13 @@ uhso_if_rxflush(void *arg) * Allocate a new mbuf for this IP packet and * copy the IP-packet into it. */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); memcpy(mtod(m, uint8_t *), mtod(m0, uint8_t *), iplen); m->m_pkthdr.len = m->m_len = iplen; /* Adjust the size of the original mbuf */ m_adj(m0, iplen); - m0 = m_defrag(m0, M_WAIT); + m0 = m_defrag(m0, M_WAITOK); UHSO_DPRINTF(3, "New mbuf=%p, len=%d/%d, m0=%p, " "m0_len=%d/%d\n", m, m->m_pkthdr.len, m->m_len, diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c index 2a7bddfdbe3d..2f1795915d80 100644 --- a/sys/dev/usb/net/usb_ethernet.c +++ b/sys/dev/usb/net/usb_ethernet.c @@ -557,7 +557,7 @@ uether_newbuf(void) { struct mbuf *m_new; - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m_new == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c index 93e66de82872..4c54aebf5f10 100644 --- a/sys/dev/usb/wlan/if_rum.c +++ b/sys/dev/usb/wlan/if_rum.c @@ -907,7 +907,7 @@ rum_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) goto tr_setup; } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF("could not allocate mbuf\n"); ifp->if_ierrors++; diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index d5c86a6e4788..3d2577f121a4 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -2595,7 +2595,7 @@ run_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) case USB_ST_SETUP: tr_setup: if (sc->rx_m == NULL) { - sc->rx_m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + sc->rx_m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE /* xfer can be bigger than MCLBYTES */); } if (sc->rx_m == NULL) { @@ -2669,7 +2669,7 @@ run_bulk_rx_callback(struct usb_xfer *xfer, usb_error_t error) } /* copy aggregated frames to another mbuf */ - m0 = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m0 = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m0 == NULL)) { DPRINTF("could not allocate mbuf\n"); ifp->if_ierrors++; diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c index b78d7bfa2fa5..25e62a7908ac 100644 --- a/sys/dev/usb/wlan/if_uath.c +++ b/sys/dev/usb/wlan/if_uath.c @@ -966,7 +966,7 @@ uath_alloc_data_list(struct uath_softc *sc, struct uath_data data[], dp->sc = sc; if (fillmbuf) { /* XXX check maxsz */ - dp->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + dp->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (dp->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -2611,7 +2611,7 @@ uath_data_rxeof(struct usb_xfer *xfer, struct uath_data *data, } sc->sc_intrx_len += chunklen; - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { DPRINTF(sc, UATH_DEBUG_RECV | UATH_DEBUG_RECV_ALL, "%s: can't get new mbuf, drop frame\n", __func__); diff --git a/sys/dev/usb/wlan/if_upgt.c b/sys/dev/usb/wlan/if_upgt.c index ab5b7173e855..ec2b0d9f5112 100644 --- a/sys/dev/usb/wlan/if_upgt.c +++ b/sys/dev/usb/wlan/if_upgt.c @@ -1493,7 +1493,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t *data, int pkglen, int *rssi) /* create mbuf which is suitable for strict alignment archs */ KASSERT((pkglen + ETHER_ALIGN) < MCLBYTES, ("A current mbuf storage is small (%d)", pkglen + ETHER_ALIGN)); - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "could not create RX mbuf\n"); return (NULL); diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c index 60096bda3856..14c28687a6cc 100644 --- a/sys/dev/usb/wlan/if_ural.c +++ b/sys/dev/usb/wlan/if_ural.c @@ -913,7 +913,7 @@ ural_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) goto tr_setup; } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { DPRINTF("could not allocate mbuf\n"); ifp->if_ierrors++; diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c index 45b72a272981..2c30f6766db1 100644 --- a/sys/dev/usb/wlan/if_urtw.c +++ b/sys/dev/usb/wlan/if_urtw.c @@ -1458,7 +1458,7 @@ urtw_alloc_data_list(struct urtw_softc *sc, struct urtw_data data[], dp->sc = sc; if (fillmbuf) { - dp->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + dp->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (dp->m == NULL) { device_printf(sc->sc_dev, "could not allocate rx mbuf\n"); @@ -3994,7 +3994,7 @@ urtw_rxeof(struct usb_xfer *xfer, struct urtw_data *data, int *rssi_p, noise = rx->noise; } - mnew = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mnew = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (mnew == NULL) { ifp->if_ierrors++; return (NULL); diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c index 0dac7ad88355..b960ce02a6fa 100644 --- a/sys/dev/usb/wlan/if_zyd.c +++ b/sys/dev/usb/wlan/if_zyd.c @@ -2191,9 +2191,9 @@ zyd_rx_data(struct usb_xfer *xfer, int offset, uint16_t len) ifp->if_ierrors++; return; } else if (rlen > (int)MHLEN) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { DPRINTF(sc, ZYD_DEBUG_RECV, "%s: could not allocate rx mbuf\n", device_get_nameunit(sc->sc_dev)); diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c index 402a55c5e228..cdd67e0bedd3 100644 --- a/sys/dev/vge/if_vge.c +++ b/sys/dev/vge/if_vge.c @@ -1239,7 +1239,7 @@ vge_newbuf(struct vge_softc *sc, int prod) bus_dmamap_t map; int i, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); /* @@ -1827,7 +1827,7 @@ vge_encap(struct vge_softc *sc, struct mbuf **m_head) padlen = VGE_MIN_FRAMELEN - m->m_pkthdr.len; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1836,7 +1836,7 @@ vge_encap(struct vge_softc *sc, struct mbuf **m_head) *m_head = m; } if (M_TRAILINGSPACE(m) < padlen) { - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1858,7 +1858,7 @@ vge_encap(struct vge_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->vge_cdata.vge_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, VGE_MAXTXSEGS); + m = m_collapse(*m_head, M_NOWAIT, VGE_MAXTXSEGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index e6fef9094db2..b2ebbf07716a 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1103,7 +1103,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) clsize = sc->vtnet_rx_mbuf_size; - m_head = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, clsize); + m_head = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, clsize); if (m_head == NULL) goto fail; @@ -1115,7 +1115,7 @@ vtnet_alloc_rxbuf(struct vtnet_softc *sc, int nbufs, struct mbuf **m_tailp) ("chained Rx mbuf requested without LRO_NOMRG")); for (i = 1; i < nbufs; i++) { - m = m_getjcl(M_DONTWAIT, MT_DATA, 0, clsize); + m = m_getjcl(M_NOWAIT, MT_DATA, 0, clsize); if (m == NULL) goto fail; @@ -1927,7 +1927,7 @@ vtnet_enqueue_txbuf(struct vtnet_softc *sc, struct mbuf **m_head, if (collapsed) goto fail; - m = m_collapse(m, M_DONTWAIT, VTNET_MAX_TX_SEGS - 1); + m = m_collapse(m, M_NOWAIT, VTNET_MAX_TX_SEGS - 1); if (m == NULL) goto fail; diff --git a/sys/dev/vr/if_vr.c b/sys/dev/vr/if_vr.c index 7054042e5753..00e726909ff9 100644 --- a/sys/dev/vr/if_vr.c +++ b/sys/dev/vr/if_vr.c @@ -1224,7 +1224,7 @@ vr_newbuf(struct vr_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1800,7 +1800,7 @@ vr_encap(struct vr_softc *sc, struct mbuf **m_head) * to copy, just do it all the time. */ if ((sc->vr_quirks & VR_Q_NEEDALIGN) != 0) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1819,7 +1819,7 @@ vr_encap(struct vr_softc *sc, struct mbuf **m_head) padlen = VR_MIN_FRAMELEN - m->m_pkthdr.len; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); m_freem(*m_head); if (m == NULL) { *m_head = NULL; @@ -1828,7 +1828,7 @@ vr_encap(struct vr_softc *sc, struct mbuf **m_head) *m_head = m; } if (m->m_next != NULL || M_TRAILINGSPACE(m) < padlen) { - m = m_defrag(m, M_DONTWAIT); + m = m_defrag(m, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1850,7 +1850,7 @@ vr_encap(struct vr_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->vr_cdata.vr_tx_tag, txd->tx_dmamap, *m_head, txsegs, &nsegs, BUS_DMA_NOWAIT); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, VR_MAXFRAGS); + m = m_collapse(*m_head, M_NOWAIT, VR_MAXFRAGS); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/dev/vte/if_vte.c b/sys/dev/vte/if_vte.c index 7865ff23b9b3..dfc06e53609a 100644 --- a/sys/dev/vte/if_vte.c +++ b/sys/dev/vte/if_vte.c @@ -1034,7 +1034,7 @@ vte_encap(struct vte_softc *sc, struct mbuf **m_head) if (M_WRITABLE(m) == 0) { if (m->m_next != NULL || padlen > 0) { /* Get a writable copy. */ - m = m_dup(*m_head, M_DONTWAIT); + m = m_dup(*m_head, M_NOWAIT); /* Release original mbuf chains. */ m_freem(*m_head); if (m == NULL) { @@ -1046,7 +1046,7 @@ vte_encap(struct vte_softc *sc, struct mbuf **m_head) } if (m->m_next != NULL) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1057,7 +1057,7 @@ vte_encap(struct vte_softc *sc, struct mbuf **m_head) if (padlen > 0) { if (M_TRAILINGSPACE(m) < padlen) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -1422,7 +1422,7 @@ vte_newbuf(struct vte_softc *sc, struct vte_rxdesc *rxd) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; @@ -1870,7 +1870,7 @@ vte_init_tx_ring(struct vte_softc *sc) /* Pre-allocate TX mbufs for deep copy. */ if (tx_deep_copy != 0) { for (i = 0; i < VTE_TX_RING_CNT; i++) { - sc->vte_cdata.vte_txmbufs[i] = m_getcl(M_DONTWAIT, + sc->vte_cdata.vte_txmbufs[i] = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (sc->vte_cdata.vte_txmbufs[i] == NULL) return (ENOBUFS); diff --git a/sys/dev/vx/if_vx.c b/sys/dev/vx/if_vx.c index 090bb0c5c9e7..acb9c2fb3123 100644 --- a/sys/dev/vx/if_vx.c +++ b/sys/dev/vx/if_vx.c @@ -811,7 +811,7 @@ vx_get(struct vx_softc *sc, u_int totlen) m = sc->vx_mb[sc->vx_next_mb]; sc->vx_mb[sc->vx_next_mb] = NULL; if (m == NULL) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return NULL; } else { @@ -853,7 +853,7 @@ vx_get(struct vx_softc *sc, u_int totlen) m = sc->vx_mb[sc->vx_next_mb]; sc->vx_mb[sc->vx_next_mb] = NULL; if (m == NULL) { - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(top); return NULL; @@ -864,7 +864,7 @@ vx_get(struct vx_softc *sc, u_int totlen) len = MLEN; } if (totlen >= MINCLSIZE) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (m->m_flags & M_EXT) len = MCLBYTES; } @@ -1044,7 +1044,7 @@ vx_mbuf_fill(void *sp) i = sc->vx_last_mb; do { if (sc->vx_mb[i] == NULL) - MGET(sc->vx_mb[i], M_DONTWAIT, MT_DATA); + MGET(sc->vx_mb[i], M_NOWAIT, MT_DATA); if (sc->vx_mb[i] == NULL) break; i = (i + 1) % MAX_MBS; diff --git a/sys/dev/vxge/vxge.c b/sys/dev/vxge/vxge.c index 9948801a5443..c35d84bb8404 100644 --- a/sys/dev/vxge/vxge.c +++ b/sys/dev/vxge/vxge.c @@ -1192,7 +1192,7 @@ vxge_rx_rxd_1b_set(vxge_vpath_t *vpath, vxge_hal_rxd_h rxdh, void *dtr_priv) vxge_dev_t *vdev = vpath->vdev; - mbuf_pkt = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, vdev->rx_mbuf_sz); + mbuf_pkt = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, vdev->rx_mbuf_sz); if (!mbuf_pkt) { err = ENOBUFS; VXGE_DRV_STATS(vpath, rx_no_buf); @@ -3011,7 +3011,7 @@ vxge_dma_mbuf_coalesce(bus_dma_tag_t dma_tag_tx, bus_dmamap_t dma_map, dma_buffers, num_segs, BUS_DMA_NOWAIT); if (err == EFBIG) { /* try to defrag, too many segments */ - mbuf_pkt = m_defrag(*m_headp, M_DONTWAIT); + mbuf_pkt = m_defrag(*m_headp, M_NOWAIT); if (mbuf_pkt == NULL) { err = ENOBUFS; goto _exit0; diff --git a/sys/dev/wb/if_wb.c b/sys/dev/wb/if_wb.c index 0d0dd5599746..8bc28eabcf01 100644 --- a/sys/dev/wb/if_wb.c +++ b/sys/dev/wb/if_wb.c @@ -842,7 +842,7 @@ wb_newbuf(sc, c, m) struct mbuf *m_new = NULL; if (m == NULL) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) return(ENOBUFS); m_new->m_data = c->wb_buf; @@ -1192,11 +1192,11 @@ wb_encap(sc, c, m_head) if (m != NULL) { struct mbuf *m_new = NULL; - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) return(1); if (m_head->m_pkthdr.len > MHLEN) { - MCLGET(m_new, M_DONTWAIT); + MCLGET(m_new, M_NOWAIT); if (!(m_new->m_flags & M_EXT)) { m_freem(m_new); return(1); diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index cae3b6fe841f..2ca3c8cf8fa1 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -1360,9 +1360,9 @@ wi_rx_intr(struct wi_softc *sc) } if (off + len > MHLEN) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); ifp->if_ierrors++; diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c index a95997e4225e..c6db4b9f15ae 100644 --- a/sys/dev/wl/if_wl.c +++ b/sys/dev/wl/if_wl.c @@ -1094,7 +1094,7 @@ wlread(struct wl_softc *sc, u_short fd_p) /* * Allocate a cluster'd mbuf to receive the packet. */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { if (wlhwrst(sc) != TRUE) { sc->hacr &= ~HACR_INTRON; diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 365e03e4d36e..465c140d1d86 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -989,7 +989,7 @@ wpi_alloc_rx_ring(struct wpi_softc *sc, struct wpi_rx_ring *ring) __func__, error); goto fail; } - m = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (m == NULL) { device_printf(sc->sc_dev, "%s: could not allocate rx mbuf\n", __func__); @@ -1493,7 +1493,7 @@ wpi_rx_intr(struct wpi_softc *sc, struct wpi_rx_desc *desc, } /* XXX don't need mbuf, just dma buffer */ - mnew = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); + mnew = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE); if (mnew == NULL) { DPRINTFN(WPI_DEBUG_RX, ("%s: no mbuf to restock ring\n", __func__)); @@ -1975,7 +1975,7 @@ wpi_tx_data(struct wpi_softc *sc, struct mbuf *m0, struct ieee80211_node *ni, } if (error != 0) { /* XXX use m_collapse */ - mnew = m_defrag(m0, M_DONTWAIT); + mnew = m_defrag(m0, M_NOWAIT); if (mnew == NULL) { device_printf(sc->sc_dev, "could not defragment mbuf\n"); @@ -2575,7 +2575,7 @@ wpi_scan(struct wpi_softc *sc) desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; - data->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + data->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (data->m == NULL) { device_printf(sc->sc_dev, "could not allocate mbuf for scan command\n"); diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c index 6adc5b328e48..1a77274de2f0 100644 --- a/sys/dev/wtap/if_wtap.c +++ b/sys/dev/wtap/if_wtap.c @@ -100,7 +100,7 @@ wtap_node_write(struct cdev *dev, struct uio *uio, int ioflag) return (err); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); m_copyback(m, 0, buf_len, buf); CURVNET_SET(TD_TO_VNET(curthread)); @@ -241,7 +241,7 @@ wtap_beacon_intrp(void *arg) * the beacon frame changed size (probably because * of the TIM bitmap). */ - m = m_dup(avp->beacon, M_DONTWAIT); + m = m_dup(avp->beacon, M_NOWAIT); if (ieee80211_beacon_update(avp->bf_node, &avp->av_boff, m, 0)) { printf("%s, need to remap the memory because the beacon frame" " changed size.\n",__func__); diff --git a/sys/dev/wtap/plugins/visibility.c b/sys/dev/wtap/plugins/visibility.c index 9d2624cf8a31..a73d5203200f 100644 --- a/sys/dev/wtap/plugins/visibility.c +++ b/sys/dev/wtap/plugins/visibility.c @@ -151,7 +151,7 @@ visibility_work(struct wtap_plugin *plugin, struct packet *p) struct wtap_softc *sc = hal->hal_devs[k]; struct mbuf *m = - m_dup(p->m, M_DONTWAIT); + m_dup(p->m, M_NOWAIT); DWTAP_PRINTF("[%d] duplicated old_m=%p" "to new_m=%p\n", p->id, p->m, m); #if 0 diff --git a/sys/dev/xe/if_xe.c b/sys/dev/xe/if_xe.c index 57411bac7f1e..855c8c166433 100644 --- a/sys/dev/xe/if_xe.c +++ b/sys/dev/xe/if_xe.c @@ -757,14 +757,14 @@ xe_rxintr(struct xe_softc *scp, uint8_t rst0) * read 16-bit words). XXX - Surely there's a * better way to do this alignment? */ - MGETHDR(mbp, M_DONTWAIT, MT_DATA); + MGETHDR(mbp, M_NOWAIT, MT_DATA); if (mbp == NULL) { ifp->if_iqdrops++; continue; } if (len + 3 > MHLEN) { - MCLGET(mbp, M_DONTWAIT); + MCLGET(mbp, M_NOWAIT); if ((mbp->m_flags & M_EXT) == 0) { m_freem(mbp); ifp->if_iqdrops++; diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index 7dd5639881bf..856c98885aa2 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -831,13 +831,13 @@ network_alloc_rx_buffers(struct netfront_info *sc) */ batch_target = sc->rx_target - (req_prod - sc->rx.rsp_cons); for (i = mbufq_len(&sc->xn_rx_batch); i < batch_target; i++) { - MGETHDR(m_new, M_DONTWAIT, MT_DATA); + MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) { printf("%s: MGETHDR failed\n", __func__); goto no_mbuf; } - m_cljget(m_new, M_DONTWAIT, MJUMPAGESIZE); + m_cljget(m_new, M_NOWAIT, MJUMPAGESIZE); if ((m_new->m_flags & M_EXT) == 0) { printf("%s: m_cljget failed\n", __func__); m_freem(m_new); @@ -1530,7 +1530,7 @@ xn_assemble_tx_request(struct netfront_info *sc, struct mbuf *m_head) * the Linux network stack. */ if (nfrags > sc->maxfrags) { - m = m_defrag(m_head, M_DONTWAIT); + m = m_defrag(m_head, M_NOWAIT); if (!m) { /* * Defrag failed, so free the mbuf and diff --git a/sys/dev/xl/if_xl.c b/sys/dev/xl/if_xl.c index 7b2e23fb45eb..90bc0c02cef5 100644 --- a/sys/dev/xl/if_xl.c +++ b/sys/dev/xl/if_xl.c @@ -1762,7 +1762,7 @@ xl_newbuf(struct xl_softc *sc, struct xl_chain_onefrag *c) XL_LOCK_ASSERT(sc); - m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m_new == NULL) return (ENOBUFS); @@ -2358,7 +2358,7 @@ xl_encap(struct xl_softc *sc, struct xl_chain *c, struct mbuf **m_head) * and would waste cycles. */ if (error) { - m_new = m_collapse(*m_head, M_DONTWAIT, XL_MAXFRAGS); + m_new = m_collapse(*m_head, M_NOWAIT, XL_MAXFRAGS); if (m_new == NULL) { m_freem(*m_head); *m_head = NULL; From 5e48557ef01d0f0c1294925839fb45aaba700b45 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Tue, 4 Dec 2012 09:53:09 +0000 Subject: [PATCH 017/513] Document that bind(2) can fail with EAFNOSUPPORT. Reviewed by: glebius --- lib/libc/sys/bind.2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libc/sys/bind.2 b/lib/libc/sys/bind.2 index fecc5fa5a636..896b0053cad2 100644 --- a/lib/libc/sys/bind.2 +++ b/lib/libc/sys/bind.2 @@ -94,6 +94,8 @@ is not a socket. The specified address is not available from the local machine. .It Bq Er EADDRINUSE The specified address is already in use. +.It Bq Er EAFNOSUPPORT +Addresses in the specified address family cannot be used with this socket. .It Bq Er EACCES The requested address is protected, and the current user has inadequate permission to access it. From 3fa6535388fc69e0e5f63cde8158a2474fa6f44f Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 4 Dec 2012 10:24:50 +0000 Subject: [PATCH 018/513] No need to be root when running with -t or -d. --- sbin/route/route.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index 58a92e117a0c..2d470e14bc28 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -365,7 +365,7 @@ flushroutes(int argc, char *argv[]) struct fibl *fl; int error; - if (uid != 0 && !debugonly) { + if (uid != 0 && !debugonly && !tflag) { errx(EX_NOPERM, "must be root to alter routing table"); } shutdown(s, SHUT_RD); /* Don't want to read back our messages */ @@ -727,7 +727,7 @@ newroute(int argc, char **argv) const char *dest, *gateway, *errmsg; int key, error, flags, nrflags, fibnum; - if (uid != 0) { + if (uid != 0 && !debugonly && !tflag) { errx(EX_NOPERM, "must be root to alter routing table"); } From f1e17e139df71f1ffe0331965021013b9313b82e Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 4 Dec 2012 11:10:01 +0000 Subject: [PATCH 019/513] Flush stdout after RTM_IFANNOUNCE message. PR: bin/151600 Submitted by: Eric van Gyzen --- sbin/route/route.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sbin/route/route.c b/sbin/route/route.c index 2d470e14bc28..107c66fa67ce 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1632,6 +1632,7 @@ print_rtmsg(struct rt_msghdr *rtm, size_t msglen) break; } printf("\n"); + fflush(stdout); break; default: From dee63064805268d33cdba42a568c1e8f4383ebd8 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 4 Dec 2012 12:39:26 +0000 Subject: [PATCH 020/513] Change /usr/libexec/ld-elf.so.1 to point at ../../libexec/ld-elf.so.1 instead of /libexec/ld-elf.so.1. Below in the Makefile we execute 'chflags noschg ${DESTDIR}/usr/libexec/ld-elf.so.1', which follows symlink and removes 'schg' flag from system's /libexec/ld-elf.so.1 instead of the one in DESTDIR. It is also more friendly to use replative paths in symlink in case of jail/chroot environments. Obtained from: WHEEL Systems MFC after: 2 weeks --- libexec/rtld-elf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 80737e8c4409..487a0984cf68 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -27,7 +27,7 @@ LDFLAGS+= -nostdlib -e .rtld_start WARNS?= 2 INSTALLFLAGS= -C -b PRECIOUSPROG= -BINDIR= /libexec +BINDIR= ../../libexec SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} MLINKS= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 From f31c1e3fd3e4a54abb6d5cb4db86995c2bf9ba5a Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 4 Dec 2012 12:51:33 +0000 Subject: [PATCH 021/513] Do not change entire BINDIR, it might be needed later, just change symlink target. MFC after: 2 weeks --- libexec/rtld-elf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 487a0984cf68..9a7170f6343f 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -27,8 +27,8 @@ LDFLAGS+= -nostdlib -e .rtld_start WARNS?= 2 INSTALLFLAGS= -C -b PRECIOUSPROG= -BINDIR= ../../libexec -SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} +BINDIR= /libexec +SYMLINKS= ../..${BINDIR}/${PROG} /usr/libexec/${PROG} MLINKS= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 From c1e231bcbbf3eb4f50d264b97b7804932b68d4cc Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 4 Dec 2012 14:07:17 +0000 Subject: [PATCH 022/513] Fix typo. Submitted by: bjk MFC after: 3 days --- share/man/man9/taskqueue.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9 index cce1fba29477..c8e21d37ebf5 100644 --- a/share/man/man9/taskqueue.9 +++ b/share/man/man9/taskqueue.9 @@ -183,7 +183,7 @@ scheduling. If the .Va ticks argument is negative, the already scheduled enqueueing is not re-scheduled. -Otherwise, the task is schedules for enqueueing in the future, +Otherwise, the task is scheduled for enqueueing in the future, after the absolute value of .Va ticks is passed. From 456b64c4433386b36977e58f4f8ffddd489131fe Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Tue, 4 Dec 2012 14:36:01 +0000 Subject: [PATCH 023/513] Use absolute path for /usr/libexec/ld-elf.so.1 symlink. Requested by: kan, kib Use -h flags for chflags, so we won't remove 'schg' flag from system's /libexec/ld-elf.so.1. MFC after: 2 weeks --- libexec/rtld-elf/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index 9a7170f6343f..e41477d65190 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -28,7 +28,7 @@ WARNS?= 2 INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec -SYMLINKS= ../..${BINDIR}/${PROG} /usr/libexec/${PROG} +SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} MLINKS= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 @@ -62,7 +62,7 @@ SYMBOL_MAPS+= ${.CURDIR}/${RTLD_ARCH}/Symbol.map # Fixup the existing binary that's there so we can symlink over it. beforeinstall: .if exists(${DESTDIR}/usr/libexec/${PROG}) - -chflags noschg ${DESTDIR}/usr/libexec/${PROG} + -chflags -h noschg ${DESTDIR}/usr/libexec/${PROG} .endif .PATH: ${.CURDIR}/${RTLD_ARCH} From 273e3bbfe6efca53aafcbd3f5aab7cafef426a8a Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Tue, 4 Dec 2012 16:54:43 +0000 Subject: [PATCH 024/513] libc: Use the new 'e' fopen() mode option to simplify fstab.c. No functional change is intended. --- lib/libc/gen/fstab.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c index b68db2effb6d..6a77abd635cf 100644 --- a/lib/libc/gen/fstab.c +++ b/lib/libc/gen/fstab.c @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -255,8 +254,6 @@ getfsfile(const char *name) int setfsent(void) { - int fd; - if (_fs_fp) { rewind(_fs_fp); LineNo = 0; @@ -268,18 +265,11 @@ setfsent(void) else setfstab(getenv("PATH_FSTAB")); } - fd = _open(path_fstab, O_RDONLY | O_CLOEXEC); - if (fd == -1) { - error(errno); - return (0); - } - _fs_fp = fdopen(fd, "r"); - if (_fs_fp != NULL) { + if ((_fs_fp = fopen(path_fstab, "re")) != NULL) { LineNo = 0; return (1); } error(errno); - _close(fd); return (0); } From 5c9fa630f66e0e8a54074c21b66a526503d9509f Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Tue, 4 Dec 2012 17:12:23 +0000 Subject: [PATCH 025/513] - Fix LOR in sa6_recoverscope() in rt_msg2()[1]. - Check V_deembed_scopeid before checking if sa_family == AF_INET6. - Fix scope id handing in route(8)[2] and ifconfig(8). Reported by: rpaulo[1], Mateusz Guzik[1], peter[2] --- sbin/ifconfig/af_inet6.c | 5 +-- sbin/route/route.c | 10 ++++++ sys/net/rtsock.c | 71 ++++++++++++++++++---------------------- 3 files changed, 45 insertions(+), 41 deletions(-) diff --git a/sbin/ifconfig/af_inet6.c b/sbin/ifconfig/af_inet6.c index a9ad86724453..5911a941212c 100644 --- a/sbin/ifconfig/af_inet6.c +++ b/sbin/ifconfig/af_inet6.c @@ -251,8 +251,9 @@ in6_status(int s __unused, const struct ifaddrs *ifa) if ((flags6 & IN6_IFF_TEMPORARY) != 0) printf("temporary "); - if (sin->sin6_scope_id) - printf("scopeid 0x%x ", sin->sin6_scope_id); + if (((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id) + printf("scopeid 0x%x ", + ((struct sockaddr_in6 *)(ifa->ifa_addr))->sin6_scope_id); if (ip6lifetime && (lifetime.ia6t_preferred || lifetime.ia6t_expire)) { printf("pltime "); diff --git a/sbin/route/route.c b/sbin/route/route.c index 107c66fa67ce..b63ce6377451 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1208,6 +1208,16 @@ getaddr(int which, char *str, struct hostent **hpp) exit(1); } memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); +#ifdef __KAME__ + if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) || + IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) && + su->sin6.sin6_scope_id) { + *(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] = + htons(su->sin6.sin6_scope_id); + su->sin6.sin6_scope_id = 0; + } +#endif freeaddrinfo(res); if (q != NULL) *q++ = '/'; diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 1ff6bcab444b..d1bf200619ed 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -804,28 +804,31 @@ route_output(struct mbuf *m, struct socket *so) } info.rti_info[RTAX_DST] = rt_key(rt); #ifdef INET6 - switch (rt_key(rt)->sa_family) { - case AF_INET6: - if (V_deembed_scopeid == 0) + if (V_deembed_scopeid) { + switch (rt_key(rt)->sa_family) { + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&ss_dst; + bcopy(rt_key(rt), sin6, sizeof(*sin6)); + if (sa6_recoverscope(sin6) == 0) + info.rti_info[RTAX_DST] = + (struct sockaddr *)sin6; break; - sin6 = (struct sockaddr_in6 *)&ss_dst; - bcopy(rt_key(rt), sin6, sizeof(*sin6)); - if (sa6_recoverscope(sin6) == 0) - info.rti_info[RTAX_DST] = - (struct sockaddr *)sin6; - break; + } } #endif info.rti_info[RTAX_GATEWAY] = rt->rt_gateway; #ifdef INET6 - switch (rt->rt_gateway->sa_family) { - case AF_INET6: - sin6 = (struct sockaddr_in6 *)&ss_gw; - bcopy(rt->rt_gateway, sin6, sizeof(*sin6)); - if (sa6_recoverscope(sin6) == 0) - info.rti_info[RTAX_GATEWAY] = - (struct sockaddr *)sin6; - break; + if (V_deembed_scopeid) { + switch (rt->rt_gateway->sa_family) { + case AF_INET6: + sin6 = (struct sockaddr_in6 *)&ss_gw; + bcopy(rt->rt_gateway, sin6, + sizeof(*sin6)); + if (sa6_recoverscope(sin6) == 0) + info.rti_info[RTAX_GATEWAY] = + (struct sockaddr *)sin6; + break; + } } #endif info.rti_info[RTAX_NETMASK] = rt_mask(rt); @@ -1130,15 +1133,11 @@ rt_msg1(int type, struct rt_addrinfo *rtinfo) rtinfo->rti_addrs |= (1 << i); dlen = SA_SIZE(sa); #ifdef INET6 - switch (sa->sa_family) { - case AF_INET6: - if (V_deembed_scopeid == 0) - break; + if (V_deembed_scopeid && sa->sa_family == AF_INET6) { sin6 = (struct sockaddr_in6 *)&ss; bcopy(sa, sin6, sizeof(*sin6)); if (sa6_recoverscope(sin6) == 0) sa = (struct sockaddr *)sin6; - break; } #endif m_copyback(m, len, dlen, (caddr_t)sa); @@ -1219,15 +1218,11 @@ rt_msg2(int type, struct rt_addrinfo *rtinfo, caddr_t cp, struct walkarg *w) rtinfo->rti_addrs |= (1 << i); dlen = SA_SIZE(sa); #ifdef INET6 - switch (sa->sa_family) { - case AF_INET6: - if (V_deembed_scopeid == 0) - break; + if (V_deembed_scopeid && sa->sa_family == AF_INET6) { sin6 = (struct sockaddr_in6 *)&ss; bcopy(sa, sin6, sizeof(*sin6)); if (sa6_recoverscope(sin6) == 0) sa = (struct sockaddr *)sin6; - break; } #endif if (cp) { @@ -1594,18 +1589,16 @@ sysctl_dumpentry(struct radix_node *rn, void *vw) info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr; } #ifdef INET6 - for (i = 0; i < RTAX_MAX; i++) { - if (info.rti_info[i] == NULL) - continue; - switch (info.rti_info[i]->sa_family) { - case AF_INET6: - if (V_deembed_scopeid == 0) - break; + if (V_deembed_scopeid) { + for (i = 0; i < RTAX_MAX; i++) { + if (info.rti_info[i] == NULL) + continue; + if (info.rti_info[i]->sa_family != AF_INET6) + continue; sin6 = (struct sockaddr_in6 *)&ss[i]; bcopy(info.rti_info[i], sin6, sizeof(*sin6)); if (sa6_recoverscope(sin6) == 0) info.rti_info[i] = (struct sockaddr *)sin6; - break; } } #endif @@ -1811,7 +1804,7 @@ sysctl_iflist(int af, struct walkarg *w) int len, error = 0; bzero((caddr_t)&info, sizeof(info)); - IFNET_RLOCK(); + IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; @@ -1856,7 +1849,7 @@ sysctl_iflist(int af, struct walkarg *w) done: if (ifp != NULL) IF_ADDR_RUNLOCK(ifp); - IFNET_RUNLOCK(); + IFNET_RUNLOCK_NOSLEEP(); return (error); } @@ -1870,7 +1863,7 @@ sysctl_ifmalist(int af, struct walkarg *w) struct ifaddr *ifa; bzero((caddr_t)&info, sizeof(info)); - IFNET_RLOCK(); + IFNET_RLOCK_NOSLEEP(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; @@ -1905,7 +1898,7 @@ sysctl_ifmalist(int af, struct walkarg *w) IF_ADDR_RUNLOCK(ifp); } done: - IFNET_RUNLOCK(); + IFNET_RUNLOCK_NOSLEEP(); return (error); } From 7c283ae8603134c3aa4352b6ee5d5f879f7c3af5 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 4 Dec 2012 20:05:01 +0000 Subject: [PATCH 026/513] Fix fallout from r243019, which broke parsing of shortened network prefixes. Reported and tested by: delphij --- sbin/route/route.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sbin/route/route.c b/sbin/route/route.c index b63ce6377451..809dc9f08404 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -1032,6 +1032,13 @@ inet_makenetandmask(u_long net, struct sockaddr_in *sin, u_long bits) rtm_addrs |= RTA_NETMASK; + /* + * MSB of net should be meaningful. 0/0 is exception. + */ + if (net > 0) + while ((net & 0xff000000) == 0) + net <<= 8; + /* * If no /xx was specified we must calculate the * CIDR address. From 9bdf6ccab3f1b80221eada9fe11b62e899de8e7f Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 4 Dec 2012 20:49:04 +0000 Subject: [PATCH 027/513] Do not allocate buffer of the 255 bytes length on the stack. Reported and tested by: sig6247@gmail.com MFC after: 1 week --- sys/kern/vfs_mountroot.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 83948f24e669..147926e3e1c1 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -672,10 +672,11 @@ parse_mount_dev_present(const char *dev) return (error != 0) ? 0 : 1; } +#define ERRMSGL 255 static int parse_mount(char **conf) { - char errmsg[255]; + char *errmsg; struct mntarg *ma; char *dev, *fs, *opts, *tok; int delay, error, timeout; @@ -707,7 +708,7 @@ parse_mount(char **conf) printf("Trying to mount root from %s:%s [%s]...\n", fs, dev, (opts != NULL) ? opts : ""); - bzero(errmsg, sizeof(errmsg)); + errmsg = malloc(ERRMSGL, M_TEMP, M_WAITOK | M_ZERO); if (vfs_byname(fs) == NULL) { strlcpy(errmsg, "unknown file system", sizeof(errmsg)); @@ -734,7 +735,7 @@ parse_mount(char **conf) ma = mount_arg(ma, "fstype", fs, -1); ma = mount_arg(ma, "fspath", "/", -1); ma = mount_arg(ma, "from", dev, -1); - ma = mount_arg(ma, "errmsg", errmsg, sizeof(errmsg)); + ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); ma = mount_arg(ma, "ro", NULL, 0); ma = parse_mountroot_options(ma, opts); error = kernel_mount(ma, MNT_ROOTFS); @@ -748,11 +749,13 @@ parse_mount(char **conf) printf(".\n"); } free(fs, M_TEMP); + free(errmsg, M_TEMP); if (opts != NULL) free(opts, M_TEMP); /* kernel_mount can return -1 on error. */ return ((error < 0) ? EDOOFUS : error); } +#undef ERRMSGL static int vfs_mountroot_parse(struct sbuf *sb, struct mount *mpdevfs) From f7e50ea72295c39c2d6c2a092171941d095a0230 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Tue, 4 Dec 2012 20:49:39 +0000 Subject: [PATCH 028/513] Fix a race between kern_setitimer() and realitexpire(), where the callout is started before kern_setitimer() acquires process mutex, but looses a race and kern_setitimer() gets the process mutex before the callout. Then, assuming that new specified struct itimerval has it_interval zero, but it_value non-zero, the callout, after it starts executing again, clears p->p_realtimer.it_value, but kern_setitimer() already rescheduled the callout. As the result of the race, both p_realtimer is zero, and the callout is rescheduled. Then, in the exit1(), the exit code sees that it_value is zero and does not even try to stop the callout. This allows the struct proc to be reused and eventually the armed callout is re-initialized. The consequence is the corrupted callwheel tailq. Use process mutex to interlock the callout start, which fixes the race. Reported and tested by: pho Reviewed by: jhb MFC after: 2 weeks --- sys/kern/init_main.c | 2 +- sys/kern/kern_fork.c | 2 +- sys/kern/kern_time.c | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index c30e1a2dcddc..00b1c3f90cdf 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -498,7 +498,7 @@ proc0_init(void *dummy __unused) strncpy(p->p_comm, "kernel", sizeof (p->p_comm)); strncpy(td->td_name, "swapper", sizeof (td->td_name)); - callout_init(&p->p_itcallout, CALLOUT_MPSAFE); + callout_init_mtx(&p->p_itcallout, &p->p_mtx, 0); callout_init_mtx(&p->p_limco, &p->p_mtx, 0); callout_init(&td->td_slpcallout, CALLOUT_MPSAFE); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 5dc43cac4b31..b8a4825d6da2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -591,7 +591,7 @@ do_fork(struct thread *td, int flags, struct proc *p2, struct thread *td2, LIST_INIT(&p2->p_children); LIST_INIT(&p2->p_orphans); - callout_init(&p2->p_itcallout, CALLOUT_MPSAFE); + callout_init_mtx(&p2->p_itcallout, &p2->p_mtx, 0); /* * If PF_FORK is set, the child process inherits the diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index c0e783118959..97c288d337e0 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -788,13 +788,11 @@ realitexpire(void *arg) struct timeval ctv, ntv; p = (struct proc *)arg; - PROC_LOCK(p); kern_psignal(p, SIGALRM); if (!timevalisset(&p->p_realtimer.it_interval)) { timevalclear(&p->p_realtimer.it_value); if (p->p_flag & P_WEXIT) wakeup(&p->p_itcallout); - PROC_UNLOCK(p); return; } for (;;) { @@ -806,7 +804,6 @@ realitexpire(void *arg) timevalsub(&ntv, &ctv); callout_reset(&p->p_itcallout, tvtohz(&ntv) - 1, realitexpire, p); - PROC_UNLOCK(p); return; } } From 6dbda21756f4e6634972b1a9405c49fe0605de6d Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Wed, 5 Dec 2012 04:22:53 +0000 Subject: [PATCH 029/513] Remove dead code that clang refuses to compile. --- sys/boot/i386/efi/exec.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/boot/i386/efi/exec.c b/sys/boot/i386/efi/exec.c index fefbf0bb7925..579f5593b24b 100644 --- a/sys/boot/i386/efi/exec.c +++ b/sys/boot/i386/efi/exec.c @@ -46,14 +46,4 @@ __v86int() void __exec(caddr_t addr, ...) { - /* XXX this is wrong */ - __asm __volatile("movl %cr0, %eax"); - __asm __volatile("andl $0x7fffffff, %eax"); - __asm __volatile("mov %eax, %cr0"); - __asm __volatile("xorl %eax, %eax"); - __asm __volatile("mov %eax, %cr3"); - __asm __volatile("movl %cr0, %eax"); - __asm __volatile("andl $0xfffffffe, %eax"); - __asm __volatile("movl %eax, %cr0"); - __asm __volatile("jmp %0" :: "r" (addr)); } From eb1b1807afd1266445720b768b1bdbcdf7655a0a Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 5 Dec 2012 08:04:20 +0000 Subject: [PATCH 030/513] Mechanically substitute flags from historic mbuf allocator with malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually --- sys/arm/at91/if_ate.c | 6 +- sys/arm/at91/if_macb.c | 6 +- sys/arm/econa/if_ece.c | 2 +- sys/arm/lpc/if_lpe.c | 2 +- sys/arm/ti/cpsw/if_cpsw.c | 2 +- sys/arm/xscale/ixp425/if_npe.c | 6 +- sys/compat/linux/linux_socket.c | 2 +- sys/compat/ndis/kern_ndis.c | 6 +- sys/fs/nfs/nfs_commonsubs.c | 4 +- sys/fs/nfs/nfsm_subs.h | 2 +- sys/fs/nfsclient/nfs_clcomsubs.c | 4 +- sys/fs/nfsserver/nfs_nfsdcache.c | 8 +- sys/fs/nfsserver/nfs_nfsdport.c | 4 +- sys/fs/nfsserver/nfs_nfsdstate.c | 2 +- sys/kern/subr_mchain.c | 10 +-- sys/kern/uipc_mbuf.c | 20 ++--- sys/kern/uipc_mbuf2.c | 6 +- sys/kern/uipc_sockbuf.c | 8 +- sys/kern/uipc_socket.c | 26 +++--- sys/kern/uipc_syscalls.c | 6 +- sys/mips/adm5120/if_admsw.c | 8 +- sys/mips/atheros/if_arge.c | 4 +- sys/mips/cavium/if_octm.c | 2 +- sys/mips/cavium/octe/ethernet-mem.c | 2 +- sys/mips/cavium/octe/ethernet-rx.c | 2 +- sys/mips/idt/if_kr.c | 2 +- sys/mips/nlm/dev/net/xlpge.c | 2 +- sys/mips/rmi/dev/nlge/if_nlge.c | 2 +- sys/mips/rmi/dev/xlr/rge.c | 2 +- sys/net/bpf.c | 8 +- sys/net/bridgestp.c | 4 +- sys/net/ieee8023ad_lacp.c | 4 +- sys/net/if_arcsubr.c | 10 +-- sys/net/if_atmsubr.c | 2 +- sys/net/if_bridge.c | 18 ++-- sys/net/if_ef.c | 4 +- sys/net/if_ethersubr.c | 10 +-- sys/net/if_fddisubr.c | 6 +- sys/net/if_fwsubr.c | 6 +- sys/net/if_gre.c | 4 +- sys/net/if_iso88025subr.c | 6 +- sys/net/if_spppfr.c | 6 +- sys/net/if_spppsubr.c | 10 +-- sys/net/if_stf.c | 2 +- sys/net/if_tap.c | 2 +- sys/net/if_tun.c | 6 +- sys/net/rtsock.c | 4 +- sys/net80211/ieee80211_freebsd.c | 4 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_hwmp.c | 2 +- sys/net80211/ieee80211_input.c | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_output.c | 20 ++--- sys/net80211/ieee80211_superg.c | 6 +- sys/net80211/ieee80211_wds.c | 2 +- sys/netatalk/aarp.c | 10 +-- sys/netatalk/ddp_output.c | 4 +- sys/netgraph/atm/ccatm/ng_ccatm.c | 4 +- sys/netgraph/atm/ng_atm.c | 6 +- .../bluetooth/drivers/bt3c/ng_bt3c_pccard.c | 4 +- sys/netgraph/bluetooth/drivers/h4/ng_h4.c | 2 +- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 12 +-- sys/netgraph/bluetooth/hci/ng_hci_cmds.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_evnt.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_misc.c | 2 +- sys/netgraph/bluetooth/hci/ng_hci_ulpi.c | 10 +-- sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h | 22 ++--- sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c | 2 +- sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c | 2 +- sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c | 2 +- .../bluetooth/socket/ng_btsocket_hci_raw.c | 6 +- .../bluetooth/socket/ng_btsocket_l2cap.c | 6 +- .../bluetooth/socket/ng_btsocket_rfcomm.c | 14 ++-- .../bluetooth/socket/ng_btsocket_sco.c | 4 +- sys/netgraph/netflow/netflow.c | 2 +- sys/netgraph/netflow/netflow_v9.c | 2 +- sys/netgraph/ng_UI.c | 2 +- sys/netgraph/ng_atmllc.c | 4 +- sys/netgraph/ng_bridge.c | 2 +- sys/netgraph/ng_cisco.c | 4 +- sys/netgraph/ng_deflate.c | 4 +- sys/netgraph/ng_device.c | 2 +- sys/netgraph/ng_frame_relay.c | 2 +- sys/netgraph/ng_gif.c | 2 +- sys/netgraph/ng_gif_demux.c | 2 +- sys/netgraph/ng_hub.c | 2 +- sys/netgraph/ng_iface.c | 2 +- sys/netgraph/ng_ipfw.c | 2 +- sys/netgraph/ng_l2tp.c | 14 ++-- sys/netgraph/ng_lmi.c | 2 +- sys/netgraph/ng_mppc.c | 6 +- sys/netgraph/ng_one2many.c | 2 +- sys/netgraph/ng_ppp.c | 6 +- sys/netgraph/ng_pppoe.c | 20 ++--- sys/netgraph/ng_pptpgre.c | 4 +- sys/netgraph/ng_pred1.c | 4 +- sys/netgraph/ng_rfc1490.c | 10 +-- sys/netgraph/ng_source.c | 8 +- sys/netgraph/ng_tee.c | 2 +- sys/netgraph/ng_tty.c | 4 +- sys/netgraph/ng_vjc.c | 4 +- sys/netgraph/ng_vlan.c | 2 +- sys/netinet/if_ether.c | 2 +- sys/netinet/igmp.c | 18 ++-- sys/netinet/in_gif.c | 4 +- sys/netinet/ip_icmp.c | 6 +- sys/netinet/ip_input.c | 4 +- sys/netinet/ip_mroute.c | 12 +-- sys/netinet/ip_options.c | 4 +- sys/netinet/ip_output.c | 10 +-- sys/netinet/libalias/alias.c | 4 +- sys/netinet/raw_ip.c | 2 +- sys/netinet/sctp_asconf.c | 10 +-- sys/netinet/sctp_auth.c | 4 +- sys/netinet/sctp_indata.c | 58 ++++++------- sys/netinet/sctp_input.c | 14 ++-- sys/netinet/sctp_output.c | 84 +++++++++---------- sys/netinet/sctp_pcb.c | 6 +- sys/netinet/sctp_timer.c | 4 +- sys/netinet/sctp_usrreq.c | 6 +- sys/netinet/sctputil.c | 34 ++++---- sys/netinet/tcp_output.c | 6 +- sys/netinet/tcp_subr.c | 4 +- sys/netinet/tcp_syncache.c | 2 +- sys/netinet/tcp_timewait.c | 2 +- sys/netinet/udp_usrreq.c | 2 +- sys/netinet6/frag6.c | 2 +- sys/netinet6/icmp6.c | 38 ++++----- sys/netinet6/in6_gif.c | 4 +- sys/netinet6/ip6_input.c | 8 +- sys/netinet6/ip6_mroute.c | 2 +- sys/netinet6/ip6_output.c | 18 ++-- sys/netinet6/mld6.c | 18 ++-- sys/netinet6/nd6_nbr.c | 8 +- sys/netinet6/raw_ip6.c | 2 +- sys/netinet6/udp6_usrreq.c | 2 +- sys/netipsec/ipsec_mbuf.c | 8 +- sys/netipsec/ipsec_output.c | 4 +- sys/netipsec/key.c | 42 +++++----- sys/netipsec/keysock.c | 8 +- sys/netipsec/xform_ipip.c | 4 +- sys/netipx/ipx_outputfl.c | 2 +- sys/netipx/ipx_usrreq.c | 4 +- sys/netipx/spx_reass.c | 2 +- sys/netipx/spx_usrreq.c | 10 +-- sys/netnatm/natm.c | 2 +- sys/netncp/ncp_sock.c | 2 +- sys/netpfil/ipfw/ip_dn_glue.c | 2 +- sys/netpfil/ipfw/ip_fw_dynamic.c | 2 +- sys/netpfil/ipfw/ip_fw_pfil.c | 4 +- sys/netsmb/smb_iod.c | 2 +- sys/netsmb/smb_rq.c | 2 +- sys/netsmb/smb_trantcp.c | 2 +- sys/nfs/krpc_subr.c | 10 +-- sys/nfs/nfs_common.c | 6 +- sys/nfsclient/nfs_krpc.c | 2 +- sys/nfsclient/nfs_subs.c | 16 ++-- sys/nfsserver/nfs_fha.c | 2 +- sys/nfsserver/nfs_serv.c | 8 +- sys/nfsserver/nfs_srvkrpc.c | 6 +- sys/nfsserver/nfs_srvsubs.c | 4 +- .../drivers/infiniband/ulp/ipoib/ipoib_ib.c | 2 +- .../drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- .../drivers/infiniband/ulp/sdp/sdp_bcopy.c | 2 +- .../drivers/infiniband/ulp/sdp/sdp_main.c | 8 +- sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c | 2 +- sys/ofed/drivers/net/mlx4/en_tx.c | 2 +- sys/pci/if_rl.c | 2 +- sys/powerpc/ps3/if_glc.c | 4 +- sys/rpc/clnt_dg.c | 2 +- sys/rpc/clnt_vc.c | 4 +- sys/rpc/rpc_generic.c | 4 +- sys/rpc/rpcm_subs.h | 2 +- sys/rpc/rpcsec_gss/rpcsec_gss_prot.c | 4 +- sys/rpc/svc.c | 4 +- sys/rpc/svc_dg.c | 2 +- sys/rpc/svc_vc.c | 6 +- sys/sys/mbuf.h | 15 +--- 178 files changed, 582 insertions(+), 593 deletions(-) diff --git a/sys/arm/at91/if_ate.c b/sys/arm/at91/if_ate.c index 58062e73f0e5..9da2abafcd13 100644 --- a/sys/arm/at91/if_ate.c +++ b/sys/arm/at91/if_ate.c @@ -901,9 +901,9 @@ ate_intr(void *xsc) /* Get an appropriately sized mbuf */ if (remain + ETHER_ALIGN >= MINCLSIZE) - mb = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mb = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - MGETHDR(mb, M_DONTWAIT, MT_DATA); + MGETHDR(mb, M_NOWAIT, MT_DATA); if (mb == NULL) { sc->ifp->if_iqdrops++; @@ -1135,7 +1135,7 @@ atestart_locked(struct ifnet *ifp) e = bus_dmamap_load_mbuf_sg(sc->mtag, sc->tx_map[sc->txhead], m, segs, &nseg, 0); if (e == EFBIG) { - mdefrag = m_defrag(m, M_DONTWAIT); + mdefrag = m_defrag(m, M_NOWAIT); if (mdefrag == NULL) { IFQ_DRV_PREPEND(&ifp->if_snd, m); return; diff --git a/sys/arm/at91/if_macb.c b/sys/arm/at91/if_macb.c index ac280a1918e5..1a46adc52506 100644 --- a/sys/arm/at91/if_macb.c +++ b/sys/arm/at91/if_macb.c @@ -435,7 +435,7 @@ macb_new_rxbuf(struct macb_softc *sc, int index) bus_dma_segment_t seg[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES - ETHER_ALIGN; @@ -878,7 +878,7 @@ macb_encap(struct macb_softc *sc, struct mbuf **m_head) error = bus_dmamap_load_mbuf_sg(sc->dmatag_ring_tx, txd->dmamap, *m_head, segs, &nsegs, 0); if (error == EFBIG) { - m = m_collapse(*m_head, M_DONTWAIT, MAX_FRAGMENT); + m = m_collapse(*m_head, M_NOWAIT, MAX_FRAGMENT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; @@ -973,7 +973,7 @@ macbstart_locked(struct ifnet *ifp) #if 0 if (m0->m_next != NULL) { /* Fragmented mbuf chain, collapse it. */ - m_new = m_defrag(m0, M_DONTWAIT); + m_new = m_defrag(m0, M_NOWAIT); if (m_new != NULL) { /* Original frame freed. */ m0 = m_new; diff --git a/sys/arm/econa/if_ece.c b/sys/arm/econa/if_ece.c index 5169101704b3..cafc2f920615 100644 --- a/sys/arm/econa/if_ece.c +++ b/sys/arm/econa/if_ece.c @@ -714,7 +714,7 @@ ece_new_rxbuf(struct ece_softc *sc, struct rx_desc_info* descinfo) tag = sc->dmatag_ring_rx; - new_mbuf = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + new_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (new_mbuf == NULL) return (ENOBUFS); diff --git a/sys/arm/lpc/if_lpe.c b/sys/arm/lpc/if_lpe.c index b7b5a9ac49fa..025aa72545cf 100644 --- a/sys/arm/lpc/if_lpe.c +++ b/sys/arm/lpc/if_lpe.c @@ -1122,7 +1122,7 @@ lpe_init_rxbuf(struct lpe_softc *sc, int n) rxd = &sc->lpe_cdata.lpe_rx_desc[n]; hwd = &sc->lpe_rdata.lpe_rx_ring[n]; hws = &sc->lpe_rdata.lpe_rx_status[n]; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (!m) { device_printf(sc->lpe_dev, "WARNING: mbufs exhausted!\n"); diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index d671c728f145..8ed0ce581c3d 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -625,7 +625,7 @@ cpsw_pad(struct mbuf *m) ; if (!(M_WRITABLE(last) && M_TRAILINGSPACE(last) >= padlen)) { /* Allocate new empty mbuf, pad it. Compact later. */ - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) return (ENOBUFS); n->m_len = 0; diff --git a/sys/arm/xscale/ixp425/if_npe.c b/sys/arm/xscale/ixp425/if_npe.c index 5063ac61ad02..21e39267fbe2 100644 --- a/sys/arm/xscale/ixp425/if_npe.c +++ b/sys/arm/xscale/ixp425/if_npe.c @@ -1064,7 +1064,7 @@ npe_rxbuf_init(struct npe_softc *sc, struct npebuf *npe, struct mbuf *m) int error, nseg; if (m == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return ENOBUFS; } @@ -1120,7 +1120,7 @@ npe_rxdone(int qid, void *arg) * data up the stack and replace it with the newly * allocated one. */ - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m != NULL) { struct mbuf *mrx = npe->ix_m; struct npehwbuf *hw = npe->ix_hw; @@ -1316,7 +1316,7 @@ npestart_locked(struct ifnet *ifp) error = bus_dmamap_load_mbuf_sg(dma->mtag, npe->ix_map, m, segs, &nseg, 0); if (error == EFBIG) { - n = m_collapse(m, M_DONTWAIT, NPE_MAXSEG); + n = m_collapse(m, M_NOWAIT, NPE_MAXSEG); if (n == NULL) { if_printf(ifp, "%s: too many fragments %u\n", __func__, nseg); diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index d8fcd2d3bd83..7271a18385af 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1173,7 +1173,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) error = ENOBUFS; cmsg = malloc(CMSG_HDRSZ, M_TEMP, M_WAITOK | M_ZERO); - control = m_get(M_WAIT, MT_CONTROL); + control = m_get(M_WAITOK, MT_CONTROL); if (control == NULL) goto bad; diff --git a/sys/compat/ndis/kern_ndis.c b/sys/compat/ndis/kern_ndis.c index ce7ee4c40256..23abaf130f28 100644 --- a/sys/compat/ndis/kern_ndis.c +++ b/sys/compat/ndis/kern_ndis.c @@ -657,12 +657,12 @@ ndis_ptom(m0, p) for (buf = priv->npp_head; buf != NULL; buf = buf->mdl_next) { if (buf == priv->npp_head) #ifdef MT_HEADER - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); #else - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); #endif else - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(*m0); *m0 = NULL; diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c index 71cfbabc8b1f..5fe831528de0 100644 --- a/sys/fs/nfs/nfs_commonsubs.c +++ b/sys/fs/nfs/nfs_commonsubs.c @@ -382,7 +382,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) while (siz > 0) { if (left == 0) { if (siz > ncl_mbuf_mlen) - NFSMCLGET(m1, M_WAIT); + NFSMCLGET(m1, M_WAITOK); else NFSMGET(m1); mbuf_setlen(m1, 0); @@ -3455,7 +3455,7 @@ nfsrvd_rephead(struct nfsrv_descript *nd) */ if ((nd->nd_flag & ND_GSSINITREPLY) == 0 && nfs_bigreply[nd->nd_procnum]) { - NFSMCLGET(mreq, M_WAIT); + NFSMCLGET(mreq, M_WAITOK); nd->nd_mreq = mreq; nd->nd_mb = mreq; } else { diff --git a/sys/fs/nfs/nfsm_subs.h b/sys/fs/nfs/nfsm_subs.h index a2777a0ca47a..6e91b9954c1b 100644 --- a/sys/fs/nfs/nfsm_subs.h +++ b/sys/fs/nfs/nfsm_subs.h @@ -73,7 +73,7 @@ nfsm_build(struct nfsrv_descript *nd, int siz) struct mbuf *mb2; if (siz > M_TRAILINGSPACE(nd->nd_mb)) { - NFSMCLGET(mb2, M_DONTWAIT); + NFSMCLGET(mb2, M_NOWAIT); if (siz > MLEN) panic("build > MLEN"); mbuf_setlen(mb2, 0); diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index 28d8ba11dfdc..b68e5bd07fd5 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -138,7 +138,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, * Get the first mbuf for the request. */ if (nfs_bigrequest[procnum]) - NFSMCLGET(mb, M_WAIT); + NFSMCLGET(mb, M_WAITOK); else NFSMGET(mb); mbuf_setlen(mb, 0); @@ -212,7 +212,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) mlen = M_TRAILINGSPACE(mp); if (mlen == 0) { if (clflg) - NFSMCLGET(mp, M_WAIT); + NFSMCLGET(mp, M_WAITOK); else NFSMGET(mp); mbuf_setlen(mp, 0); diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c index 0ee3b024dead..b979b358d6b6 100644 --- a/sys/fs/nfsserver/nfs_nfsdcache.c +++ b/sys/fs/nfsserver/nfs_nfsdcache.c @@ -364,7 +364,7 @@ nfsrc_getudp(struct nfsrv_descript *nd, struct nfsrvcache *newrp) newnfsstats.srvcache_nonidemdonehits++; NFSUNLOCKCACHE(); nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); ret = RC_REPLY; rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_UDPTIMEOUT; @@ -437,7 +437,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so) if (!(rp->rc_flag & RC_REPMBUF)) panic("reply from cache"); nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT; nfsrc_unlock(rp); goto out; @@ -473,7 +473,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so) nfsrc_tcpsavedreplies; } NFSUNLOCKCACHE(); - m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT); + m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAITOK); NFSLOCKCACHE(); rp->rc_reply = m; rp->rc_flag |= RC_REPMBUF; @@ -654,7 +654,7 @@ nfsrc_gettcp(struct nfsrv_descript *nd, struct nfsrvcache *newrp) nfsrc_marksametcpconn(rp->rc_sockref); ret = RC_REPLY; nd->nd_mreq = m_copym(rp->rc_reply, 0, - M_COPYALL, M_WAIT); + M_COPYALL, M_WAITOK); rp->rc_timestamp = NFSD_MONOSEC + NFSRVCACHE_TCPTIMEOUT; } else { diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 1234a4a6281c..f56a292ca64b 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -565,7 +565,7 @@ nfsvno_readlink(struct vnode *vp, struct ucred *cred, struct thread *p, i = 0; while (len < NFS_MAXPATHLEN) { NFSMGET(mp); - MCLGET(mp, M_WAIT); + MCLGET(mp, M_WAITOK); mp->m_len = NFSMSIZ(mp); if (len == 0) { mp3 = mp2 = mp; @@ -635,7 +635,7 @@ nfsvno_read(struct vnode *vp, off_t off, int cnt, struct ucred *cred, i = 0; while (left > 0) { NFSMGET(m); - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); m->m_len = 0; siz = min(M_TRAILINGSPACE(m), left); left -= siz; diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index e9962c720cc9..515f8111d423 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -3726,7 +3726,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, /* * Get the first mbuf for the request. */ - MGET(m, M_WAIT, MT_DATA); + MGET(m, M_WAITOK, MT_DATA); mbuf_setlen(m, 0); nd->nd_mreq = nd->nd_mb = m; nd->nd_bpos = NFSMTOD(m, caddr_t); diff --git a/sys/kern/subr_mchain.c b/sys/kern/subr_mchain.c index cd2a5f370ed2..e9d7d22129b4 100644 --- a/sys/kern/subr_mchain.c +++ b/sys/kern/subr_mchain.c @@ -59,7 +59,7 @@ mb_init(struct mbchain *mbp) { struct mbuf *m; - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_len = 0; mb_initm(mbp, m); return (0); @@ -114,7 +114,7 @@ mb_reserve(struct mbchain *mbp, int size) panic("mb_reserve: size = %d\n", size); m = mbp->mb_cur; if (mbp->mb_mleft < size) { - mn = m_get(M_WAIT, MT_DATA); + mn = m_get(M_WAITOK, MT_DATA); mbp->mb_cur = m->m_next = mn; m = mn; m->m_len = 0; @@ -205,7 +205,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_t source, int size, int type) while (size > 0) { if (mleft == 0) { if (m->m_next == NULL) - m = m_getm(m, size, M_WAIT, MT_DATA); + m = m_getm(m, size, M_WAITOK, MT_DATA); else m = m->m_next; mleft = M_TRAILINGSPACE(m); @@ -307,7 +307,7 @@ md_init(struct mdchain *mdp) { struct mbuf *m; - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_len = 0; md_initm(mdp, m); return (0); @@ -514,7 +514,7 @@ md_get_mbuf(struct mdchain *mdp, int size, struct mbuf **ret) { struct mbuf *m = mdp->md_cur, *rm; - rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAIT); + rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAITOK); md_get_mem(mdp, NULL, size, MB_MZERO); *ret = rm; return (0); diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 4130361e781d..ab6163dd7829 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -520,7 +520,7 @@ m_prepend(struct mbuf *m, int len, int how) /* * Make a copy of an mbuf chain starting "off0" bytes from the beginning, * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf. - * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller. + * The wait parameter is a choice of M_WAITOK/M_NOWAIT from caller. * Note that the copy is read-only, because clusters are not copied, * only their reference counts are incremented. */ @@ -1028,7 +1028,7 @@ m_pullup(struct mbuf *n, int len) } else { if (len > MHLEN) goto bad; - MGET(m, M_DONTWAIT, n->m_type); + MGET(m, M_NOWAIT, n->m_type); if (m == NULL) goto bad; m->m_len = 0; @@ -1076,7 +1076,7 @@ m_copyup(struct mbuf *n, int len, int dstoff) if (len > (MHLEN - dstoff)) goto bad; - MGET(m, M_DONTWAIT, n->m_type); + MGET(m, M_NOWAIT, n->m_type); if (m == NULL) goto bad; m->m_len = 0; @@ -1195,10 +1195,10 @@ m_devget(char *buf, int totlen, int off, struct ifnet *ifp, while (totlen > 0) { if (top == NULL) { /* First one, must be PKTHDR */ if (totlen + off >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); len = MCLBYTES; } else { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); len = MHLEN; /* Place initial small packet/header at end of mbuf */ @@ -1213,10 +1213,10 @@ m_devget(char *buf, int totlen, int off, struct ifnet *ifp, m->m_pkthdr.len = totlen; } else { if (totlen + off >= MINCLSIZE) { - m = m_getcl(M_DONTWAIT, MT_DATA, 0); + m = m_getcl(M_NOWAIT, MT_DATA, 0); len = MCLBYTES; } else { - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); len = MLEN; } if (m == NULL) { @@ -1260,7 +1260,7 @@ m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp) off -= mlen; totlen += mlen; if (m->m_next == NULL) { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) goto out; bzero(mtod(n, caddr_t), MLEN); @@ -1284,7 +1284,7 @@ m_copyback(struct mbuf *m0, int off, int len, c_caddr_t cp) if (len == 0) break; if (m->m_next == NULL) { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) break; n->m_len = min(MLEN, len); @@ -1328,7 +1328,7 @@ m_append(struct mbuf *m0, int len, c_caddr_t cp) * Allocate a new mbuf; could check space * and allocate a cluster instead. */ - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) break; n->m_len = min(MLEN, remainder); diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c index 96be658c4775..e32e2a127124 100644 --- a/sys/kern/uipc_mbuf2.c +++ b/sys/kern/uipc_mbuf2.c @@ -171,7 +171,7 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) * chop the current mbuf into two pieces, set off to 0. */ if (len <= n->m_len - off) { - o = m_dup1(n, off, n->m_len - off, M_DONTWAIT); + o = m_dup1(n, off, n->m_len - off, M_NOWAIT); if (o == NULL) { m_freem(m); return NULL; /* ENOBUFS */ @@ -231,9 +231,9 @@ m_pulldown(struct mbuf *m, int off, int len, int *offp) * on both end. */ if (len > MLEN) - o = m_getcl(M_DONTWAIT, m->m_type, 0); + o = m_getcl(M_NOWAIT, m->m_type, 0); else - o = m_get(M_DONTWAIT, m->m_type); + o = m_get(M_NOWAIT, m->m_type); if (!o) { m_freem(m); return NULL; /* ENOBUFS */ diff --git a/sys/kern/uipc_sockbuf.c b/sys/kern/uipc_sockbuf.c index 272f9392bbd2..6325840d4662 100644 --- a/sys/kern/uipc_sockbuf.c +++ b/sys/kern/uipc_sockbuf.c @@ -188,7 +188,7 @@ sowakeup(struct socket *so, struct sockbuf *sb) } KNOTE_LOCKED(&sb->sb_sel.si_note, 0); if (sb->sb_upcall != NULL) { - ret = sb->sb_upcall(so, sb->sb_upcallarg, M_DONTWAIT); + ret = sb->sb_upcall(so, sb->sb_upcallarg, M_NOWAIT); if (ret == SU_ISCONNECTED) { KASSERT(sb == &so->so_rcv, ("SO_SND upcall returned SU_ISCONNECTED")); @@ -644,7 +644,7 @@ sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, if (asa->sa_len > MLEN) return (0); #endif - MGET(m, M_DONTWAIT, MT_SONAME); + MGET(m, M_NOWAIT, MT_SONAME); if (m == 0) return (0); m->m_len = asa->sa_len; @@ -1002,9 +1002,9 @@ sbcreatecontrol(caddr_t p, int size, int type, int level) if (CMSG_SPACE((u_int)size) > MCLBYTES) return ((struct mbuf *) NULL); if (CMSG_SPACE((u_int)size) > MLEN) - m = m_getcl(M_DONTWAIT, MT_CONTROL, 0); + m = m_getcl(M_NOWAIT, MT_CONTROL, 0); else - m = m_get(M_DONTWAIT, MT_CONTROL); + m = m_get(M_NOWAIT, MT_CONTROL); if (m == NULL) return ((struct mbuf *) NULL); cp = mtod(m, struct cmsghdr *); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 4416eca93775..2d84afedeecd 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -998,7 +998,7 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space, } } else { if (top == NULL) { - m = m_gethdr(M_WAIT, MT_DATA); + m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; m->m_pkthdr.rcvif = NULL; @@ -1010,7 +1010,7 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space, if (atomic && m && len < MHLEN) MH_ALIGN(m, len); } else { - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); len = min(min(MLEN, resid), *space); } } @@ -1433,7 +1433,7 @@ soreceive_rcvoob(struct socket *so, struct uio *uio, int flags) KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0")); VNET_SO_ASSERT(so); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK); if (error) goto bad; @@ -1841,13 +1841,13 @@ soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, int copy_flag; if (flags & MSG_DONTWAIT) - copy_flag = M_DONTWAIT; + copy_flag = M_NOWAIT; else copy_flag = M_WAIT; - if (copy_flag == M_WAIT) + if (copy_flag == M_WAITOK) SOCKBUF_UNLOCK(&so->so_rcv); *mp = m_copym(m, 0, len, copy_flag); - if (copy_flag == M_WAIT) + if (copy_flag == M_WAITOK) SOCKBUF_LOCK(&so->so_rcv); if (*mp == NULL) { /* @@ -2114,7 +2114,7 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else @@ -2901,11 +2901,11 @@ soopt_getm(struct sockopt *sopt, struct mbuf **mp) struct mbuf *m, *m_prev; int sopt_size = sopt->sopt_valsize; - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) return ENOBUFS; if (sopt_size > MLEN) { - MCLGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT); + MCLGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); return ENOBUFS; @@ -2919,14 +2919,14 @@ soopt_getm(struct sockopt *sopt, struct mbuf **mp) m_prev = m; while (sopt_size) { - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(*mp); return ENOBUFS; } if (sopt_size > MLEN) { - MCLGET(m, sopt->sopt_td != NULL ? M_WAIT : - M_DONTWAIT); + MCLGET(m, sopt->sopt_td != NULL ? M_WAITOK : + M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); m_freem(*mp); @@ -3409,7 +3409,7 @@ soisconnected(struct socket *so) head->so_accf->so_accept_filter_arg); so->so_options &= ~SO_ACCEPTFILTER; ret = head->so_accf->so_accept_filter->accf_callback(so, - head->so_accf->so_accept_filter_arg, M_DONTWAIT); + head->so_accf->so_accept_filter_arg, M_NOWAIT); if (ret == SU_ISCONNECTED) soupcall_clear(so, SO_RCV); SOCK_UNLOCK(so); diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 8ecaa02ea251..b29c2c6b80b7 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -722,7 +722,7 @@ sendit(td, s, mp, flags) if (mp->msg_flags == MSG_COMPAT) { struct cmsghdr *cm; - M_PREPEND(control, sizeof(*cm), M_WAIT); + M_PREPEND(control, sizeof(*cm), M_WAITOK); cm = mtod(control, struct cmsghdr *); cm->cmsg_len = control->m_len; cm->cmsg_level = SOL_SOCKET; @@ -1661,9 +1661,9 @@ sockargs(mp, buf, buflen, type) if ((u_int)buflen > MCLBYTES) return (EINVAL); } - m = m_get(M_WAIT, type); + m = m_get(M_WAITOK, type); if ((u_int)buflen > MLEN) - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); m->m_len = buflen; error = copyin(buf, mtod(m, caddr_t), (u_int)buflen); if (error) diff --git a/sys/mips/adm5120/if_admsw.c b/sys/mips/adm5120/if_admsw.c index b3f6e3bdd403..f17df00f8365 100644 --- a/sys/mips/adm5120/if_admsw.c +++ b/sys/mips/adm5120/if_admsw.c @@ -647,14 +647,14 @@ admsw_start(struct ifnet *ifp) if (m0->m_pkthdr.len < ETHER_MIN_LEN || bus_dmamap_load_mbuf(sc->sc_bufs_dmat, dmamap, m0, admsw_mbuf_map_addr, ds, BUS_DMA_NOWAIT) != 0) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { device_printf(sc->sc_dev, "unable to allocate Tx mbuf\n"); break; } if (m0->m_pkthdr.len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { device_printf(sc->sc_dev, "unable to allocate Tx cluster\n"); @@ -1222,11 +1222,11 @@ admsw_add_rxbuf(struct admsw_softc *sc, int idx, int high) else ds = &sc->sc_rxlsoft[idx]; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); return (ENOBUFS); diff --git a/sys/mips/atheros/if_arge.c b/sys/mips/atheros/if_arge.c index 6c6398299e0f..247d331b9021 100644 --- a/sys/mips/atheros/if_arge.c +++ b/sys/mips/atheros/if_arge.c @@ -1090,7 +1090,7 @@ arge_encap(struct arge_softc *sc, struct mbuf **m_head) m = *m_head; if (! arge_mbuf_chain_is_tx_aligned(m)) { sc->stats.tx_pkts_unaligned++; - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { *m_head = NULL; return (ENOBUFS); @@ -1772,7 +1772,7 @@ arge_newbuf(struct arge_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/mips/cavium/if_octm.c b/sys/mips/cavium/if_octm.c index c6778fff5c3e..bfb58976aefb 100644 --- a/sys/mips/cavium/if_octm.c +++ b/sys/mips/cavium/if_octm.c @@ -505,7 +505,7 @@ octm_rx_intr(void *arg) } for (;;) { - struct mbuf *m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + struct mbuf *m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "no memory for receive mbuf.\n"); return; diff --git a/sys/mips/cavium/octe/ethernet-mem.c b/sys/mips/cavium/octe/ethernet-mem.c index d7af1ae4d602..d101d7cc9568 100644 --- a/sys/mips/cavium/octe/ethernet-mem.c +++ b/sys/mips/cavium/octe/ethernet-mem.c @@ -57,7 +57,7 @@ int cvm_oct_mem_fill_fpa(int pool, int size, int elements) while (freed) { KASSERT(size <= MCLBYTES - 128, ("mbuf clusters are too small")); - struct mbuf *m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + struct mbuf *m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { printf("Failed to allocate mbuf for hardware pool %d\n", pool); break; diff --git a/sys/mips/cavium/octe/ethernet-rx.c b/sys/mips/cavium/octe/ethernet-rx.c index 0f00245d2f16..910d6bdbb65d 100644 --- a/sys/mips/cavium/octe/ethernet-rx.c +++ b/sys/mips/cavium/octe/ethernet-rx.c @@ -228,7 +228,7 @@ void cvm_oct_tasklet_rx(void *context, int pending) /* We have to copy the packet. First allocate an mbuf for it */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { DEBUGPRINT("Port %d failed to allocate mbuf, packet dropped\n", work->word1.cn38xx.ipprt); cvm_oct_free_work(work); diff --git a/sys/mips/idt/if_kr.c b/sys/mips/idt/if_kr.c index b43defa25716..aa533eb889b8 100644 --- a/sys/mips/idt/if_kr.c +++ b/sys/mips/idt/if_kr.c @@ -1305,7 +1305,7 @@ kr_newbuf(struct kr_softc *sc, int idx) bus_dmamap_t map; int nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = MCLBYTES; diff --git a/sys/mips/nlm/dev/net/xlpge.c b/sys/mips/nlm/dev/net/xlpge.c index 3af802e3deb1..0e41559cbb06 100644 --- a/sys/mips/nlm/dev/net/xlpge.c +++ b/sys/mips/nlm/dev/net/xlpge.c @@ -1125,7 +1125,7 @@ get_buf(void) vm_paddr_t temp1, temp2; #endif - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_adj(m_new, NAE_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); diff --git a/sys/mips/rmi/dev/nlge/if_nlge.c b/sys/mips/rmi/dev/nlge/if_nlge.c index a25ebe3c95e3..331064ae72a0 100644 --- a/sys/mips/rmi/dev/nlge/if_nlge.c +++ b/sys/mips/rmi/dev/nlge/if_nlge.c @@ -2158,7 +2158,7 @@ get_buf(void) vm_paddr_t temp1, temp2; #endif - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return (NULL); m_new->m_len = m_new->m_pkthdr.len = MCLBYTES; m_adj(m_new, XLR_CACHELINE_SIZE - ((uintptr_t)m_new->m_data & 0x1f)); diff --git a/sys/mips/rmi/dev/xlr/rge.c b/sys/mips/rmi/dev/xlr/rge.c index 1af97c2fbd9e..2d2ba9e4bf79 100644 --- a/sys/mips/rmi/dev/xlr/rge.c +++ b/sys/mips/rmi/dev/xlr/rge.c @@ -568,7 +568,7 @@ get_mbuf(void) { struct mbuf *m_new = NULL; - if ((m_new = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR)) == NULL) + if ((m_new = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR)) == NULL) return NULL; m_new->m_len = MCLBYTES; diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 79ea5242283e..6d9a917a8b91 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -530,11 +530,11 @@ bpf_movein(struct uio *uio, int linktype, struct ifnet *ifp, struct mbuf **mp, return (EIO); if (len <= MHLEN) - MGETHDR(m, M_WAIT, MT_DATA); + MGETHDR(m, M_WAITOK, MT_DATA); else if (len <= MCLBYTES) - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_WAITOK, MT_DATA, M_PKTHDR); else - m = m_getjcl(M_WAIT, MT_DATA, M_PKTHDR, + m = m_getjcl(M_WAITOK, MT_DATA, M_PKTHDR, #if (MJUMPAGESIZE > MCLBYTES) len <= MJUMPAGESIZE ? MJUMPAGESIZE : #endif @@ -1064,7 +1064,7 @@ bpfwrite(struct cdev *dev, struct uio *uio, int ioflag) dst.sa_family = pseudo_AF_HDRCMPLT; if (d->bd_feedback) { - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc != NULL) mc->m_pkthdr.rcvif = ifp; /* Set M_PROMISC for outgoing packets to be discarded. */ diff --git a/sys/net/bridgestp.c b/sys/net/bridgestp.c index 15d4ee96a475..43dd005244db 100644 --- a/sys/net/bridgestp.c +++ b/sys/net/bridgestp.c @@ -234,7 +234,7 @@ bstp_transmit_tcn(struct bstp_state *bs, struct bstp_port *bp) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; @@ -348,7 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, struct bstp_port *bp, if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return; diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c index b2a6a7daf152..87c4e9bcb237 100644 --- a/sys/net/ieee8023ad_lacp.c +++ b/sys/net/ieee8023ad_lacp.c @@ -348,7 +348,7 @@ lacp_xmit_lacpdu(struct lacp_port *lp) LACP_LOCK_ASSERT(lp->lp_lsc); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { return (ENOMEM); } @@ -402,7 +402,7 @@ lacp_xmit_marker(struct lacp_port *lp) LACP_LOCK_ASSERT(lp->lp_lsc); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { return (ENOMEM); } diff --git a/sys/net/if_arcsubr.c b/sys/net/if_arcsubr.c index 03f3a1c305bc..faa37cf9e0fd 100644 --- a/sys/net/if_arcsubr.c +++ b/sys/net/if_arcsubr.c @@ -214,7 +214,7 @@ arc_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, } isphds = arc_isphds(atype); - M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_DONTWAIT); + M_PREPEND(m, isphds ? ARC_HDRNEWLEN : ARC_HDRLEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); ah = mtod(m, struct arc_header *); @@ -294,13 +294,13 @@ arc_frag_next(struct ifnet *ifp) /* split out next fragment and return it */ if (ac->sflag < ac->fsflag) { /* we CAN'T have short packets here */ - ac->curr_frag = m_split(m, ARC_MAX_DATA, M_DONTWAIT); + ac->curr_frag = m_split(m, ARC_MAX_DATA, M_NOWAIT); if (ac->curr_frag == 0) { m_freem(m); return 0; } - M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT); if (m == 0) { m_freem(ac->curr_frag); ac->curr_frag = 0; @@ -319,7 +319,7 @@ arc_frag_next(struct ifnet *ifp) ARC_MAX_FORBID_LEN - ARC_HDRNEWLEN + 2)) { ac->curr_frag = 0; - M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN_EXC, M_NOWAIT); if (m == 0) return 0; @@ -332,7 +332,7 @@ arc_frag_next(struct ifnet *ifp) } else { ac->curr_frag = 0; - M_PREPEND(m, ARC_HDRNEWLEN, M_DONTWAIT); + M_PREPEND(m, ARC_HDRNEWLEN, M_NOWAIT); if (m == 0) return 0; diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c index bb691e1fb97e..fdb8931ec76b 100644 --- a/sys/net/if_atmsubr.c +++ b/sys/net/if_atmsubr.c @@ -190,7 +190,7 @@ atm_output(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, atm_flags = ATM_PH_FLAGS(&atmdst); if (atm_flags & ATM_PH_LLCSNAP) sz += 8; /* sizeof snap == 8 */ - M_PREPEND(m, sz, M_DONTWAIT); + M_PREPEND(m, sz, M_NOWAIT); if (m == 0) senderr(ENOBUFS); ad = mtod(m, struct atm_pseudohdr *); diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 015cc64091e7..7666d5e99529 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1948,7 +1948,7 @@ bridge_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *sa, used = 1; mc = m; } else { - mc = m_copypacket(m, M_DONTWAIT); + mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -2237,7 +2237,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) * for bridge processing; return the original packet for * local processing. */ - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { BRIDGE_UNLOCK(sc); return (m); @@ -2254,7 +2254,7 @@ bridge_input(struct ifnet *ifp, struct mbuf *m) */ KASSERT(bifp->if_bridge == NULL, ("loop created in bridge_input")); - mc2 = m_dup(m, M_DONTWAIT); + mc2 = m_dup(m, M_NOWAIT); if (mc2 != NULL) { /* Keep the layer3 header aligned */ int i = min(mc2->m_pkthdr.len, max_protohdr); @@ -2431,7 +2431,7 @@ bridge_broadcast(struct bridge_softc *sc, struct ifnet *src_if, mc = m; used = 1; } else { - mc = m_dup(m, M_DONTWAIT); + mc = m_dup(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -2494,7 +2494,7 @@ bridge_span(struct bridge_softc *sc, struct mbuf *m) if ((dst_if->if_drv_flags & IFF_DRV_RUNNING) == 0) continue; - mc = m_copypacket(m, M_DONTWAIT); + mc = m_copypacket(m, M_NOWAIT); if (mc == NULL) { sc->sc_ifp->if_oerrors++; continue; @@ -3189,13 +3189,13 @@ bridge_pfil(struct mbuf **mp, struct ifnet *bifp, struct ifnet *ifp, int dir) * Finally, put everything back the way it was and return */ if (snap) { - M_PREPEND(*mp, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(*mp, sizeof(struct llc), M_NOWAIT); if (*mp == NULL) return (error); bcopy(&llc1, mtod(*mp, caddr_t), sizeof(struct llc)); } - M_PREPEND(*mp, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(*mp, ETHER_HDR_LEN, M_NOWAIT); if (*mp == NULL) return (error); bcopy(&eh2, mtod(*mp, caddr_t), ETHER_HDR_LEN); @@ -3390,7 +3390,7 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, for (m0 = m; m0; m0 = m0->m_nextpkt) { if (error == 0) { if (snap) { - M_PREPEND(m0, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m0, sizeof(struct llc), M_NOWAIT); if (m0 == NULL) { error = ENOBUFS; continue; @@ -3398,7 +3398,7 @@ bridge_fragment(struct ifnet *ifp, struct mbuf *m, struct ether_header *eh, bcopy(llc, mtod(m0, caddr_t), sizeof(struct llc)); } - M_PREPEND(m0, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m0, ETHER_HDR_LEN, M_NOWAIT); if (m0 == NULL) { error = ENOBUFS; continue; diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c index 8e84b0792272..94337934b521 100644 --- a/sys/net/if_ef.c +++ b/sys/net/if_ef.c @@ -408,7 +408,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, type = htons(m->m_pkthdr.len); break; case ETHER_FT_8022: - M_PREPEND(m, ETHER_HDR_LEN + 3, M_WAIT); + M_PREPEND(m, ETHER_HDR_LEN + 3, M_WAITOK); /* * Ensure that ethernet header and next three bytes * will fit into single mbuf @@ -427,7 +427,7 @@ ef_output(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst, short *tp, *hlen += 3; break; case ETHER_FT_SNAP: - M_PREPEND(m, 8, M_WAIT); + M_PREPEND(m, 8, M_WAITOK); type = htons(m->m_pkthdr.len); cp = mtod(m, u_char *); bcopy("\xAA\xAA\x03\x00\x00\x00\x81\x37", cp, 8); diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 44ac25d53935..bb4029e95dfc 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -260,7 +260,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct llc llc; ifa_free(&aa->aa_ifa); - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == NULL) senderr(ENOBUFS); llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; @@ -313,7 +313,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); if (m == NULL) senderr(ENOBUFS); eh = mtod(m, struct ether_header *); @@ -362,7 +362,7 @@ ether_output(struct ifnet *ifp, struct mbuf *m, * often used kernel parts suffer from the same bug. * See PR kern/105943 for a proposed general solution. */ - if ((n = m_dup(m, M_DONTWAIT)) != NULL) { + if ((n = m_dup(m, M_NOWAIT)) != NULL) { n->m_pkthdr.csum_flags |= csum_flags; if (csum_flags & CSUM_DATA_VALID) n->m_pkthdr.csum_data = 0xffff; @@ -864,7 +864,7 @@ ether_demux(struct ifnet *ifp, struct mbuf *m) * Put back the ethernet header so netgraph has a * consistent view of inbound packets. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); (*ng_ether_input_orphan_p)(ifp, m); return; } @@ -1288,7 +1288,7 @@ ether_vlanencap(struct mbuf *m, uint16_t tag) { struct ether_vlan_header *evl; - M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_NOWAIT); if (m == NULL) return (NULL); /* M_PREPEND takes care of m_len, m_pkthdr.len for us */ diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index d98029cfe887..57fb27d36d51 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -212,7 +212,7 @@ fddi_output(ifp, m, dst, ro) if (aa->aa_flags & AFA_PHASE2) { struct llc llc; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_WAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_WAITOK); llc.llc_dsap = llc.llc_ssap = LLC_SNAP_LSAP; llc.llc_control = LLC_UI; bcopy(at_org_code, llc.llc_snap.org_code, sizeof(at_org_code)); @@ -291,7 +291,7 @@ fddi_output(ifp, m, dst, ro) */ if (type != 0) { struct llc *l; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); l = mtod(m, struct llc *); @@ -307,7 +307,7 @@ fddi_output(ifp, m, dst, ro) * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, FDDI_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, FDDI_HDR_LEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); fh = mtod(m, struct fddi_header *); diff --git a/sys/net/if_fwsubr.c b/sys/net/if_fwsubr.c index 5414d792de04..e1d5c01022a6 100644 --- a/sys/net/if_fwsubr.c +++ b/sys/net/if_fwsubr.c @@ -229,7 +229,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, /* * No fragmentation is necessary. */ - M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); + M_PREPEND(m, sizeof(uint32_t), M_NOWAIT); if (!m) { error = ENOBUFS; goto bad; @@ -261,7 +261,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, * Split off the tail segment from the * datagram, copying our tags over. */ - mtail = m_split(m, fsize, M_DONTWAIT); + mtail = m_split(m, fsize, M_NOWAIT); m_tag_copy_chain(mtail, m, M_NOWAIT); } else { mtail = 0; @@ -271,7 +271,7 @@ firewire_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, * Add our encapsulation header to this * fragment and hand it off to the link. */ - M_PREPEND(m, 2*sizeof(uint32_t), M_DONTWAIT); + M_PREPEND(m, 2*sizeof(uint32_t), M_NOWAIT); if (!m) { error = ENOBUFS; goto bad; diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index b72f064fa641..27e58d800ce8 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -385,7 +385,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, if ((m->m_data - msiz) < m->m_pktdat) { /* need new mbuf */ - MGETHDR(m0, M_DONTWAIT, MT_DATA); + MGETHDR(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) { _IF_DROP(&ifp->if_snd); m_freem(m); @@ -452,7 +452,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, int hdrlen = sizeof(struct greip) + extra; if (sc->key) hdrlen += sizeof(uint32_t); - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); } else { _IF_DROP(&ifp->if_snd); m_freem(m); diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 91d67fdd5323..7f9e8bd10ae0 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -338,7 +338,7 @@ iso88025_output(ifp, m, dst, ro) bcopy((caddr_t)&(satoipx_addr(dst).x_host), (caddr_t)edst, ISO88025_ADDR_LEN); - M_PREPEND(m, 3, M_WAIT); + M_PREPEND(m, 3, M_WAITOK); m = m_pullup(m, 3); if (m == 0) senderr(ENOBUFS); @@ -382,7 +382,7 @@ iso88025_output(ifp, m, dst, ro) */ if (snap_type != 0) { struct llc *l; - M_PREPEND(m, LLC_SNAPFRAMELEN, M_DONTWAIT); + M_PREPEND(m, LLC_SNAPFRAMELEN, M_NOWAIT); if (m == 0) senderr(ENOBUFS); l = mtod(m, struct llc *); @@ -398,7 +398,7 @@ iso88025_output(ifp, m, dst, ro) * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_DONTWAIT); + M_PREPEND(m, ISO88025_HDR_LEN + rif_len, M_NOWAIT); if (m == 0) senderr(ENOBUFS); th = mtod(m, struct iso88025_header *); diff --git a/sys/net/if_spppfr.c b/sys/net/if_spppfr.c index ee5339e56ab7..b5e24f6802d2 100644 --- a/sys/net/if_spppfr.c +++ b/sys/net/if_spppfr.c @@ -304,7 +304,7 @@ struct mbuf *sppp_fr_header (struct sppp *sp, struct mbuf *m, /* Prepend the space for Frame Relay header. */ hlen = (family == AF_INET) ? 4 : 10; - M_PREPEND (m, hlen, M_DONTWAIT); + M_PREPEND (m, hlen, M_NOWAIT); if (! m) return 0; h = mtod (m, u_char*); @@ -381,7 +381,7 @@ void sppp_fr_keepalive (struct sppp *sp) unsigned char *h, *p; struct mbuf *m; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.rcvif = 0; @@ -501,7 +501,7 @@ static void sppp_fr_arp (struct sppp *sp, struct arp_req *req, (unsigned char) his_ip_address); /* Send the Inverse ARP reply. */ - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = 10 + sizeof (*reply); diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index e5fbac902c67..23851099f81b 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -629,7 +629,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m) * enough leading space in the existing mbuf). */ m_adj(m, vjlen); - M_PREPEND(m, hlen, M_DONTWAIT); + M_PREPEND(m, hlen, M_NOWAIT); if (m == NULL) { SPPP_UNLOCK(sp); goto drop2; @@ -920,7 +920,7 @@ sppp_output(struct ifnet *ifp, struct mbuf *m, /* * Prepend general data packet PPP header. For now, IP only. */ - M_PREPEND (m, PPP_HEADER_LEN, M_DONTWAIT); + M_PREPEND (m, PPP_HEADER_LEN, M_NOWAIT); if (! m) { nobufs: if (debug) log(LOG_DEBUG, SPP_FMT "no memory for transmit header\n", @@ -1392,7 +1392,7 @@ sppp_cisco_send(struct sppp *sp, int type, long par1, long par2) getmicrouptime(&tv); - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + CISCO_PACKET_LEN; @@ -1440,7 +1440,7 @@ sppp_cp_send(struct sppp *sp, u_short proto, u_char type, if (len > MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN) len = MHLEN - PPP_HEADER_LEN - LCP_HEADER_LEN; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.len = m->m_len = PPP_HEADER_LEN + LCP_HEADER_LEN + len; @@ -4722,7 +4722,7 @@ sppp_auth_send(const struct cp *cp, struct sppp *sp, const char *msg; va_list ap; - MGETHDR (m, M_DONTWAIT, MT_DATA); + MGETHDR (m, M_NOWAIT, MT_DATA); if (! m) return; m->m_pkthdr.rcvif = 0; diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c index edde4561f7fa..c7ea06c59e76 100644 --- a/sys/net/if_stf.c +++ b/sys/net/if_stf.c @@ -506,7 +506,7 @@ stf_output(ifp, m, dst, ro) bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m); } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m && m->m_len < sizeof(struct ip)) m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 5c8da74fd0ca..45bd7d269b9e 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -948,7 +948,7 @@ tapwrite(struct cdev *dev, struct uio *uio, int flag) return (EIO); } - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, ETHER_ALIGN, + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, ETHER_ALIGN, M_PKTHDR)) == NULL) { ifp->if_ierrors ++; return (ENOBUFS); diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index 086a3c188f8a..3630732deedd 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -622,7 +622,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, /* prepend sockaddr? this may abort if the mbuf allocation fails */ if (cached_tun_flags & TUN_LMODE) { /* allocate space for sockaddr */ - M_PREPEND(m0, dst->sa_len, M_DONTWAIT); + M_PREPEND(m0, dst->sa_len, M_NOWAIT); /* if allocation failed drop packet */ if (m0 == NULL) { @@ -636,7 +636,7 @@ tunoutput(struct ifnet *ifp, struct mbuf *m0, struct sockaddr *dst, if (cached_tun_flags & TUN_IFHEAD) { /* Prepend the address family */ - M_PREPEND(m0, 4, M_DONTWAIT); + M_PREPEND(m0, 4, M_NOWAIT); /* if allocation failed drop packet */ if (m0 == NULL) { @@ -872,7 +872,7 @@ tunwrite(struct cdev *dev, struct uio *uio, int flag) return (EIO); } - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) { + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) { ifp->if_ierrors++; return (ENOBUFS); } diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index d1bf200619ed..a4d7407814e2 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1113,9 +1113,9 @@ rt_msg1(int type, struct rt_addrinfo *rtinfo) } if (len > MCLBYTES) panic("rt_msg1"); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m && len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index ec7ee49b9779..1c6491551a4c 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -445,9 +445,9 @@ ieee80211_realign(struct ieee80211vap *vap, struct mbuf *m, size_t align) pktlen = m->m_pkthdr.len; space = pktlen + align; if (space < MINCLSIZE) - n = m_gethdr(M_DONTWAIT, MT_DATA); + n = m_gethdr(M_NOWAIT, MT_DATA); else { - n = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, + n = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, space <= MCLBYTES ? MCLBYTES : #if MJUMPAGESIZE != MCLBYTES space <= MJUMPAGESIZE ? MJUMPAGESIZE : diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 01a8078bdfe0..ad7987646c11 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -376,7 +376,7 @@ hostap_deliver_data(struct ieee80211vap *vap, struct mbuf *mcopy = NULL; if (m->m_flags & M_MCAST) { - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) ifp->if_oerrors++; else diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c index 4e2508e12027..fcc4af1a66a1 100644 --- a/sys/net80211/ieee80211_hwmp.c +++ b/sys/net80211/ieee80211_hwmp.c @@ -652,7 +652,7 @@ hwmp_send_action(struct ieee80211_node *ni, } m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); vap->iv_stats.is_tx_nobuf++; diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 76b3bedf12b1..a9acad189b32 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -131,7 +131,7 @@ ieee80211_input_mimo_all(struct ieee80211com *ic, struct mbuf *m, * Packet contents are changed by ieee80211_decap * so do a deep copy of the packet. */ - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) { /* XXX stat+msg */ continue; diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 89f85ad12632..6ab76d92a158 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -947,7 +947,7 @@ mesh_forward(struct ieee80211vap *vap, struct mbuf *m, vap->iv_stats.is_mesh_fwd_disabled++; return; } - mcopy = m_dup(m, M_DONTWAIT); + mcopy = m_dup(m, M_NOWAIT); if (mcopy == NULL) { IEEE80211_NOTE_FRAME(vap, IEEE80211_MSG_MESH, wh, "%s", "frame not fwd'd, cannot dup"); diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 7430c34aedda..57925f2e038c 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -632,7 +632,7 @@ ieee80211_mgmt_output(struct ieee80211_node *ni, struct mbuf *m, int type, return EIO; /* XXX */ } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { ieee80211_free_node(ni); return ENOMEM; @@ -718,7 +718,7 @@ ieee80211_send_nulldata(struct ieee80211_node *ni) } KASSERT(M_LEADINGSPACE(m) >= hdrlen, ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -1191,7 +1191,7 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee80211_node *ni, } datalen = m->m_pkthdr.len; /* NB: w/o 802.11 header */ - M_PREPEND(m, hdrspace + meshhdrsize, M_DONTWAIT); + M_PREPEND(m, hdrspace + meshhdrsize, M_NOWAIT); if (m == NULL) { vap->iv_stats.is_tx_nobuf++; goto bad; @@ -1430,9 +1430,9 @@ ieee80211_fragment(struct ieee80211vap *vap, struct mbuf *m0, KASSERT(fragsize < MCLBYTES, ("fragment size %u too big!", fragsize)); if (fragsize > MHLEN) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); else - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) goto bad; /* leave room to prepend any cipher header */ @@ -1867,7 +1867,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni, KASSERT(M_LEADINGSPACE(m) >= sizeof(struct ieee80211_frame), ("leading space %zd", M_LEADINGSPACE(m))); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); if (m == NULL) { /* NB: cannot happen */ ieee80211_free_node(ni); @@ -2495,7 +2495,7 @@ ieee80211_send_proberesp(struct ieee80211vap *vap, return ENOMEM; } - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); KASSERT(m != NULL, ("no room for header")); wh = mtod(m, struct ieee80211_frame *); @@ -2529,7 +2529,7 @@ ieee80211_alloc_rts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m != NULL) { rts = mtod(m, struct ieee80211_frame_rts *); rts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -2555,7 +2555,7 @@ ieee80211_alloc_cts(struct ieee80211com *ic, struct mbuf *m; /* XXX honor ic_headroom */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m != NULL) { cts = mtod(m, struct ieee80211_frame_cts *); cts->i_fc[0] = IEEE80211_FC0_VERSION_0 | @@ -2865,7 +2865,7 @@ ieee80211_beacon_alloc(struct ieee80211_node *ni, } ieee80211_beacon_construct(m, frm, bo, ni); - M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ieee80211_frame), M_NOWAIT); KASSERT(m != NULL, ("no space for 802.11 header?")); wh = mtod(m, struct ieee80211_frame *); wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | diff --git a/sys/net80211/ieee80211_superg.c b/sys/net80211/ieee80211_superg.c index 172c1f91fe6d..a061929d47a4 100644 --- a/sys/net80211/ieee80211_superg.c +++ b/sys/net80211/ieee80211_superg.c @@ -352,7 +352,7 @@ ff_encap1(struct ieee80211vap *vap, struct mbuf *m, llc->llc_snap.ether_type = eh->ether_type; payload = m->m_pkthdr.len; /* NB: w/o Ethernet header */ - M_PREPEND(m, sizeof(struct ether_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ether_header), M_NOWAIT); if (m == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for ether_header\n", __func__); @@ -460,7 +460,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, */ m->m_next = m2; /* NB: last mbuf from above */ m1->m_pkthdr.len += m2->m_pkthdr.len; - M_PREPEND(m1, sizeof(uint32_t)+2, M_DONTWAIT); + M_PREPEND(m1, sizeof(uint32_t)+2, M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for tunnel header\n", __func__); @@ -469,7 +469,7 @@ ieee80211_ff_encap(struct ieee80211vap *vap, struct mbuf *m1, int hdrspace, } memset(mtod(m1, void *), 0, sizeof(uint32_t)+2); - M_PREPEND(m1, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m1, sizeof(struct llc), M_NOWAIT); if (m1 == NULL) { /* XXX cannot happen */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SUPERG, "%s: no space for llc header\n", __func__); diff --git a/sys/net80211/ieee80211_wds.c b/sys/net80211/ieee80211_wds.c index ed82fac1c086..b9fd4ff87564 100644 --- a/sys/net80211/ieee80211_wds.c +++ b/sys/net80211/ieee80211_wds.c @@ -256,7 +256,7 @@ ieee80211_dwds_mcast(struct ieee80211vap *vap0, struct mbuf *m) /* * Duplicate the frame and send it. */ - mcopy = m_copypacket(m, M_DONTWAIT); + mcopy = m_copypacket(m, M_NOWAIT); if (mcopy == NULL) { ifp->if_oerrors++; /* XXX stat + msg */ diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c index 7e340de85004..4426d57c11fa 100644 --- a/sys/netatalk/aarp.c +++ b/sys/netatalk/aarp.c @@ -190,7 +190,7 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat) struct sockaddr sa; AARPTAB_UNLOCK_ASSERT(); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; #ifdef MAC @@ -230,7 +230,7 @@ aarpwhohas(struct ifnet *ifp, struct sockaddr_at *sat) sizeof(eh->ether_dhost)); eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m, sizeof(struct llc), M_NOWAIT); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -524,7 +524,7 @@ at_aarpinput(struct ifnet *ifp, struct mbuf *m) if (aa->aa_flags & AFA_PHASE2) { eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_DONTWAIT); + M_PREPEND(m, sizeof(struct llc), M_NOWAIT); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -643,7 +643,7 @@ aarpprobe(void *arg) ifa_ref(&aa->aa_ifa); AARPTAB_UNLOCK(); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { ifa_free(&aa->aa_ifa); return; @@ -673,7 +673,7 @@ aarpprobe(void *arg) sizeof(eh->ether_dhost)); eh->ether_type = htons(sizeof(struct llc) + sizeof(struct ether_aarp)); - M_PREPEND(m, sizeof(struct llc), M_WAIT); + M_PREPEND(m, sizeof(struct llc), M_WAITOK); llc = mtod(m, struct llc *); llc->llc_dsap = llc->llc_ssap = LLC_SNAP_LSAP; llc->llc_control = LLC_UI; diff --git a/sys/netatalk/ddp_output.c b/sys/netatalk/ddp_output.c index 1b178be49b8c..2b53de46e759 100644 --- a/sys/netatalk/ddp_output.c +++ b/sys/netatalk/ddp_output.c @@ -54,7 +54,7 @@ ddp_output(struct mbuf *m, struct socket *so) mac_socket_create_mbuf(so, m); #endif - M_PREPEND(m, sizeof(struct ddpehdr), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ddpehdr), M_NOWAIT); if (m == NULL) return (ENOBUFS); @@ -201,7 +201,7 @@ ddp_route(struct mbuf *m, struct route *ro) * removing mac_mbuf_copy(). */ if (!(aa->aa_flags & AFA_PHASE2)) { - MGET(m0, M_DONTWAIT, MT_DATA); + MGET(m0, M_NOWAIT, MT_DATA); if (m0 == NULL) { ifa_free(&aa->aa_ifa); m_freem(m); diff --git a/sys/netgraph/atm/ccatm/ng_ccatm.c b/sys/netgraph/atm/ccatm/ng_ccatm.c index a6ff474f2ae1..cdbc86f86331 100644 --- a/sys/netgraph/atm/ccatm/ng_ccatm.c +++ b/sys/netgraph/atm/ccatm/ng_ccatm.c @@ -434,13 +434,13 @@ send_dump(struct ccdata *data, void *uarg, const char *buf) struct ccnode *priv = uarg; if (priv->dump == NULL) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); priv->dump_first = priv->dump_last = m; m->m_pkthdr.len = 0; } else { - m = m_getcl(M_DONTWAIT, MT_DATA, 0); + m = m_getcl(M_NOWAIT, MT_DATA, 0); if (m == 0) { m_freem(priv->dump_first); return (ENOBUFS); diff --git a/sys/netgraph/atm/ng_atm.c b/sys/netgraph/atm/ng_atm.c index 32bde57ad02f..ef168ac719c2 100644 --- a/sys/netgraph/atm/ng_atm.c +++ b/sys/netgraph/atm/ng_atm.c @@ -384,7 +384,7 @@ ng_atm_input(struct ifnet *ifp, struct mbuf **mp, /* * Prepend the atm_pseudoheader. */ - M_PREPEND(*mp, sizeof(*ah), M_DONTWAIT); + M_PREPEND(*mp, sizeof(*ah), M_NOWAIT); if (*mp == NULL) return; memcpy(mtod(*mp, struct atm_pseudohdr *), ah, sizeof(*ah)); @@ -462,7 +462,7 @@ ng_atm_input_orphans(struct ifnet *ifp, struct mbuf *m, /* * Prepend the atm_pseudoheader. */ - M_PREPEND(m, sizeof(*ah), M_DONTWAIT); + M_PREPEND(m, sizeof(*ah), M_NOWAIT); if (m == NULL) return; memcpy(mtod(m, struct atm_pseudohdr *), ah, sizeof(*ah)); @@ -502,7 +502,7 @@ ng_atm_rcvdata(hook_p hook, item_p item) /* * Prepend pseudo-hdr. Drivers don't care about the flags. */ - M_PREPEND(m, sizeof(*aph), M_DONTWAIT); + M_PREPEND(m, sizeof(*aph), M_NOWAIT); if (m == NULL) { NG_FREE_M(m); return (ENOMEM); diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c index b244b3019cd1..f2930abcdb02 100644 --- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c +++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c @@ -807,7 +807,7 @@ bt3c_receive(bt3c_softc_p sc) sc->state = NG_BT3C_W4_PKT_IND; sc->want = 1; - MGETHDR(sc->m, M_DONTWAIT, MT_DATA); + MGETHDR(sc->m, M_NOWAIT, MT_DATA); if (sc->m == NULL) { NG_BT3C_ERR(sc->dev, "Could not get mbuf\n"); NG_BT3C_STAT_IERROR(sc->stat); @@ -815,7 +815,7 @@ bt3c_receive(bt3c_softc_p sc) break; /* XXX lost of sync */ } - MCLGET(sc->m, M_DONTWAIT); + MCLGET(sc->m, M_NOWAIT); if (!(sc->m->m_flags & M_EXT)) { NG_FREE_M(sc->m); diff --git a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c index 2bf1717db7f6..97cee2ed29ad 100644 --- a/sys/netgraph/bluetooth/drivers/h4/ng_h4.c +++ b/sys/netgraph/bluetooth/drivers/h4/ng_h4.c @@ -525,7 +525,7 @@ ng_h4_input(int c, struct tty *tp) if (sc->hook != NULL && NG_HOOK_IS_VALID(sc->hook)) { struct mbuf *m = NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { m->m_pkthdr.len = 0; diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index 44654d20555d..6de270fd9f9b 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -710,13 +710,13 @@ ubt_intr_read_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: /* Allocate a new mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); goto submit_next; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); goto submit_next; @@ -810,13 +810,13 @@ ubt_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: /* Allocate new mbuf */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); goto submit_next; } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); goto submit_next; @@ -1020,13 +1020,13 @@ ubt_isoc_read_one_frame(struct usb_xfer *xfer, int frame_no) while (total > 0) { if (m == NULL) { /* Start new reassembly buffer */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { UBT_STAT_IERROR(sc); return (-1); /* XXX out of sync! */ } - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { UBT_STAT_IERROR(sc); NG_FREE_M(m); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_cmds.c b/sys/netgraph/bluetooth/hci/ng_hci_cmds.c index 8d630a272b84..1dc9854e342a 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_cmds.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_cmds.c @@ -118,7 +118,7 @@ ng_hci_send_command(ng_hci_unit_p unit) ng_hci_mtap(unit, m0); - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) NG_SEND_DATA_ONLY(error, unit->drv, m); else diff --git a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c index a4cc9ba45470..b8dd21fd1580 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_evnt.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_evnt.c @@ -511,7 +511,7 @@ con_compl(ng_hci_unit_p unit, struct mbuf *event) } __attribute__ ((packed)) *lp; struct mbuf *m; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m != NULL) { m->m_pkthdr.len = m->m_len = sizeof(*lp); lp = mtod(m, struct __link_policy *); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_misc.c b/sys/netgraph/bluetooth/hci/ng_hci_misc.c index 252a5809039e..2209fbde0493 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_misc.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_misc.c @@ -65,7 +65,7 @@ ng_hci_mtap(ng_hci_unit_p unit, struct mbuf *m0) int error = 0; if (unit->raw != NULL && NG_HOOK_IS_VALID(unit->raw)) { - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) NG_SEND_DATA_ONLY(error, unit->raw, m); diff --git a/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c b/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c index 311bd4f782f6..4c06c07938b0 100644 --- a/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c +++ b/sys/netgraph/bluetooth/hci/ng_hci_ulpi.c @@ -224,7 +224,7 @@ ng_hci_lp_acl_con_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ng_hci_free_con(con); error = ENOBUFS; @@ -417,7 +417,7 @@ ng_hci_lp_sco_con_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { ng_hci_free_con(sco_con); error = ENOBUFS; @@ -531,7 +531,7 @@ ng_hci_lp_discon_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; @@ -776,7 +776,7 @@ ng_hci_lp_con_rsp(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; @@ -996,7 +996,7 @@ ng_hci_lp_qos_req(ng_hci_unit_p unit, item_p item, hook_p hook) * Create HCI command */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h b/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h index ed225c837792..52789a159125 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.h @@ -56,7 +56,7 @@ do { \ ng_l2cap_cmd_rej_data_t data; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -90,7 +90,7 @@ do { \ ng_l2cap_con_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -113,7 +113,7 @@ do { \ ng_l2cap_con_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -138,7 +138,7 @@ do { \ ng_l2cap_cfg_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) { \ NG_FREE_M((_data)); \ break; \ @@ -172,7 +172,7 @@ do { \ ng_l2cap_cfg_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) { \ NG_FREE_M((_data)); \ break; \ @@ -204,7 +204,7 @@ do { \ do { \ u_int8_t *p = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -281,7 +281,7 @@ do { \ ng_l2cap_discon_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -304,7 +304,7 @@ do { \ ng_l2cap_discon_rsp_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -324,7 +324,7 @@ do { \ do { \ ng_l2cap_cmd_hdr_t *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -351,7 +351,7 @@ do { \ ng_l2cap_info_req_cp param; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ @@ -374,7 +374,7 @@ do { \ ng_l2cap_info_rsp_data_t data; \ } __attribute__ ((packed)) *c = NULL; \ \ - MGETHDR((_m), M_DONTWAIT, MT_DATA); \ + MGETHDR((_m), M_NOWAIT, MT_DATA); \ if ((_m) == NULL) \ break; \ \ diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c index 9d5268e89cf4..747b74ca7086 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c @@ -192,7 +192,7 @@ ng_l2cap_process_signal_cmd(ng_l2cap_con_p con) /* Get the command, save the rest (if any) */ if (con->rx_pkt->m_pkthdr.len > hdr->length) - m = m_split(con->rx_pkt, hdr->length, M_DONTWAIT); + m = m_split(con->rx_pkt, hdr->length, M_NOWAIT); else m = NULL; diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c index 923ecfc6ffdd..704e74a9110e 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_llpi.c @@ -528,7 +528,7 @@ ng_l2cap_lp_send(ng_l2cap_con_p con, u_int16_t dcid, struct mbuf *m0) /* Check length of the packet against HCI MTU */ len = m0->m_pkthdr.len; if (len > l2cap->pkt_size) { - m = m_split(m0, l2cap->pkt_size, M_DONTWAIT); + m = m_split(m0, l2cap->pkt_size, M_NOWAIT); if (m == NULL) { NG_L2CAP_ALERT( "%s: %s - m_split(%d) failed\n", __func__, NG_NODE_NAME(l2cap->node), diff --git a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c index 3791dcd0f0fb..0c3f1d0877bf 100644 --- a/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c +++ b/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c @@ -558,7 +558,7 @@ ng_l2cap_command_untimeout(ng_l2cap_cmd_p cmd) struct mbuf * ng_l2cap_prepend(struct mbuf *m, int size) { - M_PREPEND(m, size, M_DONTWAIT); + M_PREPEND(m, size, M_NOWAIT); if (m == NULL || (m->m_len < size && (m = m_pullup(m, size)) == NULL)) return (NULL); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c index df189130fb6d..35cd766d2ebe 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_hci_raw.c @@ -310,7 +310,7 @@ ng_btsocket_hci_raw_node_rcvdata(hook_p hook, item_p item) * for now */ - MGET(nam, M_DONTWAIT, MT_SONAME); + MGET(nam, M_NOWAIT, MT_SONAME); if (nam != NULL) { struct sockaddr_hci *sa = mtod(nam, struct sockaddr_hci *); @@ -519,7 +519,7 @@ ng_btsocket_hci_raw_data_input(struct mbuf *nam) * will check if socket has enough buffer space. */ - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m != NULL) { struct mbuf *ctl = NULL; @@ -1585,7 +1585,7 @@ ng_btsocket_hci_raw_send(struct socket *so, int flags, struct mbuf *m, sa = (struct sockaddr *) &pcb->addr; } - MGET(nam, M_DONTWAIT, MT_SONAME); + MGET(nam, M_NOWAIT, MT_SONAME); if (nam == NULL) { mtx_unlock(&pcb->pcb_mtx); error = ENOBUFS; diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c index 0066a855a2bd..993494596ccc 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c @@ -1533,7 +1533,7 @@ ng_btsocket_l2cap_data_input(struct mbuf *m, hook_p hook) * it is a broadcast traffic after all */ - copy = m_dup(m, M_DONTWAIT); + copy = m_dup(m, M_NOWAIT); if (copy != NULL) { sbappendrecord(&pcb->so->so_rcv, copy); sorwakeup(pcb->so); @@ -2513,12 +2513,12 @@ ng_btsocket_l2cap_send2(ng_btsocket_l2cap_pcb_p pcb) if (pcb->so->so_snd.sb_cc == 0) return (EINVAL); /* XXX */ - m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); + m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); if (m == NULL) return (ENOBUFS); /* Create L2CA packet header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m != NULL) if (m->m_len < sizeof(*hdr)) m = m_pullup(m, sizeof(*hdr)); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c index a0e266ed72b5..0ffc12e8957b 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c @@ -3005,7 +3005,7 @@ ng_btsocket_rfcomm_send_command(ng_btsocket_rfcomm_session_p s, /* NOT REACHED */ } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3036,14 +3036,14 @@ ng_btsocket_rfcomm_send_uih(ng_btsocket_rfcomm_session_p s, u_int8_t address, mtx_assert(&s->session_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { NG_FREE_M(data); return (ENOBUFS); } m->m_pkthdr.len = m->m_len = sizeof(*hdr); - MGET(mcrc, M_DONTWAIT, MT_DATA); + MGET(mcrc, M_NOWAIT, MT_DATA); if (mcrc == NULL) { NG_FREE_M(data); return (ENOBUFS); @@ -3110,7 +3110,7 @@ ng_btsocket_rfcomm_send_msc(ng_btsocket_rfcomm_pcb_p pcb) mtx_assert(&pcb->session->session_mtx, MA_OWNED); mtx_assert(&pcb->pcb_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3148,7 +3148,7 @@ ng_btsocket_rfcomm_send_pn(ng_btsocket_rfcomm_pcb_p pcb) mtx_assert(&pcb->session->session_mtx, MA_OWNED); mtx_assert(&pcb->pcb_mtx, MA_OWNED); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -3519,7 +3519,7 @@ ng_btsocket_rfcomm_prepare_packet(struct sockbuf *sb, int length) struct mbuf *top = NULL, *m = NULL, *n = NULL, *nextpkt = NULL; int mlen, noff, len; - MGETHDR(top, M_DONTWAIT, MT_DATA); + MGETHDR(top, M_NOWAIT, MT_DATA); if (top == NULL) return (NULL); @@ -3543,7 +3543,7 @@ ng_btsocket_rfcomm_prepare_packet(struct sockbuf *sb, int length) length -= len; if (length > 0 && m->m_len == mlen) { - MGET(m->m_next, M_DONTWAIT, MT_DATA); + MGET(m->m_next, M_NOWAIT, MT_DATA); if (m->m_next == NULL) { NG_FREE_M(top); return (NULL); diff --git a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c index 12786fa9cd1a..7727d7c7f5c8 100644 --- a/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c +++ b/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c @@ -1746,14 +1746,14 @@ ng_btsocket_sco_send2(ng_btsocket_sco_pcb_p pcb) while (pcb->rt->pending < pcb->rt->num_pkts && pcb->so->so_snd.sb_cc > 0) { /* Get a copy of the first packet on send queue */ - m = m_dup(pcb->so->so_snd.sb_mb, M_DONTWAIT); + m = m_dup(pcb->so->so_snd.sb_mb, M_NOWAIT); if (m == NULL) { error = ENOBUFS; break; } /* Create SCO packet header */ - M_PREPEND(m, sizeof(*hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(*hdr), M_NOWAIT); if (m != NULL) if (m->m_len < sizeof(*hdr)) m = m_pullup(m, sizeof(*hdr)); diff --git a/sys/netgraph/netflow/netflow.c b/sys/netgraph/netflow/netflow.c index 2775756d0449..c889a0de91a0 100644 --- a/sys/netgraph/netflow/netflow.c +++ b/sys/netgraph/netflow/netflow.c @@ -214,7 +214,7 @@ get_export_dgram(priv_p priv, fib_export_p fe) struct netflow_v5_export_dgram *dgram; struct mbuf *m; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (NULL); item = ng_package_data(m, NG_NOFLAGS); diff --git a/sys/netgraph/netflow/netflow_v9.c b/sys/netgraph/netflow/netflow_v9.c index e0406655f770..a3c57911c9b3 100644 --- a/sys/netgraph/netflow/netflow_v9.c +++ b/sys/netgraph/netflow/netflow_v9.c @@ -386,7 +386,7 @@ get_export9_dgram(priv_p priv, fib_export_p fe, struct netflow_v9_packet_opt **t uint16_t mtu = priv->mtu; /* Allocate entire packet at once, allowing easy m_append() calls */ - m = m_getm(NULL, mtu, M_DONTWAIT, MT_DATA); + m = m_getm(NULL, mtu, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); diff --git a/sys/netgraph/ng_UI.c b/sys/netgraph/ng_UI.c index b06c17a22038..8e8ab55d6490 100644 --- a/sys/netgraph/ng_UI.c +++ b/sys/netgraph/ng_UI.c @@ -188,7 +188,7 @@ ng_UI_rcvdata(hook_p hook, item_p item) m_adj(m, ptr - start); NG_FWD_NEW_DATA(error, item, priv->uplink, m); /* m -> NULL */ } else if (hook == priv->uplink) { - M_PREPEND(m, 1, M_DONTWAIT); /* Prepend IP NLPID */ + M_PREPEND(m, 1, M_NOWAIT); /* Prepend IP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; diff --git a/sys/netgraph/ng_atmllc.c b/sys/netgraph/ng_atmllc.c index 3ba9dff75ae0..f35707b90b6d 100644 --- a/sys/netgraph/ng_atmllc.c +++ b/sys/netgraph/ng_atmllc.c @@ -202,7 +202,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p item) m_adj(m, sizeof(struct atmllc) + padding); } else if (hook == priv->ether) { /* Add the LLC header */ - M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 2, M_DONTWAIT); + M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 2, M_NOWAIT); if (m == NULL) { printf("ng_atmllc: M_PREPEND failed\n"); NG_FREE_ITEM(item); @@ -219,7 +219,7 @@ ng_atmllc_rcvdata(hook_p hook, item_p item) outhook = priv->atm; } else if (hook == priv->fddi) { /* Add the LLC header */ - M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 3, M_DONTWAIT); + M_PREPEND(m, NG_ATMLLC_HEADER_LEN + 3, M_NOWAIT); if (m == NULL) { printf("ng_atmllc: M_PREPEND failed\n"); NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_bridge.c b/sys/netgraph/ng_bridge.c index 738441d835c1..becfea160ed7 100644 --- a/sys/netgraph/ng_bridge.c +++ b/sys/netgraph/ng_bridge.c @@ -719,7 +719,7 @@ ng_bridge_rcvdata(hook_p hook, item_p item) * It's usable link but not the reserved (first) one. * Copy mbuf info for sending. */ - m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { link->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_cisco.c b/sys/netgraph/ng_cisco.c index 7183369ee38a..f937557fa798 100644 --- a/sys/netgraph/ng_cisco.c +++ b/sys/netgraph/ng_cisco.c @@ -360,7 +360,7 @@ cisco_rcvdata(hook_p hook, item_p item) /* OK so it came from a protocol, heading out. Prepend general data packet header. For now, IP,IPX only */ NGI_GET_M(item, m); - M_PREPEND(m, CISCO_HEADER_LEN, M_DONTWAIT); + M_PREPEND(m, CISCO_HEADER_LEN, M_NOWAIT); if (!m) { error = ENOBUFS; goto out; @@ -608,7 +608,7 @@ cisco_send(sc_p sc, int type, long par1, long par2) getmicrouptime(&time); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) return (ENOBUFS); diff --git a/sys/netgraph/ng_deflate.c b/sys/netgraph/ng_deflate.c index 5fa6363e8313..da68e49d24a8 100644 --- a/sys/netgraph/ng_deflate.c +++ b/sys/netgraph/ng_deflate.c @@ -462,7 +462,7 @@ ng_deflate_compress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); @@ -556,7 +556,7 @@ ng_deflate_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index f6e60879e351..723fbca8379e 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -465,7 +465,7 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag) if (uio->uio_resid < 0 || uio->uio_resid > IP_MAXPACKET) return (EIO); - if ((m = m_uiotombuf(uio, M_DONTWAIT, 0, 0, M_PKTHDR)) == NULL) + if ((m = m_uiotombuf(uio, M_NOWAIT, 0, 0, M_PKTHDR)) == NULL) return (ENOBUFS); NG_SEND_DATA_ONLY(error, priv->hook, m); diff --git a/sys/netgraph/ng_frame_relay.c b/sys/netgraph/ng_frame_relay.c index 05c311d8d7b6..4d39d11e1b63 100644 --- a/sys/netgraph/ng_frame_relay.c +++ b/sys/netgraph/ng_frame_relay.c @@ -360,7 +360,7 @@ ngfrm_rcvdata(hook_p hook, item_p item) alen = sc->addrlen; if (alen == 0) alen = 2; /* default value for transmit */ - M_PREPEND(m, alen, M_DONTWAIT); + M_PREPEND(m, alen, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/netgraph/ng_gif.c b/sys/netgraph/ng_gif.c index d362152323ae..580b8b13bd85 100644 --- a/sys/netgraph/ng_gif.c +++ b/sys/netgraph/ng_gif.c @@ -303,7 +303,7 @@ ng_gif_glue_af(struct mbuf **mp, int af) * hopefully everything after that will not * need one. So let's just use M_PREPEND. */ - M_PREPEND(m, sizeof (tmp_af), M_DONTWAIT); + M_PREPEND(m, sizeof (tmp_af), M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto done; diff --git a/sys/netgraph/ng_gif_demux.c b/sys/netgraph/ng_gif_demux.c index 646e37dd5d49..ce0fba01893e 100644 --- a/sys/netgraph/ng_gif_demux.c +++ b/sys/netgraph/ng_gif_demux.c @@ -341,7 +341,7 @@ ng_gif_demux_rcvdata(hook_p hook, item_p item) * Add address family header and set the output hook. */ iffam = get_iffam_from_hook(priv, hook); - M_PREPEND(m, sizeof (iffam->family), M_DONTWAIT); + M_PREPEND(m, sizeof (iffam->family), M_NOWAIT); if (m == NULL) { NG_FREE_M(m); NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_hub.c b/sys/netgraph/ng_hub.c index 2a8c2d2a6923..9348b27c9fac 100644 --- a/sys/netgraph/ng_hub.c +++ b/sys/netgraph/ng_hub.c @@ -133,7 +133,7 @@ ng_hub_rcvdata(hook_p hook, item_p item) if (--nhooks == 1) NG_FWD_ITEM_HOOK(error, item, hook2); else { - if ((m2 = m_dup(m, M_DONTWAIT)) == NULL) { + if ((m2 = m_dup(m, M_NOWAIT)) == NULL) { NG_FREE_ITEM(item); return (ENOBUFS); } diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 3ce0261287cc..5e6f12fb4b5d 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -394,7 +394,7 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, ng_iface_bpftap(ifp, m, dst->sa_family); if (ALTQ_IS_ENABLED(&ifp->if_snd)) { - M_PREPEND(m, sizeof(sa_family_t), M_DONTWAIT); + M_PREPEND(m, sizeof(sa_family_t), M_NOWAIT); if (m == NULL) { IFQ_LOCK(&ifp->if_snd); IFQ_INC_DROPS(&ifp->if_snd); diff --git a/sys/netgraph/ng_ipfw.c b/sys/netgraph/ng_ipfw.c index 82a7238a8380..8c777980d3c2 100644 --- a/sys/netgraph/ng_ipfw.c +++ b/sys/netgraph/ng_ipfw.c @@ -320,7 +320,7 @@ ng_ipfw_input(struct mbuf **m0, int dir, struct ip_fw_args *fwa, int tee) m_tag_prepend(m, tag); } else - if ((m = m_dup(*m0, M_DONTWAIT)) == NULL) + if ((m = m_dup(*m0, M_NOWAIT)) == NULL) return (ENOMEM); /* which is ignored */ if (m->m_len < sizeof(struct ip) && diff --git a/sys/netgraph/ng_l2tp.c b/sys/netgraph/ng_l2tp.c index 3b91b84d04f4..bd98e6ce3b58 100644 --- a/sys/netgraph/ng_l2tp.c +++ b/sys/netgraph/ng_l2tp.c @@ -934,7 +934,7 @@ ng_l2tp_rcvdata_lower(hook_p h, item_p item) mtx_unlock(&seq->mtx); /* Prepend session ID to packet. */ - M_PREPEND(m, 2, M_DONTWAIT); + M_PREPEND(m, 2, M_NOWAIT); if (m == NULL) { seq->inproc = 0; priv->stats.memoryFailures++; @@ -1071,7 +1071,7 @@ ng_l2tp_rcvdata_ctrl(hook_p hook, item_p item) mtx_unlock(&seq->mtx); /* Copy packet */ - if ((m = L2TP_COPY_MBUF(m, M_DONTWAIT)) == NULL) { + if ((m = L2TP_COPY_MBUF(m, M_NOWAIT)) == NULL) { priv->stats.memoryFailures++; ERROUT(ENOBUFS); } @@ -1122,7 +1122,7 @@ ng_l2tp_rcvdata(hook_p hook, item_p item) M_PREPEND(m, 6 + (2 * (hpriv->conf.include_length != 0)) + (4 * (hpriv->conf.enable_dseq != 0)), - M_DONTWAIT); + M_NOWAIT); if (m == NULL) { priv->stats.memoryFailures++; NG_FREE_ITEM(item); @@ -1406,7 +1406,7 @@ ng_l2tp_seq_recv_nr(priv_p priv, u_int16_t nr) */ for (i = 0; i < j; i++) { struct mbuf *m; - if ((m = L2TP_COPY_MBUF(xwin[i], M_DONTWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(xwin[i], M_NOWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, ns); @@ -1482,7 +1482,7 @@ ng_l2tp_seq_rack_timeout(node_p node, hook_p hook, void *arg1, int arg2) seq->acks = 0; /* Retransmit oldest unack'd packet */ - if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_DONTWAIT)) == NULL) + if ((m = L2TP_COPY_MBUF(seq->xwin[0], M_NOWAIT)) == NULL) priv->stats.memoryFailures++; else ng_l2tp_xmit_ctrl(priv, m, seq->ns++); @@ -1521,7 +1521,7 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) if (m == NULL) { /* Create a new mbuf for ZLB packet */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { priv->stats.memoryFailures++; return (ENOBUFS); @@ -1539,7 +1539,7 @@ ng_l2tp_xmit_ctrl(priv_p priv, struct mbuf *m, u_int16_t ns) session_id = (mtod(m, u_int8_t *)[0] << 8) + mtod(m, u_int8_t *)[1]; /* Make room for L2TP header */ - M_PREPEND(m, 10, M_DONTWAIT); /* - 2 + 12 = 10 */ + M_PREPEND(m, 10, M_NOWAIT); /* - 2 + 12 = 10 */ if (m == NULL) { priv->stats.memoryFailures++; return (ENOBUFS); diff --git a/sys/netgraph/ng_lmi.c b/sys/netgraph/ng_lmi.c index 2624e06d95c0..6d3fb208b19f 100644 --- a/sys/netgraph/ng_lmi.c +++ b/sys/netgraph/ng_lmi.c @@ -317,7 +317,7 @@ nglmi_inquire(sc_p sc, int full) if (sc->lmi_channel == NULL) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { log(LOG_ERR, "nglmi: unable to start up LMI processing\n"); return; diff --git a/sys/netgraph/ng_mppc.c b/sys/netgraph/ng_mppc.c index 6754be79c08e..ddf97d19da6f 100644 --- a/sys/netgraph/ng_mppc.c +++ b/sys/netgraph/ng_mppc.c @@ -467,7 +467,7 @@ ng_mppc_compress(node_p node, struct mbuf **datap) struct mbuf *m = *datap; /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) return (ENOMEM); @@ -595,7 +595,7 @@ ng_mppc_compress(node_p node, struct mbuf **datap) MPPC_CCOUNT_INC(d->cc); /* Install header */ - M_PREPEND(m, MPPC_HDRLEN, M_DONTWAIT); + M_PREPEND(m, MPPC_HDRLEN, M_NOWAIT); if (m != NULL) be16enc(mtod(m, void *), header); @@ -617,7 +617,7 @@ ng_mppc_decompress(node_p node, struct mbuf **datap) struct mbuf *m = *datap; /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) return (ENOMEM); diff --git a/sys/netgraph/ng_one2many.c b/sys/netgraph/ng_one2many.c index 5984279120a9..8171005efa80 100644 --- a/sys/netgraph/ng_one2many.c +++ b/sys/netgraph/ng_one2many.c @@ -459,7 +459,7 @@ ng_one2many_rcvdata(hook_p hook, item_p item) struct ng_one2many_link *mdst; mdst = &priv->many[priv->activeMany[i]]; - m2 = m_dup(m, M_DONTWAIT); /* XXX m_copypacket() */ + m2 = m_dup(m, M_NOWAIT); /* XXX m_copypacket() */ if (m2 == NULL) { mdst->stats.memoryFailures++; NG_FREE_ITEM(item); diff --git a/sys/netgraph/ng_ppp.c b/sys/netgraph/ng_ppp.c index b26163af9d73..9db1a2fb1eb5 100644 --- a/sys/netgraph/ng_ppp.c +++ b/sys/netgraph/ng_ppp.c @@ -2095,7 +2095,7 @@ ng_ppp_mp_xmit(node_p node, item_p item, uint16_t proto) /* Split off next fragment as "m2" */ m2 = m; if (!lastFragment) { - struct mbuf *n = m_split(m, len, M_DONTWAIT); + struct mbuf *n = m_split(m, len, M_NOWAIT); if (n == NULL) { NG_FREE_M(m); @@ -2103,7 +2103,7 @@ ng_ppp_mp_xmit(node_p node, item_p item, uint16_t proto) NG_FREE_ITEM(item); return (ENOMEM); } - m_tag_copy_chain(n, m, M_DONTWAIT); + m_tag_copy_chain(n, m, M_NOWAIT); m = n; } @@ -2445,7 +2445,7 @@ ng_ppp_cutproto(struct mbuf *m, uint16_t *proto) static struct mbuf * ng_ppp_prepend(struct mbuf *m, const void *buf, int len) { - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m == NULL || (m->m_len < len && (m = m_pullup(m, len)) == NULL)) return (NULL); bcopy(buf, mtod(m, uint8_t *), len); diff --git a/sys/netgraph/ng_pppoe.c b/sys/netgraph/ng_pppoe.c index 3b953b3201fe..818bd7ac7f27 100644 --- a/sys/netgraph/ng_pppoe.c +++ b/sys/netgraph/ng_pppoe.c @@ -460,7 +460,7 @@ pppoe_broadcast_padi(node_p node, struct mbuf *m0) LIST_FOREACH(sp, &privp->listeners, sessions) { struct mbuf *m; - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); if (m == NULL) return (ENOMEM); NG_SEND_DATA_ONLY(error, sp->hook, m); @@ -801,7 +801,7 @@ ng_pppoe_rcvmsg(node_p node, item_p item, hook_p lasthook) if (neg == NULL) LEAVE(ENOMEM); - neg->m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + neg->m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (neg->m == NULL) { free(neg, M_NETGRAPH_PPPOE); LEAVE(ENOBUFS); @@ -1078,7 +1078,7 @@ pppoe_start(sessp sp) ng_callout(&neg->handle, node, hook, PPPOE_INITIAL_TIMEOUT * hz, pppoe_ticker, NULL, 0); neg->timeout = PPPOE_INITIAL_TIMEOUT * 2; - m0 = m_copypacket(neg->m, M_DONTWAIT); + m0 = m_copypacket(neg->m, M_NOWAIT); NG_SEND_DATA_ONLY(error, privp->ethernet_hook, m0); } @@ -1161,7 +1161,7 @@ ng_pppoe_rcvdata(hook_p hook, item_p item) * Bang in a pre-made header, and set the length up * to be correct. Then send it to the ethernet driver. */ - M_PREPEND(m, sizeof(*wh), M_DONTWAIT); + M_PREPEND(m, sizeof(*wh), M_NOWAIT); if (m == NULL) LEAVE(ENOBUFS); @@ -1251,7 +1251,7 @@ ng_pppoe_rcvdata(hook_p hook, item_p item) */ ng_callout(&neg->handle, node, hook, PPPOE_OFFER_TIMEOUT * hz, pppoe_ticker, NULL, 0); - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); privp->packets_out++; break; @@ -1338,7 +1338,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) * Put it into a cluster. */ struct mbuf *n; - n = m_dup(m, M_DONTWAIT); + n = m_dup(m, M_NOWAIT); m_freem(m); m = n; if (m) { @@ -1472,7 +1472,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) PPPOE_INITIAL_TIMEOUT * hz, pppoe_ticker, NULL, 0); neg->timeout = PPPOE_INITIAL_TIMEOUT * 2; - m0 = m_copypacket(neg->m, M_DONTWAIT); + m0 = m_copypacket(neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); break; case PADR_CODE: @@ -1530,7 +1530,7 @@ ng_pppoe_rcvdata_ether(hook_p hook, item_p item) sp->state = PPPOE_NEWCONNECTED; /* Send the PADS without a timeout - we're now connected. */ - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_FWD_NEW_DATA(error, item, privp->ethernet_hook, m0); /* @@ -1736,7 +1736,7 @@ ng_pppoe_disconnect(hook_p hook) struct mbuf *m; /* Generate a packet of that type. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) log(LOG_NOTICE, "ng_pppoe[%x]: session out of " "mbufs\n", node->nd_ID); @@ -1823,7 +1823,7 @@ pppoe_ticker(node_p node, hook_p hook, void *arg1, int arg2) case PPPOE_SINIT: case PPPOE_SREQ: /* Timeouts on these produce resends. */ - m0 = m_copypacket(sp->neg->m, M_DONTWAIT); + m0 = m_copypacket(sp->neg->m, M_NOWAIT); NG_SEND_DATA_ONLY( error, privp->ethernet_hook, m0); ng_callout(&neg->handle, node, hook, neg->timeout * hz, pppoe_ticker, NULL, 0); diff --git a/sys/netgraph/ng_pptpgre.c b/sys/netgraph/ng_pptpgre.c index f48b80c384fa..83d3e0a4c10c 100644 --- a/sys/netgraph/ng_pptpgre.c +++ b/sys/netgraph/ng_pptpgre.c @@ -598,7 +598,7 @@ ng_pptpgre_xmit(hpriv_p hpriv, item_p item) /* Prepend GRE header to outgoing frame */ grelen = sizeof(*gre) + sizeof(u_int32_t) * (gre->hasSeq + gre->hasAck); if (m == NULL) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { priv->stats.memoryFailures++; ERROUT(ENOBUFS); @@ -606,7 +606,7 @@ ng_pptpgre_xmit(hpriv_p hpriv, item_p item) m->m_len = m->m_pkthdr.len = grelen; m->m_pkthdr.rcvif = NULL; } else { - M_PREPEND(m, grelen, M_DONTWAIT); + M_PREPEND(m, grelen, M_NOWAIT); if (m == NULL || (m->m_len < grelen && (m = m_pullup(m, grelen)) == NULL)) { priv->stats.memoryFailures++; diff --git a/sys/netgraph/ng_pred1.c b/sys/netgraph/ng_pred1.c index 52efe633e1b7..4792b7a459f9 100644 --- a/sys/netgraph/ng_pred1.c +++ b/sys/netgraph/ng_pred1.c @@ -401,7 +401,7 @@ ng_pred1_compress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); @@ -479,7 +479,7 @@ ng_pred1_decompress(node_p node, struct mbuf *m, struct mbuf **resultp) } /* We must own the mbuf chain exclusively to modify it. */ - m = m_unshare(m, M_DONTWAIT); + m = m_unshare(m, M_NOWAIT); if (m == NULL) { priv->stats.Errors++; return (ENOMEM); diff --git a/sys/netgraph/ng_rfc1490.c b/sys/netgraph/ng_rfc1490.c index 2dc512390068..061faa29fdef 100644 --- a/sys/netgraph/ng_rfc1490.c +++ b/sys/netgraph/ng_rfc1490.c @@ -385,7 +385,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); break; } } else if (hook == priv->ppp) { - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend PPP NLPID */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend PPP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -394,7 +394,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); } else if (hook == priv->inet) { switch (priv->enc->method) { case NG_RFC1490_ENCAP_IETF_IP: - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend IP NLPID */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend IP NLPID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -406,7 +406,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); * HDLC_UI PAD NLIPID OUI PID * 03 00 80 00 00 00 08 00 */ - M_PREPEND(m, 8, M_DONTWAIT); + M_PREPEND(m, 8, M_NOWAIT); if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; @@ -417,7 +417,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); = htons(ETHERTYPE_IP); /* PID */ break; case NG_RFC1490_ENCAP_CISCO: - M_PREPEND(m, 2, M_DONTWAIT); /* Prepend IP ethertype */ + M_PREPEND(m, 2, M_NOWAIT); /* Prepend IP ethertype */ if (!m) ERROUT(ENOBUFS); *((u_int16_t *)mtod(m, u_int16_t *)) = htons(ETHERTYPE_IP); @@ -425,7 +425,7 @@ switch_on_etype: etype = ntohs(*((const u_int16_t *)ptr)); } NG_FWD_NEW_DATA(error, item, priv->downlink, m); } else if (hook == priv->ethernet) { - M_PREPEND(m, 8, M_DONTWAIT); /* Prepend NLPID, OUI, PID */ + M_PREPEND(m, 8, M_NOWAIT); /* Prepend NLPID, OUI, PID */ if (!m) ERROUT(ENOBUFS); mtod(m, u_char *)[0] = HDLC_UI; diff --git a/sys/netgraph/ng_source.c b/sys/netgraph/ng_source.c index 83473f9927cc..1883ec021ac3 100644 --- a/sys/netgraph/ng_source.c +++ b/sys/netgraph/ng_source.c @@ -445,7 +445,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) { struct ng_source_embed_info *embed; - NG_MKRESPONSE(resp, msg, sizeof(*embed), M_DONTWAIT); + NG_MKRESPONSE(resp, msg, sizeof(*embed), M_NOWAIT); if (resp == NULL) { error = ENOMEM; goto done; @@ -484,7 +484,7 @@ ng_source_rcvmsg(node_p node, item_p item, hook_p lasthook) error = EINVAL; goto done; } - NG_MKRESPONSE(resp, msg, sizeof(*embed), M_DONTWAIT); + NG_MKRESPONSE(resp, msg, sizeof(*embed), M_NOWAIT); if (resp == NULL) { error = ENOMEM; goto done; @@ -873,9 +873,9 @@ ng_source_dup_mod(sc_p sc, struct mbuf *m0, struct mbuf **m_ptr) /* Duplicate the packet. */ if (modify) - m = m_dup(m0, M_DONTWAIT); + m = m_dup(m0, M_NOWAIT); else - m = m_copypacket(m0, M_DONTWAIT); + m = m_copypacket(m0, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto done; diff --git a/sys/netgraph/ng_tee.c b/sys/netgraph/ng_tee.c index 4d8566612e83..c6a517e0498e 100644 --- a/sys/netgraph/ng_tee.c +++ b/sys/netgraph/ng_tee.c @@ -305,7 +305,7 @@ ng_tee_rcvdata(hook_p hook, item_p item) struct mbuf *m2; /* Copy packet (failure will not stop the original)*/ - m2 = m_dup(m, M_DONTWAIT); + m2 = m_dup(m, M_NOWAIT); if (m2) { /* Deliver duplicate */ h = hinfo->dup; diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index 34105b2e950c..35e17344825f 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -418,7 +418,7 @@ ngt_rint_bypass(struct tty *tp, const void *buf, size_t len) if (sc->hook == NULL) return (0); - m = m_getm2(NULL, len, M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getm2(NULL, len, M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { if (sc->flags & FLG_DEBUG) log(LOG_ERR, @@ -476,7 +476,7 @@ ngt_rint(struct tty *tp, char c, int flags) /* Get a new header mbuf if we need one */ if (!(m = sc->m)) { - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) { if (sc->flags & FLG_DEBUG) log(LOG_ERR, diff --git a/sys/netgraph/ng_vjc.c b/sys/netgraph/ng_vjc.c index 97801f24f855..e1b76b5b9e62 100644 --- a/sys/netgraph/ng_vjc.c +++ b/sys/netgraph/ng_vjc.c @@ -474,7 +474,7 @@ ng_vjc_rcvdata(hook_p hook, item_p item) m_adj(m, vjlen); /* Copy the reconstructed TCP/IP headers into a new mbuf */ - MGETHDR(hm, M_DONTWAIT, MT_DATA); + MGETHDR(hm, M_NOWAIT, MT_DATA); if (hm == NULL) { priv->slc.sls_errorin++; NG_FREE_M(m); @@ -484,7 +484,7 @@ ng_vjc_rcvdata(hook_p hook, item_p item) hm->m_len = 0; hm->m_pkthdr.rcvif = NULL; if (hlen > MHLEN) { /* unlikely, but can happen */ - MCLGET(hm, M_DONTWAIT); + MCLGET(hm, M_NOWAIT); if ((hm->m_flags & M_EXT) == 0) { m_freem(hm); priv->slc.sls_errorin++; diff --git a/sys/netgraph/ng_vlan.c b/sys/netgraph/ng_vlan.c index b07a603a1b08..1c10a0e1eb07 100644 --- a/sys/netgraph/ng_vlan.c +++ b/sys/netgraph/ng_vlan.c @@ -648,7 +648,7 @@ ng_vlan_rcvdata(hook_p hook, item_p item) * [dmac] [smac] [TPID] [PCP/CFI/VID] [ether_type] [payload] * |-----------| |-- inserted tag --| |--------------------| */ - M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_VLAN_ENCAP_LEN, M_NOWAIT); if (m == NULL) error = ENOMEM; else diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 52d7db228dcf..2d92815ca41c 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -249,7 +249,7 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip, if (enaddr == NULL) enaddr = carpaddr ? carpaddr : (u_char *)IF_LLADDR(ifp); - if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) + if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) return; m->m_len = sizeof(*ah) + 2*sizeof(struct in_addr) + 2*ifp->if_data.ifi_addrlen; diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index 63b96a85761c..e87da5e93d44 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -523,7 +523,7 @@ igmp_ra_alloc(void) struct mbuf *m; struct ipoption *p; - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); p = mtod(m, struct ipoption *); p->ipopt_dst.s_addr = INADDR_ANY; p->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */ @@ -2203,7 +2203,7 @@ igmp_v1v2_queue_report(struct in_multi *inm, const int type) ifp = inm->inm_ifp; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (ENOMEM); MH_ALIGN(m, sizeof(struct ip) + sizeof(struct igmp)); @@ -2780,12 +2780,12 @@ igmp_v3_enqueue_group_record(struct ifqueue *ifq, struct in_multi *inm, m0srcs = (ifp->if_mtu - IGMP_LEADINGSPACE - sizeof(struct igmp_grouprec)) / sizeof(in_addr_t); if (!is_state_change && !is_group_query) { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; } if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -2905,11 +2905,11 @@ igmp_v3_enqueue_group_record(struct ifqueue *ifq, struct in_multi *inm, CTR1(KTR_IGMPV3, "%s: outbound queue full", __func__); return (-ENOMEM); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -3061,11 +3061,11 @@ igmp_v3_enqueue_filter_change(struct ifqueue *ifq, struct in_multi *inm) CTR1(KTR_IGMPV3, "%s: use previous packet", __func__); } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m) m->m_data += IGMP_LEADINGSPACE; if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m) MH_ALIGN(m, IGMP_LEADINGSPACE); } @@ -3497,7 +3497,7 @@ igmp_v3_encap_report(struct ifnet *ifp, struct mbuf *m) if (m->m_flags & M_IGMPV3_HDR) { igmpreclen -= hdrlen; } else { - M_PREPEND(m, hdrlen, M_DONTWAIT); + M_PREPEND(m, hdrlen, M_NOWAIT); if (m == NULL) return (NULL); m->m_flags |= M_IGMPV3_HDR; diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 6ccd17f41b6e..45c86190107d 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -162,7 +162,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m) eiphdr.eip_resvh = 0; } /* prepend Ethernet-in-IP header */ - M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct etherip_header), M_NOWAIT); if (m && m->m_len < sizeof(struct etherip_header)) m = m_pullup(m, sizeof(struct etherip_header)); if (m == NULL) @@ -202,7 +202,7 @@ in_gif_output(struct ifnet *ifp, int family, struct mbuf *m) if (family == AF_LINK) len += ETHERIP_ALIGN; #endif - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m != NULL && m->m_len < len) m = m_pullup(m, len); if (m == NULL) { diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index d6fd5bafc9b3..39d6f7ea0049 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -280,9 +280,9 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs(oip->ip_len) - oiphlen)); goto freeit; if (MHLEN > sizeof(struct ip) + ICMP_MINLEN + icmplen) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); else - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) goto freeit; #ifdef MAC @@ -809,7 +809,7 @@ icmp_reflect(struct mbuf *m) */ cp = (u_char *) (ip + 1); if ((opts = ip_srcroute(m)) == 0 && - (opts = m_gethdr(M_DONTWAIT, MT_DATA))) { + (opts = m_gethdr(M_NOWAIT, MT_DATA))) { opts->m_len = sizeof(struct in_addr); mtod(opts, struct in_addr *)->s_addr = 0; } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 033c03da9709..0e559a652b89 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1406,8 +1406,8 @@ ip_forward(struct mbuf *m, int srcrt) * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). */ - MGETHDR(mcopy, M_DONTWAIT, m->m_type); - if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_DONTWAIT)) { + MGETHDR(mcopy, M_NOWAIT, m->m_type); + if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { /* * It's probably ok if the pkthdr dup fails (because * the deep copy of the tag chain failed), but for now diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 5b3350473ca3..622893320a80 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1306,7 +1306,7 @@ X_ip_mforward(struct ip *ip, struct ifnet *ifp, struct mbuf *m, return ENOBUFS; } - mb0 = m_copypacket(m, M_DONTWAIT); + mb0 = m_copypacket(m, M_NOWAIT); if (mb0 && (M_HASCL(mb0) || mb0->m_len < hlen)) mb0 = m_pullup(mb0, hlen); if (mb0 == NULL) { @@ -1669,7 +1669,7 @@ phyint_send(struct ip *ip, struct vif *vifp, struct mbuf *m) * the IP header is actually copied, not just referenced, * so that ip_output() only scribbles on the copy. */ - mb_copy = m_copypacket(m, M_DONTWAIT); + mb_copy = m_copypacket(m, M_NOWAIT); if (mb_copy && (M_HASCL(mb_copy) || mb_copy->m_len < hlen)) mb_copy = m_pullup(mb_copy, hlen); if (mb_copy == NULL) @@ -2083,7 +2083,7 @@ bw_upcalls_send(void) * Allocate a new mbuf, initialize it with the header and * the payload for the pending calls. */ - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n"); return; @@ -2384,7 +2384,7 @@ pim_register_prepare(struct ip *ip, struct mbuf *m) * Copy the old packet & pullup its IP header into the * new mbuf so we can modify it. */ - mb_copy = m_copypacket(m, M_DONTWAIT); + mb_copy = m_copypacket(m, M_NOWAIT); if (mb_copy == NULL) return NULL; mb_copy = m_pullup(mb_copy, ip->ip_hl << 2); @@ -2430,7 +2430,7 @@ pim_register_send_upcall(struct ip *ip, struct vif *vifp, /* * Add a new mbuf with an upcall header */ - MGETHDR(mb_first, M_DONTWAIT, MT_DATA); + MGETHDR(mb_first, M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; @@ -2488,7 +2488,7 @@ pim_register_send_rp(struct ip *ip, struct vif *vifp, struct mbuf *mb_copy, /* * Add a new mbuf with the encapsulating header */ - MGETHDR(mb_first, M_DONTWAIT, MT_DATA); + MGETHDR(mb_first, M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; diff --git a/sys/netinet/ip_options.c b/sys/netinet/ip_options.c index df320271cc77..239c69974f7e 100644 --- a/sys/netinet/ip_options.c +++ b/sys/netinet/ip_options.c @@ -411,7 +411,7 @@ ip_srcroute(struct mbuf *m0) if (opts->ip_nhops == 0) return (NULL); - m = m_get(M_DONTWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); @@ -495,7 +495,7 @@ ip_insertoptions(struct mbuf *m, struct mbuf *opt, int *phlen) if (p->ipopt_dst.s_addr) ip->ip_dst = p->ipopt_dst; if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { *phlen = 0; return (m); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ad709a51c959..166bef5173f5 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -621,7 +621,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, } #ifdef MBUF_STRESS_TEST if (mbuf_frag_size && m->m_pkthdr.len > mbuf_frag_size) - m = m_fragment(m, M_DONTWAIT, mbuf_frag_size); + m = m_fragment(m, M_NOWAIT, mbuf_frag_size); #endif /* * Reset layer specific mbuf flags @@ -784,7 +784,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, struct mbuf *m; int mhlen = sizeof (struct ip); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; IPSTAT_INC(ips_odropped); @@ -813,7 +813,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, } else mhip->ip_off |= IP_MF; mhip->ip_len = htons((u_short)(len + mhlen)); - m->m_next = m_copym(m0, off, len, M_DONTWAIT); + m->m_next = m_copym(m0, off, len, M_NOWAIT); if (m->m_next == NULL) { /* copy failed */ m_free(m); error = ENOBUFS; /* ??? */ @@ -951,7 +951,7 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt) error = EMSGSIZE; break; } - MGET(m, sopt->sopt_td ? M_WAIT : M_DONTWAIT, MT_DATA); + MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; break; @@ -1289,7 +1289,7 @@ ip_mloopback(struct ifnet *ifp, struct mbuf *m, struct sockaddr_in *dst, * Make a deep copy of the packet because we're going to * modify the pack in order to generate checksums. */ - copym = m_dup(m, M_DONTWAIT); + copym = m_dup(m, M_NOWAIT); if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) { diff --git a/sys/netinet/libalias/alias.c b/sys/netinet/libalias/alias.c index 876e95844ded..da28b2297ecf 100644 --- a/sys/netinet/libalias/alias.c +++ b/sys/netinet/libalias/alias.c @@ -1761,7 +1761,7 @@ m_megapullup(struct mbuf *m, int len) { return (m); if (len <= MCLBYTES - RESERVE) { - mcl = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + mcl = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); } else if (len < MJUM16BYTES) { int size; if (len <= MJUMPAGESIZE - RESERVE) { @@ -1771,7 +1771,7 @@ m_megapullup(struct mbuf *m, int len) { } else { size = MJUM16BYTES; }; - mcl = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, size); + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, size); } else { goto bad; } diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 7d070fdae3a6..eddc69e21f65 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -439,7 +439,7 @@ rip_output(struct mbuf *m, struct socket *so, u_long dst) m_freem(m); return(EMSGSIZE); } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == NULL) return(ENOBUFS); diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index b9ed52feff77..0b15cd49ab8b 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -80,7 +80,7 @@ sctp_asconf_success_response(uint32_t id) struct sctp_asconf_paramhdr *aph; m_reply = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_success_response: couldn't get mbuf!\n"); @@ -108,7 +108,7 @@ sctp_asconf_error_response(uint32_t id, uint16_t cause, uint8_t * error_tlv, m_reply = sctp_get_mbuf_for_msg((sizeof(struct sctp_asconf_paramhdr) + tlv_length + sizeof(struct sctp_error_cause)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (m_reply == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "asconf_error_response: couldn't get mbuf!\n"); @@ -633,7 +633,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset, } } m_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_ack_chunk), 0, - M_DONTWAIT, 1, MT_DATA); + M_NOWAIT, 1, MT_DATA); if (m_ack == NULL) { SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: couldn't get mbuf!\n"); @@ -2569,14 +2569,14 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen, int addr_locked) * it's simpler to fill in the asconf chunk header lookup address on * the fly */ - m_asconf_chk = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_chunk), 0, M_DONTWAIT, 1, MT_DATA); + m_asconf_chk = sctp_get_mbuf_for_msg(sizeof(struct sctp_asconf_chunk), 0, M_NOWAIT, 1, MT_DATA); if (m_asconf_chk == NULL) { /* no mbuf's */ SCTPDBG(SCTP_DEBUG_ASCONF1, "compose_asconf: couldn't get chunk mbuf!\n"); return (NULL); } - m_asconf = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_asconf = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_asconf == NULL) { /* no mbuf's */ SCTPDBG(SCTP_DEBUG_ASCONF1, diff --git a/sys/netinet/sctp_auth.c b/sys/netinet/sctp_auth.c index a5d5f71f3858..42e263650f05 100644 --- a/sys/netinet/sctp_auth.c +++ b/sys/netinet/sctp_auth.c @@ -1763,7 +1763,7 @@ sctp_handle_auth(struct sctp_tcb *stcb, struct sctp_auth_chunk *auth, * report this in an Error Chunk: Unsupported HMAC * Identifier */ - m_err = sctp_get_mbuf_for_msg(sizeof(*err), 0, M_DONTWAIT, + m_err = sctp_get_mbuf_for_msg(sizeof(*err), 0, M_NOWAIT, 1, MT_HEADER); if (m_err != NULL) { /* pre-reserve some space */ @@ -1869,7 +1869,7 @@ sctp_notify_authentication(struct sctp_tcb *stcb, uint32_t indication, return; m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_authkey_event), - 0, M_DONTWAIT, 1, MT_HEADER); + 0, M_NOWAIT, 1, MT_HEADER); if (m_notify == NULL) /* no space left */ return; diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index a394de5d68fb..112920b920f8 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -241,7 +241,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo) use_extended = 0; } - ret = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + ret = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (ret == NULL) { /* No space */ return (ret); @@ -587,7 +587,7 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb, struct sctp_association *asoc, */ TAILQ_INSERT_HEAD(&strm->inqueue, control, next); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -866,7 +866,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not first, no fragmented delivery in progress\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; @@ -899,7 +899,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, */ SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it IS a first and fragmented delivery in progress\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -933,7 +933,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, asoc->str_of_pdapi); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -965,7 +965,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, asoc->ssn_of_pdapi); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1059,7 +1059,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - It can be a midlle or last but not a first\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, it's a FIRST!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1096,7 +1096,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, prev->rec.data.stream_number); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1133,7 +1133,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, prev->rec.data.stream_seq); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1166,7 +1166,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTP_DATA_FIRST_FRAG) { SCTPDBG(SCTP_DEBUG_INDATA1, "Prev check - Gak, evil plot, its not FIRST and it must be!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1210,7 +1210,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is FIRST, we must be LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, its not a last!\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1249,7 +1249,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "Next chk - Next is a MIDDLE/LAST\n"); SCTPDBG(SCTP_DEBUG_INDATA1, "Gak, Evil plot, new prev chunk is a LAST\n"); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1286,7 +1286,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_number, next->rec.data.stream_number); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1324,7 +1324,7 @@ sctp_queue_data_for_reasm(struct sctp_tcb *stcb, struct sctp_association *asoc, chk->rec.data.stream_seq, next->rec.data.stream_seq); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1571,7 +1571,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, struct mbuf *mb; mb = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) * 2), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (mb != NULL) { /* add some space up front so prepend will work well */ SCTP_BUF_RESV_UF(mb, sizeof(struct sctp_chunkhdr)); @@ -1636,7 +1636,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, SCTPDBG(SCTP_DEBUG_INDATA1, "EVIL/Broken-Dup S-SEQ:%d delivered:%d from peer, Abort!\n", strmseq, asoc->strmin[strmno].last_sequence_delivered); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1668,7 +1668,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, if (last_chunk == 0) { dmbuf = SCTP_M_COPYM(*m, (offset + sizeof(struct sctp_data_chunk)), - the_len, M_DONTWAIT); + the_len, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; @@ -1898,7 +1898,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, } sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1932,7 +1932,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1977,7 +1977,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, } sctp_free_a_readq(stcb, control); oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -2560,7 +2560,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, */ if (SCTP_BUF_LEN(m) < (long)MLEN && SCTP_BUF_NEXT(m) == NULL) { /* we only handle mbufs that are singletons.. not chains */ - m = sctp_get_mbuf_for_msg(SCTP_BUF_LEN(m), 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(SCTP_BUF_LEN(m), 0, M_NOWAIT, 1, MT_DATA); if (m) { /* ok lets see if we can copy the data up */ caddr_t *from, *to; @@ -2608,7 +2608,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct mbuf *op_err; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 2 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { struct sctp_paramhdr *ph; @@ -2710,7 +2710,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, struct mbuf *merr; struct sctp_paramhdr *phd; - merr = sctp_get_mbuf_for_msg(sizeof(*phd), 0, M_DONTWAIT, 1, MT_DATA); + merr = sctp_get_mbuf_for_msg(sizeof(*phd), 0, M_NOWAIT, 1, MT_DATA); if (merr) { phd = mtod(merr, struct sctp_paramhdr *); /* @@ -2726,7 +2726,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, phd->param_length = htons(chk_length + sizeof(*phd)); SCTP_BUF_LEN(merr) = sizeof(*phd); - SCTP_BUF_NEXT(merr) = SCTP_M_COPYM(m, *offset, chk_length, M_DONTWAIT); + SCTP_BUF_NEXT(merr) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); if (SCTP_BUF_NEXT(merr)) { if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(merr), SCTP_SIZE32(chk_length) - chk_length, NULL)) { sctp_m_freem(merr); @@ -3852,7 +3852,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4222,7 +4222,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4445,7 +4445,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -4954,7 +4954,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup, *abort_now = 1; /* XXX */ oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -5405,7 +5405,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb, */ *abort_flag = 1; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + 3 * sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index eb4be5651c2b..c70bc033dd97 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1481,7 +1481,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, /* SHUTDOWN came in after sending INIT-ACK */ sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -1699,7 +1699,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, * with colliding state indication. */ op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -2461,7 +2461,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - m_sig = m_split(m, sig_offset, M_DONTWAIT); + m_sig = m_split(m, sig_offset, M_NOWAIT); if (m_sig == NULL) { /* out of memory or ?? */ return (NULL); @@ -2567,7 +2567,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, uint32_t tim; op_err = sctp_get_mbuf_for_msg(sizeof(struct sctp_stale_cookie_msg), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err == NULL) { /* FOOBAR */ return (NULL); @@ -4094,7 +4094,7 @@ __attribute__((noinline)) chk->no_fr_allowed = 0; chk->book_size = chk->send_size = sizeof(struct sctp_chunkhdr); chk->book_size_scale = 0; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { strres_nochunk: if (chk->data) { @@ -5477,7 +5477,7 @@ __attribute__((noinline)) struct sctp_paramhdr *phd; mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (mm) { phd = mtod(mm, struct sctp_paramhdr *); /* @@ -5490,7 +5490,7 @@ __attribute__((noinline)) phd->param_type = htons(SCTP_CAUSE_UNRECOG_CHUNK); phd->param_length = htons(chk_length + sizeof(*phd)); SCTP_BUF_LEN(mm) = sizeof(*phd); - SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_DONTWAIT); + SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); if (SCTP_BUF_NEXT(mm)) { if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(chk_length) - chk_length, NULL)) { sctp_m_freem(mm); diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index aecf035d8f3a..68d3d8b042d6 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -1970,7 +1970,7 @@ sctp_add_addr_to_mbuf(struct mbuf *m, struct sctp_ifa *ifa) while (SCTP_BUF_NEXT(mret) != NULL) { mret = SCTP_BUF_NEXT(mret); } - SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_DONTWAIT, 1, MT_DATA); + SCTP_BUF_NEXT(mret) = sctp_get_mbuf_for_msg(len, 0, M_NOWAIT, 1, MT_DATA); if (SCTP_BUF_NEXT(mret) == NULL) { /* We are hosed, can't add more addresses */ return (m); @@ -3700,11 +3700,11 @@ sctp_add_cookie(struct mbuf *init, int init_offset, mret = NULL; mret = sctp_get_mbuf_for_msg((sizeof(struct sctp_state_cookie) + sizeof(struct sctp_paramhdr)), 0, - M_DONTWAIT, 1, MT_DATA); + M_NOWAIT, 1, MT_DATA); if (mret == NULL) { return (NULL); } - copy_init = SCTP_M_COPYM(init, init_offset, M_COPYALL, M_DONTWAIT); + copy_init = SCTP_M_COPYM(init, init_offset, M_COPYALL, M_NOWAIT); if (copy_init == NULL) { sctp_m_freem(mret); return (NULL); @@ -3721,7 +3721,7 @@ sctp_add_cookie(struct mbuf *init, int init_offset, } #endif copy_initack = SCTP_M_COPYM(initack, initack_offset, M_COPYALL, - M_DONTWAIT); + M_NOWAIT); if (copy_initack == NULL) { sctp_m_freem(mret); sctp_m_freem(copy_init); @@ -3771,7 +3771,7 @@ sctp_add_cookie(struct mbuf *init, int init_offset, break; } } - sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_DONTWAIT, 1, MT_DATA); + sig = sctp_get_mbuf_for_msg(SCTP_SECRET_SIZE, 0, M_NOWAIT, 1, MT_DATA); if (sig == NULL) { /* no space, so free the entire chain */ sctp_m_freem(mret); @@ -3940,7 +3940,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (port) { len += sizeof(struct udphdr); } - newm = sctp_get_mbuf_for_msg(len, 1, M_DONTWAIT, 1, MT_DATA); + newm = sctp_get_mbuf_for_msg(len, 1, M_NOWAIT, 1, MT_DATA); if (newm == NULL) { sctp_m_freem(m); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -4229,7 +4229,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, if (port) { len += sizeof(struct udphdr); } - newm = sctp_get_mbuf_for_msg(len, 1, M_DONTWAIT, 1, MT_DATA); + newm = sctp_get_mbuf_for_msg(len, 1, M_NOWAIT, 1, MT_DATA); if (newm == NULL) { sctp_m_freem(m); SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -4626,7 +4626,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked /* start the INIT timer */ sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net); - m = sctp_get_mbuf_for_msg(MCLBYTES, 1, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(MCLBYTES, 1, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* No memory, INIT timer will re-attempt. */ SCTPDBG(SCTP_DEBUG_OUTPUT4, "Sending INIT - mbuf?\n"); @@ -5015,7 +5015,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, #endif l_len += plen; l_len += sizeof(struct sctp_paramhdr); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; /* @@ -5084,7 +5084,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, #endif l_len += plen; l_len += sizeof(struct sctp_paramhdr); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; #ifdef INET6 @@ -5158,7 +5158,7 @@ sctp_arethere_unrecognized_parameters(struct mbuf *in_initpkt, l_len = sizeof(struct ip) + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); #endif l_len += (2 * sizeof(struct sctp_paramhdr)); - op_err = sctp_get_mbuf_for_msg(l_len, 0, M_DONTWAIT, 1, MT_DATA); + op_err = sctp_get_mbuf_for_msg(l_len, 0, M_NOWAIT, 1, MT_DATA); if (op_err) { SCTP_BUF_LEN(op_err) = 0; #ifdef INET6 @@ -5428,7 +5428,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct sctp_tcb *stcb, vrf_id, port); return; } - m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m == NULL) { /* No memory, INIT timer will re-attempt. */ if (op_err) @@ -6280,7 +6280,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, if (outchain == NULL) { /* This is the general case */ new_mbuf: - outchain = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_HEADER); + outchain = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_HEADER); if (outchain == NULL) { goto error_out; } @@ -6334,7 +6334,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, /* now we need another one */ sizeofcpy -= len; } - m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_HEADER); + m = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_HEADER); if (m == NULL) { /* We failed */ goto error_out; @@ -6348,7 +6348,7 @@ sctp_copy_mbufchain(struct mbuf *clonechain, return (outchain); } else { /* copy the old fashion way */ - appendchain = SCTP_M_COPYM(clonechain, 0, M_COPYALL, M_DONTWAIT); + appendchain = SCTP_M_COPYM(clonechain, 0, M_COPYALL, M_NOWAIT); #ifdef SCTP_MBUF_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { struct mbuf *mat; @@ -6442,7 +6442,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, return; } if ((ca->m) && ca->sndlen) { - m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_DONTWAIT); + m = SCTP_M_COPYM(ca->m, 0, M_COPYALL, M_NOWAIT); if (m == NULL) { /* can't copy so we are done */ ca->cnt_failed++; @@ -6473,7 +6473,7 @@ sctp_sendall_iterator(struct sctp_inpcb *inp, struct sctp_tcb *stcb, void *ptr, if (m) { struct sctp_paramhdr *ph; - SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_DONTWAIT); + SCTP_BUF_PREPEND(m, sizeof(struct sctp_paramhdr), M_NOWAIT); if (m) { ph = mtod(m, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_USER_INITIATED_ABT); @@ -6650,7 +6650,7 @@ sctp_copy_out_all(struct uio *uio, int len) struct mbuf *ret, *at; int left, willcpy, cancpy, error; - ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAIT, 1, MT_DATA); + ret = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_WAITOK, 1, MT_DATA); if (ret == NULL) { /* TSNH */ return (NULL); @@ -6673,7 +6673,7 @@ sctp_copy_out_all(struct uio *uio, int len) SCTP_BUF_NEXT_PKT(at) = SCTP_BUF_NEXT(at) = 0; left -= willcpy; if (left > 0) { - SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAIT, 1, MT_DATA); + SCTP_BUF_NEXT(at) = sctp_get_mbuf_for_msg(left, 0, M_WAITOK, 1, MT_DATA); if (SCTP_BUF_NEXT(at) == NULL) { goto err_out_now; } @@ -7237,7 +7237,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, struct mbuf *m; dont_do_it: - chk->data = SCTP_M_COPYM(sp->data, 0, to_move, M_DONTWAIT); + chk->data = SCTP_M_COPYM(sp->data, 0, to_move, M_NOWAIT); chk->last_mbuf = NULL; if (chk->data == NULL) { sp->some_taken = some_taken; @@ -7316,7 +7316,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, /* Not enough room for a chunk header, get some */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(1, 0, M_DONTWAIT, 0, MT_DATA); + m = sctp_get_mbuf_for_msg(1, 0, M_NOWAIT, 0, MT_DATA); if (m == NULL) { /* * we're in trouble here. _PREPEND below will free @@ -7353,7 +7353,7 @@ sctp_move_to_outqueue(struct sctp_tcb *stcb, M_ALIGN(chk->data, 4); } } - SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_DONTWAIT); + SCTP_BUF_PREPEND(chk->data, sizeof(struct sctp_data_chunk), M_NOWAIT); if (chk->data == NULL) { /* HELP, TSNH since we assured it would not above? */ #ifdef INVARIANTS @@ -8789,7 +8789,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, struct mbuf *op_err) return; } chk->copy_by_ref = 0; - SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_DONTWAIT); + SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_NOWAIT); if (op_err == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -8854,7 +8854,7 @@ sctp_send_cookie_echo(struct mbuf *m, if ((pad = (plen % 4))) { plen += 4 - pad; } - cookie = SCTP_M_COPYM(m, at, plen, M_DONTWAIT); + cookie = SCTP_M_COPYM(m, at, plen, M_NOWAIT); if (cookie == NULL) { /* No memory */ return (-2); @@ -8926,7 +8926,7 @@ sctp_send_heartbeat_ack(struct sctp_tcb *stcb, /* must have a net pointer */ return; - outchain = SCTP_M_COPYM(m, offset, chk_length, M_DONTWAIT); + outchain = SCTP_M_COPYM(m, offset, chk_length, M_NOWAIT); if (outchain == NULL) { /* gak out of memory */ return; @@ -8985,7 +8985,7 @@ sctp_send_cookie_ack(struct sctp_tcb *stcb) cookie_ack = NULL; SCTP_TCB_LOCK_ASSERT(stcb); - cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); + cookie_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); if (cookie_ack == NULL) { /* no mbuf's */ return; @@ -9031,7 +9031,7 @@ sctp_send_shutdown_ack(struct sctp_tcb *stcb, struct sctp_nets *net) struct sctp_shutdown_ack_chunk *ack_cp; struct sctp_tmit_chunk *chk; - m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown_ack = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_ack_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown_ack == NULL) { /* no mbuf's */ return; @@ -9074,7 +9074,7 @@ sctp_send_shutdown(struct sctp_tcb *stcb, struct sctp_nets *net) struct sctp_shutdown_chunk *shutdown_cp; struct sctp_tmit_chunk *chk; - m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown == NULL) { /* no mbuf's */ return; @@ -9210,7 +9210,7 @@ sctp_send_asconf_ack(struct sctp_tcb *stcb) continue; } /* copy the asconf_ack */ - m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_DONTWAIT); + m_ack = SCTP_M_COPYM(ack->data, 0, M_COPYALL, M_NOWAIT); if (m_ack == NULL) { /* couldn't copy it */ return; @@ -10130,7 +10130,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->rec.chunk_id.can_take_data = 0; chk->asoc = asoc; chk->whoTo = NULL; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -10416,7 +10416,7 @@ sctp_send_sack(struct sctp_tcb *stcb, int so_locked space_req = MCLBYTES; } /* Ok now lets formulate a MBUF with our sack */ - a_chk->data = sctp_get_mbuf_for_msg(space_req, 0, M_DONTWAIT, 1, MT_DATA); + a_chk->data = sctp_get_mbuf_for_msg(space_req, 0, M_NOWAIT, 1, MT_DATA); if ((a_chk->data == NULL) || (a_chk->whoTo == NULL)) { /* rats, no mbuf memory */ @@ -10713,7 +10713,7 @@ sctp_send_abort_tcb(struct sctp_tcb *stcb, struct mbuf *operr, int so_locked SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } SCTP_TCB_LOCK_ASSERT(stcb); - m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_DONTWAIT, 1, MT_HEADER); + m_abort = sctp_get_mbuf_for_msg(sizeof(struct sctp_abort_chunk), 0, M_NOWAIT, 1, MT_HEADER); if (m_abort == NULL) { /* no mbuf's */ if (m_out) @@ -10773,7 +10773,7 @@ sctp_send_shutdown_complete(struct sctp_tcb *stcb, uint32_t vtag; uint8_t flags; - m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); + m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_NOWAIT, 1, MT_HEADER); if (m_shutdown_comp == NULL) { /* no mbuf's */ return; @@ -10869,7 +10869,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, if (port) { len += sizeof(struct udphdr); } - mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_DONTWAIT, 1, MT_DATA); + mout = sctp_get_mbuf_for_msg(len + max_linkhdr, 1, M_NOWAIT, 1, MT_DATA); if (mout == NULL) { if (cause) { sctp_m_freem(cause); @@ -11113,7 +11113,7 @@ sctp_send_hb(struct sctp_tcb *stcb, struct sctp_nets *net, int so_locked chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_heartbeat_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, so_locked); return; @@ -11217,7 +11217,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb, struct sctp_nets *net, chk->rec.chunk_id.can_take_data = 0; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_ecne_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -11316,7 +11316,7 @@ sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, was_trunc = 1; } chk->asoc = &stcb->asoc; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { jump_out: sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); @@ -11429,7 +11429,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, u chk->rec.chunk_id.can_take_data = 1; chk->asoc = &stcb->asoc; chk->send_size = sizeof(struct sctp_cwr_chunk); - chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); + chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_NOWAIT, 1, MT_HEADER); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; @@ -11735,7 +11735,7 @@ sctp_send_str_reset_req(struct sctp_tcb *stcb, chk->send_size = SCTP_SIZE32(chk->book_size); chk->book_size_scale = 0; - chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (chk->data == NULL) { sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -12487,7 +12487,7 @@ sctp_lower_sosend(struct socket *so, if (top) { struct mbuf *cntm = NULL; - mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_WAIT, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_WAITOK, 1, MT_DATA); if (sndlen != 0) { for (cntm = top; cntm; cntm = SCTP_BUF_NEXT(cntm)) { tot_out += SCTP_BUF_LEN(cntm); @@ -12503,7 +12503,7 @@ sctp_lower_sosend(struct socket *so, error = EMSGSIZE; goto out; } - mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAIT, 1, MT_DATA); + mm = sctp_get_mbuf_for_msg(tot_demand, 0, M_WAITOK, 1, MT_DATA); } if (mm == NULL) { SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, ENOMEM); @@ -13279,7 +13279,7 @@ sctp_add_auth_chunk(struct mbuf *m, struct mbuf **m_end, if (!sctp_auth_is_required_chunk(chunk, stcb->asoc.peer_auth_chunks)) { return (m); } - m_auth = sctp_get_mbuf_for_msg(sizeof(*auth), 0, M_DONTWAIT, 1, MT_HEADER); + m_auth = sctp_get_mbuf_for_msg(sizeof(*auth), 0, M_NOWAIT, 1, MT_HEADER); if (m_auth == NULL) { /* no mbuf's */ return (m); diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index b2703cdd68eb..04ac4b597aea 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3294,7 +3294,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) struct mbuf *op_err; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; @@ -3380,7 +3380,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* * Fill in the user @@ -3465,7 +3465,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) uint32_t *ippp; op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 3444923da62b..69505c39514b 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -150,7 +150,7 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct mbuf *oper; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; @@ -1054,7 +1054,7 @@ sctp_cookie_timer(struct sctp_inpcb *inp, struct mbuf *oper; oper = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (oper) { struct sctp_paramhdr *ph; uint32_t *ippp; diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 9c4a8b2003c9..3d1e31ddac86 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -763,7 +763,7 @@ sctp_disconnect(struct socket *so) /* Left with Data unread */ struct mbuf *err; - err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); + err = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (err) { /* * Fill in the user @@ -862,7 +862,7 @@ sctp_disconnect(struct socket *so) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* * Fill in the user @@ -1077,7 +1077,7 @@ sctp_shutdown(struct socket *so) abort_anyway: op_err = sctp_get_mbuf_for_msg((sizeof(struct sctp_paramhdr) + sizeof(uint32_t)), - 0, M_DONTWAIT, 1, MT_DATA); + 0, M_NOWAIT, 1, MT_DATA); if (op_err) { /* Fill in the user initiated abort */ struct sctp_paramhdr *ph; diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index f31a55736f6e..2f1678250909 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -2548,7 +2548,7 @@ sctp_add_pad_tombuf(struct mbuf *m, int padlen) /* Hard way we must grow the mbuf */ struct mbuf *tmp; - tmp = sctp_get_mbuf_for_msg(padlen, 0, M_DONTWAIT, 1, MT_DATA); + tmp = sctp_get_mbuf_for_msg(padlen, 0, M_NOWAIT, 1, MT_DATA); if (tmp == NULL) { /* Out of space GAK! we are in big trouble. */ SCTP_LTRACE_ERR_RET_PKT(m, NULL, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); @@ -2618,11 +2618,11 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, } else if ((state == SCTP_COMM_LOST) || (state == SCTP_CANT_STR_ASSOC)) { notif_len += abort_len; } - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ notif_len = sizeof(struct sctp_assoc_change); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { goto set_error; } @@ -2740,7 +2740,7 @@ sctp_notify_peer_addr_change(struct sctp_tcb *stcb, uint32_t state, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_paddr_change), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_paddr_change), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) return; SCTP_BUF_LEN(m_notify) = 0; @@ -2831,7 +2831,7 @@ sctp_notify_send_failed(struct sctp_tcb *stcb, uint8_t sent, uint32_t error, } else { length = sizeof(struct sctp_send_failed); } - m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(length, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -2943,7 +2943,7 @@ sctp_notify_send_failed2(struct sctp_tcb *stcb, uint32_t error, } else { length = sizeof(struct sctp_send_failed); } - m_notify = sctp_get_mbuf_for_msg(length, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(length, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* no space left */ return; @@ -3032,7 +3032,7 @@ sctp_notify_adaptation_layer(struct sctp_tcb *stcb) /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_adaption_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_adaption_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3087,7 +3087,7 @@ sctp_notify_partial_delivery_indication(struct sctp_tcb *stcb, uint32_t error, if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_SOCKET_CANT_READ) { return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_pdapi_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3197,7 +3197,7 @@ sctp_notify_shutdown_event(struct sctp_tcb *stcb) /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_shutdown_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3245,7 +3245,7 @@ sctp_notify_sender_dry_event(struct sctp_tcb *stcb, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_sender_dry_event), 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(sizeof(struct sctp_sender_dry_event), 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* no space left */ return; @@ -3297,7 +3297,7 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t return; } stcb->asoc.peer_req_out = 0; - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3353,7 +3353,7 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32 /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3412,7 +3412,7 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb, /* event not enabled */ return; } - m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) /* no space left */ return; @@ -3479,11 +3479,11 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_erro chunk_len = 0; } notif_len = sizeof(struct sctp_remote_error) + chunk_len; - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { /* Retry with smaller value. */ notif_len = sizeof(struct sctp_remote_error); - m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_DONTWAIT, 1, MT_DATA); + m_notify = sctp_get_mbuf_for_msg(notif_len, 0, M_NOWAIT, 1, MT_DATA); if (m_notify == NULL) { return; } @@ -4636,7 +4636,7 @@ sctp_generate_invmanparam(int err) /* Return a MBUF with a invalid mandatory parameter */ struct mbuf *m; - m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_DONTWAIT, 1, MT_DATA); + m = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (m) { struct sctp_paramhdr *ph; @@ -6798,7 +6798,7 @@ sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *ignored) * Split out the mbuf chain. Leave the IP header in m, place the * rest in the sp. */ - sp = m_split(m, off, M_DONTWAIT); + sp = m_split(m, off, M_NOWAIT); if (sp == NULL) { /* Gak, drop packet, we can't do a split */ goto out; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index b050fcfa7651..ac7ac3185292 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -842,7 +842,7 @@ tcp_output(struct tcpcb *tp) TCPSTAT_INC(tcps_sndpack); TCPSTAT_ADD(tcps_sndbyte, len); } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { SOCKBUF_UNLOCK(&so->so_snd); error = ENOBUFS; @@ -850,7 +850,7 @@ tcp_output(struct tcpcb *tp) } #ifdef INET6 if (MHLEN < hdrlen + max_linkhdr) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { SOCKBUF_UNLOCK(&so->so_snd); m_freem(m); @@ -902,7 +902,7 @@ tcp_output(struct tcpcb *tp) else TCPSTAT_INC(tcps_sndwinup); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; goto out; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index a24e16af3277..e74d0aadc288 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -573,7 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, } } if (m == NULL) { - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; tlen = 0; @@ -1859,7 +1859,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) return (0); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (!m) return (0); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index c83945ac9d32..99116521b3c8 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1369,7 +1369,7 @@ syncache_respond(struct syncache *sc) ("syncache: mbuf too small")); /* Create the IP+TCP header from scratch. */ - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); #ifdef MAC diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index c7076d7f7d4e..7e6128b46fdb 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -523,7 +523,7 @@ tcp_twrespond(struct tcptw *tw, int flags) INP_WLOCK_ASSERT(inp); - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); m->m_data += max_linkhdr; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 45e2693623fa..3b93b260ab30 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1174,7 +1174,7 @@ udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr, * link-layer headers. Immediate slide the data pointer back forward * since we won't use that space at this layer. */ - M_PREPEND(m, sizeof(struct udpiphdr) + max_linkhdr, M_DONTWAIT); + M_PREPEND(m, sizeof(struct udpiphdr) + max_linkhdr, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto release; diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index b2e8e047bd50..c4d4e3b03898 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -565,7 +565,7 @@ frag6_input(struct mbuf **mp, int *offp, int proto) m->m_len -= sizeof(struct ip6_frag); } else { /* this comes with no copy if the boundary is on cluster */ - if ((t = m_split(m, offset, M_DONTWAIT)) == NULL) { + if ((t = m_split(m, offset, M_NOWAIT)) == NULL) { frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; #ifdef MAC diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index d9ea93e20a82..0cd6e5aaed95 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -360,7 +360,7 @@ icmp6_error(struct mbuf *m, int type, int code, int param) m_adj(m, ICMPV6_PLD_MAXLEN - m->m_pkthdr.len); preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); - M_PREPEND(m, preplen, M_DONTWAIT); /* FIB is also copied over. */ + M_PREPEND(m, preplen, M_NOWAIT); /* FIB is also copied over. */ if (m && m->m_len < preplen) m = m_pullup(m, preplen); if (m == NULL) { @@ -581,12 +581,12 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) const int maxlen = sizeof(*nip6) + sizeof(*nicmp6); int n0len; - MGETHDR(n, M_DONTWAIT, n0->m_type); + MGETHDR(n, M_NOWAIT, n0->m_type); n0len = n0->m_pkthdr.len; /* save for use below */ if (n) M_MOVE_PKTHDR(n, n0); /* FIB copied. */ if (n && maxlen >= MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; @@ -699,15 +699,15 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) /* Give up remote */ break; } - MGETHDR(n, M_DONTWAIT, m->m_type); + MGETHDR(n, M_NOWAIT, m->m_type); if (n && maxlen > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; } } - if (n && !m_dup_pkthdr(n, m, M_DONTWAIT)) { + if (n && !m_dup_pkthdr(n, m, M_NOWAIT)) { /* * Previous code did a blind M_COPY_PKTHDR * and said "just for rcvif". If true, then @@ -767,7 +767,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_router_solicit)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* give up local */ /* Send incoming SeND packet to user space. */ @@ -805,7 +805,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_router_advert)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ if (send_sendso_input_hook != NULL) { @@ -836,7 +836,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_neighbor_solicit)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, ifp, SND_IN, ip6len); @@ -865,7 +865,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_neighbor_advert)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { /* Send incoming SeND-protected/ND packet to user space. */ if (send_sendso_input_hook != NULL) { @@ -896,7 +896,7 @@ icmp6_input(struct mbuf **mp, int *offp, int proto) goto badcode; if (icmp6len < sizeof(struct nd_redirect)) goto badlen; - if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) { + if ((n = m_copym(m, 0, M_COPYALL, M_NOWAIT)) == NULL) { if (send_sendso_input_hook != NULL) { error = send_sendso_input_hook(m, ifp, SND_IN, ip6len); @@ -1495,7 +1495,7 @@ ni6_input(struct mbuf *m, int off) } /* allocate an mbuf to reply. */ - MGETHDR(n, M_DONTWAIT, m->m_type); + MGETHDR(n, M_NOWAIT, m->m_type); if (n == NULL) { m_freem(m); return (NULL); @@ -1509,7 +1509,7 @@ ni6_input(struct mbuf *m, int off) */ goto bad; } - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { goto bad; } @@ -1609,9 +1609,9 @@ ni6_nametodns(const char *name, int namelen, int old) len = MCLBYTES; /* because MAXHOSTNAMELEN is usually 256, we use cluster mbuf */ - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m && len > MLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) goto fail; } @@ -2063,7 +2063,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) */ if ((m->m_flags & M_EXT) && m->m_next == NULL && m->m_len <= MHLEN) { - MGET(n, M_DONTWAIT, m->m_type); + MGET(n, M_NOWAIT, m->m_type); if (n != NULL) { if (m_dup_pkthdr(n, m, M_NOWAIT)) { bcopy(m->m_data, n->m_data, @@ -2113,7 +2113,7 @@ icmp6_rip6_input(struct mbuf **mp, int off) m->m_len <= MHLEN) { struct mbuf *n; - MGET(n, M_DONTWAIT, m->m_type); + MGET(n, M_NOWAIT, m->m_type); if (n != NULL) { if (m_dup_pkthdr(n, m, M_NOWAIT)) { bcopy(m->m_data, n->m_data, m->m_len); @@ -2592,9 +2592,9 @@ icmp6_redirect_output(struct mbuf *m0, struct rtentry *rt) #if IPV6_MMTU >= MCLBYTES # error assumption failed about IPV6_MMTU and MCLBYTES #endif - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); if (m && IPV6_MMTU >= MHLEN) - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!m) goto fail; M_SETFIB(m, rt->rt_fibnum); diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 573287caa4c3..9da5917aa497 100644 --- a/sys/netinet6/in6_gif.c +++ b/sys/netinet6/in6_gif.c @@ -167,7 +167,7 @@ in6_gif_output(struct ifnet *ifp, eiphdr.eip_resvh = 0; } /* prepend Ethernet-in-IP header */ - M_PREPEND(m, sizeof(struct etherip_header), M_DONTWAIT); + M_PREPEND(m, sizeof(struct etherip_header), M_NOWAIT); if (m && m->m_len < sizeof(struct etherip_header)) m = m_pullup(m, sizeof(struct etherip_header)); if (m == NULL) @@ -191,7 +191,7 @@ in6_gif_output(struct ifnet *ifp, if (family == AF_LINK) len += ETHERIP_ALIGN; #endif - M_PREPEND(m, len, M_DONTWAIT); + M_PREPEND(m, len, M_NOWAIT); if (m != NULL && m->m_len < len) m = m_pullup(m, len); if (m == NULL) { diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 1b90c75dc29c..f75a11f07e34 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -492,11 +492,11 @@ ip6_input(struct mbuf *m) if (m && m->m_next != NULL && m->m_pkthdr.len < MCLBYTES) { struct mbuf *n; - MGETHDR(n, M_DONTWAIT, MT_HEADER); + MGETHDR(n, M_NOWAIT, MT_HEADER); if (n) M_MOVE_PKTHDR(n, m); if (n && n->m_pkthdr.len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -1662,9 +1662,9 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) else elen = (ip6e.ip6e_len + 1) << 3; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n && elen >= MLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 5e72b2be47f6..a22111010db3 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1699,7 +1699,7 @@ register_send(struct ip6_hdr *ip6, struct mif6 *mif, struct mbuf *m) ++pim6stat.pim6s_snd_registers; /* Make a copy of the packet to send to the user level process */ - MGETHDR(mm, M_DONTWAIT, MT_HEADER); + MGETHDR(mm, M_NOWAIT, MT_HEADER); if (mm == NULL) return (ENOBUFS); mm->m_pkthdr.rcvif = NULL; diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index 0d762e9d7d25..f4a0d782c8ca 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -1125,7 +1125,7 @@ skip_ipsec2:; */ m0 = m; for (off = hlen; off < tlen; off += len) { - MGETHDR(m, M_DONTWAIT, MT_HEADER); + MGETHDR(m, M_NOWAIT, MT_HEADER); if (!m) { error = ENOBUFS; V_ip6stat.ip6s_odropped++; @@ -1225,12 +1225,12 @@ ip6_copyexthdr(struct mbuf **mp, caddr_t hdr, int hlen) if (hlen > MCLBYTES) return (ENOBUFS); /* XXX */ - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (!m) return (ENOBUFS); if (hlen > MLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); return (ENOBUFS); @@ -1263,7 +1263,7 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) * Otherwise, use it to store the options. */ if (exthdrs->ip6e_hbh == 0) { - MGET(mopt, M_DONTWAIT, MT_DATA); + MGET(mopt, M_NOWAIT, MT_DATA); if (mopt == 0) return (ENOBUFS); mopt->m_len = JUMBOOPTLEN; @@ -1295,9 +1295,9 @@ ip6_insert_jumboopt(struct ip6_exthdrs *exthdrs, u_int32_t plen) * As a consequence, we must always prepare a cluster * at this point. */ - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -1350,7 +1350,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, if (hlen > sizeof(struct ip6_hdr)) { n = m_copym(m0, sizeof(struct ip6_hdr), - hlen - sizeof(struct ip6_hdr), M_DONTWAIT); + hlen - sizeof(struct ip6_hdr), M_NOWAIT); if (n == 0) return (ENOBUFS); m->m_next = n; @@ -1372,7 +1372,7 @@ ip6_insertfraghdr(struct mbuf *m0, struct mbuf *m, int hlen, /* allocate a new mbuf for the fragment header */ struct mbuf *mfrg; - MGET(mfrg, M_DONTWAIT, MT_DATA); + MGET(mfrg, M_NOWAIT, MT_DATA); if (mfrg == 0) return (ENOBUFS); mfrg->m_len = sizeof(struct ip6_frag); @@ -3048,7 +3048,7 @@ ip6_splithdr(struct mbuf *m, struct ip6_exthdrs *exthdrs) ip6 = mtod(m, struct ip6_hdr *); if (m->m_len > sizeof(*ip6)) { - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == 0) { m_freem(m); return ENOBUFS; diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index ba850b2a38b2..0d9e30026ebc 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -1799,13 +1799,13 @@ mld_v1_transmit_report(struct in6_multi *in6m, const int type) ia = in6ifa_ifpforlinklocal(ifp, IN6_IFF_NOTREADY|IN6_IFF_ANYCAST); /* ia may be NULL if link-local address is tentative. */ - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == NULL) { if (ia != NULL) ifa_free(&ia->ia_ifa); return (ENOMEM); } - MGET(md, M_DONTWAIT, MT_DATA); + MGET(md, M_NOWAIT, MT_DATA); if (md == NULL) { m_free(mh); if (ia != NULL) @@ -2447,9 +2447,9 @@ mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, m0srcs = (ifp->if_mtu - MLD_MTUSPACE - sizeof(struct mldv2_record)) / sizeof(struct in6_addr); if (!is_state_change && !is_group_query) - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (-ENOMEM); @@ -2572,9 +2572,9 @@ mld_v2_enqueue_group_record(struct ifqueue *ifq, struct in6_multi *inm, CTR1(KTR_MLD, "%s: outbound queue full", __func__); return (-ENOMEM); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (-ENOMEM); mld_save_context(m, ifp); @@ -2726,9 +2726,9 @@ mld_v2_enqueue_filter_change(struct ifqueue *ifq, struct in6_multi *inm) CTR1(KTR_MLD, "%s: use previous packet", __func__); } else { - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CTR1(KTR_MLD, "%s: m_get*() failed", __func__); @@ -3173,7 +3173,7 @@ mld_v2_encap_report(struct ifnet *ifp, struct mbuf *m) if (ia == NULL) CTR1(KTR_MLD, "%s: warning: ia is NULL", __func__); - MGETHDR(mh, M_DONTWAIT, MT_HEADER); + MGETHDR(mh, M_NOWAIT, MT_HEADER); if (mh == NULL) { if (ia != NULL) ifa_free(&ia->ia_ifa); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 42b4ad22eb5b..31d0ccba6b04 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -419,9 +419,9 @@ nd6_ns_output(struct ifnet *ifp, const struct in6_addr *daddr6, return; } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && max_linkhdr + maxlen >= MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; @@ -994,9 +994,9 @@ nd6_na_output_fib(struct ifnet *ifp, const struct in6_addr *daddr6_0, return; } - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && max_linkhdr + maxlen >= MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_free(m); m = NULL; diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index d78bf8ef1afd..e6350413d678 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -459,7 +459,7 @@ rip6_output(m, va_alist) code = icmp6->icmp6_code; } - M_PREPEND(m, sizeof(*ip6), M_DONTWAIT); + M_PREPEND(m, sizeof(*ip6), M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 952905a2bd02..200fd68d44c4 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -747,7 +747,7 @@ udp6_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr6, * Calculate data length and get a mbuf * for UDP and IP6 headers. */ - M_PREPEND(m, hlen + sizeof(struct udphdr), M_DONTWAIT); + M_PREPEND(m, hlen + sizeof(struct udphdr), M_NOWAIT); if (m == 0) { error = ENOBUFS; goto release; diff --git a/sys/netipsec/ipsec_mbuf.c b/sys/netipsec/ipsec_mbuf.c index ffbe6649b340..bc87409be511 100644 --- a/sys/netipsec/ipsec_mbuf.c +++ b/sys/netipsec/ipsec_mbuf.c @@ -85,11 +85,11 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) todo = remain; while (todo > 0) { if (todo > MHLEN) { - n = m_getcl(M_DONTWAIT, m->m_type, 0); + n = m_getcl(M_NOWAIT, m->m_type, 0); len = MCLBYTES; } else { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); len = MHLEN; } if (n == NULL) { @@ -115,7 +115,7 @@ m_makespace(struct mbuf *m0, int skip, int hlen, int *off) } } else { - n = m_get(M_DONTWAIT, m->m_type); + n = m_get(M_NOWAIT, m->m_type); if (n == NULL) { m_freem(n0); return NULL; @@ -203,7 +203,7 @@ m_pad(struct mbuf *m, int n) if (pad > M_TRAILINGSPACE(m0)) { /* Add an mbuf to the chain. */ - MGET(m1, M_DONTWAIT, MT_DATA); + MGET(m1, M_NOWAIT, MT_DATA); if (m1 == 0) { m_freem(m0); DPRINTF(("%s: unable to get extra mbuf\n", __func__)); diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c index 681dc15d8d0d..f263139e6e15 100644 --- a/sys/netipsec/ipsec_output.c +++ b/sys/netipsec/ipsec_output.c @@ -601,7 +601,7 @@ ipsec6_splithdr(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); hlen = sizeof(struct ip6_hdr); if (m->m_len > hlen) { - MGETHDR(mh, M_DONTWAIT, MT_DATA); + MGETHDR(mh, M_NOWAIT, MT_DATA); if (!mh) { m_freem(m); return NULL; @@ -721,7 +721,7 @@ ipsec6_encapsulate(struct mbuf *m, struct secasvar *sav) plen = m->m_pkthdr.len; if (M_LEADINGSPACE(m->m_next) < sizeof(struct ip6_hdr)) { struct mbuf *n; - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (!n) { m_freem(m); return ENOBUFS; diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index 2d6443db5afb..a4b7ecba0d98 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -1723,7 +1723,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) IPSEC_ASSERT(len <= MHLEN, ("header too big %u", len)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (!n) goto fail; n->m_len = len; @@ -1742,7 +1742,7 @@ key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) mtod(n, caddr_t)); } else { n = m_copym(m, mhp->extoff[idx], mhp->extlen[idx], - M_DONTWAIT); + M_NOWAIT); } if (n == NULL) goto fail; @@ -2200,9 +2200,9 @@ key_spddelete2(so, m, mhp) /* create new sadb_msg to reply. */ len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n && len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -2222,7 +2222,7 @@ key_spddelete2(so, m, mhp) off, len)); n->m_next = m_copym(m, mhp->extoff[SADB_X_EXT_POLICY], - mhp->extlen[SADB_X_EXT_POLICY], M_DONTWAIT); + mhp->extlen[SADB_X_EXT_POLICY], M_NOWAIT); if (!n->m_next) { m_freem(n); return key_senderror(so, m, ENOBUFS); @@ -3562,9 +3562,9 @@ key_setsadbmsg(u_int8_t type, u_int16_t tlen, u_int8_t satype, u_int32_t seq, len = PFKEY_ALIGN8(sizeof(struct sadb_msg)); if (len > MCLBYTES) return NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m && len > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -4823,9 +4823,9 @@ key_getspi(so, m, mhp) len = PFKEY_ALIGN8(sizeof(struct sadb_msg)) + PFKEY_ALIGN8(sizeof(struct sadb_sa)); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -6033,7 +6033,7 @@ key_getcomb_esp() else { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; @@ -6141,14 +6141,14 @@ key_getcomb_ah() if (!m) { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; m->m_next = NULL; } } else - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6185,14 +6185,14 @@ key_getcomb_ipcomp() if (!m) { IPSEC_ASSERT(l <= MLEN, ("l=%u > MLEN=%lu", l, (u_long) MLEN)); - MGET(m, M_DONTWAIT, MT_DATA); + MGET(m, M_NOWAIT, MT_DATA); if (m) { M_ALIGN(m, l); m->m_len = l; m->m_next = NULL; } } else - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6236,7 +6236,7 @@ key_getprop(saidx) if (!m) return NULL; - M_PREPEND(m, l, M_DONTWAIT); + M_PREPEND(m, l, M_NOWAIT); if (!m) return NULL; @@ -6794,9 +6794,9 @@ key_register(so, m, mhp) if (len > MCLBYTES) return key_senderror(so, m, ENOBUFS); - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_freem(n); n = NULL; @@ -7364,9 +7364,9 @@ key_parse(m, so) if (m->m_next) { struct mbuf *n; - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n && m->m_pkthdr.len > MHLEN) { - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); n = NULL; @@ -7969,9 +7969,9 @@ key_alloc_mbuf(l) len = l; while (len > 0) { - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n && len > MLEN) - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if (!n) { m_freem(m); return NULL; diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 143b600bb4f7..475befaf10b1 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -143,7 +143,7 @@ key_sendup0(rp, m, promisc) if (promisc) { struct sadb_msg *pmsg; - M_PREPEND(m, sizeof(struct sadb_msg), M_DONTWAIT); + M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { @@ -214,14 +214,14 @@ key_sendup(so, msg, len, target) m = mprev = NULL; while (tlen > 0) { if (tlen == len) { - MGETHDR(n, M_DONTWAIT, MT_DATA); + MGETHDR(n, M_NOWAIT, MT_DATA); if (n == NULL) { V_pfkeystat.in_nomem++; return ENOBUFS; } n->m_len = MHLEN; } else { - MGET(n, M_DONTWAIT, MT_DATA); + MGET(n, M_NOWAIT, MT_DATA); if (n == NULL) { V_pfkeystat.in_nomem++; return ENOBUFS; @@ -229,7 +229,7 @@ key_sendup(so, msg, len, target) n->m_len = MLEN; } if (tlen >= MCLBYTES) { /*XXX better threshold? */ - MCLGET(n, M_DONTWAIT); + MCLGET(n, M_NOWAIT); if ((n->m_flags & M_EXT) == 0) { m_free(n); m_freem(m); diff --git a/sys/netipsec/xform_ipip.c b/sys/netipsec/xform_ipip.c index bde2d2c5e829..fc3b1d29859d 100644 --- a/sys/netipsec/xform_ipip.c +++ b/sys/netipsec/xform_ipip.c @@ -447,7 +447,7 @@ ipip_output( goto bad; } - M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip), M_NOWAIT); if (m == 0) { DPRINTF(("%s: M_PREPEND failed\n", __func__)); V_ipipstat.ipips_hdrops++; @@ -534,7 +534,7 @@ ipip_output( if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) ip6->ip6_dst.s6_addr16[1] = 0; - M_PREPEND(m, sizeof(struct ip6_hdr), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ip6_hdr), M_NOWAIT); if (m == 0) { DPRINTF(("%s: M_PREPEND failed\n", __func__)); V_ipipstat.ipips_hdrops++; diff --git a/sys/netipx/ipx_outputfl.c b/sys/netipx/ipx_outputfl.c index 3fbda88b8b19..25bbedf40bbc 100644 --- a/sys/netipx/ipx_outputfl.c +++ b/sys/netipx/ipx_outputfl.c @@ -270,7 +270,7 @@ ipx_output_type20(struct mbuf *m) if(ipx->ipx_sum != 0xffff) ipx->ipx_sum = ipx_cksum(m, ntohs(ipx->ipx_len)); - m1 = m_copym(m, 0, M_COPYALL, M_DONTWAIT); + m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); if(m1) { error = (*ifp->if_output)(ifp, m1, (struct sockaddr *)&dst, NULL); diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c index 5fcfa3645c4b..31b781c9f65f 100644 --- a/sys/netipx/ipx_usrreq.c +++ b/sys/netipx/ipx_usrreq.c @@ -257,7 +257,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0) (m->m_len + m->m_data < &m->m_dat[MLEN])) { mtod(m, char*)[m->m_len++] = 0; } else { - struct mbuf *m1 = m_get(M_DONTWAIT, MT_DATA); + struct mbuf *m1 = m_get(M_NOWAIT, MT_DATA); if (m1 == NULL) { m_freem(m0); @@ -278,7 +278,7 @@ ipx_output(struct ipxpcb *ipxp, struct mbuf *m0) if (ipxp->ipxp_flags & IPXP_RAWOUT) { ipx = mtod(m, struct ipx *); } else { - M_PREPEND(m, sizeof(struct ipx), M_DONTWAIT); + M_PREPEND(m, sizeof(struct ipx), M_NOWAIT); if (m == NULL) return (ENOBUFS); ipx = mtod(m, struct ipx *); diff --git a/sys/netipx/spx_reass.c b/sys/netipx/spx_reass.c index fea031fdc493..2479ae13ec87 100644 --- a/sys/netipx/spx_reass.c +++ b/sys/netipx/spx_reass.c @@ -399,7 +399,7 @@ spx_reass(struct spxpcb *cb, struct mbuf *msi, struct spx *si) spx_newchecks[4]++; if (dt != cb->s_rhdr.spx_dt) { struct mbuf *mm = - m_getclr(M_DONTWAIT, MT_CONTROL); + m_getclr(M_NOWAIT, MT_CONTROL); spx_newchecks[0]++; if (mm != NULL) { u_short *s = diff --git a/sys/netipx/spx_usrreq.c b/sys/netipx/spx_usrreq.c index 2b1828855bcc..9d00d10533f5 100644 --- a/sys/netipx/spx_usrreq.c +++ b/sys/netipx/spx_usrreq.c @@ -473,7 +473,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) cb->s_cc &= ~SPX_EM; while (len > mtu) { - m = m_copym(m0, 0, mtu, M_DONTWAIT); + m = m_copym(m0, 0, mtu, M_NOWAIT); if (m == NULL) { cb->s_cc |= oldEM; m_freem(m0); @@ -509,7 +509,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) if (M_TRAILINGSPACE(m) >= 1) m->m_len++; else { - struct mbuf *m1 = m_get(M_DONTWAIT, MT_DATA); + struct mbuf *m1 = m_get(M_NOWAIT, MT_DATA); if (m1 == NULL) { m_freem(m0); @@ -520,7 +520,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) m->m_next = m1; } } - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(m0); return (ENOBUFS); @@ -734,7 +734,7 @@ spx_output(struct spxpcb *cb, struct mbuf *m0) spxstat.spxs_sndprobe++; if (cb->s_flags & SF_ACKNOW) spxstat.spxs_sndacks++; - m = m_gethdr(M_DONTWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return (ENOBUFS); @@ -1091,7 +1091,7 @@ spx_attach(struct socket *so, int proto, struct thread *td) cb = malloc(sizeof *cb, M_PCB, M_NOWAIT | M_ZERO); if (cb == NULL) return (ENOBUFS); - mm = m_getclr(M_DONTWAIT, MT_DATA); + mm = m_getclr(M_NOWAIT, MT_DATA); if (mm == NULL) { free(cb, M_PCB); return (ENOBUFS); diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index cfcbaa786c73..681da9cd0595 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -292,7 +292,7 @@ natm_usr_send(struct socket *so, int flags, struct mbuf *m, /* * Send the data. We must put an atm_pseudohdr on first. */ - M_PREPEND(m, sizeof(*aph), M_DONTWAIT); + M_PREPEND(m, sizeof(*aph), M_NOWAIT); if (m == NULL) { NATM_UNLOCK(); m_freem(control); diff --git a/sys/netncp/ncp_sock.c b/sys/netncp/ncp_sock.c index 4be432ed3cf0..24557bef0add 100644 --- a/sys/netncp/ncp_sock.c +++ b/sys/netncp/ncp_sock.c @@ -157,7 +157,7 @@ ncp_sock_send(struct socket *so, struct mbuf *top, struct ncp_rq *rqp) int error, flags=0; for (;;) { - m = m_copym(top, 0, M_COPYALL, M_WAIT); + m = m_copym(top, 0, M_COPYALL, M_WAITOK); /* NCPDDEBUG(m);*/ error = sosend(so, to, 0, m, 0, flags, td); if (error == 0 || error == EINTR || error == ENETDOWN) diff --git a/sys/netpfil/ipfw/ip_dn_glue.c b/sys/netpfil/ipfw/ip_dn_glue.c index 54eed7500cc0..7d7e69547dd8 100644 --- a/sys/netpfil/ipfw/ip_dn_glue.c +++ b/sys/netpfil/ipfw/ip_dn_glue.c @@ -513,7 +513,7 @@ dn_compat_configure(void *v) lmax += sizeof(struct dn_sch) + sizeof(struct dn_link) + sizeof(struct dn_fs) + sizeof(struct dn_profile); - base = buf = malloc(lmax, M_DUMMYNET, M_WAIT|M_ZERO); + base = buf = malloc(lmax, M_DUMMYNET, M_WAITOK|M_ZERO); o_next(&buf, sizeof(struct dn_id), DN_CMD_CONFIG); base->id = DN_API_VERSION; diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index d58bc90bd155..5cccce9dc1c1 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -810,7 +810,7 @@ ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, #endif struct tcphdr *th = NULL; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); diff --git a/sys/netpfil/ipfw/ip_fw_pfil.c b/sys/netpfil/ipfw/ip_fw_pfil.c index 5d6c1bdae01d..79973b1f05c7 100644 --- a/sys/netpfil/ipfw/ip_fw_pfil.c +++ b/sys/netpfil/ipfw/ip_fw_pfil.c @@ -346,7 +346,7 @@ ipfw_check_frame(void *arg, struct mbuf **m0, struct ifnet *dst, int dir, * Restore Ethernet header, as needed, in case the * mbuf chain was replaced by ipfw. */ - M_PREPEND(m, ETHER_HDR_LEN, M_DONTWAIT); + M_PREPEND(m, ETHER_HDR_LEN, M_NOWAIT); if (m == NULL) { *m0 = NULL; return (0); @@ -411,7 +411,7 @@ ipfw_divert(struct mbuf **m0, int incoming, struct ipfw_rule_ref *rule, clone = *m0; /* use the original mbuf */ *m0 = NULL; } else { - clone = m_dup(*m0, M_DONTWAIT); + clone = m_dup(*m0, M_NOWAIT); /* If we cannot duplicate the mbuf, we sacrifice the divert * chain and continue with the tee-ed packet. */ diff --git a/sys/netsmb/smb_iod.c b/sys/netsmb/smb_iod.c index 78def4739f1f..e4c805a33698 100644 --- a/sys/netsmb/smb_iod.c +++ b/sys/netsmb/smb_iod.c @@ -255,7 +255,7 @@ smb_iod_sendrq(struct smbiod *iod, struct smb_rq *rqp) } SMBSDEBUG("M:%04x, P:%04x, U:%04x, T:%04x\n", rqp->sr_mid, 0, 0, 0); m_dumpm(rqp->sr_rq.mb_top); - m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_WAIT); + m = m_copym(rqp->sr_rq.mb_top, 0, M_COPYALL, M_WAITOK); error = rqp->sr_lerror = SMB_TRAN_SEND(vcp, m, td); if (error == 0) { getnanotime(&rqp->sr_timesent); diff --git a/sys/netsmb/smb_rq.c b/sys/netsmb/smb_rq.c index 566a25211558..957102901cf4 100644 --- a/sys/netsmb/smb_rq.c +++ b/sys/netsmb/smb_rq.c @@ -427,7 +427,7 @@ smb_t2_placedata(struct mbuf *mtop, u_int16_t offset, u_int16_t count, struct mbuf *m, *m0; int len; - m0 = m_split(mtop, offset, M_WAIT); + m0 = m_split(mtop, offset, M_WAITOK); len = m_length(m0, &m); m->m_len -= len - count; if (mdp->md_top == NULL) { diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c index a7c7e05b351d..dd39ac5fed8c 100644 --- a/sys/netsmb/smb_trantcp.c +++ b/sys/netsmb/smb_trantcp.c @@ -580,7 +580,7 @@ smb_nbst_send(struct smb_vc *vcp, struct mbuf *m0, struct thread *td) error = ENOTCONN; goto abort; } - M_PREPEND(m0, 4, M_WAIT); + M_PREPEND(m0, 4, M_WAITOK); nb_sethdr(m0, NB_SSN_MESSAGE, m_fixhdr(m0) - 4); error = nb_sosend(nbp->nbp_tso, m0, 0, td); return error; diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c index 18e0f9b67609..6caafcf8f910 100644 --- a/sys/nfs/krpc_subr.c +++ b/sys/nfs/krpc_subr.c @@ -154,7 +154,7 @@ krpc_portmap(struct sockaddr_in *sin, u_int prog, u_int vers, u_int16_t *portp, return 0; } - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); sdata = mtod(m, struct sdata *); m->m_len = sizeof(*sdata); @@ -275,7 +275,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, /* * Prepend RPC message header. */ - mhead = m_gethdr(M_WAIT, MT_DATA); + mhead = m_gethdr(M_WAITOK, MT_DATA); mhead->m_next = *data; call = mtod(mhead, struct krpc_call *); mhead->m_len = sizeof(*call); @@ -309,7 +309,7 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, timo = 0; for (;;) { /* Send RPC request (or re-send). */ - m = m_copym(mhead, 0, M_COPYALL, M_WAIT); + m = m_copym(mhead, 0, M_COPYALL, M_WAITOK); error = sosend(so, (struct sockaddr *)sa, NULL, m, NULL, 0, td); if (error) { @@ -459,9 +459,9 @@ xdr_string_encode(char *str, int len) if (mlen > MCLBYTES) /* If too big, we just can't do it. */ return (NULL); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); if (mlen > MLEN) - MCLGET(m, M_WAIT); + MCLGET(m, M_WAITOK); xs = mtod(m, struct xdr_string *); m->m_len = mlen; xs->len = txdr_unsigned(len); diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 09dbfabed320..6f0394824640 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -275,7 +275,7 @@ nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos) void *ret; if (s > M_TRAILINGSPACE(*mb)) { - MGET(mb2, M_WAIT, MT_DATA); + MGET(mb2, M_WAITOK, MT_DATA); if (s > MLEN) panic("build > MLEN"); (*mb)->m_next = mb2; @@ -293,14 +293,14 @@ void * nfsm_dissect_xx(int s, struct mbuf **md, caddr_t *dpos) { - return (nfsm_dissect_xx_sub(s, md, dpos, M_WAIT)); + return (nfsm_dissect_xx_sub(s, md, dpos, M_WAITOK)); } void * nfsm_dissect_xx_nonblock(int s, struct mbuf **md, caddr_t *dpos) { - return (nfsm_dissect_xx_sub(s, md, dpos, M_DONTWAIT)); + return (nfsm_dissect_xx_sub(s, md, dpos, M_NOWAIT)); } static void * diff --git a/sys/nfsclient/nfs_krpc.c b/sys/nfsclient/nfs_krpc.c index 6dfd46d8d61f..0e4a83ec438c 100644 --- a/sys/nfsclient/nfs_krpc.c +++ b/sys/nfsclient/nfs_krpc.c @@ -568,7 +568,7 @@ nfs_request(struct vnode *vp, struct mbuf *mreq, int procnum, * These could cause pointer alignment problems, so copy them to * well aligned mbufs. */ - error = nfs_realign(&mrep, M_DONTWAIT); + error = nfs_realign(&mrep, M_NOWAIT); if (error == ENOMEM) { m_freem(mrep); AUTH_DESTROY(auth); diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index fb6cbe81ce7e..fd83794152ba 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -181,9 +181,9 @@ nfsm_reqhead(struct vnode *vp, u_long procid, int hsiz) { struct mbuf *mb; - MGET(mb, M_WAIT, MT_DATA); + MGET(mb, M_WAITOK, MT_DATA); if (hsiz >= MINCLSIZE) - MCLGET(mb, M_WAIT); + MCLGET(mb, M_WAITOK); mb->m_len = 0; return (mb); } @@ -218,9 +218,9 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos) while (left > 0) { mlen = M_TRAILINGSPACE(mp); if (mlen == 0) { - MGET(mp, M_WAIT, MT_DATA); + MGET(mp, M_WAITOK, MT_DATA); if (clflg) - MCLGET(mp, M_WAIT); + MCLGET(mp, M_WAITOK); mp->m_len = 0; mp2->m_next = mp; mp2 = mp; @@ -251,7 +251,7 @@ nfsm_uiotombuf(struct uio *uiop, struct mbuf **mq, int siz, caddr_t *bpos) } if (rem > 0) { if (rem > M_TRAILINGSPACE(mp)) { - MGET(mp, M_WAIT, MT_DATA); + MGET(mp, M_WAITOK, MT_DATA); mp->m_len = 0; mp2->m_next = mp; } @@ -296,9 +296,9 @@ nfsm_strtmbuf(struct mbuf **mb, char **bpos, const char *cp, long siz) } /* Loop around adding mbufs */ while (siz > 0) { - MGET(m1, M_WAIT, MT_DATA); + MGET(m1, M_WAITOK, MT_DATA); if (siz > MLEN) - MCLGET(m1, M_WAIT); + MCLGET(m1, M_WAITOK); m1->m_len = NFSMSIZ(m1); m2->m_next = m1; m2 = m1; @@ -481,7 +481,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, md = *mdp; t1 = (mtod(md, caddr_t) + md->m_len) - *dposp; - cp2 = nfsm_disct(mdp, dposp, NFSX_FATTR(v3), t1, M_WAIT); + cp2 = nfsm_disct(mdp, dposp, NFSX_FATTR(v3), t1, M_WAITOK); if (cp2 == NULL) { error = EBADRPC; goto out; diff --git a/sys/nfsserver/nfs_fha.c b/sys/nfsserver/nfs_fha.c index 76537d7ef94d..2dd20c131cd6 100644 --- a/sys/nfsserver/nfs_fha.c +++ b/sys/nfsserver/nfs_fha.c @@ -202,7 +202,7 @@ fha_extract_info(struct svc_req *req, struct fha_info *i) procnum == NFSPROC_NULL) goto out; - error = nfs_realign(&req->rq_args, M_DONTWAIT); + error = nfs_realign(&req->rq_args, M_NOWAIT); if (error) goto out; md = req->rq_args; diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index f0da468927eb..bef72afea337 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -693,8 +693,8 @@ nfsrv_readlink(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, len = 0; i = 0; while (len < NFS_MAXPATHLEN) { - MGET(nmp, M_WAIT, MT_DATA); - MCLGET(nmp, M_WAIT); + MGET(nmp, M_WAITOK, MT_DATA); + MCLGET(nmp, M_WAITOK); nmp->m_len = NFSMSIZ(nmp); if (len == 0) mp3 = mp = nmp; @@ -878,8 +878,8 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, i++; } if (left > 0) { - MGET(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGET(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); m->m_len = 0; m2->m_next = m; m2 = m; diff --git a/sys/nfsserver/nfs_srvkrpc.c b/sys/nfsserver/nfs_srvkrpc.c index 2581092eafe0..64f2aaad1ef8 100644 --- a/sys/nfsserver/nfs_srvkrpc.c +++ b/sys/nfsserver/nfs_srvkrpc.c @@ -217,14 +217,14 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, int err, if (err && (nd->nd_flag & ND_NFSV3) == 0) /* XXX recheck */ siz = 0; - MGET(mreq, M_WAIT, MT_DATA); + MGET(mreq, M_WAITOK, MT_DATA); /* * If this is a big reply, use a cluster */ mreq->m_len = 0; if (siz >= MINCLSIZE) { - MCLGET(mreq, M_WAIT); + MCLGET(mreq, M_WAITOK); } mb = mreq; bpos = mtod(mb, caddr_t); @@ -278,7 +278,7 @@ nfssvc_program(struct svc_req *rqst, SVCXPRT *xprt) mreq = mrep = NULL; mreq = rqst->rq_args; rqst->rq_args = NULL; - (void)nfs_realign(&mreq, M_WAIT); + (void)nfs_realign(&mreq, M_WAITOK); /* * Note: we want rq_addr, not svc_getrpccaller for nd_nam2 - diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index ba3a9fe4775b..eedac6c01138 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1301,8 +1301,8 @@ nfsm_clget_xx(u_int32_t **tl, struct mbuf *mb, struct mbuf **mp, if (*bp >= *be) { if (*mp == mb) (*mp)->m_len += *bp - bpos; - MGET(nmp, M_WAIT, MT_DATA); - MCLGET(nmp, M_WAIT); + MGET(nmp, M_WAITOK, MT_DATA); + MCLGET(nmp, M_WAITOK); nmp->m_len = NFSMSIZ(nmp); (*mp)->m_next = nmp; *mp = nmp; diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 1afb80e23efe..339e30500786 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -287,7 +287,7 @@ int ipoib_dma_map_tx(struct ib_device *ca, struct ipoib_tx_buf *tx_req, int max) } i--; if (i >= max) { - tx_req->mb = mb = m_defrag(mb, M_DONTWAIT); + tx_req->mb = mb = m_defrag(mb, M_NOWAIT); if (mb == NULL) return -EIO; for (m = mb, i = 0; m != NULL; m = m->m_next, i++); diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c index 380ee8c2c015..22b0fb923b92 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -1346,7 +1346,7 @@ ipoib_output(struct ifnet *ifp, struct mbuf *m, * Add local net header. If no space in first mbuf, * allocate another. */ - M_PREPEND(m, IPOIB_HEADER_LEN, M_DONTWAIT); + M_PREPEND(m, IPOIB_HEADER_LEN, M_NOWAIT); if (m == NULL) { error = ENOBUFS; goto bad; diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c index d0688528f1ff..327d7bef73f5 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_bcopy.c @@ -151,7 +151,7 @@ sdp_nagle_timeout(void *data) if (ssk->state == TCPS_CLOSED) return; ssk->nagle_last_unacked = 0; - sdp_post_sends(ssk, M_DONTWAIT); + sdp_post_sends(ssk, M_NOWAIT); sowwakeup(ssk->socket); out: diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index 2b15f31b67f4..c915fb3c92ea 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -928,12 +928,12 @@ sdp_send(struct socket *so, int flags, struct mbuf *m, ssk = sdp_sk(so); KASSERT(m->m_flags & M_PKTHDR, ("sdp_send: %p no packet header", m)); - M_PREPEND(m, SDP_HEAD_SIZE, M_WAIT); + M_PREPEND(m, SDP_HEAD_SIZE, M_WAITOK); mtod(m, struct sdp_bsdh *)->mid = SDP_MID_DATA; for (n = m, cnt = 0; n->m_next; n = n->m_next) cnt++; if (cnt > SDP_MAX_SEND_SGES) { - n = m_collapse(m, M_WAIT, SDP_MAX_SEND_SGES); + n = m_collapse(m, M_WAITOK, SDP_MAX_SEND_SGES); if (n == NULL) { m_freem(m); return (EMSGSIZE); @@ -1196,7 +1196,7 @@ soreceive_rcvoob(struct socket *so, struct uio *uio, int flags) KASSERT(flags & MSG_OOB, ("soreceive_rcvoob: (flags & MSG_OOB) == 0")); - m = m_get(M_WAIT, MT_DATA); + m = m_get(M_WAITOK, MT_DATA); error = (*pr->pr_usrreqs->pru_rcvoob)(so, m, flags & MSG_PEEK); if (error) goto bad; @@ -1351,7 +1351,7 @@ sdp_sorecv(struct socket *so, struct sockaddr **psa, struct uio *uio, KASSERT(sb->sb_mb != NULL, ("%s: len > 0 && sb->sb_mb empty", __func__)); - m = m_copym(sb->sb_mb, 0, len, M_DONTWAIT); + m = m_copym(sb->sb_mb, 0, len, M_NOWAIT); if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c index b0c37e554e13..f7d84be1b988 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c @@ -297,7 +297,7 @@ sdp_process_tx_cq(struct sdp_sock *ssk) } while (n == SDP_NUM_WC); if (wc_processed) { - sdp_post_sends(ssk, M_DONTWAIT); + sdp_post_sends(ssk, M_NOWAIT); sdp_prf1(sk, NULL, "Waking sendmsg. inflight=%d", (u32) tx_ring_posted(ssk)); sowwakeup(ssk->socket); diff --git a/sys/ofed/drivers/net/mlx4/en_tx.c b/sys/ofed/drivers/net/mlx4/en_tx.c index 4d1690f8da0e..e2e13c2fdcc4 100644 --- a/sys/ofed/drivers/net/mlx4/en_tx.c +++ b/sys/ofed/drivers/net/mlx4/en_tx.c @@ -725,7 +725,7 @@ static int mlx4_en_xmit(struct net_device *dev, int tx_ind, struct mbuf **mbp) nr_txbb = desc_size / TXBB_SIZE; if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { if (defrag) { - mb = m_defrag(*mbp, M_DONTWAIT); + mb = m_defrag(*mbp, M_NOWAIT); if (mb == NULL) { mb = *mbp; goto tx_drop; diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index 11c20a3e2d18..98e3352c0298 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -1565,7 +1565,7 @@ rl_encap(struct rl_softc *sc, struct mbuf **m_head) */ if (m->m_next != NULL || (mtod(m, uintptr_t) & 3) != 0 || (padlen > 0 && M_TRAILINGSPACE(m) < padlen)) { - m = m_defrag(*m_head, M_DONTWAIT); + m = m_defrag(*m_head, M_NOWAIT); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/powerpc/ps3/if_glc.c b/sys/powerpc/ps3/if_glc.c index ab5c17279923..178821221c84 100644 --- a/sys/powerpc/ps3/if_glc.c +++ b/sys/powerpc/ps3/if_glc.c @@ -555,7 +555,7 @@ glc_add_rxbuf(struct glc_softc *sc, int idx) bus_dma_segment_t segs[1]; int error, nsegs; - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) return (ENOBUFS); m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; @@ -630,7 +630,7 @@ glc_encap(struct glc_softc *sc, struct mbuf **m_head, bus_addr_t *pktdesc) nsegs++; if (nsegs > nsegs_max) { - m = m_collapse(*m_head, M_DONTWAIT, nsegs_max); + m = m_collapse(*m_head, M_NOWAIT, nsegs_max); if (m == NULL) { m_freem(*m_head); *m_head = NULL; diff --git a/sys/rpc/clnt_dg.c b/sys/rpc/clnt_dg.c index c86b18a904d0..86a8d01ee63e 100644 --- a/sys/rpc/clnt_dg.c +++ b/sys/rpc/clnt_dg.c @@ -431,7 +431,7 @@ clnt_dg_call( send_again: mtx_unlock(&cs->cs_lock); - MGETHDR(mreq, M_WAIT, MT_DATA); + MGETHDR(mreq, M_WAITOK, MT_DATA); KASSERT(cu->cu_mcalllen <= MHLEN, ("RPC header too big")); bcopy(cu->cu_mcallc, mreq->m_data, cu->cu_mcalllen); mreq->m_len = cu->cu_mcalllen; diff --git a/sys/rpc/clnt_vc.c b/sys/rpc/clnt_vc.c index 26f23fa1c864..6655e6e7da95 100644 --- a/sys/rpc/clnt_vc.c +++ b/sys/rpc/clnt_vc.c @@ -386,7 +386,7 @@ clnt_vc_call( /* * Leave space to pre-pend the record mark. */ - MGETHDR(mreq, M_WAIT, MT_DATA); + MGETHDR(mreq, M_WAITOK, MT_DATA); mreq->m_data += sizeof(uint32_t); KASSERT(ct->ct_mpos + sizeof(uint32_t) <= MHLEN, ("RPC header too big")); @@ -414,7 +414,7 @@ clnt_vc_call( /* * Prepend a record marker containing the packet length. */ - M_PREPEND(mreq, sizeof(uint32_t), M_WAIT); + M_PREPEND(mreq, sizeof(uint32_t), M_WAITOK); *mtod(mreq, uint32_t *) = htonl(0x80000000 | (mreq->m_pkthdr.len - sizeof(uint32_t))); diff --git a/sys/rpc/rpc_generic.c b/sys/rpc/rpc_generic.c index 6adae3839912..65f57cf2e35c 100644 --- a/sys/rpc/rpc_generic.c +++ b/sys/rpc/rpc_generic.c @@ -750,8 +750,8 @@ clnt_call_private( struct mbuf *mrep; enum clnt_stat stat; - MGET(mreq, M_WAIT, MT_DATA); - MCLGET(mreq, M_WAIT); + MGET(mreq, M_WAITOK, MT_DATA); + MCLGET(mreq, M_WAITOK); mreq->m_len = 0; xdrmbuf_create(&xdrs, mreq, XDR_ENCODE); diff --git a/sys/rpc/rpcm_subs.h b/sys/rpc/rpcm_subs.h index ac789f3c593a..f0d60a3d6ebc 100644 --- a/sys/rpc/rpcm_subs.h +++ b/sys/rpc/rpcm_subs.h @@ -80,7 +80,7 @@ #define rpcm_build(a,c,s) \ { if ((s) > M_TRAILINGSPACE(mb)) { \ - MGET(mb2, M_WAIT, MT_DATA); \ + MGET(mb2, M_WAITOK, MT_DATA); \ if ((s) > MLEN) \ panic("build > MLEN"); \ mb->m_next = mb2; \ diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c b/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c index 91112a1aa675..a50c4fa98d18 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c @@ -107,7 +107,7 @@ put_uint32(struct mbuf **mp, uint32_t v) struct mbuf *m = *mp; uint32_t n; - M_PREPEND(m, sizeof(uint32_t), M_WAIT); + M_PREPEND(m, sizeof(uint32_t), M_WAITOK); n = htonl(v); bcopy(&n, mtod(m, uint32_t *), sizeof(uint32_t)); *mp = m; @@ -241,7 +241,7 @@ xdr_rpc_gss_unwrap_data(struct mbuf **resultsp, */ len = get_uint32(&results); message = results; - results = m_split(results, len, M_WAIT); + results = m_split(results, len, M_WAITOK); if (!results) { m_freem(message); return (FALSE); diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 16e911aba62b..f038e783c04e 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -563,8 +563,8 @@ svc_sendreply(struct svc_req *rqstp, xdrproc_t xdr_results, void * xdr_location) rply.acpted_rply.ar_results.where = NULL; rply.acpted_rply.ar_results.proc = (xdrproc_t) xdr_void; - MGET(m, M_WAIT, MT_DATA); - MCLGET(m, M_WAIT); + MGET(m, M_WAITOK, MT_DATA); + MCLGET(m, M_WAITOK); m->m_len = 0; xdrmbuf_create(&xdrs, m, XDR_ENCODE); ok = xdr_results(&xdrs, xdr_location); diff --git a/sys/rpc/svc_dg.c b/sys/rpc/svc_dg.c index adfe2b51f87c..ba6a56e1c700 100644 --- a/sys/rpc/svc_dg.c +++ b/sys/rpc/svc_dg.c @@ -238,7 +238,7 @@ svc_dg_reply(SVCXPRT *xprt, struct rpc_msg *msg, bool_t stat = TRUE; int error; - MGETHDR(mrep, M_WAIT, MT_DATA); + MGETHDR(mrep, M_WAITOK, MT_DATA); mrep->m_len = 0; xdrmbuf_create(&xdrs, mrep, XDR_ENCODE); diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index fddcf586a08e..ca8239bae6ea 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -572,7 +572,7 @@ svc_vc_recv(SVCXPRT *xprt, struct rpc_msg *msg, if (cd->mpending->m_next || cd->mpending->m_len > cd->resid) cd->mpending = m_split(cd->mpending, - cd->resid, M_WAIT); + cd->resid, M_WAITOK); else cd->mpending = NULL; if (cd->mreq) @@ -691,7 +691,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg, /* * Leave space for record mark. */ - MGETHDR(mrep, M_WAIT, MT_DATA); + MGETHDR(mrep, M_WAITOK, MT_DATA); mrep->m_len = 0; mrep->m_data += sizeof(uint32_t); @@ -713,7 +713,7 @@ svc_vc_reply(SVCXPRT *xprt, struct rpc_msg *msg, /* * Prepend a record marker containing the reply length. */ - M_PREPEND(mrep, sizeof(uint32_t), M_WAIT); + M_PREPEND(mrep, sizeof(uint32_t), M_WAITOK); *mtod(mrep, uint32_t *) = htonl(0x80000000 | (mrep->m_pkthdr.len - sizeof(uint32_t))); diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 0d0b0d054919..6444b078bef1 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -346,18 +346,7 @@ struct mbstat { }; /* - * Flags specifying how an allocation should be made. - * - * The flag to use is as follows: - * - M_NOWAIT (M_DONTWAIT) from an interrupt handler to not block allocation. - * - M_WAITOK (M_WAIT) from wherever it is safe to block. - * - * M_DONTWAIT/M_NOWAIT means that we will not block the thread explicitly and - * if we cannot allocate immediately we may return NULL, whereas - * M_WAIT/M_WAITOK means that if we cannot allocate resources we - * will block until they are available, and thus never return NULL. - * - * XXX Eventually just phase this out to use M_WAITOK/M_NOWAIT. + * Compatibility with historic mbuf allocator. */ #define MBTOM(how) (how) #define M_DONTWAIT M_NOWAIT @@ -865,7 +854,7 @@ m_last(struct mbuf *m) #define M_COPYALL 1000000000 /* Compatibility with 4.3. */ -#define m_copy(m, o, l) m_copym((m), (o), (l), M_DONTWAIT) +#define m_copy(m, o, l) m_copym((m), (o), (l), M_NOWAIT) extern int max_datalen; /* MHLEN - max_hdr */ extern int max_hdr; /* Largest link + protocol header */ From 29aaa9615959a0523074de389e74204f3828fd4a Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 5 Dec 2012 11:35:50 +0000 Subject: [PATCH 031/513] if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead of pkgbeta.FreeBSD.org MFC after: 1 month --- usr.sbin/pkg/Makefile | 2 +- usr.sbin/pkg/dns_utils.c | 136 +++++++++++++++++++++++++++++++++++++++ usr.sbin/pkg/dns_utils.h | 45 +++++++++++++ usr.sbin/pkg/pkg.c | 48 +++++++++++--- 4 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 usr.sbin/pkg/dns_utils.c create mode 100644 usr.sbin/pkg/dns_utils.h diff --git a/usr.sbin/pkg/Makefile b/usr.sbin/pkg/Makefile index 360e301c1813..c2ca0a32d391 100644 --- a/usr.sbin/pkg/Makefile +++ b/usr.sbin/pkg/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= pkg -SRC= pkg.c +SRCS= pkg.c dns_utils.c NO_MAN= yes DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBFETCH} diff --git a/usr.sbin/pkg/dns_utils.c b/usr.sbin/pkg/dns_utils.c new file mode 100644 index 000000000000..e88bf989d821 --- /dev/null +++ b/usr.sbin/pkg/dns_utils.c @@ -0,0 +1,136 @@ +/*- + * Copyright (c) 2012 Baptiste Daroussin + * 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, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include "dns_utils.h" + +typedef union { + HEADER hdr; + unsigned char buf[1024]; +} dns_query; + +struct dns_srvinfo * +dns_getsrvinfo(const char *zone) +{ + struct dns_srvinfo **res, *first; + unsigned char *end, *p; + char host[MAXHOSTNAMELEN]; + dns_query q; + int len, qdcount, ancount, n, i; + unsigned int type, class, ttl, priority, weight, port; + + if ((len = res_query(zone, C_IN, T_SRV, q.buf, sizeof(q.buf))) == -1 || + len < (int)sizeof(HEADER)) + return (NULL); + + qdcount = ntohs(q.hdr.qdcount); + ancount = ntohs(q.hdr.ancount); + + end = q.buf + len; + p = q.buf + sizeof(HEADER); + + while(qdcount > 0 && p < end) { + qdcount--; + if((len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN)) < 0) + return (NULL); + p += len + NS_QFIXEDSZ; + } + + res = malloc(sizeof(struct dns_srvinfo) * ancount); + if (res == NULL) + return (NULL); + memset(res, 0, sizeof(struct dns_srvinfo) * ancount); + + n = 0; + while (ancount > 0 && p < end) { + ancount--; + len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN); + if (len < 0) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return NULL; + } + + p += len; + + NS_GET16(type, p); + NS_GET16(class, p); + NS_GET32(ttl, p); + NS_GET16(len, p); + + if (type != T_SRV) { + p += len; + continue; + } + + NS_GET16(priority, p); + NS_GET16(weight, p); + NS_GET16(port, p); + + len = dn_expand(q.buf, end, p, host, MAXHOSTNAMELEN); + if (len < 0) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return (NULL); + } + + res[n] = malloc(sizeof(struct dns_srvinfo)); + if (res[n] == NULL) { + for (i = 0; i < n; i++) + free(res[i]); + free(res); + return (NULL); + } + res[n]->type = type; + res[n]->class = class; + res[n]->ttl = ttl; + res[n]->priority = priority; + res[n]->weight = weight; + res[n]->port = port; + res[n]->next = NULL; + strlcpy(res[n]->host, host, MAXHOSTNAMELEN); + + p += len; + n++; + } + + for (i = 0; i < n - 1; i++) + res[i]->next = res[i + 1]; + + first = res[0]; + free(res); + + return (first); +} diff --git a/usr.sbin/pkg/dns_utils.h b/usr.sbin/pkg/dns_utils.h new file mode 100644 index 000000000000..0f3367b526c0 --- /dev/null +++ b/usr.sbin/pkg/dns_utils.h @@ -0,0 +1,45 @@ +/*- + * Copyright (c) 2012 Baptiste Daroussin + * 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 DNS_UTILS_H +#define DNS_UTILS_H +struct dns_srvinfo { + unsigned int type; + unsigned int class; + unsigned int ttl; + unsigned int priority; + unsigned int weight; + unsigned int port; + char host[MAXHOSTNAMELEN]; + struct dns_srvinfo *next; +}; + +struct dns_srvinfo * + dns_getsrvinfo(const char *zone); + +#endif diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c index 8dc7bcfd9a1a..061008c4f00e 100644 --- a/usr.sbin/pkg/pkg.c +++ b/usr.sbin/pkg/pkg.c @@ -48,9 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include "elf_tables.h" +#include "dns_utils.h" #define _LOCALBASE "/usr/local" -#define _PKGS_URL "http://pkgbeta.FreeBSD.org" +#define _PKGS_URL "http://pkg.FreeBSD.org" static const char * elf_corres_to_string(struct _elf_corres *m, int e) @@ -281,16 +282,20 @@ install_pkg_static(char *path, char *pkgpath) static int bootstrap_pkg(void) { + struct url *u; FILE *remote; FILE *config; char *site; + struct dns_srvinfo *mirrors, *current; + /* To store _https._tcp. + hostname + \0 */ + char zone[MAXHOSTNAMELEN + 13]; char url[MAXPATHLEN]; char conf[MAXPATHLEN]; char abi[BUFSIZ]; char tmppkg[MAXPATHLEN]; char buf[10240]; char pkgstatic[MAXPATHLEN]; - int fd, retry, ret; + int fd, retry, ret, max_retry; struct url_stat st; off_t done, r; time_t now; @@ -298,9 +303,11 @@ bootstrap_pkg(void) done = 0; last = 0; + max_retry = 3; ret = -1; remote = NULL; config = NULL; + current = mirrors = NULL; printf("Bootstrapping pkg please wait\n"); @@ -324,12 +331,37 @@ bootstrap_pkg(void) return (-1); } - retry = 3; - do { - remote = fetchXGetURL(url, &st, ""); - if (remote == NULL) - sleep(1); - } while (remote == NULL && retry-- > 0); + retry = max_retry; + + u = fetchParseURL(url); + while (remote == NULL) { + if (retry == max_retry) { + if (strcmp(u->scheme, "file") != 0) { + snprintf(zone, sizeof(zone), + "_%s._tcp.%s", u->scheme, u->host); + printf("%s\n", zone); + mirrors = dns_getsrvinfo(zone); + current = mirrors; + } + } + + if (mirrors != NULL) + strlcpy(u->host, current->host, sizeof(u->host)); + + remote = fetchXGet(u, &st, ""); + if (remote == NULL) { + --retry; + if (retry <= 0) + goto fetchfail; + if (mirrors == NULL) { + sleep(1); + } else { + current = current->next; + if (current == NULL) + current = mirrors; + } + } + } if (remote == NULL) goto fetchfail; From a503af91a8a93bdaeb15b5467c2d98018eb719c5 Mon Sep 17 00:00:00 2001 From: Erwin Lansing Date: Wed, 5 Dec 2012 12:53:50 +0000 Subject: [PATCH 032/513] Vendor import of Bind 9.8.4 Approved by: delphij (mentor) Sponsored by: DK Hostmaster A/S --- CHANGES | 107 +- Makefile.in | 2 +- README | 5 + acconfig.h | 5 +- bin/Makefile.in | 2 +- bin/check/Makefile.in | 2 +- bin/check/check-tool.c | 5 +- bin/confgen/Makefile.in | 2 +- bin/confgen/unix/Makefile.in | 2 +- bin/dig/Makefile.in | 2 +- bin/dig/nslookup.c | 11 +- bin/dnssec/Makefile.in | 2 +- bin/dnssec/dnssec-dsfromkey.8 | 6 +- bin/dnssec/dnssec-dsfromkey.c | 7 +- bin/dnssec/dnssec-dsfromkey.docbook | 6 +- bin/dnssec/dnssec-dsfromkey.html | 19 +- bin/dnssec/dnssec-keyfromlabel.8 | 6 +- bin/dnssec/dnssec-keyfromlabel.c | 8 +- bin/dnssec/dnssec-keyfromlabel.docbook | 6 +- bin/dnssec/dnssec-keyfromlabel.html | 17 +- bin/dnssec/dnssec-keygen.8 | 10 +- bin/dnssec/dnssec-keygen.c | 23 +- bin/dnssec/dnssec-keygen.docbook | 12 +- bin/dnssec/dnssec-keygen.html | 25 +- bin/dnssec/dnssec-settime.c | 7 +- bin/dnssec/dnssec-signzone.c | 5 +- bin/named/Makefile.in | 2 +- bin/named/builtin.c | 6 +- bin/named/config.c | 4 +- bin/named/controlconf.c | 6 +- bin/named/convertxsl.pl | 2 +- bin/named/query.c | 176 +- bin/named/server.c | 108 +- bin/named/statschannel.c | 37 +- bin/named/unix/Makefile.in | 2 +- bin/nsupdate/Makefile.in | 2 +- bin/nsupdate/nsupdate.c | 53 +- bin/rndc/Makefile.in | 2 +- bin/tools/Makefile.in | 2 +- config.h.in | 10 +- configure.in | 43 +- doc/Makefile.in | 2 +- doc/arm/Bv9ARM-book.xml | 179 +- doc/arm/Bv9ARM.ch04.html | 96 +- doc/arm/Bv9ARM.ch06.html | 260 +- doc/arm/Bv9ARM.ch07.html | 12 +- doc/arm/Bv9ARM.ch08.html | 16 +- doc/arm/Bv9ARM.ch09.html | 218 +- doc/arm/Bv9ARM.html | 96 +- doc/arm/Bv9ARM.pdf | 6522 +++++++++-------- doc/arm/Makefile.in | 2 +- doc/arm/man.arpaname.html | 6 +- doc/arm/man.ddns-confgen.html | 8 +- doc/arm/man.dig.html | 18 +- doc/arm/man.dnssec-dsfromkey.html | 17 +- doc/arm/man.dnssec-keyfromlabel.html | 15 +- doc/arm/man.dnssec-keygen.html | 23 +- doc/arm/man.dnssec-revoke.html | 8 +- doc/arm/man.dnssec-settime.html | 12 +- doc/arm/man.dnssec-signzone.html | 10 +- doc/arm/man.genrandom.html | 8 +- doc/arm/man.host.html | 8 +- doc/arm/man.isc-hmac-fixup.html | 8 +- doc/arm/man.named-checkconf.html | 10 +- doc/arm/man.named-checkzone.html | 10 +- doc/arm/man.named-journalprint.html | 6 +- doc/arm/man.named.html | 14 +- doc/arm/man.nsec3hash.html | 8 +- doc/arm/man.nsupdate.html | 12 +- doc/arm/man.rndc-confgen.html | 10 +- doc/arm/man.rndc.conf.html | 10 +- doc/arm/man.rndc.html | 10 +- doc/misc/Makefile.in | 2 +- doc/misc/format-options.pl | 2 +- doc/misc/options | 18 +- doc/misc/sort-options.pl | 2 +- isc-config.sh.in | 2 +- lib/Makefile.in | 2 +- lib/bind9/Makefile.in | 2 +- lib/bind9/api | 2 +- lib/bind9/check.c | 69 +- lib/bind9/include/Makefile.in | 2 +- lib/bind9/include/bind9/Makefile.in | 2 +- lib/dns/Makefile.in | 5 +- lib/dns/adb.c | 44 +- lib/dns/api | 4 +- lib/dns/db.c | 9 +- lib/dns/dnssec.c | 115 +- lib/dns/ds.c | 35 +- lib/dns/dst_api.c | 16 +- lib/dns/dst_internal.h | 3 + lib/dns/dst_openssl.h | 3 + lib/dns/dst_parse.c | 61 +- lib/dns/dst_parse.h | 5 +- lib/dns/dst_result.c | 4 +- lib/dns/include/Makefile.in | 2 +- lib/dns/include/dns/db.h | 8 +- lib/dns/include/dns/dnssec.h | 13 +- lib/dns/include/dns/ds.h | 7 +- lib/dns/include/dns/iptable.h | 4 +- lib/dns/include/dns/keyvalues.h | 10 +- lib/dns/include/dns/log.h | 1 + lib/dns/include/dns/rdataset.h | 20 + lib/dns/include/dns/rpz.h | 13 +- lib/dns/include/dns/stats.h | 10 + lib/dns/include/dns/view.h | 2 + lib/dns/include/dns/zone.h | 2 +- lib/dns/include/dst/Makefile.in | 2 +- lib/dns/include/dst/dst.h | 2 + lib/dns/include/dst/result.h | 6 +- lib/dns/log.c | 1 + lib/dns/master.c | 47 +- lib/dns/masterdump.c | 12 +- lib/dns/openssl_link.c | 40 +- lib/dns/openssldh_link.c | 18 +- lib/dns/openssldsa_link.c | 34 +- lib/dns/opensslecdsa_link.c | 596 ++ lib/dns/opensslgost_link.c | 75 +- lib/dns/opensslrsa_link.c | 52 +- lib/dns/rbtdb.c | 39 +- lib/dns/rcode.c | 2 + lib/dns/rdata.c | 12 +- lib/dns/rdata/generic/dlv_32769.c | 12 +- lib/dns/rdata/generic/ds_43.c | 12 +- lib/dns/rdataset.c | 28 + lib/dns/resolver.c | 50 +- lib/dns/rpz.c | 129 +- lib/dns/spnego_asn1.pl | 2 +- lib/dns/validator.c | 10 +- lib/dns/view.c | 2 + lib/dns/zone.c | 101 +- lib/export/Makefile.in | 2 +- lib/export/dns/Makefile.in | 4 +- lib/export/dns/include/Makefile.in | 2 +- lib/export/dns/include/dns/Makefile.in | 2 +- lib/export/dns/include/dst/Makefile.in | 2 +- lib/export/irs/include/irs/Makefile.in | 2 +- lib/export/isc/Makefile.in | 2 +- lib/export/isc/include/isc/Makefile.in | 2 +- lib/export/isc/nls/Makefile.in | 2 +- lib/export/isc/nothreads/Makefile.in | 2 +- .../isc/nothreads/include/isc/Makefile.in | 2 +- lib/export/isc/pthreads/Makefile.in | 2 +- .../isc/pthreads/include/isc/Makefile.in | 2 +- lib/export/isc/unix/Makefile.in | 2 +- lib/export/isc/unix/include/isc/Makefile.in | 2 +- lib/export/isccfg/include/isccfg/Makefile.in | 2 +- lib/export/samples/Makefile-postinstall.in | 2 +- lib/export/samples/Makefile.in | 2 +- lib/irs/Makefile.in | 2 +- lib/irs/include/Makefile.in | 2 +- lib/irs/include/irs/Makefile.in | 2 +- lib/isc/alpha/Makefile.in | 2 +- lib/isc/alpha/include/Makefile.in | 2 +- lib/isc/alpha/include/isc/Makefile.in | 2 +- lib/isc/api | 6 +- lib/isc/ia64/Makefile.in | 2 +- lib/isc/ia64/include/Makefile.in | 2 +- lib/isc/ia64/include/isc/Makefile.in | 2 +- lib/isc/ia64/include/isc/atomic.h | 6 +- lib/isc/include/Makefile.in | 2 +- lib/isc/include/isc/file.h | 13 +- lib/isc/include/isc/namespace.h | 2 + lib/isc/include/isc/task.h | 27 + lib/isc/mem.c | 10 +- lib/isc/mips/Makefile.in | 2 +- lib/isc/mips/include/Makefile.in | 2 +- lib/isc/mips/include/isc/Makefile.in | 2 +- lib/isc/nls/Makefile.in | 2 +- lib/isc/noatomic/Makefile.in | 2 +- lib/isc/noatomic/include/Makefile.in | 2 +- lib/isc/noatomic/include/isc/Makefile.in | 2 +- lib/isc/nothreads/Makefile.in | 2 +- lib/isc/nothreads/include/Makefile.in | 2 +- lib/isc/nothreads/include/isc/Makefile.in | 2 +- lib/isc/powerpc/Makefile.in | 2 +- lib/isc/powerpc/include/Makefile.in | 2 +- lib/isc/powerpc/include/isc/Makefile.in | 2 +- lib/isc/pthreads/Makefile.in | 2 +- lib/isc/pthreads/condition.c | 11 +- lib/isc/pthreads/include/Makefile.in | 2 +- lib/isc/pthreads/include/isc/Makefile.in | 2 +- lib/isc/sparc64/Makefile.in | 2 +- lib/isc/sparc64/include/Makefile.in | 2 +- lib/isc/sparc64/include/isc/Makefile.in | 2 +- lib/isc/task.c | 45 +- lib/isc/task_api.c | 11 + lib/isc/unix/Makefile.in | 2 +- lib/isc/unix/file.c | 31 + lib/isc/unix/include/Makefile.in | 2 +- lib/isc/unix/include/isc/Makefile.in | 2 +- lib/isc/x86_32/Makefile.in | 2 +- lib/isc/x86_32/include/Makefile.in | 2 +- lib/isc/x86_32/include/isc/Makefile.in | 2 +- lib/isc/x86_64/Makefile.in | 2 +- lib/isc/x86_64/include/Makefile.in | 2 +- lib/isc/x86_64/include/isc/Makefile.in | 2 +- lib/isccc/api | 2 +- lib/isccc/cc.c | 6 +- lib/isccc/include/Makefile.in | 2 +- lib/isccc/include/isccc/Makefile.in | 2 +- lib/isccfg/api | 2 +- lib/isccfg/include/Makefile.in | 2 +- lib/isccfg/include/isccfg/Makefile.in | 2 +- lib/isccfg/namedconf.c | 240 +- lib/lwres/Makefile.in | 2 +- lib/lwres/api | 2 +- lib/lwres/getaddrinfo.c | 8 +- lib/lwres/include/Makefile.in | 2 +- lib/lwres/include/lwres/Makefile.in | 2 +- lib/lwres/man/Makefile.in | 2 +- make/rules.in | 2 +- version | 6 +- 213 files changed, 6263 insertions(+), 4475 deletions(-) create mode 100644 lib/dns/opensslecdsa_link.c diff --git a/CHANGES b/CHANGES index d9b6714eff29..801f9918e5fe 100644 --- a/CHANGES +++ b/CHANGES @@ -1,15 +1,76 @@ - --- 9.8.3-P4 released --- + --- 9.8.4 released --- 3383. [security] A certain combination of records in the RBT could cause named to hang while populating the additional section of a response. [RT #31090] - --- 9.8.3-P3 released --- +3373. [bug] win32: open raw files in binary mode. [RT #30944] 3364. [security] Named could die on specially crafted record. [RT #30416] - --- 9.8.3-P2 released --- + --- 9.8.4rc1 released --- + +3369. [bug] nsupdate terminated unexpectedly in interactive mode + if built with readline support. [RT #29550] + +3368. [bug] and were not C++ safe. + +3367. [bug] dns_dnsseckey_create() result was not being checked. + [RT #30685] + +3366. [bug] Fixed Read-After-Write dependency violation for IA64 + atomic operations. [RT #25181] + +3365. [bug] Removed spurious newlines from log messages in + zone.c [RT #30675] + +3363. [bug] Need to allow "forward" and "fowarders" options + in static-stub zones; this had been overlooked. + [RT #30482] + +3362. [bug] Setting some option values to 0 in named.conf + could trigger an assertion failure on startup. + [RT #27730] + +3360. [bug] 'host -w' could die. [RT #18723] + +3359. [bug] An improperly-formed TSIG secret could cause a + memory leak. [RT #30607] + +3357. [port] Add support for libxml2-2.8.x [RT #30440] + +3356. [bug] Cap the TTL of signed RRsets when RRSIGs are + approaching their expiry, so they don't remain + in caches after expiry. [RT #26429] + + --- 9.8.4b1 released --- + +3354. [func] Improve OpenSSL error logging. [RT #29932] + +3353. [bug] Use a single task for task exclusive operations. + [RT #29872] + +3352. [bug] Ensure that learned server attributes timeout of the + adb cache. [RT #29856] + +3351. [bug] isc_mem_put and isc_mem_putanddetach didn't report + caller if either ISC_MEM_DEBUGSIZE or ISC_MEM_DEBUGCTX + memory debugging flags are set. [RT #30243] + +3350. [bug] Memory read overrun in isc___mem_reallocate if + ISC_MEM_DEBUGCTX memory debugging flag is set. + [RT #30240] + +3348. [bug] Prevent RRSIG data from being cached if a negative + record matching the covering type exists at a higher + trust level. Such data already can't be retrieved from + the cache since change 3218 -- this prevents it + being inserted into the cache as well. [RT #26809] + +3347. [bug] dnssec-settime: Issue a warning when writing a new + private key file would cause a change in the + permissions of the existing file. [RT #27724] 3346. [security] Bad-cache data could be used before it was initialized, causing an assert. [RT #30025] @@ -18,11 +79,47 @@ resulting in excessive cpu usage in some cases. [RT #29952] - --- 9.8.3-P1 released --- +3337. [bug] Change #3294 broke support for the multiple keys + in controls. [RT #29694] + +3335. [func] nslookup: return a nonzero exit code when unable + to get an answer. [RT #29492] + +3333. [bug] Setting resolver-query-timeout too low can cause + named to not recover if it loses connectivity. + [RT #29623] + +3332. [bug] Re-use cached DS rrsets if possible. [RT #29446] 3331. [security] dns_rdataslab_fromrdataset could produce bad rdataslabs. [RT #29644] - + +3330. [func] Fix missing signatures on NOERROR results despite + RPZ rewriting. Also + - add optional "recursive-only yes|no" to the + response-policy statement + - add optional "max-policy-ttl" to the response-policy + statement to limit the false data that + "recursive-only no" can introduce into + resolvers' caches + - add a RPZ performance test to bin/tests/system/rpz + when queryperf is available. + - the encoding of PASSTHRU action to "rpz-passthru". + (The old encoding is still accepted.) + [RT #26172] + + +3329. [bug] Handle RRSIG signer-name case consistently: We + generate RRSIG records with the signer-name in + lower case. We accept them with any case, but if + they fail to validate, we try again in lower case. + [RT #27451] + +3328. [bug] Fixed inconsistent data checking in dst_parse.c. + [RT #29401] + +3317. [func] Add ECDSA support (RFC 6605). [RT #21918] + --- 9.8.3 released --- 3318. [tuning] Reduce the amount of work performed while holding a diff --git a/Makefile.in b/Makefile.in index 2a00df415f38..05d9c43174f0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2009, 2011 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2009, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2002 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any diff --git a/README b/README index ee56344c5e02..f79763978754 100644 --- a/README +++ b/README @@ -51,6 +51,11 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.8.4 + + BIND 9.8.4 includes several bug fixes and patches security + flaws described in CVE-2012-1667, CVE-2012-3817 and CVE-2012-4244. + BIND 9.8.3 BIND 9.8.3 is a maintenance release. diff --git a/acconfig.h b/acconfig.h index 736d1bcdd31d..3d412d93c878 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -138,6 +138,9 @@ int sigwait(const unsigned int *set, int *sig); /* Define if OpenSSL includes DSA support */ #undef HAVE_OPENSSL_DSA +/* Define if OpenSSL includes ECDSA support */ +#undef HAVE_OPENSSL_ECDSA + /* Define to the length type used by the socket API (socklen_t, size_t, int). */ #undef ISC_SOCKADDR_LEN_T diff --git a/bin/Makefile.in b/bin/Makefile.in index e4805520e7e6..89b4673edd35 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 1998-2001 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in index 403933b2ed7d..c191605605b1 100644 --- a/bin/check/Makefile.in +++ b/bin/check/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004-2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000-2003 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any diff --git a/bin/check/check-tool.c b/bin/check/check-tool.c index 422d9b1cde98..2bf16a686c55 100644 --- a/bin/check/check-tool.c +++ b/bin/check/check-tool.c @@ -639,6 +639,9 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename, { isc_result_t result; FILE *output = stdout; + const char *flags; + + flags = (fileformat == dns_masterformat_text) ? "w+" : "wb+"; if (debug) { if (filename != NULL && strcmp(filename, "-") != 0) @@ -649,7 +652,7 @@ dump_zone(const char *zonename, dns_zone_t *zone, const char *filename, } if (filename != NULL && strcmp(filename, "-") != 0) { - result = isc_stdio_open(filename, "w+", &output); + result = isc_stdio_open(filename, flags, &output); if (result != ISC_R_SUCCESS) { fprintf(stderr, "could not open output " diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in index 64ddf760a067..8b3e5aa1c4de 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above diff --git a/bin/confgen/unix/Makefile.in b/bin/confgen/unix/Makefile.in index 924701e61ff2..2ab6d922d555 100644 --- a/bin/confgen/unix/Makefile.in +++ b/bin/confgen/unix/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2009, 2012 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in index 19dc61c4353f..2a3bc5d6fe8b 100644 --- a/bin/dig/Makefile.in +++ b/bin/dig/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004, 2005, 2007, 2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2005, 2007, 2009, 2012 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000-2002 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 48c390b8ae0e..2ef8f84ea2a7 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -57,6 +57,7 @@ static isc_boolean_t in_use = ISC_FALSE; static char defclass[MXRD] = "IN"; static char deftype[MXRD] = "A"; static isc_event_t *global_event = NULL; +static int query_error = 1, print_error = 0; static char domainopt[DNS_NAME_MAXTEXT]; @@ -406,6 +407,9 @@ isc_result_t printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { char servtext[ISC_SOCKADDR_FORMATSIZE]; + /* I've we've gotten this far, we've reached a server. */ + query_error = 0; + debug("printmessage()"); isc_sockaddr_format(&query->sockaddr, servtext, sizeof(servtext)); @@ -433,6 +437,9 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { (msg->rcode != dns_rcode_nxdomain) ? nametext : query->lookup->textname, rcode_totext(msg->rcode)); debug("returning with rcode == 0"); + + /* the lookup failed */ + print_error |= 1; return (ISC_R_SUCCESS); } @@ -887,5 +894,5 @@ main(int argc, char **argv) { destroy_libs(); isc_app_finish(); - return (0); + return (query_error | print_error); } diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in index 6bfd162d8d35..0bca14155724 100644 --- a/bin/dnssec/Makefile.in +++ b/bin/dnssec/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2004, 2005, 2007-2009, 2012 Internet Systems Consortium, Inc. ("ISC") # Copyright (C) 2000-2002 Internet Software Consortium. # # Permission to use, copy, modify, and/or distribute this software for any diff --git a/bin/dnssec/dnssec-dsfromkey.8 b/bin/dnssec/dnssec-dsfromkey.8 index 437aa371cff4..ae9bb54000c6 100644 --- a/bin/dnssec/dnssec-dsfromkey.8 +++ b/bin/dnssec/dnssec-dsfromkey.8 @@ -1,4 +1,4 @@ -.\" Copyright (C) 2008-2010 Internet Systems Consortium, Inc. ("ISC") +.\" Copyright (C) 2008-2010, 2012 Internet Systems Consortium, Inc. ("ISC") .\" .\" Permission to use, copy, modify, and/or distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above @@ -55,7 +55,7 @@ Use SHA\-256 as the digest algorithm. .RS 4 Select the digest algorithm. The value of \fBalgorithm\fR -must be one of SHA\-1 (SHA1), SHA\-256 (SHA256) or GOST. These values are case insensitive. +must be one of SHA\-1 (SHA1), SHA\-256 (SHA256), GOST or SHA\-384 (SHA384). These values are case insensitive. .RE .PP \-K \fIdirectory\fR @@ -139,5 +139,5 @@ RFC 4509. .PP Internet Systems Consortium .SH "COPYRIGHT" -Copyright \(co 2008\-2010 Internet Systems Consortium, Inc. ("ISC") +Copyright \(co 2008\-2010, 2012 Internet Systems Consortium, Inc. ("ISC") .br diff --git a/bin/dnssec/dnssec-dsfromkey.c b/bin/dnssec/dnssec-dsfromkey.c index c4b157cd9b1a..93d789b06264 100644 --- a/bin/dnssec/dnssec-dsfromkey.c +++ b/bin/dnssec/dnssec-dsfromkey.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2008-2012 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -296,7 +296,7 @@ usage(void) { fprintf(stderr, " -K : directory in which to find " "key file or keyset file\n"); fprintf(stderr, " -a algorithm: digest algorithm " - "(SHA-1, SHA-256 or GOST)\n"); + "(SHA-1, SHA-256, GOST or SHA-384)\n"); fprintf(stderr, " -1: use SHA-1\n"); fprintf(stderr, " -2: use SHA-256\n"); fprintf(stderr, " -l: add lookaside zone and print DLV records\n"); @@ -415,6 +415,9 @@ main(int argc, char **argv) { else if (strcasecmp(algname, "GOST") == 0) dtype = DNS_DSDIGEST_GOST; #endif + else if (strcasecmp(algname, "SHA384") == 0 || + strcasecmp(algname, "SHA-384") == 0) + dtype = DNS_DSDIGEST_SHA384; else fatal("unknown algorithm %s", algname); } diff --git a/bin/dnssec/dnssec-dsfromkey.docbook b/bin/dnssec/dnssec-dsfromkey.docbook index d139ba5ec7c8..d7050335107a 100644 --- a/bin/dnssec/dnssec-dsfromkey.docbook +++ b/bin/dnssec/dnssec-dsfromkey.docbook @@ -2,7 +2,7 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>

Introduction @@ -46,7 +40,7 @@ Release Notes.

This document contains the release notes for the LLVM Compiler Infrastructure, release 3.2. Here we describe the status of LLVM, including major improvements from the previous release, improvements in various - subprojects of LLVM, and some of the current users of the code. All LLVM + sub-projects of LLVM, and some of the current users of the code. All LLVM releases may be downloaded from the LLVM releases web site.

@@ -72,11 +66,12 @@ Release Notes.
-

The LLVM 3.2 distribution currently consists of code from the core LLVM - repository, which roughly includes the LLVM optimizers, code generators and - supporting tools, and the Clang repository. In addition to this code, the - LLVM Project includes other sub-projects that are in development. Here we - include updates on these subprojects.

+

The LLVM 3.2 distribution currently consists of production-quality code + from the core LLVM repository, which roughly includes the LLVM optimizers, + code generators and supporting tools, as well as Clang, DragonEgg and + compiler-rt sub-project repositories. In addition to this code, the LLVM + Project includes other sub-projects that are in development. Here we + include updates on these sub-projects.

@@ -90,18 +85,18 @@ Release Notes.

experience through expressive diagnostics, a high level of conformance to language standards, fast compilation, and low memory use. Like LLVM, Clang provides a modular, library-based architecture that makes it suitable for - creating or integrating with other development tools. Clang is considered a - production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86 - (32- and 64-bit), and for Darwin/ARM targets.

+ creating or integrating with other development tools.

In the LLVM 3.2 time-frame, the Clang team has made many improvements. Highlights include:

    -
  • ...
  • +
  • Improvements to Clang's diagnostics
  • +
  • Support for tls_model attribute
  • +
  • Type safety attributes

For more details about the changes to Clang since the 3.1 release, see the - Clang release + Clang 3.2 release notes.

If Clang rejects your code but another compiler accepts it, please take a @@ -129,7 +124,10 @@ Release Notes.

The 3.2 release has the following notable changes:

    -
  • ...
  • +
  • Able to load LLVM plugins such as Polly.
  • +
  • Supports thread-local storage models.
  • +
  • Passes knowledge of variable lifetimes to the LLVM optimizers.
  • +
  • No longer requires GCC to be built with LTO support.
@@ -141,7 +139,8 @@ Release Notes.
-

The new LLVM compiler-rt project + +

The LLVM compiler-rt project is a simple library that provides an implementation of the low-level target-specific hooks required by code generation and other runtime components. For example, when compiling for a 32-bit target, converting a @@ -153,7 +152,11 @@ Release Notes.

The 3.2 release has the following notable changes:

    -
  • ...
  • +
  • ThreadSanitizer (TSan) - data race detector run-time library for C/C++ has been added.
  • +
  • Improvements to AddressSanitizer including: better portability + (OSX, Android NDK), support for cmake based builds, enhanced error reporting and lots of bug fixes.
  • +
  • Added support for A6 'Swift' CPU.
  • +
  • divsi3 function has been enhanced to take advantage of a hardware unsigned divide when it is available.
@@ -174,7 +177,9 @@ Release Notes.

The 3.2 release has the following notable changes:

    -
  • ...
  • +
  • Linux build fixes for clang (see Building LLDB)
  • +
  • Some Linux stability and usability improvements
  • +
  • Switch expression evaluation to use MCJIT (from legacy JIT) on Linux
@@ -193,7 +198,15 @@ Release Notes.

Within the LLVM 3.2 time-frame there were the following highlights:

    -
  • ...
  • +
  • C++11 shared_ptr atomic access API (20.7.2.5) has been implemented.
  • +
  • Applied noexcept and constexpr throughout library.
  • +
  • Improved C++11 conformance in associative container emplace.
  • +
  • Performance improvements in: std::rotate algorithm and I/O.
  • +
  • Operator new/delete and type_infos for exception types moved from libc++ to libc++abi.
  • +
  • Bug fixes in: <atomic>; vector<bool> algorithms, + <future>,<tuple>, + <type_traits>,<fstream>,<istream>, + <iterator>, <condition_variable>,<complex> as well as visibility fixes.
@@ -212,7 +225,7 @@ Release Notes.

The 3.2 release has the following notable changes:

    -
  • ...
  • +
  • Bug fixes only, no functional changes.
@@ -227,18 +240,63 @@ Release Notes.

Polly is an experimental optimizer for data locality and parallelism. It currently provides high-level - loop optimizations and automatic parallelisation (using the OpenMP run time). + loop optimizations and automatic parallelization (using the OpenMP run time). Work in the area of automatic SIMD and accelerator code generation was started.

Within the LLVM 3.2 time-frame there were the following highlights:

    -
  • ...
  • +
  • isl, the integer set library used by Polly, was relicensed under the MIT license.
  • +
  • isl based code generation.
  • +
  • MIT licensed replacement for CLooG (LGPLv2).
  • +
  • Fine grained option handling (separation of core and border computations, control overhead vs. code size).
  • +
  • Support for FORTRAN and Dragonegg.
  • +
  • OpenMP code generation fixes.
+ +

+Clang Static Analyzer +

+ +
+ +

The Clang Static Analyzer + is an advanced source code analysis tool integrated into Clang that performs + a deep analysis of code to find potential bugs.

+ +

In the LLVM 3.2 release, the static analyzer has made significant improvements + in many areas, with notable highlights such as:

+ +
    +
  • Improved interprocedural analysis within a translation unit (see details below), which greatly amplified the analyzer's ability to find bugs.
  • +
  • New infrastructure to model "well-known" APIs, allowing the analyzer to do a much better job when modeling calls to such functions.
  • +
  • Significant improvements to the APIs to write static analyzer checkers, with a more unified way of representing function/method calls in the checker API. Details can be found in the Building a Checker in 24 hours talk. +
+ +

The release specifically includes notable improvements for Objective-C analysis, including:

+ +
    +
  • Interprocedural analysis for Objective-C methods.
  • +
  • Interprocedural analysis of calls to "blocks".
  • +
  • Precise modeling of GCD APIs such as dispatch_once and friends.
  • +
  • Improved support for recently added Objective-C constructs such as array and dictionary literals.
  • +
+ +

The release specifically includes notable improvements for C++ analysis, including:

+ +
    +
  • Interprocedural analysis for C++ methods (within a translation unit).
  • +
  • More precise modeling of C++ initializers and destructors.
  • +
+ +

Finally, this release includes many small improvements to scan-build, which can be used to drive the analyzer from the command line or a continuous integration system. This includes a directory-traversal issue, which could cause potential security problems in some cases. We would like to acknowledge Tim Brown of Portcullis Computer Security Ltd for reporting this issue.

+ +
+ @@ -265,6 +323,19 @@ Release Notes. +

EmbToolkit

+ +
+ +

EmbToolkit provides Linux cross-compiler + toolchain/SDK (GCC/binutils/C library (uclibc,eglibc,musl)), a build system for + package cross-compilation and optionally various root file systems. + It supports ARM and MIPS. There is an ongoing effort to provide a clang+llvm + environment for the 3.2 releases, +

+ +
+

FAUST

@@ -274,7 +345,7 @@ Release Notes. AUdio STream. Its programming model combines two approaches: functional programming and block diagram composition. In addition with the C, C++, Java, JavaScript output formats, the Faust compiler can generate LLVM bitcode, and - works with LLVM 2.7-3.1.

+ works with LLVM 2.7-3.2.

@@ -331,7 +402,11 @@ Release Notes.

OSL was developed by Sony Pictures Imageworks for use in its in-house renderer used for feature film animation and visual effects, and is - distributed as open source software with the "New BSD" license.

+ distributed as open source software with the "New BSD" license. + It has been used for all the shading on such films as The Amazing Spider-Man, + Men in Black III, Hotel Transylvania, and may other films in-progress, + and also has been incorporated into several commercial and open source + rendering products such as Blender, VRay, and Autodesk Beast.

@@ -367,7 +442,7 @@ Release Notes. C++, Fortran and Faust code in Pure programs if the corresponding LLVM-enabled compilers are installed).

-

Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and +

Pure version 0.56 has been tested and is known to work with LLVM 3.2 (and continues to work with older LLVM releases >= 2.5).

@@ -432,7 +507,9 @@ Release Notes.

LLVM 3.2 includes several major changes and big features:

    -
  • ...
  • +
  • Loop Vectorizer.
  • +
  • New implementation of SROA.
  • +
  • New NVPTX back-end (replacing existing PTX back-end) based on NVIDIA sources.
@@ -451,7 +528,10 @@ Release Notes.
  • Thread local variables may have a specified TLS model. See the Language Reference Manual.
  • -
  • ...
  • +
  • 'TYPE_CODE_FUNCTION_OLD' type code and autoupgrade code for old function attributes format has been removed.
  • +
  • Internal representation of the Attributes class has been converted into a pointer to an + opaque object that's uniqued by and stored in the LLVMContext object. + The Attributes class then becomes a thin wrapper around this opaque object.
@@ -489,23 +569,33 @@ Release Notes.
  • The inner most loops must have a single basic block.
  • The number of iterations are known before the loop starts to execute.
  • -
  • The loop counter needs to be incrimented by one.
  • +
  • The loop counter needs to be incremented by one.
  • The loop trip count can be a variable.
  • Loops do not need to start at zero.
  • The induction variable can be used inside the loop.
  • Loop reductions are supported.
  • Arrays with affine access pattern do not need to be marked as 'noalias' and are checked at runtime.
  • -
  • ...

-

SROA - We've re-written SROA to be significantly more powerful. -

+

SROA - We’ve re-written SROA to be significantly more powerful and generate +code which is much more friendly to the rest of the optimization pipeline. +Previously this pass had scaling problems that required it to only operate on +relatively small aggregates, and at times it would mistakenly replace a large +aggregate with a single very large integer in order to make it a scalar SSA +value. The result was a large number of i1024 and i2048 values representing any +small stack buffer. These in turn slowed down many subsequent optimization +paths.

+

The new SROA pass uses a different algorithm that allows it to only promote to +scalars the pieces of the aggregate actively in use. Because of this it doesn’t +require any thresholds. It also always deduces the scalar values from the uses +of the aggregate rather than the specific LLVM type of the aggregate. These +features combine to both optimize more code with the pass but to improve the +compile time of many functions dramatically.

    -
  • Branch weight metadata is preseved through more of the optimizer.
  • -
  • ...
  • +
  • Branch weight metadata is preserved through more of the optimizer.
@@ -524,8 +614,19 @@ Release Notes. Intro to the LLVM MC Project Blog Post.

-
    -
  • ...
  • +
      +
    • Added support for following assembler directives: .ifb, .ifnb, .ifc, + .ifnc, .purgem, .rept and .version (ELF) as well as Darwin specific + .pushsection, .popsection and .previous .
    • +
    • Enhanced handling of .lcomm directive.
    • +
    • MS style inline assembler: added implementation of the offset and TYPE operators.
    • +
    • Targets can specify minimum supported NOP size for NOP padding.
    • +
    • ELF improvements: added support for generating ELF objects on Windows.
    • +
    • MachO improvements: symbol-difference variables are marked as N_ABS, added direct-to-object attribute for data-in-code markers.
    • +
    • Added support for annotated disassembly output for x86 and arm targets.
    • +
    • Arm support has been improved by adding support for ARM TARGET2 relocation + and fixing hadling of ARM-style "$d.*" labels.
    • +
    • Implemented local-exec TLS on PowerPC.
    @@ -550,10 +651,6 @@ Release Notes. infrastructure, which allows us to implement more aggressive algorithms and make it run faster:

    -
      -
    • ...
    • -
    -

    We added new TableGen infrastructure to support bundling for Very Long Instruction Word (VLIW) architectures. TableGen can now automatically generate a deterministic finite automaton from a VLIW @@ -563,6 +660,13 @@ Release Notes.

    We have added a new target independent VLIW packetizer based on the DFA infrastructure to group machine instructions into bundles.

    +

    We have added new TableGen infrastructure to support relationship maps + between instructions. This feature enables TableGen to automatically + construct a set of relation tables and query functions that can be used + to switch between various forms of instructions. For more information, + please refer to + How To Use Instruction Mappings.

    +

    @@ -588,7 +692,7 @@ Release Notes.

    New features and major changes in the X86 target include:

      -
    • ...
    • +
    • Small codegen optimizations, especially for AVX2.
    @@ -603,7 +707,7 @@ Release Notes.

    New features of the ARM target include:

      -
    • ...
    • +
    • Support and performance tuning for the A6 'Swift' CPU.
    @@ -620,7 +724,7 @@ Release Notes. platform specific support for Linux.

    Full support is included for Thumb1, Thumb2 and ARM modes, along with - subtarget and CPU specific extensions for VFP2, VFP3 and NEON.

    + sub-target and CPU specific extensions for VFP2, VFP3 and NEON.

    The assembler is Unified Syntax only (see ARM Architecural Reference Manual for details). While there is some, and growing, support for pre-unfied @@ -640,7 +744,29 @@ Release Notes.

    New features and major changes in the MIPS target include:

      -
    • ...
    • +
    • Integrated assembler support: + MIPS32 works for both PIC and static, known limitation is the PR14456 where + R_MIPS_GPREL16 relocation is generated with the wrong addend. + MIPS64 support is incomplete, for example exception handling is not working.
    • +
    • Support for fast calling convention has been added.
    • +
    • Support for Android MIPS toolchain has been added to clang driver.
    • +
    • Added clang driver support for MIPS N32 ABI through "-mabi=n32" option.
    • +
    • MIPS32 and MIPS64 disassembler has been implemented.
    • +
    • Support for compiling programs with large GOTs (exceeding 64kB in size) has been added + through llc option "-mxgot".
    • +
    • Added experimental support for MIPS32 DSP intrinsics.
    • +
    • Experimental support for MIPS16 with following limitations: only soft float is supported, + C++ exceptions are not supported, large stack frames (> 32000 bytes) are not supported, + direct object code emission is not supported only .s .
    • +
    • Standalone assembler (llvm-mc): implementation is in progress and considered experimental.
    • +
    • All classic JIT and MCJIT tests pass on Little and Big Endian MIPS32 platforms.
    • +
    • Inline asm support: all common constraints and operand modifiers have been implemented.
    • +
    • Added tail call optimization support, use llc option "-enable-mips-tail-calls" + or clang options "-mllvm -enable-mips-tail-calls"to enable it.
    • +
    • Improved register allocation by removing registers $fp, $gp, $ra and $at from the list of reserved registers.
    • +
    • Long branch expansion pass has been implemented, which expands branch + instructions with offsets that do not fit in the 16-bit field.
    • +
    • Cavium Octeon II board is used for testing builds (llvm-mips-linux builder).
    @@ -652,7 +778,6 @@ Release Notes.
    -

      Many fixes and changes across LLVM (and Clang) for better compliance with the 64-bit PowerPC ELF Application Binary Interface, interoperability with GCC, and overall 64-bit PowerPC support. Some highlights include:

      @@ -681,8 +806,28 @@ Release Notes.

      There have also been code generation improvements for both 32- and 64-bit code. Instruction scheduling support for the Freescale e500mc and e5500 cores has been added.

      + +
    + + +

    +PTX/NVPTX Target Improvements +

    + +
    + +

    The PTX back-end has been replaced by the NVPTX back-end, which is based on + the LLVM back-end used by NVIDIA in their CUDA (nvcc) and OpenCL compiler. + Some highlights include:

    +
      +
    • Compatibility with PTX 3.1 and SM 3.5
    • +
    • Support for NVVM intrinsics as defined in the NVIDIA Compiler SDK
    • +
    • Full compatibility with old PTX back-end, with much greater coverage of + LLVM IR
    +

    Please submit any back-end bugs to the LLVM Bugzilla site.

    +
    @@ -693,7 +838,7 @@ Release Notes.
      -
    • ...
    • +
    • Added support for custom names for library functions in TargetLibraryInfo.
    @@ -710,9 +855,11 @@ Release Notes. from the previous release.

      -
    • ...
    • -
    - +
  • llvm-ld and llvm-stub have been removed, llvm-ld functionality can be partially replaced by + llvm-link | opt | {llc | as, llc -filetype=obj} | ld, or fully replaced by Clang.
  • +
  • MCJIT: added support for inline assembly (requires asm parser), added faux remote target execution to lli option '-remote-mcjit'.
  • +
+ @@ -733,10 +880,6 @@ Release Notes.

The TargetData structure has been renamed to DataLayout and moved to VMCore to remove a dependency on Target.

-
    -
  • ...
  • -
- @@ -746,34 +889,23 @@ to remove a dependency on Target.

-

In addition, some tools have changed in this release. Some of the changes - are:

+

In addition, some tools have changed in this release. Some of the changes are:

    -
  • ...
  • +
  • opt: added support for '-mtriple' option.
  • +
  • llvm-mc : - added '-disassemble' support for '-show-inst' and '-show-encoding' options, added '-edis' option to produce annotated + disassembly output for X86 and ARM targets.
  • +
  • libprofile: allows the profile data file name to be specified by the LLVMPROF_OUTPUT environment variable.
  • +
  • llvm-objdump: has been changed to display available targets, '-arch' option accepts x86 and x86-64 as valid arch names.
  • +
  • llc and opt: added FMA formation from pairs of FADD + FMUL or FSUB + FMUL enabled by option '-enable-excess-fp-precision' or option '-enable-unsafe-fp-math', + option '-fp-contract' controls the creation by optimizations of fused FP by selecting Fast, Standard, or Strict mode.
  • +
  • llc: object file output from llc is no longer considered experimental.
  • +
  • gold plugin: handles Position Independent Executables.
- -

-Python Bindings -

- -
- -

Officially supported Python bindings have been added! Feature support is far - from complete. The current bindings support interfaces to:

- -
    -
  • ...
  • -
- -
- - -

Known Problems @@ -794,7 +926,7 @@ to remove a dependency on Target.

Known problem areas include:

    -
  • The CellSPU, MSP430, PTX and XCore backends are experimental.
  • +
  • The CellSPU, MSP430, and XCore backends are experimental, and the CellSPU backend will be removed in LLVM 3.3.
  • The integrated assembler, disassembler, and JIT is not supported by several targets. If an integrated assembler is not supported, then a @@ -836,7 +968,7 @@ to remove a dependency on Target.

    src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"> LLVM Compiler Infrastructure
    - Last modified: $Date: 2012-11-20 05:22:44 +0100 (Tue, 20 Nov 2012) $ + Last modified: $Date: 2012-12-19 11:50:28 +0100 (Wed, 19 Dec 2012) $ diff --git a/include/llvm/MC/MCExpr.h b/include/llvm/MC/MCExpr.h index 00eef270d6c4..1007aa526493 100644 --- a/include/llvm/MC/MCExpr.h +++ b/include/llvm/MC/MCExpr.h @@ -197,7 +197,11 @@ class MCSymbolRefExpr : public MCExpr { VK_Mips_GOT_PAGE, VK_Mips_GOT_OFST, VK_Mips_HIGHER, - VK_Mips_HIGHEST + VK_Mips_HIGHEST, + VK_Mips_GOT_HI16, + VK_Mips_GOT_LO16, + VK_Mips_CALL_HI16, + VK_Mips_CALL_LO16 }; private: diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp index f6dccb106d9b..a180e36e83f8 100644 --- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp +++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp @@ -346,7 +346,7 @@ uint8_t *RuntimeDyldImpl::createStubFunction(uint8_t *Addr) { uint32_t *StubAddr = (uint32_t*)Addr; *StubAddr = 0xe51ff004; // ldr pc,