From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id 610C92C2E for ; Thu, 30 Jun 2016 17:05:13 +0200 (CEST) Received: by mail-lf0-f46.google.com with SMTP id h129so57614416lfh.1 for ; Thu, 30 Jun 2016 08:05:13 -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=kABRov2a/ad9F7tKaLI6IsFc46uGPBVwpLqWcfdmiAA=; b=q2cn50HGKGU5YiLdPakkqI1m28UnGpnpMllmOzn6N9b2RsrMicAkTYnI0hO44BNGVB XCfrSDih6kq6l1ecrXFOqGTPljtpmxf4GQuLxLLvU/1+shTLu85Ep2o2ZJif321u5kjd VOkN5v+HJzgZXvno5AU69ZBHi8stugTztdY6l5qpi3IQskKxAX7Yc2u69N70VqiD7Z6g 7kE1Q59H5kD45dQlUAz4nE1WXyKay3aZYrASQcQNOd/ktlZ3YmMjq/MEtxARxt9aXApx V2JWWSJS0i+RhLVPJg626pSwbBNLqAokjsy3X057nUoQK4526QNaTHLUQP/yLtZPbRNM 5/xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kABRov2a/ad9F7tKaLI6IsFc46uGPBVwpLqWcfdmiAA=; b=VSM29j8sY3ZQemRAja3FZmv2K/A2aPOXIgFKIW8BeYPoNJBoq6X5XmhZwugmmugWIR 4LF0JNliLoWZ4CA0kNvgLV8KM2oj6PeEDn/wBI/Rfzjwozn8xGxWnrRUMzmFRLcT98Rt D8G/C6GWB8M5gxR2MeOKhFKxlTxe1gzXlgaKHZX4ACiBMydsZS7j0KjANI/45nO2fB0z 9SV8M7ExaSyR8PtQhYUnOuubwAZM+jSPtmoFRt9H0v9nMh4BkyRbMNXO9BzkiS8uQMmN 8hyaS+tkHyqAZPSAN1VL1Pg7JFMwephStvfV8k+xuwBxiyEnhXLvnFY00hIxBgZKxMRo NwaA== X-Gm-Message-State: ALyK8tJE7dDU3KphoxlZlj7KM4ojeunZNAZex/E10FTqKyvwpMACCltqOvEkZ4hkm1ehFQ== X-Received: by 10.25.41.83 with SMTP id p80mr5410057lfp.32.1467299112779; Thu, 30 Jun 2016 08:05:12 -0700 (PDT) Received: from anpa-dpdk-2.lab.semihalf.com (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id 206sm1635339ljj.0.2016.06.30.08.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 08:05:12 -0700 (PDT) From: Jan Medala To: dev@dpdk.org Cc: ferruh.yigit@intel.com, bruce.richardson@intel.com, Jan Medala , Alexander Matushevsky , Jakub Palider Date: Thu, 30 Jun 2016 17:04:56 +0200 Message-Id: <1467299099-32498-4-git-send-email-jan@semihalf.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1467299099-32498-1-git-send-email-jan@semihalf.com> References: <1466510763-19569-6-git-send-email-jan@semihalf.com> <1467299099-32498-1-git-send-email-jan@semihalf.com> Subject: [dpdk-dev] [PATCH v3 3/6] ena: disable readless communication regarding to HW revision X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2016 15:05:13 -0000 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 Signed-off-by: Jakub Palider Signed-off-by: Jan Medala --- 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