]> git.droids-corp.org - dpdk.git/commitdiff
app/testpmd: disable Rx VLAN offloads by default
authorMoti Haimovsky <motih@mellanox.com>
Wed, 31 Jan 2018 17:32:03 +0000 (19:32 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 20:45:33 +0000 (21:45 +0100)
Removed the hardcoded preconfigured Rx VLAN offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.

It has been decided by the Technical Board that testers who wish to
use these offloads will now have to explicitly write them in the
command-line when running testpmd.
The agreement is to keep two exceptions enabled by default in 18.02:
Rx CRC strip and Tx fast free.

Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
  commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
  commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.

Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.

Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
12 files changed:
app/test-pmd/parameters.c
app/test-pmd/testpmd.c
doc/guides/contributing/documentation.rst
doc/guides/howto/lm_virtio_vhost_user.rst
doc/guides/howto/pvp_reference_benchmark.rst
doc/guides/howto/virtio_user_as_exceptional_path.rst
doc/guides/nics/mrvl.rst
doc/guides/nics/octeontx.rst
doc/guides/nics/thunderx.rst
doc/guides/nics/virtio.rst
doc/guides/testpmd_app_ug/run_app.rst
doc/guides/testpmd_app_ug/testpmd_funcs.rst

index fd5907177dfa7aab8f683459d16512fe62330f7c..97d22b8601a4f990e40ddbce797836fcd9a452b7 100644 (file)
@@ -133,10 +133,10 @@ usage(char* progname)
        printf("  --enable-lro: enable large receive offload.\n");
        printf("  --enable-rx-cksum: enable rx hardware checksum offload.\n");
        printf("  --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
-       printf("  --disable-hw-vlan: disable hardware vlan.\n");
-       printf("  --disable-hw-vlan-filter: disable hardware vlan filter.\n");
-       printf("  --disable-hw-vlan-strip: disable hardware vlan strip.\n");
-       printf("  --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+       printf("  --enable-hw-vlan: enable hardware vlan.\n");
+       printf("  --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+       printf("  --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+       printf("  --enable-hw-vlan-extend: enable hardware vlan extend.\n");
        printf("  --enable-drop-en: enable per queue packet drop.\n");
        printf("  --disable-rss: disable rss.\n");
        printf("  --port-topology=N: set port topology (N: paired (default) or "
@@ -585,10 +585,10 @@ launch_args_parse(int argc, char** argv)
                { "enable-rx-cksum",            0, 0, 0 },
                { "enable-rx-timestamp",        0, 0, 0 },
                { "enable-scatter",             0, 0, 0 },
-               { "disable-hw-vlan",            0, 0, 0 },
-               { "disable-hw-vlan-filter",     0, 0, 0 },
-               { "disable-hw-vlan-strip",      0, 0, 0 },
-               { "disable-hw-vlan-extend",     0, 0, 0 },
+               { "enable-hw-vlan",             0, 0, 0 },
+               { "enable-hw-vlan-filter",      0, 0, 0 },
+               { "enable-hw-vlan-strip",       0, 0, 0 },
+               { "enable-hw-vlan-extend",      0, 0, 0 },
                { "enable-drop-en",            0, 0, 0 },
                { "disable-rss",                0, 0, 0 },
                { "port-topology",              1, 0, 0 },
@@ -886,20 +886,20 @@ launch_args_parse(int argc, char** argv)
                        if (!strcmp(lgopts[opt_idx].name,
                                        "enable-rx-timestamp"))
                                rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
-                       if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
-                               rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+                       if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+                               rx_offloads |= DEV_RX_OFFLOAD_VLAN;
 
                        if (!strcmp(lgopts[opt_idx].name,
-                                       "disable-hw-vlan-filter"))
-                               rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+                                       "enable-hw-vlan-filter"))
+                               rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
 
                        if (!strcmp(lgopts[opt_idx].name,
-                                       "disable-hw-vlan-strip"))
-                               rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+                                       "enable-hw-vlan-strip"))
+                               rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
 
                        if (!strcmp(lgopts[opt_idx].name,
-                                       "disable-hw-vlan-extend"))
-                               rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+                                       "enable-hw-vlan-extend"))
+                               rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
 
                        if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
                                rx_drop_en = 1;
index f64dd73340045900a9bcfb17edb398d1a2f4d8ca..fc8effad9ad314e0b7964fb7527a65415924e5eb 100644 (file)
@@ -306,9 +306,7 @@ lcoreid_t latencystats_lcore_id = -1;
  */
 struct rte_eth_rxmode rx_mode = {
        .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
-       .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
-                    DEV_RX_OFFLOAD_VLAN_STRIP |
-                    DEV_RX_OFFLOAD_CRC_STRIP),
+       .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
        .ignore_offload_bitfield = 1,
 };
 
@@ -670,7 +668,7 @@ init_config(void)
 
        RTE_ETH_FOREACH_DEV(pid) {
                port = &ports[pid];
-               /* Apply default Tx configuration for all ports */
+               /* Apply default TxRx configuration for all ports */
                port->dev_conf.txmode = tx_mode;
                port->dev_conf.rxmode = rx_mode;
                rte_eth_dev_info_get(pid, &port->dev_info);
@@ -678,7 +676,10 @@ init_config(void)
                      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
                        port->dev_conf.txmode.offloads &=
                                ~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-
+               if (!(port->dev_info.rx_offload_capa &
+                     DEV_RX_OFFLOAD_CRC_STRIP))
+                       port->dev_conf.rxmode.offloads &=
+                               ~DEV_RX_OFFLOAD_CRC_STRIP;
                if (numa_support) {
                        if (port_numa[pid] != NUMA_NO_CONFIG)
                                port_per_socket[port_numa[pid]]++;
index 170dacdb77765a1baff2276f2ac07c2f4e8cb92a..82f2e1bb357b7b47e1f721f20ba01cec2da97975 100644 (file)
@@ -294,7 +294,7 @@ Line Length
 
      testpmd -l 2-3 -n 4 \
              --vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
-             -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+             -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
              --enable-rx-cksum --txq=2 --rxq=2 --rxd=1024  --txd=1024
 
 
index 9402ed8d281e51c301f061161604bfe84397f456..0661e8807b8b43137bfe0b0ef7b48ed311126dcc 100644 (file)
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
    # test system has 8 cpus (0-7), use cpus 2-7 for VM
 
    /root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
-   -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+   -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
index 228b4a25759b36701718f584b1f5aa6079298330..67fa232ec4b014fe28f6b06393c4f09c734a79d9 100644 (file)
@@ -158,7 +158,7 @@ Testpmd launch
       $RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
           --vdev 'net_vhost0,iface=/tmp/vhost-user1' \
           --vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
-          --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+          --portmask=f -i --rxq=1 --txq=1 \
           --nb-cores=4 --forward-mode=io
 
    With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
       $RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
           --proc-type auto --file-prefix pg -- \
           --portmask=3 --forward-mode=macswap --port-topology=chained \
-          --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+          --disable-rss -i --rxq=1 --txq=1 \
           --rxd=256 --txd=256 --nb-cores=2 --auto-start
 
 Results template
index 3f99fe8231e8f1c0fd789a3242e86da71da767d3..393f002430c3c095426825fc3497920608b8646f 100644 (file)
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
 
         $(testpmd) -l 2-3 -n 4 \
                --vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
-               -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+               -- -i --txqflags=0x0 --enable-lro \
                --enable-rx-cksum --rxd=1024 --txd=1024
 
     This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
 
         $(testpmd) -l 2-3 -n 4 \
                --vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
-               -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+               -- -i --txqflags=0x0 --enable-lro \
                --enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
                --txd=1024
 
index 77b2d6649f5bdcb35a598ed1b9f9c48e5be0ac1b..b7f32921ad8029a388ed874686d5be212f029b63 100644 (file)
@@ -215,7 +215,7 @@ Usage example
 .. code-block:: console
 
    ./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
-     -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+     -c 7 -- -i -a --rxq=2
 
 
 Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
 
    ./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
      --burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2  --nb-cores=2 \
-     -i -a --disable-hw-vlan-strip --rss-udp
+     -i -a --rss-udp
index 212fe3465b87f5432b036247f23c4997b94fb1ef..8e2a2b75b09a87f4381785c07a3889c980a9f0b7 100644 (file)
@@ -88,8 +88,8 @@ following ``make`` command:
                 --mbuf-pool-ops-name="octeontx_fpavf" \
                 --vdev='event_octeontx' \
                 --vdev='eth_octeontx,nr_port=2' \
-                -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
-                --disable-hw-vlan-filter -i
+                -- --rxq=1 --txq=1 --nb-core=2 \
+                --total-num-mbufs=16384 -i
       .....
       EAL: Detected 24 lcore(s)
       EAL: Probing VFIO support...
index 1c800e73ec266813b4c6348191ddd7876259e992..5270ef23ec096d8bdc04a2ce8fcf094bb8476105 100644 (file)
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
    .. code-block:: console
 
       ./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
-        -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+        -- -i --no-flush-rx \
         --port-topology=loop
 
       ...
index af82f86e4a7979cca86148e07188822396336c63..90751e934a1f5b5583e44240994fdabd9a80bd71 100644 (file)
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
     by default. Tx queue size is still hard-coded to be 256.
 
 *   Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
-    When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
-    the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+    When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+    to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+    command line.
 
 *   "RTE_PKTMBUF_HEADROOM" should be defined
     no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
index 46da1dfd71e1cf41032cdb5a639feece6071f59e..782be3e356367e9afeb8d4bd485dd58c5653e6ab 100644 (file)
@@ -315,21 +315,21 @@ The commandline options are:
 
     Enable scatter (multi-segment) RX.
 
-*   ``--disable-hw-vlan``
+*   ``--enable-hw-vlan``
 
-    Disable hardware VLAN.
+    Enable hardware VLAN.
 
-*   ``--disable-hw-vlan-filter``
+*   ``--enable-hw-vlan-filter``
 
-    Disable hardware VLAN filter.
+    Enable hardware VLAN filter.
 
-*   ``--disable-hw-vlan-strip``
+*   ``--enable-hw-vlan-strip``
 
-    Disable hardware VLAN strip.
+    Enable hardware VLAN strip.
 
-*   ``--disable-hw-vlan-extend``
+*   ``--enable-hw-vlan-extend``
 
-    Disable hardware VLAN extend.
+    Enable hardware VLAN extend.
 
 *   ``--enable-drop-en``
 
index d8c9ef0e6f18d89b109279ccc8c716db7c7d8937..a63b236792bba9b51cce927c4772cca46fd7ab4f 100644 (file)
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
 
    testpmd> port config all hw-vlan (on|off)
 
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
 
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
 
 port config - VLAN filter
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
 
    testpmd> port config all hw-vlan-filter (on|off)
 
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
 
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
 
 port config - VLAN strip
 ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
 
    testpmd> port config all hw-vlan-strip (on|off)
 
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
 
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
 
 port config - VLAN extend
 ~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
 
 Hardware VLAN extend is off by default.
 
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
 
 port config - Drop Packets
 ~~~~~~~~~~~~~~~~~~~~~~~~~~