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 7EBEB43183; Tue, 17 Oct 2023 00:58:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F062640285; Tue, 17 Oct 2023 00:58:55 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by mails.dpdk.org (Postfix) with ESMTP id 90933400D5 for ; Tue, 17 Oct 2023 00:58:54 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id 41be03b00d2f7-5b7f3f470a9so394371a12.0 for ; Mon, 16 Oct 2023 15:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1697497133; x=1698101933; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=15g44CSYxGCvQppPVIqaAbctI1qnZP1aE/CdbBQWDrU=; b=RDWv4uwbd8Yw1kcQbfGb+wcXU7K/PvG/tqH0gOKS/fhVu1XpdF+D4a3Ltg0wza0RRB rFHuRC6+W1nIxsrVNt0E4Wax4Yq9nUoxKyUMxOJeXHhz/FeYiuqilEBqzPpnGcMGf+QA 8WvoIawjBzqGO1B70yl6m5cG5HtU+Wv8dZeAO7VQCli1cPUH8OgkAZYhN6+YqSWzDnSs 6Foo48g4Fxx2f/Wl6C4frZ2ObBNdAEpWZybsE/HSw2grkkvixn9LJUKMuYu21f/4axA+ R9lvfqTHgU1eT0z2W+IAIOIWPcyWzeuw9Bz3n+wU7sz4UJrwV/KH6gEmQibRxlSzoDTt nIug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697497133; x=1698101933; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=15g44CSYxGCvQppPVIqaAbctI1qnZP1aE/CdbBQWDrU=; b=mr+p9qtRAXe4JLsN/StQDjYI0v8cnq7V6op9m9Ao+KsnvyUWAFm8AnU9P8BGvjd6+8 SNr5Er2y4aIkphB2xew+PM3BT1SPZqcz45V9dTes2uhypwNwpbVWHiAN8SdyiovEc4St 8EprbKU3PdHRUWdikaAmrPmqfMof9B5Cu7y7xcHjqnvBBmHpKvY05oP7Ne2mOo+AyeiW c7EUQYVzPikeoYs+qxJXqvfpSqUCYRn56iOT8qakhBUrJiafHlUjVlGfo0CVKQEDFNXY i0mHZz+AfxyHCbXerx5kiWCLsADg1VKckTnZAVFmlunG+Me2DCFHiGCwDwxGnbSRlJpD 2SWQ== X-Gm-Message-State: AOJu0YxtoYhNjOh3Fq7CCIBMq99ww3VX0Y76eUQNFUzhR/uKUl1C2vRq 3AvgG1Cu5zKnN8JCohCu+YLyGw== X-Google-Smtp-Source: AGHT+IH/Co2FInUbzg8afuM8nQxLDVv/XHgHawy3drhmDbXZTlkoQCVIS6gBjnWFrppda5HGkYCTdA== X-Received: by 2002:a05:6a20:938f:b0:154:6480:83b4 with SMTP id x15-20020a056a20938f00b00154648083b4mr438519pzh.14.1697497133352; Mon, 16 Oct 2023 15:58:53 -0700 (PDT) Received: from hermes.local (204-195-126-68.wavecable.com. [204.195.126.68]) by smtp.gmail.com with ESMTPSA id e1-20020a170902744100b001b8b45b177esm130764plt.274.2023.10.16.15.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 15:58:53 -0700 (PDT) Date: Mon, 16 Oct 2023 15:58:51 -0700 From: Stephen Hemminger To: Joshua Washington Cc: Junfeng Guo , Jeroen de Borst , Rushil Gupta , dev@dpdk.org, Ferruh Yigit Subject: Re: [PATCH] net/gve: Update max_rx_pktlen to be based on MTU Message-ID: <20231016155851.32978666@hermes.local> In-Reply-To: <20231016205948.2252342-1-joshwash@google.com> References: <20231016205948.2252342-1-joshwash@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 16 Oct 2023 13:59:48 -0700 Joshua Washington wrote: > 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 Never mind, previous comment. You are correctly doing the inverse of this common code pattern. In testpmd: static uint32_t eth_dev_get_overhead_len(uint32_t max_rx_pktlen, uint16_t max_mtu) { uint32_t overhead_len; if (max_mtu != UINT16_MAX && max_rx_pktlen > max_mtu) overhead_len = max_rx_pktlen - max_mtu; else overhead_len = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN; return overhead_len; }