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 F1103A0C47; Sun, 5 Dec 2021 06:30:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C377B40040; Sun, 5 Dec 2021 06:30:58 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 213504003C for ; Sun, 5 Dec 2021 06:30:57 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id iq11so5327504pjb.3 for ; Sat, 04 Dec 2021 21:30:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=yQOQ1iOf8bwFS1PFL7d8ekWAjErzsK0TMi/4PPkqVCA=; b=fKwyjgBXy3+VWTOohBdldRWjEjI5hftEVC4aNkEWDQAysaszBofQK6ljwFVBfxZBB4 jke6aJspTKRiilcbdRJxzwFCU71A0KmUCauKfpUnzp8DkU5QiE3VT431oLsNCJMRnD7N 1NKOdc3KP61FHhZptvaLgmWWfwmuOHlaC2HE972uI0J2pSJFBCRlyFyjpjhhu/bFE+z1 ydl5FlTPng37qnmOd1BPT78IHxJFV3Ph084T2OxpqBQNzCYCAT+VJD7KnOkMw5OIJiCZ 2Ww3NvLa1i/dX+Xpyy20YiIkckmQm0cditnO5pHAF0EvYTLQntMV5SXYbLfigYJDZWNX 00yw== 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:mime-version :content-transfer-encoding; bh=yQOQ1iOf8bwFS1PFL7d8ekWAjErzsK0TMi/4PPkqVCA=; b=oNu9RvVgCFWxJ+CvYy2PaG8vkNsLiYQemSNEoBjI8u4fTdBgP43d9wLBwnn8HgggmU A0amFYlh8H+FfS5dldoXZ85hhiFA+EvO1CeLETy6PTa1pAyxdR8Lxji4v7ZlfFm+f09y xKNhtgQqya94BU7Fwv2gqodJ94oNAM0NxpPx85+HedxYKe7hmNWl09sormWykEubF8r2 cJ8sbVTNqH23CsmH0skamMakXOiXUsukG1iDP6ykui1cgMs8O3b8MdHfal17real359h 4v/WTyeqiTx7FfN4tnI4ZmZc0whYcIarTsINILN9rA7Qo5lPLUOw+5ELrPXb5DtL33rJ zrww== X-Gm-Message-State: AOAM533LtVL1UcFakwCwpHfQvxxmCRLu3791TnOOOw4dNZ3CBJdTeWAj axtg9y3SjuTV6uAtknhpIOX1OsJiOsttpA== X-Google-Smtp-Source: ABdhPJwqbg1hXhB/Z2pOlEjDXzGmHmrKjT/DYIXGLZnPd4YoSCmMZVFW8IFY4pIbtXFRDbvDu51znw== X-Received: by 2002:a17:90b:3142:: with SMTP id ip2mr27112199pjb.207.1638682256077; Sat, 04 Dec 2021 21:30:56 -0800 (PST) Received: from localhost.localdomain ([157.255.44.217]) by smtp.gmail.com with ESMTPSA id ms15sm6057946pjb.26.2021.12.04.21.30.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Dec 2021 21:30:55 -0800 (PST) From: Harold Huang To: dev@dpdk.org Subject: [PATCH v3] net/kni: reset rte_kni_conf struct before initialization Date: Sun, 5 Dec 2021 13:30:41 +0800 Message-Id: <20211205053041.2156629-1-baymaxhuang@gmail.com> X-Mailer: git-send-email 2.27.0 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