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 7F9DCA00C5; Thu, 28 Jul 2022 17:12:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A9B242BC5; Thu, 28 Jul 2022 17:11:57 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id C60D142BAE for ; Thu, 28 Jul 2022 17:11:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659021114; x=1690557114; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UzzpIhJ2abbRozU27BFdEHiHwKlZzXx+954EfyzY78c=; b=gvOGZrSNXxCPXhCngIPyeD8SBatKTJ3mK8lhgFYUXkhHaj4ZhgqW5Ll6 KmBchUnkfk91D9axAu59IWGUuXMhJOFGNZbhmviM0vWtGX29W4fcHetVx QMQKVlUG6AfrTXGbk0V/ylMsglx1nLXteeQdbt/U/+UuumU14TI8cCe2V kUTL75rgwb/JUvw6Y2RtBVSGiUVQU5owd56mDC2F2D8u9nRgX6XC7LKty FPoosv48Mf2bnO7vhX3nWXgmk1Y9M2/TaL0Fsnvem7GTXDOSDHuzA6Onb 7tt6TCDRhqPrwO1zXYmruxuIVFJXp/RUGv0fKiMIK8+AScI2o/mM+5V8c A==; X-IronPort-AV: E=McAfee;i="6400,9594,10422"; a="288547369" X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="288547369" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2022 08:11:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,198,1654585200"; d="scan'208";a="633727145" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by orsmga001.jf.intel.com with ESMTP; 28 Jul 2022 08:11:52 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Cc: "Kamalakannan R ." Subject: [PATCH V6 03/17] pipeline: add pipeline specification data structure Date: Thu, 28 Jul 2022 15:11:33 +0000 Message-Id: <20220728151147.603265-4-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220728151147.603265-1-cristian.dumitrescu@intel.com> References: <20220718130713.339003-1-cristian.dumitrescu@intel.com> <20220728151147.603265-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