net/gve: add support for max_rx_bufsize

Message ID 20231116221605.2240305-1-joshwash@google.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/gve: add support for max_rx_bufsize |

Checks

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

Commit Message

Joshua Washington Nov. 16, 2023, 10:16 p.m. UTC
  The new max_rx_bufsize field in dev_info can be used to guide mbuf sizes
chosen by DPDK programs by ensuring that DPDK programs do not waste
memory by using an mbuf size too large for the maximum RX buffer size.
This patch adds support for this field in the GVE PMD.

Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Rushil Gupta <rushilg@google.com>
---
 drivers/net/gve/gve_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

lihuisong (C) Nov. 17, 2023, 1:35 a.m. UTC | #1
在 2023/11/17 6:16, Joshua Washington 写道:
> The new max_rx_bufsize field in dev_info can be used to guide mbuf sizes
> chosen by DPDK programs by ensuring that DPDK programs do not waste
> memory by using an mbuf size too large for the maximum RX buffer size.
> This patch adds support for this field in the GVE PMD.
>
> Signed-off-by: Joshua Washington <joshwash@google.com>
> Reviewed-by: Rushil Gupta <rushilg@google.com>
> ---
>   drivers/net/gve/gve_ethdev.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
> index 43b4ab523d..001cae2b98 100644
> --- a/drivers/net/gve/gve_ethdev.c
> +++ b/drivers/net/gve/gve_ethdev.c
> @@ -296,10 +296,14 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
>   	dev_info->max_mac_addrs = 1;
>   	dev_info->max_rx_queues = priv->max_nb_rxq;
>   	dev_info->max_tx_queues = priv->max_nb_txq;
> -	if (gve_is_gqi(priv))
> +	if (gve_is_gqi(priv)) {
>   		dev_info->min_rx_bufsize = GVE_RX_MIN_BUF_SIZE_GQI;
> -	else
> +		dev_info->max_rx_bufsize = GVE_RX_MAX_BUF_SIZE_GQI;
> +	} else {
>   		dev_info->min_rx_bufsize = GVE_RX_MIN_BUF_SIZE_DQO;
> +		dev_info->max_rx_bufsize = GVE_RX_MAX_BUF_SIZE_DQO;
> +	}
nice
Reviewed-by: Huisong Li <lihuisong@huawei.com>
> +
>   	dev_info->max_rx_pktlen = priv->max_mtu + RTE_ETHER_HDR_LEN;
>   	dev_info->max_mtu = priv->max_mtu;
>   	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
  
Ferruh Yigit Nov. 17, 2023, 10:59 a.m. UTC | #2
On 11/17/2023 1:35 AM, lihuisong (C) wrote:
> 
> 在 2023/11/17 6:16, Joshua Washington 写道:
>> The new max_rx_bufsize field in dev_info can be used to guide mbuf sizes
>> chosen by DPDK programs by ensuring that DPDK programs do not waste
>> memory by using an mbuf size too large for the maximum RX buffer size.
>> This patch adds support for this field in the GVE PMD.
>>
>> Signed-off-by: Joshua Washington <joshwash@google.com>
>> Reviewed-by: Rushil Gupta <rushilg@google.com>
> 
> Reviewed-by: Huisong Li <lihuisong@huawei.com>
>

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

Patch

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 43b4ab523d..001cae2b98 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -296,10 +296,14 @@  gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_mac_addrs = 1;
 	dev_info->max_rx_queues = priv->max_nb_rxq;
 	dev_info->max_tx_queues = priv->max_nb_txq;
-	if (gve_is_gqi(priv))
+	if (gve_is_gqi(priv)) {
 		dev_info->min_rx_bufsize = GVE_RX_MIN_BUF_SIZE_GQI;
-	else
+		dev_info->max_rx_bufsize = GVE_RX_MAX_BUF_SIZE_GQI;
+	} else {
 		dev_info->min_rx_bufsize = GVE_RX_MIN_BUF_SIZE_DQO;
+		dev_info->max_rx_bufsize = GVE_RX_MAX_BUF_SIZE_DQO;
+	}
+
 	dev_info->max_rx_pktlen = priv->max_mtu + RTE_ETHER_HDR_LEN;
 	dev_info->max_mtu = priv->max_mtu;
 	dev_info->min_mtu = RTE_ETHER_MIN_MTU;