HACK ctdb/ib
authorStefan Metzmacher <metze@samba.org>
Tue, 20 May 2014 07:00:17 +0000 (09:00 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 11:30:07 +0000 (12:30 +0100)
ctdb/ib/ibw_ctdb.c
ctdb/ib/ibwrapper.c

index 458646faae0904265101900472c8fcfb9dc89864..9b50d5c1218be1869e7b98adfd1b146f904c80b6 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "ibwrapper.h"
 #include "ibw_ctdb.h"
+#include "lib/util/dlinklist.h"
 
 int ctdb_ibw_get_address(struct ctdb_context *ctdb,
        const char *address, struct in_addr *addr)
index 5ca3b946f00f371bd8a6a0cd4eadcfe09fa14d9b..01e17ab233cb17ccc0f89c5459c95d77bb49134a 100644 (file)
@@ -42,9 +42,9 @@
 #define IBW_LASTERR_BUFSIZE 512
 static char ibw_lasterr[IBW_LASTERR_BUFSIZE];
 
-#define IBW_MAX_SEND_WR 256
-#define IBW_MAX_RECV_WR 1024
-#define IBW_RECV_BUFSIZE 256
+#define IBW_MAX_SEND_WR 16
+#define IBW_MAX_RECV_WR 16
+#define IBW_RECV_BUFSIZE 64
 #define IBW_RECV_THRESHOLD (1 * 1024 * 1024)
 
 static void ibw_event_handler_verbs(struct tevent_context *ev,
@@ -66,6 +66,7 @@ static void *ibw_alloc_mr(struct ibw_ctx_priv *pctx, struct ibw_conn_priv *pconn
                return NULL;
        }
 
+       DEBUG(DEBUG_DEBUG, ("2 ibw_alloc_mr(cmid=%p, n=%u)\n", pconn->cm_id, n));
        *ppmr = ibv_reg_mr(pconn->pd, buf, n, IBV_ACCESS_LOCAL_WRITE);
        if (!*ppmr) {
                sprintf(ibw_lasterr, "couldn't allocate mr\n");
@@ -73,6 +74,7 @@ static void *ibw_alloc_mr(struct ibw_ctx_priv *pctx, struct ibw_conn_priv *pconn
                return NULL;
        }
 
+       DEBUG(DEBUG_DEBUG, ("3 ibw_alloc_mr(cmid=%p, n=%u)\n", pconn->cm_id, n));
        return buf;
 }
 
@@ -105,6 +107,13 @@ static int ibw_init_memory(struct ibw_conn *conn)
                return -1;
        }
 
+       pconn->buf_recv = ibw_alloc_mr(pctx, pconn,
+               opts->max_send_wr * opts->recv_bufsize, &pconn->mr_send);
+       if (!pconn->buf_send) {
+               sprintf(ibw_lasterr, "METZEcouldn't allocate work send buf\n");
+               return -1;
+       }
+
        pconn->buf_recv = ibw_alloc_mr(pctx, pconn,
                opts->max_recv_wr * opts->recv_bufsize, &pconn->mr_recv);
        if (!pconn->buf_recv) {