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, 10 Feb 2020 14:09:17 +0000 (15:09 +0100)
ctdb/ib/ibw_ctdb.c
ctdb/ib/ibwrapper.c

index 38314c32ebcf87415fb9efd13c53cc4b81d4d34c..496a9f6ddf1726f2bc4db3d2ffc7b2e05bb63418 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 cf4efa579e2ee93bbc0a28e5e45e04c411a288fc..5ed0fc744f2fca3270ca16801a1ba66803455f48 100644 (file)
@@ -41,9 +41,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,
@@ -65,6 +65,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");
@@ -72,6 +73,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;
 }
 
@@ -104,6 +106,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) {