svn commit: r306485 - in head/sys: dev/hyperv/netvsc net

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 06:58:45 2016
New Revision: 306485
URL: https://svnweb.freebsd.org/changeset/base/306485

Log:
  hyperv/hn: Add stubs for OFFLOAD_CURRENT_CONFIG and NETWORK_CHANGE status
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8068

Modified:
  head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
  head/sys/net/rndis.h

Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c
==
--- head/sys/dev/hyperv/netvsc/hv_rndis_filter.cFri Sep 30 06:49:39 
2016(r306484)
+++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.cFri Sep 30 06:58:45 
2016(r306485)
@@ -155,6 +155,15 @@ hv_rf_receive_indicate_status(struct hn_
netvsc_linkstatus_callback(sc, 0);
break;
 
+   case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG:
+   /* Not really useful; ignore. */
+   break;
+
+   case RNDIS_STATUS_NETWORK_CHANGE:
+   /* TODO */
+   if_printf(sc->hn_ifp, "network changed\n");
+   break;
+
default:
/* TODO: */
if_printf(sc->hn_ifp, "unknown RNDIS status 0x%08x\n",

Modified: head/sys/net/rndis.h
==
--- head/sys/net/rndis.hFri Sep 30 06:49:39 2016(r306484)
+++ head/sys/net/rndis.hFri Sep 30 06:58:45 2016(r306485)
@@ -31,6 +31,8 @@
 #defineRNDIS_STATUS_PENDING0x0103L
 #defineRNDIS_STATUS_MEDIA_CONNECT  0x4001000BL
 #defineRNDIS_STATUS_MEDIA_DISCONNECT   0x4001000CL
+#defineRNDIS_STATUS_NETWORK_CHANGE 0x40010018L
+#defineRNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG0x40020006L
 #defineRNDIS_STATUS_BUFFER_OVERFLOW0x8005L
 #defineRNDIS_STATUS_FAILURE0xC001L
 #defineRNDIS_STATUS_NOT_SUPPORTED  0xC0BBL
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306484 - head/sys/modules/hyperv/vmbus

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 06:49:39 2016
New Revision: 306484
URL: https://svnweb.freebsd.org/changeset/base/306484

Log:
  hyperv/vmbus: Add missing vmbus_if.c to module build.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8067

Modified:
  head/sys/modules/hyperv/vmbus/Makefile

Modified: head/sys/modules/hyperv/vmbus/Makefile
==
--- head/sys/modules/hyperv/vmbus/Makefile  Fri Sep 30 06:30:16 2016
(r306483)
+++ head/sys/modules/hyperv/vmbus/Makefile  Fri Sep 30 06:49:39 2016
(r306484)
@@ -11,6 +11,7 @@ SRCS= hyperv.c \
vmbus_br.c \
vmbus_chan.c \
vmbus_et.c \
+   vmbus_if.c \
vmbus_xact.c
 SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306483 - head/sys/dev/hyperv/netvsc

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 06:30:16 2016
New Revision: 306483
URL: https://svnweb.freebsd.org/changeset/base/306483

Log:
  hyperv/hn: Fix detach and attach error handling.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8066

Modified:
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Sep 30 06:21:00 
2016(r306482)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Sep 30 06:30:16 
2016(r306483)
@@ -352,6 +352,7 @@ static void hn_resume(struct hn_softc *)
 static void hn_rx_drain(struct vmbus_channel *);
 static void hn_tx_resume(struct hn_softc *, int);
 static void hn_tx_ring_qflush(struct hn_tx_ring *);
+static int netvsc_detach(device_t dev);
 
 static void hn_nvs_handle_notify(struct hn_softc *sc,
const struct vmbus_chanpkt_hdr *pkt);
@@ -739,27 +740,28 @@ netvsc_attach(device_t dev)
 
return (0);
 failed:
-   /* TODO: reuse netvsc_detach() */
-   hn_destroy_tx_data(sc);
-   if (ifp != NULL)
-   if_free(ifp);
+   if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED)
+   hn_synth_detach(sc);
+   netvsc_detach(dev);
return (error);
 }
 
-/*
- * TODO: Use this for error handling on attach path.
- */
 static int
 netvsc_detach(device_t dev)
 {
struct hn_softc *sc = device_get_softc(dev);
+   struct ifnet *ifp = sc->hn_ifp;
 
-   /* TODO: ether_ifdetach */
-
-   HN_LOCK(sc);
-   /* TODO: hn_stop */
-   hn_synth_detach(sc);
-   HN_UNLOCK(sc);
+   if (device_is_attached(dev)) {
+   HN_LOCK(sc);
+   if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) {
+   if (ifp->if_drv_flags & IFF_DRV_RUNNING)
+   hn_stop(sc);
+   hn_synth_detach(sc);
+   }
+   HN_UNLOCK(sc);
+   ether_ifdetach(ifp);
+   }
 
ifmedia_removeall(&sc->hn_media);
hn_destroy_rx_data(sc);
@@ -768,10 +770,12 @@ netvsc_detach(device_t dev)
if (sc->hn_tx_taskq != hn_tx_taskq)
taskqueue_free(sc->hn_tx_taskq);
 
-   vmbus_xact_ctx_destroy(sc->hn_xact);
-   HN_LOCK_DESTROY(sc);
+   if (sc->hn_xact != NULL)
+   vmbus_xact_ctx_destroy(sc->hn_xact);
 
-   /* TODO: if_free */
+   if_free(ifp);
+
+   HN_LOCK_DESTROY(sc);
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306482 - head/sys/dev/hyperv/netvsc

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 06:21:00 2016
New Revision: 306482
URL: https://svnweb.freebsd.org/changeset/base/306482

Log:
  hyperv/hn: If synthetic parts are detached, don't touch them.
  
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8065

Modified:
  head/sys/dev/hyperv/netvsc/hv_net_vsc.h
  head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c

Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Sep 30 06:08:21 2016
(r306481)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Sep 30 06:21:00 2016
(r306482)
@@ -252,6 +252,7 @@ struct hn_softc {
 #define HN_FLAG_CHIM_CONNECTED 0x0002
 #define HN_FLAG_HAS_RSSKEY 0x0004
 #define HN_FLAG_HAS_RSSIND 0x0008
+#define HN_FLAG_SYNTH_ATTACHED 0x0010
 
 #define HN_CAP_VLAN0x0001
 #define HN_CAP_MTU 0x0002

Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Sep 30 06:08:21 
2016(r306481)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c  Fri Sep 30 06:21:00 
2016(r306482)
@@ -405,6 +405,9 @@ hn_rss_reconfig(struct hn_softc *sc)
 
HN_LOCK_ASSERT(sc);
 
+   if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0)
+   return (ENXIO);
+
/*
 * Disable RSS first.
 *
@@ -1618,6 +1621,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
 
HN_LOCK(sc);
 
+   if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) {
+   HN_UNLOCK(sc);
+   break;
+   }
+
if ((sc->hn_caps & HN_CAP_MTU) == 0) {
/* Can't change MTU */
HN_UNLOCK(sc);
@@ -1671,6 +1679,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, 
case SIOCSIFFLAGS:
HN_LOCK(sc);
 
+   if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) {
+   HN_UNLOCK(sc);
+   break;
+   }
+
if (ifp->if_flags & IFF_UP) {
/*
 * If only the state of the PROMISC flag changed,
@@ -1782,6 +1795,9 @@ hn_stop(struct hn_softc *sc)
 
HN_LOCK_ASSERT(sc);
 
+   KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED,
+   ("synthetic parts were not attached"));
+
/* Clear RUNNING bit _before_ hn_suspend() */
atomic_clear_int(&ifp->if_drv_flags, IFF_DRV_RUNNING);
hn_suspend(sc);
@@ -1858,6 +1874,9 @@ hn_init_locked(struct hn_softc *sc)
 
HN_LOCK_ASSERT(sc);
 
+   if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0)
+   return;
+
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
return;
 
@@ -3377,6 +3396,9 @@ hn_synth_attach(struct hn_softc *sc, int
int error, nsubch, nchan, i;
uint32_t old_caps;
 
+   KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0,
+   ("synthetic parts were attached"));
+
/* Save capabilities for later verification. */
old_caps = sc->hn_caps;
sc->hn_caps = 0;
@@ -3489,6 +3511,8 @@ back:
error = hn_attach_subchans(sc);
if (error)
return (error);
+
+   sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED;
return (0);
 }
 
@@ -3502,6 +3526,9 @@ hn_synth_detach(struct hn_softc *sc)
 {
HN_LOCK_ASSERT(sc);
 
+   KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED,
+   ("synthetic parts were not attached"));
+
/* Detach the RNDIS first. */
hn_rndis_detach(sc);
 
@@ -3510,6 +3537,8 @@ hn_synth_detach(struct hn_softc *sc)
 
/* Detach all of the channels. */
hn_detach_allchans(sc);
+
+   sc->hn_flags &= ~HN_FLAG_SYNTH_ATTACHED;
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306481 - head/sys/x86/x86

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 06:08:21 2016
New Revision: 306481
URL: https://svnweb.freebsd.org/changeset/base/306481

Log:
  x86/ioapic: Fix destination cpu for Hyper-V
  
  On Hyper-V:
  - Stick to the first cpu for all I/O APIC pins.
  - And don't allow destination cpu changes.
  
  Reviewed by:  jhb
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D7949

Modified:
  head/sys/x86/x86/io_apic.c

Modified: head/sys/x86/x86/io_apic.c
==
--- head/sys/x86/x86/io_apic.c  Fri Sep 30 05:51:11 2016(r306480)
+++ head/sys/x86/x86/io_apic.c  Fri Sep 30 06:08:21 2016(r306481)
@@ -412,6 +412,18 @@ ioapic_assign_cpu(struct intsrc *isrc, u
u_int old_id;
 
/*
+* On Hyper-V:
+* - Stick to the first cpu for all I/O APIC pins.
+* - And don't allow destination cpu changes.
+*/
+   if (vm_guest == VM_GUEST_HV) {
+   if (intpin->io_vector)
+   return (EINVAL);
+   else
+   apic_id = 0;
+   }
+
+   /*
 * keep 1st core as the destination for NMI
 */
if (intpin->io_irq == IRQ_NMI)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306480 - head/sys/compat/linuxkpi/common/include/linux

2016-09-29 Thread Sepherosa Ziehau
Author: sephe
Date: Fri Sep 30 05:51:11 2016
New Revision: 306480
URL: https://svnweb.freebsd.org/changeset/base/306480

Log:
  linuxkpi: Fix PCI BAR lazy allocation support.
  
  FreeBSD supports lazy allocation of PCI BAR, that is, when a device
  driver's attach method is invoked, even if the device's PCI BAR
  address wasn't initialized, the invocation of bus_alloc_resource_any()
  (the call chain: pci_alloc_resource() -> pci_alloc_multi_resource() ->
  pci_reserve_map() -> pci_write_bar()) would allocate a proper address
  for the PCI BAR and write this 'lazy allocated' address into the PCI
  BAR.
  
  This model works fine for native FreeBSD device drivers, but _not_ for
  device drivers shared with Linux (e.g. dev/mlx5/mlx5_core/mlx5_main.c
  and ofed/drivers/net/mlx4/main.c.  Both of them use
  pci_request_regions(), which doesn't work properly with the PCI BAR
  lazy allocation, because pci_resource_type() -> _pci_get_rle() always
  returns NULL, so pci_request_regions() doesn't have the opportunity to
  invoke bus_alloc_resource_any().  We now use pci_find_bar() in
  pci_resource_type(), which is able to locate all available PCI BARs
  even if some of them will be lazy allocated.
  
  Submitted by: Dexuan Cui 
  Reviewed by:  hps
  MFC after:1 week
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D8071

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Sep 30 05:30:16 
2016(r306479)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h Fri Sep 30 05:51:11 
2016(r306480)
@@ -233,11 +233,16 @@ pci_resource_len(struct pci_dev *pdev, i
 static inline int
 pci_resource_type(struct pci_dev *pdev, int bar)
 {
-   struct resource_list_entry *rle;
+   struct pci_map *pm;
 
-   if ((rle = _pci_get_bar(pdev, bar)) == NULL)
+   pm = pci_find_bar(pdev->dev.bsddev, PCIR_BAR(bar));
+   if (!pm)
return (-1);
-   return (rle->type);
+
+   if (PCI_BAR_IO(pm->pm_value))
+   return (SYS_RES_IOPORT);
+   else
+   return (SYS_RES_MEMORY);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306479 - head/sys/arm/allwinner

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Fri Sep 30 05:30:16 2016
New Revision: 306479
URL: https://svnweb.freebsd.org/changeset/base/306479

Log:
  ALLWINNER: ahci_devclass is local variable, don't export it.

Modified:
  head/sys/arm/allwinner/a10_ahci.c

Modified: head/sys/arm/allwinner/a10_ahci.c
==
--- head/sys/arm/allwinner/a10_ahci.c   Fri Sep 30 05:28:11 2016
(r306478)
+++ head/sys/arm/allwinner/a10_ahci.c   Fri Sep 30 05:30:16 2016
(r306479)
@@ -373,7 +373,7 @@ ahci_a10_detach(device_t dev)
return (ahci_detach(dev));
 }
 
-devclass_t ahci_devclass;
+static devclass_t ahci_devclass;
 
 static device_method_t ahci_ata_methods[] = {
DEVMETHOD(device_probe, ahci_a10_probe),
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306478 - in head/sys/dev/usb: . serial

2016-09-29 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Sep 30 05:28:11 2016
New Revision: 306478
URL: https://svnweb.freebsd.org/changeset/base/306478

Log:
  Add new USB ID.
  
  While at it remove some whitespaces.
  
  Submitted by: Jose Luis Duran 
  PR:   213110
  MFC after:1 week

Modified:
  head/sys/dev/usb/serial/u3g.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/u3g.c
==
--- head/sys/dev/usb/serial/u3g.c   Fri Sep 30 05:25:15 2016
(r306477)
+++ head/sys/dev/usb/serial/u3g.c   Fri Sep 30 05:28:11 2016
(r306478)
@@ -522,6 +522,7 @@ static const STRUCT_USB_HOST_ID u3g_devs
U3G_DEV(SIERRA, MC5728, 0),
U3G_DEV(SIERRA, MC7354, 0),
U3G_DEV(SIERRA, MC7355, 0),
+   U3G_DEV(SIERRA, MC7430, 0),
U3G_DEV(SIERRA, MC8700, 0),
U3G_DEV(SIERRA, MC8755, 0),
U3G_DEV(SIERRA, MC8755_2, 0),
@@ -631,7 +632,7 @@ u3g_sael_m460_init(struct usb_device *ud
static const uint8_t setup[][24] = {
 { 0x41, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 { 0x41, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 },
-{ 0x41, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
+{ 0x41, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
   0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
 { 0xc1, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02 },
@@ -643,7 +644,7 @@ u3g_sael_m460_init(struct usb_device *ud
 { 0x41, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00 },
 { 0x41, 0x19, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x11, 0x13 },
-{ 0x41, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 
+{ 0x41, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
   0x09, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
   0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 },
 { 0x41, 0x12, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00 },
@@ -653,7 +654,7 @@ u3g_sael_m460_init(struct usb_device *ud
 { 0x41, 0x19, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x11, 0x13 },
 { 0x41, 0x13, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
-  0x09, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 
+  0x09, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
   0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00 },
 { 0x41, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 },
};
@@ -687,7 +688,7 @@ u3g_sael_m460_init(struct usb_device *ud
DPRINTFN(0, "too small buffer\n");
continue;
}
-   err = usbd_do_request(udev, NULL, &req, 
+   err = usbd_do_request(udev, NULL, &req,
__DECONST(uint8_t *, &setup[n][8]));
}
if (err) {
@@ -863,7 +864,7 @@ u3g_attach(device_t dev)
}
 
/* copy in USB config */
-   for (n = 0; n != U3G_N_TRANSFER; n++) 
+   for (n = 0; n != U3G_N_TRANSFER; n++)
u3g_config_tmp[n] = u3g_config[n];
 
device_set_usb_desc(dev);

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsFri Sep 30 05:25:15 2016(r306477)
+++ head/sys/dev/usb/usbdevsFri Sep 30 05:28:11 2016(r306478)
@@ -4101,6 +4101,7 @@ product SIERRA E6893  0x6893  E6893
 product SIERRA MC8700  0x68A3  MC8700
 product SIERRA MC7354  0x68C0  MC7354
 product SIERRA MC7355  0x9041  MC7355
+product SIERRA MC7430  0x9071  Sierra Wireless MC7430 Qualcomm 
Snapdragon X7 LTE-A
 product SIERRA AC313U  0x68aa  Sierra Wireless AirCard 313U
 product SIERRA TRUINSTALL  0x0fff  Aircard Tru Installer
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306477 - in head/sys/arm/nvidia: . tegra124

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Fri Sep 30 05:25:15 2016
New Revision: 306477
URL: https://svnweb.freebsd.org/changeset/base/306477

Log:
  TEGRA: Prepare Tegra subtree for inclusion into ARM generic kernel.
   - use DEFINE_CLASS_0() for driver classes
   - unify driver names
   - cleanup driver definitions and bindings

Modified:
  head/sys/arm/nvidia/as3722.c
  head/sys/arm/nvidia/tegra124/tegra124_car.c
  head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
  head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
  head/sys/arm/nvidia/tegra124/tegra124_pmc.c
  head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c
  head/sys/arm/nvidia/tegra_abpmisc.c
  head/sys/arm/nvidia/tegra_ahci.c
  head/sys/arm/nvidia/tegra_efuse.c
  head/sys/arm/nvidia/tegra_ehci.c
  head/sys/arm/nvidia/tegra_gpio.c
  head/sys/arm/nvidia/tegra_i2c.c
  head/sys/arm/nvidia/tegra_lic.c
  head/sys/arm/nvidia/tegra_pcie.c
  head/sys/arm/nvidia/tegra_pinmux.c
  head/sys/arm/nvidia/tegra_rtc.c
  head/sys/arm/nvidia/tegra_sdhci.c
  head/sys/arm/nvidia/tegra_soctherm.c
  head/sys/arm/nvidia/tegra_usbphy.c

Modified: head/sys/arm/nvidia/as3722.c
==
--- head/sys/arm/nvidia/as3722.cFri Sep 30 03:45:41 2016
(r306476)
+++ head/sys/arm/nvidia/as3722.cFri Sep 30 05:25:15 2016
(r306477)
@@ -405,7 +405,7 @@ static device_method_t as3722_methods[] 
 };
 
 static devclass_t as3722_devclass;
-DEFINE_CLASS_0(gpio, as3722_driver, as3722_methods,
+static DEFINE_CLASS_0(gpio, as3722_driver, as3722_methods,
 sizeof(struct as3722_softc));
 EARLY_DRIVER_MODULE(as3722, iicbus, as3722_driver, as3722_devclass,
-0, 0, 74);
+NULL, NULL, 74);

Modified: head/sys/arm/nvidia/tegra124/tegra124_car.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_car.c Fri Sep 30 03:45:41 2016
(r306476)
+++ head/sys/arm/nvidia/tegra124/tegra124_car.c Fri Sep 30 05:25:15 2016
(r306477)
@@ -602,12 +602,7 @@ static device_method_t tegra124_car_meth
 };
 
 static devclass_t tegra124_car_devclass;
-
-static driver_t tegra124_car_driver = {
-   "tegra124_car",
-   tegra124_car_methods,
-   sizeof(struct tegra124_car_softc),
-};
-
+static DEFINE_CLASS_0(car, tegra124_car_driver, tegra124_car_methods,
+sizeof(struct tegra124_car_softc));
 EARLY_DRIVER_MODULE(tegra124_car, simplebus, tegra124_car_driver,
-tegra124_car_devclass, 0, 0, BUS_PASS_TIMER);
+tegra124_car_devclass, NULL, NULL, BUS_PASS_TIMER);

Modified: head/sys/arm/nvidia/tegra124/tegra124_coretemp.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_coretemp.cFri Sep 30 03:45:41 
2016(r306476)
+++ head/sys/arm/nvidia/tegra124/tegra124_coretemp.cFri Sep 30 05:25:15 
2016(r306477)
@@ -250,7 +250,6 @@ tegra124_coretemp_detach(device_t dev)
return (0);
 }
 
-
 static device_method_t tegra124_coretemp_methods[] = {
/* Device interface */
DEVMETHOD(device_identify,  tegra124_coretemp_identify),
@@ -263,11 +262,7 @@ static device_method_t tegra124_coretemp
 };
 
 static devclass_t tegra124_coretemp_devclass;
-static driver_t tegra124_coretemp_driver = {
-   "tegra124_coretemp",
-   tegra124_coretemp_methods,
-   sizeof(struct tegra124_coretemp_softc),
-};
-
+static DEFINE_CLASS_0(coretemp, tegra124_coretemp_driver,
+tegra124_coretemp_methods, sizeof(struct tegra124_coretemp_softc));
 DRIVER_MODULE(tegra124_coretemp, cpu, tegra124_coretemp_driver,
-tegra124_coretemp_devclass, 0, 0);
+tegra124_coretemp_devclass, NULL, NULL);

Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Fri Sep 30 03:45:41 
2016(r306476)
+++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Fri Sep 30 05:25:15 
2016(r306477)
@@ -588,11 +588,7 @@ static device_method_t tegra124_cpufreq_
 };
 
 static devclass_t tegra124_cpufreq_devclass;
-static driver_t tegra124_cpufreq_driver = {
-   "tegra124_cpufreq",
-   tegra124_cpufreq_methods,
-   sizeof(struct tegra124_cpufreq_softc),
-};
-
+static DEFINE_CLASS_0(cpufreq, tegra124_cpufreq_driver,
+tegra124_cpufreq_methods, sizeof(struct tegra124_cpufreq_softc));
 DRIVER_MODULE(tegra124_cpufreq, cpu, tegra124_cpufreq_driver,
-tegra124_cpufreq_devclass, 0, 0);
+tegra124_cpufreq_devclass, NULL, NULL);

Modified: head/sys/arm/nvidia/tegra124/tegra124_pmc.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_pmc.c Fri Sep 30 03:45:41 2016
(r306476)
+++ head/sys/arm/nvidia/tegra124/tegra124_pmc.c Fri Sep 30 05:25:15 2016
(r306477)
@@ -555,12 +555,8 @@ static device_method_t tegra124_pmc_meth
DEVMETHOD_END
 };
 
-st

Re: svn commit: r306473 - head/sys/dev/fdt

2016-09-29 Thread Justin Hibbits
If I remember correctly, newbus will throw an error if you try to create
two devices with the same number. Applying the logic of using the
cell-index property for all device nodes, if two sub buses from simplebus
have the same set of child nodes, with the same cell-index property values,
one set of children would error and not attach.  Of course this change is
only for simplebus, so shouldn't have too big an impact.

- Justin

On Sep 29, 2016 23:23, "Nathan Whitehorn"  wrote:

> Eh, I don't care much, especially if it's for cosmetic reasons only. I'm
> not sure I understand your suggested complication, but will leave the
> choice to you in any case.
> -Nathan
>
> On 09/29/16 21:16, Justin Hibbits wrote:
>
>>
>> It's more cosmetic than anything else. I did realize a potential
>> complication with it tonight, too, if newbus devices are created as
>> children (like DMA channels in this case), and have the cell-index
>> property. If you object it's an easy revert.
>>
>> - Justin
>>
>>
>> On Sep 29, 2016 23:10, "Nathan Whitehorn" > > wrote:
>>
>> I'm a little dubious about this change. It's not really safe to
>> rely on newbus unit numbers anywhere, so making them meaningful in
>> this context seems like a bad idea.
>> -Nathan
>>
>> On 09/29/16 19:48, Justin Hibbits wrote:
>>
>> Author: jhibbits
>> Date: Fri Sep 30 02:48:40 2016
>> New Revision: 306473
>> URL: https://svnweb.freebsd.org/changeset/base/306473
>> 
>>
>> Log:
>>Use the cell-index property as the unit number if available.
>>   Summary:
>>NXP/Freescale, among others, includes an optional
>> cell-index property
>>on nodes to denote the SoC block number of the node. This
>> can be useful if, for
>>example, a node is disabled or nonexistent in the fdt, or
>> the blocks are not
>>organized in address-sorted order.  For instance, on the
>> P1022, DMA2 is located
>>at CCSR offset 0xC000, while DMA1 is located at 0x21000.
>>   Reviewed By: jmcneill
>>   Differential Revision: https://reviews.freebsd.org/D8054
>> 
>>
>> Modified:
>>head/sys/dev/fdt/simplebus.c
>>
>> Modified: head/sys/dev/fdt/simplebus.c
>> 
>> ==
>> --- head/sys/dev/fdt/simplebus.cFri Sep 30 01:42:29
>> 2016(r306472)
>> +++ head/sys/dev/fdt/simplebus.cFri Sep 30 02:48:40
>> 2016(r306473)
>> @@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand
>> if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL)
>> return (NULL);
>> +
>> +   /*
>> +* If the order is unspecified, use the cell-index
>> field, if available.
>> +* The cell-index property is not part of any
>> standard, but is widely
>> +* used in NXP/Freescale and Marvell device trees.
>> +*/
>> +   if (order == -1)
>> +   OF_getencprop(node, "cell-index", &order,
>> sizeof(order));
>> +
>> cdev = device_add_child_ordered(dev, order, name, unit);
>> if (cdev == NULL) {
>> device_printf(dev, "<%s>: device_add_child
>> failed\n",
>>
>>
>>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r306473 - head/sys/dev/fdt

2016-09-29 Thread Nathan Whitehorn
Eh, I don't care much, especially if it's for cosmetic reasons only. I'm 
not sure I understand your suggested complication, but will leave the 
choice to you in any case.

-Nathan

On 09/29/16 21:16, Justin Hibbits wrote:


It's more cosmetic than anything else. I did realize a potential 
complication with it tonight, too, if newbus devices are created as 
children (like DMA channels in this case), and have the cell-index 
property. If you object it's an easy revert.


- Justin


On Sep 29, 2016 23:10, "Nathan Whitehorn" > wrote:


I'm a little dubious about this change. It's not really safe to
rely on newbus unit numbers anywhere, so making them meaningful in
this context seems like a bad idea.
-Nathan

On 09/29/16 19:48, Justin Hibbits wrote:

Author: jhibbits
Date: Fri Sep 30 02:48:40 2016
New Revision: 306473
URL: https://svnweb.freebsd.org/changeset/base/306473


Log:
   Use the cell-index property as the unit number if available.
  Summary:
   NXP/Freescale, among others, includes an optional
cell-index property
   on nodes to denote the SoC block number of the node. This
can be useful if, for
   example, a node is disabled or nonexistent in the fdt, or
the blocks are not
   organized in address-sorted order.  For instance, on the
P1022, DMA2 is located
   at CCSR offset 0xC000, while DMA1 is located at 0x21000.
  Reviewed By: jmcneill
  Differential Revision: https://reviews.freebsd.org/D8054


Modified:
   head/sys/dev/fdt/simplebus.c

Modified: head/sys/dev/fdt/simplebus.c

==
--- head/sys/dev/fdt/simplebus.cFri Sep 30 01:42:29
2016(r306472)
+++ head/sys/dev/fdt/simplebus.cFri Sep 30 02:48:40
2016(r306473)
@@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand
if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL)
return (NULL);
+
+   /*
+* If the order is unspecified, use the cell-index
field, if available.
+* The cell-index property is not part of any
standard, but is widely
+* used in NXP/Freescale and Marvell device trees.
+*/
+   if (order == -1)
+   OF_getencprop(node, "cell-index", &order,
sizeof(order));
+
cdev = device_add_child_ordered(dev, order, name, unit);
if (cdev == NULL) {
device_printf(dev, "<%s>: device_add_child
failed\n",




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


Re: svn commit: r306473 - head/sys/dev/fdt

2016-09-29 Thread Justin Hibbits
It's more cosmetic than anything else. I did realize a potential
complication with it tonight, too, if newbus devices are created as
children (like DMA channels in this case), and have the cell-index
property. If you object it's an easy revert.

- Justin

On Sep 29, 2016 23:10, "Nathan Whitehorn"  wrote:

> I'm a little dubious about this change. It's not really safe to rely on
> newbus unit numbers anywhere, so making them meaningful in this context
> seems like a bad idea.
> -Nathan
>
> On 09/29/16 19:48, Justin Hibbits wrote:
>
>> Author: jhibbits
>> Date: Fri Sep 30 02:48:40 2016
>> New Revision: 306473
>> URL: https://svnweb.freebsd.org/changeset/base/306473
>>
>> Log:
>>Use the cell-index property as the unit number if available.
>>   Summary:
>>NXP/Freescale, among others, includes an optional cell-index property
>>on nodes to denote the SoC block number of the node.  This can be
>> useful if, for
>>example, a node is disabled or nonexistent in the fdt, or the blocks
>> are not
>>organized in address-sorted order.  For instance, on the P1022, DMA2
>> is located
>>at CCSR offset 0xC000, while DMA1 is located at 0x21000.
>>   Reviewed By: jmcneill
>>   Differential Revision: https://reviews.freebsd.org/D8054
>>
>> Modified:
>>head/sys/dev/fdt/simplebus.c
>>
>> Modified: head/sys/dev/fdt/simplebus.c
>> 
>> ==
>> --- head/sys/dev/fdt/simplebus.cFri Sep 30 01:42:29 2016
>> (r306472)
>> +++ head/sys/dev/fdt/simplebus.cFri Sep 30 02:48:40 2016
>> (r306473)
>> @@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand
>> if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL)
>> return (NULL);
>> +
>> +   /*
>> +* If the order is unspecified, use the cell-index field, if
>> available.
>> +* The cell-index property is not part of any standard, but is
>> widely
>> +* used in NXP/Freescale and Marvell device trees.
>> +*/
>> +   if (order == -1)
>> +   OF_getencprop(node, "cell-index", &order, sizeof(order));
>> +
>> cdev = device_add_child_ordered(dev, order, name, unit);
>> if (cdev == NULL) {
>> device_printf(dev, "<%s>: device_add_child failed\n",
>>
>>
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r306473 - head/sys/dev/fdt

2016-09-29 Thread Nathan Whitehorn
I'm a little dubious about this change. It's not really safe to rely on 
newbus unit numbers anywhere, so making them meaningful in this context 
seems like a bad idea.

-Nathan

On 09/29/16 19:48, Justin Hibbits wrote:

Author: jhibbits
Date: Fri Sep 30 02:48:40 2016
New Revision: 306473
URL: https://svnweb.freebsd.org/changeset/base/306473

Log:
   Use the cell-index property as the unit number if available.
   
   Summary:

   NXP/Freescale, among others, includes an optional cell-index property
   on nodes to denote the SoC block number of the node.  This can be useful if, 
for
   example, a node is disabled or nonexistent in the fdt, or the blocks are not
   organized in address-sorted order.  For instance, on the P1022, DMA2 is 
located
   at CCSR offset 0xC000, while DMA1 is located at 0x21000.
   
   Reviewed By: jmcneill
   
   Differential Revision: https://reviews.freebsd.org/D8054


Modified:
   head/sys/dev/fdt/simplebus.c

Modified: head/sys/dev/fdt/simplebus.c
==
--- head/sys/dev/fdt/simplebus.cFri Sep 30 01:42:29 2016
(r306472)
+++ head/sys/dev/fdt/simplebus.cFri Sep 30 02:48:40 2016
(r306473)
@@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand
  
  	if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL)

return (NULL);
+
+   /*
+* If the order is unspecified, use the cell-index field, if available.
+* The cell-index property is not part of any standard, but is widely
+* used in NXP/Freescale and Marvell device trees.
+*/
+   if (order == -1)
+   OF_getencprop(node, "cell-index", &order, sizeof(order));
+
cdev = device_add_child_ordered(dev, order, name, unit);
if (cdev == NULL) {
device_printf(dev, "<%s>: device_add_child failed\n",



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


svn commit: r306476 - stable/11/sys/geom

2016-09-29 Thread Andrey V. Elsukov
Author: ae
Date: Fri Sep 30 03:45:41 2016
New Revision: 306476
URL: https://svnweb.freebsd.org/changeset/base/306476

Log:
  MFC r303019:
Use g_resize_provider() to change the size of GEOM_DISK provider,
when it is being opened. This should fix the possible loss of a resize
event when disk capacity changed.
  
  MFC r303288:
Do not invoke resize method if geom is being withered.
  
  MFC r303637:
Do not invoke resize event if initial disk size is zero. Some disks
report the size only after first opening.  And due to the events are
asynchronous, some consumers can receive this event too late and
this confuses them. This partially restores previous behaviour, and
at the same time this should fix the problem, when already opened
provider loses resize event.
  
  PR:   211028

Modified:
  stable/11/sys/geom/geom_disk.c
  stable/11/sys/geom/geom_subr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/geom/geom_disk.c
==
--- stable/11/sys/geom/geom_disk.c  Fri Sep 30 03:27:07 2016
(r306475)
+++ stable/11/sys/geom/geom_disk.c  Fri Sep 30 03:45:41 2016
(r306476)
@@ -126,7 +126,6 @@ g_disk_access(struct g_provider *pp, int
if (error != 0)
return (error);
}
-   pp->mediasize = dp->d_mediasize;
pp->sectorsize = dp->d_sectorsize;
if (dp->d_maxsize == 0) {
printf("WARNING: Disk drive %s%d has no d_maxsize\n",
@@ -143,6 +142,14 @@ g_disk_access(struct g_provider *pp, int
pp->stripeoffset = dp->d_stripeoffset;
pp->stripesize = dp->d_stripesize;
dp->d_flags |= DISKFLAG_OPEN;
+   /*
+* Do not invoke resize event when initial size was zero.
+* Some disks report its size only after first opening.
+*/
+   if (pp->mediasize == 0)
+   pp->mediasize = dp->d_mediasize;
+   else
+   g_resize_provider(pp, dp->d_mediasize);
} else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) {
if (dp->d_close != NULL) {
error = dp->d_close(dp);

Modified: stable/11/sys/geom/geom_subr.c
==
--- stable/11/sys/geom/geom_subr.c  Fri Sep 30 03:27:07 2016
(r306475)
+++ stable/11/sys/geom/geom_subr.c  Fri Sep 30 03:45:41 2016
(r306476)
@@ -636,7 +636,7 @@ g_resize_provider_event(void *arg, int f

LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) {
gp = cp->geom;
-   if (gp->resize != NULL)
+   if ((gp->flags & G_GEOM_WITHER) == 0 && gp->resize != NULL)
gp->resize(cp);
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306475 - stable/11/sys/netpfil/ipfw

2016-09-29 Thread Andrey V. Elsukov
Author: ae
Date: Fri Sep 30 03:27:07 2016
New Revision: 306475
URL: https://svnweb.freebsd.org/changeset/base/306475

Log:
  MFC r305940:
Move opcode rewriter init and destroy handlers into non-VNET code.
  
PR: 212576,212649,212077
Submitted by:   John Zielinski

Modified:
  stable/11/sys/netpfil/ipfw/ip_fw2.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c
==
--- stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Sep 30 03:03:42 2016
(r306474)
+++ stable/11/sys/netpfil/ipfw/ip_fw2.c Fri Sep 30 03:27:07 2016
(r306475)
@@ -2691,6 +2691,7 @@ ipfw_init(void)
  default_fw_tables = IPFW_TABLES_MAX;
 
ipfw_init_sopt_handler();
+   ipfw_init_obj_rewriter();
ipfw_iface_init();
return (error);
 }
@@ -2704,6 +2705,7 @@ ipfw_destroy(void)
 
ipfw_iface_destroy();
ipfw_destroy_sopt_handler();
+   ipfw_destroy_obj_rewriter();
printf("IP firewall unloaded\n");
 }
 
@@ -2738,7 +2740,6 @@ vnet_ipfw_init(const void *unused)
/* Init shared services hash table */
ipfw_init_srv(chain);
 
-   ipfw_init_obj_rewriter();
ipfw_init_counters();
/* insert the default rule and create the initial map */
chain->n_rules = 1;
@@ -2845,7 +2846,6 @@ vnet_ipfw_uninit(const void *unused)
IPFW_LOCK_DESTROY(chain);
ipfw_dyn_uninit(1); /* free the remaining parts */
ipfw_destroy_counters();
-   ipfw_destroy_obj_rewriter();
return (0);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r306355 - in head/sys: dev/atkbdc sys

2016-09-29 Thread Oleksandr Tymoshenko

> On Sep 27, 2016, at 1:55 PM, John Baldwin  wrote:
> 
> On Monday, September 26, 2016 10:06:19 PM Oleksandr Tymoshenko wrote:
>> Author: gonzo
>> Date: Mon Sep 26 22:06:19 2016
>> New Revision: 306355
>> URL: https://svnweb.freebsd.org/changeset/base/306355
>> 
>> Log:
>>  Add Elantech trackpad support
>> 
>>  Elantech trackpads are found in some laptops like the Asus UX31E. They
>>  are "synaptics compatible" but use a slightly different protocol.
>> 
>>  Elantech hardware support is not enabled by default and just like
>>  Synaptic or TrackPoint devices it should be enabled by setting
>>  tunable, in this case hw.psm.elantech_support, to non-zero value
>> 
>>  PR: 205690
>>  Submitted by:   Vladimir Kondratyev 
>>  MFC after:  1 week
>> 
>> Modified: head/sys/dev/atkbdc/psm.c
>> ==
>> --- head/sys/dev/atkbdc/psm.cMon Sep 26 20:26:19 2016
>> (r306354)
>> +++ head/sys/dev/atkbdc/psm.cMon Sep 26 22:06:19 2016
>> (r306355)
>> @@ -389,6 +465,9 @@ TUNABLE_INT("hw.psm.synaptics_support", 
>> static int trackpoint_support = 0;
>> TUNABLE_INT("hw.psm.trackpoint_support", &trackpoint_support);
>> 
>> +static int elantech_support = 0;
>> +TUNABLE_INT("hw.psm.elantech_support", &elantech_support);
>> +
>> static int verbose = PSM_DEBUG;
>> TUNABLE_INT("debug.psm.loglevel", &verbose);
> 
> It would be good to expose all these tunables as CTLFLAG_RDTUN sysctls.  
> Exposing
> them that way with a decent description string makes it easier for users to
> discover tunables.

Thanks for suggestion, John. Committed in r306474

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

svn commit: r306474 - head/sys/dev/atkbdc

2016-09-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Fri Sep 30 03:03:42 2016
New Revision: 306474
URL: https://svnweb.freebsd.org/changeset/base/306474

Log:
  Replace explicit TUNABLE_INT to sysctl with CTLFLAG_TUN
  
  - Replace tunables-only hw.psm.synaptics_support, hw.psm.trackpoint_support,
  and hw.psm.elantech_support with respective sysctls declared with
  CTLFLAG_TUN. It simplifies checking them in userland, also makes them
  easier to get discovered by user
  - Get rid of debug.psm.loglevel and hw.psm.tap_enabled TUNABLE_INT
  declaration by adding CTLFLAG_TUN to read/write sysctls that were
  already declared for these tunables.
  
  Suggested by: jhb

Modified:
  head/sys/dev/atkbdc/psm.c

Modified: head/sys/dev/atkbdc/psm.c
==
--- head/sys/dev/atkbdc/psm.c   Fri Sep 30 02:48:40 2016(r306473)
+++ head/sys/dev/atkbdc/psm.c   Fri Sep 30 03:03:42 2016(r306474)
@@ -457,19 +457,10 @@ static devclass_t psm_devclass;
 
 /* Tunables */
 static int tap_enabled = -1;
-TUNABLE_INT("hw.psm.tap_enabled", &tap_enabled);
-
+static int verbose = PSM_DEBUG;
 static int synaptics_support = 0;
-TUNABLE_INT("hw.psm.synaptics_support", &synaptics_support);
-
 static int trackpoint_support = 0;
-TUNABLE_INT("hw.psm.trackpoint_support", &trackpoint_support);
-
 static int elantech_support = 0;
-TUNABLE_INT("hw.psm.elantech_support", &elantech_support);
-
-static int verbose = PSM_DEBUG;
-TUNABLE_INT("debug.psm.loglevel", &verbose);
 
 /* for backward compatibility */
 #defineOLD_MOUSE_GETHWINFO _IOR('M', 1, old_mousehw_t)
@@ -2460,7 +2451,7 @@ psmtimeout(void *arg)
 static SYSCTL_NODE(_debug, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse");
 static SYSCTL_NODE(_hw, OID_AUTO, psm, CTLFLAG_RD, 0, "ps/2 mouse");
 
-SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RW, &verbose, 0,
+SYSCTL_INT(_debug_psm, OID_AUTO, loglevel, CTLFLAG_RWTUN, &verbose, 0,
 "Verbosity level");
 
 static int psmhz = 20;
@@ -2482,7 +2473,7 @@ static int pkterrthresh = 2;
 SYSCTL_INT(_debug_psm, OID_AUTO, pkterrthresh, CTLFLAG_RW, &pkterrthresh, 0,
 "Number of error packets allowed before reinitializing the mouse");
 
-SYSCTL_INT(_hw_psm, OID_AUTO, tap_enabled, CTLFLAG_RW, &tap_enabled, 0,
+SYSCTL_INT(_hw_psm, OID_AUTO, tap_enabled, CTLFLAG_RWTUN, &tap_enabled, 0,
 "Enable tap and drag gestures");
 static int tap_threshold = PSM_TAP_THRESHOLD;
 SYSCTL_INT(_hw_psm, OID_AUTO, tap_threshold, CTLFLAG_RW, &tap_threshold, 0,
@@ -2491,6 +2482,16 @@ static int tap_timeout = PSM_TAP_TIMEOUT
 SYSCTL_INT(_hw_psm, OID_AUTO, tap_timeout, CTLFLAG_RW, &tap_timeout, 0,
 "Tap timeout for touchpads");
 
+/* Tunables */
+SYSCTL_INT(_hw_psm, OID_AUTO, synaptics_support, CTLFLAG_RDTUN,
+&synaptics_support, 0, "Enable support for Synaptics touchpads");
+
+SYSCTL_INT(_hw_psm, OID_AUTO, trackpoint_support, CTLFLAG_RDTUN,
+&trackpoint_support, 0, "Enable support for IBM/Lenovo TrackPoint");
+
+SYSCTL_INT(_hw_psm, OID_AUTO, elantech_support, CTLFLAG_RDTUN,
+&elantech_support, 0, "Enable support for Elantech touchpads");
+
 static void
 psmintr(void *arg)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306473 - head/sys/dev/fdt

2016-09-29 Thread Justin Hibbits
Author: jhibbits
Date: Fri Sep 30 02:48:40 2016
New Revision: 306473
URL: https://svnweb.freebsd.org/changeset/base/306473

Log:
  Use the cell-index property as the unit number if available.
  
  Summary:
  NXP/Freescale, among others, includes an optional cell-index property
  on nodes to denote the SoC block number of the node.  This can be useful if, 
for
  example, a node is disabled or nonexistent in the fdt, or the blocks are not
  organized in address-sorted order.  For instance, on the P1022, DMA2 is 
located
  at CCSR offset 0xC000, while DMA1 is located at 0x21000.
  
  Reviewed By: jmcneill
  
  Differential Revision: https://reviews.freebsd.org/D8054

Modified:
  head/sys/dev/fdt/simplebus.c

Modified: head/sys/dev/fdt/simplebus.c
==
--- head/sys/dev/fdt/simplebus.cFri Sep 30 01:42:29 2016
(r306472)
+++ head/sys/dev/fdt/simplebus.cFri Sep 30 02:48:40 2016
(r306473)
@@ -265,6 +265,15 @@ simplebus_add_device(device_t dev, phand
 
if ((ndi = simplebus_setup_dinfo(dev, node, di)) == NULL)
return (NULL);
+
+   /*
+* If the order is unspecified, use the cell-index field, if available.
+* The cell-index property is not part of any standard, but is widely
+* used in NXP/Freescale and Marvell device trees.
+*/
+   if (order == -1)
+   OF_getencprop(node, "cell-index", &order, sizeof(order));
+
cdev = device_add_child_ordered(dev, order, name, unit);
if (cdev == NULL) {
device_printf(dev, "<%s>: device_add_child failed\n",
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r306472 - in stable/10/sys/amd64/vmm: . io

2016-09-29 Thread John Baldwin
On Friday, September 30, 2016 01:42:29 AM John Baldwin wrote:
> Author: jhb
> Date: Fri Sep 30 01:42:29 2016
> New Revision: 306472
> URL: https://svnweb.freebsd.org/changeset/base/306472
> 
> Log:
>   MFC 304858,305485: Fix various issues with PCI pass through and VT-d.
>   
>   304858:
>   Enable I/O MMU when PCI pass through is first used.
>   
>   Rather than enabling the I/O MMU when the vmm module is loaded,
>   defer initialization until the first attempt to pass a PCI device
>   through to a guest.  If the I/O MMU fails to initialize or is not
>   present, than fail the attempt to pass a PCI device through to a
>   guest.
>   
>   The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
>   no longer enabled during boot.  However, the I/O MMU support can be
>   disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
>   use of the I/O MMU on any systems where it is buggy.
>   
>   305485:
>   Leave ppt devices in the host domain when they are not attached to a VM.
>   
>   This allows a pass through device to be reset to a normal device driver
>   on the host and reused on the host.  ppt devices are now always active in
>   some I/O MMU domain when the I/O MMU is active, either the host domain
>   or the domain of a VM they are attached to.

I did not MFC 305497 (update I/O MMU when adding/removing PCI devices) since
there was a conflict and neither SR-IOV nor PCI-e Hotplug are in 10 (though
Cardbus is in 10).  At this point I doubt I will get around to merging Hotplug
to 10, but if I do then 305497 could be merged.

-- 
John Baldwin

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


svn commit: r306472 - in stable/10/sys/amd64/vmm: . io

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:42:29 2016
New Revision: 306472
URL: https://svnweb.freebsd.org/changeset/base/306472

Log:
  MFC 304858,305485: Fix various issues with PCI pass through and VT-d.
  
  304858:
  Enable I/O MMU when PCI pass through is first used.
  
  Rather than enabling the I/O MMU when the vmm module is loaded,
  defer initialization until the first attempt to pass a PCI device
  through to a guest.  If the I/O MMU fails to initialize or is not
  present, than fail the attempt to pass a PCI device through to a
  guest.
  
  The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
  no longer enabled during boot.  However, the I/O MMU support can be
  disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
  use of the I/O MMU on any systems where it is buggy.
  
  305485:
  Leave ppt devices in the host domain when they are not attached to a VM.
  
  This allows a pass through device to be reset to a normal device driver
  on the host and reused on the host.  ppt devices are now always active in
  some I/O MMU domain when the I/O MMU is active, either the host domain
  or the domain of a VM they are attached to.

Modified:
  stable/10/sys/amd64/vmm/io/iommu.c
  stable/10/sys/amd64/vmm/io/iommu.h
  stable/10/sys/amd64/vmm/io/ppt.c
  stable/10/sys/amd64/vmm/vmm.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/vmm/io/iommu.c
==
--- stable/10/sys/amd64/vmm/io/iommu.c  Fri Sep 30 01:39:18 2016
(r306471)
+++ stable/10/sys/amd64/vmm/io/iommu.c  Fri Sep 30 01:42:29 2016
(r306472)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 
 #include "vmm_util.h"
@@ -51,6 +52,10 @@ static int iommu_avail;
 SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail,
 0, "bhyve iommu initialized?");
 
+static int iommu_enable = 1;
+SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0,
+"Enable use of I/O MMU (required for PCI passthrough).");
+
 static struct iommu_ops *ops;
 static void *host_domain;
 
@@ -148,14 +153,16 @@ IOMMU_DISABLE(void)
(*ops->disable)();
 }
 
-void
+static void
 iommu_init(void)
 {
int error, bus, slot, func;
vm_paddr_t maxaddr;
-   const char *name;
device_t dev;
 
+   if (!iommu_enable)
+   return;
+
if (vmm_is_intel())
ops = &iommu_ops_intel;
else if (vmm_is_amd())
@@ -174,8 +181,13 @@ iommu_init(void)
 */
maxaddr = vmm_mem_maxaddr();
host_domain = IOMMU_CREATE_DOMAIN(maxaddr);
-   if (host_domain == NULL)
-   panic("iommu_init: unable to create a host domain");
+   if (host_domain == NULL) {
+   printf("iommu_init: unable to create a host domain");
+   IOMMU_CLEANUP();
+   ops = NULL;
+   iommu_avail = 0;
+   return;
+   }
 
/*
 * Create 1:1 mappings from '0' to 'maxaddr' for devices assigned to
@@ -190,12 +202,7 @@ iommu_init(void)
if (dev == NULL)
continue;
 
-   /* skip passthrough devices */
-   name = device_get_name(dev);
-   if (name != NULL && strcmp(name, "ppt") == 0)
-   continue;
-
-   /* everything else belongs to the host domain */
+   /* Everything belongs to the host domain. */
iommu_add_device(host_domain,
pci_get_rid(dev));
}
@@ -216,7 +223,16 @@ iommu_cleanup(void)
 void *
 iommu_create_domain(vm_paddr_t maxaddr)
 {
+   static volatile int iommu_initted;
 
+   if (iommu_initted < 2) {
+   if (atomic_cmpset_int(&iommu_initted, 0, 1)) {
+   iommu_init();
+   atomic_store_rel_int(&iommu_initted, 2);
+   } else
+   while (iommu_initted == 1)
+   cpu_spinwait();
+   }
return (IOMMU_CREATE_DOMAIN(maxaddr));
 }
 

Modified: stable/10/sys/amd64/vmm/io/iommu.h
==
--- stable/10/sys/amd64/vmm/io/iommu.h  Fri Sep 30 01:39:18 2016
(r306471)
+++ stable/10/sys/amd64/vmm/io/iommu.h  Fri Sep 30 01:42:29 2016
(r306472)
@@ -61,7 +61,6 @@ struct iommu_ops {
 extern struct iommu_ops iommu_ops_intel;
 extern struct iommu_ops iommu_ops_amd;
 
-void   iommu_init(void);
 void   iommu_cleanup(void);
 void   *iommu_host_domain(void);
 void   *iommu_create_domain(vm_paddr_t maxaddr);

Modified: stable/10/sys/amd64/vmm/io/ppt.c
=

svn commit: r306471 - in stable/11: share/man/man9 sys/amd64/vmm sys/amd64/vmm/io sys/dev/pci

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:39:18 2016
New Revision: 306471
URL: https://svnweb.freebsd.org/changeset/base/306471

Log:
  MFC 304858,305485,305497: Fix various issues with PCI pass through and VT-d.
  
  304858:
  Enable I/O MMU when PCI pass through is first used.
  
  Rather than enabling the I/O MMU when the vmm module is loaded,
  defer initialization until the first attempt to pass a PCI device
  through to a guest.  If the I/O MMU fails to initialize or is not
  present, than fail the attempt to pass a PCI device through to a
  guest.
  
  The hw.vmm.force_iommu tunable has been removed since the I/O MMU is
  no longer enabled during boot.  However, the I/O MMU support can be
  disabled by setting the hw.vmm.iommu.enable tunable to 0 to prevent
  use of the I/O MMU on any systems where it is buggy.
  
  305485:
  Leave ppt devices in the host domain when they are not attached to a VM.
  
  This allows a pass through device to be reset to a normal device driver
  on the host and reused on the host.  ppt devices are now always active in
  some I/O MMU domain when the I/O MMU is active, either the host domain
  or the domain of a VM they are attached to.
  
  305497:
  Update the I/O MMU in bhyve when PCI devices are added and removed.
  
  When the I/O MMU is active in bhyve, all PCI devices need valid entries
  in the DMAR context tables. The I/O MMU code does a single enumeration
  of the available PCI devices during initialization to add all existing
  devices to a domain representing the host. The ppt(4) driver then moves
  pass through devices in and out of domains for virtual machines as needed.
  However, when new PCI devices were added at runtime either via SR-IOV or
  HotPlug, the I/O MMU tables were not updated.
  
  This change adds a new set of EVENTHANDLERS that are invoked when PCI
  devices are added and deleted. The I/O MMU driver in bhyve installs
  handlers for these events which it uses to add and remove devices to
  the "host" domain.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/share/man/man9/pci.9
  stable/11/sys/amd64/vmm/io/iommu.c
  stable/11/sys/amd64/vmm/io/iommu.h
  stable/11/sys/amd64/vmm/io/ppt.c
  stable/11/sys/amd64/vmm/vmm.c
  stable/11/sys/dev/pci/pci.c
  stable/11/sys/dev/pci/pcivar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/pci.9
==
--- stable/11/share/man/man9/pci.9  Fri Sep 30 01:16:09 2016
(r306470)
+++ stable/11/share/man/man9/pci.9  Fri Sep 30 01:39:18 2016
(r306471)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 1, 2016
+.Dd September 6, 2016
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -149,6 +149,10 @@
 .Fn pcie_read_config "device_t dev" "int reg" "int width"
 .Ft void
 .Fn pcie_write_config "device_t dev" "int reg" "uint32_t val" "int width"
+.Ft void
+.Fn pci_event_fn "void *arg" "device_t dev"
+.Fn EVENTHANDLER_REGISTER "pci_add_device" "pci_event_fn"
+.Fn EVENTHANDLER_DEREGISTER "pci_delete_resource" "pci_event_fn"
 .In dev/pci/pci_iov.h
 .Ft int
 .Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
@@ -910,6 +914,24 @@ with one in the new distribution.
 The
 .Fn pci_remap_msix
 function will fail if this condition is not met.
+.Ss Device Events
+The
+.Va pci_add_device
+event handler is invoked every time a new PCI device is added to the system.
+This includes the creation of Virtual Functions via SR-IOV.
+.Pp
+The
+.Va pci_delete_device
+event handler is invoked every time a PCI device is removed from the system.
+.Pp
+Both event handlers pass the
+.Vt device_t
+object of the relevant PCI device as
+.Fa dev
+to each callback function.
+Both event handlers are invoked while
+.Fa dev
+is unattached but with valid instance variables.
 .Sh SEE ALSO
 .Xr pci 4 ,
 .Xr pciconf 8 ,
@@ -921,6 +943,7 @@ function will fail if this condition is 
 .Xr devclass 9 ,
 .Xr device 9 ,
 .Xr driver 9 ,
+.Xr eventhandler 9 ,
 .Xr rman 9
 .Rs
 .%B FreeBSD Developers' Handbook

Modified: stable/11/sys/amd64/vmm/io/iommu.c
==
--- stable/11/sys/amd64/vmm/io/iommu.c  Fri Sep 30 01:16:09 2016
(r306470)
+++ stable/11/sys/amd64/vmm/io/iommu.c  Fri Sep 30 01:39:18 2016
(r306471)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 
 #include "vmm_util.h"
@@ -51,8 +52,13 @@ static int iommu_avail;
 SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail,
 0, "bhyve iommu initialized?");
 
+static int iommu_enable = 1;
+SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, enable, CTLFLAG_RDTUN, &iommu_enable, 0,
+"Enable use of I/O MMU (required for PCI passthrough).");
+
 static struct iommu_ops *ops;
 static void *host_domain;
+static eventhandler_tag add_tag, delete_tag;
 
 static __inline int
 IOMMU_INIT(void)
@@ -148,14 +154,31 @@ IOMMU_DISABLE(void)
  

svn commit: r306470 - in stable: 10/share/man/man9 11/share/man/man9

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:16:09 2016
New Revision: 306470
URL: https://svnweb.freebsd.org/changeset/base/306470

Log:
  MFC 305248: Remove warning about pci_addr_t being different sizes.
  
  pci_addr_t has always been 64-bits since r163805.

Modified:
  stable/10/share/man/man9/pci.9
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man9/pci.9
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/share/man/man9/pci.9
==
--- stable/10/share/man/man9/pci.9  Fri Sep 30 01:13:57 2016
(r306469)
+++ stable/10/share/man/man9/pci.9  Fri Sep 30 01:16:09 2016
(r306470)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 24, 2016
+.Dd September 1, 2016
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -793,11 +793,6 @@ with one in the new distribution.
 The
 .Fn pci_remap_msix
 function will fail if this condition is not met.
-.Sh IMPLEMENTATION NOTES
-The
-.Vt pci_addr_t
-type varies according to the size of the PCI bus address
-space on the target architecture.
 .Sh SEE ALSO
 .Xr pci 4 ,
 .Xr pciconf 8 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306470 - in stable: 10/share/man/man9 11/share/man/man9

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:16:09 2016
New Revision: 306470
URL: https://svnweb.freebsd.org/changeset/base/306470

Log:
  MFC 305248: Remove warning about pci_addr_t being different sizes.
  
  pci_addr_t has always been 64-bits since r163805.

Modified:
  stable/11/share/man/man9/pci.9
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/share/man/man9/pci.9
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/share/man/man9/pci.9
==
--- stable/11/share/man/man9/pci.9  Fri Sep 30 01:13:57 2016
(r306469)
+++ stable/11/share/man/man9/pci.9  Fri Sep 30 01:16:09 2016
(r306470)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 3, 2016
+.Dd September 1, 2016
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -910,11 +910,6 @@ with one in the new distribution.
 The
 .Fn pci_remap_msix
 function will fail if this condition is not met.
-.Sh IMPLEMENTATION NOTES
-The
-.Vt pci_addr_t
-type varies according to the size of the PCI bus address
-space on the target architecture.
 .Sh SEE ALSO
 .Xr pci 4 ,
 .Xr pciconf 8 ,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306469 - in stable: 10/share/man/man4 10/sys/dev/pci 11/share/man/man4 11/sys/dev/pci

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:13:57 2016
New Revision: 306469
URL: https://svnweb.freebsd.org/changeset/base/306469

Log:
  MFC 303881: Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.
  
  Previously the loop in PCIIOCGETCONF would terminate as soon as it
  found enough matches.  Now it will continue iterating through the
  PCI device list and only terminate if it finds another matching device
  for which it has no room to store a conf structure.  This means that
  PCI_GETCONF_LAST_DEVICE is reliably returned when the number of
  matching devices is equal to the number of slots in the matches
  buffer.  For example, if a program requests the conf structure for a
  single PCI function with a specified domain/bus/slot/function it will
  now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS.
  
  While here, simplify the loop conditional a bit more by explicitly
  breaking out of the loop if copyout() fails and removing a redundant
  i < pci_numdevs check.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/10/share/man/man4/pci.4
  stable/10/sys/dev/pci/pci_user.c
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/share/man/man4/pci.4
  stable/11/sys/dev/pci/pci_user.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/share/man/man4/pci.4
==
--- stable/10/share/man/man4/pci.4  Fri Sep 30 00:43:30 2016
(r306468)
+++ stable/10/share/man/man4/pci.4  Fri Sep 30 01:13:57 2016
(r306469)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 3, 2008
+.Dd August 9, 2016
 .Dt PCI 4
 .Os
 .Sh NAME
@@ -229,7 +229,8 @@ The status tells the user the dispositio
 The possible status values are:
 .Bl -ohang
 .It PCI_GETCONF_LAST_DEVICE
-This means that there are no more devices in the PCI device list after the
+This means that there are no more devices in the PCI device list matching
+the specified criteria after the
 ones returned in the
 .Va matches
 buffer.
@@ -245,9 +246,7 @@ and
 to zero to start over at the beginning of the list.
 .It PCI_GETCONF_MORE_DEVS
 This tells the user that his buffer was not large enough to hold all of the
-remaining devices in the device list that possibly match his criteria.
-It is possible for this status to be returned, even when none of the remaining
-devices in the list would match the user's criteria.
+remaining devices in the device list that match his criteria.
 .It PCI_GETCONF_ERROR
 This indicates a general error while servicing the user's request.
 If the

Modified: stable/10/sys/dev/pci/pci_user.c
==
--- stable/10/sys/dev/pci/pci_user.cFri Sep 30 00:43:30 2016
(r306468)
+++ stable/10/sys/dev/pci/pci_user.cFri Sep 30 01:13:57 2016
(r306469)
@@ -708,10 +708,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 * Go through the list of devices and copy out the devices
 * that match the user's criteria.
 */
-   for (cio->num_matches = 0, error = 0, i = 0,
+   for (cio->num_matches = 0, i = 0,
 dinfo = STAILQ_FIRST(devlist_head);
-(dinfo != NULL) && (cio->num_matches < ionum) &&
-(error == 0) && (i < pci_numdevs);
+dinfo != NULL;
 dinfo = STAILQ_NEXT(dinfo, pci_links), i++) {
 
if (i < cio->offset)
@@ -833,11 +832,12 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
} else
 #endif /* PRE7_COMPAT */
confdata = &dinfo->conf;
-   /* Only if we can copy it out do we count it. */
-   if (!(error = copyout(confdata,
+   error = copyout(confdata,
(caddr_t)cio->matches +
-   confsz * cio->num_matches, confsz)))
-   cio->num_matches++;
+   confsz * cio->num_matches, confsz);
+   if (error)
+   break;
+   cio->num_matches++;
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306469 - in stable: 10/share/man/man4 10/sys/dev/pci 11/share/man/man4 11/sys/dev/pci

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 01:13:57 2016
New Revision: 306469
URL: https://svnweb.freebsd.org/changeset/base/306469

Log:
  MFC 303881: Reliably return PCI_GETCONF_LAST_DEVICE from PCIOCGETCONF.
  
  Previously the loop in PCIIOCGETCONF would terminate as soon as it
  found enough matches.  Now it will continue iterating through the
  PCI device list and only terminate if it finds another matching device
  for which it has no room to store a conf structure.  This means that
  PCI_GETCONF_LAST_DEVICE is reliably returned when the number of
  matching devices is equal to the number of slots in the matches
  buffer.  For example, if a program requests the conf structure for a
  single PCI function with a specified domain/bus/slot/function it will
  now get PCI_GETCONF_LAST_DEVICE instead of PCI_GETCONF_MORE_DEVS.
  
  While here, simplify the loop conditional a bit more by explicitly
  breaking out of the loop if copyout() fails and removing a redundant
  i < pci_numdevs check.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/share/man/man4/pci.4
  stable/11/sys/dev/pci/pci_user.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/share/man/man4/pci.4
  stable/10/sys/dev/pci/pci_user.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/share/man/man4/pci.4
==
--- stable/11/share/man/man4/pci.4  Fri Sep 30 00:43:30 2016
(r306468)
+++ stable/11/share/man/man4/pci.4  Fri Sep 30 01:13:57 2016
(r306469)
@@ -254,7 +254,8 @@ The status tells the user the dispositio
 The possible status values are:
 .Bl -ohang
 .It PCI_GETCONF_LAST_DEVICE
-This means that there are no more devices in the PCI device list after the
+This means that there are no more devices in the PCI device list matching
+the specified criteria after the
 ones returned in the
 .Va matches
 buffer.
@@ -270,9 +271,7 @@ and
 to zero to start over at the beginning of the list.
 .It PCI_GETCONF_MORE_DEVS
 This tells the user that his buffer was not large enough to hold all of the
-remaining devices in the device list that possibly match his criteria.
-It is possible for this status to be returned, even when none of the remaining
-devices in the list would match the user's criteria.
+remaining devices in the device list that match his criteria.
 .It PCI_GETCONF_ERROR
 This indicates a general error while servicing the user's request.
 If the

Modified: stable/11/sys/dev/pci/pci_user.c
==
--- stable/11/sys/dev/pci/pci_user.cFri Sep 30 00:43:30 2016
(r306468)
+++ stable/11/sys/dev/pci/pci_user.cFri Sep 30 01:13:57 2016
(r306469)
@@ -708,10 +708,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 * Go through the list of devices and copy out the devices
 * that match the user's criteria.
 */
-   for (cio->num_matches = 0, error = 0, i = 0,
+   for (cio->num_matches = 0, i = 0,
 dinfo = STAILQ_FIRST(devlist_head);
-(dinfo != NULL) && (cio->num_matches < ionum) &&
-(error == 0) && (i < pci_numdevs);
+dinfo != NULL;
 dinfo = STAILQ_NEXT(dinfo, pci_links), i++) {
 
if (i < cio->offset)
@@ -833,11 +832,12 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
} else
 #endif /* PRE7_COMPAT */
confdata = &dinfo->conf;
-   /* Only if we can copy it out do we count it. */
-   if (!(error = copyout(confdata,
+   error = copyout(confdata,
(caddr_t)cio->matches +
-   confsz * cio->num_matches, confsz)))
-   cio->num_matches++;
+   confsz * cio->num_matches, confsz);
+   if (error)
+   break;
+   cio->num_matches++;
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306468 - stable/10/sys/dev/pci

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 00:43:30 2016
New Revision: 306468
URL: https://svnweb.freebsd.org/changeset/base/306468

Log:
  MFC 295813,295816: Remove redundant check for "(dinfo != NULL)".

Modified:
  stable/10/sys/dev/pci/pci_user.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/pci/pci_user.c
==
--- stable/10/sys/dev/pci/pci_user.cFri Sep 30 00:33:19 2016
(r306467)
+++ stable/10/sys/dev/pci/pci_user.cFri Sep 30 00:43:30 2016
(r306468)
@@ -709,9 +709,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, 
 * that match the user's criteria.
 */
for (cio->num_matches = 0, error = 0, i = 0,
-dinfo = STAILQ_FIRST(devlist_head);
-(dinfo != NULL) && (cio->num_matches < ionum)
-&& (error == 0) && (i < pci_numdevs) && (dinfo != NULL);
+dinfo = STAILQ_FIRST(devlist_head);
+(dinfo != NULL) && (cio->num_matches < ionum) &&
+(error == 0) && (i < pci_numdevs);
 dinfo = STAILQ_NEXT(dinfo, pci_links), i++) {
 
if (i < cio->offset)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306467 - in stable: 10/tools/tools/dmardump 11/tools/tools/dmardump

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 00:33:19 2016
New Revision: 306467
URL: https://svnweb.freebsd.org/changeset/base/306467

Log:
  MFC 303887: Add a dmardump utility to dump the VT-d context tables.
  
  This tool parses the ACPI DMAR table looking for DMA remapping devices.
  For each device it walks the root table and any context tables
  referenced to display mapping info for PCI devices.
  
  Note that acpidump -t already parses the info in the ACPI DMAR tables
  directly.  This tool examines some of the data structures the DMAR
  remapping engines use to translate DMA requests.
  
  Sponsored by: Chelsio Communications

Added:
  stable/11/tools/tools/dmardump/
 - copied from r303887, head/tools/tools/dmardump/
Modified:
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/10/tools/tools/dmardump/
 - copied from r303887, head/tools/tools/dmardump/
Modified:
Directory Properties:
  stable/10/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306467 - in stable: 10/tools/tools/dmardump 11/tools/tools/dmardump

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 00:33:19 2016
New Revision: 306467
URL: https://svnweb.freebsd.org/changeset/base/306467

Log:
  MFC 303887: Add a dmardump utility to dump the VT-d context tables.
  
  This tool parses the ACPI DMAR table looking for DMA remapping devices.
  For each device it walks the root table and any context tables
  referenced to display mapping info for PCI devices.
  
  Note that acpidump -t already parses the info in the ACPI DMAR tables
  directly.  This tool examines some of the data structures the DMAR
  remapping engines use to translate DMA requests.
  
  Sponsored by: Chelsio Communications

Added:
  stable/10/tools/tools/dmardump/
 - copied from r303887, head/tools/tools/dmardump/
Modified:
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Added:
  stable/11/tools/tools/dmardump/
 - copied from r303887, head/tools/tools/dmardump/
Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306466 - in stable: 10/sys/x86/iommu 11/sys/x86/iommu

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 00:31:17 2016
New Revision: 306466
URL: https://svnweb.freebsd.org/changeset/base/306466

Log:
  MFC 303886: Add additional constants.
  
  - Add constants for the fields in the root-entry table address register,
namely the root type type (RTT) and root table address (RTA) mask.
  - Add macros for the bitmask of the domain ID field in the second word
of context table entries as well as a helper macro (DMAR_CTX2_GET_DID)
to extract the domain ID from a context table entry.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/10/sys/x86/iommu/intel_reg.h
Directory Properties:
  stable/10/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/x86/iommu/intel_reg.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/10/sys/x86/iommu/intel_reg.h
==
--- stable/10/sys/x86/iommu/intel_reg.h Fri Sep 30 00:16:54 2016
(r306465)
+++ stable/10/sys/x86/iommu/intel_reg.h Fri Sep 30 00:31:17 2016
(r306466)
@@ -67,7 +67,9 @@ typedef   struct dmar_ctx_entry {
 #defineDMAR_CTX2_AW_4LVL   2   /* 4-level page tables 
*/
 #defineDMAR_CTX2_AW_5LVL   3   /* 5-level page tables 
*/
 #defineDMAR_CTX2_AW_6LVL   4   /* 6-level page tables 
*/
+#defineDMAR_CTX2_DID_MASK  0x0
 #defineDMAR_CTX2_DID(x)((x) << 8)  /* Domain Identifier */
+#defineDMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8)
 
 typedef struct dmar_pte {
uint64_t pte;
@@ -214,6 +216,8 @@ typedef struct dmar_irte {
 
 /* Root-Entry Table Address register */
 #defineDMAR_RTADDR_REG 0x20
+#defineDMAR_RTADDR_RTT (1 << 11)   /* Root Table Type */
+#defineDMAR_RTADDR_RTA_MASK0xf000
 
 /* Context Command register */
 #defineDMAR_CCMD_REG   0x28
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306466 - in stable: 10/sys/x86/iommu 11/sys/x86/iommu

2016-09-29 Thread John Baldwin
Author: jhb
Date: Fri Sep 30 00:31:17 2016
New Revision: 306466
URL: https://svnweb.freebsd.org/changeset/base/306466

Log:
  MFC 303886: Add additional constants.
  
  - Add constants for the fields in the root-entry table address register,
namely the root type type (RTT) and root table address (RTA) mask.
  - Add macros for the bitmask of the domain ID field in the second word
of context table entries as well as a helper macro (DMAR_CTX2_GET_DID)
to extract the domain ID from a context table entry.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/x86/iommu/intel_reg.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/x86/iommu/intel_reg.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/x86/iommu/intel_reg.h
==
--- stable/11/sys/x86/iommu/intel_reg.h Fri Sep 30 00:16:54 2016
(r306465)
+++ stable/11/sys/x86/iommu/intel_reg.h Fri Sep 30 00:31:17 2016
(r306466)
@@ -67,7 +67,9 @@ typedef   struct dmar_ctx_entry {
 #defineDMAR_CTX2_AW_4LVL   2   /* 4-level page tables 
*/
 #defineDMAR_CTX2_AW_5LVL   3   /* 5-level page tables 
*/
 #defineDMAR_CTX2_AW_6LVL   4   /* 6-level page tables 
*/
+#defineDMAR_CTX2_DID_MASK  0x0
 #defineDMAR_CTX2_DID(x)((x) << 8)  /* Domain Identifier */
+#defineDMAR_CTX2_GET_DID(ctx2) (((ctx2) & DMAR_CTX2_DID_MASK) >> 8)
 
 typedef struct dmar_pte {
uint64_t pte;
@@ -214,6 +216,8 @@ typedef struct dmar_irte {
 
 /* Root-Entry Table Address register */
 #defineDMAR_RTADDR_REG 0x20
+#defineDMAR_RTADDR_RTT (1 << 11)   /* Root Table Type */
+#defineDMAR_RTADDR_RTA_MASK0xf000
 
 /* Context Command register */
 #defineDMAR_CCMD_REG   0x28
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-09-29 Thread Navdeep Parhar
Author: np
Date: Fri Sep 30 00:16:54 2016
New Revision: 306465
URL: https://svnweb.freebsd.org/changeset/base/306465

Log:
  cxgbe(4): Claim the T6 -DBG card.

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

Modified: head/sys/dev/cxgbe/t4_main.c
==
--- head/sys/dev/cxgbe/t4_main.cFri Sep 30 00:10:57 2016
(r306464)
+++ head/sys/dev/cxgbe/t4_main.cFri Sep 30 00:16:54 2016
(r306465)
@@ -607,6 +607,7 @@ struct {
{0x6407, "Chelsio T62100-LP-CR"},   /* 2 x 40/50/100G */
{0x6408, "Chelsio T62100-SO-CR"},   /* 2 x 40/50/100G, nomem */
{0x640d, "Chelsio T62100-CR"},  /* 2 x 40/50/100G */
+   {0x6410, "Chelsio T62100-DBG"}, /* 2 x 40/50/100G, debug */
 };
 
 #ifdef TCP_OFFLOAD
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306464 - head/sys/netinet

2016-09-29 Thread Hiren Panchasara
Author: hiren
Date: Fri Sep 30 00:10:57 2016
New Revision: 306464
URL: https://svnweb.freebsd.org/changeset/base/306464

Log:
  This adds a sysctl which allows you to disable the TCP hostcache. This is 
handy
  during testing of network related changes where cached entries may pollute 
your
  results, or during known congestion events where you don't want to unfairly
  penalize hosts.
  
  Prior to r232346 this would have meant you would break any connection with a 
sub
  1500 MTU, as the hostcache was authoritative. All entries as they stand today
  should simply be used to pre populate values for efficiency.
  
  Submitted by: Jason Wolfe (j at nitrology dot com)
  Reviewed by:  rwatson, sbruno, rrs , bz (earlier version)
  MFC after:2 weeks
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D6198

Modified:
  head/sys/netinet/tcp_hostcache.c

Modified: head/sys/netinet/tcp_hostcache.c
==
--- head/sys/netinet/tcp_hostcache.cThu Sep 29 23:41:57 2016
(r306463)
+++ head/sys/netinet/tcp_hostcache.cFri Sep 30 00:10:57 2016
(r306464)
@@ -124,6 +124,12 @@ static void tcp_hc_purge(void *);
 static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0,
 "TCP Host cache");
 
+VNET_DEFINE(int, tcp_use_hostcache) = 1;
+#define V_tcp_use_hostcache  VNET(tcp_use_hostcache)
+SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, enable, CTLFLAG_VNET | 
CTLFLAG_RW,
+&VNET_NAME(tcp_use_hostcache), 0,
+"Enable the TCP hostcache");
+
 SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, cachelimit, CTLFLAG_VNET | 
CTLFLAG_RDTUN,
 &VNET_NAME(tcp_hostcache.cache_limit), 0,
 "Overall entry limit for hostcache");
@@ -276,6 +282,9 @@ tcp_hc_lookup(struct in_conninfo *inc)
struct hc_head *hc_head;
struct hc_metrics *hc_entry;
 
+   if (!V_tcp_use_hostcache)
+   return NULL;
+
KASSERT(inc != NULL, ("tcp_hc_lookup with NULL in_conninfo pointer"));
 
/*
@@ -332,6 +341,9 @@ tcp_hc_insert(struct in_conninfo *inc)
struct hc_head *hc_head;
struct hc_metrics *hc_entry;
 
+   if (!V_tcp_use_hostcache)
+   return NULL;
+
KASSERT(inc != NULL, ("tcp_hc_insert with NULL in_conninfo pointer"));
 
/*
@@ -421,6 +433,9 @@ tcp_hc_get(struct in_conninfo *inc, stru
 {
struct hc_metrics *hc_entry;
 
+   if (!V_tcp_use_hostcache)
+   return;
+
/*
 * Find the right bucket.
 */
@@ -452,7 +467,7 @@ tcp_hc_get(struct in_conninfo *inc, stru
 
 /*
  * External function: look up an entry in the hostcache and return the
- * discovered path MTU.  Returns NULL if no entry is found or value is not
+ * discovered path MTU.  Returns 0 if no entry is found or value is not
  * set.
  */
 u_long
@@ -461,6 +476,9 @@ tcp_hc_getmtu(struct in_conninfo *inc)
struct hc_metrics *hc_entry;
u_long mtu;
 
+   if (!V_tcp_use_hostcache)
+   return 0;
+
hc_entry = tcp_hc_lookup(inc);
if (hc_entry == NULL) {
return 0;
@@ -482,6 +500,9 @@ tcp_hc_updatemtu(struct in_conninfo *inc
 {
struct hc_metrics *hc_entry;
 
+   if (!V_tcp_use_hostcache)
+   return;
+
/*
 * Find the right bucket.
 */
@@ -521,6 +542,9 @@ tcp_hc_update(struct in_conninfo *inc, s
 {
struct hc_metrics *hc_entry;
 
+   if (!V_tcp_use_hostcache)
+   return;
+
hc_entry = tcp_hc_lookup(inc);
if (hc_entry == NULL) {
hc_entry = tcp_hc_insert(inc);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306463 - stable/11/sys/dev/cxgbe

2016-09-29 Thread John Baldwin
Author: jhb
Date: Thu Sep 29 23:41:57 2016
New Revision: 306463
URL: https://svnweb.freebsd.org/changeset/base/306463

Log:
  MFC 303204: Install a handler for firmware work request error messages.
  
  If a driver sends an malformed or disallowed work request, the firmware
  responds with a work request error.  Previously the driver treated this is
  as an unexpected message and panicked.  Now it decodes the error message
  to aid in debugging.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/t4_sge.c
==
--- stable/11/sys/dev/cxgbe/t4_sge.cThu Sep 29 23:07:28 2016
(r306462)
+++ stable/11/sys/dev/cxgbe/t4_sge.cThu Sep 29 23:41:57 2016
(r306463)
@@ -244,6 +244,7 @@ static int handle_sge_egr_update(struct 
 struct mbuf *);
 static int handle_fw_msg(struct sge_iq *, const struct rss_header *,
 struct mbuf *);
+static int t4_handle_wrerr_rpl(struct adapter *, const __be64 *);
 static void wrq_tx_drain(void *, int);
 static void drain_wrq_wr_list(struct adapter *, struct sge_wrq *);
 
@@ -402,6 +403,7 @@ t4_sge_modload(void)
t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update);
t4_register_cpl_handler(CPL_RX_PKT, t4_eth_rx);
t4_register_fw_msg_handler(FW6_TYPE_CMD_RPL, t4_handle_fw_rpl);
+   t4_register_fw_msg_handler(FW6_TYPE_WRERR_RPL, t4_handle_wrerr_rpl);
 }
 
 void
@@ -4782,6 +4784,71 @@ handle_fw_msg(struct sge_iq *iq, const s
return (t4_fw_msg_handler[cpl->type](sc, &cpl->data[0]));
 }
 
+/**
+ * t4_handle_wrerr_rpl - process a FW work request error message
+ * @adap: the adapter
+ * @rpl: start of the FW message
+ */
+static int
+t4_handle_wrerr_rpl(struct adapter *adap, const __be64 *rpl)
+{
+   u8 opcode = *(const u8 *)rpl;
+   const struct fw_error_cmd *e = (const void *)rpl;
+   unsigned int i;
+
+   if (opcode != FW_ERROR_CMD) {
+   log(LOG_ERR,
+   "%s: Received WRERR_RPL message with opcode %#x\n",
+   device_get_nameunit(adap->dev), opcode);
+   return (EINVAL);
+   }
+   log(LOG_ERR, "%s: FW_ERROR (%s) ", device_get_nameunit(adap->dev),
+   G_FW_ERROR_CMD_FATAL(be32toh(e->op_to_type)) ? "fatal" :
+   "non-fatal");
+   switch (G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type))) {
+   case FW_ERROR_TYPE_EXCEPTION:
+   log(LOG_ERR, "exception info:\n");
+   for (i = 0; i < nitems(e->u.exception.info); i++)
+   log(LOG_ERR, "%s%08x", i == 0 ? "\t" : " ",
+   be32toh(e->u.exception.info[i]));
+   log(LOG_ERR, "\n");
+   break;
+   case FW_ERROR_TYPE_HWMODULE:
+   log(LOG_ERR, "HW module regaddr %08x regval %08x\n",
+   be32toh(e->u.hwmodule.regaddr),
+   be32toh(e->u.hwmodule.regval));
+   break;
+   case FW_ERROR_TYPE_WR:
+   log(LOG_ERR, "WR cidx %d PF %d VF %d eqid %d hdr:\n",
+   be16toh(e->u.wr.cidx),
+   G_FW_ERROR_CMD_PFN(be16toh(e->u.wr.pfn_vfn)),
+   G_FW_ERROR_CMD_VFN(be16toh(e->u.wr.pfn_vfn)),
+   be32toh(e->u.wr.eqid));
+   for (i = 0; i < nitems(e->u.wr.wrhdr); i++)
+   log(LOG_ERR, "%s%02x", i == 0 ? "\t" : " ",
+   e->u.wr.wrhdr[i]);
+   log(LOG_ERR, "\n");
+   break;
+   case FW_ERROR_TYPE_ACL:
+   log(LOG_ERR, "ACL cidx %d PF %d VF %d eqid %d %s",
+   be16toh(e->u.acl.cidx),
+   G_FW_ERROR_CMD_PFN(be16toh(e->u.acl.pfn_vfn)),
+   G_FW_ERROR_CMD_VFN(be16toh(e->u.acl.pfn_vfn)),
+   be32toh(e->u.acl.eqid),
+   G_FW_ERROR_CMD_MV(be16toh(e->u.acl.mv_pkd)) ? "vlanid" :
+   "MAC");
+   for (i = 0; i < nitems(e->u.acl.val); i++)
+   log(LOG_ERR, " %02x", e->u.acl.val[i]);
+   log(LOG_ERR, "\n");
+   break;
+   default:
+   log(LOG_ERR, "type %#x\n",
+   G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type)));
+   return (EINVAL);
+   }
+   return (0);
+}
+
 static int
 sysctl_uint16(SYSCTL_HANDLER_ARGS)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306462 - in head/sys: kern sys

2016-09-29 Thread Gleb Smirnoff
Author: glebius
Date: Thu Sep 29 23:07:28 2016
New Revision: 306462
URL: https://svnweb.freebsd.org/changeset/base/306462

Log:
  Provide kern.maxphys sysctl, which returns MAXPHYS.  Naming matches NetBSD.

Modified:
  head/sys/kern/kern_mib.c
  head/sys/sys/sysctl.h

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cThu Sep 29 22:52:24 2016(r306461)
+++ head/sys/kern/kern_mib.cThu Sep 29 23:07:28 2016(r306462)
@@ -138,6 +138,9 @@ char kernelname[MAXPATHLEN] = "/kernel";
 SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
 kernelname, sizeof kernelname, "Name of kernel file booted");
 
+SYSCTL_INT(_kern, KERN_MAXPHYS, maxphys, CTLFLAG_RD | CTLFLAG_CAPRD,
+SYSCTL_NULL_INT_PTR, MAXPHYS, "Maximum block I/O access size");
+
 SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD,
 &mp_ncpus, 0, "Number of active CPUs");
 

Modified: head/sys/sys/sysctl.h
==
--- head/sys/sys/sysctl.h   Thu Sep 29 22:52:24 2016(r306461)
+++ head/sys/sys/sysctl.h   Thu Sep 29 23:07:28 2016(r306462)
@@ -835,6 +835,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
 #defineKERN_IOV_MAX35  /* int: value of UIO_MAXIOV */
 #defineKERN_HOSTUUID   36  /* string: host UUID identifier 
*/
 #defineKERN_ARND   37  /* int: from arc4rand() */
+#defineKERN_MAXPHYS38  /* int: MAXPHYS value */
 /*
  * KERN_PROC subtypes
  */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306461 - in stable/11: share/man/man9 sys/dev/pci

2016-09-29 Thread John Baldwin
Author: jhb
Date: Thu Sep 29 22:52:24 2016
New Revision: 306461
URL: https://svnweb.freebsd.org/changeset/base/306461

Log:
  MFC 303721: Permit the name of the /dev/iov entry to be set by the driver.
  
  The PCI_IOV option creates character devices in /dev/iov for each PF
  device driver that registers support for creating VFs.  By default the
  character device is named after the PF device (e.g. /dev/iov/foo0).
  This change adds a variant of pci_iov_attach() called pci_iov_attach_name()
  that allows the name of the /dev/iov entry to be specified by the
  driver.
  
  To preserve the ABI, this version does not modify the existing
  PCI_IOV_ATTACH kobj method as was done in HEAD.  Instead, a new
  PCI_IOV_ATTACH_NAME method has been added that accepts the name as an
  additional parameter.  The PCI bus driver now provides an implementation
  of PCI_IOV_ATTACH_NAME.  A default implementation of PCI_IOV_ATTACH is
  provided that calls PCI_IOV_ATTACH_NAME passing 'device_get_nameunit(dev)'
  as the name.
  
  Sponsored by: Chelsio Communications

Modified:
  stable/11/share/man/man9/Makefile
  stable/11/share/man/man9/pci.9
  stable/11/sys/dev/pci/pci.c
  stable/11/sys/dev/pci/pci_if.m
  stable/11/sys/dev/pci/pci_iov.c
  stable/11/sys/dev/pci/pci_iov.h
  stable/11/sys/dev/pci/pci_private.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man9/Makefile
==
--- stable/11/share/man/man9/Makefile   Thu Sep 29 22:01:09 2016
(r306460)
+++ stable/11/share/man/man9/Makefile   Thu Sep 29 22:52:24 2016
(r306461)
@@ -1303,6 +1303,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \
pci.9 pci_get_vpd_ident.9 \
pci.9 pci_get_vpd_readonly.9 \
pci.9 pci_iov_attach.9 \
+   pci.9 pci_iov_attach_name.9 \
pci.9 pci_iov_detach.9 \
pci.9 pci_msi_count.9 \
pci.9 pci_msix_count.9 \

Modified: stable/11/share/man/man9/pci.9
==
--- stable/11/share/man/man9/pci.9  Thu Sep 29 22:01:09 2016
(r306460)
+++ stable/11/share/man/man9/pci.9  Thu Sep 29 22:52:24 2016
(r306461)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 24, 2016
+.Dd August 3, 2016
 .Dt PCI 9
 .Os
 .Sh NAME
@@ -50,6 +50,7 @@
 .Nm pci_get_vpd_ident ,
 .Nm pci_get_vpd_readonly ,
 .Nm pci_iov_attach ,
+.Nm pci_iov_attach_name ,
 .Nm pci_iov_detach ,
 .Nm pci_msi_count ,
 .Nm pci_msix_count ,
@@ -152,6 +153,14 @@
 .Ft int
 .Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema"
 .Ft int
+.Fo pci_iov_attach_name
+.Fa "device_t dev"
+.Fa "nvlist_t *pf_schema"
+.Fa "nvlist_t *vf_schema"
+.Fa "const char *fmt"
+.Fa "..."
+.Fc
+.Ft int
 .Fn pci_iov_detach "device_t dev"
 .Sh DESCRIPTION
 The
@@ -595,6 +604,20 @@ and is responsible for freeing them.
 The driver must never free the schemas itself.
 .Pp
 The
+.Fn pci_iov_attach_name
+function is a variant of
+.Fn pci_iov_attach
+that allows the name of the associated character device in
+.Pa /dev/iov
+to be specified by
+.Fa fmt .
+The
+.Fn pci_iov_attach
+function uses the name of
+.Fa dev
+as the device name.
+.Pp
+The
 .Fn pci_iov_detach
 function is used to advise the SR-IOV infrastructure that the driver for the
 given device is attempting to detach and that all SR-IOV resources for the

Modified: stable/11/sys/dev/pci/pci.c
==
--- stable/11/sys/dev/pci/pci.c Thu Sep 29 22:01:09 2016(r306460)
+++ stable/11/sys/dev/pci/pci.c Thu Sep 29 22:52:24 2016(r306461)
@@ -195,7 +195,7 @@ static device_method_t pci_methods[] = {
DEVMETHOD(pci_alloc_devinfo,pci_alloc_devinfo_method),
DEVMETHOD(pci_child_added,  pci_child_added_method),
 #ifdef PCI_IOV
-   DEVMETHOD(pci_iov_attach,   pci_iov_attach_method),
+   DEVMETHOD(pci_iov_attach_name,  pci_iov_attach_method),
DEVMETHOD(pci_iov_detach,   pci_iov_detach_method),
DEVMETHOD(pci_create_iov_child, pci_create_iov_child_method),
 #endif

Modified: stable/11/sys/dev/pci/pci_if.m
==
--- stable/11/sys/dev/pci/pci_if.m  Thu Sep 29 22:01:09 2016
(r306460)
+++ stable/11/sys/dev/pci/pci_if.m  Thu Sep 29 22:52:24 2016
(r306461)
@@ -51,6 +51,14 @@ CODE {
device_printf(bus, "PCI_IOV not implemented on this bus.\n");
return (NULL);
}
+
+   static int
+   compat_iov_attach(device_t bus, device_t dev, struct nvlist *pf_schema,
+   struct nvlist *vf_schema)
+   {
+   return (PCI_IOV_ATTACH_NAME(bus, dev, pf_schema, vf_schema,
+   device_get_nameunit(dev)));
+   }
 };
 
 HEADER {
@@ -235,6 +243,14 @@ METHOD int iov_attach {
device_tchild;
struct nvlist   *pf_schema;

Re: svn commit: r300824 - head/lib/libmd

2016-09-29 Thread Alan Somers
On Fri, May 27, 2016 at 1:00 AM, Ed Schouten  wrote:
> 2016-05-27 8:50 GMT+02:00 Conrad Meyer :
>> There's nothing to support — literally ignoring the keyword is an
>> acceptable implementation.  So it's disappointing C++ chooses to
>> reject C keywords.
>
> Keep in mind that C++ does not reject "static" altogether; only in
> this specific context. The reason for it is that in C++, there are
> other ways of enforcing similar properties. For example by using
> std::array, which has the size as part of its type.
>
>> If sys/md5.h includes a static inline function, there are bigger
>> problems with potentially trying to interpret C code as C++.
>
> We have quite a lot of public header files that contain static inline
> functions that also work well in C++ mode.  is a good
> example.
>
>> Your proposed macro seems ok, although it is pretty long for where it
>> would be used.  Maybe __min_size()?
>
> Sure!

Is anybody still intending to write this feature?  I just ran into the
same c++-includability bug with sha256.h and sha512.h.  It would be
nice to fix them the right way instead of using r300824's workaround.

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

svn commit: r306460 - head/sys/modules/dtb/nvidia

2016-09-29 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Thu Sep 29 22:01:09 2016
New Revision: 306460
URL: https://svnweb.freebsd.org/changeset/base/306460

Log:
  Add dtb module for Jetson-TK1 board

Added:
  head/sys/modules/dtb/nvidia/
  head/sys/modules/dtb/nvidia/Makefile   (contents, props changed)

Added: head/sys/modules/dtb/nvidia/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/dtb/nvidia/MakefileThu Sep 29 22:01:09 2016
(r306460)
@@ -0,0 +1,6 @@
+# $FreeBSD$
+# All the dts files for Nvidia ARM systems we support.
+DTS=   \
+   tegra124-jetson-tk1-fbsd.dts
+
+.include 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306459 - head/sys/netinet6

2016-09-29 Thread Andrey V. Elsukov
Author: ae
Date: Thu Sep 29 19:57:37 2016
New Revision: 306459
URL: https://svnweb.freebsd.org/changeset/base/306459

Log:
  Fix bug introduced in r274300.
  
  In icmp6_reflect() use original source address of erroneous packet as
  destination address for source selection algorithm when original
  destination address is not one of our own.
  
  Reported by:  Mark Kamichoff 
  Tested by:Mark Kamichoff 
  MFC after:1 week

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==
--- head/sys/netinet6/icmp6.c   Thu Sep 29 19:45:24 2016(r306458)
+++ head/sys/netinet6/icmp6.c   Thu Sep 29 19:57:37 2016(r306459)
@@ -2146,7 +2146,7 @@ icmp6_reflect(struct mbuf *m, size_t off
 * that we do not own.  Select a source address based on the
 * source address of the erroneous packet.
 */
-   in6_splitscope(&ip6->ip6_dst, &dst6, &scopeid);
+   in6_splitscope(&ip6->ip6_src, &dst6, &scopeid);
error = in6_selectsrc_addr(RT_DEFAULT_FIB, &dst6,
scopeid, NULL, &src6, &hlim);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306458 - head/sys/netinet

2016-09-29 Thread Kurt Lidl
Author: lidl
Date: Thu Sep 29 19:45:24 2016
New Revision: 306458
URL: https://svnweb.freebsd.org/changeset/base/306458

Log:
  Properly preserve ip_tos bits for IPv4 packets
  
  Restructure code slightly to save ip_tos bits earlier.  Fix the bug
  where the ip_tos field is zeroed out before assigning to the iptos
  variable. Restore the ip_tos and ip_ver fields only if they have
  been zeroed during the pseudo-header checksum calculation.
  
  Reviewed by:  cem, gnn, hiren
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D8053

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==
--- head/sys/netinet/tcp_input.cThu Sep 29 18:24:29 2016
(r306457)
+++ head/sys/netinet/tcp_input.cThu Sep 29 19:45:24 2016
(r306458)
@@ -603,7 +603,7 @@ tcp_input(struct mbuf **mp, int *offp, i
 #ifdef TCP_SIGNATURE
uint8_t sig_checked = 0;
 #endif
-   uint8_t iptos = 0;
+   uint8_t iptos;
struct m_tag *fwd_tag = NULL;
 #ifdef INET6
struct ip6_hdr *ip6 = NULL;
@@ -675,6 +675,7 @@ tcp_input(struct mbuf **mp, int *offp, i
/* XXX stat */
goto drop;
}
+   iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
}
 #endif
 #if defined(INET) && defined(INET6)
@@ -701,6 +702,7 @@ tcp_input(struct mbuf **mp, int *offp, i
th = (struct tcphdr *)((caddr_t)ip + off0);
tlen = ntohs(ip->ip_len) - off0;
 
+   iptos = ip->ip_tos;
if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) {
if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR)
th->th_sum = m->m_pkthdr.csum_data;
@@ -721,29 +723,20 @@ tcp_input(struct mbuf **mp, int *offp, i
ipov->ih_len = htons(tlen);
th->th_sum = in_cksum(m, len);
/* Reset length for SDT probes. */
-   ip->ip_len = htons(tlen + off0);
+   ip->ip_len = htons(len);
+   /* Reset TOS bits */
+   ip->ip_tos = iptos;
+   /* Re-initialization for later version check */
+   ip->ip_v = IPVERSION;
}
 
if (th->th_sum) {
TCPSTAT_INC(tcps_rcvbadsum);
goto drop;
}
-   /* Re-initialization for later version check */
-   ip->ip_v = IPVERSION;
}
 #endif /* INET */
 
-#ifdef INET6
-   if (isipv6)
-   iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
-#endif
-#if defined(INET) && defined(INET6)
-   else
-#endif
-#ifdef INET
-   iptos = ip->ip_tos;
-#endif
-
/*
 * Check that TCP offset makes sense,
 * pull out TCP options and adjust length.  XXX
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306457 - in head/contrib/unbound: . compat contrib daemon dns64 doc iterator libunbound services sldns smallapp util util/storage validator

2016-09-29 Thread Dag-Erling Smørgrav
Author: des
Date: Thu Sep 29 18:24:29 2016
New Revision: 306457
URL: https://svnweb.freebsd.org/changeset/base/306457

Log:
  Upgrade to Unbound 1.5.10.

Added:
  head/contrib/unbound/contrib/
 - copied from r306382, vendor/unbound/dist/contrib/
Modified:
  head/contrib/unbound/Makefile.in
  head/contrib/unbound/acx_python.m4
  head/contrib/unbound/compat/arc4random.c
  head/contrib/unbound/compat/getentropy_linux.c
  head/contrib/unbound/config.h
  head/contrib/unbound/config.h.in
  head/contrib/unbound/configure
  head/contrib/unbound/configure.ac
  head/contrib/unbound/daemon/acl_list.c
  head/contrib/unbound/daemon/acl_list.h
  head/contrib/unbound/daemon/daemon.c
  head/contrib/unbound/daemon/remote.c
  head/contrib/unbound/daemon/remote.h
  head/contrib/unbound/daemon/unbound.c
  head/contrib/unbound/daemon/worker.c
  head/contrib/unbound/dns64/dns64.c
  head/contrib/unbound/doc/Changelog
  head/contrib/unbound/doc/README
  head/contrib/unbound/doc/example.conf
  head/contrib/unbound/doc/example.conf.in
  head/contrib/unbound/doc/libunbound.3
  head/contrib/unbound/doc/libunbound.3.in
  head/contrib/unbound/doc/unbound-anchor.8
  head/contrib/unbound/doc/unbound-anchor.8.in
  head/contrib/unbound/doc/unbound-checkconf.8
  head/contrib/unbound/doc/unbound-checkconf.8.in
  head/contrib/unbound/doc/unbound-control.8
  head/contrib/unbound/doc/unbound-control.8.in
  head/contrib/unbound/doc/unbound-host.1
  head/contrib/unbound/doc/unbound-host.1.in
  head/contrib/unbound/doc/unbound.8
  head/contrib/unbound/doc/unbound.8.in
  head/contrib/unbound/doc/unbound.conf.5
  head/contrib/unbound/doc/unbound.conf.5.in
  head/contrib/unbound/doc/unbound.doxygen
  head/contrib/unbound/iterator/iter_hints.c
  head/contrib/unbound/iterator/iter_utils.c
  head/contrib/unbound/iterator/iterator.c
  head/contrib/unbound/iterator/iterator.h
  head/contrib/unbound/libunbound/libworker.c
  head/contrib/unbound/services/listen_dnsport.c
  head/contrib/unbound/services/localzone.c
  head/contrib/unbound/services/localzone.h
  head/contrib/unbound/services/mesh.c
  head/contrib/unbound/services/outside_network.c
  head/contrib/unbound/services/outside_network.h
  head/contrib/unbound/sldns/keyraw.c
  head/contrib/unbound/sldns/rrdef.h
  head/contrib/unbound/sldns/wire2str.h
  head/contrib/unbound/smallapp/unbound-anchor.c
  head/contrib/unbound/smallapp/unbound-checkconf.c
  head/contrib/unbound/smallapp/unbound-control.c
  head/contrib/unbound/smallapp/unbound-host.c
  head/contrib/unbound/smallapp/worker_cb.c
  head/contrib/unbound/util/alloc.c
  head/contrib/unbound/util/config_file.c
  head/contrib/unbound/util/config_file.h
  head/contrib/unbound/util/configlexer.lex
  head/contrib/unbound/util/configparser.y
  head/contrib/unbound/util/iana_ports.inc
  head/contrib/unbound/util/net_help.c
  head/contrib/unbound/util/netevent.c
  head/contrib/unbound/util/netevent.h
  head/contrib/unbound/util/storage/dnstree.c
  head/contrib/unbound/util/storage/dnstree.h
  head/contrib/unbound/util/storage/lookup3.c
  head/contrib/unbound/util/ub_event.c
  head/contrib/unbound/util/ub_event_pluggable.c
  head/contrib/unbound/util/winsock_event.c
  head/contrib/unbound/validator/autotrust.c
  head/contrib/unbound/validator/val_secalgo.c
  head/contrib/unbound/validator/val_sigcrypt.c
  head/contrib/unbound/validator/validator.c
Directory Properties:
  head/contrib/unbound/   (props changed)

Modified: head/contrib/unbound/Makefile.in
==
--- head/contrib/unbound/Makefile.inThu Sep 29 17:48:53 2016
(r306456)
+++ head/contrib/unbound/Makefile.inThu Sep 29 18:24:29 2016
(r306457)
@@ -81,7 +81,7 @@ LINTFLAGS+=@NETBSD_LINTFLAGS@
 # compat with OpenBSD
 LINTFLAGS+="-Dsigset_t=long"
 # FreeBSD
-LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_METHOD=int" 
"-D_RuneLocale=int" "-D__va_list=va_list"
+LINTFLAGS+="-D__uint16_t=uint16_t" "-DEVP_PKEY_ASN1_METHOD=int" 
"-D_RuneLocale=int" "-D__va_list=va_list" "-D__uint32_t=uint32_t"
 
 INSTALL=$(SHELL) $(srcdir)/install-sh
 
@@ -228,7 +228,7 @@ SVCUNINST_OBJ_LINK=$(SVCUNINST_OBJ) w_in
 $(COMPAT_OBJ_WITHOUT_CTIMEARC4)
 ANCHORUPD_SRC=winrc/anchor-update.c
 ANCHORUPD_OBJ=anchor-update.lo
-ANCHORUPD_OBJ_LINK=$(ANCHORUPD_OBJ) rsrc_anchorupd.o 
$(COMPAT_OBJ_WITHOUT_CTIMEARC4)
+ANCHORUPD_OBJ_LINK=$(ANCHORUPD_OBJ) rsrc_anchorupd.o 
$(COMPAT_OBJ_WITHOUT_CTIMEARC4) wire2str.lo str2wire.lo parseutil.lo sbuffer.lo 
 rrdef.lo keyraw.lo  parse.lo
 RSRC_OBJ=rsrc_svcinst.o rsrc_svcuninst.o rsrc_anchorupd.o rsrc_unbound.o \
rsrc_unbound_host.o rsrc_unbound_anchor.o rsrc_unbound_control.o \
rsrc_unbound_checkconf.o
@@ -704,11 +704,12 @@ listen_dnsport.lo listen_dnsport.o: $(sr
  $(srcdir)/util/rbtree.h  $(srcdir)/util/log.h $(srcdir)/util/config_file.h \
  $(srcdir)/util/net_help.h $(srcdir)/sldns/sbuffer.h
 localzone.lo localzone.o: $(srcdir)/services/localzone.c config.h 
$(srcdir)/services/loca

svn commit: r306456 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-09-29 Thread Alexander Motin
Author: mav
Date: Thu Sep 29 17:48:53 2016
New Revision: 306456
URL: https://svnweb.freebsd.org/changeset/base/306456

Log:
  Add #ifdef _KERNEL around send_holes_without_birth_time sysctl.
  
  Reported by:  avg@

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c  Thu Sep 
29 17:13:17 2016(r306455)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c  Thu Sep 
29 17:48:53 2016(r306456)
@@ -42,9 +42,11 @@
 int32_t zfs_pd_bytes_max = 50 * 1024 * 1024;   /* 50MB */
 boolean_t send_holes_without_birth_time = B_TRUE;
 
+#ifdef _KERNEL
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, send_holes_without_birth_time, CTLFLAG_RWTUN,
 &send_holes_without_birth_time, 0, "Send holes without birth time");
+#endif
 
 typedef struct prefetch_data {
kmutex_t pd_mtx;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2016-09-29 Thread Andrew Turner
Author: andrew
Date: Thu Sep 29 17:13:17 2016
New Revision: 306455
URL: https://svnweb.freebsd.org/changeset/base/306455

Log:
  Use SV_ABI_ERRNO to set the syscall return value. The Linuxulator will
  need this.
  
  Submitted by: Grégory Soutadé 
  Differential Revision:https://reviews.freebsd.org/D7976

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

Modified: head/sys/arm/arm/vm_machdep.c
==
--- head/sys/arm/arm/vm_machdep.c   Thu Sep 29 16:36:32 2016
(r306454)
+++ head/sys/arm/arm/vm_machdep.c   Thu Sep 29 17:13:17 2016
(r306455)
@@ -220,7 +220,7 @@ cpu_set_syscall_retval(struct thread *td
/* nothing to do */
break;
default:
-   frame->tf_r0 = error;
+   frame->tf_r0 = SV_ABI_ERRNO(td->td_proc, error);
frame->tf_spsr |= PSR_C;/* carry bit */
break;
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

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

2016-09-29 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 29 16:36:32 2016
New Revision: 306454
URL: https://svnweb.freebsd.org/changeset/base/306454

Log:
  Set hardware stats flag to avoid double counting the number of incoming bytes.
  
  Found by: Ben RUBSON 
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/ofed/drivers/net/mlx4/en_netdev.c

Modified: head/sys/ofed/drivers/net/mlx4/en_netdev.c
==
--- head/sys/ofed/drivers/net/mlx4/en_netdev.c  Thu Sep 29 16:35:52 2016
(r306453)
+++ head/sys/ofed/drivers/net/mlx4/en_netdev.c  Thu Sep 29 16:36:32 2016
(r306454)
@@ -2165,6 +2165,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d
dev->if_capabilities |= IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER;
dev->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU;
dev->if_capabilities |= IFCAP_LRO;
+   dev->if_capabilities |= IFCAP_HWSTATS;
 
if (mdev->LSO_support)
dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | 
IFCAP_VLAN_HWTSO;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306453 - head/sys/dev/mlx5/mlx5_en

2016-09-29 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 29 16:35:52 2016
New Revision: 306453
URL: https://svnweb.freebsd.org/changeset/base/306453

Log:
  Set hardware stats flag to avoid double counting the number of incoming bytes.
  
  Found by: Ben RUBSON 
  Sponsored by: Mellanox Technologies
  MFC after:1 week

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cThu Sep 29 16:29:49 2016
(r306452)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cThu Sep 29 16:35:52 2016
(r306453)
@@ -2903,6 +2903,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *m
ifp->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU;
ifp->if_capabilities |= IFCAP_LRO;
ifp->if_capabilities |= IFCAP_TSO | IFCAP_VLAN_HWTSO;
+   ifp->if_capabilities |= IFCAP_HWSTATS;
 
/* set TSO limits so that we don't have to drop TX packets */
ifp->if_hw_tsomax = MLX5E_MAX_TX_PAYLOAD_SIZE - (ETHER_HDR_LEN + 
ETHER_VLAN_ENCAP_LEN);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306452 - head/sys/kern

2016-09-29 Thread Allan Jude
Author: allanjude
Date: Thu Sep 29 16:29:49 2016
New Revision: 306452
URL: https://svnweb.freebsd.org/changeset/base/306452

Log:
  Allow reading the following sysctl MIBs in capability mode:
  kern.hostname, kern.domainname, and kern.hostuuid
  
  This allows sandboxed applications to read these sysctls
  
  Submitted by: cem (original version)
  Reviewed by:  cem, jonathan, rwatson (original version)
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D8015

Modified:
  head/sys/kern/kern_mib.c

Modified: head/sys/kern/kern_mib.c
==
--- head/sys/kern/kern_mib.cThu Sep 29 14:35:32 2016(r306451)
+++ head/sys/kern/kern_mib.cThu Sep 29 16:29:49 2016(r306452)
@@ -316,15 +316,15 @@ sysctl_hostname(SYSCTL_HANDLER_ARGS)
 }
 
 SYSCTL_PROC(_kern, KERN_HOSTNAME, hostname,
-CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
+CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_CAPRD | 
CTLFLAG_MPSAFE,
 (void *)(offsetof(struct prison, pr_hostname)), MAXHOSTNAMELEN,
 sysctl_hostname, "A", "Hostname");
 SYSCTL_PROC(_kern, KERN_NISDOMAINNAME, domainname,
-CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
+CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_CAPRD | 
CTLFLAG_MPSAFE,
 (void *)(offsetof(struct prison, pr_domainname)), MAXHOSTNAMELEN,
 sysctl_hostname, "A", "Name of the current YP/NIS domain");
 SYSCTL_PROC(_kern, KERN_HOSTUUID, hostuuid,
-CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
+CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_CAPRD | 
CTLFLAG_MPSAFE,
 (void *)(offsetof(struct prison, pr_hostuuid)), HOSTUUIDLEN,
 sysctl_hostname, "A", "Host UUID");
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306451 - head/sys/compat/linuxkpi/common/include/linux

2016-09-29 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 29 14:35:32 2016
New Revision: 306451
URL: https://svnweb.freebsd.org/changeset/base/306451

Log:
  The IORESOURCE_XXX defines should resemble a bitmask while SYS_RES_XXX
  are not bitmasks. Fix return value of pci_resource_flags() to reflect
  this change.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==
--- head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Sep 29 14:14:39 
2016(r306450)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Sep 29 14:35:32 
2016(r306451)
@@ -2,7 +2,7 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -121,9 +121,9 @@ struct pci_device_id {
 #definePCI_EXP_LNKCAP2_SLS_5_0GB 0x04  /* Supported Link Speed 5.0GT/s 
*/
 #definePCI_EXP_LNKCAP2_SLS_8_0GB 0x08  /* Supported Link Speed 8.0GT/s 
*/
 
-#defineIORESOURCE_MEM  SYS_RES_MEMORY
-#defineIORESOURCE_IO   SYS_RES_IOPORT
-#defineIORESOURCE_IRQ  SYS_RES_IRQ
+#defineIORESOURCE_MEM  (1 << SYS_RES_MEMORY)
+#defineIORESOURCE_IO   (1 << SYS_RES_IOPORT)
+#defineIORESOURCE_IRQ  (1 << SYS_RES_IRQ)
 
 enum pci_bus_speed {
PCI_SPEED_UNKNOWN = -1,
@@ -230,17 +230,28 @@ pci_resource_len(struct pci_dev *pdev, i
return rle->count;
 }
 
+static inline int
+pci_resource_type(struct pci_dev *pdev, int bar)
+{
+   struct resource_list_entry *rle;
+
+   if ((rle = _pci_get_bar(pdev, bar)) == NULL)
+   return (-1);
+   return (rle->type);
+}
+
 /*
  * All drivers just seem to want to inspect the type not flags.
  */
 static inline int
 pci_resource_flags(struct pci_dev *pdev, int bar)
 {
-   struct resource_list_entry *rle;
+   int type;
 
-   if ((rle = _pci_get_bar(pdev, bar)) == NULL)
+   type = pci_resource_type(pdev, bar);
+   if (type < 0)
return (0);
-   return rle->type;
+   return (1 << type);
 }
 
 static inline const char *
@@ -300,8 +311,8 @@ pci_request_region(struct pci_dev *pdev,
int rid;
int type;
 
-   type = pci_resource_flags(pdev, bar);
-   if (type == 0)
+   type = pci_resource_type(pdev, bar);
+   if (type < 0)
return (-ENODEV);
rid = PCIR_BAR(bar);
if (bus_alloc_resource_any(pdev->dev.bsddev, type, &rid,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306450 - head/share/man/man9

2016-09-29 Thread Andriy Voskoboinyk
Author: avos
Date: Thu Sep 29 14:14:39 2016
New Revision: 306450
URL: https://svnweb.freebsd.org/changeset/base/306450

Log:
  sysctl.9: add missing underscore (SYSCTL_HANDLERARGS -> SYSCTL_HANDLER_ARGS)

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

Modified: head/share/man/man9/sysctl.9
==
--- head/share/man/man9/sysctl.9Thu Sep 29 14:01:06 2016
(r306449)
+++ head/share/man/man9/sysctl.9Thu Sep 29 14:14:39 2016
(r306450)
@@ -132,7 +132,7 @@
 .Fa "int ctlflags"
 .Fa "void *arg1"
 .Fa "intptr_t arg2"
-.Fa "int (*handler) (SYSCTL_HANDLERARGS)"
+.Fa "int (*handler) (SYSCTL_HANDLER_ARGS)"
 .Fa "const char *format"
 .Fa "const char *descr"
 .Fc
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306449 - head/sys/contrib/ipfilter/netinet

2016-09-29 Thread Eitan Adler
Author: eadler
Date: Thu Sep 29 14:01:06 2016
New Revision: 306449
URL: https://svnweb.freebsd.org/changeset/base/306449

Log:
  Remove an extra etter.

Modified:
  head/sys/contrib/ipfilter/netinet/fil.c

Modified: head/sys/contrib/ipfilter/netinet/fil.c
==
--- head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 29 13:59:14 2016
(r306448)
+++ head/sys/contrib/ipfilter/netinet/fil.c Thu Sep 29 14:01:06 2016
(r306449)
@@ -421,7 +421,7 @@ static ipftuneable_t ipf_main_tuneables[
 
 
 /*
- * The next section of code is a a collection of small routines that set
+ * The next section of code is a collection of small routines that set
  * fields in the fr_info_t structure passed based on properties of the
  * current packet.  There are different routines for the same protocol
  * for each of IPv4 and IPv6.  Adding a new protocol, for which there
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306448 - in head/sys/dev/cxgbe: cxgbei tom

2016-09-29 Thread Eitan Adler
Author: eadler
Date: Thu Sep 29 13:59:14 2016
New Revision: 306448
URL: https://svnweb.freebsd.org/changeset/base/306448

Log:
  Remove a a duplicated word.

Modified:
  head/sys/dev/cxgbe/cxgbei/cxgbei.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c

Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c
==
--- head/sys/dev/cxgbe/cxgbei/cxgbei.c  Thu Sep 29 13:54:09 2016
(r306447)
+++ head/sys/dev/cxgbe/cxgbei/cxgbei.c  Thu Sep 29 13:59:14 2016
(r306448)
@@ -207,7 +207,7 @@ cxgbei_init(struct adapter *sc, struct c
r &= V_ISCSITAGMASK(M_ISCSITAGMASK);
if (r != pr->pr_tag_mask) {
/*
-* Recent firmwares are supposed to set up the the iSCSI tagmask
+* Recent firmwares are supposed to set up the iSCSI tagmask
 * but we'll do it ourselves it the computed value doesn't match
 * what's in the register.
 */

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Thu Sep 29 13:54:09 2016
(r306447)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Thu Sep 29 13:59:14 2016
(r306448)
@@ -2114,7 +2114,7 @@ sendanother:
 
/*
 * If the request will not be requeued, drop a reference on
-* the the aiotx buffer.  Any mbufs in flight should still
+* the aiotx buffer.  Any mbufs in flight should still
 * contain a reference, but this drops the reference that the
 * job owns while it is waiting to queue mbufs to the socket.
 */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306447 - head/sys/arm/nvidia

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Thu Sep 29 13:54:09 2016
New Revision: 306447
URL: https://svnweb.freebsd.org/changeset/base/306447

Log:
  TEGRA: Rename (cut & pasted) genahci to tegra_ahci. Make device class 
definition static.

Modified:
  head/sys/arm/nvidia/tegra_ahci.c

Modified: head/sys/arm/nvidia/tegra_ahci.c
==
--- head/sys/arm/nvidia/tegra_ahci.cThu Sep 29 13:38:14 2016
(r306446)
+++ head/sys/arm/nvidia/tegra_ahci.cThu Sep 29 13:54:09 2016
(r306447)
@@ -602,8 +602,8 @@ tegra_ahci_resume(device_t dev)
return (bus_generic_resume(dev));
 }
 
-devclass_t genahci_devclass;
-static device_method_t genahci_methods[] = {
+static devclass_t tegra_ahci_devclass;
+static device_method_t tegra_ahci_methods[] = {
DEVMETHOD(device_probe, tegra_ahci_probe),
DEVMETHOD(device_attach,tegra_ahci_attach),
DEVMETHOD(device_detach,tegra_ahci_detach),
@@ -619,9 +619,10 @@ static device_method_t genahci_methods[]
 
DEVMETHOD_END
 };
-static driver_t genahci_driver = {
+
+static driver_t tegra_ahci_driver = {
"ahci",
-   genahci_methods,
+   tegra_ahci_methods,
sizeof(struct tegra_ahci_sc)
 };
-DRIVER_MODULE(genahci, simplebus, genahci_driver, genahci_devclass, NULL, 
NULL);
+DRIVER_MODULE(tegra_ahci, simplebus, tegra_ahci_driver, tegra_ahci_devclass, 
NULL, NULL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306446 - head/share/mk

2016-09-29 Thread Warner Losh
Author: imp
Date: Thu Sep 29 13:38:14 2016
New Revision: 306446
URL: https://svnweb.freebsd.org/changeset/base/306446

Log:
  SSP is broken on all mips.

Modified:
  head/share/mk/src.opts.mk

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Thu Sep 29 12:54:27 2016(r306445)
+++ head/share/mk/src.opts.mk   Thu Sep 29 13:38:14 2016(r306446)
@@ -261,7 +261,7 @@ BROKEN_OPTIONS+=LLDB
 .if ${__T} != "armv6"
 BROKEN_OPTIONS+=LIBSOFT
 .endif
-.if ${__T} == "mips" || ${__T} == "mips64"
+.if ${__T:Mmips*}
 BROKEN_OPTIONS+=SSP
 .endif
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306445 - head/sys/arm/nvidia/tegra124

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Thu Sep 29 12:54:27 2016
New Revision: 306445
URL: https://svnweb.freebsd.org/changeset/base/306445

Log:
  TEGRA: Return back kern_clocksource.c into tegra config file. It was removed 
in r306444 by mistake.

Modified:
  head/sys/arm/nvidia/tegra124/files.tegra124

Modified: head/sys/arm/nvidia/tegra124/files.tegra124
==
--- head/sys/arm/nvidia/tegra124/files.tegra124 Thu Sep 29 12:25:04 2016
(r306444)
+++ head/sys/arm/nvidia/tegra124/files.tegra124 Thu Sep 29 12:54:27 2016
(r306445)
@@ -1,6 +1,11 @@
 # $FreeBSD$
 
 #
+# Standard ARM support.
+#
+kern/kern_clocksource.cstandard
+
+#
 # Standard tegra124 devices and support.
 #
 arm/nvidia/tegra124/tegra124_machdep.c standard
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r306425 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2016-09-29 Thread Andriy Gapon
On 29/09/2016 03:00, Alexander Motin wrote:
> Author: mav
> Date: Thu Sep 29 00:00:37 2016
> New Revision: 306425
> URL: https://svnweb.freebsd.org/changeset/base/306425
> 
> Log:
>   MFV r306423: 7402 Create tunable to ignore hole_birth feature
>   
>   Until we can resolve the numerous hole_birth bugs that have cropped up
>   recently, and come up with a way going forwards to protect users from
>   corruption, we should disable the hole_birth feature.  Using a tunable
>   allows those who are confident that their data is correct to continue to
>   take advantage of the feature.
>   
>   Closes #188
>   
>   Reviewed by: Matthew Ahrens 
>   Author: Paul Dagnelie 
> 
> Modified:
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
> Directory Properties:
>   head/sys/cddl/contrib/opensolaris/   (props changed)
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
> ==
> --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
> Wed Sep 28 23:54:47 2016(r306424)
> +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
> Thu Sep 29 00:00:37 2016(r306425)
> @@ -40,6 +40,11 @@
>  #include 
>  
>  int32_t zfs_pd_bytes_max = 50 * 1024 * 1024; /* 50MB */
> +boolean_t send_holes_without_birth_time = B_TRUE;
> +
> +SYSCTL_DECL(_vfs_zfs);
> +SYSCTL_UINT(_vfs_zfs, OID_AUTO, send_holes_without_birth_time, CTLFLAG_RWTUN,
> +&send_holes_without_birth_time, 0, "Send holes without birth time");


I think that this should be guarded with _KERNEL.

>  typedef struct prefetch_data {
>   kmutex_t pd_mtx;
> @@ -254,7 +259,8 @@ traverse_visitbp(traverse_data_t *td, co
>*
>* Note that the meta-dnode cannot be reallocated.
>*/
> - if ((!td->td_realloc_possible ||
> + if (!send_holes_without_birth_time &&
> + (!td->td_realloc_possible ||
>   zb->zb_object == DMU_META_DNODE_OBJECT) &&
>   td->td_hole_birth_enabled_txg <= td->td_min_txg)
>   return (0);
> 


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


svn commit: r306444 - head/sys/arm/nvidia/tegra124

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Thu Sep 29 12:25:04 2016
New Revision: 306444
URL: https://svnweb.freebsd.org/changeset/base/306444

Log:
  TEGRA: Don't include files already included by system or arch configs.

Modified:
  head/sys/arm/nvidia/tegra124/files.tegra124

Modified: head/sys/arm/nvidia/tegra124/files.tegra124
==
--- head/sys/arm/nvidia/tegra124/files.tegra124 Thu Sep 29 11:18:48 2016
(r306443)
+++ head/sys/arm/nvidia/tegra124/files.tegra124 Thu Sep 29 12:25:04 2016
(r306444)
@@ -1,12 +1,6 @@
 # $FreeBSD$
 
 #
-# Standard ARM support.
-#
-kern/kern_clocksource.cstandard
-dev/ofw/ofw_cpu.c  optionalfdt
-
-#
 # Standard tegra124 devices and support.
 #
 arm/nvidia/tegra124/tegra124_machdep.c standard
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r305819 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2016-09-29 Thread Oliver Pinter
On Thursday, September 29, 2016, Shawn Webb 
wrote:

> On Wed, Sep 14, 2016 at 09:15:01PM +, Martin Matuska wrote:
> > Author: mm
> > Date: Wed Sep 14 21:15:01 2016
> > New Revision: 305819
> > URL: https://svnweb.freebsd.org/changeset/base/305819
> >
> > Log:
> >   MFV r305816:
> >   Sync libarchive with vendor including important security fixes.
> >
> >   Issues fixed (FreeBSD):
> >   PR #778: ACL error handling
> >   Issue #745: Symlink check prefix optimization is too aggressive
> >   Issue #746: Hard links with data can evade sandboxing restrictions
> >
> >   This update fixes the vulnerability #3 and vulnerability #4 as
> reported in
> >   "non-cryptanalytic attacks against FreeBSD update components".
> >   https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f
> >
> >   Fix for vulnerability #2 has already been merged in r304989.
> >
> >   MFC after:  1 week
> >   Security: http://gist.github.com/anonymous/
> e48209b03f1dd9625a992717e7b89c4f
>
> Hey Martin,
>
> Any plans to release a security announcement?
>
>
I expect that at the same time, as 11.0-RELEASE is announced.  It would be
logical.


> Thanks,
>
> --
> Shawn Webb
> Cofounder and Security Engineer
> HardenedBSD
>
> GPG Key ID:  0x6A84658F52456EEE
> GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE
>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306443 - head/sys/netinet

2016-09-29 Thread Julien Charbon
Author: jch
Date: Thu Sep 29 11:18:48 2016
New Revision: 306443
URL: https://svnweb.freebsd.org/changeset/base/306443

Log:
  Fix an issue with accept_filter introduced with r261242:
  
  As a side effect of r261242 when using accept_filter the
  first call to soisconnected() is done earlier in tcp_input()
  instead of tcp_do_segment() context.  Restore the expected behaviour.
  
  Note:  This call to soisconnected() seems to be extraneous in all
  cases (with or without accept_filter).  Will be addressed in a
  separate commit.
  
  PR:   212920
  Reported by:  Alexey
  Tested by:  Alexey, jch
  Sponsored by:   Verisign, Inc.
  MFC after:1 week

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Thu Sep 29 11:13:51 2016
(r306442)
+++ head/sys/netinet/tcp_syncache.c Thu Sep 29 11:18:48 2016
(r306443)
@@ -918,7 +918,9 @@ syncache_socket(struct syncache *sc, str
tp->t_keepcnt = sototcpcb(lso)->t_keepcnt;
tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
 
-   soisconnected(so);
+   if ((so->so_options & SO_ACCEPTFILTER) == 0) {
+   soisconnected(so);
+   }
 
TCPSTAT_INC(tcps_accepts);
return (so);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306442 - in head/sys/arm: conf nvidia/tegra124

2016-09-29 Thread Michal Meloun
Author: mmel
Date: Thu Sep 29 11:13:51 2016
New Revision: 306442
URL: https://svnweb.freebsd.org/changeset/base/306442

Log:
  TEGRA: Add support for MULTIDELAY option.

Modified:
  head/sys/arm/conf/TEGRA124
  head/sys/arm/nvidia/tegra124/tegra124_machdep.c

Modified: head/sys/arm/conf/TEGRA124
==
--- head/sys/arm/conf/TEGRA124  Thu Sep 29 10:38:20 2016(r306441)
+++ head/sys/arm/conf/TEGRA124  Thu Sep 29 11:13:51 2016(r306442)
@@ -26,6 +26,7 @@ ident TEGRA124
 optionsSCHED_ULE   # ULE scheduler
 optionsPLATFORM# Platform based SoC
 optionsPLATFORM_SMP
+optionsMULTIDELAY
 optionsSMP # Enable multiple cores
 optionsLINUX_BOOT_ABI
 

Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c
==
--- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Sep 29 10:38:20 
2016(r306441)
+++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Thu Sep 29 11:13:51 
2016(r306442)
@@ -153,4 +153,4 @@ static platform_method_t tegra124_method
PLATFORMMETHOD_END,
 };
 
-FDT_PLATFORM_DEF(tegra124, "Nvidia Jetson-TK1", 0, "nvidia,jetson-tk1", 0);
+FDT_PLATFORM_DEF(tegra124, "Nvidia Jetson-TK1", 0, "nvidia,jetson-tk1", 120);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306441 - in head: share/man/man9 sys/kern

2016-09-29 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Sep 29 10:38:20 2016
New Revision: 306441
URL: https://svnweb.freebsd.org/changeset/base/306441

Log:
  While draining a timeout task prevent the taskqueue_enqueue_timeout()
  function from restarting the timer.
  
  Commonly taskqueue_enqueue_timeout() is called from within the task
  function itself without any checks for teardown. Then it can happen
  the timer stays active after the return of taskqueue_drain_timeout(),
  because the timeout and task is drained separately.
  
  This patch factors out the teardown flag into the timeout task itself,
  allowing existing code to stay as-is instead of applying a teardown
  flag to each and every of the timeout task consumers.
  
  Add assert to taskqueue_drain_timeout() which prevents parallel
  execution on the same timeout task.
  
  Update manual page documenting the return value of
  taskqueue_enqueue_timeout().
  
  Differential Revision:https://reviews.freebsd.org/D8012
  Reviewed by:  kib, trasz
  MFC after:1 week

Modified:
  head/share/man/man9/taskqueue.9
  head/sys/kern/subr_taskqueue.c

Modified: head/share/man/man9/taskqueue.9
==
--- head/share/man/man9/taskqueue.9 Thu Sep 29 09:16:02 2016
(r306440)
+++ head/share/man/man9/taskqueue.9 Thu Sep 29 10:38:20 2016
(r306441)
@@ -223,6 +223,8 @@ Otherwise, the task is scheduled for enq
 after the absolute value of
 .Va ticks
 is passed.
+This function will return -1 if the queue is being drained.
+Otherwise the number of pending calls will be returned.
 .Pp
 The
 .Fn taskqueue_cancel

Modified: head/sys/kern/subr_taskqueue.c
==
--- head/sys/kern/subr_taskqueue.c  Thu Sep 29 09:16:02 2016
(r306440)
+++ head/sys/kern/subr_taskqueue.c  Thu Sep 29 10:38:20 2016
(r306441)
@@ -81,6 +81,7 @@ struct taskqueue {
 #defineTQ_FLAGS_UNLOCKED_ENQUEUE   (1 << 2)
 
 #defineDT_CALLOUT_ARMED(1 << 0)
+#defineDT_DRAIN_IN_PROGRESS(1 << 1)
 
 #defineTQ_LOCK(tq) 
\
do {\
@@ -299,7 +300,11 @@ taskqueue_enqueue_timeout(struct taskque
KASSERT(!queue->tq_spin, ("Timeout for spin-queue"));
timeout_task->q = queue;
res = timeout_task->t.ta_pending;
-   if (ticks == 0) {
+   if (timeout_task->f & DT_DRAIN_IN_PROGRESS) {
+   /* Do nothing */
+   TQ_UNLOCK(queue);
+   res = -1;
+   } else if (ticks == 0) {
taskqueue_enqueue_locked(queue, &timeout_task->t);
/* The lock is released inside. */
} else {
@@ -559,8 +564,24 @@ taskqueue_drain_timeout(struct taskqueue
 struct timeout_task *timeout_task)
 {
 
+   /*
+* Set flag to prevent timer from re-starting during drain:
+*/
+   TQ_LOCK(queue);
+   KASSERT((timeout_task->f & DT_DRAIN_IN_PROGRESS) == 0,
+   ("Drain already in progress"));
+   timeout_task->f |= DT_DRAIN_IN_PROGRESS;
+   TQ_UNLOCK(queue);
+
callout_drain(&timeout_task->c);
taskqueue_drain(queue, &timeout_task->t);
+
+   /*
+* Clear flag to allow timer to re-start:
+*/
+   TQ_LOCK(queue);
+   timeout_task->f &= ~DT_DRAIN_IN_PROGRESS;
+   TQ_UNLOCK(queue);
 }
 
 static void
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306440 - head/contrib/atf/atf-sh

2016-09-29 Thread Ruslan Bukin
Author: br
Date: Thu Sep 29 09:16:02 2016
New Revision: 306440
URL: https://svnweb.freebsd.org/changeset/base/306440

Log:
  Fix conversion from C++ std::string into C const char *.
  This fixes operation on MIPS64EB with GCC 4.2.1.
  
  Reviewed by:  jmmv
  Sponsored by: DARPA, AFRL
  Sponsored by: HEIF5
  Differential Revision:https://reviews.freebsd.org/D7952

Modified:
  head/contrib/atf/atf-sh/atf-check.cpp

Modified: head/contrib/atf/atf-sh/atf-check.cpp
==
--- head/contrib/atf/atf-sh/atf-check.cpp   Thu Sep 29 08:49:12 2016
(r306439)
+++ head/contrib/atf/atf-sh/atf-check.cpp   Thu Sep 29 09:16:02 2016
(r306440)
@@ -346,9 +346,10 @@ std::auto_ptr< atf::check::check_result 
 execute_with_shell(char* const* argv)
 {
 const std::string cmd = flatten_argv(argv);
+const std::string shell = atf::env::get("ATF_SHELL", ATF_SHELL);
 
 const char* sh_argv[4];
-sh_argv[0] = atf::env::get("ATF_SHELL", ATF_SHELL).c_str();
+sh_argv[0] = shell.c_str();
 sh_argv[1] = "-c";
 sh_argv[2] = cmd.c_str();
 sh_argv[3] = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r306439 - head/sys/arm/include

2016-09-29 Thread Andrew Turner
Author: andrew
Date: Thu Sep 29 08:49:12 2016
New Revision: 306439
URL: https://svnweb.freebsd.org/changeset/base/306439

Log:
  Remove struct platform_data, it was never used.
  
  Sponsored by: ABT Systems Ltd

Modified:
  head/sys/arm/include/platformvar.h

Modified: head/sys/arm/include/platformvar.h
==
--- head/sys/arm/include/platformvar.h  Thu Sep 29 08:32:19 2016
(r306438)
+++ head/sys/arm/include/platformvar.h  Thu Sep 29 08:49:12 2016
(r306439)
@@ -70,10 +70,6 @@ struct platform_kobj {
struct platform_class *cls;
 };
 
-struct platform_data {
-   int delay_count;
-};
-
 typedef struct platform_kobj   *platform_t;
 typedef struct platform_class  platform_def_t;
 #define platform_method_t  kobj_method_t
@@ -100,11 +96,6 @@ extern platform_method_t fdt_platform_me
 #defineFDT_PLATFORM_CTASSERT(delay)CTASSERT(delay == 0)
 #endif
 
-#definePLATFORM_DATA(NAME, delay)  
\
-static struct platform_data NAME ## _platc = { \
-   .delay_count = delay;   \
-};
-
 #define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible,  \
 delay) \
 FDT_PLATFORM_CTASSERT(delay);  \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r305486 - head/usr.bin/bsdiff/bspatch

2016-09-29 Thread Shawn Webb
On Tue, Sep 06, 2016 at 07:00:37PM +, Ed Maste wrote:
> Author: emaste
> Date: Tue Sep  6 19:00:37 2016
> New Revision: 305486
> URL: https://svnweb.freebsd.org/changeset/base/305486
> 
> Log:
>   bspatch: add sanity checks on sizes to avoid integer overflow
>   
>   Note that this introduces an explicit 2GB limit, but this was already
>   implicit in variable and function argument types.
>   
>   This is based on the "non-cryptanalytic attacks against freebsd
>   update components" anonymous gist. Further refinement is planned.
>   
>   Reviewed by:allanjude, cem, kib
>   Obtained from:  anonymous gist
>   MFC after:  3 days
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D7619

Hey Ed,

Any plans to release a security announcement?

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


Re: svn commit: r305819 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test lib/libarchive/tests

2016-09-29 Thread Shawn Webb
On Wed, Sep 14, 2016 at 09:15:01PM +, Martin Matuska wrote:
> Author: mm
> Date: Wed Sep 14 21:15:01 2016
> New Revision: 305819
> URL: https://svnweb.freebsd.org/changeset/base/305819
> 
> Log:
>   MFV r305816:
>   Sync libarchive with vendor including important security fixes.
>   
>   Issues fixed (FreeBSD):
>   PR #778: ACL error handling
>   Issue #745: Symlink check prefix optimization is too aggressive
>   Issue #746: Hard links with data can evade sandboxing restrictions
>   
>   This update fixes the vulnerability #3 and vulnerability #4 as reported in
>   "non-cryptanalytic attacks against FreeBSD update components".
>   https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f
>   
>   Fix for vulnerability #2 has already been merged in r304989.
>   
>   MFC after:  1 week
>   Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f

Hey Martin,

Any plans to release a security announcement?

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


Re: svn commit: r306417 - head/usr.sbin/portsnap/portsnap

2016-09-29 Thread Shawn Webb
On Wed, Sep 28, 2016 at 09:22:51PM +, Ed Maste wrote:
> Author: emaste
> Date: Wed Sep 28 21:22:51 2016
> New Revision: 306417
> URL: https://svnweb.freebsd.org/changeset/base/306417
> 
> Log:
>   portsnap: only move expected snapshot contents from snap/ to files/
>   
>   Previously it was possible to smuggle in addional files that would
>   be used by later portsnap runs. Now we only move those files expected
>   to be in the snapshot into files/ and require that there are no
>   unexpected files.
>   
>   This was used by portsnap attacks 2, 3, and 4 in the "non-cryptanalytic
>   attacks against FreeBSD update components" anonymous gist.
>   
>   Reported by:anonymous gist
>   Reviewed by:allanjude, delphij
>   MFC after:  ASAP
>   Sponsored by:   The FreeBSD Foundation
>   Differential Revision:  https://reviews.freebsd.org/D8052

Hey Ed,

Any plans to release a security announcement?

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature