]> 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>
Sun, 14 Jun 2020 11:56:09 +0000 (11:56 +0000)
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>
src/crimson/net/ProtocolV2.cc
src/msg/async/frames_v2.cc
src/msg/async/frames_v2.h

index a524497d80bdb36b8798e7d8b3a5bbe599d07330..26c2f6c40993bbb050bcf7f20f54b02dd15b9e36 100644 (file)
@@ -377,7 +377,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 74c9d5ed9c7a9c27081f863aa2a1ed333ca53948..f7eea559a2a6ae8005be00cfed3b029162068a33 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;