Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
be.h File Reference
#include <linux/pci.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <net/tcp.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <linux/if_vlan.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/u64_stats_sync.h>
#include "be_hw.h"
#include "be_roce.h"

Go to the source code of this file.

Data Structures

struct  be_dma_mem
 
struct  be_queue_info
 
struct  be_eq_obj
 
struct  be_mcc_obj
 
struct  be_tx_stats
 
struct  be_tx_obj
 
struct  be_rx_page_info
 
struct  be_rx_stats
 
struct  be_rx_compl_info
 
struct  be_rx_obj
 
struct  be_drv_stats
 
struct  be_vf_cfg
 
struct  phy_info
 
struct  be_adapter
 

Macros

#define DRV_VER   "4.4.31.0u"
 
#define DRV_NAME   "be2net"
 
#define BE_NAME   "ServerEngines BladeEngine2 10Gbps NIC"
 
#define BE3_NAME   "ServerEngines BladeEngine3 10Gbps NIC"
 
#define OC_NAME   "Emulex OneConnect 10Gbps NIC"
 
#define OC_NAME_BE   OC_NAME "(be3)"
 
#define OC_NAME_LANCER   OC_NAME "(Lancer)"
 
#define OC_NAME_SH   OC_NAME "(Skyhawk)"
 
#define DRV_DESC   "ServerEngines BladeEngine 10Gbps NIC Driver"
 
#define BE_VENDOR_ID   0x19a2
 
#define EMULEX_VENDOR_ID   0x10df
 
#define BE_DEVICE_ID1   0x211
 
#define BE_DEVICE_ID2   0x221
 
#define OC_DEVICE_ID1   0x700 /* Device Id for BE2 cards */
 
#define OC_DEVICE_ID2   0x710 /* Device Id for BE3 cards */
 
#define OC_DEVICE_ID3   0xe220 /* Device id for Lancer cards */
 
#define OC_DEVICE_ID4   0xe228 /* Device id for VF in Lancer */
 
#define OC_DEVICE_ID5   0x720 /* Device Id for Skyhawk cards */
 
#define OC_SUBSYS_DEVICE_ID1   0xE602
 
#define OC_SUBSYS_DEVICE_ID2   0xE642
 
#define OC_SUBSYS_DEVICE_ID3   0xE612
 
#define OC_SUBSYS_DEVICE_ID4   0xE652
 
#define BE_HDR_LEN   ((u16) 64)
 
#define BE_RX_SKB_ALLOC_SIZE   (BE_HDR_LEN + 64)
 
#define BE_MAX_JUMBO_FRAME_SIZE   9018
 
#define BE_MIN_MTU   256
 
#define BE_NUM_VLANS_SUPPORTED   64
 
#define BE_MAX_EQD   96u
 
#define BE_MAX_TX_FRAG_COUNT   30
 
#define EVNT_Q_LEN   1024
 
#define TX_Q_LEN   2048
 
#define TX_CQ_LEN   1024
 
#define RX_Q_LEN   1024 /* Does not support any other value */
 
#define RX_CQ_LEN   1024
 
#define MCC_Q_LEN   128 /* total size not to exceed 8 pages */
 
#define MCC_CQ_LEN   256
 
#define BE3_MAX_RSS_QS   8
 
#define BE2_MAX_RSS_QS   4
 
#define MAX_RSS_QS   BE3_MAX_RSS_QS
 
#define MAX_RX_QS   (MAX_RSS_QS + 1) /* RSS qs + 1 def Rx */
 
#define MAX_TX_QS   8
 
#define MAX_ROCE_EQS   5
 
#define MAX_MSIX_VECTORS   (MAX_RSS_QS + MAX_ROCE_EQS) /* RSS qs + RoCE */
 
#define BE_TX_BUDGET   256
 
#define BE_NAPI_WEIGHT   64
 
#define MAX_RX_POST   BE_NAPI_WEIGHT /* Frags posted at a time */
 
#define RX_FRAGS_REFILL_WM   (RX_Q_LEN - MAX_RX_POST)
 
#define MAX_VFS   30 /* Max VFs supported by BE3 FW */
 
#define FW_VER_LEN   32
 
#define BE_FLAGS_LINK_STATUS_INIT   1
 
#define BE_FLAGS_WORKER_SCHEDULED   (1 << 3)
 
#define BE_UC_PMAC_COUNT   30
 
#define BE_VF_UC_PMAC_COUNT   2
 
#define be_physfn(adapter)   (!adapter->virtfn)
 
#define sriov_enabled(adapter)   (adapter->num_vfs > 0)
 
#define sriov_want(adapter)
 
#define for_all_vfs(adapter, vf_cfg, i)
 
#define BE_GEN2   2
 
#define BE_GEN3   3
 
#define ON   1
 
#define OFF   0
 
#define lancer_chip(adapter)
 
#define skyhawk_chip(adapter)   (adapter->pdev->device == OC_DEVICE_ID5)
 
#define be_roce_supported(adapter)
 
#define msix_enabled(adapter)   (adapter->num_msix_vec > 0)
 
#define num_irqs(adapter)
 
#define tx_stats(txo)   (&(txo)->stats)
 
#define rx_stats(rxo)   (&(rxo)->stats)
 
#define default_rxo(adpt)   (&adpt->rx_obj[adpt->num_rx_qs - 1])
 
#define for_all_rx_queues(adapter, rxo, i)
 
#define for_all_rss_queues(adapter, rxo, i)
 
#define for_all_tx_queues(adapter, txo, i)
 
#define for_all_evt_queues(adapter, eqo, i)
 
#define is_mcc_eqo(eqo)   (eqo->idx == 0)
 
#define mcc_eqo(adapter)   (&adapter->eq_obj[0])
 
#define PAGE_SHIFT_4K   12
 
#define PAGE_SIZE_4K   (1 << PAGE_SHIFT_4K)
 
#define PAGES_4K_SPANNED(_address, size)
 
#define AMAP_BIT_OFFSET(_struct, field)   (((size_t)&(((_struct *)0)->field))%32)
 
#define AMAP_SET_BITS(_struct, field, ptr, val)
 
#define AMAP_GET_BITS(_struct, field, ptr)
 
#define be_dws_cpu_to_le(wrb, len)   swap_dws(wrb, len)
 
#define be_dws_le_to_cpu(wrb, len)   swap_dws(wrb, len)
 

Enumerations

enum  vf_state { ENABLED = 0, ASSIGNED = 1 }
 

Functions

void be_cq_notify (struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
 
void be_link_status_update (struct be_adapter *adapter, u8 link_status)
 
void be_parse_stats (struct be_adapter *adapter)
 
int be_load_fw (struct be_adapter *adapter, u8 *func)
 
bool be_is_wol_supported (struct be_adapter *adapter)
 
bool be_pause_supported (struct be_adapter *adapter)
 
u32 be_get_fw_log_level (struct be_adapter *adapter)
 
void be_roce_dev_add (struct be_adapter *)
 
void be_roce_dev_remove (struct be_adapter *)
 
void be_roce_dev_open (struct be_adapter *)
 
void be_roce_dev_close (struct be_adapter *)
 

Variables

struct be_eq_obj ____cacheline_aligned_in_smp
 
struct ethtool_ops be_ethtool_ops
 

Macro Definition Documentation

#define AMAP_BIT_OFFSET (   _struct,
  field 
)    (((size_t)&(((_struct *)0)->field))%32)

Definition at line 507 of file be.h.

#define AMAP_GET_BITS (   _struct,
  field,
  ptr 
)
Value:
amap_get(ptr, \
offsetof(_struct, field)/32, \
amap_mask(sizeof(((_struct *)0)->field)), \

Definition at line 537 of file be.h.

#define AMAP_SET_BITS (   _struct,
  field,
  ptr,
  val 
)
Value:
amap_set(ptr, \
offsetof(_struct, field)/32, \
amap_mask(sizeof(((_struct *)0)->field)), \
AMAP_BIT_OFFSET(_struct, field), \
val)

Definition at line 524 of file be.h.

#define BE2_MAX_RSS_QS   4

Definition at line 101 of file be.h.

#define BE3_MAX_RSS_QS   8

Definition at line 100 of file be.h.

#define BE3_NAME   "ServerEngines BladeEngine3 10Gbps NIC"

Definition at line 40 of file be.h.

#define BE_DEVICE_ID1   0x211

Definition at line 49 of file be.h.

#define BE_DEVICE_ID2   0x221

Definition at line 50 of file be.h.

#define be_dws_cpu_to_le (   wrb,
  len 
)    swap_dws(wrb, len)

Definition at line 543 of file be.h.

#define be_dws_le_to_cpu (   wrb,
  len 
)    swap_dws(wrb, len)

Definition at line 544 of file be.h.

#define BE_FLAGS_LINK_STATUS_INIT   1

Definition at line 324 of file be.h.

#define BE_FLAGS_WORKER_SCHEDULED   (1 << 3)

Definition at line 325 of file be.h.

#define BE_GEN2   2

Definition at line 452 of file be.h.

#define BE_GEN3   3

Definition at line 453 of file be.h.

#define BE_HDR_LEN   ((u16) 64)

Definition at line 81 of file be.h.

#define BE_MAX_EQD   96u

Definition at line 89 of file be.h.

#define BE_MAX_JUMBO_FRAME_SIZE   9018

Definition at line 85 of file be.h.

#define BE_MAX_TX_FRAG_COUNT   30

Definition at line 90 of file be.h.

#define BE_MIN_MTU   256

Definition at line 86 of file be.h.

#define BE_NAME   "ServerEngines BladeEngine2 10Gbps NIC"

Definition at line 39 of file be.h.

#define BE_NAPI_WEIGHT   64

Definition at line 109 of file be.h.

#define BE_NUM_VLANS_SUPPORTED   64

Definition at line 88 of file be.h.

#define be_physfn (   adapter)    (!adapter->virtfn)

Definition at line 443 of file be.h.

#define be_roce_supported (   adapter)
Value:
((adapter->if_type == SLI_INTF_TYPE_3 || \
adapter->sli_family == SKYHAWK_SLI_FAMILY) && \
(adapter->function_mode & RDMA_ENABLED))

Definition at line 463 of file be.h.

#define BE_RX_SKB_ALLOC_SIZE   (BE_HDR_LEN + 64)

Definition at line 83 of file be.h.

#define BE_TX_BUDGET   256

Definition at line 108 of file be.h.

#define BE_UC_PMAC_COUNT   30

Definition at line 326 of file be.h.

#define BE_VENDOR_ID   0x19a2

Definition at line 47 of file be.h.

#define BE_VF_UC_PMAC_COUNT   2

Definition at line 327 of file be.h.

#define default_rxo (   adpt)    (&adpt->rx_obj[adpt->num_rx_qs - 1])

Definition at line 476 of file be.h.

#define DRV_DESC   "ServerEngines BladeEngine 10Gbps NIC Driver"

Definition at line 45 of file be.h.

#define DRV_NAME   "be2net"

Definition at line 38 of file be.h.

#define DRV_VER   "4.4.31.0u"

Definition at line 37 of file be.h.

#define EMULEX_VENDOR_ID   0x10df

Definition at line 48 of file be.h.

#define EVNT_Q_LEN   1024

Definition at line 92 of file be.h.

#define for_all_evt_queues (   adapter,
  eqo,
  i 
)
Value:
for (i = 0, eqo = &adapter->eq_obj[i]; i < adapter->num_evt_qs; \
i++, eqo++)

Definition at line 491 of file be.h.

#define for_all_rss_queues (   adapter,
  rxo,
  i 
)
Value:
for (i = 0, rxo = &adapter->rx_obj[i]; i < (adapter->num_rx_qs - 1);\
i++, rxo++)

Definition at line 483 of file be.h.

#define for_all_rx_queues (   adapter,
  rxo,
  i 
)
Value:
for (i = 0, rxo = &adapter->rx_obj[i]; i < adapter->num_rx_qs; \
i++, rxo++)

Definition at line 478 of file be.h.

#define for_all_tx_queues (   adapter,
  txo,
  i 
)
Value:
for (i = 0, txo = &adapter->tx_obj[i]; i < adapter->num_tx_qs; \
i++, txo++)

Definition at line 487 of file be.h.

#define for_all_vfs (   adapter,
  vf_cfg,
  i 
)
Value:
for (i = 0, vf_cfg = &adapter->vf_cfg[i]; i < adapter->num_vfs; \
i++, vf_cfg++)

Definition at line 447 of file be.h.

#define FW_VER_LEN   32

Definition at line 114 of file be.h.

#define is_mcc_eqo (   eqo)    (eqo->idx == 0)

Definition at line 495 of file be.h.

#define lancer_chip (   adapter)
Value:
((adapter->pdev->device == OC_DEVICE_ID3) || \
(adapter->pdev->device == OC_DEVICE_ID4))

Definition at line 457 of file be.h.

#define MAX_MSIX_VECTORS   (MAX_RSS_QS + MAX_ROCE_EQS) /* RSS qs + RoCE */

Definition at line 107 of file be.h.

#define MAX_ROCE_EQS   5

Definition at line 106 of file be.h.

#define MAX_RSS_QS   BE3_MAX_RSS_QS

Definition at line 102 of file be.h.

#define MAX_RX_POST   BE_NAPI_WEIGHT /* Frags posted at a time */

Definition at line 110 of file be.h.

#define MAX_RX_QS   (MAX_RSS_QS + 1) /* RSS qs + 1 def Rx */

Definition at line 103 of file be.h.

#define MAX_TX_QS   8

Definition at line 105 of file be.h.

#define MAX_VFS   30 /* Max VFs supported by BE3 FW */

Definition at line 113 of file be.h.

#define MCC_CQ_LEN   256

Definition at line 98 of file be.h.

#define mcc_eqo (   adapter)    (&adapter->eq_obj[0])

Definition at line 496 of file be.h.

#define MCC_Q_LEN   128 /* total size not to exceed 8 pages */

Definition at line 97 of file be.h.

#define msix_enabled (   adapter)    (adapter->num_msix_vec > 0)

Definition at line 469 of file be.h.

#define num_irqs (   adapter)
Value:
adapter->num_msix_vec : 1)

Definition at line 470 of file be.h.

#define OC_DEVICE_ID1   0x700 /* Device Id for BE2 cards */

Definition at line 51 of file be.h.

#define OC_DEVICE_ID2   0x710 /* Device Id for BE3 cards */

Definition at line 52 of file be.h.

#define OC_DEVICE_ID3   0xe220 /* Device id for Lancer cards */

Definition at line 53 of file be.h.

#define OC_DEVICE_ID4   0xe228 /* Device id for VF in Lancer */

Definition at line 54 of file be.h.

#define OC_DEVICE_ID5   0x720 /* Device Id for Skyhawk cards */

Definition at line 55 of file be.h.

#define OC_NAME   "Emulex OneConnect 10Gbps NIC"

Definition at line 41 of file be.h.

#define OC_NAME_BE   OC_NAME "(be3)"

Definition at line 42 of file be.h.

#define OC_NAME_LANCER   OC_NAME "(Lancer)"

Definition at line 43 of file be.h.

#define OC_NAME_SH   OC_NAME "(Skyhawk)"

Definition at line 44 of file be.h.

#define OC_SUBSYS_DEVICE_ID1   0xE602

Definition at line 56 of file be.h.

#define OC_SUBSYS_DEVICE_ID2   0xE642

Definition at line 57 of file be.h.

#define OC_SUBSYS_DEVICE_ID3   0xE612

Definition at line 58 of file be.h.

#define OC_SUBSYS_DEVICE_ID4   0xE652

Definition at line 59 of file be.h.

#define OFF   0

Definition at line 456 of file be.h.

#define ON   1

Definition at line 455 of file be.h.

#define PAGE_SHIFT_4K   12

Definition at line 498 of file be.h.

#define PAGE_SIZE_4K   (1 << PAGE_SHIFT_4K)

Definition at line 499 of file be.h.

#define PAGES_4K_SPANNED (   _address,
  size 
)
Value:
((u32)((((size_t)(_address) & (PAGE_SIZE_4K - 1)) + \

Definition at line 502 of file be.h.

#define RX_CQ_LEN   1024

Definition at line 96 of file be.h.

#define RX_FRAGS_REFILL_WM   (RX_Q_LEN - MAX_RX_POST)

Definition at line 111 of file be.h.

#define RX_Q_LEN   1024 /* Does not support any other value */

Definition at line 95 of file be.h.

#define rx_stats (   rxo)    (&(rxo)->stats)

Definition at line 473 of file be.h.

#define skyhawk_chip (   adapter)    (adapter->pdev->device == OC_DEVICE_ID5)

Definition at line 460 of file be.h.

#define sriov_enabled (   adapter)    (adapter->num_vfs > 0)

Definition at line 444 of file be.h.

#define sriov_want (   adapter)
Value:
(adapter->dev_num_vfs && num_vfs && \
be_physfn(adapter))

Definition at line 445 of file be.h.

#define TX_CQ_LEN   1024

Definition at line 94 of file be.h.

#define TX_Q_LEN   2048

Definition at line 93 of file be.h.

#define tx_stats (   txo)    (&(txo)->stats)

Definition at line 472 of file be.h.

Enumeration Type Documentation

enum vf_state
Enumerator:
ENABLED 
ASSIGNED 

Definition at line 319 of file be.h.

Function Documentation

void be_cq_notify ( struct be_adapter adapter,
u16  qid,
bool  arm,
u16  num_popped 
)

Definition at line 217 of file be_main.c.

u32 be_get_fw_log_level ( struct be_adapter adapter)

Definition at line 3568 of file be_main.c.

bool be_is_wol_supported ( struct be_adapter adapter)

Definition at line 3562 of file be_main.c.

void be_link_status_update ( struct be_adapter adapter,
u8  link_status 
)

Definition at line 505 of file be_main.c.

int be_load_fw ( struct be_adapter adapter,
u8 func 
)

Definition at line 3266 of file be_main.c.

void be_parse_stats ( struct be_adapter adapter)

Definition at line 409 of file be_main.c.

bool be_pause_supported ( struct be_adapter adapter)

Definition at line 515 of file be_ethtool.c.

void be_roce_dev_add ( struct be_adapter )

Definition at line 83 of file be_roce.c.

void be_roce_dev_close ( struct be_adapter )

Definition at line 139 of file be_roce.c.

void be_roce_dev_open ( struct be_adapter )

Definition at line 123 of file be_roce.c.

void be_roce_dev_remove ( struct be_adapter )

Definition at line 106 of file be_roce.c.

Variable Documentation

struct be_rx_obj ____cacheline_aligned_in_smp
struct ethtool_ops be_ethtool_ops

Definition at line 924 of file be_ethtool.c.