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 ACE90A055A; Wed, 26 Feb 2020 18:26:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 760B81BF8D; Wed, 26 Feb 2020 18:26:54 +0100 (CET) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id 155662C02 for ; Wed, 26 Feb 2020 18:26:53 +0100 (CET) Received: by mail-oi1-f194.google.com with SMTP id c16so307129oic.3 for ; Wed, 26 Feb 2020 09:26:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZjD4hT6lM1tMHTrnzJjM87CXf6hVQo0zgUytT5qMobo=; b=Ui8kINAfS0qXqa1cJzHzLGpXSNemQZVdZp+x+V6M0xipKBdeQUck0mAFrYO1S9MfaX dqkIlOnuR98lEXGLDROJBzQHWAnz6ePRCck/ailfE4BHshFjNE6fGgjz2cXZjSN3PUhB Pahxv4LHRlsqoIEspaIKlAbDWxnebikPsfCFAS/aIEYcQ9lEuzqx28EfgTp/GQiLDZM7 mvVfxS0cKC6FQ5LM3fDm4k8YRu1VRz7gTh9W3WCIaIZthoLEZUj2TteSUJc4OqoPrwWm 8W/aAhYG9G0lfPhbY8iJ097dv2+CWOl+qXtMAK0zC80CU6pr8PmYYIXCwYQyMIpDH89i OeIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZjD4hT6lM1tMHTrnzJjM87CXf6hVQo0zgUytT5qMobo=; b=TFNVGb1LmHTsPh2GAvcFhyIGGhTy0f/2nm+SDPym5/Uc+XM/yEE85GtO2oibd915O2 sKogMgV4PJRUxQgMR5m8UzK5jU/nnRDnlG6VAEN91fHfAvOebiXbRrqCFWfTLU9I7F42 AEzp/JQiRUXbH8bC25G+RBJBWjzHK8b4WB9NEiYHUv9/zkjE9n8nYU5UnzaZxOwrsGjM csZ9fxSexKluJPK2IOXbp97O3fIft8LJ/aNnG1MKD27woNfdjotzTyCYtiOhPh4veiyH JlajcZPuYko2FjW+PCJjU+x8l9BkyGJ2Cv7G8aVtcWITvUqyv5b2vng0PKEYoOr41j0o cyCg== X-Gm-Message-State: APjAAAXnhRfVwwfxQR5dH+t5kA1uEC73eC9aYk6HV8KRqHJrCAKftmUM DpHsOyePnwUPqwswdhBMpwXKpqV/hl2W4x96zsM= X-Google-Smtp-Source: APXvYqyxEUcp1gIIVdcd+ci4KRMHM3B/EY+ZqwfmPWZL8Tt29+WffCcu5VQY9DGxhU/Oksg/dSIvpBiwl+leWh/cDbg= X-Received: by 2002:aca:2806:: with SMTP id 6mr70194oix.64.1582738012020; Wed, 26 Feb 2020 09:26:52 -0800 (PST) MIME-Version: 1.0 References: <20200226015110.GA32777@___> In-Reply-To: <20200226015110.GA32777@___> From: Yifeng Sun Date: Wed, 26 Feb 2020 09:26:41 -0800 Message-ID: To: Tiwei Bie Cc: dev@dpdk.org, William Tu , Maxime Coquelin , zhihong.wang@intel.com, xiaolong.ye@intel.com Content-Type: text/plain; charset="UTF-8" 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" Hi Tiwei, Thanks a lot for your comment. I will take a look at rte_vhost_get_vhost_vring. Best, Yifeng On Tue, Feb 25, 2020 at 5:51 PM Tiwei Bie wrote: > > 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