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 F3DA6A0032 for ; Tue, 12 Jul 2022 12:31:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9080341109; Tue, 12 Jul 2022 12:31:06 +0200 (CEST) Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by mails.dpdk.org (Postfix) with ESMTP id 0CCAD400D4 for ; Tue, 12 Jul 2022 12:31:05 +0200 (CEST) Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-f2a4c51c45so9788112fac.9 for ; Tue, 12 Jul 2022 03:31:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RAtpRF349OOn9GnNiGvNTJy540t1BtXIj23qJjtUfmQ=; b=Thca20Zdt7H6k9N1Dd/b+40eexKZZDvH6afsEvrR/1/2LCiEXwIbwLPDNb6oDplump 3Y3ocMyI8gdX+6sfxBaEgBDhq8X9yBY0CsDVuLIWSX6JoQykFtQydMI57G0UQqFEQqng +QIXTBdVoJZM0DoocRbnvfiEqHUqhKL5ISiVJ/KxbOM4+5Z38KvrVxoFbyUUHQs+Fwod +8EYB5THp+ok4nFk2WOSWccUptihbF/GzawK/nqHyhnBxAGo7P/ueIVXpLZ536ck8HrW 91bBm2LOkCkZazx0sGC4qoZ7fjXv3y2iZwq661bLZ1rHufD606dM0RZy2BpZ2JeZwp7l Fs4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RAtpRF349OOn9GnNiGvNTJy540t1BtXIj23qJjtUfmQ=; b=mk6KxJrN5d2ZEAYqr5GVJ+Np5/T/sJFQiz6qimdpbOrWo7vzJdan5ds9RDCYYYSN8l JQnbVI+Quxz0uc9o1gHo92V0cHUw5dOjNSlbPfE0DjeAVz1hX22UNO6hJnxFbLLLGJjj NzQFH6aPLSWKpQoe4dtNHdrbF3vuNAr+6fizSvgIWEkwh7DTuggpEEKYzvj45oUIlV/M 9XX4TD+OWO8iwo3bO4ZYk91WKV8L0y3zc4sA0fP30/VJVTsdVslXOY5aac3QW8U3oCQ7 A7zWX/p2I7NBJ49JQr94YucRxdYHyj0Giv2VoWwBMO0ps7rDEDj74HZfecvGI89cqnZl fGqg== X-Gm-Message-State: AJIora/DTOFyIHRorTMvmqpfjuY39VND6jG8DV29a3kyYsualweXYkIv Uf5zshoNotlJsdTfnXtRGBNWrgGI+2YJfRPdNRQ= X-Google-Smtp-Source: AGRyM1t18PpaokcB5U4EvuInCAKEh+UWcrK96ec5B34ZmdJMo7a2IY/h1Om/vnHwnJOBszIVT03yWP23lC/lNwrnJDs= X-Received: by 2002:a05:6870:f203:b0:108:4a52:da42 with SMTP id t3-20020a056870f20300b001084a52da42mr1316879oao.59.1657621864317; Tue, 12 Jul 2022 03:31:04 -0700 (PDT) MIME-Version: 1.0 References: <20220712113234.1209dd36@sovereign> In-Reply-To: <20220712113234.1209dd36@sovereign> From: Antonio Di Bacco Date: Tue, 12 Jul 2022 12:30:53 +0200 Message-ID: Subject: Re: Getting mbuf pointer from buf_addr pointer To: Dmitry Kozlyuk Cc: 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 I was asked to reproduce the exact same behaviour of a library that used VMDQ queues without DPDK. Now this library offered an API to allocate a buffer for a packet and returned an address where the application could write its data. void* vmdqNew (vmdqUidPOOLt* p); I implemented the same API to allocate an MBUF from a pool and I also return the right address as a void* but then to transmit the packet I need the address of the MBUF for the tx_burst API and I don't have it. On Tue, Jul 12, 2022 at 10:32 AM Dmitry Kozlyuk wrote: > > 2022-07-11 11:21 (UTC+0200), Antonio Di Bacco: > > Is there any API that allows me to get the MBUF pointer given its > > buf_addr pointer? > > No. > > How did you come across this need? > Sounds like an app design flaw. > What is the original problem you're solving? > > P.S. It may be possible in specific cases when you know (from code) > how mempool sets buf_addr for a given mbuf, > and that PMDs don't change buf_addr with the used set of offloads. > Apparently, this approach would be extremely brittle and dangerous.