From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E74FA0C46; Fri, 18 Jun 2021 12:44:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37B76411EB; Fri, 18 Jun 2021 12:41:14 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F233040142 for ; Fri, 18 Jun 2021 12:41:10 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15IAaTc0004723 for ; Fri, 18 Jun 2021 03:41:10 -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-type; s=pfpt0220; bh=UDa+WcS4MC1l2ZtjiI5WlTCXSW+J1AQ6IlvFCQLrjDY=; b=VqVBe/idEbPLZp30vUeatdMnEct0b5dzi+sGUyeYtNeVEZ1MrWHWieIWqgnYS3M3VDhS pSPmxHkiXgFrsblVCPzjxXCe15g4SGPUnJsjQhe9P2f6FXitUqUtfGUE56tjX9efHsM1 APN/gxIBiwTNK6DNCrjZtEdAfx31+jvpHFfy4DyQAj0q1r2sHfkPeVlFUdqG3Ptc1SHU bJ2vEVR/loOm0D7LwHzVwTa8r7Gdhuhh3CO9C9C3xiIli2Sn6tsHjFcs+sMkGfkpHIiS a5HXGQkAXglhh4nQHxnHYLXB0+ArheCLJIa2QFPwo4wnXd2ESL5Vppstt5miJ8XhmhRA oA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com with ESMTP id 397udry7kg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 18 Jun 2021 03:41:10 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 18 Jun 2021 03:41:08 -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.18 via Frontend Transport; Fri, 18 Jun 2021 03:41:08 -0700 Received: from hyd1588t430.marvell.com (unknown [10.29.52.204]) by maili.marvell.com (Postfix) with ESMTP id 818F55B695A; Fri, 18 Jun 2021 03:40:53 -0700 (PDT) From: Nithin Dabilpuram To: CC: , , , , , , , Date: Fri, 18 Jun 2021 16:07:24 +0530 Message-ID: <20210618103741.26526-46-ndabilpuram@marvell.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20210618103741.26526-1-ndabilpuram@marvell.com> References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210618103741.26526-1-ndabilpuram@marvell.com> MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-ORIG-GUID: CUOlcSWMva6UCQ6zqEiGHRHO0Z_yGujY X-Proofpoint-GUID: CUOlcSWMva6UCQ6zqEiGHRHO0Z_yGujY X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-06-18_04:2021-06-18, 2021-06-18 signatures=0 Subject: [dpdk-dev] [PATCH v3 45/62] net/cnxk: add rxq/txq info get operations 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 Sender: "dev" From: Satha Rao Initial apis to get default queue information. Signed-off-by: Satha Rao --- drivers/net/cnxk/cnxk_ethdev.c | 2 ++ drivers/net/cnxk/cnxk_ethdev.h | 4 ++++ drivers/net/cnxk/cnxk_ethdev_ops.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c index 27b92f9..288e069 100644 --- a/drivers/net/cnxk/cnxk_ethdev.c +++ b/drivers/net/cnxk/cnxk_ethdev.c @@ -1192,6 +1192,8 @@ struct eth_dev_ops cnxk_eth_dev_ops = { .xstats_reset = cnxk_nix_xstats_reset, .xstats_get_by_id = cnxk_nix_xstats_get_by_id, .xstats_get_names_by_id = cnxk_nix_xstats_get_names_by_id, + .rxq_info_get = cnxk_nix_rxq_info_get, + .txq_info_get = cnxk_nix_txq_info_get, }; static int diff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h index 5a0dc13..32977eb 100644 --- a/drivers/net/cnxk/cnxk_ethdev.h +++ b/drivers/net/cnxk/cnxk_ethdev.h @@ -305,6 +305,10 @@ int cnxk_nix_xstats_get_names_by_id(struct rte_eth_dev *eth_dev, int cnxk_nix_xstats_get_by_id(struct rte_eth_dev *eth_dev, const uint64_t *ids, uint64_t *values, unsigned int n); int cnxk_nix_xstats_reset(struct rte_eth_dev *eth_dev); +void cnxk_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid, + struct rte_eth_rxq_info *qinfo); +void cnxk_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid, + struct rte_eth_txq_info *qinfo); /* Lookup configuration */ const uint32_t *cnxk_nix_supported_ptypes_get(struct rte_eth_dev *eth_dev); diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c index ddfaffa..55c26c4 100644 --- a/drivers/net/cnxk/cnxk_ethdev_ops.c +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c @@ -628,3 +628,33 @@ cnxk_nix_pool_ops_supported(struct rte_eth_dev *eth_dev, const char *pool) return -ENOTSUP; } + +void +cnxk_nix_rxq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid, + struct rte_eth_rxq_info *qinfo) +{ + void *rxq = eth_dev->data->rx_queues[qid]; + struct cnxk_eth_rxq_sp *rxq_sp = cnxk_eth_rxq_to_sp(rxq); + + memset(qinfo, 0, sizeof(*qinfo)); + + qinfo->mp = rxq_sp->qconf.mp; + qinfo->scattered_rx = eth_dev->data->scattered_rx; + qinfo->nb_desc = rxq_sp->qconf.nb_desc; + + memcpy(&qinfo->conf, &rxq_sp->qconf.conf.rx, sizeof(qinfo->conf)); +} + +void +cnxk_nix_txq_info_get(struct rte_eth_dev *eth_dev, uint16_t qid, + struct rte_eth_txq_info *qinfo) +{ + void *txq = eth_dev->data->tx_queues[qid]; + struct cnxk_eth_txq_sp *txq_sp = cnxk_eth_txq_to_sp(txq); + + memset(qinfo, 0, sizeof(*qinfo)); + + qinfo->nb_desc = txq_sp->qconf.nb_desc; + + memcpy(&qinfo->conf, &txq_sp->qconf.conf.tx, sizeof(qinfo->conf)); +} -- 2.8.4