Commit Graph

29746 Commits

Author SHA1 Message Date
Roger Pau Monné
3778878d7c netfront: fix LINT-NOIP
r289587 broke LINT-NOIP kernels because the lro and queued local variables
are defined but not used. Add preprocessor guards around them.

Reported by:	emaste
Sponsored by:	Citrix Systems R&D
2015-10-21 13:53:07 +00:00
Roger Pau Monné
2f9ec994bc xen: Code cleanup and small bug fixes
xen/hypervisor.h:
 - Remove unused helpers: MULTI_update_va_mapping, is_initial_xendomain,
   is_running_on_xen
 - Remove unused define CONFIG_X86_PAE
 - Remove unused variable xen_start_info: note that it's used inpcifront
   which is not built at all
 - Remove forward declaration of HYPERVISOR_crash

xen/xen-os.h:
 - Remove unused define CONFIG_X86_PAE
 - Drop unused helpers: test_and_clear_bit, clear_bit,
   force_evtchn_callback
 - Implement a generic version (based on ofed/include/linux/bitops.h) of
   set_bit and test_bit and prefix them by xen_ to avoid any use by other
   code than Xen. Note that It would be worth to investigate a generic
   implementation in FreeBSD.
 - Replace barrier() by __compiler_membar()
 - Replace cpu_relax() by cpu_spinwait(): it's exactly the same as rep;nop
   = pause

xen/xen_intr.h:
 - Move the prototype of xen_intr_handle_upcall in it: Use by all the
   platform

x86/xen/xen_intr.c:
 - Use BITSET* for the enabledbits: Avoid to use custom helpers
 - test_bit/set_bit has been renamed to xen_test_bit/xen_set_bit
 - Don't export the variable xen_intr_pcpu

dev/xen/blkback/blkback.c:
 - Fix the string format when XBB_DEBUG is enabled: host_addr is typed
   uint64_t

dev/xen/balloon/balloon.c:
 - Remove set but not used variable
 - Use the correct type for frame_list: xen_pfn_t represents the frame
   number on any architecture

dev/xen/control/control.c:
 - Return BUS_PROBE_WILDCARD in xs_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
   first driver, every new device with the driver is unset will use
   xenstore.

dev/xen/grant-table/grant_table.c:
 - Remove unused cmpxchg
 - Drop unused include opt_pmap.h: Doesn't exist on ARM64 and it doesn't
   contain anything required for the code on x86

dev/xen/netfront/netfront.c:
 - Use the correct type for rx_pfn_array: xen_pfn_t represents the frame
   number on any architecture

dev/xen/netback/netback.c:
 - Use the correct type for gmfn: xen_pfn_t represents the frame number on
   any architecture

dev/xen/xenstore/xenstore.c:
 - Return BUS_PROBE_WILDCARD in xctrl_probe: Returning 0 in a probe callback
   means the driver can handle this device. If by any chance xenstore is the
  first driver, every new device with the driver is unset will use xenstore.

Note that with the changes, x86/include/xen/xen-os.h doesn't contain anymore
arch-specific code. Although, a new series will add some helpers that differ
between x86 and ARM64, so I've kept the headers for now.

Submitted by:		Julien Grall <julien.grall@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3921
Sponsored by:		Citrix Systems R&D
2015-10-21 10:44:07 +00:00
Alexander Motin
b5024bfde9 Some more defines and polishing for INIT_FIRMWARE. 2015-10-21 08:23:19 +00:00
Kevin Lo
b020e15ebd Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's
no valid flag there.
2015-10-21 06:23:57 +00:00
Kevin Lo
4b0d8bec6b Switch PCI register reads from using magic numbers to using the names
defined in pcireg.h
2015-10-21 02:50:22 +00:00
Adrian Chadd
8f1cf028d3 AR8327: Fix up the ability to configure the vlangroup configuration for the CPU port
I messed up when doing the reset_vlans method - setting vid[0] = 1 here
was making it 'hidden' from configuration (as it needed ETHERSWITCH_VID_VALID
as well) and so there was no way to configure vlangroup0.

In per-port VLAN mode, vlangroup0 is for the CPU port (port0).
Now, it normally wouldn't really matter - the CPU port thus sees
all other ports. However there are two CPU ports on the AR8327 and
so port0 (arge0) was seeing all traffic on port6 (arge1).
If you thus tried to use arge1/port6 for anything (eg a WAN port)
in a bridge group then things would very upset very quickly.

Whilst here, add a comment to remind myself that yes, it'd be nice
if we could specify a boot-time switch config.

Tested:

* AP135 reference platform w/ AR8327N switch
2015-10-20 21:18:02 +00:00
Jean-Sébastien Pédron
238b89fcad iicbus: Use device_delete_children() instead of explicit child removal
If the bus is detached and deleted by a call to device_delete_child() or
device_delete_children() on a device higher in the tree, I²C children
were already detached and deleted. So the device_t pointer stored in sc
points to freed memory: we must not try to delete it again.

By using device_delete_children(), we let subr_bus.c figure out if there
are children to take care of.

While here, make sure iicbus_detach() and iicoc_detach() call
device_delete_children() too, to be safe.

Reviewed by:	jhb, imp
Approved by:	jhb, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3926
2015-10-20 19:52:59 +00:00
Jean-Sébastien Pédron
b90d6d94c1 iicbus: Remove trailing whitespaces
MFC after:	1 week
2015-10-20 19:47:08 +00:00
Conrad Meyer
a69ff5b1ee NTB: Revert r289645
Per Benno, this is a Linuxism we do not need in FreeBSD.

Suggested by:	benno
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:32:16 +00:00
Conrad Meyer
d9503a7fcd if_ntb: Diff-reduce with Linux; add queue index type
Add ntb_q_idx_t so it is more clear which struct members are of the same
type (some bogus uint64_ts snuck in that should have been unsigned int).

Add tx_err_no_buf and s/ENOMEM/EBUSY/ in tx_enqueue to match Linux.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:21:01 +00:00
Conrad Meyer
2d6501b281 NTB: MFV 8c9edf63: Fix zero size or integer overflow in ntb_set_mw
A plain 32 bit integer will overflow for values over 4GiB.

Change the plain integer size to the appropriate size type in
ntb_set_mw.  Change the type of the size parameter and two local
variables used for size.

Even if there is no overflow, a size of zero is invalid here.

Authored by:	Allen Hubbe
Reported by:	Juyoung Jung
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:52 +00:00
Conrad Meyer
4994fe1295 NTB: MFV da2e5ae5: Fix ntb_transport out-of-order RX update
It was possible for a synchronous update of the RX index in the error
case to get ahead of the asynchronous RX index update in the normal
case.  Change the RX processing to preserve an RX completion order.

There were two error cases.  First, if a buffer is not present to
receive data, there would be no queue entry to preserve the RX
completion order.  Instead of dropping the RX frame, leave the RX frame
in the ring.  Schedule RX processing when RX entries are enqueued, in
case there are RX frames waiting in the ring to be received.

Second, if a buffer is too small to receive data, drop the frame in the
ring, mark the RX entry as done, and indicate the error in the RX entry
length.  Check for a negative length in the receive callback in
ntb_netdev, and count occurrences as rx_length_errors.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:42 +00:00
Conrad Meyer
8a26cf17c6 if_ntb: Correct over-long lines, use qmin()
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:33 +00:00
Conrad Meyer
bbea13c586 if_ntb: Use if_printf instead of device_printf
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:24 +00:00
Conrad Meyer
eccd1f0a14 NTB: MFV 2f887b9a: Rename Intel code names to platform names
Mechanically replace "SOC" with "ATOM" to match Linux.  No functional
change.  Original Linux commit log follows:

Instead of using the platform code names, use the correct platform names
to identify the respective Intel NTB hardware.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:15 +00:00
Conrad Meyer
3a8a0a9dfa NTB: Don't abort if setting a MW write-combine fails
Also log BAR mapping results more verbosely.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:20:06 +00:00
Conrad Meyer
217453caed NTB: Fix typo in bar5 tunables
Typo introduced in r289614.

Pointy-hat:	cem
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:19:57 +00:00
Conrad Meyer
43a191ed78 NTB: MFV 7eb38781: Print driver name in module init
Prints driver name to indicate what is being loaded.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 19:19:48 +00:00
David C Somayajulu
467dcb5a1f ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE
ql_os.c: removed unnecessary debug printf
ql_ver.h: updated version number
MFC after:5 days
2015-10-20 17:27:11 +00:00
Alexander Motin
21c2207ffc Update firmware images for Qlogic 24xx/25xx from 5.5.0 to 7.3.0.
This also removes separate "_multi" images, since this funcationality is
now in base, and there is simply no new images without it for years.
2015-10-20 12:27:59 +00:00
Alexander Motin
b363245a31 Zero mbox[0] for INIT_FIRMWARE to fix version 7.3 firmware.
While there, add new fields to isp_icb_2400_t structure.
2015-10-20 10:16:03 +00:00
Alexander Motin
261286a787 Decode more firmware attributes. 2015-10-20 08:29:30 +00:00
Conrad Meyer
5165422dff NTB: Clean up safely if attach fails early
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:52 +00:00
Conrad Meyer
98580c064c NTB: MFV 9891417d: Increase transport MTU to 64k from 16k
Benchmarking showed a significant performance increase with the MTU size
to 64k instead of 16k.  Change the driver default to 64k.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:43 +00:00
Conrad Meyer
6a88fb3ef8 if_ntb: Fix typo in qp_link_work to match Linux
Throw away the result of the peer SPAD read.  The peer will write our
local SPAD and we need to keep the locally read SPAD value to check if
the remote side is up.

Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:34 +00:00
Conrad Meyer
d5bd08b091 NTB: MFV 42fefc86: Add parameters for Intel SNB B2B addresses
Add module parameters for the addresses to be used in B2B topology.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:25 +00:00
Conrad Meyer
25ff5df7c4 if_ntb: MFV 2849b5d7: Reset transport QP link stats on down
Reset the link stats when the link goes down.  In particular, the TX and
RX index and count must be reset, or else the TX side will be sending
packets to the RX side where the RX side is not expecting them.  Reset
all the stats, to be consistent.

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:16 +00:00
Conrad Meyer
0326e4d6b5 NTB: Change Atom (BWD/SoC) pci_id name to match others
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:54:08 +00:00
Conrad Meyer
fb6531b056 NTB: MFV 5ae0beb6: Enable link for Intel root port mode in probe
We skip actually bringing up Rootport/Transparent configurations, so
most of this doesn't apply.  Original Linux commit log:

Link training should be enabled in the driver probe for root port mode.
We should not have to wait for transport to be loaded for this to
happen.  Otherwise the ntb device will not show up on the transparent
bridge side of the link.

Authored by:	Dave Jiang
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:46:14 +00:00
Conrad Meyer
6849146f9d NTB: enum-ify some HW constants
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:46:05 +00:00
Conrad Meyer
2d53c202a1 NTB: Pull copy of soc_link_is_err out of recover_soc_link
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:45:57 +00:00
Conrad Meyer
e638b59556 NTB: Drop some dead softc members
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:45:48 +00:00
Conrad Meyer
7452e26d14 NTB: Replace last reg_ofs with self_reg
Diff reduce with Linux driver.  No functional change.

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-20 01:45:38 +00:00
Conrad Meyer
f1a516bcf9 NTB: Add ntb_db_vector_mask() missed in r289546
This is the last one.

Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-19 18:06:35 +00:00
Conrad Meyer
83f50830db NTB: Add ntb_db_valid_mask() missed in r289546
Another trivial one.

Pointy-hat:	cem
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-19 17:53:20 +00:00
Conrad Meyer
2ea07c645a NTB: Add ntb_mw_clear_trans() missed in r289546
It is just a trivial wrapper around ntb_mw_set_trans().

Authored by:	Allen Hubbe
Obtained from:	Linux (Dual BSD/GPL driver)
Sponsored by:	EMC / Isilon Storage Division
2015-10-19 17:41:22 +00:00
Roger Pau Monné
4955cbf300 xen-netfront: use "netfront" in lock description
Missed from r289585.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3937
Sponsored by:		Citrix Systems R&D
2015-10-19 15:34:24 +00:00
Roger Pau Monné
1a2928b740 xen-netfront: fix netfront create_dev error path
The failure path for allocating rx grant refs should not try to free tx
grant refs because tx grant refs were allocated after that. Also fix the
error path for xen_net_read_mac.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3891
Sponsored by:		Citrix Systems R&D
2015-10-19 14:47:37 +00:00
Roger Pau Monné
b31a0d731b xen-netfront: no need to set if_output
This is redundant because ether_ifattach will set that field.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3918
Sponsored by:		Citrix Systems R&D
2015-10-19 14:37:17 +00:00
Roger Pau Monné
08c9c2e0a1 xen-netfront: remove a bunch of FreeBSD version check
We're way beyond FreeBSD 7 at this point.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3892
Sponsored by:		Citrix Systems R&D
2015-10-19 14:34:45 +00:00
Roger Pau Monné
177e3f1366 xen-netfront: remove XN_LOCK_{INIT,DESTROY}
Multiqueue feature will make the number of queues dynamic, so XN_LOCK_INIT
won't be that useful. Remove the macro and call mtx_init directly.

XN_LOCK_DESTROY is just dead code.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3890
Sponsored by:		Citrix Systems R&D
2015-10-19 14:26:40 +00:00
Roger Pau Monné
9a7f9feaf5 xen-netfront: clean up netfront stats structure
Rename it with netfront_ prefix and purge a bunch of unused fields.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3889
Sponsored by:		Citrix Systems R&D
2015-10-19 14:22:57 +00:00
Roger Pau Monné
d0f3a8b902 xen-netfront: purge page flipping support
Currently neither Linux nor FreeBSD netback supports page flipping. NetBSD
still supports that. It is not sure how many people actually use page
flipping, but page flipping is supposed to be slower than copying nowadays.
It will also shatter frontend / backend address space.

Overall this feature is more of a burden than a benefit.

Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3888
Sponsored by:		Citrix Systems R&D
2015-10-19 14:20:06 +00:00
Roger Pau Monné
17374b6c3b xen-netfront: delete all trailing white spaces
Submitted by:		Wei Liu <wei.liu2@citrix.com>
Reviewed by:		royger
Differential Revision:	https://reviews.freebsd.org/D3886
Sponsored by:		Citrix Systems R&D
2015-10-19 14:12:15 +00:00
Hans Petter Selasky
f556cede8a Merge LinuxKPI changes from DragonflyBSD:
- Define the kref structure identical to the one found in Linux.
- Update clients referring inside the kref structure.
- Implement kref_sub() for FreeBSD.

Reviewed by:	np @
Sponsored by:	Mellanox Technologies
2015-10-19 12:26:38 +00:00
Hans Petter Selasky
4be283b9be Add quirk for USB 3.0 PCI device.
Submitted by:	philipp.maechler@mamo.li
PR:		203650
MFC after:	1 week
2015-10-19 07:21:57 +00:00
Adrian Chadd
02b3773ac4 otus(4) - use the local node alloc function so there's space for statistics.
* Use the correct malloc type for node allocation - M_80211_NODE - so
  the default node free method in net80211 will work correctly.
* Fix otus_node_alloc() to suit FreeBSD's net80211.
* .. and actually call otus_node_alloc() so there's space for the
  per-node tx statistics.  Otherwise, well, it will be scribbling over
  random memory.

Tested:

* AR9170, STA mode
2015-10-19 01:21:29 +00:00
Adrian Chadd
fd7b55de48 otus(4) - add initial monitor mode; use lowest rate for EAPOL
The monitor mode stuff is from the openbsd driver, but it doesn't
100% work.  It doesn't seem to get all frames for all BSSes.
However, it's enough to at start debugging things.  That 0xffffffff
write is /I think/ the RX filter, but I am still not 100% sure about
it all.

Then, whilst here, use the lowest rate for EAPOL frames.  This is just
generally a good thing to do.
2015-10-19 01:14:26 +00:00
Zbigniew Bodek
441d67800c Introduce driver for Cavium's ThunderX MDIO
This commit adds support for MDIO present in the ThunderX SoC.
From the FDT point of view it is compatible with "octeon-3860-mdio"
however only C22 mode is used.
The code also implements lmac_if interface functions.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
2015-10-18 22:10:08 +00:00
Zbigniew Bodek
2306b72a5d Introduce initial support for Cavium's ThunderX networking interface
- The driver consists of three main componens: PF, VF, BGX
- Requires appropriate entries in DTS and MDIO driver
- Supports only FDT configuration
- Multiple Tx queues and single Rx queue supported
- No RSS, HW checksum and TSO support
- No more than 8 queues per-IF (only one Queue Set per IF)
- HW statistics enabled
- Works in all available MAC modes (1,10,20,40G)
- Style converted to BSD according to style(9)
- The code brings lmac_if interface used by the BGX driver to
  update its logical MACs state.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
2015-10-18 22:02:58 +00:00