All of lore.kernel.org
 help / color / mirror / Atom feed
From: Si-Wei Liu <si-wei.liu@oracle.com>
To: Parav Pandit <parav@mellanox.com>, "Michael S. Tsirkin" <mst@redhat.com>
Cc: Eugenio Perez Martin <eperezma@redhat.com>,
	Eli Cohen <elic@nvidia.com>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>,
	"perezma@redhat.com" <perezma@redhat.com>
Subject: Re: [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default
Date: Tue, 14 Mar 2023 12:29:26 -0700	[thread overview]
Message-ID: <8952f08f-cc61-cf5f-7ffe-3f2a80891d28@oracle.com> (raw)
In-Reply-To: <PH0PR12MB54816DE6E7A0594D38019305DCBE9@PH0PR12MB5481.namprd12.prod.outlook.com>



On 3/13/2023 8:47 PM, Parav Pandit wrote:
>> From: Michael S. Tsirkin <mst@redhat.com>
>> Sent: Monday, March 13, 2023 11:38 PM
>>
>> On Tue, Mar 14, 2023 at 02:05:50AM +0000, Parav Pandit wrote:
>>>> From: Si-Wei Liu <si-wei.liu@oracle.com>
>>>> Sent: Monday, March 13, 2023 6:19 PM
>>>> Actually there's no such burden or requirement to maintain backward
>>>> compatibility for the default 'vdpa dev add' behavior if dedicated
>>>> device_features is not specified. Historically the default vdpa
>>>> creation on mlx5 ever got changed from single queue to 8 queue pairs
>>>> when VIRTIO_NET_F_MQ feature was first introduced to mlx5_vdpa, then
>>>> the default switched back to 1 data queue pair again when max_vqp
>> attribute was added to the vdpa tool.
>>>> Essentially, every addition of new feature to mlx5_vdpa, e.g.
>>>> CTRL_VQ, CTRL_VLAN, and et al, effectively changed the default "vdpa
>>>> dev add" behavior not just only once: the backward compatibility
>>>> guarantee is simply just not there and ever.
>>> This requires that every change in the device attributes will change the
>> behavior for vdpa dev add.
>>> The OR operation of the user supplied feature bits with device defaults
>> feature bit doesn’t look good to me.
>>> It brings uncertain behavior.
>>>
>>> The right behavior should be, if user supplied the feature bits, it should
>> supply all desired bits.
>>
>> I think u mean all that device also supports.
>>
> If user supplied feature bits and device doesn’t support some of the feature bits -> add command fails.
> If user supplied feature bits, than use only the feature bits. Do not OR user supplied feature bits with device supported feature bits.
I think that is the not the current behavior for mlx5_vdpa? As far as I 
can see it would AND user supplied device_features bits with the device 
supported feature bits (find the common part of both feature bits) then 
proceed. I am not sure I follow what is the problem?

> For example,
> User asked to set,
> F_CONFIG_MTU
> F_CONFIG_MAC
> F_PACKED
> In that device should only use above 3 features. (because user is the master).
>
> It should not OR user supplied feature bits with device defaults feature bits.
>   
>>> If user doesn’t supply feature bits, use the device defaults.
> If user doesn’t supply any feature fits, that means user wants to run with some device defaults.
> In that case its fine to run with device defaults.
Noted, we don't have this device defaults exposed to users yet other 
than what's shown in the parent mgmtdev (dev_features). And the current 
and the only safe behavior for mlx5_vdpa is to inherit all device 
supported features from parent mgmtdev, otherwise user can't know in 
advance what default features the device might come up with implicitly 
underneath. Basically it would need to add new CLI interface to achieve 
what you want.

Thanks,
-Siwei

>
>>> But not to mix both feature bits.
>> Can't say I understand what this means. What does "both" mean here?
> Mix Both means, to perform OR operation on user supplied feature bits with device defaults.

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

  parent reply	other threads:[~2023-03-14 19:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230312083920.2300028-1-elic@nvidia.com>
     [not found] ` <20230312083920.2300028-2-elic@nvidia.com>
2023-03-12  8:58   ` [PATCH 1/2] vdpa/mlx5: Make VIRTIO_NET_F_MRG_RXBUF off by default Michael S. Tsirkin
     [not found]     ` <f01c7204-5629-297e-47b6-06e58bd3f543@nvidia.com>
2023-03-12 10:25       ` Michael S. Tsirkin
     [not found]         ` <PH0PR12MB54816C24BAA322567BED21A0DCB89@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-12 16:24           ` Michael S. Tsirkin
     [not found]             ` <PH0PR12MB548140734E1A0A8A2FD2CE30DCB99@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-13 21:23               ` Michael S. Tsirkin
2023-03-13 21:36                 ` Si-Wei Liu
     [not found]                 ` <PH0PR12MB5481766116A2C074EDA7B3CCDCB99@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-13 21:44                   ` Michael S. Tsirkin
     [not found]                     ` <PH0PR12MB5481FBB83AF401E598448736DCBE9@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-14  3:43                       ` Michael S. Tsirkin
2023-03-13 22:19           ` Si-Wei Liu
     [not found]             ` <PH0PR12MB5481A0629C479A030C8A8EDEDCBE9@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-14  3:37               ` Michael S. Tsirkin
     [not found]                 ` <PH0PR12MB54816DE6E7A0594D38019305DCBE9@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-14  4:33                   ` Michael S. Tsirkin
2023-03-14 19:29                   ` Si-Wei Liu [this message]
     [not found]                     ` <PH0PR12MB5481F776D35247E6BF3F115EDCBF9@PH0PR12MB5481.namprd12.prod.outlook.com>
2023-03-15  6:56                       ` Si-Wei Liu

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=8952f08f-cc61-cf5f-7ffe-3f2a80891d28@oracle.com \
    --to=si-wei.liu@oracle.com \
    --cc=elic@nvidia.com \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=perezma@redhat.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.