From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 179E3A053C; Thu, 30 Jul 2020 11:56:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A2AC1C00F; Thu, 30 Jul 2020 11:56:19 +0200 (CEST) Received: from mail-m972.mail.163.com (mail-m972.mail.163.com [123.126.97.2]) by dpdk.org (Postfix) with ESMTP id B403811A2 for ; Thu, 30 Jul 2020 11:56:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=Z0xEf AcIlG7UazUOoxO0z8+F9G+0Lb/6Ky1JI6Ak4OA=; b=g/80qYG9QsUAVWw2GkmHC 98SgP4rjOUCtgBNk23BbdpNsYN52V90lET8jmgCCgyt8UFsSLJh9BFPb+TJfUpfU aw3EyR5N+tok5vqDGVrFdEWuaDQXjGRTWCKmKU0WX97HFQYc9ZVU1nuH38cjBu6X 4TQhV943zvoYf9sqZE6LwI= Received: from yangyi0100.home.langchao.com (unknown [111.207.123.56]) by smtp2 (Coremail) with SMTP id GtxpCgCXFdk6mSJfhBGTHg--.3074S3; Thu, 30 Jul 2020 17:56:11 +0800 (CST) From: yang_y_yi@163.com To: dev@dpdk.org Cc: jiayu.hu@intel.com, thomas@monjalon.net, yangyi01@inspur.com, yang_y_yi@163.com Date: Thu, 30 Jul 2020 17:56:08 +0800 Message-Id: <20200730095610.93384-2-yang_y_yi@163.com> X-Mailer: git-send-email 2.19.2.windows.1 In-Reply-To: <20200730095610.93384-1-yang_y_yi@163.com> References: <20200730095610.93384-1-yang_y_yi@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: GtxpCgCXFdk6mSJfhBGTHg--.3074S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7JF1rJrWruF1UGF4fAFyxZrb_yoWDKFc_ua 4FkF1ktay7Jr4xZw43Jw4Yga1xurW7Aa18Ww4Igw45Xr4qgFsxu34DJr42qFWDu3yUGFWx WF43uFn2yr1FvjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjFAp7UUUUU== X-Originating-IP: [111.207.123.56] X-CM-SenderInfo: 51dqwsp1b1xqqrwthudrp/xtbB0htxi1UMX9WQMQAAsB Subject: [dpdk-dev] [PATCH 1/3] gso: fix refcnt update issue for external mbuf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Yi Yang 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 --- 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