Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl.h
Show All 26 Lines | /****************************************************************************** | ||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
POSSIBILITY OF SUCH DAMAGE. | POSSIBILITY OF SUCH DAMAGE. | ||||
******************************************************************************/ | ******************************************************************************/ | ||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#ifndef _IXL_H_ | #ifndef _IXL_H_ | ||||
#define _IXL_H_ | #define _IXL_H_ | ||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#include "opt_rss.h" | #include "opt_rss.h" | ||||
#include "opt_ixl.h" | #include "opt_ixl.h" | ||||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
/* Alignment for rings */ | /* Alignment for rings */ | ||||
#define DBA_ALIGN 128 | #define DBA_ALIGN 128 | ||||
#define MAX_MULTICAST_ADDR 128 | #define MAX_MULTICAST_ADDR 128 | ||||
#define IXL_MSIX_BAR 3 | #define IXL_MSIX_BAR 3 | ||||
#define IXL_ADM_LIMIT 2 | #define IXL_ADM_LIMIT 2 | ||||
// TODO: Find out which TSO_SIZE to use | |||||
//#define IXL_TSO_SIZE 65535 | |||||
#define IXL_TSO_SIZE ((255*1024)-1) | #define IXL_TSO_SIZE ((255*1024)-1) | ||||
#define IXL_TX_BUF_SZ ((u32) 1514) | #define IXL_TX_BUF_SZ ((u32) 1514) | ||||
#define IXL_AQ_BUF_SZ ((u32) 4096) | #define IXL_AQ_BUF_SZ ((u32) 4096) | ||||
#define IXL_RX_ITR 0 | #define IXL_RX_ITR 0 | ||||
#define IXL_TX_ITR 1 | #define IXL_TX_ITR 1 | ||||
#define IXL_ITR_NONE 3 | #define IXL_ITR_NONE 3 | ||||
#define IXL_QUEUE_EOL 0x7FF | #define IXL_QUEUE_EOL 0x7FF | ||||
#define IXL_MIN_FRAME 17 | |||||
#define IXL_MAX_FRAME 9728 | #define IXL_MAX_FRAME 9728 | ||||
#define IXL_MAX_TX_SEGS 8 | #define IXL_MAX_TX_SEGS 8 | ||||
#define IXL_MAX_RX_SEGS 5 | #define IXL_MAX_RX_SEGS 5 | ||||
#define IXL_MAX_TSO_SEGS 128 | #define IXL_MAX_TSO_SEGS 128 | ||||
#define IXL_SPARSE_CHAIN 7 | #define IXL_SPARSE_CHAIN 7 | ||||
#define IXL_MIN_TSO_MSS 64 | #define IXL_MIN_TSO_MSS 64 | ||||
#define IXL_MAX_TSO_MSS 9668 | |||||
#define IXL_MAX_DMA_SEG_SIZE ((16 * 1024) - 1) | #define IXL_MAX_DMA_SEG_SIZE ((16 * 1024) - 1) | ||||
#define IXL_RSS_KEY_SIZE_REG 13 | #define IXL_RSS_KEY_SIZE_REG 13 | ||||
#define IXL_RSS_KEY_SIZE (IXL_RSS_KEY_SIZE_REG * 4) | #define IXL_RSS_KEY_SIZE (IXL_RSS_KEY_SIZE_REG * 4) | ||||
#define IXL_RSS_VSI_LUT_SIZE 64 /* X722 -> VSI, X710 -> VF */ | #define IXL_RSS_VSI_LUT_SIZE 64 /* X722 -> VSI, X710 -> VF */ | ||||
#define IXL_RSS_VSI_LUT_ENTRY_MASK 0x3F | #define IXL_RSS_VSI_LUT_ENTRY_MASK 0x3F | ||||
#define IXL_RSS_VF_LUT_ENTRY_MASK 0xF | #define IXL_RSS_VF_LUT_ENTRY_MASK 0xF | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#define IXL_VSI_DATA_PORT 0x01 | #define IXL_VSI_DATA_PORT 0x01 | ||||
#define IXLV_MAX_QUEUES 16 | #define IXLV_MAX_QUEUES 16 | ||||
#define IXL_MAX_VSI_QUEUES (2 * (I40E_VSILAN_QTABLE_MAX_INDEX + 1)) | #define IXL_MAX_VSI_QUEUES (2 * (I40E_VSILAN_QTABLE_MAX_INDEX + 1)) | ||||
#define IXL_RX_CTX_BASE_UNITS 128 | #define IXL_RX_CTX_BASE_UNITS 128 | ||||
#define IXL_TX_CTX_BASE_UNITS 128 | #define IXL_TX_CTX_BASE_UNITS 128 | ||||
#if 0 | |||||
#define IXL_VPINT_LNKLSTN_REG(hw, vector, vf_num) \ | |||||
I40E_VPINT_LNKLSTN(((vector) - 1) + \ | |||||
(((hw)->func_caps.num_msix_vectors_vf - 1) * (vf_num))) | |||||
#define IXL_VFINT_DYN_CTLN_REG(hw, vector, vf_num) \ | |||||
I40E_VFINT_DYN_CTLN(((vector) - 1) + \ | |||||
(((hw)->func_caps.num_msix_vectors_vf - 1) * (vf_num))) | |||||
#endif | |||||
#define IXL_PF_PCI_CIAA_VF_DEVICE_STATUS 0xAA | #define IXL_PF_PCI_CIAA_VF_DEVICE_STATUS 0xAA | ||||
#define IXL_PF_PCI_CIAD_VF_TRANS_PENDING_MASK 0x20 | #define IXL_PF_PCI_CIAD_VF_TRANS_PENDING_MASK 0x20 | ||||
#define IXL_GLGEN_VFLRSTAT_INDEX(glb_vf) ((glb_vf) / 32) | #define IXL_GLGEN_VFLRSTAT_INDEX(glb_vf) ((glb_vf) / 32) | ||||
#define IXL_GLGEN_VFLRSTAT_MASK(glb_vf) (1 << ((glb_vf) % 32)) | #define IXL_GLGEN_VFLRSTAT_MASK(glb_vf) (1 << ((glb_vf) % 32)) | ||||
#define IXL_MAX_ITR_IDX 3 | #define IXL_MAX_ITR_IDX 3 | ||||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
#define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count) | #define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count) | ||||
#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count) | #define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count) | ||||
#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count) | #define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count) | ||||
#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count) | #define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count) | ||||
#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops) | #define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops) | ||||
#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) | #define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count) | ||||
#endif | #endif | ||||
/* For stats sysctl naming */ | |||||
#define QUEUE_NAME_LEN 32 | |||||
#define IXL_DEV_ERR(_dev, _format, ...) \ | #define IXL_DEV_ERR(_dev, _format, ...) \ | ||||
device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) | device_printf(_dev, "%s: " _format " (%s:%d)\n", __func__, ##__VA_ARGS__, __FILE__, __LINE__) | ||||
/* | /* | ||||
***************************************************************************** | ***************************************************************************** | ||||
* vendor_info_array | * vendor_info_array | ||||
* | * | ||||
* This array contains the list of Subvendor/Subdevice IDs on which the driver | * This array contains the list of Subvendor/Subdevice IDs on which the driver | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
** Virtual Station Interface | ** Virtual Station Interface | ||||
*/ | */ | ||||
SLIST_HEAD(ixl_ftl_head, ixl_mac_filter); | SLIST_HEAD(ixl_ftl_head, ixl_mac_filter); | ||||
struct ixl_vsi { | struct ixl_vsi { | ||||
if_ctx_t ctx; | if_ctx_t ctx; | ||||
if_softc_ctx_t shared; | if_softc_ctx_t shared; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
//device_t dev; | device_t dev; | ||||
struct i40e_hw *hw; | struct i40e_hw *hw; | ||||
struct ifmedia *media; | struct ifmedia *media; | ||||
#define num_rx_queues shared->isc_nrxqsets | |||||
#define num_tx_queues shared->isc_ntxqsets | |||||
int num_rx_queues; | |||||
int num_tx_queues; | |||||
void *back; | void *back; | ||||
enum i40e_vsi_type type; | enum i40e_vsi_type type; | ||||
// TODO: Remove? | |||||
u64 que_mask; | |||||
int id; | int id; | ||||
u32 rx_itr_setting; | u32 rx_itr_setting; | ||||
u32 tx_itr_setting; | u32 tx_itr_setting; | ||||
bool enable_head_writeback; | bool enable_head_writeback; | ||||
u16 vsi_num; | u16 vsi_num; | ||||
bool link_active; | bool link_active; | ||||
u16 seid; | u16 seid; | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | struct ixl_sysctl_info { | ||||
u64 *stat; | u64 *stat; | ||||
char *name; | char *name; | ||||
char *description; | char *description; | ||||
}; | }; | ||||
extern const uint8_t ixl_bcast_addr[ETHER_ADDR_LEN]; | extern const uint8_t ixl_bcast_addr[ETHER_ADDR_LEN]; | ||||
/* Common function prototypes between PF/VF driver */ | /* Common function prototypes between PF/VF driver */ | ||||
void ixl_debug_core(device_t dev, u32 enabled_mask, u32 mask, char *fmt, ...); | |||||
void ixl_init_tx_ring(struct ixl_vsi *vsi, struct ixl_tx_queue *que); | void ixl_init_tx_ring(struct ixl_vsi *vsi, struct ixl_tx_queue *que); | ||||
void ixl_get_default_rss_key(u32 *); | void ixl_get_default_rss_key(u32 *); | ||||
const char * i40e_vc_stat_str(struct i40e_hw *hw, | const char * i40e_vc_stat_str(struct i40e_hw *hw, | ||||
enum virtchnl_status_code stat_err); | enum virtchnl_status_code stat_err); | ||||
u64 ixl_max_aq_speed_to_value(u8); | void ixl_init_tx_rsqs(struct ixl_vsi *vsi); | ||||
void ixl_init_tx_cidx(struct ixl_vsi *vsi); | |||||
u64 ixl_max_vc_speed_to_value(u8 link_speeds); | |||||
void ixl_add_vsi_sysctls(device_t dev, struct ixl_vsi *vsi, | |||||
struct sysctl_ctx_list *ctx, const char *sysctl_name); | |||||
void ixl_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, | |||||
struct sysctl_oid_list *child, | |||||
struct i40e_eth_stats *eth_stats); | |||||
void ixl_add_queues_sysctls(device_t dev, struct ixl_vsi *vsi); | |||||
#endif /* _IXL_H_ */ | #endif /* _IXL_H_ */ |