From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0040.outbound.protection.outlook.com [104.47.34.40]) by dpdk.org (Postfix) with ESMTP id 3E20C2C06 for ; Wed, 18 Jan 2017 02:22:19 +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=ZsPqXTxXcBUTcYc7dWL4kUyTgstyR0AP8FXpApLsOds=; b=UoQBi02pTvLpJr78sSR9y0CVDCd6mOHSSYq5/Hyh+xDU+UnvZk/8M6e6wKQvCn/AgFB/SVxo3lV73o6G3w9q7U9Jv0OZH2/cf+WyHhaGYzPLFNRiGLeKhemAxWHtDxbtbyjJTr6ypO76jWjzLcsUqKRR2ecAmt5FndhEX6WvceE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from jerin.caveonetworks.com (111.93.218.67) by BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 18 Jan 2017 01:22:14 +0000 From: Jerin Jacob To: CC: , , , , , , Jerin Jacob Date: Wed, 18 Jan 2017 06:51:14 +0530 Message-ID: <1484702502-25451-2-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1484702502-25451-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1484637244-7548-1-git-send-email-jerin.jacob@caviumnetworks.com> <1484702502-25451-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: MA1PR01CA0115.INDPRD01.PROD.OUTLOOK.COM (10.174.56.159) To BY1PR0701MB1721.namprd07.prod.outlook.com (10.162.111.140) X-MS-Office365-Filtering-Correlation-Id: a6b5e7ee-2445-4621-0cdd-08d43f407132 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 3:RFrkCyWcu/W1lXlW9povUGY5LPdAFQM+0Kaik3GQZ1zW3DcQs2UbVpAOnYlY+I1K+c4bhupMkRfQMjBzMlcSS0zK9VTa9j5Q+6z/c+TkfMZk6kbzEs3wFPPZApES3zZxFkX5CNrMUSTi2t/04fdLEy7WMiFS8perfxKZrcy8lSHiQRT+4tf2adpYihrKRgpM89SP5wy9RLSJfnLkGmP1YkcppuSwyFimTI9Hp8OaTLP+7S6/5LVoCDewy62SXG+5GtEJxXOEQJvSspJmNwcpgg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 25:DUZX3GQRBM1yBv6x86ophA5N9Rm7B3I+omww7GGTbzy1W7w3GZA8ffeUyd1+Whan+XkntzoG6EAqlQLFnN+2RWZ/Px01I6fM5VYzaQl2ObyFHCnyGwL2wDzfUgDTjSgFwyscJUhMr5ObaEflVgPFgcpqRH9Q3yX60lsOl1PpyTXNtOXsUf5cQWBS0t1Ak3m1nr04a6kHVKaYso3Wrnyj25wCHMrT6vnuATuUMZX/Bwf7Fm8fwav8nm97zG9+0J3yLcryJAslTRdlUlTQlYsPbGdP3eW5H/78vBbNJ1euOPKrvQeY5rgbF1pN61be6RJz8GW6ur2VYvQNHTiDsnmnQhF7Y8cKUmiV1eBmCqFPIo3V2TwXjdPEEBPA+nslethL0VQUAnVZCsBXliDNqlICDpRpRNbqlRrS+nC6d42ZIEF5HjGyUsDdoduvBw+tmtRacPKNZlVys3aik8vmJcQOLzQkCS/J6V9Sat+WzqC3hk9ajl8LP5juROnidZjLKPUx7/OOAm986DK9hrMZxZ0yO9i1L3mrj1x1w2DU2ayYx9v0YM92F0SYLtyAO1u9Cz3Ai71dnZM5ILuuInAJIeM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GcT/xXslZ5S1aXGdekCtbMCx+vQVTxkyUOPXS99ek= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148); SRVR:BY1PR0701MB1721; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1721; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1721; 4:46mTqrQQTs8Q8NuGDCcffahptPSUqBbQRE7Ppfdtb1k9adurZh3t7ERuU0YWARg/DWAIZmdyNNwMddwQVmEYxfItK9UpaZK47jaZ3M+K5tDRjzQXO2PIqS4zLpnRpPWgwOrcWsiYJev5iirpKdWUMNIFuk0vc+/RMBYFzB3Ru0EMPNxBqOp6RecXxBvPHqtz+/kbdpTaXKpIeArFWTbs2JGGEgVpKOEUTH43lJL3cHjLoAjaUWb4SOFlhoN040CXg2yc+X1cfdB50d1oYRORqitiWrZ8c2oCJLwSb/S38ub6xcRScB/RHoaNYPqWFsouGeuEw9NxMVeOmzfxmsjcnnN+IpU9mSZhh33589YRYu6vDM41BHmwhYFH2cSx5V2v/96RkaSJ9BKL9PUeby/OK/q5/h4Pl5w37go1J7SSMnVV52+6weHtpY7ow8er0m8uDp8Dk/yVgdoVyoWtjRpO5MQmFlCHLO2JxaZjytdVRLD4kGzNqgJpZIOvodNvG4yfAr+EVPoCZmJlAocpZWXQJkolW/ds6/vWu9hv3i52wv5F3Bi/pTumoinJjg7P5AUXumGY8domQSMI39fUF78T9w== X-Forefront-PRVS: 01917B1794 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(4326007)(6506006)(50986999)(97736004)(47776003)(107886002)(25786008)(189998001)(54906002)(66066001)(92566002)(101416001)(38730400001)(81156014)(81166006)(6486002)(2906002)(42186005)(53936002)(50226002)(8676002)(2351001)(68736007)(305945005)(53416004)(3846002)(50466002)(105586002)(33646002)(6116002)(4001430100002)(5660300001)(6512007)(48376002)(69596002)(76176999)(42882006)(5003940100001)(5009440100003)(36756003)(7736002)(110136003)(6916009)(106356001)(2950100002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1721; H:jerin.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; BY1PR0701MB1721; 23:GHNqrVgRN/ZVQ3VPdYO3nrsnGjVb87GK6Edysne?= =?us-ascii?Q?rs4KnAor7SwL0kZFbxeEjFRoQ9C19ZN96XiNes2Nv/7WTENd6uSjWND2BHSc?= =?us-ascii?Q?JdeSgbEBgQvACzAL2Jp/xtMjTYNJw6wniYMfdU/5pyIVIZgUxYQdorI3tOrQ?= =?us-ascii?Q?V2ZcC+hDSzENXiCukRJVReXJhYUcBijAluq7/LtWBdf1gvFVnbLgNsCKwjU3?= =?us-ascii?Q?7HFklRkxu5ZiCy7827PBrE6QRKpzfxWdd2KPwJdVGtj8h4s8I49II9xQYZvg?= =?us-ascii?Q?1ReegevUHNHvmZN4wULZxul4Jvo+JBA032kKvGoIIiVGmJF00Ryj+/ZjquDa?= =?us-ascii?Q?Tsrb2rK0g+P0YAhaCcsv9j12gCSpYvmJDfx3S+hSuK/cKSRQRdpPxGne/7a6?= =?us-ascii?Q?3cqkF02LxLuxpBgmVBU1Ut1NhJ2aTc75yiFyNs+PJuGt4vif0t0VdTJsmBXu?= =?us-ascii?Q?NO5Jm4+eCET7TP48x2Jdp4Axvo9Dr+S8M9PhRj2Cx2a/LiZKvf0GoDcHmIfU?= =?us-ascii?Q?GXjRkmTWLASW+9gQcqSylXHt9uM4Op4txc+HakAfz6aL4BD+Zq1NFfaW+7NM?= =?us-ascii?Q?4wYEFC9ML1ekD8lH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caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2017 01:22:14.8272 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1721 Subject: [dpdk-dev] [PATCH v5 01/29] eal: introduce I/O device memory barriers 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, 18 Jan 2017 01:22:20 -0000 This commit introduce rte_io_mb(), rte_io_wmb() and rte_io_rmb(), in order to enable memory barriers between I/O device and CPU. Signed-off-by: Jerin Jacob --- lib/librte_eal/common/include/generic/rte_atomic.h | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/librte_eal/common/include/generic/rte_atomic.h index 43a704e..7b81705 100644 --- a/lib/librte_eal/common/include/generic/rte_atomic.h +++ b/lib/librte_eal/common/include/generic/rte_atomic.h @@ -100,6 +100,33 @@ static inline void rte_smp_wmb(void); */ static inline void rte_smp_rmb(void); +/** + * General memory barrier for I/O device + * + * Guarantees that the LOAD and STORE operations that precede the + * rte_io_mb() call are visible to I/O device or CPU before the + * LOAD and STORE operations that follow it. + */ +static inline void rte_io_mb(void); + +/** + * Write memory barrier for I/O device + * + * Guarantees that the STORE operations that precede the + * rte_io_wmb() call are visible to I/O device before the STORE + * operations that follow it. + */ +static inline void rte_io_wmb(void); + +/** + * Read memory barrier for IO device + * + * Guarantees that the LOAD operations on I/O device that precede the + * rte_io_rmb() call are visible to CPU before the LOAD + * operations that follow it. + */ +static inline void rte_io_rmb(void); + #endif /* __DOXYGEN__ */ /** -- 2.5.5