Message ID | 1481047729-518-2-git-send-email-jliang@xilinx.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-remoteproc-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2AA260231 for <patchwork-linux-remoteproc@patchwork.kernel.org>; Tue, 6 Dec 2016 18:48:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5B01284BB for <patchwork-linux-remoteproc@patchwork.kernel.org>; Tue, 6 Dec 2016 18:48:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6E7C284BD; Tue, 6 Dec 2016 18:48:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07B85284BB for <patchwork-linux-remoteproc@patchwork.kernel.org>; Tue, 6 Dec 2016 18:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751180AbcLFSsy (ORCPT <rfc822;patchwork-linux-remoteproc@patchwork.kernel.org>); Tue, 6 Dec 2016 13:48:54 -0500 Received: from mail-cys01nam02on0060.outbound.protection.outlook.com ([104.47.37.60]:28448 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751166AbcLFSsw (ORCPT <rfc822;linux-remoteproc@vger.kernel.org>); Tue, 6 Dec 2016 13:48:52 -0500 X-Greylist: delayed 351 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Dec 2016 13:48:52 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=sLHnY5AlZr2rOJhziaU80L0v8Xj+/pLp0ksFDMl+plM=; b=NKZ4nNG6iJMiKlhFN2ekaJbffv0mlhwxf7fEVjCwOfs9V+Xi7xYFUtGa/Z0tPhVQmaMTJIJQ0v+y0V3+cGhFP+rkqMOTLU7Q+qPR10HoCc/lm4A1GIEcereSmNysUkjCRGzrErPQGuNOs4eJf5heCOh5j6OxFIqbALP7kdWhc4k= Received: from MWHPR02CA0012.namprd02.prod.outlook.com (10.168.209.150) by DM5PR02MB2266.namprd02.prod.outlook.com (10.168.174.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Tue, 6 Dec 2016 18:15:35 +0000 Received: from CY1NAM02FT064.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by MWHPR02CA0012.outlook.office365.com (2603:10b6:300:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Tue, 6 Dec 2016 18:15:34 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.linux-foundation.org; dkim=none (message not signed) header.d=none; lists.linux-foundation.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT064.mail.protection.outlook.com (10.152.74.64) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.761.6 via Frontend Transport; Tue, 6 Dec 2016 18:15:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1580; Count:17 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35010 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from <wendy.liang@xilinx.com>) id 1cEKH7-0002G0-J8; Tue, 06 Dec 2016 10:15:33 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from <wendy.liang@xilinx.com>) id 1cEKH7-00018k-F7; Tue, 06 Dec 2016 10:15:33 -0800 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id uB6IFRRp030810; Tue, 6 Dec 2016 10:15:28 -0800 Received: from [172.19.74.38] (helo=xsjjliang50.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from <jliang@xilinx.com>) id 1cEKH1-000152-S5; Tue, 06 Dec 2016 10:15:27 -0800 From: Wendy Liang <wendy.liang@xilinx.com> To: <ohad@wizery.com>, <bjorn.andersson@linaro.org>, <linux-remoteproc@vger.kernel.org>, <mst@redhat.com>, <jasowang@redhat.com>, <virtualization@lists.linux-foundation.org> CC: Wendy Liang <jliang@xilinx.com> Subject: [RFC LINUX PATCH 1/2] virtio_ring: Do not call dma_map_page if sg is already mapped. Date: Tue, 6 Dec 2016 10:08:48 -0800 Message-ID: <1481047729-518-2-git-send-email-jliang@xilinx.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481047729-518-1-git-send-email-jliang@xilinx.com> References: <1481047729-518-1-git-send-email-jliang@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22744.004 X-TM-AS-User-Approved-Sender: Yes;Yes X-IncomingHeaderCount: 17 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(2201001)(63266004)(106466001)(8676002)(305945005)(76176999)(50986999)(8936002)(81156014)(81166006)(36756003)(48376002)(50466002)(33646002)(356003)(50226002)(7846002)(5003940100001)(38730400001)(47776003)(92566002)(189998001)(39860400001)(39840400001)(39450400002)(77096006)(39850400001)(39410400001)(36386004)(107886002)(5001770100001)(2906002)(4326007)(9786002)(626004)(5660300001)(6666003)(4001430100002)(2950100002)(107986001)(5001870100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB2266; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT064; 1:9+3Fw7xq1bJdU8hHgaDQ3yFcXpDQG07mPzPqlNGaNSCDf+egZbwC9aPy0HrvNo53bxHry18YUv3XAhCdCBPctxml2o4yeLtZ6kqj+ge7sn1vR6px7S/nJvTlXDG5KoY/AgsY6K9N18mU57Kougp8QEep7B8Yyrrzi9iU86ZIthtnn8kd4NBrBZKIg/ib7RvUy0oW4PbjUwgolgyxl4O8kxm5KbjgbkYuN5qPo+wDvXD2UhwPJMkxcqoo4cR2M7p5GRcM6htB43Sjkd6RuJ25zxUyDZs2Vgiigw/8rKfTnSmtfUbqwI3UqjHZrqMO5E9LDl4RFt3PpRgWwolbcBhqr4NopjGKDb+GZOSefP6D/N6Qk/YTpoC/BZnlqRHqYylIcDu6bJQTvWKiSCmD1bNfXfQpy6Y+0g4NaIe89VS3m7P0Pxk1H+vEwjNcbqIrkFaDhD2vlJKct1xFeAsyp+ognTlzZzaoaj6Fxh1bT/oyuxk5yAv8DyyP14pgafkAQuWIZxxFnLNydIvCFp7jLEnTfA+mq5S0FlWb6I5Vuo8yms6AiJ9XnxByqvKE5OT5lNJuJEzh2ibZvmSgzHOz4DA2J/71gFE/XBMv/Z5X4WocEak= MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: e0068bae-36d2-4180-be30-08d41e03df55 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DM5PR02MB2266; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2266; 3:e3Tn0OblTre9vK69lADa9Cwpjlc8ya0jgS6WAcaH3BdWKPzm0ug6Ifpha69ER+MTltYq1QYgTDiDk8UN3FajgYug57hD8en2y76/Vyl5dXoKSu2ZrXSjLVmdcTAQZG/5Lk4PZmyEjz44QPgmNmVeuxNAtbaGdbQGL1rsQTX2dCWjluN955wYM7g6WHYLKjbBkgvotNdFTVfHRhPHzrvC6dR+w1yxDpK2Zp2Im5Fvd9g9EXrqkiiWTgasKDl8tO6Mmr7TRQgC6oMpUqYu8rW5+94rhwkszxOO1emFKxSC9sG6nS3iSz2sgvQW9PJN7Gp/6pBg+de4nB8NGOoGEC50cWeIqJG69t1dFnrEu2G1N2BtqkFJuZz4Wm1ue2V/eg1lFweVpyvNhalv9pWmgK8n4g==; 25:DwIVB2pmGgnSWLFNVfDemhahRIJ5TOPfBeThTzAC1VAFWNBmPVuQvy4ByWvDP2Mtb4Snd/CCg0mweij7bVKmIaJYHX9KVTF258jk3Xtt45SiNWoG8U9ztGcyTv+lOQZeYxmiZ4Y1uwLMhZGcVKWX9pFrSGDEOFHejdmsBBkNJ2TrWMmqdIpad3MGemLpNEQNQT8OCbfUDC3uVjkCHDsyufzlX35sQlbjghgPOT3qY/ltFI9TVb4RpH7wMtqbSJAYDAiA1RDhCrQL4iwEwShq8LYN7cT44h1aVyT0iXhz7hiXUqE/agHRbgWua1TYVNtZTv/vxCfk0sCXn4LUrLA+L+2nzryUH4teHO8s5Qp9GTcC9BvIckHSm7wPoHym063rvWB0+IfG9cT9YLBgpyFqzqeiy1kwz4QLCrvRyV1OXgZlkAFQi0b1OXAbz8Gc0Cl/O0Vdq65yaSvhmp3ry4r+lA== X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2266; 31:2e8ZzuTlYXZVhjccQNI5egqJUi+cUiVbQStOmvlilDHI3Hw8FA2+Mt2m63tHtll1CWg/W7CVFF+HE1ppndvhZtVCA/rAlukCvEj/aLms8bvW1bjd6HBldhbpXsRUbzXGiKUTnipwbyImi935PbmDyDU+A7tZ0RfKOJCzZRj+gFkDPAjfhVgr6LA0AFRqb9+7xAw4OSxNZMda2eXDmIuT5cjL9Y5qegxMsEaMh0RvlZiRQdFRFJCa8YMdsgJPYC9+Mn7mZ1pIn9PqcsUEzd/PfQ==; 20:alThnkiTKtWcB7ar5MWH3CTMZQNGeO5ZwQTR1M0QRdcS3zSwM1NeCmU/8JX9MaFqcWCMyUmqQwhFWbDmDbMbv1eG4jiX88KvdDLxrRi/kjsSg1UdTo4hIj8GwOKuuaXfbsM+YsOs1qDHLDCseWrack00qPp7ma86rFlWJnFCbwqrpLRjcBdlTaCsw10FMgJ9nPYNI9IAGp1QlsNEaVkfugWsIQNaD4dhAMUGRxFQ7pH1i0273TdK2Y0xFaBYEP4HyYHwdaaDGl6vILgCodWY5vZ7pKFzAS4vztkQUHFmeG5eUXISKpY0Cq+D+npKd0mxUVED4N3PplbScZWqwK15MAFvlDgFxPb5SCUFoz/bfuFUEe0nO4yHNffCg3LFphFu4ObpObZ4MZr7x8AYdGIgu5JRGHkKlfkzfj5zo+U7TITveVJE4OFRExW8U83ZJ7jVpCEAfb/7OBgIUclR/99EwxPel68r7db1iUQteZzJK8+QOcc9ehhrq2Qz3TejMReH X-Microsoft-Antispam-PRVS: <DM5PR02MB226683115C1DF9F1DEEAE875B0820@DM5PR02MB2266.namprd02.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13018025)(13017025)(13015025)(13023025)(8121501046)(5005006)(13024025)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:DM5PR02MB2266; BCL:0; PCL:0; RULEID:; SRVR:DM5PR02MB2266; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2266; 4:/+QkeK+uGNr2i3Adm1Rw2SXCCr+ZWbQVO7Oj1urjQ24AFX0M7Rnj8nggNHTcKQvbckapgm0WZ0ddk1+8EFwHEYkiUGwSo6gRlzKLOLTXE9Gs1c5bwgwmtTtPTCD4gk7ibQm+tPlVvtlz/zXys46PIXNBSg/ioYgN9u4LNquVVH0adfvLsJpmS4lBhmfDGUdavQpYlg/p+chP0oneaYgm/65hkjVT6xKsDk3phopf5FF72ikZs8QzfCV+b1APCQ02lRo8cXeRHUKmh2xWNrkmAoQwvDBHgpHUpoCT7s+mDK/1dwKuQHzR2Uulm/aJfxWz6F1aJFUhOsAFeSRpjmYLx4o18M5qq5MdiKKhgPP2bKDHI7F72f7zZyJkYcuKM2vSgpi7HMZlS36hwDpWi43QrmbBXgvuPWyHI3W1tA/ICx80Dd0m3/bnqBnJzN6lCIeFSeQHaUqa7t1rd2JuciJsIjRp9pO3uXuwLZnKEp4rlcMnyO1TcNSCyZb1kjhodqBhOr9i3LefcZZko2M8KTvEhJtW2f2HiwilGItfjSHeEc9GLxlbljRIdnfLi9vN1mWZI/OLgUlJqLmIvXzrWycXQ0O90gF06yRTXin0E99rePphpo+TZqCSVkb8yK7P6P/OGtbO+Pg4VFHmSMI6l5rMohD6Vai5Iw0ckDBs/pGdn25UPaPli0z2rKwWjkNDx9WftiOeS/OFpGn1Sm6mvjBuAZ7xFDuabRLDvxzKIXUEhAw= X-Forefront-PRVS: 01480965DA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB2266; 23:43rCUEf5X54Pb0LGSZEyBBHsuwCvvH6TkFJMBAFE3?= =?us-ascii?Q?feaa9Jd1P5M/JIM0SBj6hZ6JtONA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= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB2266; 7:JEBzGqouiFcz5iVdwpa2WVkLwmtZnF5+laHU3WbvYSj1KtGpDwCG5SFapW8+z1ERFuqu5OSMUIGfYR845IguUhNR2dUF2HbdNDNzzCvcLDA6HhnJQDxb8epencjRjBr1mh71KM0EAg15QfD7Dr7C+Bc2MTahP8MbVNdi5yPg8aWH1Lk6NcvPyvx/i3LkSynZ03j7yc9+owqCAOBGmdDLZzTMD/EZNW6v7ZFgD3Hq0pCaHK3km2bxbeMTmqPUNAXddemkvx6N28QmftbabDGz+WYpF4E7fglgEuX4bpFqfwA1c+3+S6yG5JGCCTZqbrVKniaVSIJcCeSJ+0yiwiMAEGN2u49KgA6xcdvs3XROVao8Iv1UZP73bHo+XziIkEqcpx3jhBouYClnl6AmSYSdrHw0i3MUCpv+gg1CJZJhH+ss47DBL0HjfcN3VaxwIh21znclCjs048w0JQFTfBIfHQ== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2016 18:15:34.3005 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB2266 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: <linux-remoteproc.vger.kernel.org> X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 489bfc6..9793e1f 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -180,6 +180,12 @@ static dma_addr_t vring_map_one_sg(const struct vring_virtqueue *vq, if (!vring_use_dma_api(vq->vq.vdev)) return (dma_addr_t)sg_phys(sg); + /* If the sg is already mapped, return the DMA address */ + if (sg_dma_address(sg)) { + sg->length = sg_dma_len(sg); + return sg_dma_address(sg); + } + /* * We can't use dma_map_sg, because we don't use scatterlists in * the way it expects (we don't guarantee that the scatterlist
If sg is already dma mapped, do not call dma_map_page() in vring_map_one_sg(). In case of rpmsg, rpmsg uses dma_alloc_coherent() to allocate memory to share with the remote. There is no pages setup in dma_alloc_coherent(). In this case, we cannot convert the virtual address back to the physical address. In this case, we can setup the sg_dma_addr to store the DMA address, and also mark the sg is already mapped. In the vring, we can detect if the address is already mapped by checking the sg_dma_addr. If yes, do not call dma_map_page(). Signed-off-by: Wendy Liang <jliang@xilinx.com> --- drivers/virtio/virtio_ring.c | 6 ++++++ 1 file changed, 6 insertions(+)