ice: enable initial devlink support
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 12 Mar 2020 01:58:15 +0000 (18:58 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Sat, 21 Mar 2020 07:55:42 +0000 (00:55 -0700)
commit1adf7ead8204094516994d18e5aa02e34e4765f2
tree3142f75f69d836923ea00d3b71d944bccc6b4a4a
parent84a2479822ddc94845ca3f6a9874106b694eb1ed
ice: enable initial devlink support

Begin implementing support for the devlink interface with the ice
driver.

The pf structure is currently memory managed through devres, via
a devm_alloc. To mimic this behavior, after allocating the devlink
pointer, use devm_add_action to add a teardown action for releasing the
devlink memory on exit.

The ice hardware is a multi-function PCIe device. Thus, each physical
function will get its own devlink instance. This means that each
function will be treated independently, with its own parameters and
configuration. This is done because the ice driver loads a separate
instance for each function.

Due to this, the implementation does not enable devlink to manage
device-wide resources or configuration, as each physical function will
be treated independently. This is done for simplicity, as managing
a devlink instance across multiple driver instances would significantly
increase the complexity for minimal gain.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/Kconfig
drivers/net/ethernet/intel/ice/Makefile
drivers/net/ethernet/intel/ice/ice.h
drivers/net/ethernet/intel/ice/ice_devlink.c [new file with mode: 0644]
drivers/net/ethernet/intel/ice/ice_devlink.h [new file with mode: 0644]
drivers/net/ethernet/intel/ice/ice_main.c