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 DD7E3A052F; Wed, 29 Jan 2020 18:18:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B97D1BFFC; Wed, 29 Jan 2020 18:18:07 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5D3D71BFEE for ; Wed, 29 Jan 2020 18:18:05 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00THDZAN029748; Wed, 29 Jan 2020 09:18:04 -0800 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=7cRIhvZ3Br+38UiBTiRCuJO6TaCU2U5AxN9/stdnHNo=; b=yX0uOZ20pOPasFWqc+heuh8fvL//hmKRSyaX8v/g2nk9Gx/l2IyI4NXysi8WbtGH2Ixh 2pEWkttLIG5Yh5g2OO9ARJjOudS61Fubon793P9W/Aa6boFGsArTApoymRQWW4lxDOOs qotBuYGAM/JUXBot5XdzzHOxB96tcT0rSL50yyviK4zJbK4tqbtMHMwXiIEbX5ewvkO8 QCBpdRqM3CNMQJNkss8H8f0uMSxLKxTnK9RArUSaK07EycoAlSEkREeTSuUEyjfUDSy5 TR6HUrYBIQwn50DXC4K+cu/Imcjp6HVmbGZb8r+bDM0SscQyvCwmnoFrSSuqBD5qWywr eQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2xrp2ta3md-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 29 Jan 2020 09:18:04 -0800 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 29 Jan 2020 09:18:02 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 29 Jan 2020 09:18:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqgsDHrTZyk4RxEk3/6hN5/blDwCxs6kxka5eXqQspjGaap92zub+YGeYAE2fn5a3xgregba1TpCQ4GvPIt6UyiK+zKVPZ2sQbHmzkIZ4hGDbXP0xGhrT9jlKNg9051nCOjXltsZ6sg5ssBq1n1qn1AR2YBqYKMZScWH1MN64R0KUssU8+PZpUGuGVK46cHckdTvnZ4q9dZ67uWTw4RbM6Lj2ZNRKyJwUk5Jna6ccaIj732a0d6ClAXftxvFIdmSEsp8/Hwxi5tu/S5tgrQUjp/KWjsnbmjN4MzJZc5omkepv4aL+eHrj0sk2BKqjaoYfpPpGVwoRDlxIPf3tWFN5Q== 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=7cRIhvZ3Br+38UiBTiRCuJO6TaCU2U5AxN9/stdnHNo=; b=NLZ70vt17sAUmLoGEGTKIPmUrDqhGlBti28DIE5f4veWiEFfYJ3Tf/18Qe0TI9BPmW1JwJ1+d6TdkGZr0X1kEKUbi7E1lj1joY6Jgm1UwtpWgP3LVrCNDznMYkWqAyXE16mwtUwEXuXu+CPmfYdsAVuUaNdwsGQ1W22MZqaaSqkSPv7Or/84qy6sk16alA6Y/jOxK2q1Rj9qnStI7K+paNWBDM7EezyGJd9Pq3z7ROPrrbHpaj79VYWS2mX8h+prW1QuI5kxn3tPchp9RBqq2CzPCTDbWel0lGtzE7X+Gcj5TkOKLtURZnISSt5UKiDEswMk1xFBHZtoglVhLfzb9A== 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=7cRIhvZ3Br+38UiBTiRCuJO6TaCU2U5AxN9/stdnHNo=; b=NHXRp4pofco7HeqYyQZww+S8RN3Oyiv9i8PDjFzu8A/lHMBQaVn2CR4w6+3hzX6QS4PWIQ9m5XmTjo466vcnuclOao8bvHX5nxuJJMXTCxKc89XVAdLy5YOXGPSnm2I7xcTG4R6YpKQ36cPT7OBLah3d5tOdrV+MyYFtC/Xzom0= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB2960.namprd18.prod.outlook.com (20.179.22.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 17:18:01 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::e48d:494:fc46:3572]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::e48d:494:fc46:3572%7]) with mapi id 15.20.2665.027; Wed, 29 Jan 2020 17:18:01 +0000 From: Anoob Joseph To: "Ananyev, Konstantin" , Akhil Goyal , "Nicolau, Radu" , "Thomas Monjalon" CC: Lukas Bartosik , Jerin Jacob Kollanukkaran , Narayana Prasad Raju Athreya , Ankur Dwivedi , Archana Muniganti , Tejasree Kondoj , "Vamsi Krishna Attunuru" , "dev@dpdk.org" Thread-Topic: [PATCH v2 11/12] examples/ipsec-secgw: add app mode worker Thread-Index: AQHVz5gp6Wo9EByE8EKWpeb08iSvr6gB1BkAgAAcCWA= Date: Wed, 29 Jan 2020 17:18:01 +0000 Message-ID: References: <1575808249-31135-1-git-send-email-anoobj@marvell.com> <1579527918-360-1-git-send-email-anoobj@marvell.com> <1579527918-360-12-git-send-email-anoobj@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.250.227] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f584e9a0-476a-4d4a-393b-08d7a4df31a7 x-ms-traffictypediagnostic: MN2PR18MB2960: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1107; x-forefront-prvs: 02973C87BC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(396003)(366004)(376002)(346002)(136003)(189003)(199004)(76116006)(9686003)(66946007)(7696005)(4326008)(81156014)(81166006)(478600001)(64756008)(66446008)(66476007)(8936002)(66556008)(33656002)(86362001)(71200400001)(110136005)(54906003)(8676002)(6506007)(53546011)(2906002)(52536014)(26005)(186003)(55016002)(316002)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB2960; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; 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: 6pIQeW2dIkngeCV0jMKrlpzpmQFnWkP4AOcQhZRdevCsTv3DjA/WUmgknCyFvKRRu3PGw0IEq9tUY9njP01W7zZJ2+bUdjekAcajxHfh2YRmRJLDPPxj9T236YVvwgGDhr9RCWT+3ESIU02czuDmNHU7vGygsy6dygVbQ9W8tY6XdEeSZDBgFmkmPEPmJdqGr6euBi8eeXfbq+ukT8TGhW7bTN1DiqnKBBsOvCwyhIUlY39ehaHgVLWycEWIhtUxpRwKd6mHkUNo4pKMSSY4sMfyE2Be5iWXDf89SC5RyCjisqOGgQZWnwoJn635PKu2FrzuV5iUVNQmaTgbxSySNZsbOuoYVmPQ4h34UIwrsatilalyrmWbNJ/ekf7a8aLgSanUr/a2Jc4frzTUNeLuWY5tACedprIrPMsZ2m/J00JF2aHiN7NOjNkLk/hk6Cs+ x-ms-exchange-antispam-messagedata: ia+dylAqUlxYgQecnoDZR7U6WHZiWvLUoKWM1pdrefOD9yr+IUHe42Jr15j3DfTFjFKUC2Ly9lYlMyCvoLM7HhTZjrY8LnHj1pw35dRa76TerGtJ4toM8/bdbODUU0HT9MuPcutCsEncj6wqkXer+A== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: f584e9a0-476a-4d4a-393b-08d7a4df31a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Jan 2020 17:18:01.1750 (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: 2gxlTL4Co2wCVmOrAioYjRmL11giZ0uqa+phU/EDMaqk6gCSnKnoBGns+FNalPndrgn/Dr7uF1aoxloze1kAKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2960 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-01-29_04:2020-01-28, 2020-01-29 signatures=0 Subject: Re: [dpdk-dev] [PATCH v2 11/12] examples/ipsec-secgw: add app mode worker 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 Konstantin, Please see inline. Thanks, Anoob > -----Original Message----- > From: Ananyev, Konstantin > Sent: Wednesday, January 29, 2020 9:05 PM > To: Anoob Joseph ; Akhil Goyal ; > Nicolau, Radu ; Thomas Monjalon > > Cc: Lukas Bartosik ; Jerin Jacob Kollanukkaran > ; Narayana Prasad Raju Athreya > ; Ankur Dwivedi ; Archana > Muniganti ; Tejasree Kondoj > ; Vamsi Krishna Attunuru ; > dev@dpdk.org > Subject: [EXT] RE: [PATCH v2 11/12] examples/ipsec-secgw: add app mode > worker >=20 > External Email >=20 > ---------------------------------------------------------------------- > > Add application inbound/outbound worker thread and IPsec application > > processing code for event mode. > > > > Exampple ipsec-secgw command in 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-gcm.cfg --transfer-mode event --schedule-type parallel > > > > Signed-off-by: Anoob Joseph > > Signed-off-by: Ankur Dwivedi > > Signed-off-by: Lukasz Bartosik > > --- > > examples/ipsec-secgw/ipsec-secgw.c | 45 +--- > > examples/ipsec-secgw/ipsec-secgw.h | 69 ++++++ > > examples/ipsec-secgw/ipsec.h | 22 -- > > examples/ipsec-secgw/ipsec_worker.c | 418 > > +++++++++++++++++++++++++++++++++++- > > examples/ipsec-secgw/ipsec_worker.h | 39 ++++ > > 5 files changed, 533 insertions(+), 60 deletions(-) create mode > > 100644 examples/ipsec-secgw/ipsec_worker.h > > > > diff --git a/examples/ipsec-secgw/ipsec-secgw.c > > b/examples/ipsec-secgw/ipsec-secgw.c > > index 86215fb..7d844bb 100644 > > --- a/examples/ipsec-secgw/ipsec-secgw.c > > +++ b/examples/ipsec-secgw/ipsec-secgw.c > > @@ -50,12 +50,11 @@ > > > > #include "event_helper.h" > > #include "ipsec.h" > > +#include "ipsec_worker.h" > > #include "parser.h" > > > > volatile bool force_quit; > > > > -#define RTE_LOGTYPE_IPSEC RTE_LOGTYPE_USER1 > > - > > #define MAX_JUMBO_PKT_LEN 9600 > > > > #define MEMPOOL_CACHE_SIZE 256 > > @@ -85,29 +84,6 @@ volatile bool force_quit; static uint16_t nb_rxd = =3D > > IPSEC_SECGW_RX_DESC_DEFAULT; static uint16_t nb_txd =3D > > IPSEC_SECGW_TX_DESC_DEFAULT; > > > > -#if RTE_BYTE_ORDER !=3D RTE_LITTLE_ENDIAN -#define > __BYTES_TO_UINT64(a, > > b, c, d, e, f, g, h) \ > > - (((uint64_t)((a) & 0xff) << 56) | \ > > - ((uint64_t)((b) & 0xff) << 48) | \ > > - ((uint64_t)((c) & 0xff) << 40) | \ > > - ((uint64_t)((d) & 0xff) << 32) | \ > > - ((uint64_t)((e) & 0xff) << 24) | \ > > - ((uint64_t)((f) & 0xff) << 16) | \ > > - ((uint64_t)((g) & 0xff) << 8) | \ > > - ((uint64_t)(h) & 0xff)) > > -#else > > -#define __BYTES_TO_UINT64(a, b, c, d, e, f, g, h) \ > > - (((uint64_t)((h) & 0xff) << 56) | \ > > - ((uint64_t)((g) & 0xff) << 48) | \ > > - ((uint64_t)((f) & 0xff) << 40) | \ > > - ((uint64_t)((e) & 0xff) << 32) | \ > > - ((uint64_t)((d) & 0xff) << 24) | \ > > - ((uint64_t)((c) & 0xff) << 16) | \ > > - ((uint64_t)((b) & 0xff) << 8) | \ > > - ((uint64_t)(a) & 0xff)) > > -#endif > > -#define ETHADDR(a, b, c, d, e, f) (__BYTES_TO_UINT64(a, b, c, d, e, > > f, 0, 0)) > > - > > #define ETHADDR_TO_UINT64(addr) __BYTES_TO_UINT64( \ > > (addr)->addr_bytes[0], (addr)->addr_bytes[1], \ > > (addr)->addr_bytes[2], (addr)->addr_bytes[3], \ @@ -119,18 > +95,6 @@ > > static uint16_t nb_txd =3D IPSEC_SECGW_TX_DESC_DEFAULT; > > > > #define MTU_TO_FRAMELEN(x) ((x) + RTE_ETHER_HDR_LEN + > RTE_ETHER_CRC_LEN) > > > > -/* port/source ethernet addr and destination ethernet addr */ -struct > > ethaddr_info { > > - uint64_t src, dst; > > -}; > > - > > -struct ethaddr_info ethaddr_tbl[RTE_MAX_ETHPORTS] =3D { > > - { 0, ETHADDR(0x00, 0x16, 0x3e, 0x7e, 0x94, 0x9a) }, > > - { 0, ETHADDR(0x00, 0x16, 0x3e, 0x22, 0xa1, 0xd9) }, > > - { 0, ETHADDR(0x00, 0x16, 0x3e, 0x08, 0x69, 0x26) }, > > - { 0, ETHADDR(0x00, 0x16, 0x3e, 0x49, 0x9e, 0xdd) } > > -}; > > - > > struct flow_info flow_info_tbl[RTE_MAX_ETHPORTS]; > > > > #define CMD_LINE_OPT_CONFIG "config" > > @@ -183,6 +147,13 @@ static const struct option lgopts[] =3D { > > {NULL, 0, 0, 0} > > }; > > > > +struct ethaddr_info ethaddr_tbl[RTE_MAX_ETHPORTS] =3D { > > + { 0, ETHADDR(0x00, 0x16, 0x3e, 0x7e, 0x94, 0x9a) }, > > + { 0, ETHADDR(0x00, 0x16, 0x3e, 0x22, 0xa1, 0xd9) }, > > + { 0, ETHADDR(0x00, 0x16, 0x3e, 0x08, 0x69, 0x26) }, > > + { 0, ETHADDR(0x00, 0x16, 0x3e, 0x49, 0x9e, 0xdd) } }; > > + > > /* mask of enabled ports */ > > static uint32_t enabled_port_mask; > > static uint64_t enabled_cryptodev_mask =3D UINT64_MAX; diff --git > > a/examples/ipsec-secgw/ipsec-secgw.h > > b/examples/ipsec-secgw/ipsec-secgw.h > > index 5b19e29..926ce5d 100644 > > --- a/examples/ipsec-secgw/ipsec-secgw.h > > +++ b/examples/ipsec-secgw/ipsec-secgw.h > > @@ -4,10 +4,79 @@ > > #ifndef _IPSEC_SECGW_H_ > > #define _IPSEC_SECGW_H_ > > > > +#include > > + > > +#define NB_SOCKETS 4 > > + > > +#define MAX_PKT_BURST 32 > > + > > +#define RTE_LOGTYPE_IPSEC RTE_LOGTYPE_USER1 > > + > > #define NB_SOCKETS 4 >=20 > Duplicate, NB_SOCKETS already defined, see above. [Anoob] Good catch. Will fix in v3. =20 >=20 > > > > #define UNPROTECTED_PORT(portid) (unprotected_port_mask & (1 << > > portid)) >=20 > As you are moving it anyway probably a good time to put portid param in (= ), or > even make it a static inline function. [Anoob] I would prefer a static inline function. Shall I make this change i= n v3? =20 >=20 > > > > +#if RTE_BYTE_ORDER !=3D RTE_LITTLE_ENDIAN #define > __BYTES_TO_UINT64(a, > > +b, c, d, e, f, g, h) \ > > + (((uint64_t)((a) & 0xff) << 56) | \ > > + ((uint64_t)((b) & 0xff) << 48) | \ > > + ((uint64_t)((c) & 0xff) << 40) | \ > > + ((uint64_t)((d) & 0xff) << 32) | \ > > + ((uint64_t)((e) & 0xff) << 24) | \ > > + ((uint64_t)((f) & 0xff) << 16) | \ > > + ((uint64_t)((g) & 0xff) << 8) | \ > > + ((uint64_t)(h) & 0xff)) > > +#else > > +#define __BYTES_TO_UINT64(a, b, c, d, e, f, g, h) \ > > + (((uint64_t)((h) & 0xff) << 56) | \ > > + ((uint64_t)((g) & 0xff) << 48) | \ > > + ((uint64_t)((f) & 0xff) << 40) | \ > > + ((uint64_t)((e) & 0xff) << 32) | \ > > + ((uint64_t)((d) & 0xff) << 24) | \ > > + ((uint64_t)((c) & 0xff) << 16) | \ > > + ((uint64_t)((b) & 0xff) << 8) | \ > > + ((uint64_t)(a) & 0xff)) > > +#endif > > + > > +#define ETHADDR(a, b, c, d, e, f) (__BYTES_TO_UINT64(a, b, c, d, e, > > +f, 0, 0)) > > + > > +struct traffic_type { > > + const uint8_t *data[MAX_PKT_BURST * 2]; > > + struct rte_mbuf *pkts[MAX_PKT_BURST * 2]; > > + void *saptr[MAX_PKT_BURST * 2]; > > + uint32_t res[MAX_PKT_BURST * 2]; > > + uint32_t num; > > +}; > > + > > +struct ipsec_traffic { > > + struct traffic_type ipsec; > > + struct traffic_type ip4; > > + struct traffic_type ip6; > > +}; > > + > > +/* Fields optimized for devices without burst */ struct > > +traffic_type_nb { > > + const uint8_t *data; > > + struct rte_mbuf *pkt; > > + uint32_t res; > > + uint32_t num; > > +}; > > + > > +struct ipsec_traffic_nb { > > + struct traffic_type_nb ipsec; > > + struct traffic_type_nb ip4; > > + struct traffic_type_nb ip6; > > +}; > > + > > +/* port/source ethernet addr and destination ethernet addr */ struct > > +ethaddr_info { > > + uint64_t src, dst; > > +}; > > + > > +struct ethaddr_info ethaddr_tbl[RTE_MAX_ETHPORTS]; > > + > > +/* TODO: All var definitions need to be part of a .c file */ >=20 > Seems like that TODO wasn't done :) > Probably a good thing to add extern for all global vars declarations here= , and > keep actual definitions in ipsec-secgw.c. > Same story for: > +struct socket_ctx socket_ctx[NB_SOCKETS]; > in ipsec.h [Anoob] Will do in v3. =20 >=20 > > + > > /* Port mask to identify the unprotected ports */ uint32_t > > unprotected_port_mask; > >