From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id C31612B88 for ; Thu, 2 Mar 2017 15:46:54 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id n11so26984487wma.0 for ; Thu, 02 Mar 2017 06:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VIse1/Pizk7UzRS6BYjORkTAgwHmt8j1lIcam3nI7bw=; b=XhBo2IQqaIRHDkWGe2/0YGzO+F3ex5dSiKjMhgBVS4hih9+ypzRFWCSBE1e3w7K2LO dIiPnERSZCCI7CiBNYnnau4q3VN3CidgtEJO85cdC6+cvuGWsVU6SE5xCFvNGjdazdQj WxG8qw/YJ169l2U/oDNBJFQp9vDgy0KSD5omhH4E1p7E2FWKQsW0Cyw76n1YpkDWH/vp 5415Eg+ouYo3yY87tpWsJIQ8FT0smA4AJUlWER+QNBRTcwo9t/GEXtfhl8alKTimBC8A BykvK0lYTsPDwPWBP+hG/Pj2M7A0v4fLkpeftpgSRlmZaP+b9w0ANFi3aOemOUK3UK6R QvxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VIse1/Pizk7UzRS6BYjORkTAgwHmt8j1lIcam3nI7bw=; b=himBmpRaUXIIUBu1n2jyo/0Wm+33fPh3yNR2Lmxsf+DbSKwZgDHAuo1/B9UN9bk0Yd u02yl2ulzedELBXRANbHnFdwI8gQ0dG3opX/pbJxZKhosqfvC6fbBZ95P3owRtHBekF1 8dFNh4sRGg2aGKiv0NOZaCXF7arhCtGAqiMlH57bzluRxEin4L3wZ6OIpPoYRpdiLjXu vYQ7c/82XSc+RerMBo1WICVmWYNc4XCFk8qsm+Pbz9RwJstl8j3NomrW+vSU8nlIZDbJ SJgxAH8JOyZ8LzHgrSrxjSzuNv/KdGQ5XgexIKJOob7tppuWiEbCBg9h7rS/sNuxE3ct vOBw== X-Gm-Message-State: AMke39nKBfaETaqvXO6D3wppvRXjOecDT7rvCXYgAclJISMN1FEq8kvPOfcT0KsGgkylkLrs X-Received: by 10.28.71.21 with SMTP id u21mr8286242wma.1.1488466013405; Thu, 02 Mar 2017 06:46:53 -0800 (PST) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id e14sm27406290wmd.14.2017.03.02.06.46.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2017 06:46:53 -0800 (PST) Date: Thu, 2 Mar 2017 15:46:49 +0100 From: Olivier Matz To: "Lu, Wenzhuo" Cc: "dev@dpdk.org" , "thomas.monjalon@6wind.com" , "Ananyev, Konstantin" , "Zhang, Helin" , "Wu, Jingjing" , "adrien.mazarguil@6wind.com" , "nelio.laranjeiro@6wind.com" , "Yigit, Ferruh" , "Richardson, Bruce" Message-ID: <20170302154649.6488c40c@platinum> In-Reply-To: <6A0DE07E22DDAD4C9103DF62FEBC09093B569F66@shsmsx102.ccr.corp.intel.com> References: <1479981261-19512-1-git-send-email-olivier.matz@6wind.com> <1488388752-1819-1-git-send-email-olivier.matz@6wind.com> <1488388752-1819-5-git-send-email-olivier.matz@6wind.com> <6A0DE07E22DDAD4C9103DF62FEBC09093B569F66@shsmsx102.ccr.corp.intel.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 4/6] net/e1000: implement descriptor status API (em) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 14:46:54 -0000 Hi Wenzhuo, On Thu, 2 Mar 2017 01:22:25 +0000, "Lu, Wenzhuo" wrote: > Hi Oliver, > > > -----Original Message----- > > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > Sent: Thursday, March 2, 2017 1:19 AM > > To: dev@dpdk.org; thomas.monjalon@6wind.com; Ananyev, Konstantin; Lu, > > Wenzhuo; Zhang, Helin; Wu, Jingjing; adrien.mazarguil@6wind.com; > > nelio.laranjeiro@6wind.com > > Cc: Yigit, Ferruh; Richardson, Bruce > > Subject: [PATCH 4/6] net/e1000: implement descriptor status API (em) > > > > Signed-off-by: Olivier Matz > > +int > > +eth_em_tx_descriptor_status(struct rte_eth_dev *dev, uint16_t tx_queue_id, > > + uint16_t offset) > > +{ > > + volatile uint8_t *status; > > + struct em_tx_queue *txq; > > + uint32_t desc; > > + > > + txq = dev->data->tx_queues[tx_queue_id]; > > + if (unlikely(offset >= txq->nb_tx_desc)) > > + return -EINVAL; > > + > > + desc = txq->tx_tail + offset; > > + /* go to next desc that has the RS bit */ > > + desc = ((desc + txq->tx_rs_thresh - 1) / txq->tx_rs_thresh) * > > + txq->tx_rs_thresh; > The descriptor may be changed here. So the return value may not be for the offset one. Why? Yes, desc index can change. From what I understand, the "descriptor done" (DD) bit is only set on descriptors which are flagged with the "report status" (RS) bit. Here is an example from: http://www.dpdk.org/ml/archives/dev/2016-November/050679.html |----------------------------------------------------------------| | D R R R | | ............xxxxxxxxxxxxxxxxxxxxxxxxx | | <- descs not sent yet -> | | ............xxxxxxxxxxxxxxxxxxxxxxxxx | |----------------------------------------------------------------| ^last_desc_cleaned=8 ^next_rs=47 ^next_dd=15 ^tail=45 ^hw_head=20 <---- nb_used ---------> The hardware is currently processing the descriptor 20 'R' means the descriptor has the RS bit 'D' means the descriptor has the DD + RS bits 'x' are packets in txq (not sent) '.' are packet already sent but not freed by sw Regards, Olivier