From dcd398f9466fc42f09e5c725c3188d8c41bd3fbf Mon Sep 17 00:00:00 2001 From: Harold Huang Date: Thu, 3 Mar 2022 10:18:03 +0800 Subject: [PATCH] net/kni: fix config initialization When kni driver calls eth_kni_start to start device, some fields such as min_mtu and max_mtu of rte_kni_conf are not initialized. It will cause kni_ioctl_create create a kni netdevice with a random min_mtu and max_mtu value. This is unexpected and sometimes we could not change the kni device mtu with ip link command. Fixes: ff1e35fb5f83 ("kni: calculate MTU from mbuf size") Cc: stable@dpdk.org Signed-off-by: Harold Huang Reviewed-by: Ferruh Yigit --- drivers/net/kni/rte_eth_kni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index c428caf441..0532de5315 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -124,7 +124,7 @@ eth_kni_start(struct rte_eth_dev *dev) struct pmd_internals *internals = dev->data->dev_private; uint16_t port_id = dev->data->port_id; struct rte_mempool *mb_pool; - struct rte_kni_conf conf; + struct rte_kni_conf conf = {{0}}; const char *name = dev->device->name + 4; /* remove net_ */ mb_pool = internals->rx_queues[0].mb_pool; -- 2.39.5