From patchwork Tue Oct 3 15:01:31 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: 132282 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 859C84269F; Tue, 3 Oct 2023 17:01:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 10C51402A2; Tue, 3 Oct 2023 17:01:41 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 946E540262 for ; Tue, 3 Oct 2023 17:01:39 +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 393EU1Ot028374; Tue, 3 Oct 2023 08:01:38 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=nvOXwzW9dOHZ8gFPeHfTg3o5KzdyMr5iggJpl5VqewQ=; b=iqij7N2fw28dBZRo1N+t/3zLBrUT0l3MOuIsx04a83GdVhbJXa/7IXPNhS6ApPX2gQ8s 9EY1YS4Tc1bYGobvU5QPycVmypeapLm1fRQLVVp3AkvDzxksxuFNXc46WTDjpp7N4hgY qtoXhFU4oMk/5Cu9b050KZSRBVPhPldMXKlMH3r3bP6LD4IJliAXeoegiEABA85zz/72 cCallyBWqM0fTgZdlkYhKNZqUn35PNLqFKXeAfkh4l252hHfCWjxt5VmIPis/tieAVxn bZ5/mEFhxSrGnr8loJbhaUrVxrzm6p+HEX/vss9hSFvXb+xtAvFM6ommHgsLwfaT4NR0 RQ== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tek6n0t0n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Oct 2023 08:01:37 -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:01:35 -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:01:35 -0700 Received: from MININT-80QBFE8.corp.innovium.com (MININT-80QBFE8.marvell.com [10.28.164.106]) by maili.marvell.com (Postfix) with ESMTP id 1CEA23F707F; Tue, 3 Oct 2023 08:01:30 -0700 (PDT) From: To: , CC: , Pavan Nikhilesh Subject: [PATCH] eventdev: fix port link and unlink Date: Tue, 3 Oct 2023 20:31:31 +0530 Message-ID: <20231003150131.6786-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: izLidKabt2cqBzHUVl926MQSGhJqd2Zh X-Proofpoint-GUID: izLidKabt2cqBzHUVl926MQSGhJqd2Zh 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 --- - Please Squash lib/eventdev/rte_eventdev.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 5ee8bd665b..27b819d605 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); @@ -1223,12 +1223,12 @@ rte_event_port_profile_links_get(uint8_t dev_id, uint8_t port_id, uint8_t queues 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);