Re: svn commit: r334540 - head/usr.bin/top

2018-06-18 Thread Eitan Adler
On 2 June 2018 at 23:51, Rodney W. Grimes
 wrote:
> [ Charset UTF-8 unsupported, converting... ]
>> On 2 June 2018 at 21:14, Rodney W. Grimes
>>  wrote:
>> >> On 2 June 2018 at 16:53, Rodney W. Grimes
>> >>  wrote:
>> >> > [ Charset UTF-8 unsupported, converting... ]
>> >> >> Author: eadler
>> >> >> Date: Sat Jun  2 21:40:45 2018
>> >> >> New Revision: 334540
>> >> >> URL: https://svnweb.freebsd.org/changeset/base/334540
>> >> >>
>> >> >> Log:
>> >> >>   top(1): cleanup memory allocation and warnings
>> >> >>
>> >> >>   - Prefer calloc over malloc. This is more predicable and we're not 
>> >> >> in a
>> >> >>   performance sensitive context. [1]
>> >> >>   - Remove bogus comment (obsolete from prior commit). [2]
>> >> >>   - Remove void casts and type casts of NULL
>> >> >>   - Remove redundant declaration of 'quit'
>> >> >>   - Add additional const
>> >> >>
>> >> >>   Reported by:kib [1], vangyzen [2]
>> >> >>
>> >> >> Modified:
>> >> >>   head/usr.bin/top/display.c
>> >> >>   head/usr.bin/top/machine.c
>> >> >>   head/usr.bin/top/screen.c
>> >> >>   head/usr.bin/top/screen.h
>> >> >>   head/usr.bin/top/utils.c
>> >> > ...
>> >> >
>> >> >>
>> >> >> Modified: head/usr.bin/top/screen.c
>> >> >> ==
>> >> >> --- head/usr.bin/top/screen.c Sat Jun  2 21:16:20 2018(r334539)
>> >> >> +++ head/usr.bin/top/screen.c Sat Jun  2 21:40:45 2018(r334540)
>> >> >> @@ -3,7 +3,7 @@
>> >> >>   *  Version 3
>> >> >>   *
>> >> >>   *  This program may be freely redistributed,
>> >> >> - *  but this entire comment MUST remain intact.
>> >> >> + *  but this entire ceomment MUST remain intact.
>> >> >
>> >> > I know you have already fixed this spelling error,
>> >> > but I believe there are some other commits that actually
>> >> > removed either this string, or some part of "this entire"
>> >> > comment that is to "remain intact".
>> >>
>> >> I just went through my commits to top(1) and don't see any others. Did
>> >> I miss any?
>> >
>> > Index: commands.c
>> > ===
>> > --- commands.c  (revision 333898)
>> > +++ commands.c  (working copy)
>> > @@ -1,6 +1,5 @@
>> >  /*
>> >   *  Top users/processes display for Unix
>> > - *  Version 3
>> >   *
>> >   *  This program may be freely redistributed,
>> >   *  but this entire comment MUST remain intact.
>> >
>> > Found with a cd usr.bin/top; svn diff -r 333898 which is
>> > when you moved it to usr.bin.  Further investigation
>> > shows that this line was deleted at r333909.
>>
>> I removed the version line, not the license line. Do you believe
>> "entire comment" includes the version information?
>
> I would interpret entire to be anything between /* and */.

Sorry about the delay in responding: there was some ongoing
conversations with core@ about the licensing of top(1). While that
assertion isn't clear, I also don't think it's harmful to restore.
I'll do so in my next pass.



-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335361 - head/sys/netinet

2018-06-18 Thread Randall Stewart
Author: rrs
Date: Tue Jun 19 05:28:14 2018
New Revision: 335361
URL: https://svnweb.freebsd.org/changeset/base/335361

Log:
  Move the tp set back to where it was before
  we started playing with the VNET sets. This
  way we have verified the INP settings before
  we go to the trouble of de-referencing it.
  
  Reviewed by:  and suggested by lstewart
  Sponsored by: Netflix Inc.

Modified:
  head/sys/netinet/tcp_hpts.c

Modified: head/sys/netinet/tcp_hpts.c
==
--- head/sys/netinet/tcp_hpts.c Tue Jun 19 05:01:07 2018(r335360)
+++ head/sys/netinet/tcp_hpts.c Tue Jun 19 05:28:14 2018(r335361)
@@ -1158,7 +1158,6 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim
hpts->p_inp = inp;
drop_reason = inp->inp_hpts_drop_reas;
inp->inp_in_input = 0;
-   tp = intotcpcb(inp);
mtx_unlock(>p_mtx);
CURVNET_SET(inp->inp_vnet);
if (drop_reason) {
@@ -1183,6 +1182,7 @@ out:
mtx_lock(>p_mtx);
continue;
}
+   tp = intotcpcb(inp);
if ((tp == NULL) || (tp->t_inpcb == NULL)) {
goto out;
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r335278 - head/bin/pwd

2018-06-18 Thread Eitan Adler
On 18 June 2018 at 10:57, John Baldwin  wrote:
> On 6/16/18 10:14 PM, Eitan Adler wrote:
>> Author: eadler
>> Date: Sun Jun 17 05:14:50 2018
>> New Revision: 335278
>> URL: https://svnweb.freebsd.org/changeset/base/335278
>>
>> Log:
>>   pwd: mark usage as dead
>
> You keep committing changes like this and ignoring e-mails about them.

I replied both the first time and this time. I may have
(accidentally?) ignored similar emails though. The question I have is
other than the mild code churn what's the harm?

> What broken compiler are you using that doesn't properly inherit __dead2
> from the call to exit()?

In this case, scan-build50 was getting annoyed.





-- 
Eitan Adler
Source, Ports, Doc committer
Bugmeister, Ports Security teams
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335360 - head/usr.bin/top

2018-06-18 Thread Eitan Adler
Author: eadler
Date: Tue Jun 19 05:01:07 2018
New Revision: 335360
URL: https://svnweb.freebsd.org/changeset/base/335360

Log:
  top(1): correct assertion

Modified:
  head/usr.bin/top/top.c

Modified: head/usr.bin/top/top.c
==
--- head/usr.bin/top/top.c  Tue Jun 19 04:18:23 2018(r335359)
+++ head/usr.bin/top/top.c  Tue Jun 19 05:01:07 2018(r335360)
@@ -1169,7 +1169,7 @@ restart:
clear_message();
break;
case CMD_NONE:
-   assert("reached switch without 
command");
+   assert(false && "reached switch without 
command");
}
}
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335359 - head/usr.bin/top

2018-06-18 Thread Eitan Adler
Author: eadler
Date: Tue Jun 19 04:18:23 2018
New Revision: 335359
URL: https://svnweb.freebsd.org/changeset/base/335359

Log:
  top(1): correct header in UP mode
  
  Fix an oversight from r334869 which made the same change, but only for
  SMP systems. This avoids a segfault while D15801 is being reviewed.
  
  Reviewed by:  kevans

Modified:
  head/usr.bin/top/machine.c

Modified: head/usr.bin/top/machine.c
==
--- head/usr.bin/top/machine.c  Tue Jun 19 03:11:09 2018(r335358)
+++ head/usr.bin/top/machine.c  Tue Jun 19 04:18:23 2018(r335359)
@@ -87,7 +87,7 @@ struct handle {
  */
 
 static const char io_header[] =
-"  PID%*s %-*.*s   VCSW  IVCSW   READ  WRITE  FAULT  TOTAL PERCENT 
COMMAND";
+"  %s%*s %-*.*s   VCSW  IVCSW   READ  WRITE  FAULT  TOTAL PERCENT COMMAND";
 
 static const char io_Proc_format[] =
 "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s";
@@ -103,7 +103,7 @@ static const char smp_Proc_format[] =
 "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s";
 
 static char up_header_thr_and_pid[] =
-"  PID%*s %-*.*s  THR PRI NICE   SIZERES%*s STATETIME %7s COMMAND";
+"  %s%*s %-*.*s  THR PRI NICE   SIZERES%*s STATETIME %7s COMMAND";
 static char up_header_id_only[] =
 "  %s%*s %-*.*s   PRI NICE   SIZERES%*s STATETIME %7s COMMAND";
 static char up_Proc_format[] =
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv

2018-06-18 Thread Matthew Macy
OK. I've taken it out of NOTES until such time.
-M

On Mon, Jun 18, 2018 at 7:38 PM, Eric Joyner  wrote:
> It probably won't result in anything usable. I need to remove ixlvc.c from
> the build since the VF driver as a whole doesn't work atm.
>
> - Eric
>
> On Mon, Jun 18, 2018 at 7:05 PM Matthew Macy  wrote:
>>
>> This breaks universe / tinderbox on AMD64. You appear to have
>> committed parts of a patch to ixlvc.c.  I'm not quite clear on what
>> happened here and if just removing the '+' will produce something
>> usable.
>>
>>
>>
>> void
>> ixlv_configure_queues(struct ixlv_sc *sc)
>> {
>> device_tdev = sc->dev;
>> struct ixl_vsi*vsi = >vsi;
>> +if_softc_ctx_tscctx = iflib_get_softc_ctx(vsi->ctx);
>> +struct ixl_tx_queue*tx_que = vsi->tx_queues;
>> +struct ixl_rx_queue*rx_que = vsi->rx_queues;
>> struct tx_ring*txr;
>> struct rx_ring*rxr;
>> intlen, pairs;
>>
>> struct virtchnl_vsi_queue_config_info *vqci;
>> struct virtchnl_queue_pair_info *vqpi;
>>
>> +/* XXX: Linux PF driver wants matching ids in each tx/rx struct,
>> so both TX/RX
>> + * queues of a pair need to be configured */
>> +pairs = max(vsi->num_tx_queues, vsi->num_rx_queues);
>> len = sizeof(struct virtchnl_vsi_queue_config_info) +
>>(sizeof(struct virtchnl_queue_pair_info) * pairs);
>> vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
>> if (!vqci) {
>> device_printf(dev, "%s: unable to allocate memory\n", __func__);
>> ixl_vc_schedule_retry(>vc_mgr);
>> return;
>> }
>> vqci->vsi_id = sc->vsi_res->vsi_id;
>> vqci->num_queue_pairs = pairs;
>> vqpi = vqci->qpair;
>> /* Size check is not needed here - HW max is 16 queue pairs, and we
>>  * can fit info for 31 of them into the AQ buffer before it overflows.
>>  */
>> +for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) {
>> +txr = _que->txr;
>> +rxr = _que->rxr;
>> +
>> vqpi->txq.vsi_id = vqci->vsi_id;
>> vqpi->txq.queue_id = i;
>> +vqpi->txq.ring_len = scctx->isc_ntxd[0];
>> +vqpi->txq.dma_ring_addr = txr->tx_paddr;
>>
>> On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner  wrote:
>> > Author: erj
>> > Date: Mon Jun 18 20:12:54 2018
>> > New Revision: 335338
>> > URL: https://svnweb.freebsd.org/changeset/base/335338
>> >
>> > Log:
>> >   ixl(4): Update to use iflib
>> >
>> >   Update the driver to use iflib in order to bring performance,
>> >   maintainability, and (hopefully) stability benefits to the driver.
>> >
>> >   The driver currently isn't completely ported; features that are
>> > missing:
>> >
>> >   - VF driver (ixlv)
>> >   - SR-IOV host support
>> >   - RDMA support
>> >
>> >   The plan is to have these re-added to the driver before the next
>> > FreeBSD release.
>> >
>> >   Reviewed by:  gallatin@
>> >   Contributions by: gallatin@, mmacy@, krzysztof.gala...@intel.com
>> >   Tested by:jeffrey.e.pie...@intel.com
>> >   MFC after:1 month
>> >   Sponsored by: Intel Corporation
>> >   Differential Revision:https://reviews.freebsd.org/D15577
>> >
>> > Added:
>> >   head/sys/dev/ixl/ixl_debug.h   (contents, props changed)
>> > Modified:
>> >   head/sys/amd64/conf/GENERIC
>> >   head/sys/conf/files.amd64
>> >   head/sys/dev/ixl/i40e_osdep.c
>> >   head/sys/dev/ixl/if_ixl.c
>> >   head/sys/dev/ixl/if_ixlv.c
>> >   head/sys/dev/ixl/ixl.h
>> >   head/sys/dev/ixl/ixl_pf.h
>> >   head/sys/dev/ixl/ixl_pf_i2c.c
>> >   head/sys/dev/ixl/ixl_pf_iov.c
>> >   head/sys/dev/ixl/ixl_pf_main.c
>> >   head/sys/dev/ixl/ixl_pf_qmgr.c
>> >   head/sys/dev/ixl/ixl_txrx.c
>> >   head/sys/dev/ixl/ixlv.h
>> >   head/sys/dev/ixl/ixlvc.c
>> >   head/sys/modules/Makefile
>> >   head/sys/modules/ixl/Makefile
>> >   head/sys/modules/ixlv/Makefile
>> >
>> > Modified: head/sys/amd64/conf/GENERIC
>> >
>> > ==
>> > --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018
>> > (r335337)
>> > +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018
>> > (r335338)
>> > @@ -240,8 +240,8 @@ device  em  # Intel
>> > PRO/1000 Gigabit Ethernet Family
>> >  device ix  # Intel PRO/10GbE PCIE PF
>> > Ethernet
>> >  device ixv # Intel PRO/10GbE PCIE VF
>> > Ethernet
>> >  device ixl # Intel XL710 40Gbe PCIE
>> > Ethernet
>> > -optionsIXL_IW  # Enable iWARP Client
>> > Interface in ixl(4)
>> > -device ixlv# Intel XL710 40Gbe VF PCIE
>> > Ethernet
>> > +#options   IXL_IW  # Enable iWARP Client
>> > Interface in ixl(4)
>> > +#deviceixlv# Intel XL710 40Gbe VF
>> > PCIE Ethernet
>> >  device le  # AMD Am7900 LANCE and Am79C9xx
>> > PCnet
>> > 

svn commit: r335357 - head/sys/amd64/conf

2018-06-18 Thread Matt Macy
Author: mmacy
Date: Tue Jun 19 02:48:53 2018
New Revision: 335357
URL: https://svnweb.freebsd.org/changeset/base/335357

Log:
  remove ixl iwarp and ixlv from the build until they are in a working state

Modified:
  head/sys/amd64/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Tue Jun 19 01:54:00 2018(r335356)
+++ head/sys/amd64/conf/NOTES   Tue Jun 19 02:48:53 2018(r335357)
@@ -333,8 +333,8 @@ device  ipw # Intel 2100 wireless 
NICs.
 device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs.
 device iwn # Intel 4965/1000/5000/6000 wireless NICs.
 device ixl # Intel XL710 40Gbe PCIE Ethernet
-optionsIXL_IW  # Enable iWARP Client Interface in 
ixl(4)
-device ixlv# Intel XL710 40Gbe VF PCIE Ethernet
+#options   IXL_IW  # Enable iWARP Client Interface in 
ixl(4)
+#deviceixlv# Intel XL710 40Gbe VF PCIE Ethernet
 device mthca   # Mellanox HCA InfiniBand
 device mlx4# Shared code module between IB and Ethernet
 device mlx4ib  # Mellanox ConnectX HCA InfiniBand
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv

2018-06-18 Thread Eric Joyner
It probably won't result in anything usable. I need to remove ixlvc.c from
the build since the VF driver as a whole doesn't work atm.

- Eric

On Mon, Jun 18, 2018 at 7:05 PM Matthew Macy  wrote:

> This breaks universe / tinderbox on AMD64. You appear to have
> committed parts of a patch to ixlvc.c.  I'm not quite clear on what
> happened here and if just removing the '+' will produce something
> usable.
>
>
>
> void
> ixlv_configure_queues(struct ixlv_sc *sc)
> {
> device_tdev = sc->dev;
> struct ixl_vsi*vsi = >vsi;
> +if_softc_ctx_tscctx = iflib_get_softc_ctx(vsi->ctx);
> +struct ixl_tx_queue*tx_que = vsi->tx_queues;
> +struct ixl_rx_queue*rx_que = vsi->rx_queues;
> struct tx_ring*txr;
> struct rx_ring*rxr;
> intlen, pairs;
>
> struct virtchnl_vsi_queue_config_info *vqci;
> struct virtchnl_queue_pair_info *vqpi;
>
> +/* XXX: Linux PF driver wants matching ids in each tx/rx struct,
> so both TX/RX
> + * queues of a pair need to be configured */
> +pairs = max(vsi->num_tx_queues, vsi->num_rx_queues);
> len = sizeof(struct virtchnl_vsi_queue_config_info) +
>(sizeof(struct virtchnl_queue_pair_info) * pairs);
> vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
> if (!vqci) {
> device_printf(dev, "%s: unable to allocate memory\n", __func__);
> ixl_vc_schedule_retry(>vc_mgr);
> return;
> }
> vqci->vsi_id = sc->vsi_res->vsi_id;
> vqci->num_queue_pairs = pairs;
> vqpi = vqci->qpair;
> /* Size check is not needed here - HW max is 16 queue pairs, and we
>  * can fit info for 31 of them into the AQ buffer before it overflows.
>  */
> +for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) {
> +txr = _que->txr;
> +rxr = _que->rxr;
> +
> vqpi->txq.vsi_id = vqci->vsi_id;
> vqpi->txq.queue_id = i;
> +vqpi->txq.ring_len = scctx->isc_ntxd[0];
> +vqpi->txq.dma_ring_addr = txr->tx_paddr;
>
> On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner  wrote:
> > Author: erj
> > Date: Mon Jun 18 20:12:54 2018
> > New Revision: 335338
> > URL: https://svnweb.freebsd.org/changeset/base/335338
> >
> > Log:
> >   ixl(4): Update to use iflib
> >
> >   Update the driver to use iflib in order to bring performance,
> >   maintainability, and (hopefully) stability benefits to the driver.
> >
> >   The driver currently isn't completely ported; features that are
> missing:
> >
> >   - VF driver (ixlv)
> >   - SR-IOV host support
> >   - RDMA support
> >
> >   The plan is to have these re-added to the driver before the next
> FreeBSD release.
> >
> >   Reviewed by:  gallatin@
> >   Contributions by: gallatin@, mmacy@, krzysztof.gala...@intel.com
> >   Tested by:jeffrey.e.pie...@intel.com
> >   MFC after:1 month
> >   Sponsored by: Intel Corporation
> >   Differential Revision:https://reviews.freebsd.org/D15577
> >
> > Added:
> >   head/sys/dev/ixl/ixl_debug.h   (contents, props changed)
> > Modified:
> >   head/sys/amd64/conf/GENERIC
> >   head/sys/conf/files.amd64
> >   head/sys/dev/ixl/i40e_osdep.c
> >   head/sys/dev/ixl/if_ixl.c
> >   head/sys/dev/ixl/if_ixlv.c
> >   head/sys/dev/ixl/ixl.h
> >   head/sys/dev/ixl/ixl_pf.h
> >   head/sys/dev/ixl/ixl_pf_i2c.c
> >   head/sys/dev/ixl/ixl_pf_iov.c
> >   head/sys/dev/ixl/ixl_pf_main.c
> >   head/sys/dev/ixl/ixl_pf_qmgr.c
> >   head/sys/dev/ixl/ixl_txrx.c
> >   head/sys/dev/ixl/ixlv.h
> >   head/sys/dev/ixl/ixlvc.c
> >   head/sys/modules/Makefile
> >   head/sys/modules/ixl/Makefile
> >   head/sys/modules/ixlv/Makefile
> >
> > Modified: head/sys/amd64/conf/GENERIC
> >
> ==
> > --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018(r335337)
> > +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018(r335338)
> > @@ -240,8 +240,8 @@ device  em  # Intel
> PRO/1000 Gigabit Ethernet Family
> >  device ix  # Intel PRO/10GbE PCIE PF
> Ethernet
> >  device ixv # Intel PRO/10GbE PCIE VF
> Ethernet
> >  device ixl # Intel XL710 40Gbe PCIE Ethernet
> > -optionsIXL_IW  # Enable iWARP Client
> Interface in ixl(4)
> > -device ixlv# Intel XL710 40Gbe VF PCIE
> Ethernet
> > +#options   IXL_IW  # Enable iWARP Client
> Interface in ixl(4)
> > +#deviceixlv# Intel XL710 40Gbe VF
> PCIE Ethernet
> >  device le  # AMD Am7900 LANCE and Am79C9xx
> PCnet
> >  device ti  # Alteon Networks Tigon I/II
> gigabit Ethernet
> >  device txp # 3Com 3cR990 (``Typhoon'')
> >
> > Modified: head/sys/conf/files.amd64
> >
> 

Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv

2018-06-18 Thread Matthew Macy
This breaks universe / tinderbox on AMD64. You appear to have
committed parts of a patch to ixlvc.c.  I'm not quite clear on what
happened here and if just removing the '+' will produce something
usable.



void
ixlv_configure_queues(struct ixlv_sc *sc)
{
device_tdev = sc->dev;
struct ixl_vsi*vsi = >vsi;
+if_softc_ctx_tscctx = iflib_get_softc_ctx(vsi->ctx);
+struct ixl_tx_queue*tx_que = vsi->tx_queues;
+struct ixl_rx_queue*rx_que = vsi->rx_queues;
struct tx_ring*txr;
struct rx_ring*rxr;
intlen, pairs;

struct virtchnl_vsi_queue_config_info *vqci;
struct virtchnl_queue_pair_info *vqpi;

+/* XXX: Linux PF driver wants matching ids in each tx/rx struct,
so both TX/RX
+ * queues of a pair need to be configured */
+pairs = max(vsi->num_tx_queues, vsi->num_rx_queues);
len = sizeof(struct virtchnl_vsi_queue_config_info) +
   (sizeof(struct virtchnl_queue_pair_info) * pairs);
vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO);
if (!vqci) {
device_printf(dev, "%s: unable to allocate memory\n", __func__);
ixl_vc_schedule_retry(>vc_mgr);
return;
}
vqci->vsi_id = sc->vsi_res->vsi_id;
vqci->num_queue_pairs = pairs;
vqpi = vqci->qpair;
/* Size check is not needed here - HW max is 16 queue pairs, and we
 * can fit info for 31 of them into the AQ buffer before it overflows.
 */
+for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) {
+txr = _que->txr;
+rxr = _que->rxr;
+
vqpi->txq.vsi_id = vqci->vsi_id;
vqpi->txq.queue_id = i;
+vqpi->txq.ring_len = scctx->isc_ntxd[0];
+vqpi->txq.dma_ring_addr = txr->tx_paddr;

On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner  wrote:
> Author: erj
> Date: Mon Jun 18 20:12:54 2018
> New Revision: 335338
> URL: https://svnweb.freebsd.org/changeset/base/335338
>
> Log:
>   ixl(4): Update to use iflib
>
>   Update the driver to use iflib in order to bring performance,
>   maintainability, and (hopefully) stability benefits to the driver.
>
>   The driver currently isn't completely ported; features that are missing:
>
>   - VF driver (ixlv)
>   - SR-IOV host support
>   - RDMA support
>
>   The plan is to have these re-added to the driver before the next FreeBSD 
> release.
>
>   Reviewed by:  gallatin@
>   Contributions by: gallatin@, mmacy@, krzysztof.gala...@intel.com
>   Tested by:jeffrey.e.pie...@intel.com
>   MFC after:1 month
>   Sponsored by: Intel Corporation
>   Differential Revision:https://reviews.freebsd.org/D15577
>
> Added:
>   head/sys/dev/ixl/ixl_debug.h   (contents, props changed)
> Modified:
>   head/sys/amd64/conf/GENERIC
>   head/sys/conf/files.amd64
>   head/sys/dev/ixl/i40e_osdep.c
>   head/sys/dev/ixl/if_ixl.c
>   head/sys/dev/ixl/if_ixlv.c
>   head/sys/dev/ixl/ixl.h
>   head/sys/dev/ixl/ixl_pf.h
>   head/sys/dev/ixl/ixl_pf_i2c.c
>   head/sys/dev/ixl/ixl_pf_iov.c
>   head/sys/dev/ixl/ixl_pf_main.c
>   head/sys/dev/ixl/ixl_pf_qmgr.c
>   head/sys/dev/ixl/ixl_txrx.c
>   head/sys/dev/ixl/ixlv.h
>   head/sys/dev/ixl/ixlvc.c
>   head/sys/modules/Makefile
>   head/sys/modules/ixl/Makefile
>   head/sys/modules/ixlv/Makefile
>
> Modified: head/sys/amd64/conf/GENERIC
> ==
> --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018(r335337)
> +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018(r335338)
> @@ -240,8 +240,8 @@ device  em  # Intel 
> PRO/1000 Gigabit Ethernet Family
>  device ix  # Intel PRO/10GbE PCIE PF Ethernet
>  device ixv # Intel PRO/10GbE PCIE VF Ethernet
>  device ixl # Intel XL710 40Gbe PCIE Ethernet
> -optionsIXL_IW  # Enable iWARP Client 
> Interface in ixl(4)
> -device ixlv# Intel XL710 40Gbe VF PCIE Ethernet
> +#options   IXL_IW  # Enable iWARP Client 
> Interface in ixl(4)
> +#deviceixlv# Intel XL710 40Gbe VF PCIE 
> Ethernet
>  device le  # AMD Am7900 LANCE and Am79C9xx PCnet
>  device ti  # Alteon Networks Tigon I/II gigabit 
> Ethernet
>  device txp # 3Com 3cR990 (``Typhoon'')
>
> Modified: head/sys/conf/files.amd64
> ==
> --- head/sys/conf/files.amd64   Mon Jun 18 19:53:11 2018(r335337)
> +++ head/sys/conf/files.amd64   Mon Jun 18 20:12:54 2018(r335338)
> @@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c  optionalixl 
> pci  pci_iov \
> compile-with "${NORMAL_C} -I$S/dev/ixl"
>  dev/ixl/ixl_pf_i2c.c   optionalixl pci \
> compile-with "${NORMAL_C} 

svn commit: r335356 - in head/sys: kern netinet netinet/tcp_stacks

2018-06-18 Thread Matt Macy
Author: mmacy
Date: Tue Jun 19 01:54:00 2018
New Revision: 335356
URL: https://svnweb.freebsd.org/changeset/base/335356

Log:
  convert inpcbinfo hash and info rwlocks to epoch + mutex
  
  - Convert inpcbinfo info & hash locks to epoch for read and mutex for write
  - Garbage collect code that handled INP_INFO_TRY_RLOCK failures as
INP_INFO_RLOCK which can no longer fail
  
  When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces
  unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to
  3%.
  
  Overall packet throughput rate limited by CPU affinity and NIC driver design
  choices.
  
  On the receiver unhalted core cycles samples in in_pcblookup_hash went from
  13% to to 1.6%
  
  Tested by LLNW and pho@
  
  Reviewed by: jtl
  Sponsored by: Limelight Networks
  Differential Revision: https://reviews.freebsd.org/D15686

Modified:
  head/sys/kern/subr_witness.c
  head/sys/netinet/in_pcb.h
  head/sys/netinet/tcp_hpts.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/rack.c
  head/sys/netinet/tcp_timewait.c

Modified: head/sys/kern/subr_witness.c
==
--- head/sys/kern/subr_witness.cTue Jun 19 01:33:03 2018
(r335355)
+++ head/sys/kern/subr_witness.cTue Jun 19 01:54:00 2018
(r335356)
@@ -561,14 +561,14 @@ static struct witness_order_list_entry order_lists[] =
/*
 * UDP/IP
 */
-   { "udp", _class_rw },
+   { "udp", _class_mtx_sleep },
{ "udpinp", _class_rw },
{ "so_snd", _class_mtx_sleep },
{ NULL, NULL },
/*
 * TCP/IP
 */
-   { "tcp", _class_rw },
+   { "tcp", _class_mtx_sleep },
{ "tcpinp", _class_rw },
{ "so_snd", _class_mtx_sleep },
{ NULL, NULL },

Modified: head/sys/netinet/in_pcb.h
==
--- head/sys/netinet/in_pcb.h   Tue Jun 19 01:33:03 2018(r335355)
+++ head/sys/netinet/in_pcb.h   Tue Jun 19 01:54:00 2018(r335356)
@@ -51,6 +51,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #endif
 #include 
@@ -157,6 +159,7 @@ struct in_conninfo {
  * Key:
  * (b) - Protected by the hpts lock.
  * (c) - Constant after initialization
+ * (e) - Protected by the net_epoch_prempt epoch
  * (g) - Protected by the pcbgroup lock
  * (i) - Protected by the inpcb lock
  * (p) - Protected by the pcbinfo lock for the inpcb
@@ -231,7 +234,7 @@ struct inpcbpolicy;
 struct m_snd_tag;
 struct inpcb {
/* Cache line #1 (amd64) */
-   CK_LIST_ENTRY(inpcb) inp_hash;  /* (h/i) hash list */
+   CK_LIST_ENTRY(inpcb) inp_hash;  /* [w](h/i) [r](e/i)  hash list */
CK_LIST_ENTRY(inpcb) inp_pcbgrouphash;  /* (g/i) hash list */
struct rwlock   inp_lock;
/* Cache line #2 (amd64) */
@@ -324,8 +327,8 @@ struct inpcb {
struct route_in6 inp_route6;
};
CK_LIST_ENTRY(inpcb) inp_list;  /* (p/l) list for all PCBs for proto */
-   /* (p[w]) for list iteration */
-   /* (p[r]/l) for addition/removal */
+   /* (e[r]) for list iteration */
+   /* (p[w]/l) for addition/removal */
struct epoch_context inp_epoch_ctx;
 };
 #endif /* _KERNEL */
@@ -436,22 +439,23 @@ struct in_pcblist {
  * Locking key:
  *
  * (c) Constant or nearly constant after initialisation
+ * (e) - Protected by the net_epoch_prempt epoch
  * (g) Locked by ipi_lock
  * (l) Locked by ipi_list_lock
- * (h) Read using either ipi_hash_lock or inpcb lock; write requires both
+ * (h) Read using either net_epoch_preempt or inpcb lock; write requires both 
ipi_hash_lock and inpcb lock
  * (p) Protected by one or more pcbgroup locks
  * (x) Synchronisation properties poorly defined
  */
 struct inpcbinfo {
/*
-* Global lock protecting full inpcb list traversal
+* Global lock protecting inpcb list modification
 */
-   struct rwlockipi_lock;
+   struct mtx   ipi_lock;
 
/*
 * Global list of inpcbs on the protocol.
 */
-   struct inpcbhead*ipi_listhead;  /* (g/l) */
+   struct inpcbhead*ipi_listhead;  /* [r](e) [w](g/l) */
u_intipi_count; /* (l) */
 
/*
@@ -482,9 +486,9 @@ struct inpcbinfo {
u_intipi_hashfields;/* (c) */
 
/*
-* Global lock protecting non-pcbgroup hash lookup tables.
+* Global lock protecting modification non-pcbgroup hash lookup tables.
 */
-   struct rwlockipi_hash_lock;
+   struct mtx   ipi_hash_lock;
 
/*
 * Global hash of inpcbs, hashed by local and foreign addresses and
@@ -626,20 

svn commit: r335355 - head/contrib/amd/amq

2018-06-18 Thread Cy Schubert
Author: cy
Date: Tue Jun 19 01:33:03 2018
New Revision: 335355
URL: https://svnweb.freebsd.org/changeset/base/335355

Log:
  Fix amq -i timestamp segmentation violation.
  
  MFC after:1 week

Modified:
  head/contrib/amd/amq/amq.c

Modified: head/contrib/amd/amq/amq.c
==
--- head/contrib/amd/amq/amq.c  Tue Jun 19 01:32:33 2018(r335354)
+++ head/contrib/amd/amq/amq.c  Tue Jun 19 01:33:03 2018(r335355)
@@ -79,7 +79,7 @@ enum show_opt {
 static void
 time_print(time_type tt)
 {
-  time_t t = (time_t)*tt;
+  time_t t = (time_t)(intptr_t)tt;
   struct tm *tp = localtime();
   printf("%02d/%02d/%04d %02d:%02d:%02d",
 tp->tm_mon + 1, tp->tm_mday,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335354 - head/tests/sys/audit

2018-06-18 Thread Alan Somers
Author: asomers
Date: Tue Jun 19 01:32:33 2018
New Revision: 335354
URL: https://svnweb.freebsd.org/changeset/base/335354

Log:
  audit(4): add tests for ioctl(2)
  
  Submitted by: aniketp
  MFC after:2 weeks
  Sponsored by: Google, Inc. (GSoC 2018)
  Differential Revision:https://reviews.freebsd.org/D15872

Added:
  head/tests/sys/audit/ioctl.c   (contents, props changed)
Modified:
  head/tests/sys/audit/Makefile

Modified: head/tests/sys/audit/Makefile
==
--- head/tests/sys/audit/Makefile   Tue Jun 19 01:00:27 2018
(r335353)
+++ head/tests/sys/audit/Makefile   Tue Jun 19 01:32:33 2018
(r335354)
@@ -10,6 +10,7 @@ ATF_TESTS_C+= file-close
 ATF_TESTS_C+=  file-write
 ATF_TESTS_C+=  file-read
 ATF_TESTS_C+=  open
+ATF_TESTS_C+=  ioctl
 ATF_TESTS_C+=  network
 ATF_TESTS_C+=  inter-process
 ATF_TESTS_C+=  administrative
@@ -30,6 +31,8 @@ SRCS.file-read+=  file-read.c
 SRCS.file-read+=   utils.c
 SRCS.open+=open.c
 SRCS.open+=utils.c
+SRCS.ioctl+=   ioctl.c
+SRCS.ioctl+=   utils.c
 SRCS.network+= network.c
 SRCS.network+= utils.c
 SRCS.inter-process+=   inter-process.c

Added: head/tests/sys/audit/ioctl.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tests/sys/audit/ioctl.cTue Jun 19 01:32:33 2018
(r335354)
@@ -0,0 +1,103 @@
+/*-
+ * Copyright (c) 2018 Aniket Pandey
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * 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
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include "utils.h"
+
+static int filedesc;
+static char ioregex[80];
+static const char *auclass = "io";
+static struct pollfd fds[1];
+static unsigned long request = AUDITPIPE_FLUSH;
+
+
+ATF_TC_WITH_CLEANUP(ioctl_success);
+ATF_TC_HEAD(ioctl_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "ioctl(2) call");
+}
+
+ATF_TC_BODY(ioctl_success, tc)
+{
+   /* auditpipe(4) supports quite a few ioctls */
+   ATF_REQUIRE((filedesc = open("/dev/auditpipe", O_RDONLY)) != -1);
+   /* Prepare the regex to be checked in the audit record */
+   snprintf(ioregex, sizeof(ioregex),
+   "ioctl.*%#lx.*%#x.*return,success", request, filedesc);
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE(ioctl(filedesc, request) != -1);
+   check_audit(fds, ioregex, pipefd);
+   close(filedesc);
+}
+
+ATF_TC_CLEANUP(ioctl_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(ioctl_failure);
+ATF_TC_HEAD(ioctl_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "ioctl(2) call");
+}
+
+ATF_TC_BODY(ioctl_failure, tc)
+{
+   snprintf(ioregex, sizeof(ioregex),
+   "ioctl.*%#lx.*return,failure : Bad file descriptor", request);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: Invalid file descriptor */
+   ATF_REQUIRE_EQ(-1, ioctl(-1, request));
+   check_audit(fds, ioregex, pipefd);
+}
+
+ATF_TC_CLEANUP(ioctl_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+   ATF_TP_ADD_TC(tp, ioctl_success);
+   ATF_TP_ADD_TC(tp, ioctl_failure);
+
+   return (atf_no_error());
+}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335353 - head

2018-06-18 Thread Bryan Drewery
Author: bdrewery
Date: Tue Jun 19 01:00:27 2018
New Revision: 335353
URL: https://svnweb.freebsd.org/changeset/base/335353

Log:
  Don't bootstrap lld if an external linker is used.
  
  Sponsored by: Dell EMC

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==
--- head/Makefile.inc1  Tue Jun 19 00:50:27 2018(r335352)
+++ head/Makefile.inc1  Tue Jun 19 01:00:27 2018(r335353)
@@ -232,6 +232,10 @@ X${BINUTIL}?=  ${${BINUTIL}}
 .endif
 .endfor
 
+# If a full path to an external linker is given, don't build lld.
+.if ${XLD:M/*}
+MK_LLD_BOOTSTRAP=  no
+.endif
 
 # We must do lib/ and libexec/ before bin/ in case of a mid-install error to
 # keep the users system reasonably usable.  For static->dynamic root upgrades,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335352 - head/sys/dev/cxgbe/common

2018-06-18 Thread Navdeep Parhar
Author: np
Date: Tue Jun 19 00:50:27 2018
New Revision: 335352
URL: https://svnweb.freebsd.org/changeset/base/335352

Log:
  cxgbe(4): Some mailbox commands require access to the Tx pipeline and
  can time out if it's backed up due to a non-stop deluge of PAUSE frames
  from a misbehaving peer.  Detect this situation and toggle MPS TxEn
  to allow forward progress.
  
  MFC after:2 weeks
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/common/t4_hw.c

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==
--- head/sys/dev/cxgbe/common/t4_hw.c   Tue Jun 19 00:38:28 2018
(r335351)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Tue Jun 19 00:50:27 2018
(r335352)
@@ -239,6 +239,63 @@ static void fw_asrt(struct adapter *adap, struct fw_de
  be32_to_cpu(asrt->u.assert.y));
 }
 
+struct port_tx_state {
+   uint64_t rx_pause;
+   uint64_t tx_frames;
+};
+
+static void
+read_tx_state_one(struct adapter *sc, int i, struct port_tx_state *tx_state)
+{
+   uint32_t rx_pause_reg, tx_frames_reg;
+
+   if (is_t4(sc)) {
+   tx_frames_reg = PORT_REG(i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L);
+   rx_pause_reg = PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L);
+   } else {
+   tx_frames_reg = T5_PORT_REG(i, 
A_MPS_PORT_STAT_TX_PORT_FRAMES_L);
+   rx_pause_reg = T5_PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L);
+   }
+
+   tx_state->rx_pause = t4_read_reg64(sc, rx_pause_reg);
+   tx_state->tx_frames = t4_read_reg64(sc, tx_frames_reg);
+}
+
+static void
+read_tx_state(struct adapter *sc, struct port_tx_state *tx_state)
+{
+   int i;
+
+   for_each_port(sc, i)
+   read_tx_state_one(sc, i, _state[i]);
+}
+
+static void
+check_tx_state(struct adapter *sc, struct port_tx_state *tx_state)
+{
+   uint32_t port_ctl_reg;
+   uint64_t tx_frames, rx_pause;
+   int i;
+
+   for_each_port(sc, i) {
+   rx_pause = tx_state[i].rx_pause;
+   tx_frames = tx_state[i].tx_frames;
+   read_tx_state_one(sc, i, _state[i]); /* update */
+
+   if (is_t4(sc))
+   port_ctl_reg = PORT_REG(i, A_MPS_PORT_CTL);
+   else
+   port_ctl_reg = T5_PORT_REG(i, A_MPS_PORT_CTL);
+   if (t4_read_reg(sc, port_ctl_reg) & F_PORTTXEN &&
+   rx_pause != tx_state[i].rx_pause &&
+   tx_frames == tx_state[i].tx_frames) {
+   t4_set_reg_field(sc, port_ctl_reg, F_PORTTXEN, 0);
+   mdelay(1);
+   t4_set_reg_field(sc, port_ctl_reg, F_PORTTXEN, 
F_PORTTXEN);
+   }
+   }
+}
+
 #define X_CIM_PF_NOACCESS 0x
 /**
  * t4_wr_mbox_meat_timeout - send a command to FW through the given mailbox
@@ -280,13 +337,14 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int 
};
u32 v;
u64 res;
-   int i, ms, delay_idx, ret;
+   int i, ms, delay_idx, ret, next_tx_check;
const __be64 *p = cmd;
u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA);
u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL);
u32 ctl;
__be64 cmd_rpl[MBOX_LEN/8];
u32 pcie_fw;
+   struct port_tx_state tx_state[MAX_NPORTS];
 
if (adap->flags & CHK_MBOX_ACCESS)
ASSERT_SYNCHRONIZED_OP(adap);
@@ -375,8 +433,8 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int 
CH_DUMP_MBOX(adap, mbox, data_reg);
 
t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW));
-   t4_read_reg(adap, ctl_reg); /* flush write */
-
+   read_tx_state(adap, _state[0]);  /* also flushes the write_reg */
+   next_tx_check = 1000;
delay_idx = 0;
ms = delay[0];
 
@@ -391,6 +449,12 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int 
if (pcie_fw & F_PCIE_FW_ERR)
break;
}
+
+   if (i >= next_tx_check) {
+   check_tx_state(adap, _state[0]);
+   next_tx_check = i + 1000;
+   }
+
if (sleep_ok) {
ms = delay[delay_idx];  /* last element may repeat */
if (delay_idx < ARRAY_SIZE(delay) - 1)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335351 - in head/sys/dev/rtwn: rtl8812a rtl8812a/usb rtl8821a/usb

2018-06-18 Thread Andriy Voskoboinyk
Author: avos
Date: Tue Jun 19 00:38:28 2018
New Revision: 335351
URL: https://svnweb.freebsd.org/changeset/base/335351

Log:
  rtwn(4): decode some bit fields + merge duplicate code.
  
  Add macros for R12A_RXDMA_PRO register (descriptions were seen in the
  RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies.
  
  No functional change intended.

Modified:
  head/sys/dev/rtwn/rtl8812a/r12a_reg.h
  head/sys/dev/rtwn/rtl8812a/usb/r12au.h
  head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c
  head/sys/dev/rtwn/rtl8821a/usb/r21au.h
  head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
  head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c

Modified: head/sys/dev/rtwn/rtl8812a/r12a_reg.h
==
--- head/sys/dev/rtwn/rtl8812a/r12a_reg.h   Tue Jun 19 00:27:30 2018
(r335350)
+++ head/sys/dev/rtwn/rtl8812a/r12a_reg.h   Tue Jun 19 00:38:28 2018
(r335351)
@@ -58,6 +58,16 @@
 /* Bits for R92C_LEDCFG2. */
 #define R12A_LEDCFG2_ENA   0x20
 
+/* Bits for R12A_RXDMA_PRO. */
+#define R12A_DMA_MODE  0x02
+#define R12A_BURST_CNT_M   0x0c
+#define R12A_BURST_CNT_S   2
+#define R12A_BURST_SZ_M0x30
+#define R12A_BURST_SZ_S4
+#define R12A_BURST_SZ_USB3 0
+#define R12A_BURST_SZ_USB2 1
+#define R12A_BURST_SZ_USB1 2
+
 /* Bits for R12A_CCK_CHECK. */
 #define R12A_CCK_CHECK_BCN10x20
 #define R12A_CCK_CHECK_5GHZ0x80

Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au.h
==
--- head/sys/dev/rtwn/rtl8812a/usb/r12au.h  Tue Jun 19 00:27:30 2018
(r335350)
+++ head/sys/dev/rtwn/rtl8812a/usb/r12au.h  Tue Jun 19 00:38:28 2018
(r335351)
@@ -37,6 +37,7 @@
  */
 /* r12au_init.c */
 void   r12au_init_rx_agg(struct rtwn_softc *);
+void   r12au_init_burstlen_usb2(struct rtwn_softc *);
 void   r12au_init_burstlen(struct rtwn_softc *);
 void   r12au_init_ampdu_fwhw(struct rtwn_softc *);
 void   r12au_init_ampdu(struct rtwn_softc *);

Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c
==
--- head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c Tue Jun 19 00:27:30 2018
(r335350)
+++ head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c Tue Jun 19 00:38:28 2018
(r335351)
@@ -72,19 +72,32 @@ r12au_init_rx_agg(struct rtwn_softc *sc)
 }
 
 void
+r12au_init_burstlen_usb2(struct rtwn_softc *sc)
+{
+   const uint8_t dma_count = R12A_DMA_MODE | SM(R12A_BURST_CNT, 3);
+
+   if ((rtwn_read_1(sc, R92C_USB_INFO) & 0x30) == 0) {
+   /* Set burst packet length to 512 B. */
+   rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M,
+   dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB2));
+   } else {
+   /* Set burst packet length to 64 B. */
+   rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M,
+   dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB1));
+   }
+}
+
+void
 r12au_init_burstlen(struct rtwn_softc *sc)
 {
-   if (rtwn_read_1(sc, R92C_TYPE_ID + 3) & 0x80)   {
-   if ((rtwn_read_1(sc, R92C_USB_INFO) & 0x30) == 0) {
-   /* Set burst packet length to 512 B. */
-   rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x20, 0x1e);
-   } else {
-   /* Set burst packet length to 64 B. */
-   rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x10, 0x2e);
-   }
-   } else {/* USB 3.0 */
+   const uint8_t dma_count = R12A_DMA_MODE | SM(R12A_BURST_CNT, 3);
+
+   if (rtwn_read_1(sc, R92C_TYPE_ID + 3) & 0x80)
+   r12au_init_burstlen_usb2(sc);
+   else {  /* USB 3.0 */
/* Set burst packet length to 1 KB. */
-   rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x30, 0x0e);
+   rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M,
+   dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB3));
 
rtwn_setbits_1(sc, 0xf008, 0x18, 0);
}

Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au.h
==
--- head/sys/dev/rtwn/rtl8821a/usb/r21au.h  Tue Jun 19 00:27:30 2018
(r335350)
+++ head/sys/dev/rtwn/rtl8821a/usb/r21au.h  Tue Jun 19 00:38:28 2018
(r335351)
@@ -37,7 +37,6 @@
  */
 /* r21au_init.c */
 void   r21au_init_tx_agg(struct rtwn_softc *);
-void   r21au_init_burstlen(struct rtwn_softc *);
 
 /* r21au_dfs.c */
 void   r21au_chan_check(void *, int);

Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c
==
--- head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c   Tue Jun 19 00:27:30 
2018(r335350)
+++ 

svn commit: r335350 - head/tools/tools/git

2018-06-18 Thread Warner Losh
Author: imp
Date: Tue Jun 19 00:27:30 2018
New Revision: 335350
URL: https://svnweb.freebsd.org/changeset/base/335350

Log:
  Add my script for coping with git-svn and the need to rebase
  changes for different branches. It's a bit rough right now,
  but should be good enough for most people to try to use. It's
  definitely 'tools' tree quality.

Added:
  head/tools/tools/git/git-svn-rebase   (contents, props changed)
Modified:
  head/tools/tools/git/HOWTO

Modified: head/tools/tools/git/HOWTO
==
--- head/tools/tools/git/HOWTO  Mon Jun 18 23:16:47 2018(r335349)
+++ head/tools/tools/git/HOWTO  Tue Jun 19 00:27:30 2018(r335350)
@@ -142,3 +142,18 @@ and 5, the commit hashes of all of your commits change
 You must go back and find the new commit hashes of your commits to pass to
 importgit.  Passing -r C1~..C2 would import your commits as they were *before*
 your code review fixes were applied.
+
+III. git-svn-rebase
+
+git-svn-rebase is a script that helps you keep current when using git 
+plus subversion as outline in https://wiki.freebsd.org/GitWorkflow/GitSvn
+since it's otherwise a pain to have many branhes active. It will rebase
+those branches that haven't been merged yet. Some tweaking may be needed
+if you have other, weird branches in your tree (including any stable
+branches). To run it just cd into the git subversion tree somewhere and
+type
+$ git-svn-rebase
+and it will do its thing and leave the tree on the master branch.
+
+Your tree must be clean to start this, and while it tries to catch
+some failures, not all of them have been allowed for.

Added: head/tools/tools/git/git-svn-rebase
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/tools/git/git-svn-rebase Tue Jun 19 00:27:30 2018
(r335350)
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+# $FreeBSD$
+
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
+#  Copyright (c) 2018 M. Warner Losh
+#
+#  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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+
+#
+# simple script to keep all my branches up to date while tracking
+# FreeBSD (or any upstream svn source) with git. Run it often, and it
+# will rebase all the branches so they don't get too stale.
+# Takes no args, and acts goofy if you have really old branches
+# which is why stable/* and mfc* are excluded. Caution to should be taken
+# when using this.
+#
+
+FAIL=
+echo - Checkout master for svn rebase 
+git checkout master
+echo - Rebasing our master to svn upstream  
+git svn rebase
+for i in $(git branch --no-merge | grep -v stable/ | grep -v mfc); do
+   echo - Rebasing $i to the tip of master 
+   git rebase master $i || {
+   echo "** REBASE OF $i FAILED, ABORTING 
*"
+   FAIL="$FAIL $i"
+   git rebase --abort
+   }
+done
+echo - Checkout out master again 
+git checkout master
+git branch
+if [ -n "$FAIL" ]; then
+echo Failed branches: $FAIL
+fi
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r335346 - head/sys/modules

2018-06-18 Thread Emmanuel Vadot

On 2018-06-19 00:27, Matt Macy wrote:

Author: mmacy
Date: Mon Jun 18 22:27:29 2018
New Revision: 335346
URL: https://svnweb.freebsd.org/changeset/base/335346

Log:
  remove epoch_test from default build


 Requested by: manu

 Thanks,


Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Mon Jun 18 22:22:06 2018(r335345)
+++ head/sys/modules/Makefile   Mon Jun 18 22:27:29 2018(r335346)
@@ -121,7 +121,6 @@ SUBDIR= \
${_ena} \
${_ep} \
${_epic} \
-   epoch_test \
esp \
${_et} \
evdev \


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


svn commit: r335349 - head/tools/boot

2018-06-18 Thread Warner Losh
Author: imp
Date: Mon Jun 18 23:16:47 2018
New Revision: 335349
URL: https://svnweb.freebsd.org/changeset/base/335349

Log:
  Switch to creating UEFI ESPs using loader.efi instead of boot1.efi.
  Cope for the fact that laoder.efi, not being boot1, doesn't read
  /boot.config by setting boot_serial and force the serial console.
  
  Also add sysctl so we can display the boot method.
  
  Provide a variable, do_boot1_efi, if you want to use boot1 for
  testing. But since it's transient, it's just a variable and not
  available on the command line.

Modified:
  head/tools/boot/rootgen.sh

Modified: head/tools/boot/rootgen.sh
==
--- head/tools/boot/rootgen.sh  Mon Jun 18 23:00:15 2018(r335348)
+++ head/tools/boot/rootgen.sh  Mon Jun 18 23:16:47 2018(r335349)
@@ -2,6 +2,8 @@
 
 # $FreeBSD$
 
+do_boot1_efi=0
+
 #
 # Builds all the bat-shit crazy combinations we support booting from,
 # at least for amd64. It assume you have a ~sane kernel in /boot/kernel
@@ -29,6 +31,29 @@ cpsys() {
 (cd $src ; tar cf - .) | (cd $dst; tar xf -)
 }
 
+make_esp()
+{
+local src dst md mntpt
+src=$1
+dst=$2
+
+if [ "${do_boot1_efi}" -eq 1 ]; then
+   cp ${src}/boot/boot1.efifat ${dst}
+else
+   dd if=/dev/zero of=${dst} count=1 seek=$((100 * 1024 * 1024 / 512))
+   md=$(mdconfig -f ${dst})
+   newfs_msdos -a 32 /dev/${md}
+   mntpt=$(mktemp -d /tmp/stand-test.XX)
+   mount -t msdos /dev/${md} ${mntpt}
+#  mkdir -p ${mntpt}/efi/freebsd # not yet
+   mkdir -p ${mntpt}/efi/boot
+   cp ${src}/boot/loader.efi ${mntpt}/efi/boot/bootx64.efi
+   umount ${mntpt}
+   rmdir ${mntpt}
+   mdconfig -d -u ${md}
+fi
+}
+
 mk_nogeli_gpt_ufs_legacy() {
 src=$1
 img=$2
@@ -50,8 +75,7 @@ mk_nogeli_gpt_ufs_uefi() {
 cat > ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${DESTDIR}/boot.config
+cat > ${DESTDIR}/boot/loader.conf < ${DESTDIR}/etc/rc 

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

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 23:00:15 2018
New Revision: 335348
URL: https://svnweb.freebsd.org/changeset/base/335348

Log:
  libnv: add note about nvlist_pack and nvlist_unpack
  
  Fix small typo as well.
  
  Submitted by: Mindaugas Rasiukevicius 

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

Modified: head/share/man/man9/nv.9
==
--- head/share/man/man9/nv.9Mon Jun 18 22:57:32 2018(r335347)
+++ head/share/man/man9/nv.9Mon Jun 18 23:00:15 2018(r335348)
@@ -589,7 +589,7 @@ The
 .Fn nvlist_add_nvlist_array ,
 .Fn nvlist_add_descriptor_array
 functions add element to the given nvlist.
-When adding string or binary buffor the functions will allocate memory
+When adding string or binary buffer the functions will allocate memory
 and copy the data over.
 When adding nvlist, the nvlist will be cloned and clone will be added.
 When adding descriptor, the descriptor will be duplicated using the
@@ -768,6 +768,13 @@ function name from the nvlist and free all resources a
 If element of the given name and the given type does not exist, the program
 will be aborted.
 The nvlist must not be in error state.
+.Sh NOTES
+The
+.Fn nvlist_pack
+and
+.Fn nvlist_unpack
+functions handle the byte-order conversions, so the binary buffer can be
+packed/unpacked by the hosts with the different endianness.
 .Sh EXAMPLES
 The following example demonstrates how to prepare an nvlist and send it over
 .Xr unix 4
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335347 - in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 22:57:32 2018
New Revision: 335347
URL: https://svnweb.freebsd.org/changeset/base/335347

Log:
  libnv: Add nvlist_append_*_array() family of functions.
  
  The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions
  allows to dynamically extend array stored in the nvlist.
  
  Submitted by: Mindaugas Rasiukevicius 

Added:
  head/lib/libnv/tests/nvlist_append_test.c   (contents, props changed)
Modified:
  head/lib/libnv/tests/Makefile
  head/share/man/man9/nv.9
  head/sys/contrib/libnv/nv_impl.h
  head/sys/contrib/libnv/nvlist.c
  head/sys/contrib/libnv/nvpair.c
  head/sys/sys/nv.h

Modified: head/lib/libnv/tests/Makefile
==
--- head/lib/libnv/tests/Makefile   Mon Jun 18 22:27:29 2018
(r335346)
+++ head/lib/libnv/tests/Makefile   Mon Jun 18 22:57:32 2018
(r335347)
@@ -7,6 +7,7 @@ ATF_TESTS_CXX=  \
nv_tests \
 
 TAP_TESTS_C+=  nvlist_add_test
+TAP_TESTS_C+=  nvlist_append_test
 TAP_TESTS_C+=  nvlist_exists_test
 TAP_TESTS_C+=  nvlist_free_test
 TAP_TESTS_C+=  nvlist_get_test

Added: head/lib/libnv/tests/nvlist_append_test.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/lib/libnv/tests/nvlist_append_test.c   Mon Jun 18 22:57:32 2018
(r335347)
@@ -0,0 +1,120 @@
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int ntest = 1;
+
+#defineCHECK(expr) do {
\
+   if ((expr)) \
+   printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__);   \
+   else\
+   printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\
+   ntest++;\
+} while (0)
+
+int
+main(void)
+{
+   const bool *bool_result;
+   const char * const *string_result;
+   const nvlist_t * const *nvl_result;
+   nvlist_t *nvl, *nvl1, *nvl2, **items;
+   unsigned int i;
+   size_t nitems;
+
+   printf("1..32\n");
+
+   nvl = nvlist_create(0);
+
+   for (i = 0; i < 16; i++)
+   nvlist_append_bool_array(nvl, "nvl/bool", i % 2 == 0);
+
+   CHECK(nvlist_error(nvl) == 0);
+   CHECK(!nvlist_empty(nvl));
+   CHECK(nvlist_exists_bool_array(nvl, "nvl/bool"));
+
+   bool_result = nvlist_get_bool_array(nvl, "nvl/bool", );
+   CHECK(nitems == 16);
+   CHECK(bool_result != NULL);
+   for (i = 0; i < nitems; i++)
+   CHECK(bool_result[i] == (i % 2 == 0));
+
+
+   nvlist_append_string_array(nvl, "nvl/string", "a");
+   nvlist_append_string_array(nvl, "nvl/string", "abc");
+   string_result = nvlist_get_string_array(nvl, "nvl/string", );
+   CHECK(nitems == 2);
+   CHECK(strcmp(string_result[0], "a") == 0);
+   CHECK(strcmp(string_result[1], "abc") == 0);
+
+
+   nvl1 = nvlist_create(0);
+   nvlist_add_string(nvl1, "key1", "test1");
+   nvlist_append_nvlist_array(nvl, "nvl/nvl", nvl1);
+   nvlist_destroy(nvl1);
+
+   nvl2 = nvlist_create(0);
+   nvlist_add_string(nvl2, "key2", "test2");
+   nvlist_append_nvlist_array(nvl, "nvl/nvl", nvl2);
+   nvlist_destroy(nvl2);
+
+   nvl_result = nvlist_get_nvlist_array(nvl, "nvl/nvl", );
+   CHECK(nitems == 2);
+   

svn commit: r335346 - head/sys/modules

2018-06-18 Thread Matt Macy
Author: mmacy
Date: Mon Jun 18 22:27:29 2018
New Revision: 335346
URL: https://svnweb.freebsd.org/changeset/base/335346

Log:
  remove epoch_test from default build

Modified:
  head/sys/modules/Makefile

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Mon Jun 18 22:22:06 2018(r335345)
+++ head/sys/modules/Makefile   Mon Jun 18 22:27:29 2018(r335346)
@@ -121,7 +121,6 @@ SUBDIR= \
${_ena} \
${_ep} \
${_epic} \
-   epoch_test \
esp \
${_et} \
evdev \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335345 - head/lib/libnv/tests

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 22:22:06 2018
New Revision: 335345
URL: https://svnweb.freebsd.org/changeset/base/335345

Log:
  libnv: add regression test for r335344.

Modified:
  head/lib/libnv/tests/nv_array_tests.cc

Modified: head/lib/libnv/tests/nv_array_tests.cc
==
--- head/lib/libnv/tests/nv_array_tests.cc  Mon Jun 18 22:21:28 2018
(r335344)
+++ head/lib/libnv/tests/nv_array_tests.cc  Mon Jun 18 22:22:06 2018
(r335345)
@@ -312,6 +312,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__basic)
for (i = 0; i < num_items; i++) {
ATF_REQUIRE_EQ(nvlist_error(result[i]), 0);
ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL);
+   ATF_REQUIRE(nvlist_get_parent(result[i], NULL) == NULL);
ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == NULL);
ATF_REQUIRE(!nvlist_in_array(const_result[i]));
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335344 - head/sys/contrib/libnv

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 22:21:28 2018
New Revision: 335344
URL: https://svnweb.freebsd.org/changeset/base/335344

Log:
  libnv: clean parent in nvlist_array when removing it.
  
  When we are removing element form the nvlist we should also clean parent,
  because the array is not a part of the nvlist anymore.
  
  Submitted by: Mindaugas Rasiukevicius 

Modified:
  head/sys/contrib/libnv/nvpair.c

Modified: head/sys/contrib/libnv/nvpair.c
==
--- head/sys/contrib/libnv/nvpair.c Mon Jun 18 21:26:58 2018
(r335343)
+++ head/sys/contrib/libnv/nvpair.c Mon Jun 18 22:21:28 2018
(r335344)
@@ -206,8 +206,10 @@ nvpair_remove_nvlist_array(nvpair_t *nvp)
/* XXX: DECONST is bad, mkay? */
nvlarray = __DECONST(nvlist_t **,
nvpair_get_nvlist_array(nvp, ));
-   for (i = 0; i < count; i++)
+   for (i = 0; i < count; i++) {
nvlist_set_array_next(nvlarray[i], NULL);
+   nvlist_set_parent(nvlarray[i], NULL);
+   }
 }
 
 void
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335343 - in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 21:26:58 2018
New Revision: 335343
URL: https://svnweb.freebsd.org/changeset/base/335343

Log:
  libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
  
  All information which are need for those operations is already stored in
  the cookie.
  
  We decided not to bump libnv version because this API is not used yet in the
  base system.
  
  Reviewed by:  pjd

Modified:
  head/lib/libnv/tests/cnv_tests.cc
  head/share/man/man9/cnv.9
  head/sys/contrib/libnv/cnvlist.c
  head/sys/sys/cnv.h

Modified: head/lib/libnv/tests/cnv_tests.cc
==
--- head/lib/libnv/tests/cnv_tests.cc   Mon Jun 18 21:23:40 2018
(r335342)
+++ head/lib/libnv/tests/cnv_tests.cc   Mon Jun 18 21:26:58 2018
(r335343)
@@ -575,7 +575,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_bool)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   ATF_REQUIRE_EQ(cnvlist_take_bool(nvl, cookie), value);
+   ATF_REQUIRE_EQ(cnvlist_take_bool(cookie), value);
 
cookie = NULL;
ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
@@ -618,7 +618,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_number)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   ATF_REQUIRE_EQ(cnvlist_take_number(nvl, cookie), value);
+   ATF_REQUIRE_EQ(cnvlist_take_number(cookie), value);
 
cookie = NULL;
ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
@@ -662,7 +662,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_string)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   out_string = cnvlist_take_string(nvl, cookie);
+   out_string = cnvlist_take_string(cookie);
ATF_REQUIRE(out_string != NULL);
ATF_REQUIRE_EQ(strcmp(out_string, value), 0);
 
@@ -725,7 +725,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_nvlist)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   result = cnvlist_take_nvlist(nvl, cookie);
+   result = cnvlist_take_nvlist(cookie);
ATF_REQUIRE(!nvlist_exists_nvlist(nvl, key));
ATF_REQUIRE(result == value);
 
@@ -784,7 +784,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_bool_array)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   out_array = cnvlist_take_bool_array(nvl, cookie, );
+   out_array = cnvlist_take_bool_array(cookie, );
ATF_REQUIRE_EQ(nitems, 16);
ATF_REQUIRE(out_array != NULL);
for (i = 0; i < 16; i++)
@@ -836,7 +836,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_number_array)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   out_array = cnvlist_take_number_array(nvl, cookie, );
+   out_array = cnvlist_take_number_array(cookie, );
 
ATF_REQUIRE(out_array != NULL);
ATF_REQUIRE_EQ(nitems, 16);
@@ -885,7 +885,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_string_array)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   out_array = cnvlist_take_string_array(nvl, cookie, );
+   out_array = cnvlist_take_string_array(cookie, );
ATF_REQUIRE_EQ(nitems, 4);
for (i = 0; i < 4; i++) {
ATF_REQUIRE(out_array[i] != NULL);
@@ -957,7 +957,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_nvlist_array)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   result = cnvlist_take_nvlist_array(nvl, cookie, _items);
+   result = cnvlist_take_nvlist_array(cookie, _items);
 
ATF_REQUIRE(result != NULL);
ATF_REQUIRE_EQ(num_items, 8);
@@ -1022,7 +1022,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_binary)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   out_binary = cnvlist_take_binary(nvl, cookie, _size);
+   out_binary = cnvlist_take_binary(cookie, _size);
ATF_REQUIRE_EQ(out_size, in_size);
ATF_REQUIRE_EQ(memcmp(in_binary, out_binary, out_size), 0);
 
@@ -1069,7 +1069,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_bool)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   cnvlist_free_bool(nvl, cookie);
+   cnvlist_free_bool(cookie);
 
cookie = NULL;
ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
@@ -1112,7 +1112,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_number)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   cnvlist_free_number(nvl, cookie);
+   cnvlist_free_number(cookie);
 
cookie = NULL;
ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
@@ -1155,7 +1155,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_string)
 
cookie = NULL;
ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, , )), 0);
-   cnvlist_free_string(nvl, cookie);
+   cnvlist_free_string(cookie);
 
cookie = NULL;
ATF_REQUIRE_EQ(nvlist_error(nvl), 0);
@@ -1215,7 +1215,7 @@ 

svn commit: r335342 - in head: share/man/man9 sys/contrib/libnv sys/sys

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 21:23:40 2018
New Revision: 335342
URL: https://svnweb.freebsd.org/changeset/base/335342

Log:
  libnv: add const to cookies arguments
  
  Pointed out by:   pjd@

Modified:
  head/share/man/man9/cnv.9
  head/sys/contrib/libnv/cnvlist.c
  head/sys/sys/cnv.h

Modified: head/share/man/man9/cnv.9
==
--- head/share/man/man9/cnv.9   Mon Jun 18 21:18:20 2018(r335341)
+++ head/share/man/man9/cnv.9   Mon Jun 18 21:23:40 2018(r335342)
@@ -38,32 +38,32 @@
 .Sh SYNOPSIS
 .In sys/cnv.h
 .Ft const char *
-.Fn cnvlist_name "void *cookie"
+.Fn cnvlist_name "const void *cookie"
 .Ft int
-.Fn cnvlist_type "void *cookie"
+.Fn cnvlist_type "const void *cookie"
 .\"
 .Ft bool
-.Fn cnvlist_get_bool "void *cookie"
+.Fn cnvlist_get_bool "const void *cookie"
 .Ft uint64_t
-.Fn cnvlist_get_number "void *cookie"
+.Fn cnvlist_get_number "const void *cookie"
 .Ft "const char *"
-.Fn cnvlist_get_string "void *cookie"
+.Fn cnvlist_get_string "const void *cookie"
 .Ft "const nvlist_t *"
-.Fn cnvlist_get_nvlist "void *cookie"
+.Fn cnvlist_get_nvlist "const void *cookie"
 .Ft "const void *"
-.Fn cnvlist_get_binary "void *cookie" "size_t *sizep"
+.Fn cnvlist_get_binary "const void *cookie" "size_t *sizep"
 .Ft "const bool *"
-.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_bool_array "const void *cookie" "size_t *nitemsp"
 .Ft "const uint64_t *"
-.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_number_array "const void *cookie" "size_t *nitemsp"
 .Ft "const char * const *"
-.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_string_array "const void *cookie" "size_t *nitemsp"
 .Ft "const nvlist_t * const *"
-.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_nvlist_array "const void *cookie" "size_t *nitemsp"
 .Ft int
-.Fn cnvlist_get_descriptor "void *cookie"
+.Fn cnvlist_get_descriptor "const void *cookie"
 .Ft "const int *"
-.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp"
+.Fn cnvlist_get_descriptor_array "const void *cookie" "size_t *nitemsp"
 .\"
 .Ft bool
 .Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie"

Modified: head/sys/contrib/libnv/cnvlist.c
==
--- head/sys/contrib/libnv/cnvlist.cMon Jun 18 21:18:20 2018
(r335341)
+++ head/sys/contrib/libnv/cnvlist.cMon Jun 18 21:23:40 2018
(r335342)
@@ -56,14 +56,14 @@ __FBSDID("$FreeBSD$");
 #include "nvpair_impl.h"
 
 const char *
-cnvlist_name(void *cookie)
+cnvlist_name(const void *cookie)
 {
 
return (nvpair_name(cookie));
 }
 
 int
-cnvlist_type(void *cookie)
+cnvlist_type(const void *cookie)
 {
 
return (nvpair_type(cookie));
@@ -71,7 +71,7 @@ cnvlist_type(void *cookie)
 
 #defineCNVLIST_GET(ftype, type, NVTYPE)
\
 ftype  \
-cnvlist_get_##type(void *cookie)   \
+cnvlist_get_##type(const void *cookie) \
 {  \
\
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {  \
@@ -93,7 +93,7 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR)
 
 #defineCNVLIST_GET_ARRAY(ftype, type, NVTYPE)  
\
 ftype  \
-cnvlist_get_##type(void *cookie, size_t *nitemsp)  \
+cnvlist_get_##type(const void *cookie, size_t *nitemsp)
\
 {  \
\
if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) {  \
@@ -114,7 +114,7 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCR
 #undef CNVLIST_GET_ARRAY
 
 const void *
-cnvlist_get_binary(void *cookie, size_t *sizep)
+cnvlist_get_binary(const void *cookie, size_t *sizep)
 {
 
if (nvpair_type(cookie) != NV_TYPE_BINARY)

Modified: head/sys/sys/cnv.h
==
--- head/sys/sys/cnv.h  Mon Jun 18 21:18:20 2018(r335341)
+++ head/sys/sys/cnv.h  Mon Jun 18 21:23:40 2018(r335342)
@@ -52,8 +52,8 @@ __BEGIN_DECLS
 /*
  * Functions which returns information about the given cookie.
  */
-const char *cnvlist_name(void *cookie);
-int cnvlist_type(void *cookie);
+const char *cnvlist_name(const void *cookie);
+int cnvlist_type(const void *cookie);
 
 /*
  * The cnvlist_get functions returns value associated with the given cookie.
@@ -61,18 +61,18 @@ int  cnvlist_type(void 

svn commit: r335341 - in head: share/man/man9 sys/contrib/libnv sys/sys

2018-06-18 Thread Mariusz Zaborski
Author: oshogbo
Date: Mon Jun 18 21:18:20 2018
New Revision: 335341
URL: https://svnweb.freebsd.org/changeset/base/335341

Log:
  libnv: change name of cookie from cookiep to cookie.
  
  The name was inconsistent with rest of the library.
  No functional change intended.
  
  Pointed out by:   pjd@

Modified:
  head/share/man/man9/cnv.9
  head/sys/contrib/libnv/cnvlist.c
  head/sys/sys/cnv.h

Modified: head/share/man/man9/cnv.9
==
--- head/share/man/man9/cnv.9   Mon Jun 18 20:42:53 2018(r335340)
+++ head/share/man/man9/cnv.9   Mon Jun 18 21:18:20 2018(r335341)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 18, 2018
+.Dd June 18, 2018
 .Dt CNV 9
 .Os
 .Sh NAME
@@ -38,80 +38,80 @@
 .Sh SYNOPSIS
 .In sys/cnv.h
 .Ft const char *
-.Fn cnvlist_name "void *cookiep"
+.Fn cnvlist_name "void *cookie"
 .Ft int
-.Fn cnvlist_type "void *cookiep"
+.Fn cnvlist_type "void *cookie"
 .\"
 .Ft bool
-.Fn cnvlist_get_bool "void *cookiep"
+.Fn cnvlist_get_bool "void *cookie"
 .Ft uint64_t
-.Fn cnvlist_get_number "void *cookiep"
+.Fn cnvlist_get_number "void *cookie"
 .Ft "const char *"
-.Fn cnvlist_get_string "void *cookiep"
+.Fn cnvlist_get_string "void *cookie"
 .Ft "const nvlist_t *"
-.Fn cnvlist_get_nvlist "void *cookiep"
+.Fn cnvlist_get_nvlist "void *cookie"
 .Ft "const void *"
-.Fn cnvlist_get_binary "void *cookiep" "size_t *sizep"
+.Fn cnvlist_get_binary "void *cookie" "size_t *sizep"
 .Ft "const bool *"
-.Fn cnvlist_get_bool_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp"
 .Ft "const uint64_t *"
-.Fn cnvlist_get_number_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp"
 .Ft "const char * const *"
-.Fn cnvlist_get_string_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp"
 .Ft "const nvlist_t * const *"
-.Fn cnvlist_get_nvlist_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp"
 .Ft int
-.Fn cnvlist_get_descriptor "void *cookiep"
+.Fn cnvlist_get_descriptor "void *cookie"
 .Ft "const int *"
-.Fn cnvlist_get_descriptor_array "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp"
 .\"
 .Ft bool
-.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie"
 .Ft uint64_t
-.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookie"
 .Ft "const char *"
-.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookie"
 .Ft "const nvlist_t *"
-.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookie"
 .Ft "const void *"
-.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookiep" "size_t *sizep"
+.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookie" "size_t *sizep"
 .Ft "const bool *"
-.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const uint64_t *"
-.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const char * const *"
-.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft "const nvlist_t * const *"
-.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp"
+.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp"
 .Ft int
-.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookie"
 .Ft "const int *"
-.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookiep" "size_t 
*nitemsp"
+.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookie" "size_t 
*nitemsp"
 .\"
 .Ft void
-.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookiep"
+.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookie"
 .Ft void
-.Fn 

svn commit: r335339 - head/sys/dev/ixl

2018-06-18 Thread Eric Joyner
Author: erj
Date: Mon Jun 18 20:32:53 2018
New Revision: 335339
URL: https://svnweb.freebsd.org/changeset/base/335339

Log:
  ixl(4): Update version number to 2.0.0-k
  
  And update copyrights to current year.
  
  MFC after:1 month
  Sponsored by: Intel Corporation

Modified:
  head/sys/dev/ixl/i40e_adminq.c
  head/sys/dev/ixl/i40e_adminq.h
  head/sys/dev/ixl/i40e_adminq_cmd.h
  head/sys/dev/ixl/i40e_alloc.h
  head/sys/dev/ixl/i40e_common.c
  head/sys/dev/ixl/i40e_dcb.c
  head/sys/dev/ixl/i40e_dcb.h
  head/sys/dev/ixl/i40e_devids.h
  head/sys/dev/ixl/i40e_hmc.c
  head/sys/dev/ixl/i40e_hmc.h
  head/sys/dev/ixl/i40e_lan_hmc.c
  head/sys/dev/ixl/i40e_lan_hmc.h
  head/sys/dev/ixl/i40e_nvm.c
  head/sys/dev/ixl/i40e_osdep.c
  head/sys/dev/ixl/i40e_osdep.h
  head/sys/dev/ixl/i40e_prototype.h
  head/sys/dev/ixl/i40e_register.h
  head/sys/dev/ixl/i40e_status.h
  head/sys/dev/ixl/i40e_type.h
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_debug.h
  head/sys/dev/ixl/ixl_iw.c
  head/sys/dev/ixl/ixl_iw.h
  head/sys/dev/ixl/ixl_iw_int.h
  head/sys/dev/ixl/ixl_pf.h
  head/sys/dev/ixl/ixl_pf_i2c.c
  head/sys/dev/ixl/ixl_pf_iov.c
  head/sys/dev/ixl/ixl_pf_iov.h
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixl_pf_qmgr.c
  head/sys/dev/ixl/ixl_pf_qmgr.h
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/ixl/ixlv.h
  head/sys/dev/ixl/ixlv_vc_mgr.h
  head/sys/dev/ixl/ixlvc.c
  head/sys/dev/ixl/virtchnl.h

Modified: head/sys/dev/ixl/i40e_adminq.c
==
--- head/sys/dev/ixl/i40e_adminq.c  Mon Jun 18 20:12:54 2018
(r335338)
+++ head/sys/dev/ixl/i40e_adminq.c  Mon Jun 18 20:32:53 2018
(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation
+  Copyright (c) 2013-2018, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_adminq.h
==
--- head/sys/dev/ixl/i40e_adminq.h  Mon Jun 18 20:12:54 2018
(r335338)
+++ head/sys/dev/ixl/i40e_adminq.h  Mon Jun 18 20:32:53 2018
(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation
+  Copyright (c) 2013-2018, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_adminq_cmd.h
==
--- head/sys/dev/ixl/i40e_adminq_cmd.h  Mon Jun 18 20:12:54 2018
(r335338)
+++ head/sys/dev/ixl/i40e_adminq_cmd.h  Mon Jun 18 20:32:53 2018
(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation
+  Copyright (c) 2013-2018, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_alloc.h
==
--- head/sys/dev/ixl/i40e_alloc.h   Mon Jun 18 20:12:54 2018
(r335338)
+++ head/sys/dev/ixl/i40e_alloc.h   Mon Jun 18 20:32:53 2018
(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation
+  Copyright (c) 2013-2018, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_common.c
==
--- head/sys/dev/ixl/i40e_common.c  Mon Jun 18 20:12:54 2018
(r335338)
+++ head/sys/dev/ixl/i40e_common.c  Mon Jun 18 20:32:53 2018
(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation
+  Copyright (c) 2013-2018, Intel Corporation
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_dcb.c
==
--- head/sys/dev/ixl/i40e_dcb.c Mon Jun 18 20:12:54 2018(r335338)
+++ head/sys/dev/ixl/i40e_dcb.c Mon Jun 18 20:32:53 2018(r335339)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2013-2017, Intel Corporation 
+  Copyright (c) 2013-2018, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 

Modified: head/sys/dev/ixl/i40e_dcb.h

svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv

2018-06-18 Thread Eric Joyner
Author: erj
Date: Mon Jun 18 20:12:54 2018
New Revision: 335338
URL: https://svnweb.freebsd.org/changeset/base/335338

Log:
  ixl(4): Update to use iflib
  
  Update the driver to use iflib in order to bring performance,
  maintainability, and (hopefully) stability benefits to the driver.
  
  The driver currently isn't completely ported; features that are missing:
  
  - VF driver (ixlv)
  - SR-IOV host support
  - RDMA support
  
  The plan is to have these re-added to the driver before the next FreeBSD 
release.
  
  Reviewed by:  gallatin@
  Contributions by: gallatin@, mmacy@, krzysztof.gala...@intel.com
  Tested by:jeffrey.e.pie...@intel.com
  MFC after:1 month
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D15577

Added:
  head/sys/dev/ixl/ixl_debug.h   (contents, props changed)
Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/conf/files.amd64
  head/sys/dev/ixl/i40e_osdep.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/ixl/if_ixlv.c
  head/sys/dev/ixl/ixl.h
  head/sys/dev/ixl/ixl_pf.h
  head/sys/dev/ixl/ixl_pf_i2c.c
  head/sys/dev/ixl/ixl_pf_iov.c
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/ixl/ixl_pf_qmgr.c
  head/sys/dev/ixl/ixl_txrx.c
  head/sys/dev/ixl/ixlv.h
  head/sys/dev/ixl/ixlvc.c
  head/sys/modules/Makefile
  head/sys/modules/ixl/Makefile
  head/sys/modules/ixlv/Makefile

Modified: head/sys/amd64/conf/GENERIC
==
--- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018(r335337)
+++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018(r335338)
@@ -240,8 +240,8 @@ device  em  # Intel 
PRO/1000 Gigabit Ethernet Family
 device ix  # Intel PRO/10GbE PCIE PF Ethernet
 device ixv # Intel PRO/10GbE PCIE VF Ethernet
 device ixl # Intel XL710 40Gbe PCIE Ethernet
-optionsIXL_IW  # Enable iWARP Client Interface 
in ixl(4)
-device ixlv# Intel XL710 40Gbe VF PCIE Ethernet
+#options   IXL_IW  # Enable iWARP Client Interface 
in ixl(4)
+#deviceixlv# Intel XL710 40Gbe VF PCIE 
Ethernet
 device le  # AMD Am7900 LANCE and Am79C9xx PCnet
 device ti  # Alteon Networks Tigon I/II gigabit 
Ethernet
 device txp # 3Com 3cR990 (``Typhoon'')

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Mon Jun 18 19:53:11 2018(r335337)
+++ head/sys/conf/files.amd64   Mon Jun 18 20:12:54 2018(r335338)
@@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c  optionalixl pci 
 pci_iov \
compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixl_pf_i2c.c   optionalixl pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/ixl_iw.c   optionalixl pci \
-   compile-with "${NORMAL_C} -I$S/dev/ixl"
-dev/ixl/if_ixlv.c  optionalixlv pci \
-   compile-with "${NORMAL_C} -I$S/dev/ixl"
+#dev/ixl/ixl_iw.c  optionalixl pci \
+#  compile-with "${NORMAL_C} -I$S/dev/ixl"
+#dev/ixl/if_ixlv.c optionalixlv pci \
+#  compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixlvc.coptionalixlv pci \
compile-with "${NORMAL_C} -I$S/dev/ixl"
 dev/ixl/ixl_txrx.c optionalixl pci | ixlv pci \

Modified: head/sys/dev/ixl/i40e_osdep.c
==
--- head/sys/dev/ixl/i40e_osdep.c   Mon Jun 18 19:53:11 2018
(r335337)
+++ head/sys/dev/ixl/i40e_osdep.c   Mon Jun 18 20:12:54 2018
(r335338)
@@ -132,7 +132,7 @@ i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_
bus_dmamap_unload(mem->tag, mem->map);
bus_dmamem_free(mem->tag, mem->va, mem->map);
bus_dma_tag_destroy(mem->tag);
-   return (0);
+   return (I40E_SUCCESS);
 }
 
 void

Modified: head/sys/dev/ixl/if_ixl.c
==
--- head/sys/dev/ixl/if_ixl.c   Mon Jun 18 19:53:11 2018(r335337)
+++ head/sys/dev/ixl/if_ixl.c   Mon Jun 18 20:12:54 2018(r335338)
@@ -51,60 +51,79 @@
 #define IXL_DRIVER_VERSION_MINOR   9
 #define IXL_DRIVER_VERSION_BUILD   9
 
-char ixl_driver_version[] = __XSTRING(IXL_DRIVER_VERSION_MAJOR) "."
-   __XSTRING(IXL_DRIVER_VERSION_MINOR) "."
-   __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k";
+#define IXL_DRIVER_VERSION_STRING  \
+__XSTRING(IXL_DRIVER_VERSION_MAJOR) "."\
+__XSTRING(IXL_DRIVER_VERSION_MINOR) "."\
+

svn commit: r335337 - head/stand/libsa

2018-06-18 Thread Warner Losh
Author: imp
Date: Mon Jun 18 19:53:11 2018
New Revision: 335337
URL: https://svnweb.freebsd.org/changeset/base/335337

Log:
  Remove stray debugging line.
  
  Noticed by: ian@

Modified:
  head/stand/libsa/Makefile

Modified: head/stand/libsa/Makefile
==
--- head/stand/libsa/Makefile   Mon Jun 18 19:40:21 2018(r335336)
+++ head/stand/libsa/Makefile   Mon Jun 18 19:53:11 2018(r335337)
@@ -103,7 +103,6 @@ STAND_H_INC=ctype.h fcntl.h signal.h stdio.h stdlib.h
 OTHER_INC=stdarg.h errno.h stdint.h
 
 beforedepend:
-   echo beforedepend; \
mkdir -p ${FAKE_DIRS}; \
for i in ${SAFE_INCS}; do \
ln -sf ${SRCTOP}/include/$$i $$i; \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335336 - head/stand/geli

2018-06-18 Thread Warner Losh
Author: imp
Date: Mon Jun 18 19:40:21 2018
New Revision: 335336
URL: https://svnweb.freebsd.org/changeset/base/335336

Log:
  Remove now-empty geli directory

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


svn commit: r335333 - head/sys/arm64/linux

2018-06-18 Thread Ed Maste
Author: emaste
Date: Mon Jun 18 19:34:34 2018
New Revision: 335333
URL: https://svnweb.freebsd.org/changeset/base/335333

Log:
  Introduce arm64 linuxulator stubs
  
  This provides stub implementations of arm64 Linux vdso and machdep,
  ptrace, and futex sufficient for executing an arm64 Linux 'hello world'
  binary.
  
  Reviewed by:  andrew
  Sponsored by: Turing Robotic Industries
  Differential Revision:https://reviews.freebsd.org/D15832

Added:
  head/sys/arm64/linux/linux_locore.s   (contents, props changed)
  head/sys/arm64/linux/linux_machdep.c   (contents, props changed)
  head/sys/arm64/linux/linux_ptrace.c   (contents, props changed)
  head/sys/arm64/linux/linux_support.s   (contents, props changed)

Added: head/sys/arm64/linux/linux_locore.s
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/linux/linux_locore.s Mon Jun 18 19:34:34 2018
(r335333)
@@ -0,0 +1,58 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (C) 2018 Turing Robotic Industries Inc.
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * arm64 Linux VDSO implementation.
+ */
+
+#include 
+
+   .data
+
+   .globl linux_platform
+linux_platform:
+   .asciz "arm64"
+
+   .text
+
+ENTRY(__kernel_rt_sigreturn)
+   brk #0 /* LINUXTODO: implement __kernel_rt_sigreturn */
+   ret
+
+ENTRY(__kernel_gettimeofday)
+   brk #0 /* LINUXTODO: implement __kernel_gettimeofday */
+   ret
+
+ENTRY(__kernel_clock_gettime)
+   brk #0 /* LINUXTODO: implement __kernel_clock_gettime */
+   ret
+
+ENTRY(__kernel_clock_getres)
+   brk #0 /* LINUXTODO: implement __kernel_clock_getres */
+   ret

Added: head/sys/arm64/linux/linux_machdep.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/arm64/linux/linux_machdep.cMon Jun 18 19:34:34 2018
(r335333)
@@ -0,0 +1,132 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2018 Turing Robotic Industries Inc.
+ * Copyright (c) 2000 Marcel Moolenaar
+ *
+ * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 

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

2018-06-18 Thread Ed Maste
Author: emaste
Date: Mon Jun 18 18:43:45 2018
New Revision: 335327
URL: https://svnweb.freebsd.org/changeset/base/335327

Log:
  linuxulator: add debugging for invalid capget/capset version
  
  Sponsored by: Turing Robotic Industries Inc.

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

Modified: head/sys/compat/linux/linux_misc.c
==
--- head/sys/compat/linux/linux_misc.c  Mon Jun 18 18:38:58 2018
(r335326)
+++ head/sys/compat/linux/linux_misc.c  Mon Jun 18 18:43:45 2018
(r335327)
@@ -1895,6 +1895,11 @@ linux_capget(struct thread *td, struct linux_capget_ar
return (error);
 
if (luch.version != _LINUX_CAPABILITY_VERSION) {
+#ifdef DEBUG
+   if (ldebug(capget))
+   printf(LMSG("invalid capget capability version 0x%x"),
+   luch.version);
+#endif
luch.version = _LINUX_CAPABILITY_VERSION;
error = copyout(, args->hdrp, sizeof(luch));
if (error)
@@ -1934,6 +1939,11 @@ linux_capset(struct thread *td, struct linux_capset_ar
return (error);
 
if (luch.version != _LINUX_CAPABILITY_VERSION) {
+#ifdef DEBUG
+   if (ldebug(capset))
+   printf(LMSG("invalid capset capability version 0x%x"),
+   luch.version);
+#endif
luch.version = _LINUX_CAPABILITY_VERSION;
error = copyout(, args->hdrp, sizeof(luch));
if (error)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335325 - head/cddl/lib/libdtrace

2018-06-18 Thread Michael Tuexen
Author: tuexen
Date: Mon Jun 18 18:35:29 2018
New Revision: 335325
URL: https://svnweb.freebsd.org/changeset/base/335325

Log:
  The IP, TCP, and UDP provider report IP addresses as strings.
  In some cases, the required information is not available and the
  UDP provider reported an empty string in this case and the IP
  and TCP provider reported a NULL pointer.
  
  This patch changes the value provided in this case to the string
  "". This make the behaviour consistent and in-line with
  the behaviour of Solaris.
  
  Reviewed by:  markj@, dteske@, gnn@
  Differential Revision:https://reviews.freebsd.org/D15855

Modified:
  head/cddl/lib/libdtrace/ip.d
  head/cddl/lib/libdtrace/tcp.d
  head/cddl/lib/libdtrace/udp.d

Modified: head/cddl/lib/libdtrace/ip.d
==
--- head/cddl/lib/libdtrace/ip.dMon Jun 18 18:10:11 2018
(r335324)
+++ head/cddl/lib/libdtrace/ip.dMon Jun 18 18:35:29 2018
(r335325)
@@ -228,11 +228,11 @@ translator ipinfo_t < uint8_t *p > {
((struct ip *)p)->ip_v == 4 ?
ntohs(((struct ip *)p)->ip_len) - (((struct ip *)p)->ip_hl << 2):
ntohs(((struct ip6_hdr *)p)->ip6_ctlun.ip6_un1.ip6_un1_plen);
-   ip_saddr =  p == NULL ? 0 :
+   ip_saddr =  p == NULL ? "" :
((struct ip *)p)->ip_v == 4 ?
inet_ntoa(&((struct ip *)p)->ip_src.s_addr) :
inet_ntoa6(&((struct ip6_hdr *)p)->ip6_src);
-   ip_daddr =  p == NULL ? 0 :
+   ip_daddr =  p == NULL ? "" :
((struct ip *)p)->ip_v == 4 ?
inet_ntoa(&((struct ip *)p)->ip_dst.s_addr) :
inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst);
@@ -246,11 +246,11 @@ translator ipinfo_t < struct mbuf *m > {
ntohs(((struct ip *)m->m_data)->ip_len) - 
(((struct ip *)m->m_data)->ip_hl << 2):
ntohs(((struct ip6_hdr 
*)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen);
-   ip_saddr =  m == NULL ? 0 :
+   ip_saddr =  m == NULL ? "" :
((struct ip *)m->m_data)->ip_v == 4 ?
inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) :
inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src);
-   ip_daddr =  m == NULL ? 0 :
+   ip_daddr =  m == NULL ? "" :
((struct ip *)m->m_data)->ip_v == 4 ?
inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) :
inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst);

Modified: head/cddl/lib/libdtrace/tcp.d
==
--- head/cddl/lib/libdtrace/tcp.d   Mon Jun 18 18:10:11 2018
(r335324)
+++ head/cddl/lib/libdtrace/tcp.d   Mon Jun 18 18:35:29 2018
(r335325)
@@ -190,11 +190,11 @@ translator tcpsinfo_t < struct tcpcb *p > {
tcps_active =   -1; /* XXX */
tcps_lport =p == NULL ? 0 : 
ntohs(p->t_inpcb->inp_inc.inc_ie.ie_lport);
tcps_rport =p == NULL ? 0 : 
ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport);
-   tcps_laddr =p == NULL ? 0 :
+   tcps_laddr =p == NULL ? "" :
p->t_inpcb->inp_vflag == INP_IPV4 ?

inet_ntoa(>t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr)
 :
inet_ntoa6(>t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr);
-   tcps_raddr =p == NULL ? 0 :
+   tcps_raddr =p == NULL ? "" :
p->t_inpcb->inp_vflag == INP_IPV4 ?

inet_ntoa(>t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr)
 :
inet_ntoa6(>t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr);

Modified: head/cddl/lib/libdtrace/udp.d
==
--- head/cddl/lib/libdtrace/udp.d   Mon Jun 18 18:10:11 2018
(r335324)
+++ head/cddl/lib/libdtrace/udp.d   Mon Jun 18 18:35:29 2018
(r335325)
@@ -56,11 +56,11 @@ translator udpsinfo_t < struct inpcb *p > {
udps_addr = (uintptr_t)p;
udps_lport =p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport);
udps_rport =p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_fport);
-   udps_laddr =p == NULL ? "" :
+   udps_laddr =p == NULL ? "" :
p->inp_vflag == INP_IPV4 ?

inet_ntoa(>inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) :
inet_ntoa6(>inp_inc.inc_ie.ie_dependladdr.id6_addr);
-   udps_raddr =p == NULL ? "" :
+   udps_raddr =p == NULL ? "" :
p->inp_vflag == INP_IPV4 ?

inet_ntoa(>inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) :
inet_ntoa6(>inp_inc.inc_ie.ie_dependfaddr.id6_addr);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, 

svn commit: r335324 - head/sys/arm64/linux

2018-06-18 Thread Ed Maste
Author: emaste
Date: Mon Jun 18 18:10:11 2018
New Revision: 335324
URL: https://svnweb.freebsd.org/changeset/base/335324

Log:
  Regen arm64 linuxulator sysent files after r335323

Modified:
  head/sys/arm64/linux/linux_syscall.h
  head/sys/arm64/linux/linux_syscalls.c
  head/sys/arm64/linux/linux_sysent.c
  head/sys/arm64/linux/linux_systrace_args.c

Modified: head/sys/arm64/linux/linux_syscall.h
==
--- head/sys/arm64/linux/linux_syscall.hMon Jun 18 18:08:19 2018
(r335323)
+++ head/sys/arm64/linux/linux_syscall.hMon Jun 18 18:10:11 2018
(r335324)
@@ -23,6 +23,7 @@
 #defineLINUX_SYS_linux_epoll_create1   20
 #defineLINUX_SYS_linux_epoll_ctl   21
 #defineLINUX_SYS_linux_epoll_pwait 22
+#defineLINUX_SYS_dup   23
 #defineLINUX_SYS_linux_dup324
 #defineLINUX_SYS_linux_fcntl   25
 #defineLINUX_SYS_linux_inotify_init1   26

Modified: head/sys/arm64/linux/linux_syscalls.c
==
--- head/sys/arm64/linux/linux_syscalls.c   Mon Jun 18 18:08:19 2018
(r335323)
+++ head/sys/arm64/linux/linux_syscalls.c   Mon Jun 18 18:10:11 2018
(r335324)
@@ -30,7 +30,7 @@ const char *linux_syscallnames[] = {
"linux_epoll_create1",  /* 20 = linux_epoll_create1 */
"linux_epoll_ctl",  /* 21 = linux_epoll_ctl */
"linux_epoll_pwait",/* 22 = linux_epoll_pwait */
-   "#23",  /* 23 = linux_dup */
+   "dup",  /* 23 = dup */
"linux_dup3",   /* 24 = linux_dup3 */
"linux_fcntl",  /* 25 = linux_fcntl */
"linux_inotify_init1",  /* 26 = linux_inotify_init1 */

Modified: head/sys/arm64/linux/linux_sysent.c
==
--- head/sys/arm64/linux/linux_sysent.c Mon Jun 18 18:08:19 2018
(r335323)
+++ head/sys/arm64/linux/linux_sysent.c Mon Jun 18 18:10:11 2018
(r335324)
@@ -40,7 +40,7 @@ struct sysent linux_sysent[] = {
{ AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = linux_epoll_create1 */
{ AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, 
NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = linux_epoll_ctl */
{ AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, 
NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = linux_epoll_pwait */
-   { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },  
/* 23 = linux_dup */
+   { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, 
SY_THR_STATIC },  /* 23 = dup */
{ AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 
0, SY_THR_STATIC },   /* 24 = linux_dup3 */
{ AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 
0, 0, SY_THR_STATIC },/* 25 = linux_fcntl */
{ AS(linux_inotify_init1_args), (sy_call_t *)linux_inotify_init1, 
AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = linux_inotify_init1 */

Modified: head/sys/arm64/linux/linux_systrace_args.c
==
--- head/sys/arm64/linux/linux_systrace_args.c  Mon Jun 18 18:08:19 2018
(r335323)
+++ head/sys/arm64/linux/linux_systrace_args.c  Mon Jun 18 18:10:11 2018
(r335324)
@@ -122,6 +122,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg
*n_args = 6;
break;
}
+   /* dup */
+   case 23: {
+   struct dup_args *p = params;
+   uarg[0] = p->fd; /* u_int */
+   *n_args = 1;
+   break;
+   }
/* linux_dup3 */
case 24: {
struct linux_dup3_args *p = params;
@@ -2234,6 +2241,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d
break;
};
break;
+   /* dup */
+   case 23:
+   switch(ndx) {
+   case 0:
+   p = "u_int";
+   break;
+   default:
+   break;
+   };
+   break;
/* linux_dup3 */
case 24:
switch(ndx) {
@@ -5496,6 +5513,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char *
break;
/* linux_epoll_pwait */
case 22:
+   if (ndx == 0 || ndx == 1)
+   p = "int";
+   break;
+   /* dup */
+   case 23:
if (ndx == 0 || ndx == 1)
p = "int";
break;
___
svn-src-head@freebsd.org mailing list

svn commit: r335323 - head/sys/arm64/linux

2018-06-18 Thread Ed Maste
Author: emaste
Date: Mon Jun 18 18:08:19 2018
New Revision: 335323
URL: https://svnweb.freebsd.org/changeset/base/335323

Log:
  arm64 linuxulator: add dup syscall entry
  
  Missed in r333027
  
  Sponsored by: Turing Robotic Industries Inc.

Modified:
  head/sys/arm64/linux/syscalls.master

Modified: head/sys/arm64/linux/syscalls.master
==
--- head/sys/arm64/linux/syscalls.masterMon Jun 18 17:27:43 2018
(r335322)
+++ head/sys/arm64/linux/syscalls.masterMon Jun 18 18:08:19 2018
(r335323)
@@ -42,7 +42,7 @@
struct epoll_event *events, \
l_int maxevents, l_int timeout, \
l_sigset_t *mask, l_size_t sigsetsize); }
-23 AUE_NULLUNIMPL  linux_dup
+23 AUE_DUP NOPROTO { int dup(u_int fd); }
 24 AUE_NULLSTD { int linux_dup3(l_int oldfd, l_int newfd, \
l_int flags); }
 25 AUE_FCNTL   STD { int linux_fcntl(l_uint fd, l_uint cmd, \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r335278 - head/bin/pwd

2018-06-18 Thread John Baldwin
On 6/16/18 10:14 PM, Eitan Adler wrote:
> Author: eadler
> Date: Sun Jun 17 05:14:50 2018
> New Revision: 335278
> URL: https://svnweb.freebsd.org/changeset/base/335278
> 
> Log:
>   pwd: mark usage as dead

You keep committing changes like this and ignoring e-mails about them.
What broken compiler are you using that doesn't properly inherit __dead2
from the call to exit()?

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


svn commit: r335322 - head/sys/net

2018-06-18 Thread Eric Joyner
Author: erj
Date: Mon Jun 18 17:27:43 2018
New Revision: 335322
URL: https://svnweb.freebsd.org/changeset/base/335322

Log:
  iflib: Style fixes
  
  MFC after:1 week

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Jun 18 16:24:42 2018(r335321)
+++ head/sys/net/iflib.cMon Jun 18 17:27:43 2018(r335322)
@@ -2275,7 +2275,7 @@ iflib_init_locked(if_ctx_t ctx)
}
}
}
-   done:
+done:
if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE);
IFDI_INTR_ENABLE(ctx);
txq = ctx->ifc_txqs;
@@ -4014,7 +4014,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
*/
if (avoid_reset) {
if_setflagbits(ifp, IFF_UP,0);
-   if (!(if_getdrvflags(ifp)& IFF_DRV_RUNNING))
+   if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))
reinit = 1;
 #ifdef INET
if (!(if_getflags(ifp) & IFF_NOARP))
@@ -4115,7 +4115,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
 #endif
setmask |= (mask & IFCAP_FLAGS);
 
-   if (setmask  & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
+   if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
if ((mask & IFCAP_WOL) &&
(if_getcapabilities(ifp) & IFCAP_WOL) != 0)
@@ -4140,7 +4140,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
CTX_UNLOCK(ctx);
}
break;
-   }
+   }
case SIOCGPRIVATE_0:
case SIOCSDRVSPEC:
case SIOCGDRVSPEC:
@@ -5097,7 +5097,7 @@ iflib_queues_alloc(if_ctx_t ctx)
KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1"));
KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1"));
 
-/* Allocate the TX ring struct memory */
+   /* Allocate the TX ring struct memory */
if (!(ctx->ifc_txqs =
(iflib_txq_t) malloc(sizeof(struct iflib_txq) *
ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335321 - in head/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli

2018-06-18 Thread Warner Losh
Author: imp
Date: Mon Jun 18 16:24:42 2018
New Revision: 335321
URL: https://svnweb.freebsd.org/changeset/base/335321

Log:
  stand: move libgeliboot into libsa.
  
  Reduce by 1 the number of crazy libraries we need in stand by moving
  geli into libsa (where architecturally it belonged all along). This
  just moves things around without any code changes.

Added:
  head/stand/libsa/geli/
  head/stand/libsa/geli/Makefile.inc   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/Makefile
  head/stand/libsa/geli/geliboot.c   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/geliboot.c
  head/stand/libsa/geli/geliboot.h   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/geliboot.h
  head/stand/libsa/geli/geliboot_crypto.c   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/geliboot_crypto.c
  head/stand/libsa/geli/geliboot_internal.h   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/geliboot_internal.h
  head/stand/libsa/geli/pwgets.c   (contents, props changed)
 - copied, changed from r335320, head/stand/geli/pwgets.c
Deleted:
  head/stand/geli/Makefile
  head/stand/geli/Makefile.depend
  head/stand/geli/geliboot.c
  head/stand/geli/geliboot.h
  head/stand/geli/geliboot_crypto.c
  head/stand/geli/geliboot_internal.h
  head/stand/geli/pwgets.c
Modified:
  head/stand/Makefile
  head/stand/defs.mk
  head/stand/i386/gptboot/Makefile
  head/stand/i386/gptzfsboot/Makefile
  head/stand/i386/isoboot/Makefile
  head/stand/i386/loader/Makefile
  head/stand/i386/zfsboot/Makefile
  head/stand/libsa/Makefile

Modified: head/stand/Makefile
==
--- head/stand/Makefile Mon Jun 18 15:37:43 2018(r335320)
+++ head/stand/Makefile Mon Jun 18 16:24:42 2018(r335321)
@@ -21,8 +21,6 @@ S.${MK_ZFS}+= zfs
 S.yes+=defaults
 S.yes+=man
 
-S.${MK_LOADER_GELI}+=  geli
-
 .include 
 
 S.${MK_EFI}+=  efi

Modified: head/stand/defs.mk
==
--- head/stand/defs.mk  Mon Jun 18 15:37:43 2018(r335320)
+++ head/stand/defs.mk  Mon Jun 18 16:24:42 2018(r335321)
@@ -67,8 +67,7 @@ MK_LOADER_GELI=yes
 .endif
 .if ${MK_LOADER_GELI} == "yes"
 CFLAGS+=   -DLOADER_GELI_SUPPORT
-CFLAGS+=   -I${BOOTSRC}/geli
-LIBGELIBOOT=   ${BOOTOBJ}/geli/libgeliboot.a
+CFLAGS+=   -I${SASRC}/geli
 .endif # MK_LOADER_GELI
 .endif # HAVE_GELI
 

Modified: head/stand/i386/gptboot/Makefile
==
--- head/stand/i386/gptboot/MakefileMon Jun 18 15:37:43 2018
(r335320)
+++ head/stand/i386/gptboot/MakefileMon Jun 18 16:24:42 2018
(r335321)
@@ -64,7 +64,7 @@ gptboot.bin: gptboot.out
${OBJCOPY} -S -O binary gptboot.out ${.TARGET}
 
 gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
-   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} 
${LIBGELIBOOT} ${LIBSA32}
+   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
 
 .include 
 

Modified: head/stand/i386/gptzfsboot/Makefile
==
--- head/stand/i386/gptzfsboot/Makefile Mon Jun 18 15:37:43 2018
(r335320)
+++ head/stand/i386/gptzfsboot/Makefile Mon Jun 18 16:24:42 2018
(r335321)
@@ -75,7 +75,7 @@ gptzfsboot.bin: gptzfsboot.out
 
 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
${OPENCRYPTO_XTS}
-   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} 
${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
+   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} 
${LIBSA32}
 
 zfsboot.o: ${ZFSSRC}/zfsimpl.c
 

Modified: head/stand/i386/isoboot/Makefile
==
--- head/stand/i386/isoboot/MakefileMon Jun 18 15:37:43 2018
(r335320)
+++ head/stand/i386/isoboot/MakefileMon Jun 18 16:24:42 2018
(r335321)
@@ -66,6 +66,6 @@ isoboot.bin: isoboot.out
${OBJCOPY} -S -O binary isoboot.out ${.TARGET}
 
 isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS}
-   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} 
${LIBGELIBOOT} ${LIBSA32}
+   ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
 
 .include 

Modified: head/stand/i386/loader/Makefile
==
--- head/stand/i386/loader/Makefile Mon Jun 18 15:37:43 2018
(r335320)
+++ head/stand/i386/loader/Makefile Mon Jun 18 16:24:42 2018
(r335321)
@@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b
 # XXX crt0.o needs to be first for pxeboot(8) to work
 OBJS=  

svn commit: r335320 - head/tests/sys/audit

2018-06-18 Thread Alan Somers
Author: asomers
Date: Mon Jun 18 15:37:43 2018
New Revision: 335320
URL: https://svnweb.freebsd.org/changeset/base/335320

Log:
  audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr
  
  Submitted by: aniketp
  MFC after:2 weeks
  Sponsored by: Google, Inc. (GSoC 2018)
  Differential Revision:https://reviews.freebsd.org/D15871

Modified:
  head/tests/sys/audit/administrative.c

Modified: head/tests/sys/audit/administrative.c
==
--- head/tests/sys/audit/administrative.c   Mon Jun 18 15:27:31 2018
(r335319)
+++ head/tests/sys/audit/administrative.c   Mon Jun 18 15:37:43 2018
(r335320)
@@ -39,7 +39,7 @@ static pid_t pid;
 static int filedesc;
 static mode_t mode = 0777;
 static struct pollfd fds[1];
-static char adregex[60];
+static char adregex[80];
 static const char *auclass = "ad";
 static const char *path = "fileforaudit";
 
@@ -200,6 +200,301 @@ ATF_TC_CLEANUP(nfs_getfh_failure, tc)
 }
 
 
+ATF_TC_WITH_CLEANUP(getauid_success);
+ATF_TC_HEAD(getauid_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "getauid(2) call");
+}
+
+ATF_TC_BODY(getauid_success, tc)
+{
+   au_id_t auid;
+   pid = getpid();
+   snprintf(adregex, sizeof(adregex), "getauid.*%d.*return,success", pid);
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE_EQ(0, getauid());
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(getauid_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(getauid_failure);
+ATF_TC_HEAD(getauid_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "getauid(2) call");
+}
+
+ATF_TC_BODY(getauid_failure, tc)
+{
+   pid = getpid();
+   snprintf(adregex, sizeof(adregex), "getauid.*%d.*return,failure", pid);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: Bad address */
+   ATF_REQUIRE_EQ(-1, getauid(NULL));
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(getauid_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(setauid_success);
+ATF_TC_HEAD(setauid_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "setauid(2) call");
+}
+
+ATF_TC_BODY(setauid_success, tc)
+{
+   au_id_t auid;
+   pid = getpid();
+   snprintf(adregex, sizeof(adregex), "setauid.*%d.*return,success", pid);
+   ATF_REQUIRE_EQ(0, getauid());
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE_EQ(0, setauid());
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(setauid_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(setauid_failure);
+ATF_TC_HEAD(setauid_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "setauid(2) call");
+}
+
+ATF_TC_BODY(setauid_failure, tc)
+{
+   pid = getpid();
+   snprintf(adregex, sizeof(adregex), "setauid.*%d.*return,failure", pid);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: Bad address */
+   ATF_REQUIRE_EQ(-1, setauid(NULL));
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(setauid_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(getaudit_success);
+ATF_TC_HEAD(getaudit_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "getaudit(2) call");
+}
+
+ATF_TC_BODY(getaudit_success, tc)
+{
+   pid = getpid();
+   auditinfo_t auditinfo;
+   snprintf(adregex, sizeof(adregex), "getaudit.*%d.*return,success", pid);
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE_EQ(0, getaudit());
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(getaudit_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(getaudit_failure);
+ATF_TC_HEAD(getaudit_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "getaudit(2) call");
+}
+
+ATF_TC_BODY(getaudit_failure, tc)
+{
+   pid = getpid();
+   snprintf(adregex, sizeof(adregex), "getaudit.*%d.*return,failure", pid);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: Bad address */
+   ATF_REQUIRE_EQ(-1, getaudit(NULL));
+   check_audit(fds, adregex, pipefd);
+}
+
+ATF_TC_CLEANUP(getaudit_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(setaudit_success);
+ATF_TC_HEAD(setaudit_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "setaudit(2) call");
+}
+
+ATF_TC_BODY(setaudit_success, tc)
+{
+   pid = getpid();
+   auditinfo_t auditinfo;
+   snprintf(adregex, sizeof(adregex), 

svn commit: r335319 - head/tests/sys/audit

2018-06-18 Thread Alan Somers
Author: asomers
Date: Mon Jun 18 15:27:31 2018
New Revision: 335319
URL: https://svnweb.freebsd.org/changeset/base/335319

Log:
  audit(4): add tests for send, recv, sendto, and recvfrom
  
  Submitted by: aniketp
  MFC after:2 weeks
  Sponsored by: Google, Inc. (GSoC 2018)
  Differential Revision:https://reviews.freebsd.org/D15869

Modified:
  head/tests/sys/audit/network.c

Modified: head/tests/sys/audit/network.c
==
--- head/tests/sys/audit/network.c  Mon Jun 18 15:07:10 2018
(r335318)
+++ head/tests/sys/audit/network.c  Mon Jun 18 15:27:31 2018
(r335319)
@@ -32,16 +32,20 @@
 #include 
 #include 
 #include 
-#include 
 
 #include "utils.h"
 
+#define MAX_DATA 1024
 #define SERVER_PATH "server"
 
-static int sockfd, sockfd2;
-static socklen_t len;
+static int sockfd, sockfd2, connectfd;
+static ssize_t data_bytes;
 static struct pollfd fds[1];
+static struct sockaddr_un server;
 static char extregex[80];
+static char data[MAX_DATA];
+static socklen_t len = sizeof(struct sockaddr_un);
+static char msgbuff[MAX_DATA] = "This message does not exist";
 static const char *auclass = "nt";
 static const char *nosupregex = "return,failure : Address family "
"not supported by protocol family";
@@ -66,11 +70,11 @@ close_sockets(int count, ...)
  * Assign local filesystem address to a Unix domain socket
  */
 static void
-assign_address(struct sockaddr_un *server)
+assign_address(struct sockaddr_un *serveraddr)
 {
-   memset(server, 0, sizeof(*server));
-   server->sun_family = AF_UNIX;
-   strcpy(server->sun_path, SERVER_PATH);
+   memset(serveraddr, 0, sizeof(*serveraddr));
+   serveraddr->sun_family = AF_UNIX;
+   strcpy(serveraddr->sun_path, SERVER_PATH);
 }
 
 
@@ -203,12 +207,10 @@ ATF_TC_HEAD(setsockopt_failure, tc)
 
 ATF_TC_BODY(setsockopt_failure, tc)
 {
-   int tr = 1;
snprintf(extregex, sizeof(extregex), "setsockopt.*%s", invalregex);
FILE *pipefd = setup(fds, auclass);
/* Failure reason: Invalid socket descriptor */
-   ATF_REQUIRE_EQ(-1, setsockopt(-1, SOL_SOCKET,
-   SO_REUSEADDR, , sizeof(int)));
+   ATF_REQUIRE_EQ(-1, setsockopt(-1, SOL_SOCKET, 0, NULL, 0));
check_audit(fds, extregex, pipefd);
 }
 
@@ -227,10 +229,7 @@ ATF_TC_HEAD(bind_success, tc)
 
 ATF_TC_BODY(bind_success, tc)
 {
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
-
/* Preliminary socket setup */
ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
/* Check the presence of AF_UNIX address path in audit record */
@@ -258,10 +257,7 @@ ATF_TC_HEAD(bind_failure, tc)
 
 ATF_TC_BODY(bind_failure, tc)
 {
-   /* Preliminary socket setup */
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
/* Check the presence of AF_UNIX path in audit record */
snprintf(extregex, sizeof(extregex),
"bind.*%s.*return,failure", SERVER_PATH);
@@ -287,10 +283,7 @@ ATF_TC_HEAD(bindat_success, tc)
 
 ATF_TC_BODY(bindat_success, tc)
 {
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
-
/* Preliminary socket setup */
ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
/* Check the presence of socket descriptor in audit record */
@@ -319,10 +312,7 @@ ATF_TC_HEAD(bindat_failure, tc)
 
 ATF_TC_BODY(bindat_failure, tc)
 {
-   /* Preliminary socket setup */
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
snprintf(extregex, sizeof(extregex), "bindat.*%s", invalregex);
 
FILE *pipefd = setup(fds, auclass);
@@ -347,10 +337,7 @@ ATF_TC_HEAD(listen_success, tc)
 
 ATF_TC_BODY(listen_success, tc)
 {
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
-
/* Preliminary socket setup */
ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *), len));
@@ -401,14 +388,9 @@ ATF_TC_HEAD(connect_success, tc)
 
 ATF_TC_BODY(connect_success, tc)
 {
-   struct sockaddr_un server;
assign_address();
-   len = sizeof(struct sockaddr_un);
-
-   /*  Setup a non-blocking server socket */
-   ATF_REQUIRE((sockfd = socket(PF_UNIX,
-   SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1);
-   /* Bind to the specified address and wait for connection */
+   /* Setup a server socket and bind to the specified address */
+   ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1);
ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *), len));
ATF_REQUIRE_EQ(0, listen(sockfd, 1));
 
@@ -442,11 +424,7 @@ ATF_TC_HEAD(connect_failure, tc)
 
 

svn commit: r335318 - head/tests/sys/audit

2018-06-18 Thread Alan Somers
Author: asomers
Date: Mon Jun 18 15:07:10 2018
New Revision: 335318
URL: https://svnweb.freebsd.org/changeset/base/335318

Log:
  audit(4): add tests for extattr_set_file and friends
  
  Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd,
  _delete_link}
  
  Submitted by: aniketp
  MFC after:2 weeks
  Sponsored by: Google, Inc. (GSoC 2018)
  Differential Revision:https://reviews.freebsd.org/D15867

Modified:
  head/tests/sys/audit/file-attribute-modify.c

Modified: head/tests/sys/audit/file-attribute-modify.c
==
--- head/tests/sys/audit/file-attribute-modify.cMon Jun 18 14:10:12 
2018(r335317)
+++ head/tests/sys/audit/file-attribute-modify.cMon Jun 18 15:07:10 
2018(r335318)
@@ -25,6 +25,8 @@
  * $FreeBSD$
  */
 
+#include 
+#include 
 #include 
 #include 
 
@@ -37,11 +39,13 @@
 static pid_t pid;
 static uid_t uid = -1;
 static gid_t gid = -1;
-static int filedesc;
+static int filedesc, retval;
 static struct pollfd fds[1];
 static mode_t mode = 0777;
 static char extregex[80];
+static const char *buff = "ezio";
 static const char *auclass = "fm";
+static const char *name = "authorname";
 static const char *path = "fileforaudit";
 static const char *errpath = "adirhasnoname/fileforaudit";
 static const char *successreg = "fileforaudit.*return,success";
@@ -685,6 +689,333 @@ ATF_TC_CLEANUP(lchflags_failure, tc)
 }
 
 
+ATF_TC_WITH_CLEANUP(extattr_set_file_success);
+ATF_TC_HEAD(extattr_set_file_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "extattr_set_file(2) call");
+}
+
+ATF_TC_BODY(extattr_set_file_success, tc)
+{
+   /* File needs to exist to call extattr_set_file(2) */
+   ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
+   /* Prepare the regex to be checked in the audit record */
+   snprintf(extregex, sizeof(extregex),
+   "extattr_set_file.*%s.*%s.*return,success", path, name);
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path,
+   EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+   check_audit(fds, extregex, pipefd);
+   close(filedesc);
+}
+
+ATF_TC_CLEANUP(extattr_set_file_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(extattr_set_file_failure);
+ATF_TC_HEAD(extattr_set_file_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "extattr_set_file(2) call");
+}
+
+ATF_TC_BODY(extattr_set_file_failure, tc)
+{
+   /* Prepare the regex to be checked in the audit record */
+   snprintf(extregex, sizeof(extregex),
+   "extattr_set_file.*%s.*%s.*failure", path, name);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: file does not exist */
+   ATF_REQUIRE_EQ(-1, extattr_set_file(path,
+   EXTATTR_NAMESPACE_USER, name, NULL, 0));
+   check_audit(fds, extregex, pipefd);
+}
+
+ATF_TC_CLEANUP(extattr_set_file_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(extattr_set_fd_success);
+ATF_TC_HEAD(extattr_set_fd_success, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful "
+   "extattr_set_fd(2) call");
+}
+
+ATF_TC_BODY(extattr_set_fd_success, tc)
+{
+   /* File needs to exist to call extattr_set_fd(2) */
+   ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
+
+   /* Prepare the regex to be checked in the audit record */
+   snprintf(extregex, sizeof(extregex),
+   "extattr_set_fd.*%s.*return,success", name);
+
+   FILE *pipefd = setup(fds, auclass);
+   ATF_REQUIRE_EQ(sizeof(buff), extattr_set_fd(filedesc,
+   EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff)));
+   check_audit(fds, extregex, pipefd);
+   close(filedesc);
+}
+
+ATF_TC_CLEANUP(extattr_set_fd_success, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(extattr_set_fd_failure);
+ATF_TC_HEAD(extattr_set_fd_failure, tc)
+{
+   atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful "
+   "extattr_set_fd(2) call");
+}
+
+ATF_TC_BODY(extattr_set_fd_failure, tc)
+{
+   /* Prepare the regex to be checked in the audit record */
+   snprintf(extregex, sizeof(extregex),
+   "extattr_set_fd.*%s.*return,failure : Bad file descriptor", name);
+
+   FILE *pipefd = setup(fds, auclass);
+   /* Failure reason: Invalid file descriptor */
+   ATF_REQUIRE_EQ(-1, extattr_set_fd(-1,
+   EXTATTR_NAMESPACE_USER, name, NULL, 0));
+   check_audit(fds, extregex, pipefd);
+}
+
+ATF_TC_CLEANUP(extattr_set_fd_failure, tc)
+{
+   cleanup();
+}
+
+
+ATF_TC_WITH_CLEANUP(extattr_set_link_success);
+ATF_TC_HEAD(extattr_set_link_success, tc)
+{
+

svn commit: r335317 - head/sys/netinet

2018-06-18 Thread Randall Stewart
Author: rrs
Date: Mon Jun 18 14:10:12 2018
New Revision: 335317
URL: https://svnweb.freebsd.org/changeset/base/335317

Log:
  Move to using the inp->vnet pointer has suggested by lstewart.
  This is far better since the hpts system is using the inp
  as its basis anyway. Unfortunately his comments came late.
  
  Sponsored by: Netflix Inc.

Modified:
  head/sys/netinet/tcp_hpts.c

Modified: head/sys/netinet/tcp_hpts.c
==
--- head/sys/netinet/tcp_hpts.c Mon Jun 18 13:49:44 2018(r335316)
+++ head/sys/netinet/tcp_hpts.c Mon Jun 18 14:10:12 2018(r335317)
@@ -1216,7 +1216,7 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim
inp->inp_in_input = 0;
tp = intotcpcb(inp);
mtx_unlock(>p_mtx);
-   CURVNET_SET(tp->t_vnet);
+   CURVNET_SET(inp->inp_vnet);
if (drop_reason) {
INP_INFO_RLOCK(_tcbinfo);
ti_locked = TI_RLOCKED;
@@ -1589,7 +1589,7 @@ out_now:
getmicrouptime();
cts = tcp_tv_to_usectick();
}
-   CURVNET_SET(tp->t_vnet);
+   CURVNET_SET(inp->inp_vnet);
/*
 * There is a hole here, we get the refcnt on the
 * inp so it will still be preserved but to make
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335316 - head/share/man/man7

2018-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Mon Jun 18 13:49:44 2018
New Revision: 335316
URL: https://svnweb.freebsd.org/changeset/base/335316

Log:
  Improve spelling and capitalize "Kerberos".
  
  MFC after:2 weeks
  Sponsored by: DARPA, AFRL

Modified:
  head/share/man/man7/hier.7

Modified: head/share/man/man7/hier.7
==
--- head/share/man/man7/hier.7  Mon Jun 18 13:26:45 2018(r335315)
+++ head/share/man/man7/hier.7  Mon Jun 18 13:49:44 2018(r335316)
@@ -28,7 +28,7 @@
 .\"@(#)hier.7  8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd April 2, 2018
+.Dd June 18, 2018
 .Dt HIER 7
 .Os
 .Sh NAME
@@ -474,7 +474,7 @@ Handbook
 .It Pa ja/
 Japanese translations of documents in /usr/share/doc
 .It Pa legal/
-License files for vendor supplied firmwares
+License files for vendor supplied firmware files
 .It Pa ncurses/
 HTML documents pertaining to ncurses;
 see
@@ -623,7 +623,7 @@ utilities covered by the GNU General Public License
 source code for files in
 .Pa /usr/include
 .It Pa kerberos5/
-build infrastructure for kerberos version 5
+build infrastructure for Kerberos version 5
 .It Pa lib/
 source code for files in
 .Pa /lib
@@ -801,7 +801,7 @@ for privilege separation.
 .It Pa games/
 miscellaneous game status and score files
 .It Pa heimdal/
-kerberos server databases; see
+Kerberos server databases; see
 .Xr kdc 8
 .It Pa log/
 miscellaneous system log files
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335315 - head/sys/compat/linsysfs

2018-06-18 Thread Ed Maste
Author: emaste
Date: Mon Jun 18 13:26:45 2018
New Revision: 335315
URL: https://svnweb.freebsd.org/changeset/base/335315

Log:
  linsysfs: depend on linux_common module on arm64, as on amd64
  
  Sponsored by: Turing Robotic Industries

Modified:
  head/sys/compat/linsysfs/linsysfs.c

Modified: head/sys/compat/linsysfs/linsysfs.c
==
--- head/sys/compat/linsysfs/linsysfs.c Mon Jun 18 06:01:28 2018
(r335314)
+++ head/sys/compat/linsysfs/linsysfs.c Mon Jun 18 13:26:45 2018
(r335315)
@@ -557,7 +557,7 @@ linsysfs_uninit(PFS_INIT_ARGS)
 }
 
 PSEUDOFS(linsysfs, 1, VFCF_JAIL);
-#if defined(__amd64__)
+#if defined(__aarch64__) || defined(__amd64__)
 MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1);
 #else
 MODULE_DEPEND(linsysfs, linux, 1, 1, 1);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r335314 - head/usr.sbin/syslogd

2018-06-18 Thread Ed Schouten
Author: ed
Date: Mon Jun 18 06:01:28 2018
New Revision: 335314
URL: https://svnweb.freebsd.org/changeset/base/335314

Log:
  Fix bad logic in iovlist_truncate().
  
  To conform to RFC 5426, this function is intended to truncate messages
  if they exceed the message size limits. Unfortunately, the amount of
  space was computed the wrong way around, causing messages to be
  truncated entirely.
  
  Reported by:  Michael Grimm on stable@
  MFC after:3 days

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

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Mon Jun 18 04:58:48 2018
(r335313)
+++ head/usr.sbin/syslogd/syslogd.c Mon Jun 18 06:01:28 2018
(r335314)
@@ -1613,8 +1613,8 @@ iovlist_truncate(struct iovlist *il, size_t size)
struct iovec *last;
size_t diff;
 
-   while (size > il->totalsize) {
-   diff = size - il->totalsize;
+   while (il->totalsize > size) {
+   diff = il->totalsize - size;
last = >iov[il->iovcnt - 1];
if (diff >= last->iov_len) {
/* Remove the last iovec entirely. */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"