app/testpmd: set and clear keep CRC offload flag

Message ID 1533111199-4621-1-git-send-email-bernard.iremonger@intel.com (mailing list archive)
State Accepted, archived
Headers
Series app/testpmd: set and clear keep CRC offload flag |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Iremonger, Bernard Aug. 1, 2018, 8:13 a.m. UTC
  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(-)
  

Comments

Andrew Rybchenko Aug. 1, 2018, 8:22 a.m. UTC | #1
On 01.08.2018 11:13, Bernard Iremonger wrote:
> 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>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
  
Thomas Monjalon Aug. 1, 2018, 2:22 p.m. UTC | #2
01/08/2018 10:22, Andrew Rybchenko:
> On 01.08.2018 11:13, Bernard Iremonger wrote:
> > 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>
> 
> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

Applied, thanks
  

Patch

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;
 			}