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 09456A0577; Tue, 7 Apr 2020 17:39:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 613162B96; Tue, 7 Apr 2020 17:39:24 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id DEDEC2B96 for ; Tue, 7 Apr 2020 17:39:22 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id ng8so916665pjb.2 for ; Tue, 07 Apr 2020 08:39:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6bpmeNiRlcSwrvykYFLlzLFC2TaPXX/+nh36gWxu/ms=; b=zM10FUVf3dnQEnJnS9pnXYd8ILkoGkIU9fvkDIFclzwXzMi2+zZXeA2qi1BLYHY0V1 mAEtWH5fZXsbSvRsh03WsFEz6WA7O0V435vHxegyVs41pyABLnnILERYx4BJSEFSwRfi lBkytnMq7FKbV8aB/7IqXAasB19hWKfEfjzj8NcAqenmO32LI46DR79Bcce4eQoyrLjz 9NjFP5nZPFu7RT92rceXReG4aFZ86C8UGTsmZ0nWmJRnAZA42yzVhfrt4D3UI4zAW4DP ccSO755Q6clxSoSIQ7dp6gNBT2PI32NYqYSO2jRu5ZLW/TQw2f+AnT7b8Ws8xB/g/OUF 2IHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6bpmeNiRlcSwrvykYFLlzLFC2TaPXX/+nh36gWxu/ms=; b=JGQ6YPTXEl5Z7+/Ur1yAgyPxA3ad5Q1upKCAWTH9Db4GHHwAXb7LBA8TnXyBrvPlRm PRBP+ZB3vtMBu+6N7Vlc9tV8zQgx89M9Rl1nW6rVutZgTItvB/nO4yGkxUBZPOBNs7ey EUghv+zmJ44TGas9RO+ySJarygpdwUTDNTPK4eMm6fqZ1s5/JCs7SLr6uyTx2ScE/G4k t+eep4p2H1vbmOdYGAlTrXPwS6bwZjSRU03qhxaf2f9rT2C15qCqNy20fVMOxeIQHt9X cJ16Hp/OxBB2GOpQYaq4tfUEYRhDvPgf8hx9jqqhWaPsxfs2BoJUJM5dTTmr6lRMGBmd FsRw== X-Gm-Message-State: AGi0PubUjEDz6w0alsRdgk2XM+uoOeabhFg8VdMgRCk2lHad3I8xQ1Z/ JZd9kOv/CatHGPbq2WjOjk90UA== X-Google-Smtp-Source: APiQypI6EN9KeH8zZtELV50N2OonHslT2ARfpqDTRydoLHfPrTCRSqRyUnCEYim80Lad1CFkF5RS3Q== X-Received: by 2002:a17:902:8643:: with SMTP id y3mr2951474plt.149.1586273961922; Tue, 07 Apr 2020 08:39:21 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b17sm14490617pff.81.2020.04.07.08.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 08:39:21 -0700 (PDT) Date: Tue, 7 Apr 2020 08:38:46 -0700 From: Stephen Hemminger To: Ferruh Yigit Cc: wangyunjian , dev@dpdk.org, keith.wiles@intel.com, jerry.lilijun@huawei.com, xudingke@huawei.com, stable@dpdk.org Message-ID: <20200407083846.674ca9e4@hermes.lan> In-Reply-To: <7da1388e-c4c6-27d5-f038-0526a39d9a8c@intel.com> References: <1586233383-1084-1-git-send-email-wangyunjian@huawei.com> <7da1388e-c4c6-27d5-f038-0526a39d9a8c@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3 3/5] net/tap: fix check for mbuf's nb_segs failure 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" On Tue, 7 Apr 2020 16:15:16 +0100 Ferruh Yigit wrote: > > +static void > > +tap_rxq_pool_free(struct rte_mbuf *pool) > > +{ > > + struct rte_mbuf *mbuf = pool; > > + uint16_t nb_segs = 1; > > + > > + if (mbuf == NULL) > > + return; > > + > > + while (mbuf->next) { > > + mbuf = mbuf->next; > > + nb_segs++; > > + } > > + pool->nb_segs = nb_segs; > > + rte_pktmbuf_free(pool); > > +} Since mbuf is going to be free, why bother with nb_segs. Since rte_pktmbuf_free takes NULL as an argument, and frees the m->next chain I don't see why not just rte_pktmbuf_free(pool)