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 E445A8E9D for ; Tue, 20 Oct 2015 09:31:29 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 20 Oct 2015 00:31:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,706,1437462000"; d="scan'208";a="831003693" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2015 00:31:21 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Oct 2015 00:31:21 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 20 Oct 2015 00:31:21 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.204]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.106]) with mapi id 14.03.0248.002; Tue, 20 Oct 2015 15:31:19 +0800 From: "Tan, Jianfeng" To: Amine Kherbouche , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get Thread-Index: AQHRCrqT7lu45pzZCUKOOy74M7/LDJ5z/EvA Date: Tue, 20 Oct 2015 07:31:19 +0000 Message-ID: References: <1443729293-20753-2-git-send-email-konstantin.ananyev@intel.com> <1445292384-19815-1-git-send-email-amine.kherbouche@6wind.com> <1445292384-19815-4-git-send-email-amine.kherbouche@6wind.com> In-Reply-To: <1445292384-19815-4-git-send-email-amine.kherbouche@6wind.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] [dpdk-dev, PATCHv6 3/6] virtio: add support for eth_(rxq|txq)_info_get 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, 20 Oct 2015 07:31:30 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Amine Kherbouche > Sent: Tuesday, October 20, 2015 6:06 AM > To: dev@dpdk.org > Cc: amine.kherbouche@6wind.com > Subject: [dpdk-dev] [dpdk-dev, PATCHv6 3/6] virtio: add support for > eth_(rxq|txq)_info_get >=20 > In the case of virtio, there are many fields in rte_eth_(tx|rxq)_info str= uct > that aren't set in this function because those fields are missed in virtq= ueue > struct. >=20 > Signed-off-by: Amine Kherbouche > --- > drivers/net/virtio/virtio_ethdev.c | 28 ++++++++++++++++++++++++++++ > drivers/net/virtio/virtio_ethdev.h | 4 ++++ > 2 files changed, 32 insertions(+) >=20 > diff --git a/drivers/net/virtio/virtio_ethdev.c > b/drivers/net/virtio/virtio_ethdev.c > index 465d3cd..6118913 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -580,6 +580,8 @@ static const struct eth_dev_ops virtio_eth_dev_ops = =3D > { > .mac_addr_add =3D virtio_mac_addr_add, > .mac_addr_remove =3D virtio_mac_addr_remove, > .mac_addr_set =3D virtio_mac_addr_set, > + .rxq_info_get =3D virtio_rxq_info_get, > + .txq_info_get =3D virtio_txq_info_get, > }; >=20 > static inline int > @@ -1574,4 +1576,30 @@ static struct rte_driver rte_virtio_driver =3D { > .init =3D rte_virtio_pmd_init, > }; >=20 > +void > +virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, > + struct rte_eth_rxq_info *qinfo) > +{ > + struct virtqueue *rxq; > + > + rxq =3D dev->data->rx_queues[queue_id]; > + > + qinfo->nb_desc =3D rxq->vq_nentries; > + qinfo->used_desc =3D rxq->vq_nentries - rxq->vq_free_cnt; rxq->vq_free_cnt needs to be masked by rx->vq_nentries here? Thanks, Jianfeng > + qinfo->free_desc=3D rxq->vq_free_cnt; > +} > + > +void > +virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, > + struct rte_eth_txq_info *qinfo) > +{ > + struct virtqueue *txq; > + > + txq =3D dev->data->tx_queues[queue_id]; > + > + qinfo->nb_desc =3D txq->vq_nentries; > + qinfo->used_desc =3D txq->vq_nentries - txq->vq_free_cnt; > + qinfo->free_desc=3D txq->vq_free_cnt; > +} > + > PMD_REGISTER_DRIVER(rte_virtio_driver); > diff --git a/drivers/net/virtio/virtio_ethdev.h > b/drivers/net/virtio/virtio_ethdev.h > index 9026d42..1bbe421 100644 > --- a/drivers/net/virtio/virtio_ethdev.h > +++ b/drivers/net/virtio/virtio_ethdev.h > @@ -107,7 +107,11 @@ uint16_t virtio_recv_mergeable_pkts(void > *rx_queue, struct rte_mbuf **rx_pkts, >=20 > uint16_t virtio_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > uint16_t nb_pkts); > +void virtio_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, > + struct rte_eth_rxq_info *qinfo); >=20 > +void virtio_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id, > + struct rte_eth_txq_info *qinfo); >=20 > /* > * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us > -- > 1.7.10.4