bnxe_fw_funcs.c revision d14abf155341d55053c76eeec58b787a456b753b
#include "lm5710.h"
#include "init_defs.h"
/* Vnics per mode */
#define ECORE_PORT2_MODE_NUM_VNICS 4
/* QM queue numbers */
#define ECORE_ETH_Q 0
#define ECORE_TOE_Q 3
#define ECORE_TOE_ACK_Q 6
#define ECORE_ISCSI_Q 9
#define ECORE_ISCSI_ACK_Q 11
#define ECORE_FCOE_Q 10
/* Vnics per mode */
#define ECORE_PORT4_MODE_NUM_VNICS 2
/* COS offset for port1 in E3 B0 4port mode */
#define ECORE_E3B0_PORT1_COS_OFFSET 3
/* QM Register addresses */
#define ECORE_Q_VOQ_REG_ADDR(pf_q_num)\
#define ECORE_Q_CMDQ_REG_ADDR(pf_q_num)\
/* extracts the QM queue number for the specified port and vnic */
/* Maps the specified queue to the specified COS */
{
/* find current COS mapping */
/* check if queue->COS mapping has changed */
/* update parameters for 4port mode */
}
}
/* change queue mapping for each VNIC */
/* overwrite queue->VOQ mapping */
/* clear queue bit from current COS bit map */
/* set queue bit in new COS bit map */
reg_bit_map = new_cos ?
(reg_bit_map | q_bit_map) :
(reg_bit_map & (~q_bit_map));
}
}
}
}
/* Configures the QM according to the specified per-traffic-type COSes */
struct priority_cos *traffic_cos)
{
if (mode != STATIC_COS) {
/* required only in OVERRIDE_COS mode */
}
}
/*
* congestion managment port init api description
* the api works as follows:
* the driver should pass the cmng_init_input struct, the port_init function
* will prepare the required internal ram structure which will be passed back
* to the driver (cmng_init) that will write it into the internal ram.
*
* IMPORTANT REMARKS:
* 1. the cmng_init struct does not represent the contiguous internal ram
* structure. the driver should use the XSTORM_CMNG_PERPORT_VARS_OFFSET
* offset in order to write the port sub struct and the
* PFID_FROM_PORT_AND_VNIC offset for writing the vnic sub struct (in other
* words - don't use memcpy!).
* 2. although the cmng_init struct is filled for the maximal vnic number
* possible, the driver should only write the valid vnics into the internal
* ram according to the appropriate port mode.
*/
#define BITS_TO_BYTES(x) ((x)/8)
/* CMNG constants, as derived from system spec calculations */
/* default MIN rate in case VNIC min rate is configured to zero- 100Mbps */
#define DEF_MIN_RATE 100
/* resolution of the rate shaping timer - 400 usec */
#define RS_PERIODIC_TIMEOUT_USEC 400
/*
* number of bytes in single QM arbitration cycle -
* coefficient for calculating the fairness timer
*/
#define QM_ARB_BYTES 160000
/* resolution of Min algorithm 1:100 */
#define MIN_RES 100
/*
* how many bytes above threshold for
* the minimal credit of Min algorithm
*/
#define MIN_ABOVE_THRESH 32768
/*
* Fairness algorithm integration time coefficient -
* for calculating the actual Tfair
*/
/* Memory of fairness algorithm - 2 cycles */
#define FAIR_MEM 2
#define SAFC_TIMEOUT_USEC 52
#define SDM_TICKS 4
{
/*
* rate shaping per-port variables
* 100 micro seconds in SDM ticks = 25
* since each tick is 4 microSeconds
*/
/* this is the threshold below which no timer arming will occur.
* 1.25 coefficient is for the threshold to be a little bigger
* then the real time to compensate for timer in-accuracy
*/
/* rate shaping per-vnic variables */
/* global vnic counter */
/*
* maximal Mbps for this vnic
* the quota in each timer period - number of bytes
* transmitted in this period
*/
}
}
struct rate_shaping_vars_per_vn *ram_data)
{
/* global vnic counter */
/*
* maximal Mbps for this vnic
* the quota in each timer period - number of bytes
* transmitted in this period
*/
}
{
/* this is the resolution of the fairness timer */
/*
* fairness per-port variables
* for 10G it is 1000usec. for 1G it is 10000usec.
*/
/* this is the threshold below which we won't arm the timer anymore */
/*
* to pass a credit of the T_FAIR*FAIR_MEM (algorithm resolution)
*/
/* since each tick is 4 microSeconds */
/* calculate sum of weights */
vnicWeightSum = 0;
/* global vnic counter */
if (vnicWeightSum > 0) {
/* fairness per-vnic variables */
/*
* this is the credit for each period of the fairness
* algorithm - number of bytes in T_FAIR (this vnic
* share of the port rate)
*/
}
}
}
}
{
u32_t cosWeightSum = 0;
if (cosWeightSum > 0) {
/*
* Since cos and vnic shouldn't work together the rate
* to divide between the coses is the port rate.
*/
/*
* this is the credit for each period of
* the fairness algorithm - number of bytes
* in T_FAIR (this cos share of the vnic rate)
*/
+ MIN_ABOVE_THRESH) {
}
}
}
}
}
{
/* in microSeconds */
}
/* Congestion management port init */
{
/*
* number of bytes transmitted in a rate of 10Gbps
* in one usec = 1.25KB.
*/
}