From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 371DA593A for ; Tue, 22 Dec 2015 12:55:33 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 22 Dec 2015 03:55:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,464,1444719600"; d="scan'208";a="846339758" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 22 Dec 2015 03:55:33 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Dec 2015 03:55:31 -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; Tue, 22 Dec 2015 03:55:31 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.158]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.190]) with mapi id 14.03.0248.002; Tue, 22 Dec 2015 19:55:29 +0800 From: "He, Shaopeng" To: "Qiu, Michael" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 1/6] fm10k: implement rx_descriptor_done function Thread-Index: AQHRPIUaejNyalzdskqRIagbVXyfnZ7W5aKg Date: Tue, 22 Dec 2015 11:55:29 +0000 Message-ID: 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> <533710CFB86FA344BFBF2D6802E6028622EFD0D3@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <533710CFB86FA344BFBF2D6802E6028622EFD0D3@SHSMSX101.ccr.corp.intel.com> Accept-Language: zh-CN, 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 11:55:33 -0000 > -----Original Message----- > From: Qiu, Michael > Sent: Tuesday, December 22, 2015 2:51 PM > To: He, Shaopeng; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 1/6] fm10k: implement > rx_descriptor_done function >=20 > On 12/21/2015 6:20 PM, Shaopeng He wrote: > > rx_descriptor_done is used by interrupt mode example application > > (l3fwd-power) to check rxd DD bit to decide the RX trend, then > > l3fwd-power will adjust the cpu frequency according to the result. > > > > Signed-off-by: Shaopeng He > > Acked-by: Jing Chen > > --- > > drivers/net/fm10k/fm10k.h | 3 +++ > > drivers/net/fm10k/fm10k_ethdev.c | 1 + > > drivers/net/fm10k/fm10k_rxtx.c | 25 +++++++++++++++++++++++++ > > 3 files changed, 29 insertions(+) > > > > diff --git a/drivers/net/fm10k/fm10k.h b/drivers/net/fm10k/fm10k.h > > index cd38af2..e2f677a 100644 > > --- a/drivers/net/fm10k/fm10k.h > > +++ b/drivers/net/fm10k/fm10k.h > > @@ -345,6 +345,9 @@ uint16_t fm10k_recv_pkts(void *rx_queue, struct > > rte_mbuf **rx_pkts, uint16_t fm10k_recv_scattered_pkts(void > *rx_queue, > > struct rte_mbuf **rx_pkts, uint16_t nb_pkts); > > > > +int > > +fm10k_dev_rx_descriptor_done(void *rx_queue, uint16_t offset); > > + > > uint16_t fm10k_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > > uint16_t nb_pkts); > > > > diff --git a/drivers/net/fm10k/fm10k_ethdev.c > > b/drivers/net/fm10k/fm10k_ethdev.c > > index e4aed94..d39c33b 100644 > > --- a/drivers/net/fm10k/fm10k_ethdev.c > > +++ b/drivers/net/fm10k/fm10k_ethdev.c > > @@ -2435,6 +2435,7 @@ static const struct eth_dev_ops > fm10k_eth_dev_ops =3D { > > .rx_queue_release =3D fm10k_rx_queue_release, > > .tx_queue_setup =3D fm10k_tx_queue_setup, > > .tx_queue_release =3D fm10k_tx_queue_release, > > + .rx_descriptor_done =3D fm10k_dev_rx_descriptor_done, > > .reta_update =3D fm10k_reta_update, > > .reta_query =3D fm10k_reta_query, > > .rss_hash_update =3D fm10k_rss_hash_update, > > diff --git a/drivers/net/fm10k/fm10k_rxtx.c > > b/drivers/net/fm10k/fm10k_rxtx.c index e958865..36d3002 100644 > > --- a/drivers/net/fm10k/fm10k_rxtx.c > > +++ b/drivers/net/fm10k/fm10k_rxtx.c > > @@ -369,6 +369,31 @@ fm10k_recv_scattered_pkts(void *rx_queue, > struct rte_mbuf **rx_pkts, > > return nb_rcv; > > } > > > > +int > > +fm10k_dev_rx_descriptor_done(void *rx_queue, uint16_t offset) { > > + volatile union fm10k_rx_desc *rxdp; > > + struct fm10k_rx_queue *rxq =3D rx_queue; > > + uint16_t desc; > > + int ret; > > + > > + if (unlikely(offset >=3D rxq->nb_desc)) { > > + PMD_DRV_LOG(ERR, "Invalid RX queue id %u", offset); >=20 > Sorry, here makes my confuse: offset for RX queue id? Good catch, will fix it in next version >=20 > > + return 0; > > + } > > + > > + desc =3D rxq->next_dd + offset; > > + if (desc >=3D rxq->nb_desc) > > + desc -=3D rxq->nb_desc; > > + > > + rxdp =3D &rxq->hw_ring[desc]; > > + > > + ret =3D !!(rxdp->w.status & > > + rte_cpu_to_le_16(FM10K_RXD_STATUS_DD)); > > + > > + return ret; > > +} > > + > > static inline void tx_free_descriptors(struct fm10k_tx_queue *q) { > > uint16_t next_rs, count =3D 0;