DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com, thomas@monjalon.net,
	allain.legacy@windriver.com, arybchenko@solarflare.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH] app/testpmd: set and clear keep CRC offload flag
Date: Wed,  1 Aug 2018 09:13:19 +0100	[thread overview]
Message-ID: <1533111199-4621-1-git-send-email-bernard.iremonger@intel.com> (raw)

If the "port config all crc-strip on" command is issued,
The DEV_RX_OFFLOAD_KEEP_CRC offload flag should be cleared.

If the "port config all crc-strip off command is issued,
The DEV_RX_OFFLOAD_KEEP_CRC offload flag should be set.

Fixes: 70815c9ecadd ("ethdev: add new offload flag to keep CRC")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 8708875..54ba2f5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1897,11 +1897,13 @@ cmd_config_rx_mode_flag_parsed(void *parsed_result,
 		port = &ports[pid];
 		rx_offloads = port->dev_conf.rxmode.offloads;
 		if (!strcmp(res->name, "crc-strip")) {
-			if (!strcmp(res->value, "on"))
+			if (!strcmp(res->value, "on")) {
 				rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
-			else if (!strcmp(res->value, "off"))
+				rx_offloads &= ~DEV_RX_OFFLOAD_KEEP_CRC;
+			} else if (!strcmp(res->value, "off")) {
+				rx_offloads |= DEV_RX_OFFLOAD_KEEP_CRC;
 				rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
-			else {
+			} else {
 				printf("Unknown parameter\n");
 				return;
 			}
-- 
2.7.4

             reply	other threads:[~2018-08-01  8:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01  8:13 Bernard Iremonger [this message]
2018-08-01  8:22 ` Andrew Rybchenko
2018-08-01 14:22   ` 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=1533111199-4621-1-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=allain.legacy@windriver.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas@monjalon.net \
    /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).