From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22BEDA0351; Sun, 27 Feb 2022 21:12:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0140B40683; Sun, 27 Feb 2022 21:12:56 +0100 (CET) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id C6F3540042 for ; Sun, 27 Feb 2022 21:12:54 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6EFD85C0094; Sun, 27 Feb 2022 15:12:54 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 27 Feb 2022 15:12:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; bh=Uw/3zmc/OhcFn6 HorcBuHNPzE14nNNKQVnb4S42eAXQ=; b=O3bed2OKFaI9t7aFB2loU6XTk6iWlX h3l81m51pindmBi07x4Odh9gmJEbNGNOiWQ6a+AXsB/mR2wqBxw1mxbaeem6onb0 Cr1TCQojPbX15CKJg8H4x1TYMI62o30kLXgaj5NerGijoC0mLlEYlyxEq569aUVF YC39ngPYL4tgBxbLjMmbTR2FPepi5ulxDEZeohuEaS/Di7lJaJV+uEtDJ0mt9spd jg8BM0wBTLdZCHlODQJ+wANF5fPssBIY7Ql/kTO4Zbbk762qUEayd4TWAi/2Hsl/ PRl/xn7r0nZx5StlbUTsfo+BqrJ5MwlPaQpiyZkeGhf4GLpsW/2cjdAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Uw/3zmc/OhcFn6HorcBuHNPzE14nNNKQVnb4S42eA XQ=; b=f3Az7ZVG/WdVWOOIlWYSJGbtbkzsDu2rWcVoN4LlgXiKkAO++eiuSRn5Q om3sBcSegnK3nNyIuZdq/JPn820tbOEg9uYqTBUJOc9gfSKcHznTsCxemxdVVFO5 WHUQ3YjC6mRvUDI5g860wxVs8SdzQZKV16GpSCPYSqTXnw7OyJ2unADrXUGNotpe Vrfm+V7+n+Prwd4xlUjnTOieEdGsRkwpE//LtHOs7VoEIVIRmVmgT0o4oUDHRpJ6 taeklYSs7+LDllwza1JAwsk/IILIH9QI+9/bTpAzY8J+ETPIzd0ge4NpEv6NGUIs zL+q0+f1FFI7/6eJBb3a/BNyAQOeg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrleekgddufedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Feb 2022 15:12:53 -0500 (EST) From: Thomas Monjalon To: Harold Huang Cc: dev@dpdk.org, ferruh.yigit@intel.com Subject: Re: [PATCH v4] net/kni: reset rte_kni_conf struct before initialization Date: Sun, 27 Feb 2022 21:12:52 +0100 Message-ID: <4666160.Lt9SDvczpP@thomas> In-Reply-To: <20211205062102.2165380-1-baymaxhuang@gmail.com> References: <20211205062102.2165380-1-baymaxhuang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org +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 > --- > 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;