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 1759FA0C47; Sun, 5 Dec 2021 07:21:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A230340040; Sun, 5 Dec 2021 07:21:20 +0100 (CET) Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by mails.dpdk.org (Postfix) with ESMTP id 04A3B4003C for ; Sun, 5 Dec 2021 07:21:18 +0100 (CET) Received: by mail-pj1-f41.google.com with SMTP id j6-20020a17090a588600b001a78a5ce46aso8388799pji.0 for ; Sat, 04 Dec 2021 22:21:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yQOQ1iOf8bwFS1PFL7d8ekWAjErzsK0TMi/4PPkqVCA=; b=TYEi2gLNwXDnQfB66sO0j6L4zmWtdckxpliTyQWZSoXyzFORHs7KNu6y/R9r9/QlUF 6wasCMlRJOCpFRoY24vyAKruAeHz4cJL+gKsIMwVFRoNG7LTCnq4eUhOLxry1gG8qnSO fATEX3h7oHNOsw6x6vERHzp4ZS29DETJ0YYAwrRrB5WmnWBYa/aNr6ScSpdB2xR2CjZ0 67q9/UNLeN1UrukLtwVWs6ZxcoghXL8qU7gPQEke3lH1Oln+N+aTlZCsSIZzUzPZbout Ja8cNOjzDfeNFppJmdPbtt6B0mVUQZRKlrkFw4ReUqtsio0UCW8cmnvxebqlCSj4HFia oD+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yQOQ1iOf8bwFS1PFL7d8ekWAjErzsK0TMi/4PPkqVCA=; b=U+pA/k6kuwwJKTR6YHJlFLts/1BRcqvO0A8p4i8ff1nl2MUDT1WLrv1q3voxs+LkbU WOt3BfjskocrOPmUg6mFhsrOLgycCyGv6cXMKwMF8eAFUxsESm5hgykVTPJFMSV9kE1D WTqA6PxD7b5tvhxFvh+jg0GGbEsUKcwduSvTxE79uquDq0ZiEdWHRrnTIr8ceKRH708q s70NI41SaKl/uDVJDJ0mOsGxxl9FdX4nZZvpHQxwqlryOUZ/0fjpx/+nCNjlBudF2Lfx wmW650NNdN8+STXRVkue+GBsL5iNU0cwR11Bv3t3NCCiusA1VCtgbuGxE8kLvImlNP3y 4gtg== X-Gm-Message-State: AOAM533TlJgVkg9inma3X8VFrQK6v80xLaT8XCdzpaU8SpQkRF3mcYE9 5MV4qNOtVDNqrGt1Vmu7wyI5ult50NqklQ== X-Google-Smtp-Source: ABdhPJwmWtFazEDX/QHP+NY+rA6NgZ/nCEYNGdiHRtjvOXBr09cJ2XRLd9ZAt41E6rGJpe+9IzQkXQ== X-Received: by 2002:a17:90b:4c8f:: with SMTP id my15mr26790589pjb.132.1638685277857; Sat, 04 Dec 2021 22:21:17 -0800 (PST) Received: from localhost.localdomain ([157.255.44.219]) by smtp.gmail.com with ESMTPSA id t8sm7845440pfe.28.2021.12.04.22.21.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 22:21:17 -0800 (PST) From: Harold Huang To: dev@dpdk.org Subject: [PATCH v4] net/kni: reset rte_kni_conf struct before initialization Date: Sun, 5 Dec 2021 14:21:02 +0800 Message-Id: <20211205062102.2165380-1-baymaxhuang@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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; -- 2.27.0