DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jan Medala <jan@semihalf.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com,
	Jan Medala <jan@semihalf.com>,
	Alexander Matushevsky <matua@amazon.com>,
	Jakub Palider <jpa@semihalf.com>
Subject: [dpdk-dev] [PATCH v3 3/6] ena: disable readless communication regarding to HW revision
Date: Thu, 30 Jun 2016 17:04:56 +0200	[thread overview]
Message-ID: <1467299099-32498-4-git-send-email-jan@semihalf.com> (raw)
In-Reply-To: <1467299099-32498-1-git-send-email-jan@semihalf.com>

Depending on HW revision readless communcation between host and device
may be unavailable.
In that case prevent PMD of seting up readless communication mechanism.

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jakub Palider <jpa@semihalf.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 12 +++++++++++-
 drivers/net/ena/ena_ethdev.h |  2 ++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 62232a4..25637a6 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -338,7 +338,8 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev)
 	host_info->driver_version =
 		(DRV_MODULE_VER_MAJOR) |
 		(DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
-		(DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
+		(DRV_MODULE_VER_SUBMINOR <<
+			ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
 
 	rc = ena_com_set_host_attributes(ena_dev);
 	if (rc) {
@@ -1145,6 +1146,7 @@ static int ena_device_init(struct ena_com_dev *ena_dev,
 			   struct ena_com_dev_get_features_ctx *get_feat_ctx)
 {
 	int rc;
+	bool readless_supported;
 
 	/* Initialize mmio registers */
 	rc = ena_com_mmio_reg_read_request_init(ena_dev);
@@ -1153,6 +1155,14 @@ static int ena_device_init(struct ena_com_dev *ena_dev,
 		return rc;
 	}
 
+	/* The PCIe configuration space revision id indicate if mmio reg
+	 * read is disabled.
+	 */
+	readless_supported =
+		!(((struct rte_pci_device *)ena_dev->dmadev)->id.class_id
+			       & ENA_MMIO_DISABLE_REG_READ);
+	ena_com_set_mmio_read_mode(ena_dev, readless_supported);
+
 	/* reset device */
 	rc = ena_com_dev_reset(ena_dev);
 	if (rc) {
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index ab9667f..61390a9 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -54,6 +54,8 @@
 
 #define ENA_PKT_MAX_BUFS     17
 
+#define ENA_MMIO_DISABLE_REG_READ	BIT(0)
+
 #define	ENA_CIRC_COUNT(head, tail, size)				\
 	(((uint16_t)((uint16_t)(head) - (uint16_t)(tail))) & ((size) - 1))
 
-- 
2.8.2

  parent reply	other threads:[~2016-06-30 15:05 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 17:54 [dpdk-dev] [PATCH] ena: Update PMD to cooperate with latest ENA firmware Jan Medala
2016-06-20 16:16 ` Ferruh Yigit
2016-06-21 12:05 ` [dpdk-dev] [PATCH v2 0/6] ena: update " Jan Medala
2016-06-21 12:05   ` [dpdk-dev] [PATCH v2 1/6] ena: update of ENA communication layer Jan Medala
2016-06-21 12:05   ` [dpdk-dev] [PATCH v2 2/6] ena: add debug area and host information Jan Medala
2016-06-21 12:06   ` [dpdk-dev] [PATCH v2 3/6] ena: disable readless communication regarding to HW revision Jan Medala
2016-06-21 12:06   ` [dpdk-dev] [PATCH v2 4/6] ena: allocate coherent memory in node-aware way Jan Medala
2016-06-21 12:06   ` [dpdk-dev] [PATCH v2 5/6] ena: fix memory management issue Jan Medala
2016-06-30 15:04     ` [dpdk-dev] [PATCH v3 0/6] ena: update PMD to cooperate with latest ENA firmware Jan Medala
2016-06-30 15:04       ` [dpdk-dev] [PATCH v3 1/6] ena: update of ENA communication layer Jan Medala
2016-06-30 15:04       ` [dpdk-dev] [PATCH v3 2/6] ena: add debug area and host information Jan Medala
2016-06-30 15:04       ` Jan Medala [this message]
2016-07-04 15:43         ` [dpdk-dev] [PATCH v3 3/6] ena: disable readless communication regarding to HW revision Bruce Richardson
2016-07-05 10:02           ` Jan Mędala
2016-07-05 15:47             ` Bruce Richardson
2016-06-30 15:04       ` [dpdk-dev] [PATCH v3 4/6] ena: allocate coherent memory in node-aware way Jan Medala
2016-06-30 15:04       ` [dpdk-dev] [PATCH v3 5/6] ena: fix memory management issue Jan Medala
2016-07-04 16:27         ` Bruce Richardson
2016-07-05 16:13           ` Bruce Richardson
2016-07-05 17:03             ` Jan Mędala
2016-07-05 17:03             ` Jan Mędala
2016-06-30 15:04       ` [dpdk-dev] [PATCH v3 6/6] ena: fix for icc compiler Jan Medala
2016-07-05  8:52         ` Ferruh Yigit
2016-07-05 16:19           ` Bruce Richardson
2016-07-05 17:03             ` Jan Mędala
2016-07-05 17:04               ` Jan Mędala
2016-07-05 17:10                 ` Jan Mędala
2016-07-06  8:14                   ` Bruce Richardson
2016-07-06  8:50                     ` Jan Mędala
2016-07-08 13:23           ` Bruce Richardson
2016-07-08 14:07             ` Ferruh Yigit
2016-07-08 13:24       ` [dpdk-dev] [PATCH v3 0/6] ena: update PMD to cooperate with latest ENA firmware Bruce Richardson
2016-06-21 12:06   ` [dpdk-dev] [PATCH v2 6/6] ena: fix for icc compiler Jan Medala
2016-06-24 11:52   ` [dpdk-dev] [PATCH v2 0/6] ena: update PMD to cooperate with latest ENA firmware Bruce Richardson
2016-06-29 11:01     ` Bruce Richardson
2016-06-29 11:31       ` Jan Mędala
2016-06-29 12:28         ` Bruce Richardson

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=1467299099-32498-4-git-send-email-jan@semihalf.com \
    --to=jan@semihalf.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jpa@semihalf.com \
    --cc=matua@amazon.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).