From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0045.outbound.protection.outlook.com [104.47.42.45]) by dpdk.org (Postfix) with ESMTP id 99A9FFA40 for ; Tue, 17 Jan 2017 08:16:04 +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=V7IpGDMO71s72SA/IytFG+lYoWpAEhPkM67pGa9fpm0=; b=VIMkCzqxxvqB3iWIBSsE5b+AUo11N9xbukK6rGdOK9cV5eZ5EM7nb6FwWCkurMFET3ZlwD7Z792Y4p2wQ08FZqDOyzdadD9+RYzx2pqYe+wRIPu1x+W5itc6syxJ6SxOJnQSbYuuY+wwQw8EOyH+HWwVBRx4DoAIRnVKKC7Rwjg= 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:00 +0000 From: Jerin Jacob To: CC: , , , , , , Wenzhuo Lu , Jerin Jacob Date: Tue, 17 Jan 2017 12:43:54 +0530 Message-ID: <1484637244-7548-20-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: 01eb482e-2aae-4d5e-1452-08d43ea8b265 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:5I6b0tV8tKZ11twYlep0nYgsfP0DiswDsWMKnRuYt5vKu0lBPLWIbACWcBV5Srwh54jioN0hxkD9iuYbsxbsiTWabCfV/eUU3tvq7fe1Rycd35x14vgj/2MX5IhfadomcC2AGZHSSWPunBOHiHG6MR3KXec/oPRQIUBc5b9uY7D9NeaQHRLylAbfXGQfr7j6ykFWVW1kMWXNx6MCvUkGqE/ETtNQJbOQcnu0PKY1/6XbI3KmzAe+0thv9EZsxGyRpIWEB+AEeCjVmUfls4DvRQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 25:1LhdvYbug5ta7Gdp9e1ZShBdb0U5vPsCYBoYQnLHRN14CJi+VsxhSwGiMvKYOUF8PmbuBDqY1038JHqwhgr6w3WOnvkpvVWwixw6NTv9qbxZS6X34gxKxeC5u/YYuRMK/iCEZO6EHDDwGPZdgnQJ4U7yzTuIxRRSmWkTNOR8rM8ObFkDN7atbRgOIMvkzQWSP+F4/5VHKCY60PDa8TMUK9I4+IVqXXoxa6w2dy/KboWke7FVgFDxDqe3oEBQsBDHWLnsTOgFT00XmvFe36YaWeopgy7QljWCFBYJ2+CzkeDBfbdHOCBUcmrKFNj9aVYcPyx04AgbWIdXf6l91mA84pTHdzW9VEjsYMDmz4voWrav0qNUnklE47pa8liYyJrn3CRNw7IwfmuGwU3DKGXemkbyYbKLRgy4oafznSHsufNcyUhpxO3hK4jd3mLsZYYq8se9pDrqMTdkh0m+JVHo9Io3xspZ6fPYhteUKl94kFQY7O7YTgiHeK/ru+utGB9KvBSQAkAE7F5YPhGjac831HC1sZGz1S/nXaYmWvEDooaDzVEXqyu3Bu9dZZ4j5QNwXGGHF/pXQYi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3zmcvXxLcPQwpf2I65X8JV9xp3fjzZIk5UmKI/v0Ne/HnjStP1Mi9uVwTK/28jCyS2eDwlY= 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)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:6RtFU7df48VUt/rqJhfVIcATJKo1FiaSg9VGe5pFBQriaorYzi1BLLf4Q50QRpUr4cmB8dzfdwSWRpeivnSA+agJHcGyS+vNwT2CVA2+9cb0zy3uNMcVlXosl0Is/Vv4ASBbolKmrvzzs1DQtw9yBRvoiXE2LftziHjjkfVp42ENyDK0MmwtryCLsvO+lO0jAq+htSuHzA+q8JCjBmfzAp79O1Budsov3CtTzTRkfgTwIGAgU7KulOpBg4OvjmVvGskjtzmH1hREkFwvmEl04MxssfHPvAuc3DVWyjcTC8m6Q3D3yZxUGikhAW456o9c03JPZKUhhBt0RRVXgFvVC5vbjClAqkwH18KsEKnJ8IAF1YGo0Mci2/A2WZUTL5vprchAssXJfYyZ36RfIaImHA/qT7xY9+phip1zqoQnHzgxyBdGy+NotFnfMv9Kz0y5P5/z8LbG3Q3XN9R5SNfcu2ng+yHXDYNWIQyFhFCX0dzbGmo+nPc0Imx4Q51mETsoFRPEUaZmq0XG30PIOZ9wHQBKrM0gDmc0AO+1mtErIDzTRhSIXJb9ImY99uekvxGpTKgPJJ6dy1ZkMDt5rXt2f56BFZG+b61JTVGsgyrKWrVg8mewi2NlAEe23oSGFaAK41xP+sDmcvMrwAHW1zX8yg== X-Forefront-PRVS: 01901B3451 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(199003)(189002)(2906002)(4326007)(76506005)(107886002)(53416004)(189998001)(92566002)(106356001)(38730400001)(575784001)(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:o6sd13zZ5RuA/fPxydtxoYdMdy03VrShSHL7hEK?= =?us-ascii?Q?UqgHiKfwGbb/comCetvuj4etynqUs4YBUVt652a1pjfsudVDWnEavtShlBcN?= =?us-ascii?Q?VLNeyWYoyfSUIxUdZqgfqRHCUOgw2+NnhsFW5j0dAMxfBDhdLjIxSLPqkqvx?= =?us-ascii?Q?37WXfnBEd1XCX+P0AnRfzaiV5nFKxsYqlCer7jivQ2xt1cWnM1GZcxW4rdnu?= =?us-ascii?Q?HzNv7L6qLg7kn7Yu7ulXEygsEvvc+CC4o+6jXtvq1jS2UNSANBOeanqUzNkh?= =?us-ascii?Q?ncSX9S1xq3yqrs3cxY3hmttwQW+tcW/G/lMDQeFwy2k9/YLunmznVtrDcSLM?= =?us-ascii?Q?Ua1CkZs2OsUiTanvfIXNwzW/SdMzXBYkKvYB8YnQwkpg8ZbolDOhy1sheswn?= =?us-ascii?Q?1n+rnBPZMPEPl3liEpmexxWtSkmwR7Faz/jH1ff3Zf9LYrRH1WQN/v/8Im3/?= =?us-ascii?Q?JkryGFeQUubQeOOHv9hXidNJrGa0AoKhJdjUGt4f6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Whm80EnMSoUT20rjIIV7UlxA9EsaxBSniTnHyCD828L+bUDN87oJAp1DiDBbX8mpgd0uaLugcuc1hfZw/xIkP2NNXk9RIEl5gXF6TVQbDkw5xSZJoTVHL9D9eeE35SbMnE0DxIvKDu3sFf2/S17JiJBJp7edTn2UbLIRISToOY0mfQ/52FLw3A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 07:16:00.2433 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [dpdk-dev] [PATCH v4 19/29] net/e1000: 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:05 -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: Wenzhuo Lu Signed-off-by: Santosh Shukla Signed-off-by: Jerin Jacob --- drivers/net/e1000/base/e1000_osdep.h | 18 ++++++++++-------- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_rxtx.c | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/e1000/base/e1000_osdep.h b/drivers/net/e1000/base/e1000_osdep.h index 47a1948..b886804 100644 --- a/drivers/net/e1000/base/e1000_osdep.h +++ b/drivers/net/e1000/base/e1000_osdep.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "../e1000_logs.h" @@ -94,17 +95,18 @@ typedef int bool; #define E1000_WRITE_FLUSH(a) E1000_READ_REG(a, E1000_STATUS) -#define E1000_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define E1000_PCI_REG(reg) rte_read32(reg) -#define E1000_PCI_REG16(reg) (*((volatile uint16_t *)(reg))) +#define E1000_PCI_REG16(reg) rte_read16(reg) -#define E1000_PCI_REG_WRITE(reg, value) do { \ - E1000_PCI_REG((reg)) = (rte_cpu_to_le_32(value)); \ -} while (0) +#define E1000_PCI_REG_WRITE(reg, value) \ + rte_write32((rte_cpu_to_le_32(value)), reg) -#define E1000_PCI_REG_WRITE16(reg, value) do { \ - E1000_PCI_REG16((reg)) = (rte_cpu_to_le_16(value)); \ -} while (0) +#define E1000_PCI_REG_WRITE_RELAXED(reg, value) \ + rte_write32_relaxed((rte_cpu_to_le_32(value)), reg) + +#define E1000_PCI_REG_WRITE16(reg, value) \ + rte_write16((rte_cpu_to_le_16(value)), reg) #define E1000_PCI_REG_ADDR(hw, reg) \ ((volatile uint32_t *)((char *)(hw)->hw_addr + (reg))) diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index 7e271ad..d099d6a 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -619,7 +619,7 @@ eth_em_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); - E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); + E1000_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, tx_id); txq->tx_tail = tx_id; return nb_tx; diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 5d0d3cd..45f3f24 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -609,7 +609,7 @@ eth_igb_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, /* * Set the Transmit Descriptor Tail (TDT). */ - E1000_PCI_REG_WRITE(txq->tdt_reg_addr, tx_id); + E1000_PCI_REG_WRITE_RELAXED(txq->tdt_reg_addr, tx_id); PMD_TX_LOG(DEBUG, "port_id=%u queue_id=%u tx_tail=%u nb_tx=%u", (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); -- 2.5.5