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