From patchwork Mon Jun 25 10:57:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 934172 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=fail (p=none dis=none) header.from=redhat.com 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 41DmNQ6hgwz9s01 for ; Mon, 25 Jun 2018 20:57:42 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 135DEBC1; Mon, 25 Jun 2018 10:57:33 +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 10E5EBBD for ; Mon, 25 Jun 2018 10:57:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7FEB0766 for ; Mon, 25 Jun 2018 10:57:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AE1894023351 for ; Mon, 25 Jun 2018 10:57:29 +0000 (UTC) Received: from rhvm.imac (ovpn-116-227.ams2.redhat.com [10.36.116.227]) by smtp.corp.redhat.com (Postfix) with ESMTP id 547DF2026D5B for ; Mon, 25 Jun 2018 10:57:29 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Mon, 25 Jun 2018 12:57:26 +0200 Message-Id: <152992424137.10837.8018927845969393798.stgit@rhvm.imac> In-Reply-To: <152992422304.10837.6128066538561533468.stgit@rhvm.imac> References: <152992422304.10837.6128066538561533468.stgit@rhvm.imac> User-Agent: StGit/unknown-version MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 25 Jun 2018 10:57:29 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 25 Jun 2018 10:57:29 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'echaudro@redhat.com' RCPT:'' X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 1/5] mac-learning: Add additional mac-learning coverage counters 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 This patch adds two additional mac-learning coverage counters: - mac_learning_evicted, entries deleted due to mac table being full - mac_learning_moved, entries where the port has changed. Signed-off-by: Eelco Chaudron --- lib/mac-learning.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/mac-learning.c b/lib/mac-learning.c index 215caf0ba..8b7981dbb 100644 --- a/lib/mac-learning.c +++ b/lib/mac-learning.c @@ -32,6 +32,8 @@ COVERAGE_DEFINE(mac_learning_learned); COVERAGE_DEFINE(mac_learning_expired); +COVERAGE_DEFINE(mac_learning_evicted); +COVERAGE_DEFINE(mac_learning_moved); /* Returns the number of seconds since 'e' (within 'ml') was last learned. */ int @@ -150,6 +152,7 @@ evict_mac_entry_fairly(struct mac_learning *ml) struct mac_learning_port, heap_node); e = CONTAINER_OF(ovs_list_front(&mlport->port_lrus), struct mac_entry, port_lru_node); + COVERAGE_INC(mac_learning_evicted); mac_learning_expire(ml, e); } @@ -421,6 +424,9 @@ update_learning_table__(struct mac_learning *ml, struct eth_addr src, } if (mac_entry_get_port(ml, mac) != in_port) { + if (mac_entry_get_port(ml, mac) != NULL) { + COVERAGE_INC(mac_learning_moved); + } mac_entry_set_port(ml, mac, in_port); return true; }