From: "Zhang, Qi Z" <qi.z.zhang@intel.com>
To: "Yang, Qiming" <qiming.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] net/ice: check process type in reset operation
Date: Tue, 27 Sep 2022 02:07:10 +0000 [thread overview]
Message-ID: <DM4PR11MB59944F500A45DF3E066BFBC2D7559@DM4PR11MB5994.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220926134405.304919-1-qiming.yang@intel.com>
> -----Original Message-----
> From: Yang, Qiming <qiming.yang@intel.com>
> Sent: Monday, September 26, 2022 9:44 PM
> To: dev@dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>
> Subject: [PATCH] net/ice: check process type in reset operation
>
> The secondary processes are not allowed to release shared resources.
> so the stop and reset operation are forbidden in a secondary process.
>
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> ---
> drivers/net/ice/ice_ethdev.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> cf63ce1f32..d855e9ebe1 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -2504,6 +2504,9 @@ ice_dev_stop(struct rte_eth_dev *dev)
> struct rte_intr_handle *intr_handle = pci_dev->intr_handle;
> uint16_t i;
>
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> + return 0;
> +
If we didn't explicitly deny dev_start from secondary process, then we'd better keep same for dev_stop
Any conflict should be handled inside the PMD.
> /* avoid stopping again */
> if (pf->adapter_stopped)
> return 0;
> @@ -3742,6 +3745,9 @@ ice_dev_reset(struct rte_eth_dev *dev) {
> int ret;
>
> + if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> + return -ENOTSUP;
> +
> if (dev->data->sriov.active)
> return -ENOTSUP;
>
> --
> 2.25.1
prev parent reply other threads:[~2022-09-27 2:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-26 13:44 Qiming Yang
2022-09-27 2:07 ` Zhang, Qi Z [this message]
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=DM4PR11MB59944F500A45DF3E066BFBC2D7559@DM4PR11MB5994.namprd11.prod.outlook.com \
--to=qi.z.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=qiming.yang@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).