]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async/frames_v2: rename and clarify FRAME_FLAGS_LATEABRT
authorIlya Dryomov <idryomov@gmail.com>
Mon, 4 May 2020 15:52:13 +0000 (17:52 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 23 Jun 2020 07:21:44 +0000 (09:21 +0200)
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 <idryomov@gmail.com>
(cherry picked from commit bc835b8bed627af89b1a0bb0f7585e0e3d531aaa)

src/crimson/net/ProtocolV2.cc
src/msg/async/frames_v2.cc
src/msg/async/frames_v2.h

index 390f8bffa1bf92a35e048f3fc02aca1f10a8f037..d942a761d67c9178f391f0d9bc023728f98b72fe 100644 (file)
@@ -403,7 +403,7 @@ seastar::future<> ProtocolV2::read_frame_payload()
     // we do have a mechanism that allows transmitter to start sending message
     // and abort after putting entire data field on wire. This will be used by
     // the kernel client to avoid unnecessary buffering.
-    if (late_flags & FRAME_FLAGS_LATEABRT) {
+    if (late_flags & FRAME_LATE_FLAG_ABORTED) {
       // TODO
       ceph_assert(false);
     }
index bb292d0cf5085f6dce584908c1013fe6924cbb88..7711cc8d292c3aa3c9b57ad7d9985ab3b1950e06 100644 (file)
@@ -215,7 +215,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[],
@@ -233,7 +233,7 @@ bool FrameAssembler::disasm_all_secure_rev0(bufferlist segment_bls[],
   m_crypto->rx->authenticated_decrypt_update_final(epilogue_bl);
   auto epilogue = reinterpret_cast<const epilogue_secure_rev0_block_t*>(
       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[],
index 07ce8f55a55b10441076e3b4dc30bf104bf1af41..2f61eb9e20a9ba4f8ab1d9a7a760d31c290ad4c2 100644 (file)
@@ -130,13 +130,13 @@ static_assert(std::is_standard_layout<preamble_block_t>::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
   ceph_le32 crc_values[MAX_NUM_SEGMENTS];
 } __attribute__((packed));
 static_assert(std::is_standard_layout_v<epilogue_crc_rev0_block_t>);
 
 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<epilogue_secure_rev0_block_t>);
 
-#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;