aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe/iw_cxgbe
Commit message (Collapse)AuthorAgeFilesLines
* cxgbe: Move the STAG and PBL memory pool arenas to the base driverJohn Baldwin2025-09-295-141/+33
| | | | | | | | | | | | | | Both RDMA (iw_cxgbe) and NVMe offloads use TPT table entries to map transaction tags in incoming PDUs to buffers in host memory permitting direct placement of received data into host memory buffers avoiding copies (iSCSI offload uses a different scheme for mapping tags to host memory). Move the vmem arenas for the supporting card memory regions from iw_cxgbe to the main driver so they can be shared with the NVMe offload driver. In addition, add some helper routines for constructing work requests to update TPT table entries. MFC after: 3 days Sponsored by: Chelsio Communications
* cxgbe(4): T7 ULPTX supports larger data length with MEMIO commandsNavdeep Parhar2025-09-291-3/+10
| | | | | MFC after: 3 days Sponsored by: Chelsio Communications
* cxgbe tom: Halve the size of offload transmit software descriptorsJohn Baldwin2025-09-111-0/+2
| | | | | | | | Use bitfields to pack tx_credits and plen into a single 32-bit word. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D47759
* cxgbe/iw_cxgbe: Fail early in some callbacks when the RNIC is stopped.Navdeep Parhar2024-08-305-0/+18
| | | | | | | | | | | | Stop allocating new resources when the RNIC is stopped but continue to allow previously allocated resources to be freed. Note that t4_tom's uld_stop tears down all TOE connections, including those being used for iWARP, and that triggers the cleanup of iWARP resources. Fail post_send/post_recv early too to avoid the SQ doorbell. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe/iw_cxgbe: c4iw_connect should return a negative errno.Navdeep Parhar2024-08-301-2/+1
| | | | | | | Avoid a pointless assignment while here. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe/iw_cxgbe: Tidy up a couple of CTRs in c4iw_create_listen.Navdeep Parhar2024-08-291-3/+2
| | | | | | | | backlog is an int and not a string. While here, fix an adjacent CTR that was spread over two lines even though it fits in one. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe/iw_cxgbe: Replace the fatal error flag with a stopped flag.Navdeep Parhar2024-08-284-14/+19
| | | | | | | | | | | Now that suspend/resume is supported by the base driver, a fatal error isn't the only reason that the RNIC can stop abruptly. Also, this state is no longer permanent as it's possible to resume operations after a stop. Rename the flag and associated routines to match the new state of affairs. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe/iw_cxgbe: Fix typo in assertion.Navdeep Parhar2024-08-171-1/+1
| | | | | | eanbled -> enabled MFC after: 3 days
* cxgbe/iw_cxgbe: Add a placeholder uld_restart.Navdeep Parhar2024-07-221-0/+8
| | | | | MFC after: 1 month Sponsored by: Chelsio Communications
* cxgbe(4): Changes to ULD list management.Navdeep Parhar2024-07-191-9/+10
| | | | | | | | | | | | | | | * Convert t4_uld_list to an array. There will be at most 3 items in the list and it's simpler to track them in an array with a fixed slot for each ULD. * There is no need to refcount ULDs so stop doing that. * Add uld_ prefix to all members of uld_info. * Rename async_event to uld_stop to match its actual purpose. Call it for all ULDs and not just ULD_IWARP. Reviewed by: jhb MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D46029
* sockets: don't malloc/free sockaddr memory on getpeername/getsocknameGleb Smirnoff2023-11-301-10/+4
| | | | | | | | | | | | | Just like it was done for accept(2) in cfb1e92912b4, use same approach for two simplier syscalls that return socket addresses. Although, these two syscalls aren't performance critical, this change generalizes some code between 3 syscalls trimming code size. Following example of accept(2), provide VNET-aware and INVARIANT-checking wrappers sopeeraddr() and sosockaddr() around protosw methods. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D42694
* sockets: don't malloc/free sockaddr memory on accept(2)Gleb Smirnoff2023-11-301-5/+2
| | | | | | | | | | | | | | Let the accept functions provide stack memory for protocols to fill it in. Generic code should provide sockaddr_storage, specialized code may provide smaller structure. While rewriting accept(2) make 'addrlen' a true in/out parameter, reporting required length in case if provided length was insufficient. Our manual page accept(2) and POSIX don't explicitly require that, but one can read the text as they do. Linux also does that. Update tests accordingly. Reviewed by: rscheff, tuexen, zlei, dchagin Differential Revision: https://reviews.freebsd.org/D42635
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-169-18/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1212-12/+12
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* cxgbe/iw_cxgbe: debug routines to dump STAG (steering tag) entries.Navdeep Parhar2023-04-192-5/+79
| | | | | | | | | | | t4_dump_stag to dump hw state for a known STAG. t4_dump_all_stag to dump hw state for all valid STAGs. This routine walks the entire STAG region looking for valid entries and this can take a while for some configurations. MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe/iw_cxgbe: Always set a vnet around calls to IN_LOOPBACK.Navdeep Parhar2023-04-011-13/+25
| | | | | | | This is catch up with efe58855f3ea. MFC after: 1 week Sponsored by: Chelsio Communications
* Mechanically convert cxgb(4) and cxgbe(4) to IfAPIJustin Hibbits2023-03-072-11/+11
| | | | | | Reviewed by: np Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38597
* cxgbe: stop open-coding kref accessMateusz Guzik2022-12-052-4/+4
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* cxgbe: Various whitespace fixes.John Baldwin2022-11-153-8/+8
| | | | | | | Mostly trailing whitespace and spaces before tabs. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D37350
* cxgbe: use standard sototcpcb() accessor macro to get socket's tcpcbGleb Smirnoff2022-10-191-1/+1
| | | | | Reviewed by: np Differential revision: https://reviews.freebsd.org/D37041
* tcp: remove INP_TIMEWAIT flagGleb Smirnoff2022-10-071-1/+1
| | | | | | | | | | | | | Mechanically cleanup INP_TIMEWAIT from the kernel sources. After 0d7445193ab, this commit shall not cause any functional changes. Note: this flag was very often checked together with INP_DROPPED. If we modify in_pcblookup*() not to return INP_DROPPED pcbs, we will be able to remove most of this checks and turn them to assertions. Some of them can be turned into assertions right now, but that should be carefully done on a case by case basis. Differential revision: https://reviews.freebsd.org/D36400
* cxgbe(4): Fix a typo in a source code commentGordon Bergling2022-07-161-1/+1
| | | | | | - s/alredy/already/ MFC after: 3 days
* cxgbe/iw_cxgbe: c4iw_zero_addr should not use IN_ZERONET.Navdeep Parhar2022-05-191-2/+1
| | | | | | | | | | c4iw_zero_addr is supposed to check for all-zero addresses but was using IN_ZERONET (which does something different) for IPv4 addresses. Fix it by simply checking for 0 as is done for IPv6 addresses. Reported by: karels@ MFC after: 3 days Sponsored by: Chelsio Communications
* cxgbe(4): Fix a typo in a source code commentGordon Bergling2022-04-091-1/+1
| | | | | | - s/simultaniously/simultaneously/ MFC after: 3 days
* cxgbe/iw_cxgbe: Initialize the vma correctly in c4iw_mmap.Navdeep Parhar2022-04-011-2/+2
| | | | | | | | | | | | This fixes userspace RDMA applications that would fail due to mmap failure. The driver's mmap routine would succeed but later the linux_compat.c mmap routine would fail because vma->vm_private_data wasn't set properly. This is catch-up with b633e08c705fe43180567eae26923d6f6f98c8d9. Reported by: Veeresh @ Chelsio Sponsored by: Chelsio Communications
* cxgbe(4): Fix "set but not used [-Wunused-but-set-variable]" warnings.Navdeep Parhar2022-01-101-0/+10
| | | | | MFC after: 1 week Sponsored by: Chelsio Communications
* ibcore: Kernel space update based on Linux 5.7-rc1.Hans Petter Selasky2021-07-285-103/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ibcore: Declare ib_post_send() and ib_post_recv() arguments constHans Petter Selasky2021-07-122-18/+18
| | | | | | | | | | | | | | | | | | | 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
* cxgbe/iw_cxgbe: Support for 512 SGL entries in one memory registration.Navdeep Parhar2021-06-015-10/+13
| | | | | | | | | Use the correct SGL limit within iw_cxgbe, firmwares >= 1.25.6.0 support upto 512 entries per MR. Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications
* cxgbe(4): Remove some dead code.Navdeep Parhar2021-05-191-2/+0
| | | | MFC after: 3 days
* cxgbe: Add a struct sge_ofld_txq type.John Baldwin2021-03-261-3/+3
| | | | | | | | | | This type mirrors struct sge_ofld_rxq and holds state for TCP offload transmit queues. Currently it only holds a work queue but will include additional state in future changes. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29382
* cxgbe: remove unused linux headersBjoern A. Zeeb2021-03-262-3/+0
| | | | | | | | | | | | | Remove unused #includes of LinuxKPI headers noticed while trying to solve LinuxKPI struct net_device and related functions. Neither netdevice.h nor inetdevice.h nor notifier.h seem to be needed. This takes cxgbe(4) out of the picture of D29366. Sponsored-by: The FreeBSD Foundation MFC-after: 2 weeks Reviewed-by: np X-D-R: D29366 (extracted as further cleanup) Differential Revision: https://reviews.freebsd.org/D29432
* Switch cxgbe interface lookup to use fibX_lookup() from olderAlexander V. Chernikov2020-06-221-12/+13
| | | | | | | | | | | | | | fibX_lookup_nh_ext(). fibX_lookup_nh_ represents pre-epoch generation of fib kpi, providing less guarantees over pointer validness and requiring on-stack data copying. Reviewed by: np Differential Revision: https://reviews.freebsd.org/D24975 Notes: svn path=/head/; revision=362487
* cxgbe/iw_cxgbe: Add an async callback to notify iw_cxgbe in case of aNavdeep Parhar2020-05-192-33/+51
| | | | | | | | | | | fatal error. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 2 weeks Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=361261
* cxgbe/iw_cxgbe: Create a LinuxKPI pci device for an adapter and use itNavdeep Parhar2020-04-222-2/+9
| | | | | | | | | | | | | as the dma_device during RDMA registration. cxgbe's struct device cannot be used as-is because it's a native FreeBSD driver and ibcore is LinuxKPI based. MFC after: 1 week MFC after: r360196 Notes: svn path=/head/; revision=360211
* cxgbe/iw_cxgbe: Do not start the EP timer if soaccept fails.Navdeep Parhar2020-04-151-2/+2
| | | | | | | | | | | | This fixes a panic that would occur when the timer tried to close a stale socket. Submitted by: Krishnamraju Eraparaju @ Chelsio MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=359952
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-1/+2
| | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=358333
* cxgbe/iw_cxgbe: correctly enforce the max reg_mr depth.Navdeep Parhar2020-02-181-1/+1
| | | | | | | | | | Reported by: Andrew Zhu @ Netapp Obtained from: Chelsio Communications MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=358082
* cxgbe/iw_cxgbe: Do not allow memory registrations with page size greaterNavdeep Parhar2020-01-143-4/+13
| | | | | | | | | | | than 128MB, which is the maximum supported by the hardware in RDMA mode. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=356713
* cxgbe/iw_cxgbe: Support 64b length in the memory registration routines.Navdeep Parhar2019-12-091-6/+5
| | | | | | | | | Submitted by: bharat @ chelsio MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=355566
* cxgbe(4): Use correct FetchBurstMin values for T6.Navdeep Parhar2019-10-251-2/+4
| | | | | | | | MFC after: 1 week Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=354106
* cxgbe/t4_tom: Initialize all TOE connection parameters in one place.Navdeep Parhar2019-08-271-1/+1
| | | | | | | | | | | | | | | Remove now-redundant items from toepcb and synq_entry and the code to support them. Let the driver calculate tx_align, rx_coalesce, and sndbuf by default. Reviewed by: jhb@ MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D21387 Notes: svn path=/head/; revision=351540
* cxgbe/iw_cxgbe: Remove unused field from the endpoint structure.Navdeep Parhar2019-06-282-2/+0
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=349499
* iw_cxgbe: Remove unused smac_idx from the ep structure.Navdeep Parhar2019-03-191-1/+0
| | | | | | | Submitted by: Krishnamraju Eraparaju @ Chelsio Notes: svn path=/head/; revision=345307
* cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code thatNavdeep Parhar2019-01-301-1/+1
| | | | | | | | | | was added in r342266. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=343569
* cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open.Navdeep Parhar2018-12-201-22/+0
| | | | | | | | | This information is readily available elsewhere. Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=342289
* cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n.Navdeep Parhar2018-12-204-14/+14
| | | | Notes: svn path=/head/; revision=342288
* cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.Navdeep Parhar2018-12-201-6/+6
| | | | | | | | Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=342272
* cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycleNavdeep Parhar2018-12-201-1/+32
| | | | | | | | | | through 4-tuples quickly. Submitted by: Krishnamraju Eraparaju @ Chelsio Sponsored by: Chelsio Communications Notes: svn path=/head/; revision=342270