Commit Graph

227451 Commits

Author SHA1 Message Date
Andriy Gapon
da1bfa506f MFV r325609: 7531 Assign correct flags to prefetched buffers
illumos/illumos-gate@2729521654
2729521654

https://www.illumos.org/issues/7531
  I found that some buffers that could be L2ARC eligible are not flagged
  such, leading to some performance impact.  As a test I ran the same IO
  workload 10 times in a raw.  It is a metadata only workload (files
  listing).  l2arc_noprefetch=0.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: benrubson <ben.rubson@gmail.com>

MFC after:	8 days
2017-11-09 18:22:42 +00:00
Andriy Gapon
0a98af26af 7531 Assign correct flags to prefetched buffers
illumos/illumos-gate@2729521654
2729521654

https://www.illumos.org/issues/7531
  I found that some buffers that could be L2ARC eligible are not flagged
  such, leading to some performance impact.  As a test I ran the same IO
  workload 10 times in a raw.  It is a metadata only workload (files
  listing).  l2arc_noprefetch=0.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: benrubson <ben.rubson@gmail.com>

MFC after:	8 days
2017-11-09 18:21:17 +00:00
Andriy Gapon
885a5425f3 MFV r325607: 8607 zfs: variable set but not used
illumos/illumos-gate@b852c2f543
b852c2f543

https://www.illumos.org/issues/8607

Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>

MFC after:	1 week
2017-11-09 18:14:42 +00:00
Andriy Gapon
e36f861978 8607 zfs: variable set but not used
illumos/illumos-gate@b852c2f543
b852c2f543

https://www.illumos.org/issues/8607

Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>
2017-11-09 18:13:26 +00:00
Andriy Gapon
2e06836fee MFV r325605: 8713 Buffer overflow in dsl_dataset_name()
illumos/illumos-gate@f37ae9a714
f37ae9a714

https://www.illumos.org/issues/8713
  If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to
  account for additional space needed by the origin dataset which will also be
  snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN".
  Enforce this limit in pool_namecheck().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>

MFC after:	1 week
2017-11-09 18:12:21 +00:00
Andriy Gapon
98b9b8cb4b 8713 Buffer overflow in dsl_dataset_name()
illumos/illumos-gate@f37ae9a714
f37ae9a714

https://www.illumos.org/issues/8713
  If we're creating a pool with version >= SPA_VERSION_DSL_SCRUB (v11) we need to
  account for additional space needed by the origin dataset which will also be
  snapshotted: "poolname"+"/"+"$ORIGIN"+"@"+"$ORIGIN".
  Enforce this limit in pool_namecheck().

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
2017-11-09 18:06:18 +00:00
Navdeep Parhar
0cf77199b2 cxgbe(4): Do not request settings not supported by the port.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2017-11-09 15:35:51 +00:00
Warner Losh
c1d0ef846c Remove useless .if. The whole point of SUBDIR.yes was so that we
didn't need this construct.

Sponsored by: Netflix
2017-11-09 14:31:25 +00:00
Gavin Atkinson
c6404e6690 Point people towards our https web site for documentation, http accesses are
just redirected anyway.

MFC after:	1 week
2017-11-09 13:38:24 +00:00
Marcin Wojtas
5727f16270 Fix setting AENQ group in ENA driver
With the current state of the AENQ handlers in the ENA driver, only
implemented handlers should be indicated.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12872
2017-11-09 13:38:17 +00:00
Marcin Wojtas
4727bda6f2 Allow usage of more RX descriptors than 1 in ENA driver
Using only 1 descriptor on RX could be an issue, if system would be low
on resources and could not provide driver with large chunks of
contiguous memory.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12871
2017-11-09 13:36:42 +00:00
Marcin Wojtas
3cfadb28c3 Read max MTU from the ENA device
The device now provides driver with max available MTU value it
can handle.

The function setting MTU for the interface was simplified and reworked
to follow up this changes.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12870
2017-11-09 13:35:07 +00:00
Marcin Wojtas
ad5a5afaad Fix calculating io queues number in ENA driver
The maximum number of io_cq was the same number as maximum io_sq
indicated by the device working in normal mode (without LLQ).
It is not always true, especially when LLQ is being enabled.
Fix it.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12869
2017-11-09 13:33:02 +00:00
Marcin Wojtas
4e8acd844f Rework printouts and logging level in ENA driver
The driver was printing out a lot of information upon failure, which
does not have to be interested for the user.
Changing logging level required to rebuild driver with proper flags. The
proper sysctl was added, so the level now can be changed dynamically
using bitmask.

Levels of printouts were adjusted to keep on mind end user instead of
debugging purposes.

More verbose messages were added to align the driver with the Linux.

Fix building error introduced by the r325506 by casting csum_flags to
uint64_t.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12868
2017-11-09 13:30:39 +00:00
Konstantin Belousov
dc00696a27 Correct operators precedence.
Also keep the calculated vm_page_alloc_contig() flags in the variable
to not re-evaluate it on the loop iteration.

Noted by:	alc
Sponsored by:	The FreeBSD Foundation
2017-11-09 13:09:07 +00:00
Marcin Wojtas
bfea0e9327 Fix comparing L3 type with L4 enum on RX hash in ENA driver
This bug wasn't impacting anything, because both enums are indicating
the same value, but it could cause a problem on API change.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12867
2017-11-09 12:39:26 +00:00
Marcin Wojtas
90f4da8bd4 Fix compilation warnings when building ENA driver with gcc compiler
The gcc compiler is more sensitive when variable is having an value
assigned, but it is not used anywhere further.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12866
2017-11-09 12:37:19 +00:00
Marcin Wojtas
cd43338509 Fix checking if the DF flag was set in ENA driver
The previous way of checking for DF was not valid.
When DF is enabled, the DF bit should be 1.

The original way of checking it was wrong in 2 ways: first of all, it
was not checking for single bit, secondly, it was checking for 0.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12865
2017-11-09 12:32:10 +00:00
Marcin Wojtas
5a9902126e Cleanup of the ENA driver header file
Remove unused macros and fields - some of them were only initialized,
without further usage.

Implement minor style fixes and add required comments.

On the occasion add missing TX completion counter, which was existing,
but mistakenly remained unused.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12864
2017-11-09 12:07:02 +00:00
Marcin Wojtas
8805021a2a Allow partial MSI-x allocation in ENA driver
The situation, where part of the MSI-x was not configured properly, was
not properly handled. Now, the driver reduces number of queues to
reflect number of existing and properly configured MSI-x vectors.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12863
2017-11-09 12:03:06 +00:00
Marcin Wojtas
0052f3b580 Remove deprecated and unused counters in ENA driver
Few counters were imported from the Linux driver and never used,
because of differences between the Linux and FreeBSD APIs.

Queue stops and resumes are no longer supported by the driver and
counters were incremented indicating false events.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12862
2017-11-09 12:01:46 +00:00
Marcin Wojtas
3f9ed7ab94 Cover ENA driver code with branch predictioning statements
The driver was using it in only few places, so the rest of the code
was covered with those statement.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: rlibby
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12861
2017-11-09 11:59:21 +00:00
Marcin Wojtas
0bdffe5959 Refactor style of the ENA driver
* Change all conditional checks in "if" statement to boolean expressions
* Initialize variables with too complex values outside the declaration
* Fix indentations
* Move code associated with sysctls to ena_sysctl.c file
* For consistency, remove unnecesary "return" from void functions
* Use if_getdrvflags() function instead of accesing variable directly

Submitted by: Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12860
2017-11-09 11:57:02 +00:00
Marcin Wojtas
7d2544e60e Fix error handling in the ENA driver and lock drbr_free() call
Some goto tags were renamed for consistency, and few error handling
routines were reworked.

The drbr_free() must be locked just in case code will change in the
future - for now, it should never be an issue, because drbr is being
flushed in the ena_down() call, and the lock is required only when there
are some mbufs inside.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12859
2017-11-09 11:54:32 +00:00
Marcin Wojtas
197f028470 Destroy admin queue after freeing interrupts in ENA driver
On heavy load, when interrupt handling routine was slowed down, there
could appear memory corruption, because resources were destroyed and
interrupt was still being handled.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12858
2017-11-09 11:52:52 +00:00
Marcin Wojtas
74dba3ad78 Split function checking for missing TX completion in ENA driver
Pure cosmetic change for better readability of the driver.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12857
2017-11-09 11:50:52 +00:00
Marcin Wojtas
efe6ab18da Check for Rx ring state to prevent from stall in the ENA driver
In case when Rx ring is full and driver will fail to allocate Rx mbufs,
the ring could be stalled.

Keep alive is checking every second for Rx ring state, and if it is full
for two cycles, then trigger rx_cleanup routine in another thread.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12856
2017-11-09 11:48:22 +00:00
Marcin Wojtas
43fefd1629 Add RX OOO completion feature
The RX out of order completion feature, allows to complete RX
descriptors out of order, by keeping trace of all free descriptors in
the separate array.

Submitted by: Michal Krawczyk <mk@semihalf.com>
Reviewed by: byenduri_gmail.com
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D12855
2017-11-09 11:45:59 +00:00
Marcin Wojtas
ca61e2d994 Update ena-com HAL to newest version
The newest ena-com HAL update adds dynamically controlled logging level
functionality.

Obtained from: Amazon, Inc.
2017-11-09 11:37:20 +00:00
Alexander Motin
ede4c91d7b Add some PCI IDs found on AMD Epyc system.
MFC after:	2 weeks
2017-11-09 10:15:57 +00:00
Bryan Drewery
6c2f618666 AUTO_OBJ: Fix 'old style' kernel builds using wrong .OBJDIR.
There's no way currently to automatically prevent the bad .OBJDIR from being
created but it can at least be prevented from being used.  Passing
WITHOUT_AUTO_OBJ=yes or MK_AUTO_OBJ=no or -DNO_OBJ in will prevent it.

Reported by:	jeffr
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D12989
2017-11-09 02:37:49 +00:00
Adrian Chadd
066b9ae54e [bsdbox] fix compilation due to library work. 2017-11-09 01:41:00 +00:00
Bryan Drewery
4556d0795f universe: Fix creating LINT files with AUTO_OBJ.
These are expected to be created in .CURDIR.

Reported by:	kib
Sponsored by:	Dell EMC Isilon
2017-11-08 23:41:27 +00:00
Konstantin Belousov
9acf7b136d Zero whole struct ptrace_lwpinfo to not leak kernel stack data.
Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
Discussed with:	secteam
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D12796
2017-11-08 23:32:56 +00:00
Konstantin Belousov
772c8b6749 Fix operator priority.
Sponsored by:	The FreeBSD Foundation
2017-11-08 23:25:05 +00:00
Antoine Brodin
f5056d933a Do not leak control in raw_usend 2017-11-08 23:20:05 +00:00
Kyle Evans
752e881db7 Revert r325365
r325365 caused several ports to fail to patch correctly. Revert it for the
time being until an exp-run can be completed.

Requested by:	antoine
Approved by:	emaste (implicit)
2017-11-08 23:11:15 +00:00
Emmanuel Vadot
70bc7e51ca Allwinner A13: Add clkng support
DTS files switch from clocks under /clocks to a ccu (Clock Controller Unit)
a while ago.
Restore A13 functionality by adding a clock driver for it.
Almost every clocks are handled, the missing ones are mostly video related
clocks.

Tested On: A13 Olinuxino
2017-11-08 21:24:06 +00:00
Emmanuel Vadot
58f6e2154e Allwinner: clk: Unlock the clknode after locking it.
Pointy Hat: manu
2017-11-08 21:12:59 +00:00
Mark Johnston
e0b2fc3a51 Allow various page daemon parameters to be set from loader.conf.
MFC after:	1 week
2017-11-08 19:55:17 +00:00
Bryan Drewery
2a8176cb61 META_MODE: Bmake 20171028 in r325340 simplifies the meta filename.
Now if the meta file is in the objdir, the objdir is stripped away
from the meta filename.

Sponsored by:	Dell EMC Isilon
2017-11-08 18:02:01 +00:00
Eugene Grosbein
cedc7c5870 Add suitable knob ifconfig_<interface>_descr for static interface description.
Document availability of interface descriptions within rc.conf(5).

Approved by:	avg (mentor), mav (mentor)
MFC after:	3 days
2017-11-08 16:53:11 +00:00
Gleb Smirnoff
b9a63e5c3a When parsing UDP messages skip optional hostname as described by
RFC 3164.

PR:		200933
Submitted by:	maxim
Reported by:	Konstantin Pavlov <thresh nginx.com>
MFC after:	2 weeks
2017-11-08 16:45:53 +00:00
Bryan Drewery
e1b7ce1fa0 AUTO_OBJ: Hide 'creating dirs' output with 'make -s'.
Reported by:	garga
Sponsored by:	Dell EMC Isilon
2017-11-08 16:03:58 +00:00
Roger Pau Monné
8161a35259 loader: set options before including bsd.init.mk
bsd.init.mk ends up including defs.mk so the per-arch options must be
set before including defs.mk, or else the global defaults will be
used and the per-arch ones will be ignored.

Although better, note that the usage of MK_FDT before the inclusion of
bsd.init.mk is incorrect but doesn't lead to build errors. This
circular dependency must be broken in order for this to work
correctly.

Reviewed by:	imp
Sponsored by:	Citrix Systems R&D
2017-11-08 14:44:45 +00:00
Ed Schouten
7e6155744d Upgrade to CloudABI v0.17.
Compared to the previous version, v0.16, there are a couple of minor
changes:

- CLOUDABI_AT_PID: Process identifiers for CloudABI processes.

  Initially, BSD process identifiers weren't exposed inside the runtime,
  due to them being pretty much useless inside of a cluster computing
  environment. When jobs are scheduled across systems, the BSD process
  number doesn't act as an identifier. Even on individual systems they
  may recycle relatively quickly.

  With this change, the kernel will now generate a UUIDv4 when executing
  a process. These UUIDs can be obtained within the process using
  program_getpid(). Right now, FreeBSD will not attempt to store this
  value. This should of course happen at some point in time, so that it
  may be printed by administration tools.

- Removal of some unused structure members for polling.

  With the polling framework being simplified/redesigned, it turns out
  some of the structure fields were not used by the C library. We can
  remove these to keep things nice and tidy.

Obtained from:	https://github.com/NuxiNL/cloudabi
2017-11-08 14:21:52 +00:00
Emmanuel Vadot
8c9e091944 ctl(4): Insert a new line after a sentence-ending full stop.
Reported by:	bjk
MFC after:	2 weeks
Sponsored by:	Gandi.net
X-MFC-With:  r325517
2017-11-08 13:06:41 +00:00
Konstantin Belousov
b1499f0e77 Remove useless DEBUG printfs in i386 sendsig() implementations.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-11-08 13:05:14 +00:00
Alexander Motin
898300ee11 s/NgSendMsgReply/NgSendReplyMsg/ in man to match the code.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	2 weeks
2017-11-08 12:34:47 +00:00
Hans Petter Selasky
a7a3d0d170 Make the dma_alloc_coherent() function in the LinuxKPI NULL safe with regard
to the "dev" argument.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
MFC after:	1 week
2017-11-08 08:37:05 +00:00