]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoMFC r340822
Andrew Rybchenko [Fri, 21 Dec 2018 15:03:44 +0000 (15:03 +0000)]
MFC r340822

sfxge(4): fix check in NVRAM validate

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18092

5 years agoMFC r340799
Andrew Rybchenko [Fri, 21 Dec 2018 15:02:36 +0000 (15:02 +0000)]
MFC r340799

sfxge(4): fix error code usage

MCDI results returned in req.emr_rc have already been translated
from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value
is incorrect.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18069

5 years agoMFC r340806
Andrew Rybchenko [Fri, 21 Dec 2018 14:59:24 +0000 (14:59 +0000)]
MFC r340806

sfxge(4): fix default RSS context check on Siena

Default RSS context check is carried out during filter
insertion on Siena and it needs to be fixed

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18076

5 years agoMFC r340805
Andrew Rybchenko [Fri, 21 Dec 2018 14:58:16 +0000 (14:58 +0000)]
MFC r340805

sfxge(4): define a handle to denote default RSS context

Make the existing filter-specific define more general.
This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18075

5 years agoMFC r340797
Andrew Rybchenko [Fri, 21 Dec 2018 14:53:50 +0000 (14:53 +0000)]
MFC r340797

sfxge(4): fix potential buffer overflow in Tx queue init

Improve error checking to avoid a caller overflowing the MCDI
request buffer if the requested TXQ size was excessively large.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18067

5 years agoMFC r340826
Andrew Rybchenko [Fri, 21 Dec 2018 14:52:46 +0000 (14:52 +0000)]
MFC r340826

sfxge(4): fix ignoring function return value

fix PreFAST issue, add missing annotation that function return value
should not be ignored. Fix alignment.

Submitted by:   Andy Moreton <amoreton at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18096

5 years agoMFC r340767
Andrew Rybchenko [Fri, 21 Dec 2018 14:50:18 +0000 (14:50 +0000)]
MFC r340767

sfxge(4): limit max TXQ size on Medford to 2048

Queues with 4096 descriptors are not supported as the top bit is used
for vfifo stuffing.

Submitted by:   Mark Spender <mspender at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D8948

5 years agoMFC r342086:
Mark Johnston [Fri, 21 Dec 2018 02:22:11 +0000 (02:22 +0000)]
MFC r342086:
Add support for the nForce MCP89 adapter.

PR: 234015

5 years agoMFC r342183:
Cy Schubert [Fri, 21 Dec 2018 01:58:01 +0000 (01:58 +0000)]
MFC r342183:

Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000)

PR: 234113
Security: https://blade.tencent.com/magellan/index_en.html
No known CVE was apparently registered.

5 years agoPull in r329671 from upstream clang trunk (by Akira Hatanaka):
Dimitry Andric [Thu, 20 Dec 2018 18:28:53 +0000 (18:28 +0000)]
Pull in r329671 from upstream clang trunk (by Akira Hatanaka):

  [ExprConstant] Use an AST node and a version number as a key to
  create an APValue and retrieve it from map Temporaries.

  The version number is needed when a single AST node is visited
  multiple times and is used to create APValues that are required to be
  distinct from each other (for example, MaterializeTemporaryExprs in
  default arguments and VarDecls in loops).

  rdar://problem/36505742

  Differential Revision: https://reviews.llvm.org/D42776

This should fix 'Assertion failed: (Result.isUninit() && "temporary
created multiple times"), function createTemporary' errors (if
assertions are enabled, otherwise the compiler internal state might go
bad), when building the graphics/rawtherapee port.

Direct commit to stable/11 and stable/12, since head already has clang
7.0.1, which includes this change.

PR: 234144

5 years agoMFC r341632: acpi_{Device,Battery}IsPresent: restore pre-r330957 behaviour
Andriy Gapon [Thu, 20 Dec 2018 08:45:41 +0000 (08:45 +0000)]
MFC r341632: acpi_{Device,Battery}IsPresent: restore pre-r330957 behaviour

Specifically, assume that the device is present if evaluation of _STA
method fails.

PR: 227191

5 years agoMFC r342030:
Andrey V. Elsukov [Thu, 20 Dec 2018 08:28:51 +0000 (08:28 +0000)]
MFC r342030:
  Plug memory leak for AES_*_NIST_GMAC algorithms.

  swcr_newsession() allocates sw_ictx for these algorithms, thus we need
  to free() it in swcr_freesession().

  PR: 233907

5 years agoMFC r341786, r342156
Andriy Voskoboinyk [Thu, 20 Dec 2018 02:50:24 +0000 (02:50 +0000)]
MFC r341786, r342156
rtwn, rsu: add more USB ids.

PR: 233638
Submitted by: cezary.sliwa@gmail.com

5 years agoMFC r341988
David Bright [Thu, 20 Dec 2018 00:57:23 +0000 (00:57 +0000)]
MFC r341988

asmc: Add Support for Macbook Pro 8,1

PR: 217505
Submitted by: John O. Brickley <obryan.brickley@gmail.com>, updated by Maciej Pasternacki <maciej@pasternacki.net>
Reported by: John O. Brickley <obryan.brickley@gmail.com>

5 years agoMFC r342053
Mateusz Guzik [Wed, 19 Dec 2018 23:29:44 +0000 (23:29 +0000)]
MFC r342053

dtrace: fix userspace access on boxes with SMAP

Sponsored by: The FreeBSD Foundation

5 years agoMFC r341806:
David Bright [Wed, 19 Dec 2018 22:46:03 +0000 (22:46 +0000)]
MFC r341806:

Add uk.macbook.kbd keymap (vt)

PR: 215185
Submitted by: James Wright <james.wright@jigsawdezign.com>
Reported by: James Wright <james.wright@jigsawdezign.com>

5 years agoMFC r340676,r340677,r340679,r340747,r340749,r341682
Mateusz Guzik [Wed, 19 Dec 2018 22:42:06 +0000 (22:42 +0000)]
MFC r340676,r340677,r340679,r340747,r340749,r341682

Implement unr64
pipe: use unr64
tmpfs: use unr64 for inode numbers
uipc_shm: use unr64 for inode numbers
uipc_usrreq: fix inode number assignment
unr64: use locked variant if not __LP64__

Sponsored by: The FreeBSD Foundation

5 years agoMFC r340482,r341724
Mateusz Guzik [Wed, 19 Dec 2018 22:38:06 +0000 (22:38 +0000)]
MFC r340482,r341724

proc: always store parent pid in p_oppid
Remove proctree acquire from note_procstat_proc

Sponsored by: The FreeBSD Foundation

5 years agoMFC r340410
Mateusz Guzik [Wed, 19 Dec 2018 22:31:20 +0000 (22:31 +0000)]
MFC r340410

locks: plug warnings about unitialized variables

Sponsored by: The FreeBSD Foundation

5 years agoMFC r341820:
David Bright [Wed, 19 Dec 2018 21:28:11 +0000 (21:28 +0000)]
MFC r341820:

asmc: Add Support for MacBookAir 7,1 and 7,2

PR: 226172
Submitted by: James Wright <james.wright@jigsawdezign.com>
Reported by: James Wright <james.wright@jigsawdezign.com>

5 years agoMFC r341272,r341273,r341351
Mateusz Guzik [Wed, 19 Dec 2018 21:25:43 +0000 (21:25 +0000)]
MFC r341272,r341273,r341351

amd64: tidy up copying backwards in memmove
amd64: remove stale attribution for memmove work
amd64: handle small memmove buffers with overlapping stores

5 years agoMFC r341719
Mateusz Guzik [Wed, 19 Dec 2018 21:04:06 +0000 (21:04 +0000)]
MFC r341719

amd64: stop re-reading curpc on subyte/suword

5 years agoMFC r341364
Mateusz Guzik [Wed, 19 Dec 2018 21:03:17 +0000 (21:03 +0000)]
MFC r341364

amd64: align target memmove buffer to 16 bytes before using rep movs

5 years agoMFC r342227: bootpd: validate hardware type
Ed Maste [Wed, 19 Dec 2018 18:17:59 +0000 (18:17 +0000)]
MFC r342227: bootpd: validate hardware type

Due to insufficient validation of network-provided data it may have been
possible for a malicious actor to craft a bootp packet which could cause
a stack buffer overflow.

admbugs: 850
Reported by: Reno Robert
Reviewed by: markj
Approved by: so
Security: FreeBSD-SA-18:15.bootpd
Sponsored by: The FreeBSD Foundation

5 years agoRevert r342219.
Mark Johnston [Wed, 19 Dec 2018 17:48:37 +0000 (17:48 +0000)]
Revert r342219.

It depends on a Capsicum helper not present in stable/12.

5 years agoMFC r341595:
Mark Johnston [Wed, 19 Dec 2018 17:42:39 +0000 (17:42 +0000)]
MFC r341595:
Clamp the INPCB port hash tables to IPPORT_MAX + 1 chains.

5 years agoMFC r341837, r342192:
Mark Johnston [Wed, 19 Dec 2018 17:40:45 +0000 (17:40 +0000)]
MFC r341837, r342192:
Use Capsicum helpers in ping(8).

5 years agoMFC r341844:
Hans Petter Selasky [Wed, 19 Dec 2018 08:49:07 +0000 (08:49 +0000)]
MFC r341844:
Don't register IOCTLs with capsicum when there is no valid file descriptor.
This fixes tcpdump when using mlx5_X devices.

Differential Revision: https://reviews.freebsd.org/D18499
Reviewed by: kib@, slavash@, oshogbo@
Sponsored by: Mellanox Technologies

5 years agoMFC r342144:
Konstantin Belousov [Wed, 19 Dec 2018 03:21:49 +0000 (03:21 +0000)]
MFC r342144:
Document new required MI behaviour of pmap_enter(9) for CoW.

5 years agoMFC r342150:
Cy Schubert [Wed, 19 Dec 2018 02:34:31 +0000 (02:34 +0000)]
MFC r342150:

Add a missing leading / in a filename.

5 years agoMFC r342124:
Andriy Voskoboinyk [Wed, 19 Dec 2018 02:23:51 +0000 (02:23 +0000)]
MFC r342124:
Add new USB id in rtwn_usb(4) (RTL8812AU)

PR: 234029
Submitted by: <hakotani000@gmail.com>

5 years agoMFC r339909: Allow changing lagg(4) MTU.
Alexander Motin [Tue, 18 Dec 2018 22:56:24 +0000 (22:56 +0000)]
MFC r339909: Allow changing lagg(4) MTU.

Previously, changing the MTU would require destroying the lagg and
creating a new one. Now it is allowed to change the MTU of
the lagg interface and the MTU of the ports will be set to match.

If any port cannot set the new MTU, all ports are reverted to the original
MTU of the lagg. Additionally, when adding ports, the MTU of a port will be
automatically set to the MTU of the lagg. As always, the MTU of the lagg is
initially determined by the MTU of the first port added. If adding an
interface as a port for some reason fails, that interface is reverted to its
original MTU.

Submitted by: Ryan Moeller <ryan@freqlabs.com>
Relnotes: Yes
Sponsored by: iXsystems Inc.

5 years agoMFC r340402, r340914 (by alc), r341602 (by alc), r341766 (by alc):
Mark Johnston [Tue, 18 Dec 2018 21:01:48 +0000 (21:01 +0000)]
MFC r340402, r340914 (by alc), r341602 (by alc), r341766 (by alc):
Allow allocations across meta boundaries.

5 years agoMFC r341594, r341601:
Mark Johnston [Tue, 18 Dec 2018 20:16:46 +0000 (20:16 +0000)]
MFC r341594, r341601:
mlx4en(4) and ixl(4) have netdump support.

5 years agoMFC r341808:
Mark Johnston [Tue, 18 Dec 2018 20:14:33 +0000 (20:14 +0000)]
MFC r341808:
Remove an unused malloc(9) type.

5 years agoMFC r341807:
Mark Johnston [Tue, 18 Dec 2018 20:13:45 +0000 (20:13 +0000)]
MFC r341807:
Use inline tests for individual PTE bits in the RISC-V pmap.

5 years agoMFC r341821:
Mark Johnston [Tue, 18 Dec 2018 20:12:43 +0000 (20:12 +0000)]
MFC r341821:
Fix the PAE kernel gcc build.

5 years agoMFC: r340090, r342056
Jung-uk Kim [Tue, 18 Dec 2018 19:38:28 +0000 (19:38 +0000)]
MFC: r340090, r342056

Merge ACPICA 20181031 and 20181213.

5 years agoMFC r341824:
Stephen Hurd [Tue, 18 Dec 2018 17:31:31 +0000 (17:31 +0000)]
MFC r341824:

Fix !tx_abdicate error from r336560

r336560 was supposed to restore pre-r323954 behaviour when tx_abdicate is
not set (the default case). However, it appears that rather than the drainage
check being made conditional on tx_abdicate being set, it was duplicated
so it occured twice if tx_abdicate was set and once if it was not.

Now when !tx_abdicate, drainage is only checked if the doorbell isn't
pending.

Reported by:    lev
Sponsored by:   Limelight Networks

5 years agoMFC r342125:
Brooks Davis [Tue, 18 Dec 2018 09:13:50 +0000 (09:13 +0000)]
MFC r342125:

Fix bugs in plugable CC algorithm and siftr sysctls.

Use the sysctl_handle_int() handler to write out the old value and read
the new value into a temporary variable. Use the temporary variable
for any checks of values rather than using the CAST_PTR_INT() macro on
req->newptr. The prior usage read directly from userspace memory if the
sysctl() was called correctly. This is unsafe and doesn't work at all on
some architectures (at least i386.)

In some cases, the code could also be tricked into reading from kernel
memory and leaking limited information about the contents or crashing
the system. This was true for CDG, newreno, and siftr on all platforms
and true for i386 in all cases. The impact of this bug is largest in
VIMAGE jails which have been configured to allow writing to these
sysctls.

Per discussion with the security officer, we will not be issuing an
advisory for this issue as root access and a non-default config are
required to be impacted.

Reviewed by: markj, bz
Discussed with: gordon (security officer)
Security: kernel information leak, local DoS (both require root)
Differential Revision: https://reviews.freebsd.org/D18443

5 years agoMFC r341810:
Konstantin Belousov [Tue, 18 Dec 2018 07:11:12 +0000 (07:11 +0000)]
MFC r341810:
Free bootstacks after AP startup.

5 years agoMFC r340707:
Marcelo Araujo [Tue, 18 Dec 2018 03:00:12 +0000 (03:00 +0000)]
MFC r340707:

Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES
to avoid buffer accessed out of bounds, also switch to snprintf(3).

PR: 200859
Submitted by: Caglar <caglar@10ur.org>
Obtained from: https://github.com/mist64/xhyve/pull/24

5 years agoMFC r342127
Hiren Panchasara [Mon, 17 Dec 2018 21:46:42 +0000 (21:46 +0000)]
MFC r342127
Revert r331567 CC Cubic: fix underflow for cubic_cwnd()

This change is causing TCP connections using cubic to hang. Need to dig more to
find exact cause and fix it.

5 years agoMFC r341257: improve speed of empty block detection.
Maxim Sobolev [Mon, 17 Dec 2018 15:17:09 +0000 (15:17 +0000)]
MFC r341257: improve speed of empty block detection.

5 years agoMFC r341253: panic() should not apply \n.
Maxim Sobolev [Mon, 17 Dec 2018 15:13:58 +0000 (15:13 +0000)]
MFC r341253: panic() should not apply \n.

5 years agoMFC r341798:
Andrey V. Elsukov [Mon, 17 Dec 2018 10:42:20 +0000 (10:42 +0000)]
MFC r341798:
  Use correct size for IPv4 address in gethostbyaddr().
  When u_long is 8 bytes, it returns EINVAL and 'ipfw -N show' doesn't work.

  Reported by: Claudio Eichenberger <cei at yourshop.com>

MFC r341799:
  Rework how protocol number is tracked in rule. Save it when O_PROTO
  opcode will be printed. This should solve the problem, when protocol
  name is not printed in `ipfw -N show`.

  Reported by: Claudio Eichenberger <cei at yourshop.com>

5 years agoMFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode
Eugene Grosbein [Mon, 17 Dec 2018 06:58:11 +0000 (06:58 +0000)]
MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode

PR: 102719

5 years agoMFC r341402:
Konstantin Belousov [Sun, 16 Dec 2018 02:46:51 +0000 (02:46 +0000)]
MFC r341402:
Fix off-by-one (page) errors in checks in d_mmap methods of several drivers.

5 years agoMFC r341400:
Konstantin Belousov [Sun, 16 Dec 2018 02:46:09 +0000 (02:46 +0000)]
MFC r341400:
Add a comment noting that the additional range checks are not needed.

5 years agoMFC r341399:
Konstantin Belousov [Sun, 16 Dec 2018 02:44:57 +0000 (02:44 +0000)]
MFC r341399:
Fix off by one in hpet_mmap() csw method.

5 years agoMFC r341398:
Konstantin Belousov [Sun, 16 Dec 2018 02:42:32 +0000 (02:42 +0000)]
MFC r341398:
Change the vm_ooffset_t type to unsigned.

MFC note: For KPI stability, UOFF_TO_IDX() macro is still provided,
redefined to OFF_TO_IDX().

5 years agoMFC r341746:
Konstantin Belousov [Sun, 16 Dec 2018 02:30:55 +0000 (02:30 +0000)]
MFC r341746:
Fix PAE boot.

5 years agoMFC r341768,r341795: ping(8): remove needless comparision with LONG_MAX
Eugene Grosbein [Sun, 16 Dec 2018 01:17:27 +0000 (01:17 +0000)]
MFC r341768,r341795: ping(8): remove needless comparision with LONG_MAX
after unsigned long ultmp changed to long ltmp in r340245.

5 years agoMFC r341990:
Mark Johnston [Sat, 15 Dec 2018 19:56:51 +0000 (19:56 +0000)]
MFC r341990:
Fix a possible mbuf double free in bwn_dma_tx_start().

admbug: 820

5 years agoMFC r341993
Vincenzo Maffione [Sat, 15 Dec 2018 18:11:41 +0000 (18:11 +0000)]
MFC r341993

netmap: add man page for ptnet

Add a man page for ptnet(4), describing the guest driver for netmap passthrough.

Reviewed by:    bcr
Differential Revision:  https://reviews.freebsd.org/D18518

5 years agoMFC r341992
Vincenzo Maffione [Sat, 15 Dec 2018 18:05:05 +0000 (18:05 +0000)]
MFC r341992

netmap: fix warning in netmap_kloop.c

Reported by:    markj

5 years agoMFC r341738:
Michal Meloun [Sat, 15 Dec 2018 06:22:48 +0000 (06:22 +0000)]
MFC r341738:

  Implement R_AARCH64_TLS_DTPMOD64 and A_AARCH64_TLS_DTPREL64 relocations.
  Although these are slightly obsolete in favor of R_AARCH64_TLSDESC, gcc
  -mtls-dialect=trad still use them.

5 years agoMFC r341694:
Mark Johnston [Fri, 14 Dec 2018 18:40:08 +0000 (18:40 +0000)]
MFC r341694:
Update the description of the address space layout on RISC-V.

5 years agoMFC r341693:
Mark Johnston [Fri, 14 Dec 2018 18:39:06 +0000 (18:39 +0000)]
MFC r341693:
Rename sptbr to satp per v1.10 of the privileged architecture spec.

5 years agoMFC r341692:
Mark Johnston [Fri, 14 Dec 2018 18:38:10 +0000 (18:38 +0000)]
MFC r341692:
Let the cap_syslog capability inherit stdio descriptors.

5 years agoMFC r341829: Allow CTL device specification in bhyve virtio-scsi.
Alexander Motin [Fri, 14 Dec 2018 14:49:04 +0000 (14:49 +0000)]
MFC r341829: Allow CTL device specification in bhyve virtio-scsi.

There was a large refactoring done in CTL to allow multiple ioctl frontend
ports (and respective devices) to be created, particularly for bhyve.
Unfortunately, respective part of bhyve functionality got lost somehow from
the original virtio-scsi commit.  This change allows wanted device path to
be specified in either of two ways:
 -s 6,virtio-scsi,/dev/cam/ctl1.1
 -s 6,virtio-scsi,dev=/dev/cam/ctl2.3
If neither is specified, the default /dev/cam/ctl device is used.

While there, remove per-queue CTL device opening, which makes no sense at
this point.

5 years agoMFC r341706: Make virtio-scsi pass SCSI Task Attributes to CTL.
Alexander Motin [Fri, 14 Dec 2018 14:46:35 +0000 (14:46 +0000)]
MFC r341706: Make virtio-scsi pass SCSI Task Attributes to CTL.

5 years agoMFC r341704: Fill initid explicitly on requests.
Alexander Motin [Fri, 14 Dec 2018 14:45:54 +0000 (14:45 +0000)]
MFC r341704: Fill initid explicitly on requests.

Unfortunately ctl_scsi_zero_io() wipes that field, so it was always zero.
While there, targ_port is set by kernel, so user-space should not fill it.

5 years agoMFC r341705: Fix several iov handling bugs in bhyve virtio-scsi backend.
Alexander Motin [Fri, 14 Dec 2018 14:44:38 +0000 (14:44 +0000)]
MFC r341705: Fix several iov handling bugs in bhyve virtio-scsi backend.

 - buf_to_iov() does not use buflen parameter, allowing out of bound read.
 - buf_to_iov() leaks memory if seek argument > 0.
 - iov_to_buf() doesn't need to reallocate buffer for every segment.
 - there is no point to use size_t for iov counts, int is more then enough.
 - some iov function arguments can be constified.
 - pci_vtscsi_request_handle() used truncate_iov() incorrectly, allowing
   getting out of buffer and possibly corrupting data.
 - pci_vtscsi_controlq_notify() written returned status at wrong offset.
 - pci_vtscsi_controlq_notify() leaked one buffer per event.

5 years agoMFC r341679:
Michal Meloun [Fri, 14 Dec 2018 10:30:09 +0000 (10:30 +0000)]
MFC r341679:

  Fix cut&paste typo in atomic_fetchadd_64().

5 years agoMFC r341511,r341512,r341513:
Michal Meloun [Fri, 14 Dec 2018 10:20:26 +0000 (10:20 +0000)]
MFC r341511,r341512,r341513:

  r341511:
    Fix style(9). Not a functional change.
  r341512:
    Implement arm64 version of __tls_get_addr().
  r341513:
    Tidy up arm64 reloc_jmpslots() implementation.
    - don't relocate jump slots multiple times (if LD_BIND_NOW is defined).
    - process only R_AARCH64_JUMP_SLOT here, other relocation types are
      handled by reloc_plt().

5 years agoMFC r341680
Vincenzo Maffione [Fri, 14 Dec 2018 09:06:56 +0000 (09:06 +0000)]
MFC r341680

netmap: remove dead code obsoleted by iflib

The iflib subsystem implements netmap support in a driver-independent
way (sys/net/iflib.c). We can therefore remove the headers that
used to implement netmap support for all the drivers now supported
by iflib (em, igb, ixl, ixgbe, lem).

5 years agopfsync: Performance improvement
Kristof Provost [Thu, 13 Dec 2018 20:00:11 +0000 (20:00 +0000)]
pfsync: Performance improvement

pfsync code is called for every new state, state update and state
deletion in pf. While pf itself can operate on multiple states at the
same time (on different cores, assuming the states hash to a different
hashrow), pfsync only had a single lock.
This greatly reduced throughput on multicore systems.

Address this by splitting the pfsync queues into buckets, based on the
state id. This ensures that updates for a given connection always end up
in the same bucket, which allows pfsync to still collapse multiple
updates into one, while allowing multiple cores to proceed at the same
time.

The number of buckets is tunable, but defaults to 2 x number of cpus.
Benchmarking has shown improvement, depending on hardware and setup, from ~30%
to ~100%.

Sponsored by: Orange Business Services

5 years agoMFC r340405:
Mark Johnston [Thu, 13 Dec 2018 16:07:35 +0000 (16:07 +0000)]
MFC r340405:
Add accounting to per-domain UMA full bucket caches.

5 years agoMFC r341638:
Mark Johnston [Thu, 13 Dec 2018 15:51:07 +0000 (15:51 +0000)]
MFC r341638:
Let kern.trap_enotcap be set as a tunable.

5 years agoMFC r340394: ipfw.8: Fix part of the SYNOPSIS documenting
Eugene Grosbein [Thu, 13 Dec 2018 10:52:40 +0000 (10:52 +0000)]
MFC r340394: ipfw.8: Fix part of the SYNOPSIS documenting
LIST OF RULES AND PREPROCESSING that is still referred
as last section of the SYNOPSIS later but was erroneously situated
in the section IN-KERNEL NAT.

5 years agoMFC r341726
Vincenzo Maffione [Thu, 13 Dec 2018 09:40:06 +0000 (09:40 +0000)]
MFC r341726

tools: netmap: pkt-gen: check packet length against interface MTU

Validate the value of the -l argument (packet length) against the MTU of the netmap port.
In case the netmap port does not refer to a physical interface (e.g. VALE port or pipe), then
the netmap buffer size is used as MTU.
This change also sets a better default value for the -M option, so that pkt-gen uses
the largest possible fragments in case of multi-slot packets.

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

5 years agoMFC r341624
Vincenzo Maffione [Thu, 13 Dec 2018 09:39:05 +0000 (09:39 +0000)]
MFC r341624

netmap: netmap_transmit should honor bpf packet tap hook

This allows tcpdump to capture outbound kernel packets while
in netmap mode

Submitted by:   Marc de la Gueronniere <mdelagueronniere@verisign.com>
Reviewed by:    vmaffione
MFC after:      1 week
Sponsored by:   Verisign, Inc.
Differential Revision:  https://reviews.freebsd.org/D17896

5 years agoMFC r341650:
Cy Schubert [Thu, 13 Dec 2018 03:12:15 +0000 (03:12 +0000)]
MFC r341650:

Remove an ugly Ultrix hack. Ultrix has been AWOL since the last ice
age, more to come.

5 years agoMFC: r340745, fix CU: output of the --debug-dump=decodedline.
Maxim Sobolev [Wed, 12 Dec 2018 16:25:30 +0000 (16:25 +0000)]
MFC: r340745, fix CU: output of the --debug-dump=decodedline.

5 years agoMFC r341587:
Hans Petter Selasky [Wed, 12 Dec 2018 13:17:49 +0000 (13:17 +0000)]
MFC r341587:
mlx4/mlx5: Updated driver version to 3.5.0

Sponsored by:   Mellanox Technologies

5 years agoMFC r341586:
Hans Petter Selasky [Wed, 12 Dec 2018 13:16:39 +0000 (13:16 +0000)]
MFC r341586:
mlx5en: Implement backpressure indication.

The backpressure indication is implemented using an unlimited rate type of
mbuf send tag. When the upper layers typically the socket layer has obtained such
a tag, it can then query the destination driver queue for the current
amount of space available in the send queue.

A single mbuf send tag may be referenced multiple times and a refcount has been added
to the mlx5e_priv structure to track its usage. Because the send tag resides
in the mlx5e_channel structure, there is no need to wait for refcounts to reach
zero until the mlx4en(4) driver is detached. The channels structure is persistant
during the lifetime of the mlx5en(4) driver it belongs to and can so be accessed
without any need of synchronization.

The mlx5e_snd_tag structure was extended to contain a type field, because there are now
two different tag types which end up in the driver which need to be distinguished.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341585:
Hans Petter Selasky [Wed, 12 Dec 2018 13:13:39 +0000 (13:13 +0000)]
MFC r341585:
mlx5en: Improve configuration of HW LRO.

In order to enable HW LRO, both the "hw_lro" sysctl in the mlx5en(4) config
space must be set, and the ifconfig(8) LRO capability must be set. Any other
settings will disable HW LRO.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341584:
Hans Petter Selasky [Wed, 12 Dec 2018 13:12:10 +0000 (13:12 +0000)]
MFC r341584:
mlx5en: Count all transmitted and received bytes.

Add counter for all transmitted and received bytes. Currently only all
transmitted and received packets were counted. Fix description of RX LRO
counters while at it.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341583:
Hans Petter Selasky [Wed, 12 Dec 2018 13:08:49 +0000 (13:08 +0000)]
MFC r341583:
mlx5en: Statically allocate and free the channel structure(s).

By allocating the worst case size channel structure array
at attach time we can eliminate various NULL checks in the
fast path. And also reduce the chance for use-after-free
issues in the transmit fast path.

This change is also a requirement for implementing
backpressure support.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341582:
Hans Petter Selasky [Wed, 12 Dec 2018 13:04:53 +0000 (13:04 +0000)]
MFC r341582:
mlx5en: Fix race in mlx5e_ethtool_debug_stats().

Writing to the debug stats variable must be locked,
else serialization will be lost which might cause
various kernel panics due to creating and destroying
sysctls out of order.

Make sure the sysctl context is initialized after freeing
the sysctl nodes, else they can be freed twice.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341581:
Hans Petter Selasky [Wed, 12 Dec 2018 13:03:50 +0000 (13:03 +0000)]
MFC r341581:
mlx5en: Add support for IFM_10G_LR and IFM_40G_ER4 media types.

Inspect the ethernet compliance code to figure out actual cable type by reading
the PDDR module info register.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341580:
Hans Petter Selasky [Wed, 12 Dec 2018 13:02:00 +0000 (13:02 +0000)]
MFC r341580:
mlx5en: Don't set rate on SQs when the SQ is already stopped.

This can happen when connections are short lived and leads to
a firmware error printout in dmesg, syndrome 0x51cfb0, because
the SQ is in the wrong state.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341579:
Hans Petter Selasky [Wed, 12 Dec 2018 12:59:57 +0000 (12:59 +0000)]
MFC r341579:
mlx5en: Fix for inlining issues in transmit path

1) Don't exceed the drivers own hardcoded TX inline limit.

The blueflame register size can be much greater than the hardcoded limit
for inlining. Make sure we don't exceed the drivers own limit, because this
also means that the maximum number of TX fragments becomes invalid and
then memory size assumptions in the TX path no longer hold up.

2) Make sure the mlx5_query_min_inline() function returns an error code.

3) Header inlining is required when using TSO.

4) Catch failure to compute inline header size for TSO.

5) Add support for UDP when computing inline header size.

6) Fix for inlining issues with regards to DSCP.

Make sure we inline 4 bytes beyond the ethernet and/or
VLAN header to workaround a hardware bug extracting
the DSCP field from the IPv4/v6 header.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341578 and r341655:
Hans Petter Selasky [Wed, 12 Dec 2018 12:57:55 +0000 (12:57 +0000)]
MFC r341578 and r341655:
mlx5en: Remove the DRBR and associated logic in the transmit path.

The hardware queues are deep enough currently and using the DRBR and associated
callbacks only leads to more task switching in the TX path. The is also a race
setting the queue_state which can lead to hung TX rings.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341577:
Hans Petter Selasky [Wed, 12 Dec 2018 12:55:28 +0000 (12:55 +0000)]
MFC r341577:
mlx5en: Implement support for bandwidth limiting in by ratio, ETS.

Add support for setting the bandwidth limit as a ratio rather than in bits per
second. The ratio must be an integer number between 1 and 100 inclusivly.

Implement the needed firmware commands and SYSCTLs through mlx5en(4).

Sponsored by:   Mellanox Technologies

5 years agoMFC r341576:
Hans Petter Selasky [Wed, 12 Dec 2018 12:54:21 +0000 (12:54 +0000)]
MFC r341576:
mlx5fpga: Add set and query connect/disconnect FPGA

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341575:
Hans Petter Selasky [Wed, 12 Dec 2018 12:53:23 +0000 (12:53 +0000)]
MFC r341575:
mlx5fpga: IOCTL for FPGA temperature measurement

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341574:
Hans Petter Selasky [Wed, 12 Dec 2018 12:52:10 +0000 (12:52 +0000)]
MFC r341574:
mlx5fpga: Support MorseQ board

Added and supported new enum "morseQ = 4" for fpga_id field

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341573 and r341643:
Hans Petter Selasky [Wed, 12 Dec 2018 12:50:13 +0000 (12:50 +0000)]
MFC r341573 and r341643:
mlx5fpga_tools initial code import.

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341572 and r341590:
Hans Petter Selasky [Wed, 12 Dec 2018 12:46:11 +0000 (12:46 +0000)]
MFC r341572 and r341590:
mlx5fpga: Initial code import.

Submitted by:   kib@
Sponsored by:   Mellanox Technologies

5 years agoMFC r341571:
Hans Petter Selasky [Wed, 12 Dec 2018 12:35:33 +0000 (12:35 +0000)]
MFC r341571:
mlx5ib: Set default active width and speed when querying port.

Make sure the active width and speed is set in case the
translate_eth_proto_oper() function doesn't recognize the
current port operation mask.

Linux commit:
7672ed33c4c15dbe9d56880683baaba4227cf940

Sponsored by:   Mellanox Technologies

5 years agoMFC r341570:
Hans Petter Selasky [Wed, 12 Dec 2018 12:34:30 +0000 (12:34 +0000)]
MFC r341570:
mlx5ib: Make sure the congestion work timer does not escape the drain procedure.

If the mlx5_ib_read_cong_stats() function was running when mlx5ib was unloaded,
because this function unconditionally restarts the timer, the timer can still
be pending after the delayed work has been cancelled. To fix this simply loop
on the delayed work cancel procedure as long as it returns non-zero.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341569:
Hans Petter Selasky [Wed, 12 Dec 2018 12:33:12 +0000 (12:33 +0000)]
MFC r341569:
mlx5ib: Fix null pointer dereference in mlx5_ib_create_srq

Although "create_srq_user" does overwrite "in.pas" on some paths, it
also contains at least one feasible path which does not overwrite it.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341568:
Hans Petter Selasky [Wed, 12 Dec 2018 12:31:57 +0000 (12:31 +0000)]
MFC r341568:
mlx5ib: Fix sign extension in mlx5_ib_query_device

"fw_rev_min(dev->mdev)" with type "unsigned short" (16 bits, unsigned) is
promoted in "fw_rev_min(dev->mdev) << 16" to type "int" (32 bits, signed), then
sign-extended to type "unsigned long" (64 bits, unsigned). If
"fw_rev_min(dev->mdev) << 16" is greater than 0x7FFFFFFF, the upper bits of the
result will all be 1.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341567:
Hans Petter Selasky [Wed, 12 Dec 2018 12:30:47 +0000 (12:30 +0000)]
MFC r341567:
mlx5: Fix driver version location

Driver description should be set by core and not by the Ethernet driver.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341566:
Hans Petter Selasky [Wed, 12 Dec 2018 12:29:22 +0000 (12:29 +0000)]
MFC r341566:
mlx5: Fixes to allow command polling mode to exist alongside event mode.

A command is either polling or event driven and the mode cannot change
during execution of a command. Make sure the event handler only handle
commands which are not polled. This is done by checking the command mode
in the command handler before completing commands.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341565:
Hans Petter Selasky [Wed, 12 Dec 2018 12:28:16 +0000 (12:28 +0000)]
MFC r341565:
mlx5: Fix wrong size allocation for QoS ETC TC register

The driver allocates wrong size (due to wrong struct name) when issuing
a query/set request to NIC's register.

Linux commit:
d14fcb8d877caf1b8d6bd65d444bf62b21f2070c

Sponsored by:   Mellanox Technologies

5 years agoMFC r341564:
Hans Petter Selasky [Wed, 12 Dec 2018 12:26:59 +0000 (12:26 +0000)]
MFC r341564:
mlx5: Add software tx_jumbo_packets counter

This counter will represent transmitted packets which has more than
1518 octets.
The NIC has multiple hardware counters for counting transmitted
packets larger than 1518 octets. Each counter counts the packets
in specific range.
We accumulate those counters to have a single counter.

Sponsored by:   Mellanox Technologies

5 years agoMFC r341563:
Hans Petter Selasky [Wed, 12 Dec 2018 12:26:01 +0000 (12:26 +0000)]
MFC r341563:
mlx5: Implement support for configuring PCIe packet write ordering via a sysctl.

Sponsored by:   Mellanox Technologies