ethdev: add MPLS RSS offload type
authorHemant Agrawal <hemant.agrawal@nxp.com>
Wed, 20 Jan 2021 06:22:37 +0000 (11:52 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 29 Jan 2021 17:16:08 +0000 (18:16 +0100)
This patch defines new RSS offload types for MPLS. The distribution
will on the basis of MPLS tag.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline.c
doc/guides/testpmd_app_ug/testpmd_funcs.rst
lib/librte_ethdev/rte_ethdev.h

index 89034c8..c6ace2d 100644 (file)
@@ -788,7 +788,7 @@ static void cmd_help_long_parsed(void *parsed_result,
                        "receive buffers available.\n\n"
 
                        "port config all rss (all|default|ip|tcp|udp|sctp|"
-                       "ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|none|level-default|"
+                       "ether|port|vxlan|geneve|nvgre|vxlan-gpe|ecpri|mpls|none|level-default|"
                        "level-outer|level-inner|<flowtype_id>)\n"
                        "    Set the RSS mode.\n\n"
 
@@ -2220,6 +2220,8 @@ cmd_config_rss_parsed(void *parsed_result,
                rss_conf.rss_hf = ETH_RSS_GTPU;
        else if (!strcmp(res->value, "ecpri"))
                rss_conf.rss_hf = ETH_RSS_ECPRI;
+       else if (!strcmp(res->value, "mpls"))
+               rss_conf.rss_hf = ETH_RSS_MPLS;
        else if (!strcmp(res->value, "none"))
                rss_conf.rss_hf = 0;
        else if (!strcmp(res->value, "level-default")) {
@@ -2290,7 +2292,7 @@ cmdline_parse_inst_t cmd_config_rss = {
        .data = NULL,
        .help_str = "port config all rss "
                "all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|"
-               "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|none|level-default|"
+               "nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none|level-default|"
                "level-outer|level-inner|<flowtype_id>",
        .tokens = {
                (void *)&cmd_config_rss_port,
index 458f25b..3ccc9fc 100644 (file)
@@ -2270,7 +2270,7 @@ port config - RSS
 
 Set the RSS (Receive Side Scaling) mode on or off::
 
-   testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|none)
+   testpmd> port config all rss (all|default|eth|vlan|ip|tcp|udp|sctp|ether|port|vxlan|geneve|nvgre|vxlan-gpe|l2tpv3|esp|ah|pfcp|ecpri|mpls|none)
 
 RSS is on by default.
 
index d36d3a4..667373f 100644 (file)
@@ -530,6 +530,7 @@ struct rte_eth_rss_conf {
 #define ETH_RSS_PFCP               (1ULL << 30)
 #define ETH_RSS_PPPOE             (1ULL << 31)
 #define ETH_RSS_ECPRI             (1ULL << 32)
+#define ETH_RSS_MPLS              (1ULL << 33)
 
 /*
  * We use the following macros to combine with above ETH_RSS_* for
@@ -761,7 +762,8 @@ rte_eth_rss_hf_refine(uint64_t rss_hf)
        ETH_RSS_PORT  | \
        ETH_RSS_VXLAN | \
        ETH_RSS_GENEVE | \
-       ETH_RSS_NVGRE)
+       ETH_RSS_NVGRE | \
+       ETH_RSS_MPLS)
 
 /*
  * Definitions used for redirection table entry size.