From patchwork Wed Jun 28 12:42:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Traynor X-Patchwork-Id: 781654 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.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 3wyMvJ4hCTz9s7m for ; Wed, 28 Jun 2017 22:45:00 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5DF00AF4; Wed, 28 Jun 2017 12:43:29 +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 0BC8B9C for ; Wed, 28 Jun 2017 12:43:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AB18A184 for ; Wed, 28 Jun 2017 12:43:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E8D7980F94; Wed, 28 Jun 2017 12:43:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E8D7980F94 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=ktraynor@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E8D7980F94 Received: from ktraynor.remote.csb (ovpn-117-248.ams2.redhat.com [10.36.117.248]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FC558928C; Wed, 28 Jun 2017 12:43:23 +0000 (UTC) From: Kevin Traynor To: dev@openvswitch.org, ian.stokes@intel.com, jan.scheurich@ericsson.com, bhanuprakash.bodireddy@intel.com, ciara.loftus@intel.com Date: Wed, 28 Jun 2017 13:42:47 +0100 Message-Id: <1498653773-13757-3-git-send-email-ktraynor@redhat.com> In-Reply-To: <1498653773-13757-1-git-send-email-ktraynor@redhat.com> References: <1494002063-12269-1-git-send-email-ktraynor@redhat.com> <1498653773-13757-1-git-send-email-ktraynor@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 28 Jun 2017 12:43:25 +0000 (UTC) X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD 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 2/8] dpif-netdev: Make dpcls optimization interval more generic. 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: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org So far the interval was only used for dpcls optimization. Soon, we will use it for storing rxq cycles so make the names more generic. Also, set the interval regardless of whether dpcls optimization has occurred, as the optimization interval will need to be consistent across pmds. Signed-off-by: Kevin Traynor --- lib/dpif-netdev.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 6bae4ac..e5b9f6a 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -175,6 +175,6 @@ struct emc_cache { /* Simple non-wildcarding single-priority classifier. */ -/* Time in ms between successive optimizations of the dpcls subtable vector */ -#define DPCLS_OPTIMIZATION_INTERVAL 1000 +/* Time in ms between successive optimizations of the pmd */ +#define PMD_OPTIMIZATION_INTERVAL 1000 struct dpcls { @@ -4215,5 +4215,5 @@ dp_netdev_configure_pmd(struct dp_netdev_pmd_thread *pmd, struct dp_netdev *dp, cmap_init(&pmd->flow_table); cmap_init(&pmd->classifiers); - pmd->next_optimization = time_msec() + DPCLS_OPTIMIZATION_INTERVAL; + pmd->next_optimization = time_msec() + PMD_OPTIMIZATION_INTERVAL; hmap_init(&pmd->poll_list); hmap_init(&pmd->tx_ports); @@ -5679,7 +5679,7 @@ dp_netdev_pmd_try_optimize(struct dp_netdev_pmd_thread *pmd) } ovs_mutex_unlock(&pmd->flow_mutex); - /* Start new measuring interval */ - pmd->next_optimization = now + DPCLS_OPTIMIZATION_INTERVAL; } + /* Start new measuring interval */ + pmd->next_optimization = now + PMD_OPTIMIZATION_INTERVAL; } }