nvmf/vfio-user: several code cleanup

Change-Id: Iba94148599c8b82827f38a7b9badc1b13713031e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8814
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Changpeng Liu 2021-07-19 23:46:07 +08:00 committed by Tomasz Zawadzki
parent 64b6b8e30f
commit 111851efbb

View File

@ -1564,14 +1564,6 @@ nvmf_vfio_user_prop_req_rsp(struct nvmf_vfio_user_req *req, void *cb_arg)
return 0;
}
/*
* XXX Do NOT remove, see comment in access_bar0_fn.
*
* Handles a write at offset 0x1000 or more.
*
* DSTRD is set to fixed value 0 for NVMf.
*
*/
static int
handle_dbl_access(struct nvmf_vfio_user_ctrlr *ctrlr, uint32_t *buf,
const size_t count, loff_t pos, const bool is_write)
@ -1599,10 +1591,6 @@ handle_dbl_access(struct nvmf_vfio_user_ctrlr *ctrlr, uint32_t *buf,
pos >>= 2;
if (pos > NVMF_VFIO_USER_DEFAULT_MAX_QPAIRS_PER_CTRLR * 2) {
/*
* TODO: need to emit a "Write to Invalid Doorbell Register"
* asynchronous event
*/
SPDK_ERRLOG("%s: bad doorbell index %#lx\n", ctrlr_id(ctrlr), pos);
errno = EINVAL;
return -1;
@ -1647,7 +1635,6 @@ access_bar0_fn(vfu_ctx_t *vfu_ctx, char *buf, size_t count, loff_t pos,
if (ret == 0) {
return count;
}
assert(errno != 0);
return ret;
}
@ -2668,13 +2655,6 @@ nvmf_vfio_user_qpair_poll(struct nvmf_vfio_user_qpair *qpair)
}
}
/*
* Called unconditionally, periodically, very frequently from SPDK to ask
* whether there's work to be done. This function consumes requests generated
* from read/write_bar0 by setting ctrlr->prop_req.dir. read_bar0, and
* occasionally write_bar0 -- though this may change, synchronously wait. This
* function also consumes requests by looking at the doorbells.
*/
static int
nvmf_vfio_user_poll_group_poll(struct spdk_nvmf_transport_poll_group *group)
{