netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Eli Cohen <elic@nvidia.com>,
	"stephen@networkplumber.org" <stephen@networkplumber.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org" 
	<virtualization@lists.linux-foundation.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"si-wei.liu@oracle.com" <si-wei.liu@oracle.com>
Cc: "mst@redhat.com" <mst@redhat.com>,
	"lulu@redhat.com" <lulu@redhat.com>,
	Parav Pandit <parav@nvidia.com>
Subject: Re: [PATCH v7 2/4] vdpa: Allow for printing negotiated features of a device
Date: Mon, 14 Mar 2022 10:00:05 -0600	[thread overview]
Message-ID: <e32671f6-287e-69aa-6146-d5ddac239313@kernel.org> (raw)
In-Reply-To: <DM8PR12MB540062ECB8F8FD32B99A421EAB0F9@DM8PR12MB5400.namprd12.prod.outlook.com>

On 3/14/22 9:34 AM, Eli Cohen wrote:
>> @@ -403,9 +403,9 @@ static const char *parse_class(int num)
>>  }
>>
>>  static const char * const net_feature_strs[64] = {
>> -       [VIRTIO_NET_F_CSUM] = "CSUM",
>> -       [VIRTIO_NET_F_GUEST_CSUM] = "GUEST_CSUM",
>> -       [VIRTIO_NET_F_CTRL_GUEST_OFFLOADS] = "CTRL_GUEST_OFFLOADS",
>> +       [VIRTIO_NET_F_CSUM]                     = "CSUM",
>> +       [VIRTIO_NET_F_GUEST_CSUM]               = "GUEST_CSUM",
>> +       [VIRTIO_NET_F_CTRL_GUEST_OFFLOADS]      = "CTRL_GUEST_OFFLOADS",
>> ...
>>
>>
>>> +};
>>> +
>>> +#define VIRTIO_F_IN_ORDER 35
>>> +#define VIRTIO_F_NOTIFICATION_DATA 38
>>> +#define VDPA_EXT_FEATURES_SZ (VIRTIO_TRANSPORT_F_END - \
>>> +			      VIRTIO_TRANSPORT_F_START + 1)
>>> +
>>> +static const char * const ext_feature_strs[VDPA_EXT_FEATURES_SZ] = {
>>> +	[VIRTIO_RING_F_INDIRECT_DESC - VIRTIO_TRANSPORT_F_START] = "RING_INDIRECT_DESC",
>>> +	[VIRTIO_RING_F_EVENT_IDX - VIRTIO_TRANSPORT_F_START] = "RING_EVENT_IDX",
>>> +	[VIRTIO_F_VERSION_1 - VIRTIO_TRANSPORT_F_START] = "VERSION_1",
>>> +	[VIRTIO_F_ACCESS_PLATFORM - VIRTIO_TRANSPORT_F_START] = "ACCESS_PLATFORM",
>>> +	[VIRTIO_F_RING_PACKED - VIRTIO_TRANSPORT_F_START] = "RING_PACKED",
>>> +	[VIRTIO_F_IN_ORDER - VIRTIO_TRANSPORT_F_START] = "IN_ORDER",
>>> +	[VIRTIO_F_ORDER_PLATFORM - VIRTIO_TRANSPORT_F_START] = "ORDER_PLATFORM",
>>> +	[VIRTIO_F_SR_IOV - VIRTIO_TRANSPORT_F_START] = "SR_IOV",
>>> +	[VIRTIO_F_NOTIFICATION_DATA - VIRTIO_TRANSPORT_F_START] = "NOTIFICATION_DATA",
>>
>> and the entries here should be a macro to handle the
>> VIRTIO_TRANSPORT_F_START  offset with column aligned strings.
>>
> Do you mean define a new macro for each line above?
> I could align them nicely without new macros while being confined to column 88.
> 

VIRTIO_TRANSPORT_F_START is redundant on each line; a macro can be used
to hide that and simplifies each line.

  reply	other threads:[~2022-03-14 16:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 17:12 [PATCH v7 0/4] vdpa tool enhancements Eli Cohen
2022-03-13 17:12 ` [PATCH v7 1/4] vdpa: Remove unsupported command line option Eli Cohen
2022-03-13 17:12 ` [PATCH v7 2/4] vdpa: Allow for printing negotiated features of a device Eli Cohen
2022-03-13 17:33   ` Stephen Hemminger
2022-03-13 18:04     ` Eli Cohen
2022-03-14 14:51       ` David Ahern
2022-03-14 14:54         ` Eli Cohen
2022-03-14 15:07   ` David Ahern
2022-03-14 15:34     ` Eli Cohen
2022-03-14 16:00       ` David Ahern [this message]
2022-03-15 11:35     ` Eli Cohen
2022-03-16 15:46       ` David Ahern
2022-03-13 17:12 ` [PATCH v7 3/4] vdpa: Support for configuring max VQ pairs for " Eli Cohen
2022-03-14 15:09   ` David Ahern
2022-03-14 15:35     ` Eli Cohen
2022-03-14 15:45     ` Eli Cohen
2022-03-14 16:01       ` David Ahern
2022-03-13 17:12 ` [PATCH v7 4/4] vdpa: Support reading device features Eli Cohen
2022-03-14 15:10 ` [PATCH v7 0/4] vdpa tool enhancements patchwork-bot+netdevbpf

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=e32671f6-287e-69aa-6146-d5ddac239313@kernel.org \
    --to=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=stephen@networkplumber.org \
    --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 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).