DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload
@ 2021-08-23 10:02 Akhil Goyal
  2021-08-23 10:18 ` Andrew Rybchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 184+ messages in thread
From: Akhil Goyal @ 2021-08-23 10:02 UTC (permalink / raw)
  To: dev
  Cc: anoobj, radu.nicolau, declan.doherty, hemant.agrawal, matan,
	konstantin.ananyev, thomas, adwivedi, ferruh.yigit,
	andrew.rybchenko, Akhil Goyal

Reassembly is a costly operation if it is done in
software, however, if it is offloaded to HW, it can
considerably save application cycles.
The operation becomes even more costlier if IP fragmants
are encrypted.

To resolve above two issues, a new offload
DEV_RX_OFFLOAD_REASSEMBLY is introduced in ethdev for
devices which can attempt reassembly of packets in hardware.
rte_eth_dev_info is added with the reassembly capabilities
which a device can support.
Now, if IP fragments are encrypted, reassembly can also be
attempted while doing inline IPsec processing.
This is controlled by a flag in rte_security_ipsec_sa_options
to enable reassembly of encrypted IP fragments in the inline
path.

The resulting reassembled packet would be a typical
segmented mbuf in case of success.

And if reassembly of fragments is failed or is incomplete (if
fragments do not come before the reass_timeout), the mbuf is
updated with an ol_flag PKT_RX_REASSEMBLY_INCOMPLETE and
mbuf is returned as is. Now application may decide the fate
of the packet to wait more for fragments to come or drop.

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 lib/ethdev/rte_ethdev.c     |  1 +
 lib/ethdev/rte_ethdev.h     | 18 +++++++++++++++++-
 lib/mbuf/rte_mbuf_core.h    |  3 ++-
 lib/security/rte_security.h | 10 ++++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9d95cd11e1..1ab3a093cf 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -119,6 +119,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER),
 	RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND),
 	RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME),
+	RTE_RX_OFFLOAD_BIT2STR(REASSEMBLY),
 	RTE_RX_OFFLOAD_BIT2STR(SCATTER),
 	RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP),
 	RTE_RX_OFFLOAD_BIT2STR(SECURITY),
diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h
index d2b27c351f..e89a4dc1eb 100644
--- a/lib/ethdev/rte_ethdev.h
+++ b/lib/ethdev/rte_ethdev.h
@@ -1360,6 +1360,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_VLAN_FILTER	0x00000200
 #define DEV_RX_OFFLOAD_VLAN_EXTEND	0x00000400
 #define DEV_RX_OFFLOAD_JUMBO_FRAME	0x00000800
+#define DEV_RX_OFFLOAD_REASSEMBLY	0x00001000
 #define DEV_RX_OFFLOAD_SCATTER		0x00002000
 /**
  * Timestamp is set by the driver in RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
@@ -1477,6 +1478,20 @@ struct rte_eth_dev_portconf {
  */
 #define RTE_ETH_DEV_SWITCH_DOMAIN_ID_INVALID	(UINT16_MAX)
 
+/**
+ * Reassembly capabilities that a device can support.
+ * The device which can support reassembly offload should set
+ * DEV_RX_OFFLOAD_REASSEMBLY
+ */
+struct rte_eth_reass_capa {
+	/** Maximum time in ns that a fragment can wait for further fragments */
+	uint64_t reass_timeout;
+	/** Maximum number of fragments that device can reassemble */
+	uint16_t max_frags;
+	/** Reserved for future capabilities */
+	uint16_t reserved[3];
+};
+
 /**
  * Ethernet device associated switch information
  */
@@ -1582,8 +1597,9 @@ struct rte_eth_dev_info {
 	 * embedded managed interconnect/switch.
 	 */
 	struct rte_eth_switch_info switch_info;
+	/* Reassembly capabilities of a device for reassembly offload */
+	struct rte_eth_reass_capa reass_capa;
 
-	uint64_t reserved_64s[2]; /**< Reserved for future fields */
 	void *reserved_ptrs[2];   /**< Reserved for future fields */
 };
 
diff --git a/lib/mbuf/rte_mbuf_core.h b/lib/mbuf/rte_mbuf_core.h
index bb38d7f581..cea25c87f7 100644
--- a/lib/mbuf/rte_mbuf_core.h
+++ b/lib/mbuf/rte_mbuf_core.h
@@ -200,10 +200,11 @@ extern "C" {
 #define PKT_RX_OUTER_L4_CKSUM_BAD	(1ULL << 21)
 #define PKT_RX_OUTER_L4_CKSUM_GOOD	(1ULL << 22)
 #define PKT_RX_OUTER_L4_CKSUM_INVALID	((1ULL << 21) | (1ULL << 22))
+#define PKT_RX_REASSEMBLY_INCOMPLETE	(1ULL << 23)
 
 /* add new RX flags here, don't forget to update PKT_FIRST_FREE */
 
-#define PKT_FIRST_FREE (1ULL << 23)
+#define PKT_FIRST_FREE (1ULL << 24)
 #define PKT_LAST_FREE (1ULL << 40)
 
 /* add new TX flags here, don't forget to update PKT_LAST_FREE  */
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 88d31de0a6..364eeb5cd4 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -181,6 +181,16 @@ struct rte_security_ipsec_sa_options {
 	 * * 0: Disable per session security statistics collection for this SA.
 	 */
 	uint32_t stats : 1;
+
+	/** Enable reassembly on incoming packets.
+	 *
+	 * * 1: Enable driver to try reassembly of encrypted IP packets for
+	 *      this SA, if supported by the driver. This feature will work
+	 *      only if rx_offload DEV_RX_OFFLOAD_REASSEMBLY is set in
+	 *      inline ethernet device.
+	 * * 0: Disable reassembly of packets (default).
+	 */
+	uint32_t reass_en : 1;
 };
 
 /** IPSec security association direction */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 184+ messages in thread

end of thread, other threads:[~2022-09-27 18:44 UTC | newest]

Thread overview: 184+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 10:02 [dpdk-dev] [PATCH] RFC: ethdev: add reassembly offload Akhil Goyal
2021-08-23 10:18 ` Andrew Rybchenko
2021-08-29 13:14   ` [dpdk-dev] [EXT] " Akhil Goyal
2021-09-21 19:59     ` Thomas Monjalon
2021-09-07  8:47 ` [dpdk-dev] " Ferruh Yigit
2021-09-08 10:29   ` [dpdk-dev] [EXT] " Anoob Joseph
2021-09-13  6:56     ` Xu, Rosen
2021-09-13  7:22       ` Andrew Rybchenko
2021-09-14  5:14         ` Anoob Joseph
2021-09-08  6:34 ` [dpdk-dev] " Xu, Rosen
2021-09-08  6:36   ` Xu, Rosen
2022-01-03 15:08 ` [PATCH 0/8] ethdev: introduce IP " Akhil Goyal
2022-01-03 15:08   ` [PATCH 1/8] " Akhil Goyal
2022-01-11 16:03     ` Ananyev, Konstantin
2022-01-22  7:38     ` Andrew Rybchenko
2022-01-30 16:53       ` [EXT] " Akhil Goyal
2022-01-03 15:08   ` [PATCH 2/8] ethdev: add dev op for IP reassembly configuration Akhil Goyal
2022-01-11 16:09     ` Ananyev, Konstantin
2022-01-11 18:54       ` Akhil Goyal
2022-01-12 10:22         ` Ananyev, Konstantin
2022-01-12 10:32           ` Akhil Goyal
2022-01-12 10:48             ` Ananyev, Konstantin
2022-01-12 11:06               ` Akhil Goyal
2022-01-13 13:31                 ` Akhil Goyal
2022-01-13 14:41                   ` Ananyev, Konstantin
2022-01-03 15:08   ` [PATCH 3/8] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-01-11 17:04     ` Ananyev, Konstantin
2022-01-11 18:44       ` Akhil Goyal
2022-01-12 10:30         ` Ananyev, Konstantin
2022-01-12 10:59           ` Akhil Goyal
2022-01-13 22:29             ` Ananyev, Konstantin
2022-01-13 13:18         ` Akhil Goyal
2022-01-13 14:36           ` Ananyev, Konstantin
2022-01-13 15:04             ` Akhil Goyal
2022-01-03 15:08   ` [PATCH 4/8] security: add IPsec option for " Akhil Goyal
2022-01-03 15:08   ` [PATCH 5/8] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-01-20 16:48     ` [PATCH v2 0/4] app/test: add inline IPsec and reassembly cases Akhil Goyal
2022-01-20 16:48       ` [PATCH v2 1/4] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-01-20 16:48       ` [PATCH v2 2/4] app/test: add IP reassembly case with no frags Akhil Goyal
2022-01-20 16:48       ` [PATCH v2 3/4] app/test: add IP reassembly cases with multiple fragments Akhil Goyal
2022-01-20 16:48       ` [PATCH v2 4/4] app/test: add IP reassembly negative cases Akhil Goyal
2022-02-17 17:23       ` [PATCH v3 0/4] app/test: add inline IPsec and reassembly cases Akhil Goyal
2022-02-17 17:23         ` [PATCH v3 1/4] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-02-17 17:23         ` [PATCH v3 2/4] app/test: add IP reassembly case with no frags Akhil Goyal
2022-02-17 17:23         ` [PATCH v3 3/4] app/test: add IP reassembly cases with multiple fragments Akhil Goyal
2022-02-17 17:23         ` [PATCH v3 4/4] app/test: add IP reassembly negative cases Akhil Goyal
2022-04-16 19:25         ` [PATCH v4 00/10] app/test: add inline IPsec and reassembly cases Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 01/10] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 02/10] test/security: add inline inbound IPsec cases Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 03/10] test/security: add combined mode inline " Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 04/10] test/security: add inline IPsec reassembly cases Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 05/10] test/security: add more inline IPsec functional cases Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 06/10] test/security: add ESN and anti-replay cases for inline Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 07/10] ethdev: add IPsec SA expiry event subtypes Akhil Goyal
2022-04-19  8:58             ` Thomas Monjalon
2022-04-19 10:14               ` [EXT] " Akhil Goyal
2022-04-19 10:19                 ` Anoob Joseph
2022-04-19 10:37                   ` Thomas Monjalon
2022-04-19 10:39                     ` Anoob Joseph
2022-04-19 10:47                 ` Thomas Monjalon
2022-04-19 12:27                   ` Akhil Goyal
2022-04-19 15:41                     ` Ray Kinsella
2022-04-20 13:51                       ` Akhil Goyal
2022-09-24 13:57             ` [PATCH v5 0/3] Add and test IPsec SA expiry events Akhil Goyal
2022-09-24 13:57               ` [PATCH v5 1/3] ethdev: add IPsec SA expiry event subtypes Akhil Goyal
2022-09-24 14:02                 ` Akhil Goyal
2022-09-26 14:02                 ` Thomas Monjalon
2022-09-27 18:44                   ` [EXT] " Akhil Goyal
2022-09-24 13:57               ` [PATCH v5 2/3] test/security: add inline IPsec SA soft expiry cases Akhil Goyal
2022-09-24 13:57               ` [PATCH v5 3/3] test/security: add inline IPsec SA hard " Akhil Goyal
2022-09-26 17:07               ` [PATCH v6 0/3] Add and test IPsec SA expiry events Akhil Goyal
2022-09-26 17:07                 ` [PATCH v6 1/3] ethdev: add IPsec SA expiry event subtypes Akhil Goyal
2022-09-26 17:07                 ` [PATCH v6 2/3] test/security: add inline IPsec SA soft expiry cases Akhil Goyal
2022-09-26 17:07                 ` [PATCH v6 3/3] test/security: add inline IPsec SA hard " Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 08/10] test/security: add inline IPsec SA soft " Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 09/10] test/security: add inline IPsec SA hard " Akhil Goyal
2022-04-16 19:25           ` [PATCH v4 10/10] test/security: add inline IPsec IPv6 flow label cases Akhil Goyal
2022-04-18  3:44             ` Anoob Joseph
2022-04-18  3:55               ` Akhil Goyal
2022-04-25 12:38           ` [PATCH v4 00/10] app/test: add inline IPsec and reassembly cases Poczatek, Jakub
2022-04-27 15:10           ` [PATCH v5 0/7] " Akhil Goyal
2022-04-27 15:10             ` [PATCH v5 1/7] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-04-27 15:44               ` Zhang, Roy Fan
2022-04-27 15:10             ` [PATCH v5 2/7] test/security: add inline inbound IPsec cases Akhil Goyal
2022-04-27 15:44               ` Zhang, Roy Fan
2022-04-27 15:10             ` [PATCH v5 3/7] test/security: add combined mode inline " Akhil Goyal
2022-04-27 15:45               ` Zhang, Roy Fan
2022-04-27 15:10             ` [PATCH v5 4/7] test/security: add inline IPsec reassembly cases Akhil Goyal
2022-04-27 15:45               ` Zhang, Roy Fan
2022-04-27 15:10             ` [PATCH v5 5/7] test/security: add more inline IPsec functional cases Akhil Goyal
2022-04-27 15:46               ` Zhang, Roy Fan
2022-04-27 15:10             ` [PATCH v5 6/7] test/security: add ESN and anti-replay cases for inline Akhil Goyal
2022-04-27 15:46               ` Zhang, Roy Fan
2022-04-28  5:25               ` Anoob Joseph
2022-04-27 15:10             ` [PATCH v5 7/7] test/security: add inline IPsec IPv6 flow label cases Akhil Goyal
2022-04-27 15:46               ` Zhang, Roy Fan
2022-04-27 15:42             ` [PATCH v5 0/7] app/test: add inline IPsec and reassembly cases Zhang, Roy Fan
2022-05-13  7:31             ` [PATCH v6 " Akhil Goyal
2022-05-13  7:31               ` [PATCH v6 1/7] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-05-13  7:31               ` [PATCH v6 2/7] test/security: add inline inbound IPsec cases Akhil Goyal
2022-05-13  7:31               ` [PATCH v6 3/7] test/security: add combined mode inline " Akhil Goyal
2022-05-13  7:31               ` [PATCH v6 4/7] test/security: add inline IPsec reassembly cases Akhil Goyal
2022-05-13  7:31               ` [PATCH v6 5/7] test/security: add more inline IPsec functional cases Akhil Goyal
2022-05-13  7:32               ` [PATCH v6 6/7] test/security: add ESN and anti-replay cases for inline Akhil Goyal
2022-05-13  7:32               ` [PATCH v6 7/7] test/security: add inline IPsec IPv6 flow label cases Akhil Goyal
2022-05-24  7:22               ` [PATCH v7 0/7] app/test: add inline IPsec and reassembly cases Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 1/7] app/test: add unit cases for inline IPsec offload Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 2/7] test/security: add inline inbound IPsec cases Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 3/7] test/security: add combined mode inline " Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 4/7] test/security: add inline IPsec reassembly cases Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 5/7] test/security: add more inline IPsec functional cases Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 6/7] test/security: add ESN and anti-replay cases for inline Akhil Goyal
2022-05-24  7:22                 ` [PATCH v7 7/7] test/security: add inline IPsec IPv6 flow label cases Akhil Goyal
2022-05-24  8:05                 ` [PATCH v7 0/7] app/test: add inline IPsec and reassembly cases Anoob Joseph
2022-05-24  9:38                   ` Akhil Goyal
2022-01-03 15:08   ` [PATCH 6/8] app/test: add IP reassembly case with no frags Akhil Goyal
2022-01-03 15:08   ` [PATCH 7/8] app/test: add IP reassembly cases with multiple fragments Akhil Goyal
2022-01-03 15:08   ` [PATCH 8/8] app/test: add IP reassembly negative cases Akhil Goyal
2022-01-06  9:51   ` [PATCH 0/8] ethdev: introduce IP reassembly offload David Marchand
2022-01-06  9:54     ` [EXT] " Akhil Goyal
2022-01-20 16:26   ` [PATCH v2 0/4] " Akhil Goyal
2022-01-20 16:26     ` [PATCH v2 1/4] " Akhil Goyal
2022-01-20 16:45       ` Stephen Hemminger
2022-01-20 17:11         ` [EXT] " Akhil Goyal
2022-01-20 16:26     ` [PATCH v2 2/4] ethdev: add dev op to set/get IP reassembly configuration Akhil Goyal
2022-01-22  8:17       ` Andrew Rybchenko
2022-01-30 16:30         ` [EXT] " Akhil Goyal
2022-01-20 16:26     ` [PATCH v2 3/4] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-01-20 16:26     ` [PATCH v2 4/4] security: add IPsec option for " Akhil Goyal
2022-01-30 17:59     ` [PATCH v3 0/4] ethdev: introduce IP reassembly offload Akhil Goyal
2022-01-30 17:59       ` [PATCH v3 1/4] " Akhil Goyal
2022-02-01 14:11         ` Ferruh Yigit
2022-02-02 10:57           ` [EXT] " Akhil Goyal
2022-02-02 14:05             ` Ferruh Yigit
2022-01-30 17:59       ` [PATCH v3 2/4] ethdev: add dev op to set/get IP reassembly configuration Akhil Goyal
2022-01-30 17:59       ` [PATCH v3 3/4] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-02-01 14:11         ` Ferruh Yigit
2022-02-02  9:13           ` [EXT] " Akhil Goyal
2022-01-30 17:59       ` [PATCH v3 4/4] security: add IPsec option for " Akhil Goyal
2022-02-01 14:12         ` Ferruh Yigit
2022-02-02  9:15           ` [EXT] " Akhil Goyal
2022-02-02 14:04             ` Ferruh Yigit
2022-02-01 14:10       ` [PATCH v3 0/4] ethdev: introduce IP reassembly offload Ferruh Yigit
2022-02-02  9:05         ` [EXT] " Akhil Goyal
2022-02-04 22:13       ` [PATCH v4 0/3] " Akhil Goyal
2022-02-04 22:13         ` [PATCH v4 1/3] " Akhil Goyal
2022-02-04 22:20           ` Akhil Goyal
2022-02-07 13:53           ` Ferruh Yigit
2022-02-07 14:36             ` [EXT] " Akhil Goyal
2022-02-04 22:13         ` [PATCH v4 2/3] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-02-07 13:58           ` Ferruh Yigit
2022-02-07 14:20             ` [EXT] " Akhil Goyal
2022-02-07 14:56               ` Ferruh Yigit
2022-02-07 16:20                 ` Akhil Goyal
2022-02-07 16:41                   ` Ferruh Yigit
2022-02-07 17:17                     ` Akhil Goyal
2022-02-07 17:23           ` Stephen Hemminger
2022-02-07 17:28             ` Ferruh Yigit
2022-02-07 18:01               ` Stephen Hemminger
2022-02-07 18:28                 ` [EXT] " Akhil Goyal
2022-02-07 19:08                   ` Stephen Hemminger
2022-02-07 17:29             ` Akhil Goyal
2022-02-04 22:13         ` [PATCH v4 3/3] security: add IPsec option for " Akhil Goyal
2022-02-08  9:01           ` David Marchand
2022-02-08  9:18             ` [EXT] " Akhil Goyal
2022-02-08  9:27               ` David Marchand
2022-02-08 10:45                 ` Akhil Goyal
2022-02-08 13:19                   ` Akhil Goyal
2022-02-08 19:55                     ` David Marchand
2022-02-08 20:01                       ` Akhil Goyal
2022-02-08 20:11         ` [PATCH v5 0/3] ethdev: introduce IP reassembly offload Akhil Goyal
2022-02-08 20:11           ` [PATCH v5 1/3] " Akhil Goyal
2022-02-08 20:11           ` [PATCH v5 2/3] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-02-08 20:11           ` [PATCH v5 3/3] security: add IPsec option for " Akhil Goyal
2022-02-08 22:20           ` [PATCH v6 0/3] ethdev: introduce IP reassembly offload Akhil Goyal
2022-02-08 22:20             ` [PATCH v6 1/3] " Akhil Goyal
2022-02-10  8:54               ` Ferruh Yigit
2022-02-10 10:08               ` Andrew Rybchenko
2022-02-10 10:20                 ` Ferruh Yigit
2022-02-10 10:30                   ` Ferruh Yigit
2022-02-08 22:20             ` [PATCH v6 2/3] ethdev: add mbuf dynfield for incomplete IP reassembly Akhil Goyal
2022-02-10  8:54               ` Ferruh Yigit
2022-02-08 22:20             ` [PATCH v6 3/3] security: add IPsec option for " Akhil Goyal
2022-02-10  8:54             ` [PATCH v6 0/3] ethdev: introduce IP reassembly offload Ferruh Yigit

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).