]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
5 years agoMFC r343495:
avos [Fri, 1 Feb 2019 02:43:13 +0000 (02:43 +0000)]
MFC r343495:
wlan.4: improve wording

PR: 218075
Submitted by: Aaron Taylor <halfnote1004@gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/10@343639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343473:
avos [Thu, 31 Jan 2019 11:36:28 +0000 (11:36 +0000)]
MFC r343473:
geom_uzip(4): move NULL pointer KASSERT check before it is dereferenced

PR: 203499
Submitted by: <chadf@triularity.org>

MFC r343475:
geom_uzip(4): set 'gp != NULL' assertion on top of the function

There was yet another access to this variable in g_trace() few
lines upper.

PR: 203499
Reported by: cem

git-svn-id: svn://svn.freebsd.org/base/stable/10@343605 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343486:
cy [Wed, 30 Jan 2019 02:39:08 +0000 (02:39 +0000)]
MFC r343486:

Fix a typo.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343568 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343341:
avos [Mon, 28 Jan 2019 00:51:26 +0000 (00:51 +0000)]
MFC r343341:
ifconfig: drop unused macros from ifieee80211.c

git-svn-id: svn://svn.freebsd.org/base/stable/10@343506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r342634 (partial)
marius [Sun, 27 Jan 2019 19:05:18 +0000 (19:05 +0000)]
MFC: r342634 (partial)

o Don't allocate resources for SDMA in sdhci(4) if the controller or the
  front-end doesn't support SDMA or the latter implements a platform-
  specific transfer method instead. While at it, factor out allocation
  and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to
  keep the code more readable when adding support for ADMA variants.

o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum
  of 512 KiB instead of using a fixed 4-KiB-buffer. With the default
  MAXPHYS of 128 KiB and depending on the controller and medium, this
  reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on
  sequential reads while an increase of throughput of up to ~84 % was
  seen.

  Front-ends for broken controllers that only support an SDMA buffer
  boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY
  and supply a size via struct sdhci_slot. According to Linux, only -
  unsupported in stable/10 anyway - Qualcomm MSM-type SDHCI controllers
  are affected by this, though.

  Requested by: Shreyank Amartya (unconditional bump to 512 KiB)

o Introduce a SDHCI_DEPEND macro for specifying the dependency of the
  front-end modules on the sdhci(4) one and bump the module version
  of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order
  to ensure that all components are in sync WRT struct sdhci_slot.

o In sdhci(4):
  - Make pointers const were applicable, and
  - replace a few device_printf(9) calls with slot_printf() for
    consistency.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343190:
avos [Sat, 26 Jan 2019 12:41:16 +0000 (12:41 +0000)]
MFC r343190:
net80211: drop m_pullup call from ieee80211_crypto_decap.

For most wireless drivers Rx mbuf is allocated as one
contiguous chunk; only few are using chains for allocations -
but even then at least MCLBYTES (minus Rx descriptor size) is
available in the first mbuf.

In addition to the above, m_pullup was never called here - otherwise,
reallocation will break post-crypto_decap logic (ieee80211_decap,
ieee80211_deliver_data...), so just remove it; length check is left
in case if some truncated frame appears here.

PR: 234241

git-svn-id: svn://svn.freebsd.org/base/stable/10@343465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343103:
cy [Wed, 23 Jan 2019 02:43:49 +0000 (02:43 +0000)]
MFC r343103:

Remove redundant ipfilter version of pcap-bpf.h. As of r214535 it was
no longer needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343337 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343073:
cy [Wed, 23 Jan 2019 02:40:29 +0000 (02:40 +0000)]
MFC r343073:

Remove an IRIX-only source file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343336 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: 325765 (imp) Add notes about overlapping copies.
rgrimes [Tue, 22 Jan 2019 21:52:07 +0000 (21:52 +0000)]
MFC: 325765 (imp) Add notes about overlapping copies.

Add notes to each of these that specifically state that results are
undefined if the strings overlap. In the case of memcpy, we document
the overlapping behavior on FreeBSD (pre-existing). For str*, it is
left unspecified, however, since the default (and x86) implementations
do not handle overlapping strings properly.

PR: 223653
Approved by: phk (mentor)

git-svn-id: svn://svn.freebsd.org/base/stable/10@343326 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343023:
pfg [Mon, 21 Jan 2019 14:55:10 +0000 (14:55 +0000)]
MFC r343023:
msun: reduce diff between src/e_j0.c and src/e_j0f.c

PR: 229501

git-svn-id: svn://svn.freebsd.org/base/stable/10@343258 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342791: fix a typo in chio(4) (which propagates into chio(1))
joerg [Sun, 20 Jan 2019 21:49:13 +0000 (21:49 +0000)]
MFC r342791: fix a typo in chio(4) (which propagates into chio(1))

git-svn-id: svn://svn.freebsd.org/base/stable/10@343227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342884:
hselasky [Fri, 18 Jan 2019 08:59:00 +0000 (08:59 +0000)]
MFC r342884:
Fix loopback traffic when using non-lo0 link local IPv6 addresses.

The loopback interface can only receive packets with a single scope ID,
namely the scope ID of the loopback interface itself. To mitigate this
packets which use the scope ID are appearing as received by the real
network interface, see "origifp" in the patch. The current code would
drop packets which are designated for loopback which use a link-local
scope ID in the destination address or source address, because they
won't match the lo0's scope ID. To fix this restore the network
interface pointer from the scope ID in the destination address for
the problematic cases. See comments added in patch for a more detailed
description.

This issue was introduced with route caching by karels@ .

Reviewed by: bz (network)
Differential Revision: https://reviews.freebsd.org/D18769
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343139 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342778:
hselasky [Fri, 18 Jan 2019 08:49:10 +0000 (08:49 +0000)]
MFC r342778:
Reduce timeout for reading the USB HUB port status to 1000ms and try to filter
out dead USB HUB devices by implementing an error counter, so that the USB
enumeration thread does not spend all its time reading from non-responding
devices, blocking user-space access in the end.

Tested by: Matthias Apitz <guru@unixarea.de>
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342730:
hselasky [Fri, 18 Jan 2019 08:45:56 +0000 (08:45 +0000)]
MFC r342730:
Improve USB generic debug messages. Print process ID and name when opening
and closing usb/ugenX.Y character device nodes.

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@343133 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r343043: scp: disallow empty or current directory
emaste [Wed, 16 Jan 2019 15:19:09 +0000 (15:19 +0000)]
MFC r343043: scp: disallow empty or current directory

Obtained from: OpenBSD scp.c 1.198
Security: CVE-2018-20685
Sponsored by: The FreeBSD Foundation

git-svn-id: svn://svn.freebsd.org/base/stable/10@343098 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342966:
avos [Tue, 15 Jan 2019 02:26:03 +0000 (02:26 +0000)]
MFC r342966:
net80211: fix possible panic for some drivers after r342465

Check if rate control structures were allocated before trying to
access them in various places; this was possible before on
allocation failure (unlikely), but was revealed after r342211
where allocation was deferred.

The patch was adjusted a bit since file contents are different enough
since r306591.

Also, 'rate_stats' sysctl is not available here, so the panic is
unlikely to happen here even without this patch.

git-svn-id: svn://svn.freebsd.org/base/stable/10@343036 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342810:
avos [Sun, 13 Jan 2019 02:27:10 +0000 (02:27 +0000)]
MFC r342810:
powerd(8): allow to force a method of battery state query

This change allows to determine power source via sysctl or /dev/apm
when devd(8) is running (used by default).

Based on patch from PR; other changes on top of it:
- '-f' (force) -> '-s' (source) parameter renaming;
- allow 'apm' -> 'devd' transition when '-s devd' is set
(if APM is enabled);
- man page update.

PR: 125707
Submitted by: Konstantin Stepanov <milezv@yandex.ru>
Reviewed by: bcr, imp
Differential Revision: https://reviews.freebsd.org/D18742

git-svn-id: svn://svn.freebsd.org/base/stable/10@342983 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342605:
cy [Sun, 6 Jan 2019 00:32:14 +0000 (00:32 +0000)]
MFC r342605:

TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD
TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header
isn't included explicitly or implicitly at this point therefore
as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove
the #ifdef and include netinet/tcp.h unconditionally.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342794 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC: r336610 (partial), r339207, r339267
marius [Sat, 5 Jan 2019 19:35:10 +0000 (19:35 +0000)]
MFC: r336610 (partial), r339207, r339267

- Or in the DMA coalescing Rx threshold so the other bits set in E1000_DMACR
  remain intact as intended in igb_init_dmac(). [1]

- Fix igb corrupting checksums with BPF and VLAN
  In stable/11, this merely syncs the code with head as the problem was
  introduced with r311849 in the latter and then fixed by r339207 with
  a different approach than the code used pre-r311849 and in stable/11.

- Use mbuf defines to construct csum offload masks rather than literals

MF11: r340148

Don't use 9k jumbo clusters

Reported by: Coverity
CID: 1304929 [1]

git-svn-id: svn://svn.freebsd.org/base/stable/10@342790 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342549:
hselasky [Thu, 3 Jan 2019 09:28:18 +0000 (09:28 +0000)]
MFC r342549:
Add USB quirk for SPL Crimson Rev 1.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342456:
hselasky [Thu, 3 Jan 2019 09:25:39 +0000 (09:25 +0000)]
MFC r342456:
Fix reading of USB sample rate descriptor for SPL Crimson Rev 1.

Read first one entry, then try to read the full rate descriptor table.

PR: 234380
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/10@342724 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 341800: Don't report stale signal information in ptrace_lwpinfo.
jhb [Wed, 2 Jan 2019 19:11:49 +0000 (19:11 +0000)]
MFC 341800: Don't report stale signal information in ptrace_lwpinfo.

Once a signal's siginfo was copied to 'td_si' as part of the signal
exchange in issignal(), it was never cleared.  This caused future
thread events that are reported as SIGTRAP events without signal
information to report the stale siginfo in 'td_si'.  For example, if a
debugger created a new process and used SIGSTOP to stop it after
PT_ATTACH, future system call entry / exit events would set PL_FLAG_SI
with the SIGSTOP siginfo in pl_siginfo.  This broke 'catch syscall' in
current versions of gdb as it assumed PL_FLAG_SI with SIGTRAP
indicates a breakpoint or single step trap.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342704 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342596:
cy [Wed, 2 Jan 2019 15:13:08 +0000 (15:13 +0000)]
MFC r342596:

Remove duplicate include of sys/mbuf.h.

Reported by: Trond Endrest <Trond.Endrestol@ximalas.info>

git-svn-id: svn://svn.freebsd.org/base/stable/10@342685 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342613: Import tzdata 2018h
philip [Tue, 1 Jan 2019 10:05:36 +0000 (10:05 +0000)]
MFC r342613: Import tzdata 2018h
MFC r342644: Import tzdata 2018i

git-svn-id: svn://svn.freebsd.org/base/stable/10@342669 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342385:
cy [Mon, 31 Dec 2018 03:53:33 +0000 (03:53 +0000)]
MFC r342385:

Remove an empty #if block.

The interesting thing is that looking through Darren's commit logs,
the line containing an extern ppsratecheck() definition was removed
from the v5-1-RELEASE branch but not from HEAD (I have taken his
CVS tree and converted it to GIT). There is a commit adding an
additional #if defined to the empty block. I can only assume that
this was intentional for something later. Looking through HEAD the
extern ppsratecheck() is there. However if we put it back it would
conflict with a static ppsratecheck() definition in fil.c when
building ipftest.

Therefore we remove this empty block.

ppsratecheck() is a function in the FreeBSD kernel. However ipftest
cannot call the ppsratecheck() in the kernel. Therefore one exists in
fil.c for use when building the userland ipftest utility which
approximates the packet filter in userland for testing of ipfilter
rules against packets captured with tcpdump.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342641 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342547:
cy [Sun, 30 Dec 2018 04:42:01 +0000 (04:42 +0000)]
MFC r342547:

Remove another empty #ifdef block. This empty block also exists in
the upstream HEAD.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342608 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342377:
cy [Sun, 30 Dec 2018 04:37:49 +0000 (04:37 +0000)]
MFC r342377:

Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9)
framework is available. pfil(9) has been in FreeBSD since FreeBSD 5
and according to svn log was first committed to HEAD in 2000, therefore
it is safe to say the check is no longer needed in FreeBSD.

pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF).
Therefore it is safe to say that it is supported by every NetBSD system
today. The framework also exists in illumos.

As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and
at some point in the future illumos too, and as all three platforms have
pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341279:
cy [Sun, 30 Dec 2018 04:31:51 +0000 (04:31 +0000)]
MFC r341279:

Clean up a redundant non-redefinition of IFNAMSIZ. IFNAMSIZ
is defined in net/if.h, therefore the condition is never met and
confusing to those who follow.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342374:
cy [Sat, 29 Dec 2018 03:18:16 +0000 (03:18 +0000)]
MFC r342374:

Remove the last vestiges of HP/UX from a FreeBSD-only ipfilter
source file.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342588 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.
jhb [Sat, 29 Dec 2018 01:19:14 +0000 (01:19 +0000)]
MFC 340441: Revert r332735 and fix MSI-X to properly fail allocations when full.

The off-by-one errors in 332735 weren't actual errors and were
preventing the last MSI interrupt source from being used.  Instead,
the issue is that when all MSI interrupt sources were allocated, the
loop in msix_alloc() would terminate with 'msi' still set to non-null.
The only check for 'i' overflowing was in the 'msi' == NULL case, so
msix_alloc() would try to reuse the last MSI interrupt source instead
of failing.

Fix by moving the check for all sources being in use to just after the
loop.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
eugen [Sat, 29 Dec 2018 00:44:11 +0000 (00:44 +0000)]
MFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
needs to be used to force local hash computation and disable usage
of RSS hash provided by driver.

PR: 234242

git-svn-id: svn://svn.freebsd.org/base/stable/10@342586 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.
jhb [Sat, 29 Dec 2018 00:30:17 +0000 (00:30 +0000)]
MFC 340304: Use tcp_state_change() in the cxgbe(4) TOE module.

r254889 added tcp_state_change() as a centralized place to log state
changes in TCP connections for DTrace.  r294869 and r296881 took
advantage of this central location to manage per-state counters.
However, TOE sockets were still performing some (but not all) state
change updates via direct assignments to t_state.  This resulted in
state counters underflowing when TOE was in use.  Fix by using
tcp_state_change() when changing a TOE connection's state.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342583 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341785
arybchik [Wed, 26 Dec 2018 10:39:34 +0000 (10:39 +0000)]
MFC r341785

sfxge(4): use n Tx queues instead of n + 2 on EF10 HW

On EF10 HW we can avoid sending packets without checksum offload
or with IP-only checksum offload to dedicated queues. Instead, we
can use option descriptors to change offload policy on any queue
during runtime. Thus, we don't need to create two dedicated queues.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18390

git-svn-id: svn://svn.freebsd.org/base/stable/10@342529 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341784
arybchik [Wed, 26 Dec 2018 10:38:51 +0000 (10:38 +0000)]
MFC r341784

sfxge(4): prepare the number of Tx queues on event queue 0 to become
variable

The number of Tx queues on event queue 0 can depend on the NIC family
type, and this property will be leveraged by future patches.
This patch prepares the code for this change.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18389

git-svn-id: svn://svn.freebsd.org/base/stable/10@342527 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341783
arybchik [Wed, 26 Dec 2018 10:37:06 +0000 (10:37 +0000)]
MFC r341783

sfxge(4): report support for Tx checksum op descriptors

FreeBSD driver needs a patch to provide a means for packets
which do not need checksum offload but have flow ID set
to avoid hitting only the first Tx queue (which has been used
for packets not needing checksum offload).

This should be possible on Huntington, Medford or Medford2 chips
since these support toggling checksum offload on any given queue
dynamically by means of pushing option descriptors.

The patch for FreeBSD driver will then need a means to figure out
whether the feature can be used, and testing adapter family might
not be a good solution.

This patch adds a feature bit specifically to indicate support
for checksum option descriptors. The new feature bits may have
more users in future, apart from the mentioned FreeBSD patch.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18388

git-svn-id: svn://svn.freebsd.org/base/stable/10@342524 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341782
arybchik [Wed, 26 Dec 2018 10:35:41 +0000 (10:35 +0000)]
MFC r341782

sfxge(4): populate per-event queue stats in sysctl

In order to find out why the first event queue and corresponding
interrupt is triggered more frequent, it is useful to know which
events go to each event queue.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18418

git-svn-id: svn://svn.freebsd.org/base/stable/10@342523 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341327
arybchik [Wed, 26 Dec 2018 10:28:43 +0000 (10:28 +0000)]
MFC r341327

sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped

Early processing of a packet on transmit may change last seen
VLAN TCI in the queue context. If such a packet is eventually
dropped, last seen VLAN TCI must be set to its previous value.

Submitted by:   Ivan Malov <Ivan.Malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18288

git-svn-id: svn://svn.freebsd.org/base/stable/10@342522 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341326
arybchik [Wed, 26 Dec 2018 10:28:03 +0000 (10:28 +0000)]
MFC r341326

sfxge(4): ensure EvQ poll stops when abort is requested

If an event handler requested an abort, only the inner loop was
guarenteed to be broken out of - the outer loop could continue
if total == batch.

Fix this by poisoning batch to ensure it is different to total.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342521 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341311
arybchik [Wed, 26 Dec 2018 10:27:24 +0000 (10:27 +0000)]
MFC r341311

sfxge(4): make last byte of module information available

Adjust bounds so the interface supports reading
the last available byte of data.

Submitted by:   Richard Houldsworth <rhouldsworth at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18273

git-svn-id: svn://svn.freebsd.org/base/stable/10@342520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341309
arybchik [Wed, 26 Dec 2018 10:26:58 +0000 (10:26 +0000)]
MFC r341309

sfxge(4): fix MAC Tx stats for less or equal to 64 bytes

This statistic should include 64byte and smaller frames.
Fix EF10 calculation to match Siena code.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342519 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341302
arybchik [Wed, 26 Dec 2018 10:26:24 +0000 (10:26 +0000)]
MFC r341302

sfxge(4): fix a typo in unicast filter insertion comment

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18264

git-svn-id: svn://svn.freebsd.org/base/stable/10@342518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341301
arybchik [Wed, 26 Dec 2018 10:25:55 +0000 (10:25 +0000)]
MFC r341301

sfxge(4): prevent access to the NIC config before probe

NIC config is initialized during NIC probe.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342517 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341297
arybchik [Wed, 26 Dec 2018 10:25:01 +0000 (10:25 +0000)]
MFC r341297

sfxge(4): fix out of bounds read when dereferencing sdup

Introduce and use macro to make sure that MCDI buffers allocated
on stack are rounded up properly.

Submitted by:   Gautam Dawar <gdawar at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18259

git-svn-id: svn://svn.freebsd.org/base/stable/10@342516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341295
arybchik [Wed, 26 Dec 2018 10:23:16 +0000 (10:23 +0000)]
MFC r341295

sfxge(4): avoid usage of too big arrays on stack

Found by PreFAST static analysis.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18257

git-svn-id: svn://svn.freebsd.org/base/stable/10@342515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341290
arybchik [Wed, 26 Dec 2018 10:22:49 +0000 (10:22 +0000)]
MFC r341290

sfxge(4): check size of memory to read sensors data to

Size of provided memory should be consistent with specified size.

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18252

git-svn-id: svn://svn.freebsd.org/base/stable/10@342514 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341215
arybchik [Wed, 26 Dec 2018 10:22:18 +0000 (10:22 +0000)]
MFC r341215

sfxge(4): fix build because of no declaration

Functions declared in mcdi_mon.h are implemented in mcdi_mon.c.
The build fails if compiler options require declaration before
definition.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18246

git-svn-id: svn://svn.freebsd.org/base/stable/10@342513 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341214
arybchik [Wed, 26 Dec 2018 10:21:40 +0000 (10:21 +0000)]
MFC r341214

sfxge(4): fix SAL annotation for input buffers

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18245

git-svn-id: svn://svn.freebsd.org/base/stable/10@342512 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341213
arybchik [Wed, 26 Dec 2018 10:20:54 +0000 (10:20 +0000)]
MFC r341213

sfxge(4): fix PreFAST warnings because of unused return

Submitted by:   Martin Harvey <mharvey at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18244

git-svn-id: svn://svn.freebsd.org/base/stable/10@342511 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341197
arybchik [Wed, 26 Dec 2018 10:20:02 +0000 (10:20 +0000)]
MFC r341197

sfxge(4): fix comparison always true warning

Loopback type used as bit index has efx_loopback_type_t type
which is enum. clang complains that it is always true when it
is compared with qword (64 bit) bits number boundary.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18228

git-svn-id: svn://svn.freebsd.org/base/stable/10@342510 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341038
arybchik [Wed, 26 Dec 2018 10:19:12 +0000 (10:19 +0000)]
MFC r341038

sfxge(4): add method to make checksum option descriptors

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342509 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340896
arybchik [Wed, 26 Dec 2018 10:17:44 +0000 (10:17 +0000)]
MFC r340896

sfxge(4): remove Falcon-specific concurrency check

Falcon support has been withdrawn from libefx, however, there is still
an obsolete Falcon-specific assertion that efx_mac_stats_upload()
and efx_port_poll() aren't concurrent. To be consistent with an overall
Falcon support revocation it's desirable to remove it.

Fix debug build invalid assertion failure.

Submitted by:   Ivan Malov <ivan.malov at oktetlabs.ru>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D1813

git-svn-id: svn://svn.freebsd.org/base/stable/10@342508 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340895
arybchik [Wed, 26 Dec 2018 10:16:48 +0000 (10:16 +0000)]
MFC r340895

sfxge(4): move BIU test code into Siena-specific file

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342507 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340894
arybchik [Wed, 26 Dec 2018 10:16:11 +0000 (10:16 +0000)]
MFC r340894

sfxge(4): fix PreFAST static analysis warning (C6001)

Fix warning
"C6001: Using uninitialized memory '*sensor_maskp'"
which could occur when the npages argument to efx_mcdi_sensor_info()
is less than or equal to zero.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18128

git-svn-id: svn://svn.freebsd.org/base/stable/10@342506 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340892
arybchik [Wed, 26 Dec 2018 10:15:31 +0000 (10:15 +0000)]
MFC r340892

sfxge(4): remove obsolete check for pre-Siena hardware

The fail4 label was used twice, so it doesn't need removing.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342505 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340891
arybchik [Wed, 26 Dec 2018 10:14:29 +0000 (10:14 +0000)]
MFC r340891

sfxge(4): fix warnings from VS2015 C compiler (C4214)

Fix multiple level 4 warnings
"C4214: nonstandard extension used: bit field types other than int";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18125

git-svn-id: svn://svn.freebsd.org/base/stable/10@342504 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340890
arybchik [Wed, 26 Dec 2018 10:13:42 +0000 (10:13 +0000)]
MFC r340890

sfxge(4): fix warnings from VS2015 C compiler (C4057)

Fix two level 4 warnings
"C4057: 'function': 'const uint8_t *' differs in indirection to
slightly different base types from 'caddr_t'"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18124

git-svn-id: svn://svn.freebsd.org/base/stable/10@342503 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340889
arybchik [Wed, 26 Dec 2018 10:12:15 +0000 (10:12 +0000)]
MFC r340889

sfxge(4): fix warnings from VS2015 C compiler (C4189)

Fix multiple level 4 warnings
"C4189: 'xxx': local variable is initialized but not referenced";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18123

git-svn-id: svn://svn.freebsd.org/base/stable/10@342502 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340888
arybchik [Wed, 26 Dec 2018 10:09:53 +0000 (10:09 +0000)]
MFC r340888

sfxge(4): fix warnings from VS2015 C compiler (C4100)

Fix multiple level 4 warnings
"C4100: 'xxx': unreferenced formal parameter"
no functional changes.

The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual
Studio 2015 C compiler with the following:

  #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__));
  #define _NOTE(_annotation)   _NOTE_ ## _annotation

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18122

git-svn-id: svn://svn.freebsd.org/base/stable/10@342501 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340887
arybchik [Wed, 26 Dec 2018 10:08:28 +0000 (10:08 +0000)]
MFC r340887

sfxge(4): fix warnings from VS2015 C compiler (C4245)

Fix level 4 warning
"C4245: 'initializing': conversion from 'int' to 'uint32_t',
signed/unsigned mismatch" warning; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18121

git-svn-id: svn://svn.freebsd.org/base/stable/10@342500 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340886
arybchik [Wed, 26 Dec 2018 10:07:30 +0000 (10:07 +0000)]
MFC r340886

sfxge(4): fix warnings from VS2015 C compiler (C4244)

Fix level 4 warning
"C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible
loss
of data"; no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18120

git-svn-id: svn://svn.freebsd.org/base/stable/10@342499 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340885
arybchik [Wed, 26 Dec 2018 10:06:14 +0000 (10:06 +0000)]
MFC r340885

sfxge(4): fix warnings from VS2015 C compiler (C4310)

Fix level 4 warning
"C4310: cast truncates constant value";
no functional changes.

Submitted by:   Andrew Lee <alee at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18119

git-svn-id: svn://svn.freebsd.org/base/stable/10@342498 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340884
arybchik [Wed, 26 Dec 2018 10:05:36 +0000 (10:05 +0000)]
MFC r340884

sfxge(4): fix probes in licensing support

EFSYS_PROBE1 takes one typed value (in addition to the probe name),
whereas EFSYS_PROBE has just the probe name.

Which to use is determined by the probe name - "fail1" probes are
expected to include the function result.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342497 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340883
arybchik [Wed, 26 Dec 2018 10:05:03 +0000 (10:05 +0000)]
MFC r340883

sfxge(4): fix diagnostics support build without Siena

The compilation failed because __efx_sram_pattern_fns was used in
efx_nic.c, but defined in efx_sram.c which is only needed when
supporting Siena.

To fix it move all the code using __efx_sram_pattern_fns into
Siena-specific files (except for the definition in efx_sram.c itself,
as that file only needs to be included in Siena-supporting builds
anyway).

The functions to test registers and tables are unlikely to apply to any
new hardware and so can be moved into Siena files. Since Huntington
such tests have been implemented in firmware.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342496 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340875
arybchik [Wed, 26 Dec 2018 10:03:59 +0000 (10:03 +0000)]
MFC r340875

sfxge(4): fix build issue with PHY LED control enabled

Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and
Medford.

Submitted by:   Vijay Srivastava <vijays at solarflare.com>
Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18110

git-svn-id: svn://svn.freebsd.org/base/stable/10@342495 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340833
arybchik [Wed, 26 Dec 2018 10:03:11 +0000 (10:03 +0000)]
MFC r340833

sfxge(4): support inner checksum offload on transmit

Inner checksum offloads may be used only if firmware supports
these tunnels.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18102

git-svn-id: svn://svn.freebsd.org/base/stable/10@342494 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340831
arybchik [Wed, 26 Dec 2018 10:02:05 +0000 (10:02 +0000)]
MFC r340831

sfxge(4): make MAC naming consistent with other modules

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342493 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340826
arybchik [Wed, 26 Dec 2018 10:01:25 +0000 (10:01 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342492 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340822
arybchik [Wed, 26 Dec 2018 10:00:25 +0000 (10:00 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342491 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340814
arybchik [Wed, 26 Dec 2018 09:59:24 +0000 (09:59 +0000)]
MFC r340814

sfxge(4): fix result code in MCDI NVRAM update finish

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340806
arybchik [Wed, 26 Dec 2018 09:44:08 +0000 (09:44 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342489 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340805
arybchik [Wed, 26 Dec 2018 09:43:38 +0000 (09:43 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340804
arybchik [Wed, 26 Dec 2018 09:42:40 +0000 (09:42 +0000)]
MFC r340804

sfxge(4): insert filters for encapsulated packets

On Medford, with full-featured firmware running, encapsulated
packets may not be delivered unless filters are inserted for
them, as ordinary filters are not applied to encapsulated
packets. So filters for encapsulated packets need to be
inserted for each class of encapsulated packet. For simplicity,
catch-all filters are always inserted. These may match more
packets than the OS has asked for, but trying to insert more
precise filters increases complexity for little gain.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342487 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340803
arybchik [Wed, 26 Dec 2018 09:41:04 +0000 (09:41 +0000)]
MFC r340803

sfxge(4): support filters for encapsulated packets

This supports filters which match all unicast or multicast
inner frames in VXLAN, GENEVE, or NVGRE packets.
(Additional fields to match on can be added easily.)

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342486 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340802
arybchik [Wed, 26 Dec 2018 09:40:13 +0000 (09:40 +0000)]
MFC r340802

sfxge(4): use proper MCDI command for encap filters

MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated
packets.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342485 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340801
arybchik [Wed, 26 Dec 2018 09:38:50 +0000 (09:38 +0000)]
MFC r340801

sfxge(4): provide information about supported tunnels

VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with
full-feature firmware variant running.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D18071

git-svn-id: svn://svn.freebsd.org/base/stable/10@342484 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340800
arybchik [Wed, 26 Dec 2018 09:37:30 +0000 (09:37 +0000)]
MFC r340800

sfxge(4): let caller know that queue is already flushed

Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
MC reboot. Caller needs to know that the queue is already flushed to
avoid waiting for flush done event.

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342483 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340799
arybchik [Wed, 26 Dec 2018 09:36:42 +0000 (09:36 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342482 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340798
arybchik [Wed, 26 Dec 2018 09:34:26 +0000 (09:34 +0000)]
MFC r340798

sfxge(4): fix out of bounds read in VIs allocation

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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342481 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r340767
arybchik [Wed, 26 Dec 2018 09:33:26 +0000 (09:33 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@342480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312885
arybchik [Wed, 26 Dec 2018 09:32:30 +0000 (09:32 +0000)]
MFC r312885

sfxge(4): compact the first hot part of RxQ control

buf_base_id is used on RxQ control operations only and not used on
datapath.

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342479 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312884
arybchik [Wed, 26 Dec 2018 09:31:36 +0000 (09:31 +0000)]
MFC r312884

sfxge(4): fix RxQ structure layout vs usage on datapath

Recent changes in the pseudo header accessor prototypes start to
use common code RxQ handle on datapath. The handle was located
at the end of the structure with members not used on datapath.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D9359

git-svn-id: svn://svn.freebsd.org/base/stable/10@342478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312883
arybchik [Wed, 26 Dec 2018 09:30:53 +0000 (09:30 +0000)]
MFC r312883

sfxge(4): fix invalid VLAN tagging after stop/start

TxQ is destroyed on stop and last used tag should be reset to default 0
on the next start.

Sponsored by:   Solarflare Communications, Inc.
Differential Revision:  https://reviews.freebsd.org/D9358

git-svn-id: svn://svn.freebsd.org/base/stable/10@342477 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312868
arybchik [Wed, 26 Dec 2018 09:30:06 +0000 (09:30 +0000)]
MFC r312868

sfxge(4): cleanup: remove unused soft context struct member rxq_cache

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342476 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312867
arybchik [Wed, 26 Dec 2018 09:29:26 +0000 (09:29 +0000)]
MFC r312867

sfxge(4): cleanup: remvoe trailing tab

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342475 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r312866
arybchik [Wed, 26 Dec 2018 09:28:40 +0000 (09:28 +0000)]
MFC r312866

sfxge(4): cleanup: remove unused txq_index TxQ control structure member

Sponsored by:   Solarflare Communications, Inc.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342474 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342211:
avos [Tue, 25 Dec 2018 14:06:52 +0000 (14:06 +0000)]
MFC r342211:
net80211: fix out-of-bounds read in ieee80211_amrr(9)

git-svn-id: svn://svn.freebsd.org/base/stable/10@342465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r339746,339751,339794,340866,340939,342042:
mm [Fri, 21 Dec 2018 23:33:28 +0000 (23:33 +0000)]
MFC r339746,339751,339794,340866,340939,342042:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1013: Add missing h_base offset when performing absolute seeks in
            xar decompression
  PR #1023: Support extracting extattrs as non-root on non-user-writeable
            files
  PR #1061: Add support for extraction of RAR v5 archives
  PR #1066: Fix out of bounds read on empty string filename for gnutar, pax
            and v7tar
  PR #1067: Fix temporary file path buffer overflow in tests
  IS #1068: Correctly process and verify integer arguments passed to
            bsdcpio and bsdtar
  PR #1070: Don't default XAR entry atime/mtime to the current time
  PR #1080: Spelling fixes
  PR #1084: RAR5 reader bugfixes
  PR #1091: fix use-after-free in delayed newc link processing
  PR #1092: Fix a few obvious resource leaks and strcpy() misuses
  IS #1096: Support extracting ACLs with in-entry comments (GNU tar)
  PR #1102: RAR5 reader - fix big-endian problems
  PR #1105: Fix various crash, memory corruption and infinite loop conditions

  RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64),
               sparc64 and riscv64
  RAR5 reader: more maybe-uninitialized size_t fixes for riscv64
               FreeBSD build

git-svn-id: svn://svn.freebsd.org/base/stable/10@342361 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode
eugen [Mon, 17 Dec 2018 07:03:36 +0000 (07:03 +0000)]
MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode

PR: 102719

git-svn-id: svn://svn.freebsd.org/base/stable/10@342159 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r334648:
hselasky [Thu, 13 Dec 2018 10:34:26 +0000 (10:34 +0000)]
MFC r334648:
Add support for SIMCom SIM7600E.

PR: 226066
Sponsored by: MSI/FUNTORO

git-svn-id: svn://svn.freebsd.org/base/stable/10@342037 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341650:
cy [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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@342023 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341585:
hselasky [Wed, 12 Dec 2018 13:14:41 +0000 (13:14 +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

git-svn-id: svn://svn.freebsd.org/base/stable/10@341984 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoAs part of the general cleanup of the ipfilter code, special cases
cy [Tue, 11 Dec 2018 01:49:06 +0000 (01:49 +0000)]
As part of the general cleanup of the ipfilter code, special cases
are committed separately to document fixing them separately from
the general cleanup. In this case we don't want to hide the utter
brokenness of what is being fixed.

Clean up a discombobulated block of #if's, with one block unreachable.
ip_fil.c is used in ipftest which is used to dry-run test ipfilter
rules in userspace without loading them in the kernel. The call to
(*ifp->if_output) matches that in the FreeBSD kernel.

Further testing and work will be required to make ipftest fully
functional.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341804 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341377, r341388 (fixup):
cy [Sat, 8 Dec 2018 17:50:00 +0000 (17:50 +0000)]
MFC r341377, r341388 (fixup):

Restore handling of PMTU discovery, removed through an unifdef(1)
following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341740 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341384:
cy [Sat, 8 Dec 2018 17:28:52 +0000 (17:28 +0000)]
MFC r341384:

Remove IFF_DRVRLOCK as it is used in IRIX only (and we all know IRIX
is dead). This includes collaterally removing code shared by HP/UX,
SGI, and Linux, where IP Filter will in all likelihood for various
reasons never run again.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341739 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341280:
cy [Fri, 7 Dec 2018 21:42:41 +0000 (21:42 +0000)]
MFC r341280:

Clean up a rather useless conditional structure member definition.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check
avg [Thu, 6 Dec 2018 13:32:51 +0000 (13:32 +0000)]
MFC r336641: fix incorrect operator in the AUDITPIPE_SET_QLIMIT bounds check

PR: 229983

git-svn-id: svn://svn.freebsd.org/base/stable/10@341633 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341265:
cy [Thu, 6 Dec 2018 04:28:39 +0000 (04:28 +0000)]
MFC r341265:

Remove an old comment/code and replace with a comment that
directly references a NetBSD commit.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r341484: Always treat firmware request and response sizes as unsigned.
emaste [Wed, 5 Dec 2018 21:51:39 +0000 (21:51 +0000)]
MFC r341484: Always treat firmware request and response sizes as unsigned.

This fixes an incomplete bounds check on the guest-supplied request
size where a very large request size could be interpreted as a negative
value and not be caught by the bounds check.

Submitted by: jhb
Reported by: Reno Robert
Security: CVE-2018-17160

git-svn-id: svn://svn.freebsd.org/base/stable/10@341607 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r298454 (araujo): Use MIN()/MAX() macros from sys/param.h.
emaste [Wed, 5 Dec 2018 21:49:39 +0000 (21:49 +0000)]
MFC r298454 (araujo): Use MIN()/MAX() macros from sys/param.h.

git-svn-id: svn://svn.freebsd.org/base/stable/10@341606 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

5 years agoMFC r323010: hv_vss.4: Fix spelling of 'responsibility'
emaste [Tue, 4 Dec 2018 14:07:45 +0000 (14:07 +0000)]
MFC r323010: hv_vss.4: Fix spelling of 'responsibility'

PR: 221300
Submitted by: Fabian Keil
Obtained from: ElectroBSD

git-svn-id: svn://svn.freebsd.org/base/stable/10@341465 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f