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 E9495A0524; Mon, 24 Feb 2020 14:40:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A32981BFA7; Mon, 24 Feb 2020 14:40:24 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60067.outbound.protection.outlook.com [40.107.6.67]) by dpdk.org (Postfix) with ESMTP id 8BAD81F1C for ; Mon, 24 Feb 2020 14:40:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GdRUg+ksH01pD3iFD8qHc3tnAsuXZWxK/6ZVwV1/MEwoPmL5fE3fzc5dcCV/Qa4DDxIItGk7W3ybyO47nnAmyBah9GE/QoA/ybZIyRbnQFQQiSSxai2wczBp2jWXM6desDyDwQTrXH/pXagaR7ZUJ26fma47W+6smqOjwJdkWbXeEH9Vp+Da1swhipN+QY8pNavwnUY9osAnH5Fwi8WlnLhVkhFjJGjNklHRaKxjxnD8fnch5mlhfZT3hUwo7Y0n51h64OCH+XgdplrM8Txslhq/Yxjq98K0kUN7G3Hf+Gg3Omb6eCrj+LazV0VtJgHuff26gSNE5PPHfXKgStovhw== 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=/RRBUVb7wj1+rpKclDmqY7SIba52CEGfqFXUCKvgG6E=; b=GM07xp90AC4w74jmsaBAO05dWM3/y374CKnRfStXBCZ+pcdikPKHxIudEY2NsmFXwZ6JCUhezLg6m2yPu2DlwKhM1Dk7NfztfpipBX+0+TajSzFuBt8/8fW50V8YKz+n/0slNRkUqJxLqC19qSxqTH2wBnTiRwuMKDHdD59owT380VIU/FitzpEWds96/35ziBgpoERzM5qyySeO1WB/CSx5Ix6yac38ib//5/t7c5BuvJv6o1PQVLiRqOuaOZ1MDKcnIZECLX9n3r4t95O0D+XmyocMMTV2w+Nm0np4PaY0QKqmjWMnKaLoqhUSMWaJjeoU1sXtQQqwAvSNZmr9GQ== 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=/RRBUVb7wj1+rpKclDmqY7SIba52CEGfqFXUCKvgG6E=; b=H+ffkTmV++Dga9aJ/4js1y/m7nvvUBYRwaG9yiyWSijxTpKF80lcgAB1WFUXW9ZRlV7r1c3GmOpUSMxwc645a2XnNtD8gRbhVrsdjpalgjCwKgbjIOpEzmKkN42yL5Tl11hqb9cE1aaSBacHFZE1vCYKMQQg5xVRklzQEpyTlok= Received: from VE1PR04MB6639.eurprd04.prod.outlook.com (10.255.118.11) by VE1PR04MB6448.eurprd04.prod.outlook.com (20.179.233.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.22; Mon, 24 Feb 2020 13:40:20 +0000 Received: from VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::25b0:b1ac:aed0:63e1]) by VE1PR04MB6639.eurprd04.prod.outlook.com ([fe80::25b0:b1ac:aed0:63e1%7]) with mapi id 15.20.2750.021; Mon, 24 Feb 2020 13:40:20 +0000 From: Akhil Goyal To: Lukasz Bartosik , Radu Nicolau , Thomas Monjalon CC: Jerin Jacob , Narayana Prasad , Ankur Dwivedi , Anoob Joseph , Archana Muniganti , Tejasree Kondoj , Vamsi Attunuru , Konstantin Ananyev , "dev@dpdk.org" Thread-Topic: [PATCH v4 00/15] add eventmode to ipsec-secgw Thread-Index: AQHV58Qbefh/qzwv10GgN5LQERrVP6gqX1iw Date: Mon, 24 Feb 2020 13:40:19 +0000 Message-ID: References: <1580824721-21527-1-git-send-email-lbartosik@marvell.com> <1582185727-6749-1-git-send-email-lbartosik@marvell.com> In-Reply-To: <1582185727-6749-1-git-send-email-lbartosik@marvell.com> Accept-Language: en-IN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=akhil.goyal@nxp.com; x-originating-ip: [92.120.1.69] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a524efab-e9cb-4294-cbc8-08d7b92f1749 x-ms-traffictypediagnostic: VE1PR04MB6448: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2582; x-forefront-prvs: 032334F434 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(136003)(376002)(396003)(346002)(39860400002)(199004)(189003)(86362001)(186003)(110136005)(2906002)(8676002)(81156014)(81166006)(8936002)(66556008)(66476007)(316002)(52536014)(44832011)(6506007)(7696005)(66446008)(64756008)(5660300002)(76116006)(66946007)(54906003)(9686003)(26005)(7416002)(4326008)(71200400001)(33656002)(478600001)(55016002)(30864003); DIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6448; H:VE1PR04MB6639.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QrM3cbDfsEdlvFaPSMWCpkvvNeRpDdv9XEG/xSWh1SeYue41DE23xeOtyL2tJik2EEBzTseGMEpYSBp2uuGl+QBzbDihMm9Qvvif/0owDTFKUkiMSa1I0ZnJwSz9qTYxMu2JiHCxCTfOuJIxh8AKTKJthH+QsBn36NudZgtICavvvUjbiMXuvoJB4ZeYrxS9X0IImTeNi2GWOZto/kUYN3lRWhdoNVqltwhve32nRiqBmIozGWVYmSFNTcH5Mg4C6WhBl338sEu9uUL+fpRZ8tbzgIjR5vOk1XXxcV1jKfovVGxMfBSDzCVOcXs0deXV4W1/McwVvYRwAIVs2EufwLPXLOzSL7puAuLNSjMMHLAlxAsF0kRiGTk99IJ6B2iEbGje9LZViVYe8vKBUXwwMkgTTx/HS9isSQLALrboMLhZpxej7ZGoSfyYE1nMT+CE x-ms-exchange-antispam-messagedata: FOFFHrlXDJipnpXORr3Xvuxc+ZCUvDRrrDTy7XqDzMpvz3rfWGDD09xQni0tyDyL8qybd6QSyqJP5eW6PHPjBiIVFve/uSegXeo/CBJ8u3dv5IiUxlQDcJyz+oMj2zxa/qWlTmLKAUG2SiFYI09OWw== 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-Network-Message-Id: a524efab-e9cb-4294-cbc8-08d7b92f1749 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Feb 2020 13:40:19.9729 (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: sxREdqyOiFPo3lN2MtfZ7TtL5IXJs/QwgjwtJ7EYZ493YZCap0ge7A0J7yGk7ivOhLikjg9hMG4zeEQIYGbXHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6448 Subject: Re: [dpdk-dev] [PATCH v4 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 Anoob/Lukasz, >=20 > This series introduces event-mode additions to ipsec-secgw. >=20 > 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. >=20 > Since the underlying event device would be having varying capabilities, > the worker thread could be drafted differently to maximize 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. >=20 > 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. >=20 > 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. >=20 > Following command line options are introduced, >=20 > --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) >=20 > Additionally the event mode introduces two modes of processing packets: >=20 > Driver-mode: This mode will have bare minimum changes in the application > 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 benchmark > 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. >=20 > App-mode: This mode will have all the features currently implemented with > 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. >=20 > 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. >=20 > Example commands to execute ipsec-secgw in various modes on OCTEON TX2 > platform, >=20 > #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 --config "(1,0,0),(0,0,0)" -f aes-gc= m.cfg -- > transfer-mode event --event-schedule-type parallel >=20 What is the need of adding the port queue core mapping in case of event. In case of event, all queues are given to eventdev and there is no need for= specifying such specific mapping. In l3fwd also this was not done. > #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 --config "(1,0,0),(0,0,0)" -f aes-gc= m.cfg -- > transfer-mode event --event-schedule-type parallel --single-sa 0 >=20 > This series adds non burst tx internal port workers only. It provides inf= rastructure > for non internal port workers, however does not define any. Also, only in= line > ipsec > protocol mode is supported by the worker threads added. >=20 > 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 ve= rify). > 4. Add lookaside protocol support. >=20 > Following are features that Marvell won't be attempting. > 1. Inline crypto support. > 2. Lookaside crypto support. >=20 > For the features that Marvell won't be attempting, new workers can be > introduced by the respective stake holders. >=20 > This series is tested on Marvell OCTEON TX2. > This series is targeted for 20.05 release. >=20 > 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 po= rts > in order to meet inline protocol offload requirements. > * Add calculate_nb_mbufs() function to calculate number of mbufs in a poo= l > and include fragments table size into the calculation. > * Move structures ipsec_xf and ipsec_sad to ipsec.h and remove static key= word > 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_s= p() > and prepare_out_sessions_tbl() functions as a result of changes introdu= ced > 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 defini= tion > 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_por= t() 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 ip= sec- > secgw.h, > remove #include . > - Remove not needed includes in ipsec_worker.c. > - Remove expired todo from ipsec_worker.h. >=20 > 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. >=20 > Changes in v2: > * Remove --process-dir option. Instead use existing unprotected port mask > 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 >=20 > Ankur Dwivedi (1): > examples/ipsec-secgw: add default rte flow for inline Rx >=20 > 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 >=20 > 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 >=20 > doc/guides/sample_app_ug/ipsec_secgw.rst | 138 ++- > 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 | 463 ++++++-- > 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 | 638 +++++++++++ > examples/ipsec-secgw/ipsec_worker.h | 35 + > examples/ipsec-secgw/meson.build | 6 +- > examples/ipsec-secgw/sa.c | 21 +- > examples/ipsec-secgw/sad.h | 5 - > 13 files changed, 3464 insertions(+), 129 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 > -- > 2.7.4