From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rao, Nikhil" Subject: Re: [PATCH v1 2/4] eventdev: improve err handling for Rx adapter queue add/del Date: Mon, 18 Jun 2018 17:43:35 +0530 Message-ID: <518488a6-5ae1-bf2b-9125-ca622cb4c476@intel.com> References: <1528481718-7241-1-git-send-email-nikhil.rao@intel.com> <1528481718-7241-3-git-send-email-nikhil.rao@intel.com> <20180617133127.GC7498@jerin> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Jerin Jacob Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 25818293B for ; Mon, 18 Jun 2018 14:13:37 +0200 (CEST) In-Reply-To: <20180617133127.GC7498@jerin> Content-Language: en-US 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 6/17/2018 7:01 PM, Jerin Jacob wrote: > -----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. Ok.