From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0073.outbound.protection.outlook.com [104.47.41.73]) by dpdk.org (Postfix) with ESMTP id 7F4C25689 for ; Wed, 14 Dec 2016 02:59:09 +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=VKzvUwQr01SQZ5NXsh18ZsqYtbjdlhvbOdenLZMGdI0=; b=ZKhG5U7LnseFFYdFSzbrqykyJgHJ3buURkHztkBupVWaH3XumEIZtQJ/o1s3eFw8eOtbfSwEcheSM9O6UUBynS+pW08K3s1/vwlMnSI5I4YHF26+7QxmB4LTdOeS+hHJQQBobI8w5WvLmiZ2asbMON2gCeFmao35IPahMeja6as= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (122.166.91.229) by BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8; Wed, 14 Dec 2016 01:59:05 +0000 From: Jerin Jacob To: CC: , , , , , Santosh Shukla , Jerin Jacob , Helin Zhang Date: Wed, 14 Dec 2016 07:25:53 +0530 Message-ID: <1481680558-4003-24-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1481680558-4003-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [122.166.91.229] X-ClientProxiedBy: MAXPR01CA0006.INDPRD01.PROD.OUTLOOK.COM (10.164.147.13) To BN3PR0701MB1719.namprd07.prod.outlook.com (10.163.39.18) X-MS-Office365-Filtering-Correlation-Id: 436f6a2b-1421-4735-ff0a-08d423c4ca7b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 3:FlYl4fkW2n3yCWhHt2pEYDxmCTw2qTrJPpQWnfi4KpCRebePz9CNTCdqn4ayGDn1KZawuDB3d56FKjFBftDThAI40BnZCh1+7Wpww4jN1+S3dB6j/K8MmP3lGON5Raf9LOEcKSypTbNjdpx8IkVScPPF24tWlZYH4vAZq4t8fC7qGBKPR/8GfvncFrdw9TqcZstpfCvYUoaWOlYNX59GLEm4jx30GR/4HQf09j1wnJLqyt8qJ5cMHr6Q29Hk0yXtz1D8kzVor2YcRlGSn6BQJg==; 25:/HzYINrbv8XVgNcitvg1wbwg2ZdGEq1DtC51SUWz0Ajop7BlSWitWfhJRmRhhI7NzsiocgdL53QHLvw4L8yCfQeMmER8O5jOa+ulqHIacpV8MVX06vz504DPCXeIL9RDuXvLUiL04O/oua5qP9qHpHBV9r82u0LkfvrQQCj1GzVafq/WTVWeKNqWJ/gtni2BFm6Ku033Z7Iop6X0UgjuXX4gv7R53fbZ6Kh9cHO/2Qs/wBlmTGmo0exNZELAQ+4p0d9reQu7itNtz2HiZhQ24bOEw8TBqX6Z9kZBhpxGLCUrktX1o1IT3d0SY2cCEZLi1isds/5dTH9GXvXs0W8UU2SQW+/gaHSyMBKV+8JdzPT51Vmm/WIZFIBQEm8HQoxvHOrtT47rdApc3LXZBhySxEG/W5xAHoW3rbPh3kVbTyWMn2zZM142rAk1XqcsOFvLuPJ47gPCFhCI8d8+BIyJ+A== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 31:Ry9lOjl1/PTJPNNTtjDq+EfuLHtRdTiqouS4GybHMVnNRsTIHMhe/pfYp3jAZXQgPMTeQALyXm0fe3DiPfgQsMyw7/QC2gDUOG0aJeX+w0yGDpRrGR11zz6Jp+1CKUl0/pGnMurNCJ54RO0v5S2i/vlJ4NQwWEFUmGvQ1197p45lEy0m1PqUK28p57B6+bVShRQLhIUBmPmERc4H6/hbmpOIEnV9KqAERa/MM1b2hIBk20LVwYGhY0cTtAShq9/KcAR383S9Kyu3ZdZtPkXA6w==; 20:vf34i7n8NiCGlNHZ4bci85YK7hvrM9UCR2JeZNU1H5NQHJW6uqjDLFsh/bQSD5vI6sXthOCDQLNRpxrjrMlbMg0KIF59ncqYJ7GY7QCNPuFpZ29p3z4LLyfJApV7gWjawib6SxUd0bUuLgEaV0aSofxEXKOzne3Ril9pBjtEsSKo/JtEIlULzYvWRZ8SrD5RoxdKr0HutfOoxolRwhu4rMv0V+pnl3CUmStG0FbLGVt9ZRZwbiUzcxeHZL+2/mR8WsXNSETgjaQKThjYCs+I21pC0UlqeyyWWTY0sMnq8EimVVkn2qU/Xt/sj37HMxRRQtsmi6iQYCGgG9bOkZSXvFpKRbL+w5wIc+Ixa22iETcUR5SJuLWSMuE5Z53HdWy0Cv3XNQ5nTqntsmOr85fOWkJG2IBvPk+YFqhxw3qyKN5BQVFVLiuEhrE3Eg7PviA1FgsN7JXzAa2Gmzn/Qo9zCru+UQKj15Rosj/kSNfNAVLFRMnzYxg3l3bxzMdVoc7FHFZJ0rWUeCaGlWtzlAdZ2GPNfFkhHgl1d2fUAIx7KmjMx40utn8j5JIFvBIhaxWCfVyIQvEncpglHHgZpS/wiMXL1BkVDUIrjY5vtMV53lU= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BN3PR0701MB1719; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1719; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 4:tOEc5rAIxmyPYrCQ9+ukYpDQuSzY4vrB98rmnsPZSHWx1pAMq3wm0vc148tnwoqXfKjFs/Ok9Ls+J6Lpp9fDWYox+Fu4KrQ8XIFyEg1xbG0NDvgZ9v4/eDu3gYTgZ3jfUY6JS/FyYx9/cO708Zhrx3Rd96BfndOE0FfeUS2Th+auAYx0ynVtTreTlGWmtiKENoj6IIDfvJDzKbifs1h5U+uLcqqH75YaHGFo0CTB0fWJc1GsY+k++d9Unc+kVgYj3w2UEfkC4BJTiRHCmTUAsztfIizieG74VYEleRyezev/VxCgAEdqScox8mQI+/6ZrTEKBobhvr4IG6qih8Ypxp9E5riJMEOrdc5/7TT8WA6LAoTbjLN7nOadz/vgiuNl5JCyue2jd/W1oJ9aWOilEzrJA8dG2Js3fwyjEW2IS9rIX7V2K2I95+wMbpCjS7v4LhlUgyu6MhxhZmwWROhYLYw5W3HrMdkOwjcdF3hqBsjfJxBRzKnVn4VoFn6mUMN0uavQGfh3ej+yT4zCczZ6g8ctFNsb8/dOXlV0J8w4/e0dvCfzg6h5uNIoi/jhUxDjs5UFKg448qMfx7bYuUPpC2cWK8PtbN83y8ivqncieynnJZayhxFJgWrpWqoStrVVVAth3SIvu5cwzU3Iyteetw== X-Forefront-PRVS: 01565FED4C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39450400003)(39840400002)(39410400002)(189002)(199003)(6116002)(6512006)(6506006)(6486002)(3846002)(66066001)(68736007)(575784001)(47776003)(92566002)(5003940100001)(50986999)(76176999)(81156014)(50226002)(2906002)(110136003)(33646002)(6916009)(101416001)(42882006)(2950100002)(6666003)(4326007)(81166006)(38730400001)(105586002)(8676002)(106356001)(5660300001)(305945005)(48376002)(97736004)(50466002)(36756003)(2351001)(42186005)(7736002)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1719; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender h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XBS3PvQeLwQf93XEgCtsZuU7CWeZhc1sXnYR2BtM73P/xlkCTDnOudP8LVNbgU2zwLvxlIkJpf0/CS7ZjL+VFV60tAGwg5r6Y4XVI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1719; 7:JA9AuEaI/kvjsH5td5UH2+pkoSqrduG9KkblwHF8yEGwBjpSHXrN3QYEEZ6xfFyv1a4wRur/sOfi2CqlWkiTzquMQQMl+ZJ2aKNbpFLq4JNAuZwxIjMSrTHSo5v8YyErs4II8E+DEfS8PYNGeOEqqHWM1YEdL7loHnlkbDRkj+TBrTtCLN6cmQFu92+bw6unTqKmPHJLTZp1pInCtq0y6aMxnhqQJ+f0stmyCxWGuEgQozbxbPhljPYs7iWatCKyn6TlB3YRFcJCaFz6F9II0w/VLfRLoN6hKvTuJLAgqWS1M6O6RDX6NWTFDdsSMbmnjWGM11elSWSoQfJ8kX6r8tEEDVIOwAHvZdsLriR0SoNQvyrf5npzDNA0BxOWSbfXq4RXiXcTXl2GqfpsDsgKGJHY7JuCO6Xpt9t+kXqa16VDWJF+7T7+2mrPSlB48SYOFOqE99aXVV3LPEpkLbQ11Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2016 01:59:05.2663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1719 Subject: [dpdk-dev] [PATCH 23/28] net/ixgbe: 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: Wed, 14 Dec 2016 01:59:10 -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. Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob CC: Helin Zhang CC: Konstantin Ananyev --- drivers/net/ixgbe/base/ixgbe_osdep.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h index 77f0af5..9d16c21 100644 --- a/drivers/net/ixgbe/base/ixgbe_osdep.h +++ b/drivers/net/ixgbe/base/ixgbe_osdep.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "../ixgbe_logs.h" #include "../ixgbe_bypass_defines.h" @@ -121,16 +122,20 @@ typedef int bool; #define prefetch(x) rte_prefetch0(x) -#define IXGBE_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define IXGBE_PCI_REG(reg) ({ \ + uint32_t __val; \ + __val = rte_readl(reg); \ + __val; \ +}) static inline uint32_t ixgbe_read_addr(volatile void* addr) { return rte_le_to_cpu_32(IXGBE_PCI_REG(addr)); } -#define IXGBE_PCI_REG_WRITE(reg, value) do { \ - IXGBE_PCI_REG((reg)) = (rte_cpu_to_le_32(value)); \ -} while(0) +#define IXGBE_PCI_REG_WRITE(reg, value) ({ \ + rte_writel(rte_cpu_to_le_32(value), reg); \ +}) #define IXGBE_PCI_REG_ADDR(hw, reg) \ ((volatile uint32_t *)((char *)(hw)->hw_addr + (reg))) -- 2.5.5