From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f44.google.com (mail-lf0-f44.google.com [209.85.215.44]) by dpdk.org (Postfix) with ESMTP id A995FC32A for ; Tue, 21 Jun 2016 14:06:19 +0200 (CEST) Received: by mail-lf0-f44.google.com with SMTP id q132so20520102lfe.3 for ; Tue, 21 Jun 2016 05:06:19 -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=VOAgG2MgkYSWDsEG/y/LDUSlmX4Xgq/OzE0bBWkGT/s=; b=D18JTRVgrZWTesz3oYUuulR6eLwtokPCpXy1PD4HSt9vYOn82yNhVIqfW3diqdEod4 Sok4vk/rIDRXUHeQuNhkMkZJacRWA06Q2ZD61/IN8aFzcIWnQkqZc6jlaR4zW1k67ps4 0oamvpBO6MPB7uINKINcRTR6XKECY95/XGisZFNNlFXnXiiCupjxN0UsNCMO+pn40koM JBEUkVNEO3Ugu8iMUSHuCut/3rEMd17MkaafUQ29nQATX5if1m3YyxPnOjeA0jVYCoeP x7KXX56D9anOv/MKfCVzq6nP+BJoXWqX9gFT8VrotCoMJvKayOd+vygjOkMPNhPLxVyP kXiA== 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=VOAgG2MgkYSWDsEG/y/LDUSlmX4Xgq/OzE0bBWkGT/s=; b=TDxeeoIHwTmzKqEv0ZNDnn7F2yX3n3NCUCHma0g/nIZ0zjlep+UpxXECV2qDBcs8qo P+k/2o3oeUWUZiUyfPu6Tc7WAy6Mqmw5TME5Zzx2Wlzc3ZGljXvr1wnaWu3el0kWLfWh 7BW8fuqA/uQ4H46GBtF883N4R3nNniHCJm2jp06cTbtacPPCnufOkcEwJ4s5QxmOcC3X ijio1iT/eNtxoDLsrQ063fnawaTJdqQhdWsxLsti37hb4d47DziPrW3qa4VXVXG9KfxU Q2AAwyRi9bJ5Krny7JUQD3HiDCUDut9IyKdx1f2fV2Q/qYn4BOzuAVtnI2NBEoIzSI+5 uCzQ== X-Gm-Message-State: ALyK8tKB5hWVi/BNu+KWiHsmb9xcYP6R8XDBEVHYkx5h013aQj7QxMZ3KeH0l1J2r8KAHQ== X-Received: by 10.46.5.213 with SMTP id 204mr6188565ljf.64.1466510779388; Tue, 21 Jun 2016 05:06:19 -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 t10sm6613629lfd.18.2016.06.21.05.06.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Jun 2016 05:06:18 -0700 (PDT) From: Jan Medala To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jan Medala , Alexander Matushevsky , Jakub Palider Date: Tue, 21 Jun 2016 14:06:00 +0200 Message-Id: <1466510763-19569-4-git-send-email-jan@semihalf.com> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1466510763-19569-1-git-send-email-jan@semihalf.com> References: <1466099690-28085-1-git-send-email-jan@semihalf.com> <1466510763-19569-1-git-send-email-jan@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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: Tue, 21 Jun 2016 12:06:20 -0000 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 5fc37f6..9ad35b3 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -341,7 +341,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) { @@ -1148,6 +1149,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); @@ -1156,6 +1158,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 cfb3fb9..3ef669c 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