From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98ED6A2EEB for ; Thu, 12 Sep 2019 10:38:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4D1C81D448; Thu, 12 Sep 2019 10:38:38 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 7C83B1D448 for ; Thu, 12 Sep 2019 10:38:36 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id m3so2666810wmc.5 for ; Thu, 12 Sep 2019 01:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0/YLCzMfhIlqAQ2Gnk7qydI4dmfFqcrqt5pfhlhgoR0=; b=O0NhkWEx1d14cPRpcnJ8GMACewhFcsWgjLIYg1xPypeKs4+OZJjEPn6Kp88OmAO4K/ bFaOd1sWOiL9/D6Y7PH4W70PpH/hphwmYzZTs8uBEP5EJEj4nwFPl1y9UuQw6Txx6zt5 3WhNNtFY/VmJX2l4Z138aC2JpT+v0MiE+9bwWtviK+oy/t0SGN+O/+LKnHnV4JNot4EV SI9nNIMfThcEjRqhV1pMkkrg0bAjZw+jf2XZQQR7BzNT/RXz/mjm/VdsXTrYH0EI9Kyu IQAKRCzAAcXycSxvpnj5MCsgnHsNLvNo9atm0B4AeTVrv+unxwRxRnyUmZeugHYsuvBh v0Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0/YLCzMfhIlqAQ2Gnk7qydI4dmfFqcrqt5pfhlhgoR0=; b=QLHysJL3wc8HaM+tE+tOx26OoznkoCylDuRY5bBgIKhLMJ68XeMHELB/f5q3GG+953 GuKOuGSRqV6wsmvW2FeQrh/+PELAQx6vgxfzh9sinMiI6fkg0w+VE7XHQxZODTRXJfYv vY1WJ7kDxvw1CETh7/j9MCInO7gmy3Tet6Ld7XdqxjuknGfIFjmO+ECxK7TWtRsUP09G rmKwuqRWEwPVXOss1ecZ+SYE3FVWsrlyvZe2ihPi3nHgaDBo35sgxlEQC+5sRZcYyt/H YESoHjBmjB1WMdSD1UfhPz0BmV5mxuNo9SkSpRkQylaK3MNHHYZQKRtv8m7FGwPlrVv3 9afw== X-Gm-Message-State: APjAAAWwYbi0DzeoyfJ2pBxWW7uz9TXzGiaDMz5ERL/dEkz7Jsu/qr5s wV26ISb7aw8zqUYEs1RIHKU2 X-Google-Smtp-Source: APXvYqxySlKSrW31nPYbYQqB3oG7s2TQSlmWAJJtR1za+fDm/DNbYYUlSedgmMmNzUryagchp4vq8A== X-Received: by 2002:a1c:c589:: with SMTP id v131mr7081724wmf.163.1568277516031; Thu, 12 Sep 2019 01:38:36 -0700 (PDT) Received: from ascain.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id n12sm4214194wmk.41.2019.09.12.01.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 01:38:35 -0700 (PDT) From: Thierry Herbelot To: dev@dpdk.org Cc: Thomas Monjalon , stable@dpdk.org, akhil.goyal@nxp.com, hemant.agrawal@nxp.com Date: Thu, 12 Sep 2019 10:38:21 +0200 Message-Id: X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] drivers/crypto/dpaa_sec: update DPAA iova table in dpaa_mem_vtop X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" dpaa_sec needs translations between physical and virtual addresses. V to P translation is relatively fast, as memory is managed in contiguous segments. The result of each V to P translation is used to update the DPAA iova table, which should be updated by a Mem event callback, but is not. Then the DPAA iova table has entries for all needed memory ranges. With this patch, dpaa_mem_ptov will always use dpaax_iova_table_get_va, which ensures optimal performance. Fixes: 5a7dbb934d75 ('dpaa: enable dpaax library') Cc: stable@dpdk.org Cc: akhil.goyal@nxp.com Cc: hemant.agrawal@nxp.com V2: use "ms->addr" instead of "(void *)ms->addr_64" to fix compilation on 32bit (i686) Signed-off-by: Thierry Herbelot --- drivers/crypto/dpaa_sec/dpaa_sec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 122c80a072ff..b8d142107d2a 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -38,6 +38,7 @@ #include #include #include +#include enum rta_sec_era rta_sec_era; @@ -100,8 +101,10 @@ dpaa_mem_vtop(void *vaddr) const struct rte_memseg *ms; ms = rte_mem_virt2memseg(vaddr, NULL); - if (ms) + if (ms) { + dpaax_iova_table_update(ms->iova, ms->addr, ms->len); return ms->iova + RTE_PTR_DIFF(vaddr, ms->addr); + } return (size_t)NULL; } -- 2.20.1