From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8F6B23DC for ; Fri, 3 Mar 2017 02:15:50 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2017 17:15:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,234,1484035200"; d="scan'208";a="63771169" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga004.jf.intel.com with ESMTP; 02 Mar 2017 17:15:48 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 2 Mar 2017 17:15:48 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 2 Mar 2017 17:15:47 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Fri, 3 Mar 2017 09:15:45 +0800 From: "Lu, Wenzhuo" To: Olivier Matz 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" Thread-Topic: [PATCH 4/6] net/e1000: implement descriptor status API (em) Thread-Index: AQHSkrAXA56qFbnafEKEESP24bxhvKGAwAsQgABcHYCAATWr0A== Date: Fri, 3 Mar 2017 01:15:45 +0000 Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC09093B56A679@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> <20170302154649.6488c40c@platinum> In-Reply-To: <20170302154649.6488c40c@platinum> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: Fri, 03 Mar 2017 01:15:51 -0000 Hi Olivier, > -----Original Message----- > From: Olivier Matz [mailto:olivier.matz@6wind.com] > Sent: Thursday, March 2, 2017 10:47 PM > To: Lu, Wenzhuo > Cc: dev@dpdk.org; thomas.monjalon@6wind.com; Ananyev, Konstantin; Zhang, > Helin; Wu, Jingjing; adrien.mazarguil@6wind.com; nelio.laranjeiro@6wind.c= om; > Yigit, Ferruh; Richardson, Bruce > Subject: Re: [PATCH 4/6] net/e1000: implement descriptor status API (em) >=20 > Hi Wenzhuo, >=20 > 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 =3D dev->data->tx_queues[tx_queue_id]; > > > + if (unlikely(offset >=3D txq->nb_tx_desc)) > > > + return -EINVAL; > > > + > > > + desc =3D txq->tx_tail + offset; > > > + /* go to next desc that has the RS bit */ > > > + desc =3D ((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? >=20 > 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. Yes, you're right. Sorry for the noise :) >=20 > Here is an example from: > http://www.dpdk.org/ml/archives/dev/2016-November/050679.html >=20 > |----------------------------------------------------------------| > | D R R R | > | ............xxxxxxxxxxxxxxxxxxxxxxxxx | > | <- descs not sent yet -> | > | ............xxxxxxxxxxxxxxxxxxxxxxxxx | > |----------------------------------------------------------------| > ^last_desc_cleaned=3D8 ^next_rs=3D47 > ^next_dd=3D15 ^tail=3D45 > ^hw_head=3D20 >=20 > <---- nb_used ---------> >=20 > The hardware is currently processing the descriptor 20 'R' means the desc= riptor > has the RS bit 'D' means the descriptor has the DD + RS bits 'x' are pack= ets in txq > (not sent) '.' are packet already sent but not freed by sw >=20 >=20 > Regards, > Olivier