From afb41254338719e57cab8ffc8b395adda8546912 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Tue, 20 Oct 2020 10:13:28 +0100 Subject: [PATCH] common/sfc_efx/base: add MAE match fields for IPv4 Add MCDI-compatible enumeration for these fields and provide necessary mappings for them to be inserted directly into mask-value pairs buffer. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/common/sfc_efx/base/efx.h | 5 +++++ drivers/common/sfc_efx/base/efx_mae.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index 30bd411843..ed15e5e0d5 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4107,6 +4107,11 @@ typedef enum efx_mae_field_id_e { EFX_MAE_FIELD_VLAN0_PROTO_BE, EFX_MAE_FIELD_VLAN1_TCI_BE, EFX_MAE_FIELD_VLAN1_PROTO_BE, + EFX_MAE_FIELD_SRC_IP4_BE, + EFX_MAE_FIELD_DST_IP4_BE, + EFX_MAE_FIELD_IP_PROTO, + EFX_MAE_FIELD_IP_TOS, + EFX_MAE_FIELD_IP_TTL, EFX_MAE_FIELD_NIDS } efx_mae_field_id_t; diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 46b3655182..9618942ed7 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -290,6 +290,11 @@ typedef enum efx_mae_field_cap_id_e { EFX_MAE_FIELD_ID_VLAN0_PROTO_BE = MAE_FIELD_VLAN0_PROTO, EFX_MAE_FIELD_ID_VLAN1_TCI_BE = MAE_FIELD_VLAN1_TCI, EFX_MAE_FIELD_ID_VLAN1_PROTO_BE = MAE_FIELD_VLAN1_PROTO, + EFX_MAE_FIELD_ID_SRC_IP4_BE = MAE_FIELD_SRC_IP4, + EFX_MAE_FIELD_ID_DST_IP4_BE = MAE_FIELD_DST_IP4, + EFX_MAE_FIELD_ID_IP_PROTO = MAE_FIELD_IP_PROTO, + EFX_MAE_FIELD_ID_IP_TOS = MAE_FIELD_IP_TOS, + EFX_MAE_FIELD_ID_IP_TTL = MAE_FIELD_IP_TTL, EFX_MAE_FIELD_CAP_NIDS } efx_mae_field_cap_id_t; @@ -339,6 +344,11 @@ static const efx_mae_mv_desc_t __efx_mae_action_rule_mv_desc_set[] = { EFX_MAE_MV_DESC(VLAN0_PROTO_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(VLAN1_TCI_BE, EFX_MAE_FIELD_BE), EFX_MAE_MV_DESC(VLAN1_PROTO_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC(SRC_IP4_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC(DST_IP4_BE, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC(IP_PROTO, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC(IP_TOS, EFX_MAE_FIELD_BE), + EFX_MAE_MV_DESC(IP_TTL, EFX_MAE_FIELD_BE), #undef EFX_MAE_MV_DESC }; -- 2.20.1