From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id EC5058D8F for ; Tue, 22 Dec 2015 07:51:19 +0100 (CET) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 21 Dec 2015 22:51:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,463,1444719600"; d="scan'208";a="17400236" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 21 Dec 2015 22:51:18 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Dec 2015 22:51:17 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 21 Dec 2015 22:51:17 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.190]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.28]) with mapi id 14.03.0248.002; Tue, 22 Dec 2015 14:50:54 +0800 From: "Qiu, Michael" To: "He, Shaopeng" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 1/6] fm10k: implement rx_descriptor_done function Thread-Index: AQHRO9lB8lfdQFBH4UqlZD3EpaWEEQ== Date: Tue, 22 Dec 2015 06:50:54 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028622EFD0D3@SHSMSX101.ccr.corp.intel.com> References: <1446700329-10048-1-git-send-email-shaopeng.he@intel.com> <1450693192-14500-1-git-send-email-shaopeng.he@intel.com> <1450693192-14500-2-git-send-email-shaopeng.he@intel.com> 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 v4 1/6] fm10k: implement rx_descriptor_done function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2015 06:51:20 -0000 On 12/21/2015 6:20 PM, Shaopeng He wrote:=0A= > rx_descriptor_done is used by interrupt mode example application=0A= > (l3fwd-power) to check rxd DD bit to decide the RX trend,=0A= > then l3fwd-power will adjust the cpu frequency according to=0A= > the result.=0A= >=0A= > Signed-off-by: Shaopeng He =0A= > Acked-by: Jing Chen =0A= > ---=0A= > drivers/net/fm10k/fm10k.h | 3 +++=0A= > drivers/net/fm10k/fm10k_ethdev.c | 1 +=0A= > drivers/net/fm10k/fm10k_rxtx.c | 25 +++++++++++++++++++++++++=0A= > 3 files changed, 29 insertions(+)=0A= >=0A= > diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h=0A= > index cd38af2..e2f677a 100644=0A= > --- a/drivers/net/fm10k/fm10k.h=0A= > +++ b/drivers/net/fm10k/fm10k.h=0A= > @@ -345,6 +345,9 @@ uint16_t fm10k_recv_pkts(void *rx_queue, struct rte_m= buf **rx_pkts,=0A= > uint16_t fm10k_recv_scattered_pkts(void *rx_queue,=0A= > struct rte_mbuf **rx_pkts, uint16_t nb_pkts);=0A= > =0A= > +int=0A= > +fm10k_dev_rx_descriptor_done(void *rx_queue, uint16_t offset);=0A= > +=0A= > uint16_t fm10k_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,=0A= > uint16_t nb_pkts);=0A= > =0A= > diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_e= thdev.c=0A= > index e4aed94..d39c33b 100644=0A= > --- a/drivers/net/fm10k/fm10k_ethdev.c=0A= > +++ b/drivers/net/fm10k/fm10k_ethdev.c=0A= > @@ -2435,6 +2435,7 @@ static const struct eth_dev_ops fm10k_eth_dev_ops = =3D {=0A= > .rx_queue_release =3D fm10k_rx_queue_release,=0A= > .tx_queue_setup =3D fm10k_tx_queue_setup,=0A= > .tx_queue_release =3D fm10k_tx_queue_release,=0A= > + .rx_descriptor_done =3D fm10k_dev_rx_descriptor_done,=0A= > .reta_update =3D fm10k_reta_update,=0A= > .reta_query =3D fm10k_reta_query,=0A= > .rss_hash_update =3D fm10k_rss_hash_update,=0A= > diff --git a/drivers/net/fm10k/fm10k_rxtx.c b/drivers/net/fm10k/fm10k_rxt= x.c=0A= > index e958865..36d3002 100644=0A= > --- a/drivers/net/fm10k/fm10k_rxtx.c=0A= > +++ b/drivers/net/fm10k/fm10k_rxtx.c=0A= > @@ -369,6 +369,31 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct rte= _mbuf **rx_pkts,=0A= > return nb_rcv;=0A= > }=0A= > =0A= > +int=0A= > +fm10k_dev_rx_descriptor_done(void *rx_queue, uint16_t offset)=0A= > +{=0A= > + volatile union fm10k_rx_desc *rxdp;=0A= > + struct fm10k_rx_queue *rxq =3D rx_queue;=0A= > + uint16_t desc;=0A= > + int ret;=0A= > +=0A= > + if (unlikely(offset >=3D rxq->nb_desc)) {=0A= > + PMD_DRV_LOG(ERR, "Invalid RX queue id %u", offset);=0A= =0A= Sorry, here makes my confuse: offset for RX queue id?=0A= =0A= > + return 0;=0A= > + }=0A= > +=0A= > + desc =3D rxq->next_dd + offset;=0A= > + if (desc >=3D rxq->nb_desc)=0A= > + desc -=3D rxq->nb_desc;=0A= > +=0A= > + rxdp =3D &rxq->hw_ring[desc];=0A= > +=0A= > + ret =3D !!(rxdp->w.status &=0A= > + rte_cpu_to_le_16(FM10K_RXD_STATUS_DD));=0A= > +=0A= > + return ret;=0A= > +}=0A= > +=0A= > static inline void tx_free_descriptors(struct fm10k_tx_queue *q)=0A= > {=0A= > uint16_t next_rs, count =3D 0;=0A= =0A=