From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0054.outbound.protection.outlook.com [104.47.33.54]) by dpdk.org (Postfix) with ESMTP id 23515E5D for ; Tue, 12 Dec 2017 10:33:51 +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=3ozHhNRlyFGTYL6HTCSqpJUfp9W7LMEm4v0smSGfy/g=; b=e19gNvr3V0FuY+jMEd5oY6N4fsY83+aKa/gQwn48QKhnL2QqSFKNFsFHWs/bpGuGFrOoX4Vim8jh/G5S6K9YTlnO2pvoy+ker/fVi0qsGC4eU6oMKQdctAGbQjLPLpIP3t51MpPxhxuZHx43oT3eB4jgq+7uJnR7xZO//vfyjgM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 09:33:46 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, harry.van.haaren@intel.com, gage.eads@intel.com, hemant.agrawal@nxp.com, nipun.gupta@nxp.com, nikhil.rao@intel.com, santosh.shukla@caviumnetworks.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 12 Dec 2017 15:03:31 +0530 Message-Id: <20171212093331.20216-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> References: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: DM5PR13CA0036.namprd13.prod.outlook.com (10.168.240.150) To DM5PR07MB3467.namprd07.prod.outlook.com (10.164.153.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a58ecf36-079e-4a25-e115-08d541437390 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:DM5PR07MB3467; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 3:FMuvzr36ugsk5sd94L/40MXqEh3E+3VDiJoHP5HmFFT7Ngo33Trehbq5GD5NWDKeiMqAnshztzSQpDA2xgZC+4iKDmIjtD2gbDR9lP8JkuoSBO+k8cdKFHByoJua8MAM94bZ9mpS/rZANc3txfFEa2oH127xD4prtKD+iJXAhcwrNj+hHx+a1huCpR0GNsx+o6ZCk9W3f5EOUL29al790RGZJqkG5bdsi3300KniPhf2Cg+0vP3V8QSPdb02wwdS; 25:j/R1rpOraNyCiT9lOJlPEozQwc6J2klP7+N7fw8ktnhGjz9Ym//tuQ4ihL33Xzou+aOgf8hOv41mrTEy/pw1VheyONXZlDPUBtTakofHkaFP/8104XliqH0W5l81LN/VpKNOYtYlAXZrOY8EOrx2400YA88QmTq0FqI4hTcl572Mxih6hH1qqND4jLW4TbRyqYzKzMp/vOG+Vku6iEj8ETKLCMfng2nmAWcu9MeEfO8GdT/OKWKE2IiHApyLvbrnx2+ctKi0INg/MYET2ZbDWxCTUv3141q0X3p3HTgb4uppeHrRSzMal3HFeaI9OtO26UBQADAY4xFS8XPD0ltKbw==; 31:46XlODD+ODRcDmZxcwGz4W+y4YUJAZVBdk+wnIKOLFwsGPqykPSLlenhm65Gb3vYAUAUwGjZ2HVSBOlnmXQf9ir5hq6Z3CNZQyd59xHfW3msYpk5iypYTSBEAPOiyo8ePVhwOMgRKFKmovcJUUJy3bev3f0HVxfn12MLk77+dH5Hn1ohHExgcgfbfzZ4uQkJBS+wsvD2ydzDEkn1qrJhOikkhrbYb8dDByjsvvoUoXg= X-MS-TrafficTypeDiagnostic: DM5PR07MB3467: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3467; 20:agozu5ibaCS2Vy/QryDl+PgOLcewUcCIYr5393dyrnKsJe7u4a6HAGpoW2e+QRTBxFYTeoOQpOFXI6Ar16TwTBkptYYPKTPLv+vtHHGSD8GPo4ySBlkF9OIljcJzDbu7vCPwERUMPhg4xLyvp13bYR7WtpF7q3S/Nb3Sj/S1q012ZIxSWZGVJ4RQiSeLINGXAUgk8IseYeQyp+/BJKOy7Q9MrVbv6WV1uKVHf2eI+PsYFTSg6qvkCl9FY9q4iWvxXBp+5Jk82b1VnIz2hFY3SkPHHzujan0cXRN1IUNIY0xXWZxfaqyM6ZvmaXwBQrULHXKwrpFyBSAy+lSkO/IWafERELGCkGV1rc0z/63wB4kylPq759VNPE9e0U7/9Lj0TzfyAn9R/mdMjFjwr4nVy50DI7kSvSNz6fPYbzttptkhs6zqpLxho+AZTtnukltFtyWNfwbOxqRtkOJCfH2L87x4Gv86eu3Z0WIRCJong7Blejh3FHxpcHAxMTccXqxiEyI4R5wT3s2aaZNsGZMR1A09FM/xN+enFlOuZu0zSadBJ4Yaozsvvf+rNq0BBBD3oBAZyg+meFMga5F5vXP5MP4m0ZSKjelADnOC1wtpUFE=; 4:G1EHZCKxAO+y15hpAAp9CqwnL7QVuk5SNYC9SzDnvZYPBWSFuNajz9qkpXV8IZC5lS21Ie3q6QieIQDLi/1Xjnwi6MDx9Q1RB5NyuIUCL5Zf4ym1nD+qMZuvGmi5oX6y32CWW4QHbi/o4JIvYmi2lfQnF73KZZMwgaGsanfHMQ//+yDUnj5X9MrgpgJqfIhXNQ15eMLmO4ZwtgZv8tLb4e08IeTBHbeOZVA+RMjlRFt8tyQJM1dNBbmch3shXVqahpV09+U5TVoRRxjrkJWp4A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231023)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123560025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DM5PR07MB3467; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR07MB3467; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(376002)(346002)(366004)(199004)(189003)(107886003)(7736002)(53416004)(51416003)(4326008)(575784001)(76176011)(106356001)(25786009)(8676002)(72206003)(8656006)(36756003)(6486002)(53936002)(52116002)(305945005)(16526018)(6512007)(478600001)(6506006)(50226002)(68736007)(1076002)(47776003)(8936002)(69596002)(5660300001)(105586002)(50466002)(48376002)(6116002)(3846002)(2906002)(66066001)(97736004)(316002)(81156014)(42882006)(81166006)(5009440100003)(16586007)(6636002)(6666003)(2950100002)(42262002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3467; 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; DM5PR07MB3467; 23:68j4lOr/SLHkMXdFea8oTFb7a8ya9Z/zsUPtUTxbS?= =?us-ascii?Q?sSkq/wgKVEzgtbUk6iowor0vU5MbfP+FvMYqVpAB7ZoiRTaR/iY5Qm9C5RLa?= =?us-ascii?Q?rr7WYE2vXAukZMFm3IJqYUboZGiYOoVt0nTmj95pCGGyqZBkqAB/5eLoTfRJ?= =?us-ascii?Q?2GEj+MDcioSLa02R1wZIeo6qa0en8M4hKdn8zp+qRQvOKz+JqVPb+aftxZV0?= =?us-ascii?Q?DRpa1IaGbC09h305DHobrDF06Feec9rIAPPDT399phd4nOHCb+mtn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SbOGg+233bQEaXGpzaR16mK6WCVehT6hjV3UigfJR2zNF1202QEpP1DCNke SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 09:33:46.9031 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a58ecf36-079e-4a25-e115-08d541437390 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3467 Subject: [dpdk-dev] [PATCH v2] eventdev: use links map to unlink queues 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: Tue, 12 Dec 2017 09:33:52 -0000 The octeontx event device doesn't store the queues to port mapping as a result it cannot return the exact number of queues unlinked from a port when application wants to unlink all the queues mapped (supplies queues param as NULL). Using links_map we can determine the exact queues mapped to a specific port and unlink them. Signed-off-by: Pavan Nikhilesh --- lib/librte_eventdev/rte_eventdev.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index e0c2a78..b43ffbf 100644 --- a/lib/librte_eventdev/rte_eventdev.c +++ b/lib/librte_eventdev/rte_eventdev.c @@ -888,7 +888,8 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, { struct rte_eventdev *dev; uint8_t all_queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; - int i, diag; + uint8_t linked_queues[RTE_EVENT_MAX_QUEUES_PER_DEV]; + int i, diag, j; uint16_t *links_map; RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, -EINVAL, 0); @@ -906,13 +907,34 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, return 0; } + links_map = dev->data->links_map; + /* Point links_map to this port specific area */ + links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); + if (queues == NULL) { - for (i = 0; i < dev->data->nb_queues; i++) - all_queues[i] = i; + j = 0; + for (i = 0; i < dev->data->nb_queues; i++) { + if (links_map[i] != + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { + all_queues[j] = i; + j++; + } + } queues = all_queues; - nb_unlinks = dev->data->nb_queues; + } else { + j = 0; + for (i = 0; i < nb_unlinks; i++) { + if (links_map[queues[i]] == + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) + break; + + linked_queues[j] = queues[i]; + j++; + } + queues = linked_queues; } + nb_unlinks = j; for (i = 0; i < nb_unlinks; i++) if (queues[i] >= dev->data->nb_queues) { rte_errno = -EINVAL; @@ -925,9 +947,6 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, if (diag < 0) return diag; - links_map = dev->data->links_map; - /* Point links_map to this port specific area */ - links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); for (i = 0; i < diag; i++) links_map[queues[i]] = EVENT_QUEUE_SERVICE_PRIORITY_INVALID; -- 2.7.4