From 1570c87f81cbdb8dfdf022df1a018ab5f236d213 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 16 Aug 2018 08:51:04 -0700 Subject: [PATCH] rdma: disbale send with inval on Soft-RoCE NICs Currently, the RXE kernel driver does not support send with invalidate. There is a change to the kernel making its way downstream that will enable this feature. At that point, we can conditionally enable send-with-invalidate based on the kernel version. Change-Id: I05c7bcbf8ec944be89c10bdf6ccc3229e4586914 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/422579 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/nvmf/rdma.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/nvmf/rdma.c b/lib/nvmf/rdma.c index 9fd82e6366..472577f4c3 100644 --- a/lib/nvmf/rdma.c +++ b/lib/nvmf/rdma.c @@ -1145,9 +1145,19 @@ spdk_nvmf_rdma_request_parse_sgl(struct spdk_nvmf_rdma_transport *rtransport, return -1; } #ifdef SPDK_CONFIG_RDMA_SEND_WITH_INVAL - if (sgl->keyed.subtype == SPDK_NVME_SGL_SUBTYPE_INVALIDATE_KEY) { - rdma_req->rsp.wr.opcode = IBV_WR_SEND_WITH_INV; - rdma_req->rsp.wr.imm_data = sgl->keyed.key; + /** + * These vendor IDs are assigned by the IEEE and an ID of 0 implies Soft-RoCE. + * The Soft-RoCE RXE driver does not currently support send with invalidate. + * There are changes making their way through the kernel now that will enable + * this feature. When they are merged, we can conditionally enable this feature. + * + * todo: enable this for versions of the kernel rxe driver that support it. + */ + if (device->attr.vendor_id != 0) { + if (sgl->keyed.subtype == SPDK_NVME_SGL_SUBTYPE_INVALIDATE_KEY) { + rdma_req->rsp.wr.opcode = IBV_WR_SEND_WITH_INV; + rdma_req->rsp.wr.imm_data = sgl->keyed.key; + } } #endif