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 1D652A04A4 for ; Wed, 2 Mar 2022 10:46:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 051C642715; Wed, 2 Mar 2022 10:46:59 +0100 (CET) Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) by mails.dpdk.org (Postfix) with ESMTP id 991A440141 for ; Wed, 2 Mar 2022 10:46:57 +0100 (CET) Received: by mail-yb1-f173.google.com with SMTP id u61so2122754ybi.11 for ; Wed, 02 Mar 2022 01:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarao.ac.za; s=google; h=mime-version:from:date:message-id:subject:to; bh=Xskd9J6aWBJkBl/d63ElLkYUkGavxsqAVSHDgniIZNM=; b=AUBsytG4VGO+TAIZKLTWez4wXhDonx7EyBYK5kT2Kx7cvxXtEM3TbribVu5x5AhYzl rOqCqKwxM3nH4CuLwMU5SakSp/SkZvcjQCWEIGrfrkvXn9nNuTdP7/iMz/1hmsgUtVcb SdYbWb7YMgLenHmF7kxh07n0pp/hN0N+KrC3daJo0BCjrvhZjJSkq9V3arksKihJYJDD 3DOliAgew7AJXwIWdoRlcwT8GAb1pvPh/Szprh+LG8K9lK+Q6F5A4hoNtyh/7sS6eNxu vYbsDLSkuplKYUDYPSB1R5uHJKYb5QkqcCq9IAyzmKuArkStDwGrYWDrylw3GILKlKg1 OcTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Xskd9J6aWBJkBl/d63ElLkYUkGavxsqAVSHDgniIZNM=; b=FDv/j2fvvpJ6sxZCmsjMXNhJcDhL3c3FYAN7aWmE4840YkpMklhZdREQW9jx/EMKRl 8Y2fgPlu8j97eAj/GGGr1L4EDxMsqXNVQ8uQDwTB8SgqITcmrpMt1WY8ufqvW653clUn TRt5CyaX8lINjjlKNo6Lmnjzn1Y7XZiNCbQH+2oniXQOPaQSXiN2txZ536RM0J5SzsQo MnP2fswsya2N3IzqVitxYP5SE4AoG+y6TtgOOCOk0ocgRooYBe8CPGh9NtnFysrrYr6P HLaF+d2tDLxK0E8c1ujBtki6XpQNjvgXlPCW9V/OfEgpv+5y6dNB+QMEH8RON/SqyC6t WBOQ== X-Gm-Message-State: AOAM531fvWt2HdrmlXdTz3n57ZELQm+XEZJ1M+/U3+MTQ1r4fe1FDUJy UfJoMVRmd4XfVrzJIvUluUp8aYmvddn17aE7ibtKzDfjQFRRgQ== X-Google-Smtp-Source: ABdhPJyNpj+cVm5DXDWSo/P3TWtnMqP9EFb+KH9QHopl54nwjbbt0rbj4VXe9UZiBoYIrGVJca7jnYRgKmBE042t5JI= X-Received: by 2002:a5b:ec1:0:b0:624:64d2:560e with SMTP id a1-20020a5b0ec1000000b0062464d2560emr28613903ybs.351.1646214416800; Wed, 02 Mar 2022 01:46:56 -0800 (PST) MIME-Version: 1.0 From: Bruce Merry Date: Wed, 2 Mar 2022 11:46:46 +0200 Message-ID: Subject: Understanding extbufs for transmit To: users@dpdk.org Content-Type: text/plain; charset="UTF-8" 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 Hi I'm new to DPDK. I'm looking at adding a backend to a high-level library (https://github.com/ska-sa/spead2) that currently has a backend using ibverbs raw ethernet QPs for kernel bypass (on mlx5 hardware). One of the features of the high-level library is that when transmitting data, the user can point at arbitrary memory they've allocated and get zero copy, provided they pre-register memory regions first. The ibverbs backend maps the pre-registration to ibv_reg_mr, and when constructing packets it uses a segmented work request with one segment pointing at headers (in internally-managed memory) and other segment points at the user-provided memory for the payload. I'm trying to understand if I'll be able to support the same thing in DPDK, given that it seems to be geared to allocate memory for packets from mempools. It looks like mbuf's can be chained to construct a packet from non-contiguous data, and I see there are some functions like rte_pktmbuf_attach_extbuf that look promising, but I haven't yet found any high-level documentation that explains how to use it. For example - What happens to the original memory of the mbuf - is it just wasted memory? If so, should I be creating a mempool with small mbufs (just enough to hold packet headers)? - How do I pin the memory? Is rte_extmem_register the equivalent of ibv_reg_mr? It's not clear what "registering" memory with DPDK actually does. - How should I compute the iova? (in ibverbs, the driver is normally responsible for dealing with any address mapping) Thanks Bruce -- Bruce Merry Senior DSP Engineer SARAO