From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id AE61C5F34 for ; Wed, 1 Aug 2018 10:13:24 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Aug 2018 01:13:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,431,1526367600"; d="scan'208";a="76327886" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga004.fm.intel.com with ESMTP; 01 Aug 2018 01:13:21 -0700 From: Bernard Iremonger To: dev@dpdk.org, ferruh.yigit@intel.com, thomas@monjalon.net, allain.legacy@windriver.com, arybchenko@solarflare.com Cc: Bernard Iremonger Date: Wed, 1 Aug 2018 09:13:19 +0100 Message-Id: <1533111199-4621-1-git-send-email-bernard.iremonger@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] app/testpmd: set and clear keep CRC offload flag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 08:13:25 -0000 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 --- 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