]> git.droids-corp.org - dpdk.git/commitdiff
app/testpmd: fix MPLS BoS bit default value
authorSaleh Alsouqi <salehals@mellanox.com>
Wed, 21 Nov 2018 14:47:24 +0000 (14:47 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Dec 2018 16:31:06 +0000 (16:31 +0000)
The Bottom-of-Stack (bos) bit of MPLS indicates
whether its the last MPLS layer (1) or not (0).

Indicating that the encapsulating MPLS is the
last MPLS layer in the packet as the default
behavior is more appropriate since multiple
encapsulation actions is not supported.

Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: 3e77031be855 ("app/testpmd: add MPLSoGRE encapsulation")
Fixes: a1191d39cb57 ("app/testpmd: add MPLSoUDP encapsulation")
cc: stable@dpdk.org

Signed-off-by: Saleh Alsouqi <salehals@mellanox.com>
Acked-by: Ori Kam <orika@mellanox.com>
app/test-pmd/cmdline_flow.c

index 23ea7cc8294988710c426e49858a6fe1f739e1ec..5c0108fa702171bb449c7229de0dd678b8884fba 100644 (file)
@@ -3808,6 +3808,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 -
@@ -3998,6 +3999,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 -