svn commit: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-29 Thread Andriy Gapon
Author: avg
Date: Fri Jun 29 07:35:37 2012
New Revision: 237748
URL: http://svn.freebsd.org/changeset/base/237748

Log:
  dtrace instruction decoder: add 0x0f 0x1f NOP opcode support
  
  According to the AMD manual the whole range from 0x09 to 0x1f are NOPs.
  Intel manual mentions only 0x1f.  Use only Intel one for now, it seems
  to be the one actually generated by compilers.
  Use gdb mnemonic for the operation: "nopw".
  
  [1] AMD64 Architecture Programmer's Manual
  Volume 3: General-Purpose and System Instructions
  [2] Software Optimization Guide for AMD Family 10h Processors
  [3] Intel(R) 64 and IA-32 Architectures Software Developer’s Manual
  Volume 2 (2A, 2B & 2C): Instruction Set Reference, A-Z
  
  Tested by:Fabian Keil  (earlier version)
  MFC after:3 days

Modified:
  head/sys/cddl/dev/dtrace/amd64/dis_tables.c
  head/sys/cddl/dev/dtrace/i386/dis_tables.c

Modified: head/sys/cddl/dev/dtrace/amd64/dis_tables.c
==
--- head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jun 29 06:41:19 2012
(r237747)
+++ head/sys/cddl/dev/dtrace/amd64/dis_tables.c Fri Jun 29 07:35:37 2012
(r237748)
@@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = {
 /*  [10]  */   TNSZ("movups",XMMO,16), 
TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8),  TNSZ("movlps",XMMOS,8),
 /*  [14]  */   
TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8),
 /*  [18]  */   IND(dis_op0F18),INVALID,INVALID,
INVALID,
-/*  [1C]  */   INVALID,INVALID,INVALID,
INVALID,
+/*  [1C]  */   INVALID,INVALID,INVALID,
TNS("nopw", M),
 }, {
 /*  [20]  */   TSy("mov",SREG),TSy("mov",SREG),
TSy("mov",SREG),TSy("mov",SREG),
 /*  [24]  */   TSx("mov",SREG),INVALID,
TSx("mov",SREG),INVALID,

Modified: head/sys/cddl/dev/dtrace/i386/dis_tables.c
==
--- head/sys/cddl/dev/dtrace/i386/dis_tables.c  Fri Jun 29 06:41:19 2012
(r237747)
+++ head/sys/cddl/dev/dtrace/i386/dis_tables.c  Fri Jun 29 07:35:37 2012
(r237748)
@@ -815,7 +815,7 @@ const instable_t dis_op0F[16][16] = {
 /*  [10]  */   TNSZ("movups",XMMO,16), 
TNSZ("movups",XMMOS,16),TNSZ("movlps",XMMO,8),  TNSZ("movlps",XMMOS,8),
 /*  [14]  */   
TNSZ("unpcklps",XMMO,16),TNSZ("unpckhps",XMMO,16),TNSZ("movhps",XMMOM,8),TNSZ("movhps",XMMOMS,8),
 /*  [18]  */   IND(dis_op0F18),INVALID,INVALID,
INVALID,
-/*  [1C]  */   INVALID,INVALID,INVALID,
INVALID,
+/*  [1C]  */   INVALID,INVALID,INVALID,
TNS("nopw", M),
 }, {
 /*  [20]  */   TSy("mov",SREG),TSy("mov",SREG),
TSy("mov",SREG),TSy("mov",SREG),
 /*  [24]  */   TSx("mov",SREG),INVALID,
TSx("mov",SREG),INVALID,
___
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: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-29 Thread Andriy Gapon
on 29/06/2012 10:35 Andriy Gapon said the following:
> Author: avg
> Date: Fri Jun 29 07:35:37 2012
> New Revision: 237748
> URL: http://svn.freebsd.org/changeset/base/237748
> 
> Log:
>   dtrace instruction decoder: add 0x0f 0x1f NOP opcode support
>   
>   According to the AMD manual the whole range from 0x09 to 0x1f are NOPs.
>   Intel manual mentions only 0x1f.  Use only Intel one for now, it seems
>   to be the one actually generated by compilers.
>   Use gdb mnemonic for the operation: "nopw".

BTW, here I have a patch that brings our copy of dtrace dis_tables.c to the
latest version available in OpenSolaris code:
http://people.freebsd.org/~avg/dtrace-disassm-osol.diff

I haven't studied at all what the newer code brings in, but it must be some
fixes and improvements, I guess :-)
The change is mostly a mechanical merge, plus some changes on top to get the
code to compile.
I've been using the code for a few weeks and haven't run into any problems.

Should I put this change into the tree?

-- 
Andriy Gapon


___
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: r237777 - head/usr.sbin/vidcontrol

2012-06-29 Thread Andrey A. Chernov
Author: ache
Date: Fri Jun 29 12:55:36 2012
New Revision: 23
URL: http://svn.freebsd.org/changeset/base/23

Log:
  Call set_terminal_mode() after video mode change, not before, because
  video mode change always reset terminal mode to xterm.
  It allows things like 'vidcontrol -T cons25 80x30' works as supposed,
  and allows 'allscreens_flags="-T cons25 80x30"' in /etc/rc.conf too.
  
  MFC after:  1 week

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

Modified: head/usr.sbin/vidcontrol/vidcontrol.c
==
--- head/usr.sbin/vidcontrol/vidcontrol.c   Fri Jun 29 12:11:31 2012
(r237776)
+++ head/usr.sbin/vidcontrol/vidcontrol.c   Fri Jun 29 12:55:36 2012
(r23)
@@ -1192,15 +1192,13 @@ set_terminal_mode(char *arg)
fprintf(stderr, "\033[=T");
else if (strcmp(arg, "cons25") == 0)
fprintf(stderr, "\033[=1T");
-   else
-   usage();
 }
 
 
 int
 main(int argc, char **argv)
 {
-   char*font, *type;
+   char*font, *type, *termmode;
int dumpmod, dumpopt, opt;
int reterr;
 
@@ -1212,6 +1210,7 @@ main(int argc, char **argv)
err(1, "must be on a virtual console");
dumpmod = 0;
dumpopt = DUMP_FBF;
+   termmode = NULL;
while ((opt = getopt(argc, argv,
"b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
switch(opt) {
@@ -1283,7 +1282,10 @@ main(int argc, char **argv)
set_console(optarg);
break;
case 'T':
-   set_terminal_mode(optarg);
+   if (strcmp(optarg, "xterm") != 0 &&
+   strcmp(optarg, "cons25") != 0)
+   usage();
+   termmode = optarg;
break;
case 't':
set_screensaver_timeout(optarg);
@@ -1306,6 +1308,8 @@ main(int argc, char **argv)
}
 
video_mode(argc, argv, &optind);
+   if (termmode != NULL)
+   set_terminal_mode(termmode);
 
get_normal_colors(argc, argv, &optind);
 
___
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: r237656 - in head: contrib/top usr.bin/top

2012-06-29 Thread Pawel Jakub Dawidek
On Wed, Jun 27, 2012 at 03:17:26PM -0400, John Baldwin wrote:
> On Wednesday, June 27, 2012 2:08:48 pm John Baldwin wrote:
> > Author: jhb
> > Date: Wed Jun 27 18:08:48 2012
> > New Revision: 237656
> > URL: http://svn.freebsd.org/changeset/base/237656
> > 
> > Log:
> >   Add a new line to top that provides a brief summary of the ZFS ARC memory
> >   usage on hosts using ZFS.  The new line displays the total amount of RAM
> >   used by the ARC along with the size of MFU, MRU, anonymous (in flight),
> >   headers, and other (miscellaneous) sub-categories.  The line is not
> >   displayed on systems that are not using ZFS.
> >   
> >   Reviewed by:  avg, fs@
> >   MFC after:3 days
> 
> FYI, sample output:
> 
> CPU:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
> Mem: 1252M Active, 1422M Inact, 23G Wired, 331M Buf, 21G Free
> ARC: 21G Total, 1354M MRU, 19G MFU, 272K Anon, 243M Header, 447M Other
> Swap: 8192M Total, 8192M Free

Cool:)

-- 
Pawel Jakub Dawidek   http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl


pgpOKrI6zRpHJ.pgp
Description: PGP signature


Re: svn commit: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/

2012-06-29 Thread David O'Brien
On Wed, Jun 27, 2012 at 04:39:30AM +, Pedro F. Giffuni wrote:
> Log:
>   Bring llquantize support into Dtrace.
>   Bryan Cantrill implemented the equivalent of semi-log graph
>   paper for Dtrace so llquantize will use one logarithmic and
>   one linear scale.
...
>   Obtained from:  Illumos
...
> Added: 
> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ 
> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
>Wed Jun 27 04:39:30 2012(r237624)
> @@ -0,0 +1,29 @@
> +/*
> + * CDDL HEADER START
> + *
> + * The contents of this file are subject to the terms of the
> + * Common Development and Distribution License (the "License").
> + * You may not use this file except in compliance with the License.
...
> +/*
> + * Copyright (c) 2011, Joyent, Inc. All rights reserved.
> + */

Pedro,
It looks like you simply 'svn add'ed this file, rather than importing it
into '^/vendor/opensolaris/dist'.  Please correct me if I am wrong.

We've become rather sloppy in the past 1-2 years in our handling of
3rd-party externally developed code.  Something we need to return to
our older ways good ways of handling.

This is something that is especially important with GPL, CDDL, and
similar licenses.

Commercial entities that base products on FreeBSD have to worry about
code provenance for various intellectual property legal reasons and we
muddy the waters when we make it harder to track who and where code came
from.
[Please see http://www.osgeo.org/incubator/process/codereview.html &
http://wiki.osgeo.org/wiki/Code_Provenance_Review to better understand
this issue.]

Not following our established procedure also means that the average
developer(committer) and commercial consumer will have their expectations
fail.  One expects to be able to find the stock vendor sources in
ssh://svn.freebsd.org/base/vendor/ and to be able to find FreeBSD local
changes to the sources thru 'svn diff' against 
'ssh://svn.freebsd.org/base/head'.

Please correct this by properly importing the sources, 'svn delete'ing
the files you 'svn add'ed, and do an 'svn copy' of the new files.

thanks,
-- 
-- David  (obr...@freebsd.org)
___
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: r237787 - head/sys/net

2012-06-29 Thread John Baldwin
Author: jhb
Date: Fri Jun 29 15:21:34 2012
New Revision: 237787
URL: http://svn.freebsd.org/changeset/base/237787

Log:
  Hold GIF_LOCK() for almost all of gif_start().  It is required to be held
  across in_gif_output() and in6_gif_output() anyway, and once it is held
  across those it might as well be held for the entire loop.  This simplifies
  the code and removes the need for the custom IFF_GIF_WANTED flag (which
  belonged in the softc and not as an IFF_* flag anyway).
  
  Tested by:Vincent Hoffman  vince  unsane co uk

Modified:
  head/sys/net/if.h
  head/sys/net/if_gif.c

Modified: head/sys/net/if.h
==
--- head/sys/net/if.h   Fri Jun 29 15:10:54 2012(r237786)
+++ head/sys/net/if.h   Fri Jun 29 15:21:34 2012(r237787)
@@ -153,7 +153,6 @@ struct if_data {
 #defineIFF_STATICARP   0x8 /* (n) static ARP */
 #defineIFF_DYING   0x20/* (n) interface is winding 
down */
 #defineIFF_RENAMING0x40/* (n) interface is being 
renamed */
-#define IFF_GIF_WANTED 0x100   /* (n) The gif tunnel is wanted */
 /*
  * Old names for driver flags so that user space tools can continue to use
  * the old (portable) names.

Modified: head/sys/net/if_gif.c
==
--- head/sys/net/if_gif.c   Fri Jun 29 15:10:54 2012(r237786)
+++ head/sys/net/if_gif.c   Fri Jun 29 15:21:34 2012(r237787)
@@ -359,15 +359,7 @@ gif_start(struct ifnet *ifp)
 
sc = ifp->if_softc;
GIF_LOCK(sc);
-   if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
-   /* Already active */
-   ifp->if_drv_flags |= IFF_GIF_WANTED;
-   GIF_UNLOCK(sc);
-   return;
-   }
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-   GIF_UNLOCK(sc);
-keep_going:
while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) {
 
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
@@ -424,16 +416,6 @@ keep_going:
ifp->if_oerrors++;
 
}
-   GIF_LOCK(sc);
-   if (ifp->if_drv_flags & IFF_GIF_WANTED) {
-   /* Someone did a start while
-* we were unlocked and processing
-* lets clear the flag and try again.
-*/
-   ifp->if_drv_flags &= ~IFF_GIF_WANTED;
-   GIF_UNLOCK(sc);
-   goto keep_going;
-   }
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
GIF_UNLOCK(sc);
return;
___
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: r237794 - head/tools/regression/filemon

2012-06-29 Thread David E. O'Brien
Author: obrien
Date: Fri Jun 29 15:54:07 2012
New Revision: 237794
URL: http://svn.freebsd.org/changeset/base/237794

Log:
  Support also running a 32-bit test on 64-bit platforms.

Modified:
  head/tools/regression/filemon/Makefile

Modified: head/tools/regression/filemon/Makefile
==
--- head/tools/regression/filemon/Makefile  Fri Jun 29 15:47:03 2012
(r237793)
+++ head/tools/regression/filemon/Makefile  Fri Jun 29 15:54:07 2012
(r237794)
@@ -9,16 +9,18 @@ CFLAGS+= -I${.CURDIR}/../../../sys
 
 # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in .
 test: ${PROG} clean-test
+.for BIN in ${PROG} ${PROG}32
cd ${.CURDIR} ; \
for A in 1 2 3 4 5 6 7 8 9 0; do \
for B in 1 2 3 4 5 6 7 8 9 0; do \
for C in 1 2 3 4 5 6 7 8 9 0; do \
-   ${.OBJDIR}/${PROG} ;\
+   test -x ${BIN} && ${.OBJDIR}/${BIN} ;\
done ;\
done ;\
done
@cd ${.CURDIR} ; set +e ; egrep '(Start|Stop) .*\.' filemon_log.* | \
grep -q -v '\.[0-9][0-9][0-9][0-9][0-9][0-9]$$' || echo "Time stamp 
format OK"
+.endfor
 
 clean-test:
cd ${.CURDIR} ; rm -f filemon_log.*
___
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: r237730 - in head/sys: powerpc/conf sparc64/conf

2012-06-29 Thread Marius Strobl
On Thu, Jun 28, 2012 at 08:48:24PM +, Kenneth D. Merry wrote:
> Author: ken
> Date: Thu Jun 28 20:48:24 2012
> New Revision: 237730
> URL: http://svn.freebsd.org/changeset/base/237730
> 
> Log:
>   Now that the mps(4) driver is endian-safe, add it to the powerpc and
>   sparc64 GENERIC config files.
>   

Thanks!

Marius

___
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: r237799 - head/sys/dev/cxgbe

2012-06-29 Thread Navdeep Parhar
Author: np
Date: Fri Jun 29 16:50:52 2012
New Revision: 237799
URL: http://svn.freebsd.org/changeset/base/237799

Log:
  cxgbe(4): support for IPv6 hardware checksumming (rx and tx).

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Jun 29 16:30:15 2012
(r237798)
+++ head/sys/dev/cxgbe/t4_main.cFri Jun 29 16:50:52 2012
(r237799)
@@ -822,7 +822,7 @@ cxgbe_probe(device_t dev)
 
 #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
-IFCAP_VLAN_HWTSO)
+IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6)
 #define T4_CAP_ENABLE (T4_CAP & ~IFCAP_TSO6)
 
 static int
@@ -856,7 +856,8 @@ cxgbe_attach(device_t dev)
ifp->if_capabilities |= IFCAP_TOE4;
 #endif
ifp->if_capenable = T4_CAP_ENABLE;
-   ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO;
+   ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
+   CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
 
/* Initialize ifmedia for this port */
ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change,
@@ -1028,30 +1029,50 @@ fail:
 
if (IFCAP_TSO & ifp->if_capenable &&
!(IFCAP_TXCSUM & ifp->if_capenable)) {
-   ifp->if_capenable &= ~IFCAP_TSO;
-   ifp->if_hwassist &= ~CSUM_TSO;
+   ifp->if_capenable &= ~IFCAP_TSO4;
if_printf(ifp,
"tso disabled due to -txcsum.\n");
}
}
+   if (mask & IFCAP_TXCSUM_IPV6) {
+   ifp->if_capenable ^= IFCAP_TXCSUM_IPV6;
+   ifp->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6);
+
+   if (IFCAP_TSO6 & ifp->if_capenable &&
+   !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
+   ifp->if_capenable &= ~IFCAP_TSO6;
+   if_printf(ifp,
+   "tso6 disabled due to -txcsum6.\n");
+   }
+   }
if (mask & IFCAP_RXCSUM)
ifp->if_capenable ^= IFCAP_RXCSUM;
+   if (mask & IFCAP_RXCSUM_IPV6)
+   ifp->if_capenable ^= IFCAP_RXCSUM_IPV6;
+
+   /*
+* Note that we leave CSUM_TSO alone (it is always set).  The
+* kernel takes both IFCAP_TSOx and CSUM_TSO into account before
+* sending a TSO request our way, so it's sufficient to toggle
+* IFCAP_TSOx only.
+*/
if (mask & IFCAP_TSO4) {
+   if (!(IFCAP_TSO4 & ifp->if_capenable) &&
+   !(IFCAP_TXCSUM & ifp->if_capenable)) {
+   if_printf(ifp, "enable txcsum first.\n");
+   rc = EAGAIN;
+   goto fail;
+   }
ifp->if_capenable ^= IFCAP_TSO4;
-
-   if (IFCAP_TSO & ifp->if_capenable) {
-   if (IFCAP_TXCSUM & ifp->if_capenable)
-   ifp->if_hwassist |= CSUM_TSO;
-   else {
-   ifp->if_capenable &= ~IFCAP_TSO;
-   ifp->if_hwassist &= ~CSUM_TSO;
-   if_printf(ifp,
-   "enable txcsum first.\n");
-   rc = EAGAIN;
-   goto fail;
-   }
-   } else
-   ifp->if_hwassist &= ~CSUM_TSO;
+   }
+   if (mask & IFCAP_TSO6) {
+   if (!(IFCAP_TSO6 & ifp->if_capenable) &&
+   !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
+   if_printf(ifp, "enable txcsum6 first.\n");
+   rc = EAGAIN;
+   goto fail;
+   }
+   ifp->if_capenable ^= IFCAP_TSO6;
}
if (mask & IFCAP_LRO) {
 #ifdef INET

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 16:30:15 2012(r237798)
+++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 16:50:52 2012(r237799)
@@ -1054,15 +1054,23 @@ t4_eth_rx(struct sge_iq *iq, const struc
m0->m_flags |= M_FLOWID;
m0->m_pkthdr.flowid = rss->hash_val;
 
-   if (cpl

svn commit: r237800 - head/sys/dev/mps

2012-06-29 Thread Kenneth D. Merry
Author: ken
Date: Fri Jun 29 17:00:52 2012
New Revision: 237800
URL: http://svn.freebsd.org/changeset/base/237800

Log:
  Change the mps(4) driver to only scan a target if that is what is
  needed instead of scanning the full bus every time.
  
  Submitted by: mav
  Discussed with:   Sreekanth Reddy 
  MFC after:3 days

Modified:
  head/sys/dev/mps/mps_sas.c

Modified: head/sys/dev/mps/mps_sas.c
==
--- head/sys/dev/mps/mps_sas.c  Fri Jun 29 16:50:52 2012(r237799)
+++ head/sys/dev/mps/mps_sas.c  Fri Jun 29 17:00:52 2012(r237800)
@@ -278,8 +278,11 @@ mpssas_rescan_target(struct mps_softc *s
return;
}
 
-   /* XXX Hardwired to scan the bus for now */
-   ccb->ccb_h.func_code = XPT_SCAN_BUS;
+   if (targetid == CAM_TARGET_WILDCARD)
+   ccb->ccb_h.func_code = XPT_SCAN_BUS;
+   else
+   ccb->ccb_h.func_code = XPT_SCAN_TGT; 
+
mps_dprint(sc, MPS_TRACE, "%s targetid %u\n", __func__, targetid);
mpssas_rescan(sassc, ccb);
 }
___
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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/

2012-06-29 Thread Pedro Giffuni
Hi David;

--- Ven 29/6/12, David O'Brien  ha scritto:
...
> ...
> > +/*
> > + * Copyright (c) 2011, Joyent, Inc. All rights
> reserved.
> > + */
> 
> Pedro,
> It looks like you simply 'svn add'ed this file, rather than
> importing it into '^/vendor/opensolaris/dist'.  
> Please correct me if I am wrong.
> 

You are absolutely right. However I am not sure we should
bring Illumos enhancements under the opensolaris vendor
branch. The reason is that this files are CDDL'd but are
there was no property assignment done to the OpenSolaris
copyright owner. [1]

If somehow Oracle decides to relicense Dtrace or ZFS we
still must keep these changes isolated from the code
provided in the vendor branch.


> We've become rather sloppy in the past 1-2 years in our
> handling of 3rd-party externally developed code.  Something
> we need to return to our older ways good ways of handling.
> 

Yes, that is true.

I think we have to decide if we are going to consider
Illumos a vendor on it's own. For ZFS it would seem
the right thing to do, for Dtrace I am not sure: at
least I am not considering bringing any other feature
at this time.


Thank you for the links on Code Provenance Review.

> 
> Please correct this by properly importing the sources, 'svn
> delete'ing the files you 'svn add'ed, and do an 'svn copy'
> of the new files.
>

I think the discussion is indeed important enough to
suspend the MFC I was planning and if desired I can
also revert the commit.

Pedro.


[1] 
http://smartos.org/2011/12/15/fork-yeah-the-rise-and-development-of-illumos-2/
___
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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/

2012-06-29 Thread Pedro Giffuni
(Sorry for top-posting]

Actually ...

David pointed out a fundamental flaw on my part.

These are new files under a non-BSD license. Even when
they are only scripts used for testing I shouldn't have
brought them in without -core approval.

I will delete them right away and core shall decide
afterwards if and how they can be brought in.

Pedro.


--- Ven 29/6/12, David O'Brien  ha scritto:

> Da: David O'Brien 
> Oggetto: Re: svn commit: r237624 - in head: 
> cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 
> cddl/contrib/opensolaris/lib/libdtrace/common 
> sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c...
> A: "Pedro F. Giffuni" 
> Cc: src-committ...@freebsd.org, svn-src-...@freebsd.org, 
> svn-src-head@FreeBSD.org
> Data: Venerdì 29 giugno 2012, 10:21
> On Wed, Jun 27, 2012 at 04:39:30AM
> +, Pedro F. Giffuni wrote:
> > Log:
> >   Bring llquantize support into Dtrace.
> >   Bryan Cantrill implemented the
> equivalent of semi-log graph
> >   paper for Dtrace so llquantize will
> use one logarithmic and
> >   one linear scale.
> ...
> >   Obtained from:   
> Illumos
> ...
> > Added:
> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d
> >
> ==
> > --- /dev/null    00:00:00
> 1970    (empty, because file is newly added)
> > +++
> head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_FACTOREVEN.nodivide.d   
> Wed Jun 27 04:39:30 2012    (r237624)
> > @@ -0,0 +1,29 @@
> > +/*
> > + * CDDL HEADER START
> > + *
> > + * The contents of this file are subject to the terms
> of the
> > + * Common Development and Distribution License (the
> "License").
> > + * You may not use this file except in compliance with
> the License.
> ...
> > +/*
> > + * Copyright (c) 2011, Joyent, Inc. All rights
> reserved.
> > + */
> 
> Pedro,
> It looks like you simply 'svn add'ed this file, rather than
> importing it
> into '^/vendor/opensolaris/dist'.  Please correct me if
> I am wrong.
> 
> We've become rather sloppy in the past 1-2 years in our
> handling of
> 3rd-party externally developed code.  Something we need
> to return to
> our older ways good ways of handling.
> 
> This is something that is especially important with GPL,
> CDDL, and
> similar licenses.
> 
> Commercial entities that base products on FreeBSD have to
> worry about
> code provenance for various intellectual property legal
> reasons and we
> muddy the waters when we make it harder to track who and
> where code came
> from.
> [Please see http://www.osgeo.org/incubator/process/codereview.html
> &
> http://wiki.osgeo.org/wiki/Code_Provenance_Review to
> better understand
> this issue.]
> 
> Not following our established procedure also means that the
> average
> developer(committer) and commercial consumer will have their
> expectations
> fail.  One expects to be able to find the stock vendor
> sources in
> ssh://svn.freebsd.org/base/vendor/ and to be able to find
> FreeBSD local
> changes to the sources thru 'svn diff' against
> 'ssh://svn.freebsd.org/base/head'.
> 
> Please correct this by properly importing the sources, 'svn
> delete'ing
> the files you 'svn add'ed, and do an 'svn copy' of the new
> files.
> 
> thanks,
> -- 
> -- David  (obr...@freebsd.org)
>
___
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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/

2012-06-29 Thread George Neville-Neil

On Jun 29, 2012, at 13:35 , Pedro Giffuni wrote:

> (Sorry for top-posting]
> 
> Actually ...
> 
> David pointed out a fundamental flaw on my part.
> 
> These are new files under a non-BSD license. Even when
> they are only scripts used for testing I shouldn't have
> brought them in without -core approval.
> 
> I will delete them right away and core shall decide
> afterwards if and how they can be brought in.
> 

Are the files under a CDDL license?  Since that's the point of where you added 
them
I don't think that that should be an issue.  The issue comes when we might
ship CDDL code by default, but these are tests and so that should not be a 
problem.

If they're not CDDL then that is an issue.

Best,
George


___
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: r237748 - in head/sys/cddl/dev/dtrace: amd64 i386

2012-06-29 Thread George Neville-Neil

On Jun 29, 2012, at 03:42 , Andriy Gapon wrote:

> on 29/06/2012 10:35 Andriy Gapon said the following:
>> Author: avg
>> Date: Fri Jun 29 07:35:37 2012
>> New Revision: 237748
>> URL: http://svn.freebsd.org/changeset/base/237748
>> 
>> Log:
>>  dtrace instruction decoder: add 0x0f 0x1f NOP opcode support
>> 
>>  According to the AMD manual the whole range from 0x09 to 0x1f are NOPs.
>>  Intel manual mentions only 0x1f.  Use only Intel one for now, it seems
>>  to be the one actually generated by compilers.
>>  Use gdb mnemonic for the operation: "nopw".
> 
> BTW, here I have a patch that brings our copy of dtrace dis_tables.c to the
> latest version available in OpenSolaris code:
> http://people.freebsd.org/~avg/dtrace-disassm-osol.diff
> 
> I haven't studied at all what the newer code brings in, but it must be some
> fixes and improvements, I guess :-)
> The change is mostly a mechanical merge, plus some changes on top to get the
> code to compile.
> I've been using the code for a few weeks and haven't run into any problems.
> 
> Should I put this change into the tree?

Have you tried running the DTrace test suite on it?  We have the suite in the 
tree.

If the suite passes similarly with and without the patch I'd say just put it in 
and
we'll go from there.

It's quite a large patch, but, yes, much of it is mechanical changes.

Best,
George

___
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: r237624 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/

2012-06-29 Thread Pedro Giffuni


--- Ven 29/6/12, George Neville-Neil  ha scritto:

> Da: George Neville-Neil 
> Oggetto: Re: svn commit: r237624 - in head: 
> cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/llquantize 
> cddl/contrib/opensolaris/lib/libdtrace/common 
> sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/c...
> A: p...@freebsd.org
> Cc: obr...@freebsd.org, src-committ...@freebsd.org, svn-src-...@freebsd.org, 
> svn-src-head@FreeBSD.org
> Data: Venerdì 29 giugno 2012, 12:47
> 
> On Jun 29, 2012, at 13:35 , Pedro Giffuni wrote:
> 
> > (Sorry for top-posting]
> > 
> > Actually ...
> > 
> > David pointed out a fundamental flaw on my part.
> > 
> > These are new files under a non-BSD license. Even when
> > they are only scripts used for testing I shouldn't
> have
> > brought them in without -core approval.
> > 
> > I will delete them right away and core shall decide
> > afterwards if and how they can be brought in.
> > 
> 
> Are the files under a CDDL license?  Since that's the
> point of where you added them I don't think that that
> should be an issue.  The issue comes when we might
> ship CDDL code by default, but these are tests and so that
> should not be a problem.
> 

They are under CDDL. I re-read the committer's guide and
they are right where they are.

Now .. David pointed out I am not respecting the code
provenance since I didn't add them to the opensolaris
vendor area, but these files are copyrighted Joyent
Inc (not even Illumos) so I cannot put them there
unless we create a new vendor for Joyent.

As George notes, they are only test files so we can
live without them if this is too much mess.

Pedro.
___
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: r237813 - head/sys/amd64/amd64

2012-06-29 Thread Alan Cox
Author: alc
Date: Fri Jun 29 18:15:56 2012
New Revision: 237813
URL: http://svn.freebsd.org/changeset/base/237813

Log:
  In r237592, I forgot that pmap_enter() might already hold a PV list lock
  at the point that it calls get_pv_entry().  Thus, pmap_enter()'s PV list
  lock pointer must be passed to get_pv_entry() for those rare occasions
  when get_pv_entry() calls reclaim_pv_chunk().
  
  Update some related comments.

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

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Fri Jun 29 18:09:39 2012(r237812)
+++ head/sys/amd64/amd64/pmap.c Fri Jun 29 18:15:56 2012(r237813)
@@ -264,7 +264,7 @@ static caddr_t crashdumpmap;
 
 static voidfree_pv_chunk(struct pv_chunk *pc);
 static voidfree_pv_entry(pmap_t pmap, pv_entry_t pv);
-static pv_entry_t get_pv_entry(pmap_t pmap, boolean_t try);
+static pv_entry_t get_pv_entry(pmap_t pmap, struct rwlock **lockp);
 static int popcnt_pc_map_elem(uint64_t elem);
 static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp);
 static voidreserve_pv_entries(pmap_t pmap, int needed,
@@ -2102,6 +2102,8 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_
  * drastic measures to free some pages so we can allocate
  * another pv entry chunk.
  *
+ * Returns NULL if PV entries were reclaimed from the specified pmap.
+ *
  * We do not, however, unmap 2mpages because subsequent accesses will
  * allocate per-page pv entries until repromotion occurs, thereby
  * exacerbating the shortage of free pv entries.
@@ -2123,6 +2125,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, str

rw_assert(&pvh_global_lock, RA_LOCKED);
PMAP_LOCK_ASSERT(locked_pmap, MA_OWNED);
+   KASSERT(lockp != NULL, ("reclaim_pv_chunk: lockp is NULL"));
pmap = NULL;
free = m_pc = NULL;
TAILQ_INIT(&new_tail);
@@ -2287,16 +2290,19 @@ free_pv_chunk(struct pv_chunk *pc)
 }
 
 /*
- * get a new pv_entry, allocating a block from the system
- * when needed.
+ * Returns a new PV entry, allocating a new PV chunk from the system when
+ * needed.  If this PV chunk allocation fails and a PV list lock pointer was
+ * given, a PV chunk is reclaimed from an arbitrary pmap.  Otherwise, NULL is
+ * returned.
+ *
+ * The given PV list lock may be released.
  */
 static pv_entry_t
-get_pv_entry(pmap_t pmap, boolean_t try)
+get_pv_entry(pmap_t pmap, struct rwlock **lockp)
 {
int bit, field;
pv_entry_t pv;
struct pv_chunk *pc;
-   struct rwlock *lock;
vm_page_t m;
 
rw_assert(&pvh_global_lock, RA_LOCKED);
@@ -2330,14 +2336,11 @@ retry:
m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ |
VM_ALLOC_WIRED);
if (m == NULL) {
-   if (try) {
+   if (lockp == NULL) {
PV_STAT(pc_chunk_tryfail++);
return (NULL);
}
-   lock = NULL;
-   m = reclaim_pv_chunk(pmap, &lock);
-   if (lock != NULL)
-   rw_wunlock(lock);
+   m = reclaim_pv_chunk(pmap, lockp);
if (m == NULL)
goto retry;
}
@@ -2380,6 +2383,8 @@ popcnt_pc_map_elem(uint64_t elem)
 /*
  * Ensure that the number of spare PV entries in the specified pmap meets or
  * exceeds the given count, "needed".
+ *
+ * The given PV list lock may be released.
  */
 static void
 reserve_pv_entries(pmap_t pmap, int needed, struct rwlock **lockp)
@@ -2391,6 +2396,7 @@ reserve_pv_entries(pmap_t pmap, int need
 
rw_assert(&pvh_global_lock, RA_LOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
+   KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL"));
 
/*
 * Newly allocated PV chunks must be stored in a private list until
@@ -2584,7 +2590,8 @@ pmap_pvh_free(struct md_page *pvh, pmap_
 }
 
 /*
- * Conditionally create a pv entry.
+ * Conditionally create the PV entry for a 4KB page mapping if the required
+ * memory can be allocated without resorting to reclamation.
  */
 static boolean_t
 pmap_try_insert_pv_entry(pmap_t pmap, vm_offset_t va, vm_page_t m,
@@ -2594,7 +2601,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
 
rw_assert(&pvh_global_lock, RA_LOCKED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
-   if ((pv = get_pv_entry(pmap, TRUE)) != NULL) {
+   /* Pass NULL instead of the lock pointer to disable reclamation. */
+   if ((pv = get_pv_entry(pmap, NULL)) != NULL) {
pv->pv_va = va;
CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m);
TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list);
@@ -2604,7 +2612,8 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm
 }
 
 /*
- * Create the pv entry for a 2MB page mapping.
+ * Conditionally create the PV entry for a 2MB page mapping if the required
+ * memory can be allocated without resorting 

svn commit: r237817 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2012-06-29 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Jun 29 18:49:14 2012
New Revision: 237817
URL: http://svn.freebsd.org/changeset/base/237817

Log:
  Bump dtrace_helper_actions_max from 32 to 128
  
  Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but,
  according to his blog, 128 is the recommended minimum.
  
  For now bump it safely to 128 although we may have to bump it further
  if there is demand in the future.
  
  Reference:
  
  http://www.illumos.org/issues/2558
  
http://dtrace.org/blogs/dap/2012/01/50/where-does-your-node-program-spend-its-time/

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cFri Jun 
29 18:39:31 2012(r237816)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.cFri Jun 
29 18:49:14 2012(r237817)
@@ -157,7 +157,7 @@ dtrace_optval_t dtrace_dof_maxsize = (25
 size_t dtrace_global_maxsize = (16 * 1024);
 size_t dtrace_actions_max = (16 * 1024);
 size_t dtrace_retain_max = 1024;
-dtrace_optval_tdtrace_helper_actions_max = 32;
+dtrace_optval_tdtrace_helper_actions_max = 128;
 dtrace_optval_tdtrace_helper_providers_max = 32;
 dtrace_optval_tdtrace_dstate_defsize = (1 * 1024 * 1024);
 size_t dtrace_strsize_default = 256;
___
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: r237818 - head/sys/powerpc/conf

2012-06-29 Thread Joel Dahl
Author: joel (doc committer)
Date: Fri Jun 29 19:05:29 2012
New Revision: 237818
URL: http://svn.freebsd.org/changeset/base/237818

Log:
  Reduce diffs between GENERIC and GENERIC64. Also fix a few whitespace nits
  while I'm here. No functional change.

Modified:
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64

Modified: head/sys/powerpc/conf/GENERIC
==
--- head/sys/powerpc/conf/GENERIC   Fri Jun 29 18:49:14 2012
(r237817)
+++ head/sys/powerpc/conf/GENERIC   Fri Jun 29 19:05:29 2012
(r237818)
@@ -21,14 +21,14 @@
 cpuAIM
 ident  GENERIC
 
-machinepowerpc powerpc
+machinepowerpc powerpc
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
 
 # Platform support
 optionsPOWERMAC#NewWorld Apple PowerMacs
 optionsPSIM#GDB PSIM ppc simulator
-optionsMAMBO   #IBM Mambo Full System Simulator
+optionsMAMBO   #IBM Mambo Full System Simulator
 
 optionsSCHED_ULE   #ULE scheduler
 optionsPREEMPTION  #Enable kernel thread preemption
@@ -82,7 +82,7 @@ options   WITNESS #Enable checks to det
 optionsWITNESS_SKIPSPIN#Don't run witness on spinlocks for 
speed
 optionsMALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
 
-# To make an SMP kernel, the next line is needed
+# Make an SMP-capable kernel by default
 optionsSMP # Symmetric MultiProcessor Kernel
 
 # CPU frequency control

Modified: head/sys/powerpc/conf/GENERIC64
==
--- head/sys/powerpc/conf/GENERIC64 Fri Jun 29 18:49:14 2012
(r237817)
+++ head/sys/powerpc/conf/GENERIC64 Fri Jun 29 19:05:29 2012
(r237818)
@@ -21,14 +21,14 @@
 cpuAIM
 ident  GENERIC
 
-machinepowerpc powerpc64
+machinepowerpc powerpc64
 
 makeoptionsDEBUG=-g#Build kernel with gdb(1) debug symbols
 
 # Platform support
 optionsPOWERMAC#NewWorld Apple PowerMacs
-optionsPS3 #Sony Playstation 3
-optionsMAMBO   #IBM Mambo Full System Simulator
+optionsPS3 #Sony Playstation 3
+optionsMAMBO   #IBM Mambo Full System Simulator
 
 optionsSCHED_ULE   #ULE scheduler
 optionsPREEMPTION  #Enable kernel thread preemption
@@ -67,8 +67,11 @@ options  AUDIT   # Security event auditi
 optionsMAC # TrustedBSD MAC Framework
 optionsINCLUDE_CONFIG_FILE # Include this file in kernel
 
-# Debugging for use in -current
-optionsKDB #Enable the kernel debugger
+# Debugging support.  Always need this:
+optionsKDB # Enable kernel debugger support.
+# For minimum debugger support (stable branch) use:
+#options   KDB_TRACE   # Print a stack trace for a panic.
+# For full debugger support use this instead:
 optionsDDB #Support DDB
 #options   DEADLKRES   #Enable the deadlock resolver
 optionsINVARIANTS  #Enable calls of extra sanity checking
@@ -171,8 +174,8 @@ device  cue # CATC USB Ethernet
 device kue # Kawasaki LSI USB Ethernet
 
 # Wireless NIC cards
-options IEEE80211_SUPPORT_MESH
-options AH_SUPPORT_AR5416
+optionsIEEE80211_SUPPORT_MESH
+optionsAH_SUPPORT_AR5416
 
 # FireWire support
 device firewire# FireWire bus code
___
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"


R: svn commit: r237817 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace

2012-06-29 Thread Pedro Giffuni

--- Ven 29/6/12, Pedro F. Giffuni ha scritto:
...
> 
> Log:
>   Bump dtrace_helper_actions_max from 32 to 128
>   
>   Dave Pacheco from Joyent (and Dtrace.org) bumped the cap to 1024 but,
>   according to his blog, 128 is the recommended minimum.
>   
>   For now bump it safely to 128 although we may have to bump it further
>   if there is demand in the future.
>   
>   Reference:
>   
>   http://www.illumos.org/issues/2558
>   
> http://dtrace.org/blogs/dap/2012/01/50/where-does-your-node-program-spend-its-time/
> 

The correct URL is this:

http://dtrace.org/blogs/dap/2012/01/05/where-does-your-node-program-spend-its-time/

This change won't make it into FreeBSD 9.1 but the blog
claims that ustack helpers are broken in FreeBSD so it
will not be missed(?).

Pedro.

___
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: r237819 - in head/sys: dev/cxgbe modules/cxgbe/if_cxgbe

2012-06-29 Thread Navdeep Parhar
Author: np
Date: Fri Jun 29 19:51:06 2012
New Revision: 237819
URL: http://svn.freebsd.org/changeset/base/237819

Log:
  cxgbe(4): support for IPv6 TSO and LRO.
  
  Submitted by: bz (this is a modified version of that patch)

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_l2t.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/modules/cxgbe/if_cxgbe/Makefile

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hFri Jun 29 19:05:29 2012
(r237818)
+++ head/sys/dev/cxgbe/adapter.hFri Jun 29 19:51:06 2012
(r237819)
@@ -392,7 +392,7 @@ struct sge_txq {
/* stats for common events first */
 
uint64_t txcsum;/* # of times hardware assisted with checksum */
-   uint64_t tso_wrs;   /* # of IPv4 TSO work requests */
+   uint64_t tso_wrs;   /* # of TSO work requests */
uint64_t vlan_insertion;/* # of times VLAN tag was inserted */
uint64_t imm_wrs;   /* # of work requests with immediate data */
uint64_t sgl_wrs;   /* # of work requests with direct SGL */
@@ -412,7 +412,7 @@ struct sge_rxq {
struct sge_fl fl;   /* MUST follow iq */
 
struct ifnet *ifp;  /* the interface this rxq belongs to */
-#ifdef INET
+#if defined(INET) || defined(INET6)
struct lro_ctrl lro;/* LRO state */
 #endif
 

Modified: head/sys/dev/cxgbe/t4_l2t.c
==
--- head/sys/dev/cxgbe/t4_l2t.c Fri Jun 29 19:05:29 2012(r237818)
+++ head/sys/dev/cxgbe/t4_l2t.c Fri Jun 29 19:51:06 2012(r237819)
@@ -27,6 +27,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include 
 #include 

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Jun 29 19:05:29 2012
(r237818)
+++ head/sys/dev/cxgbe/t4_main.cFri Jun 29 19:51:06 2012
(r237819)
@@ -29,6 +29,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include 
 #include 
@@ -823,7 +824,7 @@ cxgbe_probe(device_t dev)
 #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
 IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6)
-#define T4_CAP_ENABLE (T4_CAP & ~IFCAP_TSO6)
+#define T4_CAP_ENABLE (T4_CAP)
 
 static int
 cxgbe_attach(device_t dev)
@@ -1075,7 +1076,7 @@ fail:
ifp->if_capenable ^= IFCAP_TSO6;
}
if (mask & IFCAP_LRO) {
-#ifdef INET
+#if defined(INET) || defined(INET6)
int i;
struct sge_rxq *rxq;
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 19:05:29 2012(r237818)
+++ head/sys/dev/cxgbe/t4_sge.c Fri Jun 29 19:51:06 2012(r237819)
@@ -29,6 +29,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include 
 #include 
@@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "common/common.h"
@@ -908,7 +910,7 @@ service_iq(struct sge_iq *iq, int budget
STAILQ_INSERT_TAIL(&iql, q, link);
}
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
if (iq->flags & IQ_LRO_ENABLED) {
struct lro_ctrl *lro = &rxq->lro;
struct lro_entry *l;
@@ -1039,7 +1041,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
struct sge_rxq *rxq = iq_to_rxq(iq);
struct ifnet *ifp = rxq->ifp;
const struct cpl_rx_pkt *cpl = (const void *)(rss + 1);
-#ifdef INET
+#if defined(INET) || defined(INET6)
struct lro_ctrl *lro = &rxq->lro;
 #endif
 
@@ -1079,7 +1081,7 @@ t4_eth_rx(struct sge_iq *iq, const struc
rxq->vlan_extraction++;
}
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
if (cpl->l2info & htobe32(F_RXF_LRO) &&
iq->flags & IQ_LRO_ENABLED &&
tcp_lro_rx(lro, m0, 0) == 0) {
@@ -1805,7 +1807,7 @@ alloc_rxq(struct port_info *pi, struct s
refill_fl(pi->adapter, &rxq->fl, rxq->fl.needed / 8);
FL_UNLOCK(&rxq->fl);
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
rc = tcp_lro_init(&rxq->lro);
if (rc != 0)
return (rc);
@@ -1832,7 +1834,7 @@ alloc_rxq(struct port_info *pi, struct s
SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "cidx",
CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.cidx, 0, sysctl_uint16, "I",
"consumer index");
-#ifdef INET
+#if defined(INET) || defined(INET6)
SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD,
&rxq->lro.lro_queued, 0, NULL

svn commit: r237820 - head/sys/geom

2012-06-29 Thread Brooks Davis
Author: brooks
Date: Fri Jun 29 20:15:00 2012
New Revision: 237820
URL: http://svn.freebsd.org/changeset/base/237820

Log:
  MFP4 #212266
  
  Fix compile on MIPS64.
  
  Sponsored by: DARPA, AFRL

Modified:
  head/sys/geom/geom_map.c

Modified: head/sys/geom/geom_map.c
==
--- head/sys/geom/geom_map.cFri Jun 29 19:51:06 2012(r237819)
+++ head/sys/geom/geom_map.cFri Jun 29 20:15:00 2012(r237820)
@@ -119,13 +119,13 @@ g_map_dumpconf(struct sbuf *sb, const ch
g_slice_dumpconf(sb, indent, gp, cp, pp);
if (pp != NULL) {
if (indent == NULL) {
-   sbuf_printf(sb, " entry %lld", sc->entry[pp->index]);
-   sbuf_printf(sb, " dsize %lld", sc->dsize[pp->index]);
+   sbuf_printf(sb, " entry %jd", 
(intmax_t)sc->entry[pp->index]);
+   sbuf_printf(sb, " dsize %jd", 
(intmax_t)sc->dsize[pp->index]);
} else {
-   sbuf_printf(sb, "%s%lld\n", indent,
-   sc->entry[pp->index]);
-   sbuf_printf(sb, "%s%lld\n", indent,
-   sc->dsize[pp->index]);
+   sbuf_printf(sb, "%s%jd\n", indent,
+   (intmax_t)sc->entry[pp->index]);
+   sbuf_printf(sb, "%s%jd\n", indent,
+   (intmax_t)sc->dsize[pp->index]);
}
}
 }
@@ -153,8 +153,8 @@ find_marker(struct g_consumer *cp, const
return (1);
 
if (bootverbose) {
-   printf("MAP: search key \"%s\" from 0x%llx, step 0x%llx\n",
-   search_key, search_start, search_step);
+   printf("MAP: search key \"%s\" from 0x%jx, step 0x%jx\n",
+   search_key, (intmax_t)search_start, (intmax_t)search_step);
}
 
/* error if search_key is empty */
@@ -321,9 +321,10 @@ g_map_parse_part(struct g_class *mp, str
}
 
if (bootverbose) {
-   printf("MAP: %llxx%llx, data=%llxx%llx "
+   printf("MAP: %lxx%lx, data=%lxx%lx "
"\"/dev/map/%s\"\n",
-   start, size, offset, dsize, name);
+   (intmax_t)start, (intmax_t)size, (intmax_t)offset,
+   (intmax_t)dsize, name);
}
 
sc->offset[i] = start;
___
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: r237830 - head/tools/tools/ath/common

2012-06-29 Thread Adrian Chadd
Author: adrian
Date: Sat Jun 30 01:40:29 2012
New Revision: 237830
URL: http://svn.freebsd.org/changeset/base/237830

Log:
  Bump this up - that way the AR9300 and later MACs get covered (for now)
  by the AR5416 register map.

Modified:
  head/tools/tools/ath/common/dumpregs_5416.c

Modified: head/tools/tools/ath/common/dumpregs_5416.c
==
--- head/tools/tools/ath/common/dumpregs_5416.c Sat Jun 30 00:12:29 2012
(r237829)
+++ head/tools/tools/ath/common/dumpregs_5416.c Sat Jun 30 01:40:29 2012
(r237830)
@@ -39,7 +39,7 @@
 
 #defineN(a)(sizeof(a) / sizeof(a[0]))
 
-#defineMAC5416 SREV(13,8), SREV(0xff,0xff) /* XXX */
+#defineMAC5416 SREV(13,8), SREV(0x,0x) /* XXX */
 
 static struct dumpreg ar5416regs[] = {
 DEFBASIC(AR_CR,"CR"),
___
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: r237831 - head/sys/dev/cxgbe

2012-06-29 Thread Navdeep Parhar
Author: np
Date: Sat Jun 30 02:05:09 2012
New Revision: 237831
URL: http://svn.freebsd.org/changeset/base/237831

Log:
  - Assign (don't OR) the CSUM_XXX bits to csum_flags in the rx checksum code.
  - Fix TSO/TSO4 mixup.
  - Add IFCAP_LINKSTATE to the available/enabled capabilities.

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cSat Jun 30 01:40:29 2012
(r237830)
+++ head/sys/dev/cxgbe/t4_main.cSat Jun 30 02:05:09 2012
(r237831)
@@ -823,7 +823,7 @@ cxgbe_probe(device_t dev)
 
 #define T4_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
-IFCAP_VLAN_HWTSO | IFCAP_HWCSUM_IPV6)
+IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6)
 #define T4_CAP_ENABLE (T4_CAP)
 
 static int
@@ -1028,11 +1028,11 @@ fail:
ifp->if_capenable ^= IFCAP_TXCSUM;
ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP);
 
-   if (IFCAP_TSO & ifp->if_capenable &&
+   if (IFCAP_TSO4 & ifp->if_capenable &&
!(IFCAP_TXCSUM & ifp->if_capenable)) {
ifp->if_capenable &= ~IFCAP_TSO4;
if_printf(ifp,
-   "tso disabled due to -txcsum.\n");
+   "tso4 disabled due to -txcsum.\n");
}
}
if (mask & IFCAP_TXCSUM_IPV6) {

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Sat Jun 30 01:40:29 2012(r237830)
+++ head/sys/dev/cxgbe/t4_sge.c Sat Jun 30 02:05:09 2012(r237831)
@@ -1059,12 +1059,12 @@ t4_eth_rx(struct sge_iq *iq, const struc
if (cpl->csum_calc && !cpl->err_vec) {
if (ifp->if_capenable & IFCAP_RXCSUM &&
cpl->l2info & htobe32(F_RXF_IP)) {
-   m0->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED |
+   m0->m_pkthdr.csum_flags = (CSUM_IP_CHECKED |
CSUM_IP_VALID | CSUM_DATA_VALID | CSUM_PSEUDO_HDR);
rxq->rxcsum++;
} else if (ifp->if_capenable & IFCAP_RXCSUM_IPV6 &&
cpl->l2info & htobe32(F_RXF_IP6)) {
-   m0->m_pkthdr.csum_flags |= (CSUM_DATA_VALID_IPV6 |
+   m0->m_pkthdr.csum_flags = (CSUM_DATA_VALID_IPV6 |
CSUM_PSEUDO_HDR);
rxq->rxcsum++;
}
___
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: r237832 - head/sys/dev/cxgb

2012-06-29 Thread Navdeep Parhar
Author: np
Date: Sat Jun 30 02:11:53 2012
New Revision: 237832
URL: http://svn.freebsd.org/changeset/base/237832

Log:
  cxgb(4): IPv6 rx/tx hw checksum, IPv6 TSO and LRO too.
  
  (Some parts already worked, this makes it complete).

Modified:
  head/sys/dev/cxgb/cxgb_adapter.h
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_adapter.h
==
--- head/sys/dev/cxgb/cxgb_adapter.hSat Jun 30 02:05:09 2012
(r237831)
+++ head/sys/dev/cxgb/cxgb_adapter.hSat Jun 30 02:11:53 2012
(r237832)
@@ -265,15 +265,6 @@ struct sge_txq {
struct sg_ent  txq_sgl[TX_MAX_SEGS / 2 + 1];
 };

-
-enum {
-   SGE_PSTAT_TSO,  /* # of TSO requests */
-   SGE_PSTAT_RX_CSUM_GOOD, /* # of successful RX csum offloads */
-   SGE_PSTAT_TX_CSUM,  /* # of TX checksum offloads */
-   SGE_PSTAT_VLANEX,   /* # of VLAN tag extractions */
-   SGE_PSTAT_VLANINS,  /* # of VLAN tag insertions */
-};
-
 #define SGE_PSTAT_MAX (SGE_PSTAT_VLANINS+1)
 
 #define QS_EXITING  0x1
@@ -288,7 +279,6 @@ struct sge_qset {
struct lro_statelro;
struct sge_txq  txq[SGE_TXQ_PER_SET];
uint32_ttxq_stopped;   /* which Tx queues are 
stopped */
-   uint64_tport_stats[SGE_PSTAT_MAX];
struct port_info*port;
struct adapter  *adap;
int idx; /* qset # */
@@ -538,7 +528,7 @@ int t3_sge_reset_adapter(adapter_t *);
 int t3_sge_init_port(struct port_info *);
 void t3_free_tx_desc(struct sge_qset *qs, int n, int qid);
 
-void t3_rx_eth(struct adapter *adap, struct sge_rspq *rq, struct mbuf *m, int 
ethpad);
+void t3_rx_eth(struct adapter *adap, struct mbuf *m, int ethpad);
 
 void t3_add_attach_sysctls(adapter_t *sc);
 void t3_add_configured_sysctls(adapter_t *sc);

Modified: head/sys/dev/cxgb/cxgb_main.c
==
--- head/sys/dev/cxgb/cxgb_main.c   Sat Jun 30 02:05:09 2012
(r237831)
+++ head/sys/dev/cxgb/cxgb_main.c   Sat Jun 30 02:11:53 2012
(r237832)
@@ -986,7 +986,7 @@ cxgb_makedev(struct port_info *pi)
 
 #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \
 IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \
-IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE)
+IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWCSUM_IPV6)
 #define CXGB_CAP_ENABLE CXGB_CAP
 
 static int
@@ -1027,7 +1027,8 @@ cxgb_port_attach(device_t dev)
ifp->if_capabilities |= IFCAP_TOE4;
 #endif
ifp->if_capenable = CXGB_CAP_ENABLE;
-   ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO;
+   ifp->if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_IP | CSUM_TSO |
+   CSUM_UDP_IPV6 | CSUM_TCP_IPV6;
 
/*
 * Disable TSO on 4-port - it isn't supported by the firmware.
@@ -1950,31 +1951,52 @@ fail:
ifp->if_capenable ^= IFCAP_TXCSUM;
ifp->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP);
 
-   if (IFCAP_TSO & ifp->if_capenable &&
+   if (IFCAP_TSO4 & ifp->if_capenable &&
!(IFCAP_TXCSUM & ifp->if_capenable)) {
-   ifp->if_capenable &= ~IFCAP_TSO;
-   ifp->if_hwassist &= ~CSUM_TSO;
+   ifp->if_capenable &= ~IFCAP_TSO4;
if_printf(ifp,
-   "tso disabled due to -txcsum.\n");
+   "tso4 disabled due to -txcsum.\n");
+   }
+   }
+   if (mask & IFCAP_TXCSUM_IPV6) {
+   ifp->if_capenable ^= IFCAP_TXCSUM_IPV6;
+   ifp->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6);
+
+   if (IFCAP_TSO6 & ifp->if_capenable &&
+   !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
+   ifp->if_capenable &= ~IFCAP_TSO6;
+   if_printf(ifp,
+   "tso6 disabled due to -txcsum6.\n");
}
}
if (mask & IFCAP_RXCSUM)
ifp->if_capenable ^= IFCAP_RXCSUM;
-   if (mask & IFCAP_TSO) {
-   ifp->if_capenable ^= IFCAP_TSO;
+   if (mask & IFCAP_RXCSUM_IPV6)
+   ifp->if_capenable ^= IFCAP_RXCSUM_IPV6;
 
-   if (IFCAP_TSO & ifp->if_capenable) {
-   if (IFCAP_TXCSUM & ifp->if_capenable)
-   ifp->if_hwassist |= CSUM_TSO;
-   else {
-   ifp->if_capenable 

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

2012-06-29 Thread Garrett Cooper
Sent from my iPhone

On Jun 29, 2012, at 1:15 PM, Brooks Davis  wrote:

> Author: brooks
> Date: Fri Jun 29 20:15:00 2012
> New Revision: 237820
> URL: http://svn.freebsd.org/changeset/base/237820
> 
> Log:
>  MFP4 #212266
> 
>  Fix compile on MIPS64.
> 
>  Sponsored by:DARPA, AFRL

This commit appears to have broken arm (ETHERNUT5).
Thanks,
-Garrett
___
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: r237820 - head/sys/geom

2012-06-29 Thread Bruce Evans

On Fri, 29 Jun 2012, Brooks Davis wrote:


Log:
 MFP4 #212266

 Fix compile on MIPS64.

 Sponsored by:  DARPA, AFRL

Modified:
 head/sys/geom/geom_map.c

Modified: head/sys/geom/geom_map.c
==
--- head/sys/geom/geom_map.cFri Jun 29 19:51:06 2012(r237819)
+++ head/sys/geom/geom_map.cFri Jun 29 20:15:00 2012(r237820)
@@ -119,13 +119,13 @@ g_map_dumpconf(struct sbuf *sb, const ch
g_slice_dumpconf(sb, indent, gp, cp, pp);
if (pp != NULL) {
if (indent == NULL) {
-   sbuf_printf(sb, " entry %lld", sc->entry[pp->index]);
-   sbuf_printf(sb, " dsize %lld", sc->dsize[pp->index]);
+   sbuf_printf(sb, " entry %jd", 
(intmax_t)sc->entry[pp->index]);
+   sbuf_printf(sb, " dsize %jd", 
(intmax_t)sc->dsize[pp->index]);


Style bugs (lines too long).


@@ -153,8 +153,8 @@ find_marker(struct g_consumer *cp, const
return (1);

if (bootverbose) {
-   printf("MAP: search key \"%s\" from 0x%llx, step 0x%llx\n",
-   search_key, search_start, search_step);
+   printf("MAP: search key \"%s\" from 0x%jx, step 0x%jx\n",
+   search_key, (intmax_t)search_start, (intmax_t)search_step);
}


Still has sign mismatches.  %jx takes a uintmax_t arg, but an intmax_t arg
is passed.  The variables start as signed (off_t).  Printing signed values
using hex formats is dubious, but if it is wanted then the conversion
should be done when the parameter is passed instead of depending on
printf() doing something reasonable.



/* error if search_key is empty */
@@ -321,9 +321,10 @@ g_map_parse_part(struct g_class *mp, str
}

if (bootverbose) {
-   printf("MAP: %llxx%llx, data=%llxx%llx "
+   printf("MAP: %lxx%lx, data=%lxx%lx "
"\"/dev/map/%s\"\n",
-   start, size, offset, dsize, name);
+   (intmax_t)start, (intmax_t)size, (intmax_t)offset,
+   (intmax_t)dsize, name);


Still has fatal type mimatches which are larger than before:
- before: the format said  but the default promotion
  of off_t was passed.  Everything was 64 bits in practice, so there
  was no problem at runtime except possibly with the sign mismatch, but
  the static format checker complained
- after: the format says u_long, but intmax_t is passed.  Now the sizes
  are different on arches with 32 bit u_long, and the result is garbage.

Still has sign mismatches, as above.

As well as printf format errors, this still has the following format-printf
errors (formatting style bugs):
- source level: the string is still obfuscated using the C90 string
  concatenation misfeature to split it across multiple lines.  The string
  is not even long enough to not fit on 1 line.
- output level: %lxx%lx is still a weird format.  It consists of 2 hex
  numbers without any 0x prefixes to indicate that they are in hex.
  But there is an "x" with no spaces between the numbers.  This apparently
  means multiplication, but it looks like part of a 0x prefix.

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