From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v1 2/4] eventdev: improve err handling for Rx adapter queue add/del Date: Sun, 17 Jun 2018 19:01:28 +0530 Message-ID: <20180617133127.GC7498@jerin> References: <1528481718-7241-1-git-send-email-nikhil.rao@intel.com> <1528481718-7241-3-git-send-email-nikhil.rao@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Nikhil Rao Return-path: Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700088.outbound.protection.outlook.com [40.107.70.88]) by dpdk.org (Postfix) with ESMTP id C3B511B4EF for ; Sun, 17 Jun 2018 15:31:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1528481718-7241-3-git-send-email-nikhil.rao@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Fri, 8 Jun 2018 23:45:15 +0530 > From: Nikhil Rao > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, Nikhil Rao > Subject: [PATCH v1 2/4] eventdev: improve err handling for Rx adapter queue > add/del > X-Mailer: git-send-email 1.8.3.1 > > The new WRR sequence applicable after queue add/del is set > up after setting the new queue state, so a memory allocation > failure will leave behind an incorrect state. > > This change separates the memory sizing + allocation for the > Rx poll and WRR array from calculation of the WRR sequence. > If there is a memory allocation failure, existing Rx queue > configuration remains unchanged. > > Signed-off-by: Nikhil Rao > --- > @@ -995,7 +1177,6 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, > struct rte_event_eth_rx_adapter *rx_adapter; > struct rte_eventdev *dev; > struct eth_device_info *dev_info; > - int start_service; > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL); > RTE_ETH_VALID_PORTID_OR_ERR_RET(eth_dev_id, -EINVAL); > @@ -1038,7 +1219,6 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, > return -EINVAL; > } > > - start_service = 0; > dev_info = &rx_adapter->eth_devices[eth_dev_id]; > > if (cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT) { > @@ -1072,16 +1252,13 @@ static int rxa_sw_add(struct rte_event_eth_rx_adapter *rx_adapter, > ret = rxa_sw_add(rx_adapter, eth_dev_id, rx_queue_id, > queue_conf); > rte_spinlock_unlock(&rx_adapter->rx_lock); > - if (ret == 0) > - start_service = > - !!rxa_sw_adapter_queue_count(rx_adapter); > } > > if (ret) > return ret; > > - if (start_service) > - rte_service_component_runstate_set(rx_adapter->service_id, 1); > + rte_service_component_runstate_set(rx_adapter->service_id, > + rxa_sw_adapter_queue_count(rx_adapter)); Please move this logic under above !cap & RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT condition as rte_service not valid for internal ports. >