From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0087.outbound.protection.outlook.com [104.47.38.87]) by dpdk.org (Postfix) with ESMTP id 0612B7D04 for ; Thu, 7 Dec 2017 21:39:30 +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=x6VmsVI+Wy5HXbTID6uaO5QxP4ioRwb4hcmvn7mCtRM=; b=aFjVKZO5otp4g5x5CVZGopGbEXPU2Os5fIBxr9KH/FrKFdynn4bYndUhCdopnsXXPe0/tnr3QQXAz5+UgaJmx4ShYtyaQIL23H/xeTF4xHqVn/scVfdveTDaZfgpXXodl6tSZIBO8e/89sgd+DC47tB+6WjhexBTJY0eIGs4pJs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.282.5; Thu, 7 Dec 2017 20:39:23 +0000 From: Pavan Nikhilesh To: gage.eads@intel.com, jerin.jacobkollanukkaran@cavium.com, harry.van.haaren@intel.com, nikhil.rao@intel.com, hemant.agrawal@nxp.com, liang.j.ma@intel.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 8 Dec 2017 02:07:03 +0530 Message-Id: <20171207203705.25020-12-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> References: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PS1PR0601CA0101.apcprd06.prod.outlook.com (10.170.176.155) To DM5PR07MB3468.namprd07.prod.outlook.com (10.164.153.23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 026333b9-0c14-4eb9-dcc5-08d53db29bd1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603304); SRVR:DM5PR07MB3468; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 3:TXMEpPHEd2cPsWPCCVWY6wip9VQa1tAV+kb2pPefL67hRcYvOlKcU8RHo7k2TuBW/0Yk1TX5rUw6FQnqQp8O/4YUyaDVsUpJJqVVJ0oetxp6EobTWQRt4Wm7K8iV0p/Sifv2/Xh4wfNFbf2yzPB7ci+/mBvJdjwQfbui4h4A34njKILmzMwAIk/uHoTs26ckXu8YeCW+zA20wwWgJz6iZVXILUeTWaU4ENFRkaTHZy0y0MYbr5lpg8OLqyJRHB25; 25:ncUmTxW2k0c+FKiJsHimgZQ12/kwtzbucE/lRQosI3xsbZqLckMZhY8UjjmfnaPteAlqYtCoDdHr6ry+CrAmzgwfLo6NXPfFn1wq4gkIfj8w3dZRTKJuajBCrdZKEe8OvZ9BI31ulDkvcwyLPrpHN2Nhdu+GH2pOv2Dl1jqFEc/esqnnrQezG6QFKanW7v0oJ+Eu3Ku8saOO4aLD2N48JLBEZ9xcGhYUREssm1lVsL5s+R55jQL1BhfySJPSobMxm12mXlTbxME4tABvIJWLzJjQXQMEhGvlCrLoFmvOxLuzvpEbGzJleMJAQG9avVPF8UZl+YftgZ/K2oaojfC2yQ==; 31:qwNTWn0pqUZY50AY5zOg7s1RMgbhHzKDqe6lMizxlkRWHR552vzsIwTOIn2RedNh8FxL2fwhg3qJpR5unkwEl2bz0qJRUEOEdv+wk+bVyNX0Z3A3cjHHP5hpwJcySUQPjWF8rPSKTqwTM7niScI7boxtzQdEqb9KiYoRF640z7pdPa/YmboTZrtiJ9Y/8OgehJNx9XlvekHxoaO/B0AjLq//vIzwP0pquvsxBQz9NOM= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:wfLpVwOonKLAsLlXroroUQ1fEBZ9PiYTQhVujIay/BR0kMApmbyMb3ZZNWMWI4DCqzWcqPjHi4WtyvaLwqlghIeJornN2XRXYMAl1RmZf9E3AZCMWMLK1JQUKYg0qftg186LafbjSDH+mwn0lu1Hfo2hOYHw2tixHVGSI8767oNPL1cbl6SXfRHh00ZRxPppo+fnuyJ5UwRIsSQQRLKuoHsAmtVsU9dGFSOk6nwUwiRaoNDySH03ezAdvNx7gL3gUB/Wkx/7+pNU4H20BDo8/EzCgoAlYSboPsbfOlESLr2zNH0uS4cuOvSwN2L/WHmrUcQRc/7hcygPGVKgt2j4M8Ex26HLP0OXDJm+4CW8rGYs+89ir1L7iBVSqGzRuefEkIek8EnaR5CBxwM0V908mNA8pjvDiDGstWa2As/pI0tWCohnMvm04No5xigVPnDaR7ImQpCC+ArcXVebLDQrPHmjTWl8GCaQM5lccVKWKSCq4/G8p1Vq7ykPBDTedd2bUuF/gF3+F3L+QVHOeBSgoG1CIp6EhnFRwvK7iKanQY7xAssTDKksOd5VCJMlWQSkdqtscvifGViOcqZjwb/453j6IEHuqEgsAFCsi6hVoIE=; 4:HUW6WeaIJEK5J2pnq0jGkvi+PY2qOpvJRx8Z8Og1LZQuQ4SBNHR0lbPWWp5vYeYsIZ6YxeZ4TAFAS61kvngNXg5HX7j1xydWEqYRpeOE1+xEyVflLf7vBqoSBfMmIKhH+bnHNSDXnrmTkC8pVuKF5XihPahw1jMrQ4dqwiOWTCCb8YAYIUMTWZJrec89XfCRLZnfZtPi1GKBmVOaTeIeXWgW3tvPH5lbDJT124+1BPC5ZpU9vDgsJvK+9KgboRN8H3cJVZMvuPciedm2UfaPDQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(3002001)(10201501046)(3231022)(6041248)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(6072148)(201708071742011); SRVR:DM5PR07MB3468; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3468; X-Forefront-PRVS: 05143A8241 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(366004)(346002)(199004)(189003)(6666003)(8676002)(2950100002)(42882006)(2906002)(50226002)(5009440100003)(305945005)(81156014)(8936002)(97736004)(5660300001)(101416001)(33646002)(478600001)(7736002)(81166006)(68736007)(107886003)(4326008)(25786009)(16526018)(50466002)(16586007)(48376002)(106356001)(6506006)(6486002)(6116002)(105586002)(3846002)(51416003)(76176011)(47776003)(72206003)(52116002)(8656006)(316002)(66066001)(1076002)(53936002)(6512007)(36756003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3468; H:localhost.localdomain; 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; DM5PR07MB3468; 23:RiCOfUTGWuRhj1YaNSm25XhdDhWekWaFugXQg7nYS?= =?us-ascii?Q?Na7bMpBEZ9NldNSgS2p2l/DyQQoLEW5me5o0di0xdHcslYgceP60iHdz7wvH?= =?us-ascii?Q?BnRzdblkxWKoVvtnnDUw88rQ8lAkpMsPm6ezXSB5oEtZ7WAQTFfg+qO0dJ0Y?= =?us-ascii?Q?bWjq1vYib+MhLtliwn7XFMmsLhd4ebVXcLEyI1UXC7NYaRTZV5JHSHRnvOq5?= =?us-ascii?Q?ixVFfL64OM4PwN8P6H231jM+xHyIlDqlDPoAMIKHPqg795BOKFrZBTs83col?= =?us-ascii?Q?EePxCyvP6Qe4p1j7xTFDnJLjMvfJIHqSLq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nostics: 1; DM5PR07MB3468; 6:3LWe2yv+Xs0IjzbhBh6KCPIjEdD1nEmnWU7hnJBqoepHEFWCGAbOFR/yJy77/nYAqLn6H7o/SvZdNZ1KjKKOrDdpO7YuRoLSLQc1YRv07+0uSy3Y9Qp9weQO4WlGk6DqIkWRV6iK83YJ+Uq4FQTdP/6D75XHfaKTWBSKEEtanihKsSxALH++CPBy3nVCHG9N77H1lNJF155ONLjekfmEQ+SGnFE7xhjYNRKrHuupoClsSGpRb08A94dufo6qkK30NC+xYrPsfO0VAe22BCwTl486A1C1yTcn3riAgKl9FnzA+J0j4Q04zq0QRHfRTKhE7pGz4G2xfYXHa8apoYi3fR+7R84b6VCXy+Eun8UH/2o=; 5:1EKakKo7niLzs9nr4qJwSvGs6MGX+kJhL8Krh7ER3ECGKKDDnghMFfBC0AQs56VDKEqhfpAt7Z5tuLkugIBJjzmMWHOmDdBx1ma6tfRnSYZokXTezjyL4Yz7n2hIU2oQLHMrvZhcf7YR7RxMSMoz4OwLy2V9AfePqRU7XUaDQx8=; 24:m6KUakaAx10LI1/HuDLdEzfU0y6FsOMzIaAM3q4N4VVwzVJCpQxrnYVLnyVbHEOxy8XQxGctTt1ugRSy1dHEs+ciRoxdO++Szlu3IpEZl+s=; 7:ruO91QKene6c3ufQw9FLLdr5jYkrk5+4FOQkWUtVb+mHoIPVzicbdm2baYjC8eLn+6XCH/jDbm3QqY+bblAFSfY5rnUf6PxQI9rjsA2ufVLmYGMOgJB45oZoHLK/6lZ3i+oLeSZU0jiEWnnkk0DNnqGjZKZjoES5UQZeTsKLAkzD1en/0BLPnDKyHzCQcq+0gvPabEow+vs1Plr1FQxJwNvE9TpYy7Ezem8n0V2r3R70mCIjBEDsue7keRm+XUYt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 20:39:23.3925 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 026333b9-0c14-4eb9-dcc5-08d53db29bd1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3468 Subject: [dpdk-dev] [PATCH 11/13] examples/eventdev: add atq single stage pipeline worker 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: Thu, 07 Dec 2017 20:39:30 -0000 Add optimized eventdev pipeline when ethdev supports thread safe Tx, number of configured stages is one and all type queue option is enabled. Signed-off-by: Pavan Nikhilesh --- .../eventdev_pipeline_sw_pmd/pipeline_worker_tx.c | 88 +++++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c index 15df21b7e..24ffd431f 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c @@ -106,6 +106,41 @@ worker_do_tx_single(void *arg) return 0; } +static int +worker_do_tx_single_atq(void *arg) +{ + struct worker_data *data = (struct worker_data *)arg; + const uint8_t dev = data->dev_id; + const uint8_t port = data->port_id; + size_t fwd = 0, received = 0, tx = 0; + struct rte_event ev; + + while (!fdata->done) { + + if (!rte_event_dequeue_burst(dev, port, &ev, 1, 0)) { + rte_pause(); + continue; + } + + received++; + + if (ev.sched_type == RTE_SCHED_TYPE_ATOMIC) { + worker_tx_pkt(ev.mbuf); + tx++; + continue; + } + work(ev.mbuf); + worker_fwd_event(&ev, RTE_SCHED_TYPE_ATOMIC); + worker_event_enqueue(dev, port, &ev); + fwd++; + } + + if (!cdata.quiet) + printf(" worker %u thread done. RX=%zu FWD=%zu TX=%zu\n", + rte_lcore_id(), received, fwd, tx); + return 0; +} + static int worker_do_tx_single_burst(void *arg) { @@ -153,6 +188,51 @@ worker_do_tx_single_burst(void *arg) return 0; } +static int +worker_do_tx_single_burst_atq(void *arg) +{ + struct rte_event ev[BATCH_SIZE + 1]; + + struct worker_data *data = (struct worker_data *)arg; + const uint8_t dev = data->dev_id; + const uint8_t port = data->port_id; + size_t fwd = 0, received = 0, tx = 0; + + while (!fdata->done) { + uint16_t i; + uint16_t nb_rx = rte_event_dequeue_burst(dev, port, ev, + BATCH_SIZE, 0); + + if (!nb_rx) { + rte_pause(); + continue; + } + + received += nb_rx; + + for (i = 0; i < nb_rx; i++) { + rte_prefetch0(ev[i + 1].mbuf); + if (ev[i].sched_type == RTE_SCHED_TYPE_ATOMIC) { + + worker_tx_pkt(ev[i].mbuf); + ev[i].op = RTE_EVENT_OP_RELEASE; + tx++; + } else + worker_fwd_event(&ev[i], + RTE_SCHED_TYPE_ATOMIC); + work(ev[i].mbuf); + } + + worker_event_enqueue_burst(dev, port, ev, nb_rx); + fwd += nb_rx; + } + + if (!cdata.quiet) + printf(" worker %u thread done. RX=%zu FWD=%zu TX=%zu\n", + rte_lcore_id(), received, fwd, tx); + return 0; +} + /* Multi stage Pipeline Workers */ static int @@ -697,9 +777,13 @@ set_worker_tx_setup_data(struct setup_data *caps, bool burst) uint8_t atq = cdata.all_type_queues ? 1 : 0; if (cdata.num_stages == 1) { - if (burst) + if (burst && atq) + caps->worker_loop = worker_do_tx_single_burst_atq; + if (burst && !atq) caps->worker_loop = worker_do_tx_single_burst; - if (!burst) + if (!burst && atq) + caps->worker_loop = worker_do_tx_single_atq; + if (!burst && !atq) caps->worker_loop = worker_do_tx_single; } else { if (burst && atq) -- 2.14.1