From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0078.outbound.protection.outlook.com [104.47.42.78]) by dpdk.org (Postfix) with ESMTP id BEE621B169 for ; Wed, 10 Jan 2018 12:10:59 +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=0lZM44oPqf94x0o9Lk/auOVYY1Eh5bADOH4c/ALsiE8=; b=UHiIntdDvznFZSn2e8gMkQ7aq3w+eRmTBcPqcDC5nFrcwDBH+G68FjuaPVikDk3nR4fhOny/4YZK0j/wzbwhoqSaJDQ4VWU1OJR8tNetP0BzeljN30jx5oMPzo1exTSlwyG25y/EjA+zVy4ZHTtEy+lKmfQuS4OYJ+dRfyTvQu4= 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:10:55 +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:05 +0530 Message-Id: <20180110111013.14644-7-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: 062fd5c3-e622-466d-1e49-08d5581ad383 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:CODIw1qMDSjFSK1DQq81JqCpz/d2ziiCP88cRarnD0c2JLtWJZQC7c0XZdgx/JA2AYaDsMnn2qHkb4u3QaFiWHc1PpbRDF1WZ4llm+s2m+l6RJHQR5WcG1HykC0SFsKIjvhZD8ku/V0uKyoePmcBlNyD1uYsrp7xSLCmfM3zYOIA+a2V0dHwNrAkDMIVSv6T8FW0vS3YEi6DDnBO3oueTiVNrYHLDIWbZ25rmR4Q2nZSCbaUUMb43UiMmn1zszLg; 25:rJUHj08po+5WSBFtXlwtrkw3a1DrBZVGyQ28nWKVk8eZztmZBd+41M+o9zxuM8s6F6nqL2PgFaBexTZV/US8PdCgcSVCI7ES6MvP9H0TQHiH4iehsW+Z1Q9H5ItIEKVSUH0m3kHbzACBPoA5Xw4vLwlYl3KX+Zgx7IvaXf94Cs/ctSw3EtXzf1Zz/dcm30FjQTlYLbSbE6OfXVLIoVaeedYWqy5rYJ753O+CpBrc9rkhGAaF14VKCUeAL+dPRSYxMeWicdatOIGAI/Hs3nHQaMJDUVIYA5lYG3Dk+6HCSVGxf/3Qsfwt9v168SeoVO3LPBe0//eTw0PoK4Qj6ZcHpw==; 31:RQJnPtj7QQhnoZSxaRlVQnXGQhi5Fq+nWkFJ7p5veb5pcTwD7oTBUJJDn8RDvWG3JFYvZetlNXEWssaMkP64l+/JWHIpq5qCVM0qETVj248wHKssUhSbQcDAEfMALR2ohA3k+SP4uWSCEl3vn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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)(42882006)(2950100002)(106356001)(5660300001)(51416003)(52116002)(386003)(53936002)(6636002)(6666003)(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:UPM1zq70t6V7kWi/CNAhvx09gxAhEh5xmRbAjRZo2?= =?us-ascii?Q?X0SH9SWUjzL0sWyZuaEVFLWgfgvJ5fdBUk6LT342u/7bjsnhzc/BOwY4CYlU?= =?us-ascii?Q?ppyc6mTrYUcWsFNvKRoR2+NveV4v5q0w99o8MsAi8hCjlSxMzXt2DPuraBY8?= =?us-ascii?Q?J+5EjPv830jyrvbe27RHaKyJw6WnNX2pk2RaoBcG7iI03nSK+n/k01E3SBJh?= =?us-ascii?Q?o7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ofjrw3ZRpDgNPvlCQcp6xJR7XFI9g+Gc1Tkz6TvP2qMuEp0en8JcDGJacKaUfMK2j7DzCbPq3NPfXlncdn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 11:10:55.7834 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 062fd5c3-e622-466d-1e49-08d5581ad383 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 07/15] examples/eventdev: modify work cycles 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:00 -0000 The current work cycles function exchanges source and destination mac address and also pauses the core for the given cycles. This patch splits the function into two parts i.e. exchange mac and pause the cores. The pause cores function is invoked at every stage where as exchange mac is invoked when packet is transmitted. Signed-off-by: Pavan Nikhilesh --- examples/eventdev_pipeline_sw_pmd/pipeline_common.h | 11 +++++------ examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c | 7 +++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h index 9e1f5e9f0..d58059b78 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h @@ -99,21 +99,20 @@ struct fastpath_data *fdata; struct config_data cdata; static __rte_always_inline void -work(struct rte_mbuf *m) +exchange_mac(struct rte_mbuf *m) { struct ether_hdr *eth; struct ether_addr addr; /* change mac addresses on packet (to use mbuf data) */ - /* - * FIXME Swap mac address properly and also handle the - * case for both odd and even number of stages that the - * addresses end up the same at the end of the pipeline - */ eth = rte_pktmbuf_mtod(m, struct ether_hdr *); ether_addr_copy(ð->d_addr, &addr); ether_addr_copy(&addr, ð->d_addr); +} +static __rte_always_inline void +work(void) +{ /* do a number of cycles of work per packet */ volatile uint64_t start_tsc = rte_rdtsc(); while (rte_rdtsc() < start_tsc + cdata.worker_cycles) diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c index f4523902b..90f87709c 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c @@ -45,7 +45,7 @@ worker_generic(void *arg) ev.op = RTE_EVENT_OP_FORWARD; ev.sched_type = cdata.queue_type; - work(ev.mbuf); + work(); while (rte_event_enqueue_burst(dev_id, port_id, &ev, 1) != 1) rte_pause(); @@ -101,7 +101,7 @@ worker_generic_burst(void *arg) events[i].op = RTE_EVENT_OP_FORWARD; events[i].sched_type = cdata.queue_type; - work(events[i].mbuf); + work(); } uint16_t nb_tx = rte_event_enqueue_burst(dev_id, port_id, events, nb_rx); @@ -148,6 +148,7 @@ consumer(void) received++; uint8_t outport = packet.mbuf->port; + exchange_mac(packet.mbuf); rte_eth_tx_buffer(outport, 0, fdata->tx_buf[outport], packet.mbuf); @@ -212,6 +213,8 @@ consumer_burst(void) received += n; for (i = 0; i < n; i++) { uint8_t outport = packets[i].mbuf->port; + + exchange_mac(packets[i].mbuf); rte_eth_tx_buffer(outport, 0, fdata->tx_buf[outport], packets[i].mbuf); -- 2.15.1