Re: svn commit: r340413 - in head/sys: kern net sys

2018-11-14 Thread Gleb Smirnoff
On Wed, Nov 14, 2018 at 10:27:48PM +0200, Konstantin Belousov wrote:
K> On Wed, Nov 14, 2018 at 08:28:31AM -0800, Gleb Smirnoff wrote:
K> > On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote:
K> > H> On 11/14/18 10:33 AM, Cy Schubert wrote:
K> > H> > + epoch_thread_init(td);
K> > H> 
K> > H> Did you forget to call epoch_thread_init() for thread0 ?
K> > 
K> > Yes, this is my guess. I'm preparing patch for Cy to test.
K> 
K> Is this stuff allocated for each thread, unconditionally ?
K> If yes, why is it allocatable instead of embedding it into struct thread ?

I wish to do that, but struct thread is exposed to userland, and all
epoch structures are not.

-- 
Gleb Smirnoff
___
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: r340448 - in head/sys/cam: ata scsi

2018-11-14 Thread Warner Losh
Author: imp
Date: Wed Nov 14 23:15:50 2018
New Revision: 340448
URL: https://svnweb.freebsd.org/changeset/base/340448

Log:
  Remove trailing white space in advance of other changes.

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Wed Nov 14 22:05:20 2018(r340447)
+++ head/sys/cam/ata/ata_da.c   Wed Nov 14 23:15:50 2018(r340448)
@@ -987,7 +987,7 @@ adaclose(struct disk *dp)
cam_periph_sleep(periph, >refcount, PRIBIO, "adaclose", 
1);
cam_periph_unlock(periph);
cam_periph_release(periph);
-   return (0); 
+   return (0);
 }
 
 static void
@@ -1011,7 +1011,7 @@ adastrategy(struct bio *bp)
 {
struct cam_periph *periph;
struct ada_softc *softc;
-   
+
periph = (struct cam_periph *)bp->bio_disk->d_drv1;
softc = (struct ada_softc *)periph->softc;
 
@@ -1035,7 +1035,7 @@ adastrategy(struct bio *bp)
 */
if (bp->bio_cmd == BIO_ZONE)
bp->bio_flags |= BIO_ORDERED;
-   
+
/*
 * Place it in the queue of disk activities for this disk
 */
@@ -1068,7 +1068,6 @@ adadump(void *arg, void *virtual, vm_offset_t physical
secsize = softc->params.secsize;
lba = offset / secsize;
count = length / secsize;
-   
if ((periph->flags & CAM_PERIPH_INVALID) != 0)
return (ENXIO);
 
@@ -1258,7 +1257,7 @@ adaasync(void *callback_arg, u_int32_t code,
{
struct ccb_getdev *cgd;
cam_status status;
- 
+
cgd = (struct ccb_getdev *)arg;
if (cgd == NULL)
break;
@@ -2161,7 +2160,7 @@ ada_zone_cmd(struct cam_periph *periph, union ccb *ccb
error = ENOMEM;
goto bailout;
}
-   
+
ata_zac_mgmt_in(>ataio,
/*retries*/ ada_retry_count,
/*cbcfnp*/ adadone,
@@ -3002,7 +3001,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
 */
if ((softc->valid_logdir_len >=
((ATA_IDENTIFY_DATA_LOG + 1) * sizeof(uint16_t)))
-&& (le16dec(softc->ata_logdir.header) == 
+&& (le16dec(softc->ata_logdir.header) ==
 ATA_GP_LOG_DIR_VERSION)
 && (le16dec(>ata_logdir.num_pages[
 (ATA_IDENTIFY_DATA_LOG *
@@ -3022,7 +3021,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
 * then ATA logs are effectively not
 * supported even if the bit is set in the
 * identify data.
-*/ 
+*/
softc->flags &= ~(ADA_FLAG_CAN_LOG |
  ADA_FLAG_CAN_IDLOG);
if ((done_ccb->ccb_h.status &
@@ -3132,7 +3131,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
softc->state = ADA_STATE_SUP_CAP;
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
-   } else 
+   } else
adaprobedone(periph, done_ccb);
return;
}
@@ -3196,11 +3195,10 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
 * to an earlier spec, it won't have
 * the field.  So, assume all
 * commands are supported.
-*/ 
+*/
softc->zone_flags |=
ADA_ZONE_FLAG_SUP_MASK;
}
-   
}
} else {
error = adaerror(done_ccb, CAM_RETRY_SELTO,
@@ -3237,7 +3235,7 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
softc->state = ADA_STATE_ZONE;
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
-   } else  
+   } else
adaprobedone(periph, done_ccb);
return;
}
@@ -3321,7 +3319,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb
 /*getcount_only*/0);
}
}
-   
}
free(ataio->data_ptr, M_ATADA);

svn commit: r340447 - stable/12/sys/dev/amdtemp

2018-11-14 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 14 22:05:20 2018
New Revision: 340447
URL: https://svnweb.freebsd.org/changeset/base/340447

Log:
  MFC r340426 (by cem)
  
  amdtemp(4): Fix temperature reporting on AMD 2990WX
  
  Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
  OSRR, section 4.2.1.
  
  For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
  range -49..206; i.e., subtract 49°C.
  
  Submitted by: gallatin@
  Reported by:  bcran@
  Reviewed by:  cem (long ago)
  Approved by:  re (kib)
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D16855

Modified:
  stable/12/sys/dev/amdtemp/amdtemp.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/amdtemp/amdtemp.c
==
--- stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 21:31:26 2018
(r340446)
+++ stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 22:05:20 2018
(r340447)
@@ -115,8 +115,15 @@ static struct amdtemp_product {
 
 /*
  * Reported Temperature, Family 17h
+ *
+ * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register
+ * provide the current temp.  bit 19, when clear, means the temp is reported in
+ * a range 0.."225C" (probable typo for 255C), and when set changes the range
+ * to -49..206C.
  */
-#defineAMDTEMP_17H_CUR_TMP 0x59800
+#defineAMDTEMP_17H_CUR_TMP 0x59800
+#defineAMDTEMP_17H_CUR_TMP_RANGE_SEL   (1 << 19)
+#defineAMDTEMP_17H_CUR_TMP_RANGE_OFF   490
 
 /*
  * Thermaltrip Status Register (Family 0Fh only)
@@ -595,13 +602,15 @@ static int32_t
 amdtemp_gettemp17h(device_t dev, amdsensor_t sensor)
 {
struct amdtemp_softc *sc = device_get_softc(dev);
-   uint32_t temp;
+   uint32_t temp, val;
int error;
 
-   error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, );
+   error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, );
KASSERT(error == 0, ("amdsmn_read"));
 
-   temp = ((temp >> 21) & 0x7ff) * 5 / 4;
+   temp = ((val >> 21) & 0x7ff) * 5 / 4;
+   if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0)
+   temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF;
temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10;
 
return (temp);
___
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: r340446 - in stable/12/sys/dev: amdsmn amdtemp

2018-11-14 Thread Eric van Gyzen
Author: vangyzen
Date: Wed Nov 14 21:31:26 2018
New Revision: 340446
URL: https://svnweb.freebsd.org/changeset/base/340446

Log:
  MFC r340425 (by cem)
  
  amdsmn(4)/amdtemp(4): Attach to Ryzen 2 hostbridges
  
  As reported, tested, and patch supplied by Johannes.
  
  There may be future work to do to support multiple sensors, but for now, any
  sensor at all is a strict improvement for Ryzen 2 systems.
  
  PR:   228480
  Submitted by: Johannes Lundberg  (earlier version)
  Reported by:  deischen@, Johannes, and numerous others
  Early MFC approved by:  cem
  Approved by:re (kib)
  Relnotes:   yes

Modified:
  stable/12/sys/dev/amdsmn/amdsmn.c
  stable/12/sys/dev/amdtemp/amdtemp.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/amdsmn/amdsmn.c
==
--- stable/12/sys/dev/amdsmn/amdsmn.c   Wed Nov 14 20:36:18 2018
(r340445)
+++ stable/12/sys/dev/amdsmn/amdsmn.c   Wed Nov 14 21:31:26 2018
(r340446)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -53,14 +54,21 @@ __FBSDID("$FreeBSD$");
 #defineSMN_ADDR_REG0x60
 #defineSMN_DATA_REG0x64
 
+#definePCI_DEVICE_ID_AMD_17H_ROOT  0x1450
+#definePCI_DEVICE_ID_AMD_17H_ROOT_DF_F30x1463
+#definePCI_DEVICE_ID_AMD_17H_M10H_ROOT 0x15d0
+#definePCI_DEVICE_ID_AMD_17H_M10H_ROOT_DF_F3   0x15eb
+
 struct amdsmn_softc {
struct mtx smn_lock;
 };
 
 static struct pciid {
-   uint32_tdevice_id;
+   uint16_tamdsmn_vendorid;
+   uint16_tamdsmn_deviceid;
 } amdsmn_ids[] = {
-   { 0x14501022 },
+   { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_ROOT },
+   { CPU_VENDOR_AMD, PCI_DEVICE_ID_AMD_17H_M10H_ROOT },
 };
 
 /*
@@ -89,18 +97,21 @@ static driver_t amdsmn_driver = {
 static devclass_t amdsmn_devclass;
 DRIVER_MODULE(amdsmn, hostb, amdsmn_driver, amdsmn_devclass, NULL, NULL);
 MODULE_VERSION(amdsmn, 1);
-MODULE_PNP_INFO("W32:vendor/device", pci, amdsmn, amdsmn_ids,
+MODULE_PNP_INFO("U16:vendor;U16:device", pci, amdsmn, amdsmn_ids,
 nitems(amdsmn_ids));
 
 static bool
 amdsmn_match(device_t parent)
 {
-   uint32_t devid;
+   uint16_t vendor, device;
size_t i;
 
-   devid = pci_get_devid(parent);
+   vendor = pci_get_vendor(parent);
+   device = pci_get_device(parent);
+
for (i = 0; i < nitems(amdsmn_ids); i++)
-   if (amdsmn_ids[i].device_id == devid)
+   if (vendor == amdsmn_ids[i].amdsmn_vendorid &&
+   device == amdsmn_ids[i].amdsmn_deviceid)
return (true);
return (false);
 }

Modified: stable/12/sys/dev/amdtemp/amdtemp.c
==
--- stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 20:36:18 2018
(r340445)
+++ stable/12/sys/dev/amdtemp/amdtemp.c Wed Nov 14 21:31:26 2018
(r340446)
@@ -86,7 +86,10 @@ struct amdtemp_softc {
 #defineDEVICEID_AMD_MISC16 0x1533
 #defineDEVICEID_AMD_MISC16_M30H0x1583
 #defineDEVICEID_AMD_MISC17 0x141d
-#defineDEVICEID_AMD_HOSTB17H   0x1450
+#defineDEVICEID_AMD_HOSTB17H_ROOT  0x1450
+#defineDEVICEID_AMD_HOSTB17H_DF_F3 0x1463
+#defineDEVICEID_AMD_HOSTB17H_M10H_ROOT 0x15d0
+#defineDEVICEID_AMD_HOSTB17H_M10H_DF_F3 0x15eb
 
 static struct amdtemp_product {
uint16_tamdtemp_vendorid;
@@ -101,7 +104,8 @@ static struct amdtemp_product {
{ VENDORID_AMD, DEVICEID_AMD_MISC16 },
{ VENDORID_AMD, DEVICEID_AMD_MISC16_M30H },
{ VENDORID_AMD, DEVICEID_AMD_MISC17 },
-   { VENDORID_AMD, DEVICEID_AMD_HOSTB17H },
+   { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_ROOT },
+   { VENDORID_AMD, DEVICEID_AMD_HOSTB17H_M10H_ROOT },
 };
 
 /*
___
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: r340436 - in head/sys/dev: netmap virtio/network

2018-11-14 Thread Rodney W. Grimes
> On Wed, Nov 14, 2018, 8:44 PM Rodney W. Grimes <
> free...@pdx.rh.cn85.dnsmgr.net wrote:
> 
> > > Author: vmaffione
> > > Date: Wed Nov 14 15:39:48 2018
> > > New Revision: 340436
> > > URL: https://svnweb.freebsd.org/changeset/base/340436
> > >
> > > Log:
> > >   vtnet: fix netmap support
> > >
> > >   netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
> > >   This commit fixes those bugs to bring netmap on vtnet in a functional
> > state.
> > >
> > >   Changelist:
> > > - handle errors returned by virtqueue_enqueue() properly (they were
> > >   previously ignored)
> > > - make sure netmap XOR rest of the kernel access each virtqueue.
> > > - compute the number of netmap slots for TX and RX separately,
> > according to
> > >   whether indirect descriptors are used or not for a given virtqueue.
> > > - make sure sglist are freed according to their type (mbufs or netmap
> > >   buffers)
> > > - add support for mulitiqueue and netmap host (aka sw) rings.
> > > - intercept VQ interrupts directly instead of intercepting them in
> > txq_eof
> > >   and rxq_eof. This simplifies the code and makes it easier to make
> > sure
> > >   taskqueues are not running for a VQ while it is in netmap mode.
> > > - implement vntet_netmap_config() to cope with changes in the number
> > of queues.
> > >
> > >   Reviewed by:bryanv
> > >   Approved by:gnn (mentor)
> > >   MFC after:  3 days
> > >   Sponsored by:   Sunny Valley Networks
> > >   Differential Revision:  https://reviews.freebsd.org/D17916
> >
> > I would like to get some wider test of this in ^head/
> > specifically with use in a bhyve guest before we do
> > an early merge to stable/12 so that this can be in
> > the next build.
> >
> > If you are capable of testing this within bhyve as a guest
> > please do so and provide feedback.  It does not need to be
> > a ^/head host, just the guest needs to be using vtnet
> > nic's.
> >
> >
> The tests I did are reported here https://reviews.freebsd.org/D17916 , and
> consist of one or two ^/head guests, each
> one having a vtnet NIC. The hypervisor is qemu-kvm, running in the host.
> Unfortunately I cannot do tests with bhyve as an hypervisor, because that
> requires a FreeBSD host (e.g., ^/head , stable/12 or stable/11),
> and at the moment I don't have one.

Ok, thanks for the update information, I miss understood, so
what we need is testing of ^/head bhyve using a ^/head guest.

-- 
Rod Grimes rgri...@freebsd.org
___
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: r340436 - in head/sys/dev: netmap virtio/network

2018-11-14 Thread Vincenzo Maffione
On Wed, Nov 14, 2018, 8:44 PM Rodney W. Grimes <
free...@pdx.rh.cn85.dnsmgr.net wrote:

> > Author: vmaffione
> > Date: Wed Nov 14 15:39:48 2018
> > New Revision: 340436
> > URL: https://svnweb.freebsd.org/changeset/base/340436
> >
> > Log:
> >   vtnet: fix netmap support
> >
> >   netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
> >   This commit fixes those bugs to bring netmap on vtnet in a functional
> state.
> >
> >   Changelist:
> > - handle errors returned by virtqueue_enqueue() properly (they were
> >   previously ignored)
> > - make sure netmap XOR rest of the kernel access each virtqueue.
> > - compute the number of netmap slots for TX and RX separately,
> according to
> >   whether indirect descriptors are used or not for a given virtqueue.
> > - make sure sglist are freed according to their type (mbufs or netmap
> >   buffers)
> > - add support for mulitiqueue and netmap host (aka sw) rings.
> > - intercept VQ interrupts directly instead of intercepting them in
> txq_eof
> >   and rxq_eof. This simplifies the code and makes it easier to make
> sure
> >   taskqueues are not running for a VQ while it is in netmap mode.
> > - implement vntet_netmap_config() to cope with changes in the number
> of queues.
> >
> >   Reviewed by:bryanv
> >   Approved by:gnn (mentor)
> >   MFC after:  3 days
> >   Sponsored by:   Sunny Valley Networks
> >   Differential Revision:  https://reviews.freebsd.org/D17916
>
> I would like to get some wider test of this in ^head/
> specifically with use in a bhyve guest before we do
> an early merge to stable/12 so that this can be in
> the next build.
>
> If you are capable of testing this within bhyve as a guest
> please do so and provide feedback.  It does not need to be
> a ^/head host, just the guest needs to be using vtnet
> nic's.
>
>
The tests I did are reported here https://reviews.freebsd.org/D17916 , and
consist of one or two ^/head guests, each
one having a vtnet NIC. The hypervisor is qemu-kvm, running in the host.
Unfortunately I cannot do tests with bhyve as an hypervisor, because that
requires a FreeBSD host (e.g., ^/head , stable/12 or stable/11),
and at the moment I don't have one.

Cheers,
  Vincenzo
___
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: r340445 - head/sys/net

2018-11-14 Thread Stephen Hurd
Author: shurd
Date: Wed Nov 14 20:36:18 2018
New Revision: 340445
URL: https://svnweb.freebsd.org/changeset/base/340445

Log:
  Clear RX completion queue state veriables in iflib_stop()
  
  iflib_stop() was not resetting the rxq completion queue state variables.
  This meant that for any driver that has receive completion queues, after a
  reinit, iflib would start asking what's available on the rx side starting at
  whatever the completion queue index was prior to the stop, instead of at 0.
  
  Submitted by: pkelsey
  Reported by:  pkelsey
  MFC after:3 days
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Nov 14 20:35:04 2018(r340444)
+++ head/sys/net/iflib.cWed Nov 14 20:36:18 2018(r340445)
@@ -2414,6 +2414,7 @@ iflib_stop(if_ctx_t ctx)
for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
/* make sure all transmitters have completed before proceeding 
XXX */
 
+   rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0;
for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++)
bzero((void *)di->idi_vaddr, di->idi_size);
/* also resets the free lists pidx/cidx */
___
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: r340444 - in stable/12: . usr.sbin/ctm/ctm

2018-11-14 Thread Stefan Esser
Author: se
Date: Wed Nov 14 20:35:04 2018
New Revision: 340444
URL: https://svnweb.freebsd.org/changeset/base/340444

Log:
  MFC S340428: Prepare move of ctm from base to a port (misc/ctm) by:
  - Adding a note to UPDATING
  - Adding a note to the history section of the manpage ctm.1
  - Adding a message printed to STDERR to the ctm program
  
  This version is meant for release in FreeBSD-12.0 and should remain in
  FreeBSD-12 over its life-time.
  
  A follow-up commit will remove ctm from -CURRENT after the MFC to 12
  has happened.
  
  Approved by:re
  Relnotes:   yes
  Differential Revision:  https://reviews.freebsd.org/D17969

Modified:
  stable/12/UPDATING
  stable/12/usr.sbin/ctm/ctm/ctm.1
  stable/12/usr.sbin/ctm/ctm/ctm.c

Modified: stable/12/UPDATING
==
--- stable/12/UPDATING  Wed Nov 14 19:10:35 2018(r340443)
+++ stable/12/UPDATING  Wed Nov 14 20:35:04 2018(r340444)
@@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITHOUT_CLANG and 
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20181115:
+   The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue)
+   has been converted to a port (misc/ctm) and will be removed from
+   FreeBSD-13.  A depreciation warning will be printed to stderr by
+   the ctm command, but the functionality will remain in base for all
+   FreeBSD-12 releases.
+
 20181019:
The stable/12 branch has been created in subversion from head
revision r339432.

Modified: stable/12/usr.sbin/ctm/ctm/ctm.1
==
--- stable/12/usr.sbin/ctm/ctm/ctm.1Wed Nov 14 19:10:35 2018
(r340443)
+++ stable/12/usr.sbin/ctm/ctm/ctm.1Wed Nov 14 20:35:04 2018
(r340444)
@@ -12,7 +12,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 14, 2016
+.Dd November 15, 2018
 .Dt CTM 1
 .Os
 .Sh NAME
@@ -321,6 +321,12 @@ The
 .Nm
 command appeared in
 .Fx 2.1 .
+.Pp
+The latest
+.Nm
+code has been made available as a port (misc/ctm) in preparation of removal
+from base in
+.Fx 13.0 .
 .Sh AUTHORS
 .An -nosplit
 The CTM system has been designed and implemented by

Modified: stable/12/usr.sbin/ctm/ctm/ctm.c
==
--- stable/12/usr.sbin/ctm/ctm/ctm.cWed Nov 14 19:10:35 2018
(r340443)
+++ stable/12/usr.sbin/ctm/ctm/ctm.cWed Nov 14 20:35:04 2018
(r340444)
@@ -144,6 +144,9 @@ main(int argc, char **argv)
warnx("%d errors during option processing",stat);
return Exit_Pilot;
 }
+fprintf(stderr, "CTM will be removed from FreeBSD-13, and will be "
+   "provided as a port (misc/ctm) or package (ctm).\n\n");
+
 stat = Exit_Done;
 argc -= optind;
 argv += optind;
___
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: r340413 - in head/sys: kern net sys

2018-11-14 Thread Konstantin Belousov
On Wed, Nov 14, 2018 at 08:28:31AM -0800, Gleb Smirnoff wrote:
> On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote:
> H> On 11/14/18 10:33 AM, Cy Schubert wrote:
> H> > +epoch_thread_init(td);
> H> 
> H> Did you forget to call epoch_thread_init() for thread0 ?
> 
> Yes, this is my guess. I'm preparing patch for Cy to test.

Is this stuff allocated for each thread, unconditionally ?
If yes, why is it allocatable instead of embedding it into struct thread ?
___
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: r340436 - in head/sys/dev: netmap virtio/network

2018-11-14 Thread Rodney W. Grimes
> Author: vmaffione
> Date: Wed Nov 14 15:39:48 2018
> New Revision: 340436
> URL: https://svnweb.freebsd.org/changeset/base/340436
> 
> Log:
>   vtnet: fix netmap support
>   
>   netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
>   This commit fixes those bugs to bring netmap on vtnet in a functional state.
>   
>   Changelist:
> - handle errors returned by virtqueue_enqueue() properly (they were
>   previously ignored)
> - make sure netmap XOR rest of the kernel access each virtqueue.
> - compute the number of netmap slots for TX and RX separately, according 
> to
>   whether indirect descriptors are used or not for a given virtqueue.
> - make sure sglist are freed according to their type (mbufs or netmap
>   buffers)
> - add support for mulitiqueue and netmap host (aka sw) rings.
> - intercept VQ interrupts directly instead of intercepting them in txq_eof
>   and rxq_eof. This simplifies the code and makes it easier to make sure
>   taskqueues are not running for a VQ while it is in netmap mode.
> - implement vntet_netmap_config() to cope with changes in the number of 
> queues.
>   
>   Reviewed by:bryanv
>   Approved by:gnn (mentor)
>   MFC after:  3 days
>   Sponsored by:   Sunny Valley Networks
>   Differential Revision:  https://reviews.freebsd.org/D17916

I would like to get some wider test of this in ^head/
specifically with use in a bhyve guest before we do
an early merge to stable/12 so that this can be in
the next build.

If you are capable of testing this within bhyve as a guest
please do so and provide feedback.  It does not need to be
a ^/head host, just the guest needs to be using vtnet
nic's.

Thanks,
Rod

> 
> Modified:
>   head/sys/dev/netmap/if_vtnet_netmap.h
>   head/sys/dev/virtio/network/if_vtnet.c
>   head/sys/dev/virtio/network/if_vtnetvar.h
> 
> Modified: head/sys/dev/netmap/if_vtnet_netmap.h
> ==
> --- head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:23:39 2018
> (r340435)
> +++ head/sys/dev/netmap/if_vtnet_netmap.h Wed Nov 14 15:39:48 2018
> (r340436)
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (C) 2014 Vincenzo Maffione, Luigi Rizzo. All rights reserved.
> + * Copyright (C) 2014-2018 Vincenzo Maffione, Luigi Rizzo.
>   *
>   * Redistribution and use in source and binary forms, with or without
>   * modification, are permitted provided that the following conditions
> @@ -33,74 +33,148 @@
>  #include /* vtophys ? */
>  #include 
>  
> +/*
> + * Return 1 if the queue identified by 't' and 'idx' is in netmap mode.
> + */
> +static int
> +vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx)
> +{
> + struct netmap_adapter *na = NA(sc->vtnet_ifp);
>  
> -#define SOFTC_T  vtnet_softc
> + if (!nm_native_on(na))
> + return 0;
>  
> -/* Free all the unused buffer in all the RX virtqueues.
> - * This function is called when entering and exiting netmap mode.
> - * - buffers queued by the virtio driver return skbuf/mbuf pointer
> - *   and need to be freed;
> - * - buffers queued by netmap return the txq/rxq, and do not need work
> - */
> + if (t == NR_RX)
> + return !!(idx < na->num_rx_rings &&
> + na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON);
> +
> + return !!(idx < na->num_tx_rings &&
> + na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON);
> +}
> +
>  static void
> -vtnet_netmap_free_bufs(struct SOFTC_T* sc)
> +vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx)
>  {
> - int i, nmb = 0, n = 0, last;
> + void *cookie;
> + int deq = 0;
>  
> - for (i = 0; i < sc->vtnet_max_vq_pairs; i++) {
> - struct vtnet_rxq *rxq = >vtnet_rxqs[i];
> - struct virtqueue *vq;
> - struct mbuf *m;
> - struct vtnet_txq *txq = >vtnet_txqs[i];
> -struct vtnet_tx_header *txhdr;
> + while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) {
> + if (netmap_bufs) {
> + /* These are netmap buffers: there is nothing to do. */
> + } else {
> + /* These are mbufs that we need to free. */
> + struct mbuf *m;
>  
> - last = 0;
> - vq = rxq->vtnrx_vq;
> - while ((m = virtqueue_drain(vq, )) != NULL) {
> - n++;
> - if (m != (void *)rxq)
> + if (t == NR_TX) {
> + struct vtnet_tx_header *txhdr = cookie;
> + m = txhdr->vth_mbuf;
>   m_freem(m);
> - else
> - nmb++;
> - }
> -
> - last = 0;
> - vq = txq->vtntx_vq;
> - while ((txhdr = virtqueue_drain(vq, )) != NULL) {
> - n++;

Re: svn commit: r340426 - head/sys/dev/amdtemp

2018-11-14 Thread Ian Lepore
On Wed, 2018-11-14 at 08:33 -0800, Rodney W. Grimes wrote:
> > 
> > Author: cem
> > Date: Wed Nov 14 04:50:29 2018
> > New Revision: 340426
> > URL: https://svnweb.freebsd.org/changeset/base/340426
> > 
> > Log:
> >   amdtemp(4): Fix temperature reporting on AMD 2990WX
> >   
> >   Update the AMD family 17h temperature reporting based on AMD Tech
> > Doc 56255
> >   OSRR, section 4.2.1.
> >   
> >   For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature
> > into the
> >   range -49..206; i.e., subtract 49?C.
> >   
> >   Submitted by: gallatin@
> >   Reported by:  bcran@
> >   Reviewed by:  me (long ago)
> As per recent discussion on @developers, me@ is actually a valid
> committers name and should not be used to describe one self in
> commit messages.
> 

There is NO ambiguity, not even a tiny little bit, between the self-
referential me and the committer me@ in the context of that commit
message.

Is there no code to be written? No PRs to be closed? Do we all have so
much free time that there's nothing better to do than argue about this
kind of stupid angels-on-a-pin thing?

-- Ian

> > 
> >   MFC after:22.57 seconds
> >   Relnotes: yea
> I do not believe the relnotes processor understands slang.
> 
> > 
> >   Differential Revision:https://reviews.freebsd.org/D16855
> > 
> > Modified:
> >   head/sys/dev/amdtemp/amdtemp.c
> > 
> > Modified: head/sys/dev/amdtemp/amdtemp.c
> > ===
> > ===
> > --- head/sys/dev/amdtemp/amdtemp.c  Wed Nov 14 03:42:39 2018
> > (r340425)
> > +++ head/sys/dev/amdtemp/amdtemp.c  Wed Nov 14 04:50:29 2018
> > (r340426)
> > @@ -115,8 +115,15 @@ static struct amdtemp_product {
> >  
> >  /*
> >   * Reported Temperature, Family 17h
> > + *
> > + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of
> > this register
> > + * provide the current temp.  bit 19, when clear, means the temp
> > is reported in
> > + * a range 0.."225C" (probable typo for 255C), and when set
> > changes the range
> > + * to -49..206C.
> >   */
> > -#defineAMDTEMP_17H_CUR_TMP 0x59800
> > +#defineAMDTEMP_17H_CUR_TMP 0x59800
> > +#defineAMDTEMP_17H_CUR_TMP_RANGE_SEL   (1 << 19)
> > +#defineAMDTEMP_17H_CUR_TMP_RANGE_OFF   490
> >  
> >  /*
> >   * Thermaltrip Status Register (Family 0Fh only)
> > @@ -595,13 +602,15 @@ static int32_t
> >  amdtemp_gettemp17h(device_t dev, amdsensor_t sensor)
> >  {
> >     struct amdtemp_softc *sc = device_get_softc(dev);
> > -   uint32_t temp;
> > +   uint32_t temp, val;
> >     int error;
> >  
> > -   error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP,
> > );
> > +   error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP,
> > );
> >     KASSERT(error == 0, ("amdsmn_read"));
> >  
> > -   temp = ((temp >> 21) & 0x7ff) * 5 / 4;
> > +   temp = ((val >> 21) & 0x7ff) * 5 / 4;
> > +   if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0)
> > +   temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF;
> >     temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10;
> >  
> >     return (temp);
> > 
> > 
___
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: r340426 - head/sys/dev/amdtemp

2018-11-14 Thread Gary Jennejohn
On Wed, 14 Nov 2018 08:33:28 -0800 (PST)
"Rodney W. Grimes"  wrote:

> > Author: cem
> > Date: Wed Nov 14 04:50:29 2018
> > New Revision: 340426
> > URL: https://svnweb.freebsd.org/changeset/base/340426
> > 
> > Log:
> >   amdtemp(4): Fix temperature reporting on AMD 2990WX
> >   
> >   Update the AMD family 17h temperature reporting based on AMD Tech Doc 
> > 56255
> >   OSRR, section 4.2.1.
> >   
> >   For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
> >   range -49..206; i.e., subtract 49?C.
> >   
> >   Submitted by: gallatin@
> >   Reported by:  bcran@
> >   Reviewed by:  me (long ago)  
> 
> As per recent discussion on @developers, me@ is actually a valid
> committers name and should not be used to describe one self in
> commit messages.
> 

Actually, me@ (Michael Elbel) was never a committer.  He worked
with Jordan (jkh@) and myself (gj@) in Germany and Jordan gave
him a login on freefall in the very early FreeBSD days.

But, it might be less confusing to use myself rather than me in
log messages.

-- 
Gary Jennejohn
___
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: r340443 - head/sys/kern

2018-11-14 Thread Gleb Smirnoff
Author: glebius
Date: Wed Nov 14 19:10:35 2018
New Revision: 340443
URL: https://svnweb.freebsd.org/changeset/base/340443

Log:
  Initialize compatibility epoch tracker for thread0. Fixes
  panics for drivers that call if_maddr_lock() during startup.
  
  Reported by:  cy

Modified:
  head/sys/kern/init_main.c

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Wed Nov 14 19:06:43 2018(r340442)
+++ head/sys/kern/init_main.c   Wed Nov 14 19:10:35 2018(r340443)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -510,6 +511,7 @@ proc0_init(void *dummy __unused)
td->td_pflags = TDP_KTHREAD;
td->td_cpuset = cpuset_thread0();
td->td_domain.dr_policy = td->td_cpuset->cs_domain;
+   epoch_thread_init(td);
prison0_init();
p->p_peers = 0;
p->p_leader = p;
___
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: r340442 - head/usr.sbin/mountd

2018-11-14 Thread Sean Eric Fagan
Author: sef
Date: Wed Nov 14 19:06:43 2018
New Revision: 340442
URL: https://svnweb.freebsd.org/changeset/base/340442

Log:
  mountd has no way to configure the listen queue depth; rather than add a new
  option, we pass -1 down to listen, which causes it to use the
  kern.ipc.soacceptqueue sysctl.
  
  Approved by:  mav
  MFC after:2 weeks
  Sponsored by: iXsystems Inc

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

Modified: head/usr.sbin/mountd/mountd.c
==
--- head/usr.sbin/mountd/mountd.c   Wed Nov 14 18:45:33 2018
(r340441)
+++ head/usr.sbin/mountd/mountd.c   Wed Nov 14 19:06:43 2018
(r340442)
@@ -908,8 +908,12 @@ complete_service(struct netconfig *nconf, char *port_s
if (fd < 0)
continue;
 
+   /*
+* Using -1 tells listen(2) to use
+* kern.ipc.soacceptqueue for the backlog.
+*/
if (nconf->nc_semantics != NC_TPI_CLTS)
-   listen(fd, SOMAXCONN);
+   listen(fd, -1);
 
if (nconf->nc_semantics == NC_TPI_CLTS )
transp = svc_dg_create(fd, 0, 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: r340441 - head/sys/x86/x86

2018-11-14 Thread John Baldwin
Author: jhb
Date: Wed Nov 14 18:45:33 2018
New Revision: 340441
URL: https://svnweb.freebsd.org/changeset/base/340441

Log:
  Revert r332735 and fix MSI-X to properly fail allocations when full.
  
  The off-by-one errors in 332735 weren't actual errors and were
  preventing the last MSI interrupt source from being used.  Instead,
  the issue is that when all MSI interrupt sources were allocated, the
  loop in msix_alloc() would terminate with 'msi' still set to non-null.
  The only check for 'i' overflowing was in the 'msi' == NULL case, so
  msix_alloc() would try to reuse the last MSI interrupt source instead
  of failing.
  
  Fix by moving the check for all sources being in use to just after the
  loop.
  
  Reviewed by:  kib, markj
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D17976

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

Modified: head/sys/x86/x86/msi.c
==
--- head/sys/x86/x86/msi.c  Wed Nov 14 18:38:27 2018(r340440)
+++ head/sys/x86/x86/msi.c  Wed Nov 14 18:45:33 2018(r340441)
@@ -409,7 +409,7 @@ again:
/* Do we need to create some new sources? */
if (cnt < count) {
/* If we would exceed the max, give up. */
-   if (i + (count - cnt) >= first_msi_irq + NUM_MSI_INTS) {
+   if (i + (count - cnt) > first_msi_irq + NUM_MSI_INTS) {
mtx_unlock(_lock);
free(mirqs, M_MSI);
return (ENXIO);
@@ -647,13 +647,14 @@ again:
break;
}
 
+   /* Are all IRQs in use? */
+   if (i == first_msi_irq + NUM_MSI_INTS) {
+   mtx_unlock(_lock);
+   return (ENXIO);
+   }
+
/* Do we need to create a new source? */
if (msi == NULL) {
-   /* If we would exceed the max, give up. */
-   if (i + 1 >= first_msi_irq + NUM_MSI_INTS) {
-   mtx_unlock(_lock);
-   return (ENXIO);
-   }
mtx_unlock(_lock);
 
/* Create a new source. */
___
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: r340439 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread Renato Botelho
On 14/11/18 16:23, Eugene Grosbein wrote:
> 15.11.2018 1:12, Renato Botelho wrote:
> 
 Modified: head/usr.sbin/ntp/ntpd/Makefile
 ==
 --- head/usr.sbin/ntp/ntpd/MakefileWed Nov 14 16:18:13 2018
 (r340438)
 +++ head/usr.sbin/ntp/ntpd/MakefileWed Nov 14 16:19:15 2018
 (r340439)
 @@ -7,9 +7,12 @@ MAN=
  .PATH:${SRCTOP}/contrib/ntp/ntpd \
${.OBJDIR}
  
 +DIRS= ETC_NTP
 +ETC_NTP=  /etc/ntp
 +ETN_NTP_MODE= 0700
>>>
>>> s/ETN/ETC/?
>>
>> Yes, I need to commit a fix. Do I need to request a new approval from a
>> src committer?
>>
>> Index: ntpd/Makefile
>> ===
>> --- ntpd/Makefile(revision 340439)
>> +++ ntpd/Makefile(working copy)
>> @@ -9,7 +9,7 @@
>>
>>  DIRS=   ETC_NTP
>>  ETC_NTP=/etc/ntp
>> -ETN_NTP_MODE=   0700
>> +ETC_NTP_MODE=   0700
>>  CONFS=  ntp.conf
>>  FILES=  leap-seconds
>>  FILESDIR=   ETC_NTP
>>
> 
> Yes, you need. Approved.

Fixed in 340440. Thanks!

-- 
Renato Botelho
___
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: r340440 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread Renato Botelho
Author: garga (ports committer)
Date: Wed Nov 14 18:38:27 2018
New Revision: 340440
URL: https://svnweb.freebsd.org/changeset/base/340440

Log:
  Fix typo introduced in r340439 - s/ETN/ETC/
  
  Reported by:  jhb, yuripv
  Approved by:  eugen
  MFC after:3 days
  X-MFC-With:   340439
  Sponsored by: Rubicon Communications, LLC (Netgate)

Modified:
  head/usr.sbin/ntp/ntpd/Makefile

Modified: head/usr.sbin/ntp/ntpd/Makefile
==
--- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018
(r340439)
+++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 18:38:27 2018
(r340440)
@@ -9,7 +9,7 @@ MAN=
 
 DIRS=  ETC_NTP
 ETC_NTP=   /etc/ntp
-ETN_NTP_MODE=  0700
+ETC_NTP_MODE=  0700
 CONFS= ntp.conf
 FILES= leap-seconds
 FILESDIR=  ETC_NTP
___
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: r340426 - head/sys/dev/amdtemp

2018-11-14 Thread John Baldwin
On 11/14/18 8:33 AM, Rodney W. Grimes wrote:
>>   MFC after: 22.57 seconds
>>   Relnotes:  yea
> 
> I do not believe the relnotes processor understands slang.

This is quite possibly a typo ('a' and 's' are adjacent keys in QWERTY).
However, no one uses 'Relnotes: no', so it seems like you should probably
just match on '^Relnotes:' and ignore the value.

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


Re: svn commit: r340439 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread Eugene Grosbein
15.11.2018 1:12, Renato Botelho wrote:

>>> Modified: head/usr.sbin/ntp/ntpd/Makefile
>>> ==
>>> --- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018
>>> (r340438)
>>> +++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018
>>> (r340439)
>>> @@ -7,9 +7,12 @@ MAN=
>>>  .PATH: ${SRCTOP}/contrib/ntp/ntpd \
>>> ${.OBJDIR}
>>>  
>>> +DIRS=  ETC_NTP
>>> +ETC_NTP=   /etc/ntp
>>> +ETN_NTP_MODE=  0700
>>
>> s/ETN/ETC/?
> 
> Yes, I need to commit a fix. Do I need to request a new approval from a
> src committer?
> 
> Index: ntpd/Makefile
> ===
> --- ntpd/Makefile (revision 340439)
> +++ ntpd/Makefile (working copy)
> @@ -9,7 +9,7 @@
> 
>  DIRS=ETC_NTP
>  ETC_NTP= /etc/ntp
> -ETN_NTP_MODE=0700
> +ETC_NTP_MODE=0700
>  CONFS=   ntp.conf
>  FILES=   leap-seconds
>  FILESDIR=ETC_NTP
> 

Yes, you need. Approved.

___
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: r340439 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread Renato Botelho
On 14/11/18 14:33, John Baldwin wrote:
> On 11/14/18 8:19 AM, Renato Botelho wrote:
>> Author: garga (ports committer)
>> Date: Wed Nov 14 16:19:15 2018
>> New Revision: 340439
>> URL: https://svnweb.freebsd.org/changeset/base/340439
>>
>> Log:
>>   Fix /etc/ntp permissions. According to mtree it must be 0700
>>   
>>   Reviewed by:   imp
>>   Approved by:   imp
>>   MFC after: 3 days
>>   Sponsored by:  Rubicon Communications, LLC (Netgate)
>>   Differential Revision: https://reviews.freebsd.org/D17973
>>
>> Modified:
>>   head/usr.sbin/ntp/ntpd/Makefile
>>
>> Modified: head/usr.sbin/ntp/ntpd/Makefile
>> ==
>> --- head/usr.sbin/ntp/ntpd/Makefile  Wed Nov 14 16:18:13 2018
>> (r340438)
>> +++ head/usr.sbin/ntp/ntpd/Makefile  Wed Nov 14 16:19:15 2018
>> (r340439)
>> @@ -7,9 +7,12 @@ MAN=
>>  .PATH:  ${SRCTOP}/contrib/ntp/ntpd \
>>  ${.OBJDIR}
>>  
>> +DIRS=   ETC_NTP
>> +ETC_NTP=/etc/ntp
>> +ETN_NTP_MODE=   0700
> 
> s/ETN/ETC/?

Yes, I need to commit a fix. Do I need to request a new approval from a
src committer?

Index: ntpd/Makefile
===
--- ntpd/Makefile   (revision 340439)
+++ ntpd/Makefile   (working copy)
@@ -9,7 +9,7 @@

 DIRS=  ETC_NTP
 ETC_NTP=   /etc/ntp
-ETN_NTP_MODE=  0700
+ETC_NTP_MODE=  0700
 CONFS= ntp.conf
 FILES= leap-seconds
 FILESDIR=  ETC_NTP

-- 
Renato Botelho
___
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: r340426 - head/sys/dev/amdtemp

2018-11-14 Thread Rodney W. Grimes
> Author: cem
> Date: Wed Nov 14 04:50:29 2018
> New Revision: 340426
> URL: https://svnweb.freebsd.org/changeset/base/340426
> 
> Log:
>   amdtemp(4): Fix temperature reporting on AMD 2990WX
>   
>   Update the AMD family 17h temperature reporting based on AMD Tech Doc 56255
>   OSRR, section 4.2.1.
>   
>   For CPUS w/CUR_TEMP_RANGE_SEL set, scale the reported temperature into the
>   range -49..206; i.e., subtract 49?C.
>   
>   Submitted by:   gallatin@
>   Reported by:bcran@
>   Reviewed by:me (long ago)

As per recent discussion on @developers, me@ is actually a valid
committers name and should not be used to describe one self in
commit messages.

>   MFC after:  22.57 seconds
>   Relnotes:   yea

I do not believe the relnotes processor understands slang.

>   Differential Revision:  https://reviews.freebsd.org/D16855
> 
> Modified:
>   head/sys/dev/amdtemp/amdtemp.c
> 
> Modified: head/sys/dev/amdtemp/amdtemp.c
> ==
> --- head/sys/dev/amdtemp/amdtemp.cWed Nov 14 03:42:39 2018
> (r340425)
> +++ head/sys/dev/amdtemp/amdtemp.cWed Nov 14 04:50:29 2018
> (r340426)
> @@ -115,8 +115,15 @@ static struct amdtemp_product {
>  
>  /*
>   * Reported Temperature, Family 17h
> + *
> + * According to AMD OSRR for 17H, section 4.2.1, bits 31-21 of this register
> + * provide the current temp.  bit 19, when clear, means the temp is reported 
> in
> + * a range 0.."225C" (probable typo for 255C), and when set changes the range
> + * to -49..206C.
>   */
> -#define  AMDTEMP_17H_CUR_TMP 0x59800
> +#define  AMDTEMP_17H_CUR_TMP 0x59800
> +#define  AMDTEMP_17H_CUR_TMP_RANGE_SEL   (1 << 19)
> +#define  AMDTEMP_17H_CUR_TMP_RANGE_OFF   490
>  
>  /*
>   * Thermaltrip Status Register (Family 0Fh only)
> @@ -595,13 +602,15 @@ static int32_t
>  amdtemp_gettemp17h(device_t dev, amdsensor_t sensor)
>  {
>   struct amdtemp_softc *sc = device_get_softc(dev);
> - uint32_t temp;
> + uint32_t temp, val;
>   int error;
>  
> - error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, );
> + error = amdsmn_read(sc->sc_smn, AMDTEMP_17H_CUR_TMP, );
>   KASSERT(error == 0, ("amdsmn_read"));
>  
> - temp = ((temp >> 21) & 0x7ff) * 5 / 4;
> + temp = ((val >> 21) & 0x7ff) * 5 / 4;
> + if ((val & AMDTEMP_17H_CUR_TMP_RANGE_SEL) != 0)
> + temp -= AMDTEMP_17H_CUR_TMP_RANGE_OFF;
>   temp += AMDTEMP_ZERO_C_TO_K + sc->sc_offset * 10;
>  
>   return (temp);
> 
> 

-- 
Rod Grimes rgri...@freebsd.org
___
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: r340439 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread John Baldwin
On 11/14/18 8:19 AM, Renato Botelho wrote:
> Author: garga (ports committer)
> Date: Wed Nov 14 16:19:15 2018
> New Revision: 340439
> URL: https://svnweb.freebsd.org/changeset/base/340439
> 
> Log:
>   Fix /etc/ntp permissions. According to mtree it must be 0700
>   
>   Reviewed by:imp
>   Approved by:imp
>   MFC after:  3 days
>   Sponsored by:   Rubicon Communications, LLC (Netgate)
>   Differential Revision:  https://reviews.freebsd.org/D17973
> 
> Modified:
>   head/usr.sbin/ntp/ntpd/Makefile
> 
> Modified: head/usr.sbin/ntp/ntpd/Makefile
> ==
> --- head/usr.sbin/ntp/ntpd/Makefile   Wed Nov 14 16:18:13 2018
> (r340438)
> +++ head/usr.sbin/ntp/ntpd/Makefile   Wed Nov 14 16:19:15 2018
> (r340439)
> @@ -7,9 +7,12 @@ MAN=
>  .PATH:   ${SRCTOP}/contrib/ntp/ntpd \
>   ${.OBJDIR}
>  
> +DIRS=ETC_NTP
> +ETC_NTP= /etc/ntp
> +ETN_NTP_MODE=0700

s/ETN/ETC/?

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


Re: svn commit: r340413 - in head/sys: kern net sys

2018-11-14 Thread Gleb Smirnoff
On Wed, Nov 14, 2018 at 11:06:38AM +0100, Hans Petter Selasky wrote:
H> On 11/14/18 10:33 AM, Cy Schubert wrote:
H> > +  epoch_thread_init(td);
H> 
H> Did you forget to call epoch_thread_init() for thread0 ?

Yes, this is my guess. I'm preparing patch for Cy to test.

-- 
Gleb Smirnoff
___
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: r340439 - head/usr.sbin/ntp/ntpd

2018-11-14 Thread Renato Botelho
Author: garga (ports committer)
Date: Wed Nov 14 16:19:15 2018
New Revision: 340439
URL: https://svnweb.freebsd.org/changeset/base/340439

Log:
  Fix /etc/ntp permissions. According to mtree it must be 0700
  
  Reviewed by:  imp
  Approved by:  imp
  MFC after:3 days
  Sponsored by: Rubicon Communications, LLC (Netgate)
  Differential Revision:https://reviews.freebsd.org/D17973

Modified:
  head/usr.sbin/ntp/ntpd/Makefile

Modified: head/usr.sbin/ntp/ntpd/Makefile
==
--- head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:18:13 2018
(r340438)
+++ head/usr.sbin/ntp/ntpd/Makefile Wed Nov 14 16:19:15 2018
(r340439)
@@ -7,9 +7,12 @@ MAN=
 .PATH: ${SRCTOP}/contrib/ntp/ntpd \
${.OBJDIR}
 
+DIRS=  ETC_NTP
+ETC_NTP=   /etc/ntp
+ETN_NTP_MODE=  0700
 CONFS= ntp.conf
 FILES= leap-seconds
-FILESDIR=  /etc/ntp
+FILESDIR=  ETC_NTP
 FILESMODE= 644
 PROG=  ntpd
 
___
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: r340438 - head/share/man/man4

2018-11-14 Thread Mark Johnston
Author: markj
Date: Wed Nov 14 16:18:13 2018
New Revision: 340438
URL: https://svnweb.freebsd.org/changeset/base/340438

Log:
  Hook mac_ntpd.4 up to the build.
  
  PR:   232757
  Submitted by: Yasuhiro KIMURA 
  MFC after:3 days

Modified:
  head/share/man/man4/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileWed Nov 14 16:15:36 2018
(r340437)
+++ head/share/man/man4/MakefileWed Nov 14 16:18:13 2018
(r340438)
@@ -264,6 +264,7 @@ MAN=aac.4 \
mac_lomac.4 \
mac_mls.4 \
mac_none.4 \
+   mac_ntpd.4 \
mac_partition.4 \
mac_portacl.4 \
mac_seeotheruids.4 \
___
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: r340437 - head

2018-11-14 Thread Mark Johnston
Author: markj
Date: Wed Nov 14 16:15:36 2018
New Revision: 340437
URL: https://svnweb.freebsd.org/changeset/base/340437

Log:
  Fix the path to malloc_domain.9.
  
  Reported by:  yuripv
  MFC after:3 days
  Sponsored by: The FreeBSD Foundation

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Nov 14 15:39:48 2018(r340436)
+++ head/ObsoleteFiles.inc  Wed Nov 14 16:15:36 2018(r340437)
@@ -42,7 +42,7 @@
 OLD_LIBS+=lib/casper/libcap_dns.so.1
 OLD_LIBS+=usr/lib32/libcap_dns.so.1
 # 20181030: malloc_domain(9) KPI change
-OLD_FILES+=share/man/man9/malloc_domain.9.gz
+OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz
 # 20181026: joy(4) removal
 OLD_FILES+=usr/share/man/man4/joy.4.gz
 # 20181025: OpenSSL libraries version bump to avoid conflict with ports
___
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: r340436 - in head/sys/dev: netmap virtio/network

2018-11-14 Thread Vincenzo Maffione
Author: vmaffione
Date: Wed Nov 14 15:39:48 2018
New Revision: 340436
URL: https://svnweb.freebsd.org/changeset/base/340436

Log:
  vtnet: fix netmap support
  
  netmap(4) support for vtnet(4) was incomplete and had multiple bugs.
  This commit fixes those bugs to bring netmap on vtnet in a functional state.
  
  Changelist:
- handle errors returned by virtqueue_enqueue() properly (they were
  previously ignored)
- make sure netmap XOR rest of the kernel access each virtqueue.
- compute the number of netmap slots for TX and RX separately, according to
  whether indirect descriptors are used or not for a given virtqueue.
- make sure sglist are freed according to their type (mbufs or netmap
  buffers)
- add support for mulitiqueue and netmap host (aka sw) rings.
- intercept VQ interrupts directly instead of intercepting them in txq_eof
  and rxq_eof. This simplifies the code and makes it easier to make sure
  taskqueues are not running for a VQ while it is in netmap mode.
- implement vntet_netmap_config() to cope with changes in the number of 
queues.
  
  Reviewed by:  bryanv
  Approved by:  gnn (mentor)
  MFC after:3 days
  Sponsored by: Sunny Valley Networks
  Differential Revision:https://reviews.freebsd.org/D17916

Modified:
  head/sys/dev/netmap/if_vtnet_netmap.h
  head/sys/dev/virtio/network/if_vtnet.c
  head/sys/dev/virtio/network/if_vtnetvar.h

Modified: head/sys/dev/netmap/if_vtnet_netmap.h
==
--- head/sys/dev/netmap/if_vtnet_netmap.h   Wed Nov 14 15:23:39 2018
(r340435)
+++ head/sys/dev/netmap/if_vtnet_netmap.h   Wed Nov 14 15:39:48 2018
(r340436)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Vincenzo Maffione, Luigi Rizzo. All rights reserved.
+ * Copyright (C) 2014-2018 Vincenzo Maffione, Luigi Rizzo.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,74 +33,148 @@
 #include /* vtophys ? */
 #include 
 
+/*
+ * Return 1 if the queue identified by 't' and 'idx' is in netmap mode.
+ */
+static int
+vtnet_netmap_queue_on(struct vtnet_softc *sc, enum txrx t, int idx)
+{
+   struct netmap_adapter *na = NA(sc->vtnet_ifp);
 
-#define SOFTC_Tvtnet_softc
+   if (!nm_native_on(na))
+   return 0;
 
-/* Free all the unused buffer in all the RX virtqueues.
- * This function is called when entering and exiting netmap mode.
- * - buffers queued by the virtio driver return skbuf/mbuf pointer
- *   and need to be freed;
- * - buffers queued by netmap return the txq/rxq, and do not need work
- */
+   if (t == NR_RX)
+   return !!(idx < na->num_rx_rings &&
+   na->rx_rings[idx]->nr_mode == NKR_NETMAP_ON);
+
+   return !!(idx < na->num_tx_rings &&
+   na->tx_rings[idx]->nr_mode == NKR_NETMAP_ON);
+}
+
 static void
-vtnet_netmap_free_bufs(struct SOFTC_T* sc)
+vtnet_free_used(struct virtqueue *vq, int netmap_bufs, enum txrx t, int idx)
 {
-   int i, nmb = 0, n = 0, last;
+   void *cookie;
+   int deq = 0;
 
-   for (i = 0; i < sc->vtnet_max_vq_pairs; i++) {
-   struct vtnet_rxq *rxq = >vtnet_rxqs[i];
-   struct virtqueue *vq;
-   struct mbuf *m;
-   struct vtnet_txq *txq = >vtnet_txqs[i];
-struct vtnet_tx_header *txhdr;
+   while ((cookie = virtqueue_dequeue(vq, NULL)) != NULL) {
+   if (netmap_bufs) {
+   /* These are netmap buffers: there is nothing to do. */
+   } else {
+   /* These are mbufs that we need to free. */
+   struct mbuf *m;
 
-   last = 0;
-   vq = rxq->vtnrx_vq;
-   while ((m = virtqueue_drain(vq, )) != NULL) {
-   n++;
-   if (m != (void *)rxq)
+   if (t == NR_TX) {
+   struct vtnet_tx_header *txhdr = cookie;
+   m = txhdr->vth_mbuf;
m_freem(m);
-   else
-   nmb++;
-   }
-
-   last = 0;
-   vq = txq->vtntx_vq;
-   while ((txhdr = virtqueue_drain(vq, )) != NULL) {
-   n++;
-   if (txhdr != (void *)txq) {
-   m_freem(txhdr->vth_mbuf);
uma_zfree(vtnet_tx_header_zone, txhdr);
-   } else
-   nmb++;
+   } else {
+   m = cookie;
+   m_freem(m);
+   }
}
+   deq++;
}
-   D("freed %d mbufs, %d netmap bufs on %d queues",
-   n - nmb, nmb, 

Re: svn commit: r340413 - in head/sys: kern net sys

2018-11-14 Thread Cy Schubert
In message <178c3d69-4a3b-49cb-dab4-f6f4139df...@selasky.org>, Hans 
Petter Sela
sky writes:
> On 11/14/18 10:33 AM, Cy Schubert wrote:
> > +   epoch_thread_init(td);
>
> Did you forget to call epoch_thread_init() for thread0 ?
>
> --HPS

It appears that interfaces that call if_maddr_rlock(ifp) have the 
issue. This suggests epoch_thread_init() for thread0 hasn't been called 
yet when interfaces (specifically those that call if_maddr_rlock()) 
attach.



-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.



___
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: r340435 - head/sys/net

2018-11-14 Thread Stephen Hurd
Author: shurd
Date: Wed Nov 14 15:23:39 2018
New Revision: 340435
URL: https://svnweb.freebsd.org/changeset/base/340435

Log:
  Prevent POLA violation with TSO/CSUM offload
  
  Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding
  CSUM_IP6?_TCP / CSUM_IP flags are also set.
  
  Rather than requireing drivers to bake-in an understanding that TSO implies
  checksum offloads, make it explicit.
  
  This change requires us to move the IFLIB_NEED_ZERO_CSUM implementation to
  ensure it's zeroed for TSO.
  
  Reported by:  Jacob Keller 
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D17801

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Nov 14 15:16:45 2018(r340434)
+++ head/sys/net/iflib.cWed Nov 14 15:23:39 2018(r340435)
@@ -2973,9 +2973,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, 
pi->ipi_ipproto = ip->ip_p;
pi->ipi_flags |= IPI_TX_IPV4;
 
-   if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && 
(pi->ipi_csum_flags & CSUM_IP))
-   ip->ip_sum = 0;
-
/* TCP checksum offload may require TCP header length */
if (IS_TX_OFFLOAD4(pi)) {
if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) {
@@ -2992,6 +2989,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, 
if (IS_TSO4(pi)) {
if (__predict_false(ip->ip_p != IPPROTO_TCP))
return (ENXIO);
+   /*
+* TSO always requires hardware checksum 
offload.
+*/
+   pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP);
th->th_sum = in_pseudo(ip->ip_src.s_addr,
   ip->ip_dst.s_addr, 
htons(IPPROTO_TCP));
pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz;
@@ -3001,6 +3002,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, 
}
}
}
+   if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && 
(pi->ipi_csum_flags & CSUM_IP))
+   ip->ip_sum = 0;
+
break;
}
 #endif
@@ -3038,9 +3042,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, 
if (__predict_false(ip6->ip6_nxt != 
IPPROTO_TCP))
return (ENXIO);
/*
-* The corresponding flag is set by the stack 
in the IPv4
-* TSO case, but not in IPv6 (at least in 
FreeBSD 10.2).
-* So, set it here because the rest of the flow 
requires it.
+* TSO always requires hardware checksum 
offload.
 */
pi->ipi_csum_flags |= CSUM_IP6_TCP;
th->th_sum = in6_cksum_pseudo(ip6, 0, 
IPPROTO_TCP, 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: r340434 - head/sys/net

2018-11-14 Thread Stephen Hurd
Author: shurd
Date: Wed Nov 14 15:16:45 2018
New Revision: 340434
URL: https://svnweb.freebsd.org/changeset/base/340434

Log:
  Fix leaks caused by ifc_nhwtxqs never being initialized
  
  r333502 removed initialization of ifc_nhwtxqs, and it's not clear
  there's a need to copy it into the struct iflib_ctx at all. Use
  ctx->ifc_sctx->isc_ntxqs instead.
  
  Further, iflib_stop() did not clear the last ring in the case where
  isc_nfl != isc_nrxqs (such as when IFLIB_HAS_RXCQ is set). Use
  ctx->ifc_sctx->isc_nrxqs here instead of isc_nfl.
  
  Reported by:  pkelsey
  Reviewed by:  pkelsey
  MFC after:3 days
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D17979

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Nov 14 15:15:07 2018(r340433)
+++ head/sys/net/iflib.cWed Nov 14 15:16:45 2018(r340434)
@@ -175,8 +175,6 @@ struct iflib_ctx {
struct sx ifc_ctx_sx;
struct mtx ifc_state_mtx;
 
-   uint16_t ifc_nhwtxqs;
-
iflib_txq_t ifc_txqs;
iflib_rxq_t ifc_rxqs;
uint32_t ifc_if_flags;
@@ -1771,6 +1769,7 @@ iflib_txq_setup(iflib_txq_t txq)
 {
if_ctx_t ctx = txq->ift_ctx;
if_softc_ctx_t scctx = >ifc_softc_ctx;
+   if_shared_ctx_t sctx = ctx->ifc_sctx;
iflib_dma_info_t di;
int i;
 
@@ -1784,11 +1783,11 @@ iflib_txq_setup(iflib_txq_t txq)
txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0;
txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset];
 
-   for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++)
+   for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++)
bzero((void *)di->idi_vaddr, di->idi_size);
 
IFDI_TXQ_SETUP(ctx, txq->ift_id);
-   for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++)
+   for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++)
bus_dmamap_sync(di->idi_tag, di->idi_map,
BUS_DMASYNC_PREREAD | 
BUS_DMASYNC_PREWRITE);
return (0);
@@ -2375,6 +2374,7 @@ iflib_stop(if_ctx_t ctx)
iflib_txq_t txq = ctx->ifc_txqs;
iflib_rxq_t rxq = ctx->ifc_rxqs;
if_softc_ctx_t scctx = >ifc_softc_ctx;
+   if_shared_ctx_t sctx = ctx->ifc_sctx;
iflib_dma_info_t di;
iflib_fl_t fl;
int i, j;
@@ -2408,13 +2408,13 @@ iflib_stop(if_ctx_t ctx)
txq->ift_no_tx_dma_setup = txq->ift_txd_encap_efbig = 
txq->ift_map_failed = 0;
txq->ift_pullups = 0;
ifmp_ring_reset_stats(txq->ift_br);
-   for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwtxqs; j++, di++)
+   for (j = 0, di = txq->ift_ifdi; j < sctx->isc_ntxqs; j++, di++)
bzero((void *)di->idi_vaddr, di->idi_size);
}
for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) {
/* make sure all transmitters have completed before proceeding 
XXX */
 
-   for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++)
+   for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++)
bzero((void *)di->idi_vaddr, di->idi_size);
/* also resets the free lists pidx/cidx */
for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++)
@@ -5516,11 +5516,12 @@ static void
 iflib_tx_structures_free(if_ctx_t ctx)
 {
iflib_txq_t txq = ctx->ifc_txqs;
+   if_shared_ctx_t sctx = ctx->ifc_sctx;
int i, j;
 
for (i = 0; i < NTXQSETS(ctx); i++, txq++) {
iflib_txq_destroy(txq);
-   for (j = 0; j < ctx->ifc_nhwtxqs; j++)
+   for (j = 0; j < sctx->isc_ntxqs; j++)
iflib_dma_free(>ift_ifdi[j]);
}
free(ctx->ifc_txqs, M_IFLIB);
___
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: r340433 - head/contrib/smbfs/smbutil

2018-11-14 Thread Mateusz Piotrowski
Author: 0mp (ports committer)
Date: Wed Nov 14 15:15:07 2018
New Revision: 340433
URL: https://svnweb.freebsd.org/changeset/base/340433

Log:
  smbutil(1): Improve mdoc formatting.
  
  Also, make the path to the example configuration file absolute.
  
  Reviewed by:  bcr
  Approved by:  krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D17985

Modified:
  head/contrib/smbfs/smbutil/smbutil.1

Modified: head/contrib/smbfs/smbutil/smbutil.1
==
--- head/contrib/smbfs/smbutil/smbutil.1Wed Nov 14 14:26:32 2018
(r340432)
+++ head/contrib/smbfs/smbutil/smbutil.1Wed Nov 14 15:15:07 2018
(r340433)
@@ -1,5 +1,5 @@
 .\" $Id: smbutil.1,v 1.5 2002/04/16 02:48:16 bp Exp $
-.Dd November 1, 2018
+.Dd November 14, 2018
 .Dt SMBUTIL 1
 .Os
 .Sh NAME
@@ -9,7 +9,7 @@
 .Nm
 .Op Fl hv
 .Ar command
-.Op Fl Ar options
+.Op Ar options
 .Op Ar args
 .Sh DESCRIPTION
 The
@@ -50,8 +50,8 @@ Print usage information about
 List active connections and their parameters.
 .It Xo
 .Cm login
-.Op Fl Ar connection_options
-.No // Ns Ar user Ns @ Ns Ar server Ns Op / Ns Ar share
+.Op Ar connection_options
+.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share
 .Xc
 Login/attach to the specified
 .Ar server
@@ -65,13 +65,13 @@ Thus, it is possible to login only once and then
 use other SMB commands without authentication procedure and additional
 connections.
 For the description of
-.Fl Ar connection_options
+.Ar connection_options
 refer to the
 .Xr mount_smbfs 8
-manpage (all uppercase options are connection options).
+manual page (all uppercase options are connection options).
 .It Xo
 .Cm logout
-.No // Ns Ar user Ns @ Ns Ar server Ns Op / Ns Ar share
+.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share
 .Xc
 Logout/detach from the specified
 .Ar server
@@ -97,8 +97,8 @@ The NetBIOS name server can be directly specified via 
 option.
 .It Xo
 .Cm print
-.Op Fl Ar connection_options
-.No // Ns Ar user Ns @ Ns Ar server Ns / Ns Ar share
+.Op Ar connection_options
+.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server Ns Op Cm \&/ Ns Ar share
 .Ar file
 .Xc
 Send the given
@@ -107,12 +107,12 @@ to the specified queue on the remote server.
 If
 .Ar file
 is
-.Pa - ,
+.Dq Pa - ,
 then standard input will be used.
 .It Xo
 .Cm view
-.Op Fl Ar connection_options
-.No // Ns Ar user Ns @ Ns Ar server
+.Op Ar connection_options
+.Cm \&// Ns Ar user Ns Cm \&@ Ns Ar server
 .Xc
 List resources available on the specified
 .Ar server
@@ -124,7 +124,7 @@ for the user
 .It Pa ~/.nsmbrc
 Keeps description for each connection.
 See
-.Pa ./examples/dot.nsmbrc
+.Pa /usr/share/examples/smbfs/dot.nsmbrc
 for details.
 .El
 .Sh SEE ALSO
___
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: r340432 - in head/sys/arm: conf mv

2018-11-14 Thread Luiz Otavio O Souza
Author: loos
Date: Wed Nov 14 14:26:32 2018
New Revision: 340432
URL: https://svnweb.freebsd.org/changeset/base/340432

Log:
  Add the driver for the SPI controller on ARMADA38X.
  
  Tested on Clearfog (Pro) and SG-3100.
  
  Sponsored by: Rubicon Communications, LLC (Netgate)

Added:
  head/sys/arm/mv/mv_spi.c   (contents, props changed)
Modified:
  head/sys/arm/conf/ARMADA38X
  head/sys/arm/conf/GENERIC
  head/sys/arm/mv/files.arm7

Modified: head/sys/arm/conf/ARMADA38X
==
--- head/sys/arm/conf/ARMADA38X Wed Nov 14 14:18:35 2018(r340431)
+++ head/sys/arm/conf/ARMADA38X Wed Nov 14 14:26:32 2018(r340432)
@@ -76,6 +76,11 @@ device   iic
 device iicbus
 device twsi
 
+# SPI
+device spibus
+device spigen
+device mv_spi
+
 # Wireless NIC cards
 device wlan# 802.11 support
 device ath # Atheros NIC's

Modified: head/sys/arm/conf/GENERIC
==
--- head/sys/arm/conf/GENERIC   Wed Nov 14 14:18:35 2018(r340431)
+++ head/sys/arm/conf/GENERIC   Wed Nov 14 14:26:32 2018(r340432)
@@ -169,6 +169,7 @@ device  aw_cir
 device spibus
 device spigen
 device bcm2835_spi
+device mv_spi
 device ti_spi
 
 # ADC support

Modified: head/sys/arm/mv/files.arm7
==
--- head/sys/arm/mv/files.arm7  Wed Nov 14 14:18:35 2018(r340431)
+++ head/sys/arm/mv/files.arm7  Wed Nov 14 14:26:32 2018(r340432)
@@ -18,6 +18,7 @@ arm/mv/armada38x/armada38x_mp.c   optionalsmp
 arm/mv/armada38x/pmsu.cstandard
 arm/mv/armada38x/armada38x_rtc.c   standard
 arm/mv/armada38x/armada38x_pl310.c optional pl310
+arm/mv/mv_spi.coptionalmv_spi spibus
 dev/sdhci/sdhci_fdt.c  optionalsdhci
 
 arm/mv/rtc.c   standard

Added: head/sys/arm/mv/mv_spi.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm/mv/mv_spi.cWed Nov 14 14:26:32 2018(r340432)
@@ -0,0 +1,351 @@
+/*-
+ * Copyright (c) 2017-2018, Rubicon Communications, LLC (Netgate)
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include "spibus_if.h"
+
+struct mv_spi_softc {
+   device_tsc_dev;
+   struct mtx  sc_mtx;
+   struct resource *sc_mem_res;
+   struct resource *sc_irq_res;
+   struct spi_command  *sc_cmd;
+   bus_space_tag_t sc_bst;
+   bus_space_handle_t  sc_bsh;
+   uint32_tsc_len;
+   uint32_tsc_read;
+   uint32_tsc_flags;
+   uint32_tsc_written;
+   void*sc_intrhand;
+};
+
+#defineMV_SPI_BUSY 0x1
+#defineMV_SPI_WRITE(_sc, _off, _val)   \
+bus_space_write_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off), (_val))
+#defineMV_SPI_READ(_sc, _off)  \
+bus_space_read_4((_sc)->sc_bst, (_sc)->sc_bsh, (_off))
+#defineMV_SPI_LOCK(_sc)mtx_lock(&(_sc)->sc_mtx)
+#defineMV_SPI_UNLOCK(_sc)  mtx_unlock(&(_sc)->sc_mtx)
+
+#defineMV_SPI_CONTROL  0
+#define

svn commit: r340431 - in head: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs sys/fs...

2018-11-14 Thread Konstantin Belousov
Author: kib
Date: Wed Nov 14 14:18:35 2018
New Revision: 340431
URL: https://svnweb.freebsd.org/changeset/base/340431

Log:
  Add d_off support for multiple filesystems.
  
  The d_off field has been added to the dirent structure recently.
  Currently filesystems don't support this feature.  Support has been
  added and tested for zfs, ufs, ext2fs, fdescfs, msdosfs and unionfs.
  A stub implementation is available for cd9660, nandfs, udf and
  pseudofs but hasn't been tested.
  
  Motivation for this feature: our usecase is for a userspace nfs server
  (nfs-ganesha) with zfs.  At the moment we cache direntry offsets by
  calling lseek once per entry, with this patch we can get the offset
  directly from getdirentries(2) calls which provides a significant
  speedup.
  
  Submitted by: Jack Halford 
  Reviewed by:  mckusick, pfg, rmacklem (previous versions)
  Sponsored by: Gandi.net
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D17917

Modified:
  head/lib/libc/sys/getdirentries.2
  head/share/man/man5/dir.5
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  head/sys/fs/cd9660/cd9660_vnops.c
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/fdescfs/fdesc_vnops.c
  head/sys/fs/msdosfs/msdosfs_vnops.c
  head/sys/fs/nandfs/nandfs_vnops.c
  head/sys/fs/pseudofs/pseudofs_vnops.c
  head/sys/fs/udf/udf_vnops.c
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/lib/libc/sys/getdirentries.2
==
--- head/lib/libc/sys/getdirentries.2   Wed Nov 14 13:06:48 2018
(r340430)
+++ head/lib/libc/sys/getdirentries.2   Wed Nov 14 14:18:35 2018
(r340431)
@@ -28,7 +28,7 @@
 .\"@(#)getdirentries.2 8.2 (Berkeley) 5/3/95
 .\" $FreeBSD$
 .\"
-.Dd May 28, 2017
+.Dd Nov 14, 2018
 .Dt GETDIRENTRIES 2
 .Os
 .Sh NAME
@@ -88,6 +88,11 @@ Files that are linked by hard links (see
 have the same
 .Fa d_fileno .
 The
+.Fa d_off
+field returns a cookie which can be used with
+.Xr lseek 2
+to position the directory descriptor to the next entry.
+The
 .Fa d_reclen
 entry is the length, in bytes, of the directory record.
 The
@@ -140,8 +145,17 @@ a value returned in the location pointed to by
 .Fa basep
 .Po Fn getdirentries
 only
-.Pc
+.Pc ,
+a value returned in the
+.Fa d_off
+field,
 or zero.
+.Sh IMPLEMENTATION NOTES
+The
+.Fa d_off
+field is being used as a cookie to readdir for nfs servers.
+These cookies can be cached and allow to read directory entries at a specific
+offset on demand.
 .Sh RETURN VALUES
 If successful, the number of bytes actually transferred is returned.
 Otherwise, -1 is returned and the global variable

Modified: head/share/man/man5/dir.5
==
--- head/share/man/man5/dir.5   Wed Nov 14 13:06:48 2018(r340430)
+++ head/share/man/man5/dir.5   Wed Nov 14 14:18:35 2018(r340431)
@@ -28,7 +28,7 @@
 .\" @(#)dir.5  8.3 (Berkeley) 4/19/94
 .\" $FreeBSD$
 .\"
-.Dd June 20, 2018
+.Dd November 14, 2018
 .Dt DIR 5
 .Os
 .Sh NAME
@@ -101,7 +101,7 @@ The directory entry format is defined in the file
 
 struct dirent {
ino_t  d_fileno;/* file number of entry */
-   off_t  d_off;   /* directory offset of entry */
+   off_t  d_off;   /* directory offset of the next entry */
__uint16_t d_reclen;/* length of this record */
__uint8_t  d_type;  /* file type, see below */
__uint8_t  d_namlen;/* length of string in d_name */

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cWed Nov 
14 13:06:48 2018(r340430)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.cWed Nov 
14 14:18:35 2018(r340431)
@@ -1097,6 +1097,8 @@ zfsctl_snapdir_readdir(ap)
strcpy(entry.d_name, snapname);
entry.d_namlen = strlen(entry.d_name);
entry.d_reclen = sizeof(entry);
+   /* NOTE: d_off is the offset for the *next* entry. */
+   entry.d_off = cookie + dots_offset;
error = vfs_read_dirent(ap, , uio->uio_offset);
if (error != 0) {
if (error == ENAMETOOLONG)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 
14 13:06:48 2018(r340430)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 
14 14:18:35 2018(r340431)
@@ -2529,8 +2529,8 @@ zfs_readdir(vnode_t 

svn commit: r340430 - head/contrib/jemalloc/src

2018-11-14 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Nov 14 13:06:48 2018
New Revision: 340430
URL: https://svnweb.freebsd.org/changeset/base/340430

Log:
  Pick 57553c3b1a5592dc4c03f3c6831d9b794e523865 from upstream:
  
  Avoid touching all pages in extent_recycle for debug build.
  
  We may have a large number of pages with *zero set (since they are 
populated on
  demand).  Only check the first page to avoid paging in all of them.
  
  This makes it easy to compare performance with and without 'retain:true'.
  
  Discussed with:   jasone
  Obtained from:Qi Wang 
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/contrib/jemalloc/src/extent.c

Modified: head/contrib/jemalloc/src/extent.c
==
--- head/contrib/jemalloc/src/extent.c  Wed Nov 14 09:06:15 2018
(r340429)
+++ head/contrib/jemalloc/src/extent.c  Wed Nov 14 13:06:48 2018
(r340430)
@@ -1113,14 +1113,15 @@ extent_recycle(tsdn_t *tsdn, arena_t *arena, extent_ho
 
if (*zero) {
void *addr = extent_base_get(extent);
-   size_t size = extent_size_get(extent);
if (!extent_zeroed_get(extent)) {
+   size_t size = extent_size_get(extent);
if (pages_purge_forced(addr, size)) {
memset(addr, 0, size);
}
} else if (config_debug) {
size_t *p = (size_t *)(uintptr_t)addr;
-   for (size_t i = 0; i < size / sizeof(size_t); i++) {
+   /* Check the first page only. */
+   for (size_t i = 0; i < PAGE / sizeof(size_t); i++) {
assert(p[i] == 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: r340413 - in head/sys: kern net sys

2018-11-14 Thread Hans Petter Selasky

On 11/14/18 10:33 AM, Cy Schubert wrote:

+   epoch_thread_init(td);


Did you forget to call epoch_thread_init() for thread0 ?

--HPS
___
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: r340413 - in head/sys: kern net sys

2018-11-14 Thread Cy Schubert
Sorry. This should have been a private email. But now that it's in the 
wild, if_sk.c calls epoch_enter_preempt() at line 84 which causes panic 
early in boot.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


In message <201811140933.wae9xxsl003...@slippy.cwsent.com>, Cy Schubert 
writes:
> In message <201811132258.wadmwctl063...@repo.freebsd.org>, Gleb 
> Smirnoff writes
> :
> > Author: glebius
> > Date: Tue Nov 13 22:58:38 2018
> > New Revision: 340413
> > URL: https://svnweb.freebsd.org/changeset/base/340413
> >
> > Log:
> >   For compatibility KPI functions like if_addr_rlock() that used to have
> >   mutexes but now are converted to epoch(9) use thread-private epoch_tracke
> r.
> >   Embedding tracker into ifnet(9) or ifnet derived structures creates a non
> >   reentrable function, that will fail miserably if called simultaneously fr
> om
> >   two different contexts.
> >   A thread private tracker will provide a single tracker that would allow t
> o
> >   call these functions safely. It doesn't allow nested call, but this is no
> t
> >   expected from compatibility KPIs.
> >   
> >   Reviewed by:  markj
> >
> > Modified:
> >   head/sys/kern/kern_thread.c
> >   head/sys/kern/subr_epoch.c
> >   head/sys/net/if.c
> >   head/sys/net/if_var.h
> >   head/sys/sys/epoch.h
> >   head/sys/sys/proc.h
> >
> > Modified: head/sys/kern/kern_thread.c
> > ===
> ==
> > =
> > --- head/sys/kern/kern_thread.c Tue Nov 13 22:41:20 2018(r34041
> > 2)
> > +++ head/sys/kern/kern_thread.c Tue Nov 13 22:58:38 2018(r34041
> > 3)
> > @@ -272,6 +272,7 @@ thread_init(void *mem, int size, int flags)
> > td->td_rlqe = NULL;
> > EVENTHANDLER_DIRECT_INVOKE(thread_init, td);
> > umtx_thread_init(td);
> > +   epoch_thread_init(td);
> > td->td_kstack = 0;
> > td->td_sel = NULL;
> > return (0);
> > @@ -291,6 +292,7 @@ thread_fini(void *mem, int size)
> > turnstile_free(td->td_turnstile);
> > sleepq_free(td->td_sleepqueue);
> > umtx_thread_fini(td);
> > +   epoch_thread_fini(td);
> > seltdfini(td);
> >  }
> >  
> >
> > Modified: head/sys/kern/subr_epoch.c
> > ===
> ==
> > =
> > --- head/sys/kern/subr_epoch.c  Tue Nov 13 22:41:20 2018(r34041
> > 2)
> > +++ head/sys/kern/subr_epoch.c  Tue Nov 13 22:58:38 2018(r34041
> > 3)
> > @@ -667,3 +667,17 @@ in_epoch(epoch_t epoch)
> >  {
> > return (in_epoch_verbose(epoch, 0));
> >  }
> > +
> > +void
> > +epoch_thread_init(struct thread *td)
> > +{
> > +
> > +   td->td_et = malloc(sizeof(struct epoch_tracker), M_EPOCH, M_WAITOK);
> > +}
> > +
> > +void
> > +epoch_thread_fini(struct thread *td)
> > +{
> > +
> > +   free(td->td_et, M_EPOCH);
> > +}
> >
> > Modified: head/sys/net/if.c
> > ===
> ==
> > =
> > --- head/sys/net/if.c   Tue Nov 13 22:41:20 2018(r340412)
> > +++ head/sys/net/if.c   Tue Nov 13 22:58:38 2018(r340413)
> > @@ -1767,35 +1767,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd
> )
> >  void
> >  if_addr_rlock(struct ifnet *ifp)
> >  {
> > -   MPASS(*(uint64_t *)>if_addr_et == 0);
> > -   epoch_enter_preempt(net_epoch_preempt, >if_addr_et);
> > +
> > +   epoch_enter_preempt(net_epoch_preempt, curthread->td_et);
> >  }
> >  
> >  void
> >  if_addr_runlock(struct ifnet *ifp)
> >  {
> > -   epoch_exit_preempt(net_epoch_preempt, >if_addr_et);
> > -#ifdef INVARIANTS
> > -   bzero(>if_addr_et, sizeof(struct epoch_tracker));
> > -#endif
> > +
> > +   epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
> >  }
> >  
> >  void
> >  if_maddr_rlock(if_t ifp)
> >  {
> >  
> > -   MPASS(*(uint64_t *)>if_maddr_et == 0);
> > -   epoch_enter_preempt(net_epoch_preempt, >if_maddr_et);
> > +   epoch_enter_preempt(net_epoch_preempt, curthread->td_et);
>
>
> Hi Gleb,
>
> I was wrong. It's happening here, called from line 084 in if_sk.c.
>
> ~cy
>
> >  }
> >  
> >  void
> >  if_maddr_runlock(if_t ifp)
> >  {
> >  
> > -   epoch_exit_preempt(net_epoch_preempt, >if_maddr_et);
> > -#ifdef INVARIANTS
> > -   bzero(>if_maddr_et, sizeof(struct epoch_tracker));
> > -#endif
> > +   epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
> >  }
> >  
> >  /*
> >
> > Modified: head/sys/net/if_var.h
> > ===
> ==
> > =
> > --- head/sys/net/if_var.h   Tue Nov 13 22:41:20 2018(r340412)
> > +++ head/sys/net/if_var.h   Tue Nov 13 22:58:38 2018(r340413)
> > @@ -381,8 +381,6 @@ struct ifnet {
> >  */
> > struct netdump_methods *if_netdump_methods;
> > struct epoch_contextif_epoch_ctx;
> > -   struct epoch_trackerif_addr_et;
> > -   struct epoch_trackerif_maddr_et;
> >  
> > /*
> >  

Re: svn commit: r340413 - in head/sys: kern net sys

2018-11-14 Thread Cy Schubert
In message <201811132258.wadmwctl063...@repo.freebsd.org>, Gleb 
Smirnoff writes
:
> Author: glebius
> Date: Tue Nov 13 22:58:38 2018
> New Revision: 340413
> URL: https://svnweb.freebsd.org/changeset/base/340413
>
> Log:
>   For compatibility KPI functions like if_addr_rlock() that used to have
>   mutexes but now are converted to epoch(9) use thread-private epoch_tracker.
>   Embedding tracker into ifnet(9) or ifnet derived structures creates a non
>   reentrable function, that will fail miserably if called simultaneously from
>   two different contexts.
>   A thread private tracker will provide a single tracker that would allow to
>   call these functions safely. It doesn't allow nested call, but this is not
>   expected from compatibility KPIs.
>   
>   Reviewed by:markj
>
> Modified:
>   head/sys/kern/kern_thread.c
>   head/sys/kern/subr_epoch.c
>   head/sys/net/if.c
>   head/sys/net/if_var.h
>   head/sys/sys/epoch.h
>   head/sys/sys/proc.h
>
> Modified: head/sys/kern/kern_thread.c
> =
> =
> --- head/sys/kern/kern_thread.c   Tue Nov 13 22:41:20 2018(r34041
> 2)
> +++ head/sys/kern/kern_thread.c   Tue Nov 13 22:58:38 2018(r34041
> 3)
> @@ -272,6 +272,7 @@ thread_init(void *mem, int size, int flags)
>   td->td_rlqe = NULL;
>   EVENTHANDLER_DIRECT_INVOKE(thread_init, td);
>   umtx_thread_init(td);
> + epoch_thread_init(td);
>   td->td_kstack = 0;
>   td->td_sel = NULL;
>   return (0);
> @@ -291,6 +292,7 @@ thread_fini(void *mem, int size)
>   turnstile_free(td->td_turnstile);
>   sleepq_free(td->td_sleepqueue);
>   umtx_thread_fini(td);
> + epoch_thread_fini(td);
>   seltdfini(td);
>  }
>  
>
> Modified: head/sys/kern/subr_epoch.c
> =
> =
> --- head/sys/kern/subr_epoch.cTue Nov 13 22:41:20 2018(r34041
> 2)
> +++ head/sys/kern/subr_epoch.cTue Nov 13 22:58:38 2018(r34041
> 3)
> @@ -667,3 +667,17 @@ in_epoch(epoch_t epoch)
>  {
>   return (in_epoch_verbose(epoch, 0));
>  }
> +
> +void
> +epoch_thread_init(struct thread *td)
> +{
> +
> + td->td_et = malloc(sizeof(struct epoch_tracker), M_EPOCH, M_WAITOK);
> +}
> +
> +void
> +epoch_thread_fini(struct thread *td)
> +{
> +
> + free(td->td_et, M_EPOCH);
> +}
>
> Modified: head/sys/net/if.c
> =
> =
> --- head/sys/net/if.c Tue Nov 13 22:41:20 2018(r340412)
> +++ head/sys/net/if.c Tue Nov 13 22:58:38 2018(r340413)
> @@ -1767,35 +1767,29 @@ if_data_copy(struct ifnet *ifp, struct if_data *ifd)
>  void
>  if_addr_rlock(struct ifnet *ifp)
>  {
> - MPASS(*(uint64_t *)>if_addr_et == 0);
> - epoch_enter_preempt(net_epoch_preempt, >if_addr_et);
> +
> + epoch_enter_preempt(net_epoch_preempt, curthread->td_et);
>  }
>  
>  void
>  if_addr_runlock(struct ifnet *ifp)
>  {
> - epoch_exit_preempt(net_epoch_preempt, >if_addr_et);
> -#ifdef INVARIANTS
> - bzero(>if_addr_et, sizeof(struct epoch_tracker));
> -#endif
> +
> + epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
>  }
>  
>  void
>  if_maddr_rlock(if_t ifp)
>  {
>  
> - MPASS(*(uint64_t *)>if_maddr_et == 0);
> - epoch_enter_preempt(net_epoch_preempt, >if_maddr_et);
> + epoch_enter_preempt(net_epoch_preempt, curthread->td_et);


Hi Gleb,

I was wrong. It's happening here, called from line 084 in if_sk.c.

~cy

>  }
>  
>  void
>  if_maddr_runlock(if_t ifp)
>  {
>  
> - epoch_exit_preempt(net_epoch_preempt, >if_maddr_et);
> -#ifdef INVARIANTS
> - bzero(>if_maddr_et, sizeof(struct epoch_tracker));
> -#endif
> + epoch_exit_preempt(net_epoch_preempt, curthread->td_et);
>  }
>  
>  /*
>
> Modified: head/sys/net/if_var.h
> =
> =
> --- head/sys/net/if_var.h Tue Nov 13 22:41:20 2018(r340412)
> +++ head/sys/net/if_var.h Tue Nov 13 22:58:38 2018(r340413)
> @@ -381,8 +381,6 @@ struct ifnet {
>*/
>   struct netdump_methods *if_netdump_methods;
>   struct epoch_contextif_epoch_ctx;
> - struct epoch_trackerif_addr_et;
> - struct epoch_trackerif_maddr_et;
>  
>   /*
>* Spare fields to be added before branching a stable branch, so
>
> Modified: head/sys/sys/epoch.h
> =
> =
> --- head/sys/sys/epoch.h  Tue Nov 13 22:41:20 2018(r340412)
> +++ head/sys/sys/epoch.h  Tue Nov 13 22:58:38 2018(r340413)
> @@ -82,5 +82,8 @@ void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t
>  void epoch_enter(epoch_t epoch);
>  void epoch_exit(epoch_t epoch);
>  
> +void epoch_thread_init(struct thread *);
> +void epoch_thread_fini(struct thread *);
> +
>  #endif   /* _KERNEL */
>  #endif   /* 

svn commit: r340429 - head/lib/libc/locale

2018-11-14 Thread Yuri Pankov
Author: yuripv
Date: Wed Nov 14 09:06:15 2018
New Revision: 340429
URL: https://svnweb.freebsd.org/changeset/base/340429

Log:
  Fix WITHOUT_ICONV build after r340276.
  
  Reported by:  olivier
  Approved by:  kib (mentor, implicit)

Modified:
  head/lib/libc/locale/c16rtomb.c
  head/lib/libc/locale/c32rtomb.c
  head/lib/libc/locale/mbrtoc16.c
  head/lib/libc/locale/mbrtoc32.c

Modified: head/lib/libc/locale/c16rtomb.c
==
--- head/lib/libc/locale/c16rtomb.c Wed Nov 14 08:45:48 2018
(r340428)
+++ head/lib/libc/locale/c16rtomb.c Wed Nov 14 09:06:15 2018
(r340429)
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include "xlocale_private.h"
+#include "mblocal.h"
 
 typedef struct {
char16_tlead_surrogate;
@@ -47,7 +47,7 @@ c16rtomb_l(char * __restrict s, char16_t c16, mbstate_
 
FIX_LOCALE(locale);
if (ps == NULL)
-   ps = >c16rtomb;
+   ps = &(XLOCALE_CTYPE(locale)->c16rtomb);
cs = (_Char16State *)ps;
 
/* If s is a null pointer, the value of parameter c16 is ignored. */

Modified: head/lib/libc/locale/c32rtomb.c
==
--- head/lib/libc/locale/c32rtomb.c Wed Nov 14 08:45:48 2018
(r340428)
+++ head/lib/libc/locale/c32rtomb.c Wed Nov 14 09:06:15 2018
(r340429)
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include "xlocale_private.h"
+#include "mblocal.h"
 
 size_t
 c32rtomb_l(char * __restrict s, char32_t c32, mbstate_t * __restrict ps,
@@ -47,7 +47,7 @@ c32rtomb_l(char * __restrict s, char32_t c32, mbstate_
 
FIX_LOCALE(locale);
if (ps == NULL)
-   ps = >c32rtomb;
+   ps = &(XLOCALE_CTYPE(locale)->c32rtomb);
 
/* Assume wchar_t uses UTF-32. */
return (wcrtomb_l(s, c32, ps, locale));

Modified: head/lib/libc/locale/mbrtoc16.c
==
--- head/lib/libc/locale/mbrtoc16.c Wed Nov 14 08:45:48 2018
(r340428)
+++ head/lib/libc/locale/mbrtoc16.c Wed Nov 14 09:06:15 2018
(r340429)
@@ -30,7 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
-#include "xlocale_private.h"
+#include "mblocal.h"
 
 typedef struct {
char16_ttrail_surrogate;
@@ -47,7 +47,7 @@ mbrtoc16_l(char16_t * __restrict pc16, const char * __
 
FIX_LOCALE(locale);
if (ps == NULL)
-   ps = >mbrtoc16;
+   ps = &(XLOCALE_CTYPE(locale)->mbrtoc16);
cs = (_Char16State *)ps;
 
/*

Modified: head/lib/libc/locale/mbrtoc32.c
==
--- head/lib/libc/locale/mbrtoc32.c Wed Nov 14 08:45:48 2018
(r340428)
+++ head/lib/libc/locale/mbrtoc32.c Wed Nov 14 09:06:15 2018
(r340429)
@@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include "xlocale_private.h"
+#include "mblocal.h"
 
 size_t
 mbrtoc32_l(char32_t * __restrict pc32, const char * __restrict s, size_t n,
@@ -40,7 +40,7 @@ mbrtoc32_l(char32_t * __restrict pc32, const char * __
 
FIX_LOCALE(locale);
if (ps == NULL)
-   ps = >mbrtoc32;
+   ps = &(XLOCALE_CTYPE(locale)->mbrtoc32);
 
/* Assume wchar_t uses UTF-32. */
return (mbrtowc_l(pc32, s, n, ps, locale));
___
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: r340428 - in head: . usr.sbin/ctm/ctm

2018-11-14 Thread Stefan Esser
Author: se
Date: Wed Nov 14 08:45:48 2018
New Revision: 340428
URL: https://svnweb.freebsd.org/changeset/base/340428

Log:
  Prepare move of ctm from base to a port (misc/ctm) by:
  - Adding a note to UPDATING
  - Adding a note to the history section of the manpage ctm.1
  - Adding a message printed to STDERR to the ctm program
  
  This version is meant for release in FreeBSD-12.0 and should remain in
  FreeBSD-12 over its life-time.
  
  A follow-up commit will remove ctm from -CURRENT after the MFC to 12
  has happened.
  
  Approved by:  imp, rgrimes, bcr (man-page)
  MFC after:3 days
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D17969

Modified:
  head/UPDATING
  head/usr.sbin/ctm/ctm/ctm.1
  head/usr.sbin/ctm/ctm/ctm.c

Modified: head/UPDATING
==
--- head/UPDATING   Wed Nov 14 06:46:44 2018(r340427)
+++ head/UPDATING   Wed Nov 14 08:45:48 2018(r340428)
@@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
 
+20181115:
+   The set of CTM commands (ctm, ctm_smail, ctm_rmail, ctm_dequeue)
+   has been converted to a port (misc/ctm) and will be removed from
+   FreeBSD-13.  It is available as a package (ctm) for all supported
+   FreeBSD versions.
+
 20181110:
The default newsyslog.conf(5) file has been changed to only include
files in /etc/newsyslog.conf.d/ and /usr/local/etc/newsyslog.conf.d/ if

Modified: head/usr.sbin/ctm/ctm/ctm.1
==
--- head/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 06:46:44 2018(r340427)
+++ head/usr.sbin/ctm/ctm/ctm.1 Wed Nov 14 08:45:48 2018(r340428)
@@ -12,7 +12,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 14, 2016
+.Dd November 15, 2018
 .Dt CTM 1
 .Os
 .Sh NAME
@@ -321,6 +321,12 @@ The
 .Nm
 command appeared in
 .Fx 2.1 .
+.Pp
+The latest
+.Nm
+code has been made available as a port (misc/ctm) in preparation of removal
+from base in
+.Fx 13.0 .
 .Sh AUTHORS
 .An -nosplit
 The CTM system has been designed and implemented by

Modified: head/usr.sbin/ctm/ctm/ctm.c
==
--- head/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 06:46:44 2018(r340427)
+++ head/usr.sbin/ctm/ctm/ctm.c Wed Nov 14 08:45:48 2018(r340428)
@@ -144,6 +144,9 @@ main(int argc, char **argv)
warnx("%d errors during option processing",stat);
return Exit_Pilot;
 }
+fprintf(stderr, "CTM will be removed from FreeBSD-13, and will be "
+   "provided as a port (misc/ctm) or package (ctm).\n\n");
+
 stat = Exit_Done;
 argc -= optind;
 argv += optind;
___
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"