net/gve: allow GVE MTU greater than RTE_ETHER_MTU

Message ID 20230929203825.3136449-1-joshwash@google.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/gve: allow GVE MTU greater than RTE_ETHER_MTU |

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/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

Joshua Washington Sept. 29, 2023, 8:38 p.m. UTC
  This patch corrects the MTU setting behavior in the GVE DPDK driver to
remove the artificial upper limit of RTE_ETHER_MTU. Instead, the max MTU
is dictated by the default value of the MTU that the device sends during
initialization, which will always be the maximum supported MTU.

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

Comments

Ferruh Yigit Oct. 4, 2023, 12:06 p.m. UTC | #1
On 9/29/2023 9:38 PM, Joshua Washington wrote:
> This patch corrects the MTU setting behavior in the GVE DPDK driver to
> remove the artificial upper limit of RTE_ETHER_MTU. Instead, the max MTU
> is dictated by the default value of the MTU that the device sends during
> initialization, which will always be the maximum supported MTU.
> 
> Signed-off-by: Joshua Washington <joshwash@google.com>
> 

    Fixes: 71dea04cdf9a ("net/gve: support device info and configure")
    Cc: stable@dpdk.org


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 9b25f3036b..b441f96623 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -7,6 +7,7 @@ 
 #include "base/gve_register.h"
 #include "base/gve_osdep.h"
 #include "gve_version.h"
+#include "rte_ether.h"
 
 static void
 gve_write_version(uint8_t *driver_version_register)
@@ -297,8 +298,8 @@  gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->max_tx_queues = priv->max_nb_txq;
 	dev_info->min_rx_bufsize = GVE_MIN_BUF_SIZE;
 	dev_info->max_rx_pktlen = GVE_MAX_RX_PKTLEN;
-	dev_info->max_mtu = GVE_MAX_MTU;
-	dev_info->min_mtu = GVE_MIN_MTU;
+	dev_info->max_mtu = priv->max_mtu;
+	dev_info->min_mtu = RTE_ETHER_MIN_MTU;
 
 	dev_info->rx_offload_capa = 0;
 	dev_info->tx_offload_capa =
diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h
index ca94a09a2f..1cba282128 100644
--- a/drivers/net/gve/gve_ethdev.h
+++ b/drivers/net/gve/gve_ethdev.h
@@ -23,9 +23,6 @@ 
 #define GVE_MIN_BUF_SIZE	    1024
 #define GVE_MAX_RX_PKTLEN	    65535
 
-#define GVE_MAX_MTU	RTE_ETHER_MTU
-#define GVE_MIN_MTU	RTE_ETHER_MIN_MTU
-
 #define GVE_TX_CKSUM_OFFLOAD_MASK (		\
 		RTE_MBUF_F_TX_L4_MASK  |	\
 		RTE_MBUF_F_TX_TCP_SEG)