]> git.droids-corp.org - dpdk.git/commitdiff
common/sfc_efx/base: indicate MAE support for encapsulation
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 20 Oct 2020 09:13:35 +0000 (10:13 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:24:25 +0000 (23:24 +0100)
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>
drivers/common/sfc_efx/base/efx.h
drivers/common/sfc_efx/base/efx_impl.h
drivers/common/sfc_efx/base/efx_mae.c

index b84a43336a12d61bb437b91194565328c106338a..dea1fe39797636dfdf0b8fc6d86f0c897f4f7fc3 100644 (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
index 5f662b6fe3bad82d4519011070f8691ffb5ec6c4..3d1a4fdcb91df8da2b62ab2e81c29b28bd9230b3 100644 (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 */
index a2b541a9e2755bac0da35383c195774a81b3646a..58b323d939c3c2205856e6e022dc099af31a1c9f 100644 (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);