Such can be initiated when a packet hits an outer rule. Signed-off-by: Ivan Malov <ivan.ma...@arknetworks.am> Reviewed-by: Andy Moreton <amore...@xilinx.com> --- drivers/common/sfc_efx/base/efx.h | 9 +++++++++ drivers/common/sfc_efx/base/efx_impl.h | 1 + drivers/common/sfc_efx/base/efx_mae.c | 26 ++++++++++++++++++++++++++ drivers/common/sfc_efx/version.map | 1 + 4 files changed, 37 insertions(+)
diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index dd9d4f29e8..99ef0ce957 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4679,6 +4679,15 @@ efx_mae_outer_rule_recirc_id_set( __in efx_mae_match_spec_t *spec, __in uint8_t recirc_id); +/* + * Request that packets hitting this rule be submitted + * for a lookup in the conntrack assistance table. + */ +LIBEFX_API +extern __checkReturn efx_rc_t +efx_mae_outer_rule_do_ct_set( + __in efx_mae_match_spec_t *spec); + LIBEFX_API extern __checkReturn efx_rc_t efx_mae_outer_rule_insert( diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index 9a5d465fa0..0a6a489d2c 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1761,6 +1761,7 @@ struct efx_mae_match_spec_s { uint8_t outer[MAE_ENC_FIELD_PAIRS_LEN]; } emms_mask_value_pairs; uint8_t emms_outer_rule_recirc_id; + boolean_t emms_outer_rule_do_ct; }; typedef enum efx_mae_action_e { diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index b00ed2ec7a..546c743a02 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -2369,6 +2369,26 @@ efx_mae_outer_rule_recirc_id_set( return (0); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + __checkReturn efx_rc_t +efx_mae_outer_rule_do_ct_set( + __in efx_mae_match_spec_t *spec) +{ + efx_rc_t rc; + + if (spec->emms_type != EFX_MAE_RULE_OUTER) { + rc = EINVAL; + goto fail1; + } + + spec->emms_outer_rule_do_ct = B_TRUE; + + return (0); + fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -2389,6 +2409,7 @@ efx_mae_outer_rule_insert( uint32_t encap_type_mcdi; efx_mae_rule_id_t or_id; size_t offset; + uint8_t do_ct; efx_rc_t rc; EFX_STATIC_ASSERT(sizeof (or_idp->id) == @@ -2451,6 +2472,11 @@ efx_mae_outer_rule_insert( MAE_OUTER_RULE_INSERT_IN_RECIRC_ID, spec->emms_outer_rule_recirc_id); + do_ct = (spec->emms_outer_rule_do_ct == B_FALSE) ? 0 : 1; + + MCDI_IN_SET_DWORD_FIELD(req, MAE_OUTER_RULE_INSERT_IN_LOOKUP_CONTROL, + MAE_OUTER_RULE_INSERT_IN_DO_CT, do_ct); + efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map index d972896210..28a2be0a95 100644 --- a/drivers/common/sfc_efx/version.map +++ b/drivers/common/sfc_efx/version.map @@ -143,6 +143,7 @@ INTERNAL { efx_mae_mport_free; efx_mae_mport_id_by_selector; efx_mae_mport_invalid; + efx_mae_outer_rule_do_ct_set; efx_mae_outer_rule_insert; efx_mae_outer_rule_recirc_id_set; efx_mae_outer_rule_remove; -- 2.30.2