From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ananyev, Konstantin" Subject: Re: [PATCH] ethdev: fix queue start Date: Sat, 24 Mar 2018 12:06:55 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258A0AB3C78@irsmsx105.ger.corp.intel.com> References: <20180322125901.37141-1-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" , "stable@dpdk.org" To: "Zhang, Qi Z" , "thomas@monjalon.net" Return-path: In-Reply-To: <20180322125901.37141-1-qi.z.zhang@intel.com> 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" >=20 > Device must be started before start any queue. >=20 > Fixes: 0748be2cf9a2 ("ethdev: queue start and stop") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qi Zhang > --- > lib/librte_ether/rte_ethdev.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.= c > index 0590f0c10..7aa404fa5 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -732,6 +732,12 @@ rte_eth_dev_rx_queue_start(uint16_t port_id, uint16_= t rx_queue_id) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); >=20 > dev =3D &rte_eth_devices[port_id]; > + if (!dev->data->dev_started) { > + RTE_PMD_DEBUG_TRACE( > + "port %d must be started before start any queue\n", port_id); > + return -EINVAL; > + } > + > if (rx_queue_id >=3D dev->data->nb_rx_queues) { > RTE_PMD_DEBUG_TRACE("Invalid RX queue_id=3D%d\n", rx_queue_id); > return -EINVAL; > @@ -785,6 +791,12 @@ rte_eth_dev_tx_queue_start(uint16_t port_id, uint16_= t tx_queue_id) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); >=20 > dev =3D &rte_eth_devices[port_id]; > + if (!dev->data->dev_started) { > + RTE_PMD_DEBUG_TRACE( > + "port %d must be started before start any queue\n", port_id); > + return -EINVAL; > + } > + > if (tx_queue_id >=3D dev->data->nb_tx_queues) { > RTE_PMD_DEBUG_TRACE("Invalid TX queue_id=3D%d\n", tx_queue_id); > return -EINVAL; > -- Acked-by: Konstantin Ananyev > 2.13.6