ethdev: add IPsec event subtype range for PMD specific code
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
@@ -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
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
@@ -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
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_UNKNOWNandRTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.Signed-off-by Nithin Dabilpuram <[email protected]>--- lib/ethdev/rte_ethdev.h | 4 ++++ 1 file changed, 4 insertions(+)lib/ethdev/rte_ethdev.h +0
-0
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?
Akhil Goyal
Acked-byQuoted 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_UNKNOWNQuoted 19 lines
and
RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.Signed-off-by Nithin Dabilpuram <[email protected]>--- lib/ethdev/rte_ethdev.h | 4 ++++ 1 file changed, 4 insertions(+)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?
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.
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_UNKNOWNQuoted 19 lines
and
RTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.Signed-off-by Nithin Dabilpuram <[email protected]>--- lib/ethdev/rte_ethdev.h | 4 ++++ 1 file changed, 4 insertions(+)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?
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.Acked-by Akhil Goyal <[email protected]>Acked-by Anoob Joseph <[email protected]>
Series applied to dpdk-next-net/main, thanks.
Anoob Joseph
Acked-byHi 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 betweenRTE_ETH_EVENT_IPSEC_UNKNOWNandRTE_ETH_EVENT_IPSEC_MAX. Adding this as -ve error range to avoid ABI breakage.Signed-off-by Nithin Dabilpuram <[email protected]>--- 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
-08542257721..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