Commit Graph

91 Commits

Author SHA1 Message Date
Navdeep Parhar
3496224a96 cxgbe/iw_cxgbe: Fix an address calculation in the memory registration code that
was added in r342266.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2019-01-30 05:39:47 +00:00
Navdeep Parhar
ad025209ba cxgbe/iw_cxgbe: Remove redundant CTRs from c4iw_alloc/c4iw_rdev_open.
This information is readily available elsewhere.

Sponsored by:	Chelsio Communications
2018-12-20 22:39:58 +00:00
Navdeep Parhar
6bb034658d cxgbe/iw_cxgbe: Do not terminate CTRx messages with \n. 2018-12-20 22:31:07 +00:00
Navdeep Parhar
8953e80f5e cxgbe/iw_cxgbe: Use -ve errno when interfacing with linuxkpi/OFED.
Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2018-12-20 01:35:45 +00:00
Navdeep Parhar
b562884d63 cxgbe/iw_cxgbe: Add a knob for testing that lets iWARP connections cycle
through 4-tuples quickly.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2018-12-20 01:00:21 +00:00
Navdeep Parhar
121684b714 cxgbe/iw_cxgbe: Use DSGLs to write to card's memory when appropriate.
Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2018-12-19 23:29:01 +00:00
Navdeep Parhar
5c239d80c0 cxgbe/iw_cxgbe: Suppress spurious "Unexpected streaming data ..."
messages.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
MFC after:	1 month
Sponsored by:	Chelsio Communications
2018-11-02 16:21:44 +00:00
Navdeep Parhar
f01fc2d0e8 cxgbe/iw_cxgbe: Install the socket upcall before calling soconnect to
ensure that it always runs when soisconnected does.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
MFC after:	1 month
Sponsored by:	Chelsio Communications
2018-10-29 22:35:46 +00:00
Navdeep Parhar
980ab1baa6 cxgbe/iw_cxgbe: save the ep in the driver-private provider_data field.
Submitted By: Lily Wang @ Netapp

MFC after:	1 week
2018-10-23 18:32:55 +00:00
Navdeep Parhar
6f3a49c317 cxgbe/iw_cxgbe: Fix reported build breakage when the kernel
configuration has "device cxgbe' but no VIMAGE.

Reported by:	mav@
Approved by:	re@ (kib@)
2018-09-13 16:27:21 +00:00
Navdeep Parhar
e32cd65c5b cxgbe/iw_cxgbe: Fix iWARP RDMA + VIMAGE operation by setting the VNET
properly in a couple of places in the driver.

Submitted by:	Krishnamraju Eraparaju @ Chelsio
Approved by:	re@ (rgrimes@)
Sponsored by:	Chelsio Communications
2018-08-29 04:37:53 +00:00
Navdeep Parhar
4a89444d7e Remove unused stuff from iw_cxgbe.h 2018-08-12 03:36:09 +00:00
Navdeep Parhar
37310a98a8 cxgbe(4): Move all control queues to the adapter.
There used to be one control queue per adapter (the mgmtq) that was
initialized during adapter init and one per port that was initialized
later during port init.  This change moves all the control queues (one
per port/channel) to the adapter so that they are initialized during
adapter init and are available before any port is up.  This allows the
driver to issue ctrlq work requests over any channel without having to
bring up any port.

MFH:		2 weeks
Sponsored by:	Chelsio Communications
2018-08-11 21:10:08 +00:00
Hans Petter Selasky
1456d97c01 Optimize ibcore RoCE address handle creation from user-space.
Creating a UD address handle from user-space or from the kernel-space,
when the link layer is ethernet, requires resolving the remote L3
address into a L2 address. Doing this from the kernel is easy because
the required ARP(IPv4) and ND6(IPv6) address resolving APIs are readily
available. In userspace such an interface does not exist and kernel
help is required.

It should be noted that in an IP-based GID environment, the GID itself
does not contain all the information needed to resolve the destination
IP address. For example information like VLAN ID and SCOPE ID, is not
part of the GID and must be fetched from the GID attributes. Therefore
a source GID should always be referred to as a GID index. Instead of
going through various racy steps to obtain information about the
GID attributes from user-space, this is now all done by the kernel.

This patch optimises the L3 to L2 address resolving using the existing
create address handle uverbs interface, retrieving back the L2 address
as an additional user-space information structure.

This commit combines the following Linux upstream commits:

IB/core: Let create_ah return extended response to user
IB/core: Change ib_resolve_eth_dmac to use it in create AH
IB/mlx5: Make create/destroy_ah available to userspace
IB/mlx5: Use kernel driver to help userspace create ah
IB/mlx5: Report that device has udata response in create_ah

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2018-03-05 14:34:52 +00:00
Navdeep Parhar
919da4ceff iw_cxgbe: Remove declaration of a function that no longer exists. 2018-02-07 20:13:08 +00:00
Navdeep Parhar
e62fb4b142 cxgbe/iw_cxgbe: Remove duplicates to fix compilation with recent gcc. 2018-01-13 00:04:11 +00:00
Navdeep Parhar
adbb3637ec cxgbe/iw_cxgbe: Fix iWARP over VLANs (catch up with r326169).
Submitted by:	KrishnamRaju ErapaRaju @ Chelsio
Sponsored by:	Chelsio Communications
2017-12-27 22:44:50 +00:00
Pedro F. Giffuni
718cf2ccb9 sys/dev: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2017-11-27 14:52:40 +00:00
Navdeep Parhar
f93039d9de Fix iw_cxgbe build in the projects branch.
Submitted by:	Krishnamraju Eraparaju @ Chelsio
2017-11-14 07:04:06 +00:00
Navdeep Parhar
5c2bacde58 Update the iw_cxgbe bits in the projects branch.
Submitted by:	Krishnamraju Eraparaju @ Chelsio
Sponsored by:	Chelsio Communications
2017-11-07 23:52:14 +00:00
Hans Petter Selasky
d05554bb99 The remote DMA TCP portspace selector, RDMA_PS_TCP, is used for both
iWarp and RoCE in ibcore. The selection of RDMA_PS_TCP can not be used
to indicate iWarp protocol use. Backport the proper IB device
capabilities from Linux upstream to distinguish between iWarp and
RoCE. Only allocate the additional socket required for iWarp for RDMA
IDs when at least one iWarp device present. This resolves
interopability issues between iWarp and RoCE in ibcore

Reviewed by:		np @
Differential Revision:	https://reviews.freebsd.org/D12563
Sponsored by:		Mellanox Technologies
MFC after:		3 days
2017-10-20 08:20:15 +00:00
Navdeep Parhar
95bb5b694e cxgbe/iw_cxgbe: Set TCP_NODELAY before initiating connection so that
t4_tom picks it up right away.  This is less work than waiting for
the connection to be established before applying the setting.

MFC after:	2 weeks
Sponsored by:	Chelsio Communications
2017-09-01 01:34:12 +00:00
Navdeep Parhar
fc740a161b cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0.
These firmwares come from a pre-release snapshot.  The final firmwares
in this Chelsio release cycle will likely be .61.0 or later and those
will be the next "long lived" firmwares in FreeBSD head and stable
branches.  .59 is being provided in head (only) for wider test exposure.

Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications
2017-08-29 23:37:26 +00:00
Navdeep Parhar
f8d0488ec6 cxgbe/iw_cxgbe: Log the end point's history and flags to the trace
buffer just before it's freed.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2017-07-28 22:28:45 +00:00
Navdeep Parhar
ea168fbc64 cxgbe/iw_cxgbe: Disable debug output by default. The help text for the sysctl
already says that the default is 0.

Sponsored by:	Chelsio Communications
2017-06-27 17:48:11 +00:00
Navdeep Parhar
edc9c9cd54 cxgbe/iw_cxgbe: Catch up with r319722. The socket lock is not the same as the
lock for the receive buffer any more.

Sponsored by:	Chelsio Communications
2017-06-27 17:45:47 +00:00
Navdeep Parhar
27bdfd5a8a cxgbe/iw_cxgbe: sodisconnect failures are harmless and should not be
treated as fatal errors.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-05-24 04:48:09 +00:00
Navdeep Parhar
034b4dcfa8 cxgbe/iw_cxgbe: Pull in some updates to c4iw_wait_for_reply from the
iw_cxgb4 Linux driver.

Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-25 16:54:27 +00:00
Navdeep Parhar
e3951def25 cxgbe/iw_cxgbe: Report the actual values of various parameters as
configured by the firmware.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-14 20:15:17 +00:00
Navdeep Parhar
7f77a37048 cxgbe/iw_cxgbe: Report accurate page_size_cap in ib_query_device.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-14 19:18:50 +00:00
Navdeep Parhar
080491b13c cxgbe/iw_cxgbe: hw supports 64K (not 32K) Protection Domains.
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-14 19:15:31 +00:00
Navdeep Parhar
1c7d0de794 cxgbe/iw_cxgbe: Remove another bad cast. This should have been
included in r316571.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 16:19:19 +00:00
Navdeep Parhar
ba81aae287 cxgbe/iw_cxgbe: Replace a magic constant with something more readable
(and accurate).

T4 and later have an extra bit for page shift so the maximum page size
is 8TB (shift of 12 + 31) instead of 128MB (12 + 15).  This saves space
in the chip's PBL (physical buffer list) when registering very large
memory regions.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 14:50:15 +00:00
Navdeep Parhar
870b2660d4 cxgbe/iw_cxgbe: Remove bad cast that resulted in incorrect length for
memory regions larger than 4GB.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-04-06 13:58:59 +00:00
Navdeep Parhar
ce22fbcf83 cxgbe/iw_cxgbe: T6 has no limit on the amount of memory that can be
registered in one ib_reg_phys_mr.
2017-03-28 23:39:11 +00:00
Navdeep Parhar
74308c6816 cxgbe/iw_cxgbe: Defer the handling of error CQEs and RDMA_TERMINATE to
the thread that deals with socket state changes.  This eliminates
various bad races with the ithread.

Submitted by:	KrishnamRaju ErapaRaju @ Chelsio (original version)
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-27 22:00:03 +00:00
Navdeep Parhar
dee33b4bd5 cxgbe/iw_cxgbe: Remove unused code.
MFC after:	3 days
2017-03-27 03:11:51 +00:00
Navdeep Parhar
4aff1c38d1 cxgbe/iw_cxgbe: allocations that use GFP_KERNEL (which is M_WAITOK on
FreeBSD) cannot fail.

MFC after:	3 days
2017-03-25 02:28:21 +00:00
Navdeep Parhar
d4ce83cd36 cxgbe/iw_cxgbe: alloc_ep expects a gfp_t, and it's always ok to sleep during
alloc_ep.
2017-03-25 01:45:04 +00:00
Navdeep Parhar
a8d61a0a7b cxgbe/iw_cxgbe: c4iw_connect should always returns a -ve errno on failure.
MFC after:	3 days
2017-03-25 01:38:17 +00:00
Navdeep Parhar
94036cfff0 cxgbe/iw_cxgbe: Use the socket and not the toepcb to reach for the
inpcb.  t4_tom detaches the inpcb from the toepcb as soon as the
hardware is done with the connection (in final_cpl_received) but the
socket is around as long as the cm_id and the rest of iWARP state is.

This fixes an intermittent NULL dereference during abort.

Submitted by:	KrishnamRaju ErapaRaju @ Chelsio
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-15 19:10:04 +00:00
Navdeep Parhar
1081f354af cxgbe/iw_cxgbe: Abort connection if there is an error during c4iw_modify_qp.
Submitted by:	KrishnamRaju ErapaRaju @ Chelsio
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-07 01:13:26 +00:00
Navdeep Parhar
401032c67d cxgbe/iw_cxgbe: Implement sq/rq drain operation.
ULPs can set a qp's state to ERROR and then post a work request on the
sq and/or rq.  When the reply for that work request comes back it is
guaranteed that all previous work requests posted on that queue have
been drained.

Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-03 03:07:54 +00:00
Navdeep Parhar
f52a45c98e cxgbe/iw_cxgbe: Do not check the size of the memory region being
registered.  T4/5/6 have no internal limit on this size.  This is
probably a copy paste from the T3 iw_cxgb driver.

MFC after:	3 days
Sponsored by:	Chelsio Communications
2017-03-01 20:23:21 +00:00
Navdeep Parhar
017296dbb6 cxgbe/iw_cxgbe: fix various double-close panics with iWARP sockets.
Sockets representing the TCP endpoints for iWARP connections are
allocated by the ibcore module.  Before this revision they were closed
either by the ibcore module or the iw_cxgbe hardware driver depending on
the state transitions during connection teardown.  This is error prone
and there were cases where both iw_cxgbe and ibcore closed the socket
leading to double-free panics.  The fix is to let ibcore close the
sockets it creates and never do it in the driver.

- Use sodisconnect instead of soclose (preceded by solinger = 0) in the
  driver to tear down an RDMA connection abruptly.  This does what's
  intended without releasing the socket's fd reference.

- Close the socket in ibcore when the iWARP iw_cm_id is destroyed.  This
  works for all kinds of sockets: clients that initiate connections,
  listeners, and sockets accepted off of listeners.

Reviewed by:	Steve Wise @ Open Grid Computing, hselasky@
MFC after:	3 days
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D9796
2017-02-28 19:27:41 +00:00
Navdeep Parhar
3ae36eee9c cxgbe/iw_cxgbe: Minor changes for T6.
Submitted by:	Krishnamraju Eraparaju at Chelsio
Sponsored by:	Chelsio Communications
2017-02-23 19:02:40 +00:00
Navdeep Parhar
c70c4d71de The iw_cxgb and iw_cxgbe drivers should not use a FreeBSD device_t where
a linuxkpi style device is expected.  If OFED/linuxkpi actually starts
using this field then we'll have to figure out whether to create fake
devices for these drivers or have linuxkpi deal with NULL device.

This mismatch was first reported as part of D6585.
2017-01-10 18:39:53 +00:00
Navdeep Parhar
7df135c055 cxgbe/iw_cxgbe: Various fixes to the iWARP driver.
- Return appropriate error code instead of ENOMEM when sosend() fails in
  send_mpa_req.
- Fix for problematic race during destroy_qp.
- Abortive close in the failure of send_mpa_reject() instead of normal close.
- Remove the unnecessary doorbell flowcontrol logic.

Submitted by:	Krishnamraju Eraparaju at Chelsio
MFC after:	1 month
Sponsored by:	Chelsio communications
2016-08-26 17:38:13 +00:00
John Baldwin
315048f2ad Store the offset of the KDOORBELL and GTS registers in the softc.
VF devices use a different register layout than PF devices.  Storing
the offset in a value in the softc allows code to be shared between the
PF and VF drivers.

Reviewed by:	np
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D7389
2016-08-01 22:39:51 +00:00
Navdeep Parhar
671bf2b8b2 cxgbe(4): Changes to the CPL-handler registration mechanism and code
related to "shared" CPLs.

a) Combine t4_set_tcb_field and t4_set_tcb_field_rpl into a single
function.  Allow callers to direct the response to any iq.  Tidy up
set_ulp_mode_iscsi while there to use names from t4_tcb.h instead of
magic constants.

b) Remove all CPL handler tables from struct adapter.  This reduces its
size by around 2KB.  All handlers are now registered at MOD_LOAD instead
of attach or some kind of initialization/activation.  The registration
functions do not need an adapter parameter any more.

c) Add per-iq handlers to deal with CPLs whose destination cannot be
determined solely from the opcode.  There are 2 such CPLs in use right
now: SET_TCB_RPL and L2T_WRITE_RPL.  The base driver continues to send
filter and L2T_WRITEs over the mgmtq and solicits the reply on fwq.
t4_tom (including the DDP code) now uses the port's ctrlq to send
L2T_WRITEs and SET_TCB_FIELDs and solicits the reply on an ofld_rxq.
fwq and ofld_rxq have different handlers that know what kind of tid to
expect in the reply.  Update t4_write_l2e and callers to to support any
wrq/iq combination.

Approved by:	re@ (kib@)
Sponsored by:	Chelsio Communications
2016-07-05 01:29:24 +00:00