From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f175.google.com (mail-qt0-f175.google.com [209.85.216.175]) by dpdk.org (Postfix) with ESMTP id 141C92B8D for ; Tue, 17 Jan 2017 15:27:40 +0100 (CET) Received: by mail-qt0-f175.google.com with SMTP id k15so159999921qtg.3 for ; Tue, 17 Jan 2017 06:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9y3ALwffhdSwZ/UGPKQ9kWk6c58gKvm1MbmA/uUutIQ=; b=KY7D+Cc5I0j2VRtZeIjT5J0YMqSPcyANKTWHlMf+hE9XPhwxRY6kzIxdghXtnZteqc rBBRP8WTamDsAtI1KG8pA62tqx4OXsRVQz5Zf9b5S3fMU0L0zFuV9jMjydXF8BMXfQrx 4Hcxu6HSFFcykfRCXc7TFiUrWNLlPFYcPNQ8nPxZtheITw4ojwbHVm4prefz71uqbYD4 Soj9cjPoiYCUjetxME2uPNbqpfdpc6W1CqDxuRM/vMccesePBMy1+ngEiQEgxK9qOyWk 1KuUTahKyVGOUNLncNqz0dOm4WlYDeeC1qm87g4tPTvp6xHGW63LsVhRNR+K9osAuoWu xIXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9y3ALwffhdSwZ/UGPKQ9kWk6c58gKvm1MbmA/uUutIQ=; b=Qr+W4AtU90ckvZOHlJveaQsapGpB742jn6TmOO8TN2g3ZNng4M0ppYejiSDTqk8g/M dywt1dtXwPQuAfiCQxfBtkdNUVLHXxJYzehvp7OrWWDLYKsvCv34o7rJjS0UTHA/jlZy X6OjHxM71oOfd71p2BGI/LAADOf4CcMFyvFvOIhkYNhe5DucOFhxIHwYHYqaC2RxY5L9 vK6pSHs2TiT5jfN5u3SQiGHWcI2MPpnhHhR/LkzzMGfwD6FcvwavEpshVqqTwa7r5nx8 EzohycJSsbQYRu+8d7LRqHyUVD2FDfFuY+lCfKeg6AxzkCEdiN/nP2KreL6EQmnyFoPE ZVYA== X-Gm-Message-State: AIkVDXLXHS3tkdelRi5k4g9v0qApn43nEl3DmODzNCVx+EbO9aEiG7ikgGCUTS4PrynhvWopjWyXHkUQbzQvCQ== X-Received: by 10.237.62.219 with SMTP id o27mr37528444qtf.104.1484663259523; Tue, 17 Jan 2017 06:27:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.154.69 with HTTP; Tue, 17 Jan 2017 06:27:39 -0800 (PST) In-Reply-To: <20170117141312.GA7844@localhost.localdomain> References: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-21-git-send-email-jerin.jacob@caviumnetworks.com> <20170117141312.GA7844@localhost.localdomain> From: =?UTF-8?Q?Jan_M=C4=99dala?= Date: Tue, 17 Jan 2017 15:27:39 +0100 Message-ID: To: Jerin Jacob Cc: Santosh Shukla , dev@dpdk.org, "Ananyev, Konstantin" , Thomas Monjalon , Bruce Richardson , jianbo.liu@linaro.org, viktorin@rehivetech.com, Jakub Palider Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v4 20/29] net/ena: use eal I/O device memory read/write API 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: Tue, 17 Jan 2017 14:27:40 -0000 Jerin, Thanks for the very quick replay. Actually I would like to keep *ena_com* untouched, as this layer suppose to be common between platforms. That's why it is better to leave definition in *ena_plat_dpdk.h*. Here is the patch that I would like to propose: diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 87c3bf13..7eaebf40 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -224,18 +225,8 @@ typedef uint64_t dma_addr_t; #define ENA_MEM_ALLOC(dmadev, size) rte_zmalloc(NULL, size, 1) #define ENA_MEM_FREE(dmadev, ptr) ({ENA_TOUCH(dmadev); rte_free(ptr); }) -static inline void writel(u32 value, volatile void *addr) -{ - *(volatile u32 *)addr = value; -} - -static inline u32 readl(const volatile void *addr) -{ - return *(const volatile u32 *)addr; -} - -#define ENA_REG_WRITE32(value, reg) writel((value), (reg)) -#define ENA_REG_READ32(reg) readl((reg)) +#define ENA_REG_WRITE32(value, reg) rte_write32_relaxed((value), (reg)) +#define ENA_REG_READ32(reg) rte_read32_relaxed((reg)) #define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr) #define ATOMIC32_DEC(i32_ptr) rte_atomic32_dec(i32_ptr) Cheers, Jan