create new static method that knows to calculate this value at runtime.
(This will serve my coming commit that is going to change header fields and header size)
Signed-off-by: Avner BenHanoch <avnerb@mellanox.com>
xopt = max(cct->_conf->xio_max_send_inline, 512);
xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_XIO_DATA,
&xopt, sizeof(xopt));
- xopt = 216;
+
+ xopt = XioMsgHdr::get_max_encoded_length();
+ ldout(cct,2) << "setting accelio max header size " << xopt << dendl;
xio_set_opt(NULL, XIO_OPTLEVEL_ACCELIO, XIO_OPTNAME_MAX_INLINE_XIO_HEADER,
&xopt, sizeof(xopt));
assert(r);
return r;
}
+
+/*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);
+ 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();
+}
decode(bl_iter);
}
+ static size_t get_max_encoded_length();
+
const buffer::list& get_bl() { encode(bl); return bl; };
inline void encode_hdr(buffer::list& bl) const {