From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <dev@dpdk.org>
Cc: <ferruh.yigit@intel.com>, <shreyansh.jain@nxp.com>
Subject: [dpdk-dev] [PATCH 08/14] net/dpaa2: add Rx queue count support
Date: Fri, 8 Dec 2017 10:51:21 +0530 [thread overview]
Message-ID: <1512710487-32388-9-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1512710487-32388-1-git-send-email-hemant.agrawal@nxp.com>
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
drivers/net/dpaa2/dpaa2_ethdev.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c
index 577bd8f..3e89d8d 100644
--- a/drivers/net/dpaa2/dpaa2_ethdev.c
+++ b/drivers/net/dpaa2/dpaa2_ethdev.c
@@ -51,6 +51,7 @@
#include <dpaa2_hw_dpio.h>
#include <mc/fsl_dpmng.h>
#include "dpaa2_ethdev.h"
+#include <fsl_qbman_debug.h>
struct rte_dpaa2_xstats_name_off {
char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -595,6 +596,37 @@ dpaa2_dev_tx_queue_release(void *q __rte_unused)
PMD_INIT_FUNC_TRACE();
}
+static uint32_t
+dpaa2_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)
+{
+ int32_t ret;
+ struct dpaa2_dev_priv *priv = dev->data->dev_private;
+ struct dpaa2_queue *dpaa2_q;
+ struct qbman_swp *swp;
+ struct qbman_fq_query_np_rslt state;
+ uint32_t frame_cnt = 0;
+
+ PMD_INIT_FUNC_TRACE();
+
+ if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
+ ret = dpaa2_affine_qbman_swp();
+ if (ret) {
+ RTE_LOG(ERR, PMD, "Failure in affining portal\n");
+ return -EINVAL;
+ }
+ }
+ swp = DPAA2_PER_LCORE_PORTAL;
+
+ dpaa2_q = (struct dpaa2_queue *)priv->rx_vq[rx_queue_id];
+
+ if (qbman_fq_query_state(swp, dpaa2_q->fqid, &state) == 0) {
+ frame_cnt = qbman_fq_state_frame_count(&state);
+ RTE_LOG(DEBUG, PMD, "RX frame count for q(%d) is %u\n",
+ rx_queue_id, frame_cnt);
+ }
+ return frame_cnt;
+}
+
static const uint32_t *
dpaa2_supported_ptypes_get(struct rte_eth_dev *dev)
{
@@ -1737,6 +1769,7 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {
.rx_queue_release = dpaa2_dev_rx_queue_release,
.tx_queue_setup = dpaa2_dev_tx_queue_setup,
.tx_queue_release = dpaa2_dev_tx_queue_release,
+ .rx_queue_count = dpaa2_dev_rx_queue_count,
.flow_ctrl_get = dpaa2_flow_ctrl_get,
.flow_ctrl_set = dpaa2_flow_ctrl_set,
.mac_addr_add = dpaa2_dev_add_mac_addr,
--
2.7.4
next prev parent reply other threads:[~2017-12-08 5:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 5:21 [dpdk-dev] [PATCH 00/14] DPAA2 PMD fixes and enhancements Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 01/14] bus/fslmc: fix the cplusplus macro closure Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 02/14] drivers: change the deprecated memseg physaddr to iova Hemant Agrawal
2017-12-08 5:29 ` santosh
2017-12-08 5:21 ` [dpdk-dev] [PATCH 03/14] bus/fslmc: add support for dynamic iova for DPAA2 devices Hemant Agrawal
2017-12-12 0:52 ` Ferruh Yigit
2017-12-08 5:21 ` [dpdk-dev] [PATCH 04/14] net/dpaa2: link status check as driver flag Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 05/14] bus/fslmc: expose platform soc value register Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 06/14] bus/fslmc: add braces for pointers in macros Hemant Agrawal
2017-12-12 0:52 ` Ferruh Yigit
2017-12-12 5:22 ` Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 07/14] bus/fslmc: add qman HW fq query count API Hemant Agrawal
2017-12-08 5:21 ` Hemant Agrawal [this message]
2017-12-12 1:28 ` [dpdk-dev] [PATCH 08/14] net/dpaa2: add Rx queue count support Stephen Hemminger
2017-12-12 5:14 ` Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 09/14] net/dpaa2: align the frame size in MTU set Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 10/14] net/dpaa2: add VLAN insert offload Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 11/14] net/dpaa2: add parse function for LX2 device Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 12/14] net/dpaa2: optimize Rx path packet parsing Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 13/14] net/dpaa2: optimize Tx path for best case Hemant Agrawal
2017-12-08 5:21 ` [dpdk-dev] [PATCH 14/14] net/dpaa2: prefetch the parse results from next fd Hemant Agrawal
2017-12-12 0:53 ` [dpdk-dev] [PATCH 00/14] DPAA2 PMD fixes and enhancements Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1512710487-32388-9-git-send-email-hemant.agrawal@nxp.com \
--to=hemant.agrawal@nxp.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=shreyansh.jain@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).