From patchwork Sun Jun 30 17:52:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 55674 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B8CF41B974; Sun, 30 Jun 2019 19:52:51 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 00A0E1B955; Sun, 30 Jun 2019 19:52:49 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5UHp53I004369; Sun, 30 Jun 2019 10:52:49 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=QU1wSVvIXiwQgqmGsNkwpXWlafcfxBqxU/CB5F4xLTg=; b=H+C5ZsHy3MmZ7em61XwyatkM+cplE/QNT1emfpy/JJ+/DjejXq0sXCrLWWvWhHISrQ+l Myj4V0JTwS0In+Ae2g3loXdoS/Q9HQ5nyq3yA6cBaCyp9D/oj+9twO/TTYU60V6KQdZq NB1oAEUgpG315/umMG2jfdU124BiNduALkwXUa+nxw9rZRTSJUek79iyrlSIkA62NRKH 5Y+nfRy9U/ANOW+oTAwe7enbyE5O4U+bbpb359Tick107WKQH378Cf1kilMMeIc6TlgF SjvEspfkZJbu2ss7ODAIQ9NyyqalWEivWaJzFhJac16Fu6nbSL3He3yid6l4jal61YTJ GA== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2te7gm3x2b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 30 Jun 2019 10:52:48 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 30 Jun 2019 10:52:47 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 30 Jun 2019 10:52:47 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.14]) by maili.marvell.com (Postfix) with ESMTP id 54D413F703F; Sun, 30 Jun 2019 10:52:44 -0700 (PDT) From: To: CC: , Pavan Nikhilesh , Date: Sun, 30 Jun 2019 23:22:39 +0530 Message-ID: <20190630175240.1126-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-30_08:, , signatures=0 Subject: [dpdk-dev] [PATCH 1/2] app/eventdev: fix order test port creation 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" From: Pavan Nikhilesh Configure event ports based on the underlying event device info rather than using hardcoded values. Cc: stable@dpdk.org Fixes: 5710e751813e ("app/testeventdev: add order port setup") Signed-off-by: Pavan Nikhilesh Acked-by: Jerin Jacob --- app/test-eventdev/test_order_common.c | 32 ++++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/app/test-eventdev/test_order_common.c b/app/test-eventdev/test_order_common.c index 8a3420130..252e4a14c 100644 --- a/app/test-eventdev/test_order_common.c +++ b/app/test-eventdev/test_order_common.c @@ -67,6 +67,11 @@ order_producer(void *arg) int order_opt_check(struct evt_options *opt) { + if (opt->prod_type != EVT_PROD_TYPE_SYNT) { + evt_err("Invalid producer type"); + return -EINVAL; + } + /* 1 producer + N workers + 1 master */ if (rte_lcore_count() < 3) { evt_err("test need minimum 3 lcores"); @@ -298,12 +303,23 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, int ret; uint8_t port; struct test_order *t = evt_test_priv(test); + struct rte_event_dev_info dev_info; + + memset(&dev_info, 0, sizeof(struct rte_event_dev_info)); + ret = rte_event_dev_info_get(opt->dev_id, &dev_info); + if (ret) { + evt_err("failed to get eventdev info %d", opt->dev_id); + return ret; + } + + if (opt->wkr_deq_dep > dev_info.max_event_port_dequeue_depth) + opt->wkr_deq_dep = dev_info.max_event_port_dequeue_depth; /* port configuration */ - const struct rte_event_port_conf wkr_p_conf = { + const struct rte_event_port_conf p_conf = { .dequeue_depth = opt->wkr_deq_dep, - .enqueue_depth = 64, - .new_event_threshold = 4096, + .enqueue_depth = dev_info.max_event_port_dequeue_depth, + .new_event_threshold = dev_info.max_num_events, }; /* setup one port per worker, linking to all queues */ @@ -314,7 +330,7 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, w->port_id = port; w->t = t; - ret = rte_event_port_setup(opt->dev_id, port, &wkr_p_conf); + ret = rte_event_port_setup(opt->dev_id, port, &p_conf); if (ret) { evt_err("failed to setup port %d", port); return ret; @@ -326,12 +342,6 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, return -EINVAL; } } - /* port for producer, no links */ - const struct rte_event_port_conf prod_conf = { - .dequeue_depth = 8, - .enqueue_depth = 32, - .new_event_threshold = 1200, - }; struct prod_data *p = &t->prod; p->dev_id = opt->dev_id; @@ -339,7 +349,7 @@ order_event_dev_port_setup(struct evt_test *test, struct evt_options *opt, p->queue_id = 0; p->t = t; - ret = rte_event_port_setup(opt->dev_id, port, &prod_conf); + ret = rte_event_port_setup(opt->dev_id, port, &p_conf); if (ret) { evt_err("failed to setup producer port %d", port); return ret;