[dpdk-dev] [PATCH V1 1/3] gso: fix refcnt update issue for external mbuf
yang_y_yi at 163.com
yang_y_yi at 163.com
Thu Jul 30 14:08:58 CEST 2020
From: Yi Yang <yangyi01 at inspur.com>
rte_gso_segment will segment original mbuf to multiple
small size mbufs, every mbuf of them has two segments,
the second segment will attach to original mbuf, if
original mbuf is external, rte_gso_segment should update
refcnt of mbuf->shinfo but not refcnt of mbuf. Otherwise,
original mbuf will be invalid on doing sanity check
because refcnt of mbuf is 0.
Fixes: 119583797b6a ("gso: support TCP/IPv4 GSO")
Signed-off-by: Yi Yang <yangyi01 at inspur.com>
---
lib/librte_gso/rte_gso.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/librte_gso/rte_gso.c b/lib/librte_gso/rte_gso.c
index 751b5b6..b5e8b2a 100644
--- a/lib/librte_gso/rte_gso.c
+++ b/lib/librte_gso/rte_gso.c
@@ -83,7 +83,10 @@
if (ret > 1) {
pkt_seg = pkt;
while (pkt_seg) {
- rte_mbuf_refcnt_update(pkt_seg, -1);
+ if (RTE_MBUF_HAS_EXTBUF(pkt_seg))
+ rte_mbuf_ext_refcnt_update(pkt_seg->shinfo, -1);
+ else
+ rte_mbuf_refcnt_update(pkt_seg, -1);
pkt_seg = pkt_seg->next;
}
} else if (ret < 0) {
--
1.8.3.1
More information about the dev
mailing list