Skip to content

Commit bda65b4

Browse files
committed
Merge tag 'mlx5-4kuar-for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux
Saeed Mahameed says: ==================== mlx5 4K UAR The following series of patches optimizes the usage of the UAR area which is contained within the BAR 0-1. Previous versions of the firmware and the driver assumed each system page contains a single UAR. This patch set will query the firmware for a new capability that if published, means that the firmware can support UARs of fixed 4K regardless of system page size. In the case of powerpc, where page size equals 64KB, this means we can utilize 16 UARs per system page. Since user space processes by default consume eight UARs per context this means that with this change a process will need a single system page to fulfill that requirement and in fact make use of more UARs which is better in terms of performance. In addition to optimizing user-space processes, we introduce an allocator that can be used by kernel consumers to allocate blue flame registers (which are areas within a UAR that are used to write doorbells). This provides further optimization on using the UAR area since the Ethernet driver makes use of a single blue flame register per system page and now it will use two blue flame registers per 4K. The series also makes changes to naming conventions and now the terms used in the driver code match the terms used in the PRM (programmers reference manual). Thus, what used to be called UUAR (micro UAR) is now called BFREG (blue flame register). In order to support compatibility between different versions of library/driver/firmware, the library has now means to notify the kernel driver that it supports the new scheme and the kernel can notify the library if it supports this extension. So mixed versions of libraries can run concurrently without any issues. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents b369e7f + f502d83 commit bda65b4

File tree

17 files changed

+672
-516
lines changed

17 files changed

+672
-516
lines changed

drivers/infiniband/hw/mlx5/cq.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
689689
{
690690
struct mlx5_core_dev *mdev = to_mdev(ibcq->device)->mdev;
691691
struct mlx5_ib_cq *cq = to_mcq(ibcq);
692-
void __iomem *uar_page = mdev->priv.uuari.uars[0].map;
692+
void __iomem *uar_page = mdev->priv.uar->map;
693693
unsigned long irq_flags;
694694
int ret = 0;
695695

@@ -704,9 +704,7 @@ int mlx5_ib_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags)
704704
mlx5_cq_arm(&cq->mcq,
705705
(flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED ?
706706
MLX5_CQ_DB_REQ_NOT_SOL : MLX5_CQ_DB_REQ_NOT,
707-
uar_page,
708-
MLX5_GET_DOORBELL_LOCK(&mdev->priv.cq_uar_lock),
709-
to_mcq(ibcq)->mcq.cons_index);
707+
uar_page, to_mcq(ibcq)->mcq.cons_index);
710708

711709
return ret;
712710
}
@@ -790,7 +788,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
790788
MLX5_SET(cqc, cqc, log_page_size,
791789
page_shift - MLX5_ADAPTER_PAGE_SHIFT);
792790

793-
*index = to_mucontext(context)->uuari.uars[0].index;
791+
*index = to_mucontext(context)->bfregi.sys_pages[0];
794792

795793
if (ucmd.cqe_comp_en == 1) {
796794
if (unlikely((*cqe_size != 64) ||
@@ -886,7 +884,7 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
886884
MLX5_SET(cqc, cqc, log_page_size,
887885
cq->buf.buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT);
888886

889-
*index = dev->mdev->priv.uuari.uars[0].index;
887+
*index = dev->mdev->priv.uar->index;
890888

891889
return 0;
892890

0 commit comments

Comments
 (0)