Skip to contentSkip to conversation

ethdev: add IPsec event subtype range for PMD specific code

PATCH In review Nithin Dabilpuram 4 participants 6 messages Oct 4, 2023 – Oct 12, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ethdev: add IPsec event subtype range for PMD specific code

Add IPsec event subtype range for PMD specific code in order to accommodate wide range of errors that PMD supports. These IPsec event subtypes are used when an error doesn't match the spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.

---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/ethdev/rte_ethdev.h +4 -0
index 8542257721..f949dfc83d 100644
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 net/cnxk: report undefined IPsec errors as PMD error

Report IPsec event subtype as PMD error for errors that are not defined in spec.

---
 drivers/net/cnxk/cn10k_ethdev_sec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/cnxk/cn10k_ethdev_sec.c +2 -2
index b98fc9378e..d1df4a01e6 100644
@@ -522,7 +522,7 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args, uint32_t soft_exp_event)
 			plt_warn("Outbound error, bad ip pkt, mbuf %p,"
 				 " sa_index %u (total warnings %" PRIu64 ")",
 				 mbuf, sess_priv.sa_idx, warn_cnt);
-		desc.subtype = RTE_ETH_EVENT_IPSEC_UNKNOWN;
+		desc.subtype = -res->uc_compcode;
 		break;
 	default:
 		warn_cnt++;
@@ -532,7 +532,7 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args, uint32_t soft_exp_event)
 				 " (total warnings %" PRIu64 ")",
 				 mbuf, sess_priv.sa_idx, res->compcode,
 				 res->uc_compcode, warn_cnt);
-		desc.subtype = RTE_ETH_EVENT_IPSEC_UNKNOWN;
+		desc.subtype = -res->uc_compcode;
 		break;
 	}
 
Signature · 1 line
2.25.1
#2 lore raw
In reply to Nithin Dabilpuram
Quoted 18 lines · Nithin Dabilpuram

Add IPsec event subtype range for PMD specific code in order to accommodate wide range of errors that PMD supports. These IPsec event subtypes are used when an error doesn't match the spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.

---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/ethdev/rte_ethdev.h +0 -0
index 8542257721..f949dfc83d 100644

lib/ethdev/rte_ethdev.h struct rte_eth_event_macsec_desc { · line 3914

Quoted 10 lines
lib/ethdev/rte_ethdev.h +4 -0
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */

I don't see any problem to extend event subtype with custom error range, @Akhil, @Anoob what do you think?

Acked-by
#3 lore raw
Quoted 25 lines · Nithin Dabilpuram
Quoted 4 lines

Add IPsec event subtype range for PMD specific code in order to accommodate wide range of errors that PMD supports. These IPsec event subtypes are used when an error doesn't match the spec defined subtypes between

RTE_ETH_EVENT_IPSEC_UNKNOWN

Quoted 19 lines

and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.

---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/ethdev/rte_ethdev.h +3 -0
index 8542257721..f949dfc83d 100644
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_event_macsec_desc { · line 3914

Quoted 5 lines
lib/ethdev/rte_ethdev.h +1 -0
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */

I don't see any problem to extend event subtype with custom error range, @Akhil, @Anoob what do you think?

I believe it is ok to add the custom error range.
It is just that the user will need to check the negative values too, which I believe is ok.

#4 lore raw
Quoted 34 lines · Akhil Goyal
Quoted 25 lines · Nithin Dabilpuram
Quoted 4 lines

Add IPsec event subtype range for PMD specific code in order to accommodate wide range of errors that PMD supports. These IPsec event subtypes are used when an error doesn't match the spec defined subtypes between

RTE_ETH_EVENT_IPSEC_UNKNOWN

Quoted 19 lines

and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.

---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/ethdev/rte_ethdev.h +3 -0
index 8542257721..f949dfc83d 100644
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_event_macsec_desc { · line 3914

Quoted 5 lines
lib/ethdev/rte_ethdev.h +1 -0
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */

I don't see any problem to extend event subtype with custom error range, @Akhil, @Anoob what do you think?

Quoted 8 lines

I believe it is ok to add the custom error range.
It is just that the user will need to check the negative values too, which I believe is ok.

Series applied to dpdk-next-net/main, thanks.

Acked-by
#5 lore raw
In reply to Ferruh Yigit

Hi Ferruh,

Quoted 26 lines

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

Quoted 23 lines · Nithin Dabilpuram

Add IPsec event subtype range for PMD specific code in order to accommodate wide range of errors that PMD supports.
These IPsec event subtypes are used when an error doesn't match the spec defined subtypes between RTE_ETH_EVENT_IPSEC_UNKNOWN and RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.

---
 lib/ethdev/rte_ethdev.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/ethdev/rte_ethdev.h index renamed from lib/ethdev/rte_ethdev.h +0 -0

8542257721..f949dfc83d 100644

lib/ethdev/rte_ethdev.h +3 -0
@@ -3905,6 +3905,10 @@ struct rte_eth_event_macsec_desc {
  * eth device.
  */
 enum rte_eth_event_ipsec_subtype {
+	/**  PMD specific error start */
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_START = -256,
+	/**  PMD specific error end */
Quoted 8 lines

lib/ethdev/rte_ethdev.h struct rte_eth_event_macsec_desc { · line 3914

Quoted 5 lines
lib/ethdev/rte_ethdev.h +1 -0
+	RTE_ETH_EVENT_IPSEC_PMD_ERROR_END = -1,
 	/** Unknown event type */
 	RTE_ETH_EVENT_IPSEC_UNKNOWN = 0,
 	/** Sequence number overflow */

I don't see any problem to extend event subtype with custom error range, @Akhil, @Anoob what do you think?

[Anoob] Thanks for looping in. I do not see an issue with the approach either.

Thanks,
Anoob