DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/gve: add support for max_rx_bufsize
@ 2023-11-16 22:16 Joshua Washington
  2023-11-17  1:35 ` lihuisong (C)
  0 siblings, 1 reply; 3+ messages in thread
From: Joshua Washington @ 2023-11-16 22:16 UTC (permalink / raw)
  To: Junfeng Guo, Jeroen de Borst, Rushil Gupta, Joshua Washington
  Cc: dev, Ferruh Yigit

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;
+	}
+
 	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;
-- 
2.43.0.rc0.421.g78406f8d94-goog


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

* Re: [PATCH] net/gve: add support for max_rx_bufsize
  2023-11-16 22:16 [PATCH] net/gve: add support for max_rx_bufsize Joshua Washington
@ 2023-11-17  1:35 ` lihuisong (C)
  2023-11-17 10:59   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: lihuisong (C) @ 2023-11-17  1:35 UTC (permalink / raw)
  To: Joshua Washington, Junfeng Guo, Jeroen de Borst, Rushil Gupta
  Cc: dev, Ferruh Yigit


在 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;

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

* Re: [PATCH] net/gve: add support for max_rx_bufsize
  2023-11-17  1:35 ` lihuisong (C)
@ 2023-11-17 10:59   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2023-11-17 10:59 UTC (permalink / raw)
  To: lihuisong (C),
	Joshua Washington, Junfeng Guo, Jeroen de Borst, Rushil Gupta
  Cc: dev

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.


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

end of thread, other threads:[~2023-11-17 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 22:16 [PATCH] net/gve: add support for max_rx_bufsize Joshua Washington
2023-11-17  1:35 ` lihuisong (C)
2023-11-17 10:59   ` 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).