svn commit: r219896 - stable/8/sys/boot/i386/common

2011-03-23 Thread Andrey V. Elsukov
Author: ae
Date: Wed Mar 23 06:19:17 2011
New Revision: 219896
URL: http://svn.freebsd.org/changeset/base/219896

Log:
  MFC r219702:
Set control flags in putc(). This should fix zfsboot hangs in drvread().
  
PR: kern/153552
Reviewed by:jhb

Modified:
  stable/8/sys/boot/i386/common/cons.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/boot/i386/common/cons.c
==
--- stable/8/sys/boot/i386/common/cons.cWed Mar 23 05:13:54 2011
(r219895)
+++ stable/8/sys/boot/i386/common/cons.cWed Mar 23 06:19:17 2011
(r219896)
@@ -37,6 +37,7 @@ void
 putc(int c)
 {
 
+   v86.ctl = V86_FLAGS;
v86.addr = 0x10;
v86.eax = 0xe00 | (c  0xff);
v86.ebx = 0x7;
___
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: r219898 - head/sys/modules

2011-03-23 Thread Jeff Roberson
Author: jeff
Date: Wed Mar 23 08:27:57 2011
New Revision: 219898
URL: http://svn.freebsd.org/changeset/base/219898

Log:
   - Move ofed modules into the i386 and amd64 specific sections to fix
 universe on other architectures.

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Wed Mar 23 06:31:45 2011(r219897)
+++ head/sys/modules/Makefile   Wed Mar 23 08:27:57 2011(r219898)
@@ -418,6 +418,12 @@ _linprocfs=linprocfs
 _linsysfs= linsysfs
 _linux=linux
 _mse=  mse
+.if ${MK_OFED} != no || defined(ALL_MODULES)
+_mlx4= mlx4
+_mlx4ib=   mlx4ib
+_mlxen=mlxen
+_mthca=mthca
+.endif
 .if ${MK_NCP} != no
 _ncp=  ncp
 .endif
@@ -566,6 +572,12 @@ _linprocfs=linprocfs
 _linsysfs= linsysfs
 _linux=linux
 _mly=  mly
+.if ${MK_OFED} != no || defined(ALL_MODULES)
+_mlx4= mlx4
+_mlx4ib=   mlx4ib
+_mlxen=mlxen
+_mthca=mthca
+.endif
 _ndis= ndis
 _nfe=  nfe
 _nve=  nve
@@ -673,13 +685,6 @@ _zfs=  zfs
 .endif
 .endif
 
-.if ${MK_OFED} != no || defined(ALL_MODULES)
-_mthca=mthca
-_mlx4= mlx4
-_mlx4ib=   mlx4ib
-_mlxen=mlxen
-.endif
-
 .if defined(MODULES_OVERRIDE)  !defined(ALL_MODULES)
 SUBDIR=${MODULES_OVERRIDE}
 .endif
@@ -697,6 +702,5 @@ afterinstall:
kldxref ${DESTDIR}${KMODDIR}; \
fi
 .endif
-#endif
 
 .include bsd.subdir.mk
___
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: r219899 - head/sbin/dumpfs

2011-03-23 Thread Juli Mallett
Author: jmallett
Date: Wed Mar 23 08:33:12 2011
New Revision: 219899
URL: http://svn.freebsd.org/changeset/base/219899

Log:
  Add support for displaying newfs flags for SU+J and TRIM.

Modified:
  head/sbin/dumpfs/dumpfs.c

Modified: head/sbin/dumpfs/dumpfs.c
==
--- head/sbin/dumpfs/dumpfs.c   Wed Mar 23 08:27:57 2011(r219898)
+++ head/sbin/dumpfs/dumpfs.c   Wed Mar 23 08:33:12 2011(r219899)
@@ -402,7 +402,9 @@ marshal(const char *name)
printf(-g %d , fs-fs_avgfilesize);
printf(-h %d , fs-fs_avgfpdir);
/* -i is dumb */
-   /* -j..l unimplemented */
+   if (fs-fs_flags  FS_SUJ)
+   printf(-j );
+   /* -k..l unimplemented */
printf(-m %d , fs-fs_minfree);
/* -n unimplemented */
printf(-o );
@@ -419,6 +421,8 @@ marshal(const char *name)
}
/* -p..r unimplemented */
printf(-s %jd , (intmax_t)fsbtodb(fs, fs-fs_size));
+   if (fs-fs_flags  FS_TRIM)
+   printf(-t );
printf(%s , disk.d_name);
printf(\n);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r219900 - head/sbin/hastd

2011-03-23 Thread Pawel Jakub Dawidek
Author: pjd
Date: Wed Mar 23 11:09:04 2011
New Revision: 219900
URL: http://svn.freebsd.org/changeset/base/219900

Log:
  Don't create socketpair for connection forwarding between parent and 
secondary.
  Secondary doesn't need to connect anywhere.
  
  MFC after:1 week

Modified:
  head/sbin/hastd/hastd.c
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/hastd.c
==
--- head/sbin/hastd/hastd.c Wed Mar 23 08:33:12 2011(r219899)
+++ head/sbin/hastd/hastd.c Wed Mar 23 11:09:04 2011(r219900)
@@ -224,7 +224,8 @@ descriptors_assert(const struct hast_res
fd, dtype2str(mode), dtype2str(S_IFSOCK));
break;
}
-   } else if (fd == proto_descriptor(res-hr_conn)) {
+   } else if (res-hr_role == HAST_ROLE_PRIMARY 
+   fd == proto_descriptor(res-hr_conn)) {
if (!isopen) {
(void)snprintf(msg, sizeof(msg),
Descriptor %d (conn) is closed, but should 
be open.,
@@ -238,6 +239,15 @@ descriptors_assert(const struct hast_res
break;
}
} else if (res-hr_role == HAST_ROLE_SECONDARY 
+   res-hr_conn != NULL 
+   fd == proto_descriptor(res-hr_conn)) {
+   if (isopen) {
+   (void)snprintf(msg, sizeof(msg),
+   Descriptor %d (conn) is open, but should 
be closed.,
+   fd);
+   break;
+   }
+   } else if (res-hr_role == HAST_ROLE_SECONDARY 
fd == proto_descriptor(res-hr_remotein)) {
if (!isopen) {
(void)snprintf(msg, sizeof(msg),
@@ -851,6 +861,8 @@ connection_migrate(struct hast_resource 
 
pjdlog_prefix_set([%s] (%s) , res-hr_name, role2str(res-hr_role));
 
+   PJDLOG_ASSERT(res-hr_role == HAST_ROLE_PRIMARY);
+
if (proto_recv(res-hr_conn, val, sizeof(val))  0) {
pjdlog_errno(LOG_WARNING,
Unable to receive connection command);
@@ -951,17 +963,19 @@ main_loop(void)
TAILQ_FOREACH(res, cfg-hc_resources, hr_next) {
if (res-hr_event == NULL)
continue;
-   PJDLOG_ASSERT(res-hr_conn != NULL);
fd = proto_descriptor(res-hr_event);
PJDLOG_ASSERT(fd = 0);
FD_SET(fd, rfds);
maxfd = fd  maxfd ? fd : maxfd;
if (res-hr_role == HAST_ROLE_PRIMARY) {
/* Only primary workers asks for connections. */
+   PJDLOG_ASSERT(res-hr_conn != NULL);
fd = proto_descriptor(res-hr_conn);
PJDLOG_ASSERT(fd = 0);
FD_SET(fd, rfds);
maxfd = fd  maxfd ? fd : maxfd;
+   } else {
+   PJDLOG_ASSERT(res-hr_conn == NULL);
}
}
 
@@ -998,20 +1012,26 @@ main_loop(void)
TAILQ_FOREACH(res, cfg-hc_resources, hr_next) {
if (res-hr_event == NULL)
continue;
-   PJDLOG_ASSERT(res-hr_conn != NULL);
if (FD_ISSET(proto_descriptor(res-hr_event), rfds)) {
if (event_recv(res) == 0)
continue;
/* The worker process exited? */
proto_close(res-hr_event);
res-hr_event = NULL;
-   proto_close(res-hr_conn);
-   res-hr_conn = NULL;
+   if (res-hr_conn != NULL) {
+   proto_close(res-hr_conn);
+   res-hr_conn = NULL;
+   }
continue;
}
-   if (res-hr_role == HAST_ROLE_PRIMARY 
-   FD_ISSET(proto_descriptor(res-hr_conn), rfds)) {
-   connection_migrate(res);
+   if (res-hr_role == HAST_ROLE_PRIMARY) {
+   PJDLOG_ASSERT(res-hr_conn != NULL);
+   if (FD_ISSET(proto_descriptor(res-hr_conn),
+   rfds)) {
+   connection_migrate(res);
+   }
+  

svn commit: r219901 - head/tools/tools/ath/ath_ee_v14_print

2011-03-23 Thread Adrian Chadd
Author: adrian
Date: Wed Mar 23 11:16:06 2011
New Revision: 219901
URL: http://svn.freebsd.org/changeset/base/219901

Log:
  Oops, fix badness i must've introduced earlier.

Modified:
  head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c

Modified: head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.c
==
--- head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.cWed Mar 23 
11:09:04 2011(r219900)
+++ head/tools/tools/ath/ath_ee_v14_print/ath_ee_v14_print.cWed Mar 23 
11:16:06 2011(r219901)
@@ -146,12 +146,12 @@ eeprom_v14_modal_print(uint16_t *buf, in
MODAL_EEP_HEADER *mh = eep-ee_base.modalHeader[m];
int i;
 
-   printf(| antCtrlCommon: 0x%.4x |\n, mh-antCtrlCommon);
+   printf(| antCtrlCommon: 0x%.8x |\n, mh-antCtrlCommon);
printf(| switchSettling: 0x%.2x |\n, mh-switchSettling);
printf(| adcDesiredSize: %d |\n| pgaDesiredSize: %.2f dBm |\n,
mh-adcDesiredSize, (float) mh-pgaDesiredSize / 2.0);
 
-   printf(| antCtrlChain:0:0x%.4x 1:0x%.4x 2:0x%.4x |\n,
+   printf(| antCtrlChain:0:0x%.8x 1:0x%.8x 2:0x%.8x |\n,
mh-antCtrlChain[0], mh-antCtrlChain[1], mh-antCtrlChain[2]);
printf(| antennaGainCh:   0:0x%.2x   1:0x%.2x   2:0x%.2x   |\n,
mh-antennaGainCh[0], mh-antennaGainCh[1], mh-antennaGainCh[2]);
@@ -288,9 +288,9 @@ eeprom_v14_calfreqpiers_print(uint16_t *
for (n = 0; n  AR5416_MAX_CHAINS; n++) {
printf(  Chain %d:\n, n);
if (eep-ee_base.baseEepHeader.openLoopPwrCntl)
-   eeprom_v14_print_caldata_perfreq_op_loop((void 
*) (eep-ee_base.calPierData2G[n][i]));
+   eeprom_v14_print_caldata_perfreq_op_loop((void 
*) (eep-ee_base.calPierData5G[n][i]));
else
-   
eeprom_v14_print_caldata_perfreq(eep-ee_base.calPierData2G[n][i]);
+   
eeprom_v14_print_caldata_perfreq(eep-ee_base.calPierData5G[n][i]);
}
}
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r219902 - in head/sys: dev/ae dev/age dev/agp dev/aic7xxx dev/alc dev/ale dev/bce dev/bge dev/bwn dev/bxe dev/cxgb dev/drm dev/e1000 dev/et dev/fxp dev/iwn dev/ixgbe dev/jme dev/malo de...

2011-03-23 Thread John Baldwin
Author: jhb
Date: Wed Mar 23 13:10:15 2011
New Revision: 219902
URL: http://svn.freebsd.org/changeset/base/219902

Log:
  Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
  pci_find_cap() instead.

Modified:
  head/sys/dev/ae/if_ae.c
  head/sys/dev/age/if_age.c
  head/sys/dev/agp/agp.c
  head/sys/dev/aic7xxx/aic79xx_pci.c
  head/sys/dev/alc/if_alc.c
  head/sys/dev/ale/if_ale.c
  head/sys/dev/bce/if_bce.c
  head/sys/dev/bge/if_bge.c
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/cxgb/cxgb_main.c
  head/sys/dev/drm/drm_agpsupport.c
  head/sys/dev/e1000/e1000_osdep.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/et/if_et.c
  head/sys/dev/fxp/if_fxp.c
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/ixgbe/ixv.c
  head/sys/dev/jme/if_jme.c
  head/sys/dev/malo/if_malo_pci.c
  head/sys/dev/msk/if_msk.c
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/nfe/if_nfe.c
  head/sys/dev/nge/if_nge.c
  head/sys/dev/pci/hostb_pci.c
  head/sys/dev/re/if_re.c
  head/sys/dev/siba/siba_core.c
  head/sys/dev/sis/if_sis.c
  head/sys/dev/ste/if_ste.c
  head/sys/dev/txp/if_txp.c
  head/sys/dev/vge/if_vge.c
  head/sys/dev/vr/if_vr.c
  head/sys/dev/xl/if_xl.c
  head/sys/ofed/include/linux/pci.h
  head/sys/pci/if_rl.c

Modified: head/sys/dev/ae/if_ae.c
==
--- head/sys/dev/ae/if_ae.c Wed Mar 23 11:16:06 2011(r219901)
+++ head/sys/dev/ae/if_ae.c Wed Mar 23 13:10:15 2011(r219902)
@@ -341,7 +341,7 @@ ae_attach(device_t dev)
ifp-if_snd.ifq_drv_maxlen = ifqmaxlen;
IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
IFQ_SET_READY(ifp-if_snd);
-   if (pci_find_extcap(dev, PCIY_PMG, pmc) == 0) {
+   if (pci_find_cap(dev, PCIY_PMG, pmc) == 0) {
ifp-if_capabilities |= IFCAP_WOL_MAGIC;
sc-flags |= AE_FLAG_PMG;
}
@@ -929,7 +929,7 @@ ae_check_eeprom_present(ae_softc_t *sc, 
val = ~AE_SPICTL_VPD_EN;
AE_WRITE_4(sc, AE_SPICTL_REG, val);
}
-   error = pci_find_extcap(sc-dev, PCIY_VPD, vpdc);
+   error = pci_find_cap(sc-dev, PCIY_VPD, vpdc);
return (error);
 }
 
@@ -1383,7 +1383,7 @@ ae_pm_init(ae_softc_t *sc)
/*
 * Configure PME.
 */
-   pci_find_extcap(sc-dev, PCIY_PMG, pmc);
+   pci_find_cap(sc-dev, PCIY_PMG, pmc);
pmstat = pci_read_config(sc-dev, pmc + PCIR_POWER_STATUS, 2);
pmstat = ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE);
if ((ifp-if_capenable  IFCAP_WOL) != 0)

Modified: head/sys/dev/age/if_age.c
==
--- head/sys/dev/age/if_age.c   Wed Mar 23 11:16:06 2011(r219901)
+++ head/sys/dev/age/if_age.c   Wed Mar 23 13:10:15 2011(r219902)
@@ -346,7 +346,7 @@ age_get_macaddr(struct age_softc *sc)
CSR_WRITE_4(sc, AGE_SPI_CTRL, reg);
}
 
-   if (pci_find_extcap(sc-age_dev, PCIY_VPD, vpdc) == 0) {
+   if (pci_find_cap(sc-age_dev, PCIY_VPD, vpdc) == 0) {
/*
 * PCI VPD capability found, let TWSI reload EEPROM.
 * This will set ethernet address of controller.
@@ -563,7 +563,7 @@ age_attach(device_t dev)
 
 
/* Get DMA parameters from PCIe device control register. */
-   if (pci_find_extcap(dev, PCIY_EXPRESS, i) == 0) {
+   if (pci_find_cap(dev, PCIY_EXPRESS, i) == 0) {
sc-age_flags |= AGE_FLAG_PCIE;
burst = pci_read_config(dev, i + 0x08, 2);
/* Max read request size. */
@@ -610,7 +610,7 @@ age_attach(device_t dev)
IFQ_SET_READY(ifp-if_snd);
ifp-if_capabilities = IFCAP_HWCSUM | IFCAP_TSO4;
ifp-if_hwassist = AGE_CSUM_FEATURES | CSUM_TSO;
-   if (pci_find_extcap(dev, PCIY_PMG, pmc) == 0) {
+   if (pci_find_cap(dev, PCIY_PMG, pmc) == 0) {
sc-age_flags |= AGE_FLAG_PMCAP;
ifp-if_capabilities |= IFCAP_WOL_MAGIC | IFCAP_WOL_MCAST;
}
@@ -1329,7 +1329,7 @@ age_setwol(struct age_softc *sc)
 
AGE_LOCK_ASSERT(sc);
 
-   if (pci_find_extcap(sc-age_dev, PCIY_PMG, pmc) != 0) {
+   if (pci_find_cap(sc-age_dev, PCIY_PMG, pmc) != 0) {
CSR_WRITE_4(sc, AGE_WOL_CFG, 0);
/*
 * No PME capability, PHY power down.

Modified: head/sys/dev/agp/agp.c
==
--- head/sys/dev/agp/agp.c  Wed Mar 23 11:16:06 2011(r219901)
+++ head/sys/dev/agp/agp.c  Wed Mar 23 13:10:15 2011(r219902)
@@ -98,7 +98,7 @@ agp_find_caps(device_t dev)
int capreg;
 
 
-   if (pci_find_extcap(dev, PCIY_AGP, capreg) != 0)
+   if (pci_find_cap(dev, PCIY_AGP, capreg) != 0)
capreg = 0;
return (capreg);
 }

Modified: head/sys/dev/aic7xxx/aic79xx_pci.c

svn commit: r219903 - head/usr.sbin/bsdinstall/scripts

2011-03-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Mar 23 13:43:56 2011
New Revision: 219903
URL: http://svn.freebsd.org/changeset/base/219903

Log:
  Mark any distfiles with no checksum entries in the manifest Skipped
  instead of Passed.

Modified:
  head/usr.sbin/bsdinstall/scripts/checksum

Modified: head/usr.sbin/bsdinstall/scripts/checksum
==
--- head/usr.sbin/bsdinstall/scripts/checksum   Wed Mar 23 13:10:15 2011
(r219902)
+++ head/usr.sbin/bsdinstall/scripts/checksum   Wed Mar 23 13:43:56 2011
(r219903)
@@ -42,17 +42,23 @@ for dist in $DISTRIBUTIONS; do
0 0 $percentage $items
 
CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist`
-   awk -v checksum=$CK -v dist=$dist '{
+   awk -v checksum=$CK -v dist=$dist -v found=0 '{
if (dist == $1) {
+   found = 1
if (checksum == $2)
exit(0)
else
-   exit(1)
+   exit(2)
}
-   }' $BSDINSTALL_DISTDIR/MANIFEST
+   } END {if (!found) exit(1);}' $BSDINSTALL_DISTDIR/MANIFEST
 
-   if [ $? -eq 0 ]; then
-   eval status_$distname=2
+   CK_VALID=$?
+   if [ $CK_VALID -le 1 ]; then
+   if [ $CK_VALID -eq 0 ]; then
+   eval status_$distname=2
+   else
+   eval status_$distname=6
+   fi
percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc 
-w` | bc)
else
eval status_$distname=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: r219904 - head/sbin/mount_unionfs

2011-03-23 Thread Gleb Smirnoff
Author: glebius
Date: Wed Mar 23 13:44:09 2011
New Revision: 219904
URL: http://svn.freebsd.org/changeset/base/219904

Log:
  Fix SYNOPSIS.

Modified:
  head/sbin/mount_unionfs/mount_unionfs.8

Modified: head/sbin/mount_unionfs/mount_unionfs.8
==
--- head/sbin/mount_unionfs/mount_unionfs.8 Wed Mar 23 13:43:56 2011
(r219903)
+++ head/sbin/mount_unionfs/mount_unionfs.8 Wed Mar 23 13:44:09 2011
(r219904)
@@ -39,7 +39,7 @@
 .Nd mount union file systems
 .Sh SYNOPSIS
 .Nm
-.Op Fl br
+.Op Fl b
 .Op Fl o Ar options
 .Ar directory
 .Ar uniondir
___
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: r219905 - head/sys/kern

2011-03-23 Thread John Baldwin
Author: jhb
Date: Wed Mar 23 13:44:32 2011
New Revision: 219905
URL: http://svn.freebsd.org/changeset/base/219905

Log:
  Small style fix.

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==
--- head/sys/kern/kern_sig.cWed Mar 23 13:44:09 2011(r219904)
+++ head/sys/kern/kern_sig.cWed Mar 23 13:44:32 2011(r219905)
@@ -1632,7 +1632,7 @@ killpg1(struct thread *td, int sig, int 
LIST_FOREACH(p, pgrp-pg_members, p_pglist) {
PROC_LOCK(p); 
if (p-p_pid = 1 || p-p_flag  P_SYSTEM ||
-   p-p_state == PRS_NEW ) {
+   p-p_state == PRS_NEW) {
PROC_UNLOCK(p);
continue;
}
___
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: r219700 - head/sys/x86/x86

2011-03-23 Thread John Baldwin
On Thursday, March 17, 2011 5:06:09 pm Jung-uk Kim wrote:
 On Thursday 17 March 2011 04:01 pm, Peter Jeremy wrote:
  On 2011-Mar-16 16:44:08 +, Jung-uk Kim j...@freebsd.org wrote:
  Log:
Revert r219676.
 
  Thanks also.  For extra kudos, how about adding a similar function
  to allow the HPET frequency to be over-ridden.  That is currently
  the only timecounter that does not allow the user to compensate for
  incorrect hardware frequencies.
 
 I really hate the idea of adjusting timecounter frequency from 
 userland.  I guess use ntpd(8) is not a good answer for some 
 people. :-(

Actually, that doesn't work well if your timecounter frequency is off by a 
lot.  Having the timecounter frequency accurate improves the accuracy of 
things like ntpd and ptpd.

-- 
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: r219788 - head/release

2011-03-23 Thread John Baldwin
On Saturday, March 19, 2011 7:10:40 pm Garrett Cooper wrote:
 On Sat, Mar 19, 2011 at 4:06 PM, Nathan Whitehorn
 nwhiteh...@freebsd.org wrote:
  Author: nwhitehorn
  Date: Sat Mar 19 23:06:17 2011
  New Revision: 219788
  URL: http://svn.freebsd.org/changeset/base/219788
 
  Log:
   Add support for checking out ports and doc trees from a CVS repository,
   in addition to CVSUP, and add support for alternate SVN roots for src.
 
   Requested by: jhb
 
 Although this seems good and all, wouldn't it make sense to split off
 the pulling infrastructure into separate scripts so that someone could
 have hooks to do:
 
 - pre-pull (create paths, whatever)
 - pull
 - post-pull (patch?)
 
 That way someone could choose any arbitrary SCM (git, hg, etc),
 specify necessary configuration files, and apply local patches as
 necessary.

The old release(7) infrastructure did do that (see things like LOCAL_PATCHES, 
EXTSRCDIR, LOCAL_SCRIPTS, etc.).  However, we should definitely streamline the 
case for the tools that re@ will actually use for official releases (doc and 
ports from CVS, src from either CVS or SVN).

-- 
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: r219727 - head/sys/vm

2011-03-23 Thread John Baldwin
On Friday, March 18, 2011 4:40:34 am Julian Elischer wrote:
 On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote:
  Author: trasz
  Date: Fri Mar 18 06:47:23 2011
  New Revision: 219727
  URL: http://svn.freebsd.org/changeset/base/219727
 
  Log:
 In vm_daemon(), when iterating over all processes in the system, skip 
  those
 which are not yet fully initialized (i.e. ones with p_state == PRS_NEW).
 Without it, we could panic in _thread_lock_flags().
 
 Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() that
 require similar fix.
 
 In the past each process was only put on the process list after it was 
 fully set up.
 Did someone change that recently?  that would be A Bad Thing (TM).

Err, no, that has never been true.  The reason it has to go on the list
immediately is to reserve the PID against concurrent fork()s.

Hmm, the locking of prs_state is a bit busted it seems.  Both the PROC_LOCK()
and PROC_SLOCK() are supposed to be held when it is written to, but
PROC_LOCK() is missing in fork1() when moving the state to PRS_NORMAL.

Also, this commit should check against PRS_NORMAL after acquiring the proc
lock, not before.

Hmm, I did an audit of prs_state and there is lots of locking rot. :(  Below
is a set of fixes I will commit once it has been tested some:

Index: kern/kern_thread.c
===
--- kern/kern_thread.c  (revision 219902)
+++ kern/kern_thread.c  (working copy)
@@ -981,7 +981,9 @@
td = NULL;
break;
}
+   PROC_LOCK(td-td_proc);
if (td-td_proc-p_state == PRS_NEW) {
+   PROC_UNLOCK(td-td_proc);
td = NULL;
break;
}
@@ -990,12 +992,10 @@
LIST_REMOVE(td, td_hash);
LIST_INSERT_HEAD(TIDHASH(td-td_tid),
td, td_hash);
-   PROC_LOCK(td-td_proc);
rw_wunlock(tidhash_lock);
return (td);
}
}
-   PROC_LOCK(td-td_proc);
break;
}
run++;
Index: kern/kern_proc.c
===
--- kern/kern_proc.c(revision 219902)
+++ kern/kern_proc.c(working copy)
@@ -291,11 +291,11 @@
sx_slock(allproc_lock);
LIST_FOREACH(p, PIDHASH(pid), p_hash)
if (p-p_pid == pid) {
+   PROC_LOCK(p);
if (p-p_state == PRS_NEW) {
+   PROC_UNLOCK(p);
p = NULL;
-   break;
}
-   PROC_LOCK(p);
break;
}
sx_sunlock(allproc_lock);
@@ -756,7 +756,6 @@
kp-ki_sigcatch = ps-ps_sigcatch;
mtx_unlock(ps-ps_mtx);
}
-   PROC_SLOCK(p);
if (p-p_state != PRS_NEW 
p-p_state != PRS_ZOMBIE 
p-p_vmspace != NULL) {
@@ -782,12 +781,11 @@
kp-ki_swtime = (ticks - p-p_swtick) / hz;
kp-ki_pid = p-p_pid;
kp-ki_nice = p-p_nice;
-   rufetch(p, kp-ki_rusage);
-   kp-ki_runtime = cputick2usec(p-p_rux.rux_runtime);
-   PROC_SUNLOCK(p);
kp-ki_start = p-p_stats-p_start;
timevaladd(kp-ki_start, boottime);
PROC_SLOCK(p);
+   rufetch(p, kp-ki_rusage);
+   kp-ki_runtime = cputick2usec(p-p_rux.rux_runtime);
calcru(p, kp-ki_rusage.ru_utime, kp-ki_rusage.ru_stime);
PROC_SUNLOCK(p);
calccru(p, kp-ki_childutime, kp-ki_childstime);
@@ -1213,13 +1211,11 @@
/*
 * Skip embryonic processes.
 */
-   PROC_SLOCK(p);
+   PROC_LOCK(p);
if (p-p_state == PRS_NEW) {
-   PROC_SUNLOCK(p);
+   PROC_UNLOCK(p);
continue;
}
-   PROC_SUNLOCK(p);
-   PROC_LOCK(p);
KASSERT(p-p_ucred != NULL,
(process credential is NULL for non-NEW proc));
/*
Index: kern/kern_descrip.c
===
--- kern/kern_descrip.c (revision 219902)
+++ kern/kern_descrip.c (working copy)
@@ -2634,9 +2634,11 @@
xf.xf_size = sizeof(xf);
sx_slock(allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
-   if (p-p_state == 

svn commit: r219906 - head/sys/sys

2011-03-23 Thread John Baldwin
Author: jhb
Date: Wed Mar 23 13:46:17 2011
New Revision: 219906
URL: http://svn.freebsd.org/changeset/base/219906

Log:
  Update a comment.  The kernel stopped using the S* process state constants
  a long time ago.

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==
--- head/sys/sys/proc.h Wed Mar 23 13:44:32 2011(r219905)
+++ head/sys/sys/proc.h Wed Mar 23 13:46:17 2011(r219906)
@@ -487,7 +487,7 @@ struct proc {
PRS_NEW = 0,/* In creation */
PRS_NORMAL, /* threads can be run. */
PRS_ZOMBIE
-   } p_state;  /* (j/c) S* process status. */
+   } p_state;  /* (j/c) Process status. */
pid_t   p_pid;  /* (b) Process identifier. */
LIST_ENTRY(proc) p_hash;/* (d) Hash chain. */
LIST_ENTRY(proc) p_pglist;  /* (g + e) List of processes in pgrp. */
___
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: r219907 - in stable/8/usr.bin/calendar: . calendars calendars/ru_RU.KOI8-R

2011-03-23 Thread Sergey A. Osokin
Author: osa (ports committer)
Date: Wed Mar 23 14:18:59 2011
New Revision: 219907
URL: http://svn.freebsd.org/changeset/base/219907

Log:
  MFC r211819:
  
  Add one more new memory day for Russian Federation: the end of Second World
  War.
  
  MFC r212027:
  
  Add dim to calendar.freebsd.
  
  MFC r212218:
  
  Add swills to calendar.freebsd.
  
  MFC r212260:
  
  Add andreast to calendar.freebsd.
  
  MFC r212591:
  
  Remove extra ; from parse.c.
  
  MFC r213001:
  
  Add sunpoet to calendar.freebsd.
  
  MFC r213482:
  
  Add pluknet to calendar.freebsd.
  
  MFC r213990:
  
  Add culot to calendar.freebsd.
  
  MFC r214027:
  
  Fix spaces by a tab after the date, introduced in r213990.
  
  MFC r214973:
  
  A traditional (once per three years) sort by month/day/year/login.
  While here, fixed badly formatted lines.
  
  MFC r214974:
  
  Add/expand country/state.
  
  MFC r215096:
  
  Add zack to calendar.freebsd.
  
  MFC r215836:
  
  Pet make checkdpadd.
  
  MFC r216282:
  
  Add flo to calendar.freebsd.
  
  MFC r216895:
  
  Add jpaetzel to calendar.freebsd.
  
  MFC r219478:
  
  Add trociny to calendar.freebsd.
  
  MFC r219638:
  
  Add dchagin to calendar.freebsd.
  
  MFC r219731:
  
  Add sbz to calendar.freebsd.

Modified:
  stable/8/usr.bin/calendar/Makefile
  stable/8/usr.bin/calendar/calendars/calendar.freebsd
  stable/8/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military   
(contents, props changed)
  stable/8/usr.bin/calendar/parsedata.c
Directory Properties:
  stable/8/usr.bin/calendar/   (props changed)

Modified: stable/8/usr.bin/calendar/Makefile
==
--- stable/8/usr.bin/calendar/Makefile  Wed Mar 23 13:46:17 2011
(r219906)
+++ stable/8/usr.bin/calendar/Makefile  Wed Mar 23 14:18:59 2011
(r219907)
@@ -4,6 +4,7 @@
 PROG=  calendar
 SRCS=  calendar.c locale.c events.c dates.c parsedata.c io.c day.c \
ostern.c paskha.c pom.c sunpos.c
+DPADD= ${LIBM}
 LDADD= -lm
 INTER=  de_AT.ISO_8859-15 de_DE.ISO8859-1 fr_FR.ISO8859-1 \
hr_HR.ISO8859-2 hu_HU.ISO8859-2 ru_RU.KOI8-R uk_UA.KOI8-U

Modified: stable/8/usr.bin/calendar/calendars/calendar.freebsd
==
--- stable/8/usr.bin/calendar/calendars/calendar.freebsdWed Mar 23 
13:46:17 2011(r219906)
+++ stable/8/usr.bin/calendar/calendars/calendar.freebsdWed Mar 23 
14:18:59 2011(r219907)
@@ -7,6 +7,7 @@
 #ifndef _calendar_freebsd_
 #define _calendar_freebsd_
 
+01/01  Dimitry Andric d...@freebsd.org born in Utrecht, the Netherlands, 1969
 01/01  Alexander Langer a...@freebsd.org born in Duesseldorf, 
Nordrhein-Westfalen, Germany, 1981
 01/02  Ion-Mihai IOnut Tetcu ite...@freebsd.org born in Bucharest, 
Romania, 1980
 01/02  Patrick Li p...@freebsd.org born in Beijing, People's Republic of 
China, 1985
@@ -23,13 +24,13 @@
 01/16  Vanilla I. Shu vani...@freebsd.org born in Taipei, Taiwan, Republic 
of China, 1978
 01/18  Dejan Lesjak l...@freebsd.org born in Ljubljana, Slovenia, 
Yugoslavia, 1977
 01/19  Marshall Kirk McKusick mckus...@freebsd.org born in Wilmington, 
Delaware, United States, 1954
-01/19  Marcelo S. Araujo ara...@freebsd.org born in Joinville, Santa 
Catarina, Brazil, 1981
 01/19  Ruslan Ermilov r...@freebsd.org born in Simferopol, USSR, 1974
+01/19  Marcelo S. Araujo ara...@freebsd.org born in Joinville, Santa 
Catarina, Brazil, 1981
 01/20  Poul-Henning Kamp p...@freebsd.org born in Korsoer, Denmark, 1966
 01/22  Johann Visagie w...@freebsd.org born in Cape Town, South Africa, 1970
 01/23  Hideyuki KURASHINA rush...@freebsd.org born in Niigata, Japan, 1982
-01/24  Matteo Riondato mat...@freebsd.org born in Padova, Italy, 1986
 01/24  Fabien Thomas fabi...@freebsd.org born in Avignon, France, 1971
+01/24  Matteo Riondato mat...@freebsd.org born in Padova, Italy, 1986
 01/25  Bernd Walter ti...@freebsd.org born in Moers, Nordrhein-Westfalen, 
Germany, 1974
 01/26  Andrew Gallatin galla...@freebsd.org born in Buffalo, New York, 
United States, 1970
 01/27  Nick Sayer nsa...@freebsd.org born in San Diego, California, United 
States, 1968
@@ -40,20 +41,22 @@
 02/01  Paul Saab p...@freebsd.org born in Champaign-Urbana, Illinois, United 
States, 1978
 02/01  Martin Wilke m...@freebsd.org born in Ludwigsfelde, Brandenburg, 
Germany, 1980
 02/01  Christian Brueffer bruef...@freebsd.org born in Gronau, 
Nordrhein-Westfalen, Germany, 1982
-02/01  Steven Kreuzer skreu...@freebsd.org born in Oceanside, New York, 1982
+02/01  Steven Kreuzer skreu...@freebsd.org born in Oceanside, New York, 
United States, 1982
 02/01  Juli Mallett jmall...@freebsd.org born in Washington, Pennsylvania, 
United States, 1985
-02/02   Michael W Lucas mwlu...@freebsd.org born in Detroit, Michigan, 
United States, 1967
 02/02  Diomidis D. Spinellis d...@freebsd.org born in Athens, Greece, 1967
+02/02  Michael W Lucas 

Re: svn commit: r219727 - head/sys/vm

2011-03-23 Thread Kostik Belousov
On Wed, Mar 23, 2011 at 09:45:37AM -0400, John Baldwin wrote:
 On Friday, March 18, 2011 4:40:34 am Julian Elischer wrote:
  On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote:
   Author: trasz
   Date: Fri Mar 18 06:47:23 2011
   New Revision: 219727
   URL: http://svn.freebsd.org/changeset/base/219727
  
   Log:
  In vm_daemon(), when iterating over all processes in the system, skip 
   those
  which are not yet fully initialized (i.e. ones with p_state == 
   PRS_NEW).
  Without it, we could panic in _thread_lock_flags().
  
  Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() that
  require similar fix.
  
  In the past each process was only put on the process list after it was 
  fully set up.
  Did someone change that recently?  that would be A Bad Thing (TM).
 
 Err, no, that has never been true.  The reason it has to go on the list
 immediately is to reserve the PID against concurrent fork()s.
 
 Hmm, the locking of prs_state is a bit busted it seems.  Both the PROC_LOCK()
 and PROC_SLOCK() are supposed to be held when it is written to, but
 PROC_LOCK() is missing in fork1() when moving the state to PRS_NORMAL.
 
 Also, this commit should check against PRS_NORMAL after acquiring the proc
 lock, not before.
In the case of this commit, it does not matter much, I think. The reason
is that all the check want is to make sure that there is at least one
fully initialized thread linked into the process.


pgpF9SRCR5EhI.pgp
Description: PGP signature


Re: svn commit: r219727 - head/sys/vm

2011-03-23 Thread John Baldwin
On Wednesday, March 23, 2011 10:34:34 am Kostik Belousov wrote:
 On Wed, Mar 23, 2011 at 09:45:37AM -0400, John Baldwin wrote:
  On Friday, March 18, 2011 4:40:34 am Julian Elischer wrote:
   On 3/17/11 11:47 PM, Edward Tomasz Napierala wrote:
Author: trasz
Date: Fri Mar 18 06:47:23 2011
New Revision: 219727
URL: http://svn.freebsd.org/changeset/base/219727
   
Log:
   In vm_daemon(), when iterating over all processes in the system, 
skip those
   which are not yet fully initialized (i.e. ones with p_state == 
PRS_NEW).
   Without it, we could panic in _thread_lock_flags().
   
   Note that there may be other instances of FOREACH_PROC_IN_SYSTEM() 
that
   require similar fix.
   
   In the past each process was only put on the process list after it was 
   fully set up.
   Did someone change that recently?  that would be A Bad Thing (TM).
  
  Err, no, that has never been true.  The reason it has to go on the list
  immediately is to reserve the PID against concurrent fork()s.
  
  Hmm, the locking of prs_state is a bit busted it seems.  Both the 
PROC_LOCK()
  and PROC_SLOCK() are supposed to be held when it is written to, but
  PROC_LOCK() is missing in fork1() when moving the state to PRS_NORMAL.
  
  Also, this commit should check against PRS_NORMAL after acquiring the proc
  lock, not before.
 In the case of this commit, it does not matter much, I think. The reason
 is that all the check want is to make sure that there is at least one
 fully initialized thread linked into the process.

It already checks other things under the proc lock, so it costs nothing to be
completely correct in this case.

-- 
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


svn commit: r219918 - head/release/powerpc

2011-03-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Mar 23 16:22:08 2011
New Revision: 219918
URL: http://svn.freebsd.org/changeset/base/219918

Log:
  Add support for memstick generation on PowerPC. This is a little suboptimal
  since glabel doesn't know about APM partitioning yet, but works well enough.

Added:
  head/release/powerpc/make-memstick.sh   (contents, props changed)

Added: head/release/powerpc/make-memstick.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/release/powerpc/make-memstick.sh   Wed Mar 23 16:22:08 2011
(r219918)
@@ -0,0 +1,78 @@
+#!/bin/sh
+#
+# This script generates a memstick image (image that can be copied to a
+# USB memory stick) from a directory tree.  Note that the script does not
+# clean up after itself very well for error conditions on purpose so the
+# problem can be diagnosed (full filesystem most likely but ...).
+#
+# Usage: make-memstick.sh directory tree image filename
+#
+# $FreeBSD$
+#
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+BLOCKSIZE=10240
+
+if [ $# -ne 2 ]; then
+  echo make-memstick.sh /path/to/directory /path/to/image/file
+  exit 1
+fi
+
+tempfile=${2}.$$
+
+if [ ! -d ${1} ]; then
+  echo ${1} must be a directory
+  exit 1
+fi
+
+if [ -e ${2} ]; then
+  echo won't overwrite ${2}
+  exit 1
+fi
+
+echo '/dev/da0s3 / ufs rw,noatime 1 1'  ${1}/etc/fstab
+rm -f ${tempfile}
+makefs -B big ${tempfile} ${1}
+if [ $? -ne 0 ]; then
+  echo makefs failed
+  exit 1
+fi
+rm ${1}/etc/fstab
+
+#
+# Use $BLOCKSIZE for transfers to improve efficiency.  When calculating
+# how many blocks to transfer + 2 is to account for truncation in the
+# division and to provide space for the label.
+#
+
+filesize=`stat -f %z ${tempfile}`
+blocks=$(($filesize / ${BLOCKSIZE} + 1728))
+dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
+if [ $? -ne 0 ]; then
+  echo creation of image file failed
+  exit 1
+fi
+
+unit=`mdconfig -a -t vnode -f ${2}`
+if [ $? -ne 0 ]; then
+  echo mdconfig failed
+  exit 1
+fi
+
+gpart create -s APM ${unit}
+gpart add -t freebsd-boot -s 800K ${unit}
+gpart bootcode -p ${1}/boot/boot1.hfs -i 1 ${unit}
+gpart add -t freebsd-ufs -l FreeBSD_Install ${unit}
+
+dd if=${tempfile} of=/dev/${unit}s3 bs=$BLOCKSIZE conv=sync
+if [ $? -ne 0 ]; then
+  echo copying filesystem into image file failed
+  exit 1
+fi
+
+mdconfig -d -u ${unit}
+
+rm -f ${tempfile}
+
___
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: r219920 - in head/sys: i386/include kern sys

2011-03-23 Thread Alan Cox
Author: alc
Date: Wed Mar 23 16:38:29 2011
New Revision: 219920
URL: http://svn.freebsd.org/changeset/base/219920

Log:
  Modestly increase the maximum allowed size of the kmem map on i386.
  Also, express this new maximum as a fraction of the kernel's address
  space size rather than a constant so that increasing KVA_PAGES will
  automatically increase this maximum.  As a side-effect of this change,
  kern.maxvnodes will automatically increase by a proportional amount.
  
  While I'm here ensure that this change doesn't result in an unintended
  increase in maxpipekva on i386.  Calculate maxpipekva based upon the
  size of the kernel address space and the amount of physical memory
  instead of the size of the kmem map.  The memory backing pipes is not
  allocated from the kmem map.  It is allocated from its own submap of
  the kernel map.  In short, it has no real connection to the kmem map.
  (In fact, the commit messages for the maxpipekva auto-sizing talk
  about using the kernel map size, cf. r117325 and r117391, even though
  the implementation actually used the kmem map size.)  Although the
  calculation is now done differently, the resulting value for
  maxpipekva should remain almost the same on i386.  However, on amd64,
  the value will be reduced by 2/3.  This is intentional.  The recent
  change to VM_KMEM_SIZE_SCALE on amd64 for the benefit of ZFS also had
  the unnecessary side-effect of increasing maxpipekva.  This change is
  effectively restoring maxpipekva on amd64 to its prior value.
  
  Eliminate init_param3() since it is no longer used.

Modified:
  head/sys/i386/include/vmparam.h
  head/sys/kern/kern_malloc.c
  head/sys/kern/subr_param.c
  head/sys/sys/systm.h

Modified: head/sys/i386/include/vmparam.h
==
--- head/sys/i386/include/vmparam.h Wed Mar 23 16:28:11 2011
(r219919)
+++ head/sys/i386/include/vmparam.h Wed Mar 23 16:38:29 2011
(r219920)
@@ -189,7 +189,8 @@
  * Ceiling on amount of kmem_map kva space.
  */
 #ifndef VM_KMEM_SIZE_MAX
-#defineVM_KMEM_SIZE_MAX(320 * 1024 * 1024)
+#defineVM_KMEM_SIZE_MAX((VM_MAX_KERNEL_ADDRESS - \
+VM_MIN_KERNEL_ADDRESS) * 2 / 5)
 #endif
 
 /* initial pagein size of beginning of executable file */

Modified: head/sys/kern/kern_malloc.c
==
--- head/sys/kern/kern_malloc.c Wed Mar 23 16:28:11 2011(r219919)
+++ head/sys/kern/kern_malloc.c Wed Mar 23 16:38:29 2011(r219920)
@@ -709,11 +709,6 @@ kmeminit(void *dummy)
if (((vm_kmem_size / 2) / PAGE_SIZE)  cnt.v_page_count)
vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE;
 
-   /*
-* Tune settings based on the kmem map's size at this time.
-*/
-   init_param3(vm_kmem_size / PAGE_SIZE);
-
 #ifdef DEBUG_MEMGUARD
tmp = memguard_fudge(vm_kmem_size, vm_kmem_size_max);
 #else

Modified: head/sys/kern/subr_param.c
==
--- head/sys/kern/subr_param.c  Wed Mar 23 16:28:11 2011(r219919)
+++ head/sys/kern/subr_param.c  Wed Mar 23 16:38:29 2011(r219920)
@@ -48,7 +48,9 @@ __FBSDID($FreeBSD$);
 #include sys/sysctl.h
 #include sys/msgbuf.h
 
+#include vm/vm.h
 #include vm/vm_param.h
+#include vm/pmap.h
 
 /*
  * System parameter formulae.
@@ -293,22 +295,17 @@ init_param2(long physpages)
 
ncallout = 16 + maxproc + maxfiles;
TUNABLE_INT_FETCH(kern.ncallout, ncallout);
-}
-
-/*
- * Boot time overrides that are scaled against the kmem map
- */
-void
-init_param3(long kmempages)
-{
 
/*
-* The default for maxpipekva is max(5% of the kmem map, 512KB).
-* See sys_pipe.c for more details.
+* The default for maxpipekva is min(1/64 of the kernel address space,
+* max(1/64 of main memory, 512KB)).  See sys_pipe.c for more details.
 */
-   maxpipekva = (kmempages / 20) * PAGE_SIZE;
+   maxpipekva = (physpages / 64) * PAGE_SIZE;
if (maxpipekva  512 * 1024)
maxpipekva = 512 * 1024;
+   if (maxpipekva  (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64)
+   maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) /
+   64;
TUNABLE_LONG_FETCH(kern.ipc.maxpipekva, maxpipekva);
 }
 

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hWed Mar 23 16:28:11 2011(r219919)
+++ head/sys/sys/systm.hWed Mar 23 16:38:29 2011(r219920)
@@ -171,7 +171,6 @@ voidcritical_enter(void);
 void   critical_exit(void);
 void   init_param1(void);
 void   init_param2(long physpages);
-void   init_param3(long kmempages);
 void   init_static_kenv(char *, size_t);
 void   tablefull(const char *);
 intkvprintf(char const *, void 

Re: svn commit: r219902 - in head/sys: dev/ae dev/age dev/agp dev/aic7xxx dev/alc dev/ale dev/bce dev/bge dev/bwn dev/bxe dev/cxgb dev/drm dev/e1000 dev/et dev/fxp dev/iwn dev/ixgbe dev/jme dev/malo d

2011-03-23 Thread Doug Barton

On 03/23/2011 06:10, John Baldwin wrote:

Log:
   Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
   pci_find_cap() instead.


I'm not questioning this change, just curious about why.


Doug

--

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
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: r219924 - stable/8/sys/dev/cxgbe

2011-03-23 Thread Navdeep Parhar
Author: np
Date: Wed Mar 23 17:33:04 2011
New Revision: 219924
URL: http://svn.freebsd.org/changeset/base/219924

Log:
  MFC r219883:
  
  Fix an error while constructing the table that maps context id - egress
  queue

Modified:
  stable/8/sys/dev/cxgbe/t4_sge.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/dev/cxgbe/t4_sge.c
==
--- stable/8/sys/dev/cxgbe/t4_sge.c Wed Mar 23 17:18:31 2011
(r219923)
+++ stable/8/sys/dev/cxgbe/t4_sge.c Wed Mar 23 17:33:04 2011
(r219924)
@@ -1134,7 +1134,7 @@ alloc_iq_fl(struct port_info *pi, struct
fl-cntxt_id = be16toh(c.fl0id);
fl-pidx = fl-cidx = 0;
 
-   cntxt_id = iq-cntxt_id - sc-sge.eq_start;
+   cntxt_id = fl-cntxt_id - sc-sge.eq_start;
KASSERT(cntxt_id  sc-sge.neq,
(%s: fl-cntxt_id (%d) more than the max (%d), __func__,
cntxt_id, sc-sge.neq - 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: r219925 - head/sys/kern

2011-03-23 Thread Jaakko Heinonen
Author: jh
Date: Wed Mar 23 17:56:38 2011
New Revision: 219925
URL: http://svn.freebsd.org/changeset/base/219925

Log:
  Recognize ro, rdonly, norw, rw and noro as equal options in
  vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant
  occurrences of these options. It was possible that for example both ro
  and rw options became active concurrently.
  
  PR:   kern/133614
  Discussed on: freebsd-hackers
  MFC after:1 month

Modified:
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Wed Mar 23 17:33:04 2011(r219924)
+++ head/sys/kern/vfs_mount.c   Wed Mar 23 17:56:38 2011(r219925)
@@ -175,6 +175,27 @@ vfs_deleteopt(struct vfsoptlist *opts, c
}
 }
 
+static int
+vfs_isopt_ro(const char *opt)
+{
+
+   if (strcmp(opt, ro) == 0 || strcmp(opt, rdonly) == 0 ||
+   strcmp(opt, norw) == 0)
+   return (1);
+   else
+   return (0);
+}
+
+static int
+vfs_isopt_rw(const char *opt)
+{
+
+   if (strcmp(opt, rw) == 0 || strcmp(opt, noro) == 0)
+   return (1);
+   else
+   return (0);
+}
+
 /*
  * Check if options are equal (with or without the no prefix).
  */
@@ -203,6 +224,11 @@ vfs_equalopts(const char *opt1, const ch
if (strncmp(opt2, no, 2) == 0  strcmp(opt1, opt2 + 2) == 0)
return (1);
}
+   /* ro / rdonly / norw / rw / noro */
+   if ((vfs_isopt_ro(opt1) || vfs_isopt_rw(opt1)) 
+   (vfs_isopt_ro(opt2) || vfs_isopt_rw(opt2)))
+   return (1);
+
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: r219902 - in head/sys: dev/ae dev/age dev/agp dev/aic7xxx dev/alc dev/ale dev/bce dev/bge dev/bwn dev/bxe dev/cxgb dev/drm dev/e1000 dev/et dev/fxp dev/iwn dev/ixgbe dev/jme dev/malo d

2011-03-23 Thread John Baldwin
On Wednesday, March 23, 2011 1:20:23 pm Doug Barton wrote:
 On 03/23/2011 06:10, John Baldwin wrote:
  Log:
 Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
 pci_find_cap() instead.
 
 I'm not questioning this change, just curious about why.

From an earlier commit:

Author: jhb
Date: Tue Mar 22 12:05:49 2011
New Revision: 219865
URL: http://svn.freebsd.org/changeset/base/219865

Log:
  Rename pci_find_extcap() to pci_find_cap().  PCI now uses the term
  extended capabilities to refer to the new set of capability structures
  starting at offset 0x100 in config space for PCI-express devices.  For now
  both function names will still work.  I will merge this to older branches
  to ease driver portability, but 9.0 will ship with a new pci_find_extcap()
  function that locates extended capabilities instead.
  
  Reviewed by:  imp
  MFC after:1 week


-- 
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: r219902 - in head/sys: dev/ae dev/age dev/agp dev/aic7xxx dev/alc dev/ale dev/bce dev/bge dev/bwn dev/bxe dev/cxgb dev/drm dev/e1000 dev/et dev/fxp dev/iwn dev/ixgbe dev/jme dev/malo d

2011-03-23 Thread Doug Barton

On 03/23/2011 11:16, John Baldwin wrote:

 From an earlier commit:

...

Thanks. :)


--

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
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: r219930 - head/sys/dev/usb/controller

2011-03-23 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Mar 23 19:41:44 2011
New Revision: 219930
URL: http://svn.freebsd.org/changeset/base/219930

Log:
  Comply with style(9).
  
  Reported by:  gavin
  MFC after:14 days
  Approved by:  thompsa (mentor)

Modified:
  head/sys/dev/usb/controller/ehci.c

Modified: head/sys/dev/usb/controller/ehci.c
==
--- head/sys/dev/usb/controller/ehci.c  Wed Mar 23 19:30:47 2011
(r219929)
+++ head/sys/dev/usb/controller/ehci.c  Wed Mar 23 19:41:44 2011
(r219930)
@@ -1183,18 +1183,18 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_
 static void
 ehci_data_toggle_update(struct usb_xfer *xfer, uint16_t actlen, uint16_t xlen)
 {
-   uint8_t full = (actlen == xlen);
+   uint16_t rem;
uint8_t dt;
 
/* count number of full packets */
dt = (actlen / xfer-max_packet_size)  1;
 
/* cumpute remainder */
-   actlen = actlen % xfer-max_packet_size;
+   rem = actlen % xfer-max_packet_size;
 
-   if (actlen  0)
+   if (rem  0)
dt ^= 1;/* short packet at the end */
-   else if (!full)
+   else if (actlen != xlen)
dt ^= 1;/* zero length packet at the end */
 
xfer-endpoint-toggle_next ^= dt;
___
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: r219932 - stable/8/sys/dev/ata

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 20:56:56 2011
New Revision: 219932
URL: http://svn.freebsd.org/changeset/base/219932

Log:
  MFC: r219336
  
  - Allocate the DMA memory used for the work area as coherent as at least
the ataahci(4) and atamarvell(4) drivers share it between the host and
the controller.
  - Spell some zeros as BUS_DMA_WAITOK when used as bus_dmamem_alloc() flags.

Modified:
  stable/8/sys/dev/ata/ata-dma.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/dev/ata/ata-dma.c
==
--- stable/8/sys/dev/ata/ata-dma.c  Wed Mar 23 20:55:29 2011
(r219931)
+++ stable/8/sys/dev/ata/ata-dma.c  Wed Mar 23 20:56:56 2011
(r219932)
@@ -104,7 +104,8 @@ ata_dmainit(device_t dev)
   0, NULL, NULL, ch-dma.work_tag))
goto error;
 
-if (bus_dmamem_alloc(ch-dma.work_tag, (void **)ch-dma.work, 0,
+if (bus_dmamem_alloc(ch-dma.work_tag, (void **)ch-dma.work,
+BUS_DMA_WAITOK | BUS_DMA_COHERENT,
 ch-dma.work_map))
goto error;
 
@@ -173,8 +174,8 @@ ata_dmaalloc(device_t dev)
 goto error;
}
 
-   if (bus_dmamem_alloc(slot-sg_tag, (void **)slot-sg,
-0, slot-sg_map)) {
+   if (bus_dmamem_alloc(slot-sg_tag, (void **)slot-sg, BUS_DMA_WAITOK,
+slot-sg_map)) {
device_printf(ch-dev, FAILURE - alloc sg_map\n);
goto error;
 }
___
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: r219933 - stable/8/sys/dev/ata/chipsets

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 20:58:12 2011
New Revision: 219933
URL: http://svn.freebsd.org/changeset/base/219933

Log:
  MFC: r219337
  
  Add missing bus_dmamap_sync() calls for the work DMA map.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-ahci.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/dev/ata/chipsets/ata-ahci.c
==
--- stable/8/sys/dev/ata/chipsets/ata-ahci.cWed Mar 23 20:56:56 2011
(r219932)
+++ stable/8/sys/dev/ata/chipsets/ata-ahci.cWed Mar 23 20:58:12 2011
(r219933)
@@ -320,7 +320,11 @@ ata_ahci_ch_attach(device_t dev)
 static int
 ata_ahci_ch_detach(device_t dev)
 {
-
+struct ata_channel *ch = device_get_softc(dev);
+ 
+if (ch-dma.work_tag  ch-dma.work_map)
+   bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
+   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
 ata_ahci_ch_suspend(dev);
 ata_dmafini(dev);
 return (0);
@@ -495,6 +499,9 @@ ata_ahci_begin_transaction(struct ata_re
 ATA_INL(ctlr-r_res2, ATA_AHCI_P_CMD + offset) 
 ~ATA_AHCI_P_CMD_ATAPI);
 
+bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
+   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
 /* issue command to controller */
 ATA_OUTL(ctlr-r_res2, ATA_AHCI_P_CI + offset, 1);
 
@@ -537,6 +544,9 @@ ata_ahci_end_transaction(struct ata_requ
 /* kill the timeout */
 callout_stop(request-callout);
 
+bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
+   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
 /* get status */
 tf_data = ATA_INL(ctlr-r_res2, ATA_AHCI_P_TFD + offset);
 request-status = tf_data;
@@ -590,6 +600,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16
 clp-bytecount = 0;
 clp-cmd_table_phys = htole64(ch-dma.work_bus + ATA_AHCI_CT_OFFSET);
 
+bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
+   BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
+
 /* issue command to controller */
 ATA_OUTL(ctlr-r_res2, ATA_AHCI_P_CI + offset, 1);
 
@@ -600,6 +613,9 @@ ata_ahci_issue_cmd(device_t dev, u_int16
 break;
 }
 
+bus_dmamap_sync(ch-dma.work_tag, ch-dma.work_map,
+   BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
+
 /* clear interrupts */
 ATA_OUTL(ctlr-r_res2, ATA_AHCI_P_IS + offset,
ATA_INL(ctlr-r_res2, ATA_AHCI_P_IS + offset));
___
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: r219935 - in stable/8/sys: sparc64/ebus sparc64/include sparc64/isa sparc64/pci sparc64/sbus sparc64/sparc64 sun4v/include sun4v/sun4v

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 21:04:56 2011
New Revision: 219935
URL: http://svn.freebsd.org/changeset/base/219935

Log:
  MFC: r219567
  
  Sync licenses and the corresponding RCS IDs with NetBSD, mainly switching
  the licenses of Matthew R. Green and the TNF to 2-clause.
  
  Obtained from:NetBSD

Modified:
  stable/8/sys/sparc64/ebus/ebus.c
  stable/8/sys/sparc64/ebus/ebusreg.h
  stable/8/sys/sparc64/include/_inttypes.h
  stable/8/sys/sparc64/include/_stdint.h
  stable/8/sys/sparc64/include/bus.h
  stable/8/sys/sparc64/include/bus_dma.h
  stable/8/sys/sparc64/include/iommuvar.h
  stable/8/sys/sparc64/include/ofw_nexus.h
  stable/8/sys/sparc64/isa/ofw_isa.c
  stable/8/sys/sparc64/isa/ofw_isa.h
  stable/8/sys/sparc64/pci/ofw_pci.h
  stable/8/sys/sparc64/pci/psychoreg.h
  stable/8/sys/sparc64/pci/psychovar.h
  stable/8/sys/sparc64/sbus/dma_sbus.c
  stable/8/sys/sparc64/sbus/lsi64854.c
  stable/8/sys/sparc64/sbus/lsi64854reg.h
  stable/8/sys/sparc64/sbus/lsi64854var.h
  stable/8/sys/sparc64/sbus/ofw_sbus.h
  stable/8/sys/sparc64/sbus/sbus.c
  stable/8/sys/sparc64/sbus/sbusvar.h
  stable/8/sys/sparc64/sparc64/bus_machdep.c
  stable/8/sys/sparc64/sparc64/iommu.c
  stable/8/sys/sun4v/include/_inttypes.h
  stable/8/sys/sun4v/include/_stdint.h
  stable/8/sys/sun4v/include/bus.h
  stable/8/sys/sun4v/include/bus_dma.h
  stable/8/sys/sun4v/include/ofw_nexus.h
  stable/8/sys/sun4v/sun4v/bus_machdep.c
  stable/8/sys/sun4v/sun4v/hviommu.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/sparc64/ebus/ebus.c
==
--- stable/8/sys/sparc64/ebus/ebus.cWed Mar 23 20:59:20 2011
(r219934)
+++ stable/8/sys/sparc64/ebus/ebus.cWed Mar 23 21:04:56 2011
(r219935)
@@ -1,6 +1,5 @@
 /*-
  * Copyright (c) 1999, 2000 Matthew R. Green
- * Copyright (c) 2001 Thomas Moestl t...@freebsd.org
  * Copyright (c) 2009 by Marius Strobl mar...@freebsd.org
  * All rights reserved.
  *
@@ -27,7 +26,34 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * from: NetBSD: ebus.c,v 1.26 2001/09/10 16:27:53 eeh Exp
+ * from: NetBSD: ebus.c,v 1.52 2008/05/29 14:51:26 mrg Exp
+ */
+/*-
+ * Copyright (c) 2001 Thomas Moestl t...@freebsd.org
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 #include sys/cdefs.h

Modified: stable/8/sys/sparc64/ebus/ebusreg.h
==
--- stable/8/sys/sparc64/ebus/ebusreg.h Wed Mar 23 20:59:20 2011
(r219934)
+++ stable/8/sys/sparc64/ebus/ebusreg.h Wed Mar 23 21:04:56 2011
(r219935)
@@ -1,6 +1,6 @@
 /* $FreeBSD$   */
 /* $OpenBSD: ebusreg.h,v 1.4 2001/10/01 18:08:04 jason Exp $   */
-/* $NetBSD: ebusreg.h,v 1.1 1999/06/04 13:29:13 mrg Exp $  */
+/* $NetBSD: ebusreg.h,v 1.8 2008/05/29 14:51:27 mrg Exp $  */
 
 /*-
  * Copyright (c) 1999 Matthew R. Green
@@ -14,8 +14,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *derived from this software without specific prior written 

svn commit: r219936 - stable/8/sys/dev/fxp

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 21:06:19 2011
New Revision: 219936
URL: http://svn.freebsd.org/changeset/base/219936

Log:
  MFC: r219060
  
  - Allocate the DMA memory shared between the host and the controller as
coherent.
  - Update a comment to no longer reference Alpha.

Modified:
  stable/8/sys/dev/fxp/if_fxp.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/dev/fxp/if_fxp.c
==
--- stable/8/sys/dev/fxp/if_fxp.c   Wed Mar 23 21:04:56 2011
(r219935)
+++ stable/8/sys/dev/fxp/if_fxp.c   Wed Mar 23 21:06:19 2011
(r219936)
@@ -87,7 +87,7 @@ MODULE_DEPEND(fxp, miibus, 1, 1, 1);
 #include miibus_if.h
 
 /*
- * NOTE!  On the Alpha, we have an alignment constraint.  The
+ * NOTE!  On !x86 we typically have an alignment constraint.  The
  * card DMAs the packet immediately following the RFA.  However,
  * the first thing in the packet is a 14-byte Ethernet header.
  * This means that the packet is misaligned.  To compensate,
@@ -675,7 +675,7 @@ fxp_attach(device_t dev)
}
 
error = bus_dmamem_alloc(sc-fxp_stag, (void **)sc-fxp_stats,
-   BUS_DMA_NOWAIT | BUS_DMA_ZERO, sc-fxp_smap);
+   BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_ZERO, sc-fxp_smap);
if (error) {
device_printf(dev, could not allocate stats DMA memory\n);
goto fail;
@@ -697,7 +697,7 @@ fxp_attach(device_t dev)
}
 
error = bus_dmamem_alloc(sc-cbl_tag, (void **)sc-fxp_desc.cbl_list,
-   BUS_DMA_NOWAIT | BUS_DMA_ZERO, sc-cbl_map);
+   BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_ZERO, sc-cbl_map);
if (error) {
device_printf(dev, could not allocate TxCB DMA memory\n);
goto fail;
@@ -722,7 +722,7 @@ fxp_attach(device_t dev)
}
 
error = bus_dmamem_alloc(sc-mcs_tag, (void **)sc-mcsp,
-   BUS_DMA_NOWAIT | BUS_DMA_ZERO, sc-mcs_map);
+   BUS_DMA_NOWAIT | BUS_DMA_COHERENT | BUS_DMA_ZERO, sc-mcs_map);
if (error) {
device_printf(dev,
could not allocate multicast setup DMA memory\n);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r219937 - in head/usr.bin/calendar/calendars: . pt_BR.ISO8859-1 pt_BR.UTF-8

2011-03-23 Thread Edwin Groothuis
Author: edwin
Date: Wed Mar 23 21:22:03 2011
New Revision: 219937
URL: http://svn.freebsd.org/changeset/base/219937

Log:
  Please welcome the Brazilian calendar in the FreeBSD base.
  
  For now, calendar.brazilian points to pt_BR.ISO8859-1
  
  Submitted by: Renato Tambellini rtsa...@gmail.com
  MFC after:1 week

Added:
  head/usr.bin/calendar/calendars/calendar.brazilian   (contents, props changed)
  head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/
  head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.all   (contents, 
props changed)
  head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.commemorative   
(contents, props changed)
  head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.holidays   
(contents, props changed)
  head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.mcommemorative   
(contents, props changed)
  head/usr.bin/calendar/calendars/pt_BR.UTF-8/
  head/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.all   (contents, props 
changed)
  head/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative   
(contents, props changed)
  head/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.holidays   (contents, 
props changed)
  head/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.mcommemorative   
(contents, props changed)
Modified:
  head/usr.bin/calendar/calendars/calendar.all

Modified: head/usr.bin/calendar/calendars/calendar.all
==
--- head/usr.bin/calendar/calendars/calendar.allWed Mar 23 21:06:19 
2011(r219936)
+++ head/usr.bin/calendar/calendars/calendar.allWed Mar 23 21:22:03 
2011(r219937)
@@ -9,6 +9,7 @@
 
 #include calendar.world
 #include calendar.australia
+#include calendar.brazilian
 #include calendar.croatian
 #include calendar.dutch
 #include calendar.french

Added: head/usr.bin/calendar/calendars/calendar.brazilian
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/calendar/calendars/calendar.brazilian  Wed Mar 23 21:22:03 
2011(r219937)
@@ -0,0 +1,13 @@
+/*
+ * $FreeBSD$
+ *
+ * Brazilian calendar file(s), originally submitted by
+ * Renato Tambellini rtsa...@gmail.com
+ */
+
+#ifndef _calendar_brazilian_
+#define _calendar_brazilian_
+
+#include pt_BR.ISO8859-1/calendar.all
+
+#endif

Added: head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.all
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.allWed Mar 
23 21:22:03 2011(r219937)
@@ -0,0 +1,15 @@
+/*
+ * $FreeBSD$
+ *
+ * Brazilian calendar originally submitted by
+ * Renato Tambellini rtsa...@gmail.com
+ */
+
+#ifndef _pt_BR_ISO8859_1_all_
+#define _pt_BR_ISO8859_1_all_
+
+#include pt_BR.ISO8859-1/calendar.holidays
+#include pt_BR.ISO8859-1/calendar.commemorative
+#include pt_BR.ISO8859-1/calendar.mcommemorative
+
+#endif /* !_pt_BR.ISO8859_1_all_ */

Added: head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.commemorative
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/calendar/calendars/pt_BR.ISO8859-1/calendar.commemorative  
Wed Mar 23 21:22:03 2011(r219937)
@@ -0,0 +1,191 @@
+/*
+ * $FreeBSD$
+ *
+ * Originally submitted by Renato Tambellini rtsa...@gmail.com
+ *
+ * Brazilian commemorative days
+ *
+ * http://www.ibge.gov.br/ibgeteen/datas/home.html
+ */
+
+#ifndef _pt_BR_ISO8859_1_commemorative_
+#define _pt_BR_ISO8859_1_commemorative_
+
+LANG=pt_BR.ISO8859-1
+
+01/06  Dia nacional do fot�grafo
+01/06  Dia da gratid�o
+01/07  Dia da liberdade de culto
+01/09  Dia do Fico
+01/12  Anivers�rio de Bel�m
+01/20  Dia do farmac�utico
+01/20  Dia nacional do fusca
+01/21  Dia mundial da religi�o
+01/24  Dia da Previd�ncia Social
+01/25  Dia do carteiro
+01/25  Anivers�rio da cidade de S�o Paulo
+01/28  Anivers�rio da abertura dos portos no Brasil, em 1808
+01/30  Dia da saudade
+02/01  Dia do publicit�rio
+02/04  Anivers�rio de Macap�
+02/07  Dia do gr�fico
+02/16  Dia do rep�rter
+02/19  Dia do esportista
+03/01  Anivers�rio da cidade do Rio de Janeiro
+03/02  Dia do turismo
+03/05  Dia do filatelista brasileiro
+03/07  Dia do fuzileiro naval
+03/08  Dia internacional da mulher
+03/10  Dia do telefone
+03/12  Anivers�rio de Recife
+03/12  Dia do bibliotec�rio
+03/14  Dia nacional da poesia
+03/15  Dia da escola
+03/15  Dia mundial do consumidor
+03/17  Anivers�rio de Aracaju
+03/21  Dia da elimina��o da discrimina��o racial
+03/22  Dia mundial da �gua
+03/23  Anivers�rio de Florian�polis
+03/23  Dia do meteorologista
+03/26  Anivers�rio de Porto Alegre
+03/27  Dia do circo
+03/27  Dia do teatro
+03/28  Dia do revisor e do diagramador
+03/29  Anivers�rio de 

svn commit: r219938 - head/sys/dev/vte

2011-03-23 Thread Pyun YongHyeon
Author: yongari
Date: Wed Mar 23 22:06:09 2011
New Revision: 219938
URL: http://svn.freebsd.org/changeset/base/219938

Log:
  Remove unused DMA map/tag in softc.

Modified:
  head/sys/dev/vte/if_vtevar.h

Modified: head/sys/dev/vte/if_vtevar.h
==
--- head/sys/dev/vte/if_vtevar.hWed Mar 23 21:22:03 2011
(r219937)
+++ head/sys/dev/vte/if_vtevar.hWed Mar 23 22:06:09 2011
(r219938)
@@ -80,13 +80,7 @@ struct vte_chain_data {
bus_dmamap_tvte_tx_ring_map;
bus_dma_tag_t   vte_rx_ring_tag;
bus_dmamap_tvte_rx_ring_map;
-   bus_dma_tag_t   vte_rr_ring_tag;
-   bus_dmamap_tvte_rr_ring_map;
bus_dmamap_tvte_rx_sparemap;
-   bus_dma_tag_t   vte_cmb_tag;
-   bus_dmamap_tvte_cmb_map;
-   bus_dma_tag_t   vte_smb_tag;
-   bus_dmamap_tvte_smb_map;
struct vte_tx_desc  *vte_tx_ring;
bus_addr_t  vte_tx_ring_paddr;
struct vte_rx_desc  *vte_rx_ring;
___
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: r219939 - head/lib/libutil

2011-03-23 Thread Xin LI
Author: delphij
Date: Wed Mar 23 22:08:01 2011
New Revision: 219939
URL: http://svn.freebsd.org/changeset/base/219939

Log:
  humanize_number(3) multiply the input number by 100, which could cause an
  integer overflow when the input is very large (for example, 100 Pi would
  become about 10 Ei which exceeded signed int64_t).
  
  Solve this issue by splitting the division into two parts and avoid the
  multiplication.
  
  PR:   bin/146205
  Reviewed by:  arundel
  MFC after:1 month

Modified:
  head/lib/libutil/humanize_number.c

Modified: head/lib/libutil/humanize_number.c
==
--- head/lib/libutil/humanize_number.c  Wed Mar 23 22:06:09 2011
(r219938)
+++ head/lib/libutil/humanize_number.c  Wed Mar 23 22:08:01 2011
(r219939)
@@ -43,11 +43,11 @@ __FBSDID($FreeBSD$);
 #include libutil.h
 
 int
-humanize_number(char *buf, size_t len, int64_t bytes,
+humanize_number(char *buf, size_t len, int64_t quotient,
 const char *suffix, int scale, int flags)
 {
const char *prefixes, *sep;
-   int b, i, r, maxscale, s1, s2, sign;
+   int i, r, remainder, maxscale, s1, s2, sign;
int64_t divisor, max;
size_t  baselen;
 
@@ -55,6 +55,8 @@ humanize_number(char *buf, size_t len, i
assert(suffix != NULL);
assert(scale = 0);
 
+   remainder = 0;
+
if (flags  HN_DIVISOR_1000) {
/* SI for decimal multiplies */
divisor = 1000;
@@ -86,13 +88,12 @@ humanize_number(char *buf, size_t len, i
 
if (len  0)
buf[0] = '\0';
-   if (bytes  0) {
+   if (quotient  0) {
sign = -1;
-   bytes *= -100;
+   quotient = -quotient;
baselen = 3;/* sign, digit, prefix */
} else {
sign = 1;
-   bytes *= 100;
baselen = 2;/* digit, prefix */
}
if (flags  HN_NOSPACE)
@@ -109,7 +110,7 @@ humanize_number(char *buf, size_t len, i
 
if (scale  (HN_AUTOSCALE | HN_GETSCALE)) {
/* See if there is additional columns can be used. */
-   for (max = 100, i = len - baselen; i--  0;)
+   for (max = 1, i = len - baselen; i--  0;)
max *= 10;
 
/*
@@ -117,30 +118,37 @@ humanize_number(char *buf, size_t len, i
 * If there will be an overflow by the rounding below,
 * divide once more.
 */
-   for (i = 0; bytes = max - 50  i  maxscale; i++)
-   bytes /= divisor;
+   for (i = 0;
+   (quotient = max || (quotient == max - 1  remainder = 
950)) 
+   i  maxscale; i++) {
+   remainder = quotient % divisor;
+   quotient /= divisor;
+   }
 
if (scale  HN_GETSCALE)
return (i);
-   } else
-   for (i = 0; i  scale  i  maxscale; i++)
-   bytes /= divisor;
+   } else {
+   for (i = 0; i  scale  i  maxscale; i++) {
+   remainder = quotient % divisor;
+   quotient /= divisor;
+   }
+   }
 
/* If a value = 9.9 after rounding and ... */
-   if (bytes  995  i  0  flags  HN_DECIMAL) {
+   if (quotient = 9  remainder  950  i  0  flags  HN_DECIMAL) {
/* baselen + \0 + .N */
if (len  baselen + 1 + 2)
return (-1);
-   b = ((int)bytes + 5) / 10;
-   s1 = b / 10;
-   s2 = b % 10;
+   s1 = (int)quotient + ((remainder + 50) / 1000);
+   s2 = ((remainder + 50) / 100) % 10;
r = snprintf(buf, len, %d%s%d%s%s%s,
sign * s1, localeconv()-decimal_point, s2,
sep, SCALE2PREFIX(i), suffix);
} else
r = snprintf(buf, len, % PRId64 %s%s%s,
-   sign * ((bytes + 50) / 100),
+   sign * (quotient + (remainder + 50) / 1000),
sep, SCALE2PREFIX(i), suffix);
 
return (r);
 }
+
___
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: r219940 - in stable/8: libexec/rtld-elf/sparc64 sys/sparc64/sparc64

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 22:33:29 2011
New Revision: 219940
URL: http://svn.freebsd.org/changeset/base/219940

Log:
  MFC: r219339, r219532
  
  - Remove clause 3 and 4 from TNF licenses. [1]
  - Add the _RF_X committed in r212998 (merged to stable/8 in r213478) also
to the tables in the sparc64 reloc.c in order reduce differences between
the kernel and the userland source. This results in no functional change
though.
  - Consistently abbreviate the names of the relocations.
  - End sentences with dots.
  - Fix whitespace.
  
  Obtained from:NetBSD [1]

Modified:
  stable/8/libexec/rtld-elf/sparc64/reloc.c
  stable/8/sys/sparc64/sparc64/elf_machdep.c
Directory Properties:
  stable/8/libexec/rtld-elf/   (props changed)
  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/libexec/rtld-elf/sparc64/reloc.c
==
--- stable/8/libexec/rtld-elf/sparc64/reloc.c   Wed Mar 23 22:08:01 2011
(r219939)
+++ stable/8/libexec/rtld-elf/sparc64/reloc.c   Wed Mar 23 22:33:29 2011
(r219940)
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp $   */
+/* $NetBSD: mdreloc.c,v 1.42 2008/04/28 20:23:04 martin Exp $  */
 
 /*-
  * Copyright (c) 2000 Eduardo Horvath.
@@ -16,13 +16,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *This product includes software developed by the NetBSD
- *Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *contributors may be used to endorse or promote products derived
- *from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
@@ -66,28 +59,29 @@ __FBSDID($FreeBSD$);
  * * the relocation is relative to the load address
  *
  */
-#define _RF_S  0x8000  /* Resolve symbol */
-#define _RF_A  0x4000  /* Use addend */
-#define _RF_P  0x2000  /* Location relative */
-#define _RF_G  0x1000  /* GOT offset */
-#define _RF_B  0x0800  /* Load address relative */
-#define _RF_U  0x0400  /* Unaligned */
-#define _RF_SZ(s)  (((s)  0xff)  8) /* memory target size */
-#define _RF_RS(s)  ( (s)  0xff)   /* right shift */
+#define_RF_S   0x8000  /* Resolve symbol */
+#define_RF_A   0x4000  /* Use addend */
+#define_RF_P   0x2000  /* Location relative */
+#define_RF_G   0x1000  /* GOT offset */
+#define_RF_B   0x0800  /* Load address 
relative */
+#define_RF_U   0x0400  /* Unaligned */
+#define_RF_X   0x0200  /* Bare symbols, needs 
proc */
+#define_RF_SZ(s)   (((s)  0xff)  8) /* memory target size */
+#define_RF_RS(s)   ( (s)  0xff)   /* right shift */
 static const int reloc_target_flags[] = {
0,  /* NONE */
-   _RF_S|_RF_A|_RF_SZ(8)  | _RF_RS(0), /* RELOC_8 */
-   _RF_S|_RF_A|_RF_SZ(16) | _RF_RS(0), /* RELOC_16 */
-   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(0), /* RELOC_32 */
+   _RF_S|_RF_A|_RF_SZ(8)  | _RF_RS(0), /* 8 */
+   _RF_S|_RF_A|_RF_SZ(16) | _RF_RS(0), /* 16 */
+   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(0), /* 32 */
_RF_S|_RF_A|_RF_P|  _RF_SZ(8)  | _RF_RS(0), /* DISP_8 */
_RF_S|_RF_A|_RF_P|  _RF_SZ(16) | _RF_RS(0), /* DISP_16 */
_RF_S|_RF_A|_RF_P|  _RF_SZ(32) | _RF_RS(0), /* DISP_32 */
_RF_S|_RF_A|_RF_P|  _RF_SZ(32) | _RF_RS(2), /* WDISP_30 */
_RF_S|_RF_A|_RF_P|  _RF_SZ(32) | _RF_RS(2), /* WDISP_22 */
-   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(10),/* HI22 */
-   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(0), /* 22 */
-   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(0), /* 13 */
-   _RF_S|_RF_A|_RF_SZ(32) | _RF_RS(0), /* 

svn commit: r219941 - in stable/8/sys: sparc64/include sparc64/sparc64 sun4v/include sun4v/sun4v

2011-03-23 Thread Marius Strobl
Author: marius
Date: Wed Mar 23 22:35:18 2011
New Revision: 219941
URL: http://svn.freebsd.org/changeset/base/219941

Log:
  MFC: r219608
  
  Remove the advertising clause from the UCB license according to the
  July 22, 1999 addendum.

Modified:
  stable/8/sys/sparc64/include/varargs.h
  stable/8/sys/sparc64/include/vmparam.h
  stable/8/sys/sparc64/sparc64/pmap.c
  stable/8/sys/sparc64/sparc64/trap.c
  stable/8/sys/sparc64/sparc64/vm_machdep.c
  stable/8/sys/sun4v/include/varargs.h
  stable/8/sys/sun4v/include/vmparam.h
  stable/8/sys/sun4v/sun4v/trap.c
  stable/8/sys/sun4v/sun4v/vm_machdep.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/sparc64/include/varargs.h
==
--- stable/8/sys/sparc64/include/varargs.h  Wed Mar 23 22:33:29 2011
(r219940)
+++ stable/8/sys/sparc64/include/varargs.h  Wed Mar 23 22:35:18 2011
(r219941)
@@ -25,10 +25,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.

Modified: stable/8/sys/sparc64/include/vmparam.h
==
--- stable/8/sys/sparc64/include/vmparam.h  Wed Mar 23 22:33:29 2011
(r219940)
+++ stable/8/sys/sparc64/include/vmparam.h  Wed Mar 23 22:35:18 2011
(r219941)
@@ -15,10 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed by the University of
- *  California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.

Modified: stable/8/sys/sparc64/sparc64/pmap.c
==
--- stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 23 22:33:29 2011
(r219940)
+++ stable/8/sys/sparc64/sparc64/pmap.c Wed Mar 23 22:35:18 2011
(r219941)
@@ -18,10 +18,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed by the University of
- *  California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.

Modified: stable/8/sys/sparc64/sparc64/trap.c
==
--- stable/8/sys/sparc64/sparc64/trap.c Wed Mar 23 22:33:29 2011
(r219940)
+++ stable/8/sys/sparc64/sparc64/trap.c Wed Mar 23 22:35:18 2011
(r219941)
@@ -15,10 +15,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed by the University of
- *  California, Berkeley and its contributors.
  * 4. Neither the name of the University nor the names of its contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.

Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c
==
--- 

svn commit: r219942 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416

2011-03-23 Thread Adrian Chadd
Author: adrian
Date: Wed Mar 23 23:48:44 2011
New Revision: 219942
URL: http://svn.freebsd.org/changeset/base/219942

Log:
  Make the ar2133ForceBias() call controllable at runtime.
  
  At least one AR5416 user has reported measurable throughput drops
  with this option. For now, disable it and make it a run-time
  twiddle. It won't take affect until the next radio programming
  trip though (eg channel scan, channel change.)

Modified:
  head/sys/dev/ath/ah_osdep.c
  head/sys/dev/ath/ath_hal/ah_internal.h
  head/sys/dev/ath/ath_hal/ar5416/ar2133.c

Modified: head/sys/dev/ath/ah_osdep.c
==
--- head/sys/dev/ath/ah_osdep.c Wed Mar 23 22:35:18 2011(r219941)
+++ head/sys/dev/ath/ah_osdep.c Wed Mar 23 23:48:44 2011(r219942)
@@ -85,6 +85,11 @@ SYSCTL_INT(_hw_ath_hal, OID_AUTO, debug,
 TUNABLE_INT(hw.ath.hal.debug, ath_hal_debug);
 #endif /* AH_DEBUG */
 
+int ath_hal_ar5416_biasadj = 0;
+SYSCTL_INT(_hw_ath_hal, OID_AUTO, ar5416_biasadj, CTLFLAG_RW,
+   ath_hal_debug, 0, Enable 2ghz AR5416 direction sensitivity
+bias adjust);
+
 /* NB: these are deprecated; they exist for now for compatibility */
 intath_hal_dma_beacon_response_time = 2;   /* in TU's */
 SYSCTL_INT(_hw_ath_hal, OID_AUTO, dma_brt, CTLFLAG_RW,

Modified: head/sys/dev/ath/ath_hal/ah_internal.h
==
--- head/sys/dev/ath/ath_hal/ah_internal.h  Wed Mar 23 22:35:18 2011
(r219941)
+++ head/sys/dev/ath/ath_hal/ah_internal.h  Wed Mar 23 23:48:44 2011
(r219942)
@@ -476,6 +476,7 @@ isBigEndian(void)
 extern int ath_hal_dma_beacon_response_time;   /* in TU's */
 extern int ath_hal_sw_beacon_response_time;/* in TU's */
 extern int ath_hal_additional_swba_backoff;/* in TU's */
+extern int ath_hal_ar5416_biasadj; /* 1 or 0 */
 
 /* wait for the register contents to have the specified value */
 extern HAL_BOOL ath_hal_wait(struct ath_hal *, u_int reg,

Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c
==
--- head/sys/dev/ath/ath_hal/ar5416/ar2133.cWed Mar 23 22:35:18 2011
(r219941)
+++ head/sys/dev/ath/ath_hal/ar5416/ar2133.cWed Mar 23 23:48:44 2011
(r219942)
@@ -185,7 +185,7 @@ ar2133SetChannel(struct ath_hal *ah, con
}
 
/* Workaround for hw bug - AR5416 specific */
-   if (AR_SREV_OWL(ah))
+   if (AR_SREV_OWL(ah)  ath_hal_ar5416_biasadj)
ar2133ForceBias(ah, freq);
 
reg32 = (channelSel  8) | (aModeRefSel  2) | (bModeSynth  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


Re: svn commit: r219939 - head/lib/libutil

2011-03-23 Thread Alexander Best
On Wed Mar 23 11, Xin LI wrote:
 Author: delphij
 Date: Wed Mar 23 22:08:01 2011
 New Revision: 219939
 URL: http://svn.freebsd.org/changeset/base/219939
 
 Log:
   humanize_number(3) multiply the input number by 100, which could cause an
   integer overflow when the input is very large (for example, 100 Pi would
   become about 10 Ei which exceeded signed int64_t).

i think we should also change the humanize_number(3) manual page accordingly.
here's a rough draft (date not bumped, yet).

   
   Solve this issue by splitting the division into two parts and avoid the
   multiplication.
   
   PR: bin/146205
   Reviewed by:arundel
   MFC after:  1 month
 
 Modified:
   head/lib/libutil/humanize_number.c
 
 Modified: head/lib/libutil/humanize_number.c
 ==
 --- head/lib/libutil/humanize_number.cWed Mar 23 22:06:09 2011
 (r219938)
 +++ head/lib/libutil/humanize_number.cWed Mar 23 22:08:01 2011
 (r219939)
 @@ -43,11 +43,11 @@ __FBSDID($FreeBSD$);
  #include libutil.h
  
  int
 -humanize_number(char *buf, size_t len, int64_t bytes,
 +humanize_number(char *buf, size_t len, int64_t quotient,
  const char *suffix, int scale, int flags)
  {
   const char *prefixes, *sep;
 - int b, i, r, maxscale, s1, s2, sign;
 + int i, r, remainder, maxscale, s1, s2, sign;
   int64_t divisor, max;
   size_t  baselen;
  
 @@ -55,6 +55,8 @@ humanize_number(char *buf, size_t len, i
   assert(suffix != NULL);
   assert(scale = 0);
  
 + remainder = 0;
 +
   if (flags  HN_DIVISOR_1000) {
   /* SI for decimal multiplies */
   divisor = 1000;
 @@ -86,13 +88,12 @@ humanize_number(char *buf, size_t len, i
  
   if (len  0)
   buf[0] = '\0';
 - if (bytes  0) {
 + if (quotient  0) {
   sign = -1;
 - bytes *= -100;
 + quotient = -quotient;
   baselen = 3;/* sign, digit, prefix */
   } else {
   sign = 1;
 - bytes *= 100;
   baselen = 2;/* digit, prefix */
   }
   if (flags  HN_NOSPACE)
 @@ -109,7 +110,7 @@ humanize_number(char *buf, size_t len, i
  
   if (scale  (HN_AUTOSCALE | HN_GETSCALE)) {
   /* See if there is additional columns can be used. */
 - for (max = 100, i = len - baselen; i--  0;)
 + for (max = 1, i = len - baselen; i--  0;)
   max *= 10;
  
   /*
 @@ -117,30 +118,37 @@ humanize_number(char *buf, size_t len, i
* If there will be an overflow by the rounding below,
* divide once more.
*/
 - for (i = 0; bytes = max - 50  i  maxscale; i++)
 - bytes /= divisor;
 + for (i = 0;
 + (quotient = max || (quotient == max - 1  remainder = 
 950)) 
 + i  maxscale; i++) {
 + remainder = quotient % divisor;
 + quotient /= divisor;
 + }
  
   if (scale  HN_GETSCALE)
   return (i);
 - } else
 - for (i = 0; i  scale  i  maxscale; i++)
 - bytes /= divisor;
 + } else {
 + for (i = 0; i  scale  i  maxscale; i++) {
 + remainder = quotient % divisor;
 + quotient /= divisor;
 + }
 + }
  
   /* If a value = 9.9 after rounding and ... */
 - if (bytes  995  i  0  flags  HN_DECIMAL) {
 + if (quotient = 9  remainder  950  i  0  flags  HN_DECIMAL) {
   /* baselen + \0 + .N */
   if (len  baselen + 1 + 2)
   return (-1);
 - b = ((int)bytes + 5) / 10;
 - s1 = b / 10;
 - s2 = b % 10;
 + s1 = (int)quotient + ((remainder + 50) / 1000);
 + s2 = ((remainder + 50) / 100) % 10;
   r = snprintf(buf, len, %d%s%d%s%s%s,
   sign * s1, localeconv()-decimal_point, s2,
   sep, SCALE2PREFIX(i), suffix);
   } else
   r = snprintf(buf, len, % PRId64 %s%s%s,
 - sign * ((bytes + 50) / 100),
 + sign * (quotient + (remainder + 50) / 1000),
   sep, SCALE2PREFIX(i), suffix);
  
   return (r);
  }
 +

-- 
a13x
diff --git a/lib/libutil/humanize_number.3 b/lib/libutil/humanize_number.3
index 82925ba..8741e23 100644
--- a/lib/libutil/humanize_number.3
+++ b/lib/libutil/humanize_number.3
@@ -40,14 +40,14 @@
 .In libutil.h
 .Ft int
 .Fo humanize_number
-.Fa char *buf size_t len int64_t number const char *suffix
+.Fa char *buf size_t len int64_t quotient const char *suffix
 .Fa int scale int flags
 .Fc
 .Sh DESCRIPTION
 The
 .Fn humanize_number
 function formats the signed 64-bit quantity given in
-.Fa number
+.Fa quotient
 into
 .Fa buf .
 A space and 

svn commit: r219943 - stable/8/bin/ps

2011-03-23 Thread Konstantin Belousov
Author: kib
Date: Thu Mar 24 00:42:07 2011
New Revision: 219943
URL: http://svn.freebsd.org/changeset/base/219943

Log:
  MFC r219713:
  Implement the usertime and systime keywords for ps, printing the
  corresponding times reported by getrusage().

Modified:
  stable/8/bin/ps/extern.h
  stable/8/bin/ps/keyword.c
  stable/8/bin/ps/print.c
  stable/8/bin/ps/ps.1
Directory Properties:
  stable/8/bin/ps/   (props changed)

Modified: stable/8/bin/ps/extern.h
==
--- stable/8/bin/ps/extern.hWed Mar 23 23:48:44 2011(r219942)
+++ stable/8/bin/ps/extern.hThu Mar 24 00:42:07 2011(r219943)
@@ -79,12 +79,14 @@ int  s_uname(KINFO *);
 voidshowkey(void);
 voidstarted(KINFO *, VARENT *);
 voidstate(KINFO *, VARENT *);
+voidsystime(KINFO *, VARENT *);
 voidtdev(KINFO *, VARENT *);
 voidtdnam(KINFO *, VARENT *);
 voidtname(KINFO *, VARENT *);
 voiducomm(KINFO *, VARENT *);
 voiduname(KINFO *, VARENT *);
 voidupr(KINFO *, VARENT *);
+voidusertime(KINFO *, VARENT *);
 voidvsize(KINFO *, VARENT *);
 voidwchan(KINFO *, VARENT *);
 __END_DECLS

Modified: stable/8/bin/ps/keyword.c
==
--- stable/8/bin/ps/keyword.c   Wed Mar 23 23:48:44 2011(r219942)
+++ stable/8/bin/ps/keyword.c   Thu Mar 24 00:42:07 2011(r219943)
@@ -186,6 +186,7 @@ static VAR var[] = {
UINT, UIDFMT, 0},
{svuid, SVUID, NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_svuid),
UINT, UIDFMT, 0},
+   {systime, SYSTIME, NULL, USER, systime, NULL, 9, 0, CHAR, NULL, 0},
{tdaddr, TDADDR, NULL, 0, kvar, NULL, sizeof(void *) * 2,
KOFF(ki_tdaddr), KPTR, lx, 0},
{tdev, TDEV, NULL, 0, tdev, NULL, 5, 0, CHAR, NULL, 0},
@@ -207,6 +208,8 @@ static VAR var[] = {
KOFF(ki_paddr), KPTR, lx, 0},
{user, USER, NULL, LJUST|DSIZ, uname, s_uname, USERLEN, 0, CHAR,
NULL, 0},
+   {usertime, USERTIME, NULL, USER, usertime, NULL, 9, 0, CHAR, NULL,
+   0},
{usrpri, , upr, 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{vsize, , vsz, 0, NULL, NULL, 0, 0, CHAR, NULL, 0},
{vsz, VSZ, NULL, 0, vsize, NULL, 5, 0, CHAR, NULL, 0},

Modified: stable/8/bin/ps/print.c
==
--- stable/8/bin/ps/print.c Wed Mar 23 23:48:44 2011(r219942)
+++ stable/8/bin/ps/print.c Thu Mar 24 00:42:07 2011(r219943)
@@ -548,12 +548,11 @@ vsize(KINFO *k, VARENT *ve)
(void)printf(%*lu, v-width, (u_long)(k-ki_p-ki_size / 1024));
 }
 
-void
-cputime(KINFO *k, VARENT *ve)
+static void
+printtime(KINFO *k, VARENT *ve, long secs, long psecs)
+/* psecs is parts of a second. first micro, then centi */
 {
VAR *v;
-   long secs;
-   long psecs; /* parts of a second. first micro, then centi */
char obuff[128];
static char decimal_point;
 
@@ -564,20 +563,7 @@ cputime(KINFO *k, VARENT *ve)
secs = 0;
psecs = 0;
} else {
-   /*
-* This counts time spent handling interrupts.  We could
-* fix this, but it is not 100% trivial (and interrupt
-* time fractions only work on the sparc anyway).   XXX
-*/
-   secs = k-ki_p-ki_runtime / 100;
-   psecs = k-ki_p-ki_runtime % 100;
-   if (sumrusage) {
-   secs += k-ki_p-ki_childtime.tv_sec;
-   psecs += k-ki_p-ki_childtime.tv_usec;
-   }
-   /*
-* round and scale to 100's
-*/
+   /* round and scale to 100's */
psecs = (psecs + 5000) / 1;
secs += psecs / 100;
psecs = psecs % 100;
@@ -588,6 +574,53 @@ cputime(KINFO *k, VARENT *ve)
 }
 
 void
+cputime(KINFO *k, VARENT *ve)
+{
+   long secs, psecs;
+
+   /*
+* This counts time spent handling interrupts.  We could
+* fix this, but it is not 100% trivial (and interrupt
+* time fractions only work on the sparc anyway).   XXX
+*/
+   secs = k-ki_p-ki_runtime / 100;
+   psecs = k-ki_p-ki_runtime % 100;
+   if (sumrusage) {
+   secs += k-ki_p-ki_childtime.tv_sec;
+   psecs += k-ki_p-ki_childtime.tv_usec;
+   }
+   printtime(k, ve, secs, psecs);
+}
+
+void
+systime(KINFO *k, VARENT *ve)
+{
+   long secs, psecs;
+
+   secs = k-ki_p-ki_rusage.ru_stime.tv_sec;
+   psecs = k-ki_p-ki_rusage.ru_stime.tv_usec;
+   if (sumrusage) {
+   secs += k-ki_p-ki_childstime.tv_sec;
+   psecs += k-ki_p-ki_childstime.tv_usec;
+   }
+   printtime(k, ve, secs, psecs);
+}
+
+void
+usertime(KINFO *k, VARENT *ve)
+{
+ 

svn commit: r219944 - head/sys/dev/cxgbe

2011-03-23 Thread Navdeep Parhar
Author: np
Date: Thu Mar 24 01:03:01 2011
New Revision: 219944
URL: http://svn.freebsd.org/changeset/base/219944

Log:
  Do not over-allocate MSI interrupts for the case where each ingress
  queue has its own interrupt.  If the exact number that we need is not a
  power of 2 and we're using MSI, then switch to interrupt multiplexing.
  
  While here, replace the magic numbers with something more readable.
  
  MFC after:3 days

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

Modified: head/sys/dev/cxgbe/adapter.h
==
--- head/sys/dev/cxgbe/adapter.hThu Mar 24 00:42:07 2011
(r219943)
+++ head/sys/dev/cxgbe/adapter.hThu Mar 24 01:03:01 2011
(r219944)
@@ -128,6 +128,13 @@ enum {
 };
 
 enum {
+   /* adapter intr_type */
+   INTR_INTX   = (1  0),
+   INTR_MSI= (1  1),
+   INTR_MSIX   = (1  2)
+};
+
+enum {
/* adapter flags */
FULL_INIT_DONE  = (1  0),
FW_OK   = (1  1),

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cThu Mar 24 00:42:07 2011
(r219943)
+++ head/sys/dev/cxgbe/t4_main.cThu Mar 24 01:03:01 2011
(r219944)
@@ -205,7 +205,7 @@ SYSCTL_UINT(_hw_cxgbe, OID_AUTO, qsize_r
 /*
  * Interrupt types allowed.
  */
-static int intr_types = 7;
+static int intr_types = INTR_MSIX | INTR_MSI | INTR_INTX;
 TUNABLE_INT(hw.cxgbe.interrupt_types, intr_types);
 SYSCTL_UINT(_hw_cxgbe, OID_AUTO, interrupt_types, CTLFLAG_RDTUN, intr_types, 
0,
 interrupt types allowed (bits 0, 1, 2 = INTx, MSI, MSI-X respectively));
@@ -219,7 +219,7 @@ SYSCTL_UINT(_hw_cxgbe, OID_AUTO, interru
 intr_fwd, 0, always use forwarded interrupts);
 
 struct intrs_and_queues {
-   int intr_type;  /* 1, 2, or 4 for INTx, MSI, or MSI-X */
+   int intr_type;  /* INTx, MSI, or MSI-X */
int nirq;   /* Number of vectors */
int intr_fwd;   /* Interrupts forwarded */
int ntxq10g;/* # of NIC txq's for each 10G port */
@@ -639,7 +639,7 @@ t4_detach(device_t dev)
if (sc-flags  FW_OK)
t4_fw_bye(sc, sc-mbox);
 
-   if (sc-intr_type == 2 || sc-intr_type == 4)
+   if (sc-intr_type == INTR_MSI || sc-intr_type == INTR_MSIX)
pci_release_msi(dev);
 
if (sc-regs_res)
@@ -1152,14 +1152,14 @@ cfg_itype_and_nqueues(struct adapter *sc
bzero(iaq, sizeof(*iaq));
nc = mp_ncpus;  /* our snapshot of the number of CPUs */
 
-   for (itype = 4; itype; itype = 1) {
+   for (itype = INTR_MSIX; itype; itype = 1) {
 
if ((itype  intr_types) == 0)
continue;   /* not allowed */
 
-   if (itype == 4)
+   if (itype == INTR_MSIX)
navail = pci_msix_count(sc-dev);
-   else if (itype == 2)
+   else if (itype == INTR_MSI)
navail = pci_msi_count(sc-dev);
else
navail = 1;
@@ -1179,44 +1179,50 @@ cfg_itype_and_nqueues(struct adapter *sc
iaq-nirq = n10g * nrxq10g + n1g * nrxq1g + 2;
if (iaq-nirq = navail  intr_fwd == 0) {
 
+   if (itype == INTR_MSI  !powerof2(iaq-nirq))
+   goto fwd;
+
/* One for err, one for fwq, and one for each rxq */
 
iaq-intr_fwd = 0;
iaq-nrxq10g = nrxq10g;
iaq-nrxq1g = nrxq1g;
-   if (itype == 2) {
-   /* # of vectors requested must be power of 2 */
-   while (!powerof2(iaq-nirq))
-   iaq-nirq++;
-   KASSERT(iaq-nirq = navail,
-   (%s: bad MSI calculation, __func__));
-   }
+
} else {
 fwd:
iaq-intr_fwd = 1;
-   iaq-nirq = navail;
+
+   if (navail  nc) {
+   if (itype == INTR_MSIX)
+   navail = nc + 1;
+
+   /* navail is and must remain a pow2 for MSI */
+   if (itype == INTR_MSI) {
+   KASSERT(powerof2(navail),
+   (%d not power of 2, navail));
+
+   while (navail / 2  nc)
+   navail /= 2;
+   }
+   }
+   iaq-nirq = navail; /* total # of interrupts */
 
/*
   

svn commit: r219945 - head/sys/dev/cxgb/common

2011-03-23 Thread Navdeep Parhar
Author: np
Date: Thu Mar 24 01:13:28 2011
New Revision: 219945
URL: http://svn.freebsd.org/changeset/base/219945

Log:
  T3C initialization should setup the parity fence too.
  
  MFC after:1 week

Modified:
  head/sys/dev/cxgb/common/cxgb_t3_hw.c

Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c
==
--- head/sys/dev/cxgb/common/cxgb_t3_hw.c   Thu Mar 24 01:03:01 2011
(r219944)
+++ head/sys/dev/cxgb/common/cxgb_t3_hw.c   Thu Mar 24 01:13:28 2011
(r219945)
@@ -1750,6 +1750,7 @@ static int t3_handle_intr_status(adapter
fatal++;
CH_ALERT(adapter, %s (0x%x)\n,
 acts-msg, status  acts-mask);
+   status = ~acts-mask;
} else if (acts-msg)
CH_WARN(adapter, %s (0x%x)\n,
acts-msg, status  acts-mask);
@@ -2189,11 +2190,10 @@ static int mac_intr_handler(adapter_t *a
t3_os_link_intr(pi);
}
 
-   t3_write_reg(adap, A_XGM_INT_CAUSE + mac-offset, cause);
-
if (cause  XGM_INTR_FATAL)
t3_fatal_err(adap);
 
+   t3_write_reg(adap, A_XGM_INT_CAUSE + mac-offset, cause);
return cause != 0;
 }
 
@@ -4189,6 +4189,7 @@ int t3_init_hw(adapter_t *adapter, u32 f
t3_write_reg(adapter, A_PM1_TX_MODE, 0);
chan_init_hw(adapter, adapter-params.chan_map);
t3_sge_init(adapter, adapter-params.sge);
+   t3_set_reg_field(adapter, A_PL_RST, 0, F_FATALPERREN);
 
t3_write_reg(adapter, A_T3DBG_GPIO_ACT_LOW, calc_gpio_intr(adapter));
 
___
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: r219946 - head/sys/dev/cxgb

2011-03-23 Thread Navdeep Parhar
Author: np
Date: Thu Mar 24 01:16:48 2011
New Revision: 219946
URL: http://svn.freebsd.org/changeset/base/219946

Log:
  t3_free_sge_resources should be given the number of qsets it needs to free.
  
  MFC after:1 week

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.hThu Mar 24 01:13:28 2011
(r219945)
+++ head/sys/dev/cxgb/cxgb_adapter.hThu Mar 24 01:16:48 2011
(r219946)
@@ -510,7 +510,7 @@ int t3_sge_alloc(struct adapter *);
 int t3_sge_free(struct adapter *);
 int t3_sge_alloc_qset(adapter_t *, uint32_t, int, int, const struct 
qset_params *,
 int, struct port_info *);
-void t3_free_sge_resources(adapter_t *);
+void t3_free_sge_resources(adapter_t *, int);
 void t3_sge_start(adapter_t *);
 void t3_sge_stop(adapter_t *);
 void t3b_intr(void *data);

Modified: head/sys/dev/cxgb/cxgb_main.c
==
--- head/sys/dev/cxgb/cxgb_main.c   Thu Mar 24 01:13:28 2011
(r219945)
+++ head/sys/dev/cxgb/cxgb_main.c   Thu Mar 24 01:16:48 2011
(r219946)
@@ -717,7 +717,7 @@ cxgb_controller_detach(device_t dev)
 static void
 cxgb_free(struct adapter *sc)
 {
-   int i;
+   int i, nqsets = 0;
 
ADAPTER_LOCK(sc);
sc-flags |= CXGB_SHUTDOWN;
@@ -731,6 +731,7 @@ cxgb_free(struct adapter *sc)
if (sc-portdev[i] 
device_delete_child(sc-dev, sc-portdev[i]) != 0)
device_printf(sc-dev, failed to delete child port\n);
+   nqsets += sc-port[i].nqsets;
}
 
/*
@@ -756,7 +757,7 @@ cxgb_free(struct adapter *sc)
 * sysctls are cleaned up by the kernel linker.
 */
if (sc-flags  FULL_INIT_DONE) {
-   t3_free_sge_resources(sc);
+   t3_free_sge_resources(sc, nqsets);
sc-flags = ~FULL_INIT_DONE;
}
 
@@ -842,9 +843,9 @@ setup_sge_qsets(adapter_t *sc)
(sc-flags  USING_MSIX) ? qset_idx + 1 : irq_idx,
sc-params.sge.qset[qset_idx], ntxq, pi);
if (err) {
-   t3_free_sge_resources(sc);
-   device_printf(sc-dev, t3_sge_alloc_qset 
failed with %d\n,
-   err);
+   t3_free_sge_resources(sc, qset_idx);
+   device_printf(sc-dev,
+   t3_sge_alloc_qset failed with %d\n, err);
return (err);
}
}

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cThu Mar 24 01:13:28 2011
(r219945)
+++ head/sys/dev/cxgb/cxgb_sge.cThu Mar 24 01:16:48 2011
(r219946)
@@ -2092,18 +2092,14 @@ t3_free_qset(adapter_t *sc, struct sge_q
  * Frees resources used by the SGE queue sets.
  */
 void
-t3_free_sge_resources(adapter_t *sc)
+t3_free_sge_resources(adapter_t *sc, int nqsets)
 {
-   int i, nqsets;
-   
-   for (nqsets = i = 0; i  (sc)-params.nports; i++) 
-   nqsets += sc-port[i].nqsets;
+   int i;
 
for (i = 0; i  nqsets; ++i) {
TXQ_LOCK(sc-sge.qs[i]);
t3_free_qset(sc, sc-sge.qs[i]);
}
-   
 }
 
 /**
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org