@@ -459,6 +459,18 @@ struct cifs_rdma_info* cifs_create_rdma_session(
log_rdma_event("rdma_connect connected\n");
+ sprintf(cache_name, "cifs_smbd_request_%p", info);
+ info->request_cache =
+ kmem_cache_create(
+ cache_name,
+ sizeof(struct cifs_rdma_request) +
+ sizeof(struct smbd_data_transfer),
+ 0, SLAB_HWCACHE_ALIGN, NULL);
+
+ info->request_mempool =
+ mempool_create(info->send_credit_target, mempool_alloc_slab,
+ mempool_free_slab, info->request_cache);
+
sprintf(cache_name, "cifs_smbd_response_%p", info);
info->response_cache =
kmem_cache_create(
@@ -62,6 +62,10 @@ struct cifs_rdma_info {
struct list_head receive_queue;
spinlock_t receive_queue_lock;
+ // request pool for RDMA send
+ struct kmem_cache *request_cache;
+ mempool_t *request_mempool;
+
// response pool for RDMA receive
struct kmem_cache *response_cache;
mempool_t *response_mempool;
@@ -93,6 +97,21 @@ struct smbd_data_transfer {
char buffer[0];
} __packed;
+// The context for a SMBD request
+struct cifs_rdma_request {
+ struct cifs_rdma_info *info;
+
+ // completion queue entry
+ struct ib_cqe cqe;
+
+ // the SGE entries for this packet
+ struct ib_sge *sge;
+ int num_sge;
+
+ // SMBD packet header follows this structure
+ char packet[0];
+};
+
// The context for a SMBD response
struct cifs_rdma_response {
struct cifs_rdma_info *info;