From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0046.outbound.protection.outlook.com [104.47.0.46]) by dpdk.org (Postfix) with ESMTP id 065EFA48D for ; Tue, 16 Jan 2018 02:12:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=He8x0WydLz2UD26tPIyx7goZoZpNiV88IdTK1AJIw1I=; b=C5es1LDypBmHmkjdAsIHjuPL4DYlRVM6iXJR4l6DuEOFYoU8/PXmrjeDWd+NpDvjLX+xraBK7Mz8N8Koxsu5J3G5axoX5PgCRzmiAjV5wn1gTOIkI4KsT0psCws627Oe1xGhqL61ZBdZDwze6B4B78u/nTpRkpUOb+SLmIY735A= Received: from mellanox.com (209.116.155.178) by DB6PR0501MB2040.eurprd05.prod.outlook.com (2603:10a6:4:6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 01:12:21 +0000 From: Yongseok Koh To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, jerin.jacob@caviumnetworks.com, jianbo.liu@arm.com Cc: dev@dpdk.org, Yongseok Koh Date: Mon, 15 Jan 2018 17:10:43 -0800 Message-Id: <20180116011050.18866-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180116011050.18866-1-yskoh@mellanox.com> References: <20171227042824.33373-1-yskoh@mellanox.com> <20180116011050.18866-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: CO2PR05CA0073.namprd05.prod.outlook.com (2603:10b6:102:2::41) To DB6PR0501MB2040.eurprd05.prod.outlook.com (2603:10a6:4:6::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07215ca1-45c0-44c1-b26a-08d55c7e3297 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:DB6PR0501MB2040; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 3:sb7u+Jf/slCvQxSOAspl/RjvCNVMTBBd9zCT7KbxyjI4Syc9xZuDtLWdv5Do4IoiyZSn4jvmRbYfHUI3BMne5qVFxfVaD+xywk/W1KhF0+3cCP3udF20WtLX0rDIz1KVv8a2Vp/Gmcz4V6WS1UIB9xzGuI6xQzDH4luI2YFPAKB13Ljq46gGXTXKJQEUlU/Vjv3VoRYx6fBWq1OiySK8419ccW8z8AAhLINJTm2ZyQIAvioQCl+VxTDbTDlLN2jP; 25:VflRrR6JLO+pCa6Fvd96ClvTD8tbi9xblpuiE82natuuTJdoQaQeGGjiShA0G0nWoIx64FXC5qG77jKV07Hmfnzb/Bw4eSX0ws4VkhtyD71smQx3UhJaA2ugG4ivi195GUzP6obUM/s0xGUEfEyui3MuA0UhuWZAq7QtXZHxYoHIP8kI4Bx0op0rI7cNap+EqvChUFBQtpmjtlIMiNCIQcK2zKFVKRJL9jHUXn4L6Ek8/QC2ZKYs6d1GUKZWDfH7prqIAia5oQUEqotpiO6sh4ArTFzGxorjGkYrrUoDmd9Vt5U5qOI0lfTDKX7cmSebIsL2Jze/R8yE4OtDzQGHQA==; 31:+yAi8g0Y16DZFZZ4+e+u5ymAhh+UcjerPkWGGFxlHOyv+bfR+bcarvVjlOwNh9YGSBb2Jue6xkH9Y8s/x4pNbmUKA1mQ/s+rHCsxnPGv0Jk2IR+KjB8Tb5kqUt7f2zuCIBUGe4yFhY1SIxTNiBNdNR7BAgPn4Kt+vn7of/IHwSLxiqse38gsOjgWkL/PpDrN2FOAjL5WPwcZg3rA1N4ck4owNRhm8Tw2Mpzl/LsdrQk= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2040: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 20:7gbrgAeXrbEtM6ttQ1ECsYzalic+wQzlMM3RQpiv1fb/ctXMbdWBA45XtNuJ2q0TsVYjPMWRiUTRNm7OgqhdWC86XaQUgPxBo8Z3uBkJRN2verLYlkNxu/l/VxlVbrH+g75pRs4H0lL0o1HIyBSC+ivl/PWmE+4wqZUVIYbckCfTKhcFg6NGxgzHdMFuPY9yBUImBNdR6wS+6eObRoDvZM7Uj5DP4t2u0N0l/VL61bp7kNkBdtMqKn66g+hL2L29OX18QZyHtEiPynUM9vAQVLMOcf3joMO/ugzjuPn8lJ2Hh44fijuJlJdwFjYSTHERdrn/22z54hydCljvjGVgcM5uROi9vLPMp2PMHOpD0S+DKNzWwEjjxiPt0zvYCIxYXsydjH98YJOlccjOrO8YHWpRI2KkDRGfhT+3pVwoInX6toMvxcDesCunnQkgg7j9qzTMfyqjPbF8Yh3apMzvOs9UxHO5JHHnKRdmCC7i/JDXWoI/xD0gtYzxBUhBOFTv; 4:9xFEdwQg9/i6sSRygMWrQKR/org1oiix9/RVRdR8RCWduGeP17N7kI+k+Pis7AHGmqE3NUz3VUZjMCa7iBs9RyAi0YRbVniHmCmcIpqxaS8W3TnO8w+QYFqrl8nuTO99PZu7SMGhR/54ObPOySfJJyh7dwLCqW1wB4Az3Q0C/tYqe/Qx/O+Dr98T/ztlFLngpy1Z6zuOeCXxD4jacyQqjGTeTmK5ULd09EUzQpGbkNk8t5n6TNySGOqRIxtseIXfON2pQNb9DBWRGbddwdEH6Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231023)(944501161)(6055026)(6041268)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0501MB2040; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB6PR0501MB2040; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39380400002)(366004)(39860400002)(346002)(396003)(189003)(199004)(66066001)(105586002)(106356001)(86362001)(97736004)(21086003)(316002)(5660300001)(2950100002)(6666003)(16526018)(47776003)(16586007)(76176011)(7696005)(478600001)(81156014)(25786009)(51416003)(81166006)(52116002)(4326008)(8676002)(36756003)(386003)(107886003)(8936002)(59450400001)(69596002)(55016002)(1076002)(53936002)(305945005)(50226002)(7736002)(2906002)(3846002)(6116002)(48376002)(50466002)(68736007)(26005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2040; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0501MB2040; 23:bl68t+qjQeT3MMMZHG4MwUiCzFk7td9jXrtlRJm?= =?us-ascii?Q?L5izpX/qzvaGOeeTVpm+/q4hjZnLfwgsXSsgo72zyRd+Wv88gCnNdusxdu/e?= =?us-ascii?Q?pSdnSMlHBBJxyZz4oFoFLzFTgRfhkVyOhEuKrVW5/dyvggi5WBkN3Nfl/J+x?= =?us-ascii?Q?Wo23BuOiS8GGJeU1ttqXv4AM3B0uCaC/IuHtDDmZ1UcjDgNUXF4O+Dh3LjIF?= =?us-ascii?Q?PqktCAzP3GynFc8bo00j50IcaQgOIntsgg7rop0e6iHdbp0yRbMYPOhsUVtx?= =?us-ascii?Q?J2b2AZh2Ze5SeD/FPMthg6nQj+OHg942IMt3bnzwzseCfOh2hhni18sHhrue?= =?us-ascii?Q?LIG80/M4JOeUVVEikhwc/yeKJGwAA6NnpCs4YUioRRgcze2UtGBksYcU2K+c?= =?us-ascii?Q?fJvz2bnrc4xEPmpEgAW+Ua9rTYGwrNElktimXk/2YUADCGtiwyiN/9qd7ynR?= =?us-ascii?Q?OHBNG4ZWm6sIgoyWG7ImHOchISlF+fp2MfP6xATxpEForPaD5NMAfN0rCNJM?= =?us-ascii?Q?EcSjzFJO4RNSefrpFy6uCzJllTZ878IV/OotK9BXPBVtp4DVHbRHXostStC/?= =?us-ascii?Q?W2V0qnq78909+VPGfGRVOX74cNjRSEHA0uirmQejCIv/U4LYCCmwARCj5mrR?= =?us-ascii?Q?qssuDp3TrQ8C2UL4IzIrv9zkttH5WmcmQlrEbPQBtW4uP9yI8GPlobltMAuu?= =?us-ascii?Q?2ir5az6iG7Pt8hl7m2VikDielrJ9lETl2z6dbWAaFEL6hKviIrh4Mc/QHVtD?= =?us-ascii?Q?unFtowOhDgZy55G8ICR4JECD/X5vjl8sgUhytPDu0HdrXlYBwKlG0bel5qT3?= =?us-ascii?Q?ETBDsXgW6OdKW8Qs5zfaFDmAujf5e2MjdGc38XODC8No90jCMFbSv60MGNTq?= =?us-ascii?Q?6mBAhdw2cE3DrVTsBZ/RavD1sNlzT10dR2S8ILzxNCyklzBa7/6fgjnNm4M5?= =?us-ascii?Q?Q95SGDCupfndMZW7J9Sl5JpmUmfBS95OZNFJLDyIXeh0Z1CLkMZuCnbU4V/L?= =?us-ascii?Q?919PgbZDHm+I4PZd1Vwu4pjUnCIYPrmJqSFsYumHpShCWzgiEZkH+jLfGrpJ?= =?us-ascii?Q?8ijMyVtDo/jXd6QPhmZIA48YnZg8zNZWSdhYXemsDLyyAZ++Rk4CPDUFUW71?= =?us-ascii?Q?hWqA01PsmbzJGKJpMw/KbmgkonlSUes/RzsSms3T8vWWZ2d9Xf84J/g=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2040; 6:4bmw1ALgyZ8FmfPkjxHc23x5DISyAx629spEOfwDf9CpKmwvpHG7pT2sWgn7gnWZQgKygf+IQxbH3u0XNuyS/wCgPCtdwK2fL9gEURy2u2Htl+6ToN2z89m+YuTR+Zv4odiqW4aLeZQNpDdnbJBmhY4y4oFQliUO48Vj3LJpVkHYc8g1zJNrlbSyJ9i9HZ555x+fX6Bze/qRnDqPYizOS9LpCPWfWUbpckaTAXDS8oJgAJT0tkdA8oFTVHUEhAx5JL+3CrEMEEggcgsth7+Dq9G20FegxO1jRbFbWFsanpww/ftqWkEwKjq4SbjbRQ8gIS15gfQ0LocTZsySKUd6YO5Lm3bd42m4ND03zzjCwcg=; 5:9r8cvfRvARZZW74g7VovudBZHCebowZF2aCA3SrAoR/PIB/n2q2/lz/DnBi3FQ3SqokyssS5xhxdT+wKY0ZjrzdNu577Fy+e1t4wiIKNYBkM9I0lZSmCbGljp1xu32N9KTXO/bLxqWOtnRT0pUkdLJl0oZGvev2SBfQLnMUuopE=; 24:Ru0OxVj4i7TqFlBurP1Be2vrd6IxBGZeZdYhdD8hONS1slfSI6U0SsBmILPf9bqn5jMWpHwwRlz1dR7/lrwJbLUVefB9xn5NDkoFrugo8rQ=; 7:+8eCvBE728xwQyhuuIZDxdwNSMUJoh2yMAZwy+FpRU35YbfNzZVQG4CnuU5tj1NNKgOAB8mdcdYABCRICL0wHcOCqIKZUVFGQQEWCw7mJRT1ajwI5d+Vgfr4Ma2O6m6+MBMtpxDk/TvgeYUOUTZvAFvRm/wh5Q1+f41T12yC3jRcOLdQEP2Upe7r0+Ya+uoJKc8FxbOlrjt0sg2eas+CTBP/tOc2JB3WZrM/bEXPEzmqW5xP1RkGoDMkI8NSiH52 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 01:12:21.4261 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07215ca1-45c0-44c1-b26a-08d55c7e3297 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2040 Subject: [dpdk-dev] [PATCH v2 1/8] eal: introduce DMA 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: Tue, 16 Jan 2018 01:12:24 -0000 This commit introduces rte_dma_wmb() and rte_dma_rmb(), in order to guarantee the ordering of coherent shared memory between the CPU and a DMA capable device. Signed-off-by: Yongseok Koh --- lib/librte_eal/common/include/generic/rte_atomic.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/librte_eal/common/include/generic/rte_atomic.h b/lib/librte_eal/common/include/generic/rte_atomic.h index 16af5ca57..2e0503ce6 100644 --- a/lib/librte_eal/common/include/generic/rte_atomic.h +++ b/lib/librte_eal/common/include/generic/rte_atomic.h @@ -98,6 +98,24 @@ static inline void rte_io_wmb(void); */ static inline void rte_io_rmb(void); +/** + * Write memory barrier for coherent memory between lcore and IO device + * + * Guarantees that the STORE operations on coherent memory that + * precede the rte_dma_wmb() call are visible to I/O device before the + * STORE operations that follow it. + */ +static inline void rte_dma_wmb(void); + +/** + * Read memory barrier for coherent memory between lcore and IO device + * + * Guarantees that the LOAD operations on coherent memory updated by + * IO device that precede the rte_dma_rmb() call are visible to CPU + * before the LOAD operations that follow it. + */ +static inline void rte_dma_rmb(void); + #endif /* __DOXYGEN__ */ /** -- 2.11.0