Lines Matching +full:dcb +full:- +full:algorithm

3  * Copyright (c) 2007-2013 Broadcom Corporation
21 #include <linux/dma-mapping.h>
37 * to break this driver due to amount of abuse of in-kernel interfaces
42 #define DRV_MODULE_VERSION "1.713.36-0"
53 #define BNX2X_MIN_MSIX_VEC_CNT(bp) ((bp)->min_msix_vec_cnt)
94 bp->dev ? (bp->dev->name) : "?", \
99 if (unlikely(bp->msg_enable & (__mask))) \
105 if (unlikely((bp->msg_enable & (__mask)) == __mask)) \
111 if (unlikely(bp->msg_enable & (__mask))) \
121 bp->dev ? (bp->dev->name) : "?", \
130 bp->dev ? (bp->dev->name) : "?", \
137 /* before we have a dev->name use dev_info() */
141 dev_info(&bp->pdev->dev, fmt, ##__VA_ARGS__); \
149 bp->panic = 1; \
156 bp->panic = 1; \
162 #define bnx2x_mc_addr(ha) ((ha)->addr)
163 #define bnx2x_uc_addr(ha) ((ha)->addr)
169 #define REG_ADDR(bp, offset) ((bp->regview) + (offset))
210 #define SHMEM_ADDR(bp, field) (bp->common.shmem_base + \
215 #define SHMEM2_ADDR(bp, field) (bp->common.shmem2_base + \
219 #define MF_CFG_ADDR(bp, field) (bp->common.mf_cfg_base + \
221 #define MF2_CFG_ADDR(bp, field) (bp->common.mf2_cfg_base + \
229 #define SHMEM2_HAS(bp, field) ((bp)->common.shmem2_base && \
238 /* General SP events - stats query, cfc delete, etc */
256 (&bp->def_status_blk->sp_sb.\
260 (&bp->def_status_blk->sp_sb.\
288 (bp)->max_cos)
297 /* add offset to rounded-up cid to get a value which could be used with UIO */
299 /* but wait - avoid UIO special case for cid 0 */
305 /* how many cids were wasted - need this value for cid allocation */
306 #define UIO_CID_PAD(bp) (BNX2X_CNIC_START_ETH_CID(bp) - \
313 #define CNIC_SUPPORT(bp) ((bp)->cnic_support)
314 #define CNIC_ENABLED(bp) ((bp)->cnic_enabled)
315 #define CNIC_LOADED(bp) ((bp)->cnic_loaded)
316 #define FCOE_INIT(bp) ((bp)->fcoe_init)
328 /* rules for calculating the cids of tx-only connections */
335 ((fp)->index + cos * BNX2X_NUM_NON_CNIC_QUEUES(bp))
348 #define MAX_ETH_TXQ_IDX(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * (bp)->max_cos)
394 #define BCM_PAGE_MASK (~(BCM_PAGE_SIZE - 1))
395 #define BCM_PAGE_ALIGN(addr) (((addr) + BCM_PAGE_SIZE - 1) & BCM_PAGE_MASK)
401 #define SGE_PAGE_MASK (~(SGE_PAGE_SIZE - 1))
402 #define SGE_PAGE_ALIGN(addr) (((addr) + SGE_PAGE_SIZE - 1) & SGE_PAGE_MASK)
411 #define MAX_RX_SGE_CNT (RX_SGE_CNT - NEXT_PAGE_SGE_DESC_CNT)
413 #define RX_SGE_MASK (RX_SGE_CNT - 1)
415 #define MAX_RX_SGE (NUM_RX_SGE - 1)
417 (MAX_RX_SGE_CNT - 1)) ? \
432 (BRB_SIZE(bp) - MAX_AGG_QS(bp)) / 2)
433 #define NUM_SGE_PG_REQ ((NUM_SGE_REQ + MAX_RX_SGE_CNT - 1) / \
444 #define BIT_VEC64_ELEM_MASK ((u64)BIT_VEC64_ELEM_SZ - 1)
469 idx - index of the most significant bit in the created mask */
471 (((u64)0x1 << (((idx) & BIT_VEC64_ELEM_MASK) + 1)) - 1)
478 #define RX_SGE_MASK_LEN_MASK (RX_SGE_MASK_LEN - 1)
490 * First aggregation buffer is a data buffer, the following - are pages.
613 4 ('-Xx-' string) +
615 #define FP_NAME_SIZE (sizeof(((struct net_device *)0)->name) + 8)
621 #define bnx2x_fp(bp, nr, var) ((bp)->fp[(nr)].var)
622 #define bnx2x_sp_obj(bp, fp) ((bp)->sp_objs[(fp)->index])
623 #define bnx2x_fp_stats(bp, fp) (&((bp)->fp_stats[(fp)->index]))
624 #define bnx2x_fp_qstats(bp, fp) (&((bp)->fp_stats[(fp)->index].eth_q_stats))
626 /* Use 2500 as a mini-jumbo MTU for FCoE */
633 #define bnx2x_fcoe_fp(bp) (&bp->fp[FCOE_IDX(bp)])
634 #define bnx2x_fcoe(bp, var) (bnx2x_fcoe_fp(bp)->var)
635 #define bnx2x_fcoe_inner_sp_obj(bp) (&bp->sp_objs[FCOE_IDX(bp)])
636 #define bnx2x_fcoe_sp_obj(bp, var) (bnx2x_fcoe_inner_sp_obj(bp)->var)
637 #define bnx2x_fcoe_tx(bp, var) (bnx2x_fcoe_fp(bp)-> \
639 ->var)
641 #define IS_ETH_FP(fp) ((fp)->index < BNX2X_NUM_ETH_QUEUES((fp)->bp))
642 #define IS_FCOE_FP(fp) ((fp)->index == FCOE_IDX((fp)->bp))
652 #define MAX_TX_DESC_CNT (TX_DESC_CNT - NEXT_PAGE_TX_DESC_CNT)
654 #define MAX_TX_BD (NUM_TX_BD - 1)
655 #define MAX_TX_AVAIL (MAX_TX_DESC_CNT * NUM_TX_RINGS - 2)
657 (MAX_TX_DESC_CNT - 1)) ? \
665 (((bds) + MAX_TX_DESC_CNT - 1) / \
668 * START_BD - describes packed
669 * START_BD(splitted) - includes unpaged data segment for GSO
670 * PARSING_BD - for TSO and CSUM data
671 * PARSING_BD2 - for encapsulation data
672 * Frag BDs - describes pages for frags
684 #define MAX_RX_DESC_CNT (RX_DESC_CNT - NEXT_PAGE_RX_DESC_CNT)
685 #define RX_DESC_MASK (RX_DESC_CNT - 1)
687 #define MAX_RX_BD (NUM_RX_BD - 1)
688 #define MAX_RX_AVAIL (MAX_RX_DESC_CNT * NUM_RX_RINGS - 2)
697 #define NUM_BD_PG_REQ ((NUM_BD_REQ + MAX_RX_DESC_CNT - 1) / \
704 #define MIN_RX_AVAIL ((bp)->dropless_fc ? BD_TH_HI(bp) + 128 : 128)
715 (MAX_RX_DESC_CNT - 1)) ? \
728 #define MAX_RCQ_DESC_CNT (RCQ_DESC_CNT - NEXT_PAGE_RCQ_DESC_CNT)
730 #define MAX_RCQ_BD (NUM_RCQ_BD - 1)
731 #define MAX_RCQ_AVAIL (MAX_RCQ_DESC_CNT * NUM_RCQ_RINGS - 2)
733 (MAX_RCQ_DESC_CNT - 1)) ? \
745 #define NUM_RCQ_PG_REQ ((NUM_BD_REQ + MAX_RCQ_DESC_CNT - 1) / \
753 #define SUB_S16(a, b) (s16)((s16)(a) - (s16)(b))
754 #define SUB_S32(a, b) (s32)((s32)(a) - (s32)(b))
757 #define BNX2X_SWCID_MASK ((0x1 << BNX2X_SWCID_SHIFT) - 1)
764 #define BD_UNMAP_ADDR(bd) HILO_U64(le32_to_cpu((bd)->addr_hi), \
765 le32_to_cpu((bd)->addr_lo))
766 #define BD_UNMAP_LEN(bd) (le16_to_cpu((bd)->nbytes))
774 writel_relaxed((u32)(val), (bp)->doorbells + ((bp)->db_size * (cid)))
777 #define SKB_CS_OFF(skb) (offsetof(struct tcphdr, check) - \
778 skb->csum_offset)
780 skb->csum_offset))
816 BNX2X_PRS_FLAG_OVERETH_IPV4(cqe->fast_path_cqe.pars_flags.flags)
836 (&fp->sb_index_values[HC_INDEX_ETH_RX_CQ_CONS])
841 (&fp->sb_index_values[HC_INDEX_ETH_TX_CQ_CONS_COS0])
850 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
851 #define CHIP_ID(bp) (bp->common.chip_id & 0xfffffff0)
853 #define CHIP_NUM(bp) (bp->common.chip_id >> 16)
923 #define CHIP_REV_VAL(bp) (bp->common.chip_id & CHIP_REV_MASK)
938 #define CHIP_METAL(bp) (bp->common.chip_id & 0x00000ff0)
939 #define CHIP_BOND_ID(bp) (bp->common.chip_id & 0x0000000f)
940 #define CHIP_REV_SIM(bp) (((CHIP_REV_MASK - CHIP_REV_VAL(bp)) >>\
952 * to nic-only mode or to offload mode. Offload mode is configured if either the
955 * 2. During cnic-related load, to know if offload mode is already configured in
957 * Since the transition from nic-mode to offload-mode in HW causes traffic
958 * corruption, nic-mode is configured only in ports on which storage services
984 !((bp)->common.int_block & INT_BLOCK_MODE_BW_COMP))
991 #define CHIP_MODE(bp) (bp->common.chip_port_mode)
1055 * control by the number of fast-path status blocks supported by the
1056 * device (HW/FW). Each fast-path status block (FP-SB) aka non-default
1059 * as the FCoE queue do not require a FP-SB and other components like
1060 * the CNIC may consume FP-SB reducing the number of possible L2 queues
1062 * If the maximum number of FP-SB available is X then:
1063 * a. If CNIC is supported it consumes 1 FP-SB thus the max number of
1064 * regular L2 queues is Y=X-1
1065 * b. In MF mode the actual number of L2 queues is Y= (X-1/MF_factor)
1069 * slow-path interrupts) or Y+2 if CNIC is supported (one additional
1075 /* fast-path interrupt contexts E1x */
1077 /* fast-path interrupt contexts E2 */
1180 #define bnx2x_sp(bp, var) (&bp->slowpath->var)
1182 (bp->slowpath_mapping + offsetof(struct bnx2x_slowpath, var))
1224 #define EQ_DESC_MAX_PAGE (EQ_DESC_CNT_PAGE - 1)
1226 #define EQ_DESC_MASK (NUM_EQ_DESC - 1)
1227 #define MAX_EQ_AVAIL (EQ_DESC_MAX_PAGE * NUM_EQ_PAGES - 2)
1231 (EQ_DESC_MAX_PAGE - 1)) ? (x) + 2 : (x) + 1)
1237 (&bp->def_status_blk->sp_sb.\
1358 u8 pfid; /* per-path PF number */
1360 #define BP_PATH(bp) (CHIP_IS_E1x(bp) ? 0 : (bp->pf_num & 1))
1361 #define BP_PORT(bp) (bp->pfid & 1)
1362 #define BP_FUNC(bp) (bp->pfid)
1363 #define BP_ABS_FUNC(bp) (bp->pf_num)
1364 #define BP_VN(bp) ((bp)->pfid >> 1)
1395 #define IRO (bp->iro_arr)
1405 #define ETH_MIN_PACKET_SIZE (ETH_ZLEN - ETH_HLEN)
1419 * at the end of skb->data, to avoid wasting a full cache line.
1420 * This reduces memory use (skb->truesize).
1428 #define BNX2X_PXP_DRAM_ALIGN (BNX2X_RX_ALIGN_SHIFT - 5)
1492 #define BP_NOMCP(bp) ((bp)->flags & NO_MCP_FLAG)
1495 #define IS_VF(bp) ((bp)->flags & IS_VF_FLAG)
1496 #define IS_PF(bp) (!((bp)->flags & IS_VF_FLAG))
1502 #define NO_ISCSI(bp) ((bp)->flags & NO_ISCSI_FLAG)
1503 #define NO_ISCSI_OOO(bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)
1504 #define NO_FCOE(bp) ((bp)->flags & NO_FCOE_FLAG)
1552 #define IS_MF(bp) (bp->mf_mode != 0)
1553 #define IS_MF_SI(bp) (bp->mf_mode == MULTI_FUNCTION_SI)
1554 #define IS_MF_SD(bp) (bp->mf_mode == MULTI_FUNCTION_SD)
1555 #define IS_MF_AFEX(bp) (bp->mf_mode == MULTI_FUNCTION_AFEX)
1558 bp->mf_sub_mode == SUB_MF_MODE_UFP)
1560 bp->mf_sub_mode == SUB_MF_MODE_BD)
1652 #define BP_ILT(bp) ((bp)->ilt)
1658 #define BNX2X_MAX_RSS_COUNT(bp) ((bp)->igu_sb_cnt - CNIC_SUPPORT(bp))
1727 #define GUNZIP_BUF(bp) (bp->gunzip_buf)
1728 #define GUNZIP_PHYS(bp) (bp->gunzip_mapping)
1729 #define GUNZIP_OUTLEN(bp) (bp->gunzip_outlen)
1734 /* Data blob - has 32 bit granularity */
1737 #define INIT_MODE_FLAGS(bp) (bp->init_mode_flags)
1738 /* Zipped PRAM blobs - raw data */
1747 #define INIT_OPS(bp) (bp->init_ops)
1748 #define INIT_OPS_OFFSETS(bp) (bp->init_ops_offsets)
1749 #define INIT_DATA(bp) (bp->init_data)
1750 #define INIT_TSEM_INT_TABLE_DATA(bp) (bp->tsem_int_table_data)
1751 #define INIT_TSEM_PRAM_DATA(bp) (bp->tsem_pram_data)
1752 #define INIT_USEM_INT_TABLE_DATA(bp) (bp->usem_int_table_data)
1753 #define INIT_USEM_PRAM_DATA(bp) (bp->usem_pram_data)
1754 #define INIT_XSEM_INT_TABLE_DATA(bp) (bp->xsem_int_table_data)
1755 #define INIT_XSEM_PRAM_DATA(bp) (bp->xsem_pram_data)
1756 #define INIT_CSEM_INT_TABLE_DATA(bp) (bp->csem_int_table_data)
1757 #define INIT_CSEM_PRAM_DATA(bp) (bp->csem_pram_data)
1764 #define IS_SRIOV(bp) ((bp)->vfdb)
1766 /* DCB support on/off */
1776 #define BNX2X_DCBX_ENABLED_INVALID (-1)
1866 #define BNX2X_NUM_QUEUES(bp) (bp->num_queues)
1867 #define BNX2X_NUM_ETH_QUEUES(bp) ((bp)->num_ethernet_queues)
1868 #define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \
1869 (bp)->num_cnic_queues)
1971 for ((var) = 0; (var) < (fp)->max_cos; (var)++)
1989 * bnx2x_set_mac_one - configure a single MAC address
1994 * @set: if 'true' add a new MAC, otherwise - delete
2003 * operation has been successfully scheduled and a negative - if a requested
2015 * bnx2x_del_all_macs - delete all MACs configured for the specific MAC object
2025 * operation has been successfully scheduled and a negative - if a requested
2084 ms -= wait; in reg_poll()
2096 x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL)
2101 dma_free_coherent(&bp->pdev->dev, size, x, y); \
2136 #define DMAE_TIMEOUT -1
2137 #define DMAE_PCI_ERROR -2 /* E2 and onward */
2138 #define DMAE_NOT_RDY -3
2151 /* E2 and onward - PCI error handling in the completion */
2197 #define DMAE_COMP_VAL 0x60d0d0ae /* E2 and on - upper bit
2209 * Driver: 0-3 and 8-11 (for PF dmae operations)
2242 #define MAX_SP_DESC_CNT (SP_DESC_CNT - 1)
2248 /* default MIN rate in case VNIC min rate is configured to zero - 100Mbps */
2250 /* resolution of the rate shaping timer - 400 usec */
2252 /* number of bytes in single QM arbitration cycle -
2255 /* resolution of Min algorithm 1:100 */
2257 /* how many bytes above threshold for the minimal credit of Min algorithm*/
2259 /* Fairness algorithm integration time coefficient -
2262 /* Memory of fairness algorithm . 2 cycles */
2398 (&bp->def_status_blk->sp_sb.\
2434 #define HC_SEG_ACCESS_DEF 0 /*Driver decision 0-3*/
2436 #define HC_SEG_ACCESS_NORM 0 /*Driver decision 0-1*/
2442 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)
2461 #define BNX2X_MF_EXT_PROT(bp) ((bp)->mf_ext_config & \
2533 /* Re-configure all previously configured vlan filters.
2534 * Meant for implicit re-load flows.