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 823B8A0543; Thu, 22 Sep 2022 17:29:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DBB640156; Thu, 22 Sep 2022 17:29:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D6BD8400D7 for ; Thu, 22 Sep 2022 17:29:52 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28M7iLWx032195; Thu, 22 Sep 2022 08:29:51 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3jr1qmnnw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 08:29:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WFgnfgrzJ2r+CaQUaQXlP920a45wXcjYrfndaPYoIPleL00K9X/8cCY2bNeyjWcKWk7Z4BNQHQQ2V6gfwLJBmj+X5KnFFTKfMjO05NzGWTNxIklzgcSUqs5pDM52+J7osGJEfq9tcIYtw5UoA63Pzg3dqakor9JnsLeZ+lOJwD2aDFDf7WxVs+fSNqp29iTre9rBNW3Njtv22n6xduwCMDjhfofYmMQIo6vwjfJZsDiJioyyuIZ/8evJPjtcZJ/ogCBG8qL7lLMZECihar5mBdLozbkkfkk6yXr6nuvaVOK0/W5sNIaUK8MYXlYKq/Hf+iKAV54tuATkmCOOmEku1g== 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=o3oSlY4VRTZynf2CQ4qtpzhEHTZJdO/+YS4uCgU/6Pc=; b=Iov2PzFAmSRsYThDVZl3FOxLPD5RQF7FJXWx6iV3V6uLRqvb6/DLWJRyORuVpGIN5sSKZeYtViELUrvrrspxXd90pmZ3aKFfN99bjrBU+rg0S/3S+4Fy16B8s0MwGfzST4LVZOHwFwgs1NI7KGMX6BqJ/FMi4EZyvVclylDz1ezh0ud+0ufX2jNSt9YSU53nTCHkjEvWKi6ih7ylACL77RAdFR8OCROdxzPXNXzh1bxEwfJnvioUROkaDrASZrJC7jnm7I/jVC+MOnr4IYvR8pNUM4dF02/MfYZVBsDQI7i8aspzGLHa9O8S58TdGeA2U2o6PhrqRjNULO971S3gJw== 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=o3oSlY4VRTZynf2CQ4qtpzhEHTZJdO/+YS4uCgU/6Pc=; b=rxAEyOiy8tRpWR/Ylpx5e0NEcKCaQlNRhxt87dfAw5dwm4BQIGxyNsVF/nxDM061Tb95cedQDa8IKnVL3WjBgSrTzu4fvHcYlhg9pkan4LNVUL5gGt15t/veQgwfdFUz+OQvuFdGPFkTf9qICP/bSUvYLWqe3rL5LRMsNHvGy6A= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by SN4PR18MB4994.namprd18.prod.outlook.com (2603:10b6:806:21a::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.17; Thu, 22 Sep 2022 15:29:49 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::7cea:d050:5433:8c74]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::7cea:d050:5433:8c74%7]) with mapi id 15.20.5654.019; Thu, 22 Sep 2022 15:29:49 +0000 From: Akhil Goyal To: Akhil Goyal , "dev@dpdk.org" , Olivier Matz CC: "thomas@monjalon.net" , "david.marchand@redhat.com" , "hemant.agrawal@nxp.com" , Vamsi Krishna Attunuru , "ferruh.yigit@xilinx.com" , "andrew.rybchenko@oktetlabs.ru" , "konstantin.v.ananyev@yandex.ru" , "jiawenwu@trustnetic.com" , "yisen.zhuang@huawei.com" , Igor Russkikh , "qiming.yang@intel.com" , Jerin Jacob Kollanukkaran , Ankur Dwivedi Subject: RE: [PATCH 1/3] net: add MACsec header Thread-Topic: [PATCH 1/3] net: add MACsec header Thread-Index: AQHYsA4wMHSJEwaZ106bweMXXlEcga3rz+HQ Date: Thu, 22 Sep 2022 15:29:49 +0000 Message-ID: References: <20220814184620.512343-1-gakhil@marvell.com> <20220814184620.512343-2-gakhil@marvell.com> In-Reply-To: <20220814184620.512343-2-gakhil@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO6PR18MB4484:EE_|SN4PR18MB4994:EE_ x-ms-office365-filtering-correlation-id: b997fcfe-c793-49d9-0a75-08da9caf4970 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mivGxM0o4RbLmWYhLiWiVs3ThzkB6oWObetsTNYDwlxcTWxY2N2HSKtowyytUzDhxNenN6ZCICA0npx4Oj1etyn8DpI2x9SGTEtKGLcz31jeLFGO7iq/n2yrVPxBmu3p6PsXCExRbyJQ0KbP0I/NtXcvfmlIAMEjtJW4ckw4PbE+v9lTuNYbriFzgPVvAnNyzsD/dx50U+zL8n7z+zo4HzmADdiP5eHHVMMfQiy4sYx8oIx8iLXDb3rfB1kfFbjAxRFeFdkSLchBe5PZO1Rjmq5DWVb+ha9ctteNII35SPJwk8/ljwNhrSwkS7EAipC5Q4vOBLH3iYqNrM7hHEOKAfWtfjxT5LtDnkuLONXmn3pNllGvB7z8OeC6DH32aUhllOP3p/OTa3XfTDIFKO5FuFOrbpd4ciaA+StfGWnBfHlNcN/xuiWKq3ve5nEPI+fhSUKWbbz3HVmGCbt/BLSnRaAKBaFmYrCO9L8vYpfx+FUY/3sgQQnG4WkcN/n8gIYOBb9b0xiLuOgG3AKGC7tRYbuQ+0+NJEemEA41VfewqeISDy4yYmpnPyrntZS6Iwq8ftUeO1fciDIf7kwWriFdVUzlGR3HU00c+BMFELYfaEuq7M13r4b6cdrkQFhpCkZ0CR9u7rRaxa3yAeWPETN4hLKPOlaQeH7/ybC4zOW9zWV7tuHK5s6cY5+qHQHIkxbFQMDpsmePl8j6ihSV0uFhtcsltJjAPxp5EezsJ7lqba5SVOdQGN8ozcBS/QhalVApeMaFf1L4YKhzGN4W9nEVPQ== 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:(13230022)(4636009)(366004)(39860400002)(136003)(346002)(396003)(376002)(451199015)(52536014)(2906002)(5660300002)(66556008)(66946007)(64756008)(8936002)(8676002)(4326008)(66446008)(66476007)(76116006)(33656002)(316002)(38100700002)(478600001)(122000001)(41300700001)(107886003)(55016003)(86362001)(6506007)(54906003)(7696005)(55236004)(38070700005)(71200400001)(26005)(110136005)(9686003)(7416002)(83380400001)(186003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/KQa9Bq4395Cc87MZsMNlu9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=?us-ascii?Q?/KE9GpavH1iVchUCTLVawEcztcoPzrZVVHJskTdw6LEpJOHKQH69djnLAnaR?= =?us-ascii?Q?m3z+7ckHKm9VbzMc+ViN3XhqE6rGrunJREwe4ZaOC29ueCd/ij0YN/cu8X4u?= =?us-ascii?Q?rCghPyAb7xUonu2a/az4QCLF92Vjc+acQy6GCYW5Qy8dnCwRACoMWyoWAEc9?= =?us-ascii?Q?a/oiL5QHJc2DvwUnLpowsgQNcrvk+Rb/MxwwXoFBS6ZwugO5nRSvDsung4Td?= =?us-ascii?Q?c1il3/xkVnfmE02qDC2FopyC148XoeR3tJurANHW9LppkmYK1fK2oB+uz93h?= =?us-ascii?Q?59VLQ8dr7zFEW5s4HtOidbt12iULr3Ty3BNVU8eX6Q7NBRpSuiWLPYUnQNRo?= =?us-ascii?Q?yQFjb6h/lhUde3MhDizq4V0XX7fYg+Ov3IWqAN00ylmghyzSA2WFL2+waiGg?= =?us-ascii?Q?FEeOYbRJbC9TIGJNEGNsozVQDbBeGPaNSDc9pCSktGGNT5LOR6DglfNtxggA?= =?us-ascii?Q?JD+0vtmiRvikAg/5nC7bUHBcYlwIefjT0VXsUCOPLTsX1lkHAv28b0S6C1xb?= =?us-ascii?Q?/dPJm48Y4QKcTnWpX1C+AvVijMOPiJUUeiMtPgxRPpPN4/8yoKUMGgMgQTl5?= =?us-ascii?Q?USDZiO8EFa6x98jRFW0MTHBdDRaCtff2jGgeuHxwCrb5nhgfHhkUo0ehn9c0?= =?us-ascii?Q?Ix3WH4PpVFN/85ZUx8v/zx7aVE3AiYDznwk5ZGy7?= 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: b997fcfe-c793-49d9-0a75-08da9caf4970 X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Sep 2022 15:29:49.1167 (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: 4OInAyxFkoMbNGGsQ+0mqs8i/5d24euHGXUXOi8CCvuqSKba52woiT1yEwtkEHGvtSE5b/k1yf4KO/2C5/3s8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR18MB4994 X-Proofpoint-GUID: a_XPvc6UzNyLX02L3Tp-RABeXmRilK4z X-Proofpoint-ORIG-GUID: a_XPvc6UzNyLX02L3Tp-RABeXmRilK4z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-22_08,2022-09-22_01,2022-06-22_01 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 Hi Olivier, Could you please review this patch?=20 Apologies. I missed to add you earlier. Regards, Akhil > Subject: [PATCH 1/3] net: add MACsec header >=20 > Added MACsec protocol header to be used for supporting > MACsec protocol offload in hardware or directly in the application. >=20 > Signed-off-by: Akhil Goyal > --- > doc/api/doxy-api-index.md | 3 ++- > lib/net/meson.build | 1 + > lib/net/rte_macsec.h | 56 +++++++++++++++++++++++++++++++++++++++ > 3 files changed, 59 insertions(+), 1 deletion(-) > create mode 100644 lib/net/rte_macsec.h >=20 > diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md > index 186a258be4..99e49340d3 100644 > --- a/doc/api/doxy-api-index.md > +++ b/doc/api/doxy-api-index.md > @@ -126,7 +126,8 @@ The public API headers are grouped by topics: > [Geneve](@ref rte_geneve.h), > [eCPRI](@ref rte_ecpri.h), > [L2TPv2](@ref rte_l2tpv2.h), > - [PPP](@ref rte_ppp.h) > + [PPP](@ref rte_ppp.h), > + [MACsec](@ref rte_macsec.h) >=20 > - **QoS**: > [metering](@ref rte_meter.h), > diff --git a/lib/net/meson.build b/lib/net/meson.build > index e899846578..3e63abaca8 100644 > --- a/lib/net/meson.build > +++ b/lib/net/meson.build > @@ -21,6 +21,7 @@ headers =3D files( > 'rte_geneve.h', > 'rte_l2tpv2.h', > 'rte_ppp.h', > + 'rte_macsec.h', > ) >=20 > sources =3D files( > diff --git a/lib/net/rte_macsec.h b/lib/net/rte_macsec.h > new file mode 100644 > index 0000000000..f1b59253f6 > --- /dev/null > +++ b/lib/net/rte_macsec.h > @@ -0,0 +1,56 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2022 Marvell. > + */ > + > +#ifndef _RTE_MACSEC_H_ > +#define _RTE_MACSEC_H_ > + > +/** > + * @file > + * > + * MACsec-related defines > + */ > + > +#include > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > + > +/* SecTAG length =3D macsec ether header without the optional SCI */ > +#define RTE_MACSEC_TAG_LEN 6 > +#define RTE_MACSEC_SCI_LEN 8 > + > +#define RTE_MACSEC_TCI_VERSION 0x80 /**< Version mask for MACsec. > Should be 0. */ > +#define RTE_MACSEC_TCI_ES 0x40 /**< End station - SCI is not valid */ > +#define RTE_MACSEC_TCI_SC 0x20 /**< SCI present */ > +#define RTE_MACSEC_TCI_SCB 0x10 /**< Secure channel support EPON single > copy broadcast */ > +#define RTE_MACSEC_TCI_E 0x08 /**< User data is encrypted */ > +#define RTE_MACSEC_TCI_C 0x04 /**< User data was changed (because of > encryption) */ > +#define RTE_MACSEC_AN_MASK 0x03 /**< Association number mask in > tci_an */ > +#define RTE_MACSEC_NUM_AN 4 /**< 2 bits for the association > number */ > +#define RTE_MACSEC_SALT_LEN 12 /**< Salt length for MACsec SA */ > + > +/** > + * MACsec Header > + */ > +struct rte_macsec_hdr { > + /* SecTAG */ > + uint8_t tci_an; /**< Tag control information and Association number > of SC */ > +#if RTE_BYTE_ORDER =3D=3D RTE_LITTLE_ENDIAN > + uint8_t short_length : 6; /**< Short Length */ > + uint8_t unused : 2; > +#elif RTE_BYTE_ORDER =3D=3D RTE_BIG_ENDIAN > + uint8_t unused : 2; > + uint8_t short_length : 6; > +#endif > + rte_be32_t packet_number; /**< Packet number to support replay > protection */ > + uint8_t secure_channel_id[8]; /* optional */ > +} __rte_packed; > + > +#ifdef __cplusplus > +} > +#endif > + > +#endif /* RTE_MACSEC_H_ */ > -- > 2.25.1