From: Sachin Saxena <sachin.saxena@nxp.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Nipun Gupta <nipun.gupta@nxp.com>
Subject: [dpdk-dev] [PATCH v2 05/30] net/dpaa: support Rx interrupt handler
Date: Thu, 29 Aug 2019 15:57:12 +0530 [thread overview]
Message-ID: <20190829102737.13267-6-sachin.saxena@nxp.com> (raw)
In-Reply-To: <20190829102737.13267-1-sachin.saxena@nxp.com>
From: Nipun Gupta <nipun.gupta@nxp.com>
This patch adds interrupt handler support for
the ethernet devices which are configured with
a dedicated portal for packet Rx
(i.e. for FQ's in push mode).
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
drivers/bus/dpaa/base/qbman/qman_driver.c | 3 ++-
drivers/bus/dpaa/include/fsl_qman.h | 18 +++++++++++++-
drivers/bus/dpaa/include/fsl_usd.h | 2 +-
drivers/bus/dpaa/rte_dpaa_bus.h | 1 +
drivers/net/dpaa/dpaa_ethdev.c | 29 +++++++++++++++++++++--
5 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c
index 06ed814e1..acd003143 100644
--- a/drivers/bus/dpaa/base/qbman/qman_driver.c
+++ b/drivers/bus/dpaa/base/qbman/qman_driver.c
@@ -121,7 +121,7 @@ void qman_thread_irq(void)
out_be32(qpcfg.addr_virt[DPAA_PORTAL_CI] + 0x36C0, 0);
}
-struct qman_portal *fsl_qman_fq_portal_create(void)
+struct qman_portal *fsl_qman_fq_portal_create(int *fd)
{
struct qman_portal *portal = NULL;
struct qm_portal_config *q_pcfg;
@@ -171,6 +171,7 @@ struct qman_portal *fsl_qman_fq_portal_create(void)
irq_map.portal_cinh = q_map.addr.cinh;
process_portal_irq_map(q_fd, &irq_map);
+ *fd = q_fd;
return portal;
err:
if (portal)
diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h
index 5f13a5544..064b65aed 100644
--- a/drivers/bus/dpaa/include/fsl_qman.h
+++ b/drivers/bus/dpaa/include/fsl_qman.h
@@ -1215,6 +1215,9 @@ struct qman_fq {
struct qman_fq_cb cb;
u32 fqid_le;
+ u32 fqid;
+
+ int q_fd;
u16 ch_id;
u8 cgr_groupid;
u8 is_static:4;
@@ -1231,7 +1234,6 @@ struct qman_fq {
volatile unsigned long flags;
enum qman_fq_state state;
- u32 fqid;
spinlock_t fqlock;
struct rb_node node;
@@ -1333,6 +1335,13 @@ u32 qman_portal_dequeue(struct rte_event ev[], unsigned int poll_limit,
*/
int qman_irqsource_add(u32 bits);
+/**
+ * qman_fq_portal_irqsource_add - samilar to qman_irqsource_add, but it
+ * takes portal (fq specific) as input rather than using the thread affined
+ * portal.
+ */
+int qman_fq_portal_irqsource_add(struct qman_portal *p, u32 bits);
+
/**
* qman_irqsource_remove - remove processing sources from being interrupt-driven
* @bits: bitmask of QM_PIRQ_**I processing sources
@@ -1343,6 +1352,13 @@ int qman_irqsource_add(u32 bits);
*/
int qman_irqsource_remove(u32 bits);
+/**
+ * qman_fq_portal_irqsource_remove - similar to qman_irqsource_remove, but it
+ * takes portal (fq specific) as input rather than using the thread affined
+ * portal.
+ */
+int qman_fq_portal_irqsource_remove(struct qman_portal *p, u32 bits);
+
/**
* qman_affine_channel - return the channel ID of an portal
* @cpu: the cpu whose affine portal is the subject of the query
diff --git a/drivers/bus/dpaa/include/fsl_usd.h b/drivers/bus/dpaa/include/fsl_usd.h
index ea7be38af..a407e2b22 100644
--- a/drivers/bus/dpaa/include/fsl_usd.h
+++ b/drivers/bus/dpaa/include/fsl_usd.h
@@ -75,7 +75,7 @@ int qman_global_init(void);
int bman_global_init(void);
/* Direct portal create and destroy */
-struct qman_portal *fsl_qman_fq_portal_create(void);
+struct qman_portal *fsl_qman_fq_portal_create(int *fd);
int fsl_qman_fq_portal_destroy(struct qman_portal *qp);
int fsl_qman_fq_portal_init(struct qman_portal *qp);
diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h
index 554a56f2e..9601aebdd 100644
--- a/drivers/bus/dpaa/rte_dpaa_bus.h
+++ b/drivers/bus/dpaa/rte_dpaa_bus.h
@@ -75,6 +75,7 @@ struct rte_dpaa_device {
};
struct rte_dpaa_driver *driver;
struct dpaa_device_id id;
+ struct rte_intr_handle intr_handle;
enum rte_dpaa_type device_type; /**< Ethernet or crypto type device */
char name[RTE_ETH_NAME_MAX_LEN];
};
diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c
index 4e2c9471e..1934f85ae 100644
--- a/drivers/net/dpaa/dpaa_ethdev.c
+++ b/drivers/net/dpaa/dpaa_ethdev.c
@@ -628,8 +628,10 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
fman_if_get_sg_enable(dpaa_intf->fif),
dev->data->dev_conf.rxmode.max_rx_pkt_len);
/* checking if push mode only, no error check for now */
- if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) {
+ if (!rxq->is_static &&
+ dpaa_push_mode_max_queue > dpaa_push_queue_idx) {
struct qman_portal *qp;
+ int q_fd;
dpaa_push_queue_idx++;
opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA;
@@ -676,12 +678,35 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
rxq->is_static = true;
/* Allocate qman specific portals */
- qp = fsl_qman_fq_portal_create();
+ qp = fsl_qman_fq_portal_create(&q_fd);
if (!qp) {
DPAA_PMD_ERR("Unable to alloc fq portal");
return -1;
}
rxq->qp = qp;
+
+ /* Set up the device interrupt handler */
+ if (!dev->intr_handle) {
+ struct rte_dpaa_device *dpaa_dev;
+ struct rte_device *rdev = dev->device;
+
+ dpaa_dev = container_of(rdev, struct rte_dpaa_device,
+ device);
+ dev->intr_handle = &dpaa_dev->intr_handle;
+ dev->intr_handle->intr_vec = rte_zmalloc(NULL,
+ dpaa_push_mode_max_queue, 0);
+ if (!dev->intr_handle->intr_vec) {
+ DPAA_PMD_ERR("intr_vec alloc failed");
+ return -ENOMEM;
+ }
+ dev->intr_handle->nb_efd = dpaa_push_mode_max_queue;
+ dev->intr_handle->max_intr = dpaa_push_mode_max_queue;
+ }
+
+ dev->intr_handle->type = RTE_INTR_HANDLE_EXT;
+ dev->intr_handle->intr_vec[queue_idx] = queue_idx + 1;
+ dev->intr_handle->efds[queue_idx] = q_fd;
+ rxq->q_fd = q_fd;
}
rxq->bp_array = rte_dpaa_bpid_info;
dev->data->rx_queues[queue_idx] = rxq;
--
2.17.1
next prev parent reply other threads:[~2019-08-29 10:42 UTC|newest]
Thread overview: 76+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 7:07 [dpdk-dev] [PATCH v1 00/30] Enhancements and fixes in NXP dpaax drivers and fsl-mc bus Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 01/30] bus/dpaa: fix DPAA SEC blacklist case Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 02/30] net/dpaa: improve the Rx offload debug message Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 03/30] bus/dpaa: remove un-necessary thread affinity Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 04/30] bus/dpaa: decouple fq portal alloc and init Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 05/30] net/dpaa: support Rx interrupt handler Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 06/30] net/dpaa: support for Rx interrupt enable and disable Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 07/30] net/dpaa: add SG support in Tx for non DPAA buffer Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 08/30] net/dpaa: reduce debug messages Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 09/30] net/dpaa2: improve the Rx offload debug message Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 10/30] common/dpaax: reduce debug mesages Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 11/30] mempool/dpaa: reduce debug messages Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 12/30] net/dpaa2: realign Rx offload support types Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 13/30] net/dpaa2: enable Rx offload for timestamp Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 14/30] net/dpaa2: support L2 payload based RSS distribution Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 15/30] net/dpaa2: add optional non-prefetch Rx mode Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 16/30] net/dpaa2: add taildrop support on frame count basis Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 17/30] net/dpaa2: add cgr counters in xtra stats Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 18/30] net/dpaa2: add support for config max Rx length in HW Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 19/30] net/dpaa2: use LFQIDs in Tx instead of qdid Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 20/30] net/dpaa2: support dpdmux classification on eth type Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 21/30] net/dpaa2: add Tx confirmation mode support Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 22/30] net/dpaa2: add timestamp support Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 23/30] net/dpaa2: add dprtc sub-module Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 24/30] net/dpaa2: add ptp driver Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 25/30] bus/fslmc: update PA-VA dpaax library only in PA mode Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 26/30] bus/fslmc: check for Dma map in primary process only Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 27/30] bus/fslmc: support multi vfio group Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 28/30] net/dpaa2: support separate MC portal per process Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 29/30] net/dpaa2: add support for soft parser in MC Sachin Saxena
2019-08-27 7:07 ` [dpdk-dev] [PATCH v1 30/30] net/dpaa2: add soft parser driver Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 00/30] Enhancements and fixes in NXP dpaax drivers and fsl-mc bus Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 01/30] bus/dpaa: fix DPAA SEC blacklist case Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 02/30] net/dpaa: improve the Rx offload debug message Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 03/30] bus/dpaa: remove un-necessary thread affinity Sachin Saxena
2019-09-30 11:51 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 04/30] bus/dpaa: decouple fq portal alloc and init Sachin Saxena
2019-09-30 11:52 ` Hemant Agrawal
2019-10-03 7:52 ` Ferruh Yigit
2019-10-03 9:42 ` Nipun Gupta
2019-08-29 10:27 ` Sachin Saxena [this message]
2019-09-30 11:51 ` [dpdk-dev] [PATCH v2 05/30] net/dpaa: support Rx interrupt handler Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 06/30] net/dpaa: support for Rx interrupt enable and disable Sachin Saxena
2019-09-30 11:52 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 07/30] net/dpaa: add SG support in Tx for non DPAA buffer Sachin Saxena
2019-10-03 8:26 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 08/30] net/dpaa: reduce debug messages Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 09/30] net/dpaa2: improve the Rx offload debug message Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 10/30] common/dpaax: reduce debug mesages Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 11/30] mempool/dpaa: reduce debug messages Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 12/30] net/dpaa2: realign Rx offload support types Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 13/30] net/dpaa2: enable Rx offload for timestamp Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 14/30] net/dpaa2: support L2 payload based RSS distribution Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 15/30] net/dpaa2: add optional non-prefetch Rx mode Sachin Saxena
2019-10-03 8:26 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 16/30] net/dpaa2: add taildrop support on frame count basis Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 17/30] net/dpaa2: add cgr counters in xtra stats Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 18/30] net/dpaa2: add support for config max Rx length in HW Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 19/30] net/dpaa2: use LFQIDs in Tx instead of qdid Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 20/30] net/dpaa2: support dpdmux classification on eth type Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 21/30] net/dpaa2: add Tx confirmation mode support Sachin Saxena
2019-09-30 11:53 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 22/30] net/dpaa2: add timestamp support Sachin Saxena
2019-09-30 11:53 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 23/30] net/dpaa2: add dprtc sub-module Sachin Saxena
2019-10-03 8:26 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 24/30] net/dpaa2: add ptp driver Sachin Saxena
2019-10-03 8:26 ` Hemant Agrawal
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 25/30] bus/fslmc: update PA-VA dpaax library only in PA mode Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 26/30] bus/fslmc: check for Dma map in primary process only Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 27/30] bus/fslmc: support multi vfio group Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 28/30] net/dpaa2: support separate MC portal per process Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 29/30] net/dpaa2: add support for soft parser in MC Sachin Saxena
2019-08-29 10:27 ` [dpdk-dev] [PATCH v2 30/30] net/dpaa2: add soft parser driver Sachin Saxena
2019-10-03 8:26 ` Hemant Agrawal
2019-10-03 11:33 ` [dpdk-dev] [PATCH v2 00/30] Enhancements and fixes in NXP dpaax drivers and fsl-mc bus 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=20190829102737.13267-6-sachin.saxena@nxp.com \
--to=sachin.saxena@nxp.com \
--cc=dev@dpdk.org \
--cc=nipun.gupta@nxp.com \
--cc=thomas@monjalon.net \
/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).