From: Bernard Iremonger Date: Wed, 1 Aug 2018 08:13:19 +0000 (+0100) Subject: app/testpmd: set and clear keep CRC offload flag X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d07befdf293308c9b1f789b3230c6d59bf966dac;p=dpdk.git app/testpmd: set and clear keep CRC offload flag 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 Acked-by: Andrew Rybchenko --- diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 8708875330..54ba2f55e7 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; }