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 31D1DA04F6; Tue, 7 Jan 2020 07:17:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 759C21D93C; Tue, 7 Jan 2020 07:17:05 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 8F6941D93B for ; Tue, 7 Jan 2020 07:17:03 +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 0076D3aK022001; Mon, 6 Jan 2020 22:17:02 -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=FhTsFQM8YlWO4eUlxqwJRG6AsKRC4BqhzpSBg1UvhqE=; b=U6PAGM+/vZXvHV4z1Cg1V+s0ovfGO2RcU1x2pz3vzmFDxBP+X17AEbRITMvzPY8UV8hX 94pW/vu/2U5uTx7e+X2KsxwbSqIBJSlSMMwptGabJtrvoMWkWMWd5KpycmdmJPgM37At gXfOAqhNXpi+pLafKu9Rz41LvPz0X8XV5fldXEIfKLHIXDPK63B9vEiXAjH6HmbEs7pi jbyW9pc05j1JtUSFhQxfNoSYURZ8Nku6/2x80O8L0/2kUsf+87zmrtuuZZZMYayLTCqV FM/f3qJlANCQHOUlZK29Tvlt45cAZvPLn0gbQbkxOkcWz8PWGN3Tf9etdtxKsOHpdnT9 aA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2xarxv9a6f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 06 Jan 2020 22:17:02 -0800 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 6 Jan 2020 22:17:01 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 6 Jan 2020 22:17:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AKV3U/5dH7wmoL1oGRtB2xQfRVzv6SDoW0GbOE67Szv14SwjvcE5Yo1eTItO21E0KdBt7vEKNKhOet/wiqqwe8GmJeY7lgQ5k4pHPPFOih9KrnymetRhAM1VGjUm1HkfODBhiIIpLrxogVviYgFmg/mEdBe1TVR2T0XWwtXkAxhUH9kfBMewyq6oU1hTMR+QN43M6cLzFp+VqGQSjnYXJNtypsfg0QzeHAkFdmjQwQdYFWJiuQ7t6PrMm8ngTvsvx4TgJ1fVkOkyMmcc6cSFCPKnI+cbipo4oma4hzzMCX+1x/12GwyXyyfHtIBztuOntZa1p/4I4rl+CQYiVenlfQ== 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=FhTsFQM8YlWO4eUlxqwJRG6AsKRC4BqhzpSBg1UvhqE=; b=dhLzyPmCu4dckVGSwGCG7/KK9nS5UBGEGqIYEW8p+t7nUDGSyiaA/ekPelTq8v0Yq/0Jn7kXLok7ZJajkOQaB8r5NXAoOHlFx2zdGeotm+SFj+83ef/qO7ckUn3iv8E0ca6UTIfpmUgTIi+qUFaT2CTsRJMfSZ6hCT0dfJ9dGHFXXcWYDDCtovLjK9kV5ncpg/12yzv11ySNvrPjHt7M0SqLKshq+YptsLGTmyjy3hazZDWbBAakTmFvGizzDPUT1ra4bG/twTalLOFbvm09UbUu+ruccEI0D5ixpmSjrkdqSvrDz7bJs4A4atwEeXja13jB/hXmq1Ca/j/Ei+Yg7w== 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=FhTsFQM8YlWO4eUlxqwJRG6AsKRC4BqhzpSBg1UvhqE=; b=tzCk+AZ2LT1KaV0+zyrCUM34gr7uvBZIrWiMiJrcuNY7zMktXQ/tkYkoxuO9CsqitEsTq/iDPqUGWRuGPfGzsyYjyUeuoEe16GVR6Xh3S+Db7VI4YB1uZSqa7XCvrdzNjSpnkoG0z35+UP0SBDcWRe8zPUBeKidhEaUJRcE5l4k= Received: from MN2PR18MB2877.namprd18.prod.outlook.com (20.179.20.218) by MN2PR18MB3054.namprd18.prod.outlook.com (20.179.23.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.15; Tue, 7 Jan 2020 06:16:59 +0000 Received: from MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::5db5:d179:8a01:4636]) by MN2PR18MB2877.namprd18.prod.outlook.com ([fe80::5db5:d179:8a01:4636%7]) with mapi id 15.20.2602.016; Tue, 7 Jan 2020 06:16:59 +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 11/14] examples/ipsec-secgw: add app processing code Thread-Index: AQHVrcOH6256wq631EyeHgux2HNSAafLEZ2AgBPWIAA= Date: Tue, 7 Jan 2020 06:16:59 +0000 Message-ID: References: <1575808249-31135-1-git-send-email-anoobj@marvell.com> <1575808249-31135-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.211] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7ea1d196-3e4e-4d2b-a92f-08d79339347f x-ms-traffictypediagnostic: MN2PR18MB3054: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-forefront-prvs: 027578BB13 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(366004)(376002)(346002)(39860400002)(136003)(199004)(189003)(13464003)(2906002)(4326008)(26005)(33656002)(478600001)(8676002)(81156014)(5660300002)(66476007)(66556008)(64756008)(66446008)(81166006)(55016002)(52536014)(9686003)(8936002)(66946007)(54906003)(76116006)(6506007)(53546011)(71200400001)(110136005)(316002)(7696005)(86362001)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR18MB3054; H:MN2PR18MB2877.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: coNWbhNR3FuDYUvOPKLEoY/+QUlav4IdkX20BQNJcxTBVVbUCzKS9r7B5yGuK5WK8so45y+YWhpVf0J0L0hfH7HGLKGerl4RlEShiGCs40FaqxPiKTpPl25Cw9XOCS6pDQCRFEMS52nudWfV9GzcPH5JFRwoFSAHt7Xhw93y3vtNwxTN6tBz63iyly8Wtxf4yPdMIbfuSf8iL9tE+z5eHtPZlkwzvO6gl5tqZz6qmAfuLx8RFQ2E9lHc5vI/yByO9JubMtzZ3kiCfhKBaWpNhQ0bnbBjMYC1viHs7f5AgHpXK77bISh2ItY1L/i83ev8EyNoxIUN9VkqYfVpiqJQ6GIlaKt6X3wbkMwwHK8kpbqEGJY+qHjYTQs5EyNX2JPdLttWgnpA+EFFsUTikQib59vwt+9NFzWjnwSRkBdYIh7nFDxKcH+T5dl6lIm3ycTe954osC5j/Stox2CxnJBnuYd/rO6kmTGYZRrcIGCuGqTKUqC2PS1Mywo3Ied6Ynle Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 7ea1d196-3e4e-4d2b-a92f-08d79339347f X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2020 06:16:59.8535 (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: 8SbeZpYw5uXS7WmMRGG9BBNRPZmCSPYZvqclNE+DdiAen2y8hiA7TrB88SgINZkaoozlX6V12XuPGYgstns+qQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB3054 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2020-01-07_01:2020-01-06,2020-01-07 signatures=0 Subject: Re: [dpdk-dev] [PATCH 11/14] examples/ipsec-secgw: add app processing code 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, December 25, 2019 8:49 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 11/14] examples/ipsec-secgw: add app processing > code >=20 > External Email >=20 > ---------------------------------------------------------------------- >=20 > > +static inline int > > +process_ipsec_ev_inbound(struct ipsec_ctx *ctx, struct route_table *rt= , > > + struct rte_event *ev) > > +{ > > + struct ipsec_sa *sa =3D NULL; > > + struct rte_mbuf *pkt; > > + uint16_t port_id =3D 0; > > + enum pkt_type type; > > + uint32_t sa_idx; > > + uint8_t *nlp; > > + > > + /* Get pkt from event */ > > + pkt =3D ev->mbuf; > > + > > + /* Check the packet type */ > > + type =3D process_ipsec_get_pkt_type(pkt, &nlp); > > + > > + switch (type) { > > + case PKT_TYPE_PLAIN_IPV4: > > + if (pkt->ol_flags & PKT_RX_SEC_OFFLOAD) > > + sa =3D (struct ipsec_sa *) pkt->udata64; >=20 >=20 > Shouldn't packets with PKT_RX_SEC_OFFLOAD_FAIL be handled somehow? [Anoob] Yes. Will fix this in v2. =20 > Another question - as I can see from the code, right now event mode suppo= rts > only inline-proto, correct? > If so, then probably an error should be reported at startup, if in config= file > some other types of sessions were requested. [Anoob] Okay. Will add this in v2. =20 >=20 > > + > > + /* Check if we have a match */ > > + if (check_sp(ctx->sp4_ctx, nlp, &sa_idx) =3D=3D 0) { > > + /* No valid match */ > > + goto drop_pkt_and_exit; > > + } > > + break; > > + > > + case PKT_TYPE_PLAIN_IPV6: > > + if (pkt->ol_flags & PKT_RX_SEC_OFFLOAD) > > + sa =3D (struct ipsec_sa *) pkt->udata64; > > + > > + /* Check if we have a match */ > > + if (check_sp(ctx->sp6_ctx, nlp, &sa_idx) =3D=3D 0) { > > + /* No valid match */ > > + goto drop_pkt_and_exit; > > + } > > + break; > > + > > + default: > > + RTE_LOG(ERR, IPSEC, "Unsupported packet type =3D %d\n", type); > > + goto drop_pkt_and_exit; > > + } > > + > > + /* Check if the packet has to be bypassed */ > > + if (sa_idx =3D=3D 0) > > + goto route_and_send_pkt; > > + > > + /* Else the packet has to be protected with SA */ > > + > > + /* If the packet was IPsec processed, then SA pointer should be set *= / > > + if (sa =3D=3D NULL) > > + goto drop_pkt_and_exit; > > + > > + /* SPI on the packet should match with the one in SA */ > > + if (unlikely(sa->spi !=3D sa_idx)) > > + goto drop_pkt_and_exit; > > + > > +route_and_send_pkt: > > + port_id =3D get_route(pkt, rt, type); > > + if (unlikely(port_id =3D=3D RTE_MAX_ETHPORTS)) { > > + /* no match */ > > + goto drop_pkt_and_exit; > > + } > > + /* else, we have a matching route */ > > + > > + /* Update mac addresses */ > > + update_mac_addrs(pkt, port_id); > > + > > + /* Update the event with the dest port */ > > + ipsec_event_pre_forward(pkt, port_id); > > + return 1; > > + > > +drop_pkt_and_exit: > > + RTE_LOG(ERR, IPSEC, "Inbound packet dropped\n"); > > + rte_pktmbuf_free(pkt); > > + ev->mbuf =3D NULL; > > + return 0; > > +} > > +