From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B89415A6F for ; Mon, 19 Jan 2015 16:51:04 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 19 Jan 2015 07:45:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,427,1418112000"; d="scan'208";a="664102585" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga002.fm.intel.com with ESMTP; 19 Jan 2015 07:51:02 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX107.gar.corp.intel.com (10.221.44.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 19 Jan 2015 23:51:01 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.64]) by shsmsx102.ccr.corp.intel.com ([169.254.2.238]) with mapi id 14.03.0195.001; Mon, 19 Jan 2015 23:50:59 +0800 From: "Qiu, Michael" To: "dev@dpdk.org" Thread-Topic: [PATCH] librte_pmd_ixgbe: Add queue start failure check Thread-Index: AQHQMNHv4jRlB7TeZky4c6T0HyTfpQ== Date: Mon, 19 Jan 2015 15:50:58 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E60286CB76FD@SHSMSX101.ccr.corp.intel.com> References: <1421333111-22136-1-git-send-email-michael.qiu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] librte_pmd_ixgbe: Add queue start failure check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2015 15:51:05 -0000 Any comments?=0A= =0A= On 2015/1/15 22:45, Qiu, Michael wrote:=0A= > For ixgbe, when queue start failure, for example, mbuf allocate=0A= > failure, the device will still start success, which could be=0A= > an issue.=0A= >=0A= > Add return status check of queue start to avoid this issue.=0A= >=0A= > Signed-off-by: Michael Qiu =0A= > ---=0A= > lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 6 +++++-=0A= > lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 2 +-=0A= > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 22 +++++++++++++++++-----=0A= > 3 files changed, 23 insertions(+), 7 deletions(-)=0A= >=0A= > diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/i= xgbe_ethdev.c=0A= > index 3fc3738..59e3321 100644=0A= > --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c=0A= > +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c=0A= > @@ -1491,7 +1491,11 @@ ixgbe_dev_start(struct rte_eth_dev *dev)=0A= > goto error;=0A= > }=0A= > =0A= > - ixgbe_dev_rxtx_start(dev);=0A= > + err =3D ixgbe_dev_rxtx_start(dev);=0A= > + if (err < 0) {=0A= > + PMD_INIT_LOG(ERR, "Unable to start rxtx queues\n");=0A= > + goto error;=0A= > + }=0A= > =0A= > if (ixgbe_is_sfp(hw) && hw->phy.multispeed_fiber) {=0A= > err =3D hw->mac.ops.setup_sfp(hw);=0A= > diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h b/lib/librte_pmd_ixgbe/i= xgbe_ethdev.h=0A= > index ca99170..7461450 100644=0A= > --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h=0A= > +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h=0A= > @@ -251,7 +251,7 @@ int ixgbe_dev_rx_init(struct rte_eth_dev *dev);=0A= > =0A= > void ixgbe_dev_tx_init(struct rte_eth_dev *dev);=0A= > =0A= > -void ixgbe_dev_rxtx_start(struct rte_eth_dev *dev);=0A= > +int ixgbe_dev_rxtx_start(struct rte_eth_dev *dev);=0A= > =0A= > int ixgbe_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_= id);=0A= > =0A= > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixg= be_rxtx.c=0A= > index e10d6a2..41a930e 100644=0A= > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c=0A= > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c=0A= > @@ -3744,7 +3744,7 @@ ixgbe_setup_loopback_link_82599(struct ixgbe_hw *hw= )=0A= > /*=0A= > * Start Transmit and Receive Units.=0A= > */=0A= > -void=0A= > +int=0A= > ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)=0A= > {=0A= > struct ixgbe_hw *hw;=0A= > @@ -3754,6 +3754,7 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)=0A= > uint32_t dmatxctl;=0A= > uint32_t rxctrl;=0A= > uint16_t i;=0A= > + int ret =3D 0;=0A= > =0A= > PMD_INIT_FUNC_TRACE();=0A= > hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);=0A= > @@ -3776,14 +3777,24 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)=0A= > =0A= > for (i =3D 0; i < dev->data->nb_tx_queues; i++) {=0A= > txq =3D dev->data->tx_queues[i];=0A= > - if (!txq->tx_deferred_start)=0A= > - ixgbe_dev_tx_queue_start(dev, i);=0A= > + if (!txq->tx_deferred_start) {=0A= > + ret =3D ixgbe_dev_tx_queue_start(dev, i);=0A= > + if (ret < 0) {=0A= > + PMD_INIT_LOG(ERR, "Start tx queue failed\n");=0A= > + return ret;=0A= > + }=0A= > + }=0A= > }=0A= > =0A= > for (i =3D 0; i < dev->data->nb_rx_queues; i++) {=0A= > rxq =3D dev->data->rx_queues[i];=0A= > - if (!rxq->rx_deferred_start)=0A= > - ixgbe_dev_rx_queue_start(dev, i);=0A= > + if (!rxq->rx_deferred_start) {=0A= > + ret =3D ixgbe_dev_rx_queue_start(dev, i);=0A= > + if (ret < 0) {=0A= > + PMD_INIT_LOG(ERR, "Start rx queue failed\n");=0A= > + return ret;=0A= > + }=0A= > + }=0A= > }=0A= > =0A= > /* Enable Receive engine */=0A= > @@ -3798,6 +3809,7 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev)=0A= > dev->data->dev_conf.lpbk_mode =3D=3D IXGBE_LPBK_82599_TX_RX)=0A= > ixgbe_setup_loopback_link_82599(hw);=0A= > =0A= > + return 0;=0A= > }=0A= > =0A= > /*=0A= =0A=