From: Jiri Pirko <jiri@resnulli.us>
To: Jason Wang <jasowang@redhat.com>
Cc: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
davem@davemloft.net, edumazet@google.com, parav@nvidia.com,
mst@redhat.com, xuanzhuo@linux.alibaba.com, shuah@kernel.org,
petrm@nvidia.com, liuhangbin@gmail.com, vladimir.oltean@nxp.com,
bpoirier@nvidia.com, idosch@nvidia.com,
virtualization@lists.linux.dev
Subject: Re: [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features
Date: Tue, 16 Apr 2024 11:37:22 +0200 [thread overview]
Message-ID: <Zh5G0sh62hZtOM0J@nanopsycho> (raw)
In-Reply-To: <CACGkMEtpSPFSpikcrsZZBtXOgpAukjCwFRcF79xfzDG-s8_SyQ@mail.gmail.com>
Tue, Apr 16, 2024 at 05:52:41AM CEST, jasowang@redhat.com wrote:
>On Tue, Apr 16, 2024 at 12:25 AM Jiri Pirko <jiri@resnulli.us> wrote:
>>
>> From: Jiri Pirko <jiri@nvidia.com>
>>
>> Currently there is no way for user to set what features the driver
>> should obey or not, it is hard wired in the code.
>>
>> In order to be able to debug the device behavior in case some feature is
>> disabled, introduce a debugfs infrastructure with couple of files
>> allowing user to see what features the device advertises and
>> to set filter for features used by driver.
>>
>> Example:
>> $cat /sys/bus/virtio/devices/virtio0/features
>> 1110010111111111111101010000110010000000100000000000000000000000
>> $ echo "5" >/sys/kernel/debug/virtio/virtio0/filter_feature_add
>> $ cat /sys/kernel/debug/virtio/virtio0/filter_features
>> 5
>> $ echo "virtio0" > /sys/bus/virtio/drivers/virtio_net/unbind
>> $ echo "virtio0" > /sys/bus/virtio/drivers/virtio_net/bind
>> $ cat /sys/bus/virtio/devices/virtio0/features
>> 1110000111111111111101010000110010000000100000000000000000000000
>>
>> Note that sysfs "features" know already exists, this patch does not
>> touch it.
>>
>> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
>> ---
>
>Note that this can be done already with vp_vdpa feature provisioning:
>
>commit c1ca352d371f724f7fb40f016abdb563aa85fe55
>Author: Jason Wang <jasowang@redhat.com>
>Date: Tue Sep 27 15:48:10 2022 +0800
>
> vp_vdpa: support feature provisioning
>
>For example:
>
>vdpa dev add name dev1 mgmtdev pci/0000:02:00.0 device_features 0x300020000
Sure. My intension was to make the testing possible on any virtio
device. Narrowing the testing for vpda would be limitting.
>
>Thanks
>
next prev parent reply other threads:[~2024-04-16 9:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 16:25 [patch net-next v2 0/6] selftests: virtio_net: introduce initial testing infrastructure Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 1/6] virtio: add debugfs infrastructure to allow to debug virtio features Jiri Pirko
2024-04-16 3:52 ` Jason Wang
2024-04-16 9:37 ` Jiri Pirko [this message]
2024-04-17 4:37 ` Jason Wang
2024-04-17 7:22 ` Jiri Pirko
2024-04-18 0:59 ` Jason Wang
2024-04-18 8:28 ` Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 2/6] selftests: forwarding: move couple of initial check to the beginning Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 3/6] selftests: forwarding: add ability to assemble NETIFS array by driver name Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 4/6] selftests: forwarding: add check_driver() helper Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 5/6] selftests: forwarding: add wait_for_dev() helper Jiri Pirko
2024-04-15 21:39 ` Benjamin Poirier
2024-04-16 9:34 ` Jiri Pirko
2024-04-15 16:25 ` [patch net-next v2 6/6] selftests: virtio_net: add initial tests Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zh5G0sh62hZtOM0J@nanopsycho \
--to=jiri@resnulli.us \
--cc=bpoirier@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=liuhangbin@gmail.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.com \
--cc=petrm@nvidia.com \
--cc=shuah@kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=vladimir.oltean@nxp.com \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).