From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Matz Subject: Re: [PATCH 1/6] ethdev: add descriptor status API Date: Thu, 2 Mar 2017 15:54:32 +0100 Message-ID: <20170302155432.7e81e969@platinum> References: <1479981261-19512-1-git-send-email-olivier.matz@6wind.com> <1488388752-1819-1-git-send-email-olivier.matz@6wind.com> <1488388752-1819-2-git-send-email-olivier.matz@6wind.com> <8966736f-3bcb-5096-5c2b-643c65751d5f@solarflare.com> <20170302145752.38b2f820@platinum> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: , , , , , , , , , To: Andrew Rybchenko Return-path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id 0FBAB2C60 for ; Thu, 2 Mar 2017 15:54:35 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id v186so137344249wmd.0 for ; Thu, 02 Mar 2017 06:54:35 -0800 (PST) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > >>> + * Check the status of a Rx descriptor in the queue > >> I think it would be useful to highlight caller context. > >> Should it be the same CPU which receives packets from the queue? > > Yes, you are right it would be useful. I suggest the following sentences: > > > > This function should be called on a dataplane core like the > > Rx function. They should not be called concurrently on the same > > queue. > > The first sentence looks fine. "They" (functions?, dataplane cores?) is > unclear for me in the second. May be the first one is simply sufficient. Ok, I'll keep the first one at least, and see if I can reword the second one to make it clear. > >>> + * > >>> + * @param port_id > >>> + * The port identifier of the Ethernet device. > >>> + * @param queue_id > >>> + * The Rx queue identifier on this port. > >>> + * @param offset > >>> + * The offset of the descriptor starting from tail (0 is the next > >>> + * packet to be received by the driver). > >>> + * @return > >>> + * - (RTE_ETH_DESC_AVAIL): Descriptor is available for the hardware to > >>> + * receive a packet. > >>> + * - (RTE_ETH_DESC_DONE): Descriptor is done, it is filled by hw, but > >>> + * not yet processed by the driver (i.e. in the receive queue). > >>> + * - (RTE_ETH_DESC_USED): Descriptor is unavailable (hold by driver, > >>> + * not yet returned to hw). > >> It looks like it is the most suitable for descriptors which are reserved > >> and never used. > > Can you give some more details about what is a reserved but never > > used descriptor? (same question for Tx) > > Our HW has a requirement to keep few descriptors always unused (i.e. > some gap between tail and head). It is just a few descriptors, but > invalid descriptor status may misguide application. E.g. if Rx queue > size is 512 and offset 510, it will always be unused (since it is > reserved). It is not an indication that core is too slow and can't keep > the pace. Understood. I can change _USED into _UNAVAIL (add it for Tx), with the following description: - (RTE_ETH_DESC_UNAVAIL): Descriptor is unavailable: either hold by driver and not yet returned to hw, or reserved by the hardware.