Re: svn commit: r241576 - in head/usr.sbin/cron: cron crontab lib

2012-10-16 Thread Maxim Sobolev

On 10/15/2012 1:44 PM, Ian Lepore wrote:

It appears to, which I don't think is a bad thing at all.  But the way
it waits is to wake up, do some work, and go back to sleep for an
integer 1 second.  That will occasionally lead to a second in which no
wakeup happens, as the "do some work" part always takes some fraction of
a second.


Right, I will look into it.

I believe the reason why we cannot "sleep until the next event" is that 
time can go back and forth in the meantime (e.g. ntpd / ntpdate), so 
that amount you think you can sleep can change while you are already 
sleeping. It should not be that hard to change it to wake up every 60 
seconds if there is no per-second activity planned.


Also I think some more logic necessary to ignore seconds in comparison, 
unless it's "every x seconds" job. Otherwise we might loose job set up 
for 00:00:00 by waking up say 00:00:00:01, not at 00:00:00:00 due to 
paging, network latency (e.g. running off nfs), etc.



-Maxim
___
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: r241576 - in head/usr.sbin/cron: cron crontab lib

2012-10-16 Thread Maxim Sobolev

On 10/15/2012 9:40 PM, Adrian Chadd wrote:

Gah, I think there's quite a lot of push back on this.

Maxim, would you please consider reverting this patch? Can we have a
discussion on the best way to do this, taking various things like
embedded and power-saving systems into effect?


I am working on improved version, so that in the absence of 
@every_second it would revert to the previous behavior. Even though I 
seriously doubt that few thousand additional CPU cycles every second 
would make any measurable differences in any practical application.


-Maxim
___
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: r241603 - head/sys/dev/aha

2012-10-16 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct 16 08:40:09 2012
New Revision: 241603
URL: http://svn.freebsd.org/changeset/base/241603

Log:
  Fix build of aha(4).
  
  Submitted by: delphij

Modified:
  head/sys/dev/aha/aha.c
  head/sys/dev/aha/aha_isa.c
  head/sys/dev/aha/ahareg.h

Modified: head/sys/dev/aha/aha.c
==
--- head/sys/dev/aha/aha.c  Tue Oct 16 02:52:30 2012(r241602)
+++ head/sys/dev/aha/aha.c  Tue Oct 16 08:40:09 2012(r241603)
@@ -61,6 +61,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -68,6 +69,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -173,8 +175,7 @@ static void ahatimeout(void *arg);
 
 /* Exported functions */
 void
-aha_alloc(struct aha_softc *aha, int unit, bus_space_tag_t tag,
-  bus_space_handle_t bsh)
+aha_alloc(struct aha_softc *aha)
 {
 
SLIST_INIT(&aha->free_aha_ccbs);
@@ -1107,7 +1108,7 @@ ahaexecuteccb(void *arg, bus_dma_segment
device_printf(aha->dev,
"Encountered busy mailbox with %d out of %d "
"commands active!!!", aha->active_ccbs, aha->max_ccbs);
-   callout_stop(&aacb->timer);
+   callout_stop(&accb->timer);
if (nseg != 0)
bus_dmamap_unload(aha->buffer_dmat, accb->dmamap);
ahafreeccb(aha, accb);
@@ -1833,7 +1834,7 @@ ahatimeout(void *arg)
 * later which will attempt a bus reset.
 */
accb->flags |= ACCB_DEVICE_RESET;
-   callout_reset(&aacb->timer, 2 * hz, ahatimeout, accb);
+   callout_reset(&accb->timer, 2 * hz, ahatimeout, accb);
aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET;
 
/* No Data Transfer */

Modified: head/sys/dev/aha/aha_isa.c
==
--- head/sys/dev/aha/aha_isa.c  Tue Oct 16 02:52:30 2012(r241602)
+++ head/sys/dev/aha/aha_isa.c  Tue Oct 16 08:40:09 2012(r241603)
@@ -126,7 +126,7 @@ aha_isa_probe(device_t dev)
if (aha->port == NULL)
return (ENXIO);
 
-   port_start = rman_get_start(port_res);
+   port_start = rman_get_start(aha->port);
aha_alloc(aha);
 
/* See if there is really a card present */
@@ -321,9 +321,9 @@ aha_isa_identify(driver_t *driver, devic
 * XXX kldload/kldunload.
 */
rid = 0;
-   aha->port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid,
+   aha.port = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid,
ioport, ioport, AHA_NREGS, RF_ACTIVE);
-   if (aha->port == NULL)
+   if (aha.port == NULL)
continue;
aha_alloc(&aha);
/* See if there is really a card present */
@@ -335,8 +335,8 @@ aha_isa_identify(driver_t *driver, devic
 * Could query the board and set IRQ/DRQ, but probe does
 * that.
 */
-   not_this_one:;
-   bus_release_resource(parent, SYS_RES_IOPORT, rid, aha->port);
+   not_this_one:
+   bus_release_resource(parent, SYS_RES_IOPORT, rid, aha.port);
aha_free(&aha);
}
 }

Modified: head/sys/dev/aha/ahareg.h
==
--- head/sys/dev/aha/ahareg.h   Tue Oct 16 02:52:30 2012(r241602)
+++ head/sys/dev/aha/ahareg.h   Tue Oct 16 08:40:09 2012(r241603)
@@ -370,12 +370,12 @@ struct aha_softc {
int  irqrid;
int  portrid;
int  drqrid;
-   void**ih;
+   void *ih;
device_t dev;
struct mtx   lock;
 };
 
-void aha_alloc(struct aha_softc *, int, bus_space_tag_t, bus_space_handle_t);
+void aha_alloc(struct aha_softc *);
 int aha_attach(struct aha_softc *);
 int aha_cmd(struct aha_softc *, aha_op_t, uint8_t *, u_int, uint8_t *, u_int,
 u_int);
@@ -389,11 +389,11 @@ int aha_probe(struct aha_softc *);
 
 #define DEFAULT_CMD_TIMEOUT 1  /* 1 sec */
 
-#define aha_inb(aha, port) \
-   bus_read_1((aha)->port, port)
+#define aha_inb(aha, reg)  \
+   bus_read_1((aha)->port, reg)
 
-#define aha_outb(aha, port, value) \
-   bus_write_1((aha)->port, port, value)
+#define aha_outb(aha, reg, value)  \
+   bus_write_1((aha)->port, reg, value)
 
 #define ADP0100_PNP0x00019004  /* ADP0100 */
 #define AHA1540_PNP0x40159004  /* ADP1540 */
___
svn-src-head@freebsd.org mailing list
http://

svn commit: r241604 - in head/sys: conf kern

2012-10-16 Thread Attilio Rao
Author: attilio
Date: Tue Oct 16 09:55:31 2012
New Revision: 241604
URL: http://svn.freebsd.org/changeset/base/241604

Log:
  Disconnect non-MPSAFE HPFS from the build in preparation for dropping
  GIANT from VFS.
  
  This is not targeted for MFC.

Modified:
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/kern/Make.tags.inc

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Oct 16 08:40:09 2012(r241603)
+++ head/sys/conf/NOTES Tue Oct 16 09:55:31 2012(r241604)
@@ -1004,7 +1004,6 @@ options   NFSCLIENT   #Network File System
 optionsCD9660  #ISO 9660 filesystem
 optionsFDESCFS #File descriptor filesystem
 optionsFUSE#FUSE support module
-optionsHPFS#OS/2 File system
 optionsMSDOSFS #MS DOS File System (FAT, FAT32)
 optionsNFSSERVER   #Network File System server
 optionsNFSLOCKD#Network Lock Manager

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Oct 16 08:40:09 2012(r241603)
+++ head/sys/conf/files Tue Oct 16 09:55:31 2012(r241604)
@@ -2328,11 +2328,6 @@ fs/fuse/fuse_main.c  optional fuse
 fs/fuse/fuse_node.coptional fuse
 fs/fuse/fuse_vfsops.c  optional fuse
 fs/fuse/fuse_vnops.c   optional fuse
-fs/hpfs/hpfs_alsubr.c  optional hpfs
-fs/hpfs/hpfs_lookup.c  optional hpfs
-fs/hpfs/hpfs_subr.coptional hpfs
-fs/hpfs/hpfs_vfsops.c  optional hpfs
-fs/hpfs/hpfs_vnops.c   optional hpfs
 fs/msdosfs/msdosfs_conv.c  optional msdosfs
 fs/msdosfs/msdosfs_denode.coptional msdosfs
 fs/msdosfs/msdosfs_fat.c   optional msdosfs

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue Oct 16 08:40:09 2012(r241603)
+++ head/sys/conf/options   Tue Oct 16 09:55:31 2012(r241604)
@@ -212,7 +212,6 @@ EXT2FS  opt_dontuse.h
 FDESCFSopt_dontuse.h
 FFSopt_dontuse.h
 FUSE   opt_dontuse.h
-HPFS   opt_dontuse.h
 MSDOSFSopt_dontuse.h
 NANDFS opt_dontuse.h
 NTFS   opt_dontuse.h

Modified: head/sys/kern/Make.tags.inc
==
--- head/sys/kern/Make.tags.inc Tue Oct 16 08:40:09 2012(r241603)
+++ head/sys/kern/Make.tags.inc Tue Oct 16 09:55:31 2012(r241604)
@@ -27,7 +27,6 @@ COMM= ${SYS}/dev/advansys/*.[ch] \
${SYS}/fs/devfs/*.[ch] \
${SYS}/fs/fdescfs/*.[ch] \
${SYS}/fs/fifofs/*.[ch] \
-   ${SYS}/fs/hpfs/*.[ch] \
${SYS}/fs/msdosfs/*.[ch] \
${SYS}/fs/ntfs/*.[ch] \
${SYS}/fs/nullfs/*.[ch] \
___
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: r241605 - head/sys/dev/dpt

2012-10-16 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Oct 16 09:57:34 2012
New Revision: 241605
URL: http://svn.freebsd.org/changeset/base/241605

Log:
  Fix build of dpt(4).

Modified:
  head/sys/dev/dpt/dpt_scsi.c

Modified: head/sys/dev/dpt/dpt_scsi.c
==
--- head/sys/dev/dpt/dpt_scsi.c Tue Oct 16 09:55:31 2012(r241604)
+++ head/sys/dev/dpt/dpt_scsi.c Tue Oct 16 09:57:34 2012(r241605)
@@ -720,11 +720,11 @@ dptexecuteccb(void *arg, bus_dma_segment
unionccb *ccb;
struct   dpt_softc *dpt;
 
-   if (!dumping)
-   mtx_assert(&dpt->lock, MA_OWNED);
dccb = (struct dpt_ccb *)arg;
ccb = dccb->ccb;
dpt = (struct dpt_softc *)ccb->ccb_h.ccb_dpt_ptr;
+   if (!dumping)
+   mtx_assert(&dpt->lock, MA_OWNED);
 
if (error != 0) {
if (error != EFBIG)
___
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: r241606 - in head: etc/defaults etc/mtree include sbin/mount share/doc/smm/01.setup share/examples share/man/man7 sys/boot/forth sys/conf sys/kern sys/modules usr.sbin usr.sbin/crunch/e...

2012-10-16 Thread Attilio Rao
Author: attilio
Date: Tue Oct 16 09:59:10 2012
New Revision: 241606
URL: http://svn.freebsd.org/changeset/base/241606

Log:
  Disconnect non-MPSAFE PORTALFS from the build in preparation for dropping
  GIANT from VFS.
  
  This is not targeted for MFC.

Modified:
  head/etc/defaults/rc.conf
  head/etc/mtree/BSD.usr.dist
  head/include/Makefile
  head/sbin/mount/mount.8
  head/sbin/mount/mount.c
  head/share/doc/smm/01.setup/3.t
  head/share/doc/smm/01.setup/4.t
  head/share/examples/Makefile
  head/share/man/man7/hier.7
  head/sys/boot/forth/loader.conf
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/kern/Make.tags.inc
  head/sys/modules/Makefile
  head/usr.sbin/Makefile
  head/usr.sbin/crunch/examples/really-big.conf

Modified: head/etc/defaults/rc.conf
==
--- head/etc/defaults/rc.conf   Tue Oct 16 09:57:34 2012(r241605)
+++ head/etc/defaults/rc.conf   Tue Oct 16 09:59:10 2012(r241606)
@@ -92,7 +92,7 @@ fsck_y_enable="NO"# Set to YES to do fs
 fsck_y_flags=""# Additional flags for fsck -y
 background_fsck="YES"  # Attempt to run fsck in the background where possible.
 background_fsck_delay="60" # Time to wait (seconds) before starting the fsck.
-netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB portalfs:PORTAL nwfs:NWFS" # Net 
filesystems.
+netfs_types="nfs:NFS oldnfs:OLDNFS smbfs:SMB nwfs:NWFS" # Net filesystems.
 extra_netfs_types="NO" # List of network extra filesystem types for delayed
# mount at startup (or NO).
 

Modified: head/etc/mtree/BSD.usr.dist
==
--- head/etc/mtree/BSD.usr.dist Tue Oct 16 09:57:34 2012(r241605)
+++ head/etc/mtree/BSD.usr.dist Tue Oct 16 09:59:10 2012(r241606)
@@ -289,8 +289,6 @@
 ..
 pf
 ..
-portal
-..
 ppi
 ..
 ppp

Modified: head/include/Makefile
==
--- head/include/Makefile   Tue Oct 16 09:57:34 2012(r241605)
+++ head/include/Makefile   Tue Oct 16 09:59:10 2012(r241606)
@@ -44,7 +44,7 @@ LSUBDIRS= cam/ata cam/scsi \
dev/ofw dev/pbio ${_dev_powermac_nvram} dev/ppbus dev/smbus \
dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \
fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/ntfs fs/nullfs \
-   ${_fs_nwfs} fs/portalfs fs/procfs fs/smbfs fs/udf fs/unionfs \
+   ${_fs_nwfs} fs/procfs fs/smbfs fs/udf fs/unionfs \
geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
geom/mirror geom/mountver geom/multipath geom/nop \
geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \

Modified: head/sbin/mount/mount.8
==
--- head/sbin/mount/mount.8 Tue Oct 16 09:57:34 2012(r241605)
+++ head/sbin/mount/mount.8 Tue Oct 16 09:59:10 2012(r241606)
@@ -450,7 +450,6 @@ However, for the following file system t
 .Cm nwfs ,
 .Cm nullfs ,
 .Cm oldnfs ,
-.Cm portalfs ,
 .Cm smbfs ,
 .Cm udf ,
 and
@@ -548,7 +547,6 @@ support for a particular file system mig
 .Xr mount_ntfs 8 ,
 .Xr mount_nullfs 8 ,
 .Xr mount_nwfs 8 ,
-.Xr mount_portalfs 8 ,
 .Xr mount_smbfs 8 ,
 .Xr mount_udf 8 ,
 .Xr mount_unionfs 8 ,

Modified: head/sbin/mount/mount.c
==
--- head/sbin/mount/mount.c Tue Oct 16 09:57:34 2012(r241605)
+++ head/sbin/mount/mount.c Tue Oct 16 09:59:10 2012(r241606)
@@ -143,7 +143,7 @@ use_mountprog(const char *vfstype)
unsigned int i;
const char *fs[] = {
"cd9660", "mfs", "msdosfs", "nfs", "ntfs",
-   "nwfs", "nullfs", "oldnfs", "portalfs", "smbfs", "udf", "unionfs",
+   "nwfs", "nullfs", "oldnfs", "smbfs", "udf", "unionfs",
NULL
};
 

Modified: head/share/doc/smm/01.setup/3.t
==
--- head/share/doc/smm/01.setup/3.t Tue Oct 16 09:57:34 2012
(r241605)
+++ head/share/doc/smm/01.setup/3.t Tue Oct 16 09:59:10 2012
(r241606)
@@ -1237,10 +1237,8 @@ location that uses a different password 
 .PP
 Other new filesystems that may be stacked include the loopback filesystem
 .Xr mount_lofs (8),
-the kernel filesystem
-.Xr mount_kernfs (8),
-and the portal filesystem
-.Xr mount_portal (8).
+and the kernel filesystem
+.Xr mount_kernfs (8).
 .PP
 The buffer cache in the kernel is now organized as a file block cache
 rather than a device block cache.

Modified: head/share/doc/smm/01.setup/4.t
==
--- head/share/doc/smm/01.setup/4.t Tue Oct 16 09:57:34 2012
(r241605)
+++ hea

svn commit: r241607 - in head: . share/man/man5 sys/boot/forth sys/conf sys/modules

2012-10-16 Thread Attilio Rao
Author: attilio
Date: Tue Oct 16 10:04:00 2012
New Revision: 241607
URL: http://svn.freebsd.org/changeset/base/241607

Log:
  Disconnect non-MPSAFE XFS from the build in preparation for dropping
  GIANT from VFS.
  
  This is not targeted for MFC.

Modified:
  head/MAINTAINERS
  head/share/man/man5/Makefile
  head/sys/boot/forth/loader.conf
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/kern.pre.mk
  head/sys/conf/options
  head/sys/modules/Makefile

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Oct 16 09:59:10 2012(r241606)
+++ head/MAINTAINERSTue Oct 16 10:04:00 2012(r241607)
@@ -100,8 +100,6 @@ nfs alfred  Will be happy to review code
 rpc.lockd  alfred  Will be happy to review code, but not mandatory.
 truss  alfred  Will be happy to review code, but not mandatory.
 rpcalfred  Pre-commit review requested.
-xfsk...@freebsd.org,rodr...@freebsd.org,catte...@xfs.org
-   Pre-commit review preferred.
 pkg_installportmgr Pre-commit review or approval from portmgr@ requested.
 linux emul emulation   Please discuss changes here.
 bs{diff,patch} cpercivaPre-commit review requested.

Modified: head/share/man/man5/Makefile
==
--- head/share/man/man5/MakefileTue Oct 16 09:59:10 2012
(r241606)
+++ head/share/man/man5/MakefileTue Oct 16 10:04:00 2012
(r241607)
@@ -68,8 +68,7 @@ MAN=  acct.5 \
stab.5 \
style.Makefile.5 \
sysctl.conf.5 \
-   tmpfs.5 \
-   xfs.5
+   tmpfs.5
 
 MLINKS=dir.5 dirent.5
 MLINKS+=fs.5 inode.5

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Tue Oct 16 09:59:10 2012
(r241606)
+++ head/sys/boot/forth/loader.conf Tue Oct 16 10:04:00 2012
(r241607)
@@ -175,7 +175,6 @@ nullfs_load="NO"# Null filesystem
 procfs_load="NO"   # Process filesystem
 reiserfs_load="NO" # ReiserFS
 unionfs_load="NO"  # Union filesystem
-xfs_load="NO"  # XFS
 zfs_load="NO"  # ZFS
 
 # Related stuff

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Oct 16 09:59:10 2012(r241606)
+++ head/sys/conf/NOTES Tue Oct 16 10:04:00 2012(r241607)
@@ -1106,12 +1106,6 @@ options  EXT2FS
 #
 optionsREISERFS
 
-#
-# Add support for the SGI XFS filesystem. Currently,
-# this is limited to read-only access.
-#
-optionsXFS
-
 # Use real implementations of the aio_* system calls.  There are numerous
 # stability and security issues in the current aio code that make it
 # unsuitable for inclusion on machines with untrusted local users.

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Oct 16 09:59:10 2012(r241606)
+++ head/sys/conf/files Tue Oct 16 10:04:00 2012(r241607)
@@ -3632,142 +3632,6 @@ xdr/xdr_mbuf.c  optional krpc | nfslock
 xdr/xdr_mem.c  optional krpc | nfslockd | nfsclient | 
nfsserver | nfscl | nfsd
 xdr/xdr_reference.coptional krpc | nfslockd | nfsclient | 
nfsserver | nfscl | nfsd
 xdr/xdr_sizeof.c   optional krpc | nfslockd | nfsclient | 
nfsserver | nfscl | nfsd
-#
-gnu/fs/xfs/xfs_alloc.c optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs" \
-   warning "kernel contains GPL contaminated xfs filesystem"
-gnu/fs/xfs/xfs_alloc_btree.c   optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_bit.c   optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_bmap.c  optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_bmap_btree.coptional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_btree.c optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_buf_item.c  optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_da_btree.c  optional xfs \
-   compile-with "${NORMAL_C} -I$S/gnu/fs/xfs/FreeBSD 
-I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs"
-gnu/fs/xfs/xfs_dir.c   optional xfs \

svn commit: r241608 - in head: share/man/man4 sys/boot/forth sys/conf sys/modules

2012-10-16 Thread Attilio Rao
Author: attilio
Date: Tue Oct 16 10:09:21 2012
New Revision: 241608
URL: http://svn.freebsd.org/changeset/base/241608

Log:
  Disconnect non-MPSAFE CODAFS from the build in preparation for dropping
  GIANT from VFS.
  
  This is not targeted for MFC.

Modified:
  head/share/man/man4/Makefile
  head/sys/boot/forth/loader.conf
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue Oct 16 10:04:00 2012
(r241607)
+++ head/share/man/man4/MakefileTue Oct 16 10:09:21 2012
(r241608)
@@ -93,7 +93,6 @@ MAN=  aac.4 \
ciss.4 \
cm.4 \
cmx.4 \
-   coda.4 \
${_coretemp.4} \
${_cpuctl.4} \
cpufreq.4 \

Modified: head/sys/boot/forth/loader.conf
==
--- head/sys/boot/forth/loader.conf Tue Oct 16 10:04:00 2012
(r241607)
+++ head/sys/boot/forth/loader.conf Tue Oct 16 10:09:21 2012
(r241608)
@@ -162,7 +162,6 @@ atavia_load="NO"# VIA Technologies Inc
 # Filesystems
 
 cd9660_load="NO"   # ISO 9660 filesystem
-coda_load="NO" # CODA filesystem
 fdescfs_load="NO"  # Filedescriptors filesystem
 linprocfs_load="NO"# Linux compatibility process filesystem
 linsysfs_load="NO" # Linux compatibility system filesystem

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Tue Oct 16 10:04:00 2012(r241607)
+++ head/sys/conf/NOTES Tue Oct 16 10:09:21 2012(r241608)
@@ -1085,13 +1085,6 @@ options  NFS_GATHERDELAY=10  # Default wr
 optionsNFS_WDELAYHASHSIZ=16# and with this
 optionsNFS_DEBUG   # Enable NFS Debugging
 
-# Coda stuff:
-optionsCODA#CODA filesystem.
-device vcoda   #coda minicache <-> venus comm.
-# Use the old Coda 5.x venus<->kernel interface instead of the new
-# realms-aware 6.x protocol.
-#options   CODA_COMPAT_5
-
 #
 # Add support for the EXT2FS filesystem of Linux fame.  Be a bit
 # careful with this - the ext2fs code has a tendency to lag behind

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Oct 16 10:04:00 2012(r241607)
+++ head/sys/conf/files Tue Oct 16 10:09:21 2012(r241608)
@@ -2304,12 +2304,6 @@ dev/xe/if_xe.c   optional xe
 dev/xe/if_xe_pccard.c  optional xe pccard
 dev/xl/if_xl.c optional xl pci
 dev/xl/xlphy.c optional xl pci
-fs/coda/coda_fbsd.coptional vcoda
-fs/coda/coda_psdev.c   optional vcoda
-fs/coda/coda_subr.coptional vcoda
-fs/coda/coda_venus.c   optional vcoda
-fs/coda/coda_vfsops.c  optional vcoda
-fs/coda/coda_vnops.c   optional vcoda
 fs/deadfs/dead_vnops.c standard
 fs/devfs/devfs_devs.c  standard
 fs/devfs/devfs_dir.c   standard

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Tue Oct 16 10:04:00 2012(r241607)
+++ head/sys/conf/options   Tue Oct 16 10:09:21 2012(r241608)
@@ -68,7 +68,6 @@ ALQ
 AUDIT  opt_global.h
 CAPABILITIES   opt_capsicum.h
 CAPABILITY_MODEopt_capsicum.h
-CODA_COMPAT_5  opt_coda.h
 COMPAT_43  opt_compat.h
 COMPAT_43TTY   opt_compat.h
 COMPAT_FREEBSD4opt_compat.h
@@ -207,7 +206,6 @@ INCLUDE_CONFIG_FILE opt_config.h
 # dependencies.  Unusability is enforced by hiding the defines for the
 # options in a never-included header.
 CD9660 opt_dontuse.h
-CODA   opt_dontuse.h
 EXT2FS opt_dontuse.h
 FDESCFSopt_dontuse.h
 FFSopt_dontuse.h

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue Oct 16 10:04:00 2012(r241607)
+++ head/sys/modules/Makefile   Tue Oct 16 10:09:21 2012(r241608)
@@ -67,8 +67,6 @@ SUBDIR=   \
${_ciss} \
${_cm} \
${_cmx} \
-   coda \
-   coda5 \
${_coff} \
${_coretemp} \
${_cp} \
___
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: r241603 - head/sys/dev/aha

2012-10-16 Thread John Baldwin
On Tuesday, October 16, 2012 4:40:09 am Gleb Smirnoff wrote:
> Author: glebius
> Date: Tue Oct 16 08:40:09 2012
> New Revision: 241603
> URL: http://svn.freebsd.org/changeset/base/241603
> 
> Log:
>   Fix build of aha(4).
>   
>   Submitted by:   delphij
> 
> Modified:
>   head/sys/dev/aha/aha.c
>   head/sys/dev/aha/aha_isa.c
>   head/sys/dev/aha/ahareg.h

My apologies for this and dpt(4). :(

I have done various 'make tinderbox' runs on the branch these changes lived in 
(and I had built the dpt module before commit, but perhaps only clang reported 
the warning?), but apparently they must have been before I had done these 
changes.

-- 
John Baldwin
___
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: r241610 - in head: . sys/dev/usb sys/net sys/net80211 sys/netpfil/ipfw sys/netpfil/pf sys/sys

2012-10-16 Thread Gleb Smirnoff
Author: glebius
Date: Tue Oct 16 13:37:54 2012
New Revision: 241610
URL: http://svn.freebsd.org/changeset/base/241610

Log:
  Make the "struct if_clone" opaque to users of the cloning API. Users
  now use function calls:
  
if_clone_simple()
if_clone_advanced()
  
  to initialize a cloner, instead of macros that initialize if_clone
  structure.
  
  Discussed with:   brooks, bz, 1 year ago

Modified:
  head/UPDATING
  head/sys/dev/usb/usb_pf.c
  head/sys/net/if_bridge.c
  head/sys/net/if_clone.c
  head/sys/net/if_clone.h
  head/sys/net/if_disc.c
  head/sys/net/if_edsc.c
  head/sys/net/if_enc.c
  head/sys/net/if_epair.c
  head/sys/net/if_faith.c
  head/sys/net/if_gif.c
  head/sys/net/if_gre.c
  head/sys/net/if_lagg.c
  head/sys/net/if_loop.c
  head/sys/net/if_stf.c
  head/sys/net/if_tap.c
  head/sys/net/if_tun.c
  head/sys/net/if_vlan.c
  head/sys/net80211/ieee80211_freebsd.c
  head/sys/netpfil/ipfw/ip_fw_log.c
  head/sys/netpfil/pf/if_pflog.c
  head/sys/netpfil/pf/if_pfsync.c
  head/sys/sys/param.h

Modified: head/UPDATING
==
--- head/UPDATING   Tue Oct 16 13:27:20 2012(r241609)
+++ head/UPDATING   Tue Oct 16 13:37:54 2012(r241610)
@@ -24,6 +24,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20121016:
+   The interface cloning API and ABI has changed. The following
+   modules need to be recompiled together with kernel:
+   ipfw(4), pfsync(4), pflog(4), usb(4), wlan(4), stf(4),
+   vlan(4), disc(4), edsc(4), if_bridge(4), gif(4), tap(4),
+   faith(4), epair(4), enc(4), tun(4), if_lagg(4), gre(4).
+
 20121015:
The sdhci driver was split in two parts: sdhci (generic SD Host
Controller logic) and sdhci_pci (actual hardware driver).

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Tue Oct 16 13:27:20 2012(r241609)
+++ head/sys/dev/usb/usb_pf.c   Tue Oct 16 13:37:54 2012(r241610)
@@ -60,8 +60,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#defineUSBUSNAME   "usbus"
-
 static void usbpf_init(void);
 static void usbpf_uninit(void);
 static int usbpf_ioctl(struct ifnet *, u_long, caddr_t);
@@ -74,9 +72,8 @@ static uint32_t usbpf_aggregate_status(s
 static int usbpf_xfer_frame_is_read(struct usb_xfer *, uint32_t);
 static uint32_t usbpf_xfer_precompute_size(struct usb_xfer *, int);
 
-static struct if_clone usbpf_cloner = IFC_CLONE_INITIALIZER(
-USBUSNAME, NULL, IF_MAXUNIT,
-NULL, usbpf_clone_match, usbpf_clone_create, usbpf_clone_destroy);
+static struct if_clone *usbpf_cloner;
+static const char usbusname[] = "usbus";
 
 SYSINIT(usbpf_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_init, NULL);
 SYSUNINIT(usbpf_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, usbpf_uninit, NULL);
@@ -85,7 +82,8 @@ static void
 usbpf_init(void)
 {
 
-   if_clone_attach(&usbpf_cloner);
+   usbpf_cloner = if_clone_advanced(usbusname, 0, usbpf_clone_match,
+   usbpf_clone_create, usbpf_clone_destroy);
 }
 
 static void
@@ -98,9 +96,9 @@ usbpf_uninit(void)
int error;
int i;

-   if_clone_detach(&usbpf_cloner);
+   if_clone_detach(usbpf_cloner);
 
-   dc = devclass_find(USBUSNAME);
+   dc = devclass_find(usbusname);
if (dc == NULL)
return;
error = devclass_get_devices(dc, &devlp, &devlcnt);
@@ -109,7 +107,7 @@ usbpf_uninit(void)
for (i = 0; i < devlcnt; i++) {
ubus = device_get_softc(devlp[i]);
if (ubus != NULL && ubus->ifp != NULL)
-   usbpf_clone_destroy(&usbpf_cloner, ubus->ifp);
+   usbpf_clone_destroy(usbpf_cloner, ubus->ifp);
}
free(devlp, M_TEMP);
 }
@@ -130,12 +128,12 @@ usbpf_ifname2ubus(const char *ifname)
int unit;
int error;
 
-   if (strncmp(ifname, USBUSNAME, sizeof(USBUSNAME) - 1) != 0)
+   if (strncmp(ifname, usbusname, sizeof(usbusname) - 1) != 0)
return (NULL);
error = ifc_name2unit(ifname, &unit);
if (error || unit < 0)
return (NULL);
-   dc = devclass_find(USBUSNAME);
+   dc = devclass_find(usbusname);
if (dc == NULL)
return (NULL);
dev = devclass_get_device(dc, unit);
@@ -195,7 +193,7 @@ usbpf_clone_create(struct if_clone *ifc,
}
strlcpy(ifp->if_xname, name, sizeof(ifp->if_xname));
ifp->if_softc = ubus;
-   ifp->if_dname = ifc->ifc_name;
+   ifp->if_dname = usbusname;
ifp->if_dunit = unit;
ifp->if_ioctl = usbpf_ioctl;
if_attach(i

svn commit: r241611 - head/sys/dev/aha

2012-10-16 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Oct 16 15:25:04 2012
New Revision: 241611
URL: http://svn.freebsd.org/changeset/base/241611

Log:
  Fix aha(4) build with i386 LINT (which includes 'device mca').

Modified:
  head/sys/dev/aha/aha_mca.c

Modified: head/sys/dev/aha/aha_mca.c
==
--- head/sys/dev/aha/aha_mca.c  Tue Oct 16 13:37:54 2012(r241610)
+++ head/sys/dev/aha/aha_mca.c  Tue Oct 16 15:25:04 2012(r241611)
@@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -191,7 +192,7 @@ aha_mca_attach (device_t dev)
}
 
error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY |
-   INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih);
+   INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih);
if (error) {
device_printf(dev, "Unable to register interrupt handler\n");
aha_detach(sc);
___
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: r241612 - head/usr.bin/bmake

2012-10-16 Thread David E. O'Brien
Author: obrien
Date: Tue Oct 16 15:43:16 2012
New Revision: 241612
URL: http://svn.freebsd.org/changeset/base/241612

Log:
  Obey the value of "MK_BMAKE".

Modified:
  head/usr.bin/bmake/Makefile.inc

Modified: head/usr.bin/bmake/Makefile.inc
==
--- head/usr.bin/bmake/Makefile.inc Tue Oct 16 15:25:04 2012
(r241611)
+++ head/usr.bin/bmake/Makefile.inc Tue Oct 16 15:43:16 2012
(r241612)
@@ -7,7 +7,7 @@
 .export SRCTOP
 .endif
 
-.if defined(MK_BMAKE)
+.if ${MK_BMAKE} != "no"
 PROG= make
 .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"


svn commit: r241613 - head/sys/cam/scsi

2012-10-16 Thread Eitan Adler
Author: eadler
Date: Tue Oct 16 17:49:14 2012
New Revision: 241613
URL: http://svn.freebsd.org/changeset/base/241613

Log:
  Add support for samsung HM250JI
  
  PR:   usb/121474
  Submitted by: Ben Stuyts 
  Approved by:  cperciva (implicit)
  MFC after:3 days

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Tue Oct 16 15:43:16 2012(r241612)
+++ head/sys/cam/scsi/scsi_da.c Tue Oct 16 17:49:14 2012(r241613)
@@ -844,6 +844,15 @@ static struct da_quirk_entry da_quirk_ta
{T_DIRECT, SIP_MEDIA_REMOVABLE, "USB 2.0", "(HS) Flash Disk",
"*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE
},
+   {
+   /*
+* LaCie external 250GB Hard drive des by Porsche
+* Submitted by: Ben Stuyts 
+* PR: 121474
+*/
+   {T_DIRECT, SIP_MEDIA_FIXED, "SAMSUNG", "HM250JI", "*"},
+   /*quirks*/ DA_Q_NO_SYNC_CACHE
+   },
 };
 
 static disk_strategy_t dastrategy;
___
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: r241616 - in head/sys: dev/ixgbe net

2012-10-16 Thread Maksim Yevmenkin
Author: emax
Date: Tue Oct 16 20:18:15 2012
New Revision: 241616
URL: http://svn.freebsd.org/changeset/base/241616

Log:
  introduce concept of ifi_baudrate power factor. the idea is to work
  around the problem where high speed interfaces (such as ixgbe(4))
  are not able to report real ifi_baudrate. bascially, take a spare
  byte from struct if_data and use it to store ifi_baudrate power
  factor. in other words,
  
  real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor
  
  this should be backwards compatible with old binaries. use ixgbe(4)
  as an example on how drivers would set ifi_baudrate power factor
  
  Discussed with:   kib, scottl, glebius
  MFC after:1 week

Modified:
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/net/if.h
  head/sys/net/if_var.h

Modified: head/sys/dev/ixgbe/ixgbe.c
==
--- head/sys/dev/ixgbe/ixgbe.c  Tue Oct 16 19:59:13 2012(r241615)
+++ head/sys/dev/ixgbe/ixgbe.c  Tue Oct 16 20:18:15 2012(r241616)
@@ -2597,7 +2597,8 @@ ixgbe_setup_interface(device_t dev, stru
return (-1);
}
if_initname(ifp, device_get_name(dev), device_get_unit(dev));
-   ifp->if_baudrate = 10;
+   ifp->if_baudrate = IF_Gbps(1);
+   ifp->if_baudrate_pf = 1;/* 1Gbps * 10^1 = 10Gbps */
ifp->if_init = ixgbe_init;
ifp->if_softc = adapter;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;

Modified: head/sys/net/if.h
==
--- head/sys/net/if.h   Tue Oct 16 19:59:13 2012(r241615)
+++ head/sys/net/if.h   Tue Oct 16 20:18:15 2012(r241616)
@@ -86,7 +86,7 @@ struct if_data {
u_char  ifi_hdrlen; /* media header length */
u_char  ifi_link_state; /* current link state */
u_char  ifi_vhid;   /* carp vhid */
-   u_char  ifi_spare_char2;/* spare byte */
+   u_char  ifi_baudrate_pf;/* baudrate power factor */
u_char  ifi_datalen;/* length of this data struct */
u_long  ifi_mtu;/* maximum transmission unit */
u_long  ifi_metric; /* routing metric (external only) */

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Tue Oct 16 19:59:13 2012(r241615)
+++ head/sys/net/if_var.h   Tue Oct 16 20:18:15 2012(r241616)
@@ -228,6 +228,7 @@ typedef void if_init_f_t(void *);
 #defineif_metric   if_data.ifi_metric
 #defineif_link_state   if_data.ifi_link_state
 #defineif_baudrate if_data.ifi_baudrate
+#defineif_baudrate_pf  if_data.ifi_baudrate_pf
 #defineif_hwassist if_data.ifi_hwassist
 #defineif_ipackets if_data.ifi_ipackets
 #defineif_ierrors  if_data.ifi_ierrors
___
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: r241616 - in head/sys: dev/ixgbe net

2012-10-16 Thread John Baldwin
On Tuesday, October 16, 2012 4:18:16 pm Maksim Yevmenkin wrote:
> Author: emax
> Date: Tue Oct 16 20:18:15 2012
> New Revision: 241616
> URL: http://svn.freebsd.org/changeset/base/241616
> 
> Log:
>   introduce concept of ifi_baudrate power factor. the idea is to work
>   around the problem where high speed interfaces (such as ixgbe(4))
>   are not able to report real ifi_baudrate. bascially, take a spare
>   byte from struct if_data and use it to store ifi_baudrate power
>   factor. in other words,
>   
>   real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor
>   
>   this should be backwards compatible with old binaries. use ixgbe(4)
>   as an example on how drivers would set ifi_baudrate power factor
>   
>   Discussed with: kib, scottl, glebius
>   MFC after:  1 week

It would be a lot nicer if you could still allow one to use more
readable things like IF_Gbps(10).  Note that we do have a 40G driver
(mlxen) as well.

Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT.
(It could be a static inline or some such).  I would just like to
keep the readability.

-- 
John Baldwin
___
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: r241616 - in head/sys: dev/ixgbe net

2012-10-16 Thread Maksim Yevmenkin
On Tue, Oct 16, 2012 at 2:02 PM, John Baldwin  wrote:
> On Tuesday, October 16, 2012 4:18:16 pm Maksim Yevmenkin wrote:
>> Author: emax
>> Date: Tue Oct 16 20:18:15 2012
>> New Revision: 241616
>> URL: http://svn.freebsd.org/changeset/base/241616
>>
>> Log:
>>   introduce concept of ifi_baudrate power factor. the idea is to work
>>   around the problem where high speed interfaces (such as ixgbe(4))
>>   are not able to report real ifi_baudrate. bascially, take a spare
>>   byte from struct if_data and use it to store ifi_baudrate power
>>   factor. in other words,
>>
>>   real ifi_baudrate = ifi_baudrate * 10 ^ ifi_baudrate power factor
>>
>>   this should be backwards compatible with old binaries. use ixgbe(4)
>>   as an example on how drivers would set ifi_baudrate power factor
>>
>>   Discussed with: kib, scottl, glebius
>>   MFC after:  1 week
>
> It would be a lot nicer if you could still allow one to use more
> readable things like IF_Gbps(10).  Note that we do have a 40G driver
> (mlxen) as well.
>
> Maybe a helper 'if_set_baudrate(ifp, IF_Gbps(10))' that would DTRT.
> (It could be a static inline or some such).  I would just like to
> keep the readability.

well, yes, i thought about it, but decided not to do it right away. we
could provide shortcuts/macros for "popular" baudrates, i.e. 1, 10, 40
and 100 Gbps. while ixgbe(4) example is not ideal, i thought it still
was pretty readable :)

thanks,
max
___
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: r241618 - head/usr.sbin/cron/lib

2012-10-16 Thread Maxim Sobolev
Author: sobomax
Date: Tue Oct 16 21:34:02 2012
New Revision: 241618
URL: http://svn.freebsd.org/changeset/base/241618

Log:
  Properly handle non-keyword case by setting e->second to 0.

Modified:
  head/usr.sbin/cron/lib/entry.c

Modified: head/usr.sbin/cron/lib/entry.c
==
--- head/usr.sbin/cron/lib/entry.c  Tue Oct 16 20:24:54 2012
(r241617)
+++ head/usr.sbin/cron/lib/entry.c  Tue Oct 16 21:34:02 2012
(r241618)
@@ -222,6 +222,7 @@ load_entry(file, error_func, pw, envp)
}
} else {
Debug(DPARS, ("load_entry()...about to parse numerics\n"))
+   bit_set(e->second, 0);
 
ch = get_list(e->minute, FIRST_MINUTE, LAST_MINUTE,
  PPC_NULL, ch, file);
___
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: r241619 - head/sys/net

2012-10-16 Thread Maksim Yevmenkin
Author: emax
Date: Tue Oct 16 22:43:14 2012
New Revision: 241619
URL: http://svn.freebsd.org/changeset/base/241619

Log:
  report total number of ports for each lagg(4) interface
  via net.link.lagg.X.count sysctl
  
  MFC after:1  week

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Tue Oct 16 21:34:02 2012(r241618)
+++ head/sys/net/if_lagg.c  Tue Oct 16 22:43:14 2012(r241619)
@@ -288,6 +288,9 @@ lagg_clone_create(struct if_clone *ifc, 
SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, 
sc->use_flowid,
"Use flow id for load sharing");
+   SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "count", CTLTYPE_INT|CTLFLAG_RO, &sc->sc_count, sc->sc_count,
+   "Total number of ports");
/* Hash all layers by default */
sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4;
 
___
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: r241576 - in head/usr.sbin/cron: cron crontab lib

2012-10-16 Thread Adrian Chadd
On 16 October 2012 00:06, Maxim Sobolev  wrote:

> I am working on improved version, so that in the absence of @every_second it
> would revert to the previous behavior. Even though I seriously doubt that
> few thousand additional CPU cycles every second would make any measurable
> differences in any practical application.

Please don't assume that "a few thousand CPU cycles every second"
translates to "nothing consequential." You have to wake the CPU up
when it may not need to be waked up (which takes power and time just
to do, before you run anything), all the scheduler stuff and VM code
will get run, these consume cycles and power.

Remember, CPU cycles doesn't not mean "power consumed" or "time taken."

Some of us are becoming to increasingly care about how power efficient
the base system is (both in terms of CPU used, wakeups done, code
size, etc.) and this is honestly a step backwards in that direction.

Thanks,



Adrian
___
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: r241625 - head/usr.sbin/cron/cron

2012-10-16 Thread Maxim Sobolev
Author: sobomax
Date: Wed Oct 17 00:44:34 2012
New Revision: 241625
URL: http://svn.freebsd.org/changeset/base/241625

Log:
  o Use nanosleep(2) to sleep exact amount of time till the next second,
  not multiple of 1 second, which results in actual time to drift back
  and forth every run within 1 second of the actual action has
  been set for.
  
  Suggested by:   Ian Lepore
  
  o Schedule the first run in 1 second after starting up, not on the
  boundary of the next minute, which results in the every_second jobs
  not being run.

Modified:
  head/usr.sbin/cron/cron/cron.c

Modified: head/usr.sbin/cron/cron/cron.c
==
--- head/usr.sbin/cron/cron/cron.c  Wed Oct 17 00:33:10 2012
(r241624)
+++ head/usr.sbin/cron/cron/cron.c  Wed Oct 17 00:44:34 2012
(r241625)
@@ -341,37 +341,73 @@ cron_tick(db)
  */
 static void
 cron_sync() {
+#if 0
register struct tm  *tm;
+#endif
 
-   TargetTime = time((time_t*)0);
+   TargetTime = time((time_t*)0) + 1;
+#if 0
tm = localtime(&TargetTime);
TargetTime += (60 - tm->tm_sec);
+#endif
 }
 
+static int
+timeval_subtract(struct timespec *result, struct timeval *x, struct timeval *y)
+{
+   int nsec;
+
+   /* Perform the carry for the later subtraction by updating y. */
+   if (x->tv_usec < y->tv_usec) {
+   nsec = (y->tv_usec - x->tv_usec) / 100 + 1;
+   y->tv_usec -= 100 * nsec;
+   y->tv_sec += nsec;
+   }
+   if (x->tv_usec - y->tv_usec > 100) {
+   nsec = (x->tv_usec - y->tv_usec) / 100;
+   y->tv_usec += 100 * nsec;
+   y->tv_sec -= nsec;
+   }
+ 
+   /* tv_nsec is certainly positive. */
+   result->tv_sec = x->tv_sec - y->tv_sec;
+   result->tv_nsec = (x->tv_usec - y->tv_usec) * 1000;
+ 
+   /* Return difference in seconds */
+   return (x->tv_sec - y->tv_sec);
+}
 
 static void
 cron_sleep(db)
cron_db *db;
 {
-   int seconds_to_wait = 0;
+   int seconds_to_wait;
+   int rval;
+   struct timeval ctime, ttime;
+   struct timespec stime, remtime;
 
/*
 * Loop until we reach the top of the next minute, sleep when possible.
 */
 
for (;;) {
-   seconds_to_wait = (int) (TargetTime - time((time_t*)0));
+   gettimeofday(&ctime, NULL);
+   ttime.tv_sec = TargetTime;
+   ttime.tv_usec = 0;
+   timeval_subtract(&stime, &ttime, &ctime);
 
/*
 * If the seconds_to_wait value is insane, jump the cron
 */
 
-   if (seconds_to_wait < -600 || seconds_to_wait > 600) {
+   if (stime.tv_sec < -600 || stime.tv_sec > 600) {
cron_clean(db);
cron_sync();
continue;
}
 
+   seconds_to_wait = (stime.tv_nsec > 0) ? stime.tv_sec + 1 : 
stime.tv_sec;
+
Debug(DSCH, ("[%d] TargetTime=%ld, sec-to-wait=%d\n",
getpid(), (long)TargetTime, seconds_to_wait))
 
@@ -380,13 +416,19 @@ cron_sleep(db)
 * to run, break
 */
 
-   if (seconds_to_wait <= 0)
+   if (stime.tv_sec < 0)
break;
if (job_runqueue() == 0) {
Debug(DSCH, ("[%d] sleeping for %d seconds\n",
getpid(), seconds_to_wait))
 
-   sleep(seconds_to_wait);
+   for (;;) {
+   rval = nanosleep(&stime, &remtime);
+   if (rval == 0 || errno != EINTR)
+   break;
+   stime.tv_sec = remtime.tv_sec;
+   stime.tv_nsec = remtime.tv_nsec;
+   }
}
}
 }
___
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: r241626 - head/sys/dev/cxgbe/tom

2012-10-16 Thread Navdeep Parhar
Author: np
Date: Wed Oct 17 05:08:35 2012
New Revision: 241626
URL: http://svn.freebsd.org/changeset/base/241626

Log:
  Whitespace cleanup.
  
  MFC after:3 days

Modified:
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_listen.c

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Wed Oct 17 00:44:34 2012
(r241625)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Wed Oct 17 05:08:35 2012
(r241626)
@@ -73,8 +73,8 @@ VNET_DECLARE(int, tcp_autorcvbuf_max);
 void
 send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp)
 {
-struct wrqe *wr;
-struct fw_flowc_wr *flowc;
+   struct wrqe *wr;
+   struct fw_flowc_wr *flowc;
unsigned int nparams = ftxp ? 8 : 4, flowclen;
struct port_info *pi = toep->port;
struct adapter *sc = pi->adapter;
@@ -102,13 +102,13 @@ send_flowc_wr(struct toepcb *toep, struc
V_FW_WR_FLOWID(toep->tid));
 
flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;
-flowc->mnemval[0].val = htobe32(pfvf);
-flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
-flowc->mnemval[1].val = htobe32(pi->tx_chan);
-flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT;
-flowc->mnemval[2].val = htobe32(pi->tx_chan);
-flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID;
-flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id);
+   flowc->mnemval[0].val = htobe32(pfvf);
+   flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
+   flowc->mnemval[1].val = htobe32(pi->tx_chan);
+   flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT;
+   flowc->mnemval[2].val = htobe32(pi->tx_chan);
+   flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID;
+   flowc->mnemval[3].val = htobe32(toep->ofld_rxq->iq.abs_id);
if (ftxp) {
uint32_t sndbuf = min(ftxp->snd_space, sc->tt.sndbuf);
 

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Wed Oct 17 00:44:34 2012
(r241625)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Wed Oct 17 05:08:35 2012
(r241626)
@@ -271,8 +271,8 @@ send_reset_synqe(struct toedev *tod, str
struct ifnet *ifp = m->m_pkthdr.rcvif;
struct port_info *pi = ifp->if_softc;
struct l2t_entry *e = &sc->l2t->l2tab[synqe->l2e_idx];
-struct wrqe *wr;
-struct fw_flowc_wr *flowc;
+   struct wrqe *wr;
+   struct fw_flowc_wr *flowc;
struct cpl_abort_req *req;
int txqid, rxqid, flowclen;
struct sge_wrq *ofld_txq;
@@ -312,13 +312,13 @@ send_reset_synqe(struct toedev *tod, str
flowc->flowid_len16 = htonl(V_FW_WR_LEN16(howmany(flowclen, 16)) |
V_FW_WR_FLOWID(synqe->tid));
flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;
-flowc->mnemval[0].val = htobe32(pfvf);
-flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
-flowc->mnemval[1].val = htobe32(pi->tx_chan);
-flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT;
-flowc->mnemval[2].val = htobe32(pi->tx_chan);
-flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID;
-flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id);
+   flowc->mnemval[0].val = htobe32(pfvf);
+   flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
+   flowc->mnemval[1].val = htobe32(pi->tx_chan);
+   flowc->mnemval[2].mnemonic = FW_FLOWC_MNEM_PORT;
+   flowc->mnemval[2].val = htobe32(pi->tx_chan);
+   flowc->mnemval[3].mnemonic = FW_FLOWC_MNEM_IQID;
+   flowc->mnemval[3].val = htobe32(ofld_rxq->iq.abs_id);
synqe->flags |= TPF_FLOWC_WR_SENT;
 
/* ... then ABORT request */
___
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"