DPDK patches and discussions
 help / color / mirror / Atom feed
From: Moti Haimovsky <motih@mellanox.com>
To: wenzhuo.lu@intel.com, thomas@monjalon.net
Cc: dev@dpdk.org, Moti Haimovsky <motih@mellanox.com>
Subject: [dpdk-dev] [PATCH v2] app/testpmd: do not enable Rx offloads by default
Date: Mon, 29 Jan 2018 13:33:18 +0200	[thread overview]
Message-ID: <1517225598-132061-1-git-send-email-motih@mellanox.com> (raw)
In-Reply-To: <1516695081-178919-1-git-send-email-motih@mellanox.com>

Removed the hardcoded preconfigured Rx offload configuration from
testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.

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>
---
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
 app/test-pmd/parameters.c             | 30 +++++++++++++++---------------
 app/test-pmd/testpmd.c                |  4 +---
 doc/guides/nics/thunderx.rst          |  2 +-
 doc/guides/testpmd_app_ug/run_app.rst | 20 ++++++++++----------
 4 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..134fd99 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -580,15 +580,15 @@
 #ifdef RTE_LIBRTE_BITRATE
 		{ "bitrate-stats",              1, 0, 0 },
 #endif
-		{ "disable-crc-strip",          0, 0, 0 },
+		{ "enable-crc-strip",           0, 0, 0 },
 		{ "enable-lro",                 0, 0, 0 },
 		{ "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 },
@@ -875,8 +875,8 @@
 						 " must be >= 0\n", n);
 			}
 #endif
-			if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
-				rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
+			if (!strcmp(lgopts[opt_idx].name, "enable-crc-strip"))
+				rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
 			if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
 				rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO;
 			if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
@@ -886,20 +886,20 @@
 			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;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..a082352 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
  */
 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 = 0,
 	.ignore_offload_bitfield = 1,
 };
 
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -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
 
       ...
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..076c121 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -299,9 +299,9 @@ The commandline options are:
     In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
     If the drop-queue does not exist, the packet is dropped. The default value is N=127.
 
-*   ``--disable-crc-strip``
+*   ``--enable-crc-strip``
 
-    Disable hardware CRC stripping.
+    Enable hardware CRC stripping.
 
 *   ``--enable-lro``
 
@@ -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``
 
-- 
1.8.3.1

  parent reply	other threads:[~2018-01-29 11:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  8:11 [dpdk-dev] [PATCH] " Moti Haimovsky
2018-01-25  1:11 ` Lu, Wenzhuo
2018-01-25  9:04   ` Thomas Monjalon
2018-01-25 16:01     ` Stephen Hemminger
2018-01-26  7:31       ` Lu, Wenzhuo
2018-01-26  7:49         ` Thomas Monjalon
2018-01-26  7:30     ` Lu, Wenzhuo
2018-01-26  7:48       ` Thomas Monjalon
2018-01-26  8:06         ` Lu, Wenzhuo
2018-01-26  8:35           ` Thomas Monjalon
2018-01-27 18:14             ` Shahaf Shuler
2018-01-29 11:33 ` Moti Haimovsky [this message]
2018-01-29 11:52   ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2018-01-30  8:44   ` [dpdk-dev] [PATCH v3] " Moti Haimovsky
2018-01-30  9:00     ` [dpdk-dev] [PATCH v4] " Moti Haimovsky
2018-01-31  3:16       ` Lu, Wenzhuo
2018-01-31 11:55       ` [dpdk-dev] [PATCH v5] " Moti Haimovsky
2018-01-31 16:59         ` [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx " Moti Haimovsky
2018-01-31 17:19           ` Thomas Monjalon
2018-01-31 17:32           ` [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads Moti Haimovsky
2018-01-31 21:09             ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517225598-132061-1-git-send-email-motih@mellanox.com \
    --to=motih@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).