From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0083.outbound.protection.outlook.com [104.47.38.83]) by dpdk.org (Postfix) with ESMTP id 8BBE82B89 for ; Thu, 7 Dec 2017 21:38:25 +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=7Ioj6HP7pqZamF+OO/F0o5UkjdqRd43fkw1y/zzmGdM=; b=RR/ResTShAA0lOeMbMDbqLUMt1f/VPBLVhS76fQknCEY69wf4DORx7NxWhuvwO2FdN9cFa3ZswoMv/kBrW8KhVB6/BDZ8rNozFf+kdBK7+nK6g8SQbKV50UDMj/ZH+9nQ3uil3bzk+qeTZPDrgdV28EE7gXCWCAXrvQMg/Q0EQs= 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:38:20 +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:06:54 +0530 Message-Id: <20171207203705.25020-3-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: e3b3ce1f-be1c-4d09-023e-08d53db275e3 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:Z3MQfb5tjmC4lLVNI/5w8NP8XHeigk1vKB6WIJ8Y+30IkWTmXPdOGJSKjEMVekM2rJ88GijC6vQyxnFg0i8iYWlMlUbw3leoo138GOm5TgTzyoSJyYOkGq+lJSv+0n9LB/8RE5s493pdGLKa4Q5IaE5v2073IOYIvzU8XC4T0yxorimbZdC7hv4Wd5MiqE23MYtbzcVpDa+XONfNS9PfoelSDNm/sDrOOgvxe15TztmvGtPvsUEOVhf2eP65aQuF; 25:xStEFWpb8CSsiCzhBKl+UBlgxnQcnRL3UBuSpEYA0wHguZ7WK+oBXU3sHx1ACojaBWagSGSTJTczLHw0ICsZN64nu2lcEMF5v3v6mC8WISGlq+bwI5f3GtHGLUTynNvJblmN11ggYWzLYOSlNYtCC8sG5HmbEtyQFT4/nG+vLIvFlLqLL6Sg+c3yBT43/6EtuuQ+GJt0O0TsOUXwxiHfZtqpvMfiFtMWyBuHrNGGd/qhgobLFHUFqTgbkmK1eoPd6IlSkVjCC3PUT+oG+zscbWKwLk2wj6PUuMz5zY3vUGM572vl9X3k0aeFbUU+a7OyToe0v/F5ujTTbF1mlWBf0A==; 31:FrJ+a4XQ69AyBtZaYjWBOlWbVHOsYQ5TWrKIe94YRXX/4lyrzlJTrL6nHyszSyBxUiRu49oFWN3qLkCfGYBT8iUiPqqnpOAcmtRgErqdXbjv2JruL3GfzcIcxyoj/tBAtfJdHrw9kApXgMgd9aIGf+mE3bFL5GSW3XvYtHIp5/r3zV/Am997zyalCVZYDsYdorukznC2n0pXmuRTr+PsBtMWRpKc5nu0k5sVazDIkic= X-MS-TrafficTypeDiagnostic: DM5PR07MB3468: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3468; 20:oLm8NbY7pQ6XcRrFsixqJt6+wIRDZvqHgBSVupHYUXS82FfdFdcheiR/sQM2DmGH+1FrPJGeA2l4AVPa+WbGQYkwi95JwdGc+9SZ6pxx8r9wM30gPATbSYqo8fGvcqf2m8LfbI/GfKr5yl7VzBdey4ImmZ9zzKTie04djyuWiQqcFTY85kFtlTZ92FbYUqtHH9aZ6XqQrHwPbGNthC4Gkvzs2SLT9fambltvPPHie+Z6iBr7YPuD9cwDA2FKxCk98aoqt3iPLjHgq2lFxVAJ0ObSsSg6Eb7PILSVORLnvrPBnGe0Fe1xXtu+NEjQ8JddIaLq238JHDju46A+bIFsR9O3sVUd51oRpTXBO+3CjVHvOOR+xuX8cyPm/Ux+JQztJ52ntYXwSlzcbYsx+HY1PcOmdVVeo+HoCIVhcEEgO0N4lNUhCcurXka/wmyYyp+QTAiBDilquzj9d/IEvZ521AWxIccRtutZZYRci2uXqkxJmbYg6PtxRd/f1tMjwQh+lNMr+KG+EjC54pNE7OYBS3HPHjbGtm2OhciK9anllIIpMjYJgNN375idg5CB8rv1Ip0CTCShGgNS1gcm0dsP1PtMhnglgfQvgxw6+NW8msI=; 4:pdcgPYtRBhgjvrM7+5fcWiCbxOvQ9vZnIEtSTInfFLutAJ8wl4UwnR70aSgLDDhTIuBYNdRfC2ymD3Qt54iAUQ0+imDQNI5Nfw3kpgyzLigRv41sVfGeNQaArBXvy06vZTMfWZAtaaqxTrJNNcQejFRLdgLNq0KzE+TWQbd3vV16RCZjSykIT5VHEWlyt63k10bhd8zVDnJTzyaME2LKmt338nBH+I3rm2zZhAkc5eGVOYPpf6nF7hRvhQiR/JTci1GEWkiqHulQTKSCpwWcsg== 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:dyq5SsForWdhbTNEAk5bNo4ka82ehgsx6ksTp6IR+?= =?us-ascii?Q?uIeLXJmdWCs7djIc5vPYZNO6o09i2fO5LSza49sKl4JN6bm4kl401bFmxI+L?= =?us-ascii?Q?bOwiEnZErU1UQMVVk2X4sDiyGSa2NuLntQ7EnNUh0n8q6ylrSiYzAopMcAED?= =?us-ascii?Q?5TwI6tF1bN6K3mTC4sRh7VLEdU55Ters4+GYbCE49x50ISWEEBtnAwWgV707?= =?us-ascii?Q?ywG4nnsVb+lV4UJoMMXP3cSXlpMMQA6aP1UVWUY+VKocWUBOa8MOj54bzI0D?= =?us-ascii?Q?SkdcdUWBnyRAXBSk9DGqovSqm0Dckn83GnzOMZX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-Exchange-Diagnostics: 1; DM5PR07MB3468; 6:awPtEZYRLVg9tByOkg2vdvvbnG6i7zB5pxgaC+t9lyEQXssi+RzWPNKIPh6b7RlcRmQmwzOGIj+mQjUDVGmEKU3yvZNB+G8/iM2QmvDigZ9YU7nBOunYwdqwBvJG1zXv5Hrnb4iSVIlIodTGhYPcR4iyvZqfeiNbG/9JsG/uvA39HtdXSFffLlSWADxKuUtP4olQnlpHdshv9EjihHbj2o4NTtaajgsXfKqyJNp8/nwSJiHLrCrwOTvS5Q/JbapqMM8UhA/pKLnlYa2+PZPcNi3x1RWDpZ19SB2pnvPm6XpANuMSuMvJKnUj1ZZR1CQ6d0YrSGWGFJ/O/hK0BtaY6WBFu4QuUQFwnsBkFpJyq7A=; 5:GaZNSJRKek7bFJsft1WkKnNdvlKGfGTcyQJrHw/Nmf+DnWjySY65OjpOr55lVyBTVj7aeC4wi2KFllNLURQY7rOo5MTJ0+uIKddjSURAUA7H1wjpIHvpBhQqoIB0dspVt/qReZsfUuzYqE1LznE/75U40YLvR8iL9zoveadVg/Q=; 24:k95eKt2FYwZJhqFKlfB4Fk/AluqidrJktEpHx2AcG+SuLXDs2iMKxgHYNrMYCoSkzeRkMZ9DKNbhh8omluBb+ljLHXIbt4cvendwmyHsGjo=; 7:gL4Jlweh8uQM3NfzQXXEnmYYnCypgESsYCK3bgwuOzKnqqlHKu5CV5iAycrxzNmUKhtxOcXbjVWkS8VnIRPyzdjaK4C2hyRg6EBfI7o4IwXw68MnSfW7snq/iBlI1wyeZC2ntD8ihTMuSHzFdZou0PLvNtxjiMsuVSo+nF+OEUr8X0zJiy7WwpwMswWWMV7Y/63/OlaM/0HctnCQdUBEYnmQNq0toDtjMAi2yzEOetDimwK0XUx3nvo54OEl7cYw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2017 20:38:20.2827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3b3ce1f-be1c-4d09-023e-08d53db275e3 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 02/13] examples/eventdev: move common data into pipeline common 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:38:26 -0000 Move common structures and functions into pipeline_common.h so that they can be used by different kinds of pipelines. Signed-off-by: Pavan Nikhilesh --- examples/eventdev_pipeline_sw_pmd/main.c | 77 +-------------- .../eventdev_pipeline_sw_pmd/pipeline_common.h | 109 +++++++++++++++++++++ 2 files changed, 112 insertions(+), 74 deletions(-) create mode 100644 examples/eventdev_pipeline_sw_pmd/pipeline_common.h diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index bb87c9544..c9702fddd 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -2,6 +2,7 @@ * BSD LICENSE * * Copyright(c) 2016-2017 Intel Corporation. All rights reserved. + * Copyright 2016 Cavium, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,82 +36,10 @@ #include #include #include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAX_NUM_STAGES 8 -#define BATCH_SIZE 16 -#define MAX_NUM_CORE 64 - -struct prod_data { - uint8_t dev_id; - uint8_t port_id; - int32_t qid; - unsigned int num_nic_ports; -} __rte_cache_aligned; - -struct cons_data { - uint8_t dev_id; - uint8_t port_id; -} __rte_cache_aligned; - -static struct prod_data prod_data; -static struct cons_data cons_data; - -struct worker_data { - uint8_t dev_id; - uint8_t port_id; -} __rte_cache_aligned; - -struct fastpath_data { - volatile int done; - uint32_t rx_lock; - uint32_t tx_lock; - uint32_t sched_lock; - uint32_t evdev_service_id; - uint32_t rxadptr_service_id; - bool rx_single; - bool tx_single; - bool sched_single; - unsigned int rx_core[MAX_NUM_CORE]; - unsigned int tx_core[MAX_NUM_CORE]; - unsigned int sched_core[MAX_NUM_CORE]; - unsigned int worker_core[MAX_NUM_CORE]; - struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS]; -}; -static struct fastpath_data *fdata; - -struct config_data { - unsigned int active_cores; - unsigned int num_workers; - int64_t num_packets; - unsigned int num_fids; - int queue_type; - int worker_cycles; - int enable_queue_priorities; - int quiet; - int dump_dev; - int dump_dev_signal; - unsigned int num_stages; - unsigned int worker_cq_depth; - int16_t next_qid[MAX_NUM_STAGES+2]; - int16_t qid[MAX_NUM_STAGES]; - uint8_t rx_adapter_id; -}; +#include "pipeline_common.h" -static struct config_data cdata = { +struct config_data cdata = { .num_packets = (1L << 25), /* do ~32M packets */ .num_fids = 512, .queue_type = RTE_SCHED_TYPE_ATOMIC, diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h new file mode 100644 index 000000000..938e155d3 --- /dev/null +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h @@ -0,0 +1,109 @@ +/* + * BSD LICENSE + * + * Copyright 2016 Intel Corporation. + * Copyright 2016 Cavium, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium, Inc nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_NUM_STAGES 8 +#define BATCH_SIZE 16 +#define MAX_NUM_CORE 64 + +struct prod_data { + uint8_t dev_id; + uint8_t port_id; + int32_t qid; + unsigned int num_nic_ports; +} __rte_cache_aligned; + +struct cons_data { + uint8_t dev_id; + uint8_t port_id; +} __rte_cache_aligned; + +struct worker_data { + uint8_t dev_id; + uint8_t port_id; +} __rte_cache_aligned; + +struct fastpath_data { + volatile int done; + uint32_t rx_lock; + uint32_t tx_lock; + uint32_t sched_lock; + uint32_t evdev_service_id; + uint32_t rxadptr_service_id; + bool rx_single; + bool tx_single; + bool sched_single; + unsigned int rx_core[MAX_NUM_CORE]; + unsigned int tx_core[MAX_NUM_CORE]; + unsigned int sched_core[MAX_NUM_CORE]; + unsigned int worker_core[MAX_NUM_CORE]; + struct rte_eth_dev_tx_buffer *tx_buf[RTE_MAX_ETHPORTS]; +} __rte_cache_aligned; + +struct config_data { + unsigned int active_cores; + unsigned int num_workers; + int64_t num_packets; + unsigned int num_fids; + int queue_type; + int worker_cycles; + int enable_queue_priorities; + int quiet; + int dump_dev; + int dump_dev_signal; + unsigned int num_stages; + unsigned int worker_cq_depth; + int16_t next_qid[MAX_NUM_STAGES+2]; + int16_t qid[MAX_NUM_STAGES]; + uint8_t rx_adapter_id; +}; + +struct prod_data prod_data; +struct cons_data cons_data; + +struct fastpath_data *fdata; +struct config_data cdata; -- 2.14.1