From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BC2C9A0032; Fri, 21 Oct 2022 09:47:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9ABD14281C; Fri, 21 Oct 2022 09:47:34 +0200 (CEST) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mails.dpdk.org (Postfix) with ESMTP id B4C2C400D6 for ; Fri, 21 Oct 2022 09:47:33 +0200 (CEST) Received: by mail-ej1-f50.google.com with SMTP id bj12so5029146ejb.13 for ; Fri, 21 Oct 2022 00:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ogs5TP4b3bBfaYACXgzqZUVKjpBnIcwjqo2oyDvavT0=; b=RUxWWpVeNrZx7xLcXJRPbs+nq4/kLAsqzaEJVXSnt9mkpahoqYxAOSkR+lJwgAwd15 dcH8c4AmhKIuq+acu5Xndgsk5N2lVA6UnJkib6K9cxsC3IUuanTp0n8Jvpp1DJf+U03y zZ8V+sVX7cg4zp7V36iIubTe2+KxJ7iH9L3ypZgJ5vRbIbjS6jpCNKH0FgGu2ptHAUWR l6TdlzEFPPmzUJD3Y/M8hlyyxTuA83gZXVGRTRjmChRn1a44K1j/z87Tquvltk6/Q/40 8iWw9xuzxu2IgF5I8PAsR5WvsXi75pWsxUWL/FkNgmArRx+nEqA/nLCt2TWf1AeV4mTI MGWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ogs5TP4b3bBfaYACXgzqZUVKjpBnIcwjqo2oyDvavT0=; b=J9oBs/1P/VgIeUwLz8WGrUYfZhG3LSb2Bi60Fhs4XehIkIUdfMWVJQ4fp3jjYky3Am CWt1HKlG2d682JMcdy77e34AejDEZVLZ8PyvpuJxeLwFqLyAZbuOi3C37bkgEn8/aRCe 1OICWPyN973XHUYn+lLllsZlEE9MJy+8A/DPTuGmp/8Dn9s1TBp5fXkv5xFfvBe92kxE GMZ7YijMgmBKyOoL1r+1pDPBRPg6KhNzVCNi/4p4HxcGQluu1HShBxt9vK1+O0pCI3DO XqNh55pRwp2mMZwQJnpeLupB2SxLg97fWfLNCUis0E8BVuCrPzTIbJLWQIwvPLJ5ULqo 1jxg== X-Gm-Message-State: ACrzQf1dPkyORvQ9SZqAmO6DmxteQLpmmtN3wwpCXGrsWV4DSrcIkMU+ 8Lp3RmCaoafpSciUNUSVSd+Gx1TDbHclksJHB+zZ/A== X-Google-Smtp-Source: AMsMyM6TFQ+V1QtrxbDsLjuuGr9GmIyGzs9HnR79B7fnat5FmgIh/bBiuVISYq2uH1em1RTqqzoIs35BkuJoxgz+5XA= X-Received: by 2002:a17:906:ee88:b0:78d:1a9a:b2db with SMTP id wt8-20020a170906ee8800b0078d1a9ab2dbmr14026436ejb.225.1666338453329; Fri, 21 Oct 2022 00:47:33 -0700 (PDT) MIME-Version: 1.0 References: <20221019125753.1700071-1-zhangfei.gao@linaro.org> In-Reply-To: From: Zhangfei Gao Date: Fri, 21 Oct 2022 15:47:21 +0800 Message-ID: Subject: Re: [EXT] [PATCH v4 0/6] crypto/uadk: introduce uadk crypto driver To: Akhil Goyal Cc: Declan Doherty , Fan Zhang , Ashish Gupta , Ray Kinsella , "dev@dpdk.org" , "acc@openeuler.org" , "thomas@monjalon.net" Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Fri, 21 Oct 2022 at 01:12, Akhil Goyal wrote: > > > On Thu, 20 Oct 2022 at 22:46, Akhil Goyal wrote: > > > > > > > Introduce a new crypto PMD for hardware accelerators based on UADK [1]. > > > > > > > > UADK is a framework for user applications to access hardware accelerators. > > > > UADK relies on IOMMU SVA (Shared Virtual Address) feature, which share > > > > the same page table between IOMMU and MMU. > > > > Thereby user application can directly use virtual address for device dma, > > > > which enhances the performance as well as easy usability. > > > > > > > > [1] https://urldefense.proofpoint.com/v2/url?u=https- > > > > > > 3A__github.com_Linaro_uadk&d=DwIDAg&c=nKjWec2b6R0mOyPaz7xtfQ&r=Dn > > > > L7Si2wl_PRwpZ9TWey3eu68gBzn7DkPwuqhd6WNyo&m=AkCizMeraG64B9u- > > > > h4gp5S2CYP3SiD5dpvFqvj2WHC4Cfuw6TbzZSeCk1Ryz-qLo&s=Tm7UGDJ- > > > > 3QUjCzOkIRUG_tjJA3ckOdK6kSOxuk7V5PQ&e= > > > > > > > > Test: > > > > sudo dpdk-test --vdev=crypto_uadk (--log-level=6) > > > > RTE>>cryptodev_uadk_autotest > > > > RTE>>quit > > > > > > > > Update in v4: > > > > Akril suggest dpdk use pkg-config, So > > > > Enable uadk support x86 local build, and support pkg-config. > > > > Use pkg-config feature for the uadk crypto pmd. > > > > Add build uadk library steps in doc > > > > Test on both x86 and arm. > > > > x86 can build and install, but can not test since no device. > > > > > > > I tried with the latest TOT of UADK. This resolved the openssl issue. > > > But it does not allow me to install UADK into a specific directory. > > > > What's the error? > > > > I am sorry, I will check this tomorrow. > > > > > It installs /usr/local/lib only. > > > And what is the use of pkg-config if I cannot use a specific directory > > > To install the libs and headers. > > > > Test with --prefix > > > > cd uadk > > mkdir build > > ./autogen.sh > > ./configure --prefix=$PWD/build > > make; make install > > > > $ ls build > > bin include lib > > > > $ ls build/lib/pkgconfig/ > > libwd_comp.pc libwd_crypto.pc libwd.pc > > > > export PKG_CONFIG_PATH=$PWD/build/lib/pkgconfig > > > > Above sequence worked. I would suggest to write this clearly in uadk.rst. Have updated to +Test steps +---------- + + .. code-block:: console + + 1. Build UADK + $ git clone https://github.com/Linaro/uadk.git + $ cd uadk + $ mkdir build + $ ./autogen.sh + $ ./configure --prefix=$PWD/build + $ make + $ make install + + * Without --prefix, UADK will be installed to /usr/local/lib by default + * If get error:"cannot find -lnuma", please install the libnuma-dev + + 2. Run pkg-config libwd to ensure env is setup correctly + $ export PKG_CONFIG_PATH=$PWD/build/lib/pkgconfig + $ pkg-config libwd --cflags --libs + -I/usr/local/include -L/usr/local/lib -lwd + + * export PKG_CONFIG_PATH is required on demand, + not needed if UADK is installed to /usr/local/lib + + 3. Build DPDK + $ cd dpdk + $ mkdir build + $ meson build (--reconfigure) + $ cd build + $ ninja + $ sudo ninja install + + 4. Prepare hugepage for dpdk + $ echo 1024 > /sys/devices/system/node/node0/hugepages/hugepages-2048kB/nr_hugepages + $ echo 1024 > /sys/devices/system/node/node1/hugepages/hugepages-2048kB/nr_hugepages + $ echo 1024 > /sys/devices/system/node/node2/hugepages/hugepages-2048kB/nr_hugepages + $ echo 1024 > /sys/devices/system/node/node3/hugepages/hugepages-2048kB/nr_hugepages + $ mkdir -p /mnt/huge_2mb + $ mount -t hugetlbfs none /mnt/huge_2mb -o pagesize=2MB + + 5. Run test app + https://github.com/Linaro/dpdk/blob/next-9.11-v5/doc/guides/cryptodevs/uadk.rst > > Also I made a few below changes to make compilation work. > Here, I see that you are creating a dependency on compressdev to compile a crypto > Driver. > Do you really need that? > I believe you should segregate the compressdev related stuff in compress PMD. Sorry, has updated. > -------------------------------------------------------------------------------------------------------- > > diff --git a/doc/guides/cryptodevs/uadk.rst b/doc/guides/cryptodevs/uadk.rst > index 8f09e4390e..e00398414d 100644 > --- a/doc/guides/cryptodevs/uadk.rst > +++ b/doc/guides/cryptodevs/uadk.rst > @@ -3,7 +3,7 @@ > Copyright 2022-2023 Linaro ltd. > > UADK Crypto Poll Mode Driver > -======================================================= > +============================ > > UADK crypto PMD provides poll mode driver > All cryptographic operations are using UADK crypto API. > @@ -38,7 +38,7 @@ Hash algorithms: > * ``RTE_CRYPTO_AUTH_SHA512_HMAC`` > > Test steps > ------------ > +---------- > > .. code-block:: console > > @@ -61,7 +61,7 @@ Test steps > 3. Run test app > > Dependency > ------------- > +---------- > > UADK crypto PMD relies on UADK library [1] > > @@ -72,7 +72,7 @@ As a result, user application can directly use virtual address for device dma, > which enhances the performance as well as easy usability. > > Build & Install UADK > ------------ > +-------------------- > > .. code-block:: console > > diff --git a/drivers/crypto/uadk/meson.build b/drivers/crypto/uadk/meson.build > index f6fae0a239..66418f1878 100644 > --- a/drivers/crypto/uadk/meson.build > +++ b/drivers/crypto/uadk/meson.build > @@ -12,7 +12,7 @@ sources = files( > 'uadk_crypto_pmd.c', > ) > > -deps += 'bus_vdev' > +deps += ['bus_vdev', 'compressdev'] > dep = dependency('libwd_crypto', required: false, method: 'pkg-config') > if not dep.found() > build = false > diff --git a/drivers/crypto/uadk/uadk_crypto_pmd.c b/drivers/crypto/uadk/uadk_crypto_pmd.c > index a166efa36c..2f8ef3562d 100644 > --- a/drivers/crypto/uadk/uadk_crypto_pmd.c > +++ b/drivers/crypto/uadk/uadk_crypto_pmd.c > @@ -8,9 +8,9 @@ > #include > #include > #include > -#include > -#include > -#include > +#include > +#include > +#include > > /* Maximum length for digest (SHA-512 needs 64 bytes) */ > #define DIGEST_LENGTH_MAX 64 > > Thanks Akhil