-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ice: Add support for VF reset events
Post VF initialization, there are a couple of different ways in which a VF reset can be triggered. One is when the underlying PF itself goes through a reset and other is via a VFLR interrupt. ice_reset_vf introduced in this patch handles both these cases. Also introduced in this patch is a helper function ice_aq_send_msg_to_vf to send messages to VF over the mailbox queue. The PF uses this to send reset notifications to VFs. Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
- Loading branch information
Anirudh Venkataramanan
authored and
Jeff Kirsher
committed
Oct 3, 2018
1 parent
8ede017
commit 007676b
Showing
10 changed files
with
272 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* Copyright (c) 2018, Intel Corporation. */ | ||
|
||
#include "ice_common.h" | ||
#include "ice_adminq_cmd.h" | ||
#include "ice_sriov.h" | ||
|
||
/** | ||
* ice_aq_send_msg_to_vf | ||
* @hw: pointer to the hardware structure | ||
* @vfid: VF ID to send msg | ||
* @v_opcode: opcodes for VF-PF communication | ||
* @v_retval: return error code | ||
* @msg: pointer to the msg buffer | ||
* @msglen: msg length | ||
* @cd: pointer to command details | ||
* | ||
* Send message to VF driver (0x0802) using mailbox | ||
* queue and asynchronously sending message via | ||
* ice_sq_send_cmd() function | ||
*/ | ||
enum ice_status | ||
ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval, | ||
u8 *msg, u16 msglen, struct ice_sq_cd *cd) | ||
{ | ||
struct ice_aqc_pf_vf_msg *cmd; | ||
struct ice_aq_desc desc; | ||
|
||
ice_fill_dflt_direct_cmd_desc(&desc, ice_mbx_opc_send_msg_to_vf); | ||
|
||
cmd = &desc.params.virt; | ||
cmd->id = cpu_to_le32(vfid); | ||
|
||
desc.cookie_high = cpu_to_le32(v_opcode); | ||
desc.cookie_low = cpu_to_le32(v_retval); | ||
|
||
if (msglen) | ||
desc.flags |= cpu_to_le16(ICE_AQ_FLAG_RD); | ||
|
||
return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* Copyright (c) 2018, Intel Corporation. */ | ||
|
||
#ifndef _ICE_SRIOV_H_ | ||
#define _ICE_SRIOV_H_ | ||
|
||
#include "ice_common.h" | ||
|
||
#ifdef CONFIG_PCI_IOV | ||
enum ice_status | ||
ice_aq_send_msg_to_vf(struct ice_hw *hw, u16 vfid, u32 v_opcode, u32 v_retval, | ||
u8 *msg, u16 msglen, struct ice_sq_cd *cd); | ||
|
||
#else /* CONFIG_PCI_IOV */ | ||
static inline enum ice_status | ||
ice_aq_send_msg_to_vf(struct ice_hw __always_unused *hw, | ||
u16 __always_unused vfid, u32 __always_unused v_opcode, | ||
u32 __always_unused v_retval, u8 __always_unused *msg, | ||
u16 __always_unused msglen, | ||
struct ice_sq_cd __always_unused *cd) | ||
{ | ||
return 0; | ||
} | ||
#endif /* CONFIG_PCI_IOV */ | ||
#endif /* _ICE_SRIOV_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters