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 59FCBA00C5; Tue, 30 Aug 2022 20:58:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6916410EE; Tue, 30 Aug 2022 20:58:25 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 3871940F17 for ; Tue, 30 Aug 2022 20:58:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661885904; x=1693421904; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=gpwOvPvozzSOXyjK49EuBcHPF7dRJZ8ugHoiilXRA40=; b=X4dZrZfHLxUzxIWaG2HztnGFBcl6uKZGYCxsiJvZJgPsp79xLSI9cecH 20pboNMXIVhZiaHFDOd6+wE8lpgM12UrBy5+ng0kpaWXuhkp1pN8CPan6 EW8AYq5ixpPacvdgxuGdHiFAd1VQcuN1oj2poqbKm1FKacHGDn7E0hR5E WfE/G/c0pleTKac2jUa8i6yabmVM4Lx9S/57yWlSlsGDd4mN43ctgh97o NOBUaB9rfajMxYxXzjq43Diol24/87/IYsIj9EQrxHaFUAleKXBmii2d2 PEw2U1sz7yaltZhhR/yKojq60c2ya1zeGpWzPiNJ/c92Nrv7qZjn1FADT g==; X-IronPort-AV: E=McAfee;i="6500,9779,10455"; a="296554008" X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="296554008" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 11:58:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,275,1654585200"; d="scan'208";a="562770835" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga003.jf.intel.com with ESMTP; 30 Aug 2022 11:58:12 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Subject: [PATCH V3 0/7] pipeline: support direct registers and meters Date: Tue, 30 Aug 2022 18:58:04 +0000 Message-Id: <20220830185811.1843109-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220826103605.1579589-1-cristian.dumitrescu@intel.com> References: <20220826103605.1579589-1-cristian.dumitrescu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This patch introduces support for direct registers and meters. The difference between indirect (indexed) and direct registers and meters is explained below [1][2][3]. 1. Indirect (indexed) registers and meters. The index into an array of registers or meters used on the data path is typically read from the action data identified by a table lookup operation. This means that the control plane manages the mapping of the mapping of array entries to table entries and sets up this index explicitly into the table entry action data. These are called indirect or indexed registers and meters, and they allow multiple table entries to share the same register/meter, as well as a 1:1 mapping of table entries to register/meter array entries. 2. Direct registers and meters. In the case of 1:1 mapping of table entries to register/meter array elements, it is sometimes desired to avoid the explicit allocation of register/meter array index to each table entry by the control plane. One way this can be done is by implementing a mechanism to associate a unique ID to each table entry, including the default table entry as well; once the entry ID is retrieved as result of the table lookup operation, it is saved by the pipeline and used later on as the index into the register/meter array. These are called direct registers and meters, and have the advantage that the index is auto-generated, which simplifies the controller implementation; the disadvantage is that they do not allow multiple table entries to share the same register or meter. References: [1] Indirect and direct counters: https://p4.org/p4-spec/docs/PSA.html#sec-counters [2] Indirect and direct registers: https://p4.org/p4-spec/docs/PSA.html#sec-registers [3] Indirect and direct meters: https://p4.org/p4-spec/docs/PSA.html#sec-meters Depends-on: series-24366 ("pipeline: make the hash function configurable per table") Change log: V3: -Fixed issues related to CLI parsing -Fixed issue related to the key offset V2: -Fixed minor style issues flagged by CI/CD Cristian Dumitrescu (7): table: add entry ID for regular tables table: add entry ID for learner tables pipeline: add table entry ID read instruction pipeline: support direct registers on the control path pipeline: support direct meters on the control path examples/pipeline: add CLI commands for direct registers examples/pipeline: add CLI commands for direct meters examples/pipeline/cli.c | 654 +++++++++++++++++------ examples/pipeline/examples/meter.cli | 2 +- lib/pipeline/rte_swx_ctl.h | 133 +++++ lib/pipeline/rte_swx_pipeline.c | 390 ++++++++++++++ lib/pipeline/rte_swx_pipeline_internal.h | 21 + lib/pipeline/version.map | 5 + lib/table/rte_swx_table.h | 13 + lib/table/rte_swx_table_em.c | 5 + lib/table/rte_swx_table_learner.c | 13 +- lib/table/rte_swx_table_learner.h | 12 + lib/table/rte_swx_table_wm.c | 2 + 11 files changed, 1097 insertions(+), 153 deletions(-) -- 2.34.1