Skip to contentSkip to conversation

security: allow application to specify UDP ports to PMD

PATCH In review Tejasree Kondoj 2 participants 7 messages Sep 3, 2020 – Jan 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security: allow application to specify UDP ports to PMD

Add UDP source and destination ports in ipsec_xform to allow application to specify ports to be used for IPsec UDP encapsulation as they are dynamically changed by NAT in between. Also adding an extra flag to indicate whether PMD needs to perform encapsulation header verification in case of inbound. In case of inline IPsec implementation, verification of outer IP headers and UDP encapsulation headers need to be handled in the PMD. For lookaside IPsec, application can optionally offload this to the PMD.

---
 lib/librte_security/rte_security.h | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
lib/librte_security/rte_security.h +19 -0
index 16839e539..670bdeb6b 100644
@@ -130,6 +130,13 @@ struct rte_security_ipsec_sa_options {
 	 */
 	uint32_t udp_encap : 1;
 
+	/** Verify tunnel header and UDP encapsulation ports in inbound
+	 *
+	 * * 1: Match outer header source, destination addresses and UDP ports
+	 * * 0: Do not match outer IP addresses and UDP ports
+	 */
+	uint32_t encap_hdr_verify : 1;
+
 	/** Copy DSCP bits
 	 *
 	 * * 1: Copy IPv4 or IPv6 DSCP bits from inner IP header to
@@ -190,6 +197,16 @@ enum rte_security_ipsec_sa_direction {
 	/**< Verify digest and decrypt */
 };
 
+/**
+ * UDP encapsulation ports
+ */
+struct rte_security_ipsec_udp_encapsulation {
+	uint16_t src_port;
+	/**< UDP source port */
+	uint16_t dst_port;
+	/**< UDP destination port */
+};
+
 /**
  * IPsec security association configuration data.
  *
@@ -216,6 +233,8 @@ struct rte_security_ipsec_xform {
 	/**< Anti replay window size to enable sequence replay attack handling.
 	 * replay checking is disabled if the window size is 0.
 	 */
+	struct rte_security_ipsec_udp_encapsulation udp_encap;
+	/**< UDP encapsulation ports */
 };
 
 /**
Signature · 1 line
2.27.0
#1 lore raw

Hi Tejasree,

Quoted 11 lines

Add UDP source and destination ports in ipsec_xform to allow application to specify ports to be used for IPsec UDP encapsulation as they are dynamically changed by NAT in between. Also adding an extra flag to indicate whether PMD needs to perform encapsulation header verification in case of inbound. In case of inline IPsec implementation, verification of outer IP headers and UDP encapsulation headers need to be handled in the PMD. For lookaside IPsec, application can optionally offload this to the PMD.

---

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

Regards,
Akhil

#2 lore raw

Hi Akhil,

Please see inline.

Thanks
Tejasree

Quoted 24 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, September 11, 2020 12:39 AM
To: Tejasree Kondoj <[email protected]>; Radu Nicolau <[email protected]>
Cc: Narayana Prasad Raju Athreya <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] security: allow application to specify UDP ports to PMD

External Email

----------------------------------------------------------------------
Hi Tejasree,

Quoted 9 lines

Add UDP source and destination ports in ipsec_xform to allow application to specify ports to be used for IPsec UDP encapsulation as they are dynamically changed by NAT in between. Also adding an extra flag to indicate whether PMD needs to perform encapsulation header verification in case of inbound. In case of inline IPsec implementation, verification of outer IP headers and UDP encapsulation headers need to be handled in the PMD. For lookaside IPsec, application can optionally offload this to the PMD.

Quoted 5 lines
Quoted 2 lines

---

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

[Tejasree] You mean adding test case in either of the above apps or addition of PMD implementation also? Also is the proposal sounds fine?

Quoted 3 lines

Regards,
Akhil

#3 lore raw

Hi Tejasree,

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Add UDP source and destination ports in ipsec_xform to allow application to specify ports to be used for IPsec UDP encapsulation as they are dynamically changed by NAT in between. Also adding an extra flag to indicate whether PMD needs to perform encapsulation header verification in case of inbound. In case of inline IPsec implementation, verification of outer IP headers and UDP encapsulation headers need to be handled in the PMD. For lookaside IPsec, application can optionally offload this to the PMD.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

---

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

[Tejasree] You mean adding test case in either of the above apps or addition of PMD implementation also? Also is the proposal sounds fine?

I would say both, so that the newly added parameters are tested. I am ok with the proposal with a minor comment,

We can have udp_src_port and udp_dst_port directly into rte_security_ipsec_xform Instead of adding a new struct rte_security_ipsec_udp_encapsulation.

Regards,
Akhil

#4 lore raw

Please see inline.

Thanks
Tejasree

Quoted 33 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Monday, September 21, 2020 3:01 PM
To: Tejasree Kondoj <[email protected]>; Radu Nicolau <[email protected]>
Cc: Narayana Prasad Raju Athreya <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] security: allow application to specify UDP ports to PMD

External Email

----------------------------------------------------------------------
Hi Tejasree,

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Add UDP source and destination ports in ipsec_xform to allow application to specify ports to be used for IPsec UDP encapsulation as they are dynamically changed by NAT in between. Also adding an extra flag to indicate whether PMD needs to perform encapsulation header verification in case of inbound. In case of inline IPsec implementation, verification of outer IP headers and UDP encapsulation headers need to be handled in the PMD. For lookaside IPsec, application can optionally offload this to the PMD.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

---

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

[Tejasree] You mean adding test case in either of the above apps or addition of PMD implementation also? Also is the proposal sounds fine?

Quoted 6 lines

I would say both, so that the newly added parameters are tested. I am ok with the proposal with a minor comment,

We can have udp_src_port and udp_dst_port directly into rte_security_ipsec_xform Instead of adding a new struct rte_security_ipsec_udp_encapsulation.

[Tejasree] Okay. We'll defer the patch for now. Will add usage of the params and address the comment later.

Quoted 3 lines

Regards,
Akhil

#5 lore raw

Hi Tejasree,

Quoted 10 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

[Tejasree] You mean adding test case in either of the above apps or addition of PMD implementation also? Also is the proposal sounds fine?

I would say both, so that the newly added parameters are tested. I am ok with the proposal with a minor comment,

Quoted 7 lines
Quoted 3 lines

We can have udp_src_port and udp_dst_port directly into rte_security_ipsec_xform Instead of adding a new struct rte_security_ipsec_udp_encapsulation.

[Tejasree] Okay. We'll defer the patch for now. Will add usage of the params and address the comment later.

Any updates on this patch.

Regards,
Akhil

#6 lore raw

Hi Akhil,

Please see inline.

Thanks
Tejasree

Quoted 26 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, January 12, 2021 12:50 AM
To: Tejasree Kondoj <[email protected]>; Radu Nicolau <[email protected]>
Cc: Narayana Prasad Raju Athreya <[email protected]>; Anoob Joseph <[email protected]>; [email protected]
Subject: [EXT] RE: [PATCH] security: allow application to specify UDP ports to PMD

External Email

----------------------------------------------------------------------
Hi Tejasree,

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

I think we should add some usage of these newly added params
- either in app/test or in examples/ipsec-secgw

[Tejasree] You mean adding test case in either of the above apps or addition of PMD implementation also? Also is the proposal sounds

fine?

Quoted 4 lines
Quoted 4 lines
Quoted 1 line

I would say both, so that the newly added parameters are tested. I am ok with the proposal with a minor comment,

Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

We can have udp_src_port and udp_dst_port directly into rte_security_ipsec_xform Instead of adding a new struct rte_security_ipsec_udp_encapsulation.

[Tejasree] Okay. We'll defer the patch for now. Will add usage of the params and address the comment later.

Any updates on this patch.

[Tejasree] Not yet. We'll address it later as it needs internal firmware changes.

Quoted 3 lines

Regards,
Akhil