mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/pvrdma: Remove max-sge command-line param
This parameter has no effect, fix it. The function init_dev_caps sets the front-end's max-sge to MAX_SGE. Then it checks backend's max-sge and adjust it accordingly (we can't send more than what the device supports). On send and recv we need to make sure the num_sge in the WQE does not exceeds the backend device capability. This check is done in pvrdma level so check on rdma level is deleted. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Message-Id: <20190109194123.3468-1-yuval.shaia@oracle.com> Reviewed-by: Marcel Apfelbaum<marcel.apfelbaum@gmail.com> Signed-off-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
This commit is contained in:
parent
5a301bb9f1
commit
ffef47754a
5 changed files with 42 additions and 27 deletions
|
@ -32,17 +32,6 @@
|
|||
#include "rdma_rm.h"
|
||||
#include "rdma_backend.h"
|
||||
|
||||
/* Vendor Errors */
|
||||
#define VENDOR_ERR_FAIL_BACKEND 0x201
|
||||
#define VENDOR_ERR_TOO_MANY_SGES 0x202
|
||||
#define VENDOR_ERR_NOMEM 0x203
|
||||
#define VENDOR_ERR_QP0 0x204
|
||||
#define VENDOR_ERR_INV_NUM_SGE 0x205
|
||||
#define VENDOR_ERR_MAD_SEND 0x206
|
||||
#define VENDOR_ERR_INVLKEY 0x207
|
||||
#define VENDOR_ERR_MR_SMALL 0x208
|
||||
#define VENDOR_ERR_INV_MAD_BUFF 0x209
|
||||
|
||||
#define THR_NAME_LEN 16
|
||||
#define THR_POLL_TO 5000
|
||||
|
||||
|
@ -475,11 +464,6 @@ void rdma_backend_post_send(RdmaBackendDev *backend_dev,
|
|||
}
|
||||
|
||||
pr_dbg("num_sge=%d\n", num_sge);
|
||||
if (!num_sge || num_sge > MAX_SGE) {
|
||||
pr_dbg("invalid num_sge=%d\n", num_sge);
|
||||
complete_work(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_NUM_SGE, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
bctx = g_malloc0(sizeof(*bctx));
|
||||
bctx->up_ctx = ctx;
|
||||
|
@ -602,11 +586,6 @@ void rdma_backend_post_recv(RdmaBackendDev *backend_dev,
|
|||
}
|
||||
|
||||
pr_dbg("num_sge=%d\n", num_sge);
|
||||
if (!num_sge || num_sge > MAX_SGE) {
|
||||
pr_dbg("invalid num_sge=%d\n", num_sge);
|
||||
complete_work(IBV_WC_GENERAL_ERR, VENDOR_ERR_INV_NUM_SGE, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
bctx = g_malloc0(sizeof(*bctx));
|
||||
bctx->up_ctx = ctx;
|
||||
|
@ -942,6 +921,8 @@ static int init_device_caps(RdmaBackendDev *backend_dev,
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
dev_attr->max_sge = MAX_SGE;
|
||||
|
||||
CHK_ATTR(dev_attr, backend_dev->dev_attr, max_mr_size, "%" PRId64);
|
||||
CHK_ATTR(dev_attr, backend_dev->dev_attr, max_qp, "%d");
|
||||
CHK_ATTR(dev_attr, backend_dev->dev_attr, max_sge, "%d");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue