From: Ilya Dryomov Date: Thu, 30 Apr 2020 15:22:14 +0000 (+0200) Subject: msg/async/frames_v2: make rx_segments_t global X-Git-Tag: v15.2.5~164^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=446a05ec5bdf5fbaf9e203c3224cc6860ffeb72f;p=ceph.git msg/async/frames_v2: make rx_segments_t global Use it in ProtocolV2.h and later in unit tests. While at it, drop the unused len struct. Signed-off-by: Ilya Dryomov (cherry picked from commit c081f3ca94adb4814c55aeeca0c0abdbc701ece2) --- diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 2535584bb6e..2860d1e00ed 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -1908,7 +1908,7 @@ seastar::future<> ProtocolV2::read_message(utime_t throttle_stamp) // we need to get the size before std::moving segments data const size_t cur_msg_size = get_current_msg_size(); - auto msg_frame = MessageFrame::Decode(std::move(rx_segments_data)); + auto msg_frame = MessageFrame::Decode(rx_segments_data); // XXX: paranoid copy just to avoid oops ceph_msg_header2 current_header = msg_frame.header(); diff --git a/src/crimson/net/ProtocolV2.h b/src/crimson/net/ProtocolV2.h index 0e8f2ff90e8..5d2bd5e04d6 100644 --- a/src/crimson/net/ProtocolV2.h +++ b/src/crimson/net/ProtocolV2.h @@ -113,8 +113,7 @@ class ProtocolV2 final : public Protocol { ceph::crypto::onwire::rxtx_t session_stream_handlers; boost::container::static_vector rx_segments_desc; - boost::container::static_vector rx_segments_data; + ceph::msgr::v2::segment_bls_t rx_segments_data; size_t get_current_msg_size() const; seastar::future read_main_preamble(); diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 556dd13baec..9ee7195b7a5 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -1419,7 +1419,7 @@ CtPtr ProtocolV2::handle_message() { // we need to get the size before std::moving segments data const size_t cur_msg_size = get_current_msg_size(); - auto msg_frame = MessageFrame::Decode(std::move(rx_segments_data)); + auto msg_frame = MessageFrame::Decode(rx_segments_data); // XXX: paranoid copy just to avoid oops ceph_msg_header2 current_header = msg_frame.header(); diff --git a/src/msg/async/ProtocolV2.h b/src/msg/async/ProtocolV2.h index 63db5e4d876..8029e623501 100644 --- a/src/msg/async/ProtocolV2.h +++ b/src/msg/async/ProtocolV2.h @@ -98,8 +98,7 @@ private: boost::container::static_vector rx_segments_desc; - boost::container::static_vector rx_segments_data; + ceph::msgr::v2::segment_bls_t rx_segments_data; ceph::msgr::v2::Tag next_tag; utime_t backoff; // backoff time utime_t recv_stamp; diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index ddc42a489cf..68cf61a5b18 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -7,6 +7,8 @@ #include #include +#include + /** * Protocol V2 Frame Structures * @@ -673,6 +675,9 @@ protected: using ControlFrame::ControlFrame; }; +using segment_bls_t = + boost::container::static_vector; + // This class is used for encoding/decoding header of the message frame. // Body is processed almost independently with the sole junction point // being the `extra_payload_len` passed to get_buffer(). @@ -682,12 +687,6 @@ struct MessageFrame : public Frame { - struct { - uint32_t front; - uint32_t middle; - uint32_t data; - } len; - static const Tag tag = Tag::MESSAGE; static MessageFrame Encode(const ceph_msg_header2 &msg_header, @@ -705,10 +704,7 @@ struct MessageFrame : public Frame; - static MessageFrame Decode(rx_segments_t &&recv_segments) { + static MessageFrame Decode(segment_bls_t& recv_segments) { MessageFrame f; // transfer segments' bufferlists. If a MessageFrame contains less // SegmentsNumV segments, the missing ones will be seen as zeroed.