On 6/17/2018 7:01 PM, Jerin Jacob wrote:
-----Original Message-----
Date: Fri, 8 Jun 2018 23:45:15 +0530
From: Nikhil Rao <nikhil....@intel.com>
To: jerin.ja...@caviumnetworks.com
CC: dev@dpdk.org, Nikhil Rao <nikhil....@intel.com>
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 <nikhil....@intel.com>
---
@@ -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.

Reply via email to