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 D1A5CA0588 for ; Tue, 7 Apr 2020 17:39:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEC301BE8E; Tue, 7 Apr 2020 17:39:25 +0200 (CEST) Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by dpdk.org (Postfix) with ESMTP id DA1EF2B86 for ; Tue, 7 Apr 2020 17:39:22 +0200 (CEST) Received: by mail-pj1-f67.google.com with SMTP id q16so1249714pje.1 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=g4VXJqq3873HWKx14GLegfVLlq6lcvmNzNSfKaAShYpkLtTI5qeofrS5cQyGf/Q1kz edtqNeksv0/eokUgpAD0SX5kCR7KKwsAT/jWEHUmhRDeK0kZcBf28E/6iL4ZbYev42Ks lB7A3XUjwIKv72WBrxwuM7LAuik7q6kyN5Q/OV3hDSzgk8vEjOWeW8+rAzkdDXmX4Gdd 9dPsovrd7GDdEXNKZrsVyr8MPEpXdp+MqigpXz2zCoMeEUOboKXTtBJrIbFpBuL2Rj9B d0nA2TfVab6p69Y8ZGu4I+78b6gd00gRbr7sVj55cbq36FCQl/ykLyQ+jyuVTb43nBSW e3bA== X-Gm-Message-State: AGi0PuYc+GQeCxrq3BAINbRflxWvKComkryN0P6/dhaMNq6RGKb1WgOQ QI6kLXhDW3JcAxRIZbwsT5p3MQ== 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-stable] [dpdk-dev] [PATCH v3 3/5] net/tap: fix check for mbuf's nb_segs failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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)