From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by dpdk.org (Postfix) with ESMTP id 24BDA374C for ; Tue, 29 Nov 2016 11:59:20 +0100 (CET) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHE00BXOH6UJK20@mailout3.w1.samsung.com> for dev@dpdk.org; Tue, 29 Nov 2016 10:59:18 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20161129105917eucas1p1fe2eb33efb18760fa7b4726c5cdcb197~Lf4_7xPzg1746417464eucas1p1k; Tue, 29 Nov 2016 10:59:17 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 1D.B3.23383.68F5D385; Tue, 29 Nov 2016 10:59:18 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20161129105917eucas1p26c51fc774702f8288eae9a703e33448e~Lf4_PSLms1832218322eucas1p2K; Tue, 29 Nov 2016 10:59:17 +0000 (GMT) X-AuditID: cbfec7ef-f79e76d000005b57-0c-583d5f86bf53 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0B.00.07726.59F5D385; Tue, 29 Nov 2016 10:59:33 +0000 (GMT) Received: from [106.109.129.180] by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHE00480H6SKE70@eusync3.samsung.com>; Tue, 29 Nov 2016 10:59:17 +0000 (GMT) To: dev@dpdk.org, Helin Zhang , Konstantin Ananyev , Jingjing Wu Cc: Dyasly Sergey , Heetae Ahn , Bruce Richardson , Ferruh Yigit From: Ilya Maximets Message-id: <0b31fd94-d5b2-acb8-8d55-a6fe124c9886@samsung.com> Date: Tue, 29 Nov 2016 13:59:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-version: 1.0 In-reply-to: <1476886037-4586-2-git-send-email-i.maximets@samsung.com> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAKsWRmVeSWpSXmKPExsWy7djP87pt8bYRBldWaFrcWGVv8e7TdiaL O3tPs1tM+3yb3WLKte2MFlfaf7JbzFzwmdHi/Z9FLBaTZ0s5cHr8WrCU1WPxnpdMHn1bVjEG MEdx2aSk5mSWpRbp2yVwZdw7mlXQL1Lx5FkvawPjDIEuRk4OCQETie7dR1ghbDGJC/fWs3Ux cnEICSxjlOi9/JQFwvnMKHHg9nYmmI5ZL5qY4KoefmlhhXBeMEp8n/WcDaRKWCBEYvX9Q+wg CRGBfkaJ2QsOM4M4zAIrGSV6Nq8Gm8UmoCNxavURxi5GDg5eATuJKUfLQMIsAqoSV1e2M4PY ogIREgc3rmYEsXkFBCV+TL7HAmJzCrhJvL4/FayGWcBAYsaUw0wQtrzE5jVvwXZJCKxjl/i1 9Sg7yHwJAVmJTQeYIUwXiW9LfCG+EZZ4dXwLO4QtI9HZcRDqy2qJiVvb2CHGtDBKLJz4AxpI 9hKnbl6F2sUnMWnbdKiZvBIdbUIQJR4S7UtvMELYjhJ7tmyABuNVRomvEx+yTGCUn4XknVlI XpiF5IUFjMyrGEVSS4tz01OLDfWKE3OLS/PS9ZLzczcxAtPJ6X/H3+9gfNoccohRgINRiYd3 h5VNhBBrYllxZe4hRgkOZiUR3pcxthFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefcuuBIuJJCe WJKanZpakFoEk2Xi4JRqYDRUetCzOaTxxJQF1gFGO4/dUy02mph8/57719gjH3PzV/8KlNow id/uzU69oN36MxMtXrzYY3RJU77q1M2M6O+qZ69Pr/QU2JwRWx+2NrFOcp+FWtQJz3f2v+/M /s7QZpCZNP36YvGpTMF+LS/OlKv84jxuOp9d5pphQLYf89aCHtPPWo0NZUosxRmJhlrMRcWJ APEYmtojAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPIsWRmVeSWpSXmKPExsVy+t/xq7pT420jDBadFrO4scre4t2n7UwW d/aeZreY9vk2u8WUa9sZLa60/2S3mLngM6PF+z+LWCwmz5Zy4PT4tWApq8fiPS+ZPPq2rGIM YI5ys8lITUxJLVJIzUvOT8nMS7dVCg1x07VQUshLzE21VYrQ9Q0JUlIoS8wpBfKMDNCAg3OA e7CSvl2CW8a9o1kF/SIVT571sjYwzhDoYuTkkBAwkZj1ookJwhaTuHBvPVsXIxeHkMASRomr cyZCOS8YJWZMbGIGqRIWCJF40PiIFSQhIjCRUWL6jeXsEFVXGSWW/2pmAnGYBVYzSsy9d4kF pIVNQEfi1OojjF2MHBy8AnYSU46WgYRZBFQlrq5sB5sqKhAhsenrHLByXgFBiR+T74HZnAJu Eq/vT2UGaWUW0JO4f1ELJMwsIC+xec1b5gmMArOQdMxCqJqFpGoBI/MqRpHU0uLc9NxiQ73i xNzi0rx0veT83E2MwMjaduzn5h2MlzYGH2IU4GBU4uEVsLWJEGJNLCuuzD3EKMHBrCTCeyLO NkKINyWxsiq1KD++qDQntfgQoynQCxOZpUST84FRn1cSb2hiaG5paGRsYWFuZKQkzlvy4Uq4 kEB6YklqdmpqQWoRTB8TB6dUA2Nf584qtvB4R3M1w8V3lkc/dbzffPLpFsdlTTcXOPw5Vj3x Xkohq9aKWy5qH6cfXpkj/vqcqkLfK5Vo37s5HH3z81TNHKf9YSt5zxj8QObnpzmiL9M4v8dF 2T3dLi5Y/tl3yqH5Za78FzietCw6ci/8e/ML5WNtAXdTds7nD5Ra1PT03Q314yxKLMUZiYZa zEXFiQALx/5HwgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20161129105917eucas1p26c51fc774702f8288eae9a703e33448e X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G+yCvOyEseyghOyekBtFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?SWx5YSBNYXhpbWV0cxtTUlItVmlydHVhbGl6YXRpb24gTGFi?= =?UTF-8?B?G1NhbXN1bmcgRWxlY3Ryb25pY3MbRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG0NJU0hRG0MxMEdEMDFHRDAxMDE1NA==?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f X-RootMTR: 20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f References: <1476886037-4586-1-git-send-email-i.maximets@samsung.com> <1476886037-4586-2-git-send-email-i.maximets@samsung.com> 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 10:59:20 -0000 Ping. Best regards, Ilya Maximets. 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_unused struct i40e_rx_queue *rxq) > "rxq->rx_free_thresh=%d", > rxq->nb_rx_desc, rxq->rx_free_thresh); > ret = -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=%d, " > - "I40E_MAX_RING_DESC=%d, " > - "RTE_PMD_I40E_RX_MAX_BURST=%d", > - rxq->nb_rx_desc, I40E_MAX_RING_DESC, > - RTE_PMD_I40E_RX_MAX_BURST); > - ret = -EINVAL; > } > #else > ret = -EINVAL; > @@ -1698,8 +1689,19 @@ i40e_dev_rx_queue_setup(struct rte_eth_dev *dev, > rxq->rx_deferred_start = rx_conf->rx_deferred_start; > > /* Allocate the maximun number of RX ring hardware descriptor. */ > - ring_size = sizeof(union i40e_rx_desc) * I40E_MAX_RING_DESC; > - ring_size = RTE_ALIGN(ring_size, I40E_DMA_MEM_ALIGN); > + len = 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 += RTE_PMD_I40E_RX_MAX_BURST; > +#endif > + > + ring_size = RTE_ALIGN(len * sizeof(union i40e_rx_desc), > + I40E_DMA_MEM_ALIGN); > + > rz = rte_eth_dma_zone_reserve(dev, "rx_ring", queue_idx, > ring_size, I40E_RING_BASE_ALIGN, socket_id); > if (!rz) { >