[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220313094810.3dd7aacd@hermes.local>
Date: Sun, 13 Mar 2022 09:48:10 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Eli Cohen <elic@...dia.com>
Cc: <dsahern@...nel.org>, <netdev@...r.kernel.org>,
<virtualization@...ts.linux-foundation.org>, <jasowang@...hat.com>,
<si-wei.liu@...cle.com>, <mst@...hat.com>, <lulu@...hat.com>,
<parav@...dia.com>
Subject: Re: [PATCH v6 2/4] vdpa: Allow for printing negotiated features of
a device
On Sun, 13 Mar 2022 14:46:27 +0200
Eli Cohen <elic@...dia.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@...cle.com>
> Acked-by: Jason Wang <jasowang@...hat.com>
> Signed-off-by: Eli Cohen <elic@...dia.com>
> ---
checkpatch says:
WARNING: braces {} are not necessary for any arm of this statement
#280: FILE: vdpa/vdpa.c:466:
+ if (feature_strs) {
[...]
+ } else {
[...]
Powered by blists - more mailing lists