svn commit: r272056 - head/contrib/atf

2014-09-24 Thread Garrett Cooper
Author: ngie
Date: Wed Sep 24 06:50:14 2014
New Revision: 272056
URL: http://svnweb.freebsd.org/changeset/base/272056

Log:
  Fix a typo in the upgrade directions
  
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/atf/FREEBSD-upgrade

Modified: head/contrib/atf/FREEBSD-upgrade
==
--- head/contrib/atf/FREEBSD-upgradeWed Sep 24 04:45:35 2014
(r272055)
+++ head/contrib/atf/FREEBSD-upgradeWed Sep 24 06:50:14 2014
(r272056)
@@ -41,7 +41,7 @@ the vendor branch as you easily risk com
 tree.
 
 Lastly, with the list of old and new files in this import, make sure
-to udpate the reachover Makefiles accordingly.
+to update the reachover Makefiles accordingly.
 
 Test the build (keeping in mind the WITH_TESTS/WITHOUT_TESTS knobs) and,
 if all looks good, you are ready to commit all the changes in one go.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272057 - in head: . contrib/pjdfstest tools/regression/pjdfstest

2014-09-24 Thread Garrett Cooper
Author: ngie
Date: Wed Sep 24 07:00:35 2014
New Revision: 272057
URL: http://svnweb.freebsd.org/changeset/base/272057

Log:
  Import pjdfstest from 
^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91
  
  - Remove tools/regression/pjdfstest
  - Add upgrade directions for contrib/pjdfstest
  - Add a note to UPDATING for the move (the reachover Makefiles are coming
soon)
  
  Functional differences:
  - ftruncate testcases are added from upstream (github)
  
  Non-functional differences:
  - The copyright for the project has been updated to 2012
  - pjd's contact information has been updated
  
  Discussed with: -testing, jmmv, pjd
  MFC after: 2 weeks
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/contrib/pjdfstest/
 - copied from r272055, 
vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91/
  head/contrib/pjdfstest/FREEBSD-upgrade
Deleted:
  head/tools/regression/pjdfstest/
Modified:
  head/UPDATING

Modified: head/UPDATING
==
--- head/UPDATING   Wed Sep 24 06:50:14 2014(r272056)
+++ head/UPDATING   Wed Sep 24 07:00:35 2014(r272057)
@@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11
disable the most expensive debugging functionality run
ln -s 'abort:false,junk:false' /etc/malloc.conf.)
 
+20140923:
+   pjdfstest has been moved from tools/regression/pjdfstest to
+   contrib/pjdfstest .
+
 20140922:
At svn r271982, The default linux compat kernel ABI has been adjusted
to 2.6.18 in support of the linux-c6 compat ports infrastructure

Added: head/contrib/pjdfstest/FREEBSD-upgrade
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/contrib/pjdfstest/FREEBSD-upgrade  Wed Sep 24 07:00:35 2014
(r272057)
@@ -0,0 +1,25 @@
+$FreeBSD$
+
+This document contains a collection of notes specific to the import
+of pjdfstest into head.  These notes are built on the instructions in
+the FreeBSD Subversion Primer that detail how to deal with vendor
+branches and you are supposed to follow those:
+
+   
http://www.freebsd.org/doc/en/articles/committers-guide/subversion-primer.html
+
+The pjdfstest source code is hosted on GitHub:
+
+   https://github.com/pjd/pjdfstest
+
+and is imported into the pjdfstest vendor branch (see base/vendor/pjdfstest/).
+
+To merge the vendor branch into head do something like this:
+
+   cd .../base/head/contrib/pjdfstest
+   svn merge --accept=postpone \
+   svn+ssh://svn.freebsd.org/base/vendor/pjdfstest/dist .
+
+and resolve any conflicts that may arise at this point.
+
+Lastly, with the list of old and new files in this import, make sure
+to update the reachover Makefiles accordingly.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


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

2014-09-24 Thread Alexander Motin
Author: mav
Date: Wed Sep 24 08:18:11 2014
New Revision: 272059
URL: http://svnweb.freebsd.org/changeset/base/272059

Log:
  Remake Linux' SOUND_MIXER_INFO IOCTL as a wrapper around new FreeBSD's one.
  
  Submitted by: Dmitry Luhtionov dmitryluhtio...@gmail.com
  MFC after:3 days

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

Modified: head/sys/compat/linux/linux_ioctl.c
==
--- head/sys/compat/linux/linux_ioctl.c Wed Sep 24 07:29:07 2014
(r272058)
+++ head/sys/compat/linux/linux_ioctl.c Wed Sep 24 08:18:11 2014
(r272059)
@@ -1699,13 +1699,6 @@ linux_ioctl_vfat(struct thread *td, stru
  * Sound related ioctls
  */
 
-struct linux_mixer_info {
-   charid[16];
-   charname[32];
-   int modify_counter;
-   int fillers[10];
-};
-
 struct linux_old_mixer_info {
charid[16];
charname[32];
@@ -1793,12 +1786,8 @@ linux_ioctl_sound(struct thread *td, str
/* Key on encoded length */
switch ((args-cmd  16)  0x1fff) {
case 0x005c: {  /* SOUND_MIXER_INFO */
-   struct linux_mixer_info info;
-   bzero(info, sizeof(info));
-   strncpy(info.id, OSS, sizeof(info.id) - 1);
-   strncpy(info.name, FreeBSD OSS Mixer, 
sizeof(info.name) - 1);
-   copyout(info, (void *)args-arg, sizeof(info));
-   return (0);
+   args-cmd = SOUND_MIXER_INFO;
+   return (sys_ioctl(td, (struct ioctl_args *)args));
}
case 0x0030: {  /* SOUND_OLD_MIXER_INFO */
struct linux_old_mixer_info info;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272060 - head/sys/ofed/drivers/net/mlx4

2014-09-24 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Sep 24 08:28:34 2014
New Revision: 272060
URL: http://svnweb.freebsd.org/changeset/base/272060

Log:
  Update code to use new network counter API.
  Fix some minor compile warnings while at it.
  
  Sponsored by: Mellanox Technologies
  Suggested by: glebius@
  MFC after:1 week

Modified:
  head/sys/ofed/drivers/net/mlx4/en_port.c
  head/sys/ofed/drivers/net/mlx4/en_tx.c
  head/sys/ofed/drivers/net/mlx4/fw.h
  head/sys/ofed/drivers/net/mlx4/mlx4_en.h
  head/sys/ofed/drivers/net/mlx4/resource_tracker.c

Modified: head/sys/ofed/drivers/net/mlx4/en_port.c
==
--- head/sys/ofed/drivers/net/mlx4/en_port.cWed Sep 24 08:18:11 2014
(r272059)
+++ head/sys/ofed/drivers/net/mlx4/en_port.cWed Sep 24 08:28:34 2014
(r272060)
@@ -546,17 +546,27 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_e
}
 
if (!mlx4_is_mfunc(mdev-dev)) {
-   /* netdevice stats format */
-dev = mdev-pndev[port];
-   dev-if_ipackets= priv-pkstats.rx_packets;
-   dev-if_opackets= priv-pkstats.tx_packets;
-   dev-if_ibytes  = priv-pkstats.rx_bytes;
-   dev-if_obytes  = priv-pkstats.tx_bytes;
-   dev-if_ierrors = priv-pkstats.rx_errors;
-   dev-if_iqdrops = priv-pkstats.rx_dropped;
-   dev-if_imcasts = priv-pkstats.rx_multicast_packets;
-dev-if_omcasts = priv-pkstats.tx_multicast_packets;
-dev-if_collisions  = 0;
+   if (reset == 0) {
+   /* netdevice stats format */
+   dev = mdev-pndev[port];
+   if_inc_counter(dev, IFCOUNTER_IPACKETS,
+   priv-pkstats.rx_packets - 
priv-pkstats_last.rx_packets);
+   if_inc_counter(dev, IFCOUNTER_OPACKETS,
+   priv-pkstats.tx_packets - 
priv-pkstats_last.tx_packets);
+   if_inc_counter(dev, IFCOUNTER_IBYTES,
+   priv-pkstats.rx_bytes - 
priv-pkstats_last.rx_bytes);
+   if_inc_counter(dev, IFCOUNTER_OBYTES,
+   priv-pkstats.tx_bytes - 
priv-pkstats_last.tx_bytes);
+   if_inc_counter(dev, IFCOUNTER_IERRORS,
+   priv-pkstats.rx_errors - 
priv-pkstats_last.rx_errors);
+   if_inc_counter(dev, IFCOUNTER_IQDROPS,
+   priv-pkstats.rx_dropped - 
priv-pkstats_last.rx_dropped);
+   if_inc_counter(dev, IFCOUNTER_IMCASTS,
+   priv-pkstats.rx_multicast_packets - 
priv-pkstats_last.rx_multicast_packets);
+   if_inc_counter(dev, IFCOUNTER_OMCASTS,
+   priv-pkstats.tx_multicast_packets - 
priv-pkstats_last.tx_multicast_packets);
+   }
+   priv-pkstats_last = priv-pkstats;
}
 
spin_unlock(priv-stats_lock);

Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c
==
--- head/sys/ofed/drivers/net/mlx4/en_tx.c  Wed Sep 24 08:18:11 2014
(r272059)
+++ head/sys/ofed/drivers/net/mlx4/en_tx.c  Wed Sep 24 08:28:34 2014
(r272060)
@@ -1028,9 +1028,6 @@ mlx4_en_transmit_locked(struct ifnet *de
}
drbr_advance(dev, ring-br);
enqueued++;
-   dev-if_obytes += next-m_pkthdr.len;
-   if (next-m_flags  M_MCAST)
-   if_inc_counter(dev, IFCOUNTER_OMCASTS, 1);
if ((dev-if_drv_flags  IFF_DRV_RUNNING) == 0)
break;
}

Modified: head/sys/ofed/drivers/net/mlx4/fw.h
==
--- head/sys/ofed/drivers/net/mlx4/fw.h Wed Sep 24 08:18:11 2014
(r272059)
+++ head/sys/ofed/drivers/net/mlx4/fw.h Wed Sep 24 08:28:34 2014
(r272060)
@@ -223,8 +223,6 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev,
 int mlx4_CLOSE_HCA(struct mlx4_dev *dev, int panic);
 int mlx4_map_cmd(struct mlx4_dev *dev, u16 op, struct mlx4_icm *icm, u64 virt);
 int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
-int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
-int mlx4_UNMAP_ICM_AUX(struct mlx4_dev *dev);
 int mlx4_NOP(struct mlx4_dev *dev);
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
 void mlx4_opreq_action(struct work_struct *work);

Modified: head/sys/ofed/drivers/net/mlx4/mlx4_en.h
==
--- head/sys/ofed/drivers/net/mlx4/mlx4_en.hWed Sep 24 08:18:11 2014
(r272059)
+++ head/sys/ofed/drivers/net/mlx4/mlx4_en.h

svn commit: r272064 - head/sys/dev/et

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Wed Sep 24 11:23:55 2014
New Revision: 272064
URL: http://svnweb.freebsd.org/changeset/base/272064

Log:
  - Provide igb_get_counter() to return counters that are not collected,
but taken from hardware.
  - Mechanically convert to if_inc_counter() the rest of counters.

Modified:
  head/sys/dev/et/if_et.c

Modified: head/sys/dev/et/if_et.c
==
--- head/sys/dev/et/if_et.c Wed Sep 24 09:59:48 2014(r272063)
+++ head/sys/dev/et/if_et.c Wed Sep 24 11:23:55 2014(r272064)
@@ -104,6 +104,7 @@ static int  et_watchdog(struct et_softc *
 static int et_ifmedia_upd_locked(struct ifnet *);
 static int et_ifmedia_upd(struct ifnet *);
 static voidet_ifmedia_sts(struct ifnet *, struct ifmediareq *);
+static uint64_tet_get_counter(struct ifnet *, ift_counter);
 
 static voidet_add_sysctls(struct et_softc *);
 static int et_sysctl_rx_intr_npkts(SYSCTL_HANDLER_ARGS);
@@ -324,6 +325,7 @@ et_attach(device_t dev)
ifp-if_init = et_init;
ifp-if_ioctl = et_ioctl;
ifp-if_start = et_start;
+   ifp-if_get_counter = et_get_counter;
ifp-if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU;
ifp-if_capenable = ifp-if_capabilities;
ifp-if_snd.ifq_drv_maxlen = ET_TX_NDESC - 1;
@@ -1413,7 +1415,7 @@ et_start_locked(struct ifnet *ifp)
 
if (et_encap(sc, m_head)) {
if (m_head == NULL) {
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
break;
}
IFQ_DRV_PREPEND(ifp-if_snd, m_head);
@@ -1465,7 +1467,7 @@ et_watchdog(struct et_softc *sc)
if_printf(sc-ifp, watchdog timed out (0x%08x) -- resetting\n,
status);
 
-   sc-ifp-if_oerrors++;
+   if_inc_counter(sc-ifp, IFCOUNTER_OERRORS, 1);
sc-ifp-if_drv_flags = ~IFF_DRV_RUNNING;
et_init_locked(sc);
return (EJUSTRETURN);
@@ -2093,12 +2095,12 @@ et_rxeof(struct et_softc *sc)
CSR_WRITE_4(sc, ET_RXSTAT_POS, rxstat_pos);
 
if (ring_idx = ET_RX_NRING) {
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
if_printf(ifp, invalid ring index %d\n, ring_idx);
continue;
}
if (buf_idx = ET_RX_NDESC) {
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
if_printf(ifp, invalid buf index %d\n, buf_idx);
continue;
}
@@ -2110,13 +2112,13 @@ et_rxeof(struct et_softc *sc)
rbd-rbd_discard(rbd, buf_idx);
} else if (rbd-rbd_newbuf(rbd, buf_idx) != 0) {
/* No available mbufs, discard it. */
-   ifp-if_iqdrops++;
+   if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
rbd-rbd_discard(rbd, buf_idx);
} else {
buflen -= ETHER_CRC_LEN;
if (buflen  ETHER_HDR_LEN) {
m_freem(m);
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
} else {
m-m_pkthdr.len = m-m_len = buflen;
m-m_pkthdr.rcvif = ifp;
@@ -2625,7 +2627,6 @@ back:
 static void
 et_stats_update(struct et_softc *sc)
 {
-   struct ifnet *ifp;
struct et_hw_stats *stats;
 
stats = sc-sc_stats;
@@ -2675,18 +2676,35 @@ et_stats_update(struct et_softc *sc)
stats-tx_oversize += CSR_READ_4(sc, ET_STAT_TX_OVERSIZE);
stats-tx_undersize += CSR_READ_4(sc, ET_STAT_TX_UNDERSIZE);
stats-tx_fragments += CSR_READ_4(sc, ET_STAT_TX_FRAG);
+}
 
-   /* Update ifnet counters. */
-   ifp = sc-ifp;
-   ifp-if_opackets = (u_long)stats-tx_frames;
-   ifp-if_collisions = stats-tx_total_colls;
-   ifp-if_oerrors = stats-tx_drop + stats-tx_jabbers +
-   stats-tx_crcerrs + stats-tx_excess_deferred +
-   stats-tx_late_colls;
-   ifp-if_ipackets = (u_long)stats-rx_frames;
-   ifp-if_ierrors = stats-rx_crcerrs + stats-rx_alignerrs +
-   stats-rx_lenerrs + stats-rx_codeerrs + stats-rx_cserrs +
-   stats-rx_runts + stats-rx_jabbers + stats-rx_drop;
+static uint64_t
+et_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+   struct et_softc *sc;
+   struct et_hw_stats *stats;
+
+   sc = if_getsoftc(ifp);
+   stats = sc-sc_stats;
+
+   switch (cnt) {
+   case IFCOUNTER_OPACKETS:
+   return (stats-tx_frames);
+   case IFCOUNTER_COLLISIONS:
+   return 

Re: svn commit: r272064 - head/sys/dev/et

2014-09-24 Thread Gleb Smirnoff
On Wed, Sep 24, 2014 at 11:23:56AM +, Gleb Smirnoff wrote:
T Author: glebius
T Date: Wed Sep 24 11:23:55 2014
T New Revision: 272064
T URL: http://svnweb.freebsd.org/changeset/base/272064
T 
T Log:
T   - Provide igb_get_counter() to return counters that are not collected,
T but taken from hardware.

Of course name should have been not igb_get_counter, but et_get_counter.

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


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

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Wed Sep 24 11:31:46 2014
New Revision: 272065
URL: http://svnweb.freebsd.org/changeset/base/272065

Log:
  - Provide vte_get_counter() to return counters that are not collected,
but taken from hardware.
  - Mechanically convert to if_inc_counter() the rest of counters.

Modified:
  head/sys/dev/vte/if_vte.c

Modified: head/sys/dev/vte/if_vte.c
==
--- head/sys/dev/vte/if_vte.c   Wed Sep 24 11:23:55 2014(r272064)
+++ head/sys/dev/vte/if_vte.c   Wed Sep 24 11:31:46 2014(r272065)
@@ -109,6 +109,7 @@ static int  vte_init_rx_ring(struct vte_s
 static int vte_init_tx_ring(struct vte_softc *);
 static voidvte_intr(void *);
 static int vte_ioctl(struct ifnet *, u_long, caddr_t);
+static uint64_tvte_get_counter(struct ifnet *, ift_counter);
 static voidvte_mac_config(struct vte_softc *);
 static int vte_miibus_readreg(device_t, int, int);
 static voidvte_miibus_statchg(device_t);
@@ -449,6 +450,7 @@ vte_attach(device_t dev)
ifp-if_ioctl = vte_ioctl;
ifp-if_start = vte_start;
ifp-if_init = vte_init;
+   ifp-if_get_counter = vte_get_counter;
ifp-if_snd.ifq_drv_maxlen = VTE_TX_RING_CNT - 1;
IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
IFQ_SET_READY(ifp-if_snd);
@@ -1171,7 +1173,7 @@ vte_watchdog(struct vte_softc *sc)
 
ifp = sc-vte_ifp;
if_printf(sc-vte_ifp, watchdog timeout -- resetting\n);
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp-if_drv_flags = ~IFF_DRV_RUNNING;
vte_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(ifp-if_snd))
@@ -1272,12 +1274,10 @@ static void
 vte_stats_update(struct vte_softc *sc)
 {
struct vte_hw_stats *stat;
-   struct ifnet *ifp;
uint16_t value;
 
VTE_LOCK_ASSERT(sc);
 
-   ifp = sc-vte_ifp;
stat = sc-vte_stats;
 
CSR_READ_2(sc, VTE_MECISR);
@@ -1304,14 +1304,32 @@ vte_stats_update(struct vte_softc *sc)
value = CSR_READ_2(sc, VTE_CNT_PAUSE);
stat-tx_pause_frames += (value  8);
stat-rx_pause_frames += (value  0xFF);
+}
 
-   /* Update ifp counters. */
-   ifp-if_opackets = stat-tx_frames;
-   ifp-if_collisions = stat-tx_late_colls;
-   ifp-if_oerrors = stat-tx_late_colls + stat-tx_underruns;
-   ifp-if_ipackets = stat-rx_frames;
-   ifp-if_ierrors = stat-rx_crcerrs + stat-rx_runts +
-   stat-rx_long_frames + stat-rx_fifo_full;
+static uint64_t
+vte_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+   struct vte_softc *sc;
+   struct vte_hw_stats *stat;
+
+   sc = if_getsoftc(ifp);
+   stat = sc-vte_stats;
+
+   switch (cnt) {
+   case IFCOUNTER_OPACKETS:
+   return (stat-tx_frames);
+   case IFCOUNTER_COLLISIONS:
+   return (stat-tx_late_colls);
+   case IFCOUNTER_OERRORS:
+   return (stat-tx_late_colls + stat-tx_underruns);
+   case IFCOUNTER_IPACKETS:
+   return (stat-rx_frames);
+   case IFCOUNTER_IERRORS:
+   return (stat-rx_crcerrs + stat-rx_runts +
+   stat-rx_long_frames + stat-rx_fifo_full);
+   default:
+   return (if_get_counter_default(ifp, cnt));
+   }
 }
 
 static void
@@ -1503,7 +1521,7 @@ vte_rxeof(struct vte_softc *sc)
continue;
}
if (vte_newbuf(sc, rxd) != 0) {
-   ifp-if_iqdrops++;
+   if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
rxd-rx_desc-drlen =
htole16(MCLBYTES - sizeof(uint32_t));
rxd-rx_desc-drst = htole16(VTE_DRST_RX_OWN);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272066 - head/sys/dev/jme

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Wed Sep 24 11:33:43 2014
New Revision: 272066
URL: http://svnweb.freebsd.org/changeset/base/272066

Log:
  Mechanically convert to if_inc_counter().

Modified:
  head/sys/dev/jme/if_jme.c

Modified: head/sys/dev/jme/if_jme.c
==
--- head/sys/dev/jme/if_jme.c   Wed Sep 24 11:31:46 2014(r272065)
+++ head/sys/dev/jme/if_jme.c   Wed Sep 24 11:33:43 2014(r272066)
@@ -1947,7 +1947,7 @@ jme_watchdog(struct jme_softc *sc)
ifp = sc-jme_ifp;
if ((sc-jme_flags  JME_FLAG_LINK) == 0) {
if_printf(sc-jme_ifp, watchdog timeout (missed link)\n);
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp-if_drv_flags = ~IFF_DRV_RUNNING;
jme_init_locked(sc);
return;
@@ -1962,7 +1962,7 @@ jme_watchdog(struct jme_softc *sc)
}
 
if_printf(sc-jme_ifp, watchdog timeout\n);
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp-if_drv_flags = ~IFF_DRV_RUNNING;
jme_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(ifp-if_snd))
@@ -2281,7 +2281,7 @@ jme_link_task(void *arg, int pending)
m_freem(txd-tx_m);
txd-tx_m = NULL;
txd-tx_ndesc = 0;
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
}
}
}
@@ -2449,13 +2449,13 @@ jme_txeof(struct jme_softc *sc)
break;
 
if ((status  (JME_TD_TMOUT | JME_TD_RETRY_EXP)) != 0)
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
else {
-   ifp-if_opackets++;
+   if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
if ((status  JME_TD_COLLISION) != 0)
-   ifp-if_collisions +=
+   if_inc_counter(ifp, IFCOUNTER_COLLISIONS,
le32toh(txd-tx_desc-buflen) 
-   JME_TD_BUF_LEN_MASK;
+   JME_TD_BUF_LEN_MASK);
}
/*
 * Only the first descriptor of multi-descriptor
@@ -2526,7 +2526,7 @@ jme_rxeof(struct jme_softc *sc)
nsegs = JME_RX_NSEGS(status);
sc-jme_cdata.jme_rxlen = JME_RX_BYTES(status) - JME_RX_PAD_BYTES;
if ((status  JME_RX_ERR_STAT) != 0) {
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
jme_discard_rxbuf(sc, sc-jme_cdata.jme_rx_cons);
 #ifdef JME_SHOW_ERRORS
device_printf(sc-jme_dev, %s : receive error = 0x%b\n,
@@ -2543,7 +2543,7 @@ jme_rxeof(struct jme_softc *sc)
mp = rxd-rx_m;
/* Add a new receive buffer to the ring. */
if (jme_newbuf(sc, rxd) != 0) {
-   ifp-if_iqdrops++;
+   if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
/* Reuse buffer. */
for (; count  nsegs; count++) {
jme_discard_rxbuf(sc, cons);
@@ -2626,7 +2626,7 @@ jme_rxeof(struct jme_softc *sc)
m-m_flags |= M_VLANTAG;
}
 
-   ifp-if_ipackets++;
+   if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
/* Pass it on. */
JME_UNLOCK(sc);
(*ifp-if_input)(ifp, m);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272067 - head/sys/dev/txp

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Wed Sep 24 11:58:23 2014
New Revision: 272067
URL: http://svnweb.freebsd.org/changeset/base/272067

Log:
  - Provide txp_get_counter() to return counters that are not collected,
but taken from hardware.
  - Mechanically convert to if_inc_counter() the rest of counters.

Modified:
  head/sys/dev/txp/if_txp.c

Modified: head/sys/dev/txp/if_txp.c
==
--- head/sys/dev/txp/if_txp.c   Wed Sep 24 11:33:43 2014(r272066)
+++ head/sys/dev/txp/if_txp.c   Wed Sep 24 11:58:23 2014(r272067)
@@ -149,6 +149,7 @@ static int txp_intr(void *);
 static void txp_int_task(void *, int);
 static void txp_tick(void *);
 static int txp_ioctl(struct ifnet *, u_long, caddr_t);
+static uint64_t txp_get_counter(struct ifnet *, ift_counter);
 static void txp_start(struct ifnet *);
 static void txp_start_locked(struct ifnet *);
 static int txp_encap(struct txp_softc *, struct txp_tx_ring *, struct mbuf **);
@@ -413,6 +414,7 @@ txp_attach(device_t dev)
ifp-if_ioctl = txp_ioctl;
ifp-if_start = txp_start;
ifp-if_init = txp_init;
+   ifp-if_get_counter = txp_get_counter;
ifp-if_snd.ifq_drv_maxlen = TX_ENTRIES - 1;
IFQ_SET_MAXLEN(ifp-if_snd, ifp-if_snd.ifq_drv_maxlen);
IFQ_SET_READY(ifp-if_snd);
@@ -2540,7 +2542,7 @@ txp_watchdog(struct txp_softc *sc)
 
ifp = sc-sc_ifp;
if_printf(ifp, watchdog timeout -- resetting\n);
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
txp_stop(sc);
txp_init_locked(sc);
 }
@@ -2816,13 +2818,11 @@ out:
 static void
 txp_stats_update(struct txp_softc *sc, struct txp_rsp_desc *rsp)
 {
-   struct ifnet *ifp;
struct txp_hw_stats *ostats, *stats;
struct txp_ext_desc *ext;
 
TXP_LOCK_ASSERT(sc);
 
-   ifp = sc-sc_ifp;
ext = (struct txp_ext_desc *)(rsp + 1);
ostats = sc-sc_ostats;
stats = sc-sc_stats;
@@ -2856,15 +2856,34 @@ txp_stats_update(struct txp_softc *sc, s
le32toh(ext[4].ext_3);
stats-rx_oflows = ostats-rx_oflows + le32toh(ext[4].ext_4);
stats-rx_filtered = ostats-rx_filtered + le32toh(ext[5].ext_1);
+}
 
-   ifp-if_ierrors = stats-rx_fifo_oflows + stats-rx_badssd +
-   stats-rx_crcerrs + stats-rx_lenerrs + stats-rx_oflows;
-   ifp-if_oerrors = stats-tx_deferred + stats-tx_carrier_lost +
-   stats-tx_fifo_underruns + stats-tx_mcast_oflows;
-   ifp-if_collisions = stats-tx_late_colls + stats-tx_multi_colls +
-   stats-tx_excess_colls;
-   ifp-if_opackets = stats-tx_frames;
-   ifp-if_ipackets = stats-rx_frames;
+static uint64_t
+txp_get_counter(struct ifnet *ifp, ift_counter cnt)
+{
+   struct txp_softc *sc;
+   struct txp_hw_stats *stats;
+
+   sc = if_getsoftc(ifp);
+   stats = sc-sc_stats;
+
+   switch (cnt) {
+   case IFCOUNTER_IERRORS:
+   return (stats-rx_fifo_oflows + stats-rx_badssd +
+   stats-rx_crcerrs + stats-rx_lenerrs + stats-rx_oflows);
+   case IFCOUNTER_OERRORS:
+   return (stats-tx_deferred + stats-tx_carrier_lost +
+   stats-tx_fifo_underruns + stats-tx_mcast_oflows);
+   case IFCOUNTER_COLLISIONS:
+   return (stats-tx_late_colls + stats-tx_multi_colls +
+   stats-tx_excess_colls);
+   case IFCOUNTER_OPACKETS:
+   return (stats-tx_frames);
+   case IFCOUNTER_IPACKETS:
+   return (stats-rx_frames);
+   default:
+   return (if_get_counter_default(ifp, cnt));
+   }
 }
 
 #defineTXP_SYSCTL_STAT_ADD32(c, h, n, p, d)\
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272068 - head/sys/dev/wi

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Wed Sep 24 12:19:00 2014
New Revision: 272068
URL: http://svnweb.freebsd.org/changeset/base/272068

Log:
  - Provide wi_get_counter() to return counters that are not collected,
but taken from hardware.
  - Mechanically convert to if_inc_counter() the rest of counters.

Modified:
  head/sys/dev/wi/if_wi.c

Modified: head/sys/dev/wi/if_wi.c
==
--- head/sys/dev/wi/if_wi.c Wed Sep 24 11:58:23 2014(r272067)
+++ head/sys/dev/wi/if_wi.c Wed Sep 24 12:19:00 2014(r272068)
@@ -132,6 +132,7 @@ static int  wi_reset(struct wi_softc *);
 static void wi_watchdog(void *);
 static int  wi_ioctl(struct ifnet *, u_long, caddr_t);
 static void wi_media_status(struct ifnet *, struct ifmediareq *);
+static uint64_t wi_get_counter(struct ifnet *, ift_counter);
 
 static void wi_rx_intr(struct wi_softc *);
 static void wi_tx_intr(struct wi_softc *);
@@ -337,6 +338,7 @@ wi_attach(device_t dev)
ifp-if_ioctl = wi_ioctl;
ifp-if_start = wi_start;
ifp-if_init = wi_init;
+   ifp-if_get_counter = wi_get_counter;
IFQ_SET_MAXLEN(ifp-if_snd, ifqmaxlen);
ifp-if_snd.ifq_drv_maxlen = ifqmaxlen;
IFQ_SET_READY(ifp-if_snd);
@@ -1028,7 +1030,7 @@ wi_start_locked(struct ifnet *ifp)
continue;
 
sc-sc_txnext = cur = (cur + 1) % sc-sc_ntxbuf;
-   ifp-if_opackets++;
+   if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
}
 }
 
@@ -1055,7 +1057,7 @@ wi_start_tx(struct ifnet *ifp, struct wi
 || wi_mwrite_bap(sc, fid, off, m0, m0-m_pkthdr.len) != 0;
m_freem(m0);
if (error) {
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
return -1;
}
sc-sc_txd[cur].d_len = off;
@@ -1182,7 +1184,7 @@ wi_watchdog(void *arg)
 
if (sc-sc_tx_timer  --sc-sc_tx_timer == 0) {
if_printf(ifp, device timeout\n);
-   ifp-if_oerrors++;
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
wi_init_locked(ifp-if_softc);
return;
}
@@ -1327,7 +1329,7 @@ wi_rx_intr(struct wi_softc *sc)
/* First read in the frame header */
if (wi_read_bap(sc, fid, 0, frmhdr, sizeof(frmhdr))) {
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX);
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
DPRINTF((wi_rx_intr: read fid %x failed\n, fid));
return;
}
@@ -1338,7 +1340,7 @@ wi_rx_intr(struct wi_softc *sc)
status = le16toh(frmhdr.wi_status);
if (status  WI_STAT_ERRSTAT) {
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX);
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
DPRINTF((wi_rx_intr: fid %x error status %x\n, fid, status));
return;
}
@@ -1353,7 +1355,7 @@ wi_rx_intr(struct wi_softc *sc)
if (off + len  MCLBYTES) {
if (ic-ic_opmode != IEEE80211_M_MONITOR) {
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX);
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
DPRINTF((wi_rx_intr: oversized packet\n));
return;
} else
@@ -1366,7 +1368,7 @@ wi_rx_intr(struct wi_softc *sc)
m = m_gethdr(M_NOWAIT, MT_DATA);
if (m == NULL) {
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX);
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
DPRINTF((wi_rx_intr: MGET failed\n));
return;
}
@@ -1450,11 +1452,9 @@ wi_tx_ex_intr(struct wi_softc *sc)
printf(, status=0x%x, status);
printf(\n);
}
-   ifp-if_oerrors++;
-   } else {
+   if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+   } else
DPRINTF((port disconnected\n));
-   ifp-if_collisions++;   /* XXX */
-   }
} else
DPRINTF((wi_tx_ex_intr: read fid %x failed\n, fid));
CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_TX_EXC);
@@ -1497,8 +1497,7 @@ wi_tx_intr(struct wi_softc *sc)
 static __noinline void
 wi_info_intr(struct wi_softc *sc)
 {
-   struct ifnet *ifp = sc-sc_ifp;
-   struct ieee80211com *ic = ifp-if_l2com;
+   struct ieee80211com *ic = sc-sc_ifp-if_l2com;
struct ieee80211vap *vap = TAILQ_FIRST(ic-ic_vaps);
int i, fid, len, off;
u_int16_t ltbuf[2];
@@ -1562,9 +1561,6 @@ wi_info_intr(struct wi_softc *sc)
 #endif
*ptr += stat;
}
-   ifp-if_collisions = 

svn commit: r272069 - head/lib/libthr/thread

2014-09-24 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 24 12:39:12 2014
New Revision: 272069
URL: http://svnweb.freebsd.org/changeset/base/272069

Log:
  Switch the defaults to not split the RLIMIT_STACK-sized initial thread
  stack into the stacks of the created threads.  Add knob
  LIBPTHREAD_SPLITSTACK_MAIN to restore the older behaviour.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks

Modified:
  head/lib/libthr/thread/thr_init.c

Modified: head/lib/libthr/thread/thr_init.c
==
--- head/lib/libthr/thread/thr_init.c   Wed Sep 24 12:19:00 2014
(r272068)
+++ head/lib/libthr/thread/thr_init.c   Wed Sep 24 12:39:12 2014
(r272069)
@@ -445,7 +445,7 @@ init_private(void)
struct rlimit rlim;
size_t len;
int mib[2];
-   char *env;
+   char *env, *env_bigstack, *env_splitstack;
 
_thr_umutex_init(_mutex_static_lock);
_thr_umutex_init(_cond_static_lock);
@@ -473,8 +473,9 @@ init_private(void)
len = sizeof (_usrstack);
if (sysctl(mib, 2, _usrstack, len, NULL, 0) == -1)
PANIC(Cannot get kern.usrstack from sysctl);
-   env = getenv(LIBPTHREAD_BIGSTACK_MAIN);
-   if (env != NULL) {
+   env_bigstack = getenv(LIBPTHREAD_BIGSTACK_MAIN);
+   env_splitstack = getenv(LIBPTHREAD_SPLITSTACK_MAIN);
+   if (env_bigstack != NULL || env_splitstack == NULL) {
if (getrlimit(RLIMIT_STACK, rlim) == -1)
PANIC(Cannot get stack rlimit);
_thr_stack_initial = rlim.rlim_cur;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272070 - head/lib/libthr

2014-09-24 Thread Konstantin Belousov
Author: kib
Date: Wed Sep 24 12:41:39 2014
New Revision: 272070
URL: http://svnweb.freebsd.org/changeset/base/272070

Log:
  Expand the libthr(3) manpage to document knobs accepted by libthr.so
  and explain some internal working of the library, neccessary to
  understand the knobs effects.
  
  Reviewed by:  bjk, pluknet
  Sponsored by: The FreeBSD Foundation
  MFC after:3 weeks

Modified:
  head/lib/libthr/libthr.3

Modified: head/lib/libthr/libthr.3
==
--- head/lib/libthr/libthr.3Wed Sep 24 12:39:12 2014(r272069)
+++ head/lib/libthr/libthr.3Wed Sep 24 12:41:39 2014(r272070)
@@ -1,6 +1,11 @@
 .\ Copyright (c) 2005 Robert N. M. Watson
+.\ Copyright (c) 2014 The FreeBSD Foundation, Inc.
 .\ All rights reserved.
 .\
+.\ Part of this documentation was written by
+.\ Konstantin Belousov k...@freebsd.org under sponsorship
+.\ from the FreeBSD Foundation.
+.\
 .\ Redistribution and use in source and binary forms, with or without
 .\ modification, are permitted provided that the following conditions
 .\ are met:
@@ -24,7 +29,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd October 19, 2007
+.Dd September 20, 2014
 .Dt LIBTHR 3
 .Os
 .Sh NAME
@@ -45,8 +50,216 @@ has been optimized for use by applicatio
 semantics, and can provide significant performance improvements
 compared to
 .Lb libkse .
+.Pp
+The library is tightly integrated with the run-time link editor
+.Xr ld-elf.so.1 1
+and
+.Lb libc ;
+all three components must be built from the same source tree.
+Mixing
+.Li libc
+and
+.Nm
+libraries from different versions of
+.Fx
+is not supported.
+The run-time linker
+.Xr ld-elf.so.1 1
+has some code to ensure backward-compatibility with older versions of
+.Nm .
+.Pp
+The man page documents the quirks and tunables of the
+.Nm .
+When linking with
+.Li -lpthread ,
+the run-time dependency
+.Li libthr.so.3
+is recorded in the produced object.
+.Sh MUTEX ACQUISITION
+A locked mutex (see
+.Xr pthread_mutex_lock 3 )
+is represented by a volatile variable of type
+.Dv lwpid_t ,
+which records the global system identifier of the thread
+owning the lock.
+.Nm
+performs a contested mutex acquisition in three stages, each of which
+is more resource-consuming than the previous.
+.Pp
+First, a spin loop
+is performed, where the library attempts to acquire the lock by
+.Xr atomic 9
+operations.
+The loop count is controlled by the
+.Ev LIBPTHREAD_SPINLOOPS
+environment variable, with a default value of 2000.
+.Pp
+If the spin loop
+was unable to acquire the mutex, a yield loop
+is executed, performing the same
+.Xr atomic 9
+acquisition attempts as the spin loop,
+but each attempt is followed by a yield of the CPU time
+of the thread using the
+.Xr sched_yield 2
+syscall.
+By default, the yield loop
+is not executed.
+This is controlled by the
+.Ev LIBPTHREAD_YIELDLOOPS
+environment variable.
+.Pp
+If both the spin and yield loops
+failed to acquire the lock, the thread is taken off the CPU and
+put to sleep in the kernel with the
+.Xr umtx 2
+syscall.
+The kernel wakes up a thread and hands the ownership of the lock to
+the woken thread when the lock becomes available.
+.Sh THREAD STACKS
+Each thread is provided with a private user-mode stack area
+used by the C runtime.
+The size of the main (initial) thread stack is set by the kernel, and is
+controlled by the
+.Dv RLIMIT_STACK
+process resource limit (see
+.Xr getrlimit 2 ) .
+.Pp
+By default, the main thread's stack size is equal to the value of
+.Dv RLIMIT_STACK
+for the process.
+If the
+.Ev LIBPTHREAD_SPLITSTACK_MAIN
+environment variable is present in the process environment
+(its value does not matter),
+the main thread's stack is reduced to 4MB on 64bit architectures, and to
+2MB on 32bit architectures, when the threading library is initialized.
+The rest of the address space area which has been reserved by the
+kernel for the initial process stack is used for non-initial thread stacks
+in this case.
+The presence of the
+.Ev LIBPTHREAD_BIGSTACK_MAIN
+environment variable overrides
+.Ev LIBPTHREAD_SPLITSTACK_MAIN ;
+it is kept for backward-compatibility.
+.Pp
+The size of stacks for threads created by the process at run-time
+with the
+.Xr pthread_create 3
+call is controlled by thread attributes: see
+.Xr pthread_attr 3 ,
+in particular, the
+.Xr pthread_attr_setstacksize 3 ,
+.Xr pthread_attr_setguardsize 3
+and
+.Xr pthread_attr_setstackaddr 3
+functions.
+If no attributes for the thread stack size are specified, the default
+non-initial thread stack size is 2MB for 64bit architectures, and 1MB
+for 32bit architectures.
+.Sh RUN-TIME SETTINGS
+The following environment variables are recognized by
+.Nm
+and adjust the operation of the library at run-time:
+.Bl -tag -width LIBPTHREAD_SPLITSTACK_MAIN
+.It Ev LIBPTHREAD_BIGSTACK_MAIN
+Disables the reduction of the initial thread stack enabled by
+.Ev LIBPTHREAD_SPLITSTACK_MAIN .
+.It Ev LIBPTHREAD_SPLITSTACK_MAIN
+Causes a 

Re: svn commit: r272032 - head/sys/conf

2014-09-24 Thread John Baldwin
On Tuesday, September 23, 2014 05:04:21 PM Bryan Drewery wrote:
 Author: bdrewery
 Date: Tue Sep 23 17:04:21 2014
 New Revision: 272032
 URL: http://svnweb.freebsd.org/changeset/base/272032
 
 Log:
   DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it.
   fstat(1) now uses libprocstat(9).  There is no userland impact to using
 this.

As your followup noted, it does change the size of 'struct lock' (and thus
'struct vnode') still.  While fstat does not use it for live, it probably
still uses it for coredumps.  However, lsof uses kvm access, so it will break.
I don't think that is worth noting here, but more of an FYI.

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


Re: svn commit: r272032 - head/sys/conf

2014-09-24 Thread John Baldwin
On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote:
 On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote:
  On 9/23/2014 1:20 PM, Konstantin Belousov wrote:
   On Tue, Sep 23, 2014 at 05:04:21PM +, Bryan Drewery wrote:
   Author: bdrewery
   Date: Tue Sep 23 17:04:21 2014
   New Revision: 272032
   URL: http://svnweb.freebsd.org/changeset/base/272032
   
   Log:
 DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use
 it.
 fstat(1) now uses libprocstat(9).  There is no userland impact to
 using this.  
   DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to
   lockmgr, and lockmgr is embedded into each struct vnode.
   
   VFS modules, in particular, filesystems, compiled for mismatched
   kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage.
  
  Well, perhaps the comment needs to be updated to state that
  DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to
  recompiled.
  
  I did see the stack was moved to lockmgr, but given the use of
  libprocstat, and lockmgr being a kernel struct, I don't think it's worth
  mentioning userland here.
  
  Sound good?
 
 I agree, I do not think that userland is affected.

It is for at least lsof (which does not use libprocstat and cannot easily be 
adopted to use it exclusively as it pulls a lot more data out than libprocstat 
exports such as the info about file locks, etc.)

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


Re: svn commit: r272032 - head/sys/conf

2014-09-24 Thread Konstantin Belousov
On Wed, Sep 24, 2014 at 09:58:07AM -0400, John Baldwin wrote:
 On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote:
  On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote:
   On 9/23/2014 1:20 PM, Konstantin Belousov wrote:
On Tue, Sep 23, 2014 at 05:04:21PM +, Bryan Drewery wrote:
Author: bdrewery
Date: Tue Sep 23 17:04:21 2014
New Revision: 272032
URL: http://svnweb.freebsd.org/changeset/base/272032

Log:
  DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use
  it.
  fstat(1) now uses libprocstat(9).  There is no userland impact to
  using this.  
DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to
lockmgr, and lockmgr is embedded into each struct vnode.

VFS modules, in particular, filesystems, compiled for mismatched
kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage.
   
   Well, perhaps the comment needs to be updated to state that
   DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to
   recompiled.
   
   I did see the stack was moved to lockmgr, but given the use of
   libprocstat, and lockmgr being a kernel struct, I don't think it's worth
   mentioning userland here.
   
   Sound good?
  
  I agree, I do not think that userland is affected.
 
 It is for at least lsof (which does not use libprocstat and cannot easily be 
 adopted to use it exclusively as it pulls a lot more data out than 
 libprocstat 
 exports such as the info about file locks, etc.)

We cannot seriously consider the lsof as application which uses
stable interfaces.  I.e., binary incompatibility for lsof even
on the stable branch or on -pX is not an issue.

Lsof verifies kernel release name and warns if it differs from the
one used at the compilation time, rightfully.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272071 - head/sys/vm

2014-09-24 Thread Steven Hartland
Author: smh
Date: Wed Sep 24 14:35:08 2014
New Revision: 272071
URL: http://svnweb.freebsd.org/changeset/base/272071

Log:
  Fix ticks wrap issue of lowmem test in vm_pageout_scan
  
  Reviewed by:  jhb (D818)
  MFC after:3 days
  Sponsored by: Multiplay

Modified:
  head/sys/vm/vm_pageout.c

Modified: head/sys/vm/vm_pageout.c
==
--- head/sys/vm/vm_pageout.cWed Sep 24 12:41:39 2014(r272070)
+++ head/sys/vm/vm_pageout.cWed Sep 24 14:35:08 2014(r272071)
@@ -916,7 +916,7 @@ vm_pageout_scan(struct vm_domain *vmd, i
 * some.  We rate limit to avoid thrashing.
 */
if (vmd == vm_dom[0]  pass  0 
-   lowmem_ticks + (lowmem_period * hz)  ticks) {
+   (ticks - lowmem_ticks) / hz = lowmem_period) {
/*
 * Decrease registered cache sizes.
 */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r272032 - head/sys/conf

2014-09-24 Thread John Baldwin
On Wednesday, September 24, 2014 05:23:39 PM Konstantin Belousov wrote:
 On Wed, Sep 24, 2014 at 09:58:07AM -0400, John Baldwin wrote:
  On Tuesday, September 23, 2014 09:44:34 PM Konstantin Belousov wrote:
   On Tue, Sep 23, 2014 at 01:31:42PM -0500, Bryan Drewery wrote:
On 9/23/2014 1:20 PM, Konstantin Belousov wrote:
 On Tue, Sep 23, 2014 at 05:04:21PM +, Bryan Drewery wrote:
 Author: bdrewery
 Date: Tue Sep 23 17:04:21 2014
 New Revision: 272032
 URL: http://svnweb.freebsd.org/changeset/base/272032
 
 Log:
   DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1)
   use
   it.
   fstat(1) now uses libprocstat(9).  There is no userland impact to
   using this. 
 
 DEBUG_VFS_LOCKS does modify KBI of VFS, by adding struct stack to
 lockmgr, and lockmgr is embedded into each struct vnode.
 
 VFS modules, in particular, filesystems, compiled for mismatched
 kernel WRT DEBUG_VFS_LOCKS, would cause strange breakage.

Well, perhaps the comment needs to be updated to state that
DEBUG_VFS_LOCKS modifies VFS KBI so any VFS modules will need to
recompiled.

I did see the stack was moved to lockmgr, but given the use of
libprocstat, and lockmgr being a kernel struct, I don't think it's
worth
mentioning userland here.

Sound good?
   
   I agree, I do not think that userland is affected.
  
  It is for at least lsof (which does not use libprocstat and cannot easily
  be adopted to use it exclusively as it pulls a lot more data out than
  libprocstat exports such as the info about file locks, etc.)
 
 We cannot seriously consider the lsof as application which uses
 stable interfaces.  I.e., binary incompatibility for lsof even
 on the stable branch or on -pX is not an issue.
 
 Lsof verifies kernel release name and warns if it differs from the
 one used at the compilation time, rightfully.

I don't disagree.  Just noting that it is a commonly-used tool that is 
affected by DEBUG_LOCKS.

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


Re: svn commit: r271434 - head/etc

2014-09-24 Thread Dag-Erling Smørgrav
Warren Block wbl...@wonkity.com writes:
 Dag-Erling Smørgrav d...@des.no writes:
  Non-bikesheddy: the first line is wrong.
 Could you be more specific about that?  It is an abbreviated form of
 Links to security advisories and errata are available at.  Maybe you
 mean that it does not link directly to the security advisories?

Precisely - the correct link for security information is
http://security.freebsd.org/ or http://www.freebsd.org/security.  Sorry
for being somewhat gnomic :)

 This was discussed a bit in the threads on -arch.

Yes, I know...  feel free to ignore the bikesheddy part :)

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org

svn commit: r272072 - head/usr.bin/mkimg

2014-09-24 Thread Marcel Moolenaar
Author: marcel
Date: Wed Sep 24 15:14:01 2014
New Revision: 272072
URL: http://svnweb.freebsd.org/changeset/base/272072

Log:
  Fix the creation of the L2 cluster table for version 1. The blkofs
  variable was assigned the image offset in bytes and not in blocks
  (i.e. sectors). This had image_data() return FALSE, which meant that
  we didn't assign a cluster when we needed and also meant that we
  didn't write parts of the L2 table when we should have. The result
  being that the actual data clusters were written at the wrong offset.
  
  Improve support for QCOW version 2. We're having the right layout
  and even know how many refcnt blocks we need. All we need to do is
  populate the refcnt blocks for every cluster we write and allocate
  a cluster when we need a new refcnt block. The allocation part is
  tricky in that it'll interleave with the assignment of clusters to
  L2 tables and data. Since version 2 is not quite done, keep it
  compiled out for now.

Modified:
  head/usr.bin/mkimg/qcow.c

Modified: head/usr.bin/mkimg/qcow.c
==
--- head/usr.bin/mkimg/qcow.c   Wed Sep 24 14:35:08 2014(r272071)
+++ head/usr.bin/mkimg/qcow.c   Wed Sep 24 15:14:01 2014(r272072)
@@ -46,6 +46,10 @@ __FBSDID($FreeBSD$);
 #defineQCOW1_CLSTR_LOG2SZ  12  /* 4KB */
 #defineQCOW2_CLSTR_LOG2SZ  16  /* 64KB */
 
+/* Flag bits in cluster offsets */
+#defineQCOW_CLSTR_COMPRESSED   (1ULL  62)
+#defineQCOW_CLSTR_COPIED   (1ULL  63)
+
 struct qcow_header {
uint32_tmagic;
 #defineQCOW_MAGIC  0x514649fb
@@ -90,7 +94,7 @@ round_clstr(uint64_t ofs)
 static int
 qcow_resize(lba_t imgsz, u_int version)
 {
-   uint64_t clstrsz, imagesz;
+   uint64_t imagesz;
 
switch (version) {
case QCOW_VERSION_1:
@@ -103,12 +107,11 @@ qcow_resize(lba_t imgsz, u_int version)
return (EDOOFUS);
}
 
-   clstrsz = 1UL  clstr_log2sz;
imagesz = round_clstr(imgsz * secsz);
 
if (verbose)
-   fprintf(stderr, QCOW: image size = %ju, cluster size = %ju\n,
-   (uintmax_t)imagesz, (uintmax_t)clstrsz);
+   fprintf(stderr, QCOW: image size = %ju, cluster size = %u\n,
+   (uintmax_t)imagesz, (u_int)(1U  clstr_log2sz));
 
return (image_set_size(imagesz / secsz));
 }
@@ -135,24 +138,45 @@ qcow_write(int fd, u_int version)
struct qcow_header *hdr;
uint64_t *l1tbl, *l2tbl;
uint16_t *rctbl;
-   uint64_t n, clstrsz, imagesz, nclstrs;
-   uint64_t l1ofs, l2ofs, ofs, rcofs;
-   lba_t blk, blkofs, blkcnt, imgsz;
-   u_int l1idx, l2idx, l2clstrs;
+   uint64_t clstr_imgsz, clstr_l2tbls, clstr_l1tblsz;
+   uint64_t clstr_rcblks, clstr_rctblsz;
+   uint64_t n, imagesz, nclstrs, ofs, ofsflags;
+   lba_t blk, blkofs, blk_imgsz;
+   u_int l1clno, l2clno, rcclno;
+   u_int blk_clstrsz;
+   u_int clstrsz, l1idx, l2idx;
int error;
 
if (clstr_log2sz == 0)
return (EDOOFUS);
 
-   clstrsz = 1UL  clstr_log2sz;
-   blkcnt = clstrsz / secsz;
-   imgsz = image_get_size();
-   imagesz = imgsz * secsz;
-   nclstrs = imagesz  clstr_log2sz;
-   l2clstrs = (nclstrs * 8 + clstrsz - 1)  clstr_log2sz;
+   clstrsz = 1U  clstr_log2sz;
+   blk_clstrsz = clstrsz / secsz;
+   blk_imgsz = image_get_size();
+   imagesz = blk_imgsz * secsz;
+   clstr_imgsz = imagesz  clstr_log2sz;
+   clstr_l2tbls = round_clstr(clstr_imgsz * 8)  clstr_log2sz;
+   clstr_l1tblsz = round_clstr(clstr_l2tbls * 8)  clstr_log2sz;
+   nclstrs = clstr_imgsz + clstr_l2tbls + clstr_l1tblsz + 1;
+   clstr_rcblks = clstr_rctblsz = 0;
+   do {
+   n = clstr_rcblks + clstr_rctblsz;
+   clstr_rcblks = round_clstr((nclstrs + n) * 2)  clstr_log2sz;
+   clstr_rctblsz = round_clstr(clstr_rcblks * 8)  clstr_log2sz;
+   } while (n  (clstr_rcblks + clstr_rctblsz));
+
+   /*
+* We got all the sizes in clusters. Start the layout.
+* 0 - header
+* 1 - L1 table
+* 2 - RC table (v2 only)
+* 3 - First RC block (v2 only)
+* 4 - L2 tables
+* n - data
+*/
 
-   l1ofs = clstrsz;
-   rcofs = round_clstr(l1ofs + l2clstrs * 8);
+   l1clno = 1;
+   rcclno = 0;
 
hdr = calloc(1, clstrsz);
if (hdr == NULL)
@@ -163,18 +187,21 @@ qcow_write(int fd, u_int version)
be64enc(hdr-disk_size, imagesz);
switch (version) {
case QCOW_VERSION_1:
-   l2ofs = rcofs;  /* No reference counting. */
+   ofsflags = 0;
+   l2clno = l1clno + clstr_l1tblsz;
hdr-u.v1.clstr_log2sz = clstr_log2sz;
hdr-u.v1.l2_log2sz = clstr_log2sz - 3;
-   be64enc(hdr-u.v1.l1_offset, l1ofs);
+

svn commit: r272073 - head/usr.bin/mkimg/tests

2014-09-24 Thread Marcel Moolenaar
Author: marcel
Date: Wed Sep 24 15:15:14 2014
New Revision: 272073
URL: http://svnweb.freebsd.org/changeset/base/272073

Log:
  Update the baseline for QCOW version 1. A bug was found that rendered
  the baseline invalid.

Modified:
  head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-ebr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.qcow.gz.uu

Modified: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uu
==
--- head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uuWed Sep 24 
15:14:01 2014(r272072)
+++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow.gz.uuWed Sep 24 
15:15:14 2014(r272073)
@@ -1,60 +1,127 @@
 # $FreeBSD$
 begin 644 img-1x1-4096-apm.qcow.gz
-M'XL(+-D'U0``VEM9RTQ#$M-#`Y-BUATN6-O=RYO=70`K9Q+CQO'47W
-M^A6=K8$(O%75C]K%ABT@P-*C*R=C5@P(^!8R`;_7B30S)#SMRK.XHT(@8:
-M$-^'[N;A@3`Z[,/A_#5-,Z:T3E/YV./U\FY^N'],'_[Q[N]O;[\^O#DO
-MP^$C4\]^3F'9=W=KF^UH735)L.^17KC@^Z[N;HXBWW)OESWU9OSR?*Y
-MH!;NX739=WAGP05R^][OC^]NQT;YZ7^YT@SC=62U[A:^OZS[]^7X@CC=
-M5:W;[M8]/#O=($XWJW7EH[`$`4M5ZYI9E^A45^N63?3J9VOPT=V_.ZA4Y!
-MK0MTW?2_=2N=BFI=NEMW'L%^KINHU..UCN,IT2W,%R5^B4X`Z6NTJG!'P
-MW#4Z);B#Y:[3*%=L-P-.B6XY:[G4X)[H+C#GQ*!=V^XJ[X+@#\UU0
-MW`7''9CO@N(N..[`?!4=\%Q!^:[H+B+CCLPWT7%773@?DN*NZBY8[Y+BKN
-MHN6.^2XJ[J+ECODN*NZBY8[Y+BKNHN6.^2XJ[J+ECODN*NZ2Y8[Y+BGNDN6.
-M^2XI[I+C+O`IP5URW`7FNZ2X2XZ[P'R7%'?)18[Y+B+CGN`O-=4MPEQUU@
-MODN*N]EQ%YCO9L7=[+@+S'SXFZVW#'?S8J[V7+'?#K[F;+'?/=K+B;+7?,
-M=[/B;K;,=_-BKO9L=\-RON%LL=\]VBN%LL=\QWB^)N=Q%/B6X6QQWD?EN
-M4=PMCKO(?+H[A;'762^6Q1WB^,N,M\MBKO%19[Q;%WJXB\QWJ^)N==Q%
-MYKM5;=:[ICO5L7=:KECOEL5=ZOECOEN5=RMECOFNU5QMUKNF.]6Q=UJN6.^
-M6Q5WF^6.^6Y3WV6.^:[37W.X2GQ+;8Z[Q'RW*XVQUUBOML4=YOC+C'?
-M;8J[S77F.\VQ=WFN$O,=YOB[OKK;[V.^2XK[K+C+C'?95=MMPQWV7%7;;
-M,=]EQ5VVW#'?95=MMPQWV7%7;;,=]EQ5VVW#'?95=L=PQWQ7%7;',=\5
-MQ5UQW,U\2G!7''S\UU1W!7'WQ\5Q1WQ7$W,]\5Q5UQW,W,=T5Q5QQW,_-=
-M4=Q=_QM2KV.^JXJ[ZKB;F^JXJY:[ICOJN*N6NZ8[ZKBKEKNF.^JXJY:[ICO
-MJN*N6NZ8[ZKBKEKNF.^JXJY9[ICOFN*N6Z8[YKBKCGN%CXENN.NX7YKBGN
-MFN-N8;YKBKOFN%N8[YKBKCGN%N:[IKAKCKN%^:XI[KKC;F^ZXJ[[KA;F.^Z
-MXJY;[ICONN*N6^Z8[[KBKEONF.^ZXJY;[ICONN*N6^Z8[[KBKEONF.^ZXFY8
-M[ICOAN)N6.Z8[X;B;CCN5CXEN!N.NY7Y;BCNAN-N9;X;BKOAN%N9[X;B;CCN
-M5N:[H;@;CKN5^6XH[G;'WI\MRON=L?=RGRW*^YVRQWSW:ZXVRUWS'[XFZW
-MW#'?[8J[W7+'?+K[G;+'?/=KKC;+7?,=[O@#M_Z'7$=S@([GPW!'?X2X
-MP\%QM_$ISAUL?[1WT'U=[#]W49\!]7?P?9W_$=5'\'V]]MQ'=0_1UL?[1
-MWT'U=[#]W49\!]7?P?9W_$=5'\'V]]MQ'=0_1UL?[1WT'U=[#]W49\!]7?
-MP?9W_$=5'\'V]]MQ'=0_1UL?[1WT'U=[#]W9\I_H[V/YN8[Y3_1UL?Y?Y
-ME.#.]G9^4[U=[#]76:^4_T=;'^7F]4?P?;WV7F.]7?P?9WF?E.]7P_5UF
-MOE/]'6Q_EYGO5'\'V]]EYCO5W\'V=YGY3O5WL/U=9KY3_1UL?Y9[U1_!]O?
-M98[U=_!]G9^4[U=[#]76:^4_T=;'^7F]4?P?;WQ4^);BS_5UAOE/]'6Q_
-M5YCO5'\'V]\5YCO5W\'V=X7Y3O5WL/U=8;Y3_1UL?U8[U1_!]O?%8[U=_!
-M]G%^4[U=[#]76^4_T=;']7F.]4?P?;WQ7F.]7?P?9WA?E.]7P_5UAOE/]
-M'6Q_5YCO5'\'V]\5YCO5W\'V=Y5/YL?U9[U1_!]O?58[U=_!]G5^4[U
-M=[#]766^4_T=;']7F]4?P?;WU7F.]7?P?9WE?E.]7P_5UEOE/]'6Q_5YGO
-M5'\'V]]5YCO5W\'V=Y7Y3O5WL/U=9;Y3_1UL?U9[U1_!]O?58[U=_!]G5
-M^4[U=[#]7-3@CO;WS7F.]7?P?9WC?E.]7P_5UCOE/]'6Q_UYCO5'\'V]\U
-MYCO5W\'V=XWY3O5WL/U=8[Y3_1UL?]8[U1_!]O?-8[U=_!]G-^4[U=[#]
-M76.^4_T=;'_7F.]4?P?;WS7F.]7?P?9WC?E.]7P_5UCOE/]'6Q_U_F4X,[V
-M=YWY3O5WL/U=9[Y3_1UL?]9[U1_!]O?=8[U=_!]G=^4[U=[#]76^4_T=
-M;'_7F]4?P?;WW7F.]7?P?9WG?E.]7P_5UGOE/]'6Q_UYGO5'\'V]]UYCO5
-MW\'V=YWY3O5WL/U=9[Y3_1UL?]9[U1_!]O?#3XEN+/]W6^4_T=;'\WF.]4
-M?P?;WPWF.]7?P?9W@_E.]7P_=U@OE/]'6Q_-YCO5'\'V]\-YCO5W\'V=X/Y
-M3O5WL/W=8+Y3_1UL?S8[U1_!]O?#8[U=_!]G#^4[U=[#]W6^4_T=;'\W

Re: svn commit: r272032 - head/sys/conf

2014-09-24 Thread Bryan Drewery
On 9/24/2014 8:38 AM, John Baldwin wrote:
 On Tuesday, September 23, 2014 05:04:21 PM Bryan Drewery wrote:
 Author: bdrewery
 Date: Tue Sep 23 17:04:21 2014
 New Revision: 272032
 URL: http://svnweb.freebsd.org/changeset/base/272032

 Log:
   DEBUG_LOCKS no longer modifies 'struct vnode', nor does fstat(1) use it.
   fstat(1) now uses libprocstat(9).  There is no userland impact to using
 this.
 
 As your followup noted, it does change the size of 'struct lock' (and thus
 'struct vnode') still.  While fstat does not use it for live, it probably
 still uses it for coredumps.  However, lsof uses kvm access, so it will break.
 I don't think that is worth noting here, but more of an FYI.
 

Hmm, I see my commit logs were not fully accurate. I was too focused on
the stale comment about fstat(1).

-- 
Regards,
Bryan Drewery



signature.asc
Description: OpenPGP digital signature


svn commit: r272076 - in head/contrib/apr-util: . crypto dbd dbm include test

2014-09-24 Thread Peter Wemm
Author: peter
Date: Wed Sep 24 18:38:51 2014
New Revision: 272076
URL: http://svnweb.freebsd.org/changeset/base/272076

Log:
  Merge apr-util 1.5.3 - 1.5.4.  A minor bug fix update.

Modified:
  head/contrib/apr-util/CHANGES
  head/contrib/apr-util/NOTICE
  head/contrib/apr-util/apr-util.spec
  head/contrib/apr-util/configure
  head/contrib/apr-util/crypto/apr_crypto.c
  head/contrib/apr-util/crypto/apr_passwd.c
  head/contrib/apr-util/dbd/apr_dbd_mysql.c
  head/contrib/apr-util/dbd/apr_dbd_odbc.c
  head/contrib/apr-util/dbm/NWGNUmakefile
  head/contrib/apr-util/include/apu_version.h
  head/contrib/apr-util/test/Makefile.win
Directory Properties:
  head/contrib/apr-util/   (props changed)

Modified: head/contrib/apr-util/CHANGES
==
--- head/contrib/apr-util/CHANGES   Wed Sep 24 18:14:16 2014
(r272075)
+++ head/contrib/apr-util/CHANGES   Wed Sep 24 18:38:51 2014
(r272076)
@@ -1,4 +1,30 @@
  -*- coding: utf-8 -*-
+Changes with APR-util 1.5.4
+
+  *) MySQL driver: Fix incorrect handling of bad parameter in the
+ driver support for apr_dbd_transaction_end().  PR 56330.
+ [Weiqiang Li weiqiang_li hotmail.com]
+
+  *) apr_crypto_get_driver(): Fix invalid storage reference on error path.
+ [Philip Martin philip.martin wandisco.com]
+
+  *) Fix compile failure for Android.  PR 56627.  [Fredrik Fornwall 
+ fredrik fornwall.net, Jeff Trawick]
+
+  *) Fix to let ODBC driver build with MSVC6, which does not have intptr_t
+ [Tom Donovan]
+
+  *) Windows cmake build: Fix incompatiblities with Visual Studio
+ generators with all cmake versions, and the NMake Makefile generator
+ with cmake 2.8.12 and later.  PR 56616 and other bugs.  [Jeff Trawick,
+ Bert Huijben]
+
+  *) Fix detection of Berkeley DB 6.0. PR 55277.
+ [Lars Wendler polynomial-c gentoo.org]
+
+  *) Improve platform detection for bundled expat by updating
+ config.guess and config.sub. [Rainer Jung]
+
 Changes with APR-util 1.5.3
 
   *) Cygwin: Use correct file extension when loading APR DSOs.  PR 55587.

Modified: head/contrib/apr-util/NOTICE
==
--- head/contrib/apr-util/NOTICEWed Sep 24 18:14:16 2014
(r272075)
+++ head/contrib/apr-util/NOTICEWed Sep 24 18:38:51 2014
(r272076)
@@ -1,7 +1,7 @@
 Apache Portable Runtime Utility Library
-Copyright (c) 2011 The Apache Software Foundation.
+Copyright (c) 2000-2014 The Apache Software Foundation.
 
-This product includes software developed by
+This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
 Portions of this software were developed at the National Center

Modified: head/contrib/apr-util/apr-util.spec
==
--- head/contrib/apr-util/apr-util.spec Wed Sep 24 18:14:16 2014
(r272075)
+++ head/contrib/apr-util/apr-util.spec Wed Sep 24 18:38:51 2014
(r272076)
@@ -3,7 +3,7 @@
 
 Summary: Apache Portable Runtime Utility library
 Name: apr-util
-Version: 1.5.3
+Version: 1.5.4
 Release: 1
 License: Apache Software License
 Group: System Environment/Libraries

Modified: head/contrib/apr-util/configure
==
--- head/contrib/apr-util/configure Wed Sep 24 18:14:16 2014
(r272075)
+++ head/contrib/apr-util/configure Wed Sep 24 18:38:51 2014
(r272076)
@@ -11608,19 +11608,34 @@ fi
   apu_db_version=0
 
   # Maximum supported version announced in help string.
-  # Although we search for all versions up to 5.9,
+  # Although we search for all versions up to 6.9,
   # we should only include existing versions in our
   # help string.
-  db_max_version=53
-  db_min_version=41
   dbm_list=sdbm, gdbm, ndbm, db, db1, db185, db2, db3, db4
+  db_max_version=48
+  db_min_version=41
+  db_version=$db_min_version
+  while [ $db_version -le $db_max_version ]
+  do
+dbm_list=$dbm_list, db$db_version
+db_version=`expr $db_version + 1`
+  done
+  db_max_version=53
+  db_min_version=50
+  db_version=$db_min_version
+  while [ $db_version -le $db_max_version ]
+  do
+dbm_list=$dbm_list, db$db_version
+db_version=`expr $db_version + 1`
+  done
+  db_max_version=60
+  db_min_version=60
   db_version=$db_min_version
   while [ $db_version -le $db_max_version ]
   do
 dbm_list=$dbm_list, db$db_version
 db_version=`expr $db_version + 1`
   done
-  dbm_list=$dbm_list, db60
 
 
 # Check whether --with-dbm was given.
@@ -12093,8 +12108,8 @@ if test ${with_berkeley_db+set} = set;
 
   all_places=$check_places
 
-  # Start version search at version 5.9
-  db_version=59
+  # Start version search at version 6.9
+  db_version=69
   while [ $db_version -ge 40 ]
   do
 db_major=`echo $db_version | sed 

svn commit: r272079 - head/sys/dev/cxgbe/tom

2014-09-24 Thread Navdeep Parhar
Author: np
Date: Wed Sep 24 20:04:11 2014
New Revision: 272079
URL: http://svnweb.freebsd.org/changeset/base/272079

Log:
  cxgbe/tom:  Catch up with r271119, syncache_add doesn't need tcbinfo lock.

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

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Wed Sep 24 19:30:36 2014
(r272078)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Wed Sep 24 20:04:11 2014
(r272079)
@@ -1311,7 +1311,7 @@ do_pass_accept_req(struct sge_iq *iq, co
REJECT_PASS_ACCEPT();
rpl = wrtod(wr);
 
-   INP_INFO_WLOCK(V_tcbinfo); /* for 4-tuple check, syncache_add */
+   INP_INFO_WLOCK(V_tcbinfo); /* for 4-tuple check */
 
/* Don't offload if the 4-tuple is already in use */
if (toe_4tuple_check(inc, th, ifp) != 0) {
@@ -1319,6 +1319,7 @@ do_pass_accept_req(struct sge_iq *iq, co
free(wr, M_CXGBE);
REJECT_PASS_ACCEPT();
}
+   INP_INFO_WUNLOCK(V_tcbinfo);
 
inp = lctx-inp;/* listening socket, not owned by TOE */
INP_WLOCK(inp);
@@ -1331,7 +1332,6 @@ do_pass_accept_req(struct sge_iq *iq, co
 * resources tied to this listen context.
 */
INP_WUNLOCK(inp);
-   INP_INFO_WUNLOCK(V_tcbinfo);
free(wr, M_CXGBE);
REJECT_PASS_ACCEPT();
}
@@ -1383,7 +1383,6 @@ do_pass_accept_req(struct sge_iq *iq, co
 */
toe_syncache_add(inc, to, th, inp, tod, synqe);
INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */
-   INP_INFO_UNLOCK_ASSERT(V_tcbinfo);
 
/*
 * If we replied during syncache_add (synqe-wr has been consumed),
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272080 - head/sys/dev/cxgbe/tom

2014-09-24 Thread Navdeep Parhar
Author: np
Date: Wed Sep 24 20:08:43 2014
New Revision: 272080
URL: http://svnweb.freebsd.org/changeset/base/272080

Log:
  Update comment (missed this bit in r272079).

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

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Wed Sep 24 20:04:11 2014
(r272079)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Wed Sep 24 20:08:43 2014
(r272080)
@@ -1378,8 +1378,7 @@ do_pass_accept_req(struct sge_iq *iq, co
 
/*
 * If all goes well t4_syncache_respond will get called during
-* syncache_add.  Also note that syncache_add releases both pcbinfo and
-* pcb locks.
+* syncache_add.  Note that syncache_add releases the pcb lock.
 */
toe_syncache_add(inc, to, th, inp, tod, synqe);
INP_UNLOCK_ASSERT(inp); /* ok to assert, we have a ref on the inp */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272081 - head/sys/netinet

2014-09-24 Thread Navdeep Parhar
Author: np
Date: Wed Sep 24 20:12:40 2014
New Revision: 272081
URL: http://svnweb.freebsd.org/changeset/base/272081

Log:
  Catch up with r271119.

Modified:
  head/sys/netinet/toecore.c

Modified: head/sys/netinet/toecore.c
==
--- head/sys/netinet/toecore.c  Wed Sep 24 20:08:43 2014(r272080)
+++ head/sys/netinet/toecore.c  Wed Sep 24 20:12:40 2014(r272081)
@@ -329,7 +329,6 @@ toe_syncache_add(struct in_conninfo *inc
 {
struct socket *lso = inp-inp_socket;
 
-   INP_INFO_WLOCK_ASSERT(V_tcbinfo);
INP_WLOCK_ASSERT(inp);
 
syncache_add(inc, to, th, inp, lso, NULL, tod, todctx);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272083 - head/contrib/pjdfstest/tests/open

2014-09-24 Thread Garrett Cooper
Author: ngie
Date: Wed Sep 24 22:14:53 2014
New Revision: 272083
URL: http://svnweb.freebsd.org/changeset/base/272083

Log:
  Expect ELOOP on Darwin/Linux with O_NOFOLLOW was specified and the target is 
a
  symbolic link case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris,
  etc)
  
  MFC after: 2 weeks
  X-MFC with: r272057
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/pjdfstest/tests/open/16.t

Modified: head/contrib/pjdfstest/tests/open/16.t
==
--- head/contrib/pjdfstest/tests/open/16.t  Wed Sep 24 21:17:03 2014
(r272082)
+++ head/contrib/pjdfstest/tests/open/16.t  Wed Sep 24 22:14:53 2014
(r272083)
@@ -1,19 +1,27 @@
 #!/bin/sh
 # $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 
19:35:13Z pjd $
 
-desc=open returns ELOOP when O_NOFOLLOW was specified and the target is a 
symbolic link
-
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
+case ${os} in
+Darwin|Linux)
+   error=ELOOP
+   ;;
+*)
+   error=EMLINK
+   ;;
+esac
+desc=open returns $error when O_NOFOLLOW was specified and the target is a 
symbolic link
+
 echo 1..6
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 symlink ${n0} ${n1}
-expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
-expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW
-expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW
-expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW
+expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644
+expect $error open ${n1} O_RDONLY,O_NOFOLLOW
+expect $error open ${n1} O_WRONLY,O_NOFOLLOW
+expect $error open ${n1} O_RDWR,O_NOFOLLOW
 expect 0 unlink ${n1}
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272084 - head/contrib/pjdfstest/tests/ftruncate

2014-09-24 Thread Garrett Cooper
Author: ngie
Date: Wed Sep 24 22:18:21 2014
New Revision: 272084
URL: http://svnweb.freebsd.org/changeset/base/272084

Log:
  Fix the executed testplan count
  
  MFC after: 2 weeks
  X-MFC with: r272057
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/contrib/pjdfstest/tests/ftruncate/00.t

Modified: head/contrib/pjdfstest/tests/ftruncate/00.t
==
--- head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 22:14:53 2014
(r272083)
+++ head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 22:18:21 2014
(r272084)
@@ -6,7 +6,7 @@ desc=ftruncate descrease/increase file 
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo 1..21
+echo 1..26
 
 n0=`namegen`
 n1=`namegen`
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272085 - in head: share/misc usr.bin/calendar/calendars

2014-09-24 Thread Julien Charbon
Author: jch
Date: Wed Sep 24 22:31:40 2014
New Revision: 272085
URL: http://svnweb.freebsd.org/changeset/base/272085

Log:
  Add myself (jch) to calendar.freebsd and committers-src.dot
  
  Approved by:  jhb (mentor)

Modified:
  head/share/misc/committers-src.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-src.dot
==
--- head/share/misc/committers-src.dot  Wed Sep 24 22:18:21 2014
(r272084)
+++ head/share/misc/committers-src.dot  Wed Sep 24 22:31:40 2014
(r272085)
@@ -179,6 +179,7 @@ ivoras [label=Ivan Voras\nivoras@FreeBS
 jamie [label=Jamie Gritton\nja...@freebsd.org\n2009/01/28]
 jasone [label=Jason Evans\njas...@freebsd.org\n1999/03/03]
 jceel [label=Jakub Klama\njc...@freebsd.org\n2011/09/25]
+jch [label=Julien Charbon\n...@freebsd.org\n2014/09/24]
 jchandra [label=Jayachandran C.\njchan...@freebsd.org\n2010/05/19]
 jeff [label=Jeff Roberson\nj...@freebsd.org\n2002/02/21]
 jh [label=Jaakko Heinonen\n...@freebsd.org\n2009/10/02]
@@ -484,6 +485,7 @@ jdp - fjoe
 
 jhb - arr
 jhb - avg
+jhb - jch
 jhb - jeff
 jhb - kbyanc
 jhb - peterj

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdWed Sep 24 22:18:21 
2014(r272084)
+++ head/usr.bin/calendar/calendars/calendar.freebsdWed Sep 24 22:31:40 
2014(r272085)
@@ -52,6 +52,7 @@
 02/03  Jason Helfman j...@freebsd.org born in Royal Oak, Michigan, United 
States, 1972
 02/04  Eitan Adler ead...@freebsd.org born in West Hempstead, New York, 
United States, 1991
 02/05  Frank Laszlo lasz...@freebsd.org born in Howell, Michigan, United 
States, 1983
+02/06  Julien Charbon j...@freebsd.org born in Saint Etienne, Loire, France, 
1978
 02/10  David Greenman d...@freebsd.org born in Portland, Oregon, United 
States, 1968
 02/10  Paul Richards p...@freebsd.org born in Ammanford, Carmarthenshire, 
United Kingdom, 1968
 02/10  Simon Barner bar...@freebsd.org born in Rosenheim, Bayern, Germany, 
1980
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272088 - head/usr.bin/mkimg/tests

2014-09-24 Thread Marcel Moolenaar
Author: marcel
Date: Wed Sep 24 22:58:10 2014
New Revision: 272088
URL: http://svnweb.freebsd.org/changeset/base/272088

Log:
  Add baseline files for QCOW2.

Added:
  head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-ebr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-gpt.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-mbr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-4096-vtoc8.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-apm.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-bsd.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-ebr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-gpt.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-mbr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-1x1-512-vtoc8.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-apm.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-bsd.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-ebr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-gpt.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-mbr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-4096-vtoc8.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-apm.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-bsd.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-ebr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-gpt.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-mbr.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow2.gz.uu   (contents, props 
changed)
  head/usr.bin/mkimg/tests/img-63x255-512-vtoc8.qcow2.gz.uu   (contents, props 
changed)
Modified:
  head/usr.bin/mkimg/tests/mkimg.sh

Added: head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/mkimg/tests/img-1x1-4096-apm.qcow2.gz.uu   Wed Sep 24 
22:58:10 2014(r272088)
@@ -0,0 +1,22 @@
+# $FreeBSD$
+begin 644 img-1x1-4096-apm.qcow2.gz
+M'XL()T[(U0``VEM9RTQ#$M-#`Y-BUATN6-O=S(N;W5T`*V826_;,!!
+M[_D53/F32K.D)35/9N!'@JD#7H.O,A`@YJ`7__A2ULB4J1DQ-N0(1@SB
+MQ@/GTFLZQ^*6U,DZ90BVFRK^FU3KQ?:E5M_7T[:C]5!#=.9D(6#YP
+M6ZSS@`,)E^GN@N9QKJ0P43ZH)2.-6U[?`X(X.UJU;;\8H2N`^P!HG;L9
+M]4%=7YPP]8'0]'?/]LDXL77']]6-7IW()-TKB@$D5$FZ2Q3FDJX61)G
+MF-1PI5)G52PG$ZIXG-26L)!$IS*91P)HD;,2G).YWVKF!2DGZ[=V$
+M24GZ;1W4R8E:?3WLV8E.2=3GLW9U*2=R!XIP*N9%*2=Q!Y=TBX1PW8%*2
+M=Q!Y]YAP3S8XS:4D[R#R[BGAG@4,^]`\@XB[YX3[D7`,?,.).\@\NXEX8X
+MCIEW('D'D7O/ZX)AY!Y)W$'EWW/%.,_,.).\P\NX-L;*`8^8=2MYAY)TF
+M'`0,^]0\@XC[Y!P)N882=QAY9PGG`HZ9=RAYAY%W.%`?,.Y2\P\B[
+M@G!O`XZ9=RAYAY%W[PCW/N882=QAY]X%P'P..F7H6B[SX1[G/`,?/.
+M2-Z9R+M3PIT%'#/OC.2=B;P[)]S%!@=:N-=EO$7X2X[GUD8]ONG=^/-?,L
+M+_0`1[L`^RJL6@;]C6;]CO@(5PCLK6=\A1+_#RX4YW*[/#GT@L+4P?C*;
+M2'TH'/+ZRNOC+]L[4P_N/@IZF_W$PY^Z#Z3I?+GR6#DT^WNQ^G/`Z[U=G%
+M^G\O2PXJ-\H5].P6RI75,E5WLYSW=_W_[Y?=/@JANDFU?A?)?J?DV6;'5V
+MX+TU#]S;YGX!!-S6]749X9VSZRWPU6-]QOA+S\N+593SG_-4-96:Q:[P/%=
+M69Y=7QS_%^W^V_;'!^A-5NG_0ZE_](6GW3[7KT/WS_7V+T5YXR;H7]_
+J_]4B-O4-W#^=4?_\2;W[+^LKDZV_VJ@(!@%1I73#_Z4*H1'E$P``
+`
+end

Added: head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/mkimg/tests/img-1x1-4096-bsd.qcow2.gz.uu   Wed Sep 24 
22:58:10 2014(r272088)
@@ -0,0 +1,21 @@
+# $FreeBSD$
+begin 644 img-1x1-4096-bsd.qcow2.gz
+M'XL()X[(U0``VEM9RTQ#$M-#`Y-BUBV0N6-O=S(N;W5T`*V8VY+20!
+M[WF*6^NBIGN24@\K+KK6N6=WN@UL/`4/+P;ILDDG?XS2`52J:*_ZNS)=F
+M0E'$EW.E=Z%RH7'[C7O\+`YWH?AX0Z_?_Q]E^'183Y`J2,@`=;LZ2SA
+MN,*/![R-ZU7'!HY.J3$HAPNPNJD!`W].%ZZXV+4*L7`,.+L9%]5L3R?
+MA?71W/6Q??W*4TX/5-/U:Q/IU8(5V=Q9*0:A%MG6RD-@BWS*D7I`N%T6
+M5QJI/#YCJ/N,I(82C+YEI!CA0A97RGDG][UQ@IY)W/[V4L@[G_=N
+M8Z20=S[OW=9((]\WKL'(X6\(^=2[B=D4+D?+N2G!/$FYOI)!WI+Q[*KAG
+M'Y;*0=*^^Y%PAG]CI!WI+Q[*;A76?T.T+D?+NMN$\[H=X2\(^7=
+M\]33BCWQ'RCI1W[T;:/?$?*.E7?OA54DG-'O'G'RCLO.$HXH]\Q\HZ5

svn commit: r272089 - head/sys/netpfil/ipfw

2014-09-24 Thread Sean Bruno
Author: sbruno
Date: Thu Sep 25 02:26:05 2014
New Revision: 272089
URL: http://svnweb.freebsd.org/changeset/base/272089

Log:
  Fix NULL pointer deref in ipfw when using dummynet at layer 2.
  Drop packet if pkg-ifp is NULL, which is the case here.
  
  ref. https://github.com/HardenedBSD/hardenedBSD
  commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7
  
  PR 193861 --  DUMMYNET LAYER2: kernel panic
  
  in this case a kernel panic occurs. Hence, when we do not get an interface,
  we just drop the packet in question.
  
  PR:   193681
  Submitted by: David Carlier david.carl...@hardenedbsd.org
  Obtained from:Hardened BSD
  MFC after:2 weeks
  Relnotes: yes

Modified:
  head/sys/netpfil/ipfw/ip_dn_io.c

Modified: head/sys/netpfil/ipfw/ip_dn_io.c
==
--- head/sys/netpfil/ipfw/ip_dn_io.cWed Sep 24 22:58:10 2014
(r272088)
+++ head/sys/netpfil/ipfw/ip_dn_io.cThu Sep 25 02:26:05 2014
(r272089)
@@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m)
/* extract the dummynet info, rename the tag
 * to carry reinject info.
 */
-   dst = pkt-dn_dir;
-   ifp = pkt-ifp;
-   tag-m_tag_cookie = MTAG_IPFW_RULE;
-   tag-m_tag_id = 0;
+   if (pkt-dn_dir == (DIR_OUT | PROTO_LAYER2) 
+   pkt-ifp == NULL) {
+   dst = DIR_DROP;
+   } else {
+   dst = pkt-dn_dir;
+   ifp = pkt-ifp;
+   tag-m_tag_cookie = MTAG_IPFW_RULE;
+   tag-m_tag_id = 0;
+   }
}
 
switch (dst) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r272089 - head/sys/netpfil/ipfw

2014-09-24 Thread Adrian Chadd
Hm, I saw this from Kate on IRC. Did anyone figure out _where_ these
frames are coming from?

Just dropping them is cool, but I'd really like to see the contents of
the frames and what their origin is.

I'm worried that they're valid stack-generated frames..


-a


On 24 September 2014 19:26, Sean Bruno sbr...@freebsd.org wrote:
 Author: sbruno
 Date: Thu Sep 25 02:26:05 2014
 New Revision: 272089
 URL: http://svnweb.freebsd.org/changeset/base/272089

 Log:
   Fix NULL pointer deref in ipfw when using dummynet at layer 2.
   Drop packet if pkg-ifp is NULL, which is the case here.

   ref. https://github.com/HardenedBSD/hardenedBSD
   commit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7

   PR 193861 --  DUMMYNET LAYER2: kernel panic

   in this case a kernel panic occurs. Hence, when we do not get an interface,
   we just drop the packet in question.

   PR:   193681
   Submitted by: David Carlier david.carl...@hardenedbsd.org
   Obtained from:Hardened BSD
   MFC after:2 weeks
   Relnotes: yes

 Modified:
   head/sys/netpfil/ipfw/ip_dn_io.c

 Modified: head/sys/netpfil/ipfw/ip_dn_io.c
 ==
 --- head/sys/netpfil/ipfw/ip_dn_io.cWed Sep 24 22:58:10 2014
 (r272088)
 +++ head/sys/netpfil/ipfw/ip_dn_io.cThu Sep 25 02:26:05 2014
 (r272089)
 @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m)
 /* extract the dummynet info, rename the tag
  * to carry reinject info.
  */
 -   dst = pkt-dn_dir;
 -   ifp = pkt-ifp;
 -   tag-m_tag_cookie = MTAG_IPFW_RULE;
 -   tag-m_tag_id = 0;
 +   if (pkt-dn_dir == (DIR_OUT | PROTO_LAYER2) 
 +   pkt-ifp == NULL) {
 +   dst = DIR_DROP;
 +   } else {
 +   dst = pkt-dn_dir;
 +   ifp = pkt-ifp;
 +   tag-m_tag_cookie = MTAG_IPFW_RULE;
 +   tag-m_tag_id = 0;
 +   }
 }

 switch (dst) {

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


Re: svn commit: r272089 - head/sys/netpfil/ipfw

2014-09-24 Thread Gleb Smirnoff
On Wed, Sep 24, 2014 at 07:40:23PM -0700, Adrian Chadd wrote:
A Hm, I saw this from Kate on IRC. Did anyone figure out _where_ these
A frames are coming from?
A 
A Just dropping them is cool, but I'd really like to see the contents of
A the frames and what their origin is.
A 
A I'm worried that they're valid stack-generated frames..

I agree on this. Fixing NULL pointer derefs with NULL check is not
always a right thing to do.

A -a
A 
A 
A On 24 September 2014 19:26, Sean Bruno sbr...@freebsd.org wrote:
A  Author: sbruno
A  Date: Thu Sep 25 02:26:05 2014
A  New Revision: 272089
A  URL: http://svnweb.freebsd.org/changeset/base/272089
A 
A  Log:
AFix NULL pointer deref in ipfw when using dummynet at layer 2.
ADrop packet if pkg-ifp is NULL, which is the case here.
A 
Aref. https://github.com/HardenedBSD/hardenedBSD
Acommit 4eef3881c64f6e3aa38eebbeaf27a947a5d47dd7
A 
APR 193861 --  DUMMYNET LAYER2: kernel panic
A 
Ain this case a kernel panic occurs. Hence, when we do not get an 
interface,
Awe just drop the packet in question.
A 
APR:   193681
ASubmitted by: David Carlier david.carl...@hardenedbsd.org
AObtained from:Hardened BSD
AMFC after:2 weeks
ARelnotes: yes
A 
A  Modified:
Ahead/sys/netpfil/ipfw/ip_dn_io.c
A 
A  Modified: head/sys/netpfil/ipfw/ip_dn_io.c
A  
==
A  --- head/sys/netpfil/ipfw/ip_dn_io.cWed Sep 24 22:58:10 2014
(r272088)
A  +++ head/sys/netpfil/ipfw/ip_dn_io.cThu Sep 25 02:26:05 2014
(r272089)
A  @@ -751,10 +751,15 @@ dummynet_send(struct mbuf *m)
A  /* extract the dummynet info, rename the tag
A   * to carry reinject info.
A   */
A  -   dst = pkt-dn_dir;
A  -   ifp = pkt-ifp;
A  -   tag-m_tag_cookie = MTAG_IPFW_RULE;
A  -   tag-m_tag_id = 0;
A  +   if (pkt-dn_dir == (DIR_OUT | PROTO_LAYER2) 
A  +   pkt-ifp == NULL) {
A  +   dst = DIR_DROP;
A  +   } else {
A  +   dst = pkt-dn_dir;
A  +   ifp = pkt-ifp;
A  +   tag-m_tag_cookie = MTAG_IPFW_RULE;
A  +   tag-m_tag_id = 0;
A  +   }
A  }
A 
A  switch (dst) {
A 
A 

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


svn commit: r272090 - head/sys/dev/mxge

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Thu Sep 25 05:45:52 2014
New Revision: 272090
URL: http://svnweb.freebsd.org/changeset/base/272090

Log:
  - Provide mxge_get_counter() to return counters that are not collected,
but taken from hardware.
  - Mechanically convert to if_inc_counter() the rest of counters.

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Thu Sep 25 02:26:05 2014(r272089)
+++ head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:45:52 2014(r272090)
@@ -2678,7 +2678,7 @@ mxge_rx_done_big(struct mxge_slice_state
/* try to replace the received mbuf */
if (mxge_get_buf_big(ss, rx-extra_map, idx)) {
/* drop the frame -- the old mbuf is re-cycled */
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
return;
}
 
@@ -2747,7 +2747,7 @@ mxge_rx_done_small(struct mxge_slice_sta
/* try to replace the received mbuf */
if (mxge_get_buf_small(ss, rx-extra_map, idx)) {
/* drop the frame -- the old mbuf is re-cycled */
-   ifp-if_ierrors++;
+   if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
return;
}
 
@@ -4036,43 +4036,45 @@ mxge_watchdog(mxge_softc_t *sc)
return (err);
 }
 
-static u_long
-mxge_update_stats(mxge_softc_t *sc)
+static uint64_t
+mxge_get_counter(struct ifnet *ifp, ift_counter cnt)
 {
-   struct mxge_slice_state *ss;
-   u_long pkts = 0;
-   u_long ipackets = 0;
-   u_long opackets = 0;
-#ifdef IFNET_BUF_RING
-   u_long obytes = 0;
-   u_long omcasts = 0;
-   u_long odrops = 0;
-#endif
-   u_long oerrors = 0;
-   int slice;
+   struct mxge_softc *sc;
+   uint64_t rv;
 
-   for (slice = 0; slice  sc-num_slices; slice++) {
-   ss = sc-ss[slice];
-   ipackets += ss-ipackets;
-   opackets += ss-opackets;
-#ifdef IFNET_BUF_RING
-   obytes += ss-obytes;
-   omcasts += ss-omcasts;
-   odrops += ss-tx.br-br_drops;
-#endif
-   oerrors += ss-oerrors;
-   }
-   pkts = (ipackets - sc-ifp-if_ipackets);
-   pkts += (opackets - sc-ifp-if_opackets);
-   sc-ifp-if_ipackets = ipackets;
-   sc-ifp-if_opackets = opackets;
+   sc = if_getsoftc(ifp);
+   rv = 0;
+
+   switch (cnt) {
+   case IFCOUNTER_IPACKETS:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].ipackets;
+   return (rv);
+   case IFCOUNTER_OPACKETS:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].opackets;
+   return (rv);
+   case IFCOUNTER_OERRORS:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].oerrors;
+   return (rv);
 #ifdef IFNET_BUF_RING
-   sc-ifp-if_obytes = obytes;
-   sc-ifp-if_omcasts = omcasts;
-   sc-ifp-if_oqdrops = odrops;
+   case IFCOUNTER_OBYTES:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].obytes;
+   return (rv);
+   case IFCOUNTER_OMCASTS:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].omcasts;
+   return (rv);
+   case IFCOUNTER_OQDROPS:
+   for (int s = 0; s  sc-num_slices; s++)
+   rv += sc-ss[s].tx.br-br_drops;
+   return (rv);
 #endif
-   sc-ifp-if_oerrors = oerrors;
-   return pkts;
+   default:
+   return (if_get_counter_default(ifp, cnt));
+   }
 }
 
 static void
@@ -4087,8 +4089,6 @@ mxge_tick(void *arg)
ticks = mxge_ticks;
running = sc-ifp-if_drv_flags  IFF_DRV_RUNNING;
if (running) {
-   /* aggregate stats from different slices */
-   pkts = mxge_update_stats(sc);
if (!sc-watchdog_countdown) {
err = mxge_watchdog(sc);
sc-watchdog_countdown = 4;
@@ -4925,6 +4925,7 @@ mxge_attach(device_t dev)
 ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
 ifp-if_ioctl = mxge_ioctl;
 ifp-if_start = mxge_start;
+   ifp-if_get_counter = mxge_get_counter;
/* Initialise the ifmedia structure */
ifmedia_init(sc-media, 0, mxge_media_change, 
 mxge_media_status);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r272091 - head/sys/dev/mxge

2014-09-24 Thread Gleb Smirnoff
Author: glebius
Date: Thu Sep 25 05:47:33 2014
New Revision: 272091
URL: http://svnweb.freebsd.org/changeset/base/272091

Log:
  Whitespace cleanup.

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:45:52 2014(r272090)
+++ head/sys/dev/mxge/if_mxge.c Thu Sep 25 05:47:33 2014(r272091)
@@ -211,7 +211,7 @@ mxge_dmamap_callback(void *arg, bus_dma_
 }
 
 static int
-mxge_dma_alloc(mxge_softc_t *sc, mxge_dma_t *dma, size_t bytes, 
+mxge_dma_alloc(mxge_softc_t *sc, mxge_dma_t *dma, size_t bytes,
   bus_size_t alignment)
 {
int err;
@@ -245,8 +245,8 @@ mxge_dma_alloc(mxge_softc_t *sc, mxge_dm
}
 
/* allocate DMAable memory  map */
-   err = bus_dmamem_alloc(dma-dmat, dma-addr, 
-  (BUS_DMA_WAITOK | BUS_DMA_COHERENT 
+   err = bus_dmamem_alloc(dma-dmat, dma-addr,
+  (BUS_DMA_WAITOK | BUS_DMA_COHERENT
| BUS_DMA_ZERO),  dma-map);
if (err != 0) {
device_printf(dev, couldn't alloc mem (err = %d)\n, err);
@@ -385,7 +385,7 @@ mxge_enable_nvidia_ecrc(mxge_softc_t *sc
/* 
   Test below is commented because it is believed that doing
   config read/write beyond 0xff will access the config space
-  for the next larger function.  Uncomment this and remove 
+  for the next larger function.  Uncomment this and remove
   the hacky pmap_mapdev() way of accessing config space when
   FreeBSD grows support for extended pcie config space access
*/
@@ -454,7 +454,7 @@ mxge_enable_nvidia_ecrc(mxge_softc_t *sc
}
*ptr32 = val | 0x40;
pmap_unmapdev((vm_offset_t)va, PAGE_SIZE);
-   if (mxge_verbose) 
+   if (mxge_verbose)
device_printf(sc-dev,
  Enabled ECRC on upstream Nvidia bridge 
  at %d:%d:%d\n,
@@ -573,7 +573,7 @@ mxge_firmware_probe(mxge_softc_t *sc)
}
}
 
-   /* 
+   /*
 * load the optimized firmware (which assumes aligned PCIe
 * completions) in order to see if it works on this host.
 */
@@ -583,12 +583,12 @@ mxge_firmware_probe(mxge_softc_t *sc)
return status;
}
 
-   /* 
+   /*
 * Enable ECRC if possible
 */
mxge_enable_nvidia_ecrc(sc);
 
-   /* 
+   /*
 * Run a DMA test which watches for unaligned completions and
 * aborts on the first one seen.  Not required on Z8ES or newer.
 */
@@ -657,7 +657,7 @@ mxge_validate_firmware(mxge_softc_t *sc,
 
 
if (be32toh(hdr-mcp_type) != MCP_TYPE_ETH) {
-   device_printf(sc-dev, Bad firmware type: 0x%x\n, 
+   device_printf(sc-dev, Bad firmware type: 0x%x\n,
  be32toh(hdr-mcp_type));
return EIO;
}
@@ -685,16 +685,16 @@ mxge_validate_firmware(mxge_softc_t *sc,
 static void *
 z_alloc(void *nil, u_int items, u_int size)
 {
-void *ptr;
+   void *ptr;
 
-ptr = malloc(items * size, M_TEMP, M_NOWAIT);
-return ptr;
+   ptr = malloc(items * size, M_TEMP, M_NOWAIT);
+   return ptr;
 }
 
 static void
 z_free(void *nil, void *ptr)
 {
-free(ptr, M_TEMP);
+   free(ptr, M_TEMP);
 }
 
 
@@ -732,7 +732,7 @@ mxge_load_firmware_helper(mxge_softc_t *
 
/* the uncompressed size is stored as the firmware version,
   which would otherwise go unused */
-   fw_len = (size_t) fw-version; 
+   fw_len = (size_t) fw-version;
inflate_buffer = malloc(fw_len, M_TEMP, M_NOWAIT);
if (inflate_buffer == NULL)
goto abort_with_zs;
@@ -755,7 +755,7 @@ mxge_load_firmware_helper(mxge_softc_t *
status = EIO;
goto abort_with_buffer;
}
-   hdr = (const void*)(inflate_buffer + hdr_offset); 
+   hdr = (const void*)(inflate_buffer + hdr_offset);
 
status = mxge_validate_firmware(sc, hdr);
if (status != 0)
@@ -832,14 +832,14 @@ mxge_dummy_rdma(mxge_softc_t *sc, int en
i++;
}
if (*confirm != 0x) {
-   device_printf(sc-dev, dummy rdma %s failed (%p = 0x%x), 
- (enable ? enable : disable), confirm, 
+   device_printf(sc-dev, dummy rdma %s failed (%p = 0x%x),
+ (enable ? enable : disable), confirm,
  *confirm);
}
return;
 }
 
-static int 
+static int
 mxge_send_cmd(mxge_softc_t *sc, uint32_t cmd, mxge_cmd_t *data)
 {
mcp_cmd_t *buf;
@@ -869,7 +869,7 @@ mxge_send_cmd(mxge_softc_t *sc, uint32_t
/* wait up to 20ms */
err = EAGAIN;
for (sleep_total = 0; sleep_total   20;