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 D4BD3A00C4; Thu, 28 Jul 2022 00:36:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC22342B6E; Thu, 28 Jul 2022 00:36:46 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 75E0840141 for ; Thu, 28 Jul 2022 00:36:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658961403; x=1690497403; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UzzpIhJ2abbRozU27BFdEHiHwKlZzXx+954EfyzY78c=; b=mbB/b/jv453ocDSR9F9XPy3Uwo9uaqaS2UEd9600NZuNOrepLntBtXGE LN8vIBb9Ghc2CcJggCfZbuJ7qLIaXLQr/4D8nkawN9FHiw2CB3Wv62Hn2 UKgA25aqqiY1golzdHgsWMCLwYwPPi3jIVSeXArNP1GEx7HxhQAV3oXty RoeIB6jjCBRJfwWM5tXagzWTWk3czj8fG5TzsHWvS+hgfrXPWdr2jsT1v JiL/c0XEuXdnejt8uJGW6VwqWReki4muhCXpY04MFeDSB0XQlVj2lLZ2o dwhzAmYnnHorlWzyKppPRljYyYSwaZ+13yioBSt3bW8/crywUafe4QPPa A==; X-IronPort-AV: E=McAfee;i="6400,9594,10421"; a="350068820" X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="350068820" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jul 2022 15:36:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,196,1654585200"; d="scan'208";a="628567609" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga008.jf.intel.com with ESMTP; 27 Jul 2022 15:36:41 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: "Kamalakannan R ." Subject: [PATCH V3 03/17] pipeline: add pipeline specification data structure Date: Wed, 27 Jul 2022 22:36:25 +0000 Message-Id: <20220727223639.598932-3-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220727223639.598932-1-cristian.dumitrescu@intel.com> References: <20220718132603.339314-1-cristian.dumitrescu@intel.com> <20220727223639.598932-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 Add specification data structure for the entire pipeline. Signed-off-by: Cristian Dumitrescu Signed-off-by: Kamalakannan R. --- lib/pipeline/rte_swx_pipeline_spec.c | 21 ++++++++++++++++++ lib/pipeline/rte_swx_pipeline_spec.h | 32 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/lib/pipeline/rte_swx_pipeline_spec.c b/lib/pipeline/rte_swx_pipeline_spec.c index 5e07b4f794..642091b678 100644 --- a/lib/pipeline/rte_swx_pipeline_spec.c +++ b/lib/pipeline/rte_swx_pipeline_spec.c @@ -2082,6 +2082,27 @@ apply_block_parse(struct apply_spec *s, /* * Pipeline. */ +void +pipeline_spec_free(struct pipeline_spec *s) +{ + if (!s) + return; + + free(s->extobjs); + free(s->structs); + free(s->headers); + free(s->metadata); + free(s->actions); + free(s->tables); + free(s->selectors); + free(s->learners); + free(s->regarrays); + free(s->metarrays); + free(s->apply); + + memset(s, 0, sizeof(struct pipeline_spec)); +} + int rte_swx_pipeline_build_from_spec(struct rte_swx_pipeline *p, FILE *spec, diff --git a/lib/pipeline/rte_swx_pipeline_spec.h b/lib/pipeline/rte_swx_pipeline_spec.h index 8458de878a..e1170a33b1 100644 --- a/lib/pipeline/rte_swx_pipeline_spec.h +++ b/lib/pipeline/rte_swx_pipeline_spec.h @@ -174,3 +174,35 @@ struct apply_spec { const char **instructions; uint32_t n_instructions; }; + +/* + * Pipeline. + */ +struct pipeline_spec { + struct extobj_spec *extobjs; + struct struct_spec *structs; + struct header_spec *headers; + struct metadata_spec *metadata; + struct action_spec *actions; + struct table_spec *tables; + struct selector_spec *selectors; + struct learner_spec *learners; + struct regarray_spec *regarrays; + struct metarray_spec *metarrays; + struct apply_spec *apply; + + uint32_t n_extobjs; + uint32_t n_structs; + uint32_t n_headers; + uint32_t n_metadata; + uint32_t n_actions; + uint32_t n_tables; + uint32_t n_selectors; + uint32_t n_learners; + uint32_t n_regarrays; + uint32_t n_metarrays; + uint32_t n_apply; +}; + +void +pipeline_spec_free(struct pipeline_spec *s); -- 2.34.1