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 E25EBA0558; Sat, 22 Feb 2020 22:11:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5470125B3; Sat, 22 Feb 2020 22:11:52 +0100 (CET) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by dpdk.org (Postfix) with ESMTP id A1FF81BFAC for ; Fri, 21 Feb 2020 23:33:04 +0100 (CET) Received: by mail-ot1-f42.google.com with SMTP id 59so3465284otp.12 for ; Fri, 21 Feb 2020 14:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=ylJ6RcHHP0ccUj60uG50puH8JF3OtRwZ+cKMvUdrROA=; b=Rf6CB5GKjA4vPCqqLnTuJKup7+ZfOK1eelHKprx/TfoFbna3UIREwihR17YtIUEBRp kohjGsgymfcYhuXGCj415BeggSYyZR8Q67JU2PSnRum3kiEtdiy3VUKIBG5s64Yo2FrG xWpWgDpfvjUi1urPtkj8EHQsBw3Nr4l4pMkYWr2F7xc2vvpCODZzv5E4Em+MS2jyQx8T YTMIZ8xKqD5laQQ1W/zfA6TTB4uMzKgWi3xKiklgtzA7CiJpc8L72eN0KBvxEQ5Q5jFm S8zY4CMHNlRjrlsFQkVMy4mATENmCTrm+y8AinHsW97byH+HjWl+Rf7MpkBhsSs/2xKz E1cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=ylJ6RcHHP0ccUj60uG50puH8JF3OtRwZ+cKMvUdrROA=; b=tLCR+hDTBGJnie4fjbcEC7GI9bg3kZ/iUddWyzTUf9dN3kNKkTF14Tl5TWikLMC8Q1 j/A2rj+PMK7cSvnSsKFJoyBbDoT5kk9yR/pBhxOE6Ct7nZUpjISIm2DLt9VTWXQyIVZk bVt3JsqHK3+8iWsLmoyzlKNMsAxCj1Jhl7+BCRsnvU8Ln/ElvW/pZ65AXS5rEuoYf/Wg 0vYGzwp6ZPrEcmiv4WYlSkj+OhPIWiLz5cLl99pUjQLQPaaI8KFE6dFVyAC6BU2bAF/8 ZOpTma2c1fsERTOmhbE6vH42lnDzhs2+WdU28s7ekGD+HB2O27bEcVMiaJTfTq97ensd teQQ== X-Gm-Message-State: APjAAAXILh/qW9SweTnRYe4B2I7Tb3jjw4Ll4n4Yg+M/Yp63k74RVd27 utxq+uY6VPzpouqLDuJ3bZudOCOL2MUeUHjNTaG9l18eFV0= X-Google-Smtp-Source: APXvYqzGmHVnnzl/dMDX1x91KZ4kbyEQr2WTcBHMY6HQMdk6R23VIX4oesbAKwvAGTR1TWCaUWXfI904+j8hD8j1rmc= X-Received: by 2002:a05:6830:1555:: with SMTP id l21mr28647114otp.41.1582324383527; Fri, 21 Feb 2020 14:33:03 -0800 (PST) MIME-Version: 1.0 From: Yifeng Sun Date: Fri, 21 Feb 2020 14:32:52 -0800 Message-ID: To: dev@dpdk.org Cc: William Tu Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sat, 22 Feb 2020 22:11:51 +0100 Subject: [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 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