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 EB80EA0351 for ; Fri, 4 Mar 2022 15:27:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4E924013F; Fri, 4 Mar 2022 15:27:33 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 0F60B4013F; Fri, 4 Mar 2022 15:27:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646404052; x=1677940052; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=MekotLFCV/WnDsEeGCTQcf5sDokx/47JXFfmYfnt6wI=; b=G75ytSqmLYVMjSpi5vhdMsNgvqPXiWP2kJmhL8HQB/PI+C0qeS5nMzKV RYxO6Mwnx4DabgXx+nuEx3ziHbcdnV7PBNQNeDDz4vNpE4IIj1vdJr5n9 BbAeRB+qoEsQcysGE/by/b7NRJEzipHP76XZCM6kHxWycKaa7DNQTaAmr Gj+0D/0VNjHCXBkFGU3mPhzoVoluXRIRFwwR/s0je/jN6DDDrFQCJOQfj JzW53fbtbCvfVod3MAYYVnxv2WfJaN4Wy+NjEp3RaRBUxQjjrxTcXdmVg wJZe3RjulcRkR9mbxZcmgO2pE9KQ1IzBXXdX029sMEuZwuyv3kpteOK6W g==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="241407176" X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="241407176" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Mar 2022 06:27:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,155,1643702400"; d="scan'208";a="552238068" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga008.jf.intel.com with ESMTP; 04 Mar 2022 06:27:30 -0800 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Fri, 4 Mar 2022 06:27:30 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Fri, 4 Mar 2022 06:27:30 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Fri, 4 Mar 2022 06:27:30 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNtffF/95UBIfKEuHZ77XyXGjWha6XzNGctLPKlFkBQSxnF0Dz9Hs+404UCcL8GCfJcJON2ivVyEyaZ2GBGpLJ8zkF42YWCfNtwRPPfd1aVs7sbwgpdYUVJCAL9eU/4W4pfKXg3Fwb8ceolwU0W2l/4/aqPj49CK5FNMkdi8JozzuuoEaqTyUdBPrnfrDmasMrxpKdefZVtM/re39emjhETKPj3joqh9qwNJRkLZDALQVU9qggfychSiFehMCl59iTQao/NO2I2/imtqeAylWyf9+Ol037oD9EL6PDLdhR/LbTOro6PKUpYeqa3lJrDomfyqdPXFVJ167pKj2gWD4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FOIokAWPARc1i5MRTket/vBDtbeFO7t085x0siNR2hs=; b=ImG8I1RejQq/ANtYRyACF19ZJdepDENMKplWhlsoctWw3Bl1DrcWKBh2e01F6XUbYoJiI88SSBfP7ZBxZe05lq5Y6EzD4axOppdb+bg6t5o+uHJ8TFW1xzLG7l1yfDlydmc9ceZ74PuQPRxTLy5pJQajj8dJECLdk52M5ZVswavLhwCl/TsseMoeC3JVzhmodjn964kMdrsi42UcGmaiGD489b2bfxdey0oJy91kjC9fKG2+yr5tbKC6UEqLDHEWeiZMfi2pFsAC7BtsGt/ehuXQdmzZpLBO1/X3HR+uZK5HyWvI319Pi8dKHBd74aZZTx/z7MY3YeW1IINVClCvQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by DM8PR11MB5735.namprd11.prod.outlook.com (2603:10b6:8:10::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14; Fri, 4 Mar 2022 14:27:28 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::bd21:6fbe:8308:2ecf%7]) with mapi id 15.20.5038.017; Fri, 4 Mar 2022 14:27:28 +0000 Message-ID: <72a6e129-1da1-5c00-b582-a55db54fbd9c@intel.com> Date: Fri, 4 Mar 2022 14:27:22 +0000 Content-Language: en-US To: Harold Huang , CC: , Liron Himi References: <20220302123400.188209-1-baymaxhuang@gmail.com> <20220303021803.382374-1-baymaxhuang@gmail.com> From: Ferruh Yigit Subject: Re: [PATCH] net/kni: initialize rte_kni_conf to 0 before using it X-User: ferruhy In-Reply-To: <20220303021803.382374-1-baymaxhuang@gmail.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB8PR03CA0036.eurprd03.prod.outlook.com (2603:10a6:10:be::49) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 05703927-7ed5-468d-c550-08d9fdeb1c04 X-MS-TrafficTypeDiagnostic: DM8PR11MB5735:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k4YR8/KDFJBwLZrpm69UWpeOvo/UITXEbkvPgkmJ30IoZFofWlMKZLpDDo227UddxKmpcIRn0jBU+k73Zdjwr9RZEJyPJrvMuFdPtEyTcyXHbp929C/BBlEft+fdmnu7xQoLp92wcq8ytwlhqB69eWOtDwrgIhGmSSYft5UUzNfOEy9mKtAG0hatzDQKeowVZdvPYnLKcYwxgO3bY7kw8up5XAlt+7zqPriBFG7VTpNvht7ZTuKK7LMBEWbxaOTpFnc/PKAA3LBWtjPiNmuyGuzd+MOfwq65VWpDE85rvEa6kU1hOKLJMFF5LeSu/vCFJ8JhTp0urVhWXYYUnJ1qSjLMP2W8wTl8G2o/p22MwlE7xb/l67Xxe/uP9ydLNF+qCbKcQrrGdLQg05XEriJTsAPRG0Z5316KvOixE+QY1W3SMnGMq4bM2LC5/GwoOusf4xaxwyN3pI7jpKyW0y3EJKEyOG35LmNuZleTuP+kKRuWbyewV9/zoTAzn8kXZCCFexHiK7A8Q0gotzFjROPPAgSEQ8tsHAOQYn5AV8MhlJdjvhvYjzaz7A/O25DrDveWi7FM+dQUUXu4EH2CgohLwnuNysgkN+y6iF2YdbOhpeSlKCusyFSbmwgsn6wFyiKh9qRXCF/zpy+3w6Gje9ruxh4K4W5ZlM7WazwNCL8dCzwW0pRZM8oSF8/+Gy8gR8L1O+FSNK6GOezlkPgJLjPJIw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(5660300002)(83380400001)(508600001)(66946007)(66556008)(66476007)(8676002)(6486002)(4326008)(8936002)(31696002)(53546011)(86362001)(82960400001)(6506007)(2616005)(6512007)(2906002)(186003)(26005)(6666004)(44832011)(36756003)(31686004)(316002)(38100700002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eUZDOVBDNEJSMUhmWWxCT01SS3VKTlBxTmkyMU9ab1pELzFOaEhqNCtBMGdI?= =?utf-8?B?SE9OTTVxcmJQVGFSV08va1JIckFxalN5elo1RktQV3V1WG9NL2ZkZW5JS1Jy?= =?utf-8?B?bytON09ERU5FL0FSdmpkRGZDbys1OW5sQ29xV3cwMmZDQlE2VWRaVTk0cVor?= =?utf-8?B?ZFUwdGZvdTdWR1lrU1cxUnhSWDVxYXMzeWpzMU9MODFndGV6N1R1ODhkMTli?= =?utf-8?B?c3oxN3JWRk84Yk9ZYnd1b05kOTlabktnNndOcG9ETkJmMW1YdkZUcFhuMG1O?= =?utf-8?B?cm1ZL1NmMVpYY0FqR09pd2RXRzFSdjhOcWFQMzdTSW03bUVSZzgxOHNxS0Fj?= =?utf-8?B?b2hycGlqT1NJZVZ3NG9saEg3NGNEaHB1ZmhuYXIvVXc3VE9uc1FYcDJpSG9w?= =?utf-8?B?aHRxMjZYeUhua3V6dTM2cFRIL3dvbms1elByeDMwamhFcmhhamFXeHI1MlVW?= =?utf-8?B?aVRza3hlWlVYckVQQUdzTXRuWmNpWVdPNjJ5S2UvaXZ4bHpFWDNaOEI4e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kvVklTejVvVVAvRjhqbmt6MDZ1?= =?utf-8?B?ZjBaTElQWkFPU2FrZkYwNVQxYmVETlo3djhISk10UGhscW9FektBc0tJZ1lk?= =?utf-8?B?c25peVJnUzMyTkNnaldBTHV5OU53aUt2MjM1ZWs0N1JrNTUySUxvZFRFSHor?= =?utf-8?B?cWFtYmR2cVkzbWxoQ3hVYXNMUk1NeEV5NU1LQ3dwNlk3U1NRK292QXhFUVNL?= =?utf-8?B?aGZpSEg0VmRieEdkV1BlS2R5U0dFNDBsd2U4S3VhV29uMHlWSEhtaVhLQkhi?= =?utf-8?B?TWRlaUI3dy94WHF1L0grMHppU2RPRzc2cm1DOEd3cHZQejlEajBWT2Z1RnVh?= =?utf-8?B?ZHJrSlJNNkFKRW5kQzltcUdZMjNuZjBXT2VMY3YxVnlqOE5NeWEyazFSaGlZ?= =?utf-8?B?NG4zaitLc3VnRnVoZHdwT01tamhiK1djamxsWm5aT3dCZjBDR0pyN3BoQ0hX?= =?utf-8?B?Z3oyTGR1ajErOWozMEhHcndEZGdFeldnZk1aZjFWTXJCOE9ybHpwRTE4d0k2?= =?utf-8?B?VGpieVlFUWJ1V05HVXJCR293YjRQZm1qVUhqNk1neGFGSVdCVGcycGVlQUxu?= =?utf-8?B?UW1aWFJxV3ZjTHdXUEwzYVNnaTk1TnZnRHNjbG0zMzZQUWJISE9jbVA0NStm?= =?utf-8?B?K3JwaXdleDF0SmVtMzlBQlkwOVJvbldzaE5rVmtrWklaRmQ0MWNLTXB5Syti?= =?utf-8?B?WDB5M2UrbVN5bHV0N2hpUlRTVVhBaHI0VnJ2cEZiQ1dRZzRBTktEdnlDN0Vj?= =?utf-8?Q?AfaKejntXvWANTnEwS1qlUQ=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 05703927-7ed5-468d-c550-08d9fdeb1c04 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2022 14:27:28.1663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jrG0qj4e9AiZ8OnPaG7GZWWoDjaNRAHOdJaJC+vBZ7ft7u+VPU4uPJMmGZfumgzSskmuvRBS5hzpSGuOZzsb8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5735 X-OriginatorOrg: intel.com 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 On 3/3/2022 2:18 AM, Harold Huang wrote: > 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 }; This is causing build error [1], updated in next-net [2] to fix. Normally '{ 0 }' should be universal zero-initializer, but I guess it fails because of old compiler version: gcc 4.8.5 "cc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)" [1] FAILED: drivers/a715181@@tmp_rte_net_kni@sta/net_kni_rte_eth_kni.c.o ../drivers/net/kni/rte_eth_kni.c: In function 'eth_kni_start': ../drivers/net/kni/rte_eth_kni.c:127:9: error: missing braces around initializer [-Werror=missing-braces] struct rte_kni_conf conf = { 0 }; ^ [2] struct rte_kni_conf conf = {{0}}; > const char *name = dev->device->name + 4; /* remove net_ */ > > mb_pool = internals->rx_queues[0].mb_pool;