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 139762BCD for ; Tue, 29 Nov 2016 13:54:42 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP; 29 Nov 2016 04:54:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,568,1473145200"; d="scan'208";a="36865485" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga005.fm.intel.com with ESMTP; 29 Nov 2016 04:54:39 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by irsmsx110.ger.corp.intel.com (163.33.3.25) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Nov 2016 12:50:23 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.43]) by irsmsx155.ger.corp.intel.com ([169.254.14.237]) with mapi id 14.03.0248.002; Tue, 29 Nov 2016 12:50:23 +0000 From: "Ananyev, Konstantin" To: Ilya Maximets , "dev@dpdk.org" , "Zhang, Helin" , "Wu, Jingjing" CC: Dyasly Sergey , Heetae Ahn , "Richardson, Bruce" , "Yigit, Ferruh" Thread-Topic: [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring Thread-Index: AQHSKhJxhZ6nwmQiEUmaUG2O8sC4LqDwCxqAgAAeKRA= Date: Tue, 29 Nov 2016 12:50:22 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772583F0E19CD@irsmsx105.ger.corp.intel.com> References: <1476886037-4586-1-git-send-email-i.maximets@samsung.com> <1476886037-4586-2-git-send-email-i.maximets@samsung.com> <0b31fd94-d5b2-acb8-8d55-a6fe124c9886@samsung.com> In-Reply-To: <0b31fd94-d5b2-acb8-8d55-a6fe124c9886@samsung.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring 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, 29 Nov 2016 12:54:43 -0000 Hi Ilya, > Ping. >=20 > Best regards, Ilya Maximets. >=20 > On 19.10.2016 17:07, Ilya Maximets wrote: > > The only reason why bulk alloc disabled for the rings with > > more than (I40E_MAX_RING_DESC - RTE_PMD_I40E_RX_MAX_BURST) > > descriptors is the possible out-of-bound access to the dma > > memory. But it's the artificial limit and can be easily > > avoided by allocating of RTE_PMD_I40E_RX_MAX_BURST more > > descriptors in memory. This will not interfere the HW and, > > as soon as all rings' memory zeroized, Rx functions will > > work correctly. > > > > This change allows to use vectorized Rx functions with > > 4096 descriptors in Rx ring which is important to achieve > > zero packet drop rate in high-load installations. > > > > Signed-off-by: Ilya Maximets > > --- > > drivers/net/i40e/i40e_rxtx.c | 24 +++++++++++++----------- > > 1 file changed, 13 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.= c > > index 7ae7d9f..1f76691 100644 > > --- a/drivers/net/i40e/i40e_rxtx.c > > +++ b/drivers/net/i40e/i40e_rxtx.c > > @@ -409,15 +409,6 @@ check_rx_burst_bulk_alloc_preconditions(__rte_unus= ed struct i40e_rx_queue *rxq) > > "rxq->rx_free_thresh=3D%d", > > rxq->nb_rx_desc, rxq->rx_free_thresh); > > ret =3D -EINVAL; > > - } else if (!(rxq->nb_rx_desc < (I40E_MAX_RING_DESC - > > - RTE_PMD_I40E_RX_MAX_BURST))) { > > - PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: " > > - "rxq->nb_rx_desc=3D%d, " > > - "I40E_MAX_RING_DESC=3D%d, " > > - "RTE_PMD_I40E_RX_MAX_BURST=3D%d", > > - rxq->nb_rx_desc, I40E_MAX_RING_DESC, > > - RTE_PMD_I40E_RX_MAX_BURST); > > - ret =3D -EINVAL; > > } > > #else > > ret =3D -EINVAL; > > @@ -1698,8 +1689,19 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, > > rxq->rx_deferred_start =3D rx_conf->rx_deferred_start; > > > > /* Allocate the maximun number of RX ring hardware descriptor. */ > > - ring_size =3D sizeof(union i40e_rx_desc) * I40E_MAX_RING_DESC; > > - ring_size =3D RTE_ALIGN(ring_size, I40E_DMA_MEM_ALIGN); > > + len =3D I40E_MAX_RING_DESC; > > + > > +#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC > > + /** > > + * Allocating a little more memory because vectorized/bulk_alloc Rx > > + * functions doesn't check boundaries each time. > > + */ > > + len +=3D RTE_PMD_I40E_RX_MAX_BURST; > > +#endif > > + Looks good to me. One question, though do we really need '+#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BU= LK_ALLOC' here? Why just not remove this ifdef here and always add allocate extra descripto= rs. Konstantin > > + ring_size =3D RTE_ALIGN(len * sizeof(union i40e_rx_desc), > > + I40E_DMA_MEM_ALIGN); > > + > > rz =3D rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, > > ring_size, I40E_RING_BASE_ALIGN, socket_id); > > if (!rz) { > >