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 AFAF1A055E; Wed, 26 Feb 2020 02:51:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 119BF1BFB3; Wed, 26 Feb 2020 02:51:40 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 76AC51BC24 for ; Wed, 26 Feb 2020 02:51:37 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2020 17:51:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,486,1574150400"; d="scan'208";a="231232069" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by orsmga008.jf.intel.com with ESMTP; 25 Feb 2020 17:51:34 -0800 Date: Wed, 26 Feb 2020 01:51:10 +0000 From: Tiwei Bie To: Yifeng Sun Cc: dev@dpdk.org, William Tu , Maxime Coquelin , zhihong.wang@intel.com, xiaolong.ye@intel.com Message-ID: <20200226015110.GA32777@___> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] Question about vhost user interrupt mode 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, Feb 25, 2020 at 12:44:48PM -0800, Yifeng Sun wrote: > > > > +int rte_vhost_get_kickfd(int vid, uint16_t queue_id) Introducing rte_vhost_get_kickfd() may not help much, we already have rte_vhost_get_vhost_vring() to do that. https://github.com/DPDK/dpdk/blob/d7142fbae16f/drivers/net/vhost/rte_eth_vhost.c#L628-L644 > > +{ > > + struct virtio_net *dev; > > + struct vhost_virtqueue *vq; > > + > > + dev = get_device(vid); > > + if (!dev) > > + return -1; > > + > > + if (unlikely(!(dev->flags & VIRTIO_DEV_BUILTIN_VIRTIO_NET))) { > > + // vhost net backend is disabled. > > + return -1; > > + } > > + > > + if (unlikely(!is_valid_virt_queue_idx(queue_id, 1, dev->nr_vring))) { > > + return -1; > > + } > > + > > + vq = dev->virtqueue[queue_id]; > > + // XXX lock? > > + return vq->kickfd; > > +} > > > > Best, > > Yifeng Sun