From patchwork Mon Nov 28 09:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nithin Dabilpuram X-Patchwork-Id: 120198 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 B0780A00C3; Mon, 28 Nov 2022 10:55:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A87A40A7F; Mon, 28 Nov 2022 10:54:58 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B480D40A7F for ; Mon, 28 Nov 2022 10:54:56 +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 2AS5iflJ025003 for ; Mon, 28 Nov 2022 01:54:55 -0800 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=8JFNSfYCNeJN6Fh37uppe8PqLPoB1RhyIfWlwYYRr0I=; b=d/ZZXiC9fmUXZCsWxJlzpx6QlWzzXPE52oLkTRwj7lfq8PC4CbNCbkQZJsHnuWW8Gshn Nr2SFNUQuYomYt2pFV72KuEyttjmf6LrWmNRkZdKnoRYkTImd3vtXo4XToh+vTFoJHd1 2GEFIkLe3buh/dyrwX942/oMNfO51JEarCeqMWxh16D10JOpfTjXzdJwxKsqV2GMhsZ4 lTVlCS+lv29bw2AVqboR3ku3nAkqwgUqpphUEuVo9FNmVmoKM0wLNyALK4X9EyZvEBC5 QY5KXuypWrY1z2mgwlzoho5SSE5aPkHM7vo6otJDMLX7OSlkFUEpoLasFO7nPE6kHuXx 7A== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3m4q3srse2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 28 Nov 2022 01:54:55 -0800 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.18; Mon, 28 Nov 2022 01:54:53 -0800 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.2 via Frontend Transport; Mon, 28 Nov 2022 01:54:53 -0800 Received: from hyd1588t430.caveonetworks.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id D495E3F704D; Mon, 28 Nov 2022 01:54:51 -0800 (PST) From: Nithin Dabilpuram To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , Subject: [PATCH 02/11] net/cnxk: register callback to get queue errors Date: Mon, 28 Nov 2022 15:24:33 +0530 Message-ID: <20221128095442.3185112-2-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221128095442.3185112-1-ndabilpuram@marvell.com> References: <20221128095442.3185112-1-ndabilpuram@marvell.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 7ZvKEnmni6MCuFJCGD2h9XnCs7Vi1vYG X-Proofpoint-GUID: 7ZvKEnmni6MCuFJCGD2h9XnCs7Vi1vYG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_07,2022-11-25_01,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 From: Satha Rao Register a callback mechanism to get SQ error interrupts, add call ethdev event RTE_ETH_EVENT_INTR_RESET. Signed-off-by: Satha Rao --- drivers/net/cnxk/cnxk_ethdev.c | 13 +++++++++++++ drivers/net/cnxk/cnxk_ethdev.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index bf1585fe67..104aad7b51 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1750,6 +1750,16 @@ struct eth_dev_ops cnxk_eth_dev_ops = { .cman_config_get = cnxk_nix_cman_config_get, }; +void +cnxk_eth_dev_q_err_cb(struct roc_nix *nix, void *data) +{ + struct cnxk_eth_dev *dev = (struct cnxk_eth_dev *)nix; + struct rte_eth_dev *eth_dev = dev->eth_dev; + + /* Set the flag and execute application callbacks */ + rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_RESET, data); +} + static int cnxk_eth_dev_init(struct rte_eth_dev *eth_dev) { @@ -1804,6 +1814,9 @@ cnxk_eth_dev_init(struct rte_eth_dev *eth_dev) roc_nix_mac_link_info_get_cb_register(nix, cnxk_eth_dev_link_status_get_cb); + /* Register up msg callbacks */ + roc_nix_q_err_cb_register(nix, cnxk_eth_dev_q_err_cb); + /* Register callback for inline meta pool create */ roc_nix_inl_meta_pool_cb_register(cnxk_nix_inl_meta_pool_cb); diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h index 651ef45ea8..a86e9dba80 100644 --- a/drivers/net/cnxk/cnxk_ethdev.h +++ b/drivers/net/cnxk/cnxk_ethdev.h @@ -599,6 +599,7 @@ void cnxk_eth_dev_link_status_cb(struct roc_nix *nix, struct roc_nix_link_info *link); void cnxk_eth_dev_link_status_get_cb(struct roc_nix *nix, struct roc_nix_link_info *link); +void cnxk_eth_dev_q_err_cb(struct roc_nix *nix, void *data); int cnxk_nix_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete); int cnxk_nix_queue_stats_mapping(struct rte_eth_dev *dev, uint16_t queue_id, uint8_t stat_idx, uint8_t is_rx);