net/kni: check rte kni init result
Checks
Commit Message
From: Chengwen Feng <fengchengwen@huawei.com>
This patch adds checking for rte_kni_init() result.
Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
drivers/net/kni/rte_eth_kni.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Comments
On 4/21/2021 3:14 AM, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
>
> This patch adds checking for rte_kni_init() result.
>
> Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
> Cc: stable@dpdk.org
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
On 4/23/2021 11:17 AM, Ferruh Yigit wrote:
> On 4/21/2021 3:14 AM, Min Hu (Connor) wrote:
>> From: Chengwen Feng <fengchengwen@huawei.com>
>>
>> This patch adds checking for rte_kni_init() result.
>>
>> Fixes: 75e2bc54c018 ("net/kni: add KNI PMD")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/main, thanks.
@@ -406,8 +406,13 @@ eth_kni_create(struct rte_vdev_device *vdev,
static int
kni_init(void)
{
- if (is_kni_initialized == 0)
- rte_kni_init(MAX_KNI_PORTS);
+ int ret;
+
+ if (is_kni_initialized == 0) {
+ ret = rte_kni_init(MAX_KNI_PORTS);
+ if (ret < 0)
+ return ret;
+ }
is_kni_initialized++;