[dpdk-dev] [PATCH v4 1/2] mbuf: add function returning default buffer address

David Marchand david.marchand at redhat.com
Fri Jan 11 09:32:52 CET 2019


On Fri, Jan 11, 2019 at 9:11 AM David Marchand <david.marchand at redhat.com>
wrote:

> On Thu, Jan 10, 2019 at 11:40 PM Yongseok Koh <yskoh at mellanox.com> wrote:
> diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
>
>> index bc562dc8a9..5787616999 100644
>> --- a/lib/librte_mbuf/rte_mbuf.h
>> +++ b/lib/librte_mbuf/rte_mbuf.h
>> @@ -788,8 +788,54 @@ rte_mbuf_from_indirect(struct rte_mbuf *mi)
>>  }
>>
>>  /**
>> + * Return the default buffer address of the mbuf.
>>
>
> Nit: missed it... s/default //
>
> + *
>> + * @warning
>> + * @b EXPERIMENTAL: This API may change without prior notice.
>> + * This will be used by rte_mbuf_to_baddr() which has redundant code once
>> + * experimental tag is removed.
>>
>
> Good point.
> I wonder if we have a "todolist" for release n+2 so that we don't forget
> about such things to do.
> Thomas ?
>

Maybe we could have something explicit in rte_mbuf_to_baddr that would
avoid it "inherits" the experimental tag.

@@ -844,9 +844,13 @@ struct rte_mbuf_ext_shared_info {
 static inline char *
 rte_mbuf_to_baddr(struct rte_mbuf *md)
 {
+#ifdef ALLOW_EXPERIMENTAL_API
+       return rte_mbuf_buf_addr(md, md->pool);
+#else
        char *buffer_addr;
        buffer_addr = (char *)md + sizeof(*md) +
rte_pktmbuf_priv_size(md->pool);
        return buffer_addr;
+#endif
 }

 /**


-- 
David Marchand


More information about the dev mailing list