RDMA/efa: CQ notifications
authorGal Pressman <galpress@amazon.com>
Sun, 3 Oct 2021 10:56:04 +0000 (13:56 +0300)
committerJason Gunthorpe <jgg@nvidia.com>
Wed, 6 Oct 2021 22:47:18 +0000 (19:47 -0300)
commit2a152512a155aaf27c3e67834ffafaed9525a7b5
tree104157c0a2e48a9b90b764748a6f1d143a72ef82
parent115fda3509e782c376467e43f9d490b7f7884daa
RDMA/efa: CQ notifications

This patch adds support for CQ notifications through the standard verbs
api.

In order to achieve that, a new event queue (EQ) object is introduced,
which is in charge of reporting completion events to the driver.  On
driver load, EQs are allocated and their affinity is set to a single
cpu. When a user app creates a CQ with a completion channel, the
completion vector number is converted to a EQ number, which is in charge
of reporting the CQ events.

In addition, the CQ creation admin command now returns an offset for the
CQ doorbell, which is mapped to the userspace provider and is used to arm
the CQ when requested by the user.

The EQs use a single doorbell (located on the registers BAR), which
encodes the EQ number and arm as part of the doorbell value.  The EQs are
polled by the driver on each new EQE, and arm it when the poll is
completed.

Link: https://lore.kernel.org/r/20211003105605.29222-1-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/efa/efa.h
drivers/infiniband/hw/efa/efa_admin_cmds_defs.h
drivers/infiniband/hw/efa/efa_admin_defs.h
drivers/infiniband/hw/efa/efa_com.c
drivers/infiniband/hw/efa/efa_com.h
drivers/infiniband/hw/efa/efa_com_cmd.c
drivers/infiniband/hw/efa/efa_com_cmd.h
drivers/infiniband/hw/efa/efa_main.c
drivers/infiniband/hw/efa/efa_regs_defs.h
drivers/infiniband/hw/efa/efa_verbs.c
include/uapi/rdma/efa-abi.h