From: Ilya Dryomov Date: Mon, 4 May 2020 15:52:13 +0000 (+0200) Subject: msg/async/frames_v2: rename and clarify FRAME_FLAGS_LATEABRT X-Git-Tag: v14.2.11~8^2~9 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=46d83a2c45024cace5b6db35aa46c54f6b7542f9;p=ceph.git msg/async/frames_v2: rename and clarify FRAME_FLAGS_LATEABRT Clarify that the frame can be aborted at any point after the preamble and the first segment are put on the wire. When that happens, the remaining segments (including the data segment) may be filled with zeros. Signed-off-by: Ilya Dryomov (cherry picked from commit bc835b8bed627af89b1a0bb0f7585e0e3d531aaa) Conflicts: src/crimson/net/ProtocolV2.cc [ crimson doesn't support msgr2 in nautilus ] src/msg/async/frames_v2.h [ context: commit c70f779d12a2 ("headers: Make ceph_le member private") not in nautilus ] --- diff --git a/src/msg/async/frames_v2.cc b/src/msg/async/frames_v2.cc index 89fecac4eb96a..3c402ce4c619f 100644 --- a/src/msg/async/frames_v2.cc +++ b/src/msg/async/frames_v2.cc @@ -217,7 +217,7 @@ bool FrameAssembler::disasm_all_crc_rev0(bufferlist segment_bls[], ceph_assert(segment_bls[i].length() == m_descs[i].logical_len); check_segment_crc(segment_bls[i], epilogue->crc_values[i]); } - return !(epilogue->late_flags & FRAME_FLAGS_LATEABRT); + return !(epilogue->late_flags & FRAME_LATE_FLAG_ABORTED); } bool FrameAssembler::disasm_all_secure_rev0(bufferlist segment_bls[], @@ -235,7 +235,7 @@ bool FrameAssembler::disasm_all_secure_rev0(bufferlist segment_bls[], m_crypto->rx->authenticated_decrypt_update_final(epilogue_bl); auto epilogue = reinterpret_cast( epilogue_bl.c_str()); - return !(epilogue->late_flags & FRAME_FLAGS_LATEABRT); + return !(epilogue->late_flags & FRAME_LATE_FLAG_ABORTED); } bool FrameAssembler::disassemble_segments(bufferlist segment_bls[], diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index 2c137cfbafa6c..8e857a3372fae 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -130,13 +130,13 @@ static_assert(std::is_standard_layout::value); // conveys late_flags. The initial user of this field will be the late // frame abortion facility. struct epilogue_crc_rev0_block_t { - __u8 late_flags; + __u8 late_flags; // FRAME_LATE_FLAG_ABORTED std::array crc_values; } __attribute__((packed)); static_assert(std::is_standard_layout_v); struct epilogue_secure_rev0_block_t { - __u8 late_flags; + __u8 late_flags; // FRAME_LATE_FLAG_ABORTED __u8 padding[CRYPTO_BLOCK_SIZE - sizeof(late_flags)]; __u8 ciphers_private_data[]; @@ -144,7 +144,10 @@ struct epilogue_secure_rev0_block_t { static_assert(sizeof(epilogue_secure_rev0_block_t) % CRYPTO_BLOCK_SIZE == 0); static_assert(std::is_standard_layout_v); -#define FRAME_FLAGS_LATEABRT (1<<0) /* frame was aborted after txing data */ +// A frame can be aborted by the sender after transmitting the +// preamble and the first segment. The remainder of the frame +// is filled with zeros, up until the epilogue. +#define FRAME_LATE_FLAG_ABORTED (1<<0) struct FrameError : std::runtime_error { using runtime_error::runtime_error;