From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 085FEA0A0E; Tue, 11 May 2021 14:29:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E71BF40140; Tue, 11 May 2021 14:29:18 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 8A9654003E for ; Tue, 11 May 2021 14:29:17 +0200 (CEST) IronPort-SDR: aPSsT8/lnpu3s1YrcqS+UpcB+dRP0ZSeI2JP9eLn4lpf1ogYixO4FFXGslpZEUiWVp6W052g2i wr2i8nKEI9jQ== X-IronPort-AV: E=McAfee;i="6200,9189,9980"; a="186867904" X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="186867904" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 05:29:16 -0700 IronPort-SDR: C8GKxUxl2/nNPwt0dM9tKc2oSwBQRkxvX8FwtZy7giZ6NfGT+q5wL91rSXVNOskkcmujPPuLah BE4+z1Mis+eQ== X-IronPort-AV: E=Sophos;i="5.82,290,1613462400"; d="scan'208";a="537007896" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.224.45]) ([10.213.224.45]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2021 05:29:14 -0700 To: Michal Krawczyk Cc: dev@dpdk.org, ndagan@amazon.com, gtzalik@amazon.com, igorch@amazon.com, upstream@semihalf.com, Stanislaw Kardach , Shay Agroskin References: <87e65a42-4ae5-1a81-8f8e-74759fc14999@intel.com> <20210511064554.10656-1-mk@semihalf.com> <20210511064554.10656-18-mk@semihalf.com> From: Ferruh Yigit X-User: ferruhy Message-ID: Date: Tue, 11 May 2021 13:29:10 +0100 MIME-Version: 1.0 In-Reply-To: <20210511064554.10656-18-mk@semihalf.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v4 17/19] net/ena: disable dev ops not supported in SMP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 5/11/2021 7:45 AM, Michal Krawczyk wrote: > From: Stanislaw Kardach > > For dev_ops not supported in SMP, either return -EPERM or return without > doing anything. In both cases log a warning. > 'SMP' can be confusing in this context, this is not exactly related to SMP. In DPDK we tend to call this multi process support, or for this patch it is more likely secondary process, like: net/ena: disable dev ops not supported by secondary process btw, some device operations not supported by secondary process independent from driver, it is possible to handle them in ethdev layer. Right now responsibility is mostly pushed to the application. > Signed-off-by: Stanislaw Kardach > Reviewed-by: Michal Krawczyk > Reviewed-by: Igor Chauskin > Reviewed-by: Shay Agroskin > --- > v4: > * Fix commit heading style. > > drivers/net/ena/ena_ethdev.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c > index 055fa6d514..21bea98007 100644 > --- a/drivers/net/ena/ena_ethdev.c > +++ b/drivers/net/ena/ena_ethdev.c > @@ -535,6 +535,12 @@ ena_dev_reset(struct rte_eth_dev *dev) > { > int rc = 0; > > + /* Cannot release memory in secondary process */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + PMD_DRV_LOG(WARNING, "dev_reset not supported in secondary.\n"); > + return -EPERM; > + } > + > ena_destroy_device(dev); > rc = eth_ena_dev_init(dev); > if (rc) > @@ -1058,6 +1064,12 @@ static int ena_start(struct rte_eth_dev *dev) > uint64_t ticks; > int rc = 0; > > + /* Cannot allocate memory in secondary process */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + PMD_DRV_LOG(WARNING, "dev_start not supported in secondary.\n"); > + return -EPERM; > + } > + > rc = ena_check_valid_conf(adapter); > if (rc) > return rc; > @@ -1104,6 +1116,12 @@ static int ena_stop(struct rte_eth_dev *dev) > struct ena_com_dev *ena_dev = &adapter->ena_dev; > int rc; > > + /* Cannot free memory in secondary process */ > + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { > + PMD_DRV_LOG(WARNING, "dev_stop not supported in secondary.\n"); > + return -EPERM; > + } > + > rte_timer_stop_sync(&adapter->timer_wd); > ena_queue_stop_all(dev, ENA_RING_TYPE_TX); > ena_queue_stop_all(dev, ENA_RING_TYPE_RX); >