FreeBSD kernel IXGBE device code
ixgbe_vf.c File Reference
#include "ixgbe.h"
Include dependency graph for ixgbe_vf.c:

Go to the source code of this file.

Macros

#define IXGBE_VFWRITE_REG   IXGBE_WRITE_REG
 
#define IXGBE_VFREAD_REG   IXGBE_READ_REG
 

Functions

s32 ixgbe_init_ops_vf (struct ixgbe_hw *hw)
 
static void ixgbe_virt_clr_reg (struct ixgbe_hw *hw)
 
s32 ixgbe_start_hw_vf (struct ixgbe_hw *hw)
 
s32 ixgbe_init_hw_vf (struct ixgbe_hw *hw)
 
s32 ixgbe_reset_hw_vf (struct ixgbe_hw *hw)
 
s32 ixgbe_stop_adapter_vf (struct ixgbe_hw *hw)
 
static s32 ixgbe_mta_vector (struct ixgbe_hw *hw, u8 *mc_addr)
 
static s32 ixgbevf_write_msg_read_ack (struct ixgbe_hw *hw, u32 *msg, u32 *retmsg, u16 size)
 
s32 ixgbe_set_rar_vf (struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, u32 enable_addr)
 
s32 ixgbe_update_mc_addr_list_vf (struct ixgbe_hw *hw, u8 *mc_addr_list, u32 mc_addr_count, ixgbe_mc_addr_itr next, bool clear)
 
s32 ixgbevf_update_xcast_mode (struct ixgbe_hw *hw, int xcast_mode)
 
s32 ixgbe_get_link_state_vf (struct ixgbe_hw *hw, bool *link_state)
 
s32 ixgbe_set_vfta_vf (struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool vlvf_bypass)
 
u32 ixgbe_get_num_of_tx_queues_vf (struct ixgbe_hw *hw)
 
u32 ixgbe_get_num_of_rx_queues_vf (struct ixgbe_hw *hw)
 
s32 ixgbe_get_mac_addr_vf (struct ixgbe_hw *hw, u8 *mac_addr)
 
s32 ixgbevf_set_uc_addr_vf (struct ixgbe_hw *hw, u32 index, u8 *addr)
 
s32 ixgbe_setup_mac_link_vf (struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait_to_complete)
 
s32 ixgbe_check_mac_link_vf (struct ixgbe_hw *hw, ixgbe_link_speed *speed, bool *link_up, bool autoneg_wait_to_complete)
 
s32 ixgbevf_rlpml_set_vf (struct ixgbe_hw *hw, u16 max_size)
 
int ixgbevf_negotiate_api_version (struct ixgbe_hw *hw, int api)
 
int ixgbevf_get_queues (struct ixgbe_hw *hw, unsigned int *num_tcs, unsigned int *default_tc)
 

Macro Definition Documentation

◆ IXGBE_VFREAD_REG

#define IXGBE_VFREAD_REG   IXGBE_READ_REG

Definition at line 40 of file ixgbe_vf.c.

◆ IXGBE_VFWRITE_REG

#define IXGBE_VFWRITE_REG   IXGBE_WRITE_REG

Definition at line 39 of file ixgbe_vf.c.

Function Documentation

◆ ixgbe_check_mac_link_vf()

s32 ixgbe_check_mac_link_vf ( struct ixgbe_hw hw,
ixgbe_link_speed speed,
bool link_up,
bool  autoneg_wait_to_complete 
)

ixgbe_check_mac_link_vf - Get link/speed status @hw: pointer to hardware structure @speed: pointer to link speed @link_up: true is link is up, false otherwise @autoneg_wait_to_complete: true when waiting for completion is needed

Reads the links register to determine if link is up and the current speed

Definition at line 606 of file ixgbe_vf.c.

References ixgbe_mbx_operations::check_for_rst, ixgbe_mac_info::get_link_status, IXGBE_LINK_SPEED_100_FULL, IXGBE_LINK_SPEED_10_FULL, IXGBE_LINK_SPEED_10GB_FULL, IXGBE_LINK_SPEED_1GB_FULL, IXGBE_LINK_SPEED_2_5GB_FULL, IXGBE_LINK_SPEED_5GB_FULL, IXGBE_LINK_SPEED_UNKNOWN, IXGBE_LINKS_SPEED_100_82599, IXGBE_LINKS_SPEED_10_X550EM_A, IXGBE_LINKS_SPEED_10G_82599, IXGBE_LINKS_SPEED_1G_82599, IXGBE_LINKS_SPEED_82599, IXGBE_LINKS_SPEED_NON_STD, IXGBE_LINKS_UP, ixgbe_mac_82599_vf, ixgbe_mac_X550, IXGBE_READ_REG, IXGBE_SUCCESS, IXGBE_VFLINKS, IXGBE_VT_MSGTYPE_CTS, IXGBE_VT_MSGTYPE_NACK, ixgbe_hw::mac, ixgbe_hw::mbx, ixgbe_mbx_info::ops, ixgbe_mbx_operations::read, ixgbe_mbx_info::timeout, ixgbe_mac_info::type, UNREFERENCED_1PARAMETER, and usec_delay.

Referenced by ixgbe_init_ops_vf().

Here is the caller graph for this function:

◆ ixgbe_get_link_state_vf()

s32 ixgbe_get_link_state_vf ( struct ixgbe_hw hw,
bool link_state 
)

ixgbe_get_link_state_vf - Get VF link state from PF @hw: pointer to the HW structure @link_state: link state storage

Returns state of the operation error or success.

Definition at line 463 of file ixgbe_vf.c.

References IXGBE_ERR_MBX, IXGBE_SUCCESS, IXGBE_VF_GET_LINK_STATE, IXGBE_VT_MSGTYPE_NACK, and ixgbevf_write_msg_read_ack().

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_get_mac_addr_vf()

s32 ixgbe_get_mac_addr_vf ( struct ixgbe_hw hw,
u8 mac_addr 
)

ixgbe_get_mac_addr_vf - Read device MAC address @hw: pointer to the HW structure @mac_addr: the MAC address

Definition at line 542 of file ixgbe_vf.c.

References IXGBE_ETH_LENGTH_OF_ADDRESS, IXGBE_SUCCESS, ixgbe_hw::mac, and ixgbe_mac_info::perm_addr.

Referenced by ixgbe_init_ops_vf(), and ixgbe_set_rar_vf().

Here is the caller graph for this function:

◆ ixgbe_get_num_of_rx_queues_vf()

u32 ixgbe_get_num_of_rx_queues_vf ( struct ixgbe_hw hw)

ixgbe_get_num_of_rx_queues_vf - Get number of RX queues @hw: pointer to hardware structure

Returns the number of receive queues for the given adapter.

Definition at line 531 of file ixgbe_vf.c.

References IXGBE_VF_MAX_RX_QUEUES, and UNREFERENCED_1PARAMETER.

◆ ixgbe_get_num_of_tx_queues_vf()

u32 ixgbe_get_num_of_tx_queues_vf ( struct ixgbe_hw hw)

ixgbe_get_num_of_tx_queues_vf - Get number of TX queues @hw: pointer to hardware structure

Returns the number of transmit queues for the given adapter.

Definition at line 519 of file ixgbe_vf.c.

References IXGBE_VF_MAX_TX_QUEUES, and UNREFERENCED_1PARAMETER.

◆ ixgbe_init_hw_vf()

s32 ixgbe_init_hw_vf ( struct ixgbe_hw hw)

ixgbe_init_hw_vf - virtual function hardware initialization @hw: pointer to hardware structure

Initialize the hardware by resetting the hardware and then starting the hardware

Definition at line 158 of file ixgbe_vf.c.

References ixgbe_mac_info::addr, ixgbe_mac_operations::get_mac_addr, ixgbe_hw::mac, ixgbe_mac_info::ops, and ixgbe_mac_operations::start_hw.

Referenced by ixgbe_init_ops_vf().

Here is the caller graph for this function:

◆ ixgbe_init_ops_vf()

s32 ixgbe_init_ops_vf ( struct ixgbe_hw hw)

ixgbe_init_ops_vf - Initialize the pointers for vf @hw: pointer to hardware structure

This will assign function pointers, adapter-specific functions can override the assignment of generic function pointers by assigning their own adapter-specific function pointers. Does not touch the hardware.

Definition at line 51 of file ixgbe_vf.c.

References ixgbe_mac_operations::check_link, ixgbe_mac_operations::clear_hw_cntrs, ixgbe_mac_operations::clear_vfta, ixgbe_mac_operations::disable_mc, ixgbe_mac_operations::enable_mc, ixgbe_mac_operations::get_bus_info, ixgbe_mac_operations::get_link_capabilities, ixgbe_mac_operations::get_link_state, ixgbe_mac_operations::get_mac_addr, ixgbe_mac_operations::get_media_type, ixgbe_mac_operations::init_hw, ixgbe_mbx_operations::init_params, ixgbe_mac_operations::init_rx_addrs, ixgbe_check_mac_link_vf(), ixgbe_get_link_state_vf(), ixgbe_get_mac_addr_vf(), ixgbe_init_hw_vf(), ixgbe_init_mbx_params_vf(), ixgbe_reset_hw_vf(), ixgbe_set_rar_vf(), ixgbe_set_vfta_vf(), ixgbe_setup_mac_link_vf(), ixgbe_start_hw_vf(), ixgbe_stop_adapter_vf(), IXGBE_SUCCESS, ixgbe_update_mc_addr_list_vf(), ixgbevf_negotiate_api_version(), ixgbevf_rlpml_set_vf(), ixgbevf_set_uc_addr_vf(), ixgbevf_update_xcast_mode(), ixgbe_hw::mac, ixgbe_mac_info::max_rx_queues, ixgbe_mac_info::max_tx_queues, ixgbe_hw::mbx, ixgbe_mac_operations::negotiate_api_version, ixgbe_mac_info::ops, ixgbe_mbx_info::ops, ixgbe_mac_operations::reset_hw, ixgbe_mac_operations::set_rar, ixgbe_mac_operations::set_rlpml, ixgbe_mac_operations::set_uc_addr, ixgbe_mac_operations::set_vfta, ixgbe_mac_operations::setup_link, ixgbe_mac_operations::start_hw, ixgbe_mac_operations::stop_adapter, ixgbe_mac_operations::update_mc_addr_list, and ixgbe_mac_operations::update_xcast_mode.

Referenced by ixgbe_init_shared_code(), and ixv_if_attach_pre().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_mta_vector()

static s32 ixgbe_mta_vector ( struct ixgbe_hw hw,
u8 mc_addr 
)
static

ixgbe_mta_vector - Determines bit-vector in multicast table to set @hw: pointer to hardware structure @mc_addr: the multicast address

Extracts the 12 bits, from a multicast address, to determine which bit-vector to set in the multicast table. The hardware uses 12 bits, from incoming rx multicast addresses, to determine the bit-vector to check in the MTA. Which of the 4 combination, of 12-bits, the hardware uses is set by the MO field of the MCSTCTRL. The MO field is set during initialization to mc_filter_type.

Definition at line 297 of file ixgbe_vf.c.

References ASSERT, DEBUGOUT, ixgbe_hw::mac, and ixgbe_mac_info::mc_filter_type.

Referenced by ixgbe_update_mc_addr_list_vf().

Here is the caller graph for this function:

◆ ixgbe_reset_hw_vf()

◆ ixgbe_set_rar_vf()

s32 ixgbe_set_rar_vf ( struct ixgbe_hw hw,
u32  index,
u8 addr,
u32  vmdq,
u32  enable_addr 
)

ixgbe_set_rar_vf - set device MAC address @hw: pointer to hardware structure @index: Receive address register to write @addr: Address to put into receive address register @vmdq: VMDq "set" or "pool" index @enable_addr: set flag that address is active

Definition at line 345 of file ixgbe_vf.c.

References ixgbe_mac_info::addr, IXGBE_ERR_MBX, ixgbe_get_mac_addr_vf(), IXGBE_VF_SET_MAC_ADDR, IXGBE_VT_MSGTYPE_NACK, ixgbevf_write_msg_read_ack(), ixgbe_hw::mac, and UNREFERENCED_3PARAMETER.

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_set_vfta_vf()

s32 ixgbe_set_vfta_vf ( struct ixgbe_hw hw,
u32  vlan,
u32  vind,
bool  vlan_on,
bool  vlvf_bypass 
)

ixgbe_set_vfta_vf - Set/Unset vlan filter table address @hw: pointer to the HW structure @vlan: 12 bit VLAN ID @vind: unused by VF drivers @vlan_on: if true then set bit, else clear bit @vlvf_bypass: boolean flag indicating updating default pool is okay

Turn on/off specified VLAN in the VLAN filter table.

Definition at line 494 of file ixgbe_vf.c.

References IXGBE_SUCCESS, IXGBE_VF_SET_VLAN, IXGBE_VT_MSGINFO_SHIFT, IXGBE_VT_MSGTYPE_ACK, IXGBE_VT_MSGTYPE_NACK, ixgbevf_write_msg_read_ack(), and UNREFERENCED_2PARAMETER.

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_setup_mac_link_vf()

s32 ixgbe_setup_mac_link_vf ( struct ixgbe_hw hw,
ixgbe_link_speed  speed,
bool  autoneg_wait_to_complete 
)

ixgbe_setup_mac_link_vf - Setup MAC link settings @hw: pointer to hardware structure @speed: new link speed @autoneg_wait_to_complete: true when waiting for completion is needed

Set the link speed in the AUTOC register and restarts link.

Definition at line 590 of file ixgbe_vf.c.

References IXGBE_SUCCESS, and UNREFERENCED_3PARAMETER.

Referenced by ixgbe_init_ops_vf().

Here is the caller graph for this function:

◆ ixgbe_start_hw_vf()

s32 ixgbe_start_hw_vf ( struct ixgbe_hw hw)

ixgbe_start_hw_vf - Prepare hardware for Tx/Rx @hw: pointer to hardware structure

Starts the hardware by filling the bus info structure and media type, clears all on chip counters, initializes receive address registers, multicast table, VLAN filter table, calls routine to set up link and flow control settings, and leaves transmit and receive units disabled and uninitialized

Definition at line 143 of file ixgbe_vf.c.

References ixgbe_hw::adapter_stopped, and IXGBE_SUCCESS.

Referenced by ixgbe_init_ops_vf().

Here is the caller graph for this function:

◆ ixgbe_stop_adapter_vf()

s32 ixgbe_stop_adapter_vf ( struct ixgbe_hw hw)

ixgbe_stop_adapter_vf - Generic stop Tx/Rx units @hw: pointer to hardware structure

Sets the adapter_stopped flag within ixgbe_hw struct. Clears interrupts, disables transmit and receive units. The adapter_stopped flag is used by the shared code and drivers to determine if the adapter is in a stopped state and should not touch the hardware.

Definition at line 248 of file ixgbe_vf.c.

References ixgbe_hw::adapter_stopped, IXGBE_SUCCESS, IXGBE_TXDCTL_SWFLSH, IXGBE_VF_IRQ_CLEAR_MASK, IXGBE_VFPSRTYPE, IXGBE_VFREAD_REG, IXGBE_VFRXDCTL, IXGBE_VFTXDCTL, IXGBE_VFWRITE_REG, IXGBE_VTEICR, IXGBE_VTEIMC, IXGBE_WRITE_FLUSH, IXGBE_WRITE_REG, ixgbe_hw::mac, ixgbe_mac_info::max_rx_queues, ixgbe_mac_info::max_tx_queues, and msec_delay.

Referenced by ixgbe_init_ops_vf().

Here is the caller graph for this function:

◆ ixgbe_update_mc_addr_list_vf()

s32 ixgbe_update_mc_addr_list_vf ( struct ixgbe_hw hw,
u8 mc_addr_list,
u32  mc_addr_count,
ixgbe_mc_addr_itr  next,
bool  clear 
)

ixgbe_update_mc_addr_list_vf - Update Multicast addresses @hw: pointer to the HW structure @mc_addr_list: array of multicast addresses to program @mc_addr_count: number of multicast addresses to program @next: caller supplied function to return next address in list @clear: unused

Updates the Multicast Table Array.

Definition at line 380 of file ixgbe_vf.c.

References DEBUGFUNC, DEBUGOUT1, ixgbe_mta_vector(), IXGBE_VF_SET_MULTICAST, IXGBE_VFMAILBOX_SIZE, IXGBE_VT_MSGINFO_SHIFT, ixgbe_hw::mbx, ixgbe_mbx_info::ops, UNREFERENCED_1PARAMETER, and ixgbe_mbx_operations::write_posted.

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbe_virt_clr_reg()

◆ ixgbevf_get_queues()

◆ ixgbevf_negotiate_api_version()

int ixgbevf_negotiate_api_version ( struct ixgbe_hw hw,
int  api 
)

ixgbevf_negotiate_api_version - Negotiate supported API version @hw: pointer to the HW structure @api: integer containing requested API version

Definition at line 728 of file ixgbe_vf.c.

References ixgbe_hw::api_version, IXGBE_ERR_INVALID_ARGUMENT, IXGBE_VF_API_NEGOTIATE, IXGBE_VT_MSGTYPE_ACK, and ixgbevf_write_msg_read_ack().

Referenced by ixgbe_init_ops_vf(), and ixv_negotiate_api().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbevf_rlpml_set_vf()

s32 ixgbevf_rlpml_set_vf ( struct ixgbe_hw hw,
u16  max_size 
)

ixgbevf_rlpml_set_vf - Set the maximum receive packet length @hw: pointer to the HW structure @max_size: value to assign to max frame size

Definition at line 705 of file ixgbe_vf.c.

References IXGBE_ERR_MBX, IXGBE_VF_SET_LPE, IXGBE_VT_MSGTYPE_NACK, and ixgbevf_write_msg_read_ack().

Referenced by ixgbe_init_ops_vf(), and ixv_initialize_receive_units().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbevf_set_uc_addr_vf()

s32 ixgbevf_set_uc_addr_vf ( struct ixgbe_hw hw,
u32  index,
u8 addr 
)

Definition at line 552 of file ixgbe_vf.c.

References IXGBE_ERR_OUT_OF_MEM, IXGBE_VF_SET_MACVLAN, IXGBE_VT_MSGINFO_SHIFT, IXGBE_VT_MSGTYPE_NACK, and ixgbevf_write_msg_read_ack().

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbevf_update_xcast_mode()

s32 ixgbevf_update_xcast_mode ( struct ixgbe_hw hw,
int  xcast_mode 
)

ixgbevf_update_xcast_mode - Update Multicast mode @hw: pointer to the HW structure @xcast_mode: new multicast mode

Updates the Multicast Mode of VF.

Definition at line 426 of file ixgbe_vf.c.

References ixgbe_hw::api_version, IXGBE_ERR_FEATURE_NOT_SUPPORTED, ixgbe_mbox_api_12, ixgbe_mbox_api_13, IXGBE_SUCCESS, IXGBE_VF_UPDATE_XCAST_MODE, IXGBE_VT_MSGTYPE_NACK, ixgbevf_write_msg_read_ack(), and IXGBEVF_XCAST_MODE_ALLMULTI.

Referenced by ixgbe_init_ops_vf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ixgbevf_write_msg_read_ack()

static s32 ixgbevf_write_msg_read_ack ( struct ixgbe_hw hw,
u32 msg,
u32 retmsg,
u16  size 
)
static