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 7A93FA0C43; Thu, 26 Aug 2021 12:25:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 407F640140; Thu, 26 Aug 2021 12:25:58 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A615F4013F for ; Thu, 26 Aug 2021 12:25:56 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10087"; a="239908080" X-IronPort-AV: E=Sophos;i="5.84,353,1620716400"; d="scan'208";a="239908080" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2021 03:25:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,353,1620716400"; d="scan'208";a="474159950" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga008.jf.intel.com with ESMTP; 26 Aug 2021 03:25:55 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 26 Aug 2021 03:25:55 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Thu, 26 Aug 2021 03:25:54 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Thu, 26 Aug 2021 03:25:54 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Thu, 26 Aug 2021 03:25:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fZfR9p+JFqzNi4RdMQrQMehfBjHlBj8QXKijJVd46PQYP896ZHrxVDjyqpb7ViJjf8/W+e6y1f0uZ9xkMQBJEkNtyKdgqlsLtoV6mojh3yd/dbquEaXzPYMR+OJtE25LrKBVLu41kk2d5LC0nhAzPoZdfyIq+dq0Y2+9aIfCrCMEqTasfkcgJs4Vyn4wJFFz35Pyw+0gkzomWlpX03Mch3dRrbXwRrXSmKPGFkvp4ME/bIlKoaCEV1U6J7qbuFunJ4qvqj8NVgz5pmxeGHNI6Ur6tIUNlR+/E7nslYsTnlvWYacgt89CS7tlLWVG/NiLNMXjjBbDEaghykc91QkZKQ== 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-SenderADCheck; bh=JKrVjkz7SvnNHdh7xGcbIdn3q9fU6oje4HTAb1V0q0g=; b=Vjk+su7Y7Gzpxe+eGe2dFytQNlwIhkYu6Isdad62q47uyMZLPmVb+7cqgsByumVZ+/8jXnp8FykxXlqhX78AKEHYqJP/4BGWjnsl9mUbsVX41rLvsljIU4bx2NKcKNHqtIQYFcAMJdfhKdJ6pk9RWFrkTgm+NvtRTIXg8idZXk6PDeckEVxVamtUXl2Zur2qhUsf9EzpK27WPj014grEhD6lXC8EnG4rDf60kpyorL2gD8hVnWhbczsQhdfvqv8uXima5/9GkPcUNht/S4Z67QikZj+QaN+GHSoEpZ3fu9wXOCC7fbNtvV4kMhatyIQmvCd/Ujn+Pnq9b4sZX4ZvTg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JKrVjkz7SvnNHdh7xGcbIdn3q9fU6oje4HTAb1V0q0g=; b=RbTxZsv61wNM5bXGg4jAGQ3PM3Uwt8LmIqjQFPCs2u341RWPg3sMYZA07mPrX00iwT71S3+awqDzXUdfQ1vCdVTfWGqSatkU6li1IrfoNZTUrqkXISkEapajOwx1CQP20XkwPfCJ6TtBM7AXRfI+3bOBebLxljkYSbMIk7Ax/1w= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4886.namprd11.prod.outlook.com (2603:10b6:510:33::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Thu, 26 Aug 2021 10:25:52 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::747b:3a08:d1ec:31fc%4]) with mapi id 15.20.4457.020; Thu, 26 Aug 2021 10:25:52 +0000 To: Ben Magistro , , Beilei Xing , Luca Boccassi CC: , , "Qi Zhang" , Kevin Traynor References: <20210825194526.14987-1-koncept1@gmail.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <94f93212-6432-710b-1135-638e359741da@intel.com> Date: Thu, 26 Aug 2021 11:25:47 +0100 In-Reply-To: <20210825194526.14987-1-koncept1@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DB6PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:4:3f::23) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by DB6PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:4:3f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.17 via Frontend Transport; Thu, 26 Aug 2021 10:25:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8036bb03-3dd3-48c9-0a4a-08d9687be1a0 X-MS-TrafficTypeDiagnostic: PH0PR11MB4886: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HnxpPNBxWuDIPCjZbaCDS/S4shoAxSp3VUUgyGaLgeRN4YTQo5XP9knP7jA8Ew1tlWIIoQ863tXR030L5JSMC1hqQ7vmW3dS+25TGP+2FhuiPhV5Q78dMwwQaM74wyWirXMDPb56svT3ziVmGIB8cAQPenww5Q0igUGQWjHO6r0c0q6uS0rTiZ7PDxR5yVcu3lGqj0/XPo9eof6WS/vv3bPWYoCL32w9BpNcQu3TJIuxXBA/PNFc3jJBddwcYJeevybfzBDTu+cfp89fx1IaZToYoMD1t9PI+yGuGeLuL28SdyE6i+cM38h/5rglP6kPq62/VJ9yOfwcZeYaMH5NJyAzKPsnVWO3CHI0Bfsg6ZOaF01dm3o6J7aPaokHDVzhmCh22qfAOBjwDZxwxNH2lsqtzB1+OrHEVk4QYrWLkJXLSCtMObMTX47lX8LQFZVBQ7Rk5MZ1G131IM7MJzqJ+3KoXUS0IQkN5PosCAeAVvn+WYdJuNqufts2wkrg0PpyF5FSK2MQkS8/MEbbOcbyVpEPc++WuDRSHXCMcFjHDC0kMX/jyGbEvN2sHhw6M/D1NNULvYOTUZlJKp7w+B0RvoWekGFhZb2DsUj8eeswfjBzn5U0u3rz4FoxLoqz/rcVg+bt+0km4BemcnkcLh7Ehu1guTERY4NadTGiv+j3xiIFfWQnZcos7V+WoI7TcNHJOBuI1eqSX74F0fpSP618TPgMv5PWZQQcE1v2+cl0Nov9i61389UHaWuLYZKUH5o+LfnNJHiFJcuWg1K6huKEuPuLurcfPXZlUhXCNRhVmt8= 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:(4636009)(376002)(136003)(366004)(346002)(396003)(39860400002)(6666004)(66946007)(66476007)(5660300002)(8676002)(31696002)(316002)(36756003)(66556008)(8936002)(6486002)(31686004)(110136005)(966005)(54906003)(478600001)(16576012)(38100700002)(83380400001)(26005)(186003)(86362001)(44832011)(956004)(2616005)(4326008)(2906002)(53546011)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NEVnN1YyMU5tV1BzVi9BUldSMlR0L2xpcWt4Wjc3SFYxb2VNeVVlU2pmMVRh?= =?utf-8?B?ZXlnNHY2UWJNZ0hOdENjTTFNVWdiVTRTYnVlUlY5dGp1NlBNVGZKS0RKNE1K?= =?utf-8?B?NThxYkJMUWZRdmJrdHVTOUZ0TWpERDZWQ3RHdzJIUDl2UFZnNHBZMzZEdXEv?= =?utf-8?B?NVNDVnM1TnRhd2Y0SWdSVDNQNlJ6azlBc01NMVlkUkt3RXNzUG9uejM4V24z?= =?utf-8?B?ZkJ3NFFpYmplajlVWmt1OFB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?B?bkJWMXZxeFZ6QTUxMmR2LzdMdndWZzJzZENQMFVHMU5telNDSG4xNlJXMzIr?= =?utf-8?B?cUpIM1RZYVBmTDI5WDFOSXoyNlVEL2VGM0QvbXhjUG5RTDBhQnNCWEQ0OUNy?= =?utf-8?B?MjVQUkNZZ1F6aUROT3QyWE4wMFBGdHR0NUF5ZDQ4QUd5eGhEcnZGbVcvMmFp?= =?utf-8?B?Y0RVLys5bjRiRXJyZm1HakNPejlpV2JkYUNrL3Y0MVN5V1IrMTJ0S3Zpd2N6?= =?utf-8?B?L1VlajJLVlcvaml5d0tYSFhTQjVGdHJ6aE1rTU9ZdVZ3M2FLYlU5Z2tHR0xu?= =?utf-8?B?M2p0OGpJRm82a1dUS0U4bGNBbGR4SXhKQldkWVdITDFFakNjZEdtRHkxdWl1?= =?utf-8?B?bm9ZUm5JbVMxZWQ5dmRDM3FCRVo2WnBIS0pjaXRTekdwVmVLS3RFOWY5M2Fy?= =?utf-8?B?aUY0dUR3YkNQTGJSY3hNQlltTFk3cmxVSFE1Z3NRZ2MyRTd3RVplZndWZTBW?= =?utf-8?B?UzVHT3hFVjZ0anErVjRHZFU4T05WSkViajUrWUdveFF4b3dpYmZiMUZ2WnpH?= =?utf-8?B?d0JTQzk5czY4VVBzeFZpcUpWempUUWdQWUVFRmdlRWd6UWFsY2x6SEYzU2My?= =?utf-8?Q?d4DO6Apskx3NIo4BbmeBVEmb0meUp+wh4HFgnRV?= X-MS-Exchange-CrossTenant-Network-Message-Id: 8036bb03-3dd3-48c9-0a4a-08d9687be1a0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2021 10:25:52.6508 (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: 7yp1kD6Ypbr9/aIjZxed+Nslyi+FdJmSLVYDHkGYOUWjLvMFbrVNasSm42S/zqk4pqb/pFTAC+/NJIHe0Me2Lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4886 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] driver: i40evf device initialization 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 Sender: "dev" On 8/25/2021 8:45 PM, Ben Magistro wrote: > The i40evf driver is not initializing the eth_dev attribute which > can result in a nullptr dereference. Changes were modeled after the > iavf_dev_init() per suggestion from the mailing list[1]. > > [1] https://mails.dpdk.org/archives/dev/2021-August/217251.html > > Signed-off-by: Ben Magistro i40evf will be removed in this release. But I guess it helps for stable releases to first merge the fixes and later removed it, not sure. @Luca, @Kevin, do you prefer this patch directly to stable repos, or through the main repo? i40evf won't be tested in the main anyway, since it would be removed before -rc1 testing, so it looks like there won't be any difference from testing point of view. > --- > drivers/net/i40e/i40e_ethdev_vf.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c > index 0cfe13b7b2..ccdce9a16a 100644 > --- a/drivers/net/i40e/i40e_ethdev_vf.c > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > @@ -1564,8 +1564,9 @@ i40evf_dev_alarm_handler(void *param) > static int > i40evf_dev_init(struct rte_eth_dev *eth_dev) > { > - struct i40e_hw *hw > - = I40E_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); > + struct i40e_adapter *adapter = > + I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private); > + struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(adapter); > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev); > > PMD_INIT_FUNC_TRACE(); > @@ -1596,11 +1597,14 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) > hw->device_id = pci_dev->id.device_id; > hw->subsystem_vendor_id = pci_dev->id.subsystem_vendor_id; > hw->subsystem_device_id = pci_dev->id.subsystem_device_id; > + hw->bus.bus_id = pci_dev->addr.bus; > hw->bus.device = pci_dev->addr.devid; > hw->bus.func = pci_dev->addr.function; > hw->hw_addr = (void *)pci_dev->mem_resource[0].addr; > hw->adapter_stopped = 1; > hw->adapter_closed = 0; > + hw->back = I40E_DEV_PRIVATE_TO_ADAPTER(eth_dev->data->dev_private); > + adapter->eth_dev = eth_dev; > > if(i40evf_init_vf(eth_dev) != 0) { > PMD_INIT_LOG(ERR, "Init vf failed"); >