net/gve: Refill all descriptors that were consumed

Message ID 20230914205213.564562-1-rushilg@google.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/gve: Refill all descriptors that were consumed |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Rushil Gupta Sept. 14, 2023, 8:52 p.m. UTC
  Refill all consumed descriptors instead of refilling a set amount of
descriptors everytime. Also, lower the rx-free-thresh to refill more
aggressively. This yields in fewer packet drops for DQO queue format.

Signed-off-by: Rushil Gupta <rushilg@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
---
 drivers/net/gve/gve_ethdev.h | 2 +-
 drivers/net/gve/gve_rx_dqo.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Junfeng Guo Sept. 15, 2023, 2:28 a.m. UTC | #1
Acked-by: Junfeng Guo <junfeng.guo@intel.com>

Regards,
Junfeng

> -----Original Message-----
> From: Rushil Gupta <rushilg@google.com>
> Sent: Friday, September 15, 2023 04:52
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; ferruh.yigit@amd.com
> Cc: Guo, Junfeng <junfeng.guo@intel.com>; dev@dpdk.org; Rushil Gupta
> <rushilg@google.com>; Joshua Washington <joshwash@google.com>
> Subject: [PATCH] net/gve: Refill all descriptors that were consumed
> 
> Refill all consumed descriptors instead of refilling a set amount of
> descriptors everytime. Also, lower the rx-free-thresh to refill more
> aggressively. This yields in fewer packet drops for DQO queue format.
> 
> Signed-off-by: Rushil Gupta <rushilg@google.com>
> Reviewed-by: Joshua Washington <joshwash@google.com>
> ---
>  drivers/net/gve/gve_ethdev.h | 2 +-
>  drivers/net/gve/gve_rx_dqo.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
> index c9bcfa553c..fe7095ed76 100644
> --- a/drivers/net/gve/gve_ethdev.h
> +++ b/drivers/net/gve/gve_ethdev.h
> @@ -27,7 +27,7 @@
>  #define PCI_MSIX_FLAGS		2	/* Message Control */
>  #define PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */
> 
> -#define GVE_DEFAULT_RX_FREE_THRESH  512
> +#define GVE_DEFAULT_RX_FREE_THRESH   64
>  #define GVE_DEFAULT_TX_FREE_THRESH   32
>  #define GVE_DEFAULT_TX_RS_THRESH     32
>  #define GVE_TX_MAX_FREE_SZ          512
> diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
> index 236aefd2a8..7e7ddac48e 100644
> --- a/drivers/net/gve/gve_rx_dqo.c
> +++ b/drivers/net/gve/gve_rx_dqo.c
> @@ -12,8 +12,8 @@ gve_rx_refill_dqo(struct gve_rx_queue *rxq)
>  {
>  	volatile struct gve_rx_desc_dqo *rx_buf_ring;
>  	volatile struct gve_rx_desc_dqo *rx_buf_desc;
> -	struct rte_mbuf *nmb[rxq->free_thresh];
> -	uint16_t nb_refill = rxq->free_thresh;
> +	struct rte_mbuf *nmb[rxq->nb_rx_hold];
> +	uint16_t nb_refill = rxq->nb_rx_hold;
>  	uint16_t nb_desc = rxq->nb_rx_desc;
>  	uint16_t next_avail = rxq->bufq_tail;
>  	struct rte_eth_dev *dev;
> --
> 2.42.0.459.ge4e396fd5e-goog
  
Ferruh Yigit Sept. 21, 2023, 4:37 p.m. UTC | #2
On 9/15/2023 3:28 AM, Guo, Junfeng wrote:
>> -----Original Message-----
>> From: Rushil Gupta <rushilg@google.com>
>> Sent: Friday, September 15, 2023 04:52
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; ferruh.yigit@amd.com
>> Cc: Guo, Junfeng <junfeng.guo@intel.com>; dev@dpdk.org; Rushil Gupta
>> <rushilg@google.com>; Joshua Washington <joshwash@google.com>
>> Subject: [PATCH] net/gve: Refill all descriptors that were consumed
>>
>> Refill all consumed descriptors instead of refilling a set amount of
>> descriptors everytime. Also, lower the rx-free-thresh to refill more
>> aggressively. This yields in fewer packet drops for DQO queue format.
>>
>> Signed-off-by: Rushil Gupta <rushilg@google.com>
>> Reviewed-by: Joshua Washington <joshwash@google.com>
> 
> Acked-by: Junfeng Guo <junfeng.guo@intel.com>
>

Applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index c9bcfa553c..fe7095ed76 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -27,7 +27,7 @@ 
 #define PCI_MSIX_FLAGS		2	/* Message Control */
 #define PCI_MSIX_FLAGS_QSIZE	0x07FF	/* Table size */
 
-#define GVE_DEFAULT_RX_FREE_THRESH  512
+#define GVE_DEFAULT_RX_FREE_THRESH   64
 #define GVE_DEFAULT_TX_FREE_THRESH   32
 #define GVE_DEFAULT_TX_RS_THRESH     32
 #define GVE_TX_MAX_FREE_SZ          512
diff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c
index 236aefd2a8..7e7ddac48e 100644
--- a/drivers/net/gve/gve_rx_dqo.c
+++ b/drivers/net/gve/gve_rx_dqo.c
@@ -12,8 +12,8 @@  gve_rx_refill_dqo(struct gve_rx_queue *rxq)
 {
 	volatile struct gve_rx_desc_dqo *rx_buf_ring;
 	volatile struct gve_rx_desc_dqo *rx_buf_desc;
-	struct rte_mbuf *nmb[rxq->free_thresh];
-	uint16_t nb_refill = rxq->free_thresh;
+	struct rte_mbuf *nmb[rxq->nb_rx_hold];
+	uint16_t nb_refill = rxq->nb_rx_hold;
 	uint16_t nb_desc = rxq->nb_rx_desc;
 	uint16_t next_avail = rxq->bufq_tail;
 	struct rte_eth_dev *dev;