common/sfc_efx/base: indicate MAE support for encapsulation

MAE provides support for encapsulation. One needs to insert
a so-called outer rule, which can match outer packet fields,
to require that matching packets be parsed as tunnel frames
of a given type (VXLAN, Geneve, NVGRE). Then it is possible
to chain this rule with an action rule in order to match on
inner fields and carry out some actions on matching packets.

Report to clients what encapsulation types are supported by
MAE. Indicate the number of priority levels for outer rules.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
This commit is contained in:
Ivan Malov 2020-10-20 10:13:35 +01:00 committed by Ferruh Yigit
parent c50442b0a7
commit 891408c45a
3 changed files with 26 additions and 0 deletions

View File

@ -4068,6 +4068,8 @@ efx_mae_fini(
typedef struct efx_mae_limits_s {
uint32_t eml_max_n_action_prios;
uint32_t eml_max_n_outer_prios;
uint32_t eml_encap_types_supported;
} efx_mae_limits_t;
LIBEFX_API

View File

@ -798,6 +798,8 @@ typedef struct efx_mae_s {
/** Action rule match field capabilities. */
efx_mae_field_cap_t *em_action_rule_field_caps;
size_t em_action_rule_field_caps_size;
uint32_t em_max_n_outer_prios;
uint32_t em_encap_types_supported;
} efx_mae_t;
#endif /* EFSYS_OPT_MAE */

View File

@ -39,9 +39,29 @@ efx_mae_get_capabilities(
goto fail2;
}
maep->em_max_n_outer_prios =
MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_OUTER_PRIOS);
maep->em_max_n_action_prios =
MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_ACTION_PRIOS);
maep->em_encap_types_supported = 0;
if (MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_ENCAP_TYPE_VXLAN) == 1) {
maep->em_encap_types_supported |=
(1U << EFX_TUNNEL_PROTOCOL_VXLAN);
}
if (MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_ENCAP_TYPE_GENEVE) == 1) {
maep->em_encap_types_supported |=
(1U << EFX_TUNNEL_PROTOCOL_GENEVE);
}
if (MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_ENCAP_TYPE_NVGRE) == 1) {
maep->em_encap_types_supported |=
(1U << EFX_TUNNEL_PROTOCOL_NVGRE);
}
maep->em_max_nfields =
MCDI_OUT_DWORD(req, MAE_GET_CAPS_OUT_MATCH_FIELD_COUNT);
@ -225,7 +245,9 @@ efx_mae_get_limits(
goto fail1;
}
emlp->eml_max_n_outer_prios = maep->em_max_n_outer_prios;
emlp->eml_max_n_action_prios = maep->em_max_n_action_prios;
emlp->eml_encap_types_supported = maep->em_encap_types_supported;
return (0);