]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: drop the unnecessary connection_features member
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 20 Oct 2022 01:53:44 +0000 (09:53 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Fri, 21 Oct 2022 09:51:29 +0000 (17:51 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV2.cc
src/crimson/net/ProtocolV2.h

index da62762ac992403cbb3790ba78d06a1b531ea313..7a4e3030f863211aef540f8fe14b5b57b29461d6 100644 (file)
@@ -483,9 +483,6 @@ ProtocolV2::banner_exchange(bool is_connect)
         abort_in_close(*this, is_connect);
       }
       peer_supported_features = _peer_supported_features;
-      if (_peer_required_features == 0) {
-        this->connection_features = msgr2_required;
-      }
       bool is_rev1 = HAVE_MSGR2_FEATURE(peer_supported_features, REVISION_1);
       tx_frame_asm.set_is_rev1(is_rev1);
       rx_frame_asm.set_is_rev1(is_rev1);
@@ -711,6 +708,7 @@ ProtocolV2::client_connect()
           conn.set_peer_id(server_ident.gid());
           conn.set_features(server_ident.supported_features() &
                             conn.policy.features_supported);
+          logger().debug("{} UPDATE: features={}", conn, conn.get_features());
           peer_global_seq = server_ident.global_seq();
 
           bool lossy = server_ident.flags() & CEPH_MSG_CONNECT_LOSSY;
@@ -1076,7 +1074,7 @@ ProtocolV2::reuse_connection(
                                     peer_global_seq,
                                     client_cookie,
                                     conn.get_peer_name(),
-                                    connection_features,
+                                    conn.get_features(),
                                     peer_supported_features,
                                     conn_seq,
                                     msg_seq);
@@ -1247,9 +1245,9 @@ ProtocolV2::server_connect()
         return next_step_t::wait;
       });
     }
-    connection_features =
-        client_ident.supported_features() & conn.policy.features_supported;
-    logger().debug("{} UPDATE: connection_features={}", conn, connection_features);
+    conn.set_features(client_ident.supported_features() &
+                      conn.policy.features_supported);
+    logger().debug("{} UPDATE: features={}", conn, conn.get_features());
 
     peer_global_seq = client_ident.global_seq();
 
@@ -1657,8 +1655,6 @@ ProtocolV2::send_server_ident()
                    conn.policy.features_required | msgr2_required,
                    flags, server_cookie);
 
-    conn.set_features(connection_features);
-
     return write_frame(server_ident);
   });
 }
@@ -1741,7 +1737,7 @@ void ProtocolV2::trigger_replacing(bool reconnect,
         if (conn.get_peer_id() == entity_name_t::NEW) {
           conn.set_peer_id(new_peer_name.num());
         }
-        connection_features = new_conn_features;
+        conn.set_features(new_conn_features);
         peer_supported_features = new_peer_supported_features;
         bool is_rev1 = HAVE_MSGR2_FEATURE(peer_supported_features, REVISION_1);
         tx_frame_asm.set_is_rev1(is_rev1);
index b82df4c307054d9b0007f9c54e735f840adbe860..0f07f2d8ccdfc37a0af517a639e8526b160e1f52 100644 (file)
@@ -77,7 +77,6 @@ class ProtocolV2 final : public Protocol {
 
   void trigger_state(state_t state, write_state_t write_state, bool reentrant);
 
-  uint64_t connection_features = 0;
   uint64_t peer_supported_features = 0;
 
   uint64_t client_cookie = 0;