From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0066.outbound.protection.outlook.com [104.47.42.66]) by dpdk.org (Postfix) with ESMTP id EA2ACF97D for ; Tue, 17 Jan 2017 08:16:21 +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=y12OUhTUTV6VJRVvLj6XViWvoV47pJUf2YGtBrPLAXY=; b=iIAO8STJVIwjhVaI4r2Swi2a0k5GcIefcQFT+3fTBxzrqDi57xz7jlTxgXIputMnncaibWjdR5TqdcKvc/brHICK6fC7WyowOVkdNuzAvxroqGro4elx4bj8yjuHJqHu5hN25k5ZBdzMJ5UUtn8Ip6NoQfwLQ0bLMg3wheF6pA0= 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:17 +0000 From: Jerin Jacob To: CC: , , , , , , Helin Zhang , Jingjing Wu , Satha Rao , Jerin Jacob Date: Tue, 17 Jan 2017 12:43:58 +0530 Message-ID: <1484637244-7548-24-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: 44f369d7-c577-4543-5719-08d43ea8bcc5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:nA73OmaRuccEcvSD6OisZhrtrvje8CUt78JuXQ2AtnqzpnOc117NNKoyF2acVgtE1++iItOUuJQ/xj8SrNQ13cXMzhW0bZIb00cWTz/G+jA67ZvdDhhQfDUFcTdu7nTLL8cU3yyBbSdkrDWsXhV2CNSBWQiukypudOdRq2v+VO0CLv/qOEQqsTtasZaoMIk1gEYzTfjbCPSLluH22daLAS2HzmDhdDWRpQBKWheW/GDsz4yuW/Cl9WNCVPgYzhXE0mh8N1lbbNoBL1OkozjAkw==; 25:l1D5dvCriEPVwnAyBCBs9WohW17bwJ3Zh18yc2gRZ+qIWRQZ/rITYkqX+83FR7vurhujn3JYa15OgcxxUOgY0nyCrIkXAnEPnp358mO+VizOy/GMjv3pY+EIE0Ls4SKILh0XL/ROCy6sL8hYT8Y0qEGOddQekZC2JKHzOy79ORfxUF19R9Ed14T6CZxbYZ3CbLpQVMMptpeLdIHYLig4MnBfbYNM6/2m8WqGTNySsL6EKIo5JtbSvMlVpmTqZq7vTzwSyAUofaMNouuzI16hPktU6KRlyMBqU4qUQrh17r9NNsuYw7T9UH77OTfMx60xHq9YsFmCyr6yc02KyOWwMhTxLaQgmd7M5PpMgaLLHgbDVcSfUFASuj3QfQ8j567ouAJb+jaVHlkHNzy7mCq80/q4FWHG7vfYrD0xYvZoCvYBx4lcxBAS+d7/eRSkppo4Rsnt2Y0hrHkWLtVy8dRfgQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:MMQr4xA4yVYAUd6Qj3+JPrQP0K8HxYUSVcZWRHGPYcLq4XTEkDFkeDDMKgg1/K8ZaVwB86TzOIA++h8+X/xR8exjh4VZCOoqtyhh82tKbH19ifg0+HeyuZNZ7Iv+MdlVgvdwk4fYHSV809enZFa3/SiVUkfQ1NQqaea7tqBw4LLrU4q79vdwe2QY9o1zSXXva+4DN2tmQTPJ4SCy66c8wainAJVAj65yrdBuN88AUtDqDOg4AUK0b9xou5F98AF53B5JAAHhykRvV7DS4ae6NQ==; 20:FBE2f+JkA+qrPNWES8zewAjly/LB85EnT+UglRP9XikjrVZ0YTKK0DRl5dmXrjihB55OboWB5pm2h5m6CErBGsRktKj2yZNRvuhCBIpj0gpBwrH98Geq+EmvRpRVw5hfCEj68qcC6sAJAl7Upv4nxF48W/aK2O/Ia1rxAoBvKeu0+Jm797gCrmNyrrosfH36D2r9Heae61uaUOtLkhF4rwuxzAoZeE7D9TELIhoaefbAgfd9zSOcJD06LhpBtEG8A1V529ISJlhWJwoIHwQGh2JVmZtkvwRw8UL5yojqfaeTQGO6+I5yJadVCb/qE0bEZFHBUW3GNRv03JgIDz57iELl0ugiH1nqMgFC1BoPuN2O/8wvzLKcOpyUskeEb0bxl9HAailFwtvieL+VwiIh3pIObc6JZEtpTcYPUpNryNXnh9DWGKYeybP9QbkjPDelbo0p0BAXrI4qFxu1QZwfY8rHxd1UWlo7E81xt/fPIp2BUCu/r5+CxR5B8Nop1jSYgRVM3Wo61AigEkRTZI4ij32zlgJ6UI5li9XvTAT01u2/4qHwIPTAdJgAhVv60Cf/Mnez8Dte4ScmQEE45YfPu+3S5T+NsDzF85oAuEI2fhU= 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:dKiF3J/Kn1Jtu7GBy5ROTENWv92RdzJZSmropUWD6B5N54As3LnXwoUxjd++8tsem5UNiLQoLKreLgnkdmqttWs/pvcjZGX7to5k3iZFk67e1BNVtm0nDs8VjdcCzuSpfrvOnuD1b1WoC4Prmb2FM8hbNYObMK2/ObWj2L5l7yKEL3127pxMBmhyknOjYmorlskKL5lwTS3kpwVkoTbh+tNUeMu7NenaxgEhCeAsRVWojvQODeo6iclXCybsOGWsU9Iby4glwwqUoOEXwMrjcCak4biYENEM3aVRtvlvM3iDZGHnUoYWZWdJ6jYZYwwy+30+m+PlrtW+20HDoJwIzwlCxrYTKVRPz6zUfeLed7GWqDjwTeHeNTkFy/oCA7pL3nK+fWJoB3gZ0II2dbC9q9QNgsldYgBoOEoKD/PmnUwY2CGw0dBb9Zz4G4ggKX+31lg7ts93Q3wL9gh06Ec4Mk2hla9pcy36J9FRs0hJlNChK75PX7TW9bofRwWVgW3GabkdKTen/GOV22d5wdCZHEOcpuH6yMXH2JKAzMc0uYUIV/53yPI1UEzhqPO6AiZGi8KohbqsIjZAFxtoKgBd0T/7ziw/d/nhjh5oq9ZMMArahLySUWQbxfd34VwTCmzguRUn7fG0fkP3jiaATgNLqA== 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)(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:dOfN3Sb39XENQrggBJMVNk7iahQEol/i80tI0ih?= =?us-ascii?Q?GVR/+5L2y2r+wQA6NhgpmQJx6uQptlfjEVcEXDU52NPjVyiMzO1iTqAWsZ8Z?= =?us-ascii?Q?k8B7n/TvbDkUqMl4SjkmfAwjap04iV/iciCdNiwrErxInX9Idwdp2RYoSoGp?= =?us-ascii?Q?MN1ddcZ9v0mMumkDgfcs8IVe2sGu5IKFKgg5oAmW8ezg57gwxcktyPwqkw8M?= =?us-ascii?Q?wdWMs2QiJX1q1QSRPLCA/gjQlBXnEto/BU4TfDMepMfZOEH8xVMbzLIfWORu?= =?us-ascii?Q?FsNw2P7rFQFZ/NbIAYa+2yptGmYcArCf/pISBNNAsmX59SPoGva4ZDYUHLdQ?= =?us-ascii?Q?kiMnECqD9LHoehwieAr3AWAxatg+c12h9f7+PucYZMKkuOMslAYT44w1fMRD?= =?us-ascii?Q?Qy89GLdaN6qie6mJxvmrbsYlZGz2U+ty8UpMwfN1NiFsMdcbDADrJW5wd9Gl?= =?us-ascii?Q?9eFFYcYPdHSttVeraUAAa+dAePACGtZ7LjTyWhZEGh2HBiXmlA142Dv+qBCu?= =?us-ascii?Q?32EZT5Cs8DS9teyghI3pxGSFig+/QooJ5ddRoVHD2VAeCXFpKQxvCwW3kOHf?= =?us-ascii?Q?SlNGXGvdWAnjpTwc5909x4PTr9iv8i4cs3OXmyMgqgAHAUT/7XALN2uu5nj3?= =?us-ascii?Q?+Xf9UUR7uzTLhmGoaYMWOENg5my1ebKLqzbNEae79PSbikHy8aq2FoDV+Sv1?= =?us-ascii?Q?QoHuAk9uVE3NDaIe1el/ZI91xPqvoEjJ7Ctor/UV/rHpaejg2mJY9B0EowQy?= =?us-ascii?Q?5MAAlTPgskd4RhYSNzDl6783Wd8nNyexPGZDlFZnitfoV3XiDLqam7f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wroEPXLkXSwlXZcaxTVnQtBE=; 5:pmw+DMJyKWlmpaTUlvNunapHHsOTxwOo/deE04yAQ+nS4ssuSSMpx+ddLvtcJLnknbdc6SWnD1uic5tJPi+nI5hGyvVAlv85ybEXpsS/FaTcSstnhxD3rFx0OHWZhIOZNA3NNELgVsVx7Pr59x6HLw==; 24:nmqm422BMwF5UpjS3igf5gdVcgRqGFf4Bd1OiKaFvFXvaZtF2BqnLhXNk1T0msJ75XqWqwF6AET7cpSvcbhZ/AuMiX+V3SsWiOpsQ9qwi20= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:3eqWY9mscWT/Nl9jJIlVtmkxIEgK7r5Wc/fRU1EMaRjUd8z6J1sYZ/QaIuvQKUkfpqw0Q0w2dg/XGcOLBnCsrLFPLQzBCC0PvyXvJ7qurmub9QUIfEdFVj2gnAF/WEmI+mFd+DWNX9SXhZ74VEvvzpgfot/H+dvc4/K7aGGU7c0d79bsatXyDcdWcFBehx9YjszMMPgCoUO/tXL27JQFUAAY1gQvlsLGsfuVeuh6RcdoizReszEdNQYOpKMc4zg+cBd0ENyatFs5UshLHlVwzxdVWzltF+p8fXIffwJVDhYToqenC3PNFv5q7y8SN3lOmQi31F3f9p7BrX7+F9QFWNXxn2Bu+Arlmo5BAdpxlub0N8B3J7/Lls+XgbgGb6ecBcO3do1u9LeRhNivINXr0TbJAEn8tySND6JXUM02Grc44kExdt1QmR9b1zhMQujipTPwH63gspfUcflzRXtb/g== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2017 07:16:17.0629 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: [dpdk-dev] [PATCH v4 23/29] net/i40e: 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:22 -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: Helin Zhang CC: Jingjing Wu Signed-off-by: Santosh Shukla Signed-off-by: Satha Rao Signed-off-by: Jerin Jacob --- drivers/net/i40e/base/i40e_osdep.h | 10 +++++++--- drivers/net/i40e/i40e_rxtx.c | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/i40e/base/i40e_osdep.h b/drivers/net/i40e/base/i40e_osdep.h index 38e7ba5..c57ecde 100644 --- a/drivers/net/i40e/base/i40e_osdep.h +++ b/drivers/net/i40e/base/i40e_osdep.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "../i40e_logs.h" @@ -153,15 +154,18 @@ do { \ * I40E_PRTQF_FD_MSK */ -#define I40E_PCI_REG(reg) (*((volatile uint32_t *)(reg))) +#define I40E_PCI_REG(reg) rte_read32(reg) #define I40E_PCI_REG_ADDR(a, reg) \ ((volatile uint32_t *)((char *)(a)->hw_addr + (reg))) static inline uint32_t i40e_read_addr(volatile void *addr) { return rte_le_to_cpu_32(I40E_PCI_REG(addr)); } -#define I40E_PCI_REG_WRITE(reg, value) \ - do { I40E_PCI_REG((reg)) = rte_cpu_to_le_32(value); } while (0) + +#define I40E_PCI_REG_WRITE(reg, value) \ + rte_write32((rte_cpu_to_le_32(value)), reg) +#define I40E_PCI_REG_WRITE_RELAXED(reg, value) \ + rte_write32_relaxed((rte_cpu_to_le_32(value)), reg) #define I40E_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_GLGEN_STAT) #define I40EVF_WRITE_FLUSH(a) I40E_READ_REG(a, I40E_VFGEN_RSTAT) diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 1c9a6c8..f1e223a 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -594,7 +594,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq) /* Update rx tail regsiter */ rte_wmb(); - I40E_PCI_REG_WRITE(rxq->qrx_tail, rxq->rx_free_trigger); + I40E_PCI_REG_WRITE_RELAXED(rxq->qrx_tail, rxq->rx_free_trigger); rxq->rx_free_trigger = (uint16_t)(rxq->rx_free_trigger + rxq->rx_free_thresh); @@ -1241,7 +1241,7 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) (unsigned) txq->port_id, (unsigned) txq->queue_id, (unsigned) tx_id, (unsigned) nb_tx); - I40E_PCI_REG_WRITE(txq->qtx_tail, tx_id); + I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, tx_id); txq->tx_tail = tx_id; return nb_tx; @@ -1393,7 +1393,7 @@ tx_xmit_pkts(struct i40e_tx_queue *txq, /* Update the tx tail register */ rte_wmb(); - I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail); + I40E_PCI_REG_WRITE_RELAXED(txq->qtx_tail, txq->tx_tail); return nb_pkts; } -- 2.5.5