Files
@ 052c0cbc4bbf
Branch filter:
Location: vmkdrivers/vmkdrivers/src_9/drivers/net/bnx2x/bnx2x_dcb.h
052c0cbc4bbf
8.3 KiB
text/x-chdr
ESXi-5.0-U3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | /* bnx2x_dcb.h: Broadcom Everest network driver.
*
* Copyright 2009-2011 Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2, available
* at http://www.gnu.org/licenses/old-licenses/gpl-2.0.html (the "GPL").
*
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a
* license other than the GPL, without Broadcom's express prior written
* consent.
*
* Maintained by: Eilon Greenstein <eilong@broadcom.com>
* Written by: Dmitry Kravkov
*
*/
#ifndef BNX2X_DCB_H
#define BNX2X_DCB_H
/* Un-comment this to dump dcbx parameters when received from FW */
/* #define BNX2X_DUMP_DCBX 1 */
#include "bnx2x_hsi.h"
#include "bnx2x_compat.h"
#define LLFC_DRIVER_TRAFFIC_TYPE_MAX 3 /* NW, iSCSI, FCoE */
struct bnx2x_dcbx_app_params {
u32 enabled;
u32 traffic_type_priority[LLFC_DRIVER_TRAFFIC_TYPE_MAX];
};
#define E2_NUM_OF_COS 2
#define BNX2X_DCBX_COS_NOT_STRICT 0
#define BNX2X_DCBX_COS_LOW_STRICT 1
#define BNX2X_DCBX_COS_HIGH_STRICT 2
struct bnx2x_dcbx_cos_params {
u32 bw_tbl;
u32 pri_bitmask;
u8 strict;
u8 pauseable;
};
struct bnx2x_dcbx_pg_params {
u32 enabled;
u8 num_of_cos; /* valid COS entries */
struct bnx2x_dcbx_cos_params cos_params[E2_NUM_OF_COS];
};
struct bnx2x_dcbx_pfc_params {
u32 enabled;
u32 priority_non_pauseable_mask;
};
struct bnx2x_dcbx_port_params {
u32 dcbx_enabled;
struct bnx2x_dcbx_pfc_params pfc;
struct bnx2x_dcbx_pg_params ets;
struct bnx2x_dcbx_app_params app;
};
#define BNX2X_DCBX_CONFIG_INV_VALUE (0xFFFFFFFF)
#define BNX2X_DCBX_OVERWRITE_SETTINGS_DISABLE 0
#define BNX2X_DCBX_OVERWRITE_SETTINGS_ENABLE 1
#define BNX2X_DCBX_OVERWRITE_SETTINGS_INVALID (BNX2X_DCBX_CONFIG_INV_VALUE)
/*******************************************************************************
* LLDP protocol configuration parameters.
******************************************************************************/
struct bnx2x_config_lldp_params {
u32 overwrite_settings;
u32 msg_tx_hold;
u32 msg_fast_tx;
u32 tx_credit_max;
u32 msg_tx_interval;
u32 tx_fast;
};
/*******************************************************************************
* LLDP structure for IOCTL get params
******************************************************************************/
struct bnx2x_lldp_params_get{
u32 ver_num;
#define LLDP_PARAMS_VER_NUM 2
struct bnx2x_config_lldp_params config_lldp_params;
/* The reserved field should follow in case the struct above will increase*/
u32 _reserved[20];
u32 admin_status;
#define LLDP_TX_ONLY 0x01
#define LLDP_RX_ONLY 0x02
#define LLDP_TX_RX 0x03
#define LLDP_DISABLED 0x04
u32 remote_chassis_id[REM_CHASSIS_ID_STAT_LEN];
u32 remote_port_id[REM_PORT_ID_STAT_LEN];
u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN];
u32 local_port_id[LOCAL_PORT_ID_STAT_LEN];
};
struct bnx2x_admin_priority_app_table{
u32 valid;
u32 priority;
#define INVALID_TRAFFIC_TYPE_PRIORITY (0xFFFFFFFF)
u32 traffic_type;
#define TRAFFIC_TYPE_ETH 0
#define TRAFFIC_TYPE_PORT 1
u32 app_id;
};
/*******************************************************************************
* DCBX protocol configuration parameters.
******************************************************************************/
struct bnx2x_config_dcbx_params {
u32 dcb_enable;
u32 admin_dcbx_enable;
u32 overwrite_settings;
u32 admin_dcbx_version;
u32 admin_ets_enable;
u32 admin_pfc_enable;
u32 admin_tc_supported_tx_enable;
u32 admin_ets_configuration_tx_enable;
u32 admin_ets_recommendation_tx_enable;
u32 admin_pfc_tx_enable;
u32 admin_application_priority_tx_enable;
u32 admin_ets_willing;
u32 admin_ets_reco_valid;
u32 admin_pfc_willing;
u32 admin_app_priority_willing;
u32 admin_configuration_bw_precentage[8];
u32 admin_configuration_ets_pg[8];
u32 admin_recommendation_bw_precentage[8];
u32 admin_recommendation_ets_pg[8];
u32 admin_pfc_bitmap;
struct bnx2x_admin_priority_app_table admin_priority_app_table[4];
u32 admin_default_priority;
};
/*******************************************************************************
* DCBX structure for IOCTL get params
******************************************************************************/
#define DCBX_PARAMS_VER_NUM 2
struct bnx2x_dcbx_params_get {
u32 ver_num;
struct bnx2x_config_dcbx_params config_dcbx_params;
/* The reserved field should follow in case the struct above will increase*/
u32 _reserved[20];
u32 local_tc_supported;
u32 local_pfc_caps;
u32 remote_tc_supported;
u32 remote_pfc_cap;
u32 remote_ets_willing;
u32 remote_ets_reco_valid;
u32 remote_pfc_willing;
u32 remote_app_priority_willing;
u32 remote_configuration_bw_precentage[8];
u32 remote_configuration_ets_pg[8];
u32 remote_recommendation_bw_precentage[8];
u32 remote_recommendation_ets_pg[8];
u32 remote_pfc_bitmap;
struct bnx2x_admin_priority_app_table remote_priority_app_table[16];
u32 local_ets_enable;
u32 local_pfc_enable;
u32 local_configuration_bw_precentage[8];
u32 local_configuration_ets_pg[8];
u32 local_pfc_bitmap;
struct bnx2x_admin_priority_app_table local_priority_app_table[16];
u32 pfc_mismatch;
u32 priority_app_mismatch;
u32 dcbx_frames_sent;
u32 dcbx_frames_received;
u32 pfc_frames_sent[2];
u32 pfc_frames_received[2];
};
/*******************************************************************************
* DCBX structure for B10_IOC_SET_DCBX_PARAMS.
******************************************************************************/
struct bnx2x_dcbx_params_set {
u32 ver_num;
struct bnx2x_config_dcbx_params config_dcbx_params;
};
#define GET_FLAGS(flags,bits) ((flags) & (bits))
#define SET_FLAGS(flags, bits) ((flags) |= (bits))
#define RESET_FLAGS(flags, bits) ((flags) &= ~(bits))
typedef enum {
DCBX_READ_LOCAL_MIB,
DCBX_READ_REMOTE_MIB
}bnx2x_dcbx_read_mib_type;
#define ETH_TYPE_FCOE (0x8906)
#define TCP_PORT_ISCSI (0xCBC)
#define PFC_VALUE_FRAME_SIZE (512)
#define PFC_QUANTA_IN_NANOSEC_FROM_SPEED_MEGA(mega_speed) \
((1000 * PFC_VALUE_FRAME_SIZE)/(mega_speed))
#define PFC_BRB1_REG_HIGH_LLFC_LOW_THRESHOLD 130
#define PFC_BRB1_REG_HIGH_LLFC_HIGH_THRESHOLD 170
struct cos_entry_help_data
{
u32 pri_join_mask;
u32 cos_bw;
u8 strict;
bool pausable;
};
struct cos_help_data
{
struct cos_entry_help_data data[E2_NUM_OF_COS];
u8 num_of_cos;
};
#define DCBX_ILLEGAL_PG (0xFF)
#define DCBX_PFC_PRI_MASK (0xFF)
#define DCBX_STRICT_PRIORITY (15)
#define DCBX_INVALID_COS_BW (0xFFFFFFFF)
#define DCBX_PFC_PRI_NON_PAUSE_MASK(bp) \
((bp)->dcbx_port_params.pfc.priority_non_pauseable_mask)
#define DCBX_PFC_PRI_PAUSE_MASK(bp) \
((u8)~DCBX_PFC_PRI_NON_PAUSE_MASK(bp))
#define DCBX_PFC_PRI_GET_PAUSE(bp, pg_pri) \
((pg_pri) & (DCBX_PFC_PRI_PAUSE_MASK(bp)))
#define DCBX_PFC_PRI_GET_NON_PAUSE(bp, pg_pri) \
(DCBX_PFC_PRI_NON_PAUSE_MASK(bp) & (pg_pri))
#define IS_DCBX_PFC_PRI_ONLY_PAUSE(bp, pg_pri) \
(pg_pri == DCBX_PFC_PRI_GET_PAUSE((bp), (pg_pri)))
#define IS_DCBX_PFC_PRI_ONLY_NON_PAUSE(bp, pg_pri)\
((pg_pri) == DCBX_PFC_PRI_GET_NON_PAUSE((bp), (pg_pri)))
#define IS_DCBX_PFC_PRI_MIX_PAUSE(bp, pg_pri) \
(!(IS_DCBX_PFC_PRI_ONLY_NON_PAUSE((bp), (pg_pri)) || \
IS_DCBX_PFC_PRI_ONLY_PAUSE((bp), (pg_pri))))
struct pg_entry_help_data
{
u8 num_of_dif_pri;
u8 pg;
u32 pg_priority;
};
struct pg_help_data
{
struct pg_entry_help_data data[LLFC_DRIVER_TRAFFIC_TYPE_MAX];
u8 num_of_pg;
};
/* forward DCB/PFC related declarations */
struct bnx2x;
void bnx2x_dcb_init_intmem_pfc(struct bnx2x *bp);
#if defined(INIT_DELAYED_WORK_DEFERRABLE) || defined(INIT_WORK_NAR) || (defined(VMWARE_ESX_DDK_VERSION) && (VMWARE_ESX_DDK_VERSION >= 40000)) /* BNX2X_UPSTREAM */
void bnx2x_dcbx_timeout(struct work_struct *work);
void bnx2x_dcbx_update(struct work_struct *work);
#else
void bnx2x_dcbx_timeout(void *data);
void bnx2x_dcbx_update(void *data);
#endif
void bnx2x_dcbx_init_params(struct bnx2x *bp);
int bnx2x_dcb_get_lldp_params_ioctl(struct bnx2x *bp, void *uaddr);
int bnx2x_dcb_get_dcbx_params_ioctl(struct bnx2x *bp, void *uaddr);
int bnx2x_dcb_set_dcbx_params_ioctl(struct bnx2x *bp, void *uaddr);
enum {
BNX2X_DCBX_STATE_NEG_RECEIVED = 0x1,
BNX2X_DCBX_STATE_TX_PAUSED = 0x2,
BNX2X_DCBX_STATE_TX_RELEASED = 0x4
};
void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state);
#endif /* BNX2X_DCB_H */
|