From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <paul.m.stillwell.jr@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id DB3E01DBA
 for <dev@dpdk.org>; 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" <paul.m.stillwell.jr@intel.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
 "Zhang, Qi Z" <qi.z.zhang@intel.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
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: <F8A4ECA1C1D86B4081DD6BF503D1F436C7491C64@fmsmsx120.amr.corp.intel.com>
References: <1556608319-5135-1-git-send-email-haiyue.wang@intel.com>
 <F8A4ECA1C1D86B4081DD6BF503D1F436C7491A90@fmsmsx120.amr.corp.intel.com>
 <E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com>
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="us-ascii"
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 30 Apr 2019 18:43:33 -0000


> -----Original Message-----
> From: Wang, Haiyue
> Sent: Tuesday, April 30, 2019 10:19 AM
> To: Stillwell Jr, Paul M <paul.m.stillwell.jr@intel.com>; dev@dpdk.org; Z=
hang,
> Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> 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 <haiyue.wang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>
> > 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 <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > <wenzhuo.lu@intel.com>
> > > Cc: Wang, Haiyue <haiyue.wang@intel.com>
> > > 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 <haiyue.wang@intel.com>
> > > ---
> > >  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

From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 0372CA0679
	for <public@inbox.dpdk.org>; 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 <dev@dpdk.org>; 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" <paul.m.stillwell.jr@intel.com>
To: "Wang, Haiyue" <haiyue.wang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>,
 "Zhang, Qi Z" <qi.z.zhang@intel.com>, "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
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:
 <F8A4ECA1C1D86B4081DD6BF503D1F436C7491C64@fmsmsx120.amr.corp.intel.com>
References: <1556608319-5135-1-git-send-email-haiyue.wang@intel.com>
 <F8A4ECA1C1D86B4081DD6BF503D1F436C7491A90@fmsmsx120.amr.corp.intel.com>
 <E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com>
In-Reply-To: <E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190430184330.w15vxZapqQTwO3T9Vsnnh1PKEdo4IcKqsLMU5a58J-c@z>


> -----Original Message-----
> From: Wang, Haiyue
> Sent: Tuesday, April 30, 2019 10:19 AM
> To: Stillwell Jr, Paul M <paul.m.stillwell.jr@intel.com>; dev@dpdk.org; Z=
hang,
> Qi Z <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> 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 <haiyue.wang@intel.com>; dev@dpdk.org; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>
> > 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 <qi.z.zhang@intel.com>; Lu, Wenzhuo
> > > <wenzhuo.lu@intel.com>
> > > Cc: Wang, Haiyue <haiyue.wang@intel.com>
> > > 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 <haiyue.wang@intel.com>
> > > ---
> > >  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