Commit 556c811f authored by Gal Pressman's avatar Gal Pressman Committed by Jason Gunthorpe

RDMA/efa: Expose maximum TX doorbell batch

The device reports the maximum number of bytes to be written before
ringing the doorbell (zero means unlimited).

This patch queries the max batch size and reports it back to the userspace
library.

Link: https://lore.kernel.org/r/20200722140312.3651-2-galpress@amazon.comReviewed-by: default avatarDaniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: default avatarFiras JahJah <firasj@amazon.com>
Signed-off-by: default avatarGal Pressman <galpress@amazon.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent c804af2c
...@@ -632,6 +632,17 @@ struct efa_admin_feature_queue_attr_desc { ...@@ -632,6 +632,17 @@ struct efa_admin_feature_queue_attr_desc {
/* Maximum number of SGEs for a single RDMA read WQE */ /* Maximum number of SGEs for a single RDMA read WQE */
u16 max_wr_rdma_sges; u16 max_wr_rdma_sges;
/*
* Maximum number of bytes that can be written to SQ between two
* consecutive doorbells (in units of 64B). Driver must ensure that only
* complete WQEs are written to queue before issuing a doorbell.
* Examples: max_tx_batch=16 and WQE size = 64B, means up to 16 WQEs can
* be written to SQ between two consecutive doorbells. max_tx_batch=11
* and WQE size = 128B, means up to 5 WQEs can be written to SQ between
* two consecutive doorbells. Zero means unlimited.
*/
u16 max_tx_batch;
}; };
struct efa_admin_feature_aenq_desc { struct efa_admin_feature_aenq_desc {
......
...@@ -480,6 +480,7 @@ int efa_com_get_device_attr(struct efa_com_dev *edev, ...@@ -480,6 +480,7 @@ int efa_com_get_device_attr(struct efa_com_dev *edev,
result->max_llq_size = resp.u.queue_attr.max_llq_size; result->max_llq_size = resp.u.queue_attr.max_llq_size;
result->sub_cqs_per_cq = resp.u.queue_attr.sub_cqs_per_cq; result->sub_cqs_per_cq = resp.u.queue_attr.sub_cqs_per_cq;
result->max_wr_rdma_sge = resp.u.queue_attr.max_wr_rdma_sges; result->max_wr_rdma_sge = resp.u.queue_attr.max_wr_rdma_sges;
result->max_tx_batch = resp.u.queue_attr.max_tx_batch;
err = efa_com_get_feature(edev, &resp, EFA_ADMIN_NETWORK_ATTR); err = efa_com_get_feature(edev, &resp, EFA_ADMIN_NETWORK_ATTR);
if (err) { if (err) {
......
...@@ -127,6 +127,7 @@ struct efa_com_get_device_attr_result { ...@@ -127,6 +127,7 @@ struct efa_com_get_device_attr_result {
u16 max_sq_sge; u16 max_sq_sge;
u16 max_rq_sge; u16 max_rq_sge;
u16 max_wr_rdma_sge; u16 max_wr_rdma_sge;
u16 max_tx_batch;
u8 db_bar; u8 db_bar;
}; };
......
...@@ -1525,6 +1525,7 @@ int efa_alloc_ucontext(struct ib_ucontext *ibucontext, struct ib_udata *udata) ...@@ -1525,6 +1525,7 @@ int efa_alloc_ucontext(struct ib_ucontext *ibucontext, struct ib_udata *udata)
resp.sub_cqs_per_cq = dev->dev_attr.sub_cqs_per_cq; resp.sub_cqs_per_cq = dev->dev_attr.sub_cqs_per_cq;
resp.inline_buf_size = dev->dev_attr.inline_buf_size; resp.inline_buf_size = dev->dev_attr.inline_buf_size;
resp.max_llq_size = dev->dev_attr.max_llq_size; resp.max_llq_size = dev->dev_attr.max_llq_size;
resp.max_tx_batch = dev->dev_attr.max_tx_batch;
if (udata && udata->outlen) { if (udata && udata->outlen) {
err = ib_copy_to_udata(udata, &resp, err = ib_copy_to_udata(udata, &resp,
......
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */ /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
/* /*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All rights reserved. * Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All rights reserved.
*/ */
#ifndef EFA_ABI_USER_H #ifndef EFA_ABI_USER_H
...@@ -31,6 +31,8 @@ struct efa_ibv_alloc_ucontext_resp { ...@@ -31,6 +31,8 @@ struct efa_ibv_alloc_ucontext_resp {
__u16 sub_cqs_per_cq; __u16 sub_cqs_per_cq;
__u16 inline_buf_size; __u16 inline_buf_size;
__u32 max_llq_size; /* bytes */ __u32 max_llq_size; /* bytes */
__u16 max_tx_batch; /* units of 64 bytes */
__u8 reserved_90[6];
}; };
struct efa_ibv_alloc_pd_resp { struct efa_ibv_alloc_pd_resp {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment