Re: svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/

2018-02-13 Thread Antoine Brodin
On Tue, Feb 13, 2018 at 11:43 PM, Mark Johnston  wrote:
> Author: markj
> Date: Tue Feb 13 22:43:07 2018
> New Revision: 329249
> URL: https://svnweb.freebsd.org/changeset/base/329249
>
> Log:
>   MFC r327888, r327972, r327973:
>   Add "jid" and "jailname" variables to DTrace.
>

Hi,

stable/11 fails to build:

/poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:316:19:
error: use of undeclared identifier 'DT_VERS_1_13'
DT_ATTR_STABCMN, DT_VERS_1_13, _idops_type, "string" },
 ^
/poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:317:60:
error: use of undeclared identifier 'DT_VERS_1_13'
{ "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13,
   ^
2 errors generated.

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


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Bruce Evans

On Tue, 13 Feb 2018, Ian Lepore wrote:


On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote:

On 13 February 2018 at 14:23, Ian Lepore  wrote:


On Tue, 2018-02-13 at 19:17 +, Ed Maste wrote:


Author: emaste
Date: Tue Feb 13 19:17:48 2018
New Revision: 329237
URL: https://svnweb.freebsd.org/changeset/base/329237

Log:
? libkern: use nul for terminating char rather than 0

? Akin to the change made in r188080 for lib/libc/string/.

? Reported by:bde
? Sponsored by:???The FreeBSD Foundation

There are many ways to spell 0.??Why are we using something other
than
the simplest way???Is it a style rule thing, or is it portability-
correctness, or what?


style(9) requires '\0' (by always spelling the character constant with
value 0 like that).


I made the change to improve consistency between lib/libc/string and
sys/libkern, which is what Bruce commented on some time ago. I don't
have a personal preference for 0 or '\0' but definitely believe that
if we have multiple, similar copies of a function they ought to avoid
gratuitous differences. (I'm happy to change both trees to 0 if
that's
preferred.)


Core parts of libc like stdio and (MI) string use '\0' fairly consistently.
There were about 10-20 plain 0's in string in FreeBSD-5, but most of these
have been changed to '\0'.  This gives a much larger set of examples of
normal style.


Oh, I agree completely about consistancy being important. ?I just
wanted to know whether I should try to remember to always use \0
because it's a rule or has some benefit I didn't know about.

20+ years ago I used to slavishly ensure I always used \0 when a char
type was involved, just as a personal style thing. ?Then over time I
came to the conclusion that "0 is 0 no matter how you spell it, so keep
it simple" (except for pointers... even in c++ I've always used NULL).


Probably the BSD style rule has the same origin.

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


Re: svn commit: r329257 - head/sys/powerpc/pseries

2018-02-13 Thread Nathan Whitehorn
There is another set of these that Linux added recently that are used 
for Meltdown/Spectre workarounds. Might be worth importing while these 
are being updated...

-Nathan

On 02/13/18 18:48, Justin Hibbits wrote:

Author: jhibbits
Date: Wed Feb 14 02:48:27 2018
New Revision: 329257
URL: https://svnweb.freebsd.org/changeset/base/329257

Log:
   powerpc64/pseries: Define new hcalls
   
   Summary:

   Define new hcalls as in 'Linux on Power Architecture Platform Reference'
   version 1.1 (24 March 2016) downloaded from:
   
   https://members.openpowerfoundation.org/document/dl/469
   
   Submitted by:	Breno Leitao

   Differential Revision:   https://reviews.freebsd.org/D14281

Modified:
   head/sys/powerpc/pseries/phyp-hvcall.h

Modified: head/sys/powerpc/pseries/phyp-hvcall.h
==
--- head/sys/powerpc/pseries/phyp-hvcall.h  Wed Feb 14 00:34:02 2018
(r329256)
+++ head/sys/powerpc/pseries/phyp-hvcall.h  Wed Feb 14 02:48:27 2018
(r329257)
@@ -296,7 +296,25 @@
  #define H_VPM_STAT0x2bc
  #define H_SET_MPP 0x2d0
  #define H_GET_MPP 0x2d4
-#define MAX_HCALL_OPCODE   H_GET_MPP
+#define H_MO_PERF  0x2d8
+#define H_REG_SUB_CRQ  0x2dc
+#define H_FREE_SUB_CRQ 0x2e0
+#define H_SEND_SUB_CRQ 0x2e4
+#define H_SEND_SUB_CRQ_IND 0x2e8
+#define H_HOME_NODE_ASSOC  0x2ec
+/* Reserved ... */
+#define H_BEST_ENERGY  0x2f4
+#define H_REG_SNS  0x2f8
+#define H_X_XIRR   0x2fc
+#define H_RANDOM   0x300
+/* Reserved ... */
+#define H_COP_OP   0x304
+#define H_STOP_COP_OP  0x308
+#define H_GET_MPP_X0x314
+#define H_SET_MODE 0x31C
+/* Reserved ... */
+#define H_GET_DMA_XLATES_L 0x324
+#define MAX_HCALL_OPCODE   H_GET_DMA_XLATES_L
  
  int64_t phyp_hcall(uint64_t opcode, ...);

  int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx,



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


svn commit: r329258 - head/sys/powerpc/pseries

2018-02-13 Thread Justin Hibbits
Author: jhibbits
Date: Wed Feb 14 02:51:28 2018
New Revision: 329258
URL: https://svnweb.freebsd.org/changeset/base/329258

Log:
  PPC64: Get the timestap from the proper OF field
  
  Summary:
  After revision rS328534('PPC64: use hwref instead of cpuid'), FreeBSD on
  powerpc64 virtual machine panics since it is unable to read the
  timebase, showing the following error:
  
   get-property for timebase-frequency on zero phandle
  
   panic: Unable to determine timebase frequency!
  
  With the change above,  cpuref->cr_hwref does not contain the phandle
  anymore, thus, it never reads the proper CPU entry in OF.
  
  Submitted by: Breno Leitao
  Differential Revision:https://reviews.freebsd.org/D14204

Modified:
  head/sys/powerpc/pseries/platform_chrp.c

Modified: head/sys/powerpc/pseries/platform_chrp.c
==
--- head/sys/powerpc/pseries/platform_chrp.cWed Feb 14 02:48:27 2018
(r329257)
+++ head/sys/powerpc/pseries/platform_chrp.cWed Feb 14 02:51:28 2018
(r329258)
@@ -285,12 +285,24 @@ chrp_real_maxaddr(platform_t plat)
 static u_long
 chrp_timebase_freq(platform_t plat, struct cpuref *cpuref)
 {
-   phandle_t phandle;
+   phandle_t cpus, cpunode;
int32_t ticks = -1;
+   int res;
+   char buf[8];
 
-   phandle = cpuref->cr_hwref;
+   cpus = OF_finddevice("/cpus");
+   if (cpus <= 0)
+   panic("CPU tree not found on Open Firmware\n");
 
-   OF_getencprop(phandle, "timebase-frequency", , sizeof(ticks));
+   for (cpunode = OF_child(cpus); cpunode != 0; cpunode = 
OF_peer(cpunode)) {
+   res = OF_getprop(cpunode, "device_type", buf, sizeof(buf));
+   if (res > 0 && strcmp(buf, "cpu") == 0)
+   break;
+   }
+   if (cpunode <= 0)
+   panic("CPU node not found on Open Firmware\n");
+
+   OF_getencprop(cpunode, "timebase-frequency", , sizeof(ticks));
 
if (ticks <= 0)
panic("Unable to determine timebase frequency!");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329257 - head/sys/powerpc/pseries

2018-02-13 Thread Justin Hibbits
Author: jhibbits
Date: Wed Feb 14 02:48:27 2018
New Revision: 329257
URL: https://svnweb.freebsd.org/changeset/base/329257

Log:
  powerpc64/pseries: Define new hcalls
  
  Summary:
  Define new hcalls as in 'Linux on Power Architecture Platform Reference'
  version 1.1 (24 March 2016) downloaded from:
  
  https://members.openpowerfoundation.org/document/dl/469
  
  Submitted by: Breno Leitao
  Differential Revision:https://reviews.freebsd.org/D14281

Modified:
  head/sys/powerpc/pseries/phyp-hvcall.h

Modified: head/sys/powerpc/pseries/phyp-hvcall.h
==
--- head/sys/powerpc/pseries/phyp-hvcall.h  Wed Feb 14 00:34:02 2018
(r329256)
+++ head/sys/powerpc/pseries/phyp-hvcall.h  Wed Feb 14 02:48:27 2018
(r329257)
@@ -296,7 +296,25 @@
 #define H_VPM_STAT 0x2bc
 #define H_SET_MPP  0x2d0
 #define H_GET_MPP  0x2d4
-#define MAX_HCALL_OPCODE   H_GET_MPP
+#define H_MO_PERF  0x2d8
+#define H_REG_SUB_CRQ  0x2dc
+#define H_FREE_SUB_CRQ 0x2e0
+#define H_SEND_SUB_CRQ 0x2e4
+#define H_SEND_SUB_CRQ_IND 0x2e8
+#define H_HOME_NODE_ASSOC  0x2ec
+/* Reserved ... */
+#define H_BEST_ENERGY  0x2f4
+#define H_REG_SNS  0x2f8
+#define H_X_XIRR   0x2fc
+#define H_RANDOM   0x300
+/* Reserved ... */
+#define H_COP_OP   0x304
+#define H_STOP_COP_OP  0x308
+#define H_GET_MPP_X0x314
+#define H_SET_MODE 0x31C
+/* Reserved ... */
+#define H_GET_DMA_XLATES_L 0x324
+#define MAX_HCALL_OPCODE   H_GET_DMA_XLATES_L
 
 int64_t phyp_hcall(uint64_t opcode, ...);
 int64_t phyp_pft_hcall(uint64_t opcode, uint64_t flags, uint64_t pteidx,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329256 - head/sys/vm

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 14 00:34:02 2018
New Revision: 329256
URL: https://svnweb.freebsd.org/changeset/base/329256

Log:
  Cleanup unused page argument for vm_reserv_break().
  
  Reviewed by:  markj
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D14364

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==
--- head/sys/vm/vm_reserv.c Wed Feb 14 00:32:19 2018(r329255)
+++ head/sys/vm/vm_reserv.c Wed Feb 14 00:34:02 2018(r329256)
@@ -259,7 +259,7 @@ struct mtx_padalign vm_reserv_object_mtx[VM_RESERV_OBJ
 #definevm_reserv_object_unlock(object) \
mtx_unlock(vm_reserv_object_lock_ptr((object)))
 
-static voidvm_reserv_break(vm_reserv_t rv, vm_page_t m);
+static voidvm_reserv_break(vm_reserv_t rv);
 static voidvm_reserv_depopulate(vm_reserv_t rv, int index);
 static vm_reserv_t vm_reserv_from_page(vm_page_t m);
 static boolean_t   vm_reserv_has_pindex(vm_reserv_t rv,
@@ -934,34 +934,21 @@ vm_reserv_alloc_page(vm_object_t object, vm_pindex_t p
 }
 
 /*
- * Breaks the given reservation.  Except for the specified free page, all free
- * pages in the reservation are returned to the physical memory allocator.
- * The reservation's population count and map are reset to their initial
- * state.
+ * Breaks the given reservation.  All free pages in the reservation
+ * are returned to the physical memory allocator.  The reservation's
+ * population count and map are reset to their initial state.
  *
  * The given reservation must not be in the partially populated reservation
  * queue.  The free page queue lock must be held.
  */
 static void
-vm_reserv_break(vm_reserv_t rv, vm_page_t m)
+vm_reserv_break(vm_reserv_t rv)
 {
int begin_zeroes, hi, i, lo;
 
vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
vm_reserv_remove(rv);
rv->pages->psind = 0;
-   if (m != NULL) {
-   /*
-* Since the reservation is being broken, there is no harm in
-* abusing the population map to stop "m" from being returned
-* to the physical memory allocator.
-*/
-   i = m - rv->pages;
-   KASSERT(popmap_is_clear(rv->popmap, i),
-   ("vm_reserv_break: reserv %p's popmap is corrupted", rv));
-   popmap_set(rv->popmap, i);
-   rv->popcnt++;
-   }
i = hi = 0;
do {
/* Find the next 0 bit.  Any previous 0 bits are < "hi". */
@@ -1039,7 +1026,7 @@ vm_reserv_break_all(vm_object_t object)
TAILQ_REMOVE(_rvq_partpop[rv->domain], rv, partpopq);
rv->inpartpopq = FALSE;
}
-   vm_reserv_break(rv, NULL);
+   vm_reserv_break(rv);
}
if (vmd != NULL)
vm_domain_free_unlock(vmd);
@@ -1156,7 +1143,7 @@ vm_reserv_reclaim(vm_reserv_t rv)
rv, rv->domain));
TAILQ_REMOVE(_rvq_partpop[rv->domain], rv, partpopq);
rv->inpartpopq = FALSE;
-   vm_reserv_break(rv, NULL);
+   vm_reserv_break(rv);
vm_reserv_reclaimed++;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329254 - head/sys/vm

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 14 00:31:45 2018
New Revision: 329254
URL: https://svnweb.freebsd.org/changeset/base/329254

Log:
  Ensure memory consistency on COW.
  
  From the submitter description:
  The process is forked transitioning a map entry to COW
  Thread A writes to a page on the map entry, faults, updates the pmap to
writable at a new phys addr, and starts TLB invalidations...
  Thread B acquires a lock, writes to a location on the new phys addr, and
releases the lock
  Thread C acquires the lock, reads from the location on the old phys addr...
  Thread A ...continues the TLB invalidations which are completed
  Thread C ...reads from the location on the new phys addr, and releases
the lock
  
  In this example Thread B and C [lock, use and unlock] properly and
  neither own the lock at the same time.  Thread A was writing somewhere
  else on the page and so never had/needed the lock. Thread C sees a
  location that is only ever read|modified under a lock change beneath
  it while it is the lock owner.
  
  To fix this, perform the two-stage update of the copied PTE.  First,
  the PTE is updated with the address of the new physical page with
  copied content, but in read-only mode.  The pmap locking and the page
  busy state during PTE update and TLB invalidation IPIs ensure that any
  writer to the page cannot upgrade the PTE to the writable state until
  all CPUs updated their TLB to not cache old mapping.  Then, after the
  busy state of the page is lifted, the faults for write can proceed and
  do not violate the consistency of the reads.
  
  The change is done in vm_fault because most architectures do need IPIs
  to invalidate remote TLBs.  More, I think that hardware guarantees of
  atomicity of the remote TLB invalidation are not enough to prevent the
  inconsistent reads of non-atomic reads, like multi-word accesses
  protected by a lock.  So instead of modifying each pmap invalidation
  code, I did it there.
  
  Discovered and analyzed by: elliott.r...@dell.com
  Reviewed by:  markj
  PR:   225584 (appeared to have the same cause)
  Tested by:elliott.r...@dell.com, emaste, Mike Tancsa , 
truckman
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D14347

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Wed Feb 14 00:31:37 2018(r329253)
+++ head/sys/vm/vm_fault.c  Wed Feb 14 00:31:45 2018(r329254)
@@ -1135,6 +1135,10 @@ readrest:
 */
pmap_copy_page(fs.m, fs.first_m);
fs.first_m->valid = VM_PAGE_BITS_ALL;
+   if ((fault_flags & VM_FAULT_WIRE) == 0) {
+   prot &= ~VM_PROT_WRITE;
+   fault_type &= ~VM_PROT_WRITE;
+   }
if (wired && (fault_flags &
VM_FAULT_WIRE) == 0) {
vm_page_lock(fs.first_m);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329255 - stable/11/usr.bin/sort

2018-02-13 Thread Mark Johnston
Author: markj
Date: Wed Feb 14 00:32:19 2018
New Revision: 329255
URL: https://svnweb.freebsd.org/changeset/base/329255

Log:
  MFC r328995:
  Fix the WITH_SORT_THREADS build.
  
  PR:   201664

Modified:
  stable/11/usr.bin/sort/radixsort.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/sort/radixsort.c
==
--- stable/11/usr.bin/sort/radixsort.c  Wed Feb 14 00:31:45 2018
(r329254)
+++ stable/11/usr.bin/sort/radixsort.c  Wed Feb 14 00:32:19 2018
(r329255)
@@ -127,6 +127,14 @@ have_sort_left(void)
 
 #endif /* SORT_THREADS */
 
+static void
+_push_ls(struct level_stack *ls)
+{
+
+   ls->next = g_ls;
+   g_ls = ls;
+}
+
 /*
  * Push sort level to the stack
  */
@@ -139,22 +147,14 @@ push_ls(struct sort_level *sl)
new_ls->sl = sl;
 
 #if defined(SORT_THREADS)
-   if (nthreads > 1)
+   if (nthreads > 1) {
pthread_mutex_lock(_ls_mutex);
-#endif
-
-   new_ls->next = g_ls;
-   g_ls = new_ls;
-
-#if defined(SORT_THREADS)
-   if (nthreads > 1)
+   _push_ls(new_ls);
pthread_cond_signal(_ls_cond);
-#endif
-
-#if defined(SORT_THREADS)
-   if (nthreads > 1)
pthread_mutex_unlock(_ls_mutex);
+   } else
 #endif
+   _push_ls(new_ls);
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329253 - stable/11/usr.bin/sort

2018-02-13 Thread Mark Johnston
Author: markj
Date: Wed Feb 14 00:31:37 2018
New Revision: 329253
URL: https://svnweb.freebsd.org/changeset/base/329253

Log:
  MFC r312667 (by pfg):
  sort - Don't live-loop threads.

Modified:
  stable/11/usr.bin/sort/radixsort.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/sort/radixsort.c
==
--- stable/11/usr.bin/sort/radixsort.c  Wed Feb 14 00:25:18 2018
(r329252)
+++ stable/11/usr.bin/sort/radixsort.c  Wed Feb 14 00:31:37 2018
(r329253)
@@ -83,12 +83,12 @@ static struct level_stack *g_ls;
 
 #if defined(SORT_THREADS)
 /* stack guarding mutex */
+static pthread_cond_t g_ls_cond;
 static pthread_mutex_t g_ls_mutex;
 
 /* counter: how many items are left */
 static size_t sort_left;
 /* guarding mutex */
-static pthread_mutex_t sort_left_mutex;
 
 /* semaphore to count threads */
 static sem_t mtsem;
@@ -99,23 +99,25 @@ static sem_t mtsem;
 static inline void
 sort_left_dec(size_t n)
 {
-
-   pthread_mutex_lock(_left_mutex);
+   pthread_mutex_lock(_ls_mutex);
sort_left -= n;
-   pthread_mutex_unlock(_left_mutex);
+   if (sort_left == 0 && nthreads > 1)
+   pthread_cond_broadcast(_ls_cond);
+   pthread_mutex_unlock(_ls_mutex);
 }
 
 /*
  * Do we have something to sort ?
+ *
+ * This routine does not need to be locked.
  */
 static inline bool
 have_sort_left(void)
 {
bool ret;
 
-   pthread_mutex_lock(_left_mutex);
ret = (sort_left > 0);
-   pthread_mutex_unlock(_left_mutex);
+
return (ret);
 }
 
@@ -146,6 +148,11 @@ push_ls(struct sort_level *sl)
 
 #if defined(SORT_THREADS)
if (nthreads > 1)
+   pthread_cond_signal(_ls_cond);
+#endif
+
+#if defined(SORT_THREADS)
+   if (nthreads > 1)
pthread_mutex_unlock(_ls_mutex);
 #endif
 }
@@ -184,13 +191,19 @@ pop_ls_mt(void)
 
pthread_mutex_lock(_ls_mutex);
 
-   if (g_ls) {
-   sl = g_ls->sl;
-   saved_ls = g_ls;
-   g_ls = g_ls->next;
-   } else {
+   for (;;) {
+   if (g_ls) {
+   sl = g_ls->sl;
+   saved_ls = g_ls;
+   g_ls = g_ls->next;
+   break;
+   }
sl = NULL;
saved_ls = NULL;
+
+   if (have_sort_left() == 0)
+   break;
+   pthread_cond_wait(_ls_cond, _ls_mutex);
}
 
pthread_mutex_unlock(_ls_mutex);
@@ -495,13 +508,8 @@ run_sort_cycle_mt(void)
 
for (;;) {
slc = pop_ls_mt();
-   if (slc == NULL) {
-   if (have_sort_left()) {
-   pthread_yield();
-   continue;
-   }
+   if (slc == NULL)
break;
-   }
run_sort_level_next(slc);
}
 }
@@ -512,9 +520,7 @@ run_sort_cycle_mt(void)
 static void*
 sort_thread(void* arg)
 {
-
run_sort_cycle_mt();
-
sem_post();
 
return (arg);
@@ -610,8 +616,7 @@ run_top_sort_level(struct sort_level *sl)
pthread_t pth;
 
pthread_attr_init();
-   pthread_attr_setdetachstate(,
-   PTHREAD_DETACHED);
+   pthread_attr_setdetachstate(, PTHREAD_DETACHED);
 
for (;;) {
int res = pthread_create(, ,
@@ -628,7 +633,7 @@ run_top_sort_level(struct sort_level *sl)
pthread_attr_destroy();
}
 
-   for(i = 0; i < nthreads; ++i)
+   for (i = 0; i < nthreads; ++i)
sem_wait();
}
 #endif /* defined(SORT_THREADS) */
@@ -651,7 +656,7 @@ run_sort(struct sort_list_item **base, size_t nmemb)
pthread_mutexattr_settype(, PTHREAD_MUTEX_ADAPTIVE_NP);
 
pthread_mutex_init(_ls_mutex, );
-   pthread_mutex_init(_left_mutex, );
+   pthread_cond_init(_ls_cond, NULL);
 
pthread_mutexattr_destroy();
 
@@ -679,7 +684,6 @@ run_sort(struct sort_list_item **base, size_t nmemb)
if (nthreads > 1) {
sem_destroy();
pthread_mutex_destroy(_ls_mutex);
-   pthread_mutex_destroy(_left_mutex);
}
nthreads = nthreads_save;
 #endif
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329252 - head/sys/vm

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Wed Feb 14 00:25:18 2018
New Revision: 329252
URL: https://svnweb.freebsd.org/changeset/base/329252

Log:
  Do not call pmap_enter() with invalid protection mode.
  
  If the map entry elookup was performed due to the mapping changes, we
  need to ensure that there is still some access permission bit
  requested which is compatible with the current vm_map_entry mode.  If
  not, restart the handler from scratch instead of trying to save the
  current progress.
  
  Also adjust fault_type to not include cleared permission bits.
  
  Reviewed by:  markj
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D14347

Modified:
  head/sys/vm/vm_fault.c

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Wed Feb 14 00:12:03 2018(r329251)
+++ head/sys/vm/vm_fault.c  Wed Feb 14 00:25:18 2018(r329252)
@@ -1219,6 +1219,12 @@ readrest:
 * write-enabled after all.
 */
prot &= retry_prot;
+   fault_type &= retry_prot;
+   if (prot == 0) {
+   release_page();
+   unlock_and_deallocate();
+   goto RetryFault;
+   }
}
}
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329251 - head/sys/kgssapi

2018-02-13 Thread Conrad Meyer
Author: cem
Date: Wed Feb 14 00:12:03 2018
New Revision: 329251
URL: https://svnweb.freebsd.org/changeset/base/329251

Log:
  kgssapi: Remove trivial deadcode
  
  CID:  1385956
  Reported by:  Coverity
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/kgssapi/gss_impl.c

Modified: head/sys/kgssapi/gss_impl.c
==
--- head/sys/kgssapi/gss_impl.c Tue Feb 13 22:46:06 2018(r329250)
+++ head/sys/kgssapi/gss_impl.c Wed Feb 14 00:12:03 2018(r329251)
@@ -287,8 +287,6 @@ kgssapi_modevent(module_t mod, int type, void *data)
 
switch (type) {
case MOD_LOAD:
-   if (error != 0)
-   return (error);
rpc_gss_entries.rpc_gss_refresh_auth = rpc_gss_refresh_auth;
rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind;
rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/d...

2018-02-13 Thread Mark Johnston
Author: markj
Date: Tue Feb 13 22:43:07 2018
New Revision: 329249
URL: https://svnweb.freebsd.org/changeset/base/329249

Log:
  MFC r327888, r327972, r327973:
  Add "jid" and "jailname" variables to DTrace.

Added:
  
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
 - copied unchanged from r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
  stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d
 - copied unchanged from r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d
Modified:
  stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  stable/11/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
  stable/11/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
  stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
  stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
Directory Properties:
  stable/11/   (props changed)

Copied: 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
 (from r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
 Tue Feb 13 22:43:07 2018(r329249, copy of r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d)
@@ -0,0 +1,44 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2018 Domagoj Stolfa .
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ */
+
+#pragma ident  "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect jailname at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+   @a[jailname] = count();
+}
+
+profile-4999hz
+{
+   @a[jailname] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+   exit(0);
+}

Copied: 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d 
(from r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
stable/11/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d  
Tue Feb 13 22:43:07 2018(r329249, copy of r327888, 
head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d)
@@ -0,0 +1,44 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2018 Domagoj Stolfa .
+ *
+ * This software was developed by BAE Systems, the University of Cambridge
+ * Computer Laboratory, and Memorial University under DARPA/AFRL contract
+ * FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent Computing
+ * (TC) research program.
+ *
+ */
+
+#pragma ident  "%Z%%M% %I% %E% SMI"
+
+/*
+ * ASSERTION:
+ * collect jid at every fbt probe and at every firing of a
+ * high-frequency profile probe
+ */
+
+fbt:::
+{
+   @a[jid] = count();
+}
+
+profile-4999hz
+{
+   @a[jid] = count();
+}
+
+tick-1sec
+/n++ == 10/
+{
+   exit(0);
+}

Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==
--- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c   Tue Feb 
13 22:42:25 2018(r329248)
+++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c   Tue Feb 
13 22:43:07 2018(r329249)
@@ -311,6 +311,12 @@ static const dt_ident_t _dtrace_globals[] = {
DT_VERS_1_5, _idops_func, "string(int, void *)" },
 { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
_idops_type, "uint_t" },
+#ifdef __FreeBSD__
+{ "jailname", DT_IDENT_SCALAR, 0, 

svn commit: r329247 - stable/11/usr.sbin/kldxref

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 22:40:33 2018
New Revision: 329247
URL: https://svnweb.freebsd.org/changeset/base/329247

Log:
  MFC r328052: kldxref: handle modules with md_cval at end of allocated secs
  
  Attempting to retrieve an md_cval string from a kernel module with
  kldxref would throw a offset error for modules created using lld, since
  this value would be placed at the end of all allocated sections.
  
  Add an ef_read_seg_string method to the ef interface, to allow reading
  strings of varying size without attempting to read beyond the segment's
  bounds.
  
  PR:   224875
  Submitted by: Mitchell Horne 
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/usr.sbin/kldxref/ef.c
  stable/11/usr.sbin/kldxref/ef.h
  stable/11/usr.sbin/kldxref/ef_obj.c
  stable/11/usr.sbin/kldxref/kldxref.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/kldxref/ef.c
==
--- stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:37:54 2018
(r329246)
+++ stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:40:33 2018
(r329247)
@@ -88,6 +88,8 @@ static int ef_read_entry(elf_file_t ef, Elf_Off offset
 static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest);
 static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len,
 void *dest);
+static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len,
+char *dest);
 static int ef_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len,
 void **ptr);
 static int ef_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len,
@@ -104,6 +106,7 @@ static struct elf_file_ops ef_file_ops = {
ef_read_entry,
ef_seg_read,
ef_seg_read_rel,
+   ef_seg_read_string,
ef_seg_read_entry,
ef_seg_read_entry_rel,
ef_symaddr,
@@ -492,6 +495,28 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t 
if (error != 0)
return (error);
}
+   return (0);
+}
+
+static int
+ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest)
+{
+   u_long ofs = ef_get_offset(ef, offset);
+   ssize_t r;
+
+   if (ofs == 0 || ofs == (Elf_Off)-1) {
+   if (ef->ef_verbose)
+   warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)",
+   ef->ef_name, (long)offset, ofs);
+   return (EFAULT);
+   }
+
+   r = pread(ef->ef_fd, dest, len, ofs);
+   if (r < 0)
+   return (errno);
+   if (strnlen(dest, len) == len)
+   return (EFAULT);
+
return (0);
 }
 

Modified: stable/11/usr.sbin/kldxref/ef.h
==
--- stable/11/usr.sbin/kldxref/ef.h Tue Feb 13 22:37:54 2018
(r329246)
+++ stable/11/usr.sbin/kldxref/ef.h Tue Feb 13 22:40:33 2018
(r329247)
@@ -21,6 +21,8 @@
 (ef)->ef_ops->seg_read((ef)->ef_ef, offset, len, dest)
 #define EF_SEG_READ_REL(ef, offset, len, dest) \
 (ef)->ef_ops->seg_read_rel((ef)->ef_ef, offset, len, dest)
+#define EF_SEG_READ_STRING(ef, offset, len, dest) \
+(ef)->ef_ops->seg_read_string((ef)->ef_ef, offset, len, dest)
 #define EF_SEG_READ_ENTRY(ef, offset, len, ptr) \
 (ef)->ef_ops->seg_read_entry((ef)->kf_ef, offset, len, ptr)
 #define EF_SEG_READ_ENTRY_REL(ef, offset, len, ptr) \
@@ -44,6 +46,8 @@ struct elf_file_ops {
int (*seg_read)(elf_file_t ef, Elf_Off offset, size_t len, void *dest);
int (*seg_read_rel)(elf_file_t ef, Elf_Off offset, size_t len,
void *dest);
+   int (*seg_read_string)(elf_file_t, Elf_Off offset, size_t len,
+   char *dest);
int (*seg_read_entry)(elf_file_t ef, Elf_Off offset, size_t len,
void**ptr);
int (*seg_read_entry_rel)(elf_file_t ef, Elf_Off offset, size_t len,

Modified: stable/11/usr.sbin/kldxref/ef_obj.c
==
--- stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:37:54 2018
(r329246)
+++ stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:40:33 2018
(r329247)
@@ -108,6 +108,8 @@ static int ef_obj_seg_read(elf_file_t ef, Elf_Off offs
 void *dest);
 static int ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len,
 void *dest);
+static int ef_obj_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len,
+char *dest);
 static int ef_obj_seg_read_entry(elf_file_t ef, Elf_Off offset, size_t len,
 void **ptr);
 static int ef_obj_seg_read_entry_rel(elf_file_t ef, Elf_Off offset, size_t len,
@@ -124,6 +126,7 @@ static struct elf_file_ops ef_obj_file_ops = {
ef_obj_read_entry,
ef_obj_seg_read,
ef_obj_seg_read_rel,
+   ef_obj_seg_read_string,
ef_obj_seg_read_entry,
ef_obj_seg_read_entry_rel,

svn commit: r329246 - stable/11/usr.sbin/kldxref

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 22:37:54 2018
New Revision: 329246
URL: https://svnweb.freebsd.org/changeset/base/329246

Log:
  MFC r327503: kldxref: correct function names in warning messages
  
  Sponsored by: The FreeBSD Foundation

Modified:
  stable/11/usr.sbin/kldxref/ef.c
  stable/11/usr.sbin/kldxref/ef_obj.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/kldxref/ef.c
==
--- stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 21:33:40 2018
(r329245)
+++ stable/11/usr.sbin/kldxref/ef.c Tue Feb 13 22:37:54 2018
(r329246)
@@ -473,7 +473,7 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t 
 
if (ofs == 0) {
if (ef->ef_verbose)
-   warnx("ef_seg_read(%s): zero offset (%lx:%ld)",
+   warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)",
ef->ef_name, (long)offset, ofs);
return EFAULT;
}

Modified: stable/11/usr.sbin/kldxref/ef_obj.c
==
--- stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 21:33:40 2018
(r329245)
+++ stable/11/usr.sbin/kldxref/ef_obj.c Tue Feb 13 22:37:54 2018
(r329246)
@@ -225,7 +225,7 @@ ef_obj_seg_read(elf_file_t ef, Elf_Off offset, size_t 
 
if (offset + len > ef->size) {
if (ef->ef_verbose)
-   warnx("ef_seg_read_rel(%s): bad offset/len (%lx:%ld)",
+   warnx("ef_obj_seg_read(%s): bad offset/len (%lx:%ld)",
ef->ef_name, (long)offset, (long)len);
return (EFAULT);
}
@@ -244,7 +244,7 @@ ef_obj_seg_read_rel(elf_file_t ef, Elf_Off offset, siz
 
if (offset + len > ef->size) {
if (ef->ef_verbose)
-   warnx("ef_seg_read_rel(%s): bad offset/len (%lx:%ld)",
+   warnx("ef_obj_seg_read_rel(%s): bad offset/len 
(%lx:%ld)",
ef->ef_name, (long)offset, (long)len);
return (EFAULT);
}
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 21:33:40 2018
New Revision: 329245
URL: https://svnweb.freebsd.org/changeset/base/329245

Log:
  Add DECLARE_MODULE_TIED mlink missed in r329244
  
  Reported by:  imp

Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileTue Feb 13 21:22:09 2018
(r329244)
+++ head/share/man/man9/MakefileTue Feb 13 21:33:40 2018
(r329245)
@@ -858,6 +858,7 @@ MLINKS+=crypto.9 crypto_dispatch.9 \
crypto.9 crypto_unregister_all.9
 MLINKS+=DB_COMMAND.9 DB_SHOW_ALL_COMMAND.9 \
DB_COMMAND.9 DB_SHOW_COMMAND.9
+MLINKS+=DECLARE_MODULE.9 DECLARE_MODULE_TIED.9
 MLINKS+=dev_clone.9 drain_dev_clone_events.9
 MLINKS+=devfs_set_cdevpriv.9 devfs_clear_cdevpriv.9 \
devfs_set_cdevpriv.9 devfs_get_cdevpriv.9
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 21:22:09 2018
New Revision: 329244
URL: https://svnweb.freebsd.org/changeset/base/329244

Log:
  Document DECLARE_MODULE_TIED
  
  It was introduced in r213716.
  
  Reviewed by:  kib
  Sponsored by: The FreeBSD Foundation

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

Modified: head/share/man/man9/DECLARE_MODULE.9
==
--- head/share/man/man9/DECLARE_MODULE.9Tue Feb 13 21:14:27 2018
(r329243)
+++ head/share/man/man9/DECLARE_MODULE.9Tue Feb 13 21:22:09 2018
(r329244)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 6, 2005
+.Dd February 13, 2018
 .Dt DECLARE_MODULE 9
 .Os
 .Sh NAME
@@ -39,6 +39,7 @@
 .In sys/kernel.h
 .In sys/module.h
 .Fn DECLARE_MODULE "name" "moduledata_t data" "sub" "order"
+.Fn DECLARE_MODULE_TIED "name" "moduledata_t data" "sub" "order"
 .Sh DESCRIPTION
 The
 .Fn DECLARE_MODULE
@@ -55,7 +56,17 @@ and
 Of course, it can also be called directly, for example in
 order to implement dynamic sysctls.
 .Pp
-The arguments it expects are:
+A module declared with
+.Fn DECLARE_MODULE_TIED
+will load only if the running kernel version
+(as specified by
+.Dv __FreeBSD_version )
+is identical to that on which it was built.
+This declaration should be used by modules which depend on interfaces beyond
+the stable kernel KBI (such as ABI emulators or hypervisors that rely on
+internal kernel structures).
+.Pp
+The arguments are:
 .Bl -tag -width indent
 .It Fa name
 The module name, which will be used in the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329243 - stable/11/crypto/openssl/doc/man3

2018-02-13 Thread Jung-uk Kim
Author: jkim
Date: Tue Feb 13 21:14:27 2018
New Revision: 329243
URL: https://svnweb.freebsd.org/changeset/base/329243

Log:
  MFC:  r329022
  
  Remove an empty directory.

Deleted:
  stable/11/crypto/openssl/doc/man3/
Modified:
Directory Properties:
  stable/11/   (props changed)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329242 - in stable/11: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man

2018-02-13 Thread Jung-uk Kim
Author: jkim
Date: Tue Feb 13 21:11:27 2018
New Revision: 329242
URL: https://svnweb.freebsd.org/changeset/base/329242

Log:
  MFC:  r329024
  
  Remove c_rehash(1) to not confuse users.

Deleted:
  stable/11/secure/usr.bin/openssl/man/c_rehash.1
Modified:
  stable/11/ObsoleteFiles.inc
  stable/11/secure/lib/libcrypto/Makefile.inc
  stable/11/secure/usr.bin/openssl/Makefile.man
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/ObsoleteFiles.inc
==
--- stable/11/ObsoleteFiles.inc Tue Feb 13 20:07:40 2018(r329241)
+++ stable/11/ObsoleteFiles.inc Tue Feb 13 21:11:27 2018(r329242)
@@ -38,6 +38,8 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20180213: remove c_rehash(1)
+OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz
 # 20180212: Obsolete forth files
 OLD_FILES+=boot/efi.4th
 OLD_FILES+=boot/pcibios.4th

Modified: stable/11/secure/lib/libcrypto/Makefile.inc
==
--- stable/11/secure/lib/libcrypto/Makefile.inc Tue Feb 13 20:07:40 2018
(r329241)
+++ stable/11/secure/lib/libcrypto/Makefile.inc Tue Feb 13 21:11:27 2018
(r329242)
@@ -64,14 +64,11 @@ MANDIR= ${SHAREDIR}/openssl/man/man
 
 .if defined(LIB)
 _docs= ${LIB}
-.if ${LIB} == ssl
-_docs+=man3
-.endif
 _skip= SSLeay_version des_modes
 _sec=  3
 .else
 _docs= apps
-_skip= config
+_skip= c_rehash config
 _sec=  1
 .endif
 

Modified: stable/11/secure/usr.bin/openssl/Makefile.man
==
--- stable/11/secure/usr.bin/openssl/Makefile.man   Tue Feb 13 20:07:40 
2018(r329241)
+++ stable/11/secure/usr.bin/openssl/Makefile.man   Tue Feb 13 21:11:27 
2018(r329242)
@@ -2,7 +2,6 @@
 # DO NOT EDIT: generated from man-makefile-update target
 MAN+= CA.pl.1
 MAN+= asn1parse.1
-MAN+= c_rehash.1
 MAN+= ca.1
 MAN+= ciphers.1
 MAN+= cms.1
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Warner Losh
On Tue, Feb 13, 2018 at 1:40 PM, Ravi Pokala  wrote:

> -Original Message-
> From:  on behalf of Eric van Gyzen <
> e...@vangyzen.net>
> Date: 2018-02-13, Tuesday at 11:52
> To: Ed Maste , Ian Lepore 
> Cc: src-committers , ,
> 
> Subject: Re: svn commit: r329237 - head/sys/libkern
>
> > ...
> >
> > I prefer '\0' here because it tells the reader that it's a NUL
> > character, as opposed to a NULL pointer or a zero integer.  Yes, the
> > reader should already know that, but the author can /help/ the reader by
> > communicating more clearly and completely.
> >
> > Eric
>
> Out of morbid curiosity, does any standard (or any of our non-standard
> headers) define a "NUL" macro for use as a manual string terminator?
>

No. There's no standard define.

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


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Ravi Pokala
-Original Message-
From:  on behalf of Eric van Gyzen 

Date: 2018-02-13, Tuesday at 11:52
To: Ed Maste , Ian Lepore 
Cc: src-committers , , 

Subject: Re: svn commit: r329237 - head/sys/libkern

> ...
> 
> I prefer '\0' here because it tells the reader that it's a NUL
> character, as opposed to a NULL pointer or a zero integer.  Yes, the
> reader should already know that, but the author can /help/ the reader by
> communicating more clearly and completely.
>
> Eric

Out of morbid curiosity, does any standard (or any of our non-standard headers) 
define a "NUL" macro for use as a manual string terminator?

-Ravi (rpokala@)


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


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Conrad Meyer
On Tue, Feb 13, 2018 at 11:52 AM, Eric van Gyzen  wrote:
> On 02/13/2018 13:43, Ed Maste wrote:
>> On 13 February 2018 at 14:23, Ian Lepore  wrote:
>>> There are many ways to spell 0.  Why are we using something other than
>>> the simplest way?  Is it a style rule thing, or is it portability-
>>> correctness, or what?
>>
>> I made the change to improve consistency between lib/libc/string and
>> sys/libkern,
>> ...
>
> I prefer '\0' here because it tells the reader that it's a NUL
> character, as opposed to a NULL pointer or a zero integer.  Yes, the
> reader should already know that, but the author can /help/ the reader by
> communicating more clearly and completely.

And I prefer 0, because it's easier to type and conveys exactly the
same meaning.  A character NUL is simply a zero integer of char type.

These are standard library string manipulation routines with char
pointer types.  It is already extremely clear to the reader that the
zeros involved are end-of-string sentinels.

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


svn commit: r329241 - head/sys/dev/bwn

2018-02-13 Thread Landon J. Fuller
Author: landonf
Date: Tue Feb 13 20:07:40 2018
New Revision: 329241
URL: https://svnweb.freebsd.org/changeset/base/329241

Log:
  bwn(4): Conditionalize "RX decryption attempted" message on a new
  BWN_DEBUG_HWCRYPTO debug flag.
  
  The MAC will attempt decryption (and set BWN_RX_MAC_DEC) even if a key has
  not been supplied to the hardware; this is expected behavior, and there's
  no need to spam users' console with this debugging printf.

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwn_debug.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 13 19:28:02 2018(r329240)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 13 20:07:40 2018(r329241)
@@ -5983,7 +5983,6 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v
int padding, rate, rssi = 0, noise = 0, type;
uint16_t phytype, phystat0, phystat3, chanstat;
unsigned char *mp = mtod(m, unsigned char *);
-   static int rx_mac_dec_rpt = 0;
 
BWN_ASSERT_LOCKED(sc);
 
@@ -6032,11 +6031,12 @@ bwn_rxeof(struct bwn_mac *mac, struct mbuf *m, const v
}
wh = mtod(m, struct ieee80211_frame_min *);
 
-   if (macstat & BWN_RX_MAC_DEC && rx_mac_dec_rpt++ < 50)
-   device_printf(sc->sc_dev,
+   if (macstat & BWN_RX_MAC_DEC) {
+   DPRINTF(sc, BWN_DEBUG_HWCRYPTO,
"RX decryption attempted (old %d keyidx %#x)\n",
BWN_ISOLDFMT(mac),
(macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT);
+   }
 
if (phystat0 & BWN_RX_PHYST0_OFDM)
rate = bwn_plcp_get_ofdmrate(mac, plcp,

Modified: head/sys/dev/bwn/if_bwn_debug.h
==
--- head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 19:28:02 2018
(r329240)
+++ head/sys/dev/bwn/if_bwn_debug.h Tue Feb 13 20:07:40 2018
(r329241)
@@ -53,6 +53,7 @@ enum {
BWN_DEBUG_XMIT_POWER= 0x0002,
BWN_DEBUG_PHY   = 0x0004,
BWN_DEBUG_EEPROM= 0x0008,
+   BWN_DEBUG_HWCRYPTO  = 0x0010,   /* HW crypto */
BWN_DEBUG_FATAL = 0x8000,   /* fatal errors */
BWN_DEBUG_ANY   = 0x
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Ian Lepore
On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote:
> On 13 February 2018 at 14:23, Ian Lepore  wrote:
> > 
> > On Tue, 2018-02-13 at 19:17 +, Ed Maste wrote:
> > > 
> > > Author: emaste
> > > Date: Tue Feb 13 19:17:48 2018
> > > New Revision: 329237
> > > URL: https://svnweb.freebsd.org/changeset/base/329237
> > > 
> > > Log:
> > >   libkern: use nul for terminating char rather than 0
> > > 
> > >   Akin to the change made in r188080 for lib/libc/string/.
> > > 
> > >   Reported by:bde
> > >   Sponsored by:   The FreeBSD Foundation
> > There are many ways to spell 0.  Why are we using something other
> > than
> > the simplest way?  Is it a style rule thing, or is it portability-
> > correctness, or what?
> I made the change to improve consistency between lib/libc/string and
> sys/libkern, which is what Bruce commented on some time ago. I don't
> have a personal preference for 0 or '\0' but definitely believe that
> if we have multiple, similar copies of a function they ought to avoid
> gratuitous differences. (I'm happy to change both trees to 0 if
> that's
> preferred.)
> 

Oh, I agree completely about consistancy being important.  I just
wanted to know whether I should try to remember to always use \0
because it's a rule or has some benefit I didn't know about.

20+ years ago I used to slavishly ensure I always used \0 when a char
type was involved, just as a personal style thing.  Then over time I
came to the conclusion that "0 is 0 no matter how you spell it, so keep
it simple" (except for pointers... even in c++ I've always used NULL).

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


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Eric van Gyzen
On 02/13/2018 13:43, Ed Maste wrote:
> On 13 February 2018 at 14:23, Ian Lepore  wrote:
>> On Tue, 2018-02-13 at 19:17 +, Ed Maste wrote:
>>> Author: emaste
>>> Date: Tue Feb 13 19:17:48 2018
>>> New Revision: 329237
>>> URL: https://svnweb.freebsd.org/changeset/base/329237
>>>
>>> Log:
>>>   libkern: use nul for terminating char rather than 0
>>>
>>>   Akin to the change made in r188080 for lib/libc/string/.
>>>
>>>   Reported by:bde
>>>   Sponsored by:   The FreeBSD Foundation
>>
>> There are many ways to spell 0.  Why are we using something other than
>> the simplest way?  Is it a style rule thing, or is it portability-
>> correctness, or what?
> 
> I made the change to improve consistency between lib/libc/string and
> sys/libkern, which is what Bruce commented on some time ago. I don't
> have a personal preference for 0 or '\0' but definitely believe that
> if we have multiple, similar copies of a function they ought to avoid
> gratuitous differences. (I'm happy to change both trees to 0 if that's
> preferred.)

I prefer '\0' here because it tells the reader that it's a NUL
character, as opposed to a NULL pointer or a zero integer.  Yes, the
reader should already know that, but the author can /help/ the reader by
communicating more clearly and completely.

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


Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Ed Maste
On 13 February 2018 at 14:23, Ian Lepore  wrote:
> On Tue, 2018-02-13 at 19:17 +, Ed Maste wrote:
>> Author: emaste
>> Date: Tue Feb 13 19:17:48 2018
>> New Revision: 329237
>> URL: https://svnweb.freebsd.org/changeset/base/329237
>>
>> Log:
>>   libkern: use nul for terminating char rather than 0
>>
>>   Akin to the change made in r188080 for lib/libc/string/.
>>
>>   Reported by:bde
>>   Sponsored by:   The FreeBSD Foundation
>
> There are many ways to spell 0.  Why are we using something other than
> the simplest way?  Is it a style rule thing, or is it portability-
> correctness, or what?

I made the change to improve consistency between lib/libc/string and
sys/libkern, which is what Bruce commented on some time ago. I don't
have a personal preference for 0 or '\0' but definitely believe that
if we have multiple, similar copies of a function they ought to avoid
gratuitous differences. (I'm happy to change both trees to 0 if that's
preferred.)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329240 - in head: sbin/dumpon sbin/savecore share/man/man5 sys/conf sys/kern sys/sys

2018-02-13 Thread Mark Johnston
Author: markj
Date: Tue Feb 13 19:28:02 2018
New Revision: 329240
URL: https://svnweb.freebsd.org/changeset/base/329240

Log:
  Add support for zstd-compressed user and kernel core dumps.
  
  This works similarly to the existing gzip compression support, but
  zstd is typically faster and gives better compression ratios.
  
  Support for this functionality must be configured by adding ZSTDIO to
  one's kernel configuration file. dumpon(8)'s new -Z option is used to
  configure zstd compression for kernel dumps. savecore(8) now recognizes
  and saves zstd-compressed kernel dumps with a .zst extension.
  
  Submitted by: cem (original version)
  Relnotes: yes
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D13101,
https://reviews.freebsd.org/D13633

Modified:
  head/sbin/dumpon/dumpon.8
  head/sbin/dumpon/dumpon.c
  head/sbin/savecore/savecore.c
  head/share/man/man5/core.5
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options
  head/sys/kern/kern_shutdown.c
  head/sys/kern/kern_sig.c
  head/sys/kern/subr_compressor.c
  head/sys/sys/compressor.h
  head/sys/sys/kerneldump.h

Modified: head/sbin/dumpon/dumpon.8
==
--- head/sbin/dumpon/dumpon.8   Tue Feb 13 19:19:26 2018(r329239)
+++ head/sbin/dumpon/dumpon.8   Tue Feb 13 19:28:02 2018(r329240)
@@ -28,7 +28,7 @@
 .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 24, 2017
+.Dd February 13, 2018
 .Dt DUMPON 8
 .Os
 .Sh NAME
@@ -39,6 +39,7 @@
 .Op Fl v
 .Op Fl k Ar public_key_file
 .Op Fl z
+.Op Fl Z
 .Ar special_file
 .Nm
 .Op Fl v
@@ -116,8 +117,10 @@ kernel option.
 .Pp
 The
 .Fl z
-option configures the kernel to compress the dump in gzip format before writing
-it to the dump device.
+and
+.Fl Z
+options configure the kernel to compress the dump before writing it to
+the dump device.
 This reduces the amount of space required for the dump and accelerates
 recovery with
 .Xr savecore 8
@@ -126,10 +129,22 @@ When compression is enabled, the
 .Nm
 utility will not verify that the dump device is sufficiently large for a full
 dump.
-This flag requires a kernel compiled with the
+The
+.Fl z
+and
+.Fl Z
+options cause the dump to be written in
+.Xr gzip 1
+and
+.Xr zstd 1
+format, respectively.
+These flags require a kernel compiled with the
 .Dv GZIO
-kernel option.
+or
+.Dv ZSTDIO
+kernel options.
 .Pp
+.Pp
 The
 .Fl l
 flag causes
@@ -269,15 +284,17 @@ The core was decrypted properly if
 .Xr kgdb 1
 does not print any errors.
 .Sh SEE ALSO
+.Xr gzip 1 ,
 .Xr kgdb 1 ,
+.Xr zstd 1 ,
 .Xr ddb 4 ,
 .Xr fstab 5 ,
 .Xr rc.conf 5 ,
 .Xr config 8 ,
+.Xr decryptcore 8 ,
 .Xr init 8 ,
 .Xr loader 8 ,
 .Xr rc 8 ,
-.Xr decryptcore 8 ,
 .Xr savecore 8 ,
 .Xr swapon 8 ,
 .Xr panic 9

Modified: head/sbin/dumpon/dumpon.c
==
--- head/sbin/dumpon/dumpon.c   Tue Feb 13 19:19:26 2018(r329239)
+++ head/sbin/dumpon/dumpon.c   Tue Feb 13 19:28:02 2018(r329240)
@@ -73,7 +73,7 @@ static void
 usage(void)
 {
fprintf(stderr, "%s\n%s\n%s\n",
-   "usage: dumpon [-v] [-k public_key_file] [-z] special_file",
+   "usage: dumpon [-v] [-k public_key_file] [-Zz] special_file",
"   dumpon [-v] off",
"   dumpon [-v] -l");
exit(EX_USAGE);
@@ -192,12 +192,12 @@ main(int argc, char *argv[])
int ch;
int i, fd;
int do_listdumpdev = 0;
-   bool enable, gzip;
+   bool enable, gzip, zstd;
 
-   gzip = false;
+   gzip = zstd = false;
pubkeyfile = NULL;
 
-   while ((ch = getopt(argc, argv, "k:lvz")) != -1)
+   while ((ch = getopt(argc, argv, "k:lvZz")) != -1)
switch((char)ch) {
case 'k':
pubkeyfile = optarg;
@@ -208,6 +208,9 @@ main(int argc, char *argv[])
case 'v':
verbose = 1;
break;
+   case 'Z':
+   zstd = true;
+   break;
case 'z':
gzip = true;
break;
@@ -215,6 +218,9 @@ main(int argc, char *argv[])
usage();
}
 
+   if (gzip && zstd)
+   errx(EX_USAGE, "The -z and -Z options are mutually exclusive.");
+
argc -= optind;
argv += optind;
 
@@ -254,7 +260,7 @@ main(int argc, char *argv[])
if (fd < 0)
err(EX_OSFILE, "%s", dumpdev);
 
-   if (!gzip)
+   if (!gzip && !zstd)
check_size(fd, dumpdev);
 
bzero(, sizeof(kda));
@@ -268,8 +274,11 @@ main(int argc, char *argv[])
 #endif
 
kda.kda_enable = 1;
-   kda.kda_compression = gzip ? KERNELDUMP_COMP_GZIP :
-   

Re: svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Ian Lepore
On Tue, 2018-02-13 at 19:17 +, Ed Maste wrote:
> Author: emaste
> Date: Tue Feb 13 19:17:48 2018
> New Revision: 329237
> URL: https://svnweb.freebsd.org/changeset/base/329237
> 
> Log:
>   libkern: use nul for terminating char rather than 0
>   
>   Akin to the change made in r188080 for lib/libc/string/.
>   
>   Reported by:bde
>   Sponsored by:   The FreeBSD Foundation

There are many ways to spell 0.  Why are we using something other than
the simplest way?  Is it a style rule thing, or is it portability-
correctness, or what?

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


svn commit: r329239 - head/sys/amd64/amd64

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 19:19:26 2018
New Revision: 329239
URL: https://svnweb.freebsd.org/changeset/base/329239

Log:
  amd64/pmap: Move Foundation copyright to the 2-clause section
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/amd64/amd64/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Tue Feb 13 19:18:00 2018(r329238)
+++ head/sys/amd64/amd64/pmap.c Tue Feb 13 19:19:26 2018(r329239)
@@ -11,17 +11,11 @@
  * All rights reserved.
  * Copyright (c) 2005-2010 Alan L. Cox 
  * All rights reserved.
- * Copyright (c) 2014-2018 The FreeBSD Foundation
- * All rights reserved.
  *
  * This code is derived from software contributed to Berkeley by
  * the Systems Programming Group of the University of Utah Computer
  * Science Department and William Jolitz of UUNET Technologies Inc.
  *
- * Portions of this software were developed by
- * Konstantin Belousov  under sponsorship from
- * the FreeBSD Foundation.
- *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -54,6 +48,7 @@
  */
 /*-
  * Copyright (c) 2003 Networks Associates Technology, Inc.
+ * Copyright (c) 2014-2018 The FreeBSD Foundation
  * All rights reserved.
  *
  * This software was developed for the FreeBSD Project by Jake Burkholder,
@@ -61,6 +56,10 @@
  * Security Research Division of Network Associates, Inc. under
  * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
  * CHATS research program.
+ *
+ * Portions of this software were developed by
+ * Konstantin Belousov  under sponsorship from
+ * the FreeBSD Foundation.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329238 - head/sys/contrib/zstd/lib/freebsd

2018-02-13 Thread Mark Johnston
Author: markj
Date: Tue Feb 13 19:18:00 2018
New Revision: 329238
URL: https://svnweb.freebsd.org/changeset/base/329238

Log:
  Move zstd malloc()/free()/calloc() macros to stdlib.h.
  
  The definitions otherwise leak into anything that includes zstd.h,
  which is not desirable for native FreeBSD code.
  
  Reviewed by:  allanjude, cem, imp
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D14352

Modified:
  head/sys/contrib/zstd/lib/freebsd/stdlib.h
  head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h

Modified: head/sys/contrib/zstd/lib/freebsd/stdlib.h
==
--- head/sys/contrib/zstd/lib/freebsd/stdlib.h  Tue Feb 13 19:17:48 2018
(r329237)
+++ head/sys/contrib/zstd/lib/freebsd/stdlib.h  Tue Feb 13 19:18:00 2018
(r329238)
@@ -1,3 +1,44 @@
-/* This file is in the public domain */
-/* $FreeBSD$ */
-#include "zstd_kfreebsd.h"
+/*-
+ * Copyright (c) 2014-2015 Allan Jude 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _ZSTD_FREEBSD_STDLIB_H_
+#define_ZSTD_FREEBSD_STDLIB_H_
+
+#ifdef _KERNEL
+
+#include 
+
+MALLOC_DECLARE(M_ZSTD);
+
+#definemalloc(x)   (malloc)((x), M_ZSTD, M_WAITOK)
+#definefree(x) (free)((x), M_ZSTD)
+#definecalloc(a, b)(mallocarray)((a), (b), M_ZSTD, M_WAITOK | 
M_ZERO)
+
+#endif /* _KERNEL */
+
+#endif /* _ZSTD_FREEBSD_STDLIB_H_ */

Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h
==
--- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h   Tue Feb 13 19:17:48 
2018(r329237)
+++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.h   Tue Feb 13 19:18:00 
2018(r329238)
@@ -39,14 +39,6 @@ extern "C" {
 #ifndef BUILDING_ZFS
 #include /* ptrdiff_t */
 #endif
-#include 
-
-MALLOC_DECLARE(M_ZSTD);
-
-#define malloc(x)  (malloc)((x), M_ZSTD, M_WAITOK)
-#define free(x)(free)((x), M_ZSTD)
-/* in zstd's use of calloc, a is always 1 */
-#define calloc(a,b)(mallocarray)((a), (b), M_ZSTD, M_WAITOK | M_ZERO)
 #endif
 
 #ifdef __cplusplus
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329237 - head/sys/libkern

2018-02-13 Thread Ed Maste
Author: emaste
Date: Tue Feb 13 19:17:48 2018
New Revision: 329237
URL: https://svnweb.freebsd.org/changeset/base/329237

Log:
  libkern: use nul for terminating char rather than 0
  
  Akin to the change made in r188080 for lib/libc/string/.
  
  Reported by:  bde
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/libkern/strcmp.c
  head/sys/libkern/strncat.c
  head/sys/libkern/strncpy.c
  head/sys/libkern/strsep.c
  head/sys/libkern/strstr.c

Modified: head/sys/libkern/strcmp.c
==
--- head/sys/libkern/strcmp.c   Tue Feb 13 19:17:33 2018(r329236)
+++ head/sys/libkern/strcmp.c   Tue Feb 13 19:17:48 2018(r329237)
@@ -44,7 +44,7 @@ int
 strcmp(const char *s1, const char *s2)
 {
while (*s1 == *s2++)
-   if (*s1++ == 0)
+   if (*s1++ == '\0')
return (0);
return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1));
 }

Modified: head/sys/libkern/strncat.c
==
--- head/sys/libkern/strncat.c  Tue Feb 13 19:17:33 2018(r329236)
+++ head/sys/libkern/strncat.c  Tue Feb 13 19:17:48 2018(r329237)
@@ -53,11 +53,11 @@ strncat(char *dst, const char *src, size_t n)
while (*d != 0)
d++;
do {
-   if ((*d = *s++) == 0)
+   if ((*d = *s++) == '\0')
break;
d++;
} while (--n != 0);
-   *d = 0;
+   *d = '\0';
}
return (dst);
 }

Modified: head/sys/libkern/strncpy.c
==
--- head/sys/libkern/strncpy.c  Tue Feb 13 19:17:33 2018(r329236)
+++ head/sys/libkern/strncpy.c  Tue Feb 13 19:17:48 2018(r329237)
@@ -49,10 +49,10 @@ strncpy(char * __restrict dst, const char * __restrict
const char *s = src;
 
do {
-   if ((*d++ = *s++) == 0) {
+   if ((*d++ = *s++) == '\0') {
/* NUL pad the remaining n-1 bytes */
while (--n != 0)
-   *d++ = 0;
+   *d++ = '\0';
break;
}
} while (--n != 0);

Modified: head/sys/libkern/strsep.c
==
--- head/sys/libkern/strsep.c   Tue Feb 13 19:17:33 2018(r329236)
+++ head/sys/libkern/strsep.c   Tue Feb 13 19:17:48 2018(r329237)
@@ -64,14 +64,14 @@ strsep(char **stringp, const char *delim)
spanp = delim;
do {
if ((sc = *spanp++) == c) {
-   if (c == 0)
+   if (c == '\0')
s = NULL;
else
-   s[-1] = 0;
+   s[-1] = '\0';
*stringp = s;
return (tok);
}
-   } while (sc != 0);
+   } while (sc != '\0');
}
/* NOTREACHED */
 }

Modified: head/sys/libkern/strstr.c
==
--- head/sys/libkern/strstr.c   Tue Feb 13 19:17:33 2018(r329236)
+++ head/sys/libkern/strstr.c   Tue Feb 13 19:17:48 2018(r329237)
@@ -51,7 +51,7 @@ strstr(const char *s, const char *find)
len = strlen(find);
do {
do {
-   if ((sc = *s++) == 0)
+   if ((sc = *s++) == '\0')
return (NULL);
} while (sc != c);
} while (strncmp(s, find, len) != 0);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329236 - head/contrib/netbsd-tests/kernel

2018-02-13 Thread Alan Somers
Author: asomers
Date: Tue Feb 13 19:17:33 2018
New Revision: 329236
URL: https://svnweb.freebsd.org/changeset/base/329236

Log:
  Fix Coverity CIDs in the sys/kern/sysv_test tests
  
  CID 979810: strcpy => strlcpy
  CID 1193367: don't leak a file descriptor
  CID 1299856: Check the return value of read(2)
  
  Reported by:  Coverity
  Coverity CID: 978910 1193367 1299856
  MFC after:3 weeks
  X-MFC-With:   328896
  Sponsored by: Spectra Logic Corp

Modified:
  head/contrib/netbsd-tests/kernel/t_sysv.c

Modified: head/contrib/netbsd-tests/kernel/t_sysv.c
==
--- head/contrib/netbsd-tests/kernel/t_sysv.c   Tue Feb 13 17:58:02 2018
(r329235)
+++ head/contrib/netbsd-tests/kernel/t_sysv.c   Tue Feb 13 19:17:33 2018
(r329236)
@@ -129,7 +129,8 @@ read_int(const char *path)
return -1;
else {
int value;
-   read(input, , sizeof(value));
+   ATF_REQUIRE_EQ(read(input, , sizeof(value)), 
sizeof(value));
+   close(input);
return value;
}
 }
@@ -284,7 +285,7 @@ ATF_TC_BODY(msg, tc)
 * Send the first message to the receiver and wait for the ACK.
 */
m.mtype = MTYPE_1;
-   strcpy(m.mtext, m1_str);
+   strlcpy(m.mtext, m1_str, sizeof(m.mtext));
ATF_REQUIRE_MSG(msgsnd(sender_msqid, , MESSAGE_TEXT_LEN,
0) != -1, "sender: msgsnd 1: %d", errno);
 
@@ -298,7 +299,7 @@ ATF_TC_BODY(msg, tc)
 * Send the second message to the receiver and wait for the ACK.
 */
m.mtype = MTYPE_2;
-   strcpy(m.mtext, m2_str);
+   strlcpy(m.mtext, m2_str, sizeof(m.mtext));
ATF_REQUIRE_MSG(msgsnd(sender_msqid, , MESSAGE_TEXT_LEN, 0) 
!= -1,
"sender: msgsnd 2: %d", errno);
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329232 - head/sys/conf

2018-02-13 Thread Bryan Drewery
Author: bdrewery
Date: Tue Feb 13 17:51:16 2018
New Revision: 329232
URL: https://svnweb.freebsd.org/changeset/base/329232

Log:
  ports modules: Don't leak AUTO_OBJ changes into the port builds.
  
  This came about when r328489 made ports modules builds no longer use the
  in-tree share/mk files, but didn't cleanup MAKEOBJDIR from the
  environment.
  
  This fixes "Variable OBJTOP is recursive".
  
  Sponsored by: Dell EMC

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Tue Feb 13 17:50:36 2018(r329231)
+++ head/sys/conf/kern.post.mk  Tue Feb 13 17:51:16 2018(r329232)
@@ -70,6 +70,7 @@ PORTSMODULESENV=\
-u CXX \
-u CPP \
-u MAKESYSPATH \
+   -u MAKEOBJDIR \
MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*}" \
SYSDIR=${SYSDIR} \
PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329228 - head/sys/gnu/dev/bwn/phy_n

2018-02-13 Thread Landon J. Fuller
Author: landonf
Date: Tue Feb 13 17:43:54 2018
New Revision: 329228
URL: https://svnweb.freebsd.org/changeset/base/329228

Log:
  bwn(4): txpid2g/txpid5g[lh] are not defined after sromrev 7; the default
  indices into the TX power gain table should be used instead.
  
  This enables use of bwn(4) with later BCM4321 revisions.
  
  Reported by:  Trev Roydhouse

Modified:
  head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c

Modified: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c
==
--- head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c  Tue Feb 13 17:42:16 
2018(r329227)
+++ head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c  Tue Feb 13 17:43:54 
2018(r329228)
@@ -3906,6 +3906,9 @@ static int bwn_nphy_tx_power_fix(struct bwn_mac *mac)
} else if (sc->sc_board_info.board_srom_rev < 4) {
txpi[0] = 72;
txpi[1] = 72;
+   } else if (sc->sc_board_info.board_srom_rev > 7) {
+   txpi[0] = 0;
+   txpi[1] = 0;
} else {
 #defineBWN_NPHY_GET_TXPI(_name, _result)   
\
 do {   \
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329226 - head/etc/mtree

2018-02-13 Thread Warner Losh
Author: imp
Date: Tue Feb 13 17:42:10 2018
New Revision: 329226
URL: https://svnweb.freebsd.org/changeset/base/329226

Log:
  Add /boot/lua.

Modified:
  head/etc/mtree/BSD.root.dist

Modified: head/etc/mtree/BSD.root.dist
==
--- head/etc/mtree/BSD.root.distTue Feb 13 17:40:09 2018
(r329225)
+++ head/etc/mtree/BSD.root.distTue Feb 13 17:42:10 2018
(r329226)
@@ -14,6 +14,8 @@
 ..
 firmware
 ..
+lua
+..
 kernel
 ..
 modules
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329225 - head/sys/geom/part

2018-02-13 Thread Justin Hibbits
Author: jhibbits
Date: Tue Feb 13 17:40:09 2018
New Revision: 329225
URL: https://svnweb.freebsd.org/changeset/base/329225

Log:
  Narrow a race, and fix a leak, in g_part_wither
  
  A race in g_part_wither() can lead to I/O being performed with a freed GEOM
  when the device disappears.  Close the race as best as we can for now,
  following the code patterns from g_part_ctl_destroy() and g_part_ctl_undo().
  This also fixes a leak, as g_wither_geom() does not wither providers, it
  only orphans them, so the partition entries would never get destroyed in
  g_wither_washer().
  
  Note, this is not a complete fix, it can still race with g_part_start(), the
  race has merely been narrowed.
  
  Reviewed by:  markj
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==
--- head/sys/geom/part/g_part.c Tue Feb 13 17:38:08 2018(r329224)
+++ head/sys/geom/part/g_part.c Tue Feb 13 17:40:09 2018(r329225)
@@ -1541,18 +1541,21 @@ g_part_wither(struct g_geom *gp, int error)
 {
struct g_part_entry *entry;
struct g_part_table *table;
+   struct g_provider *pp;
 
table = gp->softc;
if (table != NULL) {
-   G_PART_DESTROY(table, NULL);
+   gp->softc = NULL;
while ((entry = LIST_FIRST(>gpt_entry)) != NULL) {
LIST_REMOVE(entry, gpe_entry);
+   pp = entry->gpe_pp;
+   entry->gpe_pp->private = NULL;
+   entry->gpe_pp = NULL;
+   g_wither_provider(pp, error);
g_free(entry);
}
-   if (gp->softc != NULL) {
-   kobj_delete((kobj_t)gp->softc, M_GEOM);
-   gp->softc = NULL;
-   }
+   G_PART_DESTROY(table, NULL);
+   kobj_delete((kobj_t)table, M_GEOM);
}
g_wither_geom(gp, error);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329224 - head/sys/kern

2018-02-13 Thread Ian Lepore
Author: ian
Date: Tue Feb 13 17:38:08 2018
New Revision: 329224
URL: https://svnweb.freebsd.org/changeset/base/329224

Log:
  Fix bad indentation.  Whitespace only, no functional changes.
  
  Reported by:  bde@

Modified:
  head/sys/kern/subr_rtc.c

Modified: head/sys/kern/subr_rtc.c
==
--- head/sys/kern/subr_rtc.cTue Feb 13 17:05:50 2018(r329223)
+++ head/sys/kern/subr_rtc.cTue Feb 13 17:38:08 2018(r329224)
@@ -156,55 +156,55 @@ settime_task_func(void *arg, int pending)
 static void
 clock_dbgprint_hdr(device_t dev, int rw)
 {
-struct timespec now;
+   struct timespec now;
 
-getnanotime();
-device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write");
-clock_print_ts(, 9);
-printf(": "); 
+   getnanotime();
+   device_printf(dev, "%s at ", (rw & CLOCK_DBG_READ) ? "read " : "write");
+   clock_print_ts(, 9);
+   printf(": "); 
 }
 
 void
 clock_dbgprint_bcd(device_t dev, int rw, const struct bcd_clocktime *bct)
 {
 
-if (show_io & rw) {
-   clock_dbgprint_hdr(dev, rw);
-   clock_print_bcd(bct, 9);
-   printf("\n");
-}
+   if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_bcd(bct, 9);
+   printf("\n");
+   }
 }
 
 void
 clock_dbgprint_ct(device_t dev, int rw, const struct clocktime *ct)
 {
 
-if (show_io & rw) {
-   clock_dbgprint_hdr(dev, rw);
-   clock_print_ct(ct, 9);
-   printf("\n");
-}
+   if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_ct(ct, 9);
+   printf("\n");
+   }
 }
 
 void
 clock_dbgprint_err(device_t dev, int rw, int err)
 {
 
-if (show_io & rw) {
-   clock_dbgprint_hdr(dev, rw);
-   printf("error = %d\n", err);
-}
+   if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   printf("error = %d\n", err);
+   }
 }
 
 void
 clock_dbgprint_ts(device_t dev, int rw, const struct timespec *ts)
 {
 
-if (show_io & rw) {
-   clock_dbgprint_hdr(dev, rw);
-   clock_print_ts(ts, 9);
-   printf("\n");
-}
+   if (show_io & rw) {
+   clock_dbgprint_hdr(dev, rw);
+   clock_print_ts(ts, 9);
+   printf("\n");
+   }
 }
 
 void
@@ -266,7 +266,7 @@ clock_unregister(device_t clockdev)
if (rtc != NULL) {
taskqueue_cancel_timeout(taskqueue_thread, >stask, NULL);
taskqueue_drain_timeout(taskqueue_thread, >stask);
-free(rtc, M_DEVBUF);
+   free(rtc, M_DEVBUF);
}
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329223 - head/contrib/llvm/tools/clang/lib/Sema

2018-02-13 Thread Dimitry Andric
Author: dim
Date: Tue Feb 13 17:05:50 2018
New Revision: 329223
URL: https://svnweb.freebsd.org/changeset/base/329223

Log:
  Pull in r323998 from upstream clang trunk (by Richard Smith):
  
PR36157: When injecting an implicit function declaration in C89, find
the right DeclContext rather than injecting it wherever we happen to
be.
  
This avoids creating functions whose DeclContext is a struct or
similar.
  
  This fixes assertion failures when parsing certain not-completely-valid
  struct declarations.
  
  Reported by:  ae
  PR:   225862
  MFC after:3 months
  X-MFC-With:   r327952

Modified:
  head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp

Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp
==
--- head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:04:34 
2018(r329222)
+++ head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Tue Feb 13 17:05:50 
2018(r329223)
@@ -12507,9 +12507,19 @@ void Sema::ActOnFinishDelayedAttribute(Scope *S, Decl 
 /// call, forming a call to an implicitly defined function (per C99 6.5.1p2).
 NamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc,
   IdentifierInfo , Scope *S) {
+  // Find the scope in which the identifier is injected and the corresponding
+  // DeclContext.
+  // FIXME: C89 does not say what happens if there is no enclosing block scope.
+  // In that case, we inject the declaration into the translation unit scope
+  // instead.
   Scope *BlockScope = S;
   while (!BlockScope->isCompoundStmtScope() && BlockScope->getParent())
 BlockScope = BlockScope->getParent();
+
+  Scope *ContextScope = BlockScope;
+  while (!ContextScope->getEntity())
+ContextScope = ContextScope->getParent();
+  ContextRAII SavedContext(*this, ContextScope->getEntity());
 
   // Before we produce a declaration for an implicitly defined
   // function, see whether there was a locally-scoped declaration of
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329222 - in head/sys: amd64/conf conf dev/mthca i386/conf modules modules/mthca ofed/include/uapi/rdma

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 17:04:34 2018
New Revision: 329222
URL: https://svnweb.freebsd.org/changeset/base/329222

Log:
  Import the mthca kernel side infiniband driver from Linux 4.9 and fix
  compilation under FreeBSD. The mthca driver was temporarily removed as
  part of the Linux 4.9 RoCE/infinband upgrade.
  
  Top commit in Linux source tree:
  69973b830859bc6529a7a0468ba0d80ee5117826
  
  Sponsored by: Mellanox Technologies

Added:
  head/sys/dev/mthca/
  head/sys/dev/mthca/mthca_allocator.c   (contents, props changed)
  head/sys/dev/mthca/mthca_av.c   (contents, props changed)
  head/sys/dev/mthca/mthca_catas.c   (contents, props changed)
  head/sys/dev/mthca/mthca_cmd.c   (contents, props changed)
  head/sys/dev/mthca/mthca_cmd.h   (contents, props changed)
  head/sys/dev/mthca/mthca_config_reg.h   (contents, props changed)
  head/sys/dev/mthca/mthca_cq.c   (contents, props changed)
  head/sys/dev/mthca/mthca_dev.h   (contents, props changed)
  head/sys/dev/mthca/mthca_doorbell.h   (contents, props changed)
  head/sys/dev/mthca/mthca_eq.c   (contents, props changed)
  head/sys/dev/mthca/mthca_mad.c   (contents, props changed)
  head/sys/dev/mthca/mthca_main.c   (contents, props changed)
  head/sys/dev/mthca/mthca_mcg.c   (contents, props changed)
  head/sys/dev/mthca/mthca_memfree.c   (contents, props changed)
  head/sys/dev/mthca/mthca_memfree.h   (contents, props changed)
  head/sys/dev/mthca/mthca_mr.c   (contents, props changed)
  head/sys/dev/mthca/mthca_pd.c   (contents, props changed)
  head/sys/dev/mthca/mthca_profile.c   (contents, props changed)
  head/sys/dev/mthca/mthca_profile.h   (contents, props changed)
  head/sys/dev/mthca/mthca_provider.c   (contents, props changed)
  head/sys/dev/mthca/mthca_provider.h   (contents, props changed)
  head/sys/dev/mthca/mthca_qp.c   (contents, props changed)
  head/sys/dev/mthca/mthca_reset.c   (contents, props changed)
  head/sys/dev/mthca/mthca_srq.c   (contents, props changed)
  head/sys/dev/mthca/mthca_uar.c   (contents, props changed)
  head/sys/dev/mthca/mthca_user.h   (contents, props changed)
  head/sys/dev/mthca/mthca_wqe.h   (contents, props changed)
  head/sys/modules/mthca/
  head/sys/modules/mthca/Makefile   (contents, props changed)
  head/sys/ofed/include/uapi/rdma/mthca-abi.h   (contents, props changed)
Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/files
  head/sys/i386/conf/NOTES
  head/sys/modules/Makefile

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Tue Feb 13 16:48:57 2018(r329221)
+++ head/sys/amd64/conf/NOTES   Tue Feb 13 17:04:34 2018(r329222)
@@ -315,6 +315,7 @@ options DRM_DEBUG   # Include debug printfs (slow)
 #  Requires the iwn firmware module
 # ixl: Intel XL710 40Gbe PCIE Ethernet
 # ixlv:Intel XL710 40Gbe VF PCIE Ethernet
+# mthca: Mellanox HCA InfiniBand
 # mlx4ib: Mellanox ConnectX HCA InfiniBand
 # mlx4en: Mellanox ConnectX HCA Ethernet
 # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source)
@@ -334,6 +335,7 @@ device  iwn # Intel 
4965/1000/5000/6000 wireless NICs
 device ixl # Intel XL710 40Gbe PCIE Ethernet
 optionsIXL_IW  # Enable iWARP Client Interface in 
ixl(4)
 device ixlv# Intel XL710 40Gbe VF PCIE Ethernet
+device mthca   # Mellanox HCA InfiniBand
 device mlx4# Shared code module between IB and Ethernet
 device mlx4ib  # Mellanox ConnectX HCA InfiniBand
 device mlx4en  # Mellanox ConnectX HCA Ethernet

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Feb 13 16:48:57 2018(r329221)
+++ head/sys/conf/files Tue Feb 13 17:04:34 2018(r329222)
@@ -4551,6 +4551,43 @@ ofed/drivers/infiniband/ulp/sdp/sdp_cma.c
optional sdp
 ofed/drivers/infiniband/ulp/sdp/sdp_tx.c   optional sdp inet   \
compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/sdp/"
 
+dev/mthca/mthca_allocator.coptional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_av.c   optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_catas.coptional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_cmd.c  optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_cq.c   optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_eq.c   optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_mad.c  optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_main.c optional mthca pci ofed \
+   compile-with "${OFED_C}"
+dev/mthca/mthca_mcg.c

svn commit: r329221 - head/bin/sh

2018-02-13 Thread Bryan Drewery
Author: bdrewery
Date: Tue Feb 13 16:48:57 2018
New Revision: 329221
URL: https://svnweb.freebsd.org/changeset/base/329221

Log:
  Allow overriding VTABSIZE at compile-time.
  
  Reviewed by:  jilles
  Differential Revision:https://reviews.freebsd.org/D14339

Modified:
  head/bin/sh/var.c

Modified: head/bin/sh/var.c
==
--- head/bin/sh/var.c   Tue Feb 13 16:26:06 2018(r329220)
+++ head/bin/sh/var.c   Tue Feb 13 16:48:57 2018(r329221)
@@ -71,7 +71,9 @@ __FBSDID("$FreeBSD$");
 #endif
 
 
+#ifndef VTABSIZE
 #define VTABSIZE 39
+#endif
 
 
 struct varinit {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329220 - in head/sys/dev: mpr mps

2018-02-13 Thread Li-Wen Hsu
Author: lwhsu (ports committer)
Date: Tue Feb 13 16:26:06 2018
New Revision: 329220
URL: https://svnweb.freebsd.org/changeset/base/329220

Log:
  Fix non-64-bit platform build by printing bus_addr_t values using %#jx
  
  Reviewed by:  slm
  Differential Revision:https://reviews.freebsd.org/D14344

Modified:
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mps/mps.c

Modified: head/sys/dev/mpr/mpr.c
==
--- head/sys/dev/mpr/mpr.c  Tue Feb 13 16:25:43 2018(r329219)
+++ head/sys/dev/mpr/mpr.c  Tue Feb 13 16:26:06 2018(r329220)
@@ -1356,10 +1356,10 @@ mpr_alloc_hw_queues(struct mpr_softc *sc)
sc->free_busaddr = queues_busaddr;
sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize);
sc->post_busaddr = queues_busaddr + fqsize;
-   mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016lx size= %d\n",
-   sc->free_busaddr, fqsize);
-   mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016lx size= %d\n",
-   sc->post_busaddr, pqsize);
+   mpr_dprint(sc, MPR_INIT, "free queue busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->free_busaddr, fqsize);
+   mpr_dprint(sc, MPR_INIT, "reply queue busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->post_busaddr, pqsize);
 
return (0);
 }
@@ -1402,8 +1402,8 @@ mpr_alloc_replies(struct mpr_softc *sc)
 bzero(sc->reply_frames, rsize);
 bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize,
mpr_memaddr_cb, >reply_busaddr, 0);
-   mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016lx size= %d\n",
-   sc->reply_busaddr, rsize);
+   mpr_dprint(sc, MPR_INIT, "reply frames busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->reply_busaddr, rsize);
 
return (0);
 }
@@ -1438,8 +1438,8 @@ mpr_alloc_requests(struct mpr_softc *sc)
 bzero(sc->req_frames, rsize);
 bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize,
mpr_memaddr_cb, >req_busaddr, 0);
-   mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016lx size= %d\n",
-   sc->req_busaddr, rsize);
+   mpr_dprint(sc, MPR_INIT, "request frames busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->req_busaddr, rsize);
 
rsize = sc->chain_frame_size * sc->num_chains;
 if (bus_dma_tag_create( sc->mpr_parent_dmat,/* parent */
@@ -1464,8 +1464,8 @@ mpr_alloc_requests(struct mpr_softc *sc)
 bzero(sc->chain_frames, rsize);
 bus_dmamap_load(sc->chain_dmat, sc->chain_map, sc->chain_frames, rsize,
mpr_memaddr_cb, >chain_busaddr, 0);
-   mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016lx size= %d\n",
-   sc->chain_busaddr, rsize);
+   mpr_dprint(sc, MPR_INIT, "chain frames busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->chain_busaddr, rsize);
 
rsize = MPR_SENSE_LEN * sc->num_reqs;
if (bus_dma_tag_create( sc->mpr_parent_dmat,/* parent */
@@ -1490,8 +1490,8 @@ mpr_alloc_requests(struct mpr_softc *sc)
 bzero(sc->sense_frames, rsize);
 bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize,
mpr_memaddr_cb, >sense_busaddr, 0);
-   mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016lx size= %d\n",
-   sc->sense_busaddr, rsize);
+   mpr_dprint(sc, MPR_INIT, "sense frames busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->sense_busaddr, rsize);
 
sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR,
M_WAITOK | M_ZERO);

Modified: head/sys/dev/mps/mps.c
==
--- head/sys/dev/mps/mps.c  Tue Feb 13 16:25:43 2018(r329219)
+++ head/sys/dev/mps/mps.c  Tue Feb 13 16:26:06 2018(r329220)
@@ -1313,10 +1313,10 @@ mps_alloc_hw_queues(struct mps_softc *sc)
sc->free_busaddr = queues_busaddr;
sc->post_queue = (MPI2_REPLY_DESCRIPTORS_UNION *)(queues + fqsize);
sc->post_busaddr = queues_busaddr + fqsize;
-   mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016lx size= %d\n",
-   sc->free_busaddr, fqsize);
-   mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016lx size= %d\n",
-   sc->post_busaddr, pqsize);
+   mps_dprint(sc, MPS_INIT, "free queue busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->free_busaddr, fqsize);
+   mps_dprint(sc, MPS_INIT, "reply queue busaddr= %#016jx size= %d\n",
+   (uintmax_t)sc->post_busaddr, pqsize);
 
return (0);
 }
@@ -1360,8 +1360,8 @@ mps_alloc_replies(struct mps_softc *sc)
 bus_dmamap_load(sc->reply_dmat, sc->reply_map, sc->reply_frames, rsize,
mps_memaddr_cb, >reply_busaddr, 0);
 
-   mps_dprint(sc, MPS_INIT, "reply frames busaddr= %#016lx size= %d\n",
-   sc->reply_busaddr, rsize);
+   mps_dprint(sc, MPS_INIT, "reply 

svn commit: r329219 - head

2018-02-13 Thread Roger Pau Monné
Author: royger
Date: Tue Feb 13 16:25:43 2018
New Revision: 329219
URL: https://svnweb.freebsd.org/changeset/base/329219

Log:
  list myself in the MAINTAINERS file for Xen bits

Modified:
  head/MAINTAINERS

Modified: head/MAINTAINERS
==
--- head/MAINTAINERSTue Feb 13 16:07:39 2018(r329218)
+++ head/MAINTAINERSTue Feb 13 16:25:43 2018(r329219)
@@ -92,8 +92,11 @@ sys/dev/ixgbeerj Pre-commit phabricator review 
reques
 sys/dev/ixlerj Pre-commit phabricator review requested.
 sys/dev/sound/usb  hselaskyIf in doubt, ask.
 sys/dev/usbhselaskyIf in doubt, ask.
+sys/dev/xenroyger  Pre-commit review recommended.
 sys/netinet/ip_carp.c  glebius Pre-commit review recommended.
 sys/netpfil/pf kp,glebius  Pre-commit review recommended.
+sys/x86/xenroyger  Pre-commit review recommended.
+sys/xenroyger  Pre-commit review recommended.
 tests  freebsd-testing,ngiePre-commit review requested.
 usr.sbin/bsdconfig dteske  Pre-commit phabricator review requested.
 usr.sbin/dpv   dteske  Pre-commit review requested. Keep in sync with libdpv.
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329218 - head/etc/rc.d

2018-02-13 Thread Brad Davis
Author: brd (doc,ports committer)
Date: Tue Feb 13 16:07:39 2018
New Revision: 329218
URL: https://svnweb.freebsd.org/changeset/base/329218

Log:
  Fix resolv to run when it should and not when it should not..
  
  Approved by:  manu
  Reported by:  manu
  Pointy hat to:brd

Modified:
  head/etc/rc.d/resolv

Modified: head/etc/rc.d/resolv
==
--- head/etc/rc.d/resolvTue Feb 13 15:55:31 2018(r329217)
+++ head/etc/rc.d/resolvTue Feb 13 16:07:39 2018(r329218)
@@ -34,12 +34,11 @@
 . /etc/rc.subr
 
 name="resolv"
+rcvar="resolv_enable"
 desc="Create /etc/resolv.conf from kenv"
 start_cmd="${name}_start"
 stop_cmd=':'
 
-load_rc_config $name
-
 # if the info is available via dhcp/kenv
 # build the resolv.conf
 #
@@ -60,3 +59,5 @@ resolv_start()
fi
 }
 
+load_rc_config $name
+run_rc_command "$1"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329217 - stable/11/share/man/man9

2018-02-13 Thread Bryan Venteicher
Author: bryanv
Date: Tue Feb 13 15:55:31 2018
New Revision: 329217
URL: https://svnweb.freebsd.org/changeset/base/329217

Log:
  MFC 328917:
  
  Correct structure name used in bus_map_resource(9) example

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

Modified: stable/11/share/man/man9/bus_map_resource.9
==
--- stable/11/share/man/man9/bus_map_resource.9 Tue Feb 13 15:44:35 2018
(r329216)
+++ stable/11/share/man/man9/bus_map_resource.9 Tue Feb 13 15:55:31 2018
(r329217)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 20, 2016
+.Dd February 5, 2018
 .Dt BUS_MAP_RESOURCE 9
 .Os
 .Sh NAME
@@ -143,16 +143,16 @@ reads the first 32-bit word:
 .Bd -literal
struct resource *r;
struct resource_map map;
-   struct resource_map_args args;
+   struct resource_map_request req;
uint32_t val;
int rid;
 
rid = PCIR_BAR(0);
r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, , RF_ACTIVE |
RF_UNMAPPED);
-   resource_init_map_request();
-   args.memattr = VM_MEMATTR_WRITE_COMBINING;
-   bus_map_resource(dev, SYS_RES_MEMORY, r, , );
+   resource_init_map_request();
+   req.memattr = VM_MEMATTR_WRITE_COMBINING;
+   bus_map_resource(dev, SYS_RES_MEMORY, r, , );
val = bus_read_4(, 0);
 .Ed
 .Sh SEE ALSO
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


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

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Tue Feb 13 15:44:35 2018
New Revision: 329216
URL: https://svnweb.freebsd.org/changeset/base/329216

Log:
  linuxkpi: Do not leak pages on put.
  
  When the owner of the wire reference releases the last reference, it
  might be that the page was already attempted to be freed (but free
  cannot be performed at that time due to wire).  Check that the page
  was removed from the object as the indicator of the free attempt and
  finish the free operation if so.
  
  Reported and tested by:   Slava Shwartsman
  Reviewed by:  hselasky
  Sponsored by: Mellanox Technologies
  MFC after:1 week

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

Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h
==
--- head/sys/compat/linuxkpi/common/include/linux/mm.h  Tue Feb 13 15:36:28 
2018(r329215)
+++ head/sys/compat/linuxkpi/common/include/linux/mm.h  Tue Feb 13 15:44:35 
2018(r329216)
@@ -243,7 +243,8 @@ static inline void
 put_page(struct vm_page *page)
 {
vm_page_lock(page);
-   vm_page_unwire(page, PQ_ACTIVE);
+   if (vm_page_unwire(page, PQ_ACTIVE) && page->object == NULL)
+   vm_page_free(page);
vm_page_unlock(page);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329215 - head/sys/vm

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Tue Feb 13 15:36:28 2018
New Revision: 329215
URL: https://svnweb.freebsd.org/changeset/base/329215

Log:
  Do not leak rv->psind in some specific situations.
  
  Suppose that we have an object with a mapped superpage, and that all
  pages in the superpages are held (by some driver).  Additionally,
  suppose that the object is terminated, e.g. because the only process
  mapping it is exiting.  Then the reservation is broken, but the pages
  cannot be freed until later, when they are unheld.  In this situation,
  the reservation code cannot clean psind, since no pages are freed, and
  the page is freed and then reused with invalid psind.
  
  Clean psind on vm_reserv_break() to avoid the situation.
  
  Reported and tested by:   Slava Shwartsman
  Reviewed by:  markj
  Sponsored by: Mellanox Technologies
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D14335

Modified:
  head/sys/vm/vm_reserv.c

Modified: head/sys/vm/vm_reserv.c
==
--- head/sys/vm/vm_reserv.c Tue Feb 13 15:30:31 2018(r329214)
+++ head/sys/vm/vm_reserv.c Tue Feb 13 15:36:28 2018(r329215)
@@ -949,6 +949,7 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m)
 
vm_domain_free_assert_locked(VM_DOMAIN(rv->domain));
vm_reserv_remove(rv);
+   rv->pages->psind = 0;
if (m != NULL) {
/*
 * Since the reservation is being broken, there is no harm in
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329214 - in head/sys/x86: include x86

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Tue Feb 13 15:30:31 2018
New Revision: 329214
URL: https://svnweb.freebsd.org/changeset/base/329214

Log:
  Fix build with gas.
  
  Do not use C constant suffixes.  Bit values are small enough to not
  require typing, despite they are used for 64bit MSR writes.  The added
  cast in hw_ibrs_recalculate() is redundand but I prefer to add it for
  clarity.
  
  Reported by:  bde
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/x86/include/specialreg.h
  head/sys/x86/x86/cpu_machdep.c

Modified: head/sys/x86/include/specialreg.h
==
--- head/sys/x86/include/specialreg.h   Tue Feb 13 15:18:11 2018
(r329213)
+++ head/sys/x86/include/specialreg.h   Tue Feb 13 15:30:31 2018
(r329214)
@@ -702,8 +702,8 @@
  * document 336996-001 Speculative Execution Side Channel Mitigations.
  */
 /* MSR IA32_SPEC_CTRL */
-#defineIA32_SPEC_CTRL_IBRS 0x0001ULL
-#defineIA32_SPEC_CTRL_STIBP0x0002ULL
+#defineIA32_SPEC_CTRL_IBRS 0x0001
+#defineIA32_SPEC_CTRL_STIBP0x0002
 
 /* MSR IA32_PRED_CMD */
 #defineIA32_PRED_CMD_IBPB_BARRIER  0x0001ULL

Modified: head/sys/x86/x86/cpu_machdep.c
==
--- head/sys/x86/x86/cpu_machdep.c  Tue Feb 13 15:18:11 2018
(r329213)
+++ head/sys/x86/x86/cpu_machdep.c  Tue Feb 13 15:30:31 2018
(r329214)
@@ -592,7 +592,7 @@ hw_ibrs_recalculate(void)
if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) {
if (hw_ibrs_disable) {
v= rdmsr(MSR_IA32_SPEC_CTRL);
-   v &= ~IA32_SPEC_CTRL_IBRS;
+   v &= ~(uint64_t)IA32_SPEC_CTRL_IBRS;
wrmsr(MSR_IA32_SPEC_CTRL, v);
} else {
v= rdmsr(MSR_IA32_SPEC_CTRL);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329213 - stable/11/sys/dev/mlx5/mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:18:11 2018
New Revision: 329213
URL: https://svnweb.freebsd.org/changeset/base/329213

Log:
  MFC r325654:
  Add API functions to modify the transport interface send object, TIS,
  in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c
  stable/11/sys/dev/mlx5/mlx5_core/transobj.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.cTue Feb 13 15:16:10 
2018(r329212)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_transobj.cTue Feb 13 15:18:11 
2018(r329213)
@@ -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
@@ -208,6 +208,17 @@ int mlx5_core_create_tis(struct mlx5_core_dev *dev, u3
*tisn = MLX5_GET(create_tis_out, out, tisn);
 
return err;
+}
+
+int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in,
+int inlen)
+{
+   u32 out[MLX5_ST_SZ_DW(modify_tis_out)] = {0};
+
+   MLX5_SET(modify_tis_in, in, tisn, tisn);
+   MLX5_SET(modify_tis_in, in, opcode, MLX5_CMD_OP_MODIFY_TIS);
+
+   return mlx5_cmd_exec(dev, in, inlen, out, sizeof(out));
 }
 
 void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn)

Modified: stable/11/sys/dev/mlx5/mlx5_core/transobj.h
==
--- stable/11/sys/dev/mlx5/mlx5_core/transobj.h Tue Feb 13 15:16:10 2018
(r329212)
+++ stable/11/sys/dev/mlx5/mlx5_core/transobj.h Tue Feb 13 15:18:11 2018
(r329213)
@@ -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
@@ -45,6 +45,8 @@ int mlx5_core_create_tir(struct mlx5_core_dev *dev, u3
 void mlx5_core_destroy_tir(struct mlx5_core_dev *dev, u32 tirn);
 int mlx5_core_create_tis(struct mlx5_core_dev *dev, u32 *in, int inlen,
 u32 *tisn);
+int mlx5_core_modify_tis(struct mlx5_core_dev *dev, u32 tisn, u32 *in,
+int inlen);
 void mlx5_core_destroy_tis(struct mlx5_core_dev *dev, u32 tisn);
 int mlx5_core_create_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen, u32 
*rmpn);
 int mlx5_core_modify_rmp(struct mlx5_core_dev *dev, u32 *in, int inlen);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329212 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:16:10 2018
New Revision: 329212
URL: https://svnweb.freebsd.org/changeset/base/329212

Log:
  MFC r325658:
  Make physical address of init segment available in the priv of mlx5 core.
  This change is needed by mlx5ib(4).
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:14:32 2018
(r329211)
+++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:16:10 2018
(r329212)
@@ -595,6 +595,7 @@ struct mlx5_core_dev {
struct mlx5_port_caps   port_caps[MLX5_MAX_PORTS];
u32 hca_caps_cur[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];
u32 hca_caps_max[MLX5_CAP_NUM][MLX5_UN_SZ_DW(hca_cap_union)];
+   phys_addr_t iseg_base;
struct mlx5_init_seg __iomem *iseg;
enum mlx5_device_state  state;
void(*event) (struct mlx5_core_dev *dev,

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:14:32 
2018(r329211)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:16:10 
2018(r329212)
@@ -716,8 +716,8 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st
goto err_clr_master;
}
 
-   dev->iseg = ioremap(pci_resource_start(dev->pdev, 0),
-   sizeof(*dev->iseg));
+   dev->iseg_base = pci_resource_start(dev->pdev, 0);
+   dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg));
if (!dev->iseg) {
err = -ENOMEM;
device_printf((>dev)->bsddev, "ERR: ""Failed mapping 
initialization segment, aborting\n");
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329211 - stable/11/sys/dev/mlx5/mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:14:32 2018
New Revision: 329211
URL: https://svnweb.freebsd.org/changeset/base/329211

Log:
  MFC r325652:
  Prevent mlx5 core from accessing host memory after shutdown by disabling
  PCI busmaster.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:13:43 
2018(r329210)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:14:32 
2018(r329211)
@@ -1134,6 +1134,12 @@ static void remove_one(struct pci_dev *pdev)
kfree(dev);
 }
 
+static void shutdown_one(struct pci_dev *pdev)
+{
+   /* prevent device from accessing host memory after shutdown */
+   pci_clear_master(pdev);
+}
+
 static const struct pci_device_id mlx5_core_pci_table[] = {
{ PCI_VDEVICE(MELLANOX, 4113) }, /* Connect-IB */
{ PCI_VDEVICE(MELLANOX, 4114) }, /* Connect-IB VF */
@@ -1175,6 +1181,7 @@ MODULE_DEVICE_TABLE(pci, mlx5_core_pci_table);
 static struct pci_driver mlx5_core_driver = {
.name   = DRIVER_NAME,
.id_table   = mlx5_core_pci_table,
+   .shutdown   = shutdown_one,
.probe  = init_one,
.remove = remove_one
 };
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329210 - head/share/misc

2018-02-13 Thread Remko Lodder
Author: remko
Date: Tue Feb 13 15:13:43 2018
New Revision: 329210
URL: https://svnweb.freebsd.org/changeset/base/329210

Log:
  Update the secteam/security officer list to match reality.

Modified:
  head/share/misc/organization.dot

Modified: head/share/misc/organization.dot
==
--- head/share/misc/organization.dotTue Feb 13 15:13:15 2018
(r329209)
+++ head/share/misc/organization.dotTue Feb 13 15:13:43 2018
(r329210)
@@ -33,10 +33,10 @@ portscommitters [label="Ports Committers\nports-commit
 portmgr [label="Port Management Team\nport...@freebsd.org\nadamw, antoine, 
bapt, bdrewery\nfeld, mat, rene, swills"]
 portmgrsecretary [label="Port Management Team 
Secretary\nportmgr-secret...@freebsd.org\nrene"]
 re [label="Primary Release Engineering Team\n...@freebsd.org\ngjb, 
kib,\nbdrewery, blackend,\nrgrimes, delphij,\nhrs, glebius,\nmarius, rwatson"]
-secteam [label="Security Team\nsect...@freebsd.org\ndelphij,\ndes, gavin, 
gjb,\nglebius, remko"]
+secteam [label="Security Team\nsect...@freebsd.org\nbenno, delphij,\ndes, 
emaste,\ngjb, gordon,\nremko"]
 portssecteam [label="Ports Security Team\nports-sect...@freebsd.org\ndelphij, 
amdmi3, eadler, feld, jgh, rea, riggs, sbz, simon, swills, zi"]
 secteamsecretary [label="Security Team 
Secretary\nsecteam-secret...@freebsd.org\nremko"]
-securityofficer [label="Security Officer 
Team\nsecurity-offi...@freebsd.org\ndelphij, des,\ngavin, gjb,\nglebius, remko"]
+securityofficer [label="Security Officer 
Team\nsecurity-offi...@freebsd.org\nbenno, delphij,\ndes, emaste,\ngjb, 
gordon,\nremko"]
 srccommitters [label="Src Committers\nsrc-committ...@freebsd.org"]
 
 # Admin teams go here alphabetically sorted
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329209 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:13:15 2018
New Revision: 329209
URL: https://svnweb.freebsd.org/changeset/base/329209

Log:
  MFC r325651:
  Set ATOMIC endian mode in mlx5 core.
  
  The hardware is capable of 2 requestor endianness modes for standard 8
  byte atomics: BE (0x0) and host endianness (0x1). Read the supported
  modes from hca atomic capabilities and configure HW to host endianness
  mode if supported.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
  stable/11/sys/dev/mlx5/mlx5_ifc.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:11:00 
2018(r329208)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.cTue Feb 13 15:13:15 
2018(r329209)
@@ -74,6 +74,11 @@ struct mlx5_device_context {
void   *context;
 };
 
+enum {
+   MLX5_ATOMIC_REQ_MODE_BE = 0x0,
+   MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS = 0x1,
+};
+
 static struct mlx5_profile profiles[] = {
[0] = {
.mask   = 0,
@@ -393,6 +398,53 @@ query_ex:
return err;
 }
 
+static int handle_hca_cap_atomic(struct mlx5_core_dev *dev)
+{
+   void *set_ctx;
+   void *set_hca_cap;
+   int set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in);
+   int req_endianness;
+   int err;
+
+   if (MLX5_CAP_GEN(dev, atomic)) {
+   err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC,
+HCA_CAP_OPMOD_GET_MAX);
+   if (err)
+   return err;
+
+   err = mlx5_core_get_caps(dev, MLX5_CAP_ATOMIC,
+HCA_CAP_OPMOD_GET_CUR);
+   if (err)
+   return err;
+   } else {
+   return 0;
+   }
+
+   req_endianness =
+   MLX5_CAP_ATOMIC(dev,
+   supported_atomic_req_8B_endianess_mode_1);
+
+   if (req_endianness != MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS)
+   return 0;
+
+   set_ctx = kzalloc(set_sz, GFP_KERNEL);
+   if (!set_ctx)
+   return -ENOMEM;
+
+   MLX5_SET(set_hca_cap_in, set_ctx, op_mod,
+MLX5_SET_HCA_CAP_OP_MOD_ATOMIC << 1);
+   set_hca_cap = MLX5_ADDR_OF(set_hca_cap_in, set_ctx, capability);
+
+   /* Set requestor to host endianness */
+   MLX5_SET(atomic_caps, set_hca_cap, atomic_req_8B_endianess_mode,
+MLX5_ATOMIC_REQ_MODE_HOST_ENDIANNESS);
+
+   err = set_caps(dev, set_ctx, set_sz);
+
+   kfree(set_ctx);
+   return err;
+}
+
 static int set_hca_ctrl(struct mlx5_core_dev *dev)
 {
struct mlx5_reg_host_endianess he_in;
@@ -717,15 +769,21 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st
goto err_pagealloc_stop;
}
 
+   err = set_hca_ctrl(dev);
+   if (err) {
+   device_printf((>dev)->bsddev, "ERR: ""set_hca_ctrl 
failed\n");
+   goto reclaim_boot_pages;
+   }
+
err = handle_hca_cap(dev);
if (err) {
device_printf((>dev)->bsddev, "ERR: ""handle_hca_cap 
failed\n");
goto reclaim_boot_pages;
}
 
-   err = set_hca_ctrl(dev);
+   err = handle_hca_cap_atomic(dev);
if (err) {
-   device_printf((>dev)->bsddev, "ERR: ""set_hca_ctrl 
failed\n");
+   device_printf((>dev)->bsddev, "ERR: 
""handle_hca_cap_atomic failed\n");
goto reclaim_boot_pages;
}
 

Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h
==
--- stable/11/sys/dev/mlx5/mlx5_ifc.h   Tue Feb 13 15:11:00 2018
(r329208)
+++ stable/11/sys/dev/mlx5/mlx5_ifc.h   Tue Feb 13 15:13:15 2018
(r329209)
@@ -74,6 +74,11 @@ enum {
 };
 
 enum {
+   MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE= 0x0,
+   MLX5_SET_HCA_CAP_OP_MOD_ATOMIC= 0x3,
+};
+
+enum {
MLX5_CMD_OP_QUERY_HCA_CAP = 0x100,
MLX5_CMD_OP_QUERY_ADAPTER = 0x101,
MLX5_CMD_OP_INIT_HCA  = 0x102,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329208 - stable/11/sys/dev/mlx5/mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:11:00 2018
New Revision: 329208
URL: https://svnweb.freebsd.org/changeset/base/329208

Log:
  MFC r325649:
  Make local variable 64-bits to avoid masking away bits in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Tue Feb 13 15:09:03 2018
(r329207)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Tue Feb 13 15:11:00 2018
(r329208)
@@ -510,7 +510,7 @@ void mlx5_eq_cleanup(struct mlx5_core_dev *dev)
 int mlx5_start_eqs(struct mlx5_core_dev *dev)
 {
struct mlx5_eq_table *table = >priv.eq_table;
-   u32 async_event_mask = MLX5_ASYNC_EVENT_MASK;
+   u64 async_event_mask = MLX5_ASYNC_EVENT_MASK;
int err;
 
if (MLX5_CAP_GEN(dev, port_module_event))
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329207 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:09:03 2018
New Revision: 329207
URL: https://svnweb.freebsd.org/changeset/base/329207

Log:
  MFC r325653:
  Add API functions to set and query dropless port mode in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:07:39 2018
(r329206)
+++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:09:03 2018
(r329207)
@@ -983,6 +983,8 @@ int mlx5_core_destroy_psv(struct mlx5_core_dev *dev, i
 void mlx5_core_put_rsc(struct mlx5_core_rsc_common *common);
 u8 mlx5_is_wol_supported(struct mlx5_core_dev *dev);
 int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mode);
+int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout);
+int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout);
 int mlx5_query_wol(struct mlx5_core_dev *dev, u8 *wol_mode);
 int mlx5_core_access_pvlc(struct mlx5_core_dev *dev,
  struct mlx5_pvlc_reg *pvlc, int write);

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.cTue Feb 13 15:07:39 
2018(r329206)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.cTue Feb 13 15:09:03 
2018(r329207)
@@ -459,6 +459,46 @@ int mlx5_set_wol(struct mlx5_core_dev *dev, u8 wol_mod
 }
 EXPORT_SYMBOL_GPL(mlx5_set_wol);
 
+int mlx5_query_dropless_mode(struct mlx5_core_dev *dev, u16 *timeout)
+{
+   u32 in[MLX5_ST_SZ_DW(query_delay_drop_params_in)];
+   u32 out[MLX5_ST_SZ_DW(query_delay_drop_params_out)];
+   int err = 0;
+
+   memset(in, 0, sizeof(in));
+   memset(out, 0, sizeof(out));
+
+   MLX5_SET(query_delay_drop_params_in, in, opcode,
+MLX5_CMD_OP_QUERY_DELAY_DROP_PARAMS);
+
+   err = mlx5_cmd_exec_check_status(dev, in, sizeof(in), out, sizeof(out));
+   if (err)
+   return err;
+
+   *timeout = MLX5_GET(query_delay_drop_params_out, out,
+   delay_drop_timeout);
+
+   return 0;
+}
+EXPORT_SYMBOL_GPL(mlx5_query_dropless_mode);
+
+int mlx5_set_dropless_mode(struct mlx5_core_dev *dev, u16 timeout)
+{
+   u32 in[MLX5_ST_SZ_DW(set_delay_drop_params_in)];
+   u32 out[MLX5_ST_SZ_DW(set_delay_drop_params_out)];
+
+   memset(in, 0, sizeof(in));
+   memset(out, 0, sizeof(out));
+
+   MLX5_SET(set_delay_drop_params_in, in, opcode,
+MLX5_CMD_OP_SET_DELAY_DROP_PARAMS);
+   MLX5_SET(set_delay_drop_params_in, in, delay_drop_timeout, timeout);
+
+   return mlx5_cmd_exec_check_status(dev, in, sizeof(in),
+  out, sizeof(out));
+}
+EXPORT_SYMBOL_GPL(mlx5_set_dropless_mode);
+
 int mlx5_core_access_pvlc(struct mlx5_core_dev *dev,
  struct mlx5_pvlc_reg *pvlc, int write)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329206 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:07:39 2018
New Revision: 329206
URL: https://svnweb.freebsd.org/changeset/base/329206

Log:
  MFC r325650:
  Add const keyword to input-only argument in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:05:23 2018
(r329205)
+++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 15:07:39 2018
(r329206)
@@ -879,7 +879,7 @@ int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev
 u32 *mkey);
 int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn);
 int mlx5_core_dealloc_pd(struct mlx5_core_dev *dev, u32 pdn);
-int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb,
+int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
  u16 opmod, u8 port);
 void mlx5_fwp_flush(struct mlx5_fw_page *fwp);
 void mlx5_fwp_invalidate(struct mlx5_fw_page *fwp);

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c Tue Feb 13 15:05:23 2018
(r329205)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_mad.c Tue Feb 13 15:07:39 2018
(r329206)
@@ -30,7 +30,7 @@
 #include 
 #include "mlx5_core.h"
 
-int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, void *inb, void *outb,
+int mlx5_core_mad_ifc(struct mlx5_core_dev *dev, const void *inb, void *outb,
  u16 opmod, u8 port)
 {
struct mlx5_mad_ifc_mbox_in *in = NULL;
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329205 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 15:05:23 2018
New Revision: 329205
URL: https://svnweb.freebsd.org/changeset/base/329205

Log:
  MFC r325648:
  Implement support for decoding general port notification event in
  the mlx5 core module.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/device.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/device.h
==
--- stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:57:34 2018
(r329204)
+++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 15:05:23 2018
(r329205)
@@ -526,6 +526,11 @@ struct mlx5_eqe_port_module_event {
u8error_type;
 };
 
+struct mlx5_eqe_general_notification_event {
+   u32   rq_user_index_delay_drop;
+   u32   rsvd0[6];
+};
+
 union ev_data {
__be32  raw[7];
struct mlx5_eqe_cmd cmd;
@@ -539,6 +544,7 @@ union ev_data {
struct mlx5_eqe_page_reqreq_pages;
struct mlx5_eqe_port_module_event port_module_event;
struct mlx5_eqe_vport_changevport_change;
+   struct mlx5_eqe_general_notification_event general_notifications;
 } __packed;
 
 struct mlx5_eqe {
@@ -1427,6 +1433,10 @@ static inline int mlx5_get_cqe_format(const struct mlx
 {
return (cqe->op_own & MLX5E_CQE_FORMAT_MASK) >> 2;
 }
+
+enum {
+   MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT = 0x1,
+};
 
 /* 8 regular priorities + 1 for multicast */
 #define MLX5_NUM_BYPASS_FTS9

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Tue Feb 13 14:57:34 2018
(r329204)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c  Tue Feb 13 15:05:23 2018
(r329205)
@@ -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
@@ -80,6 +80,8 @@ struct cre_des_eq {
 /*Function prototype*/
 static void mlx5_port_module_event(struct mlx5_core_dev *dev,
   struct mlx5_eqe *eqe);
+static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev,
+struct mlx5_eqe *eqe);
 
 static int mlx5_cmd_destroy_eq(struct mlx5_core_dev *dev, u8 eqn)
 {
@@ -157,6 +159,8 @@ static const char *eqe_type_str(u8 type)
return "MLX5_EVENT_TYPE_NIC_VPORT_CHANGE";
case MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT:
return "MLX5_EVENT_TYPE_CODING_DCBX_CHANGE_EVENT";
+   case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT:
+   return "MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT";
default:
return "Unrecognized event";
}
@@ -296,6 +300,10 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru
}
break;
 
+   case MLX5_EVENT_TYPE_CODING_GENERAL_NOTIFICATION_EVENT:
+   mlx5_port_general_notification_event(dev, eqe);
+   break;
+
case MLX5_EVENT_TYPE_CQ_ERROR:
cqn = be32_to_cpu(eqe->data.cq_err.cqn) & 0xff;
mlx5_core_warn(dev, "CQ error on CQN 0x%x, syndrom 
0x%x\n",
@@ -665,5 +673,26 @@ static void mlx5_port_module_event(struct mlx5_core_de
/* store module status */
if (module_num < MLX5_MAX_PORTS)
dev->module_status[module_num] = module_status;
+}
+
+static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev,
+struct mlx5_eqe *eqe)
+{
+   u8 port = (eqe->data.port.port >> 4) & 0xf;
+   u32 rqn = 0;
+   struct mlx5_eqe_general_notification_event *general_event = NULL;
+
+   switch (eqe->sub_type) {
+   case MLX5_GEN_EVENT_SUBTYPE_DELAY_DROP_TIMEOUT:
+   general_event = >data.general_notifications;
+   rqn = be32_to_cpu(general_event->rq_user_index_delay_drop) &
+ 0xff;
+   break;
+   default:
+   mlx5_core_warn(dev,
+  "general event with unrecognized subtype: port 
%d, sub_type %d\n",
+  port, eqe->sub_type);
+   break;
+   }
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329204 - in stable/11/sys/dev/mlx5: . mlx5_ib

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 14:57:34 2018
New Revision: 329204
URL: https://svnweb.freebsd.org/changeset/base/329204

Log:
  MFC r325662:
  Add more and update existing mlx5 core firmware structure definitions and 
bits.
  This change is part of coming ibcore and mlx5ib updates.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/device.h
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c
  stable/11/sys/dev/mlx5/mlx5_ifc.h
  stable/11/sys/dev/mlx5/qp.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/device.h
==
--- stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:47:44 2018
(r329203)
+++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:57:34 2018
(r329204)
@@ -100,6 +100,35 @@ __mlx5_mask(typ, fld))
 
 #define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + 
__mlx5_64_off(typ, fld)))
 
+#define MLX5_GET64_BE(typ, p, fld) (*((__be64 *)(p) +\
+   __mlx5_64_off(typ, fld)))
+
+#define MLX5_GET_BE(type_t, typ, p, fld) ({  \
+   type_t tmp;   \
+   switch (sizeof(tmp)) {\
+   case sizeof(u8):  \
+   tmp = (__force type_t)MLX5_GET(typ, p, fld);  \
+   break;\
+   case sizeof(u16): \
+   tmp = (__force type_t)cpu_to_be16(MLX5_GET(typ, p, 
fld)); \
+   break;\
+   case sizeof(u32): \
+   tmp = (__force type_t)cpu_to_be32(MLX5_GET(typ, p, 
fld)); \
+   break;\
+   case sizeof(u64): \
+   tmp = (__force type_t)MLX5_GET64_BE(typ, p, fld); \
+   break;\
+   } \
+   tmp;  \
+   })
+
+#define MLX5_BY_PASS_NUM_REGULAR_PRIOS 8
+#define MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS 8
+#define MLX5_BY_PASS_NUM_MULTICAST_PRIOS 1
+#define MLX5_BY_PASS_NUM_PRIOS (MLX5_BY_PASS_NUM_REGULAR_PRIOS +\
+MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS +\
+MLX5_BY_PASS_NUM_MULTICAST_PRIOS)
+
 enum {
MLX5_MAX_COMMANDS   = 32,
MLX5_CMD_DATA_BLOCK_SIZE= 512,
@@ -326,6 +355,17 @@ enum {
MLX5_CAP_OFF_CMDIF_CSUM = 46,
 };
 
+enum {
+   /*
+* Max wqe size for rdma read is 512 bytes, so this
+* limits our max_sge_rd as the wqe needs to fit:
+* - ctrl segment (16 bytes)
+* - rdma segment (16 bytes)
+* - scatter elements (16 bytes each)
+*/
+   MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16
+};
+
 struct mlx5_inbox_hdr {
__be16  opcode;
u8  rsvd[4];
@@ -642,9 +682,9 @@ enum {
 };
 
 enum {
-   CQE_ROCE_L3_HEADER_TYPE_GRH = 0x0,
-   CQE_ROCE_L3_HEADER_TYPE_IPV6= 0x1,
-   CQE_ROCE_L3_HEADER_TYPE_IPV4= 0x2,
+   MLX5_CQE_ROCE_L3_HEADER_TYPE_GRH= 0x0,
+   MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV6   = 0x1,
+   MLX5_CQE_ROCE_L3_HEADER_TYPE_IPV4   = 0x2,
 };
 
 enum {
@@ -1282,6 +1322,7 @@ enum {
MLX5_PER_PRIORITY_COUNTERS_GROUP  = 0x10,
MLX5_PER_TRAFFIC_CLASS_COUNTERS_GROUP = 0x11,
MLX5_PHYSICAL_LAYER_COUNTERS_GROUP= 0x12,
+   MLX5_PHYSICAL_LAYER_STATISTICAL_GROUP = 0x16,
MLX5_INFINIBAND_PORT_COUNTERS_GROUP = 0x20,
 };
 

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:47:44 2018
(r329203)
+++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:57:34 2018
(r329204)
@@ -306,6 +306,11 @@ struct cmd_msg_cache {
 
 };
 
+struct mlx5_traffic_counter {
+   u64 packets;
+   u64 octets;
+};
+
 struct mlx5_cmd_stats {
u64 sum;
u64 n;
@@ -742,6 +747,13 @@ struct mlx5_pas {
u8  log_sz;
 };
 
+enum port_state_policy {
+   MLX5_POLICY_DOWN= 0,
+   MLX5_POLICY_UP  = 1,
+   MLX5_POLICY_FOLLOW  = 2,
+   MLX5_POLICY_INVALID = 0x
+};
+
 static inline void *
 mlx5_buf_offset(struct mlx5_buf *buf, int offset)
 {
@@ -808,6 +820,11 @@ static inline void *mlx5_vmalloc(unsigned long size)
if (!rtn)
rtn = vmalloc(size);
  

svn commit: r329203 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 14:47:44 2018
New Revision: 329203
URL: https://svnweb.freebsd.org/changeset/base/329203

Log:
  MFC r325657:
  Add API function to query port performance counters for infiniband and RoCE
  traffic in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
  stable/11/sys/dev/mlx5/vport.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:46:29 
2018(r329202)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:47:44 
2018(r329203)
@@ -1757,3 +1757,25 @@ out:
return err;
 }
 EXPORT_SYMBOL_GPL(mlx5_query_hca_vport_state);
+
+int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev,
+u8 port_num, void *out, size_t sz)
+{
+   u32 *in;
+   int err;
+
+   in  = mlx5_vzalloc(sz);
+   if (!in) {
+   err = -ENOMEM;
+   return err;
+   }
+
+   MLX5_SET(ppcnt_reg, in, local_port, port_num);
+
+   MLX5_SET(ppcnt_reg, in, grp, MLX5_INFINIBAND_PORT_COUNTERS_GROUP);
+   err = mlx5_core_access_reg(dev, in, sz, out,
+  sz, MLX5_REG_PPCNT, 0, 0);
+
+   kvfree(in);
+   return err;
+}

Modified: stable/11/sys/dev/mlx5/vport.h
==
--- stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:46:29 2018
(r329202)
+++ stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:47:44 2018
(r329203)
@@ -143,4 +143,6 @@ int mlx5_query_vport_counter(struct mlx5_core_dev *dev
 void *out, int out_size);
 int mlx5_get_vport_counters(struct mlx5_core_dev *dev, u8 port_num,
struct mlx5_vport_counters *vc);
+int mlx5_core_query_ib_ppcnt(struct mlx5_core_dev *dev,
+u8 port_num, void *out, size_t sz);
 #endif /* __MLX5_VPORT_H__ */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329202 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 14:46:29 2018
New Revision: 329202
URL: https://svnweb.freebsd.org/changeset/base/329202

Log:
  MFC r325656:
  Add API functions to query and modify local loopback of multicast and
  unicast traffic in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
  stable/11/sys/dev/mlx5/vport.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:45:05 
2018(r329201)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:46:29 
2018(r329202)
@@ -1485,6 +1485,72 @@ int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev
 }
 EXPORT_SYMBOL_GPL(mlx5_modify_nic_vport_promisc);
 
+int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev,
+  enum mlx5_local_lb_selection selection,
+  u8 value)
+{
+   void *in;
+   int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in);
+   int err;
+
+   in = mlx5_vzalloc(inlen);
+   if (!in) {
+   mlx5_core_warn(mdev, "failed to allocate inbox\n");
+   return -ENOMEM;
+   }
+
+   MLX5_SET(modify_nic_vport_context_in, in, vport_number, 0);
+
+   if (selection == MLX5_LOCAL_MC_LB) {
+   MLX5_SET(modify_nic_vport_context_in, in,
+field_select.disable_mc_local_lb, 1);
+   MLX5_SET(modify_nic_vport_context_in, in,
+nic_vport_context.disable_mc_local_lb,
+value);
+   } else {
+   MLX5_SET(modify_nic_vport_context_in, in,
+field_select.disable_uc_local_lb, 1);
+   MLX5_SET(modify_nic_vport_context_in, in,
+nic_vport_context.disable_uc_local_lb,
+value);
+   }
+
+   err = mlx5_modify_nic_vport_context(mdev, in, inlen);
+
+   kvfree(in);
+   return err;
+}
+EXPORT_SYMBOL_GPL(mlx5_nic_vport_modify_local_lb);
+
+int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev,
+ enum mlx5_local_lb_selection selection,
+ u8 *value)
+{
+   void *out;
+   int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out);
+   int err;
+
+   out = kzalloc(outlen, GFP_KERNEL);
+   if (!out)
+   return -ENOMEM;
+
+   err = mlx5_query_nic_vport_context(mdev, 0, out, outlen);
+   if (err)
+   goto done;
+
+   if (selection == MLX5_LOCAL_MC_LB)
+   *value = MLX5_GET(query_nic_vport_context_out, out,
+ nic_vport_context.disable_mc_local_lb);
+   else
+   *value = MLX5_GET(query_nic_vport_context_out, out,
+ nic_vport_context.disable_uc_local_lb);
+
+done:
+   kfree(out);
+   return err;
+}
+EXPORT_SYMBOL_GPL(mlx5_nic_vport_query_local_lb);
+
 int mlx5_query_vport_counter(struct mlx5_core_dev *dev,
 u8 port_num, u16 vport_num,
 void *out, int out_size)

Modified: stable/11/sys/dev/mlx5/vport.h
==
--- stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:45:05 2018
(r329201)
+++ stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:46:29 2018
(r329202)
@@ -41,7 +41,17 @@ int mlx5_vport_query_q_counter(struct mlx5_core_dev *m
 int mlx5_vport_query_out_of_rx_buffer(struct mlx5_core_dev *mdev,
  u16 counter_set_id,
  u32 *out_of_rx_buffer);
+enum mlx5_local_lb_selection {
+   MLX5_LOCAL_MC_LB,
+   MLX5_LOCAL_UC_LB
+};
 
+int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev,
+ enum mlx5_local_lb_selection selection,
+ u8 *value);
+int mlx5_nic_vport_modify_local_lb(struct mlx5_core_dev *mdev,
+  enum mlx5_local_lb_selection selection,
+  u8 value);
 u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport);
 u8 mlx5_query_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod,
u16 vport);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329201 - in stable/11/sys/dev/mlx5: . mlx5_core

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 14:45:05 2018
New Revision: 329201
URL: https://svnweb.freebsd.org/changeset/base/329201

Log:
  MFC r325655:
  Add API function to query virtual port counters in mlx5 core.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
  stable/11/sys/dev/mlx5/vport.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c
==
--- stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:37:21 
2018(r329200)
+++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_vport.c   Tue Feb 13 14:45:05 
2018(r329201)
@@ -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
@@ -965,6 +965,43 @@ int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *
return mlx5_nic_vport_enable_disable_roce(mdev, 0);
 }
 EXPORT_SYMBOL_GPL(mlx5_nic_vport_disable_roce);
+
+int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport,
+ int vf, u8 port_num, void *out,
+ size_t out_sz)
+{
+   int in_sz = MLX5_ST_SZ_BYTES(query_vport_counter_in);
+   int is_group_manager;
+   void   *in;
+   int err;
+
+   is_group_manager = MLX5_CAP_GEN(dev, vport_group_manager);
+   in = mlx5_vzalloc(in_sz);
+   if (!in) {
+   err = -ENOMEM;
+   return err;
+   }
+
+   MLX5_SET(query_vport_counter_in, in, opcode,
+MLX5_CMD_OP_QUERY_VPORT_COUNTER);
+   if (other_vport) {
+   if (is_group_manager) {
+   MLX5_SET(query_vport_counter_in, in, other_vport, 1);
+   MLX5_SET(query_vport_counter_in, in, vport_number, vf + 
1);
+   } else {
+   err = -EPERM;
+   goto free;
+   }
+   }
+   if (MLX5_CAP_GEN(dev, num_ports) == 2)
+   MLX5_SET(query_vport_counter_in, in, port_num, port_num);
+
+   err = mlx5_cmd_exec(dev, in, in_sz, out,  out_sz);
+free:
+   kvfree(in);
+   return err;
+}
+EXPORT_SYMBOL_GPL(mlx5_core_query_vport_counter);
 
 int mlx5_query_hca_vport_context(struct mlx5_core_dev *mdev,
 u8 port_num, u8 vport_num, u32 *out,

Modified: stable/11/sys/dev/mlx5/vport.h
==
--- stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:37:21 2018
(r329200)
+++ stable/11/sys/dev/mlx5/vport.h  Tue Feb 13 14:45:05 2018
(r329201)
@@ -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
@@ -101,6 +101,9 @@ int mlx5_set_nic_vport_permanent_mac(struct mlx5_core_
 u8 *addr);
 int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev);
 int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev);
+int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport,
+  int vf, u8 port_num, void *out,
+  size_t out_sz);
 int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
   u64 *system_image_guid);
 int mlx5_query_vport_system_image_guid(struct mlx5_core_dev *dev,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329148 - head/etc/devd

2018-02-13 Thread Warner Losh
On Tue, Feb 13, 2018 at 2:04 AM, Hans Petter Selasky 
wrote:

> On 02/12/18 20:13, Renato Botelho wrote:
>
>> On 12/02/18 02:45, Warner Losh wrote:
>>
>>> Author: imp
>>> Date: Mon Feb 12 04:45:26 2018
>>> New Revision: 329148
>>> URL: https://svnweb.freebsd.org/changeset/base/329148
>>>
>>> Log:
>>>Switch to using devmatch to autoload drivers. Remove usb.conf
>>>as obsolete because devmatch gets its information from the same
>>>place as the genration scripts.
>>>
>>> Added:
>>>head/etc/devd/devmatch.conf   (contents, props changed)
>>> Deleted:
>>>head/etc/devd/usb.conf
>>>
>>> Added: head/etc/devd/devmatch.conf
>>> 
>>> ==
>>> --- /dev/null   00:00:00 1970   (empty, because file is newly added)
>>> +++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018(r329148)
>>> @@ -0,0 +1,13 @@
>>> +#
>>> +# $FreeBSD$
>>> +#
>>> +
>>> +#
>>> +# Example devd configuration file for automatically
>>> +# loading what modules we can based on nomatch
>>> +# events.
>>> +#
>>> +# Generic NOMATCH event
>>> +nomatch 100 {
>>> +   action "service devmatch onestart"
>>>
>>
>> Config syntax is broken. It's missing ; in the end of above line
>>
>>
> I've just fixed this in r329194.
>
> BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH
> event, should limit the searching to the current system. I.E. when you plug
> a USB device, devmatch should not search PCI drivers aswell.
>
> Warner, can you add this support?


Yes, but on boot, it's still going to match everything because all the
NOMATCH events are in the queue.

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


svn commit: r329200 - in stable/11/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 14:37:21 2018
New Revision: 329200
URL: https://svnweb.freebsd.org/changeset/base/329200

Log:
  MFC r325638 and r325976:
  Refactor the flowsteering APIs used by mlx5en(4). This change is needed by
  the coming ibcore and mlx5ib updates in order to support traffic redirection
  to so-called raw ethernet QPs.
  
  Remove unused E-switch related routines and files while at it.
  
  Sponsored by: Mellanox Technologies

Added:
  stable/11/sys/dev/mlx5/fs.h
 - copied unchanged from r325638, head/sys/dev/mlx5/fs.h
  stable/11/sys/dev/mlx5/mlx5_core/fs_core.h
 - copied unchanged from r325638, head/sys/dev/mlx5/mlx5_core/fs_core.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c
 - copied unchanged from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c
 - copied, changed from r325638, head/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c
Deleted:
  stable/11/sys/dev/mlx5/eswitch_vacl.h
  stable/11/sys/dev/mlx5/flow_table.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_flow_table.c
Modified:
  stable/11/sys/conf/files
  stable/11/sys/dev/mlx5/device.h
  stable/11/sys/dev/mlx5/driver.h
  stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c
  stable/11/sys/dev/mlx5/mlx5_en/en.h
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c
  stable/11/sys/dev/mlx5/mlx5_ifc.h
  stable/11/sys/modules/mlx5/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files
==
--- stable/11/sys/conf/filesTue Feb 13 12:54:03 2018(r329199)
+++ stable/11/sys/conf/filesTue Feb 13 14:37:21 2018(r329200)
@@ -4402,7 +4402,9 @@ dev/mlx5/mlx5_core/mlx5_diagnostics.c 
optional mlx5 p
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   \
+dev/mlx5/mlx5_core/mlx5_fs_cmd.c   optional mlx5 pci   \
+   compile-with "${OFED_C}"
+dev/mlx5/mlx5_core/mlx5_fs_tree.c  optional mlx5 pci   \
compile-with "${OFED_C}"
 dev/mlx5/mlx5_core/mlx5_fw.c   optional mlx5 pci   \
compile-with "${OFED_C}"

Modified: stable/11/sys/dev/mlx5/device.h
==
--- stable/11/sys/dev/mlx5/device.h Tue Feb 13 12:54:03 2018
(r329199)
+++ stable/11/sys/dev/mlx5/device.h Tue Feb 13 14:37:21 2018
(r329200)
@@ -1085,6 +1085,7 @@ enum {
MLX5_FLOW_TABLE_TYPE_ESWITCH = 4,
MLX5_FLOW_TABLE_TYPE_SNIFFER_RX  = 5,
MLX5_FLOW_TABLE_TYPE_SNIFFER_TX  = 6,
+   MLX5_FLOW_TABLE_TYPE_NIC_RX_RDMA = 7,
 };
 
 enum {

Modified: stable/11/sys/dev/mlx5/driver.h
==
--- stable/11/sys/dev/mlx5/driver.h Tue Feb 13 12:54:03 2018
(r329199)
+++ stable/11/sys/dev/mlx5/driver.h Tue Feb 13 14:37:21 2018
(r329200)
@@ -582,6 +582,7 @@ struct mlx5_special_contexts {
int resd_lkey;
 };
 
+struct mlx5_flow_root_namespace;
 struct mlx5_core_dev {
struct pci_dev *pdev;
charboard_id[MLX5_BOARD_ID_LEN];
@@ -600,6 +601,12 @@ struct mlx5_core_dev {
u32 issi;
struct mlx5_special_contexts special_contexts;
unsigned int module_status[MLX5_MAX_PORTS];
+   struct mlx5_flow_root_namespace *root_ns;
+   struct mlx5_flow_root_namespace *fdb_root_ns;
+   struct mlx5_flow_root_namespace *esw_egress_root_ns;
+   struct mlx5_flow_root_namespace *esw_ingress_root_ns;
+   struct mlx5_flow_root_namespace *sniffer_rx_root_ns;
+   struct mlx5_flow_root_namespace *sniffer_tx_root_ns;
u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER];
 };
 

Copied: stable/11/sys/dev/mlx5/fs.h (from r325638, head/sys/dev/mlx5/fs.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/sys/dev/mlx5/fs.h Tue Feb 13 14:37:21 2018(r329200, copy 
of r325638, head/sys/dev/mlx5/fs.h)
@@ -0,0 +1,232 @@
+/*-
+ * 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.
+ *

svn commit: r329199 - in stable/11/sys: conf i386/i386

2018-02-13 Thread Konstantin Belousov
Author: kib
Date: Tue Feb 13 12:54:03 2018
New Revision: 329199
URL: https://svnweb.freebsd.org/changeset/base/329199

Log:
  MFC r328913:
  Move signal trampolines out of locore.s into separate source file.

Added:
  stable/11/sys/i386/i386/sigtramp.s
 - copied unchanged from r328913, head/sys/i386/i386/sigtramp.s
Modified:
  stable/11/sys/conf/files.i386
  stable/11/sys/i386/i386/locore.s
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/conf/files.i386
==
--- stable/11/sys/conf/files.i386   Tue Feb 13 11:43:57 2018
(r329198)
+++ stable/11/sys/conf/files.i386   Tue Feb 13 12:54:03 2018
(r329199)
@@ -504,6 +504,7 @@ i386/i386/mpboot.s  optional smp
 i386/i386/perfmon.coptional perfmon
 i386/i386/pmap.c   standard
 i386/i386/ptrace_machdep.c standard
+i386/i386/sigtramp.s   standard
 i386/i386/support.sstandard
 i386/i386/swtch.s  standard
 i386/i386/sys_machdep.cstandard

Modified: stable/11/sys/i386/i386/locore.s
==
--- stable/11/sys/i386/i386/locore.sTue Feb 13 11:43:57 2018
(r329198)
+++ stable/11/sys/i386/i386/locore.sTue Feb 13 12:54:03 2018
(r329199)
@@ -44,7 +44,6 @@
 #include "opt_nfsroot.h"
 #include "opt_pmap.h"
 
-#include 
 #include 
 
 #include 
@@ -327,77 +326,6 @@ begin:
callmi_startup  /* autoconfiguration, mountroot etc */
/* NOTREACHED */
addl$0,%esp /* for db_numargs() again */
-
-/*
- * Signal trampoline, copied to top of user stack
- */
-NON_GPROF_ENTRY(sigcode)
-   calll   *SIGF_HANDLER(%esp)
-   lealSIGF_UC(%esp),%eax  /* get ucontext */
-   pushl   %eax
-   testl   $PSL_VM,UC_EFLAGS(%eax)
-   jne 1f
-   mov UC_GS(%eax),%gs /* restore %gs */
-1:
-   movl$SYS_sigreturn,%eax
-   pushl   %eax/* junk to fake return addr. */
-   int $0x80   /* enter kernel with args */
-   /* on stack */
-1:
-   jmp 1b
-
-#ifdef COMPAT_FREEBSD4
-   ALIGN_TEXT
-freebsd4_sigcode:
-   calll   *SIGF_HANDLER(%esp)
-   lealSIGF_UC4(%esp),%eax /* get ucontext */
-   pushl   %eax
-   testl   $PSL_VM,UC4_EFLAGS(%eax)
-   jne 1f
-   mov UC4_GS(%eax),%gs/* restore %gs */
-1:
-   movl$344,%eax   /* 4.x SYS_sigreturn */
-   pushl   %eax/* junk to fake return addr. */
-   int $0x80   /* enter kernel with args */
-   /* on stack */
-1:
-   jmp 1b
-#endif
-
-#ifdef COMPAT_43
-   ALIGN_TEXT
-osigcode:
-   call*SIGF_HANDLER(%esp) /* call signal handler */
-   lea SIGF_SC(%esp),%eax  /* get sigcontext */
-   pushl   %eax
-   testl   $PSL_VM,SC_PS(%eax)
-   jne 9f
-   mov SC_GS(%eax),%gs /* restore %gs */
-9:
-   movl$103,%eax   /* 3.x SYS_sigreturn */
-   pushl   %eax/* junk to fake return addr. */
-   int $0x80   /* enter kernel with args */
-0: jmp 0b
-#endif /* COMPAT_43 */
-
-   ALIGN_TEXT
-esigcode:
-
-   .data
-   .globl  szsigcode
-szsigcode:
-   .long   esigcode-sigcode
-#ifdef COMPAT_FREEBSD4
-   .globl  szfreebsd4_sigcode
-szfreebsd4_sigcode:
-   .long   esigcode-freebsd4_sigcode
-#endif
-#ifdef COMPAT_43
-   .globl  szosigcode
-szosigcode:
-   .long   esigcode-osigcode
-#endif
-   .text
 
 /**
  *

Copied: stable/11/sys/i386/i386/sigtramp.s (from r328913, 
head/sys/i386/i386/sigtramp.s)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/11/sys/i386/i386/sigtramp.s  Tue Feb 13 12:54:03 2018
(r329199, copy of r328913, head/sys/i386/i386/sigtramp.s)
@@ -0,0 +1,118 @@
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * 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.
+ * 3. Neither the name of 

svn commit: r329198 - head/sys/dev/usb

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 11:43:57 2018
New Revision: 329198
URL: https://svnweb.freebsd.org/changeset/base/329198

Log:
  Fix for incorrect PnP information used by devmatch(8).
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/usbdi.h

Modified: head/sys/dev/usb/usbdi.h
==
--- head/sys/dev/usb/usbdi.hTue Feb 13 10:11:39 2018(r329197)
+++ head/sys/dev/usb/usbdi.hTue Feb 13 11:43:57 2018(r329198)
@@ -336,7 +336,7 @@ struct usb_device_id {
unsigned long driver_info;
 } __aligned(32);
 
-#define USB_STD_PNP_INFO 
"M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \
+#define USB_STD_PNP_INFO 
"M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \
"U8:devclass;U8:devsubclass;U8:devprotocol;" \
"U8:intclass;U8:intsubclass;U8:intprotocol;"
 #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;"
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329197 - head/sbin/ipfw

2018-02-13 Thread Nick Hibma
Author: n_hibma
Date: Tue Feb 13 10:11:39 2018
New Revision: 329197
URL: https://svnweb.freebsd.org/changeset/base/329197

Log:
  DSCP values passed to setdscp need to be lowercase.
  
  See definition of f_ipdscp values. They are compared against using bcmp
  which is case sensitive.
  
  MFC after:1 week

Modified:
  head/sbin/ipfw/ipfw.8

Modified: head/sbin/ipfw/ipfw.8
==
--- head/sbin/ipfw/ipfw.8   Tue Feb 13 08:17:19 2018(r329196)
+++ head/sbin/ipfw/ipfw.8   Tue Feb 13 10:11:39 2018(r329197)
@@ -1070,49 +1070,49 @@ Set specified DiffServ codepoint for an IPv4/IPv6 pack
 Processing continues at the next rule.
 Supported values are:
 .Pp
-.Cm CS0
+.Cm cs0
 .Pq Dv 00 ,
-.Cm CS1
+.Cm cs1
 .Pq Dv 001000 ,
-.Cm CS2
+.Cm cs2
 .Pq Dv 01 ,
-.Cm CS3
+.Cm cs3
 .Pq Dv 011000 ,
-.Cm CS4
+.Cm cs4
 .Pq Dv 10 ,
-.Cm CS5
+.Cm cs5
 .Pq Dv 101000 ,
-.Cm CS6
+.Cm cs6
 .Pq Dv 11 ,
-.Cm CS7
+.Cm cs7
 .Pq Dv 111000 ,
-.Cm AF11
+.Cm af11
 .Pq Dv 001010 ,
-.Cm AF12
+.Cm af12
 .Pq Dv 001100 ,
-.Cm AF13
+.Cm af13
 .Pq Dv 001110 ,
-.Cm AF21
+.Cm af21
 .Pq Dv 010010 ,
-.Cm AF22
+.Cm af22
 .Pq Dv 010100 ,
-.Cm AF23
+.Cm af23
 .Pq Dv 010110 ,
-.Cm AF31
+.Cm af31
 .Pq Dv 011010 ,
-.Cm AF32
+.Cm af32
 .Pq Dv 011100 ,
-.Cm AF33
+.Cm af33
 .Pq Dv 00 ,
-.Cm AF41
+.Cm af41
 .Pq Dv 100010 ,
-.Cm AF42
+.Cm af42
 .Pq Dv 100100 ,
-.Cm AF43
+.Cm af43
 .Pq Dv 100110 ,
-.Cm EF
+.Cm ef
 .Pq Dv 101110 ,
-.Cm BE
+.Cm be
 .Pq Dv 00 .
 Additionally, DSCP value can be specified by number (0..64).
 It is also possible to use the
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r329148 - head/etc/devd

2018-02-13 Thread Hans Petter Selasky

On 02/12/18 20:13, Renato Botelho wrote:

On 12/02/18 02:45, Warner Losh wrote:

Author: imp
Date: Mon Feb 12 04:45:26 2018
New Revision: 329148
URL: https://svnweb.freebsd.org/changeset/base/329148

Log:
   Switch to using devmatch to autoload drivers. Remove usb.conf
   as obsolete because devmatch gets its information from the same
   place as the genration scripts.

Added:
   head/etc/devd/devmatch.conf   (contents, props changed)
Deleted:
   head/etc/devd/usb.conf

Added: head/etc/devd/devmatch.conf
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/etc/devd/devmatch.conf Mon Feb 12 04:45:26 2018(r329148)
@@ -0,0 +1,13 @@
+#
+# $FreeBSD$
+#
+
+#
+# Example devd configuration file for automatically
+# loading what modules we can based on nomatch
+# events.
+#
+# Generic NOMATCH event
+nomatch 100 {
+   action "service devmatch onestart"


Config syntax is broken. It's missing ; in the end of above line



I've just fixed this in r329194.

BTW: I see another annoying issue. Devmatch, when it receives a NOMATCH 
event, should limit the searching to the current system. I.E. when you 
plug a USB device, devmatch should not search PCI drivers aswell.


Warner, can you add this support?

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


svn commit: r329196 - head/usr.sbin/devmatch

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 08:17:19 2018
New Revision: 329196
URL: https://svnweb.freebsd.org/changeset/base/329196

Log:
  Remove leftover empty directory.

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


svn commit: r329195 - in head/sys/dev/usb: . quirk

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 08:13:20 2018
New Revision: 329195
URL: https://svnweb.freebsd.org/changeset/base/329195

Log:
  Add new USB quirk.
  
  PR:   225844
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/usb/quirk/usb_quirk.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/quirk/usb_quirk.c
==
--- head/sys/dev/usb/quirk/usb_quirk.c  Tue Feb 13 08:10:17 2018
(r329194)
+++ head/sys/dev/usb/quirk/usb_quirk.c  Tue Feb 13 08:13:20 2018
(r329195)
@@ -137,6 +137,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK
USB_QUIRK(CORSAIR, K60, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair Vengeance K70 keyboard */
USB_QUIRK(CORSAIR, K70, 0x, 0x, UQ_KBD_BOOTPROTO),
+   /* Quirk for Corsair K70 RGB keyboard */
+   USB_QUIRK(CORSAIR, K70_RGB, 0x, 0x, UQ_KBD_BOOTPROTO),
/* Quirk for Corsair STRAFE Gaming keyboard */
USB_QUIRK(CORSAIR, STRAFE, 0x, 0x, UQ_KBD_BOOTPROTO),
/* umodem(4) device quirks */

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsTue Feb 13 08:10:17 2018(r329194)
+++ head/sys/dev/usb/usbdevsTue Feb 13 08:13:20 2018(r329195)
@@ -1532,6 +1532,7 @@ product COREGA FETHER_USB_TXC 0x9601  FEther USB-TXC
 /* Corsair products */
 product CORSAIR K600x0a60  Corsair Vengeance K60 keyboard
 product CORSAIR K700x1b09  Corsair Vengeance K70 keyboard
+product CORSAIR K70_RGB0x1b13  Corsair K70 RGB Keyboard
 product CORSAIR STRAFE 0x1b15  Cossair STRAFE Gaming keyboard
 
 /* Creative products */
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r329194 - head/etc/devd

2018-02-13 Thread Hans Petter Selasky
Author: hselasky
Date: Tue Feb 13 08:10:17 2018
New Revision: 329194
URL: https://svnweb.freebsd.org/changeset/base/329194

Log:
  Add missing semicolon to not break devd during system startup.

Modified:
  head/etc/devd/devmatch.conf

Modified: head/etc/devd/devmatch.conf
==
--- head/etc/devd/devmatch.conf Tue Feb 13 06:36:27 2018(r329193)
+++ head/etc/devd/devmatch.conf Tue Feb 13 08:10:17 2018(r329194)
@@ -9,12 +9,12 @@
 #
 # Generic NOMATCH event
 nomatch 100 {
-   action "service devmatch start"
+   action "service devmatch start";
 };
 
 # Add the following to devd.conf to prevent this from running:
 #  nomatch 1000 {
-#  action "true"
+#  action "true";
 #  };
 # it replaces the generic event with one of higher priority that
 # does nothing. You can also set 'devmatch_enable=NO' in /etc/rc.conf
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"