From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0051.outbound.protection.outlook.com [104.47.42.51]) by dpdk.org (Postfix) with ESMTP id 51B24293B for ; Mon, 11 Dec 2017 16:05:58 +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=zG90h3guHowg80c2yQZ7gRhiVwSy62X9HwSWWMCq3fM=; b=F5pe/59JbNA1u39xjQSo/vKLZ+5o/n85cRxfeEQcqPmSsui/S3qEYYep1WqdATsdhZBHmoqYRT3ABybMHKV9txcQrldAjPt1alFxojk15uawPQts7EQ1oXuoKqHKZtFEEvWQAegQ+gBYZ8fbfovXl1+UEhKkQtyHAsPlfeAunw0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from Pavan-LT.caveonetworks.com (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Mon, 11 Dec 2017 15:05:53 +0000 From: Pavan Nikhilesh To: gage.eads@intel.com, jerin.jacob@caviumnetworks.com, bruce.richardson@intel.com, nipun.gupta@nxp.com, santosh.shukla@caviumnetworks.com, harry.van.haaren@intel.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Pavan Nikhilesh Date: Mon, 11 Dec 2017 20:35:28 +0530 Message-Id: <20171211150528.13236-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: SN4PR0801CA0007.namprd08.prod.outlook.com (10.161.215.145) To CY4PR07MB3464.namprd07.prod.outlook.com (10.171.252.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 935080f2-2a01-49a1-d2a8-08d540a8ae19 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:saPmNdsc3D4vPup26Qbl+olkVKQ7NeCt5BlhDbhv9LiPfihnaEo6K1Vj9XEvoM2DNFqUIw9rX94uJNZCvCugX3Vou8q2ubegmycsLLMJ/acry4iAbjGXfBuwYvUTyhczE+5fDeIJbhCBy9lnFNYO43YPvngvdHTmBh/aFLRgo/qkLqBUm7myO8ePJtjnsOOzyp7RP7wBUTbUaztpFVHgkHHpcuMSd6z+0w1HJwpeYr3vvZeZPkL0CbHYbroodK3N; 25:AvkE9tZxzMXdn9wkh0hgkxLMhMIaSjTW8FE6uSY/ljEhWF8fsicouZbtfT1VNwenojXKy7qoA81pp2CVHDNFSo5hlV1xyNJSoxbhPm0WKoQeE7b/7l41o6RhMXFaUyJS8M7yksnFtqy48WRWhgKJPzrh7PsfOffQljRwWXWMGqTkp2XcylFErhYb6Kk94HzZ5yI4fHuAUITTNms9dT0luR/7ttzeGn/v1Vf2NDeOh/TMzHsR78Iov+cQREk0qFiq1avGzVwP+AxQ4PtW4o0vuAVJ9ZE1FhnsVenKnJefXlItFfXdBe0kgyqTSOCNy2CqSn7vApm4MD0t2AX23nKj9w==; 31:pjuWDjUdq8JUugqhRiWrvJVuImmQn/vTT/0vB0uIuNBzjfqyHAiejMiwHOyy68Nqa7aHuMw4CDD6y4+Fmi/OcZQybLgWDARqADMUqWlQhytYiGbvxhCtZUISHDjzEl9BgFRouhhA3ZMz4EbvZE78nxTbNZNmQ8JSxiaF+qb7fWfh/o86WfCw4BOWESTRJkYnogr50dh+qbnfUihpE6sH0/WJx7G/RTY/nAHcvdEATRQ= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:HbKhUtGbGdabWE9RsVHFeLMl7QqJnweL3CpVSJAX+o+P00ysjEJYxjAuxBcTRNFOCNI0Fa1IBjQNy3QPz5aFRJ26G7kSviw9FADu8Vf6eNieKbKIkyllKIm56qRNxNEC3zgWx2ICrIzm3DRHmxJE7z0W44ILeaDy/gsBLrArrRkh7E3KvgGivnNcU6aHW/JpxvNCqP/qkPCG8B9n1lxNysJ3KLjKbawCuX0j48aHkIo4lCnMX3R8XoKdrTrpxRn06wZlbaoTE/5P9UNZoHEMz961X8gMyLuPLC23wZURMf91ZvbpSs5L8q6n9NaB6qrwrWGu6Dw5T/ELrqf6h0s6JV4KvEj38TGq+TciNKzOaV4WTwsnSBaBTe6JIOgu7gcOQOyXB8XJ/QXL1C20yGWVJzZcJwQFf8K+Dz55kcCGtKmT2ciBq1z+x9bNyZ3q0tEULjT9hzcT4XjXKNRYxQ3F76f+3mXBJ9Aj0vKAZdpka830GdnuEP/fPSvfVEQwPYFCyZAQtTAam6gTcZLt83kBKO2qRnVUmZ0hjYkU2TsnH7cEiN99clxpf4ZUzHYDPSFjS1QwkgKkTR3n+wGMLwIj2HmfeQjqFK+YSyB9ysfoB+o=; 4:s+zfOPcDPMctfz/Y+NI7pkGHa1Sr5L1/diIINu4LPjjpfiibQwbF5R/YBBVV/KIo6SDbp8t6j8Ldpt/cwIHay9y9bxisdzsUykYzuvaT8Lte3LBW1NKhnpKvsNmWL8oxARubb5jFRgFqliWpVW1No5CO/BXnjluAfHzvAQwekJy+cwGx+Ay9oSKwU8XwutoYcRq99pCxeSIpdY+gwQsiSAGaoFaof+4OjnP+elNql1T6+Dt5D20V8MfkjO0RQmQN14ONl25o/9bJbg6dC0UsHg== 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)(3231022)(93006095)(3002001)(10201501046)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0518EEFB48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(366004)(199004)(189003)(42882006)(1076002)(97736004)(107886003)(6666003)(2906002)(106356001)(53936002)(5009440100003)(8936002)(105586002)(59450400001)(51416003)(52116002)(6512007)(8656006)(53416004)(5660300001)(50466002)(575784001)(47776003)(25786009)(72206003)(36756003)(69596002)(16526018)(6506006)(316002)(6486002)(16586007)(48376002)(66066001)(4326008)(6116002)(3846002)(305945005)(7736002)(50226002)(68736007)(478600001)(81166006)(8676002)(81156014)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; 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; CY4PR07MB3464; 23:pnU1i5RCJ5/+tBPhTJdolBk11LeySnBtpWsp6qssV?= =?us-ascii?Q?VcWabP/OXbNyaLOd4nOe3ehNQPOjyJUwhAWey1ZBRFkgdnK7cT5TSyBFd6E7?= =?us-ascii?Q?oAFpjQkP9HeRNbOWPnI3FHqFJnrjAhCui5yCKSxCRGmafa7IfsdveHXPLnmK?= =?us-ascii?Q?+frHjJHnCcp7SeQo/ZOr7p1pECfkj+T+dvBQcKRcmUZBrTVmzzKqYmQK9asx?= =?us-ascii?Q?L6FpY1Tc9Oz80F7Sd0ad2M2AYmUjdankna0TCf/EVkb9IBJmwTJEzPf7Ska3?= =?us-ascii?Q?SMHD0h+lxnSgpuen/F/1ki0Pw9vai0U8ye8HtrYa7KkHOdWb15CKXKjUJ+Ay?= =?us-ascii?Q?ey2v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Dy2TUE3FvN/8sm8QBCamxwUvqpQA+DLfkl9ou/DL15ck+7yR681H162jw7dxWwa1NLAAx/lTxS0RsmMa4i7zj6oi/Ztm4qjEhHCgbsM+IPeP2vvXdzWYBWfgo78agIkBCgqinckUPXuGxx4YY1umPR8DEYPoLiBy7lUf6PgvIphS+TbV+txTLxrbeV3dmgXckiQhjHsz0Rr/RNXn41lKrRq0hCkTd8VB/skD/yEnStnuAn/x8OaqqU4tImPzwzvoDjvApr7NyspdbRHW26MKsxxqHD9B910moCofdMtQ/iPOm8NL0r9YlWq8=; 5:OP9bas5t3UKjlkR54p4PtW/KHYns3UuXqcmHFLVjfghaP1bA5pk1rLT4sGl7WgtdRTP1qfHRnnxgHL+NJC9WiFAGh1QfQLdSqhP2ux8RvKIrlbiyKkZfQdemChdyAu/raaQ5+gLnA1ihS/BSEdIPnYGVZxj3gdsln+LSSfPuBsg=; 24:4Wcw8uBN7TkGAZEauRY0knLy4jaLUgg66wzDPaouvx0XGMdLMtTY5Nro+hU+djKuQjd6TRBZF3fw+bbj53iJdP9q/JeTam5XnKejiBzOEd8=; 7:ErNeP8fMvhtGKyL2Qu0mjbRFjR6TnbW7xAJzvIgZJRDXKCtij+a+gH5ttB5Cbf6It6J9UTufbJ/u2D5N8Z3w0uYJ2FtUyBTPow9dtJjVdEn8khPa2+7waUX2lqYOIuC3GK/PifHtwU0i+kfyRiVjT/WbqsBzFuqjkNPvE6eVJqxgyV4a+NkM14QeMJJc8Z4GXk6Blts4MUWS3FEXabSLxkefRKT/sM8/b9ei2IPjp6VDgH9mlkrGTURbAaiU00je SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2017 15:05:53.3654 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 935080f2-2a01-49a1-d2a8-08d540a8ae19 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH] 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: Mon, 11 Dec 2017 15:05:58 -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 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c index e0c2a78..e17f8fc 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); @@ -918,6 +919,18 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, rte_errno = -EINVAL; return 0; } + j = 0; + links_map = dev->data->links_map; + links_map += (port_id * RTE_EVENT_MAX_QUEUES_PER_DEV); + for (i = 0; i < nb_unlinks; i++) { + if (links_map[queues[i]] != + EVENT_QUEUE_SERVICE_PRIORITY_INVALID) { + linked_queues[j] = queues[i]; + j++; + } + } + queues = linked_queues; + nb_unlinks = j; diag = (*dev->dev_ops->port_unlink)(dev, dev->data->ports[port_id], queues, nb_unlinks); -- 2.7.4