From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 51FA8A04B1; Wed, 26 Aug 2020 17:21:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E58AB1C211; Wed, 26 Aug 2020 17:15:45 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id CCEC61C0D7 for ; Wed, 26 Aug 2020 17:15:17 +0200 (CEST) IronPort-SDR: QHr/3VdTAI7QTRj9F1UE0IReKwQsw1HnO+eGtN674TIinKX09OKA23hWfsQVJgHhr0m6/C14go 8sF72SAndq7A== X-IronPort-AV: E=McAfee;i="6000,8403,9725"; a="153879595" X-IronPort-AV: E=Sophos;i="5.76,356,1592895600"; d="scan'208";a="153879595" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2020 08:15:16 -0700 IronPort-SDR: 8PzGV3+vP+zCUI/t3uZYt0nyNMawPPztKMpdfH2QNvcdLymgAw9MEp+1NnwbpyUDUKwR5LJLhH Ti/RdUd8flNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,356,1592895600"; d="scan'208";a="444081437" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.107]) by orsmga004.jf.intel.com with ESMTP; 26 Aug 2020 08:15:16 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Date: Wed, 26 Aug 2020 16:14:34 +0100 Message-Id: <20200826151445.51500-30-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826151445.51500-1-cristian.dumitrescu@intel.com> References: <20200826151445.51500-1-cristian.dumitrescu@intel.com> Subject: [dpdk-dev] [PATCH 29/40] pipeline: add pipeline flush X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Flush the packets currently buffered by the pipeline output ports. Signed-off-by: Cristian Dumitrescu --- lib/librte_pipeline/rte_pipeline_version.map | 1 + lib/librte_pipeline/rte_swx_pipeline.c | 13 +++++++++++++ lib/librte_pipeline/rte_swx_pipeline.h | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/lib/librte_pipeline/rte_pipeline_version.map b/lib/librte_pipeline/rte_pipeline_version.map index bb992fdd0..730e11a0c 100644 --- a/lib/librte_pipeline/rte_pipeline_version.map +++ b/lib/librte_pipeline/rte_pipeline_version.map @@ -74,6 +74,7 @@ EXPERIMENTAL { rte_swx_pipeline_build; rte_swx_pipeline_free; rte_swx_pipeline_run; + rte_swx_pipeline_flush; rte_swx_pipeline_table_state_get; rte_swx_pipeline_table_state_set; rte_swx_ctl_pipeline_info_get; diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c index 6963f63a2..64fc187c4 100644 --- a/lib/librte_pipeline/rte_swx_pipeline.c +++ b/lib/librte_pipeline/rte_swx_pipeline.c @@ -6951,6 +6951,19 @@ rte_swx_pipeline_run(struct rte_swx_pipeline *p, uint32_t n_instructions) instr_exec(p); } +void +rte_swx_pipeline_flush(struct rte_swx_pipeline *p) +{ + uint32_t i; + + for (i = 0; i < p->n_ports_out; i++) { + struct port_out_runtime *port = &p->out[i]; + + if (port->flush) + port->flush(port->obj); + } +} + /* * Control. */ diff --git a/lib/librte_pipeline/rte_swx_pipeline.h b/lib/librte_pipeline/rte_swx_pipeline.h index fb83a8820..203e394d6 100644 --- a/lib/librte_pipeline/rte_swx_pipeline.h +++ b/lib/librte_pipeline/rte_swx_pipeline.h @@ -547,6 +547,18 @@ void rte_swx_pipeline_run(struct rte_swx_pipeline *p, uint32_t n_instructions); +/** + * Pipeline flush + * + * Flush all output ports of the pipeline. + * + * @param[in] p + * Pipeline handle. + */ +__rte_experimental +void +rte_swx_pipeline_flush(struct rte_swx_pipeline *p); + /** * Pipeline free * -- 2.17.1