From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3BD143182; Mon, 16 Oct 2023 22:59:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A562F40299; Mon, 16 Oct 2023 22:59:53 +0200 (CEST) Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by mails.dpdk.org (Postfix) with ESMTP id CBAD8400D6 for ; Mon, 16 Oct 2023 22:59:51 +0200 (CEST) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-5a21e8ee1b7so46047027b3.1 for ; Mon, 16 Oct 2023 13:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697489991; x=1698094791; darn=dpdk.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=7cPB6CNdHTjnfdAPx13ikW3fEpqHkoxAj7v/2lOsALQ=; b=UTvSKR4NBPmBXEuBtji7ZErWuVlTAgr7SjvkNft34lNSRJ+kAM4QdF2HLUK18Ym7Sb cwNYJCLHpU0ae8kdpG6oKBQIho/DdFUePauR1kh5ejeFj/2hDDMIeMIKwl0/mnzvQxSk qRUcjHXPCjzrXHzjnjpSYIKPnWMpU2FwofgtDl8MNSjrKRZtzy+7/Tl32Wq1axH97WkS vtXnIVi5OylQKFF8C+nOFFDOA6G4gljSYdLWIf7CI62pxjvsSdH/2UY2VP9LpRUy/jcf ISmdYfrs/0fFkQWOvSPeW2y5F6RW01qGDQ2ParBRPKU7n6WCoIK/KtgUzitKdQBxOHg2 Pidw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697489991; x=1698094791; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7cPB6CNdHTjnfdAPx13ikW3fEpqHkoxAj7v/2lOsALQ=; b=of+m7YLGjTcAqj++BvxZrngYXxszInAv3oDR6/jfRfDWKzEWRd4ST4ed6i6bf1yWMu KZDyJhaB59cSyzSuf/fku1UZXDWSpQI1CB2sFCE+wG8f9W3Xz6GHA1M/3H5OCpwFQRdZ 04nUWdyTSu+Faw1ZEMmGbY2XMmTAR+qFAihqQc6M2DB6w8wfzNCozq9UA+4jaHEUATYw r8koxDyu2MHrfdy6fG8RTze1aAm7jI0Dy0ddW+0uYqmZC5lJea9D21vG6/iL1FXUrFl3 nl/0mrabyd6Tv522VdLfZGaXmOTC9pvnIcIfVjPgOZV/XYL1KdAdxKinDrebLvRywxRJ l7iQ== X-Gm-Message-State: AOJu0Ywut7QSDEBJLqLkz+gwb+5Ubmp5d2x3W8N28X1w0wK3swFuV8hG yIXgbuFFUAUjejwhGXyIEG5MGyFzYtJ1hw== X-Google-Smtp-Source: AGHT+IHUUXpTIr5sndAfCkVMkAIPv7hcdWY1NvzZ/zUMklSCVSji7zTT0kx2G6cc2InRetWvZAj0FBwekzgqQw== X-Received: from joshwash.sea.corp.google.com ([2620:15c:11c:202:8b71:1974:d716:ecf2]) (user=joshwash job=sendgmr) by 2002:a25:cfcc:0:b0:d9b:b6bd:4894 with SMTP id f195-20020a25cfcc000000b00d9bb6bd4894mr15290ybg.5.1697489991254; Mon, 16 Oct 2023 13:59:51 -0700 (PDT) Date: Mon, 16 Oct 2023 13:59:48 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.42.0.655.g421f12c284-goog Message-ID: <20231016205948.2252342-1-joshwash@google.com> Subject: [PATCH] net/gve: Update max_rx_pktlen to be based on MTU From: Joshua Washington To: Junfeng Guo , Jeroen de Borst , Rushil Gupta , Joshua Washington Cc: dev@dpdk.org, Ferruh Yigit Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Before this patch, max_rx_pktlen was always set to UINT16_MAX. This, in conjunction with the MTU fix, causes problems with testpmd, as setting the packet length with the --max-pkt-len flag causes the MTU to be set higher than possible due to underflow. As an example, setting --max-pkt-len=1460 (the default MTU on Google Cloud VMs) causes testpmd to set the following: mtu = 1460 - eth_overhead, where eth_overhead = dev->max_rx_pktlen - dev->max_mtu = 65535 - 1460. Thus, mtu = 1460 - 65535 + 1460 = 2921 due to underflow. Signed-off-by: Joshua Washington Fixes: 030025b74202 ("net/gve: fix max MTU limit") Cc: joshwash@google.com --- drivers/net/gve/gve_ethdev.c | 2 +- drivers/net/gve/gve_ethdev.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c index b441f96623..eb3bc7e151 100644 --- a/drivers/net/gve/gve_ethdev.c +++ b/drivers/net/gve/gve_ethdev.c @@ -297,7 +297,7 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues = priv->max_nb_rxq; 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_rx_pktlen = priv->max_mtu + RTE_ETHER_HDR_LEN; dev_info->max_mtu = priv->max_mtu; dev_info->min_mtu = RTE_ETHER_MIN_MTU; diff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h index 1cba282128..755ee8ad15 100644 --- a/drivers/net/gve/gve_ethdev.h +++ b/drivers/net/gve/gve_ethdev.h @@ -21,7 +21,6 @@ #define GVE_TX_MAX_FREE_SZ 512 #define GVE_MIN_BUF_SIZE 1024 -#define GVE_MAX_RX_PKTLEN 65535 #define GVE_TX_CKSUM_OFFLOAD_MASK ( \ RTE_MBUF_F_TX_L4_MASK | \ -- 2.42.0.655.g421f12c284-goog