Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixlv.h
/****************************************************************************** | /****************************************************************************** | ||||
Copyright (c) 2013-2015, Intel Corporation | Copyright (c) 2013-2017, Intel Corporation | ||||
All rights reserved. | All rights reserved. | ||||
Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | ||||
modification, are permitted provided that the following conditions are met: | modification, are permitted provided that the following conditions are met: | ||||
1. Redistributions of source code must retain the above copyright notice, | 1. Redistributions of source code must retain the above copyright notice, | ||||
this list of conditions and the following disclaimer. | this list of conditions and the following disclaimer. | ||||
Show All 21 Lines | |||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#ifndef _IXLV_H_ | #ifndef _IXLV_H_ | ||||
#define _IXLV_H_ | #define _IXLV_H_ | ||||
#include "ixlv_vc_mgr.h" | #include "ixlv_vc_mgr.h" | ||||
#define IXLV_AQ_MAX_ERR 30 | #define IXLV_AQ_MAX_ERR 200 | ||||
#define IXLV_MAX_INIT_WAIT 120 | |||||
#define IXLV_MAX_FILTERS 128 | #define IXLV_MAX_FILTERS 128 | ||||
#define IXLV_MAX_QUEUES 16 | #define IXLV_MAX_QUEUES 16 | ||||
#define IXLV_AQ_TIMEOUT (1 * hz) | #define IXLV_AQ_TIMEOUT (1 * hz) | ||||
#define IXLV_CALLOUT_TIMO (hz / 50) /* 20 msec */ | #define IXLV_CALLOUT_TIMO (hz / 50) /* 20 msec */ | ||||
#define IXLV_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) | #define IXLV_FLAG_AQ_ENABLE_QUEUES (u32)(1 << 0) | ||||
#define IXLV_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) | #define IXLV_FLAG_AQ_DISABLE_QUEUES (u32)(1 << 1) | ||||
#define IXLV_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) | #define IXLV_FLAG_AQ_ADD_MAC_FILTER (u32)(1 << 2) | ||||
Show All 23 Lines | #define IXLV_PRINTF_VF_OFFLOAD_FLAGS \ | ||||
"\4I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ" \ | "\4I40E_VIRTCHNL_VF_OFFLOAD_RSS_AQ" \ | ||||
"\5I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG" \ | "\5I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG" \ | ||||
"\6I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR" \ | "\6I40E_VIRTCHNL_VF_OFFLOAD_WB_ON_ITR" \ | ||||
"\21I40E_VIRTCHNL_VF_OFFLOAD_VLAN" \ | "\21I40E_VIRTCHNL_VF_OFFLOAD_VLAN" \ | ||||
"\22I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING" \ | "\22I40E_VIRTCHNL_VF_OFFLOAD_RX_POLLING" \ | ||||
"\23I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2" \ | "\23I40E_VIRTCHNL_VF_OFFLOAD_RSS_PCTYPE_V2" \ | ||||
"\24I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF" | "\24I40E_VIRTCHNL_VF_OFFLOAD_RSS_PF" | ||||
static MALLOC_DEFINE(M_IXLV, "ixlv", "ixlv driver allocations"); | |||||
/* Driver state */ | /* Driver state */ | ||||
enum ixlv_state_t { | enum ixlv_state_t { | ||||
IXLV_START, | IXLV_START, | ||||
IXLV_FAILED, | IXLV_FAILED, | ||||
IXLV_RESET_REQUIRED, | IXLV_RESET_REQUIRED, | ||||
IXLV_RESET_PENDING, | IXLV_RESET_PENDING, | ||||
IXLV_VERSION_CHECK, | IXLV_VERSION_CHECK, | ||||
IXLV_GET_RESOURCES, | IXLV_GET_RESOURCES, | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | struct ixlv_sc { | ||||
struct resource *res; /* For the AQ */ | struct resource *res; /* For the AQ */ | ||||
struct ifmedia media; | struct ifmedia media; | ||||
struct callout timer; | struct callout timer; | ||||
int msix; | int msix; | ||||
int pf_version; | int pf_version; | ||||
int if_flags; | int if_flags; | ||||
bool link_up; | bool link_up; | ||||
u32 link_speed; | enum virtchnl_link_speed link_speed; | ||||
struct mtx mtx; | struct mtx mtx; | ||||
u32 qbase; | u32 qbase; | ||||
u32 admvec; | u32 admvec; | ||||
struct timeout_task timeout; | struct timeout_task timeout; | ||||
#ifdef notyet | |||||
struct task aq_irq; | struct task aq_irq; | ||||
struct task aq_sched; | struct task aq_sched; | ||||
struct taskqueue *tq; | #endif | ||||
struct ixl_vsi vsi; | struct ixl_vsi vsi; | ||||
/* Filter lists */ | /* Filter lists */ | ||||
struct mac_list *mac_filters; | struct mac_list *mac_filters; | ||||
struct vlan_list *vlan_filters; | struct vlan_list *vlan_filters; | ||||
/* Promiscuous mode */ | /* Promiscuous mode */ | ||||
Show All 13 Lines | #endif | ||||
struct ixl_vc_cmd add_multi_cmd; | struct ixl_vc_cmd add_multi_cmd; | ||||
struct ixl_vc_cmd del_multi_cmd; | struct ixl_vc_cmd del_multi_cmd; | ||||
struct ixl_vc_cmd config_rss_key_cmd; | struct ixl_vc_cmd config_rss_key_cmd; | ||||
struct ixl_vc_cmd get_rss_hena_caps_cmd; | struct ixl_vc_cmd get_rss_hena_caps_cmd; | ||||
struct ixl_vc_cmd set_rss_hena_cmd; | struct ixl_vc_cmd set_rss_hena_cmd; | ||||
struct ixl_vc_cmd config_rss_lut_cmd; | struct ixl_vc_cmd config_rss_lut_cmd; | ||||
/* Virtual comm channel */ | /* Virtual comm channel */ | ||||
struct i40e_virtchnl_vf_resource *vf_res; | struct virtchnl_vf_resource *vf_res; | ||||
struct i40e_virtchnl_vsi_resource *vsi_res; | struct virtchnl_vsi_resource *vsi_res; | ||||
/* Misc stats maintained by the driver */ | /* Misc stats maintained by the driver */ | ||||
u64 watchdog_events; | u64 watchdog_events; | ||||
u64 admin_irq; | u64 admin_irq; | ||||
u8 aq_buffer[IXL_AQ_BUF_SZ]; | u8 aq_buffer[IXL_AQ_BUF_SZ]; | ||||
}; | }; | ||||
#define IXLV_CORE_LOCK_ASSERT(sc) mtx_assert(&(sc)->mtx, MA_OWNED) | |||||
/* | /* | ||||
** This checks for a zero mac addr, something that will be likely | ** This checks for a zero mac addr, something that will be likely | ||||
** unless the Admin on the Host has created one. | ** unless the Admin on the Host has created one. | ||||
*/ | */ | ||||
static inline bool | static inline bool | ||||
ixlv_check_ether_addr(u8 *addr) | ixlv_check_ether_addr(u8 *addr) | ||||
{ | { | ||||
bool status = TRUE; | bool status = TRUE; | ||||
if ((addr[0] == 0 && addr[1]== 0 && addr[2] == 0 && | if ((addr[0] == 0 && addr[1]== 0 && addr[2] == 0 && | ||||
addr[3] == 0 && addr[4]== 0 && addr[5] == 0)) | addr[3] == 0 && addr[4]== 0 && addr[5] == 0)) | ||||
status = FALSE; | status = FALSE; | ||||
return (status); | return (status); | ||||
} | } | ||||
/* | /* | ||||
** VF Common function prototypes | ** VF Common function prototypes | ||||
*/ | */ | ||||
void ixlv_if_init(if_ctx_t ctx); | |||||
int ixlv_send_api_ver(struct ixlv_sc *); | int ixlv_send_api_ver(struct ixlv_sc *); | ||||
int ixlv_verify_api_ver(struct ixlv_sc *); | int ixlv_verify_api_ver(struct ixlv_sc *); | ||||
int ixlv_send_vf_config_msg(struct ixlv_sc *); | int ixlv_send_vf_config_msg(struct ixlv_sc *); | ||||
int ixlv_get_vf_config(struct ixlv_sc *); | int ixlv_get_vf_config(struct ixlv_sc *); | ||||
void ixlv_init(void *); | void ixlv_init(void *); | ||||
int ixlv_reinit_locked(struct ixlv_sc *); | int ixlv_reinit_locked(struct ixlv_sc *); | ||||
void ixlv_configure_queues(struct ixlv_sc *); | void ixlv_configure_queues(struct ixlv_sc *); | ||||
void ixlv_enable_queues(struct ixlv_sc *); | void ixlv_enable_queues(struct ixlv_sc *); | ||||
void ixlv_disable_queues(struct ixlv_sc *); | void ixlv_disable_queues(struct ixlv_sc *); | ||||
void ixlv_map_queues(struct ixlv_sc *); | void ixlv_map_queues(struct ixlv_sc *); | ||||
void ixlv_enable_intr(struct ixl_vsi *); | void ixlv_enable_intr(struct ixl_vsi *); | ||||
void ixlv_disable_intr(struct ixl_vsi *); | void ixlv_disable_intr(struct ixl_vsi *); | ||||
void ixlv_add_ether_filters(struct ixlv_sc *); | void ixlv_add_ether_filters(struct ixlv_sc *); | ||||
void ixlv_del_ether_filters(struct ixlv_sc *); | void ixlv_del_ether_filters(struct ixlv_sc *); | ||||
void ixlv_request_stats(struct ixlv_sc *); | void ixlv_request_stats(struct ixlv_sc *); | ||||
void ixlv_request_reset(struct ixlv_sc *); | void ixlv_request_reset(struct ixlv_sc *); | ||||
void ixlv_vc_completion(struct ixlv_sc *, | void ixlv_vc_completion(struct ixlv_sc *, | ||||
enum i40e_virtchnl_ops, i40e_status, u8 *, u16); | enum virtchnl_ops, enum virtchnl_status_code, | ||||
u8 *, u16); | |||||
void ixlv_add_ether_filter(struct ixlv_sc *); | void ixlv_add_ether_filter(struct ixlv_sc *); | ||||
void ixlv_add_vlans(struct ixlv_sc *); | void ixlv_add_vlans(struct ixlv_sc *); | ||||
void ixlv_del_vlans(struct ixlv_sc *); | void ixlv_del_vlans(struct ixlv_sc *); | ||||
void ixlv_update_stats_counters(struct ixlv_sc *, | void ixlv_update_stats_counters(struct ixlv_sc *, | ||||
struct i40e_eth_stats *); | struct i40e_eth_stats *); | ||||
void ixlv_update_link_status(struct ixlv_sc *); | void ixlv_update_link_status(struct ixlv_sc *); | ||||
void ixlv_get_default_rss_key(u32 *, bool); | void ixlv_get_default_rss_key(u32 *, bool); | ||||
void ixlv_config_rss_key(struct ixlv_sc *); | void ixlv_config_rss_key(struct ixlv_sc *); | ||||
void ixlv_set_rss_hena(struct ixlv_sc *); | void ixlv_set_rss_hena(struct ixlv_sc *); | ||||
void ixlv_config_rss_lut(struct ixlv_sc *); | void ixlv_config_rss_lut(struct ixlv_sc *); | ||||
#endif /* _IXLV_H_ */ | #endif /* _IXLV_H_ */ |