From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0084.outbound.protection.outlook.com [104.47.32.84]) by dpdk.org (Postfix) with ESMTP id 9326A1B015 for ; Wed, 10 Jan 2018 12:11:16 +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=uyUECZWLvgyAxynoVE0YJsHSlzL5KfS2Po6+bEFgeMk=; b=hR/SraCeZjb/4fwNkV261MmVB1kpjDgKNbcXzWzlHwNovk9DKubekZPJTqK2ZSe5eWCjF0PLX3j9nf+GkZQvr9sgO0VMfVTmFklh1Xw1Ib3xq9BKemRXmd3MDsykb/Gvj+uyjgwo8y1IqBLUAJI90Ut+eu4B4UQ5K7pLL2xo1iI= 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.386.5; Wed, 10 Jan 2018 11:11:12 +0000 From: Pavan Nikhilesh To: gage.eads@intel.com, jerin.jacobkollanukkaran@cavium.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com, liang.j.ma@intel.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Wed, 10 Jan 2018 16:40:10 +0530 Message-Id: <20180110111013.14644-12-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180110111013.14644-1-pbhagavatula@caviumnetworks.com> References: <20171207203705.25020-1-pbhagavatula@caviumnetworks.com> <20180110111013.14644-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: CY4PR1701CA0010.namprd17.prod.outlook.com (10.171.208.20) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6be40dc0-bf76-41eb-3d65-08d5581add5b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:b4YeUGu19yqbkTIqUiX0Hjh5CtX/NyR8/XQk4twP2UTpLW7VHnCcN4ZERbnklIRHLOr4mKiUIrDYA6rhsqjNlb6G8mXHXXnixPao2LO8pmD5MW5iTQO2CF3sjFTcAznppXFpXEVqfv0u6d9ag91yjJN1Fx9EKyD6BZNbtwsAreWPbT6pA8L/42Jv9QHXwNub7sZEtwBSR+EfO2IVlX75pz5ysDtBn69J5VeJTg4+tIScgbNPEAl0TU+O9dJ9YIxy; 25:dc2SZboussaAWtjpDX9ljJYAKkhx/Tz8RB+iBlGfWM6yYdhMIxUSSfhvBU2kWjpmbuPqoymBuc2C4KvuYCaYgV28Io+6x3EkZv2V/K3K73kIo2yIkiZidWhrd48XamzPwm4EFvFUDkNybjSNBpMb/tP80C4lJ4yxx3nt2bvVQXof3J+noV4Pty9SOisBGWcYH3ZMVOlw6FhW6SFL9JyMS/sV0kwfcGuowg3xFU5QYtX3097UxkglMGMthjCqvdCSrQ2OsvQPNlUKHWkU2VUVUoxxx3GpD5SnOtDk0EPYOd0gKP8bkTYNHDVOq5C6VlLN8IJl5eIbqumNuNf6grEPBw==; 31:ekztZhtlIoHGPFJ3gBEBV5n5bY1P3NPoSVBx5Cvw4uirNns0smq6VJpMQF7/PKHkXVf3FVB4HcQRp3EkooXTx10haDUgQQz3KIzubEUw8NHCv7MprBdxwxJBjkxOnVOGK84xMIRsvsBWnDKpncQ7wXoK26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ft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(3231023)(944501075)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(39380400002)(376002)(346002)(396003)(39860400002)(199004)(189003)(4326008)(8656006)(81156014)(316002)(81166006)(5009440100003)(53416004)(50466002)(50226002)(16586007)(8936002)(16526018)(47776003)(68736007)(66066001)(48376002)(36756003)(69596002)(25786009)(107886003)(575784001)(42882006)(2950100002)(106356001)(5660300001)(51416003)(52116002)(386003)(53936002)(6636002)(105586002)(97736004)(305945005)(7736002)(8676002)(6116002)(3846002)(2906002)(478600001)(72206003)(6512007)(76176011)(6486002)(6506007)(1076002)(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:waBxNJOT0QABRe4ynlsKxNRDuE5PEeiSTAh6QDqJE?= =?us-ascii?Q?58qjymivyIPzEJICxw+H3pUyQit1lEj2I2fAbKFqBYb+C4LgHoGIQJhccja4?= =?us-ascii?Q?+LAs4pqgDwUErbS6vTmqnSRwpr3w9N/Uj5Ejp0FBkeTWIpqXoRm24Y6dO0Am?= =?us-ascii?Q?Gnjt3/f506WFry5X91NUIZGz5UJVNEAdrseBwRmTBG6Ig9OgSen7vxdUxqnl?= =?us-ascii?Q?Tdr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F1IjsBkvkgIBMD0k2wCe3DAdcFMIUQi3D7B+8O5H8W4Vc14paLJ+5YJ38+hCiZYw9saWMvNkfjAIt4yVG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 11:11:12.2524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6be40dc0-bf76-41eb-3d65-08d5581add5b 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 v2 12/15] 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: Wed, 10 Jan 2018 11:11:17 -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 | 104 ++++++++++++++++++++- 1 file changed, 101 insertions(+), 3 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c index 21985b00d..c0d1bd9fb 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c @@ -81,6 +81,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(); + 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) { @@ -127,6 +162,50 @@ 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(); + } + + 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 @@ -683,6 +762,24 @@ worker_tx_opt_check(void) } } +static worker_loop +get_worker_loop_single_burst(uint8_t atq) +{ + if (atq) + return worker_do_tx_single_burst_atq; + + return worker_do_tx_single_burst; +} + +static worker_loop +get_worker_loop_single_non_burst(uint8_t atq) +{ + if (atq) + return worker_do_tx_single_atq; + + return worker_do_tx_single; +} + static worker_loop get_worker_loop_burst(uint8_t atq) { @@ -704,10 +801,12 @@ get_worker_loop_non_burst(uint8_t atq) static worker_loop get_worker_single_stage(bool burst) { + uint8_t atq = cdata.all_type_queues ? 1 : 0; + if (burst) - return worker_do_tx_single_burst; + return get_worker_loop_single_burst(atq); - return worker_do_tx_single; + return get_worker_loop_single_non_burst(atq); } static worker_loop @@ -736,5 +835,4 @@ set_worker_tx_setup_data(struct setup_data *caps, bool burst) caps->scheduler = schedule_devices; caps->evdev_setup = setup_eventdev_worker_tx; caps->adptr_setup = init_rx_adapter; - } -- 2.15.1