Commit Graph

28 Commits

Author SHA1 Message Date
Pedro F. Giffuni
ac2fffa4b7 Revert r327828, r327949, r327953, r328016-r328026, r328041:
Uses of mallocarray(9).

The use of mallocarray(9) has rocketed the required swap to build FreeBSD.
This is likely caused by the allocation size attributes which put extra pressure
on the compiler.

Given that most of these checks are superfluous we have to choose better
where to use mallocarray(9). We still have more uses of mallocarray(9) but
hopefully this is enough to bring swap usage to a reasonable level.

Reported by:	wosch
PR:		225197
2018-01-21 15:42:36 +00:00
Pedro F. Giffuni
efaa3e0789 dev/(e1000,ixl): Make some use of mallocarray(9).
Reviewed by:	erj
Differential Revision: https://reviews.freebsd.org/D13833
2018-01-11 15:25:26 +00:00
Ryan Libby
33c66d8aeb ixl: gcc build errors
Fix minor -Werror issues when building with gcc from -Wredundant-decls,
-Wunused, -Wbool-operations.  Also ensure the M_IXL malloc type is only
defined once.

Reviewed by:	efj
Approved by:	markj (mentor)
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D11414
2017-07-14 00:10:51 +00:00
Eric Joyner
cb6b8299fd ixl(4): Update to 1.7.12-k
Refresh upstream driver before impending conversion to iflib.

Major new features:

- Support for Fortville-based 25G adapters
- Support for I2C reads/writes

(To prevent getting or sending corrupt data, you should set
dev.ixl.0.debug.disable_fw_link_management=1 when using I2C
[this will disable link!], then set it to 0 when done. The driver implements
the SIOCGI2C ioctl, so ifconfig -v works for reading I2C data,
but there are read_i2c and write_i2c sysctls under the .debug sysctl tree
[the latter being useful for upper page support in QSFP+]).

- Addition of an iWARP client interface (so the future iWARP driver for
  X722 devices can communicate with the base driver).
  - Compiling this option in is enabled by default, with "options IXL_IW" in
    GENERIC.

Differential Revision:	https://reviews.freebsd.org/D9227
Reviewed by:	sbruno
MFC after:	2 weeks
Sponsored by:	Intel Corporation
2017-02-10 01:04:11 +00:00
Eric Joyner
ff9b61ca07 Fix linker warnings (errors on gcc) that resulted from r304510.
The variables that are extern in the netmap header file should be
defined in ixl_txrx.c (the file that is included in both ixl(4)/ixlv(4),
not in the main driver source files.

Reported by:	ed@, dim@, ngie@
2016-09-01 01:08:18 +00:00
Eric Joyner
ff59a463a3 ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled.
Define (unused) netmap variables; ixlv(4) doesn't support netmap yet.

Reported by:	sergey.kozlov@intel.com
Sponsored by:	Intel Corporation
2016-08-20 00:08:10 +00:00
Sean Bruno
4294f337b0 ixl(4): Update to ixl-1.6.6-k.
Submitted by:	erj
Reviewed by:	jeffrey.e.pieper@intel.com
MFC after:	3 days
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D7391
2016-08-07 18:12:36 +00:00
Sean Bruno
761e526185 Do not initialize the adapter on MTU change when adapter status is down.
This fixes long-standing problems when changing settings of the adapter.

Discussed in:
https://lists.freebsd.org/pipermail/freebsd-net/2016-June/045509.html

Submitted by:	arnaud.ysmal@stormshield.eu
Reviewed by:	erj@freebsd.org
Approved by:	re (gjb)
Differential Revision:	https://reviews.freebsd.org/D7030
2016-07-07 03:39:18 +00:00
Eric Joyner
d4683565fd ixl: Update to 1.4.27-k.
Changes:

Kevin Scott		i40e-shared: Save off VSI resource count when updating VSI
Anjali Singhai Jain	i40e-shared: Expose some registers to program parser, FD and RSS logic
Eric Joyner		ixl: Fix errors in queue interrupt setup in MSIX mode.
Shannon Nelson		i40e-shared: implement and use rx ctl helper functions
Shannon Nelson		i40e-shared: don't use AQ calls from clear_hw
Eric Joyner		ixl: Use rx ctl read/write functions instead of register accesses in certain places.
Shannon Nelson		i40e-shared: add adminq commands for rx ctl registers
Shannon Nelson		i40e-shared: implement and use rx ctl helper functions
Jeremiah Kyle		i40e-shared: Corrected function name in comment block
Deepthi Kavalur		i40e-shared: correcting a HW capability display info
Shannon Nelson		i40e-shared: fixups for (Linux) upstream consistency
Eric Joyner		ixl: Only stop firmware's LLDP agent on older firmware versions.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:22:12 +00:00
Eric Joyner
6d011ad5f6 ixl: Update to 1.4.24-k.
Changes by author:

Eric Joyner		ixl: Fix compile error when IXL_DEBUG is defined.
Eric Joyner		ixl: Fix taskqueues created in init() not being freed in stop().
Eric Joyner		ixl: Add additional debug sysctls, for Tx and Rx queue stats.
Eric Joyner		ixl: Enable dynamic itr by default.
Eric Joyner		ixl: Edit spacing, comments,  function signatures (to conform to style(9)).
Eric Joyner		ixl: Check for errors when tearing down msix interrupts.
Eric Joyner		ixl: Remove unnecessary register reads/writes.
Eric Joyner		ixl: Remove admin queue interrupt enable from general interrupt enable.
Eric Joyner		ixl: Update switch config after teardown/reset flow in init().
Eric Joyner		ixl: Add additional admin queue error code output to admin queue call errors.
Eric Joyner		ixl: Don't destroy i40e spinlock if it's already uninitialized.
Shannon Nelson		i40e-shared: clean event descriptor before use
Anjali Singhai Jain	i40e-shared: When in promisc mode apply promisc mode to Tx Traffic as well
Kevin Scott		i40e_shared: Increase timeout when checking GLGEN_RSTAT_DEVSTATE bit
Eric Joyner		ixlv: Fix IXL_DEBUG compile issue.
Eric Joyner		ixlv: Attempt to fix panic/other issues when rapidly unloading/loading driver.
Eric Joyner		ixl/ixlv: Revert m_collapse() in ixl_xmit() to m_defrag().
Deepthi Kavalur		i40e_shared: Trace logging HW capabilities
Eric Joyner		ixlv: Correctly unlock/relock around init() call in vc_completion().
Eric Joyner		ixl: Stop preventing changing flow control mode for CR4 media.
Eric Joyner		ixl: Set IPv6 TCP offload flag when doing TSO.

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:21:52 +00:00
Eric Joyner
1d767a8eae ixl: Update to 1.4.17-k.
Changes:

Kiran Patil	i40e-shared: APIs to Add/remove port mirroring rules
Shannon Nelson	i40e-shared: add VEB stat control and remove L2 cloud filter
Eric Joyner	ixl: Update NVM version information shown.
Eric Joyner	ixl: Remove empty else block.
Eric Joyner	ixl: Slightly re-work ixl_init_msix().
Eric Joyner	ixl: Remove duplicate queue enablement.
Shannon Nelson	i40e-shared: implement the API function for aq_set_switch_config
Eric Joyner	ixl: Update nvm version string shown in sysctl.
Eric Joyner	ixl/ixlv: Changes to PF/VF minor version checking/handling.
Eric Joyner	ixlv: Reduce maximum wait time for responses to VF AQ messages.
Eric Joyner	ixl/ixlv: Edit comments, comment out code, and edit spacing.
Eric Joyner	ixl: Print log message when SR-IOV init is successful.
Eric Joyner	ixl: Add Tx Flow Control filter from main PF VSI.
Eric Joyner	ixlv: Add extra error message when ixlv_get_vf_config times out.
Eric Joyner	ixl: Assign current MOCS optics the XLPPI media type.
Eric Joyner	ixl: Remove conditional wait after link status event.
Eric Joyner	ixl: Add line break and remove extraneous return statement.
Eric Joyner	ixl: Allow 40G speeds in the advertise_speed sysctl.
Eric Joyner	ixl: Add "CRC enable" field to link_status sysctl output.
Eric Joyner	ixl: Move sbuf.h include out of IXL_DEBUG* defines.
Eric Joyner	ixl: Move remaining debug sysctl funcs to IXL_DEBUG_SYSCTL define.
Eric Joyner	ixl: Add cases for all remaining media types in shared code to media_status().

Differential Revision:  https://reviews.freebsd.org/D6211
Reviewed by:    sbruno, kmacy, jeffrey.e.pieper@intel.com
MFC after:      2 weeks
Sponsored by:   Intel Corporation
2016-05-12 18:21:17 +00:00
Pedro F. Giffuni
648970d8eb ixl(4): replace 0 with NULL for pointers.
Found by devel/coccinelle.

Differential Revision:	https://reviews.freebsd.org/D5894
Reviewed by:	erj
2016-04-09 17:37:36 +00:00
Jack F Vogel
be771cda12 Update SW4 to the Intel ixl/ixlv drivers. This is primarily a shared
code update, with supporting changes in the CORE. Changes for the extended
media types, VF driver has virtual channel protocol changes, and some
register use corrections.  This software change should be coordinated with
Firmware updates to your hardware, contact your support channels for that.

MFC after:	1 week
2015-06-05 22:52:42 +00:00
Marcelo Araujo
3d6b500ff9 Free vsi->queues after use.
Differential Revision:	D2344
Reviewed by:		erj
2015-05-15 06:11:47 +00:00
Jack F Vogel
56c2c47b64 This delta introduces SRIOV support, thanks to Ryan Stone of Sandvine for
adding this major feature to the driver. Secondly, this updates the base
driver with new 20G device support, and with the new firmware levels some
changes to link handling and initialization were required.

MFC after: 1 week
2015-03-10 19:17:40 +00:00
Adrian Chadd
977dc4e243 Migrate using CPU_ZERO() + CPU_SET() -> CPU_SETOF().
Tested:

* ixgbe, igb, RSS enabled

Submitted by:	jhb
Sponsored by:	Norse Corp, Inc.
2015-02-25 21:44:53 +00:00
Adrian Chadd
9756bd5982 Change uses of taskqueue_start_threads_pinned() -> taskqueue_start_threads_cpuset()
Differential Revision:	https://reviews.freebsd.org/D1897
Reviewed by:	jfv
2015-02-24 22:17:12 +00:00
Jack F Vogel
b6c8f26052 Bring the XL710 drivers up to the SW3 release level.
MFC after: 1 week
2015-02-20 00:40:26 +00:00
Jack F Vogel
dcd7b3b269 Some RSS issues discovered by Adrian, missing header, variable
names fat fingered, incorrect hash config setup. Thanks :)

MFC after: 1 week
2015-01-16 19:11:58 +00:00
Jack F Vogel
393c4bb1ba Intel I40E driver updates:
if_ixl to version 1.3.0, if_ixlv to version 1.2.0
	- Major change in both drivers is to add RSS support
	- In ixl fix some interface speed related issues, dual
	  speed was not changing correctly, KR/X media was not
	  displaying correctly (this has a workaround until a
	  more robust media handling is in place)
	- Add a warning when using Dell NPAR and the speed is
	  less than 10G
	- Wrap a queue hung message in IXL_DEBUG, as it is non-fatal,
	  and without tuning can display excessively

MFC after: 1 week
2015-01-12 18:43:34 +00:00
Jack F Vogel
e5100ee278 Update the Intel i40e drivers, ixl version 1.2.8, ixlv version 1.1.18
-Improved VF stability, thanks to changes from Ryan Stone,
	 and Juniper.
	- RSS fixes in the ixlv driver
	- link detection in the ixlv driver
	- New sysctl's added in ixl and ixlv
	- reset timeout increased for ixlv
	- stability fixes in detach
	- correct media reporting
	- Coverity warnings fixed
	- Many small bug fixes
	- VF Makefile modified - nvm shared code needed
	- remove unused sleep channels in ixlv_sc struct

Submitted by: Eric Joyner (committed by jfv)
MFC after:	1 week
2014-11-06 23:45:05 +00:00
Ryan Stone
cf3c0c32d2 Ensure that ixl_flush() uses a defined register on VFs
In some code that is shared between the ixl(4) and ixlv(4) drivers,
a macro hard-coded a register offset that was not valid on ixlv devices.
Fix this by having each driver define a variable that contains the correct
offset.

Reviewed by:	Eric Joyner <ricera10 AT gmail.com>
MFC after:	3 days
Sponsored by:	Sandvine Inc
2014-09-29 17:51:39 +00:00
Gleb Smirnoff
4b443922e0 Convert driver to if_get_counter method.
Submitted by:	rstone
Reviewed by:	Eric Joyner <ricera10 gmail.com>
2014-09-27 20:54:57 +00:00
Bjoern A. Zeeb
7e0dde7d54 Properly hide calls to ARP under #ifdef INET to allow IPv6-only
kernels to compile.

MFC atfer:	3 days
2014-09-20 08:34:56 +00:00
Bjoern A. Zeeb
d94ca7cf07 Revert r270808, which were changes to common code (i40e_alloc.h).
Rather than #define-ing common code function calls to OS-dependent
ones, make the osdep versions match the common code expectations,
adjust the FreeBSD specific code to use those, and remove the
#defines.

In the FreeBSD specific code, use "i40e_mem_reserved" for the
now expected but unused argument to i40e_allocate_dma_mem().

Reviewed by:	gnn, eric.joyner intel.com
MFC after:	3 days
2014-09-18 21:13:03 +00:00
Gleb Smirnoff
1bffa9511f Use define from if_var.h to access a field inside struct if_data,
that resides in struct ifnet.

Sponsored by:	Nginx, Inc.
2014-08-30 19:55:54 +00:00
Steven Hartland
13b408044d Fix build breakage caused by ixl driver
Fix missing includes and invalid vars in ixl / ixlv driver added by r270346
which caused build failures for GENERIC kernel after it was made default
by r270755.

X-MFC-With: r270346 / r270755
Sponsored by:	Multiplay
2014-08-28 18:59:39 +00:00
Jack F Vogel
61ae650d55 Update to the Intel Base driver for the Intel XL710 Ethernet Controller Family
- It was decided to change the driver name to if_ixl for FreeBSD
	- This release adds the VF Driver to the tree, it can be built into
	  the kernel or as the if_ixlv module
	- The VF driver is independent for the first time, this will be
	  desireable when full SRIOV capability is added to the OS.
	- Thanks to my new coworker Eric Joyner for his superb work in
	  both the core and vf driver code.

Enjoy everyone!

Submitted by:	jack.vogel@intel.com and eric.joyner@intel.com
MFC after:	3 days (hoping to make 10.1)
2014-08-22 18:59:19 +00:00