Skip to content

Commit

Permalink
net/kni: fix config initialization
Browse files Browse the repository at this point in the history
[ upstream commit dcd398f ]

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: ff1e35f ("kni: calculate MTU from mbuf size")

Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
baymaxhuang authored and kevintraynor committed Mar 8, 2022
1 parent 0316ab0 commit a602518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/kni/rte_eth_kni.c
Expand Up @@ -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;
Expand Down

0 comments on commit a602518

Please sign in to comment.