svn commit: r218675 - head/sys/geom/sched

2011-02-14 Thread Luigi Rizzo
Author: luigi
Date: Mon Feb 14 08:09:02 2011
New Revision: 218675
URL: http://svn.freebsd.org/changeset/base/218675

Log:
  Correct a subtle bug in the 'gsched_rr' disk scheduler.
  The algorithm is supposed to work as follows:
  in order to prevent starvation, when a new client starts being served we
  record the start time and reset the counter of bytes served.
  We then switch to a new client after a certain amount of time or bytes,
  even if the current one still has pending requests.
  To avoid charging a new client the time of the first seek,
  we start counting time when the first request is served.
  
  Unfortunately a bug in the previous version of the code failed
  to set the start time in certain cases, resulting in some processes
  exceeding their timeslice.
  
  The fix (in this patch) is trivial, though it took a while to find
  out and replicate the bug.
  Thanks to Tommaso Caprai for investigating and fixing the problem.
  
  Submitted by: Tommaso Caprai
  MFC after:1 week

Modified:
  head/sys/geom/sched/gs_rr.c

Modified: head/sys/geom/sched/gs_rr.c
==
--- head/sys/geom/sched/gs_rr.c Mon Feb 14 06:06:20 2011(r218674)
+++ head/sys/geom/sched/gs_rr.c Mon Feb 14 08:09:02 2011(r218675)
@@ -71,6 +71,7 @@ enum g_rr_state {
 
 /* possible queue flags */
 enum g_rr_flags {
+   /* G_FLAG_COMPLETED means that the field q_slice_end is valid. */
G_FLAG_COMPLETED = 1,   /* Completed a req. in the current budget. */
 };
 
@@ -87,7 +88,7 @@ struct g_rr_queue {
 
enum g_rr_state q_status;
unsigned intq_service;  /* service received so far */
-   int q_slice_end;/* actual slice end in ticks */
+   int q_slice_end;/* actual slice end time, in ticks */
enum g_rr_flags q_flags;/* queue flags */
struct bio_queue_head q_bioq;
 
@@ -638,14 +639,25 @@ g_rr_done(void *data, struct bio *bp)
sc->sc_in_flight--;
 
qp = bp->bio_caller1;
-   if (qp == sc->sc_active && qp->q_status == G_QUEUE_BUSY) {
-   if (!(qp->q_flags & G_FLAG_COMPLETED)) {
-   qp->q_flags |= G_FLAG_COMPLETED;
-   /* in case we want to make the slice adaptive */
-   qp->q_slice_duration = get_bounded(&me.quantum_ms, 2);
-   qp->q_slice_end = ticks + qp->q_slice_duration;
-   }
 
+   /*
+* When the first request for this queue completes, update the
+* duration and end of the slice. We do not do it when the
+* slice starts to avoid charging to the queue the time for
+* the first seek.
+*/
+   if (!(qp->q_flags & G_FLAG_COMPLETED)) {
+   qp->q_flags |= G_FLAG_COMPLETED;
+   /*
+* recompute the slice duration, in case we want
+* to make it adaptive. This is not used right now.
+* XXX should we do the same for q_quantum and q_wait_ticks ?
+*/
+   qp->q_slice_duration = get_bounded(&me.quantum_ms, 2);
+   qp->q_slice_end = ticks + qp->q_slice_duration;
+   }
+
+   if (qp == sc->sc_active && qp->q_status == G_QUEUE_BUSY) {
/* The queue is trying anticipation, start the timer. */
qp->q_status = G_QUEUE_IDLING;
/* may make this adaptive */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218676 - head/sys/dev/usb/wlan

2011-02-14 Thread Hans Petter Selasky
Author: hselasky
Date: Mon Feb 14 08:14:06 2011
New Revision: 218676
URL: http://svn.freebsd.org/changeset/base/218676

Log:
  * Fix page fault caused by referring freed node.
  
  While updating Tx stats, already freed node could be referred and cause
  page fault. To avoid such panic, spool Tx stats in driver's softc. Then,
  on every ratectl interval, grab node though ieee80211_iterate_nodes() and
  update ratectl stats.
  
  * Simplify some code in run_iter_func().
  
  * Fix typo
  
  * Use memset instead of bzero (hselasky @)
  
  PR:   kern/153938
  Submitted by: PseudoCylon 
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_runreg.h
  head/sys/dev/usb/wlan/if_runvar.h

Modified: head/sys/dev/usb/wlan/if_run.c
==
--- head/sys/dev/usb/wlan/if_run.c  Mon Feb 14 08:09:02 2011
(r218675)
+++ head/sys/dev/usb/wlan/if_run.c  Mon Feb 14 08:14:06 2011
(r218676)
@@ -1684,7 +1684,7 @@ run_read_eeprom(struct run_softc *sc)
return (0);
 }
 
-struct ieee80211_node *
+static struct ieee80211_node *
 run_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
 {
return malloc(sizeof (struct run_node), M_DEVBUF, M_NOWAIT | M_ZERO);
@@ -1787,7 +1787,6 @@ run_newstate(struct ieee80211vap *vap, e
}
break;
 
-
case IEEE80211_S_RUN:
if (!(sc->runbmap & bid)) {
if(sc->running++)
@@ -2229,10 +2228,10 @@ run_drain_fifo(void *arg)
 {
struct run_softc *sc = arg;
struct ifnet *ifp = sc->sc_ifp;
-   struct ieee80211_node *ni = sc->sc_ni[0];   /* make compiler happy 
*/
uint32_t stat;
-   int retrycnt = 0;
+   uint16_t (*wstat)[3];
uint8_t wcid, mcs, pid;
+   int8_t retry;
 
RUN_LOCK_ASSERT(sc, MA_OWNED);
 
@@ -2250,31 +2249,32 @@ run_drain_fifo(void *arg)
wcid == 0)
continue;
 
-   ni = sc->sc_ni[wcid];
-   if (ni->ni_rctls == NULL)
-   continue;
-
-   /* update per-STA AMRR stats */
-   if (stat & RT2860_TXQ_OK) {
-   /*
-* Check if there were retries, ie if the Tx
-* success rate is different from the requested
-* rate. Note that it works only because we do
-* not allow rate fallback from OFDM to CCK.
-*/
-   mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f;
-   pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf;
-   if (mcs + 1 != pid)
-   retrycnt = 1;
-   ieee80211_ratectl_tx_complete(ni->ni_vap, ni,
-   IEEE80211_RATECTL_TX_SUCCESS,
-   &retrycnt, NULL);
-   } else {
-   retrycnt = 1;
-   ieee80211_ratectl_tx_complete(ni->ni_vap, ni,
-   IEEE80211_RATECTL_TX_FAILURE,
-   &retrycnt, NULL);
+   /*
+* Even though each stat is Tx-complete-status like format,
+* the device can poll stats. Because there is no guarantee
+* that the referring node is still around when read the stats.
+* So that, if we use ieee80211_ratectl_tx_update(), we will
+* have hard time not to refer already freed node.
+*
+* To eliminate such page faults, we poll stats in softc.
+* Then, update the rates later with 
ieee80211_ratectl_tx_update().
+*/
+   wstat = &(sc->wcid_stats[wcid]);
+   (*wstat)[RUN_TXCNT]++;
+   if (stat & RT2860_TXQ_OK)
+   (*wstat)[RUN_SUCCESS]++;
+   else
ifp->if_oerrors++;
+   /*
+* Check if there were retries, ie if the Tx success rate is
+* different from the requested rate. Note that it works only
+* because we do not allow rate fallback from OFDM to CCK.
+*/
+   mcs = (stat >> RT2860_TXQ_MCS_SHIFT) & 0x7f;
+   pid = (stat >> RT2860_TXQ_PID_SHIFT) & 0xf;
+   if ((retry = pid -1 - mcs) > 0) {
+   (*wstat)[RUN_TXCNT] += retry;
+   (*wstat)[RUN_RETRY] += retry;
}
}
DPRINTFN(3, "count=%d\n", sc->fifo_cnt);
@@ -2290,46 +2290,51 @@ run_iter_func(void *arg, struct ieee8021
struct ieee80211com *ic = ni->ni_ic;
struct ifnet *ifp = ic->ic_ifp;
struct run_node *rn = (void *)ni;
-   uint32_t sta[3];
-   int txcnt = 0, success = 0, retrycnt = 0;
-   int error;
+  

Re: svn commit: r218603 - head/sbin/tunefs

2011-02-14 Thread Bruce Evans

On Sun, 13 Feb 2011, Ivan Voras wrote:


On 13 February 2011 11:51, Bruce Evans  wrote:

On Sat, 12 Feb 2011, Konstantin Belousov wrote:


Log:
??When creating a directory entry for the journal, always read at least
??the fragment, and write the full block. Reading less might not work
??due to device sector size bigger then size of direntries in the
??last directory fragment.


I think it should always write full fragments too (and the kernel should
always read/write in units of fragments, not sectors of any size).


Or at least One Single Variable, preferably recorded in the
superblock, so when the need arises there's only one thing to change
(so it might as well be fragment size in case of UFS).


kib pointed out that the writes in fsck_ffs need to be atomic, and
geom/device drivers only guarantee atomicity for single-sector writes
(which I thing is a bug -- up to the driver's max_iosize should be
guaranteed, and userland needs to be able to see this max if it needs
to do atomic writes).  I don't know if tunefs needs this too (maybe
not, since AFAIK tunefs doesn't even work on ro-mounted file systems
except in my version).

Now I think size shouldn't be given by any fs parameter.  The device
used by utilities may have support different i/o sizes than the device
used by the kernel.  For example, it might be a block device or a
regular file.  I've actually made use of this.  When block devices
were broken on FreeBSD, Linux e2fsck stopped working.  I used the
workaround of copying a small (~1GB) partition to a regular file for
fsck'ing and back to the disk for use in the kernel.  It would be more
unusual for the device used by utilities to require a larger i/o size
than the kernel is using, and utilities would need more reblocking
than they have to work if this size exceeds the fragment size, but
this is possible too.  Say the file system records the hardware sector
size of the device on which it was created.  This size will become
unusable if the file system is copied to another device that has a
larger hard sector size.  But everything will keep working if you use
a size that works on the current device, and this size is a divisor
of the fragment size (else at least the kernel will stop working)
and is not larger than 8K (else the superblock probe will fail).
Examples:
- start with a "device" consisting of a regular file.  The ioctl to
  determine the sector size will fail, so you must not depend on it
  working or use its value.  You can do no better than requiring the
  size to be specified on the command line.  You can also default to
  512.  Copy the resulting file system image to a new disk with 4K
  sectors (and no block size fakery of its own :-).
- start with a normal device with a normal sector size of 512.  Use this
  a bit, then copy it to a new disk with 4K sectors.
- test all this by copying file systems to md devices with various larger
  and smaller sector sizes.


There is currently nothing technically wrong with what this commit
does, but it's pretty much a certainty that future will be more
strange than today and future developers may forget there are two
places they need to change.


Another technical error is lack of support for different i/o sizes for
read and write.  Not a large error since this is broken in the kernel
too.  But probing for an i/o size that works would handle all combinations.
I have a DVD drive with this problem.  For DVD-RW, it has a minimum
read size of 2K but a minimum write size of 32K.  It advertises a
"firmware" sector size of 2K.  So using the firmware sector size doesn't
work for writing, and recent changes in fsck_ffs wouldn't work.  The
fragment size needs to be 32K to work.  IIRC, the kernel did work with
this fragment size, but 32K is too inefficient to actually use for long.
This depends on reads of < 32K working, since the probe for the superblock
only tries size 8K.  A pure minimum i/o size of 32K would fail for just
the buggy superblock probe and buggy utilities.

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

svn commit: r218677 - head/sbin/mdconfig

2011-02-14 Thread Bruce Cran
Author: brucec
Date: Mon Feb 14 09:58:47 2011
New Revision: 218677
URL: http://svn.freebsd.org/changeset/base/218677

Log:
  Add a check to make sure the provider name is "mdN" before printing the
  unit number.
  
  Suggested by: jh
  MFC after:3 days

Modified:
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.c
==
--- head/sbin/mdconfig/mdconfig.c   Mon Feb 14 08:14:06 2011
(r218676)
+++ head/sbin/mdconfig/mdconfig.c   Mon Feb 14 09:58:47 2011
(r218677)
@@ -373,7 +373,11 @@ md_list(char *units, int opt)
found = 1;
}
gc = &pp->lg_config;
-   printf("%s", nflag ? pp->lg_name + 2 : pp->lg_name);
+   if (nflag && strncmp(pp->lg_name, "md", 2) == 0)
+   printf("%s", pp->lg_name + 2);
+   else
+   printf("%s", pp->lg_name);
+
if (opt & OPT_VERBOSE || opt & OPT_UNIT) {
type = geom_config_get(gc, "type");
if (strcmp(type, "vnode") == 0)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r218421 - head/usr.bin/gzip

2011-02-14 Thread Ulrich Spörlein
On Sun, 13.02.2011 at 18:05:46 -0500, Glen Barber wrote:
> On 2/13/11 5:58 PM, Glen Barber wrote:
> > Hi,
> > 
> > On 2/13/11 5:27 PM, Ulrich Spörlein wrote:
> >>> Log:
> >>>   Update manpage to remove CRT reference.
> >>
> >> Would you mind tackling these as well?
> >>
> 
> >> share/man/man4/acpi_panasonic.4
> 
> Hmm.. acpi_panasonic(4) appears to have a mode which differentiates
> between LCD and CRT modes.  Do you think this manual should be left as-is?

I think this is bogus. Sure, the "internal" display is of type LCD, but
what the manpage really tries to say is, that the button switches
between the laptop display (can you call that internal?) and the
external VGA port. Not sure how to best phrase this.

"LCD brightness" should be replaced with "display brightness", although
it only pertains to the internal display, not any externally attached
ones ...)

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


svn commit: r218681 - head/sys/fs/tmpfs

2011-02-14 Thread Alan Cox
Author: alc
Date: Mon Feb 14 15:36:38 2011
New Revision: 218681
URL: http://svn.freebsd.org/changeset/base/218681

Log:
  Further simplify tmpfs_reg_resize().  Also, update its comments, including
  style fixes.

Modified:
  head/sys/fs/tmpfs/tmpfs_subr.c

Modified: head/sys/fs/tmpfs/tmpfs_subr.c
==
--- head/sys/fs/tmpfs/tmpfs_subr.c  Mon Feb 14 14:26:14 2011
(r218680)
+++ head/sys/fs/tmpfs/tmpfs_subr.c  Mon Feb 14 15:36:38 2011
(r218681)
@@ -874,9 +874,9 @@ tmpfs_dir_whiteout_remove(struct vnode *
 /* - */
 
 /*
- * Resizes the aobj associated to the regular file pointed to by vp to
- * the size newsize.  'vp' must point to a vnode that represents a regular
- * file.  'newsize' must be positive.
+ * Resizes the aobj associated with the regular file pointed to by 'vp' to the
+ * size 'newsize'.  'vp' must point to a vnode that represents a regular file.
+ * 'newsize' must be positive.
  *
  * Returns zero on success or an appropriate error code on failure.
  */
@@ -890,7 +890,6 @@ tmpfs_reg_resize(struct vnode *vp, off_t
vm_pindex_t newpages, oldpages;
off_t oldsize;
size_t zerolen;
-   int error;
 
MPASS(vp->v_type == VREG);
MPASS(newsize >= 0);
@@ -899,20 +898,19 @@ tmpfs_reg_resize(struct vnode *vp, off_t
uobj = node->tn_reg.tn_aobj;
tmp = VFS_TO_TMPFS(vp->v_mount);
 
-   /* Convert the old and new sizes to the number of pages needed to
+   /*
+* Convert the old and new sizes to the number of pages needed to
 * store them.  It may happen that we do not need to do anything
 * because the last allocated page can accommodate the change on
-* its own. */
+* its own.
+*/
oldsize = node->tn_size;
oldpages = OFF_TO_IDX(oldsize + PAGE_MASK);
MPASS(oldpages == uobj->size);
newpages = OFF_TO_IDX(newsize + PAGE_MASK);
-
if (newpages > oldpages &&
-   newpages - oldpages > TMPFS_PAGES_AVAIL(tmp)) {
-   error = ENOSPC;
-   goto out;
-   }
+   newpages - oldpages > TMPFS_PAGES_AVAIL(tmp))
+   return (ENOSPC);
 
TMPFS_LOCK(tmp);
tmp->tm_pages_used += (newpages - oldpages);
@@ -923,7 +921,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t
VM_OBJECT_LOCK(uobj);
if (newsize < oldsize) {
/*
-* free "backing store"
+* Release any swap space and free any whole pages.
 */
if (newpages < oldpages) {
swap_pager_freespace(uobj, newpages, oldpages -
@@ -932,7 +930,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t
}
 
/*
-* zero out the truncated part of the last page.
+* Zero the truncated part of the last page.
 */
zerolen = round_page(newsize) - newsize;
if (zerolen > 0) {
@@ -943,10 +941,7 @@ tmpfs_reg_resize(struct vnode *vp, off_t
}
uobj->size = newpages;
VM_OBJECT_UNLOCK(uobj);
-   error = 0;
-
-out:
-   return (error);
+   return (0);
 }
 
 /* - */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r218583 - head/sys/dev/e1000

2011-02-14 Thread Fabien Thomas
> 
> 
> @@ -1937,6 +1937,10 @@ igb_local_timer(void *arg)
>   goto timeout;
> out:
>   callout_reset(&adapter->timer, hz, igb_local_timer, adapter);
> +#ifndef DEVICE_POLLING
> + /* Fire off all queue interrupts - deadlock protection */
> + E1000_WRITE_REG(&adapter->hw, E1000_EICS, adapter->que_mask);
> +#endif
>   return;

It seems this one need a check on the polling runtime interface flag?

Fabien




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


svn commit: r218682 - stable/8/sys/netinet

2011-02-14 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb 14 16:36:02 2011
New Revision: 218682
URL: http://svn.freebsd.org/changeset/base/218682

Log:
  MFC r218078:
  
Remove duplicate printing of TF_NOPUSH in db_print_tflags().

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

Modified: stable/8/sys/netinet/tcp_usrreq.c
==
--- stable/8/sys/netinet/tcp_usrreq.c   Mon Feb 14 15:36:38 2011
(r218681)
+++ stable/8/sys/netinet/tcp_usrreq.c   Mon Feb 14 16:36:02 2011
(r218682)
@@ -1695,10 +1695,6 @@ db_print_tflags(u_int t_flags)
db_printf("%sTF_NOPUSH", comma ? ", " : "");
comma = 1;
}
-   if (t_flags & TF_NOPUSH) {
-   db_printf("%sTF_NOPUSH", comma ? ", " : "");
-   comma = 1;
-   }
if (t_flags & TF_MORETOCOME) {
db_printf("%sTF_MORETOCOME", comma ? ", " : "");
comma = 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218683 - stable/8/sys/compat/linprocfs

2011-02-14 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb 14 16:38:32 2011
New Revision: 218683
URL: http://svn.freebsd.org/changeset/base/218683

Log:
  MFC r218114:
  
Update interface stats counters to match the current format in linux and
try to export as much information as we can match.
  
Requested on: Debian GNU/kFreeBSD list (debian-bsd lists.debian.org) 2010-12
Tested by:Mats Erik Andersson (mats.andersson gisladisker.se)

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

Modified: stable/8/sys/compat/linprocfs/linprocfs.c
==
--- stable/8/sys/compat/linprocfs/linprocfs.c   Mon Feb 14 16:36:02 2011
(r218682)
+++ stable/8/sys/compat/linprocfs/linprocfs.c   Mon Feb 14 16:38:32 2011
(r218683)
@@ -1214,20 +1214,43 @@ linprocfs_donetdev(PFS_FILL_ARGS)
char ifname[16]; /* XXX LINUX_IFNAMSIZ */
struct ifnet *ifp;
 
-   sbuf_printf(sb, "%6s|%58s|%s\n%6s|%58s|%58s\n",
-   "Inter-", "   Receive", "  Transmit", " face",
-   "bytespackets errs drop fifo frame compressed",
-   "bytespackets errs drop fifo frame compressed");
+   sbuf_printf(sb, "%6s|%58s|%s\n"
+   "%6s|%58s|%58s\n",
+   "Inter-", "   Receive", "  Transmit",
+   " face",
+   "bytespackets errs drop fifo frame compressed multicast",
+   "bytespackets errs drop fifo colls carrier compressed");
 
CURVNET_SET(TD_TO_VNET(curthread));
IFNET_RLOCK();
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
linux_ifname(ifp, ifname, sizeof ifname);
-   sbuf_printf(sb, "%6.6s:", ifname);
-   sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ",
-   0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
+   sbuf_printf(sb, "%6.6s: ", ifname);
+   sbuf_printf(sb, "%7lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu ",
+   ifp->if_ibytes, /* rx_bytes */
+   ifp->if_ipackets,   /* rx_packets */
+   ifp->if_ierrors,/* rx_errors */
+   ifp->if_iqdrops,/* rx_dropped +
+* rx_missed_errors */
+   0UL,/* rx_fifo_errors */
+   0UL,/* rx_length_errors +
+* rx_over_errors +
+* rx_crc_errors +
+* rx_frame_errors */
+   0UL,/* rx_compressed */
+   ifp->if_imcasts);   /* multicast, XXX-BZ rx only? */
sbuf_printf(sb, "%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n",
-   0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL);
+   ifp->if_obytes, /* tx_bytes */
+   ifp->if_opackets,   /* tx_packets */
+   ifp->if_oerrors,/* tx_errors */
+   0UL,/* tx_dropped */
+   0UL,/* tx_fifo_errors */
+   ifp->if_collisions, /* collisions */
+   0UL,/* tx_carrier_errors +
+* tx_aborted_errors +
+* tx_window_errors +
+* tx_heartbeat_errors */
+   0UL);   /* tx_compressed */
}
IFNET_RUNLOCK();
CURVNET_RESTORE();
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218684 - in stable/8/sys: conf netinet

2011-02-14 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb 14 16:54:03 2011
New Revision: 218684
URL: http://svn.freebsd.org/changeset/base/218684

Log:
  MFC r216466:
  
Bring back (most of) NATM to avoid further bitrot after r186119.
Keep three lines disabled which I am unsure if they had been used at all.
This will allow us to seek testers and possibly bring it all back.
  
Discussed with:   rwatson

Modified:
  stable/8/sys/conf/NOTES
  stable/8/sys/netinet/if_atm.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/conf/NOTES
==
--- stable/8/sys/conf/NOTES Mon Feb 14 16:38:32 2011(r218683)
+++ stable/8/sys/conf/NOTES Mon Feb 14 16:54:03 2011(r218684)
@@ -2120,7 +2120,7 @@ devicefatm#Fore PCA200E
 device hatm#Fore/Marconi HE155/622
 device patm#IDT77252 cards (ProATM and IDT)
 device utopia  #ATM PHY driver
-#options   NATM#native ATM
+optionsNATM#native ATM
 
 optionsLIBMBPOOL   #needed by patm, iatm
 

Modified: stable/8/sys/netinet/if_atm.c
==
--- stable/8/sys/netinet/if_atm.c   Mon Feb 14 16:38:32 2011
(r218683)
+++ stable/8/sys/netinet/if_atm.c   Mon Feb 14 16:54:03 2011
(r218684)
@@ -229,7 +229,9 @@ atm_rtrequest(int req, struct rtentry *r
npcb->npcb_flags |= NPCB_IP;
npcb->ipaddr.s_addr = sin->sin_addr.s_addr;
/* XXX: move npcb to llinfo when ATM ARP is ready */
+#ifdef __notyet_restored__
rt->rt_llinfo = (caddr_t) npcb;
+#endif
rt->rt_flags |= RTF_LLINFO;
 #endif
/*
@@ -255,7 +257,9 @@ failed:
 #ifdef NATM
if (npcb) {
npcb_free(npcb, NPCB_DESTROY);
+#ifdef __notyet_restored__
rt->rt_llinfo = NULL;
+#endif
rt->rt_flags &= ~RTF_LLINFO;
}
NATM_UNLOCK();
@@ -273,9 +277,11 @@ failed:
 */
if (rt->rt_flags & RTF_LLINFO) {
NATM_LOCK();
+#ifdef __notyet_restored__
npcb_free((struct natmpcb *)rt->rt_llinfo,
NPCB_DESTROY);
rt->rt_llinfo = NULL;
+#endif
rt->rt_flags &= ~RTF_LLINFO;
NATM_UNLOCK();
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218685 - head/sys/dev/acpica

2011-02-14 Thread Matthew D Fleming
Author: mdf
Date: Mon Feb 14 17:20:20 2011
New Revision: 218685
URL: http://svn.freebsd.org/changeset/base/218685

Log:
  Prevent reading from the ACPI_RESOURCE past its actual end.  For
  paranoia limit to the size of the ACPI_RESOURCE as well.
  
  Reviewd by:   jhb (in spirit)
  MFC after:1 week

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 16:54:03 2011
(r218684)
+++ head/sys/dev/acpica/acpi_resource.c Mon Feb 14 17:20:20 2011
(r218685)
@@ -60,6 +60,7 @@ static ACPI_STATUS
 acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
 {
 struct lookup_irq_request *req;
+size_t len;
 u_int irqnum, irq;
 
 switch (res->Type) {
@@ -82,7 +83,10 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r
req->found = 1;
KASSERT(irq == rman_get_start(req->res),
("IRQ resources do not match"));
-   bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
+   len = res->Length;
+   if (len > sizeof(ACPI_RESOURCE))
+   len = sizeof(ACPI_RESOURCE);
+   bcopy(res, req->acpi_res, len);
return (AE_CTRL_TERMINATE);
 }
 return (AE_OK);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218686 - head/sys/compat/linux

2011-02-14 Thread Dmitry Chagin
Author: dchagin
Date: Mon Feb 14 17:24:58 2011
New Revision: 218686
URL: http://svn.freebsd.org/changeset/base/218686

Log:
  Style(9) fix. Do not initialize variables in the declarations.

Modified:
  head/sys/compat/linux/linux_futex.c

Modified: head/sys/compat/linux/linux_futex.c
==
--- head/sys/compat/linux/linux_futex.c Mon Feb 14 17:20:20 2011
(r218685)
+++ head/sys/compat/linux/linux_futex.c Mon Feb 14 17:24:58 2011
(r218686)
@@ -436,8 +436,8 @@ linux_sys_futex(struct thread *td, struc
int clockrt, nrwake, op_ret, ret, val;
struct linux_emuldata *em;
struct waiting_proc *wp;
-   struct futex *f, *f2 = NULL;
-   int error = 0;
+   struct futex *f, *f2;
+   int error;
 
/*
 * Our implementation provides only privates futexes. Most of the apps
@@ -460,6 +460,9 @@ linux_sys_futex(struct thread *td, struc
args->op != LINUX_FUTEX_WAIT_REQUEUE_PI)
return (ENOSYS);
 
+   error = 0;
+   f = f2 = NULL;
+
switch (args->op) {
case LINUX_FUTEX_WAIT:
args->val3 = FUTEX_BITSET_MATCH_ANY;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r218685 - head/sys/dev/acpica

2011-02-14 Thread Jung-uk Kim
On Monday 14 February 2011 12:20 pm, Matthew D Fleming wrote:
> Author: mdf
> Date: Mon Feb 14 17:20:20 2011
> New Revision: 218685
> URL: http://svn.freebsd.org/changeset/base/218685
>
> Log:
>   Prevent reading from the ACPI_RESOURCE past its actual end.  For
>   paranoia limit to the size of the ACPI_RESOURCE as well.
>
>   Reviewd by: jhb (in spirit)
>   MFC after:  1 week
>
> Modified:
>   head/sys/dev/acpica/acpi_resource.c
>
> Modified: head/sys/dev/acpica/acpi_resource.c
> ===
>=== --- head/sys/dev/acpica/acpi_resource.cMon Feb 14
> 16:54:03 2011 (r218684) +++ head/sys/dev/acpica/acpi_resource.c   Mon
> Feb 14 17:20:20 2011  (r218685) @@ -60,6 +60,7 @@ static ACPI_STATUS
>  acpi_lookup_irq_handler(ACPI_RESOURCE *res, void *context)
>  {
>  struct lookup_irq_request *req;
> +size_t len;
>  u_int irqnum, irq;
>
>  switch (res->Type) {
> @@ -82,7 +83,10 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r
>   req->found = 1;
>   KASSERT(irq == rman_get_start(req->res),
>   ("IRQ resources do not match"));
> - bcopy(res, req->acpi_res, sizeof(ACPI_RESOURCE));
> + len = res->Length;
> + if (len > sizeof(ACPI_RESOURCE))
> + len = sizeof(ACPI_RESOURCE);
> + bcopy(res, req->acpi_res, len);
>   return (AE_CTRL_TERMINATE);
>  }
>  return (AE_OK);

Hmm...  I am not sure this is a correct fix.  For most cases, directly 
using sizeof(ACPI_RESOURCE) is evil as it does not reflect actual 
size of underlying structure.  With the same reason, 
sizeof(ACPI_RESOURCE_IRQ) and sizeof(ACPI_RESOURCE_EXTENDED_IRQ) is 
not recommended, either.  A correct fix is to extend 
acpi_lookup_irq_resource() to allocate necessary space dynamically.

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


Re: svn commit: r218685 - head/sys/dev/acpica

2011-02-14 Thread John Baldwin
On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote:
> Author: mdf
> Date: Mon Feb 14 17:20:20 2011
> New Revision: 218685
> URL: http://svn.freebsd.org/changeset/base/218685
> 
> Log:
>   Prevent reading from the ACPI_RESOURCE past its actual end.  For
>   paranoia limit to the size of the ACPI_RESOURCE as well.

I think in practice that len would never be > sizeof(ACPI_RESOURCE).

You could probably get by with using a KASSERT() instead:

KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too large"));
bcopy(res, req->acpi_res, res->Length);

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


Re: svn commit: r218685 - head/sys/dev/acpica

2011-02-14 Thread mdf
On Mon, Feb 14, 2011 at 10:33 AM, John Baldwin  wrote:
> On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote:
>> Author: mdf
>> Date: Mon Feb 14 17:20:20 2011
>> New Revision: 218685
>> URL: http://svn.freebsd.org/changeset/base/218685
>>
>> Log:
>>   Prevent reading from the ACPI_RESOURCE past its actual end.  For
>>   paranoia limit to the size of the ACPI_RESOURCE as well.
>
> I think in practice that len would never be > sizeof(ACPI_RESOURCE).
>
> You could probably get by with using a KASSERT() instead:
>
>        KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too large"));
>        bcopy(res, req->acpi_res, res->Length);

Thanks.  I wanted to be paranoid since the problem was sporadic.

Anyone who can better test this code should feel free to modify it further.

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


Re: svn commit: r218685 - head/sys/dev/acpica

2011-02-14 Thread Jung-uk Kim
On Monday 14 February 2011 01:33 pm, John Baldwin wrote:
> On Monday, February 14, 2011 12:20:20 pm Matthew D Fleming wrote:
> > Author: mdf
> > Date: Mon Feb 14 17:20:20 2011
> > New Revision: 218685
> > URL: http://svn.freebsd.org/changeset/base/218685
> >
> > Log:
> >   Prevent reading from the ACPI_RESOURCE past its actual end. 
> > For paranoia limit to the size of the ACPI_RESOURCE as well.
>
> I think in practice that len would never be >
> sizeof(ACPI_RESOURCE).
>
> You could probably get by with using a KASSERT() instead:
>
>   KASSERT(res->Length <= sizeof(ACPI_RESOURCE), "resource too
> large")); bcopy(res, req->acpi_res, res->Length);

We should avoid sizeof(ACPI_RESOURCE).  If you really have to know 
size of a specific resource type, there is a convenience macro, i.e., 
ACPI_RS_SIZE(type).

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


svn commit: r218687 - head/sys/dev/acpica

2011-02-14 Thread Jung-uk Kim
Author: jkim
Date: Mon Feb 14 20:05:37 2011
New Revision: 218687
URL: http://svn.freebsd.org/changeset/base/218687

Log:
  Rework r218685.  Copy just enough data for the resource type.
  
  Reviewed by:  jhb, mdf

Modified:
  head/sys/dev/acpica/acpi_resource.c

Modified: head/sys/dev/acpica/acpi_resource.c
==
--- head/sys/dev/acpica/acpi_resource.c Mon Feb 14 17:24:58 2011
(r218686)
+++ head/sys/dev/acpica/acpi_resource.c Mon Feb 14 20:05:37 2011
(r218687)
@@ -65,31 +65,30 @@ acpi_lookup_irq_handler(ACPI_RESOURCE *r
 
 switch (res->Type) {
 case ACPI_RESOURCE_TYPE_IRQ:
+   irqnum = res->Data.Irq.InterruptCount;
+   irq = res->Data.Irq.Interrupts[0];
+   len = ACPI_RS_SIZE(ACPI_RESOURCE_IRQ);
+   break;
 case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
-   if (res->Type == ACPI_RESOURCE_TYPE_IRQ) {
-   irqnum = res->Data.Irq.InterruptCount;
-   irq = res->Data.Irq.Interrupts[0];
-   } else {
-   irqnum = res->Data.ExtendedIrq.InterruptCount;
-   irq = res->Data.ExtendedIrq.Interrupts[0];
-   }
-   if (irqnum != 1)
-   break;
-   req = (struct lookup_irq_request *)context;
-   if (req->counter != req->rid) {
-   req->counter++;
-   break;
-   }
-   req->found = 1;
-   KASSERT(irq == rman_get_start(req->res),
-   ("IRQ resources do not match"));
-   len = res->Length;
-   if (len > sizeof(ACPI_RESOURCE))
-   len = sizeof(ACPI_RESOURCE);
-   bcopy(res, req->acpi_res, len);
-   return (AE_CTRL_TERMINATE);
+   irqnum = res->Data.ExtendedIrq.InterruptCount;
+   irq = res->Data.ExtendedIrq.Interrupts[0];
+   len = ACPI_RS_SIZE(ACPI_RESOURCE_EXTENDED_IRQ);
+   break;
+default:
+   return (AE_OK);
+}
+if (irqnum != 1)
+   return (AE_OK);
+req = (struct lookup_irq_request *)context;
+if (req->counter != req->rid) {
+   req->counter++;
+   return (AE_OK);
 }
-return (AE_OK);
+req->found = 1;
+KASSERT(irq == rman_get_start(req->res),
+   ("IRQ resources do not match"));
+bcopy(res, req->acpi_res, len);
+return (AE_CTRL_TERMINATE);
 }
 
 ACPI_STATUS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218688 - head/sys/kern

2011-02-14 Thread Bjoern A. Zeeb
Author: bz
Date: Mon Feb 14 20:49:37 2011
New Revision: 218688
URL: http://svn.freebsd.org/changeset/base/218688

Log:
  Mfp4 CH=177256:
  
Catch a set vnet upon return to user space. This usually
means return paths with CURVNET_RESTORE() missing.
  
If VNET_DEBUG is turned on we can even tell the function
that did the CURVNET_SET() which is really helpful; else
we print "N/A".
  
Sponsored by: The FreeBSD Foundation
Sponsored by: CK Software GmbH
Reviewed by:  jhb
  
  MFC after:11 days

Modified:
  head/sys/kern/subr_trap.c

Modified: head/sys/kern/subr_trap.c
==
--- head/sys/kern/subr_trap.c   Mon Feb 14 20:05:37 2011(r218687)
+++ head/sys/kern/subr_trap.c   Mon Feb 14 20:49:37 2011(r218688)
@@ -74,6 +74,10 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#ifdef VIMAGE
+#include 
+#endif
+
 #ifdef XEN
 #include 
 #include 
@@ -126,6 +130,13 @@ userret(struct thread *td, struct trapfr
sched_userret(td);
KASSERT(td->td_locks == 0,
("userret: Returning with %d locks held.", td->td_locks));
+#ifdef VIMAGE
+   /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */
+   VNET_ASSERT(curvnet == NULL,
+   ("%s: Returning on td %p (pid %d, %s) with vnet %p set in %s",
+   __func__, td, p->p_pid, td->td_name, curvnet,
+   (td->td_vnet_lpush != NULL) ? td->td_vnet_lpush : "N/A"));
+#endif
 #ifdef XEN
PT_UPDATES_FLUSH();
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2011-02-14 Thread Adrian Chadd
Author: adrian
Date: Mon Feb 14 21:24:54 2011
New Revision: 218689
URL: http://svn.freebsd.org/changeset/base/218689

Log:
  Some statistics additions - prepare for error codes > 32 (since the AR5416
  error mask is > 5 bits) and add some extra CRC/HT40/ShortGI counters to
  help debug 802.11n issues.

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

Modified: head/sys/dev/ath/if_ath.c
==
--- head/sys/dev/ath/if_ath.c   Mon Feb 14 20:49:37 2011(r218688)
+++ head/sys/dev/ath/if_ath.c   Mon Feb 14 21:24:54 2011(r218689)
@@ -3715,7 +3715,6 @@ ath_rx_proc(void *arg, int npending)
struct mbuf *m;
struct ieee80211_node *ni;
int len, type, ngood;
-   u_int phyerr;
HAL_STATUS status;
int16_t nf;
u_int64_t tsf;
@@ -3769,6 +3768,21 @@ ath_rx_proc(void *arg, int npending)
if (status == HAL_EINPROGRESS)
break;
STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list);
+
+   /* These aren't specifically errors */
+   if (rs->rs_flags & HAL_RX_GI)
+   sc->sc_stats.ast_rx_halfgi++;
+   if (rs->rs_flags & HAL_RX_2040)
+   sc->sc_stats.ast_rx_2040++;
+   if (rs->rs_flags & HAL_RX_DELIM_CRC_PRE)
+   sc->sc_stats.ast_rx_pre_crc_err++;
+   if (rs->rs_flags & HAL_RX_DELIM_CRC_POST)
+   sc->sc_stats.ast_rx_post_crc_err++;
+   if (rs->rs_flags & HAL_RX_DECRYPT_BUSY)
+   sc->sc_stats.ast_rx_decrypt_busy_err++;
+   if (rs->rs_flags & HAL_RX_HI_RX_CHAIN)
+   sc->sc_stats.ast_rx_hi_rx_chain++;
+
if (rs->rs_status != 0) {
if (rs->rs_status & HAL_RXERR_CRC)
sc->sc_stats.ast_rx_crcerr++;
@@ -3776,8 +3790,9 @@ ath_rx_proc(void *arg, int npending)
sc->sc_stats.ast_rx_fifoerr++;
if (rs->rs_status & HAL_RXERR_PHY) {
sc->sc_stats.ast_rx_phyerr++;
-   phyerr = rs->rs_phyerr & 0x1f;
-   sc->sc_stats.ast_rx_phy[phyerr]++;
+   /* Be suitably paranoid about receiving phy 
errors out of the stats array bounds */
+   if (rs->rs_phyerr < 64)
+   
sc->sc_stats.ast_rx_phy[rs->rs_phyerr]++;
goto rx_error;  /* NB: don't count in ierrors */
}
if (rs->rs_status & HAL_RXERR_DECRYPT) {
@@ -6402,7 +6417,7 @@ ath_sysctl_stats_attach_rxphyerr(struct 
 
tree = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, "rx_phy_err", CTLFLAG_RD, 
NULL, "Per-code RX PHY Errors");
child = SYSCTL_CHILDREN(tree);
-   for (i = 0; i < 32; i++) {
+   for (i = 0; i < 64; i++) {
snprintf(sn, sizeof(sn), "%d", i);
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, sn, CTLFLAG_RD, 
&sc->sc_stats.ast_rx_phy[i], 0, "");
}
@@ -6580,6 +6595,13 @@ ath_sysctl_stats_attach(struct ath_softc
SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_agg", CTLFLAG_RD,
&sc->sc_stats.ast_rx_agg, 0, "number of aggregate frames received");
 
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_halfgi", CTLFLAG_RD, 
&sc->sc_stats.ast_rx_halfgi, 0, "");
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_2040", CTLFLAG_RD, 
&sc->sc_stats.ast_rx_2040, 0, "");
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_pre_crc_err", CTLFLAG_RD, 
&sc->sc_stats.ast_rx_pre_crc_err, 0, "");
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_post_crc_err", 
CTLFLAG_RD, &sc->sc_stats.ast_rx_post_crc_err, 0, "");
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_decrypt_busy_err", 
CTLFLAG_RD, &sc->sc_stats.ast_rx_decrypt_busy_err, 0, "");
+   SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_hi_rx_chain", CTLFLAG_RD, 
&sc->sc_stats.ast_rx_hi_rx_chain, 0, "");
+
/* Attach the RX phy error array */
ath_sysctl_stats_attach_rxphyerr(sc, child);
 }

Modified: head/sys/dev/ath/if_athioctl.h
==
--- head/sys/dev/ath/if_athioctl.h  Mon Feb 14 20:49:37 2011
(r218688)
+++ head/sys/dev/ath/if_athioctl.h  Mon Feb 14 21:24:54 2011
(r218689)
@@ -79,7 +79,7 @@ struct ath_stats {
u_int32_t   ast_rx_badcrypt;/* rx failed 'cuz decryption */
u_int32_t   ast_rx_badmic;  /* rx failed 'cuz MIC failure */
u_int32_t   ast_rx_phyerr;  /* rx failed 'cuz of PHY err */
-   u_int32_t   ast_rx_phy[32]; /* rx PHY error per-code counts */
+   u_int32_t   ast_rx_phy[64]; /* rx PHY error per-code counts */
u_int32_t   ast_rx_too

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

2011-02-14 Thread Adrian Chadd
Author: adrian
Date: Mon Feb 14 21:35:11 2011
New Revision: 218690
URL: http://svn.freebsd.org/changeset/base/218690

Log:
  bring this in line with what ath9k does.

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

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Mon Feb 14 21:24:54 
2011(r218689)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c  Mon Feb 14 21:35:11 
2011(r218690)
@@ -2296,7 +2296,7 @@ ar5416Set11nRegs(struct ath_hal *ah, con
 
/* carrier sense timeout */
OS_REG_SET_BIT(ah, AR_GTTM, AR_GTTM_CST_USEC);
-   OS_REG_WRITE(ah, AR_CST, 1 << AR_CST_TIMEOUT_LIMIT_S);
+   OS_REG_WRITE(ah, AR_CST, 0xF << AR_CST_TIMEOUT_LIMIT_S);
 }
 
 void
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218691 - head/sys/dev/isp

2011-02-14 Thread Marius Strobl
Author: marius
Date: Mon Feb 14 21:50:51 2011
New Revision: 218691
URL: http://svn.freebsd.org/changeset/base/218691

Log:
  - Use the correct DMA tag/map pair for synchronize the FC scratch area.
  - Allocate coherent DMA memory for the request/response queue area and
and the FC scratch area.
  
  These changes allow isp(4) to work properly on sparc64 with usage of the
  IOMMU streaming buffers enabled.
  
  Approved by:  mjacob
  MFC after:2 weeks

Modified:
  head/sys/dev/isp/isp.c
  head/sys/dev/isp/isp_freebsd.c
  head/sys/dev/isp/isp_freebsd.h
  head/sys/dev/isp/isp_library.c
  head/sys/dev/isp/isp_pci.c
  head/sys/dev/isp/isp_sbus.c
  head/sys/dev/isp/ispvar.h

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Mon Feb 14 21:35:11 2011(r218690)
+++ head/sys/dev/isp/isp.c  Mon Feb 14 21:50:51 2011(r218691)
@@ -777,7 +777,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d
ISP_IOXPUT_32(isp,  ptr[wi++], &cp[i]);
wl--;
}
-   MEMORYBARRIER(isp, SYNC_REQUEST, 0, 
ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)));
+   MEMORYBARRIER(isp, SYNC_REQUEST, 0, 
ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1);
ISP_MEMZERO(&mbs, sizeof (mbs));
if (la < 0x1 && nw < 0x1) {
mbs.param[0] = MBOX_LOAD_RISC_RAM_2100;
@@ -846,7 +846,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d
ISP_IOXPUT_16(isp,  ptr[wi++], &cp[i]);
wl--;
}
-   MEMORYBARRIER(isp, SYNC_REQUEST, 0, 
ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)));
+   MEMORYBARRIER(isp, SYNC_REQUEST, 0, 
ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)), -1);
ISP_MEMZERO(&mbs, sizeof (mbs));
if (la < 0x1) {
mbs.param[0] = MBOX_LOAD_RISC_RAM_2100;
@@ -1716,7 +1716,7 @@ isp_fibre_init(ispsoftc_t *isp)
isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %p (%08x%08x)",
fcp->isp_scratch, (uint32_t) ((uint64_t)fcp->isp_scdma >> 32),
(uint32_t) fcp->isp_scdma);
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp));
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0);
isp_mboxcmd(isp, &mbs);
FC_SCRATCH_RELEASE(isp, 0);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
@@ -2008,7 +2008,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
mbs.param[6] = DMA_WD3(fcp->isp_scdma);
mbs.param[7] = DMA_WD2(fcp->isp_scdma);
isp_prt(isp, ISP_LOGDEBUG0, "INIT F/W from %04x%04x%04x%04x", 
DMA_WD3(fcp->isp_scdma), DMA_WD2(fcp->isp_scdma), DMA_WD1(fcp->isp_scdma), 
DMA_WD0(fcp->isp_scdma));
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp));
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (*icbp), 0);
isp_mboxcmd(isp, &mbs);
FC_SCRATCH_RELEASE(isp, 0);
 
@@ -2125,13 +2125,13 @@ isp_plogx(ispsoftc_t *isp, int chan, uin
mbs.param[3] = DMA_WD0(fcp->isp_scdma);
mbs.param[6] = DMA_WD3(fcp->isp_scdma);
mbs.param[7] = DMA_WD2(fcp->isp_scdma);
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN);
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, QENTRY_LEN, chan);
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
rval = mbs.param[0];
goto out;
}
-   MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN);
+   MEMORYBARRIER(isp, SYNC_SFORCPU, QENTRY_LEN, QENTRY_LEN, chan);
scp += QENTRY_LEN;
isp_get_plogx(isp, (isp_plogx_t *) scp, plp);
if (isp->isp_dblev & ISP_LOGDEBUG1) {
@@ -2324,7 +2324,7 @@ isp_getpdb(ispsoftc_t *isp, int chan, ui
return (-1);
}
}
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un));
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, sizeof (un), chan);
isp_mboxcmd(isp, &mbs);
if (mbs.param[0] != MBOX_COMMAND_COMPLETE) {
if (dolock) {
@@ -3215,7 +3215,7 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan
rq->snscb_fc4_type = FC4_SCSI;
 
isp_put_gid_ft_request(isp, rq, fcp->isp_scratch);
-   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE);
+   MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan);
 
MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 1000);
mbs.param[0] = MBOX_SEND_SNS;
@@ -3310,12 +3310,12 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, 
mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF);
mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF);
mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF);
-

svn commit: r218692 - stable/8/lib/libc/sys

2011-02-14 Thread Glen Barber
Author: gjb (doc committer)
Date: Tue Feb 15 01:33:59 2011
New Revision: 218692
URL: http://svn.freebsd.org/changeset/base/218692

Log:
  MFC 212438:
  Add EINVAL to list of possible return values for cpuset_getaffinity(2).
  
  PR:   149978
  Approved by:  keramida (mentor)

Modified:
  stable/8/lib/libc/sys/cpuset_getaffinity.2
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/sys/cpuset_getaffinity.2
==
--- stable/8/lib/libc/sys/cpuset_getaffinity.2  Mon Feb 14 21:50:51 2011
(r218691)
+++ stable/8/lib/libc/sys/cpuset_getaffinity.2  Tue Feb 15 01:33:59 2011
(r218692)
@@ -121,6 +121,12 @@ The
 or
 .Fa which
 argument was not a valid value.
+.It Bq Er EINVAL
+The
+.Fa mask
+argument specified when calling
+.Fn cpuset_setaffinity
+was not a valid value.
 .It Bq Er EDEADLK
 The
 .Fn cpuset_setaffinity
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218693 - stable/7/lib/libc/sys

2011-02-14 Thread Glen Barber
Author: gjb (doc committer)
Date: Tue Feb 15 01:34:46 2011
New Revision: 218693
URL: http://svn.freebsd.org/changeset/base/218693

Log:
  MFC 212438:
  Add EINVAL to list of possible return values for cpuset_getaffinity(2).
  
  PR:   149978
  Approved by:  keramida (mentor)

Modified:
  stable/7/lib/libc/sys/cpuset_getaffinity.2
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/sys/cpuset_getaffinity.2
==
--- stable/7/lib/libc/sys/cpuset_getaffinity.2  Tue Feb 15 01:33:59 2011
(r218692)
+++ stable/7/lib/libc/sys/cpuset_getaffinity.2  Tue Feb 15 01:34:46 2011
(r218693)
@@ -121,6 +121,12 @@ The
 or
 .Fa which
 argument was not a valid value.
+.It Bq Er EINVAL
+The
+.Fa mask
+argument specified when calling
+.Fn cpuset_setaffinity
+was not a valid value.
 .It Bq Er EDEADLK
 The
 .Fn cpuset_setaffinity
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2011-02-14 Thread Martin Wilke
Author: miwi (doc,ports committer)
Date: Tue Feb 15 05:57:53 2011
New Revision: 218694
URL: http://svn.freebsd.org/changeset/base/218694

Log:
  - Add Dell Wireless 1390 BCM4311 Mini PCI to supported list.
  
  PR:   154500
  Submitted by: Ruslan Mahmatkhanov 
  Approved by:  rwatson

Modified:
  head/share/man/man4/bwn.4

Modified: head/share/man/man4/bwn.4
==
--- head/share/man/man4/bwn.4   Tue Feb 15 01:34:46 2011(r218693)
+++ head/share/man/man4/bwn.4   Tue Feb 15 05:57:53 2011(r218694)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 12, 2010
+.Dd February 15, 2011
 .Dt BWN 4
 .Os
 .Sh NAME
@@ -81,6 +81,7 @@ driver supports Broadcom BCM43xx based w
 .It "Apple Airport Extreme BCM4318 PCI b/g"
 .It "ASUS WL-138g  BCM4318 PCI b/g"
 .It "Buffalo WLI-CB-G54S   BCM4318 CardBus b/g"
+.It "Dell Wireless 1390 BCM4311 Mini PCI   b/g"
 .It "Dell Wireless 1470BCM4318 Mini PCIb/g"
 .It "Dell Truemobile 1400  BCM4309 Mini PCIb/g"
 .It "HP Compaq 6715b   BCM4312 PCI b/g"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218695 - stable/8/usr.bin/top

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 06:33:35 2011
New Revision: 218695
URL: http://svn.freebsd.org/changeset/base/218695

Log:
  MFC 217746 from /head/usr.bin/top
  
  Touch up the sample memory usage numbers a bit, to avoid wrapping
  on terminal boundary.  While here add definition for 'G' and fix
  the indentation of 'K' units.
  
  Submitted by:   plunket
  PR: docs/153614

Modified:
  stable/8/usr.bin/top/top.local.1
Directory Properties:
  stable/8/usr.bin/top/   (props changed)

Modified: stable/8/usr.bin/top/top.local.1
==
--- stable/8/usr.bin/top/top.local.1Tue Feb 15 05:57:53 2011
(r218694)
+++ stable/8/usr.bin/top/top.local.1Tue Feb 15 06:33:35 2011
(r218695)
@@ -5,16 +5,19 @@
 The '-H' option will toggle the display of kernel visible thread contexts.
 At runtime the 'H' key will toggle this mode. The default is OFF.
 
-.SH DESCRIPTION OF MEMORY 
-Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free
+.SH DESCRIPTION OF MEMORY
+Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free
 Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out
-
+.TP
 .B K:
 Kilobyte
 .TP
 .B M:
 Megabyte
 .TP
+.B G:
+Gigabyte
+.TP
 .B %:
 1/100
 .TP
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218696 - stable/7/usr.bin/top

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 06:34:30 2011
New Revision: 218696
URL: http://svn.freebsd.org/changeset/base/218696

Log:
  MFC 217746 from /head/usr.bin/top
  
  Touch up the sample memory usage numbers a bit, to avoid wrapping
  on terminal boundary.  While here add definition for ’G’ and fix
  the indentation of ’K’ units.
  
  Submitted by:   plunket
  PR: docs/153614

Modified:
  stable/7/usr.bin/top/top.local.1
Directory Properties:
  stable/7/usr.bin/top/   (props changed)

Modified: stable/7/usr.bin/top/top.local.1
==
--- stable/7/usr.bin/top/top.local.1Tue Feb 15 06:33:35 2011
(r218695)
+++ stable/7/usr.bin/top/top.local.1Tue Feb 15 06:34:30 2011
(r218696)
@@ -5,16 +5,19 @@
 The '-H' option will toggle the display of kernel visible thread contexts.
 At runtime the 'H' key will toggle this mode. The default is OFF.
 
-.SH DESCRIPTION OF MEMORY 
-Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free
+.SH DESCRIPTION OF MEMORY
+Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free
 Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out
-
+.TP
 .B K:
 Kilobyte
 .TP
 .B M:
 Megabyte
 .TP
+.B G:
+Gigabyte
+.TP
 .B %:
 1/100
 .TP
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218697 - stable/7/usr.bin/mail

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 07:12:16 2011
New Revision: 218697
URL: http://svn.freebsd.org/changeset/base/218697

Log:
  MFC 216698 by maxim from /head
  
  Fix -u flag description: it takes a username as an argument.
  
  PR: docs/153416
  Submitted by:   Eitan Adler

Modified:
  stable/7/usr.bin/mail/mail.1
Directory Properties:
  stable/7/usr.bin/mail/   (props changed)

Modified: stable/7/usr.bin/mail/mail.1
==
--- stable/7/usr.bin/mail/mail.1Tue Feb 15 06:34:30 2011
(r218696)
+++ stable/7/usr.bin/mail/mail.1Tue Feb 15 07:12:16 2011
(r218697)
@@ -156,7 +156,7 @@ line in the mail header.
 Overrides the
 .Va record
 variable, if set.
-.It Fl u
+.It Fl u Ar user
 Is equivalent to:
 .Pp
 .Dl "mail -f /var/mail/user"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218698 - stable/8/usr.bin/mail

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 07:12:41 2011
New Revision: 218698
URL: http://svn.freebsd.org/changeset/base/218698

Log:
  MFC 216698 by maxim from /head
  
  Fix -u flag description: it takes a username as an argument.
  
  PR: docs/153416
  Submitted by:   Eitan Adler

Modified:
  stable/8/usr.bin/mail/mail.1
Directory Properties:
  stable/8/usr.bin/mail/   (props changed)

Modified: stable/8/usr.bin/mail/mail.1
==
--- stable/8/usr.bin/mail/mail.1Tue Feb 15 07:12:16 2011
(r218697)
+++ stable/8/usr.bin/mail/mail.1Tue Feb 15 07:12:41 2011
(r218698)
@@ -156,7 +156,7 @@ line in the mail header.
 Overrides the
 .Va record
 variable, if set.
-.It Fl u
+.It Fl u Ar user
 Is equivalent to:
 .Pp
 .Dl "mail -f /var/mail/user"
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218699 - head/share/man/man7

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 07:16:27 2011
New Revision: 218699
URL: http://svn.freebsd.org/changeset/base/218699

Log:
  Document TRYBROKEN in ports(7).
  
  PR:   docs/153542
  Submitted by: Eitan Adler 
  MFC after:3 days

Modified:
  head/share/man/man7/ports.7

Modified: head/share/man/man7/ports.7
==
--- head/share/man/man7/ports.7 Tue Feb 15 07:12:41 2011(r218698)
+++ head/share/man/man7/ports.7 Tue Feb 15 07:16:27 2011(r218699)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 21, 2009
+.Dd February 14, 2009
 .Dt PORTS 7
 .Os
 .Sh NAME
@@ -477,6 +477,9 @@ Of course, these ports may not work as e
 what you are doing and are sure about installing a forbidden port, then
 .Va NO_IGNORE
 lets you do it.
+.It Va TRYBROKEN
+If defined, attempt to build a port even if it is marked as
+.Aq Va BROKEN .
 .It Va PORT_DBDIR
 Directory where the results of configuring
 .Va OPTIONS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r218700 - head/sbin/mksnap_ffs

2011-02-14 Thread Giorgos Keramidas
Author: keramida (doc committer)
Date: Tue Feb 15 07:25:54 2011
New Revision: 218700
URL: http://svn.freebsd.org/changeset/base/218700

Log:
  Note that a UFS filesystem can have up to 20 active snapshots.
  
  PR:   docs/151104
  Submitted by: Aldis Berjoza 
  MFC after:3 days

Modified:
  head/sbin/mksnap_ffs/mksnap_ffs.8

Modified: head/sbin/mksnap_ffs/mksnap_ffs.8
==
--- head/sbin/mksnap_ffs/mksnap_ffs.8   Tue Feb 15 07:16:27 2011
(r218699)
+++ head/sbin/mksnap_ffs/mksnap_ffs.8   Tue Feb 15 07:25:54 2011
(r218700)
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 29, 2009
+.Dd February 14, 2011
 .Dt MKSNAP_FFS 8
 .Os
 .Sh NAME
@@ -79,3 +79,12 @@ utility first appeared in
 .Sh CAVEATS
 The disk full situation is not handled gracefully and may
 lead to a system panic when no free blocks are found.
+.Pp
+Every filesystem can have only up to 20 active snapshots.
+When this limit is reached, attempting to create more snapshots
+fails with
+.Er ENOSPC ,
+and
+.Nm
+reports that it is
+.Dq out of space .
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"