Re: svn commit: r306486 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/mlx4 sys/dev/mlx4/mlx4_core sys/dev/mlx4/mlx4_en sys/dev/mlx4/mlx4_ib sys/i386/conf sys/modules sys/modules/mlx4 sys/m

2017-02-10 Thread Hans Petter Selasky

On 02/10/17 08:42, Ngie Cooper (yaneurabeya) wrote:



On Sep 30, 2016, at 01:23, Hans Petter Selasky  wrote:

Author: hselasky
Date: Fri Sep 30 08:23:06 2016
New Revision: 306486
URL: https://svnweb.freebsd.org/changeset/base/306486

Log:
 Move the ConnectX-3 and ConnectX-2 driver from sys/ofed into sys/dev/mlx4
 like other PCI network drivers. The sys/ofed directory is now mainly
 reserved for generic infiniband code, with exception of the mthca driver.

 - Add new manual page, mlx4en(4), describing how to configure and load
 mlx4en.

 - All relevant driver C-files are now prefixed mlx4, mlx4_en and
 mlx4_ib respectivly to avoid object filename collisions when compiling
 the kernel. This also fixes an issue with proper dependency file
 generation for the C-files in question.

 - Device mlxen is now device mlx4en and depends on device mlx4, see
 mlx4en(4). Only the network device name remains unchanged.

 - The mlx4 and mlx4en modules are now built by default on i386 and
 amd64 targets. Only building the mlx4ib module depends on
 WITH_OFED=YES .

 Sponsored by:  Mellanox Technologies


Hi Hans!
I was wondering if there was a reason why this change hasn’t been MFCed 
… I noticed this because the mlx4en(4) manpage is tied to this commit.


No, except for making integration more difficult for people that use 
SVN. Which branches do you wish this MFC'ed to?


--HPS


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

svn commit: r313544 - head/usr.bin/indent/tests

2017-02-10 Thread Piotr Pawel Stefaniak
Author: pstef
Date: Fri Feb 10 09:31:39 2017
New Revision: 313544
URL: https://svnweb.freebsd.org/changeset/base/313544

Log:
  indent(1): add regression test cases
  
  These examples show expected behavior of indent(1). They are meant to be used
  together with a regression test mechanism, either Kyua, a Makefile or perhaps
  something else. The mechanism should in essence do this:
indent -P${test}.pro < ${test}.0 > ${test}.0.run
  and compare ${test}.0.stdout to ${test}.0.run. If the files differ or the exit
  status isn't 0, the test failed.
  
  * ${test}.pro is an indent(1) profile: a list of options passed through a 
file.
The program doesn't complain if the file doesn't exist.
  * ${test}.0 is a C source file which acts as input for indent(1). It doesn't
have to have any particular formatting, since it's the output that matters.
  * ${test}.0.stdout contains expected output. It doesn't have to be formatted 
in
Kernel Normal Form as the point of the tests is to check for regressions in
the program and not to check that it always produces KNF.
  
  Reviewed by:  ngie
  Approved by:  pfg (mentor)
  Differential Revision:https://reviews.freebsd.org/D9007

Added:
  head/usr.bin/indent/tests/
  head/usr.bin/indent/tests/comments.0   (contents, props changed)
  head/usr.bin/indent/tests/comments.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/declarations.0   (contents, props changed)
  head/usr.bin/indent/tests/declarations.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/elsecomment.0   (contents, props changed)
  head/usr.bin/indent/tests/elsecomment.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/elsecomment.pro   (contents, props changed)
  head/usr.bin/indent/tests/float.0   (contents, props changed)
  head/usr.bin/indent/tests/float.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/label.0   (contents, props changed)
  head/usr.bin/indent/tests/label.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/label.pro   (contents, props changed)
  head/usr.bin/indent/tests/list_head.0   (contents, props changed)
  head/usr.bin/indent/tests/list_head.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/nsac.0   (contents, props changed)
  head/usr.bin/indent/tests/nsac.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/nsac.pro   (contents, props changed)
  head/usr.bin/indent/tests/offsetof.0   (contents, props changed)
  head/usr.bin/indent/tests/offsetof.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/sac.0   (contents, props changed)
  head/usr.bin/indent/tests/sac.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/sac.pro   (contents, props changed)
  head/usr.bin/indent/tests/struct.0   (contents, props changed)
  head/usr.bin/indent/tests/struct.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/surplusbad.0   (contents, props changed)
  head/usr.bin/indent/tests/surplusbad.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/surplusbad.pro   (contents, props changed)
  head/usr.bin/indent/tests/types_from_file.0   (contents, props changed)
  head/usr.bin/indent/tests/types_from_file.0.stdout   (contents, props changed)
  head/usr.bin/indent/tests/types_from_file.list   (contents, props changed)
  head/usr.bin/indent/tests/types_from_file.pro   (contents, props changed)
  head/usr.bin/indent/tests/wchar.0   (contents, props changed)
  head/usr.bin/indent/tests/wchar.0.stdout   (contents, props changed)

Added: head/usr.bin/indent/tests/comments.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/indent/tests/comments.0Fri Feb 10 09:31:39 2017
(r313544)
@@ -0,0 +1,25 @@
+/* $FreeBSD$ */
+/* See r303597, r303598, r309219, and r309343 */
+void t(void) {
+   /*
+* Old indent wrapped the URL near where this sentence ends.
+*
+* 
https://www.freebsd.org/cgi/man.cgi?query=indent&apropos=0&sektion=0&manpath=FreeBSD+12-current&arch=default&format=html
+*/
+
+   /*
+* Old indent did not wrap to column 78
+* 
+* aa bb cc dd ee ff g h i  kk
+*/
+   
+   /*
+* Old indent unnecessarily removed the star comment continuation on 
the next line.
+* 
+* *test*
+*/
+   
+   /* r309219 Go through linked list, freeing from the malloced (t[-1]) 
address. */
+   
+   /* r309343  */
+}

Added: head/usr.bin/indent/tests/comments.0.stdout
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/indent/tests/comments.0.stdout Fri Feb 10 09:31:39 2017
(r313544)
@@ -0,0 +1,32 @@
+/* $FreeBSD$ */
+/* See r303597, r303598, r30

svn commit: r313547 - head/sys/dev/vt

2017-02-10 Thread Aleksandr Rybalko
Author: ray
Date: Fri Feb 10 13:28:30 2017
New Revision: 313547
URL: https://svnweb.freebsd.org/changeset/base/313547

Log:
  o Reset mouse selection when new lines reach selection lines.
  o Fix how selection handled on display.
  
  Submitted by: hselasky
  Reviewed by:  hselasky, emaste(previous version)
  Todo: track mouse select direction.

Modified:
  head/sys/dev/vt/vt_buf.c

Modified: head/sys/dev/vt/vt_buf.c
==
--- head/sys/dev/vt/vt_buf.cFri Feb 10 11:17:45 2017(r313546)
+++ head/sys/dev/vt/vt_buf.cFri Feb 10 13:28:30 2017(r313547)
@@ -54,6 +54,11 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", "
(d).tp_row = (s).tp_row;\
 } while (0)
 
+#ifndef SC_NO_CUTPASTE
+static int vtbuf_wth(const struct vt_buf *vb, int row);
+static int vtbuf_in_this_range(int begin, int test, int end, int sz);
+#endif
+static int vtbuf_htw(const struct vt_buf *vb, int row);
 
 /*
  * line4
@@ -122,6 +127,9 @@ vthistory_seek(struct vt_buf *vb, int of
 void
 vthistory_addlines(struct vt_buf *vb, int offset)
 {
+#ifndef SC_NO_CUTPASTE
+   int cur, sz;
+#endif
 
vb->vb_curroffset += offset;
if (vb->vb_curroffset < 0)
@@ -132,6 +140,17 @@ vthistory_addlines(struct vt_buf *vb, in
if ((vb->vb_flags & VBF_SCROLL) == 0) {
vb->vb_roffset = vb->vb_curroffset;
}
+
+#ifndef SC_NO_CUTPASTE
+   sz = vb->vb_history_size;
+   cur = vb->vb_roffset + vb->vb_scr_size.tp_row + sz - 1;
+   if (vtbuf_in_this_range(cur, vb->vb_mark_start.tp_row, cur + offset, 
sz) ||
+   vtbuf_in_this_range(cur, vb->vb_mark_end.tp_row, cur + offset, sz)) 
{
+   /* clear screen selection */
+   vb->vb_mark_start.tp_row = vb->vb_mark_end.tp_row;
+   vb->vb_mark_start.tp_col = vb->vb_mark_end.tp_col;
+   }
+#endif
 }
 
 void
@@ -144,11 +163,33 @@ vthistory_getpos(const struct vt_buf *vb
 #ifndef SC_NO_CUTPASTE /* Only mouse support use it now. */
 /* Translate current view row number to history row. */
 static int
-vtbuf_wth(struct vt_buf *vb, int row)
+vtbuf_wth(const struct vt_buf *vb, int row)
 {
 
return ((vb->vb_roffset + row) % vb->vb_history_size);
 }
+
+/*
+ * Test if an index in a circular buffer is within a range.
+ *
+ * begin - start index
+ * end - end index
+ * test - test index
+ * sz - size of circular buffer when it turns over
+ */
+static int
+vtbuf_in_this_range(int begin, int test, int end, int sz)
+{
+
+   begin %= sz;
+   end %= sz;
+
+   /* check for inversion */
+   if (begin > end)
+   return (test >= begin || test < end);
+   else
+   return (test >= begin && test < end);
+}
 #endif
 
 /* Translate history row to current view row number. */
@@ -169,33 +210,44 @@ vtbuf_htw(const struct vt_buf *vb, int r
 int
 vtbuf_iscursor(const struct vt_buf *vb, int row, int col)
 {
-   int sc, sr, ec, er, tmp;
+#ifndef SC_NO_CUTPASTE
+   int sc, sr, sz, ec, er, tmp;
+#endif
 
if ((vb->vb_flags & (VBF_CURSOR|VBF_SCROLL)) == VBF_CURSOR &&
(vb->vb_cursor.tp_row == row) && (vb->vb_cursor.tp_col == col))
return (1);
 
+#ifndef SC_NO_CUTPASTE
/* Mark cut/paste region. */
+   if (vb->vb_mark_start.tp_col == vb->vb_mark_end.tp_col &&
+   vb->vb_mark_start.tp_row == vb->vb_mark_end.tp_row)
+   return (0);
 
-   /*
-* Luckily screen view is not like circular buffer, so we will
-* calculate in screen coordinates.  Translate first.
-*/
sc = vb->vb_mark_start.tp_col;
-   sr = vtbuf_htw(vb, vb->vb_mark_start.tp_row);
+   sr = vb->vb_mark_start.tp_row;
ec = vb->vb_mark_end.tp_col;
-   er = vtbuf_htw(vb, vb->vb_mark_end.tp_row);
+   er = vb->vb_mark_end.tp_row;
 
+   /*
+* Information about if the selection was made bottom-top or
+* top-bottom is lost due to modulo arithmetics and needs to
+* be recovered:
+*/
+   sz = vb->vb_history_size;
+   tmp = (sz + er - sr) % sz;
+   row = vtbuf_wth(vb, row);
 
-   /* Swap start and end if start > end. */
-   if (POS_INDEX(sc, sr) > POS_INDEX(ec, er)) {
+   /* Swap start and end if start > end */
+   if ((2 * tmp) > sz || (tmp == 0 && sc > ec)) {
tmp = sc; sc = ec; ec = tmp;
tmp = sr; sr = er; er = tmp;
}
 
-   if ((POS_INDEX(sc, sr) <= POS_INDEX(col, row)) &&
-   (POS_INDEX(col, row) < POS_INDEX(ec, er)))
+   if (vtbuf_in_this_range(POS_INDEX(sc, sr), POS_INDEX(col, row),
+   POS_INDEX(ec, er), POS_INDEX(0, sz)))
return (1);
+#endif
 
return (0);
 }
@@ -627,8 +679,8 @@ vtbuf_flush_mark(struct vt_buf *vb)
int s, e;
 
/* Notify renderer to update marked region. */
-   if (vb->vb_mark_start.tp_col || vb->vb_mark_end.tp_col ||
-   vb->vb_mark_s

Re: svn commit: r313547 - head/sys/dev/vt

2017-02-10 Thread Ed Maste
On 10 February 2017 at 08:28, Aleksandr Rybalko  wrote:
> Author: ray
> Date: Fri Feb 10 13:28:30 2017
> New Revision: 313547
> URL: https://svnweb.freebsd.org/changeset/base/313547
>
> Log:
>   o Reset mouse selection when new lines reach selection lines.
>   o Fix how selection handled on display.

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


Re: svn commit: r313547 - head/sys/dev/vt

2017-02-10 Thread Aleksandr Rybalko
Ed,

thanks, I will define PR on planned fix


2017-02-10 16:24 GMT+02:00 Ed Maste :

> On 10 February 2017 at 08:28, Aleksandr Rybalko  wrote:
> > Author: ray
> > Date: Fri Feb 10 13:28:30 2017
> > New Revision: 313547
> > URL: https://svnweb.freebsd.org/changeset/base/313547
> >
> > Log:
> >   o Reset mouse selection when new lines reach selection lines.
> >   o Fix how selection handled on display.
>
> PR: 211922
>



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


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

2017-02-10 Thread Konstantin Belousov
Author: kib
Date: Fri Feb 10 14:49:04 2017
New Revision: 313549
URL: https://svnweb.freebsd.org/changeset/base/313549

Log:
  Fix r313495.
  
  The file type DTYPE_VNODE can be assigned as a fallback if VOP_OPEN()
  did not initialized file type.  This is a typical code path used by
  normal file systems.
  
  Also, change error returned for inappropriate file type used for
  O_EXLOCK to EOPNOTSUPP, as declared in the open(2) man page.
  
  Reported by:  cy, dhw, Iblis Lin 
  Tested by:dhw
  Sponsored by: The FreeBSD Foundation
  MFC after:13 days

Modified:
  head/sys/kern/vfs_vnops.c
  head/sys/sys/file.h

Modified: head/sys/kern/vfs_vnops.c
==
--- head/sys/kern/vfs_vnops.c   Fri Feb 10 14:38:28 2017(r313548)
+++ head/sys/kern/vfs_vnops.c   Fri Feb 10 14:49:04 2017(r313549)
@@ -351,8 +351,8 @@ vn_open_vnode(struct vnode *vp, int fmod
 
while ((fmode & (O_EXLOCK | O_SHLOCK)) != 0) {
KASSERT(fp != NULL, ("open with flock requires fp"));
-   if (fp->f_type != DTYPE_VNODE) {
-   error = EBADF;
+   if (fp->f_type != DTYPE_NONE && fp->f_type != DTYPE_VNODE) {
+   error = EOPNOTSUPP;
break;
}
lock_flags = VOP_ISLOCKED(vp);

Modified: head/sys/sys/file.h
==
--- head/sys/sys/file.h Fri Feb 10 14:38:28 2017(r313548)
+++ head/sys/sys/file.h Fri Feb 10 14:49:04 2017(r313549)
@@ -53,6 +53,7 @@ struct vnode;
 
 #endif /* _KERNEL */
 
+#defineDTYPE_NONE  0   /* not yet initialized */
 #defineDTYPE_VNODE 1   /* file */
 #defineDTYPE_SOCKET2   /* communications endpoint */
 #defineDTYPE_PIPE  3   /* pipe */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313554 - in head/sys/dev: hpt27xx hptnr hptrr

2017-02-10 Thread Pedro F. Giffuni
Author: pfg
Date: Fri Feb 10 15:18:41 2017
New Revision: 313554
URL: https://svnweb.freebsd.org/changeset/base/313554

Log:
  Clean redundant MIN/MAX declarations in some HighPoint drivers.
  
  The hpt27xx(4), hptnr(4), and hptrr(4) drivers declare MIN() and MAX()
  internally which match the macros from sys/param.h.
  
  MIN() is not used, MAX is only used once and can be replaced with the
  max() version in libkern.h which operates on u_ints.
  
  MFC after:2 weeks

Modified:
  head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
  head/sys/dev/hpt27xx/ldm.h
  head/sys/dev/hptnr/hptnr_osm_bsd.c
  head/sys/dev/hptnr/ldm.h
  head/sys/dev/hptrr/hptrr_osm_bsd.c
  head/sys/dev/hptrr/ldm.h

Modified: head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c
==
--- head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c  Fri Feb 10 15:03:54 2017
(r313553)
+++ head/sys/dev/hpt27xx/hpt27xx_osm_bsd.c  Fri Feb 10 15:18:41 2017
(r313554)
@@ -297,7 +297,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus
hpt_lock_vbus(vbus_ext);
 
if (mIsArray(vd->type) && vd->u.array.transform)
-   count = MAX(vd->u.array.transform->source->cmds_per_request,
+   count = max(vd->u.array.transform->source->cmds_per_request,

vd->u.array.transform->target->cmds_per_request);
else
count = vd->cmds_per_request;

Modified: head/sys/dev/hpt27xx/ldm.h
==
--- head/sys/dev/hpt27xx/ldm.h  Fri Feb 10 15:03:54 2017(r313553)
+++ head/sys/dev/hpt27xx/ldm.h  Fri Feb 10 15:18:41 2017(r313554)
@@ -59,10 +59,6 @@ extern "C" {
 #error "Please redefine MAX_PARTITIONS_PER_DISK!!!"
 #endif
 
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-
 typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ];
 
 #define hpt_time_after_eq(a, b) ((int)(a) - (int)(b) >= 0)

Modified: head/sys/dev/hptnr/hptnr_osm_bsd.c
==
--- head/sys/dev/hptnr/hptnr_osm_bsd.c  Fri Feb 10 15:03:54 2017
(r313553)
+++ head/sys/dev/hptnr/hptnr_osm_bsd.c  Fri Feb 10 15:18:41 2017
(r313554)
@@ -294,7 +294,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus
hpt_assert_vbus_locked(vbus_ext);
 
if (mIsArray(vd->type) && vd->u.array.transform)
-   count = MAX(vd->u.array.transform->source->cmds_per_request,
+   count = max(vd->u.array.transform->source->cmds_per_request,

vd->u.array.transform->target->cmds_per_request);
else
count = vd->cmds_per_request;

Modified: head/sys/dev/hptnr/ldm.h
==
--- head/sys/dev/hptnr/ldm.hFri Feb 10 15:03:54 2017(r313553)
+++ head/sys/dev/hptnr/ldm.hFri Feb 10 15:18:41 2017(r313554)
@@ -58,9 +58,6 @@ extern "C" {
 #error "Please redefine MAX_PARTITIONS_PER_DISK!!!"
 #endif
 
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
 
 typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ];
 

Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c
==
--- head/sys/dev/hptrr/hptrr_osm_bsd.c  Fri Feb 10 15:03:54 2017
(r313553)
+++ head/sys/dev/hptrr/hptrr_osm_bsd.c  Fri Feb 10 15:18:41 2017
(r313554)
@@ -300,7 +300,7 @@ static int hpt_flush_vdev(PVBUS_EXT vbus
hpt_assert_vbus_locked(vbus_ext);
 
if (mIsArray(vd->type) && vd->u.array.transform)
-   count = MAX(vd->u.array.transform->source->cmds_per_request,
+   count = max(vd->u.array.transform->source->cmds_per_request,

vd->u.array.transform->target->cmds_per_request);
else
count = vd->cmds_per_request;

Modified: head/sys/dev/hptrr/ldm.h
==
--- head/sys/dev/hptrr/ldm.hFri Feb 10 15:03:54 2017(r313553)
+++ head/sys/dev/hptrr/ldm.hFri Feb 10 15:18:41 2017(r313554)
@@ -58,10 +58,6 @@ extern "C" {
 #error "Please redefine MAX_PARTITIONS_PER_DISK!!!"
 #endif
 
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-
 typedef char check_HPT_TIME_is_unsigned[ (HPT_TIME)(-1) > 0 ? 1 : -1 ];
 
 #define hpt_time_after_eq(a, b) ((long)(a) - (long)(b) >= 0)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313555 - in head/sys/dev/mlx4: . mlx4_core

2017-02-10 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Feb 10 15:22:21 2017
New Revision: 313555
URL: https://svnweb.freebsd.org/changeset/base/313555

Log:
  Flexible and asymmetric allocation of EQs and MSI-X vectors for PF/VFs.
  
  Previously, the mlx4 driver queried the firmware in order to get the
  number of supported EQs. Under SRIOV, since this was done before the
  driver notified the firmware how many VFs it actually needs, the
  firmware had to take into account a worst case scenario and always
  allocated four EQs per VF, where one was used for events while the
  others were used for completions. Now, when the firmware supports the
  asymmetric allocation scheme, denoted by exposing num_sys_eqs > 0 (-->
  MLX4_DEV_CAP_FLAG2_SYS_EQS), we use the QUERY_FUNC command to query
  the firmware before enabling SRIOV. Thus we can get more EQs and MSI-X
  vectors per function. Moreover, when running in the new
  firmware/driver mode, the limitation that the number of EQs should be
  a power of two is lifted.
  
  Obtained from:Linux (dual BSD/GPLv2 licensed)
  Submitted by: Dexuan Cui @ microsoft . com
  Differential Revision:https://reviews.freebsd.org/D8867
  MFC after:2 weeks
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/mlx4_core/fw.h
  head/sys/dev/mlx4/mlx4_core/mlx4_eq.c
  head/sys/dev/mlx4/mlx4_core/mlx4_fw.c
  head/sys/dev/mlx4/mlx4_core/mlx4_main.c
  head/sys/dev/mlx4/mlx4_core/mlx4_profile.c

Modified: head/sys/dev/mlx4/device.h
==
--- head/sys/dev/mlx4/device.h  Fri Feb 10 15:18:41 2017(r313554)
+++ head/sys/dev/mlx4/device.h  Fri Feb 10 15:22:21 2017(r313555)
@@ -199,6 +199,7 @@ enum {
MLX4_DEV_CAP_FLAG2_EQE_STRIDE   = 1LL <<  23,
MLX4_DEV_CAP_FLAG2_UPDATE_QP_SRC_CHECK_LB = 1LL << 24,
MLX4_DEV_CAP_FLAG2_RX_CSUM_MODE = 1LL <<  25,
+   MLX4_DEV_CAP_FLAG2_SYS_EQS  = 1LL <<  26,
 };
 
 /* bit enums for an 8-bit flags field indicating special use
@@ -473,6 +474,7 @@ struct mlx4_caps {
int num_cqs;
int max_cqes;
int reserved_cqs;
+   int num_sys_eqs;
int num_eqs;
int reserved_eqs;
int num_comp_vectors;

Modified: head/sys/dev/mlx4/mlx4_core/fw.h
==
--- head/sys/dev/mlx4/mlx4_core/fw.hFri Feb 10 15:18:41 2017
(r313554)
+++ head/sys/dev/mlx4/mlx4_core/fw.hFri Feb 10 15:22:21 2017
(r313555)
@@ -56,6 +56,7 @@ struct mlx4_dev_cap {
int max_mpts;
int reserved_eqs;
int max_eqs;
+   int num_sys_eqs;
int reserved_mtts;
int max_mrw_sz;
int reserved_mrws;
@@ -146,6 +147,16 @@ struct mlx4_func_cap {
u8  def_counter_index;
 };
 
+struct mlx4_func {
+   int bus;
+   int device;
+   int function;
+   int physical_function;
+   int rsvd_eqs;
+   int max_eq;
+   int rsvd_uars;
+};
+
 struct mlx4_adapter {
u16 vsd_vendor_id;
char board_id[MLX4_BOARD_ID_LEN];
@@ -173,6 +184,7 @@ struct mlx4_init_hca_param {
u8  log_num_srqs;
u8  log_num_cqs;
u8  log_num_eqs;
+   u16 num_sys_eqs;
u8  log_rd_per_qp;
u8  log_mc_table_sz;
u8  log_mpt_sz;
@@ -225,6 +237,7 @@ int mlx4_map_cmd(struct mlx4_dev *dev, u
 int mlx4_SET_ICM_SIZE(struct mlx4_dev *dev, u64 icm_size, u64 *aux_pages);
 int mlx4_NOP(struct mlx4_dev *dev);
 int mlx4_MOD_STAT_CFG(struct mlx4_dev *dev, struct mlx4_mod_stat_cfg *cfg);
+int mlx4_QUERY_FUNC(struct mlx4_dev *dev, struct mlx4_func *func, int slave);
 void mlx4_opreq_action(struct work_struct *work);
 
 #endif /* MLX4_FW_H */

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_eq.c
==
--- head/sys/dev/mlx4/mlx4_core/mlx4_eq.c   Fri Feb 10 15:18:41 2017
(r313554)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_eq.c   Fri Feb 10 15:22:21 2017
(r313555)
@@ -1136,8 +1136,12 @@ int mlx4_init_eq_table(struct mlx4_dev *
goto err_out_free;
}
 
-   err = mlx4_bitmap_init(&priv->eq_table.bitmap, dev->caps.num_eqs,
-  dev->caps.num_eqs - 1, dev->caps.reserved_eqs, 
0);
+   err = mlx4_bitmap_init(&priv->eq_table.bitmap,
+   roundup_pow_of_two(dev->caps.num_eqs),
+   dev->caps.num_eqs - 1,
+   dev->caps.reserved_eqs,
+   roundup_pow_of_two(dev->caps.num_eqs) -
+   dev->caps.num_eqs);
if (err)
goto err_out_free;
 

Modified:

svn commit: r313556 - in head/sys/dev/mlx4: . mlx4_core

2017-02-10 Thread Hans Petter Selasky
Author: hselasky
Date: Fri Feb 10 15:28:18 2017
New Revision: 313556
URL: https://svnweb.freebsd.org/changeset/base/313556

Log:
  Change mlx4 QP allocation scheme.
  
  When using Blue-Flame, BF, the QPN overrides the VLAN, CV, and SV
  fields in the WQE. Thus, BF may only be used for QPNs with bits 6,7
  unset.
  
  The current ethernet driver code reserves a TX QP range with 256b
  alignment.
  
  This is wrong because if there are more than 64 TX QPs in use, QPNs >=
  base + 65 will have bits 6/7 set.
  
  This problem is not specific for the Ethernet driver, any entity that
  tries to reserve more than 64 BF-enabled QPs should fail. Also, using
  ranges is not necessary here and is wasteful.
  
  The new mechanism introduced here will support reservation for "Eth
  QPs eligible for BF" for all drivers: bare-metal, multi-PF, and VFs
  (when hypervisors support WC in VMs). The flow we use is:
  
  1. In mlx4_en, allocate Tx QPs one by one instead of a range allocation,
 and request "BF enabled QPs" if BF is supported for the function
  
  2. In the ALLOC_RES FW command, change param1 to:
  a. param1[23:0]  - number of QPs
  b. param1[31-24] - flags controlling QPs reservation
  
  Bit 31 refers to Eth blueflame supported QPs. Those QPs must have bits
  6 and 7 unset in order to be used in Ethernet.
  
  Bits 24-30 of the flags are currently reserved.
  
  When a function tries to allocate a QP, it states the required
  attributes for this QP. Those attributes are considered "best-effort".
  If an attribute, such as Ethernet BF enabled QP, is a must-have
  attribute, the function has to check that attribute is supported
  before trying to do the allocation.
  
  In a lower layer of the code, mlx4_qp_reserve_range masks out the bits
  which are unsupported. If SRIOV is used, the PF validates those
  attributes and masks out unsupported attributes as well. In order to
  notify VFs which attributes are supported, the VF uses QUERY_FUNC_CAP
  command. This command's mailbox is filled by the PF, which notifies
  which QP allocation attributes it supports.
  
  Obtained from:Linux (dual BSD/GPLv2 licensed)
  Submitted by: Dexuan Cui @ microsoft . com
  Differential Revision:https://reviews.freebsd.org/D8868
  MFC after:2 weeks
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx4/device.h
  head/sys/dev/mlx4/mlx4_core/fw.h
  head/sys/dev/mlx4/mlx4_core/mlx4_fw.c
  head/sys/dev/mlx4/mlx4_core/mlx4_main.c
  head/sys/dev/mlx4/mlx4_core/mlx4_qp.c
  head/sys/dev/mlx4/mlx4_core/mlx4_resource_tracker.c

Modified: head/sys/dev/mlx4/device.h
==
--- head/sys/dev/mlx4/device.h  Fri Feb 10 15:22:21 2017(r313555)
+++ head/sys/dev/mlx4/device.h  Fri Feb 10 15:28:18 2017(r313556)
@@ -219,6 +219,23 @@ enum {
 };
 
 enum {
+   MLX4_QUERY_FUNC_FLAGS_BF_RES_QP = 1LL << 0
+};
+
+/* bit enums for an 8-bit flags field indicating special use
+ * QPs which require special handling in qp_reserve_range.
+ * Currently, this only includes QPs used by the ETH interface,
+ * where we expect to use blueflame.  These QPs must not have
+ * bits 6 and 7 set in their qp number.
+ *
+ * This enum may use only bits 0..7.
+ */
+enum {
+   MLX4_RESERVE_ETH_BF_QP  = 1 << 7,
+};
+
+
+enum {
MLX4_DEV_CAP_64B_EQE_ENABLED= 1LL << 0,
MLX4_DEV_CAP_64B_CQE_ENABLED= 1LL << 1
 };
@@ -533,6 +550,7 @@ struct mlx4_caps {
u32 max_basic_counters;
u32 max_extended_counters;
u8  def_counter_index[MLX4_MAX_PORTS + 1];
+   u8  alloc_res_qp_mask;
 };
 
 struct mlx4_buf_list {

Modified: head/sys/dev/mlx4/mlx4_core/fw.h
==
--- head/sys/dev/mlx4/mlx4_core/fw.hFri Feb 10 15:22:21 2017
(r313555)
+++ head/sys/dev/mlx4/mlx4_core/fw.hFri Feb 10 15:28:18 2017
(r313556)
@@ -145,6 +145,7 @@ struct mlx4_func_cap {
u8  physical_port;
u8  port_flags;
u8  def_counter_index;
+   u8  extra_flags;
 };
 
 struct mlx4_func {

Modified: head/sys/dev/mlx4/mlx4_core/mlx4_fw.c
==
--- head/sys/dev/mlx4/mlx4_core/mlx4_fw.c   Fri Feb 10 15:22:21 2017
(r313555)
+++ head/sys/dev/mlx4/mlx4_core/mlx4_fw.c   Fri Feb 10 15:28:18 2017
(r313556)
@@ -265,10 +265,15 @@ int mlx4_QUERY_FUNC_CAP_wrapper(struct m
 #define QUERY_FUNC_CAP_MTT_QUOTA_OFFSET0x64
 #define QUERY_FUNC_CAP_MCG_QUOTA_OFFSET0x68
 
+#define QUERY_FUNC_CAP_EXTRA_FLAGS_OFFSET  0x6c
+
 #define QUERY_FUNC_CAP_FMR_FLAG0x80
 #define QUERY_FUNC_CAP_FLAG_RDMA   0x40
 #define QUERY_FUNC_CAP_FLAG_ETH0x80
 #

svn commit: r313557 - head/sys/conf

2017-02-10 Thread Bjoern A. Zeeb
Author: bz
Date: Fri Feb 10 16:06:14 2017
New Revision: 313557
URL: https://svnweb.freebsd.org/changeset/base/313557

Log:
  Allow Dtrace to be compiled into the kernel again after r313177.
  
  MFC after:1 week

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Fri Feb 10 15:28:18 2017(r313556)
+++ head/sys/conf/files Fri Feb 10 16:06:14 2017(r313557)
@@ -268,6 +268,7 @@ cddl/contrib/opensolaris/uts/common/zmod
 # dtrace specific
 cddl/contrib/opensolaris/uts/common/dtrace/dtrace.coptional dtrace 
compile-with "${DTRACE_C}" \
warning "kernel 
contains CDDL licensed DTRACE"
+cddl/contrib/opensolaris/uts/common/dtrace/dtrace_xoroshiro128_plus.c  
optional dtrace compile-with "${DTRACE_C}"
 cddl/dev/dtmalloc/dtmalloc.c   optional dtmalloc| dtraceall 
compile-with "${CDDL_C}"
 cddl/dev/profile/profile.c optional dtrace_profile  | dtraceall 
compile-with "${CDDL_C}"
 cddl/dev/sdt/sdt.c optional dtrace_sdt  | dtraceall 
compile-with "${CDDL_C}"
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313559 - head/contrib/compiler-rt/lib/sanitizer_common

2017-02-10 Thread Gleb Smirnoff
Author: glebius
Date: Fri Feb 10 17:34:48 2017
New Revision: 313559
URL: https://svnweb.freebsd.org/changeset/base/313559

Log:
  Don't check struct rtentry on FreeBSD, it is an internal kernel structure.
  On other systems it may be API structure for SIOCADDRT/SIOCDELRT.
  
  Reviewed by:  emaste, dim

Modified:
  
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc

Modified: 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
==
--- 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
Fri Feb 10 16:11:11 2017(r313558)
+++ 
head/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
Fri Feb 10 17:34:48 2017(r313559)
@@ -23,11 +23,6 @@
 #ifdef _FILE_OFFSET_BITS
 #undef _FILE_OFFSET_BITS
 #endif
-#if SANITIZER_FREEBSD
-#define _WANT_RTENTRY
-#include 
-#include 
-#endif
 #include 
 #include 
 #include 
@@ -422,6 +417,7 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
   unsigned struct_input_absinfo_sz = sizeof(struct input_absinfo);
   unsigned struct_input_id_sz = sizeof(struct input_id);
   unsigned struct_mtpos_sz = sizeof(struct mtpos);
+  unsigned struct_rtentry_sz = sizeof(struct rtentry);
   unsigned struct_termio_sz = sizeof(struct termio);
   unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
   unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
@@ -441,7 +437,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(El
   unsigned struct_midi_info_sz = sizeof(struct midi_info);
   unsigned struct_mtget_sz = sizeof(struct mtget);
   unsigned struct_mtop_sz = sizeof(struct mtop);
-  unsigned struct_rtentry_sz = sizeof(struct rtentry);
   unsigned struct_sbi_instrument_sz = sizeof(struct sbi_instrument);
   unsigned struct_seq_event_rec_sz = sizeof(struct seq_event_rec);
   unsigned struct_synth_info_sz = sizeof(struct synth_info);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313560 - head/sys/net

2017-02-10 Thread Gleb Smirnoff
Author: glebius
Date: Fri Feb 10 17:37:04 2017
New Revision: 313560
URL: https://svnweb.freebsd.org/changeset/base/313560

Log:
  Last consumer of _WANT_RTENTRY gone.

Modified:
  head/sys/net/route.h

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hFri Feb 10 17:34:48 2017(r313559)
+++ head/sys/net/route.hFri Feb 10 17:37:04 2017(r313560)
@@ -135,7 +135,7 @@ VNET_DECLARE(u_int, rt_add_addr_allfibs)
 #endif
 #endif
 
-#if defined(_KERNEL) || defined(_WANT_RTENTRY)
+#if defined(_KERNEL)
 struct rtentry {
struct  radix_node rt_nodes[2]; /* tree glue, and other values */
/*
@@ -159,7 +159,7 @@ struct rtentry {
struct mtx  rt_mtx; /* mutex for routing entry */
struct rtentry  *rt_chain;  /* pointer to next rtentry to delete */
 };
-#endif /* _KERNEL || _WANT_RTENTRY */
+#endif /* _KERNEL */
 
 #defineRTF_UP  0x1 /* route usable */
 #defineRTF_GATEWAY 0x2 /* destination is a gateway */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313561 - in head/sys: netinet netipsec

2017-02-10 Thread Gleb Smirnoff
Author: glebius
Date: Fri Feb 10 17:46:26 2017
New Revision: 313561
URL: https://svnweb.freebsd.org/changeset/base/313561

Log:
  Move tcp_fields_to_net() static inline into tcp_var.h, just below its
  friend tcp_fields_to_host(). There is third party code that also uses
  this inline.
  
  Reviewed by:  ae

Modified:
  head/sys/netinet/tcp_var.h
  head/sys/netipsec/xform_tcp.c

Modified: head/sys/netinet/tcp_var.h
==
--- head/sys/netinet/tcp_var.h  Fri Feb 10 17:37:04 2017(r313560)
+++ head/sys/netinet/tcp_var.h  Fri Feb 10 17:46:26 2017(r313561)
@@ -863,6 +863,15 @@ tcp_fields_to_host(struct tcphdr *th)
th->th_urp = ntohs(th->th_urp);
 }
 
+static inline void
+tcp_fields_to_net(struct tcphdr *th)
+{
+
+   th->th_seq = htonl(th->th_seq);
+   th->th_ack = htonl(th->th_ack);
+   th->th_win = htons(th->th_win);
+   th->th_urp = htons(th->th_urp);
+}
 #endif /* _KERNEL */
 
 #endif /* _NETINET_TCP_VAR_H_ */

Modified: head/sys/netipsec/xform_tcp.c
==
--- head/sys/netipsec/xform_tcp.c   Fri Feb 10 17:37:04 2017
(r313560)
+++ head/sys/netipsec/xform_tcp.c   Fri Feb 10 17:46:26 2017
(r313561)
@@ -72,16 +72,6 @@ __FBSDID("$FreeBSD$");
 #defineTCP_KEYLEN_MIN  1   /* minimum length of TCP-MD5 key */
 #defineTCP_KEYLEN_MAX  80  /* maximum length of TCP-MD5 key */
 
-static inline void
-tcp_fields_to_net(struct tcphdr *th)
-{
-
-   th->th_seq = htonl(th->th_seq);
-   th->th_ack = htonl(th->th_ack);
-   th->th_win = htons(th->th_win);
-   th->th_urp = htons(th->th_urp);
-}
-
 static int
 tcp_ipsec_pcbctl(struct inpcb *inp, struct sockopt *sopt)
 {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313174 - in head: lib/libc/sys share/man/man4

2017-02-10 Thread Gleb Smirnoff
On Fri, Feb 03, 2017 at 08:33:23PM +, Jilles Tjoelker wrote:
J> Author: jilles
J> Date: Fri Feb  3 20:33:23 2017
J> New Revision: 313174
J> URL: https://svnweb.freebsd.org/changeset/base/313174
J> 
J> Log:
J>   Clean up documentation of AF_UNIX control messages.
J>   
J>   Document AF_UNIX control messages in unix(4) only, not split between 
unix(4)
J>   and recv(2).

Thanks a lot! This split was always irritating.

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


svn commit: r313562 - head/usr.sbin/kldxref

2017-02-10 Thread Ed Maste
Author: emaste
Date: Fri Feb 10 19:11:33 2017
New Revision: 313562
URL: https://svnweb.freebsd.org/changeset/base/313562

Log:
  kldxref: s/sections/segments/ in warning message
  
  The message refers to program header segments, not sections.
  
  PR:   216975

Modified:
  head/usr.sbin/kldxref/ef.c

Modified: head/usr.sbin/kldxref/ef.c
==
--- head/usr.sbin/kldxref/ef.c  Fri Feb 10 17:46:26 2017(r313561)
+++ head/usr.sbin/kldxref/ef.c  Fri Feb 10 19:11:33 2017(r313562)
@@ -600,7 +600,7 @@ ef_open(const char *filename, struct elf
filename);
break;
} else if (nsegs > MAXSEGS) {
-   warnx("%s: too many sections", filename);
+   warnx("%s: too many segments", filename);
break;
}
ef->ef_nsegs = nsegs;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313563 - head/usr.sbin/kldxref

2017-02-10 Thread Ed Maste
Author: emaste
Date: Fri Feb 10 19:17:10 2017
New Revision: 313563
URL: https://svnweb.freebsd.org/changeset/base/313563

Log:
  kldxref: bump MAXSEGS to 3
  
  ld.bfd generates two PT_LOAD segments, but certain linkers or linker
  configurations generate three PT_LOAD segments (one additional for
  RELRO).
  
  PR:   216975
  Reported by:  Shawn Webb
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/kldxref/ef.c

Modified: head/usr.sbin/kldxref/ef.c
==
--- head/usr.sbin/kldxref/ef.c  Fri Feb 10 19:11:33 2017(r313562)
+++ head/usr.sbin/kldxref/ef.c  Fri Feb 10 19:17:10 2017(r313563)
@@ -47,7 +47,7 @@
 
 #include "ef.h"
 
-#defineMAXSEGS 2
+#defineMAXSEGS 3
 struct ef_file {
char*   ef_name;
struct elf_file *ef_efile;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313564 - head/sys/kern

2017-02-10 Thread John Baldwin
Author: jhb
Date: Fri Feb 10 19:25:52 2017
New Revision: 313564
URL: https://svnweb.freebsd.org/changeset/base/313564

Log:
  Drop the "created from" line from files generated by makesyscalls.sh.
  
  This information is less useful when the generated files are included in
  source control along with the source.  If needed it can be reconstructed
  from the $FreeBSD$ tag in the generated file.  Removing this information
  from the generated output permits committing the generated files along
  with the change to the system call master list without having inconsistent
  metadata in the generated files.
  
  Reviewed by:  emaste, kib
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D9497

Modified:
  head/sys/kern/makesyscalls.sh

Modified: head/sys/kern/makesyscalls.sh
==
--- head/sys/kern/makesyscalls.sh   Fri Feb 10 19:17:10 2017
(r313563)
+++ head/sys/kern/makesyscalls.sh   Fri Feb 10 19:25:52 2017
(r313564)
@@ -119,10 +119,12 @@ sed -e '
printf "/*\n * System call switch table.\n *\n" > syssw
printf " * DO NOT EDIT-- this file is automatically 
generated.\n" > syssw
printf " * $%s$\n", "FreeBSD" > syssw
+   printf " */\n\n" > syssw
 
printf "/*\n * System call prototypes.\n *\n" > sysarg
printf " * DO NOT EDIT-- this file is automatically 
generated.\n" > sysarg
printf " * $%s$\n", "FreeBSD" > sysarg
+   printf " */\n\n" > sysarg
 
printf "\n#ifdef %s\n\n", compat > syscompat
printf "\n#ifdef %s\n\n", compat4 > syscompat4
@@ -133,10 +135,13 @@ sed -e '
printf "/*\n * System call names.\n *\n" > sysnames
printf " * DO NOT EDIT-- this file is automatically 
generated.\n" > sysnames
printf " * $%s$\n", "FreeBSD" > sysnames
+   printf " */\n\n" > sysnames
 
printf "/*\n * System call numbers.\n *\n" > syshdr
printf " * DO NOT EDIT-- this file is automatically 
generated.\n" > syshdr
printf " * $%s$\n", "FreeBSD" > syshdr
+   printf " */\n\n" > syshdr
+
printf "# FreeBSD system call object files.\n" > sysmk
printf "# DO NOT EDIT-- this file is automatically 
generated.\n" > sysmk
printf "# $%s$\n", "FreeBSD" > sysmk
@@ -146,15 +151,9 @@ sed -e '
printf " * $%s$\n", "FreeBSD" > systrace
}
NR == 1 {
-   gsub("[$]FreeBSD: ", "FreeBSD: ", $0)
-   gsub(" [$]", "", $0)
-
-   printf " * created from%s\n */\n\n", $0 > syssw
-
printf "\n/* The casts are bogus but will do for now. */\n" > 
sysent
printf "struct sysent %s[] = {\n",switchname > sysent
 
-   printf " * created from%s\n */\n\n", $0 > sysarg
printf "#ifndef %s\n", sysproto_h > sysarg
printf "#define\t%s\n\n", sysproto_h > sysarg
printf "#include \n" > sysarg
@@ -177,12 +176,9 @@ sed -e '
printf "#define\tPADR_(t)\t0\n" > sysarg
printf "#endif\n\n" > sysarg
 
-   printf " * created from%s\n */\n\n", $0 > sysnames
printf "const char *%s[] = {\n", namesname > sysnames
 
-   printf " * created from%s\n */\n\n", $0 > syshdr
-
-   printf "# created from%s\nMIASM = ", $0 > sysmk
+   printf "MIASM = " > sysmk
 
printf " * This file is part of the DTrace syscall provider.\n 
*/\n\n" > systrace
printf "static void\nsystrace_args(int sysnum, void *params, 
uint64_t *uarg, int *n_args)\n{\n" > systrace
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313565 - head/tests/sys/vm

2017-02-10 Thread Ngie Cooper
Author: ngie
Date: Fri Feb 10 19:31:09 2017
New Revision: 313565
URL: https://svnweb.freebsd.org/changeset/base/313565

Log:
  Expect :mmap__bad_arguments to fail
  
  Some recent changes to vm related to mmap(2) have broken the prot checks that
  would result with an EINVAL with this case
  
  I suspect r313352 is the root-cause the issue
  
  PR:   216976
  Sponsored by: Dell EMC Isilon

Modified:
  head/tests/sys/vm/mmap_test.c

Modified: head/tests/sys/vm/mmap_test.c
==
--- head/tests/sys/vm/mmap_test.c   Fri Feb 10 19:25:52 2017
(r313564)
+++ head/tests/sys/vm/mmap_test.c   Fri Feb 10 19:31:09 2017
(r313565)
@@ -134,6 +134,8 @@ ATF_TC_BODY(mmap__bad_arguments, tc)
checked_mmap(PROT_READ, MAP_SHARED, devstatfd, 0,
"simple /dev/devstat shared");
 
+   atf_tc_expect_fail("extra PROT flags check fails due to recent mmap(2) 
changes; bug # 216976");
+
/* Extra PROT flags. */
checked_mmap(PROT_READ | PROT_WRITE | 0x10, MAP_ANON, -1, EINVAL,
"MAP_ANON with extra PROT flags");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r313352 - in head/sys: compat/cloudabi compat/freebsd32 compat/linux vm

2017-02-10 Thread Ngie Cooper (yaneurabeya)

> On Feb 6, 2017, at 12:57, Edward Tomasz Napierala  wrote:
> 
> Author: trasz
> Date: Mon Feb  6 20:57:12 2017
> New Revision: 313352
> URL: https://svnweb.freebsd.org/changeset/base/313352
> 
> Log:
>  Add kern_vm_mmap2(), kern_vm_mprotect(), kern_vm_msync(), kern_vm_munlock(),
>  kern_vm_munmap(), and kern_vm_madvise(), and use them in various compats
>  instead of their sys_*() counterparts.
> 
>  Reviewed by: ed, dchagin, kib
>  MFC after:   2 weeks
>  Sponsored by:DARPA, AFRL
>  Differential Revision:   https://reviews.freebsd.org/D9378
> 
> Modified:
>  head/sys/compat/cloudabi/cloudabi_mem.c
>  head/sys/compat/freebsd32/freebsd32_misc.c
>  head/sys/compat/linux/linux_misc.c
>  head/sys/compat/linux/linux_mmap.c
>  head/sys/vm/vm_extern.h
>  head/sys/vm/vm_mmap.c

Please see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216976 . I 
believe this causes an issue with validating the prot argument which in turn is 
causing failures on ci.freebsd.org when it runs the kyua tests.
Thank you,
-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r313564 - head/sys/kern

2017-02-10 Thread John Baldwin
On Friday, February 10, 2017 07:25:52 PM John Baldwin wrote:
> Author: jhb
> Date: Fri Feb 10 19:25:52 2017
> New Revision: 313564
> URL: https://svnweb.freebsd.org/changeset/base/313564
> 
> Log:
>   Drop the "created from" line from files generated by makesyscalls.sh.
>   
>   This information is less useful when the generated files are included in
>   source control along with the source.  If needed it can be reconstructed
>   from the $FreeBSD$ tag in the generated file.  Removing this information
>   from the generated output permits committing the generated files along
>   with the change to the system call master list without having inconsistent
>   metadata in the generated files.

There is a tradeoff of course.  Having the generated files mixed in the
commits does make the diff more noisy, and it can be more of a pain in reviews.
One can still just not include the generated files when posting reviews (we
already have to do that because you have to generate the files to do testing).

However, I do think that at least for MFCs we should include the generated
files in the merge so that on stable branches we don't have known-broken
commits once this change is merged back to stable branches.

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


svn commit: r313566 - in head/sys: amd64/linux amd64/linux32 compat/cloudabi32 compat/cloudabi64 compat/freebsd32 compat/svr4 i386/ibcs2 i386/linux kern sys

2017-02-10 Thread John Baldwin
Author: jhb
Date: Fri Feb 10 19:45:02 2017
New Revision: 313566
URL: https://svnweb.freebsd.org/changeset/base/313566

Log:
  Regenerate all the system call tables to drop "created from" lines.
  
  One of the ibcs2 files contains some actual changes (new headers) as
  it hasn't been regenerated after older changes to makesyscalls.sh.

Modified:
  head/sys/amd64/linux/linux_proto.h
  head/sys/amd64/linux/linux_syscall.h
  head/sys/amd64/linux/linux_syscalls.c
  head/sys/amd64/linux/linux_sysent.c
  head/sys/amd64/linux32/linux32_proto.h
  head/sys/amd64/linux32/linux32_syscall.h
  head/sys/amd64/linux32/linux32_syscalls.c
  head/sys/amd64/linux32/linux32_sysent.c
  head/sys/compat/cloudabi32/cloudabi32_proto.h
  head/sys/compat/cloudabi32/cloudabi32_syscall.h
  head/sys/compat/cloudabi32/cloudabi32_syscalls.c
  head/sys/compat/cloudabi32/cloudabi32_sysent.c
  head/sys/compat/cloudabi64/cloudabi64_proto.h
  head/sys/compat/cloudabi64/cloudabi64_syscall.h
  head/sys/compat/cloudabi64/cloudabi64_syscalls.c
  head/sys/compat/cloudabi64/cloudabi64_sysent.c
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/svr4/svr4_proto.h
  head/sys/compat/svr4/svr4_syscall.h
  head/sys/compat/svr4/svr4_syscallnames.c
  head/sys/compat/svr4/svr4_sysent.c
  head/sys/i386/ibcs2/ibcs2_proto.h
  head/sys/i386/ibcs2/ibcs2_syscall.h
  head/sys/i386/ibcs2/ibcs2_sysent.c
  head/sys/i386/linux/linux_proto.h
  head/sys/i386/linux/linux_syscall.h
  head/sys/i386/linux/linux_syscalls.c
  head/sys/i386/linux/linux_sysent.c
  head/sys/kern/init_sysent.c
  head/sys/kern/syscalls.c
  head/sys/sys/syscall.h
  head/sys/sys/syscall.mk
  head/sys/sys/sysproto.h

Modified: head/sys/amd64/linux/linux_proto.h
==
--- head/sys/amd64/linux/linux_proto.h  Fri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux/linux_proto.h  Fri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 #ifndef _LINUX_SYSPROTO_H_

Modified: head/sys/amd64/linux/linux_syscall.h
==
--- head/sys/amd64/linux/linux_syscall.hFri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux/linux_syscall.hFri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 #defineLINUX_SYS_read  0

Modified: head/sys/amd64/linux/linux_syscalls.c
==
--- head/sys/amd64/linux/linux_syscalls.c   Fri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux/linux_syscalls.c   Fri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 const char *linux_syscallnames[] = {

Modified: head/sys/amd64/linux/linux_sysent.c
==
--- head/sys/amd64/linux/linux_sysent.c Fri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux/linux_sysent.c Fri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 #include 

Modified: head/sys/amd64/linux32/linux32_proto.h
==
--- head/sys/amd64/linux32/linux32_proto.h  Fri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux32/linux32_proto.h  Fri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 #ifndef _LINUX32_SYSPROTO_H_

Modified: head/sys/amd64/linux32/linux32_syscall.h
==
--- head/sys/amd64/linux32/linux32_syscall.hFri Feb 10 19:31:09 2017
(r313565)
+++ head/sys/amd64/linux32/linux32_syscall.hFri Feb 10 19:45:02 2017
(r313566)
@@ -3,7 +3,6 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 
2017-02-05 14:17:09Z dchagin
  */
 
 #defineLINUX32_SYS_linux_exit 

Re: svn commit: r313401 - head/sys/netinet

2017-02-10 Thread Gleb Smirnoff
On Tue, Feb 07, 2017 at 06:57:57PM +, Eric van Gyzen wrote:
E> Author: vangyzen
E> Date: Tue Feb  7 18:57:57 2017
E> New Revision: 313401
E> URL: https://svnweb.freebsd.org/changeset/base/313401
E> 
E> Log:
E>   Fix garbage IP addresses in UDP log_in_vain messages
E>   
E>   If multiple threads emit a UDP log_in_vain message concurrently,
E>   the IP addresses could be garbage due to concurrent usage of a
E>   single string buffer inside inet_ntoa().  Use inet_ntoa_r() with
E>   two stack buffers instead.
E>   
E>   Reported by:   Mark Martinec 
E>   MFC after: 3 days
E>   Relnotes:  yes
E>   Sponsored by:  Dell EMC

Thanks. I think inet_ntoa() and anything that uses static buffer
should just be removed from libkern.

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


Re: svn commit: r313564 - head/sys/kern

2017-02-10 Thread Ngie Cooper (yaneurabeya)

> On Feb 10, 2017, at 11:38, John Baldwin  wrote:
> 
> On Friday, February 10, 2017 07:25:52 PM John Baldwin wrote:
>> Author: jhb
>> Date: Fri Feb 10 19:25:52 2017
>> New Revision: 313564
>> URL: https://svnweb.freebsd.org/changeset/base/313564
>> 
>> Log:
>>  Drop the "created from" line from files generated by makesyscalls.sh.
>> 
>>  This information is less useful when the generated files are included in
>>  source control along with the source.  If needed it can be reconstructed
>>  from the $FreeBSD$ tag in the generated file.  Removing this information
>>  from the generated output permits committing the generated files along
>>  with the change to the system call master list without having inconsistent
>>  metadata in the generated files.
> 
> There is a tradeoff of course.  Having the generated files mixed in the
> commits does make the diff more noisy, and it can be more of a pain in 
> reviews.
> One can still just not include the generated files when posting reviews (we
> already have to do that because you have to generate the files to do testing).
> 
> However, I do think that at least for MFCs we should include the generated
> files in the merge so that on stable branches we don't have known-broken
> commits once this change is merged back to stable branches.

Uhh…. $FreeBSD$ isn’t being expanded in some of these files…

$ svn pg svn:keywords sys/sys/syscall.mk
FreeBSD=%H
$ grep '$FreeBSD' sys/sys/syscall.mk
# $FreeBSD$

-Ngie


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r313401 - head/sys/netinet

2017-02-10 Thread Ed Maste
On 10 February 2017 at 15:10, Gleb Smirnoff  wrote:
>
> Thanks. I think inet_ntoa() and anything that uses static buffer
> should just be removed from libkern.

Agreed. A quick grep found inet_ntoa used in:

netpfil/pf/pf_osfp.c
netpfil/ipfw/ip_fw_log.c
kern/kern_jail.c
fs/nfsserver/nfs_nfsdkrpc.c
netinet/ip_icmp.c
netinet/tcp_hostcache.c
netinet/ip_options.c
netinet/in_mcast.c
netinet/igmp.c
netinet/libalias/alias_nbt.c
netinet/libalias/alias_proxy.c
netinet/libalias/alias_sctp.c
netinet/ip_mroute.c
netinet/in.c
netinet/if_ether.c
dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313568 - head/sys/dev/isp

2017-02-10 Thread Kenneth D. Merry
Author: ken
Date: Fri Feb 10 22:02:45 2017
New Revision: 313568
URL: https://svnweb.freebsd.org/changeset/base/313568

Log:
  Change the isp(4) driver to not adjust the tag type for REQUEST SENSE.
  
  The isp(4) driver was changing the tag type for REQUEST SENSE
  commands to Head of Queue, when the CAM CCB flag
  CAM_TAG_ACTION_VALID was NOT set.  CAM_TAG_ACTION_VALID is set
  when the tag action in the XPT_SCSI_IO is not CAM_TAG_ACTION_NONE
  and when the target has tagged queueing turned on.
  
  In most cases when CAM_TAG_ACTION_VALID is not set, it is because
  the target is not doing tagged queueing.  In those cases, trying to
  send a Head of Queue tag may cause problems.  Instead, default to
  sending a simple tag.
  
  IBM tape drives claim to support tagged queueing in their standard
  Inquiry data, but have the DQue bit set in the control mode page
  (mode page 10).  CAM correctly detects that these drives do not
  support tagged queueing, and clears the CAM_TAG_ACTION_VALID flag
  on CCBs sent down to the drives.
  
  This caused the isp(4) driver to go down the path of setting the
  tag action to a default value, and for Request Sense commands only,
  set the tag action to Head of Queue.
  
  If an IBM tape drive does get a Head of Queue tag, it rejects it with
  Invalid Message Error (0x49,0x00).  (The Qlogic firmware translates that
  to a Transport Error, which the driver translates to an Unrecoverable
  HBA Error, or CAM_UNREC_HBA_ERROR.) So, by default, it wasn't possible
  to get a good response from a REQUEST SENSE to an FC-attached IBM
  tape drive with the isp(4) driver.
  
  IBM tape drives (tested on an LTO-5 with G9N1 firmware and a TS1150
  with 4470 firmware) also have a bug in that sending a command with a
  non-simple tag attribute breaks the tape drive's Command Reference
  Number (CRN) accounting and causes it to ignore all subsequent
  commands because it and the initiator disagree about the next
  expected CRN.  The drives do reject the initial command with a head
  of queue tag with an Invalid Message Error (0x49,0x00), but after that
  they ignore any subsequent commands.  IBM confirmed that it is a bug,
  and sent me test firmware that fixes the bug.  However tape drives in
  the field will still exhibit the bug until they are upgraded.
  
  Request Sense is not often sent to targets because most errors are
  reported automatically through autosense in Fibre Channel and other
  modern transports.  ("Modern" meaning post SCSI-2.)  So this is not
  an error that would crop up frequently.  But Request Sense is useful on
  tape devices to report status information, aside from error reporting.
  
  This problem is less serious without FC-Tape features turned on,
  specifically precise delivery of commands (which enables Command
  Reference Numbers), enabled on the target and initiator.  Without
  FC-Tape features turned on, the target would return an error and
  things would continue on.
  
  And it also does not cause problems for targets that do tagged
  queueing, because in those cases the isp(4) driver just uses the
  tag type that is specified in the CCB, assuming the
  CAM_TAG_ACTION_VALID flag is set, and defaults to sending a Simple
  tag action if it isn't an ordered or head of queue tag.
  
  sys/dev/isp/isp.c:
In isp_start(), don't try to send Request Sense commands
with the Head of Queue tag attribute if the CCB doesn't
have a valid tag action.  The tag action likely isn't valid
because the target doesn't support tagged queueing.
  
  Sponsored by: Spectra Logic
  MFC after:3 days

Modified:
  head/sys/dev/isp/isp.c

Modified: head/sys/dev/isp/isp.c
==
--- head/sys/dev/isp/isp.c  Fri Feb 10 19:49:42 2017(r313567)
+++ head/sys/dev/isp/isp.c  Fri Feb 10 22:02:45 2017(r313568)
@@ -4451,11 +4451,7 @@ isp_start(XS_T *xs)
if (XS_TAG_P(xs)) {
ttype = XS_TAG_TYPE(xs);
} else {
-   if (XS_CDBP(xs)[0] == 0x3) {
-   ttype = REQFLAG_HTAG;
-   } else {
-   ttype = REQFLAG_STAG;
-   }
+   ttype = REQFLAG_STAG;
}
if (ttype == REQFLAG_OTAG) {
ttype = FCP_CMND_TASK_ATTR_ORDERED;
@@ -4479,14 +4475,7 @@ isp_start(XS_T *xs)
if (XS_TAG_P(xs)) {
((ispreqt2_t *)reqp)->req_flags = XS_TAG_TYPE(xs);
} else {
-   /*
-* If we don't know what tag to use, use HEAD OF QUEUE
-* for Request Sense or Simple.
-*/
-   if (XS_CDBP(xs)[0] == 0x3)  /* REQUEST SENSE */
-   ((ispreqt2_t *)reqp)->req_flags = REQFLAG_HTAG;
-

Re: svn commit: r313564 - head/sys/kern

2017-02-10 Thread John Baldwin
On Friday, February 10, 2017 12:19:35 PM Ngie Cooper wrote:
> 
> > On Feb 10, 2017, at 11:38, John Baldwin  wrote:
> > 
> > On Friday, February 10, 2017 07:25:52 PM John Baldwin wrote:
> >> Author: jhb
> >> Date: Fri Feb 10 19:25:52 2017
> >> New Revision: 313564
> >> URL: https://svnweb.freebsd.org/changeset/base/313564
> >> 
> >> Log:
> >>  Drop the "created from" line from files generated by makesyscalls.sh.
> >> 
> >>  This information is less useful when the generated files are included in
> >>  source control along with the source.  If needed it can be reconstructed
> >>  from the $FreeBSD$ tag in the generated file.  Removing this information
> >>  from the generated output permits committing the generated files along
> >>  with the change to the system call master list without having inconsistent
> >>  metadata in the generated files.
> > 
> > There is a tradeoff of course.  Having the generated files mixed in the
> > commits does make the diff more noisy, and it can be more of a pain in 
> > reviews.
> > One can still just not include the generated files when posting reviews (we
> > already have to do that because you have to generate the files to do 
> > testing).
> > 
> > However, I do think that at least for MFCs we should include the generated
> > files in the merge so that on stable branches we don't have known-broken
> > commits once this change is merged back to stable branches.
> 
> Uhh…. $FreeBSD$ isn’t being expanded in some of these files…
> 
> $ svn pg svn:keywords sys/sys/syscall.mk
> FreeBSD=%H
> $ grep '$FreeBSD' sys/sys/syscall.mk
> # $FreeBSD$

Which client are you using?

This is what I see on the clean checkout of head I comitted this from:

% grep FreeBSD sys/sys/syscall.mk
# FreeBSD system call object files.
# $FreeBSD: head/sys/sys/syscall.mk 313566 2017-02-10 19:45:02Z jhb $

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

Re: svn commit: r313564 - head/sys/kern

2017-02-10 Thread Ngie Cooper
On Fri, Feb 10, 2017 at 4:34 PM, John Baldwin  wrote:

...

> Which client are you using?

I'll have to doublecheck, but IIRC I'm using the latest copy of
devel/subversion .

> This is what I see on the clean checkout of head I comitted this from:
>
> % grep FreeBSD sys/sys/syscall.mk
> # FreeBSD system call object files.
> # $FreeBSD: head/sys/sys/syscall.mk 313566 2017-02-10 19:45:02Z jhb $

Ok!
Thanks for the reply :).
-Ngie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313572 - head/contrib/libarchive/libarchive

2017-02-10 Thread Martin Matuska
Author: mm
Date: Sat Feb 11 01:00:58 2017
New Revision: 313572
URL: https://svnweb.freebsd.org/changeset/base/313572

Log:
  MFV r313569:313569:313569:
  Sync libarchive with vendor
  
  Vendor bugfixes:
  cpio reader sanity fix (OSS-Fuzz 504)
  WARC reader sanity fixes (OSS-Fuzz 511, 526, 532, 552)
  mtree reader time parsing fix (OSS-Fuzz 538)
  XAR reader memleak fix (OSS-Fuzz 551)
  
  MFC after:1 week

Modified:
  head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
  head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
  head/contrib/libarchive/libarchive/archive_read_support_format_warc.c
  head/contrib/libarchive/libarchive/archive_read_support_format_xar.c
Directory Properties:
  head/contrib/libarchive/   (props changed)

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
==
--- head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c   
Sat Feb 11 00:56:18 2017(r313571)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_cpio.c   
Sat Feb 11 01:00:58 2017(r313572)
@@ -356,7 +356,7 @@ archive_read_format_cpio_read_header(str
 struct archive_entry *entry)
 {
struct cpio *cpio;
-   const void *h;
+   const void *h, *hl;
struct archive_string_conv *sconv;
size_t namelength;
size_t name_pad;
@@ -406,11 +406,11 @@ archive_read_format_cpio_read_header(str
"Rejecting malformed cpio archive: symlink contents 
exceed 1 megabyte");
return (ARCHIVE_FATAL);
}
-   h = __archive_read_ahead(a,
+   hl = __archive_read_ahead(a,
(size_t)cpio->entry_bytes_remaining, NULL);
-   if (h == NULL)
+   if (hl == NULL)
return (ARCHIVE_FATAL);
-   if (archive_entry_copy_symlink_l(entry, (const char *)h,
+   if (archive_entry_copy_symlink_l(entry, (const char *)hl,
(size_t)cpio->entry_bytes_remaining, sconv) != 0) {
if (errno == ENOMEM) {
archive_set_error(&a->archive, ENOMEM,
@@ -434,7 +434,7 @@ archive_read_format_cpio_read_header(str
 * header.  XXX */
 
/* Compare name to "TRAILER!!!" to test for end-of-archive. */
-   if (namelength == 11 && memcmp((const char *)h, "TRAILER!!!",
+   if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!",
11) == 0) {
/* TODO: Store file location of start of block. */
archive_clear_error(&a->archive);

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
==
--- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c  
Sat Feb 11 00:56:18 2017(r313571)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c  
Sat Feb 11 01:00:58 2017(r313572)
@@ -1608,8 +1608,11 @@ parse_keyword(struct archive_read *a, st
if (*val == '.') {
++val;
ns = (long)mtree_atol10(&val);
-   } else
-   ns = 0;
+   if (ns < 0)
+   ns = 0;
+   else if (ns > 9)
+   ns = 9;
+   }
if (m > my_time_t_max)
m = my_time_t_max;
else if (m < my_time_t_min)

Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c
==
--- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c   
Sat Feb 11 00:56:18 2017(r313571)
+++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c   
Sat Feb 11 01:00:58 2017(r313572)
@@ -134,8 +134,8 @@ static ssize_t _warc_rdlen(const char *b
 static time_t _warc_rdrtm(const char *buf, size_t bsz);
 static time_t _warc_rdmtm(const char *buf, size_t bsz);
 static const char *_warc_find_eoh(const char *buf, size_t bsz);
+static const char *_warc_find_eol(const char *buf, size_t bsz);
 
-
 int
 archive_read_support_format_warc(struct archive *_a)
 {
@@ -198,8 +198,8 @@ _warc_bid(struct archive_read *a, int be
 
/* otherwise snarf the record's version number */
ver = _warc_rdver(hdr, nrd);
-   if (ver == 0U || ver > 1U) {
-   /* oh oh oh, best not to wager ... */
+   if (ver < 1200U || ver > 1U) {
+   /* we only support WARC 0.12 to 1.0 */
return -1;
}
 
@@ -254,23 +254,32 @@ start

svn commit: r313573 - in head/sys: arm/arm arm/include contrib/vchiq/interface/compat

2017-02-10 Thread Ian Lepore
Author: ian
Date: Sat Feb 11 01:07:46 2017
New Revision: 313573
URL: https://svnweb.freebsd.org/changeset/base/313573

Log:
  Stop including sys/types.h from arm's machine/atomic.h, fix the places
  where atomic.h was being included without ensuring that types.h (via
  param.h) was included first, as required by atomic(9).

Modified:
  head/sys/arm/arm/identcpu-v4.c
  head/sys/arm/arm/identcpu-v6.c
  head/sys/arm/arm/stack_machdep.c
  head/sys/arm/include/atomic.h
  head/sys/contrib/vchiq/interface/compat/vchi_bsd.h

Modified: head/sys/arm/arm/identcpu-v4.c
==
--- head/sys/arm/arm/identcpu-v4.c  Sat Feb 11 01:00:58 2017
(r313572)
+++ head/sys/arm/arm/identcpu-v4.c  Sat Feb 11 01:07:46 2017
(r313573)
@@ -43,8 +43,8 @@
 
 #include 
 __FBSDID("$FreeBSD$");
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/arm/identcpu-v6.c
==
--- head/sys/arm/arm/identcpu-v6.c  Sat Feb 11 01:00:58 2017
(r313572)
+++ head/sys/arm/arm/identcpu-v6.c  Sat Feb 11 01:07:46 2017
(r313573)
@@ -43,8 +43,8 @@
 
 #include 
 __FBSDID("$FreeBSD$");
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 

Modified: head/sys/arm/arm/stack_machdep.c
==
--- head/sys/arm/arm/stack_machdep.cSat Feb 11 01:00:58 2017
(r313572)
+++ head/sys/arm/arm/stack_machdep.cSat Feb 11 01:07:46 2017
(r313573)
@@ -27,8 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include 
 #include 
+#include 
 #include 
 #include 
 

Modified: head/sys/arm/include/atomic.h
==
--- head/sys/arm/include/atomic.h   Sat Feb 11 01:00:58 2017
(r313572)
+++ head/sys/arm/include/atomic.h   Sat Feb 11 01:07:46 2017
(r313573)
@@ -39,7 +39,6 @@
 #ifndef_MACHINE_ATOMIC_H_
 #define_MACHINE_ATOMIC_H_
 
-#include 
 #include 
 
 #ifndef _KERNEL

Modified: head/sys/contrib/vchiq/interface/compat/vchi_bsd.h
==
--- head/sys/contrib/vchiq/interface/compat/vchi_bsd.h  Sat Feb 11 01:00:58 
2017(r313572)
+++ head/sys/contrib/vchiq/interface/compat/vchi_bsd.h  Sat Feb 11 01:07:46 
2017(r313573)
@@ -28,8 +28,8 @@
 #ifndef __VCHI_BSD_H__
 #define __VCHI_BSD_H__
 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313575 - in head: sys/boot/pc98 usr.sbin/makefs usr.sbin/makefs/ffs

2017-02-10 Thread Ed Maste
Author: emaste
Date: Sat Feb 11 02:33:48 2017
New Revision: 313575
URL: https://svnweb.freebsd.org/changeset/base/313575

Log:
  makefs: make the buffer functions look exactly like the kernel ones
  
  From NetBSD christos Sat Jan 26 00:19:39 2013 +
  
  make the buffer functions look exactly like the kernel ones and add other
  cruft to make the kernel files compile.
  
  ffs.c 1.54
  ffs/buf.c 1.13
  ffs/buf.h 1.3
  ffs/ffs_alloc.c 1.21
  ffs/ffs_balloc.c 1.15
  
  Reviewed by:  marcel, ngie
  Obtained from:NetBSD
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D8404

Added:
  head/sys/boot/pc98/
 - copied from r312897, head/sys/boot/pc98/
Modified:
  head/usr.sbin/makefs/ffs.c
  head/usr.sbin/makefs/ffs/buf.c
  head/usr.sbin/makefs/ffs/buf.h
  head/usr.sbin/makefs/ffs/ffs_alloc.c
  head/usr.sbin/makefs/ffs/ffs_balloc.c

Modified: head/usr.sbin/makefs/ffs.c
==
--- head/usr.sbin/makefs/ffs.c  Sat Feb 11 02:00:56 2017(r313574)
+++ head/usr.sbin/makefs/ffs.c  Sat Feb 11 02:33:48 2017(r313575)
@@ -973,7 +973,7 @@ ffs_write_file(union dinode *din, uint32
errno = bwrite(bp);
if (errno != 0)
goto bad_ffs_write_file;
-   brelse(bp);
+   brelse(bp, 0);
if (!isfile)
p += chunk;
}

Modified: head/usr.sbin/makefs/ffs/buf.c
==
--- head/usr.sbin/makefs/ffs/buf.c  Sat Feb 11 02:00:56 2017
(r313574)
+++ head/usr.sbin/makefs/ffs/buf.c  Sat Feb 11 02:33:48 2017
(r313575)
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.12 2004/06/20 22:20:18 jmc Exp $ */
+/* $NetBSD: buf.c,v 1.13 2004/06/20 22:20:18 jmc Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -60,10 +60,12 @@ extern int sectorsize;  /* XXX: from ffs
 TAILQ_HEAD(buftailhead,buf) buftail;
 
 int
-bread(int fd, struct fs *fs, daddr_t blkno, int size, struct buf **bpp)
+bread(struct vnode *vp, daddr_t blkno, int size, struct ucred *u1 __unused,
+struct buf **bpp)
 {
off_t   offset;
ssize_t rv;
+   struct fs *fs = vp->fs;
 
assert (fs != NULL);
assert (bpp != NULL);
@@ -71,7 +73,7 @@ bread(int fd, struct fs *fs, daddr_t blk
if (debug & DEBUG_BUF_BREAD)
printf("bread: fs %p blkno %lld size %d\n",
fs, (long long)blkno, size);
-   *bpp = getblk(fd, fs, blkno, size);
+   *bpp = getblk(vp, blkno, size, 0, 0, 0);
offset = (*bpp)->b_blkno * sectorsize;  /* XXX */
if (debug & DEBUG_BUF_BREAD)
printf("bread: bp %p blkno %lld offset %lld bcount %ld\n",
@@ -95,7 +97,7 @@ bread(int fd, struct fs *fs, daddr_t blk
 }
 
 void
-brelse(struct buf *bp)
+brelse(struct buf *bp, int u1 __unused)
 {
 
assert (bp != NULL);
@@ -174,12 +176,16 @@ bcleanup(void)
 }
 
 struct buf *
-getblk(int fd, struct fs *fs, daddr_t blkno, int size)
+getblk(struct vnode *vp, daddr_t blkno, int size, int u1 __unused,
+int u2 __unused, int u3 __unused)
 {
static int buftailinitted;
struct buf *bp;
void *n;
+   int fd = vp->fd;
+   struct fs *fs = vp->fs;
 
+   blkno += vp->offset;
assert (fs != NULL);
if (debug & DEBUG_BUF_GETBLK)
printf("getblk: fs %p blkno %lld size %d\n", fs,

Modified: head/usr.sbin/makefs/ffs/buf.h
==
--- head/usr.sbin/makefs/ffs/buf.h  Sat Feb 11 02:00:56 2017
(r313574)
+++ head/usr.sbin/makefs/ffs/buf.h  Sat Feb 11 02:33:48 2017
(r313575)
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.2 2001/11/02 03:12:49 lukem Exp $*/
+/* $NetBSD: buf.h,v 1.3 2001/11/02 03:12:49 lukem Exp $*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -43,6 +43,15 @@
 #include 
 #include 
 
+struct ucred;
+
+struct vnode {
+   int fd;
+   void *fs;
+   void *v_data;
+   int offset;
+};
+
 struct buf {
void *  b_data;
longb_bufsize;
@@ -56,10 +65,11 @@ struct buf {
 };
 
 void   bcleanup(void);
-intbread(int, struct fs *, daddr_t, int, struct buf **);
-void   brelse(struct buf *);
+intbread(struct vnode *, daddr_t, int, struct ucred *,
+struct buf **);
+void   brelse(struct buf *, int);
 intbwrite(struct buf *);
-struct buf *   getblk(int, struct fs *, daddr_t, int);
+struct buf *   getblk(struct vnode *, daddr_t, int, int, int, int);
 
 #definebdwrite(bp) bwrite(bp)
 #defineclrbuf(bp)  memset((bp)->b_data, 0, (u_int)(bp)->b_bcount)

Modified: head/usr.sbin/makefs/ffs/ffs_alloc.c

svn commit: r313576 - head/sys/boot/pc98

2017-02-10 Thread Ed Maste
Author: emaste
Date: Sat Feb 11 02:45:54 2017
New Revision: 313576
URL: https://svnweb.freebsd.org/changeset/base/313576

Log:
  Remove sys/boot/pc98 accidentally restored in r313575
  
  Reported by:  rpokala

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


svn commit: r313577 - in head: share/misc usr.bin/calendar/calendars

2017-02-10 Thread Mahdi Mokhtari
Author: mmokhi (ports committer)
Date: Sat Feb 11 05:19:45 2017
New Revision: 313577
URL: https://svnweb.freebsd.org/changeset/base/313577

Log:
  Adding myself to committers-ports.dot and calendar.freebsd
  
  Submitted by: mmokhi
  Approved by:  feld, mat (mentors)
  Differential Revision:https://reviews.freebsd.org/D9528

Modified:
  head/share/misc/committers-ports.dot
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotSat Feb 11 02:45:54 2017
(r313576)
+++ head/share/misc/committers-ports.dotSat Feb 11 05:19:45 2017
(r313577)
@@ -173,6 +173,7 @@ milki [label="Jonathan Chu\nmilki@FreeBS
 misha [label="Mikhail Pchelin\nmi...@freebsd.org\n2016/11/15"]
 miwi [label="Martin Wilke\nm...@freebsd.org\n2006/06/04"]
 mm [label="Martin Matuska\n...@freebsd.org\n2007/04/04"]
+mmokhi [label="Mahdi Mokhtari\nmmo...@freebsd.org\n2017/02/09"]
 mnag [label="Marcus Alves Grando\nm...@freebsd.org\n2005/09/15"]
 mva [label="Marcus von Appen\n...@freebsd.org\n2009/02/16"]
 nemysis [label="Rusmir Dusko\nnemy...@freebsd.org\n2013/07/31"]
@@ -372,6 +373,7 @@ erwin -> simon
 
 feld -> brnrd
 feld -> junovitch
+feld -> mmokhi
 feld -> rezny
 
 fjoe -> danfe
@@ -481,6 +483,7 @@ makc -> rakuco
 mat -> bmah
 mat -> dvl
 mat -> gordon
+mat -> mmokhi
 mat -> tcberner
 mat -> thierry
 mat -> woodsb02

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdSat Feb 11 02:45:54 
2017(r313576)
+++ head/usr.bin/calendar/calendars/calendar.freebsdSat Feb 11 05:19:45 
2017(r313577)
@@ -28,6 +28,7 @@
 01/19  Ruslan Ermilov  born in Simferopol, USSR, 1974
 01/19  Marcelo S. Araujo  born in Joinville, Santa 
Catarina, Brazil, 1981
 01/20  Poul-Henning Kamp  born in Korsoer, Denmark, 1966
+01/21  Mahdi Mokhtari  born in Tehran, Iran, 1995
 01/22  Johann Visagie  born in Cape Town, South Africa, 1970
 01/23  Hideyuki KURASHINA  born in Niigata, Japan, 1982
 01/24  Fabien Thomas  born in Avignon, France, 1971
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r313578 - head/sys/net80211

2017-02-10 Thread Adrian Chadd
Author: adrian
Date: Sat Feb 11 05:33:49 2017
New Revision: 313578
URL: https://svnweb.freebsd.org/changeset/base/313578

Log:
  [net80211] add a sysctl that forces a vap restart.
  
  Well, vap restart really does "all restart" for now, which will be a good
  way of debugging firmware restart issues.

Modified:
  head/sys/net80211/ieee80211_freebsd.c

Modified: head/sys/net80211/ieee80211_freebsd.c
==
--- head/sys/net80211/ieee80211_freebsd.c   Sat Feb 11 05:19:45 2017
(r313577)
+++ head/sys/net80211/ieee80211_freebsd.c   Sat Feb 11 05:33:49 2017
(r313578)
@@ -180,6 +180,26 @@ ieee80211_sysctl_radar(SYSCTL_HANDLER_AR
return 0;
 }
 
+/*
+ * For now, just restart everything.
+ *
+ * Later on, it'd be nice to have a separate VAP restart to
+ * full-device restart.
+ */
+static int
+ieee80211_sysctl_vap_restart(SYSCTL_HANDLER_ARGS)
+{
+   struct ieee80211vap *vap = arg1;
+   int t = 0, error;
+
+   error = sysctl_handle_int(oidp, &t, 0, req);
+   if (error || !req->newptr)
+   return error;
+
+   ieee80211_restart_all(vap->iv_ic);
+   return 0;
+}
+
 void
 ieee80211_sysctl_attach(struct ieee80211com *ic)
 {
@@ -259,6 +279,12 @@ ieee80211_sysctl_vattach(struct ieee8021
&vap->iv_ampdu_mintraffic[WME_AC_VI], 0,
"VI traffic tx aggr threshold (pps)");
}
+
+   SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
+   "force_restart", CTLTYPE_INT | CTLFLAG_RW, vap, 0,
+   ieee80211_sysctl_vap_restart, "I",
+   "force a VAP restart");
+
if (vap->iv_caps & IEEE80211_C_DFS) {
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO,
"radar", CTLTYPE_INT | CTLFLAG_RW, vap->iv_ic, 0,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"