[v2,13/13] net/cnxk: handle hard expiry events

Message ID 20221013114156.996517-13-ndabilpuram@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v2,01/13] common/cnxk: set MTU size on SDP based on SoC type |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Nithin Dabilpuram Oct. 13, 2022, 11:41 a.m. UTC
  From: Vamsi Attunuru <vattunuru@marvell.com>

Based on the hard limits configured in the SA context,
PMD passes corresponding event subtype to the application
to notify hard expiry event

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 drivers/net/cnxk/cn10k_ethdev_sec.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c
index ce1b10d885..ed5c335787 100644
--- a/drivers/net/cnxk/cn10k_ethdev_sec.c
+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c
@@ -479,6 +479,12 @@  cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args, uint32_t soft_exp_event)
 	case ROC_IE_OT_UCC_ERR_SA_OVERFLOW:
 		desc.subtype = RTE_ETH_EVENT_IPSEC_ESN_OVERFLOW;
 		break;
+	case ROC_IE_OT_UCC_ERR_SA_EXPIRED:
+		if (sa->w2.s.life_unit == ROC_IE_OT_SA_LIFE_UNIT_PKTS)
+			desc.subtype = RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY;
+		else
+			desc.subtype = RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY;
+		break;
 	case ROC_IE_OT_UCC_ERR_PKT_IP:
 		warn_cnt++;
 		if (warn_cnt % 10000 == 0)