Re: svn commit: r312905 - head/sys/net

2017-01-27 Thread hiren panchasara
On 01/27/17 at 11:19P, Cy Schubert wrote:
> Really? Just a copyright notice?
> 
> The reason I ask is because of this:
> 
> ===> ae (all)
> --- iflib.o ---
> /export/home/cy/freebsd/svn/ip6-cksum/sys/net/iflib.c:1561:1: error: 
> function definition is not allowed here
> {
>

Should these 2 lines be swapped?
https://svnweb.freebsd.org/base/head/sys/net/iflib.c?annotate=312905#l1539
https://svnweb.freebsd.org/base/head/sys/net/iflib.c?annotate=312905#l1540
seems like #if #endif block has an extra '}'? 

Cheers,
Hiren


pgph7YfXR3MtR.pgp
Description: PGP signature


Re: svn commit: r312905 - head/sys/net

2017-01-27 Thread Cy Schubert
In message <201701280719.v0s7jnmf087...@slippy.cwsent.com>, Cy Schubert 
writes:
> In message <201701272308.v0rn86fx040...@repo.freebsd.org>, Sean Bruno 
> writes:
> > Author: sbruno
> > Date: Fri Jan 27 23:08:06 2017
> > New Revision: 312905
> > URL: https://svnweb.freebsd.org/changeset/base/312905
> > 
> > Log:
> >   IFLIB updates:
> >   We found routing performance dropped significantly when configuring
> >   FreeBSD as a router, we are applying the following changes in order to
> >   resolve those issues and hopefully perform better.
> >- don't prefetch the flags array, we usually don't need it
> >- prefetch the next cache line of each of the software descriptor arrays
>  a
> > s
> >  well as the first cache line of each of the next four packets' mbufs a
> nd
> >  clusters
> >- reduce max copy size to 63 bytes
> >- convert rx soft descriptors from array of structures to a structure of
>  a
> > rrays
> >- update copyrights
> >   
> >   Submitted by: Matt Macy 
> > 
> > Modified:
> >   head/sys/net/iflib.c
> >   head/sys/net/iflib.h
> > 
> > Modified: head/sys/net/iflib.c
> > ===
> ==
> > =
> > --- head/sys/net/iflib.cFri Jan 27 23:03:28 2017(r312904)
> > +++ head/sys/net/iflib.cFri Jan 27 23:08:06 2017(r312905)
> > @@ -1,5 +1,5 @@
> >  /*-
> > - * Copyright (c) 2014-2016, Matthew Macy 
> > + * Copyright (c) 2014-2017, Matthew Macy 
> >   * All rights reserved.
> >   *
> >   * Redistribution and use in source and binary forms, with or without
> > @@ -264,18 +264,12 @@ iflib_get_sctx(if_ctx_t ctx)
> >  #define RX_SW_DESC_INUSE(1 << 3)
> >  #define TX_SW_DESC_MAPPED   (1 << 4)
> >  
> > -typedef struct iflib_sw_rx_desc {
> > -   bus_dmamap_tifsd_map; /* bus_dma map for packet */
> > -   struct mbuf*ifsd_m;   /* rx: uninitialized mbuf */
> > -   caddr_t ifsd_cl;  /* direct cluster pointer for rx */
> > -   uint16_tifsd_flags;
> > -} *iflib_rxsd_t;
> > -
> > -typedef struct iflib_sw_tx_desc_val {
> > -   bus_dmamap_tifsd_map; /* bus_dma map for packet */
> > -   struct mbuf*ifsd_m;   /* pkthdr mbuf */
> > -   uint8_t ifsd_flags;
> > -} *iflib_txsd_val_t;
> > +typedef struct iflib_sw_rx_desc_array {
> > +   bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
> > +   struct mbuf **ifsd_m;   /* pkthdr mbufs */
> > +   caddr_t *ifsd_cl;  /* direct cluster pointer for rx */
> > +   uint8_t *ifsd_flags;
> > +} iflib_rxsd_array_t;
> >  
> >  typedef struct iflib_sw_tx_desc_array {
> > bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
> > @@ -287,7 +281,7 @@ typedef struct iflib_sw_tx_desc_array {
> >  /* magic number that should be high enough for any hardware */
> >  #define IFLIB_MAX_TX_SEGS  128
> >  #define IFLIB_MAX_RX_SEGS  32
> > -#define IFLIB_RX_COPY_THRESH   128
> > +#define IFLIB_RX_COPY_THRESH   63
> >  #define IFLIB_MAX_RX_REFRESH   32
> >  #define IFLIB_QUEUE_IDLE   0
> >  #define IFLIB_QUEUE_HUNG   1
> > @@ -383,7 +377,7 @@ struct iflib_fl {
> > uint16_tifl_buf_size;
> > uint16_tifl_cltype;
> > uma_zone_t  ifl_zone;
> > -   iflib_rxsd_tifl_sds;
> > +   iflib_rxsd_array_t  ifl_sds;
> > iflib_rxq_t ifl_rxq;
> > uint8_t ifl_id;
> > bus_dma_tag_t   ifl_desc_tag;
> > @@ -909,7 +903,7 @@ iflib_netmap_rxsync(struct netmap_kring 
> > ring->slot[nm_i].len = ri.iri_len - crc
> > len;
> > ring->slot[nm_i].flags = slot_flags;
> > bus_dmamap_sync(fl->ifl_ifdi->idi_tag,
> > -   fl->ifl_sds[nic
> > _i].ifsd_map, BUS_DMASYNC_POSTREAD);
> > +   fl->ifl_sds.ifs
> > d_map[nic_i], BUS_DMASYNC_POSTREAD);
> > nm_i = nm_next(nm_i, lim);
> > nic_i = nm_next(nic_i, lim);
> > }
> > @@ -949,14 +943,14 @@ iflib_netmap_rxsync(struct netmap_kring 
> > vaddr = addr;
> > if (slot->flags & NS_BUF_CHANGED) {
> > /* buffer has changed, reload map */
> > -   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, fl
> > ->ifl_sds[nic_i].ifsd_map, addr);
> > +   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, fl
> > ->ifl_sds.ifsd_map[nic_i], addr);
> > slot->flags &= ~NS_BUF_CHANGED;
> > }
> > /*
> >  * XXX we should be batching this operation - TODO
> >  */
> > ctx->isc_rxd_refill(ctx->ifc_softc, rxq->ifr_id, fl->i

svn commit: r312916 - in head/sys: net sys

2017-01-27 Thread Dexuan Cui
Author: dexuan
Date: Sat Jan 28 07:26:42 2017
New Revision: 312916
URL: https://svnweb.freebsd.org/changeset/base/312916

Log:
  ifnet: move the new ifnet_event EVENTHANDLER_DECLARE to net/if_var.h
  
  Thank glebius for pointing this out:
  "The network stuff shall not be added to sys/eventhandler.h"
  
  Reviewed by:  David_A_Bright_DELL.com, sephe, glebius
  Approved by:  sephe (mentor)
  MFC after:2 weeks
  Sponsored by: Microsoft
  Differential Revision:https://reviews.freebsd.org/D9345

Modified:
  head/sys/net/if.c
  head/sys/net/if_var.h
  head/sys/sys/eventhandler.h

Modified: head/sys/net/if.c
==
--- head/sys/net/if.c   Sat Jan 28 05:07:55 2017(r312915)
+++ head/sys/net/if.c   Sat Jan 28 07:26:42 2017(r312916)
@@ -59,7 +59,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Sat Jan 28 05:07:55 2017(r312915)
+++ head/sys/net/if_var.h   Sat Jan 28 07:26:42 2017(r312916)
@@ -404,6 +404,11 @@ EVENTHANDLER_DECLARE(ifnet_departure_eve
 /* Interface link state change event */
 typedef void (*ifnet_link_event_handler_t)(void *, struct ifnet *, int);
 EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t);
+/* Interface up/down event */
+#define IFNET_EVENT_UP 0
+#define IFNET_EVENT_DOWN   1
+typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event);
+EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn);
 #endif /* _SYS_EVENTHANDLER_H_ */
 
 /*

Modified: head/sys/sys/eventhandler.h
==
--- head/sys/sys/eventhandler.h Sat Jan 28 05:07:55 2017(r312915)
+++ head/sys/sys/eventhandler.h Sat Jan 28 07:26:42 2017(r312916)
@@ -284,11 +284,4 @@ typedef void (*swapoff_fn)(void *, struc
 EVENTHANDLER_DECLARE(swapon, swapon_fn);
 EVENTHANDLER_DECLARE(swapoff, swapoff_fn);
 
-/* ifup/ifdown events */
-#define IFNET_EVENT_UP 0
-#define IFNET_EVENT_DOWN   1
-struct ifnet;
-typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event);
-EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn);
-
 #endif /* _SYS_EVENTHANDLER_H_ */
___
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: r312905 - head/sys/net

2017-01-27 Thread Cy Schubert
In message <201701272308.v0rn86fx040...@repo.freebsd.org>, Sean Bruno 
writes:
> Author: sbruno
> Date: Fri Jan 27 23:08:06 2017
> New Revision: 312905
> URL: https://svnweb.freebsd.org/changeset/base/312905
> 
> Log:
>   IFLIB updates:
>   We found routing performance dropped significantly when configuring
>   FreeBSD as a router, we are applying the following changes in order to
>   resolve those issues and hopefully perform better.
>- don't prefetch the flags array, we usually don't need it
>- prefetch the next cache line of each of the software descriptor arrays a
> s
>  well as the first cache line of each of the next four packets' mbufs and
>  clusters
>- reduce max copy size to 63 bytes
>- convert rx soft descriptors from array of structures to a structure of a
> rrays
>- update copyrights
>   
>   Submitted by:   Matt Macy 
> 
> Modified:
>   head/sys/net/iflib.c
>   head/sys/net/iflib.h
> 
> Modified: head/sys/net/iflib.c
> =
> =
> --- head/sys/net/iflib.c  Fri Jan 27 23:03:28 2017(r312904)
> +++ head/sys/net/iflib.c  Fri Jan 27 23:08:06 2017(r312905)
> @@ -1,5 +1,5 @@
>  /*-
> - * Copyright (c) 2014-2016, Matthew Macy 
> + * Copyright (c) 2014-2017, Matthew Macy 
>   * All rights reserved.
>   *
>   * Redistribution and use in source and binary forms, with or without
> @@ -264,18 +264,12 @@ iflib_get_sctx(if_ctx_t ctx)
>  #define RX_SW_DESC_INUSE(1 << 3)
>  #define TX_SW_DESC_MAPPED   (1 << 4)
>  
> -typedef struct iflib_sw_rx_desc {
> - bus_dmamap_tifsd_map; /* bus_dma map for packet */
> - struct mbuf*ifsd_m;   /* rx: uninitialized mbuf */
> - caddr_t ifsd_cl;  /* direct cluster pointer for rx */
> - uint16_tifsd_flags;
> -} *iflib_rxsd_t;
> -
> -typedef struct iflib_sw_tx_desc_val {
> - bus_dmamap_tifsd_map; /* bus_dma map for packet */
> - struct mbuf*ifsd_m;   /* pkthdr mbuf */
> - uint8_t ifsd_flags;
> -} *iflib_txsd_val_t;
> +typedef struct iflib_sw_rx_desc_array {
> + bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
> + struct mbuf **ifsd_m;   /* pkthdr mbufs */
> + caddr_t *ifsd_cl;  /* direct cluster pointer for rx */
> + uint8_t *ifsd_flags;
> +} iflib_rxsd_array_t;
>  
>  typedef struct iflib_sw_tx_desc_array {
>   bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
> @@ -287,7 +281,7 @@ typedef struct iflib_sw_tx_desc_array {
>  /* magic number that should be high enough for any hardware */
>  #define IFLIB_MAX_TX_SEGS128
>  #define IFLIB_MAX_RX_SEGS32
> -#define IFLIB_RX_COPY_THRESH 128
> +#define IFLIB_RX_COPY_THRESH 63
>  #define IFLIB_MAX_RX_REFRESH 32
>  #define IFLIB_QUEUE_IDLE 0
>  #define IFLIB_QUEUE_HUNG 1
> @@ -383,7 +377,7 @@ struct iflib_fl {
>   uint16_tifl_buf_size;
>   uint16_tifl_cltype;
>   uma_zone_t  ifl_zone;
> - iflib_rxsd_tifl_sds;
> + iflib_rxsd_array_t  ifl_sds;
>   iflib_rxq_t ifl_rxq;
>   uint8_t ifl_id;
>   bus_dma_tag_t   ifl_desc_tag;
> @@ -909,7 +903,7 @@ iflib_netmap_rxsync(struct netmap_kring 
>   ring->slot[nm_i].len = ri.iri_len - crc
> len;
>   ring->slot[nm_i].flags = slot_flags;
>   bus_dmamap_sync(fl->ifl_ifdi->idi_tag,
> - fl->ifl_sds[nic
> _i].ifsd_map, BUS_DMASYNC_POSTREAD);
> + fl->ifl_sds.ifs
> d_map[nic_i], BUS_DMASYNC_POSTREAD);
>   nm_i = nm_next(nm_i, lim);
>   nic_i = nm_next(nic_i, lim);
>   }
> @@ -949,14 +943,14 @@ iflib_netmap_rxsync(struct netmap_kring 
>   vaddr = addr;
>   if (slot->flags & NS_BUF_CHANGED) {
>   /* buffer has changed, reload map */
> - netmap_reload_map(na, fl->ifl_ifdi->idi_tag, fl
> ->ifl_sds[nic_i].ifsd_map, addr);
> + netmap_reload_map(na, fl->ifl_ifdi->idi_tag, fl
> ->ifl_sds.ifsd_map[nic_i], addr);
>   slot->flags &= ~NS_BUF_CHANGED;
>   }
>   /*
>* XXX we should be batching this operation - TODO
>*/
>   ctx->isc_rxd_refill(ctx->ifc_softc, rxq->ifr_id, fl->if
> l_id, nic_i, &paddr, &vaddr, 1, fl->ifl_buf_size);
> - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_sds[nic_
> i].ifsd_map,
> + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_sds.ifsd
> _map[

svn commit: r312915 - head/sys/modules/dtb/am335x

2017-01-27 Thread Warner Losh
Author: imp
Date: Sat Jan 28 05:07:55 2017
New Revision: 312915
URL: https://svnweb.freebsd.org/changeset/base/312915

Log:
  Switch to Linux / device tree upstream names. U-boot uses these by
  default, and the fewer changes relative to the upstream u-boot the
  better.
  Add compatibility links for the old names.
  Add dts file for BeagleBone Green while we're here.

Modified:
  head/sys/modules/dtb/am335x/Makefile

Modified: head/sys/modules/dtb/am335x/Makefile
==
--- head/sys/modules/dtb/am335x/MakefileSat Jan 28 05:07:53 2017
(r312914)
+++ head/sys/modules/dtb/am335x/MakefileSat Jan 28 05:07:55 2017
(r312915)
@@ -1,8 +1,13 @@
 # $FreeBSD$
 # All the dts files for am335x systems we support.
 DTS=   \
-   beaglebone.dts \
-   beaglebone-black.dts \
+   am335x-bone.dts \
+   am335x-boneblack.dts \
+   am335x-bonegreen.dts \
ufw.dts
 
+LINKS= \
+   ${DTBDIR}/am3335x-bone.dtb ${DTBDIR}/beaglebone.dtb \
+   ${DTBDIR}/am3335x-boneblack.dtb ${DTBDIR}/beaglebone-black.dtb
+
 .include 
___
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: r312914 - head/sys/conf

2017-01-27 Thread Warner Losh
Author: imp
Date: Sat Jan 28 05:07:53 2017
New Revision: 312914
URL: https://svnweb.freebsd.org/changeset/base/312914

Log:
  Honor LINKS=x y in dtb modules. We need this for compatibility links
  for old, FreeBSD names.

Modified:
  head/sys/conf/dtb.mk

Modified: head/sys/conf/dtb.mk
==
--- head/sys/conf/dtb.mkSat Jan 28 04:33:51 2017(r312913)
+++ head/sys/conf/dtb.mkSat Jan 28 05:07:53 2017(r312914)
@@ -76,3 +76,4 @@ _dtbinstall:
 
 .include 
 .include 
+.include 
___
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: r312913 - head/tests/sys/aio

2017-01-27 Thread Alan Somers
Author: asomers
Date: Sat Jan 28 04:33:51 2017
New Revision: 312913
URL: https://svnweb.freebsd.org/changeset/base/312913

Log:
  Improve the aio tests
  
  * Add tests for aio_suspend(2).
  * Add tests for polled completion notification.
  * Test the full matrix of file descriptor types and completion notification
mechanisms.
  * Don't bother with mkstemp, because ATF runs every test in its own temp dir.
  * Fix some typos.
  * Remove extraneous ATF_REQUIRE_KERNEL_MODULE calls.
  
  Reviewed by:  jhb
  MFC after:4 weeks
  Differential Revision:https://reviews.freebsd.org/D9045

Modified:
  head/tests/sys/aio/aio_test.c

Modified: head/tests/sys/aio/aio_test.c
==
--- head/tests/sys/aio/aio_test.c   Sat Jan 28 03:53:53 2017
(r312912)
+++ head/tests/sys/aio/aio_test.c   Sat Jan 28 04:33:51 2017
(r312913)
@@ -33,7 +33,7 @@
  * reading it from a second descriptor using AIO.  For some targets, the same
  * fd is used for write and read (i.e., file, md device), but for others the
  * operation is performed on a peer (pty, socket, fifo, etc).  A timeout is
- * initiated to detect undo blocking.  This test does not attempt to exercise
+ * initiated to detect undue blocking.  This test does not attempt to exercise
  * error cases or more subtle asynchronous behavior, just make sure that the
  * basic operations work on some basic object types.
  */
@@ -74,6 +74,13 @@
 #defineGLOBAL_MAX  16384
 
 #defineBUFFER_MAX  GLOBAL_MAX
+
+/*
+ * A completion function will block until the aio has completed, then return
+ * the result of the aio.  errno will be set appropriately.
+ */
+typedef ssize_t (*completion)(struct aiocb*);
+
 struct aio_context {
int  ac_read_fd, ac_write_fd;
long ac_seed;
@@ -179,6 +186,45 @@ aio_context_init(struct aio_context *ac,
ac->ac_cleanup_arg = cleanup_arg;
 }
 
+static ssize_t
+poll(struct aiocb *aio) {
+   int err;
+
+   while ((err = aio_error(aio)) == EINPROGRESS && !aio_timedout)
+   usleep(25000);
+   switch (err) {
+   case EINPROGRESS:
+   errno = EINTR;
+   return (-1);
+   case 0:
+   return (aio_return(aio));
+   default:
+   return (err);
+   }
+}
+
+static ssize_t
+suspend(struct aiocb *aio) {
+   const struct aiocb *const iocbs[] = {aio};
+   int err;
+
+   err = aio_suspend(iocbs, 1, NULL);
+   if (err == 0)
+   return (aio_return(aio));
+   else
+   return (err);
+}
+
+static ssize_t
+waitcomplete(struct aiocb *aio) {
+   struct aiocb *aiop;
+   ssize_t ret;
+
+   ret = aio_waitcomplete(&aiop, NULL);
+   ATF_REQUIRE_EQ(aio, aiop);
+   return (ret);
+}
+
 /*
  * Each tester can register a callback to clean up in the event the test
  * fails.  Preserve the value of errno so that subsequent calls to errx()
@@ -201,13 +247,11 @@ aio_cleanup(struct aio_context *ac)
  * file descriptor.
  */
 static void
-aio_write_test(struct aio_context *ac)
+aio_write_test(struct aio_context *ac, completion comp)
 {
-   struct aiocb aio, *aiop;
+   struct aiocb aio;
ssize_t len;
 
-   ATF_REQUIRE_KERNEL_MODULE("aio");
-
bzero(&aio, sizeof(aio));
aio.aio_buf = ac->ac_buffer;
aio.aio_nbytes = ac->ac_buflen;
@@ -227,24 +271,23 @@ aio_write_test(struct aio_context *ac)
atf_tc_fail("aio_write failed: %s", strerror(errno));
}
 
-   len = aio_waitcomplete(&aiop, NULL);
+   len = comp(&aio);
if (len < 0) {
if (errno == EINTR) {
if (aio_timedout) {
aio_cleanup(ac);
-   atf_tc_fail("aio_waitcomplete timed out");
+   atf_tc_fail("aio timed out");
}
}
aio_cleanup(ac);
-   atf_tc_fail("aio_waitcomplete failed: %s", strerror(errno));
+   atf_tc_fail("aio failed: %s", strerror(errno));
}
 
aio_timeout_stop();
 
if (len != ac->ac_buflen) {
aio_cleanup(ac);
-   atf_tc_fail("aio_waitcomplete short write (%jd)",
-   (intmax_t)len);
+   atf_tc_fail("aio short write (%jd)", (intmax_t)len);
}
 }
 
@@ -253,13 +296,11 @@ aio_write_test(struct aio_context *ac)
  * provided file descriptor.
  */
 static void
-aio_read_test(struct aio_context *ac)
+aio_read_test(struct aio_context *ac, completion comp)
 {
-   struct aiocb aio, *aiop;
+   struct aiocb aio;
ssize_t len;
 
-   ATF_REQUIRE_KERNEL_MODULE("aio");
-
bzero(ac->ac_buffer, ac->ac_buflen);
bzero(&aio, sizeof(aio));
aio.aio_buf = ac->ac_buffer;
@@ -273,30 +314,30 @

svn commit: r312912 - head/sys/i386/isa

2017-01-27 Thread Takahashi Yoshihiro
Author: nyan
Date: Sat Jan 28 03:53:53 2017
New Revision: 312912
URL: https://svnweb.freebsd.org/changeset/base/312912

Log:
  Garbage collect the FPU_ERROR_BROKEN option.
  It is for pc98 only.

Modified:
  head/sys/i386/isa/npx.c

Modified: head/sys/i386/isa/npx.c
==
--- head/sys/i386/isa/npx.c Sat Jan 28 02:25:33 2017(r312911)
+++ head/sys/i386/isa/npx.c Sat Jan 28 03:53:53 2017(r312912)
@@ -304,14 +304,6 @@ npx_probe(void)
 */
control &= ~(1 << 2);   /* enable divide by 0 trap */
fldcw(control);
-#ifdef FPU_ERROR_BROKEN
-   /*
-* FPU error signal doesn't work on some CPU
-* accelerator board.
-*/
-   hw_float = 1;
-   return (1);
-#endif
npx_traps_while_probing = 0;
fp_divide_by_0();
if (npx_traps_while_probing != 0) {
___
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: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/exampl

2017-01-27 Thread Ed Maste
On 27 January 2017 at 21:22, Takahashi Yoshihiro  wrote:
> Author: nyan
> Date: Sat Jan 28 02:22:15 2017
> New Revision: 312910
> URL: https://svnweb.freebsd.org/changeset/base/312910
>
> Log:
>   Remove pc98 support completely.
>   I thank all developers and contributors for pc98.

Thank you and the rest of the pc98 team for diligently maintaining the
port all of this time.
___
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: r312911 - head/share/man/man5

2017-01-27 Thread Takahashi Yoshihiro
Author: nyan
Date: Sat Jan 28 02:25:33 2017
New Revision: 312911
URL: https://svnweb.freebsd.org/changeset/base/312911

Log:
  Regen after r312910.

Modified:
  head/share/man/man5/src.conf.5

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Sat Jan 28 02:22:15 2017
(r312910)
+++ head/share/man/man5/src.conf.5  Sat Jan 28 02:25:33 2017
(r312911)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
 .\" from FreeBSD: head/tools/build/options/makeman 306729 2016-10-05 20:12:00Z 
emaste
 .\" $FreeBSD$
-.Dd January 6, 2017
+.Dd January 28, 2017
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -177,7 +177,7 @@ Set to build and install binutils (as, l
 of the normal system build.
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
 .It Va WITHOUT_BINUTILS_BOOTSTRAP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS_BOOTSTRAP 295490 
2016-02-10 23:57:09Z emaste
 Set to not build binutils (as, ld, objcopy and objdump)
@@ -195,7 +195,7 @@ Set build binutils (as, ld, objcopy and 
 as part of the bootstrap process.
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, pc98/i386, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, 
mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, 
mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, 
powerpc/powerpcspe and sparc64/sparc64.
 .It Va WITHOUT_BLACKLIST
 .\" from FreeBSD: head/tools/build/options/WITHOUT_BLACKLIST 301554 2016-06-07 
16:35:55Z lidl
 Set this if you do not want to build blacklistd / blacklistctl.
@@ -352,7 +352,7 @@ When set, it also enforces the following
 Set to build the Clang C/C++ compiler during the normal phase of the build.
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
 .It Va WITHOUT_CLANG_BOOTSTRAP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_BOOTSTRAP 273177 
2014-10-16 18:28:11Z skreuzer
 Set to not build the Clang C/C++ compiler during the bootstrap phase of the 
build.
@@ -367,7 +367,7 @@ mips/mipsel, mips/mips, mips/mips64el, m
 Set to build the Clang C/C++ compiler during the bootstrap phase of the build.
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and 
pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
 .It Va WITH_CLANG_EXTRAS
 .\" from FreeBSD: head/tools/build/options/WITH_CLANG_EXTRAS 231057 2012-02-05 
23:56:22Z dim
 Set to build additional clang and llvm tools, such as bugpoint.
@@ -384,7 +384,7 @@ Set to build the ARCMigrate, Rewriter an
 Clang C/C++ compiler.
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
pc98/i386, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, 
powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe.
 .It Va WITHOUT_CLANG_IS_CC
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG_IS_CC 242629 
2012-11-05 21:53:23Z brooks
 Set to install the GCC compiler as
@@ -404,7 +404,7 @@ and
 .Pa /usr/bin/cpp .
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and 
pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
 .It Va WITHOUT_CPP
 .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 
07:50:50Z ru
 Set to not build
@@ -652,7 +652,7 @@ and
 .Xr efivar 8 .
 .Pp
 It is a default setting on
-amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and 
pc98/i386.
+amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386.
 .It Va WITH_EISA
 .\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 
16:53:06Z imp
 Set to build EISA kernel modules.
@@ -726,7 +726,7 @@ Set to not build games.
 Set to not build and install gcc and g++ as 

svn commit: r312910 - in head: . etc/etc.pc98 etc/rc.d lib/libsysdecode libexec release release/doc release/doc/en_US.ISO8859-1/hardware release/doc/en_US.ISO8859-1/readme release/doc/share/example...

2017-01-27 Thread Takahashi Yoshihiro
Author: nyan
Date: Sat Jan 28 02:22:15 2017
New Revision: 312910
URL: https://svnweb.freebsd.org/changeset/base/312910

Log:
  Remove pc98 support completely.
  I thank all developers and contributors for pc98.
  
  Relnotes: yes

Deleted:
  head/etc/etc.pc98/
  head/libexec/Makefile.pc98
  head/release/pc98/
  head/sbin/Makefile.pc98
  head/sbin/fdisk_pc98/
  head/share/man/man4/man4.i386/ct.4
  head/share/man/man4/man4.i386/snc.4
  head/share/syscons/keymaps/jp.pc98.iso.kbd
  head/share/syscons/keymaps/jp.pc98.kbd
  head/share/vt/keymaps/jp.pc98.iso.kbd
  head/share/vt/keymaps/jp.pc98.kbd
  head/sys/boot/Makefile.pc98
  head/sys/boot/pc98/
  head/sys/conf/Makefile.pc98
  head/sys/conf/files.pc98
  head/sys/conf/options.pc98
  head/sys/dev/aic/aic_cbus.c
  head/sys/dev/ata/ata-cbus.c
  head/sys/dev/ct/
  head/sys/dev/ed/if_ed98.h
  head/sys/dev/ed/if_ed_cbus.c
  head/sys/dev/fdc/fdc_cbus.c
  head/sys/dev/fe/if_fe_cbus.c
  head/sys/dev/ic/i8251.h
  head/sys/dev/ic/wd33c93reg.h
  head/sys/dev/le/if_le_cbus.c
  head/sys/dev/mse/mse_cbus.c
  head/sys/dev/snc/
  head/sys/dev/uart/uart_cpu_pc98.c
  head/sys/geom/geom_pc98.c
  head/sys/geom/geom_pc98_enc.c
  head/sys/geom/part/g_part_pc98.c
  head/sys/modules/canbepm/
  head/sys/modules/canbus/
  head/sys/modules/ct/
  head/sys/modules/geom/geom_part/geom_part_pc98/
  head/sys/modules/geom/geom_pc98/
  head/sys/modules/pmc/
  head/sys/modules/snc/
  head/sys/pc98/
  head/sys/sys/disk/pc98.h
  head/sys/sys/diskpc98.h
  head/usr.bin/mkimg/pc98.c
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-4096-pc98.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.raw.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-1x1-512-pc98.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-4096-pc98.vmdk.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.qcow2.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.raw.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhd.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.vhdf.gz.uu
  head/usr.bin/mkimg/tests/img-63x255-512-pc98.vmdk.gz.uu
  head/usr.sbin/boot98cfg/
  head/usr.sbin/bsdinstall/partedit/partedit_pc98.c
Modified:
  head/Makefile
  head/Makefile.inc1
  head/ObsoleteFiles.inc
  head/etc/rc.d/syscons
  head/lib/libsysdecode/Makefile
  head/lib/libsysdecode/mkioctls
  head/release/doc/README
  head/release/doc/en_US.ISO8859-1/hardware/article.xml
  head/release/doc/en_US.ISO8859-1/readme/article.xml
  head/release/doc/share/examples/Makefile.relnotesng
  head/release/doc/share/misc/dev.archlist.txt
  head/release/doc/share/xml/release.ent
  head/release/rc.local
  head/rescue/rescue/Makefile
  head/sbin/bsdlabel/bsdlabel.8
  head/sbin/bsdlabel/bsdlabel.c
  head/sbin/geom/class/part/gpart.8
  head/share/examples/bootforth/frames.4th
  head/share/man/man4/adv.4
  head/share/man/man4/ahc.4
  head/share/man/man4/apic.4
  head/share/man/man4/ed.4
  head/share/man/man4/esp.4
  head/share/man/man4/fxp.4
  head/share/man/man4/geom.4
  head/share/man/man4/man4.i386/Makefile
  head/share/man/man4/man4.i386/aic.4
  head/share/man/man4/ncr.4
  head/share/man/man4/ncv.4
  head/share/man/man4/sym.4
  head/share/mk/bsd.stand.mk
  head/share/mk/local.meta.sys.mk
  head/share/syscons/keymaps/INDEX.keymaps
  head/share/syscons/keymaps/Makefile
  head/share/vt/keymaps/INDEX.keymaps
  head/share/vt/keymaps/Makefile
  head/sys/Makefile
  head/sys/boot/common/Makefile.inc
  head/sys/boot/common/isapnp.h
  head/sys/boot/ficl/loader.c
  head/sys/boot/forth/frames.4th
  head/sys/cam/cam_xpt.c
  head/sys/conf/NOTES
  head/sys/conf/config.mk
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/conf/options
  head/sys/crypto/aesni/aesni.h
  head/sys/crypto/via/padlock.c
  head/sys/crypto/via/padlock_hash.c
  head/sys/dev/ata/ata-all.h
  head/sys/dev/ep/if_ep_isa.c
  head/sys/dev/exca/excareg.h
  head/sys/dev/fb/fb.c
  head/sys/dev/fb/splash_bmp.c
  head/sys/dev/fdc/fdc.c
  head/sys/dev/fdc/fdcvar.h
  head/sys/dev/fe/if_fe.c
  head/sys/dev/fe/if_fereg.h
  head/sys/dev/kbd/kbd.c
  head/sys/dev/le/am79900.c
  head/sys/dev/mse/msevar.h
  head/sys/dev/pccbb/pccbb_isa.c
  head/sys/dev/pci/vga_pci.c
  head/

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

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Sat Jan 28 00:40:36 2017
New Revision: 312909
URL: https://svnweb.freebsd.org/changeset/base/312909

Log:
  Add iflib man pages for developers.
  
  Doc review is probably waranted here for editing.
  
  Submitted by: Nicole Graziano

Added:
  head/share/man/man9/iflibdd.9   (contents, props changed)
  head/share/man/man9/iflibdi.9   (contents, props changed)
  head/share/man/man9/iflibtxrx.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileSat Jan 28 00:00:10 2017
(r312908)
+++ head/share/man/man9/MakefileSat Jan 28 00:40:36 2017
(r312909)
@@ -158,6 +158,9 @@ MAN=accept_filter.9 \
ieee80211_regdomain.9 \
ieee80211_scan.9 \
ieee80211_vap.9 \
+   iflibdd.9 \
+   iflibdi.9 \
+   iflibtxrx.9 \
ifnet.9 \
inittodr.9 \
insmntque.9 \

Added: head/share/man/man9/iflibdd.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/iflibdd.9   Sat Jan 28 00:40:36 2017
(r312909)
@@ -0,0 +1,181 @@
+.\" $FreeBSD$
+.Dd January 27, 2017
+.Dt IFlIBDD(9)
+.Os
+.Sh NAME
+.Nm iflibdd
+.Nd Device Dependent Configuration Functions
+.Sh SYNOPSIS
+.In "ifdi_if.h"
+.Ss "Soft Queue Setup and Teardown Functions"
+.Ss "Mandatory Functions"
+.Ft int
+.Fn ifdi_queues_alloc "if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int 
nqs"
+.Ft int
+.Fn ifdi_queues_free "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft int
+.Fn ifdi_txq_setup "if_ctx_t ctx, uint16_t qid"
+.Ft int
+.Fn ifdi_rxq_setup "if_ctx_t ctx, uint16_t qid"
+.Ss "Device Setup and Teardown Functions"
+.Ss "Mandatory Functions"
+.Ft int
+.Fn ifdi_attach_pre "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_attach_post "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_detach "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_vlan_register "if_ctx_t ctx, uint16_t vtag"
+.Ft void
+.Fn ifdi_vlan_unregister "if_ctx_t ctx, uint16_t vtag"
+.Ft int
+.Fn ifdi_suspend "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_resume "if_ctx_t ctx"
+.Ss "Device Configuration Functions"
+.Ss "Mandatory Functions"
+.Ft void
+.Fn ifdi_init "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_stop "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_multi_set "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_mtu_set "if_ctx_t ctx, uint32_t mtu"
+.Ft void
+.Fn ifdi_media_status "if_ctx_t ctx, struct ifmediareq *ifr"
+.Ft int
+.Fn ifdi_media_change "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_promisc_set "if_ctx_t ctx, int flags"
+.Ft uint64_t
+.Fn ifdi_get_counter "if_ctx_t ctx, ift_counter cnt"
+.Ft void
+.Fn ifdi_update_admin_status "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_media_set "if_ctx_t ctx"
+.Ss "Interrupt enable/disable"
+.Ss "Mandatory Functions"
+.Ft void
+.Fn ifdi_intr_enable "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_queue_intr_enable "if_ctx_t ctx, uint16_t qid"
+.Ft void
+.Fn ifdi_intr_disable "if_ctx_t ctx"
+.Ss IOV Support
+.Ft init
+.Fn iov_init "if_ctx_t, uint16_t num_vfs, const nvlist_t *params"
+.Ft void
+.Fn iov_uinit "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_vflr_handle "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_vf_add "if_ctx_t ctx, uint16_t vfnum, const nvlist_t *params"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_link_intr_enable "if_ctx_t ctx"
+.Ss "Optional Service Routines"
+.Ft void
+.Fn ifdi_timer "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_watchdog_reset "if_ctx_t ctx"
+.Ss "Additional Functions" 
+.Ft void
+.Fn ifdi_led_func "if_ctx_t ctx, int onoff"
+.Ft int
+.Fn ifdi_sysctl_int_delay "if_ctx_t ctx, if_int_delay_info_t iidi"
+.Ft int
+.Fn ifdi_i2c_req "if_ctx_t ctx, struct ifi2creq *req"
+.Sh FUNCTIONS
+The above named functions are device dependent configuration functions. These 
routines are registerd with iflib by the driver and are called from the 
corresponding iflib function to configure device specific functions and 
registers. 
+.Ss Device Dependent Functions
+.Ss Soft Queue Setup and Teardown
+.Bl -ohang -offset indent
+.It Fn ifdi_queues_alloc
+Manditory queues allocation function that is called during iflib_attach. 
vaddrs and paddrs are arrays of virtual and physical addresses respectively of 
the hardware transmit and receive queues, and if relevany, any command 
completion queues. nqs is the number of queues per qset. For example, a driver 
with a single receive and transmit queue would have a nqs equal to 2.
+.It Fn ifdi_queues_free
+Mandatory function that frees the allocated queues and associated transmit 
buffers. 
+.It Fn ifdi_txq_setup
+Optional function for each transmit queue that handles device specific 
initialization.
+.It Fn ifdi_rxq_setup
+Optional function for each receive queue that handles device specific 
initialization.
+.El
+.Ss Device Setup and Teardown
+.Bl -ohang -offset indent
+.It Fn ifdi_attach_pre
+Mandatory function implemented

svn commit: r312908 - head/sys/mips/conf

2017-01-27 Thread Ed Maste
Author: emaste
Date: Sat Jan 28 00:00:10 2017
New Revision: 312908
URL: https://svnweb.freebsd.org/changeset/base/312908

Log:
  ERL: set -march=octeon+ for use with external toolchain
  
  Upstream GCC and devel/mips64-gcc use "octeon+" as the CPU setting for
  the Octeon processor in the EdgeRouter Lite. As of r312899 the base
  system GCC 4.2.1 accepts octeon+ as an alias for the Octeon support
  added in r208737 for the same CPU.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/mips/conf/ERL

Modified: head/sys/mips/conf/ERL
==
--- head/sys/mips/conf/ERL  Fri Jan 27 23:10:46 2017(r312907)
+++ head/sys/mips/conf/ERL  Sat Jan 28 00:00:10 2017(r312908)
@@ -21,7 +21,7 @@
 
 ident  ERL
 
-makeoptionsARCH_FLAGS="-march=octeon -mabi=64"
+makeoptionsARCH_FLAGS="-march=octeon+ -mabi=64"
 makeoptionsLDSCRIPT_NAME=ldscript.mips.octeon1
 
 makeoptionsKERNLOADADDR=0x8010
___
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: r312907 - head/sys/netinet

2017-01-27 Thread Hiren Panchasara
Author: hiren
Date: Fri Jan 27 23:10:46 2017
New Revision: 312907
URL: https://svnweb.freebsd.org/changeset/base/312907

Log:
  Add a knob to change default behavior of inheriting listen socket's tcp stack
  regardless of what the default stack for the system is set to.
  
  With current/default behavior, after changing the default tcp stack, the
  application needs to be restarted to pick up that change. Setting this new 
knob
  net.inet.tcp.functions_inherit_listen_socket_stack to '0' would change that
  behavior and make any new connection use the newly selected default tcp stack.
  
  Reviewed by:  rrs
  MFC after:2 weeks
  Sponsored by: Limelight Networks

Modified:
  head/sys/netinet/tcp_syncache.c

Modified: head/sys/netinet/tcp_syncache.c
==
--- head/sys/netinet/tcp_syncache.c Fri Jan 27 23:08:30 2017
(r312906)
+++ head/sys/netinet/tcp_syncache.c Fri Jan 27 23:10:46 2017
(r312907)
@@ -120,6 +120,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sync
 &VNET_NAME(tcp_syncookiesonly), 0,
 "Use only TCP SYN cookies");
 
+static VNET_DEFINE(int, functions_inherit_listen_socket_stack) = 1;
+#define V_functions_inherit_listen_socket_stack \
+VNET(functions_inherit_listen_socket_stack)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, functions_inherit_listen_socket_stack,
+CTLFLAG_VNET | CTLFLAG_RW,
+&VNET_NAME(functions_inherit_listen_socket_stack), 0,
+"Inherit listen socket's stack");
+
 #ifdef TCP_OFFLOAD
 #define ADDED_BY_TOE(sc) ((sc)->sc_tod != NULL)
 #endif
@@ -830,7 +838,7 @@ syncache_socket(struct syncache *sc, str
tcp_rcvseqinit(tp);
tcp_sendseqinit(tp);
blk = sototcpcb(lso)->t_fb;
-   if (blk != tp->t_fb) {
+   if (V_functions_inherit_listen_socket_stack && blk != tp->t_fb) {
/*
 * Our parents t_fb was not the default,
 * we need to release our ref on tp->t_fb and 
___
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: r312905 - head/sys/net

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Fri Jan 27 23:08:06 2017
New Revision: 312905
URL: https://svnweb.freebsd.org/changeset/base/312905

Log:
  IFLIB updates:
  We found routing performance dropped significantly when configuring
  FreeBSD as a router, we are applying the following changes in order to
  resolve those issues and hopefully perform better.
   - don't prefetch the flags array, we usually don't need it
   - prefetch the next cache line of each of the software descriptor arrays as
 well as the first cache line of each of the next four packets' mbufs and
 clusters
   - reduce max copy size to 63 bytes
   - convert rx soft descriptors from array of structures to a structure of 
arrays
   - update copyrights
  
  Submitted by: Matt Macy 

Modified:
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Jan 27 23:03:28 2017(r312904)
+++ head/sys/net/iflib.cFri Jan 27 23:08:06 2017(r312905)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014-2016, Matthew Macy 
+ * Copyright (c) 2014-2017, Matthew Macy 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -264,18 +264,12 @@ iflib_get_sctx(if_ctx_t ctx)
 #define RX_SW_DESC_INUSE(1 << 3)
 #define TX_SW_DESC_MAPPED   (1 << 4)
 
-typedef struct iflib_sw_rx_desc {
-   bus_dmamap_tifsd_map; /* bus_dma map for packet */
-   struct mbuf*ifsd_m;   /* rx: uninitialized mbuf */
-   caddr_t ifsd_cl;  /* direct cluster pointer for rx */
-   uint16_tifsd_flags;
-} *iflib_rxsd_t;
-
-typedef struct iflib_sw_tx_desc_val {
-   bus_dmamap_tifsd_map; /* bus_dma map for packet */
-   struct mbuf*ifsd_m;   /* pkthdr mbuf */
-   uint8_t ifsd_flags;
-} *iflib_txsd_val_t;
+typedef struct iflib_sw_rx_desc_array {
+   bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
+   struct mbuf **ifsd_m;   /* pkthdr mbufs */
+   caddr_t *ifsd_cl;  /* direct cluster pointer for rx */
+   uint8_t *ifsd_flags;
+} iflib_rxsd_array_t;
 
 typedef struct iflib_sw_tx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
@@ -287,7 +281,7 @@ typedef struct iflib_sw_tx_desc_array {
 /* magic number that should be high enough for any hardware */
 #define IFLIB_MAX_TX_SEGS  128
 #define IFLIB_MAX_RX_SEGS  32
-#define IFLIB_RX_COPY_THRESH   128
+#define IFLIB_RX_COPY_THRESH   63
 #define IFLIB_MAX_RX_REFRESH   32
 #define IFLIB_QUEUE_IDLE   0
 #define IFLIB_QUEUE_HUNG   1
@@ -383,7 +377,7 @@ struct iflib_fl {
uint16_tifl_buf_size;
uint16_tifl_cltype;
uma_zone_t  ifl_zone;
-   iflib_rxsd_tifl_sds;
+   iflib_rxsd_array_t  ifl_sds;
iflib_rxq_t ifl_rxq;
uint8_t ifl_id;
bus_dma_tag_t   ifl_desc_tag;
@@ -909,7 +903,7 @@ iflib_netmap_rxsync(struct netmap_kring 
ring->slot[nm_i].len = ri.iri_len - 
crclen;
ring->slot[nm_i].flags = slot_flags;
bus_dmamap_sync(fl->ifl_ifdi->idi_tag,
-   
fl->ifl_sds[nic_i].ifsd_map, BUS_DMASYNC_POSTREAD);
+   
fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD);
nm_i = nm_next(nm_i, lim);
nic_i = nm_next(nic_i, lim);
}
@@ -949,14 +943,14 @@ iflib_netmap_rxsync(struct netmap_kring 
vaddr = addr;
if (slot->flags & NS_BUF_CHANGED) {
/* buffer has changed, reload map */
-   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, 
fl->ifl_sds[nic_i].ifsd_map, addr);
+   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, 
fl->ifl_sds.ifsd_map[nic_i], addr);
slot->flags &= ~NS_BUF_CHANGED;
}
/*
 * XXX we should be batching this operation - TODO
 */
ctx->isc_rxd_refill(ctx->ifc_softc, rxq->ifr_id, 
fl->ifl_id, nic_i, &paddr, &vaddr, 1, fl->ifl_buf_size);
-   bus_dmamap_sync(fl->ifl_ifdi->idi_tag, 
fl->ifl_sds[nic_i].ifsd_map,
+   bus_dmamap_sync(fl->ifl_ifdi->idi_tag, 
fl->ifl_sds.ifsd_map[nic_i],
BUS_DMASYNC_PREREAD);
nm_i = nm_next(nm_i, lim);
nic_i = nm_next(nic_i, lim);
@@ -1030,22 +1024,22 @@ iflib_netmap_rxq_init(if_

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

2017-01-27 Thread John Baldwin
Author: jhb
Date: Fri Jan 27 23:08:30 2017
New Revision: 312906
URL: https://svnweb.freebsd.org/changeset/base/312906

Log:
  Unregister CPL handlers for TOE-related messages when unloading TOM.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/tom/t4_connect.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_listen.c
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==
--- head/sys/dev/cxgbe/tom/t4_connect.c Fri Jan 27 23:08:06 2017
(r312905)
+++ head/sys/dev/cxgbe/tom/t4_connect.c Fri Jan 27 23:08:30 2017
(r312906)
@@ -275,6 +275,14 @@ t4_init_connect_cpl_handlers(void)
t4_register_cpl_handler(CPL_ACT_OPEN_RPL, do_act_open_rpl);
 }
 
+void
+t4_uninit_connect_cpl_handlers(void)
+{
+
+   t4_register_cpl_handler(CPL_ACT_ESTABLISH, NULL);
+   t4_register_cpl_handler(CPL_ACT_OPEN_RPL, NULL);
+}
+
 #define DONT_OFFLOAD_ACTIVE_OPEN(x)do { \
reason = __LINE__; \
rc = (x); \

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c  Fri Jan 27 23:08:06 2017
(r312905)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c  Fri Jan 27 23:08:30 2017
(r312906)
@@ -1848,12 +1848,12 @@ void
 t4_uninit_cpl_io_handlers(void)
 {
 
-   t4_register_cpl_handler(CPL_PEER_CLOSE, do_peer_close);
-   t4_register_cpl_handler(CPL_CLOSE_CON_RPL, do_close_con_rpl);
-   t4_register_cpl_handler(CPL_ABORT_REQ_RSS, do_abort_req);
-   t4_register_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl);
-   t4_register_cpl_handler(CPL_RX_DATA, do_rx_data);
-   t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack);
+   t4_register_cpl_handler(CPL_PEER_CLOSE, NULL);
+   t4_register_cpl_handler(CPL_CLOSE_CON_RPL, NULL);
+   t4_register_cpl_handler(CPL_ABORT_REQ_RSS, NULL);
+   t4_register_cpl_handler(CPL_ABORT_RPL_RSS, NULL);
+   t4_register_cpl_handler(CPL_RX_DATA, NULL);
+   t4_register_cpl_handler(CPL_FW4_ACK, NULL);
 }
 
 /*

Modified: head/sys/dev/cxgbe/tom/t4_listen.c
==
--- head/sys/dev/cxgbe/tom/t4_listen.c  Fri Jan 27 23:08:06 2017
(r312905)
+++ head/sys/dev/cxgbe/tom/t4_listen.c  Fri Jan 27 23:08:30 2017
(r312906)
@@ -1622,4 +1622,14 @@ t4_init_listen_cpl_handlers(void)
t4_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_pass_accept_req);
t4_register_cpl_handler(CPL_PASS_ESTABLISH, do_pass_establish);
 }
+
+void
+t4_uninit_listen_cpl_handlers(void)
+{
+
+   t4_register_cpl_handler(CPL_PASS_OPEN_RPL, NULL);
+   t4_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, NULL);
+   t4_register_cpl_handler(CPL_PASS_ACCEPT_REQ, NULL);
+   t4_register_cpl_handler(CPL_PASS_ESTABLISH, NULL);
+}
 #endif

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 27 23:08:06 2017
(r312905)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 27 23:08:30 2017
(r312906)
@@ -1227,6 +1227,10 @@ t4_tom_mod_unload(void)
 
t4_ddp_mod_unload();
 
+   t4_uninit_connect_cpl_handlers();
+   t4_uninit_listen_cpl_handlers();
+   t4_uninit_cpl_io_handlers();
+
return (0);
 }
 #endif /* TCP_OFFLOAD */

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==
--- head/sys/dev/cxgbe/tom/t4_tom.h Fri Jan 27 23:08:06 2017
(r312905)
+++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Jan 27 23:08:30 2017
(r312906)
@@ -326,12 +326,14 @@ void release_lip(struct tom_data *, stru
 
 /* t4_connect.c */
 void t4_init_connect_cpl_handlers(void);
+void t4_uninit_connect_cpl_handlers(void);
 int t4_connect(struct toedev *, struct socket *, struct rtentry *,
 struct sockaddr *);
 void act_open_failure_cleanup(struct adapter *, u_int, u_int);
 
 /* t4_listen.c */
 void t4_init_listen_cpl_handlers(void);
+void t4_uninit_listen_cpl_handlers(void);
 int t4_listen_start(struct toedev *, struct tcpcb *);
 int t4_listen_stop(struct toedev *, struct tcpcb *);
 void t4_syncache_added(struct toedev *, 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: r312904 - head/sys/dev/cxgbe/tom

2017-01-27 Thread John Baldwin
Author: jhb
Date: Fri Jan 27 23:03:28 2017
New Revision: 312904
URL: https://svnweb.freebsd.org/changeset/base/312904

Log:
  Don't drop a reference to the TOE PCB in undo_offload_socket().
  
  undo_offload_socket() is only called by t4_connect() during a connection
  setup failure, but t4_connect() still owns the TOE PCB and frees ita
  after undo_offload_socket() returns.  Release a reference in
  undo_offload_socket() resulted in a double-free which panicked when
  t4_connect() performed the second free.  The reference release was
  added to undo_offload_socket() incorrectly in r299210.
  
  MFC after:1 week
  Sponsored by: Chelsio Communications

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

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==
--- head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 27 22:30:27 2017
(r312903)
+++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 27 23:03:28 2017
(r312904)
@@ -273,8 +273,6 @@ undo_offload_socket(struct socket *so)
mtx_lock(&td->toep_list_lock);
TAILQ_REMOVE(&td->toep_list, toep, link);
mtx_unlock(&td->toep_list_lock);
-
-   free_toepcb(toep);
 }
 
 static 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: r312903 - head/sys/net

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Fri Jan 27 22:30:27 2017
New Revision: 312903
URL: https://svnweb.freebsd.org/changeset/base/312903

Log:
  Replace customized busmaster code with standardized setup call.
  
  Reported by:  jhb

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Jan 27 22:14:42 2017(r312902)
+++ head/sys/net/iflib.cFri Jan 27 22:30:27 2017(r312903)
@@ -4781,12 +4781,9 @@ iflib_msix_init(if_ctx_t ctx)
** successfully initialize us.
*/
{
-   uint16_t pci_cmd_word;
int msix_ctrl, rid;
 
-   pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2);
-   pci_cmd_word |= PCIM_CMD_BUSMASTEREN;
-   pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2);
+   pci_enable_busmaster(dev);
rid = 0;
if (pci_find_cap(dev, PCIY_MSIX, &rid) == 0 && rid != 0) {
rid += PCIR_MSIX_CTRL;
___
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: r312902 - head/sys/kern

2017-01-27 Thread Mateusz Guzik
Author: mjg
Date: Fri Jan 27 22:14:42 2017
New Revision: 312902
URL: https://svnweb.freebsd.org/changeset/base/312902

Log:
  hwpmc: annotate pmc_hook and pmc_intr as __read_mostly
  
  MFC after:1 month

Modified:
  head/sys/kern/kern_pmc.c

Modified: head/sys/kern/kern_pmc.c
==
--- head/sys/kern/kern_pmc.cFri Jan 27 22:13:15 2017(r312901)
+++ head/sys/kern/kern_pmc.cFri Jan 27 22:14:42 2017(r312902)
@@ -59,10 +59,10 @@ MALLOC_DEFINE(M_PMCHOOKS, "pmchooks", "M
 const int pmc_kernel_version = PMC_KERNEL_VERSION;
 
 /* Hook variable. */
-int (*pmc_hook)(struct thread *td, int function, void *arg) = NULL;
+int __read_mostly (*pmc_hook)(struct thread *td, int function, void *arg) = 
NULL;
 
 /* Interrupt handler */
-int (*pmc_intr)(int cpu, struct trapframe *tf) = NULL;
+int __read_mostly (*pmc_intr)(int cpu, struct trapframe *tf) = NULL;
 
 /* Bitmask of CPUs requiring servicing at hardclock time */
 volatile cpuset_t pmc_cpumask;
___
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: r312901 - head/sys/kern

2017-01-27 Thread Mateusz Guzik
Author: mjg
Date: Fri Jan 27 22:13:15 2017
New Revision: 312901
URL: https://svnweb.freebsd.org/changeset/base/312901

Log:
  hwpmc: partially depessimize mmap handling if the module is not loaded
  
  In particular this means the pmc sx lock is no longer taken when an
  executable mapping succeeds.
  
  MFC after:1 week

Modified:
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Fri Jan 27 21:55:47 2017(r312900)
+++ head/sys/kern/vfs_vnops.c   Fri Jan 27 22:13:15 2017(r312901)
@@ -2460,10 +2460,12 @@ vn_mmap(struct file *fp, vm_map_t map, v
}
 #ifdef HWPMC_HOOKS
/* Inform hwpmc(4) if an executable is being mapped. */
-   if (error == 0 && (prot & VM_PROT_EXECUTE) != 0) {
-   pkm.pm_file = vp;
-   pkm.pm_address = (uintptr_t) *addr;
-   PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
+   if (PMC_HOOK_INSTALLED(PMC_FN_MMAP)) {
+   if ((prot & VM_PROT_EXECUTE) != 0 && error == 0) {
+   pkm.pm_file = vp;
+   pkm.pm_address = (uintptr_t) *addr;
+   PMC_CALL_HOOK(td, PMC_FN_MMAP, (void *) &pkm);
+   }
}
 #endif
return (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: r312900 - head/sys/cam

2017-01-27 Thread Scott Long
Author: scottl
Date: Fri Jan 27 21:55:47 2017
New Revision: 312900
URL: https://svnweb.freebsd.org/changeset/base/312900

Log:
  Squash a couple of uses of xpt_print_path()
  
  Sponsored by: Netflix

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Fri Jan 27 21:31:32 2017(r312899)
+++ head/sys/cam/cam_xpt.c  Fri Jan 27 21:55:47 2017(r312900)
@@ -3062,8 +3062,8 @@ call_sim:
case XPT_TERM_IO:
case XPT_ENG_INQ:
/* XXX Implement */
-   xpt_print_path(start_ccb->ccb_h.path);
-   printf("%s: CCB type %#x %s not supported\n", __func__,
+   xpt_print(start_ccb->ccb_h.path,
+   "%s: CCB type %#x %s not supported\n", __func__,
start_ccb->ccb_h.func_code,
xpt_action_name(start_ccb->ccb_h.func_code));
start_ccb->ccb_h.status = CAM_PROVIDE_FAIL;
@@ -3944,8 +3944,8 @@ xpt_bus_register(struct cam_sim *sim, de
}
}
if (new_bus->xport == NULL) {
-   xpt_print_path(path);
-   printf("No transport found for %d\n", cpi.transport);
+   xpt_print(path,
+   "No transport found for %d\n", cpi.transport);
xpt_release_bus(new_bus);
free(path, M_CAMXPT);
return (CAM_RESRC_UNAVAIL);
___
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: r312857 - head

2017-01-27 Thread John Baldwin
On Friday, January 27, 2017 03:36:01 PM Ed Maste wrote:
> On 27 January 2017 at 14:38, John Baldwin  wrote:
> >
> > Which external toolchain?  Building with GCC 6 and binutils from ports 
> > worked
> > fine for me?
> 
> This was using the mips64-xtoolchain-gcc package and
> CROSS_TOOLCHAIN=mips64-gcc. It appears that it picked up the host's nm
> while building compat32.
> 
> If you are building on a FreeBSD 11 or -CURRENT host it will work even
> if it gets the host nm, because /usr/bin/nm is ELF Tool Chain's and
> includes support for all architectures, but I'm building on 10.x and
> the GNU nm there only handles x86 objects.

Ah, yes I am testing on 11.  Good catch then.

-- 
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: r312899 - in head/contrib: binutils/gas/config gcc/config/mips

2017-01-27 Thread Ed Maste
Author: emaste
Date: Fri Jan 27 21:31:32 2017
New Revision: 312899
URL: https://svnweb.freebsd.org/changeset/base/312899

Log:
  add octeon+ as an alias for octeon in GCC & binutils
  
  In r208737 jmallett@ added support for the "mips64r2" architecture
  and "octeon" CPU, and the saa/saad instructions.
  
  Upstream binutils also added the "octeon+" CPU, and the saa/saad
  instructions are only available in octeon+, not octeon.  Since our
  base system tool chain already accepts saa/saad with -march=octeon,
  just allow octeon+ as an alias.
  
  This allows the use of octeon+ in kernel config files, for use with both
  external tool chain and in-tree GCC/binutils.
  
  PR:   216516
  MFC after:1 month
  Sponsored by: The FreeBSD Foundation

Modified:
  head/contrib/binutils/gas/config/tc-mips.c
  head/contrib/gcc/config/mips/mips.c
  head/contrib/gcc/config/mips/mips.h

Modified: head/contrib/binutils/gas/config/tc-mips.c
==
--- head/contrib/binutils/gas/config/tc-mips.c  Fri Jan 27 21:26:23 2017
(r312898)
+++ head/contrib/binutils/gas/config/tc-mips.c  Fri Jan 27 21:31:32 2017
(r312899)
@@ -15156,6 +15156,7 @@ static const struct mips_cpu_info mips_c
 
   /* Cavium Networks Octeon CPU core */
   { "octeon", 0,  ISA_MIPS64R2,   CPU_OCTEON },
+  { "octeon+",0,  ISA_MIPS64R2,   CPU_OCTEON },
 
   /* End marker */
   { NULL, 0, 0, 0 }

Modified: head/contrib/gcc/config/mips/mips.c
==
--- head/contrib/gcc/config/mips/mips.c Fri Jan 27 21:26:23 2017
(r312898)
+++ head/contrib/gcc/config/mips/mips.c Fri Jan 27 21:31:32 2017
(r312899)
@@ -765,6 +765,7 @@ const struct mips_cpu_info mips_cpu_info
 
   /* MIPS64R2 */
   { "octeon", PROCESSOR_OCTEON, 65 },
+  { "octeon+", PROCESSOR_OCTEON, 65 },
 
   /* End marker */
   { 0, 0, 0 }

Modified: head/contrib/gcc/config/mips/mips.h
==
--- head/contrib/gcc/config/mips/mips.h Fri Jan 27 21:26:23 2017
(r312898)
+++ head/contrib/gcc/config/mips/mips.h Fri Jan 27 21:31:32 2017
(r312899)
@@ -285,7 +285,10 @@ extern const struct mips_rtx_cost_data *
\
   macro = concat ((PREFIX), "_", (INFO)->name, NULL);  \
   for (p = macro; *p != 0; p++)\
-   *p = TOUPPER (*p);  \
+   if (*p == '+')  \
+ *p = 'P'; \
+   else\
+ *p = TOUPPER (*p);\
\
   builtin_define (macro);  \
   builtin_define_with_value ((PREFIX), (INFO)->name, 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: r312897 - head/tools/build/mk

2017-01-27 Thread Ed Maste
Author: emaste
Date: Fri Jan 27 21:18:23 2017
New Revision: 312897
URL: https://svnweb.freebsd.org/changeset/base/312897

Log:
  Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC
  
  An additional case missed in r312855

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Jan 27 21:14:42 
2017(r312896)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Jan 27 21:18:23 
2017(r312897)
@@ -221,7 +221,7 @@ OLD_DIRS+=usr/share/examples/bhyve
 
 .if ${MK_BINUTILS} == no
 OLD_FILES+=usr/bin/as
-.if ${MK_LLD_AS_LD} == no
+.if ${MK_LLD_IS_LD} == no
 OLD_FILES+=usr/bin/ld
 .endif
 OLD_FILES+=usr/bin/ld.bfd
___
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: r312857 - head

2017-01-27 Thread Ed Maste
On 27 January 2017 at 14:38, John Baldwin  wrote:
>
> Which external toolchain?  Building with GCC 6 and binutils from ports worked
> fine for me?

This was using the mips64-xtoolchain-gcc package and
CROSS_TOOLCHAIN=mips64-gcc. It appears that it picked up the host's nm
while building compat32.

If you are building on a FreeBSD 11 or -CURRENT host it will work even
if it gets the host nm, because /usr/bin/nm is ELF Tool Chain's and
includes support for all architectures, but I'm building on 10.x and
the GNU nm there only handles x86 objects.
___
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: r312770 - in head/sys: net netinet netinet6

2017-01-27 Thread Gleb Smirnoff
On Fri, Jan 27, 2017 at 05:34:45PM +1100, Bruce Evans wrote:
B> > On Thu, Jan 26, 2017 at 02:03:05PM +1100, Bruce Evans wrote:
B> > B> On Thu, 26 Jan 2017, Konstantin Belousov wrote:
B> > B>
B> > B> > On Wed, Jan 25, 2017 at 02:20:06PM -0800, Gleb Smirnoff wrote:
B> > B> >>   Thanks, Luiz!
B> > B> >>
B> > B> >>   One stylistic nit that I missed in review:
B> > B> >>
B> > B> >> L>  static int
B> > B> >> L> -in_difaddr_ioctl(caddr_t data, struct ifnet *ifp, struct thread 
*td)
B> > B> >> L> +in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, 
struct thread *td)
B> > B> >> L>  {
B> > B> >> L>   const struct ifreq *ifr = (struct ifreq *)data;
B> > B> >> L>   const struct sockaddr_in *addr = (const struct sockaddr_in *)
B> > B> >> L> @@ -618,7 +618,8 @@ in_difaddr_ioctl(caddr_t data, struct if
B> > B> >> L>   in_ifadown(&ia->ia_ifa, 1);
B> > B> >> L>
B> > B> >> L>   if (ia->ia_ifa.ifa_carp)
B> > B> >> L> - (*carp_detach_p)(&ia->ia_ifa);
B> > B> >> L> + (*carp_detach_p)(&ia->ia_ifa,
B> > B> >> L> + (cmd == SIOCDIFADDR) ? false : true);
B> > B> >>
B> > B> >> Can we change the very last line to:
B> > B> >>
B> > B> >>  (cmd == SIOCAIFADDR) ? true : false);
B> > B>
B> > B> That is not stylistic, but invert the result.  Perhaps you meant to
B> > B> reverse the test to avoid negative logic for the result.
B> >
B> > It uses different ioctl value, so it doesn't invert result. Instead
B> > of !SIOCDIFADDR I want more explicit SIOCAIFADDR.
B> 
B> Oops.  So it is non-stylistic in a different way.  cmd can only be
B> SIOCDIFADDR, or one or both of SIOCAIFADDR.  Than is unclear.  Assuming
B> that the original code is correct and that all 3 cases can occur,
B> inversion would break all 3 cases, while the non-stylistic change breaks
B> only the O_SIOCAIFADDR case.
B> 
B> Since there can be more than 2 cases and it isn't clear that there are
B> at most 3, any boolean test on 1 of the cases is going to be unclear.
B> Positive logic will be clearer, but that requires comparison with 2
B> cases.  The current code use negative logic to select these 2 cases as
B> the complement of the other case.

O_SIOCAIFADDR should just be deleted. My suggestion is not only convert
to positive logic, but also outline that SIOCAIFADDR is an exceptional
case, in all other cases in_difaddr_ioctl() which is named "delete ifaddr"
should do delete everything.

-- 
Totus tuus, Glebius.
___
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: r312755 - head/sys/net

2017-01-27 Thread John Baldwin
On Wednesday, January 25, 2017 02:37:05 PM Sean Bruno wrote:
> Author: sbruno
> Date: Wed Jan 25 14:37:05 2017
> New Revision: 312755
> URL: https://svnweb.freebsd.org/changeset/base/312755
> 
> Log:
>   Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
>   success and a good value.  Only then try to use it and set the MSIX_ENABLE
>   bit.
>   
>   With the current em(4) driver we have observed failures in this case in a
>   specific environment when pci_find_cap() would not return the assumed
>   value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
>   which is read-only.

Why is this writing directly to the MSIX registers at all?  pci_alloc_msix()
etc. handle those registers for all other drivers and proper suspend/resume
depends on drivers using the existing PCI API for managing MSI and MSI-X.

> Modified: head/sys/net/iflib.c
> ==
> --- head/sys/net/iflib.c  Wed Jan 25 13:42:38 2017(r312754)
> +++ head/sys/net/iflib.c  Wed Jan 25 14:37:05 2017(r312755)
> @@ -4779,15 +4783,20 @@ iflib_msix_init(if_ctx_t ctx)
>   uint16_t pci_cmd_word;
>   int msix_ctrl, rid;
>  
> - rid = 0;
>   pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2);
>   pci_cmd_word |= PCIM_CMD_BUSMASTEREN;
>   pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2);

This should use 'pci_enable_busmaster()' like other drivers rather than
manipulating registers directly.

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


Re: svn commit: r312857 - head

2017-01-27 Thread John Baldwin
On Friday, January 27, 2017 03:43:18 AM Ed Maste wrote:
> Author: emaste
> Date: Fri Jan 27 03:43:18 2017
> New Revision: 312857
> URL: https://svnweb.freebsd.org/changeset/base/312857
> 
> Log:
>   Use cross-NM (XNM) in compat32 build
>   
>   An attempt to build mips64 using external toolchain failed as it tried
>   to use the host amd64 nm.
>   
>   MFC after:  1 month
>   Sponsored by:   The FreeBSD Foundation

Which external toolchain?  Building with GCC 6 and binutils from ports worked 
fine for me?

OTOH, it seems that trying to use clang (in HEAD) with external binutils 
might be buggy as it doesn't pass the '-m ' down to ld like GCC
does.

-- 
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: r312893 - head/sys/cddl/contrib/opensolaris/uts/intel/dtrace

2017-01-27 Thread Mark Johnston
Author: markj
Date: Fri Jan 27 17:58:41 2017
New Revision: 312893
URL: https://svnweb.freebsd.org/changeset/base/312893

Log:
  Fix an off-by-one in an assertion on fasttrap tracepoint sizes.
  
  FASTTRAP_MAX_INSTR_SIZE is the largest valid value of a tracepoint, so
  correct the assertion accordingly. This limit was hit with a 15-byte NOP.
  
  Reported by:  bdrewery
  MFC after:1 week
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Fri Jan 
27 17:54:24 2017(r312892)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c   Fri Jan 
27 17:58:41 2017(r312893)
@@ -1616,7 +1616,7 @@ fasttrap_pid_probe(struct reg *rp)
 * a signal we can reset the value of the scratch register.
 */
 
-   ASSERT(tp->ftt_size < FASTTRAP_MAX_INSTR_SIZE);
+   ASSERT(tp->ftt_size <= FASTTRAP_MAX_INSTR_SIZE);
 
curthread->t_dtrace_scrpc = addr;
bcopy(tp->ftt_instr, &scratch[i], tp->ftt_size);
___
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: r312890 - head/sys/kern

2017-01-27 Thread Mateusz Guzik
Author: mjg
Date: Fri Jan 27 15:03:51 2017
New Revision: 312890
URL: https://svnweb.freebsd.org/changeset/base/312890

Log:
  Sprinkle __read_mostly on backoff and lock profiling code.
  
  MFC after:1 month

Modified:
  head/sys/kern/kern_lockstat.c
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_rwlock.c
  head/sys/kern/kern_sx.c
  head/sys/kern/subr_lock.c

Modified: head/sys/kern/kern_lockstat.c
==
--- head/sys/kern/kern_lockstat.c   Fri Jan 27 14:56:36 2017
(r312889)
+++ head/sys/kern/kern_lockstat.c   Fri Jan 27 15:03:51 2017
(r312890)
@@ -27,6 +27,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,7 +62,7 @@ SDT_PROBE_DEFINE1(lockstat, , , sx__down
 
 SDT_PROBE_DEFINE2(lockstat, , , thread__spin, "struct mtx *", "uint64_t");
 
-int lockstat_enabled = 0;
+int __read_mostly lockstat_enabled;
 
 uint64_t 
 lockstat_nsecs(struct lock_object *lo)

Modified: head/sys/kern/kern_mutex.c
==
--- head/sys/kern/kern_mutex.c  Fri Jan 27 14:56:36 2017(r312889)
+++ head/sys/kern/kern_mutex.c  Fri Jan 27 15:03:51 2017(r312890)
@@ -140,7 +140,7 @@ struct lock_class lock_class_mtx_spin = 
 #ifdef ADAPTIVE_MUTEXES
 static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging");
 
-static struct lock_delay_config mtx_delay = {
+static struct lock_delay_config __read_mostly mtx_delay = {
.initial= 1000,
.step   = 500,
.min= 100,
@@ -171,7 +171,7 @@ LOCK_DELAY_SYSINIT(mtx_delay_sysinit);
 static SYSCTL_NODE(_debug, OID_AUTO, mtx_spin, CTLFLAG_RD, NULL,
 "mtx spin debugging");
 
-static struct lock_delay_config mtx_spin_delay = {
+static struct lock_delay_config __read_mostly mtx_spin_delay = {
.initial= 1000,
.step   = 500,
.min= 100,

Modified: head/sys/kern/kern_rwlock.c
==
--- head/sys/kern/kern_rwlock.c Fri Jan 27 14:56:36 2017(r312889)
+++ head/sys/kern/kern_rwlock.c Fri Jan 27 15:03:51 2017(r312890)
@@ -100,7 +100,7 @@ static SYSCTL_NODE(_debug, OID_AUTO, rwl
 SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, "");
 SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, "");
 
-static struct lock_delay_config rw_delay = {
+static struct lock_delay_config __read_mostly rw_delay = {
.initial= 1000,
.step   = 500,
.min= 100,

Modified: head/sys/kern/kern_sx.c
==
--- head/sys/kern/kern_sx.c Fri Jan 27 14:56:36 2017(r312889)
+++ head/sys/kern/kern_sx.c Fri Jan 27 15:03:51 2017(r312890)
@@ -148,7 +148,7 @@ static SYSCTL_NODE(_debug, OID_AUTO, sx,
 SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, "");
 SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, "");
 
-static struct lock_delay_config sx_delay = {
+static struct lock_delay_config __read_mostly sx_delay = {
.initial= 1000,
.step   = 500,
.min= 100,

Modified: head/sys/kern/subr_lock.c
==
--- head/sys/kern/subr_lock.c   Fri Jan 27 14:56:36 2017(r312889)
+++ head/sys/kern/subr_lock.c   Fri Jan 27 15:03:51 2017(r312890)
@@ -213,7 +213,7 @@ struct lock_prof_cpu {
 
 struct lock_prof_cpu *lp_cpu[MAXCPU];
 
-volatile int lock_prof_enable = 0;
+volatile int __read_mostly lock_prof_enable;
 static volatile int lock_prof_resetting;
 
 #define LPROF_SBUF_SIZE256
___
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: r312889 - head/sys/kern

2017-01-27 Thread Mateusz Guzik
Author: mjg
Date: Fri Jan 27 14:56:36 2017
New Revision: 312889
URL: https://svnweb.freebsd.org/changeset/base/312889

Log:
  cache: annotate with __read_mostly and __exclusive_cache_line
  
  MFC after:1 month

Modified:
  head/sys/kern/vfs_cache.c

Modified: head/sys/kern/vfs_cache.c
==
--- head/sys/kern/vfs_cache.c   Fri Jan 27 14:53:09 2017(r312888)
+++ head/sys/kern/vfs_cache.c   Fri Jan 27 14:56:36 2017(r312889)
@@ -200,48 +200,47 @@ structnamecache_ts {
  */
 #define NCHHASH(hash) \
(&nchashtbl[(hash) & nchash])
-static LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */
-static u_long  nchash; /* size of hash table */
+static __read_mostly LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table 
*/
+static u_long __read_mostlynchash; /* size of hash table */
 SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0,
 "Size of namecache hash table");
-static u_long  ncnegfactor = 16;   /* ratio of negative entries */
+static u_long __read_mostlyncnegfactor = 16; /* ratio of negative entries 
*/
 SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0,
 "Ratio of negative namecache entries");
-static u_long  numneg; /* number of negative entries allocated 
*/
+static u_long __exclusive_cache_line   numneg; /* number of negative entries 
allocated */
 SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0,
 "Number of negative entries in namecache");
-static u_long  numcache;   /* number of cache entries allocated */
+static u_long __exclusive_cache_line   numcache;/* number of cache entries 
allocated */
 SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0,
 "Number of namecache entries");
-static u_long  numcachehv; /* number of cache entries with vnodes 
held */
+static u_long __exclusive_cache_line   numcachehv;/* number of cache entries 
with vnodes held */
 SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0,
 "Number of namecache entries with vnodes held");
-u_int  ncsizefactor = 2;
+u_int __read_mostlyncsizefactor = 2;
 SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0,
 "Size factor for namecache");
-static u_int   ncpurgeminvnodes;
+static u_int __read_mostly ncpurgeminvnodes;
 SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, &ncpurgeminvnodes, 0,
 "Number of vnodes below which purgevfs ignores the request");
-static u_int   ncneghitsrequeue = 8;
+static u_int __read_mostly ncneghitsrequeue = 8;
 SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, &ncneghitsrequeue, 0,
 "Number of hits to requeue a negative entry in the LRU list");
 
 struct nchstatsnchstats;   /* cache effectiveness 
statistics */
 
 static struct mtx   ncneg_shrink_lock;
+static int shrink_list_turn;
 
 struct neglist {
struct mtx  nl_lock;
TAILQ_HEAD(, namecache) nl_list;
 } __aligned(CACHE_LINE_SIZE);
 
-static struct neglist *neglists;
+static struct neglist __read_mostly*neglists;
 static struct neglist ncneg_hot;
 
-static int shrink_list_turn;
-
 #definenumneglists (ncneghash + 1)
-static u_int   ncneghash;
+static u_int __read_mostly ncneghash;
 static inline struct neglist *
 NCP2NEGLIST(struct namecache *ncp)
 {
@@ -250,14 +249,14 @@ NCP2NEGLIST(struct namecache *ncp)
 }
 
 #definenumbucketlocks (ncbuckethash + 1)
-static u_int   ncbuckethash;
-static struct rwlock_padalign  *bucketlocks;
+static u_int __read_mostly  ncbuckethash;
+static struct rwlock_padalign __read_mostly  *bucketlocks;
 #defineHASH2BUCKETLOCK(hash) \
((struct rwlock *)(&bucketlocks[((hash) & ncbuckethash)]))
 
 #definenumvnodelocks (ncvnodehash + 1)
-static u_int   ncvnodehash;
-static struct mtx *vnodelocks;
+static u_int __read_mostly  ncvnodehash;
+static struct mtx __read_mostly *vnodelocks;
 static inline struct mtx *
 VP2VNODELOCK(struct vnode *vp)
 {
@@ -272,10 +271,10 @@ VP2VNODELOCK(struct vnode *vp)
  * most common.  The large cache is used for entries which are too big to
  * fit in the small cache.
  */
-static uma_zone_t cache_zone_small;
-static uma_zone_t cache_zone_small_ts;
-static uma_zone_t cache_zone_large;
-static uma_zone_t cache_zone_large_ts;
+static uma_zone_t __read_mostly cache_zone_small;
+static uma_zone_t __read_mostly cache_zone_small_ts;
+static uma_zone_t __read_mostly cache_zone_large;
+static uma_zone_t __read_mostly cache_zone_large_ts;
 
 #defineCACHE_PATH_CUTOFF   35
 
@@ -341,7 +340,7 @@ cache_out_ts(struct namecache *ncp, stru
*ticksp = ((struct namecache_ts *)ncp)->nc_ticks;
 }
 
-static int doingcache = 1; /* 1 => enable the cache */
+static int __read_mostly   doingcache = 1; /* 1 => enable the cache */
 SYSCTL_IN

svn commit: r312888 - in head/sys: compat/linuxkpi/common/include/linux conf dev/drm2 sys

2017-01-27 Thread Mateusz Guzik
Author: mjg
Date: Fri Jan 27 14:53:09 2017
New Revision: 312888
URL: https://svnweb.freebsd.org/changeset/base/312888

Log:
  Introduce __read_mostly and __exclusive_cache_line macros.
  
  The intended use is to annotate frequently used globals which either rarely
  change (and thus can be grouped in the same cacheline) or are an atomic 
counter
  (which means it may benefit from being the only variable in the cacheline).
  
  Linker script support is provided only for amd64. Architectures without it 
risk
  having other variables put in, i.e. as if they were not annotated. This is
  harmless from correctness point of view.
  
  Reviewed by:  bde (previous version)
  MFC after:1 month

Modified:
  head/sys/compat/linuxkpi/common/include/linux/compiler.h
  head/sys/conf/ldscript.amd64
  head/sys/dev/drm2/drm_os_freebsd.h
  head/sys/sys/systm.h

Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h
==
--- head/sys/compat/linuxkpi/common/include/linux/compiler.hFri Jan 27 
14:17:48 2017(r312887)
+++ head/sys/compat/linuxkpi/common/include/linux/compiler.hFri Jan 27 
14:53:09 2017(r312888)
@@ -67,7 +67,6 @@
 #define typeof(x)  __typeof(x)
 
 #defineuninitialized_var(x)x = x
-#define__read_mostly __attribute__((__section__(".data.read_mostly")))
 #define__always_unused __unused
 #define__must_check__result_use_check
 

Modified: head/sys/conf/ldscript.amd64
==
--- head/sys/conf/ldscript.amd64Fri Jan 27 14:17:48 2017
(r312887)
+++ head/sys/conf/ldscript.amd64Fri Jan 27 14:53:09 2017
(r312888)
@@ -145,6 +145,17 @@ SECTIONS
   .got: { *(.got) }
   . = DATA_SEGMENT_RELRO_END (24, .);
   .got.plt: { *(.got.plt) }
+  . = ALIGN(64);
+  .data.read_mostly :
+  {
+*(.data.read_mostly)
+  }
+  . = ALIGN(64);
+  .data.exclusive_cache_line :
+  {
+*(.data.exclusive_cache_line)
+  }
+  . = ALIGN(64);
   .data   :
   {
 *(.data .data.* .gnu.linkonce.d.*)

Modified: head/sys/dev/drm2/drm_os_freebsd.h
==
--- head/sys/dev/drm2/drm_os_freebsd.h  Fri Jan 27 14:17:48 2017
(r312887)
+++ head/sys/dev/drm2/drm_os_freebsd.h  Fri Jan 27 14:53:09 2017
(r312888)
@@ -80,7 +80,6 @@ typedef void  irqreturn_t;
 
 #define__init
 #define__exit
-#define__read_mostly
 
 #defineBUILD_BUG_ON(x) CTASSERT(!(x))
 #defineBUILD_BUG_ON_NOT_POWER_OF_2(x)

Modified: head/sys/sys/systm.h
==
--- head/sys/sys/systm.hFri Jan 27 14:17:48 2017(r312887)
+++ head/sys/sys/systm.hFri Jan 27 14:53:09 2017(r312888)
@@ -129,6 +129,12 @@ void   kassert_panic(const char *fmt, ...)
 #defineSCHEDULER_STOPPED() __predict_false(curthread->td_stopsched)
 
 /*
+ * Align variables.
+ */
+#define__read_mostly   __section(".data.read_mostly")
+#define__exclusive_cache_line  __aligned(CACHE_LINE_SIZE) \
+   __section(".data.exclusive_cache_line")
+/*
  * XXX the hints declarations are even more misplaced than most declarations
  * in this file, since they are needed in one file (per arch) and only used
  * in two 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: r312887 - head/sys/dev/acpi_support

2017-01-27 Thread Shunsuke Akiyama
Author: akiyama
Date: Fri Jan 27 14:17:48 2017
New Revision: 312887
URL: https://svnweb.freebsd.org/changeset/base/312887

Log:
  Hide unneeded message under bootverbose.
  
  MFC after:1 week

Modified:
  head/sys/dev/acpi_support/acpi_panasonic.c

Modified: head/sys/dev/acpi_support/acpi_panasonic.c
==
--- head/sys/dev/acpi_support/acpi_panasonic.c  Fri Jan 27 14:12:34 2017
(r312886)
+++ head/sys/dev/acpi_support/acpi_panasonic.c  Fri Jan 27 14:17:48 2017
(r312887)
@@ -493,6 +493,10 @@ acpi_panasonic_notify(ACPI_HANDLE h, UIN
}
ACPI_SERIAL_END(panasonic);
break;
+   case 0x81:
+   if (!bootverbose)
+   break;
+   /* FALLTHROUGH */
default:
device_printf(sc->dev, "unknown notify: %#x\n", notify);
break;
___
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: r312886 - head/sys/contrib/ipfilter/netinet

2017-01-27 Thread Cy Schubert
Author: cy
Date: Fri Jan 27 14:12:34 2017
New Revision: 312886
URL: https://svnweb.freebsd.org/changeset/base/312886

Log:
  Fix lookup of original destination address when using a redirect rule.
  Transparent proxying, e.g. to squid, is an example of this.
  
  Obtained from:NetBSD ip_nat.c r1.17, ip_nat6.c r1.10
  MFC after:6 weeks

Modified:
  head/sys/contrib/ipfilter/netinet/ip_nat.c
  head/sys/contrib/ipfilter/netinet/ip_nat6.c

Modified: head/sys/contrib/ipfilter/netinet/ip_nat.c
==
--- head/sys/contrib/ipfilter/netinet/ip_nat.c  Fri Jan 27 11:59:02 2017
(r312885)
+++ head/sys/contrib/ipfilter/netinet/ip_nat.c  Fri Jan 27 14:12:34 2017
(r312886)
@@ -4704,8 +4704,8 @@ ipf_nat_lookupredir(np)
}
}
 
-   np->nl_realip = nat->nat_ndstip;
-   np->nl_realport = nat->nat_ndport;
+   np->nl_realip = nat->nat_odstip;
+   np->nl_realport = nat->nat_odport;
}
}
 

Modified: head/sys/contrib/ipfilter/netinet/ip_nat6.c
==
--- head/sys/contrib/ipfilter/netinet/ip_nat6.c Fri Jan 27 11:59:02 2017
(r312885)
+++ head/sys/contrib/ipfilter/netinet/ip_nat6.c Fri Jan 27 14:12:34 2017
(r312886)
@@ -2521,8 +2521,8 @@ ipf_nat6_lookupredir(np)
}
}
 
-   np->nl_realip6 = nat->nat_ndst6.in6;
-   np->nl_realport = nat->nat_ndport;
+   np->nl_realip6 = nat->nat_odst6.in6;
+   np->nl_realport = nat->nat_odport;
}
}
 
___
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: r312885 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 11:59:02 2017
New Revision: 312885
URL: https://svnweb.freebsd.org/changeset/base/312885

Log:
  sfxge(4): compact the first hot part of RxQ control
  
  buf_base_id is used on RxQ control operations only and not used on
  datapath.
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge_rx.h

Modified: head/sys/dev/sfxge/sfxge_rx.h
==
--- head/sys/dev/sfxge/sfxge_rx.h   Fri Jan 27 11:57:19 2017
(r312884)
+++ head/sys/dev/sfxge/sfxge_rx.h   Fri Jan 27 11:59:02 2017
(r312885)
@@ -155,7 +155,6 @@ struct sfxge_rxq {
struct sfxge_softc  *sc __aligned(CACHE_LINE_SIZE);
unsigned intindex;
efsys_mem_t mem;
-   unsigned intbuf_base_id;
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
@@ -175,6 +174,7 @@ struct sfxge_rxq {
unsigned intrefill_delay;
 
volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
+   unsigned intbuf_base_id;
 };
 
 /*
___
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: r312884 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 11:57:19 2017
New Revision: 312884
URL: https://svnweb.freebsd.org/changeset/base/312884

Log:
  sfxge(4): fix RxQ structure layout vs usage on datapath
  
  Recent changes in the pseudo header accessor prototypes start to
  use common code RxQ handle on datapath. The handle was located
  at the end of the structure with members not used on datapath.
  
  Reviewed by:philip
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D9359

Modified:
  head/sys/dev/sfxge/sfxge_rx.h

Modified: head/sys/dev/sfxge/sfxge_rx.h
==
--- head/sys/dev/sfxge/sfxge_rx.h   Fri Jan 27 11:56:18 2017
(r312883)
+++ head/sys/dev/sfxge/sfxge_rx.h   Fri Jan 27 11:57:19 2017
(r312884)
@@ -159,6 +159,7 @@ struct sfxge_rxq {
enum sfxge_rxq_stateinit_state;
unsigned intentries;
unsigned intptr_mask;
+   efx_rxq_t   *common;
 
struct sfxge_rx_sw_desc *queue __aligned(CACHE_LINE_SIZE);
unsigned intadded;
@@ -173,8 +174,7 @@ struct sfxge_rxq {
struct callout  refill_callout;
unsigned intrefill_delay;
 
-   efx_rxq_t   *common __aligned(CACHE_LINE_SIZE);
-   volatile enum sfxge_flush_state flush_state;
+   volatile enum sfxge_flush_state flush_state __aligned(CACHE_LINE_SIZE);
 };
 
 /*
___
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: r312883 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 11:56:18 2017
New Revision: 312883
URL: https://svnweb.freebsd.org/changeset/base/312883

Log:
  sfxge(4): fix invalid VLAN tagging after stop/start
  
  TxQ is destroyed on stop and last used tag should be reset to default 0
  on the next start.
  
  Reviewed by:philip
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D9358

Modified:
  head/sys/dev/sfxge/sfxge_tx.c

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Fri Jan 27 11:46:55 2017
(r312882)
+++ head/sys/dev/sfxge/sfxge_tx.c   Fri Jan 27 11:56:18 2017
(r312883)
@@ -1623,6 +1623,8 @@ sfxge_tx_qstart(struct sfxge_softc *sc, 
txq->max_pkt_desc = sfxge_tx_max_pkt_desc(sc, txq->type,
  tso_fw_assisted);
 
+   txq->hw_vlan_tci = 0;
+
SFXGE_TXQ_UNLOCK(txq);
 
return (0);
@@ -1839,7 +1841,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u
txq->type = type;
txq->evq_index = evq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
-   txq->hw_vlan_tci = 0;
 
return (0);
 
___
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: r312882 - in head/sys/dev/mlx5: . mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 11:46:55 2017
New Revision: 312882
URL: https://svnweb.freebsd.org/changeset/base/312882

Log:
  Use the busdma API to allocate all DMA-able memory.
  
  The MLX5 driver has four different types of DMA allocations which are
  now allocated using busdma:
  
  1) The 4K firmware DMA-able blocks. One busdma object per 4K allocation.
  2) Data for firmware commands use the 4K firmware blocks split into four 1K 
blocks.
  3) The 4K firmware blocks are also used for doorbell pages.
  4) The RQ-, SQ- and CQ- DMA rings. One busdma object per allocation.
  
  After this patch the mlx5en driver can be used with DMAR enabled in
  the FreeBSD kernel.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/device.h
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_alloc.c
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/device.h
==
--- head/sys/dev/mlx5/device.h  Fri Jan 27 11:29:33 2017(r312881)
+++ head/sys/dev/mlx5/device.h  Fri Jan 27 11:46:55 2017(r312882)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2015, Mellanox Technologies, Ltd.  All rights reserved.
+ * Copyright (c) 2013-2017, Mellanox Technologies, Ltd.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -103,6 +103,7 @@ __mlx5_mask(typ, fld))
 enum {
MLX5_MAX_COMMANDS   = 32,
MLX5_CMD_DATA_BLOCK_SIZE= 512,
+   MLX5_CMD_MBOX_SIZE  = 1024,
MLX5_PCI_CMD_XPORT  = 7,
MLX5_MKEY_BSF_OCTO_SIZE = 4,
MLX5_MAX_PSVS   = 4,
@@ -523,6 +524,11 @@ struct mlx5_cmd_prot_block {
u8  sig;
 };
 
+#defineMLX5_NUM_CMDS_IN_ADAPTER_PAGE \
+   (MLX5_ADAPTER_PAGE_SIZE / MLX5_CMD_MBOX_SIZE)
+CTASSERT(MLX5_CMD_MBOX_SIZE >= sizeof(struct mlx5_cmd_prot_block));
+CTASSERT(MLX5_CMD_MBOX_SIZE <= MLX5_ADAPTER_PAGE_SIZE);
+
 enum {
MLX5_CQE_SYND_FLUSHED_IN_ERROR = 5,
 };

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Fri Jan 27 11:29:33 2017(r312881)
+++ head/sys/dev/mlx5/driver.h  Fri Jan 27 11:46:55 2017(r312882)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013-2015, Mellanox Technologies, Ltd.  All rights reserved.
+ * Copyright (c) 2013-2017, Mellanox Technologies, Ltd.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -258,13 +258,26 @@ struct mlx5_cmd_first {
__be32  data[4];
 };
 
-struct mlx5_cmd_msg {
-   struct list_headlist;
-   struct cache_ent   *cache;
-   u32 len;
-   struct mlx5_cmd_first   first;
-   struct mlx5_cmd_mailbox*next;
+struct cache_ent;
+struct mlx5_fw_page {
+   union {
+   struct rb_node rb_node;
+   struct list_head list;
+   };
+   struct mlx5_cmd_first first;
+   struct mlx5_core_dev *dev;
+   bus_dmamap_t dma_map;
+   bus_addr_t dma_addr;
+   void *virt_addr;
+   struct cache_ent *cache;
+   u32 numpages;
+   u16 load_done;
+#defineMLX5_LOAD_ST_NONE 0
+#defineMLX5_LOAD_ST_SUCCESS 1
+#defineMLX5_LOAD_ST_FAILURE 2
+   u16 func_id;
 };
+#definemlx5_cmd_msg mlx5_fw_page
 
 struct mlx5_cmd_debug {
struct dentry  *dbg_root;
@@ -304,9 +317,16 @@ struct mlx5_cmd_stats {
 };
 
 struct mlx5_cmd {
-   void   *cmd_alloc_buf;
-   dma_addr_t  alloc_dma;
-   int alloc_size;
+   struct mlx5_fw_page *cmd_page;
+   bus_dma_tag_t dma_tag;
+   struct sx dma_sx;
+   struct mtx dma_mtx;
+#defineMLX5_DMA_OWNED(dev) mtx_owned(&(dev)->cmd.dma_mtx)
+#defineMLX5_DMA_LOCK(dev) mtx_lock(&(dev)->cmd.dma_mtx)
+#defineMLX5_DMA_UNLOCK(dev) mtx_unlock(&(dev)->cmd.dma_mtx)
+   struct cv dma_cv;
+#defineMLX5_DMA_DONE(dev) cv_broadcast(&(dev)->cmd.dma_cv)
+#defineMLX5_DMA_WAIT(dev) cv_wait(&(dev)->cmd.dma_cv, 
&(dev)->cmd.dma_mtx)
void   *cmd_buf;
dma_addr_t  dma;
u16 cmdif_rev;
@@ -331,7 +351,6 @@ struct mlx5_cmd {
struct semaphore pages_sem;
int mode;
struct mlx5_cmd_work_ent *ent_arr[MLX5_MAX_COMMANDS];
-   struct pci_pool *pool;
struct mlx5_cmd_debug dbg;
struct cmd_msg_cache cache;
int checksum_disabled;
@@ -345,24 +364,18 @@ struct mlx5_port_caps {
u8  ext_port_cap;
 };
 
-struct mlx5_cmd_mailbox {
-   

svn commit: r312881 - in head/sys/dev/mlx5: . mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 11:29:33 2017
New Revision: 312881
URL: https://svnweb.freebsd.org/changeset/base/312881

Log:
  Add support for device surprise removal and other PCI errors.
  
  - When device disappears from PCI indicate error device state and:
1) Trigger command completion for all pending commands
2) Prevent new commands from executing and return:
   - success for modify and remove/cleanup commands
   - failure for create/query commands
3) When reclaiming pages for a device in error state don't ask FW to
   return all given pages, just release the allocated memory
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
  head/sys/dev/mlx5/mlx5_core/mlx5_health.c
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Fri Jan 27 11:19:06 2017(r312880)
+++ head/sys/dev/mlx5/driver.h  Fri Jan 27 11:29:33 2017(r312881)
@@ -713,6 +713,7 @@ struct mlx5_cmd_work_ent {
u64 ts1;
u64 ts2;
u16 op;
+   u8  busy;
 };
 
 struct mlx5_pas {
@@ -791,6 +792,7 @@ static inline void *mlx5_vmalloc(unsigne
return rtn;
 }
 
+void mlx5_enter_error_state(struct mlx5_core_dev *dev);
 int mlx5_cmd_init(struct mlx5_core_dev *dev);
 void mlx5_cmd_cleanup(struct mlx5_core_dev *dev);
 void mlx5_cmd_use_events(struct mlx5_core_dev *dev);
@@ -862,6 +864,7 @@ void mlx5_rsc_event(struct mlx5_core_dev
 void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type);
 struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn);
 void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector);
+void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev);
 void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type);
 int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 
vecidx,
   int nent, u64 mask, const char *name, struct mlx5_uar 
*uar);

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 11:19:06 2017
(r312880)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 11:29:33 2017
(r312881)
@@ -119,6 +119,8 @@ static int alloc_ent(struct mlx5_cmd_wor
 {
unsigned long flags;
struct mlx5_cmd *cmd = ent->cmd;
+   struct mlx5_core_dev *dev =
+   container_of(cmd, struct mlx5_core_dev, cmd);
int ret = cmd->max_reg_cmds;
 
spin_lock_irqsave(&cmd->alloc_lock, flags);
@@ -128,7 +130,11 @@ static int alloc_ent(struct mlx5_cmd_wor
ret = -1;
}
 
+   if (dev->state != MLX5_DEVICE_STATE_UP)
+   ret = -1;
+
if (ret != -1) {
+   ent->busy = 1;
ent->idx = ret;
clear_bit(ent->idx, &cmd->bitmask);
cmd->ent_arr[ent->idx] = ent;
@@ -205,12 +211,16 @@ static void set_signature(struct mlx5_cm
 
 static void poll_timeout(struct mlx5_cmd_work_ent *ent)
 {
-   int poll_end = jiffies + msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000);
+   struct mlx5_core_dev *dev = container_of(ent->cmd,
+struct mlx5_core_dev, cmd);
+   int poll_end = jiffies +
+   msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC + 1000);
u8 own;
 
do {
own = ent->lay->status_own;
-   if (!(own & CMD_OWNER_HW)) {
+   if (!(own & CMD_OWNER_HW) ||
+   dev->state != MLX5_DEVICE_STATE_UP) {
ent->ret = 0;
return;
}
@@ -718,6 +728,173 @@ static void dump_command(struct mlx5_cor
pr_debug("\n");
 }
 
+static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode,
+  struct mlx5_outbox_hdr *hdr)
+{
+   hdr->status = 0;
+   hdr->syndrome = 0;
+
+   switch (opcode) {
+   case MLX5_CMD_OP_TEARDOWN_HCA:
+   case MLX5_CMD_OP_DISABLE_HCA:
+   case MLX5_CMD_OP_MANAGE_PAGES:
+   case MLX5_CMD_OP_DESTROY_MKEY:
+   case MLX5_CMD_OP_DESTROY_EQ:
+   case MLX5_CMD_OP_DESTROY_CQ:
+   case MLX5_CMD_OP_DESTROY_QP:
+   case MLX5_CMD_OP_DESTROY_PSV:
+   case MLX5_CMD_OP_DESTROY_SRQ:
+   case MLX5_CMD_OP_DESTROY_XRC_SRQ:
+   case MLX5_CMD_OP_DESTROY_DCT:
+   case MLX5_CMD_OP_DEALLOC_Q_COUNTER:
+   case MLX5_CMD_OP_DEALLOC_PD:
+   case MLX5_CMD_OP_DEALLOC_UAR:
+   case MLX5_CMD_OP_DETACH_FROM_MCG:
+   case MLX5_CMD_OP_DEALLOC_XRCD:
+   

svn commit: r312880 - in head/sys/dev/mlx5: . mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 11:19:06 2017
New Revision: 312880
URL: https://svnweb.freebsd.org/changeset/base/312880

Log:
  Wait for all VFs pages to be reclaimed before closing EQ pages.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Fri Jan 27 11:03:58 2017(r312879)
+++ head/sys/dev/mlx5/driver.h  Fri Jan 27 11:19:06 2017(r312880)
@@ -43,6 +43,7 @@
 #include 
 
 #define MLX5_QCOUNTER_SETS_NETDEV 64
+#define MLX5_MAX_NUMBER_OF_VFS 128
 
 enum {
MLX5_BOARD_ID_LEN = 64,
@@ -521,7 +522,7 @@ struct mlx5_priv {
s64 fw_pages;
atomic_treg_pages;
struct list_headfree_list;
-
+   s64 pages_per_func[MLX5_MAX_NUMBER_OF_VFS];
struct mlx5_core_health health;
 
struct mlx5_srq_table   srq_table;
@@ -850,6 +851,7 @@ void mlx5_core_req_pages_handler(struct 
 s32 npages);
 int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot);
 int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev);
+s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev);
 void mlx5_register_debugfs(void);
 void mlx5_unregister_debugfs(void);
 int mlx5_eq_init(struct mlx5_core_dev *dev);

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Jan 27 11:03:58 2017
(r312879)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Fri Jan 27 11:19:06 2017
(r312880)
@@ -853,6 +853,7 @@ static void mlx5_dev_cleanup(struct mlx5
mlx5_cleanup_qp_table(dev);
mlx5_cleanup_cq_table(dev);
unmap_bf_area(dev);
+   mlx5_wait_for_reclaim_vfs_pages(dev);
free_comp_eqs(dev);
mlx5_stop_eqs(dev);
mlx5_free_uuars(dev, &priv->uuari);

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cFri Jan 27 11:03:58 
2017(r312879)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cFri Jan 27 11:19:06 
2017(r312880)
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include "mlx5_core.h"
 
@@ -282,6 +283,7 @@ retry:
goto out_alloc;
}
dev->priv.fw_pages += npages;
+   dev->priv.pages_per_func[func_id] += npages;
 
if (out.hdr.status) {
err = mlx5_cmd_status_to_err(&out.hdr);
@@ -355,7 +357,7 @@ static int reclaim_pages(struct mlx5_cor
*nclaimed = num_claimed;
 
dev->priv.fw_pages -= num_claimed;
-
+   dev->priv.pages_per_func[func_id] -= num_claimed;
for (i = 0; i < num_claimed; i++) {
addr = be64_to_cpu(out->pas[i]);
free_4k(dev, addr);
@@ -423,6 +425,31 @@ enum {
MLX5_BLKS_FOR_RECLAIM_PAGES = 12
 };
 
+s64 mlx5_wait_for_reclaim_vfs_pages(struct mlx5_core_dev *dev)
+{
+   int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS);
+   s64 prevpages = 0;
+   s64 npages = 0;
+
+   while (!time_after(jiffies, end)) {
+   /* exclude own function, VFs only */
+   npages = dev->priv.fw_pages - dev->priv.pages_per_func[0];
+   if (!npages)
+   break;
+
+   if (npages != prevpages)
+   end = end + msecs_to_jiffies(100);
+
+   prevpages = npages;
+   msleep(1);
+   }
+
+   if (npages)
+   mlx5_core_warn(dev, "FW did not return all VFs pages, will 
cause to memory leak\n");
+
+   return -npages;
+}
+
 static int optimal_reclaimed_pages(void)
 {
struct mlx5_cmd_prot_block *block;
___
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: r312879 - head/sys/dev/mlx5/mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 11:03:58 2017
New Revision: 312879
URL: https://svnweb.freebsd.org/changeset/base/312879

Log:
  Rename struct fw_page into struct mlx5_fw_page as a preparation step
  for adding busdma support.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cFri Jan 27 10:56:03 
2017(r312878)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.cFri Jan 27 11:03:58 
2017(r312879)
@@ -37,7 +37,7 @@ struct mlx5_pages_req {
struct work_struct work;
 };
 
-struct fw_page {
+struct mlx5_fw_page {
struct rb_node  rb_node;
u64 addr;
struct page*page;
@@ -76,13 +76,13 @@ static int insert_page(struct mlx5_core_
struct rb_root *root = &dev->priv.page_root;
struct rb_node **new = &root->rb_node;
struct rb_node *parent = NULL;
-   struct fw_page *nfp;
-   struct fw_page *tfp;
+   struct mlx5_fw_page *nfp;
+   struct mlx5_fw_page *tfp;
int i;
 
while (*new) {
parent = *new;
-   tfp = rb_entry(parent, struct fw_page, rb_node);
+   tfp = rb_entry(parent, struct mlx5_fw_page, rb_node);
if (tfp->addr < addr)
new = &parent->rb_left;
else if (tfp->addr > addr)
@@ -107,15 +107,15 @@ static int insert_page(struct mlx5_core_
return 0;
 }
 
-static struct fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr)
+static struct mlx5_fw_page *find_fw_page(struct mlx5_core_dev *dev, u64 addr)
 {
struct rb_root *root = &dev->priv.page_root;
struct rb_node *tmp = root->rb_node;
-   struct fw_page *result = NULL;
-   struct fw_page *tfp;
+   struct mlx5_fw_page *result = NULL;
+   struct mlx5_fw_page *tfp;
 
while (tmp) {
-   tfp = rb_entry(tmp, struct fw_page, rb_node);
+   tfp = rb_entry(tmp, struct mlx5_fw_page, rb_node);
if (tfp->addr < addr) {
tmp = tmp->rb_left;
} else if (tfp->addr > addr) {
@@ -155,13 +155,13 @@ static int mlx5_cmd_query_pages(struct m
 
 static int alloc_4k(struct mlx5_core_dev *dev, u64 *addr)
 {
-   struct fw_page *fp;
+   struct mlx5_fw_page *fp;
unsigned n;
 
if (list_empty(&dev->priv.free_list))
return -ENOMEM;
 
-   fp = list_entry(dev->priv.free_list.next, struct fw_page, list);
+   fp = list_entry(dev->priv.free_list.next, struct mlx5_fw_page, list);
n = find_first_bit(&fp->bitmask, 8 * sizeof(fp->bitmask));
if (n >= MLX5_NUM_4K_IN_PAGE) {
mlx5_core_warn(dev, "alloc 4k bug\n");
@@ -179,7 +179,7 @@ static int alloc_4k(struct mlx5_core_dev
 
 static void free_4k(struct mlx5_core_dev *dev, u64 addr)
 {
-   struct fw_page *fwp;
+   struct mlx5_fw_page *fwp;
int n;
 
fwp = find_fw_page(dev, addr & PAGE_MASK);
@@ -439,7 +439,7 @@ static int optimal_reclaimed_pages(void)
 int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev)
 {
int end = jiffies + msecs_to_jiffies(MAX_RECLAIM_TIME_MSECS);
-   struct fw_page *fwp;
+   struct mlx5_fw_page *fwp;
struct rb_node *p;
int nclaimed = 0;
int err;
@@ -447,7 +447,7 @@ int mlx5_reclaim_startup_pages(struct ml
do {
p = rb_first(&dev->priv.page_root);
if (p) {
-   fwp = rb_entry(p, struct fw_page, rb_node);
+   fwp = rb_entry(p, struct mlx5_fw_page, rb_node);
err = reclaim_pages(dev, fwp->func_id,
optimal_reclaimed_pages(),
&nclaimed);
___
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: r312743 - head/sys/dev/cesa

2017-01-27 Thread Michal Meloun
This breaks DB-88F6XXX kernel with:

--- cesa.o ---
...
/usr2/Meloun/git/tegra/sys/dev/cesa/cesa.c:960:57: error: use of
undeclared identifier 'CESA_SA_CMD_SHA2'
CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE |
CESA_SA_CMD_SHA2);
  ^
/usr2/Meloun/git/tegra/sys/dev/cesa/cesa.c:1209:10: error: use of
undeclared identifier 'CESA_TDMA_NUM_OUTSTAND'
val |= CESA_TDMA_NUM_OUTSTAND;
   ^
2 errors generated.
*** [cesa.o] Error code 1

Michal


On 25.01.2017 11:22, Wojciech Macek wrote:
> Author: wma
> Date: Wed Jan 25 10:22:07 2017
> New Revision: 312743
> URL: https://svnweb.freebsd.org/changeset/base/312743
> 
> Log:
>   Use SoC ID - based detection in CESA
>   
>   This commit introduces following changes in order to get rid of
>   ifdef's from all around the driver.
>   * Introduce sc_soc_id field in cesa_softc structure - this value is
> obtained in cesa_attach() anyway, so make use of it.
>   * Replace ifdefs with SoC ID checks.
>   * Perform PM control status only for relevant SoC's.
>   
>   Submitted by:  Marcin Wojtas 
>   Obtained from: Semihalf
>   Sponsored by:  Stormshield
>   Reviewed by:   zbb
>   Differential revision: https://reviews.freebsd.org/D9247
> 
> Modified:
>   head/sys/dev/cesa/cesa.c
>   head/sys/dev/cesa/cesa.h
> 
> Modified: head/sys/dev/cesa/cesa.c
> ==
> --- head/sys/dev/cesa/cesa.c  Wed Jan 25 07:51:53 2017(r312742)
> +++ head/sys/dev/cesa/cesa.c  Wed Jan 25 10:22:07 2017(r312743)
> @@ -953,11 +953,13 @@ cesa_execute(struct cesa_softc *sc)
>   ctd = STAILQ_FIRST(&cr->cr_tdesc);
>  
>   CESA_TDMA_WRITE(sc, CESA_TDMA_ND, ctd->ctd_cthd_paddr);
> -#if defined (SOC_MV_ARMADA38X)
> - CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE | CESA_SA_CMD_SHA2);
> -#else
> - CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE);
> -#endif
> +
> + if (sc->sc_soc_id == MV_DEV_88F6828 ||
> + sc->sc_soc_id == MV_DEV_88F6820 ||
> + sc->sc_soc_id == MV_DEV_88F6810)
> + CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE | 
> CESA_SA_CMD_SHA2);
> + else
> + CESA_REG_WRITE(sc, CESA_SA_CMD, CESA_SA_CMD_ACTVATE);
>  
>   CESA_UNLOCK(sc, requests);
>  }
> @@ -968,6 +970,7 @@ cesa_setup_sram(struct cesa_softc *sc)
>   phandle_t sram_node;
>   ihandle_t sram_ihandle;
>   pcell_t sram_handle, sram_reg[2];
> + void *sram_va;
>   int rv;
>  
>   rv = OF_getencprop(ofw_bus_get_node(sc->sc_dev), "sram-handle",
> @@ -986,15 +989,17 @@ cesa_setup_sram(struct cesa_softc *sc)
>   /* Store SRAM size to be able to unmap in detach() */
>   sc->sc_sram_size = sram_reg[1];
>  
> -#if defined(SOC_MV_ARMADA38X)
> - void *sram_va;
> + if (sc->sc_soc_id != MV_DEV_88F6828 &&
> + sc->sc_soc_id != MV_DEV_88F6820 &&
> + sc->sc_soc_id != MV_DEV_88F6810)
> + return (0);
>  
>   /* SRAM memory was not mapped in platform_sram_devmap(), map it now */
>   sram_va = pmap_mapdev(sc->sc_sram_base_pa, sc->sc_sram_size);
>   if (sram_va == NULL)
>   return (ENOMEM);
>   sc->sc_sram_base_va = (vm_offset_t)sram_va;
> -#endif
> +
>   return (0);
>  }
>  
> @@ -1018,7 +1023,7 @@ static int
>  cesa_attach(device_t dev)
>  {
>   struct cesa_softc *sc;
> - uint32_t d, r;
> + uint32_t d, r, val;
>   int error;
>   int i;
>  
> @@ -1027,23 +1032,19 @@ cesa_attach(device_t dev)
>   sc->sc_error = 0;
>   sc->sc_dev = dev;
>  
> - /* Check if CESA peripheral device has power turned on */
> -#if defined(SOC_MV_KIRKWOOD)
> - if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) == CPU_PM_CTRL_CRYPTO) {
> - device_printf(dev, "not powered on\n");
> - return (ENXIO);
> - }
> -#else
> - if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) != CPU_PM_CTRL_CRYPTO) {
> - device_printf(dev, "not powered on\n");
> - return (ENXIO);
> - }
> -#endif
>   soc_id(&d, &r);
>  
>   switch (d) {
>   case MV_DEV_88F6281:
>   case MV_DEV_88F6282:
> + /* Check if CESA peripheral device has power turned on */
> + if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) ==
> + CPU_PM_CTRL_CRYPTO) {
> + device_printf(dev, "not powered on\n");
> + return (ENXIO);
> + }
> + sc->sc_tperr = 0;
> + break;
>   case MV_DEV_88F6828:
>   case MV_DEV_88F6820:
>   case MV_DEV_88F6810:
> @@ -1051,12 +1052,20 @@ cesa_attach(device_t dev)
>   break;
>   case MV_DEV_MV78100:
>   case MV_DEV_MV78100_Z0:
> + /* Check if CESA peripheral device has power turned on */
> + if (soc_power_ctrl_get(CPU_PM_CTRL_CRYPTO) !=
> + CP

svn commit: r312878 - head/sys/dev/mlx5/mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 10:56:03 2017
New Revision: 312878
URL: https://svnweb.freebsd.org/changeset/base/312878

Log:
  Fix command completion with callback scenario.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:47:53 2017
(r312877)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:56:03 2017
(r312878)
@@ -723,6 +723,9 @@ static void complete_command(struct mlx5
struct mlx5_cmd *cmd = ent->cmd;
struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev,
 cmd);
+   mlx5_cmd_cbk_t callback;
+   void *context;
+
s64 ds;
struct mlx5_cmd_stats *stats;
unsigned long flags;
@@ -744,6 +747,8 @@ static void complete_command(struct mlx5
spin_unlock_irqrestore(&stats->lock, flags);
}
 
+   callback = ent->callback;
+   context = ent->context;
err = ent->ret;
if (!err)
err = mlx5_copy_from_msg(ent->uout,
@@ -754,7 +759,7 @@ static void complete_command(struct mlx5
free_msg(dev, ent->in);
 
free_cmd(ent);
-   ent->callback(err, ent->context);
+   callback(err, context);
} else {
complete(&ent->done);
}
___
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: r312877 - head/sys/dev/mlx5/mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 10:47:53 2017
New Revision: 312877
URL: https://svnweb.freebsd.org/changeset/base/312877

Log:
  Minor code refactor as a preparation step for suprise removal of CX-4
  PCI device(s), changes:
  - alloc_entry() now clears bit for page slot entry aswell
  - update of cmd->ent_arr[] is now under cmd->alloc_lock
  - complete command if alloc_entry() fails
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:36:49 2017
(r312876)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:47:53 2017
(r312877)
@@ -39,6 +39,11 @@
 
 #include "mlx5_core.h"
 
+static int mlx5_copy_from_msg(void *to, struct mlx5_cmd_msg *from, int size);
+static void mlx5_free_cmd_msg(struct mlx5_core_dev *dev,
+ struct mlx5_cmd_msg *msg);
+static void free_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg);
+
 enum {
CMD_IF_REV = 5,
 };
@@ -110,18 +115,27 @@ static u8 alloc_token(struct mlx5_cmd *c
return token;
 }
 
-static int alloc_ent(struct mlx5_cmd *cmd)
+static int alloc_ent(struct mlx5_cmd_work_ent *ent)
 {
unsigned long flags;
-   int ret;
+   struct mlx5_cmd *cmd = ent->cmd;
+   int ret = cmd->max_reg_cmds;
 
spin_lock_irqsave(&cmd->alloc_lock, flags);
-   ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds);
-   if (ret < cmd->max_reg_cmds)
-   clear_bit(ret, &cmd->bitmask);
+   if (!ent->page_queue) {
+   ret = find_first_bit(&cmd->bitmask, cmd->max_reg_cmds);
+   if (ret >= cmd->max_reg_cmds)
+   ret = -1;
+   }
+
+   if (ret != -1) {
+   ent->idx = ret;
+   clear_bit(ent->idx, &cmd->bitmask);
+   cmd->ent_arr[ent->idx] = ent;
+   }
spin_unlock_irqrestore(&cmd->alloc_lock, flags);
 
-   return ret < cmd->max_reg_cmds ? ret : -1;
+   return ret;
 }
 
 static void free_ent(struct mlx5_cmd *cmd, int idx)
@@ -704,6 +718,49 @@ static void dump_command(struct mlx5_cor
pr_debug("\n");
 }
 
+static void complete_command(struct mlx5_cmd_work_ent *ent)
+{
+   struct mlx5_cmd *cmd = ent->cmd;
+   struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev,
+cmd);
+   s64 ds;
+   struct mlx5_cmd_stats *stats;
+   unsigned long flags;
+   int err;
+   struct semaphore *sem;
+
+   if (ent->page_queue)
+   sem = &cmd->pages_sem;
+   else
+   sem = &cmd->sem;
+
+   if (ent->callback) {
+   ds = ent->ts2 - ent->ts1;
+   if (ent->op < ARRAY_SIZE(cmd->stats)) {
+   stats = &cmd->stats[ent->op];
+   spin_lock_irqsave(&stats->lock, flags);
+   stats->sum += ds;
+   ++stats->n;
+   spin_unlock_irqrestore(&stats->lock, flags);
+   }
+
+   err = ent->ret;
+   if (!err)
+   err = mlx5_copy_from_msg(ent->uout,
+ent->out,
+ent->uout_size);
+
+   mlx5_free_cmd_msg(dev, ent->out);
+   free_msg(dev, ent->in);
+
+   free_cmd(ent);
+   ent->callback(err, ent->context);
+   } else {
+   complete(&ent->done);
+   }
+   up(sem);
+}
+
 static void cmd_work_handler(struct work_struct *work)
 {
struct mlx5_cmd_work_ent *ent = container_of(work, struct 
mlx5_cmd_work_ent, work);
@@ -719,19 +776,13 @@ static void cmd_work_handler(struct work
}
 
down(sem);
-   if (!ent->page_queue) {
-   ent->idx = alloc_ent(cmd);
-   if (ent->idx < 0) {
-   mlx5_core_err(dev, "failed to allocate command 
entry\n");
-   up(sem);
-   return;
-   }
-   } else {
-   ent->idx = cmd->max_reg_cmds;
+
+   if (alloc_ent(ent) < 0) {
+   complete_command(ent);
+   return;
}
 
ent->token = alloc_token(cmd);
-   cmd->ent_arr[ent->idx] = ent;
lay = get_inst(cmd, ent->idx);
ent->lay = lay;
memset(lay, 0, sizeof(*lay));
@@ -1108,23 +1159,12 @@ void mlx5_cmd_comp_handler(struct mlx5_c
 {
struct mlx5_cmd *cmd = &dev->cmd;
struct mlx5_cmd_work_ent *ent;
-   mlx5_cmd_cbk_t callback;
-   void *context;
-   int err;
int i;
-   struct semaphore *sem;
-   s64 ds;
-   struct mlx5_cmd_stats *stats;
-   unsigned long flags;
 
while (vec

svn commit: r312876 - in head/sys/dev/mlx5: . mlx5_core

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 10:36:49 2017
New Revision: 312876
URL: https://svnweb.freebsd.org/changeset/base/312876

Log:
  Use ffs() to scan for first bit instead of using a for() loop.
  Minor code refactor while at it.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h
  head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Fri Jan 27 10:20:38 2017(r312875)
+++ head/sys/dev/mlx5/driver.h  Fri Jan 27 10:36:49 2017(r312876)
@@ -859,7 +859,7 @@ void mlx5_cq_completion(struct mlx5_core
 void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type);
 void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type);
 struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn);
-void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector);
+void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector);
 void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type);
 int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 
vecidx,
   int nent, u64 mask, const char *name, struct mlx5_uar 
*uar);

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c
==
--- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:20:38 2017
(r312875)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c  Fri Jan 27 10:36:49 2017
(r312876)
@@ -760,7 +760,7 @@ static void cmd_work_handler(struct work
poll_timeout(ent);
/* make sure we read the descriptor after ownership is SW */
rmb();
-   mlx5_cmd_comp_handler(dev, 1UL << ent->idx);
+   mlx5_cmd_comp_handler(dev, 1U << ent->idx);
}
 }
 
@@ -1104,7 +1104,7 @@ static void free_msg(struct mlx5_core_de
}
 }
 
-void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, unsigned long vector)
+void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector)
 {
struct mlx5_cmd *cmd = &dev->cmd;
struct mlx5_cmd_work_ent *ent;
@@ -1112,60 +1112,63 @@ void mlx5_cmd_comp_handler(struct mlx5_c
void *context;
int err;
int i;
+   struct semaphore *sem;
s64 ds;
struct mlx5_cmd_stats *stats;
unsigned long flags;
 
-   for (i = 0; i < (1 << cmd->log_sz); i++) {
-   if (test_bit(i, &vector)) {
-   struct semaphore *sem;
-
-   ent = cmd->ent_arr[i];
-   if (ent->page_queue)
-   sem = &cmd->pages_sem;
+   while (vector != 0) {
+   i = ffs(vector) - 1;
+   vector &= ~(1U << i);
+   ent = cmd->ent_arr[i];
+   if (ent->page_queue)
+   sem = &cmd->pages_sem;
+   else
+   sem = &cmd->sem;
+   ent->ts2 = ktime_get_ns();
+   memcpy(ent->out->first.data, ent->lay->out,
+  sizeof(ent->lay->out));
+   dump_command(dev, ent, 0);
+   if (!ent->ret) {
+   if (!cmd->checksum_disabled)
+   ent->ret = verify_signature(ent);
else
-   sem = &cmd->sem;
-   ent->ts2 = ktime_get_ns();
-   memcpy(ent->out->first.data, ent->lay->out, 
sizeof(ent->lay->out));
-   dump_command(dev, ent, 0);
-   if (!ent->ret) {
-   if (!cmd->checksum_disabled)
-   ent->ret = verify_signature(ent);
-   else
-   ent->ret = 0;
-   ent->status = ent->lay->status_own >> 1;
-   mlx5_core_dbg(dev, "command completed. ret 
0x%x, delivery status %s(0x%x)\n",
- ent->ret, 
deliv_status_to_str(ent->status), ent->status);
-   }
-   free_ent(cmd, ent->idx);
-   if (ent->callback) {
-   ds = ent->ts2 - ent->ts1;
-   if (ent->op < ARRAY_SIZE(cmd->stats)) {
-   stats = &cmd->stats[ent->op];
-   spin_lock_irqsave(&stats->lock, flags);
-   stats->sum += ds;
-   ++stats->n;
-   spin_unlock_irqrestore(&stats->lock, 
flags);
-   }
-
-   callback = ent->callback;
-   contex

svn commit: r312875 - head/sys/dev/mlx5

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 10:20:38 2017
New Revision: 312875
URL: https://svnweb.freebsd.org/changeset/base/312875

Log:
  Make fw_pages statistics counter 64-bit to avoid overflow.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h

Modified: head/sys/dev/mlx5/driver.h
==
--- head/sys/dev/mlx5/driver.h  Fri Jan 27 10:06:20 2017(r312874)
+++ head/sys/dev/mlx5/driver.h  Fri Jan 27 10:20:38 2017(r312875)
@@ -518,7 +518,7 @@ struct mlx5_priv {
/* pages stuff */
struct workqueue_struct *pg_wq;
struct rb_root  page_root;
-   int fw_pages;
+   s64 fw_pages;
atomic_treg_pages;
struct list_headfree_list;
 
___
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: r312872 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 10:03:50 2017
New Revision: 312872
URL: https://svnweb.freebsd.org/changeset/base/312872

Log:
  Add support for reading advanced diagnostic counters.
  
  By default reading the diagnostic counters is disabled. The firmware
  decides which counters are supported and only those supported show up
  in the dev.mce.X.diagnostics sysctl tree.
  
  To enable reading of diagnostic counters set one or more of the
  following sysctls to one:
  
  dev.mce.X.conf.diag_general_enable=1
  dev.mce.X.conf.diag_pci_enable=1
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Added:
  head/sys/dev/mlx5/diagnostics.h   (contents, props changed)
  head/sys/dev/mlx5/mlx5_core/mlx5_diagnostics.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/modules/mlx5/Makefile

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Jan 27 09:11:44 2017(r312871)
+++ head/sys/conf/files Fri Jan 27 10:03:50 2017(r312872)
@@ -4462,6 +4462,8 @@ dev/mlx5/mlx5_core/mlx5_cmd.c optional
compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_cq.c   optional mlx5 pci   \
compile-with "${OFED_C}"
+dev/mlx5/mlx5_core/mlx5_diagnostics.c  optional mlx5 pci   \
+   compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_eq.c   optional mlx5 pci   \
compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_flow_table.c   optional mlx5 pci   \

Added: head/sys/dev/mlx5/diagnostics.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/mlx5/diagnostics.h Fri Jan 27 10:03:50 2017
(r312872)
@@ -0,0 +1,138 @@
+/*-
+ * Copyright (c) 2013-2017, Mellanox Technologies, Ltd.  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 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 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$
+ */
+
+#ifndef MLX5_CORE_DIAGNOSTICS_H
+#defineMLX5_CORE_DIAGNOSTICS_H
+
+#defineMLX5_CORE_DIAGNOSTICS_NUM(n, s, t) n
+#defineMLX5_CORE_DIAGNOSTICS_STRUCT(n, s, t) s,
+#defineMLX5_CORE_DIAGNOSTICS_ENTRY(n, s, t) { #s, (t) },
+
+struct mlx5_core_diagnostics_entry {
+   const char *const desc;
+   u16 counter_id;
+};
+
+#defineMLX5_CORE_PCI_DIAGNOSTICS(m) \
+m(+1, pxd_ready_bp, 0x0401) \
+m(+1, pci_write_bp, 0x0402) \
+m(+1, pci_read_bp, 0x0403) \
+m(+1, pci_read_stuck_no_completion_buffer, 0x0404) \
+m(+1, max_pci_bw, 0x0405) \
+m(+1, used_pci_bw, 0x0406) \
+m(+1, rx_pci_errors, 0) \
+m(+1, tx_pci_errors, 0) \
+m(+1, tx_pci_correctable_errors, 0) \
+m(+1, tx_pci_non_fatal_errors, 0) \
+m(+1, tx_pci_fatal_errors, 0)
+
+#defineMLX5_CORE_PCI_DIAGNOSTICS_NUM \
+   (0 MLX5_CORE_PCI_DIAGNOSTICS(MLX5_CORE_DIAGNOSTICS_NUM))
+
+union mlx5_core_pci_diagnostics {
+   u64 array[MLX5_CORE_PCI_DIAGNOSTICS_NUM];
+   struct {
+   u64 MLX5_CORE_PCI_DIAGNOSTICS(
+   MLX5_CORE_DIAGNOSTICS_STRUCT) dummy[0];
+   }   counter;
+};
+
+extern const struct mlx5_core_diagnostics_entry
+   mlx5_core_pci_diagnostics_table[MLX5_CORE_PCI_DIAGNOSTICS_NUM];
+
+#defineMLX5_CORE_GENERAL_DIAGNOSTICS(m) \
+m(+1, l0_mtt_miss, 0x0801) \
+m(+1, l0_mtt_hit, 0x0802) \
+m(+1, l1_mtt_miss, 0x0803) \
+m(+1, l1_mtt_hit, 0x0804) \
+m(+1, l0_mpt_miss, 0x0805) \
+m(+1, l0_mpt_hit, 0x0806) \
+m(+1, l1_mpt_miss, 0x0807) \
+m(+1, l1_mpt_hit, 0x0808) \
+m(+1, rxb_no_slow_path_credits, 0x0c01)

svn commit: r312868 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 08:54:33 2017
New Revision: 312868
URL: https://svnweb.freebsd.org/changeset/base/312868

Log:
  sfxge(4): cleanup: remove unused soft context struct member rxq_cache
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge.h

Modified: head/sys/dev/sfxge/sfxge.h
==
--- head/sys/dev/sfxge/sfxge.h  Fri Jan 27 08:53:11 2017(r312867)
+++ head/sys/dev/sfxge/sfxge.h  Fri Jan 27 08:54:33 2017(r312868)
@@ -302,7 +302,6 @@ struct sfxge_softc {
 #endif
 
unsigned intmax_rss_channels;
-   uma_zone_t  rxq_cache;
struct sfxge_rxq*rxq[SFXGE_RX_SCALE_MAX];
unsigned intrx_indir_table[EFX_RSS_TBL_SIZE];
 
___
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: r312867 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 08:53:11 2017
New Revision: 312867
URL: https://svnweb.freebsd.org/changeset/base/312867

Log:
  sfxge(4): cleanup: remvoe trailing tab
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge_rx.c

Modified: head/sys/dev/sfxge/sfxge_rx.c
==
--- head/sys/dev/sfxge/sfxge_rx.c   Fri Jan 27 08:51:48 2017
(r312866)
+++ head/sys/dev/sfxge/sfxge_rx.c   Fri Jan 27 08:53:11 2017
(r312867)
@@ -1096,7 +1096,7 @@ sfxge_rx_start(struct sfxge_softc *sc)
encp = efx_nic_cfg_get(sc->enp);
sc->rx_buffer_size = EFX_MAC_PDU(sc->ifnet->if_mtu);
 
-   /* Calculate the receive packet buffer size. */ 
+   /* Calculate the receive packet buffer size. */
sc->rx_prefix_size = encp->enc_rx_prefix_size;
 
/* Ensure IP headers are 32bit aligned */
___
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: r312866 - head/sys/dev/sfxge

2017-01-27 Thread Andrew Rybchenko
Author: arybchik
Date: Fri Jan 27 08:51:48 2017
New Revision: 312866
URL: https://svnweb.freebsd.org/changeset/base/312866

Log:
  sfxge(4): cleanup: remove unused txq_index TxQ control structure member
  
  Sponsored by:   Solarflare Communications, Inc.
  MFC after:  2 days

Modified:
  head/sys/dev/sfxge/sfxge_tx.c
  head/sys/dev/sfxge/sfxge_tx.h

Modified: head/sys/dev/sfxge/sfxge_tx.c
==
--- head/sys/dev/sfxge/sfxge_tx.c   Fri Jan 27 08:32:50 2017
(r312865)
+++ head/sys/dev/sfxge/sfxge_tx.c   Fri Jan 27 08:51:48 2017
(r312866)
@@ -1838,7 +1838,6 @@ sfxge_tx_qinit(struct sfxge_softc *sc, u
 
txq->type = type;
txq->evq_index = evq_index;
-   txq->txq_index = txq_index;
txq->init_state = SFXGE_TXQ_INITIALIZED;
txq->hw_vlan_tci = 0;
 

Modified: head/sys/dev/sfxge/sfxge_tx.h
==
--- head/sys/dev/sfxge/sfxge_tx.h   Fri Jan 27 08:32:50 2017
(r312865)
+++ head/sys/dev/sfxge/sfxge_tx.h   Fri Jan 27 08:51:48 2017
(r312866)
@@ -172,7 +172,6 @@ struct sfxge_txq {
enum sfxge_flush_state  flush_state;
unsigned inttso_fw_assisted;
enum sfxge_txq_type type;
-   unsigned inttxq_index;
unsigned intevq_index;
efsys_mem_t mem;
unsigned intbuf_base_id;
___
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: r312865 - head/sys/dev/mlx5/mlx5_en

2017-01-27 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Jan 27 08:32:50 2017
New Revision: 312865
URL: https://svnweb.freebsd.org/changeset/base/312865

Log:
  Enforce reading the consumer and producer counters once to ensure
  consistent return values from the mlx5e_sq_has_room_for()
  function. The two counters are incremented by different threads under
  different locks.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Fri Jan 27 08:30:43 2017
(r312864)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Fri Jan 27 08:32:50 2017
(r312865)
@@ -546,8 +546,10 @@ struct mlx5e_sq {
 static inline bool
 mlx5e_sq_has_room_for(struct mlx5e_sq *sq, u16 n)
 {
-   return ((sq->wq.sz_m1 & (sq->cc - sq->pc)) >= n ||
-   sq->cc == sq->pc);
+   u16 cc = sq->cc;
+   u16 pc = sq->pc;
+
+   return ((sq->wq.sz_m1 & (cc - pc)) >= n || cc == pc);
 }
 
 struct mlx5e_channel {
___
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: r312864 - head/sys/cam

2017-01-27 Thread Warner Losh
Author: imp
Date: Fri Jan 27 08:30:43 2017
New Revision: 312864
URL: https://svnweb.freebsd.org/changeset/base/312864

Log:
  Remove nested #ifdef that can't possibly be false.

Modified:
  head/sys/cam/cam_iosched.c

Modified: head/sys/cam/cam_iosched.c
==
--- head/sys/cam/cam_iosched.c  Fri Jan 27 07:45:06 2017(r312863)
+++ head/sys/cam/cam_iosched.c  Fri Jan 27 08:30:43 2017(r312864)
@@ -1629,7 +1629,6 @@ cam_iosched_update(struct iop_stats *iop
iop->sd = (int64_t)var < 0 ? 0 : isqrt64(var);
 }
 
-#ifdef CAM_IOSCHED_DYNAMIC
 static void
 cam_iosched_io_metric_update(struct cam_iosched_softc *isc,
 sbintime_t sim_latency, int cmd, size_t size)
@@ -1649,7 +1648,6 @@ cam_iosched_io_metric_update(struct cam_
break;
}
 }
-#endif
 
 #ifdef DDB
 static int biolen(struct bio_queue_head *bq)
___
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"