From patchwork Tue Oct 3 15:08:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Nikhilesh Bhagavatula X-Patchwork-Id: 132283 X-Patchwork-Delegate: jerinj@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E9654269F; Tue, 3 Oct 2023 17:08:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 256A5402A2; Tue, 3 Oct 2023 17:08:39 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 5E45040262 for ; Tue, 3 Oct 2023 17:08:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 393E43S0028431; Tue, 3 Oct 2023 08:08:36 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=9dix7sv9O34Vw/uGhbcUulSjU4yMShlxWqUh3ZP5Vzw=; b=h66+iLpiezjkKCTX4W1st6k4jdILCnnkH/sL1O7kKIMgcwOjJ9/EeKg7hFRCln2s6iu4 zt4FTax+Y0ea/IHhA3HoAGgWGRzEsAVSvyMwatBcmkNN9bgaTisp7UckxqEg9dBh/Zr2 2A36dm9Z+4NeT9sGtasS/5S4EsdAN0TIXqfxiqyTJFK0tAXFNdzhoSgSRzRKFnkwe7q9 GkAqOGDQqhKgA3SQXGitpEmOWxGEwn3iftNxyAr/MPpol11jMpdMrZ0W3EnPzcc3YL38 vFxHvHyb25lqONi9Bm1hI9fJeL+xj2no7xRgDrQbtTROIr6nLovL2UqzpwdOaxEkZk26 hg== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tek6n0u5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 08:08:36 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 3 Oct 2023 08:08:34 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Tue, 3 Oct 2023 08:08:34 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 391633F707F; Tue, 3 Oct 2023 08:08:29 -0700 (PDT) From: To: , CC: , Pavan Nikhilesh Subject: [PATCH v2] eventdev: fix port link and unlink Date: Tue, 3 Oct 2023 20:38:29 +0530 Message-ID: <20231003150829.8257-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231003150131.6786-1-pbhagavatula@marvell.com> References: <20231003150131.6786-1-pbhagavatula@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 5nXg8e48_WQ_c1JqbSDvJCDSwd61J7Dt X-Proofpoint-GUID: 5nXg8e48_WQ_c1JqbSDvJCDSwd61J7Dt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-03_12,2023-10-02_01,2023-05-22_02 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Pavan Nikhilesh Port link and unlink rely on info get API to validate max supported profiles, the default max profiles is initialized in ``rte_dev_info_get`` API, use it instead of invoking driver callback. Fixes: 162aa4e1b479 ("eventdev: introduce link profiles") Signed-off-by: Pavan Nikhilesh --- lib/eventdev/rte_eventdev.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 5ee8bd665b..64fd5a70ae 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -995,10 +995,10 @@ rte_event_port_profile_links_set(uint8_t dev_id, uint8_t port_id, const uint8_t RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0); dev = &rte_eventdevs[dev_id]; - if (*dev->dev_ops->dev_infos_get == NULL) - return -ENOTSUP; + diag = rte_event_dev_info_get(dev_id, &info); + if (diag < 0) + return diag; - (*dev->dev_ops->dev_infos_get)(dev, &info); if (profile_id >= RTE_EVENT_MAX_PROFILES_PER_PORT || profile_id >= info.max_profiles_per_port) { RTE_EDEV_LOG_ERR("Invalid profile_id=%" PRIu8, profile_id); @@ -1083,10 +1083,10 @@ rte_event_port_profile_unlink(uint8_t dev_id, uint8_t port_id, uint8_t queues[], RTE_EVENTDEV_VALID_DEVID_OR_ERRNO_RET(dev_id, EINVAL, 0); dev = &rte_eventdevs[dev_id]; - if (*dev->dev_ops->dev_infos_get == NULL) - return -ENOTSUP; + diag = rte_event_dev_info_get(dev_id, &info); + if (diag < 0) + return diag; - (*dev->dev_ops->dev_infos_get)(dev, &info); if (profile_id >= RTE_EVENT_MAX_PROFILES_PER_PORT || profile_id >= info.max_profiles_per_port) { RTE_EDEV_LOG_ERR("Invalid profile_id=%" PRIu8, profile_id); @@ -1219,16 +1219,16 @@ rte_event_port_profile_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues { struct rte_event_dev_info info; struct rte_eventdev *dev; + int i, diag, count = 0; uint16_t *links_map; - int i, count = 0; RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL); - dev = &rte_eventdevs[dev_id]; - if (*dev->dev_ops->dev_infos_get == NULL) - return -ENOTSUP; - (*dev->dev_ops->dev_infos_get)(dev, &info); + diag = rte_event_dev_info_get(dev_id, &info); + if (diag < 0) + return diag; + if (profile_id >= RTE_EVENT_MAX_PROFILES_PER_PORT || profile_id >= info.max_profiles_per_port) { RTE_EDEV_LOG_ERR("Invalid profile_id=%" PRIu8, profile_id);