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 4CC2EA0C43; Thu, 26 Aug 2021 12:46:24 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C62C340140; Thu, 26 Aug 2021 12:46:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 23F894013F for ; Thu, 26 Aug 2021 12:46:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629974781; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1PCa4lPDr2CjklXOO2a1rCIhqc3QSC0ZBENfefwEkjI=; b=GhGc61MWWr9KX5/oB1pOrRkw/3Z0LMBPo47dzHikNkq5rNDdJpq4FAvNNnzUfPRTqoMAwA xwIU4nks0maDvXIH7pmNphUeYnXldJ7IByZiBumBcQ+WYp6QkiQ1NrUPQtWhWW3d0KQc2B aszycjJGPRNnnRFQzB7BVgokHlHwrEs= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-V7D6HqSdODi85lGqt8vYTg-1; Thu, 26 Aug 2021 06:46:18 -0400 X-MC-Unique: V7D6HqSdODi85lGqt8vYTg-1 Received: by mail-wr1-f71.google.com with SMTP id p1-20020adfcc81000000b001576cccf12cso705642wrj.6 for ; Thu, 26 Aug 2021 03:46:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1PCa4lPDr2CjklXOO2a1rCIhqc3QSC0ZBENfefwEkjI=; b=R4eEV/dHxwCWMT/HPbhif0QMBo1p40avv6E4l0g8glFMt4I/8w5do4Q+NzlKRPVD01 Rvj3d/qAL7pqQhA2GfCvieCrATbP5lIXw2gRczsAAn5b9SXdu5oq1lLMSslzeIWw/X0a SdCAv5quNEW5rUrPCSaOq9sWQcD6j2xWXgWqBqboavYMFDto9DjqHb0kXt5sPGYgzHig gQCvou11tO8p2n3UAH6q+RkwxcIM0Qos7dPUWkmDJ1tn7q4RexMl1g3vY7mRLUd9zYyz NbfYXBJgYg3ZxM4bx6hJbVhRfnFxa1VgIusTQ3PDtwvm+ZJ+Yavh3RXvBnCOT2MuE7R9 1Vsg== X-Gm-Message-State: AOAM533BXk0U+L05t/rEpudXstaJOnSOGCxQkWCFIr2RlH0rjhKltPTb ykNH6KrMnbqP2sE4GmWXXVc3hAV7BOCpoIE5y7voML/TxTIxhNUC1YTQRgHImO2wbZpcVbi7IHJ Ih94= X-Received: by 2002:a1c:7f90:: with SMTP id a138mr2904867wmd.33.1629974777186; Thu, 26 Aug 2021 03:46:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbrWi6QGJrDJ352HSdJxalv5Y70zlvTlACTr1GyUuSr7+djoWkxZJ++vFgLXQRzSAMYgXceg== X-Received: by 2002:a1c:7f90:: with SMTP id a138mr2904857wmd.33.1629974777026; Thu, 26 Aug 2021 03:46:17 -0700 (PDT) Received: from [192.168.0.36] ([78.18.17.175]) by smtp.gmail.com with ESMTPSA id b4sm2686522wrp.33.2021.08.26.03.46.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Aug 2021 03:46:16 -0700 (PDT) To: Ferruh Yigit , Ben Magistro , dev@dpdk.org, Beilei Xing , Luca Boccassi , Christian Ehrhardt , "Xueming(Steven) Li" Cc: ben.magistro@trinitycyber.com, stefan.baranoff@trinitycyber.com, Qi Zhang References: <20210825194526.14987-1-koncept1@gmail.com> <94f93212-6432-710b-1135-638e359741da@intel.com> From: Kevin Traynor Message-ID: <11dd4ae3-0396-b237-7f2b-1484f07bb637@redhat.com> Date: Thu, 26 Aug 2021 11:46:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <94f93212-6432-710b-1135-638e359741da@intel.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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" + Christian and Xueming On 26/08/2021 11:25, Ferruh Yigit wrote: > 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? I'll leave to Luca/Xueming and Christian to say if they have a preference, but I'd guess either way is fine from stable view once it has fixes/stable tags or LTS patch prefix (it doesn't have any of these at present). > 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"); >> >