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 52E77A055B; Tue, 25 Feb 2020 21:45:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A06231BFAB; Tue, 25 Feb 2020 21:45:01 +0100 (CET) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) by dpdk.org (Postfix) with ESMTP id 25C1C1BC24 for ; Tue, 25 Feb 2020 21:45:00 +0100 (CET) Received: by mail-ot1-f46.google.com with SMTP id i6so814461otr.7 for ; Tue, 25 Feb 2020 12:45:00 -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=ISfU1ckyb/LXK+RgCPB/D7YwLM6F7i0uWblXO+G89qE=; b=Pgbq2ji0XvftdEvbqxa3p1WnMXYNu+85AVAV7TewEN5dCLepb4HDsuSu07mZvammQX xsQKet4KqvV7jV8oFKOJz3SAc3553+6kCDiPTh6SRjGR7fDKSWaiv85ntuEOpc/SsPMs sUShuTDonzMb0uXUazpEIXYJ2q93s8do9RyZw/uMFxqz/aMu8uCaMvQ+GTBIl1UQue3L bxlcvdLhcfhnWSRAJyHQBKVByMLf1R2gZp4GZAo1PiWAP83I78isagujIaERFAJv518z nf5+FbRBUq5Bu2YW3LfCMkMH71XVdNpJpTGXdlTBahBULO1ymkeJSXDp7HQHE0AGbKT7 ctZw== 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=ISfU1ckyb/LXK+RgCPB/D7YwLM6F7i0uWblXO+G89qE=; b=P9ZGE4dIXD5zgX7UNEJcETKp7vBpLp4BRqDBsWJv0gEgTGbOqir1yaZXdk3x3nR0O4 YBCXUStZJyRRsZXNOkI8g9kpsri8Zdh+wqWjN9tg7FBs90QXeAmCnP82qHGPt5OrSn/U RKQlQA8CF7lRvkbp1T9Ym68/HnzZASyj8jdfC36NNB/8Xc8SJQiCkr74Zt91Eo1L7B6c zBvV5DAL7SB4VK0sD5T/ZcGZ6tCQWr4HJd9NSrIiB9Wb1IdsPm8VZ350SXC/XZN8e0yd jms6K33M+sXtU8x11I8T6fRo4Dl2XeR/Er/lFx078D/KqVXsKNDlsUzuMJ7jB6XobTDl F1PQ== X-Gm-Message-State: APjAAAWFY8CU7V99cHv2wtQ0LhkYV0x/3STu+IxOWj7wWjAzWFi/D2ut FmtF85e7iFG34GO9LDZ4vuCXXQS2fqAa0gpouxMfUaq9 X-Google-Smtp-Source: APXvYqxE1bwL2MXQuvfs6eIOY7bflh6jj4VneTSZGBkZ1XKzSJf6ckhw0nUrlyUQEr77SOCROWb6ePcOyWXJ3a74dc8= X-Received: by 2002:a05:6830:1598:: with SMTP id i24mr367346otr.260.1582663499126; Tue, 25 Feb 2020 12:44:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Yifeng Sun Date: Tue, 25 Feb 2020 12:44:48 -0800 Message-ID: To: dev@dpdk.org Cc: William Tu , Tiwei Bie , Maxime Coquelin 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" + Tiwei and Maxime Thanks, Yifeng On Fri, Feb 21, 2020 at 2:32 PM Yifeng Sun wrote: > > Hi all, > > Right now on OVS, dpdkvhostuser can only run in polling mode (please > correct me if I am wrong). We are trying to enable interrupt mode of > dpdkvhostuser type port on OVS. We found that, with changes below, OVS > can poll&block on exposed kickfd and vhostuser is working under > interrupt mode without consuming 2 CPUs. > > My question is, is this the correct direction to do so, or is there a > better way? Thanks! > > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -318,7 +318,6 @@ struct vring_packed_desc_event { > (1ULL << VIRTIO_NET_F_GUEST_UFO) | \ > (1ULL << VIRTIO_NET_F_GUEST_ECN) | \ > (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | \ > - (1ULL << VIRTIO_RING_F_EVENT_IDX) | \ > (1ULL << VIRTIO_NET_F_MTU) | \ > (1ULL << VIRTIO_F_IN_ORDER) | \ > (1ULL << VIRTIO_F_IOMMU_PLATFORM) | \ > > +int rte_vhost_get_kickfd(int vid, uint16_t queue_id) > +{ > + 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