]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoRevert r342807, mistakenly including libbe(3)/bectl(8) MFC
kevans [Sun, 6 Jan 2019 02:15:09 +0000 (02:15 +0000)]
Revert r342807, mistakenly including libbe(3)/bectl(8) MFC

5 years agoMFC r342362-r342363: config(8) duplicate option handling
kevans [Sun, 6 Jan 2019 02:13:16 +0000 (02:13 +0000)]
MFC r342362-r342363: config(8) duplicate option handling

r342362:
config(8): Allow duplicate options to be specified

config(8)'s option handling has been written to allow duplicate options; if
the value changes, then the latest value is used and an informative message
is printed to stderr like so:

/usr/src/sys/amd64/conf/TEST: option "VERBOSE_SYSINIT" redefined from 0 to 1

Currently, this is only a possibility for cpu types, MAXUSERS, and
MACHINE_ARCH. Anything else duplicated in a config file will use the first
value set and error about duplicated options on subsequent appearances,
which is arguably unfriendly since one could specify:

include GENERIC
nooptions VERBOSE_SYSINIT
options VERBOSE_SYSINIT

to redefine the value later anyways.

Reported by: mmacy

r342363:
config(8): Remove all instances of an option when opting out

Quick follow-up to r342362: options can appear multiple times now, so
clean up all of them as needed. For non-OPTIONS options, this has no effect
since they're already de-duplicated.

5 years agoMFC r342628, r342670 (by cem):
kib [Sun, 6 Jan 2019 00:59:55 +0000 (00:59 +0000)]
MFC r342628, r342670 (by cem):
Fix linux_destroy_dev() behaviour when there are still files open from
the destroying cdev.

Also bump __FreeBSD_version since struct linux_cdev size on i386 increased
(this is unmergeable r342629 on HEAD).

5 years agoMFC r342627:
kib [Sun, 6 Jan 2019 00:55:23 +0000 (00:55 +0000)]
MFC r342627:
Implement zap_vma_ptes() for managed device objects.

5 years agoMFC r342625, r342631:
kib [Sun, 6 Jan 2019 00:54:08 +0000 (00:54 +0000)]
MFC r342625, r342631:
Use IDX_TO_OFF().

5 years agoMFC r342630:
kib [Sun, 6 Jan 2019 00:38:28 +0000 (00:38 +0000)]
MFC r342630:
Add 'v' modifier to the ddb 'show pginfo' command to display vm_page
backing the provided kernel virtual address.

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.

5 years agoMFC: r336610 (partial), r339207, r339267
marius [Sat, 5 Jan 2019 19:32:48 +0000 (19:32 +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

Reported by: Coverity
CID: 1304929 [1]

5 years agoMFC r342595:
kib [Sat, 5 Jan 2019 00:42:30 +0000 (00:42 +0000)]
MFC r342595:
For hw.{physmem,realmem,usermem} MIBs, clamp instead of truncating.

5 years agoMFC r342218:
dab [Fri, 4 Jan 2019 02:50:18 +0000 (02:50 +0000)]
MFC r342218:

asmc: Add support for MacPro1,1

PR: 203431
Submitted by: jjr@alisa.org & holindho@saunalahti.fi
Reported by: jjr@alisa.org

5 years agoMFC r342171:
dab [Fri, 4 Jan 2019 02:20:34 +0000 (02:20 +0000)]
MFC r342171:

asmc: Add support for mid-2011 Macmini 5,2

PR: 225911
Submitted by: trev <fbsdbugs4@sentry.org>
Reported by: trev <fbsdbugs4@sentry.org>

5 years agoMFC 340022: Add support for port unit wiring to cxgbe(4).
jhb [Fri, 4 Jan 2019 01:19:23 +0000 (01:19 +0000)]
MFC 340022: Add support for port unit wiring to cxgbe(4).

- Add a bus_child_location_str method to the nexus drivers that prints
  out 'port=N' as the location string exported via devinfo and the
  '%location' sysctl node.

- We can't use a bus_hint_device_unit to wire the unit numbers of
  devices with a fixed devclass as the device gets assigned a unit in
  make_device() before the device creator can set softc, etc.
  Instead, when adding a child device, use a helper function much like
  a bus_hint_device_unit method to look for wiring hints or to return
  -1 to let the system choose a unit number.  This function requires
  an "at" hint for the port pointing to the nexus device and a "port"
  hint listing the port number.  For example:

hint.cxl.4.at="t5nex0"
hint.cxl.4.port="0"

  wires cxl4 to the first port on the t5nex0 adapter.

5 years agoMFC 340021: Assert that reclaim_tx_descs() is always making forward progress.
jhb [Fri, 4 Jan 2019 00:06:30 +0000 (00:06 +0000)]
MFC 340021: Assert that reclaim_tx_descs() is always making forward progress.

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

PR: 234380
Sponsored by: Mellanox Technologies

5 years agoMFC r342456:
hselasky [Thu, 3 Jan 2019 09:24:37 +0000 (09:24 +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

5 years agoMFC r342537-r342540
kadesai [Thu, 3 Jan 2019 08:04:14 +0000 (08:04 +0000)]
MFC r342537-r342540

r342537

This patch will add support for latest generation MegaRAID adapters- Aero(39xx).
Driver will throw a warning message when a Configurable secure type controller is
encountered.

r342538

This patch will add support for 32 bit atomic request descriptor for Aero adapters.

For Aero adapters-
1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs.
2. Driver will use 64 bit request descriptor to fire IOC INIT.
3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it
otherwise driver will use 64 bit request descriptor.

For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request
descriptors only.

r342539

Problem statement:
Due to hardware errata in Aero controllers, reads to certain
fusion registers could intermittently return all zeroes.
This behavior is transient in nature and subsequent reads will return
valid value.

Fix:
For Aero controllers, any read will retry the read operations
from certain registers for maximum three times, if read returns zero.

r342540

Driver version upgrade.

5 years agoMFC r342079
kadesai [Thu, 3 Jan 2019 07:59:51 +0000 (07:59 +0000)]
MFC r342079
Compilation failure on ppc and mips due to Revision 342066.
Adding extra memset on chain frame.

5 years agoMFC r342059-r342069
kadesai [Thu, 3 Jan 2019 07:45:52 +0000 (07:45 +0000)]
MFC r342059-r342069

r342059
This patch will add support for next generation(SAS3.5) of Tri mode(SAS, SATA, NVMe)
MegaRAID adapters.

r342060
This patch will add support for new Dynamic RaidMap to have different sizes
for different number of supported VDs for SAS3.5 MegaRAID adapters.

r342061
This patch will add support for divert bitmap in RAID map. Divert bitmap is supported for
SAS3.5 adapters only.

r342062
This patch will add new interface to support more than 256 JBODs.

r342063
Detect sequential Write IOs and pass the hint that it is part of sequential
stream to help HBA Firmware do the Full Stripe Writes. For read IOs on
certain RAID volumes like Read Ahead volumes,this will help driver to
send it to Firmware even if the IOs can potentially be sent to
hardware directly (called fast path) bypassing firmware.

Design: 8 streams are maintained per RAID volume as per the combined
firmware/driver design. When there is no stream detected the LRU stream
is used for next potential stream and LRU/MRU map is updated to make this
as MRU stream. Every time a stream is detected the MRU map
is updated to make the current stream as MRU stream.

r342064
To improve RAID 1/10 Write performance, OS drivers need to issue the
required Write IOs as Fast Path IOs (after the appropriate checks
allowing Fast Path to be used) to the appropriate physical drives
(translated from the OS logical IO) and wait for all Write IOs to complete.

Design: A write IO on RAID volume will be examined if it can be sent in
Fast Path based on IO size and starting LBA and ending LBA falling on to
a Physical Drive boundary. If the underlying RAID volume is a RAID 1/10,
driver issues two fast path write IOs one for each corresponding physical
drive after computing the corresponding start LBA for each physical drive.
Both write IOs will have the same payload and are posted to HW such that
replies land in the same reply queue.

If there are no resources available for sending two IOs, driver will send
the original IO from upper layer to RAID volume through the Firmware.

When both IOs are completed by HW, the resources will be released
and SCSI IO completion handler will be called.

r342065
This patch will add support for new DCMD to get PD information and a single data structure
to specify LD and JBOD.

r342066
This patch will add support for NVME PRPs creation by driver for fastpath
capable IOs. NVME specification supports specific type of scatter gather list
called as PRP (Physical Region Page) for IO data buffers. Since NVME drive is
connected behind SAS3.5 tri-mode adapter, MegaRAID driver/firmware has to convert
OS SGLs in native NVMe PRP format. For IOs sent to firmware, MegaRAID firmware
does this job of OS SGLs to PRP translation and send PRPs to backend NVME device.
For fastpath IOs, driver will do this OS SGLs to PRP translation.

r342067
Change IOC INIT wait time to 180 secs to keep it inline with timeout
used by internal DCMDs.

r342068
This patch will increase debug level as current logging level has
very minimal prints and even few important messages will not get logged.

r342069
Driver version upgrade 07.708.02.00-fbsd

5 years agoMFC 339899: Make battery emptying rate available as sysctl variable.
jhb [Thu, 3 Jan 2019 01:39:22 +0000 (01:39 +0000)]
MFC 339899: Make battery emptying rate available as sysctl variable.

Curiously, the in-kernel routines always use the design voltage to
convert from mA to mW, but acpiconf in userland uses the current
voltage.  As a result, this can report a different mW rate than
acpiconf.

5 years agoMFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.
jhb [Wed, 2 Jan 2019 23:57:37 +0000 (23:57 +0000)]
MFC 339894: Teach procstat -x about the AT_EHDRFLAGS ELF auxiliary vector.

5 years agoMFC 341802: Validate the string size parameter passed to -s.
jhb [Wed, 2 Jan 2019 20:49:41 +0000 (20:49 +0000)]
MFC 341802: Validate the string size parameter passed to -s.

Use strtonum() to reject negative sizes instead of core dumping.

PR: 232206

5 years agoMFC 339620: Add a "live" mode to ktrdump.
jhb [Wed, 2 Jan 2019 19:48:17 +0000 (19:48 +0000)]
MFC 339620: Add a "live" mode to ktrdump.

Support a "live" mode in ktrdump enabled via the -l flag.  In this
mode, ktrdump polls the kernel's trace buffer periodically (currently
hardcoded as a 50 millisecond interval) and dumps any newly added
entries.  Fancier logic for the timeout (e.g. a command line option or
some kind of backoff based on the time since the last entry) can be
added later as the need arises.

Note that this does not include the capsicum fixes from the original
commit since ktrdump in stable/11 is not capsicum-ized.

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.

5 years agoMFC r342182:
markj [Wed, 2 Jan 2019 16:28:56 +0000 (16:28 +0000)]
MFC r342182:
Remove UMS support code from radeonkms.

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>

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

5 years agoMFC r342661: Happy New Year 2019!
delphij [Tue, 1 Jan 2019 00:48:25 +0000 (00:48 +0000)]
MFC r342661: Happy New Year 2019!

5 years agoMFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright
delphij [Tue, 1 Jan 2019 00:42:51 +0000 (00:42 +0000)]
MFC r333391 (imp): Remove 'All Rights Reserved' from the collection copyright
and templates.

5 years agoMFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable.
jhb [Mon, 31 Dec 2018 22:09:08 +0000 (22:09 +0000)]
MFC 340460: Convert the number of MSI IRQs on x86 from a constant to a tunable.

The number of MSI IRQs still defaults to 512, but it can now be
changed at boot time via the machdep.num_msi_irqs tunable.

Relnotes: yes

5 years agoMFC r342368, r342369
vmaffione [Mon, 31 Dec 2018 11:10:02 +0000 (11:10 +0000)]
MFC r342368, r342369

netmap: fix bug in netmap_poll() optimization

The bug was introduced by r339639, although it is present in the upstream
netmap code since 2015. It is due to resetting the want_rx variable to
POLLIN, rather than resetting it to POLLIN|POLLRDNORM.
It only affects select(), which uses POLLRDNORM. poll() is not affected,
because it uses POLLIN.
Also, it only affects FreeBSD, because Linux skips the optimization
implemented by the piece of code where the bug occurs.
To check if txsync can be skipped, it is necessary to look for
unseen TX space. However, this means comparing ring->cur
against ring->tail, rather than ring->head against ring->tail
(like nm_ring_empty() does).

Sponsored by:   Sunny Valley Networks

5 years agoMerge forgotten r318577 to close PR.
mr [Mon, 31 Dec 2018 11:05:38 +0000 (11:05 +0000)]
Merge forgotten r318577 to close PR.

PR: 217622

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.

5 years agoMFC r342381:
kib [Sun, 30 Dec 2018 15:21:25 +0000 (15:21 +0000)]
MFC r342381:
Allocate v_object for the new snapshot vnode.

5 years agoMFC r342380:
kib [Sun, 30 Dec 2018 15:20:35 +0000 (15:20 +0000)]
MFC r342380:
Properly test for vmio buffer in bnoreuselist().

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.

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.

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.

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.

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.

5 years agoMFC r342367: ifconfig.8, lagg.4: fix documentation bug: -use_flowid
eugen [Sat, 29 Dec 2018 00:42:11 +0000 (00:42 +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

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.

5 years agoAdd an UPDATING entry for r342562.
rmacklem [Sat, 29 Dec 2018 00:06:41 +0000 (00:06 +0000)]
Add an UPDATING entry for r342562.

This is a direct commit.

5 years agoMFC r342298:
ae [Fri, 28 Dec 2018 10:10:16 +0000 (10:10 +0000)]
MFC r342298:
  Allow use underscores and dots in service names without escaping.

  PR: 234237

5 years agoMFC r342193: ichwd: add a few assertions about tco_version
avg [Fri, 28 Dec 2018 08:53:26 +0000 (08:53 +0000)]
MFC r342193: ichwd: add a few assertions about tco_version

5 years agoMFC r342073: ichwd: add Sunrise Point-LP ID
avg [Fri, 28 Dec 2018 08:50:27 +0000 (08:50 +0000)]
MFC r342073: ichwd: add Sunrise Point-LP ID

5 years agoMFC r342072: ichwd: add support for clearing No Reboot bit in TCOv4
avg [Fri, 28 Dec 2018 08:48:37 +0000 (08:48 +0000)]
MFC r342072: ichwd: add support for clearing No Reboot bit in TCOv4

5 years agoMFC: r342286
rmacklem [Fri, 28 Dec 2018 00:26:19 +0000 (00:26 +0000)]
MFC: r342286
Fix the NFSv4 server to obey vfs.nfsd.nfs_privport.

When the NFSv4 server was coded, I believed that the specification authors
did not want NFSv4 servers to require a client to use a reserved port#.
However, recently it has been noted that the Linux NFSv4 server does support
a check for a reserved port#.
Since both the FreeBSD and Linux NFSv4 clients use a reserved port# by
default, enabling vfs.nfsd.nfs_privport to require a reserved port# for
NFSv4 the same as it does for NFSv2, 3 seems reasonable.
The only case where this could cause a POLA violation is a FreeBSD NFSv4
server with vfs.nfsd.nfs_privport set, but with NFSv4 clients doing mounts
without using a reserved port# (< 1024).

5 years agoDocument SA-18:15, EN-18:16, EN-18:17, EN-18:18.
gjb [Thu, 27 Dec 2018 17:17:37 +0000 (17:17 +0000)]
Document SA-18:15, EN-18:16, EN-18:17, EN-18:18.

Sponsored by: The FreeBSD Foundation

5 years agoMFC r341998:
kp [Wed, 26 Dec 2018 12:54:27 +0000 (12:54 +0000)]
MFC r341998:

pf: Fix endless loop on NAT exhaustion with sticky-address

When we try to find a source port in pf_get_sport() it's possible that
all available source ports will be in use. In that case we call
pf_map_addr() to try to find a new source IP to try from. If there are
no more available source IPs pf_map_addr() will return 1 and we stop
trying.

However, if sticky-address is set we'll always return the same IP
address, even if we've already tried that one.
We need to check the supplied address, because if that's the one we'd
set it means pf_get_sport() has already tried it, and we should error
out rather than keep trying.

PR: 233867

5 years agoMFC r342204: cyapa.4, isl.4: cross-reference and document use of chromebook_platform(4)
avg [Wed, 26 Dec 2018 09:23:13 +0000 (09:23 +0000)]
MFC r342204: cyapa.4, isl.4: cross-reference and document use of chromebook_platform(4)

5 years agoMFC r341681: daprobedone: announce if a disk is write-protected
avg [Wed, 26 Dec 2018 09:19:13 +0000 (09:19 +0000)]
MFC r341681: daprobedone: announce if a disk is write-protected

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

5 years agoMFC r342185:
avos [Tue, 25 Dec 2018 13:39:11 +0000 (13:39 +0000)]
MFC r342185:
iwi(4): do not leak node reference when IWI_FLAG_ASSOCIATED flag is set.

5 years agoMFC r341833:
kp [Tue, 25 Dec 2018 12:45:49 +0000 (12:45 +0000)]
MFC r341833:

pf: Prevent integer overflow in PF when calculating the adaptive timeout.

Mainly states of established TCP connections would be affected resulting
in immediate state removal once the number of states is bigger than
adaptive.start.  Disabling adaptive timeouts is a workaround to avoid this bug.
Issue found and initial diff by Mathieu Blanc (mathieu.blanc at cea dot fr)

Reported by: Andreas Longwitz <longwitz AT incore.de>
Obtained from: OpenBSD

5 years agoMFC r341785
arybchik [Tue, 25 Dec 2018 07:39:34 +0000 (07: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

5 years agoMFC r341784
arybchik [Tue, 25 Dec 2018 07:38:46 +0000 (07: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

5 years agoMFC r341783
arybchik [Tue, 25 Dec 2018 07:37:42 +0000 (07: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

5 years agoMFC r341782
arybchik [Tue, 25 Dec 2018 07:34:44 +0000 (07:34 +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

5 years agoMFC r341327
arybchik [Tue, 25 Dec 2018 07:33:45 +0000 (07:33 +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

5 years agoMFC r341326
arybchik [Tue, 25 Dec 2018 07:33:02 +0000 (07:33 +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

5 years agoMFC r341311
arybchik [Tue, 25 Dec 2018 07:32:18 +0000 (07:32 +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

5 years agoMFC r341309
arybchik [Tue, 25 Dec 2018 07:31:45 +0000 (07:31 +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

5 years agoMFC r341302
arybchik [Tue, 25 Dec 2018 07:30:53 +0000 (07:30 +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

5 years agoMFC r341301
arybchik [Tue, 25 Dec 2018 07:30:17 +0000 (07:30 +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

5 years agoMFC r341297
arybchik [Tue, 25 Dec 2018 07:27:45 +0000 (07:27 +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

5 years agoMFC r341295
arybchik [Tue, 25 Dec 2018 07:23:33 +0000 (07: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

5 years agoMFC r341290
arybchik [Tue, 25 Dec 2018 07:23:04 +0000 (07:23 +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

5 years agoMFC r341215
arybchik [Tue, 25 Dec 2018 07:22:24 +0000 (07: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

5 years agoMFC r341214
arybchik [Tue, 25 Dec 2018 07:21:35 +0000 (07: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

5 years agoMFC r341213
arybchik [Tue, 25 Dec 2018 07:20:41 +0000 (07: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

5 years agoMFC r341197
arybchik [Tue, 25 Dec 2018 07:19:39 +0000 (07:19 +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

5 years agoMFC r341038
arybchik [Tue, 25 Dec 2018 07:18:40 +0000 (07:18 +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

5 years agoMFC r340896
arybchik [Tue, 25 Dec 2018 07:15:51 +0000 (07:15 +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

5 years agoMFC r340895
arybchik [Tue, 25 Dec 2018 07:15:03 +0000 (07:15 +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

5 years agoMFC r340894
arybchik [Tue, 25 Dec 2018 07:14:01 +0000 (07:14 +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

5 years agoMFC r340892
arybchik [Tue, 25 Dec 2018 07:13:30 +0000 (07:13 +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

5 years agoMFC r340891
arybchik [Tue, 25 Dec 2018 07:12:49 +0000 (07:12 +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

5 years agoMFC r340890
arybchik [Tue, 25 Dec 2018 07:12:08 +0000 (07:12 +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

5 years agoMFC r340889
arybchik [Tue, 25 Dec 2018 07:11:08 +0000 (07:11 +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

5 years agoMFC r340888
arybchik [Tue, 25 Dec 2018 07:07:34 +0000 (07:07 +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

5 years agoMFC r340887
arybchik [Tue, 25 Dec 2018 07:03:52 +0000 (07:03 +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

5 years agoMFC r340886
arybchik [Tue, 25 Dec 2018 07:03:01 +0000 (07:03 +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

5 years agoMFC r340885
arybchik [Tue, 25 Dec 2018 07:02:35 +0000 (07:02 +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

5 years agoMFC r340884
arybchik [Tue, 25 Dec 2018 07:02:08 +0000 (07:02 +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

5 years agoMFC r340883
arybchik [Tue, 25 Dec 2018 07:01:25 +0000 (07:01 +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

5 years agoMFC r340875
arybchik [Tue, 25 Dec 2018 07:00:37 +0000 (07:00 +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

5 years agoMFC r340833
arybchik [Tue, 25 Dec 2018 06:59:48 +0000 (06:59 +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

5 years agoMFC r340831
arybchik [Tue, 25 Dec 2018 06:58:47 +0000 (06:58 +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

5 years agoMFC r340826
arybchik [Tue, 25 Dec 2018 06:57:41 +0000 (06:57 +0000)]
MFC r340826

sfxge(4): fix ignoring function return value

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

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

5 years agoMFC r340822
arybchik [Tue, 25 Dec 2018 06:56:48 +0000 (06:56 +0000)]
MFC r340822

sfxge(4): fix check in NVRAM validate

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

5 years agoMFC r340814
arybchik [Tue, 25 Dec 2018 06:56:04 +0000 (06:56 +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

5 years agoMFC r340806
arybchik [Tue, 25 Dec 2018 06:55:13 +0000 (06:55 +0000)]
MFC r340806

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

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

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

5 years agoMFC r340805
arybchik [Tue, 25 Dec 2018 06:54:25 +0000 (06:54 +0000)]
MFC r340805

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

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

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

5 years agoMFC r340804
arybchik [Tue, 25 Dec 2018 06:53:25 +0000 (06:53 +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

5 years agoMFC r340803
arybchik [Tue, 25 Dec 2018 06:52:37 +0000 (06:52 +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

5 years agoMFC r340802
arybchik [Tue, 25 Dec 2018 06:51:58 +0000 (06:51 +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

5 years agoMFC r340801
arybchik [Tue, 25 Dec 2018 06:51:18 +0000 (06:51 +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

5 years agoMFC r340800
arybchik [Tue, 25 Dec 2018 06:50:13 +0000 (06:50 +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

5 years agoMFC r340796
arybchik [Tue, 25 Dec 2018 06:49:10 +0000 (06:49 +0000)]
MFC r340796

sfxge(4): fix failure path in EF10 Tx queue PIO enable

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

5 years agoMFC r340800
arybchik [Tue, 25 Dec 2018 06:48:04 +0000 (06:48 +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