From patchwork Tue Jun 11 16:55:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 1114120 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45Nbl26rhZz9sNf for ; Wed, 12 Jun 2019 02:57:02 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 940E1DD6; Tue, 11 Jun 2019 16:55:34 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id C6FDEDAC for ; Tue, 11 Jun 2019 16:55:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3271E887 for ; Tue, 11 Jun 2019 16:55:31 +0000 (UTC) X-Originating-IP: 66.170.99.95 Received: from sigill.benpfaff.org (unknown [66.170.99.95]) (Authenticated sender: blp@ovn.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id CBEDC1BF20A; Tue, 11 Jun 2019 16:55:29 +0000 (UTC) From: Ben Pfaff To: dev@openvswitch.org Date: Tue, 11 Jun 2019 09:55:15 -0700 Message-Id: <20190611165516.16083-3-blp@ovn.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190611165516.16083-1-blp@ovn.org> References: <20190611165516.16083-1-blp@ovn.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_FILL_THIS_FORM_SHORT autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ben Pfaff Subject: [ovs-dev] [PATCH v2 2/3] rconn: Remove write-only struct members. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Ben Pfaff Acked-by: Ilya Maximets --- lib/rconn.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/lib/rconn.c b/lib/rconn.c index a5b31d099efd..ba95bb3a1a61 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -118,12 +118,6 @@ struct rconn { bool probably_admitted; time_t last_admitted; - /* These values are simply for statistics reporting, not used directly by - * anything internal to the rconn (or ofproto for that matter). */ - unsigned int n_attempted_connections, n_successful_connections; - time_t creation_time; - unsigned long int total_time_connected; - /* Throughout this file, "probe" is shorthand for "inactivity probe". When * no activity has been observed from the peer for a while, we send out an * echo request as an inactivity probe packet. We should receive back a @@ -272,11 +266,6 @@ rconn_create(int probe_interval, int max_backoff, uint8_t dscp, rc->probably_admitted = false; rc->last_admitted = time_now(); - rc->n_attempted_connections = 0; - rc->n_successful_connections = 0; - rc->creation_time = time_now(); - rc->total_time_connected = 0; - rc->last_activity = time_now(); rconn_set_probe_interval(rc, probe_interval); @@ -468,7 +457,6 @@ reconnect(struct rconn *rc) if (rconn_logging_connection_attempts__(rc)) { VLOG_INFO("%s: connecting...", rc->name); } - rc->n_attempted_connections++; retval = vconn_open(rc->target, rc->allowed_versions, rc->dscp, &rc->vconn); if (!retval) { @@ -512,7 +500,6 @@ run_CONNECTING(struct rconn *rc) int retval = vconn_connect(rc->vconn); if (!retval) { VLOG(rc->reliable ? VLL_INFO : VLL_DBG, "%s: connected", rc->name); - rc->n_successful_connections++; state_transition(rc, S_ACTIVE); rc->version = vconn_get_version(rc->vconn); rc->last_connected = rc->state_entered; @@ -1286,9 +1273,6 @@ state_transition(struct rconn *rc, enum state state) if (is_connected_state(state) && !is_connected_state(rc->state)) { rc->probably_admitted = false; } - if (rconn_is_connected(rc)) { - rc->total_time_connected += elapsed_in_this_state(rc); - } VLOG_DBG("%s: entering %s", rc->name, state_name(state)); rc->state = state; rc->state_entered = time_now();