]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
9 years agoImprove and document `ctladm portlist` subcommand.
mav [Sun, 12 Oct 2014 06:55:34 +0000 (06:55 +0000)]
Improve and document `ctladm portlist` subcommand.

Make this subcommand less FC-specific, reporting target and port addresses
in more generic way.  Also make it report list of connected initiators in
unified way, working for both FC and iSCSI, and potentially others.

MFC after: 1 week

9 years agoAdd env and prepend to _rc_namevarlist.
hrs [Sun, 12 Oct 2014 02:42:36 +0000 (02:42 +0000)]
Add env and prepend to _rc_namevarlist.

9 years agoAdd ${name}_env and ${name}_prepend. ${name}_env is an argument list which
hrs [Sat, 11 Oct 2014 23:49:27 +0000 (23:49 +0000)]
Add ${name}_env and ${name}_prepend.  ${name}_env is an argument list which
will be passed to env(1).  ${name}_prepend is simply prepended to the command
line for $command.

9 years agoCheck buffer length more strictly.
hrs [Sat, 11 Oct 2014 23:24:09 +0000 (23:24 +0000)]
Check buffer length more strictly.

MFC after: 1 day

9 years agoFix off-by-one.
hrs [Sat, 11 Oct 2014 23:08:00 +0000 (23:08 +0000)]
Fix off-by-one.

MFC after: 1 day

9 years agopstat(8): Correct description of the SESS column in pstat -t.
jilles [Sat, 11 Oct 2014 21:53:06 +0000 (21:53 +0000)]
pstat(8): Correct description of the SESS column in pstat -t.

MFC after: 1 week

9 years agoAdd a new option, -P, to pkt-gen which reads a single packet from a stored
gnn [Sat, 11 Oct 2014 21:43:05 +0000 (21:43 +0000)]
Add a new option, -P, to pkt-gen which reads a single packet from a stored
pcap file and transmits it instead of the default UDP packet.

Reviewed by: luigi
MFC after: 2 weeks

9 years agoFix buffer overrun.
hrs [Sat, 11 Oct 2014 20:46:06 +0000 (20:46 +0000)]
Fix buffer overrun.

MFC after: 1 day

9 years agoRename s/network/netif/ and set netif_enable for namespace consistency.
hrs [Sat, 11 Oct 2014 20:28:04 +0000 (20:28 +0000)]
Rename s/network/netif/ and set netif_enable for namespace consistency.

9 years agoddb: space/tab fixes.
pfg [Sat, 11 Oct 2014 20:25:19 +0000 (20:25 +0000)]
ddb: space/tab fixes.

No functional change.

MFC after: 3 days

9 years agoAdd locking and mark MPSAFE.
jhb [Sat, 11 Oct 2014 19:36:59 +0000 (19:36 +0000)]
Add locking and mark MPSAFE.
- Add a mutex to protect the softc.
- Use callout(9) instead of timeout(9).
- Consolidate duplicated detach routines into a bus-independent detach
  routine.
- Add an extra sleep lock flag (MSESC_READING) to prevent other readers
  from reading while the first reader is copying data out of sc_bytes[]
  via uiomove().
- Use bus_*() instead of bus_space_*().

Tested by: nyan

9 years agoDo not set IN_ACCESS flag for read-only mounts. The IN_ACCESS
kib [Sat, 11 Oct 2014 19:09:56 +0000 (19:09 +0000)]
Do not set IN_ACCESS flag for read-only mounts.  The IN_ACCESS
survives remount in rw, also it is set for vnodes on rootfs before
noatime can be set or clock is adjusted.  All conditions result in
wrong atime for accessed vnodes.

Submitted by: bde
MFC after: 1 week

9 years agoBump FreeBSD_version due to cleanup of tcp wrapper header.
pfg [Sat, 11 Oct 2014 18:58:58 +0000 (18:58 +0000)]
Bump FreeBSD_version due to cleanup of tcp wrapper header.

Due to revisions r272949 and r272950 which should affect
positively some ports.

9 years agotcpd.h: add prototype for hosts_ctl
pfg [Sat, 11 Oct 2014 18:54:37 +0000 (18:54 +0000)]
tcpd.h: add prototype for hosts_ctl

According the hosts_access(3) man page the hosts_ctl() prototype
should be in tcpd.h. For now, follow other declarations and don't
add the arguments in the prototype.

Reference:
https://www.illumos.org/issues/4385

PR: 32808
MFC after: 2 weeks

9 years agotcpd: complete function prototypes.
pfg [Sat, 11 Oct 2014 18:34:10 +0000 (18:34 +0000)]
tcpd: complete function prototypes.

This clears up at least a build issues on mysql-server
ports. While here also replace some spaces with tabs
in our headers.

PR: 42336
MFC after: 2 weeks

9 years agoGive physical and virtual ports numbers some more meaning.
mav [Sat, 11 Oct 2014 17:52:54 +0000 (17:52 +0000)]
Give physical and virtual ports numbers some more meaning.

9 years agoFix nits in previous commit:
marcel [Sat, 11 Oct 2014 16:34:01 +0000 (16:34 +0000)]
Fix nits in previous commit:
1.  Remove initializer for badstack_sbuf_size; it gets set unconditionally.
2.  Remove meaningless comment.
3.  Group witness_count and its sysctl together.
4.  Fix spacing in for statements (space after for and within condition).
5.  Change *all* M_NOWAIT usages in witness_initialize() to M_WAITOK; not
    just those that were newly introduced -- the allocation is assumed to
    succeed for all allocations.
6.  Avoid using uint8_t as the base type in sizeof() expressions; Use the
    variable name (w_rmatrix) as much as possible.

Pointed out by: jhb@ (thanks!)

9 years agoMFi386 r272761.
kib [Sat, 11 Oct 2014 16:17:49 +0000 (16:17 +0000)]
MFi386 r272761.

Noted by: Holger Hans Peter Freyther <holger at freyther.de>
Sponsored by: The FreeBSD Foundation
MFC after: 10 days

9 years agoUpdate ip_divert.ko to depend on version 3 of ipfw.
jhb [Sat, 11 Oct 2014 16:08:54 +0000 (16:08 +0000)]
Update ip_divert.ko to depend on version 3 of ipfw.

9 years agoFix KASSERT typo.
melifaro [Sat, 11 Oct 2014 15:04:50 +0000 (15:04 +0000)]
Fix KASSERT typo.

9 years agoShorten frontend name.
mav [Sat, 11 Oct 2014 12:56:49 +0000 (12:56 +0000)]
Shorten frontend name.

9 years agoFilter out duplicate AC_PATH_REGISTERED async events.
mav [Sat, 11 Oct 2014 10:19:37 +0000 (10:19 +0000)]
Filter out duplicate AC_PATH_REGISTERED async events.

Queued async events handling in CAM opened race, that may lead to duplicate
AC_PATH_REGISTERED events delivery during boot.  That was not happening
before r272935 because the driver was initialized later.  After that change
it started create duplicate ports in CTL.

9 years agoFix r272936 build with old GCC.
mav [Sat, 11 Oct 2014 08:50:19 +0000 (08:50 +0000)]
Fix r272936 build with old GCC.

MFC after: 1 week

9 years agoUpdate isp_tgt_map and send new arrival notification if target that departed
mav [Sat, 11 Oct 2014 07:59:15 +0000 (07:59 +0000)]
Update isp_tgt_map and send new arrival notification if target that departed
earlier has returned.  Previously that code worked only once, confusing CTL.

MFC after: 1 month

9 years agoMark CTL frontend's CAM driver as CAM_PERIPH_DRV_EARLY.
mav [Sat, 11 Oct 2014 07:49:27 +0000 (07:49 +0000)]
Mark CTL frontend's CAM driver as CAM_PERIPH_DRV_EARLY.

Target mode operation does not depend on the initiator mode scan process.
This change allows the target driver to attach earlier and receive some
async events (like AC_CONTRACT) that could be lost otherwise.

MFC after: 1 week

9 years agoMark iscontrol(8) and iscsi_initiator(4) obsolete.
trasz [Sat, 11 Oct 2014 05:18:22 +0000 (05:18 +0000)]
Mark iscontrol(8) and iscsi_initiator(4) obsolete.

Differential Revision: https://reviews.freebsd.org/D931
Reviewed by: wblock@
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

9 years agoAdd assertion to catch duplicated notes.
trasz [Sat, 11 Oct 2014 05:11:23 +0000 (05:11 +0000)]
Add assertion to catch duplicated notes.

Sponsored by: The FreeBSD Foundation

9 years agoTurn WITNESS_COUNT into a tunable and sysctl. This allows adjusting
marcel [Sat, 11 Oct 2014 02:02:58 +0000 (02:02 +0000)]
Turn WITNESS_COUNT into a tunable and sysctl. This allows adjusting
the value without recompiling the kernel.  This is useful when
recompiling is not possible as an immediate solution. When we run out
of witness objects, witness is completely disabled. Not having an
immediate solution can therefore be problematic.

Submitted by: Sreekanth Rupavatharam <rupavath@juniper.net>
Obtained from: Juniper Networks, Inc.

9 years agoAdd LDFLAGS to PROG_VARS so it can be overridden on a per-PROG basis
ngie [Fri, 10 Oct 2014 22:18:09 +0000 (22:18 +0000)]
Add LDFLAGS to PROG_VARS so it can be overridden on a per-PROG basis

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoPort the testcase to FreeBSD
ngie [Fri, 10 Oct 2014 21:22:25 +0000 (21:22 +0000)]
Port the testcase to FreeBSD

- Make #include path to h_macros.h a non-relative path
- __gl_stat_t is synonymous with struct stat on FreeBSD
- FreeBSD doesn't have _DIRENT_RECLEN
- Skip over glob_star on FreeBSD (testcase doesn't pass)

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoSkip over t_spawn_open_nonexistent_diag because it requires NetBSD specific
ngie [Fri, 10 Oct 2014 21:19:17 +0000 (21:19 +0000)]
Skip over t_spawn_open_nonexistent_diag because it requires NetBSD specific
additions to posix_spawn

Sponsored by: EMC / Isilon Storage Division

9 years agoRemove redundant if_notifier declaration.
melifaro [Fri, 10 Oct 2014 20:37:06 +0000 (20:37 +0000)]
Remove redundant if_notifier declaration.

9 years agoMake ctld start even if some LUNs are unable to open backing storage.
mav [Fri, 10 Oct 2014 19:41:09 +0000 (19:41 +0000)]
Make ctld start even if some LUNs are unable to open backing storage.

Such LUNs will be visible to initiators, but return "not ready" status
on media access commands.  If backing storage become available later,
`ctladm modify ...` or `service ctld reload` can trigger its reopen.

9 years agoSIGPWR does not exist on FreeBSD
ngie [Fri, 10 Oct 2014 19:34:19 +0000 (19:34 +0000)]
SIGPWR does not exist on FreeBSD

Sponsored by: EMC / Isilon Storage Division

9 years agoHandle getting/setting niceness/priority correctly on FreeBSD vs NetBSD
ngie [Fri, 10 Oct 2014 19:32:53 +0000 (19:32 +0000)]
Handle getting/setting niceness/priority correctly on FreeBSD vs NetBSD

This might be fallout from PR: 189821

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoDisable the invalid pointer test on FreeBSD
ngie [Fri, 10 Oct 2014 19:28:57 +0000 (19:28 +0000)]
Disable the invalid pointer test on FreeBSD

FreeBSD segfaults on invalid pointers passed to getcwd because it throbs the
address passed in in libc, whereas NetBSD just passes the information off to
the syscall, which allows the kernel to return EFAULT on bad pointers.

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoMake MAP_NOSYNC handling in the vm_fault() read-locked object path
kib [Fri, 10 Oct 2014 19:27:36 +0000 (19:27 +0000)]
Make MAP_NOSYNC handling in the vm_fault() read-locked object path
compatible with write-locked path.  Test for MAP_ENTRY_NOSYNC and set
VPO_NOSYNC for pages with dirty mask zero (this does not exclude a
possibility that the page is dirty, e.g. due to read fault on
writeable mapping and consequent write; the same issue exists in the
slow path).

Use helper vm_fault_dirty() to unify fast and slow path handling of
VPO_NOSYNC and setting the dirty mask.

Reviewed by: alc
Sponsored by: The FreeBSD Foundation

9 years agoChange the PF hash from Jenkins to Murmur3. In forwarding tests
gnn [Fri, 10 Oct 2014 19:26:26 +0000 (19:26 +0000)]
Change the PF hash from Jenkins to Murmur3.  In forwarding tests
this showed a conservative 3% incrase in PPS.

Differential Revision: https://reviews.freebsd.org/D461
Submitted by: des
Reviewed by: emaste
MFC after: 1 month

9 years agoFreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in
ngie [Fri, 10 Oct 2014 19:18:52 +0000 (19:18 +0000)]
FreeBSD doesn't support strings greater than MAXHOSTNAMELEN-1 in
{get,set}{domain,host}name. Adjust the tests to not exceed that
value when testing out the code

Add a positive and negative test for MAXHOSTNAMELEN-1 and
MAXHOSTNAMELEN, respectively

PR: 181127
In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoDon't pass RF_ALLOCATED to bus_alloc_resource().
jhb [Fri, 10 Oct 2014 19:12:04 +0000 (19:12 +0000)]
Don't pass RF_ALLOCATED to bus_alloc_resource().

9 years agoFreeBSD returns ENOTTY instead of EBADF in ttyname_r; mark it as an expected
ngie [Fri, 10 Oct 2014 19:02:02 +0000 (19:02 +0000)]
FreeBSD returns ENOTTY instead of EBADF in ttyname_r; mark it as an expected
failure

PR: 191936

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoAdd missing #include <sys/time.h> for gettimeofday
ngie [Fri, 10 Oct 2014 18:59:18 +0000 (18:59 +0000)]
Add missing #include <sys/time.h> for gettimeofday

Sponsored by: EMC / Isilon Storage Division

9 years agoDisable tests that don't pass on FreeBSD due to missing support in
ngie [Fri, 10 Oct 2014 18:57:39 +0000 (18:57 +0000)]
Disable tests that don't pass on FreeBSD due to missing support in
humanize_number(3). Bringing in additional revisions from NetBSD's
humanize_number(3) will fix the tests

Account for the fact that util.h on NetBSD is libutil.h on FreeBSD

Submitted by: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoFix KASSERT argument type.
melifaro [Fri, 10 Oct 2014 18:57:12 +0000 (18:57 +0000)]
Fix KASSERT argument type.

9 years agoFix NOINET6 build for ipfw.
melifaro [Fri, 10 Oct 2014 18:31:35 +0000 (18:31 +0000)]
Fix NOINET6 build for ipfw.

9 years agoPartially fix build on !amd64
melifaro [Fri, 10 Oct 2014 17:24:56 +0000 (17:24 +0000)]
Partially fix build on !amd64

Pointed by: bz

9 years agoVarious fixes to stats:
jhb [Fri, 10 Oct 2014 16:36:25 +0000 (16:36 +0000)]
Various fixes to stats:
- Read the counts of received, dropped, and transmitted management
  packets and add sysctl nodes for them.
- Fix the total octets received/transmitted to read all 64 bits of
  the counters.
- Add missing sysctl nodes for rlec, tncrs, fcruc, tor, and tot.
- Remove spurious spaces.

Reviewed by: Eric Joyner @ Intel
MFC after: 1 week

9 years agoo Add machine-dependent SMP part
br [Fri, 10 Oct 2014 14:35:51 +0000 (14:35 +0000)]
o Add machine-dependent SMP part
o Enable SMP

Sponsored by: DARPA, AFRL

9 years agoFix typo revealed by using newer binutils
bapt [Fri, 10 Oct 2014 14:18:33 +0000 (14:18 +0000)]
Fix typo revealed by using newer binutils

Differential Revision: https://reviews.freebsd.org/D933
Reviewed by: marius

9 years agoUse FreeBSD-bit-checking-style
bapt [Fri, 10 Oct 2014 14:17:42 +0000 (14:17 +0000)]
Use FreeBSD-bit-checking-style
This appease gcc 4.9 issuing warnings about parentheses

Differential Revision: https://reviews.freebsd.org/D933
Reviewed by: marius

9 years agoStore persistent reservation keys as uint64_t instead of uint8_t[8].
mav [Fri, 10 Oct 2014 12:38:53 +0000 (12:38 +0000)]
Store persistent reservation keys as uint64_t instead of uint8_t[8].

This allows to simplify the code and save 512KB of RAM per LUN (8%)
by removing no longer needed "registered" keys flags.

9 years agoExpect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic
ngie [Fri, 10 Oct 2014 08:57:55 +0000 (08:57 +0000)]
Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic

See bin/189805 for more details

In collaboration with: pho
Sponsored by: EMC / Isilon Storage Division

9 years agoOnly build/run hsearch_basic and hsearch_r_basic on NetBSD
ngie [Fri, 10 Oct 2014 08:35:16 +0000 (08:35 +0000)]
Only build/run hsearch_basic and hsearch_r_basic on NetBSD

hdestroy1 is not present on FreeBSD

Sponsored by: EMC / Isilon Storage Division

9 years agoVirtualize if_epair(4). An if_xname check for both "a" and "b" interfaces
hrs [Fri, 10 Oct 2014 06:45:13 +0000 (06:45 +0000)]
Virtualize if_epair(4).  An if_xname check for both "a" and "b" interfaces
is added to return EEXIST when only "b" interface exists---this can happen
when epair<N>b is moved to a vnet jail and then "ifconfig epair<N> create"
is invoked there.

9 years agoRename elf*-powerpc into elf*-powerpc-freebsd in binutils
bapt [Fri, 10 Oct 2014 06:24:09 +0000 (06:24 +0000)]
Rename elf*-powerpc into elf*-powerpc-freebsd in binutils

The powerpc support was the only supported architecture not prepending the elf format name
with "-freebsd" in base this change makes it consistent with other architectures.
On newer version of binutils the powerpc format is also prepended with "-freebsd".

Also modify the kernel ldscripts in that regards.

As a result it is now possible cross build the kernel on powerpc using newer binutils

Differential Revision: https://reviews.freebsd.org/D926
Differential Revision: https://reviews.freebsd.org/D928

9 years agoMake sure SIZE is defined early
bapt [Fri, 10 Oct 2014 06:09:47 +0000 (06:09 +0000)]
Make sure SIZE is defined early

9 years agoAdd context pointer and source address to the UDP tunnel callback
bryanv [Fri, 10 Oct 2014 06:08:59 +0000 (06:08 +0000)]
Add context pointer and source address to the UDP tunnel callback

These are needed for the forthcoming vxlan implementation. The context
pointer means we do not have to use a spare pointer field in the inpcb,
and the source address is required to populate vxlan's forwarding table.

While I highly doubt there is an out of tree consumer of the UDP
tunneling callback, this change may be a difficult to eventually MFC.

Phabricator: https://reviews.freebsd.org/D383
Reviewed by: gnn

9 years agoDo not add late flag when file= is specified because it has a bad
hrs [Fri, 10 Oct 2014 03:20:12 +0000 (03:20 +0000)]
Do not add late flag when file= is specified because it has a bad
side-effect.  The specified file should exist before the fstab line.

Reported by: wblock (long time ago)
MFC after: 1 day

9 years agoaccept(2) may and can return EAGAIN, document it.
delphij [Fri, 10 Oct 2014 03:05:55 +0000 (03:05 +0000)]
accept(2) may and can return EAGAIN, document it.

MFC after: 1 week

9 years agoFor gcc 4.6 and newer, _Static_assert is a keyword, so don't try to
imp [Fri, 10 Oct 2014 00:35:13 +0000 (00:35 +0000)]
For gcc 4.6 and newer, _Static_assert is a keyword, so don't try to
redefine it. It does what we want, and is always available unlike
other alternatives.

9 years agoRestore the backed-out change, using __offsetof instead.
imp [Fri, 10 Oct 2014 00:35:08 +0000 (00:35 +0000)]
Restore the backed-out change, using __offsetof instead.

9 years agoFix a bug in decoding string indexes in snmp_target(3), thus causing
syrinx [Fri, 10 Oct 2014 00:26:28 +0000 (00:26 +0000)]
Fix a bug in decoding string indexes in snmp_target(3), thus causing
bsnmpd(1) to not send v3 notifications properly; while here add two
missing return statements which could lead to abort() in case of a
rollback

9 years agoBuild gperf only if we're using g++ (not clang++)
emaste [Thu, 9 Oct 2014 23:05:31 +0000 (23:05 +0000)]
Build gperf only if we're using g++ (not clang++)

gperf is used as a build tool for g++ and is not needed for Clang
architectures. Ports and third-party software that need it can use the
up-to-date devel/gperf port.

PR: 194103 (exp-run)
Reviewed by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D886

9 years agoUpdate dl_iterate_phdr(3) to follow r272842
emaste [Thu, 9 Oct 2014 22:58:33 +0000 (22:58 +0000)]
Update dl_iterate_phdr(3) to follow r272842

Relnotes: yes
Sponsored by: The FreeBSD Foundation

9 years agoThe value small=2**-(p+3), where p is the precision, can be determine from
kargl [Thu, 9 Oct 2014 22:39:52 +0000 (22:39 +0000)]
The value small=2**-(p+3), where p is the precision, can be determine from
lgamma(x) = -log(x) - log(1+x) + x*(1-g) + x**2*P(x) with g = 0.57...
being the Euler constant and P(x) a polynomial.  Substitution of small
into the RHS shows that the last 3 terms are negligible in comparison to
the leading term.  The choice of 3 may be conservative.

The value large=2**(p+3) is detemined from Stirling's approximation
lgamma(x) = x*(log(x)-1) - log(x)/2 + log(2*pi)/2 + P(1/x)/x
Again, substitution of large into the RHS reveals the last 3 terms
are negligible in comparison to the leading term.

Move the x=+-0 special case into the |x|<small block.

In the ld80 and ld128 implementaion, use fdlibm compatible comparisons
involving ix, lx, and llx.  This replaces several floating point
comparisons (some involving fabsl()) and also fixes the special cases
x=1 and x=2.

While here
  . Remove unnecessary parentheses.
  . Fix/improve comments due to the above changes.
  . Fix nearby whitespace.

* src/e_lgamma_r.c:
  . Sort declaration.
  . Remove unneeded explicit cast for type conversion.
  . Replace a double literal constant by an integer literal constant.

* src/e_lgammaf_r.c:
  . Sort declaration.

* ld128/e_lgammal_r.c:
  . Replace a long double literal constant by a double literal constant.

* ld80/e_lgammal_r.c:
  . Remove unused '#include float.h'
  . Replace a long double literal constant by a double literal constant.

Requested by: bde

9 years agoAdd missing UDP multicast receive dtrace probes
bryanv [Thu, 9 Oct 2014 22:36:21 +0000 (22:36 +0000)]
Add missing UDP multicast receive dtrace probes

Phabricator: https://reviews.freebsd.org/D924
Reviewed by: rpaulo markj
MFC after: 1 month

9 years agoFix problem on big endian systems introduced in r271579 - when we were
pjd [Thu, 9 Oct 2014 20:55:05 +0000 (20:55 +0000)]
Fix problem on big endian systems introduced in r271579 - when we were
returning from handling a nested nvlist we were resetting big-endian flag.

Reported by: Kuleshov Aleksey @ yandex.ru
Tested by: Kuleshov Aleksey @ yandex.ru

9 years agoAlways return pathname in dl_iterate_phdr's dlpi_name, as Linux does
emaste [Thu, 9 Oct 2014 20:39:18 +0000 (20:39 +0000)]
Always return pathname in dl_iterate_phdr's dlpi_name, as Linux does

Linux LD_ITERATE_PHDR(3):
    The dlpi_name field is a null-terminated string giving the
    pathname from which the shared object was loaded.

That functionality is much more useful than returning just the short
name.

Approved by: kan
Sponsored by: The FreeBSD Foundation

9 years agoEnsure that the flags field of sctp_tmit_chunks is initialized.
tuexen [Thu, 9 Oct 2014 20:08:12 +0000 (20:08 +0000)]
Ensure that the flags field of sctp_tmit_chunks is initialized.
Thanks to Peter Bostroem from Google for reporting the issue.

MFC after: 3 days

9 years agoMerge projects/ipfw to HEAD.
melifaro [Thu, 9 Oct 2014 19:32:35 +0000 (19:32 +0000)]
Merge projects/ipfw to HEAD.

Main user-visible changes are related to tables:

* Tables are now identified by names, not numbers.
 There can be up to 65k tables with up to 63-byte long names.
* Tables are now set-aware (default off), so you can switch/move
 them atomically with rules.
* More functionality is supported (swap, lock, limits, user-level lookup,
 batched add/del) by generic table code.
* New table types are added (flow) so you can match multiple packet fields at once.
* Ability to add different type of lookup algorithms for particular
 table type has been added.
* New table algorithms are added (cidr:hash, iface:array, number:array and
 flow:hash) to make certain types of lookup more effective.
* Table value are now capable of holding multiple data fields for
  different tablearg users

Performance changes:
* Main ipfw lock was converted to rmlock
* Rule counters were separated from rule itself and made per-cpu.
* Radix table entries fits into 128 bytes
* struct ip_fw is now more compact so more rules will fit into 64 bytes
* interface tables uses array of existing ifindexes for faster match

ABI changes:
All functionality supported by old ipfw(8) remains functional.
 Old & new binaries can work together with the following restrictions:
* Tables named other than ^\d+$ are shown as table(65535) in
 ruleset in old binaries

Internal changes:.
Changing table ids to numbers resulted in format modification for
 most sockopt codes. Old sopt format was compact, but very hard to
 extend (no versioning, inability to add more opcodes), so
* All relevant opcodes were converted to TLV-based versioned IP_FW3-based codes.
* The remaining opcodes were also converted to be able to eliminate
 all older opcodes at once
* All IP_FW3 handlers uses special API instead of calling sooptcopy*
 directly to ease adding another communication methods
* struct ip_fw is now different for kernel and userland
* tablearg value has been changed to 0 to ease future extensions
* table "values" are now indexes in special value array which
 holds extended data for given index
* Batched add/delete has been added to tables code
* Most changes has been done to permit batched rule addition.
* interface tracking API has been added (started on demand)
 to permit effective interface tables operations
* O(1) skipto cache, currently turned off by default at
 compile-time (eats 512K).

* Several steps has been made towards making libipfw:
  * most of new functions were separated into "parse/prepare/show
    and actuall-do-stuff" pieces (already merged).
  * there are separate functions for parsing text string into "struct ip_fw"
    and printing "struct ip_fw" to supplied buffer (already merged).
* Probably some more less significant/forgotten features

MFC after: 1 month
Sponsored by: Yandex LLC

9 years agoSupport Intel-specific MSRs that are accessed when booting up a linux in bhyve:
neel [Thu, 9 Oct 2014 19:13:33 +0000 (19:13 +0000)]
Support Intel-specific MSRs that are accessed when booting up a linux in bhyve:
- MSR_PLATFORM_INFO
- MSR_TURBO_RATIO_LIMITx
- MSR_RAPL_POWER_UNIT

Reviewed by: grehan
MFC after: 1 week

9 years agoiasl(8) expects integer fields in data tables to be specified as hexadecimal
neel [Thu, 9 Oct 2014 19:02:32 +0000 (19:02 +0000)]
iasl(8) expects integer fields in data tables to be specified as hexadecimal
values. Therefore the bit width of the "PM Timer Block" was actually being
interpreted as 50-bits instead of the expected 32-bit.

This eliminates an error message emitted by a Linux 3.17 guest during boot:
"Invalid length for FADT/PmTimerBlock: 50, using default 32"

Reviewed by: grehan
MFC after: 1 week

9 years agoRemove remnants of some cleanup; no functional changes.
trasz [Thu, 9 Oct 2014 18:49:58 +0000 (18:49 +0000)]
Remove remnants of some cleanup; no functional changes.

Sponsored by: The FreeBSD Foundation

9 years agoMerge HEAD@r272834
melifaro [Thu, 9 Oct 2014 18:03:12 +0000 (18:03 +0000)]
Merge HEAD@r272834

9 years agoDocument the CPU+Pri_Class column rather than CPU+PRI, as the latter isn't
markj [Thu, 9 Oct 2014 17:45:58 +0000 (17:45 +0000)]
Document the CPU+Pri_Class column rather than CPU+PRI, as the latter isn't
used or implemented on FreeBSD.

Reported by: kmacy
Reviewed by: kmacy, rpaulo
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division

9 years agoTwo more places where login_setcryptfmt() defaults to MD5 were missed
des [Thu, 9 Oct 2014 17:39:11 +0000 (17:39 +0000)]
Two more places where login_setcryptfmt() defaults to MD5 were missed
in r252688.

MFC after: 3 days

9 years agoBackout r272825 every useland usage of ufs/ufs/dir.h are now broken with that change
bapt [Thu, 9 Oct 2014 17:26:29 +0000 (17:26 +0000)]
Backout r272825 every useland usage of ufs/ufs/dir.h are now broken with that change

9 years agoShuffle things.
adrian [Thu, 9 Oct 2014 16:48:42 +0000 (16:48 +0000)]
Shuffle things.

Suggested by: jhb

Differential Revision: D906
Sponsored by: Norse Corp

9 years agoChange the hardcoded default back from SHA512 to DES.
des [Thu, 9 Oct 2014 16:45:11 +0000 (16:45 +0000)]
Change the hardcoded default back from SHA512 to DES.

PR: 192277
MFC after: 3 days

9 years agoWhen building with a newer GCC, suppress some warnings for the
imp [Thu, 9 Oct 2014 16:39:10 +0000 (16:39 +0000)]
When building with a newer GCC, suppress some warnings for the
moment. The kernel isn't ready for them without a lot of work.

9 years agoBump ipfw module version.
melifaro [Thu, 9 Oct 2014 16:12:01 +0000 (16:12 +0000)]
Bump ipfw module version.

9 years agoAdd size(1) to the cross build toolchain
bapt [Thu, 9 Oct 2014 15:52:01 +0000 (15:52 +0000)]
Add size(1) to the cross build toolchain

9 years agoSync to HEAD@r272825.
melifaro [Thu, 9 Oct 2014 15:35:28 +0000 (15:35 +0000)]
Sync to HEAD@r272825.

9 years agoUse offsetof() from sys/types.h instead of a custom one
bapt [Thu, 9 Oct 2014 15:26:22 +0000 (15:26 +0000)]
Use offsetof() from sys/types.h instead of a custom one
This fixes build with recent gcc versions

9 years agoRegenerate after r272823:
marcel [Thu, 9 Oct 2014 15:19:35 +0000 (15:19 +0000)]
Regenerate after r272823:
Move the SCTP syscalls to netinet with the rest of the SCTP code.

Submitted by: Steve Kiernan <stevek@juniper.net>
Reviewed by: tuexen, rrs
Obtained from: Juniper Networks, Inc.

9 years agoMove the SCTP syscalls to netinet with the rest of the SCTP code. The
marcel [Thu, 9 Oct 2014 15:16:52 +0000 (15:16 +0000)]
Move the SCTP syscalls to netinet with the rest of the SCTP code.  The
syscalls themselves are tightly coupled with the network stack and
therefore should not be in the generic socket code.

The following four syscalls have been marked as NOSTD so they can be
dynamically registered in sctp_syscalls_init() function:
  sys_sctp_peeloff
  sys_sctp_generic_sendmsg
  sys_sctp_generic_sendmsg_iov
  sys_sctp_generic_recvmsg

The syscalls are also set up to be dynamically registered when COMPAT32
option is configured.

As a side effect of moving the SCTP syscalls, getsock_cap needs to be
made available outside of the uipc_syscalls.c source file.  A proper
prototype has been added to the sys/socketvar.h header file.

API tests from the SCTP reference implementation have been run to ensure
compatibility. (http://code.google.com/p/sctp-refimpl/source/checkout)

Submitted by: Steve Kiernan <stevek@juniper.net>
Reviewed by: tuexen, rrs
Obtained from: Juniper Networks, Inc.

9 years agoAdd sysctl knob to disable port power on a specific USB HUB. You need
hselasky [Thu, 9 Oct 2014 14:43:43 +0000 (14:43 +0000)]
Add sysctl knob to disable port power on a specific USB HUB. You need
to reset the USB HUB using "usbconfig -d X.Y reset" or boot having the
setting in /boot/loader.conf before it activates.

9 years agoFix core on table destroy inroduced by table values code.
melifaro [Thu, 9 Oct 2014 14:33:20 +0000 (14:33 +0000)]
Fix core on table destroy inroduced by table values code.
Rename @ti array copy to 'ti_copy'.

9 years agoAdd example devd configuration file for USB printers.
hselasky [Thu, 9 Oct 2014 13:58:19 +0000 (13:58 +0000)]
Add example devd configuration file for USB printers.

9 years ago* Fix use-after-free in table printing code.
melifaro [Thu, 9 Oct 2014 12:54:56 +0000 (12:54 +0000)]
* Fix use-after-free in table printing code.
* Fix showing human-readable error in table cmds code.

9 years ago* Wire large user buffer before processing GET request.
melifaro [Thu, 9 Oct 2014 12:37:53 +0000 (12:37 +0000)]
* Wire large user buffer before processing GET request.
* Fix incorrect size calculation for IP_FW_XGET request.

9 years agoOnly catch the line from the compiler output where 'version' is a word
bapt [Thu, 9 Oct 2014 12:35:17 +0000 (12:35 +0000)]
Only catch the line from the compiler output  where 'version' is a word
This allows to build the kernel with gcc 4.9.1 from ports

9 years agoFix typo
bapt [Thu, 9 Oct 2014 12:20:00 +0000 (12:20 +0000)]
Fix typo

9 years agoAdd OBJCOPY to the list of external tools
bapt [Thu, 9 Oct 2014 10:47:14 +0000 (10:47 +0000)]
Add OBJCOPY to the list of external tools

9 years agoFix build when XCC is defined and X_COMPILER_TYPE is not
bapt [Thu, 9 Oct 2014 09:46:44 +0000 (09:46 +0000)]
Fix build when XCC is defined and X_COMPILER_TYPE is not

9 years agoMake iSCSI connection close somewhat less aggressive.
mav [Thu, 9 Oct 2014 09:12:08 +0000 (09:12 +0000)]
Make iSCSI connection close somewhat less aggressive.

It allows to push out some final data from the send queue to the socket
before its close.  In particular, it increases chances for logout response
to be delivered to the initiator.

9 years agoAdd CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files
bapt [Thu, 9 Oct 2014 09:04:01 +0000 (09:04 +0000)]
Add CROSS_TOOLCHAIN macro select pre seeded external toolchain configuration files
The goal is to provide pre seeded toolchain configurations withing the ports tree
to allow the use of an external toolchain in a simple way:

make CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 buildworld

This will look for the external toolchain definition in /usr/local/share/mk/powerpc64-gcc.mk
While here add the notion of X_COMPILER_TYPE to the external toolchain framework to allow
to deal with differences between gcc and clang in regards of cross building

9 years agoMFV r272804:
delphij [Thu, 9 Oct 2014 07:52:51 +0000 (07:52 +0000)]
MFV r272804:

Refactor the code and stop restore_object from creating two transactions.

Illumos issue:
    3693 restore_object uses at least two transactions to restore an object

MFC after: 2 weeks

9 years agoMFV r272803:
delphij [Thu, 9 Oct 2014 07:18:40 +0000 (07:18 +0000)]
MFV r272803:

Illumos issue:
    5175 implement dmu_read_uio_dbuf() to improve cached read performance

MFC after: 2 weeks

9 years agoFix build with rpcgen using a recent (tested with gcc 4.9.1) GNU cpp
bapt [Thu, 9 Oct 2014 06:58:33 +0000 (06:58 +0000)]
Fix build with rpcgen using a recent (tested with gcc 4.9.1) GNU cpp