From: fengchengwen <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <stephen@networkplumber.org>,
<mcoqueli@redhat.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH] examples/vdpa: support show protocol features
Date: Thu, 6 Nov 2025 08:37:24 +0800 [thread overview]
Message-ID: <60afaf2b-8871-4689-ae15-835fe6039a2f@huawei.com> (raw)
In-Reply-To: <20251030065715.47304-1-fengchengwen@huawei.com>
ping for review / upstream
On 10/30/2025 2:57 PM, Chengwen Feng wrote:
> This commit adds show device's protocol features in list command.
>
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> ---
> doc/guides/sample_app_ug/vdpa.rst | 8 ++++----
> examples/vdpa/main.c | 13 ++++++++++---
> 2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/doc/guides/sample_app_ug/vdpa.rst b/doc/guides/sample_app_ug/vdpa.rst
> index cd3ec99054..873efbf7c7 100644
> --- a/doc/guides/sample_app_ug/vdpa.rst
> +++ b/doc/guides/sample_app_ug/vdpa.rst
> @@ -70,10 +70,10 @@ Then we can create 2 vdpa ports in interactive cmdline.
> .. code-block:: console
>
> vdpa> list
> - device id device address queue num supported features
> - 0 0000:06:00.3 1 0x14c238020
> - 1 0000:06:00.4 1 0x14c238020
> - 2 0000:06:00.5 1 0x14c238020
> + device id device address queue num supported features supported protocol features
> + 0 0000:06:00.3 1 0x14c238020 0x10c33
> + 1 0000:06:00.4 1 0x14c238020 0x10c33
> + 2 0000:06:00.5 1 0x14c238020 0x10c33
>
> vdpa> create /tmp/vdpa-socket0 0000:06:00.3
> vdpa> create /tmp/vdpa-socket1 0000:06:00.4
> diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c
> index 289db26498..505e563a57 100644
> --- a/examples/vdpa/main.c
> +++ b/examples/vdpa/main.c
> @@ -324,11 +324,12 @@ void cmd_list_parsed(
> {
> uint32_t queue_num;
> uint64_t features;
> + uint64_t protocol_features;
> struct rte_vdpa_device *vdev;
> struct rte_device *dev;
> struct rte_dev_iterator dev_iter;
>
> - cmdline_printf(cl, "device name\tqueue num\tsupported features\n");
> + cmdline_printf(cl, "device name\tqueue num\tsupported features\tsupported protocol features\n");
> RTE_DEV_FOREACH(dev, "class=vdpa", &dev_iter) {
> vdev = rte_vdpa_find_device_by_name(rte_dev_name(dev));
> if (!vdev)
> @@ -345,8 +346,14 @@ void cmd_list_parsed(
> "for device %s.\n", rte_dev_name(dev));
> continue;
> }
> - cmdline_printf(cl, "%s\t\t%" PRIu32 "\t\t0x%" PRIx64 "\n",
> - rte_dev_name(dev), queue_num, features);
> + if (rte_vdpa_get_protocol_features(vdev, &protocol_features) < 0) {
> + RTE_LOG(ERR, VDPA,
> + "failed to get vdpa protocol features "
> + "for device %s.\n", rte_dev_name(dev));
> + continue;
> + }
> + cmdline_printf(cl, "%s\t\t%" PRIu32 "\t\t0x%" PRIx64 "\t\t0x%" PRIx64 "\n",
> + rte_dev_name(dev), queue_num, features, protocol_features);
> }
> }
>
prev parent reply other threads:[~2025-11-06 0:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 6:57 Chengwen Feng
2025-11-06 0:37 ` fengchengwen [this message]
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=60afaf2b-8871-4689-ae15-835fe6039a2f@huawei.com \
--to=fengchengwen@huawei.com \
--cc=dev@dpdk.org \
--cc=mcoqueli@redhat.com \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/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).