From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 37F46A0577; Tue, 7 Apr 2020 03:37:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 034562B96; Tue, 7 Apr 2020 03:37:50 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id CF09C2B83 for ; Tue, 7 Apr 2020 03:37:47 +0200 (CEST) IronPort-SDR: k1h0lKThv0jz18AYFM6Mj5sdGAnKJw5+zclX9sCvcwMD2G6/tr2vc15KZZWvvMdI2MTflU8hpf i6QDIHm/sWpQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2020 18:37:46 -0700 IronPort-SDR: EDcqNnK5M/KQBogWeuG3c6o8LX08TkGePICA8u+Nxy76J78rXa4lJQpr6Xgj/jUyCtdDilr/6g 9Kf524laA3+w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,353,1580803200"; d="scan'208";a="274934728" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga004.fm.intel.com with ESMTP; 06 Apr 2020 18:37:46 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Apr 2020 18:37:45 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 6 Apr 2020 18:37:45 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.225]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.129]) with mapi id 14.03.0439.000; Tue, 7 Apr 2020 09:37:42 +0800 From: "Chen, Zhaoyan" To: "dev@dpdk.org" CC: "Yang, Qiming" , "Wu, Jingjing" , "Cui, LunyuanX" , "Cui, LunyuanX" , "Chen, Zhaoyan" Thread-Topic: [dpdk-dev] [PATCH v2] net/iavf: enable port reset Thread-Index: AQHWB/Wd8Kb8JC+ZU0myBU8LjCFZu6hs6cdg Date: Tue, 7 Apr 2020 01:37:41 +0000 Message-ID: <9DEEADBC57E43F4DA73B571777FECECA41F21E13@SHSMSX104.ccr.corp.intel.com> References: <20200325024758.132253-1-lunyuanx.cui@intel.com> <20200401071214.109641-1-lunyuanx.cui@intel.com> In-Reply-To: <20200401071214.109641-1-lunyuanx.cui@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/iavf: enable port reset X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Tested-by: Chen, Zhaoyan > -----Original Message----- > From: dev On Behalf Of Lunyuan Cui > Sent: Wednesday, April 1, 2020 3:12 PM > To: dev@dpdk.org > Cc: Yang, Qiming ; Wu, Jingjing > ; Cui, LunyuanX > Subject: [dpdk-dev] [PATCH v2] net/iavf: enable port reset >=20 > This patch is intended to add iavf_dev_reset ops, enable iavf to support > "port reset all". >=20 > Signed-off-by: Lunyuan Cui > Acked-by: Jingjing Wu > --- > drivers/net/iavf/iavf_ethdev.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c > index 7a8bec9c9..382530a43 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -32,6 +32,7 @@ static int iavf_dev_configure(struct rte_eth_dev > *dev); static int iavf_dev_start(struct rte_eth_dev *dev); static void > iavf_dev_stop(struct rte_eth_dev *dev); static void iavf_dev_close(struc= t > rte_eth_dev *dev); > +static int iavf_dev_reset(struct rte_eth_dev *dev); > static int iavf_dev_info_get(struct rte_eth_dev *dev, > struct rte_eth_dev_info *dev_info); static > const uint32_t *iavf_dev_supported_ptypes_get(struct rte_eth_dev *dev); > @@ -91,6 +92,7 @@ static const struct eth_dev_ops iavf_eth_dev_ops =3D { > .dev_start =3D iavf_dev_start, > .dev_stop =3D iavf_dev_stop, > .dev_close =3D iavf_dev_close, > + .dev_reset =3D iavf_dev_reset, > .dev_infos_get =3D iavf_dev_info_get, > .dev_supported_ptypes_get =3D iavf_dev_supported_ptypes_get, > .link_update =3D iavf_dev_link_update, > @@ -1419,6 +1421,21 @@ iavf_dev_uninit(struct rte_eth_dev *dev) > return 0; > } >=20 > +/* > + * Reset VF device only to re-initialize resources in PMD layer */ > +static int iavf_dev_reset(struct rte_eth_dev *dev) { > + int ret; > + > + ret =3D iavf_dev_uninit(dev); > + if (ret) > + return ret; > + > + return iavf_dev_init(dev); > +} > + > static int > iavf_dcf_cap_check_handler(__rte_unused const char *key, > const char *value, __rte_unused void *opaque) > -- > 2.17.1