Skip to contentSkip to conversation

ethdev: allow multiple security sessions to use one rte flow

RFC In review Anoob Joseph 4 participants 13 messages Jul 24, 2019 – Dec 3, 2019

lore
Share & tools
lore
#0 lore raw

RFC 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 f3a8fb1..4977d3c 100644
@@ -1879,6 +1879,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
#1 lore raw

Hi Akhil, Adrien, Declan, Pablo,

Can you review this proposal and share your feedback?

Thanks,
Anoob

Quoted 62 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, July 24, 2019 7:47 PM
To: Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [RFC] 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 index renamed from lib/librte_ethdev/rte_flow.h +0 -0

f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +9 -1
@@ -1879,6 +1879,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

#2 lore raw

Hi all,

Reminder...!

If there are no concerns, I'll send the patch after adding the required changes in ipsec-secgw as well.

Thanks,
Anoob

Quoted 93 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Friday, August 2, 2019 11:05 AM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: RE: [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Akhil, Adrien, Declan, Pablo,

Can you review this proposal and share your feedback?

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, July 24, 2019 7:47 PM
To: Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>;

Shahaf

Quoted 2 lines

Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Yongseok

Quoted 9 lines

Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [RFC] 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.

Quoted 9 lines

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 32 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 f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -1879,6 +1879,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

#3 lore raw

Hi Anoob,

Quoted 5 lines

Hi all,

Reminder...!

Sorry for a delayed response.

Quoted 67 lines

If there are no concerns, I'll send the patch after adding the required changes in ipsec-secgw as well.

Thanks,
Anoob

Quoted 61 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Friday, August 2, 2019 11:05 AM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: RE: [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Akhil, Adrien, Declan, Pablo,

Can you review this proposal and share your feedback?

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, July 24, 2019 7:47 PM
To: Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>;

Shahaf

Quoted 2 lines

Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Yongseok

Quoted 9 lines

Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [RFC] 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.

Quoted 9 lines

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.

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow. I believe SPI value should not be a range for applying a particular SA or session.

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows. How will the keys and other SA related info will be passed to the driver/HW.

Quoted 32 lines
Quoted 32 lines
Quoted 32 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 f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -1879,6 +1879,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

#4 lore raw

Hi Akhil,

Please see inline.

Thanks,
Anoob

Quoted 106 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Wednesday, August 14, 2019 4:37 PM
To: Anoob Joseph <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: RE: [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 5 lines

Hi all,

Reminder...!

Sorry for a delayed response.

Quoted 18 lines

If there are no concerns, I'll send the patch after adding the required changes in ipsec-secgw as well.

Thanks,
Anoob

Quoted 12 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Friday, August 2, 2019 11:05 AM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>;

Hemant

Quoted 1 line
Quoted 1 line

Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 46 lines
Quoted 46 lines

Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: RE: [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Akhil, Adrien, Declan, Pablo,

Can you review this proposal and share your feedback?

Thanks,
Anoob

Quoted 11 lines

-----Original Message-----
From: Anoob Joseph <[email protected]>
Sent: Wednesday, July 24, 2019 7:47 PM
To: Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Anoob Joseph <[email protected]>; Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>;

Shahaf

Quoted 2 lines

Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>;

Yongseok

Quoted 10 lines

Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [RFC] 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.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the driver/HW.

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to be created.

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the security session identified with its SPI.

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number of SAs that can be supported.

Quoted 33 lines
Quoted 33 lines
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 f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -1879,6 +1879,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 Anoob,

Quoted 38 lines
Quoted 24 lines
Quoted 13 lines
Quoted 13 lines
Quoted 6 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.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the driver/HW.

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to be created.

Quoted 6 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the security session identified with its SPI.

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number of SAs that can be supported.

QQ: Would that change be accompanied with real implementation for some particular PMD? Konstantin

Quoted 34 lines
Quoted 34 lines
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 f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +9 -0
@@ -1879,6 +1879,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

Hi Konstantin,

Please see inline.

Thanks,
Anoob

Quoted 70 lines

-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Thursday, August 15, 2019 3:18 PM
To: Anoob Joseph <[email protected]>; Akhil Goyal <[email protected]>; Adrien Mazarguil <[email protected]>; Doherty, Declan <[email protected]>; De Lara Guarch, Pablo <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Lu, Wenzhuo <[email protected]>; Nicolau, Radu <[email protected]>; [email protected]
Subject: RE: [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

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

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines
Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 3 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and

rte_security session.

Quoted 4 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact

our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to be created.

Quoted 4 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a

DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the security session identified with its SPI.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of

one flow per session is creating an artificial limit to the number of SAs that can be supported.

QQ: Would that change be accompanied with real implementation for some particular PMD?
Konstantin

[Anoob] Yes. This will be implemented as part of the rte_security additions in net_octeontx2 PMD, which will be upstreamed this release cycle.

Quoted 38 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

lib/librte_ethdev/rte_flow.h +0 -0
@@ -1879,6 +1879,12 @@ struct rte_flow_action_meter {
  * 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
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

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

#7 lore raw
In reply to Anoob Joseph

Hi Anoob,

Quoted 29 lines

Hi Akhil,

Quoted 26 lines
Quoted 12 lines
Quoted 12 lines
Quoted 5 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.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Quoted 7 lines
Quoted 3 lines

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the driver/HW.

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 6 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to be created.

I am not able to understand the issue here. Flow are validated based on some pattern,
You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case). You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 10 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the security session identified with its SPI.

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it. But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One put a range to that.

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB and do all the processing.

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you? Atleast for NXP devices we are able to work as is without any issue.

Quoted 11 lines
Quoted 11 lines
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 16 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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 items
+ 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil

#8 lore raw

Hi Akhil,

Please see inline.

Thanks,
Anoob

Quoted 97 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Akhil Goyal
Sent: Friday, August 16, 2019 2:02 PM
To: Anoob Joseph <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [RFC] ethdev: allow multiple security sessions to use one rte flow

Hi Anoob,

Quoted 6 lines

Hi Akhil,

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 is

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines
Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 4 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 6 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to

be created.

I am not able to understand the issue here. Flow are validated based on some pattern, You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case).
You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 6 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the

security session identified with its SPI.

Quoted 4 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number

of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it.
But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One put a range to that.

Quoted 4 lines

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB and do all the processing.

[Anoob] Yes. That is the model being followed right now. Concern is, whether this would be deviating from the spec. In other words, we could have devices which would need rte_flow for every rte_security session (ixgbe needs for inline crypto), and then we could have devices which doesn't need per session rte_flow (which is our case). What do you think is the right approach for supporting both kinds of devices?

Quoted 4 lines

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you?

[Anoob] In ipsec-secgw, a default flow would be created per security enabled port with 'conf=NULL' & SPI = 'ANY'. Flow validate would be done to make sure the underlying PMD supports it. For PMDs which doesn't support this model, per SA flow would be created.

Quoted 1 line

Atleast for NXP devices we are able to work as is without any issue.

[Anoob] Just curious, would having such a dependency on rte_flow be an issue for NXP devices?

Quoted 36 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
Quoted 12 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

session.

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil

#9 lore raw

Hi Anoob,

Quoted 82 lines

Hi Akhil,

Quoted 74 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 is

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines
Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 4 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 6 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to

be created.

I am not able to understand the issue here. Flow are validated based on some pattern, You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case).
You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 6 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the

security session identified with its SPI.

Quoted 4 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number

of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it.
But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One put a range to that.

Quoted 4 lines

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB and do all the processing.

Quoted 6 lines

[Anoob] Yes. That is the model being followed right now. Concern is, whether this would be deviating from the spec. In other words, we could have devices which would need rte_flow for every rte_security session (ixgbe needs for inline crypto), and then we could have devices which doesn't need per session rte_flow (which is our case). What do you think is the right approach for supporting both kinds of devices?

Inline proto case is not using rte_flow at the moment.
And as far as I understand, you also do not need rte_flow to be configured.
Inline crypto cases are mainly for Intel and Mellanox cases which only supported Inline crypto. For Protocol offload cases, I don't feel we need rte_flow as all information related to ipsec is already there when we call the session create. Rte_flows are used For segregation of ethernet traffic for classification which can be configured for various factors as well.

Quoted 10 lines
Quoted 5 lines

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you?

[Anoob] In ipsec-secgw, a default flow would be created per security enabled port with 'conf=NULL' & SPI = 'ANY'. Flow validate would be done to make sure the underlying PMD supports it. For PMDs which doesn't support this model, per SA flow would be created.

Why do you need that flow as well. You have all the information in the session already. You can process the packets based on that information. Isn't it?
Current implementation in application is good enough in my opinion.

Quoted 5 lines
Quoted 2 lines

Atleast for NXP devices we are able to work as is without any issue.

[Anoob] Just curious, would having such a dependency on rte_flow be an issue for NXP devices?

As of now I do not have any comment on this. We are not using rte_flow in our work as of now. It is kind of POC for us, we may not upstream it.
This will depend on the changes that will be done.

Quoted 37 lines
Quoted 37 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

session.

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil

#10 lore raw
Quoted 114 lines · Akhil Goyal

Hi Anoob,

Quoted 82 lines

Hi Akhil,

Quoted 74 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 is

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines
Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 4 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 6 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way, rte_flow_validate() would fail and then per SPI rte_flow would require to

be created.

I am not able to understand the issue here. Flow are validated based on some pattern, You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case).
You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 6 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the

security session identified with its SPI.

Quoted 4 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number

of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it.
But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One put a range to that.

Quoted 4 lines

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB and do all the processing.

Quoted 6 lines

[Anoob] Yes. That is the model being followed right now. Concern is, whether this would be deviating from the spec. In other words, we could have devices which would need rte_flow for every rte_security session (ixgbe needs for inline crypto), and then we could have devices which doesn't need per session rte_flow (which is our case). What do you think is the right approach for supporting both kinds of devices?

Inline proto case is not using rte_flow at the moment.
And as far as I understand, you also do not need rte_flow to be configured.
Inline crypto cases are mainly for Intel and Mellanox cases which only supported Inline crypto. For Protocol offload cases, I don't feel we need rte_flow as all information related to ipsec is already there when we call the session create. Rte_flows are used For segregation of ethernet traffic for classification which can be configured for various factors as well.

Quoted 10 lines
Quoted 5 lines

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you?

[Anoob] In ipsec-secgw, a default flow would be created per security enabled port with 'conf=NULL' & SPI = 'ANY'. Flow validate would be done to make sure the underlying PMD supports it. For PMDs which doesn't support this model, per SA flow would be created.

Why do you need that flow as well. You have all the information in the session already. You can process the packets based on that information. Isn't it?
Current implementation in application is good enough in my opinion.

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Atleast for NXP devices we are able to work as is without any issue.

[Anoob] Just curious, would having such a dependency on rte_flow be an issue for NXP devices?

As of now I do not have any comment on this. We are not using rte_flow in our work as of now. It is kind of POC for us, we may not upstream it.
This will depend on the changes that will be done.

Is there any follow up to the RFC? Is it still valid?

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

session.

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil

#11 lore raw

Hi Ferruh,

I would like to pursue this RFC.

@Akhil, Please see inline.

Thanks,
Anoob

Quoted 143 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, October 8, 2019 6:30 PM
To: Akhil Goyal <[email protected]>; Anoob Joseph <[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad <[email protected]>; Yongseok Koh <[email protected]>; Wenzhuo Lu <[email protected]>; Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [RFC] ethdev: allow multiple security sessions to use one rte flow

External Email

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

Quoted 81 lines · Akhil Goyal

Hi Anoob,

Quoted 80 lines

Hi Akhil,

Quoted 77 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 is

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 6 lines
Quoted 6 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 4 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 8 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way,
rte_flow_validate() would fail and then per SPI rte_flow would require to

be created.

I am not able to understand the issue here. Flow are validated based on some pattern, You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case). You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 7 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the

security session identified with its SPI.

Quoted 5 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number

of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it.
But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One

put a range to that.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB

and do all the processing.

Quoted 8 lines
Quoted 7 lines

[Anoob] Yes. That is the model being followed right now. Concern is, whether this would be deviating from the spec. In other words, we could have devices which would need rte_flow for every rte_security session (ixgbe needs for inline crypto), and then we could have devices which doesn't need per session rte_flow (which is our case). What do you think is the right approach for supporting both kinds of devices?

Quoted 7 lines

Inline proto case is not using rte_flow at the moment.
And as far as I understand, you also do not need rte_flow to be configured. Inline crypto cases are mainly for Intel and Mellanox cases which only supported Inline crypto. For Protocol offload cases, I don't feel we need rte_flow as all information related to ipsec is already there when we call the session create. Rte_flows are used For segregation of ethernet traffic for classification which can be configured for various factors

as well.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you?

Quoted 6 lines
Quoted 4 lines

[Anoob] In ipsec-secgw, a default flow would be created per security enabled port with 'conf=NULL' & SPI = 'ANY'. Flow validate would be done to make sure the underlying PMD supports it. For PMDs which doesn't support this model, per SA flow would be created.

Why do you need that flow as well. You have all the information in the session

already.

Quoted 4 lines

You can process the packets based on that information. Isn't it? Current implementation in application is good enough in my opinion.

Quoted 1 line
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Atleast for NXP devices we are able to work as is without any issue.

[Anoob] Just curious, would having such a dependency on rte_flow be an issue for NXP devices?

As of now I do not have any comment on this. We are not using rte_flow in

our work as of now.

Quoted 2 lines

It is kind of POC for us, we may not upstream it. This will depend on the changes that will be done.

[Anoob] For inline crypto/protocol processing, a h/w lookup is required. Whether we need one per SPI is the question here.

The current approach in inline crypto assumes per session, rte_flow would be created. But for inline protocol, ipsec-secgw doesn't create any rte_flow, which also could work if we can have static rules to enable SECURITY processing for all ESP packets.

The problem is, in that case any other action on ESP packets could result in a conflict. Or if the applications wants to enable SECURITY processing only for specific flows, the current usage model wouldn't allow that.

May be I'll summarize my concerns,
1. rte_flow SECURITY action type requires a security session.
From the spec of rte_flow, "For INLINE_PROTOCOL, the security protocol is fully offloaded to HW, providing full encapsulation and decapsulation of packets in security protocols. The flow pattern specifies both the outer security header fields and the inner packet fields. The security session specified in the action must match the pattern parameters."

Issue: If only this is allowed, then the numbers of SAs supported will be limited by max number of flows supported. [Current ipsec-secgw is in violation of the above]

2. A static rule to enable security processing on all ESP packets can be enabled. With this, application won't be required to create rte_flow per flow and will be able to use SPI field to identify the security processing to be done on the packet.

Issue: If there are any conflicting rte_flow entries for ESP packets, the behavior is not defined. Also, if application wants to control the flows on which SECURITY processing is done (as in SECURITY is enabled only for selected SPI values), then it is not possible.

I believe it is okay to have either of them in ipsec-secgw, but as a spec we should allow both use cases. Also, all these can be protected by capability check/rte_flow_validate(). So if any PMD doesn't support these modes, an alternate path can be taken. What do you think?

Quoted 41 lines

Is there any follow up to the RFC? Is it still valid?

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

session.

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus created
+ can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil

#12 lore raw

Hi Akhil,

Can you see my responses below and see if I can pursue this RFC?

Thanks,
Anoob

Quoted 270 lines

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

Hi Ferruh,

I would like to pursue this RFC.

@Akhil, Please see inline.

Thanks,
Anoob

Quoted 4 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, October 8, 2019 6:30 PM
To: Akhil Goyal <[email protected]>; Anoob Joseph

Quoted 8 lines

<[email protected]>; Adrien Mazarguil <[email protected]>; Declan Doherty <[email protected]>; Pablo de Lara <[email protected]>; Thomas Monjalon <[email protected]>
Cc: Jerin Jacob Kollanukkaran <[email protected]>; Narayana Prasad Raju Athreya <[email protected]>; Ankur Dwivedi <[email protected]>; Shahaf Shuler <[email protected]>; Hemant Agrawal <[email protected]>; Matan Azrad

<[email protected]>;

Quoted 1 line

Yongseok Koh <[email protected]>; Wenzhuo Lu

<[email protected]>;

Quoted 93 lines

Konstantin Ananyev <[email protected]>; Radu Nicolau <[email protected]>; [email protected]
Subject: [EXT] Re: [dpdk-dev] [RFC] ethdev: allow multiple security sessions to use one rte flow

External Email

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

Quoted 84 lines · Akhil Goyal

Hi Anoob,

Quoted 83 lines

Hi Akhil,

Quoted 80 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

created.

Quoted 20 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

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

classification.

Quoted 6 lines

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

SPI values are normally used to uniquely identify the SA that need to be applied on a particular flow.
I believe SPI value should not be a range for applying a particular SA or session.

Quoted 7 lines
Quoted 7 lines

Plain packet IP addresses can be a range. That is not an issue. Multiple plain packet flows can use the same session/SA.

Why do you feel that security session provided should be NULL to support multiple flows.
How will the keys and other SA related info will be passed to the

driver/HW.

Quoted 4 lines

[Anoob] The SA configuration would be done via rte_security session. The proposal here only changes the 1:1 dependency of rte_flow and rte_security session.

I don't see this dependency for rte_flow and security session. Multiple flows can be configured to use the same security session.

Quoted 8 lines

The h/w could use SPI field in the received packet to identify SA(ie, rte_security session). If the h/w allows to index into a table which holds SA information, then per SPI rte_flow is not required. This is in fact our case. And for PMDs which doesn't do it this way,
rte_flow_validate() would fail and then per SPI rte_flow would require to

be created.

I am not able to understand the issue here. Flow are validated based on some pattern, You can identify the flow based on some parameter(currently it is spi in case of inline crypto and also your case). You can perform some action based on the security session that you have created before validating the flow And that session creation is nowhere linked to the type of flow. You can use the same session for as many flows you want.

Quoted 7 lines

In the present model, a security session is created, and then rte_flow will connect ESP packets with one SPI to one security session. Instead, when we create the security session, h/w can populate entries in a DB that would be accessed during data path handling. And the rte_flow could say, all SPI in some range gets inline processed with the

security session identified with its SPI.

Quoted 5 lines

Our PMD supports limited number of flow entries but our h/w can do SA lookup without flow entries(using SPI instead). So the current approach of one flow per session is creating an artificial limit to the number

of SAs that can be supported.

Ok now I got it. You want to configure a single flow with multiple sessions in it.
But defining a range in SPI and tunnel IP addresses does not make sense. In real world applications, Sessions can be created and destroyed at any time with varied values of SPI and tunnel IPs. How can One

Quoted 14 lines

put a range to that.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

I would rather say, you actually do not need the rte_flows to be configured for Inline protocol processing. You have configured all the session info in the hw while Creating the session and your H/W will be able to identify on the basis of SPI value which It has stored in the DB

and do all the processing.

Quoted 6 lines
Quoted 6 lines

[Anoob] Yes. That is the model being followed right now. Concern is, whether this would be deviating from the spec. In other words, we could have devices which would need rte_flow for every rte_security session (ixgbe needs for inline crypto), and then we could have devices which doesn't need per session rte_flow (which is our

case).

Quoted 1 line
Quoted 1 line
Quoted 1 line

What do you think is the right approach for supporting both kinds of

devices?

Quoted 29 lines
Quoted 9 lines

Inline proto case is not using rte_flow at the moment.
And as far as I understand, you also do not need rte_flow to be configured. Inline crypto cases are mainly for Intel and Mellanox cases which only supported Inline crypto. For Protocol offload cases, I don't feel we need rte_flow as all information related to ipsec is already there when we call the session create. Rte_flows are used For segregation of ethernet traffic for classification which can be configured for various factors

as well.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

What are the changes that you need in the ipsec-secgw for inline proto to work, there is No flow processing currently in the inline proto case. Will it not work as is for you?

Quoted 7 lines
Quoted 4 lines

[Anoob] In ipsec-secgw, a default flow would be created per security enabled port with 'conf=NULL' & SPI = 'ANY'. Flow validate would be done to make sure the underlying PMD supports it. For PMDs which doesn't support this model, per SA flow would be created.

Why do you need that flow as well. You have all the information in the session

already.

Quoted 4 lines

You can process the packets based on that information. Isn't it? Current implementation in application is good enough in my opinion.

Quoted 1 line
Quoted 10 lines
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Atleast for NXP devices we are able to work as is without any issue.

[Anoob] Just curious, would having such a dependency on rte_flow be an issue for NXP devices?

As of now I do not have any comment on this. We are not using rte_flow in

our work as of now.

Quoted 2 lines

It is kind of POC for us, we may not upstream it. This will depend on the changes that will be done.

[Anoob] For inline crypto/protocol processing, a h/w lookup is required. Whether we need one per SPI is the question here.

The current approach in inline crypto assumes per session, rte_flow would be created. But for inline protocol, ipsec-secgw doesn't create any rte_flow, which also could work if we can have static rules to enable SECURITY processing for all ESP packets.

The problem is, in that case any other action on ESP packets could result in a conflict. Or if the applications wants to enable SECURITY processing only for specific flows, the current usage model wouldn't allow that.

May be I'll summarize my concerns,
1. rte_flow SECURITY action type requires a security session.
From the spec of rte_flow, "For INLINE_PROTOCOL, the security protocol is fully offloaded to HW, providing full encapsulation and decapsulation of packets in security protocols. The flow pattern specifies both the outer security header fields and the inner packet fields. The security session specified in the action must match the pattern parameters."

Issue: If only this is allowed, then the numbers of SAs supported will be limited by max number of flows supported. [Current ipsec-secgw is in violation of the above]

2. A static rule to enable security processing on all ESP packets can be enabled. With this, application won't be required to create rte_flow per flow and will be able to use SPI field to identify the security processing to be done on the packet.

Issue: If there are any conflicting rte_flow entries for ESP packets, the behavior is not defined. Also, if application wants to control the flows on which SECURITY processing is done (as in SECURITY is enabled only for selected SPI values), then it is not possible.

I believe it is okay to have either of them in ipsec-secgw, but as a spec we should allow both use cases. Also, all these can be protected by capability check/rte_flow_validate(). So if any PMD doesn't support these modes, an alternate path can be taken. What do you think?

Quoted 41 lines

Is there any follow up to the RFC? Is it still valid?

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 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

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

Quoted 8 lines
(quoted diff) +0 -0

b/lib/librte_ethdev/rte_flow.h index f3a8fb1..4977d3c 100644

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

session.

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

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

Quoted 8 lines
lib/librte_ethdev/rte_flow.h +8 -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
+ items 'IPv4' and
+ * 'IPv6' will be allowed to be a range. The rule thus
+ created can enable
+ * SECURITY processing on multiple flows.

What you intent here is " The rule thus created can enable multiple security sessions on a single rte flow"

Regards,
Akhil