From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 308DDA0093; Thu, 21 Apr 2022 18:00:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AA6E427EF; Thu, 21 Apr 2022 18:00:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id EA23D40042 for ; Thu, 21 Apr 2022 17:59:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650556796; x=1682092796; h=from:to:subject:date:message-id:in-reply-to:references; bh=I5uKwo8MX+l339sRNLPNB2/Vbwn3i9yBEjJeEsy7kLg=; b=JBtfjzc6V+HgtWPkcDVoywS5Chw9LZV3JNLI3+kuKh1Of1sLaGappuYw wbGjDLbw3KGJ4MjY9ABD0xdojeByS4cqMM7pgOm0UCrXQTiE9SV4d3cXg XLILx7SmFYuVTRaDtTv1LHidECrqUp45rr8FxxCHhse/D7PycEhe2P1Pt S+sqyjlLVUkeABqGTDwTDhJuV6dYIEbI/lKJqsN+r4MB1rkLStjx77649 HUhCKY/xbGgfTdn90vUMgh1SePaZdV713QfLp4mpf9r/HIu4/xaSv1+eb I0YO8I4z05FWVUq9yVQgS1/gAhAISE+FpW9gG5ZxYGJOhgCGbw0gaPxPc w==; X-IronPort-AV: E=McAfee;i="6400,9594,10324"; a="244973292" X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="244973292" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Apr 2022 08:59:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,279,1643702400"; d="scan'208";a="728066557" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.107]) by orsmga005.jf.intel.com with ESMTP; 21 Apr 2022 08:59:54 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Subject: [PATCH 3/3] examples/pipeline: improve learner table timers Date: Thu, 21 Apr 2022 16:59:51 +0100 Message-Id: <20220421155951.31811-3-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220421155951.31811-1-cristian.dumitrescu@intel.com> References: <20220421155951.31811-1-cristian.dumitrescu@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Signed-off-by: Cristian Dumitrescu --- examples/pipeline/cli.c | 2 ++ examples/pipeline/examples/learner.spec | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c index d52ad6b61e..0334616bd9 100644 --- a/examples/pipeline/cli.c +++ b/examples/pipeline/cli.c @@ -2677,12 +2677,14 @@ cmd_pipeline_stats(char **tokens, "\t\tMiss (packets): %" PRIu64 "\n" "\t\tLearn OK (packets): %" PRIu64 "\n" "\t\tLearn error (packets): %" PRIu64 "\n" + "\t\tRearm (packets): %" PRIu64 "\n" "\t\tForget (packets): %" PRIu64 "\n", learner_info.name, stats.n_pkts_hit, stats.n_pkts_miss, stats.n_pkts_learn_ok, stats.n_pkts_learn_err, + stats.n_pkts_rearm, stats.n_pkts_forget); out_size -= strlen(out); out += strlen(out); diff --git a/examples/pipeline/examples/learner.spec b/examples/pipeline/examples/learner.spec index 4ee52da7ac..095325c293 100644 --- a/examples/pipeline/examples/learner.spec +++ b/examples/pipeline/examples/learner.spec @@ -48,6 +48,9 @@ struct metadata_t { bit<32> port_in bit<32> port_out + // Key timeout. + bit<32> timeout_id + // Arguments for the "fwd_action" action. bit<32> fwd_action_arg_port_out } @@ -68,10 +71,14 @@ struct fwd_action_args_t { action fwd_action args instanceof fwd_action_args_t { mov m.port_out t.port_out + rearm return } action learn_action args none { + // Pick the key timeout. Timeout ID #1 (i.e. 120 seconds) is selected. + mov m.timeout_id 1 + // Read current counter value into m.fwd_action_arg_port_out. regrd m.fwd_action_arg_port_out counter 0 @@ -84,7 +91,7 @@ action learn_action args none { // Add the current lookup key to the table with fwd_action as the key action. The action // arguments are read from the packet meta-data (the m.fwd_action_arg_port_out field). These // packet meta-data fields have to be written before the "learn" instruction is invoked. - learn fwd_action m.fwd_action_arg_port_out + learn fwd_action m.fwd_action_arg_port_out m.timeout_id // Send the current packet to the same output port. mov m.port_out m.fwd_action_arg_port_out @@ -110,7 +117,11 @@ learner fwd_table { size 1048576 - timeout 120 + timeout { + 60 + 120 + 180 + } } // -- 2.17.1