From: "Wiles, Keith" Subject: Re: [PATCH] net/tap: set queue started and stopped Date: Mon, 9 Jul 2018 22:06:54 +0000 Message-ID: <8A4C5FFB-F16D-482E-8272-1D9DABA44255@intel.com> References: <20180709202049.18137-1-gage.eads@intel.com> <9184057F7FC11744A2107296B6B8EB1E446E6F14@FMSMSX108.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Eads, Gage" Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0A9955F2D for ; Tue, 10 Jul 2018 00:07:06 +0200 (CEST) In-Reply-To: Content-Language: en-US Content-ID: <71E8D174BF4DD241915325CCB6950D55@intel.com> 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 Jul 9, 2018, at 5:00 PM, Wiles, Keith wrote: >=20 >=20 >=20 >> On Jul 9, 2018, at 4:51 PM, Eads, Gage wrote: >>=20 >> >>=20 >>>>=20 >>>> +static int >>>> +tap_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id) >>>> +{ >>>> + dev->data->rx_queue_state[rx_queue_id] =3D >>> RTE_ETH_QUEUE_STATE_STARTED; >>>=20 >>> We need to verify the rx_queue_id is valid before setting the state. >>>=20 >>> if (rx_queue_id < dev->data>nb_rx_queues) >>> dev->data->rx_queue_state[rx_queue_id] =3D >>> RTE_ETH_QUEUE_STATE_STARTED; >>> else >>> return -1; >>>=20 >>> This needs to be done for each of these routines. >>>=20 >>=20 >> The ethdev layer function (rte_eth_dev_{rx, tx}_queue_{start, stop}) alr= eady does the queue ID bounds check -- do you prefer to duplicate it here? >=20 > I looked in ixgb driver and it was checking I then assumed needed it. I s= hould check in the ethdev layer. We do not need to duplicate more checks. >=20 > Thanks for spotting that one. Looks like a number of the Intel drivers check the queue_id in the PMD :-( >=20 >>=20 >> Thanks, >> Gage >=20 > Regards, > Keith Regards, Keith