From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 0372CA0679 for ; Tue, 30 Apr 2019 20:43:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC9D0397D; Tue, 30 Apr 2019 20:43:34 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id DB3E01DBA for ; Tue, 30 Apr 2019 20:43:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Apr 2019 11:43:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,414,1549958400"; d="scan'208";a="144942834" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga008.fm.intel.com with ESMTP; 30 Apr 2019 11:43:31 -0700 Received: from fmsmsx120.amr.corp.intel.com ([169.254.15.34]) by fmsmsx104.amr.corp.intel.com ([169.254.3.3]) with mapi id 14.03.0415.000; Tue, 30 Apr 2019 11:43:31 -0700 From: "Stillwell Jr, Paul M" To: "Wang, Haiyue" , "dev@dpdk.org" , "Zhang, Qi Z" , "Lu, Wenzhuo" Thread-Topic: [dpdk-dev] [PATCH v1] net/ice: add link-up and link-down functions Thread-Index: AQHU/yTVXHH+12LXl0uUSD6e7imuz6ZU40gQgACFZQD//6IaIA== Date: Tue, 30 Apr 2019 18:43:30 +0000 Message-ID: References: <1556608319-5135-1-git-send-email-haiyue.wang@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzc2YmU4ZTgtMTFiNy00NDVjLWFmZDktMGZhZTJmYWFkMDQyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicDhLSUNrTUE2eGRsUXljSXdlMFhaVDhtTUxTZWltM2lFWVZsdlhvcnlyT2Q4eE5kN2p1SWZmWmNpdFFXbUt4SSJ9 dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1] net/ice: add link-up and link-down functions 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" Message-ID: <20190430184330.w15vxZapqQTwO3T9Vsnnh1PKEdo4IcKqsLMU5a58J-c@z> > -----Original Message----- > From: Wang, Haiyue > Sent: Tuesday, April 30, 2019 10:19 AM > To: Stillwell Jr, Paul M ; dev@dpdk.org; Z= hang, > Qi Z ; Lu, Wenzhuo > Subject: RE: [dpdk-dev] [PATCH v1] net/ice: add link-up and link-down > functions >=20 > > -----Original Message----- > > From: Stillwell Jr, Paul M > > Sent: Wednesday, May 1, 2019 00:24 > > To: Wang, Haiyue ; dev@dpdk.org; Zhang, Qi Z > > ; Lu, Wenzhuo > > Cc: Wang, Haiyue > > Subject: RE: [dpdk-dev] [PATCH v1] net/ice: add link-up and link-down > > functions > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Haiyue Wang > > > Sent: Tuesday, April 30, 2019 12:12 AM > > > To: dev@dpdk.org; Zhang, Qi Z ; Lu, Wenzhuo > > > > > > Cc: Wang, Haiyue > > > Subject: [dpdk-dev] [PATCH v1] net/ice: add link-up and link-down > > > functions > > > > > > Support link up and down functions for ice, and when stop the ice, > > > makes the link down also. > > > > > > Signed-off-by: Haiyue Wang > > > --- > > > drivers/net/ice/ice_ethdev.c | 83 > > > ++++++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 83 insertions(+) > > > > > > diff --git a/drivers/net/ice/ice_ethdev.c > > > b/drivers/net/ice/ice_ethdev.c index 1f06a2c..8f58150 100644 > > > --- a/drivers/net/ice/ice_ethdev.c > > > +++ b/drivers/net/ice/ice_ethdev.c > > > @@ -32,6 +32,9 @@ static void ice_dev_info_get(struct rte_eth_dev > *dev, > > > struct rte_eth_dev_info *dev_info); static int > > > ice_link_update(struct rte_eth_dev *dev, > > > + if (link_up) > > > + cfg.caps |=3D ICE_AQ_PHY_ENA_LINK; > > > + else > > > + cfg.caps &=3D ~ICE_AQ_PHY_ENA_LINK; > > > + > > > + status =3D ice_aq_set_phy_cfg(hw, pi->lport, &cfg, NULL); > > > + > > > > It seems like you should either check the return value here and tell > > the user if it didn't work or change the code that calls this to tell > > the user if something went wrong. Otherwise the user thinks things > worked when it didn't. > > > I just make use of 'ICE_SUCCESS =3D=3D 0' be treated as successful, and o= ther > value defined in 'enum ice_status ' will be treated as error code by func= tion ' > eth_err ' through ' rte_eth_dev_set_link_down/up'. OK, I see, that makes sense. >=20 > > > +out: > > > + ice_free(hw, pcaps); > > > + return status; > > > +} > > > + > > > +static int > > > +ice_dev_set_link_up(struct rte_eth_dev *dev) { > > > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + return ice_force_phys_link_state(hw, true); } > > > + > > > +static int > > > +ice_dev_set_link_down(struct rte_eth_dev *dev) { > > > + struct ice_hw *hw =3D ICE_DEV_PRIVATE_TO_HW(dev->data- > > > >dev_private); > > > + > > > + return ice_force_phys_link_state(hw, false); } > > > + > > > static int > > > ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { > > > -- > > > 2.7.4