• Jacob Keller's avatar
    ice: introduce ice_vf_lib.c, ice_vf_lib.h, and ice_vf_lib_private.h · 109aba47
    Jacob Keller authored
    Introduce the ice_vf_lib.c file along with the ice_vf_lib.h and
    ice_vf_lib_private.h header files.
    
    These files will house the generic VF structures and access functions.
    Move struct ice_vf and its dependent definitions into this new header
    file.
    
    The ice_vf_lib.c is compiled conditionally on CONFIG_PCI_IOV. Some of
    its functionality is required by all driver files. However, some of its
    functionality will only be required by other files also conditionally
    compiled based on CONFIG_PCI_IOV.
    
    Declaring these functions used only in CONFIG_PCI_IOV files in
    ice_vf_lib.h is verbose. This is because we must provide a fallback
    implementation for each function in this header since it is included in
    files which may not be compiled with CONFIG_PCI_IOV.
    
    Instead, introduce a new ice_vf_lib_private.h header which verifies that
    CONFIG_PCI_IOV is enabled. This header is intended to be directly
    included in .c files which are CONFIG_PCI_IOV only. Add a #error
    indication that will complain if the file ever gets included by another
    C file on a kernel with CONFIG_PCI_IOV disabled. Add a comment
    indicating the nature of the file and why it is useful.
    
    This makes it so that we can easily define functions exposed from
    ice_vf_lib.c into other virtualization files without needing to add
    fallback implementations for every single function.
    
    This begins the path to separate out generic code which will be reused
    by other virtualization implementations from ice_sriov.h and ice_sriov.c
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Tested-by: default avatarKonrad Jankowski <konrad0.jankowski@intel.com>
    Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
    109aba47
ice_virtchnl_fdir.c 52.3 KB