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 AD73F423AC for ; Wed, 11 Jan 2023 12:26:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33D1B40691; Wed, 11 Jan 2023 12:26:04 +0100 (CET) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mails.dpdk.org (Postfix) with ESMTP id 986354014F for ; Wed, 11 Jan 2023 12:26:02 +0100 (CET) Received: by mail-lf1-f42.google.com with SMTP id b3so23049280lfv.2 for ; Wed, 11 Jan 2023 03:26:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=eevRdIf6BgxQm9kh3EBLszZznm/mpPaamxIna7I2nv8=; b=WcrY3JLhe4M1eLrV44cGeUq/MX7nz1R/3Igs9E0wTgSBeOpre7i3aJ6w+vcZpdWuRM CcuchUo+6nXmIgcmM4Bw9iQRGvhKCE0iUJNskH7XeMUzCLoVfADhTtSIlwPz0znB3BpV hfzIpBmHHldo6bfTEnL2pEhc5UPTzdzEZobq2ZlyCeqFSd4FAxqbCxLkdIlFQB8zVqNW t/unfso/muniSIpizohDe/46EK5BEY3D/Ibz3KTiUiL/9CA8ARBCPiC1PIfDviaa670j f5qewkphyyLy4/4ZJjQNuJT/JBkfSI9iDNHMDTQEkMCMXsZdJEczyjyoHq35cd83+Dwo TZ7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eevRdIf6BgxQm9kh3EBLszZznm/mpPaamxIna7I2nv8=; b=tQk4CbcTyf1jBGW/LR+wn6j2tNVE1CD/jhkdTVB8Hgv5KtmSfspQDUB8nHf0B0Qh2Y vu0E8JM5KvwplwRqiZCc32ii9SysAsEhxx+WVbKk9uNy41nz5JTAzgzmZsi4ISsdNEkr t1S3FALuZQe/97ebRDM6DW3Y7hPTDD4gf9HZozA4cys4sBWAP/DCLxwWCi7tK1gS3v3b gSLQNYDAtku425hKZ1ZLfFv23oXwqEH+SzSOXzpwuwVHWnZHDAluVESYFnHzsMmpNt8t UAPM5HhEwwSgjuRGMadiq0fnwPdeAMkGtNLfV2XNv6yE+pzOKDGFDFXuaf9GDHUrtmyI X2Nw== X-Gm-Message-State: AFqh2krSNkI2PKIR5IGDwlGGUwBk37lMb9Oj6eTZFovaCzzSr0+GwYoO /AwbcUE9lvKhP2lMBl6snwk= X-Google-Smtp-Source: AMrXdXs/CCr4cBUFQd+/gH9rHVUO2E8fs9vbg5TamsKmKjWvty4KaPpNOU/E9542VWWj9nMzUZLrwg== X-Received: by 2002:a05:6512:694:b0:4cb:436b:a70f with SMTP id t20-20020a056512069400b004cb436ba70fmr8953927lfe.64.1673436361871; Wed, 11 Jan 2023 03:26:01 -0800 (PST) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id m10-20020a056512358a00b004cb0242704asm2663273lfr.255.2023.01.11.03.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 03:26:01 -0800 (PST) Date: Wed, 11 Jan 2023 14:26:00 +0300 From: Dmitry Kozlyuk To: fwefew 4t4tg <7532yahoo@gmail.com> Cc: users@dpdk.org Subject: Re: DPDK and DMA Message-ID: <20230111142600.221cdc2e@sovereign> In-Reply-To: References: X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org 2023-01-08 16:05 (UTC-0500), fwefew 4t4tg: > Consider a valid DPDK TXQ with its mempool of rte_mbufs. Application code > will allocate a mbuf from the pool and prepare it with headers, data, and > so on. > > When the mbuf(s) are enqueued to the NIC with rte_eth_tx_burst() does DPDK > DMA the memory into the NIC? Is this an optimization worth considering? DPDK is SW running on CPU. DMA is a way for HW to access RAM bypassing CPU (thus it is "direct"). What happens in rte_eth_tx_burst(): DPDK fills the packet descriptor and requests the NIC to send the packet. The NIC subsequently and asynchronously uses DMA to read the packet data. Regarding optimizations: 1. Even if the NIC has some internal buffer where it stores packet data before sending it to the wire, those buffers are not usually exposed. 2. If the NIC has on-board memory to store packet data, this would be implemented by a mempool driver working with such memory. > DPDK provides a DMA example here: > http://doc.dpdk.org/api/examples_2dma_2dmafwd_8c-example.html > > Now, to be fair, ultimately whether or not DMA helps must be evidenced by a > benchmark. Still, is there any serious reason to make mempools and its > bufs DMA into and out of the NIC? DMA devices in DPDK allow the CPU to initiate an operation on RAM that will be performed asynchronously by some special HW. For example, instead of memset() DPDK can tell DMA device to zero a memory block and avoid spending CPU cycles (but CPU will need to ensure zeroing completion later).