From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 5/8] net/bnxt: add support for tx_descriptor_status Date: Tue, 29 Aug 2017 17:12:04 +0100 Message-ID: References: <20170824162956.62761-1-ajit.khaparde@broadcom.com> <20170824162956.62761-7-ajit.khaparde@broadcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Ajit Khaparde , dev@dpdk.org Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9F1573798 for ; Tue, 29 Aug 2017 18:12:12 +0200 (CEST) In-Reply-To: <20170824162956.62761-7-ajit.khaparde@broadcom.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" On 8/24/2017 5:29 PM, Ajit Khaparde wrote: > add support for tx_descriptor_status dev_op > Signed-off-by: Ajit Khaparde <...> > +static int > +bnxt_tx_descriptor_status_op(void *tx_queue, uint16_t offset) > +{ > + struct bnxt_tx_queue *txq = (struct bnxt_tx_queue *)tx_queue; > + struct bnxt_cp_ring_info *cpr; > + struct tx_pkt_cmpl *txcmp; > + uint32_t cons; > + > + if (!txq) > + return -EINVAL; > + > + cpr = txq->cp_ring; > + > + if (offset >= txq->nb_tx_desc) > + return -EINVAL; > + > + cons = RING_CMP(cpr->cp_ring_struct, offset); > + txcmp = (struct tx_pkt_cmpl *)&cpr->cp_desc_ring[cons]; > + > + if (CMP_VALID(txcmp, offset, cpr->cp_ring_struct)) > + return RTE_ETH_TX_DESC_DONE; > + > + return RTE_ETH_TX_DESC_FULL; Same comment with Rx one, a check may be required to distinguish between status FULL and UNAVAIL. > +} <...>