eal/x86: add 128-bit atomic compare exchange
[dpdk.git] / app / test-pmd / cmdline_flow.c
index d1c370e..36659a6 100644 (file)
@@ -570,11 +570,6 @@ static const enum index item_param[] = {
        ZERO,
 };
 
-static const enum index item_param_is[] = {
-       ITEM_PARAM_IS,
-       ZERO,
-};
-
 static const enum index next_item[] = {
        ITEM_END,
        ITEM_VOID,
@@ -2140,7 +2135,7 @@ static const struct token token_list[] = {
        [ITEM_META_DATA] = {
                .name = "data",
                .help = "metadata value",
-               .next = NEXT(item_meta, NEXT_ENTRY(UNSIGNED), item_param_is),
+               .next = NEXT(item_meta, NEXT_ENTRY(UNSIGNED), item_param),
                .args = ARGS(ARGS_ENTRY_MASK_HTON(struct rte_flow_item_meta,
                                                  data, "\xff\xff\xff\xff")),
        },
@@ -3506,6 +3501,38 @@ parse_vc_action_vxlan_encap(struct context *ctx, const struct token *token,
        if (!vxlan_encap_conf.select_vlan)
                action_vxlan_encap_data->items[1].type =
                        RTE_FLOW_ITEM_TYPE_VOID;
+       if (vxlan_encap_conf.select_tos_ttl) {
+               if (vxlan_encap_conf.select_ipv4) {
+                       static struct rte_flow_item_ipv4 ipv4_mask_tos;
+
+                       memcpy(&ipv4_mask_tos, &rte_flow_item_ipv4_mask,
+                              sizeof(ipv4_mask_tos));
+                       ipv4_mask_tos.hdr.type_of_service = 0xff;
+                       ipv4_mask_tos.hdr.time_to_live = 0xff;
+                       action_vxlan_encap_data->item_ipv4.hdr.type_of_service =
+                                       vxlan_encap_conf.ip_tos;
+                       action_vxlan_encap_data->item_ipv4.hdr.time_to_live =
+                                       vxlan_encap_conf.ip_ttl;
+                       action_vxlan_encap_data->items[2].mask =
+                                                       &ipv4_mask_tos;
+               } else {
+                       static struct rte_flow_item_ipv6 ipv6_mask_tos;
+
+                       memcpy(&ipv6_mask_tos, &rte_flow_item_ipv6_mask,
+                              sizeof(ipv6_mask_tos));
+                       ipv6_mask_tos.hdr.vtc_flow |=
+                               RTE_BE32(0xfful << IPV6_HDR_TC_SHIFT);
+                       ipv6_mask_tos.hdr.hop_limits = 0xff;
+                       action_vxlan_encap_data->item_ipv6.hdr.vtc_flow |=
+                               rte_cpu_to_be_32
+                                       ((uint32_t)vxlan_encap_conf.ip_tos <<
+                                        IPV6_HDR_TC_SHIFT);
+                       action_vxlan_encap_data->item_ipv6.hdr.hop_limits =
+                                       vxlan_encap_conf.ip_ttl;
+                       action_vxlan_encap_data->items[2].mask =
+                                                       &ipv6_mask_tos;
+               }
+       }
        memcpy(action_vxlan_encap_data->item_vxlan.vni, vxlan_encap_conf.vni,
               RTE_DIM(vxlan_encap_conf.vni));
        action->conf = &action_vxlan_encap_data->conf;
@@ -3813,6 +3840,7 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token,
        header += sizeof(gre);
        memcpy(mpls.label_tc_s, mplsogre_encap_conf.label,
               RTE_DIM(mplsogre_encap_conf.label));
+       mpls.label_tc_s[2] |= 0x1;
        memcpy(header, &mpls, sizeof(mpls));
        header += sizeof(mpls);
        action_encap_data->conf.size = header -
@@ -4003,6 +4031,7 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token,
        header += sizeof(udp);
        memcpy(mpls.label_tc_s, mplsoudp_encap_conf.label,
               RTE_DIM(mplsoudp_encap_conf.label));
+       mpls.label_tc_s[2] |= 0x1;
        memcpy(header, &mpls, sizeof(mpls));
        header += sizeof(mpls);
        action_encap_data->conf.size = header -
@@ -4330,6 +4359,8 @@ parse_int(struct context *ctx, const struct token *token,
        }
        buf = (uint8_t *)ctx->object + arg->offset;
        size = arg->size;
+       if (u > RTE_LEN2MASK(size * CHAR_BIT, uint64_t))
+               return -1;
 objmask:
        switch (size) {
        case sizeof(uint8_t):