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 ADBAFA0569; Thu, 12 Mar 2020 06:32:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DA1E21BFBF; Thu, 12 Mar 2020 06:32:23 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 610EB2BE6 for ; Thu, 12 Mar 2020 06:32:22 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02C5P8KY021396; Wed, 11 Mar 2020 22:32:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=X7WT8OIhQEn1C8AArAS3/Vjk0lFi+g5q6yYnhjt0OlQ=; b=BMaXp5wd6GRS/Ek9m3JXkrBPNg1vSAsE+r843xLcBS8hlO0FWJLwmKtNQq+ZaAC7KogQ 5yRbMt+kZiwGJgH+7qi9SFx9ISb3T4lrsI+fDlWxhBcwMZUWcperWg9VFtD1GLu2AfEL CDnSPkvx4e1g+ZFNvB2EsudIPY+BKNGB6UDBjlnjfj6o4VZUYP87OJYIn1Xc83sBWCGp XX5g0tiX+8c73opdeo6Qlu6Bb33Ngb23P6vsHYwHCFRJMlkpUXQrSDCICqtvjEh8T6j3 D7nL7jAHZNrb4U530su2QNtsAGJ461vT4F/BMab1xaLJQ9W7SdnYLMlzEyI51h1BfVWm QA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2ypstsq481-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 11 Mar 2020 22:32:21 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 11 Mar 2020 22:32:19 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 11 Mar 2020 22:32:19 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iaeO36lD+IAKvhy0sjHo/xH0eEJ06f7qYvkGR81vuRRcJsxfjqjKSIt4ONDrQXTHr6aJ2ip2yOEShe19P1i9o9W8o4cGQqaSnrxje9EPvMQTrbYDaVzspyJ1fjZlI3OThlDAYfsKkqGLU1XfVeLbmLB28nHhzf4tj3kxb9lgwUnCP/DG/2q2M9sqnMiZD1eOcf5pRMcbwIPkA9q+yhGhVRQvDsa/r4jTnsPV5sn8+H0ByyJE4mL6zj1VACLAipcMs0K+QeWi/XBGk90rAdpqyCUIjMh/Wp2kzk+gOgzuR09FnIeYGFldT5Jlzlcj9EvQ3tbyc7mlTJ6O/1cLiln9yQ== 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=X7WT8OIhQEn1C8AArAS3/Vjk0lFi+g5q6yYnhjt0OlQ=; b=JDsd1cWqkk9TUpwWjzsDnyncpsIC8c2BXqlvblFdfZF9V4AEJNLBpfDD7cuQLZNcPX6omAo4gzFTqlulSBI1etH7tp7bLu6GVLTI6YUNjhyvD5ClfQ6GdQ/sQgfXUxq6RAHpnVqapfi5Rkep3Nvm1HKvOXexjb7v5IoK0f/O7lxT4iWpxdfGJ61HCtcq3ZEbSRlbJ4sKhhQgvjP8JLIt4XraNH6GBfsS5BzXlMX4dNMXsLDvIA2fxCfAnESLfjTzHuTYDwvNyKGFO9EghiigH+JSHb+Dq71Q4ZGRDaZzPVmtBPWQ2EdfHr/UEAFsjMDgrDhg26+r86hJfxD5kPOseg== 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=X7WT8OIhQEn1C8AArAS3/Vjk0lFi+g5q6yYnhjt0OlQ=; b=RUW6iWtZpzIH4fuPvW9Qs43n57SnKHlcrMlT58r7TvHjPHRIGfaxE/y0M35eFDdzdFldelRojCJe3zg7qAe/EOFD+K2hi/VERiHwXvV6TRxbDdwlWgJtkPonvU/63bE0IW9j3kr7YkyyaUqZ5ErkB46jBAMZEmKKnuujdxEEPhI= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (2603:10b6:208:3b::26) by MN2PR18MB3248.namprd18.prod.outlook.com (2603:10b6:208:16c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Thu, 12 Mar 2020 05:32:17 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::648f:e7fa:f95e:191b]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::648f:e7fa:f95e:191b%2]) with mapi id 15.20.2793.018; Thu, 12 Mar 2020 05:32:17 +0000 From: Anoob Joseph To: Akhil Goyal CC: Jerin Jacob Kollanukkaran , "Narayana Prasad Raju Athreya" , Ankur Dwivedi , "Archana Muniganti" , Tejasree Kondoj , Vamsi Krishna Attunuru , "dev@dpdk.org" , "Ananyev, Konstantin" , "Lukas Bartosik" , "Nicolau, Radu" , Thomas Monjalon Thread-Topic: [PATCH v5 00/15] add eventmode to ipsec-secgw Thread-Index: AQHV7YmVR5oHWd9MkEC88Mx3MFEw/qg3MBwAgA1TZhA= Date: Thu, 12 Mar 2020 05:32:16 +0000 Message-ID: References: <1582185727-6749-1-git-send-email-lbartosik@marvell.com> <1582820317-7333-1-git-send-email-lbartosik@marvell.com> In-Reply-To: Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [27.34.244.205] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 41f4d1f1-aed9-4bf0-627e-08d7c646ba51 x-ms-traffictypediagnostic: MN2PR18MB3248: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 0340850FCD x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(366004)(136003)(396003)(39860400002)(199004)(30864003)(55016002)(66946007)(52536014)(26005)(66476007)(66446008)(66556008)(7696005)(478600001)(6506007)(5660300002)(53546011)(76116006)(86362001)(33656002)(64756008)(71200400001)(6916009)(9686003)(186003)(81166006)(4326008)(8676002)(2906002)(81156014)(8936002)(316002)(54906003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3248; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tRYEkE0Wtc5tdHfo6GLhJHdfHG9P6IucC48Nf090jy5gTj21Rs7VynFanKHi8Sx1WBocuPQ2WMz6NZbdI+KZOvbIdck86uIor6ouFa5Yw+iBgN4GqPTdmcCHIM7GzsMiprPZxjbhodbcxptZiM20gZBJtxlBmqYgQGYiZ/HZ+YcFrAWm3GjSxVckOlDZJNRRIM+yTyR6k/SSDwddaZMhn6Wj/vFOxnsf++X/2o7gIzDU4lZ3KxHYsQkWzddqkI/wVjLr6naMYvKFl1S2/LMOgGlZe8KNELiuLhzYYzqUa8jtuy+1ZT/sm00GuXVpo+RYmFmtqDMJQ2wJhe5z0wYe3IXJ8I0fk5dOS1GhYbquxKRzgLcm86S0kBvUsfRt2pErVvKyXJZJ/v9EL8PZeAjPF+5ybLUHqjTN87efNaJrVNoR0zDWu2AL1uj6h/22/lSW x-ms-exchange-antispam-messagedata: QwokA0rgkMiZE4DknyNFlpYDoroKBgqCXtavfOWNEhXfWTOvmd1ec/r2gqC7GWziwjM/vK3VHfK0rvlLp2qtqpDP66cnSsW61r6qPwE5nVNgb8rFFJAp1DQzIFao9tG/eaidHG0cdRNr+epOWwh8lg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 41f4d1f1-aed9-4bf0-627e-08d7c646ba51 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2020 05:32:17.0871 (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: RoEyUs0DIXPrkrdLd0leykcvcHrDsupUXhyQ9V51T723L5sJMaO/5ZCSUAZrrVwqnPoJufvA//btUAMYdGKUVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3248 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-11_15:2020-03-11, 2020-03-11 signatures=0 Subject: Re: [dpdk-dev] [PATCH v5 00/15] add eventmode to ipsec-secgw 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 Akhil, Reminder. Do you have any further review comments? Thanks, Anoob > -----Original Message----- > From: Ananyev, Konstantin > Sent: Tuesday, March 3, 2020 11:30 PM > To: Lukas Bartosik ; Akhil Goyal > ; Nicolau, Radu ; Thomas > Monjalon > Cc: Jerin Jacob Kollanukkaran ; Narayana Prasad Raju > Athreya ; Ankur Dwivedi ; > Anoob Joseph ; Archana Muniganti > ; Tejasree Kondoj ; Vamsi > Krishna Attunuru ; dev@dpdk.org > Subject: [EXT] RE: [PATCH v5 00/15] add eventmode to ipsec-secgw >=20 > External Email >=20 > ---------------------------------------------------------------------- >=20 > > > > This series introduces event-mode additions to ipsec-secgw. > > > > With this series, ipsec-secgw would be able to run in eventmode. The > > worker thread (executing loop) would be receiving events and would be > > submitting it back to the eventdev after the processing. This way, > > multicore scaling and h/w assisted scheduling is achieved by making > > use of the eventdev capabilities. > > > > Since the underlying event device would be having varying > > capabilities, the worker thread could be drafted differently to maximiz= e > performance. > > This series introduces usage of multiple worker threads, among which > > the one to be used will be determined by the operating conditions and > > the underlying device capabilities. > > > > For example, if an event device - eth device pair has Tx internal > > port, then application can do tx_adapter_enqueue() instead of regular > > event_enqueue(). So a thread making an assumption that the device pair > > has internal port will not be the right solution for another pair. The > > infrastructure added with these patches aims to help application to > > have multiple worker threads, there by extracting maximum performance > > from every device without affecting existing paths/use cases. > > > > The eventmode configuration is predefined. All packets reaching one > > eth port will hit one event queue. All event queues will be mapped to > > all event ports. So all cores will be able to receive traffic from all = ports. > > When schedule_type is set as RTE_SCHED_TYPE_ORDERED/ATOMIC, event > > device will ensure the ordering. Ordering would be lost when tried in > PARALLEL. > > > > Following command line options are introduced, > > > > --transfer-mode: to choose between poll mode & event mode > > --event-schedule-type: to specify the scheduling type > > (RTE_SCHED_TYPE_ORDERED/ > > RTE_SCHED_TYPE_ATOMIC/ > > RTE_SCHED_TYPE_PARALLEL) > > > > Additionally the event mode introduces two modes of processing packets: > > > > Driver-mode: This mode will have bare minimum changes in the applicatio= n > > to support ipsec. There woudn't be any lookup etc done in > > the application. And for inline-protocol use case, the > > thread would resemble l2fwd as the ipsec processing would = be > > done entirely in the h/w. This mode can be used to benchma= rk > > the raw performance of the h/w. All the application side > > steps (like lookup) can be redone based on the requirement > > of the end user. Hence the need for a mode which would > > report the raw performance. > > > > App-mode: This mode will have all the features currently implemented wi= th > > ipsec-secgw (non librte_ipsec mode). All the lookups etc > > would follow the existing methods and would report numbers > > that can be compared against regular ipsec-secgw benchmark > > numbers. > > > > The driver mode is selected with existing --single-sa option (used > > also by poll mode). When --single-sa option is used in conjution with > > event mode then index passed to --single-sa is ignored. > > > > Example commands to execute ipsec-secgw in various modes on OCTEON TX2 > > platform, > > > > #Inbound and outbound app mode > > ipsec-secgw -w 0002:02:00.0,ipsec_in_max_spi=3D128 -w > > 0002:03:00.0,ipsec_in_max_spi=3D128 -w 0002:0e:00.0 -w 0002:10:00.1 > > --log-level=3D8 -c 0x1 -- -P -p 0x3 -u 0x1 -f aes-gcm.cfg > > --transfer-mode event --event-schedule-type parallel > > > > #Inbound and outbound driver mode > > ipsec-secgw -w 0002:02:00.0,ipsec_in_max_spi=3D128 -w > > 0002:03:00.0,ipsec_in_max_spi=3D128 -w 0002:0e:00.0 -w 0002:10:00.1 > > --log-level=3D8 -c 0x1 -- -P -p 0x3 -u 0x1 -f aes-gcm.cfg > > --transfer-mode event --event-schedule-type parallel --single-sa 0 > > > > This series adds non burst tx internal port workers only. It provides > > infrastructure for non internal port workers, however does not define > > any. Also, only inline ipsec protocol mode is supported by the worker t= hreads > added. > > > > Following are planned features, > > 1. Add burst mode workers. > > 2. Add non internal port workers. > > 3. Verify support for Rx core (the support is added but lack of h/w to = verify). > > 4. Add lookaside protocol support. > > > > Following are features that Marvell won't be attempting. > > 1. Inline crypto support. > > 2. Lookaside crypto support. > > > > For the features that Marvell won't be attempting, new workers can be > > introduced by the respective stake holders. > > > > This series is tested on Marvell OCTEON TX2. > > This series is targeted for 20.05 release. > > > > Changes in v5: > > * Rename function check_params() to check_poll_mode_params() and > > check_eh_conf() to check_event_mode_params() in order to make it clea= r > > what is their purpose. > > * Forbid usage of --config option in event mode. > > * Replace magic numbers on return with enum values in > process_ipsec_ev_inbound() > > and process_ipsec_ev_outbound() functions. > > * Add session_priv_pool for both inbound and outbound configuration in > > ipsec_wrkr_non_burst_int_port_app_mode worker. > > * Add check of event type in ipsec_wrkr_non_burst_int_port_app_mode > worker. > > * Update description of --config option in both ipsec-secgw help and > documentation. > > > > Changes in v4: > > * Update ipsec-secgw documentation to describe the new options as well = as > > event mode support. > > * In event mode reserve number of crypto queues equal to number of eth > ports > > in order to meet inline protocol offload requirements. > > * Add calculate_nb_mbufs() function to calculate number of mbufs in a p= ool > > and include fragments table size into the calculation. > > * Move structures ipsec_xf and ipsec_sad to ipsec.h and remove static > keyword > > from sa_out, nb_sa_out, sa_in and nb_sa_in in sa.c. > > * Update process_ipsec_ev_inbound(), process_ipsec_ev_outbound(), > check_sp() > > and prepare_out_sessions_tbl() functions as a result of changes intro= duced > > by SAD feature. > > * Remove setting sa->cdev_id_qp to 0 in create_inline_session as sa_ctx > > is created with rte_zmalloc. > > * Minor cleanup enhancements: > > - In eh_set_default_conf_eventdev() function in event_helper.c put defi= nition > > of int local vars in one line, remove invalid comment, put > > "eventdev_config->ev_queue_mode =3D RTE_EVENT_QUEUE_CFG_ALL_TYPES" > in one line > > instead of two. > > - Remove extern "C" from event_helper.h. > > - Put local vars in reverse xmas tree order in eh_dev_has_rx_internal_p= ort() > and > > eh_dev_has_tx_internal_port() functions in event_helper.c. > > - Put #include in alphabetical order in ipsec-secgw.c. > > - Move "extern volatile bool force_quit" and "#include " to = ipsec- > secgw.h, > > remove #include . > > - Remove not needed includes in ipsec_worker.c. > > - Remove expired todo from ipsec_worker.h. > > > > Changes in v3: > > * Move eh_conf_init() and eh_conf_uninit() functions to event_helper.c > > including minor rework. > > * Rename --schedule-type option to --event-schedule-type. > > * Replace macro UNPROTECTED_PORT with static inline function > > is_unprotected_port(). > > * Move definitions of global variables used by multiple modules > > to .c files and add externs in .h headers. > > * Add eh_check_conf() which validates ipsec-secgw configuration > > for event mode. > > * Add dynamic calculation of number of buffers in a pool based > > on number of cores, ports and crypto queues. > > * Fix segmentation fault in event mode driver worker which happens > > when there are no inline outbound sessions configured. > > * Remove change related to updating number of crypto queues > > in cryptodevs_init(). The update of crypto queues will be handled > > in a separate patch. > > * Fix compilation error on 32-bit platforms by using userdata instead > > of udata64 from rte_mbuf. > > > > Changes in v2: > > * Remove --process-dir option. Instead use existing unprotected port ma= sk > > option (-u) to decide wheter port handles inbound or outbound traffic= . > > * Remove --process-mode option. Instead use existing --single-sa option > > to select between app and driver modes. > > * Add handling of PKT_RX_SEC_OFFLOAD_FAIL result in app worker thread. > > * Fix passing of req_rx_offload flags to create_default_ipsec_flow(). > > * Move destruction of flows to a location where eth ports are stopped > > and closed. > > * Print error and exit when event mode --schedule-type option is used > > in poll mode. > > * Reduce number of goto statements replacing them with loop constructs. > > * Remove sec_session_fixed table and replace it with locally build > > table in driver worker thread. Table is indexed by port identifier > > and holds first inline session pointer found for a given port. > > * Print error and exit when sessions other than inline are configured > > in event mode. > > * When number of event queues is less than number of eth ports then > > map all eth ports to one event queue. > > * Cleanup and minor improvements in code as suggested by Konstantin > > > > Ankur Dwivedi (1): > > examples/ipsec-secgw: add default rte flow for inline Rx > > > > Anoob Joseph (5): > > examples/ipsec-secgw: add framework for eventmode helper > > examples/ipsec-secgw: add eventdev port-lcore link > > examples/ipsec-secgw: add Rx adapter support > > examples/ipsec-secgw: add Tx adapter support > > examples/ipsec-secgw: add routines to display config > > > > Lukasz Bartosik (9): > > examples/ipsec-secgw: add routines to launch workers > > examples/ipsec-secgw: add support for internal ports > > examples/ipsec-secgw: add event helper config init/uninit > > examples/ipsec-secgw: add eventmode to ipsec-secgw > > examples/ipsec-secgw: add driver mode worker > > examples/ipsec-secgw: add app mode worker > > examples/ipsec-secgw: make number of buffers dynamic > > doc: add event mode support to ipsec-secgw > > examples/ipsec-secgw: reserve crypto queues in event mode > > > > doc/guides/sample_app_ug/ipsec_secgw.rst | 135 ++- > > examples/ipsec-secgw/Makefile | 2 + > > examples/ipsec-secgw/event_helper.c | 1812 > ++++++++++++++++++++++++++++++ > > examples/ipsec-secgw/event_helper.h | 327 ++++++ > > examples/ipsec-secgw/ipsec-secgw.c | 506 +++++++-- > > examples/ipsec-secgw/ipsec-secgw.h | 88 ++ > > examples/ipsec-secgw/ipsec.c | 5 +- > > examples/ipsec-secgw/ipsec.h | 53 +- > > examples/ipsec-secgw/ipsec_worker.c | 649 +++++++++++ > > examples/ipsec-secgw/ipsec_worker.h | 41 + > > examples/ipsec-secgw/meson.build | 6 +- > > examples/ipsec-secgw/sa.c | 21 +- > > examples/ipsec-secgw/sad.h | 5 - > > 13 files changed, 3516 insertions(+), 134 deletions(-) create mode > > 100644 examples/ipsec-secgw/event_helper.c > > create mode 100644 examples/ipsec-secgw/event_helper.h > > create mode 100644 examples/ipsec-secgw/ipsec-secgw.h > > create mode 100644 examples/ipsec-secgw/ipsec_worker.c > > create mode 100644 examples/ipsec-secgw/ipsec_worker.h > > > > -- >=20 > Have to say I didn't look extensively on event mode. > My primary concern was poll-mode and common code changes. > From that perspective - LGTM. >=20 > Series Acked-by: Konstantin Ananyev >=20 > > 2.7.4