Merge pull request #9636 from linuxbox2/xio-entity

msg/xio: fix entity_addr_t encoding
This commit is contained in:
Matt Benjamin 2016-06-10 16:33:21 -04:00 committed by GitHub
commit 37b20e0f59
4 changed files with 15 additions and 9 deletions

View File

@ -275,7 +275,7 @@ else(ALLOCATOR)
else()
message(WARNING "tcmalloc and jemalloc not found, falling back to libc")
set(ALLOCATOR "libc")
endif(NOT Tcmalloc_FOUND AND NOT JEMALLOC_FOUND)
endif(Tcmalloc_FOUND)
endif(ALLOCATOR)
find_package(keyutils REQUIRED)

View File

@ -775,7 +775,9 @@ static inline XioMsg* pool_alloc_xio_msg(Message *m, XioConnection *xcon,
return NULL;
XioMsg *xmsg = reinterpret_cast<XioMsg*>(mp_mem.addr);
assert(!!xmsg);
new (xmsg) XioMsg(m, xcon, mp_mem, ex_cnt);
new (xmsg) XioMsg(m, xcon, mp_mem, ex_cnt,
static_cast<XioMessenger*>(
xcon->get_messenger())->local_features);
return xmsg;
}

View File

@ -38,7 +38,7 @@ int XioDispatchHook::release_msgs()
/*static*/ size_t XioMsgHdr::get_max_encoded_length() {
ceph_msg_header _ceph_msg_header;
ceph_msg_footer _ceph_msg_footer;
XioMsgHdr hdr (_ceph_msg_header, _ceph_msg_footer);
XioMsgHdr hdr (_ceph_msg_header, _ceph_msg_footer, 0 /* features */);
const std::list<buffer::ptr>& hdr_buffers = hdr.get_bl().buffers();
assert(hdr_buffers.size() == 1); /* accelio header is small without scatter gather */
return hdr_buffers.begin()->length();

View File

@ -28,6 +28,8 @@ extern "C" {
namespace bi = boost::intrusive;
class XioMessenger;
class XioMsgCnt
{
public:
@ -51,10 +53,12 @@ public:
entity_addr_t addr; /* XXX hack! */
ceph_msg_header* hdr;
ceph_msg_footer* ftr;
uint64_t features;
buffer::list bl;
public:
XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer& _ftr)
: tag(CEPH_MSGR_TAG_MSG), msg_cnt(0), hdr(&_hdr), ftr(&_ftr)
XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer& _ftr, uint64_t _features)
: tag(CEPH_MSGR_TAG_MSG), msg_cnt(0), hdr(&_hdr), ftr(&_ftr),
features(_features)
{ }
XioMsgHdr(ceph_msg_header& _hdr, ceph_msg_footer &_ftr, buffer::ptr p)
@ -69,11 +73,11 @@ public:
const buffer::list& get_bl() { encode(bl); return bl; };
inline void encode_hdr(buffer::list& bl) const {
inline void encode_hdr(ceph::buffer::list& bl) const {
::encode(tag, bl);
::encode(msg_cnt, bl);
::encode(peer_type, bl);
::encode(addr, bl);
::encode(addr, bl, features);
::encode(hdr->seq, bl);
::encode(hdr->tid, bl);
::encode(hdr->type, bl);
@ -248,9 +252,9 @@ public:
public:
XioMsg(Message *_m, XioConnection *_xcon, struct xio_reg_mem& _mp,
int _ex_cnt) :
int _ex_cnt, uint64_t _features) :
XioSend(_xcon, _mp, _ex_cnt),
m(_m), hdr(m->get_header(), m->get_footer()),
m(_m), hdr(m->get_header(), m->get_footer(), _features),
req_arr(NULL)
{
const entity_inst_t &inst = xcon->get_messenger()->get_myinst();