diff mbox series

[v3,net-next,01/14] devlink: add enable_migration parameter

Message ID 20230217225558.19837-2-shannon.nelson@amd.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series pds_core driver | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 386 this patch: 386
netdev/cc_maintainers warning 5 maintainers not CCed: pabeni@redhat.com corbet@lwn.net jiri@nvidia.com linux-doc@vger.kernel.org edumazet@google.com
netdev/build_clang success Errors and warnings before: 21 this patch: 21
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 537 this patch: 537
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/kdoc success Errors and warnings before: 14 this patch: 14
netdev/source_inline success Was 0 now: 0

Commit Message

Nelson, Shannon Feb. 17, 2023, 10:55 p.m. UTC
Add a new device generic parameter to enable/disable support
for live migration in the devlink device.  This is intended
primarily for a core device that supports other ports/VFs/SFs.
Those dependent ports may need their own migratable parameter
for individual enable/disable control.

Examples:
  $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
  $ devlink dev param show pci/0000:07:00.0 name enable_migration
  pci/0000:07:00.0:
    name enable_migration type generic
      values:
        cmode runtime value true

Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
---
 Documentation/networking/devlink/devlink-params.rst | 3 +++
 include/net/devlink.h                               | 4 ++++
 net/devlink/leftover.c                              | 5 +++++
 3 files changed, 12 insertions(+)

Comments

Jiri Pirko Feb. 20, 2023, 8:22 a.m. UTC | #1
Fri, Feb 17, 2023 at 11:55:45PM CET, shannon.nelson@amd.com wrote:
>Add a new device generic parameter to enable/disable support
>for live migration in the devlink device.  This is intended
>primarily for a core device that supports other ports/VFs/SFs.
>Those dependent ports may need their own migratable parameter
>for individual enable/disable control.
>
>Examples:
>  $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
>  $ devlink dev param show pci/0000:07:00.0 name enable_migration
>  pci/0000:07:00.0:
>    name enable_migration type generic
>      values:
>        cmode runtime value true
>
>Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>

Could you please elaborate why exactly is this needed?

From my perspective, the migration capability is something that
is related to the actual function (VF/SF).

When instantiating/configuring SF/VF, the admin ask for the particular
function to support live migration. We have port function caps now,
which is exactly where this makes sense.

See DEVLINK_PORT_FN_CAP_MIGRATABLE.
Jiri Pirko Feb. 20, 2023, 8:23 a.m. UTC | #2
Fri, Feb 17, 2023 at 11:55:45PM CET, shannon.nelson@amd.com wrote:
>Add a new device generic parameter to enable/disable support
>for live migration in the devlink device.  This is intended
>primarily for a core device that supports other ports/VFs/SFs.
>Those dependent ports may need their own migratable parameter
>for individual enable/disable control.
>
>Examples:
>  $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
>  $ devlink dev param show pci/0000:07:00.0 name enable_migration
>  pci/0000:07:00.0:
>    name enable_migration type generic
>      values:
>        cmode runtime value true
>
>Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
>---
> Documentation/networking/devlink/devlink-params.rst | 3 +++
> include/net/devlink.h                               | 4 ++++
> net/devlink/leftover.c                              | 5 +++++

Why you didn't use get_maintainers.pl script for the cc list?
Nelson, Shannon Feb. 20, 2023, 11:54 p.m. UTC | #3
On 2/20/23 12:22 AM, Jiri Pirko wrote:
> Fri, Feb 17, 2023 at 11:55:45PM CET, shannon.nelson@amd.com wrote:
>> Add a new device generic parameter to enable/disable support
>> for live migration in the devlink device.  This is intended
>> primarily for a core device that supports other ports/VFs/SFs.
>> Those dependent ports may need their own migratable parameter
>> for individual enable/disable control.
>>
>> Examples:
>>   $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
>>   $ devlink dev param show pci/0000:07:00.0 name enable_migration
>>   pci/0000:07:00.0:
>>     name enable_migration type generic
>>       values:
>>         cmode runtime value true
>>
>> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> 
> Could you please elaborate why exactly is this needed?
> 
>  From my perspective, the migration capability is something that
> is related to the actual function (VF/SF).
> 
> When instantiating/configuring SF/VF, the admin ask for the particular
> function to support live migration. We have port function caps now,
> which is exactly where this makes sense.
> 
> See DEVLINK_PORT_FN_CAP_MIGRATABLE.

Hi Jiri,

Thanks for your questions.  My apologies for not getting your name into 
the To: list – a late Friday afternoon miss.

This enable_migration flag is intended to be similar to the enable_vnet, 
enable_rdma, and similar existing parameters that are used by other core 
devices.

Our pds_core device can be used to support several features (currently 
VFio and vDPA), and this gives the user a way to control how many of the 
features are made available in any particular configuration.  This is to 
be enabled to turn on support for our pds_vfio client devices as a 
whole, not individually port-by-port.  I understand FN_CAP_MIGRATABLE to 
be applied to an individual devlink port, which could be used in 
conjunction with this once the general feature is enable in pds_core.

Thanks,
sln
Jiri Pirko Feb. 21, 2023, 12:33 p.m. UTC | #4
Tue, Feb 21, 2023 at 12:54:25AM CET, shannon.nelson@amd.com wrote:
>On 2/20/23 12:22 AM, Jiri Pirko wrote:
>> Fri, Feb 17, 2023 at 11:55:45PM CET, shannon.nelson@amd.com wrote:
>> > Add a new device generic parameter to enable/disable support
>> > for live migration in the devlink device.  This is intended
>> > primarily for a core device that supports other ports/VFs/SFs.
>> > Those dependent ports may need their own migratable parameter
>> > for individual enable/disable control.
>> > 
>> > Examples:
>> >   $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
>> >   $ devlink dev param show pci/0000:07:00.0 name enable_migration
>> >   pci/0000:07:00.0:
>> >     name enable_migration type generic
>> >       values:
>> >         cmode runtime value true
>> > 
>> > Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
>> 
>> Could you please elaborate why exactly is this needed?
>> 
>>  From my perspective, the migration capability is something that
>> is related to the actual function (VF/SF).
>> 
>> When instantiating/configuring SF/VF, the admin ask for the particular
>> function to support live migration. We have port function caps now,
>> which is exactly where this makes sense.
>> 
>> See DEVLINK_PORT_FN_CAP_MIGRATABLE.
>
>Hi Jiri,
>
>Thanks for your questions.  My apologies for not getting your name into the
>To: list – a late Friday afternoon miss.
>
>This enable_migration flag is intended to be similar to the enable_vnet,
>enable_rdma, and similar existing parameters that are used by other core
>devices.
>
>Our pds_core device can be used to support several features (currently VFio
>and vDPA), and this gives the user a way to control how many of the features
>are made available in any particular configuration.  This is to be enabled to
>turn on support for our pds_vfio client devices as a whole, not individually
>port-by-port.  I understand FN_CAP_MIGRATABLE to be applied to an individual
>devlink port, which could be used in conjunction with this once the general
>feature is enable in pds_core.

Okay, that sounds legit. Could yout please extend the patch description
with this? Thanks!


>
>Thanks,
>sln
Nelson, Shannon Feb. 21, 2023, 9:55 p.m. UTC | #5
On 2/21/23 4:33 AM, Jiri Pirko wrote:
> Tue, Feb 21, 2023 at 12:54:25AM CET, shannon.nelson@amd.com wrote:
>> On 2/20/23 12:22 AM, Jiri Pirko wrote:
>>> Fri, Feb 17, 2023 at 11:55:45PM CET, shannon.nelson@amd.com wrote:
>>>> Add a new device generic parameter to enable/disable support
>>>> for live migration in the devlink device.  This is intended
>>>> primarily for a core device that supports other ports/VFs/SFs.
>>>> Those dependent ports may need their own migratable parameter
>>>> for individual enable/disable control.
>>>>
>>>> Examples:
>>>>    $ devlink dev param set pci/0000:07:00.0 name enable_migration value true cmode runtime
>>>>    $ devlink dev param show pci/0000:07:00.0 name enable_migration
>>>>    pci/0000:07:00.0:
>>>>      name enable_migration type generic
>>>>        values:
>>>>          cmode runtime value true
>>>>
>>>> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
>>>
>>> Could you please elaborate why exactly is this needed?
>>>
>>>   From my perspective, the migration capability is something that
>>> is related to the actual function (VF/SF).
>>>
>>> When instantiating/configuring SF/VF, the admin ask for the particular
>>> function to support live migration. We have port function caps now,
>>> which is exactly where this makes sense.
>>>
>>> See DEVLINK_PORT_FN_CAP_MIGRATABLE.
>>
>> Hi Jiri,
>>
>> Thanks for your questions.  My apologies for not getting your name into the
>> To: list – a late Friday afternoon miss.
>>
>> This enable_migration flag is intended to be similar to the enable_vnet,
>> enable_rdma, and similar existing parameters that are used by other core
>> devices.
>>
>> Our pds_core device can be used to support several features (currently VFio
>> and vDPA), and this gives the user a way to control how many of the features
>> are made available in any particular configuration.  This is to be enabled to
>> turn on support for our pds_vfio client devices as a whole, not individually
>> port-by-port.  I understand FN_CAP_MIGRATABLE to be applied to an individual
>> devlink port, which could be used in conjunction with this once the general
>> feature is enable in pds_core.
> 
> Okay, that sounds legit. Could yout please extend the patch description
> with this? Thanks!

Will do - thanks.
sln
diff mbox series

Patch

diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index 4e01dc32bc08..900216fd56b9 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -137,3 +137,6 @@  own name.
    * - ``event_eq_size``
      - u32
      - Control the size of asynchronous control events EQ.
+   * - ``enable_migration``
+     - Boolean
+     - Enable/disable support for live migration in the devlink device.
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 6a942e70e451..bd85a3ff3774 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -513,6 +513,7 @@  enum devlink_param_generic_id {
 	DEVLINK_PARAM_GENERIC_ID_ENABLE_IWARP,
 	DEVLINK_PARAM_GENERIC_ID_IO_EQ_SIZE,
 	DEVLINK_PARAM_GENERIC_ID_EVENT_EQ_SIZE,
+	DEVLINK_PARAM_GENERIC_ID_ENABLE_MIGRATION,
 
 	/* add new param generic ids above here*/
 	__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -571,6 +572,9 @@  enum devlink_param_generic_id {
 #define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME "event_eq_size"
 #define DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE DEVLINK_PARAM_TYPE_U32
 
+#define DEVLINK_PARAM_GENERIC_ENABLE_MIGRATION_NAME "enable_migration"
+#define DEVLINK_PARAM_GENERIC_ENABLE_MIGRATION_TYPE DEVLINK_PARAM_TYPE_BOOL
+
 #define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate)	\
 {									\
 	.id = DEVLINK_PARAM_GENERIC_ID_##_id,				\
diff --git a/net/devlink/leftover.c b/net/devlink/leftover.c
index 3569706c49e1..2e56dfadd37b 100644
--- a/net/devlink/leftover.c
+++ b/net/devlink/leftover.c
@@ -3923,6 +3923,11 @@  static const struct devlink_param devlink_param_generic[] = {
 		.name = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_NAME,
 		.type = DEVLINK_PARAM_GENERIC_EVENT_EQ_SIZE_TYPE,
 	},
+	{
+		.id = DEVLINK_PARAM_GENERIC_ID_ENABLE_MIGRATION,
+		.name = DEVLINK_PARAM_GENERIC_ENABLE_MIGRATION_NAME,
+		.type = DEVLINK_PARAM_GENERIC_ENABLE_MIGRATION_TYPE,
+	},
 };
 
 static int devlink_param_generic_verify(const struct devlink_param *param)