From: "Zhao1, Wei" <wei.zhao1@intel.com>
To: "Yigit, Ferruh" <ferruh.yigit@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
Subject: Re: [dpdk-dev] [PATCH 3/3] net/i40e: implement device reset on port
Date: Tue, 14 Mar 2017 06:46:42 +0000 [thread overview]
Message-ID: <A2573D2ACFCADC41BB3BE09C6DE313CA02058145@PGSMSX103.gar.corp.intel.com> (raw)
In-Reply-To: <08c8c198-7202-f45c-80d9-580a15bc7569@intel.com>
Hi,Ferruh
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, March 8, 2017 7:21 PM
> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH 3/3] net/i40e: implement device reset on
> port
>
> On 3/3/2017 4:56 AM, Wei Zhao wrote:
> > Implement the device reset function on vf port.
> > This restart function will detach device then attach device,
> > reconfigure dev, re-setup the Rx/Tx queues.
> >
> > Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
>
> <...>
>
> > +static int i40evf_dev_uninit(struct rte_eth_dev *eth_dev); static int
> > +i40evf_dev_init(struct rte_eth_dev *eth_dev); static void
> > +i40evf_dev_close(struct rte_eth_dev *dev); static int
> > +i40evf_dev_start(struct rte_eth_dev *dev); static int
> > +i40evf_dev_configure(struct rte_eth_dev *dev); static int
> > +i40evf_handle_vf_reset(struct rte_eth_dev *dev);
>
> Some of them already seems declared, please avoid unnecessary or
> duplicate declarations.
Ok, I will delete useless function declaration in V2 patch.
>
> > +
> >
> > /* Default hash key buffer for RSS */ static uint32_t
> > rss_key_default[I40E_VFQF_HKEY_MAX_INDEX + 1]; @@ -230,6 +237,7
> @@
> > static const struct eth_dev_ops i40evf_eth_dev_ops = {
> > .rss_hash_conf_get = i40evf_dev_rss_hash_conf_get,
> > .mtu_set = i40evf_dev_mtu_set,
> > .mac_addr_set = i40evf_set_default_mac_addr,
> > + .dev_reset = i40evf_handle_vf_reset,
> > };
> >
> > /*
> > @@ -885,10 +893,13 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,
> > args.out_buffer = vf->aq_resp;
> > args.out_size = I40E_AQ_BUF_SZ;
> > err = i40evf_execute_vf_cmd(dev, &args);
> > - if (err)
> > + if (err) {
> > PMD_DRV_LOG(ERR, "fail to execute command "
> > "OP_ADD_ETHER_ADDRESS");
> > -
> > + goto DONE;
>
> Please prefer lowercase labels,
> also this is error exit, I would prefer other name than "done"
Ok, I will delete useless function declaration in V2 patch.
>
> > + }
> > + vf->vsi.mac_num++;
> > +DONE:
> > return;
> > }
> >
>
> <...>
>
> > +static int
> > +i40evf_handle_vf_reset(struct rte_eth_dev *dev) {
> > + struct i40e_adapter *adapter =
> > + I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> > +
> > + if (!dev->data->dev_started)
> > + return 0;
> > +
> > + adapter->reset_number = 1;
> > + i40e_vf_reset_dev(dev);
>
> What happens if user called this function for PF ?
This is an illegal operation, so I will may be add an check of whether it is vf port,
if not , a return command to avoid illegal operation.
>
> > + adapter->reset_number = 0;
> > +
> > + return 0;
> > +}
> > +
>
> <...>
next prev parent reply other threads:[~2017-03-14 6:46 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 4:56 [dpdk-dev] [PATCH 0/3] net/i40e: vf port reset Wei Zhao
2017-03-03 4:56 ` [dpdk-dev] [PATCH 1/3] app/testpmd: add port reset command into testpmd Wei Zhao
2017-03-08 11:07 ` Ferruh Yigit
2017-03-14 7:58 ` Zhao1, Wei
2017-03-27 7:08 ` Zhao1, Wei
2017-03-03 4:56 ` [dpdk-dev] [PATCH 2/3] lib/librte_ether: add support for port reset Wei Zhao
2017-03-03 4:56 ` [dpdk-dev] [PATCH 3/3] net/i40e: implement device reset on port Wei Zhao
2017-03-08 11:20 ` Ferruh Yigit
2017-03-14 6:46 ` Zhao1, Wei [this message]
2017-03-24 8:31 ` Wu, Jingjing
2017-03-24 9:07 ` Wu, Jingjing
2017-03-27 6:10 ` Zhao1, Wei
2017-03-24 5:57 ` [dpdk-dev] [PATCH 0/3] net/i40e: vf port reset Wu, Jingjing
2017-03-27 6:17 ` Zhao1, Wei
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=A2573D2ACFCADC41BB3BE09C6DE313CA02058145@PGSMSX103.gar.corp.intel.com \
--to=wei.zhao1@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@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).