From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0042.outbound.protection.outlook.com [104.47.42.42]) by dpdk.org (Postfix) with ESMTP id D40FAF967 for ; Tue, 17 Jan 2017 08:16:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sEN9cC0QpQamZU1HAvl2g7ZX56XwH/o5WP1E8fgr01M=; b=K+v0Mg0oDL9BpDaTUZ7MfYTSyQ2QCHaBTzbdXFhfixSA6VqgywDcR53pUJjDfBWibCb2trWN+3xxuqJRvoBcJMjSsVIT+SzrfXcS/YGz6+MLQffeTGjtjiSrTQvlQ3h/hEShdVkm8dxGb2F9ZkHq4TGDKTLbibys73tyu3hLh9A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Tue, 17 Jan 2017 07:16:04 +0000 From: Jerin Jacob To: CC: , , , , , , Jan Medala , Jakub Palider , Jerin Jacob Date: Tue, 17 Jan 2017 12:43:55 +0530 Message-ID: <1484637244-7548-21-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1484212646-10338-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0030.INDPRD01.PROD.OUTLOOK.COM (10.164.137.37) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-MS-Office365-Filtering-Correlation-Id: cec8d5cc-bb40-40de-6fe2-08d43ea8b4cb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:Uy+jork23LhmEJoiKPPyXOCRHE5raObMJ+uCz8ScvtdNv5bL99P+UAfVyrg8u+zUcNIKIzBtMkKlqyW9wqPr6MZ4HNcQNuK4hAYLe0SdGMbym+sygSgxzq96CwNVukLKpm3E1XIQfzU+7g/mf/L+QbMnDYEwyRDV7KyPEinA/JdWjNNp9h56oum4ayYUK+7dG5MbN3cZ7o241+z9RuadhtEMprX6eT3YxyVH0dS8faZnF3jNPa6muYLtogR7/hgZukJI2okohi8IQuvLKZv8bQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 25:WFPcrOQJt0vZ8MBcAihSCUkzta3gf+cKnh8HFInCfRh7ki/CxlPW7zkesgAxDToxW76T5J13bwtX10h9DWlkCJDoonScAlajH8q5xIcGevo9qv2E8zEqrNPsLFKMNE020hFY0nuyCPwW5/MLQo/JYn2C7e0PIiuEzIen7gNg1fjGyTmhH7Ys4rXus98oMzzZq5Rfja7L/FzfrIGYkQAKu/BW6iQNJBULakJMjNfX+Ka0GpeuzRNXylHJnWX+8/bAz3rzeiQlLVW52ipdGFcvuXaPm/0kBxlZT6qrW/Q84iPKIdEcdQ/J1ObI6xuhajlES2a0CBDf4A2jaJSiOD7AO6ahI4DmdLmv7pxSfL6dV+H3cr1cKeX8c4NMuuAynQ7MtiwLzWg6tvuOVx9Ze2UXRyaSCTvQMrAXUMzm+mnisTq6fKbpzUDe4pCVYxuLfCCRJ4keg1RGJ8Xz+Oakay9+BX7lAa1xmz2tlLG9sdafFGAx/2LTGAaAcWF2zFGPmsTMyrgFmkdgOT/4kHObFES8qL5f2CQz2XLbU6YVE1GbaAgCBar/+x7QjeJR3G+3vvpXL1T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+8SxLIYA2humyWWQovDFlDIZRhmeLKHLI6wlm9Mw7AdlvXCuEqht7qqPyPt2bKt3BxT33bOgFVtwgO6PDP2JA209pf94pHZ4UEF33PSictZ1j1t28c7V+e4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:S5b4mNpqtV8rRJIEJ3TnyKMDKwzYGbsjR69EFg3QvA4Jt1OzsJ2RNRjMt8lVLlAm1mbGdjOIRnXd51/mp1RA4zcJrQGp0NOv8q6uEtn856xZGfFcoepHSTph3DmbDfNDC0lpGXjYbIjwUk0qPxc+GT+cMTb6P8qdVOW1Lyw6FhV1U2k4VLtjz4cG8KoHpvnsM6af6b6h6DWWku/NOibAW/gTdhG4BISreOmHrXafcW6Gkhswek+DP1OttEdp/eChKrBv/tFCc2vFFFKcxEyQOu1HzaNyqqYgv9ESWDuXNrmQsTKqsCtKysvx5zeDA177c0pFtbx4fqw1fHNSoJQbeM0jOVbioIT2v+5xyBJ3jTtnLc0DXulcZ2Ek6d+4OxdPmATrKMKCc+p5WC54qL4mTuyxCVkKSyoniFKZbr38Xb6oziC+lYN6fagsujOnM0YeBen7w48yfOoqdojMEwtJu5UqoktUGECoZwcbT3umebOKrJcH3fBcOtOGyfnFXQcBTaEfadWFAzgw4qsaWl/6XFJezwOvXoOEgzlLvFkxHk5nNPanEGKvVD3MY7CVyUQAhFM+fSg8UBUzJMldXtfCTq4uN/TrwRwbIVZ9BFcgY/A= X-Forefront-PRVS: 01901B3451 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(51234002)(199003)(189002)(2906002)(4326007)(76506005)(107886002)(53416004)(189998001)(92566002)(106356001)(38730400001)(47776003)(25786008)(6486002)(54906002)(66066001)(6506006)(305945005)(7736002)(6512007)(5009440100003)(81156014)(3846002)(50226002)(5003940100001)(68736007)(4001430100002)(6116002)(76176999)(50986999)(2351001)(97736004)(81166006)(5660300001)(8676002)(105586002)(69596002)(42186005)(48376002)(6666003)(36756003)(33646002)(101416001)(2950100002)(6916009)(110136003)(50466002)(42882006)(30001)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1724; 23:OehUu6eGV/io+5xksFidHrXMJ39V15j1y6nm/U/?= =?us-ascii?Q?B94QnuSxMCkn4eLg8H0f8Gi4mi2DkCzjt7dGIIN+kLiCj56szeNzJyMHeoDK?= =?us-ascii?Q?cAwSvMv1xuJm6/LXk67VqwOsC9HedCKXfTCcZcHCY9y+a07r7Qrdoa2/oxCr?= =?us-ascii?Q?w1KthRXQbL9OfKSvpmy+zAOPpBMjDhFR9nwYPOrhe3IkY4oTAYJSaCoe9Dp1?= =?us-ascii?Q?CPI77QU9jx00G9TJVHrYkI3Smsag580WAtA0VlTIiD9QXSk3uajBjsacBsAB?= =?us-ascii?Q?LB68KB/KHjF0XhBcmocBlwxmy7+dUf83xfK/NZC4SJzlQNMQeplk1KOb1c8V?= =?us-ascii?Q?BtU3aMfkEWAvfiU7o/UZJFdQw2K0MAatjnPSCYcCeWTkH5y0iCjC4vgeFs4N?= =?us-ascii?Q?hipeZtR8G+2lMKlSOlWQY8F6/y63UwW64u8M2I+pJ5bBS1M0EbMKRtMAb+iC?= =?us-ascii?Q?fz7DfA71JsvOW7+MT6Jg0Rryf9MkQde+FP47YIvMZM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b/HQTk1FRd1senD9rhbqsqALctnZBlKY6G8MXufCUwq6qZKb1fDife++mUr7XwRYfLES5vEGqGN9L+9E4//9d9AQhjol/p9Iy/v9TczYk8nAq0AY7lo73XvN8bqc9cR7hIPN1fSr0dr59+PMEq3VBu5WrMZoSFYL2B47hue792MmHw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 07:16:04.0604 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [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 07:16:09 -0000 From: Santosh Shukla Replace the raw I/O device memory read/write access with eal abstraction for I/O device memory read/write access to fix portability issues across different architectures. CC: Jan Medala CC: Jakub Palider Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob Acked-by: Jan Medala --- drivers/net/ena/base/ena_eth_com.h | 2 +- drivers/net/ena/base/ena_plat_dpdk.h | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ena/base/ena_eth_com.h b/drivers/net/ena/base/ena_eth_com.h index 71a880c..ee62685 100644 --- a/drivers/net/ena/base/ena_eth_com.h +++ b/drivers/net/ena/base/ena_eth_com.h @@ -118,7 +118,7 @@ static inline int ena_com_write_sq_doorbell(struct ena_com_io_sq *io_sq) ena_trc_dbg("write submission queue doorbell for queue: %d tail: %d\n", io_sq->qid, tail); - ENA_REG_WRITE32(tail, io_sq->db_addr); + ENA_REG_WRITE32_RELAXED(tail, io_sq->db_addr); return 0; } diff --git a/drivers/net/ena/base/ena_plat_dpdk.h b/drivers/net/ena/base/ena_plat_dpdk.h index 87c3bf1..09d540a 100644 --- a/drivers/net/ena/base/ena_plat_dpdk.h +++ b/drivers/net/ena/base/ena_plat_dpdk.h @@ -48,6 +48,7 @@ #include #include #include +#include #include @@ -226,15 +227,21 @@ typedef uint64_t dma_addr_t; static inline void writel(u32 value, volatile void *addr) { - *(volatile u32 *)addr = value; + rte_write32(value, addr); +} + +static inline void writel_relaxed(u32 value, volatile void *addr) +{ + rte_write32_relaxed(value, addr); } static inline u32 readl(const volatile void *addr) { - return *(const volatile u32 *)addr; + return rte_read32(addr); } #define ENA_REG_WRITE32(value, reg) writel((value), (reg)) +#define ENA_REG_WRITE32_RELAXED(value, reg) writel_relaxed((value), (reg)) #define ENA_REG_READ32(reg) readl((reg)) #define ATOMIC32_INC(i32_ptr) rte_atomic32_inc(i32_ptr) -- 2.5.5