mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 05:55:02 +08:00
2ae0aa4758
Keeping devlink port inside VSI data structure causes some issues. Since VF VSI is released during reset that means that we have to unregister devlink port and register it again every time reset is triggered. With the new changes in devlink API it might cause deadlock issues. After calling devlink_port_register/devlink_port_unregister devlink API is going to lock rtnl_mutex. It's an issue when VF reset is triggered in netlink operation context (like setting VF MAC address or VLAN), because rtnl_lock is already taken by netlink. Another call of rtnl_lock from devlink API results in dead-lock. By moving devlink port to PF/VF we avoid creating/destroying it during reset. Since this patch, devlink ports are created during ice_probe, destroyed during ice_remove for PF and created during ice_repr_add, destroyed during ice_repr_rem for VF. Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com> Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
20 lines
623 B
C
20 lines
623 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/* Copyright (c) 2019, Intel Corporation. */
|
|
|
|
#ifndef _ICE_DEVLINK_H_
|
|
#define _ICE_DEVLINK_H_
|
|
|
|
struct ice_pf *ice_allocate_pf(struct device *dev);
|
|
|
|
void ice_devlink_register(struct ice_pf *pf);
|
|
void ice_devlink_unregister(struct ice_pf *pf);
|
|
int ice_devlink_create_pf_port(struct ice_pf *pf);
|
|
void ice_devlink_destroy_pf_port(struct ice_pf *pf);
|
|
int ice_devlink_create_vf_port(struct ice_vf *vf);
|
|
void ice_devlink_destroy_vf_port(struct ice_vf *vf);
|
|
|
|
void ice_devlink_init_regions(struct ice_pf *pf);
|
|
void ice_devlink_destroy_regions(struct ice_pf *pf);
|
|
|
|
#endif /* _ICE_DEVLINK_H_ */
|