Commit Graph

62 Commits

Author SHA1 Message Date
Warner Losh
685dc743dc sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:36 -06:00
Warner Losh
2ff63af9b8 sys: Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:18 -06:00
Warner Losh
95ee2897e9 sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:11 -06:00
Jessica Clarke
5684c8783b qlnxe: Add missing #ifdef INET to fix amd64 LINT-NOINET/NOIP builds
The approach here is copied directly from qlxgb.

Fixes:	b0d3d44dfe ("qlnxe: add driver to amd64 NOTES")
2023-07-08 00:54:07 +01:00
Mark O'Donovan
406ff3d57e Simplify buffer count calculation
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/778
2023-07-07 16:36:28 -06:00
Mark O'Donovan
0b53a9971e Remove duplicate #include
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/778
2023-07-07 16:36:28 -06:00
Mark O'Donovan
6f9388d505 qlnxe: remove unused variable from ecore_ll2.c
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:07:00 -06:00
Mark O'Donovan
e4017d9b69 qlnxe: Fix building as in-kernel component
Add some extra files for building the driver as part of the kernel.
Change some #defines to match those used when building as a module.

PR: 268354

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:59 -06:00
Mark O'Donovan
dc58675cfb qlnxe: Fix unused but set variable warning
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:58 -06:00
Mark O'Donovan
b75c387a66 qlnxe: Remove #ifdef ECORE_PACKAGE
I do not know why this is here but it blocks compilation.
Removing it makes the builtin option the same as the module build

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:57 -06:00
Mark O'Donovan
c1be7151d5 qlnxe: Fix too many args in call to internal_ram_wr()
internal_ram_wr() only takes 3 args when ECORE_CONFIG_DIRECT_HWFN
is defined

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:56 -06:00
Mark O'Donovan
99e5ffe1ba qlnxe: Move sriov includes to qlnx_os.c
SRIOV is being enabled in ecore.h but by then
the qlnx_os.h header has been processed and not
included the relevant headers

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:56 -06:00
Mark O'Donovan
134b093699 qlnxe: Remove -Wno-case-qual from module build
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/779
2023-07-01 11:06:55 -06:00
Justin Hibbits
727bfe3894 Mechanically convert qlnx(4) to IfAPI
Reviewed By:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37856
2023-03-24 10:09:53 -04:00
Elliott Mitchell
21e0b50796 qlnxr: cleanup secondary effects from EOL purge
DEFINE_ALLOC_MR became unconditionally true, but it isn't used anywhere
now.  Several places depended upon DEFINE_IB_FAST_REG, but that is now
always false.
Similarly DEFINE_IB_UMEM_WITH_CHUNK became always false/undefined.
DEFINE_IB_AH_ATTR_WITH_DMAC is now unconditionally true.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560
2023-02-04 09:13:09 -07:00
Elliott Mitchell
bbe35708ad qlnx: purge EOL release compatibility
Drop code that supproted FreeBSD 10 and 11.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/603
Differential Revision: https://reviews.freebsd.org/D35560
2023-02-04 09:13:08 -07:00
Gordon Bergling
5daf88ea5e qlnxe(4): Fix a typo in a source code comment
- s/defult/default/

MFC after:	3 days
2022-10-26 17:27:07 +02:00
Gordon Bergling
a5c1b9e332 qlnxe(4): Fix a typo in a source code comment
- s/paramters/parameters/

MFC after:	3 days
2022-09-15 10:31:05 +02:00
Gordon Bergling
37519e3ff3 qlnxe(4): Fix a typo in a source code comment
- s/pedning/pending/

MFC after:	3 days
2022-07-31 11:35:07 +02:00
Gordon Bergling
a87f167c41 qlnxe(4): Fix a typo in a source code comment
- s/indepent/independent/

MFC after:	3 days
2022-06-05 09:15:33 +02:00
John Baldwin
2f87208e2d qlnx/qlxgb/qlxgbe/qlxge: Remove unused devclass arguments to DRIVER_MODULE. 2022-05-09 12:22:03 -07:00
Gordon Bergling
78fc83f096 qlnxe(4): Fix a typo in a source code comment
- s/mulitple/multiple/

MFC after:	3 days
2022-04-09 09:29:35 +02:00
John Baldwin
eb147f78a4 qlnx: Mark variables only used in debug traces as unused. 2022-04-07 17:01:28 -07:00
John Baldwin
ee07d71213 qlnx: Return error from qlnxr_mod_load if it fails.
Fix qlnx_rdma_register_if return ENXIO rather than -1 on error and
propagate that error to the caller in qlnxr_mod_load.
2022-04-07 17:01:27 -07:00
John Baldwin
885db9301e qlnx: Comment out remaining references to tx_data_bd. 2022-04-07 17:01:27 -07:00
John Baldwin
3415775dfa qlnx: Move all references to total_rx_count under #ifdef QLNX_SOFT_LRO. 2022-04-07 17:01:27 -07:00
John Baldwin
91aa93eb67 qlnx: Remove unused variables. 2022-04-07 17:01:27 -07:00
Gordon Bergling
a216b9c2e0 qlnxe(4): Fix a typo in a source code comment
- s/existance/existence/

MFC after:	3 days
2022-03-28 19:31:18 +02:00
Elyes HAOUAS
9097ac9af4 Fix typo on "Celsius"
"Celcius" --> "Celsius"

Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Pull Request: https://github.com/freebsd/freebsd-src/pull/551/files
2021-11-18 23:05:32 -07:00
Gordon Bergling
957d9ba0c3 qlnxe: Fix typos in two error messages
- s/erorr/error/

MFC after:	1 week
2021-10-02 10:49:51 +02:00
Gordon Bergling
5bdf58e196 Fix some common typos in source code comments
- s/priviledged/privileged/
- s/funtion/function/
- s/doens't/doesn't/
- s/sychronization/synchronization/

MFC after:	3 days
2021-08-28 18:57:23 +02:00
Gordon Bergling
04389c855e Fix some common typos in comments
- s/configuraiton/configuration/
- s/specifed/specified/
- s/compatiblity/compatibility/

MFC after:	5 days
2021-08-08 10:16:06 +02:00
Hans Petter Selasky
b633e08c70 ibcore: Kernel space update based on Linux 5.7-rc1.
Overview:

This is the first stage of a RDMA stack upgrade introducing kernel
changes only based on Linux 5.7-rc1.

This patch is based on about four main areas of work:
- Update of the IB uobjects system:
  - The memory holding so-called AH, CQ, PD, SRQ and UCONTEXT objects
    is now managed by ibcore. This also require some changes in the
    kernel verbs API. The updated verbs changes are typically about
    initialize and deinitialize objects, and remove allocation and
    free of memory.

- Update of the uverbs IOCTL framework:
  - The parsing and handling of user-space commands has been
    completely refactored to integrate with the updated IB uobjects
    system.

- Various changes and updates to the generic uverbs interfaces in
  device drivers including the new uAPI surface.

- The mlx5_ib_devx.c in mlx5ib and related mlx5 core changes.

Dependencies:

- The mlx4ib driver code has been updated with the minimum changes
needed.

- The mlx5ib driver code has been updated with the minimum changes
needed including DV support.

Compatibility:

- All user-space facing APIs are backwards compatible after this
  change.

- All kernel-space facing RDMA APIs are backwards compatible after
  this change, with exception of ib_create_ah() and ib_destroy_ah()
  which takes a new flag.

- The "ib_device_ops" structure exist, but only contains the driver ID
  and some structure sizes.

Differences from Linux:

- Infiniband drivers must use the INIT_IB_DEVICE_OPS() macro to set
  the sizes needed for allocating various IB objects, when adding
  IB device instances.

Security:

- PRIV_NET_RAW is needed to use raw ethernet transmit features.
- PRIV_DRIVER is needed to use other privileged operations.

Based on upstream Linux, Torvalds (5.7-rc1):
8632e9b5645bbc2331d21d892b0d6961c1a08429

MFC after:	1 week
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D31149
Sponsored by:	NVIDIA Networking
2021-07-28 13:28:29 +02:00
Hans Petter Selasky
c3987b8ea7 ibcore: Declare ib_post_send() and ib_post_recv() arguments const
Since neither ib_post_send() nor ib_post_recv() modify the data structure
their second argument points at, declare that argument const. This change
makes it necessary to declare the 'bad_wr' argument const too and also to
modify all ULPs that call ib_post_send(), ib_post_recv() or
ib_post_srq_recv(). This patch does not change any functionality but makes
it possible for the compiler to verify whether the
ib_post_(send|recv|srq_recv) really do not modify the posted work request.

Linux commit:
f696bf6d64b195b83ca1bdb7cd33c999c9dcf514
7bb1fafc2f163ad03a2007295bb2f57cfdbfb630
d34ac5cd3a73aacd11009c4fc3ba15d7ea62c411

MFC after:	1 week
Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-07-12 14:22:33 +02:00
Hans Petter Selasky
d92a9e5604 ibcore: Simplify ib_modify_qp_is_ok().
All callers to ib_modify_qp_is_ok() provides enum ib_qp_state makes the
checks of out-of-scope redundant. Let's remove them together with updating
function signature to return boolean result.

While at it remove unused "ll" parameter from ib_modify_qp_is_ok().

Linux commit:
19b1f54099b6ee334acbfbcfbdffd1d1f057216d
d31131bba5a1630304c55ea775c48cc84912ab59

MFC after:	1 week
Reviewed by:	kib
Sponsored by:	Mellanox Technologies // NVIDIA Networking
2021-07-12 14:22:32 +02:00
Mark Johnston
56cbd386fb qlnxr: Properly initialize the Linux device structure
The driver needs to provide a LinuxKPI device structure to register
itself with the IB subsystem.  It was erroneously using a copy of its
FreeBSD device structure for this purpose.

Use linux_pci_attach_device() instead, following the example of the
Chelsio iwarp driver.  Also ensure that we don't leak the faked device
during detach.

Reviewed by:	hselasky
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D29595
2021-04-12 09:32:08 -04:00
Bjoern A. Zeeb
6c8dd7c863 qlnxr: remove netdevice.h
Remove unused #includes of a LinuxKPI header noticed while trying to
solve LinuxKPI struct net_device and related functions.
This takes qlnxr out of the picture of D29366.

Sponsored-by:	The FreeBSD Foundation
MFC-after:	2 weeks
X-D-R:		D29366 (extracted as further cleanup)
2021-03-26 17:17:10 +00:00
Bjoern A. Zeeb
5df6f7a840 qlnxr: remove duplicate defines
upper_32_bits() and lower_32_bits() are defined twice in this file.
With the extra conditinal removed on LinuxKPI in 3b1ecc9fa1
they are also included from there already.  Use the LinuxKPI version
and remove the two local ones.

Sponsored-by:	The FreeBSD Foundation
Reviewed-by:	hselasky
MFC-after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D29392
2021-03-24 23:03:30 +00:00
Mateusz Guzik
3720573374 qlnx: clean up empty lines in .c and .h files 2020-09-01 21:57:33 +00:00
Emmanuel Vadot
1d7d49c360 qnlx: Do not redifines types.
r360870 added linux/slab.h into liunx/bitmap.h and this include linux/types.h
The qlnx driver is redefining some of those types so remove them and add an
explicit linux/types.h include.

Pointy hat: manu
Reported by:	Austin Shafer <ashafer@badland.io>
2020-05-10 14:09:30 +00:00
Pawel Biernacki
7029da5c36 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2020-02-26 14:26:36 +00:00
Gleb Smirnoff
fe8a3369a8 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:12 +00:00
Mark Johnston
d3588766e1 Correct the scope of several global variables.
They are accessed from multiple compilation units.  No functional change
intended.

MFC after:	1 week
Sponsored by:	Netflix
2019-09-27 21:04:33 +00:00
Conrad Meyer
f4d8b4f81c qlnxr(4), qlnxe(4): Unbreak gcc build
Remove redundant definitions and conditionalize Clang-specific CFLAGS.

Sponsored by:	Dell EMC Isilon
2019-02-01 23:04:45 +00:00
David C Somayajulu
fa790ea99f Add RDMA (iWARP and RoCEv1) support
David Somayajulu (davidcs): Overall RDMA Driver infrastructure and iWARP
Anand Khoje (akhoje@marvell.com): RoCEv1 verbs implementation

MFC after:5 days
2019-01-31 00:09:38 +00:00
David C Somayajulu
217ec20885 Remove support for QLNX_RCV_IN_TASKQ - i.e., Rx only in TaskQ.
Added support for LLDP passthru
Upgrade ECORE to version 8.33.5.0
Upgrade STORMFW to version 8.33.7.0
Added support for SRIOV

MFC after:5 days
2018-07-25 02:36:55 +00:00
Matt Macy
d7c5a620e2 ifnet: Replace if_addr_lock rwlock with epoch + mutex
Run on LLNW canaries and tested by pho@

gallatin:
Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5
based ConnectX 4-LX NIC, I see an almost 12% improvement in received
packet rate, and a larger improvement in bytes delivered all the way
to userspace.

When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1,
I see, using nstat -I mce0 1 before the patch:

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
4.98   0.00   4.42   0.00 4235592     33   83.80 4720653 2149771   1235 247.32
4.73   0.00   4.20   0.00 4025260     33   82.99 4724900 2139833   1204 247.32
4.72   0.00   4.20   0.00 4035252     33   82.14 4719162 2132023   1264 247.32
4.71   0.00   4.21   0.00 4073206     33   83.68 4744973 2123317   1347 247.32
4.72   0.00   4.21   0.00 4061118     33   80.82 4713615 2188091   1490 247.32
4.72   0.00   4.21   0.00 4051675     33   85.29 4727399 2109011   1205 247.32
4.73   0.00   4.21   0.00 4039056     33   84.65 4724735 2102603   1053 247.32

After the patch

InMpps OMpps  InGbs  OGbs err TCP Est %CPU syscalls csw     irq GBfree
5.43   0.00   4.20   0.00 3313143     33   84.96 5434214 1900162   2656 245.51
5.43   0.00   4.20   0.00 3308527     33   85.24 5439695 1809382   2521 245.51
5.42   0.00   4.19   0.00 3316778     33   87.54 5416028 1805835   2256 245.51
5.42   0.00   4.19   0.00 3317673     33   90.44 5426044 1763056   2332 245.51
5.42   0.00   4.19   0.00 3314839     33   88.11 5435732 1792218   2499 245.52
5.44   0.00   4.19   0.00 3293228     33   91.84 5426301 1668597   2121 245.52

Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch

Reviewed by:	gallatin
Sponsored by:	Limelight Networks
Differential Revision:	https://reviews.freebsd.org/D15366
2018-05-18 20:13:34 +00:00
Brooks Davis
541d96aaaf Use an accessor function to access ifr_data.
This fixes 32-bit compat (no ioctl command defintions are required
as struct ifreq is the same size).  This is believed to be sufficent to
fully support ifconfig on 32-bit systems.

Reviewed by:	kib
Obtained from:	CheriBSD
MFC after:	1 week
Relnotes:	yes
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14900
2018-03-30 18:50:13 +00:00
Ryan Libby
dd00a8cd29 ql*_def.h: fix QL_ALIGN parenthesization
QL_ALIGN is a set of copies of roundup2, but it was missing an outer set
of parentheses, which began to matter with r324538. Now, fully copy the
parenthesization of roundup2.

Reviewed by:	davidcs
Differential Revision:	https://reviews.freebsd.org/D12673
2017-10-18 19:28:28 +00:00
David C Somayajulu
b1c4d096e6 Fix qlnx_tso_check() so that every window of
(ETH_TX_LSO_WINDOW_BDS_NUM - nbds_in_hdr) has atleast
ETH_TX_LSO_WINDOW_MIN_LEN bytes

MFC after:5 days
2017-08-24 19:09:42 +00:00