OSDN Git Service

devlink: prepare to support region operations
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 26 Mar 2020 18:37:08 +0000 (11:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 02:39:26 +0000 (19:39 -0700)
commite8937681797c9af491c8a1e362a9db4f4aa1f471
treeaa3bd2e62c552bae9769e1c8e5b7d178668684d0
parent6739ce85919e4fa1d60b8a6e779f54b7156bc960
devlink: prepare to support region operations

Modify the devlink region code in preparation for adding new operations
on regions.

Create a devlink_region_ops structure, and move the name pointer from
within the devlink_region structure into the ops structure (similar to
the devlink_health_reporter_ops).

This prepares the regions to enable support of additional operations in
the future such as requesting snapshots, or accessing the region
directly without a snapshot.

In order to re-use the constant strings in the mlx4 driver their
declaration must be changed to 'const char * const' to ensure the
compiler realizes that both the data and the pointer cannot change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/crdump.c
drivers/net/netdevsim/dev.c
include/net/devlink.h
net/core/devlink.c