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, Rafal Kozik <rk@semihalf.com>
Subject: [PATCH v3 13/27] net/ena: make watchdog configurable
Date: Thu,  7 Jun 2018 11:43:08 +0200	[thread overview]
Message-ID: <20180607094322.14312-13-mk@semihalf.com> (raw)
In-Reply-To: <20180607094322.14312-1-mk@semihalf.com>

From: Rafal Kozik <rk@semihalf.com>

Add variable wd_state to make driver functional without keep alive
AENQ handler.
The watchdog will be executed only if the aenq group has keep alive
enabled.

Signed-off-by: Rafal Kozik <rk@semihalf.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 19 +++++++++++++++----
 drivers/net/ena/ena_ethdev.h |  2 ++
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index dc253c384..1a15c184a 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -204,7 +204,8 @@ static const struct rte_pci_id pci_id_ena_map[] = {
 static struct ena_aenq_handlers aenq_handlers;
 
 static int ena_device_init(struct ena_com_dev *ena_dev,
-			   struct ena_com_dev_get_features_ctx *get_feat_ctx);
+			   struct ena_com_dev_get_features_ctx *get_feat_ctx,
+			   bool *wd_state);
 static int ena_dev_configure(struct rte_eth_dev *dev);
 static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 				  uint16_t nb_pkts);
@@ -485,6 +486,7 @@ ena_dev_reset(struct rte_eth_dev *dev)
 	struct ena_adapter *adapter;
 	int nb_queues;
 	int rc, i;
+	bool wd_state;
 
 	adapter = (struct ena_adapter *)(dev->data->dev_private);
 	ena_dev = &adapter->ena_dev;
@@ -510,11 +512,12 @@ ena_dev_reset(struct rte_eth_dev *dev)
 	ena_com_admin_destroy(ena_dev);
 	ena_com_mmio_reg_read_request_destroy(ena_dev);
 
-	rc = ena_device_init(ena_dev, &get_feat_ctx);
+	rc = ena_device_init(ena_dev, &get_feat_ctx, &wd_state);
 	if (rc) {
 		PMD_INIT_LOG(CRIT, "Cannot initialize device\n");
 		return rc;
 	}
+	adapter->wd_state = wd_state;
 
 	rte_intr_enable(intr_handle);
 	ena_com_set_admin_polling_mode(ena_dev, false);
@@ -1309,7 +1312,8 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
 }
 
 static int ena_device_init(struct ena_com_dev *ena_dev,
-			   struct ena_com_dev_get_features_ctx *get_feat_ctx)
+			   struct ena_com_dev_get_features_ctx *get_feat_ctx,
+			   bool *wd_state)
 {
 	uint32_t aenq_groups;
 	int rc;
@@ -1381,6 +1385,8 @@ static int ena_device_init(struct ena_com_dev *ena_dev,
 		goto err_admin_init;
 	}
 
+	*wd_state = !!(aenq_groups & BIT(ENA_ADMIN_KEEP_ALIVE));
+
 	return 0;
 
 err_admin_init:
@@ -1404,6 +1410,9 @@ static void ena_interrupt_handler_rte(void *cb_arg)
 
 static void check_for_missing_keep_alive(struct ena_adapter *adapter)
 {
+	if (!adapter->wd_state)
+		return;
+
 	if (adapter->keep_alive_timeout == ENA_HW_HINTS_NO_TIMEOUT)
 		return;
 
@@ -1452,6 +1461,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	int queue_size, rc;
 
 	static int adapters_found;
+	bool wd_state;
 
 	memset(adapter, 0, sizeof(struct ena_adapter));
 	ena_dev = &adapter->ena_dev;
@@ -1495,11 +1505,12 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 		 adapter->id_number);
 
 	/* device specific initialization routine */
-	rc = ena_device_init(ena_dev, &get_feat_ctx);
+	rc = ena_device_init(ena_dev, &get_feat_ctx, &wd_state);
 	if (rc) {
 		PMD_INIT_LOG(CRIT, "Failed to init ENA device");
 		return -1;
 	}
+	adapter->wd_state = wd_state;
 
 	ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
 	adapter->num_queues = get_feat_ctx.max_queues.max_sq_num;
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index 1f6a7062f..594e643e2 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -196,6 +196,8 @@ struct ena_adapter {
 	uint64_t keep_alive_timeout;
 
 	bool trigger_reset;
+
+	bool wd_state;
 };
 
 #endif /* _ENA_ETHDEV_H_ */
-- 
2.14.1

  parent reply	other threads:[~2018-06-07  9:43 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07  9:42 [PATCH v3 01/27] net/ena: change version number to 1.1.0 Michal Krawczyk
2018-06-07  9:42 ` [PATCH v3 02/27] net/ena: update ena_com to the newer version Michal Krawczyk
2018-06-08 19:43   ` Ferruh Yigit
2018-06-11  9:54     ` [PATCH v4 2/2] " Michal Krawczyk
2018-06-11 10:42       ` Ferruh Yigit
2018-06-11 11:01         ` [PATCH v5 02/27] " Michal Krawczyk
2018-06-07  9:42 ` [PATCH v3 03/27] net/ena: remove support of legacy LLQ Michal Krawczyk
2018-06-07  9:42 ` [PATCH v3 04/27] net/ena: add interrupt handler for admin queue Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 05/27] net/ena: add stop and uninit routines Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 06/27] net/ena: add LSC intr support and AENQ handling Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 07/27] net/ena: handle ENA notification Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 08/27] net/ena: restart only initialized queues instead of all Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 09/27] net/ena: add reset routine Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 10/27] net/ena: add lrte_timer dependency for linking Michal Krawczyk
2018-06-08 19:17   ` Ferruh Yigit
2018-06-11  6:24     ` Michał Krawczyk
2018-06-17 22:37   ` Thomas Monjalon
2018-06-18  6:04     ` Michał Krawczyk
2018-06-18  8:30       ` Thomas Monjalon
2018-06-18  8:32         ` Michał Krawczyk
2018-06-07  9:43 ` [PATCH v3 11/27] net/ena: add watchdog and keep alive AENQ handler Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 12/27] net/ena: add checking for admin queue state Michal Krawczyk
2018-06-07  9:43 ` Michal Krawczyk [this message]
2018-06-07  9:43 ` [PATCH v3 14/27] net/ena: add RX out of order completion Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 15/27] net/ena: linearize Tx mbuf Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 16/27] net/ena: add info about max number of Tx/Rx descriptors Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 17/27] net/ena: unimplemented handler error Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 18/27] net/ena: rework configuration of IO queue numbers Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 19/27] net/ena: validate Tx req id Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 20/27] net/ena: add (un)likely statements Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 21/27] net/ena: adjust error checking and cleaning Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 22/27] net/ena: update numa node Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 23/27] net/ena: check pointer before memset Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 24/27] net/ena: change memory type Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 25/27] net/ena: fix GENMASK_ULL macro Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 26/27] net/ena: store handle after memory allocation Michal Krawczyk
2018-06-07  9:43 ` [PATCH v3 27/27] net/ena: set link speed as none Michal Krawczyk
2018-06-08 19:37   ` Ferruh Yigit
2018-06-10  1:35     ` Chas Williams
2018-06-11  8:01       ` Michał Krawczyk
2018-06-11 16:15         ` Chas Williams
2018-06-19  6:32           ` Michał Krawczyk
2018-06-08 19:45 ` [PATCH v3 01/27] net/ena: change version number to 1.1.0 Ferruh Yigit
2018-06-11  8:45   ` Michał Krawczyk
2018-06-11  9:26     ` Ferruh Yigit
2018-06-11  9:33       ` Michał Krawczyk
2018-06-11  9:50         ` Ferruh Yigit
2018-06-11  9:52           ` Michał Krawczyk
2018-06-11 12:34 ` 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=20180607094322.14312-13-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 \
    --cc=rk@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.