From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (unknown [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E76AC460A7; Fri, 17 Jan 2025 11:44:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5564C42B71; Fri, 17 Jan 2025 11:43:25 +0100 (CET) Received: from smtpbguseast1.qq.com (smtpbguseast1.qq.com [54.204.34.129]) by mails.dpdk.org (Postfix) with ESMTP id A473D427DE for ; Fri, 17 Jan 2025 11:43:22 +0100 (CET) X-QQ-mid: bizesmtpsz8t1737110597tq3564k X-QQ-Originating-IP: unMdZMDFFkEIij5om8J2uatYB5P1YRN6bO7SdnrCU/8= Received: from DSK-zaiyuwang.trustnetic.com ( [36.24.187.167]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 17 Jan 2025 18:43:15 +0800 (CST) X-QQ-SSF: 0000000000000000000000000000000 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 12404095034145537095 From: Zaiyu Wang To: dev@dpdk.org Cc: Zaiyu Wang , Jiawen Wu Subject: [PATCH v2 02/15] net/ngbe: add support for PF-VF mailbox interface Date: Fri, 17 Jan 2025 18:41:01 +0800 Message-Id: <20250117104115.16528-3-zaiyuwang@trustnetic.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20250117104115.16528-1-zaiyuwang@trustnetic.com> References: <20250109040227.1016-1-zaiyuwang@trustnetic.com> <20250117104115.16528-1-zaiyuwang@trustnetic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpsz:trustnetic.com:qybglogicsvrgz:qybglogicsvrgz5a-1 X-QQ-XMAILINFO: MZj8uWqgIL1NEmWJuMXNcmS5b28moOvEnOilcYgmc0go5zKzPm504jsx VZi32h9yXkdXFP12Wa2P/CfMJnCuZY2KQ25XFEUJFMCEOc2PRE/0aRpGGLtBRS1iskCU/+N TXd0UZjL4F7/kBd1KRJqVMfg3ld48UMd4QLhXkhiitUWPA4ICSG5Ulx71QAITwMJCk2tsO0 XXfYDpXFLhksJnJMXtKbuj6jj/w33sfeQLD5L8esUiEY5YIPe2lP8A2rwi1Q26YYdT8kL4r FmewkeUgOmklitEvkt+NJMF5QiuAk2KYpU7j4Jz9p3jvkY8S7QJNJMjy2hRBjEXb9SpkVFk i5E3a6JkD2Kvl9lbGChiZI03VJ70GKDdu4BQ78j24ow/07SJzKeLStCeSLnAbpGEa7uNPvs +uuCtk0lNWX0JPvUkciHukJGEI99BxvTBMlaAe7MNLQE1VOUfUIlZw988tKX5EMVgx7a69u gsa8uf00cSooB0//JXu3LM40yQrmgmpiho1/8mRI8UxdHhRo/oz24c95on2mLcE9bkFvPi0 ZLjnZl6q4CkVG1Sn5rdsyYYw7igX+G4Bfb5huYXwgBv3CCKiMx2hfE3ZDk/Ka14Xzq8v384 Wjf3GRe3FPtJBoOxuxcDOxVqxGMDCUcIKj8i8YPb1kZaRP2PfAHu5HdGEawOMMRz4T7ApIg hQeYc/1U4yIN2q63O8IMFwJYd+UwxPLBtYgcI46IEnuVL1cNQr7ILtTmyQvDMNQFNuTFE78 azczPkfp+70mXel/3BR6MnV1exaq3tEBq34Qcc/I8sKCsj82cdGA5JK3B2iIyMjr6jFQ+Oy tfcHQZ9HZ0rbbWDBa517pUo326EzhJBIz2YgY8ZlShrOdcPeUNa4az9zqsk30+pAYZgc/s7 MD0NQHa/JrxshsPT49jamnTMBt7ZubGyicR2QXz6yl6d7h14UcuFy4iIcncZxQGt/V6rJT/ weWtJxfyQ09wJHi0P7+QXBAcaNwM1A99uJVEgQoWe1UsQBy/iUwRquHSm X-QQ-XMRINFO: MSVp+SPm3vtS1Vd6Y4Mggwc= X-QQ-RECHKSPAM: 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Add basic code of PF-VF mailbox implementation to serve the communication between VF and PF devices. Signed-off-by: Zaiyu Wang --- drivers/net/ngbe/base/ngbe_mbx.c | 338 ++++++++++++++++++++++++++++++ drivers/net/ngbe/base/ngbe_mbx.h | 29 +++ drivers/net/ngbe/base/ngbe_type.h | 7 + drivers/net/ngbe/base/ngbe_vf.c | 56 +++++ drivers/net/ngbe/base/ngbe_vf.h | 1 + 5 files changed, 431 insertions(+) diff --git a/drivers/net/ngbe/base/ngbe_mbx.c b/drivers/net/ngbe/base/ngbe_mbx.c index bc0adbb3ec..a96a4aced7 100644 --- a/drivers/net/ngbe/base/ngbe_mbx.c +++ b/drivers/net/ngbe/base/ngbe_mbx.c @@ -109,6 +109,344 @@ s32 ngbe_check_for_rst(struct ngbe_hw *hw, u16 mbx_id) return ret_val; } +/** + * ngbe_poll_for_msg - Wait for message notification + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification + **/ +STATIC s32 ngbe_poll_for_msg(struct ngbe_hw *hw, u16 mbx_id) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + if (!countdown || !mbx->check_for_msg) + goto out; + + while (countdown && mbx->check_for_msg(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + if (countdown == 0) + DEBUGOUT("Polling for VF%d mailbox message timedout", mbx_id); + +out: + return countdown ? 0 : NGBE_ERR_MBX; +} + +/** + * ngbe_poll_for_ack - Wait for message acknowledgment + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message acknowledgment + **/ +STATIC s32 ngbe_poll_for_ack(struct ngbe_hw *hw, u16 mbx_id) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + if (!countdown || !mbx->check_for_ack) + goto out; + + while (countdown && mbx->check_for_ack(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + if (countdown == 0) + DEBUGOUT("Polling for VF%d mailbox ack timedout", mbx_id); + +out: + return countdown ? 0 : NGBE_ERR_MBX; +} + +/** + * ngbe_read_posted_mbx - Wait for message notification and receive message + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification and + * copied it into the receive buffer. + **/ +s32 ngbe_read_posted_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = NGBE_ERR_MBX; + + if (!mbx->read) + goto out; + + ret_val = ngbe_poll_for_msg(hw, mbx_id); + + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + ret_val = mbx->read(hw, msg, size, mbx_id); +out: + return ret_val; +} + +/** + * ngbe_write_posted_mbx - Write a message to the mailbox, wait for ack + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer and + * received an ack to that message within delay * timeout period + **/ +s32 ngbe_write_posted_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + s32 ret_val = NGBE_ERR_MBX; + + /* exit if either we can't write or there isn't a defined timeout */ + if (!mbx->write || !mbx->timeout) + goto out; + + /* send msg */ + ret_val = mbx->write(hw, msg, size, mbx_id); + + /* if msg sent wait until we receive an ack */ + if (!ret_val) + ret_val = ngbe_poll_for_ack(hw, mbx_id); +out: + return ret_val; +} + +/** + * ngbe_read_v2p_mailbox - read v2p mailbox + * @hw: pointer to the HW structure + * + * This function is used to read the v2p mailbox without losing the read to + * clear status bits. + **/ +STATIC u32 ngbe_read_v2p_mailbox(struct ngbe_hw *hw) +{ + u32 v2p_mailbox = rd32(hw, NGBE_VFMBCTL); + + v2p_mailbox |= hw->mbx.v2p_mailbox; + hw->mbx.v2p_mailbox |= v2p_mailbox & NGBE_VFMBCTL_R2C_BITS; + + return v2p_mailbox; +} + +/** + * ngbe_check_for_bit_vf - Determine if a status bit was set + * @hw: pointer to the HW structure + * @mask: bitmask for bits to be tested and cleared + * + * This function is used to check for the read to clear bits within + * the V2P mailbox. + **/ +STATIC s32 ngbe_check_for_bit_vf(struct ngbe_hw *hw, u32 mask) +{ + u32 v2p_mailbox = ngbe_read_v2p_mailbox(hw); + s32 ret_val = NGBE_ERR_MBX; + + if (v2p_mailbox & mask) + ret_val = 0; + + hw->mbx.v2p_mailbox &= ~mask; + + return ret_val; +} + +/** + * ngbe_check_for_msg_vf - checks to see if the PF has sent mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the Status bit or else ERR_MBX + **/ +s32 ngbe_check_for_msg_vf(struct ngbe_hw *hw, u16 mbx_id) +{ + s32 ret_val = NGBE_ERR_MBX; + + UNREFERENCED_PARAMETER(mbx_id); + + if (!ngbe_check_for_bit_vf(hw, NGBE_VFMBCTL_PFSTS)) { + ret_val = 0; + hw->mbx.stats.reqs++; + } + + return ret_val; +} + +/** + * ngbe_check_for_ack_vf - checks to see if the PF has ACK'd + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the ACK bit or else ERR_MBX + **/ +s32 ngbe_check_for_ack_vf(struct ngbe_hw *hw, u16 mbx_id) +{ + s32 ret_val = NGBE_ERR_MBX; + + UNREFERENCED_PARAMETER(mbx_id); + + if (!ngbe_check_for_bit_vf(hw, NGBE_VFMBCTL_PFACK)) { + ret_val = 0; + hw->mbx.stats.acks++; + } + + return ret_val; +} + +/** + * ngbe_check_for_rst_vf - checks to see if the PF has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns true if the PF has set the reset done bit or else false + **/ +s32 ngbe_check_for_rst_vf(struct ngbe_hw *hw, u16 mbx_id) +{ + s32 ret_val = NGBE_ERR_MBX; + + UNREFERENCED_PARAMETER(mbx_id); + + if (!ngbe_check_for_bit_vf(hw, (NGBE_VFMBCTL_RSTD | + NGBE_VFMBCTL_RSTI))) { + ret_val = 0; + hw->mbx.stats.rsts++; + } + + return ret_val; +} + +/** + * ngbe_obtain_mbx_lock_vf - obtain mailbox lock + * @hw: pointer to the HW structure + * + * return SUCCESS if we obtained the mailbox lock + **/ +STATIC s32 ngbe_obtain_mbx_lock_vf(struct ngbe_hw *hw) +{ + s32 ret_val = NGBE_ERR_MBX; + + /* Take ownership of the buffer */ + wr32(hw, NGBE_VFMBCTL, NGBE_VFMBCTL_VFU); + + /* reserve mailbox for vf use */ + if (ngbe_read_v2p_mailbox(hw) & NGBE_VFMBCTL_VFU) + ret_val = 0; + + return ret_val; +} + +/** + * ngbe_write_mbx_vf - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +s32 ngbe_write_mbx_vf(struct ngbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val; + u16 i; + + UNREFERENCED_PARAMETER(mbx_id); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = ngbe_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_write; + + /* flush msg and acks as we are overwriting the message buffer */ + ngbe_check_for_msg_vf(hw, 0); + ngbe_check_for_ack_vf(hw, 0); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + wr32a(hw, NGBE_VFMBX, i, msg[i]); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + + /* Drop VFU and interrupt the PF to tell it a message has been sent */ + wr32(hw, NGBE_VFMBCTL, NGBE_VFMBCTL_REQ); + +out_no_write: + return ret_val; +} + +/** + * ngbe_read_mbx_vf - Reads a message from the inbox intended for vf + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfully read message from buffer + **/ +s32 ngbe_read_mbx_vf(struct ngbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val = 0; + u16 i; + + UNREFERENCED_PARAMETER(mbx_id); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = ngbe_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_read; + + /* copy the message from the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = rd32a(hw, NGBE_VFMBX, i); + + /* Acknowledge receipt and release mailbox, then we're done */ + wr32(hw, NGBE_VFMBCTL, NGBE_VFMBCTL_ACK); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + +out_no_read: + return ret_val; +} + +/** + * ngbe_init_mbx_params_vf - set initial values for vf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for vf mailbox + */ +void ngbe_init_mbx_params_vf(struct ngbe_hw *hw) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + + /* start mailbox as timed out and let the reset_hw call set the timeout + * value to begin communications + */ + mbx->timeout = 0; + mbx->usec_delay = NGBE_VF_MBX_INIT_DELAY; + + mbx->size = NGBE_P2VMBX_SIZE; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; +} + STATIC s32 ngbe_check_for_bit_pf(struct ngbe_hw *hw, u32 mask) { u32 mbvficr = rd32(hw, NGBE_MBVFICR); diff --git a/drivers/net/ngbe/base/ngbe_mbx.h b/drivers/net/ngbe/base/ngbe_mbx.h index d47da2718c..83561fd4cf 100644 --- a/drivers/net/ngbe/base/ngbe_mbx.h +++ b/drivers/net/ngbe/base/ngbe_mbx.h @@ -73,11 +73,34 @@ enum ngbevf_xcast_modes { /* length of permanent address message returned from PF */ #define NGBE_VF_PERMADDR_MSG_LEN 4 +/* word in permanent address message with the current multicast type */ +#define NGBE_VF_MC_TYPE_WORD 3 + +#define NGBE_PF_CONTROL_MSG 0x0100 /* PF control message */ + +/* mailbox API, version 2.0 VF requests */ +#define NGBE_VF_API_NEGOTIATE 0x08 /* negotiate API version */ +#define NGBE_VF_GET_QUEUES 0x09 /* get queue configuration */ +#define NGBE_VF_ENABLE_MACADDR 0x0A /* enable MAC address */ +#define NGBE_VF_DISABLE_MACADDR 0x0B /* disable MAC address */ +#define NGBE_VF_GET_MACADDRS 0x0C /* get all configured MAC addrs */ +#define NGBE_VF_SET_MCAST_PROMISC 0x0D /* enable multicast promiscuous */ +#define NGBE_VF_GET_MTU 0x0E /* get bounds on MTU */ +#define NGBE_VF_SET_MTU 0x0F /* set a specific MTU */ + +/* mailbox API, version 2.0 PF requests */ +#define NGBE_PF_TRANSPARENT_VLAN 0x0101 /* enable transparent vlan */ + +#define NGBE_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ +#define NGBE_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ s32 ngbe_read_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); s32 ngbe_write_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); +s32 ngbe_read_posted_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); +s32 ngbe_write_posted_mbx(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); s32 ngbe_check_for_msg(struct ngbe_hw *hw, u16 mbx_id); s32 ngbe_check_for_ack(struct ngbe_hw *hw, u16 mbx_id); s32 ngbe_check_for_rst(struct ngbe_hw *hw, u16 mbx_id); +void ngbe_init_mbx_params_vf(struct ngbe_hw *hw); void ngbe_init_mbx_params_pf(struct ngbe_hw *hw); s32 ngbe_read_mbx_pf(struct ngbe_hw *hw, u32 *msg, u16 size, u16 vf_number); @@ -86,4 +109,10 @@ s32 ngbe_check_for_msg_pf(struct ngbe_hw *hw, u16 vf_number); s32 ngbe_check_for_ack_pf(struct ngbe_hw *hw, u16 vf_number); s32 ngbe_check_for_rst_pf(struct ngbe_hw *hw, u16 vf_number); +s32 ngbe_read_mbx_vf(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); +s32 ngbe_write_mbx_vf(struct ngbe_hw *hw, u32 *msg, u16 size, u16 mbx_id); +s32 ngbe_check_for_msg_vf(struct ngbe_hw *hw, u16 mbx_id); +s32 ngbe_check_for_ack_vf(struct ngbe_hw *hw, u16 mbx_id); +s32 ngbe_check_for_rst_vf(struct ngbe_hw *hw, u16 mbx_id); + #endif /* _NGBE_MBX_H_ */ diff --git a/drivers/net/ngbe/base/ngbe_type.h b/drivers/net/ngbe/base/ngbe_type.h index a987bbe25b..35ebb7208a 100644 --- a/drivers/net/ngbe/base/ngbe_type.h +++ b/drivers/net/ngbe/base/ngbe_type.h @@ -311,6 +311,7 @@ struct ngbe_mac_info { s32 (*enable_sec_rx_path)(struct ngbe_hw *hw); s32 (*acquire_swfw_sync)(struct ngbe_hw *hw, u32 mask); void (*release_swfw_sync)(struct ngbe_hw *hw, u32 mask); + s32 (*negotiate_api_version)(struct ngbe_hw *hw, int api); /* Link */ s32 (*setup_link)(struct ngbe_hw *hw, u32 speed, @@ -422,6 +423,10 @@ struct ngbe_mbx_info { void (*init_params)(struct ngbe_hw *hw); s32 (*read)(struct ngbe_hw *hw, u32 *msg, u16 size, u16 vf_number); s32 (*write)(struct ngbe_hw *hw, u32 *msg, u16 size, u16 vf_number); + s32 (*read_posted)(struct ngbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id); + s32 (*write_posted)(struct ngbe_hw *hw, u32 *msg, u16 size, + u16 mbx_id); s32 (*check_for_msg)(struct ngbe_hw *hw, u16 mbx_id); s32 (*check_for_ack)(struct ngbe_hw *hw, u16 mbx_id); s32 (*check_for_rst)(struct ngbe_hw *hw, u16 mbx_id); @@ -429,6 +434,7 @@ struct ngbe_mbx_info { struct ngbe_mbx_stats stats; u32 timeout; u32 usec_delay; + u32 v2p_mailbox; u16 size; }; @@ -458,6 +464,7 @@ struct ngbe_hw { u8 port_id; u8 revision_id; bool adapter_stopped; + int api_version; bool wol_enabled; bool ncsi_enabled; bool lldp_enabled; diff --git a/drivers/net/ngbe/base/ngbe_vf.c b/drivers/net/ngbe/base/ngbe_vf.c index 91b8d1bbe2..12aa3bca1a 100644 --- a/drivers/net/ngbe/base/ngbe_vf.c +++ b/drivers/net/ngbe/base/ngbe_vf.c @@ -4,8 +4,52 @@ */ #include "ngbe_type.h" +#include "ngbe_mbx.h" #include "ngbe_vf.h" +STATIC s32 ngbevf_write_msg_read_ack(struct ngbe_hw *hw, u32 *msg, + u32 *retmsg, u16 size) +{ + struct ngbe_mbx_info *mbx = &hw->mbx; + s32 retval = mbx->write_posted(hw, msg, size, 0); + + if (retval) + return retval; + + return mbx->read_posted(hw, retmsg, size, 0); +} + +/** + * ngbevf_negotiate_api_version - Negotiate supported API version + * @hw: pointer to the HW structure + * @api: integer containing requested API version + **/ +int ngbevf_negotiate_api_version(struct ngbe_hw *hw, int api) +{ + int err; + u32 msg[3]; + + /* Negotiate the mailbox API version */ + msg[0] = NGBE_VF_API_NEGOTIATE; + msg[1] = api; + msg[2] = 0; + + err = ngbevf_write_msg_read_ack(hw, msg, msg, 3); + if (!err) { + msg[0] &= ~NGBE_VT_MSGTYPE_CTS; + + /* Store value and return 0 on success */ + if (msg[0] == (NGBE_VF_API_NEGOTIATE | NGBE_VT_MSGTYPE_ACK)) { + hw->api_version = api; + return 0; + } + + err = NGBE_ERR_INVALID_ARGUMENT; + } + + return err; +} + /** * ngbe_init_ops_vf - Initialize the pointers for vf * @hw: pointer to hardware structure @@ -18,9 +62,21 @@ s32 ngbe_init_ops_vf(struct ngbe_hw *hw) { struct ngbe_mac_info *mac = &hw->mac; + struct ngbe_mbx_info *mbx = &hw->mbx; + + mac->negotiate_api_version = ngbevf_negotiate_api_version; mac->max_tx_queues = 1; mac->max_rx_queues = 1; + mbx->init_params = ngbe_init_mbx_params_vf; + mbx->read = ngbe_read_mbx_vf; + mbx->write = ngbe_write_mbx_vf; + mbx->read_posted = ngbe_read_posted_mbx; + mbx->write_posted = ngbe_write_posted_mbx; + mbx->check_for_msg = ngbe_check_for_msg_vf; + mbx->check_for_ack = ngbe_check_for_ack_vf; + mbx->check_for_rst = ngbe_check_for_rst_vf; + return 0; } diff --git a/drivers/net/ngbe/base/ngbe_vf.h b/drivers/net/ngbe/base/ngbe_vf.h index 7982ea231e..23e5b0d8a3 100644 --- a/drivers/net/ngbe/base/ngbe_vf.h +++ b/drivers/net/ngbe/base/ngbe_vf.h @@ -9,5 +9,6 @@ #include "ngbe_type.h" s32 ngbe_init_ops_vf(struct ngbe_hw *hw); +int ngbevf_negotiate_api_version(struct ngbe_hw *hw, int api); #endif /* __NGBE_VF_H__ */ -- 2.21.0.windows.1