Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6423220rwl; Wed, 22 Mar 2023 10:22:35 -0700 (PDT) X-Google-Smtp-Source: AK7set9yOTqIuJdA5nJcJFzmU+gT+8dRpwudGGbBXa/LR3cM1dLudnrtpS7OESKbggDJqvaVoBUE X-Received: by 2002:a17:906:55ca:b0:933:1b05:8851 with SMTP id z10-20020a17090655ca00b009331b058851mr8051495ejp.16.1679505755632; Wed, 22 Mar 2023 10:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679505755; cv=none; d=google.com; s=arc-20160816; b=zIBHOZQnLA18xX4lcPKL9OpwuRIXYZLAKqVoyg+/NCXU31GMQct4b6ZkVkO17BEqVY pK5NlzkUwJoqlXnUShwq5UR8cmTJNDPNbhyoBK79BdX9xUYXPduhdsJbk9yv+jjzTUt7 Ut9C+HeHjmfM7QwEO7X/roQyrLpXCfiZCj+sY9X/BR591Pi99staFLN+cj1m8ZR2sqqd I8Z7YpERcRe75eK1XqvOjMAoqNPIJ6805euEodm/Uij9zYaWIdLc/YBmnr+uWeJVWCkj oJWGdC8TJCKbSr+ABamFolW4c7KrWyveJ9/2GrbKWh5B/jKad6OIVd1QvbjzEBmXQRY5 Bgwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZAMwytLDDPXOJZO7xVxuXg0wtjoShJg+clkvBywaXAo=; b=Xr6tdFzJm7QQoyila4iTEelOsfYARiJCtHO/ygA23brhRjshueESsieBSf765fXPjB 09QUMQ3PHXMd96i4lC4iQyy8iozHhZ6XvAFEW+j6Di7ocYYVU+oY+ci32LzkcRTRj0XR 9hawJjGEol49gf+U4P2TAjoLUuJHkL+g0uH15ofhJDlWSmNtsTxFDIiiHh2QD0g+bmGk WwEOrbUUzXBaf8pvzL4hi2mq0PBbOhHzjJP09/NDL97/Gyz5sNS1VKeWBGDTNeoS/uSG MJaVwlZ3oMlj0HCr0ZMHZ0G5BEOsHuJ+M6QpdOzz9OTP1tQwXv/AB3PozBASPvd2CzsR 1vbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=NhEzhajg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tx26-20020a1709078e9a00b0093348efaf0asi10542629ejc.198.2023.03.22.10.22.11; Wed, 22 Mar 2023 10:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=NhEzhajg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjCVRVu (ORCPT + 99 others); Wed, 22 Mar 2023 13:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjCVRVs (ORCPT ); Wed, 22 Mar 2023 13:21:48 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D76A764279 for ; Wed, 22 Mar 2023 10:21:26 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id s8so24082106lfr.8 for ; Wed, 22 Mar 2023 10:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; t=1679505683; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZAMwytLDDPXOJZO7xVxuXg0wtjoShJg+clkvBywaXAo=; b=NhEzhajgiO0scbd61FI+YDLNe/DDnEOiVT7Dn5D2fjex5xhRtPRBlBY+JxrearBLuR yJ9WEWNww9OUPDpR/YugZQxUS1UBnqNP0yFExwUMGxUJfTrT5VYwaRDx/dh3CR7ZQNA2 vx2lB9ZbwxHli0lFXOQMAyw0cjcA/Xd+hLVE3EEINvbWDbasZXcbqnsOBWETKPt3zh/w Hru80PEpNo5REJZ6HZnYvjhLcRbN8KcB13CqYlSzFrwKwd8vJ6KCyOZ6erFQiOPX9syh mxJbXKk7u7WFt6XLNTRW3nNNA1AXT4BIzQLCVemnqXLgNO0IDfFvHQCKHA8HXAFU44bQ X/AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679505683; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZAMwytLDDPXOJZO7xVxuXg0wtjoShJg+clkvBywaXAo=; b=XJDS1M+25Yjce3dznlQwCfbI5sb+4O8jAcGj/2g7HcpSLAgwg2EsZaEd5bCMspGQPt hKHrr1FtspgX0D191x9quCxeg5gLWP5Jt5CflS/FvJraKA5sD37hXNAJgWq8S9NrXrdN MJdkYcDN+6RCL59rQGOMSlMjXWxvwzimryrkMCBSoxs1lVdhP/dA/Dbleqi570/33gSP kT+mDGYrC+g+HO1pOyZy2RBDXtGIJfvca/zjU5iLffZQz2UHL9SLnvGE3vvuWEADcAGA 6mz+4d9LHrAoz4yUt8PnK8ZKOBytFA7YDW909a+7PY0gdeaEInbO31EhFJyScHsXVA5z ak9g== X-Gm-Message-State: AO0yUKU9+vw9AQRi9IETZMrXojBjbn6uEUeZcx242j+Xz8CTE9I5fJIK lapLKrZONCCEsT83tEdfwX7wsDs8yGIIAAejhrVKsA== X-Received: by 2002:ac2:5989:0:b0:4dd:a025:d8c with SMTP id w9-20020ac25989000000b004dda0250d8cmr2195562lfn.5.1679505682982; Wed, 22 Mar 2023 10:21:22 -0700 (PDT) MIME-Version: 1.0 References: <20230322141031.2211141-1-viktor@daynix.com> <20230322123121-mutt-send-email-mst@kernel.org> <87mt44hh5f.fsf@redhat.com> In-Reply-To: <87mt44hh5f.fsf@redhat.com> From: Viktor Prutyanov Date: Wed, 22 Mar 2023 20:21:12 +0300 Message-ID: Subject: Re: [PATCH v4] virtio: add VIRTIO_F_NOTIFICATION_DATA feature support To: Cornelia Huck Cc: "Michael S. Tsirkin" , jasowang@redhat.com, pasic@linux.ibm.com, farman@linux.ibm.com, linux-s390@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, yan@daynix.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 22, 2023 at 7:42=E2=80=AFPM Cornelia Huck w= rote: > > On Wed, Mar 22 2023, "Michael S. Tsirkin" wrote: > > > On Wed, Mar 22, 2023 at 05:10:31PM +0300, Viktor Prutyanov wrote: > >> According to VirtIO spec v1.2, VIRTIO_F_NOTIFICATION_DATA feature > >> indicates that the driver passes extra data along with the queue > >> notifications. > >> > >> In a split queue case, the extra data is 16-bit available index. In a > >> packed queue case, the extra data is 1-bit wrap counter and 15-bit > >> available index. > >> > >> Add support for this feature for MMIO, channel I/O and modern PCI > >> transports. > >> > >> Signed-off-by: Viktor Prutyanov > >> --- > >> v4: remove VP_NOTIFY macro and legacy PCI support, add > >> virtio_ccw_kvm_notify_with_data to virtio_ccw > >> v3: support feature in virtio_ccw, remove VM_NOTIFY, use avail_idx_sh= adow, > >> remove byte swap, rename to vring_notification_data > >> v2: reject the feature in virtio_ccw, replace __le32 with u32 > >> > >> Tested with disabled VIRTIO_F_NOTIFICATION_DATA on qemu-system-s390x > >> (virtio-blk-ccw), qemu-system-riscv64 (virtio-blk-device, > >> virtio-rng-device), qemu-system-x86_64 (virtio-blk-pci, virtio-net-pc= i) > >> to make sure nothing is broken. > >> Tested with enabled VIRTIO_F_NOTIFICATION_DATA on 64-bit RISC-V Linux > >> and my hardware implementation of virtio-rng. > > > > what did you test? virtio pci? mmio? guessing not ccw... > > > > Cornelia could you hack up something to quickly test ccw? > > Hm, I'm not entirely sure how notification data is supposed to be used > in real life -- Viktor, what is your virtio-rng implementation doing; > can this be hacked into all transports? In hardware implementation of split VirtIO queue, the notification data fea= ture saves time on a memory request to avail_idx from the device side. I can definitely say about MMIO, but most likely it is also useful for PCI. It is also written here that this feature was added for efficiency: https://www.mail-archive.com/virtio-dev@lists.oasis-open.org/msg02728.html Also DPDK has support for this feature in VirtIO PCI: https://github.com/DPDK/dpdk/commit/7e72f3ec1a8abefd9321a61e484846e16177f5b= 1 > > (Also, if the other ccw folks have something handy, please speak up :) >