From: Stephen Hemminger <stephen@networkplumber.org>
To: Eli Cohen <elic@nvidia.com>
Cc: <dsahern@kernel.org>, <netdev@vger.kernel.org>,
<virtualization@lists.linux-foundation.org>,
<jasowang@redhat.com>, <si-wei.liu@oracle.com>, <mst@redhat.com>,
<lulu@redhat.com>, <parav@nvidia.com>
Subject: Re: [PATCH v6 2/4] vdpa: Allow for printing negotiated features of a device
Date: Sun, 13 Mar 2022 09:48:10 -0700 [thread overview]
Message-ID: <20220313094810.3dd7aacd@hermes.local> (raw)
In-Reply-To: <20220313124629.297014-3-elic@nvidia.com>
On Sun, 13 Mar 2022 14:46:27 +0200
Eli Cohen <elic@nvidia.com> wrote:
> When reading the configuration of a vdpa device, check if the
> VDPA_ATTR_DEV_NEGOTIATED_FEATURES is available. If it is, parse the
> feature bits and print a string representation of each of the feature
> bits.
>
> We keep the strings in two different arrays. One for net device related
> devices and one for generic feature bits.
>
> In this patch we parse only net device specific features. Support for
> other devices can be added later. If the device queried is not a net
> device, we print its bit number only.
>
> Examples:
> 1. Standard presentation
> $ vdpa dev config show vdpa-a
> vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 2 mtu 9000
> negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \
> CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM
>
> 2. json output
> $ vdpa -j dev config show vdpa-a
> {"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link":"up","link_announce":false,\
> "max_vq_pairs":2,"mtu":9000,"negotiated_features":["CSUM","GUEST_CSUM",\
> "MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR",\
> "VERSION_1","ACCESS_PLATFORM"]}}}
>
> 3. Pretty json
> $ vdpa -jp dev config show vdpa-a
> {
> "config": {
> "vdpa-a": {
> "mac": "00:00:00:00:88:88",
> "link ": "up",
> "link_announce ": false,
> "max_vq_pairs": 2,
> "mtu": 9000,
> "negotiated_features": [
> "CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ",\
> "MQ","CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ]
> }
> }
> }
>
> Reviewed-by: Si-Wei Liu<si-wei.liu@oracle.com>
> Acked-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Eli Cohen <elic@nvidia.com>
> ---
checkpatch says:
WARNING: braces {} are not necessary for any arm of this statement
#280: FILE: vdpa/vdpa.c:466:
+ if (feature_strs) {
[...]
+ } else {
[...]
next prev parent reply other threads:[~2022-03-13 16:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-13 12:46 [PATCH v6 0/4] vdpa tool enhancements Eli Cohen
2022-03-13 12:46 ` [PATCH v6 1/4] vdpa: Remove unsupported command line option Eli Cohen
2022-03-13 12:46 ` [PATCH v6 2/4] vdpa: Allow for printing negotiated features of a device Eli Cohen
2022-03-13 16:48 ` Stephen Hemminger [this message]
2022-03-13 17:12 ` Eli Cohen
2022-03-13 12:46 ` [PATCH v6 3/4] vdpa: Support for configuring max VQ pairs for " Eli Cohen
2022-03-13 12:46 ` [PATCH v6 4/4] vdpa: Support reading device features Eli Cohen
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=20220313094810.3dd7aacd@hermes.local \
--to=stephen@networkplumber.org \
--cc=dsahern@kernel.org \
--cc=elic@nvidia.com \
--cc=jasowang@redhat.com \
--cc=lulu@redhat.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=parav@nvidia.com \
--cc=si-wei.liu@oracle.com \
--cc=virtualization@lists.linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.