From: "Wang, Haiyue" <haiyue.wang@intel.com>
To: "Stillwell Jr, Paul M" <paul.m.stillwell.jr@intel.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Zhang, 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
Date: Tue, 30 Apr 2019 17:19:04 +0000 [thread overview]
Message-ID: <E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <F8A4ECA1C1D86B4081DD6BF503D1F436C7491A90@fmsmsx120.amr.corp.intel.com>
> -----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 |= ICE_AQ_PHY_ENA_LINK;
> > + else
> > + cfg.caps &= ~ICE_AQ_PHY_ENA_LINK;
> > +
> > + status = 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 == 0' be treated as successful, and other value defined
in 'enum ice_status ' will be treated as error code by function ' eth_err ' through
' rte_eth_dev_set_link_down/up'.
> > +out:
> > + ice_free(hw, pcaps);
> > + return status;
> > +}
> > +
> > +static int
> > +ice_dev_set_link_up(struct rte_eth_dev *dev) {
> > + struct ice_hw *hw = 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 = 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
next prev parent reply other threads:[~2019-04-30 17:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 7:11 Haiyue Wang
2019-04-30 7:11 ` Haiyue Wang
2019-04-30 16:23 ` Stillwell Jr, Paul M
2019-04-30 16:23 ` Stillwell Jr, Paul M
2019-04-30 17:19 ` Wang, Haiyue [this message]
2019-04-30 17:19 ` Wang, Haiyue
2019-04-30 18:43 ` Stillwell Jr, Paul M
2019-04-30 18:43 ` Stillwell Jr, Paul M
2019-05-01 1:08 ` Zhang, Qi Z
2019-05-01 1:08 ` Zhang, Qi Z
2019-05-03 3:30 ` Wang, Haiyue
2019-05-03 3:30 ` Wang, Haiyue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E3B9F2FDCB65864C82CD632F23D8AB8773358983@SHSMSX101.ccr.corp.intel.com \
--to=haiyue.wang@intel.com \
--cc=dev@dpdk.org \
--cc=paul.m.stillwell.jr@intel.com \
--cc=qi.z.zhang@intel.com \
--cc=wenzhuo.lu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).