From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v4 2/3] net/virtio: add packet injection method Date: Sat, 6 Jan 2018 12:41:01 +0800 Message-ID: <20180106044100.o3fgg3mggkap2rc5@debian-xvivbkq.sh.intel.com> References: <1515051700-117262-3-git-send-email-xiao.w.wang@intel.com> <1515081578-30649-1-git-send-email-xiao.w.wang@intel.com> <1515081578-30649-3-git-send-email-xiao.w.wang@intel.com> <20180105122737.52c69b1a@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: Xiao Wang , dev@dpdk.org, yliu@fridaylinux.org To: Stephen Hemminger Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 056D11B01D for ; Sat, 6 Jan 2018 05:41:29 +0100 (CET) Content-Disposition: inline In-Reply-To: <20180105122737.52c69b1a@xeon-e3> 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 Fri, Jan 05, 2018 at 12:27:37PM -0800, Stephen Hemminger wrote: > On Thu, 4 Jan 2018 07:59:37 -0800 > Xiao Wang wrote: > > > This patch adds dev_pause, dev_resume and inject_pkts api to allow > > driver to pause the worker thread and inject special packets into > > Tx queue. The next patch will be based on this. > > > > Signed-off-by: Xiao Wang > > Why is this needed? It isn't obvious what the mechanism is trying to solve. Xiao needs to use such mechanism to send some special packets (RARP packet) in the interrupt handler to implement the GUEST ANNOUNCE feature. To avoid the contention between user's Tx threads and the interrupt thread. He needs to pause user's Tx threads (by reusing the existing 'started' flag in `virtio_hw`) first, and call tx_burst() to send the RARP packet. He already provided the pause() and resume() functions, but the implementation of sending the RARP packet (add a field named as `rarp_buf` in `virtio_hw`, and check it in tx_burst() functions) is too specific. So I just suggested him to give rarp_buf a more generic name and provide a simple wrapper of tx_burst for internal use: http://dpdk.org/ml/archives/dev/2018-January/085213.html Is it OK to you? Or do you have any other suggestions? Thanks! PS. The latest version is v5, below is the link: http://dpdk.org/ml/archives/dev/2018-January/085354.html Best regards, Tiwei Bie