Skip to content

Commit

Permalink
net/hns3: fail setting FEC if one bit mode is not supported
Browse files Browse the repository at this point in the history
If the FEC mode was not supported, it should return error code.

This patch also adds a space when log error info.

Fixes: 9bf2ea8 ("net/hns3: support FEC")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
  • Loading branch information
fengchengwen authored and Ferruh Yigit committed May 11, 2021
1 parent ac8962e commit ab8c500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/hns3/hns3_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6991,9 +6991,11 @@ hns3_fec_set(struct rte_eth_dev *dev, uint32_t mode)
return ret;

/* HNS3 PMD driver only support one bit set mode, e.g. 0x1, 0x4 */
if (!is_fec_mode_one_bit_set(mode))
hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD,"
if (!is_fec_mode_one_bit_set(mode)) {
hns3_err(hw, "FEC mode(0x%x) not supported in HNS3 PMD, "
"FEC mode should be only one bit set", mode);
return -EINVAL;
}

/*
* Check whether the configured mode is within the FEC capability.
Expand Down

0 comments on commit ab8c500

Please sign in to comment.