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 C7E6345B67; Fri, 18 Oct 2024 05:42:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B087C40265; Fri, 18 Oct 2024 05:42:11 +0200 (CEST) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 3BA7D402EB for ; Fri, 18 Oct 2024 05:42:10 +0200 (CEST) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-7ea7e2ff5ceso1363982a12.2 for ; Thu, 17 Oct 2024 20:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729222929; x=1729827729; 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=c3AgHQ9LQIRQVts0Ek/ShHHlJR4tWKA+oTxqc9SBd7A=; b=dgq5T86uKp9UOCcm9uywbxgZj9+FD6/a0IlyO0DOZQSRftYtPNZArZjUAc+74zmQhT 2e73517yM0AaPUwfa60afvIdpSVwXvcoeQkDSH/OEf3qf/1NAMiWjeZUMUut5Fcgzrxi BzWjCmE2s2STxgVsX0DmiXuNeJx41XR7AcIqhPFh8N/j9V51fYiDiOYW/lxUg/h/ky7d hzjUwwkpoMvXEVF72CVBXGr15/zKAyh5XaU9JWtvv9+n39XFHX0lDdolBjHzed80qrta g2ysOO1Rd85BfPi/4BsiMhfoJ0JH9WTA1myaohHTvFFAuDMZ4LKJCRL9P/RDDTc8ZOLG MRRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729222929; x=1729827729; 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=c3AgHQ9LQIRQVts0Ek/ShHHlJR4tWKA+oTxqc9SBd7A=; b=uV/uyhWe/8kYhWCttxrqNmHyjswykAD/gsyTo7QTaBbXdMXui1aye8q0ne4tIW1qco rsCanJW0YpfNngci8SIVxvy3ghc5EFmBIsrsz8SMdf8Hr5ZbG1PuCypUskm9rFD7K68w woipFkPwjW9UbQKREwKWlUaz0Romg+pgZOVGcvV+AjYmaLcuxvzC4UoJu7wECmDlpCqP 4iBwCRnOQ8M6jgAOGUbL6wy1jjfLDi3vwvK0qIrRhiRp9o3DKHOfuagugR759l+2bJru BDg7phUqFEHxgdm+je3UYpMPeMN3oS1Jiy2gARCFo1FOJqeXqls4vMQaQxtB+ngJI+0J 2Kzw== X-Gm-Message-State: AOJu0YzCNQWYgVzYMn762XZOsspBJWKymNbpemSZ4FEOc53DaJgdftOv w4b0X0UlO7XBSQAYgQclOd7UZwNbOcS9p7DiwhHBbVJ9WuQYLqlEj1bGolk/O425G/BP+KMT48k 6 X-Google-Smtp-Source: AGHT+IGKIyA19jUB2kEO8kqPBCEx7zsLWKEupBKuOKhGAkCs9z/Wc4O6DCfrWuXbX7DI5N1NFkn9yg== X-Received: by 2002:a05:6a20:ac43:b0:1d9:26b7:6b8 with SMTP id adf61e73a8af0-1d92c50ff4bmr1648728637.23.1729222929364; Thu, 17 Oct 2024 20:42:09 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20e5a90f212sm3706975ad.257.2024.10.17.20.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 20:42:09 -0700 (PDT) Date: Thu, 17 Oct 2024 20:42: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: <20241017204206.2dc20546@hermes.local> In-Reply-To: References: <20241016082232.4005800-1-chaoyong.he@corigine.com> <20241018024253.4075609-1-chaoyong.he@corigine.com> <20241017195916.656dacc6@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 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. 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