From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rao, Nikhil" Subject: Re: [PATCH] examples/eventdev_pipeline: add Tx adapter support Date: Wed, 19 Sep 2018 08:24:01 +0530 Message-ID: <2913f7a3-b531-ce60-d6fd-3585e8c85288@intel.com> References: <20180905134554.25243-1-pbhagavatula@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, "Rao, Nikhil" To: Pavan Nikhilesh , jerin.jacob@caviumnetworks.com, harry.van.haaren@intel.com, anoob.joseph@caviumnetworks.com Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A4E5E1041 for ; Wed, 19 Sep 2018 04:54:06 +0200 (CEST) In-Reply-To: <20180905134554.25243-1-pbhagavatula@caviumnetworks.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 9/5/2018 7:15 PM, Pavan Nikhilesh wrote: > Signed-off-by: Pavan Nikhilesh > --- > This patch depends on the following series: > http://patches.dpdk.org/project/dpdk/list/?series=1121 > > examples/eventdev_pipeline/main.c | 62 ++-- > examples/eventdev_pipeline/pipeline_common.h | 31 +- > .../pipeline_worker_generic.c | 273 +++++------------- > .../eventdev_pipeline/pipeline_worker_tx.c | 130 +++++---- > 4 files changed, 186 insertions(+), 310 deletions(-) > > diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c > index 700bc696f..95531150b 100644 > --- a/examples/eventdev_pipeline/main.c > +++ b/examples/eventdev_pipeline/main.c > > > static void > do_capability_setup(uint8_t eventdev_id) > { > + int ret; > uint16_t i; > - uint8_t mt_unsafe = 0; > + uint8_t generic_pipeline = 0; > uint8_t burst = 0; > > RTE_ETH_FOREACH_DEV(i) { > - struct rte_eth_dev_info dev_info; > - memset(&dev_info, 0, sizeof(struct rte_eth_dev_info)); > - > - rte_eth_dev_info_get(i, &dev_info); > - /* Check if it is safe ask worker to tx. */ > - mt_unsafe |= !(dev_info.tx_offload_capa & > - DEV_TX_OFFLOAD_MT_LOCKFREE); > + uint32_t caps = 0; > + > + ret = rte_event_eth_tx_adapter_caps_get(eventdev_id, i, &caps); > + if (ret) > + rte_exit(EXIT_FAILURE, > + "Invalid capability for Tx adptr port %d\n", i); > + generic_pipeline |= !(caps & > + RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT); > } > > struct rte_event_dev_info eventdev_info; > @@ -406,10 +386,10 @@ do_capability_setup(uint8_t eventdev_id) > burst = eventdev_info.event_dev_cap & RTE_EVENT_DEV_CAP_BURST_MODE ? 1 : > 0; > > - if (mt_unsafe) > + if (generic_pipeline) > set_worker_generic_setup_data(&fdata->cap, burst); > else > - set_worker_tx_setup_data(&fdata->cap, burst); > + set_worker_tx_enq_setup_data(&fdata->cap, burst); > } The generic_pipeline flag is set here and therefore, aren't the subsequent checks in generic_opt_check() and worker_tx_enq_opt_check() redundant ? Thanks, Nikhil