Re: svn commit: r235797 - head/contrib/gcc

2012-05-24 Thread Bruce Evans

On Wed, 23 May 2012, David O'Brien wrote:


On Wed, May 23, 2012 at 01:49:45PM +0200, Dimitry Andric wrote:

On 2012-05-22 20:18, David E. O'Brien wrote:

Log:
  Do not incorrectly warn when printing a quad_t using %qd on 64-bit 
platforms.

...

Until all the additional warnings this causes have been fixed, can this
commit please be reverted for now?


Yes.  I cannot believe we've been abusing %q this badly.


Using it at all is using it badly, so your change should have had no effect.

But when it was used to print quad_t's, its use was almost reasonable,
and the change broke that too.

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


Re: svn commit: r235822 - in head: sys/dev/esp sys/gnu/fs/xfs/FreeBSD usr.sbin/ppp usr.sbin/rpc.lockd

2012-05-24 Thread Bruce Evans

On Wed, 23 May 2012, Xin Li wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 05/23/12 07:56, Bjoern A. Zeeb wrote:


On 23. May 2012, at 06:49 , Xin LI wrote:


Author: delphij Date: Wed May 23 06:49:50 2012 New Revision:
235822 URL: http://svn.freebsd.org/changeset/base/235822

Log: Fix build:

- Use %ll instead of %q for explicit long long casts; - Use %j
instead of %q in XFS and cast to intmax_t.

Tested with:make universe



I am still seeing XLP64 failing to compile:

cc1: warnings being treated as errors
/scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c: In function
'g_flashmap_print':
/scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning:
format '%08llx' expects type 'long long unsigned int', but argument
2 has type 'off_t' [-Wformat]
/scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning:
format '%08llx' expects type 'long long unsigned int', but argument
3 has type 'off_t' [-Wformat]
/scratch2/tmp/bz/HEAD.svn/sys/geom/geom_flashmap.c:82: warning:
format '%llu' expects type 'long long unsigned int', but argument 5
has type 'off_t' [-Wformat]


Weird, I don't know why I didn't caught this :-/  It seems that
'universe_kernel' does not do things after an existing universe build?


Well, new printf format errors/style bugs involving %ll have little to
do with old ones involving %q, even if they are not even style bugs but
fatal type mismatches.


Should be fixed in r235849.


The following bugs remain:
- bogus types off_t for sl_start and sl_end.  The typedef for file offsets
  is very inappropriate for disk offsets.  But this seems to be a generic
  bug in geom.
- printing the signed type off_t using the unsigned formats %...x and
  %...u.  (The casts are to unsigned to match the formats.)
- printing sl_start and sl_end in hex format
- printing sl_start and sl_end in %08jx format:
  - this hex format doesn't even use '%#' or '0x%', so it is ambiguous
  - the output is not in tab format, so '08' is not needed to line it up
  - 08 doesn't even work for lining things up, except for 32-bit values.
016 might work for 64-bit values.  But for general uint64_t values,
there is no correct field width to use.

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


Re: svn commit: r235852 - head/sys/geom

2012-05-24 Thread Bruce Evans

On Wed, 23 May 2012, Andriy Gapon wrote:


on 23/05/2012 22:22 Pawel Jakub Dawidek said the following:

On Wed, May 23, 2012 at 06:17:02PM +, Xin LI wrote:

Author: delphij Date: Wed May 23 18:17:02 2012 New Revision: 235852 URL:
http://svn.freebsd.org/changeset/base/235852

Log: Use %ju to match uintmax_t usage

Modified: head/sys/geom/geom_flashmap.c

Modified: head/sys/geom/geom_flashmap.c
==



--- head/sys/geom/geom_flashmap.c   Wed May 23 18:11:36 2012
(r235851)

+++ head/sys/geom/geom_flashmap.c   Wed May 23 18:17:02 2012
(r235852) @@
-78,7 +78,7 @@ static void g_flashmap_print(struct g_flashmap_slice
*slice) {

-   printf(%08jx-%08jx: %s (%lluKB)\n, (intmax_t)slice-sl_start,
(intmax_t)slice-sl_end, +   printf(%08jx-%08jx: %s (%juKB)\n,
(intmax_t)slice-sl_start, (intmax_t)slice-sl_end, slice-sl_name,
(uintmax_t)(slice-sl_end - slice-sl_start) / 1024);


BTW, %jx is also uintmax_t, not intmax_t, right?


I think that non-decimal representation generally implies unsigned-ness.


But it is another bug.  I already pointed this out. but didn't notice
then that it took 3-4 commits to get this far.

Sometimes negative values need to be printed in hex, with the burden of
interpreting the sign bit left to the user.  Then the correct cast to
use is problematic -- if you actually want to see the bits, then you
don't want casting to change them, but perhaps it does change them for
the 1's complement and other exotic cases.  So hex printing of negative
values probably shouldn't use casts at all, but should point at the
object using u_char * and print the bits 1 byte at a time.

These complications probably don't apply here.  Probably the values are
always nonnegative, so they can be printed in hex by simply casting them,
and the casts should be to an unsigned type to match the format.  The hex
format is just bad here, with 2 or 3 internal bugs starting with it never
having an 0x prefix -- see a previous reply.

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


svn commit: r235886 - in head/sys: compat/freebsd32 kern sys

2012-05-24 Thread Gleb Kurtsou
Author: gleb
Date: Thu May 24 08:00:26 2012
New Revision: 235886
URL: http://svn.freebsd.org/changeset/base/235886

Log:
  Add kern_fhstat(), adjust sys_fhstat() to use it.
  
  Extend kern_getdirentries() to accept uio segflag and optionally return
  buffer residue.
  
  Sponsored by: Google Summer of Code 2011

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/vfs_syscalls.c
  head/sys/sys/syscallsubr.h

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==
--- head/sys/compat/freebsd32/freebsd32_misc.c  Thu May 24 05:30:17 2012
(r235885)
+++ head/sys/compat/freebsd32/freebsd32_misc.c  Thu May 24 08:00:26 2012
(r235886)
@@ -1528,7 +1528,8 @@ freebsd32_getdirentries(struct thread *t
int32_t base32;
int error;
 
-   error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base);
+   error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base,
+   NULL, UIO_USERSPACE);
if (error)
return (error);
if (uap-basep != NULL) {

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cThu May 24 05:30:17 2012
(r235885)
+++ head/sys/kern/vfs_syscalls.cThu May 24 08:00:26 2012
(r235886)
@@ -4136,7 +4136,8 @@ sys_getdirentries(td, uap)
long base;
int error;
 
-   error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base);
+   error = kern_getdirentries(td, uap-fd, uap-buf, uap-count, base,
+   NULL, UIO_USERSPACE);
if (error)
return (error);
if (uap-basep != NULL)
@@ -4146,7 +4147,7 @@ sys_getdirentries(td, uap)
 
 int
 kern_getdirentries(struct thread *td, int fd, char *buf, u_int count,
-long *basep)
+long *basep, ssize_t *residp, enum uio_seg bufseg)
 {
struct vnode *vp;
struct file *fp;
@@ -4180,7 +4181,7 @@ unionread:
auio.uio_iov = aiov;
auio.uio_iovcnt = 1;
auio.uio_rw = UIO_READ;
-   auio.uio_segflg = UIO_USERSPACE;
+   auio.uio_segflg = bufseg;
auio.uio_td = td;
vn_lock(vp, LK_SHARED | LK_RETRY);
AUDIT_ARG_VNODE1(vp);
@@ -4213,6 +4214,8 @@ unionread:
VOP_UNLOCK(vp, 0);
VFS_UNLOCK_GIANT(vfslocked);
*basep = loff;
+   if (residp != NULL)
+   *residp = auio.uio_resid;
td-td_retval[0] = count - auio.uio_resid;
 fail:
fdrop(fp, td);
@@ -4679,7 +4682,22 @@ sys_fhstat(td, uap)
} */ *uap;
 {
struct stat sb;
-   fhandle_t fh;
+   struct fhandle fh;
+   int error;
+
+   error = copyin(uap-u_fhp, fh, sizeof(fh));
+   if (error != 0)
+   return (error);
+   error = kern_fhstat(td, fh, sb);
+   if (error != 0)
+   return (error);
+   error = copyout(sb, uap-sb, sizeof(sb));
+   return (error);
+}
+
+int
+kern_fhstat(struct thread *td, struct fhandle fh, struct stat *sb)
+{
struct mount *mp;
struct vnode *vp;
int vfslocked;
@@ -4688,9 +4706,6 @@ sys_fhstat(td, uap)
error = priv_check(td, PRIV_VFS_FHSTAT);
if (error)
return (error);
-   error = copyin(uap-u_fhp, fh, sizeof(fhandle_t));
-   if (error)
-   return (error);
if ((mp = vfs_busyfs(fh.fh_fsid)) == NULL)
return (ESTALE);
vfslocked = VFS_LOCK_GIANT(mp);
@@ -4700,12 +4715,9 @@ sys_fhstat(td, uap)
VFS_UNLOCK_GIANT(vfslocked);
return (error);
}
-   error = vn_stat(vp, sb, td-td_ucred, NOCRED, td);
+   error = vn_stat(vp, sb, td-td_ucred, NOCRED, td);
vput(vp);
VFS_UNLOCK_GIANT(vfslocked);
-   if (error)
-   return (error);
-   error = copyout(sb, uap-sb, sizeof(sb));
return (error);
 }
 

Modified: head/sys/sys/syscallsubr.h
==
--- head/sys/sys/syscallsubr.h  Thu May 24 05:30:17 2012(r235885)
+++ head/sys/sys/syscallsubr.h  Thu May 24 08:00:26 2012(r235886)
@@ -89,6 +89,7 @@ int   kern_fchmodat(struct thread *td, int
 intkern_fchownat(struct thread *td, int fd, char *path,
enum uio_seg pathseg, int uid, int gid, int flag);
 intkern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg);
+intkern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf);
 intkern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf);
 intkern_fstat(struct thread *td, int fd, struct stat *sbp);
 intkern_fstatfs(struct thread *td, int fd, struct statfs *buf);
@@ -96,7 +97,7 @@ int   kern_ftruncate(struct thread *td, in
 intkern_futimes(struct thread *td, int fd, struct timeval *tptr,
enum uio_seg tptrseg);
 intkern_getdirentries(struct thread *td, int fd, 

Re: svn commit: r235859 - in head/sys: i386/conf modules

2012-05-24 Thread Konstantin Belousov
On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote:
 On 05/23/12 23:07, Konstantin Belousov wrote:
 Author: kib
 Date: Wed May 23 21:07:01 2012
 New Revision: 235859
 URL: http://svn.freebsd.org/changeset/base/235859
 
 Log:
Enable drm2 modules build.
 
Sponsored by: The FreeBSD Foundation
MFC after:1 month
 
 Modified:
head/sys/i386/conf/XEN
head/sys/modules/Makefile
 
 
 Hi!
 Thank you very much for all your work!
 With this commit, is there any need for any patches from you, or have 
 they all been incorporated by now? Perhaps a note in UPDATING would be 
 good, at least to make people more aware of the fact that GEM/KMS 
 finally has come to FreeBSD as well.  An update to the wiki might be 
 good as well.  I can help you with patches and updating the wiki, just 
 let me know.
 Once again, a big thank you!

ATM no more patches are needed to run new driver.

I do not see a need in any UPDATING entry, since nothing should have
been changed for users who did not used my patch before.

Wiki ought to get complete rewrite, I might get time to do it at the end
of week.


pgppbzWH4ql3j.pgp
Description: PGP signature


Re: svn commit: r235859 - in head/sys: i386/conf modules

2012-05-24 Thread Niclas Zeising
On 2012-05-24 11:26, Konstantin Belousov wrote:
 On Wed, May 23, 2012 at 11:37:29PM +0200, Niclas Zeising wrote:
 On 05/23/12 23:07, Konstantin Belousov wrote:
 Author: kib
 Date: Wed May 23 21:07:01 2012
 New Revision: 235859
 URL: http://svn.freebsd.org/changeset/base/235859

 Log:
   Enable drm2 modules build.

   Sponsored by: The FreeBSD Foundation
   MFC after:1 month

 Modified:
   head/sys/i386/conf/XEN
   head/sys/modules/Makefile


 Hi!
 Thank you very much for all your work!
 With this commit, is there any need for any patches from you, or have 
 they all been incorporated by now? Perhaps a note in UPDATING would be 
 good, at least to make people more aware of the fact that GEM/KMS 
 finally has come to FreeBSD as well.  An update to the wiki might be 
 good as well.  I can help you with patches and updating the wiki, just 
 let me know.
 Once again, a big thank you!
 
 ATM no more patches are needed to run new driver.
 
 I do not see a need in any UPDATING entry, since nothing should have
 been changed for users who did not used my patch before.
 
 Wiki ought to get complete rewrite, I might get time to do it at the end
 of week.

Hi!
Thank you for the clarifications!

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


Re: svn commit: r235746 - head/sys/net

2012-05-24 Thread Alexander V. Chernikov

On 24.05.2012 04:18, Jung-uk Kim wrote:
...

@@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro
struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef
BPF_JITTER -bpf_jit_filter *ofunc; +bpf_jit_filter *ofunc,
*jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6
+1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode =
NULL; /* Make compiler happy */

+#ifdef BPF_JITTER +if (fp-bf_insns != NULL) +  jfunc =
bpf_jitter(fcode, flen); +  else +  jfunc = NULL; /* Make compiler
happy */ +#endif + BPF_LOCK();

if (cmd == BIOCSETWF) {

...

This is completely wrong.  First, fcode has not been initialized with

Ups.

Does the attached patch look ok to you?
Index: sys/net/bpf.c
===
--- sys/net/bpf.c   (revision 235750)
+++ sys/net/bpf.c   (working copy)
@@ -1737,9 +1737,16 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp,
 
need_upgrade = 0;
size = flen * sizeof(*fp-bf_insns);
-   if (size  0)
+   if (size  0) {
+   /* We're setting up new filter. Copy and check actual data */
fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK);
-   else
+   if (copyin((caddr_t)fp-bf_insns, (caddr_t)fcode, size) != 0 ||
+   (bpf_validate(fcode, (int)flen) == 0)) {
+   free(fcode, M_BPF);
+   return (EINVAL);
+   }
+   /* Filter is copied inside fcode and is perfectly valid */
+   } else
fcode = NULL; /* Make compiler happy */
 
 #ifdef BPF_JITTER
@@ -1795,55 +1802,50 @@ bpf_setf(struct bpf_d *d, struct bpf_program *fp,
return (0);
}
 
-   if (copyin((caddr_t)fp-bf_insns, (caddr_t)fcode, size) == 0 
-   bpf_validate(fcode, (int)flen)) {
-   /* 
-* Protect filter change by interface lock
-* Additionally, we are protected by global lock here.
-*/
-   if (d-bd_bif != NULL)
-   BPFIF_WLOCK(d-bd_bif);
-   BPFD_LOCK(d);
-   if (wfilter)
-   d-bd_wfilter = fcode;
-   else {
-   d-bd_rfilter = fcode;
+   /* 
+* Set up new filter.
+* Protect filter change by interface lock
+* Additionally, we are protected by global lock here.
+*/
+   if (d-bd_bif != NULL)
+   BPFIF_WLOCK(d-bd_bif);
+   BPFD_LOCK(d);
+   if (wfilter)
+   d-bd_wfilter = fcode;
+   else {
+   d-bd_rfilter = fcode;
 #ifdef BPF_JITTER
-   d-bd_bfilter = jfunc;
+   d-bd_bfilter = jfunc;
 #endif
-   if (cmd == BIOCSETF)
-   reset_d(d);
+   if (cmd == BIOCSETF)
+   reset_d(d);
 
-   /*
-* Do not require upgrade by first BIOCSETF
-* (used to set snaplen) by pcap_open_live()
-*/
-   if ((d-bd_writer != 0)  (--d-bd_writer == 0))
-   need_upgrade = 1;
-   CTR4(KTR_NET, %s: filter function set by pid %d, 
-   bd_writer counter %d, need_upgrade %d,
-   __func__, d-bd_pid, d-bd_writer, need_upgrade);
-   }
-   BPFD_UNLOCK(d);
-   if (d-bd_bif != NULL)
-   BPFIF_WUNLOCK(d-bd_bif);
-   if (old != NULL)
-   free((caddr_t)old, M_BPF);
+   /*
+* Do not require upgrade by first BIOCSETF
+* (used to set snaplen) by pcap_open_live()
+*/
+   if ((d-bd_writer != 0)  (--d-bd_writer == 0))
+   need_upgrade = 1;
+   CTR4(KTR_NET, %s: filter function set by pid %d, 
+   bd_writer counter %d, need_upgrade %d,
+   __func__, d-bd_pid, d-bd_writer, need_upgrade);
+   }
+   BPFD_UNLOCK(d);
+   if (d-bd_bif != NULL)
+   BPFIF_WUNLOCK(d-bd_bif);
+   if (old != NULL)
+   free((caddr_t)old, M_BPF);
 #ifdef BPF_JITTER
-   if (ofunc != NULL)
-   bpf_destroy_jit_filter(ofunc);
+   if (ofunc != NULL)
+   bpf_destroy_jit_filter(ofunc);
 #endif
 
-   /* Move d to active readers list */
-   if (need_upgrade != 0)
-   bpf_upgraded(d);
+   /* Move d to active readers list */
+   if (need_upgrade != 0)
+   bpf_upgraded(d);
 
-   BPF_UNLOCK();
-   return (0);
-   }
-   free((caddr_t)fcode, M_BPF);
BPF_UNLOCK();
-   return (EINVAL);
+   return (0);
 }
 
 /*
Index: sys/net/bpf_jitter.c

svn commit: r235897 - in head: sbin/camcontrol sys/cam sys/cam/ata sys/cam/scsi sys/sys

2012-05-24 Thread Alexander Motin
Author: mav
Date: Thu May 24 11:07:39 2012
New Revision: 235897
URL: http://svn.freebsd.org/changeset/base/235897

Log:
  MFprojects/zfsd:
   - Add low-level support for SATA Enclosure Management Bridge (SEMB)
  devices -- SATA equivalents of the SCSI SES/SAF-TE devices.
   - Add some utility functions for SCSI SAF-TE devices access.
  
  Sponsored by: iXsystems, Inc.

Modified:
  head/sbin/camcontrol/camcontrol.c
  head/sys/cam/ata/ata_all.c
  head/sys/cam/ata/ata_all.h
  head/sys/cam/ata/ata_da.c
  head/sys/cam/ata/ata_xpt.c
  head/sys/cam/cam_ccb.h
  head/sys/cam/cam_xpt.c
  head/sys/cam/scsi/scsi_all.c
  head/sys/cam/scsi/scsi_all.h
  head/sys/sys/ata.h

Modified: head/sbin/camcontrol/camcontrol.c
==
--- head/sbin/camcontrol/camcontrol.c   Thu May 24 11:03:03 2012
(r235896)
+++ head/sbin/camcontrol/camcontrol.c   Thu May 24 11:07:39 2012
(r235897)
@@ -456,7 +456,7 @@ getdevtree(void)
case DEV_MATCH_DEVICE: {
struct device_match_result *dev_result;
char vendor[16], product[48], revision[16];
-   char tmpstr[256];
+   char fw[5], tmpstr[256];
 
dev_result =
 ccb.cdm.matches[i].result.device_result;
@@ -495,6 +495,25 @@ getdevtree(void)
   sizeof(revision));
sprintf(tmpstr, %s %s, product,
revision);
+   } else if (dev_result-protocol == PROTO_SEMB) {
+   struct sep_identify_data *sid;
+
+   sid = (struct sep_identify_data *)
+   dev_result-ident_data;
+   cam_strvis(vendor, sid-vendor_id,
+   sizeof(sid-vendor_id),
+   sizeof(vendor));
+   cam_strvis(product, sid-product_id,
+   sizeof(sid-product_id),
+   sizeof(product));
+   cam_strvis(revision, sid-product_rev,
+   sizeof(sid-product_rev),
+   sizeof(revision));
+   cam_strvis(fw, sid-firmware_rev,
+   sizeof(sid-firmware_rev),
+   sizeof(fw));
+   sprintf(tmpstr, %s %s %s %s,
+   vendor, product, revision, fw);
} else {
sprintf(tmpstr, );
}

Modified: head/sys/cam/ata/ata_all.c
==
--- head/sys/cam/ata/ata_all.c  Thu May 24 11:03:03 2012(r235896)
+++ head/sys/cam/ata/ata_all.c  Thu May 24 11:07:39 2012(r235897)
@@ -108,6 +108,16 @@ ata_op_string(struct ata_cmd *cmd)
case 0x51: return (CONFIGURE_STREAM);
case 0x60: return (READ_FPDMA_QUEUED);
case 0x61: return (WRITE_FPDMA_QUEUED);
+   case 0x67:
+   if (cmd-features == 0xec)
+   return (SEP_ATTN IDENTIFY);
+   switch (cmd-lba_low) {
+   case 0x00: return (SEP_ATTN READ BUFFER);
+   case 0x02: return (SEP_ATTN RECEIVE DIAGNOSTIC RESULTS);
+   case 0x80: return (SEP_ATTN WRITE BUFFER);
+   case 0x82: return (SEP_ATTN SEND DIAGNOSTIC);
+   }
+   return (SEP_ATTN);
case 0x70: return (SEEK);
case 0x87: return (CFA_TRANSLATE_SECTOR);
case 0x90: return (EXECUTE_DEVICE_DIAGNOSTIC);
@@ -286,6 +296,21 @@ ata_print_ident(struct ata_params *ident
printf( device\n);
 }
 
+void
+semb_print_ident(struct sep_identify_data *ident_data)
+{
+   char vendor[9], product[17], revision[5], fw[5], in[7], ins[5];
+
+   cam_strvis(vendor, ident_data-vendor_id, 8, sizeof(vendor));
+   cam_strvis(product, ident_data-product_id, 16, sizeof(product));
+   cam_strvis(revision, ident_data-product_rev, 4, sizeof(revision));
+   cam_strvis(fw, ident_data-firmware_rev, 4, sizeof(fw));
+   cam_strvis(in, ident_data-interface_id, 6, sizeof(in));
+   cam_strvis(ins, ident_data-interface_rev, 4, sizeof(ins));
+   printf(%s %s %s %s SEMB %s %s device\n,
+   vendor, product, revision, fw, in, ins);
+}
+
 uint32_t
 ata_logical_sector_size(struct ata_params *ident_data)
 {
@@ -695,3 +720,86 @@ ata_static_identify_match(caddr_t identb
}
 return 

svn commit: r235898 - in head/sys: arm/conf conf mips/conf pc98/conf sparc64/conf

2012-05-24 Thread Alexander Motin
Author: mav
Date: Thu May 24 11:20:51 2012
New Revision: 235898
URL: http://svn.freebsd.org/changeset/base/235898

Log:
  MFprojects/zfsd:
  Generalize and unify ses device description.

Modified:
  head/sys/arm/conf/ETHERNUT5
  head/sys/conf/NOTES
  head/sys/mips/conf/OCTEON1
  head/sys/pc98/conf/GENERIC
  head/sys/sparc64/conf/GENERIC

Modified: head/sys/arm/conf/ETHERNUT5
==
--- head/sys/arm/conf/ETHERNUT5 Thu May 24 11:07:39 2012(r235897)
+++ head/sys/arm/conf/ETHERNUT5 Thu May 24 11:20:51 2012(r235898)
@@ -141,7 +141,7 @@ device  ether   # Ethernet support
 #devicesa  # Sequential Access (tape etc)
 #devicecd  # CD
 #devicepass# Passthrough device (direct ATA/SCSI 
access)
-#deviceses # SCSI Environmental Services (and 
SAF-TE)
+#deviceses # Enclosure Services (SES and SAF-TE)
 #devicectl # CAM Target Layer
 
 # Serial (COM) ports

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu May 24 11:07:39 2012(r235897)
+++ head/sys/conf/NOTES Thu May 24 11:20:51 2012(r235898)
@@ -1295,7 +1295,7 @@ devicech  #SCSI media changers
 device da  #SCSI direct access devices (aka disks)
 device sa  #SCSI tapes
 device cd  #SCSI CD-ROMs
-device ses #SCSI Environmental Services (and SAF-TE)
+device ses #Enclosure Services (SES and SAF-TE)
 device pt  #SCSI processor
 device targ#SCSI Target Mode Code
 device targbh  #SCSI Target Mode Blackhole Device

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Thu May 24 11:07:39 2012(r235897)
+++ head/sys/mips/conf/OCTEON1  Thu May 24 11:20:51 2012(r235898)
@@ -135,7 +135,7 @@ device  da  # Direct Access (disks)
 device sa  # Sequential Access (tape etc)
 device cd  # CD
 device pass# Passthrough device (direct ATA/SCSI access)
-device ses # SCSI Environmental Services (and SAF-TE)
+device ses # Enclosure Services (SES and SAF-TE)
 
 # RAID controllers interfaced to the SCSI subsystem
 device amr # AMI MegaRAID

Modified: head/sys/pc98/conf/GENERIC
==
--- head/sys/pc98/conf/GENERIC  Thu May 24 11:07:39 2012(r235897)
+++ head/sys/pc98/conf/GENERIC  Thu May 24 11:20:51 2012(r235898)
@@ -110,7 +110,7 @@ device  da  # Direct Access (disks)
 device sa  # Sequential Access (tape etc)
 device cd  # CD
 device pass# Passthrough device (direct ATA/SCSI access)
-device ses # SCSI Environmental Services (and SAF-TE)
+device ses # Enclosure Services (SES and SAF-TE)
 
 # keyboard driver
 device pckbd   # PC98 keyboard

Modified: head/sys/sparc64/conf/GENERIC
==
--- head/sys/sparc64/conf/GENERIC   Thu May 24 11:07:39 2012
(r235897)
+++ head/sys/sparc64/conf/GENERIC   Thu May 24 11:20:51 2012
(r235898)
@@ -118,7 +118,7 @@ device  da  # Direct Access (disks)
 device sa  # Sequential Access (tape etc)
 device cd  # CD
 device pass# Passthrough device (direct ATA/SCSI access)
-device ses # SCSI Environmental Services (and SAF-TE)
+device ses # Enclosure Services (SES and SAF-TE)
 device ctl # CAM Target Layer
 
 # RAID controllers
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235899 - head/sys/kern

2012-05-24 Thread Alexander Motin
Author: mav
Date: Thu May 24 11:24:44 2012
New Revision: 235899
URL: http://svn.freebsd.org/changeset/base/235899

Log:
  MFprojects/zfsd:
  Hide warning behind bootverbose. Average user has nothing to do about it.

Modified:
  head/sys/kern/kern_conf.c

Modified: head/sys/kern/kern_conf.c
==
--- head/sys/kern/kern_conf.c   Thu May 24 11:20:51 2012(r235898)
+++ head/sys/kern/kern_conf.c   Thu May 24 11:24:44 2012(r235899)
@@ -993,9 +993,10 @@ make_dev_physpath_alias(int flags, struc
max_parentpath_len = SPECNAMELEN - physpath_len - /*/*/1;
parentpath_len = strlen(pdev-si_name);
if (max_parentpath_len  parentpath_len) {
-   printf(make_dev_physpath_alias: WARNING - Unable to alias %s 
-   to %s/%s - path too long\n,
-   pdev-si_name, physpath, pdev-si_name);
+   if (bootverbose)
+   printf(WARNING: Unable to alias %s 
+   to %s/%s - path too long\n,
+   pdev-si_name, physpath, pdev-si_name);
ret = ENAMETOOLONG;
goto out;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235903 - head/sys/netinet

2012-05-24 Thread Michael Tuexen
Author: tuexen
Date: Thu May 24 11:52:57 2012
New Revision: 235903
URL: http://svn.freebsd.org/changeset/base/235903

Log:
  Add sn_send_failed_event to sctp_notification.
  
  MFC after: 3 days

Modified:
  head/sys/netinet/sctp_uio.h

Modified: head/sys/netinet/sctp_uio.h
==
--- head/sys/netinet/sctp_uio.h Thu May 24 11:50:14 2012(r235902)
+++ head/sys/netinet/sctp_uio.h Thu May 24 11:52:57 2012(r235903)
@@ -523,10 +523,10 @@ union sctp_notification {
struct sctp_pdapi_event sn_pdapi_event;
struct sctp_authkey_event sn_auth_event;
struct sctp_sender_dry_event sn_sender_dry_event;
+   struct sctp_send_failed_event sn_send_failed_event;
struct sctp_stream_reset_event sn_strreset_event;
struct sctp_assoc_reset_event sn_assocreset_event;
struct sctp_stream_change_event sn_strchange_event;
-
 };
 
 /* notification types */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235907 - head/sys/arm/arm

2012-05-24 Thread Grzegorz Bernacki
Author: gber
Date: Thu May 24 12:38:24 2012
New Revision: 235907
URL: http://svn.freebsd.org/changeset/base/235907

Log:
  ARMs don't have motherboards.
  
  Obtained from:Semihalf

Modified:
  head/sys/arm/arm/nexus.c

Modified: head/sys/arm/arm/nexus.c
==
--- head/sys/arm/arm/nexus.cThu May 24 12:28:11 2012(r235906)
+++ head/sys/arm/arm/nexus.cThu May 24 12:38:24 2012(r235907)
@@ -160,7 +160,7 @@ nexus_print_child(device_t bus, device_t
int retval = 0;
 
retval += bus_print_child_header(bus, child);
-   retval += printf( on motherboard\n);  /* XXX motherboard, ick */
+   retval += printf(\n);
 
return (retval);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235908 - head/sys/arm/arm

2012-05-24 Thread Grzegorz Bernacki
Author: gber
Date: Thu May 24 12:41:57 2012
New Revision: 235908
URL: http://svn.freebsd.org/changeset/base/235908

Log:
  Return Supervisor SP and LR registers instead of User ones while in KDB 
thread.
  
  Obtained from: Semihalf

Modified:
  head/sys/arm/arm/gdb_machdep.c

Modified: head/sys/arm/arm/gdb_machdep.c
==
--- head/sys/arm/arm/gdb_machdep.c  Thu May 24 12:38:24 2012
(r235907)
+++ head/sys/arm/arm/gdb_machdep.c  Thu May 24 12:41:57 2012
(r235908)
@@ -54,8 +54,12 @@ gdb_cpu_getreg(int regnum, size_t *regsz
*regsz = gdb_cpu_regsz(regnum);
 
if (kdb_thread == curthread) {
-   if (regnum  15)
+   if (regnum  13)
return (kdb_frame-tf_r0 + regnum);
+   if (regnum == 13)
+   return (kdb_frame-tf_svc_sp);
+   if (regnum == 14)
+   return (kdb_frame-tf_svc_lr);
if (regnum == 15)
return (kdb_frame-tf_pc);
if (regnum == 25)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump

2012-05-24 Thread Alexander Motin
Author: mav
Date: Thu May 24 14:07:44 2012
New Revision: 235911
URL: http://svn.freebsd.org/changeset/base/235911

Log:
  MFprojects/zfsd:
  Revamp the CAM enclosure services driver.
  This updated driver uses an in-kernel daemon to track state changes and
  publishes physical path location information\for disk elements into the
  CAM device database.
  
  Sponsored by:   Spectra Logic Corporation
  Sponsored by:   iXsystems, Inc.
  Submitted by:   gibbs, will, mav

Added:
  head/sys/cam/scsi/scsi_enc.c   (contents, props changed)
  head/sys/cam/scsi/scsi_enc.h   (contents, props changed)
  head/sys/cam/scsi/scsi_enc_internal.h   (contents, props changed)
  head/sys/cam/scsi/scsi_enc_safte.c   (contents, props changed)
  head/sys/cam/scsi/scsi_enc_ses.c   (contents, props changed)
Deleted:
  head/sys/cam/scsi/scsi_ses.c
Modified:
  head/share/examples/ses/Makefile.inc
  head/share/examples/ses/srcs/eltsub.c
  head/share/examples/ses/srcs/getencstat.c
  head/share/examples/ses/srcs/getnobj.c
  head/share/examples/ses/srcs/getobjmap.c
  head/share/examples/ses/srcs/getobjstat.c
  head/share/examples/ses/srcs/inienc.c
  head/share/examples/ses/srcs/sesd.c
  head/share/examples/ses/srcs/setencstat.c
  head/share/examples/ses/srcs/setobjstat.c
  head/sys/cam/scsi/scsi_ses.h
  head/sys/conf/files
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/modules/cam/Makefile
  head/usr.bin/kdump/mkioctls

Modified: head/share/examples/ses/Makefile.inc
==
--- head/share/examples/ses/Makefile.incThu May 24 13:15:15 2012
(r235910)
+++ head/share/examples/ses/Makefile.incThu May 24 14:07:44 2012
(r235911)
@@ -32,7 +32,6 @@
 # mja...@feral.com
 #
 
-CFLAGS+= -I/usr/include/cam/scsi -DSESINC=scsi_ses.h
 BINDIR?= /usr/sbin
 
 CLEANFILES+= ${MAN}

Modified: head/share/examples/ses/srcs/eltsub.c
==
--- head/share/examples/ses/srcs/eltsub.c   Thu May 24 13:15:15 2012
(r235910)
+++ head/share/examples/ses/srcs/eltsub.c   Thu May 24 14:07:44 2012
(r235911)
@@ -33,10 +33,13 @@
  */
 
 #include unistd.h
+#include stddef.h
+#include stdint.h
 #include stdlib.h
 #include stdio.h
 #include sys/ioctl.h
-#include SESINC
+#include cam/scsi/scsi_all.h
+#include cam/scsi/scsi_enc.h
 
 #include eltsub.h
 
@@ -46,79 +49,82 @@ geteltnm(int type)
static char rbuf[132];
 
switch (type) {
-   case SESTYP_UNSPECIFIED:
+   case ELMTYP_UNSPECIFIED:
sprintf(rbuf, Unspecified);
break;
-   case SESTYP_DEVICE:
-   sprintf(rbuf, Device);
+   case ELMTYP_DEVICE:
+   sprintf(rbuf, Device Slot);
break;
-   case SESTYP_POWER:
-   sprintf(rbuf, Power supply);
+   case ELMTYP_POWER:
+   sprintf(rbuf, Power Supply);
break;
-   case SESTYP_FAN:
-   sprintf(rbuf, Cooling element);
+   case ELMTYP_FAN:
+   sprintf(rbuf, Cooling);
break;
-   case SESTYP_THERM:
-   sprintf(rbuf, Temperature sensors);
+   case ELMTYP_THERM:
+   sprintf(rbuf, Temperature Sensors);
break;
-   case SESTYP_DOORLOCK:
+   case ELMTYP_DOORLOCK:
sprintf(rbuf, Door Lock);
break;
-   case SESTYP_ALARM:
+   case ELMTYP_ALARM:
sprintf(rbuf, Audible alarm);
break;
-   case SESTYP_ESCC:
-   sprintf(rbuf, Enclosure services controller electronics);
+   case ELMTYP_ESCC:
+   sprintf(rbuf, Enclosure Eervices Controller Electronics);
break;
-   case SESTYP_SCC:
-   sprintf(rbuf, SCC controller electronics);
+   case ELMTYP_SCC:
+   sprintf(rbuf, SCC Controller Electronics);
break;
-   case SESTYP_NVRAM:
-   sprintf(rbuf, Nonvolatile cache);
+   case ELMTYP_NVRAM:
+   sprintf(rbuf, Nonvolatile Cache);
break;
-   case SESTYP_UPS:
-   sprintf(rbuf, Uninterruptible power supply);
+   case ELMTYP_INV_OP_REASON:
+   sprintf(rbuf, Invalid Operation Reason);
break;
-   case SESTYP_DISPLAY:
+   case ELMTYP_UPS:
+   sprintf(rbuf, Uninterruptible Power Supply);
+   break;
+   case ELMTYP_DISPLAY:
sprintf(rbuf, Display);
break;
-   case SESTYP_KEYPAD:
-   sprintf(rbuf, Key pad entry device);
+   case ELMTYP_KEYPAD:
+   sprintf(rbuf, Key Pad Entry);
break;
-   case SESTYP_ENCLOSURE:
+   case ELMTYP_ENCLOSURE:
sprintf(rbuf, Enclosure);
break;
-   case SESTYP_SCSIXVR:
-   sprintf(rbuf, SCSI port/transceiver);
+   case ELMTYP_SCSIXVR:
+ 

Re: svn commit: r235911 - in head: share/examples/ses share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump

2012-05-24 Thread Konstantin Belousov
On Thu, May 24, 2012 at 02:07:44PM +, Alexander Motin wrote:
 Author: mav
 Date: Thu May 24 14:07:44 2012
 New Revision: 235911
 URL: http://svn.freebsd.org/changeset/base/235911
 
 Log:
   MFprojects/zfsd:
   Revamp the CAM enclosure services driver.
   This updated driver uses an in-kernel daemon to track state changes and
   publishes physical path location information\for disk elements into the
   CAM device database.
   
   Sponsored by:   Spectra Logic Corporation
   Sponsored by:   iXsystems, Inc.
   Submitted by:   gibbs, will, mav
 
 Added:
   head/sys/cam/scsi/scsi_enc.c   (contents, props changed)
   head/sys/cam/scsi/scsi_enc.h   (contents, props changed)
   head/sys/cam/scsi/scsi_enc_internal.h   (contents, props changed)
   head/sys/cam/scsi/scsi_enc_safte.c   (contents, props changed)
   head/sys/cam/scsi/scsi_enc_ses.c   (contents, props changed)
 Deleted:
   head/sys/cam/scsi/scsi_ses.c
 Modified:
   head/share/examples/ses/Makefile.inc
   head/share/examples/ses/srcs/eltsub.c
   head/share/examples/ses/srcs/getencstat.c
   head/share/examples/ses/srcs/getnobj.c
   head/share/examples/ses/srcs/getobjmap.c
   head/share/examples/ses/srcs/getobjstat.c
   head/share/examples/ses/srcs/inienc.c
   head/share/examples/ses/srcs/sesd.c
   head/share/examples/ses/srcs/setencstat.c
   head/share/examples/ses/srcs/setobjstat.c
   head/sys/cam/scsi/scsi_ses.h
   head/sys/conf/files
   head/sys/fs/devfs/devfs_vnops.c
   head/sys/modules/cam/Makefile
   head/usr.bin/kdump/mkioctls

The devfs change should have been committed separately. Also, I do not
see why devfs should do this to aliases at all. Also, your change only
handles jails and not chroots, why ?


Index: devfs_vnops.c
===
--- devfs_vnops.c   (revision 235910)
+++ devfs_vnops.c   (revision 235911)
@@ -1266,8 +1266,53 @@ static int
 devfs_readlink(struct vop_readlink_args *ap)
 {
struct devfs_dirent *de;
+   struct cdev_priv *cdp;
 
de = ap-a_vp-v_data;
+   cdp = de-de_cdp;
+
+   if (cdp != NULL  (cdp-cdp_c.si_flags  SI_ALIAS) != 0) {
+   struct devfs_mount *dmp;
+   struct prison *pr;
+   char *mp;
+   int mp_len;
+   int pr_path_len;
+   int err;
The declarations should be placed at the start of the function, not
at the start of the block.

+
+   /*
+* For device aliases, construct an absolute symlink (to
+* shorten its length and avoid the ugliness of a relative
+* link) by prepending the fully qualified path to the root
+* of this devfs.  For a non-jailed process, the devfs root
+* is our mount point.  For a jailed process, we must remove
+* any jail prefix in our mount point so that our response
+* matches the user process's world view.
+*/
+   dmp = VFSTODEVFS(ap-a_vp-v_mount);
+   mp = dmp-dm_mount-mnt_stat.f_mntonname;
+   mp_len = strlen(mp);
+
+   pr = ap-a_cred-cr_prison;
+   pr_path_len = strlen(pr-pr_path);
+
+   if (strncmp(pr-pr_path, mp, pr_path_len) == 0
+ mp[pr_path_len] == '/') {
Style prefers to put '' on the first line, and not on the continuation
line.

I suspect that you may access mp past the end of its memory there, no ?

+   mp += pr_path_len;
+   mp_len -= pr_path_len;
+   }
+
+   err = uiomove(mp, mp_len, ap-a_uio);
+   if (err != 0)
+   return (err);
+
+   /*
+* Devfs cannot be the root file system, so its
+* mount point must always be terminated by a '/'.
+*/
+   err = uiomove(/, 1, ap-a_uio);
+   if (err != 0)
+   return (err);
+   }
return (uiomove(de-de_symlink, strlen(de-de_symlink), ap-a_uio));
 }
 


pgp7lOMqlAv1w.pgp
Description: PGP signature


svn commit: r235912 - head/sys/i386/i386

2012-05-24 Thread Alan Cox
Author: alc
Date: Thu May 24 15:25:35 2012
New Revision: 235912
URL: http://svn.freebsd.org/changeset/base/235912

Log:
  MF amd64 r233097, r233122
  
  With the changes over the past year to how accesses to the page's dirty
  field are synchronized, there is no need for pmap_protect() to acquire
  the page queues lock unless it is going to access the pv lists or
  PMAP1/PADDR1.
  
  Style fix to pmap_protect().

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Thu May 24 14:07:44 2012(r235911)
+++ head/sys/i386/i386/pmap.c   Thu May 24 15:25:35 2012(r235912)
@@ -3050,7 +3050,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
vm_offset_t pdnxt;
pd_entry_t ptpaddr;
pt_entry_t *pte;
-   int anychanged;
+   boolean_t anychanged, pv_lists_locked;
 
if ((prot  VM_PROT_READ) == VM_PROT_NONE) {
pmap_remove(pmap, sva, eva);
@@ -3066,10 +3066,16 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
return;
 #endif
 
-   anychanged = 0;
+   if (pmap_is_current(pmap))
+   pv_lists_locked = FALSE;
+   else {
+   pv_lists_locked = TRUE;
+resume:
+   vm_page_lock_queues();
+   sched_pin();
+   }
+   anychanged = FALSE;
 
-   vm_page_lock_queues();
-   sched_pin();
PMAP_LOCK(pmap);
for (; sva  eva; sva = pdnxt) {
pt_entry_t obits, pbits;
@@ -3104,12 +3110,27 @@ pmap_protect(pmap_t pmap, vm_offset_t sv
 */
if (pmap_protect_pde(pmap,
pmap-pm_pdir[pdirindex], sva, prot))
-   anychanged = 1;
-   continue;
-   } else if (!pmap_demote_pde(pmap,
-   pmap-pm_pdir[pdirindex], sva)) {
-   /* The large page mapping was destroyed. */
+   anychanged = TRUE;
continue;
+   } else {
+   if (!pv_lists_locked) {
+   pv_lists_locked = TRUE;
+   if (!mtx_trylock(vm_page_queue_mtx)) {
+   if (anychanged)
+   pmap_invalidate_all(
+   pmap);
+   PMAP_UNLOCK(pmap);
+   goto resume;
+   }
+   }
+   if (!pmap_demote_pde(pmap,
+   pmap-pm_pdir[pdirindex], sva)) {
+   /*
+* The large page mapping was
+* destroyed.
+*/
+   continue;
+   }
}
}
 
@@ -3155,14 +3176,16 @@ retry:
if (obits  PG_G)
pmap_invalidate_page(pmap, sva);
else
-   anychanged = 1;
+   anychanged = TRUE;
}
}
}
-   sched_unpin();
if (anychanged)
pmap_invalidate_all(pmap);
-   vm_page_unlock_queues();
+   if (pv_lists_locked) {
+   sched_unpin();
+   vm_page_unlock_queues();
+   }
PMAP_UNLOCK(pmap);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235915 - head/usr.bin

2012-05-24 Thread Josh Paetzel
Author: jpaetzel
Date: Thu May 24 16:11:51 2012
New Revision: 235915
URL: http://svn.freebsd.org/changeset/base/235915

Log:
  Hook up mkulzma to the build.
  
  MFC after:3 days

Modified:
  head/usr.bin/Makefile

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Thu May 24 16:11:13 2012(r235914)
+++ head/usr.bin/Makefile   Thu May 24 16:11:51 2012(r235915)
@@ -105,6 +105,7 @@ SUBDIR= alias \
mkfifo \
mklocale \
mktemp \
+   mkulzma \
mkuzip \
mt \
ncal \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235916 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 16:30:13 2012
New Revision: 235916
URL: http://svn.freebsd.org/changeset/base/235916

Log:
  MFp4 bz_ipv6_fast:
  
Introduce in6_getscope() to allow more effective checksum
computations without the need to copy the address to clear the
scope.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/scope6.c
  head/sys/netinet6/scope6_var.h

Modified: head/sys/netinet6/scope6.c
==
--- head/sys/netinet6/scope6.c  Thu May 24 16:11:51 2012(r235915)
+++ head/sys/netinet6/scope6.c  Thu May 24 16:30:13 2012(r235916)
@@ -494,3 +494,16 @@ in6_clearscope(struct in6_addr *in6)
 
return (modified);
 }
+
+/*
+ * Return the scope identifier or zero.
+ */
+uint16_t
+in6_getscope(struct in6_addr *in6)
+{
+
+   if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6))
+   return (in6-s6_addr16[1]);
+
+   return (0);
+}

Modified: head/sys/netinet6/scope6_var.h
==
--- head/sys/netinet6/scope6_var.h  Thu May 24 16:11:51 2012
(r235915)
+++ head/sys/netinet6/scope6_var.h  Thu May 24 16:30:13 2012
(r235916)
@@ -54,6 +54,7 @@ int   sa6_embedscope __P((struct sockaddr_
 intsa6_recoverscope __P((struct sockaddr_in6 *));
 intin6_setscope __P((struct in6_addr *, struct ifnet *, u_int32_t *));
 intin6_clearscope __P((struct in6_addr *));
+uint16_t in6_getscope(struct in6_addr *);
 #endif /* _KERNEL */
 
 #endif /* _NETINET6_SCOPE6_VAR_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r235746 - head/sys/net

2012-05-24 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2012-05-24 06:44:48 -0400, Alexander V. Chernikov wrote:
 Does the attached patch look ok to you?

Generally looks good.  Few nits:

- --- bpf.c ---

1713: #ifdef BPF_JITTER
1714:   bpf_jit_filter *ofunc, *jfunc;
1715: #endif

Please add jfunc before ofunc, i.e., style(9).

1743:   if (copyin((caddr_t)fp-bf_insns, (caddr_t)fcode, size) != 0 ||
1744:   (bpf_validate(fcode, (int)flen) == 0)) {
1745:   free(fcode, M_BPF);
1746:   return (EINVAL);
1747:   }

Excessive parens @ L1744.

1752: #ifdef BPF_JITTER
1753:   if (fp-bf_insns != NULL)
1754:   jfunc = bpf_jitter(fcode, flen);
1755:   else
1756:   jfunc = NULL; /* Make compiler happy */
1757: #endif

Please test 'fcode' instead of 'fp-bf_insns' for consistency.

- --- bpf_jitter.c ---

72: #ifdef _KERNEL
73: filter = (struct bpf_jit_filter *)malloc(sizeof(*filter),
74: M_BPFJIT, M_WAITOK);
75: #else

This change is bogus because bpf_jit_compile() does more malloc(9)
calls with M_NOWAIT, bpf_jitter() failures are not fatal (i.e., all
consumers fall back to bpf_filter(9)), all consumers (e.g., ng_bpf.c)
assume M_NOWAIT, etc, etc...

Please note I haven't looked at other locking changes.

Thanks,

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk++ZAAACgkQmlay1b9qnVObOgCfZmKOtPC8BhsnUK4I9LC5fW53
ePwAnipYRZFYNSi/5KFs2J3+L62zUMId
=CASZ
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235918 - head/sys/geom/label

2012-05-24 Thread Edward Tomasz Napierala
Author: trasz
Date: Thu May 24 16:48:33 2012
New Revision: 235918
URL: http://svn.freebsd.org/changeset/base/235918

Log:
  Make g_label(4) ignore provider size when looking for UFS labels.
  Without it, it fails to create labels for filesystems resized by
  growfs(8).
  
  PR:   kern/165962
  Submitted by: Olivier Cochard-Labbe olivier at cochard dot me

Modified:
  head/sys/geom/label/g_label_ufs.c

Modified: head/sys/geom/label/g_label_ufs.c
==
--- head/sys/geom/label/g_label_ufs.c   Thu May 24 16:41:26 2012
(r235917)
+++ head/sys/geom/label/g_label_ufs.c   Thu May 24 16:48:33 2012
(r235918)
@@ -81,12 +81,10 @@ g_label_ufs_taste_common(struct g_consum
fs = (struct fs *)g_read_data(cp, superblock, SBLOCKSIZE, NULL);
if (fs == NULL)
continue;
-   /* Check for magic and make sure things are the right size */
-   if (fs-fs_magic == FS_UFS1_MAGIC  fs-fs_fsize  0 
-   pp-mediasize / fs-fs_fsize == fs-fs_old_size) {
+   /* Check for magic */
+   if (fs-fs_magic == FS_UFS1_MAGIC  fs-fs_fsize  0) {
/* Valid UFS1. */
-   } else if (fs-fs_magic == FS_UFS2_MAGIC  fs-fs_fsize  0 
-   pp-mediasize / fs-fs_fsize == fs-fs_size) {
+   } else if (fs-fs_magic == FS_UFS2_MAGIC  fs-fs_fsize  0) {
/* Valid UFS2. */
} else {
g_free(fs);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235920 - head/sys/conf

2012-05-24 Thread Jack F Vogel
Author: jfv
Date: Thu May 24 17:39:54 2012
New Revision: 235920
URL: http://svn.freebsd.org/changeset/base/235920

Log:
  Fix to kern/168294 - add flow director support into the
  static kernel build of ixgbe. Thanks Sergey for pointing
  this out.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Thu May 24 17:10:54 2012(r235919)
+++ head/sys/conf/files Thu May 24 17:39:54 2012(r235920)
@@ -1522,7 +1522,7 @@ dev/ixgb/if_ixgb.coptional ixgb
 dev/ixgb/ixgb_ee.c optional ixgb
 dev/ixgb/ixgb_hw.c optional ixgb
 dev/ixgbe/ixgbe.c  optional ixgbe inet \
-   compile-with ${NORMAL_C} -I$S/dev/ixgbe
+   compile-with ${NORMAL_C} -I$S/dev/ixgbe -DSMP -DIXGBE_FDIR
 dev/ixgbe/ixv.coptional ixgbe inet \
compile-with ${NORMAL_C} -I$S/dev/ixgbe
 dev/ixgbe/ixgbe_phy.c  optional ixgbe inet \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235921 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 18:05:10 2012
New Revision: 235921
URL: http://svn.freebsd.org/changeset/base/235921

Log:
  MFp4 bz_ipv6_fast:
  
Optimize in6_cksum(), re-ordering work and limiting variable
initialization, removing a bzero() for mostly re-initialized
struct values, making use of the newly introduced in6_getscope(),
as well as converting an if/panic to a KASSERT().
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/in6_cksum.c

Modified: head/sys/netinet6/in6_cksum.c
==
--- head/sys/netinet6/in6_cksum.c   Thu May 24 17:39:54 2012
(r235920)
+++ head/sys/netinet6/in6_cksum.c   Thu May 24 18:05:10 2012
(r235921)
@@ -89,12 +89,10 @@ __FBSDID($FreeBSD$);
 int
 in6_cksum(struct mbuf *m, u_int8_t nxt, u_int32_t off, u_int32_t len)
 {
-   u_int16_t *w;
-   int sum = 0;
-   int mlen = 0;
-   int byte_swapped = 0;
struct ip6_hdr *ip6;
-   struct in6_addr in6;
+   u_int16_t *w, scope;
+   int byte_swapped, mlen;
+   int sum;
union {
u_int16_t phs[4];
struct {
@@ -112,42 +110,38 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, 
u_int32_t l;
} l_util;
 
-   /* sanity check */
-   if (m-m_pkthdr.len  off + len) {
-   panic(in6_cksum: mbuf len (%d)  off+len (%d+%d),
-   m-m_pkthdr.len, off, len);
-   }
-
-   bzero(uph, sizeof(uph));
+   /* Sanity check. */
+   KASSERT(m-m_pkthdr.len = off + len, (%s: mbuf len (%d)  off(%d)+
+   len(%d), __func__, m-m_pkthdr.len, off, len));
 
/*
 * First create IP6 pseudo header and calculate a summary.
 */
-   ip6 = mtod(m, struct ip6_hdr *);
uph.ph.ph_len = htonl(len);
+   uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0;
uph.ph.ph_nxt = nxt;
 
-   /*
-* IPv6 source address.
-* XXX: we'd like to avoid copying the address, but we can't due to
-* the possibly embedded scope zone ID.
-*/
-   in6 = ip6-ip6_src;
-   in6_clearscope(in6);
-   w = (u_int16_t *)in6;
+   /* Payload length and upper layer identifier. */
+   sum = uph.phs[0];  sum += uph.phs[1];
+   sum += uph.phs[2];  sum += uph.phs[3];
+
+   ip6 = mtod(m, struct ip6_hdr *);
+
+   /* IPv6 source address. */
+   scope = in6_getscope(ip6-ip6_src);
+   w = (u_int16_t *)ip6-ip6_src;
sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
+   if (scope != 0)
+   sum -= scope;
 
-   /* IPv6 destination address */
-   in6 = ip6-ip6_dst;
-   in6_clearscope(in6);
-   w = (u_int16_t *)in6;
+   /* IPv6 destination address. */
+   scope = in6_getscope(ip6-ip6_dst);
+   w = (u_int16_t *)ip6-ip6_dst;
sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
-
-   /* Payload length and upper layer identifier */
-   sum += uph.phs[0];  sum += uph.phs[1];
-   sum += uph.phs[2];  sum += uph.phs[3];
+   if (scope != 0)
+   sum -= scope;
 
/*
 * Secondly calculate a summary of the first mbuf excluding offset.
@@ -167,14 +161,16 @@ in6_cksum(struct mbuf *m, u_int8_t nxt, 
/*
 * Force to even boundary.
 */
-   if ((1  (long) w)  (mlen  0)) {
+   if ((1  (long)w)  (mlen  0)) {
REDUCE;
sum = 8;
s_util.c[0] = *(u_char *)w;
w = (u_int16_t *)((char *)w + 1);
mlen--;
byte_swapped = 1;
-   }
+   } else
+   byte_swapped = 0;
+   
/*
 * Unroll the loop to make overhead from
 * branches c small.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235922 - head/sys/fs/devfs

2012-05-24 Thread Alexander Motin
Author: mav
Date: Thu May 24 18:19:23 2012
New Revision: 235922
URL: http://svn.freebsd.org/changeset/base/235922

Log:
  Revert devfs part of r235911. I was unaware about old but unfinished
  discussion between kib@ and gibbs@ about it.

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==
--- head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:05:10 2012
(r235921)
+++ head/sys/fs/devfs/devfs_vnops.c Thu May 24 18:19:23 2012
(r235922)
@@ -1266,53 +1266,8 @@ static int
 devfs_readlink(struct vop_readlink_args *ap)
 {
struct devfs_dirent *de;
-   struct cdev_priv *cdp;
 
de = ap-a_vp-v_data;
-   cdp = de-de_cdp;
-
-   if (cdp != NULL  (cdp-cdp_c.si_flags  SI_ALIAS) != 0) {
-   struct devfs_mount *dmp;
-   struct prison *pr;
-   char *mp;
-   int mp_len;
-   int pr_path_len;
-   int err;
-
-   /*
-* For device aliases, construct an absolute symlink (to
-* shorten its length and avoid the ugliness of a relative
-* link) by prepending the fully qualified path to the root
-* of this devfs.  For a non-jailed process, the devfs root
-* is our mount point.  For a jailed process, we must remove
-* any jail prefix in our mount point so that our response
-* matches the user process's world view.
-*/
-   dmp = VFSTODEVFS(ap-a_vp-v_mount);
-   mp = dmp-dm_mount-mnt_stat.f_mntonname;
-   mp_len = strlen(mp);
-
-   pr = ap-a_cred-cr_prison;
-   pr_path_len = strlen(pr-pr_path);
-
-   if (strncmp(pr-pr_path, mp, pr_path_len) == 0
- mp[pr_path_len] == '/') {
-   mp += pr_path_len;
-   mp_len -= pr_path_len;
-   }
-
-   err = uiomove(mp, mp_len, ap-a_uio);
-   if (err != 0)
-   return (err);
-
-   /*
-* Devfs cannot be the root file system, so its
-* mount point must always be terminated by a '/'.
-*/
-   err = uiomove(/, 1, ap-a_uio);
-   if (err != 0)
-   return (err);
-   }
return (uiomove(de-de_symlink, strlen(de-de_symlink), ap-a_uio));
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235923 - head/sys/netgraph

2012-05-24 Thread Gleb Smirnoff
Author: glebius
Date: Thu May 24 18:22:57 2012
New Revision: 235923
URL: http://svn.freebsd.org/changeset/base/235923

Log:
  Revert r220768 for ng_ksocket. This node is special and
  when it is cloning, its constructor method may be called
  in a context that isn't allowed to sleep.
  
  Noticed by:   Vadim Goncharov

Modified:
  head/sys/netgraph/ng_ksocket.c
  head/sys/netgraph/ng_mppc.c

Modified: head/sys/netgraph/ng_ksocket.c
==
--- head/sys/netgraph/ng_ksocket.c  Thu May 24 18:19:23 2012
(r235922)
+++ head/sys/netgraph/ng_ksocket.c  Thu May 24 18:22:57 2012
(r235923)
@@ -524,7 +524,9 @@ ng_ksocket_constructor(node_p node)
priv_p priv;
 
/* Allocate private structure */
-   priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_WAITOK | M_ZERO);
+   priv = malloc(sizeof(*priv), M_NETGRAPH_KSOCKET, M_NOWAIT | M_ZERO);
+   if (priv == NULL)
+   return (ENOMEM);
 
LIST_INIT(priv-embryos);
/* cross link them */

Modified: head/sys/netgraph/ng_mppc.c
==
--- head/sys/netgraph/ng_mppc.c Thu May 24 18:19:23 2012(r235922)
+++ head/sys/netgraph/ng_mppc.c Thu May 24 18:22:57 2012(r235923)
@@ -98,15 +98,6 @@ static MALLOC_DEFINE(M_NETGRAPH_MPPC, n
 /* Key length */
 #define KEYLEN(b)  (((b)  MPPE_128) ? 16 : 8)
 
-/*
- * When packets are lost with MPPE, we may have to re-key arbitrarily
- * many times to 'catch up' to the new jumped-ahead sequence number.
- * Since this can be expensive, we pose a limit on how many re-keyings
- * we will do at one time to avoid a possible D.O.S. vulnerability.
- * This should instead be a configurable parameter.
- */
-#define MPPE_MAX_REKEY 1000
-
 /* MPPC packet header bits */
 #define MPPC_FLAG_FLUSHED  0x8000  /* xmitter reset state */
 #define MPPC_FLAG_RESTART  0x4000  /* compress history restart */
@@ -641,20 +632,22 @@ ng_mppc_decompress(node_p node, struct m
 #endif
 #ifdef NETGRAPH_MPPC_ENCRYPTION
if ((d-cfg.bits  MPPE_BITS) != 0) {
-   u_int rekey;
-
-   /* How many times are we going to have to re-key? */
-   rekey = ((d-cfg.bits  MPPE_STATELESS) != 0) ?
-   numLost : (numLost / (MPPE_UPDATE_MASK + 1));
-   if (rekey  MPPE_MAX_REKEY) {
-   log(LOG_ERR, %s: too many (%d) packets
-dropped, disabling node %p!,
-   __func__, numLost, node);
-   priv-recv.cfg.enable = 0;
-   goto failed;
-   }
-
-   /* Re-key as necessary to catch up to peer */
+   u_int rekey;
+ 
+   /* How many times are we going to have to re-key? */
+   rekey = ((d-cfg.bits  MPPE_STATELESS) != 0) ?
+   numLost : (numLost / (MPPE_UPDATE_MASK + 1));
+   if (rekey  1000)
+   log(LOG_ERR, %s: %d packets dropped, 
+  node [%x]\n, __func__, numLost,
+  node-nd_ID);
+
+   /*
+* When packets are lost or re-ordered with MPPE,
+* we may have to re-key up to 0xfff times to 'catch
+* up' to the new jumped-ahead sequence number. Yep,
+* this is heavy, but what else can we do?
+*/
while (d-cc != cc) {
if ((d-cfg.bits  MPPE_STATELESS) != 0
|| (d-cc  MPPE_UPDATE_MASK)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235924 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 18:25:09 2012
New Revision: 235924
URL: http://svn.freebsd.org/changeset/base/235924

Log:
  MFp4 bz_ipv6_fast:
  
Introduce a (for now copied stripped down) in6_cksum_pseudo()
function.  We should be able to use this from in6_cksum() but
we should also ponder possible MD specific improvements.
It takes an extra csum argument to allow for easy checks as
will be done by the upper layer protocol input paths.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/in6.h
  head/sys/netinet6/in6_cksum.c

Modified: head/sys/netinet6/in6.h
==
--- head/sys/netinet6/in6.h Thu May 24 18:22:57 2012(r235923)
+++ head/sys/netinet6/in6.h Thu May 24 18:25:09 2012(r235924)
@@ -632,7 +632,9 @@ struct ip6_mtuinfo {
 
 #ifdef _KERNEL
 struct cmsghdr;
+struct ip6_hdr;
 
+intin6_cksum_pseudo(struct ip6_hdr *, uint32_t, uint8_t, uint16_t);
 intin6_cksum __P((struct mbuf *, u_int8_t, u_int32_t, u_int32_t));
 intin6_localaddr __P((struct in6_addr *));
 intin6_localip(struct in6_addr *);

Modified: head/sys/netinet6/in6_cksum.c
==
--- head/sys/netinet6/in6_cksum.c   Thu May 24 18:22:57 2012
(r235923)
+++ head/sys/netinet6/in6_cksum.c   Thu May 24 18:25:09 2012
(r235924)
@@ -80,6 +80,66 @@ __FBSDID($FreeBSD$);
 #define ADDCARRY(x)  (x  65535 ? x -= 65535 : x)
 #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; 
(void)ADDCARRY(sum);}
 
+static int
+_in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t 
csum)
+{
+   int sum;
+   uint16_t scope, *w;
+   union {
+   u_int16_t phs[4];
+   struct {
+   u_int32_t   ph_len;
+   u_int8_tph_zero[3];
+   u_int8_tph_nxt;
+   } __packed ph;
+   } uph;
+
+   sum = csum;
+
+   /*
+* First create IP6 pseudo header and calculate a summary.
+*/
+   uph.ph.ph_len = htonl(len);
+   uph.ph.ph_zero[0] = uph.ph.ph_zero[1] = uph.ph.ph_zero[2] = 0;
+   uph.ph.ph_nxt = nxt;
+
+   /* Payload length and upper layer identifier. */
+   sum += uph.phs[0];  sum += uph.phs[1];
+   sum += uph.phs[2];  sum += uph.phs[3];
+
+   /* IPv6 source address. */
+   scope = in6_getscope(ip6-ip6_src);
+   w = (u_int16_t *)ip6-ip6_src;
+   sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
+   sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
+   if (scope != 0)
+   sum -= scope;
+
+   /* IPv6 destination address. */
+   scope = in6_getscope(ip6-ip6_dst);
+   w = (u_int16_t *)ip6-ip6_dst;
+   sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3];
+   sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7];
+   if (scope != 0)
+   sum -= scope;
+
+   return (sum);
+}
+
+int
+in6_cksum_pseudo(struct ip6_hdr *ip6, uint32_t len, uint8_t nxt, uint16_t csum)
+{
+   int sum;
+   union {
+   u_int16_t s[2];
+   u_int32_t l;
+   } l_util;
+
+   sum = _in6_cksum_pseudo(ip6, len, nxt, csum);
+   REDUCE;
+   return (sum);
+}
+
 /*
  * m MUST contain a contiguous IP6 header.
  * off is an offset where TCP/UDP/ICMP6 header starts.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235925 - head/sys/dev/drm2/i915

2012-05-24 Thread Dimitry Andric
Author: dim
Date: Thu May 24 19:13:54 2012
New Revision: 235925
URL: http://svn.freebsd.org/changeset/base/235925

Log:
  Fix the following clang warning in drm2:
  
sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused 
[-Werror,-Wunused-value]
_intel_wait_for(dev,
^~~~
@/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro 
'_intel_wait_for'
ret;\
^~~
  
  Reviewed by:  kib
  MFC after:1 week

Modified:
  head/sys/dev/drm2/i915/intel_display.c

Modified: head/sys/dev/drm2/i915/intel_display.c
==
--- head/sys/dev/drm2/i915/intel_display.c  Thu May 24 18:25:09 2012
(r235924)
+++ head/sys/dev/drm2/i915/intel_display.c  Thu May 24 19:13:54 2012
(r235925)
@@ -8858,7 +8858,7 @@ static void ironlake_disable_rc6(struct 
if (I915_READ(PWRCTXA)) {
/* Wake the GPU, prevent RC6, then restore RSTDBYCTL */
I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) | RCX_SW_EXIT);
-   _intel_wait_for(dev,
+   (void)_intel_wait_for(dev,
((I915_READ(RSTDBYCTL)  RSX_STATUS_MASK) == RSX_STATUS_ON),
50, 1, 915pro);
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235927 - head/bin/sh

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 19:48:15 2012
New Revision: 235927
URL: http://svn.freebsd.org/changeset/base/235927

Log:
  Work better with how make/bmake works:
  1.  Avoid a cd back into ${.CURDIR} to run mkbuiltins when we know make
  will first cd into ${.OBJDIR}. Keep the cwd to what make sets it to.
  2.  Don't tell mkbuiltins where to write to (= ${.OBJDIR}), but where to
  get sources from (= ${.CURDIR}). This to compensate for point 1.
  
  This fixes a problem with bmake's mk files that optimize ${.OBJDIR} to
  expand to . after changing cwd, not taking into account that the
  target is pretty much undoing that and not getting the full path to the
  object tree anymore.

Modified:
  head/bin/sh/Makefile
  head/bin/sh/mkbuiltins

Modified: head/bin/sh/Makefile
==
--- head/bin/sh/MakefileThu May 24 19:24:31 2012(r235926)
+++ head/bin/sh/MakefileThu May 24 19:48:15 2012(r235927)
@@ -38,7 +38,7 @@ build-tools: mkinit mknodes mksyntax
 
 .ORDER: builtins.c builtins.h
 builtins.c builtins.h: mkbuiltins builtins.def
-   cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
+   sh ${.CURDIR}/mkbuiltins ${.CURDIR}
 
 init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
redir.c trap.c var.c

Modified: head/bin/sh/mkbuiltins
==
--- head/bin/sh/mkbuiltins  Thu May 24 19:24:31 2012(r235926)
+++ head/bin/sh/mkbuiltins  Thu May 24 19:48:15 2012(r235927)
@@ -35,17 +35,17 @@
 # $FreeBSD$
 
 temp=`/usr/bin/mktemp -t ka`
-havejobs=0
-if grep '^#define[  ]*JOBS[ ]*1' shell.h  /dev/null
-then   havejobs=1
-fi
 havehist=1
 if [ X$1 = X-h ]; then
havehist=0
shift
 fi
-objdir=$1
-exec  ${objdir}/builtins.c
+srcdir=$1
+havejobs=0
+if grep '^#define[  ]*JOBS[ ]*1' $srcdir/shell.h  /dev/null
+then   havejobs=1
+fi
+exec  builtins.c
 cat \!
 /*
  * This file was generated by the mkbuiltins program.
@@ -57,7 +57,7 @@ cat \!
 
 !
 awk '/^[^#]/ {if(('$havejobs' || $2 != -j)  ('$havehist' || $2 != -h)) \
-print $0}' builtins.def | sed 's/-[hj]//'  $temp
+print $0}' $srcdir/builtins.def | sed 's/-[hj]//'  $temp
 echo 'int (*const builtinfunc[])(int, char **) = {'
 awk '/^[^#]/ { printf \t%s,\n, $1}' $temp
 echo '};
@@ -74,7 +74,7 @@ awk '{for (i = 2 ; i = NF ; i++) {
 echo ' { NULL, 0, 0 }
 };'
 
-exec  ${objdir}/builtins.h
+exec  builtins.h
 cat \!
 /*
  * This file was generated by the mkbuiltins program.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235928 - head/share/mk

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 20:00:58 2012
New Revision: 235928
URL: http://svn.freebsd.org/changeset/base/235928

Log:
  Fix an inconsistency I just ran into for LDADD and DPADD. The description
  for both of them use different, and presumably wrong, variables in the
  example. They set LDFILES and SRCLIB respectively. I guess that's what
  DPADD and LDADD were called first ...

Modified:
  head/share/mk/bsd.README

Modified: head/share/mk/bsd.README
==
--- head/share/mk/bsd.READMEThu May 24 19:48:15 2012(r235927)
+++ head/share/mk/bsd.READMEThu May 24 20:00:58 2012(r235928)
@@ -228,7 +228,7 @@ LDADD   Additional loader objects.  Usual
For example, to load with the compatibility and utility
libraries, use:
 
-   LDFILES=-lutil -lcompat
+   LDADD=-lutil -lcompat
 
 LDFLAGSAdditional loader flags.
 
@@ -261,7 +261,7 @@ DPADD   Additional dependencies for the p
libraries.  For example, to depend on the compatibility and
utility libraries use:
 
-   SRCLIB=${LIBCOMPAT} ${LIBUTIL}
+   DPADD=${LIBCOMPAT} ${LIBUTIL}
 
There is a predefined identifier for each (non-profiled,
non-shared) library and object.  Library file names are
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235929 - in head/lib/libc/powerpc: . gen

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 20:12:46 2012
New Revision: 235929
URL: http://svn.freebsd.org/changeset/base/235929

Log:
  Allow building for the PowerPC EABI by providing a dummy __eabi()
  function. The purpose of the __eabi() function is to set up the
  runtime and is called first thing by main(). The runtime is already
  set up for us prior to caling main, so there's nothing to do for
  us in the EABI case.

Added:
  head/lib/libc/powerpc/gen/eabi.S   (contents, props changed)
Modified:
  head/lib/libc/powerpc/Symbol.map
  head/lib/libc/powerpc/gen/Makefile.inc

Modified: head/lib/libc/powerpc/Symbol.map
==
--- head/lib/libc/powerpc/Symbol.mapThu May 24 20:00:58 2012
(r235928)
+++ head/lib/libc/powerpc/Symbol.mapThu May 24 20:12:46 2012
(r235929)
@@ -11,6 +11,7 @@ FBSD_1.0 {
/* PSEUDO syscalls */
_exit;
 
+   __eabi;
_mcount;
_setjmp;
_longjmp;

Modified: head/lib/libc/powerpc/gen/Makefile.inc
==
--- head/lib/libc/powerpc/gen/Makefile.inc  Thu May 24 20:00:58 2012
(r235928)
+++ head/lib/libc/powerpc/gen/Makefile.inc  Thu May 24 20:12:46 2012
(r235929)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-SRCS += _ctx_start.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
+SRCS += _ctx_start.S eabi.S fabs.S flt_rounds.c fpgetmask.c fpgetround.c \
fpgetsticky.c fpsetmask.c fpsetround.c getcontextx.c \
infinity.c ldexp.c makecontext.c _setjmp.S \
setjmp.S sigsetjmp.S signalcontext.c syncicache.c \

Added: head/lib/libc/powerpc/gen/eabi.S
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libc/powerpc/gen/eabi.SThu May 24 20:12:46 2012
(r235929)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2011 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include machine/asm.h
+__FBSDID($FreeBSD$);
+
+ENTRY(__eabi)
+   blr
+
+   .section .note.GNU-stack,,%progbits
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235930 - head/sys/dev/fdt

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 20:24:49 2012
New Revision: 235930
URL: http://svn.freebsd.org/changeset/base/235930

Log:
  Preset (clear) the ranges we're supposed to fill from the FDT. If a
  particular range (either I/O memory or I/O port) is not defined in
  the FDT, we're not handing uninitialized structures back to our caller.

Modified:
  head/sys/dev/fdt/fdt_pci.c

Modified: head/sys/dev/fdt/fdt_pci.c
==
--- head/sys/dev/fdt/fdt_pci.c  Thu May 24 20:12:46 2012(r235929)
+++ head/sys/dev/fdt/fdt_pci.c  Thu May 24 20:24:49 2012(r235930)
@@ -100,6 +100,14 @@ fdt_pci_ranges_decode(phandle_t node, st
size_cells);
tuples = len / tuple_size;
 
+   /*
+* Initialize the ranges so that we don't have to worry about
+* having them all defined in the FDT. In particular, it is
+* perfectly fine not to want I/O space on PCI busses.
+*/
+   bzero(io_space, sizeof(*io_space));
+   bzero(mem_space, sizeof(*mem_space));
+
rangesptr = ranges[0];
offset_cells = 0;
for (i = 0; i  tuples; i++) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 20:45:44 2012
New Revision: 235931
URL: http://svn.freebsd.org/changeset/base/235931

Log:
  Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
  exceptions early enough during boot that the kernel will do ithe same.
  Use lwsync only when compiling for LP64 and revert to the more proven isync
  when compiling for ILP32. Note that in the end (i.e. between revision 222198
  and this change) ILP32 changed from using sync to using isync. As per Nathan
  the isync is needed to make sure I/O accesses are properly serialized with
  locks and isync tends to be more effecient than sync.
  
  While here, undefine __ATOMIC_ACQ and __ATOMIC_REL at the end of the file
  so as not to leak their definitions.
  
  Discussed with: nwhitehorn

Modified:
  head/sys/powerpc/include/atomic.h

Modified: head/sys/powerpc/include/atomic.h
==
--- head/sys/powerpc/include/atomic.h   Thu May 24 20:24:49 2012
(r235930)
+++ head/sys/powerpc/include/atomic.h   Thu May 24 20:45:44 2012
(r235931)
@@ -36,23 +36,30 @@
 #error this file needs sys/cdefs.h as a prerequisite
 #endif
 
-/* NOTE: lwsync is equivalent to sync on systems without lwsync */
-#define mb()   __asm __volatile(lwsync : : : memory)
-#ifdef __powerpc64__
-#define rmb()  __asm __volatile(lwsync : : : memory)
-#define wmb()  __asm __volatile(lwsync : : : memory)
-#else
-#define rmb()  __asm __volatile(lwsync : : : memory)
-#define wmb()  __asm __volatile(eieio : : : memory)
-#endif
-
 /*
  * The __ATOMIC_REL/ACQ() macros provide memory barriers only in conjunction
- * with the atomic lXarx/stXcx. sequences below. See Appendix B.2 of Book II
- * of the architecture manual.
+ * with the atomic lXarx/stXcx. sequences below. They are not exposed outside
+ * of this file. See also Appendix B.2 of Book II of the architecture manual.
+ *
+ * Note that not all Book-E processors accept the light-weight sync variant.
+ * In particular, early models of E500 cores are known to wedge. Bank on all
+ * 64-bit capable CPUs to accept lwsync properly and pressimize 32-bit CPUs
+ * to use the heavier-weight sync.
  */
+
+#ifdef __powerpc64__
+#define mb()   __asm __volatile(lwsync : : : memory)
+#define rmb()  __asm __volatile(lwsync : : : memory)
+#define wmb()  __asm __volatile(lwsync : : : memory)
 #define __ATOMIC_REL() __asm __volatile(lwsync : : : memory)
+#define __ATOMIC_ACQ() __asm __volatile(lwsync : : : memory)
+#else
+#define mb()   __asm __volatile(isync : : : memory)
+#define rmb()  __asm __volatile(isync : : : memory)
+#define wmb()  __asm __volatile(isync : : : memory)
+#define __ATOMIC_REL() __asm __volatile(isync : : : memory)
 #define __ATOMIC_ACQ() __asm __volatile(isync : : : memory)
+#endif
 
 /*
  * atomic_add(p, v)
@@ -683,4 +690,7 @@ atomic_fetchadd_long(volatile u_long *p,
 #defineatomic_fetchadd_64  atomic_fetchadd_long
 #endif
 
+#undef __ATOMIC_REL
+#undef __ATOMIC_ACQ
+
 #endif /* ! _MACHINE_ATOMIC_H_ */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235932 - head/sys/powerpc/booke

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 20:58:40 2012
New Revision: 235932
URL: http://svn.freebsd.org/changeset/base/235932

Log:
  o   Rename kernload_ap to bp_kernelload. This to introduce a common prefix
  for variables that live in the boot page.
  o   Add bp_trace (yes, it's in the boot page) that gets zeroed before we
  try to wake a core and to which the core being woken can write markers
  so that we know where the core was in case it doesn't wake up. The
  boot code does not yet write markers (too follow).
  o   Disable the boot page translation to allow the last 4K page to be used
  for whatever we please. It would get mapped otherwise.
  o   Fix kernstart in the case of SMP. The start argument is typically page
  aligned due to the alignment requirements that come with having a boot
  page. The point of using trunc_page is that we get the actual load
  address given that the entry point is immediately following the ELF
  headers. In the SMP case this ended up exactly 4K after the load
  address. Hence subtracting 1 from start.

Modified:
  head/sys/powerpc/booke/locore.S
  head/sys/powerpc/booke/platform_bare.c
  head/sys/powerpc/booke/pmap.c

Modified: head/sys/powerpc/booke/locore.S
==
--- head/sys/powerpc/booke/locore.S Thu May 24 20:45:44 2012
(r235931)
+++ head/sys/powerpc/booke/locore.S Thu May 24 20:58:40 2012
(r235932)
@@ -242,14 +242,20 @@ done_mapping:
 __boot_page:
bl  1f
 
-   .globl  kernload_ap
-kernload_ap:
+   .globl  bp_trace
+bp_trace:
+   .long   0
+
+   .globl  bp_kernload
+bp_kernload:
.long   0
 
 /*
  * Initial configuration
  */
 1:
+   mflr%r31/* r31 hold the address of bp_trace */
+
/* Set HIDs */
lis %r3, HID0_E500_DEFAULT_SET@h
ori %r3, %r3, HID0_E500_DEFAULT_SET@l
@@ -318,15 +324,15 @@ kernload_ap:
mtspr   SPR_MAS2, %r3
isync
 
-   /* Retrieve kernel load [physical] address from kernload_ap */
+   /* Retrieve kernel load [physical] address from bp_kernload */
bl  4f
 4: mflr%r3
rlwinm  %r3, %r3, 0, 0, 19
-   lis %r4, kernload_ap@h
-   ori %r4, %r4, kernload_ap@l
+   lis %r4, bp_kernload@h
+   ori %r4, %r4, bp_kernload@l
lis %r5, __boot_page@h
ori %r5, %r5, __boot_page@l
-   sub %r4, %r4, %r5   /* offset of kernload_ap within __boot_page */
+   sub %r4, %r4, %r5   /* offset of bp_kernload within __boot_page */
lwzx%r3, %r4, %r3
 
/* Set RPN and protection */

Modified: head/sys/powerpc/booke/platform_bare.c
==
--- head/sys/powerpc/booke/platform_bare.c  Thu May 24 20:45:44 2012
(r235931)
+++ head/sys/powerpc/booke/platform_bare.c  Thu May 24 20:58:40 2012
(r235932)
@@ -56,7 +56,8 @@ __FBSDID($FreeBSD$);
 #ifdef SMP
 extern void *ap_pcpu;
 extern uint8_t __boot_page[];  /* Boot page body */
-extern uint32_t kernload_ap;   /* Kernel physical load address */
+extern uint32_t bp_kernload;   /* Kernel physical load address */
+extern uint32_t bp_trace;  /* AP boot trace field */
 #endif
 
 extern uint32_t *bootinfo;
@@ -262,8 +263,8 @@ bare_smp_start_cpu(platform_t plat, stru
 
eebpcr = ccsr_read4(OCP85XX_EEBPCR);
if ((eebpcr  (1  (pc-pc_cpuid + 24))) != 0) {
-   printf(%s: CPU=%d already out of hold-off state!\n,
-   __func__, pc-pc_cpuid);
+   printf(SMP: CPU %d already out of hold-off state!\n,
+   pc-pc_cpuid);
return (ENXIO);
}
 
@@ -273,12 +274,13 @@ bare_smp_start_cpu(platform_t plat, stru
/*
 * Set BPTR to the physical address of the boot page
 */
-   bptr = ((uint32_t)__boot_page - KERNBASE) + kernload_ap;
+   bptr = ((uint32_t)__boot_page - KERNBASE) + bp_kernload;
ccsr_write4(OCP85XX_BPTR, (bptr  12) | 0x8000);
 
/*
 * Release AP from hold-off state
 */
+   bp_trace = 0;
eebpcr |= (1  (pc-pc_cpuid + 24));
ccsr_write4(OCP85XX_EEBPCR, eebpcr);
__asm __volatile(isync; msync);
@@ -287,6 +289,16 @@ bare_smp_start_cpu(platform_t plat, stru
while (!pc-pc_awake  timeout--)
DELAY(1000);/* wait 1ms */
 
+   /*
+* Disable boot page translation so that the 4K page at the default
+* address (= 0xf000) isn't permanently remapped and thus not
+* usable otherwise.
+*/
+   ccsr_write4(OCP85XX_BPTR, 0);
+
+   if (!pc-pc_awake)
+   printf(SMP: CPU %d didn't wake up (trace code %#x).\n,
+   pc-pc_awake, bp_trace);
return ((pc-pc_awake) ? 0 : EBUSY);
 #else
/* No SMP support */


Re: svn commit: r235918 - head/sys/geom/label

2012-05-24 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote:
 Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918 
 URL: http://svn.freebsd.org/changeset/base/235918
 
 Log: Make g_label(4) ignore provider size when looking for UFS
 labels. Without it, it fails to create labels for filesystems
 resized by growfs(8).
 
 PR:   kern/165962 Submitted by:   Olivier Cochard-Labbe olivier 
 at
 cochard dot me
 
 Modified: head/sys/geom/label/g_label_ufs.c

This commit broke my fstab based on ufsid.  I have something like this
in my fstab:

/dev/ufsid/44b3df81873011b5 /ufs rw,noatime 1 1
/dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2
/dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2
/dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2

Mounting / as read-only went fine and I had /dev/ada0s1a,
/dev/ada0s1d, etc.  Strangely, I also had matching ufsid's under
/dev/ufsid, e.g., /dev/ufsid/some_ufsida, /dev/ufsid/some_ufsidd,
etc.  However, once I do 'mount -u -w /', everything disappears except
for root's ufsid.

Reverting this commit fixed the problem for me.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk++oU4ACgkQmlay1b9qnVO2dQCfUT8+Z3pKORnH+htSgMUB7+un
TK8AnRvL5Oc4vOic1yvceJpyTD5YQOFK
=HEVp
-END PGP SIGNATURE-
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235933 - head/sys/powerpc/mpc85xx

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 21:01:35 2012
New Revision: 235933
URL: http://svn.freebsd.org/changeset/base/235933

Log:
  Either the I/O port range or the memory mapped I/O range may not be
  defined in the FDT. The range will have a zero size in that case.

Modified:
  head/sys/powerpc/mpc85xx/pci_fdt.c

Modified: head/sys/powerpc/mpc85xx/pci_fdt.c
==
--- head/sys/powerpc/mpc85xx/pci_fdt.c  Thu May 24 20:58:40 2012
(r235932)
+++ head/sys/powerpc/mpc85xx/pci_fdt.c  Thu May 24 21:01:35 2012
(r235933)
@@ -816,8 +816,13 @@ fsl_pcib_set_range(struct fsl_pcib_softc
}
 
*allocp = pci_start + alloc;
-   *vap = (uintptr_t)pmap_mapdev(start, size);
-   fsl_pcib_outbound(sc, wnd, type, start, size, pci_start);
+   if (size  0) {
+   *vap = (uintptr_t)pmap_mapdev(start, size);
+   fsl_pcib_outbound(sc, wnd, type, start, size, pci_start);
+   } else {
+   *vap = 0;
+   fsl_pcib_outbound(sc, wnd, -1, 0, 0, 0);
+   }
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235934 - head/sys/powerpc/mpc85xx

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 21:07:10 2012
New Revision: 235934
URL: http://svn.freebsd.org/changeset/base/235934

Log:
  Just return if the size of the window is 0. This can happen when the
  FDT does not define all ranges possible for a particular node (e.g.
  PCI).
  While here, only update the trgt_mem and trgt_io pointers if there's
  no error. This avoids that we knowingly write an invalid target (= -1).

Modified:
  head/sys/powerpc/mpc85xx/mpc85xx.c

Modified: head/sys/powerpc/mpc85xx/mpc85xx.c
==
--- head/sys/powerpc/mpc85xx/mpc85xx.c  Thu May 24 21:01:35 2012
(r235933)
+++ head/sys/powerpc/mpc85xx/mpc85xx.c  Thu May 24 21:07:10 2012
(r235934)
@@ -88,6 +88,9 @@ law_enable(int trgt, u_long addr, u_long
uint32_t bar, sr;
int i, law_max;
 
+   if (size == 0)
+   return (0);
+
law_max = law_getmax();
bar = _LAW_BAR(addr);
sr = _LAW_SR(trgt, size);
@@ -168,7 +171,10 @@ law_pci_target(struct resource *res, int
default:
rv = ENXIO;
}
-   *trgt_mem = *trgt_io = trgt;
+   if (rv == 0) {
+   *trgt_mem = trgt;
+   *trgt_io = trgt;
+   }
return (rv);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235935 - head/sys/powerpc/mpc85xx

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 21:09:38 2012
New Revision: 235935
URL: http://svn.freebsd.org/changeset/base/235935

Log:
  Remove Semihakf-ism. DEBUG is a kernel configuration option. It
  should not be defined in source files.

Modified:
  head/sys/powerpc/mpc85xx/i2c.c

Modified: head/sys/powerpc/mpc85xx/i2c.c
==
--- head/sys/powerpc/mpc85xx/i2c.c  Thu May 24 21:07:10 2012
(r235934)
+++ head/sys/powerpc/mpc85xx/i2c.c  Thu May 24 21:09:38 2012
(r235935)
@@ -72,9 +72,6 @@ __FBSDID($FreeBSD$);
 #define I2C_BAUD_RATE_DEF  0x3F
 #define I2C_DFSSR_DIV  0x10
 
-#define DEBUG
-#undef DEBUG
-
 #ifdef  DEBUG
 #define debugf(fmt, args...) do { printf(%s(): , __func__); 
printf(fmt,##args); } while (0)
 #else
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235936 - in head/sys/powerpc: aim booke include powerpc

2012-05-24 Thread Rafal Jaworowski
Author: raj
Date: Thu May 24 21:13:24 2012
New Revision: 235936
URL: http://svn.freebsd.org/changeset/base/235936

Log:
  Fix physical address type to vm_paddr_t.

Modified:
  head/sys/powerpc/aim/mmu_oea.c
  head/sys/powerpc/booke/pmap.c
  head/sys/powerpc/include/pmap.h
  head/sys/powerpc/powerpc/platform.c
  head/sys/powerpc/powerpc/pmap_dispatch.c

Modified: head/sys/powerpc/aim/mmu_oea.c
==
--- head/sys/powerpc/aim/mmu_oea.c  Thu May 24 21:09:38 2012
(r235935)
+++ head/sys/powerpc/aim/mmu_oea.c  Thu May 24 21:13:24 2012
(r235936)
@@ -289,7 +289,7 @@ boolean_t moea_is_modified(mmu_t, vm_pag
 boolean_t moea_is_prefaultable(mmu_t, pmap_t, vm_offset_t);
 boolean_t moea_is_referenced(mmu_t, vm_page_t);
 boolean_t moea_ts_referenced(mmu_t, vm_page_t);
-vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_offset_t, vm_offset_t, int);
+vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int);
 boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t);
 int moea_page_wired_mappings(mmu_t, vm_page_t);
 void moea_pinit(mmu_t, pmap_t);
@@ -308,14 +308,14 @@ void moea_activate(mmu_t, struct thread 
 void moea_deactivate(mmu_t, struct thread *);
 void moea_cpu_bootstrap(mmu_t, int);
 void moea_bootstrap(mmu_t, vm_offset_t, vm_offset_t);
-void *moea_mapdev(mmu_t, vm_offset_t, vm_size_t);
+void *moea_mapdev(mmu_t, vm_paddr_t, vm_size_t);
 void *moea_mapdev_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t);
 void moea_unmapdev(mmu_t, vm_offset_t, vm_size_t);
-vm_offset_t moea_kextract(mmu_t, vm_offset_t);
+vm_paddr_t moea_kextract(mmu_t, vm_offset_t);
 void moea_kenter_attr(mmu_t, vm_offset_t, vm_offset_t, vm_memattr_t);
-void moea_kenter(mmu_t, vm_offset_t, vm_offset_t);
+void moea_kenter(mmu_t, vm_offset_t, vm_paddr_t);
 void moea_page_set_memattr(mmu_t mmu, vm_page_t m, vm_memattr_t ma);
-boolean_t moea_dev_direct_mapped(mmu_t, vm_offset_t, vm_size_t);
+boolean_t moea_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t);
 static void moea_sync_icache(mmu_t, pmap_t, vm_offset_t, vm_size_t);
 
 static mmu_method_t moea_methods[] = {
@@ -1436,7 +1436,7 @@ moea_page_set_memattr(mmu_t mmu, vm_page
  * Map a wired page into kernel virtual address space.
  */
 void
-moea_kenter(mmu_t mmu, vm_offset_t va, vm_offset_t pa)
+moea_kenter(mmu_t mmu, vm_offset_t va, vm_paddr_t pa)
 {
 
moea_kenter_attr(mmu, va, pa, VM_MEMATTR_DEFAULT);
@@ -1471,7 +1471,7 @@ moea_kenter_attr(mmu_t mmu, vm_offset_t 
  * Extract the physical page address associated with the given kernel virtual
  * address.
  */
-vm_offset_t
+vm_paddr_t
 moea_kextract(mmu_t mmu, vm_offset_t va)
 {
struct  pvo_entry *pvo;
@@ -1512,8 +1512,8 @@ moea_kremove(mmu_t mmu, vm_offset_t va)
  * first usable address after the mapped region.
  */
 vm_offset_t
-moea_map(mmu_t mmu, vm_offset_t *virt, vm_offset_t pa_start,
-vm_offset_t pa_end, int prot)
+moea_map(mmu_t mmu, vm_offset_t *virt, vm_paddr_t pa_start,
+vm_paddr_t pa_end, int prot)
 {
vm_offset_t sva, va;
 
@@ -2408,7 +2408,7 @@ moea_bat_mapped(int idx, vm_offset_t pa,
 }
 
 boolean_t
-moea_dev_direct_mapped(mmu_t mmu, vm_offset_t pa, vm_size_t size)
+moea_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 {
int i;
 
@@ -2431,7 +2431,7 @@ moea_dev_direct_mapped(mmu_t mmu, vm_off
  * NOT real memory.
  */
 void *
-moea_mapdev(mmu_t mmu, vm_offset_t pa, vm_size_t size)
+moea_mapdev(mmu_t mmu, vm_paddr_t pa, vm_size_t size)
 {
 
return (moea_mapdev_attr(mmu, pa, size, VM_MEMATTR_DEFAULT));

Modified: head/sys/powerpc/booke/pmap.c
==
--- head/sys/powerpc/booke/pmap.c   Thu May 24 21:09:38 2012
(r235935)
+++ head/sys/powerpc/booke/pmap.c   Thu May 24 21:13:24 2012
(r235936)
@@ -291,7 +291,7 @@ static boolean_tmmu_booke_is_modified(m
 static boolean_t   mmu_booke_is_prefaultable(mmu_t, pmap_t, vm_offset_t);
 static boolean_t   mmu_booke_is_referenced(mmu_t, vm_page_t);
 static boolean_t   mmu_booke_ts_referenced(mmu_t, vm_page_t);
-static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_offset_t, 
vm_offset_t,
+static vm_offset_t mmu_booke_map(mmu_t, vm_offset_t *, vm_paddr_t, 
vm_paddr_t,
 int);
 static int mmu_booke_mincore(mmu_t, pmap_t, vm_offset_t,
 vm_paddr_t *);
@@ -316,12 +316,12 @@ static void   mmu_booke_zero_page_idle(mm
 static voidmmu_booke_activate(mmu_t, struct thread *);
 static voidmmu_booke_deactivate(mmu_t, struct thread *);
 static voidmmu_booke_bootstrap(mmu_t, vm_offset_t, vm_offset_t);
-static void*mmu_booke_mapdev(mmu_t, vm_offset_t, vm_size_t);
+static void*mmu_booke_mapdev(mmu_t, vm_paddr_t, vm_size_t);
 static voidmmu_booke_unmapdev(mmu_t, vm_offset_t, vm_size_t);
-static vm_offset_t 

Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Nathan Whitehorn

On 05/24/12 15:45, Marcel Moolenaar wrote:

Author: marcel
Date: Thu May 24 20:45:44 2012
New Revision: 235931
URL: http://svn.freebsd.org/changeset/base/235931

Log:
   Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
   exceptions early enough during boot that the kernel will do ithe same.
   Use lwsync only when compiling for LP64 and revert to the more proven isync
   when compiling for ILP32. Note that in the end (i.e. between revision 222198
   and this change) ILP32 changed from using sync to using isync. As per Nathan
   the isync is needed to make sure I/O accesses are properly serialized with
   locks and isync tends to be more effecient than sync.



This badly breaks the synchronization primitives. The functions 
mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync. As the 
comment notes, isync only provides a barrier in conjunction with the 
atomic operations and atomic retry loop -- this is why there is a 
distinction between *mb() and __ATOMIC_*(). Moreover, __ATOMIC_ACQ() 
*must* be isync, not lwsync, on PPC64 without changes to the bus_space 
accessors. Using lwsync causes bus space operations to leak across mutex 
acquisition which causes the expected severe problems on at least my 
machine.


Summary:
1. *mb() must be lwsync or sync on all machines, except for wmb() which 
could be eieio
2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
bus_space changes)

3. __ATOMIC_REL() must be lwsync or sync
-Nathan
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235937 - head/sys/powerpc/mpc85xx

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 21:23:13 2012
New Revision: 235937
URL: http://svn.freebsd.org/changeset/base/235937

Log:
  A few improvements:
  1.  Define all registers. These definitions are needed to support
  the FCM driver for direct-connect NAND.
  2.  Repurpose lbc_read_reg() and lbc_write_reg() for use by localbus
  attached device drivers. Use bus_space functions directly in the
  lbc driver itself.
  3.  Be smarter about programming LAWs and mapping memory. The ranges
  defined in the FDT are per bank (= chip select) and since we can
  have up to 8 banks, we could easily use more than 8 LAWs or TLB
  enrties when per-bank memory ranges need multiple LAWs or TLBs
  due to alignment or size constraints.
  We now combine all memory ranges into the fewest possible set of
  contiguous regions and program the hardware for that. Thus, a
  cleverly written FDT with 8 devices may still only need 1 LAW or
  1 TLB entry. Note that the memory ranges can be assigned randomly
  to the banks. We sort as we build to handle that.
  4.  Support the FCM when programming the OR register. This is mostly
  for documention purposes as we do not have a way to define the
  mode for a bank.
  5.  Remove Semihalf-ism: do not define DEBUG (only to undefine it
  again).

Modified:
  head/sys/powerpc/mpc85xx/lbc.c
  head/sys/powerpc/mpc85xx/lbc.h

Modified: head/sys/powerpc/mpc85xx/lbc.c
==
--- head/sys/powerpc/mpc85xx/lbc.c  Thu May 24 21:13:24 2012
(r235936)
+++ head/sys/powerpc/mpc85xx/lbc.c  Thu May 24 21:23:13 2012
(r235937)
@@ -56,9 +56,6 @@ __FBSDID($FreeBSD$);
 #include ofw_bus_if.h
 #include lbc.h
 
-#define DEBUG
-#undef DEBUG
-
 #ifdef DEBUG
 #define debugf(fmt, args...) do { printf(%s(): , __func__);  \
 printf(fmt,##args); } while (0)
@@ -66,20 +63,6 @@ __FBSDID($FreeBSD$);
 #define debugf(fmt, args...)
 #endif
 
-static __inline void
-lbc_write_reg(struct lbc_softc *sc, bus_size_t off, uint32_t val)
-{
-
-   bus_space_write_4(sc-sc_bst, sc-sc_bsh, off, val);
-}
-
-static __inline uint32_t
-lbc_read_reg(struct lbc_softc *sc, bus_size_t off)
-{
-
-   return (bus_space_read_4(sc-sc_bst, sc-sc_bsh, off));
-}
-
 static MALLOC_DEFINE(M_LBC, localbus, localbus devices information);
 
 static int lbc_probe(device_t);
@@ -161,46 +144,123 @@ lbc_address_mask(uint32_t size)
 static void
 lbc_banks_unmap(struct lbc_softc *sc)
 {
-   int i;
-
-   for (i = 0; i  LBC_DEV_MAX; i++) {
-   if (sc-sc_banks[i].size == 0)
-   continue;
+   int r;
 
-   law_disable(OCP85XX_TGTIF_LBC, sc-sc_banks[i].pa,
-   sc-sc_banks[i].size);
-   pmap_unmapdev(sc-sc_banks[i].va, sc-sc_banks[i].size);
+   r = 0;
+   while (r  LBC_DEV_MAX) {
+   if (sc-sc_range[r].size == 0)
+   return;
+
+   pmap_unmapdev(sc-sc_range[r].kva, sc-sc_range[r].size);
+   law_disable(OCP85XX_TGTIF_LBC, sc-sc_range[r].addr,
+   sc-sc_range[r].size);
+   r++;
}
 }
 
 static int
 lbc_banks_map(struct lbc_softc *sc)
 {
-   u_long start, size;
-   int error, i;
+   vm_paddr_t end, start;
+   vm_size_t size;
+   u_int i, r, ranges, s;
+   int error;
 
+   bzero(sc-sc_range, sizeof(sc-sc_range));
+
+   /*
+* Determine number of discontiguous address ranges to program.
+*/
+   ranges = 0;
for (i = 0; i  LBC_DEV_MAX; i++) {
-   if (sc-sc_banks[i].size == 0)
+   size = sc-sc_banks[i].size;
+   if (size == 0)
continue;
 
-   /* Physical address start/size. */
-   start = sc-sc_banks[i].pa;
-   size = sc-sc_banks[i].size;
+   start = sc-sc_banks[i].addr;
+   for (r = 0; r  ranges; r++) {
+   /* Avoid wrap-around bugs. */
+   end = sc-sc_range[r].addr - 1 + sc-sc_range[r].size;
+   if (start  0  end == start - 1) {
+   sc-sc_range[r].size += size;
+   break;
+   }
+   /* Avoid wrap-around bugs. */
+   end = start - 1 + size;
+   if (sc-sc_range[r].addr  0 
+   end == sc-sc_range[r].addr - 1) {
+   sc-sc_range[r].addr = start;
+   sc-sc_range[r].size += size;
+   break;
+   }
+   }
+   if (r == ranges) {
+   /* New range; add using insertion sort */
+   r = 0;
+   while (r  ranges  sc-sc_range[r].addr  start)
+   r++;
+  

svn commit: r235938 - head/sys/dev/sec

2012-05-24 Thread Rafal Jaworowski
Author: raj
Date: Thu May 24 21:24:23 2012
New Revision: 235938
URL: http://svn.freebsd.org/changeset/base/235938

Log:
  Recognize version 3.1 of the SEC crypto engine.

Modified:
  head/sys/dev/sec/sec.c
  head/sys/dev/sec/sec.h

Modified: head/sys/dev/sec/sec.c
==
--- head/sys/dev/sec/sec.c  Thu May 24 21:23:13 2012(r235937)
+++ head/sys/dev/sec/sec.c  Thu May 24 21:24:23 2012(r235938)
@@ -227,6 +227,10 @@ sec_probe(device_t dev)
device_set_desc(dev, Freescale Security Engine 3.0);
sc-sc_version = 3;
break;
+   case SEC_31_ID:
+   device_set_desc(dev, Freescale Security Engine 3.1);
+   sc-sc_version = 3;
+   break;
default:
device_printf(dev, unknown SEC ID 0x%016llx!\n, id);
return (ENXIO);

Modified: head/sys/dev/sec/sec.h
==
--- head/sys/dev/sec/sec.h  Thu May 24 21:23:13 2012(r235937)
+++ head/sys/dev/sec/sec.h  Thu May 24 21:24:23 2012(r235938)
@@ -46,6 +46,7 @@
 /* SEC information */
 #define SEC_20_ID  0x0040ULL
 #define SEC_30_ID  0x00300300ULL
+#define SEC_31_ID  0x00300301ULL
 #define SEC_CHANNELS   4
 #define SEC_POINTERS   7
 #define SEC_MAX_DMA_BLOCK_SIZE 0x
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235939 - in head: lib/libstand sys/x86/include

2012-05-24 Thread David E. O'Brien
Author: obrien
Date: Thu May 24 21:44:46 2012
New Revision: 235939
URL: http://svn.freebsd.org/changeset/base/235939

Log:
  Consitently use __LP64__.
  [there are 33 __LP64__'s in the kernel (minus cddl/ and contrib/),
  and 11 _LP64's]

Modified:
  head/lib/libstand/bswap.c
  head/sys/x86/include/_limits.h
  head/sys/x86/include/_stdint.h
  head/sys/x86/include/_types.h
  head/sys/x86/include/float.h

Modified: head/lib/libstand/bswap.c
==
--- head/lib/libstand/bswap.c   Thu May 24 21:24:23 2012(r235938)
+++ head/lib/libstand/bswap.c   Thu May 24 21:44:46 2012(r235939)
@@ -31,7 +31,7 @@ bswap32(u_int32_t x)
 u_int64_t
 bswap64(u_int64_t x)
 {
-#ifdef _LP64
+#ifdef __LP64__
/*
 * Assume we have wide enough registers to do it without touching
 * memory.

Modified: head/sys/x86/include/_limits.h
==
--- head/sys/x86/include/_limits.h  Thu May 24 21:24:23 2012
(r235938)
+++ head/sys/x86/include/_limits.h  Thu May 24 21:44:46 2012
(r235939)
@@ -57,7 +57,7 @@
 #define__INT_MAX   0x7fff  /* max value for an int */
 #define__INT_MIN   (-0x7fff - 1)   /* min value for an int 
*/
 
-#ifdef _LP64
+#ifdef __LP64__
 #define__ULONG_MAX 0x  /* max for an unsigned 
long */
 #define__LONG_MAX  0x7fff  /* max for a long */
 #define__LONG_MIN  (-0x7fff - 1) /* min for a long */
@@ -72,7 +72,7 @@
 #define__LLONG_MAX 0x7fffLL/* max value for a long 
long */
 #define__LLONG_MIN (-0x7fffLL - 1)  /* min for a long 
long */
 
-#ifdef _LP64
+#ifdef __LP64__
 #define__SSIZE_MAX __LONG_MAX  /* max value for a ssize_t */
 #define__SIZE_T_MAX__ULONG_MAX /* max value for a size_t */
 #define__OFF_MAX   __LONG_MAX  /* max value for an off_t */

Modified: head/sys/x86/include/_stdint.h
==
--- head/sys/x86/include/_stdint.h  Thu May 24 21:24:23 2012
(r235938)
+++ head/sys/x86/include/_stdint.h  Thu May 24 21:44:46 2012
(r235939)
@@ -50,7 +50,7 @@
 #defineUINT16_C(c) (c)
 #defineUINT32_C(c) (c ## U)
 
-#ifdef _LP64
+#ifdef __LP64__
 #defineINT64_C(c)  (c ## L)
 #defineUINT64_C(c) (c ## UL)
 #else
@@ -81,7 +81,7 @@
 #defineUINT16_MAX  0x
 #defineUINT32_MAX  0xU
 
-#ifdef _LP64
+#ifdef __LP64__
 #defineINT64_MIN   (-0x7fff-1)
 #defineINT64_MAX   0x7fff
 #defineUINT64_MAX  0x
@@ -139,7 +139,7 @@
  * ISO/IEC 9899:1999
  * 7.18.2.4  Limits of integer types capable of holding object pointers
  */
-#ifdef _LP64
+#ifdef __LP64__
 #defineINTPTR_MIN  INT64_MIN
 #defineINTPTR_MAX  INT64_MAX
 #defineUINTPTR_MAX UINT64_MAX
@@ -161,7 +161,7 @@
  * ISO/IEC 9899:1999
  * 7.18.3  Limits of other integer types
  */
-#ifdef _LP64
+#ifdef __LP64__
 /* Limits of ptrdiff_t. */
 #definePTRDIFF_MIN INT64_MIN   
 #definePTRDIFF_MAX INT64_MAX

Modified: head/sys/x86/include/_types.h
==
--- head/sys/x86/include/_types.h   Thu May 24 21:24:23 2012
(r235938)
+++ head/sys/x86/include/_types.h   Thu May 24 21:44:46 2012
(r235939)
@@ -54,7 +54,7 @@ typedef   short   __int16_t;
 typedefunsigned short  __uint16_t;
 typedefint __int32_t;
 typedefunsigned int__uint32_t;
-#ifdef _LP64
+#ifdef __LP64__
 typedeflong__int64_t;
 typedefunsigned long   __uint64_t;
 #else
@@ -73,7 +73,7 @@ typedef   unsigned long long  __uint64_t;
 /*
  * Standard type definitions.
  */
-#ifdef _LP64
+#ifdef __LP64__
 typedef__int32_t   __clock_t;  /* clock()... */
 typedef__int64_t   __critical_t;
 typedefdouble  __double_t;
@@ -97,7 +97,7 @@ typedef   __int8_t__int_least8_t;
 typedef__int16_t   __int_least16_t;
 typedef__int32_t   __int_least32_t;
 typedef__int64_t   __int_least64_t;
-#ifdef _LP64
+#ifdef __LP64__
 typedef__int64_t   __ptrdiff_t;/* ptr1 - ptr2 */
 typedef__int64_t   __register_t;
 typedef__int64_t   __segsz_t;  /* segment size (in 
pages) */
@@ -125,7 +125,7 @@ typedef __uint8_t   __uint_least8_t;
 typedef__uint16_t  __uint_least16_t;
 typedef__uint32_t  __uint_least32_t;
 

svn commit: r235941 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 22:00:48 2012
New Revision: 235941
URL: http://svn.freebsd.org/changeset/base/235941

Log:
  MFp4 bz_ipv6_fast:
  
in_cksum.h required ip.h to be included for struct ip.  To be
able to use some general checksum functions like in_addword()
in a non-IPv4 context, limit the (also exported to user space)
IPv4 specific functions to the times, when the ip.h header is
present and IPVERSION is defined (to 4).
  
We should consider more general checksum (updating) functions
to also allow easier incremental checksum updates in the L3/4
stack and firewalls, as well as ponder further requirements by
certain NIC drivers needing slightly different pseudo values
in offloading cases.  Thinking in terms of a better library.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/amd64/include/in_cksum.h
  head/sys/arm/include/in_cksum.h
  head/sys/i386/include/in_cksum.h
  head/sys/ia64/include/in_cksum.h
  head/sys/mips/include/in_cksum.h
  head/sys/powerpc/include/in_cksum.h
  head/sys/sparc64/include/in_cksum.h

Modified: head/sys/amd64/include/in_cksum.h
==
--- head/sys/amd64/include/in_cksum.h   Thu May 24 21:55:36 2012
(r235940)
+++ head/sys/amd64/include/in_cksum.h   Thu May 24 22:00:48 2012
(r235941)
@@ -43,6 +43,7 @@
 
 #define in_cksum(m, len)   in_cksum_skip(m, len, 0)
 
+#if defined(IPVERSION)  (IPVERSION == 4)
 /*
  * It it useful to have an Internet checksum routine which is inlineable
  * and optimized specifically for the task of computing IP header checksums
@@ -69,9 +70,12 @@ in_cksum_update(struct ip *ip)
} while(0)
 
 #endif
+#endif
 
 #ifdef _KERNEL
+#if defined(IPVERSION)  (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
+#endif
 u_shortin_addword(u_short sum, u_short b);
 u_shortin_pseudo(u_int sum, u_int b, u_int c);
 u_shortin_cksum_skip(struct mbuf *m, int len, int skip);

Modified: head/sys/arm/include/in_cksum.h
==
--- head/sys/arm/include/in_cksum.h Thu May 24 21:55:36 2012
(r235940)
+++ head/sys/arm/include/in_cksum.h Thu May 24 22:00:48 2012
(r235941)
@@ -46,7 +46,9 @@ u_short in_cksum(struct mbuf *m, int len
 u_short in_addword(u_short sum, u_short b);
 u_short in_cksum_skip(struct mbuf *m, int len, int skip);
 u_int do_cksum(const void *, int);
+#if defined(IPVERSION)  (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *);
+#endif
 
 static __inline u_short
 in_pseudo(u_int sum, u_int b, u_int c)

Modified: head/sys/i386/include/in_cksum.h
==
--- head/sys/i386/include/in_cksum.hThu May 24 21:55:36 2012
(r235940)
+++ head/sys/i386/include/in_cksum.hThu May 24 22:00:48 2012
(r235941)
@@ -54,6 +54,7 @@
  * therefore always exactly five 32-bit words.
  */
 #if defined(__GNUCLIKE_ASM)  !defined(__INTEL_COMPILER)
+#if defined(IPVERSION)  (IPVERSION == 4)
 static __inline u_int
 in_cksum_hdr(const struct ip *ip)
 {
@@ -88,6 +89,7 @@ in_cksum_update(struct ip *ip)
__tmpsum = (int)ntohs(ip-ip_sum) + 256;
ip-ip_sum = htons(__tmpsum + (__tmpsum  16));
 }
+#endif
 
 static __inline u_short
 in_addword(u_short sum, u_short b)
@@ -121,6 +123,7 @@ in_pseudo(u_int sum, u_int b, u_int c)
 }
 
 #else
+#if defined(IPVERSION)  (IPVERSION == 4)
 #definein_cksum_update(ip) \
do { \
int __tmpsum; \
@@ -129,10 +132,13 @@ in_pseudo(u_int sum, u_int b, u_int c)
} while(0)
 
 #endif
+#endif
 
 #ifdef _KERNEL
 #if !defined(__GNUCLIKE_ASM) || defined(__INTEL_COMPILER)
+#if defined(IPVERSION)  (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
+#endif
 u_short in_addword(u_short sum, u_short b);
 u_short in_pseudo(u_int sum, u_int b, u_int c);
 #endif

Modified: head/sys/ia64/include/in_cksum.h
==
--- head/sys/ia64/include/in_cksum.hThu May 24 21:55:36 2012
(r235940)
+++ head/sys/ia64/include/in_cksum.hThu May 24 22:00:48 2012
(r235941)
@@ -39,6 +39,7 @@
 
 #define in_cksum(m, len)   in_cksum_skip(m, len, 0)
 
+#if defined(IPVERSION)  (IPVERSION == 4)
 /*
  * It it useful to have an Internet checksum routine which is inlineable
  * and optimized specifically for the task of computing IP header checksums
@@ -65,9 +66,12 @@ in_cksum_update(struct ip *ip)
} while(0)
 
 #endif
+#endif
 
 #ifdef _KERNEL
+#if defined(IPVERSION)  (IPVERSION == 4)
 u_int in_cksum_hdr(const struct ip *ip);
+#endif
 u_shortin_addword(u_short sum, u_short b);
 u_shortin_pseudo(u_int sum, u_int b, u_int c);
 u_short

svn commit: r235942 - head/sys/powerpc/include

2012-05-24 Thread Marcel Moolenaar
Author: marcel
Date: Thu May 24 22:06:00 2012
New Revision: 235942
URL: http://svn.freebsd.org/changeset/base/235942

Log:
  Revert isync for ILP32 to sync as per my original change that I discussed
  with Nathan. Leave __ATOMIC_ACQ as an isync as per Nathan.

Modified:
  head/sys/powerpc/include/atomic.h

Modified: head/sys/powerpc/include/atomic.h
==
--- head/sys/powerpc/include/atomic.h   Thu May 24 22:00:48 2012
(r235941)
+++ head/sys/powerpc/include/atomic.h   Thu May 24 22:06:00 2012
(r235942)
@@ -54,10 +54,10 @@
 #define __ATOMIC_REL() __asm __volatile(lwsync : : : memory)
 #define __ATOMIC_ACQ() __asm __volatile(lwsync : : : memory)
 #else
-#define mb()   __asm __volatile(isync : : : memory)
-#define rmb()  __asm __volatile(isync : : : memory)
-#define wmb()  __asm __volatile(isync : : : memory)
-#define __ATOMIC_REL() __asm __volatile(isync : : : memory)
+#define mb()   __asm __volatile(sync : : : memory)
+#define rmb()  __asm __volatile(sync : : : memory)
+#define wmb()  __asm __volatile(sync : : : memory)
+#define __ATOMIC_REL() __asm __volatile(sync : : : memory)
 #define __ATOMIC_ACQ() __asm __volatile(isync : : : memory)
 #endif
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Marcel Moolenaar

On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote:

 On 05/24/12 15:45, Marcel Moolenaar wrote:
 Author: marcel
 Date: Thu May 24 20:45:44 2012
 New Revision: 235931
 URL: http://svn.freebsd.org/changeset/base/235931
 
 Log:
   Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
   exceptions early enough during boot that the kernel will do ithe same.
   Use lwsync only when compiling for LP64 and revert to the more proven isync
   when compiling for ILP32. Note that in the end (i.e. between revision 
 222198
   and this change) ILP32 changed from using sync to using isync. As per 
 Nathan
   the isync is needed to make sure I/O accesses are properly serialized with
   locks and isync tends to be more effecient than sync.
 
 
 This badly breaks the synchronization primitives. The functions 
 mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync.

I guess I misinterpreted your email in which you stated that isync is better.

 Summary:
 1. *mb() must be lwsync or sync on all machines, except for wmb() which could 
 be eieio
 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
 bus_space changes)
 3. __ATOMIC_REL() must be lwsync or sync

This is absolutely not what I concluded from our discussions. I have no idea
how we could end up so out of sync...

-- 
Marcel Moolenaar
mar...@xcllnt.net


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


svn commit: r235943 - head/sys/powerpc/include

2012-05-24 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu May 24 22:14:39 2012
New Revision: 235943
URL: http://svn.freebsd.org/changeset/base/235943

Log:
  Atomic operation acquire barriers also need to be isync on 64-bit systems.

Modified:
  head/sys/powerpc/include/atomic.h

Modified: head/sys/powerpc/include/atomic.h
==
--- head/sys/powerpc/include/atomic.h   Thu May 24 22:06:00 2012
(r235942)
+++ head/sys/powerpc/include/atomic.h   Thu May 24 22:14:39 2012
(r235943)
@@ -52,7 +52,7 @@
 #define rmb()  __asm __volatile(lwsync : : : memory)
 #define wmb()  __asm __volatile(lwsync : : : memory)
 #define __ATOMIC_REL() __asm __volatile(lwsync : : : memory)
-#define __ATOMIC_ACQ() __asm __volatile(lwsync : : : memory)
+#define __ATOMIC_ACQ() __asm __volatile(isync : : : memory)
 #else
 #define mb()   __asm __volatile(sync : : : memory)
 #define rmb()  __asm __volatile(sync : : : memory)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Nathan Whitehorn

On 05/24/12 17:07, Marcel Moolenaar wrote:


On May 24, 2012, at 2:13 PM, Nathan Whitehorn wrote:


On 05/24/12 15:45, Marcel Moolenaar wrote:

Author: marcel
Date: Thu May 24 20:45:44 2012
New Revision: 235931
URL: http://svn.freebsd.org/changeset/base/235931

Log:
   Fix the memory barriers for CPUs that do not like lwsync and wedge or cause
   exceptions early enough during boot that the kernel will do ithe same.
   Use lwsync only when compiling for LP64 and revert to the more proven isync
   when compiling for ILP32. Note that in the end (i.e. between revision 222198
   and this change) ILP32 changed from using sync to using isync. As per Nathan
   the isync is needed to make sure I/O accesses are properly serialized with
   locks and isync tends to be more effecient than sync.



This badly breaks the synchronization primitives. The functions 
mb()/wmb()/rmb() need to be sync or lwsync on ILP32, not isync.


I guess I misinterpreted your email in which you stated that isync is better.


It's just in this one single case. Otherwise, it's still faster but 
doesn't work :)



Summary:
1. *mb() must be lwsync or sync on all machines, except for wmb() which could 
be eieio
2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
bus_space changes)
3. __ATOMIC_REL() must be lwsync or sync


This is absolutely not what I concluded from our discussions. I have no idea
how we could end up so out of sync...



Thanks for the quick change. No idea how we got out of sync. I find all 
of this synchronization stuff a little mind-bending, so sorry for any 
miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so 
I've fixed that up. Things should be good now.

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


Re: svn commit: r235918 - head/sys/geom/label

2012-05-24 Thread Jung-uk Kim
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2012-05-24 16:59:58 -0400, Jung-uk Kim wrote:
 On 2012-05-24 12:48:33 -0400, Edward Tomasz Napierala wrote:
 Author: trasz Date: Thu May 24 16:48:33 2012 New Revision: 235918
  URL: http://svn.freebsd.org/changeset/base/235918
 
 Log: Make g_label(4) ignore provider size when looking for UFS 
 labels. Without it, it fails to create labels for filesystems 
 resized by growfs(8).
 
 PR:  kern/165962 Submitted by:   Olivier Cochard-Labbe olivier 
 at
 cochard dot me
 
 Modified: head/sys/geom/label/g_label_ufs.c
 
 This commit broke my fstab based on ufsid.  I have something like
 this in my fstab:
 
 /dev/ufsid/44b3df81873011b5 /ufs rw,noatime 1 1 
 /dev/ufsid/463b935456452bbd /tmp ufs rw,noatime 2 2 
 /dev/ufsid/44b3dfc4bfcc4c30 /usr ufs rw,noatime 2 2 
 /dev/ufsid/463b934b955f63ff /var ufs rw,noatime 2 2
 
 Mounting / as read-only went fine and I had /dev/ada0s1a, 
 /dev/ada0s1d, etc.  Strangely, I also had matching ufsid's under 
 /dev/ufsid, e.g., /dev/ufsid/some_ufsida,
 /dev/ufsid/some_ufsidd, etc.  However, once I do 'mount -u -w /',
 everything disappears except for root's ufsid.
 
 Reverting this commit fixed the problem for me.

The attached patch fixed my problem and kern/165962.

Jung-uk Kim
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk++s4YACgkQmlay1b9qnVO5uACglaXhj9ZXwpUiroMUxqkbHF/v
Qm0An0lHidiRMenHsDLTaiC0Wqz0cYB6
=k1Ff
-END PGP SIGNATURE-
Index: sys/geom/label/g_label_ufs.c
===
--- sys/geom/label/g_label_ufs.c(revision 235941)
+++ sys/geom/label/g_label_ufs.c(working copy)
@@ -51,8 +51,9 @@ static void
 g_label_ufs_taste_common(struct g_consumer *cp, char *label, size_t size, int 
what)
 {
struct g_provider *pp;
+   struct fs *fs;
+   off_t fs_size;
int sb, superblock;
-   struct fs *fs;
 
g_topology_assert_not();
pp = cp-provider;
@@ -82,11 +83,19 @@ g_label_ufs_taste_common(struct g_consumer *cp, ch
if (fs == NULL)
continue;
/* Check for magic */
-   if (fs-fs_magic == FS_UFS1_MAGIC  fs-fs_fsize  0) {
-   /* Valid UFS1. */
-   } else if (fs-fs_magic == FS_UFS2_MAGIC  fs-fs_fsize  0) {
-   /* Valid UFS2. */
-   } else {
+   switch (fs-fs_magic) {
+   case FS_UFS1_MAGIC:
+   case FS_UFS2_MAGIC:
+   if (fs-fs_fsize  0) {
+   if (what == G_LABEL_UFS_VOLUME)
+   break;
+   fs_size = (fs-fs_magic == FS_UFS1_MAGIC) ?
+   fs-fs_old_size : fs-fs_size;
+   if (pp-mediasize / fs-fs_fsize == fs_size)
+   break;
+   }
+   /* FALLTHROUGH */
+   default:
g_free(fs);
continue;
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Marcel Moolenaar

On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote:

 Summary:
 1. *mb() must be lwsync or sync on all machines, except for wmb() which 
 could be eieio
 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
 bus_space changes)
 3. __ATOMIC_REL() must be lwsync or sync
 
 This is absolutely not what I concluded from our discussions. I have no idea
 how we could end up so out of sync...
 
 
 Thanks for the quick change. No idea how we got out of sync. I find all of 
 this synchronization stuff a little mind-bending, so sorry for any 
 miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've 
 fixed that up. Things should be good now.

Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum effect.
I'll reread our emails and make sure wmb() is what we think it is and if
so I'll do a followup commit.
FYI,

-- 
Marcel Moolenaar
mar...@xcllnt.net


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


Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Nathan Whitehorn

On 05/24/12 17:22, Marcel Moolenaar wrote:


On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote:


Summary:
1. *mb() must be lwsync or sync on all machines, except for wmb() which could 
be eieio
2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
bus_space changes)
3. __ATOMIC_REL() must be lwsync or sync


This is absolutely not what I concluded from our discussions. I have no idea
how we could end up so out of sync...



Thanks for the quick change. No idea how we got out of sync. I find all of this 
synchronization stuff a little mind-bending, so sorry for any miscommunication. 
__ATOMIC_ACQ() needed to also be isync on ppc64, so I've fixed that up. Things 
should be good now.


Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum effect.
I'll reread our emails and make sure wmb() is what we think it is and if
so I'll do a followup commit.
FYI,



I don't think it really makes a difference. Basically nothing uses 
wmb(), and those things that do mostly use it wrong and need sync. So it 
should probably stay as [lw]sync.

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


svn commit: r235944 - in head/sys: dev/cxgb dev/cxgbe netinet

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 23:03:23 2012
New Revision: 235944
URL: http://svn.freebsd.org/changeset/base/235944

Log:
  MFp4 bz_ipv6_fast:
  
Significantly update tcp_lro for mostly two things:
1) introduce basic support for IPv6 without extension headers.
2) try hard to also get the incremental checksum updates right,
   especially also in the IPv4 case for the IP and TCP header.
  
Move variables around for better locality, factor things out into
functions, allow checksum updates to be compiled out, ...
  
Leave a few comments on further things to look at in the future,
though that is not the full list.
  
Update drivers with appropriate #includes as needed for IPv6 data
type in LRO.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgbe/adapter.h
  head/sys/netinet/tcp_lro.c
  head/sys/netinet/tcp_lro.h

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==
--- head/sys/dev/cxgb/cxgb_adapter.hThu May 24 22:14:39 2012
(r235943)
+++ head/sys/dev/cxgb/cxgb_adapter.hThu May 24 23:03:23 2012
(r235944)
@@ -46,6 +46,7 @@ $FreeBSD$
 #include net/if.h
 #include net/if_media.h
 #include net/if_dl.h
+#include netinet/in.h
 #include netinet/tcp_lro.h
 
 #include machine/bus.h

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu May 24 22:14:39 2012
(r235943)
+++ head/sys/dev/cxgbe/adapter.hThu May 24 23:03:23 2012
(r235944)
@@ -44,6 +44,7 @@
 #include net/ethernet.h
 #include net/if.h
 #include net/if_media.h
+#include netinet/in.h
 #include netinet/tcp_lro.h
 
 #include offload.h

Modified: head/sys/netinet/tcp_lro.c
==
--- head/sys/netinet/tcp_lro.c  Thu May 24 22:14:39 2012(r235943)
+++ head/sys/netinet/tcp_lro.c  Thu May 24 23:03:23 2012(r235944)
@@ -1,8 +1,12 @@
 /*-
  * Copyright (c) 2007, Myricom Inc.
  * Copyright (c) 2008, Intel Corporation.
+ * Copyright (c) 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * Portions of this software were developed by Bjoern Zeeb
+ * under sponsorship from the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -27,365 +31,565 @@
  * $FreeBSD$ 
  */
 
+#include sys/cdefs.h
+__FBSDID($FreeBSD$);
+
+#include opt_inet.h
+#include opt_inet6.h
+
 #include sys/param.h
 #include sys/systm.h
-#include sys/endian.h
 #include sys/mbuf.h
 #include sys/kernel.h
 #include sys/socket.h
 
 #include net/if.h
+#include net/if_var.h
 #include net/ethernet.h
-#include net/if_media.h
 
 #include netinet/in_systm.h
 #include netinet/in.h
+#include netinet/ip6.h
 #include netinet/ip.h
 #include netinet/tcp.h
 #include netinet/tcp_lro.h
 
-#include machine/bus.h
 #include machine/in_cksum.h
 
+#ifndef LRO_ENTRIES
+#defineLRO_ENTRIES 8   /* # of LRO entries per RX queue. */
+#endif
+
+#defineTCP_LRO_UPDATE_CSUM 1
+#ifndefTCP_LRO_UPDATE_CSUM
+#defineTCP_LRO_INVALID_CSUM0x
+#endif
 
-static uint16_t do_csum_data(uint16_t *raw, int len)
-{
-   uint32_t csum;
-   csum = 0;
-   while (len  0) {
-   csum += *raw;
-   raw++;
-   csum += *raw;
-   raw++;
-   len -= 4;
-   }
-   csum = (csum  16) + (csum  0x);
-   csum = (csum  16) + (csum  0x);
-   return (uint16_t)csum;
-}
-
-/*
- * Allocate and init the LRO data structures
- */
 int
-tcp_lro_init(struct lro_ctrl *cntl)
+tcp_lro_init(struct lro_ctrl *lc)
 {
-   struct lro_entry *lro;
-   int i, error = 0;
-
-   SLIST_INIT(cntl-lro_free);
-   SLIST_INIT(cntl-lro_active);
+   struct lro_entry *le;
+   int error, i;
 
-   cntl-lro_bad_csum = 0;
-   cntl-lro_queued = 0;
-   cntl-lro_flushed = 0;
+   lc-lro_bad_csum = 0;
+   lc-lro_queued = 0;
+   lc-lro_flushed = 0;
+   lc-lro_cnt = 0;
+   SLIST_INIT(lc-lro_free);
+   SLIST_INIT(lc-lro_active);
 
+   error = 0;
for (i = 0; i  LRO_ENTRIES; i++) {
-lro = (struct lro_entry *) malloc(sizeof (struct lro_entry),
-   M_DEVBUF, M_NOWAIT | M_ZERO);
-if (lro == NULL) {
+   le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF,
+   M_NOWAIT | M_ZERO);
+if (le == NULL) {
if (i == 0)
error = ENOMEM;
 break;
 }
-   cntl-lro_cnt = i;
-

svn commit: r235945 - in head/sys: contrib/dev/acpica contrib/dev/acpica/common contrib/dev/acpica/compiler contrib/dev/acpica/components/debugger contrib/dev/acpica/components/dispatcher contrib/d...

2012-05-24 Thread Jung-uk Kim
Author: jkim
Date: Thu May 24 23:12:30 2012
New Revision: 235945
URL: http://svn.freebsd.org/changeset/base/235945

Log:
  Merge ACPICA 20120518.

Modified:
  head/sys/contrib/dev/acpica/acpica_prep.sh
  head/sys/contrib/dev/acpica/changes.txt
  head/sys/contrib/dev/acpica/common/adfile.c
  head/sys/contrib/dev/acpica/common/adwalk.c
  head/sys/contrib/dev/acpica/common/dmextern.c
  head/sys/contrib/dev/acpica/compiler/aslcompile.c
  head/sys/contrib/dev/acpica/compiler/aslcompiler.h
  head/sys/contrib/dev/acpica/compiler/aslcompiler.l
  head/sys/contrib/dev/acpica/compiler/aslcompiler.y
  head/sys/contrib/dev/acpica/compiler/aslerror.c
  head/sys/contrib/dev/acpica/compiler/aslfiles.c
  head/sys/contrib/dev/acpica/compiler/aslmain.c
  head/sys/contrib/dev/acpica/compiler/aslmap.c
  head/sys/contrib/dev/acpica/compiler/aslmessages.h
  head/sys/contrib/dev/acpica/compiler/aslstartup.c
  head/sys/contrib/dev/acpica/compiler/dtio.c
  head/sys/contrib/dev/acpica/compiler/prscan.c
  head/sys/contrib/dev/acpica/compiler/prutils.c
  head/sys/contrib/dev/acpica/components/debugger/dbfileio.c
  head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c
  head/sys/contrib/dev/acpica/components/events/evxface.c
  head/sys/contrib/dev/acpica/components/tables/tbfadt.c
  head/sys/contrib/dev/acpica/components/utilities/utmisc.c
  head/sys/contrib/dev/acpica/include/acobject.h
  head/sys/contrib/dev/acpica/include/acpiosxf.h
  head/sys/contrib/dev/acpica/include/acpixf.h
  head/sys/contrib/dev/acpica/include/actypes.h
  head/sys/contrib/dev/acpica/include/acutils.h
  head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c
  head/sys/dev/acpica/Osd/OsdSchedule.c
Directory Properties:
  head/sys/contrib/dev/acpica/   (props changed)
  head/sys/contrib/dev/acpica/common/   (props changed)
  head/sys/contrib/dev/acpica/compiler/   (props changed)
  head/sys/contrib/dev/acpica/components/debugger/   (props changed)
  head/sys/contrib/dev/acpica/components/dispatcher/   (props changed)
  head/sys/contrib/dev/acpica/components/events/   (props changed)
  head/sys/contrib/dev/acpica/components/tables/   (props changed)
  head/sys/contrib/dev/acpica/components/utilities/   (props changed)
  head/sys/contrib/dev/acpica/include/   (props changed)
  head/sys/contrib/dev/acpica/os_specific/   (props changed)

Modified: head/sys/contrib/dev/acpica/acpica_prep.sh
==
--- head/sys/contrib/dev/acpica/acpica_prep.sh  Thu May 24 23:03:23 2012
(r235944)
+++ head/sys/contrib/dev/acpica/acpica_prep.sh  Thu May 24 23:12:30 2012
(r235945)
@@ -10,8 +10,8 @@ if [ ! $# -eq 1 ]; then
 fi
 
 src=$1
-wrk=`realpath ./_acpi_ca_unpack`
-dst=`realpath ./acpi_ca_destination`
+wrk=$(realpath .)/_acpi_ca_unpack
+dst=$(realpath .)/acpi_ca_destination
 
 # files that should keep their full directory path
 fulldirs=common compiler components include os_specific
@@ -67,7 +67,8 @@ for H in ${src_headers}; do
xargs sed -i  -e s|[\]$H[\]|\contrib/dev/acpica/include/$H\|g
 done
 for H in ${comp_headers}; do
-   find ${dst}/common ${dst}/compiler -name *.[chly] -type f |   \
+   find ${dst}/common ${dst}/compiler ${dst}/components \
+   -name *.[chly] -type f |  \
xargs sed -i  -e s|[\]$H[\]|\contrib/dev/acpica/compiler/$H\|g
 done
 for H in ${platform_headers}; do

Modified: head/sys/contrib/dev/acpica/changes.txt
==
--- head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:03:23 2012
(r235944)
+++ head/sys/contrib/dev/acpica/changes.txt Thu May 24 23:12:30 2012
(r235945)
@@ -1,8 +1,70 @@
 
+18 May 2012. Summary of changes for version 20120518:
+
+
+1) ACPICA Core Subsystem:
+
+Added a new OSL interface, AcpiOsWaitEventsComplete. This interface is defined 
+to block until asynchronous events such as notifies and GPEs have completed. 
+Within ACPICA, it is only called before a notify or GPE handler is 
+removed/uninstalled. It also may be useful for the host OS within related 
+drivers such as the Embedded Controller driver. See the ACPICA reference for 
+additional information. ACPICA BZ 868.
+
+ACPI Tables: Added a new error message for a possible overflow failure during 
+the conversion of FADT 32-bit legacy register addresses to internal common 64-
+bit GAS structure representation. The GAS has a one-byte bit length field, 
+thus limiting the register length to 255 bits. ACPICA BZ 953.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug 
+version of the code includes the debug output trace mechanism and has a much 
+larger code and data size.
+
+  Previous Release:
+Non-Debug Version:  92.9K Code, 25.0K Data, 117.9K Total
+Debug Version: 172.6K Code, 73.4K Data, 246.0K Total
+  

svn commit: r235946 - head/sys/powerpc/include

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Thu May 24 23:46:17 2012
New Revision: 235946
URL: http://svn.freebsd.org/changeset/base/235946

Log:
  Add a missing  to get closer to compiling.

Modified:
  head/sys/powerpc/include/atomic.h

Modified: head/sys/powerpc/include/atomic.h
==
--- head/sys/powerpc/include/atomic.h   Thu May 24 23:12:30 2012
(r235945)
+++ head/sys/powerpc/include/atomic.h   Thu May 24 23:46:17 2012
(r235946)
@@ -56,7 +56,7 @@
 #else
 #define mb()   __asm __volatile(sync : : : memory)
 #define rmb()  __asm __volatile(sync : : : memory)
-#define wmb()  __asm __volatile(sync : : : memory)
+#define wmb()  __asm __volatile(sync : : : memory)
 #define __ATOMIC_REL() __asm __volatile(sync : : : memory)
 #define __ATOMIC_ACQ() __asm __volatile(isync : : : memory)
 #endif
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r235931 - head/sys/powerpc/include

2012-05-24 Thread Marcel Moolenaar

On May 24, 2012, at 3:46 PM, Nathan Whitehorn wrote:

 On 05/24/12 17:22, Marcel Moolenaar wrote:
 
 On May 24, 2012, at 3:15 PM, Nathan Whitehorn wrote:
 
 Summary:
 1. *mb() must be lwsync or sync on all machines, except for wmb() which 
 could be eieio
 2. __ATOMIC_ACQ() must be isync (though could be reduced to lwsync with 
 bus_space changes)
 3. __ATOMIC_REL() must be lwsync or sync
 
 This is absolutely not what I concluded from our discussions. I have no 
 idea
 how we could end up so out of sync...
 
 
 Thanks for the quick change. No idea how we got out of sync. I find all of 
 this synchronization stuff a little mind-bending, so sorry for any 
 miscommunication. __ATOMIC_ACQ() needed to also be isync on ppc64, so I've 
 fixed that up. Things should be good now.
 
 Ok. I didn't change wmb() to eieio as I wanted to avoid a pendulum effect.
 I'll reread our emails and make sure wmb() is what we think it is and if
 so I'll do a followup commit.
 FYI,
 
 
 I don't think it really makes a difference. Basically nothing uses wmb(), and 
 those things that do mostly use it wrong and need sync. So it should probably 
 stay as [lw]sync.

Works for me.
Thanks!

-- 
Marcel Moolenaar
mar...@xcllnt.net


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


svn commit: r235948 - head/usr.sbin/acpi/acpidump

2012-05-24 Thread Jung-uk Kim
Author: jkim
Date: Fri May 25 00:18:19 2012
New Revision: 235948
URL: http://svn.freebsd.org/changeset/base/235948

Log:
  Catch up with realpath(3) changes (r235266) and unbreak acpidump(8).

Modified:
  head/usr.sbin/acpi/acpidump/acpi.c

Modified: head/usr.sbin/acpi/acpidump/acpi.c
==
--- head/usr.sbin/acpi/acpidump/acpi.c  Thu May 24 23:55:08 2012
(r235947)
+++ head/usr.sbin/acpi/acpidump/acpi.c  Fri May 25 00:18:19 2012
(r235948)
@@ -1196,13 +1196,13 @@ aml_disassemble(ACPI_TABLE_HEADER *rsdt,
if (tmpdir == NULL)
tmpdir = _PATH_TMP;
strncpy(tmpstr, tmpdir, sizeof(tmpstr));
-   strncat(tmpstr, /acpidump., sizeof(tmpstr) - strlen(tmpdir));
if (realpath(tmpstr, buf) == NULL) {
-   perror(realpath tmp file);
+   perror(realpath tmp dir);
return;
}
strncpy(tmpstr, buf, sizeof(tmpstr));
-   len = strlen(buf);
+   strncat(tmpstr, /acpidump., sizeof(tmpstr) - strlen(buf));
+   len = strlen(tmpstr);
tmpext = tmpstr + len;
strncpy(tmpext, XX, sizeof(tmpstr) - len);
fd = mkstemp(tmpstr);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235949 - head/usr.sbin/jail

2012-05-24 Thread Jamie Gritton
Author: jamie
Date: Fri May 25 00:38:06 2012
New Revision: 235949
URL: http://svn.freebsd.org/changeset/base/235949

Log:
  Don't try to set a null TERM environment.
  
  Submitted by: Mateusz Guzik mjguzik gmail.com

Modified:
  head/usr.sbin/jail/command.c

Modified: head/usr.sbin/jail/command.c
==
--- head/usr.sbin/jail/command.cFri May 25 00:18:19 2012
(r235948)
+++ head/usr.sbin/jail/command.cFri May 25 00:38:06 2012
(r235949)
@@ -584,7 +584,8 @@ run_command(struct cfjail *j)
term = getenv(TERM);
environ = cleanenv;
setenv(PATH, /bin:/usr/bin, 0);
-   setenv(TERM, term, 1);
+   if (term != NULL)
+   setenv(TERM, term, 1);
}
if (setusercontext(lcap, pwd, pwd-pw_uid, username
? LOGIN_SETALL  ~LOGIN_SETGROUP  ~LOGIN_SETLOGIN
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235950 - head/sys/netinet

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 01:13:39 2012
New Revision: 235950
URL: http://svn.freebsd.org/changeset/base/235950

Log:
  MFp4 bz_ipv6_fast:
  
Factor out the tcp_hc_getmtu() call.  As the comments say it
applies to both v4 and v6, so only write it once making it easier
to read the protocol family specifc code.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cFri May 25 00:38:06 2012
(r235949)
+++ head/sys/netinet/tcp_input.cFri May 25 01:13:39 2012
(r235950)
@@ -3542,7 +3542,6 @@ tcp_mssopt(struct in_conninfo *inc)
if (inc-inc_flags  INC_ISIPV6) {
mss = V_tcp_v6mssdflt;
maxmtu = tcp_maxmtu6(inc, NULL);
-   thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
}
 #endif
@@ -3553,10 +3552,13 @@ tcp_mssopt(struct in_conninfo *inc)
{
mss = V_tcp_mssdflt;
maxmtu = tcp_maxmtu(inc, NULL);
-   thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
min_protoh = sizeof(struct tcpiphdr);
}
 #endif
+#if defined(INET6) || defined(INET)
+   thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
+#endif
+
if (maxmtu  thcmtu)
mss = min(maxmtu, thcmtu) - min_protoh;
else if (maxmtu || thcmtu)
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235953 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 01:42:48 2012
New Revision: 235953
URL: http://svn.freebsd.org/changeset/base/235953

Log:
  MFp4 bz_ipv6_fast:
  
No need to hold the (expensive) rt lock over (expensive) logging.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Fri May 25 01:21:17 2012(r235952)
+++ head/sys/netinet6/icmp6.c   Fri May 25 01:42:48 2012(r235953)
@@ -2418,23 +2418,23 @@ icmp6_redirect_input(struct mbuf *m, int
if (rt) {
if (rt-rt_gateway == NULL ||
rt-rt_gateway-sa_family != AF_INET6) {
+   RTFREE_LOCKED(rt);
nd6log((LOG_ERR,
ICMP6 redirect rejected; no route 
with inet6 gateway found for redirect dst: %s\n,
icmp6_redirect_diag(src6, reddst6, redtgt6)));
-   RTFREE_LOCKED(rt);
goto bad;
}
 
gw6 = (((struct sockaddr_in6 *)rt-rt_gateway)-sin6_addr);
if (bcmp(src6, gw6, sizeof(struct in6_addr)) != 0) {
+   RTFREE_LOCKED(rt);
nd6log((LOG_ERR,
ICMP6 redirect rejected; 
not equal to gw-for-src=%s (must be same): 
%s\n,
ip6_sprintf(ip6buf, gw6),
icmp6_redirect_diag(src6, reddst6, redtgt6)));
-   RTFREE_LOCKED(rt);
goto bad;
}
} else {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235954 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 01:43:52 2012
New Revision: 235954
URL: http://svn.freebsd.org/changeset/base/235954

Log:
  MFp4 bz_ipv6_fast:
  
We currently nowhere set IP6A_SWAP making the entire check useless
with the current code.  Keep around but do not compile in.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/route6.c

Modified: head/sys/netinet6/route6.c
==
--- head/sys/netinet6/route6.c  Fri May 25 01:42:48 2012(r235953)
+++ head/sys/netinet6/route6.c  Fri May 25 01:43:52 2012(r235954)
@@ -62,6 +62,7 @@ route6_input(struct mbuf **mp, int *offp
struct mbuf *m = *mp;
struct ip6_rthdr *rh;
int off = *offp, rhlen;
+#ifdef __notyet__
struct ip6aux *ip6a;
 
ip6a = ip6_findaux(m);
@@ -73,6 +74,7 @@ route6_input(struct mbuf **mp, int *offp
return IPPROTO_DONE;
}
}
+#endif
 
 #ifndef PULLDOWN_TEST
IP6_EXTHDR_CHECK(m, off, sizeof(*rh), IPPROTO_DONE);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235955 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 01:45:05 2012
New Revision: 235955
URL: http://svn.freebsd.org/changeset/base/235955

Log:
  MFp4 bz_ipv6_fast:
  
Simplify the code removing a return from an earlier else case,
not differing from the default function return called now.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/in6_src.c

Modified: head/sys/netinet6/in6_src.c
==
--- head/sys/netinet6/in6_src.c Fri May 25 01:43:52 2012(r235954)
+++ head/sys/netinet6/in6_src.c Fri May 25 01:45:05 2012(r235955)
@@ -873,8 +873,7 @@ in6_selecthlim(struct inpcb *in6p, struc
RTFREE(ro6.ro_rt);
if (lifp)
return (ND_IFINFO(lifp)-chlim);
-   } else
-   return (V_ip6_defhlim);
+   }
}
return (V_ip6_defhlim);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235956 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 01:48:15 2012
New Revision: 235956
URL: http://svn.freebsd.org/changeset/base/235956

Log:
  MFp4 bz_ipv6_fast:
  
Hide the ip6aux functions.  The only one referenced outside ip6_input.c
is not compiled in yet (__notyet__) in route6.c (r235954).  We do have
accessor functions that should be used.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days
  X-MFC:KPI?

Modified:
  head/sys/netinet6/ip6_input.c
  head/sys/netinet6/ip6_var.h

Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Fri May 25 01:45:05 2012
(r235955)
+++ head/sys/netinet6/ip6_input.c   Fri May 25 01:48:15 2012
(r235956)
@@ -146,6 +146,9 @@ RW_SYSINIT(in6_ifaddr_lock, in6_ifaddr_
 
 static void ip6_init2(void *);
 static struct ip6aux *ip6_setdstifaddr(struct mbuf *, struct in6_ifaddr *);
+static struct ip6aux *ip6_addaux(struct mbuf *);
+static struct ip6aux *ip6_findaux(struct mbuf *m);
+static void ip6_delaux (struct mbuf *);
 static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *);
 #ifdef PULLDOWN_TEST
 static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int);
@@ -1772,7 +1775,7 @@ ip6_lasthdr(struct mbuf *m, int off, int
}
 }
 
-struct ip6aux *
+static struct ip6aux *
 ip6_addaux(struct mbuf *m)
 {
struct m_tag *mtag;
@@ -1789,7 +1792,7 @@ ip6_addaux(struct mbuf *m)
return mtag ? (struct ip6aux *)(mtag + 1) : NULL;
 }
 
-struct ip6aux *
+static struct ip6aux *
 ip6_findaux(struct mbuf *m)
 {
struct m_tag *mtag;
@@ -1798,7 +1801,7 @@ ip6_findaux(struct mbuf *m)
return mtag ? (struct ip6aux *)(mtag + 1) : NULL;
 }
 
-void
+static void
 ip6_delaux(struct mbuf *m)
 {
struct m_tag *mtag;

Modified: head/sys/netinet6/ip6_var.h
==
--- head/sys/netinet6/ip6_var.h Fri May 25 01:45:05 2012(r235955)
+++ head/sys/netinet6/ip6_var.h Fri May 25 01:48:15 2012(r235956)
@@ -388,9 +388,9 @@ char *  ip6_get_prevhdr __P((struct mbuf 
 intip6_nexthdr __P((struct mbuf *, int, int, int *));
 intip6_lasthdr __P((struct mbuf *, int, int, int *));
 
-struct ip6aux *ip6_addaux __P((struct mbuf *));
+#ifdef __notyet__
 struct ip6aux *ip6_findaux __P((struct mbuf *));
-void   ip6_delaux __P((struct mbuf *));
+#endif
 
 extern int (*ip6_mforward)(struct ip6_hdr *, struct ifnet *,
 struct mbuf *);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235957 - in head/sys/dev/ath: . ath_hal/ar5416 ath_hal/ar9002

2012-05-24 Thread Adrian Chadd
Author: adrian
Date: Fri May 25 02:07:59 2012
New Revision: 235957
URL: http://svn.freebsd.org/changeset/base/235957

Log:
  Prepare for improved (read: pcie) suspend/resume support.
  
  * Flesh out the pcie disable method for 11n chips, as they were defaulting
to the AR5212 (empty) PCIe disable method.
  
  * Add accessor macros for the HAL PCIe enable/disable calls.
  
  * Call disable on ath_suspend()
  
  * Call enable on ath_resume()
  
  NOTE:
  
  * This has nothing to do with the NIC sleep/run state - the NIC still
will stay in network-run state rather than supporting network-sleep
state.  This is preparation work for supporting correct suspend/resume
WARs for the 11n PCIe NICs.
  
  TODO:
  
  * It may be feasible at this point to keep the chip powered down during
initial probe/attach and only power it up upon the first configure/reset
pass.  This however would require correct (for values of correct)
tracking of the NIC power configuration state from the driver and that
just isn't attempted at the moment.
  
  Tested:
  
  * AR9280 on my Lenovo T60, but with no suspend/resume pass (yet).

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 01:48:15 
2012(r235956)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri May 25 02:07:59 
2012(r235957)
@@ -31,6 +31,7 @@
 #include ar5416/ar5416.ini
 
 static void ar5416ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static void ar5416DisablePCIE(struct ath_hal *ah);
 static void ar5416WriteIni(struct ath_hal *ah,
const struct ieee80211_channel *chan);
 static void ar5416SpurMitigate(struct ath_hal *ah,
@@ -99,6 +100,7 @@ ar5416InitState(struct ath_hal_5416 *ahp
ah-ah_phyDisable   = ar5416PhyDisable;
ah-ah_disable  = ar5416Disable;
ah-ah_configPCIE   = ar5416ConfigPCIE;
+   ah-ah_disablePCIE  = ar5416DisablePCIE;
ah-ah_perCalibration   = ar5416PerCalibration;
ah-ah_perCalibrationN  = ar5416PerCalibrationN,
ah-ah_resetCalValid= ar5416ResetCalValid,
@@ -474,6 +476,12 @@ ar5416ConfigPCIE(struct ath_hal *ah, HAL
 }
 
 static void
+ar5416DisablePCIE(struct ath_hal *ah)
+{
+   /* XXX TODO */
+}
+
+static void
 ar5416WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
 {
u_int modesIndex, freqIndex;

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 01:48:15 
2012(r235956)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Fri May 25 02:07:59 
2012(r235957)
@@ -62,6 +62,7 @@ static const HAL_PERCAL_DATA ar9280_adc_
 };
 
 static void ar9280ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static void ar9280DisablePCIE(struct ath_hal *ah);
 static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah);
 static void ar9280WriteIni(struct ath_hal *ah,
const struct ieee80211_channel *chan);
@@ -187,6 +188,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s
 
ah-ah_setAntennaSwitch = ar9280SetAntennaSwitch;
ah-ah_configPCIE   = ar9280ConfigPCIE;
+   ah-ah_disablePCIE  = ar9280DisablePCIE;
 
AH5416(ah)-ah_cal.iqCalData.calData = ar9280_iq_cal;
AH5416(ah)-ah_cal.adcGainCalData.calData = ar9280_adc_gain_cal;
@@ -426,6 +428,12 @@ ar9280ConfigPCIE(struct ath_hal *ah, HAL
 }
 
 static void
+ar9280DisablePCIE(struct ath_hal *ah)
+{
+   /* XXX TODO */
+}
+
+static void
 ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan)
 {
u_int modesIndex, freqIndex;

Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
==
--- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 01:48:15 
2012(r235956)
+++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Fri May 25 02:07:59 
2012(r235957)
@@ -67,6 +67,7 @@ static const HAL_PERCAL_DATA ar9280_adc_
 };
 
 static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static void ar9285DisablePCIE(struct ath_hal *ah);
 static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah);
 static void ar9285WriteIni(struct ath_hal *ah,
const struct ieee80211_channel *chan);
@@ -152,6 +153,7 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s
 
ah-ah_setAntennaSwitch = ar9285SetAntennaSwitch;

svn commit: r235958 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 02:17:16 2012
New Revision: 235958
URL: http://svn.freebsd.org/changeset/base/235958

Log:
  MFp4 bz_ipv6_fast:
  
Add support for delayed checksum calculations in the IPv6
output path.  We currently cannot offload to the card if we
add extension headers (which incl. fragmentation).
  
Fix two SCTP offload support copypaste bugs: calculate
checksums if fragmenting and no need to flag IPv4 header
checksums in the IPv6 forwarding path.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/ip6_forward.c
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_forward.c
==
--- head/sys/netinet6/ip6_forward.c Fri May 25 02:07:59 2012
(r235957)
+++ head/sys/netinet6/ip6_forward.c Fri May 25 02:17:16 2012
(r235958)
@@ -586,8 +586,6 @@ skip_routing:
CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
m-m_pkthdr.csum_data = 0x;
}
-   m-m_pkthdr.csum_flags |=
-   CSUM_IP_CHECKED | CSUM_IP_VALID;
 #ifdef SCTP
if (m-m_pkthdr.csum_flags  CSUM_SCTP)
m-m_pkthdr.csum_flags |= CSUM_SCTP_VALID;

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Fri May 25 02:07:59 2012
(r235957)
+++ head/sys/netinet6/ip6_output.c  Fri May 25 02:17:16 2012
(r235958)
@@ -83,6 +83,8 @@ __FBSDID($FreeBSD$);
 #include sys/syslog.h
 #include sys/ucred.h
 
+#include machine/in_cksum.h
+
 #include net/if.h
 #include net/netisr.h
 #include net/route.h
@@ -182,6 +184,29 @@ static int copypktopts(struct ip6_pktopt
}\
 } while (/*CONSTCOND*/ 0)
 
+static void
+in6_delayed_cksum(struct mbuf *m, uint32_t plen, u_short offset)
+{
+   u_short csum;
+
+   csum = in_cksum_skip(m, ntohl(plen), offset);
+   if (m-m_pkthdr.csum_flags  CSUM_UDP  csum == 0)
+   csum = 0x;
+   offset += m-m_pkthdr.csum_data;/* checksum offset */
+
+   if (offset + sizeof(u_short)  m-m_len) {
+   printf(%s: delayed m_pullup, m-len: %d  off: %d\n,
+   __func__, m-m_len, offset);
+   /*
+* XXX this should not happen, but if it does, the correct
+* behavior may be to insert the checksum in the appropriate
+* next mbuf in the chain.
+*/
+   return;
+   }
+   *(u_short *)(m-m_data + offset) = csum;
+}
+
 /*
  * IP6 output. The packet in mbuf chain m contains a skeletal IP6
  * header (with pri, len, nxt, hlim, src, dst).
@@ -221,9 +246,7 @@ ip6_output(struct mbuf *m0, struct ip6_p
int flevalid = 0;
int hdrsplit = 0;
int needipsec = 0;
-#ifdef SCTP
-   int sw_csum;
-#endif
+   int sw_csum, tso;
 #ifdef IPSEC
struct ipsec_output_state state;
struct ip6_rthdr *rh = NULL;
@@ -867,8 +890,6 @@ again:
CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
m-m_pkthdr.csum_data = 0x;
}
-   m-m_pkthdr.csum_flags |=
-   CSUM_IP_CHECKED | CSUM_IP_VALID;
 #ifdef SCTP
if (m-m_pkthdr.csum_flags  CSUM_SCTP)
m-m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
@@ -891,7 +912,7 @@ again:
}
 #ifdef SCTP
if (m-m_pkthdr.csum_flags  CSUM_SCTP)
-   m-m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
+   m-m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
 #endif   
error = netisr_queue(NETISR_IPV6, m);
goto done;
@@ -927,16 +948,32 @@ passout:
 * 4: if dontfrag == 1  alwaysfrag == 1
 *  error, as we cannot handle this conflicting request
 */
+   sw_csum = m-m_pkthdr.csum_flags;
+   if (!hdrsplit) {
+   tso = ((sw_csum  ifp-if_hwassist  CSUM_TSO) != 0) ? 1 : 0;
+   sw_csum = ~ifp-if_hwassist;
+   } else
+   tso = 0;
+   /*
+* If we added extension headers, we will not do TSO and calculate the
+* checksums ourselves for now.
+* XXX-BZ  Need a framework to know when the NIC can handle it, even
+* with ext. hdrs.
+*/
+   if (sw_csum  CSUM_DELAY_DATA) {
+   sw_csum = ~CSUM_DELAY_DATA;
+   in6_delayed_cksum(m, ip6-ip6_plen, sizeof(struct ip6_hdr));
+   }
 #ifdef SCTP
-   sw_csum = m-m_pkthdr.csum_flags  ~ifp-if_hwassist;
if (sw_csum  CSUM_SCTP) {
-   sctp_delayed_cksum(m, sizeof(struct 

svn commit: r235959 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 02:19:17 2012
New Revision: 235959
URL: http://svn.freebsd.org/changeset/base/235959

Log:
  MFp4 bz_ipv6_fast:
  
Defer checksum calulations on UDP6 output and respect the mbuf
flags set by NICs having done checksum validation for us already,
thus saving the computing time in the input path as well.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==
--- head/sys/netinet6/udp6_usrreq.c Fri May 25 02:17:16 2012
(r235958)
+++ head/sys/netinet6/udp6_usrreq.c Fri May 25 02:19:17 2012
(r235959)
@@ -185,6 +185,7 @@ udp6_input(struct mbuf **mp, int *offp, 
 #ifdef IPFIREWALL_FORWARD
struct m_tag *fwd_tag;
 #endif
+   uint16_t uh_sum;
 
ifp = m-m_pkthdr.rcvif;
ip6 = mtod(m, struct ip6_hdr *);
@@ -228,7 +229,18 @@ udp6_input(struct mbuf **mp, int *offp, 
UDPSTAT_INC(udps_nosum);
goto badunlocked;
}
-   if (in6_cksum(m, IPPROTO_UDP, off, ulen) != 0) {
+
+   if (m-m_pkthdr.csum_flags  CSUM_DATA_VALID) {
+   if (m-m_pkthdr.csum_flags  CSUM_PSEUDO_HDR)
+   uh_sum = m-m_pkthdr.csum_data;
+   else
+   uh_sum = in6_cksum_pseudo(ip6, ulen,
+   IPPROTO_UDP, m-m_pkthdr.csum_data);
+   uh_sum ^= 0x;
+   } else
+   uh_sum = in6_cksum(m, IPPROTO_UDP, off, ulen);
+
+   if (uh_sum != 0) {
UDPSTAT_INC(udps_badsum);
goto badunlocked;
}
@@ -771,10 +783,9 @@ udp6_output(struct inpcb *inp, struct mb
ip6-ip6_src= *laddr;
ip6-ip6_dst= *faddr;
 
-   if ((udp6-uh_sum = in6_cksum(m, IPPROTO_UDP,
-   sizeof(struct ip6_hdr), plen)) == 0) {
-   udp6-uh_sum = 0x;
-   }
+   udp6-uh_sum = in6_cksum_pseudo(ip6, plen, IPPROTO_UDP, 0);
+   m-m_pkthdr.csum_flags = CSUM_UDP;
+   m-m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
 
flags = 0;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235960 - head/sys/net

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 02:21:17 2012
New Revision: 235960
URL: http://svn.freebsd.org/changeset/base/235960

Log:
  MFp4 bz_ipv6_fast:
  
Simple yet effective change enabling checksum offload on loopback
for IPv6 to avoid expensive computations.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/net/if_loop.c

Modified: head/sys/net/if_loop.c
==
--- head/sys/net/if_loop.c  Fri May 25 02:19:17 2012(r235959)
+++ head/sys/net/if_loop.c  Fri May 25 02:21:17 2012(r235960)
@@ -247,12 +247,12 @@ looutput(struct ifnet *ifp, struct mbuf 
 #if 1  /* XXX */
switch (dst-sa_family) {
case AF_INET:
+   case AF_INET6:
if (ifp-if_capenable  IFCAP_RXCSUM) {
m-m_pkthdr.csum_data = 0x;
m-m_pkthdr.csum_flags = LO_CSUM_SET;
}
m-m_pkthdr.csum_flags = ~LO_CSUM_FEATURES;
-   case AF_INET6:
case AF_IPX:
case AF_APPLETALK:
break;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235961 - head/sys/netinet

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 02:23:26 2012
New Revision: 235961
URL: http://svn.freebsd.org/changeset/base/235961

Log:
  MFp4 bz_ipv6_fast:
  
Add code to handle pre-checked TCP checksums as indicated by mbuf
flags to save the entire computation for validation if not needed.
  
In the IPv6 TCP output path only compute the pseudo-header checksum,
set the checksum offset in the mbuf field along the appropriate flag
as done in IPv4.
  
In tcp_respond() just initialize the IPv6 payload length to 0 as
ip6_output() will properly set it.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_timewait.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cFri May 25 02:21:17 2012
(r235960)
+++ head/sys/netinet/tcp_input.cFri May 25 02:23:26 2012
(r235961)
@@ -577,13 +577,31 @@ tcp_input(struct mbuf *m, int off0)
 #ifdef INET6
if (isipv6) {
/* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */
+
+   if (m-m_len  (sizeof(*ip6) + sizeof(*th))) {
+   m = m_pullup(m, sizeof(*ip6) + sizeof(*th));
+   if (m == NULL) {
+   TCPSTAT_INC(tcps_rcvshort);
+   return;
+   }
+   }
+
ip6 = mtod(m, struct ip6_hdr *);
+   th = (struct tcphdr *)((caddr_t)ip6 + off0);
tlen = sizeof(*ip6) + ntohs(ip6-ip6_plen) - off0;
-   if (in6_cksum(m, IPPROTO_TCP, off0, tlen)) {
+   if (m-m_pkthdr.csum_flags  CSUM_DATA_VALID) {
+   if (m-m_pkthdr.csum_flags  CSUM_PSEUDO_HDR)
+   th-th_sum = m-m_pkthdr.csum_data;
+   else
+   th-th_sum = in6_cksum_pseudo(ip6, tlen,
+   IPPROTO_TCP, m-m_pkthdr.csum_data);
+   th-th_sum ^= 0x;
+   } else
+   th-th_sum = in6_cksum(m, IPPROTO_TCP, off0, tlen);
+   if (th-th_sum) {
TCPSTAT_INC(tcps_rcvbadsum);
goto drop;
}
-   th = (struct tcphdr *)((caddr_t)ip6 + off0);
 
/*
 * Be proactive about unspecified IPv6 address in source.

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Fri May 25 02:21:17 2012
(r235960)
+++ head/sys/netinet/tcp_output.c   Fri May 25 02:23:26 2012
(r235961)
@@ -1047,19 +1047,23 @@ send:
 * checksum extended header and data.
 */
m-m_pkthdr.len = hdrlen + len; /* in6_cksum() need this */
+   m-m_pkthdr.csum_flags = CSUM_TCP;
+   m-m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
 #ifdef INET6
-   if (isipv6)
+   if (isipv6) {
/*
 * ip6_plen is not need to be filled now, and will be filled
 * in ip6_output.
 */
-   th-th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(struct ip6_hdr),
-  sizeof(struct tcphdr) + optlen + len);
+   th-th_sum = in6_cksum_pseudo(ip6, sizeof(struct tcphdr) +
+   optlen + len, IPPROTO_TCP, 0);
+   }
+#endif
+#if defined(INET6)  defined(INET)
else
-#endif /* INET6 */
+#endif
+#ifdef INET
{
-   m-m_pkthdr.csum_flags = CSUM_TCP;
-   m-m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
th-th_sum = in_pseudo(ip-ip_src.s_addr, ip-ip_dst.s_addr,
htons(sizeof(struct tcphdr) + IPPROTO_TCP + len + optlen));
 
@@ -1067,6 +1071,7 @@ send:
KASSERT(ip-ip_v == IPVERSION,
(%s: IP version incorrect: %d, __func__, ip-ip_v));
}
+#endif
 
/*
 * Enable TSO and specify the size of the segments.

Modified: head/sys/netinet/tcp_subr.c
==
--- head/sys/netinet/tcp_subr.c Fri May 25 02:21:17 2012(r235960)
+++ head/sys/netinet/tcp_subr.c Fri May 25 02:23:26 2012(r235961)
@@ -573,8 +573,7 @@ tcp_respond(struct tcpcb *tp, void *ipge
ip6-ip6_flow = 0;
ip6-ip6_vfc = IPV6_VERSION;
ip6-ip6_nxt = IPPROTO_TCP;
-   ip6-ip6_plen = htons((u_short)(sizeof (struct tcphdr) +
-   tlen));
+   ip6-ip6_plen = 0;  /* 

Re: svn commit: r235960 - head/sys/net

2012-05-24 Thread Bjoern A. Zeeb

On 25. May 2012, at 02:21 , Bjoern A. Zeeb wrote:

 Author: bz
 Date: Fri May 25 02:21:17 2012
 New Revision: 235960
 URL: http://svn.freebsd.org/changeset/base/235960
 
 Log:
  MFp4 bz_ipv6_fast:
 
Simple yet effective change enabling checksum offload on loopback
for IPv6 to avoid expensive computations.

While not particularly related but a good example:  if we would
provide a better library KPI we could possibly even defer
(pseudo-header) checksum calculations to drivers, which expect
different calculations already anyway, and even save these cycles
on loop as well.

Something more to ponder along with other factoring out of drivers etc.

/bz

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

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


svn commit: r235962 - head/sys/netinet6

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 02:58:21 2012
New Revision: 235962
URL: http://svn.freebsd.org/changeset/base/235962

Log:
  MFp4 bz_ipv6_fast:
  
Factor out Hop-By-Hop option processing.  It's still not heavily used,
it reduces the footprint of ip6_input() and makes ip6_input() more
readable.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/netinet6/ip6_input.c

Modified: head/sys/netinet6/ip6_input.c
==
--- head/sys/netinet6/ip6_input.c   Fri May 25 02:23:26 2012
(r235961)
+++ head/sys/netinet6/ip6_input.c   Fri May 25 02:58:21 2012
(r235962)
@@ -331,6 +331,83 @@ ip6_init2(void *dummy)
 /* This must be after route_init(), which is now SI_ORDER_THIRD */
 SYSINIT(netinet6init2, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ip6_init2, NULL);
 
+static int
+ip6_input_hbh(struct mbuf *m, uint32_t *plen, uint32_t *rtalert, int *off,
+int *nxt, int *ours)
+{
+   struct ip6_hdr *ip6;
+   struct ip6_hbh *hbh;
+
+   if (ip6_hopopts_input(plen, rtalert, m, off)) {
+#if 0  /*touches NULL pointer*/
+   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_discard);
+#endif
+   goto out;   /* m have already been freed */
+   }
+
+   /* adjust pointer */
+   ip6 = mtod(m, struct ip6_hdr *);
+
+   /*
+* if the payload length field is 0 and the next header field
+* indicates Hop-by-Hop Options header, then a Jumbo Payload
+* option MUST be included.
+*/
+   if (ip6-ip6_plen == 0  *plen == 0) {
+   /*
+* Note that if a valid jumbo payload option is
+* contained, ip6_hopopts_input() must set a valid
+* (non-zero) payload length to the variable plen.
+*/
+   V_ip6stat.ip6s_badoptions++;
+   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_discard);
+   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_hdrerr);
+   icmp6_error(m, ICMP6_PARAM_PROB,
+   ICMP6_PARAMPROB_HEADER,
+   (caddr_t)ip6-ip6_plen - (caddr_t)ip6);
+   goto out;
+   }
+#ifndef PULLDOWN_TEST
+   /* ip6_hopopts_input() ensures that mbuf is contiguous */
+   hbh = (struct ip6_hbh *)(ip6 + 1);
+#else
+   IP6_EXTHDR_GET(hbh, struct ip6_hbh *, m, sizeof(struct ip6_hdr),
+   sizeof(struct ip6_hbh));
+   if (hbh == NULL) {
+   V_ip6stat.ip6s_tooshort++;
+   goto out;
+   }
+#endif
+   *nxt = hbh-ip6h_nxt;
+
+   /*
+* If we are acting as a router and the packet contains a
+* router alert option, see if we know the option value.
+* Currently, we only support the option value for MLD, in which
+* case we should pass the packet to the multicast routing
+* daemon.
+*/
+   if (*rtalert != ~0) {
+   switch (*rtalert) {
+   case IP6OPT_RTALERT_MLD:
+   if (V_ip6_forwarding)
+   *ours = 1;
+   break;
+   default:
+   /*
+* RFC2711 requires unrecognized values must be
+* silently ignored.
+*/
+   break;
+   }
+   }
+
+   return (0);
+
+out:
+   return (1);
+}
+
 void
 ip6_input(struct mbuf *m)
 {
@@ -825,71 +902,11 @@ passin:
 */
plen = (u_int32_t)ntohs(ip6-ip6_plen);
if (ip6-ip6_nxt == IPPROTO_HOPOPTS) {
-   struct ip6_hbh *hbh;
+   int error;
 
-   if (ip6_hopopts_input(plen, rtalert, m, off)) {
-#if 0  /*touches NULL pointer*/
-   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_discard);
-#endif
-   goto out;   /* m have already been freed */
-   }
-
-   /* adjust pointer */
-   ip6 = mtod(m, struct ip6_hdr *);
-
-   /*
-* if the payload length field is 0 and the next header field
-* indicates Hop-by-Hop Options header, then a Jumbo Payload
-* option MUST be included.
-*/
-   if (ip6-ip6_plen == 0  plen == 0) {
-   /*
-* Note that if a valid jumbo payload option is
-* contained, ip6_hopopts_input() must set a valid
-* (non-zero) payload length to the variable plen.
-*/
-   V_ip6stat.ip6s_badoptions++;
-   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_discard);
-   in6_ifstat_inc(m-m_pkthdr.rcvif, ifs6_in_hdrerr);
-   icmp6_error(m, 

svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 03:00:34 2012
New Revision: 235963
URL: http://svn.freebsd.org/changeset/base/235963

Log:
  MFp4 bz_ipv6_fast:
  
Allow LRO to work on IPv6 as well.
Fix the module Makefile to at least properly inlcude opt_inet6.h
and allow builds without INET or INET6.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/modules/cxgb/cxgb/Makefile

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cFri May 25 02:58:21 2012
(r235962)
+++ head/sys/dev/cxgb/cxgb_sge.cFri May 25 03:00:34 2012
(r235963)
@@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include opt_inet6.h
 #include opt_inet.h
 
 #include sys/param.h
@@ -2085,7 +2086,7 @@ t3_free_qset(adapter_t *sc, struct sge_q
MTX_DESTROY(q-rspq.lock);
}
 
-#ifdef INET
+#if defined(INET6) || defined(INET)
tcp_lro_free(q-lro.ctrl);
 #endif
 
@@ -2668,7 +2669,7 @@ t3_sge_alloc_qset(adapter_t *sc, u_int i
 
/* Allocate and setup the lro_ctrl structure */
q-lro.enabled = !!(pi-ifp-if_capenable  IFCAP_LRO);
-#ifdef INET
+#if defined(INET6) || defined(INET)
ret = tcp_lro_init(q-lro.ctrl);
if (ret) {
printf(error %d from tcp_lro_init\n, ret);
@@ -2961,9 +2962,11 @@ process_responses(adapter_t *adap, struc
struct rsp_desc *r = rspq-desc[rspq-cidx];
int budget_left = budget;
unsigned int sleeping = 0;
+#if defined(INET6) || defined(INET)
int lro_enabled = qs-lro.enabled;
int skip_lro;
struct lro_ctrl *lro_ctrl = qs-lro.ctrl;
+#endif
struct mbuf *offload_mbufs[RX_BUNDLE_SIZE];
int ngathered = 0;
struct t3_mbuf_hdr *mh = rspq-rspq_mh;
@@ -3082,15 +3085,16 @@ process_responses(adapter_t *adap, struc
 * The mbuf's rcvif was derived from the cpl header and
 * is accurate.  Skip LRO and just use that.
 */
+#if defined(INET6) || defined(INET)
skip_lro = __predict_false(qs-port-ifp != 
m-m_pkthdr.rcvif);
 
if (lro_enabled  lro_ctrl-lro_cnt  !skip_lro
-#ifdef INET
 (tcp_lro_rx(lro_ctrl, m, 0) == 0)
-#endif
) {
/* successfully queue'd for LRO */
-   } else {
+   } else
+#endif
+   {
/*
 * LRO not enabled, packet unsuitable for LRO,
 * or unable to queue.  Pass it up right now in
@@ -3109,7 +3113,7 @@ process_responses(adapter_t *adap, struc
 
deliver_partial_bundle(adap-tdev, rspq, offload_mbufs, ngathered);
 
-#ifdef INET
+#if defined(INET6) || defined(INET)
/* Flush LRO */
while (!SLIST_EMPTY(lro_ctrl-lro_active)) {
struct lro_entry *queued = SLIST_FIRST(lro_ctrl-lro_active);

Modified: head/sys/modules/cxgb/cxgb/Makefile
==
--- head/sys/modules/cxgb/cxgb/Makefile Fri May 25 02:58:21 2012
(r235962)
+++ head/sys/modules/cxgb/cxgb/Makefile Fri May 25 03:00:34 2012
(r235963)
@@ -8,9 +8,21 @@ SRCS=  cxgb_mc5.c cxgb_vsc8211.c cxgb_ael
 SRCS+= cxgb_xgmac.c cxgb_vsc7323.c cxgb_t3_hw.c cxgb_main.c cxgb_aq100x.c
 SRCS+=  cxgb_sge.c cxgb_offload.c cxgb_tn1010.c
 SRCS+= device_if.h bus_if.h pci_if.h
-SRCS+= opt_inet.h opt_zero.h opt_sched.h
+SRCS+= opt_inet.h opt_inet6.h opt_zero.h opt_sched.h
 SRCS+= uipc_mvec.c
 
 CFLAGS+= -g -DDEFAULT_JUMBO -I${CXGB}
 
+.if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != no
+opt_inet.h:
+   @echo #define INET 1  ${.TARGET}
+.endif
+
+.if ${MK_INET6_SUPPORT} != no
+opt_inet6.h:
+   @echo #define INET6 1  ${.TARGET}
+.endif
+.endif
+
 .include bsd.kmod.mk
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r235964 - in head/sys: dev/ixgbe modules/ixgbe

2012-05-24 Thread Bjoern A. Zeeb
Author: bz
Date: Fri May 25 03:02:56 2012
New Revision: 235964
URL: http://svn.freebsd.org/changeset/base/235964

Log:
  MFp4 bz_ipv6_fast:
  
Add TSO6 and LRO/IPv6 support.
Fix the module Makefile to at least properly inlcude opt_inet6.h
and allow builds without INET or INET6.
  
Sponsored by:   The FreeBSD Foundation
Sponsored by:   iXsystems
  
  Reviewed by:  gnn (as part of the whole)
  MFC After:3 days

Modified:
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/modules/ixgbe/Makefile

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Fri May 25 03:00:34 2012(r235963)
+++ head/sys/dev/ixgbe/ixgbe.c  Fri May 25 03:02:56 2012(r235964)
@@ -162,7 +162,7 @@ static void ixgbe_dma_free(struct ad
 static voidixgbe_add_rx_process_limit(struct adapter *, const char *,
const char *, int *, int);
 static boolixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *);
-static boolixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *);
+static boolixgbe_tso_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *);
 static voidixgbe_set_ivar(struct adapter *, u8, u8, s8);
 static voidixgbe_configure_ivars(struct adapter *);
 static u8 *ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
@@ -997,6 +997,8 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c
ifp-if_capenable ^= IFCAP_HWCSUM;
if (mask  IFCAP_TSO4)
ifp-if_capenable ^= IFCAP_TSO4;
+   if (mask  IFCAP_TSO6)
+   ifp-if_capenable ^= IFCAP_TSO6;
if (mask  IFCAP_LRO)
ifp-if_capenable ^= IFCAP_LRO;
if (mask  IFCAP_VLAN_HWTAGGING)
@@ -1061,7 +1063,7 @@ ixgbe_init_locked(struct adapter *adapte
 
/* Set the various hardware offload abilities */
ifp-if_hwassist = 0;
-   if (ifp-if_capenable  IFCAP_TSO4)
+   if (ifp-if_capenable  IFCAP_TSO)
ifp-if_hwassist |= CSUM_TSO;
if (ifp-if_capenable  IFCAP_TXCSUM) {
ifp-if_hwassist |= (CSUM_TCP | CSUM_UDP);
@@ -1767,9 +1769,8 @@ ixgbe_xmit(struct tx_ring *txr, struct m
** a packet.
*/
if (m_head-m_pkthdr.csum_flags  CSUM_TSO) {
-   if (ixgbe_tso_setup(txr, m_head, paylen)) {
+   if (ixgbe_tso_setup(txr, m_head, paylen, olinfo_status)) {
cmd_type_len |= IXGBE_ADVTXD_DCMD_TSE;
-   olinfo_status |= IXGBE_TXD_POPTS_IXSM  8;
olinfo_status |= IXGBE_TXD_POPTS_TXSM  8;
olinfo_status |= paylen  IXGBE_ADVTXD_PAYLEN_SHIFT;
++adapter-tso_tx;
@@ -2562,7 +2563,7 @@ ixgbe_setup_interface(device_t dev, stru
 */
ifp-if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
 
-   ifp-if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO4 | IFCAP_VLAN_HWCSUM;
+   ifp-if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM;
ifp-if_capabilities |= IFCAP_JUMBO_MTU;
ifp-if_capabilities |= IFCAP_VLAN_HWTAGGING
 |  IFCAP_VLAN_HWTSO
@@ -3234,6 +3235,7 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
case ETHERTYPE_IPV6:
ip6 = (struct ip6_hdr *)(mp-m_data + ehdrlen);
ip_hlen = sizeof(struct ip6_hdr);
+   /* XXX-BZ this will go badly in case of ext hdrs. */
ipproto = ip6-ip6_nxt;
type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6;
break;
@@ -3292,17 +3294,23 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, 
  *
  **/
 static bool
-ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen)
+ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, u32 *paylen,
+u32 *olinfo_status)
 {
struct adapter *adapter = txr-adapter;
struct ixgbe_adv_tx_context_desc *TXD;
struct ixgbe_tx_buf*tx_buffer;
u32 vlan_macip_lens = 0, type_tucmd_mlhl = 0;
-   u32 mss_l4len_idx = 0;
-   u16 vtag = 0;
-   int ctxd, ehdrlen,  hdrlen, ip_hlen, tcp_hlen;
+   u32 mss_l4len_idx = 0, len;
+   u16 vtag = 0, eh_type;
+   int ctxd, ehdrlen, ip_hlen, tcp_hlen;
struct ether_vlan_header *eh;
+#ifdef INET6
+   struct ip6_hdr *ip6;
+#endif
+#ifdef INET
struct ip *ip;
+#endif
struct tcphdr *th;
 
 
@@ -3311,32 +3319,62 @@ ixgbe_tso_setup(struct tx_ring *txr, str
 * Jump over vlan headers if already present
 */
eh = mtod(mp, struct ether_vlan_header *);
-   if (eh-evl_encap_proto == htons(ETHERTYPE_VLAN)) 
+   if (eh-evl_encap_proto == htons(ETHERTYPE_VLAN)) {
ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN;
-   else
+   

Re: svn commit: r235963 - in head/sys: dev/cxgb modules/cxgb/cxgb

2012-05-24 Thread Bjoern A. Zeeb

On 25. May 2012, at 03:00 , Bjoern A. Zeeb wrote:

 Author: bz
 Date: Fri May 25 03:00:34 2012
 New Revision: 235963
 URL: http://svn.freebsd.org/changeset/base/235963
 
 Log:
  MFp4 bz_ipv6_fast:
 
Allow LRO to work on IPv6 as well.

Note that TSO6 support had been present in cxgb(4) since r231317.

/bz

-- 
Bjoern A. Zeeb You have to have visions!
   It does not matter how good you are. It matters what good you do!

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


svn commit: r235967 - head/usr.sbin/utx

2012-05-24 Thread Warren Block
Author: wblock (doc committer)
Date: Fri May 25 03:46:56 2012
New Revision: 235967
URL: http://svn.freebsd.org/changeset/base/235967

Log:
  Fixes to man8 groff mandoc style, usage mistakes, or typos.
  
  PR:   168016
  Submitted by: Nobuyuki Koganemaru
  Approved by:  gjb
  MFC after:3 days

Modified:
  head/usr.sbin/utx/utx.8

Modified: head/usr.sbin/utx/utx.8
==
--- head/usr.sbin/utx/utx.8 Fri May 25 03:08:46 2012(r235966)
+++ head/usr.sbin/utx/utx.8 Fri May 25 03:46:56 2012(r235967)
@@ -94,7 +94,7 @@ database, its use is limited to the supe
 .Sh SEE ALSO
 .Xr getent 1 ,
 .Xr w 1 ,
-.Xr pututxline 3 .
+.Xr pututxline 3
 .Sh HISTORY
 The
 .Nm
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r235918 - head/sys/geom/label

2012-05-24 Thread Andrey V. Elsukov
On 24.05.2012 20:48, Edward Tomasz Napierala wrote:
 Log:
   Make g_label(4) ignore provider size when looking for UFS labels.
   Without it, it fails to create labels for filesystems resized by
   growfs(8).
   
   PR: kern/165962

I think it should be fixed in the growfs(8), not here. It seems to me
that growfs(8) incorrectly calculates some values.

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


svn commit: r235972 - in head/sys/dev/ath: . ath_hal ath_hal/ar5210 ath_hal/ar5211 ath_hal/ar5212 ath_hal/ar5416 ath_hal/ar9002

2012-05-24 Thread Adrian Chadd
Author: adrian
Date: Fri May 25 05:01:27 2012
New Revision: 235972
URL: http://svn.freebsd.org/changeset/base/235972

Log:
  oops - ath_hal_disablepcie is actually destined for another purpose,
  not to disable the PCIe PHY in prepration for reset.
  
  Extend the enablepci method to have a poweroff flag, which if equal
  to true means the hardware is about to go to sleep.

Modified:
  head/sys/dev/ath/ath_hal/ah.h
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
  head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
  head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c
  head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_athvar.h

Modified: head/sys/dev/ath/ath_hal/ah.h
==
--- head/sys/dev/ath/ath_hal/ah.h   Fri May 25 04:42:18 2012
(r235971)
+++ head/sys/dev/ath/ath_hal/ah.h   Fri May 25 05:01:27 2012
(r235972)
@@ -832,7 +832,8 @@ struct ath_hal {
HAL_BOOL bChannelChange, HAL_STATUS *status);
HAL_BOOL  __ahdecl(*ah_phyDisable)(struct ath_hal *);
HAL_BOOL  __ahdecl(*ah_disable)(struct ath_hal *);
-   void  __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore);
+   void  __ahdecl(*ah_configPCIE)(struct ath_hal *, HAL_BOOL restore,
+   HAL_BOOL power_off);
void  __ahdecl(*ah_disablePCIE)(struct ath_hal *);
void  __ahdecl(*ah_setPCUConfig)(struct ath_hal *);
HAL_BOOL  __ahdecl(*ah_perCalibration)(struct ath_hal*,

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==
--- head/sys/dev/ath/ath_hal/ah_internal.h  Fri May 25 04:42:18 2012
(r235971)
+++ head/sys/dev/ath/ath_hal/ah_internal.h  Fri May 25 05:01:27 2012
(r235972)
@@ -355,8 +355,8 @@ struct ath_hal_private {
AH_PRIVATE(_ah)-ah_getNfAdjust(_ah, _c)
 #defineath_hal_getNoiseFloor(_ah, _nfArray) \
AH_PRIVATE(_ah)-ah_getNoiseFloor(_ah, _nfArray)
-#defineath_hal_configPCIE(_ah, _reset) \
-   (_ah)-ah_configPCIE(_ah, _reset)
+#defineath_hal_configPCIE(_ah, _reset, _poweroff) \
+   (_ah)-ah_configPCIE(_ah, _reset, _poweroff)
 #defineath_hal_disablePCIE(_ah) \
(_ah)-ah_disablePCIE(_ah)
 #defineath_hal_setInterrupts(_ah, _mask) \

Modified: head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 04:42:18 
2012(r235971)
+++ head/sys/dev/ath/ath_hal/ar5210/ar5210_attach.c Fri May 25 05:01:27 
2012(r235972)
@@ -33,7 +33,8 @@ staticHAL_BOOL ar5210GetChannelEdges(st
 static HAL_BOOL ar5210GetChipPowerLimits(struct ath_hal *ah,
struct ieee80211_channel *chan);
 
-static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static void ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore,
+   HAL_BOOL power_on);
 static void ar5210DisablePCIE(struct ath_hal *ah);
 
 static const struct ath_hal_private ar5210hal = {{
@@ -332,7 +333,7 @@ ar5210GetChipPowerLimits(struct ath_hal 
 }
 
 static void
-ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore)
+ar5210ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
 {
 }
 

Modified: head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 04:42:18 
2012(r235971)
+++ head/sys/dev/ath/ath_hal/ar5211/ar5211_attach.c Fri May 25 05:01:27 
2012(r235972)
@@ -33,7 +33,8 @@ static HAL_BOOL ar5211GetChannelEdges(st
 static HAL_BOOL ar5211GetChipPowerLimits(struct ath_hal *ah,
struct ieee80211_channel *chan);
 
-static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore);
+static void ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore,
+   HAL_BOOL power_off);
 static void ar5211DisablePCIE(struct ath_hal *ah);
 
 static const struct ath_hal_private ar5211hal = {{
@@ -455,7 +456,7 @@ ar5211GetChipPowerLimits(struct ath_hal 
 }
 
 static void
-ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore)
+ar5211ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore, HAL_BOOL power_off)
 {
 }
 

Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c
==
--- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 04:42:18 
2012(r235971)
+++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Fri May 25 05:01:27 
2012(r235972)

svn commit: r235973 - head/sys/amd64/amd64

2012-05-24 Thread Alan Cox
Author: alc
Date: Fri May 25 05:28:14 2012
New Revision: 235973
URL: http://svn.freebsd.org/changeset/base/235973

Log:
  Correct an error in pmap_pv_reclaim().  In a rare case, when it should have
  returned NULL, it might instead return a pointer to a page that it had just
  unmapped.

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Fri May 25 05:01:27 2012(r235972)
+++ head/sys/amd64/amd64/pmap.c Fri May 25 05:28:14 2012(r235973)
@@ -2058,14 +2058,14 @@ pmap_pv_reclaim(pmap_t locked_pmap)
pt_entry_t *pte, tpte;
pv_entry_t pv;
vm_offset_t va;
-   vm_page_t free, m;
+   vm_page_t free, m, m_pc;
uint64_t inuse, freemask;
int bit, field, freed;

rw_assert(pvh_global_lock, RA_WLOCKED);
PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED);
pmap = NULL;
-   free = m = NULL;
+   free = m_pc = NULL;
TAILQ_INIT(newtail);
while ((pc = TAILQ_FIRST(pv_chunks)) != NULL  free == NULL) {
TAILQ_REMOVE(pv_chunks, pc, pc_lru);
@@ -2141,8 +2141,8 @@ pmap_pv_reclaim(pmap_t locked_pmap)
PV_STAT(pc_chunk_count--);
PV_STAT(pc_chunk_frees++);
/* Entire chunk is free; return it. */
-   m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
-   dump_drop_page(m-phys_addr);
+   m_pc = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc));
+   dump_drop_page(m_pc-phys_addr);
break;
}
TAILQ_INSERT_HEAD(pmap-pm_pvchunk, pc, pc_list);
@@ -2157,15 +2157,15 @@ pmap_pv_reclaim(pmap_t locked_pmap)
if (pmap != locked_pmap)
PMAP_UNLOCK(pmap);
}
-   if (m == NULL  free != NULL) {
-   m = free;
-   free = m-right;
+   if (m_pc == NULL  free != NULL) {
+   m_pc = free;
+   free = m_pc-right;
/* Recycle a freed page table page. */
-   m-wire_count = 1;
+   m_pc-wire_count = 1;
atomic_add_int(cnt.v_wire_count, 1);
}
pmap_free_zero_pages(free);
-   return (m);
+   return (m_pc);
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org