Add the logic of modify IPv4 TTL value.

Signed-off-by: Chaoyong He <chaoyong...@corigine.com>
Reviewed-by: Long Wu <long...@corigine.com>
Reviewed-by: Peng Zhang <peng.zh...@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_flow.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/nfp/flower/nfp_flower_flow.c 
b/drivers/net/nfp/flower/nfp_flower_flow.c
index a25151cca1..9950d158c3 100644
--- a/drivers/net/nfp/flower/nfp_flower_flow.c
+++ b/drivers/net/nfp/flower/nfp_flower_flow.c
@@ -1224,6 +1224,8 @@ nfp_flow_field_id_dst_support(enum rte_flow_field_id 
field)
        case RTE_FLOW_FIELD_UDP_PORT_SRC:
                /* FALLTHROUGH */
        case RTE_FLOW_FIELD_UDP_PORT_DST:
+               /* FALLTHROUGH */
+       case RTE_FLOW_FIELD_IPV4_TTL:
                return true;
        default:
                break;
@@ -1260,6 +1262,8 @@ nfp_flow_field_width(enum rte_flow_field_id field,
                /* FALLTHROUGH */
        case RTE_FLOW_FIELD_UDP_PORT_DST:
                return 16;
+       case RTE_FLOW_FIELD_IPV4_TTL:
+               return 8;
        case RTE_FLOW_FIELD_POINTER:
                /* FALLTHROUGH */
        case RTE_FLOW_FIELD_VALUE:
@@ -1320,6 +1324,8 @@ nfp_flow_action_calculate_modify_dispatch(struct 
nfp_action_calculate_param *par
                /* FALLTHROUGH */
        case RTE_FLOW_FIELD_UDP_PORT_DST:
                return nfp_flow_action_calculate_tp(param);
+       case RTE_FLOW_FIELD_IPV4_TTL:
+               return nfp_flow_action_calculate_ttl(param);
        default:
                break;    /* NOTREACHED */
        }
@@ -4291,6 +4297,8 @@ nfp_flow_action_compile_modify_dispatch(struct 
nfp_action_compile_param *param,
                /* FALLTHROUGH */
        case RTE_FLOW_FIELD_UDP_PORT_DST:
                return nfp_flow_action_compile_tp_dst(param);
+       case RTE_FLOW_FIELD_IPV4_TTL:
+               return nfp_flow_action_compile_ttl(param);
        default:
                break;    /* NOTREACHED */
        }
-- 
2.39.1

Reply via email to