DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
       [not found] <CGME20161019140725eucas1p1cb53318d974fb1152f1a7b571f328fd5@eucas1p1.samsung.com>
@ 2016-10-19 14:07 ` Ilya Maximets
       [not found]   ` <CGME20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f@eucas1p2.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Ilya Maximets @ 2016-10-19 14:07 UTC (permalink / raw)
  To: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson, Ilya Maximets

Ilya Maximets (2):
  net/i40e: allow bulk alloc for the max size desc ring
  net/ixgbe: allow bulk alloc for the max size desc ring

 drivers/net/i40e/i40e_rxtx.c   | 24 +++++++++++++-----------
 drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
 drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
 3 files changed, 15 insertions(+), 28 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring
       [not found]   ` <CGME20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f@eucas1p2.samsung.com>
@ 2016-10-19 14:07     ` Ilya Maximets
  2016-11-29 10:59       ` Ilya Maximets
  0 siblings, 1 reply; 15+ messages in thread
From: Ilya Maximets @ 2016-10-19 14:07 UTC (permalink / raw)
  To: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson, Ilya Maximets

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 <i.maximets@samsung.com>
---
 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) {
-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH RFC 2/2] net/ixgbe: allow bulk alloc for the max size desc ring
       [not found]   ` <CGME20161019140735eucas1p267bb4aa03547e70e5f13d78e2ffedcc4@eucas1p2.samsung.com>
@ 2016-10-19 14:07     ` Ilya Maximets
  2016-11-29 10:59       ` Ilya Maximets
  0 siblings, 1 reply; 15+ messages in thread
From: Ilya Maximets @ 2016-10-19 14:07 UTC (permalink / raw)
  To: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson, Ilya Maximets

The only reason why bulk alloc disabled for the rings with
more than (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_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_IXGBE_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 <i.maximets@samsung.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
 drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
 2 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index 2ce8234..07c04c3 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2585,7 +2585,6 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 	 *   rxq->rx_free_thresh >= RTE_PMD_IXGBE_RX_MAX_BURST
 	 *   rxq->rx_free_thresh < rxq->nb_rx_desc
 	 *   (rxq->nb_rx_desc % rxq->rx_free_thresh) == 0
-	 *   rxq->nb_rx_desc<(IXGBE_MAX_RING_DESC-RTE_PMD_IXGBE_RX_MAX_BURST)
 	 * Scattered packets are not supported.  This should be checked
 	 * outside of this function.
 	 */
@@ -2607,15 +2606,6 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
 			     "rxq->rx_free_thresh=%d",
 			     rxq->nb_rx_desc, rxq->rx_free_thresh);
 		ret = -EINVAL;
-	} else if (!(rxq->nb_rx_desc <
-	       (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_RX_MAX_BURST))) {
-		PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: "
-			     "rxq->nb_rx_desc=%d, "
-			     "IXGBE_MAX_RING_DESC=%d, "
-			     "RTE_PMD_IXGBE_RX_MAX_BURST=%d",
-			     rxq->nb_rx_desc, IXGBE_MAX_RING_DESC,
-			     RTE_PMD_IXGBE_RX_MAX_BURST);
-		ret = -EINVAL;
 	}
 
 	return ret;
@@ -2632,12 +2622,7 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq)
 	/*
 	 * By default, the Rx queue setup function allocates enough memory for
 	 * IXGBE_MAX_RING_DESC.  The Rx Burst bulk allocation function requires
-	 * extra memory at the end of the descriptor ring to be zero'd out. A
-	 * pre-condition for using the Rx burst bulk alloc function is that the
-	 * number of descriptors is less than or equal to
-	 * (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_RX_MAX_BURST). Check all the
-	 * constraints here to see if we need to zero out memory after the end
-	 * of the H/W descriptor ring.
+	 * extra memory at the end of the descriptor ring to be zero'd out.
 	 */
 	if (adapter->rx_bulk_alloc_allowed)
 		/* zero out extra memory */
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
index 2608b36..1abc6f2 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.h
+++ b/drivers/net/ixgbe/ixgbe_rxtx.h
@@ -67,7 +67,7 @@
 #define RTE_IXGBE_MAX_RX_BURST          RTE_IXGBE_RXQ_REARM_THRESH
 #endif
 
-#define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_IXGBE_DESCS_PER_LOOP - 1) * \
+#define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_PMD_IXGBE_RX_MAX_BURST) * \
 		    sizeof(union ixgbe_adv_rx_desc))
 
 #ifdef RTE_PMD_PACKET_PREFETCH
-- 
2.7.4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2016-10-19 14:07 ` [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs Ilya Maximets
       [not found]   ` <CGME20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f@eucas1p2.samsung.com>
       [not found]   ` <CGME20161019140735eucas1p267bb4aa03547e70e5f13d78e2ffedcc4@eucas1p2.samsung.com>
@ 2016-10-19 14:30   ` Ferruh Yigit
  2016-11-21 13:53     ` Ferruh Yigit
  2 siblings, 1 reply; 15+ messages in thread
From: Ferruh Yigit @ 2016-10-19 14:30 UTC (permalink / raw)
  To: Ilya Maximets, dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson

On 10/19/2016 3:07 PM, Ilya Maximets wrote:
> Ilya Maximets (2):
>   net/i40e: allow bulk alloc for the max size desc ring
>   net/ixgbe: allow bulk alloc for the max size desc ring
> 
>  drivers/net/i40e/i40e_rxtx.c   | 24 +++++++++++++-----------
>  drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
>  drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
>  3 files changed, 15 insertions(+), 28 deletions(-)
> 

Hi Ilya,

Thank you for the patch, we are in post rc1 phase and this is a new
feature, so this patchset will be considered for next release (v17.02).

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2016-10-19 14:30   ` [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs Ferruh Yigit
@ 2016-11-21 13:53     ` Ferruh Yigit
  2016-12-21 12:33       ` Ilya Maximets
  2016-12-27  5:03       ` Ilya Maximets
  0 siblings, 2 replies; 15+ messages in thread
From: Ferruh Yigit @ 2016-11-21 13:53 UTC (permalink / raw)
  To: Ilya Maximets, dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson, Wenzhuo Lu

On 10/19/2016 3:30 PM, Ferruh Yigit wrote:
> On 10/19/2016 3:07 PM, Ilya Maximets wrote:
>> Ilya Maximets (2):
>>   net/i40e: allow bulk alloc for the max size desc ring
>>   net/ixgbe: allow bulk alloc for the max size desc ring
>>
>>  drivers/net/i40e/i40e_rxtx.c   | 24 +++++++++++++-----------
>>  drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
>>  drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
>>  3 files changed, 15 insertions(+), 28 deletions(-)
>>
> 
> Hi Ilya,
> 
> Thank you for the patch, we are in post rc1 phase and this is a new
> feature, so this patchset will be considered for next release (v17.02).
> 

Reminder for this patch (RFC) which has been sent in 16.11 time frame
and we postponed to 17.02 release.

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring
  2016-10-19 14:07     ` [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring Ilya Maximets
@ 2016-11-29 10:59       ` Ilya Maximets
  2016-11-29 12:50         ` Ananyev, Konstantin
  0 siblings, 1 reply; 15+ messages in thread
From: Ilya Maximets @ 2016-11-29 10:59 UTC (permalink / raw)
  To: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson, Ferruh Yigit

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 <i.maximets@samsung.com>
> ---
>  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) {
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 2/2] net/ixgbe: allow bulk alloc for the max size desc ring
  2016-10-19 14:07     ` [dpdk-dev] [PATCH RFC 2/2] net/ixgbe: " Ilya Maximets
@ 2016-11-29 10:59       ` Ilya Maximets
  0 siblings, 0 replies; 15+ messages in thread
From: Ilya Maximets @ 2016-11-29 10:59 UTC (permalink / raw)
  To: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Dyasly Sergey, Heetae Ahn, Bruce Richardson

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 (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_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_IXGBE_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 <i.maximets@samsung.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
>  drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
>  2 files changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index 2ce8234..07c04c3 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -2585,7 +2585,6 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
>  	 *   rxq->rx_free_thresh >= RTE_PMD_IXGBE_RX_MAX_BURST
>  	 *   rxq->rx_free_thresh < rxq->nb_rx_desc
>  	 *   (rxq->nb_rx_desc % rxq->rx_free_thresh) == 0
> -	 *   rxq->nb_rx_desc<(IXGBE_MAX_RING_DESC-RTE_PMD_IXGBE_RX_MAX_BURST)
>  	 * Scattered packets are not supported.  This should be checked
>  	 * outside of this function.
>  	 */
> @@ -2607,15 +2606,6 @@ check_rx_burst_bulk_alloc_preconditions(struct ixgbe_rx_queue *rxq)
>  			     "rxq->rx_free_thresh=%d",
>  			     rxq->nb_rx_desc, rxq->rx_free_thresh);
>  		ret = -EINVAL;
> -	} else if (!(rxq->nb_rx_desc <
> -	       (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_RX_MAX_BURST))) {
> -		PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: "
> -			     "rxq->nb_rx_desc=%d, "
> -			     "IXGBE_MAX_RING_DESC=%d, "
> -			     "RTE_PMD_IXGBE_RX_MAX_BURST=%d",
> -			     rxq->nb_rx_desc, IXGBE_MAX_RING_DESC,
> -			     RTE_PMD_IXGBE_RX_MAX_BURST);
> -		ret = -EINVAL;
>  	}
>  
>  	return ret;
> @@ -2632,12 +2622,7 @@ ixgbe_reset_rx_queue(struct ixgbe_adapter *adapter, struct ixgbe_rx_queue *rxq)
>  	/*
>  	 * By default, the Rx queue setup function allocates enough memory for
>  	 * IXGBE_MAX_RING_DESC.  The Rx Burst bulk allocation function requires
> -	 * extra memory at the end of the descriptor ring to be zero'd out. A
> -	 * pre-condition for using the Rx burst bulk alloc function is that the
> -	 * number of descriptors is less than or equal to
> -	 * (IXGBE_MAX_RING_DESC - RTE_PMD_IXGBE_RX_MAX_BURST). Check all the
> -	 * constraints here to see if we need to zero out memory after the end
> -	 * of the H/W descriptor ring.
> +	 * extra memory at the end of the descriptor ring to be zero'd out.
>  	 */
>  	if (adapter->rx_bulk_alloc_allowed)
>  		/* zero out extra memory */
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.h b/drivers/net/ixgbe/ixgbe_rxtx.h
> index 2608b36..1abc6f2 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.h
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.h
> @@ -67,7 +67,7 @@
>  #define RTE_IXGBE_MAX_RX_BURST          RTE_IXGBE_RXQ_REARM_THRESH
>  #endif
>  
> -#define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_IXGBE_DESCS_PER_LOOP - 1) * \
> +#define RX_RING_SZ ((IXGBE_MAX_RING_DESC + RTE_PMD_IXGBE_RX_MAX_BURST) * \
>  		    sizeof(union ixgbe_adv_rx_desc))
>  
>  #ifdef RTE_PMD_PACKET_PREFETCH
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring
  2016-11-29 10:59       ` Ilya Maximets
@ 2016-11-29 12:50         ` Ananyev, Konstantin
  2016-11-29 13:06           ` Ilya Maximets
  0 siblings, 1 reply; 15+ messages in thread
From: Ananyev, Konstantin @ 2016-11-29 12:50 UTC (permalink / raw)
  To: Ilya Maximets, dev, Zhang, Helin, Wu, Jingjing
  Cc: Dyasly Sergey, Heetae Ahn, Richardson, Bruce, Yigit, Ferruh

Hi Ilya,

> 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 <i.maximets@samsung.com>
> > ---
> >  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
> > +

Looks good to me.
One question, though do we really need '+#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC' here?
Why just not remove this ifdef here and always add allocate extra descriptors.
Konstantin

> > +	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) {
> >

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring
  2016-11-29 12:50         ` Ananyev, Konstantin
@ 2016-11-29 13:06           ` Ilya Maximets
  0 siblings, 0 replies; 15+ messages in thread
From: Ilya Maximets @ 2016-11-29 13:06 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev, Zhang, Helin, Wu, Jingjing
  Cc: Dyasly Sergey, Heetae Ahn, Richardson, Bruce, Yigit, Ferruh

On 29.11.2016 15:50, Ananyev, Konstantin wrote:
> Hi Ilya,
> 
>> 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 <i.maximets@samsung.com>
>>> ---
>>>  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
>>> +
> 
> Looks good to me.
> One question, though do we really need '+#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC' here?
> Why just not remove this ifdef here and always add allocate extra descriptors.
> Konstantin

I put it there because all other bulk_alloc related code in i40e is under this
ifdef. Just to keep the code in consistent state. Plus, it saves memory a bit.
I prefer to keep ifdef here, but maintainers are free to remove it while applying.

>>> +	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) {
>>>
> 
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2016-11-21 13:53     ` Ferruh Yigit
@ 2016-12-21 12:33       ` Ilya Maximets
  2016-12-27  5:03       ` Ilya Maximets
  1 sibling, 0 replies; 15+ messages in thread
From: Ilya Maximets @ 2016-12-21 12:33 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu
  Cc: Heetae Ahn, Bruce Richardson, Wenzhuo Lu

Ping.

Best regards, Ilya Maximets.

On 21.11.2016 16:53, Ferruh Yigit wrote:
> On 10/19/2016 3:30 PM, Ferruh Yigit wrote:
>> On 10/19/2016 3:07 PM, Ilya Maximets wrote:
>>> Ilya Maximets (2):
>>>   net/i40e: allow bulk alloc for the max size desc ring
>>>   net/ixgbe: allow bulk alloc for the max size desc ring
>>>
>>>  drivers/net/i40e/i40e_rxtx.c   | 24 +++++++++++++-----------
>>>  drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
>>>  drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
>>>  3 files changed, 15 insertions(+), 28 deletions(-)
>>>
>>
>> Hi Ilya,
>>
>> Thank you for the patch, we are in post rc1 phase and this is a new
>> feature, so this patchset will be considered for next release (v17.02).
>>
> 
> Reminder for this patch (RFC) which has been sent in 16.11 time frame
> and we postponed to 17.02 release.
> 
> Thanks,
> ferruh
> 
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2016-11-21 13:53     ` Ferruh Yigit
  2016-12-21 12:33       ` Ilya Maximets
@ 2016-12-27  5:03       ` Ilya Maximets
  2017-01-02 15:40         ` Thomas Monjalon
  1 sibling, 1 reply; 15+ messages in thread
From: Ilya Maximets @ 2016-12-27  5:03 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu,
	Thomas Monjalon
  Cc: Heetae Ahn, Bruce Richardson, Wenzhuo Lu

Hello.
Ferruh, Thomas, is there a chance for this to be accepted to 17.02?
Maybe I should resend this patch-set without 'RFC' tag?

Best regards, Ilya Maximets.


On 21.11.2016 16:53, Ferruh Yigit wrote:
> On 10/19/2016 3:30 PM, Ferruh Yigit wrote:
>> On 10/19/2016 3:07 PM, Ilya Maximets wrote:
>>> Ilya Maximets (2):
>>>   net/i40e: allow bulk alloc for the max size desc ring
>>>   net/ixgbe: allow bulk alloc for the max size desc ring
>>>
>>>  drivers/net/i40e/i40e_rxtx.c   | 24 +++++++++++++-----------
>>>  drivers/net/ixgbe/ixgbe_rxtx.c | 17 +----------------
>>>  drivers/net/ixgbe/ixgbe_rxtx.h |  2 +-
>>>  3 files changed, 15 insertions(+), 28 deletions(-)
>>>
>>
>> Hi Ilya,
>>
>> Thank you for the patch, we are in post rc1 phase and this is a new
>> feature, so this patchset will be considered for next release (v17.02).
>>
> 
> Reminder for this patch (RFC) which has been sent in 16.11 time frame
> and we postponed to 17.02 release.
> 
> Thanks,
> ferruh
> 
> 
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2016-12-27  5:03       ` Ilya Maximets
@ 2017-01-02 15:40         ` Thomas Monjalon
  2017-01-03 17:24           ` Ferruh Yigit
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Monjalon @ 2017-01-02 15:40 UTC (permalink / raw)
  To: Ilya Maximets, Ferruh Yigit
  Cc: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu, Heetae Ahn,
	Bruce Richardson, Wenzhuo Lu

2016-12-27 08:03, Ilya Maximets:
> Hello.
> Ferruh, Thomas, is there a chance for this to be accepted to 17.02?
> Maybe I should resend this patch-set without 'RFC' tag?

Yes it should be integrated in 17.02.
Ferruh, any news?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2017-01-02 15:40         ` Thomas Monjalon
@ 2017-01-03 17:24           ` Ferruh Yigit
  2017-01-06  2:29             ` Wu, Jingjing
  0 siblings, 1 reply; 15+ messages in thread
From: Ferruh Yigit @ 2017-01-03 17:24 UTC (permalink / raw)
  To: Thomas Monjalon, Ilya Maximets
  Cc: dev, Helin Zhang, Konstantin Ananyev, Jingjing Wu, Heetae Ahn,
	Bruce Richardson, Wenzhuo Lu

On 1/2/2017 3:40 PM, Thomas Monjalon wrote:
> 2016-12-27 08:03, Ilya Maximets:
>> Hello.
>> Ferruh, Thomas, is there a chance for this to be accepted to 17.02?
>> Maybe I should resend this patch-set without 'RFC' tag?
> 
> Yes it should be integrated in 17.02.
> Ferruh, any news?
> 

I was waiting for a review from driver maintainers

Ilya,

If you don't mind, can you please send again as patches instead of RFC,
if patches also don't get any objection, they can be merged.

Thanks,
ferruh

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2017-01-03 17:24           ` Ferruh Yigit
@ 2017-01-06  2:29             ` Wu, Jingjing
  2017-01-06 13:56               ` Ferruh Yigit
  0 siblings, 1 reply; 15+ messages in thread
From: Wu, Jingjing @ 2017-01-06  2:29 UTC (permalink / raw)
  To: Yigit, Ferruh, Thomas Monjalon, Ilya Maximets
  Cc: dev, Zhang, Helin, Ananyev, Konstantin, Heetae Ahn, Richardson,
	Bruce, Lu, Wenzhuo



> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, January 4, 2017 1:25 AM
> To: Thomas Monjalon <thomas.monjalon@6wind.com>; Ilya Maximets
> <i.maximets@samsung.com>
> Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
> Heetae Ahn <heetae82.ahn@samsung.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring
> size on Intel NICs.
> 
> On 1/2/2017 3:40 PM, Thomas Monjalon wrote:
> > 2016-12-27 08:03, Ilya Maximets:
> >> Hello.
> >> Ferruh, Thomas, is there a chance for this to be accepted to 17.02?
> >> Maybe I should resend this patch-set without 'RFC' tag?
> >
> > Yes it should be integrated in 17.02.
> > Ferruh, any news?
> >
> 
> I was waiting for a review from driver maintainers

The patch looks good me, both ixgbe and i40e.

Thanks, Ilya.

Another idea is like, now the memory zone can be freed now.
So maybe later, we don't need to reserve a maximum size for rx ring, and can change it when number of desc are changed.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs.
  2017-01-06  2:29             ` Wu, Jingjing
@ 2017-01-06 13:56               ` Ferruh Yigit
  0 siblings, 0 replies; 15+ messages in thread
From: Ferruh Yigit @ 2017-01-06 13:56 UTC (permalink / raw)
  To: Wu, Jingjing, Thomas Monjalon, Ilya Maximets
  Cc: dev, Zhang, Helin, Ananyev, Konstantin, Heetae Ahn, Richardson,
	Bruce, Lu, Wenzhuo

On 1/6/2017 2:29 AM, Wu, Jingjing wrote:
> 
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, January 4, 2017 1:25 AM
>> To: Thomas Monjalon <thomas.monjalon@6wind.com>; Ilya Maximets
>> <i.maximets@samsung.com>
>> Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Ananyev, Konstantin
>> <konstantin.ananyev@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>;
>> Heetae Ahn <heetae82.ahn@samsung.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring
>> size on Intel NICs.
>>
>> On 1/2/2017 3:40 PM, Thomas Monjalon wrote:
>>> 2016-12-27 08:03, Ilya Maximets:
>>>> Hello.
>>>> Ferruh, Thomas, is there a chance for this to be accepted to 17.02?
>>>> Maybe I should resend this patch-set without 'RFC' tag?
>>>
>>> Yes it should be integrated in 17.02.
>>> Ferruh, any news?
>>>
>>
>> I was waiting for a review from driver maintainers
> 
> The patch looks good me, both ixgbe and i40e.

Acked-by: Jingjing Wu <jingjing.wu@intel.com>

Series applied to dpdk-next-net/master, thanks.

> 
> Thanks, Ilya.
> 
> Another idea is like, now the memory zone can be freed now.
> So maybe later, we don't need to reserve a maximum size for rx ring, and can change it when number of desc are changed.
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-01-06 13:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161019140725eucas1p1cb53318d974fb1152f1a7b571f328fd5@eucas1p1.samsung.com>
2016-10-19 14:07 ` [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs Ilya Maximets
     [not found]   ` <CGME20161019140730eucas1p2b1cf9daba45bdbf915bb69b24a0a850f@eucas1p2.samsung.com>
2016-10-19 14:07     ` [dpdk-dev] [PATCH RFC 1/2] net/i40e: allow bulk alloc for the max size desc ring Ilya Maximets
2016-11-29 10:59       ` Ilya Maximets
2016-11-29 12:50         ` Ananyev, Konstantin
2016-11-29 13:06           ` Ilya Maximets
     [not found]   ` <CGME20161019140735eucas1p267bb4aa03547e70e5f13d78e2ffedcc4@eucas1p2.samsung.com>
2016-10-19 14:07     ` [dpdk-dev] [PATCH RFC 2/2] net/ixgbe: " Ilya Maximets
2016-11-29 10:59       ` Ilya Maximets
2016-10-19 14:30   ` [dpdk-dev] [PATCH RFC 0/2] Allow vectorized Rx with 4096 desc ring size on Intel NICs Ferruh Yigit
2016-11-21 13:53     ` Ferruh Yigit
2016-12-21 12:33       ` Ilya Maximets
2016-12-27  5:03       ` Ilya Maximets
2017-01-02 15:40         ` Thomas Monjalon
2017-01-03 17:24           ` Ferruh Yigit
2017-01-06  2:29             ` Wu, Jingjing
2017-01-06 13:56               ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).