]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
xio: sync to work with accellio v1.4
authorVu Pham <vu@mellanox.com>
Fri, 29 May 2015 17:32:22 +0000 (10:32 -0700)
committerVu Pham <vu@mellanox.com>
Tue, 23 Jun 2015 21:25:13 +0000 (14:25 -0700)
latest master's HEAD - tag v1-4

Signed-off-by: Vu Pham <vu@mellanox.com>
src/common/buffer.cc
src/include/buffer.h
src/messages/MDataPing.h
src/msg/xio/XioConnection.cc
src/msg/xio/XioMessenger.cc
src/msg/xio/XioMsg.h
src/msg/xio/XioPool.h
src/test/messenger/message_helper.h

index f4642b83ea07c03f8052fa88334e755c10d9721f..5124b8c50f421a2c6c96bb476bb4a9cd1cbd9763 100644 (file)
@@ -557,8 +557,8 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 
   class buffer::xio_mempool : public buffer::raw {
   public:
-    struct xio_mempool_obj *mp;
-    xio_mempool(struct xio_mempool_obj *_mp, unsigned l) :
+    struct xio_reg_mem *mp;
+    xio_mempool(struct xio_reg_mem *_mp, unsigned l) :
       raw((char*)mp->addr, l), mp(_mp)
     { }
     ~xio_mempool() {}
@@ -567,7 +567,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     }
   };
 
-  struct xio_mempool_obj* get_xio_mp(const buffer::ptr& bp)
+  struct xio_reg_mem* get_xio_mp(const buffer::ptr& bp)
   {
     buffer::xio_mempool *mb = dynamic_cast<buffer::xio_mempool*>(bp.get_raw());
     if (mb) {
index d7dbfe3f28bd1fa9178829dfdb130c05486229ae..d75ebf0d3102e1cd0be8f47ceba97ea43098e548 100644 (file)
@@ -58,7 +58,7 @@
 #endif
 
 #if defined(HAVE_XIO)
-struct xio_mempool_obj;
+struct xio_reg_mem;
 class XioDispatchHook;
 #endif
 
@@ -514,7 +514,7 @@ public:
 };
 
 #if defined(HAVE_XIO)
-xio_mempool_obj* get_xio_mp(const buffer::ptr& bp);
+xio_reg_mem* get_xio_mp(const buffer::ptr& bp);
 #endif
 
 typedef buffer::ptr bufferptr;
index 16bf4d2fb5a66da0e086f95837e9804d8d6414f3..f713dac7f766180f7e96ca35a045f3faa171a758 100644 (file)
@@ -23,10 +23,10 @@ extern "C" {
 #include "libxio.h"
 }
 #else
-struct xio_mempool_obj {};
+struct xio_reg_mem {};
 #endif /* HAVE_XIO */
 
-typedef void (*mdata_hook_func)(struct xio_mempool_obj *mp);
+typedef void (*mdata_hook_func)(struct xio_reg_mem *mp);
 
 class MDataPing : public Message {
 
@@ -38,7 +38,7 @@ class MDataPing : public Message {
   std::string tag;
   uint32_t counter;
   mdata_hook_func mdata_hook;
-  struct xio_mempool_obj mp;
+  struct xio_reg_mem mp;
   bool free_data;
 
   MDataPing()
@@ -47,7 +47,7 @@ class MDataPing : public Message {
       free_data(false)
   {}
 
-  struct xio_mempool_obj *get_mp()
+  struct xio_reg_mem *get_mp()
     {
       return &mp;
     }
index 74a0620f00f2816c6ec5f3c1a0f283270106033c..6a2ae2e1270bc4e2c870fde10032a5e3b5797b07 100644 (file)
@@ -187,7 +187,7 @@ int XioConnection::passive_setup()
 static inline XioDispatchHook* pool_alloc_xio_dispatch_hook(
   XioConnection *xcon, Message *m, XioInSeq& msg_seq)
 {
-  struct xio_mempool_obj mp_mem;
+  struct xio_reg_mem mp_mem;
   int e = xpool_alloc(xio_msgr_noreg_mpool,
                      sizeof(XioDispatchHook), &mp_mem);
   if (!!e)
index cd502cae255cbac07a6ab481a845df6c1c7b595c..ad87af181298e2342de8a146790b2eee50e6003e 100644 (file)
@@ -313,10 +313,10 @@ XioMessenger::XioMessenger(CephContext *cct, entity_name_t name,
 
       /* and set threshold for buffer callouts */
       xopt = 16384;
-      xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_DATA,
+      xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_XIO_DATA,
                  &xopt, sizeof(xopt));
       xopt = 216;
-      xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_HEADER,
+      xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_XIO_HEADER,
                  &xopt, sizeof(xopt));
 
       struct xio_mempool_config mempool_config = {
@@ -341,22 +341,22 @@ XioMessenger::XioMessenger(CephContext *cct, entity_name_t name,
        xio_mempool_create(-1 /* nodeid */,
                           XIO_MEMPOOL_FLAG_REGULAR_PAGES_ALLOC);
 
-      (void) xio_mempool_add_allocator(xio_msgr_noreg_mpool, 64,
+      (void) xio_mempool_add_slab(xio_msgr_noreg_mpool, 64,
                                       cct->_conf->xio_mp_min,
                                       cct->_conf->xio_mp_max_64,
-                                      XMSG_MEMPOOL_QUANTUM);
-      (void) xio_mempool_add_allocator(xio_msgr_noreg_mpool, 256,
+                                      XMSG_MEMPOOL_QUANTUM, 0);
+      (void) xio_mempool_add_slab(xio_msgr_noreg_mpool, 256,
                                       cct->_conf->xio_mp_min,
                                       cct->_conf->xio_mp_max_256,
-                                      XMSG_MEMPOOL_QUANTUM);
-      (void) xio_mempool_add_allocator(xio_msgr_noreg_mpool, 1024,
+                                      XMSG_MEMPOOL_QUANTUM, 0);
+      (void) xio_mempool_add_slab(xio_msgr_noreg_mpool, 1024,
                                       cct->_conf->xio_mp_min,
                                       cct->_conf->xio_mp_max_1k,
-                                      XMSG_MEMPOOL_QUANTUM);
-      (void) xio_mempool_add_allocator(xio_msgr_noreg_mpool, getpagesize(),
+                                      XMSG_MEMPOOL_QUANTUM, 0);
+      (void) xio_mempool_add_slab(xio_msgr_noreg_mpool, getpagesize(),
                                       cct->_conf->xio_mp_min,
                                       cct->_conf->xio_mp_max_page,
-                                      XMSG_MEMPOOL_QUANTUM);
+                                      XMSG_MEMPOOL_QUANTUM, 0);
 
       /* initialize ops singleton */
       xio_msgr_ops.on_session_event = on_session_event;
@@ -388,9 +388,9 @@ int XioMessenger::pool_hint(uint32_t dsize) {
     return 0;
 
   /* if dsize is already present, returns -EEXIST */
-  return xio_mempool_add_allocator(xio_msgr_noreg_mpool, dsize, 0,
+  return xio_mempool_add_slab(xio_msgr_noreg_mpool, dsize, 0,
                                   cct->_conf->xio_mp_max_hint,
-                                  XMSG_MEMPOOL_QUANTUM);
+                                  XMSG_MEMPOOL_QUANTUM, 0);
 }
 
 void XioMessenger::learned_addr(const entity_addr_t &peer_addr_for_me)
@@ -661,7 +661,7 @@ xio_place_buffers(buffer::list& bl, XioMsg *xmsg, struct xio_msg*& req,
       //break;
     default:
     {
-      struct xio_mempool_obj *mp = get_xio_mp(*pb);
+      struct xio_reg_mem *mp = get_xio_mp(*pb);
       iov->mr = (mp) ? mp->mr : NULL;
     }
       break;
@@ -777,7 +777,7 @@ int XioMessenger::_send_message(Message *m, const entity_inst_t& dest)
 static inline XioMsg* pool_alloc_xio_msg(Message *m, XioConnection *xcon,
   int ex_cnt)
 {
-  struct xio_mempool_obj mp_mem;
+  struct xio_reg_mem mp_mem;
   int e = xpool_alloc(xio_msgr_noreg_mpool, sizeof(XioMsg), &mp_mem);
   if (!!e)
     return NULL;
@@ -1073,7 +1073,7 @@ void XioMessenger::mark_down_all()
 static inline XioMarkDownHook* pool_alloc_markdown_hook(
   XioConnection *xcon, Message *m)
 {
-  struct xio_mempool_obj mp_mem;
+  struct xio_reg_mem mp_mem;
   int e = xio_mempool_alloc(xio_msgr_noreg_mpool,
                            sizeof(XioMarkDownHook), &mp_mem);
   if (!!e)
index 21bb62cc2a2eab5f76b30105b8c201fdac9b0de0..68d8ebe05afdd1bf40d706b22f75d064168feed6 100644 (file)
@@ -183,11 +183,11 @@ public:
   XioMsgHdr hdr;
   xio_msg_ex req_0;
   xio_msg_ex* req_arr;
-  struct xio_mempool_obj mp_this;
+  struct xio_reg_mem mp_this;
   atomic_t nrefs;
 
 public:
-  XioMsg(Message *_m, XioConnection *_xcon, struct xio_mempool_obj& _mp,
+  XioMsg(Message *_m, XioConnection *_xcon, struct xio_reg_mem& _mp,
         int _ex_cnt) :
     XioSubmit(XioSubmit::OUTGOING_MSG, _xcon),
     m(_m), hdr(m->get_header(), m->get_footer()),
@@ -215,7 +215,7 @@ public:
   void put(int n) {
     int refs = nrefs.sub(n);
     if (refs == 0) {
-      struct xio_mempool_obj *mp = &this->mp_this;
+      struct xio_reg_mem *mp = &this->mp_this;
       this->~XioMsg();
       xpool_free(sizeof(XioMsg), mp);
     }
@@ -281,10 +281,10 @@ private:
   friend class XioConnection;
   friend class XioMessenger;
 public:
-  struct xio_mempool_obj mp_this;
+  struct xio_reg_mem mp_this;
 
   XioDispatchHook(XioConnection *_xcon, Message *_m, XioInSeq& _msg_seq,
-                   struct xio_mempool_obj& _mp) :
+                   struct xio_reg_mem& _mp) :
     CompletionHook(_m),
     xcon(_xcon->get()),
     msg_seq(_msg_seq),
@@ -319,7 +319,7 @@ public:
        */
       if (!cl_flag && release_msgs())
        return;
-      struct xio_mempool_obj *mp = &this->mp_this;
+      struct xio_reg_mem *mp = &this->mp_this;
       this->~XioDispatchHook();
       xpool_free(sizeof(XioDispatchHook), mp);
     }
@@ -351,10 +351,10 @@ private:
   XioConnection* xcon;
 
 public:
-  struct xio_mempool_obj mp_this;
+  struct xio_reg_mem mp_this;
 
   XioMarkDownHook(
-    XioConnection* _xcon, Message *_m, struct xio_mempool_obj& _mp) :
+    XioConnection* _xcon, Message *_m, struct xio_reg_mem& _mp) :
     CompletionHook(_m), xcon(_xcon->get()), mp_this(_mp)
     { }
 
@@ -362,7 +362,7 @@ public:
 
   virtual void finish(int r) {
     xcon->put();
-    struct xio_mempool_obj *mp = &this->mp_this;
+    struct xio_reg_mem *mp = &this->mp_this;
     this->~XioMarkDownHook();
     xio_mempool_free(mp);
   }
index 2df24b07195a1b4d2e55678ccaef516f390ce95f..cd74803eae08146839377319b64a3ab0f2ad1c53 100644 (file)
@@ -26,8 +26,8 @@ extern "C" {
 
 
 static inline int xpool_alloc(struct xio_mempool *pool, uint64_t size,
-                             struct xio_mempool_obj* mp);
-static inline void xpool_free(uint64_t size, struct xio_mempool_obj* mp);
+                             struct xio_reg_mem* mp);
+static inline void xpool_free(uint64_t size, struct xio_reg_mem* mp);
 
 using ceph::atomic_t;
 
@@ -42,7 +42,7 @@ public:
   static const int MB = 8;
 
   struct xio_piece {
-    struct xio_mempool_obj mp[1];
+    struct xio_reg_mem mp[1];
     struct xio_piece *next;
     int s;
     char payload[MB];
@@ -66,7 +66,7 @@ public:
   void *alloc(size_t _s)
     {
        void *r;
-       struct xio_mempool_obj mp[1];
+       struct xio_reg_mem mp[1];
        struct xio_piece *x;
        int e = xpool_alloc(handle, (sizeof(struct xio_piece)-MB) + _s, mp);
        if (e) {
@@ -197,7 +197,7 @@ public:
 extern XioPoolStats xp_stats;
 
 static inline int xpool_alloc(struct xio_mempool *pool, uint64_t size,
-                             struct xio_mempool_obj* mp)
+                             struct xio_reg_mem* mp)
 {
   // try to allocate from the xio pool
   int r = xio_mempool_alloc(pool, size, mp);
@@ -215,7 +215,7 @@ static inline int xpool_alloc(struct xio_mempool *pool, uint64_t size,
   return 0;
 }
 
-static inline void xpool_free(uint64_t size, struct xio_mempool_obj* mp)
+static inline void xpool_free(uint64_t size, struct xio_reg_mem* mp)
 {
   if (mp->length) {
     if (unlikely(XioPool::trace_mempool))
index cac19445dd5d4a10d212cc8fbf3be473302997c6..769c9b4a4187256ed5404bc2452c0263229fa664 100644 (file)
@@ -47,7 +47,7 @@ static inline Message* new_ping_monstyle(const char *tag, int mult)
 #if defined(HAVE_XIO)
 extern struct xio_mempool *xio_msgr_mpool;
 
-void xio_hook_func(struct xio_mempool_obj *mp)
+void xio_hook_func(struct xio_reg_mem *mp)
 {
   xio_mempool_free(mp);
 }
@@ -63,7 +63,7 @@ static inline Message* new_ping_with_data(const char *tag, uint32_t size)
   bufferlist bl;
   void *p;
 
-  struct xio_mempool_obj *mp = m->get_mp();
+  struct xio_reg_mem *mp = m->get_mp();
   int e = xio_mempool_alloc(xio_msgr_mpool, size, mp);
   assert(e == 0);
   p = mp->addr;