From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id CFDB61B3F0 for ; Mon, 3 Dec 2018 16:24:13 +0100 (CET) Received: by mail-oi1-f194.google.com with SMTP id t204so11211331oie.7 for ; Mon, 03 Dec 2018 07:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=94n2p6c42u/hYsTP1CnyHlC48QZecJM7hgOVd8zNi3c=; b=h1KUiQvfMQgyB9wDwOviJBc2pIjA92j6Wl47DzZWTV/d6giREOb83evPgWeZH4wKkP nFgm1Kn/aMprwq0Ug3xB9953I0HvCs9gxkZ81YYzfJzOh4l3zhpoOmrM3+ITolQHRyOF xBFMyp/cEchvkmam2tNs+aePNnPvqHJh9tj2z80Zyzmu/aTt8W+gZU2rtfFa1tooFfRo agf2bYsIAvW6VCqHUxggEQJTXdu9WbtaJRwt9GdBA467kl8VjHlWEjIWFeWfMqp3chcF qboqOBPW7H78ZpGQzgd0+NgVkXoqED90jh+J7wOgRd1QY7NerXGHKCfq8zNJ3gnFS6Hn xueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=94n2p6c42u/hYsTP1CnyHlC48QZecJM7hgOVd8zNi3c=; b=LPFw7zIxYCXvxyq7uGowQdWm13EQKjZidkAzb6YNFZO7UaEe1Lqt+w1zSxYkN/BRDH tqqESvlRGW4gJNhLs9wYCRo5PB44sIM/7d+j9WVDcfYrRYJQAUvbki7wKHEvYT4v8zKZ 2JikFpScDvP9Ts48frqq3LzMFYzU1IGrv9TXjv3N+DxCaIhULXlJCUrhyuKvq6nFK+nC i4I/j0MHx3AsN5Spg5cdH2L8wI0PgBt/WrLdkxtY9W7Xu278NmXdonDvi20UhzKwAipi 5heaLEsof9IzMZsbvllZpaIwPioB+Ca1+NWNdb0JRGbiatdgx+ROR2c6IBf0bpbqtpa/ DVGQ== X-Gm-Message-State: AA+aEWYej0j2u3BwZjuakPfu1pZ8gujsu3DmttCqGienesFMLktBKftl R9HAlnZvkjZObISRlP3nXvt7+BcHBv5oFbXE4CY= X-Google-Smtp-Source: AFSGD/U6m3Jfl3RFP04mdk7+wjm6IAxw9ZlSapCiyDF8Zqqq2verNxrLPVX1ZF+cd0zZZL7FtIp+cHsm0senvJu4Qb8= X-Received: by 2002:aca:31cb:: with SMTP id x194mr9701482oix.213.1543850653032; Mon, 03 Dec 2018 07:24:13 -0800 (PST) MIME-Version: 1.0 References: <1542956179-80951-1-git-send-email-wenzhuo.lu@intel.com> <1542956179-80951-4-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1542956179-80951-4-git-send-email-wenzhuo.lu@intel.com> From: Rami Rosen Date: Mon, 3 Dec 2018 17:24:01 +0200 Message-ID: To: wenzhuo.lu@intel.com Cc: dev@dpdk.org, qiming.yang@intel.com, xiaoyun.li@intel.com, jingjing.wu@intel.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 03/19] net/ice: support device and queue ops X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2018 15:24:14 -0000 Hi, Wenzhuo, > +static int > +ice_dev_start(struct rte_eth_dev *dev) > +{ > + struct rte_eth_dev_data *data = dev->data; > + struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); > + struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + uint16_t nb_rxq = 0; > + uint16_t nb_txq, i; > + int ret; > + > + if (rte_eal_process_type() == RTE_PROC_SECONDARY) > + return -E_RTE_SECONDARY; > + [Rami Rosen] Suppose start of a TX queue failes in the loop below. You go to **tx_err** label, where you stop all **RX** queues (which actually were not started at all, since they are started only later in this method; and then you return -EIO and the ice_dev_start() method is terminated, without actually stopping any TX queues which were already started; So maybe it is better to call ice_tx_queue_stop() in tx_err and ice_rx_queue_stop() in rx_err. Apart from it, there is a typo: "Tx queues' contex" should be =>Tx queues' context" > + /* program Tx queues' contex in hardware */ > + for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) { > + ret = ice_tx_queue_start(dev, nb_txq); > + if (ret) { > + PMD_DRV_LOG(ERR, "fail to start Tx queue %u", nb_txq); > + goto tx_err; > + } > + } > + > + /* program Rx queues' context in hardware*/ > + for (nb_rxq = 0; nb_rxq < data->nb_rx_queues; nb_rxq++) { > + ret = ice_rx_queue_start(dev, nb_rxq); > + if (ret) { > + PMD_DRV_LOG(ERR, "fail to start Rx queue %u", nb_rxq); > + goto rx_err; > + } > + } ,,, > + /* stop the started queues if failed to start all queues */ > +rx_err: > + for (i = 0; i < nb_txq; i++) > + ice_tx_queue_stop(dev, i); > +tx_err: > + for (i = 0; i < nb_rxq; i++) > + ice_rx_queue_stop(dev, i); > + > + return -EIO; > +} > + Regards, Rami Rosen