linux_dsm_epyc7002/drivers/net/ethernet/mellanox/mlx4
Or Gerlitz 08ff32352d mlx4: 64-byte CQE/EQE support
ConnectX-3 devices can use either 64- or 32-byte completion queue
entries (CQEs) and event queue entries (EQEs).  Using 64-byte
EQEs/CQEs performs better because each entry is aligned to a complete
cacheline.  This patch queries the HCA's capabilities, and if it
supports 64-byte CQEs and EQES the driver will configure the HW to
work in 64-byte mode.

The 32-byte vs 64-byte mode is global per HCA and not per CQ or EQ.

Since this mode is global, userspace (libmlx4) must be updated to work
with the configured CQE size, and guests using SR-IOV virtual
functions need to know both EQE and CQE size.

In case one of the 64-byte CQE/EQE capabilities is activated, the
patch makes sure that older guest drivers that use the QUERY_DEV_FUNC
command (e.g as done in mlx4_core of Linux 3.3..3.6) will notice that
they need an update to be able to work with the PPF. This is done by
changing the returned pf_context_behaviour not to be zero any more. In
case none of these capabilities is activated that value remains zero
and older guest drivers can run OK.

The SRIOV related flow is as follows

1. the PPF does the detection of the new capabilities using
   QUERY_DEV_CAP command.

2. the PPF activates the new capabilities using INIT_HCA.

3. the VF detects if the PPF activated the capabilities using
   QUERY_HCA, and if this is the case activates them for itself too.

Note that the VF detects that it must be aware to the new PF behaviour
using QUERY_FUNC_CAP.  Steps 1 and 2 apply also for native mode.

User space notification is done through a new field introduced in
struct mlx4_ib_ucontext which holds device capabilities for which user
space must take action. This changes the binary interface so the ABI
towards libmlx4 exposed through uverbs is bumped from 3 to 4 but only
when **needed** i.e. only when the driver does use 64-byte CQEs or
future device capabilities which must be in sync by user space. This
practice allows to work with unmodified libmlx4 on older devices (e.g
A0, B0) which don't support 64-byte CQEs.

In order to keep existing systems functional when they update to a
newer kernel that contains these changes in VF and userspace ABI, a
module parameter enable_64b_cqe_eqe must be set to enable 64-byte
mode; the default is currently false.

Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
2012-11-26 10:19:17 -08:00
..
alloc.c mlx4_core: Change bitmap allocator to work in round-robin fashion 2012-05-14 13:44:38 -07:00
catas.c mlx4: Add support for EEH error recovery 2012-07-25 15:24:13 -07:00
cmd.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
cq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00
en_cq.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
en_dcb_nl.c drivers/net: fix unresolved 64bit math in mellanox/mlx4/en_dcb_nl.c 2012-04-16 02:12:11 -04:00
en_ethtool.c net/mlx4: Move MAC_MASK to a common place 2012-07-19 08:34:37 -07:00
en_main.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
en_netdev.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
en_port.c mlx4: Ethernet port management modifications 2011-12-13 13:56:07 -05:00
en_port.h net/mlx4_core: set port QoS attributes 2012-04-05 05:08:03 -04:00
en_resources.c net/mlx4_en: Force user priority by QP attribute 2012-04-05 05:08:03 -04:00
en_rx.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
en_selftest.c mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) 2011-12-13 13:56:05 -05:00
en_tx.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
eq.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
fw.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
fw.h mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
icm.c mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
icm.h mlx4_core: Fix integer overflows so 8TBs of memory registration works 2012-09-13 17:52:02 -07:00
intf.c mlx4: Use port management change event instead of smp_snoop 2012-07-10 09:47:10 -07:00
Kconfig net/mlx4_en: DCB QoS support 2012-04-05 05:08:04 -04:00
main.c mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
Makefile net/mlx4_en: DCB QoS support 2012-04-05 05:08:04 -04:00
mcg.c net/mlx4_core: Looking for promiscuous entries on the correct port 2012-09-07 12:55:59 -04:00
mlx4_en.h mlx4: 64-byte CQE/EQE support 2012-11-26 10:19:17 -08:00
mlx4.h mlx4_core: Clean up enabling of SENSE_PORT for older (ConnectX-1/-2) HCAs 2012-10-01 02:10:44 -07:00
mr.c mlx4_core: Clean up buddy bitmap allocation 2012-08-15 21:05:27 -07:00
pd.c net/mlx4_core: Add XRC domains and counters to resource tracker 2012-05-16 00:56:59 -04:00
port.c net/mlx4_core: Adjustments to SET_PORT for IB SR-IOV 2012-09-30 20:33:40 -07:00
profile.c mlx4_core: Fix integer overflow issues around MTT table 2012-08-15 21:05:26 -07:00
qp.c mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations 2012-09-30 20:33:43 -07:00
reset.c mlx4: Use PCI Express Capability accessors 2012-08-23 10:11:13 -06:00
resource_tracker.c mlx4_core: Remove annoying debug messages from SR-IOV flow 2012-10-23 09:03:30 -07:00
sense.c Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq 2012-10-02 09:54:49 -07:00
srq.c mlx4_core: removed function index from vf. 2012-01-22 15:08:43 -05:00