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 E6B46A04A5 for ; Thu, 3 Mar 2022 03:18:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBBAE42758; Thu, 3 Mar 2022 03:18:14 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 3204140041; Thu, 3 Mar 2022 03:18:13 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id 132so3258316pga.5; Wed, 02 Mar 2022 18:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y4LLwCXWUBGUr13uJjivE7LCUyvBDd8yWgEwhB6vDxw=; b=BWcWm67HXYjZHgY1/y21u5TiDKkOVi4t9nAPReJTg4dz4FazGWqDtm6FlVk+igKH+S A971ni0apvhnhIhTrYDqSh2aDKvvQlyROpnBCuHBH/vutOIIF0NrocQzP/CL94x0/FpC ysdNhgykU4A74C4A+dy4YR8L79EzYxfDyvhVWxdGakQ5e1Nbg4WKbW60Knx0IpUO0Gml /QSGN32HnK9cTj2b6yPyjsAlAeOvdj6XpxmcoTP6Wmb+DMOLDw2m7445i9kGWEmLcI5O TdZz4FHatYezpUotmXcRjtNcnvLBZpiYasMyiKyoj3TzJlJmlCt0mcqQkY+Cfk6ytBvd Pz4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=y4LLwCXWUBGUr13uJjivE7LCUyvBDd8yWgEwhB6vDxw=; b=KCSz1yaqOEKwDQdmxlmRtXca/OszY5I43bFqDVKaQXeXLu45CiWuXaBrenxmCiBhlZ YDEMBP2UOrId4MD76OMC2nwIYgpQA1aXGf7BKCv6OwN5tX217FJO620u8xRmjJRCuBLQ WYjXrDYNLo2BFnrWW8obOs7Jk8izm6qEej/aMyjtvs+VoBp3w+X/2IETW9hEDLvdvYMN lzARDr3uGzGgewiKieG6dQvLqlpfl8h0MLTYGXzx5r7AEOO2FPgVCcR1cZLdPSL055oK WKz5sWvk9ypVBvPhYJz6STmLB4/E+BSgy2ZWy3xyox8mOeXZWqF6nCWPXdVV6zXh4qMc wfXg== X-Gm-Message-State: AOAM5325Yfou++xZ/FwclevF0ZB/z3ERnuNPwIvYkr64YWWgNQ5gz8+D nzNohVyJH0BIonM5SIp3RWDWlmAq4gq6Ps0k X-Google-Smtp-Source: ABdhPJwH98Y2SXh3R1OG6u6FkBfy/yBH+o2mARTxH60z87hdf1hK1YOqLmDYw8nN9pnRXxTQvKTeiA== X-Received: by 2002:a63:1662:0:b0:378:8b0b:1c9 with SMTP id 34-20020a631662000000b003788b0b01c9mr17159395pgw.537.1646273892198; Wed, 02 Mar 2022 18:18:12 -0800 (PST) Received: from localhost.localdomain ([157.255.44.218]) by smtp.gmail.com with ESMTPSA id u12-20020a17090a890c00b001b8efcf8e48sm6472804pjn.14.2022.03.02.18.18.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 18:18:11 -0800 (PST) From: Harold Huang To: dev@dpdk.org Cc: Harold Huang , stable@dpdk.org, Ferruh Yigit , Liron Himi Subject: [PATCH] net/kni: initialize rte_kni_conf to 0 before using it Date: Thu, 3 Mar 2022 10:18:03 +0800 Message-Id: <20220303021803.382374-1-baymaxhuang@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220302123400.188209-1-baymaxhuang@gmail.com> References: <20220302123400.188209-1-baymaxhuang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 --- 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..ba58d9dbae 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.27.0