svn commit: r256594 - head/usr.sbin/freebsd-update

2013-10-16 Thread Colin Percival
Author: cperciva
Date: Wed Oct 16 08:19:58 2013
New Revision: 256594
URL: http://svnweb.freebsd.org/changeset/base/256594

Log:
  Speed up `freebsd-update IDS` by using IFS to split fields instead of
  forking lots of processes to run echo|cut.  In one test this reduced
  the CPU time from 980s to 134s and the wallclock time from 806s to
  132s.
  
  Submitted by: Oleg Ginzburg

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 16 08:14:05 
2013(r256593)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 16 08:19:58 
2013(r256594)
@@ -3033,21 +3033,8 @@ IDS_compare () {
mv INDEX-NOTMATCHING.tmp INDEX-NOTMATCHING
 
# Go through the lines and print warnings.
-   while read LINE; do
-   FPATH=`echo "${LINE}" | cut -f 1 -d '|'`
-   TYPE=`echo "${LINE}" | cut -f 2 -d '|'`
-   OWNER=`echo "${LINE}" | cut -f 3 -d '|'`
-   GROUP=`echo "${LINE}" | cut -f 4 -d '|'`
-   PERM=`echo "${LINE}" | cut -f 5 -d '|'`
-   HASH=`echo "${LINE}" | cut -f 6 -d '|'`
-   LINK=`echo "${LINE}" | cut -f 7 -d '|'`
-   P_TYPE=`echo "${LINE}" | cut -f 8 -d '|'`
-   P_OWNER=`echo "${LINE}" | cut -f 9 -d '|'`
-   P_GROUP=`echo "${LINE}" | cut -f 10 -d '|'`
-   P_PERM=`echo "${LINE}" | cut -f 11 -d '|'`
-   P_HASH=`echo "${LINE}" | cut -f 12 -d '|'`
-   P_LINK=`echo "${LINE}" | cut -f 13 -d '|'`
-
+   local IFS='|'
+   while read FPATH TYPE OWNER GROUP PERM HASH LINK P_TYPE P_OWNER P_GROUP 
P_PERM P_HASH P_LINK; do
# Warn about different object types.
if ! [ "${TYPE}" = "${P_TYPE}" ]; then
echo -n "${FPATH} is a "
___
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: r256603 - in head/sys: geom kern sys

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:12:40 2013
New Revision: 256603
URL: http://svnweb.freebsd.org/changeset/base/256603

Log:
  MFprojects/camlock r254905:
  Introduce new function devstat_end_transaction_bio_bt(), adding new argument
  to specify present time.  Use this function to move binuptime() out of lock,
  substantially reducing lock congestion when slow timecounter is used.

Modified:
  head/sys/geom/geom_disk.c
  head/sys/geom/geom_io.c
  head/sys/kern/subr_devstat.c
  head/sys/sys/devicestat.h

Modified: head/sys/geom/geom_disk.c
==
--- head/sys/geom/geom_disk.c   Wed Oct 16 09:05:49 2013(r256602)
+++ head/sys/geom/geom_disk.c   Wed Oct 16 09:12:40 2013(r256603)
@@ -229,6 +229,7 @@ g_disk_setstate(struct bio *bp, struct g
 static void
 g_disk_done(struct bio *bp)
 {
+   struct bintime now;
struct bio *bp2;
struct g_disk_softc *sc;
 
@@ -237,12 +238,13 @@ g_disk_done(struct bio *bp)
bp2 = bp->bio_parent;
sc = bp2->bio_to->private;
bp->bio_completed = bp->bio_length - bp->bio_resid;
+   binuptime(&now);
mtx_lock(&sc->done_mtx);
if (bp2->bio_error == 0)
bp2->bio_error = bp->bio_error;
bp2->bio_completed += bp->bio_completed;
if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0)
-   devstat_end_transaction_bio(sc->dp->d_devstat, bp);
+   devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now);
g_destroy_bio(bp);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {

Modified: head/sys/geom/geom_io.c
==
--- head/sys/geom/geom_io.c Wed Oct 16 09:05:49 2013(r256602)
+++ head/sys/geom/geom_io.c Wed Oct 16 09:12:40 2013(r256603)
@@ -511,6 +511,7 @@ g_io_request(struct bio *bp, struct g_co
 void
 g_io_deliver(struct bio *bp, int error)
 {
+   struct bintime now;
struct g_consumer *cp;
struct g_provider *pp;
int first;
@@ -564,11 +565,13 @@ g_io_deliver(struct bio *bp, int error)
 * can not update one instance of the statistics from more
 * than one thread at a time, so grab the lock first.
 */
+   if (g_collectstats)
+   binuptime(&now);
g_bioq_lock(&g_bio_run_up);
if (g_collectstats & 1)
-   devstat_end_transaction_bio(pp->stat, bp);
+   devstat_end_transaction_bio_bt(pp->stat, bp, &now);
if (g_collectstats & 2)
-   devstat_end_transaction_bio(cp->stat, bp);
+   devstat_end_transaction_bio_bt(cp->stat, bp, &now);
 
cp->nend++;
pp->nend++;

Modified: head/sys/kern/subr_devstat.c
==
--- head/sys/kern/subr_devstat.cWed Oct 16 09:05:49 2013
(r256602)
+++ head/sys/kern/subr_devstat.cWed Oct 16 09:12:40 2013
(r256603)
@@ -374,6 +374,14 @@ devstat_end_transaction(struct devstat *
 void
 devstat_end_transaction_bio(struct devstat *ds, struct bio *bp)
 {
+
+   devstat_end_transaction_bio_bt(ds, bp, NULL);
+}
+
+void
+devstat_end_transaction_bio_bt(struct devstat *ds, struct bio *bp,
+struct bintime *now)
+{
devstat_trans_flags flg;
 
/* sanity check */
@@ -390,7 +398,7 @@ devstat_end_transaction_bio(struct devst
flg = DEVSTAT_NO_DATA;
 
devstat_end_transaction(ds, bp->bio_bcount - bp->bio_resid,
-   DEVSTAT_TAG_SIMPLE, flg, NULL, &bp->bio_t0);
+   DEVSTAT_TAG_SIMPLE, flg, now, &bp->bio_t0);
DTRACE_DEVSTAT_BIO_DONE();
 }
 

Modified: head/sys/sys/devicestat.h
==
--- head/sys/sys/devicestat.h   Wed Oct 16 09:05:49 2013(r256602)
+++ head/sys/sys/devicestat.h   Wed Oct 16 09:12:40 2013(r256603)
@@ -199,6 +199,8 @@ void devstat_end_transaction(struct devs
 devstat_trans_flags flags,
 struct bintime *now, struct bintime *then);
 void devstat_end_transaction_bio(struct devstat *ds, struct bio *bp);
+void devstat_end_transaction_bio_bt(struct devstat *ds, struct bio *bp,
+struct bintime *now);
 #endif
 
 #endif /* _DEVICESTAT_H */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256606 - head/sys/geom

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:18:01 2013
New Revision: 256606
URL: http://svnweb.freebsd.org/changeset/base/256606

Log:
  MFprojects/camlock r254907:
  Move g_io_deliver() out of the lock, as required for direct dispatch.
  Move g_destroy_bio() out too to reduce lock scope even more.

Modified:
  head/sys/geom/geom_disk.c

Modified: head/sys/geom/geom_disk.c
==
--- head/sys/geom/geom_disk.c   Wed Oct 16 09:17:46 2013(r256605)
+++ head/sys/geom/geom_disk.c   Wed Oct 16 09:18:01 2013(r256606)
@@ -245,13 +245,14 @@ g_disk_done(struct bio *bp)
bp2->bio_completed += bp->bio_completed;
if ((bp->bio_cmd & (BIO_READ|BIO_WRITE|BIO_DELETE)) != 0)
devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now);
-   g_destroy_bio(bp);
bp2->bio_inbed++;
if (bp2->bio_children == bp2->bio_inbed) {
+   mtx_unlock(&sc->done_mtx);
bp2->bio_resid = bp2->bio_bcount - bp2->bio_completed;
g_io_deliver(bp2, bp2->bio_error);
-   }
-   mtx_unlock(&sc->done_mtx);
+   } else
+   mtx_unlock(&sc->done_mtx);
+   g_destroy_bio(bp);
 }
 
 static int
___
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: r256607 - head/sys/geom

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:21:40 2013
New Revision: 256607
URL: http://svnweb.freebsd.org/changeset/base/256607

Log:
  MFprojects/camlock r256371:
  Fix passing uninitialized bio_resid argument to g_trace().

Modified:
  head/sys/geom/geom_dev.c

Modified: head/sys/geom/geom_dev.c
==
--- head/sys/geom/geom_dev.cWed Oct 16 09:18:01 2013(r256606)
+++ head/sys/geom/geom_dev.cWed Oct 16 09:21:40 2013(r256607)
@@ -485,16 +485,16 @@ g_dev_done(struct bio *bp2)
sc = cp->private;
bp = bp2->bio_parent;
bp->bio_error = bp2->bio_error;
-   if (bp->bio_error != 0) {
+   bp->bio_completed = bp2->bio_completed;
+   bp->bio_resid = bp2->bio_resid;
+   if (bp2->bio_error != 0) {
g_trace(G_T_BIO, "g_dev_done(%p) had error %d",
-   bp2, bp->bio_error);
+   bp2, bp2->bio_error);
bp->bio_flags |= BIO_ERROR;
} else {
g_trace(G_T_BIO, "g_dev_done(%p/%p) resid %ld completed %jd",
-   bp2, bp, bp->bio_resid, (intmax_t)bp2->bio_completed);
+   bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed);
}
-   bp->bio_resid = bp->bio_length - bp2->bio_completed;
-   bp->bio_completed = bp2->bio_completed;
g_destroy_bio(bp2);
destroy = 0;
mtx_lock(&sc->sc_mtx);
___
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: r256610 - head/sys/geom/raid

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:33:23 2013
New Revision: 256610
URL: http://svnweb.freebsd.org/changeset/base/256610

Log:
  MFprojects/camlock r256445:
  Add unmapped I/O support to GEOM RAID.

Modified:
  head/sys/geom/raid/g_raid.c
  head/sys/geom/raid/g_raid.h
  head/sys/geom/raid/tr_concat.c
  head/sys/geom/raid/tr_raid0.c
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c
  head/sys/geom/raid/tr_raid5.c

Modified: head/sys/geom/raid/g_raid.c
==
--- head/sys/geom/raid/g_raid.c Wed Oct 16 09:27:51 2013(r256609)
+++ head/sys/geom/raid/g_raid.c Wed Oct 16 09:33:23 2013(r256610)
@@ -993,20 +993,15 @@ g_raid_tr_flush_common(struct g_raid_tr_
cbp->bio_caller1 = sd;
bioq_insert_tail(&queue, cbp);
}
-   for (cbp = bioq_first(&queue); cbp != NULL;
-   cbp = bioq_first(&queue)) {
-   bioq_remove(&queue, cbp);
+   while ((cbp = bioq_takefirst(&queue)) != NULL) {
sd = cbp->bio_caller1;
cbp->bio_caller1 = NULL;
g_raid_subdisk_iostart(sd, cbp);
}
return;
 failure:
-   for (cbp = bioq_first(&queue); cbp != NULL;
-   cbp = bioq_first(&queue)) {
-   bioq_remove(&queue, cbp);
+   while ((cbp = bioq_takefirst(&queue)) != NULL)
g_destroy_bio(cbp);
-   }
if (bp->bio_error == 0)
bp->bio_error = ENOMEM;
g_raid_iodone(bp, bp->bio_error);
@@ -1639,11 +1634,13 @@ static void
 g_raid_launch_provider(struct g_raid_volume *vol)
 {
struct g_raid_disk *disk;
+   struct g_raid_subdisk *sd;
struct g_raid_softc *sc;
struct g_provider *pp;
char name[G_RAID_MAX_VOLUMENAME];
char   announce_buf[80], buf1[32];
off_t off;
+   int i;
 
sc = vol->v_softc;
sx_assert(&sc->sc_lock, SX_LOCKED);
@@ -1673,6 +1670,17 @@ g_raid_launch_provider(struct g_raid_vol
 }
 
pp = g_new_providerf(sc->sc_geom, "%s", name);
+   if (vol->v_tr->tro_class->trc_accept_unmapped) {
+   pp->flags |= G_PF_ACCEPT_UNMAPPED;
+   for (i = 0; i < vol->v_disks_count; i++) {
+   sd = &vol->v_subdisks[i];
+   if (sd->sd_state == G_RAID_SUBDISK_S_NONE)
+   continue;
+   if ((sd->sd_disk->d_consumer->provider->flags &
+   G_PF_ACCEPT_UNMAPPED) == 0)
+   pp->flags &= ~G_PF_ACCEPT_UNMAPPED;
+   }
+   }
pp->private = vol;
pp->mediasize = vol->v_mediasize;
pp->sectorsize = vol->v_sectorsize;

Modified: head/sys/geom/raid/g_raid.h
==
--- head/sys/geom/raid/g_raid.h Wed Oct 16 09:27:51 2013(r256609)
+++ head/sys/geom/raid/g_raid.h Wed Oct 16 09:33:23 2013(r256610)
@@ -376,6 +376,7 @@ struct g_raid_tr_class {
KOBJ_CLASS_FIELDS;
int  trc_enable;
int  trc_priority;
+   int  trc_accept_unmapped;
LIST_ENTRY(g_raid_tr_class) trc_list;
 };
 

Modified: head/sys/geom/raid/tr_concat.c
==
--- head/sys/geom/raid/tr_concat.c  Wed Oct 16 09:27:51 2013
(r256609)
+++ head/sys/geom/raid/tr_concat.c  Wed Oct 16 09:33:23 2013
(r256610)
@@ -74,7 +74,8 @@ static struct g_raid_tr_class g_raid_tr_
g_raid_tr_concat_methods,
sizeof(struct g_raid_tr_concat_object),
.trc_enable = 1,
-   .trc_priority = 50
+   .trc_priority = 50,
+   .trc_accept_unmapped = 1
 };
 
 static int
@@ -227,7 +228,10 @@ g_raid_tr_iostart_concat(struct g_raid_t
 
offset = bp->bio_offset;
remain = bp->bio_length;
-   addr = bp->bio_data;
+   if ((bp->bio_flags & BIO_UNMAPPED) != 0)
+   addr = NULL;
+   else
+   addr = bp->bio_data;
no = 0;
while (no < vol->v_disks_count &&
offset >= vol->v_subdisks[no].sd_size) {
@@ -244,8 +248,16 @@ g_raid_tr_iostart_concat(struct g_raid_t
if (cbp == NULL)
goto failure;
cbp->bio_offset = offset;
-   cbp->bio_data = addr;
cbp->bio_length = length;
+   if ((bp->bio_flags & BIO_UNMAPPED) != 0 &&
+   bp->bio_cmd != BIO_DELETE) {
+   cbp->bio_ma_offset += (uintptr_t)addr;
+   cbp->bio_ma += cbp->bio_ma_offset / PAGE_SIZE;
+   cbp->bio_ma_offset %= PAGE_SIZE;
+   cbp->bio_ma_n = round_page(cbp->bio_ma_offset +
+   cbp->bio_length) / PAGE_SIZE;
+   } else
+   cbp->bio_data = addr;
  

svn commit: r256612 - head/sys/kern

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:48:23 2013
New Revision: 256612
URL: http://svnweb.freebsd.org/changeset/base/256612

Log:
  MFprojects/camlock r254685:
  Remove TQ_FLAGS_PENDING flag, softly duplicating queue emptiness status.

Modified:
  head/sys/kern/subr_taskqueue.c

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Wed Oct 16 09:40:00 2013
(r256611)
+++ head/sys/kern/subr_taskqueue.c  Wed Oct 16 09:48:23 2013
(r256612)
@@ -70,7 +70,6 @@ struct taskqueue {
 
 #defineTQ_FLAGS_ACTIVE (1 << 0)
 #defineTQ_FLAGS_BLOCKED(1 << 1)
-#defineTQ_FLAGS_PENDING(1 << 2)
 
 #defineDT_CALLOUT_ARMED(1 << 0)
 
@@ -223,8 +222,6 @@ taskqueue_enqueue_locked(struct taskqueu
task->ta_pending = 1;
if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0)
queue->tq_enqueue(queue->tq_context);
-   else
-   queue->tq_flags |= TQ_FLAGS_PENDING;
 
return (0);
 }
@@ -301,10 +298,8 @@ taskqueue_unblock(struct taskqueue *queu
 
TQ_LOCK(queue);
queue->tq_flags &= ~TQ_FLAGS_BLOCKED;
-   if (queue->tq_flags & TQ_FLAGS_PENDING) {
-   queue->tq_flags &= ~TQ_FLAGS_PENDING;
+   if (!STAILQ_EMPTY(&queue->tq_queue))
queue->tq_enqueue(queue->tq_context);
-   }
TQ_UNLOCK(queue);
 }
 
___
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: r256613 - head/sys/kern

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:52:59 2013
New Revision: 256613
URL: http://svnweb.freebsd.org/changeset/base/256613

Log:
  MFprojects/camlock r254763:
  Move tq_enqueue() call out of the queue lock for known handlers (actually
  I have found no others in the base system).  This reduces queue lock hold
  time and congestion spinning under active multithreaded enqueuing.

Modified:
  head/sys/kern/subr_taskqueue.c

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Wed Oct 16 09:48:23 2013
(r256612)
+++ head/sys/kern/subr_taskqueue.c  Wed Oct 16 09:52:59 2013
(r256613)
@@ -47,6 +47,9 @@ __FBSDID("$FreeBSD$");
 static MALLOC_DEFINE(M_TASKQUEUE, "taskqueue", "Task Queues");
 static void*taskqueue_giant_ih;
 static void*taskqueue_ih;
+static void taskqueue_fast_enqueue(void *);
+static void taskqueue_swi_enqueue(void *);
+static void taskqueue_swi_giant_enqueue(void *);
 
 struct taskqueue_busy {
struct task *tb_running;
@@ -70,6 +73,7 @@ struct taskqueue {
 
 #defineTQ_FLAGS_ACTIVE (1 << 0)
 #defineTQ_FLAGS_BLOCKED(1 << 1)
+#defineTQ_FLAGS_UNLOCKED_ENQUEUE   (1 << 2)
 
 #defineDT_CALLOUT_ARMED(1 << 0)
 
@@ -97,7 +101,8 @@ _timeout_task_init(struct taskqueue *que
 {
 
TASK_INIT(&timeout_task->t, priority, func, context);
-   callout_init_mtx(&timeout_task->c, &queue->tq_mutex, 0);
+   callout_init_mtx(&timeout_task->c, &queue->tq_mutex,
+   CALLOUT_RETURNUNLOCKED);
timeout_task->q = queue;
timeout_task->f = 0;
 }
@@ -128,6 +133,11 @@ _taskqueue_create(const char *name __unu
queue->tq_context = context;
queue->tq_spin = (mtxflags & MTX_SPIN) != 0;
queue->tq_flags |= TQ_FLAGS_ACTIVE;
+   if (enqueue == taskqueue_fast_enqueue ||
+   enqueue == taskqueue_swi_enqueue ||
+   enqueue == taskqueue_swi_giant_enqueue ||
+   enqueue == taskqueue_thread_enqueue)
+   queue->tq_flags |= TQ_FLAGS_UNLOCKED_ENQUEUE;
mtx_init(&queue->tq_mutex, mtxname, NULL, mtxflags);
 
return queue;
@@ -197,6 +207,7 @@ taskqueue_enqueue_locked(struct taskqueu
if (task->ta_pending) {
if (task->ta_pending < USHRT_MAX)
task->ta_pending++;
+   TQ_UNLOCK(queue);
return (0);
}
 
@@ -220,8 +231,12 @@ taskqueue_enqueue_locked(struct taskqueu
}
 
task->ta_pending = 1;
+   if ((queue->tq_flags & TQ_FLAGS_UNLOCKED_ENQUEUE) != 0)
+   TQ_UNLOCK(queue);
if ((queue->tq_flags & TQ_FLAGS_BLOCKED) == 0)
queue->tq_enqueue(queue->tq_context);
+   if ((queue->tq_flags & TQ_FLAGS_UNLOCKED_ENQUEUE) == 0)
+   TQ_UNLOCK(queue);
 
return (0);
 }
@@ -232,7 +247,6 @@ taskqueue_enqueue(struct taskqueue *queu
 
TQ_LOCK(queue);
res = taskqueue_enqueue_locked(queue, task);
-   TQ_UNLOCK(queue);
 
return (res);
 }
@@ -278,8 +292,8 @@ taskqueue_enqueue_timeout(struct taskque
callout_reset(&timeout_task->c, ticks,
taskqueue_timeout_func, timeout_task);
}
+   TQ_UNLOCK(queue);
}
-   TQ_UNLOCK(queue);
return (res);
 }
 
@@ -566,7 +580,6 @@ taskqueue_thread_enqueue(void *context)
tqp = context;
tq = *tqp;
 
-   TQ_ASSERT_LOCKED(tq);
wakeup_one(tq);
 }
 
___
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: r256614 - head/sys/kern

2013-10-16 Thread Alexander Motin
Author: mav
Date: Wed Oct 16 09:56:40 2013
New Revision: 256614
URL: http://svnweb.freebsd.org/changeset/base/256614

Log:
  MFprojects/camlock r256370:
   - Take BIO lock in biodone() only when there is no completion callback set
  and so we should wake up thread waiting in biowait().
   - Remove msleep() timeout from biowait().  It was added 11 years ago, when
  there was no locks used, and it should not be needed any more.

Modified:
  head/sys/kern/vfs_bio.c

Modified: head/sys/kern/vfs_bio.c
==
--- head/sys/kern/vfs_bio.c Wed Oct 16 09:52:59 2013(r256613)
+++ head/sys/kern/vfs_bio.c Wed Oct 16 09:56:40 2013(r256614)
@@ -3559,9 +3559,6 @@ biodone(struct bio *bp)
vm_offset_t start, end;
int transient;
 
-   mtxp = mtx_pool_find(mtxpool_sleep, bp);
-   mtx_lock(mtxp);
-   bp->bio_flags |= BIO_DONE;
if ((bp->bio_flags & BIO_TRANSIENT_MAPPING) != 0) {
start = trunc_page((vm_offset_t)bp->bio_data);
end = round_page((vm_offset_t)bp->bio_data + bp->bio_length);
@@ -3571,11 +3568,16 @@ biodone(struct bio *bp)
start = end = 0;
}
done = bp->bio_done;
-   if (done == NULL)
+   if (done == NULL) {
+   mtxp = mtx_pool_find(mtxpool_sleep, bp);
+   mtx_lock(mtxp);
+   bp->bio_flags |= BIO_DONE;
wakeup(bp);
-   mtx_unlock(mtxp);
-   if (done != NULL)
+   mtx_unlock(mtxp);
+   } else {
+   bp->bio_flags |= BIO_DONE;
done(bp);
+   }
if (transient) {
pmap_qremove(start, OFF_TO_IDX(end - start));
vmem_free(transient_arena, start, end - start);
@@ -3585,9 +3587,6 @@ biodone(struct bio *bp)
 
 /*
  * Wait for a BIO to finish.
- *
- * XXX: resort to a timeout for now.  The optimal locking (if any) for this
- * case is not yet clear.
  */
 int
 biowait(struct bio *bp, const char *wchan)
@@ -3597,7 +3596,7 @@ biowait(struct bio *bp, const char *wcha
mtxp = mtx_pool_find(mtxpool_sleep, bp);
mtx_lock(mtxp);
while ((bp->bio_flags & BIO_DONE) == 0)
-   msleep(bp, mtxp, PRIBIO, wchan, hz / 10);
+   msleep(bp, mtxp, PRIBIO, wchan, 0);
mtx_unlock(mtxp);
if (bp->bio_error != 0)
return (bp->bio_error);
___
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: r256617 - head/sys/net

2013-10-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Oct 16 10:33:20 2013
New Revision: 256617
URL: http://svnweb.freebsd.org/changeset/base/256617

Log:
  Remove unused fields from radix_node_head.
  
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/radix.h

Modified: head/sys/net/radix.h
==
--- head/sys/net/radix.hWed Oct 16 10:26:34 2013(r256616)
+++ head/sys/net/radix.hWed Oct 16 10:33:20 2013(r256617)
@@ -107,24 +107,15 @@ struct radix_node_head {
struct  radix_node *rnh_treetop;
u_int   rnh_gen;/* generation counter */
int rnh_multipath;  /* multipath capable ? */
-   int rnh_addrsize;   /* permit, but not require fixed keys */
-   int rnh_pktsize;/* permit, but not require fixed keys */
struct  radix_node *(*rnh_addaddr)  /* add based on sockaddr */
(void *v, void *mask,
 struct radix_node_head *head, struct radix_node nodes[]);
-   struct  radix_node *(*rnh_addpkt)   /* add based on packet hdr */
-   (void *v, void *mask,
-struct radix_node_head *head, struct radix_node nodes[]);
struct  radix_node *(*rnh_deladdr)  /* remove based on sockaddr */
(void *v, void *mask, struct radix_node_head *head);
-   struct  radix_node *(*rnh_delpkt)   /* remove based on packet hdr */
-   (void *v, void *mask, struct radix_node_head *head);
struct  radix_node *(*rnh_matchaddr)/* locate based on sockaddr */
(void *v, struct radix_node_head *head);
struct  radix_node *(*rnh_lookup)   /* locate based on sockaddr */
(void *v, void *mask, struct radix_node_head *head);
-   struct  radix_node *(*rnh_matchpkt) /* locate based on packet hdr */
-   (void *v, struct radix_node_head *head);
int (*rnh_walktree) /* traverse tree */
(struct radix_node_head *head, walktree_f_t *f, void *w);
int (*rnh_walktree_from)/* traverse tree below a */
___
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: r256618 - head/share/man/man9

2013-10-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Oct 16 10:36:42 2013
New Revision: 256618
URL: http://svnweb.freebsd.org/changeset/base/256618

Log:
  Reflect r248070 (RTM_PINNED) changes in documentation.
  
  Pointed by:   pluknet
  MFC after:2 weeks

Modified:
  head/share/man/man9/rtentry.9

Modified: head/share/man/man9/rtentry.9
==
--- head/share/man/man9/rtentry.9   Wed Oct 16 10:33:20 2013
(r256617)
+++ head/share/man/man9/rtentry.9   Wed Oct 16 10:36:42 2013
(r256618)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 11, 2008
+.Dd October 16, 2013
 .Dt RTENTRY 9
 .Os
 .Sh NAME
@@ -154,8 +154,7 @@ Protocol-specific.
 .It Dv RTF_PRCLONING
 This flag is obsolete and simply ignored by facility.
 .It Dv RTF_PINNED
-(Reserved for future use to indicate routes which are not to be
-modified by a routing protocol.)
+Indicates that this route is immutable to a routing protocol.
 .It Dv RTF_LOCAL
 Indicates that the destination of this route is an address configured
 as belonging to this system.
___
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: r256624 - head/sys/net

2013-10-16 Thread Alexander V. Chernikov
Author: melifaro
Date: Wed Oct 16 12:18:44 2013
New Revision: 256624
URL: http://svnweb.freebsd.org/changeset/base/256624

Log:
  Fix long-standing issue with incorrect radix mask calculation.
  
  Usual symptoms are messages like
  rn_delete: inconsistent annotation
  rn_addmask: mask impossibly already in tree
  or inability to flush/delete particular prefix in ipfw table.
  
  Changes:
  * Assume 32 bytes as maximum radix key length
  * Remove rn_init()
  * Statically allocate rn_ones/rn_zeroes
  * Make separate mask tree for each "normal" tree instead of system global one
  * Remove "optimization" on masks reusage and key zeroying
  * Change rn_addmask() arguments to accept tree pointer (no users in base)
  
  PR:   kern/182851, kern/169206, kern/135476, kern/134531
  Found by: Slawa Olhovchenkov 
  MFC after:2 weeks
  Reviewed by:  glebius
  Sponsored by: Yandex LLC

Modified:
  head/sys/net/radix.c
  head/sys/net/radix.h
  head/sys/net/route.c

Modified: head/sys/net/radix.c
==
--- head/sys/net/radix.cWed Oct 16 12:15:33 2013(r256623)
+++ head/sys/net/radix.cWed Oct 16 12:18:44 2013(r256624)
@@ -66,27 +66,19 @@ static struct radix_node
 *rn_search(void *, struct radix_node *),
 *rn_search_m(void *, struct radix_node *, void *);
 
-static int max_keylen;
-static struct radix_mask *rn_mkfreelist;
-static struct radix_node_head *mask_rnhead;
-/*
- * Work area -- the following point to 3 buffers of size max_keylen,
- * allocated in this order in a block of memory malloc'ed by rn_init.
- * rn_zeros, rn_ones are set in rn_init and used in readonly afterwards.
- * addmask_key is used in rn_addmask in rw mode and not thread-safe.
- */
-static char *rn_zeros, *rn_ones, *addmask_key;
+static void rn_detachhead_internal(void **head);
+static int rn_inithead_internal(void **head, int off);
+
+#defineRADIX_MAX_KEY_LEN   32
 
-#define MKGet(m) { \
-   if (rn_mkfreelist) {\
-   m = rn_mkfreelist;  \
-   rn_mkfreelist = (m)->rm_mklist; \
-   } else  \
-   R_Malloc(m, struct radix_mask *, sizeof (struct radix_mask)); }
- 
-#define MKFree(m) { (m)->rm_mklist = rn_mkfreelist; rn_mkfreelist = (m);}
+static char rn_zeros[RADIX_MAX_KEY_LEN];
+static char rn_ones[RADIX_MAX_KEY_LEN] = {
+   -1, -1, -1, -1, -1, -1, -1, -1,
+   -1, -1, -1, -1, -1, -1, -1, -1,
+   -1, -1, -1, -1, -1, -1, -1, -1,
+   -1, -1, -1, -1, -1, -1, -1, -1,
+};
 
-#define rn_masktop (mask_rnhead->rnh_treetop)
 
 static int rn_lexobetter(void *m_arg, void *n_arg);
 static struct radix_mask *
@@ -230,7 +222,8 @@ rn_lookup(v_arg, m_arg, head)
caddr_t netmask = 0;
 
if (m_arg) {
-   x = rn_addmask(m_arg, 1, head->rnh_treetop->rn_offset);
+   x = rn_addmask(m_arg, head->rnh_masks, 1,
+   head->rnh_treetop->rn_offset);
if (x == 0)
return (0);
netmask = x->rn_key;
@@ -489,53 +482,47 @@ on1:
 }
 
 struct radix_node *
-rn_addmask(n_arg, search, skip)
-   int search, skip;
-   void *n_arg;
+rn_addmask(void *n_arg, struct radix_node_head *maskhead, int search, int skip)
 {
caddr_t netmask = (caddr_t)n_arg;
register struct radix_node *x;
register caddr_t cp, cplim;
register int b = 0, mlen, j;
-   int maskduplicated, m0, isnormal;
+   int maskduplicated, isnormal;
struct radix_node *saved_x;
-   static int last_zeroed = 0;
+   char addmask_key[RADIX_MAX_KEY_LEN];
 
-   if ((mlen = LEN(netmask)) > max_keylen)
-   mlen = max_keylen;
+   if ((mlen = LEN(netmask)) > RADIX_MAX_KEY_LEN)
+   mlen = RADIX_MAX_KEY_LEN;
if (skip == 0)
skip = 1;
if (mlen <= skip)
-   return (mask_rnhead->rnh_nodes);
+   return (maskhead->rnh_nodes);
+
+   bzero(addmask_key, RADIX_MAX_KEY_LEN);
if (skip > 1)
bcopy(rn_ones + 1, addmask_key + 1, skip - 1);
-   if ((m0 = mlen) > skip)
-   bcopy(netmask + skip, addmask_key + skip, mlen - skip);
+   bcopy(netmask + skip, addmask_key + skip, mlen - skip);
/*
 * Trim trailing zeroes.
 */
for (cp = addmask_key + mlen; (cp > addmask_key) && cp[-1] == 0;)
cp--;
mlen = cp - addmask_key;
-   if (mlen <= skip) {
-   if (m0 >= last_zeroed)
-   last_zeroed = mlen;
-   return (mask_rnhead->rnh_nodes);
-   }
-   if (m0 < last_zeroed)
-   bzero(addmask_key + m0, last_zeroed - m0);
-   *addmask_key = last_zeroed = mlen;
-   x = rn_search(addm

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

2013-10-16 Thread Ian Lepore
Author: ian
Date: Wed Oct 16 14:24:22 2013
New Revision: 256628
URL: http://svnweb.freebsd.org/changeset/base/256628

Log:
  Fix a register name typo.  The effect was that CPU_CONTROL_AFLT_ENABLE
  wasn't being set, but it was almost assuredly already turned on anyway
  by the bootloader.

Modified:
  head/sys/arm/arm/locore.S

Modified: head/sys/arm/arm/locore.S
==
--- head/sys/arm/arm/locore.S   Wed Oct 16 13:33:48 2013(r256627)
+++ head/sys/arm/arm/locore.S   Wed Oct 16 14:24:22 2013(r256628)
@@ -187,7 +187,7 @@ Lunmapped:
mrc p15, 0, r0, c1, c0, 0
 #ifdef _ARM_ARCH_6
orr r0, r0, #(CPU_CONTROL_V6_EXTPAGE | CPU_CONTROL_UNAL_ENABLE)
-   orr r2, r2, #(CPU_CONTROL_AFLT_ENABLE)
+   orr r0, r0, #(CPU_CONTROL_AFLT_ENABLE)
orr r0, r0, #(CPU_CONTROL_AF_ENABLE)
 #endif
orr r0, r0, #(CPU_CONTROL_MMU_ENABLE)
___
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: r256629 - in head/sys/arm: arm include

2013-10-16 Thread Ruslan Bukin
Author: br
Date: Wed Oct 16 15:20:27 2013
New Revision: 256629
URL: http://svnweb.freebsd.org/changeset/base/256629

Log:
  Add CPU ID for ARM Cortex A5.
  
  Approved by:  cognet (mentor)

Modified:
  head/sys/arm/arm/cpufunc.c
  head/sys/arm/arm/identcpu.c
  head/sys/arm/include/armreg.h

Modified: head/sys/arm/arm/cpufunc.c
==
--- head/sys/arm/arm/cpufunc.c  Wed Oct 16 14:24:22 2013(r256628)
+++ head/sys/arm/arm/cpufunc.c  Wed Oct 16 15:20:27 2013(r256629)
@@ -1476,7 +1476,8 @@ set_cpufuncs()
}
 #endif /* CPU_ARM1136 || CPU_ARM1176 */
 #ifdef CPU_CORTEXA
-   if (cputype == CPU_ID_CORTEXA7 ||
+   if (cputype == CPU_ID_CORTEXA5 ||
+   cputype == CPU_ID_CORTEXA7 ||
cputype == CPU_ID_CORTEXA8R1 ||
cputype == CPU_ID_CORTEXA8R2 ||
cputype == CPU_ID_CORTEXA8R3 ||

Modified: head/sys/arm/arm/identcpu.c
==
--- head/sys/arm/arm/identcpu.c Wed Oct 16 14:24:22 2013(r256628)
+++ head/sys/arm/arm/identcpu.c Wed Oct 16 15:20:27 2013(r256629)
@@ -236,6 +236,8 @@ const struct cpuidtab cpuids[] = {
{ CPU_ID_ARM1026EJS,CPU_CLASS_ARM10EJ,  "ARM1026EJ-S",
  generic_steppings },
 
+   { CPU_ID_CORTEXA5,  CPU_CLASS_CORTEXA,  "Cortex A5",
+ generic_steppings },
{ CPU_ID_CORTEXA7,  CPU_CLASS_CORTEXA,  "Cortex A7",
  generic_steppings },
{ CPU_ID_CORTEXA8R1,CPU_CLASS_CORTEXA,  "Cortex A8-r1",

Modified: head/sys/arm/include/armreg.h
==
--- head/sys/arm/include/armreg.h   Wed Oct 16 14:24:22 2013
(r256628)
+++ head/sys/arm/include/armreg.h   Wed Oct 16 15:20:27 2013
(r256629)
@@ -147,6 +147,7 @@
 #define CPU_ID_ARM1136JS   0x4107b360
 #define CPU_ID_ARM1136JSR1 0x4117b360
 #define CPU_ID_ARM1176JZS  0x410fb760
+#define CPU_ID_CORTEXA50x410fc050
 #define CPU_ID_CORTEXA70x410fc070
 #define CPU_ID_CORTEXA8R1  0x411fc080
 #define CPU_ID_CORTEXA8R2  0x412fc080
___
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: r256637 - head/sys/arm/arm

2013-10-16 Thread Ian Lepore
Author: ian
Date: Wed Oct 16 16:32:35 2013
New Revision: 256637
URL: http://svnweb.freebsd.org/changeset/base/256637

Log:
  When calculating the number of bounce pages needed, round the maxsize
  up to a multiple of PAGE_SIZE, and add one page because there can always
  be one more boundary crossing than the number of pages in the transfer.

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cWed Oct 16 16:05:49 2013
(r256636)
+++ head/sys/arm/arm/busdma_machdep-v6.cWed Oct 16 16:32:35 2013
(r256637)
@@ -425,14 +425,21 @@ bus_dma_tag_create(bus_dma_tag_t parent,
if (_bus_dma_can_bounce(newtag->lowaddr, newtag->highaddr)
 || newtag->alignment > 1)
newtag->flags |= BUS_DMA_COULD_BOUNCE;
-   else
-   maxsize = 2; /* Need at most 2 bounce pages for unaligned 
access on cache line boundaries */
 
+   /*
+* Any request can auto-bounce due to cacheline alignment, in addition
+* to any alignment or boundary specifications in the tag, so if the
+* ALLOCNOW flag is set, there's always work to do.
+*/
if ((flags & BUS_DMA_ALLOCNOW) != 0) {
struct bounce_zone *bz;
-
-   /* Must bounce */
-
+   /*
+* Round size up to a full page, and add one more page because
+* there can always be one more boundary crossing than the
+* number of pages in a transfer.
+*/
+   maxsize = roundup2(maxsize, PAGE_SIZE) + PAGE_SIZE;
+   
if ((error = alloc_bounce_zone(newtag)) != 0) {
free(newtag, M_DEVBUF);
return (error);
@@ -518,20 +525,22 @@ static int allocate_bz_and_pages(bus_dma
STAILQ_INIT(&(mapp->bpages));
 
/*
-* Attempt to add pages to our pool on a per-instance
-* basis up to a sane limit.
+* Attempt to add pages to our pool on a per-instance basis up to a sane
+* limit.  Even if the tag isn't flagged as COULD_BOUNCE due to
+* alignment and boundary constraints, it could still auto-bounce due to
+* cacheline alignment, which requires at most two bounce pages.
 */
if (dmat->flags & BUS_DMA_COULD_BOUNCE)
maxpages = MAX_BPAGES;
else
-   maxpages = 2 * bz->map_count; /* Only need at most 2 pages for 
buffers unaligned on cache line boundaries */
+   maxpages = 2 * bz->map_count;
if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0
|| (bz->map_count > 0 && bz->total_bpages < maxpages)) {
int pages;

-   pages = MAX(atop(dmat->maxsize), 1);
+   pages = atop(roundup2(dmat->maxsize, PAGE_SIZE)) + 1;
pages = MIN(maxpages - bz->total_bpages, pages);
-   pages = MAX(pages, 1);
+   pages = MAX(pages, 2);
if (alloc_bounce_pages(dmat, pages) < pages)
return (ENOMEM);

___
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: r256638 - head/sys/arm/arm

2013-10-16 Thread Ian Lepore
Author: ian
Date: Wed Oct 16 16:35:25 2013
New Revision: 256638
URL: http://svnweb.freebsd.org/changeset/base/256638

Log:
  Add cases for the combinations of busdma sync op flags that we handle
  correctly by doing nothing, then add a panic for the default case, because
  that implies that some driver asked for a sync (probably incorrectly) and
  nothing was done.

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cWed Oct 16 16:32:35 2013
(r256637)
+++ head/sys/arm/arm/busdma_machdep-v6.cWed Oct 16 16:35:25 2013
(r256638)
@@ -1282,7 +1282,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus
}
break;
 
+   case BUS_DMASYNC_POSTREAD:
+   case BUS_DMASYNC_POSTWRITE:
+   case BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE:
+   break;
default:
+   panic("unsupported combination of sync operations: 
0x%08x\n", op);
break;
}
}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256640 - head

2013-10-16 Thread Ian Lepore
Author: ian
Date: Wed Oct 16 16:46:25 2013
New Revision: 256640
URL: http://svnweb.freebsd.org/changeset/base/256640

Log:
  Allow 'make xdev' to work when DESTDIR is set.
  
  Submitted by: Patrick Kelsey 

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Wed Oct 16 16:46:15 2013(r256639)
+++ head/Makefile.inc1  Wed Oct 16 16:46:25 2013(r256640)
@@ -1830,7 +1830,7 @@ NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOU
CPUTYPE=${XDEV_CPUTYPE}
 
 XDDIR=${XDEV_ARCH}-freebsd
-XDTP=/usr/${XDDIR}
+XDTP=usr/${XDDIR}
 CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
INSTALL="sh ${.CURDIR}/tools/install.sh"
 CDENV= ${CDBENV} \
@@ -1843,8 +1843,8 @@ CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" 
 
 CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
 CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
-CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDTP}/usr/bin:${PATH} ${MAKE} 
${NOFUN}
-XDDESTDIR=${DESTDIR}${XDTP}
+CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} 
${NOFUN}
+XDDESTDIR=${DESTDIR}/${XDTP}
 .if !defined(OSREL)
 OSREL!= uname -r | sed -e 's/[-(].*//'
 .endif
@@ -1924,6 +1924,7 @@ _xi-libraries:
 
 _xi-links:
${_+_}cd ${XDDESTDIR}/usr/bin; \
+   mkdir -p ../../../../usr/bin; \
for i in *; do \
ln -sf ../../${XDTP}/usr/bin/$$i \
../../../../usr/bin/${XDDIR}-$$i; \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256639 - head/release/picobsd/build

2013-10-16 Thread Luigi Rizzo
Author: luigi
Date: Wed Oct 16 16:46:15 2013
New Revision: 256639
URL: http://svnweb.freebsd.org/changeset/base/256639

Log:
  update the picobsd script to build with GCC and not CLANG

Modified:
  head/release/picobsd/build/picobsd

Modified: head/release/picobsd/build/picobsd
==
--- head/release/picobsd/build/picobsd  Wed Oct 16 16:35:25 2013
(r256638)
+++ head/release/picobsd/build/picobsd  Wed Oct 16 16:46:15 2013
(r256639)
@@ -166,7 +166,13 @@ create_includes_and_libraries2() { # opt
 log "create_includes_and_libraries2() for ${SRC} $1"
 if [ ${OSVERSION} -ge 60 ] ; then
no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1"
-   no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION"
+   #no="$no -DWITHOUT_CLANG -DMALLOC_PRODUCTION"
+   # XXX 20131001 see if clang fixes the build
+   export WITHOUT_CLANG=YES
+   export WITHOUT_ICONV=YES
+   export WITH_GCC=YES
+   export WITH_GNUCXX=YES
+   no="$no -DMALLOC_PRODUCTION"
 else
no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R"
 fi
@@ -974,7 +980,13 @@ set_build_parameters() {
 if [ ${OSVERSION} -ge 500035 ] ; then
export MAKEOBJDIRPREFIX=${l_objtree}
export TARGET_ARCH=${o_arch} TARGET=${o_arch}
-   export WITHOUT_CLANG_IS_CC=1
+   # XXX 20131001 see if CLANG fixes the build
+   # XXX export WITHOUT_CLANG_IS_CC=1
+   export WITHOUT_CLANG=YES
+   export WITHOUT_ICONV=YES
+   export WITH_GCC=YES
+   export WITH_GNUCXX=YES
+
# XXX why change machine_arch ?
#-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m`
# export CWARNFLAGS="-Wextra -Wno-sign-compare 
-Wno-missing-field-initializers"
___
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: r256641 - in head/release/picobsd/floppy.tree/etc: . ssh

2013-10-16 Thread Luigi Rizzo
Author: luigi
Date: Wed Oct 16 16:53:00 2013
New Revision: 256641
URL: http://svnweb.freebsd.org/changeset/base/256641

Log:
  help running sshd on picobsd

Modified:
  head/release/picobsd/floppy.tree/etc/rc1
  head/release/picobsd/floppy.tree/etc/ssh/sshd_config

Modified: head/release/picobsd/floppy.tree/etc/rc1
==
--- head/release/picobsd/floppy.tree/etc/rc1Wed Oct 16 16:46:25 2013
(r256640)
+++ head/release/picobsd/floppy.tree/etc/rc1Wed Oct 16 16:53:00 2013
(r256641)
@@ -52,8 +52,11 @@ pwd_mkdb -p ./master.passwd
 [ "${inetd_enable}" = "YES" -a -f /stand/inetd ] && \
{ echo "Starting inetd."; inetd ${inetd_flags} ; }
 
-[ "${sshd_enable}" = "YES" -a -f /stand/sshd ] && \
-   { echo "Starting sshd..." ; sshd -f /etc/sshd_config ; }
+if [ "${sshd_enable}" = "YES" -a -f /usr/sbin/sshd ] ; then
+   echo "Starting sshd..."
+   chmod 600 /etc/ssh_host*key
+   /usr/sbin/sshd -f /etc/sshd_config
+fi
 
 echo ''
 cat /etc/motd

Modified: head/release/picobsd/floppy.tree/etc/ssh/sshd_config
==
--- head/release/picobsd/floppy.tree/etc/ssh/sshd_configWed Oct 16 
16:46:25 2013(r256640)
+++ head/release/picobsd/floppy.tree/etc/ssh/sshd_configWed Oct 16 
16:53:00 2013(r256641)
@@ -1,24 +1,23 @@
+# $FreeBSD$
+# minimal config for sshd on picobsd
 Port 22
 ListenAddress 0.0.0.0
 HostKey  /etc/ssh_host_key
-RandomSeed /etc/ssh_random_seed
+#RandomSeed /etc/ssh_random_seed
 ServerKeyBits 768
 LoginGraceTime 600
 KeyRegenerationInterval 3600
 PermitRootLogin yes
 IgnoreRhosts no
 StrictModes yes
-QuietMode no
 X11Forwarding no
 X11DisplayOffset 10
-FascistLogging no
 PrintMotd yes
 KeepAlive yes
 SyslogFacility AUTH
-RhostsAuthentication no
 RhostsRSAAuthentication yes
 RSAAuthentication yes
-PasswordAuthentication no
+PasswordAuthentication yes
 PermitEmptyPasswords no
 UseLogin no
 # CheckMail no
___
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: r256642 - head/contrib/libcxxrt

2013-10-16 Thread Dimitry Andric
Author: dim
Date: Wed Oct 16 17:00:21 2013
New Revision: 256642
URL: http://svnweb.freebsd.org/changeset/base/256642

Log:
  Since C++ typeinfo objects are currently not guaranteed to be merged at
  runtime by the dynamic linker, check for their equality in libcxxrt by
  not only comparing the typeinfo's name pointers, but also comparing the
  full names, if necessary.  (This is similar to what GNU libstdc++ does
  in its default configuration.)  The 'deep' check can be turned off again
  by defining LIBCXXRT_MERGED_TYPEINFO, and recompiling libcxxrt.
  
  Reviewed by:  theraven
  MFC after:3 days

Modified:
  head/contrib/libcxxrt/typeinfo.cc

Modified: head/contrib/libcxxrt/typeinfo.cc
==
--- head/contrib/libcxxrt/typeinfo.cc   Wed Oct 16 16:53:00 2013
(r256641)
+++ head/contrib/libcxxrt/typeinfo.cc   Wed Oct 16 17:00:21 2013
(r256642)
@@ -35,15 +35,23 @@ type_info::~type_info() {}
 
 bool type_info::operator==(const type_info &other) const
 {
+#ifdef LIBCXXRT_MERGED_TYPEINFO
return __type_name == other.__type_name;
+#else
+   return __type_name == other.__type_name || strcmp(__type_name, 
other.__type_name) == 0;
+#endif
 }
 bool type_info::operator!=(const type_info &other) const
 {
-   return __type_name != other.__type_name;
+   return !operator==(other);
 }
 bool type_info::before(const type_info &other) const
 {
+#ifdef LIBCXXRT_MERGED_TYPEINFO
return __type_name < other.__type_name;
+#else
+   return strcmp(__type_name, other.__type_name) < 0;
+#endif
 }
 const char* type_info::name() const
 {
___
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: r256643 - head/sys/kern

2013-10-16 Thread Ed Maste
Author: emaste
Date: Wed Oct 16 17:03:46 2013
New Revision: 256643
URL: http://svnweb.freebsd.org/changeset/base/256643

Log:
  Error out on failure to open specified config file

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Wed Oct 16 17:00:21 2013
(r256642)
+++ head/sys/kern/makesyscalls.sh   Wed Oct 16 17:03:46 2013
(r256643)
@@ -57,7 +57,7 @@ case $# in
;;
 esac
 
-if [ -n "$2" -a -f "$2" ]; then
+if [ -n "$2" ]; then
. $2
 fi
 
___
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: r256644 - head/lib/libz

2013-10-16 Thread Xin LI
Author: delphij
Date: Wed Oct 16 17:16:40 2013
New Revision: 256644
URL: http://svnweb.freebsd.org/changeset/base/256644

Log:
  Make it possible to seek within a gzip stream.

Modified:
  head/lib/libz/zopen.c

Modified: head/lib/libz/zopen.c
==
--- head/lib/libz/zopen.c   Wed Oct 16 17:03:46 2013(r256643)
+++ head/lib/libz/zopen.c   Wed Oct 16 17:16:40 2013(r256644)
@@ -29,6 +29,12 @@ xgzclose(void *cookie)
 return gzclose(cookie);
 }
 
+static fpos_t
+xgzseek(void *cookie,  fpos_t offset, int whence)
+{
+   return gzseek(cookie, (z_off_t)offset, whence);
+}
+
 FILE *
 zopen(const char *fname, const char *mode)
 {
@@ -37,7 +43,7 @@ zopen(const char *fname, const char *mod
return NULL;
 
 if(*mode == 'r')
-   return (funopen(gz, xgzread, NULL, NULL, xgzclose));
+   return (funopen(gz, xgzread, NULL, xgzseek, xgzclose));
 else
-   return (funopen(gz, NULL, xgzwrite, NULL, xgzclose));
+   return (funopen(gz, NULL, xgzwrite, xgzseek, xgzclose));
 }
___
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: r256645 - in head: lib/libvmmapi sys/amd64/amd64 sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl

2013-10-16 Thread Neel Natu
Author: neel
Date: Wed Oct 16 18:20:27 2013
New Revision: 256645
URL: http://svnweb.freebsd.org/changeset/base/256645

Log:
  Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose
  'invpcid' instruction to the guest. Currently bhyve will try to enable this
  capability unconditionally if it is available.
  
  Consolidate code in bhyve to set the capabilities so it is no longer
  duplicated in BSP and AP bringup.
  
  Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid'
  instruction is available.
  
  Reviewed by:  grehan
  MFC after:3 days

Modified:
  head/lib/libvmmapi/vmmapi.c
  head/sys/amd64/amd64/pmap.c
  head/sys/amd64/include/vmm.h
  head/sys/amd64/vmm/intel/vmx.c
  head/sys/amd64/vmm/intel/vmx.h
  head/sys/amd64/vmm/intel/vmx_controls.h
  head/sys/amd64/vmm/x86.c
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyve/bhyverun.h
  head/usr.sbin/bhyve/spinup_ap.c
  head/usr.sbin/bhyvectl/bhyvectl.c

Modified: head/lib/libvmmapi/vmmapi.c
==
--- head/lib/libvmmapi/vmmapi.c Wed Oct 16 17:16:40 2013(r256644)
+++ head/lib/libvmmapi/vmmapi.c Wed Oct 16 18:20:27 2013(r256645)
@@ -415,6 +415,7 @@ static struct {
{ "mtrap_exit", VM_CAP_MTRAP_EXIT },
{ "pause_exit", VM_CAP_PAUSE_EXIT },
{ "unrestricted_guest", VM_CAP_UNRESTRICTED_GUEST },
+   { "enable_invpcid", VM_CAP_ENABLE_INVPCID },
{ 0 }
 };
 

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Wed Oct 16 17:16:40 2013(r256644)
+++ head/sys/amd64/amd64/pmap.c Wed Oct 16 18:20:27 2013(r256645)
@@ -371,6 +371,8 @@ int pmap_pcid_enabled = 1;
 SYSCTL_INT(_vm_pmap, OID_AUTO, pcid_enabled, CTLFLAG_RDTUN, &pmap_pcid_enabled,
 0, "Is TLB Context ID enabled ?");
 int invpcid_works = 0;
+SYSCTL_INT(_vm_pmap, OID_AUTO, invpcid_works, CTLFLAG_RD, &invpcid_works, 0,
+"Is the invpcid instruction available ?");
 
 static int
 pmap_pcid_save_cnt_proc(SYSCTL_HANDLER_ARGS)

Modified: head/sys/amd64/include/vmm.h
==
--- head/sys/amd64/include/vmm.hWed Oct 16 17:16:40 2013
(r256644)
+++ head/sys/amd64/include/vmm.hWed Oct 16 18:20:27 2013
(r256645)
@@ -223,6 +223,7 @@ enum vm_cap_type {
VM_CAP_MTRAP_EXIT,
VM_CAP_PAUSE_EXIT,
VM_CAP_UNRESTRICTED_GUEST,
+   VM_CAP_ENABLE_INVPCID,
VM_CAP_MAX
 };
 

Modified: head/sys/amd64/vmm/intel/vmx.c
==
--- head/sys/amd64/vmm/intel/vmx.c  Wed Oct 16 17:16:40 2013
(r256644)
+++ head/sys/amd64/vmm/intel/vmx.c  Wed Oct 16 18:20:27 2013
(r256645)
@@ -164,6 +164,7 @@ static int cap_halt_exit;
 static int cap_pause_exit;
 static int cap_unrestricted_guest;
 static int cap_monitor_trap;
+static int cap_invpcid;
  
 static struct unrhdr *vpid_unr;
 static u_int vpid_alloc_failed;
@@ -660,6 +661,11 @@ vmx_init(void)
PROCBASED2_UNRESTRICTED_GUEST, 0,
&tmp) == 0);
 
+   cap_invpcid = (vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2,
+   MSR_VMX_PROCBASED_CTLS2, PROCBASED2_ENABLE_INVPCID, 0,
+   &tmp) == 0);
+
+
/* Initialize EPT */
error = ept_init();
if (error) {
@@ -828,6 +834,7 @@ vmx_vminit(struct vm *vm, pmap_t pmap)
 
vmx->cap[i].set = 0;
vmx->cap[i].proc_ctls = procbased_ctls;
+   vmx->cap[i].proc_ctls2 = procbased_ctls2;
 
vmx->state[i].lastcpu = -1;
vmx->state[i].vpid = vpid[i];
@@ -1932,6 +1939,10 @@ vmx_getcap(void *arg, int vcpu, int type
if (cap_unrestricted_guest)
ret = 0;
break;
+   case VM_CAP_ENABLE_INVPCID:
+   if (cap_invpcid)
+   ret = 0;
+   break;
default:
break;
}
@@ -1988,11 +1999,21 @@ vmx_setcap(void *arg, int vcpu, int type
case VM_CAP_UNRESTRICTED_GUEST:
if (cap_unrestricted_guest) {
retval = 0;
-   baseval = procbased_ctls2;
+   pptr = &vmx->cap[vcpu].proc_ctls2;
+   baseval = *pptr;
flag = PROCBASED2_UNRESTRICTED_GUEST;
reg = VMCS_SEC_PROC_BASED_CTLS;
}
break;
+   case VM_CAP_ENABLE_INVPCID:
+   if (cap_invpcid) {
+   retval = 0;
+   pptr = &vmx->cap[vcpu].proc_ctls2;
+   baseval = *pptr;
+   flag = PROCBASED2_ENABLE_INVPCID;
+   reg = VMCS_SEC_PROC_BASED

svn commit: r256646 - head/usr.sbin/freebsd-update

2013-10-16 Thread Colin Percival
Author: cperciva
Date: Wed Oct 16 18:36:53 2013
New Revision: 256646
URL: http://svnweb.freebsd.org/changeset/base/256646

Log:
  When installing updates, install new directories first and remove old
  directories last.
  
  This is generally handled by the fact that the list of filesystem objects
  is sorted, but this sorting is broken by code which moves .so files ahead
  (so that they're present before any binaries which use them)... that code
  also moved .so files ahead of directories, which is a problem for upgrading
  to 10.0 where there's a new directory containing new .so files.
  
  Errata Notice Candidate.

Modified:
  head/usr.sbin/freebsd-update/freebsd-update.sh

Modified: head/usr.sbin/freebsd-update/freebsd-update.sh
==
--- head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 16 18:20:27 
2013(r256645)
+++ head/usr.sbin/freebsd-update/freebsd-update.sh  Wed Oct 16 18:36:53 
2013(r256646)
@@ -2814,15 +2814,23 @@ Kernel updates have been installed.  Ple
 
# If we haven't already dealt with the world, deal with it.
if ! [ -f $1/worlddone ]; then
+   # Create any necessary directories first
+   grep -vE '^/boot/' $1/INDEX-NEW |
+   grep -E '^[^|]+\|d\|' > INDEX-NEW
+   install_from_index INDEX-NEW || return 1
+
# Install new shared libraries next
grep -vE '^/boot/' $1/INDEX-NEW |
+   grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
 
# Deal with everything else
grep -vE '^/boot/' $1/INDEX-OLD |
+   grep -vE '^[^|]+\|d\|' |
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
grep -vE '^/boot/' $1/INDEX-NEW |
+   grep -vE '^[^|]+\|d\|' |
grep -vE '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
install_from_index INDEX-NEW || return 1
install_delete INDEX-OLD INDEX-NEW || return 1
@@ -2868,11 +2876,20 @@ again to finish installing updates.
 
# Remove old shared libraries
grep -vE '^/boot/' $1/INDEX-NEW |
+   grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-NEW
grep -vE '^/boot/' $1/INDEX-OLD |
+   grep -vE '^[^|]+\|d\|' |
grep -E '/lib/.*\.so\.[0-9]+\|' > INDEX-OLD
install_delete INDEX-OLD INDEX-NEW || return 1
 
+   # Remove old directories
+   grep -vE '^/boot/' $1/INDEX-OLD |
+   grep -E '^[^|]+\|d\|' > INDEX-OLD
+   grep -vE '^/boot/' $1/INDEX-OLD |
+   grep -E '^[^|]+\|d\|' > INDEX-OLD
+   install_delete INDEX-OLD INDEX-NEW || return 1
+
# Remove temporary files
rm INDEX-OLD INDEX-NEW
 }
___
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: r256647 - head/sys/arm/arm

2013-10-16 Thread Ian Lepore
Author: ian
Date: Wed Oct 16 19:06:44 2013
New Revision: 256647
URL: http://svnweb.freebsd.org/changeset/base/256647

Log:
  Invalidate the entire L2 cache before enabling it.  Say whether it
  has been enabled or disabled.

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

Modified: head/sys/arm/arm/pl310.c
==
--- head/sys/arm/arm/pl310.cWed Oct 16 18:36:53 2013(r256646)
+++ head/sys/arm/arm/pl310.cWed Oct 16 19:06:44 2013(r256647)
@@ -341,8 +341,13 @@ pl310_attach(device_t dev)
ctrl_value = pl310_read4(sc, PL310_CTRL);
 
if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) {
+   /* invalidate current content */
+   pl310_write4(pl310_softc, PL310_INV_WAY, 0x);
+   pl310_wait_background_op(PL310_INV_WAY, 0x);
+
/* Enable the L2 cache if disabled */
platform_pl310_write_ctrl(sc, CTRL_ENABLED);
+   device_printf(dev, "L2 Cache enabled\n");
} 
 
if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) {
@@ -375,6 +380,7 @@ pl310_attach(device_t dev)
EVENT_COUNTER_CTRL_C0_RESET | 
EVENT_COUNTER_CTRL_C1_RESET);
 
+   device_printf(dev, "L2 Cache disabled\n");
}
 
if (sc->sc_enabled)
___
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: r256648 - head/sys/mips/atheros

2013-10-16 Thread Adrian Chadd
Author: adrian
Date: Wed Oct 16 19:36:50 2013
New Revision: 256648
URL: http://svnweb.freebsd.org/changeset/base/256648

Log:
  Allow the MDIO bus frequency to be selected.
  
  The MDIO bus frequency is configured as a divisor off of the MDIO bus
  reference clock.  For the AR9344 and later, the MDIO bus frequency can
  be faster than normal (ie, up to 100MHz) and thus a static divisor may
  not be very applicable.
  
  So, for those boards that may require an actual frequency to be selected
  regardless of what crazy stuff the vendor throws in uboot, one can now
  set the MDIO bus frequency.  It uses the MDIO frequency and the target
  frequency to choose a divisor that doesn't exceed the target frequency.
  
  By default it will choose:
  
  * DIV_28 on everything; except
  * DIV_58 on the AR9344 to be conservative.
  
  Whilst I'm here, add some comments about the defaults being not quite
  right.  For the other internal switch devices (like the AR933x, AR724x)
  the divisor can be higher - it's internal and the reference MDIO clock
  is much lower than 100MHz.
  
  The divisor tables and loop code is inspired from Linux/OpenWRT.  It's very
  simple; I didn't feel that reimplementing it would yield a substantially
  different solution.
  
  Tested:
  
  * AR9331 (mips24k)
  * AR9344 (mips74k)
  
  Obtained from:Linux/OpenWRT

Modified:
  head/sys/mips/atheros/if_arge.c
  head/sys/mips/atheros/if_argevar.h

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Wed Oct 16 19:06:44 2013
(r256647)
+++ head/sys/mips/atheros/if_arge.c Wed Oct 16 19:36:50 2013
(r256648)
@@ -345,10 +345,101 @@ arge_reset_mac(struct arge_softc *sc)
 }
 
 /*
+ * These values map to the divisor values programmed into
+ * AR71XX_MAC_MII_CFG.
+ *
+ * The index of each value corresponds to the divisor section
+ * value in AR71XX_MAC_MII_CFG (ie, table[0] means '0' in
+ * AR71XX_MAC_MII_CFG, table[1] means '1', etc.)
+ */
+static const uint32_t ar71xx_mdio_div_table[] = {
+   4, 4, 6, 8, 10, 14, 20, 28,
+};
+
+static const uint32_t ar7240_mdio_div_table[] = {
+   2, 2, 4, 6, 8, 12, 18, 26, 32, 40, 48, 56, 62, 70, 78, 96,
+};
+
+static const uint32_t ar933x_mdio_div_table[] = {
+   4, 4, 6, 8, 10, 14, 20, 28, 34, 42, 50, 58, 66, 74, 82, 98,
+};
+
+/*
+ * Lookup the divisor to use based on the given frequency.
+ *
+ * Returns the divisor to use, or -ve on error.
+ */
+static int
+arge_mdio_get_divider(struct arge_softc *sc, unsigned long mdio_clock)
+{
+   unsigned long ref_clock, t;
+   const uint32_t *table;
+   int ndivs;
+   int i;
+
+   /*
+* This is the base MDIO frequency on the SoC.
+* The dividers .. well, divide. Duh.
+*/
+   ref_clock = ar71xx_mdio_freq();
+
+   /*
+* If either clock is undefined, just tell the
+* caller to fall through to the defaults.
+*/
+   if (ref_clock == 0 || mdio_clock == 0)
+   return (-EINVAL);
+
+   /*
+* Pick the correct table!
+*/
+   switch (ar71xx_soc) {
+   case AR71XX_SOC_AR9330:
+   case AR71XX_SOC_AR9331:
+   case AR71XX_SOC_AR9341:
+   case AR71XX_SOC_AR9342:
+   case AR71XX_SOC_AR9344:
+   table = ar933x_mdio_div_table;
+   ndivs = nitems(ar933x_mdio_div_table);
+   break;
+
+   case AR71XX_SOC_AR7240:
+   case AR71XX_SOC_AR7241:
+   case AR71XX_SOC_AR7242:
+   table = ar7240_mdio_div_table;
+   ndivs = nitems(ar7240_mdio_div_table);
+   break;
+
+   default:
+   table = ar71xx_mdio_div_table;
+   ndivs = nitems(ar71xx_mdio_div_table);
+   }
+
+   /*
+* Now, walk through the list and find the first divisor
+* that falls under the target MDIO frequency.
+*
+* The divisors go up, but the corresponding frequencies
+* are actually decreasing.
+*/
+   for (i = 0; i < ndivs; i++) {
+   t = ref_clock / table[i];
+   if (t <= mdio_clock) {
+   return (i);
+   }
+   }
+
+   ARGEDEBUG(sc, ARGE_DBG_RESET,
+   "No divider found; MDIO=%lu Hz; target=%lu Hz\n",
+   ref_clock, mdio_clock);
+   return (-ENOENT);
+}
+
+/*
  * Fetch the MDIO bus clock rate.
  *
  * For now, the default is DIV_28 for everything
- * bar AR934x, which will be DIV_42.
+ * bar AR934x, which will be DIV_58.
  *
  * It will definitely need updating to take into account
  * the MDIO bus core clock rate and the target clock
@@ -357,12 +448,48 @@ arge_reset_mac(struct arge_softc *sc)
 static uint32_t
 arge_fetch_mdiobus_clock_rate(struct arge_softc *sc)
 {
+   int mdio_freq, div;
+
+   /*
+* Is the MDIO frequency defined? If so, find a divisor that
+* makes reasonable sense. 

Re: svn commit: r256587 - in head/sys: kern sys

2013-10-16 Thread Adrian Chadd
.. so what brought this on? I can see this fixing issues for things where a
virtual device is created with taskqueues (eg a tap device of some sort)
that get stuffed into a vnet context. But for physical interfaces whose
taskqueues don't have a specific vnet context and may need to set it
per-packet, what may this break?

Ie - what did this fix, and why isn't it being fixed in all the various
taskqueues in device drivers?

I'd rather not see the taskqueue setup (which knows nothing about network
contexts at all) grow this just to solve a bunch of places where the task
in question can just correctly initialise the context itself when it's
called.

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: r256649 - head/sys/mips/atheros

2013-10-16 Thread Adrian Chadd
Author: adrian
Date: Wed Oct 16 19:53:50 2013
New Revision: 256649
URL: http://svnweb.freebsd.org/changeset/base/256649

Log:
  Whilst here, document that this TX alignment requirement may acutally
  not be required on later hardware.
  
  It would allow for higher packet rates so yes, it would be nice
  to disable it.

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==
--- head/sys/mips/atheros/if_arge.c Wed Oct 16 19:36:50 2013
(r256648)
+++ head/sys/mips/atheros/if_arge.c Wed Oct 16 19:53:50 2013
(r256649)
@@ -1261,6 +1261,10 @@ arge_init_locked(struct arge_softc *sc)
  * The TX engine requires each fragment to be aligned to a
  * 4 byte boundary and the size of each fragment except
  * the last to be a multiple of 4 bytes.
+ *
+ * XXX TODO: I believe this is only a bug on the AR71xx and
+ * AR913x MACs. The later MACs (AR724x and later) does not
+ * need this workaround.
  */
 static int
 arge_mbuf_chain_is_tx_aligned(struct mbuf *m0)
@@ -1294,6 +1298,10 @@ arge_encap(struct arge_softc *sc, struct
/*
 * Fix mbuf chain, all fragments should be 4 bytes aligned and
 * even 4 bytes
+*
+* XXX TODO: I believe this is only a bug on the AR71xx and
+* AR913x MACs. The later MACs (AR724x and later) does not
+* need this workaround.
 */
m = *m_head;
if (! arge_mbuf_chain_is_tx_aligned(m)) {
___
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: r256650 - head/usr.sbin/kldxref

2013-10-16 Thread Jilles Tjoelker
Author: jilles
Date: Wed Oct 16 20:04:06 2013
New Revision: 256650
URL: http://svnweb.freebsd.org/changeset/base/256650

Log:
  kldxref: Add static keyword to the new function only used in the same file.
  
  The WARNS level is not such that the omission broke the build.
  
  Reported by:  mdf

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

Modified: head/usr.sbin/kldxref/kldxref.c
==
--- head/usr.sbin/kldxref/kldxref.c Wed Oct 16 19:53:50 2013
(r256649)
+++ head/usr.sbin/kldxref/kldxref.c Wed Oct 16 20:04:06 2013
(r256650)
@@ -274,7 +274,7 @@ usage(void)
exit(1);
 }
 
-int 
+static int
 compare(const FTSENT *const *a, const FTSENT *const *b)
 {
if ((*a)->fts_info == FTS_D && (*b)->fts_info != FTS_D)
___
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: r228969 - head/sys/netinet

2013-10-16 Thread John Baldwin
On Sunday, July 01, 2012 1:48:23 pm Mikolaj Golub wrote:
> 
> On Mon, 2 Apr 2012 08:48:04 -0400 John Baldwin wrote:
> 
>  JB> On Sunday, April 01, 2012 8:05:00 am Mikolaj Golub wrote:
>  >> Hi,
>  >> 
>  >> On 12/29/11, John Baldwin  wrote:
>  >> > Author: jhb
>  >> > Date: Thu Dec 29 20:41:16 2011
>  >> > New Revision: 228969
>  >> > URL: http://svn.freebsd.org/changeset/base/228969
>  >> >
>  >> > Log:
>  >> >   Defer the work of freeing IPv4 multicast options from a socket to an
>  >> >   asychronous task.  This avoids tearing down multicast state including
>  >> >   sending IGMP leave messages and reprogramming MAC filters while 
> holding
>  >> >   the per-protocol global pcbinfo lock that is used in the receive path 
> of
>  >> >   packet processing.
>  >> >
>  >> >   Reviewed by:rwatson
>  >> >   MFC after:1 month
>  >> >
>  >> > Modified:
>  >> >   head/sys/netinet/in_mcast.c
>  >> >   head/sys/netinet/ip_var.h
>  >> >
>  >> > Modified: head/sys/netinet/in_mcast.c
>  >> > 
> ==
>  >> > --- head/sys/netinet/in_mcast.cThu Dec 29 19:01:29 2011
> (r228968)
>  >> > +++ head/sys/netinet/in_mcast.cThu Dec 29 20:41:16 2011
> (r228969)
>  >> > @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
>  >> >  #include 
>  >> >  #include 
>  >> >  #include 
>  >> > +#include 
>  >> >  #include 
>  >> >
>  >> >  #include 
>  >> > @@ -144,6 +145,8 @@ static voidinm_purge(struct in_multi *)
>  >> >  static voidinm_reap(struct in_multi *);
>  >> >  static struct ip_moptions *
>  >> >  inp_findmoptions(struct inpcb *);
>  >> > +static voidinp_freemoptions_internal(struct ip_moptions *);
>  >> > +static voidinp_gcmoptions(void *, int);
>  >> >  static intinp_get_source_filters(struct inpcb *, struct 
> sockopt *);
>  >> >  static intinp_join_group(struct inpcb *, struct sockopt *);
>  >> >  static intinp_leave_group(struct inpcb *, struct sockopt *);
>  >> > @@ -179,6 +182,10 @@ static SYSCTL_NODE(_net_inet_ip_mcast, O
>  >> >  CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_ip_mcast_filters,
>  >> >  "Per-interface stack-wide source filters");
>  >> >
>  >> > +static STAILQ_HEAD(, ip_moptions) imo_gc_list =
>  >> > +STAILQ_HEAD_INITIALIZER(imo_gc_list);
>  >> > +static struct task imo_gc_task = TASK_INITIALIZER(0, inp_gcmoptions, 
> NULL);
>  >> > +
>  >> >  /*
>  >> >   * Inline function which wraps assertions for a valid ifp.
>  >> >   * The ifnet layer will set the ifma's ifp pointer to NULL if the ifp
>  >> > @@ -1518,17 +1525,29 @@ inp_findmoptions(struct inpcb *inp)
>  >> >  }
>  >> >
>  >> >  /*
>  >> > - * Discard the IP multicast options (and source filters).
>  >> > + * Discard the IP multicast options (and source filters).  To minimize
>  >> > + * the amount of work done while holding locks such as the INP's
>  >> > + * pcbinfo lock (which is used in the receive path), the free
>  >> > + * operation is performed asynchronously in a separate task.
>  >> >   *
>  >> >   * SMPng: NOTE: assumes INP write lock is held.
>  >> >   */
>  >> >  void
>  >> >  inp_freemoptions(struct ip_moptions *imo)
>  >> >  {
>  >> > -struct in_mfilter*imf;
>  >> > -size_t idx, nmships;
>  >> >
>  >> >  KASSERT(imo != NULL, ("%s: ip_moptions is NULL", __func__));
>  >> > +IN_MULTI_LOCK();
>  >> > +STAILQ_INSERT_TAIL(&imo_gc_list, imo, imo_link);
>  >> > +IN_MULTI_UNLOCK();
>  >> > +taskqueue_enqueue(taskqueue_thread, &imo_gc_task);
>  >> > +}
>  >> > +
>  >> > +static void
>  >> > +inp_freemoptions_internal(struct ip_moptions *imo)
>  >> > +{
>  >> > +struct in_mfilter*imf;
>  >> > +size_t idx, nmships;
>  >> >
>  >> >  nmships = imo->imo_num_memberships;
>  >> >  for (idx = 0; idx < nmships; ++idx) {
>  >> > @@ -1546,6 +1565,22 @@ inp_freemoptions(struct ip_moptions *imo
>  >> >  free(imo, M_IPMOPTS);
>  >> >  }
>  >> >
>  >> > +static void
>  >> > +inp_gcmoptions(void *context, int pending)
>  >> > +{
>  >> > +struct ip_moptions *imo;
>  >> > +
>  >> > +IN_MULTI_LOCK();
>  >> > +while (!STAILQ_EMPTY(&imo_gc_list)) {
>  >> > +imo = STAILQ_FIRST(&imo_gc_list);
>  >> > +STAILQ_REMOVE_HEAD(&imo_gc_list, imo_link);
>  >> > +IN_MULTI_UNLOCK();
>  >> > +inp_freemoptions_internal(imo);
>  >> > +IN_MULTI_LOCK();
>  >> > +}
>  >> > +IN_MULTI_UNLOCK();
>  >> > +}
>  >> > +
>  >> >  /*
>  >> >   * Atomically get source filters on a socket for an IPv4 multicast 
> group.
>  >> >   * Called with INP lock held; returns with lock released.
>  >> >
>  >> > Modified: head/sys/netinet/ip_var.h
>  >> > 
> ==
>  >> > ---

svn commit: r256657 - in head: share/examples/bhyve usr.sbin/bhyveload

2013-10-16 Thread Neel Natu
Author: neel
Date: Thu Oct 17 00:28:35 2013
New Revision: 256657
URL: http://svnweb.freebsd.org/changeset/base/256657

Log:
  Add an option to bhyveload(8) that allows setting a loader environment 
variable
  from the command line.
  
  The option syntax is "-e ". It may be used multiple times to set
  multiple environment variables.
  
  Reviewed by:  grehan
  Requested by: alfred

Modified:
  head/share/examples/bhyve/vmrun.sh
  head/usr.sbin/bhyveload/bhyveload.8
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/share/examples/bhyve/vmrun.sh
==
--- head/share/examples/bhyve/vmrun.sh  Thu Oct 17 00:07:21 2013
(r256656)
+++ head/share/examples/bhyve/vmrun.sh  Thu Oct 17 00:28:35 2013
(r256657)
@@ -39,11 +39,12 @@ DEFAULT_VIRTIO_DISK="./diskdev"
 DEFAULT_ISOFILE="./release.iso"
 
 usage() {
-   echo "Usage: vmrun.sh [-hai][-g ][-m ][-d ][-I ][-t ] "
+   echo "Usage: vmrun.sh [-hai][-g ][-m ][-d ][-e ][-I ][-t ] 
"
echo "   -h: display this help message"
echo "   -a: force memory mapped local apic access"
echo "   -c: number of virtual cpus (default is ${DEFAULT_CPUS})"
echo "   -d: virtio diskdev file (default is 
${DEFAULT_VIRTIO_DISK})"
+   echo "   -e: set FreeBSD loader environment variable"
echo "   -g: listen for connection from kgdb at "
echo "   -i: force boot of the Installation CDROM image"
echo "   -I: Installation CDROM image location (default is 
${DEFAULT_ISOFILE})"
@@ -73,8 +74,9 @@ virtio_diskdev=${DEFAULT_VIRTIO_DISK}
 tapdev=${DEFAULT_TAPDEV}
 apic_opt=""
 gdbport=0
+env_opt=""
 
-while getopts haic:g:I:m:d:t: c ; do
+while getopts haic:e:g:I:m:d:t: c ; do
case $c in
h)
usage
@@ -85,6 +87,9 @@ while getopts haic:g:I:m:d:t: c ; do
d)
virtio_diskdev=${OPTARG}
;;
+   e)
+   env_opt="${env_opt} -e ${OPTARG}"
+   ;;
g)  gdbport=${OPTARG}
;;
i)
@@ -163,7 +168,7 @@ while [ 1 ]; do
installer_opt=""
fi
 
-   ${LOADER} -m ${memsize} -d ${BOOTDISK} ${vmname}
+   ${LOADER} -m ${memsize} -d ${BOOTDISK} ${env_opt} ${vmname}
if [ $? -ne 0 ]; then
break
fi

Modified: head/usr.sbin/bhyveload/bhyveload.8
==
--- head/usr.sbin/bhyveload/bhyveload.8 Thu Oct 17 00:07:21 2013
(r256656)
+++ head/usr.sbin/bhyveload/bhyveload.8 Thu Oct 17 00:28:35 2013
(r256657)
@@ -38,6 +38,7 @@ guest inside a bhyve virtual machine
 .Op Fl m Ar mem-size
 .Op Fl d Ar disk-path
 .Op Fl h Ar host-path
+.Op Fl e Ar name=value
 .Ar vmname
 .Sh DESCRIPTION
 .Nm
@@ -91,6 +92,14 @@ is the pathname of the guest's boot disk
 The
 .Ar host-path
 is the directory at the top of the guest's boot filesystem.
+.It Fl e Ar name=value
+Set the FreeBSD loader environment variable
+.Ar name
+to
+.Ar value .
+.Pp
+The option may be used more than once to set more than one environment
+variable.
 .El
 .Sh EXAMPLES
 To create a virtual machine named

Modified: head/usr.sbin/bhyveload/bhyveload.c
==
--- head/usr.sbin/bhyveload/bhyveload.c Thu Oct 17 00:07:21 2013
(r256656)
+++ head/usr.sbin/bhyveload/bhyveload.c Thu Oct 17 00:28:35 2013
(r256657)
@@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -498,23 +499,37 @@ cb_getmem(void *arg, uint64_t *ret_lowme
vm_get_memory_seg(ctx, 4 * GB, ret_highmem, NULL);
 }
 
+struct env {
+   const char *str;/* name=value */
+   SLIST_ENTRY(env) next;
+};
+
+static SLIST_HEAD(envhead, env) envhead;
+
+static void
+addenv(const char *str)
+{
+   struct env *env;
+
+   env = malloc(sizeof(struct env));
+   env->str = str;
+   SLIST_INSERT_HEAD(&envhead, env, next);
+}
+
 static const char *
 cb_getenv(void *arg, int num)
 {
-   int max;
+   int i;
+   struct env *env;
 
-   static const char * var[] = {
-   "smbios.bios.vendor=BHYVE",
-   "boot_serial=1",
-   NULL
-   };
-
-   max = sizeof(var) / sizeof(var[0]);
+   i = 0;
+   SLIST_FOREACH(env, &envhead, next) {
+   if (i == num)
+   return (env->str);
+   i++;
+   }
 
-   if (num < max)
-   return (var[num]);
-   else
-   return (NULL);
+   return (NULL);
 }
 
 static struct loader_callbacks cb = {
@@ -553,8 +568,8 @@ usage(void)
 {
 
fprintf(stderr,
-   "usage: %s [-m mem-size][-d ] [-h ] "
-   "\n", progname);
+   "usage: %s [-m mem-size][-d ] [-h ] "
+   "[-e ] \n", progname);
exit(1);
 }
 
@@

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

2013-10-16 Thread Rui Paulo
Author: rpaulo
Date: Thu Oct 17 01:53:07 2013
New Revision: 256658
URL: http://svnweb.freebsd.org/changeset/base/256658

Log:
  Move a lot of debugging printf's to DPRINTF.
  
  Approved by:  adrian
  MFC after:2 weeks

Modified:
  head/sys/dev/ath/if_ath.c
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Thu Oct 17 00:28:35 2013(r256657)
+++ head/sys/dev/ath/if_ath.c   Thu Oct 17 01:53:07 2013(r256658)
@@ -2725,7 +2725,7 @@ ath_transmit(struct ifnet *ifp, struct m
 */
ATH_PCU_LOCK(sc);
if (sc->sc_inreset_cnt > 0) {
-   device_printf(sc->sc_dev,
+   DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: sc_inreset_cnt > 0; bailing\n", __func__);
ATH_PCU_UNLOCK(sc);
IF_LOCK(&ifp->if_snd);
@@ -6430,7 +6430,7 @@ ath_node_recv_pspoll(struct ieee80211_no
 * Immediately punt.
 */
if (! an->an_is_powersave) {
-   device_printf(sc->sc_dev,
+   DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
"%s: %6D: not in powersave?\n",
__func__,
ni->ni_macaddr,
@@ -6498,7 +6498,8 @@ ath_node_recv_pspoll(struct ieee80211_no
/*
 * XXX nothing in the TIDs at this point? Eek.
 */
-   device_printf(sc->sc_dev, "%s: %6D: TIDs empty, but ath_node showed 
traffic?!\n",
+   DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
+   "%s: %6D: TIDs empty, but ath_node showed traffic?!\n",
__func__,
ni->ni_macaddr,
":");

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cThu Oct 17 00:28:35 2013
(r256657)
+++ head/sys/dev/ath/if_ath_tx.cThu Oct 17 01:53:07 2013
(r256658)
@@ -268,7 +268,7 @@ ath_txfrag_setup(struct ath_softc *sc, a
/* XXX non-management? */
bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL);
if (bf == NULL) {   /* out of buffers, cleanup */
-   device_printf(sc->sc_dev, "%s: no buffer?\n",
+   DPRINTF(sc, ATH_DEBUG_XMIT, "%s: no buffer?\n",
__func__);
ath_txfrag_cleanup(sc, frags, ni);
break;
@@ -560,10 +560,10 @@ ath_tx_setds_11n(struct ath_softc *sc, s
bf = bf_first;
 
if (bf->bf_state.bfs_txrate0 == 0)
-   device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
+   DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, txrate0=%d\n",
__func__, bf, 0);
if (bf->bf_state.bfs_rc[0].ratecode == 0)
-   device_printf(sc->sc_dev, "%s: bf=%p, rix0=%d\n",
+   DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: bf=%p, rix0=%d\n",
__func__, bf, 0);
 
/*
@@ -708,11 +708,9 @@ ath_tx_handoff_mcast(struct ath_softc *s
 * mapped correctly.
 */
if (bf->bf_state.bfs_tx_queue != sc->sc_cabq->axq_qnum) {
-   device_printf(sc->sc_dev,
+   DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n",
-   __func__,
-   bf,
-   bf->bf_state.bfs_tx_queue,
+   __func__, bf, bf->bf_state.bfs_tx_queue,
txq->axq_qnum);
}
 
@@ -881,11 +879,9 @@ ath_tx_handoff_hw(struct ath_softc *sc, 
 * checking and holding buffer manipulation is sane.
 */
if (bf->bf_state.bfs_tx_queue != txq->axq_qnum) {
-   device_printf(sc->sc_dev,
+   DPRINTF(sc, ATH_DEBUG_XMIT,
"%s: bf=%p, bfs_tx_queue=%d, axq_qnum=%d\n",
-   __func__,
-   bf,
-   bf->bf_state.bfs_tx_queue,
+   __func__, bf, bf->bf_state.bfs_tx_queue,
txq->axq_qnum);
}
 
@@ -1343,8 +1339,8 @@ ath_tx_setds(struct ath_softc *sc, struc
struct ath_hal *ah = sc->sc_ah;
 
if (bf->bf_state.bfs_txrate0 == 0)
-   device_printf(sc->sc_dev, "%s: bf=%p, txrate0=%d\n",
-   __func__, bf, 0);
+   DPRINTF(sc, ATH_DEBUG_XMIT, 
+   "%s: bf=%p, txrate0=%d\n", __func__, bf, 0);
 
ath_hal_setuptxdesc(ah, ds
, bf->bf_state.bfs_pktlen   /* packet length */
@@ -1481,14 +1477,10 @@ ath_tx_should_swq_frame(struct ath_softc
 * Other control/mgmt frame; bypass software queuing
 * for now!
 */
-   device_printf(sc->sc_dev,
+   DPRINTF(sc, ATH_DEBUG_XMIT, 
"%s: %6D: Node is asleep; sending mgmt "
"(type=%d, subtype=%d)\n",
-   __func__

svn commit: r256659 - head/sbin/iscontrol

2013-10-16 Thread Kevin Lo
Author: kevlo
Date: Thu Oct 17 01:59:08 2013
New Revision: 256659
URL: http://svnweb.freebsd.org/changeset/base/256659

Log:
  Check for EHOSTUNREACH when establishing a connection.
  
  Reviewed by:  trasz

Modified:
  head/sbin/iscontrol/fsm.c

Modified: head/sbin/iscontrol/fsm.c
==
--- head/sbin/iscontrol/fsm.c   Thu Oct 17 01:53:07 2013(r256658)
+++ head/sbin/iscontrol/fsm.c   Thu Oct 17 01:59:08 2013(r256659)
@@ -199,6 +199,7 @@ tcpConnect(isess_t *sess)
  perror("connect");
  switch(sv_errno) {
  case ECONNREFUSED:
+ case EHOSTUNREACH:
  case ENETUNREACH:
  case ETIMEDOUT:
  if((sess->flags & SESS_REDIRECT) == 0) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r256660 - head/tools/build/mk

2013-10-16 Thread Andrey Zonov
Author: zont
Date: Thu Oct 17 02:02:29 2013
New Revision: 256660
URL: http://svnweb.freebsd.org/changeset/base/256660

Log:
  Remove duplicates in ipfilter and kerberos sections

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 01:59:08 
2013(r256659)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 02:02:29 
2013(r256660)
@@ -2052,6 +2052,7 @@ OLD_FILES+=rescue/ping6
 
 .if ${MK_IPFILTER} == no
 OLD_FILES+=etc/periodic/security/510.ipfdenied
+OLD_FILES+=etc/periodic/security/610.ipf6denied
 OLD_FILES+=rescue/ipf
 OLD_FILES+=sbin/ipf
 OLD_FILES+=sbin/ipfs
@@ -2128,8 +2129,6 @@ OLD_FILES+=usr/share/man/man8/ipfstat.8.
 OLD_FILES+=usr/share/man/man8/ipmon.8.gz
 OLD_FILES+=usr/share/man/man8/ipnat.8.gz
 OLD_FILES+=usr/share/man/man8/ippool.8.gz
-OLD_FILES+=etc/periodic/security/510.ipfdenied
-OLD_FILES+=etc/periodic/security/610.ipf6denied
 .endif
 
 .if ${MK_IPFW} == no
@@ -2258,7 +2257,6 @@ OLD_FILES+=usr/lib/libcom_err.a
 OLD_FILES+=usr/lib/libcom_err.so
 OLD_LIBS+=usr/lib/libcom_err.so.5
 OLD_FILES+=usr/lib/libcom_err_p.a
-OLD_FILES+=usr/lib/libcom_err_p.a
 OLD_FILES+=usr/lib/libgssapi_krb5.a
 OLD_FILES+=usr/lib/libgssapi_krb5.so
 OLD_LIBS+=usr/lib/libgssapi_krb5.so.10
@@ -2637,27 +2635,16 @@ OLD_FILES+=usr/share/man/man3/hx509_veri
 OLD_FILES+=usr/share/man/man3/hx509_verify_signature.3.gz
 OLD_FILES+=usr/share/man/man3/hx509_xfree.3.gz
 OLD_FILES+=usr/share/man/man3/k_afs_cell_of_file.3.gz
-OLD_FILES+=usr/share/man/man3/k_afs_cell_of_file.3.gz
-OLD_FILES+=usr/share/man/man3/k_hasafs.3.gz
 OLD_FILES+=usr/share/man/man3/k_hasafs.3.gz
 OLD_FILES+=usr/share/man/man3/k_pioctl.3.gz
-OLD_FILES+=usr/share/man/man3/k_pioctl.3.gz
 OLD_FILES+=usr/share/man/man3/k_setpag.3.gz
-OLD_FILES+=usr/share/man/man3/k_setpag.3.gz
-OLD_FILES+=usr/share/man/man3/k_unlog.3.gz
 OLD_FILES+=usr/share/man/man3/k_unlog.3.gz
 OLD_FILES+=usr/share/man/man3/kadm5_pwcheck.3.gz
 OLD_FILES+=usr/share/man/man3/kafs.3.gz
-OLD_FILES+=usr/share/man/man3/kafs.3.gz
-OLD_FILES+=usr/share/man/man3/kafs5.3.gz
 OLD_FILES+=usr/share/man/man3/kafs5.3.gz
 OLD_FILES+=usr/share/man/man3/kafs_set_verbose.3.gz
-OLD_FILES+=usr/share/man/man3/kafs_set_verbose.3.gz
-OLD_FILES+=usr/share/man/man3/kafs_settoken.3.gz
 OLD_FILES+=usr/share/man/man3/kafs_settoken.3.gz
 OLD_FILES+=usr/share/man/man3/kafs_settoken5.3.gz
-OLD_FILES+=usr/share/man/man3/kafs_settoken5.3.gz
-OLD_FILES+=usr/share/man/man3/kafs_settoken_rxkad.3.gz
 OLD_FILES+=usr/share/man/man3/kafs_settoken_rxkad.3.gz
 OLD_FILES+=usr/share/man/man3/krb5.3.gz
 OLD_FILES+=usr/share/man/man3/krb524_convert_creds_kdc.3.gz
@@ -2680,8 +2667,6 @@ OLD_FILES+=usr/share/man/man3/krb5_addre
 OLD_FILES+=usr/share/man/man3/krb5_address_prefixlen_boundary.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_address_search.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_afslog.3.gz
-OLD_FILES+=usr/share/man/man3/krb5_afslog.3.gz
-OLD_FILES+=usr/share/man/man3/krb5_afslog_uid.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_afslog_uid.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_allow_weak_crypto.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_aname_to_localname.3.gz
@@ -2718,7 +2703,6 @@ OLD_FILES+=usr/share/man/man3/krb5_auth_
 OLD_FILES+=usr/share/man/man3/krb5_auth_getkeytype.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_auth_getlocalseqnumber.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_auth_getremoteseqnumber.3.gz
-OLD_FILES+=usr/share/man/man3/krb5_auth_getremoteseqnumber.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_auth_setcksumtype.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_auth_setkeytype.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_auth_setlocalseqnumber.3.gz
@@ -2865,7 +2849,6 @@ OLD_FILES+=usr/share/man/man3/krb5_free_
 OLD_FILES+=usr/share/man/man3/krb5_free_addresses.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_config_files.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_context.3.gz
-OLD_FILES+=usr/share/man/man3/krb5_free_context.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_cred_contents.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_creds.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_creds_contents.3.gz
@@ -2873,7 +2856,6 @@ OLD_FILES+=usr/share/man/man3/krb5_free_
 OLD_FILES+=usr/share/man/man3/krb5_free_data_contents.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_error_string.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_host_realm.3.gz
-OLD_FILES+=usr/share/man/man3/krb5_free_host_realm.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_keyblock.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_keyblock_contents.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_free_krbhst.3.gz
@@ -2953,7 +2935,6 @@ OLD_FILES+=usr/share/man/man3/krb5_keyty
 OLD_FILES+=usr/share/man/man3/krb5_krbhst_format_string.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_krbhst_free.3.gz
 OLD_FILES+=usr/share/man/man3/krb5_krbhst_get_addrinfo.3.gz
-OLD_FILES+=usr/shar

svn commit: r256661 - head/lib/libproc

2013-10-16 Thread Mark Johnston
Author: markj
Date: Thu Oct 17 03:39:21 2013
New Revision: 256661
URL: http://svnweb.freebsd.org/changeset/base/256661

Log:
  Fix the libproc build when DEBUG is defined.

Modified:
  head/lib/libproc/_libproc.h

Modified: head/lib/libproc/_libproc.h
==
--- head/lib/libproc/_libproc.h Thu Oct 17 02:02:29 2013(r256660)
+++ head/lib/libproc/_libproc.h Thu Oct 17 03:39:21 2013(r256661)
@@ -49,7 +49,7 @@ struct proc_handle {
 };
 
 #ifdef DEBUG
-#define DPRINTF(fmt, ...)  warn(fmt, __VA_ARGS__)
+#define DPRINTF(...)   warn(__VA_ARGS__)
 #else
-#define DPRINTF(fmt, ...)
+#define DPRINTF(...)
 #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: r256662 - head/tools/build/mk

2013-10-16 Thread Andrey Zonov
Author: zont
Date: Thu Oct 17 04:51:28 2013
New Revision: 256662
URL: http://svnweb.freebsd.org/changeset/base/256662

Log:
  Remove files which are in ObsoleteFiles.inc

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 03:39:21 
2013(r256661)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 04:51:28 
2013(r256662)
@@ -368,7 +368,6 @@ OLD_FILES+=usr/share/calendar/ru_RU.KOI8
 OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.common
 OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.holiday
 OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.military
-OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.msk
 OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.orthodox
 OLD_FILES+=usr/share/calendar/ru_RU.KOI8-R/calendar.pagan
 OLD_FILES+=usr/share/calendar/uk_UA.KOI8-U/calendar.all
@@ -1305,8 +1304,6 @@ OLD_FILES+=usr/games/rot13
 OLD_FILES+=usr/games/strfile
 OLD_FILES+=usr/games/unstr
 OLD_FILES+=usr/share/games/fortune/fortunes
-OLD_FILES+=usr/share/games/fortune/fortunes-o
-OLD_FILES+=usr/share/games/fortune/fortunes-o.dat
 OLD_FILES+=usr/share/games/fortune/fortunes.dat
 OLD_FILES+=usr/share/games/fortune/freebsd-tips
 OLD_FILES+=usr/share/games/fortune/freebsd-tips.dat
@@ -3712,7 +3709,6 @@ OLD_FILES+=usr/lib/libfetch_p.a
 OLD_FILES+=usr/lib/libfl_p.a
 OLD_FILES+=usr/lib/libform_p.a
 OLD_FILES+=usr/lib/libformw_p.a
-OLD_FILES+=usr/lib/libftpio_p.a
 OLD_FILES+=usr/lib/libgcc_p.a
 OLD_FILES+=usr/lib/libgeom_p.a
 OLD_FILES+=usr/lib/libgnuregex_p.a
@@ -3735,7 +3731,6 @@ OLD_FILES+=usr/lib/libkrb5_p.a
 OLD_FILES+=usr/lib/libkvm_p.a
 OLD_FILES+=usr/lib/libl_p.a
 OLD_FILES+=usr/lib/libln_p.a
-OLD_FILES+=usr/lib/liblwres_p.a
 OLD_FILES+=usr/lib/libm_p.a
 OLD_FILES+=usr/lib/libmagic_p.a
 OLD_FILES+=usr/lib/libmd_p.a
@@ -3744,12 +3739,10 @@ OLD_FILES+=usr/lib/libmenu_p.a
 OLD_FILES+=usr/lib/libmenuw_p.a
 OLD_FILES+=usr/lib/libmilter_p.a
 OLD_FILES+=usr/lib/libmp_p.a
-OLD_FILES+=usr/lib/libncp_p.a
 OLD_FILES+=usr/lib/libncurses_p.a
 OLD_FILES+=usr/lib/libncursesw_p.a
 OLD_FILES+=usr/lib/libnetgraph_p.a
 OLD_FILES+=usr/lib/libngatm_p.a
-OLD_FILES+=usr/lib/libobjc_p.a
 OLD_FILES+=usr/lib/libopie_p.a
 OLD_FILES+=usr/lib/libpanel_p.a
 OLD_FILES+=usr/lib/libpanelw_p.a
@@ -4155,7 +4148,6 @@ OLD_FILES+=etc/periodic/monthly/200.acco
 OLD_FILES+=usr/bin/last
 OLD_FILES+=usr/bin/users
 OLD_FILES+=usr/bin/who
-OLD_FILES+=usr/bin/wtmpcvt
 OLD_FILES+=usr/sbin/ac
 OLD_FILES+=usr/sbin/lastlogin
 OLD_FILES+=usr/sbin/utx
@@ -4163,7 +4155,6 @@ OLD_FILES+=usr/sbin/utxrm
 OLD_FILES+=usr/share/man/man1/last.1.gz
 OLD_FILES+=usr/share/man/man1/users.1.gz
 OLD_FILES+=usr/share/man/man1/who.1.gz
-OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz
 OLD_FILES+=usr/share/man/man8/ac.8.gz
 OLD_FILES+=usr/share/man/man8/lastlogin.8.gz
 OLD_FILES+=usr/share/man/man8/utx.8.gz
___
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: r256587 - in head/sys: kern sys

2013-10-16 Thread Gleb Smirnoff
On Wed, Oct 16, 2013 at 12:47:13PM -0700, Adrian Chadd wrote:
A> .. so what brought this on? I can see this fixing issues for things where a
A> virtual device is created with taskqueues (eg a tap device of some sort)
A> that get stuffed into a vnet context. But for physical interfaces whose
A> taskqueues don't have a specific vnet context and may need to set it
A> per-packet, what may this break?

For physical this shouldn't breab anything, you can re-set the curvnet,
and then re-restore it.

A> Ie - what did this fix, and why isn't it being fixed in all the various
A> taskqueues in device drivers?
A> 
A> I'd rather not see the taskqueue setup (which knows nothing about network
A> contexts at all) grow this just to solve a bunch of places where the task
A> in question can just correctly initialise the context itself when it's
A> called.

For non-physical drivers' taskqueues that fixes that taskqueue belongs to
the same vnet, that was used on its creation. This is the case for pf(4),
might be used somewhere else, for example tap(4) you mentioned.

-- 
Totus tuus, Glebius.
___
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: r256587 - in head/sys: kern sys

2013-10-16 Thread Gleb Smirnoff
On Wed, Oct 16, 2013 at 12:47:13PM -0700, Adrian Chadd wrote:
A> .. so what brought this on? I can see this fixing issues for things where a
A> virtual device is created with taskqueues (eg a tap device of some sort)
A> that get stuffed into a vnet context. But for physical interfaces whose
A> taskqueues don't have a specific vnet context and may need to set it
A> per-packet, what may this break?
A> 
A> Ie - what did this fix, and why isn't it being fixed in all the various
A> taskqueues in device drivers?
A> 
A> I'd rather not see the taskqueue setup (which knows nothing about network
A> contexts at all) grow this just to solve a bunch of places where the task
A> in question can just correctly initialise the context itself when it's
A> called.

Also, see

http://lists.freebsd.org/pipermail/svn-src-head/2013-October/052359.html

-- 
Totus tuus, Glebius.
___
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: r256663 - head/tools/build/mk

2013-10-16 Thread Andrey Zonov
Author: zont
Date: Thu Oct 17 05:20:40 2013
New Revision: 256663
URL: http://svnweb.freebsd.org/changeset/base/256663

Log:
  wlconfig exists only on i386

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 04:51:28 
2013(r256662)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Thu Oct 17 05:20:40 
2013(r256663)
@@ -4168,7 +4168,9 @@ OLD_FILES+=usr/sbin/hostapd
 OLD_FILES+=usr/sbin/hostapd_cli
 OLD_FILES+=usr/sbin/ndis_events
 OLD_FILES+=usr/sbin/wlandebug
+.if ${TARGET_ARCH} == "i386"
 OLD_FILES+=usr/sbin/wlconfig
+.endif
 OLD_FILES+=usr/sbin/wpa_cli
 OLD_FILES+=usr/sbin/wpa_passphrase
 OLD_FILES+=usr/sbin/wpa_supplicant
@@ -4182,7 +4184,9 @@ OLD_FILES+=usr/share/man/man5/wpa_suppli
 OLD_FILES+=usr/share/man/man8/ancontrol.8.gz
 OLD_FILES+=usr/share/man/man8/hostapd.8.gz
 OLD_FILES+=usr/share/man/man8/hostapd_cli.8.gz
+.if ${TARGET_ARCH} == "i386"
 OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz
+.endif
 OLD_FILES+=usr/share/man/man8/ndis_events.8.gz
 OLD_FILES+=usr/share/man/man8/wlandebug.8.gz
 OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz
___
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: r256666 - head/sys/dev/ath

2013-10-16 Thread Rui Paulo
Author: rpaulo
Date: Thu Oct 17 05:51:54 2013
New Revision: 25
URL: http://svnweb.freebsd.org/changeset/base/25

Log:
  Add a missing comma.

Modified:
  head/sys/dev/ath/if_ath_tx.c

Modified: head/sys/dev/ath/if_ath_tx.c
==
--- head/sys/dev/ath/if_ath_tx.cThu Oct 17 05:44:15 2013
(r256665)
+++ head/sys/dev/ath/if_ath_tx.cThu Oct 17 05:51:54 2013
(r25)
@@ -2980,7 +2980,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, s
 * be reset or the completion code will get upset with you.
 */
if (bf->bf_state.bfs_aggr != 0 || bf->bf_state.bfs_nframes > 1) {
-   DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR
+   DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR,
"%s: bfs_aggr=%d, bfs_nframes=%d\n", __func__,
bf->bf_state.bfs_aggr, bf->bf_state.bfs_nframes);
bf->bf_state.bfs_aggr = 0;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"