From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 0E04B1B326; Thu, 18 Jan 2018 15:05:03 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id AD85C20CB2; Thu, 18 Jan 2018 09:05:01 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 18 Jan 2018 09:05:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=9rBN++T3GwEhjeE8Wvp23UOkE29GczM30yfethN3cyw=; b=LIsAkeXD lOK9WbEb2nbra6alqk2hXwG/TQEEi52Zunbu4tyaXfES/zteGPhIV+ksHdeeNXE8 plGyemJhk9g5yfnRj0aVc9DRBM95+xHm9pzcNril8Yu+e/qG25seOqJaBO7u2MOd EsXyfIh3jrsmU+Ip5reQ4JnMpQYVlRS3jr2beXfJYjInF7Mnj3FX9eRyfjpVzFlR iWb6JlaR3O766s/dvEcTFHsy2My5tDCH71FCzjCHZk1XU1m0R4eIpgsxvFMvrUgL QZrX/8seC5uVu6MJnjU4gddcLQ3yKwyfgN4Q3Ernhjvx7ma/XbG4w9LZXHYGGg4I uF9/YpPa/zq4VA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=9rBN++T3GwEhjeE8Wvp23UOkE29Gc zM30yfethN3cyw=; b=UXlMujwR23vfzZugNtfHLYT3hI4kD1uuO36JBduPzdgOr JfEwEu2O9ZUMo1WaV5pTuu+9HjqGppr89Pr/J9tdrBmt5Ng+AVrgWQyI6OLKMENH sb5RVTeu+PySNM+CpGQ4C/HIocU+BOkf2eKK5mALhLPBs7P1QAeFRK9uhegTR+tf oZgAV/xLUI3azr1gujW52ypElzL43lyOxHoZXmxREC4SDl2qjnOtpnFDGLoIHqXT n5SRCPTlDm4sxo2HD6PzRmjXFCpQzWaUVp22S8Pwwee1xi885RVUlmIAZTaZd+1t K+km8cIVQoUSiz/hSNKPQB9NlWvmdFcng4jX12I0w== X-ME-Sender: Received: from yliu-mob (unknown [115.148.90.22]) by mail.messagingengine.com (Postfix) with ESMTPA id 66A9B7E3D7; Thu, 18 Jan 2018 09:05:00 -0500 (EST) Date: Thu, 18 Jan 2018 22:04:55 +0800 From: Yuanhan Liu To: Olivier Matz Cc: dev@dpdk.org, Maxime Coquelin , Tiwei Bie , stable@dpdk.org Message-ID: <20180118140455.GJ29540@yliu-mob> References: <20180118090733.12728-1-olivier.matz@6wind.com> <20180118090733.12728-3-olivier.matz@6wind.com> <20180118132609.GG29540@yliu-mob> <20180118135544.wtvupq3dca6yfxeh@platinum> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180118135544.wtvupq3dca6yfxeh@platinum> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio: rationalize queue flushing 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: , X-List-Received-Date: Thu, 18 Jan 2018 14:05:03 -0000 On Thu, Jan 18, 2018 at 02:55:44PM +0100, Olivier Matz wrote: > On Thu, Jan 18, 2018 at 09:26:09PM +0800, Yuanhan Liu wrote: > > Hi Oliver, > > > > On Thu, Jan 18, 2018 at 10:07:32AM +0100, Olivier Matz wrote: > > > Rationalize the function virtio_dev_free_mbufs(): > > > > > > - skip NULL vqs instead of crashing: this is required for the > > > next commit > > > - use the same kind of loop than in virtio_free_queues() > > > - also flush mbufs from the control queue (this is useless yet) > > > > Could we just do "nr_vq = virtio_get_nr_vq(hw) - 1" with a comment that > > CQ is excluded, for skipping the CQ? > > Is "nr_vq = virtio_get_nr_vq(hw) - 1" always valid? > Shouldn't we do this check? > if (vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VQ)) > > Instead, I suggest this: > > queue_type = virtio_get_queue_type(hw, i); > if (queue_type == VTNET_RQ) > type = "rxq"; > else if (queue_type == VTNET_TQ) > type = "txq"; > else > - type = "cq"; > + continue; Yes, this is better. > > > > - factorize common code between rxq, txq, cq > > > > > > Cc: stable@dpdk.org > > > > Could you split the patch two 2: > > > > - one for fixing the crash (skip the NULL vqs). We only need this one > > for stable release. > > - another one for the refactoring > > Yes, do you want them all in the same patchset? I think it's okay. Thanks. --yliu