Skip to content

Commit

Permalink
app/testpmd: fix VLAN configuration on failure
Browse files Browse the repository at this point in the history
When failing to configure VLAN offloads after the port was started, there
is no need to update the port configuration. Currently, when user
configure an unsupported VLAN offloads and fails, and then restart the
port, it will fails since the configuration has been refreshed.

This patch makes the function return directly instead of refreshing the
configuration when execution fails.

Fixes: 384161e ("app/testpmd: adjust on the fly VLAN configuration")
Cc: stable@dpdk.org

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
Chengchang Tang authored and Ferruh Yigit committed Sep 30, 2020
1 parent b428e71 commit 57d4198
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions app/test-pmd/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3509,9 +3509,11 @@ vlan_extend_set(portid_t port_id, int on)
}

diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_extend_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}

Expand All @@ -3536,9 +3538,11 @@ rx_vlan_strip_set(portid_t port_id, int on)
}

diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_strip_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}

Expand Down Expand Up @@ -3577,9 +3581,11 @@ rx_vlan_filter_set(portid_t port_id, int on)
}

diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("rx_vlan_filter_set(port_pi=%d, on=%d) failed "
"diag=%d\n", port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}

Expand All @@ -3604,9 +3610,11 @@ rx_vlan_qinq_strip_set(portid_t port_id, int on)
}

diag = rte_eth_dev_set_vlan_offload(port_id, vlan_offload);
if (diag < 0)
if (diag < 0) {
printf("%s(port_pi=%d, on=%d) failed "
"diag=%d\n", __func__, port_id, on, diag);
return;
}
ports[port_id].dev_conf.rxmode.offloads = port_rx_offloads;
}

Expand Down

0 comments on commit 57d4198

Please sign in to comment.