app/testpmd: enable configuring GENEVE port
authorOphir Munk <ophirmu@mellanox.com>
Thu, 8 Oct 2020 20:16:55 +0000 (20:16 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:18:47 +0000 (19:18 +0200)
IANA has assigned port 6081 as the fixed well-known destination port for
GENEVE. Nevertheless draft-ietf-nvo3-geneve-09 recommends that
implementations make this configurable.  This commit enables specifying
any positive UDP destination port number for GENEVE protocol parsing.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/parameters.c
doc/guides/testpmd_app_ug/run_app.rst

index 1ead595..15ce8c1 100644 (file)
@@ -70,8 +70,8 @@ usage(char* progname)
               "--rxpt= | --rxht= | --rxwt= |"
               " --rxfreet= | --txpt= | --txht= | --txwt= | --txfreet= | "
               "--txrst= | --tx-offloads= | | --rx-offloads= | "
-              "--vxlan-gpe-port= | --record-core-cycles | "
-              "--record-burst-stats]\n",
+              "--vxlan-gpe-port= | --geneve-parsed-port= | "
+              "--record-core-cycles | --record-burst-stats]\n",
               progname);
 #ifdef RTE_LIBRTE_CMDLINE
        printf("  --interactive: run in interactive mode.\n");
@@ -202,6 +202,7 @@ usage(char* progname)
        printf("  --rx-offloads=0xXXXXXXXX: hexadecimal bitmask of RX queue offloads\n");
        printf("  --hot-plug: enable hot plug for device.\n");
        printf("  --vxlan-gpe-port=N: UPD port of tunnel VXLAN-GPE\n");
+       printf("  --geneve-parsed-port=N: UPD port to parse GENEVE tunnel protocol\n");
        printf("  --mlockall: lock all memory\n");
        printf("  --no-mlockall: do not lock all memory\n");
        printf("  --mp-alloc <native|anon|xmem|xmemhuge>: mempool allocation method.\n"
@@ -671,6 +672,7 @@ launch_args_parse(int argc, char** argv)
                { "rx-offloads",                1, 0, 0 },
                { "hot-plug",                   0, 0, 0 },
                { "vxlan-gpe-port",             1, 0, 0 },
+               { "geneve-parsed-port",         1, 0, 0 },
                { "mlockall",                   0, 0, 0 },
                { "no-mlockall",                0, 0, 0 },
                { "mp-alloc",                   1, 0, 0 },
@@ -1311,6 +1313,15 @@ launch_args_parse(int argc, char** argv)
                                        rte_exit(EXIT_FAILURE,
                                                 "vxlan-gpe-port must be >= 0\n");
                        }
+                       if (!strcmp(lgopts[opt_idx].name,
+                                   "geneve-parsed-port")) {
+                               n = atoi(optarg);
+                               if (n >= 0)
+                                       geneve_udp_port = (uint16_t)n;
+                               else
+                                       rte_exit(EXIT_FAILURE,
+                                                "geneve-parsed-port must be >= 0\n");
+                       }
                        if (!strcmp(lgopts[opt_idx].name, "print-event"))
                                if (parse_event_printing_config(optarg, 1)) {
                                        rte_exit(EXIT_FAILURE,
index e2539f6..ec085c2 100644 (file)
@@ -426,6 +426,12 @@ The command line options are:
     Set the UDP port number of tunnel VXLAN-GPE to N.
     The default value is 4790.
 
+*   ``--geneve-parsed-port=N``
+
+    Set the UDP port number that is used for parsing the GENEVE protocol to N.
+    HW may be configured with another tunnel Geneve port.
+    The default value is 6081.
+
 *   ``--mlockall``
 
     Enable locking all memory.