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 A818F45B94; Mon, 21 Oct 2024 19:07:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78F6D40263; Mon, 21 Oct 2024 19:07:13 +0200 (CEST) Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) by mails.dpdk.org (Postfix) with ESMTP id D36C7400D6 for ; Mon, 21 Oct 2024 19:07:11 +0200 (CEST) Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-7ea12e0dc7aso2943137a12.3 for ; Mon, 21 Oct 2024 10:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729530431; x=1730135231; 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=0RGZqZFqiFX2Fuv9oY5yAymWMDEYyWgVdiDaMjHf6ZU=; b=ajzJjuru6CinWzoXYEdmqbzJn7RhQ93V+DN7VYFWZ5pfScBimz3lbNoQGwWNZxg6MY GAT538GtBFNGlmiyVgQYE5ZPg8Qh3OtGirUXvIUpviPCCTZZMlQECJQlbboXjyCktXyF KU0xPxSkNTQlt+sq61ORVP8NBaI53FKALZSXK2kGBBmdpZPrweA3NX/cWgmcj/0cBJ6D gqhIfrlkltKZ1Lii4ihaVNBCbs6JgqssL2P/qAwIJillkupUHWbIpZAAxUa6yefFz3Y2 /2OZYHsFkPorYj2Gd7Zl1qekaXM8K1TiXNg2nPA6ke5j94LECZz+jUGQAuMUKWLHu6fz 3TrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729530431; x=1730135231; 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=0RGZqZFqiFX2Fuv9oY5yAymWMDEYyWgVdiDaMjHf6ZU=; b=aorK582AJ/tc6eMRrL597FfE2ijz1IIEJ2rHGtNK/NMYMz4QQFbk1YIdvq25pbJyc8 MBw9p8YKkM6m7qbbFPvZIigVpXtBo/6uIL11GPOMV2X0SYPM3abGhVPvefFyr41LqKmQ FjLfgj2Wfh5630jsCP9emEvAbADAvmTYrMcpHhXVgvMQDNzw5jFDH4ABjzQRbQlmgc6t TPWtxcHqfzmVkZlAur5a4l/LN7+WU4M4DKkZb8yhDyAyEXPEQFuFfXTSEJFDJ51+Cy1J De2zfaZ+Tvu9KZxHsvZIvXByP0gDXqPl7G9XfINp4VEL0ip295jsjXTwSvBvqGOMuiux eEkw== X-Gm-Message-State: AOJu0YyI8qOgrbKtDE0JFTcFcnz7sg7Wa6HxnuZ1k2NBP71BHQTG3P7E X3hvwp5Fc61LZD/3xSUIIodVVJ0cWVHt5kOqhnAI4nvB/wtiIajW52YuGPmRthM= X-Google-Smtp-Source: AGHT+IFUuCyFNaGlolFoXzOUUAcIXK4jZR8LssMIYOmKtNn1N1zEiVv32BWOIac1cq2g97MoTdA0IQ== X-Received: by 2002:a05:6a21:2d08:b0:1d8:ae07:bf8 with SMTP id adf61e73a8af0-1d92c56d2c1mr15581438637.31.1729530429358; Mon, 21 Oct 2024 10:07:09 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7eaeab35f8dsm3363277a12.31.2024.10.21.10.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 10:07:09 -0700 (PDT) Date: Mon, 21 Oct 2024 10:07:06 -0700 From: Stephen Hemminger To: Chaoyong He Cc: "dev@dpdk.org" , oss-drivers , Long Wu , Morten =?UTF-8?B?QnLDuHJ1cA==?= Subject: Re: [PATCH v2] examples/l3fwd: support setting the data size of mbuf Message-ID: <20241021100706.1994b924@hermes.local> In-Reply-To: References: <20241016082232.4005800-1-chaoyong.he@corigine.com> <20241018024253.4075609-1-chaoyong.he@corigine.com> <20241017195916.656dacc6@hermes.local> <20241017204206.2dc20546@hermes.local> <20241018085905.1e610ebf@hermes.local> 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, 21 Oct 2024 02:00:55 +0000 Chaoyong He wrote: > > On Fri, 18 Oct 2024 05:50:20 +0000 > > Chaoyong He wrote: > > > > > > On Fri, 18 Oct 2024 03:21:28 +0000 > > > > Chaoyong He wrote: > > > > > > > > > > RTE_PKTMBUF_HEADROOM); } > > > > > > > + > > > > > > > > > > > > Not sure why this is needed? What is the problem with the original > > code? > > > > > > Are you trying to force packets to be segmented? > > > > > > > > > > Actually, we are trying to force packets *not* segmented by making > > > > > the > > > > mbuf size large enough to hold the packets. > > > > > > > > > > In our user case, we start l3fwd app with parameter '--max-pkt-len > > > > > 4000', > > > > and obviously the original logic with RTE_MBUF_DEFAULT_DATAROOM > > mbuf > > > > size will cause the packets to be segmented. > > > > > Which is not what we want, so we add this new '--mbuf-size=4096' > > > > parameter, the mbuf size will large enough to hold even the largest packet. > > > > > > > > > > Do you think this make sense? > > > > > > > > Maybe query the driver, and use the max_rx_pkt_len as input to > > > > deciding the right mbuf size. > > > > > > Sorry, I am not quite understanding here. > > > I can't find 'max_rx_pkt_len' in l3fwd app, instead it's exist testpmd app. > > > Could you please explain a little more about the advice? > > > > In rte_eth_dev_info, I meant the field max_rx_bufsize and there is also > > max_rx_pktlen. > > > > > > > > > If max-pkt-len was 4000 and driver can only take 2K buffers, then > > > > use 2K mbuf size. > > > > If max-pkt-len was 1500 then use mtu + headroom and round up > > Oh, I understand what you mean now, thanks for the clarification. > But the solution you suppose is not flexible enough, thus can't satisfy our needs. > > Follow your example and consider this situation: > If max-pkt-len was 4000 and driver can only take 2K buffers, then > use 2K mbuf size. > > But we want to measure the performance when the mbuf size is 1024 and 512. > > Then there is no way to do this in your solution, I suppose? > > But with our '--mbuf-size' parameter, we can easily do that. > Thanks for your hint, we realized our solution also has a little problem, which not > consider the 'max_rx_bufsize' of rte_eth_dev_info, and we will fix that in the next version patch. It would be best if the default was to choose mbuf size automatically, but since this is a test program having an override is also useful. In general l3fwd is target at usability (less options) and test-pmd is focused on testing (lots of options). There is a tradeoff here. l3fwd should not get as complex as test-pmd or there is no point.