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 44327A00C4; Wed, 27 Jul 2022 06:25:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D03F940A89; Wed, 27 Jul 2022 06:25:43 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 45208400D7 for ; Wed, 27 Jul 2022 06:25:42 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26R1kT4p024338; Tue, 26 Jul 2022 21:25:36 -0700 Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3hjv08gct5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Jul 2022 21:25:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VLDnQ0veP99PpZWjkZc2cvknPMdQugathG6KyY8CM/iFXKnNCP7p2HIRHQMajivGKVTTaUTB/pNEqPXIAyisWYfRVJU3jtJMxpbsykLSHI/N6xaNeT7v8EhDy71gi+rXC0TpHcPagblCoXFS86hkiaKrnO22Ca6QHkCFiNsZANejaoV+pn27dCqlDBe4sBl/1hrcjPVCJb6k5N9726pPX5mFJgD59FAdzNdRqQluCIagL8kw2ERBk4ZwSo1Dbs3F6dgqUR1USldekR/heDUBI940uZlI7eCqOh42XGlYw/vyxImlrcs9l1X/eg2yV1sYvUOvZyZ9c309oEnaVjmvpA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HM7/+MXMMNqZGiewUYfX/6JOBc7a+usxXdOjSF5SEKA=; b=L2zTLCcwx1Wub1W3ky2ZlMgcfDMCeTeq3ezDW/gtwMvizPBMIRhRTMe8foEvDAXHob9v1kq7wAlkVMHIu0QLz9JFnUbY4dGC6350DXeoIh1CLvfUD5vuY3qZEYuLAWbsk/2ovCVzkB0RL52QE54zNdAhJeZX9DZhU4vFwL5zoDBarOZcZPePWOn0YXExMDwEAxxoFBbLkHmfrp3MSba1e1qw9PVSOl/Mo1mpSPYYW5DfDxIC5IZE8CSKZINevEEt7kzbn4h+1NrJ5F3lmT7Df6xCwPs4SX4bsX51gyurDfP+rcu0QzgH2i3BD+f2/KTIoccTP3+VHV3bgPDlAyJQ1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HM7/+MXMMNqZGiewUYfX/6JOBc7a+usxXdOjSF5SEKA=; b=O4uAAq0LnG37lM+erZ+8m5A9wdxEDXUEbCEOhDJqYGF8TYvhB+y0d87kbRv3SBoHZlFBH2Sj3iGZ0OJcUSYThE8eCycMbckWIrvDGC1F4g4hLdfqITRT8sBuDv+ptPEqfiF63cb+ufR/GgX1MdyM2ejILUgUEgbDGXNSmt3BW04= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by DM6PR18MB2553.namprd18.prod.outlook.com (2603:10b6:5:189::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.25; Wed, 27 Jul 2022 04:25:32 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::285f:66cc:a533:2ebe]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::285f:66cc:a533:2ebe%9]) with mapi id 15.20.5458.025; Wed, 27 Jul 2022 04:25:32 +0000 From: Akhil Goyal To: Kai Ji , "dev@dpdk.org" CC: Anoob Joseph , "hemant.agrawal@nxp.com" , "Zhang, Roy Fan" , Chandubabu Namburu , Ruifeng Wang , "ajit.khaparde@broadcom.com" , Michael Shamis , Nagadheeraj Rottela , "matan@nvidia.com" , Jay Zhou Subject: RE: [EXT] [dpdk-dev v1] lib/cryptodev: multi-process IPC request handler Thread-Topic: [EXT] [dpdk-dev v1] lib/cryptodev: multi-process IPC request handler Thread-Index: AQHYoUSUm03CEnbBzEOYSpZ7tshzPq2RnMNA Date: Wed, 27 Jul 2022 04:25:32 +0000 Message-ID: References: <20220726230804.90036-1-kai.ji@intel.com> In-Reply-To: <20220726230804.90036-1-kai.ji@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b90e8e37-a0bc-4081-cb16-08da6f880b99 x-ms-traffictypediagnostic: DM6PR18MB2553:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y0sNJg0xX4Jcyzfl5tzjtP8imXzkzU7YJXqAG7e9tipoPfIkAtF7Tco1SqS/uPA5gANNg1EMq9uJiV7FAKpcOxF6ej+GhzlEna+LEn8dQpZyVcNulNXpoGGI/RWJCLL834Sd6mtrDjzJO/j8WHYnpoQj+OW8YsBk4uzXnwOhs35xbwldrjPEEu9IsCxjyqag4rW4jmQxRopteKia0l7LTSJvmpj61oXVuHT+GUogNH07Uo2rCh58p/Wx53i50hf+rMQY5NY8y4hbj30jcMxAKumz4WmlRIBR2je24NlBZ43TsVa2xhbMqXdYjLiUMFYd9c5R9QncZWfttfxCsRWIHVZqtgboXiWLhi7Qxu0IlaihtygA0s/lImUWLXwUexNLAiTyHiwZ57vJjOHK5bsH94KMAJxBH0/ClqPQDr36RaX5aL14f4l8cy42iNvSGfzoMD9XE0gprgHNXPxSbWF3AjVLKDUnzCpwB2P6/6BfismPk6J32RbHitJ0fxCv5bjrIkfv41IrLyo1pX+WDSIr2VU1smDjdbln7MbDZBM15oyfsFR9mR4Bk3IV1pDb5LcuY/OrhEOk//OX5Qom/J7xeWbR/BqYAvpq1zBWL5BM5Rq6N8TUnuJKrQF6Hqqwl4nBrW2KgeCILtTavBV4xYYtavtJew6UD40zcWaohEoM+xrJW2+4ZAL2Mcf44ZoVitTnJ95PjrbegghZ1/LVoS7jF4xuumbT3ZJHLuT29k0/frognzzC4w74Z3Gy+rSpDmGYNMIW2A/yCxh28kY6zQq9uupoEEaWilmmEZ1jB0hnrms= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(39860400002)(136003)(346002)(366004)(76116006)(4326008)(8676002)(66556008)(66446008)(110136005)(66476007)(64756008)(66946007)(33656002)(5660300002)(55016003)(86362001)(54906003)(316002)(8936002)(52536014)(2906002)(38070700005)(186003)(83380400001)(38100700002)(122000001)(71200400001)(9686003)(26005)(478600001)(55236004)(7696005)(6506007)(41300700001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?5kS3XoGOkMSV6r3RppJk0ees/AadheGMDCIPj6Zof5laS7W3Lq289ehWmXRo?= =?us-ascii?Q?dqYICrqupG+vDr+90F6DPhHdh1Tem/Jx0nZIuR9K86PT0WJWzr/3PxYSUv0u?= =?us-ascii?Q?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=?us-ascii?Q?L1kS5NaYc97Cw/iKe8u+FSmNVfn9Yqb6ZtCSNAu3GTrFTsCPNtzse+gKHHma?= =?us-ascii?Q?o8BjjfRzkOprgR0NPp5nsXJ1ci0GEo06h8sbSiZZo+PrPcBwJS2YjcKkwhhL?= =?us-ascii?Q?V55EhHZKoO3lUNDJwC/39F17l49yqP3dOiEFYEJlic33jwcsZRMrqyLHzE/z?= =?us-ascii?Q?GOqDrJF6pobo2jKrV++dgfYSL/ZmQNUu2HsDsApbbOTGNGNiUFuj0ScScKcg?= =?us-ascii?Q?Ap7eKI/8ZnIKQ6m6ti/PeDeGmxfuA31/UwrQfgzjGxj+nefSIGieheHKlpOs?= =?us-ascii?Q?uFprIzOfU8mlJs4DKXQdSzUY7bXcbu5+LfonjWJ1d31ymHRC+rIyI6OLiyyl?= =?us-ascii?Q?NkeU84Ik+igS+AFpWAjMFjWorTikbKlX+SbrARs6sR2s54erzS4Z/78jljLU?= =?us-ascii?Q?0YEP12HePRT7FxKul/WbjjoHkNWVUNCwnMNgQk/fu3o73y/hpJxLSeHAODco?= =?us-ascii?Q?0i3xTzLS+pEBuVRhpyfd4rn13TLMqCe5eQfH3m0uYxzR21dn67+6QbS4pi6X?= =?us-ascii?Q?46BbNYo6OukaYrRD61UvR0Tm1sGS8F7FDKOhtlCM?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b90e8e37-a0bc-4081-cb16-08da6f880b99 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Jul 2022 04:25:32.6585 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pDKwqJbcLNdwoKzqOm235CAUn7LJk+KLnQrtljDfZEQC7evDfmf/HNmzmNXPJhU8WmgbijJiHy727ucqOqXiBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR18MB2553 X-Proofpoint-GUID: zfUOCoFNvd3UAdDpNrmGH1JHnaqWgWCB X-Proofpoint-ORIG-GUID: zfUOCoFNvd3UAdDpNrmGH1JHnaqWgWCB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-26_07,2022-07-26_01,2022-06-22_01 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 This is a library change you should cc all PMD owners while sending patch. > This patch add in multi-process IPC request handler function in rte > cryptodev. This function intend to support a queue-pair configuration > request to allow the secondary process to reconfigure the queue-pair > setup'ed by the primary process. Who will release the queue pair already setup by primary in the first place= ? Currently, all queues are setup by primary and secondary uses them. So if a queue is re-initialized by secondary, and if it is being used in pr= imary process, Wont that drop packets abruptly if the queue is re-initialized? Also, I see register API but not deregister. >=20 > Signed-off-by: Kai Ji > --- > lib/cryptodev/rte_cryptodev.c | 45 +++++++++++++++++++++++++++++++++++ > lib/cryptodev/rte_cryptodev.h | 14 +++++++++++ > 2 files changed, 59 insertions(+) >=20 > diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.= c > index 42f3221052..18fdbf6db6 100644 > --- a/lib/cryptodev/rte_cryptodev.c > +++ b/lib/cryptodev/rte_cryptodev.c > @@ -1202,6 +1202,51 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, > uint16_t queue_pair_id) > return 0; > } >=20 > +/* crypto queue pair config */ > +#define CRYPTODEV_MP_REQ "cryptodev_mp_request" > + > +static int > +rte_cryptodev_mp_request(const struct rte_mp_msg *mp_msg, const void > *peer) > +{ > + struct rte_mp_msg mp_res; > + struct rte_cryptodev_mp_param *res =3D > + (struct rte_cryptodev_mp_param *)mp_res.param; > + const struct rte_cryptodev_mp_param *param =3D > + (const struct rte_cryptodev_mp_param *)mp_msg->param; > + > + int ret; > + int dev_id =3D 0; > + int port_id =3D 0, socket_id =3D 1; > + struct rte_cryptodev_qp_conf queue_conf; > + queue_conf.nb_descriptors =3D 2; > + > + RTE_ASSERT(rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY); > + switch (param->type) { > + case RTE_CRYPTODEV_MP_REQ_QP: > + ret =3D rte_cryptodev_queue_pair_setup(dev_id, port_id, > + &queue_conf, socket_id); > + res->result =3D ret; > + > + ret =3D rte_mp_reply(&mp_res, peer); > + break; > + default: > + CDEV_LOG_ERR("invalid mp request type\n"); > + return -EINVAL; > + } > + return ret; > + > +} > + > +int rte_cryptodev_mp_request_register(void) > +{ > + int ret; > + > + RTE_ASSERT(rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY); > + ret =3D rte_mp_action_register(CRYPTODEV_MP_REQ, > + rte_cryptodev_mp_request); > + return ret; > +} > + > int > rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, > const struct rte_cryptodev_qp_conf *qp_conf, int socket_id) > diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.= h > index 56f459c6a0..901465ca65 100644 > --- a/lib/cryptodev/rte_cryptodev.h > +++ b/lib/cryptodev/rte_cryptodev.h > @@ -539,6 +539,18 @@ enum rte_cryptodev_event_type { > RTE_CRYPTODEV_EVENT_MAX /**< max value of this enum */ > }; >=20 > +/* Request types for IPC. */ > +enum rte_cryptodev_mp_req_type { > + RTE_CRYPTODEV_MP_REQ_NONE, > + RTE_CRYPTODEV_MP_REQ_QP > +}; > + > +/* Parameters for IPC. */ > +struct rte_cryptodev_mp_param { > + enum rte_cryptodev_mp_req_type type; > + int result; > +}; > + > /** Crypto device queue pair configuration structure. */ > struct rte_cryptodev_qp_conf { > uint32_t nb_descriptors; /**< Number of descriptors per queue pair */ > @@ -744,6 +756,8 @@ rte_cryptodev_stop(uint8_t dev_id); > extern int > rte_cryptodev_close(uint8_t dev_id); >=20 > +extern int rte_cryptodev_mp_request_register(void); > + > /** > * Allocate and set up a receive queue pair for a device. > * > -- > 2.17.1