Skip to contentSkip to conversation

ethdev: allow multiple security sessions to use one rte flow

PATCH In review Anoob Joseph 6 participants 30 messages Dec 8, 2019 – Jan 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: allow multiple security sessions to use one rte flow

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
lib/librte_ethdev/rte_flow.h +6 -0
index 452d359..21fa7ed 100644
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure. */
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Anoob Joseph

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 4 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

Quoted 24 lines
---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
lib/librte_ethdev/rte_flow.h +6 -1
index 452d359..21fa7ed 100644
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
        void *security_session; /**< Pointer to security session structure. */
--

2.7.4

Acked-by
#2 lore raw
Quoted 23 lines

-----Original Message-----
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 16 lines · Anoob Joseph

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 9 lines
Quoted 4 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

Quoted 1 line

---

Thanks,
Ori

#3 lore raw

10/12/2019 21:47, Ori Kam:

Quoted 22 lines
Quoted 22 lines

-----Original Message-----
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 16 lines · Anoob Joseph

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

Reworded title:
ethdev: allow multiple security sessions to use flow rule
and converted "SECURITY" to lowercase, then
Applied for -rc1

#4 lore raw
In reply to Anoob Joseph
Quoted 12 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD lookup.
Am I missing something obvious here?

Quoted 28 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
lib/librte_ethdev/rte_flow.h +6 -1
index 452d359..21fa7ed 100644
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure. */
--

2.7.4

#5 lore raw

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 35 lines

-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Monday, December 9, 2019 6:49 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

----------------------------------------------------------------------

Quoted 11 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 4 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD lookup. Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely identify the security session/SA.

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index into a table (for example), then the above requirement of one rte_flow per SA is not required.

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual lookup. Just that it is not used while creating 'rte_flow'.

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 33 lines
Quoted 33 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created can
+ enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

#6 lore raw
Quoted 27 lines
Quoted 17 lines
Quoted 12 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 4 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD lookup. Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely identify the security session/SA.

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index into a table (for example), then the above requirement of one rte_flow per SA is not required.

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API? If yes, then what would be the mechanism?

Quoted 37 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 33 lines
Quoted 33 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created can
+ enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

#7 lore raw

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 54 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 7 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 4 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Quoted 7 lines
Quoted 2 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain how it's done in OCTEONTX2 PMD.

The application would create security_session for every SA. SPI etc would be available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done.

PMD uses SPI as index to write into specific locations(during session create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would work.

Quoted 40 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

#8 lore raw
Quoted 47 lines
Quoted 37 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 7 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 4 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Quoted 7 lines
Quoted 2 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain how it's done in OCTEONTX2 PMD.

Quoted 7 lines

The application would create security_session for every SA. SPI etc would be available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done.

PMD uses SPI as index to write into specific locations(during session create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would work.

Thanks for explanation, few more questions:
Ok, so the table will be allocated at device init() somehow (nothing to do with rte_flow).
Then PMD will be able to write/update entries in that table and HW will be able to read (to get SPI, keys, etc), correct? Now if upper layer (ipsec-secgw for example) would like to create new ESP session on that device, what it would need to do? Would it still need to use rte_flow API for that?
Or just call rte_security_session_create() and PMD will take update this HW/SW table for it?

Quoted 41 lines
Quoted 41 lines
Quoted 5 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 34 lines
Quoted 34 lines
Quoted 34 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

#9 lore raw

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 76 lines

-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Friday, December 13, 2019 5:25 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

----------------------------------------------------------------------

Quoted 43 lines
Quoted 43 lines
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 4 lines
Quoted 4 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 5 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 8 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 7 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

Quoted 7 lines
Quoted 5 lines

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created.

Quoted 2 lines

Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and

h/w would have the pointer after the initialization is done.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

PMD uses SPI as index to write into specific locations(during session create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could

populate at memory locations that h/w would look at, this scheme would work.

Thanks for explanation, few more questions:
Ok, so the table will be allocated at device init() somehow (nothing to do with rte_flow).

[Anoob] Yes.

Quoted 2 lines

Then PMD will be able to write/update entries in that table and HW will be able to read (to get SPI, keys, etc), correct?

[Anoob] Yes.

Quoted 5 lines

Now if upper layer (ipsec-secgw for example) would like to create new ESP session on that device, what it would need to do?
Would it still need to use rte_flow API for that?
Or just call rte_security_session_create() and PMD will take update this HW/SW table for it?

[Anoob] rte_security_session_create() is enough.

Quoted 44 lines
Quoted 32 lines
Quoted 32 lines
Quoted 7 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +4 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session

structure.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

#10 lore raw
Quoted 75 lines
Quoted 59 lines
Quoted 44 lines
Quoted 44 lines
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Quoted 4 lines
Quoted 4 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 5 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 8 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 7 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

Quoted 7 lines
Quoted 5 lines

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created.

Quoted 2 lines

Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and

h/w would have the pointer after the initialization is done.

Quoted 1 line
Quoted 8 lines
Quoted 3 lines

PMD uses SPI as index to write into specific locations(during session create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could

populate at memory locations that h/w would look at, this scheme would work.

Thanks for explanation, few more questions:
Ok, so the table will be allocated at device init() somehow (nothing to do with rte_flow).

[Anoob] Yes.

Quoted 2 lines

Then PMD will be able to write/update entries in that table and HW will be able to read (to get SPI, keys, etc), correct?

[Anoob] Yes.

Quoted 7 lines
Quoted 5 lines

Now if upper layer (ipsec-secgw for example) would like to create new ESP session on that device, what it would need to do?
Would it still need to use rte_flow API for that?
Or just call rte_security_session_create() and PMD will take update this HW/SW table for it?

[Anoob] rte_security_session_create() is enough.

Then probably a stupid question:
If this HW/SW table will be created at dev_init() and to populate it rte_security_session_create() is sufficient,
why do you need that dummy flow at all?
Would it be just used as a switch to enable/disable HW IPsec packet processing (either per whole device, or for some sub-ranges of SPI/SIP/DIP)? Something different?
Konstantin

Quoted 45 lines
Quoted 45 lines
Quoted 33 lines
Quoted 33 lines
Quoted 8 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +4 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session

structure.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

#11 lore raw

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 110 lines

-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Monday, December 16, 2019 6:24 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

----------------------------------------------------------------------

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is

created.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to

support.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would

be NULL.

Quoted 45 lines
Quoted 45 lines
Quoted 29 lines
Quoted 29 lines
Quoted 5 lines
Quoted 5 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 5 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 8 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 7 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

Quoted 8 lines
Quoted 5 lines

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 3 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created.

Quoted 3 lines

Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and

Quoted 8 lines
Quoted 8 lines

h/w would have the pointer after the initialization is done.

Quoted 6 lines

PMD uses SPI as index to write into specific locations(during session
create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could

populate at memory locations that h/w would look at, this scheme would

work.

Quoted 12 lines
Quoted 4 lines

Thanks for explanation, few more questions:
Ok, so the table will be allocated at device init() somehow (nothing to do with rte_flow).

[Anoob] Yes.

Quoted 2 lines

Then PMD will be able to write/update entries in that table and HW will be able to read (to get SPI, keys, etc), correct?

[Anoob] Yes.

Quoted 7 lines
Quoted 5 lines

Now if upper layer (ipsec-secgw for example) would like to create new ESP session on that device, what it would need to do? Would it still need to use rte_flow API for that?
Or just call rte_security_session_create() and PMD will take update this HW/SW table for it?

[Anoob] rte_security_session_create() is enough.

Quoted 7 lines

Then probably a stupid question:
If this HW/SW table will be created at dev_init() and to populate it rte_security_session_create() is sufficient, why do you need that dummy flow at all?
Would it be just used as a switch to enable/disable HW IPsec packet processing (either per whole device, or for some sub-ranges of SPI/SIP/DIP)? Something different?

[Anoob] Your understanding is correct. rte_flow is used to selectively enable/disable HW IPsec processing.

Quoted 49 lines

Konstantin

Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 21 lines
Quoted 8 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
 lib/librte_ethdev/rte_flow.h | 6 ++++++
 1 file changed, 6 insertions(+)
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter { · line 2241

Quoted 9 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +0 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
  * direction.
  *
  * Multiple flows can be configured to use the same security

session.

Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/librte_ethdev/rte_flow.h +4 -0
+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ flow items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
  */
 struct rte_flow_action_security {
 	void *security_session; /**< Pointer to security session

structure.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

#12 lore raw
In reply to Anoob Joseph

Hi Anoob,

Quoted 55 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 48 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 3 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 6 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 11 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain how it's done in OCTEONTX2 PMD.

The application would create security_session for every SA. SPI etc would be available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done.

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create) and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would work.

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

Quoted 36 lines
Quoted 36 lines
Quoted 3 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 31 lines
Quoted 31 lines
Quoted 31 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
  lib/librte_ethdev/rte_flow.h | 6 ++++++
  1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
   * direction.
   *
   * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
   */
  struct rte_flow_action_security {
  	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

Signature · 2 lines
Regards,
Vladimir
#13 lore raw

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 103 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

----------------------------------------------------------------------
Hi Anoob,

Quoted 17 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 33 lines
Quoted 33 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 9 lines
Quoted 4 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done.
If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 1 line
Quoted 4 lines
Quoted 1 line

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would work.

[Anoob] Yes. But we need to allow application to control the h/w ipsec processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the h/w packet steering happens. Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing so.

Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one to one. As in, SPI is used as index in the table.

Quoted 41 lines
Quoted 29 lines
Quoted 29 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
  lib/librte_ethdev/rte_flow.h | 6 ++++++
  1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +7 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
   * direction.
   *
   * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/librte_ethdev/rte_flow.h +2 -0
+ * SECURITY processing on multiple flows.
+ *
   */
  struct rte_flow_action_security {
  	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

--
Regards,
Vladimir

#14 lore raw

Hi Anoob,

Quoted 108 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 101 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

----------------------------------------------------------------------
Hi Anoob,

Quoted 17 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 10 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 33 lines
Quoted 33 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 1 line

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done.
If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 1 line

PMD uses SPI as index to write into specific locations(during session create)

Quoted 8 lines
Quoted 3 lines

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would work.

[Anoob] Yes. But we need to allow application to control the h/w ipsec processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the h/w packet steering happens. Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing so.

Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one to one. As in, SPI is used as index in the table.

So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different SPI's which have the same lsb's? Moreover, what about two sessions with same SPI but different dst and src ip addresses?

Quoted 40 lines
Quoted 40 lines
Quoted 29 lines
Quoted 29 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
   lib/librte_ethdev/rte_flow.h | 6 ++++++
   1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +7 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
    * direction.
    *
    * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
lib/librte_ethdev/rte_flow.h +2 -0
+ * SECURITY processing on multiple flows.
+ *
    */
   struct rte_flow_action_security {
   	void *security_session; /**< Pointer to security session structure.

*/
--
2.7.4

--
Regards,
Vladimir

Signature · 2 lines
Regards,
Vladimir
#15 lore raw

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 148 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 94 lines
Quoted 94 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

---------------------------------------------------------------------
-
Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 34 lines
Quoted 34 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done. If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

work.

Quoted 1 line

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the h/w packet steering happens. Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing so.

Quoted 3 lines
Quoted 3 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

Quoted 7 lines
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we map it one to one.

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different SPI's which have the same lsb's?

[Anoob] rte_security_session_create() would fail. Why do you say we cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using devargs.

Also, collision of LSBs can be avoided by introducing a "MARK" rule in addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session with same SPI would result in session creation failure.

Quoted 45 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
   lib/librte_ethdev/rte_flow.h | 6 ++++++
   1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +4 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
    * direction.
    *
    * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
    */
   struct rte_flow_action_security {
   	void *security_session; /**< Pointer to security session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

--
Regards,
Vladimir

#16 lore raw

Hi Anoob,

Quoted 161 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 147 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 94 lines
Quoted 94 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

---------------------------------------------------------------------
-
Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev, Konstantin
Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 34 lines
Quoted 34 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is created. This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done. If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

work.

Quoted 1 line

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the h/w packet steering happens. Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing so.

Quoted 2 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

Quoted 7 lines
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we map it one to one.

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different SPI's which have the same lsb's?

Quoted 7 lines

[Anoob] rte_security_session_create() would fail. Why do you say we cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using devargs.

Also, collision of LSBs can be avoided by introducing a "MARK" rule in addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI + range size), not for all SPI values.

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 44 lines
Quoted 44 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 26 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 20 lines
Quoted 20 lines
Quoted 20 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
    lib/librte_ethdev/rte_flow.h | 6 ++++++
    1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +4 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
     * direction.
     *
     * Multiple flows can be configured to use the same security session.
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
     */
    struct rte_flow_action_security {
    	void *security_session; /**< Pointer to security session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

--
Regards,
Vladimir

Signature · 2 lines
Regards,
Vladimir
#17 lore raw

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 212 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 11:14 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 42 lines
Quoted 42 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 16 lines
Quoted 16 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

-------------------------------------------------------------------
--
-
Hi Anoob,

Quoted 2 lines · Anoob Joseph

Hi Konstantin,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Please see inline.

Thanks,
Anoob

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev,

Konstantin

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Nicolau,

Quoted 9 lines
Quoted 9 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is

created.

Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 25 lines
Quoted 25 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done. If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 6 lines
Quoted 6 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 3 lines
Quoted 3 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 6 lines
Quoted 6 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using devargs.

Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 4 lines
Quoted 3 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

Quoted 8 lines

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

So can I assume you are in agreement with this patch?

Quoted 56 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 4 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
    lib/librte_ethdev/rte_flow.h | 6 ++++++
    1 file changed, 6 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter { · line 2241

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +0 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
     * direction.
     *
     * Multiple flows can be configured to use the same security

session.

Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/librte_ethdev/rte_flow.h +4 -0
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
     */
    struct rte_flow_action_security {
    	void *security_session; /**< Pointer to security session

structure.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#18 lore raw

Hi Anoob,

Quoted 220 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 213 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 11:14 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 42 lines
Quoted 42 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 16 lines
Quoted 16 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

-------------------------------------------------------------------
--
-
Hi Anoob,

Quoted 2 lines · Anoob Joseph

Hi Konstantin,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Please see inline.

Thanks,
Anoob

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev,

Konstantin

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Nicolau,

Quoted 9 lines
Quoted 9 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is

created.

Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 25 lines
Quoted 25 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to support.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is done. If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 6 lines
Quoted 6 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 3 lines
Quoted 3 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 6 lines
Quoted 6 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using devargs.

Quoted 1 line

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 3 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 8 lines
Quoted 5 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

        .hdr = {
                .spi = rte_cpu_to_be_32(first_spi), },

};

struct rte_flow_item_esp esp_mask = {

        .hdr = {
                .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1), },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset of SPI's. All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to have finer grained control here.

Quoted 54 lines
Quoted 54 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 3 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of SAs. The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

---
     lib/librte_ethdev/rte_flow.h | 6 ++++++
     1 file changed, 6 insertions(+)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter { · line 2241

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed 100644

lib/librte_ethdev/rte_flow.h +0 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
      * direction.
      *
      * Multiple flows can be configured to use the same security

session.

Quoted 16 lines
Quoted 16 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/librte_ethdev/rte_flow.h +4 -0
+ *
+ * The NULL value is allowed for security session. If security
+ session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

lib/librte_ethdev/rte_flow.h struct rte_flow_action_meter {

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +5 -0
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.
+ *
      */
     struct rte_flow_action_security {
     	void *security_session; /**< Pointer to security session

structure.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

Signature · 2 lines
Regards,
Vladimir
#19 lore raw

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 293 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, December 18, 2019 7:22 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 11:14 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 25 lines
Quoted 25 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 4 lines
Quoted 4 lines

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 7 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

Nicolau,

Quoted 24 lines
Quoted 24 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

-----------------------------------------------------------------
--
--
-
Hi Anoob,

Quoted 9 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev,

Quoted 8 lines
Quoted 8 lines

Konstantin

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon

<[email protected]>

Quoted 14 lines
Quoted 14 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Nicolau,

Quoted 10 lines
Quoted 10 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

The rte_security API which enables inline protocol/crypto feature mandates that for every security session an rte_flow is

Quoted 8 lines
Quoted 8 lines

created.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This would internally translate to a rule in the hardware which would do packet classification.

In rte_securty, one SA would be one security session. And if an rte_flow need to be created for every session, the number of SAs supported by an inline implementation would be limited by the number of rte_flows the PMD would be able to

support.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 18 lines
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines

If the fields SPI & IP addresses are allowed to be a range, then this limitation can be overcome. Multiple flows will be able to use one rule for SECURITY processing. In this case, the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is

done.

Quoted 33 lines
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 7 lines
Quoted 7 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 7 lines
Quoted 7 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

Quoted 6 lines
Quoted 6 lines

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using

devargs.

Quoted 16 lines
Quoted 16 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 4 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 7 lines
Quoted 6 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the

IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

Quoted 2 lines

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

        .hdr = {
                .spi = rte_cpu_to_be_32(first_spi), },

};

struct rte_flow_item_esp esp_mask = {

        .hdr = {
                .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1), },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

pattern[0].spec = & esp_spec;

Quoted 9 lines

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset of SPI's. All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to have finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described. What you described is one way to define a range. That will come as part of the implementation, ie, a change in the example application. This patch intends to allow using a range for SPI than a fixed value. I believe you are also in agreement there.

Quoted 62 lines
Quoted 9 lines
Quoted 9 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of

SAs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Application should do an rte_flow_validate() to make sure the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
---
     lib/librte_ethdev/rte_flow.h | 6 ++++++
     1 file changed, 6 insertions(+)
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 28 lines
Quoted 28 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
lib/librte_ethdev/rte_flow.h +0 -0
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
      * direction.
      *
      * Multiple flows can be configured to use the same

security

session.

Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
+ items 'IPv4' and

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *

      */
     struct rte_flow_action_security {
     	void *security_session; /**< Pointer to security

session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#20 lore raw

Hi Anoob,

Quoted 299 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 292 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, December 18, 2019 7:22 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 11:14 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 25 lines
Quoted 25 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 18 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Tuesday, December 17, 2019 4:51 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 4 lines
Quoted 4 lines

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

Subject: Re: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 7 lines · Anoob Joseph

Hi Vladimir,

Please see inline.

Thanks,
Anoob

Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

-----Original Message-----
From: Medvedkin, Vladimir <[email protected]>
Sent: Monday, December 16, 2019 9:29 PM
To: Anoob Joseph <[email protected]>; Ananyev, Konstantin

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

Nicolau,

Quoted 24 lines
Quoted 24 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

External Email

-----------------------------------------------------------------
--
--
-
Hi Anoob,

Quoted 9 lines · Anoob Joseph

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ananyev,

Quoted 8 lines
Quoted 8 lines

Konstantin

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Sent: Wednesday, December 11, 2019 4:36 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon

<[email protected]>

Quoted 14 lines
Quoted 14 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Nicolau,

Quoted 10 lines
Quoted 10 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

The rte_security API which enables inline protocol/crypto
feature mandates that for every security session an rte_flow
is

Quoted 8 lines
Quoted 8 lines

created.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This would internally translate to a rule in the hardware
which would do packet classification.

In rte_securty, one SA would be one security session. And if
an rte_flow need to be created for every session, the number
of SAs supported by an inline implementation would be
limited by the number of rte_flows the PMD would be able to

support.

Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 17 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

If the fields SPI & IP addresses are allowed to be a range,
then this limitation can be overcome. Multiple flows will be
able to use one rule for SECURITY processing. In this case,
the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is

done.

Quoted 33 lines
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 7 lines
Quoted 7 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 7 lines
Quoted 7 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

Quoted 6 lines
Quoted 6 lines

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using

devargs.

Quoted 16 lines
Quoted 16 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 4 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 7 lines
Quoted 6 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the

IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

Quoted 8 lines
Quoted 7 lines

...

So this means inline proto device would process only special subset of SPI's. All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to have finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described. What you described is one way to define a range. That will come as part of the implementation, ie, a change in the example application. This patch intends to allow using a range for SPI than a fixed value. I believe you are also in agreement there.

Thanks for clarification, no objections from my side.

Quoted 61 lines
Quoted 61 lines
Quoted 9 lines
Quoted 9 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of

SAs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Application should do an rte_flow_validate() to make sure
the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 28 lines
Quoted 28 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
+ items 'IPv4' and

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

Signature · 2 lines
Regards,
Vladimir
#21 lore raw
In reply to Anoob Joseph
Quoted 163 lines
Quoted 153 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

The rte_security API which enables inline protocol/crypto
feature mandates that for every security session an rte_flow
is

Quoted 8 lines
Quoted 8 lines

created.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This would internally translate to a rule in the hardware
which would do packet classification.

In rte_securty, one SA would be one security session. And if
an rte_flow need to be created for every session, the number
of SAs supported by an inline implementation would be
limited by the number of rte_flows the PMD would be able to

support.

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 18 lines
Quoted 18 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines

If the fields SPI & IP addresses are allowed to be a range,
then this limitation can be overcome. Multiple flows will be
able to use one rule for SECURITY processing. In this case,
the security session provided as conf would be NULL.

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone or in conjunction with dst (and src) IP should clearly identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is

done.

Quoted 33 lines
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 7 lines
Quoted 7 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 7 lines
Quoted 7 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's.  Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

Quoted 6 lines
Quoted 6 lines

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using

devargs.

Quoted 16 lines
Quoted 16 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 4 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 7 lines
Quoted 6 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the

IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

Quoted 2 lines

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

        .hdr = {
                .spi = rte_cpu_to_be_32(first_spi), },

};

struct rte_flow_item_esp esp_mask = {

        .hdr = {
                .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1), },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

pattern[0].spec = & esp_spec;

Quoted 9 lines

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset of SPI's. All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to have finer grained control here.

Quoted 3 lines

[Anoob] Allowing a range for SPI is what you have also described. What you described is one way to define a range. That will come as part of the implementation, ie, a change in the example application. This patch intends to allow using a range for SPI than a fixed value. I believe you are also in agreement there.

I also don't have objections for that patch.
The only obseravion from reading your replies to that at ipsec-secgw patches:
Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

Quoted 63 lines
Quoted 63 lines
Quoted 10 lines
Quoted 10 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of

SAs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Application should do an rte_flow_validate() to make sure
the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 28 lines
Quoted 28 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
+ items 'IPv4' and

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#22 lore raw

Hi Anoob,

Quoted 161 lines · Konstantin
Quoted 153 lines
Quoted 153 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

The rte_security API which enables inline protocol/crypto
feature mandates that for every security session an rte_flow
is

Quoted 8 lines
Quoted 8 lines

created.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

This would internally translate to a rule in the hardware
which would do packet classification.

In rte_securty, one SA would be one security session. And if
an rte_flow need to be created for every session, the number
of SAs supported by an inline implementation would be
limited by the number of rte_flows the PMD would be able to

support.

Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 17 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

If the fields SPI & IP addresses are allowed to be a range,
then this limitation can be overcome. Multiple flows will be
able to use one rule for SECURITY processing. In this case,
the security session provided as conf would be NULL.
Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone
or in conjunction with dst (and src) IP should clearly
identify SA for inbound SAD

lookup.

Quoted 4 lines
Quoted 1 line

Am I missing something obvious here?

[Anoob] Existing SECURITY action type requires application to create an 'rte_flow' per SA, which is not really required if h/w can use SPI to uniquely

identify the security session/SA.

Quoted 3 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security processing enabled on one security session (ie on SA)

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

The above rule would uniquely identify packets for an SA. But with the above usage, we would quickly exhaust entries available in h/w lookup tables (which are limited on our hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of one rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) -> security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

Now h/w could use SPI to index into a pre-populated table to get security session. Please do note that, SPI is not ignored during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may be I'll explain

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization is

done.

Quoted 33 lines
Quoted 33 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would look at, this scheme would

Quoted 7 lines
Quoted 7 lines

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of unsupported capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about collisions?

[Anoob] That is implementation dependent. In our PMD, we map it one

to one.

Quoted 7 lines
Quoted 7 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's. Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

Quoted 6 lines
Quoted 6 lines

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say we

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using

devargs.

Quoted 16 lines
Quoted 16 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 4 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would be:

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 7 lines
Quoted 6 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from configuration?).

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and the

IP addresses to be range and have security_session provided as NULL. What you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

Quoted 8 lines
Quoted 5 lines

So this means inline proto device would process only special subset of SPI's. All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to have finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described. What you described is one way to define a range. That will come as part of the implementation, ie, a change in the example application. This patch intends to allow using a range for SPI than a fixed value. I believe you are also in agreement there.

Quoted 6 lines

I also don't have objections for that patch.
The only obseravion from reading your replies to that at ipsec-secgw patches:
Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

I also don't have objections.

Quoted 61 lines
Quoted 61 lines
Quoted 61 lines
Quoted 9 lines
Quoted 9 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple (i.e. SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The usage of one 'rte_flow' for multiple SAs is not mandatory. It is only required when application requires large number of

SAs.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

The proposed

change is to allow more efficient usage of h/w resources where it's permitted by the PMD.

Quoted 3 lines
Quoted 3 lines

Application should do an rte_flow_validate() to make sure
the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 28 lines
Quoted 28 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 20 lines
Quoted 20 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
+ items 'IPv4' and

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

Signature · 2 lines
Regards,
Vladimir
#23 lore raw

Hi
sorry for jumping in late.

Quoted 32 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 3 lines · Konstantin
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

The rte_security API which enables inline protocol/crypto
feature mandates that for every security session an

rte_flow

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

is

created.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

This would internally translate to a rule in the hardware
which would do packet classification.

In rte_securty, one SA would be one security session. And

if

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

an rte_flow need to be created for every session, the

Quoted 10 lines

number

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

of SAs supported by an inline implementation would be
limited by the number of rte_flows the PMD would be

able to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If the fields SPI & IP addresses are allowed to be a range,
then this limitation can be overcome. Multiple flows will

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

able to use one rule for SECURITY processing. In this case,
the security session provided as conf would be NULL.

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range, Am I missing something? As it is stated in the rte_fow.h security_session can be used for multiple flows.

Quoted 242 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone
or in conjunction with dst (and src) IP should clearly
identify SA for inbound SAD

lookup.

Quoted 1 line

Am I missing something obvious here?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

[Anoob] Existing SECURITY action type requires application to
create an 'rte_flow' per SA, which is not really required if
h/w can use SPI to uniquely

identify the security session/SA.

Quoted 4 lines

Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security
processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA.

But

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

with the above usage, we would quickly exhaust entries
available in h/w lookup tables (which are limited on our
hardware). But if h/w can use SPI field to index

into a table (for example), then the above requirement of

one

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

rte_flow per SA is not required.

Quoted 2 lines

Proposed rte_flow usage: IP (any) + ESP + SPI (any) ->
security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 1 line
Quoted 1 line
Quoted 1 line

Now h/w could use SPI to index into a pre-populated table

to

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

get security session. Please do note that, SPI is not ignored
during the actual

lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But may

be

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 1 line

I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 2 lines

The application would create security_session for every SA. SPI etc would be

available to PMD (in conf) when the session is created. Now the PMD would populate SA related params in a specific location that h/w would access. This memory is allocated during device configure and h/w would have the pointer after the initialization

is

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

done.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would

look

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

at, this scheme would

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the h/w ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of

unsupported

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about

collisions?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we map

it

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

one

to one.

Quoted 7 lines
Quoted 7 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an index, a lot of memory is wasted in the table for unused SPI's. Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say

we

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation of memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires using

devargs.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip addresses?

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would

be:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from

configuration?).

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

IP addresses to be range and have security_session provided as NULL.

What

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset of

SPI's.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to

have

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described. What

you described is one way to define a range. That will come as

Quoted 1 line
Quoted 1 line

part of the implementation, ie, a change in the example application. This

patch intends to allow using a range for SPI than a fixed

Quoted 3 lines
Quoted 1 line

value. I believe you are also in agreement there.

I also don't have objections for that patch.
The only obseravion from reading your replies to that at ipsec-secgw

patches:

Quoted 4 lines

Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

I also don't have objections.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer tuple

(i.e.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The usage of one 'rte_flow' for multiple SAs is not

mandatory.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

It is only required when application requires large number of

SAs.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

The proposed

change is to allow more efficient usage of h/w resources

where

Quoted 43 lines
Quoted 43 lines
Quoted 43 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

it's permitted by the PMD.

Quoted 10 lines

Application should do an rte_flow_validate() to make sure
the flow is supported on the PMD.

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 31 lines
Quoted 31 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter {
* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 23 lines
Quoted 23 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in flow
+ items 'IPv4' and

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#24 lore raw

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 66 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi
sorry for jumping in late.

Quoted 17 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

feature mandates that for every security session an

rte_flow

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

is

created.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

This would internally translate to a rule in the hardware
which would do packet classification.

In rte_securty, one SA would be one security session.

And

Quoted 8 lines

if

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

an rte_flow need to be created for every session, the

number

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

of SAs supported by an inline implementation would be
limited by the number of rte_flows the PMD would be

able to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

support.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

If the fields SPI & IP addresses are allowed to be a

range,

Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

then this limitation can be overcome. Multiple flows will

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

able to use one rule for SECURITY processing. In this

Quoted 8 lines

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be NULL.

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range,
Am I missing something? As it is stated in the rte_fow.h security_session can be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow rule need to be NULL. Having a non-zero security_session when SPI is a range would be incorrect.

Quoted 259 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value alone
or in conjunction with dst (and src) IP should clearly
identify SA for inbound SAD
lookup.
Am I missing something obvious here?
[Anoob] Existing SECURITY action type requires application

to

Quoted 12 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

create an 'rte_flow' per SA, which is not really required if
h/w can use SPI to uniquely
identify the security session/SA.
Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security
processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an SA.

But

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

with the above usage, we would quickly exhaust entries
available in h/w lookup tables (which are limited on our
hardware). But if h/w can use SPI field to index
into a table (for example), then the above requirement of

Quoted 16 lines

one

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

rte_flow per SA is not required.
Proposed rte_flow usage: IP (any) + ESP + SPI (any) ->
security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What about SA's which are indexed by SPI+DIP+SIP?

Quoted 1 line
Quoted 1 line

Now h/w could use SPI to index into a pre-populated table

to

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

get security session. Please do note that, SPI is not ignored
during the actual
lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to it
will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?

[Anoob] I'm not sure what exactly you meant by user. But

may

Quoted 4 lines

be

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 1 line

The application would create security_session for every SA.

SPI

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

etc would be

available to PMD (in conf) when the session is created. Now

the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

PMD would populate SA related params in a specific location

that

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

h/w would access. This memory is allocated during device configure and h/w would have the pointer after the

initialization

Quoted 13 lines

is

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

done.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during session create)

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would

look

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

at, this scheme would

work.

Quoted 1 line

[Anoob] Yes. But we need to allow application to control the

h/w

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of

unsupported

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines

capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

Also, rte_flow enables H/w parsing on incoming packets. This info is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about

collisions?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we

map

Quoted 5 lines

it

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

one

to one.

Quoted 2 lines
Quoted 2 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an

index,

Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

a lot of memory is wasted in the table for unused SPI's. Also, you are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you say

we

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic allocation

of

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

memory for sessions. So at some point session creation would start failing. In our PMD, we allow user to specify the range it requires

using

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

devargs.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

Also, collision of LSBs can be avoided by introducing a "MARK" rule in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 2 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip

addresses?

Quoted 79 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

[Anoob] Currently our PMD only support UCAST IPSEC. So another session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here would

be:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from

configuration?).

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI and

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

IP addresses to be range and have security_session provided as NULL.

What

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset of

SPI's.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to

have

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described. What

you described is one way to define a range. That will come as

Quoted 1 line
Quoted 1 line

part of the implementation, ie, a change in the example application. This

patch intends to allow using a range for SPI than a fixed

Quoted 3 lines
Quoted 1 line

value. I believe you are also in agreement there.

I also don't have objections for that patch.
The only obseravion from reading your replies to that at ipsec-secgw

patches:

Quoted 4 lines

Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

I also don't have objections.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

- Other SPI values would be processed non inline.

Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

In this case we would be able to have SA addressed by longer tuple

(i.e.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

SPI+DIP+SIP) outside of before mentioned range, as well as SA with unsupported capabilities by inline protocol device.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The usage of one 'rte_flow' for multiple SAs is not

mandatory.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

It is only required when application requires large number

of

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

SAs.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The proposed
change is to allow more efficient usage of h/w resources

where

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it's permitted by the PMD.
Application should do an rte_flow_validate() to make

sure

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

the flow is supported on the PMD.

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index 452d359..21fa7ed

100644

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct rte_flow_action_meter

{

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in

flow

Quoted 29 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#25 lore raw
Quoted 105 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Tuesday, January 14, 2020 11:28 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 18 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 8 lines

Hi
sorry for jumping in late.

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob

Joseph

Quoted 3 lines
Quoted 3 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>;

Jerin

Quoted 10 lines
Quoted 10 lines

Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 11 lines
Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

feature mandates that for every security session an

rte_flow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

is

created.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

This would internally translate to a rule in the

hardware

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

which would do packet classification.

In rte_securty, one SA would be one security session.

And

Quoted 4 lines

if

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

an rte_flow need to be created for every session, the

number

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of SAs supported by an inline implementation would

be

Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

limited by the number of rte_flows the PMD would be

able to

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

support.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

If the fields SPI & IP addresses are allowed to be a

range,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

then this limitation can be overcome. Multiple flows

will

Quoted 9 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

able to use one rule for SECURITY processing. In this

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be NULL.

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range,
Am I missing something? As it is stated in the rte_fow.h security_session

Quoted 7 lines

can

Quoted 1 line

be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

[Ori] I'm less familiar with security, but this is what I understand you are trying to do right?

Quoted 6 lines

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow rule need to be NULL. Having a non-zero security_session when SPI is a range would be incorrect.

[Ori] I'm all in favor decreasing number of flows.
Sorry for the basic question, what is the security_session /SA dependent on? Can one SA include number of different SPI?

Quoted 284 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI value

alone

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

or in conjunction with dst (and src) IP should clearly
identify SA for inbound SAD
lookup.
Am I missing something obvious here?
[Anoob] Existing SECURITY action type requires

application

Quoted 8 lines

to

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

create an 'rte_flow' per SA, which is not really required if
h/w can use SPI to uniquely
identify the security session/SA.
Existing rte_flow usage: IP (dst,src) + ESP + SPI -> security
processing enabled on one security session (ie on SA)

The above rule would uniquely identify packets for an

SA.

Quoted 10 lines
Quoted 10 lines

But

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

with the above usage, we would quickly exhaust entries
available in h/w lookup tables (which are limited on our
hardware). But if h/w can use SPI field to index
into a table (for example), then the above requirement of

one

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

rte_flow per SA is not required.
Proposed rte_flow usage: IP (any) + ESP + SPI (any) ->
security processing enabled on all ESP packets

So this means that SA will be indexed only by spi? What

about

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

SA's which are indexed by SPI+DIP+SIP?

Quoted 1 line

Now h/w could use SPI to index into a pre-populated

table

Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

get security session. Please do note that, SPI is not

ignored

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

during the actual
lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and pointer to

it

Quoted 23 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?
[Anoob] I'm not sure what exactly you meant by user. But

may

Quoted 4 lines

be

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

I'll explain

how it's done in OCTEONTX2 PMD.

Quoted 1 line

The application would create security_session for every SA.

SPI

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

etc would be

available to PMD (in conf) when the session is created. Now

the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

PMD would populate SA related params in a specific location

that

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

h/w would access. This memory is allocated during device configure and h/w would have the pointer after the

initialization

Quoted 6 lines

is

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

done.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

If memory is allocated during device configure what is upper limit for number of sessions? What if app needs more?

Quoted 2 lines

PMD uses SPI as index to write into specific locations(during
session create)

Quoted 16 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and h/w would use it when it sees an ESP packet eligible for SECURITY (in receive path, per packet). As long as session creation could populate at memory locations that h/w would

look

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line

at, this scheme would

work.

Quoted 1 line

[Anoob] Yes. But we need to allow application to control the

h/w

Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of

unsupported

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 1 line
Quoted 1 line

Also, rte_flow enables H/w parsing on incoming packets. This

info

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

What algorithm of indexing by SPI is there? Could I use any arbitrary SPI? If some kind of hashing is used, what about

collisions?

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we

map

Quoted 5 lines

it

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

one

to one.

Quoted 2 lines
Quoted 2 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an

index,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

a lot of memory is wasted in the table for unused SPI's. Also,

you

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as an index. And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 1 line

[Anoob] rte_security_session_create() would fail. Why do you

say

Quoted 3 lines
Quoted 3 lines

we

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic

allocation

Quoted 2 lines

of

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

memory for sessions. So at some point session creation would

start

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

failing. In our PMD, we allow user to specify the range it requires

using

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

devargs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Also, collision of LSBs can be avoided by introducing a "MARK"

rule

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 2 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip

addresses?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] Currently our PMD only support UCAST IPSEC. So

another

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here

would

Quoted 5 lines
Quoted 5 lines

be:

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from

configuration?).

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI

and

Quoted 2 lines
Quoted 2 lines

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

IP addresses to be range and have security_session provided as

NULL.

Quoted 26 lines
Quoted 26 lines

What

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset

of

Quoted 7 lines
Quoted 7 lines

SPI's.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to

have

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described.

What

Quoted 2 lines
Quoted 2 lines

you described is one way to define a range. That will come as

Quoted 1 line
Quoted 1 line

part of the implementation, ie, a change in the example application.

This

Quoted 10 lines
Quoted 10 lines

patch intends to allow using a range for SPI than a fixed

Quoted 3 lines
Quoted 1 line

value. I believe you are also in agreement there.

I also don't have objections for that patch.
The only obseravion from reading your replies to that at ipsec-secgw

patches:

Quoted 4 lines

Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

Quoted 8 lines
Quoted 8 lines

I also don't have objections.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer

tuple

Quoted 2 lines
Quoted 2 lines

(i.e.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

SPI+DIP+SIP) outside of before mentioned range, as well as SA

with

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

unsupported capabilities by inline protocol device.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The usage of one 'rte_flow' for multiple SAs is not

mandatory.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

It is only required when application requires large

number

Quoted 10 lines

of

Quoted 6 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

SAs.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The proposed
change is to allow more efficient usage of h/w resources

where

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it's permitted by the PMD.
Application should do an rte_flow_validate() to make

sure

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index

452d359..21fa7ed

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

100644

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct

rte_flow_action_meter

Quoted 40 lines

{

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

* direction.
*
* Multiple flows can be configured to use the same
security

session.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

+ *
+ * The NULL value is allowed for security session. If
+ security session is NULL,
+ * then SPI field in ESP flow item and IP addresses in

flow

Quoted 29 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to security
session

structure.

Quoted 6 lines
Quoted 6 lines
Quoted 3 lines

*/
--
2.7.4

--
Regards,
Vladimir

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#26 lore raw

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 128 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ori Kam
Sent: Thursday, January 16, 2020 5:06 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Tuesday, January 14, 2020 11:28 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir

Quoted 8 lines

<[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 5 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 19 lines

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 12 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 71 lines
Quoted 5 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 8 lines

Hi
sorry for jumping in late.

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin, Vladimir
Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob

Joseph

Quoted 4 lines
Quoted 4 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>;

Jerin

Quoted 10 lines
Quoted 10 lines

Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 11 lines
Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

feature mandates that for every security session an

rte_flow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

is

created.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

This would internally translate to a rule in the

hardware

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

which would do packet classification.

In rte_securty, one SA would be one security session.

And

Quoted 5 lines

if

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

an rte_flow need to be created for every session,
the

number

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of SAs supported by an inline implementation would

be

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

limited by the number of rte_flows the PMD would be

able to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If the fields SPI & IP addresses are allowed to be
a

range,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

then this limitation can be overcome. Multiple
flows

will

Quoted 10 lines
Quoted 3 lines

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

able to use one rule for SECURITY processing. In
this

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be NULL.

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range, Am I missing something? As it is stated in the rte_fow.h security_session

can

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

[Ori] I'm less familiar with security, but this is what I understand you are trying to do right?

[Anoob] Not exactly. In our implementation, h/w can index into a table which would hold security_sessions. So we can have one rte_flow rule, which will enable the packet steering in the hardware. Which session need to be used will be determined by the SPI.

Quoted 9 lines
Quoted 7 lines

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow rule need to be NULL. Having a non-zero security_session when SPI is a range would be incorrect.

[Ori] I'm all in favor decreasing number of flows.
Sorry for the basic question, what is the security_session /SA dependent on?

[Anoob] No prob! In case of unicast IPsec, every SA would have a unique SPI. So we cannot have multiple SPI's referring to the same SA. And one SA would mean one security_session.

Quoted 1 line

Can one SA include number of different SPI?

[Anoob] No.

May be we need to reimagine this.

Currently, an rte_flow with SECURITY enables ipsec processing with a specific security_session on the packet. This is enabled on a specific IP/SPI specified in the rule.

My proposal: an rte_flow with SECURITY (and session = NULL), would enable ipsec processing on a range and SPI from the packet can be used by the h/w to further figure out the security_session.

Quoted 312 lines
Quoted 105 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Wonder what will be the usage model for it?
AFAIK, RFC 4301 clearly states that either SPI
value

alone

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

or in conjunction with dst (and src) IP should
clearly identify SA for inbound SAD
lookup.
Am I missing something obvious here?
[Anoob] Existing SECURITY action type requires

application

Quoted 9 lines

to

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

create an 'rte_flow' per SA, which is not really
required if h/w can use SPI to uniquely
identify the security session/SA.
Existing rte_flow usage: IP (dst,src) + ESP + SPI ->
security processing enabled on one security session
(ie on SA)

The above rule would uniquely identify packets for an

SA.

Quoted 5 lines
Quoted 5 lines

But

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

with the above usage, we would quickly exhaust
entries available in h/w lookup tables (which are
limited on our hardware). But if h/w can use SPI
field to index

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

into a table (for example), then the above requirement
of

one

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

rte_flow per SA is not required.
Proposed rte_flow usage: IP (any) + ESP + SPI (any)
-> security processing enabled on all ESP packets
So this means that SA will be indexed only by spi? What

about

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

SA's which are indexed by SPI+DIP+SIP?
Now h/w could use SPI to index into a pre-populated

table

Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

get security session. Please do note that, SPI is not

ignored

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

during the actual
lookup. Just that it is not used while creating 'rte_flow'.

And this table will be prepopulated by user and
pointer to

it

Quoted 30 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

will be somehow passed via rte_flow API?
If yes, then what would be the mechanism?
[Anoob] I'm not sure what exactly you meant by user.
But

may

Quoted 4 lines

be

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

I'll explain
how it's done in OCTEONTX2 PMD.
The application would create security_session for every SA.

SPI

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

etc would be
available to PMD (in conf) when the session is created.
Now

the

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

PMD would populate SA related params in a specific
location

that

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

h/w would access. This memory is allocated during device
configure and h/w would have the pointer after the

initialization

Quoted 10 lines

is

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

done.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

If memory is allocated during device configure what is
upper limit for number of sessions? What if app needs more?
PMD uses SPI as index to write into specific
locations(during session create)
and h/w would use it when it sees an ESP packet eligible
for SECURITY (in receive path, per packet). As long as
session creation could populate at memory locations that
h/w would

Quoted 15 lines
Quoted 5 lines

look

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

at, this scheme would

work.

Quoted 2 lines

[Anoob] Yes. But we need to allow application to control the

h/w

Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

ipsec

processing as well. Let's say, application wants to handle a specific SPI range in lookaside mode (may be because of

unsupported

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

capabilities?), in that case having rte_flow will help in fine tuning how the

h/w packet steering happens.

Quoted 2 lines
Quoted 2 lines

Also, rte_flow enables H/w parsing on incoming packets. This

info

Quoted 12 lines
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

is useful even after IPsec processing is complete. Or if application wants to give higher priority to a range of SPIs, rte_flow would allow doing

so.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

What algorithm of indexing by SPI is there? Could I use
any arbitrary SPI? If some kind of hashing is used, what
about

collisions?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] That is implementation dependent. In our PMD, we

map

Quoted 2 lines

it

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

one

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

to one.

Quoted 3 lines
Quoted 3 lines

As in, SPI is used as index in the table.
So, as far as you are mapping one to one and using SPI as an

index,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

a lot of memory is wasted in the table for unused SPI's. Also,

you

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

are not able to have a table with 2^32 sessions. It is likely that some number of SPI's least significant bits are used as

an index.

Quoted 196 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

And it raises a question - what if application needs two sessions with different

SPI's which have the same lsb's?

Quoted 2 lines

[Anoob] rte_security_session_create() would fail. Why do you

say

Quoted 3 lines
Quoted 3 lines

we

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

cannot support 2^32 sessions? If it's memory limitation, the same memory limitation would apply even if you have dynamic

allocation

Quoted 2 lines

of

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

memory for sessions. So at some point session creation would

start

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

failing. In our PMD, we allow user to specify the range it requires

using

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

devargs.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Also, collision of LSBs can be avoided by introducing a "MARK"

rule

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

in

addition to "SECURITY" for the rte_flow created for inline ipsec. Currently that model is not supported (in the library), but that is one solution to the collisions that can be pursued later.

Quoted 2 lines
Quoted 2 lines

Moreover, what about
two sessions with same SPI but different dst and src ip

addresses?

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

[Anoob] Currently our PMD only support UCAST IPSEC. So

another

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

session

with same SPI would result in session creation failure.

Aha, I see, thanks for the explanation. So my suggestion here

would

Quoted 8 lines
Quoted 8 lines

be:

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

- Application defines that some subset of SA's would be inline protocol processed. And this SA's will be indexed by SPI only.

- App defines special range for SPI values of this SA's (size of this range is defined using devargs) and first SPI value (from

Quoted 7 lines
Quoted 7 lines

configuration?).

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

- App installs rte_flow only for this range (from first SPI to first SPI
+ range size), not for all SPI values.

[Anoob] This is exactly what this patch proposes. Allowing the SPI

and

Quoted 2 lines
Quoted 2 lines

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

IP addresses to be range and have security_session provided as

NULL.

Quoted 26 lines
Quoted 26 lines

What

Quoted 25 lines
Quoted 25 lines
Quoted 25 lines

you have described would be achievable only if we can allow this modification in the lib.

Quoted 1 line

So can I assume you are in agreement with this patch?

Not exactly. I meant it is better to make more specified flow like:

...

struct rte_flow_item_esp esp_spec = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(first_spi),
          },

};

struct rte_flow_item_esp esp_mask = {

          .hdr = {
                  .spi = rte_cpu_to_be_32(nb_ipsec_in_sa - 1),
          },

};

pattern[0].type = RTE_FLOW_ITEM_TYPE_ESP;

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

pattern[0].spec = & esp_spec;

pattern[0].mask = &esp_mask;

...

So this means inline proto device would process only special subset

of

Quoted 8 lines
Quoted 8 lines

SPI's.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

All other will be processed as usual. Sure, you can assign all 2^32 SPI range and it work as you intended earlier. I think we need to

have

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

finer grained control here.

[Anoob] Allowing a range for SPI is what you have also described.

What

Quoted 2 lines
Quoted 2 lines

you described is one way to define a range. That will come as

Quoted 1 line
Quoted 1 line

part of the implementation, ie, a change in the example application.

This

Quoted 11 lines
Quoted 11 lines

patch intends to allow using a range for SPI than a fixed

Quoted 4 lines
Quoted 1 line

value. I believe you are also in agreement there.

I also don't have objections for that patch. The only obseravion from reading your replies to that at ipsec-secgw

patches:

Quoted 4 lines

Extra API to retrieve size of that HW table seems to be needed. Though I suppose it could be a subject of separate patch/discussion.

Quoted 8 lines
Quoted 8 lines

I also don't have objections.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

- Other SPI values would be processed non inline.

In this case we would be able to have SA addressed by longer

tuple

Quoted 3 lines
Quoted 3 lines

(i.e.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

SPI+DIP+SIP) outside of before mentioned range, as well as SPI+DIP+SA

with

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

unsupported capabilities by inline protocol device.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The usage of one 'rte_flow' for multiple SAs is not

mandatory.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

It is only required when application requires large

number

Quoted 12 lines

of

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

SAs.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

The proposed
change is to allow more efficient usage of h/w
resources

where

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

it's permitted by the PMD.
Application should do an rte_flow_validate() to
make

sure

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

the flow is supported on the PMD.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Signed-off-by: Anoob Joseph <[email protected]>
---
lib/librte_ethdev/rte_flow.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/lib/librte_ethdev/rte_flow.h
b/lib/librte_ethdev/rte_flow.h index

452d359..21fa7ed

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

100644

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

--- a/lib/librte_ethdev/rte_flow.h
+++ b/lib/librte_ethdev/rte_flow.h
@@ -2239,6 +2239,12 @@ struct

rte_flow_action_meter

Quoted 41 lines

{

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

* direction.
*
* Multiple flows can be configured to use
the same security

session.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

+ *
+ * The NULL value is allowed for security session.
+ If security session is NULL,
+ * then SPI field in ESP flow item and IP
+ addresses in

flow

Quoted 29 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
Quoted 9 lines

+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule
+ thus created can enable
+ * SECURITY processing on multiple flows.
+ *
*/
struct rte_flow_action_security {
void *security_session; /**< Pointer to
security session

structure.

Quoted 6 lines
Quoted 6 lines

*/
--
2.7.4
--
Regards,
Vladimir

--
Regards,
Vladimir

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 3 lines

--
Regards,
Vladimir

--
Regards,
Vladimir

--
Regards,
Vladimir

#27 lore raw

Just one more question inline.

Quoted 203 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Thursday, January 16, 2020 2:03 PM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 6 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ori Kam
Sent: Thursday, January 16, 2020 5:06 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>;

Adrien

Quoted 2 lines

Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin

Jacob

Quoted 4 lines

Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 19 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Tuesday, January 14, 2020 11:28 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir

Quoted 8 lines

<[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 2 lines

Nicolau,

Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 23 lines
Quoted 4 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 19 lines

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 12 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 2 lines

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi
sorry for jumping in late.

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin,

Vladimir

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob

Joseph

Quoted 4 lines
Quoted 4 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>;

Quoted 5 lines
Quoted 5 lines

Jerin

Quoted 4 lines
Quoted 4 lines

Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

feature mandates that for every security session

an

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

rte_flow

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

is

created.

Quoted 1 line
Quoted 1 line
Quoted 1 line

This would internally translate to a rule in the

hardware

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

which would do packet classification.

In rte_securty, one SA would be one security

session.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

And

Quoted 5 lines

if

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

an rte_flow need to be created for every session,
the

number

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of SAs supported by an inline implementation

would

Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

limited by the number of rte_flows the PMD

would be

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

able to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If the fields SPI & IP addresses are allowed to be
a

range,

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

then this limitation can be overcome. Multiple
flows

will

Quoted 5 lines
Quoted 3 lines

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

able to use one rule for SECURITY processing. In
this

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be

NULL.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range, Am I missing something? As it is stated in the rte_fow.h security_session

Quoted 8 lines
Quoted 7 lines

can

Quoted 1 line

be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

[Ori] I'm less familiar with security, but this is what I understand you are

trying to

Quoted 1 line

do right?

[Anoob] Not exactly. In our implementation, h/w can index into a table which would hold security_sessions. So we can have one rte_flow rule, which will enable the packet steering in the hardware. Which session need to be used will be determined by the SPI.

Quoted 6 lines
Quoted 6 lines

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow rule need to be NULL. Having a non-zero security_session when SPI is a range would be

incorrect.

Quoted 3 lines
Quoted 1 line

[Ori] I'm all in favor decreasing number of flows.
Sorry for the basic question, what is the security_session /SA dependent

on?

[Anoob] No prob! In case of unicast IPsec, every SA would have a unique SPI. So we cannot have multiple SPI's referring to the same SA. And one SA would mean one security_session.

Quoted 1 line

Can one SA include number of different SPI?

[Anoob] No.

May be we need to reimagine this.

Quoted 7 lines

Currently, an rte_flow with SECURITY enables ipsec processing with a specific security_session on the packet. This is enabled on a specific IP/SPI specified in the rule.

My proposal: an rte_flow with SECURITY (and session = NULL), would enable ipsec processing on a range and SPI from the packet can be used by the h/w to further figure out the security_session.

O.K. so SPI can't be shared between SA (Security_session) while IP can right? Other why to ask my question is what is allowed to be in range to allow the same security_session?

<Snip>

#28 lore raw

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 232 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 16, 2020 7:08 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Just one more question inline.

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Thursday, January 16, 2020 2:03 PM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir

Quoted 8 lines

<[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 164 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 6 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ori Kam
Sent: Thursday, January 16, 2020 5:06 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>;

Adrien

Quoted 3 lines

Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin

Jacob

Quoted 4 lines

Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 19 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Tuesday, January 14, 2020 11:28 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir

Quoted 8 lines

<[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 2 lines

Nicolau,

Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 23 lines
Quoted 4 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 19 lines

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 12 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 2 lines

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi
sorry for jumping in late.

Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin,

Vladimir

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>; Anoob

Joseph

Quoted 4 lines
Quoted 4 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>;

Quoted 5 lines
Quoted 5 lines

Jerin

Quoted 4 lines
Quoted 4 lines

Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

feature mandates that for every security
session

an

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines

rte_flow

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line

is

created.

Quoted 2 lines
Quoted 2 lines

This would internally translate to a rule in
the

hardware

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

which would do packet classification.

In rte_securty, one SA would be one security

session.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

And

Quoted 5 lines

if

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

an rte_flow need to be created for every
session, the

number

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of SAs supported by an inline implementation

would

Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

limited by the number of rte_flows the PMD

would be

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

able to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If the fields SPI & IP addresses are allowed to
be a

range,

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

then this limitation can be overcome. Multiple
flows

will

Quoted 5 lines
Quoted 3 lines

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

able to use one rule for SECURITY processing.
In this

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be

NULL.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range, Am I missing something? As it is stated in the rte_fow.h security_session

can

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

[Ori] I'm less familiar with security, but this is what I understand you are

Quoted 13 lines

trying to

Quoted 1 line

do right?

[Anoob] Not exactly. In our implementation, h/w can index into a table which would hold security_sessions. So we can have one rte_flow rule, which will enable the packet steering in the hardware. Which session need to be used will be determined by the SPI.

Quoted 5 lines
Quoted 5 lines

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow rule

need to be NULL.

Quoted 22 lines
Quoted 1 line
Quoted 1 line

Having a non-zero security_session when SPI is a range would be

incorrect.

Quoted 4 lines
Quoted 1 line

[Ori] I'm all in favor decreasing number of flows. Sorry for the basic question, what is the security_session /SA dependent

on?

[Anoob] No prob! In case of unicast IPsec, every SA would have a unique SPI. So we cannot have multiple SPI's referring to the same SA. And one SA would mean one security_session.

Quoted 1 line

Can one SA include number of different SPI?

[Anoob] No.

May be we need to reimagine this.

Currently, an rte_flow with SECURITY enables ipsec processing with a specific security_session on the packet. This is enabled on a specific IP/SPI specified in the rule.

Quoted 7 lines
Quoted 3 lines

My proposal: an rte_flow with SECURITY (and session = NULL), would enable ipsec processing on a range and SPI from the packet can be used by the h/w to further figure out the security_session.

O.K. so SPI can't be shared between SA (Security_session) while IP can right? Other why to ask my question is what is allowed to be in range to allow the same security_session?

[Anoob] With a single IP system, SPI is enough to uniquely identify an SA. So for such cases, DST_IP can be a range, and session can be non_null. In other words, in single IP systems, SPI would mean one tunnel and so DST_IP is not required to be looked up. Whether to do lookup on SPI only or DST_IP+SPI is determined by the configuration, and so it makes sense to allow such with rte_flow framework.

#29 lore raw

Hi Anoob,

Thanks for your explanation.
Best,
Ori

Quoted 288 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Saturday, January 18, 2020 10:12 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 6 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 16, 2020 7:08 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>;

Adrien

Quoted 2 lines

Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin

Jacob

Quoted 4 lines

Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 19 lines

Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Just one more question inline.

Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Thursday, January 16, 2020 2:03 PM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir

Quoted 8 lines

<[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Quoted 2 lines

Nicolau,

Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 21 lines
Quoted 21 lines

Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Thanks,
Anoob

Quoted 6 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Ori Kam
Sent: Thursday, January 16, 2020 5:06 PM
To: Anoob Joseph <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal <[email protected]>;

Adrien

Quoted 3 lines

Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin

Quoted 7 lines
Quoted 7 lines

Jacob

Quoted 4 lines

Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Nicolau,

Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 6 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Anoob Joseph
Sent: Tuesday, January 14, 2020 11:28 AM
To: Ori Kam <[email protected]>; Medvedkin, Vladimir <[email protected]>; Ananyev, Konstantin <[email protected]>; Akhil Goyal

<[email protected]>;

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Nicolau,

Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi Ori,

Please see inline.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Thanks,
Anoob

Quoted 4 lines

-----Original Message-----
From: Ori Kam <[email protected]>
Sent: Thursday, January 9, 2020 1:06 PM
To: Medvedkin, Vladimir <[email protected]>;

Ananyev,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Konstantin <[email protected]>; Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>;

Adrien

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; Yigit, Ferruh <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 12 lines
Quoted 12 lines
Quoted 2 lines

Nicolau,

Quoted 1 line
Quoted 1 line

Radu <[email protected]>; Shahaf Shuler

<[email protected]>;

Quoted 1 line
Quoted 1 line
Quoted 1 line

Narayana Prasad Raju Athreya <[email protected]>;

[email protected]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Subject: RE: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Hi
sorry for jumping in late.

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Medvedkin,

Vladimir

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Sent: Wednesday, January 8, 2020 4:30 PM
To: Ananyev, Konstantin <[email protected]>;

Anoob

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Joseph

Quoted 2 lines
Quoted 2 lines

<[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty,

Declan

Quoted 80 lines
Quoted 80 lines
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

<[email protected]>; Yigit, Ferruh
<[email protected]>;

Jerin

Quoted 4 lines
Quoted 4 lines

Jacob Kollanukkaran <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Ankur Dwivedi <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Nicolau, Radu <[email protected]>; Shahaf Shuler <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [EXT] Re: [PATCH] ethdev: allow multiple security sessions to use one rte flow

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

Hi Anoob,

Quoted 2 lines · Konstantin
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The rte_security API which enables inline

protocol/crypto

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

feature mandates that for every security
session

an

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines

rte_flow

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line

is

created.

Quoted 2 lines

This would internally translate to a rule in
the

hardware

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

which would do packet classification.

In rte_securty, one SA would be one security

session.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

And

Quoted 5 lines

if

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

an rte_flow need to be created for every
session, the

number

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

of SAs supported by an inline implementation

would

Quoted 2 lines
Quoted 2 lines

be

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

limited by the number of rte_flows the PMD

would be

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

able to

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

support.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

If the fields SPI & IP addresses are allowed to
be a

range,

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

then this limitation can be overcome. Multiple
flows

will

Quoted 5 lines
Quoted 3 lines

be

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

able to use one rule for SECURITY processing.
In this

case,

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the security session provided as conf would be

NULL.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

Why is that?
If the rte flow can have a range then this means that we need one security_session for the entire range, Am I missing something? As it is stated in the rte_fow.h security_session

can

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

be used for multiple flows.

[Anoob] One SA would mean one security_session. So if we have one security_session for the entire range, then it will be like having single SA for a range of IP & SPI. Do you think we should allow that?

[Ori] I'm less familiar with security, but this is what I understand you are

trying to

Quoted 1 line

do right?

[Anoob] Not exactly. In our implementation, h/w can index into a table which would hold security_sessions. So we can have one rte_flow rule, which will enable the packet steering in the hardware. Which session need to be used will be determined by the SPI.

Quoted 1 line
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Also, the intent of the patch is to minimize the number of rte_flow rules required for inline ipsec processing. Since the security session is per SA, and if we need multiple SPIs to use same rte_flow rule, then the security_session field in the rte_flow

rule

Quoted 10 lines

need to be NULL.

Quoted 9 lines
Quoted 1 line
Quoted 1 line

Having a non-zero security_session when SPI is a range would be

incorrect.

Quoted 4 lines
Quoted 1 line

[Ori] I'm all in favor decreasing number of flows. Sorry for the basic question, what is the security_session /SA dependent

on?

[Anoob] No prob! In case of unicast IPsec, every SA would have a unique

SPI.

Quoted 13 lines
Quoted 13 lines

So we cannot have multiple SPI's referring to the same SA. And one SA would mean one security_session.

Quoted 1 line

Can one SA include number of different SPI?

[Anoob] No.

May be we need to reimagine this.

Currently, an rte_flow with SECURITY enables ipsec processing with a specific security_session on the packet. This is enabled on a specific IP/SPI specified in the rule.

Quoted 5 lines
Quoted 3 lines

My proposal: an rte_flow with SECURITY (and session = NULL), would enable ipsec processing on a range and SPI from the packet can be used by the h/w to further figure out the security_session.

O.K. so SPI can't be shared between SA (Security_session) while IP can

right?

Quoted 2 lines

Other why to ask my question is what is allowed to be in range to allow the same security_session?

[Anoob] With a single IP system, SPI is enough to uniquely identify an SA. So for such cases, DST_IP can be a range, and session can be non_null. In other words, in single IP systems, SPI would mean one tunnel and so DST_IP is not required to be looked up. Whether to do lookup on SPI only or DST_IP+SPI is determined by the configuration, and so it makes sense to allow such with rte_flow framework.