DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/kni: reset rte_kni_conf struct before initialization
@ 2021-12-03  7:24 Harold Huang
  2021-12-05  6:21 ` [PATCH v4] " Harold Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Harold Huang @ 2021-12-03  7:24 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, lironh

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 in some time we could not
change the kni device mtu with ip link command.

Fixes: ff1e35fb5f8 ("kni: calculate MTU from mbuf size")
Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
---
 drivers/net/kni/rte_eth_kni.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index c428caf441..23b15edfac 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -128,6 +128,7 @@ eth_kni_start(struct rte_eth_dev *dev)
  const char *name = dev->device->name + 4; /* remove net_ */

  mb_pool = internals->rx_queues[0].mb_pool;
+ memset(&conf, 0, sizeof(conf));
  strlcpy(conf.name, name, RTE_KNI_NAMESIZE);
  conf.force_bind = 0;
  conf.group_id = port_id;
--
2.18.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v4] net/kni: reset rte_kni_conf struct before initialization
  2021-12-03  7:24 [PATCH] net/kni: reset rte_kni_conf struct before initialization Harold Huang
@ 2021-12-05  6:21 ` Harold Huang
  2022-02-27 20:12   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Harold Huang @ 2021-12-05  6:21 UTC (permalink / raw)
  To: dev

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 isunexpected and in some time we could not change the kni
device mtu with ip link command.

Fixes: ff1e35fb5f8 ("kni: calculate MTU from mbuf size")
Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
---
 drivers/net/kni/rte_eth_kni.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index c428caf441..23b15edfac 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -128,6 +128,7 @@ eth_kni_start(struct rte_eth_dev *dev)
 	const char *name = dev->device->name + 4; /* remove net_ */
 
 	mb_pool = internals->rx_queues[0].mb_pool;
+	memset(&conf, 0, sizeof(conf));
 	strlcpy(conf.name, name, RTE_KNI_NAMESIZE);
 	conf.force_bind = 0;
 	conf.group_id = port_id;
-- 
2.27.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] net/kni: reset rte_kni_conf struct before initialization
  2021-12-05  6:21 ` [PATCH v4] " Harold Huang
@ 2022-02-27 20:12   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2022-02-27 20:12 UTC (permalink / raw)
  To: Harold Huang; +Cc: dev, ferruh.yigit

+Cc Ferruh

05/12/2021 07:21, Harold Huang:
> 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 isunexpected and in some time we could not change the kni
> device mtu with ip link command.
> 
> Fixes: ff1e35fb5f8 ("kni: calculate MTU from mbuf size")
> Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
> ---
>  drivers/net/kni/rte_eth_kni.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
> index c428caf441..23b15edfac 100644
> --- a/drivers/net/kni/rte_eth_kni.c
> +++ b/drivers/net/kni/rte_eth_kni.c
> @@ -128,6 +128,7 @@ eth_kni_start(struct rte_eth_dev *dev)
>  	const char *name = dev->device->name + 4; /* remove net_ */
>  
>  	mb_pool = internals->rx_queues[0].mb_pool;
> +	memset(&conf, 0, sizeof(conf));
>  	strlcpy(conf.name, name, RTE_KNI_NAMESIZE);
>  	conf.force_bind = 0;
>  	conf.group_id = port_id;





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-27 20:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03  7:24 [PATCH] net/kni: reset rte_kni_conf struct before initialization Harold Huang
2021-12-05  6:21 ` [PATCH v4] " Harold Huang
2022-02-27 20:12   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).