From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0089.outbound.protection.outlook.com [104.47.41.89]) by dpdk.org (Postfix) with ESMTP id A71831B2B2 for ; Tue, 16 Jan 2018 16:18:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vgcS8q7oZI15pTMf9cuWYu1ZgWw6qvWOzu8+fo4yXzg=; b=XDJaE5h1g/ie/nRuk5NvJc+jyWEv+RU1zCH188X7/SmabteivFnMgFjiHWfrP9z9gh0OX4Q64FlR5seieK6ZwtyUpFVm65z2DWl7yCKfdKr2+xVa9nZE+AjVwMUV+gHYMs1JHgcT2Ooi7Qj7UjicvEffMCX7kN/L6Oc9HYYqNOI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 15:18:29 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, santosh.shukla@caviumnetworks.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 16 Jan 2018 20:47:21 +0530 Message-Id: <20180116151728.566-6-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180116151728.566-1-pbhagavatula@caviumnetworks.com> References: <20171130072406.15605-1-pbhagavatula@caviumnetworks.com> <20180116151728.566-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MWHPR21CA0059.namprd21.prod.outlook.com (10.172.93.149) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5e6c9aa2-3160-4547-e587-08d55cf46743 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:3E9w7r+w+tfFb99BNHnkY0Drx9drL1ZwQmYkuM15dpJEKduYWKgiI4U30F4FT9g5gtC7RLJS78zhDlUUE7XN4ffS2Tyd53tKHSc2Bz4E2hVo0Q2aoPCxZQEGRrqSt6633FtqIex460KHO6ke3m7ioZr9WiboDeMM9nmwOjqzaMdpKgr0ad+XgG4asJ830Y3qmo5/58jMI7n67UUFUzm6/kLRxWVqMUR170lfyAS+iPDDdhC5FYXvSh7akmovdGK8; 25:sai1v64+ur+XicgdABaXcq+FfixQWIEgGZvlQbCiQ/+d/TE1ZegIex1ty+q4l0COQ9sbAPpy7ne8mqKFXgsCjZ70yYhOYHpMOCc5RAiP35d+Dq8/aUaQ1Ta+aLp6dAbT3yTpqpEeLOBJ3FN8L/cCQ9kKlKIoGslSrlEBjjDS9RTir+/IuMiNV8J+attrDYKVbpRWXlanrBqYA0TwXN9+Ym8lxsz1jzs3D7QK2/BXej7+okUj4CkWwILLPjqauaDl8hNB0GpMCXgMjCNUZgIWNGlt8PrJBTXdQnryffjFR5zIsr4xbQAqGHf8BxrfeVbMWF0jH2rrkvNEEBty9zF8Cg==; 31:bHEucaz7xZkkxM+Hb+Bb3C2CmTtzQbSVqAuL1H1Hep07BM6l7Vf7UXO1ujRL9ImJElNDZBwLKURw2vWLJo9uyWQEim0G0O9PExvQ6AB3tPLCv98M/p+3ajl6xWIZI6MaxCmzW/B4t5ITkEJXewFfJcVLE+S3DYUR2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report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(944501161)(93006095)(10201501046)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(376002)(39380400002)(39860400002)(199004)(189003)(2950100002)(4326008)(42882006)(5009440100003)(6666003)(107886003)(25786009)(68736007)(16526018)(72206003)(478600001)(316002)(5660300001)(16586007)(26005)(50226002)(53936002)(575784001)(7736002)(305945005)(36756003)(53416004)(6116002)(81166006)(8656006)(69596002)(8676002)(6512007)(81156014)(8936002)(97736004)(386003)(6506007)(50466002)(66066001)(76176011)(52116002)(51416003)(2906002)(47776003)(48376002)(106356001)(3846002)(1076002)(105586002)(6486002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; H:Pavan-LT.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR07MB3469; 23:9jbl6800ooODuYClNzquSMlBffg17TN6Jf8V2f6bk?= =?us-ascii?Q?fuvXjAvDaLPCo5euce2St6i22we+44v5g5qhOLigq0HMghvjWSs11OgvKVpT?= =?us-ascii?Q?xHLm1UwlwfP/KJZ726+rC6MT9bSGrARkxJRjgiH7/xy/4km1C/kVm3iBmSkY?= =?us-ascii?Q?ELqSrWfaCyZn5ES4tQAkR4GORzKFl30K0UxZ/KAw/GM4gHLUgVCRt3c8MJiV?= =?us-ascii?Q?s60S1L3SAvt/lZTGch17pbBvhQpd+Zp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4douMzpF8DkFEl8BCGMjs1ee0/QBM78P/d3TNuSXltvrnhI+cDGHuIq7rIjI/ULpUn1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 15:18:29.3476 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5e6c9aa2-3160-4547-e587-08d55cf46743 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH v5 06/14] app/eventdev: add event port setup and Rx adapter setup 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: , X-List-Received-Date: Tue, 16 Jan 2018 15:18:35 -0000 Setup one port per worker and link to all queues and setup producer port based on Rx adapter capabilities. Signed-off-by: Pavan Nikhilesh --- app/test-eventdev/test_pipeline_common.c | 114 +++++++++++++++++++++++++++++++ app/test-eventdev/test_pipeline_common.h | 5 ++ 2 files changed, 119 insertions(+) diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c index c20815c25..63f54daef 100644 --- a/app/test-eventdev/test_pipeline_common.c +++ b/app/test-eventdev/test_pipeline_common.c @@ -157,6 +157,120 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt) return 0; } +int +pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt, + uint8_t *queue_arr, uint8_t nb_queues, + const struct rte_event_port_conf p_conf) +{ + int i; + int ret; + uint8_t port; + struct test_pipeline *t = evt_test_priv(test); + + + /* setup one port per worker, linking to all queues */ + for (port = 0; port < evt_nr_active_lcores(opt->wlcores); port++) { + struct worker_data *w = &t->worker[port]; + + w->dev_id = opt->dev_id; + w->port_id = port; + w->t = t; + w->processed_pkts = 0; + + ret = rte_event_port_setup(opt->dev_id, port, &p_conf); + if (ret) { + evt_err("failed to setup port %d", port); + return ret; + } + + if (queue_arr == NULL) { + if (rte_event_port_link(opt->dev_id, port, NULL, NULL, + 0) != nb_queues) + goto link_fail; + } else { + for (i = 0; i < nb_queues; i++) { + if (rte_event_port_link(opt->dev_id, port, + &queue_arr[i], NULL, 1) != 1) + goto link_fail; + } + } + } + + return 0; + +link_fail: + evt_err("failed to link all queues to port %d", port); + return -EINVAL; +} + +int +pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, + struct rte_event_port_conf prod_conf) +{ + int ret = 0; + uint16_t prod; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + memset(&queue_conf, 0, + sizeof(struct rte_event_eth_rx_adapter_queue_conf)); + queue_conf.ev.sched_type = opt->sched_type_list[0]; + for (prod = 0; prod < rte_eth_dev_count(); prod++) { + uint32_t cap; + + ret = rte_event_eth_rx_adapter_caps_get(opt->dev_id, + prod, &cap); + if (ret) { + evt_err("failed to get event rx adapter[%d]" + " capabilities", + opt->dev_id); + return ret; + } + queue_conf.ev.queue_id = prod * stride; + ret = rte_event_eth_rx_adapter_create(prod, opt->dev_id, + &prod_conf); + if (ret) { + evt_err("failed to create rx adapter[%d]", prod); + return ret; + } + ret = rte_event_eth_rx_adapter_queue_add(prod, prod, -1, + &queue_conf); + if (ret) { + evt_err("failed to add rx queues to adapter[%d]", prod); + return ret; + } + + if (!(cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT)) { + uint32_t service_id; + + rte_event_eth_rx_adapter_service_id_get(prod, + &service_id); + ret = evt_service_setup(service_id); + if (ret) { + evt_err("Failed to setup service core" + " for Rx adapter\n"); + return ret; + } + } + + ret = rte_eth_dev_start(prod); + if (ret) { + evt_err("Ethernet dev [%d] failed to start." + " Using synthetic producer", prod); + return ret; + } + + ret = rte_event_eth_rx_adapter_start(prod); + if (ret) { + evt_err("Rx adapter[%d] start failed", prod); + return ret; + } + printf("%s: Port[%d] using Rx adapter[%d] started\n", __func__, + prod, prod); + } + + return ret; +} + void pipeline_ethdev_destroy(struct evt_test *test, struct evt_options *opt) { diff --git a/app/test-eventdev/test_pipeline_common.h b/app/test-eventdev/test_pipeline_common.h index d8ab797bb..f8c46c0d7 100644 --- a/app/test-eventdev/test_pipeline_common.h +++ b/app/test-eventdev/test_pipeline_common.h @@ -55,7 +55,12 @@ int pipeline_test_result(struct evt_test *test, struct evt_options *opt); int pipeline_opt_check(struct evt_options *opt, uint64_t nb_queues); int pipeline_test_setup(struct evt_test *test, struct evt_options *opt); int pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt); +int pipeline_event_rx_adapter_setup(struct evt_options *opt, uint8_t stride, + struct rte_event_port_conf prod_conf); int pipeline_mempool_setup(struct evt_test *test, struct evt_options *opt); +int pipeline_event_port_setup(struct evt_test *test, struct evt_options *opt, + uint8_t *queue_arr, uint8_t nb_queues, + const struct rte_event_port_conf p_conf); void pipeline_opt_dump(struct evt_options *opt, uint8_t nb_queues); void pipeline_test_destroy(struct evt_test *test, struct evt_options *opt); void pipeline_eventdev_destroy(struct evt_test *test, struct evt_options *opt); -- 2.14.1