svn commit: r311003 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 05:23:01 2017
New Revision: 311003
URL: https://svnweb.freebsd.org/changeset/base/311003

Log:
  Fix spelling errors; bump .Dd for the change
  
  MFC after:3 days

Modified:
  head/contrib/bsnmp/lib/bsnmplib.3

Modified: head/contrib/bsnmp/lib/bsnmplib.3
==
--- head/contrib/bsnmp/lib/bsnmplib.3   Sun Jan  1 05:21:08 2017
(r311002)
+++ head/contrib/bsnmp/lib/bsnmplib.3   Sun Jan  1 05:23:01 2017
(r311003)
@@ -37,7 +37,7 @@
 .\"
 .\" $Begemot: bsnmp/lib/bsnmplib.3,v 1.9 2005/10/04 08:46:51 brandt_h Exp $
 .\"
-.Dd December 19, 2010
+.Dd December 31, 2016
 .Dt BSNMPLIB 3
 .Os
 .Sh NAME
@@ -381,7 +381,7 @@ The function
 verifies the authentication parameter contained in the PDU (if present) and
 if the PDU is encrypted, decrypts the PDU contents pointed to by
 .Fa buf .
-If successfull, a plain text scoped PDU is stored in the buffer.
+If successful, a plain text scoped PDU is stored in the buffer.
 .Pp
 The function
 .Fn snmp_pdu_init_secparams
@@ -477,7 +477,7 @@ The requested securityLevel contained in
 The PDU authentication parameter received in the PDU did not match the
 calculated message digest.
 .It Bq Er SNMP_CODE_EDECRYPT
-Error occured while trying to decrypt the PDU.
+Error occurred while trying to decrypt the PDU.
 .El
 .Pp
 .Fn snmp_pdu_encode
___
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: r311002 - in head: lib/libbsnmp/libbsnmp tools/build/mk

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 05:21:08 2017
New Revision: 311002
URL: https://svnweb.freebsd.org/changeset/base/311002

Log:
  Install bsnmpclient(3) as snmp_client_{init,set_host,set_port}(3)
  
  MFC after:3 days
  X-MFC with:   r310999

Modified:
  head/lib/libbsnmp/libbsnmp/Makefile
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/lib/libbsnmp/libbsnmp/Makefile
==
--- head/lib/libbsnmp/libbsnmp/Makefile Sun Jan  1 05:16:24 2017
(r311001)
+++ head/lib/libbsnmp/libbsnmp/Makefile Sun Jan  1 05:21:08 2017
(r311002)
@@ -77,6 +77,9 @@ MLINKS+=  bsnmpagent.3tree_size.3
 
 MLINKS+=   bsnmpclient.3   snmp_add_binding.3
 MLINKS+=   bsnmpclient.3   snmp_client.3
+MLINKS+=   bsnmpclient.3   snmp_client_init.3
+MLINKS+=   bsnmpclient.3   snmp_client_set_host.3
+MLINKS+=   bsnmpclient.3   snmp_client_set_port.3
 MLINKS+=   bsnmpclient.3   snmp_close.3
 MLINKS+=   bsnmpclient.3   snmp_dialog.3
 MLINKS+=   bsnmpclient.3   snmp_discover_engine.3

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Sun Jan  1 05:16:24 
2017(r311001)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Sun Jan  1 05:21:08 
2017(r311002)
@@ -824,6 +824,9 @@ OLD_FILES+=usr/share/man/man3/asn_slice_
 OLD_FILES+=usr/share/man/man3/snmp_add_binding.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_calc_keychange.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_client.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_client_init.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_client_set_host.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_client_set_port.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_close.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_debug.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_dep_commit.3.gz
___
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: r311001 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 05:16:24 2017
New Revision: 311001
URL: https://svnweb.freebsd.org/changeset/base/311001

Log:
  Bump .Dd for the spelling and .Nm updates
  
  MFC after:3 days

Modified:
  head/contrib/bsnmp/lib/bsnmpclient.3

Modified: head/contrib/bsnmp/lib/bsnmpclient.3
==
--- head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 05:14:58 2017
(r311000)
+++ head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 05:16:24 2017
(r311001)
@@ -31,7 +31,7 @@
 .\"
 .\" $Begemot: bsnmp/lib/bsnmpclient.3,v 1.12 2005/10/04 08:46:50 brandt_h Exp $
 .\"
-.Dd September 9, 2010
+.Dd December 31, 2016
 .Dt BSNMPCLIENT 3
 .Os
 .Sh NAME
___
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: r311000 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 05:14:58 2017
New Revision: 311000
URL: https://svnweb.freebsd.org/changeset/base/311000

Log:
  Fix spelling errors
  
  MFC after:3 days
  Reported by:  igor

Modified:
  head/contrib/bsnmp/lib/bsnmpclient.3

Modified: head/contrib/bsnmp/lib/bsnmpclient.3
==
--- head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 05:13:54 2017
(r310999)
+++ head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 05:14:58 2017
(r311000)
@@ -211,13 +211,13 @@ The community name to be used for SET re
 The default is
 .Sq private .
 .It Va identifier
-The message indentifier value to be used with SNMPv3 PDUs. Incremented with
+The message identifier value to be used with SNMPv3 PDUs. Incremented with
 each transmitted PDU.
 .It Va security_model
 The security model to be used with SNMPv3 PDUs. Currently only User-Based
 Security model specified by RFC 3414 (value 3) is supported.
 .It Va engine
-The authorative SNMP engine parameters to be used with SNMPv3 PDUs.
+The authoritive SNMP engine parameters to be used with SNMPv3 PDUs.
 .It Va user
 The USM SNMP user credentials to be used with SNMPv3 PDUs.
 .It Va clen
@@ -416,7 +416,7 @@ response is received.
 When a response is received or the retransmission count
 is exceeded the callback
 .Fa func
-is called with the orignal request PDU, the response PDU and the user argument
+is called with the original request PDU, the response PDU and the user argument
 .Fa uarg .
 If the retransmit count is exceeded,
 .Fa func
@@ -651,7 +651,7 @@ If a response was received 0 is returned
 .Pp
 The function
 .Fn snmp_discover_engine
-is used to discover the authorative snmpEngineId of a remote SNMPv3 agent.
+is used to discover the authoritative snmpEngineId of a remote SNMPv3 agent.
 A request PDU with empty USM user name is sent and the client's engine
 parameters are set according to the snmpEngine parameters received in the
 response PDU.
@@ -659,10 +659,10 @@ If the client is configured to use authe
 snmpEngineBoots and/or snmpEngineTime in the response had zero values, an
 additional request (possibly encrypted) with the appropriate user credentials
 is sent to fetch the missing values.
-Note, that the function blocks until the discovery proccess is completed.
+Note, that the function blocks until the discovery process is completed.
 If no response could be received after all timeouts and retries, or the
 response contained errors the function returns -1.
-If the discovery proccess was completed 0 is returned.
+If the discovery process was completed 0 is returned.
 .Pp
 The function
 .Fn snmp_parse_server
___
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: r310999 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 05:13:54 2017
New Revision: 310999
URL: https://svnweb.freebsd.org/changeset/base/310999

Log:
  bsnmpclient(3) also documents snmp_client_init, snmp_client_set_host,
  and snmp_client_set_port. Add them to the NAME section
  
  MFC after:3 days

Modified:
  head/contrib/bsnmp/lib/bsnmpclient.3

Modified: head/contrib/bsnmp/lib/bsnmpclient.3
==
--- head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 04:48:38 2017
(r310998)
+++ head/contrib/bsnmp/lib/bsnmpclient.3Sun Jan  1 05:13:54 2017
(r310999)
@@ -36,6 +36,9 @@
 .Os
 .Sh NAME
 .Nm snmp_client ,
+.Nm snmp_client_init ,
+.Nm snmp_client_set_host ,
+.Nm snmp_client_set_port ,
 .Nm snmp_send_cb_f ,
 .Nm snmp_timeout_cb_f ,
 .Nm snmp_timeout_start_f ,
___
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: r310998 - stable/10/lib/libarchive/tests

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 04:48:38 2017
New Revision: 310998
URL: https://svnweb.freebsd.org/changeset/base/310998

Log:
  MFstable/11 r310997:
  
  MFC r310996:
  
  Look for list.h in ${.CURDIR} to unbreak the build with a ports-based copy
  of llvm38 on ^/stable/11 (oh, the bugs you find when you set CC,CXX,CPP
  manually and it skips the bootstrap stage for the toolchain...)

Modified:
  stable/10/lib/libarchive/tests/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libarchive/tests/Makefile
==
--- stable/10/lib/libarchive/tests/Makefile Sun Jan  1 04:45:06 2017
(r310997)
+++ stable/10/lib/libarchive/tests/Makefile Sun Jan  1 04:48:38 2017
(r310998)
@@ -11,7 +11,7 @@ BINDIR=   ${TESTSDIR}
 
 PROGS+=libarchive_test
 
-CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR}
+CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR}
 CFLAGS+= -I${LIBARCHIVEDIR}/libarchive -I${LIBARCHIVEDIR}/test_utils
 CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=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: r310997 - stable/11/lib/libarchive/tests

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 04:45:06 2017
New Revision: 310997
URL: https://svnweb.freebsd.org/changeset/base/310997

Log:
  MFC r310996:
  
  Look for list.h in ${.CURDIR} to unbreak the build with a ports-based copy
  of llvm38 on ^/stable/11 (oh, the bugs you find when you set CC,CXX,CPP
  manually and it skips the bootstrap stage for the toolchain...)

Modified:
  stable/11/lib/libarchive/tests/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libarchive/tests/Makefile
==
--- stable/11/lib/libarchive/tests/Makefile Sun Jan  1 04:13:24 2017
(r310996)
+++ stable/11/lib/libarchive/tests/Makefile Sun Jan  1 04:45:06 2017
(r310997)
@@ -10,7 +10,7 @@ BINDIR=   ${TESTSDIR}
 
 PROGS+=libarchive_test
 
-CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR}
+CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR}
 CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/test_utils
 CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=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: r310996 - head/lib/libarchive/tests

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 04:13:24 2017
New Revision: 310996
URL: https://svnweb.freebsd.org/changeset/base/310996

Log:
  Look for list.h in ${.CURDIR} to unbreak the build with a ports-based copy
  of llvm38 on ^/stable/11 (oh, the bugs you find when you set CC,CXX,CPP
  manually and it skips the bootstrap stage for the toolchain...)

Modified:
  head/lib/libarchive/tests/Makefile

Modified: head/lib/libarchive/tests/Makefile
==
--- head/lib/libarchive/tests/Makefile  Sun Jan  1 04:02:06 2017
(r310995)
+++ head/lib/libarchive/tests/Makefile  Sun Jan  1 04:13:24 2017
(r310996)
@@ -12,7 +12,7 @@ BINDIR=   ${TESTSDIR}
 
 PROGS+=libarchive_test
 
-CFLAGS+= -I${.CURDIR:H} -I${.OBJDIR}
+CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR}
 CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/test_utils
 CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=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: r310995 - head/tests/sys/vfs

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 04:02:06 2017
New Revision: 310995
URL: https://svnweb.freebsd.org/changeset/base/310995

Log:
  Bump WARNS to 6 to catch simple QA issues like some of the ones I squashed
  in r310994

Modified:
  head/tests/sys/vfs/Makefile

Modified: head/tests/sys/vfs/Makefile
==
--- head/tests/sys/vfs/Makefile Sun Jan  1 04:01:27 2017(r310994)
+++ head/tests/sys/vfs/Makefile Sun Jan  1 04:02:06 2017(r310995)
@@ -9,4 +9,6 @@ CFLAGS.lookup_cap_dotdot.c+=-I${SRCTOP}
 
 PLAIN_TESTS_SH+=   trailing_slash
 
+WARNS?=6
+
 .include 
___
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: r310994 - head/tests/sys/vfs

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 04:01:27 2017
New Revision: 310994
URL: https://svnweb.freebsd.org/changeset/base/310994

Log:
  Make sys/vfs/lookup_cap_dotdot actually work with "kyua test"
  
  The tests don't work when reading/writing to file descriptors in the
  sandbox after entering capability mode (and wouldn't have, regardless
  of the framework), so adjust the tests so they function within the
  framework.
  
  For tests that enter capability mode over the course of the test, the
  following is now done:
  
1. Fork child process for capability mode test.
2. In child...
   i.   Enter capability mode.
   ii.  Test invariants.
   iii. Exit after calling test function.
3. Collect status for child and determine whether or not it completed
   successfully.
  
  In order to test the invariants in the child process, they now use assert(3)
  instead of ATF_REQUIRE*, as the atf-c-api functions right to results files
  in the directories in order to determine where and how tests fail.
  
  While in the area, fix several -Wshadow and -Wunused warnings found when I
  bumped WARNS up to 6, and fix some minor style(9) issues with indentation
  and type alignment.
  
  PR:   215690

Modified:
  head/tests/sys/vfs/lookup_cap_dotdot.c

Modified: head/tests/sys/vfs/lookup_cap_dotdot.c
==
--- head/tests/sys/vfs/lookup_cap_dotdot.c  Sun Jan  1 00:43:20 2017
(r310993)
+++ head/tests/sys/vfs/lookup_cap_dotdot.c  Sun Jan  1 04:01:27 2017
(r310994)
@@ -31,23 +31,27 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include "freebsd_test_suite/macros.h"
 
-static int dirfd = -1;
-static char *abspath;
+static char*abspath;
+static int dirfd = -1;
+
+typedefvoid (*child_test_fn_t)(void);
 
 static void
-touchat(int dirfd, const char *name)
+touchat(int _dirfd, const char *name)
 {
int fd;
 
-   ATF_REQUIRE((fd = openat(dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
+   ATF_REQUIRE((fd = openat(_dirfd, name, O_CREAT | O_TRUNC | O_WRONLY,
0777)) >= 0);
ATF_REQUIRE(close(fd) == 0);
 }
@@ -78,10 +82,43 @@ prepare_dotdot_tests(void)
 static void
 check_capsicum(void)
 {
+
ATF_REQUIRE_FEATURE("security_capabilities");
ATF_REQUIRE_FEATURE("security_capability_mode");
 }
 
+static void
+run_capsicum_test(child_test_fn_t test_func)
+{
+   int child_exit_code, child_status;
+   pid_t child_pid;
+
+   check_capsicum();
+   prepare_dotdot_tests();
+
+   ATF_REQUIRE_MSG((child_pid = fork()) != -1,
+   "fork failed: %s", strerror(errno));
+
+   if (child_pid == 0) {
+   test_func();
+   _exit(0);
+   }
+
+   ATF_REQUIRE_MSG(waitpid(child_pid, &child_status, 0) != -1,
+   "waitpid failed: %s", strerror(errno));
+   if (WIFEXITED(child_status)) {
+   child_exit_code = WEXITSTATUS(child_status);
+   ATF_REQUIRE_MSG(child_exit_code == 0,
+   "child exited with non-zero exit code: %d",
+   child_exit_code);
+   } else if (WIFSIGNALED(child_status))
+   atf_tc_fail("child exited with signal: %d",
+   WTERMSIG(child_status));
+   else
+   atf_tc_fail("child exited with unexpected status: %d",
+   child_status);
+}
+
 /*
  * Positive tests
  */
@@ -93,6 +130,7 @@ ATF_TC_HEAD(openat__basic_positive, tc)
 
 ATF_TC_BODY(openat__basic_positive, tc)
 {
+
prepare_dotdot_tests();
 
ATF_REQUIRE(openat(dirfd, "d1/d2/d3/f3", O_RDONLY) >= 0);
@@ -114,21 +152,22 @@ ATF_TC_HEAD(lookup_cap_dotdot__basic, tc
"Validate cap-mode (testdir)/d1/.. lookup");
 }
 
-ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
+static void
+lookup_cap_dotdot__basic_child(void)
 {
cap_rights_t rights;
-   int fd;
-
-   check_capsicum();
-   prepare_dotdot_tests();
 
cap_rights_init(&rights, CAP_LOOKUP, CAP_READ);
-   ATF_REQUIRE(cap_rights_limit(dirfd, &rights) >= 0);
 
-   ATF_REQUIRE(cap_enter() >= 0);
+   assert(cap_rights_limit(dirfd, &rights) >= 0);
+   assert(cap_enter() >= 0);
+   assert(openat(dirfd, "d1/..", O_RDONLY) >= 0);
+}
+
+ATF_TC_BODY(lookup_cap_dotdot__basic, tc)
+{
 
-   ATF_REQUIRE_MSG(openat(dirfd, "d1/..", O_RDONLY) >= 0, "%s",
-   strerror(errno));
+   run_capsicum_test(lookup_cap_dotdot__basic_child);
 }
 
 ATF_TC(lookup_cap_dotdot__advanced);
@@ -138,23 +177,26 @@ ATF_TC_HEAD(lookup_cap_dotdot__advanced,
"Validate cap-mode (testdir)/d1/.. lookup");
 }
 
-ATF_TC_BODY(lookup_cap_dotdot__advanced, tc)
+static void
+lookup_cap_dotdot__advanced_child(void)
 {
cap_rights_t rights;
-   int fd;
-
-   check_capsicum();
-   prepare_dotdot_tests();
 
cap_rights_init(&rights, CAP_LOOKUP, C

svn commit: r310993 - stable/10/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 00:43:20 2017
New Revision: 310993
URL: https://svnweb.freebsd.org/changeset/base/310993

Log:
  MFstable/11 r310992:
  
  MFC r310763:
  
  Use uint32_t instead of u_int32_t for or_last_change and services in "struct 
systemg"
  
  This is being done to match "struct systemg" in snmpmod(3)
  
  No functional change

Modified:
  stable/10/contrib/bsnmp/snmpd/snmpmod.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/snmpd/snmpmod.h
==
--- stable/10/contrib/bsnmp/snmpd/snmpmod.h Sun Jan  1 00:41:57 2017
(r310992)
+++ stable/10/contrib/bsnmp/snmpd/snmpmod.h Sun Jan  1 00:43:20 2017
(r310993)
@@ -317,8 +317,8 @@ struct systemg {
u_char  *contact;
u_char  *name;
u_char  *location;
-   u_int32_t   services;
-   u_int32_t   or_last_change;
+   uint32_tservices;
+   uint32_tor_last_change;
 };
 extern struct systemg systemg;
 
___
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: r310992 - stable/11/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 00:41:57 2017
New Revision: 310992
URL: https://svnweb.freebsd.org/changeset/base/310992

Log:
  MFC r310763:
  
  Use uint32_t instead of u_int32_t for or_last_change and services in "struct 
systemg"
  
  This is being done to match "struct systemg" in snmpmod(3)
  
  No functional change

Modified:
  stable/11/contrib/bsnmp/snmpd/snmpmod.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/snmpd/snmpmod.h
==
--- stable/11/contrib/bsnmp/snmpd/snmpmod.h Sun Jan  1 00:40:34 2017
(r310991)
+++ stable/11/contrib/bsnmp/snmpd/snmpmod.h Sun Jan  1 00:41:57 2017
(r310992)
@@ -317,8 +317,8 @@ struct systemg {
u_char  *contact;
u_char  *name;
u_char  *location;
-   u_int32_t   services;
-   u_int32_t   or_last_change;
+   uint32_tservices;
+   uint32_tor_last_change;
 };
 extern struct systemg systemg;
 
___
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: r310991 - stable/10/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 00:40:34 2017
New Revision: 310991
URL: https://svnweb.freebsd.org/changeset/base/310991

Log:
  MFstable/11 r310990:
  
  MFC r310498,r310591:
  
  r310498:
  
  Allow SNMPv3 authNoPriv and noAuthNoPriv protocols to discover snmpEngineTime
  as discussed in RFC-5343
  
  This fixes interoperability with net-snmp.
  
  Tested with the following invocations of snmpwalk (from net-snmp):
  
  - noAuthNoPriv:
  
% snmpwalk -v 3 -n '' -u public localhost snmpEngineTime
  
  - authNoPriv:
  
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authNoPriv -a sha localhost \
  localhost snmpEngineTime
  
  - authPriv:
  
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des \
  -X bsnmptest localhost snmpEngineTime
  
  Obtained from:Isilon OneFS (5ec6d772cacbc, with minor tweaks)
  
  r310591:
  
  Update engine time using update_snmpd_engine_time(..)

Modified:
  stable/10/contrib/bsnmp/snmpd/action.c
  stable/10/contrib/bsnmp/snmpd/main.c
  stable/10/contrib/bsnmp/snmpd/snmpd.h
  stable/10/contrib/bsnmp/snmpd/trap.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/snmpd/action.c
==
--- stable/10/contrib/bsnmp/snmpd/action.c  Sun Jan  1 00:36:52 2017
(r310990)
+++ stable/10/contrib/bsnmp/snmpd/action.c  Sun Jan  1 00:40:34 2017
(r310991)
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -219,6 +220,21 @@ save_boots:
return (0);
 }
 
+void
+update_snmpd_engine_time(void)
+{
+   uint64_t etime;
+
+   etime = (get_ticks() - start_tick) / 100ULL;
+   if (etime < INT32_MAX)
+   snmpd_engine.engine_time = etime;
+   else {
+   start_tick = get_ticks();
+   (void)set_snmpd_engine();
+   snmpd_engine.engine_time = start_tick;
+   }
+}
+
 /*
  *
  * System group
@@ -1118,7 +1134,7 @@ op_snmp_engine(struct snmp_context *ctx 
value->v.integer = snmpd_engine.engine_boots;
break;
case LEAF_snmpEngineTime:
-   snmpd_engine.engine_time = (get_ticks() - start_tick) / 100ULL;
+   update_snmpd_engine_time();
value->v.integer = snmpd_engine.engine_time;
break;
case LEAF_snmpEngineMaxMessageSize:

Modified: stable/10/contrib/bsnmp/snmpd/main.c
==
--- stable/10/contrib/bsnmp/snmpd/main.cSun Jan  1 00:36:52 2017
(r310990)
+++ stable/10/contrib/bsnmp/snmpd/main.cSun Jan  1 00:40:34 2017
(r310991)
@@ -53,7 +53,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #ifdef USE_TCPWRAPPERS
 #include 
@@ -304,7 +303,6 @@ snmp_output(struct snmp_pdu *pdu, u_char
 static enum snmp_code
 snmp_pdu_auth_user(struct snmp_pdu *pdu)
 {
-   uint64_t etime;
usm_user = NULL;
 
/* un-authenticated snmpEngineId discovery */
@@ -312,6 +310,7 @@ snmp_pdu_auth_user(struct snmp_pdu *pdu)
pdu->engine.engine_len = snmpd_engine.engine_len;
memcpy(pdu->engine.engine_id, snmpd_engine.engine_id,
snmpd_engine.engine_len);
+   update_snmpd_engine_time();
pdu->engine.engine_boots = snmpd_engine.engine_boots;
pdu->engine.engine_time = snmpd_engine.engine_time;
pdu->flags |= SNMP_MSG_AUTODISCOVER;
@@ -334,21 +333,14 @@ snmp_pdu_auth_user(struct snmp_pdu *pdu)
 
/* authenticated snmpEngineId discovery */
if ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0) {
-   etime = (get_ticks() - start_tick)  / 100ULL;
-   if (etime < INT32_MAX)
-   snmpd_engine.engine_time = etime;
-   else {
-   start_tick = get_ticks();
-   set_snmpd_engine();
-   snmpd_engine.engine_time = start_tick;
-   }
-
+   update_snmpd_engine_time();
pdu->user.auth_proto = usm_user->suser.auth_proto;
memcpy(pdu->user.auth_key, usm_user->suser.auth_key,
sizeof(pdu->user.auth_key));
 
if (pdu->engine.engine_boots == 0 &&
pdu->engine.engine_time == 0) {
+   update_snmpd_engine_time();
pdu->flags |= SNMP_MSG_AUTODISCOVER;
return (SNMP_CODE_OK);
}
@@ -643,6 +635,7 @@ decoded:
pdu->engine.engine_time == 0) {
asn_append_oid(&(pdu->bindings[pdu->nbindings++].var),
&oid_usmNotInTimeWindows);
+   update_snmpd_engine_time();
pdu->engine.engine_boots = snmpd_engine.engi

svn commit: r310990 - stable/11/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 00:36:52 2017
New Revision: 310990
URL: https://svnweb.freebsd.org/changeset/base/310990

Log:
  MFC r310498,r310591:
  
  r310498:
  
  Allow SNMPv3 authNoPriv and noAuthNoPriv protocols to discover snmpEngineTime
  as discussed in RFC-5343
  
  This fixes interoperability with net-snmp.
  
  Tested with the following invocations of snmpwalk (from net-snmp):
  
  - noAuthNoPriv:
  
% snmpwalk -v 3 -n '' -u public localhost snmpEngineTime
  
  - authNoPriv:
  
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authNoPriv -a sha localhost \
  localhost snmpEngineTime
  
  - authPriv:
  
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des \
  -X bsnmptest localhost snmpEngineTime
  
  Obtained from:Isilon OneFS (5ec6d772cacbc, with minor tweaks)
  
  r310591:
  
  Update engine time using update_snmpd_engine_time(..)

Modified:
  stable/11/contrib/bsnmp/snmpd/action.c
  stable/11/contrib/bsnmp/snmpd/main.c
  stable/11/contrib/bsnmp/snmpd/snmpd.h
  stable/11/contrib/bsnmp/snmpd/trap.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/snmpd/action.c
==
--- stable/11/contrib/bsnmp/snmpd/action.c  Sun Jan  1 00:23:43 2017
(r310989)
+++ stable/11/contrib/bsnmp/snmpd/action.c  Sun Jan  1 00:36:52 2017
(r310990)
@@ -40,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -219,6 +220,21 @@ save_boots:
return (0);
 }
 
+void
+update_snmpd_engine_time(void)
+{
+   uint64_t etime;
+
+   etime = (get_ticks() - start_tick) / 100ULL;
+   if (etime < INT32_MAX)
+   snmpd_engine.engine_time = etime;
+   else {
+   start_tick = get_ticks();
+   (void)set_snmpd_engine();
+   snmpd_engine.engine_time = start_tick;
+   }
+}
+
 /*
  *
  * System group
@@ -1118,7 +1134,7 @@ op_snmp_engine(struct snmp_context *ctx 
value->v.integer = snmpd_engine.engine_boots;
break;
case LEAF_snmpEngineTime:
-   snmpd_engine.engine_time = (get_ticks() - start_tick) / 100ULL;
+   update_snmpd_engine_time();
value->v.integer = snmpd_engine.engine_time;
break;
case LEAF_snmpEngineMaxMessageSize:

Modified: stable/11/contrib/bsnmp/snmpd/main.c
==
--- stable/11/contrib/bsnmp/snmpd/main.cSun Jan  1 00:23:43 2017
(r310989)
+++ stable/11/contrib/bsnmp/snmpd/main.cSun Jan  1 00:36:52 2017
(r310990)
@@ -53,7 +53,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #ifdef USE_TCPWRAPPERS
 #include 
@@ -304,7 +303,6 @@ snmp_output(struct snmp_pdu *pdu, u_char
 static enum snmp_code
 snmp_pdu_auth_user(struct snmp_pdu *pdu)
 {
-   uint64_t etime;
usm_user = NULL;
 
/* un-authenticated snmpEngineId discovery */
@@ -312,6 +310,7 @@ snmp_pdu_auth_user(struct snmp_pdu *pdu)
pdu->engine.engine_len = snmpd_engine.engine_len;
memcpy(pdu->engine.engine_id, snmpd_engine.engine_id,
snmpd_engine.engine_len);
+   update_snmpd_engine_time();
pdu->engine.engine_boots = snmpd_engine.engine_boots;
pdu->engine.engine_time = snmpd_engine.engine_time;
pdu->flags |= SNMP_MSG_AUTODISCOVER;
@@ -334,21 +333,14 @@ snmp_pdu_auth_user(struct snmp_pdu *pdu)
 
/* authenticated snmpEngineId discovery */
if ((pdu->flags & SNMP_MSG_AUTH_FLAG) != 0) {
-   etime = (get_ticks() - start_tick)  / 100ULL;
-   if (etime < INT32_MAX)
-   snmpd_engine.engine_time = etime;
-   else {
-   start_tick = get_ticks();
-   set_snmpd_engine();
-   snmpd_engine.engine_time = start_tick;
-   }
-
+   update_snmpd_engine_time();
pdu->user.auth_proto = usm_user->suser.auth_proto;
memcpy(pdu->user.auth_key, usm_user->suser.auth_key,
sizeof(pdu->user.auth_key));
 
if (pdu->engine.engine_boots == 0 &&
pdu->engine.engine_time == 0) {
+   update_snmpd_engine_time();
pdu->flags |= SNMP_MSG_AUTODISCOVER;
return (SNMP_CODE_OK);
}
@@ -643,6 +635,7 @@ decoded:
pdu->engine.engine_time == 0) {
asn_append_oid(&(pdu->bindings[pdu->nbindings++].var),
&oid_usmNotInTimeWindows);
+   update_snmpd_engine_time();
pdu->engine.engine_boots = snmpd_engine.engine_boots;

svn commit: r310989 - head/usr.sbin/bsnmpd/tools/bsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sun Jan  1 00:23:43 2017
New Revision: 310989
URL: https://svnweb.freebsd.org/changeset/base/310989

Log:
  Call snmp_pdu_free on req/resp with a consistent, correct pattern
  
  - snmp_pdu_free should be called before snmp_pdu_create is called
again
  - snmp_pdu_free should be called on the resp to snmp_dialog when
successful
  
  Tested with the following bsnmp commands:
  
% export SNMPUSER=bsnmp SNMPPASSWD=bsnmptest
% SNMP_ARGS="-A proto=sha -C context='' -K -P proto=des -v 3 -r 0"
% bsnmpset $SNMP_ARGS sysLocation="MyAgent"
% bsnmpget $SNMP_ARGS sysLocation
% bsnmpwalk $SNMP_ARGS
  
  MFC after:12 days
  X-MFC with:   r310729, r310892, r310894

Modified:
  head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c

Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
==
--- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.cSat Dec 31 23:20:57 
2016(r310988)
+++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.cSun Jan  1 00:23:43 
2017(r310989)
@@ -400,13 +400,16 @@ snmptool_get(struct snmp_toolinfo *snmpt
 
if (snmp_parse_resp(&resp, &req) >= 0) {
snmp_output_resp(snmptoolctx, &resp, NULL);
+   snmp_pdu_free(&resp);
break;
}
 
snmp_output_err_resp(snmptoolctx, &resp);
if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK ||
-   !ISSET_RETRY(snmptoolctx))
+   !ISSET_RETRY(snmptoolctx)) {
+   snmp_pdu_free(&resp);
break;
+   }
 
/*
 * Loop through the object list and set object->error to the
@@ -414,8 +417,10 @@ snmptool_get(struct snmp_toolinfo *snmpt
 */
if (snmp_object_seterror(snmptoolctx,
&(resp.bindings[resp.error_index - 1]),
-   resp.error_status) <= 0)
+   resp.error_status) <= 0) {
+   snmp_pdu_free(&resp);
break;
+   }
 
fprintf(stderr, "Retrying...\n");
snmp_pdu_free(&resp);
@@ -423,7 +428,6 @@ snmptool_get(struct snmp_toolinfo *snmpt
}
 
snmp_pdu_free(&req);
-   snmp_pdu_free(&resp);
 
return (0);
 }
@@ -500,8 +504,10 @@ snmptool_walk(struct snmp_toolinfo *snmp
 
outputs += rc;
 
-   if ((u_int)rc < resp.nbindings)
+   if ((u_int)rc < resp.nbindings) {
+   snmp_pdu_free(&resp);
break;
+   }
 
snmpwalk_nextpdu_create(op,
&(resp.bindings[resp.nbindings - 1].var), &req);
@@ -515,10 +521,11 @@ snmptool_walk(struct snmp_toolinfo *snmp
if (outputs == 0) {
snmpwalk_nextpdu_create(SNMP_PDU_GET, &root, &req);
if (snmp_dialog(&req, &resp) == SNMP_CODE_OK) {
-   if (snmp_parse_resp(&resp,&req) < 0)
+   if (snmp_parse_resp(&resp, &req) < 0)
snmp_output_err_resp(snmptoolctx, 
&resp);
else
-   snmp_output_resp(snmptoolctx, &(resp), 
NULL);
+   snmp_output_resp(snmptoolctx, &resp,
+   NULL);
snmp_pdu_free(&resp);
} else
warn("Snmp dialog");
@@ -534,7 +541,6 @@ snmptool_walk(struct snmp_toolinfo *snmp
}
 
snmp_pdu_free(&req);
-   snmp_pdu_free(&resp);
 
if (rc == 0)
return (0);
@@ -1094,25 +1100,29 @@ snmptool_set(struct snmp_toolinfo *snmpt
if (snmp_pdu_check(&req, &resp) > 0) {
if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET)
snmp_output_resp(snmptoolctx, &resp, NULL);
+   snmp_pdu_free(&resp);
break;
}
 
snmp_output_err_resp(snmptoolctx, &resp);
-   if (!ISSET_RETRY(snmptoolctx))
+   if (!ISSET_RETRY(snmptoolctx)) {
+   snmp_pdu_free(&resp);
break;
+   }
 
if (snmp_object_seterror(snmptoolctx,
&(resp.bindings[resp.error_index - 1]),
-   resp.error_status) <= 0)
+   resp.error_status) <= 0) {
+   snmp_pdu_free(&resp);
break;
+   }
 
fprintf(stderr, "Retrying...\n");
snmp_pdu_free(&req);
-   snmp_pdu_free(&resp);

svn commit: r310988 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 23:20:57 2016
New Revision: 310988
URL: https://svnweb.freebsd.org/changeset/base/310988

Log:
  snmp_discover_engine: fix up req/resp (PDU object) handling a bit
  
  - Call snmp_pdu_free on req and resp when done with the objects
  - Call snmp_pdu_free on req before calling snmp_pdu_create on it
again
  
  MFC after:1 week

Modified:
  head/contrib/bsnmp/lib/snmpclient.c

Modified: head/contrib/bsnmp/lib/snmpclient.c
==
--- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 22:46:17 2016
(r310987)
+++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 23:20:57 2016
(r310988)
@@ -1793,12 +1793,14 @@ snmp_discover_engine(char *passwd)
return (0);
}
 
+   snmp_pdu_free(&req);
+
snmp_pdu_create(&req, SNMP_PDU_GET);
req.engine.engine_boots = 0;
req.engine.engine_time = 0;
 
if (snmp_dialog(&req, &resp) == -1)
-return (-1);
+   return (-1);
 
if (resp.version != req.version) {
seterr(&snmp_client, "wrong version");
@@ -1813,6 +1815,9 @@ snmp_discover_engine(char *passwd)
snmp_client.engine.engine_boots = resp.engine.engine_boots;
snmp_client.engine.engine_time = resp.engine.engine_time;
 
+   snmp_pdu_free(&req);
+   snmp_pdu_free(&resp);
+
return (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: r310987 - head/usr.sbin/bsnmpd/tools/libbsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 22:46:17 2016
New Revision: 310987
URL: https://svnweb.freebsd.org/changeset/base/310987

Log:
  snmp_output_err_resp, snmp_output_resp: allocate `object` using calloc, not
  on the stack
  
  Some of the callers try to determine whether or not `object` is valid by
  testing the value for NULL, which will never be true if it's a stack value,
  so in order to be clear and correct down the call stack, use a heap
  allocated object.
  
  This also addresses a Coverity issue by initializing all of `object` via
  calloc
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1006392

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c   Sat Dec 31 
22:18:33 2016(r310986)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c   Sat Dec 31 
22:46:17 2016(r310987)
@@ -2003,20 +2003,25 @@ snmp_output_object(struct snmp_toolinfo 
 void
 snmp_output_err_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu)
 {
+   struct snmp_object *object;
char buf[ASN_OIDSTRLEN];
-   struct snmp_object object;
 
if (pdu == NULL || (pdu->error_index > (int32_t) pdu->nbindings)) {
-   fprintf(stdout,"Invalid error index in PDU\n");
+   fprintf(stdout, "Invalid error index in PDU\n");
+   return;
+   }
+
+   if ((object = calloc(1, sizeof(struct snmp_object))) != NULL) {
+   fprintf(stdout, "calloc: %s", strerror(errno));
return;
}
 
fprintf(stdout, "Agent %s:%s returned error \n", snmp_client.chost,
snmp_client.cport);
 
-   if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, 
&object,
+   if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, 
object,
&(pdu->bindings[pdu->error_index - 1])) > 0))
-   snmp_output_object(snmptoolctx, &object);
+   snmp_output_object(snmptoolctx, object);
else {
asn_oid2str_r(&(pdu->bindings[pdu->error_index - 1].var), buf);
fprintf(stdout,"%s", buf);
@@ -2028,17 +2033,23 @@ snmp_output_err_resp(struct snmp_toolinf
fprintf(stdout, "%s\n", error_strings[pdu->error_status].str);
else
fprintf(stdout,"%s\n", error_strings[SNMP_ERR_UNKNOWN].str);
+
+   free(object);
+   object = NULL;
 }
 
 int32_t
 snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu,
 struct asn_oid *root)
 {
-   struct snmp_object object;
+   struct snmp_object *object;
char p[ASN_OIDSTRLEN];
int32_t error;
uint32_t i;
 
+   if ((object = calloc(1, sizeof(struct snmp_object))) == NULL)
+   return (-1);
+
i = error = 0;
while (i < pdu->nbindings) {
if (root != NULL && !(asn_is_suboid(root,
@@ -2047,18 +2058,22 @@ snmp_output_resp(struct snmp_toolinfo *s
 
if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) {
if (!ISSET_NUMERIC(snmptoolctx) &&
-   (snmp_fill_object(snmptoolctx, &object,
+   (snmp_fill_object(snmptoolctx, object,
&(pdu->bindings[i])) > 0))
-   snmp_output_object(snmptoolctx, &object);
+   snmp_output_object(snmptoolctx, object);
else {
asn_oid2str_r(&(pdu->bindings[i].var), p);
fprintf(stdout, "%s", p);
}
}
-   error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), 
object.info);
+   error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]),
+   object->info);
i++;
}
 
+   free(object);
+   object = NULL;
+
if (error)
return (-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: r310986 - head/usr.sbin/bsnmpd/tools/libbsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 22:18:33 2016
New Revision: 310986
URL: https://svnweb.freebsd.org/changeset/base/310986

Log:
  snmp_output_resp: style(9): sort variables by alignment
  
  MFC after:3 days

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c   Sat Dec 31 
21:31:58 2016(r310985)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c   Sat Dec 31 
22:18:33 2016(r310986)
@@ -2034,10 +2034,10 @@ int32_t
 snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu,
 struct asn_oid *root)
 {
-   int32_t error;
+   struct snmp_object object;
char p[ASN_OIDSTRLEN];
+   int32_t error;
uint32_t i;
-   struct snmp_object object;
 
i = error = 0;
while (i < pdu->nbindings) {
___
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: r310984 - head/lib/libc/net

2016-12-31 Thread Ngie Cooper (yaneurabeya)

> On Dec 31, 2016, at 13:49, Pedro Giffuni  wrote:
> 
> 
> 
> On 12/31/16 16:00, Ngie Cooper wrote:
>> Author: ngie
>> Date: Sat Dec 31 21:00:08 2016
>> New Revision: 310984
>> URL: https://svnweb.freebsd.org/changeset/base/310984
>> 
>> Log:
>>  Use calloc instead of malloc + memset(.., 0, ..)
>> 
>>  MFC after:  1 week
>> 
>> Modified:
>>  head/lib/libc/net/getaddrinfo.c
>> 
>> Modified: head/lib/libc/net/getaddrinfo.c
>> ==
>> --- head/lib/libc/net/getaddrinfo.c  Sat Dec 31 19:59:31 2016
>> (r310983)
>> +++ head/lib/libc/net/getaddrinfo.c  Sat Dec 31 21:00:08 2016
>> (r310984)
>> @@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel)
>>  return(n);
>> 
>>  /* allocate a temporary array for sort and initialization of it. */
>> -if ((aio = malloc(sizeof(*aio) * n)) == NULL)
>> +if ((aio = calloc(1, sizeof(*aio) * n)) == NULL)
>>  return(n);  /* give up reordering */
> 
> This should be calloc(n, sizeof(*aio)))
> 
> FWIW, the other cases are not very useful.
> Generally, replacing any malloc(x) with a calloc(1, x) doesn't bring any 
> advantage as it won't catch any overflow.

Yeah, that would have been better.

The goal was to reduce complexity. I found some memory leaks with valgrind with 
bsnmp* last night involving getaddrinfo that I’m trying to chase down, and I 
noticed these while “in the neighborhood”.

Thanks!
-Ngie



signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r310984 - head/lib/libc/net

2016-12-31 Thread Pedro Giffuni



On 12/31/16 16:00, Ngie Cooper wrote:

Author: ngie
Date: Sat Dec 31 21:00:08 2016
New Revision: 310984
URL: https://svnweb.freebsd.org/changeset/base/310984

Log:
  Use calloc instead of malloc + memset(.., 0, ..)

  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sat Dec 31 19:59:31 2016
(r310983)
+++ head/lib/libc/net/getaddrinfo.c Sat Dec 31 21:00:08 2016
(r310984)
@@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel)
return(n);

/* allocate a temporary array for sort and initialization of it. */
-   if ((aio = malloc(sizeof(*aio) * n)) == NULL)
+   if ((aio = calloc(1, sizeof(*aio) * n)) == NULL)
return(n);  /* give up reordering */


This should be calloc(n, sizeof(*aio)))

FWIW, the other cases are not very useful.
Generally, replacing any malloc(x) with a calloc(1, x) doesn't bring any 
advantage as it won't catch any overflow.


Pedro.
___
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: r310985 - head

2016-12-31 Thread Alan Somers
Author: asomers
Date: Sat Dec 31 21:31:58 2016
New Revision: 310985
URL: https://svnweb.freebsd.org/changeset/base/310985

Log:
  Update ObsoleteFiles.inc for r310803
  
  MFC after:26 days
  X-MFC-with:   310803

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Sat Dec 31 21:00:08 2016(r310984)
+++ head/ObsoleteFiles.inc  Sat Dec 31 21:31:58 2016(r310985)
@@ -40,6 +40,10 @@
 
 # 20161230: libarchive ACL pax test renamed to test_acl_pax_posix1e.tar.uu
 OLD_FILES+=usr/tests/lib/libarchive/test_acl_pax.tar.uu
+# 20161229: Three files from gnop tests consolidated into one
+OLD_FILES+=usr/tests/sys/geom/class/nop/1_test.sh
+OLD_FILES+=usr/tests/sys/geom/class/nop/2_test.sh
+OLD_FILES+=usr/tests/sys/geom/class/nop/conf.sh
 # 20161217: new clang import which bumps version from 3.9.0 to 3.9.1.
 OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/allocator_interface.h
 OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/asan_interface.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: r310984 - head/lib/libc/net

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 21:00:08 2016
New Revision: 310984
URL: https://svnweb.freebsd.org/changeset/base/310984

Log:
  Use calloc instead of malloc + memset(.., 0, ..)
  
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Sat Dec 31 19:59:31 2016
(r310983)
+++ head/lib/libc/net/getaddrinfo.c Sat Dec 31 21:00:08 2016
(r310984)
@@ -691,9 +691,8 @@ reorder(struct addrinfo *sentinel)
return(n);
 
/* allocate a temporary array for sort and initialization of it. */
-   if ((aio = malloc(sizeof(*aio) * n)) == NULL)
+   if ((aio = calloc(1, sizeof(*aio) * n)) == NULL)
return(n);  /* give up reordering */
-   memset(aio, 0, sizeof(*aio) * n);
 
/* retrieve address selection policy from the kernel */
TAILQ_INIT(&policyhead);
@@ -1449,9 +1448,8 @@ copy_ai(const struct addrinfo *pai)
size_t l;
 
l = sizeof(*ai) + pai->ai_addrlen;
-   if ((ai = (struct addrinfo *)malloc(l)) == NULL)
+   if ((ai = calloc(1, l)) == NULL)
return NULL;
-   memset(ai, 0, l);
memcpy(ai, pai, sizeof(*ai));
ai->ai_addr = (struct sockaddr *)(void *)(ai + 1);
memcpy(ai->ai_addr, pai->ai_addr, pai->ai_addrlen);
@@ -1874,8 +1872,7 @@ addrinfo_unmarshal_func(char *buffer, si
size = new_ai.ai_addrlen + sizeof(struct addrinfo) +
_ALIGNBYTES;
 
-   sentinel = (struct addrinfo *)malloc(size);
-   memset(sentinel, 0, size);
+   sentinel = calloc(1, size);
 
memcpy(sentinel, &new_ai, sizeof(struct addrinfo));
sentinel->ai_addr = (struct sockaddr *)_ALIGN((char *)sentinel +
@@ -1888,8 +1885,7 @@ addrinfo_unmarshal_func(char *buffer, si
memcpy(&size, p, sizeof(size_t));
p += sizeof(size_t);
 
-   sentinel->ai_canonname = (char *)malloc(size + 1);
-   memset(sentinel->ai_canonname, 0, size + 1);
+   sentinel->ai_canonname = calloc(1, size + 1);
 
memcpy(sentinel->ai_canonname, p, size);
p += size;
___
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: r310983 - head/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 19:59:31 2016
New Revision: 310983
URL: https://svnweb.freebsd.org/changeset/base/310983

Log:
  vfs: switch nodes_created, recycles_count and free_owe_inact to counter(9)
  
  Reviewed by:  kib

Modified:
  head/sys/kern/vfs_subr.c

Modified: head/sys/kern/vfs_subr.c
==
--- head/sys/kern/vfs_subr.cSat Dec 31 19:30:22 2016(r310982)
+++ head/sys/kern/vfs_subr.cSat Dec 31 19:59:31 2016(r310983)
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -124,9 +125,9 @@ static unsigned longnumvnodes;
 SYSCTL_ULONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0,
 "Number of vnodes in existence");
 
-static u_long vnodes_created;
-SYSCTL_ULONG(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created,
-0, "Number of vnodes created by getnewvnode");
+static counter_u64_t vnodes_created;
+SYSCTL_COUNTER_U64(_vfs, OID_AUTO, vnodes_created, CTLFLAG_RD, &vnodes_created,
+"Number of vnodes created by getnewvnode");
 
 static u_long mnt_free_list_batch = 128;
 SYSCTL_ULONG(_vfs, OID_AUTO, mnt_free_list_batch, CTLFLAG_RW,
@@ -180,8 +181,8 @@ static u_long freevnodes;
 SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD,
 &freevnodes, 0, "Number of \"free\" vnodes");
 
-static u_long recycles_count;
-SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0,
+static counter_u64_t recycles_count;
+SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count,
 "Number of vnodes recycled to meet vnode cache targets");
 
 /*
@@ -193,8 +194,8 @@ static int reassignbufcalls;
 SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW, &reassignbufcalls, 0,
 "Number of calls to reassignbuf");
 
-static u_long free_owe_inact;
-SYSCTL_ULONG(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact, 0,
+static counter_u64_t free_owe_inact;
+SYSCTL_COUNTER_U64(_vfs, OID_AUTO, free_owe_inact, CTLFLAG_RD, &free_owe_inact,
 "Number of times free vnodes kept on active list due to VFS "
 "owing inactivation");
 
@@ -476,6 +477,11 @@ vntblinit(void *dummy __unused)
NULL, NULL, pctrie_zone_init, NULL, UMA_ALIGN_PTR, 
UMA_ZONE_NOFREE | UMA_ZONE_VM);
uma_prealloc(buf_trie_zone, nbuf);
+
+   vnodes_created = counter_u64_alloc(M_WAITOK);
+   recycles_count = counter_u64_alloc(M_WAITOK);
+   free_owe_inact = counter_u64_alloc(M_WAITOK);
+
/*
 * Initialize the filesystem syncer.
 */
@@ -922,7 +928,7 @@ vlrureclaim(struct mount *mp, int reclai
}
KASSERT((vp->v_iflag & VI_DOOMED) == 0,
("VI_DOOMED unexpectedly detected in vlrureclaim()"));
-   atomic_add_long(&recycles_count, 1);
+   counter_u64_add(recycles_count, 1);
vgonel(vp);
VOP_UNLOCK(vp, 0);
vdropl(vp);
@@ -1287,7 +1293,7 @@ vtryrecycle(struct vnode *vp)
return (EBUSY);
}
if ((vp->v_iflag & VI_DOOMED) == 0) {
-   atomic_add_long(&recycles_count, 1);
+   counter_u64_add(recycles_count, 1);
vgonel(vp);
}
VOP_UNLOCK(vp, LK_INTERLOCK);
@@ -1446,7 +1452,7 @@ getnewvnode(const char *tag, struct moun
atomic_add_long(&numvnodes, 1);
mtx_unlock(&vnode_free_list_mtx);
 alloc:
-   atomic_add_long(&vnodes_created, 1);
+   counter_u64_add(vnodes_created, 1);
vp = (struct vnode *) uma_zalloc(vnode_zone, M_WAITOK);
/*
 * Locks are given the generic name "vnode" when created.
@@ -2938,7 +2944,7 @@ _vdrop(struct vnode *vp, bool locked)
mtx_unlock(&mp->mnt_listmtx);
} else {
VI_UNLOCK(vp);
-   atomic_add_long(&free_owe_inact, 1);
+   counter_u64_add(free_owe_inact, 1);
}
return;
}
___
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: r310982 - head/sys/vm

2016-12-31 Thread Konstantin Belousov
Author: kib
Date: Sat Dec 31 19:30:22 2016
New Revision: 310982
URL: https://svnweb.freebsd.org/changeset/base/310982

Log:
  Ansify vm/vm_pager.c.  Style.
  
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/vm/vm_pager.c

Modified: head/sys/vm/vm_pager.c
==
--- head/sys/vm/vm_pager.c  Sat Dec 31 17:05:09 2016(r310981)
+++ head/sys/vm/vm_pager.c  Sat Dec 31 19:30:22 2016(r310982)
@@ -109,43 +109,35 @@ static vm_object_t
 dead_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
 vm_ooffset_t off, struct ucred *cred)
 {
-   return NULL;
+
+   return (NULL);
 }
 
 static void
-dead_pager_putpages(object, m, count, flags, rtvals)
-   vm_object_t object;
-   vm_page_t *m;
-   int count;
-   int flags;
-   int *rtvals;
+dead_pager_putpages(vm_object_t object, vm_page_t *m, int count,
+int flags, int *rtvals)
 {
int i;
 
-   for (i = 0; i < count; i++) {
+   for (i = 0; i < count; i++)
rtvals[i] = VM_PAGER_AGAIN;
-   }
 }
 
 static int
-dead_pager_haspage(object, pindex, prev, next)
-   vm_object_t object;
-   vm_pindex_t pindex;
-   int *prev;
-   int *next;
+dead_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *prev, int 
*next)
 {
-   if (prev)
+
+   if (prev != NULL)
*prev = 0;
-   if (next)
+   if (next != NULL)
*next = 0;
-   return FALSE;
+   return (FALSE);
 }
 
 static void
-dead_pager_dealloc(object)
-   vm_object_t object;
+dead_pager_dealloc(vm_object_t object)
 {
-   return;
+
 }
 
 static struct pagerops deadpagerops = {
@@ -181,7 +173,7 @@ static int bswneeded;
 vm_offset_t swapbkva;  /* swap buffers kva */
 
 void
-vm_pager_init()
+vm_pager_init(void)
 {
struct pagerops **pgops;
 
@@ -191,11 +183,11 @@ vm_pager_init()
 */
for (pgops = pagertab; pgops < &pagertab[nitems(pagertab)]; pgops++)
if ((*pgops)->pgo_init != NULL)
-   (*(*pgops)->pgo_init) ();
+   (*(*pgops)->pgo_init)();
 }
 
 void
-vm_pager_bufferinit()
+vm_pager_bufferinit(void)
 {
struct buf *bp;
int i;
@@ -232,7 +224,7 @@ vm_pager_allocate(objtype_t type, void *
 
ops = pagertab[type];
if (ops)
-   ret = (*ops->pgo_alloc) (handle, size, prot, off, cred);
+   ret = (*ops->pgo_alloc)(handle, size, prot, off, cred);
else
ret = NULL;
return (ret);
@@ -242,8 +234,7 @@ vm_pager_allocate(objtype_t type, void *
  * The object must be locked.
  */
 void
-vm_pager_deallocate(object)
-   vm_object_t object;
+vm_pager_deallocate(vm_object_t object)
 {
 
VM_OBJECT_ASSERT_WLOCKED(object);
@@ -366,12 +357,13 @@ vm_pager_object_lookup(struct pagerlst *
 static void
 initpbuf(struct buf *bp)
 {
+
KASSERT(bp->b_bufobj == NULL, ("initpbuf with bufobj"));
KASSERT(bp->b_vp == NULL, ("initpbuf with vp"));
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_qindex = 0;   /* On no queue (QUEUE_NONE) */
-   bp->b_kvabase = (caddr_t) (MAXPHYS * (bp - swbuf)) + swapbkva;
+   bp->b_kvabase = (caddr_t)(MAXPHYS * (bp - swbuf)) + swapbkva;
bp->b_data = bp->b_kvabase;
bp->b_kvasize = MAXPHYS;
bp->b_flags = 0;
@@ -404,9 +396,8 @@ getpbuf(int *pfreecnt)
struct buf *bp;
 
mtx_lock(&pbuf_mtx);
-
for (;;) {
-   if (pfreecnt) {
+   if (pfreecnt != NULL) {
while (*pfreecnt == 0) {
msleep(pfreecnt, &pbuf_mtx, PVM, "wswbuf0", 0);
}
@@ -424,9 +415,8 @@ getpbuf(int *pfreecnt)
if (pfreecnt)
--*pfreecnt;
mtx_unlock(&pbuf_mtx);
-
initpbuf(bp);
-   return bp;
+   return (bp);
 }
 
 /*
@@ -446,14 +436,10 @@ trypbuf(int *pfreecnt)
return NULL;
}
TAILQ_REMOVE(&bswlist, bp, b_freelist);
-
--*pfreecnt;
-
mtx_unlock(&pbuf_mtx);
-
initpbuf(bp);
-
-   return bp;
+   return (bp);
 }
 
 /*
___
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: r310981 - stable/11/sys/kern

2016-12-31 Thread John Baldwin
Author: jhb
Date: Sat Dec 31 17:05:09 2016
New Revision: 310981
URL: https://svnweb.freebsd.org/changeset/base/310981

Log:
  MFC 310336:
  Don't spin in pause() during early boot for kthreads other than thread0.
  
  pause() uses a spin loop to simulate a sleep during early boot.  However,
  we only need this for thread0 to get far enough in the boot process to
  enable timers (at which point pause() can sleep).  For other kthreads,
  sleeping in pause() is ok as the callout will be scheduled and will
  eventually fire once thread0 initializes timers.

Modified:
  stable/11/sys/kern/kern_synch.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_synch.c
==
--- stable/11/sys/kern/kern_synch.c Sat Dec 31 16:57:05 2016
(r310980)
+++ stable/11/sys/kern/kern_synch.c Sat Dec 31 17:05:09 2016
(r310981)
@@ -321,7 +321,8 @@ pause_sbt(const char *wmesg, sbintime_t 
if (sbt == 0)
sbt = tick_sbt;
 
-   if (cold || kdb_active || SCHEDULER_STOPPED()) {
+   if ((cold && curthread == &thread0) || kdb_active ||
+   SCHEDULER_STOPPED()) {
/*
 * We delay one second at a time to avoid overflowing the
 * system specific DELAY() function(s):
___
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: r310980 - in stable/10/sys: kern sys

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 16:57:05 2016
New Revision: 310980
URL: https://svnweb.freebsd.org/changeset/base/310980

Log:
  MFC r285706,r303562,r303563,r303584,r303643,r303652,r303655,r303707:
  
  (by markj)
  Don't increment the spin count until after the first attempt to acquire a
  rwlock read lock. Otherwise the lockstat:::rw-spin probe will fire
  spuriously.
  
  ==
  
  rwlock: s/READER/WRITER/ in wlock lockstat annotation
  
  ==
  
  sx: increment spin_cnt before cpu_spinwait in xlock
  
  The change is a no-op only done for consistency with the rest of the file.
  
  ==
  
  locks: change sleep_cnt and spin_cnt types to u_int
  
  Both variables are uint64_t, but they only count spins or sleeps.
  All reasonable values which we can get here comfortably hit in 32-bit 
range.
  
  ==
  
  Implement trivial backoff for locking primitives.
  
  All current spinning loops retry an atomic op the first chance they get,
  which leads to performance degradation under load.
  
  One classic solution to the problem consists of delaying the test to an
  extent. This implementation has a trivial linear increment and a random
  factor for each attempt.
  
  For simplicity, this first thouch implementation only modifies spinning
  loops where the lock owner is running. spin mutexes and thread lock were
  not modified.
  
  Current parameters are autotuned on boot based on mp_cpus.
  
  Autotune factors are very conservative and are subject to change later.
  
  ==
  
  locks: fix up ifdef guards introduced in r303643
  
  Both sx and rwlocks had copy-pasted ADAPTIVE_MUTEXES instead of the 
correct
  define.
  
  ==
  
  locks: fix compilation for KDTRACE_HOOKS && !ADAPTIVE_* case
  
  ==
  
  locks: fix sx compilation on mips after r303643
  
  The kernel.h header is required for the SYSINIT macro, which apparently
  was present on amd64 by accident.

Modified:
  stable/10/sys/kern/kern_mutex.c
  stable/10/sys/kern/kern_rwlock.c
  stable/10/sys/kern/kern_sx.c
  stable/10/sys/kern/subr_lock.c
  stable/10/sys/sys/lock.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_mutex.c
==
--- stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:37:47 2016
(r310979)
+++ stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:57:05 2016
(r310980)
@@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -140,6 +141,37 @@ struct lock_class lock_class_mtx_spin = 
 #endif
 };
 
+#ifdef ADAPTIVE_MUTEXES
+static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging");
+
+static struct lock_delay_config mtx_delay = {
+   .initial= 1000,
+   .step   = 500,
+   .min= 100,
+   .max= 5000,
+};
+
+SYSCTL_INT(_debug_mtx, OID_AUTO, delay_initial, CTLFLAG_RW, &mtx_delay.initial,
+0, "");
+SYSCTL_INT(_debug_mtx, OID_AUTO, delay_step, CTLFLAG_RW, &mtx_delay.step,
+0, "");
+SYSCTL_INT(_debug_mtx, OID_AUTO, delay_min, CTLFLAG_RW, &mtx_delay.min,
+0, "");
+SYSCTL_INT(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max,
+0, "");
+
+static void
+mtx_delay_sysinit(void *dummy)
+{
+
+   mtx_delay.initial = mp_ncpus * 25;
+   mtx_delay.step = (mp_ncpus * 25) / 2;
+   mtx_delay.min = mp_ncpus * 5;
+   mtx_delay.max = mp_ncpus * 25 * 10;
+}
+LOCK_DELAY_SYSINIT(mtx_delay_sysinit);
+#endif
+
 /*
  * System-wide mutexes
  */
@@ -412,9 +444,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
int contested = 0;
uint64_t waittime = 0;
 #endif
+#if defined(ADAPTIVE_MUTEXES) || defined(KDTRACE_HOOKS)
+   struct lock_delay_arg lda;
+#endif
 #ifdef KDTRACE_HOOKS
-   uint64_t spin_cnt = 0;
-   uint64_t sleep_cnt = 0;
+   u_int sleep_cnt = 0;
int64_t sleep_time = 0;
int64_t all_time = 0;
 #endif
@@ -422,6 +456,11 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
if (SCHEDULER_STOPPED())
return;
 
+#if defined(ADAPTIVE_MUTEXES)
+   lock_delay_arg_init(&lda, &mtx_delay);
+#elif defined(KDTRACE_HOOKS)
+   lock_delay_arg_init(&lda, NULL);
+#endif
m = mtxlock2mtx(c);
 
if (mtx_owned(m)) {
@@ -455,7 +494,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid))
break;
 #ifdef KDTRACE_HOOKS
-   spin_cnt++;
+   lda.spin_cnt++;
 #endif
 #ifdef ADAPTIVE_MUTEXES
/*
@@ -475,12 +514,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
"spinning", "lockname:\"%s\"",
m->lock_object.lo_name);
while (mtx_owner(m) == owner &&
-   TD_IS_RUNNING(ow

svn commit: r310979 - in stable/10/sys: kern sys

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 16:37:47 2016
New Revision: 310979
URL: https://svnweb.freebsd.org/changeset/base/310979

Log:
  MFC r301157:
  
  Microoptimize locking primitives by avoiding unnecessary atomic ops.
  
  Inline version of primitives do an atomic op and if it fails they 
fallback to
  actual primitives, which immediately retry the atomic op.
  
  The obvious optimisation is to check if the lock is free and only then 
proceed
  to do an atomic op.

Modified:
  stable/10/sys/kern/kern_lock.c
  stable/10/sys/kern/kern_mutex.c
  stable/10/sys/kern/kern_rwlock.c
  stable/10/sys/kern/kern_sx.c
  stable/10/sys/sys/mutex.h
  stable/10/sys/sys/rwlock.h
  stable/10/sys/sys/sx.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_lock.c
==
--- stable/10/sys/kern/kern_lock.c  Sat Dec 31 16:02:27 2016
(r310978)
+++ stable/10/sys/kern/kern_lock.c  Sat Dec 31 16:37:47 2016
(r310979)
@@ -792,8 +792,10 @@ __lockmgr_args(struct lock *lk, u_int fl
break;
}
 
-   while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED,
-   tid)) {
+   for (;;) {
+   if (lk->lk_lock == LK_UNLOCKED &&
+   atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, 
tid))
+   break;
 #ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
 #endif
@@ -1129,7 +1131,11 @@ __lockmgr_args(struct lock *lk, u_int fl
__func__, iwmesg, file, line);
}
 
-   while (!atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) {
+   for (;;) {
+   if (lk->lk_lock == LK_UNLOCKED &&
+   atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, 
tid))
+   break;
+
 #ifdef HWPMC_HOOKS
PMC_SOFT_CALL( , , lock, failed);
 #endif

Modified: stable/10/sys/kern/kern_mutex.c
==
--- stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:02:27 2016
(r310978)
+++ stable/10/sys/kern/kern_mutex.c Sat Dec 31 16:37:47 2016
(r310979)
@@ -451,7 +451,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, 
all_time -= lockstat_nsecs(&m->lock_object);
 #endif
 
-   while (!_mtx_obtain_lock(m, tid)) {
+   for (;;) {
+   if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid))
+   break;
 #ifdef KDTRACE_HOOKS
spin_cnt++;
 #endif
@@ -634,8 +636,9 @@ _mtx_lock_spin_cookie(volatile uintptr_t
 #ifdef KDTRACE_HOOKS
spin_time -= lockstat_nsecs(&m->lock_object);
 #endif
-   while (!_mtx_obtain_lock(m, tid)) {
-
+   for (;;) {
+   if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid))
+   break;
/* Give interrupts a chance while we spin. */
spinlock_exit();
while (m->mtx_lock != MTX_UNOWNED) {
@@ -714,7 +717,9 @@ retry:
m->lock_object.lo_name, file, line));
WITNESS_CHECKORDER(&m->lock_object,
opts | LOP_NEWORDER | LOP_EXCLUSIVE, file, line, NULL);
-   while (!_mtx_obtain_lock(m, tid)) {
+   for (;;) {
+   if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, 
tid))
+   break;
if (m->mtx_lock == tid) {
m->mtx_recurse++;
break;

Modified: stable/10/sys/kern/kern_rwlock.c
==
--- stable/10/sys/kern/kern_rwlock.cSat Dec 31 16:02:27 2016
(r310978)
+++ stable/10/sys/kern/kern_rwlock.cSat Dec 31 16:37:47 2016
(r310979)
@@ -768,7 +768,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u
all_time -= lockstat_nsecs(&rw->lock_object);
state = rw->rw_lock;
 #endif
-   while (!_rw_write_lock(rw, tid)) {
+   for (;;) {
+   if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid))
+   break;
 #ifdef KDTRACE_HOOKS
spin_cnt++;
 #endif

Modified: stable/10/sys/kern/kern_sx.c
==
--- stable/10/sys/kern/kern_sx.cSat Dec 31 16:02:27 2016
(r310978)
+++ stable/10/sys/kern/kern_sx.cSat Dec 31 16:37:47 2016
(r310979)
@@ -547,7 +547,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
all_time -= lockstat_nsecs(&sx->lock_object);
state = sx->sx_lock;
 #endif
-   while (!atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) {
+   for (;;) {
+   if (sx->sx_lock == SX_LOCK_UNLOCKED

svn commit: r310977 - head/sys/sys

2016-12-31 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 31 15:58:15 2016
New Revision: 310977
URL: https://svnweb.freebsd.org/changeset/base/310977

Log:
  Addition of clang nullability qualifiers.
  
  Add two new qualifiers for use by the static checkers:
  
  _Nonnull
  The _Nonnull nullability qualifier indicates that null is not a meaningful
  value for a value of the _Nonnull pointer type.
  
  _Nullable
  The _Nullable nullability qualifier indicates that a value of the
  _Nullable pointer type can be null.
  
  These were introduced in Clang 3.7. For more information, see:
  http://clang.llvm.org/docs/AttributeReference.html#nonnull
  
  We add these now without using them so that the GCC ports have time to
  pick up the header change.
  
  Hinted by:Android Bionic libc [1]
  Also seen in: Apple's Libc-1158.20.4
  
  [1]
  
https://github.com/android/platform_bionic/commit/baa2a973bd776a51bb05a8590ab05d86eea7b321

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==
--- head/sys/sys/cdefs.hSat Dec 31 15:30:00 2016(r310976)
+++ head/sys/sys/cdefs.hSat Dec 31 15:58:15 2016(r310977)
@@ -804,6 +804,14 @@
 #endif
 
 /*
+ * Nullability qualifiers: currently only supported by Clang.
+ */
+#if !(defined(__clang__) && __has_feature(nullability))
+#define_Nonnull
+#define_Nullable
+#endif
+
+/*
  * Type Safety Checking
  *
  * Clang provides additional attributes to enable checking type safety
___
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: r310976 - head/lib/libc/locale

2016-12-31 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Dec 31 15:30:00 2016
New Revision: 310976
URL: https://svnweb.freebsd.org/changeset/base/310976

Log:
  Move __hidden attribute towards the end of the declaration.
  
  Apple had them at the start but moving them to the end is better for
  faster reading and fits better what is done in other FreeBSD headers.
  
  MFC after:5 days

Modified:
  head/lib/libc/locale/mblocal.h

Modified: head/lib/libc/locale/mblocal.h
==
--- head/lib/libc/locale/mblocal.h  Sat Dec 31 13:23:28 2016
(r310975)
+++ head/lib/libc/locale/mblocal.h  Sat Dec 31 15:30:00 2016
(r310976)
@@ -65,18 +65,18 @@ extern struct xlocale_ctype __xlocale_gl
 /*
  * Rune initialization function prototypes.
  */
-__hidden int   _none_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _ascii_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _UTF8_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _EUC_CN_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _EUC_JP_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _EUC_KR_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _EUC_TW_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _GB18030_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _GB2312_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _GBK_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _BIG5_init(struct xlocale_ctype *, _RuneLocale *);
-__hidden int   _MSKanji_init(struct xlocale_ctype *, _RuneLocale *);
+int_none_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_UTF8_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_EUC_CN_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_EUC_JP_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_EUC_KR_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_EUC_TW_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_GB18030_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_GB2312_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_GBK_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_BIG5_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_MSKanji_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
+int_ascii_init(struct xlocale_ctype *, _RuneLocale *) __hidden;
 
 typedef size_t (*mbrtowc_pfn_t)(wchar_t * __restrict,
 const char * __restrict, size_t, mbstate_t * __restrict);
___
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: r310975 - stable/10/sys/amd64/amd64

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 13:23:28 2016
New Revision: 310975
URL: https://svnweb.freebsd.org/changeset/base/310975

Log:
  MFC r303583:
  
  amd64: implement pagezero using rep stos
  
  The current implementation uses non-temporal writes. This turns out to
  be detrimental to performance if the page is used shortly after, which
  is the typical case with page faults.
  
  Switch to rep stos.

Modified:
  stable/10/sys/amd64/amd64/support.S
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/support.S
==
--- stable/10/sys/amd64/amd64/support.S Sat Dec 31 13:15:52 2016
(r310974)
+++ stable/10/sys/amd64/amd64/support.S Sat Dec 31 13:23:28 2016
(r310975)
@@ -65,17 +65,10 @@ END(bzero)
 /* Address: %rdi */
 ENTRY(pagezero)
PUSH_FRAME_POINTER
-   movq$-PAGE_SIZE,%rdx
-   subq%rdx,%rdi
+   movq$PAGE_SIZE/8,%rcx
xorl%eax,%eax
-1:
-   movnti  %rax,(%rdi,%rdx)
-   movnti  %rax,8(%rdi,%rdx)
-   movnti  %rax,16(%rdi,%rdx)
-   movnti  %rax,24(%rdi,%rdx)
-   addq$32,%rdx
-   jne 1b
-   sfence
+   rep
+   stosq
POP_FRAME_POINTER
ret
 END(pagezero)
___
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: r310974 - head/usr.sbin/syslogd

2016-12-31 Thread Hiroki Sato
Author: hrs
Date: Sat Dec 31 13:15:52 2016
New Revision: 310974
URL: https://svnweb.freebsd.org/changeset/base/310974

Log:
  - Use more descriptive names for variables.
  - Set O_CLOEXEC to the signal pipe and /dev/klog.
  - Use a single signal handler to catch both SIGHUP and SIGCHLD.
  - Fix a bug which did FD_SET() the writer-end of the pipe.

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

Modified: head/usr.sbin/syslogd/syslogd.c
==
--- head/usr.sbin/syslogd/syslogd.c Sat Dec 31 13:10:08 2016
(r310973)
+++ head/usr.sbin/syslogd/syslogd.c Sat Dec 31 13:15:52 2016
(r310974)
@@ -321,7 +321,7 @@ static int  LogFacPri;  /* Put facility an
 static int KeepKernFac;/* Keep remotely logged kernel facility */
 static int needdofsync = 0; /* Are any file(s) waiting to be fsynced? */
 static struct pidfh *pfh;
-static int sigp[2];/* Pipe to catch a signal during select(). */
+static int sigpipe[2]; /* Pipe to catch a signal during select(). */
 
 static volatile sig_atomic_t MarkSet, WantDie, WantInitialize, WantReapchild;
 
@@ -341,7 +341,6 @@ static void dofsync(void);
 static voiddomark(int);
 static voidfprintlog(struct filed *, int, const char *);
 static voidinit(int);
-static voidinit_sh(int);
 static voidlogerror(const char *);
 static voidlogmsg(int, const char *, const char *, int);
 static voidlog_deadchild(pid_t, int, const char *);
@@ -350,12 +349,12 @@ static intsocksetup(struct peer *);
 static int socklist_recv_file(struct socklist *);
 static int socklist_recv_sock(struct socklist *);
 static int socklist_recv_signal(struct socklist *);
+static voidsighandler(int);
 static int skip_message(const char *, const char *, int);
 static voidprintline(const char *, char *, int);
 static voidprintsys(char *);
 static int p_open(const char *, pid_t *);
 static voidreapchild(int);
-static voidreapchild_sh(int);
 static const char *ttymsg_check(struct iovec *, int, char *, int);
 static voidusage(void);
 static int validate(struct sockaddr *, const char *);
@@ -582,18 +581,18 @@ main(int argc, char *argv[])
usage();
 
/* Pipe to catch a signal during select(). */
-   s = pipe2(sigp, O_NONBLOCK);
+   s = pipe2(sigpipe, O_CLOEXEC);
if (s < 0) {
err(1, "cannot open a pipe for signals");
} else {
addsock(NULL, 0, &(struct socklist){
-   .sl_socket = sigp[1],
+   .sl_socket = sigpipe[0],
.sl_recv = socklist_recv_signal
});
}
 
/* Listen by default: /dev/klog. */
-   s = open(_PATH_KLOG, O_RDONLY|O_NONBLOCK, 0);
+   s = open(_PATH_KLOG, O_RDONLY | O_NONBLOCK | O_CLOEXEC, 0);
if (s < 0) {
dprintf("can't open %s (%d)\n", _PATH_KLOG, errno);
} else {
@@ -646,8 +645,8 @@ main(int argc, char *argv[])
(void)signal(SIGTERM, dodie);
(void)signal(SIGINT, Debug ? dodie : SIG_IGN);
(void)signal(SIGQUIT, Debug ? dodie : SIG_IGN);
-   (void)signal(SIGHUP, init_sh);
-   (void)signal(SIGCHLD, reapchild_sh);
+   (void)signal(SIGHUP, sighandler);
+   (void)signal(SIGCHLD, sighandler);
(void)signal(SIGALRM, domark);
(void)signal(SIGPIPE, SIG_IGN); /* We'll catch EPIPE instead. */
(void)alarm(TIMERINTVL);
@@ -717,12 +716,31 @@ static int
 socklist_recv_signal(struct socklist *sl __unused)
 {
ssize_t len;
-   static char buf[BUFSIZ];
-
-   /* Clear an wake-up signal by reading dummy data. */
-   while ((len = read(sigp[0], buf, sizeof(buf))) > 0)
-   ;
+   int i, nsig, signo;
 
+   if (ioctl(sigpipe[0], FIONREAD, &i) != 0) {
+   logerror("ioctl(FIONREAD)");
+   err(1, "signal pipe read failed");
+   }
+   nsig = i / sizeof(signo);
+   dprintf("# of received signals = %d\n", nsig);
+   for (i = 0; i < nsig; i++) {
+   len = read(sigpipe[0], &signo, sizeof(signo));
+   if (len != sizeof(signo)) {
+   logerror("signal pipe read failed");
+   err(1, "signal pipe read failed");
+   }
+   dprintf("Received signal: %d from fd=%d\n", signo,
+   sigpipe[0]);
+   switch (signo) {
+   case SIGHUP:
+   WantInitialize = 1;
+   break;
+   case SIGCHLD:
+   WantReapchild = 1;
+   break;
+   }
+   }
return (0);
 }
 
@@ -1512,17 +1530,6 @@ ttymsg_check(struct iovec *iov, int iovc
 }
 
 static void
-reapchild_sh(int signo)
-{
-   static char buf[BUFSIZ];
-
-   WantReapchild = signo;
-   /* Send an wake-up signal to the select() loop. */
-  

svn commit: r310973 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 13:10:08 2016
New Revision: 310973
URL: https://svnweb.freebsd.org/changeset/base/310973

Log:
  MFC r309307,r309308:
  
  vfs: avoid VOP_ISLOCKED in the common case in lookup
  
  ==
  
  vfs: fix a whitespace nit in r309307

Modified:
  stable/11/sys/kern/vfs_lookup.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_lookup.c
==
--- stable/11/sys/kern/vfs_lookup.c Sat Dec 31 13:10:06 2016
(r310972)
+++ stable/11/sys/kern/vfs_lookup.c Sat Dec 31 13:10:08 2016
(r310973)
@@ -802,9 +802,8 @@ unionlookup:
 * If we have a shared lock we may need to upgrade the lock for the
 * last operation.
 */
-   if (dp != vp_crossmp &&
-   VOP_ISLOCKED(dp) == LK_SHARED &&
-   (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT))
+   if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) &&
+   dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED)
vn_lock(dp, LK_UPGRADE|LK_RETRY);
if ((dp->v_iflag & VI_DOOMED) != 0) {
error = ENOENT;
___
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: r310972 - head/sys/boot/fdt/dts/arm

2016-12-31 Thread Jared McNeill
Author: jmcneill
Date: Sat Dec 31 13:10:06 2016
New Revision: 310972
URL: https://svnweb.freebsd.org/changeset/base/310972

Log:
  Fix a typo in the third address of the reg property for the usbphy node.
  
  MFC after:1 week

Modified:
  head/sys/boot/fdt/dts/arm/a83t.dtsi

Modified: head/sys/boot/fdt/dts/arm/a83t.dtsi
==
--- head/sys/boot/fdt/dts/arm/a83t.dtsi Sat Dec 31 13:07:09 2016
(r310971)
+++ head/sys/boot/fdt/dts/arm/a83t.dtsi Sat Dec 31 13:10:06 2016
(r310972)
@@ -178,7 +178,7 @@
compatible = "allwinner,sun8i-a83t-usb-phy";
reg = <0x01c19400 0x2c>,
  <0x01c1a800 0x4>,
- <0x01c1a800 0x4>;
+ <0x01c1b800 0x4>;
clocks = <&usb_clk 8>,
 <&usb_clk 9>,
 <&usb_clk 10>,
___
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: r310971 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 13:07:09 2016
New Revision: 310971
URL: https://svnweb.freebsd.org/changeset/base/310971

Log:
  MFC r309111:
  
  wait: avoid relocking the child if proc_to_reap returns 1
  
  proc_to_reap would always unlock. However, if it returned 1, kern_wait6
  would immediately lock it again. Save the dance.

Modified:
  stable/11/sys/kern/kern_exit.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_exit.c
==
--- stable/11/sys/kern/kern_exit.c  Sat Dec 31 13:05:48 2016
(r310970)
+++ stable/11/sys/kern/kern_exit.c  Sat Dec 31 13:07:09 2016
(r310971)
@@ -1066,7 +1066,6 @@ proc_to_reap(struct thread *td, struct p
proc_reap(td, p, status, options);
return (-1);
}
-   PROC_UNLOCK(p);
return (1);
 }
 
@@ -1199,7 +1198,7 @@ loop:
return (0);
}
 
-   PROC_LOCK(p);
+   PROC_LOCK_ASSERT(p, MA_OWNED);
 
if ((options & (WTRAPPED | WUNTRACED)) != 0)
PROC_SLOCK(p);
@@ -1259,6 +1258,7 @@ loop:
if (ret != 0) {
KASSERT(ret != -1, ("reaped an orphan (pid %d)",
(int)td->td_retval[0]));
+   PROC_UNLOCK(p);
nfound++;
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: r310970 - in stable/11/sys: kern x86/x86

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 13:05:48 2016
New Revision: 310970
URL: https://svnweb.freebsd.org/changeset/base/310970

Log:
  MFC r307653:
  
  Mark a bunch of mpsafe sysctls as such.
  
  This gives me a sysctl Giant-free buildworld.

Modified:
  stable/11/sys/kern/kern_exec.c
  stable/11/sys/kern/kern_mib.c
  stable/11/sys/x86/x86/identcpu.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_exec.c
==
--- stable/11/sys/kern/kern_exec.c  Sat Dec 31 13:04:12 2016
(r310969)
+++ stable/11/sys/kern/kern_exec.c  Sat Dec 31 13:05:48 2016
(r310970)
@@ -118,14 +118,14 @@ static int do_execve(struct thread *td, 
 struct mac *mac_p);
 
 /* XXX This should be vm_size_t. */
-SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD,
-NULL, 0, sysctl_kern_ps_strings, "LU", "");
+SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD|
+CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", "");
 
 /* XXX This should be vm_size_t. */
 SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD|
-CTLFLAG_CAPRD, NULL, 0, sysctl_kern_usrstack, "LU", "");
+CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", "");
 
-SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD,
+SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE,
 NULL, 0, sysctl_kern_stackprot, "I", "");
 
 u_long ps_arg_cache_limit = PAGE_SIZE / 16;

Modified: stable/11/sys/kern/kern_mib.c
==
--- stable/11/sys/kern/kern_mib.c   Sat Dec 31 13:04:12 2016
(r310969)
+++ stable/11/sys/kern/kern_mib.c   Sat Dec 31 13:05:48 2016
(r310970)
@@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_
 
 char kernelname[MAXPATHLEN] = "/kernel";   /* XXX bloat */
 
-SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW,
+SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE,
 kernelname, sizeof kernelname, "Name of kernel file booted");
 
 SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD,
@@ -254,8 +254,9 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR
return (error);
 
 }
-SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD,
-NULL, 0, sysctl_hw_machine_arch, "A", "System architecture");
+SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD |
+CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A",
+"System architecture");
 
 SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE,
 #ifdef COMPAT_FREEBSD32
@@ -383,8 +384,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur
 /* Actual kernel configuration options. */
 extern char kernconfstring[];
 
-SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0,
-"Kernel configuration file");
+SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE,
+kernconfstring, 0, "Kernel configuration file");
 #endif
 
 static int

Modified: stable/11/sys/x86/x86/identcpu.c
==
--- stable/11/sys/x86/x86/identcpu.cSat Dec 31 13:04:12 2016
(r310969)
+++ stable/11/sys/x86/x86/identcpu.cSat Dec 31 13:05:48 2016
(r310970)
@@ -148,15 +148,15 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS)
return (error);
 
 }
-SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD,
-NULL, 0, sysctl_hw_machine, "A", "Machine class");
+SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD |
+CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class");
 #else
 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
 machine, 0, "Machine class");
 #endif
 
 static char cpu_model[128];
-SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
+SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE,
 cpu_model, 0, "Machine model");
 
 static int hw_clockrate;
@@ -165,8 +165,8 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTL
 
 u_int hv_high;
 char hv_vendor[16];
-SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0,
-"Hypervisor vendor");
+SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor,
+0, "Hypervisor vendor");
 
 static eventhandler_tag tsc_post_tag;
 
___
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: r310969 - stable/11/sys/compat/linprocfs

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 13:04:12 2016
New Revision: 310969
URL: https://svnweb.freebsd.org/changeset/base/310969

Log:
  MFC r305856:
  
  linprocfs: garbage collect meminfo fields not present in linux
  
  In particular memshared not only does not exist in linux, it was
  extremely expensive to calculate.

Modified:
  stable/11/sys/compat/linprocfs/linprocfs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linprocfs/linprocfs.c
==
--- stable/11/sys/compat/linprocfs/linprocfs.c  Sat Dec 31 12:58:26 2016
(r310968)
+++ stable/11/sys/compat/linprocfs/linprocfs.c  Sat Dec 31 13:04:12 2016
(r310969)
@@ -144,12 +144,10 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
unsigned long memtotal; /* total memory in bytes */
unsigned long memused;  /* used memory in bytes */
unsigned long memfree;  /* free memory in bytes */
-   unsigned long memshared;/* shared memory ??? */
unsigned long buffers, cached;  /* buffer / cache memory ??? */
unsigned long long swaptotal;   /* total swap space in bytes */
unsigned long long swapused;/* used swap space in bytes */
unsigned long long swapfree;/* free swap space in bytes */
-   vm_object_t object;
int i, j;
 
memtotal = physmem * PAGE_SIZE;
@@ -169,13 +167,6 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
swaptotal = (unsigned long long)i * PAGE_SIZE;
swapused = (unsigned long long)j * PAGE_SIZE;
swapfree = swaptotal - swapused;
-   memshared = 0;
-   mtx_lock(&vm_object_list_mtx);
-   TAILQ_FOREACH(object, &vm_object_list, object_list)
-   if (object->shadow_count > 1)
-   memshared += object->resident_page_count;
-   mtx_unlock(&vm_object_list_mtx);
-   memshared *= PAGE_SIZE;
/*
 * We'd love to be able to write:
 *
@@ -188,21 +179,14 @@ linprocfs_domeminfo(PFS_FILL_ARGS)
cached = vm_cnt.v_cache_count * PAGE_SIZE;
 
sbuf_printf(sb,
-   "total:used:free:  shared: buffers:  cached:\n"
-   "Mem:  %lu %lu %lu %lu %lu %lu\n"
-   "Swap: %llu %llu %llu\n"
"MemTotal: %9lu kB\n"
"MemFree:  %9lu kB\n"
-   "MemShared:%9lu kB\n"
"Buffers:  %9lu kB\n"
"Cached:   %9lu kB\n"
"SwapTotal:%9llu kB\n"
"SwapFree: %9llu kB\n",
-   memtotal, memused, memfree, memshared, buffers, cached,
-   swaptotal, swapused, swapfree,
-   B2K(memtotal), B2K(memfree),
-   B2K(memshared), B2K(buffers), B2K(cached),
-   B2K(swaptotal), B2K(swapfree));
+   B2K(memtotal), B2K(memfree), B2K(buffers),
+   B2K(cached), B2K(swaptotal), B2K(swapfree));
 
return (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: r310968 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:58:26 2016
New Revision: 310968
URL: https://svnweb.freebsd.org/changeset/base/310968

Log:
  MFC r304927:
  
  vfs: provide a common exit point in namei for error cases
  
  This shortens the function, adds the SDT_PROBE use for error cases and
  consistenly unrefs rootdir last.

Modified:
  stable/11/sys/kern/vfs_lookup.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/vfs_lookup.c
==
--- stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:52:58 2016
(r310967)
+++ stable/11/sys/kern/vfs_lookup.c Sat Dec 31 12:58:26 2016
(r310968)
@@ -380,9 +380,7 @@ namei(struct nameidata *ndp)
if (error != 0) {
if (dp != NULL)
vrele(dp);
-   vrele(ndp->ni_rootdir);
-   namei_cleanup_cnp(cnp);
-   return (error);
+   goto out;
}
if ((ndp->ni_lcf & NI_LCF_STRICTRELATIVE) != 0 &&
lookup_cap_dotdot != 0)
@@ -392,12 +390,8 @@ namei(struct nameidata *ndp)
for (;;) {
ndp->ni_startdir = dp;
error = lookup(ndp);
-   if (error != 0) {
-   vrele(ndp->ni_rootdir);
-   namei_cleanup_cnp(cnp);
-   SDT_PROBE2(vfs, namei, lookup, return, error, NULL);
-   return (error);
-   }
+   if (error != 0)
+   goto out;
/*
 * If not a symbolic link, we're done.
 */
@@ -471,18 +465,16 @@ namei(struct nameidata *ndp)
if (*(cnp->cn_nameptr) == '/') {
vrele(dp);
error = namei_handle_root(ndp, &dp);
-   if (error != 0) {
-   vrele(ndp->ni_rootdir);
-   namei_cleanup_cnp(cnp);
-   return (error);
-   }
+   if (error != 0)
+   goto out;
}
}
-   vrele(ndp->ni_rootdir);
-   namei_cleanup_cnp(cnp);
vput(ndp->ni_vp);
ndp->ni_vp = NULL;
vrele(ndp->ni_dvp);
+out:
+   vrele(ndp->ni_rootdir);
+   namei_cleanup_cnp(cnp);
nameicap_cleanup(ndp);
SDT_PROBE2(vfs, namei, lookup, return, error, NULL);
return (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: r310967 - in stable/10: . sys/sys

2016-12-31 Thread Baptiste Daroussin
Author: bapt
Date: Sat Dec 31 12:52:58 2016
New Revision: 310967
URL: https://svnweb.freebsd.org/changeset/base/310967

Log:
  Bump copyright year.
  
  Happy New Year 2017!

Modified:
  stable/10/COPYRIGHT
  stable/10/sys/sys/copyright.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/COPYRIGHT
==
--- stable/10/COPYRIGHT Sat Dec 31 12:52:23 2016(r310966)
+++ stable/10/COPYRIGHT Sat Dec 31 12:52:58 2016(r310967)
@@ -4,7 +4,7 @@
 The compilation of software known as FreeBSD is distributed under the
 following terms:
 
-Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved.
+Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: stable/10/sys/sys/copyright.h
==
--- stable/10/sys/sys/copyright.h   Sat Dec 31 12:52:23 2016
(r310966)
+++ stable/10/sys/sys/copyright.h   Sat Dec 31 12:52:58 2016
(r310967)
@@ -30,7 +30,7 @@
 
 /* FreeBSD */
 #define COPYRIGHT_FreeBSD \
-   "Copyright (c) 1992-2016 The FreeBSD Project.\n"
+   "Copyright (c) 1992-2017 The FreeBSD Project.\n"
 
 /* Foundation */
 #defineTRADEMARK_Foundation \
___
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: r310966 - in stable/11: . sys/sys

2016-12-31 Thread Baptiste Daroussin
Author: bapt
Date: Sat Dec 31 12:52:23 2016
New Revision: 310966
URL: https://svnweb.freebsd.org/changeset/base/310966

Log:
  Bump copyright year.
  
  Happy New Year 2017!

Modified:
  stable/11/COPYRIGHT
  stable/11/sys/sys/copyright.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/COPYRIGHT
==
--- stable/11/COPYRIGHT Sat Dec 31 12:49:20 2016(r310965)
+++ stable/11/COPYRIGHT Sat Dec 31 12:52:23 2016(r310966)
@@ -4,7 +4,7 @@
 The compilation of software known as FreeBSD is distributed under the
 following terms:
 
-Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved.
+Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: stable/11/sys/sys/copyright.h
==
--- stable/11/sys/sys/copyright.h   Sat Dec 31 12:49:20 2016
(r310965)
+++ stable/11/sys/sys/copyright.h   Sat Dec 31 12:52:23 2016
(r310966)
@@ -34,7 +34,7 @@
 
 /* FreeBSD */
 #define COPYRIGHT_FreeBSD \
-   "Copyright (c) 1992-2016 The FreeBSD Project.\n"
+   "Copyright (c) 1992-2017 The FreeBSD Project.\n"
 
 /* Foundation */
 #defineTRADEMARK_Foundation \
___
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: r310965 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:49:20 2016
New Revision: 310965
URL: https://svnweb.freebsd.org/changeset/base/310965

Log:
  MFC r303921:
  
  ktrace: do a lockless check on fork to see if tracing is enabled
  
  This saves 2 lock acquisitions in the common case.

Modified:
  stable/11/sys/kern/kern_ktrace.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_ktrace.c
==
--- stable/11/sys/kern/kern_ktrace.cSat Dec 31 12:47:41 2016
(r310964)
+++ stable/11/sys/kern/kern_ktrace.cSat Dec 31 12:49:20 2016
(r310965)
@@ -572,9 +572,14 @@ void
 ktrprocfork(struct proc *p1, struct proc *p2)
 {
 
+   MPASS(p2->p_tracevp == NULL);
+   MPASS(p2->p_traceflag == 0);
+
+   if (p1->p_traceflag == 0)
+   return;
+
PROC_LOCK(p1);
mtx_lock(&ktrace_mtx);
-   KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode"));
if (p1->p_traceflag & KTRFAC_INHERIT) {
p2->p_traceflag = p1->p_traceflag;
if ((p2->p_tracevp = p1->p_tracevp) != 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: r310964 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:47:41 2016
New Revision: 310964
URL: https://svnweb.freebsd.org/changeset/base/310964

Log:
  MFC r303921:
  
  sigio: do a lockless check in funsetownlist
  
  There is no need to grab the lock first to see if sigio is used, and it
  typically is not.

Modified:
  stable/11/sys/kern/kern_descrip.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_descrip.c
==
--- stable/11/sys/kern/kern_descrip.c   Sat Dec 31 12:41:42 2016
(r310963)
+++ stable/11/sys/kern/kern_descrip.c   Sat Dec 31 12:47:41 2016
(r310964)
@@ -939,6 +939,8 @@ funsetown(struct sigio **sigiop)
 {
struct sigio *sigio;
 
+   if (*sigiop == NULL)
+   return;
SIGIO_LOCK();
sigio = *sigiop;
if (sigio == 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: r310963 - in head: . sys/sys

2016-12-31 Thread Baptiste Daroussin
Author: bapt
Date: Sat Dec 31 12:41:42 2016
New Revision: 310963
URL: https://svnweb.freebsd.org/changeset/base/310963

Log:
  Bump copyright year.
  
  Happy New Year 2017!

Modified:
  head/COPYRIGHT
  head/sys/sys/copyright.h

Modified: head/COPYRIGHT
==
--- head/COPYRIGHT  Sat Dec 31 12:39:34 2016(r310962)
+++ head/COPYRIGHT  Sat Dec 31 12:41:42 2016(r310963)
@@ -4,7 +4,7 @@
 The compilation of software known as FreeBSD is distributed under the
 following terms:
 
-Copyright (c) 1992-2016 The FreeBSD Project. All rights reserved.
+Copyright (c) 1992-2017 The FreeBSD Project. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions

Modified: head/sys/sys/copyright.h
==
--- head/sys/sys/copyright.hSat Dec 31 12:39:34 2016(r310962)
+++ head/sys/sys/copyright.hSat Dec 31 12:41:42 2016(r310963)
@@ -34,7 +34,7 @@
 
 /* FreeBSD */
 #define COPYRIGHT_FreeBSD \
-   "Copyright (c) 1992-2016 The FreeBSD Project.\n"
+   "Copyright (c) 1992-2017 The FreeBSD Project.\n"
 
 /* Foundation */
 #defineTRADEMARK_Foundation \
___
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: r310962 - stable/11/sys/kern

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:39:34 2016
New Revision: 310962
URL: https://svnweb.freebsd.org/changeset/base/310962

Log:
  MFC r305482:
  
  cv: do a lockless check for no waiters in cv_signal and cv_broadcastpri
  
  In case of some consumers like zfs there are no waiters vast majority of
  the time

Modified:
  stable/11/sys/kern/kern_condvar.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_condvar.c
==
--- stable/11/sys/kern/kern_condvar.c   Sat Dec 31 12:39:15 2016
(r310961)
+++ stable/11/sys/kern/kern_condvar.c   Sat Dec 31 12:39:34 2016
(r310962)
@@ -397,6 +397,8 @@ cv_signal(struct cv *cvp)
 {
int wakeup_swapper;
 
+   if (cvp->cv_waiters == 0)
+   return;
wakeup_swapper = 0;
sleepq_lock(cvp);
if (cvp->cv_waiters > 0) {
@@ -424,6 +426,8 @@ cv_broadcastpri(struct cv *cvp, int pri)
 {
int wakeup_swapper;
 
+   if (cvp->cv_waiters == 0)
+   return;
/*
 * XXX sleepq_broadcast pri argument changed from -1 meaning
 * no pri to 0 meaning no pri.
___
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: r310961 - head/sbin/sysctl

2016-12-31 Thread Andriy Voskoboinyk
Author: avos
Date: Sat Dec 31 12:39:15 2016
New Revision: 310961
URL: https://svnweb.freebsd.org/changeset/base/310961

Log:
  sysctl(8): fix typename for uint32_t.
  
  MFC after:5 days.

Modified:
  head/sbin/sysctl/sysctl.c

Modified: head/sbin/sysctl/sysctl.c
==
--- head/sbin/sysctl/sysctl.c   Sat Dec 31 12:37:53 2016(r310960)
+++ head/sbin/sysctl/sysctl.c   Sat Dec 31 12:39:15 2016(r310961)
@@ -114,7 +114,7 @@ static const char *ctl_typename[CTLTYPE+
[CTLTYPE_ULONG] = "unsigned long",
[CTLTYPE_U8] = "uint8_t",
[CTLTYPE_U16] = "uint16_t",
-   [CTLTYPE_U32] = "uint16_t",
+   [CTLTYPE_U32] = "uint32_t",
[CTLTYPE_U64] = "uint64_t",
[CTLTYPE_S8] = "int8_t",
[CTLTYPE_S16] = "int16_t",
___
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: r310960 - head/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 12:37:53 2016
New Revision: 310960
URL: https://svnweb.freebsd.org/changeset/base/310960

Log:
  Similar to r310954, set .len to 0 on malloc failure and to `len` only
  on success
  
  MFC after:1 week

Modified:
  head/contrib/bsnmp/snmpd/export.c

Modified: head/contrib/bsnmp/snmpd/export.c
==
--- head/contrib/bsnmp/snmpd/export.c   Sat Dec 31 12:32:50 2016
(r310959)
+++ head/contrib/bsnmp/snmpd/export.c   Sat Dec 31 12:37:53 2016
(r310960)
@@ -114,9 +114,11 @@ string_get(struct snmp_value *value, con
}
if (len == -1)
len = strlen(ptr);
-   value->v.octetstring.len = (u_long)len;
-   if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL)
+   if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) {
+   value->v.octetstring.len = 0;
return (SNMP_ERR_RES_UNAVAIL);
+   }
+   value->v.octetstring.len = (u_long)len;
memcpy(value->v.octetstring.octets, ptr, (size_t)len);
return (SNMP_ERR_NOERROR);
 }
@@ -138,9 +140,11 @@ string_get_max(struct snmp_value *value,
len = strlen(ptr);
if ((size_t)len > maxlen)
len = maxlen;
-   value->v.octetstring.len = (u_long)len;
-   if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL)
+   if ((value->v.octetstring.octets = malloc((size_t)len)) == NULL) {
+   value->v.octetstring.len = 0;
return (SNMP_ERR_RES_UNAVAIL);
+   }
+   value->v.octetstring.len = (u_long)len;
memcpy(value->v.octetstring.octets, ptr, (size_t)len);
return (SNMP_ERR_NOERROR);
 }
___
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: r310959 - in stable/11/sys: cddl/contrib/opensolaris/uts/common/fs/zfs kern sys

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:32:50 2016
New Revision: 310959
URL: https://svnweb.freebsd.org/changeset/base/310959

Log:
  MFC r305378,r305379,r305386,r305684,r306224,r306608,r306803,r307650,r307685,
  r308407,r308665,r308667,r309067:
  
  cache: put all negative entry management code into dedicated functions
  
  ==
  cache: manage negative entry list with a dedicated lock
  
  Since negative entries are managed with a LRU list, a hit requires a
  modificaton.
  
  Currently the code tries to upgrade the global lock if needed and is
  forced to retry the lookup if it fails.
  
  Provide a dedicated lock for use when the cache is only shared-locked.
  
  ==
  
  cache: defer freeing entries until after the global lock is dropped
  
  This also defers vdrop for held vnodes.
  
  ==
  
  cache: improve scalability by introducing bucket locks
  
  An array of bucket locks is added.
  
  All modifications still require the global cache_lock to be held for
  writing. However, most readers only need the relevant bucket lock and in
  effect can run concurrently to the writer as long as they use a
  different lock. See the added comment for more details.
  
  This is an intermediate step towards removal of the global lock.
  
  ==
  
  cache: get rid of the global lock
  
  Add a table of vnode locks and use them along with bucketlocks to provide
  concurrent modification support. The approach taken is to preserve the
  current behaviour of the namecache and just lock all relevant parts before
  any changes are made.
  
  Lookups still require the relevant bucket to be locked.
  
  ==
  
  cache: ignore purgevfs requests for filesystems with few vnodes
  
  purgevfs is purely optional and induces lock contention in workloads
  which frequently mount and unmount filesystems.
  
  In particular, poudriere will do this for filesystems with 4 vnodes or
  less. Full cache scan is clearly wasteful.
  
  Since there is no explicit counter for namecache entries, the number of
  vnodes used by the target fs is checked.
  
  The default limit is the number of bucket locks.
  
  == (by kib)
  
  Limit scope of the optimization in r306608 to dounmount() caller only.
  Other uses of cache_purgevfs() do rely on the cache purge for correct
  operations, when paths are invalidated without unmount.
  
  ==
  
  cache: split negative entry LRU into multiple lists
  
  This splits the ncneg_mtx lock while preserving the hit ratio at least
  during buildworld.
  
  Create N dedicated lists for new negative entries.
  
  Entries with at least one hit get promoted to the hot list, where they
  get requeued every M hits.
  
  Shrinking demotes one hot entry and performs a round-robin shrinking of
  regular lists.
  
  ==
  
  cache: fix up a corner case in r307650
  
  If no negative entry is found on the last list, the ncp pointer will be
  left uninitialized and a non-null value will make the function assume an
  entry was found.
  
  Fix the problem by initializing to NULL on entry.
  
  == (by kib)
  
  vn_fullpath1() checked VV_ROOT and then unreferenced
  vp->v_mount->mnt_vnodecovered unlocked.  This allowed unmount to race.
  Lock vnode after we noticed the VV_ROOT flag.  See comments for
  explanation why unlocked check for the flag is considered safe.
  
  ==
  
  cache: fix a race between entry removal and demotion
  
  The negative list shrinker can demote an entry with only hotlist + neglist
  locks held. On the other hand entry removal possibly sets the NCF_DVDROP
  without aformentioned locks held prior to detaching it from the respective
  netlist., which can lose the update made by the shrinker.
  
  ==
  
  cache: plug a write-only variable in cache_negative_zap_one
  
  ==
  
  cache: ensure that the number of bucket locks does not exceed hash size
  
  The size can be changed by side effect of modifying kern.maxvnodes.
  
  Since numbucketlocks was not modified, setting a sufficiently low value
  would give more locks than actual buckets, which would then lead to
  corruption.
  
  Force the number of buckets to be not smaller.
  
  Note this should not matter for real world cases.

Modified:
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  stable/11/sys/kern/subr_witness.c
  stable/11/sys/kern/vfs_cache.c
  stable/11/sys/kern/vfs_mount.c
  stable/11/sys/kern/vfs_mountroot.c
  stable/11/sys/sys/vnode.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
==
--- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c   
Sat Dec 31 12:30:14 2016(r310958)
+++ stable/

svn commit: r310958 - head/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 12:30:14 2016
New Revision: 310958
URL: https://svnweb.freebsd.org/changeset/base/310958

Log:
  Initialize ret to SNMPD_INPUT_OK at the top of snmp_input_start(..) to
  avoid returning an uninitialized value
  
  There are some really complicated, snakey if-statements combined with
  switch statements that could result in an invalid value being returned
  as `ret`
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1006551

Modified:
  head/contrib/bsnmp/snmpd/main.c

Modified: head/contrib/bsnmp/snmpd/main.c
==
--- head/contrib/bsnmp/snmpd/main.c Sat Dec 31 12:18:17 2016
(r310957)
+++ head/contrib/bsnmp/snmpd/main.c Sat Dec 31 12:30:14 2016
(r310958)
@@ -492,6 +492,8 @@ snmp_input_start(const u_char *buf, size
b.asn_cptr = buf;
b.asn_len = len;
 
+   ret = SNMPD_INPUT_OK;
+
/* look whether we have enough bytes for the entire PDU. */
switch (sret = snmp_pdu_snoop(&b)) {
 
@@ -520,8 +522,6 @@ snmp_input_start(const u_char *buf, size
}
code = snmp_pdu_decode_scoped(&b, pdu, ip);
 
-   ret = SNMPD_INPUT_OK;
-
 decoded:
snmpd_stats.inPkts++;
 
___
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: r310957 - head/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 12:18:17 2016
New Revision: 310957
URL: https://svnweb.freebsd.org/changeset/base/310957

Log:
  Use strlcpy when copying `com` to pdu->community to avoid potential
  buffer overruns
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1006823, 1006824

Modified:
  head/contrib/bsnmp/snmpd/trap.c

Modified: head/contrib/bsnmp/snmpd/trap.c
==
--- head/contrib/bsnmp/snmpd/trap.c Sat Dec 31 12:16:21 2016
(r310956)
+++ head/contrib/bsnmp/snmpd/trap.c Sat Dec 31 12:18:17 2016
(r310957)
@@ -422,7 +422,7 @@ snmp_create_v1_trap(struct snmp_pdu *pdu
 const struct asn_oid *trap_oid)
 {
memset(pdu, 0, sizeof(*pdu));
-   strcpy(pdu->community, com);
+   strlcpy(pdu->community, com, sizeof(pdu->community));
 
pdu->version = SNMP_V1;
pdu->type = SNMP_PDU_TRAP;
@@ -439,7 +439,7 @@ snmp_create_v2_trap(struct snmp_pdu *pdu
 const struct asn_oid *trap_oid)
 {
memset(pdu, 0, sizeof(*pdu));
-   strcpy(pdu->community, com);
+   strlcpy(pdu->community, com, sizeof(pdu->community));
 
pdu->version = SNMP_V2c;
pdu->type = SNMP_PDU_TRAP2;
___
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: r310954 - head/usr.sbin/bsnmpd/tools/libbsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 12:14:25 2016
New Revision: 310954
URL: https://svnweb.freebsd.org/changeset/base/310954

Log:
  Set value->v.octetstring.len to a correct value on malloc success/failure
  
  The previous code always set value->v.octetstring.len to len, regardless
  of the result from the malloc call. This misleads the caller on malloc
  failure. Set .len to len on success and 0 on failure.
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1007590

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
==
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c  Sat Dec 31 12:06:27 
2016(r310953)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c  Sat Dec 31 12:14:25 
2016(r310954)
@@ -266,13 +266,13 @@ parse_octetstring(struct snmp_value *val
return (-1);
}
 
-   value->v.octetstring.len = len;
-
-   if((value->v.octetstring.octets = malloc(len)) == NULL) {
+   if ((value->v.octetstring.octets = malloc(len)) == NULL) {
+   value->v.octetstring.len = 0;
syslog(LOG_ERR, "malloc failed: %s", strerror(errno));
return (-1);
}
 
+   value->v.octetstring.len = len;
memcpy(value->v.octetstring.octets, val, len);
value->syntax = SNMP_SYNTAX_OCTETSTRING;
 
___
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: r310953 - in stable/11/sys: kern sys

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 12:06:27 2016
New Revision: 310953
URL: https://svnweb.freebsd.org/changeset/base/310953

Log:
  MFC r309893,r309929:
  
  vfs: add vrefact, to be used when the vnode has to be already active
  
  This allows blind increment of relevant counters which under contention
  is cheaper than inc-not-zero loops at least on amd64.
  
  Use it in some of the places which are guaranteed to see already active
  vnodes.
  
  ==
  
  vfs: use vrefact in getcwd and fchdir

Modified:
  stable/11/sys/kern/kern_descrip.c
  stable/11/sys/kern/kern_fork.c
  stable/11/sys/kern/vfs_cache.c
  stable/11/sys/kern/vfs_lookup.c
  stable/11/sys/kern/vfs_subr.c
  stable/11/sys/kern/vfs_syscalls.c
  stable/11/sys/sys/vnode.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_descrip.c
==
--- stable/11/sys/kern/kern_descrip.c   Sat Dec 31 12:03:25 2016
(r310952)
+++ stable/11/sys/kern/kern_descrip.c   Sat Dec 31 12:06:27 2016
(r310953)
@@ -318,11 +318,11 @@ pwd_ensure_dirs(void)
FILEDESC_XLOCK(fdp);
if (fdp->fd_cdir == NULL) {
fdp->fd_cdir = rootvnode;
-   VREF(rootvnode);
+   vrefact(rootvnode);
}
if (fdp->fd_rdir == NULL) {
fdp->fd_rdir = rootvnode;
-   VREF(rootvnode);
+   vrefact(rootvnode);
}
FILEDESC_XUNLOCK(fdp);
 }
@@ -1855,13 +1855,13 @@ fdinit(struct filedesc *fdp, bool prepfi
FILEDESC_SLOCK(fdp);
newfdp->fd_cdir = fdp->fd_cdir;
if (newfdp->fd_cdir)
-   VREF(newfdp->fd_cdir);
+   vrefact(newfdp->fd_cdir);
newfdp->fd_rdir = fdp->fd_rdir;
if (newfdp->fd_rdir)
-   VREF(newfdp->fd_rdir);
+   vrefact(newfdp->fd_rdir);
newfdp->fd_jdir = fdp->fd_jdir;
if (newfdp->fd_jdir)
-   VREF(newfdp->fd_jdir);
+   vrefact(newfdp->fd_jdir);
 
if (!prepfiles) {
FILEDESC_SUNLOCK(fdp);
@@ -2688,7 +2688,7 @@ _fgetvp(struct thread *td, int fd, int f
error = EINVAL;
} else {
*vpp = fp->f_vnode;
-   vref(*vpp);
+   vrefact(*vpp);
}
fdrop(fp, td);
 
@@ -2727,7 +2727,7 @@ fgetvp_rights(struct thread *td, int fd,
return (EINVAL);
 
*vpp = fp->f_vnode;
-   vref(*vpp);
+   vrefact(*vpp);
filecaps_copy(&fdp->fd_ofiles[fd].fde_caps, havecaps, true);
 
return (0);
@@ -3033,10 +3033,10 @@ pwd_chroot(struct thread *td, struct vno
}
}
oldvp = fdp->fd_rdir;
-   VREF(vp);
+   vrefact(vp);
fdp->fd_rdir = vp;
if (fdp->fd_jdir == NULL) {
-   VREF(vp);
+   vrefact(vp);
fdp->fd_jdir = vp;
}
FILEDESC_XUNLOCK(fdp);
@@ -3084,17 +3084,17 @@ mountcheckdirs(struct vnode *olddp, stru
continue;
FILEDESC_XLOCK(fdp);
if (fdp->fd_cdir == olddp) {
-   vref(newdp);
+   vrefact(newdp);
fdp->fd_cdir = newdp;
nrele++;
}
if (fdp->fd_rdir == olddp) {
-   vref(newdp);
+   vrefact(newdp);
fdp->fd_rdir = newdp;
nrele++;
}
if (fdp->fd_jdir == olddp) {
-   vref(newdp);
+   vrefact(newdp);
fdp->fd_jdir = newdp;
nrele++;
}
@@ -3103,13 +3103,13 @@ mountcheckdirs(struct vnode *olddp, stru
}
sx_sunlock(&allproc_lock);
if (rootvnode == olddp) {
-   vref(newdp);
+   vrefact(newdp);
rootvnode = newdp;
nrele++;
}
mtx_lock(&prison0.pr_mtx);
if (prison0.pr_root == olddp) {
-   vref(newdp);
+   vrefact(newdp);
prison0.pr_root = newdp;
nrele++;
}
@@ -3118,7 +3118,7 @@ mountcheckdirs(struct vnode *olddp, stru
TAILQ_FOREACH(pr, &allprison, pr_list) {
mtx_lock(&pr->pr_mtx);
if (pr->pr_root == olddp) {
-   vref(newdp);
+   vrefact(newdp);
pr->pr_root = newdp;
nrele++;
}
@@ -3445,17 +3445,17 @@ kern_proc_filedesc_out(struct proc *p,  
/* ktrace vnode */
tracevp = p->p_tracevp;
if (tracevp != NULL)
-   vref(tracevp);
+   vrefact(tracevp);
/* text vnode */
textvp = p->p_textvp;
if (textvp != NULL)
-   vref(textvp);
+   vrefact(text

svn commit: r310952 - head/contrib/bsnmp/snmp_mibII

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 12:03:25 2016
New Revision: 310952
URL: https://svnweb.freebsd.org/changeset/base/310952

Log:
  MIB-II: use strlcpy instead of strcpy when copying {descr,name}
  
  This is of course to avoid buffer overruns
  
  The remaining strcpy instance in the module needs to be audited for
  correctness
  
  MFC after:1 week
  Reported by:  Coverity
  CID:  1006827, 1006828

Modified:
  head/contrib/bsnmp/snmp_mibII/mibII.c

Modified: head/contrib/bsnmp/snmp_mibII/mibII.c
==
--- head/contrib/bsnmp/snmp_mibII/mibII.c   Sat Dec 31 11:57:37 2016
(r310951)
+++ head/contrib/bsnmp/snmp_mibII/mibII.c   Sat Dec 31 12:03:25 2016
(r310952)
@@ -204,7 +204,7 @@ mib_if_set_dyn(const char *name)
return;
if ((d = malloc(sizeof(*d))) == NULL)
err(1, NULL);
-   strcpy(d->name, name);
+   strlcpy(d->name, name, sizeof(d->name));
SLIST_INSERT_HEAD(&mibdynif_list, d, link);
 }
 
@@ -774,8 +774,8 @@ mibif_create(u_int sysindex, const char 
memset(ifp->private, 0, sizeof(struct mibif_private));
 
ifp->sysindex = sysindex;
-   strcpy(ifp->name, name);
-   strcpy(ifp->descr, name);
+   strlcpy(ifp->name, name, sizeof(ifp->name));
+   strlcpy(ifp->descr, name, sizeof(ifp->descr));
ifp->spec_oid = oid_zeroDotZero;
 
map = 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: r310950 - head/contrib/bsnmp/snmp_mibII

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 11:50:36 2016
New Revision: 310950
URL: https://svnweb.freebsd.org/changeset/base/310950

Log:
  MIB-II: use strlcpy when copying interface names to .ifr_name
  
  .ifra_name is assumed to be NUL terminated; using strlcpy(3)
  ensures that it's indeed NUL terminated whereas strncpy does
  not.
  
  Tested and verified as follows with a combination of ifconfig,
  snmpget, and snmpset:
  
% ifconfig create lo1 127.0.0.2/8
% SNMPARGS="-v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des -X 
bsnmptest localhost"
% snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
% snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 2
IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
% snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
IF-MIB::ifAdminStatus.4 = INTEGER: down(2)
% snmpset $SNMPARGS IF-MIB::ifAdminStatus.4 i 1
IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
% snmpget $SNMPARGS IF-MIB::ifAdminStatus.4
IF-MIB::ifAdminStatus.4 = INTEGER: up(1)
  
  MFC after:2 weeks
  Reported by:  Coverity
  CID:  1009652-1009656, 1349850

Modified:
  head/contrib/bsnmp/snmp_mibII/mibII.c
  head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c

Modified: head/contrib/bsnmp/snmp_mibII/mibII.c
==
--- head/contrib/bsnmp/snmp_mibII/mibII.c   Sat Dec 31 11:42:57 2016
(r310949)
+++ head/contrib/bsnmp/snmp_mibII/mibII.c   Sat Dec 31 11:50:36 2016
(r310950)
@@ -265,7 +265,7 @@ mib_if_admin(struct mibif *ifp, int up)
 {
struct ifreq ifr;
 
-   strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
+   strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) {
syslog(LOG_ERR, "SIOCGIFFLAGS(%s): %m", ifp->name);
return (-1);
@@ -515,7 +515,7 @@ mib_fetch_ifmib(struct mibif *ifp)
}
 
   out:
-   strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name));
+   strlcpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name));
irr.ifr_buffer.buffer = MIBIF_PRIV(ifp)->alias;
irr.ifr_buffer.length = sizeof(MIBIF_PRIV(ifp)->alias);
if (ioctl(mib_netsock, SIOCGIFDESCR, &irr) == -1) {
@@ -1384,7 +1384,7 @@ siocaifaddr(char *ifname, struct in_addr
struct sockaddr_in *sa;
 
memset(&addreq, 0, sizeof(addreq));
-   strncpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name));
+   strlcpy(addreq.ifra_name, ifname, sizeof(addreq.ifra_name));
 
sa = (struct sockaddr_in *)(void *)&addreq.ifra_addr;
sa->sin_family = AF_INET;
@@ -1414,7 +1414,7 @@ siocdifaddr(const char *ifname, struct i
struct sockaddr_in *sa;
 
memset(&delreq, 0, sizeof(delreq));
-   strncpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name));
+   strlcpy(delreq.ifr_name, ifname, sizeof(delreq.ifr_name));
sa = (struct sockaddr_in *)(void *)&delreq.ifr_addr;
sa->sin_family = AF_INET;
sa->sin_len = sizeof(*sa);
@@ -1433,7 +1433,7 @@ verify_ifa(const char *name, struct mibi
struct sockaddr_in *sa;
 
memset(&req, 0, sizeof(req));
-   strncpy(req.ifr_name, name, sizeof(req.ifr_name));
+   strlcpy(req.ifr_name, name, sizeof(req.ifr_name));
sa = (struct sockaddr_in *)(void *)&req.ifr_addr;
sa->sin_family = AF_INET;
sa->sin_len = sizeof(*sa);

Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
==
--- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.cSat Dec 31 11:42:57 
2016(r310949)
+++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.cSat Dec 31 11:50:36 
2016(r310950)
@@ -77,7 +77,7 @@ ifchange_func(struct snmp_context *ctx _
switch (op) {
 
  case SNMP_DEPOP_COMMIT:
-   strncpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
+   strlcpy(ifr.ifr_name, ifp->name, sizeof(ifr.ifr_name));
if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr) == -1) {
syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name);
return (SNMP_ERR_GENERR);
@@ -95,7 +95,7 @@ ifchange_func(struct snmp_context *ctx _
ifc->rb |= IFRB_FLAGS;
}
if (ifc->rb & IFRB_FLAGS) {
-   strncpy(ifr1.ifr_name, ifp->name, 
sizeof(ifr1.ifr_name));
+   strlcpy(ifr1.ifr_name, ifp->name, 
sizeof(ifr1.ifr_name));
if (ioctl(mib_netsock, SIOCGIFFLAGS, &ifr1) == -1) {
syslog(LOG_ERR, "GIFFLAGS(%s): %m", ifp->name);
return (SNMP_ERR_GENERR);
@@ -116,7 +116,7 @@ ifchange_func(struct snmp_context *ctx _
 
  case SNMP_DEPOP_ROLLBACK:
if (ifc->rb & IFRB_FLAGS) {
-   strncpy(ifr.ifr_name, ifp->name, s

svn commit: r310947 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:30:18 2016
New Revision: 310947
URL: https://svnweb.freebsd.org/changeset/base/310947

Log:
  MFC r310742
  
  sfxge(4): fix common code for non-Siena builds
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:28:47 2016
(r310946)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:30:18 2016
(r310947)
@@ -1105,18 +1105,16 @@ typedef struct efx_nic_cfg_s {
 #if EFSYS_OPT_PHY_STATS
uint64_tenc_phy_stat_mask;
 #endif /* EFSYS_OPT_PHY_STATS */
-#if EFSYS_OPT_SIENA
+#if EFSYS_OPT_MCDI
uint8_t enc_mcdi_mdio_channel;
 #if EFSYS_OPT_PHY_STATS
uint32_tenc_mcdi_phy_stat_mask;
 #endif /* EFSYS_OPT_PHY_STATS */
-#endif /* EFSYS_OPT_SIENA */
-#if (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD)
 #if EFSYS_OPT_MON_STATS
uint32_t*enc_mcdi_sensor_maskp;
uint32_tenc_mcdi_sensor_mask_size;
 #endif /* EFSYS_OPT_MON_STATS */
-#endif /* (EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) */
+#endif /* EFSYS_OPT_MCDI */
 #if EFSYS_OPT_BIST
uint32_tenc_bist_mask;
 #endif /* EFSYS_OPT_BIST */
___
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: r310946 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:28:47 2016
New Revision: 310946
URL: https://svnweb.freebsd.org/changeset/base/310946

Log:
  MFC r310741
  
  sfxge(4): fix misuse of siena_build_filter in common code
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_filter.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_filter.c
==
--- stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:27:58 2016
(r310945)
+++ stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:28:47 2016
(r310946)
@@ -1179,6 +1179,7 @@ siena_filter_restore(
efx_oword_t filter;
int filter_idx;
int state;
+   uint32_t key;
efx_rc_t rc;
 
EFSYS_LOCK(enp->en_eslp, state);
@@ -1192,8 +1193,10 @@ siena_filter_restore(
continue;
 
spec = &sftp->sft_spec[filter_idx];
-   if ((rc = siena_filter_build(&filter, spec)) != 0)
+   if ((key = siena_filter_build(&filter, spec)) == 0) {
+   rc = EINVAL;
goto fail1;
+   }
if ((rc = siena_filter_push_entry(enp,
spec->sfs_type, filter_idx, &filter)) != 0)
goto fail2;
___
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: r310945 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:27:58 2016
New Revision: 310945
URL: https://svnweb.freebsd.org/changeset/base/310945

Log:
  MFC r310719
  
  sfxge(4): cleanup: remove last use of deprecated function flags with 
privilege check
  
  The function flags were changed to mirror the privileges, but
  the privileges are preferred.
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/11/sys/dev/sfxge/common/ef10_phy.c   Sat Dec 31 11:26:29 2016
(r310944)
+++ stable/11/sys/dev/sfxge/common/ef10_phy.c   Sat Dec 31 11:27:58 2016
(r310945)
@@ -278,7 +278,6 @@ fail1:
 ef10_phy_reconfigure(
__inefx_nic_t *enp)
 {
-   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
efx_port_t *epp = &(enp->en_port);
efx_mcdi_req_t req;
uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN,
@@ -286,9 +285,12 @@ ef10_phy_reconfigure(
uint32_t cap_mask;
unsigned int led_mode;
unsigned int speed;
+   boolean_t supported;
efx_rc_t rc;
 
-   if (~encp->enc_func_flags & EFX_NIC_FUNC_LINKCTRL)
+   if ((rc = efx_mcdi_link_control_supported(enp, &supported)) != 0)
+   goto fail1;
+   if (supported == B_FALSE)
goto out;
 
(void) memset(payload, 0, sizeof (payload));
@@ -349,7 +351,7 @@ ef10_phy_reconfigure(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail1;
+   goto fail2;
}
 
/* And set the blink mode */
@@ -385,11 +387,13 @@ ef10_phy_reconfigure(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail2;
+   goto fail3;
}
 out:
return (0);
 
+fail3:
+   EFSYS_PROBE(fail3);
 fail2:
EFSYS_PROBE(fail2);
 fail1:
___
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: r310944 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:26:29 2016
New Revision: 310944
URL: https://svnweb.freebsd.org/changeset/base/310944

Log:
  MFC r310717
  
  sfxge(4): move BIST methods from hunt_phy.c to ef10_phy.c
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
  stable/11/sys/dev/sfxge/common/ef10_phy.c
  stable/11/sys/dev/sfxge/common/hunt_impl.h
  stable/11/sys/dev/sfxge/common/hunt_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:24:59 2016
(r310943)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:26:29 2016
(r310944)
@@ -602,6 +602,34 @@ ef10_phy_stats_update(
 
 #endif /* EFSYS_OPT_PHY_STATS */
 
+#if EFSYS_OPT_BIST
+
+extern __checkReturn   efx_rc_t
+ef10_bist_enable_offline(
+   __inefx_nic_t *enp);
+
+extern __checkReturn   efx_rc_t
+ef10_bist_start(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type);
+
+extern __checkReturn   efx_rc_t
+ef10_bist_poll(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type,
+   __out   efx_bist_result_t *resultp,
+   __out_opt __drv_when(count > 0, __notnull)
+   uint32_t*value_maskp,
+   __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+   unsigned long   *valuesp,
+   __insize_t count);
+
+extern void
+ef10_bist_stop(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type);
+
+#endif /* EFSYS_OPT_BIST */
 
 /* TX */
 

Modified: stable/11/sys/dev/sfxge/common/ef10_phy.c
==
--- stable/11/sys/dev/sfxge/common/ef10_phy.c   Sat Dec 31 11:24:59 2016
(r310943)
+++ stable/11/sys/dev/sfxge/common/ef10_phy.c   Sat Dec 31 11:26:29 2016
(r310944)
@@ -474,4 +474,157 @@ ef10_phy_stats_update(
 
 #endif /* EFSYS_OPT_PHY_STATS */
 
+#if EFSYS_OPT_BIST
+
+   __checkReturn   efx_rc_t
+ef10_bist_enable_offline(
+   __inefx_nic_t *enp)
+{
+   efx_rc_t rc;
+
+   if ((rc = efx_mcdi_bist_enable_offline(enp)) != 0)
+   goto fail1;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
+   __checkReturn   efx_rc_t
+ef10_bist_start(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type)
+{
+   efx_rc_t rc;
+
+   if ((rc = efx_mcdi_bist_start(enp, type)) != 0)
+   goto fail1;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+   return (rc);
+}
+
+   __checkReturn   efx_rc_t
+ef10_bist_poll(
+   __inefx_nic_t *enp,
+   __inefx_bist_type_t type,
+   __out   efx_bist_result_t *resultp,
+   __out_opt __drv_when(count > 0, __notnull)
+   uint32_t *value_maskp,
+   __out_ecount_opt(count) __drv_when(count > 0, __notnull)
+   unsigned long *valuesp,
+   __insize_t count)
+{
+   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+   efx_mcdi_req_t req;
+   uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN,
+   MCDI_CTL_SDU_LEN_MAX)];
+   uint32_t value_mask = 0;
+   uint32_t result;
+   efx_rc_t rc;
+
+   _NOTE(ARGUNUSED(type))
+
+   (void) memset(payload, 0, sizeof (payload));
+   req.emr_cmd = MC_CMD_POLL_BIST;
+   req.emr_in_buf = payload;
+   req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN;
+   req.emr_out_buf = payload;
+   req.emr_out_length = MCDI_CTL_SDU_LEN_MAX;
+
+   efx_mcdi_execute(enp, &req);
+
+   if (req.emr_rc != 0) {
+   rc = req.emr_rc;
+   goto fail1;
+   }
+
+   if (req.emr_out_length_used < MC_CMD_POLL_BIST_OUT_RESULT_OFST + 4) {
+   rc = EMSGSIZE;
+   goto fail2;
+   }
+
+   if (count > 0)
+   (void) memset(valuesp, '\0', count * sizeof (unsigned long));
+
+   result = MCDI_OUT_DWORD(req, POLL_BIST_OUT_RESULT);
+
+   if (result == MC_CMD_POLL_BIST_FAILED &&
+   req.emr_out_length >= MC_CMD_POLL_BIST_OUT_MEM_LEN &&
+   count > EFX_BIST_MEM_ECC_FATAL) {
+   if (valuesp != NULL) {
+   valuesp[EFX_BIST_MEM_TEST] =
+   MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_TEST);
+   valuesp[EFX_BIST_MEM_ADDR] =
+   MCDI_OUT_DWORD(req, POLL_BIST_OUT_MEM_ADDR);
+   valuesp[EFX_BIST_MEM_BUS] =
+ 

svn commit: r310943 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:24:59 2016
New Revision: 310943
URL: https://svnweb.freebsd.org/changeset/base/310943

Log:
  MFC r310716
  
  sfxge(4): add UEFI ROM support to the common code
  
  Submitted by:   Andrew Lee 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/efx.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:24:12 2016
(r310942)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:24:59 2016
(r310943)
@@ -2175,7 +2175,11 @@ static ef10_parttbl_entry_t medford_part
{NVRAM_PARTITION_TYPE_LICENSE, 1, EFX_NVRAM_LICENSE},
{NVRAM_PARTITION_TYPE_LICENSE, 2, EFX_NVRAM_LICENSE},
{NVRAM_PARTITION_TYPE_LICENSE, 3, EFX_NVRAM_LICENSE},
-   {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE}
+   {NVRAM_PARTITION_TYPE_LICENSE, 4, EFX_NVRAM_LICENSE},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  1, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  2, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  3, EFX_NVRAM_UEFIROM},
+   {NVRAM_PARTITION_TYPE_EXPANSION_UEFI,  4, EFX_NVRAM_UEFIROM}
 };
 
 static __checkReturn   efx_rc_t

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:24:12 2016
(r310942)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:24:59 2016
(r310943)
@@ -1311,6 +1311,7 @@ typedef enum efx_nvram_type_e {
EFX_NVRAM_FPGA_BACKUP,
EFX_NVRAM_DYNAMIC_CFG,
EFX_NVRAM_LICENSE,
+   EFX_NVRAM_UEFIROM,
EFX_NVRAM_NTYPES,
 } efx_nvram_type_t;
 
___
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: r310942 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 11:24:12 2016
New Revision: 310942
URL: https://svnweb.freebsd.org/changeset/base/310942

Log:
  Unbreak the build by passing the string to strdup, not its length
  
  MFC after:1 week
  X-MFC with:   r310931
  Pointyhat to: ngie

Modified:
  head/contrib/bsnmp/lib/snmpclient.c

Modified: head/contrib/bsnmp/lib/snmpclient.c
==
--- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:23:43 2016
(r310941)
+++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:24:12 2016
(r310942)
@@ -1945,7 +1945,7 @@ snmp_parse_server(struct snmp_client *sc
} else if (p > s) {
/* host */
free(sc->chost);
-   if ((sc->chost = strdup(strlen(s))) == NULL) {
+   if ((sc->chost = strdup(s)) == NULL) {
seterr(sc, "%s", strerror(errno));
return (-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: r310941 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:23:43 2016
New Revision: 310941
URL: https://svnweb.freebsd.org/changeset/base/310941

Log:
  MFC r310715
  
  sfxge(4): fix GET_RXDP_CONFIG usage for multi-PF on Medford
  
  On Medford, using MC_CMD_GET_RXDP_CONFIG to query the RX end
  padding setting is in the ADMIN group, and so fails for
  unprivileged functions. In that case, assume the largest size
  supported by Medford hardware (256bytes) to prevent overrun.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/medford_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/medford_nic.c
==
--- stable/11/sys/dev/sfxge/common/medford_nic.cSat Dec 31 11:23:03 
2016(r310940)
+++ stable/11/sys/dev/sfxge/common/medford_nic.cSat Dec 31 11:23:43 
2016(r310941)
@@ -289,8 +289,13 @@ medford_board_cfg(
encp->enc_rx_buf_align_start = 1;
 
/* Get the RX DMA end padding alignment configuration */
-   if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0)
-   goto fail11;
+   if ((rc = efx_mcdi_get_rxdp_config(enp, &end_padding)) != 0) {
+   if (rc != EACCES)
+   goto fail11;
+
+   /* Assume largest tail padding size supported by hardware */
+   end_padding = 256;
+   }
encp->enc_rx_buf_align_end = end_padding;
 
/* Alignment for WPTR updates */
___
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: r310940 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:23:03 2016
New Revision: 310940
URL: https://svnweb.freebsd.org/changeset/base/310940

Log:
  MFC r310714
  
  sfxge(4): support Medford bootcfg partition layout in common code
  
  For Siena and Huntington, the per-port bootcfg (aka expcfg) is
  stored in a dedicated 4Kbyte partition for each port.
  
  For Medford, the per-PF bootcfg is stored in a 2Kbyte sector
  within a single shared partition. Update the common code to support
  the new bootcfg layout.
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_bootcfg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/11/sys/dev/sfxge/common/efx_bootcfg.cSat Dec 31 11:21:49 
2016(r310939)
+++ stable/11/sys/dev/sfxge/common/efx_bootcfg.cSat Dec 31 11:23:03 
2016(r310940)
@@ -38,14 +38,69 @@ __FBSDID("$FreeBSD$");
 
 /*
  * Maximum size of BOOTCFG block across all nics as understood by SFCgPXE.
- * A multiple of 0x100 so trailing 0xff characters don't contrinbute to the
- * checksum.
+ * NOTE: This is larger than the Medford per-PF bootcfg sector.
  */
 #defineBOOTCFG_MAX_SIZE 0x1000
 
 #defineDHCP_END ((uint8_t)0xff)
 #defineDHCP_PAD ((uint8_t)0)
 
+
+/* Report size and offset of bootcfg sector in NVRAM partition. */
+static __checkReturn   efx_rc_t
+efx_bootcfg_sector(
+   __inefx_nic_t *enp,
+   __out   size_t *offsetp,
+   __out   size_t *max_sizep)
+{
+   size_t max_size;
+   size_t offset;
+   int rc;
+
+   switch (enp->en_family) {
+#if EFSYS_OPT_SIENA
+   case EFX_FAMILY_SIENA:
+   max_size = BOOTCFG_MAX_SIZE;
+   offset = 0;
+   break;
+#endif /* EFSYS_OPT_SIENA */
+
+#if EFSYS_OPT_HUNTINGTON
+   case EFX_FAMILY_HUNTINGTON:
+   max_size = BOOTCFG_MAX_SIZE;
+   offset = 0;
+   break;
+#endif /* EFSYS_OPT_HUNTINGTON */
+
+#if EFSYS_OPT_MEDFORD
+   case EFX_FAMILY_MEDFORD: {
+   efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+
+   /* Shared partition (array indexed by PF) */
+   max_size = 0x0800;
+   offset = max_size * encp->enc_pf;
+   break;
+   }
+#endif /* EFSYS_OPT_MEDFORD */
+
+   default:
+   EFSYS_ASSERT(0);
+   rc = ENOTSUP;
+   goto fail1;
+   }
+   EFSYS_ASSERT3U(max_size, <=, BOOTCFG_MAX_SIZE);
+
+   *offsetp = offset;
+   *max_sizep = max_size;
+
+   return (0);
+
+fail1:
+   EFSYS_PROBE1(fail1, efx_rc_t, rc);
+   return (rc);
+}
+
+
 static __checkReturn   uint8_t
 efx_bootcfg_csum(
__inefx_nic_t *enp,
@@ -136,40 +191,54 @@ efx_bootcfg_read(
 {
uint8_t *payload = NULL;
size_t used_bytes;
+   size_t partn_length;
size_t sector_length;
+   size_t sector_offset;
efx_rc_t rc;
 
-   rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, §or_length);
+   rc = efx_nvram_size(enp, EFX_NVRAM_BOOTROM_CFG, &partn_length);
if (rc != 0)
goto fail1;
 
+   /* The bootcfg sector may be stored in a (larger) shared partition */
+   rc = efx_bootcfg_sector(enp, §or_offset, §or_length);
+   if (rc != 0)
+   goto fail2;
+
+   if (sector_length > BOOTCFG_MAX_SIZE)
+   sector_length = BOOTCFG_MAX_SIZE;
+
+   if (sector_offset + sector_length > partn_length) {
+   /* Partition is too small */
+   rc = EFBIG;
+   goto fail3;
+   }
+
/*
-* We need to read the entire BOOTCFG area to ensure we read all the
+* We need to read the entire BOOTCFG sector to ensure we read all the
 * tags, because legacy bootcfg sectors are not guaranteed to end with
 * a DHCP_END character. If the user hasn't supplied a sufficiently
 * large buffer then use our own buffer.
 */
-   if (sector_length > BOOTCFG_MAX_SIZE)
-   sector_length = BOOTCFG_MAX_SIZE;
if (sector_length > size) {
EFSYS_KMEM_ALLOC(enp->en_esip, sector_length, payload);
if (payload == NULL) {
rc = ENOMEM;
-   goto fail2;
+   goto fail4;
}
} else
payload = (uint8_t *)data;
 
if ((rc = efx_nvram_rw_start(enp, EFX_NVRAM_BOOTROM_CFG, NULL)) != 0)
-   goto fail3;
+   goto fail5;
 
-   rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, 0,
+   rc = efx_nvram_read_chunk(enp, EFX_NVRAM_BOOTROM_CFG, sector_offset,
(caddr_t)payload, sector_length)

svn commit: r310939 - in stable/11/sys/dev/sfxge: . common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:21:49 2016
New Revision: 310939
URL: https://svnweb.freebsd.org/changeset/base/310939

Log:
  MFC r310713
  
  sfxge(4): add possibility to control event queue performance profile
  
  It is ignored on SFN5xxx/6xxx (aka Siena).
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/ef10_impl.h
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_ev.c
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/sfxge_ev.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 11:19:40 2016
(r310938)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 11:21:49 2016
(r310939)
@@ -140,6 +140,7 @@ efx_mcdi_init_evq(
__insize_t nevs,
__inuint32_t irq,
__inuint32_t us,
+   __inuint32_t flags,
__inboolean_t low_latency)
 {
efx_mcdi_req_t req;
@@ -178,7 +179,20 @@ efx_mcdi_init_evq(
 * So always enable RX and TX event batching, and enable event cut
 * through if we want low latency operation.
 */
-   ev_cut_through = low_latency ? 1 : 0;
+   switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) {
+   case EFX_EVQ_FLAGS_TYPE_AUTO:
+   ev_cut_through = low_latency ? 1 : 0;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_THROUGHPUT:
+   ev_cut_through = 0;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY:
+   ev_cut_through = 1;
+   break;
+   default:
+   rc = EINVAL;
+   goto fail2;
+   }
MCDI_IN_POPULATE_DWORD_6(req, INIT_EVQ_IN_FLAGS,
INIT_EVQ_IN_FLAG_INTERRUPTING, 1,
INIT_EVQ_IN_FLAG_RPTR_DOS, 0,
@@ -197,7 +211,7 @@ efx_mcdi_init_evq(
unsigned int ticks;
 
if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
-   goto fail2;
+   goto fail3;
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_IN_TMR_MODE,
MC_CMD_INIT_EVQ_IN_TMR_INT_HLDOFF);
@@ -225,18 +239,20 @@ efx_mcdi_init_evq(
 
if (req.emr_rc != 0) {
rc = req.emr_rc;
-   goto fail3;
+   goto fail4;
}
 
if (req.emr_out_length_used < MC_CMD_INIT_EVQ_OUT_LEN) {
rc = EMSGSIZE;
-   goto fail4;
+   goto fail5;
}
 
/* NOTE: ignore the returned IRQ param as firmware does not set it. */
 
return (0);
 
+fail5:
+   EFSYS_PROBE(fail5);
 fail4:
EFSYS_PROBE(fail4);
 fail3:
@@ -257,12 +273,14 @@ efx_mcdi_init_evq_v2(
__inefsys_mem_t *esmp,
__insize_t nevs,
__inuint32_t irq,
-   __inuint32_t us)
+   __inuint32_t us,
+   __inuint32_t flags)
 {
efx_mcdi_req_t req;
uint8_t payload[
MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)),
MC_CMD_INIT_EVQ_V2_OUT_LEN)];
+   unsigned int evq_type;
efx_qword_t *dma_addr;
uint64_t addr;
int npages;
@@ -286,11 +304,25 @@ efx_mcdi_init_evq_v2(
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_INSTANCE, instance);
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_IRQ_NUM, irq);
 
+   switch (flags & EFX_EVQ_FLAGS_TYPE_MASK) {
+   case EFX_EVQ_FLAGS_TYPE_AUTO:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_THROUGHPUT:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_THROUGHPUT;
+   break;
+   case EFX_EVQ_FLAGS_TYPE_LOW_LATENCY:
+   evq_type = MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_LOW_LATENCY;
+   break;
+   default:
+   rc = EINVAL;
+   goto fail2;
+   }
MCDI_IN_POPULATE_DWORD_4(req, INIT_EVQ_V2_IN_FLAGS,
INIT_EVQ_V2_IN_FLAG_INTERRUPTING, 1,
INIT_EVQ_V2_IN_FLAG_RPTR_DOS, 0,
INIT_EVQ_V2_IN_FLAG_INT_ARMD, 0,
-   INIT_EVQ_V2_IN_FLAG_TYPE, MC_CMD_INIT_EVQ_V2_IN_FLAG_TYPE_AUTO);
+   INIT_EVQ_V2_IN_FLAG_TYPE, evq_type);
 
/* If the value is zero then disable the timer */
if (us == 0) {
@@ -302,7 +334,7 @@ efx_mcdi_init_evq_v2(
unsigned int ticks;
 
if ((rc = efx_ev_usecs_to_ticks(enp, us, &ticks)) != 0)
-   goto fail2;
+   goto fail3;
 
MCDI_IN_SET_DWORD(req, INIT_EVQ_V2_IN_TMR_MODE,
MC_CMD_INIT_EVQ_V2_IN_TMR_INT_HLDOFF);
@@ -330,12 +362,12 @@ efx_mcdi_init_evq_v2(
 
if (r

svn commit: r310938 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:19:40 2016
New Revision: 310938
URL: https://svnweb.freebsd.org/changeset/base/310938

Log:
  MFC r310709
  
  sfxge(4): fix invalid type of eft_unicst_filter_count
  
  Found by clang when boolean_t is defined as bool for DPDK PMD.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:18:22 2016
(r310937)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:19:40 2016
(r310938)
@@ -954,7 +954,7 @@ typedef struct ef10_filter_table_s {
boolean_t   eft_using_rss;
uint32_teft_unicst_filter_indexes[
EFX_EF10_FILTER_UNICAST_FILTERS_MAX];
-   boolean_t   eft_unicst_filter_count;
+   uint32_teft_unicst_filter_count;
uint32_teft_mulcst_filter_indexes[
EFX_EF10_FILTER_MULTICAST_FILTERS_MAX];
uint32_teft_mulcst_filter_count;
___
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: r310937 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:18:22 2016
New Revision: 310937
URL: https://svnweb.freebsd.org/changeset/base/310937

Log:
  MFC r310708
  
  sfxge(4): do not initialize enumerated type variable to another type
  
  Fix build warning generated by ICC.
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_nic.c
==
--- stable/11/sys/dev/sfxge/common/efx_nic.cSat Dec 31 11:17:43 2016
(r310936)
+++ stable/11/sys/dev/sfxge/common/efx_nic.cSat Dec 31 11:18:22 2016
(r310937)
@@ -556,7 +556,7 @@ efx_nic_destroy(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, ==, 0);
 
-   enp->en_family = 0;
+   enp->en_family = EFX_FAMILY_INVALID;
enp->en_esip = NULL;
enp->en_esbp = NULL;
enp->en_eslp = 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: r310936 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:17:43 2016
New Revision: 310936
URL: https://svnweb.freebsd.org/changeset/base/310936

Log:
  MFC r310704
  
  sfxge(4): translate MC_CMD_ERR_ERANGE to host errno value
  
  This is needed because MCDI command MC_CMD_REKEY can return
  MC_CMD_ERR_ERANGE.
  
  Submitted by:   Tom Millington 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c
==
--- stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:16:35 2016
(r310935)
+++ stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:17:43 2016
(r310936)
@@ -646,6 +646,8 @@ efx_mcdi_request_errcode(
case MC_CMD_ERR_ENOSPC:
return (ENOSPC);
 #endif
+   case MC_CMD_ERR_ERANGE:
+   return (ERANGE);
 
case MC_CMD_ERR_ALLOC_FAIL:
return (ENOMEM);
___
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: r310935 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:16:35 2016
New Revision: 310935
URL: https://svnweb.freebsd.org/changeset/base/310935

Log:
  MFC r310699
  
  sfxge(4): rename hunt_bist_* methods to ef10_bist_*
  
  Submitted by:   Mark Spender 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_phy.c
  stable/11/sys/dev/sfxge/common/hunt_impl.h
  stable/11/sys/dev/sfxge/common/hunt_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_phy.c
==
--- stable/11/sys/dev/sfxge/common/efx_phy.cSat Dec 31 11:15:25 2016
(r310934)
+++ stable/11/sys/dev/sfxge/common/efx_phy.cSat Dec 31 11:16:35 2016
(r310935)
@@ -65,11 +65,10 @@ static const efx_phy_ops_t  __efx_phy_ef1
ef10_phy_stats_update,  /* epo_stats_update */
 #endif /* EFSYS_OPT_PHY_STATS */
 #if EFSYS_OPT_BIST
-   /* FIXME: Are these BIST methods appropriate for Medford? */
-   hunt_bist_enable_offline,   /* epo_bist_enable_offline */
-   hunt_bist_start,/* epo_bist_start */
-   hunt_bist_poll, /* epo_bist_poll */
-   hunt_bist_stop, /* epo_bist_stop */
+   ef10_bist_enable_offline,   /* epo_bist_enable_offline */
+   ef10_bist_start,/* epo_bist_start */
+   ef10_bist_poll, /* epo_bist_poll */
+   ef10_bist_stop, /* epo_bist_stop */
 #endif /* EFSYS_OPT_BIST */
 };
 #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */

Modified: stable/11/sys/dev/sfxge/common/hunt_impl.h
==
--- stable/11/sys/dev/sfxge/common/hunt_impl.h  Sat Dec 31 11:15:25 2016
(r310934)
+++ stable/11/sys/dev/sfxge/common/hunt_impl.h  Sat Dec 31 11:16:35 2016
(r310935)
@@ -75,16 +75,16 @@ hunt_board_cfg(
 #if EFSYS_OPT_BIST
 
 extern __checkReturn   efx_rc_t
-hunt_bist_enable_offline(
+ef10_bist_enable_offline(
__inefx_nic_t *enp);
 
 extern __checkReturn   efx_rc_t
-hunt_bist_start(
+ef10_bist_start(
__inefx_nic_t *enp,
__inefx_bist_type_t type);
 
 extern __checkReturn   efx_rc_t
-hunt_bist_poll(
+ef10_bist_poll(
__inefx_nic_t *enp,
__inefx_bist_type_t type,
__out   efx_bist_result_t *resultp,
@@ -95,7 +95,7 @@ hunt_bist_poll(
__insize_t count);
 
 extern void
-hunt_bist_stop(
+ef10_bist_stop(
__inefx_nic_t *enp,
__inefx_bist_type_t type);
 

Modified: stable/11/sys/dev/sfxge/common/hunt_phy.c
==
--- stable/11/sys/dev/sfxge/common/hunt_phy.c   Sat Dec 31 11:15:25 2016
(r310934)
+++ stable/11/sys/dev/sfxge/common/hunt_phy.c   Sat Dec 31 11:16:35 2016
(r310935)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 #if EFSYS_OPT_BIST
 
__checkReturn   efx_rc_t
-hunt_bist_enable_offline(
+ef10_bist_enable_offline(
__inefx_nic_t *enp)
 {
efx_rc_t rc;
@@ -56,7 +56,7 @@ fail1:
 }
 
__checkReturn   efx_rc_t
-hunt_bist_start(
+ef10_bist_start(
__inefx_nic_t *enp,
__inefx_bist_type_t type)
 {
@@ -74,7 +74,7 @@ fail1:
 }
 
__checkReturn   efx_rc_t
-hunt_bist_poll(
+ef10_bist_poll(
__inefx_nic_t *enp,
__inefx_bist_type_t type,
__out   efx_bist_result_t *resultp,
@@ -179,11 +179,11 @@ fail1:
 }
 
void
-hunt_bist_stop(
+ef10_bist_stop(
__inefx_nic_t *enp,
__inefx_bist_type_t type)
 {
-   /* There is no way to stop BIST on Huntinton. */
+   /* There is no way to stop BIST on EF10. */
_NOTE(ARGUNUSED(enp, type))
 }
 
___
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: r310934 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:15:25 2016
New Revision: 310934
URL: https://svnweb.freebsd.org/changeset/base/310934

Log:
  MFC r310696
  
  sfxge(4): cleanup: improve prefast annotations
  
  Submitted by:   Andy Moreton 
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
  stable/11/sys/dev/sfxge/common/ef10_mcdi.c
  stable/11/sys/dev/sfxge/common/siena_impl.h
  stable/11/sys/dev/sfxge/common/siena_mcdi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:14:03 2016
(r310933)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 11:15:25 2016
(r310934)
@@ -296,11 +296,11 @@ ef10_mcdi_fini(
 
 extern void
 ef10_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len);
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len);
 
 extern __checkReturn   boolean_t
 ef10_mcdi_poll_response(

Modified: stable/11/sys/dev/sfxge/common/ef10_mcdi.c
==
--- stable/11/sys/dev/sfxge/common/ef10_mcdi.c  Sat Dec 31 11:14:03 2016
(r310933)
+++ stable/11/sys/dev/sfxge/common/ef10_mcdi.c  Sat Dec 31 11:15:25 2016
(r310934)
@@ -110,11 +110,11 @@ ef10_mcdi_fini(
 
void
 ef10_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len)
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len)
 {
const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp;
efsys_mem_t *esmp = emtp->emt_dma_mem;

Modified: stable/11/sys/dev/sfxge/common/siena_impl.h
==
--- stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:14:03 2016
(r310933)
+++ stable/11/sys/dev/sfxge/common/siena_impl.h Sat Dec 31 11:15:25 2016
(r310934)
@@ -96,11 +96,11 @@ siena_mcdi_init(
 
 extern void
 siena_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len);
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len);
 
 extern __checkReturn   boolean_t
 siena_mcdi_poll_response(

Modified: stable/11/sys/dev/sfxge/common/siena_mcdi.c
==
--- stable/11/sys/dev/sfxge/common/siena_mcdi.c Sat Dec 31 11:14:03 2016
(r310933)
+++ stable/11/sys/dev/sfxge/common/siena_mcdi.c Sat Dec 31 11:15:25 2016
(r310934)
@@ -54,11 +54,11 @@ __FBSDID("$FreeBSD$");
 
void
 siena_mcdi_send_request(
-   __inefx_nic_t *enp,
-   __invoid *hdrp,
-   __insize_t hdr_len,
-   __invoid *sdup,
-   __insize_t sdu_len)
+   __inefx_nic_t *enp,
+   __in_bcount(hdr_len)void *hdrp,
+   __insize_t hdr_len,
+   __in_bcount(sdu_len)void *sdup,
+   __insize_t sdu_len)
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
efx_dword_t dword;
___
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: r310933 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:14:03 2016
New Revision: 310933
URL: https://svnweb.freebsd.org/changeset/base/310933

Log:
  MFC r310695
  
  sfxge(4): fix defined-but-not-used warning if neither VPD nor NVRAM opt
  enabled
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/siena_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/siena_nic.c
==
--- stable/11/sys/dev/sfxge/common/siena_nic.c  Sat Dec 31 11:13:23 2016
(r310932)
+++ stable/11/sys/dev/sfxge/common/siena_nic.c  Sat Dec 31 11:14:03 2016
(r310933)
@@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_SIENA
 
+#if EFSYS_OPT_VPD || EFSYS_OPT_NVRAM
+
 static __checkReturn   efx_rc_t
 siena_nic_get_partn_mask(
__inefx_nic_t *enp,
@@ -78,6 +80,8 @@ fail1:
return (rc);
 }
 
+#endif /* EFSYS_OPT_VPD || EFSYS_OPT_NVRAM */
+
 static __checkReturn   efx_rc_t
 siena_board_cfg(
__inefx_nic_t *enp)
___
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: r310932 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:13:23 2016
New Revision: 310932
URL: https://svnweb.freebsd.org/changeset/base/310932

Log:
  MFC r310694
  
  sfxge(4): cleanup: add missing spaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_mcdi.c
  stable/11/sys/dev/sfxge/common/medford_nic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:13:00 2016
(r310931)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:13:23 2016
(r310932)
@@ -124,7 +124,7 @@ typedef struct efx_tx_ops_s {
void(*etxo_qenable)(efx_txq_t *);
efx_rc_t(*etxo_qpio_enable)(efx_txq_t *);
void(*etxo_qpio_disable)(efx_txq_t *);
-   efx_rc_t(*etxo_qpio_write)(efx_txq_t *,uint8_t *, size_t,
+   efx_rc_t(*etxo_qpio_write)(efx_txq_t *, uint8_t *, size_t,
   size_t);
efx_rc_t(*etxo_qpio_post)(efx_txq_t *, size_t, unsigned int,
   unsigned int *);
@@ -801,7 +801,7 @@ struct efx_txq_s {
 #else
 #defineEFX_CHECK_REG(_enp, _reg) do {  
\
_NOTE(CONSTANTCONDITION)\
-   } while(B_FALSE)
+   } while (B_FALSE)
 #endif
 
 #defineEFX_BAR_READD(_enp, _reg, _edp, _lock)  
\

Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c
==
--- stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:13:00 2016
(r310931)
+++ stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:13:23 2016
(r310932)
@@ -1765,7 +1765,7 @@ efx_mcdi_mac_stats(
MAC_STATS_IN_PERIODIC_CHANGE, enable | events | disable,
MAC_STATS_IN_PERIODIC_ENABLE, enable | events,
MAC_STATS_IN_PERIODIC_NOEVENT, !events,
-   MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000: 0);
+   MAC_STATS_IN_PERIOD_MS, (enable | events) ? 1000 : 0);
 
if (esmp != NULL) {
int bytes = MC_CMD_MAC_NSTATS * sizeof (uint64_t);

Modified: stable/11/sys/dev/sfxge/common/medford_nic.c
==
--- stable/11/sys/dev/sfxge/common/medford_nic.cSat Dec 31 11:13:00 
2016(r310931)
+++ stable/11/sys/dev/sfxge/common/medford_nic.cSat Dec 31 11:13:23 
2016(r310932)
@@ -66,7 +66,7 @@ efx_mcdi_get_rxdp_config(
/* RX DMA end padding is disabled */
end_padding = 0;
} else {
-   switch(MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
+   switch (MCDI_OUT_DWORD_FIELD(req, GET_RXDP_CONFIG_OUT_DATA,
GET_RXDP_CONFIG_OUT_PAD_HOST_LEN)) {
case MC_CMD_SET_RXDP_CONFIG_IN_PAD_HOST_64:
end_padding = 64;
___
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: r310931 - head/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 11:13:00 2016
New Revision: 310931
URL: https://svnweb.freebsd.org/changeset/base/310931

Log:
  Use strdup in snmp_parse_server(..) when possible instead of malloc+strcpy
  
  This simplifies the code and mutes a Coverity warning about sc->cport being
  improperly allocated
  
  Reported by:  Coverity
  CID:  1018247
  MFC after:1 week

Modified:
  head/contrib/bsnmp/lib/snmpclient.c

Modified: head/contrib/bsnmp/lib/snmpclient.c
==
--- head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:12:26 2016
(r310930)
+++ head/contrib/bsnmp/lib/snmpclient.c Sat Dec 31 11:13:00 2016
(r310931)
@@ -1937,20 +1937,18 @@ snmp_parse_server(struct snmp_client *sc
}
/* port */
free(sc->cport);
-   if ((sc->cport = malloc(strlen(p + 1) + 1)) == NULL) {
+   if ((sc->cport = strdup(p + 1)) == NULL) {
seterr(sc, "%s", strerror(errno));
return (-1);
}
-   strcpy(sc->cport, p + 1);
 
} else if (p > s) {
/* host */
free(sc->chost);
-   if ((sc->chost = malloc(strlen(s) + 1)) == NULL) {
+   if ((sc->chost = strdup(strlen(s))) == NULL) {
seterr(sc, "%s", strerror(errno));
return (-1);
}
-   strcpy(sc->chost, s);
}
return (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: r310930 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:12:26 2016
New Revision: 310930
URL: https://svnweb.freebsd.org/changeset/base/310930

Log:
  MFC r310693
  
  sfxge(4): cleanup: avoid unspecified unsigned
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/ef10_filter.c
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/efx_ev.c
  stable/11/sys/dev/sfxge/common/efx_filter.c
  stable/11/sys/dev/sfxge/common/siena_vpd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 11:11:04 2016
(r310929)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 11:12:26 2016
(r310930)
@@ -990,7 +990,7 @@ ef10_ev_mcdi(
__in_optvoid *arg)
 {
efx_nic_t *enp = eep->ee_enp;
-   unsigned code;
+   unsigned int code;
boolean_t should_abort = B_FALSE;
 
EFX_EV_QSTAT_INCR(eep, EV_MCDI_RESPONSE);

Modified: stable/11/sys/dev/sfxge/common/ef10_filter.c
==
--- stable/11/sys/dev/sfxge/common/ef10_filter.cSat Dec 31 11:11:04 
2016(r310929)
+++ stable/11/sys/dev/sfxge/common/ef10_filter.cSat Dec 31 11:12:26 
2016(r310930)
@@ -1246,7 +1246,7 @@ ef10_filter_reconfigure(
efx_nic_cfg_t *encp = &enp->en_nic_cfg;
ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table;
efx_filter_flag_t filter_flags;
-   unsigned i;
+   unsigned int i;
efx_rc_t all_unicst_rc = 0;
efx_rc_t all_mulcst_rc = 0;
efx_rc_t rc;

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:11:04 2016
(r310929)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 11:12:26 2016
(r310930)
@@ -772,7 +772,7 @@ ef10_nvram_buffer_create(
struct tlv_partition_header header;
struct tlv_partition_trailer trailer;
 
-   unsigned min_buf_size = sizeof (struct tlv_partition_header) +
+   unsigned int min_buf_size = sizeof (struct tlv_partition_header) +
sizeof (struct tlv_partition_trailer);
if (partn_size < min_buf_size) {
rc = EINVAL;

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==
--- stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:11:04 2016
(r310929)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:12:26 2016
(r310930)
@@ -953,7 +953,7 @@ siena_ev_mcdi(
__in_optvoid *arg)
 {
efx_nic_t *enp = eep->ee_enp;
-   unsigned code;
+   unsigned int code;
boolean_t should_abort = B_FALSE;
 
EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);

Modified: stable/11/sys/dev/sfxge/common/efx_filter.c
==
--- stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:11:04 2016
(r310929)
+++ stable/11/sys/dev/sfxge/common/efx_filter.c Sat Dec 31 11:12:26 2016
(r310930)
@@ -970,7 +970,7 @@ siena_filter_search(
__out   int *filter_index,
__out   unsigned int *depth_required)
 {
-   unsigned hash, incr, filter_idx, depth;
+   unsigned int hash, incr, filter_idx, depth;
 
hash = siena_filter_tbl_hash(key);
incr = siena_filter_tbl_increment(key);

Modified: stable/11/sys/dev/sfxge/common/siena_vpd.c
==
--- stable/11/sys/dev/sfxge/common/siena_vpd.c  Sat Dec 31 11:11:04 2016
(r310929)
+++ stable/11/sys/dev/sfxge/common/siena_vpd.c  Sat Dec 31 11:12:26 2016
(r310930)
@@ -160,7 +160,7 @@ siena_vpd_init(
 {
efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
caddr_t svpd = NULL;
-   unsigned partn;
+   unsigned int partn;
size_t size = 0;
efx_rc_t rc;
 
___
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: r310929 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:11:04 2016
New Revision: 310929
URL: https://svnweb.freebsd.org/changeset/base/310929

Log:
  MFC r310692
  
  sfxge(4): enclose macro complex value in parenthesis
  
  Found by DPDK checkpatches.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_bootcfg.c
  stable/11/sys/dev/sfxge/common/efx_types.h
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_bootcfg.c
==
--- stable/11/sys/dev/sfxge/common/efx_bootcfg.cSat Dec 31 11:10:01 
2016(r310928)
+++ stable/11/sys/dev/sfxge/common/efx_bootcfg.cSat Dec 31 11:11:04 
2016(r310929)
@@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$");
  */
 #defineBOOTCFG_MAX_SIZE 0x1000
 
-#defineDHCP_END (uint8_t)0xff
-#defineDHCP_PAD (uint8_t)0
+#defineDHCP_END ((uint8_t)0xff)
+#defineDHCP_PAD ((uint8_t)0)
 
 static __checkReturn   uint8_t
 efx_bootcfg_csum(

Modified: stable/11/sys/dev/sfxge/common/efx_types.h
==
--- stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:10:01 2016
(r310928)
+++ stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:11:04 2016
(r310929)
@@ -264,37 +264,37 @@ typedef union efx_oword_u {
 
 #if EFSYS_IS_BIG_ENDIAN
 
-#define__CPU_TO_LE_16(_x)  (uint16_t)__SWAP16(_x)
-#define__LE_TO_CPU_16(_x)  (uint16_t)__SWAP16(_x)
-#define__CPU_TO_BE_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__BE_TO_CPU_16(_x)  (uint16_t)__NOSWAP16(_x)
-
-#define__CPU_TO_LE_32(_x)  (uint32_t)__SWAP32(_x)
-#define__LE_TO_CPU_32(_x)  (uint32_t)__SWAP32(_x)
-#define__CPU_TO_BE_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__BE_TO_CPU_32(_x)  (uint32_t)__NOSWAP32(_x)
-
-#define__CPU_TO_LE_64(_x)  (uint64_t)__SWAP64(_x)
-#define__LE_TO_CPU_64(_x)  (uint64_t)__SWAP64(_x)
-#define__CPU_TO_BE_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__BE_TO_CPU_64(_x)  (uint64_t)__NOSWAP64(_x)
+#define__CPU_TO_LE_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__LE_TO_CPU_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__CPU_TO_BE_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__BE_TO_CPU_16(_x)  ((uint16_t)__NOSWAP16(_x))
+
+#define__CPU_TO_LE_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__LE_TO_CPU_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__CPU_TO_BE_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__BE_TO_CPU_32(_x)  ((uint32_t)__NOSWAP32(_x))
+
+#define__CPU_TO_LE_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__LE_TO_CPU_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__CPU_TO_BE_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__BE_TO_CPU_64(_x)  ((uint64_t)__NOSWAP64(_x))
 
 #elif EFSYS_IS_LITTLE_ENDIAN
 
-#define__CPU_TO_LE_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__LE_TO_CPU_16(_x)  (uint16_t)__NOSWAP16(_x)
-#define__CPU_TO_BE_16(_x)  (uint16_t)__SWAP16(_x)
-#define__BE_TO_CPU_16(_x)  (uint16_t)__SWAP16(_x)
-
-#define__CPU_TO_LE_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__LE_TO_CPU_32(_x)  (uint32_t)__NOSWAP32(_x)
-#define__CPU_TO_BE_32(_x)  (uint32_t)__SWAP32(_x)
-#define__BE_TO_CPU_32(_x)  (uint32_t)__SWAP32(_x)
-
-#define__CPU_TO_LE_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__LE_TO_CPU_64(_x)  (uint64_t)__NOSWAP64(_x)
-#define__CPU_TO_BE_64(_x)  (uint64_t)__SWAP64(_x)
-#define__BE_TO_CPU_64(_x)  (uint64_t)__SWAP64(_x)
+#define__CPU_TO_LE_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__LE_TO_CPU_16(_x)  ((uint16_t)__NOSWAP16(_x))
+#define__CPU_TO_BE_16(_x)  ((uint16_t)__SWAP16(_x))
+#define__BE_TO_CPU_16(_x)  ((uint16_t)__SWAP16(_x))
+
+#define__CPU_TO_LE_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__LE_TO_CPU_32(_x)  ((uint32_t)__NOSWAP32(_x))
+#define__CPU_TO_BE_32(_x)  ((uint32_t)__SWAP32(_x))
+#define__BE_TO_CPU_32(_x)  ((uint32_t)__SWAP32(_x))
+
+#define__CPU_TO_LE_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__LE_TO_CPU_64(_x)  ((uint64_t)__NOSWAP64(_x))
+#define__CPU_TO_BE_64(_x)  ((uint64_t)__SWAP64(_x))
+#define__BE_TO_CPU_64(_x)  ((uint64_t)__SWAP64(_x))
 
 #else
 

Modified: stable/11/sys/dev/sfxge/common/mcdi_mon.c
==
--- stable/11/sys/dev/sfxge/common/mcdi_mon.c   Sat Dec 31 11:10:01 2016
(r310928)
+++ stable/11/sys/dev/sfxge/common/mcdi_mon.c   Sat Dec 31 11:11:04 2016

svn commit: r310928 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:10:01 2016
New Revision: 310928
URL: https://svnweb.freebsd.org/changeset/base/310928

Log:
  MFC r310691
  
  sfxge(4): make strings array pointer itself immutable
  
  Found by DPDK checkpatches.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_mon.c
  stable/11/sys/dev/sfxge/common/efx_port.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_mon.c
==
--- stable/11/sys/dev/sfxge/common/efx_mon.cSat Dec 31 11:09:01 2016
(r310927)
+++ stable/11/sys/dev/sfxge/common/efx_mon.cSat Dec 31 11:10:01 2016
(r310928)
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_NAMES
 
-static const char  *__efx_mon_name[] = {
+static const char * const __efx_mon_name[] = {
"",
"sfx90x0",
"sfx91x0",

Modified: stable/11/sys/dev/sfxge/common/efx_port.c
==
--- stable/11/sys/dev/sfxge/common/efx_port.c   Sat Dec 31 11:09:01 2016
(r310927)
+++ stable/11/sys/dev/sfxge/common/efx_port.c   Sat Dec 31 11:10:01 2016
(r310928)
@@ -172,7 +172,7 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-static const char  *__efx_loopback_type_name[] = {
+static const char * const __efx_loopback_type_name[] = {
"OFF",
"DATA",
"GMAC",
___
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: r310927 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:09:01 2016
New Revision: 310927
URL: https://svnweb.freebsd.org/changeset/base/310927

Log:
  MFC r310690
  
  sfxge(4): cleanup: add const qualifier to const array pointer
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_ev.c
  stable/11/sys/dev/sfxge/common/efx_mac.c
  stable/11/sys/dev/sfxge/common/efx_mon.c
  stable/11/sys/dev/sfxge/common/efx_phy.c
  stable/11/sys/dev/sfxge/common/efx_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_ev.c
==
--- stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:07:44 2016
(r310926)
+++ stable/11/sys/dev/sfxge/common/efx_ev.c Sat Dec 31 11:09:01 2016
(r310927)
@@ -1357,8 +1357,8 @@ fail1:
 
 #if EFSYS_OPT_QSTATS
 #if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock b693ddf85aee1bfd */
-static const char  *__efx_ev_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock c0f3bc5083b40532 */
+static const char * const __efx_ev_qstat_name[] = {
"all",
"rx",
"rx_ok",

Modified: stable/11/sys/dev/sfxge/common/efx_mac.c
==
--- stable/11/sys/dev/sfxge/common/efx_mac.cSat Dec 31 11:07:44 2016
(r310926)
+++ stable/11/sys/dev/sfxge/common/efx_mac.cSat Dec 31 11:09:01 2016
(r310927)
@@ -515,8 +515,8 @@ efx_mac_filter_default_rxq_clear(
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED EfxMacStatNamesBlock 054d43a31d2d7a45 */
-static const char  *__efx_mac_stat_name[] = {
+/* START MKCONFIG GENERATED EfxMacStatNamesBlock c11b91b42f922516 */
+static const char * const __efx_mac_stat_name[] = {
"rx_octets",
"rx_pkts",
"rx_unicst_pkts",

Modified: stable/11/sys/dev/sfxge/common/efx_mon.c
==
--- stable/11/sys/dev/sfxge/common/efx_mon.cSat Dec 31 11:07:44 2016
(r310926)
+++ stable/11/sys/dev/sfxge/common/efx_mon.cSat Dec 31 11:09:01 2016
(r310927)
@@ -126,8 +126,8 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED MonitorStatNamesBlock 31f437eafb0b0437 */
-static const char  *__mon_stat_name[] = {
+/* START MKCONFIG GENERATED MonitorStatNamesBlock 5daa2a5725ba734b */
+static const char * const __mon_stat_name[] = {
"value_2_5v",
"value_vccp1",
"value_vcc",

Modified: stable/11/sys/dev/sfxge/common/efx_phy.c
==
--- stable/11/sys/dev/sfxge/common/efx_phy.cSat Dec 31 11:07:44 2016
(r310926)
+++ stable/11/sys/dev/sfxge/common/efx_phy.cSat Dec 31 11:09:01 2016
(r310927)
@@ -336,8 +336,8 @@ fail1:
 
 #if EFSYS_OPT_NAMES
 
-/* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */
-static const char  *__efx_phy_stat_name[] = {
+/* START MKCONFIG GENERATED PhyStatNamesBlock af9ffa24da3bc100 */
+static const char * const __efx_phy_stat_name[] = {
"oui",
"pma_pmd_link_up",
"pma_pmd_rx_fault",

Modified: stable/11/sys/dev/sfxge/common/efx_tx.c
==
--- stable/11/sys/dev/sfxge/common/efx_tx.c Sat Dec 31 11:07:44 2016
(r310926)
+++ stable/11/sys/dev/sfxge/common/efx_tx.c Sat Dec 31 11:09:01 2016
(r310927)
@@ -1029,8 +1029,8 @@ siena_tx_qdesc_dma_create(
 
 #if EFSYS_OPT_QSTATS
 #if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 9d8d26a0a5e2c453 */
-static const char  *__efx_tx_qstat_name[] = {
+/* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 2866874ecd7a363b */
+static const char * const __efx_tx_qstat_name[] = {
"post",
"post_pio",
 };
___
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: r310925 - head/sys/sys

2016-12-31 Thread Konstantin Belousov
Author: kib
Date: Sat Dec 31 11:07:33 2016
New Revision: 310925
URL: https://svnweb.freebsd.org/changeset/base/310925

Log:
  Remove unused declaration.
  
  The setconf() implementation was removed by r52778 Nov 1 1999.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/sys/conf.h

Modified: head/sys/sys/conf.h
==
--- head/sys/sys/conf.h Sat Dec 31 11:06:19 2016(r310924)
+++ head/sys/sys/conf.h Sat Dec 31 11:07:33 2016(r310925)
@@ -285,7 +285,6 @@ int make_dev_physpath_alias(int _flags, 
const char *_physpath);
 void   dev_lock(void);
 void   dev_unlock(void);
-void   setconf(void);
 
 #ifdef KLD_MODULE
 #defineMAKEDEV_ETERNAL_KLD 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: r310926 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:07:44 2016
New Revision: 310926
URL: https://svnweb.freebsd.org/changeset/base/310926

Log:
  MFC r310689
  
  sfxge(4): cleanup: avoid spaces before TAB
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_types.h
  stable/11/sys/dev/sfxge/common/siena_phy.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:07:33 2016
(r310925)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:07:44 2016
(r310926)
@@ -169,7 +169,7 @@ extern  void
 efx_nic_unprobe(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_nic_destroy(
__inefx_nic_t *enp);
 
@@ -286,21 +286,21 @@ efx_intr_init(
__inefx_intr_type_t type,
__inefsys_mem_t *esmp);
 
-extern void
+extern void
 efx_intr_enable(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_intr_disable(
__inefx_nic_t *enp);
 
-extern void
+extern void
 efx_intr_disable_unlocked(
__inefx_nic_t *enp);
 
 #defineEFX_INTR_NEVQS  32
 
-extern __checkReturn   efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_intr_trigger(
__inefx_nic_t *enp,
__inunsigned int level);
@@ -819,7 +819,7 @@ efx_port_poll(
__inefx_nic_t *enp,
__out_opt   efx_link_mode_t *link_modep);
 
-extern void
+extern void
 efx_port_fini(
__inefx_nic_t *enp);
 
@@ -1253,7 +1253,7 @@ efx_vpd_verify(
__in_bcount(size)   caddr_t data,
__insize_t size);
 
-extern  __checkReturn  efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_vpd_reinit(
__inefx_nic_t *enp,
__in_bcount(size)   caddr_t data,
@@ -1281,7 +1281,7 @@ efx_vpd_next(
__out   efx_vpd_value_t *evvp,
__inout unsigned int *contp);
 
-extern __checkReturn   efx_rc_t
+extern __checkReturn   efx_rc_t
 efx_vpd_write(
__inefx_nic_t *enp,
__in_bcount(size)   caddr_t data,
@@ -1499,7 +1499,7 @@ typedef enum efx_pattern_type_t {
EFX_PATTERN_NTYPES
 } efx_pattern_type_t;
 
-typedefvoid
+typedefvoid
 (*efx_sram_pattern_fn_t)(
__insize_t row,
__inboolean_t negate,

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:07:33 2016
(r310925)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:07:44 2016
(r310926)
@@ -913,7 +913,7 @@ struct efx_txq_s {
uint32_t, (_edp)->ed_u32[0]);   \
EFSYS_BAR_WRITED((_enp)->en_esbp,   \
(_reg ## _OFST +\
-   (2 * sizeof (efx_dword_t)) +\
+   (2 * sizeof (efx_dword_t)) +\
((_index) * _reg ## _STEP)),\
(_edp), (_lock));   \
_NOTE(CONSTANTCONDITION)\
@@ -928,7 +928,7 @@ struct efx_txq_s {
uint32_t, (_edp)->ed_u32[0]);   \
EFSYS_BAR_WRITED((_enp)->en_esbp,   \
(_reg ## _OFST +\
-   (3 * sizeof (efx_dword_t)) +\
+   (3 * sizeof (efx_dword_t)) +\
((_index) * _reg ## _STEP)),\
(_edp), (_lock));   \
_NOTE(CONSTANTCONDITION)\

Modified: stable/11/sys/dev/sfxge/common/efx_types.h
==
--- stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:07:33 2016
(r310925)
+++ stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:07:44 2016
(r310926)
@@ -246,7 +246,7 @@ typedef union efx_oword_u {
 
 #pragma pack()
 
-#define__SWAP16(_x)\
+#define__SWAP16(_x)   

svn commit: r310924 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:06:19 2016
New Revision: 310924
URL: https://svnweb.freebsd.org/changeset/base/310924

Log:
  MFC r310688
  
  sfxge(4): cleanup: avoid space just before TAB in efx_types.h
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_types.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_types.h
==
--- stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:05:04 2016
(r310923)
+++ stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:06:19 2016
(r310924)
@@ -688,21 +688,21 @@ extern int fix_lint;
_field7, _value7, _field8, _value8, _field9, _value9,   \
_field10, _value10) \
do {\
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u64[0] = EFX_INSERT_FIELDS64(0, 63, \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u64[1] = EFX_INSERT_FIELDS64(64, 127,   \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
} while (B_FALSE)
 
 #defineEFX_POPULATE_OWORD32(_oword,
\
@@ -711,35 +711,35 @@ extern int fix_lint;
_field7, _value7, _field8, _value8, _field9, _value9,   \
_field10, _value10) \
do {\
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[0] = EFX_INSERT_FIELDS32(0, 31, \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[1] = EFX_INSERT_FIELDS32(32, 63,\
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[2] = EFX_INSERT_FIELDS32(64, 95,\
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \
_field9, _value9, _field10, _value10);  \
-   _NOTE(CONSTANTCONDITION)\
+   _NOTE(CONSTANTCONDITION)\
(_oword).eo_u32[3] = EFX_INSERT_FIELDS32(96, 127,   \
_field1, _value1, _field2, _value2, \
_field3, _value3, _field4, _value4, \
_field5, _value5, _field6, _value6, \
_field7, _value7, _field8, _value8, \

svn commit: r310923 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:05:04 2016
New Revision: 310923
URL: https://svnweb.freebsd.org/changeset/base/310923

Log:
  MFC r310687
  
  sfxge(4): cleanup: use TAB to indent
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_phy.c
  stable/11/sys/dev/sfxge/common/hunt_nic.c
  stable/11/sys/dev/sfxge/common/mcdi_mon.c
  stable/11/sys/dev/sfxge/common/medford_nic.c
  stable/11/sys/dev/sfxge/common/siena_flash.h
  stable/11/sys/dev/sfxge/common/siena_impl.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:03:54 2016
(r310922)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:05:04 2016
(r310923)
@@ -847,7 +847,7 @@ typedef enum efx_phy_cap_type_e {
 extern void
 efx_phy_adv_cap_get(
__inefx_nic_t *enp,
-   __inuint32_t flag,
+   __inuint32_t flag,
__out   uint32_t *maskp);
 
 extern __checkReturn   efx_rc_t
@@ -1132,20 +1132,20 @@ typedef struct efx_nic_cfg_s {
boolean_t   enc_rx_batching_enabled;
/* Maximum number of descriptors completed in an rx event. */
uint32_tenc_rx_batch_max;
-/* Number of rx descriptors the hardware requires for a push. */
-uint32_t   enc_rx_push_align;
+   /* Number of rx descriptors the hardware requires for a push. */
+   uint32_tenc_rx_push_align;
/*
 * Maximum number of bytes into the packet the TCP header can start for
 * the hardware to apply TSO packet edits.
 */
-   uint32_tenc_tx_tso_tcp_header_offset_limit;
-   boolean_t   enc_fw_assisted_tso_enabled;
-   boolean_t   enc_fw_assisted_tso_v2_enabled;
-   boolean_t   enc_hw_tx_insert_vlan_enabled;
+   uint32_tenc_tx_tso_tcp_header_offset_limit;
+   boolean_t   enc_fw_assisted_tso_enabled;
+   boolean_t   enc_fw_assisted_tso_v2_enabled;
+   boolean_t   enc_hw_tx_insert_vlan_enabled;
/* Datapath firmware vadapter/vport/vswitch support */
boolean_t   enc_datapath_cap_evb;
-   boolean_t   enc_rx_disable_scatter_supported;
-   boolean_t   enc_allow_set_mac_with_installed_filters;
+   boolean_t   enc_rx_disable_scatter_supported;
+   boolean_t   enc_allow_set_mac_with_installed_filters;
boolean_t   enc_enhanced_set_mac_supported;
boolean_t   enc_init_evq_v2_supported;
/* External port identifier */
@@ -1846,8 +1846,8 @@ typedef enum efx_rx_hash_support_e {
 } efx_rx_hash_support_t;
 
 #defineEFX_RSS_TBL_SIZE128 /* Rows in RX indirection table 
*/
-#defineEFX_MAXRSS  64  /* RX indirection entry range */
-#defineEFX_MAXRSS_LEGACY   16  /* See bug16611 and bug17213 */
+#defineEFX_MAXRSS  64  /* RX indirection entry range */
+#defineEFX_MAXRSS_LEGACY   16  /* See bug16611 and bug17213 */
 
 typedef enum efx_rx_scale_support_e {
EFX_RX_SCALE_UNAVAILABLE = 0,   /* Not supported */
@@ -2059,7 +2059,7 @@ efx_tx_qpio_write(
__inefx_txq_t *etp,
__in_ecount(buf_length) uint8_t *buffer,
__insize_t buf_length,
-   __insize_t pio_buf_offset);
+   __insize_t pio_buf_offset);
 
 extern __checkReturn   efx_rc_t
 efx_tx_qpio_post(

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:03:54 2016
(r310922)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:05:04 2016
(r310923)
@@ -252,7 +252,7 @@ efx_filter_reconfigure(
 
 typedef struct efx_port_s {
efx_mac_type_t  ep_mac_type;
-   uint32_tep_phy_type;
+   uint32_tep_phy_type;
uint8_t ep_port;
uint32_tep_mac_pdu;
uint8_t ep_mac_addr[6];
@@ -600,7 +600,7 @@ struct efx_nic_s {
uint32_ten_features;
efsys_identifier_t  *en_esip;
efsys_lock_t*en_eslp;
-   efsys_bar_t *en_esbp;
+   efsys_bar_t *en_esbp;
unsigned inten_mod_flags;
unsigned inten_reset_flags;
efx_nic_cfg_t   en_nic_cfg;

Modifi

svn commit: r310922 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:03:54 2016
New Revision: 310922
URL: https://svnweb.freebsd.org/changeset/base/310922

Log:
  MFC r310686
  
  sfxge(4): cleanup: add missing space between type and pointer symbol
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:03:34 2016
(r310921)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:03:54 2016
(r310922)
@@ -435,7 +435,7 @@ typedef enum efx_link_mode_e {
 
 #defineEFX_MAC_ADDR_LEN 6
 
-#defineEFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t*)_address)[0] & 
0x01)
+#defineEFX_MAC_ADDR_IS_MULTICAST(_address) (((uint8_t *)_address)[0] & 
0x01)
 
 #defineEFX_MAC_MULTICAST_LIST_MAX  256
 

Modified: stable/11/sys/dev/sfxge/common/efx_lic.c
==
--- stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 11:03:34 2016
(r310921)
+++ stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 11:03:54 2016
(r310922)
@@ -509,8 +509,8 @@ efx_lic_v1v2_find_key(
if ((size_t)buffer_size - offset < EFX_LICENSE_V1V2_HEADER_LENGTH)
goto fail1;
 
-   tlv_type = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[0]);
-   tlv_length = __LE_TO_CPU_16(((uint16_t*)&bufferp[offset])[1]);
+   tlv_type = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[0]);
+   tlv_length = __LE_TO_CPU_16(((uint16_t *)&bufferp[offset])[1]);
if ((tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) ||
(tlv_type == 0 && tlv_length == 0)) {
found = B_FALSE;
@@ -543,8 +543,8 @@ efx_lic_v1v2_validate_key(
goto fail1;
}
 
-   tlv_type = __LE_TO_CPU_16(((uint16_t*)keyp)[0]);
-   tlv_length = __LE_TO_CPU_16(((uint16_t*)keyp)[1]);
+   tlv_type = __LE_TO_CPU_16(((uint16_t *)keyp)[0]);
+   tlv_length = __LE_TO_CPU_16(((uint16_t *)keyp)[1]);
 
if (tlv_length > EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX) {
goto fail2;
@@ -1169,8 +1169,8 @@ efx_lic_v3_validate_key(
goto fail2;
}
 
-   key_type = ((uint8_t*)keyp)[0];
-   key_length = ((uint8_t*)keyp)[1];
+   key_type = ((uint8_t *)keyp)[0];
+   key_length = ((uint8_t *)keyp)[1];
 
if (key_type < 3) {
goto fail3;
___
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: r310921 - head/usr.sbin/inetd

2016-12-31 Thread Hiroki Sato
Author: hrs
Date: Sat Dec 31 11:03:34 2016
New Revision: 310921
URL: https://svnweb.freebsd.org/changeset/base/310921

Log:
  - Add static for symbols which need not to be exported.
  - Clean up warnings to the WARNS=6 level.

Modified:
  head/usr.sbin/inetd/builtins.c
  head/usr.sbin/inetd/inetd.c
  head/usr.sbin/inetd/inetd.h

Modified: head/usr.sbin/inetd/builtins.c
==
--- head/usr.sbin/inetd/builtins.c  Sat Dec 31 11:02:33 2016
(r310920)
+++ head/usr.sbin/inetd/builtins.c  Sat Dec 31 11:03:34 2016
(r310921)
@@ -52,25 +52,24 @@ __FBSDID("$FreeBSD$");
 
 #include "inetd.h"
 
-void   chargen_dg(int, struct servtab *);
-void   chargen_stream(int, struct servtab *);
-void   daytime_dg(int, struct servtab *);
-void   daytime_stream(int, struct servtab *);
-void   discard_dg(int, struct servtab *);
-void   discard_stream(int, struct servtab *);
-void   echo_dg(int, struct servtab *);
-void   echo_stream(int, struct servtab *);
+static voidchargen_dg(int, struct servtab *);
+static voidchargen_stream(int, struct servtab *);
+static voiddaytime_dg(int, struct servtab *);
+static voiddaytime_stream(int, struct servtab *);
+static voiddiscard_dg(int, struct servtab *);
+static voiddiscard_stream(int, struct servtab *);
+static voidecho_dg(int, struct servtab *);
+static voidecho_stream(int, struct servtab *);
 static int get_line(int, char *, int);
-void   iderror(int, int, int, const char *);
-void   ident_stream(int, struct servtab *);
-void   initring(void);
-uint32_t   machtime(void);
-void   machtime_dg(int, struct servtab *);
-void   machtime_stream(int, struct servtab *);
-
-char ring[128];
-char *endring;
+static voididerror(int, int, int, const char *);
+static voidident_stream(int, struct servtab *);
+static voidinitring(void);
+static uint32_tmachtime(void);
+static voidmachtime_dg(int, struct servtab *);
+static voidmachtime_stream(int, struct servtab *);
 
+static char ring[128];
+static char *endring;
 
 struct biltin biltins[] = {
/* Echo received data */
@@ -105,7 +104,7 @@ struct biltin biltins[] = {
  * any regard for input.
  */
 
-void
+static void
 initring(void)
 {
int i;
@@ -122,7 +121,7 @@ initring(void)
  * characters chosen from the range 0 to 512. We send LINESIZ+2.
  */
 /* ARGSUSED */
-void
+static void
 chargen_dg(int s, struct servtab *sep)
 {
struct sockaddr_storage ss;
@@ -159,7 +158,7 @@ chargen_dg(int s, struct servtab *sep)
 
 /* Character generator */
 /* ARGSUSED */
-void
+static void
 chargen_stream(int s, struct servtab *sep)
 {
int len;
@@ -196,7 +195,7 @@ chargen_stream(int s, struct servtab *se
 
 /* Return human-readable time of day */
 /* ARGSUSED */
-void
+static void
 daytime_dg(int s, struct servtab *sep)
 {
char buffer[256];
@@ -221,7 +220,7 @@ daytime_dg(int s, struct servtab *sep)
 
 /* Return human-readable time of day */
 /* ARGSUSED */
-void
+static void
 daytime_stream(int s, struct servtab *sep __unused)
 {
char buffer[256];
@@ -240,7 +239,7 @@ daytime_stream(int s, struct servtab *se
 
 /* Discard service -- ignore data */
 /* ARGSUSED */
-void
+static void
 discard_dg(int s, struct servtab *sep __unused)
 {
char buffer[BUFSIZE];
@@ -250,7 +249,7 @@ discard_dg(int s, struct servtab *sep __
 
 /* Discard service -- ignore data */
 /* ARGSUSED */
-void
+static void
 discard_stream(int s, struct servtab *sep)
 {
int ret;
@@ -273,7 +272,7 @@ discard_stream(int s, struct servtab *se
 
 /* Echo service -- echo data back */
 /* ARGSUSED */
-void
+static void
 echo_dg(int s, struct servtab *sep)
 {
char buffer[65536]; /* Should be sizeof(max datagram). */
@@ -294,7 +293,7 @@ echo_dg(int s, struct servtab *sep)
 
 /* Echo service -- echo data back */
 /* ARGSUSED */
-void
+static void
 echo_stream(int s, struct servtab *sep)
 {
char buffer[BUFSIZE];
@@ -322,7 +321,7 @@ echo_stream(int s, struct servtab *sep)
 
 /* Generic ident_stream error-sending func */
 /* ARGSUSED */
-void
+static void
 iderror(int lport, int fport, int s, const char *er)
 {
char *p;
@@ -340,7 +339,7 @@ iderror(int lport, int fport, int s, con
 
 /* Ident service (AKA "auth") */
 /* ARGSUSED */
-void
+static void
 ident_stream(int s, struct servtab *sep)
 {
struct utsname un;
@@ -688,7 +687,7 @@ printit:
  * some seventy years Bell Labs was asleep.
  */
 
-uint32_t
+static uint32_t
 machtime(void)
 {
 
@@ -698,7 +697,7 @@ machtime(void)
 }
 
 /* ARGSUSED */
-void
+static void
 machtime_dg(int s, struct servtab *sep)
 {
uint32_t result;
@@ -719,7 +718,7 @@ machtime_dg(int s, struct servtab *sep)
 }
 
 /* ARGSUSED */
-void
+static void
 machtime_stream(int s, struct servtab *sep __unused)
 {
uint32_t result;

Modified: 

svn commit: r310920 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:02:33 2016
New Revision: 310920
URL: https://svnweb.freebsd.org/changeset/base/310920

Log:
  MFC r310685
  
  sfxge(4): cleanup: open brace should be on a type name line
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx.h
  stable/11/sys/dev/sfxge/common/efx_mcdi.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx.h
==
--- stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:01:11 2016
(r310919)
+++ stable/11/sys/dev/sfxge/common/efx.hSat Dec 31 11:02:33 2016
(r310920)
@@ -212,8 +212,7 @@ typedef enum efx_mcdi_exception_e {
 } efx_mcdi_exception_t;
 
 #if EFSYS_OPT_MCDI_LOGGING
-typedef enum efx_log_msg_e
-{
+typedef enum efx_log_msg_e {
EFX_LOG_INVALID,
EFX_LOG_MCDI_REQUEST,
EFX_LOG_MCDI_RESPONSE,
@@ -1172,8 +1171,7 @@ efx_nic_cfg_get(
__inefx_nic_t *enp);
 
 /* Driver resource limits (minimum required/maximum usable). */
-typedef struct efx_drv_limits_s
-{
+typedef struct efx_drv_limits_s {
uint32_tedl_min_evq_count;
uint32_tedl_max_evq_count;
 

Modified: stable/11/sys/dev/sfxge/common/efx_mcdi.c
==
--- stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:01:11 2016
(r310919)
+++ stable/11/sys/dev/sfxge/common/efx_mcdi.c   Sat Dec 31 11:02:33 2016
(r310920)
@@ -1728,8 +1728,7 @@ fail1:
 
 #if EFSYS_OPT_MAC_STATS
 
-typedef enum efx_stats_action_e
-{
+typedef enum efx_stats_action_e {
EFX_STATS_CLEAR,
EFX_STATS_UPLOAD,
EFX_STATS_ENABLE_NOEVENTS,
___
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: r310918 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:00:35 2016
New Revision: 310918
URL: https://svnweb.freebsd.org/changeset/base/310918

Log:
  MFC r310684
  
  sfxge(4): cleanup: remove trailing whitespaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_types.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_types.h
==
--- stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 10:59:22 2016
(r310917)
+++ stable/11/sys/dev/sfxge/common/efx_types.h  Sat Dec 31 11:00:35 2016
(r310918)
@@ -238,7 +238,7 @@ typedef union efx_oword_u {
 #endif
 #if EFSYS_HAS_UINT64
uint64_t eo_u64[2];
-#endif 
+#endif
uint32_t eo_u32[4];
uint16_t eo_u16[8];
uint8_t eo_u8[16];
___
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: r310919 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 11:01:11 2016
New Revision: 310919
URL: https://svnweb.freebsd.org/changeset/base/310919

Log:
  MFC r310681
  
  sfxge(4): cleanup: remove unnecessary spaces
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/efx_impl.h
  stable/11/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/efx_impl.h
==
--- stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:00:35 2016
(r310918)
+++ stable/11/sys/dev/sfxge/common/efx_impl.h   Sat Dec 31 11:01:11 2016
(r310919)
@@ -564,7 +564,7 @@ typedef struct efx_lic_ops_s {
efx_rc_t(*elo_find_start)
(efx_nic_t *, caddr_t, size_t, uint32_t *);
efx_rc_t(*elo_find_end)(efx_nic_t *, caddr_t, size_t,
-   uint32_t , uint32_t *);
+   uint32_t, uint32_t *);
boolean_t   (*elo_find_key)(efx_nic_t *, caddr_t, size_t,
uint32_t, uint32_t *, uint32_t *);
boolean_t   (*elo_validate_key)(efx_nic_t *,

Modified: stable/11/sys/dev/sfxge/common/efx_lic.c
==
--- stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 11:00:35 2016
(r310918)
+++ stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 11:01:11 2016
(r310919)
@@ -627,7 +627,7 @@ efx_lic_v1v2_write_key(
 
/* Ensure space for terminator remains */
if ((offset + length) >
-   (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) {
+   (buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH)) {
rc = ENOSPC;
goto fail1;
}
___
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: r310917 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 10:59:22 2016
New Revision: 310917
URL: https://svnweb.freebsd.org/changeset/base/310917

Log:
  MFC r310683
  
  sfxge(4): cleanup: pointer symbol should go together with struct member name
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_impl.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_impl.h
==
--- stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 10:57:24 2016
(r310916)
+++ stable/11/sys/dev/sfxge/common/ef10_impl.h  Sat Dec 31 10:59:22 2016
(r310917)
@@ -950,7 +950,7 @@ typedef struct ef10_filter_entry_s {
 
 typedef struct ef10_filter_table_s {
ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS];
-   efx_rxq_t * eft_default_rxq;
+   efx_rxq_t   *eft_default_rxq;
boolean_t   eft_using_rss;
uint32_teft_unicst_filter_indexes[
EFX_EF10_FILTER_UNICAST_FILTERS_MAX];
___
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: r310916 - stable/11/sys/dev/sfxge/common

2016-12-31 Thread Andrew Rybchenko
Author: arybchik
Date: Sat Dec 31 10:57:24 2016
New Revision: 310916
URL: https://svnweb.freebsd.org/changeset/base/310916

Log:
  MFC r310682
  
  sfxge(4): cleanup: avoid C99 // comments
  
  Found by DPDK checkpatch.sh
  
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/ef10_nvram.c
  stable/11/sys/dev/sfxge/common/efx_lic.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==
--- stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 10:48:19 2016
(r310915)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.cSat Dec 31 10:57:24 2016
(r310916)
@@ -800,7 +800,7 @@ ef10_ev_rx(
 * or headers that are too long for the parser.
 * Headers and checksums must be validated by the host.
 */
-   // TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE);
+   /* TODO: EFX_EV_QSTAT_INCR(eep, EV_RX_PARSE_INCOMPLETE); */
goto deliver;
}
 

Modified: stable/11/sys/dev/sfxge/common/ef10_nvram.c
==
--- stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 10:48:19 2016
(r310915)
+++ stable/11/sys/dev/sfxge/common/ef10_nvram.c Sat Dec 31 10:57:24 2016
(r310916)
@@ -852,7 +852,7 @@ ef10_nvram_buffer_find_item_start(
__insize_t buffer_size,
__out   uint32_t *startp)
 {
-   // Read past partition header to find start address of the first key
+   /* Read past partition header to find start address of the first key */
tlv_cursor_t cursor;
efx_rc_t rc;
 
@@ -898,7 +898,7 @@ ef10_nvram_buffer_find_end(
__inuint32_t offset,
__out   uint32_t *endp)
 {
-   // Read to end of partition
+   /* Read to end of partition */
tlv_cursor_t cursor;
efx_rc_t rc;
uint32_t *segment_used;
@@ -956,7 +956,7 @@ ef10_nvram_buffer_find_item(
__out   uint32_t *startp,
__out   uint32_t *lengthp)
 {
-   // Find TLV at offset and return key start and length
+   /* Find TLV at offset and return key start and length */
tlv_cursor_t cursor;
uint8_t *key;
uint32_t tag;

Modified: stable/11/sys/dev/sfxge/common/efx_lic.c
==
--- stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 10:48:19 2016
(r310915)
+++ stable/11/sys/dev/sfxge/common/efx_lic.cSat Dec 31 10:57:24 2016
(r310916)
@@ -625,7 +625,7 @@ efx_lic_v1v2_write_key(
EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX +
EFX_LICENSE_V1V2_HEADER_LENGTH));
 
-   // Ensure space for terminator remains
+   /* Ensure space for terminator remains */
if ((offset + length) >
(buffer_size - EFX_LICENSE_V1V2_HEADER_LENGTH) ) {
rc = ENOSPC;
@@ -662,7 +662,7 @@ efx_lic_v1v2_delete_key(
_NOTE(ARGUNUSED(enp))
EFSYS_ASSERT(end <= buffer_size);
 
-   // Shift everything after the key down
+   /* Shift everything after the key down */
memmove(bufferp + offset, bufferp + move_start, move_length);
 
*deltap = length;
@@ -681,7 +681,7 @@ efx_lic_v1v2_create_partition(
_NOTE(ARGUNUSED(enp))
EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size);
 
-   // Write terminator
+   /* Write terminator */
memset(bufferp, '\0', EFX_LICENSE_V1V2_HEADER_LENGTH);
return (0);
 }
@@ -1155,7 +1155,7 @@ efx_lic_v3_validate_key(
__inuint32_t length
)
 {
-   // Check key is a valid V3 key
+   /* Check key is a valid V3 key */
uint8_t key_type;
uint8_t key_length;
 
@@ -1272,7 +1272,7 @@ efx_lic_v3_create_partition(
 {
efx_rc_t rc;
 
-   // Construct empty partition
+   /* Construct empty partition */
if ((rc = ef10_nvram_buffer_create(enp,
NVRAM_PARTITION_TYPE_LICENSE,
bufferp, buffer_size)) != 0) {
@@ -1303,7 +1303,7 @@ efx_lic_v3_finish_partition(
goto fail1;
}
 
-   // Validate completed partition
+   /* Validate completed partition */
if ((rc = ef10_nvram_buffer_validate(enp, NVRAM_PARTITION_TYPE_LICENSE,
bufferp, buffer_size)) != 0) {
goto fail2;
___
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: r310915 - in stable/10: lib/libbsnmp/libbsnmp tools/build/mk

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:48:19 2016
New Revision: 310915
URL: https://svnweb.freebsd.org/changeset/base/310915

Log:
  MFstable/11 r310897:
  
  MFC r310728:
  
  Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs
  they document
  
  Also, alphabetically sort MAN

Modified:
  stable/10/lib/libbsnmp/libbsnmp/Makefile
  stable/10/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libbsnmp/libbsnmp/Makefile
==
--- stable/10/lib/libbsnmp/libbsnmp/MakefileSat Dec 31 10:47:21 2016
(r310914)
+++ stable/10/lib/libbsnmp/libbsnmp/MakefileSat Dec 31 10:48:19 2016
(r310915)
@@ -20,7 +20,97 @@ LDADD+= -lcrypto
 .endif
 
 SRCS=  asn1.c snmp.c snmpagent.c snmpclient.c snmpcrypto.c support.c
-INCS=  asn1.h snmp.h snmpagent.h snmpclient.h 
-MAN=   asn1.3 bsnmplib.3 bsnmpclient.3 bsnmpagent.3
+INCS=  asn1.h snmp.h snmpagent.h snmpclient.h
+MAN=   asn1.3 bsnmpagent.3 bsnmpclient.3 bsnmplib.3
+
+MLINKS+=   asn1.3  asn_append_oid.3
+MLINKS+=   asn1.3  asn_commit_header.3
+MLINKS+=   asn1.3  asn_compare_oid.3
+MLINKS+=   asn1.3  asn_get_counter64_raw.3
+MLINKS+=   asn1.3  asn_get_header.3
+MLINKS+=   asn1.3  asn_get_integer.3
+MLINKS+=   asn1.3  asn_get_integer_raw.3
+MLINKS+=   asn1.3  asn_get_ipaddress.3
+MLINKS+=   asn1.3  asn_get_ipaddress_raw.3
+MLINKS+=   asn1.3  asn_get_null.3
+MLINKS+=   asn1.3  asn_get_null_raw.3
+MLINKS+=   asn1.3  asn_get_objid.3
+MLINKS+=   asn1.3  asn_get_objid_raw.3
+MLINKS+=   asn1.3  asn_get_octetstring.3
+MLINKS+=   asn1.3  asn_get_octetstring_raw.3
+MLINKS+=   asn1.3  asn_get_sequence.3
+MLINKS+=   asn1.3  asn_get_timeticks.3
+MLINKS+=   asn1.3  asn_get_uint32_raw.3
+MLINKS+=   asn1.3  asn_is_suboid.3
+MLINKS+=   asn1.3  asn_oid2str.3
+MLINKS+=   asn1.3  asn_oid2str_r.3
+MLINKS+=   asn1.3  asn_put_counter64.3
+MLINKS+=   asn1.3  asn_put_exception.3
+MLINKS+=   asn1.3  asn_put_header.3
+MLINKS+=   asn1.3  asn_put_integer.3
+MLINKS+=   asn1.3  asn_put_ipaddress.3
+MLINKS+=   asn1.3  asn_put_null.3
+MLINKS+=   asn1.3  asn_put_objid.3
+MLINKS+=   asn1.3  asn_put_octetstring.3
+MLINKS+=   asn1.3  asn_put_temp_header.3
+MLINKS+=   asn1.3  asn_put_timeticks.3
+MLINKS+=   asn1.3  asn_put_uint32.3
+MLINKS+=   asn1.3  asn_skip.3
+MLINKS+=   asn1.3  asn_slice_oid.3
+
+MLINKS+=   bsnmpagent.3snmp_debug.3
+MLINKS+=   bsnmpagent.3snmp_dep_commit.3
+MLINKS+=   bsnmpagent.3snmp_dep_finish.3
+MLINKS+=   bsnmpagent.3snmp_dep_lookup.3
+MLINKS+=   bsnmpagent.3snmp_dep_rollback.3
+MLINKS+=   bsnmpagent.3snmp_depop_t.3
+MLINKS+=   bsnmpagent.3snmp_get.3
+MLINKS+=   bsnmpagent.3snmp_getbulk.3
+MLINKS+=   bsnmpagent.3snmp_getnext.3
+MLINKS+=   bsnmpagent.3snmp_init_context.3
+MLINKS+=   bsnmpagent.3snmp_make_errresp.3
+MLINKS+=   bsnmpagent.3snmp_op_t.3
+MLINKS+=   bsnmpagent.3snmp_set.3
+MLINKS+=   bsnmpagent.3snmp_trace.3
+MLINKS+=   bsnmpagent.3tree.3
+MLINKS+=   bsnmpagent.3tree_size.3
+
+MLINKS+=   bsnmpclient.3   snmp_add_binding.3
+MLINKS+=   bsnmpclient.3   snmp_client.3
+MLINKS+=   bsnmpclient.3   snmp_close.3
+MLINKS+=   bsnmpclient.3   snmp_dialog.3
+MLINKS+=   bsnmpclient.3   snmp_discover_engine.3
+MLINKS+=   bsnmpclient.3   snmp_oid_append.3
+MLINKS+=   bsnmpclient.3   snmp_open.3
+MLINKS+=   bsnmpclient.3   snmp_parse_server.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_check.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_create.3
+MLINKS+=   bsnmpclient.3   snmp_pdu_send.3
+MLINKS+=   bsnmpclient.3   snmp_receive.3
+MLINKS+=   bsnmpclient.3   snmp_send_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_table_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_table_fetch.3
+MLINKS+=   bsnmpclient.3   snmp_table_fetch_async.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_cb_f.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_start_f.3
+MLINKS+=   bsnmpclient.3   snmp_timeout_stop_f.3
+
+MLINKS+=   bsnmplib.3  TRUTH_GET.3
+MLINKS+=   bsnmplib.3  TRUTH_MK.3
+MLINKS+=   bsnmplib.3  TRUTH_OK.3
+MLINKS+=   bsnmplib.3  snmp_calc_keychange.3
+MLINKS+=   bsnmplib.3  snmp_get_local_keys.3
+MLINKS+=   bsnmplib.3  snmp_passwd_to_keys.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_header.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_scoped.3
+MLINKS+=   bsnmplib.3  snmp_pdu_decode_secmode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_dump.3
+MLINKS+=   bsnmplib.3  snmp_pdu_encode.3
+MLINKS+=   bsnmplib.3  snmp_pdu_free.3
+MLINKS+=   bsnmplib.3  snmp_pdu_init_secparams.3
+MLINKS+=   bsnmplib.3  snmp_v

svn commit: r310914 - in stable/10: tools/build/mk usr.sbin/bsnmpd/bsnmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:47:21 2016
New Revision: 310914
URL: https://svnweb.freebsd.org/changeset/base/310914

Log:
  MFstable/11 r310896:
  
  MFC r310654:
  
  Install snmpmod.3 as all of the bsnmpd APIs it documents

Modified:
  stable/10/tools/build/mk/OptionalObsoleteFiles.inc
  stable/10/usr.sbin/bsnmpd/bsnmpd/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc
==
--- stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Sat Dec 31 10:45:01 
2016(r310913)
+++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc  Sat Dec 31 10:47:21 
2016(r310914)
@@ -406,22 +406,119 @@ OLD_FILES+=usr/share/man/man1/bsnmpget.1
 OLD_FILES+=usr/share/man/man1/bsnmpset.1.gz
 OLD_FILES+=usr/share/man/man1/bsnmpwalk.1.gz
 OLD_FILES+=usr/share/man/man1/gensnmptree.1.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT.3.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_INT_LINK_INDEX.3.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID.3.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/FIND_OBJECT_OID_LINK_INDEX.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_INT_LINK_INDEX.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/INSERT_OBJECT_OID_LINK_INDEX.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_INT_LINK_INDEX.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK.3.gz
+OLD_FILES+=usr/share/man/man3/NEXT_OBJECT_OID_LINK_INDEX.3.gz
 OLD_FILES+=usr/share/man/man3/asn1.3.gz
 OLD_FILES+=usr/share/man/man3/bsnmpagent.3.gz
 OLD_FILES+=usr/share/man/man3/bsnmpclient.3.gz
+OLD_FILES+=usr/share/man/man3/bsnmpd_get_target_stats.3.gz
+OLD_FILES+=usr/share/man/man3/bsnmpd_get_usm_stats.3.gz
+OLD_FILES+=usr/share/man/man3/bsnmpd_reset_usm_stats.3.gz
 OLD_FILES+=usr/share/man/man3/bsnmplib.3.gz
+OLD_FILES+=usr/share/man/man3/buf_alloc.3.gz
+OLD_FILES+=usr/share/man/man3/buf_size.3.gz
+OLD_FILES+=usr/share/man/man3/comm_define.3.gz
+OLD_FILES+=usr/share/man/man3/community.3.gz
+OLD_FILES+=usr/share/man/man3/fd_deselect.3.gz
+OLD_FILES+=usr/share/man/man3/fd_resume.3.gz
+OLD_FILES+=usr/share/man/man3/fd_select.3.gz
+OLD_FILES+=usr/share/man/man3/fd_suspend.3.gz
+OLD_FILES+=usr/share/man/man3/get_ticks.3.gz
+OLD_FILES+=usr/share/man/man3/index_append.3.gz
+OLD_FILES+=usr/share/man/man3/index_append_off.3.gz
+OLD_FILES+=usr/share/man/man3/index_compare.3.gz
+OLD_FILES+=usr/share/man/man3/index_compare_off.3.gz
+OLD_FILES+=usr/share/man/man3/index_decode.3.gz
+OLD_FILES+=usr/share/man/man3/ip_commit.3.gz
+OLD_FILES+=usr/share/man/man3/ip_get.3.gz
+OLD_FILES+=usr/share/man/man3/ip_rollback.3.gz
+OLD_FILES+=usr/share/man/man3/ip_save.3.gz
+OLD_FILES+=usr/share/man/man3/or_register.3.gz
+OLD_FILES+=usr/share/man/man3/or_unregister.3.gz
+OLD_FILES+=usr/share/man/man3/oid_commit.3.gz
+OLD_FILES+=usr/share/man/man3/oid_get.3.gz
+OLD_FILES+=usr/share/man/man3/oid_rollback.3.gz
+OLD_FILES+=usr/share/man/man3/oid_save.3.gz
+OLD_FILES+=usr/share/man/man3/oid_usmNotInTimeWindows.3.gz
+OLD_FILES+=usr/share/man/man3/oid_usmUnknownEngineIDs.3.gz
+OLD_FILES+=usr/share/man/man3/oid_zeroDotZero.3.gz
+OLD_FILES+=usr/share/man/man3/reqid_allocate.3.gz
+OLD_FILES+=usr/share/man/man3/reqid_base.3.gz
+OLD_FILES+=usr/share/man/man3/reqid_istype.3.gz
+OLD_FILES+=usr/share/man/man3/reqid_next.3.gz
+OLD_FILES+=usr/share/man/man3/reqid_type.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_atm.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_bridge.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_hast.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_hostres.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_input_finish.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_input_start.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_lm75.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_mibII.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_netgraph.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_output.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_pdu_auth_access.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_send_port.3.gz
+OLD_FILES+=usr/share/man/man3/snmp_send_trap.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_target.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_usm.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_vacm.3.gz
 OLD_FILES+=usr/share/man/man3/snmp_wlan.3.gz
+OLD_FILES+=usr/share/man/man3/snmpd_target_stat.3.gz
+OLD_FILES+=usr/share/man/man3/snmpd_usmstats.3.gz
 OLD_FILES+=usr/share/man/man3/snmpmod.3.gz
+OLD_FILES+=usr/share/man/man3/start_tick.3.gz
+OLD_FILES+=usr/share/man/man3/string_commit.3.gz
+OLD_FILES+=usr/share/man/man3/string_fre

svn commit: r310913 - stable/10/usr.sbin/bsnmpd/modules/snmp_pf

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:45:01 2016
New Revision: 310913
URL: https://svnweb.freebsd.org/changeset/base/310913

Log:
  MFstable/11 r310902:
  
  MFC r310669:
  
  style(9): clean up whitespace

Modified:
  stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:43:32 
2016(r310912)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:45:01 
2016(r310913)
@@ -1640,20 +1640,20 @@ err:
 static int
 altq_is_enabled(int pfdev)
 {
-struct pfioc_altq pa;
+   struct pfioc_altq pa;
 
errno = 0;
-if (ioctl(pfdev, DIOCGETALTQS, &pa)) {
-if (errno == ENODEV) {
+   if (ioctl(pfdev, DIOCGETALTQS, &pa)) {
+   if (errno == ENODEV) {
syslog(LOG_INFO, "No ALTQ support in kernel\n"
"ALTQ related functions disabled\n");
-return (0);
-} else
-syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s",
+   return (0);
+   } else
+   syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s",
strerror(errno));
return (-1);
-}
-return (1);
+   }
+   return (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: r310912 - stable/10/usr.sbin/bsnmpd/tools/libbsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:43:32 2016
New Revision: 310912
URL: https://svnweb.freebsd.org/changeset/base/310912

Log:
  MFstable/11 r310911:
  
  MFC r310668:
  
  style(9) fixes: clean up leading whitespace

Modified:
  stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==
--- stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c  Sat Dec 31 
10:41:51 2016(r310911)
+++ stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c  Sat Dec 31 
10:43:32 2016(r310912)
@@ -1093,6 +1093,7 @@ snmp_ip2asn_oid(char *str, struct asn_oi
char *endptr, *ptr;
 
ptr = str;
+
for (i = 0; i < 4; i++) {
v = strtoul(ptr, &endptr, 10);
if (v > 0xff)
___
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: r310911 - stable/11/usr.sbin/bsnmpd/tools/libbsnmptools

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:41:51 2016
New Revision: 310911
URL: https://svnweb.freebsd.org/changeset/base/310911

Log:
  MFC r310668:
  
  style(9) fixes: clean up leading whitespace

Modified:
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==
--- stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c  Sat Dec 31 
10:40:59 2016(r310910)
+++ stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c  Sat Dec 31 
10:41:51 2016(r310911)
@@ -1093,6 +1093,7 @@ snmp_ip2asn_oid(char *str, struct asn_oi
char *endptr, *ptr;
 
ptr = str;
+
for (i = 0; i < 4; i++) {
v = strtoul(ptr, &endptr, 10);
if (v > 0xff)
___
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: r310910 - stable/10/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:40:59 2016
New Revision: 310910
URL: https://svnweb.freebsd.org/changeset/base/310910

Log:
  MFstable/11 r310909:
  
  MFC r310500,r310660:
  
  r310500:
  
  Minor style(9) fixes
  
  - Trailing whitespace cleanup
  - Sort variables in snmp_dialog(..) by alignment
  
  No functional change
  
  r310660:
  
  style(9): fix whitespace in pdu_encode_secparams(..)

Modified:
  stable/10/contrib/bsnmp/lib/snmp.c
  stable/10/contrib/bsnmp/lib/snmpclient.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/lib/snmp.c
==
--- stable/10/contrib/bsnmp/lib/snmp.c  Sat Dec 31 10:40:02 2016
(r310909)
+++ stable/10/contrib/bsnmp/lib/snmp.c  Sat Dec 31 10:40:59 2016
(r310910)
@@ -355,8 +355,8 @@ static enum snmp_code
 pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu)
 {
u_char buf[256], *sptr;
-struct asn_buf tb;
-size_t auth_off, moved = 0;
+   struct asn_buf tb;
+   size_t auth_off, moved = 0;
 
auth_off = 0;
memset(buf, 0, 256);

Modified: stable/10/contrib/bsnmp/lib/snmpclient.c
==
--- stable/10/contrib/bsnmp/lib/snmpclient.cSat Dec 31 10:40:02 2016
(r310909)
+++ stable/10/contrib/bsnmp/lib/snmpclient.cSat Dec 31 10:40:59 2016
(r310910)
@@ -1214,7 +1214,7 @@ snmp_next_reqid(struct snmp_client * c)
int32_t i;
 
i = c->next_reqid;
-   if (c->next_reqid >= c->max_reqid)  
+   if (c->next_reqid >= c->max_reqid)
c->next_reqid = c->min_reqid;
else
c->next_reqid++;
@@ -1230,7 +1230,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
 u_char *buf;
 struct asn_buf b;
 ssize_t ret;
- 
+
if ((buf = malloc(snmp_client.txbuflen)) == NULL) {
seterr(&snmp_client, "%s", strerror(errno));
return (-1);
@@ -1684,9 +1684,9 @@ snmp_dialog(struct snmp_v1_pdu *req, str
struct timeval tv = snmp_client.timeout;
struct timeval end;
struct snmp_pdu pdu;
-   u_int i;
-   int32_t reqid;
int ret;
+   int32_t reqid;
+   u_int i;
 
/*
 * Make a copy of the request and replace the syntaxes by 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: r310909 - stable/11/contrib/bsnmp/lib

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:40:02 2016
New Revision: 310909
URL: https://svnweb.freebsd.org/changeset/base/310909

Log:
  MFC r310500,r310660:
  
  r310500:
  
  Minor style(9) fixes
  
  - Trailing whitespace cleanup
  - Sort variables in snmp_dialog(..) by alignment
  
  No functional change
  
  r310660:
  
  style(9): fix whitespace in pdu_encode_secparams(..)

Modified:
  stable/11/contrib/bsnmp/lib/snmp.c
  stable/11/contrib/bsnmp/lib/snmpclient.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/lib/snmp.c
==
--- stable/11/contrib/bsnmp/lib/snmp.c  Sat Dec 31 10:38:58 2016
(r310908)
+++ stable/11/contrib/bsnmp/lib/snmp.c  Sat Dec 31 10:40:02 2016
(r310909)
@@ -355,8 +355,8 @@ static enum snmp_code
 pdu_encode_secparams(struct asn_buf *b, struct snmp_pdu *pdu)
 {
u_char buf[256], *sptr;
-struct asn_buf tb;
-size_t auth_off, moved = 0;
+   struct asn_buf tb;
+   size_t auth_off, moved = 0;
 
auth_off = 0;
memset(buf, 0, 256);

Modified: stable/11/contrib/bsnmp/lib/snmpclient.c
==
--- stable/11/contrib/bsnmp/lib/snmpclient.cSat Dec 31 10:38:58 2016
(r310908)
+++ stable/11/contrib/bsnmp/lib/snmpclient.cSat Dec 31 10:40:02 2016
(r310909)
@@ -1214,7 +1214,7 @@ snmp_next_reqid(struct snmp_client * c)
int32_t i;
 
i = c->next_reqid;
-   if (c->next_reqid >= c->max_reqid)  
+   if (c->next_reqid >= c->max_reqid)
c->next_reqid = c->min_reqid;
else
c->next_reqid++;
@@ -1230,7 +1230,7 @@ snmp_send_packet(struct snmp_pdu * pdu)
u_char *buf;
struct asn_buf b;
ssize_t ret;
- 
+
if ((buf = malloc(snmp_client.txbuflen)) == NULL) {
seterr(&snmp_client, "%s", strerror(errno));
return (-1);
@@ -1684,9 +1684,9 @@ snmp_dialog(struct snmp_v1_pdu *req, str
struct timeval tv = snmp_client.timeout;
struct timeval end;
struct snmp_pdu pdu;
-   u_int i;
-   int32_t reqid;
int ret;
+   int32_t reqid;
+   u_int i;
 
/*
 * Make a copy of the request and replace the syntaxes by 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: r310908 - stable/10/usr.sbin/bsnmpd/modules/snmp_bridge

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:38:58 2016
New Revision: 310908
URL: https://svnweb.freebsd.org/changeset/base/310908

Log:
  MFstable/11 r310905:
  
  MFC r310667:
  
  style(9) fixes: clean up leading whitespace

Modified:
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c  Sat Dec 31 
10:37:56 2016(r310907)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c  Sat Dec 31 
10:38:58 2016(r310908)
@@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum
} else
s_len = 0;
 
-len = sizeof(i);
+   len = sizeof(i);
 
strcpy(mib_name, bridge_sysctl);
 
___
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: r310906 - stable/10/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:37:50 2016
New Revision: 310906
URL: https://svnweb.freebsd.org/changeset/base/310906

Log:
  MFstable/11 r310904:
  
  MFC r310662,r310663:
  
  r310662:
  
  style(9): snmp_send_packet(..): fix whitespace
  
  r310663:
  
  style(9): ip_get(..): clean up whitespace

Modified:
  stable/10/contrib/bsnmp/snmpd/export.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/snmpd/export.c
==
--- stable/10/contrib/bsnmp/snmpd/export.c  Sat Dec 31 10:37:39 2016
(r310905)
+++ stable/10/contrib/bsnmp/snmpd/export.c  Sat Dec 31 10:37:50 2016
(r310906)
@@ -194,6 +194,7 @@ ip_get(struct snmp_value *value, u_char 
value->v.ipaddress[1] = valp[1];
value->v.ipaddress[2] = valp[2];
value->v.ipaddress[3] = valp[3];
+
return (SNMP_ERR_NOERROR);
 }
 
___
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: r310907 - head/sys/vm

2016-12-31 Thread Mateusz Guzik
Author: mjg
Date: Sat Dec 31 10:37:56 2016
New Revision: 310907
URL: https://svnweb.freebsd.org/changeset/base/310907

Log:
  Use vrefact in vnode_pager_alloc.

Modified:
  head/sys/vm/vnode_pager.c

Modified: head/sys/vm/vnode_pager.c
==
--- head/sys/vm/vnode_pager.c   Sat Dec 31 10:37:50 2016(r310906)
+++ head/sys/vm/vnode_pager.c   Sat Dec 31 10:37:56 2016(r310907)
@@ -265,7 +265,7 @@ retry:
 #endif
VM_OBJECT_WUNLOCK(object);
}
-   vref(vp);
+   vrefact(vp);
return (object);
 }
 
___
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: r310905 - stable/11/usr.sbin/bsnmpd/modules/snmp_bridge

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:37:39 2016
New Revision: 310905
URL: https://svnweb.freebsd.org/changeset/base/310905

Log:
  MFC r310667:
  
  style(9) fixes: clean up leading whitespace

Modified:
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
==
--- stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c  Sat Dec 31 
10:36:07 2016(r310904)
+++ stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c  Sat Dec 31 
10:37:39 2016(r310905)
@@ -1472,7 +1472,7 @@ bridge_do_pfctl(int32_t bridge_ctl, enum
} else
s_len = 0;
 
-len = sizeof(i);
+   len = sizeof(i);
 
strcpy(mib_name, bridge_sysctl);
 
___
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: r310904 - stable/11/contrib/bsnmp/snmpd

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:36:07 2016
New Revision: 310904
URL: https://svnweb.freebsd.org/changeset/base/310904

Log:
  MFC r310662,r310663:
  
  r310662:
  
  style(9): snmp_send_packet(..): fix whitespace
  
  r310663:
  
  style(9): ip_get(..): clean up whitespace

Modified:
  stable/11/contrib/bsnmp/snmpd/export.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/snmpd/export.c
==
--- stable/11/contrib/bsnmp/snmpd/export.c  Sat Dec 31 10:34:09 2016
(r310903)
+++ stable/11/contrib/bsnmp/snmpd/export.c  Sat Dec 31 10:36:07 2016
(r310904)
@@ -194,6 +194,7 @@ ip_get(struct snmp_value *value, u_char 
value->v.ipaddress[1] = valp[1];
value->v.ipaddress[2] = valp[2];
value->v.ipaddress[3] = valp[3];
+
return (SNMP_ERR_NOERROR);
 }
 
___
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: r310903 - in stable/10: contrib/bsnmp/gensnmpdef contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp...

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:34:09 2016
New Revision: 310903
URL: https://svnweb.freebsd.org/changeset/base/310903

Log:
  MFstable/11 r310901:
  
  MFC r310648:
  
  style(9): clean up trailing whitespace

Modified:
  stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1
  stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.c
  stable/10/contrib/bsnmp/gensnmptree/gensnmptree.1
  stable/10/contrib/bsnmp/gensnmptree/gensnmptree.c
  stable/10/contrib/bsnmp/lib/asn1.3
  stable/10/contrib/bsnmp/lib/asn1.c
  stable/10/contrib/bsnmp/lib/asn1.h
  stable/10/contrib/bsnmp/lib/bsnmpagent.3
  stable/10/contrib/bsnmp/lib/bsnmpclient.3
  stable/10/contrib/bsnmp/lib/bsnmplib.3
  stable/10/contrib/bsnmp/lib/snmp.c
  stable/10/contrib/bsnmp/lib/snmp.h
  stable/10/contrib/bsnmp/lib/snmpagent.c
  stable/10/contrib/bsnmp/lib/snmpagent.h
  stable/10/contrib/bsnmp/lib/snmpclient.c
  stable/10/contrib/bsnmp/lib/snmpclient.h
  stable/10/contrib/bsnmp/lib/snmpcrypto.c
  stable/10/contrib/bsnmp/lib/snmppriv.h
  stable/10/contrib/bsnmp/lib/support.c
  stable/10/contrib/bsnmp/lib/support.h
  stable/10/contrib/bsnmp/snmp_mibII/mibII.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII.h
  stable/10/contrib/bsnmp/snmp_mibII/mibII_begemot.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_ifmib.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_ifstack.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_ip.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_route.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_tcp.c
  stable/10/contrib/bsnmp/snmp_mibII/mibII_tree.def
  stable/10/contrib/bsnmp/snmp_mibII/mibII_udp.c
  stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.3
  stable/10/contrib/bsnmp/snmp_mibII/snmp_mibII.h
  stable/10/contrib/bsnmp/snmp_ntp/NTP-MIB.txt
  stable/10/contrib/bsnmp/snmp_ntp/NTP-PROXY-MIB.txt
  stable/10/contrib/bsnmp/snmp_target/snmp_target.3
  stable/10/contrib/bsnmp/snmp_usm/snmp_usm.3
  stable/10/contrib/bsnmp/snmp_usm/usm_snmp.c
  stable/10/contrib/bsnmp/snmp_vacm/snmp_vacm.3
  stable/10/contrib/bsnmp/snmp_vacm/vacm_snmp.c
  stable/10/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt
  stable/10/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt
  stable/10/contrib/bsnmp/snmpd/FOKUS-MIB.txt
  stable/10/contrib/bsnmp/snmpd/action.c
  stable/10/contrib/bsnmp/snmpd/config.c
  stable/10/contrib/bsnmp/snmpd/export.c
  stable/10/contrib/bsnmp/snmpd/main.c
  stable/10/contrib/bsnmp/snmpd/snmpd.config
  stable/10/contrib/bsnmp/snmpd/snmpd.h
  stable/10/contrib/bsnmp/snmpd/snmpd.sh
  stable/10/contrib/bsnmp/snmpd/snmpmod.3
  stable/10/contrib/bsnmp/snmpd/snmpmod.h
  stable/10/contrib/bsnmp/snmpd/trans_lsock.c
  stable/10/contrib/bsnmp/snmpd/trans_lsock.h
  stable/10/contrib/bsnmp/snmpd/trans_udp.c
  stable/10/contrib/bsnmp/snmpd/trans_udp.h
  stable/10/contrib/bsnmp/snmpd/trap.c
  stable/10/contrib/bsnmp/snmpd/tree.def
  stable/10/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt
  stable/10/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
  stable/10/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt
  stable/10/usr.sbin/bsnmpd/modules/snmp_pf/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_target/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_usm/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile
  stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h
  stable/10/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c
  stable/10/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
  stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
  stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
  stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
  stable/10/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1
==
--- stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:34:04 
2016(r310902)
+++ stable/10/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:34:09 
2016(r310903)
@@ -4,7 +4,7 @@
 .\"All rights reserved.
 .\"
 .\" Author: Harti Brandt 
-.\" 
+.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" mo

svn commit: r310902 - stable/11/usr.sbin/bsnmpd/modules/snmp_pf

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:34:04 2016
New Revision: 310902
URL: https://svnweb.freebsd.org/changeset/base/310902

Log:
  MFC r310669:
  
  style(9): clean up whitespace

Modified:
  stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
==
--- stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:32:49 
2016(r310901)
+++ stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c Sat Dec 31 10:34:04 
2016(r310902)
@@ -1640,20 +1640,20 @@ err:
 static int
 altq_is_enabled(int pfdev)
 {
-struct pfioc_altq pa;
+   struct pfioc_altq pa;
 
errno = 0;
-if (ioctl(pfdev, DIOCGETALTQS, &pa)) {
-if (errno == ENODEV) {
+   if (ioctl(pfdev, DIOCGETALTQS, &pa)) {
+   if (errno == ENODEV) {
syslog(LOG_INFO, "No ALTQ support in kernel\n"
"ALTQ related functions disabled\n");
-return (0);
-} else
-syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s",
+   return (0);
+   } else
+   syslog(LOG_ERR, "DIOCGETALTQS returned an error: %s",
strerror(errno));
return (-1);
-}
-return (1);
+   }
+   return (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: r310901 - in stable/11: contrib/bsnmp/gensnmpdef contrib/bsnmp/gensnmptree contrib/bsnmp/lib contrib/bsnmp/snmp_mibII contrib/bsnmp/snmp_ntp contrib/bsnmp/snmp_target contrib/bsnmp/snmp...

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:32:49 2016
New Revision: 310901
URL: https://svnweb.freebsd.org/changeset/base/310901

Log:
  MFC r310648:
  
  style(9): clean up trailing whitespace

Modified:
  stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1
  stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.c
  stable/11/contrib/bsnmp/gensnmptree/gensnmptree.1
  stable/11/contrib/bsnmp/gensnmptree/gensnmptree.c
  stable/11/contrib/bsnmp/lib/asn1.3
  stable/11/contrib/bsnmp/lib/asn1.c
  stable/11/contrib/bsnmp/lib/asn1.h
  stable/11/contrib/bsnmp/lib/bsnmpagent.3
  stable/11/contrib/bsnmp/lib/bsnmpclient.3
  stable/11/contrib/bsnmp/lib/bsnmplib.3
  stable/11/contrib/bsnmp/lib/snmp.c
  stable/11/contrib/bsnmp/lib/snmp.h
  stable/11/contrib/bsnmp/lib/snmpagent.c
  stable/11/contrib/bsnmp/lib/snmpagent.h
  stable/11/contrib/bsnmp/lib/snmpclient.c
  stable/11/contrib/bsnmp/lib/snmpclient.h
  stable/11/contrib/bsnmp/lib/snmpcrypto.c
  stable/11/contrib/bsnmp/lib/snmppriv.h
  stable/11/contrib/bsnmp/lib/support.c
  stable/11/contrib/bsnmp/lib/support.h
  stable/11/contrib/bsnmp/snmp_mibII/mibII.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII.h
  stable/11/contrib/bsnmp/snmp_mibII/mibII_begemot.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_ifmib.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_ifstack.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_ip.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_nettomedia.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_rcvaddr.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_route.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_tcp.c
  stable/11/contrib/bsnmp/snmp_mibII/mibII_tree.def
  stable/11/contrib/bsnmp/snmp_mibII/mibII_udp.c
  stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.3
  stable/11/contrib/bsnmp/snmp_mibII/snmp_mibII.h
  stable/11/contrib/bsnmp/snmp_ntp/NTP-MIB.txt
  stable/11/contrib/bsnmp/snmp_ntp/NTP-PROXY-MIB.txt
  stable/11/contrib/bsnmp/snmp_target/snmp_target.3
  stable/11/contrib/bsnmp/snmp_usm/snmp_usm.3
  stable/11/contrib/bsnmp/snmp_usm/usm_snmp.c
  stable/11/contrib/bsnmp/snmp_vacm/snmp_vacm.3
  stable/11/contrib/bsnmp/snmp_vacm/vacm_snmp.c
  stable/11/contrib/bsnmp/snmpd/BEGEMOT-MIB.txt
  stable/11/contrib/bsnmp/snmpd/BEGEMOT-SNMPD.txt
  stable/11/contrib/bsnmp/snmpd/FOKUS-MIB.txt
  stable/11/contrib/bsnmp/snmpd/action.c
  stable/11/contrib/bsnmp/snmpd/config.c
  stable/11/contrib/bsnmp/snmpd/export.c
  stable/11/contrib/bsnmp/snmpd/main.c
  stable/11/contrib/bsnmp/snmpd/snmpd.config
  stable/11/contrib/bsnmp/snmpd/snmpd.h
  stable/11/contrib/bsnmp/snmpd/snmpd.sh
  stable/11/contrib/bsnmp/snmpd/snmpmod.3
  stable/11/contrib/bsnmp/snmpd/snmpmod.h
  stable/11/contrib/bsnmp/snmpd/trans_lsock.c
  stable/11/contrib/bsnmp/snmpd/trans_lsock.h
  stable/11/contrib/bsnmp/snmpd/trans_udp.c
  stable/11/contrib/bsnmp/snmpd/trans_udp.h
  stable/11/contrib/bsnmp/snmpd/trap.c
  stable/11/contrib/bsnmp/snmpd/tree.def
  stable/11/usr.sbin/bsnmpd/modules/snmp_atm/BEGEMOT-ATM-FREEBSD-MIB.txt
  stable/11/usr.sbin/bsnmpd/modules/snmp_atm/atm_sys.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/BEGEMOT-BRIDGE-MIB.txt
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3
  stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
  stable/11/usr.sbin/bsnmpd/modules/snmp_netgraph/snmp_netgraph.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_pf/BEGEMOT-PF-MIB.txt
  stable/11/usr.sbin/bsnmpd/modules/snmp_pf/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_target/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_usm/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile
  stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.c
  stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h
  stable/11/usr.sbin/bsnmpd/modules/snmp_wlan/wlan_sys.c
  stable/11/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpmap.c
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
  stable/11/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1
==
--- stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:30:56 
2016(r310900)
+++ stable/11/contrib/bsnmp/gensnmpdef/gensnmpdef.1 Sat Dec 31 10:32:49 
2016(r310901)
@@ -4,7 +4,7 @@
 .\"All rights reserved.
 .\"
 .\" Author: Harti Brandt 
-.\" 
+.\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted 

svn commit: r310900 - stable/10/usr.sbin/bsnmpd/modules/snmp_hostres

2016-12-31 Thread Ngie Cooper
Author: ngie
Date: Sat Dec 31 10:30:56 2016
New Revision: 310900
URL: https://svnweb.freebsd.org/changeset/base/310900

Log:
  MFstable/11 r310899:
  
  MFC r310666,r310675:
  
  r310666:
  
  style(9) fixes
  
  - Clean up trailing whitespace
  - Fix variable type alignment in storage_OS_get_swap(..)
  
  r310675:
  
  Fix the build by moving the initializers for len/nswapdev down below the
  declarations
  
  Pointyhat to: ngie

Modified:
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 
31 10:28:59 2016(r310899)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c Sat Dec 
31 10:30:56 2016(r310900)
@@ -123,7 +123,7 @@ device_entry_create(const char *name, co
if (map == NULL) {
/* new object - get a new index */
if (next_device_index > INT_MAX) {
-   syslog(LOG_ERR,
+   syslog(LOG_ERR,
"%s: hrDeviceTable index wrap", __func__);
/* There isn't much we can do here.
 * If the next_swins_index is consumed

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 
31 10:28:59 2016(r310899)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c Sat Dec 
31 10:30:56 2016(r310900)
@@ -131,7 +131,7 @@ static const struct {
const struct asn_oid*oid;   /* the OID to return */
 } fs_type_map[] = {
{ "ufs",&OIDX_hrFSBerkeleyFFS_c },
-   { "zfs",&OIDX_hrFSOther_c },
+   { "zfs",&OIDX_hrFSOther_c },
{ "cd9660", &OIDX_hrFSiso9660_c },
{ "nfs",&OIDX_hrFSNFS_c },
{ "ext2fs", &OIDX_hrFSLinuxExt2_c },
@@ -167,7 +167,7 @@ fs_entry_create(const char *name)
/* new object - get a new index */
if (next_fs_index > INT_MAX) {
/* Unrecoverable error - die clean and quicly*/
-   syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
+   syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
errx(EX_SOFTWARE, "hrFSTable index wrap");
}
 

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c  
Sat Dec 31 10:28:59 2016(r310899)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c  
Sat Dec 31 10:30:56 2016(r310900)
@@ -177,7 +177,7 @@ partition_entry_create(int32_t ds_index,
 
if (next_partition_index > INT_MAX) {
/* Unrecoverable error - die clean and quicly*/
-   syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
+   syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
__func__);
errx(EX_SOFTWARE, "hrPartitionTable index wrap");
}

Modified: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
==
--- stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cSat Dec 
31 10:28:59 2016(r310899)
+++ stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.cSat Dec 
31 10:30:56 2016(r310900)
@@ -193,7 +193,7 @@ OS_getSystemInitialLoadParameters(u_char
syslog(LOG_ERR, "malloc failed");
return (SNMP_ERR_GENERR);
}
-if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
+   if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
syslog(LOG_ERR,
"sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m");
free(buf);
@@ -296,7 +296,7 @@ OS_getMemorySize(uint32_t *ms)
*ms = UINT32_MAX;
else
*ms = phys_mem_size;
-return (SNMP_ERR_NOERROR);
+  

  1   2   >