From patchwork Tue Jan 3 13:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shijith Thotton X-Patchwork-Id: 121531 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 7E820A00C2; Tue, 3 Jan 2023 14:09:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25FD740693; Tue, 3 Jan 2023 14:09:17 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id EB5E940689; Tue, 3 Jan 2023 14:09:14 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303D4tIJ017316; Tue, 3 Jan 2023 05:09:13 -0800 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=N5L0ODKLNIrqQ8zLfugtsfUpZBoIo2/ZNPXJLSJkTrA=; b=HPqB84qEZn0phjbrZ3liyNI6dr13MUWytz9GacR6uSdcx4CG4HDBjfnEZ1jKlzMKkeMc K4fqs7ArEXdAHa8tAADibd8MVPxDrtyoSKyksfhyxrZmNuzt2f/I8fKszY6PJdOtKruL LU2HEq+dX0cxji4fVRIi6kblkow8qXdyzdPkp4GJqOh2ZddqWNK5TezuD3t7haP/btbG XKyx3B68e2sCxftHDyKwzuJLvwU1tyNc/K8FVe3JGEzXa5YAInh2s7F/2A+2kightATD 9Lbnls1+Cn5tTN3j8LJjIiJFtW4rzVr5IF3ByThRyVib+KEWcoo2RzE9R0duJM87w95k pw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mtkauw2vh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 03 Jan 2023 05:09:13 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 3 Jan 2023 05:09:11 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 3 Jan 2023 05:09:11 -0800 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id 959343F708A; Tue, 3 Jan 2023 05:09:09 -0800 (PST) From: Shijith Thotton To: , CC: , Shijith Thotton , , , Naga Harish K S V Subject: [PATCH] eventdev/eth_rx: fix return of rx adapter instance get Date: Tue, 3 Jan 2023 18:39:04 +0530 Message-ID: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: IDJtlH2ttP5FhjMrwfoBpxQbjkPkNF9J X-Proofpoint-ORIG-GUID: IDJtlH2ttP5FhjMrwfoBpxQbjkPkNF9J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-03_04,2023-01-03_02,2022-06-22_01 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 The API to get rx adapter instance is returning error for event devices with internal port capability and eth_rx_adapter_instance_get op undefined. But as the Rx adapter is internally maintaining the queue information needed to find the instance id, event devices can opt out from defining the op. Modified code to match this logic. Fixes: a1793ee8aba0 ("eventdev/eth_rx: add adapter instance get API") Signed-off-by: Shijith Thotton --- lib/eventdev/rte_event_eth_rx_adapter.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index cf7bbd4d69..170823a03c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -3415,14 +3415,10 @@ rte_event_eth_rx_adapter_instance_get(uint16_t eth_dev_id, if (!rte_event_eth_rx_adapter_caps_get(rx_adapter->eventdev_id, eth_dev_id, &caps)) { - if (caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) { - ret = rxa_dev_instance_get(rx_adapter) ? - rxa_dev_instance_get(rx_adapter) - (eth_dev_id, - rx_queue_id, - rxa_inst_id) - : -EINVAL; - } + if (caps & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT && + rxa_dev_instance_get(rx_adapter)) + ret = rxa_dev_instance_get(rx_adapter)(eth_dev_id, rx_queue_id, + rxa_inst_id); } /* return if entry found */