From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0064.outbound.protection.outlook.com [104.47.42.64]) by dpdk.org (Postfix) with ESMTP id EAEBE1B169 for ; Wed, 10 Jan 2018 12:11:09 +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=+xT29zxqMDevS7To99JvTmHNfftORSK+UC+FffvANxA=; b=kwHsnV6UrZV0SSplmmJPCGMg8Hl2qasiO6Bf0fmBZVU3JHmSOMBOHM05GuW3BaKcYazKaKF0YiBMH4cVXTR9o5snAbof/jCKkDAiamHA1NEgtud3dNUr7ykVFd9K3DRftVagSj7dK0KnhHMmL2HzQ1USmcgSnDVEGEP42snY1/4= 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:05 +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:08 +0530 Message-Id: <20180110111013.14644-10-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: 771b2f1a-3515-43b0-ddfd-08d5581ad971 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:lNO9Wrg9SfQXjPybA4yhmOlqzDe3XJj/2JzdHfQ5ixZxZptRXlrc0ponMka74jAhZ5ak7UJ2Ti6Rsfs3RmCprP/Xi8GrcbECpojHRr0BDlidMFqaUdjhqWm4UJgyK2AuZ9iLCqnhxzP+5QkRcvbKT5Vx/KapF6EvUiG5qZwxbPnUy+1lfi2xg71KFgSy7v5epWTtIgNuLAMZVBit7KO/akg5bO2BTN83jEsljCOnT7AP+zQe7v2KJOOnfKpdTHSj; 25:qKCELNOv7Zu0qM9Zg+HZFAY8GhPBobp5Ky53XrnemBFwGMYT+0TI//l+5QzK2YxqlWzcNWHuQ2AZD8kyRzaOCU2HcD62dg8h5N3srabfxXpO2mCy4QqHNpVfF+3y866frS54X/Rz/vSbH33qRklSXVMNI7v/XjHSt8X2N4KmQ6COLV0dr2OdF4Bk+RhnyDUDWiLepJowMHvFhb6VuHiQgUej8gf2vaO/lsMgejeT/WK+vIY8iQvLBZjvo6o/IyqPc9so45a9+PCrPiBDfdbIPOs2r4zCzKnU39HiI5nprPKEe7LzWEvwuybR28YnGGiX9j9Aby+iCDugQUPTvTDtAg==; 31:E4Ycwh2/GwpH2Qe+bJZw+J0waq48h0+4qKMePAsD/2T2cj5RWfj3R3A4AbdXkMW2aOig2hRX0itXzM50FBUwEft1bKWYK7Ev+scmnBaFl64Y7tA067mf1RozbngzUWcUHfuPQ1C4ll0tbZeB9+TFFXiT/96HEmd1psRvGNLFXxS+VYF95JmD06EzaUxoWVLCY2R99BfiGfZapHs/7bcGbyq3SbNFb5k6YrKtmLqq7+U= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:hWoVIafTpyLAKEvSIZ3HQlK+Vgxb47mDxyEK2eMRPLj1pIjGCYZqNo4OPSc2jgUAtaALkO3OXZ6PJ2ycFU2AALAEQos17l0DcrT0vZBfDaCOUY+YJU9qbS9UGzLQ3MKGcS6lUBL0vZTeKFT2aq906HEcCDp9x75nTxkaAq5FLuI969qqn7t0+j2+5X37ZVLa/w1RLWfd6ZNOKNzE3yV/ausshWGXLqTtLCdl6JNxwLn9mttN3T4czMZDHYDt2gJwHkqxQ0XNY8Mdi5QVv2DVUrSPnohfrKAjnosO5qpD2glt7M+3FP4vKntNtzaey5TFALx8S6Myh5s9LuzHWYestR1+FO02SNnqrO4BtJBty1iJ3o1HUiHezaglxkkXQ8Jnr903lCC+yBwFYAjt2F5fqohNVEYkRx0i4VdiYN2tm0nzQKgfLq6dUY2oglEUctT8NmtD4jzixeT1dsip4o+V5GP+E90lHV7s+9bNxflEULVdkHrcGAqRWza7mlc8Tm2oSgQbydrcstbtkQF5z8xrQHAHDoWmoMjkhWORSRr1rbAsAUgRZ/gacwWIq6zcwyoPUsyx1buB/Hhr+U7bPIN7DC7UITxSq3Kqglc2hn1W7PE=; 4:QNJWLhvF5IcXGsWz9TRAkCpUql7Q41fo32WVAb8T5epLQVEu6V25jIkpuwBuKvp++zITpFn9TGrLvC1MtLzaGl11FYEozU/ZSIFCOv58+k4lmWqLXO9eC/ifoDyyDPT3HFGWAVKUSsxTruk2dup55vTAjH4Y5FEh8LPLoeOb5EHDOFsiyIXENJ4PV8BLjVY0INx6QG98R8do47hZaroGAXjpPB+R0KdzR9XptbrWLyqYrFq76ZRjteb5CRe7ukef5J+Q9lfRPs2gEYOxoGhXRQ== 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)(42882006)(2950100002)(106356001)(5660300001)(51416003)(52116002)(386003)(59450400001)(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:4WTP8IwLXZ+fqtRb2nYCEBQaxTyGjk4TBIls0/FnG?= =?us-ascii?Q?4I7lx/6s+Ak8J8eqQdfeBjZhokSRQKZmxy12qZtKyfFU/gnQohZjUaZLsalc?= =?us-ascii?Q?89J+BPAxIk9MK/q0Qqi2L9bStG/HaMf4Upv30wMbbsgfHBiFe+6qkNhzFnNR?= =?us-ascii?Q?0KesNYplgHc3FNZ4OjNk/k0Gm5NS5I7GHQfIJJKBqLn5+AkqZzrFU86BuTaE?= =?us-ascii?Q?PCqf7Lre3zPOCRwdqHh5I1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X6clGdz3gGaamzpzyNc9XHasEHbs5osKtiGFmqr/7h8fZZJCK2rEptXiL/ycvI9bP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 11:11:05.7211 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 771b2f1a-3515-43b0-ddfd-08d5581ad971 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 10/15] examples/eventdev: add all type queue option 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:10 -0000 Added configurable option to make queue type as all type queues i.e. RTE_EVENT_QUEUE_CFG_ALL_TYPES based on event dev capability RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES. This can be enabled by supplying '-a' as a cmdline argument. Signed-off-by: Pavan Nikhilesh --- v2 Changes: - redo worker selection logic(Harry) examples/eventdev_pipeline_sw_pmd/main.c | 7 +- .../eventdev_pipeline_sw_pmd/pipeline_common.h | 1 + .../pipeline_worker_generic.c | 5 + .../eventdev_pipeline_sw_pmd/pipeline_worker_tx.c | 162 +++++++++++++++++++-- 4 files changed, 164 insertions(+), 11 deletions(-) diff --git a/examples/eventdev_pipeline_sw_pmd/main.c b/examples/eventdev_pipeline_sw_pmd/main.c index f877e695b..2c7b02b86 100644 --- a/examples/eventdev_pipeline_sw_pmd/main.c +++ b/examples/eventdev_pipeline_sw_pmd/main.c @@ -148,6 +148,7 @@ static struct option long_options[] = { {"parallel", no_argument, 0, 'p'}, {"ordered", no_argument, 0, 'o'}, {"quiet", no_argument, 0, 'q'}, + {"use-atq", no_argument, 0, 'a'}, {"dump", no_argument, 0, 'D'}, {0, 0, 0, 0} }; @@ -171,6 +172,7 @@ usage(void) " -o, --ordered Use ordered scheduling\n" " -p, --parallel Use parallel scheduling\n" " -q, --quiet Minimize printed output\n" + " -a, --use-atq Use all type queues\n" " -D, --dump Print detailed statistics before exit" "\n"; fprintf(stderr, "%s", usage_str); @@ -191,7 +193,7 @@ parse_app_args(int argc, char **argv) int i; for (;;) { - c = getopt_long(argc, argv, "r:t:e:c:w:n:f:s:poPqDW:", + c = getopt_long(argc, argv, "r:t:e:c:w:n:f:s:paoPqDW:", long_options, &option_index); if (c == -1) break; @@ -224,6 +226,9 @@ parse_app_args(int argc, char **argv) case 'p': cdata.queue_type = RTE_SCHED_TYPE_PARALLEL; break; + case 'a': + cdata.all_type_queues = 1; + break; case 'q': cdata.quiet = 1; break; diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h index e06320050..66553038c 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_common.h +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_common.h @@ -77,6 +77,7 @@ struct config_data { int quiet; int dump_dev; int dump_dev_signal; + int all_type_queues; unsigned int num_stages; unsigned int worker_cq_depth; unsigned int rx_stride; diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c index 90f87709c..2c51f4a30 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_generic.c @@ -516,6 +516,11 @@ generic_opt_check(void) memset(&eventdev_info, 0, sizeof(struct rte_event_dev_info)); rte_event_dev_info_get(0, &eventdev_info); + if (cdata.all_type_queues && !(eventdev_info.event_dev_cap & + RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES)) + rte_exit(EXIT_FAILURE, + "Event dev doesn't support all type queues\n"); + for (i = 0; i < rte_eth_dev_count(); i++) { ret = rte_event_eth_rx_adapter_caps_get(0, i, &cap); if (ret) diff --git a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c index 419d8d410..25eabbd6c 100644 --- a/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c +++ b/examples/eventdev_pipeline_sw_pmd/pipeline_worker_tx.c @@ -94,6 +94,52 @@ worker_do_tx(void *arg) return 0; } +static int +worker_do_tx_atq(void *arg) +{ + struct rte_event ev; + + struct worker_data *data = (struct worker_data *)arg; + const uint8_t dev = data->dev_id; + const uint8_t port = data->port_id; + const uint8_t lst_qid = cdata.num_stages - 1; + size_t fwd = 0, received = 0, tx = 0; + + while (!fdata->done) { + + if (!rte_event_dequeue_burst(dev, port, &ev, 1, 0)) { + rte_pause(); + continue; + } + + received++; + const uint8_t cq_id = ev.sub_event_type % cdata.num_stages; + + if (cq_id == lst_qid) { + if (ev.sched_type == RTE_SCHED_TYPE_ATOMIC) { + worker_tx_pkt(ev.mbuf); + tx++; + continue; + } + + worker_fwd_event(&ev, RTE_SCHED_TYPE_ATOMIC); + } else { + ev.sub_event_type++; + worker_fwd_event(&ev, cdata.queue_type); + } + work(); + + 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_burst(void *arg) { @@ -149,17 +195,81 @@ worker_do_tx_burst(void *arg) return 0; } +static int +worker_do_tx_burst_atq(void *arg) +{ + struct rte_event ev[BATCH_SIZE]; + + struct worker_data *data = (struct worker_data *)arg; + uint8_t dev = data->dev_id; + uint8_t port = data->port_id; + uint8_t lst_qid = cdata.num_stages - 1; + size_t fwd = 0, received = 0, tx = 0; + + while (!fdata->done) { + uint16_t i; + + const uint16_t nb_rx = rte_event_dequeue_burst(dev, port, + ev, BATCH_SIZE, 0); + + if (nb_rx == 0) { + rte_pause(); + continue; + } + received += nb_rx; + + for (i = 0; i < nb_rx; i++) { + const uint8_t cq_id = ev[i].sub_event_type % + cdata.num_stages; + + if (cq_id == lst_qid) { + if (ev[i].sched_type == RTE_SCHED_TYPE_ATOMIC) { + worker_tx_pkt(ev[i].mbuf); + tx++; + ev[i].op = RTE_EVENT_OP_RELEASE; + continue; + } + + worker_fwd_event(&ev[i], RTE_SCHED_TYPE_ATOMIC); + } else { + ev[i].sub_event_type++; + worker_fwd_event(&ev[i], cdata.queue_type); + } + 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; +} + static int setup_eventdev_worker_tx(struct cons_data *cons_data, struct worker_data *worker_data) { RTE_SET_USED(cons_data); uint8_t i; + const uint8_t atq = cdata.all_type_queues ? 1 : 0; const uint8_t dev_id = 0; const uint8_t nb_ports = cdata.num_workers; uint8_t nb_slots = 0; - uint8_t nb_queues = rte_eth_dev_count() * cdata.num_stages; - nb_queues += rte_eth_dev_count(); + uint8_t nb_queues = rte_eth_dev_count(); + + /* + * In case where all type queues are not enabled, use queues equal to + * number of stages * eth_dev_count and one extra queue per pipeline + * for Tx. + */ + if (!atq) { + nb_queues *= cdata.num_stages; + nb_queues += rte_eth_dev_count(); + } struct rte_event_dev_config config = { .nb_event_queues = nb_queues, @@ -211,12 +321,19 @@ setup_eventdev_worker_tx(struct cons_data *cons_data, printf(" Stages:\n"); for (i = 0; i < nb_queues; i++) { - uint8_t slot; + if (atq) { - nb_slots = cdata.num_stages + 1; - slot = i % nb_slots; - wkr_q_conf.schedule_type = slot == cdata.num_stages ? - RTE_SCHED_TYPE_ATOMIC : cdata.queue_type; + nb_slots = cdata.num_stages; + wkr_q_conf.event_queue_cfg = + RTE_EVENT_QUEUE_CFG_ALL_TYPES; + } else { + uint8_t slot; + + nb_slots = cdata.num_stages + 1; + slot = i % nb_slots; + wkr_q_conf.schedule_type = slot == cdata.num_stages ? + RTE_SCHED_TYPE_ATOMIC : cdata.queue_type; + } if (rte_event_queue_setup(dev_id, i, &wkr_q_conf) < 0) { printf("%d: error creating qid %d\n", __LINE__, i); @@ -286,7 +403,7 @@ setup_eventdev_worker_tx(struct cons_data *cons_data, * * This forms two set of queue pipelines 0->1->2->tx and 3->4->5->tx. */ - cdata.rx_stride = nb_slots; + cdata.rx_stride = atq ? 1 : nb_slots; ret = rte_event_dev_service_id_get(dev_id, &fdata->evdev_service_id); if (ret != -ESRCH && ret != 0) { @@ -450,6 +567,11 @@ worker_tx_opt_check(void) memset(&eventdev_info, 0, sizeof(struct rte_event_dev_info)); rte_event_dev_info_get(0, &eventdev_info); + if (cdata.all_type_queues && !(eventdev_info.event_dev_cap & + RTE_EVENT_DEV_CAP_QUEUE_ALL_TYPES)) + rte_exit(EXIT_FAILURE, + "Event dev doesn't support all type queues\n"); + for (i = 0; i < rte_eth_dev_count(); i++) { ret = rte_event_eth_rx_adapter_caps_get(0, i, &cap); if (ret) @@ -477,13 +599,33 @@ worker_tx_opt_check(void) } } +static worker_loop +get_worker_loop_burst(uint8_t atq) +{ + if (atq) + return worker_do_tx_burst_atq; + + return worker_do_tx_burst; +} + +static worker_loop +get_worker_loop_non_burst(uint8_t atq) +{ + if (atq) + return worker_do_tx_atq; + + return worker_do_tx; +} + void set_worker_tx_setup_data(struct setup_data *caps, bool burst) { + uint8_t atq = cdata.all_type_queues ? 1 : 0; + if (burst) - caps->worker = worker_do_tx_burst; + caps->worker = get_worker_loop_burst(atq); else - caps->worker = worker_do_tx; + caps->worker = get_worker_loop_non_burst(atq); memset(fdata->tx_core, 0, sizeof(unsigned int) * MAX_NUM_CORE); -- 2.15.1