From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0042.outbound.protection.outlook.com [104.47.42.42]) by dpdk.org (Postfix) with ESMTP id D8BC81B169 for ; Wed, 10 Jan 2018 12:10:40 +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=g9gWYET3NkCrZrYpQEfg49bsDVBdQa4Ziv5G/DUyZoc=; b=BPb2BwOFwCKhj3Y5twYK7S9cXU+jOchTUA1CL+jsOqbWkqilBTXYLUupPRgPMlkVkGoVqa4oJVp/+p7I6mW1coi9YtmSmccOvLRwuwqmDPVxAy+aN1mZwSAMls3F2JjY0Sa6cNJRBvRieM3Yc8Ln4AEBevllxb1efCFq7O22K88= 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:35 +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:39:59 +0530 Message-Id: <20180110111013.14644-1-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: 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: ecd78a43-aa70-4ac0-ed1e-08d5581ac7b3 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:bsStNRHpzRhEOY50oC8cx8xZHKe2ExXUYbDuY+ImEHMnIiEgw37a3yJGg0jD3sZ5rqmIL/CFpEd69NxF/ZAMNX0DTaxFmpL0UnPeVfzVmpMmMImH+uM8FfIdaNNOUvZctibaBp0huYWlWUWalhAnb6HVu08ypzMAIUf4UI3qqPfENCC2zj58l9IQXOMYi3Mde+1mJpZdiPdta+sgVx1MWIFTuv9fu79CzTdEDDw685e0NNFvb9+lT3ydsPijynRl; 25:r+gBUIpjeQ9Pazes5cQgsO6NTPAthGaSkFH7alm3dw9KFVpiD9DMed+gAM/2RDEY55QHisf3cNAvnR6Uh5SbOk6FdjFapSyanYaVYureLG/s5mFISBonYGBTAZqARQ2ZUyPdZv1emCMGUA3bfM53hUe/2RJhChhSEAhzbU72EMMSVg0xhP5wF/tRINCkCDbblrfCIRe5oh255vYmYEVBNFxgMqjlwR9CmJNAPhFPnvp6MfSmc+k9P194vlVNy6qtWDPc8eob/3+zFsTu1MCMLNdMEr2sEql1YIojPYiecxGtvcK9xiHxkW4izVsMGgG6qgoUhAcMKwzVni3zGP+44w==; 31:cOiV6P2w8bzhRPmtHjOQN6CCXfCk2E1vXwti3sIEuVein/V/ks+EJ10LRXCSEoownAuT81uj3bL7+3ThnSVBe7DvJdNSQvXaQhROCH90Ya7ckvZljrjviTaOL2XgCCAnplVuYxGk3mbSh5OHp418/BYfdeHqqHAmzO+inCSBXo3G4B3Y6Cs99bg1OtyrdAcMyeC4A9ynxnnG6HX07yecHYWd7eBsyyx48hCxFO2BxGM= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:INRfwzlYv/kBZS8Pkn3ExiT9dFpBooS0lPB3Apo18moCO8RnW0aOlNjDuCgXk5tdhkwTdp/tLqZ4z9rQLfyQwEoKNNsWwzqaoCASQwIHLEnmbUhAtoggKIJhfB3fNqAKj2bpl9PvEe36ooGDWz5pn6YNBsPLfVstZ6XS+Gs30+wtPHiCzxudcaoE9qNLMGZgz5yFaU5VDNZUdQYlsm8c9WDOq7E7fiIY7xKFR5zKAYH6+0Q2/3eOvxZNBNmjSVL8jjroAIt1T+g1EOss+usyt2y+6prAqgcm5MXgO7kYk+6RKiYJPOF2X3kV9rv8nFyD/wW9gw0ikrS0zpPgeMBtZrc5IHpCthY2Tj/ppBoG1pDDjaaHldLPFIxUN+wzRaDD1sllYwwByNks/w3vy0x4S+HZGUgItpJ7VrP6mUkTGstQMBjENibIL1CAP2LH7K4mALrqO4k3Z7rrhuIJmNwAB21i1UNvNWa7vfyx7CvJelOSdCD2+DAbsXL9zu+AjQL3kn9ho0KFW+1D4NeMYEcv7QrYeQNIZR2n93N0ihE1gn3DVlh3wcui6/CNzp7iZfhOa0WwojJlbr9vM3cNqmYTolgCxna3ZdDk+RUfvS/8vGg=; 4:2bXBlN7hj887ivMBPrZd4NaHHrL0OtWba/PE1bJ+PTRBKcFuWDI3SvS+9MqsMkraGDojOdIEm1WGFtF/WDSjLcLMMbtXb7qOMfbRwWksTe3rDEN4VDdZlD30fqrkwjw6GBDbamjWwwczRhd/t0HGKtqBDSdbJgkidG4W5QTTARKYz3UKr7+JV1x3PGiELrlVxUUZjeM+6C+285HTFNLjNIeZVgcd5JHCfwePwT789yJdKV8t9qtWQARmlfFwtRwr2AmrDyMYpqQYf1MxEADkqQ== X-Microsoft-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)(59450400001)(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:k1iThavC5Mj/ZlF+FNBLalLUdu9agZxVtHoMAWo4K?= =?us-ascii?Q?2UAAEKfB93ANIZDx9m+H9+yZ20hyNFQkLY53nJ9xaZDXOyINuLy/Hx+WPEId?= =?us-ascii?Q?e27FS/0uvs/qso0ZdtJL3q9cuOVRUav4R4RkaDWFOV8+4+KpuPTrUEhXXDHE?= =?us-ascii?Q?Y913SSEDndIRO5N6p3XAda5kCM83iQVYBDH/eq/gVgU+exginnzIa3xG11Hz?= =?us-ascii?Q?gs/gWKY5uXSlGZQptsZvrjUvaPPlCKpLumPLEqntxIewDtc3MII5d+v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hsZ9fehPYHP+C6BRrnZF10Z7moiDkjTeWPdCoFfAViL/tVK+9OVDISM78An72oYqFpZ7p+GaE8qr2ovASgdYZb0es3q2Rp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 11:10:35.9394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ecd78a43-aa70-4ac0-ed1e-08d5581ac7b3 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 01/15] examples/eventdev: add Rx adapter support 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:10:41 -0000 Use event Rx adapter for packets Rx instead of explicit producer logic. Use service run iter function for granular control instead of using dedicated service lcore. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - split work funtion into delay cycles and excange_mac - add option to configure mempool size - remove prod_data structure(Gage) - simplifly locks used while calling producer and scheduler(Gage) examples/eventdev_pipeline_sw_pmd/main.c | 168 +++++++++++++++---------------- 1 file changed, 80 insertions(+), 88 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index 2e9a6d208..111dcb0ea 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -46,26 +46,19 @@ #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; uint8_t release; } __rte_cache_aligned; -static struct prod_data prod_data; static struct cons_data cons_data; struct worker_data { @@ -75,10 +68,9 @@ struct worker_data { 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; @@ -106,6 +98,7 @@ struct config_data { unsigned int worker_cq_depth; int16_t next_qid[MAX_NUM_STAGES+2]; int16_t qid[MAX_NUM_STAGES]; + uint8_t rx_adapter_id; }; static struct config_data cdata = { @@ -206,64 +199,21 @@ consumer(void) return 0; } -static int -producer(void) -{ - static uint8_t eth_port; - struct rte_mbuf *mbufs[BATCH_SIZE+2]; - struct rte_event ev[BATCH_SIZE+2]; - uint32_t i, num_ports = prod_data.num_nic_ports; - int32_t qid = prod_data.qid; - uint8_t dev_id = prod_data.dev_id; - uint8_t port_id = prod_data.port_id; - uint32_t prio_idx = 0; - - const uint16_t nb_rx = rte_eth_rx_burst(eth_port, 0, mbufs, BATCH_SIZE); - if (++eth_port == num_ports) - eth_port = 0; - if (nb_rx == 0) { - rte_pause(); - return 0; - } - - for (i = 0; i < nb_rx; i++) { - ev[i].flow_id = mbufs[i]->hash.rss; - ev[i].op = RTE_EVENT_OP_NEW; - ev[i].sched_type = cdata.queue_type; - ev[i].queue_id = qid; - ev[i].event_type = RTE_EVENT_TYPE_ETHDEV; - ev[i].sub_event_type = 0; - ev[i].priority = RTE_EVENT_DEV_PRIORITY_NORMAL; - ev[i].mbuf = mbufs[i]; - RTE_SET_USED(prio_idx); - } - - const int nb_tx = rte_event_enqueue_burst(dev_id, port_id, ev, nb_rx); - if (nb_tx != nb_rx) { - for (i = nb_tx; i < nb_rx; i++) - rte_pktmbuf_free(mbufs[i]); - } - - return 0; -} - static inline void schedule_devices(unsigned int lcore_id) { - if (fdata->rx_core[lcore_id] && (fdata->rx_single || - rte_atomic32_cmpset(&(fdata->rx_lock), 0, 1))) { - producer(); - rte_atomic32_clear((rte_atomic32_t *)&(fdata->rx_lock)); + if (fdata->rx_core[lcore_id]) { + rte_service_run_iter_on_app_lcore(fdata->rxadptr_service_id, + !fdata->rx_single); } - if (fdata->sched_core[lcore_id] && (fdata->sched_single || - rte_atomic32_cmpset(&(fdata->sched_lock), 0, 1))) { - rte_service_run_iter_on_app_lcore(fdata->evdev_service_id, 1); + if (fdata->sched_core[lcore_id]) { + rte_service_run_iter_on_app_lcore(fdata->evdev_service_id, + !fdata->sched_single); if (cdata.dump_dev_signal) { rte_event_dev_dump(0, stdout); cdata.dump_dev_signal = 0; } - rte_atomic32_clear((rte_atomic32_t *)&(fdata->sched_lock)); } if (fdata->tx_core[lcore_id] && (fdata->tx_single || @@ -566,6 +516,70 @@ parse_app_args(int argc, char **argv) } } +static inline void +init_rx_adapter(uint16_t nb_ports) +{ + int i; + int ret; + uint8_t evdev_id = 0; + struct rte_event_dev_info dev_info; + + ret = rte_event_dev_info_get(evdev_id, &dev_info); + + struct rte_event_port_conf rx_p_conf = { + .dequeue_depth = 8, + .enqueue_depth = 8, + .new_event_threshold = 1200, + }; + + if (rx_p_conf.dequeue_depth > dev_info.max_event_port_dequeue_depth) + rx_p_conf.dequeue_depth = dev_info.max_event_port_dequeue_depth; + if (rx_p_conf.enqueue_depth > dev_info.max_event_port_enqueue_depth) + rx_p_conf.enqueue_depth = dev_info.max_event_port_enqueue_depth; + + ret = rte_event_eth_rx_adapter_create(cdata.rx_adapter_id, evdev_id, + &rx_p_conf); + if (ret) + rte_exit(EXIT_FAILURE, "failed to create rx adapter[%d]", + cdata.rx_adapter_id); + + struct rte_event_eth_rx_adapter_queue_conf queue_conf = { + .ev.sched_type = cdata.queue_type, + .ev.queue_id = cdata.qid[0], + }; + + for (i = 0; i < nb_ports; i++) { + uint32_t cap; + + ret = rte_event_eth_rx_adapter_caps_get(evdev_id, i, &cap); + if (ret) + rte_exit(EXIT_FAILURE, + "failed to get event rx adapter " + "capabilities"); + + ret = rte_event_eth_rx_adapter_queue_add(cdata.rx_adapter_id, i, + -1, &queue_conf); + if (ret) + rte_exit(EXIT_FAILURE, + "Failed to add queues to Rx adapter"); + } + + ret = rte_event_eth_rx_adapter_service_id_get(cdata.rx_adapter_id, + &fdata->rxadptr_service_id); + if (ret != -ESRCH && ret != 0) { + rte_exit(EXIT_FAILURE, + "Error getting the service ID for Rx adapter\n"); + } + rte_service_runstate_set(fdata->rxadptr_service_id, 1); + rte_service_set_runstate_mapped_check(fdata->rxadptr_service_id, 0); + + ret = rte_event_eth_rx_adapter_start(cdata.rx_adapter_id); + if (ret) + rte_exit(EXIT_FAILURE, "Rx adapter[%d] start failed", + cdata.rx_adapter_id); + +} + /* * Initializes a given port using global settings and with the RX buffers * coming from the mbuf_pool passed as a parameter. @@ -676,15 +690,14 @@ struct port_link { }; static int -setup_eventdev(struct prod_data *prod_data, - struct cons_data *cons_data, +setup_eventdev(struct cons_data *cons_data, struct worker_data *worker_data) { const uint8_t dev_id = 0; /* +1 stages is for a SINGLE_LINK TX stage */ const uint8_t nb_queues = cdata.num_stages + 1; - /* + 2 is one port for producer and one for consumer */ - const uint8_t nb_ports = cdata.num_workers + 2; + /* + 1 for consumer */ + const uint8_t nb_ports = cdata.num_workers + 1; struct rte_event_dev_config config = { .nb_event_queues = nb_queues, .nb_event_ports = nb_ports, @@ -838,27 +851,6 @@ setup_eventdev(struct prod_data *prod_data, __LINE__, i); return -1; } - /* port for producer, no links */ - struct rte_event_port_conf rx_p_conf = { - .dequeue_depth = 8, - .enqueue_depth = 8, - .new_event_threshold = 1200, - .disable_implicit_release = disable_implicit_release, - }; - - if (rx_p_conf.dequeue_depth > config.nb_event_port_dequeue_depth) - rx_p_conf.dequeue_depth = config.nb_event_port_dequeue_depth; - if (rx_p_conf.enqueue_depth > config.nb_event_port_enqueue_depth) - rx_p_conf.enqueue_depth = config.nb_event_port_enqueue_depth; - - if (rte_event_port_setup(dev_id, i + 1, &rx_p_conf) < 0) { - printf("Error setting up port %d\n", i); - return -1; - } - - *prod_data = (struct prod_data){.dev_id = dev_id, - .port_id = i + 1, - .qid = cdata.qid[0] }; *cons_data = (struct cons_data){.dev_id = dev_id, .port_id = i, .release = disable_implicit_release }; @@ -962,12 +954,12 @@ main(int argc, char **argv) if (worker_data == NULL) rte_panic("rte_calloc failed\n"); - int dev_id = setup_eventdev(&prod_data, &cons_data, worker_data); + int dev_id = setup_eventdev(&cons_data, worker_data); if (dev_id < 0) rte_exit(EXIT_FAILURE, "Error setting up eventdev\n"); - prod_data.num_nic_ports = num_ports; init_ports(num_ports); + init_rx_adapter(num_ports); int worker_idx = 0; RTE_LCORE_FOREACH_SLAVE(lcore_id) { @@ -982,8 +974,8 @@ main(int argc, char **argv) if (fdata->rx_core[lcore_id]) printf( - "[%s()] lcore %d executing NIC Rx, and using eventdev port %u\n", - __func__, lcore_id, prod_data.port_id); + "[%s()] lcore %d executing NIC Rx\n", + __func__, lcore_id); if (fdata->tx_core[lcore_id]) printf( -- 2.15.1