From: Akhil Goyal <gakhil@marvell.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <david.marchand@redhat.com>,
<hemant.agrawal@nxp.com>, <vattunuru@marvell.com>,
<ferruh.yigit@xilinx.com>, <andrew.rybchenko@oktetlabs.ru>,
<konstantin.v.ananyev@yandex.ru>, <jiawenwu@trustnetic.com>,
<yisen.zhuang@huawei.com>, <irusskikh@marvell.com>,
<qiming.yang@intel.com>, <jerinj@marvell.com>,
<adwivedi@marvell.com>, Akhil Goyal <gakhil@marvell.com>
Subject: [PATCH 1/3] net: add MACsec header
Date: Mon, 15 Aug 2022 00:16:18 +0530 [thread overview]
Message-ID: <20220814184620.512343-2-gakhil@marvell.com> (raw)
In-Reply-To: <20220814184620.512343-1-gakhil@marvell.com>
Added MACsec protocol header to be used for supporting
MACsec protocol offload in hardware or directly in the application.
Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
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
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)
- **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 = files(
'rte_geneve.h',
'rte_l2tpv2.h',
'rte_ppp.h',
+ 'rte_macsec.h',
)
sources = 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 <rte_byteorder.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* SecTAG length = 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 == RTE_LITTLE_ENDIAN
+ uint8_t short_length : 6; /**< Short Length */
+ uint8_t unused : 2;
+#elif RTE_BYTE_ORDER == 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
next prev parent reply other threads:[~2022-08-14 18:46 UTC|newest]
Thread overview: 166+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 18:46 [PATCH 0/3] security: support MACsec Akhil Goyal
2022-08-14 18:46 ` Akhil Goyal [this message]
2022-09-22 15:29 ` [PATCH 1/3] net: add MACsec header Akhil Goyal
2022-09-26 12:51 ` Olivier Matz
2022-09-26 13:41 ` [EXT] " Akhil Goyal
2022-09-27 8:36 ` Akhil Goyal
2022-08-14 18:46 ` [PATCH 2/3] security: support MACsec Akhil Goyal
2022-09-22 15:37 ` Akhil Goyal
2022-08-14 18:46 ` [PATCH 3/3] ethdev: add MACsec flow item Akhil Goyal
2022-08-15 12:49 ` Ori Kam
2022-09-28 12:22 ` [PATCH v2 0/3] security: support MACsec Akhil Goyal
2022-09-28 12:22 ` [PATCH v2 1/3] net: add MACsec header Akhil Goyal
2022-09-28 13:04 ` Olivier Matz
2022-09-28 13:44 ` Thomas Monjalon
2022-09-28 14:23 ` Ori Kam
2022-09-28 12:22 ` [PATCH v2 2/3] ethdev: add MACsec flow item Akhil Goyal
2022-09-28 12:22 ` [PATCH v2 3/3] security: support MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 0/5] Support and test inline MACsec for cnxk Akhil Goyal
2022-09-28 12:45 ` [PATCH 1/5] common/cnxk: add ROC APIs for MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 2/5] common/cnxk: derive hash key " Akhil Goyal
2022-09-28 12:45 ` [PATCH 3/5] net/cnxk: support MACsec Akhil Goyal
2022-09-28 12:45 ` [PATCH 4/5] test/security: add inline MACsec cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 00/13] Add MACsec unit test cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-05-23 19:49 ` [PATCH 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-05-23 21:29 ` Stephen Hemminger
2023-05-24 7:12 ` [EXT] " Akhil Goyal
2023-05-24 8:09 ` Akhil Goyal
2023-05-23 19:49 ` [PATCH 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-05-23 19:49 ` [PATCH 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-05-23 19:49 ` [PATCH 08/13] test/security: verify MACsec stats Akhil Goyal
2023-05-23 19:49 ` [PATCH 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-05-23 19:49 ` [PATCH 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-05-23 19:49 ` [PATCH 11/13] test/security: verify MACsec Rx rekey Akhil Goyal
2023-05-23 19:49 ` [PATCH 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-05-23 19:49 ` [PATCH 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 00/13] Add MACsec unit test cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-06-07 15:21 ` Akhil Goyal
2023-06-07 19:49 ` David Marchand
2023-06-08 6:58 ` [EXT] " Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 08/13] test/security: verify MACsec stats Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 11/13] test/security: verify MACsec Rx rekey Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-06-07 15:19 ` [PATCH v2 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 00/13] Add MACsec unit test cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 01/13] security: add direction in SA/SC configuration Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 02/13] security: add MACsec packet number threshold Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 03/13] test/security: add inline MACsec cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 04/13] test/security: add MACsec integrity cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 05/13] test/security: verify multi flow MACsec Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 06/13] test/security: add MACsec VLAN cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 07/13] test/security: add MACsec negative cases Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 08/13] test/security: verify MACsec stats Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 09/13] test/security: verify MACsec interrupts Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 10/13] test/security: verify MACsec Tx HW rekey Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 11/13] test/security: verify MACsec Rx rekey Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 12/13] test/security: verify MACsec anti replay Akhil Goyal
2023-06-08 6:54 ` [PATCH v3 13/13] test/security: remove no MACsec support case Akhil Goyal
2023-06-08 17:19 ` [PATCH v3 00/13] Add MACsec unit test cases Akhil Goyal
2022-09-28 12:45 ` [PATCH 5/5] test/security: add more MACsec cases Akhil Goyal
2023-05-23 20:03 ` [PATCH 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-05-23 20:03 ` [PATCH 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-05-26 9:29 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-05-26 10:16 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-05-23 20:03 ` [PATCH 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-05-23 20:03 ` [PATCH 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-05-26 10:20 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-05-23 20:03 ` [PATCH 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-05-23 20:03 ` [PATCH 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-05-23 20:03 ` [PATCH 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-05-26 10:23 ` Jerin Jacob
2023-05-23 20:03 ` [PATCH 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-05-23 20:03 ` [PATCH 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-05-23 20:03 ` [PATCH 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-05-23 20:03 ` [PATCH 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-05-23 20:04 ` [PATCH 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-05-23 20:04 ` [PATCH 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 9:46 ` Jerin Jacob
2023-06-07 15:28 ` [PATCH v2 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-12 15:51 ` Jerin Jacob
2023-06-07 15:28 ` [PATCH v2 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-07 15:28 ` [PATCH v2 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 7:15 ` [PATCH v3 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-13 7:16 ` [PATCH v3 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-13 10:19 ` [PATCH v4 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-13 10:20 ` [PATCH v4 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-13 15:26 ` Jerin Jacob
2023-06-14 13:08 ` [PATCH v5 00/15] net/cnxk: add MACsec support Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 01/15] common/cnxk: add ROC MACsec initialization Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 02/15] common/cnxk: add MACsec SA configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 03/15] common/cnxk: add MACsec SC configuration APIs Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 04/15] common/cnxk: add MACsec secy and flow configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 05/15] common/cnxk: add MACsec PN and LMAC mode configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 06/15] common/cnxk: add MACsec stats Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 07/15] common/cnxk: add MACsec interrupt APIs Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 08/15] common/cnxk: add MACsec port configuration Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 09/15] common/cnxk: add MACsec control " Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 10/15] common/cnxk: add MACsec FIPS mbox Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 11/15] common/cnxk: derive hash key for MACsec Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 12/15] net/cnxk: add MACsec initialization Akhil Goyal
2023-06-14 13:08 ` [PATCH v5 13/15] net/cnxk: create/destroy MACsec SC/SA Akhil Goyal
2023-06-14 13:09 ` [PATCH v5 14/15] net/cnxk: add MACsec session and flow configuration Akhil Goyal
2023-06-14 13:09 ` [PATCH v5 15/15] net/cnxk: add MACsec stats Akhil Goyal
2023-06-15 7:03 ` Jerin Jacob
2022-09-28 12:52 ` [PATCH v2 0/3] security: support MACsec Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 " Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 1/3] net: add MACsec header Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 2/3] ethdev: add MACsec flow item Akhil Goyal
2022-09-28 18:24 ` [PATCH v3 3/3] security: support MACsec Akhil Goyal
2022-09-28 20:04 ` [PATCH v3 0/3] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220814184620.512343-2-gakhil@marvell.com \
--to=gakhil@marvell.com \
--cc=adwivedi@marvell.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@xilinx.com \
--cc=hemant.agrawal@nxp.com \
--cc=irusskikh@marvell.com \
--cc=jerinj@marvell.com \
--cc=jiawenwu@trustnetic.com \
--cc=konstantin.v.ananyev@yandex.ru \
--cc=qiming.yang@intel.com \
--cc=thomas@monjalon.net \
--cc=vattunuru@marvell.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).