[v2] mbuf: fix API to copy mbuf dynamic fields
Checks
Commit Message
Fixed rte_mbuf_dynfield_copy() API to copy dynamic fields from one mbuf
to another. When RTE_IOVA_AS_PA is not defined during the build, an
additional dynamic field (dynfield2) becomes available. This field
should be conditionally copied to ensure the complete duplication of
dynamic fields between mbufs. This patch fixes the same.
see https://bugs.dpdk.org/show_bug.cgi?id=1472
Bugzilla ID: 1472
Fixes: 03b57eb7ab9a ("mbuf: add second dynamic field member")
Cc: stable@dpdk.org
Signed-off-by: Shijith Thotton <sthotton@marvell.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2:
- Moved copy of dynfield2 before dynfield1.
- Added Reviewed-by and Acked-by tags.
lib/mbuf/rte_mbuf.h | 3 +++
1 file changed, 3 insertions(+)
Comments
27/06/2024 09:57, Shijith Thotton:
> Fixed rte_mbuf_dynfield_copy() API to copy dynamic fields from one mbuf
> to another. When RTE_IOVA_AS_PA is not defined during the build, an
> additional dynamic field (dynfield2) becomes available. This field
> should be conditionally copied to ensure the complete duplication of
> dynamic fields between mbufs. This patch fixes the same.
>
> see https://bugs.dpdk.org/show_bug.cgi?id=1472
>
> Bugzilla ID: 1472
> Fixes: 03b57eb7ab9a ("mbuf: add second dynamic field member")
> Cc: stable@dpdk.org
>
> Signed-off-by: Shijith Thotton <sthotton@marvell.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Applied, thanks.
@@ -1119,6 +1119,9 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
static inline void
rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
{
+#if !RTE_IOVA_IN_MBUF
+ mdst->dynfield2 = msrc->dynfield2;
+#endif
memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
}