From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0085.outbound.protection.outlook.com [104.47.42.85]) by dpdk.org (Postfix) with ESMTP id 22CB51CDF9 for ; Fri, 8 Jun 2018 19:25:28 +0200 (CEST) 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:X-MS-Exchange-SenderADCheck; bh=myELBolJDf4pNGkP4mtLoADsN+W26xgXOfu+t4dIjBo=; b=nEcxA4bDQOHw/C+2PKlU7qbq3nLLowhL1eIvMnNM6u+mkYP2zpLuX7iBbdbakeVUyYJfd0WmF0pkx/U2NEuLusVY8E2aN6gJy4INA2IVk/u9a/6hmliyxJs7D9SvlzpPnIWBr4+A/991Vf/hxutoZo93AzT/u9J5utMjdb7Vxdc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.caveonetworks.com (115.113.156.2) by DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Fri, 8 Jun 2018 17:25:23 +0000 From: Anoob Joseph To: Bruce Richardson , Jerin Jacob , Pablo de Lara Cc: Anoob Joseph , Hemant Agrawal , Narayana Prasad , Nikhil Rao , Pavan Nikhilesh , Sunil Kumar Kori , dev@dpdk.org Date: Fri, 8 Jun 2018 22:54:07 +0530 Message-Id: <1528478659-15859-9-git-send-email-anoob.joseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> References: <1528478659-15859-1-git-send-email-anoob.joseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BM1PR0101CA0050.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::12) To DM6PR07MB4906.namprd07.prod.outlook.com (2603:10b6:5:a3::11) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM6PR07MB4906; X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 3:Cn58pCUWVfQy0KEcBtRe54VT4GMbb1tb/BKFBtzGkxTOjkfZKYEQvFOgCc2sekJazWrww7l2Tfsgf34uqKIxSZ+uscDCqOons0dVgat9KYfSdxXxVvxoA+7uuVoKqznra/C5QAvLK4ceFRx5ByPCqdH8F/o4c7PNVxUIlopL0Tj8HDQ8s/7zPy7uRoQlC4Tg2V9x8a4w7tmQXxR++g89gF4W6aHjng9CKh9NhA1TlvGBQS6vSMojq60X7zBco+S/; 25:JiCYVMK7UXGzv5d20KRm6YasmF1HEfvxSZ1ht+CmIk+7aK0hSZKe+HUmFr47h+VrPX3JxkB3ccaYljslR/NFuYNQAbKcdd2hiYQ7s0B1Tkrj18NKIZTyG+nU2dYef7bviVT4X4xmjA0WS3kM7Diku0K2V/pjGB8B3+U3XR1O7RAe4daLPQrkDXf26YGdwL5B+jrglzSHyXZsA0dEGdn7+iKKz6rSfDth427JegGmw8r5GKZdZiuo0AY3kP/DaMEwfF/U8XO15uFXMPrrXi1QDg0l4DRa5Y2bOWP4/WzRzubj3QexulzMkSUFTNtNmbfFuRAwoBV5YeAaFpxOoIgjgA==; 31:R3OqH1+FKtEgWRL5oIW/vLBwlVywhP2rbpdZcZ8FRoUmvFm5YmQgl2o+sNCsaJCqtIZE0tIh4ayETB4Sglgzks1RF8T9lVkuLi8WwPHoh4lJLK6pQvMm/dYciMvydc9jxhZTLmHNbijwOKm9MDYRuNOr2pGKhysierc9VPUQAO/xQ6u9j0V6CXr7ZFPAuOr2pkVVLQkKTRcQWLS/ebWmwIqRgA3n3dMO2keimlMvaS4= X-MS-TrafficTypeDiagnostic: DM6PR07MB4906: X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 20:bDnkjI/kKg9QpBw2fiUQKjvCsyuoO/mFy2RkrxyHqJLhP448MV7VAY4p3D9+Am0abI5a9NGUQ5/5H9juolkhfHUfxUQoxTYxE+5185lceiGaH0FgR0wBxuc381Tt7riNjUZewpOgUER/ytDkVNLHYtpegq0VPsLg220bm/3XRzsO8jfDmc4iCStv2kYiDWw8p3KhSB8y3xJxSyPtL9LEzTnDEkY/ifh4pRzvYQXO41Nut6GbIB4hhkJEZ+BaE7QVij1Ox3EHIXWpjIalDWnym9uNAp/KmE/ZV9EbPDdpd6YozCD1moDbGodnGJTFHW4BDxOF1Cgoir9NHLcehZt08flIT1MIDO+3YQMFDOFT/HRetoezdhEtFU8NqhVlFUcL+mV36I8pLBfURcd8UmbdIaf299pnD/W2OkN5yhYR3G8pzJY6RYvuNFQZ8Q0MXPSUQPjPI1roWCxh7agm7OHf5FvNsOy85UhaaI9Anfv7ND70R+bHgxbsguhz9KY64SEg7bNVxu+tFMq51xQcRonHBTh/AhWaPU/9PzrYmUU1Ycm1FEPn2HY0ZvsfUphMbTYWEszvG07CmOQttsHL1dYY6hgfgcPTrdXtIyfkFkC2O4Q=; 4:i0pJcodU/9zJe3woYJu8RI27bSUZNn4B4CrzDy3ionDGvjitaLd4unzFezsz/RaHEQvbaA1dLR36kq5KatdYx4jdTovJ1SFzm2weOtsWu0+wCkjlhNRIjJ8TrIWDqGD1AyAxzeYwLVmySIcYtcq2PCY7oUFLBsyWQf9xmLrGDHAirNyUiq7FDYA1m4vqOiOA9sSx6eIyYa6VRt1QfGRf4Qhozi5hzLFPFlTmkp2aNWRgGjuaFfxiqwMoB5KXQoJTB8Yl+aMUF/bOejPOEcUVHQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR07MB4906; BCL:0; PCL:0; RULEID:; SRVR:DM6PR07MB4906; X-Forefront-PRVS: 06973FFAD3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(366004)(376002)(396003)(39380400002)(189003)(199004)(186003)(16526019)(5660300001)(26005)(42882007)(55236004)(66066001)(47776003)(68736007)(6666003)(305945005)(2906002)(8676002)(7736002)(8936002)(36756003)(52116002)(2616005)(956004)(476003)(446003)(50226002)(81166006)(11346002)(44832011)(6506007)(386003)(486006)(76176011)(51416003)(48376002)(50466002)(97736004)(316002)(6512007)(25786009)(53936002)(6486002)(81156014)(4326008)(3846002)(6116002)(16586007)(54906003)(110136005)(105586002)(106356001)(72206003)(478600001)(8656006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR07MB4906; H:ajoseph83.caveonetworks.com.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR07MB4906; 23:2SeQa9+/WXO+83zy/VNgy8K/D9FK4X+hE1guBofbs?= =?us-ascii?Q?+fRiPfNH1WTxB9Gv9/09VP6E1crmVSunTCjhvziWyx+K+mZ9saLA8EH3gVK2?= =?us-ascii?Q?H8u+VgFXpgjR6s4wFjQfg6oqK8a3oWUl/AbTLj1ejgyC6VoQE/En+yAZG5uc?= =?us-ascii?Q?c+QgYtyudpXRI/rZRv2j9f4JpyRdOIG/1CGsfkWXLZamBr4Qir36/+QpfeF7?= =?us-asc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ZHTN1jXZFNGLJe0VE?= =?us-ascii?Q?jKA/VSz2R4/51Pj59hFO7cc9qqP3hYmDwOowx7Er6WwwjiaOsa3NRQRad1ou?= =?us-ascii?Q?e8kmIyKtToLn+MCWH6Vw/cCyghASLCopvzU7DOX9IPvMMZsz6CzdjGlnr60G?= =?us-ascii?Q?mBRmy4ri2TirpoTpKR/QDW9rAetCh1U03XnmSlfE8yQC7rFnbEkaayh2mqB5?= =?us-ascii?B?UT09?= X-Microsoft-Antispam-Message-Info: +hU5M//bARkrv9cmmH+Ux9ryg0kWCtSbRazNIQXmTwLahwxun+MUdTEM8KLBn8TflaV2PXfN5mtYJdikkOJb5TUMhyDxigMiLGy+VXWM7MXIcdx7SuHsMWx+5unMgCSM8wtfcgPn//IcaH9Z0EJALsGwwhQcL0rfsQH/aLeHHFc0heq1i2ZHI0Z74X8g3VZr X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 6:1fXsd8nV5h7HMHF+0OytMq+p3K93Q6wCBt0SfYtx0Z+aoQ5pfrDNVDzKyizuYem+jJc0QugXXHstPZgGCF5hAYPdYde2vn5/aFvc0CeEoGJuirBSTppqRvSsg7xaVdmYoDdHJQP2J76y55Jhv/oefUSCMO6gvmU+qSHiti9DuYRao6zoP8fWkKPikUZQwm+QHL/WmA8os4u/ecrJ732Khv7NyuledowiRWJBnZGdL4CfllnQaHg5kAb3DRj16fGUDs2Afi9D/N08PHuDSrK2E3aTSah0n/nR2noZ+G/vbMyRxU3VMUMRHnOB01/olPkuDkYj9FZbO3inidqSFd9lHyWGuKuRoOR3wxdbKzxbnXCCp6RZECEEMIKMrkVfuET7ajtzeZekw3uq3y9xvntB5iPV6U2T5KWOsJknaG5Mkji9Ei4XkNbepCiT1NM2LPJmuaVdRt+kuOx7FxnZ8g+jsw==; 5:uC98svATKbNm+Ppj1kTJjLhSCp2bTTSIXvYS1r6vpxUQwF9Q+dXtVjs/5Ryfa/AlSTkOTzpvDsXieinNHjdugUmPe48C7K45aINHrrjkY0HWicmX+UHIlE5OAxJSxC654ziDMf+ygVmmanC6HuUmtlMvie6f7cIIOJ6vruDzr2A=; 24:banknfO5x/iiF2Gm0Ctq7cejO7J1WInZfkChwY3OjSv3WeSBMkr/ZVBQ5oHzvGZbR8fbBxkloDiRDsl1WxSNrWZ892Hxag4+xpA1PZUwiGc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR07MB4906; 7:aqqFxFzJk9KW35C4RDrLg4UwWJ7LGIkXeaPDdFFUKpdGmWo9UpDsfb8L1tfoaeHs1gbDWna9p2lgkhdtUE7tZrafMlqpvdstnesGEHLNSSkdDUkseh2NnoAtEg3MqXjxmm7V4pQwGca78ehBOf3JMnf8tOsTTN33sA1BJlXlhd+z3vcEQEYYbQfXiqlBdKTjU/RQVy588EjL53JgkN41BmXH2FMqn3YxT9o3ke+01WeV2m5xoBGWA3rDlSt4Gzrq X-MS-Office365-Filtering-Correlation-Id: 55a998a8-f4fc-4a2f-025c-08d5cd64d33a X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2018 17:25:23.9042 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55a998a8-f4fc-4a2f-025c-08d5cd64d33a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4906 Subject: [dpdk-dev] [PATCH 08/20] eventdev: add eventdev port-lcore link 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: Fri, 08 Jun 2018 17:25:28 -0000 Adding eventdev port-lcore link. In addition, this will also specify which event queue need to be connected to the event port. Signed-off-by: Anoob Joseph --- lib/librte_eventdev/rte_eventmode_helper.c | 56 ++++++++++++++++++++++ lib/librte_eventdev/rte_eventmode_helper.h | 12 +++++ .../rte_eventmode_helper_internal.h | 12 +++++ 3 files changed, 80 insertions(+) diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c index e55d4aa..b3469f9 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.c +++ b/lib/librte_eventdev/rte_eventmode_helper.c @@ -46,6 +46,24 @@ internal_parse_decimal(const char *str) return num; } +static struct eventdev_params * +internal_get_eventdev_params(struct eventmode_conf *em_conf, + uint8_t eventdev_id) +{ + int i; + + for (i = 0; i < em_conf->nb_eventdev; i++) { + if (em_conf->eventdev_config[i].eventdev_id == eventdev_id) + break; + } + + /* No match */ + if (i == em_conf->nb_eventdev) + return NULL; + + return &(em_conf->eventdev_config[i]); +} + /* Global functions */ void @@ -165,10 +183,12 @@ rte_eventmode_helper_initialize_eventdev(struct eventmode_conf *em_conf) struct rte_event_dev_config eventdev_conf; struct rte_event_dev_info evdev_default_conf; struct rte_event_queue_conf eventq_conf = {0}; + struct rte_eventmode_helper_event_link_info *link; struct eventdev_params *eventdev_config; int nb_eventdev = em_conf->nb_eventdev; int nb_eventqueue; uint8_t eventdev_id; + uint8_t *queue = NULL; for (i = 0; i < nb_eventdev; i++) { @@ -257,6 +277,42 @@ rte_eventmode_helper_initialize_eventdev(struct eventmode_conf *em_conf) } } + /* Make event queue - event port link */ + for (j = 0; j < em_conf->nb_link; j++) { + + /* Get link info */ + link = &(em_conf->link[j]); + + /* Get event dev ID */ + eventdev_id = link->eventdev_id; + + queue = &(link->eventq_id); + + /* Link queue to port */ + ret = rte_event_port_link(eventdev_id, link->event_portid, + queue, NULL, 1); + if (ret < 0) { + RTE_EM_HLPR_LOG_ERR("Error in event port linking"); + return ret; + } + + /* Link ATOMIC eth tx queue also to the port */ + + /* Get the corresponding eventdev config */ + eventdev_config = internal_get_eventdev_params(em_conf, + eventdev_id); + + /* Last queue would be reserved for eth tx */ + ret = rte_event_port_link(eventdev_id, + link->event_portid, + &(eventdev_config->nb_eventqueue), NULL, 1); + + if (ret < 0) { + RTE_EM_HLPR_LOG_ERR("Error in event port linking"); + return ret; + } + } + /* Start event devices */ for (i = 0; i < nb_eventdev; i++) { diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h index e1e8a3b..1ade32f 100644 --- a/lib/librte_eventdev/rte_eventmode_helper.h +++ b/lib/librte_eventdev/rte_eventmode_helper.h @@ -24,6 +24,18 @@ struct rte_eventmode_helper_conf { /**< Mode specific parameters */ }; +/* Event-lcore link conf */ +struct rte_eventmode_helper_event_link_info { + uint8_t eventdev_id; + /**< Event device ID */ + uint8_t event_portid; + /**< Event port ID */ + uint8_t eventq_id; + /**< Event queue to be linked to the port */ + uint8_t lcore_id; + /**< Lcore to be polling on this port */ +}; + /* Common helper functions for command line parsing */ /** diff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h index 4cd5ac4..36e2a5f 100644 --- a/lib/librte_eventdev/rte_eventmode_helper_internal.h +++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h @@ -30,6 +30,13 @@ /* Max event devices supported */ #define EVENT_MODE_MAX_EVENT_DEVS RTE_EVENT_MAX_DEVS +/* Max event queues supported per event device */ +#define EVENT_MODE_MAX_EVENT_QUEUES_PER_DEV RTE_EVENT_MAX_QUEUES_PER_DEV + +/* Max event-lcore links */ +#define EVENT_MODE_MAX_LCORE_LINKS \ + (EVENT_MODE_MAX_EVENT_DEVS * EVENT_MODE_MAX_EVENT_QUEUES_PER_DEV) + /* Event dev params */ struct eventdev_params { uint8_t eventdev_id; @@ -44,6 +51,11 @@ struct eventmode_conf { /**< No of event devs */ struct eventdev_params eventdev_config[EVENT_MODE_MAX_EVENT_DEVS]; /**< Per event dev conf */ + uint8_t nb_link; + /**< No of links */ + struct rte_eventmode_helper_event_link_info + link[EVENT_MODE_MAX_LCORE_LINKS]; + /**< Per link conf */ }; #endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */ -- 2.7.4