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 A8C10A052F; Wed, 29 Jan 2020 23:12:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 27B341BFDC; Wed, 29 Jan 2020 23:12:39 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CF0131BFD7 for ; Wed, 29 Jan 2020 23:12:36 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2020 14:12:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,379,1574150400"; d="scan'208";a="316077764" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 29 Jan 2020 14:12:35 -0800 Received: from fmsmsx113.amr.corp.intel.com (10.18.116.7) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Jan 2020 14:12:35 -0800 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX113.amr.corp.intel.com (10.18.116.7) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Jan 2020 14:12:34 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 29 Jan 2020 14:12:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fz5m4Iplj2duHtIQsniFHWkITqV8WxYTJDNMlRuLcOGuxdOr2BgT3GDojrBgN0TY4WFNzDNee42gU4EXEStRDShBji+fuRzRwEvbMOpApyHCgd2eojS4p+SuMgYaUFysjMOFuWLr5sBu266EnZIcJ1jQGQ1Oo8XM7WbjvW6CAaqpgU4Cv9SH9ic02HC1tPwe4cBUgT6ckCWG48as7RsQmcqPDPpuhZamdYqwZ3wL2EME0F8RkduCFOQwnKLu3zCBWTz8fTrG+mer8K0J1XvqN1i/8l/51w8P+AjDevDgzuYASOT+UOt+Eu2P5aI/gBoSfMVhKI7yErAnbvMSGJOHcg== 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=9dbzj4ScuxGjv6qXqXRjzgLqlxb9iSPrnhSyJQwxnb8=; b=aBbOfqs5sXhhIMt6KQOOL2YzSyozDJTQ0KxX3dHRhQ+4ZM/0RqPFWBJw+/LwuLmj6FDQT0xz0c2SY5A86rEnACqUbVsYHscf8kUzyim+4lyy4l+FMRr8ZGhA+qlptH3QNM4ftHMjoxIO4+0Soj2yPPvIrBUm7jqqdiGFex3W1rFeTAYw2li3LfGjOvUpQL+HaJ5HfM7DstgC8kusWW+RCFmb4kAMqzPnX4ncRHkmPyttcJBxyrqqGpkLoVo1aB6qS5M1JjkzJw+kqr2PKJogebWGIcDt/osZYXgeYq2eQssNKN516G90O6msMiLTBGeLE7gRK/a9J5DoEbnsId9UCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9dbzj4ScuxGjv6qXqXRjzgLqlxb9iSPrnhSyJQwxnb8=; b=LbdcDt0MJ1PC677rKDd+mcxd/5DXQFSOoTR0uYTZhiBxfI2btWIgZmKQihBVIQo13vrgV9ZfKEF4AJsS4a8do90wGstlpB/IInTewaPt8NYNu1CqsMCS76+OrHgGf0VYpo3+4GOJMUDEmL5V3sYiMDyG2DSU8493EZKtNct2SpQ= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3136.namprd11.prod.outlook.com (52.135.127.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.24; Wed, 29 Jan 2020 22:12:33 +0000 Received: from SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386]) by SN6PR11MB2558.namprd11.prod.outlook.com ([fe80::4d86:362a:13c3:8386%7]) with mapi id 15.20.2665.027; Wed, 29 Jan 2020 22:12:33 +0000 From: "Ananyev, Konstantin" To: Anoob Joseph , Akhil Goyal , "Nicolau, Radu" CC: Jerin Jacob , Lukasz Bartosik , Narayana Prasad , "dev@dpdk.org" Thread-Topic: [PATCH] examples/ipsec-secgw: increase number of qps to lcore_params Thread-Index: AQHVx8T0p6tfWl36AEO+n9Pp5WnH2agCUR9g Date: Wed, 29 Jan 2020 22:12:33 +0000 Message-ID: References: <1578667598-18942-1-git-send-email-anoobj@marvell.com> In-Reply-To: <1578667598-18942-1-git-send-email-anoobj@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDQwMGJkMDktMmNhNi00MWI4LWI0ZjMtMjYzMTNlMDU0NTk1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiekRETWtOcTFabW43cjM3T3I1M0pxRkRHbERLSHU1YkRUVXQrc2o0QStFd3dBa0hXOGV2aWN6TzB0MDRHK0R2cyJ9 dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.2.0.6 x-ctpclassification: CTP_NT authentication-results: spf=none (sender IP is ) smtp.mailfrom=konstantin.ananyev@intel.com; x-originating-ip: [192.198.151.187] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c1c433a4-05a5-4371-b30b-08d7a5085735 x-ms-traffictypediagnostic: SN6PR11MB3136: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:628; x-forefront-prvs: 02973C87BC x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(136003)(396003)(366004)(376002)(346002)(189003)(199004)(8676002)(186003)(6506007)(4326008)(9686003)(26005)(110136005)(52536014)(81156014)(8936002)(81166006)(54906003)(55016002)(7696005)(71200400001)(5660300002)(86362001)(316002)(66556008)(66946007)(66446008)(76116006)(66476007)(6636002)(64756008)(2906002)(33656002)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3136; H:SN6PR11MB2558.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K359Ji+kR2AMbtTyHuWftZt1Q5FyuyQKLdell5gJztvLvc5CSKN0UHba1O2W8DMmewF+NX5IhHs8WKDQZqqzQ6p4G8ybd8PLs45QEP9m0gb++z00LtK4KbAXDyHbDZvo9NQh6ewjNxGIyYkZaLQu7keZWbW9Utxk2Gid3TL3JA4UQpUVnZ4HOlOgn5k6qCyV9EZL9GVCc9AoGHF7Nz59PabUMAf/aA1FJlWPdxrt4vlS7Nb3wVkoGIb1IBzJCsBy/1P9fpojXlN+3vusCJVGFeNeWZcIn6rET5b378xSaujs+7H5RimguCJKe4hBPbNQKGLKgaH21J/jnoFtRj8h+RIB0WWXQ3EnWpASi8rbpgv3Z9vACsB893Kad5TILoOMjhHFL4t5A3H3xpwMa77vAojyf2hHK8/3h97DU7QNws21+TNmmlo3xMdMt5m6p01V x-ms-exchange-antispam-messagedata: o+JYwiwt/2oB9Xwe+s7Nv5HgTif+taE+24zeS0NmhKXLLhkqgr7wBnw6yFMaZz5sToL5MRxyaD44rf+EJg/Ynl8D8g19PIBt42IMkY2RVNLpdxRMBS4/rLnEUgyZDkIuDP7ZUXMHegKXNqtnUjwr/A== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: c1c433a4-05a5-4371-b30b-08d7a5085735 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2020 22:12:33.6023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 92JpAy9NEuclvS939NRlfNRr2qwrZpsm5fhCy2lg1WQcTKnBVAPpDC/PQuVI8Q+yOTfJOEpDxAILWnLSh97M1WtzcoxBmrrROen7qsO46w4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3136 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] examples/ipsec-secgw: increase number of qps to lcore_params 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" >=20 > Currently only one qp will be used for one core. The number of qps can > be increased to match the number of lcore params. I don't really understand the purpose of that patch.... As I understand, all it does - unconditionally increases number of crypto-q= ueues mapped to the same lcore. The question is what for? All these extra queues woulnd't be used by current poll mode data-path anyw= ay. Plus in some cases hash_lookup() would fail to find existing mapping. I understand that for your eventdev implementation you need one crypto queu= e for each eth device. But I think it could be done in less intrusive way (see my previous mail as one possible option). Konstantin =20 >=20 > Signed-off-by: Anoob Joseph > --- > examples/ipsec-secgw/ipsec-secgw.c | 39 +++++++++++++++++++-------------= ------ > examples/ipsec-secgw/ipsec.h | 4 +++- > 2 files changed, 23 insertions(+), 20 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index 3b5aaf6..d8c435e 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -1709,6 +1709,8 @@ add_mapping(struct rte_hash *map, const char *str, = uint16_t cdev_id, > unsigned long i; > struct cdev_key key =3D { 0 }; >=20 > + key.port_id =3D params->port_id; > + key.queue_id =3D params->queue_id; > key.lcore_id =3D params->lcore_id; > if (cipher) > key.cipher_algo =3D cipher->sym.cipher.algo; > @@ -1721,23 +1723,17 @@ add_mapping(struct rte_hash *map, const char *str= , uint16_t cdev_id, > if (ret !=3D -ENOENT) > return 0; >=20 > - for (i =3D 0; i < ipsec_ctx->nb_qps; i++) > - if (ipsec_ctx->tbl[i].id =3D=3D cdev_id) > - break; > - > - if (i =3D=3D ipsec_ctx->nb_qps) { > - if (ipsec_ctx->nb_qps =3D=3D MAX_QP_PER_LCORE) { > - printf("Maximum number of crypto devices assigned to " > - "a core, increase MAX_QP_PER_LCORE value\n"); > - return 0; > - } > - ipsec_ctx->tbl[i].id =3D cdev_id; > - ipsec_ctx->tbl[i].qp =3D qp; > - ipsec_ctx->nb_qps++; > - printf("%s cdev mapping: lcore %u using cdev %u qp %u " > - "(cdev_id_qp %lu)\n", str, key.lcore_id, > - cdev_id, qp, i); > + i =3D ipsec_ctx->nb_qps; > + if (ipsec_ctx->nb_qps =3D=3D MAX_QP_PER_LCORE) { > + printf("Maximum number of crypto devices assigned to a core, " > + "increase MAX_QP_PER_LCORE value\n"); > + return 0; > } > + ipsec_ctx->tbl[i].id =3D cdev_id; > + ipsec_ctx->tbl[i].qp =3D qp; > + ipsec_ctx->nb_qps++; > + printf("%s cdev mapping: lcore %u using cdev %u qp %u " > + "(cdev_id_qp %lu)\n", str, key.lcore_id, cdev_id, qp, i); >=20 > ret =3D rte_hash_add_key_data(map, &key, (void *)i); > if (ret < 0) { > @@ -1785,8 +1781,10 @@ add_cdev_mapping(struct rte_cryptodev_info *dev_in= fo, uint16_t cdev_id, > continue; >=20 > if (i->sym.xform_type =3D=3D RTE_CRYPTO_SYM_XFORM_AEAD) { > - ret |=3D add_mapping(map, str, cdev_id, qp, params, > + ret =3D add_mapping(map, str, cdev_id, qp, params, > ipsec_ctx, NULL, NULL, i); > + if (ret) > + return ret; > continue; > } >=20 > @@ -1801,12 +1799,15 @@ add_cdev_mapping(struct rte_cryptodev_info *dev_i= nfo, uint16_t cdev_id, > if (j->sym.xform_type !=3D RTE_CRYPTO_SYM_XFORM_AUTH) > continue; >=20 > - ret |=3D add_mapping(map, str, cdev_id, qp, params, > + ret =3D add_mapping(map, str, cdev_id, qp, params, > ipsec_ctx, i, j, NULL); > + if (ret) > + return ret; > + continue; > } > } >=20 > - return ret; > + return 0; > } >=20 > /* Check if the device is enabled by cryptodev_mask */ > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index 8e07521..92fd5eb 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -200,7 +200,9 @@ struct ipsec_ctx { > }; >=20 > struct cdev_key { > - uint16_t lcore_id; > + uint16_t port_id; > + uint8_t queue_id; > + uint8_t lcore_id; > uint8_t cipher_algo; > uint8_t auth_algo; > uint8_t aead_algo; > -- > 2.7.4