]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoAs discussed several times on freebsd-arch, start to decommission armeb.
imp [Tue, 17 Jul 2018 23:23:34 +0000 (23:23 +0000)]
As discussed several times on freebsd-arch, start to decommission armeb.

Remove armeb/arm from KNOWN_ARCHS.
Remove armeb from arm universe targets.

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

5 years agoCheck that EC2SNSTOPIC and EC2PUBLIC are non-empty, along with being
cperciva [Tue, 17 Jul 2018 23:16:05 +0000 (23:16 +0000)]
Check that EC2SNSTOPIC and EC2PUBLIC are non-empty, along with being
defined, in order to avoid problems with thermite.sh.

Reported by: gjb

5 years agoFix compile error introduced in r336245.
imp [Tue, 17 Jul 2018 23:00:52 +0000 (23:00 +0000)]
Fix compile error introduced in r336245.

Include sys/boot.h to pickup the prototypes for boot_parse_arg.

5 years agoRemove bogus attempt to simulate scrolling. It's not needed and messes
imp [Tue, 17 Jul 2018 21:45:14 +0000 (21:45 +0000)]
Remove bogus attempt to simulate scrolling. It's not needed and messes
up serial output. Setting the cursor position after every character is
inefficient, and causes all lines to be over-printed in the serial
console for the boot loader. Allow the terminal to do the emulation.

This isn't completely perfect when the size of the terminal attached
to the serial port isn't the same as 80x25 to match the viedoe console
(or whatever the video console is). While imperfect still, these
changes make it much better.

This makes the serial port useful with UEFI.

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

5 years agoFix a typo: change lists to list to match rest of sentence.
imp [Tue, 17 Jul 2018 21:18:49 +0000 (21:18 +0000)]
Fix a typo: change lists to list to match rest of sentence.

Also, I misspoke in r336428. Any devices on sparc64 machines on "isa"
that can do DMA can do 32-bit address DMA and aren't limited to
24-bits of address.

5 years agoRemove VM_FREELIST_ISADMA
imp [Tue, 17 Jul 2018 21:08:01 +0000 (21:08 +0000)]
Remove VM_FREELIST_ISADMA

Sparc64 doesn't have any devices that do DMA that are attached to isa
or ebus, so we don't need a low-memory pool.

5 years agoRemove VM_FREELIST_ISADMA. It's not needed on these architectures.
imp [Tue, 17 Jul 2018 21:07:53 +0000 (21:07 +0000)]
Remove VM_FREELIST_ISADMA. It's not needed on these architectures.

Differential Review: https://reviews.freebsd.org/D16290

5 years agohyperv/hn: Fix panic in hypervisor code upon device detach event
dexuan [Tue, 17 Jul 2018 21:05:08 +0000 (21:05 +0000)]
hyperv/hn: Fix panic in hypervisor code upon device detach event

Submitted by: hselasky
Reviewed by: dexuan
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D16139

5 years agoMore typos
imp [Tue, 17 Jul 2018 20:26:17 +0000 (20:26 +0000)]
More typos

Noticed by: ian@

5 years agoFix typo in the command summary.
imp [Tue, 17 Jul 2018 20:11:52 +0000 (20:11 +0000)]
Fix typo in the command summary.

Of course, I can't get the command to work, but it's a start...

5 years agoTeach EC2 AMI release code to send an SNS notification after publishing
cperciva [Tue, 17 Jul 2018 19:05:30 +0000 (19:05 +0000)]
Teach EC2 AMI release code to send an SNS notification after publishing
new AMIs if EC2SNSTOPIC is defined.

Reviewed by: gjb
Requested by: Amazon

5 years agoconfig(8): Invert checks; envmode/hintmode reflect "env provided"1
kevans [Tue, 17 Jul 2018 15:16:34 +0000 (15:16 +0000)]
config(8): Invert checks; envmode/hintmode reflect "env provided"1

5 years agoaudit(4): add tests for _exit(2), cap_enter(2), and cap_getmode(2)
asomers [Tue, 17 Jul 2018 15:12:55 +0000 (15:12 +0000)]
audit(4): add tests for _exit(2), cap_enter(2), and cap_getmode(2)

Also, fix a bug in common code that could cause other tests to fail: using
ppoll(2) in combination with buffered I/O for /dev/auditpipe.  Fix it by
disabling buffering.

Submitted by: aniketp
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16099

5 years agoAdd a FALLTHROUGH comment to kvprintf().
markj [Tue, 17 Jul 2018 14:56:54 +0000 (14:56 +0000)]
Add a FALLTHROUGH comment to kvprintf().

Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de>
MFC after: 3 days

5 years agoFix GCC 4.2 build after r336415, proper declaration and prototype
kevans [Tue, 17 Jul 2018 14:34:54 +0000 (14:34 +0000)]
Fix GCC 4.2 build after r336415, proper declaration and prototype

5 years agoconfig(8): Add compatibility shims for r335998
kevans [Tue, 17 Jul 2018 14:14:53 +0000 (14:14 +0000)]
config(8): Add compatibility shims for r335998

Plumb the %VERSREQ from Makefile.<arch> through to the rest of config(8).
We've recorded the config(8) version that we're calling "the end of
envmode and hintmode," and we'll write them out for earlier versions. Later
kernel version bumps will remove envmode/hintmode from the kernel as needed,
which is OK since the current kernel does not use them at all.

These compatibility shims really need to go away when the major version
rolls over...

Discussed with: imp

5 years agoRevert r336353 completely based on protest; compatibility shims incoming
kevans [Tue, 17 Jul 2018 14:11:30 +0000 (14:11 +0000)]
Revert r336353 completely based on protest; compatibility shims incoming

5 years agoMinor cleanups to csqrt*(), mostly in comments.
bde [Tue, 17 Jul 2018 12:01:59 +0000 (12:01 +0000)]
Minor cleanups to csqrt*(), mostly in comments.

Remove the STDC CX_LIMITED_RANGE pragma and its verbose comment.  We still
don't have any C99 compilers (that support fenv pragmas), and if we did
then there are thousands of other places in libm that would need to use
them more than here.

The other cleanups are smaller.

5 years agoUse a mbuf header instead of a mbuf cluster for debugging interrupts in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:53:37 +0000 (11:53 +0000)]
Use a mbuf header instead of a mbuf cluster for debugging interrupts in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd module parameter to limit number of MSIX EQ vectors in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:47:56 +0000 (11:47 +0000)]
Add module parameter to limit number of MSIX EQ vectors in mlx5en(4).

For setups having a large amount of PCI devices, it makes sense to limit the
number of MSIX vectors per PCI device, in order to avoid running out of IRQ
vectors.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd missing newline.
hselasky [Tue, 17 Jul 2018 11:43:43 +0000 (11:43 +0000)]
Add missing newline.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoHandle jumbo frames without requiring big clusters in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:42:05 +0000 (11:42 +0000)]
Handle jumbo frames without requiring big clusters in mlx5en(4).

The scatter list is formed by the chunks of MCLBYTES each, and larger
than default packets are returned to the stack as the mbuf chain.

Submitted by: kib@
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRetrospectively document SVN branch point for stable-11
peterj [Tue, 17 Jul 2018 11:35:40 +0000 (11:35 +0000)]
Retrospectively document SVN branch point for stable-11

Approved by: jhb (mentor)
Differential Revision: https://reviews.freebsd.org/D16262

5 years agoMove invoking of callout_stop(&lle->lle_timer) into llentry_free().
ae [Tue, 17 Jul 2018 11:33:23 +0000 (11:33 +0000)]
Move invoking of callout_stop(&lle->lle_timer) into llentry_free().

This deduplicates the code a bit, and also implicitly adds missing
callout_stop() to in[6]_lltable_delete_entry() functions.

PR: 209682, 225927
Submitted by: hselasky (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D4605

5 years agoEnable both receive and transmit pauseframes by default in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:21:02 +0000 (11:21 +0000)]
Enable both receive and transmit pauseframes by default in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd context numbers for HW elements in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:18:01 +0000 (11:18 +0000)]
Add context numbers for HW elements in mlx5en(4).

To access the data, set sysctl dev.mce.N.conf.debug_stats to 1.
This enables the sysctl node dev.mce.N.hw_ctx_debug.  Its content is
the mapping of each channel' number to used receive queue and associated
completion queue, set of the transmit queues numbers and corresponding
completion queues.

Trimmed example output:
channel 30 rq 188 cq 1085
channel 30 tc 0 sq 187 cq 1084
channel 31 rq 191 cq 1087
channel 31 tc 0 sq 190 cq 1086

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoDo not hint about 'trust both' mode when the mlx5en(4) hardware does not support it.
hselasky [Tue, 17 Jul 2018 11:11:30 +0000 (11:11 +0000)]
Do not hint about 'trust both' mode when the mlx5en(4) hardware does not support it.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoCorrectly write atomic variable in mlx5en(4).
hselasky [Tue, 17 Jul 2018 11:08:40 +0000 (11:08 +0000)]
Correctly write atomic variable in mlx5en(4).

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix scaling bugs which gave innaccuracies and spurious underflows in csqrt()
bde [Tue, 17 Jul 2018 10:44:16 +0000 (10:44 +0000)]
Fix scaling bugs which gave innaccuracies and spurious underflows in csqrt()
and csqrtl().

When one component is huge and the other is tiny, scaling down the tiny
component gave spurious underflow.

When both components are denormal, not scaling them up gave inaccuracies
of 34+ ulps on not very carefully selected args.  Fixing this reduces the
maximum error to 1.6 ulps on the same set of args (mosly not denormal ones).

The scaling used multiplication of a complex variable by 2, but clang messes
this on amd64 up by losing the sign of -0.0.  Calculate the components
separately, as is well known to be needed for operations on more exceptional
values.

5 years agoRemove redundant call to mlx5_vsc_find_cap() in mlx5core.
hselasky [Tue, 17 Jul 2018 10:27:46 +0000 (10:27 +0000)]
Remove redundant call to mlx5_vsc_find_cap() in mlx5core.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoMake sure the state variable is set atomically instead of using a mutex in mlx5core.
hselasky [Tue, 17 Jul 2018 10:20:01 +0000 (10:20 +0000)]
Make sure the state variable is set atomically instead of using a mutex in mlx5core.

Device detach and setting error state may deadlock over the interface mutex
like this:

a) Detach code in mlx5en waits until error state is set while the interface
mutex is locked.
b) The set error handler needs to lock the interface mutex before it can
set the error state.

The solution is to use atomics to set the error state.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRefactor access to CR-space into using VSC APIs in mlx5core.
hselasky [Tue, 17 Jul 2018 10:16:32 +0000 (10:16 +0000)]
Refactor access to CR-space into using VSC APIs in mlx5core.

Remove no longer used files and APIs.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRemove redundant newline character in mlx5core.
hselasky [Tue, 17 Jul 2018 10:11:00 +0000 (10:11 +0000)]
Remove redundant newline character in mlx5core.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoUpdate version information for the mlx5ib module.
hselasky [Tue, 17 Jul 2018 10:07:40 +0000 (10:07 +0000)]
Update version information for the mlx5ib module.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoDon't pass unsupported events to ibcore from mlx5ib.
hselasky [Tue, 17 Jul 2018 09:59:55 +0000 (09:59 +0000)]
Don't pass unsupported events to ibcore from mlx5ib.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoUse static device naming instead of dynamic one in mlx5ib.
hselasky [Tue, 17 Jul 2018 09:58:11 +0000 (09:58 +0000)]
Use static device naming instead of dynamic one in mlx5ib.

When resetting mlx5core instances it can happen that the order of attach and
detach for mlx5ib instances is changed. Take the unit number for mlx5_%d from
the parent PCI device, similarly to what is done in mlx5en(4), so that there
is a direct relationship between mce<N> and mlx5_<N>.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoImplement support for Differentiated Service Code Point, DSCP, in mlx5en(4).
hselasky [Tue, 17 Jul 2018 09:56:40 +0000 (09:56 +0000)]
Implement support for Differentiated Service Code Point, DSCP, in mlx5en(4).

The DSCP feature is controlled using a set of sysctl(8) fields under
the qos sysctl directory entry for mlx5en(4).

For Routable RoCE QPs, the DSCP should be set in the QP's address path.
The DSCP's value is derived from the traffic class.

Linux commit:
ed88451e1f2d400fd6a743d0a481631cf9f97550

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoUse __FBSDID() for RCS tags in ibcore.
hselasky [Tue, 17 Jul 2018 09:47:14 +0000 (09:47 +0000)]
Use __FBSDID() for RCS tags in ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRemove blank line.
hselasky [Tue, 17 Jul 2018 09:44:16 +0000 (09:44 +0000)]
Remove blank line.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd support for IPv6 multicast in ibcore.
hselasky [Tue, 17 Jul 2018 09:37:16 +0000 (09:37 +0000)]
Add support for IPv6 multicast in ibcore.

This change allows us to join IPv6 multicast networks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd support for RoCEv2 multicast in ibcore.
hselasky [Tue, 17 Jul 2018 09:36:04 +0000 (09:36 +0000)]
Add support for RoCEv2 multicast in ibcore.

When creating address handle from multicast GID, set MAC according to
the appropriate formula instead of searching for it in the GID table:
- For IPv4 multicast GID use ip_eth_mc_map().
- For IPv6 multicast GID use ipv6_eth_mc_map().

Linux commit:
9636a56fa864464896bf7d1272c701f2b9a57737

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoHonor return status of ib_init_ah_from_mcmember() in ibcore.
hselasky [Tue, 17 Jul 2018 09:34:29 +0000 (09:34 +0000)]
Honor return status of ib_init_ah_from_mcmember() in ibcore.

The return status of ib_init_ah_from_mcmember() is ignored by
cma_ib_mc_handler().  Honor it and return error event if ah attribute
initialization failed.

Linux commit:
6d337179f28cc50ddd7e224f677b4cda70b275fc

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoHonor port_num while resolving GID for IB link layer in ibcore.
hselasky [Tue, 17 Jul 2018 09:33:20 +0000 (09:33 +0000)]
Honor port_num while resolving GID for IB link layer in ibcore.

ah_attr contains the port number to which cm_id is bound. However, while
searching for GID table for matching GID entry, the port number is
ignored.

This could cause the wrong GID to be used when the ah_attr is converted to
an AH.

Linux commit:
563c4ba3bd2b8b0b21c65669ec2226b1cfa1138b

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoSet IPv4 TOS and IPv6 traffic class field for RoCEv2 traffic in ibcore.
hselasky [Tue, 17 Jul 2018 09:32:09 +0000 (09:32 +0000)]
Set IPv4 TOS and IPv6 traffic class field for RoCEv2 traffic in ibcore.

The current implementation assumes a static mapping between
the TOS bits and the priority code point, PCP bits.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix for loopback detection in address resolve logic in ibcore.
hselasky [Tue, 17 Jul 2018 09:30:32 +0000 (09:30 +0000)]
Fix for loopback detection in address resolve logic in ibcore.

When a loopback address is detected use the network interface which
has the loopback flag set to trigger loopback logic in address resolve.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoCheck port number supplied by user verbs cmds in ibcore.
hselasky [Tue, 17 Jul 2018 09:29:14 +0000 (09:29 +0000)]
Check port number supplied by user verbs cmds in ibcore.

The ib_uverbs_create_ah() ind ib_uverbs_modify_qp() calls receive
the port number from user input as part of its attributes and assumes
it is valid. Down on the stack, that parameter is used to access kernel
data structures.  If the value is invalid, the kernel accesses memory
it should not.  To prevent this, verify the port number before using it.

Linux commit:
5ecce4c9b17bed4dc9cb58bfb10447307569b77b
a62ab66b13a0f9bcb17b7b761f6670941ed5cd62
5a7a88f1b488e4ee49eb3d5b82612d4d9ffdf2c3

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoDepend on IPv6 stack to resolve link local address for RoCEv2 in ibcore.
hselasky [Tue, 17 Jul 2018 09:27:31 +0000 (09:27 +0000)]
Depend on IPv6 stack to resolve link local address for RoCEv2 in ibcore.

RoCEv1 does not use the IPv6 stack to resolve the link local DGID since it
uses GID address. It forms the DMAC directly from the DGID.

Linux commit:
56d0a7d9a0f045ee27a001762deac28c7d28e2e4

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix kernel crash during fail to initialize device in ibcore.
hselasky [Tue, 17 Jul 2018 09:26:09 +0000 (09:26 +0000)]
Fix kernel crash during fail to initialize device in ibcore.

This patch fixes the kernel crash that occurs during ib_dealloc_device()
called due to provider driver fails with an error after
ib_alloc_device() and before it can register using ib_register_device().

This crashed seen in tha lab as below which can occur with any IB device
which fails to perform its device initialization before invoking
ib_register_device().

This patch avoids touching cache and port immutable structures if device
is not yet initialized.
It also releases related memory when cache and port immutable data
structure initialization fails during register_device() state.

Linux commit:
4be3a4fa51f432ef045546d16f25c68a1ab525b9

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoCheck AF family prior resolving address and introduce safer rdma_addr_size() variants...
hselasky [Tue, 17 Jul 2018 09:24:39 +0000 (09:24 +0000)]
Check AF family prior resolving address and introduce safer rdma_addr_size() variants in ibcore.

Garbage supplied by user will cause to UCMA module provide zero
memory size for memcpy(), because it wasn't checked, it will
produce unpredictable results in rdma_resolve_addr().

There are several places in the ucma ABI where userspace can pass in a
sockaddr but set the address family to AF_IB.  When that happens,
rdma_addr_size() will return a size bigger than sizeof struct sockaddr_in6,
and the ucma kernel code might end up copying past the end of a buffer
not sized for a struct sockaddr_ib.

Fix this by introducing new variants
    int rdma_addr_size_in6(struct sockaddr_in6 *addr);
    int rdma_addr_size_kss(struct __kernel_sockaddr_storage *addr);

that are type-safe for the types used in the ucma ABI and return 0 if the
size computed is bigger than the size of the type passed in.  We can use
these new variants to check what size userspace has passed in before
copying any addresses.

Linux commit:
2975d5de6428ff6d9317e9948f0968f7d42e5d74
09abfe7b5b2f442a85f4c4d59ecf582ad76088d7
84652aefb347297aa08e91e283adf7b18f77c2d5

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoCheck for a cm_id->device in all user calls that need it in ibcore.
hselasky [Tue, 17 Jul 2018 09:22:26 +0000 (09:22 +0000)]
Check for a cm_id->device in all user calls that need it in ibcore.

This was done by auditing all callers of ucma_get_ctx and switching the
ones that unconditionally touch ->device to ucma_get_ctx_dev. This covers
a little less than  half of the call sites.

The 11 remaining call sites to ucma_get_ctx() were manually audited.

Linux commit:
4b658d1bbc16605330694bb3ef2570c465ef383d
8b77586bd8fe600d97f922c79f7222c46f37c118

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoRestore initialisation of ctx->uid in ucma_create_id() in ibcore.
hselasky [Tue, 17 Jul 2018 09:21:05 +0000 (09:21 +0000)]
Restore initialisation of ctx->uid in ucma_create_id() in ibcore.

This fixes a regression issue after r336373.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix kernel panic while using XRC_TGT QP type in ibcore.
hselasky [Tue, 17 Jul 2018 09:18:16 +0000 (09:18 +0000)]
Fix kernel panic while using XRC_TGT QP type in ibcore.

Attempt to modify XRC_TGT QP type from the user space (ibv_xsrq_pingpong
invocation) will trigger the following kernel panic. It is caused by the
fact that such QPs missed uobject initialization.

Linux commit:
f45765872e7aae7b81feb3044aaf9886b21885ef

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix NULL pointer dereference during device removal in ibcore.
hselasky [Tue, 17 Jul 2018 09:16:54 +0000 (09:16 +0000)]
Fix NULL pointer dereference during device removal in ibcore.

As part of ib_uverbs_remove_one which might be triggered upon
reset flow, we trigger IB_EVENT_DEVICE_FATAL event to userspace
application.
If device was removed after uverbs fd was opened but before
ib_uverbs_get_context was called, the event file will be accessed
before it was allocated, result in NULL pointer dereference:

Linux commit:
870201f95fcbd19538aef630393fe9d583eff82e

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix access to non-initialized CM_ID object in ibcore.
hselasky [Tue, 17 Jul 2018 09:15:50 +0000 (09:15 +0000)]
Fix access to non-initialized CM_ID object in ibcore.

The attempt to join multicast group without ensuring that CMA device
exists will lead to the following crash reported by syzkaller.

Linux commit:
7688f2c3bbf55e52388e37ac5d63ca471a7712e1

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAvoid that ib_drain_qp() triggers an out-of-bounds stack access in ibcore.
hselasky [Tue, 17 Jul 2018 09:14:20 +0000 (09:14 +0000)]
Avoid that ib_drain_qp() triggers an out-of-bounds stack access in ibcore.

Linux commit:
a1ae7d0345edd593d6725d3218434d903a0af95d

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoEnsure that CM_ID exists prior to access it in ibcore.
hselasky [Tue, 17 Jul 2018 09:13:11 +0000 (09:13 +0000)]
Ensure that CM_ID exists prior to access it in ibcore.

Prior to access UCMA commands, the context should be initialized
and connected to CM_ID with ucma_create_id(). In case user skips
this step, he can provide non-valid ctx without CM_ID and cause
to multiple NULL dereferences.

Also there are situations where the create_id can be raced with
other user access, ensure that the context is only shared to
other threads once it is fully initialized to avoid the races.

Linux commit:
e8980d67d6017c8eee8f9c35f782c4bd68e004c9

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd support for prio-tagged traffic for RDMA in ibcore.
hselasky [Tue, 17 Jul 2018 09:11:53 +0000 (09:11 +0000)]
Add support for prio-tagged traffic for RDMA in ibcore.

When receiving a PCP change all GID entries are reloaded.
This ensures the relevant GID entries use prio tagging,
by setting VLAN present and VLAN ID to zero.

The priority for prio tagged traffic is set using the regular
rdma_set_service_type() function.

Fake the real network device to have a VLAN ID of zero
when prio tagging is enabled. This is logic is hidden inside
the rdma_vlan_dev_vlan_id() function which must always be used
to retrieve the VLAN ID throughout all of ibcore and the
infiniband network drivers.

The VLAN presence information then propagates through all
of ibcore and so incoming connections will have the VLAN
bit set. The incoming VLAN ID is then checked against the
return value of rdma_vlan_dev_vlan_id().

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoSet default GID type as RoCE when resolving RoCE route in ibcore.
hselasky [Tue, 17 Jul 2018 09:09:17 +0000 (09:09 +0000)]
Set default GID type as RoCE when resolving RoCE route in ibcore.

cma_iboe_set_mgid() is updated to reflect the RoCEv2 GID check.

Linux commit:
5c181bda77f409d89ad513528eccac5f3a416474

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoSet RoCEv2 MGID according to spec in ibcore.
hselasky [Tue, 17 Jul 2018 09:07:36 +0000 (09:07 +0000)]
Set RoCEv2 MGID according to spec in ibcore.

RoCEv2 Annex states that for RoCEv2 over IPv4, the corresponding
IPv4 address is encoded into the GID according to the following rule:
GID= :ffff:<IPv4 address>

Remove the 0xff0e prefix for RoCEv2 packets with IPv4 and leave it
zeroed and change rdma_is_multicast_addr() to consider the new logic.

Linux commit:
be1d325a335840a86c133a56c6a911c368bac0fd
1c3aea2bc8f0b2e5b57375ead40457ff75a3a2ec

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFor multicast functions in ibcore, verify that LIDs are multicast LIDs.
hselasky [Tue, 17 Jul 2018 09:04:36 +0000 (09:04 +0000)]
For multicast functions in ibcore, verify that LIDs are multicast LIDs.

The Infiniband spec defines "A multicast address is defined by a
MGID and a MLID" (section 10.5).

Add check to verify that the MLID value is in the correct address
range.

RoCE Annex (A16.9.10/11) declares that during attach (detach) QP to a
multicast group, if the QP is associated with a RoCE port, the
multicast group MLID is unused and is ignored.

During attach or detach multicast, when the QP is associated with a
port, it is enough to check the port's link layer and validate the
LID only if it is Infiniband. Otherwise, avoid validating the
multicast LID.

Linux commit:
8561eae60ff9417a50fa1fb2b83ae950dc5c1e21
5236333592244557a19694a51337df6ac018f0a7

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix for RDMA loopback over VLAN in ibcore.
hselasky [Tue, 17 Jul 2018 09:02:29 +0000 (09:02 +0000)]
Fix for RDMA loopback over VLAN in ibcore.

Implement a more generic solution for detecting loopback.
The problem was that the default netdevice was resolved
for loopback also when VLAN was used. Use real network
device instead of loopback device for bound device
interface.

How to test:
ucmatose -b 127.0.0.1 -p 20090
ucmatose -s 5.6.5.1 -p 20090

Note that RDMA treats the IPv4 and IPv6 loopback
addresses like any address.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd native FreeBSD support for multicast in ibcore.
hselasky [Tue, 17 Jul 2018 08:59:34 +0000 (08:59 +0000)]
Add native FreeBSD support for multicast in ibcore.

This change adds support for registering multicast addresses,
both IPv4 and IPv6.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoIf the MGID/MLID pair is not on the list return an error in ibcore.
hselasky [Tue, 17 Jul 2018 08:54:40 +0000 (08:54 +0000)]
If the MGID/MLID pair is not on the list return an error in ibcore.

A list of MGID/MLID pairs is built when doing a multicast attach.  When
the multicast detach is called, the list is searched, and regardless of
the search outcome, the driver detach is called.

If an MGID/MLID pair is not on the list, driver detach should not be
called, and an error should be returned.  Calling the driver without
removing an MGID/MLID pair from the list can leave the core and driver
out of sync.

Linux commit:
20c7840a77ddcb2ed2fbd66e8197db2868495751

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd lock to multicast handlers in ibcore.
hselasky [Tue, 17 Jul 2018 08:52:29 +0000 (08:52 +0000)]
Add lock to multicast handlers in ibcore.

When two handlers used the same object in the old schema, we blocked
the process in the kernel. The new schema just returns -EBUSY. This
could lead to different behaviour in applications between the old
schema and the new schema. In most cases, using such handlers
concurrently could lead to crashing the process. For example, if
thread A destroys a QP and thread B modifies it, we could have the
destruction happens before the modification. In this case, we are
accessing freed memory which could lead to crashing the process.
This is true for most cases. However, attaching and detaching
a multicast address from QP concurrently is safe. Therefore, we
preserve the original behaviour by adding a lock there.

Linux commit:
f48b726920d96dcd1860df06143bdea7d6d7dcc3

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoOnly update source address when resolving is successful in ibcore.
hselasky [Tue, 17 Jul 2018 08:48:30 +0000 (08:48 +0000)]
Only update source address when resolving is successful in ibcore.

When resolving an IP address in ibcore, only update the source address
upon normal completion. The ibcore address resolve function does not
care about the scope ID value of the IPv6 link-local addresses and expects
this information has already been extracted into the bound_dev_if field.
Because the same IPv6 link-local address can exist on multiple interfaces
the ibcore address resolver gets confused and returns ENETUNREACH.

Instead of updating both source address and bound_dev_if just keep the
address set to any address until resolving completes. For the sake of code
symmetry a similar change has been applied to the IPv4 address resolve path.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoProcess address resolve requests at least one time per second in ibcore.
hselasky [Tue, 17 Jul 2018 08:34:49 +0000 (08:34 +0000)]
Process address resolve requests at least one time per second in ibcore.

When setting a large address resolve timeout it was observed that the
address resolving would succeed at the timeout and not when the address
was available. Make sure the address resolving requests are processed no
slower than one time every second.

While at it use "int" for jiffies instead of "unsigned long" to match
FreeBSD ticks.

MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoAdd a macro nan_mix() and use it to get NaN results that are (bitwise)
bde [Tue, 17 Jul 2018 07:42:14 +0000 (07:42 +0000)]
Add a macro nan_mix() and use it to get NaN results that are (bitwise)
independent of the precision in most cases.  This is mainly to simplify
checking for errors.  r176266 did this for e_pow[f].c using a less
refined expression that often didn't work.  r176276 fixes an error in
the log message for r176266.  The main refinement is to always expand
to long double precision.  See old log messages (especially these 2)
and the comment on the macro for more general details.

Specific details:
- using nan_mix() consistently for the new and old pow*() functions was
  the only thing needed to make my consistency test for powl() vs pow()
  pass on amd64.

- catrig[fl].c already had all the refinements, but open-coded.

- e_atan2[fl].c, e_fmod[fl].c and s_remquo[fl] only had primitive NaN
  mixing.

- e_hypot[fl].c already had a different refined version of r176266.  Refine
  this further.  nan_mix() is not directly usable here since we want to
  clear the sign bit.

- e_remainder[f].c already had an earlier version of r176266.

- s_ccosh[f].c,/s_csinh[f].c already had a version equivalent to r176266.
  Refine this further.  nan_mix() is not directly usable here since the
  expression has to handle some non-NaN cases.

- s_csqrt.[fl]: the mixing was special and mostly wrong.  Partially fix the
  special version.

- s_ctanh[f].c already had a version of r176266.

5 years agoAdd needed locking for um_flags added in -r335808.
mckusick [Tue, 17 Jul 2018 04:43:58 +0000 (04:43 +0000)]
Add needed locking for um_flags added in -r335808.

While here document required locking details in ufsmount structure.

Reported by: kib
Reviewed by: kib

5 years agoFreeBSD_version bump as per r336351,
pfg [Tue, 17 Jul 2018 02:20:51 +0000 (02:20 +0000)]
FreeBSD_version bump as per r336351,

Updating the libstdc++ is likely to have consequences for archs that are
still using the older GCC based toolchain.

Requested by: mcl

5 years agoRevert 336358 and step away fron machine for the day...
kevans [Mon, 16 Jul 2018 23:32:24 +0000 (23:32 +0000)]
Revert 336358 and step away fron machine for the day...

VERSREQ < 7.+ physically will not work with new config(8) due to major bump,
which is why I bumped it in the first place... Back to the original version

5 years agoPartially revert r336353: sys/conf/* %VERSREQ bumps
kevans [Mon, 16 Jul 2018 21:53:30 +0000 (21:53 +0000)]
Partially revert r336353: sys/conf/* %VERSREQ bumps

The changes made in r335998 don't strictly require a newer config(8),
though it is advised. The %VERSREQ bumps were premature.

5 years agoModify the reasons for not issuing a delegation in the NFSv4.1 server.
rmacklem [Mon, 16 Jul 2018 21:32:50 +0000 (21:32 +0000)]
Modify the reasons for not issuing a delegation in the NFSv4.1 server.

The ESXi NFSv4.1 client will generate warning messages when the reason for
not issuing a delegation is two. Two refers to a resource limit and I do
not see why it would be considered invalid. However it probably was not the
best choice of reason for not issuing a delegation.
This patch changes the reasons used to ones that the ESXi client doesn't
complain about. This change does not affect the FreeBSD client and does
not appear to affect behaviour of the Linux NFSv4.1 client.
RFC5661 defines these "reasons" but does not give any guidance w.r.t. which
ones are more appropriate to return to a client.

Tested by: andreas.nagy@frequentis.com
PR: 226650
MFC after: 2 weeks

5 years agoUpdate igb_sctx_init for r336313, missed when incorporating shurd@'s
marius [Mon, 16 Jul 2018 19:47:57 +0000 (19:47 +0000)]
Update igb_sctx_init for r336313, missed when incorporating shurd@'s
feedback on the initial D15720.

Reported by: kib

5 years agodtrace/powerpc: Correct register indices for non-indexed registers in the trapframe
jhibbits [Mon, 16 Jul 2018 19:47:29 +0000 (19:47 +0000)]
dtrace/powerpc: Correct register indices for non-indexed registers in the trapframe

Fix an off-by-one error, LR starts at index 32, not index 33, and the others
follow suit.

5 years agozfsboot: fix build with WITHOUT_LOADER_GELI
lwhsu [Mon, 16 Jul 2018 19:21:50 +0000 (19:21 +0000)]
zfsboot: fix build with WITHOUT_LOADER_GELI

Reviewed by: ian
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D16292

5 years agoconfig(8): Bump major version after r335998
kevans [Mon, 16 Jul 2018 19:05:50 +0000 (19:05 +0000)]
config(8): Bump major version after r335998

config-generated hints.c/env.c from r335998 and later are incompatible with
earlier kernels due to no longer setting envmode/hintmode. A minor bump for
this is insufficient, as matching major version with a later minor version
is still viewed as backwards-compatible.

This was an MI kernel change, soo all VERSREQ's are bumped.

5 years agoOCF: Convert consumers to the session id typedef
cem [Mon, 16 Jul 2018 19:01:05 +0000 (19:01 +0000)]
OCF: Convert consumers to the session id typedef

These were missed in the earlier r336269.

No functional change.

Sponsored by: Dell EMC Isilon

5 years agoUpdate libstdc++ configuration.
pfg [Mon, 16 Jul 2018 18:53:28 +0000 (18:53 +0000)]
Update libstdc++ configuration.

Its been quite a while since the last time we updated this and since then
we have grown iconv and a bunch of complex math functions.

This only applies to the platforms which still use GCC 4.2.1 in the
toolchain.

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

5 years agosysrc(8): Send error message to stderr (not stdout)
dteske [Mon, 16 Jul 2018 18:53:17 +0000 (18:53 +0000)]
sysrc(8): Send error message to stderr (not stdout)

PR: bin/229806
Reported by: Andreas Sommer <andreas.sommer87@googlemail.com>
MFC after: 3 days
X-MFC-to: stable/11 stable/10 stable/9
Sponsored by: Smule, Inc.

5 years agoDon't use the static keyword with DPCPU defines in arm64 modules.
andrew [Mon, 16 Jul 2018 18:21:29 +0000 (18:21 +0000)]
Don't use the static keyword with DPCPU defines in arm64 modules.

On arm64 compiler will create PC-relative loads and stores for static data.
This means it doesn't emit a relocation. Unfortunately the in-kernel linker
expects there to be one for DPCPU defines so it can modify its value so the
code will use the correct DPCPU region.

To workaround the lack of a relocation with static data remove it when
building modules on arm64. The kernel is unaffected as it doesn't rely on
modifying these relocations to find the data.

PR: 225684
Reported by: Johannes Lundberg <johalun0@gmail.com>
Reported by: Jose Luis Duran <jlduran@gmail.com>
Reported by: Greg V <greg@unrelenting.technology>
Reviewed by: bz
Sponsored by: ABT Systems Ltd
Differential Revision: https://reviews.freebsd.org/D16145

5 years agoCreate an empty stdint.h for arm_neon.h to include.
andrew [Mon, 16 Jul 2018 15:39:33 +0000 (15:39 +0000)]
Create an empty stdint.h for arm_neon.h to include.

The armv8crypto module includes arm_neon.h for the compiler intrinsic
functions. This includes the userland stdint.h file that doesn't exist in
the kernel. Fix this by providing an empty stdint.h to be used when we
include arm_neon.h.

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D16254

5 years agoAdd pointer to freebsd-numerics for libm.
imp [Mon, 16 Jul 2018 15:29:32 +0000 (15:29 +0000)]
Add pointer to freebsd-numerics for libm.

5 years agoallwinner: a83t: Fix PLL_CPU clocks
manu [Mon, 16 Jul 2018 13:38:16 +0000 (13:38 +0000)]
allwinner: a83t: Fix PLL_CPU clocks

The PLL_CPU clocks formula is 24Mhz * N and not 24Mhz / N
Fix it by using a NKMP clock with fixed factor values for the one
unused.

5 years agoUnconditionally build libnv in legacy
kevans [Mon, 16 Jul 2018 13:14:53 +0000 (13:14 +0000)]
Unconditionally build libnv in legacy

Rather than using a config(8) built from new tree linking libnv built on
host.

5 years agoFix buildworld on FreeBSD 10
arichardson [Mon, 16 Jul 2018 11:03:05 +0000 (11:03 +0000)]
Fix buildworld on FreeBSD 10

Since r336126 we depend on explicit_bzero() for the libmd
bootstrap. Add it to -legacy if it is not found in /usr/include/strings.h.

Reviewed By: ian
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16245

5 years agoNo longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile
arichardson [Mon, 16 Jul 2018 10:57:26 +0000 (10:57 +0000)]
No longer install sys/nv.h and sys/cnv.h in lib/libnv/Makefile

Use tools/build/Makefile to install the headers into ${WORLDTMP}/legacy
instead. Compared to r336026 this has the minor advantage that it avoids
unncessary header installation when building the non-bootstrap libnv.

Reviewed By: bdrewery, kevans
Approved By: brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D16187

5 years agoindent(1): rewrite the integer/floating constant scanning part of lexi.c
pstef [Mon, 16 Jul 2018 05:46:50 +0000 (05:46 +0000)]
indent(1): rewrite the integer/floating constant scanning part of lexi.c

Remove procedural code that did the scanning, which was faulty and didn't
support complex constants such as 0x1p-61. Replace it with a finite state
machine expressed as a transition table. The table was rewritten by hand
from lx's output, given parts of grammar expressed as regular expressions.

lx is Katherine Flavel's lexer generator, currently available at
https://github.com/katef/libfsm and the parts of grammar were taken from
http://quut.com/c/ANSI-C-grammar-l-2011.html and extended to support binary
integer constants which are a popular GCC extension.

Reported by: bde

5 years agoRemove MODULE_PNP_INFO for ig4(4) driver
gonzo [Mon, 16 Jul 2018 01:34:45 +0000 (01:34 +0000)]
Remove MODULE_PNP_INFO for ig4(4) driver

ig4(4) does not support suspend/resume but present on the hardware where
such functionality is critical, like laptops. Remove PNP info to avoid
breaking suspend/resume on the systems where ig4(4) load is not explicitly
requested by the user.

PR:             229791
Reported by:    Ali Abdallah

5 years agoRemove two checks that are always false
gonzo [Mon, 16 Jul 2018 01:07:28 +0000 (01:07 +0000)]
Remove two checks that are always false

Outer loop condition contradicts inner check so code under inner condition
is not reachable. Remove it.

PR: 229722
Reported by: David Binderman

5 years agoRestore the check for the page size extension after r332489.
markj [Sun, 15 Jul 2018 22:18:31 +0000 (22:18 +0000)]
Restore the check for the page size extension after r332489.

Without this, the support for transparent superpage promotion on i386
was left disabled.

Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D16279

5 years agosh: Don't treat % specially in CDPATH
jilles [Sun, 15 Jul 2018 21:55:17 +0000 (21:55 +0000)]
sh: Don't treat % specially in CDPATH

5 years agoauditon(2): fix A_SETPOLICY with 64-bit values
asomers [Sun, 15 Jul 2018 21:10:19 +0000 (21:10 +0000)]
auditon(2): fix A_SETPOLICY with 64-bit values

A_SETPOLICY is supposed to work with either 64 or 32-bit values, but due to a
typo the 64-bit version has never worked correctly.

Submitted by: aniketp
Reviewed by: asomers, cem
MFC after: 2 weeks
Sponsored by: Google, Inc. (GSoC 2018)
Differential Revision: https://reviews.freebsd.org/D16222

5 years agoindent(1): move case_indent from parser state to the options struct
pstef [Sun, 15 Jul 2018 21:04:21 +0000 (21:04 +0000)]
indent(1): move case_indent from parser state to the options struct

This was missed in r334927.

5 years agoAdjust comment to reality since r286171.
tuexen [Sun, 15 Jul 2018 20:42:47 +0000 (20:42 +0000)]
Adjust comment to reality since r286171.

Sponsored by: Netflix, Inc.

5 years agoDon't require a local sshd for the local TCP state dtrace test
tuexen [Sun, 15 Jul 2018 20:41:16 +0000 (20:41 +0000)]
Don't require a local sshd for the local TCP state dtrace test

This change is similar to the one done in r286171 for
tst.ipv4localtcp.ksh. This not only reduces the requirements on the
system used for testing but results also in a graceful teardown of
the TCP connection.

Reviewed by: gnn@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16276

5 years agoFix the UDP tests for dtrace.
tuexen [Sun, 15 Jul 2018 20:34:22 +0000 (20:34 +0000)]
Fix the UDP tests for dtrace.

The code imported from opensolaris was depending on ping supporting
UDP for sending probes. Since this is not supported by ping on FreeBSD
use a perl script instead.
The remote test requires the usage of ksh93, so state that in the
sheband.
Enable the local test, but keep the remote test disabled, since it
requires a remote machine on the LAN.

Reviewed by: markj@, gnn@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16268

5 years agoTest PGA_REFERENCED after calling pmap_ts_referenced(), rather than before,
alc [Sun, 15 Jul 2018 19:25:15 +0000 (19:25 +0000)]
Test PGA_REFERENCED after calling pmap_ts_referenced(), rather than before,
so that a reference from a concurrently destroyed mapping is observed
during the current scan.

Reviewed by: kib, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D16277

5 years agoAssorted TSO fixes for em(4)/iflib(9) and dead code removal:
marius [Sun, 15 Jul 2018 19:04:23 +0000 (19:04 +0000)]
Assorted TSO fixes for em(4)/iflib(9) and dead code removal:
- Ever since the workaround for the silicon bug of TSO4 causing MAC hangs
  was committed in r295133, CSUM_TSO always got disabled unconditionally
  by em(4) on the first invocation of em_init_locked(). However, even with
  that problem fixed, it turned out that for at least e. g. 82579 not all
  necessary TSO workarounds are in place, still causing MAC hangs even at
  Gigabit speed. Thus, for stable/11, TSO usage was deliberately disabled
  in r323292 (r323293 for stable/10) for the EM-class by default, allowing
  users to turn it on if it happens to work with their particular EM MAC
  in a Gigabit-only environment.
  In head, the TSO workaround for speeds other than Gigabit was lost with
  the conversion to iflib(9) in r311849 (possibly along with another one
  or two TSO workarounds). Yet at the same time, for EM-class MACs TSO4
  got enabled by default again, causing device hangs. Therefore, change the
  default for this hardware class back to have TSO4 off, allowing users
  to turn it on manually if it happens to work in their environment as
  we do in stable/{10,11}. An alternative would be to add a whitelist of
  EM-class devices where TSO4 actually is reliable with the workarounds in
  place, but given that the advantage of TSO at Gigabit speed is rather
  limited - especially with the overhead of these workarounds -, that's
  really not worth it. [1]
  This change includes the addition of an isc_capabilities to struct
  if_softc_ctx so iflib(9) can also handle interface capabilities that
  shouldn't be enabled by default which is used to handle the default-off
  capabilities of e1000 as suggested by shurd@ and moving their handling
  from em_setup_interface() to em_if_attach_pre() accordingly.
- Although 82543 support TSO4 in theory, the former lem(4) didn't have
  support for TSO4, presumably because TSO4 is even more broken in the
  LEM-class of MACs than the later EM ones. Still, TSO4 for LEM-class
  devices was enabled as part of the conversion to iflib(9) in r311849,
  causing device hangs. So revert back to the pre-r311849 behavior of
  not supporting TSO4 for LEM-class at all, which includes not creating
  a TSO DMA tag in iflib(9) for devices not having IFCAP_TSO4 set. [2]
- In fact, the FreeBSD TCP stack can handle a TSO size of IP_MAXPACKET
  (65535) rather than FREEBSD_TSO_SIZE_MAX (65518). However, the TSO
  DMA must have a maxsize of the maximum TSO size plus the size of a
  VLAN header for software VLAN tagging. The iflib(9) converted em(4),
  thus, first correctly sets scctx->isc_tx_tso_size_max to EM_TSO_SIZE
  in em_if_attach_pre(), but later on overrides it with IP_MAXPACKET
  in em_setup_interface() (apparently, left-over from pre-iflib(9)
  times). So remove the later and correct iflib(9) to correctly cap
  the maximum TSO size reported to the stack at IP_MAXPACKET. While at
  it, let iflib(9) use if_sethwtsomax*().
  This change includes the addition of isc_tso_max{seg,}size DMA engine
  constraints for the TSO DMA tag to struct if_shared_ctx and letting
  iflib_txsd_alloc() automatically adjust the maxsize of that tag in case
  IFCAP_VLAN_MTU is supported as requested by shurd@.
- Move the if_setifheaderlen(9) call for adjusting the maximum Ethernet
  header length from {ixgbe,ixl,ixlv,ixv,em}_setup_interface() to iflib(9)
  so adjustment is automatically done in case IFCAP_VLAN_MTU is supported.
  As a consequence, this adjustment now is also done in case of bnxt(4)
  which missed it previously.
- Move the reduction of the maximum TSO segment count reported to the
  stack by the number of m_pullup(9) calls (which in the worst case,
  can add another mbuf and, thus, the requirement for another DMA
  segment each) in the transmit path for performance reasons from
  em_setup_interface() to iflib_txsd_alloc() as these pull-ups are now
  done in iflib_parse_header() rather than in the no longer existing
  em_xmit(). Moreover, this optimization applies to all drivers using
  iflib(9) and not just em(4); all in-tree iflib(9) consumers still
  have enough room to handle full size TSO packets. Also, reduce the
  adjustment to the maximum number of m_pullup(9)'s now performed in
  iflib_parse_header().
- Prior to the conversion of em(4)/igb(4)/lem(4) and ixl(4) to iflib(9)
  in r311849 and r335338 respectively, these drivers didn't enable
  IFCAP_VLAN_HWFILTER by default due to VLAN events not being passed
  through by lagg(4). With iflib(9), IFCAP_VLAN_HWFILTER was turned on
  by default but also lagg(4) was fixed in that regard in r203548. So
  just remove the now redundant and defunct IFCAP_VLAN_HWFILTER handling
  in {em,ixl,ixlv}_setup_interface().
- Nuke other redundant IFCAP_* setting in {em,ixl,ixlv}_setup_interface()
  which is (more completely) already done in {em,ixl,ixlv}_if_attach_pre()
  now.
- Remove some redundant/dead setting of scctx->isc_tx_csum_flags in
  em_if_attach_pre().
- Remove some IFCAP_* duplicated either directly or indirectly (e. g.
  via IFCAP_HWCSUM) in {EM,IGB,IXL}_CAPS.
- Don't bother to fiddle with IFCAP_HWSTATS in ixgbe(4)/ixgbev(4) as
  iflib(9) adds that capability unconditionally.
- Remove some unused macros from em(4).
- Bump __FreeBSD_version as some of the above changes require the modules
  of drivers using iflib(9) to be recompiled.

Okayed by: sbruno@ at 201806 DevSummit Transport Working Group [1]
Reviewed by: sbruno (earlier version), erj
PR: 219428 (part of; comment #10) [1], 220997 (part of; comment #3) [2]
Differential Revision: https://reviews.freebsd.org/D15720

5 years agoShut down the TCP connection to a DS in the pNFS client when Renew fails.
rmacklem [Sun, 15 Jul 2018 18:54:44 +0000 (18:54 +0000)]
Shut down the TCP connection to a DS in the pNFS client when Renew fails.

When a NFSv4.1 client mount using pNFS detects a failure trying to do a
Renew (actually just a Sequence operation), the code would simply try
again and again and again every 30sec.
This would tie up the "nfscl" thread, which should also be doing other
things like Renews on other DSs and the MDS.
This patch adds code which closes down the TCP connection and marks it
defunct when Renew detects an failure to communicate with the DS, so
further Renews will not be attempted until a new working TCP connection to
the DS is established.
It also makes the call to nfscl_cancelreqs() unconditional, since
nfscl_cancelreqs() checks the NFSCLDS_SAMECONN flag and does so while holding
the lock.
This fix only applies to the NFSv4.1 client whne using pNFS and without it
the only effect would have been an "nfscl" thread busy doing Renew attempts
on an unresponsive DS.

MFC after: 2 weeks

5 years agoRemove code to disable IFCAP_VLAN_HWFILTER by default for ixgbe(4) as VLAN
marius [Sun, 15 Jul 2018 18:03:56 +0000 (18:03 +0000)]
Remove code to disable IFCAP_VLAN_HWFILTER by default for ixgbe(4) as VLAN
events are passed through by lagg(4) ever since r203548. Deactivation of
this capability by default due to lagg(4) was already not done for ixgbev(4)
and has been - although inadvertently - broken when em(4)/igb(4)/lem(4) and
ixl(4) were converted to iflib(9) in r311849 and r335338 respectively.

Reviewed by: erj
Differential Revision: https://reviews.freebsd.org/D15720 (part of)