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 5C76EA034F; Wed, 24 Feb 2021 12:40:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C36054069B; Wed, 24 Feb 2021 12:40:28 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 25BE040042 for ; Wed, 24 Feb 2021 12:40:26 +0100 (CET) IronPort-SDR: HXG11lCMuG+mxlxzKXQ5knMaVbOJln2fvIKBI30tMzaZaoCnvCHfxSEt47CH2l204J62opM3Q5 dq4U1UMg6umQ== X-IronPort-AV: E=McAfee;i="6000,8403,9904"; a="172794350" X-IronPort-AV: E=Sophos;i="5.81,202,1610438400"; d="scan'208";a="172794350" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 03:40:25 -0800 IronPort-SDR: xG3hA77KJk/N1yBwYvYTN++VAzVtYNqdGtfSOjgVD7EFDhZXp59gMGgurlim69QdU9v1045ItR TD041larFszg== X-IronPort-AV: E=Sophos;i="5.81,202,1610438400"; d="scan'208";a="442041006" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.253.18]) ([10.213.253.18]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Feb 2021 03:40:09 -0800 To: Jiawen Wu , dev@dpdk.org References: <20210205033449.3813939-1-jiawenwu@trustnetic.com> <20210205033449.3813939-2-jiawenwu@trustnetic.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Wed, 24 Feb 2021 11:39:58 +0000 MIME-Version: 1.0 In-Reply-To: <20210205033449.3813939-2-jiawenwu@trustnetic.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 01/17] net/txgbe: add ethdev probe and remove for VF device 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 2/5/2021 3:34 AM, Jiawen Wu wrote: > Introduce virtual function driver in txgbe PMD, > add simple init and uninit function to probe and remove the device. > > Signed-off-by: Jiawen Wu <...> > +static int > +txgbevf_dev_close(struct rte_eth_dev *dev) > +{ > + PMD_INIT_FUNC_TRACE(); > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) > + return 0; > + > + dev->dev_ops = NULL; > + Many APIs access to 'dev->dev_ops->X' without checks, it may not be good idea to set it NULL before the port is released.