svn commit: r231578 - stable/9/usr.bin/hexdump

2012-02-13 Thread Tijl Coosemans
Author: tijl
Date: Mon Feb 13 10:24:49 2012
New Revision: 231578
URL: http://svn.freebsd.org/changeset/base/231578

Log:
  MFC r229794:
  
  - Fix how hexdump parses escape strings
  From the NetBSD bug:
  The way how hexdump(1) parses escape sequences has some bugs.
  It shows up when an escape sequence is used as the non-last character
  of a format string.
  
  MFC r230649:
  
  Fix decoding of escape sequences in format strings:
  - Zero-terminate the resulting string by letting the for-loop copy the
terminating zero.
  - Exit the for-loop after handling a backslash at the end of the format
string to fix a buffer overrun.
  - Remove some unnecessary comments and blank lines.
  
  PR:   bin/144722

Modified:
  stable/9/usr.bin/hexdump/parse.c
Directory Properties:
  stable/9/usr.bin/hexdump/   (props changed)

Modified: stable/9/usr.bin/hexdump/parse.c
==
--- stable/9/usr.bin/hexdump/parse.cMon Feb 13 10:24:22 2012
(r231577)
+++ stable/9/usr.bin/hexdump/parse.cMon Feb 13 10:24:49 2012
(r231578)
@@ -255,7 +255,9 @@ rewrite(FS *fs)
sokay = NOTOKAY;
}
 
-   p2 = p1 + 1;/* Set end pointer. */
+   p2 = *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure
+* that it's non-NUL/-NULL first
+* though. */
cs[0] = *p1;/* Set conversion string. */
cs[1] = '\0';
 
@@ -449,13 +451,14 @@ escape(char *p1)
char *p2;
 
/* alphabetic escape sequences have to be done in place */
-   for (p2 = p1;; ++p1, ++p2) {
-   if (!*p1) {
-   *p2 = *p1;
-   break;
-   }
-   if (*p1 == '\\')
-   switch(*++p1) {
+   for (p2 = p1;; p1++, p2++) {
+   if (*p1 == '\\') {
+   p1++;
+   switch(*p1) {
+   case '\0':
+   *p2 = '\\';
+   *++p2 = '\0';
+   return;
case 'a':
 /* *p2 = '\a'; */
*p2 = '\007';
@@ -482,6 +485,11 @@ escape(char *p1)
*p2 = *p1;
break;
}
+   } else {
+   *p2 = *p1;
+   if (*p1 == '\0')
+   return;
+   }
}
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231579 - stable/9/libexec/rtld-elf

2012-02-13 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 13 10:40:14 2012
New Revision: 231579
URL: http://svn.freebsd.org/changeset/base/231579

Log:
  MFC r230784:
  Add support for GNU RELRO.

Modified:
  stable/9/libexec/rtld-elf/map_object.c
  stable/9/libexec/rtld-elf/rtld.c
  stable/9/libexec/rtld-elf/rtld.h
Directory Properties:
  stable/9/libexec/rtld-elf/   (props changed)

Modified: stable/9/libexec/rtld-elf/map_object.c
==
--- stable/9/libexec/rtld-elf/map_object.c  Mon Feb 13 10:24:49 2012
(r231578)
+++ stable/9/libexec/rtld-elf/map_object.c  Mon Feb 13 10:40:14 2012
(r231579)
@@ -84,6 +84,8 @@ map_object(int fd, const char *path, con
 Elf_Addr bss_vlimit;
 caddr_t bss_addr;
 Elf_Word stack_flags;
+Elf_Addr relro_page;
+size_t relro_size;
 
 hdr = get_elf_header(fd, path);
 if (hdr == NULL)
@@ -100,6 +102,8 @@ map_object(int fd, const char *path, con
 nsegs = -1;
 phdyn = phinterp = phtls = NULL;
 phdr_vaddr = 0;
+relro_page = 0;
+relro_size = 0;
 segs = alloca(sizeof(segs[0]) * hdr-e_phnum);
 stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W;
 while (phdr  phlimit) {
@@ -134,6 +138,11 @@ map_object(int fd, const char *path, con
case PT_GNU_STACK:
stack_flags = phdr-p_flags;
break;
+
+   case PT_GNU_RELRO:
+   relro_page = phdr-p_vaddr;
+   relro_size = phdr-p_memsz;
+   break;
}
 
++phdr;
@@ -269,6 +278,9 @@ map_object(int fd, const char *path, con
obj-tlsinit = mapbase + phtls-p_vaddr;
 }
 obj-stack_flags = stack_flags;
+obj-relro_page = obj-relocbase + trunc_page(relro_page);
+obj-relro_size = round_page(relro_size);
+
 return obj;
 }
 

Modified: stable/9/libexec/rtld-elf/rtld.c
==
--- stable/9/libexec/rtld-elf/rtld.cMon Feb 13 10:24:49 2012
(r231578)
+++ stable/9/libexec/rtld-elf/rtld.cMon Feb 13 10:40:14 2012
(r231579)
@@ -1114,6 +1114,11 @@ digest_phdr(const Elf_Phdr *phdr, int ph
case PT_GNU_STACK:
obj-stack_flags = ph-p_flags;
break;
+
+   case PT_GNU_RELRO:
+   obj-relro_page = obj-relocbase + trunc_page(ph-p_vaddr);
+   obj-relro_size = round_page(ph-p_memsz);
+   break;
}
 }
 if (nsegs  1) {
@@ -2007,6 +2012,14 @@ relocate_objects(Obj_Entry *first, bool 
if (reloc_jmpslots(obj, lockstate) == -1)
return -1;
 
+   if (obj-relro_size  0) {
+   if (mprotect(obj-relro_page, obj-relro_size, PROT_READ) == -1) {
+   _rtld_error(%s: Cannot enforce relro protection: %s,
+ obj-path, strerror(errno));
+   return -1;
+   }
+   }
+
/*
 * Set up the magic number and version in the Obj_Entry.  These
 * were checked in the crt1.o from the original ElfKit, so we

Modified: stable/9/libexec/rtld-elf/rtld.h
==
--- stable/9/libexec/rtld-elf/rtld.hMon Feb 13 10:24:49 2012
(r231578)
+++ stable/9/libexec/rtld-elf/rtld.hMon Feb 13 10:40:14 2012
(r231579)
@@ -168,6 +168,9 @@ typedef struct Struct_Obj_Entry {
 size_t tlsoffset;  /* Offset of static TLS block for this module */
 size_t tlsalign;   /* Alignment of static TLS block */
 
+caddr_t relro_page;
+size_t relro_size;
+
 /* Items from the dynamic section. */
 Elf_Addr *pltgot;  /* PLT or GOT, depending on architecture */
 const Elf_Rel *rel;/* Relocation entries */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231580 - stable/9/sys/ufs/ffs

2012-02-13 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 13 10:45:20 2012
New Revision: 231580
URL: http://svn.freebsd.org/changeset/base/231580

Log:
  MFC r231077:
  JNEWBLK dependency may legitimately appear on the buf dependency list.

Modified:
  stable/9/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_softdep.c
==
--- stable/9/sys/ufs/ffs/ffs_softdep.c  Mon Feb 13 10:40:14 2012
(r231579)
+++ stable/9/sys/ufs/ffs/ffs_softdep.c  Mon Feb 13 10:45:20 2012
(r231580)
@@ -12111,6 +12111,7 @@ top:
case D_FREEWORK:
case D_FREEDEP:
case D_JSEGDEP:
+   case D_JNEWBLK:
continue;
 
default:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231581 - stable/9/sys/ufs/ffs

2012-02-13 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 13 10:48:43 2012
New Revision: 231581
URL: http://svn.freebsd.org/changeset/base/231581

Log:
  MFC r231091:
  Add missing opt_quota.h include to activate #ifdef QUOTA blocks.

Modified:
  stable/9/sys/ufs/ffs/ffs_softdep.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/ufs/ffs/ffs_softdep.c
==
--- stable/9/sys/ufs/ffs/ffs_softdep.c  Mon Feb 13 10:45:20 2012
(r231580)
+++ stable/9/sys/ufs/ffs/ffs_softdep.c  Mon Feb 13 10:48:43 2012
(r231581)
@@ -43,6 +43,7 @@
 __FBSDID($FreeBSD$);
 
 #include opt_ffs.h
+#include opt_quota.h
 #include opt_ddb.h
 
 /*
@@ -6427,7 +6428,7 @@ softdep_setup_freeblocks(ip, length, fla
}
 #ifdef QUOTA
/* Reference the quotas in case the block count is wrong in the end. */
-   quotaref(vp, freeblks-fb_quota);
+   quotaref(ITOV(ip), freeblks-fb_quota);
(void) chkdq(ip, -datablocks, NOCRED, 0);
 #endif
freeblks-fb_chkcnt = -datablocks;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231582 - head/libexec/rtld-elf

2012-02-13 Thread Konstantin Belousov
Author: kib
Date: Mon Feb 13 11:15:29 2012
New Revision: 231582
URL: http://svn.freebsd.org/changeset/base/231582

Log:
  Add missed EOL when die() was converted to use rtld_fdputstr() instead
  of errx().
  
  Reported by:  amdmi3
  PR:   bin/165075
  MFC after:3 days

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cMon Feb 13 10:48:43 2012
(r231581)
+++ head/libexec/rtld-elf/rtld.cMon Feb 13 11:15:29 2012
(r231582)
@@ -757,6 +757,7 @@ die(void)
 if (msg == NULL)
msg = Fatal error;
 rtld_fdputstr(STDERR_FILENO, msg);
+rtld_fdputchar(STDERR_FILENO, '\n');
 _exit(1);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231584 - head/crypto/openssh

2012-02-13 Thread Ed Schouten
Author: ed
Date: Mon Feb 13 11:59:59 2012
New Revision: 231584
URL: http://svn.freebsd.org/changeset/base/231584

Log:
  Polish diff against upstream.
  
  - Revert unneeded whitespace changes.
  - Revert modifications to loginrec.c, as the upstream version already
does the right thing.
  - Fix indentation and whitespace of local changes.
  
  Approved by:  des
  MFC after:1 month

Modified:
  head/crypto/openssh/auth2.c
  head/crypto/openssh/channels.c
  head/crypto/openssh/channels.h
  head/crypto/openssh/kex.c
  head/crypto/openssh/loginrec.c   (contents, props changed)
  head/crypto/openssh/readconf.c
  head/crypto/openssh/readconf.h
  head/crypto/openssh/servconf.c
  head/crypto/openssh/sftp.1
  head/crypto/openssh/ssh.c
  head/crypto/openssh/sshd.c
  head/crypto/openssh/sshd_config.5
  head/crypto/openssh/version.h

Modified: head/crypto/openssh/auth2.c
==
--- head/crypto/openssh/auth2.c Mon Feb 13 11:36:42 2012(r231583)
+++ head/crypto/openssh/auth2.c Mon Feb 13 11:59:59 2012(r231584)
@@ -223,8 +223,8 @@ input_userauth_request(int type, u_int32
login_cap_t *lc;
const char *from_host, *from_ip;
 
-from_host = get_canonical_hostname(options.use_dns);
-from_ip = get_remote_ipaddr();
+   from_host = get_canonical_hostname(options.use_dns);
+   from_ip = get_remote_ipaddr();
 #endif
 
if (authctxt == NULL)
@@ -272,23 +272,23 @@ input_userauth_request(int type, u_int32
}
 
 #ifdef HAVE_LOGIN_CAP
-if (authctxt-pw != NULL) {
-lc = login_getpwclass(authctxt-pw);
-if (lc == NULL)
-lc = login_getclassbyname(NULL, authctxt-pw);
-if (!auth_hostok(lc, from_host, from_ip)) {
-logit(Denied connection for %.200s from %.200s 
[%.200s].,
-authctxt-pw-pw_name, from_host, from_ip);
-packet_disconnect(Sorry, you are not allowed to 
connect.);
-}
-if (!auth_timeok(lc, time(NULL))) {
-logit(LOGIN %.200s REFUSED (TIME) FROM %.200s,
-authctxt-pw-pw_name, from_host);
-packet_disconnect(Logins not available right now.);
-}
-login_close(lc);
-lc = NULL;
-}
+   if (authctxt-pw != NULL) {
+   lc = login_getpwclass(authctxt-pw);
+   if (lc == NULL)
+   lc = login_getclassbyname(NULL, authctxt-pw);
+   if (!auth_hostok(lc, from_host, from_ip)) {
+   logit(Denied connection for %.200s from %.200s 
[%.200s].,
+   authctxt-pw-pw_name, from_host, from_ip);
+   packet_disconnect(Sorry, you are not allowed to 
connect.);
+   }
+   if (!auth_timeok(lc, time(NULL))) {
+   logit(LOGIN %.200s REFUSED (TIME) FROM %.200s,
+   authctxt-pw-pw_name, from_host);
+   packet_disconnect(Logins not available right now.);
+   }
+   login_close(lc);
+   lc = NULL;
+   }
 #endif  /* HAVE_LOGIN_CAP */
 
/* reset state */

Modified: head/crypto/openssh/channels.c
==
--- head/crypto/openssh/channels.c  Mon Feb 13 11:36:42 2012
(r231583)
+++ head/crypto/openssh/channels.c  Mon Feb 13 11:59:59 2012
(r231584)
@@ -824,7 +824,7 @@ channel_tcpwinsz(void)
u_int maxlen;
 
/* If we are not on a socket return 128KB. */
-   if (!packet_connection_is_on_socket()) 
+   if (!packet_connection_is_on_socket())
return (128 * 1024);
 
tcpwinsz = 0;
@@ -854,7 +854,7 @@ channel_pre_open(Channel *c, fd_set *rea
 
limit = MIN(compat20 ? c-remote_window : packet_get_maxsize(),
2 * c-tcpwinsz);
-   
+
if (c-istate == CHAN_INPUT_OPEN 
limit  0 
buffer_len(c-input)  limit 
@@ -2687,10 +2687,10 @@ channel_set_af(int af)
IPv4or6 = af;
 }
 
-void 
+void
 channel_set_hpn(int disabled, u_int buf_size)
 {
-   hpn_disabled = disabled;
+   hpn_disabled = disabled;
buffer_size = buf_size;
debug(HPN Disabled: %d, HPN Buffer Size: %d,
hpn_disabled, buffer_size);
@@ -2856,10 +2856,10 @@ channel_setup_fwd_listener(int type, con
c = channel_new(port listener, type, sock, sock, -1,
CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
0, port listener, 1);
-   else
-   c = channel_new(port listener, type, sock, sock, -1,
-   buffer_size, CHAN_TCP_PACKET_DEFAULT,
-   0, port 

svn commit: r231585 - head/sys/netgraph

2012-02-13 Thread Gleb Smirnoff
Author: glebius
Date: Mon Feb 13 13:07:56 2012
New Revision: 231585
URL: http://svn.freebsd.org/changeset/base/231585

Log:
  No need to optimise for a node with no hooks, my braino.

Modified:
  head/sys/netgraph/ng_socket.c

Modified: head/sys/netgraph/ng_socket.c
==
--- head/sys/netgraph/ng_socket.c   Mon Feb 13 11:59:59 2012
(r231584)
+++ head/sys/netgraph/ng_socket.c   Mon Feb 13 13:07:56 2012
(r231585)
@@ -850,12 +850,9 @@ ngs_findhook(node_p node, const char *na
uint32_t h;
 
/*
-* Microoptimisations for a ng_socket with no
-* hooks, or with a single hook, which is a
-* common case.
+* Microoptimisation for an ng_socket with
+* a single hook, which is a common case.
 */
-   if (node-nd_numhooks == 0)
-   return (NULL);
if (node-nd_numhooks == 1) {
hook_p hook;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231586 - head/usr.bin/write

2012-02-13 Thread Gleb Smirnoff
Author: glebius
Date: Mon Feb 13 14:40:15 2012
New Revision: 231586
URL: http://svn.freebsd.org/changeset/base/231586

Log:
  Fix write(1) to support wide characters.
  
  Submitted by: amdmi3
  PR:   bin/164317

Modified:
  head/usr.bin/write/write.1
  head/usr.bin/write/write.c

Modified: head/usr.bin/write/write.1
==
--- head/usr.bin/write/write.1  Mon Feb 13 13:07:56 2012(r231585)
+++ head/usr.bin/write/write.1  Mon Feb 13 14:40:15 2012(r231586)
@@ -31,7 +31,7 @@
 .\ @(#)write.18.1 (Berkeley) 6/6/93
 .\ $FreeBSD$
 .\
-.Dd July 17, 2004
+.Dd February 13, 2012
 .Dt WRITE 1
 .Os
 .Sh NAME
@@ -107,7 +107,3 @@ setting is used to determine which chara
 terminal, not the receiver's (which
 .Nm
 has no way of knowing).
-.Pp
-The
-.Nm
-utility does not recognize multibyte characters.

Modified: head/usr.bin/write/write.c
==
--- head/usr.bin/write/write.c  Mon Feb 13 13:07:56 2012(r231585)
+++ head/usr.bin/write/write.c  Mon Feb 13 14:40:15 2012(r231586)
@@ -60,12 +60,14 @@ __FBSDID($FreeBSD$);
 #include string.h
 #include unistd.h
 #include utmpx.h
+#include wchar.h
+#include wctype.h
 
 void done(int);
 void do_write(char *, char *, uid_t);
 static void usage(void);
 int term_chk(char *, int *, time_t *, int);
-void wr_fputs(unsigned char *s);
+void wr_fputs(wchar_t *s);
 void search_utmp(char *, char *, char *, uid_t);
 int utmp_chk(char *, char *);
 
@@ -243,7 +245,8 @@ do_write(char *tty, char *mytty, uid_t m
char *nows;
struct passwd *pwd;
time_t now;
-   char path[MAXPATHLEN], host[MAXHOSTNAMELEN], line[512];
+   char path[MAXPATHLEN], host[MAXHOSTNAMELEN];
+   wchar_t line[512];
 
/* Determine our login name before we reopen() stdout */
if ((login = getlogin()) == NULL) {
@@ -269,7 +272,7 @@ do_write(char *tty, char *mytty, uid_t m
(void)printf(\r\n\007\007\007Message from %s@%s on %s at %s ...\r\n,
login, host, mytty, nows + 11);
 
-   while (fgets(line, sizeof(line), stdin) != NULL)
+   while (fgetws(line, sizeof(line)/sizeof(wchar_t), stdin) != NULL)
wr_fputs(line);
 }
 
@@ -288,30 +291,20 @@ done(int n __unused)
  * turns \n into \r\n
  */
 void
-wr_fputs(unsigned char *s)
+wr_fputs(wchar_t *s)
 {
 
-#definePUTC(c) if (putchar(c) == EOF) err(1, NULL);
+#definePUTC(c) if (putwchar(c) == WEOF) err(1, NULL);
 
-   for (; *s != '\0'; ++s) {
-   if (*s == '\n') {
-   PUTC('\r');
-   } else if (((*s  0x80)  *s  0xA0) ||
-  /* disable upper controls */
-  (!isprint(*s)  !isspace(*s) 
-   *s != '\a'  *s != '\b')
- ) {
-   if (*s  0x80) {
-   *s = ~0x80;
-   PUTC('M');
-   PUTC('-');
-   }
-   if (iscntrl(*s)) {
-   *s ^= 0x40;
-   PUTC('^');
-   }
+   for (; *s != L'\0'; ++s) {
+   if (*s == L'\n') {
+   PUTC(L'\r');
+   PUTC(L'\n');
+   } else if (iswprint(*s) || iswspace(*s)) {
+   PUTC(*s);
+   } else {
+   wprintf(L0x%X, *s);
}
-   PUTC(*s);
}
return;
 #undef PUTC
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231587 - in stable/9/sys: kern netgraph

2012-02-13 Thread Gleb Smirnoff
Author: glebius
Date: Mon Feb 13 15:21:12 2012
New Revision: 231587
URL: http://svn.freebsd.org/changeset/base/231587

Log:
  Merge from head 226829, 230213, 230480, 230486, 230487, 231585:
  
  r226829 in ng_base:
- If KDB  NETGRAPH_DEBUG are on, print traces on discovered failed
  invariants.
- Reduce tautology in NETGRAPH_DEBUG output.
  
  r230213 in ng_socket:
Remove some disabled NOTYET code. Probability of enabling it is low,
if anyone wants, he/she can take it from svn.
  
  r230480 in ng_base:
Convert locks that protect name hash, ID hash and typelist from
mutex(9) to rwlock(9) based locks.
  
While here remove dropping lock when processing NGM_LISTNODES,
and NGM_LISTTYPES generic commands. We don't need to drop it
since memory allocation is done with M_NOWAIT.
  
  r230486 in subr_hash.c:
Convert panic()s to KASSERT()s. This is an optimisation for
hashdestroy() since in absence of INVARIANTS a compiler
will drop the entire for() cycle.
  
  230487, 231585 in ng_socket:
Provide a findhook method for ng_socket(4). The node stores a
hash with names of its hooks. It starts with size of 16, and
grows when number of hooks reaches twice the current size. A
failure to grow (memory is allocated with M_NOWAIT) isn't
fatal, however.
  
I used standard hash(9) function for the hash. With 25000
hooks named in the mpd (ports/net/mpd5) manner of b%u, the
distributions is the following: 72.1% entries consist of one
element, 22.1% consist of two, 5.2% consist of three and
0.6% of four.
  
Speedup in a synthetic test that creates 25000 hooks and then
runs through a long cyclce dereferencing them in a random order
is over 25 times.
  
  The last merge was done in an ABI preserving manner, the struct
  ngsock is still exposed to userland (unlike in head), but its new
  fields are at its end and under #ifdef _KERNEL.

Modified:
  stable/9/sys/kern/subr_hash.c
  stable/9/sys/netgraph/netgraph.h
  stable/9/sys/netgraph/ng_base.c
  stable/9/sys/netgraph/ng_socket.c
  stable/9/sys/netgraph/ng_socketvar.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/kern/subr_hash.c
==
--- stable/9/sys/kern/subr_hash.c   Mon Feb 13 14:40:15 2012
(r231586)
+++ stable/9/sys/kern/subr_hash.c   Mon Feb 13 15:21:12 2012
(r231587)
@@ -52,9 +52,7 @@ hashinit_flags(int elements, struct mall
LIST_HEAD(generic, generic) *hashtbl;
int i;
 
-   if (elements = 0)
-   panic(hashinit: bad elements);
-
+   KASSERT(elements  0, (%s: bad elements, __func__));
/* Exactly one of HASH_WAITOK and HASH_NOWAIT must be set. */
KASSERT((flags  HASH_WAITOK) ^ (flags  HASH_NOWAIT),
(Bad flags (0x%x) passed to hashinit_flags, flags));
@@ -95,8 +93,7 @@ hashdestroy(void *vhashtbl, struct mallo
 
hashtbl = vhashtbl;
for (hp = hashtbl; hp = hashtbl[hashmask]; hp++)
-   if (!LIST_EMPTY(hp))
-   panic(hashdestroy: hash not empty);
+   KASSERT(LIST_EMPTY(hp), (%s: hash not empty, __func__));
free(hashtbl, type);
 }
 
@@ -115,8 +112,7 @@ phashinit(int elements, struct malloc_ty
LIST_HEAD(generic, generic) *hashtbl;
int i;
 
-   if (elements = 0)
-   panic(phashinit: bad elements);
+   KASSERT(elements  0, (%s: bad elements, __func__));
for (i = 1, hashsize = primes[1]; hashsize = elements;) {
i++;
if (i == NPRIMES)

Modified: stable/9/sys/netgraph/netgraph.h
==
--- stable/9/sys/netgraph/netgraph.hMon Feb 13 14:40:15 2012
(r231586)
+++ stable/9/sys/netgraph/netgraph.hMon Feb 13 15:21:12 2012
(r231587)
@@ -57,6 +57,7 @@
 
 #ifdef HAVE_KERNEL_OPTION_HEADERS
 #include opt_netgraph.h
+#include opt_kdb.h
 #endif
 
 /* debugging options */
@@ -190,7 +191,7 @@ static __inline void
 _chkhook(hook_p hook, char *file, int line)
 {
if (hook-hk_magic != HK_MAGIC) {
-   printf(Accessing freed hook );
+   printf(Accessing freed );
dumphook(hook, file, line);
}
hook-lastline = line;
@@ -458,7 +459,7 @@ static __inline void
 _chknode(node_p node, char *file, int line)
 {
if (node-nd_magic != ND_MAGIC) {
-   printf(Accessing freed node );
+   printf(Accessing freed );
dumpnode(node, file, line);
}
node-lastline = line;

Modified: stable/9/sys/netgraph/ng_base.c
==
--- stable/9/sys/netgraph/ng_base.c Mon Feb 13 14:40:15 2012
(r231586)
+++ stable/9/sys/netgraph/ng_base.c Mon Feb 13 15:21:12 2012
(r231587)
@@ -50,6 +50,7 @@
 #include 

Re: svn commit: r231508 - head/sys/dev/oce

2012-02-13 Thread John Baldwin
On Saturday, February 11, 2012 2:43:33 am Bjoern A. Zeeb wrote:
 Author: bz
 Date: Sat Feb 11 07:43:33 2012
 New Revision: 231508
 URL: http://svn.freebsd.org/changeset/base/231508
 
 Log:
   Make use of the read-only variant of the IF_ADDR_*LOCK() macros introduced
   in r229614 rather than the compat one.

Drivers should use the 'if_*addr_*lock()' functions, not the macros directly 
anyway.  In this case it should likely be if_maddr_rlock() and 
if_maddr_runlock().

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw

2012-02-13 Thread John Baldwin
On Friday, February 10, 2012 8:40:32 am Ed Schouten wrote:
 Author: ed
 Date: Fri Feb 10 13:40:32 2012
 New Revision: 231383
 URL: http://svn.freebsd.org/changeset/base/231383
 
 Log:
   Detect file modification properly by using tv_nsec.
   
   POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond
   precision to detect file modification.
   
   MFC after:  2 weeks

Eh, the BUG is still worth mentioning.  By default FreeBSD only uses second 
granularity for VFS timestamps, so two updates within a single second is still 
racey.  You can keep the code change, but I would revert the manual page 
change to put the BUG back as your change didn't remove it.

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231588 - in stable/8/lib: libcrypt libmd

2012-02-13 Thread Mark Murray
Author: markm
Date: Mon Feb 13 16:43:29 2012
New Revision: 231588
URL: http://svn.freebsd.org/changeset/base/231588

Log:
  MFC: sha256 ($5$) and sha512 ($6$) crypt(3) types.
  
  PR:   misc/124164
  Delayed by:   markm

Added:
  stable/8/lib/libcrypt/crypt-sha256.c
 - copied, changed from r220497, head/lib/libcrypt/crypt-sha256.c
  stable/8/lib/libcrypt/crypt-sha512.c
 - copied, changed from r220497, head/lib/libcrypt/crypt-sha512.c
  stable/8/lib/libmd/sha512.3
 - copied unchanged from r220496, head/lib/libmd/sha512.3
  stable/8/lib/libmd/sha512.h
 - copied unchanged from r220496, head/lib/libmd/sha512.h
  stable/8/lib/libmd/sha512c.c
 - copied unchanged from r220496, head/lib/libmd/sha512c.c
Modified:
  stable/8/lib/libcrypt/Makefile
  stable/8/lib/libcrypt/crypt.c
  stable/8/lib/libcrypt/crypt.h
  stable/8/lib/libcrypt/misc.c
  stable/8/lib/libmd/Makefile
  stable/8/lib/libmd/mddriver.c
  stable/8/lib/libmd/rmddriver.c
  stable/8/lib/libmd/shadriver.c
Directory Properties:
  stable/8/   (props changed)
  stable/8/lib/   (props changed)
  stable/8/lib/libcrypt/   (props changed)
  stable/8/lib/libmd/   (props changed)

Modified: stable/8/lib/libcrypt/Makefile
==
--- stable/8/lib/libcrypt/Makefile  Mon Feb 13 15:21:12 2012
(r231587)
+++ stable/8/lib/libcrypt/Makefile  Mon Feb 13 16:43:29 2012
(r231588)
@@ -12,7 +12,9 @@ LIB=  crypt
 .PATH: ${.CURDIR}/../libmd
 SRCS=  crypt.c misc.c \
crypt-md5.c md5c.c \
-   crypt-nthash.c md4c.c
+   crypt-nthash.c md4c.c \
+   crypt-sha256.c sha256c.c \
+   crypt-sha512.c sha512c.c
 MAN=   crypt.3
 MLINKS=crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3
 CFLAGS+=   -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil
@@ -29,7 +31,9 @@ CFLAGS+=  -I${.CURDIR} -DHAS_DES -DHAS_BL
 SRCS+= auth.c property.c
 .for sym in auth_getval property_find properties_read properties_free \
MD4Init MD4Final MD4Update MD4Pad \
-   MD5Init MD5Final MD5Update MD5Pad
+   MD5Init MD5Final MD5Update MD5Pad \
+   SHA256_Init SHA256_Final SHA256_Update \
+   SHA512_Init SHA512_Final SHA512_Update
 CFLAGS+=   -D${sym}=__${sym}
 .endfor
 

Copied and modified: stable/8/lib/libcrypt/crypt-sha256.c (from r220497, 
head/lib/libcrypt/crypt-sha256.c)
==
--- head/lib/libcrypt/crypt-sha256.cSat Apr  9 14:02:04 2011
(r220497, copy source)
+++ stable/8/lib/libcrypt/crypt-sha256.cMon Feb 13 16:43:29 2012
(r231588)
@@ -60,7 +60,7 @@ static const char sha256_rounds_prefix[]
 #define ROUNDS_MAX 9
 
 static char *
-sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
+crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen)
 {
u_long srounds;
int n;
@@ -268,12 +268,12 @@ sha256_crypt_r(const char *key, const ch
 
 /* This entry point is equivalent to crypt(3). */
 char *
-sha256_crypt(const char *key, const char *salt)
+crypt_sha256(const char *key, const char *salt)
 {
/* We don't want to have an arbitrary limit in the size of the
 * password. We can compute an upper bound for the size of the
 * result in advance and so we can prepare the buffer we pass to
-* `sha256_crypt_r'. */
+* `crypt_sha256_r'. */
static char *buffer;
static int buflen;
int needed;
@@ -293,7 +293,7 @@ sha256_crypt(const char *key, const char
buflen = needed;
}
 
-   return sha256_crypt_r(key, salt, buffer, buflen);
+   return crypt_sha256_r(key, salt, buffer, buflen);
 }
 
 #ifdef TEST
@@ -459,7 +459,7 @@ main(void)
}
 
for (cnt = 0; cnt  ntests2; ++cnt) {
-   char *cp = sha256_crypt(tests2[cnt].input, tests2[cnt].salt);
+   char *cp = crypt_sha256(tests2[cnt].input, tests2[cnt].salt);
 
if (strcmp(cp, tests2[cnt].expected) != 0) {
printf(test %d: expected \%s\, got \%s\\n,

Copied and modified: stable/8/lib/libcrypt/crypt-sha512.c (from r220497, 
head/lib/libcrypt/crypt-sha512.c)
==
--- head/lib/libcrypt/crypt-sha512.cSat Apr  9 14:02:04 2011
(r220497, copy source)
+++ stable/8/lib/libcrypt/crypt-sha512.cMon Feb 13 16:43:29 2012
(r231588)
@@ -60,7 +60,7 @@ static const char sha512_rounds_prefix[]
 #define ROUNDS_MAX 9
 
 static char *
-sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
+crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen)
 {
u_long srounds;
int n;
@@ -280,12 +280,12 @@ sha512_crypt_r(const char *key, const ch
 

svn commit: r231589 - head/sys/dev/aac

2012-02-13 Thread Ed Maste
Author: emaste
Date: Mon Feb 13 16:48:49 2012
New Revision: 231589
URL: http://svn.freebsd.org/changeset/base/231589

Log:
  Add a sysctl to report the firmware build number.
  
  Some older firmware versions have issues that can be worked around by
  avoiding certain operations.  Add a sysctl dev.aac.#.firmware_build to
  make it easy for scripts or userland tools to detect the firmware
  version.

Modified:
  head/sys/dev/aac/aac.c

Modified: head/sys/dev/aac/aac.c
==
--- head/sys/dev/aac/aac.c  Mon Feb 13 16:43:29 2012(r231588)
+++ head/sys/dev/aac/aac.c  Mon Feb 13 16:48:49 2012(r231589)
@@ -292,6 +292,15 @@ aac_attach(struct aac_softc *sc)
aac_describe_controller(sc);
 
/*
+* Add sysctls.
+*/
+   SYSCTL_ADD_INT(device_get_sysctl_ctx(sc-aac_dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(sc-aac_dev)),
+   OID_AUTO, firmware_build, CTLFLAG_RD,
+   sc-aac_revision.buildNumber, 0,
+   firmware build number);
+
+   /*
 * Register to probe our containers later.
 */
sc-aac_ich.ich_func = aac_startup;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231590 - stable/8/release/picobsd/build

2012-02-13 Thread Luigi Rizzo
Author: luigi
Date: Mon Feb 13 18:10:13 2012
New Revision: 231590
URL: http://svn.freebsd.org/changeset/base/231590

Log:
  MFC: cross-arch support for picobsd

Modified:
  stable/8/release/picobsd/build/Makefile.conf
  stable/8/release/picobsd/build/picobsd

Modified: stable/8/release/picobsd/build/Makefile.conf
==
--- stable/8/release/picobsd/build/Makefile.confMon Feb 13 16:48:49 
2012(r231589)
+++ stable/8/release/picobsd/build/Makefile.confMon Feb 13 18:10:13 
2012(r231590)
@@ -13,15 +13,16 @@ BINMAKE?=make
 SRC?=/usr/src
 CONFIG?=config
 MODULES?=-DNO_MODULES  # do not build them as a default
+KERNCONF ?= PICOBSD
 
 # caller will set MODULES to empty if modules are needed.
 # Indeed, it can be used to specify other Makefile options as well.
 
 # These 3 variables determine where the kernel is built.
 # If config were smart enough, we could place the config
-# file in some other place than ${SRC}/sys/i386/conf, but
+# file in some other place than ${SRC}/sys/${TARGET_ARCH}/conf, but
 # at the moment (Oct.2001) this is not possible yet.
-CONF=${SRC}/sys/i386/conf
+CONF=${SRC}/sys/${TARGET_ARCH}/conf
 #CONF=${BUILDDIR}/conf # XXX does not work yet
 CONFFILE=PICOBSD-${name}
 
@@ -45,10 +46,10 @@ ${COMPILE}: ${CONF}/${CONFFILE}
(cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \
cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} depend )
 
-${CONF}/${CONFFILE}: PICOBSD
+${CONF}/${CONFFILE}: ${KERNCONF}
# -mkdir -p ${CONF} # XXX not needed yet.
cp ${.OODATE} ${.TARGET}
-   if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; 
fi
+   [ -f PICOBSD.hints ]  cp PICOBSD.hints ${CONF}/
 
 # This part creates crunch1.conf and crunch.mk from crunch.conf
 ${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf

Modified: stable/8/release/picobsd/build/picobsd
==
--- stable/8/release/picobsd/build/picobsd  Mon Feb 13 16:48:49 2012
(r231589)
+++ stable/8/release/picobsd/build/picobsd  Mon Feb 13 18:10:13 2012
(r231590)
@@ -67,7 +67,7 @@
 # SRC points to your FreeBSD source tree.
 # l_usrtree points to the /usr subdir for the source tree.
 # Normally /usr or ${SRC}/../usr
-# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico
+# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico-${o_arch}
 # c_label is either bsdlabel or disklabel
 # PICO_TREE is where standard picobsd stuff resides.
 # Normally ${SRC}/release/picobsd
@@ -105,11 +105,6 @@ set_defaults() {   # no arguments
 EDITOR=${EDITOR:-vi}
 fd_size=${fd_size:-1440}
 
-o_use_loader=yes # use /boot/loader
-   # You should not change it unless you are really short
-   # of space, and your kernel is small enough that the
-   # bootblocks manage to load it.
-
 o_all_in_mfs=yes # put all files in mfs so you can boot
# and run the image via diskless boot.
 o_clean= # set if you want to clean prev.builds.
@@ -121,6 +116,7 @@ set_defaults() {# no arguments
 o_no_devfs=# default is use devfs.
# You should only set it when building 4.x images
 o_do_modules=# do not build modules
+o_arch=`uname -m`  # default to amd64 or i386 ...
 
 SRC=/usr/src # default location for sources
 c_startdir=`pwd`   # directory where we start
@@ -165,20 +161,30 @@ set_defaults() {  # no arguments
 # and also to build a specific target
 create_includes_and_libraries2() { # opt_dir opt_target
 local no
-log create_includes_and_libraries2() for ${SRC}
+log create_includes_and_libraries2() for ${SRC} $1
 if [ ${OSVERSION} -ge 60 ] ; then
no=-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R # WITHOUT_CDDL=1
 else
no=-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R
 fi
-MAKEOBJDIRPREFIX=${l_objtree}
-export MAKEOBJDIRPREFIX
 ( cd ${SRC};
 # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld
 if [ -d $1 ] ; then
-   cd $1 ; ${BINMAKE} $2   # specific target, e.g. ld-elf.so
+   cd $1 ; ${BINMAKE} ${o_par} $2  # specific target, e.g. ld-elf.so
 else
-   ${BINMAKE} _+_= $no toolchain _includes _libraries
+   MAKEOBJDIRPREFIX=${l_objtree}
+   export MAKEOBJDIRPREFIX
+   # export WITH_RESCUE=yes# build crunchide
+   # ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries
+   (
+   # eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V BMAKEENV`
+   eval export XMAKE=\`cd ${SRC}; make -f Makefile -V XMAKE`\
+   ${BINMAKE} ${o_par} _+_= $no toolchain
+   )
+eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV`
+   ${BINMAKE} ${o_par} _+_= 

svn commit: r231591 - stable/9/sbin/mount

2012-02-13 Thread Jaakko Heinonen
Author: jh
Date: Mon Feb 13 18:26:58 2012
New Revision: 231591
URL: http://svn.freebsd.org/changeset/base/231591

Log:
  MFC r230373:
  
  Change mount_fs() to not exit on error. The failok mount option
  requires that errors are passed to the caller.
  
  PR:   163668

Modified:
  stable/9/sbin/mount/mount_fs.c
Directory Properties:
  stable/9/sbin/mount/   (props changed)

Modified: stable/9/sbin/mount/mount_fs.c
==
--- stable/9/sbin/mount/mount_fs.c  Mon Feb 13 18:10:13 2012
(r231590)
+++ stable/9/sbin/mount/mount_fs.c  Mon Feb 13 18:26:58 2012
(r231591)
@@ -82,7 +82,6 @@ mount_fs(const char *vfstype, int argc, 
char fstype[32];
char errmsg[255];
char *p, *val;
-   int ret;
 
strlcpy(fstype, vfstype, sizeof(fstype));
memset(errmsg, 0, sizeof(errmsg));
@@ -125,10 +124,10 @@ mount_fs(const char *vfstype, int argc, 
build_iovec(iov, iovlen, fspath, mntpath, (size_t)-1);
build_iovec(iov, iovlen, from, dev, (size_t)-1);
build_iovec(iov, iovlen, errmsg, errmsg, sizeof(errmsg));
-   
-   ret = nmount(iov, iovlen, mntflags);
-   if (ret  0)
-   err(1, %s %s, dev, errmsg);
 
-   return (ret);
+   if (nmount(iov, iovlen, mntflags) == -1) {
+   warn(%s: %s, dev, errmsg);
+   return (1);
+   }
+   return (0);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231592 - head/sys/dev/cxgbe/common

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 18:41:32 2012
New Revision: 231592
URL: http://svn.freebsd.org/changeset/base/231592

Log:
  Use the non-sleeping variang of t4_wr_mbox in code that can be called
  with locks held.
  
  MFC after:1 day

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 18:26:58 2012
(r231591)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 18:41:32 2012
(r231592)
@@ -4314,7 +4314,7 @@ int t4_change_mac(struct adapter *adap, 
V_FW_VI_MAC_CMD_IDX(idx));
memcpy(p-macaddr, addr, sizeof(p-macaddr));
 
-   ret = t4_wr_mbox(adap, mbox, c, sizeof(c), c);
+   ret = t4_wr_mbox_ns(adap, mbox, c, sizeof(c), c);
if (ret == 0) {
ret = G_FW_VI_MAC_CMD_IDX(ntohs(p-valid_to_idx));
if (ret = FW_CLS_TCAM_NUM_ENTRIES)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw

2012-02-13 Thread Ed Schouten
* John Baldwin j...@freebsd.org, 20120213 17:26:
 Eh, the BUG is still worth mentioning.  By default FreeBSD only uses
 second granularity for VFS timestamps, so two updates within a single
 second is still racey.  You can keep the code change, but I would
 revert the manual page change to put the BUG back as your change
 didn't remove it.

I'll re-add it tomorrow. I do think I will extend the message a bit,
stating that this is only a problem if your file system doesn't do
fine-grained timestamps.

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpE0jtuf854Y.pgp
Description: PGP signature


svn commit: r231593 - stable/9/sys/dev/cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 18:54:15 2012
New Revision: 231593
URL: http://svn.freebsd.org/changeset/base/231593

Log:
  MFC r231115:
  cxgbe: reduce diffs with other branches.

Modified:
  stable/9/sys/dev/cxgbe/adapter.h
  stable/9/sys/dev/cxgbe/t4_l2t.c
  stable/9/sys/dev/cxgbe/t4_l2t.h
  stable/9/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgbe/adapter.h
==
--- stable/9/sys/dev/cxgbe/adapter.hMon Feb 13 18:41:32 2012
(r231592)
+++ stable/9/sys/dev/cxgbe/adapter.hMon Feb 13 18:54:15 2012
(r231593)
@@ -66,6 +66,17 @@ prefetch(void *x)
 #define prefetch(x)
 #endif
 
+#ifndef SYSCTL_ADD_UQUAD
+#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
+#define sysctl_handle_64 sysctl_handle_quad
+#define CTLTYPE_U64 CTLTYPE_QUAD
+#endif
+
+#if (__FreeBSD_version = 900030) || \
+((__FreeBSD_version = 802507)  (__FreeBSD_version  90))
+#define SBUF_DRAIN 1
+#endif
+
 #ifdef __amd64__
 /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */
 static __inline uint64_t

Modified: stable/9/sys/dev/cxgbe/t4_l2t.c
==
--- stable/9/sys/dev/cxgbe/t4_l2t.c Mon Feb 13 18:41:32 2012
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_l2t.c Mon Feb 13 18:54:15 2012
(r231593)
@@ -259,6 +259,7 @@ t4_free_l2t(struct l2t_data *d)
return (0);
 }
 
+#ifdef SBUF_DRAIN
 static inline unsigned int
 vlan_prio(const struct l2t_entry *e)
 {
@@ -333,6 +334,7 @@ skip:
 
return (rc);
 }
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
 static inline void
@@ -652,6 +654,11 @@ t4_l2t_get(struct port_info *pi, struct 
} else
return (NULL);
 
+#ifndef VLAN_TAG
+   if (ifp-if_type == IFT_L2VLAN)
+   return (NULL);
+#endif
+
hash = addr_hash(addr, addr_len, ifp-if_index);
 
rw_wlock(d-lock);
@@ -678,10 +685,12 @@ t4_l2t_get(struct port_info *pi, struct 
e-v6 = (addr_len == 16);
e-lle = NULL;
atomic_store_rel_int(e-refcnt, 1);
+#ifdef VLAN_TAG
if (ifp-if_type == IFT_L2VLAN)
VLAN_TAG(ifp, e-vlan);
else
e-vlan = VLAN_NONE;
+#endif
e-next = d-l2tab[hash].first;
d-l2tab[hash].first = e;
mtx_unlock(e-lock);

Modified: stable/9/sys/dev/cxgbe/t4_l2t.h
==
--- stable/9/sys/dev/cxgbe/t4_l2t.h Mon Feb 13 18:41:32 2012
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_l2t.h Mon Feb 13 18:54:15 2012
(r231593)
@@ -67,7 +67,9 @@ struct l2t_entry *t4_l2t_alloc_switching
 int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t,
 uint8_t, uint8_t *);
 void t4_l2t_release(struct l2t_entry *);
+#ifdef SBUF_DRAIN
 int sysctl_l2t(SYSCTL_HANDLER_ARGS);
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
 struct l2t_entry *t4_l2t_get(struct port_info *, struct ifnet *,

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==
--- stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 18:41:32 2012
(r231592)
+++ stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 18:54:15 2012
(r231593)
@@ -309,6 +309,7 @@ static int sysctl_holdoff_pktc_idx(SYSCT
 static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS);
 static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS);
 static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS);
+#ifdef SBUF_DRAIN
 static int sysctl_cctrl(SYSCTL_HANDLER_ARGS);
 static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS);
 static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS);
@@ -324,6 +325,7 @@ static int sysctl_tcp_stats(SYSCTL_HANDL
 static int sysctl_tids(SYSCTL_HANDLER_ARGS);
 static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS);
 static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS);
+#endif
 static inline void txq_start(struct ifnet *, struct sge_txq *);
 static uint32_t fconf_to_mode(uint32_t);
 static uint32_t mode_to_fconf(uint32_t);
@@ -2980,6 +2982,7 @@ t4_sysctls(struct adapter *sc)
sizeof(sc-sge.counter_val), sysctl_int_array, A,
interrupt holdoff packet counter values);
 
+#ifdef SBUF_DRAIN
/*
 * dev.t4nex.X.misc.  Marked CTLFLAG_SKIP to avoid information overload.
 */
@@ -3051,6 +3054,7 @@ t4_sysctls(struct adapter *sc)
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, tx_rate,
CTLTYPE_STRING | CTLFLAG_RD, sc, 0,
sysctl_tx_rate, A, Tx rate);
+#endif
 
 #ifndef TCP_OFFLOAD_DISABLE
if (is_offload(sc)) {
@@ -3465,6 +3469,7 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR
return (sysctl_handle_64(oidp, val, 0, req));
 }
 
+#ifdef SBUF_DRAIN
 static int
 sysctl_cctrl(SYSCTL_HANDLER_ARGS)
 {
@@ -4297,6 +4302,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS)
 

svn commit: r231594 - head/sys/dev/netmap

2012-02-13 Thread Luigi Rizzo
Author: luigi
Date: Mon Feb 13 18:56:34 2012
New Revision: 231594
URL: http://svn.freebsd.org/changeset/base/231594

Log:
  - use struct ifnet as explicit type of the argument to the
txsync() and rxsync() callbacks, removing some variables made
useless by this change;
  
  - add generic lock and irq handling routines. These can be useful
in case there are no driver locks that we can reuse;
  
  - add a few macros to reduce differences with the Linux version.

Modified:
  head/sys/dev/netmap/if_em_netmap.h
  head/sys/dev/netmap/if_igb_netmap.h
  head/sys/dev/netmap/if_lem_netmap.h
  head/sys/dev/netmap/if_re_netmap.h
  head/sys/dev/netmap/ixgbe_netmap.h
  head/sys/dev/netmap/netmap.c
  head/sys/dev/netmap/netmap_kern.h

Modified: head/sys/dev/netmap/if_em_netmap.h
==
--- head/sys/dev/netmap/if_em_netmap.h  Mon Feb 13 18:54:15 2012
(r231593)
+++ head/sys/dev/netmap/if_em_netmap.h  Mon Feb 13 18:56:34 2012
(r231594)
@@ -42,9 +42,9 @@
 static voidem_netmap_block_tasks(struct adapter *);
 static voidem_netmap_unblock_tasks(struct adapter *);
 static int em_netmap_reg(struct ifnet *, int onoff);
-static int em_netmap_txsync(void *, u_int, int);
-static int em_netmap_rxsync(void *, u_int, int);
-static voidem_netmap_lock_wrapper(void *, int, u_int);
+static int em_netmap_txsync(struct ifnet *, u_int, int);
+static int em_netmap_rxsync(struct ifnet *, u_int, int);
+static voidem_netmap_lock_wrapper(struct ifnet *, int, u_int);
 
 static void
 em_netmap_attach(struct adapter *adapter)
@@ -69,9 +69,9 @@ em_netmap_attach(struct adapter *adapter
  * wrapper to export locks to the generic code
  */
 static void
-em_netmap_lock_wrapper(void *_a, int what, u_int queueid)
+em_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid)
 {
-   struct adapter *adapter = _a;
+   struct adapter *adapter = ifp-if_softc;
 
ASSERT(queueid  adapter-num_queues);
switch (what) {
@@ -183,9 +183,9 @@ fail:
  * Reconcile hardware and user view of the transmit ring.
  */
 static int
-em_netmap_txsync(void *a, u_int ring_nr, int do_lock)
+em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
 {
-   struct adapter *adapter = a;
+   struct adapter *adapter = ifp-if_softc;
struct tx_ring *txr = adapter-tx_rings[ring_nr];
struct netmap_adapter *na = NA(adapter-ifp);
struct netmap_kring *kring = na-tx_rings[ring_nr];
@@ -289,9 +289,9 @@ em_netmap_txsync(void *a, u_int ring_nr,
  * Reconcile kernel and user view of the receive ring.
  */
 static int
-em_netmap_rxsync(void *a, u_int ring_nr, int do_lock)
+em_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
 {
-   struct adapter *adapter = a;
+   struct adapter *adapter = ifp-if_softc;
struct rx_ring *rxr = adapter-rx_rings[ring_nr];
struct netmap_adapter *na = NA(adapter-ifp);
struct netmap_kring *kring = na-rx_rings[ring_nr];

Modified: head/sys/dev/netmap/if_igb_netmap.h
==
--- head/sys/dev/netmap/if_igb_netmap.h Mon Feb 13 18:54:15 2012
(r231593)
+++ head/sys/dev/netmap/if_igb_netmap.h Mon Feb 13 18:56:34 2012
(r231594)
@@ -38,9 +38,9 @@
 #include dev/netmap/netmap_kern.h
 
 static int igb_netmap_reg(struct ifnet *, int onoff);
-static int igb_netmap_txsync(void *, u_int, int);
-static int igb_netmap_rxsync(void *, u_int, int);
-static voidigb_netmap_lock_wrapper(void *, int, u_int);
+static int igb_netmap_txsync(struct ifnet *, u_int, int);
+static int igb_netmap_rxsync(struct ifnet *, u_int, int);
+static voidigb_netmap_lock_wrapper(struct ifnet *, int, u_int);
 
 
 static void
@@ -66,9 +66,9 @@ igb_netmap_attach(struct adapter *adapte
  * wrapper to export locks to the generic code
  */
 static void
-igb_netmap_lock_wrapper(void *_a, int what, u_int queueid)
+igb_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int queueid)
 {
-   struct adapter *adapter = _a;
+   struct adapter *adapter = ifp-if_softc;
 
ASSERT(queueid  adapter-num_queues);
switch (what) {
@@ -140,9 +140,9 @@ fail:
  * Reconcile kernel and user view of the transmit ring.
  */
 static int
-igb_netmap_txsync(void *a, u_int ring_nr, int do_lock)
+igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
 {
-   struct adapter *adapter = a;
+   struct adapter *adapter = ifp-if_softc;
struct tx_ring *txr = adapter-tx_rings[ring_nr];
struct netmap_adapter *na = NA(adapter-ifp);
struct netmap_kring *kring = na-tx_rings[ring_nr];
@@ -258,9 +258,9 @@ igb_netmap_txsync(void *a, u_int ring_nr
  * Reconcile kernel and user view of the receive ring.
  */
 static int
-igb_netmap_rxsync(void *a, u_int ring_nr, int do_lock)
+igb_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock)
 {
-   struct 

svn commit: r231595 - stable/8/share/mk

2012-02-13 Thread Stefan Esser
Author: se
Date: Mon Feb 13 18:57:36 2012
New Revision: 231595
URL: http://svn.freebsd.org/changeset/base/231595

Log:
  MFC r223596:
  
  Add macros to specify owner, group and mode of config files for installation.

Modified:
  stable/8/share/mk/bsd.own.mk
Directory Properties:
  stable/8/share/mk/   (props changed)

Modified: stable/8/share/mk/bsd.own.mk
==
--- stable/8/share/mk/bsd.own.mkMon Feb 13 18:56:34 2012
(r231594)
+++ stable/8/share/mk/bsd.own.mkMon Feb 13 18:57:36 2012
(r231595)
@@ -61,6 +61,15 @@
 # SHAREMODEASCII text file mode. [${NOBINMODE}]
 #
 #
+# CONFDIR  Base path for configuration files. [/etc]
+#
+# CONFOWN  Configuration file owner. [root]
+#
+# CONFGRP  Configuration file group. [wheel]
+#
+# CONFMODE Configuration file mode. [644]
+#
+#
 # DOCDIR   Base path for system documentation (e.g. PSD, USD,
 #  handbook, FAQ etc.). [${SHAREDIR}/doc]
 #
@@ -142,6 +151,11 @@ SHAREOWN?= root
 SHAREGRP?= wheel
 SHAREMODE?=${NOBINMODE}
 
+CONFDIR?=  /etc
+CONFOWN?=  root
+CONFGRP?=  wheel
+CONFMODE?= 644
+
 MANDIR?=   ${SHAREDIR}/man/man
 MANOWN?=   ${SHAREOWN}
 MANGRP?=   ${SHAREGRP}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231596 - stable/9/sbin/mount

2012-02-13 Thread Jaakko Heinonen
Author: jh
Date: Mon Feb 13 19:02:11 2012
New Revision: 231596
URL: http://svn.freebsd.org/changeset/base/231596

Log:
  MFC r230377:
  
  Don't print the nmount(2) provided error message if it is empty.

Modified:
  stable/9/sbin/mount/mount_fs.c
Directory Properties:
  stable/9/sbin/mount/   (props changed)

Modified: stable/9/sbin/mount/mount_fs.c
==
--- stable/9/sbin/mount/mount_fs.c  Mon Feb 13 18:57:36 2012
(r231595)
+++ stable/9/sbin/mount/mount_fs.c  Mon Feb 13 19:02:11 2012
(r231596)
@@ -126,7 +126,10 @@ mount_fs(const char *vfstype, int argc, 
build_iovec(iov, iovlen, errmsg, errmsg, sizeof(errmsg));
 
if (nmount(iov, iovlen, mntflags) == -1) {
-   warn(%s: %s, dev, errmsg);
+   if (*errmsg != '\0')
+   warn(%s: %s, dev, errmsg);
+   else
+   warn(%s, dev);
return (1);
}
return (0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231597 - in stable/9/sys/dev: cxgb cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:17:43 2012
New Revision: 231597
URL: http://svn.freebsd.org/changeset/base/231597

Log:
  MFC r231116:
  Remove if_start from cxgb and cxgbe.

Modified:
  stable/9/sys/dev/cxgb/cxgb_adapter.h
  stable/9/sys/dev/cxgb/cxgb_main.c
  stable/9/sys/dev/cxgb/cxgb_sge.c
  stable/9/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgb/cxgb_adapter.h
==
--- stable/9/sys/dev/cxgb/cxgb_adapter.hMon Feb 13 19:02:11 2012
(r231596)
+++ stable/9/sys/dev/cxgb/cxgb_adapter.hMon Feb 13 19:17:43 2012
(r231597)
@@ -572,5 +572,4 @@ static inline int offload_running(adapte
 void cxgb_tx_watchdog(void *arg);
 int cxgb_transmit(struct ifnet *ifp, struct mbuf *m);
 void cxgb_qflush(struct ifnet *ifp);
-void cxgb_start(struct ifnet *ifp);
 #endif

Modified: stable/9/sys/dev/cxgb/cxgb_main.c
==
--- stable/9/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:02:11 2012
(r231596)
+++ stable/9/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:17:43 2012
(r231597)
@@ -227,14 +227,6 @@ TUNABLE_INT(hw.cxgb.use_16k_clusters, 
 SYSCTL_INT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN,
 cxgb_use_16k_clusters, 0, use 16kB clusters for the jumbo queue );
 
-/*
- * Tune the size of the output queue.
- */
-int cxgb_snd_queue_len = IFQ_MAXLEN;
-TUNABLE_INT(hw.cxgb.snd_queue_len, cxgb_snd_queue_len);
-SYSCTL_INT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN,
-cxgb_snd_queue_len, 0, send queue size );
-
 static int nfilters = -1;
 TUNABLE_INT(hw.cxgb.nfilters, nfilters);
 SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN,
@@ -1019,11 +1011,8 @@ cxgb_port_attach(device_t dev)
ifp-if_softc = p;
ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp-if_ioctl = cxgb_ioctl;
-   ifp-if_start = cxgb_start;
-
-   ifp-if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen);
-   IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
-   IFQ_SET_READY(ifp-if_snd);
+   ifp-if_transmit = cxgb_transmit;
+   ifp-if_qflush = cxgb_qflush;
 
ifp-if_capabilities = CXGB_CAP;
ifp-if_capenable = CXGB_CAP_ENABLE;
@@ -1039,8 +1028,6 @@ cxgb_port_attach(device_t dev)
}
 
ether_ifattach(ifp, p-hw_addr);
-   ifp-if_transmit = cxgb_transmit;
-   ifp-if_qflush = cxgb_qflush;
 
 #ifdef DEFAULT_JUMBO
if (sc-params.nports = 2)

Modified: stable/9/sys/dev/cxgb/cxgb_sge.c
==
--- stable/9/sys/dev/cxgb/cxgb_sge.cMon Feb 13 19:02:11 2012
(r231596)
+++ stable/9/sys/dev/cxgb/cxgb_sge.cMon Feb 13 19:17:43 2012
(r231597)
@@ -1767,19 +1767,6 @@ cxgb_transmit(struct ifnet *ifp, struct 
error = drbr_enqueue(ifp, qs-txq[TXQ_ETH].txq_mr, m);
return (error);
 }
-void
-cxgb_start(struct ifnet *ifp)
-{
-   struct port_info *pi = ifp-if_softc;
-   struct sge_qset *qs = pi-adapter-sge.qs[pi-first_qset];
-   
-   if (!pi-link_config.link_ok)
-   return;
-
-   TXQ_LOCK(qs);
-   cxgb_start_locked(qs);
-   TXQ_UNLOCK(qs);
-}
 
 void
 cxgb_qflush(struct ifnet *ifp)

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==
--- stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:02:11 2012
(r231596)
+++ stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:17:43 2012
(r231597)
@@ -112,7 +112,6 @@ static struct cdevsw t4_cdevsw = {
 /* ifnet + media interface */
 static void cxgbe_init(void *);
 static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t);
-static void cxgbe_start(struct ifnet *);
 static int cxgbe_transmit(struct ifnet *, struct mbuf *);
 static void cxgbe_qflush(struct ifnet *);
 static int cxgbe_media_change(struct ifnet *);
@@ -829,14 +828,9 @@ cxgbe_attach(device_t dev)
 
ifp-if_init = cxgbe_init;
ifp-if_ioctl = cxgbe_ioctl;
-   ifp-if_start = cxgbe_start;
ifp-if_transmit = cxgbe_transmit;
ifp-if_qflush = cxgbe_qflush;
 
-   ifp-if_snd.ifq_drv_maxlen = 1024;
-   IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
-   IFQ_SET_READY(ifp-if_snd);
-
ifp-if_capabilities = T4_CAP;
 #ifndef TCP_OFFLOAD_DISABLE
if (is_offload(pi-adapter))
@@ -1095,21 +1089,6 @@ fail:
return (rc);
 }
 
-static void
-cxgbe_start(struct ifnet *ifp)
-{
-   struct port_info *pi = ifp-if_softc;
-   struct sge_txq *txq;
-   int i;
-
-   for_each_txq(pi, i, txq) {
-   if (TXQ_TRYLOCK(txq)) {
-   txq_start(ifp, txq);
-   TXQ_UNLOCK(txq);
-   }
-   }
-}
-
 static int
 cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
 {

svn commit: r231598 - in stable/8/sys/dev: cxgb cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:18:08 2012
New Revision: 231598
URL: http://svn.freebsd.org/changeset/base/231598

Log:
  MFC r231116:
  Remove if_start from cxgb and cxgbe.

Modified:
  stable/8/sys/dev/cxgb/cxgb_adapter.h
  stable/8/sys/dev/cxgb/cxgb_main.c
  stable/8/sys/dev/cxgb/cxgb_sge.c
  stable/8/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/cxgb/cxgb_adapter.h
==
--- stable/8/sys/dev/cxgb/cxgb_adapter.hMon Feb 13 19:17:43 2012
(r231597)
+++ stable/8/sys/dev/cxgb/cxgb_adapter.hMon Feb 13 19:18:08 2012
(r231598)
@@ -572,5 +572,4 @@ static inline int offload_running(adapte
 void cxgb_tx_watchdog(void *arg);
 int cxgb_transmit(struct ifnet *ifp, struct mbuf *m);
 void cxgb_qflush(struct ifnet *ifp);
-void cxgb_start(struct ifnet *ifp);
 #endif

Modified: stable/8/sys/dev/cxgb/cxgb_main.c
==
--- stable/8/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:17:43 2012
(r231597)
+++ stable/8/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:18:08 2012
(r231598)
@@ -227,14 +227,6 @@ TUNABLE_INT(hw.cxgb.use_16k_clusters, 
 SYSCTL_INT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN,
 cxgb_use_16k_clusters, 0, use 16kB clusters for the jumbo queue );
 
-/*
- * Tune the size of the output queue.
- */
-int cxgb_snd_queue_len = IFQ_MAXLEN;
-TUNABLE_INT(hw.cxgb.snd_queue_len, cxgb_snd_queue_len);
-SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN,
-cxgb_snd_queue_len, 0, send queue size );
-
 static int nfilters = -1;
 TUNABLE_INT(hw.cxgb.nfilters, nfilters);
 SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN,
@@ -1019,11 +1011,8 @@ cxgb_port_attach(device_t dev)
ifp-if_softc = p;
ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp-if_ioctl = cxgb_ioctl;
-   ifp-if_start = cxgb_start;
-
-   ifp-if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen);
-   IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
-   IFQ_SET_READY(ifp-if_snd);
+   ifp-if_transmit = cxgb_transmit;
+   ifp-if_qflush = cxgb_qflush;
 
ifp-if_capabilities = CXGB_CAP;
ifp-if_capenable = CXGB_CAP_ENABLE;
@@ -1039,8 +1028,6 @@ cxgb_port_attach(device_t dev)
}
 
ether_ifattach(ifp, p-hw_addr);
-   ifp-if_transmit = cxgb_transmit;
-   ifp-if_qflush = cxgb_qflush;
 
 #ifdef DEFAULT_JUMBO
if (sc-params.nports = 2)

Modified: stable/8/sys/dev/cxgb/cxgb_sge.c
==
--- stable/8/sys/dev/cxgb/cxgb_sge.cMon Feb 13 19:17:43 2012
(r231597)
+++ stable/8/sys/dev/cxgb/cxgb_sge.cMon Feb 13 19:18:08 2012
(r231598)
@@ -1767,19 +1767,6 @@ cxgb_transmit(struct ifnet *ifp, struct 
error = drbr_enqueue(ifp, qs-txq[TXQ_ETH].txq_mr, m);
return (error);
 }
-void
-cxgb_start(struct ifnet *ifp)
-{
-   struct port_info *pi = ifp-if_softc;
-   struct sge_qset *qs = pi-adapter-sge.qs[pi-first_qset];
-   
-   if (!pi-link_config.link_ok)
-   return;
-
-   TXQ_LOCK(qs);
-   cxgb_start_locked(qs);
-   TXQ_UNLOCK(qs);
-}
 
 void
 cxgb_qflush(struct ifnet *ifp)

Modified: stable/8/sys/dev/cxgbe/t4_main.c
==
--- stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:17:43 2012
(r231597)
+++ stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:18:08 2012
(r231598)
@@ -112,7 +112,6 @@ static struct cdevsw t4_cdevsw = {
 /* ifnet + media interface */
 static void cxgbe_init(void *);
 static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t);
-static void cxgbe_start(struct ifnet *);
 static int cxgbe_transmit(struct ifnet *, struct mbuf *);
 static void cxgbe_qflush(struct ifnet *);
 static int cxgbe_media_change(struct ifnet *);
@@ -829,14 +828,9 @@ cxgbe_attach(device_t dev)
 
ifp-if_init = cxgbe_init;
ifp-if_ioctl = cxgbe_ioctl;
-   ifp-if_start = cxgbe_start;
ifp-if_transmit = cxgbe_transmit;
ifp-if_qflush = cxgbe_qflush;
 
-   ifp-if_snd.ifq_drv_maxlen = 1024;
-   IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
-   IFQ_SET_READY(ifp-if_snd);
-
ifp-if_capabilities = T4_CAP;
 #ifndef TCP_OFFLOAD_DISABLE
if (is_offload(pi-adapter))
@@ -1095,21 +1089,6 @@ fail:
return (rc);
 }
 
-static void
-cxgbe_start(struct ifnet *ifp)
-{
-   struct port_info *pi = ifp-if_softc;
-   struct sge_txq *txq;
-   int i;
-
-   for_each_txq(pi, i, txq) {
-   if (TXQ_TRYLOCK(txq)) {
-   txq_start(ifp, txq);
-   TXQ_UNLOCK(txq);
-   }
-   }
-}
-
 static int
 cxgbe_transmit(struct ifnet *ifp, struct mbuf *m)
 {

svn commit: r231599 - stable/9/sys/dev/cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:25:37 2012
New Revision: 231599
URL: http://svn.freebsd.org/changeset/base/231599

Log:
  MFC r231120:
  Acquire the adapter lock before updating fields of the filter structure.

Modified:
  stable/9/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==
--- stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:18:08 2012
(r231598)
+++ stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:25:37 2012
(r231599)
@@ -4839,22 +4839,22 @@ filter_rpl(struct sge_iq *iq, const stru
unsigned int rc = G_COOKIE(rpl-cookie);
struct filter_entry *f = sc-tids.ftid_tab[idx];
 
+   ADAPTER_LOCK(sc);
if (rc == FW_FILTER_WR_FLT_ADDED) {
f-smtidx = (be64toh(rpl-oldval)  24)  0xff;
f-pending = 0;  /* asynchronous setup completed */
f-valid = 1;
-   return (0);
-   }
+   } else {
+   if (rc != FW_FILTER_WR_FLT_DELETED) {
+   /* Add or delete failed, display an error */
+   log(LOG_ERR,
+   filter %u setup failed with error %u\n,
+   idx, rc);
+   }
 
-   if (rc != FW_FILTER_WR_FLT_DELETED) {
-   /* Add or delete failed, need to display an error */
-   device_printf(sc-dev,
-   filter %u setup failed with error %u\n, idx, rc);
+   clear_filter(f);
+   sc-tids.ftids_in_use--;
}
-
-   clear_filter(f);
-   ADAPTER_LOCK(sc);
-   sc-tids.ftids_in_use--;
ADAPTER_UNLOCK(sc);
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231600 - stable/8/sys/dev/cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:25:58 2012
New Revision: 231600
URL: http://svn.freebsd.org/changeset/base/231600

Log:
  MFC r231120:
  Acquire the adapter lock before updating fields of the filter structure.

Modified:
  stable/8/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/cxgbe/t4_main.c
==
--- stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:25:37 2012
(r231599)
+++ stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:25:58 2012
(r231600)
@@ -4839,22 +4839,22 @@ filter_rpl(struct sge_iq *iq, const stru
unsigned int rc = G_COOKIE(rpl-cookie);
struct filter_entry *f = sc-tids.ftid_tab[idx];
 
+   ADAPTER_LOCK(sc);
if (rc == FW_FILTER_WR_FLT_ADDED) {
f-smtidx = (be64toh(rpl-oldval)  24)  0xff;
f-pending = 0;  /* asynchronous setup completed */
f-valid = 1;
-   return (0);
-   }
+   } else {
+   if (rc != FW_FILTER_WR_FLT_DELETED) {
+   /* Add or delete failed, display an error */
+   log(LOG_ERR,
+   filter %u setup failed with error %u\n,
+   idx, rc);
+   }
 
-   if (rc != FW_FILTER_WR_FLT_DELETED) {
-   /* Add or delete failed, need to display an error */
-   device_printf(sc-dev,
-   filter %u setup failed with error %u\n, idx, rc);
+   clear_filter(f);
+   sc-tids.ftids_in_use--;
}
-
-   clear_filter(f);
-   ADAPTER_LOCK(sc);
-   sc-tids.ftids_in_use--;
ADAPTER_UNLOCK(sc);
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231601 - stable/9/sys/dev/cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:31:16 2012
New Revision: 231601
URL: http://svn.freebsd.org/changeset/base/231601

Log:
  MFC r231172:
  Program the MAC exact match table in batches of 7 addresses at
  a time when possible.  This is more efficient than one at a time.

Modified:
  stable/9/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgbe/t4_main.c
==
--- stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:25:58 2012
(r231600)
+++ stable/9/sys/dev/cxgbe/t4_main.cMon Feb 13 19:31:16 2012
(r231601)
@@ -2013,6 +2013,8 @@ build_medialist(struct port_info *pi)
PORT_UNLOCK(pi);
 }
 
+#define FW_MAC_EXACT_CHUNK 7
+
 /*
  * Program the port's XGMAC based on parameters in ifnet.  The caller also
  * indicates which parameters should be programmed (the rest are left alone).
@@ -2064,28 +2066,57 @@ update_mac_settings(struct port_info *pi
}
 
if (flags  XGMAC_MCADDRS) {
-   const uint8_t *mcaddr;
+   const uint8_t *mcaddr[FW_MAC_EXACT_CHUNK];
int del = 1;
uint64_t hash = 0;
struct ifmultiaddr *ifma;
+   int i = 0, j;
 
if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) {
-   if (ifma-ifma_addr-sa_family != AF_LINK)
+   if (ifma-ifma_addr-sa_family == AF_LINK)
continue;
-   mcaddr = LLADDR((struct sockaddr_dl *)ifma-ifma_addr);
+   mcaddr[i++] =
+   LLADDR((struct sockaddr_dl *)ifma-ifma_addr);
 
-   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid, del, 1,
-   mcaddr, NULL, hash, 0);
+   if (i == FW_MAC_EXACT_CHUNK) {
+   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid,
+   del, i, mcaddr, NULL, hash, 0);
+   if (rc  0) {
+   rc = -rc;
+   for (j = 0; j  i; j++) {
+   if_printf(ifp,
+   failed to add mc address
+%02x:%02x:%02x:
+   %02x:%02x:%02x rc=%d\n,
+   mcaddr[j][0], mcaddr[j][1],
+   mcaddr[j][2], mcaddr[j][3],
+   mcaddr[j][4], mcaddr[j][5],
+   rc);
+   }
+   goto mcfail;
+   }
+   del = 0;
+   i = 0;
+   }
+   }
+   if (i  0) {
+   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid,
+   del, i, mcaddr, NULL, hash, 0);
if (rc  0) {
rc = -rc;
-   if_printf(ifp, failed to add mc address
-%02x:%02x:%02x:%02x:%02x:%02x rc=%d\n,
-   mcaddr[0], mcaddr[1], mcaddr[2], mcaddr[3],
-   mcaddr[4], mcaddr[5], rc);
+   for (j = 0; j  i; j++) {
+   if_printf(ifp,
+   failed to add mc address
+%02x:%02x:%02x:
+   %02x:%02x:%02x rc=%d\n,
+   mcaddr[j][0], mcaddr[j][1],
+   mcaddr[j][2], mcaddr[j][3],
+   mcaddr[j][4], mcaddr[j][5],
+   rc);
+   }
goto mcfail;
}
-   del = 0;
}
 
rc = -t4_set_addr_hash(sc, sc-mbox, pi-viid, 0, hash, 0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231602 - stable/8/sys/dev/cxgbe

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:31:32 2012
New Revision: 231602
URL: http://svn.freebsd.org/changeset/base/231602

Log:
  MFC r231172:
  Program the MAC exact match table in batches of 7 addresses at
  a time when possible.  This is more efficient than one at a time.

Modified:
  stable/8/sys/dev/cxgbe/t4_main.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/cxgbe/t4_main.c
==
--- stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:31:16 2012
(r231601)
+++ stable/8/sys/dev/cxgbe/t4_main.cMon Feb 13 19:31:32 2012
(r231602)
@@ -2013,6 +2013,8 @@ build_medialist(struct port_info *pi)
PORT_UNLOCK(pi);
 }
 
+#define FW_MAC_EXACT_CHUNK 7
+
 /*
  * Program the port's XGMAC based on parameters in ifnet.  The caller also
  * indicates which parameters should be programmed (the rest are left alone).
@@ -2064,28 +2066,57 @@ update_mac_settings(struct port_info *pi
}
 
if (flags  XGMAC_MCADDRS) {
-   const uint8_t *mcaddr;
+   const uint8_t *mcaddr[FW_MAC_EXACT_CHUNK];
int del = 1;
uint64_t hash = 0;
struct ifmultiaddr *ifma;
+   int i = 0, j;
 
if_maddr_rlock(ifp);
TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) {
-   if (ifma-ifma_addr-sa_family != AF_LINK)
+   if (ifma-ifma_addr-sa_family == AF_LINK)
continue;
-   mcaddr = LLADDR((struct sockaddr_dl *)ifma-ifma_addr);
+   mcaddr[i++] =
+   LLADDR((struct sockaddr_dl *)ifma-ifma_addr);
 
-   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid, del, 1,
-   mcaddr, NULL, hash, 0);
+   if (i == FW_MAC_EXACT_CHUNK) {
+   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid,
+   del, i, mcaddr, NULL, hash, 0);
+   if (rc  0) {
+   rc = -rc;
+   for (j = 0; j  i; j++) {
+   if_printf(ifp,
+   failed to add mc address
+%02x:%02x:%02x:
+   %02x:%02x:%02x rc=%d\n,
+   mcaddr[j][0], mcaddr[j][1],
+   mcaddr[j][2], mcaddr[j][3],
+   mcaddr[j][4], mcaddr[j][5],
+   rc);
+   }
+   goto mcfail;
+   }
+   del = 0;
+   i = 0;
+   }
+   }
+   if (i  0) {
+   rc = t4_alloc_mac_filt(sc, sc-mbox, pi-viid,
+   del, i, mcaddr, NULL, hash, 0);
if (rc  0) {
rc = -rc;
-   if_printf(ifp, failed to add mc address
-%02x:%02x:%02x:%02x:%02x:%02x rc=%d\n,
-   mcaddr[0], mcaddr[1], mcaddr[2], mcaddr[3],
-   mcaddr[4], mcaddr[5], rc);
+   for (j = 0; j  i; j++) {
+   if_printf(ifp,
+   failed to add mc address
+%02x:%02x:%02x:
+   %02x:%02x:%02x rc=%d\n,
+   mcaddr[j][0], mcaddr[j][1],
+   mcaddr[j][2], mcaddr[j][3],
+   mcaddr[j][4], mcaddr[j][5],
+   rc);
+   }
goto mcfail;
}
-   del = 0;
}
 
rc = -t4_set_addr_hash(sc, sc-mbox, pi-viid, 0, hash, 0);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231603 - head/sys/dev/oce

2012-02-13 Thread John Baldwin
Author: jhb
Date: Mon Feb 13 19:35:35 2012
New Revision: 231603
URL: http://svn.freebsd.org/changeset/base/231603

Log:
  Use if_maddr_*lock() routines to lock the per-interface multicast
  address list rather than manipulating the lock directly.

Modified:
  head/sys/dev/oce/oce_hw.c

Modified: head/sys/dev/oce/oce_hw.c
==
--- head/sys/dev/oce/oce_hw.c   Mon Feb 13 19:31:32 2012(r231602)
+++ head/sys/dev/oce/oce_hw.c   Mon Feb 13 19:35:35 2012(r231603)
@@ -558,7 +558,7 @@ oce_hw_update_multicast(POCE_SOFTC sc)
bzero(req, sizeof(struct mbx_set_common_iface_multicast));
 
 #if __FreeBSD_version  80
-   IF_ADDR_RLOCK(ifp);
+   if_maddr_rlock(ifp);
 #endif
TAILQ_FOREACH(ifma, ifp-if_multiaddrs, ifma_link) {
if (ifma-ifma_addr-sa_family != AF_LINK)
@@ -578,7 +578,7 @@ oce_hw_update_multicast(POCE_SOFTC sc)
req-params.req.num_mac = req-params.req.num_mac + 1;
}
 #if __FreeBSD_version  80
-   IF_ADDR_RUNLOCK(ifp);
+   if_maddr_runlock(ifp);
 #endif
req-params.req.if_id = sc-if_id;
rc = oce_update_multicast(sc, dma);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231604 - stable/9/sys/dev/cxgb

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:35:38 2012
New Revision: 231604
URL: http://svn.freebsd.org/changeset/base/231604

Log:
  MFC r231175:
  Allocate the BAR for userspace doorbells after the is_offload check
  is functional.

Modified:
  stable/9/sys/dev/cxgb/cxgb_main.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgb/cxgb_main.c
==
--- stable/9/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:35:35 2012
(r231603)
+++ stable/9/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:35:38 2012
(r231604)
@@ -473,15 +473,6 @@ cxgb_controller_attach(device_t dev)
device_printf(dev, Cannot allocate BAR region 0\n);
return (ENXIO);
}
-   sc-udbs_rid = PCIR_BAR(2);
-   sc-udbs_res = NULL;
-   if (is_offload(sc) 
-   ((sc-udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-  sc-udbs_rid, RF_ACTIVE)) == NULL)) {
-   device_printf(dev, Cannot allocate BAR region 1\n);
-   error = ENXIO;
-   goto out;
-   }
 
snprintf(sc-lockbuf, ADAPTER_LOCK_NAME_LEN, cxgb controller lock %d,
device_get_unit(dev));
@@ -510,6 +501,17 @@ cxgb_controller_attach(device_t dev)
error = ENODEV;
goto out;
}
+
+   sc-udbs_rid = PCIR_BAR(2);
+   sc-udbs_res = NULL;
+   if (is_offload(sc) 
+   ((sc-udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+  sc-udbs_rid, RF_ACTIVE)) == NULL)) {
+   device_printf(dev, Cannot allocate BAR region 1\n);
+   error = ENXIO;
+   goto out;
+   }
+
 /* Allocate the BAR for doing MSI-X.  If it succeeds, try to allocate
 * enough messages for the queue sets.  If that fails, try falling
 * back to MSI.  If that fails, then try falling back to the legacy
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231605 - stable/8/sys/dev/cxgb

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:36:00 2012
New Revision: 231605
URL: http://svn.freebsd.org/changeset/base/231605

Log:
  MFC r231175:
  Allocate the BAR for userspace doorbells after the is_offload check
  is functional.

Modified:
  stable/8/sys/dev/cxgb/cxgb_main.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/cxgb/cxgb_main.c
==
--- stable/8/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:35:38 2012
(r231604)
+++ stable/8/sys/dev/cxgb/cxgb_main.c   Mon Feb 13 19:36:00 2012
(r231605)
@@ -473,15 +473,6 @@ cxgb_controller_attach(device_t dev)
device_printf(dev, Cannot allocate BAR region 0\n);
return (ENXIO);
}
-   sc-udbs_rid = PCIR_BAR(2);
-   sc-udbs_res = NULL;
-   if (is_offload(sc) 
-   ((sc-udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
-  sc-udbs_rid, RF_ACTIVE)) == NULL)) {
-   device_printf(dev, Cannot allocate BAR region 1\n);
-   error = ENXIO;
-   goto out;
-   }
 
snprintf(sc-lockbuf, ADAPTER_LOCK_NAME_LEN, cxgb controller lock %d,
device_get_unit(dev));
@@ -510,6 +501,17 @@ cxgb_controller_attach(device_t dev)
error = ENODEV;
goto out;
}
+
+   sc-udbs_rid = PCIR_BAR(2);
+   sc-udbs_res = NULL;
+   if (is_offload(sc) 
+   ((sc-udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
+  sc-udbs_rid, RF_ACTIVE)) == NULL)) {
+   device_printf(dev, Cannot allocate BAR region 1\n);
+   error = ENXIO;
+   goto out;
+   }
+
 /* Allocate the BAR for doing MSI-X.  If it succeeds, try to allocate
 * enough messages for the queue sets.  If that fails, try falling
 * back to MSI.  If that fails, then try falling back to the legacy
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231606 - stable/9/release/doc/share/misc

2012-02-13 Thread John Baldwin
Author: jhb
Date: Mon Feb 13 19:36:09 2012
New Revision: 231606
URL: http://svn.freebsd.org/changeset/base/231606

Log:
  MFC 230332:
  Add support for the Em command.  This restores a missing 'not' in the
  description of snd_emu10kx(4).

Modified:
  stable/9/release/doc/share/misc/man2hwnotes.pl
Directory Properties:
  stable/9/release/   (props changed)
  stable/9/release/doc/en_US.ISO8859-1/hardware/   (props changed)

Modified: stable/9/release/doc/share/misc/man2hwnotes.pl
==
--- stable/9/release/doc/share/misc/man2hwnotes.pl  Mon Feb 13 19:36:00 
2012(r231605)
+++ stable/9/release/doc/share/misc/man2hwnotes.pl  Mon Feb 13 19:36:09 
2012(r231606)
@@ -324,6 +324,11 @@ sub parse {
} elsif (/^Fx/) {
dlog(3, Got Fx command);
parabuf_addline(\%mdocvars, FreeBSD);
+   } elsif (/^Em (.+)$/) {
+   my ($txt, $punct_str) = split_punct_chars($1);
+
+   parabuf_addline(\%mdocvars,
+   
normalize(emphasis$txt/emphasis$punct_str));
} else {
# Ignore all other commands.
dlog(3, Ignoring unknown command $cmd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231607 - stable/9/sys/dev/cxgbe/common

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:41:01 2012
New Revision: 231607
URL: http://svn.freebsd.org/changeset/base/231607

Log:
  MFC r231592:
  Use the non-sleeping variang of t4_wr_mbox in code that can be called
  with locks held.

Modified:
  stable/9/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/9/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 19:36:09 2012
(r231606)
+++ stable/9/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 19:41:01 2012
(r231607)
@@ -4314,7 +4314,7 @@ int t4_change_mac(struct adapter *adap, 
V_FW_VI_MAC_CMD_IDX(idx));
memcpy(p-macaddr, addr, sizeof(p-macaddr));
 
-   ret = t4_wr_mbox(adap, mbox, c, sizeof(c), c);
+   ret = t4_wr_mbox_ns(adap, mbox, c, sizeof(c), c);
if (ret == 0) {
ret = G_FW_VI_MAC_CMD_IDX(ntohs(p-valid_to_idx));
if (ret = FW_CLS_TCAM_NUM_ENTRIES)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231608 - stable/8/sys/dev/cxgbe/common

2012-02-13 Thread Navdeep Parhar
Author: np
Date: Mon Feb 13 19:41:31 2012
New Revision: 231608
URL: http://svn.freebsd.org/changeset/base/231608

Log:
  MFC r231592:
  Use the non-sleeping variang of t4_wr_mbox in code that can be called
  with locks held.

Modified:
  stable/8/sys/dev/cxgbe/common/t4_hw.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/cxgbe/common/t4_hw.c
==
--- stable/8/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 19:41:01 2012
(r231607)
+++ stable/8/sys/dev/cxgbe/common/t4_hw.c   Mon Feb 13 19:41:31 2012
(r231608)
@@ -4314,7 +4314,7 @@ int t4_change_mac(struct adapter *adap, 
V_FW_VI_MAC_CMD_IDX(idx));
memcpy(p-macaddr, addr, sizeof(p-macaddr));
 
-   ret = t4_wr_mbox(adap, mbox, c, sizeof(c), c);
+   ret = t4_wr_mbox_ns(adap, mbox, c, sizeof(c), c);
if (ret == 0) {
ret = G_FW_VI_MAC_CMD_IDX(ntohs(p-valid_to_idx));
if (ret = FW_CLS_TCAM_NUM_ENTRIES)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231609 - in stable/8/release: doc/share/misc picobsd/floppy.tree/sbin

2012-02-13 Thread John Baldwin
Author: jhb
Date: Mon Feb 13 19:49:45 2012
New Revision: 231609
URL: http://svn.freebsd.org/changeset/base/231609

Log:
  MFC 230332:
  Add support for the Em command.  This restores a missing 'not' in the
  description of snd_emu10kx(4).

Modified:
  stable/8/release/doc/share/misc/man2hwnotes.pl
Directory Properties:
  stable/8/release/   (props changed)
  stable/8/release/doc/en_US.ISO8859-1/hardware/   (props changed)
  stable/8/release/picobsd/   (props changed)
  stable/8/release/picobsd/floppy.tree/sbin/   (props changed)
  stable/8/release/picobsd/floppy.tree/sbin/dhclient-script   (props changed)
  stable/8/release/picobsd/qemu/   (props changed)
  stable/8/release/picobsd/tinyware/login/   (props changed)
  stable/8/release/powerpc/   (props changed)

Modified: stable/8/release/doc/share/misc/man2hwnotes.pl
==
--- stable/8/release/doc/share/misc/man2hwnotes.pl  Mon Feb 13 19:41:31 
2012(r231608)
+++ stable/8/release/doc/share/misc/man2hwnotes.pl  Mon Feb 13 19:49:45 
2012(r231609)
@@ -320,6 +320,11 @@ sub parse {
} elsif (/^Fx/) {
dlog(3, Got Fx command);
parabuf_addline(\%mdocvars, FreeBSD);
+   } elsif (/^Em (.+)$/) {
+   my ($txt, $punct_str) = split_punct_chars($1);
+
+   parabuf_addline(\%mdocvars,
+   
normalize(emphasis$txt/emphasis$punct_str));
} else {
# Ignore all other commands.
dlog(3, Ignoring unknown command $cmd);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231610 - stable/9/sys/dev/pci

2012-02-13 Thread John Baldwin
Author: jhb
Date: Mon Feb 13 19:51:59 2012
New Revision: 231610
URL: http://svn.freebsd.org/changeset/base/231610

Log:
  MFC 230340:
  Properly return success once a matching VPD entry is found in
  pci_get_vpd_readonly_method().  Previously the loop was always running
  to completion and falling through to failing with ENXIO.

Modified:
  stable/9/sys/dev/pci/pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==
--- stable/9/sys/dev/pci/pci.c  Mon Feb 13 19:49:45 2012(r231609)
+++ stable/9/sys/dev/pci/pci.c  Mon Feb 13 19:51:59 2012(r231610)
@@ -1136,11 +1136,9 @@ pci_get_vpd_readonly_method(device_t dev
if (memcmp(kw, cfg-vpd.vpd_ros[i].keyword,
sizeof(cfg-vpd.vpd_ros[i].keyword)) == 0) {
*vptr = cfg-vpd.vpd_ros[i].value;
+   return (0);
}
 
-   if (i != cfg-vpd.vpd_rocnt)
-   return (0);
-
*vptr = NULL;
return (ENXIO);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231611 - stable/8/sys/dev/pci

2012-02-13 Thread John Baldwin
Author: jhb
Date: Mon Feb 13 19:52:18 2012
New Revision: 231611
URL: http://svn.freebsd.org/changeset/base/231611

Log:
  MFC 230340:
  Properly return success once a matching VPD entry is found in
  pci_get_vpd_readonly_method().  Previously the loop was always running
  to completion and falling through to failing with ENXIO.

Modified:
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==
--- stable/8/sys/dev/pci/pci.c  Mon Feb 13 19:51:59 2012(r231610)
+++ stable/8/sys/dev/pci/pci.c  Mon Feb 13 19:52:18 2012(r231611)
@@ -1076,11 +1076,9 @@ pci_get_vpd_readonly_method(device_t dev
if (memcmp(kw, cfg-vpd.vpd_ros[i].keyword,
sizeof(cfg-vpd.vpd_ros[i].keyword)) == 0) {
*vptr = cfg-vpd.vpd_ros[i].value;
+   return (0);
}
 
-   if (i != cfg-vpd.vpd_rocnt)
-   return (0);
-
*vptr = NULL;
return (ENXIO);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231612 - stable/9/usr.bin/rpcgen

2012-02-13 Thread Dimitry Andric
Author: dim
Date: Mon Feb 13 20:59:20 2012
New Revision: 231612
URL: http://svn.freebsd.org/changeset/base/231612

Log:
  MFC r231079:
  
Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C
preprocessor to run.  Previously, it always ran /usr/bin/cpp, unless you
used the -Y option, and even then you could not set the basename.  It
also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this
is obsolete, and has been removed.
  
Note that setting RPCGEN_CPP to a command with arguments is supported,
though the command line parsing is simplistic.  However, setting it to
e.g. gcc46 -E or clang -E will lead to problems, because both gcc
and clang in -E mode will consider files with unknown extensions (such
as .x) as object files, and attempt to link them.
  
This could be worked around by also adding -x c, but it is much safer
to set RPCGEN_CPP to e.g. cpp46 or clang-cpp instead.
  
  MFC r231080:
  
Amend r231079 by properly shifting up the existing arguments in
rpc_main.c's insarg() function.  I had forgotten to put this in my patch
queue, sorry.
  
Pointy hat to:  me
  
  MFC r231101:
  
In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so
rpcgen will search the current PATH for the preprocessor.  This makes it
possible to run a preprocessor built during the cross-tools stage of
buildworld.

Modified:
  stable/9/usr.bin/rpcgen/rpc_main.c
  stable/9/usr.bin/rpcgen/rpcgen.1
Directory Properties:
  stable/9/usr.bin/rpcgen/   (props changed)

Modified: stable/9/usr.bin/rpcgen/rpc_main.c
==
--- stable/9/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 19:52:18 2012
(r231611)
+++ stable/9/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 20:59:20 2012
(r231612)
@@ -79,13 +79,8 @@ static void s_output(int, const char **,
 #defineEXTEND  1   /* alias for TRUE */
 #defineDONT_EXTEND 0   /* alias for FALSE */
 
-#defineSVR4_CPP /usr/ccs/lib/cpp
-#define SUNOS_CPP /usr/bin/cpp
-
-static int cppDefined = 0; /* explicit path for C preprocessor */
-
 static const char *svcclosetime = 120;
-static const char *CPP = SVR4_CPP;
+static const char *CPP = NULL;
 static const char CPPFLAGS[] = -C;
 static char pathbuf[MAXPATHLEN + 1];
 static const char *allv[] = {
@@ -101,7 +96,7 @@ static int allnc = sizeof (allnv)/sizeof
  * machinations for handling expanding argument list
  */
 static void addarg(const char *);  /* add another argument to the list */
-static void putarg(int, const char *); /* put argument at specified location */
+static void insarg(int, const char *); /* insert arg at specified location */
 static void clear_args(void);  /* clear argument list */
 static void checkfiles(const char *, const char *);
/* check if out file already exists */
@@ -109,7 +104,7 @@ static void checkfiles(const char *, con
 
 
 #defineARGLISTLEN  20
-#defineFIXEDARGS   2
+#defineFIXEDARGS   0
 
 static char *arglist[ARGLISTLEN];
 static int argcount = FIXEDARGS;
@@ -292,24 +287,29 @@ clear_args(void)
argcount = FIXEDARGS;
 }
 
-/* make sure that a CPP exists */
+/* prepend C-preprocessor and flags before arguments */
 static void
-find_cpp(void)
+prepend_cpp(void)
 {
-   struct stat buf;
-
-   if (stat(CPP, buf)  0)  { /* SVR4 or explicit cpp does not exist */
-   if (cppDefined) {
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   } else {/* try the other one */
-   CPP = SUNOS_CPP;
-   if (stat(CPP, buf)  0) { /* can't find any cpp */
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   }
+   int idx = 1;
+   const char *var;
+   char *dupvar, *s, *t;
+
+   if (CPP != NULL)
+   insarg(0, CPP);
+   else if ((var = getenv(RPCGEN_CPP)) == NULL)
+   insarg(0, /usr/bin/cpp);
+   else {
+   /* Parse command line in a rudimentary way */
+   dupvar = xstrdup(var);
+   for (s = dupvar, idx = 0; (t = strsep(s,  \t)) != NULL; ) {
+   if (t[0])
+   insarg(idx++, t);
}
+   free(dupvar);
}
+
+   insarg(idx, CPPFLAGS);
 }
 
 /*
@@ -324,9 +324,7 @@ open_input(const char *infile, const cha
(void) pipe(pd);
switch (childpid = fork()) {
case 0:
-   find_cpp();
-   putarg(0, CPP);
-   putarg(1, CPPFLAGS);
+   prepend_cpp();
addarg(define);
if (infile)
addarg(infile);
@@ -334,8 +332,8 @@ 

svn commit: r231613 - stable/8/usr.bin/rpcgen

2012-02-13 Thread Dimitry Andric
Author: dim
Date: Mon Feb 13 20:59:58 2012
New Revision: 231613
URL: http://svn.freebsd.org/changeset/base/231613

Log:
  MFC r231079:
  
Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C
preprocessor to run.  Previously, it always ran /usr/bin/cpp, unless you
used the -Y option, and even then you could not set the basename.  It
also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this
is obsolete, and has been removed.
  
Note that setting RPCGEN_CPP to a command with arguments is supported,
though the command line parsing is simplistic.  However, setting it to
e.g. gcc46 -E or clang -E will lead to problems, because both gcc
and clang in -E mode will consider files with unknown extensions (such
as .x) as object files, and attempt to link them.
  
This could be worked around by also adding -x c, but it is much safer
to set RPCGEN_CPP to e.g. cpp46 or clang-cpp instead.
  
  MFC r231080:
  
Amend r231079 by properly shifting up the existing arguments in
rpc_main.c's insarg() function.  I had forgotten to put this in my patch
queue, sorry.
  
Pointy hat to:  me
  
  MFC r231101:
  
In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so
rpcgen will search the current PATH for the preprocessor.  This makes it
possible to run a preprocessor built during the cross-tools stage of
buildworld.

Modified:
  stable/8/usr.bin/rpcgen/rpc_main.c
  stable/8/usr.bin/rpcgen/rpcgen.1
Directory Properties:
  stable/8/usr.bin/rpcgen/   (props changed)

Modified: stable/8/usr.bin/rpcgen/rpc_main.c
==
--- stable/8/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 20:59:20 2012
(r231612)
+++ stable/8/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 20:59:58 2012
(r231613)
@@ -79,13 +79,8 @@ static void s_output(int, const char **,
 #defineEXTEND  1   /* alias for TRUE */
 #defineDONT_EXTEND 0   /* alias for FALSE */
 
-#defineSVR4_CPP /usr/ccs/lib/cpp
-#define SUNOS_CPP /usr/bin/cpp
-
-static int cppDefined = 0; /* explicit path for C preprocessor */
-
 static const char *svcclosetime = 120;
-static const char *CPP = SVR4_CPP;
+static const char *CPP = NULL;
 static const char CPPFLAGS[] = -C;
 static char pathbuf[MAXPATHLEN + 1];
 static const char *allv[] = {
@@ -101,7 +96,7 @@ static int allnc = sizeof (allnv)/sizeof
  * machinations for handling expanding argument list
  */
 static void addarg(const char *);  /* add another argument to the list */
-static void putarg(int, const char *); /* put argument at specified location */
+static void insarg(int, const char *); /* insert arg at specified location */
 static void clear_args(void);  /* clear argument list */
 static void checkfiles(const char *, const char *);
/* check if out file already exists */
@@ -109,7 +104,7 @@ static void checkfiles(const char *, con
 
 
 #defineARGLISTLEN  20
-#defineFIXEDARGS   2
+#defineFIXEDARGS   0
 
 static char *arglist[ARGLISTLEN];
 static int argcount = FIXEDARGS;
@@ -292,24 +287,29 @@ clear_args(void)
argcount = FIXEDARGS;
 }
 
-/* make sure that a CPP exists */
+/* prepend C-preprocessor and flags before arguments */
 static void
-find_cpp(void)
+prepend_cpp(void)
 {
-   struct stat buf;
-
-   if (stat(CPP, buf)  0)  { /* SVR4 or explicit cpp does not exist */
-   if (cppDefined) {
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   } else {/* try the other one */
-   CPP = SUNOS_CPP;
-   if (stat(CPP, buf)  0) { /* can't find any cpp */
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   }
+   int idx = 1;
+   const char *var;
+   char *dupvar, *s, *t;
+
+   if (CPP != NULL)
+   insarg(0, CPP);
+   else if ((var = getenv(RPCGEN_CPP)) == NULL)
+   insarg(0, /usr/bin/cpp);
+   else {
+   /* Parse command line in a rudimentary way */
+   dupvar = xstrdup(var);
+   for (s = dupvar, idx = 0; (t = strsep(s,  \t)) != NULL; ) {
+   if (t[0])
+   insarg(idx++, t);
}
+   free(dupvar);
}
+
+   insarg(idx, CPPFLAGS);
 }
 
 /*
@@ -324,9 +324,7 @@ open_input(const char *infile, const cha
(void) pipe(pd);
switch (childpid = fork()) {
case 0:
-   find_cpp();
-   putarg(0, CPP);
-   putarg(1, CPPFLAGS);
+   prepend_cpp();
addarg(define);
if (infile)
addarg(infile);
@@ -334,8 +332,8 @@ 

svn commit: r231614 - stable/7/usr.bin/rpcgen

2012-02-13 Thread Dimitry Andric
Author: dim
Date: Mon Feb 13 21:07:48 2012
New Revision: 231614
URL: http://svn.freebsd.org/changeset/base/231614

Log:
  MFC r231079:
  
Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C
preprocessor to run.  Previously, it always ran /usr/bin/cpp, unless you
used the -Y option, and even then you could not set the basename.  It
also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this
is obsolete, and has been removed.
  
Note that setting RPCGEN_CPP to a command with arguments is supported,
though the command line parsing is simplistic.  However, setting it to
e.g. gcc46 -E or clang -E will lead to problems, because both gcc
and clang in -E mode will consider files with unknown extensions (such
as .x) as object files, and attempt to link them.
  
This could be worked around by also adding -x c, but it is much safer
to set RPCGEN_CPP to e.g. cpp46 or clang-cpp instead.
  
  MFC r231080:
  
Amend r231079 by properly shifting up the existing arguments in
rpc_main.c's insarg() function.  I had forgotten to put this in my patch
queue, sorry.
  
Pointy hat to:  me
  
  MFC r231101:
  
In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so
rpcgen will search the current PATH for the preprocessor.  This makes it
possible to run a preprocessor built during the cross-tools stage of
buildworld.

Modified:
  stable/7/usr.bin/rpcgen/rpc_main.c
  stable/7/usr.bin/rpcgen/rpcgen.1
Directory Properties:
  stable/7/usr.bin/rpcgen/   (props changed)

Modified: stable/7/usr.bin/rpcgen/rpc_main.c
==
--- stable/7/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 20:59:58 2012
(r231613)
+++ stable/7/usr.bin/rpcgen/rpc_main.c  Mon Feb 13 21:07:48 2012
(r231614)
@@ -79,13 +79,8 @@ static void s_output(int, const char **,
 #defineEXTEND  1   /* alias for TRUE */
 #defineDONT_EXTEND 0   /* alias for FALSE */
 
-#defineSVR4_CPP /usr/ccs/lib/cpp
-#define SUNOS_CPP /usr/bin/cpp
-
-static int cppDefined = 0; /* explicit path for C preprocessor */
-
 static const char *svcclosetime = 120;
-static const char *CPP = SVR4_CPP;
+static const char *CPP = NULL;
 static const char CPPFLAGS[] = -C;
 static char pathbuf[MAXPATHLEN + 1];
 static const char *allv[] = {
@@ -101,7 +96,7 @@ static int allnc = sizeof (allnv)/sizeof
  * machinations for handling expanding argument list
  */
 static void addarg(const char *);  /* add another argument to the list */
-static void putarg(int, const char *); /* put argument at specified location */
+static void insarg(int, const char *); /* insert arg at specified location */
 static void clear_args(void);  /* clear argument list */
 static void checkfiles(const char *, const char *);
/* check if out file already exists */
@@ -109,7 +104,7 @@ static void checkfiles(const char *, con
 
 
 #defineARGLISTLEN  20
-#defineFIXEDARGS   2
+#defineFIXEDARGS   0
 
 static char *arglist[ARGLISTLEN];
 static int argcount = FIXEDARGS;
@@ -292,24 +287,29 @@ clear_args(void)
argcount = FIXEDARGS;
 }
 
-/* make sure that a CPP exists */
+/* prepend C-preprocessor and flags before arguments */
 static void
-find_cpp(void)
+prepend_cpp(void)
 {
-   struct stat buf;
-
-   if (stat(CPP, buf)  0)  { /* SVR4 or explicit cpp does not exist */
-   if (cppDefined) {
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   } else {/* try the other one */
-   CPP = SUNOS_CPP;
-   if (stat(CPP, buf)  0) { /* can't find any cpp */
-   warnx(cannot find C preprocessor: %s, CPP);
-   crash();
-   }
+   int idx = 1;
+   const char *var;
+   char *dupvar, *s, *t;
+
+   if (CPP != NULL)
+   insarg(0, CPP);
+   else if ((var = getenv(RPCGEN_CPP)) == NULL)
+   insarg(0, /usr/bin/cpp);
+   else {
+   /* Parse command line in a rudimentary way */
+   dupvar = xstrdup(var);
+   for (s = dupvar, idx = 0; (t = strsep(s,  \t)) != NULL; ) {
+   if (t[0])
+   insarg(idx++, t);
}
+   free(dupvar);
}
+
+   insarg(idx, CPPFLAGS);
 }
 
 /*
@@ -324,9 +324,7 @@ open_input(const char *infile, const cha
(void) pipe(pd);
switch (childpid = fork()) {
case 0:
-   find_cpp();
-   putarg(0, CPP);
-   putarg(1, CPPFLAGS);
+   prepend_cpp();
addarg(define);
if (infile)
addarg(infile);
@@ -334,8 +332,8 @@ 

svn commit: r231615 - head/share/man/man4

2012-02-13 Thread Christian Brueffer
Author: brueffer
Date: Mon Feb 13 23:02:51 2012
New Revision: 231615
URL: http://svn.freebsd.org/changeset/base/231615

Log:
  Minor cleanup and added missing svn keywords.

Modified:
  head/share/man/man4/isci.4   (contents, props changed)

Modified: head/share/man/man4/isci.4
==
--- head/share/man/man4/isci.4  Mon Feb 13 21:07:48 2012(r231614)
+++ head/share/man/man4/isci.4  Mon Feb 13 23:02:51 2012(r231615)
@@ -57,7 +57,7 @@ The
 .Nm
 driver provides support for Intel C600
 .Tn SAS
-controller.
+controllers.
 .Sh CONFIGURATION
 To force legacy interrupts for all
 .Nm
@@ -77,9 +77,11 @@ hw.isci.debug_level
 variable to a value between 1 and 4 in
 .Xr loader.conf 5 .
 .Pp
-The hardware layer in the isci driver has extensive logging capabilities
-which are disabled by default for performance reasons.  These can be enabled
-by adding
+The hardware layer in the
+.Nm
+driver has extensive logging capabilities
+which are disabled by default for performance reasons.
+These can be enabled by adding
 .Bd -literal -offset indent
 options ISCI_LOGGING
 .Ed
@@ -91,7 +93,7 @@ to the kernel configuration file. 
 .Xr da 4 ,
 .Xr pci 4 ,
 .Xr sa 4 ,
-.Xr scsi 4 .
+.Xr scsi 4
 .Sh HISTORY
 The
 .Nm
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231616 - head/lib/libc/arm/gen

2012-02-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Feb 14 00:12:15 2012
New Revision: 231616
URL: http://svn.freebsd.org/changeset/base/231616

Log:
  Add __aeabi_read_tp function required for thread-local storage
  
  Reviewed by:  cognet

Added:
  head/lib/libc/arm/gen/__aeabi_read_tp.c   (contents, props changed)
Modified:
  head/lib/libc/arm/gen/Makefile.inc

Modified: head/lib/libc/arm/gen/Makefile.inc
==
--- head/lib/libc/arm/gen/Makefile.inc  Mon Feb 13 23:02:51 2012
(r231615)
+++ head/lib/libc/arm/gen/Makefile.inc  Tue Feb 14 00:12:15 2012
(r231616)
@@ -3,4 +3,4 @@
 
 SRCS+= _ctx_start.S _setjmp.S _set_tp.c alloca.S fabs.c \
getcontextx.c infinity.c ldexp.c makecontext.c \
-   setjmp.S signalcontext.c sigsetjmp.S divsi3.S flt_rounds.c
+   __aeabi_read_tp.c setjmp.S signalcontext.c sigsetjmp.S divsi3.S 
flt_rounds.c

Added: head/lib/libc/arm/gen/__aeabi_read_tp.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/arm/gen/__aeabi_read_tp.c Tue Feb 14 00:12:15 2012
(r231616)
@@ -0,0 +1,42 @@
+/*-
+ * Copyright (c) 2012 Oleksandr Tymoshenko
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include sys/types.h
+
+#include machine/sysarch.h
+
+void *
+__aeabi_read_tp()
+{
+   void **_tp = (void **)ARM_TP_ADDRESS;
+
+   return (*_tp);
+}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231617 - head/sys/sys

2012-02-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Feb 14 00:12:55 2012
New Revision: 231617
URL: http://svn.freebsd.org/changeset/base/231617

Log:
  Add ARM relocations types used for thread-local storage
  
  Reviewed by:  cognet

Modified:
  head/sys/sys/elf_common.h

Modified: head/sys/sys/elf_common.h
==
--- head/sys/sys/elf_common.h   Tue Feb 14 00:12:15 2012(r231616)
+++ head/sys/sys/elf_common.h   Tue Feb 14 00:12:55 2012(r231617)
@@ -633,6 +633,10 @@ typedef struct {
 #defineR_ARM_THM_SWI8  14
 #defineR_ARM_XPC25 15
 #defineR_ARM_THM_XPC22 16
+/* TLS relocations */
+#defineR_ARM_TLS_DTPMOD32  17  /* ID of module containing 
symbol */
+#defineR_ARM_TLS_DTPOFF32  18  /* Offset in TLS block */
+#defineR_ARM_TLS_TPOFF32   19  /* Offset in static TLS block */
 #defineR_ARM_COPY  20  /* Copy data from shared 
object. */
 #defineR_ARM_GLOB_DAT  21  /* Set GOT entry to data 
address. */
 #defineR_ARM_JUMP_SLOT 22  /* Set GOT entry to code 
address. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231618 - in head/libexec/rtld-elf: . arm

2012-02-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Feb 14 00:16:34 2012
New Revision: 231618
URL: http://svn.freebsd.org/changeset/base/231618

Log:
  Add thread-local storage support for ARM to rtld-elf
  
  Reviewed by:cognet
  Obtained from:  NetBSD

Modified:
  head/libexec/rtld-elf/arm/reloc.c
  head/libexec/rtld-elf/arm/rtld_machdep.h
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/arm/reloc.c
==
--- head/libexec/rtld-elf/arm/reloc.c   Tue Feb 14 00:12:55 2012
(r231617)
+++ head/libexec/rtld-elf/arm/reloc.c   Tue Feb 14 00:16:34 2012
(r231618)
@@ -10,6 +10,9 @@ __FBSDID($FreeBSD$);
 #include stdlib.h
 #include string.h
 #include unistd.h
+
+#include machine/sysarch.h
+
 #include debug.h
 #include rtld.h
 
@@ -233,6 +236,63 @@ reloc_nonplt_object(Obj_Entry *obj, cons
dbg(COPY (avoid in main));
break;
 
+   case R_ARM_TLS_DTPOFF32:
+   def = find_symdef(symnum, obj, defobj, false, cache,
+   lockstate);
+   if (def == NULL)
+   return -1;
+
+   tmp = (Elf_Addr)(def-st_value);
+   if (__predict_true(RELOC_ALIGNED_P(where)))
+   *where = tmp;
+   else
+   store_ptr(where, tmp);
+
+   dbg(TLS_DTPOFF32 %s in %s -- %p,
+   obj-strtab + obj-symtab[symnum].st_name,
+   obj-path, (void *)tmp);
+
+   break;
+   case R_ARM_TLS_DTPMOD32:
+   def = find_symdef(symnum, obj, defobj, false, cache,
+   lockstate);
+   if (def == NULL)
+   return -1;
+
+   tmp = (Elf_Addr)(defobj-tlsindex);
+   if (__predict_true(RELOC_ALIGNED_P(where)))
+   *where = tmp;
+   else
+   store_ptr(where, tmp);
+
+   dbg(TLS_DTPMOD32 %s in %s -- %p,
+   obj-strtab + obj-symtab[symnum].st_name,
+   obj-path, (void *)tmp);
+
+   break;
+
+   case R_ARM_TLS_TPOFF32:
+   def = find_symdef(symnum, obj, defobj, false, cache,
+   lockstate);
+   if (def == NULL)
+   return -1;
+
+   if (!defobj-tls_done  allocate_tls_offset(obj))
+   return -1;
+
+   /* XXX: FIXME */
+   tmp = (Elf_Addr)def-st_value + defobj-tlsoffset +
+   TLS_TCB_SIZE;
+   if (__predict_true(RELOC_ALIGNED_P(where)))
+   *where = tmp;
+   else
+   store_ptr(where, tmp);
+   dbg(TLS_TPOFF32 %s in %s -- %p,
+   obj-strtab + obj-symtab[symnum].st_name,
+   obj-path, (void *)tmp);
+   break;
+
+
default:
dbg(sym = %lu, type = %lu, offset = %p, 
contents = %p, symbol = %s,
@@ -369,11 +429,26 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr 
 void
 allocate_initial_tls(Obj_Entry *objs)
 {
-   
+   void **_tp = (void **)ARM_TP_ADDRESS;
+
+   /*
+   * Fix the size of the static TLS block by using the maximum
+   * offset allocated so far and adding a bit for dynamic modules to
+   * use.
+   */
+
+   tls_static_space = tls_last_offset + tls_last_size + 
RTLD_STATIC_TLS_EXTRA;
+
+   (*_tp) = (void *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8);
 }
 
 void *
 __tls_get_addr(tls_index* ti)
 {
-   return (NULL);
+   void **_tp = (void **)ARM_TP_ADDRESS;
+   char *p;
+
+   p = tls_get_addr_common((Elf_Addr **)(*_tp), ti-ti_module, 
ti-ti_offset);
+
+   return (p);
 }

Modified: head/libexec/rtld-elf/arm/rtld_machdep.h
==
--- head/libexec/rtld-elf/arm/rtld_machdep.hTue Feb 14 00:12:55 2012
(r231617)
+++ head/libexec/rtld-elf/arm/rtld_machdep.hTue Feb 14 00:16:34 2012
(r231618)
@@ -48,20 +48,20 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, 
 #define call_initfini_pointer(obj, target) \
(((InitFunc)(target))())

+#defineTLS_TCB_SIZE8
 typedef struct {
unsigned long ti_module;
unsigned long ti_offset;
 } tls_index;
 
 #define round(size, align) \
-   (((size) + (align) - 1)  ~((align) - 1))
+(((size) + (align) - 1)  ~((align) - 1))
 #define calculate_first_tls_offset(size, align) \
-   round(size, align) 

svn commit: r231619 - in head/lib/libthr/arch/arm: arm include

2012-02-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Feb 14 00:17:43 2012
New Revision: 231619
URL: http://svn.freebsd.org/changeset/base/231619

Log:
  Add thread-local storage support for arm:
  
  - Switch to Variant I TCB layout
  - Use function from rtld for TCB allocation/deallocation

Modified:
  head/lib/libthr/arch/arm/arm/pthread_md.c
  head/lib/libthr/arch/arm/include/pthread_md.h

Modified: head/lib/libthr/arch/arm/arm/pthread_md.c
==
--- head/lib/libthr/arch/arm/arm/pthread_md.c   Tue Feb 14 00:16:34 2012
(r231618)
+++ head/lib/libthr/arch/arm/arm/pthread_md.c   Tue Feb 14 00:17:43 2012
(r231619)
@@ -37,14 +37,17 @@ _tcb_ctor(struct pthread *thread, int in
 {
struct tcb *tcb;
 
-   tcb = malloc(sizeof(struct tcb));
+   tcb = _rtld_allocate_tls((initial) ? _tcb_get() :  NULL,
+   sizeof(struct tcb), 16);
if (tcb)
tcb-tcb_thread = thread;
+
return (tcb);
 }
 
 void
 _tcb_dtor(struct tcb *tcb)
 {
-   free(tcb);
+
+   _rtld_free_tls(tcb, sizeof(struct tcb), 16);
 }

Modified: head/lib/libthr/arch/arm/include/pthread_md.h
==
--- head/lib/libthr/arch/arm/include/pthread_md.h   Tue Feb 14 00:16:34 
2012(r231618)
+++ head/lib/libthr/arch/arm/include/pthread_md.h   Tue Feb 14 00:17:43 
2012(r231619)
@@ -43,10 +43,8 @@
  * Variant II tcb, first two members are required by rtld.
  */
 struct tcb {
-   struct tcb  *tcb_self;  /* required by rtld */
void*tcb_dtv;   /* required by rtld */
struct pthread  *tcb_thread;/* our hook */
-   void*tcb_spare[1];
 };
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231620 - head/gnu/usr.bin/cc/cc_tools

2012-02-13 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Tue Feb 14 00:18:18 2012
New Revision: 231620
URL: http://svn.freebsd.org/changeset/base/231620

Log:
  Enable TLS support for ARM toolchain
  
  Reviewed by:  cognet

Modified:
  head/gnu/usr.bin/cc/cc_tools/auto-host.h

Modified: head/gnu/usr.bin/cc/cc_tools/auto-host.h
==
--- head/gnu/usr.bin/cc/cc_tools/auto-host.hTue Feb 14 00:17:43 2012
(r231619)
+++ head/gnu/usr.bin/cc/cc_tools/auto-host.hTue Feb 14 00:18:18 2012
(r231620)
@@ -287,10 +287,8 @@
 
 /* Define if your assembler supports thread-local storage. */
 #ifndef USED_FOR_TARGET
-#if !defined(__arm__)
 #define HAVE_AS_TLS 1
 #endif
-#endif
 
 
 /* Define to 1 if you have the `atoll' function. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231621 - head/sys/dev/pci

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 00:18:35 2012
New Revision: 231621
URL: http://svn.freebsd.org/changeset/base/231621

Log:
  - As it turns out, MSI-X is broken for at least LSI SAS1068E when passed
through by VMware so blacklist their PCI-PCI bridge for MSI/MSI-X here.
Note that besides currently there not being a quirk type that disables
MSI-X only and there's no evidence that MSI doesn't work with the VMware
pass-through, it's really questionable whether MSI generally works in
that setup as VMware only mention three know working devices [1, p. 4].
Also not that this quirk entry currently doesn't affect the devices
emulated by VMware in any way as these don't claim support MSI/MSI-X to
begin with. [2]
While at it, make the PCI quirk table const and static.
  - Remove some duplicated empty lines.
  - Use DEVMETHOD_END.
  
  PR:   163812, http://forums.freebsd.org/showthread.php?t=27899 [2]
  Reviewed by:  jhb
  MFC after:3 days

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==
--- head/sys/dev/pci/pci.c  Tue Feb 14 00:18:18 2012(r231620)
+++ head/sys/dev/pci/pci.c  Tue Feb 14 00:18:35 2012(r231621)
@@ -73,7 +73,6 @@ __FBSDID($FreeBSD$);
 #definePCIR_IS_BIOS(cfg, reg)  
\
(((cfg)-hdrtype == PCIM_HDRTYPE_NORMAL  reg == PCIR_BIOS) || \
 ((cfg)-hdrtype == PCIM_HDRTYPE_BRIDGE  reg == PCIR_BIOS_1))
-   
 
 static pci_addr_t  pci_mapbase(uint64_t mapreg);
 static const char  *pci_maptype(uint64_t mapreg);
@@ -171,7 +170,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(pci_msi_count,pci_msi_count_method),
DEVMETHOD(pci_msix_count,   pci_msix_count_method),
 
-   { 0, 0 }
+   DEVMETHOD_END
 };
 
 DEFINE_CLASS_0(pci, pci_driver, pci_methods, 0);
@@ -183,7 +182,6 @@ MODULE_VERSION(pci, 1);
 static char*pci_vendordata;
 static size_t  pci_vendordata_size;
 
-
 struct pci_quirk {
uint32_t devid; /* Vendor/device of the card */
int type;
@@ -194,7 +192,7 @@ struct pci_quirk {
int arg2;
 };
 
-struct pci_quirk pci_quirks[] = {
+static const struct pci_quirk const pci_quirks[] = {
/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */
{ 0x71138086, PCI_QUIRK_MAP_REG,0x90,0 },
{ 0x719b8086, PCI_QUIRK_MAP_REG,0x90,0 },
@@ -227,6 +225,12 @@ struct pci_quirk pci_quirks[] = {
{ 0x74501022, PCI_QUIRK_DISABLE_MSI,0,  0 },
 
/*
+* MSI-X doesn't work with at least LSI SAS1068E passed through by
+* VMware.
+*/
+   { 0x079015ad, PCI_QUIRK_DISABLE_MSI,0,  0 },
+
+   /*
 * Some virtualization environments emulate an older chipset
 * but support MSI just fine.  QEMU uses the Intel 82440.
 */
@@ -724,7 +728,6 @@ pci_read_cap(device_t pcib, pcicfgregs *
}
}
 
-   
 #if defined(__i386__) || defined(__amd64__) || defined(__powerpc__)
/*
 * Enable the MSI mapping window for all HyperTransport
@@ -1873,7 +1876,7 @@ pci_remap_intr_method(device_t bus, devi
 int
 pci_msi_device_blacklisted(device_t dev)
 {
-   struct pci_quirk *q;
+   const struct pci_quirk *q;
 
if (!pci_honor_msi_blacklist)
return (0);
@@ -1893,7 +1896,7 @@ pci_msi_device_blacklisted(device_t dev)
 static int
 pci_msi_vm_chipset(device_t dev)
 {
-   struct pci_quirk *q;
+   const struct pci_quirk *q;
 
for (q = pci_quirks[0]; q-devid; q++) {
if (q-devid == pci_get_devid(dev) 
@@ -3023,7 +3026,7 @@ pci_add_resources(device_t bus, device_t
struct pci_devinfo *dinfo = device_get_ivars(dev);
pcicfgregs *cfg = dinfo-cfg;
struct resource_list *rl = dinfo-resources;
-   struct pci_quirk *q;
+   const struct pci_quirk *q;
int i;
 
/* ATA devices needs special map treatment */
@@ -3864,7 +3867,6 @@ pci_write_ivar(device_t dev, device_t ch
}
 }
 
-
 #include opt_ddb.h
 #ifdef DDB
 #include ddb/ddb.h
@@ -4021,7 +4023,6 @@ out:;
return (res);
 }
 
-
 struct resource *
 pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
   u_long start, u_long end, u_long count, u_int flags)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r231620 - head/gnu/usr.bin/cc/cc_tools

2012-02-13 Thread Marius Strobl
On Tue, Feb 14, 2012 at 12:18:18AM +, Oleksandr Tymoshenko wrote:
 Author: gonzo
 Date: Tue Feb 14 00:18:18 2012
 New Revision: 231620
 URL: http://svn.freebsd.org/changeset/base/231620
 
 Log:
   Enable TLS support for ARM toolchain
   

FYI, for the toolchain TLS support apparently should also be enabled
in gnu/lib/libgomp/config.h and gnu/lib/libstdc++/config.h.

Marius

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231622 - head/sys/dev/re

2012-02-13 Thread Pyun YongHyeon
Author: yongari
Date: Tue Feb 14 00:54:40 2012
New Revision: 231622
URL: http://svn.freebsd.org/changeset/base/231622

Log:
  For RTL8168/8111D controller, make sure to wake PHY from power down
  mode.  Otherwise, PHY access times out under certain conditions.

Modified:
  head/sys/dev/re/if_re.c

Modified: head/sys/dev/re/if_re.c
==
--- head/sys/dev/re/if_re.c Tue Feb 14 00:18:35 2012(r231621)
+++ head/sys/dev/re/if_re.c Tue Feb 14 00:54:40 2012(r231622)
@@ -1433,11 +1433,16 @@ re_attach(device_t dev)
sc-rl_flags |= RL_FLAG_MACSLEEP;
/* FALLTHROUGH */
case RL_HWREV_8168CP:
-   case RL_HWREV_8168D:
sc-rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP |
RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 | RL_FLAG_WOL_MANLINK;
break;
+   case RL_HWREV_8168D:
+   sc-rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM |
+   RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT |
+   RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_JUMBOV2 |
+   RL_FLAG_WOL_MANLINK;
+   break;
case RL_HWREV_8168DP:
sc-rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR |
RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_AUTOPAD |
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231623 - stable/9/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 00:54:50 2012
New Revision: 231623
URL: http://svn.freebsd.org/changeset/base/231623

Log:
  MFC: r231518
  
  Remove extra newlines from panic messages.

Modified:
  stable/9/sys/dev/mpt/mpt.c
  stable/9/sys/dev/mpt/mpt.h
  stable/9/sys/dev/mpt/mpt_cam.c
  stable/9/sys/dev/mpt/mpt_pci.c
  stable/9/sys/dev/mpt/mpt_reg.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/mpt/mpt.c
==
--- stable/9/sys/dev/mpt/mpt.c  Tue Feb 14 00:54:40 2012(r231622)
+++ stable/9/sys/dev/mpt/mpt.c  Tue Feb 14 00:54:50 2012(r231623)
@@ -1053,6 +1053,12 @@ mpt_hard_reset(struct mpt_softc *mpt)
 
mpt_lprt(mpt, MPT_PRT_DEBUG, hard reset\n);
 
+   if (mpt-is_1078) {
+   mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07);
+   DELAY(1000);
+   return;
+   }
+
error = mpt_enable_diag_mode(mpt);
if (error) {
mpt_prt(mpt, WARNING - Could not enter diagnostic mode !\n);
@@ -2451,6 +2457,11 @@ mpt_download_fw(struct mpt_softc *mpt)
uint32_t ext_offset;
uint32_t data;
 
+   if (mpt-pci_pio_reg == NULL) {
+   mpt_prt(mpt, No PIO resource!\n);
+   return (ENXIO);
+   }
+
mpt_prt(mpt, Downloading Firmware - Image Size %d\n,
mpt-fw_image_size);
 

Modified: stable/9/sys/dev/mpt/mpt.h
==
--- stable/9/sys/dev/mpt/mpt.h  Tue Feb 14 00:54:40 2012(r231622)
+++ stable/9/sys/dev/mpt/mpt.h  Tue Feb 14 00:54:50 2012(r231623)
@@ -608,7 +608,7 @@ struct mpt_softc {
 #endif
uint32_tmpt_pers_mask;
uint32_t
-   : 8,
+   : 7,
unit: 8,
ready   : 1,
fw_uploaded : 1,
@@ -625,7 +625,8 @@ struct mpt_softc {
disabled: 1,
is_spi  : 1,
is_sas  : 1,
-   is_fc   : 1;
+   is_fc   : 1,
+   is_1078 : 1;
 
u_int   cfg_role;
u_int   role;   /* role: none, ini, target, both */
@@ -982,12 +983,14 @@ mpt_read(struct mpt_softc *mpt, int offs
 static __inline void
 mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
bus_space_write_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset, val);
 }
 
 static __inline uint32_t
 mpt_pio_read(struct mpt_softc *mpt, int offset)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
return (bus_space_read_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset));
 }
 /*** Reply Frame/Request Management 
***/

Modified: stable/9/sys/dev/mpt/mpt_cam.c
==
--- stable/9/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:54:40 2012
(r231622)
+++ stable/9/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:54:50 2012
(r231623)
@@ -1279,8 +1279,9 @@ mpt_execute_req_a64(void *arg, bus_dma_s
char *mpt_off;
union ccb *ccb;
struct mpt_softc *mpt;
-   int seg, first_lim;
-   uint32_t flags, nxt_off;
+   bus_addr_t chain_list_addr;
+   int first_lim, seg, this_seg_lim;
+   uint32_t addr, cur_off, flags, nxt_off, tf;
void *sglp = NULL;
MSG_REQUEST_HEADER *hdrp;
SGE_SIMPLE64 *se;
@@ -1434,16 +1435,20 @@ bad:
 
se = (SGE_SIMPLE64 *) sglp;
for (seg = 0; seg  first_lim; seg++, se++, dm_segs++) {
-   uint32_t tf;
-
+   tf = flags;
memset(se, 0, sizeof (*se));
+   MPI_pSGE_SET_LENGTH(se, dm_segs-ds_len);
se-Address.Low = htole32(dm_segs-ds_addr  0x);
if (sizeof(bus_addr_t)  4) {
-   se-Address.High =
-   htole32(((uint64_t)dm_segs-ds_addr)  32);
+   addr = ((uint64_t)dm_segs-ds_addr)  32;
+   /* SAS1078 36GB limitation WAR */
+   if (mpt-is_1078 

svn commit: r231624 - stable/8/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 00:54:59 2012
New Revision: 231624
URL: http://svn.freebsd.org/changeset/base/231624

Log:
  MFC: r231518
  
  Remove extra newlines from panic messages.

Modified:
  stable/8/sys/dev/mpt/mpt.c
  stable/8/sys/dev/mpt/mpt.h
  stable/8/sys/dev/mpt/mpt_cam.c
  stable/8/sys/dev/mpt/mpt_pci.c
  stable/8/sys/dev/mpt/mpt_reg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/mpt/mpt.c
==
--- stable/8/sys/dev/mpt/mpt.c  Tue Feb 14 00:54:50 2012(r231623)
+++ stable/8/sys/dev/mpt/mpt.c  Tue Feb 14 00:54:59 2012(r231624)
@@ -1053,6 +1053,12 @@ mpt_hard_reset(struct mpt_softc *mpt)
 
mpt_lprt(mpt, MPT_PRT_DEBUG, hard reset\n);
 
+   if (mpt-is_1078) {
+   mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07);
+   DELAY(1000);
+   return;
+   }
+
error = mpt_enable_diag_mode(mpt);
if (error) {
mpt_prt(mpt, WARNING - Could not enter diagnostic mode !\n);
@@ -2451,6 +2457,11 @@ mpt_download_fw(struct mpt_softc *mpt)
uint32_t ext_offset;
uint32_t data;
 
+   if (mpt-pci_pio_reg == NULL) {
+   mpt_prt(mpt, No PIO resource!\n);
+   return (ENXIO);
+   }
+
mpt_prt(mpt, Downloading Firmware - Image Size %d\n,
mpt-fw_image_size);
 

Modified: stable/8/sys/dev/mpt/mpt.h
==
--- stable/8/sys/dev/mpt/mpt.h  Tue Feb 14 00:54:50 2012(r231623)
+++ stable/8/sys/dev/mpt/mpt.h  Tue Feb 14 00:54:59 2012(r231624)
@@ -608,7 +608,7 @@ struct mpt_softc {
 #endif
uint32_tmpt_pers_mask;
uint32_t
-   : 8,
+   : 7,
unit: 8,
ready   : 1,
fw_uploaded : 1,
@@ -625,7 +625,8 @@ struct mpt_softc {
disabled: 1,
is_spi  : 1,
is_sas  : 1,
-   is_fc   : 1;
+   is_fc   : 1,
+   is_1078 : 1;
 
u_int   cfg_role;
u_int   role;   /* role: none, ini, target, both */
@@ -982,12 +983,14 @@ mpt_read(struct mpt_softc *mpt, int offs
 static __inline void
 mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
bus_space_write_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset, val);
 }
 
 static __inline uint32_t
 mpt_pio_read(struct mpt_softc *mpt, int offset)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
return (bus_space_read_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset));
 }
 /*** Reply Frame/Request Management 
***/

Modified: stable/8/sys/dev/mpt/mpt_cam.c
==
--- stable/8/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:54:50 2012
(r231623)
+++ stable/8/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:54:59 2012
(r231624)
@@ -1279,8 +1279,9 @@ mpt_execute_req_a64(void *arg, bus_dma_s
char *mpt_off;
union ccb *ccb;
struct mpt_softc *mpt;
-   int seg, first_lim;
-   uint32_t flags, nxt_off;
+   bus_addr_t chain_list_addr;
+   int first_lim, seg, this_seg_lim;
+   uint32_t addr, cur_off, flags, nxt_off, tf;
void *sglp = NULL;
MSG_REQUEST_HEADER *hdrp;
SGE_SIMPLE64 *se;
@@ -1434,16 +1435,20 @@ bad:
 
se = (SGE_SIMPLE64 *) sglp;
for (seg = 0; seg  first_lim; seg++, se++, dm_segs++) {
-   uint32_t tf;
-
+   tf = flags;
memset(se, 0, sizeof (*se));
+   MPI_pSGE_SET_LENGTH(se, dm_segs-ds_len);
se-Address.Low = htole32(dm_segs-ds_addr  0x);
if (sizeof(bus_addr_t)  4) {
-   se-Address.High =
-   htole32(((uint64_t)dm_segs-ds_addr)  32);
+   addr = ((uint64_t)dm_segs-ds_addr)  32;
+   /* SAS1078 36GB limitation WAR */
+   if (mpt-is_1078  (((uint64_t)dm_segs-ds_addr +
+   MPI_SGE_LENGTH(se-FlagsLength))  32) == 9) {
+   addr |= (1  31);
+   tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS;
+   }
+   se-Address.High = htole32(addr);
}
-   

svn commit: r231625 - stable/7/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 00:56:01 2012
New Revision: 231625
URL: http://svn.freebsd.org/changeset/base/231625

Log:
  MFC: r231518
  
  Remove extra newlines from panic messages.

Modified:
  stable/7/sys/dev/mpt/mpt.c
  stable/7/sys/dev/mpt/mpt.h
  stable/7/sys/dev/mpt/mpt_cam.c
  stable/7/sys/dev/mpt/mpt_pci.c
  stable/7/sys/dev/mpt/mpt_reg.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/mpt/mpt.c
==
--- stable/7/sys/dev/mpt/mpt.c  Tue Feb 14 00:54:59 2012(r231624)
+++ stable/7/sys/dev/mpt/mpt.c  Tue Feb 14 00:56:01 2012(r231625)
@@ -1053,6 +1053,12 @@ mpt_hard_reset(struct mpt_softc *mpt)
 
mpt_lprt(mpt, MPT_PRT_DEBUG, hard reset\n);
 
+   if (mpt-is_1078) {
+   mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07);
+   DELAY(1000);
+   return;
+   }
+
error = mpt_enable_diag_mode(mpt);
if (error) {
mpt_prt(mpt, WARNING - Could not enter diagnostic mode !\n);
@@ -2451,6 +2457,11 @@ mpt_download_fw(struct mpt_softc *mpt)
uint32_t ext_offset;
uint32_t data;
 
+   if (mpt-pci_pio_reg == NULL) {
+   mpt_prt(mpt, No PIO resource!\n);
+   return (ENXIO);
+   }
+
mpt_prt(mpt, Downloading Firmware - Image Size %d\n,
mpt-fw_image_size);
 

Modified: stable/7/sys/dev/mpt/mpt.h
==
--- stable/7/sys/dev/mpt/mpt.h  Tue Feb 14 00:54:59 2012(r231624)
+++ stable/7/sys/dev/mpt/mpt.h  Tue Feb 14 00:56:01 2012(r231625)
@@ -608,7 +608,7 @@ struct mpt_softc {
 #endif
uint32_tmpt_pers_mask;
uint32_t
-   : 8,
+   : 7,
unit: 8,
ready   : 1,
fw_uploaded : 1,
@@ -625,7 +625,8 @@ struct mpt_softc {
disabled: 1,
is_spi  : 1,
is_sas  : 1,
-   is_fc   : 1;
+   is_fc   : 1,
+   is_1078 : 1;
 
u_int   cfg_role;
u_int   role;   /* role: none, ini, target, both */
@@ -982,12 +983,14 @@ mpt_read(struct mpt_softc *mpt, int offs
 static __inline void
 mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
bus_space_write_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset, val);
 }
 
 static __inline uint32_t
 mpt_pio_read(struct mpt_softc *mpt, int offset)
 {
+   KASSERT(mpt-pci_pio_reg != NULL, (no PIO resource));
return (bus_space_read_4(mpt-pci_pio_st, mpt-pci_pio_sh, offset));
 }
 /*** Reply Frame/Request Management 
***/

Modified: stable/7/sys/dev/mpt/mpt_cam.c
==
--- stable/7/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:54:59 2012
(r231624)
+++ stable/7/sys/dev/mpt/mpt_cam.c  Tue Feb 14 00:56:01 2012
(r231625)
@@ -1279,8 +1279,9 @@ mpt_execute_req_a64(void *arg, bus_dma_s
char *mpt_off;
union ccb *ccb;
struct mpt_softc *mpt;
-   int seg, first_lim;
-   uint32_t flags, nxt_off;
+   bus_addr_t chain_list_addr;
+   int first_lim, seg, this_seg_lim;
+   uint32_t addr, cur_off, flags, nxt_off, tf;
void *sglp = NULL;
MSG_REQUEST_HEADER *hdrp;
SGE_SIMPLE64 *se;
@@ -1434,16 +1435,20 @@ bad:
 
se = (SGE_SIMPLE64 *) sglp;
for (seg = 0; seg  first_lim; seg++, se++, dm_segs++) {
-   uint32_t tf;
-
+   tf = flags;
memset(se, 0, sizeof (*se));
+   MPI_pSGE_SET_LENGTH(se, dm_segs-ds_len);
se-Address.Low = htole32(dm_segs-ds_addr  0x);
if (sizeof(bus_addr_t)  4) {
-   se-Address.High =
-   htole32(((uint64_t)dm_segs-ds_addr)  32);
+   addr = ((uint64_t)dm_segs-ds_addr)  32;
+   /* SAS1078 36GB limitation WAR */
+   if (mpt-is_1078  (((uint64_t)dm_segs-ds_addr +
+   MPI_SGE_LENGTH(se-FlagsLength))  32) == 9) {
+   addr |= (1  31);
+   tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS;
+   }
+   se-Address.High = htole32(addr);
}
-   MPI_pSGE_SET_LENGTH(se, dm_segs-ds_len);
-   tf = flags;
if (seg == first_lim - 1) {
tf |= 

svn commit: r231626 - stable/9/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 01:05:37 2012
New Revision: 231626
URL: http://svn.freebsd.org/changeset/base/231626

Log:
  Forced commit to denote that the commit message of r231623 actually
  should have read:
  MFC: r231518
  
  Flesh out support for SAS1078 and SAS1078DE (which are said to actually
  be the same chip):
  - The I/O port resource may not be available with these. However, given
that we actually only need this resource for some controllers that
require their firmware to be up- and downloaded (which excludes the
SAS1078{,DE}) just handle failure to allocate this resource gracefully
when possible. While at it, generally put non-fatal resource allocation
failures under bootverbose.
  - SAS1078{,DE} use a different hard reset protocol.
  - Add workarounds for the 36GB physical address limitation of scatter/
gather elements of these controllers.
  
  Tested by:Slawa Olhovchenkov
  
  PR:   149220 (remaining part)

Modified:
  stable/9/sys/dev/mpt/mpt.c
  stable/9/sys/dev/mpt/mpt.h
  stable/9/sys/dev/mpt/mpt_cam.c
  stable/9/sys/dev/mpt/mpt_pci.c
  stable/9/sys/dev/mpt/mpt_reg.h

Modified: stable/9/sys/dev/mpt/mpt.c
==

Modified: stable/9/sys/dev/mpt/mpt.h
==

Modified: stable/9/sys/dev/mpt/mpt_cam.c
==

Modified: stable/9/sys/dev/mpt/mpt_pci.c
==

Modified: stable/9/sys/dev/mpt/mpt_reg.h
==
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231628 - stable/7/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 01:09:10 2012
New Revision: 231628
URL: http://svn.freebsd.org/changeset/base/231628

Log:
  Forced commit to denote that the commit message of r231625 actually
  should have read:
  MFC: r231518
  
  Flesh out support for SAS1078 and SAS1078DE (which are said to actually
  be the same chip):
  - The I/O port resource may not be available with these. However, given
that we actually only need this resource for some controllers that
require their firmware to be up- and downloaded (which excludes the
SAS1078{,DE}) just handle failure to allocate this resource gracefully
when possible. While at it, generally put non-fatal resource allocation
failures under bootverbose.
  - SAS1078{,DE} use a different hard reset protocol.
  - Add workarounds for the 36GB physical address limitation of scatter/
gather elements of these controllers.
  
  Tested by:Slawa Olhovchenkov
  
  PR:   149220 (remaining part)

Modified:
  stable/7/sys/dev/mpt/mpt.c
  stable/7/sys/dev/mpt/mpt.h
  stable/7/sys/dev/mpt/mpt_cam.c
  stable/7/sys/dev/mpt/mpt_pci.c
  stable/7/sys/dev/mpt/mpt_reg.h

Modified: stable/7/sys/dev/mpt/mpt.c
==

Modified: stable/7/sys/dev/mpt/mpt.h
==

Modified: stable/7/sys/dev/mpt/mpt_cam.c
==

Modified: stable/7/sys/dev/mpt/mpt_pci.c
==

Modified: stable/7/sys/dev/mpt/mpt_reg.h
==
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231629 - stable/9/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 01:15:01 2012
New Revision: 231629
URL: http://svn.freebsd.org/changeset/base/231629

Log:
  MFC: r231228
  
  Remove extra newlines from panic messages.

Modified:
  stable/9/sys/dev/mpt/mpt.c
  stable/9/sys/dev/mpt/mpt.h
  stable/9/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/mpt/mpt.c
==
--- stable/9/sys/dev/mpt/mpt.c  Tue Feb 14 01:09:10 2012(r231628)
+++ stable/9/sys/dev/mpt/mpt.c  Tue Feb 14 01:15:01 2012(r231629)
@@ -148,7 +148,7 @@ static __inline struct mpt_personality *
 mpt_pers_find(struct mpt_softc *mpt, u_int start_at)
 {
KASSERT(start_at = MPT_MAX_PERSONALITIES,
-   (mpt_pers_find: starting position out of range\n));
+   (mpt_pers_find: starting position out of range));
 
while (start_at  MPT_MAX_PERSONALITIES
 (mpt-mpt_pers_mask  (0x1  start_at)) == 0) {
@@ -1203,8 +1203,7 @@ mpt_free_request(struct mpt_softc *mpt, 
uint32_t offset, reply_baddr;

if (req == NULL || req != mpt-request_pool[req-index]) {
-   panic(mpt_free_request bad req ptr\n);
-   return;
+   panic(mpt_free_request: bad req ptr);
}
if ((nxt = req-chain) != NULL) {
req-chain = NULL;
@@ -1267,7 +1266,7 @@ retry:
req = TAILQ_FIRST(mpt-request_free_list);
if (req != NULL) {
KASSERT(req == mpt-request_pool[req-index],
-   (mpt_get_request: corrupted request free list\n));
+   (mpt_get_request: corrupted request free list));
KASSERT(req-state == REQ_STATE_FREE,
(req %p:%u not free on free list %x index %d function %x,
req, req-serno, req-state, req-index,

Modified: stable/9/sys/dev/mpt/mpt.h
==
--- stable/9/sys/dev/mpt/mpt.h  Tue Feb 14 01:09:10 2012(r231628)
+++ stable/9/sys/dev/mpt/mpt.h  Tue Feb 14 01:15:01 2012(r231629)
@@ -852,7 +852,7 @@ mpt_lockspl(struct mpt_softc *mpt)
mpt-mpt_splsaved = s;
} else {
splx(s);
-  panic(Recursed lock with mask: 0x%x\n, s);
+  panic(Recursed lock with mask: 0x%x, s);
}
 }
 
@@ -864,7 +864,7 @@ mpt_unlockspl(struct mpt_softc *mpt)
splx(mpt-mpt_splsaved);
}
} else
-  panic(Negative lock count\n);
+  panic(Negative lock count);
 }
 
 static __inline int
@@ -1147,7 +1147,7 @@ static __inline request_t *
 mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag)
 {
uint16_t rtg = (tag  18);
-   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d\n, tag));
+   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d, tag));
KASSERT(mpt-tgt_cmd_ptrs, (no cmd backpointer array));
KASSERT(mpt-tgt_cmd_ptrs[rtg], (no cmd backpointer));
return (mpt-tgt_cmd_ptrs[rtg]);
@@ -1214,7 +1214,7 @@ mpt_req_spcl(struct mpt_softc *mpt, requ
return;
}
}
-   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs\n,
+   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function);
 }
@@ -1228,13 +1228,13 @@ mpt_req_not_spcl(struct mpt_softc *mpt, 
int i;
for (i = 0; i  mpt-els_cmds_allocated; i++) {
KASSERT(req != mpt-els_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}
for (i = 0; i  mpt-tgt_cmds_allocated; i++) {
KASSERT(req != mpt-tgt_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}

Modified: 

svn commit: r231630 - stable/8/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 01:15:26 2012
New Revision: 231630
URL: http://svn.freebsd.org/changeset/base/231630

Log:
  MFC: r231228
  
  Remove extra newlines from panic messages.

Modified:
  stable/8/sys/dev/mpt/mpt.c
  stable/8/sys/dev/mpt/mpt.h
  stable/8/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/dev/mpt/mpt.c
==
--- stable/8/sys/dev/mpt/mpt.c  Tue Feb 14 01:15:01 2012(r231629)
+++ stable/8/sys/dev/mpt/mpt.c  Tue Feb 14 01:15:26 2012(r231630)
@@ -148,7 +148,7 @@ static __inline struct mpt_personality *
 mpt_pers_find(struct mpt_softc *mpt, u_int start_at)
 {
KASSERT(start_at = MPT_MAX_PERSONALITIES,
-   (mpt_pers_find: starting position out of range\n));
+   (mpt_pers_find: starting position out of range));
 
while (start_at  MPT_MAX_PERSONALITIES
 (mpt-mpt_pers_mask  (0x1  start_at)) == 0) {
@@ -1203,8 +1203,7 @@ mpt_free_request(struct mpt_softc *mpt, 
uint32_t offset, reply_baddr;

if (req == NULL || req != mpt-request_pool[req-index]) {
-   panic(mpt_free_request bad req ptr\n);
-   return;
+   panic(mpt_free_request: bad req ptr);
}
if ((nxt = req-chain) != NULL) {
req-chain = NULL;
@@ -1267,7 +1266,7 @@ retry:
req = TAILQ_FIRST(mpt-request_free_list);
if (req != NULL) {
KASSERT(req == mpt-request_pool[req-index],
-   (mpt_get_request: corrupted request free list\n));
+   (mpt_get_request: corrupted request free list));
KASSERT(req-state == REQ_STATE_FREE,
(req %p:%u not free on free list %x index %d function %x,
req, req-serno, req-state, req-index,

Modified: stable/8/sys/dev/mpt/mpt.h
==
--- stable/8/sys/dev/mpt/mpt.h  Tue Feb 14 01:15:01 2012(r231629)
+++ stable/8/sys/dev/mpt/mpt.h  Tue Feb 14 01:15:26 2012(r231630)
@@ -852,7 +852,7 @@ mpt_lockspl(struct mpt_softc *mpt)
mpt-mpt_splsaved = s;
} else {
splx(s);
-  panic(Recursed lock with mask: 0x%x\n, s);
+  panic(Recursed lock with mask: 0x%x, s);
}
 }
 
@@ -864,7 +864,7 @@ mpt_unlockspl(struct mpt_softc *mpt)
splx(mpt-mpt_splsaved);
}
} else
-  panic(Negative lock count\n);
+  panic(Negative lock count);
 }
 
 static __inline int
@@ -1147,7 +1147,7 @@ static __inline request_t *
 mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag)
 {
uint16_t rtg = (tag  18);
-   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d\n, tag));
+   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d, tag));
KASSERT(mpt-tgt_cmd_ptrs, (no cmd backpointer array));
KASSERT(mpt-tgt_cmd_ptrs[rtg], (no cmd backpointer));
return (mpt-tgt_cmd_ptrs[rtg]);
@@ -1214,7 +1214,7 @@ mpt_req_spcl(struct mpt_softc *mpt, requ
return;
}
}
-   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs\n,
+   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function);
 }
@@ -1228,13 +1228,13 @@ mpt_req_not_spcl(struct mpt_softc *mpt, 
int i;
for (i = 0; i  mpt-els_cmds_allocated; i++) {
KASSERT(req != mpt-els_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}
for (i = 0; i  mpt-tgt_cmds_allocated; i++) {
KASSERT(req != mpt-tgt_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}

Modified: stable/8/sys/dev/mpt/mpt_cam.c
==
--- stable/8/sys/dev/mpt/mpt_cam.c  Tue Feb 14 01:15:01 2012
(r231629)
+++ stable/8/sys/dev/mpt/mpt_cam.c  Tue Feb 14 01:15:26 2012
(r231630)
@@ -1357,7 +1357,7 @@ bad:
MPT_TGT_STATE(mpt, cmd_req)-req 

svn commit: r231631 - stable/7/sys/dev/mpt

2012-02-13 Thread Marius Strobl
Author: marius
Date: Tue Feb 14 01:15:46 2012
New Revision: 231631
URL: http://svn.freebsd.org/changeset/base/231631

Log:
  MFC: r231228
  
  Remove extra newlines from panic messages.

Modified:
  stable/7/sys/dev/mpt/mpt.c
  stable/7/sys/dev/mpt/mpt.h
  stable/7/sys/dev/mpt/mpt_cam.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/mpt/mpt.c
==
--- stable/7/sys/dev/mpt/mpt.c  Tue Feb 14 01:15:26 2012(r231630)
+++ stable/7/sys/dev/mpt/mpt.c  Tue Feb 14 01:15:46 2012(r231631)
@@ -148,7 +148,7 @@ static __inline struct mpt_personality *
 mpt_pers_find(struct mpt_softc *mpt, u_int start_at)
 {
KASSERT(start_at = MPT_MAX_PERSONALITIES,
-   (mpt_pers_find: starting position out of range\n));
+   (mpt_pers_find: starting position out of range));
 
while (start_at  MPT_MAX_PERSONALITIES
 (mpt-mpt_pers_mask  (0x1  start_at)) == 0) {
@@ -1203,8 +1203,7 @@ mpt_free_request(struct mpt_softc *mpt, 
uint32_t offset, reply_baddr;

if (req == NULL || req != mpt-request_pool[req-index]) {
-   panic(mpt_free_request bad req ptr\n);
-   return;
+   panic(mpt_free_request: bad req ptr);
}
if ((nxt = req-chain) != NULL) {
req-chain = NULL;
@@ -1267,7 +1266,7 @@ retry:
req = TAILQ_FIRST(mpt-request_free_list);
if (req != NULL) {
KASSERT(req == mpt-request_pool[req-index],
-   (mpt_get_request: corrupted request free list\n));
+   (mpt_get_request: corrupted request free list));
KASSERT(req-state == REQ_STATE_FREE,
(req %p:%u not free on free list %x index %d function %x,
req, req-serno, req-state, req-index,

Modified: stable/7/sys/dev/mpt/mpt.h
==
--- stable/7/sys/dev/mpt/mpt.h  Tue Feb 14 01:15:26 2012(r231630)
+++ stable/7/sys/dev/mpt/mpt.h  Tue Feb 14 01:15:46 2012(r231631)
@@ -852,7 +852,7 @@ mpt_lockspl(struct mpt_softc *mpt)
mpt-mpt_splsaved = s;
} else {
splx(s);
-  panic(Recursed lock with mask: 0x%x\n, s);
+  panic(Recursed lock with mask: 0x%x, s);
}
 }
 
@@ -864,7 +864,7 @@ mpt_unlockspl(struct mpt_softc *mpt)
splx(mpt-mpt_splsaved);
}
} else
-  panic(Negative lock count\n);
+  panic(Negative lock count);
 }
 
 static __inline int
@@ -1147,7 +1147,7 @@ static __inline request_t *
 mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag)
 {
uint16_t rtg = (tag  18);
-   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d\n, tag));
+   KASSERT(rtg  mpt-tgt_cmds_allocated, (bad tag %d, tag));
KASSERT(mpt-tgt_cmd_ptrs, (no cmd backpointer array));
KASSERT(mpt-tgt_cmd_ptrs[rtg], (no cmd backpointer));
return (mpt-tgt_cmd_ptrs[rtg]);
@@ -1214,7 +1214,7 @@ mpt_req_spcl(struct mpt_softc *mpt, requ
return;
}
}
-   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs\n,
+   panic(%s(%d): req %p:%u function %x not in els or tgt ptrs,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function);
 }
@@ -1228,13 +1228,13 @@ mpt_req_not_spcl(struct mpt_softc *mpt, 
int i;
for (i = 0; i  mpt-els_cmds_allocated; i++) {
KASSERT(req != mpt-els_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in els ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}
for (i = 0; i  mpt-tgt_cmds_allocated; i++) {
KASSERT(req != mpt-tgt_cmd_ptrs[i],
-   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d\n,
+   (%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d,
s, line, req, req-serno,
((PTR_MSG_REQUEST_HEADER)req-req_vbuf)-Function, i));
}

Modified: stable/7/sys/dev/mpt/mpt_cam.c
==
--- stable/7/sys/dev/mpt/mpt_cam.c  Tue Feb 14 01:15:26 2012
(r231630)
+++ stable/7/sys/dev/mpt/mpt_cam.c  Tue Feb 14 01:15:46 2012
(r231631)
@@ -1357,7 +1357,7 @@ bad:
MPT_TGT_STATE(mpt, cmd_req)-req = NULL;
}
ccb-ccb_h.status = ~CAM_SIM_QUEUED;
-   KASSERT(ccb-ccb_h.status, (zero ccb sts 

svn commit: r231632 - head/lib/libc/locale

2012-02-13 Thread Xin LI
Author: delphij
Date: Tue Feb 14 02:03:17 2012
New Revision: 231632
URL: http://svn.freebsd.org/changeset/base/231632

Log:
  wctob() returns EOF and not WEOF.
  
  Noticed by:   Zhihao Yuan lichray gmail com
  MFC after:1 week

Modified:
  head/lib/libc/locale/btowc.3

Modified: head/lib/libc/locale/btowc.3
==
--- head/lib/libc/locale/btowc.3Tue Feb 14 01:15:46 2012
(r231631)
+++ head/lib/libc/locale/btowc.3Tue Feb 14 02:03:17 2012
(r231632)
@@ -24,7 +24,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd August 3, 2002
+.Dd February 13, 2012
 .Dt BTOWC 3
 .Os
 .Sh NAME
@@ -58,7 +58,7 @@ If the wide character is
 or not able to be represented as a single byte in the initial shift state,
 .Fn wctob
 returns
-.Dv WEOF .
+.Dv EOF .
 .Sh SEE ALSO
 .Xr mbrtowc 3 ,
 .Xr multibyte 3 ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231633 - stable/9/sys/nlm

2012-02-13 Thread Rick Macklem
Author: rmacklem
Date: Tue Feb 14 04:07:35 2012
New Revision: 231633
URL: http://svn.freebsd.org/changeset/base/231633

Log:
  MFC: r230801
  jwd@ reported a problem via email to freebsd-fs@ on Aug 25, 2011
  under the subject F_RDLCK lock to FreeBSD NFS fails to R/O target file.
  This occurred because the server side NLM always checked for VWRITE
  access, irrespective of the type of lock request. This patch
  replaces VOP_ACCESS(..VWRITE..) with one appropriate to
  the lock operation. It allows unlock and lock cancellation
  to be done without a check of VOP_ACCESS(), so that files
  can't be left locked indefinitely after the file permissions
  have been changed.

Modified:
  stable/9/sys/nlm/nlm_prot_impl.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/nlm/nlm_prot_impl.c
==
--- stable/9/sys/nlm/nlm_prot_impl.cTue Feb 14 02:03:17 2012
(r231632)
+++ stable/9/sys/nlm/nlm_prot_impl.cTue Feb 14 04:07:35 2012
(r231633)
@@ -1774,10 +1774,10 @@ struct vfs_state {
 
 static int
 nlm_get_vfs_state(struct nlm_host *host, struct svc_req *rqstp,
-fhandle_t *fhp, struct vfs_state *vs)
+fhandle_t *fhp, struct vfs_state *vs, accmode_t accmode)
 {
int error, exflags;
-   struct ucred *cred = NULL, *credanon;
+   struct ucred *cred = NULL, *credanon = NULL;

memset(vs, 0, sizeof(*vs));
 
@@ -1787,14 +1787,19 @@ nlm_get_vfs_state(struct nlm_host *host,
}
vs-vs_vfslocked = VFS_LOCK_GIANT(vs-vs_mp);
 
-   error = VFS_CHECKEXP(vs-vs_mp, (struct sockaddr *)host-nh_addr,
-   exflags, credanon, NULL, NULL);
-   if (error)
-   goto out;
+   /* accmode == 0 means don't check, since it is an unlock. */
+   if (accmode != 0) {
+   error = VFS_CHECKEXP(vs-vs_mp,
+   (struct sockaddr *)host-nh_addr, exflags, credanon,
+   NULL, NULL);
+   if (error)
+   goto out;
 
-   if (exflags  MNT_EXRDONLY || (vs-vs_mp-mnt_flag  MNT_RDONLY)) {
-   error = EROFS;
-   goto out;
+   if (exflags  MNT_EXRDONLY ||
+   (vs-vs_mp-mnt_flag  MNT_RDONLY)) {
+   error = EROFS;
+   goto out;
+   }
}
 
error = VFS_FHTOVP(vs-vs_mp, fhp-fh_fid, LK_EXCLUSIVE, vs-vs_vp);
@@ -1802,22 +1807,31 @@ nlm_get_vfs_state(struct nlm_host *host,
goto out;
vs-vs_vnlocked = TRUE;
 
-   if (!svc_getcred(rqstp, cred, NULL)) {
-   error = EINVAL;
-   goto out;
-   }
-   if (cred-cr_uid == 0 || (exflags  MNT_EXPORTANON)) {
-   crfree(cred);
-   cred = credanon;
-   credanon = NULL;
-   }
+   if (accmode != 0) {
+   if (!svc_getcred(rqstp, cred, NULL)) {
+   error = EINVAL;
+   goto out;
+   }
+   if (cred-cr_uid == 0 || (exflags  MNT_EXPORTANON)) {
+   crfree(cred);
+   cred = credanon;
+   credanon = NULL;
+   }
 
-   /*
-* Check cred.
-*/
-   error = VOP_ACCESS(vs-vs_vp, VWRITE, cred, curthread);
-   if (error)
-   goto out;
+   /*
+* Check cred.
+*/
+   error = VOP_ACCESS(vs-vs_vp, accmode, cred, curthread);
+   /*
+* If this failed and accmode != VWRITE, try again with
+* VWRITE to maintain backwards compatibility with the
+* old code that always used VWRITE.
+*/
+   if (error != 0  accmode != VWRITE)
+   error = VOP_ACCESS(vs-vs_vp, VWRITE, cred, curthread);
+   if (error)
+   goto out;
+   }
 
 #if __FreeBSD_version  800011
VOP_UNLOCK(vs-vs_vp, 0, curthread);
@@ -1871,6 +1885,7 @@ nlm_do_test(nlm4_testargs *argp, nlm4_te
struct nlm_host *host, *bhost;
int error, sysid;
struct flock fl;
+   accmode_t accmode;

memset(result, 0, sizeof(*result));
memset(vs, 0, sizeof(vs));
@@ 

svn commit: r231634 - head/tools/test/hwpmc

2012-02-13 Thread George V. Neville-Neil
Author: gnn
Date: Tue Feb 14 04:18:59 2012
New Revision: 231634
URL: http://svn.freebsd.org/changeset/base/231634

Log:
  Add a rudimentary test to run through all the available counters on a
  system and then execute a program with pmcstat in counting mode.
  
  The program will verify that all counters fire and that the code neither
  panics the system nor locks it up.  This should be considered a first pass
  conformance test for new sets of counters being added to hwpmc(4).

Added:
  head/tools/test/hwpmc/
  head/tools/test/hwpmc/pmctest.py   (contents, props changed)

Added: head/tools/test/hwpmc/pmctest.py
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/test/hwpmc/pmctest.pyTue Feb 14 04:18:59 2012
(r231634)
@@ -0,0 +1,79 @@
+#!/usr/bin/env python
+# Copyright (c) 2012, Neville-Neil Consulting
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 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.
+#
+# Neither the name of Neville-Neil Consulting 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 COPYRIGHT HOLDERS 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 COPYRIGHT
+# OWNER 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.
+#
+# Author: George V. Neville-Neil
+#
+# $FreeBSD$
+
+# Description: A program to run a simple program against every available
+# pmc counter present in a system.
+#
+# To use:
+#
+# pmctest.py ls  /dev/null
+#
+# This should result in ls being run with every available counter
+# and the system should neither lock up nor panic.
+
+import sys
+import subprocess
+from subprocess import PIPE
+
+# A list of strings that are not really counters, just
+# name tags that are output by pmccontrol -L
+notcounter = [IAF, IAP, TSC, UNC, UCF]
+
+def main():
+
+if (len(sys.argv) != 2):
+print (usage: pmctest.py program)
+
+program = sys.argv[1]
+
+p = subprocess.Popen([pmccontrol, -L], stdout=PIPE)
+counters = p.communicate()[0]
+
+if len(counters) = 0:
+print no counters found
+sys.exit()
+
+for counter in counters.split():
+if counter in notcounter:
+continue
+p = subprocess.Popen([pmcstat, -p, counter, program], stdout=PIPE)
+result = p.communicate()[0]
+print result
+
+# The canonical way to make a python module into a script.
+# Remove if unnecessary.
+ 
+if __name__ == __main__:
+main()
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231635 - stable/9/lib/libthr/thread

2012-02-13 Thread David Xu
Author: davidxu
Date: Tue Feb 14 04:20:02 2012
New Revision: 231635
URL: http://svn.freebsd.org/changeset/base/231635

Log:
   MFC 231106:
   Plug a memory leak. When a cached thread is reused, don't clear sleep
   queue pointers, just reuse it.
  
   MFC 231503:
   Make code more stable by checking NULL pointers.

Modified:
  stable/9/lib/libthr/thread/thr_list.c
  stable/9/lib/libthr/thread/thr_private.h
Directory Properties:
  stable/9/lib/libthr/   (props changed)

Modified: stable/9/lib/libthr/thread/thr_list.c
==
--- stable/9/lib/libthr/thread/thr_list.c   Tue Feb 14 04:18:59 2012
(r231634)
+++ stable/9/lib/libthr/thread/thr_list.c   Tue Feb 14 04:20:02 2012
(r231635)
@@ -149,11 +149,20 @@ _thr_alloc(struct pthread *curthread)
if (total_threads  MAX_THREADS)
return (NULL);
atomic_fetchadd_int(total_threads, 1);
-   thread = malloc(sizeof(struct pthread));
+   thread = calloc(1, sizeof(struct pthread));
if (thread == NULL) {
atomic_fetchadd_int(total_threads, -1);
return (NULL);
}
+   if ((thread-sleepqueue = _sleepq_alloc()) == NULL ||
+   (thread-wake_addr = _thr_alloc_wake_addr()) == NULL) {
+   thr_destroy(curthread, thread);
+   atomic_fetchadd_int(total_threads, -1);
+   return (NULL);
+   }
+   } else {
+   bzero(thread-_pthread_startzero, 
+   __rangeof(struct pthread, _pthread_startzero, 
_pthread_endzero));
}
if (curthread != NULL) {
THR_LOCK_ACQUIRE(curthread, tcb_lock);
@@ -163,10 +172,7 @@ _thr_alloc(struct pthread *curthread)
tcb = _tcb_ctor(thread, 1 /* initial tls */);
}
if (tcb != NULL) {
-   memset(thread, 0, sizeof(*thread));
thread-tcb = tcb;
-   thread-sleepqueue = _sleepq_alloc();
-   thread-wake_addr = _thr_alloc_wake_addr();
} else {
thr_destroy(curthread, thread);
atomic_fetchadd_int(total_threads, -1);
@@ -194,8 +200,6 @@ _thr_free(struct pthread *curthread, str
}
thread-tcb = NULL;
if ((curthread == NULL) || (free_thread_count = MAX_CACHED_THREADS)) {
-   _sleepq_free(thread-sleepqueue);
-   _thr_release_wake_addr(thread-wake_addr);
thr_destroy(curthread, thread);
atomic_fetchadd_int(total_threads, -1);
} else {
@@ -213,6 +217,10 @@ _thr_free(struct pthread *curthread, str
 static void
 thr_destroy(struct pthread *curthread __unused, struct pthread *thread)
 {
+   if (thread-sleepqueue != NULL)
+   _sleepq_free(thread-sleepqueue);
+   if (thread-wake_addr != NULL)
+   _thr_release_wake_addr(thread-wake_addr);
free(thread);
 }
 

Modified: stable/9/lib/libthr/thread/thr_private.h
==
--- stable/9/lib/libthr/thread/thr_private.hTue Feb 14 04:18:59 2012
(r231634)
+++ stable/9/lib/libthr/thread/thr_private.hTue Feb 14 04:20:02 2012
(r231635)
@@ -343,6 +343,7 @@ struct pthread_key {
  * Thread structure.
  */
 struct pthread {
+#define _pthread_startzero tid
/* Kernel thread id. */
longtid;
 #defineTID_TERMINATED  1
@@ -506,12 +507,6 @@ struct pthread {
/* Event */
td_event_msg_t  event_buf;
 
-   struct wake_addr*wake_addr;
-#define WAKE_ADDR(td)   ((td)-wake_addr)
-
-   /* Sleep queue */
-   struct  sleepqueue  *sleepqueue;
-
/* Wait channel */
void*wchan;
 
@@ -526,6 +521,14 @@ struct pthread {
 
/* Deferred threads from pthread_cond_signal. */
unsigned int*defer_waiters[MAX_DEFER_WAITERS];
+#define _pthread_endzero   wake_addr
+
+   struct wake_addr*wake_addr;
+#define WAKE_ADDR(td)   ((td)-wake_addr)
+
+   /* Sleep queue */
+   struct  sleepqueue  *sleepqueue;
+
 };
 
 #define THR_SHOULD_GC(thrd)\
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231636 - in stable/9/sys: fs/nfsclient nfsclient

2012-02-13 Thread Rick Macklem
Author: rmacklem
Date: Tue Feb 14 04:48:36 2012
New Revision: 231636
URL: http://svn.freebsd.org/changeset/base/231636

Log:
  MFC: r230803
  When a mount -u switches an NFS mount point from TCP to UDP,
  any thread doing an I/O RPC with a transfer size greater than
  NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC.
  After a discussion on freebsd-fs@, I decided to add a warning
  message for this case, as suggested by Jeremy Chadwick.

Modified:
  stable/9/sys/fs/nfsclient/nfs_clvfsops.c
  stable/9/sys/nfsclient/nfs_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c
==
--- stable/9/sys/fs/nfsclient/nfs_clvfsops.cTue Feb 14 04:20:02 2012
(r231635)
+++ stable/9/sys/fs/nfsclient/nfs_clvfsops.cTue Feb 14 04:48:36 2012
(r231636)
@@ -989,6 +989,19 @@ nfs_mount(struct mount *mp)
error = EIO;
goto out;
}
+
+   /*
+* If a change from TCP-UDP is done and there are thread(s)
+* that have I/O RPC(s) in progress with a tranfer size
+* greater than NFS_MAXDGRAMDATA, those thread(s) will be
+* hung, retrying the RPC(s) forever. Usually these threads
+* will be seen doing an uninterruptible sleep on wait channel
+* newnfsreq (truncated to newnfsre by procstat).
+*/
+   if (args.sotype == SOCK_DGRAM  nmp-nm_sotype == SOCK_STREAM)
+   tprintf(td-td_proc, LOG_WARNING,
+   Warning: mount -u that changes TCP-UDP can result in hung threads\n);
+
/*
 * When doing an update, we can't change version,
 * security, switch lockd strategies or change cookie

Modified: stable/9/sys/nfsclient/nfs_vfsops.c
==
--- stable/9/sys/nfsclient/nfs_vfsops.c Tue Feb 14 04:20:02 2012
(r231635)
+++ stable/9/sys/nfsclient/nfs_vfsops.c Tue Feb 14 04:48:36 2012
(r231636)
@@ -56,6 +56,7 @@ __FBSDID($FreeBSD$);
 #include sys/socketvar.h
 #include sys/sockio.h
 #include sys/sysctl.h
+#include sys/syslog.h
 #include sys/vnode.h
 #include sys/signalvar.h
 
@@ -1106,6 +1107,19 @@ nfs_mount(struct mount *mp)
error = EIO;
goto out;
}
+
+   /*
+* If a change from TCP-UDP is done and there are thread(s)
+* that have I/O RPC(s) in progress with a tranfer size
+* greater than NFS_MAXDGRAMDATA, those thread(s) will be
+* hung, retrying the RPC(s) forever. Usually these threads
+* will be seen doing an uninterruptible sleep on wait channel
+* newnfsreq (truncated to newnfsre by procstat).
+*/
+   if (args.sotype == SOCK_DGRAM  nmp-nm_sotype == SOCK_STREAM)
+   tprintf(curthread-td_proc, LOG_WARNING,
+   Warning: mount -u that changes TCP-UDP can result in hung threads\n);
+
/*
 * When doing an update, we can't change from or to
 * v3, switch lockd strategies or change cookie translation
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231637 - in stable/8/sys: fs/nfsclient nfsclient

2012-02-13 Thread Rick Macklem
Author: rmacklem
Date: Tue Feb 14 05:12:52 2012
New Revision: 231637
URL: http://svn.freebsd.org/changeset/base/231637

Log:
  MFC: r230803
  When a mount -u switches an NFS mount point from TCP to UDP,
  any thread doing an I/O RPC with a transfer size greater than
  NFS_UDPMAXDATA will be hung indefinitely, retrying the RPC.
  After a discussion on freebsd-fs@, I decided to add a warning
  message for this case, as suggested by Jeremy Chadwick.

Modified:
  stable/8/sys/fs/nfsclient/nfs_clvfsops.c
  stable/8/sys/nfsclient/nfs_vfsops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)

Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c
==
--- stable/8/sys/fs/nfsclient/nfs_clvfsops.cTue Feb 14 04:48:36 2012
(r231636)
+++ stable/8/sys/fs/nfsclient/nfs_clvfsops.cTue Feb 14 05:12:52 2012
(r231637)
@@ -985,6 +985,19 @@ nfs_mount(struct mount *mp)
error = EIO;
goto out;
}
+
+   /*
+* If a change from TCP-UDP is done and there are thread(s)
+* that have I/O RPC(s) in progress with a tranfer size
+* greater than NFS_MAXDGRAMDATA, those thread(s) will be
+* hung, retrying the RPC(s) forever. Usually these threads
+* will be seen doing an uninterruptible sleep on wait channel
+* newnfsreq (truncated to newnfsre by procstat).
+*/
+   if (args.sotype == SOCK_DGRAM  nmp-nm_sotype == SOCK_STREAM)
+   tprintf(td-td_proc, LOG_WARNING,
+   Warning: mount -u that changes TCP-UDP can result in hung threads\n);
+
/*
 * When doing an update, we can't change version,
 * security, switch lockd strategies or change cookie

Modified: stable/8/sys/nfsclient/nfs_vfsops.c
==
--- stable/8/sys/nfsclient/nfs_vfsops.c Tue Feb 14 04:48:36 2012
(r231636)
+++ stable/8/sys/nfsclient/nfs_vfsops.c Tue Feb 14 05:12:52 2012
(r231637)
@@ -56,6 +56,7 @@ __FBSDID($FreeBSD$);
 #include sys/socketvar.h
 #include sys/sockio.h
 #include sys/sysctl.h
+#include sys/syslog.h
 #include sys/vnode.h
 #include sys/signalvar.h
 
@@ -1104,6 +1105,19 @@ nfs_mount(struct mount *mp)
error = EIO;
goto out;
}
+
+   /*
+* If a change from TCP-UDP is done and there are thread(s)
+* that have I/O RPC(s) in progress with a tranfer size
+* greater than NFS_MAXDGRAMDATA, those thread(s) will be
+* hung, retrying the RPC(s) forever. Usually these threads
+* will be seen doing an uninterruptible sleep on wait channel
+* newnfsreq (truncated to newnfsre by procstat).
+*/
+   if (args.sotype == SOCK_DGRAM  nmp-nm_sotype == SOCK_STREAM)
+   tprintf(curthread-td_proc, LOG_WARNING,
+   Warning: mount -u that changes TCP-UDP can result in hung threads\n);
+
/*
 * When doing an update, we can't change from or to
 * v3, switch lockd strategies or change cookie translation
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231638 - stable/9/etc/devd

2012-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 14 06:40:58 2012
New Revision: 231638
URL: http://svn.freebsd.org/changeset/base/231638

Log:
  MFC r231575:
  Update /etc/devd/usb.conf

Modified:
  stable/9/etc/devd/usb.conf
Directory Properties:
  stable/9/etc/   (props changed)

Modified: stable/9/etc/devd/usb.conf
==
--- stable/9/etc/devd/usb.conf  Tue Feb 14 05:12:52 2012(r231637)
+++ stable/9/etc/devd/usb.conf  Tue Feb 14 06:40:58 2012(r231638)
@@ -157,7 +157,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0403;
-   match product 
(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82);
+   match product 
(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82);
action kldload uftdi;
 };
 
@@ -293,7 +293,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0411;
-   match product (0x0148|0x0150|0x015d|0x016f);
+   match product (0x0148|0x0150|0x015d|0x016f|0x01a2);
action kldload if_run;
 };
 
@@ -1021,7 +1021,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x05c6;
-   match product (0x6000|0x6613);
+   match product (0x1000|0x6000|0x6613);
action kldload u3g;
 };
 
@@ -1301,7 +1301,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0789;
-   match product (0x0162|0x0163|0x0164);
+   match product (0x0162|0x0163|0x0164|0x0166);
action kldload if_run;
 };
 
@@ -2093,7 +2093,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0b95;
-   match product (0x1720|0x1780|0x7720|0x772a|0x772b);
+   match product (0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b);
action kldload if_axe;
 };
 
@@ -4205,6 +4205,15 @@ nomatch 32 {
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
+   match intclass 0x02;
+   match intsubclass 0x02;
+   match intprotocol 0xff;
+   action kldload umodem;
+};
+
+nomatch 32 {
+   match bus uhub[0-9]+;
+   match mode host;
match intclass 0x03;
match intsubclass 0x01;
match intprotocol 0x01;
@@ -4327,5 +4336,5 @@ nomatch 32 {
action kldload umass;
 };
 
-# 1645 USB entries processed
+# 1652 USB entries processed
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231639 - stable/8/etc/devd

2012-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 14 06:42:43 2012
New Revision: 231639
URL: http://svn.freebsd.org/changeset/base/231639

Log:
  MFC r231575:
  Update /etc/devd/usb.conf

Modified:
  stable/8/etc/devd/usb.conf
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/devd/usb.conf
==
--- stable/8/etc/devd/usb.conf  Tue Feb 14 06:40:58 2012(r231638)
+++ stable/8/etc/devd/usb.conf  Tue Feb 14 06:42:43 2012(r231639)
@@ -157,7 +157,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0403;
-   match product 
(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82);
+   match product 
(0x6001|0x6004|0x6010|0x6011|0x8372|0x9e90|0xa6d0|0xa6d0|0xcc48|0xcc49|0xcc4a|0xd678|0xe6c8|0xe888|0xe889|0xe88a|0xe88b|0xe88c|0xee18|0xf608|0xf60b|0xf850|0xfa00|0xfa01|0xfa02|0xfa03|0xfa04|0xfc08|0xfc09|0xfc0b|0xfc0c|0xfc0d|0xfc82);
action kldload uftdi;
 };
 
@@ -293,7 +293,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0411;
-   match product (0x0148|0x0150|0x015d|0x016f);
+   match product (0x0148|0x0150|0x015d|0x016f|0x01a2);
action kldload if_run;
 };
 
@@ -1021,7 +1021,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x05c6;
-   match product (0x6000|0x6613);
+   match product (0x1000|0x6000|0x6613);
action kldload u3g;
 };
 
@@ -1301,7 +1301,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0789;
-   match product (0x0162|0x0163|0x0164);
+   match product (0x0162|0x0163|0x0164|0x0166);
action kldload if_run;
 };
 
@@ -2093,7 +2093,7 @@ nomatch 32 {
match bus uhub[0-9]+;
match mode host;
match vendor 0x0b95;
-   match product (0x1720|0x1780|0x7720|0x772a|0x772b);
+   match product (0x1720|0x1780|0x7720|0x772a|0x772b|0x7e2b);
action kldload if_axe;
 };
 
@@ -4205,6 +4205,15 @@ nomatch 32 {
 nomatch 32 {
match bus uhub[0-9]+;
match mode host;
+   match intclass 0x02;
+   match intsubclass 0x02;
+   match intprotocol 0xff;
+   action kldload umodem;
+};
+
+nomatch 32 {
+   match bus uhub[0-9]+;
+   match mode host;
match intclass 0x03;
match intsubclass 0x01;
match intprotocol 0x01;
@@ -4327,5 +4336,5 @@ nomatch 32 {
action kldload umass;
 };
 
-# 1645 USB entries processed
+# 1652 USB entries processed
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231640 - stable/9/sys/geom/part

2012-02-13 Thread Andrey V. Elsukov
Author: ae
Date: Tue Feb 14 07:12:46 2012
New Revision: 231640
URL: http://svn.freebsd.org/changeset/base/231640

Log:
  MFC r231349:
Let's be more realistic and limit maximum number of partition to 4k.

Modified:
  stable/9/sys/geom/part/g_part_apm.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/part/g_part_apm.c
==
--- stable/9/sys/geom/part/g_part_apm.c Tue Feb 14 06:42:43 2012
(r231639)
+++ stable/9/sys/geom/part/g_part_apm.c Tue Feb 14 07:12:46 2012
(r231640)
@@ -102,7 +102,7 @@ static struct g_part_scheme g_part_apm_s
sizeof(struct g_part_apm_table),
.gps_entrysz = sizeof(struct g_part_apm_entry),
.gps_minent = 16,
-   .gps_maxent = INT_MAX,
+   .gps_maxent = 4096,
 };
 G_PART_SCHEME_DECLARE(g_part_apm);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231641 - stable/8/sys/geom/part

2012-02-13 Thread Andrey V. Elsukov
Author: ae
Date: Tue Feb 14 07:13:09 2012
New Revision: 231641
URL: http://svn.freebsd.org/changeset/base/231641

Log:
  MFC r231349:
Let's be more realistic and limit maximum number of partition to 4k.

Modified:
  stable/8/sys/geom/part/g_part_apm.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/geom/part/g_part_apm.c
==
--- stable/8/sys/geom/part/g_part_apm.c Tue Feb 14 07:12:46 2012
(r231640)
+++ stable/8/sys/geom/part/g_part_apm.c Tue Feb 14 07:13:09 2012
(r231641)
@@ -99,7 +99,7 @@ static struct g_part_scheme g_part_apm_s
sizeof(struct g_part_apm_table),
.gps_entrysz = sizeof(struct g_part_apm_entry),
.gps_minent = 16,
-   .gps_maxent = INT_MAX,
+   .gps_maxent = 4096,
 };
 G_PART_SCHEME_DECLARE(g_part_apm);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231642 - in head: rescue/rescue sbin/ifconfig

2012-02-13 Thread Robert Millan
Author: rmh
Date: Tue Feb 14 07:14:42 2012
New Revision: 231642
URL: http://svn.freebsd.org/changeset/base/231642

Log:
  Disable jail support in ifconfig when either building a rescue
  image or MK_JAIL knob has been set to no.
  
  Reviewed by:  bz
  Approved by:  adrian (mentor)

Modified:
  head/rescue/rescue/Makefile
  head/sbin/ifconfig/Makefile
  head/sbin/ifconfig/ifconfig.c

Modified: head/rescue/rescue/Makefile
==
--- head/rescue/rescue/Makefile Tue Feb 14 07:13:09 2012(r231641)
+++ head/rescue/rescue/Makefile Tue Feb 14 07:14:42 2012(r231642)
@@ -125,7 +125,7 @@ CRUNCH_LIBS+= -lipx
 .if ${MK_ZFS} != no
 CRUNCH_LIBS+= -lavl -lnvpair -lzfs -lpthread -luutil -lumem
 .endif
-CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs -lz
+CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
 
 .if ${MACHINE_CPUARCH} == i386
 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk

Modified: head/sbin/ifconfig/Makefile
==
--- head/sbin/ifconfig/Makefile Tue Feb 14 07:13:09 2012(r231641)
+++ head/sbin/ifconfig/Makefile Tue Feb 14 07:14:42 2012(r231642)
@@ -35,8 +35,8 @@ SRCS+=ifgre.c # GRE keys etc
 SRCS+= ifgif.c # GIF reversed header workaround
 
 SRCS+= ifieee80211.c regdomain.c # SIOC[GS]IEEE80211 support
-DPADD+=${LIBBSDXML} ${LIBJAIL} ${LIBSBUF}
-LDADD+=-lbsdxml -ljail -lsbuf
+DPADD+=${LIBBSDXML} ${LIBSBUF}
+LDADD+=-lbsdxml -lsbuf
 
 SRCS+= carp.c  # SIOC[GS]VH support
 SRCS+= ifgroup.c   # ...
@@ -56,6 +56,11 @@ SRCS+=   af_ipx.c# IPX support
 DPADD+=${LIBIPX}
 LDADD+=-lipx
 .endif
+.if ${MK_JAIL} != no  !defined(RELEASE_CRUNCH)  !defined(RESCUE)
+CFLAGS+= -DJAIL
+DPADD+= ${LIBJAIL}
+LDADD+= -ljail
+.endif
 
 MAN=   ifconfig.8
 

Modified: head/sbin/ifconfig/ifconfig.c
==
--- head/sbin/ifconfig/ifconfig.c   Tue Feb 14 07:13:09 2012
(r231641)
+++ head/sbin/ifconfig/ifconfig.c   Tue Feb 14 07:14:42 2012
(r231642)
@@ -66,7 +66,9 @@ static const char rcsid[] =
 #include err.h
 #include errno.h
 #include fcntl.h
+#ifdef JAIL
 #include jail.h
+#endif
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -255,6 +257,7 @@ main(int argc, char *argv[])
ifconfig(argc, argv, 1, NULL);
exit(0);
}
+#ifdef JAIL
/*
 * NOTE:  We have to special-case the `-vnet' command
 * right here as we would otherwise fail when trying
@@ -268,6 +271,7 @@ main(int argc, char *argv[])
ifconfig(argc, argv, 0, NULL);
exit(0);
}
+#endif
errx(1, interface %s does not exist, ifname);
}
}
@@ -688,6 +692,7 @@ deletetunnel(const char *vname, int para
err(1, SIOCDIFPHYADDR);
 }
 
+#ifdef JAIL
 static void
 setifvnet(const char *jname, int dummy __unused, int s,
 const struct afswtch *afp)
@@ -715,6 +720,7 @@ setifrvnet(const char *jname, int dummy 
if (ioctl(s, SIOCSIFRVNET, my_ifr)  0)
err(1, SIOCSIFRVNET(%d, %s), my_ifr.ifr_jid, my_ifr.ifr_name);
 }
+#endif
 
 static void
 setifnetmask(const char *addr, int dummy __unused, int s,
@@ -1173,8 +1179,10 @@ static struct cmd basic_cmds[] = {
DEF_CMD_ARG2(tunnel,  settunnel),
DEF_CMD(-tunnel, 0,   deletetunnel),
DEF_CMD(deletetunnel, 0,  deletetunnel),
+#ifdef JAIL
DEF_CMD_ARG(vnet, setifvnet),
DEF_CMD_ARG(-vnet,setifrvnet),
+#endif
DEF_CMD(link0,IFF_LINK0,  setifflags),
DEF_CMD(-link0,   -IFF_LINK0, setifflags),
DEF_CMD(link1,IFF_LINK1,  setifflags),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231643 - in stable/9/sys: geom/part sys

2012-02-13 Thread Andrey V. Elsukov
Author: ae
Date: Tue Feb 14 07:24:22 2012
New Revision: 231643
URL: http://svn.freebsd.org/changeset/base/231643

Log:
  MFC r231367:
Add alias for the partition with type 0x42 to the MBR scheme.

Modified:
  stable/9/sys/geom/part/g_part_mbr.c
  stable/9/sys/sys/diskmbr.h
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/geom/part/g_part_mbr.c
==
--- stable/9/sys/geom/part/g_part_mbr.c Tue Feb 14 07:14:42 2012
(r231642)
+++ stable/9/sys/geom/part/g_part_mbr.c Tue Feb 14 07:24:22 2012
(r231643)
@@ -119,6 +119,7 @@ static struct g_part_mbr_alias {
{ DOSPTYP_EXT,  G_PART_ALIAS_EBR },
{ DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS },
{ DOSPTYP_FAT32,G_PART_ALIAS_MS_FAT32 },
+   { DOSPTYP_LDM,  G_PART_ALIAS_MS_LDM_DATA },
{ DOSPTYP_LINSWP,   G_PART_ALIAS_LINUX_SWAP },
{ DOSPTYP_LINUX,G_PART_ALIAS_LINUX_DATA },
{ DOSPTYP_LINLVM,   G_PART_ALIAS_LINUX_LVM },

Modified: stable/9/sys/sys/diskmbr.h
==
--- stable/9/sys/sys/diskmbr.h  Tue Feb 14 07:14:42 2012(r231642)
+++ stable/9/sys/sys/diskmbr.h  Tue Feb 14 07:24:22 2012(r231643)
@@ -48,6 +48,7 @@
 #defineDOSPTYP_NTFS0x07/* NTFS partition */
 #defineDOSPTYP_FAT32   0x0b/* FAT32 partition */
 #defineDOSPTYP_EXTLBA  0x0f/* DOS extended partition */
+#defineDOSPTYP_LDM 0x42/* Win2k dynamic extended partition */
 #defineDOSPTYP_386BSD  0xa5/* 386BSD partition type */
 #defineDOSPTYP_LINSWP  0x82/* Linux swap partition */
 #defineDOSPTYP_LINUX   0x83/* Linux partition */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r231644 - in stable/8/sys: geom/part sys

2012-02-13 Thread Andrey V. Elsukov
Author: ae
Date: Tue Feb 14 07:24:44 2012
New Revision: 231644
URL: http://svn.freebsd.org/changeset/base/231644

Log:
  MFC r231367:
Add alias for the partition with type 0x42 to the MBR scheme.

Modified:
  stable/8/sys/geom/part/g_part_mbr.c
  stable/8/sys/sys/diskmbr.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/geom/part/g_part_mbr.c
==
--- stable/8/sys/geom/part/g_part_mbr.c Tue Feb 14 07:24:22 2012
(r231643)
+++ stable/8/sys/geom/part/g_part_mbr.c Tue Feb 14 07:24:44 2012
(r231644)
@@ -116,6 +116,7 @@ static struct g_part_mbr_alias {
{ DOSPTYP_EXT,  G_PART_ALIAS_EBR },
{ DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS },
{ DOSPTYP_FAT32,G_PART_ALIAS_MS_FAT32 },
+   { DOSPTYP_LDM,  G_PART_ALIAS_MS_LDM_DATA },
{ DOSPTYP_LINSWP,   G_PART_ALIAS_LINUX_SWAP },
{ DOSPTYP_LINUX,G_PART_ALIAS_LINUX_DATA },
{ DOSPTYP_LINLVM,   G_PART_ALIAS_LINUX_LVM },

Modified: stable/8/sys/sys/diskmbr.h
==
--- stable/8/sys/sys/diskmbr.h  Tue Feb 14 07:24:22 2012(r231643)
+++ stable/8/sys/sys/diskmbr.h  Tue Feb 14 07:24:44 2012(r231644)
@@ -48,6 +48,7 @@
 #defineDOSPTYP_NTFS0x07/* NTFS partition */
 #defineDOSPTYP_FAT32   0x0b/* FAT32 partition */
 #defineDOSPTYP_EXTLBA  0x0f/* DOS extended partition */
+#defineDOSPTYP_LDM 0x42/* Win2k dynamic extended partition */
 #defineDOSPTYP_386BSD  0xa5/* 386BSD partition type */
 #defineDOSPTYP_LINSWP  0x82/* Linux swap partition */
 #defineDOSPTYP_LINUX   0x83/* Linux partition */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org