| 928 | } |
| 929 | |
| 930 | static int |
| 931 | encap_apply(void *data, |
| 932 | struct rte_table_action_encap_params *p, |
| 933 | struct rte_table_action_encap_config *cfg, |
| 934 | struct rte_table_action_common_config *common_cfg) |
| 935 | { |
| 936 | int status; |
| 937 | |
| 938 | /* Check input arguments */ |
| 939 | status = encap_apply_check(p, cfg); |
| 940 | if (status) |
| 941 | return status; |
| 942 | |
| 943 | switch (p->type) { |
| 944 | case RTE_TABLE_ACTION_ENCAP_ETHER: |
| 945 | return encap_ether_apply(data, p, common_cfg); |
| 946 | |
| 947 | case RTE_TABLE_ACTION_ENCAP_VLAN: |
| 948 | return encap_vlan_apply(data, p, common_cfg); |
| 949 | |
| 950 | case RTE_TABLE_ACTION_ENCAP_QINQ: |
| 951 | return encap_qinq_apply(data, p, common_cfg); |
| 952 | |
| 953 | case RTE_TABLE_ACTION_ENCAP_MPLS: |
| 954 | return encap_mpls_apply(data, p); |
| 955 | |
| 956 | case RTE_TABLE_ACTION_ENCAP_PPPOE: |
| 957 | return encap_pppoe_apply(data, p); |
| 958 | |
| 959 | case RTE_TABLE_ACTION_ENCAP_VXLAN: |
| 960 | return encap_vxlan_apply(data, p, cfg); |
| 961 | |
| 962 | case RTE_TABLE_ACTION_ENCAP_QINQ_PPPOE: |
| 963 | return encap_qinq_pppoe_apply(data, p); |
| 964 | |
| 965 | default: |
| 966 | return -EINVAL; |
| 967 | } |
| 968 | } |
| 969 | |
| 970 | static __rte_always_inline uint16_t |
| 971 | encap_vxlan_ipv4_checksum_update(uint16_t cksum0, |
no test coverage detected