Commit 0eed07d6 authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

Default alignment should be always 8 regardless of CPU architecture

parent 66dce580
diff -uNr ceph-15.2.4/src/msg/async/frames_v2.h ceph-15.2.4-fix_v2_frame/src/msg/async/frames_v2.h diff -uNr ceph-15.2.4/src/msg/async/frames_v2.h ceph-15.2.4-fix_v2_frame/src/msg/async/frames_v2.h
--- ceph-15.2.4/src/msg/async/frames_v2.h 2020-07-01 01:10:51.000000000 +0930 --- ceph-15.2.4/src/msg/async/frames_v2.h 2020-07-01 01:10:51.000000000 +0930
+++ ceph-15.2.4-fix_v2_frame/src/msg/async/frames_v2.h 2021-08-11 22:28:55.126810164 +0930 +++ ceph-15.2.4-fix_v2_frame/src/msg/async/frames_v2.h 2021-08-14 10:06:23.517830235 +0930
@@ -68,20 +68,20 @@ @@ -60,7 +60,7 @@
// We need them because of the rx_buffers zero-copy optimization.
static constexpr __u16 PAGE_SIZE_ALIGNMENT = 4096;
struct SegmentIndex { - static constexpr __u16 DEFAULT_ALIGNMENT = sizeof(void *);
struct Msg { + static constexpr __u16 DEFAULT_ALIGNMENT = 8;
- static constexpr std::size_t HEADER = 0;
- static constexpr std::size_t FRONT = 1;
- static constexpr std::size_t MIDDLE = 2;
- static constexpr std::size_t DATA = 3;
+ static constexpr std::uint64_t HEADER = 0;
+ static constexpr std::uint64_t FRONT = 1;
+ static constexpr std::uint64_t MIDDLE = 2;
+ static constexpr std::uint64_t DATA = 3;
};
struct Control { ceph_le32 length;
- static constexpr std::size_t PAYLOAD = 0; ceph_le16 alignment;
+ static constexpr std::uint64_t PAYLOAD = 0;
};
};
static constexpr uint8_t CRYPTO_BLOCK_SIZE { 16 };
-static constexpr std::size_t MAX_NUM_SEGMENTS = 4;
+static constexpr std::uint64_t MAX_NUM_SEGMENTS = 4;
// V2 preamble consists of one or more preamble blocks depending on
// the number of segments a particular frame needs. Each block holds
@@ -166,7 +166,7 @@
template <class T, uint16_t... SegmentAlignmentVs>
struct Frame {
- static constexpr size_t SegmentsNumV = sizeof...(SegmentAlignmentVs);
+ static constexpr uint64_t SegmentsNumV = sizeof...(SegmentAlignmentVs);
static_assert(SegmentsNumV > 0 && SegmentsNumV <= MAX_NUM_SEGMENTS);
protected:
std::array<ceph::bufferlist, SegmentsNumV> segments;
@@ -227,7 +227,7 @@
reinterpret_cast<const char *>(&main_preamble));
}
- template <size_t... Is>
+ template <uint64_t... Is>
void reset_tx_handler(
ceph::crypto::onwire::rxtx_t &session_stream_handlers,
std::index_sequence<Is...>)
@@ -349,13 +349,13 @@
}
}
- template <std::size_t... Is>
+ template <std::uint64_t... Is>
inline void _decode_payload(bufferlist::const_iterator &ti,
std::index_sequence<Is...>) const {
(_decode_payload_each((Args &)std::get<Is>(_values), ti), ...);
}
- template <std::size_t N>
+ template <std::uint64_t N>
inline decltype(auto) get_val() {
return std::get<N>(_values);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment