All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: Marcin Wojtas <mw@semihalf.com>,
	Michal Krawczyk <mk@semihalf.com>,
	Guy Tzalik <gtzalik@amazon.com>,
	Evgeny Schemeilin <evgenys@amazon.com>
Cc: dev@dpdk.org, matua@amazon.com
Subject: [PATCH v1 03/24] net/ena: add interrupt handler for admin queue
Date: Wed,  9 May 2018 14:45:47 +0200	[thread overview]
Message-ID: <20180509124552.22854-3-mk@semihalf.com> (raw)
In-Reply-To: <20180509124552.22854-1-mk@semihalf.com>

The ENA device is able to send MSI-X when it will complete an command
when polling mode is deactivated. Further, the same interrupt handler
will be used for the AENQ handling - services of the ENA device, that
allows to implement watchdog or lsc handler.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 81e36b1ef..ec0380f0a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -250,6 +250,7 @@ static bool ena_are_tx_queue_offloads_allowed(struct ena_adapter *adapter,
 					      uint64_t offloads);
 static bool ena_are_rx_queue_offloads_allowed(struct ena_adapter *adapter,
 					      uint64_t offloads);
+static void ena_interrupt_handler_rte(void *cb_arg);

 static const struct eth_dev_ops ena_dev_ops = {
 	.dev_configure        = ena_dev_configure,
@@ -463,9 +464,16 @@ static void ena_close(struct rte_eth_dev *dev)
 {
 	struct ena_adapter *adapter =
 		(struct ena_adapter *)(dev->data->dev_private);
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;

 	adapter->state = ENA_ADAPTER_STATE_STOPPED;

+	rte_intr_disable(intr_handle);
+	rte_intr_callback_unregister(intr_handle,
+				     ena_interrupt_handler_rte,
+				     adapter);
+
 	ena_rx_queue_release_all(dev);
 	ena_tx_queue_release_all(dev);
 }
@@ -912,6 +920,8 @@ static int ena_start(struct rte_eth_dev *dev)
 {
 	struct ena_adapter *adapter =
 		(struct ena_adapter *)(dev->data->dev_private);
+	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
+	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 	int rc = 0;

 	if (!(adapter->state == ENA_ADAPTER_STATE_CONFIG ||
@@ -941,6 +951,11 @@ static int ena_start(struct rte_eth_dev *dev)

 	ena_stats_restart(dev);

+	rte_intr_callback_register(intr_handle,
+				   ena_interrupt_handler_rte,
+				   adapter);
+	rte_intr_enable(intr_handle);
+
 	adapter->state = ENA_ADAPTER_STATE_RUNNING;

 	return 0;
@@ -1306,6 +1321,14 @@ static int ena_device_init(struct ena_com_dev *ena_dev,
 	return rc;
 }

+static void ena_interrupt_handler_rte(__rte_unused void *cb_arg)
+{
+	struct ena_adapter *adapter = (struct ena_adapter *)cb_arg;
+	struct ena_com_dev *ena_dev = &adapter->ena_dev;
+
+	ena_com_admin_q_comp_intr_handler(ena_dev);
+}
+
 static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev;
--
2.14.1

  parent reply	other threads:[~2018-05-09 12:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 12:45 [PATCH v1 01/24] net/ena: update ena_com to the newer version Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 02/24] net/ena: remove support of legacy LLQ Michal Krawczyk
2018-05-09 12:45 ` Michal Krawczyk [this message]
2018-05-09 12:45 ` [PATCH v1 04/24] net/ena: add stop and uninit routines Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 05/24] net/ena: add LSC intr support and AENQ handling Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 06/24] net/ena: handle ENA notification Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 07/24] net/ena: restart only initialized queues instead of all Michal Krawczyk
2018-05-09 12:45 ` [PATCH v1 08/24] net/ena: add reset routine Michal Krawczyk
2018-05-31 15:12 ` [PATCH v1 01/24] net/ena: update ena_com to the newer version 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=20180509124552.22854-3-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=mw@semihalf.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.