From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 579E4A0C43; Fri, 8 Oct 2021 20:46:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2450140688; Fri, 8 Oct 2021 20:46:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7F12940685 for ; Fri, 8 Oct 2021 20:46:27 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 198G9IZ5015267; Fri, 8 Oct 2021 11:46:26 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2046.outbound.protection.outlook.com [104.47.51.46]) by mx0a-0016f401.pphosted.com with ESMTP id 3bjs8nrhq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 08 Oct 2021 11:46:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PH3ZCrVkKwzDwsiqEixSIMLYI0heCjYaOQ/ROp5QKub3r/fEORJ8fm0AJk6gF1u0IbZhka7FA8CBlR6Lgm2Hss8+koTOj5b90YH/pwQftCpdee3Ewb049u/qkNng+dcgasYQdhlsQp/G0kMS/Qc/Sknou1vTGcW5qHDYuSyTuc/spbjFMlLqncbdcWSN/HqevTLQJcfFLe8ORAFbcsLROrdbmkUb+lkAKqJkm97UTCL2bJpZfpUMlwIvJnmyUSRzcHw1YuJIzFHaQeob4CWUYIYWj1QoMHudqGrjP98HWPqe7MM8Yj76+jIDg/IZ7V9bvjFm/NRR6kUMQYU2mBG4Nw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Wfu4njJJjs1aPW51Dp1QCv0PqXAvoYRBPabfRT3Ztxc=; b=io8el8SJCpWYL9D5JUrPbHqwuUWuz2+jI0/wUD/k4kDkPZeL9mt/VjzJuGMqiCGtOUXxndkNAFNVI20gNo4M2XoLeacTxT8Pl1/rtTZ0lFQBW5JMhlos3Ag6ipI72vS7huuNGvcVuR9Mb4hZBTjKb6xtMcNNqRMJGQ+jykN+/ceZch9kgvqjUFObimdfcCYjTaslL0AUCx0SUgxOeADBsGb6NaiyVyI3fKKS1dI2YhAMFWoC+idOHj/ND0V6XtC+W6l+kmhTSu5T6w/Yq6WGD8PjJfa7PpKbTXGJzVSib6C5JwBds+lDsXeMWv+dySOkq2iH9Evv0xkcGxRw0yyIRw== 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=Wfu4njJJjs1aPW51Dp1QCv0PqXAvoYRBPabfRT3Ztxc=; b=BiESAqKIxfrptZ7Bhe1bfUcnFZt53OwDwh3ALmFGuU4/RcrKPyWTs05rRJIsxAQ+Et9tyPaSw7ZOQMMfNO/Dby6isrDIXmCXobUhDAK4aX1Yjvo8QkGWPx/Z4+Mro0Sdr+pAPAW8wq1MQ2YGXNEB/0sqFo4DNy9DjBUJUq1vr40= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4652.namprd18.prod.outlook.com (2603:10b6:303:e7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.22; Fri, 8 Oct 2021 18:46:22 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%8]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 18:46:22 +0000 From: Akhil Goyal To: Radu Nicolau CC: "dev@dpdk.org" , "declan.doherty@intel.com" , "hemant.agrawal@oss.nxp.com" Thread-Topic: [EXT] [PATCH v3 4/8] examples/ipsec-secgw: add support for TSO Thread-Index: AQHXtqu2Vu5uIcbOp0q64a4zfhd/XKvJezlA Date: Fri, 8 Oct 2021 18:46:22 +0000 Message-ID: References: <20210903112257.303961-1-radu.nicolau@intel.com> <20211001095202.3343782-1-radu.nicolau@intel.com> <20211001095202.3343782-5-radu.nicolau@intel.com> In-Reply-To: <20211001095202.3343782-5-radu.nicolau@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fcee092d-5dc7-4a83-b475-08d98a8beccd x-ms-traffictypediagnostic: CO1PR18MB4652: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w4WsztCPcL9kJNZLsZcxM4mflX9YJFC/u5zRaSh4HJsuL/ea+3XnCRLsQLtqUvDTByyTNBX9lC51lrTbQkg91hHHEWV0K1J/9/MOxiMuGcShB+Ol2b0FagGCgvwPC8ts5Lf7k8mz1BLENRiTMYVWj5d2UXTeQJ96nSPss1Z2ShIqcElAXM2UhmmNLYg35yuWq5Gj9sXtw2wjePsQKNoH+CHIU5cS7HbbGhNmlPww2WalJCZHbyB7go8AunhkxWQfd40haMyhR75n0yezi6zG+JBSYJNKfuwGComf0k7+mgx2yLNeCI+QPycEn+GBJWfEnr/7/uBaAJxw/0Ofh/ugPXlnXFRvZxwmasvv9WX5B1C/ClxxqZlLWxsb2gJrdX9O5GTfhmo6or/0p+7gDUhc4DS09JMDWTqoR1juP6oQ7OS1bgWlc1UdOkjIFTZFS3BA+ajCogZR9c/LmPqUe/aeWqBpfy2u7Dao5Yu9e/0ddZd1mUEWG23LWqoIXKwmKVCN3+ocLpHEJulxy5x1RWXH4OwJXd7hZ0ofn9qrswzO+NAmk6UwHCe70kEx/+S+K+5xonw8r6ZxIWBdgE8fDQbrol1ovr3uXCrjUBlTP9EkAMUHpTTuqa8igNI4/fLo5l92MaGDhMdbRxGkPez2ODXnOikBihZeNa3cpALXgj9x68OwGffNWHBzYaFZ3UKmCfpATYS+7iyj4D+yJyHyKAtmuw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(4326008)(2906002)(6506007)(76116006)(54906003)(7696005)(66556008)(6916009)(66476007)(66946007)(71200400001)(8936002)(52536014)(66446008)(26005)(5660300002)(55236004)(186003)(8676002)(508600001)(38070700005)(38100700002)(83380400001)(86362001)(64756008)(122000001)(33656002)(9686003)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yyWTiLqoTRwZcLelQRpAZR9exP/dk+C2N3eCakzkCMZNeQ0EuZB/0G4/5zz3?= =?us-ascii?Q?DKf93vbK3DbPXNW7tKm/o/bk7XG/agguKAehdc0oQlEnbwpJPNo0YdOk+rij?= =?us-ascii?Q?ZVToxeSrhHQWoCUImuMp+btK5NZJ6RkukgPtnDkgKufSMvMYBabyA1vX/+Bs?= =?us-ascii?Q?NipjEUxVdgMmtlM2m5flmd/i2kfQX+nql9cI/Zju7WgwzF0/t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AuwQ91N6y82nBUWPKLCIgncgC/klJA+9S7bqt+5UEa3b?= =?us-ascii?Q?LelAFt43y94vzDWAiDeVSjjwBDoyEnpeuKrCCi+pNQDDxE7uniPvHn8HH7Qh?= =?us-ascii?Q?Z6beEwygIQE4x+Sp2k7yI759zbPcz2Om44gX1ZCB6MWYLrXq6UXS/Ue+jhho?= =?us-ascii?Q?6B4kcmvPomG3ES2BY/C0/UwJBBnvm+VUM+K9tTumUq7hqLANfNnuDHAC4Ub/?= =?us-ascii?Q?/oO1be7j63gfU5mMyXuOcreC?= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fcee092d-5dc7-4a83-b475-08d98a8beccd X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2021 18:46:22.6770 (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: 1C7bQFPBWOUNGqKA8hyTYF6fkxkwoIM3vhCGbhBFqBwp9IZpV+f1PqaWUIQR1bKaEPD/fvlzV26PWZHiBR0/6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4652 X-Proofpoint-GUID: sZ1OxJa6-so8eU7eAS4A41lSAlWmidQd X-Proofpoint-ORIG-GUID: sZ1OxJa6-so8eU7eAS4A41lSAlWmidQd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-08_05,2021-10-07_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v3 4/8] examples/ipsec-secgw: add support for TSO X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > Add support to allow user to specific MSS for TSO offload on a per SA > basis. MSS configuration in the context of IPsec is only supported for > outbound SA's in the context of an inline IPsec Crypto offload. >=20 > Signed-off-by: Declan Doherty > Signed-off-by: Radu Nicolau > --- > doc/guides/sample_app_ug/ipsec_secgw.rst | 10 ++++++++++ > examples/ipsec-secgw/ipsec-secgw.c | 4 ++++ > examples/ipsec-secgw/ipsec.h | 1 + > examples/ipsec-secgw/ipsec_process.c | 2 ++ > examples/ipsec-secgw/sa.c | 12 ++++++++++++ > 5 files changed, 29 insertions(+) I think it is worth mentioning in release notes for this feature. >=20 > diff --git a/doc/guides/sample_app_ug/ipsec_secgw.rst > b/doc/guides/sample_app_ug/ipsec_secgw.rst > index 846cf2b81a..cf7a94f58a 100644 > --- a/doc/guides/sample_app_ug/ipsec_secgw.rst > +++ b/doc/guides/sample_app_ug/ipsec_secgw.rst > @@ -725,6 +725,16 @@ where each options means: >=20 > * *udp-encap* >=20 > + ```` > + > + * Maximum segment size for TSO offload, available for egress SAs only. > + > + * Optional: Yes, TSO offload not set by default > + > + * Syntax: > + > + * *mss N* N is the segment size Specify units as well. N is the segment size in bytes > + > Example SA rules: >=20 > .. code-block:: console > diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec- > secgw/ipsec-secgw.c > index 1d30f39450..3da520ec6e 100644 > --- a/examples/ipsec-secgw/ipsec-secgw.c > +++ b/examples/ipsec-secgw/ipsec-secgw.c > @@ -399,6 +399,10 @@ prepare_one_packet(struct rte_mbuf *pkt, struct > ipsec_traffic *t) > pkt->l2_len =3D 0; > pkt->l3_len =3D sizeof(*iph4); > pkt->packet_type |=3D RTE_PTYPE_L3_IPV4; > + if (pkt->packet_type & RTE_PTYPE_L4_TCP) > + pkt->l4_len =3D sizeof(struct rte_tcp_hdr); > + else > + pkt->l4_len =3D sizeof(struct rte_udp_hdr); If the packet is neither TCP nor UDP then? > } else if (eth->ether_type =3D=3D > rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) { > int next_proto; > size_t l3len, ext_len; > diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h > index 50fb7a8b46..36b1ac9355 100644 > --- a/examples/ipsec-secgw/ipsec.h > +++ b/examples/ipsec-secgw/ipsec.h > @@ -143,6 +143,7 @@ struct ipsec_sa { > enum rte_security_ipsec_sa_direction direction; > uint8_t udp_encap; > uint16_t portid; > + uint16_t mss; > uint8_t fdir_qid; > uint8_t fdir_flag; >=20 > diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec- > secgw/ipsec_process.c > index 5012e1a6a4..fc2a3cbcd1 100644 > --- a/examples/ipsec-secgw/ipsec_process.c > +++ b/examples/ipsec-secgw/ipsec_process.c > @@ -222,6 +222,8 @@ prep_process_group(void *sa, struct rte_mbuf > *mb[], uint32_t cnt) > for (j =3D 0; j !=3D cnt; j++) { > priv =3D get_priv(mb[j]); > priv->sa =3D sa; > + if (priv->sa->mss) > + mb[j]->tso_segsz =3D priv->sa->mss; > } > } >=20 > diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c > index b32c168bcc..3851a900dc 100644 > --- a/examples/ipsec-secgw/sa.c > +++ b/examples/ipsec-secgw/sa.c > @@ -678,6 +678,16 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, > continue; > } >=20 > + if (strcmp(tokens[ti], "mss") =3D=3D 0) { > + INCREMENT_TOKEN_INDEX(ti, n_tokens, status); > + if (status->status < 0) > + return; > + rule->mss =3D atoi(tokens[ti]); > + if (status->status < 0) > + return; > + continue; > + } > + > if (strcmp(tokens[ti], "fallback") =3D=3D 0) { > struct rte_ipsec_session *fb; >=20 > @@ -1326,11 +1336,13 @@ fill_ipsec_sa_prm(struct rte_ipsec_sa_prm > *prm, const struct ipsec_sa *ss, > if (IS_IP4_TUNNEL(ss->flags)) { > prm->ipsec_xform.tunnel.type =3D > RTE_SECURITY_IPSEC_TUNNEL_IPV4; > prm->tun.hdr_len =3D sizeof(*v4); > + prm->tun.hdr_l3_off =3D 0; > prm->tun.next_proto =3D rc; > prm->tun.hdr =3D v4; > } else if (IS_IP6_TUNNEL(ss->flags)) { > prm->ipsec_xform.tunnel.type =3D > RTE_SECURITY_IPSEC_TUNNEL_IPV6; > prm->tun.hdr_len =3D sizeof(*v6); > + prm->tun.hdr_l3_off =3D 0; > prm->tun.next_proto =3D rc; > prm->tun.hdr =3D v6; > } else { Also update print_usage() function with the new options added. Check in other patches also.