svn commit: r221943 - in stable/8/sys/ufs: ffs ufs

2011-05-15 Thread Konstantin Belousov
Author: kib
Date: Sun May 15 06:42:32 2011
New Revision: 221943
URL: http://svn.freebsd.org/changeset/base/221943

Log:
  MFC r220985:
  Move some parts of ufs_reclaim() into helper function ufs_prepare_reclaim(),
  and call the helper from VOP_RECLAIM and ffs_valloc() to properly prepare
  the ufs vnode for reuse.

Modified:
  stable/8/sys/ufs/ffs/ffs_alloc.c
  stable/8/sys/ufs/ufs/ufs_extern.h
  stable/8/sys/ufs/ufs/ufs_inode.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/ufs/ffs/ffs_alloc.c
==
--- stable/8/sys/ufs/ffs/ffs_alloc.cSun May 15 04:03:11 2011
(r221942)
+++ stable/8/sys/ufs/ffs/ffs_alloc.cSun May 15 06:42:32 2011
(r221943)
@@ -1014,8 +1014,9 @@ dup_alloc:
ip-i_din2-di_birthtime = ts.tv_sec;
ip-i_din2-di_birthnsec = ts.tv_nsec;
}
+   ufs_prepare_reclaim(*vpp);
ip-i_flag = 0;
-   vnode_destroy_vobject(*vpp);
+   (*vpp)-v_vflag = 0;
(*vpp)-v_type = VNON;
if (fs-fs_magic == FS_UFS2_MAGIC)
(*vpp)-v_op = ffs_vnodeops2;

Modified: stable/8/sys/ufs/ufs/ufs_extern.h
==
--- stable/8/sys/ufs/ufs/ufs_extern.h   Sun May 15 04:03:11 2011
(r221942)
+++ stable/8/sys/ufs/ufs/ufs_extern.h   Sun May 15 06:42:32 2011
(r221943)
@@ -76,6 +76,7 @@ intufs_inactive(struct vop_inactive_ar
 int ufs_init(struct vfsconf *);
 voidufs_itimes(struct vnode *vp);
 int ufs_lookup(struct vop_cachedlookup_args *);
+voidufs_prepare_reclaim(struct vnode *vp);
 int ufs_readdir(struct vop_readdir_args *);
 int ufs_reclaim(struct vop_reclaim_args *);
 voidffs_snapgone(struct inode *);

Modified: stable/8/sys/ufs/ufs/ufs_inode.c
==
--- stable/8/sys/ufs/ufs/ufs_inode.cSun May 15 04:03:11 2011
(r221942)
+++ stable/8/sys/ufs/ufs/ufs_inode.cSun May 15 06:42:32 2011
(r221943)
@@ -168,6 +168,31 @@ out:
return (error);
 }
 
+void
+ufs_prepare_reclaim(struct vnode *vp)
+{
+   struct inode *ip;
+#ifdef QUOTA
+   int i;
+#endif
+
+   ip = VTOI(vp);
+
+   vnode_destroy_vobject(vp);
+#ifdef QUOTA
+   for (i = 0; i  MAXQUOTAS; i++) {
+   if (ip-i_dquot[i] != NODQUOT) {
+   dqrele(vp, ip-i_dquot[i]);
+   ip-i_dquot[i] = NODQUOT;
+   }
+   }
+#endif
+#ifdef UFS_DIRHASH
+   if (ip-i_dirhash != NULL)
+   ufsdirhash_free(ip);
+#endif
+}
+
 /*
  * Reclaim an inode so that it can be used for other purposes.
  */
@@ -181,14 +206,9 @@ ufs_reclaim(ap)
struct vnode *vp = ap-a_vp;
struct inode *ip = VTOI(vp);
struct ufsmount *ump = ip-i_ump;
-#ifdef QUOTA
-   int i;
-#endif
 
-   /*
-* Destroy the vm object and flush associated pages.
-*/
-   vnode_destroy_vobject(vp);
+   ufs_prepare_reclaim(vp);
+
if (ip-i_flag  IN_LAZYMOD)
ip-i_flag |= IN_MODIFIED;
UFS_UPDATE(vp, 0);
@@ -196,21 +216,7 @@ ufs_reclaim(ap)
 * Remove the inode from its hash chain.
 */
vfs_hash_remove(vp);
-   /*
-* Purge old data structures associated with the inode.
-*/
-#ifdef QUOTA
-   for (i = 0; i  MAXQUOTAS; i++) {
-   if (ip-i_dquot[i] != NODQUOT) {
-   dqrele(vp, ip-i_dquot[i]);
-   ip-i_dquot[i] = NODQUOT;
-   }
-   }
-#endif
-#ifdef UFS_DIRHASH
-   if (ip-i_dirhash != NULL)
-   ufsdirhash_free(ip);
-#endif
+
/*
 * Lock the clearing of v_data so ffs_lock() can inspect it
 * prior to obtaining the lock.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221944 - head/sys/dev/ath/ath_hal/ar5416

2011-05-15 Thread Adrian Chadd
Author: adrian
Date: Sun May 15 07:59:33 2011
New Revision: 221944
URL: http://svn.freebsd.org/changeset/base/221944

Log:
  Fix NF calibration breakage introduced by me in a past commit.
  
  Since the returned NF will be -ve, checking for = 0 is not good
  enough. For now, check whether it equals 0 or -1; a future commit
  will tidy this mess up and have it return HAL_BOOL instead.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cSun May 15 06:42:32 
2011(r221943)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.cSun May 15 07:59:33 
2011(r221944)
@@ -501,7 +501,7 @@ ar5416PerCalibrationN(struct ath_hal *ah
 * and update the history buffer.
 */
r = ar5416GetNf(ah, chan);
-   if (r = 0) {
+   if (r == 0 || r == -1) {
/* NF calibration result isn't valid */
HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, %s: NF calibration
 didn't finish; delaying CCA\n, __func__);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221945 - head/sys/dev/iwn

2011-05-15 Thread Bernhard Schmidt
Author: bschmidt
Date: Sun May 15 08:09:36 2011
New Revision: 221945
URL: http://svn.freebsd.org/changeset/base/221945

Log:
  Only update the scheduler's byte count table for aggregation queues.
  The other queues, especially the command queue, uses the FIFO mode
  which doesn't require the byte count table because queued entries are
  processed in order.
  
  Pointed out by:   Lucius Windschuh lwindschuh at googlemail dot com

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==
--- head/sys/dev/iwn/if_iwn.c   Sun May 15 07:59:33 2011(r221944)
+++ head/sys/dev/iwn/if_iwn.c   Sun May 15 08:09:36 2011(r221945)
@@ -3527,7 +3527,8 @@ iwn_tx_data(struct iwn_softc *sc, struct
BUS_DMASYNC_PREWRITE);
 
/* Update TX scheduler. */
-   ops-update_sched(sc, ring-qid, ring-cur, tx-id, totlen);
+   if (ring-qid = sc-firstaggqueue)
+   ops-update_sched(sc, ring-qid, ring-cur, tx-id, totlen);
 
/* Kick TX ring. */
ring-cur = (ring-cur + 1) % IWN_TX_RING_COUNT;
@@ -3730,7 +3731,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st
BUS_DMASYNC_PREWRITE);
 
/* Update TX scheduler. */
-   ops-update_sched(sc, ring-qid, ring-cur, tx-id, totlen);
+   if (ring-qid = sc-firstaggqueue)
+   ops-update_sched(sc, ring-qid, ring-cur, tx-id, totlen);
 
/* Kick TX ring. */
ring-cur = (ring-cur + 1) % IWN_TX_RING_COUNT;
@@ -3894,7 +3896,6 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd,
 static int
 iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async)
 {
-   struct iwn_ops *ops = sc-ops;
struct iwn_tx_ring *ring = sc-txq[4];
struct iwn_tx_desc *desc;
struct iwn_tx_data *data;
@@ -3954,9 +3955,6 @@ iwn_cmd(struct iwn_softc *sc, int code, 
bus_dmamap_sync(ring-desc_dma.tag, ring-desc_dma.map,
BUS_DMASYNC_PREWRITE);
 
-   /* Update TX scheduler. */
-   ops-update_sched(sc, ring-qid, ring-cur, 0, 0);
-
/* Kick command ring. */
ring-cur = (ring-cur + 1) % IWN_TX_RING_COUNT;
IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring-qid  8 | ring-cur);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221946 - in stable/8/sys/cddl/dev/dtrace: amd64 i386

2011-05-15 Thread Andriy Gapon
Author: avg
Date: Sun May 15 08:15:26 2011
New Revision: 221946
URL: http://svn.freebsd.org/changeset/base/221946

Log:
  MFC r221740: dtrace: remove unused code

Modified:
  stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSun May 15 08:09:36 
2011(r221945)
+++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSun May 15 08:15:26 
2011(r221946)
@@ -359,26 +359,6 @@ static uint64_tnsec_scale;
 #define SCALE_SHIFT28
 
 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-   /*
-* Delay this function from returning on one
-* of the CPUs to check that the synchronisation
-* works.
-*/
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu) {
-   int i;
-   for (i = 0; i  10; i++)
-   tgt_cpu_tsc = rdtsc();
-   tgt_cpu_tsc = 0;
-   }
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
uintptr_t cpu = (uintptr_t) arg;
@@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg)
pc = pcpu_find(i);
map = PCPU_GET(cpumask) | pc-pc_cpumask;
 
-   smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+   smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
smp_no_rendevous_barrier, (void *)(uintptr_t) i);
 

Modified: stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:09:36 
2011(r221945)
+++ stable/8/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:15:26 
2011(r221946)
@@ -359,26 +359,6 @@ static uint64_tnsec_scale;
 #define SCALE_SHIFT28
 
 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-   /*
-* Delay this function from returning on one
-* of the CPUs to check that the synchronisation
-* works.
-*/
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu) {
-   int i;
-   for (i = 0; i  10; i++)
-   tgt_cpu_tsc = rdtsc();
-   tgt_cpu_tsc = 0;
-   }
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
uintptr_t cpu = (uintptr_t) arg;
@@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg)
pc = pcpu_find(i);
map = PCPU_GET(cpumask) | pc-pc_cpumask;
 
-   smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+   smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
smp_no_rendevous_barrier, (void *)(uintptr_t) i);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221947 - stable/8/sys/sys

2011-05-15 Thread Andriy Gapon
Author: avg
Date: Sun May 15 08:17:09 2011
New Revision: 221947
URL: http://svn.freebsd.org/changeset/base/221947

Log:
  MFC r221741: bitcount32: replace lengthy comment with a reference to SWAR

Modified:
  stable/8/sys/sys/systm.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/sys/systm.h
==
--- stable/8/sys/sys/systm.hSun May 15 08:15:26 2011(r221946)
+++ stable/8/sys/sys/systm.hSun May 15 08:17:09 2011(r221947)
@@ -365,44 +365,8 @@ int alloc_unrl(struct unrhdr *uh);
 void free_unr(struct unrhdr *uh, u_int item);
 
 /*
- * This is about as magic as it gets.  fortune(1) has got similar code
- * for reversing bits in a word.  Who thinks up this stuff??
- *
- * Yes, it does appear to be consistently faster than:
- * while (i = ffs(m)) {
- * m = i;
- * bits++;
- * }
- * and
- * while (lsb = (m  -m)) {// This is magic too
- * m = ~lsb;  // or: m ^= lsb
- * bits++;
- * }
- * Both of these latter forms do some very strange things on gcc-3.1 with
- * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2.
- * There is probably an SSE or MMX popcnt instruction.
- *
- * I wonder if this should be in libkern?
- *
- * XXX Stop the presses!  Another one:
- * static __inline u_int32_t
- * popcnt1(u_int32_t v)
- * {
- * v -= ((v  1)  0x);
- * v = (v  0x) + ((v  2)  0x);
- * v = (v + (v  4))  0x0F0F0F0F;
- * return (v * 0x01010101)  24;
- * }
- * The downside is that it has a multiply.  With a pentium3 with
- * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use
- * an imull, and in that case it is faster.  In most other cases
- * it appears slightly slower.
- *
- * Another variant (also from fortune):
- * #define BITCOUNT(x) (((BX_(x)+(BX_(x)4))  0x0F0F0F0F) % 255)
- * #define  BX_(x) ((x) - (((x)1)0x)\
- *  - (((x)2)0x)\
- *  - (((x)3)0x))
+ * Population count algorithm using SWAR approach
+ * - SIMD Within A Register.
  */
 static __inline uint32_t
 bitcount32(uint32_t x)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221948 - in stable/7/sys/cddl/dev/dtrace: amd64 i386

2011-05-15 Thread Andriy Gapon
Author: avg
Date: Sun May 15 08:24:26 2011
New Revision: 221948
URL: http://svn.freebsd.org/changeset/base/221948

Log:
  MFC r221740: dtrace: remove unused code

Modified:
  stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==
--- stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSun May 15 08:17:09 
2011(r221947)
+++ stable/7/sys/cddl/dev/dtrace/amd64/dtrace_subr.cSun May 15 08:24:26 
2011(r221948)
@@ -359,26 +359,6 @@ static uint64_tnsec_scale;
 #define SCALE_SHIFT28
 
 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-   /*
-* Delay this function from returning on one
-* of the CPUs to check that the synchronisation
-* works.
-*/
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu) {
-   int i;
-   for (i = 0; i  10; i++)
-   tgt_cpu_tsc = rdtsc();
-   tgt_cpu_tsc = 0;
-   }
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
uintptr_t cpu = (uintptr_t) arg;
@@ -437,7 +417,7 @@ dtrace_gethrtime_init(void *arg)
map |= (1  curcpu);
map |= (1  i);
 
-   smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+   smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
smp_no_rendevous_barrier, (void *)(uintptr_t) i);
 

Modified: stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==
--- stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:17:09 
2011(r221947)
+++ stable/7/sys/cddl/dev/dtrace/i386/dtrace_subr.c Sun May 15 08:24:26 
2011(r221948)
@@ -359,26 +359,6 @@ static uint64_tnsec_scale;
 #define SCALE_SHIFT28
 
 static void
-dtrace_gethrtime_init_sync(void *arg)
-{
-#ifdef CHECK_SYNC
-   /*
-* Delay this function from returning on one
-* of the CPUs to check that the synchronisation
-* works.
-*/
-   uintptr_t cpu = (uintptr_t) arg;
-
-   if (cpu == curcpu) {
-   int i;
-   for (i = 0; i  10; i++)
-   tgt_cpu_tsc = rdtsc();
-   tgt_cpu_tsc = 0;
-   }
-#endif
-}
-
-static void
 dtrace_gethrtime_init_cpu(void *arg)
 {
uintptr_t cpu = (uintptr_t) arg;
@@ -437,7 +417,7 @@ dtrace_gethrtime_init(void *arg)
map |= (1  curcpu);
map |= (1  i);
 
-   smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync,
+   smp_rendezvous_cpus(map, NULL,
dtrace_gethrtime_init_cpu,
smp_no_rendevous_barrier, (void *)(uintptr_t) i);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221949 - stable/7/sys/sys

2011-05-15 Thread Andriy Gapon
Author: avg
Date: Sun May 15 08:27:32 2011
New Revision: 221949
URL: http://svn.freebsd.org/changeset/base/221949

Log:
  MFC r221741: bitcount32: replace lengthy comment with a reference to SWAR

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

Modified: stable/7/sys/sys/systm.h
==
--- stable/7/sys/sys/systm.hSun May 15 08:24:26 2011(r221948)
+++ stable/7/sys/sys/systm.hSun May 15 08:27:32 2011(r221949)
@@ -369,44 +369,8 @@ int alloc_unrl(struct unrhdr *uh);
 void free_unr(struct unrhdr *uh, u_int item);
 
 /*
- * This is about as magic as it gets.  fortune(1) has got similar code
- * for reversing bits in a word.  Who thinks up this stuff??
- *
- * Yes, it does appear to be consistently faster than:
- * while (i = ffs(m)) {
- * m = i;
- * bits++;
- * }
- * and
- * while (lsb = (m  -m)) {// This is magic too
- * m = ~lsb;  // or: m ^= lsb
- * bits++;
- * }
- * Both of these latter forms do some very strange things on gcc-3.1 with
- * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2.
- * There is probably an SSE or MMX popcnt instruction.
- *
- * I wonder if this should be in libkern?
- *
- * XXX Stop the presses!  Another one:
- * static __inline u_int32_t
- * popcnt1(u_int32_t v)
- * {
- * v -= ((v  1)  0x);
- * v = (v  0x) + ((v  2)  0x);
- * v = (v + (v  4))  0x0F0F0F0F;
- * return (v * 0x01010101)  24;
- * }
- * The downside is that it has a multiply.  With a pentium3 with
- * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use
- * an imull, and in that case it is faster.  In most other cases
- * it appears slightly slower.
- *
- * Another variant (also from fortune):
- * #define BITCOUNT(x) (((BX_(x)+(BX_(x)4))  0x0F0F0F0F) % 255)
- * #define  BX_(x) ((x) - (((x)1)0x)\
- *  - (((x)2)0x)\
- *  - (((x)3)0x))
+ * Population count algorithm using SWAR approach
+ * - SIMD Within A Register.
  */
 static __inline uint32_t
 bitcount32(uint32_t x)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86

2011-05-15 Thread Andriy Gapon
on 13/05/2011 19:57 Jung-uk Kim said the following:
 You guys keep saying some code derived from OpenSolaris exists to 
 sync. TSCs.  Can you let me see it, pretty please?  I don't know what 
 else to say. :-(

http://people.freebsd.org/~avg/tsc/
I think I've posted this before.

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


Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86

2011-05-15 Thread Andriy Gapon
on 13/05/2011 22:14 Bruce Evans said the following:
 It might happen for clock_gettime()
 in separate threads where the threads somehow know and depend on the
 order of the calls.

My simplistic world view is that those threads then should be the place to do
all the fence dances, not the generic tsc read function.  But, hey, I am
speaking beyond my knowledge of their code and situation.

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


Re: svn commit: r221850 - head/tools/tools/nanobsd

2011-05-15 Thread Henrik Brix Andersen
On May 13, 2011, at 20:28, Warner Losh wrote:
 Author: imp
 Date: Fri May 13 18:28:25 2011
 New Revision: 221850
 URL: http://svn.freebsd.org/changeset/base/221850
 
 Log:
  Copy symbolic links as files rather than recreating the links.
 
  PR:  misc/151697
  Submitted by:lev@
  MFC after:   2 weeks
 
 Modified:
  head/tools/tools/nanobsd/nanobsd.sh
 
 Modified: head/tools/tools/nanobsd/nanobsd.sh
 ==
 --- head/tools/tools/nanobsd/nanobsd.sh   Fri May 13 18:20:24 2011
 (r221849)
 +++ head/tools/tools/nanobsd/nanobsd.sh   Fri May 13 18:28:25 2011
 (r221850)
 @@ -418,7 +418,7 @@ populate_slice ( ) (
   echo Creating ${dev} with ${dir} (mounting on ${mnt})
   newfs_part $dev $mnt $lbl
   cd ${dir}
 - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
 + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${mnt}
   df -i ${mnt}
   umount ${mnt}
 )
 @@ -674,7 +674,7 @@ cust_allow_ssh_root () (

The above change breaks nanobsd.sh for me.

CPIO will now try to follow all symbolic links in _.w/ - e.g. _.w/sys, which 
points to a non-existing _.w/usr/src/sys - and fail with cpio: Can't stat 
./sys.

 cust_install_files () (
   cd ${NANO_TOOLS}/Files
 - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR}
 + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${NANO_WORLDDIR}
 )
 
 ###
 @@ -687,7 +687,7 @@ cust_pkg () (
   (
   cd ${NANO_PACKAGE_DIR}
   find ${NANO_PACKAGE_LIST} -print |
 - cpio -dumpv ${NANO_WORLDDIR}/Pkg
 + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg
   )
 
   # Count  report how many we have to install

-- 
Henrik Brix Andersen b...@freebsd.org





PGP.sig
Description: This is a digitally signed message part


Re: svn commit: r221913 - head/sys/dev/mii

2011-05-15 Thread Marius Strobl
On Sun, May 15, 2011 at 02:35:37PM +1000, Bruce Evans wrote:
 On Sat, 14 May 2011, Marius Strobl wrote:
 
 Log:
  - There's no need for nibbletab to be static, it's const however.
  - Fix whitespace.
 
 There is every reason for it to be static.
 
 Modified: head/sys/dev/mii/mii.c
 ==
 --- head/sys/dev/mii/mii.c   Sat May 14 19:36:12 2011(r221912)
 +++ head/sys/dev/mii/mii.c   Sat May 14 20:31:04 2011(r221913)
 @@ -552,7 +552,7 @@ mii_down(struct mii_data *mii)
 static unsigned char
 mii_bitreverse(unsigned char x)
 {
 -static unsigned char nibbletab[16] = {
 +unsigned const char const nibbletab[16] = {
  0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
  };
 
 Making it non-static asks the compiler to pessimize it by initializing
 it on every entry to the function.  Some versions of gcc do a very good

This function is mostly used during device probing (and the result of
the caller cached afterwards) and not in the hot path, thus there's no
need to tell the compiler that it _must_ keep a static copy of the array.

 job with this pessimization.  The normal pessimzation is to keep a
 static copy of the array anyway, and copy this to the stack on every
 entry to the function.  However, the pessimization seems to be broken
 by gcc-4.3.1 in -current.  gcc-3.3.3 on i386 gives:
 
 %%%
 $ cat z.c
 int
 foo(void)
 {
   const unsigned char foo[16] = { 1, 2, 3, 4, };
 
   test(foo[0], foo[1]);
 }
 $ gcc-3.3.3 -O2 -S z.c
 $ cat z.S
   .file   z.c
   .text
   .p2align 2,,3
 .globl foo
   .type   foo, @function
 foo:
   pushl   %ebp
   movl%esp, %ebp
   pushl   %edi
   subl$28, %esp
   leal-24(%ebp), %edi
   cld
   xorl%eax, %eax
   movl$4, %ecx
   rep
   stosl
   pushl   $2
   pushl   $1
   movb$1, -24(%ebp)
   movb$2, -23(%ebp)
   movb$3, -22(%ebp)
   movb$4, -21(%ebp)
   calltest
   movl-4(%ebp), %edi
   leave
   ret
   .size   foo, .-foo
   .ident  GCC: (GNU) 3.3.3 [FreeBSD] 20031106
 %%%
 
 For this small array, gcc does an even better pessimization for space
 than copying from a static copy.  It constructs the array entirely on
 the stack.  First it bzeros 16 bytes on the stack using an inefficient
 string instruction (so that the unused top 12 bytes of the array are
 initialized).  Then uses individual stores to initialize the low 4
 bytes of the array.  Now it knows that individual stores are faster
 than string instructions for small data.  The low 4 bytes are unused
 too.  The top 2 of these bytes are entirely unused, and the low 2 bytes
 are optimized to constants at compile time.
 
 Declaring the array as static breaks the pessimization for gcc-3.3.3
 fairly well.  The code is then pushl $2; pushl $1; call test.  The
 breakage is not quite complete -- data for the unused static array is
 still generated.
 
 Using gcc-4.2.1 breaks the pessimization completely.  The code is then
 pushl $2; pushl $1; call test, and data for the unused array is not
 generated, irrespective of whether the array is declared static or const.
 
 Using -O instead of -O2 makes little difference.  Using -O0 fixes the
 pessimization for gcc-4.2.1 and gives the minor additional pessimization
 of loading the function parameters from the array.
 
 Changing the array size from 16 to 1024 gives the normal pessimization
 for gcc-3.3.3 of memcpy()'ing the array from a static copy.  The code is
 then much more readable than the above, since it is not fully pessimized
 for space.
 
 This pessimization is not common in the kernel.  KR compilers have
 the feature that initialization of auto arrays is a syntax error.  Thus
 old code doesn't even have nighmares about this pessimization.
 
 I noticed this pessimization mainly in the old ata driver.  That has
 lots of smallish arrays of data, and sqillions of function calls hidden
 in access macros.  Stepping through the generated code using ddb was
 very painful since what should be single memory accesses or constant
 loads was a function call or three for the memcpy()'s and access
 functions.
 

I agree that such code shoudn't be used in the hot path.

Marius

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


svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Andrey V. Elsukov
Author: ae
Date: Sun May 15 11:45:13 2011
New Revision: 221952
URL: http://svn.freebsd.org/changeset/base/221952

Log:
  Simplify the code a bit. For own providers GEOM_PART always provides
  start and end config attributes.
  
  MFC after:1 week

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==
--- head/sbin/geom/class/part/geom_part.c   Sun May 15 10:01:38 2011
(r221951)
+++ head/sbin/geom/class/part/geom_part.c   Sun May 15 11:45:13 2011
(r221952)
@@ -253,13 +253,7 @@ find_provider(struct ggeom *gp, off_t mi
bestsector = 0;
LIST_FOREACH(pp, gp-lg_provider, lg_provider) {
s = find_provcfg(pp, start);
-   if (s == NULL) {
-   s = find_provcfg(pp, offset);
-   sector =
-   (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   sector = (off_t)strtoimax(s, NULL, 0);
-
+   sector = (off_t)strtoimax(s, NULL, 0);
if (sector  minsector)
continue;
if (bestpp != NULL  sector = bestsector)
@@ -379,18 +373,9 @@ gpart_autofill_resize(struct gctl_req *r
errx(EXIT_FAILURE, invalid partition index);
 
s = find_provcfg(pp, start);
-   if (s == NULL) {
-   s = find_provcfg(pp, offset);
-   start = (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   start = (off_t)strtoimax(s, NULL, 0);
+   start = (off_t)strtoimax(s, NULL, 0);
s = find_provcfg(pp, end);
-   if (s == NULL) {
-   s = find_provcfg(pp, length);
-   lba = start +
-   (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   lba = (off_t)strtoimax(s, NULL, 0) + 1;
+   lba = (off_t)strtoimax(s, NULL, 0) + 1;
 
if (lba  last) {
geom_deletetree(mesh);
@@ -402,12 +387,7 @@ gpart_autofill_resize(struct gctl_req *r
new_size = ALIGNDOWN(last - start + 1, alignment);
else {
s = find_provcfg(pp, start);
-   if (s == NULL) {
-   s = find_provcfg(pp, offset);
-   new_lba =
-   (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   new_lba = (off_t)strtoimax(s, NULL, 0);
+   new_lba = (off_t)strtoimax(s, NULL, 0);
/*
 * Is there any free space between current and
 * next providers?
@@ -512,12 +492,7 @@ gpart_autofill(struct gctl_req *req)
last = ALIGNDOWN(last, alignment);
while ((pp = find_provider(gp, first)) != NULL) {
s = find_provcfg(pp, start);
-   if (s == NULL) {
-   s = find_provcfg(pp, offset);
-   lba = (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   lba = (off_t)strtoimax(s, NULL, 0);
-
+   lba = (off_t)strtoimax(s, NULL, 0);
a_lba = ALIGNDOWN(lba, alignment);
if (first  a_lba  a_first  a_lba) {
/* Free space [first, lba */
@@ -543,12 +518,7 @@ gpart_autofill(struct gctl_req *req)
}
 
s = find_provcfg(pp, end);
-   if (s == NULL) {
-   s = find_provcfg(pp, length);
-   first = lba +
-   (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
-   } else
-   first = (off_t)strtoimax(s, NULL, 0) + 1;
+   first = (off_t)strtoimax(s, NULL, 0) + 1;
a_first = ALIGNUP(first, alignment);
}
if (a_first = last) {
@@ -625,21 +595,12 @@ gpart_show_geom(struct ggeom *gp, const 
 
while ((pp = find_provider(gp, first)) != NULL) {
s = find_provcfg(pp, start);
-   if (s == NULL) {
-   s = find_provcfg(pp, offset);
-   sector = (off_t)strtoimax(s, NULL, 0) / secsz;
-   } else
-   sector = (off_t)strtoimax(s, NULL, 0);
+   sector = (off_t)strtoimax(s, NULL, 0);
 
s = find_provcfg(pp, end);
-   if (s == NULL) {
-   s = find_provcfg(pp, length);
-   length = (off_t)strtoimax(s, NULL, 0) / secsz;
-   end = sector + length - 1;
-   } else {
-   end = (off_t)strtoimax(s, NULL, 0);
-   length = end - sector + 1;
-   }
+   end = (off_t)strtoimax(s, NULL, 0);
+   length = end - sector + 1;
+
s = find_provcfg(pp, index);
idx = 

svn commit: r221953 - head/sys/geom/eli

2011-05-15 Thread Mikolaj Golub
Author: trociny
Date: Sun May 15 12:39:30 2011
New Revision: 221953
URL: http://svn.freebsd.org/changeset/base/221953

Log:
  Fix a memory leak possible in g_eli_key_allocate() if the key with the
  same keyno is added while we aren't holding the lock.
  
  Approved by:  pjd (mentor)
  MFC after:1 week

Modified:
  head/sys/geom/eli/g_eli_key_cache.c

Modified: head/sys/geom/eli/g_eli_key_cache.c
==
--- head/sys/geom/eli/g_eli_key_cache.c Sun May 15 11:45:13 2011
(r221952)
+++ head/sys/geom/eli/g_eli_key_cache.c Sun May 15 12:39:30 2011
(r221953)
@@ -124,6 +124,7 @@ g_eli_key_allocate(struct g_eli_softc *s
ekey = RB_FIND(g_eli_key_tree, sc-sc_ekeys_tree, keysearch);
if (ekey != NULL) {
bzero(key, sizeof(*key));
+   free(key, M_ELI);
key = ekey;
TAILQ_REMOVE(sc-sc_ekeys_queue, key, gek_next);
} else {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221954 - head/sbin/ifconfig

2011-05-15 Thread Marius Strobl
Author: marius
Date: Sun May 15 12:51:00 2011
New Revision: 221954
URL: http://svn.freebsd.org/changeset/base/221954

Log:
  When setting media always and not just in case of switching to IFM_AUTO
  clear the options of the current media, i.e. only inherit the instance,
  which matches what NetBSD does. Without this it's really non-intuitive
  that the following sequence:
ifconfig bge0 media 1000baseT mediaopt full-duplex
ifconfig bge0 media 100baseTX
  results in 100baseTX full-duplex to be set or that:
ifconfig bge0 media autoselect mediaopt flowcontrol
ifconfig bge0 media 1000baseT mediaopt full-duplex
  tries to set 1000baseT full-duplex with flowcontrol, which isn't suported
  und thus fails while the following:
ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex
ifconfig re0 media autoselect
  just switches to autoselection without flowcontrol.
  
  MFC after:2 weeks

Modified:
  head/sbin/ifconfig/ifmedia.c

Modified: head/sbin/ifconfig/ifmedia.c
==
--- head/sbin/ifconfig/ifmedia.cSun May 15 12:39:30 2011
(r221953)
+++ head/sbin/ifconfig/ifmedia.cSun May 15 12:51:00 2011
(r221954)
@@ -268,13 +268,9 @@ setmedia(const char *val, int d, int s, 
subtype = get_media_subtype(IFM_TYPE(ifmr-ifm_ulist[0]), val);
 
strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
-   ifr.ifr_media = (ifmr-ifm_current  ~(IFM_NMASK|IFM_TMASK)) |
+   ifr.ifr_media = (ifmr-ifm_current  IFM_IMASK) |
IFM_TYPE(ifmr-ifm_ulist[0]) | subtype;
 
-   if ((ifr.ifr_media  IFM_TMASK) == 0) {
-   ifr.ifr_media = ~(IFM_GMASK | IFM_OMASK);
-   }
-
ifmr-ifm_current = ifr.ifr_media;
callback_register(setifmediacallback, (void *)ifmr);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221955 - head/sys/net

2011-05-15 Thread Marius Strobl
Author: marius
Date: Sun May 15 12:58:29 2011
New Revision: 221955
URL: http://svn.freebsd.org/changeset/base/221955

Log:
  - Add 10baseT as an alias for 10baseT/UTP.
  - Add shorthand aliases for common media+option combinations as announced
by miibus(4) so that one can actually supply the media strings found in
the dmesg output to ifconfig(8).
  
  Obtained from:NetBSD (in principle)
  MFC after:2 weeks

Modified:
  head/sys/net/if_media.h

Modified: head/sys/net/if_media.h
==
--- head/sys/net/if_media.h Sun May 15 12:51:00 2011(r221954)
+++ head/sys/net/if_media.h Sun May 15 12:58:29 2011(r221955)
@@ -370,6 +370,7 @@ struct ifmedia_description {
 }
 
 #defineIFM_SUBTYPE_ETHERNET_ALIASES {  
\
+   { IFM_10_T, 10baseT },\
{ IFM_10_T, UTP },\
{ IFM_10_T, 10UTP },  \
{ IFM_10_2, BNC },\
@@ -389,6 +390,23 @@ struct ifmedia_description {
{ IFM_1000_T,   1000TX }, \
{ IFM_1000_T,   1000T },  \
{ IFM_2500_SX,  2500SX }, \
+   \
+   /*  \
+* Shorthands for common media+option combinations as announced \
+* by miibus(4) \
+*/ \
+   { IFM_10_T | IFM_FDX,   10baseT-FDX },\
+   { IFM_10_T | IFM_FDX | IFM_FLOW,10baseT-FDX-flow },   \
+   { IFM_100_TX | IFM_FDX, 100baseTX-FDX },  \
+   { IFM_100_TX | IFM_FDX | IFM_FLOW,  100baseTX-FDX-flow }, \
+   { IFM_1000_T | IFM_FDX, 1000baseT-FDX },  \
+   { IFM_1000_T | IFM_FDX | IFM_FLOW,  1000baseT-FDX-flow }, \
+   { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \
+   1000baseT-FDX-flow-master },  \
+   { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER,\
+   1000baseT-FDX-master },   \
+   { IFM_1000_T | IFM_ETH_MASTER,  1000baseT-master },   \
+   \
{ 0, NULL },\
 }
 
@@ -584,6 +602,13 @@ struct ifmedia_description {
 
 #defineIFM_SUBTYPE_SHARED_ALIASES {
\
{ IFM_AUTO, auto },   \
+   \
+   /*  \
+* Shorthands for common media+option combinations as announced \
+* by miibus(4) \
+*/ \
+   { IFM_AUTO | IFM_FLOW,  auto-flow },  \
+   \
{ 0, NULL },\
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221957 - head/sys/dev/mk48txx

2011-05-15 Thread Marius Strobl
Author: marius
Date: Sun May 15 13:17:08 2011
New Revision: 221957
URL: http://svn.freebsd.org/changeset/base/221957

Log:
  Add support for MK48T37.

Modified:
  head/sys/dev/mk48txx/mk48txx.c
  head/sys/dev/mk48txx/mk48txxreg.h

Modified: head/sys/dev/mk48txx/mk48txx.c
==
--- head/sys/dev/mk48txx/mk48txx.c  Sun May 15 13:07:34 2011
(r221956)
+++ head/sys/dev/mk48txx/mk48txx.c  Sun May 15 13:17:08 2011
(r221957)
@@ -33,7 +33,8 @@
 __FBSDID($FreeBSD$);
 
 /*
- * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines
+ * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip
+ * subroutines
  */
 
 #include sys/param.h
@@ -67,6 +68,7 @@ static const struct {
{ mk48t02, MK48T02_CLKSZ, MK48T02_CLKOFF, 0 },
{ mk48t08, MK48T08_CLKSZ, MK48T08_CLKOFF, 0 },
{ mk48t18, MK48T18_CLKSZ, MK48T18_CLKOFF, 0 },
+   { mk48t37, MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS },
{ mk48t59, MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS },
 };
 

Modified: head/sys/dev/mk48txx/mk48txxreg.h
==
--- head/sys/dev/mk48txx/mk48txxreg.h   Sun May 15 13:07:34 2011
(r221956)
+++ head/sys/dev/mk48txx/mk48txxreg.h   Sun May 15 13:17:08 2011
(r221957)
@@ -152,5 +152,8 @@
 #defineMK48T18_CLKSZ   8192
 #defineMK48T18_CLKOFF  0x1ff0
 
+#defineMK48T37_CLKSZ   32768
+#defineMK48T37_CLKOFF  0x1ff0
+
 #defineMK48T59_CLKSZ   8192
 #defineMK48T59_CLKOFF  0x1ff0
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221958 - head/sys/sparc64/sparc64

2011-05-15 Thread Marius Strobl
Author: marius
Date: Sun May 15 13:25:26 2011
New Revision: 221958
URL: http://svn.freebsd.org/changeset/base/221958

Log:
  Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900.

Modified:
  head/sys/sparc64/sparc64/eeprom.c

Modified: head/sys/sparc64/sparc64/eeprom.c
==
--- head/sys/sparc64/sparc64/eeprom.c   Sun May 15 13:17:08 2011
(r221957)
+++ head/sys/sparc64/sparc64/eeprom.c   Sun May 15 13:25:26 2011
(r221958)
@@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive
 static int
 eeprom_probe(device_t dev)
 {
+   const char *name;
 
-   if (strcmp(eeprom, ofw_bus_get_name(dev)) == 0) {
+   name = ofw_bus_get_name(dev);
+   if (strcmp(name, eeprom) == 0 ||
+   strcmp(name, FJSV,eeprom) == 0) {
device_set_desc(dev, EEPROM/clock);
return (0);
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221960 - in head/sys/dev: scc uart

2011-05-15 Thread Marius Strobl
Author: marius
Date: Sun May 15 13:27:38 2011
New Revision: 221960
URL: http://svn.freebsd.org/changeset/base/221960

Log:
  Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900.

Modified:
  head/sys/dev/scc/scc_bfe_ebus.c
  head/sys/dev/uart/uart_cpu_sparc64.c

Modified: head/sys/dev/scc/scc_bfe_ebus.c
==
--- head/sys/dev/scc/scc_bfe_ebus.c Sun May 15 13:27:28 2011
(r221959)
+++ head/sys/dev/scc/scc_bfe_ebus.c Sun May 15 13:27:38 2011
(r221960)
@@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev)
cmpt = ofw_bus_get_compat(dev);
if (cmpt == NULL)
cmpt = ;
-   if (!strcmp(nm, se) || !strcmp(cmpt, sab82532)) {
+   if (!strcmp(nm, se) || !strcmp(nm, FJSV,se) ||
+   !strcmp(cmpt, sab82532)) {
device_set_desc(dev, Siemens SAB 82532 dual channel SCC);
sc-sc_class = scc_sab82532_class;
return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0));

Modified: head/sys/dev/uart/uart_cpu_sparc64.c
==
--- head/sys/dev/uart/uart_cpu_sparc64.cSun May 15 13:27:28 2011
(r221959)
+++ head/sys/dev/uart/uart_cpu_sparc64.cSun May 15 13:27:38 2011
(r221960)
@@ -238,7 +238,8 @@ uart_cpu_getdev(int devtype, struct uart
di-bas.regshft = 0;
di-bas.rclk = 0;
class = NULL;
-   if (!strcmp(buf, se) || !strcmp(compat, sab82532)) {
+   if (!strcmp(buf, se) || !strcmp(buf, FJSV,se) ||
+   !strcmp(compat, sab82532)) {
class = uart_sab82532_class;
/* SAB82532 are only known to be used for TTYs. */
if ((di-bas.chan = uart_cpu_channel(dev)) == 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221961 - in head: share/man/man4/man4.i386 sys/conf sys/dev/glxiic sys/i386/conf sys/modules sys/modules/glxiic

2011-05-15 Thread Henrik Brix Andersen
Author: brix (ports committer)
Date: Sun May 15 14:01:23 2011
New Revision: 221961
URL: http://svn.freebsd.org/changeset/base/221961

Log:
  Add I2C bus driver for the AMD Geode LX series CS5536 Companion
  Device.
  
  Reviewed by:jhb (newbus bits only), adrian

Added:
  head/share/man/man4/man4.i386/glxiic.4   (contents, props changed)
  head/sys/dev/glxiic/
  head/sys/dev/glxiic/glxiic.c   (contents, props changed)
  head/sys/modules/glxiic/
  head/sys/modules/glxiic/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/man4.i386/Makefile
  head/sys/conf/files.i386
  head/sys/i386/conf/NOTES
  head/sys/modules/Makefile

Modified: head/share/man/man4/man4.i386/Makefile
==
--- head/share/man/man4/man4.i386/Makefile  Sun May 15 13:27:38 2011
(r221960)
+++ head/share/man/man4/man4.i386/Makefile  Sun May 15 14:01:23 2011
(r221961)
@@ -12,6 +12,7 @@ MAN=  aic.4 \
ep.4 \
ex.4 \
fe.4 \
+   glxiic.4 \
glxsb.4 \
ie.4 \
longrun.4 \

Added: head/share/man/man4/man4.i386/glxiic.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/man4.i386/glxiic.4  Sun May 15 14:01:23 2011
(r221961)
@@ -0,0 +1,106 @@
+.\ Copyright (c) 2011 Henrik Brix Andersen b...@freebsd.org
+.\ 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 ``AS IS'' AND ANY EXPRESS OR
+.\ IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\ NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\
+.\ $FreeBSD$
+.\
+.Dd May 15, 2011
+.Dt GLXIIC 4 i386
+.Os
+.Sh NAME
+.Nm glxiic
+.Nd Geode LX CS5536 I2C controller driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd device pci
+.Cd device isa
+.Cd device glxiic
+.Cd device iicbus
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+glxiic_load=YES
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver supports the System Management Bus controller of the Geode LX
+series CS5536 Companion Device.  The Geode LX is a member of the AMD
+Geode family of integrated x86 system chips.
+.Pp
+Although AMD refers to this device as a System Management Bus (SMBus)
+controller, it is really an I2C controller (it lacks SMBus ALERT# and
+Alert Response support).
+.Pp
+The
+.Nm
+driver supports both I2C master and slave mode.
+.Sh SYSCTL VARIABLE
+The
+.Nm
+driver supports the following variable as both
+.Xr sysctl 8
+and
+.Xr loader 8
+tunable:
+.Bl -tag -width indent
+.It Va dev.glxiic.0.timeout
+This variable controls the I2C bus timeout in milliseconds.  The
+default timeout is 35 milliseconds.  A value of zero disables the
+timeout.
+.El
+.Sh CAVEAT
+The
+.Nm
+driver uses the interrupt line number configured by the board firmware
+by default.  If no interrupt line number has been configured by the
+board firmware (or to override the interrupt line number configured by
+board firmware), place the following line in
+.Xr device.hints 5 :
+.Bd -ragged -offset indent
+hint.glxiic.0.irq=10
+.Ed
+.Pp
+The interrupt line number must be between 1 and 15.
+.Sh SEE ALSO
+.Xr iicbus 4 ,
+.Xr device.hints 5 ,
+.Xr loader.conf 5 ,
+.Xr loader 8 ,
+.Xr sysctl 8
+.Sh HISTORY
+The
+.Nm
+device driver and manual page first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+device driver and manual page were written by
+.An Henrik Brix Andersen Aq b...@freebsd.org .

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Sun May 15 13:27:38 2011(r221960)
+++ 

Re: svn commit: r221913 - head/sys/dev/mii

2011-05-15 Thread Bruce Evans

On Sun, 15 May 2011, Marius Strobl wrote:


On Sun, May 15, 2011 at 02:35:37PM +1000, Bruce Evans wrote:

On Sat, 14 May 2011, Marius Strobl wrote:


Log:
- There's no need for nibbletab to be static, it's const however.
- Fix whitespace.


There is every reason for it to be static.


Modified: head/sys/dev/mii/mii.c
==
--- head/sys/dev/mii/mii.c  Sat May 14 19:36:12 2011(r221912)
+++ head/sys/dev/mii/mii.c  Sat May 14 20:31:04 2011(r221913)
@@ -552,7 +552,7 @@ mii_down(struct mii_data *mii)
static unsigned char
mii_bitreverse(unsigned char x)
{
-   static unsigned char nibbletab[16] = {
+   unsigned const char const nibbletab[16] = {
0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15
};


Making it non-static asks the compiler to pessimize it by initializing
it on every entry to the function.  Some versions of gcc do a very good


This function is mostly used during device probing (and the result of
the caller cached afterwards) and not in the hot path, thus there's no
need to tell the compiler that it _must_ keep a static copy of the array.


Actually, in a more realistic example, and in this function, it is impossible
for the compiler to avoid static storage.  The result probably depends on
the arg, in a form like table[arg]  Better example below.

Another good pessimization in the above is passing the arg as an unsigned
char.  The caller may have to demote to this type, and the function will
probably have to promote it to use it as an index.  Similarly for returning
a type shorter than int.  These pessimizations are also shown in the
example below.


...
I agree that such code shoudn't be used in the hot path.


I agree that this doesn't matter much for efficiency.

Auto initializers are also worse for debugging (without full debugging info
or debuggers that understand it).

Better example:

%%%
$ cat z.c
unsigned char data;
int result;

unsigned char
foo(unsigned char n)
{
const unsigned char foo[16] = { 1, 2, 3, 4, };

return (foo[n]);
}

void
use(void)
{
result += foo(data);
}
$ gcc42 -O2 -S z.c
$ cat z.s [edited]
%   .file   z.c
%   .text
%   .p2align 4,,15
% .globl foo
%   .type   foo, @function
% foo:
%   pushl   %ebp
%   movl%esp, %ebp
%   movzbl  8(%ebp), %eax

Extra work to promote the arg.  movzbl instead of movl normally only costs
space on modern x86.

%   popl%ebp
%   movzbl  foo.1543(%eax), %eax

The table needs to be of unsigned char's to optimize for space.  Although
we only return an unsigned char byte, the ABI may bogusly require this movzbl.

%   ret
%   .size   foo, .-foo
%   .p2align 4,,15
% .globl use
%   .type   use, @function
% use:
%   pushl   %ebp
%   movl%esp, %ebp
%   subl$4, %esp
%   movzbl  data, %eax
%   movl%eax, (%esp)

Extra work to promote the arg.  Although we start with an unsigned char
and the function takes an unsigned char, the ABI may bogusly require this
movzbl.  Avoiding partial register stalls and memory store-to-load mismatches
may also require this movzbl.  But I think only making the ABI portable to
KR code requires this.  Storing garbage from the top bits of %eax after
movb to %al might cause a stall, but storing only %al wouldn't, and the
garbage in memory wouldn't cause any problems, since the pessimizations in
the caller result in only the low bits in memory being loaded.

%   callfoo
%   movzbl  %al, %eax

Extra work to promote the result of foo().  Although the caller has already
promoted it, the ABI might not allow depending on this.

%   addl%eax, result
%   leave
%   ret
%   .size   use, .-use
%   .section.rodata
%   .type   foo.1543, @object
%   .size   foo.1543, 16
% foo.1543:
%   .byte   1
%   .byte   2
%   .byte   3
%   .byte   4
%   .zero   12

The compiler can't avoid static allocation for this area.

The worseness of auto initializers for debugging is also shown here.
Instead of a static array named foo, there is a static array with
mangled name foo.1543.  This mangled name is not too hard to guess
or type in a primitive debugger like ddb (except in old versions of
ddb that didn't support dots in identifiers), but others might be
harder.

%   .comm   data,1,1
%   .comm   result,4,4
%   .ident  GCC: (GNU) 4.2.1 20070719  [FreeBSD]
%

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


Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Marcel Moolenaar

On May 15, 2011, at 7:45 AM, Andrey V. Elsukov wrote:

 Author: ae
 Date: Sun May 15 11:45:13 2011
 New Revision: 221952
 URL: http://svn.freebsd.org/changeset/base/221952
 
 Log:
  Simplify the code a bit. For own providers GEOM_PART always provides
  start and end config attributes.
 
  MFC after:   1 week

Just to make sure: the code deals with backward compatibility.
If you're aware of the issue, but don't care (anymore) about it,
then the change is fine (as I can't quite remember the case in
point, and I don't care enough to speculatively page in the
details).

If you weren't aware, we should probably determine the impact
before you MFC this. Let me know and I'll dig up the details.

FYI,

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


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


Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Alexey Dokuchaev
On Sun, May 15, 2011 at 11:09:10AM -0400, Marcel Moolenaar wrote:
 On May 15, 2011, at 7:45 AM, Andrey V. Elsukov wrote:
  Author: ae
  Date: Sun May 15 11:45:13 2011
  New Revision: 221952
  URL: http://svn.freebsd.org/changeset/base/221952
  
  Log:
   Simplify the code a bit. For own providers GEOM_PART always provides
   start and end config attributes.
  
   MFC after: 1 week
 
 Just to make sure: the code deals with backward compatibility.
 If you're aware of the issue, but don't care (anymore) about it,
 then the change is fine (as I can't quite remember the case in
 point, and I don't care enough to speculatively page in the
 details).
 
 If you weren't aware, we should probably determine the impact
 before you MFC this. Let me know and I'll dig up the details.

I would also suggest increasing MFC after period in this particular
case for couple of months maybe.

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


Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Andrey V. Elsukov
On 15.05.2011 19:09, Marcel Moolenaar wrote:
  Simplify the code a bit. For own providers GEOM_PART always provides
  start and end config attributes.

  MFC after:  1 week
 
 Just to make sure: the code deals with backward compatibility.
 If you're aware of the issue, but don't care (anymore) about it,
 then the change is fine (as I can't quite remember the case in
 point, and I don't care enough to speculatively page in the
 details).

g_part_dumpconf() function does set both pair of parameters:
(start, end) and (offset, length). I do not see a way how one pair
can not be present in XML tree.

 If you weren't aware, we should probably determine the impact
 before you MFC this. Let me know and I'll dig up the details.

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


svn commit: r221965 - head/sys/dev/ath

2011-05-15 Thread Adrian Chadd
Author: adrian
Date: Sun May 15 15:54:34 2011
New Revision: 221965
URL: http://svn.freebsd.org/changeset/base/221965

Log:
  * Add some more TX descriptor error counters; this'll be helpful when
implementing TX aggregation
  * Whilst I'm there, comment some RX error counters

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_sysctl.c
  head/sys/dev/ath/if_athioctl.h

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Sun May 15 15:47:16 2011(r221964)
+++ head/sys/dev/ath/if_ath.c   Sun May 15 15:54:34 2011(r221965)
@@ -3966,9 +3966,21 @@ ath_tx_processq(struct ath_softc *sc, st
sc-sc_stats.ast_tx_fifoerr++;
if (ts-ts_status  HAL_TXERR_FILT)
sc-sc_stats.ast_tx_filtered++;
+   if (ts-ts_status  HAL_TXERR_XTXOP)
+   sc-sc_stats.ast_tx_xtxop++;
+   if (ts-ts_status  HAL_TXERR_TIMER_EXPIRED)
+   sc-sc_stats.ast_tx_timerexpired++;
+
+   /* XXX HAL_TX_DATA_UNDERRUN */
+   /* XXX HAL_TX_DELIM_UNDERRUN */
+
if (bf-bf_m-m_flags  M_FF)
sc-sc_stats.ast_ff_txerr++;
}
+   /* XXX when is this valid? */
+   if (ts-ts_status  HAL_TX_DESC_CFG_ERR)
+   sc-sc_stats.ast_tx_desccfgerr++;
+
sr = ts-ts_shortretry;
lr = ts-ts_longretry;
sc-sc_stats.ast_tx_shortretry += sr;

Modified: head/sys/dev/ath/if_ath_sysctl.c
==
--- head/sys/dev/ath/if_ath_sysctl.cSun May 15 15:47:16 2011
(r221964)
+++ head/sys/dev/ath/if_ath_sysctl.cSun May 15 15:54:34 2011
(r221965)
@@ -709,6 +709,12 @@ ath_sysctl_stats_attach(struct ath_softc
sc-sc_stats.ast_tx_timeout, 0, TX Global Timeout);
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, ast_tx_cst, CTLFLAG_RD,
sc-sc_stats.ast_tx_cst, 0, TX Carrier Sense Timeout);
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, ast_tx_xtxop, CTLFLAG_RD,
+   sc-sc_stats.ast_tx_xtxop, 0, TX exceeded TXOP);
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, ast_tx_timerexpired, CTLFLAG_RD,
+   sc-sc_stats.ast_tx_timerexpired, 0, TX exceeded TX_TIMER 
register);
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, ast_tx_desccfgerr, CTLFLAG_RD,
+   sc-sc_stats.ast_tx_desccfgerr, 0, TX Descriptor Cfg Error);
 
/* Attach the RX phy error array */
ath_sysctl_stats_attach_rxphyerr(sc, child);

Modified: head/sys/dev/ath/if_athioctl.h
==
--- head/sys/dev/ath/if_athioctl.h  Sun May 15 15:47:16 2011
(r221964)
+++ head/sys/dev/ath/if_athioctl.h  Sun May 15 15:54:34 2011
(r221965)
@@ -121,17 +121,20 @@ struct ath_stats {
u_int32_t   ast_be_missed;  /* missed beacons */
u_int32_t   ast_ani_cal;/* ANI calibrations performed */
u_int32_t   ast_rx_agg; /* number of aggregate frames RX'ed */
-   u_int32_t   ast_rx_halfgi;
-   u_int32_t   ast_rx_2040;
-   u_int32_t   ast_rx_pre_crc_err;
-   u_int32_t   ast_rx_post_crc_err;
-   u_int32_t   ast_rx_decrypt_busy_err;
+   u_int32_t   ast_rx_halfgi;  /* RX half-GI */
+   u_int32_t   ast_rx_2040;/* RX 40mhz frame */
+   u_int32_t   ast_rx_pre_crc_err; /* RX pre-delimiter CRC error */
+   u_int32_t   ast_rx_post_crc_err;/* RX post-delimiter CRC error 
*/
+   u_int32_t   ast_rx_decrypt_busy_err;/* RX decrypt engine 
busy error */
u_int32_t   ast_rx_hi_rx_chain;
u_int32_t   ast_tx_htprotect;   /* HT tx frames with protection 
*/
-   u_int32_t   ast_rx_hitqueueend;
+   u_int32_t   ast_rx_hitqueueend; /* RX hit descr queue end */
u_int32_t   ast_tx_timeout; /* Global TX timeout */
u_int32_t   ast_tx_cst; /* Carrier sense timeout */
-   u_int32_t   ast_pad[16];
+   u_int32_t   ast_tx_xtxop;   /* tx exceeded TXOP */
+   u_int32_t   ast_tx_timerexpired;/* tx exceeded TX_TIMER */
+   u_int32_t   ast_tx_desccfgerr;  /* tx desc cfg error */
+   u_int32_t   ast_pad[13];
 };
 
 #defineSIOCGATHSTATS   _IOWR('i', 137, struct ifreq)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

Re: svn commit: r221853 - in head/sys: dev/md dev/null sys vm

2011-05-15 Thread Dag-Erling Smørgrav
Matthew D Fleming m...@freebsd.org writes:
 Log:
   Usa a globally visible region of zeros for both /dev/zero and the md
   device.  There are likely other kernel uses of blob of zeros than can
   be converted.

Excellent, thank you!

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221967 - head/sbin/geom/class/part

2011-05-15 Thread Andrey V. Elsukov
Author: ae
Date: Sun May 15 16:16:48 2011
New Revision: 221967
URL: http://svn.freebsd.org/changeset/base/221967

Log:
  Some partitioning schemes want to have partitions that are aligned
  with geometry. And they do recalculation of user specified parameters.
  MBR, PC98, VTOC8, EBR schemes are doing that. For these schemes an
  auto alignment feature (ie. gpart add -a alignment) would not work.
  But it can work for GPT and BSD schemes. BSD scheme usualy is created
  inside MBR, so we can use knowledge about offset of MBR partition to
  calculate aligned values for BSD partitions.
  
  Use offset attribute of the parent provider for better alignment.
  
  MFC after:2 weeks

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==
--- head/sbin/geom/class/part/geom_part.c   Sun May 15 16:15:39 2011
(r221966)
+++ head/sbin/geom/class/part/geom_part.c   Sun May 15 16:16:48 2011
(r221967)
@@ -416,7 +416,7 @@ gpart_autofill(struct gctl_req *req)
struct gprovider *pp;
off_t first, last, a_first;
off_t size, start, a_lba;
-   off_t lba, len, alignment;
+   off_t lba, len, alignment, offset;
uintmax_t grade;
const char *s;
int error, has_size, has_start, has_alignment;
@@ -467,8 +467,6 @@ gpart_autofill(struct gctl_req *req)
error = g_parse_lba(s, pp-lg_sectorsize, size);
if (error)
errc(EXIT_FAILURE, error, Invalid size param);
-   if (size  alignment)
-   size = ALIGNDOWN(size, alignment);
}
 
s = gctl_get_ascii(req, start);
@@ -478,22 +476,29 @@ gpart_autofill(struct gctl_req *req)
error = g_parse_lba(s, pp-lg_sectorsize, start);
if (error)
errc(EXIT_FAILURE, error, Invalid start param);
-   start = ALIGNUP(start, alignment);
}
 
/* No autofill necessary. */
if (has_size  has_start  !has_alignment)
goto done;
 
+   /* Adjust parameters to offset value for better alignment */
+   s = find_provcfg(pp, offset);
+   offset = (s == NULL) ? 0:
+   (off_t)strtoimax(s, NULL, 0) / pp-lg_sectorsize;
+   start = ALIGNUP(start + offset, alignment);
+   if (size + offset  alignment)
+   size = ALIGNDOWN(size + offset, alignment);
+
first = (off_t)strtoimax(find_geomcfg(gp, first), NULL, 0);
last = (off_t)strtoimax(find_geomcfg(gp, last), NULL, 0);
grade = ~0ULL;
-   a_first = ALIGNUP(first, alignment);
-   last = ALIGNDOWN(last, alignment);
+   a_first = ALIGNUP(first + offset, alignment);
+   last = ALIGNDOWN(last + offset, alignment);
while ((pp = find_provider(gp, first)) != NULL) {
s = find_provcfg(pp, start);
lba = (off_t)strtoimax(s, NULL, 0);
-   a_lba = ALIGNDOWN(lba, alignment);
+   a_lba = ALIGNDOWN(lba + offset, alignment);
if (first  a_lba  a_first  a_lba) {
/* Free space [first, lba */
len = a_lba - a_first;
@@ -519,7 +524,7 @@ gpart_autofill(struct gctl_req *req)
 
s = find_provcfg(pp, end);
first = (off_t)strtoimax(s, NULL, 0) + 1;
-   a_first = ALIGNUP(first, alignment);
+   a_first = ALIGNUP(first + offset, alignment);
}
if (a_first = last) {
/* Free space [first-last] */
@@ -543,12 +548,11 @@ gpart_autofill(struct gctl_req *req)
}
}
}
-
if (grade == ~0ULL) {
geom_deletetree(mesh);
return (ENOSPC);
}
-
+   start -= offset;/* Return back to real offset */
 done:
snprintf(ssize, sizeof(ssize), %jd, (intmax_t)size);
gctl_change_param(req, size, -1, ssize);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2011-05-15 Thread Andrey V. Elsukov
Author: ae
Date: Sun May 15 16:40:42 2011
New Revision: 221969
URL: http://svn.freebsd.org/changeset/base/221969

Log:
  MFC r221644,221645,221652,221656,221658:
Limit number of sectors that can be addressed.
  
  MFC r221647:
Replace UINT_MAX to UINT32_MAX.

Modified:
  stable/8/sys/geom/part/g_part_bsd.c
  stable/8/sys/geom/part/g_part_ebr.c
  stable/8/sys/geom/part/g_part_mbr.c
  stable/8/sys/geom/part/g_part_pc98.c
  stable/8/sys/geom/part/g_part_vtoc8.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/geom/part/g_part_bsd.c
==
--- stable/8/sys/geom/part/g_part_bsd.c Sun May 15 16:33:13 2011
(r221968)
+++ stable/8/sys/geom/part/g_part_bsd.c Sun May 15 16:40:42 2011
(r221969)
@@ -203,7 +203,7 @@ g_part_bsd_create(struct g_part_table *b
if (BBSIZE % pp-sectorsize)
return (ENOTBLK);
 
-   msize = MIN(pp-mediasize / pp-sectorsize, 0x);
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
secpercyl = basetable-gpt_sectors * basetable-gpt_heads;
ncyls = msize / secpercyl;
 
@@ -362,7 +362,7 @@ g_part_bsd_read(struct g_part_table *bas
 
pp = cp-provider;
table = (struct g_part_bsd_table *)basetable;
-   msize = pp-mediasize / pp-sectorsize;
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
 
table-bbarea = g_read_data(cp, 0, BBSIZE, error);
if (table-bbarea == NULL)

Modified: stable/8/sys/geom/part/g_part_ebr.c
==
--- stable/8/sys/geom/part/g_part_ebr.c Sun May 15 16:33:13 2011
(r221968)
+++ stable/8/sys/geom/part/g_part_ebr.c Sun May 15 16:40:42 2011
(r221969)
@@ -280,7 +280,7 @@ g_part_ebr_create(struct g_part_table *b
if (strcmp(psn, MBR))
return (ENXIO);
 
-   msize = MIN(pp-mediasize / pp-sectorsize, 0x);
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
msize -= msize % basetable-gpt_sectors;
basetable-gpt_first = 0;
basetable-gpt_last = msize - 1;
@@ -472,7 +472,7 @@ g_part_ebr_read(struct g_part_table *bas
 
pp = cp-provider;
table = (struct g_part_ebr_table *)basetable;
-   msize = pp-mediasize / pp-sectorsize;
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
 
lba = 0;
while (1) {

Modified: stable/8/sys/geom/part/g_part_mbr.c
==
--- stable/8/sys/geom/part/g_part_mbr.c Sun May 15 16:33:13 2011
(r221968)
+++ stable/8/sys/geom/part/g_part_mbr.c Sun May 15 16:40:42 2011
(r221969)
@@ -259,7 +259,7 @@ g_part_mbr_create(struct g_part_table *b
if (pp-sectorsize  MBRSIZE)
return (ENOSPC);
 
-   msize = MIN(pp-mediasize / pp-sectorsize, 0x);
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
basetable-gpt_first = basetable-gpt_sectors;
basetable-gpt_last = msize - (msize % basetable-gpt_sectors) - 1;
 
@@ -430,7 +430,7 @@ g_part_mbr_read(struct g_part_table *bas
 
pp = cp-provider;
table = (struct g_part_mbr_table *)basetable;
-   msize = pp-mediasize / pp-sectorsize;
+   msize = MIN(pp-mediasize / pp-sectorsize, UINT32_MAX);
 
buf = g_read_data(cp, 0L, pp-sectorsize, error);
if (buf == NULL)

Modified: stable/8/sys/geom/part/g_part_pc98.c
==
--- stable/8/sys/geom/part/g_part_pc98.cSun May 15 16:33:13 2011
(r221968)
+++ stable/8/sys/geom/part/g_part_pc98.cSun May 15 16:40:42 2011
(r221969)
@@ -233,7 +233,7 @@ g_part_pc98_create(struct g_part_table *
 
cyl = basetable-gpt_heads * basetable-gpt_sectors;
 
-   msize = MIN(pp-mediasize / SECSIZE, 0x);
+   msize = MIN(pp-mediasize / SECSIZE, UINT32_MAX);
basetable-gpt_first = cyl;
basetable-gpt_last = msize - (msize % cyl) - 1;
 
@@ -417,7 +417,7 @@ g_part_pc98_read(struct g_part_table *ba
 
pp = cp-provider;
table = (struct g_part_pc98_table *)basetable;
-   msize = pp-mediasize / SECSIZE;
+   msize = MIN(pp-mediasize / SECSIZE, UINT32_MAX);
 
buf = g_read_data(cp, 0L, 2 * SECSIZE, error);
if (buf == NULL)

Modified: stable/8/sys/geom/part/g_part_vtoc8.c
==
--- stable/8/sys/geom/part/g_part_vtoc8.c   Sun May 15 16:33:13 2011
(r221968)
+++ stable/8/sys/geom/part/g_part_vtoc8.c   Sun May 15 16:40:42 2011
(r221969)
@@ -195,9 +195,7 @@ 

Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Marcel Moolenaar

On May 15, 2011, at 11:27 AM, Andrey V. Elsukov wrote:

 On 15.05.2011 19:09, Marcel Moolenaar wrote:
 Simplify the code a bit. For own providers GEOM_PART always provides
 start and end config attributes.
 
 MFC after:  1 week
 
 Just to make sure: the code deals with backward compatibility.
 If you're aware of the issue, but don't care (anymore) about it,
 then the change is fine (as I can't quite remember the case in
 point, and I don't care enough to speculatively page in the
 details).
 
 g_part_dumpconf() function does set both pair of parameters:
 (start, end) and (offset, length). I do not see a way how one pair
 can not be present in XML tree.

/* ... paging in non-commit details ... */

The point is that this is what's happening *now*. This is not
what happened before. With support for logical partitions (i.e.
the EBR scheme), the total partition bounds and the effective
usable space are not the same. This is because the partition
starts with an MBR look-alike. The usable space is therefore
1 sector less and start at offset 1 (0-based) from the start
of the partition.

In any case: this particular scenario had to be handled and
for that we have offset+size (the usable area, as per GEOM
standards) and start+end (the total space occupied by the
partition) separately. They do not represent the same info.

The start+end parameters did not exist before and I had to add
that later. To have the utility work with older kernels (that
did not support the EBR scheme) I added the fall-back to using
offset+length, because those two would encode what we needed
in that case.

As I said: I'm fine with the change, but please assess the
consequences of dropping the fall-back, for it may be better
to make this change on -current after 9-stable branched and
without the MFC.

That's it... Nothing major...

FYI,

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


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


svn commit: r221970 - head/bin/sh

2011-05-15 Thread Jilles Tjoelker
Author: jilles
Date: Sun May 15 17:00:43 2011
New Revision: 221970
URL: http://svn.freebsd.org/changeset/base/221970

Log:
  sh: Avoid close(-1) when evaluating a multi-command pipeline.
  
  Valgrind complains about this.

Modified:
  head/bin/sh/eval.c

Modified: head/bin/sh/eval.c
==
--- head/bin/sh/eval.c  Sun May 15 16:40:42 2011(r221969)
+++ head/bin/sh/eval.c  Sun May 15 17:00:43 2011(r221970)
@@ -552,7 +552,8 @@ evalpipe(union node *n)
if (prevfd = 0)
close(prevfd);
prevfd = pip[0];
-   close(pip[1]);
+   if (pip[1] != -1)
+   close(pip[1]);
}
INTON;
if (n-npipe.backgnd == 0) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Marcel Moolenaar

On May 15, 2011, at 12:59 PM, Marcel Moolenaar wrote:
 
 /* ... paging in non-commit details ... */
 
 The point is that this is what's happening *now*. This is not
 what happened before. With support for logical partitions (i.e.
 the EBR scheme), the total partition bounds and the effective
 usable space are not the same. This is because the partition
 starts with an MBR look-alike. The usable space is therefore
 1 sector less and start at offset 1 (0-based) from the start
 of the partition.

/* ... compensate for data poisoning while paging in ... */

The usable space starts a *track* from the beginning of the
partition as per standard MBR rules. Not 1 sector in...

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


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


Re: svn commit: r221952 - head/sbin/geom/class/part

2011-05-15 Thread Andrey V. Elsukov
On 15.05.2011 20:59, Marcel Moolenaar wrote:
 g_part_dumpconf() function does set both pair of parameters:
 (start, end) and (offset, length). I do not see a way how one pair
 can not be present in XML tree.
 
 /* ... paging in non-commit details ... */
 
 The point is that this is what's happening *now*. This is not
 what happened before. With support for logical partitions (i.e.
 the EBR scheme), the total partition bounds and the effective
 usable space are not the same. This is because the partition
 starts with an MBR look-alike. The usable space is therefore
 1 sector less and start at offset 1 (0-based) from the start
 of the partition.
 
 In any case: this particular scenario had to be handled and
 for that we have offset+size (the usable area, as per GEOM
 standards) and start+end (the total space occupied by the
 partition) separately. They do not represent the same info.
 
 The start+end parameters did not exist before and I had to add
 that later. To have the utility work with older kernels (that
 did not support the EBR scheme) I added the fall-back to using
 offset+length, because those two would encode what we needed
 in that case.

Yes, i looked in the commit log before doing this change.
And i did not do any changes in the kernel.  Removing code that never
triggers seems no so bad for me. I'm also do not see how MFC
can affect the stable branch, because this code only used inside
gpart(8) and it is problematic to reuse it from not here (and also it
never triggers in stable/8 too).

 As I said: I'm fine with the change, but please assess the
 consequences of dropping the fall-back, for it may be better
 to make this change on -current after 9-stable branched and
 without the MFC.

So, would you like to revert this change?

-- 
WBR, Andrey V. Elsukov



signature.asc
Description: OpenPGP digital signature


svn commit: r221971 - head/sys/dev/glxiic

2011-05-15 Thread Henrik Brix Andersen
Author: brix (ports committer)
Date: Sun May 15 19:04:08 2011
New Revision: 221971
URL: http://svn.freebsd.org/changeset/base/221971

Log:
  Fix breakage on pc98 by redefining DEBUG().
  
  Pointy hat to:brix

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

Modified: head/sys/dev/glxiic/glxiic.c
==
--- head/sys/dev/glxiic/glxiic.cSun May 15 17:00:43 2011
(r221970)
+++ head/sys/dev/glxiic/glxiic.cSun May 15 19:04:08 2011
(r221971)
@@ -153,9 +153,10 @@ struct glxiic_softc {
 };
 
 #ifdef GLXIIC_DEBUG
-#define DEBUG(fmt, args...)log(LOG_DEBUG, %s:  fmt \n , __func__ , ## 
args)
+#define GLXIIC_DEBUG_LOG(fmt, args...) \
+   log(LOG_DEBUG, %s:  fmt \n , __func__ , ## args)
 #else
-#define DEBUG(fmt, args...)
+#define GLXIIC_DEBUG_LOG(fmt, args...)
 #endif
 
 #defineGLXIIC_SCLFRQ(n)((n  1))
@@ -540,7 +541,7 @@ glxiic_timeout(void *arg)
 
sc = (struct glxiic_softc *)arg;
 
-   DEBUG(timeout in state %d, sc-state);
+   GLXIIC_DEBUG_LOG(timeout in state %d, sc-state);
 
if (glxiic_state_table[sc-state].master) {
sc-error = IIC_ETIMEOUT;
@@ -604,7 +605,7 @@ glxiic_handle_slave_match_locked(struct 
glxiic_set_state_locked(sc, GLXIIC_STATE_SLAVE_RX);
iicbus_intr(sc-iicbus, INTR_GENERAL, addr);
} else {
-   DEBUG(unknown slave match);
+   GLXIIC_DEBUG_LOG(unknown slave match);
return (IIC_ESTATUS);
}
 
@@ -618,7 +619,7 @@ glxiic_state_idle_callback(struct glxiic
GLXIIC_ASSERT_LOCKED(sc);
 
if ((status  GLXIIC_SMB_STS_BER_BIT) != 0) {
-   DEBUG(bus error in idle);
+   GLXIIC_DEBUG_LOG(bus error in idle);
return (IIC_EBUSERR);
}
 
@@ -637,7 +638,7 @@ glxiic_state_slave_tx_callback(struct gl
GLXIIC_ASSERT_LOCKED(sc);
 
if ((status  GLXIIC_SMB_STS_BER_BIT) != 0) {
-   DEBUG(bus error in slave tx);
+   GLXIIC_DEBUG_LOG(bus error in slave tx);
return (IIC_EBUSERR);
}
 
@@ -658,7 +659,7 @@ glxiic_state_slave_tx_callback(struct gl
}
 
if ((status  GLXIIC_SMB_STS_SDAST_BIT) == 0) {
-   DEBUG(not awaiting data in slave tx);
+   GLXIIC_DEBUG_LOG(not awaiting data in slave tx);
return (IIC_ESTATUS);
}
 
@@ -678,7 +679,7 @@ glxiic_state_slave_rx_callback(struct gl
GLXIIC_ASSERT_LOCKED(sc);
 
if ((status  GLXIIC_SMB_STS_BER_BIT) != 0) {
-   DEBUG(bus error in slave rx);
+   GLXIIC_DEBUG_LOG(bus error in slave rx);
return (IIC_EBUSERR);
}
 
@@ -694,7 +695,7 @@ glxiic_state_slave_rx_callback(struct gl
}
 
if ((status  GLXIIC_SMB_STS_SDAST_BIT) == 0) {
-   DEBUG(no pending data in slave rx);
+   GLXIIC_DEBUG_LOG(no pending data in slave rx);
return (IIC_ESTATUS);
}
 
@@ -714,17 +715,17 @@ glxiic_state_master_addr_callback(struct
GLXIIC_ASSERT_LOCKED(sc);
 
if ((status  GLXIIC_SMB_STS_BER_BIT) != 0) {
-   DEBUG(bus error after master start);
+   GLXIIC_DEBUG_LOG(bus error after master start);
return (IIC_EBUSERR);
}
 
if ((status  GLXIIC_SMB_STS_MASTER_BIT) == 0) {
-   DEBUG(not bus master after master start);
+   GLXIIC_DEBUG_LOG(not bus master after master start);
return (IIC_ESTATUS);
}
 
if ((status  GLXIIC_SMB_STS_SDAST_BIT) == 0) {
-   DEBUG(not awaiting address in master addr);
+   GLXIIC_DEBUG_LOG(not awaiting address in master addr);
return (IIC_ESTATUS);
}
 
@@ -755,17 +756,17 @@ glxiic_state_master_tx_callback(struct g
GLXIIC_ASSERT_LOCKED(sc);
 
if ((status  GLXIIC_SMB_STS_BER_BIT) != 0) {
-   DEBUG(bus error in master tx);
+   GLXIIC_DEBUG_LOG(bus error in master tx);
return (IIC_EBUSERR);
}
 
if ((status  GLXIIC_SMB_STS_MASTER_BIT) == 0) {
-   DEBUG(not bus master in master tx);
+   GLXIIC_DEBUG_LOG(not bus master in master tx);
return (IIC_ESTATUS);
}
 
if ((status  GLXIIC_SMB_STS_NEGACK_BIT) != 0) {
-   DEBUG(slave nack in master tx);
+   GLXIIC_DEBUG_LOG(slave nack in master tx);
return (IIC_ENOACK);
}
 
@@ -775,7 +776,7 @@ glxiic_state_master_tx_callback(struct g
}
 
if ((status  GLXIIC_SMB_STS_SDAST_BIT) == 0) {
-   DEBUG(not awaiting data in master tx);
+   GLXIIC_DEBUG_LOG(not awaiting data in master tx);
return (IIC_ESTATUS);
}
 
@@ -796,17 +797,17 @@ glxiic_state_master_rx_callback(struct g
GLXIIC_ASSERT_LOCKED(sc);
 
 

Re: svn commit: r221971 - head/sys/dev/glxiic

2011-05-15 Thread Kostik Belousov
On Sun, May 15, 2011 at 07:04:08PM +, Henrik Brix Andersen wrote:
 Author: brix (ports committer)
 Date: Sun May 15 19:04:08 2011
 New Revision: 221971
 URL: http://svn.freebsd.org/changeset/base/221971
 
 Log:
   Fix breakage on pc98 by redefining DEBUG().
Why this was built on pc98 at all ?
Are there any pc98 machines with Geode ?


pgppR3MyvgT2l.pgp
Description: PGP signature


svn commit: r221972 - head/sys/geom/part

2011-05-15 Thread Andrey V. Elsukov
Author: ae
Date: Sun May 15 20:03:54 2011
New Revision: 221972
URL: http://svn.freebsd.org/changeset/base/221972

Log:
  Add a sysctl kern.geom.part.check_integrity for those who has corrupt
  partition tables and lost an ability to boot after r221788.
  Also unhide an error message from bootverbose, this would help to
  easier determine the problem.

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Sun May 15 19:04:08 2011(r221971)
+++ head/sys/geom/part/g_part.c Sun May 15 20:03:54 2011(r221972)
@@ -39,6 +39,7 @@ __FBSDID($FreeBSD$);
 #include sys/mutex.h
 #include sys/queue.h
 #include sys/sbuf.h
+#include sys/sysctl.h
 #include sys/systm.h
 #include sys/uuid.h
 #include geom/geom.h
@@ -104,6 +105,13 @@ struct g_part_alias_list {
{ netbsd-swap, G_PART_ALIAS_NETBSD_SWAP },
 };
 
+SYSCTL_DECL(_kern_geom);
+SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, GEOM_PART stuff);
+static u_int check_integrity = 1;
+TUNABLE_INT(kern.geom.part.check_integrity, check_integrity);
+SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW,
+check_integrity, 1, Enable integrity checking);
+
 /*
  * The GEOM partitioning class.
  */
@@ -267,9 +275,12 @@ g_part_check_integrity(struct g_part_tab
}
return (0);
 fail:
-   if (bootverbose)
-   printf(GEOM_PART: integrity check failed (%s, %s)\n,
-   pp-name, table-gpt_scheme-name);
+   printf(GEOM_PART: integrity check failed (%s, %s)\n, pp-name,
+   table-gpt_scheme-name);
+   if (check_integrity == 0) {
+   table-gpt_corrupt = 1;
+   return (0);
+   }
return (EINVAL);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221973 - in head: sys/fs/nfs sys/fs/nfsclient sys/nfs sys/nfsclient usr.bin/nfsstat

2011-05-15 Thread Rick Macklem
Author: rmacklem
Date: Sun May 15 20:52:43 2011
New Revision: 221973
URL: http://svn.freebsd.org/changeset/base/221973

Log:
  Change the sysctl naming for the old and new NFS clients
  to vfs.oldnfs.xxx and vfs.nfs.xxx respectively. This makes
  the default nfs client use vfs.nfs.xxx after r221124.

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/fs/nfs/nfs_commonport.c
  head/sys/fs/nfsclient/nfs_clkrpc.c
  head/sys/fs/nfsclient/nfs_clnfsiod.c
  head/sys/fs/nfsclient/nfs_clsubs.c
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/fs/nfsclient/nfs_clvnops.c
  head/sys/nfs/nfs_common.c
  head/sys/nfsclient/nfs_krpc.c
  head/sys/nfsclient/nfs_nfsiod.c
  head/sys/nfsclient/nfs_subs.c
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/nfsclient/nfs_vnops.c
  head/usr.bin/nfsstat/nfsstat.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==
--- head/sys/fs/nfs/nfs_commonkrpc.cSun May 15 20:03:54 2011
(r221972)
+++ head/sys/fs/nfs/nfs_commonkrpc.cSun May 15 20:52:43 2011
(r221973)
@@ -78,17 +78,17 @@ static int  nfs3_jukebox_delay = 10;
 static int nfs_skip_wcc_data_onerr = 1;
 static int nfs_keytab_enctype = ETYPE_DES_CBC_CRC;
 
-SYSCTL_DECL(_vfs_newnfs);
+SYSCTL_DECL(_vfs_nfs);
 
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, bufpackets, CTLFLAG_RW, nfs_bufpackets, 0,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, bufpackets, CTLFLAG_RW, nfs_bufpackets, 0,
 Buffer reservation size 2  x  64);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, reconnects, CTLFLAG_RD, nfs_reconnects, 0,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, reconnects, CTLFLAG_RD, nfs_reconnects, 0,
 Number of times the nfs client has had to reconnect);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, 
nfs3_jukebox_delay, 0,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs3_jukebox_delay, CTLFLAG_RW, 
nfs3_jukebox_delay, 0,
 Number of seconds to delay a retry after receiving EJUKEBOX);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, 
nfs_skip_wcc_data_onerr, 0,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, skip_wcc_data_onerr, CTLFLAG_RW, 
nfs_skip_wcc_data_onerr, 0,
 Disable weak cache consistency checking when server returns an error);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, keytab_enctype, CTLFLAG_RW, 
nfs_keytab_enctype, 0,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, keytab_enctype, CTLFLAG_RW, 
nfs_keytab_enctype, 0,
 Encryption type for the keytab entry used by nfs);
 
 static voidnfs_down(struct nfsmount *, struct thread *, const char *,

Modified: head/sys/fs/nfs/nfs_commonport.c
==
--- head/sys/fs/nfs/nfs_commonport.cSun May 15 20:03:54 2011
(r221972)
+++ head/sys/fs/nfs/nfs_commonport.cSun May 15 20:52:43 2011
(r221973)
@@ -69,14 +69,12 @@ void (*ncl_call_invalcaches)(struct vnod
 static int nfs_realign_test;
 static int nfs_realign_count;
 
-SYSCTL_NODE(_vfs, OID_AUTO, newnfs, CTLFLAG_RW, 0, New NFS filesystem);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_test, CTLFLAG_RW, nfs_realign_test,
+SYSCTL_NODE(_vfs, OID_AUTO, nfs, CTLFLAG_RW, 0, New NFS filesystem);
+SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RW, nfs_realign_test,
 0, Number of realign tests done);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, realign_count, CTLFLAG_RW, 
nfs_realign_count,
+SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RW, nfs_realign_count,
 0, Number of mbuf realignments done);
-SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs4acl_enable, CTLFLAG_RW, nfsrv_useacl,
-0, Enable NFSv4 ACLs);
-SYSCTL_STRING(_vfs_newnfs, OID_AUTO, callback_addr, CTLFLAG_RW,
+SYSCTL_STRING(_vfs_nfs, OID_AUTO, callback_addr, CTLFLAG_RW,
 nfsv4_callbackaddr, sizeof(nfsv4_callbackaddr),
 NFSv4 callback addr for server to use);
 

Modified: head/sys/fs/nfsclient/nfs_clkrpc.c
==
--- head/sys/fs/nfsclient/nfs_clkrpc.c  Sun May 15 20:03:54 2011
(r221972)
+++ head/sys/fs/nfsclient/nfs_clkrpc.c  Sun May 15 20:52:43 2011
(r221973)
@@ -46,8 +46,6 @@ __FBSDID($FreeBSD$);
 
 NFSDLOCKMUTEX;
 
-SYSCTL_DECL(_vfs_newnfs);
-
 SVCPOOL*nfscbd_pool;
 
 static int nfs_cbproc(struct nfsrv_descript *, u_int32_t);

Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c
==
--- head/sys/fs/nfsclient/nfs_clnfsiod.cSun May 15 20:03:54 2011
(r221972)
+++ head/sys/fs/nfsclient/nfs_clnfsiod.cSun May 15 20:52:43 2011
(r221973)
@@ -80,11 +80,11 @@ static void nfssvc_iod(void *);
 
 static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON];
 
-SYSCTL_DECL(_vfs_newnfs);
+SYSCTL_DECL(_vfs_nfs);
 
 /* Maximum number of seconds a nfsiod kthread will sleep before exiting */
 static unsigned int nfs_iodmaxidle = 120;
-SYSCTL_UINT(_vfs_newnfs, OID_AUTO, iodmaxidle, CTLFLAG_RW, nfs_iodmaxidle, 0,
+SYSCTL_UINT(_vfs_nfs, OID_AUTO, iodmaxidle, 

svn commit: r221974 - head/sys/dev/bge

2011-05-15 Thread Pyun YongHyeon
Author: yongari
Date: Sun May 15 21:44:51 2011
New Revision: 221974
URL: http://svn.freebsd.org/changeset/base/221974

Log:
  Correctly disable jumbo frame support for BCM5719 A0.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Sun May 15 20:52:43 2011(r221973)
+++ head/sys/dev/bge/if_bge.c   Sun May 15 21:44:51 2011(r221974)
@@ -2836,7 +2836,7 @@ bge_attach(device_t dev)
if (sc-bge_asicrev == BGE_ASICREV_BCM5719 
sc-bge_chipid == BGE_CHIPID_BCM5719_A0) {
/* Jumbo frame on BCM5719 A0 does not work. */
-   sc-bge_flags = ~BGE_FLAG_JUMBO_FRAME;
+   sc-bge_flags = ~BGE_FLAG_JUMBO;
}
break;
case BGE_ASICREV_BCM5755:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221975 - head/bin/sh

2011-05-15 Thread Jilles Tjoelker
Author: jilles
Date: Sun May 15 22:09:27 2011
New Revision: 221975
URL: http://svn.freebsd.org/changeset/base/221975

Log:
  sh: Minor optimization to output from ulimit/export/readonly.
  
  No functional change is intended.

Modified:
  head/bin/sh/miscbltin.c
  head/bin/sh/var.c

Modified: head/bin/sh/miscbltin.c
==
--- head/bin/sh/miscbltin.c Sun May 15 21:44:51 2011(r221974)
+++ head/bin/sh/miscbltin.c Sun May 15 22:09:27 2011(r221975)
@@ -465,7 +465,7 @@ ulimitcmd(int argc __unused, char **argv
(-%c) , l-option);
out1fmt(%-18s %18s , l-name, optbuf);
if (val == RLIM_INFINITY)
-   out1fmt(unlimited\n);
+   out1str(unlimited\n);
else
{
val /= l-factor;
@@ -491,7 +491,7 @@ ulimitcmd(int argc __unused, char **argv
val = limit.rlim_max;
 
if (val == RLIM_INFINITY)
-   out1fmt(unlimited\n);
+   out1str(unlimited\n);
else
{
val /= l-factor;

Modified: head/bin/sh/var.c
==
--- head/bin/sh/var.c   Sun May 15 21:44:51 2011(r221974)
+++ head/bin/sh/var.c   Sun May 15 22:09:27 2011(r221975)
@@ -681,14 +681,13 @@ exportcmd(int argc, char **argv)
out1str(cmdname);
out1c(' ');
}
-   p = strchr(vp-text, '=');
if (values  !(vp-flags  VUNSET)) {
-   p++;
-   outbin(vp-text, p - vp-text,
-   out1);
-   out1qstr(p);
+   outbin(vp-text,
+   vp-name_len + 1, out1);
+   out1qstr(vp-text +
+   vp-name_len + 1);
} else
-   outbin(vp-text, p - vp-text,
+   outbin(vp-text, vp-name_len,
out1);
out1c('\n');
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r221976 - head/usr.sbin/nfsd

2011-05-15 Thread Rick Macklem
Author: rmacklem
Date: Sun May 15 22:46:45 2011
New Revision: 221976
URL: http://svn.freebsd.org/changeset/base/221976

Log:
  Fix the nfsv4 man page to reflect the changes related to
  making the new NFS client and server the default.
  This is a content change.

Modified:
  head/usr.sbin/nfsd/nfsv4.4

Modified: head/usr.sbin/nfsd/nfsv4.4
==
--- head/usr.sbin/nfsd/nfsv4.4  Sun May 15 22:09:27 2011(r221975)
+++ head/usr.sbin/nfsd/nfsv4.4  Sun May 15 22:46:45 2011(r221976)
@@ -24,14 +24,14 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd April 10, 2011
+.Dd May 15, 2011
 .Dt NFSV4 4
 .Os
 .Sh NAME
 .Nm NFSv4
 .Nd NFS Version 4 Protocol
 .Sh DESCRIPTION
-The experimental NFS client and server provides support for the
+The NFS client and server provides support for the
 .Tn NFSv4
 specification; see
 .%T Network File System (NFS) Version 4 Protocol RFC 3530 .
@@ -153,36 +153,26 @@ with RPCSEC_GSS (sec=krb5, krb5i, krb5p)
 will go on the wire.
 .Sh SERVER SETUP
 .Pp
-To set up the experimental NFS server that supports
+To set up the NFS server that supports
 .Nm ,
-you will need to either build a kernel with:
+you will need to either set the variables in
+.Xr rc.conf 5
+as follows:
 .sp
 .Bd -literal -offset indent -compact
-optionsNFSD
-.Ed
-and not
-.Bd -literal -offset indent -compact
-optionsNFSSERVER
+nfs_server_enable=YES
+nfsv4_server_enable=YES
+nfsuserd_enable=YES
 .Ed
 .sp
 or start
 .Xr mountd 8
 and
 .Xr nfsd 8
-with the ``-e'' option to force use of the experimental server.
+without the ``-o'' option, which would force use of the old server.
 The
 .Xr nfsuserd 8
 daemon must also be running.
-This will occur if
-.sp
-.Bd -literal -offset indent -compact
-nfs_server_enable=YES
-nfsv4_server_enable=YES
-nfsuserd_enable=YES
-.Ed
-.sp
-are set in
-.Xr rc.conf 5 .
 .Pp
 You will also need to add at least one ``V4:'' line to the
 .Xr exports 5
@@ -196,7 +186,7 @@ there are a couple of
 .Xr sysctl 8
 variables that you can change, which might improve performance.
 .Bl -tag -width Ds
-.It Cm vfs.newnfs.issue_delegations
+.It Cm vfs.nfsd.issue_delegations
 when set non-zero, allows the server to issue Open Delegations to
 clients.
 These delegations permit the client to manipulate the file
@@ -208,7 +198,7 @@ This can only be enabled when the file s
 clients are not being accessed locally on the server and, if being
 accessed via NFS Version 2 or 3 clients, these clients cannot be
 using the NLM.
-.It Cm vfs.newnfs.enable_locallocks
+.It Cm vfs.nfsd.enable_locallocks
 can be set to 0 to disable acquisition of local byte range locks.
 Disabling local locking can only be done if neither local accesses
 to the exported file systems nor the NLM is operating on them.
@@ -217,7 +207,7 @@ to the exported file systems nor the NLM
 Note that Samba server access would be considered ``local access'' for the 
above
 discussion.
 .Pp
-To build a kernel with the experimental
+To build a kernel with the NFS server that supports
 .Nm
 linked into it, the
 .sp
@@ -235,7 +225,9 @@ To do an
 mount, specify the ``nfsv4'' option on the
 .Xr mount_nfs 8
 command line.
-This will force use of the experimental client plus set ``tcp'' and
+This will force use of the client that supports
+.Nm
+plus set ``tcp'' and
 .Nm .
 .Pp
 The
@@ -269,16 +261,16 @@ To get callbacks to work when behind a N
 service will need to be set up on the NAT gateway and then the address
 of the NAT gateway (host IP plus port#) will need to be set by assigning the
 .Xr sysctl 8
-variable vfs.newnfs.callback_addr to a string of the form:
+variable vfs.nfs.callback_addr to a string of the form:
 .sp
 N.N.N.N.N.N
 .sp
 where the first 4 Ns are the host IP address and the last two are the
 port# in network byte order (all decimal #s in the range 0-255).
 .Pp
-To build a kernel with the experimental
+To build a kernel with the client that supports
 .Nm
-client linked into it, the option
+linked into it, the option
 .sp
 .Bd -literal -offset indent -compact
 optionsNFSCL
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r221888 - head/sys/dev/ath/ath_hal

2011-05-15 Thread Adrian Chadd
On 14 May 2011 22:25, Adrian Chadd adr...@freebsd.org wrote:

  Import initial EEPROM code for Kite (AR9287).

That should be Kiwi (AR9287.) Sorry.



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


svn commit: r221981 - head/sys/powerpc/aim

2011-05-15 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Mon May 16 03:32:40 2011
New Revision: 221981
URL: http://svn.freebsd.org/changeset/base/221981

Log:
  Remove a useless check that served only to make 64-bit PPC systems
  unbootable after r221855.
  
  Submitted by: andreast
  MFC after:1 week

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cMon May 16 03:23:50 2011
(r221980)
+++ head/sys/powerpc/aim/mmu_oea64.cMon May 16 03:32:40 2011
(r221981)
@@ -1141,8 +1141,6 @@ moea64_zero_page_area(mmu_t mmu, vm_page
 {
vm_offset_t pa = VM_PAGE_TO_PHYS(m);
 
-   if (!moea64_initialized)
-   panic(moea64_zero_page: can't zero pa %# PRIxPTR, pa);
if (size + off  PAGE_SIZE)
panic(moea64_zero_page: size + off  PAGE_SIZE);
 
@@ -1165,9 +1163,6 @@ moea64_zero_page(mmu_t mmu, vm_page_t m)
vm_offset_t pa = VM_PAGE_TO_PHYS(m);
vm_offset_t va, off;
 
-   if (!moea64_initialized)
-   panic(moea64_zero_page: can't zero pa %#zx, pa);
-
if (!hw_direct_map) {
mtx_lock(moea64_scratchpage_mtx);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org