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 34DB968CD for ; Wed, 23 Jul 2014 08:45:00 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 22 Jul 2014 23:46:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,715,1400050800"; d="scan'208";a="574046999" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by fmsmga002.fm.intel.com with ESMTP; 22 Jul 2014 23:46:15 -0700 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 22 Jul 2014 23:46:15 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 22 Jul 2014 23:46:15 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.120]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.188]) with mapi id 14.03.0123.003; Wed, 23 Jul 2014 14:46:12 +0800 From: "Chen, Jing D" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] ethdev: Rename RX/TX enable queue field for queue start and stop Thread-Index: AQHPpjGC8waKsRF5k06Jxqy1IYflBputNpUg Date: Wed, 23 Jul 2014 06:46:11 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D015AE27C@shsmsx102.ccr.corp.intel.com> References: <1406090907-24347-1-git-send-email-changchun.ouyang@intel.com> In-Reply-To: <1406090907-24347-1-git-send-email-changchun.ouyang@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 v2] ethdev: Rename RX/TX enable queue field for queue start and stop 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: Wed, 23 Jul 2014 06:45:01 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ouyang Changchun > Sent: Wednesday, July 23, 2014 12:48 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2] ethdev: Rename RX/TX enable queue field > for queue start and stop >=20 > Update comments for the field start_rx_per_q for better readability. > Rename the field name to rx_enable_queue for better readability too. > Accordingly Update its reference in sample vhost. >=20 > Signed-off-by: Changchun Ouyang Acked-by Chen Jing (Mark) > --- > examples/vhost/main.c | 4 ++-- > lib/librte_ether/rte_ethdev.h | 16 ++++++++++++++-- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 8 ++++---- > lib/librte_pmd_ixgbe/ixgbe_rxtx.h | 4 ++-- > 4 files changed, 22 insertions(+), 10 deletions(-) >=20 > diff --git a/examples/vhost/main.c b/examples/vhost/main.c > index 193aa25..2eea431 100644 > --- a/examples/vhost/main.c > +++ b/examples/vhost/main.c > @@ -2984,9 +2984,9 @@ MAIN(int argc, char *argv[]) > char pool_name[RTE_MEMPOOL_NAMESIZE]; > char ring_name[RTE_MEMPOOL_NAMESIZE]; >=20 > - rx_conf_default.start_rx_per_q =3D (uint8_t)zero_copy; > + rx_conf_default.rx_enable_queue =3D (uint8_t)zero_copy; > rx_conf_default.rx_drop_en =3D 0; > - tx_conf_default.start_tx_per_q =3D (uint8_t)zero_copy; > + tx_conf_default.tx_enable_queue =3D (uint8_t)zero_copy; > nb_mbuf =3D num_rx_descriptor > + num_switching_cores * MBUF_CACHE_SIZE_ZCP > + num_switching_cores * MAX_PKT_BURST; > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.= h > index 50df654..ba439f6 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -604,7 +604,16 @@ struct rte_eth_rxconf { > struct rte_eth_thresh rx_thresh; /**< RX ring threshold registers. */ > uint16_t rx_free_thresh; /**< Drives the freeing of RX descriptors. > */ > uint8_t rx_drop_en; /**< Drop packets if no descriptors are available. > */ > - uint8_t start_rx_per_q; /**< start rx per queue. */ > + /**< If rx_enable_queue is true, rte_eth_dev_rx_queue_start > should be > + invocated to start RX for one queue after rte_eth_dev_start > is > + invocated, and rte_eth_dev_rx_queue_start instead of > + rte_eth_dev_start is responsible for allocating mbuf from > + mempool and setup the DMA physical address. It is useful in > + such scenario: buffer address is not available at the point of > + rte_eth_dev_start's invocating but available later, e.g. in > + VHOST zero copy case, the buffer address used to setup > DMA > + address is available only after one VM(guest) startup. */ > + uint8_t rx_enable_queue; > }; >=20 > #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001 /**< nb_segs=3D1 for all > mbufs */ > @@ -625,7 +634,10 @@ struct rte_eth_txconf { > uint16_t tx_rs_thresh; /**< Drives the setting of RS bit on TXDs. */ > uint16_t tx_free_thresh; /**< Drives the freeing of TX buffers. */ > uint32_t txq_flags; /**< Set flags for the Tx queue */ > - uint8_t start_tx_per_q; /**< start tx per queue. */ > + /**< If tx_enable_queue is true, rte_eth_dev_tx_queue_start must > be > + invocated to start TX for one queue after rte_eth_dev_start > is > + invocated. Refer to start_rx_per_q for the use case. */ > + uint8_t tx_enable_queue; > }; >=20 > /** > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > index dfc2076..2872fad 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c > @@ -1846,7 +1846,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev > *dev, > txq->port_id =3D dev->data->port_id; > txq->txq_flags =3D tx_conf->txq_flags; > txq->ops =3D &def_txq_ops; > - txq->start_tx_per_q =3D tx_conf->start_tx_per_q; > + txq->tx_enable_queue =3D tx_conf->tx_enable_queue; >=20 > /* > * Modification to set VFTDT for virtual function if vf is detected > @@ -2091,7 +2091,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev > *dev, > rxq->crc_len =3D (uint8_t) ((dev->data- > >dev_conf.rxmode.hw_strip_crc) ? > 0 : ETHER_CRC_LEN); > rxq->drop_en =3D rx_conf->rx_drop_en; > - rxq->start_rx_per_q =3D rx_conf->start_rx_per_q; > + rxq->rx_enable_queue =3D rx_conf->rx_enable_queue; >=20 > /* > * Allocate RX ring hardware descriptors. A memzone large enough to > @@ -3652,13 +3652,13 @@ ixgbe_dev_rxtx_start(struct rte_eth_dev *dev) >=20 > for (i =3D 0; i < dev->data->nb_tx_queues; i++) { > txq =3D dev->data->tx_queues[i]; > - if (!txq->start_tx_per_q) > + if (!txq->tx_enable_queue) > ixgbe_dev_tx_queue_start(dev, i); > } >=20 > for (i =3D 0; i < dev->data->nb_rx_queues; i++) { > rxq =3D dev->data->rx_queues[i]; > - if (!rxq->start_rx_per_q) > + if (!rxq->rx_enable_queue) > ixgbe_dev_rx_queue_start(dev, i); > } >=20 > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h > b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h > index 64c0695..d6d856e 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.h > +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.h > @@ -135,7 +135,7 @@ struct igb_rx_queue { > uint8_t port_id; /**< Device port identifier. */ > uint8_t crc_len; /**< 0 if CRC stripped, 4 otherwise. */ > uint8_t drop_en; /**< If not 0, set SRRCTL.Drop_En. */ > - uint8_t start_rx_per_q; > + uint8_t rx_enable_queue; > #ifdef RTE_LIBRTE_IXGBE_RX_ALLOW_BULK_ALLOC > /** need to alloc dummy mbuf, for wraparound when scanning hw > ring */ > struct rte_mbuf fake_mbuf; > @@ -200,7 +200,7 @@ struct igb_tx_queue { > /** Hardware context0 history. */ > struct ixgbe_advctx_info ctx_cache[IXGBE_CTX_NUM]; > struct ixgbe_txq_ops *ops; /**< txq ops */ > - uint8_t start_tx_per_q; > + uint8_t tx_enable_queue; > }; >=20 > struct ixgbe_txq_ops { > -- > 1.8.4.2