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 56D07A0524; Fri, 31 Jan 2020 18:39:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8BA0B1C0D7; Fri, 31 Jan 2020 18:39:18 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 5629A1C0CD for ; Fri, 31 Jan 2020 18:39:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 09:39:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,386,1574150400"; d="scan'208";a="377405784" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 31 Jan 2020 09:39:15 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 09:39:15 -0800 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 09:39:14 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 31 Jan 2020 09:39:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kn/4fJ6a631WEtWZmzd1RQGH1qvKPE5ye2aQApWTxq5UPfi6eu9/mLJiag0Y0SbXTY07xIBaVnJJFXLXi/Hz6RWSzzum+8strH5dAfDqZqeTajARfwLXRoseI8uHOzOwe5BS/37LTs9S6dL1DzebyJg3MVpgVZzhqYU7MmOdBPFQUsvGm66RPmpoOMZkEooE59xQDF9m5JkWupnU1fRI3SRxD3eEvjHZtjUWDJ90GtGu0JNO5M9xNxXh7DPRZ+uoWd16t+hZQ61b9EAI+wTLTh9xDG4A7E5g3zP2n4Z27KzNhYIcI7bVkchLLMar0A/uYmKPZikUuXJlKdfkomzjTg== 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=pTvpgLO2920/j4DQBrk1hrHRRHlkXz1YTJCp6EDmiWY=; b=UZ+StDnC+AcfNyuy6qx7lnwLUdRvJCwP3M8sQCnUWTc16dXTGsM85qgxxoHtSKiYjK10RaXJFsMDtgf7Fcm9GOSvTHSQovBa4Lya/Rs6do9Ig0rq3kzi+VSHIrWaJEKXzuhXLGDdNKsOGUPen96aSxwXUIf3wa6lGwMjrqOp3pPVCsBk8W+oj7sZt5H7QQNr8pwCTfjm8jSAQkfgtUXhKfGkTxuYy9aXy4KOvRP7EK3xmpsc3vYFfXVA1/f31k6O38tLsEpyuuISV2kR+N7NlICBPhbmn5K9JFu/JHCeZb7a5XXwFU8EOqHGu7+rXt6c06rqwALQs4u3d/e2dmjwjQ== 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=pTvpgLO2920/j4DQBrk1hrHRRHlkXz1YTJCp6EDmiWY=; b=r06tDgMVM6avNeVVMWsgHR0RLLoyT1OxbLeAeQH0JqBnDC2zzLChRsKVxPpuFG8Idm/khKawxV5QXF+WUH13JwDGz8JH3XQ4N9BbTcQbKiZzwaVDTM1F2sdl4IxRX+mj+XMWH/S6lesNogiqgz7rBvAq6wWZGILeNrIe71nuUes= Received: from SN6PR11MB2558.namprd11.prod.outlook.com (52.135.94.19) by SN6PR11MB3182.namprd11.prod.outlook.com (52.135.110.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.27; Fri, 31 Jan 2020 17:39:12 +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; Fri, 31 Jan 2020 17:39:12 +0000 From: "Ananyev, Konstantin" To: Anoob Joseph , Akhil Goyal , "Nicolau, Radu" CC: Jerin Jacob , Narayana Prasad , Lukasz Bartosik , "dev@dpdk.org" Thread-Topic: [PATCH v2] examples/ipsec-secgw: increase number of qps to lcore_params Thread-Index: AQHV14vl2gPQCa8BFUyRCD7c7KOy6KgFBwZw Date: Fri, 31 Jan 2020 17:39:11 +0000 Message-ID: References: <1578667598-18942-1-git-send-email-anoobj@marvell.com> <1580402318-3307-1-git-send-email-anoobj@marvell.com> In-Reply-To: <1580402318-3307-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMWQ0NmIzZTItZjNiNy00NDhiLWI4NjktOWI3ZTBjMTQ4OThiIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiV3Y5RWhZZ3lpbWFRZmtYSEpkQmtpcW1nVWR4cFBoWno2OGVoaHBLWDVoQzFHVVJQMFIrZ2pFbzNaYVlOXC9wemMifQ== 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: [46.7.38.224] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4c06ea7d-c84a-4c6c-fb8f-08d7a6747bf4 x-ms-traffictypediagnostic: SN6PR11MB3182: 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:1227; x-forefront-prvs: 029976C540 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(396003)(366004)(376002)(136003)(39860400002)(189003)(199004)(110136005)(52536014)(2906002)(26005)(86362001)(6506007)(54906003)(76116006)(316002)(64756008)(66556008)(66476007)(66946007)(9686003)(66446008)(8936002)(55016002)(478600001)(8676002)(5660300002)(186003)(81166006)(33656002)(6636002)(71200400001)(7696005)(81156014)(4326008); DIR:OUT; SFP:1102; SCL:1; SRVR:SN6PR11MB3182; 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: B0kwSjHlvUHJzp5F6rYaSaj8LZOewgzI9fYCM1+p2/0mndMzEc9xfQGFOMY/9vzC93DqZ/mZBLsQ/JZswz4N+RSaQV+/T4hpL2z/orinrPi9tRRRDetc+OUpbdz3tsu66AtZ/G0Bapu+eGwXq2x1yZGGWJtXPPR9ao2xvY7JZ7QXfXeFVS06Jm0wRdt9ogVparU4CdaTmu9bgkrosTixKa9ZF4fu6Rs00Gnq5+WkzuMcUzBOG5N60scoSuOjgOrlvE6TzqjLPqz2/ACMa3ruY1oNE85CcWsSBjuVtPrm8mEm7EOXUt5qhkMEckxrP4E9QO3CloCDQqpyG3VfdBxf1OQ+n2YDeRhL3dyiJ2ZAm71XR81BcH/kK8RwIUnzeykfT3bRQ4cyP563DSKZHKwIsnyKYbPbZfk0XZQ7f2Uu13PV4r2N90YcK6Z+Z+2bks6r x-ms-exchange-antispam-messagedata: VXnZbuwEc84sgZc0fosUYxwaIkpFyC5AprookHNu2vAmMnqi9bzA6F17GIm+w0xTKLgfIHBk7GUyfPF8nKrS74slh8PTPrR/IB12sX+7WR14SOBeePEu2H9xU7ASIlGYNhGNLAU0Kj/GTMg3mJcvxg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4c06ea7d-c84a-4c6c-fb8f-08d7a6747bf4 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2020 17:39:11.9875 (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: +VC/VQpeJIEHe6MCYuDb/YACcVhURDcrLN5HD8jajTqTxV/HkhMmZKnMnx4XEv1UfNlZ9jgLxSEThWTK4RQKnBojPCePkChW8GU49m93SL8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3182 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] 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" > Currently only one qp will be used for one core. The number of qps can > be increased to match the number of lcore params. >=20 > Signed-off-by: Anoob Joseph > Signed-off-by: Lukasz Bartosik > --- > examples/ipsec-secgw/ipsec-secgw.c | 32 ++++++++++++++++++++++---------- > examples/ipsec-secgw/ipsec.c | 13 +++++++------ > examples/ipsec-secgw/ipsec.h | 9 ++++++++- > 3 files changed, 37 insertions(+), 17 deletions(-) >=20 > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ip= sec-secgw.c > index 3b5aaf6..b49dfef 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -72,7 +72,7 @@ >=20 > #define MAX_LCORE_PARAMS 1024 >=20 > -#define UNPROTECTED_PORT(port) (unprotected_port_mask & (1 << portid)) > +#define UNPROTECTED_PORT(port) (unprotected_port_mask & (1 << port)) >=20 > /* > * Configurable number of RX/TX ring descriptors > @@ -968,20 +968,25 @@ route6_pkts(struct rt_ctx *rt_ctx, struct rte_mbuf = *pkts[], uint8_t nb_pkts) > } >=20 > static inline void > -process_pkts(struct lcore_conf *qconf, struct rte_mbuf **pkts, > - uint8_t nb_pkts, uint16_t portid) > +process_pkts(struct lcore_conf *qconf, struct lcore_rx_queue *rx_queue, > + struct rte_mbuf **pkts, uint8_t nb_pkts) > { > struct ipsec_traffic traffic; >=20 > prepare_traffic(pkts, &traffic, nb_pkts); >=20 > + qconf->inbound.port_id =3D rx_queue->port_id; > + qconf->inbound.queue_id =3D rx_queue->queue_id; > + qconf->outbound.port_id =3D rx_queue->port_id; > + qconf->outbound.queue_id =3D rx_queue->queue_id; > + > if (unlikely(single_sa)) { > - if (UNPROTECTED_PORT(portid)) > + if (UNPROTECTED_PORT(rx_queue->port_id)) > process_pkts_inbound_nosp(&qconf->inbound, &traffic); > else > process_pkts_outbound_nosp(&qconf->outbound, &traffic); > } else { > - if (UNPROTECTED_PORT(portid)) > + if (UNPROTECTED_PORT(rx_queue->port_id)) > process_pkts_inbound(&qconf->inbound, &traffic); > else > process_pkts_outbound(&qconf->outbound, &traffic); > @@ -1169,7 +1174,7 @@ main_loop(__attribute__((unused)) void *dummy) > pkts, MAX_PKT_BURST); >=20 > if (nb_rx > 0) > - process_pkts(qconf, pkts, nb_rx, portid); > + process_pkts(qconf, &rxql[i], pkts, nb_rx); >=20 > /* dequeue and process completed crypto-ops */ > if (UNPROTECTED_PORT(portid)) > @@ -1709,6 +1714,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; > @@ -1722,7 +1729,9 @@ add_mapping(struct rte_hash *map, const char *str, = uint16_t cdev_id, > return 0; >=20 > for (i =3D 0; i < ipsec_ctx->nb_qps; i++) > - if (ipsec_ctx->tbl[i].id =3D=3D cdev_id) > + if (ipsec_ctx->tbl[i].id =3D=3D cdev_id && > + ipsec_ctx->tbl[i].port_id =3D=3D key.port_id && > + ipsec_ctx->tbl[i].port_queue_id =3D=3D key.queue_id) I didn't test the patch, but at first glance this approach seems reasonable to me with one main objection - I don't think this new mapping method should become default and only possib= le one. Probably need an extra option to allow user to select, while keeping current mapping method as a default one. Then this option could be translated into some global mask that will be app= lied to cdev_key before add/lookup or so. =20 > break; >=20 > if (i =3D=3D ipsec_ctx->nb_qps) { > @@ -1733,9 +1742,12 @@ add_mapping(struct rte_hash *map, const char *str,= uint16_t cdev_id, > } > ipsec_ctx->tbl[i].id =3D cdev_id; > ipsec_ctx->tbl[i].qp =3D qp; > + ipsec_ctx->tbl[i].port_id =3D key.port_id; > + ipsec_ctx->tbl[i].port_queue_id =3D key.queue_id; > ipsec_ctx->nb_qps++; > - printf("%s cdev mapping: lcore %u using cdev %u qp %u " > - "(cdev_id_qp %lu)\n", str, key.lcore_id, > + printf("%s cdev mapping: lcore %u, portid %u, queueid %u " > + "using cdev %u qp %u (cdev_id_qp %lu)\n", > + str, key.lcore_id, key.port_id, key.queue_id, > cdev_id, qp, i); > } >=20 > @@ -1849,7 +1861,7 @@ cryptodevs_init(void) > rte_panic("Failed to create cdev_map hash table, errno =3D %d\n", > rte_errno); >=20 > - printf("lcore/cryptodev/qp mappings:\n"); > + printf("lcore/portid/queueid/cryptodev/qp mappings:\n"); >=20 > idx =3D 0; > for (cdev_id =3D 0; cdev_id < rte_cryptodev_count(); cdev_id++) { > diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c > index d4b5712..68059d8 100644 > --- a/examples/ipsec-secgw/ipsec.c > +++ b/examples/ipsec-secgw/ipsec.c > @@ -63,6 +63,8 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx, s= truct ipsec_sa *sa, > struct cdev_key key =3D { 0 }; >=20 > key.lcore_id =3D (uint8_t)rte_lcore_id(); > + key.port_id =3D ipsec_ctx->port_id; > + key.queue_id =3D ipsec_ctx->queue_id; >=20 > key.cipher_algo =3D (uint8_t)sa->cipher_algo; > key.auth_algo =3D (uint8_t)sa->auth_algo; > @@ -72,12 +74,11 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx,= struct ipsec_sa *sa, > (void **)&cdev_id_qp); > if (ret < 0) { > RTE_LOG(ERR, IPSEC, > - "No cryptodev: core %u, cipher_algo %u, " > - "auth_algo %u, aead_algo %u\n", > - key.lcore_id, > - key.cipher_algo, > - key.auth_algo, > - key.aead_algo); > + "No cryptodev: core %u, port_id %u, " > + "queue_id %u, cipher_algo %u, auth_algo %u, " > + "aead_algo %u\n", > + key.lcore_id, key.port_id, key.queue_id, > + key.cipher_algo, key.auth_algo, key.aead_algo); > return -1; > } >=20 > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index 8e07521..b76cb50 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -180,6 +180,8 @@ struct cdev_qp { > uint16_t qp; > uint16_t in_flight; > uint16_t len; > + uint16_t port_id; > + uint16_t port_queue_id; > struct rte_crypto_op *buf[MAX_PKT_BURST] __rte_aligned(sizeof(void *)); > }; >=20 > @@ -197,10 +199,15 @@ struct ipsec_ctx { > uint16_t ol_pkts_cnt; > uint64_t ipv4_offloads; > uint64_t ipv6_offloads; > + /* port_id and queue_id are used to select crypto qp */ > + uint16_t port_id; > + uint16_t queue_id; > }; >=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