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 272C2A0522; Thu, 2 Jul 2020 21:29:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CED501D984; Thu, 2 Jul 2020 21:29:51 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2084.outbound.protection.outlook.com [40.107.20.84]) by dpdk.org (Postfix) with ESMTP id 308BB1D979 for ; Thu, 2 Jul 2020 21:29:50 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NbdGHVcVzLH3huwTrRjNNAnCH7P7SkeVh9QVN8qpWrOJc7GSAWdWXEXw0+bOuxBRCwlixT/f2AVU1dx213qQIDoAnv8FPFXk93MdNh1TjDLN+VqIfLHqDcRnpe/sw+w5eIxtOolJtxJyP22lcTfvjYf67DcVHJMYJ9Yo0txSMfp0fhx18uXTAi5xV7vqLvFqPZJZvvJtFutpSr4vunW6gU13xQajAARmSTnvtJovASrB31mSwGECXBIcoOO7COdBk++oBbgt9Ykd3VxUA7SZIpx7FKxG/VkUiG0DDMXWVVhPp3DaH7O/qXkwJOGUF18qteESUEA19ii5as2OE7fIMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=52cnBcPgVKdtNaC65M1DX0/BT/fQX6HEId20kGDMckc=; b=bx0AzyUeHshbCV/zSJCGzorVmBToBX9gC44ryhAZXXLsO+cy5OfF3e9iHbT1RWTI7Wf+yeImtZjE+FV5/f3KGCsGZW80xYb1F+hsJpId5TyOM3MnHWCuaSD0HIaWwy5u7D0o4wYpvPAfp65BrLCzr2D25nPyC5w960rCnUzVUkKe2NpehagmCktRPCyU5ssy1Wl1Ow9V5hjgA6AfjqgdtUEuUrG3ufJUuhvLmS0Schwg8VIe24Tp03tQl0mx0Q+rR21D5Nh2taGP8suXTIQNWuoAwATQPQLALumw5B4ETAvOkX02VYiZZYHyLLfqSZADZ/rSUJNG/TsaCUYpsdKz+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=52cnBcPgVKdtNaC65M1DX0/BT/fQX6HEId20kGDMckc=; b=H+/QnDL3OKJdNOK1tUTowLIQa/zoiNFaUpe3zWdMW061deepYuEcs3OFP7V10MBMAO12yBnjzvxN0w9cxApcKzcNm5e/LhLSwYUq6lmJ5VU5jnTjn8+uLXb8MkUsKw0uqhzzDyKwtEOPwWH0JOSQmfnAbhx7zi/f2/fqfRdGiWE= Received: from VI1PR04MB3168.eurprd04.prod.outlook.com (2603:10a6:802:6::10) by VI1PR04MB6976.eurprd04.prod.outlook.com (2603:10a6:803:130::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24; Thu, 2 Jul 2020 19:29:48 +0000 Received: from VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::b077:1fe4:d352:b464]) by VI1PR04MB3168.eurprd04.prod.outlook.com ([fe80::b077:1fe4:d352:b464%7]) with mapi id 15.20.3131.035; Thu, 2 Jul 2020 19:29:48 +0000 From: Akhil Goyal To: Arek Kusztal , "dev@dpdk.org" , "fiona.trahe@intel.com" , Anatoly Burakov Thread-Topic: [PATCH v2] examples: add multi process crypto application Thread-Index: AQHWSjMk4mK6yErhiUyXYDdjdrqrTaj0tVTQ Date: Thu, 2 Jul 2020 19:29:48 +0000 Message-ID: References: <20200624142344.3152-1-arkadiuszx.kusztal@intel.com> In-Reply-To: <20200624142344.3152-1-arkadiuszx.kusztal@intel.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [45.118.167.91] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 100a53ae-1ed7-44e1-de01-08d81ebe48b0 x-ms-traffictypediagnostic: VI1PR04MB6976: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0452022BE1 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +7JEQAA0NccEcS+SFZXYvsBrMWGDM57Uohu7tsoCFV9d+jCD8JcGcacVBCQrwVhfSbkfBmMsndA30mCBaPSUrrxKkVbXssNKjENEDexqCNWKADaL/F3bslchHpsIbfLupFm6tN9bfTK0rZ7+hh0MdNtObp/aD4aEzaTms3yT7CFPTw4MN24JvipPN3rUwBqd2iQBhnWnmWwpwM4lXH6ctCkf9hN91K8ffjw4Hhc2SEq75vF7C6lZyMESyM8U9Ejp7/qtWvTPw+dS+EELIzUtC71ho0byJrQruCXhwUHZ1Gg8eK2YHtyHv/q8YZIdJV7mCqkzIxFH14PIjUCd3YvQcg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB3168.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(346002)(366004)(396003)(186003)(26005)(83380400001)(6506007)(7696005)(9686003)(8936002)(55016002)(71200400001)(8676002)(2906002)(110136005)(33656002)(316002)(86362001)(478600001)(44832011)(66476007)(76116006)(5660300002)(66946007)(66556008)(52536014)(64756008)(66446008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ErXc9aJ3qvL/MRNDAgMJorSW25lxu+cmogJYcK4X0KYV2XDqpjI5JoSIrJJtSWzS93tgJI1XsyPXnqJ7nrK7BFWp1+dBaheZ3TEfBpPk1C+5HPI3H9XfCvFbSpSkWcXM8gKKsC7IJer8iryuEPcneFXYFe8h+nrdEqF5XHTZTM07ccgOPU9BQwKBTQ2Za2I3dzFwxWJa3Mv6B+W+Alt2JWPUlhKwEuPtWE1GIL4PkoPSvdCXNAc2GftCfzpBN1uQS+ZXxzL10HfUY/DHjSEGkEieSnz1sp1NsBW0R+E8KMzpqbnrJUwQtVvPH1xa2z1v0K5/QDhdAYQOBkuTIWEnH1IDygwd73xx1t/+k46qPQV8a6Mj4wQoqEpnu85Sek8xeYj3igP/2FR1XEPd0AVMIxyCoZNBPVaYKDL6ZetzacUw5YS5E4SZlv6X+o86eRMlyJK15//xXqUyIqwjKAIGGnDoTs8axdYCkyMv7WxElGzDQx1SM8T9ShvDu9zEeTLr x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB3168.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 100a53ae-1ed7-44e1-de01-08d81ebe48b0 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jul 2020 19:29:48.3366 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: H7ADUi4Z0cNct7qNiZFQHG46x5Lev3ZYC1vc3cHoPNlbZGvfnI2ky+d4tk8RPRa98qynfdgeM78t4rdYZXmtQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6976 Subject: Re: [dpdk-dev] [PATCH v2] examples: add multi process crypto application 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Arek/Fiona, > This patch adds example application that can test > usage of cryptodev in multi process environment. > More can be found in mp_crypto.rst in sample app guides. >=20 > Signed-off-by: Arek Kusztal > --- Shouldn't this be part of examples/multi_process? > doc/guides/sample_app_ug/index.rst | 1 + > doc/guides/sample_app_ug/mp_crypto.rst | 153 +++++ > examples/mp_crypto/Makefile | 58 ++ > examples/mp_crypto/main.c | 1109 > ++++++++++++++++++++++++++++++++ > examples/mp_crypto/meson.build | 18 + > examples/mp_crypto/mp_crypto.c | 139 ++++ > examples/mp_crypto/mp_crypto.h | 224 +++++++ > examples/mp_crypto/mp_crypto_ipc.c | 32 + > examples/mp_crypto/mp_crypto_parser.c | 511 +++++++++++++++ > examples/mp_crypto/mp_crypto_parser.h | 149 +++++ > examples/mp_crypto/mp_crypto_vectors.c | 175 +++++ > examples/mp_crypto/mp_crypto_vectors.h | 66 ++ > 12 files changed, 2635 insertions(+) Can we split this patch in some logical way so that it can be reviewed easi= ly? > create mode 100644 doc/guides/sample_app_ug/mp_crypto.rst > create mode 100644 examples/mp_crypto/Makefile > create mode 100644 examples/mp_crypto/main.c > create mode 100644 examples/mp_crypto/meson.build > create mode 100644 examples/mp_crypto/mp_crypto.c > create mode 100644 examples/mp_crypto/mp_crypto.h > create mode 100644 examples/mp_crypto/mp_crypto_ipc.c > create mode 100644 examples/mp_crypto/mp_crypto_parser.c > create mode 100644 examples/mp_crypto/mp_crypto_parser.h > create mode 100644 examples/mp_crypto/mp_crypto_vectors.c > create mode 100644 examples/mp_crypto/mp_crypto_vectors.h >=20 > diff --git a/doc/guides/sample_app_ug/index.rst > b/doc/guides/sample_app_ug/index.rst > index affa9c5..ff033e4 100644 > --- a/doc/guides/sample_app_ug/index.rst > +++ b/doc/guides/sample_app_ug/index.rst > @@ -35,6 +35,7 @@ Sample Applications User Guides > link_status_intr > server_node_efd > service_cores > + mp_crypto > multi_process > qos_metering > qos_scheduler > diff --git a/doc/guides/sample_app_ug/mp_crypto.rst > b/doc/guides/sample_app_ug/mp_crypto.rst > new file mode 100644 > index 0000000..d3cb1d9 > --- /dev/null > +++ b/doc/guides/sample_app_ug/mp_crypto.rst > @@ -0,0 +1,153 @@ > +.. SPDX-License-Identifier: BSD-3-Clause > + Copyright(c) 2020 Intel Corporation. > + > +.. _mp_crypto: > + > +Multi-process Crypto Sample Application > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The Multi-process Crypto application is a simple application that > +allows to run crypto related operations in a multiple process environmen= t. It > +builds on the EAL primary/secondary process infrastructure. > + > +The application allows a user to configure devices, setup queue-pairs, c= reate > +and init sessions and specify data-path flow (enqueue/dequeue) in differ= ent > +processes. The app can help to check if the PMD behaves correctly > +in scenarios like the following: > + > +* device is configured in primary process, queue-pairs are setup in seco= ndary > process > + > +* queue pair is shared across processes, i.e. enqueue in one process and > dequeue in another > + > + Extra line > +Compiling the Application > +------------------------- > + > +To compile the sample application see :doc:`compiling`. > + > +The application is located in the ``mp_crypto`` sub-directory. > + > +Running the Application > +----------------------- > + > +App binary: mp_crypto (in mp_crypto/build/app) > + > +For running PRIMARY or SECONDARY process standard EAL options apply: > + > +.. code-block:: console > + > + ./mp_crypto --proc-type primary > + > + ./mp_crypto --proc-type secondary > + > +.. Note:: > + > + The same set of BDFs must be passed to all processes. > + > +.. Note:: > + The same crypto devices must be created in all processes, e.g. in qat > + case if asym and sym devices are enabled in the primary process, they > + must be enabled in all secondary processes. > + > +General help can by checked by running: > + > +.. code-block:: console > + > + ./mp_crypto -- -h > + > +The application has a number of command line options: > + > +.. code-block:: console > + > + ./mp_crypto -- --devtype [dev-name] > + > +This option specifies which driver to use by its name (for example "cryp= to_qat"). > +The same name must be passed to all processes. > + > +.. code-block:: console > + > + ./mp_crypto -- --config_dev [devA, devB,] > + > +This option specifies the list of devices that should be configured by t= his > process, > +this results in a call to the ``rte_cryptodev_configure`` API. devX is a= positive > +integer (including zero), the value is according to probe order (from th= e > smallest > +BDF number), not necessarily the cmdline order. > + > +Example command: > + > +.. code-block:: console > + > + ./mp_crypto -w 03:01.2 -w 03:01.1 -w 03:01.3 --config-dev 0,2 > + > +will configure devices 03:01.1 and 03:01.3. > + > +.. code-block:: console > + > + ./mp_crypto -- --qp-config=3D[devA]:[qp_A, qp_B,];[devB]:[qp_A, qp_C= ]; > + > +devX - positive integer (including zero), as in config_dev command > + > +qp_X - positive integer (including zero), specifies which queue pair sho= uld be > setup > + > +This command specifies which queue pairs should be setup, resulting in a= call to > +``rte_cryptodev_queue_pair_setup`` API. > + > +.. code-block:: console > + > + ./mp_crypto -w 03:01.2 -w 03:01.1 -w 03:01.3 --qp-config=3D"0:0,1;1:= 1;2:0,1;" > + > +This command will configure queue pairs 0 and 1 on device 0 (03:01.1), q= ueue > pair 1 > +on device 1 (03:01.2), queue pairs 0 and 1 on device 2 (03:01.3). The de= vice in > question > +should be configured before that, though not necessarily by the same pro= cess. > + > +.. code-block:: console > + > + ./mp_crypto -- --enq=3D[devX]:[qpX]:[ops]:[vector_id] > + ./mp_crypto -- --deq=3D[devX]:[qpX]:[ops]:[vector_id] > + > +devX - positive integer (including zero), as in config_dev command > + > +qp_X - positive integer (including zero), as in qp-config command qpX > + > +ops - when positive integer - number of operations to enqueue/dequeue, w= hen > 0 infinite loop > + > +vector_id - positive integer (including zero), vector_id used by this pr= ocess What is vector_id? How is it meant to be used? > + > +This commands will enqueue/dequeue "ops" number of packets to qp_X on > devX. > +Example usage: > + > +.. code-block:: console > + > + ./mp_crypto -- --enq=3D2:0:0:0, --deq=3D2:0:0:0, > + > +Note. ',' comma character is necessary at the end due to some parser > shortcomings. > + > +To close the application when running in an infinite loop a signal handl= er is > +registered to catch interrupt signals i.e. ``ctrl-c`` should be used. Wh= en > +used in primary process other processes will be notified about exiting > +intention and will close after collecting remaining packets (if dequeuin= g). > + > +Example commands > +---------------- > + > +Use two different devices on 3 separate queues: > + > +.. code-block:: console > + > + ./mp_crypto --proc-type primary -c 1 -w 03:01.1 -w 03:01.2 -- --devt= ype > "crypto_qat" --config-dev 0,1 --qp-config=3D"0:0,1;1:0,1;" --session-ma= sk=3D0x3 -- > enq=3D0:0:0:0, --deq=3D0:0:0:0, --print-stats > + ./mp_crypto --proc-type secondary -c 2 -w 03:01.1 -w 03:01.2 -- --de= vtype > "crypto_qat" --enq=3D0:1:0:0, --deq=3D0:1:0:0, --print-stats > + ./mp_crypto --proc-type secondary -c 4 -w 03:01.1 -w 03:01.2 -- --de= vtype > "crypto_qat" --enq=3D1:0:0:0, --deq=3D1:0:0:0, --print-stats > + > +Use different processes to enqueue and dequeue to one queue pair: > + > +.. code-block:: console > + > + ./mp_crypto --proc-type primary -c 1 -w 03:01.1 -- --devtype "crypto= _qat" -- > config-dev 0 --session-mask=3D0x3 --qp-config=3D"0:1;" --enq=3D0:1:0= :0, --print- > stats > + ./mp_crypto --proc-type secondary -c 2 -w 03:01.1 -- --devtype "cryp= to_qat" > --deq=3D0:1:0:0, --print-stats What are the expected results out of this app. Can we have some logs in thi= s doc? Can we kill the primary app first? Will the secondary get killed automatica= lly or will throw error? Can we open and kill secondary apps multiple times without killing the prim= ary? This multi process app is only taking care of crypto queues while others a= re for NICs. Is it not worth to have crypto+NIC multi process app instead of this app? I believe most common usecases of crypto are with network traffic. Can we modify l2fwd-crypto for multi process? > + > +Limitations > +----------- > + > +Software devices are not supported currently, but small changes in code = suffice > to enable it. > + > +Only one crypto vector and session type is possible to chose right now a= nd it is > AES-GCM test case. Regards, Akhil