From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by dpdk.org (Postfix) with ESMTP id 49F6C1B161 for ; Thu, 7 Jun 2018 11:43:34 +0200 (CEST) Received: by mail-lf0-f66.google.com with SMTP id n3-v6so13623512lfe.12 for ; Thu, 07 Jun 2018 02:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YnZe8HvdnzZz2TLBXsClAS62JzeHlVKJu00VBtvxyY0=; b=y2tz1r2hn0gssUVEJWcpTH2jUE9ZHRgk1J1p1Q5LcHni9uRzVnKhgjCAz5OIptaQ5q 8ktPt+QCQhuW+yGxgD3iyzKU2zEtdv9GhcXZVVpdWhJskNoU//Ky8twoI2pwL0LLwtlC /yoY711zKuzeCDrvE8O+0c3TlK0ftybsXvrH31FNE9YdHxDSHPdJLSMTbxSUj9XOoM6s GsoDBWsIwzdaP2eruX4rwWkW11+wtgSC+apvN/QnIAPANSJ1uXyQXB17cgoOo92zOaGv lI9hcj2fUNrVLIXKIw+OMXalQsbfpSwf7oYx3iY/Dc83l/J3IWKBykAd2rMW8W8XuoQ0 HUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YnZe8HvdnzZz2TLBXsClAS62JzeHlVKJu00VBtvxyY0=; b=rKgJ9JRjqIVZ8N0KejSEfHV4g/Uv0gDY4hWpRlsH61ufQFVTDwXNJ76nadqkyBJKGv x1LIismNAUXmLrDrsUyMhqGhyFk3BF1etrv7zp2caeF3sVCnnaswr6bRevQjjNIa+eQp kP5Gu0WercRtfT0m7FKDuY2HF56eUjkMBcQaInmkoggEa6WXSf+C+Mvb958Q7OpRR6F9 MkkGj/miUyISD1sha9jlWDM2gFVt8dZhEsM1ynMJlLAWu6WjVp4SDeeOzBP38EXDGv6U bIQO7CG0TfjPELvN8VIGfUJz/BhObHTcJL3f/ygNbsfUOpoVzXMjUovn73bb1uv/JyPm Z0Rw== X-Gm-Message-State: APt69E3qoFdZ9LL3/WMdNjGsW+NpA1nAi7Mj55MQFX67mvo0nHvHlv01 0kGNjU+oEaPLO4lrTHN63AtWnQ== X-Google-Smtp-Source: ADUXVKJLNmZIWoGyzNZ3GhYs7R4w9nPcseRBxuo+XbzQApHzN7o4w9VaF2Nddz8ZV0FCbOjHw8zctg== X-Received: by 2002:a2e:8350:: with SMTP id l16-v6mr943207ljh.7.1528364613936; Thu, 07 Jun 2018 02:43:33 -0700 (PDT) Received: from mkPC.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id p28-v6sm3612368lfh.24.2018.06.07.02.43.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 02:43:33 -0700 (PDT) From: Michal Krawczyk To: Marcin Wojtas , Michal Krawczyk , Guy Tzalik , Evgeny Schemeilin Cc: dev@dpdk.org, matua@amazon.com Date: Thu, 7 Jun 2018 11:42:59 +0200 Message-Id: <20180607094322.14312-4-mk@semihalf.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180607094322.14312-1-mk@semihalf.com> References: <20180607094322.14312-1-mk@semihalf.com> Subject: [dpdk-dev] [PATCH v3 04/27] net/ena: add interrupt handler for admin queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jun 2018 09:43:34 -0000 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 --- 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 f4b137a83..515d17fee 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -246,6 +246,7 @@ static int ena_rss_reta_query(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); static int ena_get_sset_count(struct rte_eth_dev *dev, int sset); +static void ena_interrupt_handler_rte(void *cb_arg); static const struct eth_dev_ops ena_dev_ops = { .dev_configure = ena_dev_configure, @@ -459,9 +460,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); } @@ -908,6 +916,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 || @@ -937,6 +947,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; @@ -1291,6 +1306,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