From: Yingxin Cheng Date: Thu, 20 Oct 2022 01:53:44 +0000 (+0800) Subject: crimson/net: drop the unnecessary connection_features member X-Git-Tag: v18.1.0~967^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=96290f6639a2c1893046120bd5db337d5e6309ca;p=ceph.git crimson/net: drop the unnecessary connection_features member Signed-off-by: Yingxin Cheng --- diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index da62762ac992..7a4e3030f863 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -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); diff --git a/src/crimson/net/ProtocolV2.h b/src/crimson/net/ProtocolV2.h index b82df4c30705..0f07f2d8ccdf 100644 --- a/src/crimson/net/ProtocolV2.h +++ b/src/crimson/net/ProtocolV2.h @@ -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;