From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id DD6111B00B for ; Thu, 4 Jan 2018 08:56:50 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2018 23:56:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,506,1508828400"; d="scan'208";a="192130069" Received: from debian-xvivbkq.sh.intel.com ([10.67.104.226]) by fmsmga005.fm.intel.com with ESMTP; 03 Jan 2018 23:56:48 -0800 Date: Thu, 4 Jan 2018 15:56:21 +0800 From: Tiwei Bie To: Xiao Wang Cc: dev@dpdk.org, yliu@fridaylinux.org, stephen@networkplumber.org Message-ID: <20180104075621.qr4i6dhgow6utcgw@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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1515081578-30649-3-git-send-email-xiao.w.wang@intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Subject: Re: [dpdk-dev] [PATCH v4 2/3] net/virtio: add packet injection method 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, 04 Jan 2018 07:56:51 -0000 On Thu, Jan 04, 2018 at 07:59:37AM -0800, Xiao Wang wrote: [...] > +void > +virtio_inject_pkts(struct rte_eth_dev *dev, struct virtnet_tx *txvq, > + struct rte_mbuf **buf, int count) > +{ > + struct virtio_hw *hw = dev->data->dev_private; > + > + hw->special_buf = buf; I think maybe you can give it (hw->special_buf) a better (more meaningful) name. You don't need to put txvq in the param list based on your current implementation. Otherwise, you need to make special_buf be per-queue variable. > + dev->tx_pkt_burst(txvq, buf, count); > +} > + You need to zero the hw->special_buf after calling tx_pkt_burst(). You should also return the retval of tx_pkt_burst() to the caller. Thanks, Tiwei