Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
main.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/io-mapping.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/mlx4/device.h>
#include <linux/mlx4/doorbell.h>
#include "mlx4.h"
#include "fw.h"
#include "icm.h"

Go to the source code of this file.

Data Structures

struct  mlx4_port_config
 

Macros

#define msi_x   (0)
 
#define HCA_GLOBAL_CAP_MASK   0
 
#define PF_CONTEXT_BEHAVIOUR_MASK   0
 
#define MLX4_LOG_NUM_VLANS   7
 
#define MLX4_OWNER_BASE   0x8069c
 
#define MLX4_OWNER_SIZE   4
 

Enumerations

enum  ibta_mtu {
  IB_MTU_256 = 1, IB_MTU_512 = 2, IB_MTU_1024 = 3, IB_MTU_2048 = 4,
  IB_MTU_4096 = 5
}
 

Functions

 MODULE_AUTHOR ("Roland Dreier")
 
 MODULE_DESCRIPTION ("Mellanox ConnectX HCA low-level driver")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 MODULE_VERSION (DRV_VERSION)
 
 module_param (num_vfs, int, 0444)
 
 MODULE_PARM_DESC (num_vfs,"enable #num_vfs functions if num_vfs > 0")
 
 module_param (probe_vf, int, 0644)
 
 MODULE_PARM_DESC (probe_vf,"number of vfs to probe by pf driver (num_vfs > 0)")
 
 module_param_named (log_num_mgm_entry_size, mlx4_log_num_mgm_entry_size, int, 0444)
 
 MODULE_PARM_DESC (log_num_mgm_entry_size,"log mgm size, that defines the num"" of qp per mcg, for example:"" 10 gives 248.range: 9<="" log_num_mgm_entry_size <= 12."" Not in use with device managed"" flow steering")
 
 module_param_named (log_num_mac, log_num_mac, int, 0444)
 
 MODULE_PARM_DESC (log_num_mac,"Log2 max number of MACs per ETH port (1-7)")
 
 module_param_named (log_num_vlan, log_num_vlan, int, 0444)
 
 MODULE_PARM_DESC (log_num_vlan,"Log2 max number of VLANs per ETH port (0-7)")
 
 module_param_named (use_prio, use_prio, bool, 0444)
 
 MODULE_PARM_DESC (use_prio,"Enable steering by VLAN priority on ETH ports ""(0/1, default 0)")
 
 module_param_named (log_mtts_per_seg, log_mtts_per_seg, int, 0444)
 
 MODULE_PARM_DESC (log_mtts_per_seg,"Log2 number of MTT entries per segment (1-7)")
 
 module_param_array (port_type_array, int,&arr_argc, 0444)
 
 MODULE_PARM_DESC (port_type_array,"Array of port types: HW_DEFAULT (0) is default ""1 for IB, 2 for Ethernet")
 
int mlx4_check_port_params (struct mlx4_dev *dev, enum mlx4_port_type *port_type)
 
int mlx4_get_parav_qkey (struct mlx4_dev *dev, u32 qpn, u32 *qkey)
 
 EXPORT_SYMBOL (mlx4_get_parav_qkey)
 
void mlx4_sync_pkey_table (struct mlx4_dev *dev, int slave, int port, int i, int val)
 
 EXPORT_SYMBOL (mlx4_sync_pkey_table)
 
void mlx4_put_slave_node_guid (struct mlx4_dev *dev, int slave, __be64 guid)
 
 EXPORT_SYMBOL (mlx4_put_slave_node_guid)
 
__be64 mlx4_get_slave_node_guid (struct mlx4_dev *dev, int slave)
 
 EXPORT_SYMBOL (mlx4_get_slave_node_guid)
 
int mlx4_is_slave_active (struct mlx4_dev *dev, int slave)
 
 EXPORT_SYMBOL (mlx4_is_slave_active)
 
int mlx4_change_port_types (struct mlx4_dev *dev, enum mlx4_port_type *port_types)
 
int __mlx4_counter_alloc (struct mlx4_dev *dev, u32 *idx)
 
int mlx4_counter_alloc (struct mlx4_dev *dev, u32 *idx)
 
 EXPORT_SYMBOL_GPL (mlx4_counter_alloc)
 
void __mlx4_counter_free (struct mlx4_dev *dev, u32 idx)
 
void mlx4_counter_free (struct mlx4_dev *dev, u32 idx)
 
 EXPORT_SYMBOL_GPL (mlx4_counter_free)
 
int mlx4_restart_one (struct pci_dev *pdev)
 
 MODULE_DEVICE_TABLE (pci, mlx4_pci_table)
 
 module_init (mlx4_init)
 
 module_exit (mlx4_cleanup)
 

Variables

struct workqueue_structmlx4_wq
 
int mlx4_log_num_mgm_entry_size = 10
 
int log_mtts_per_seg = ilog2(MLX4_MTT_ENTRY_PER_SEG)
 

Macro Definition Documentation

#define HCA_GLOBAL_CAP_MASK   0

Definition at line 98 of file main.c.

#define MLX4_LOG_NUM_VLANS   7

Definition at line 123 of file main.c.

#define MLX4_OWNER_BASE   0x8069c

Definition at line 1882 of file main.c.

#define MLX4_OWNER_SIZE   4

Definition at line 1883 of file main.c.

#define msi_x   (0)

Definition at line 76 of file main.c.

#define PF_CONTEXT_BEHAVIOUR_MASK   0

Definition at line 99 of file main.c.

Enumeration Type Documentation

enum ibta_mtu
Enumerator:
IB_MTU_256 
IB_MTU_512 
IB_MTU_1024 
IB_MTU_2048 
IB_MTU_4096 

Definition at line 744 of file main.c.

Function Documentation

int __mlx4_counter_alloc ( struct mlx4_dev dev,
u32 idx 
)

Definition at line 1442 of file main.c.

void __mlx4_counter_free ( struct mlx4_dev dev,
u32  idx 
)

Definition at line 1474 of file main.c.

EXPORT_SYMBOL ( mlx4_get_parav_qkey  )
EXPORT_SYMBOL ( mlx4_sync_pkey_table  )
EXPORT_SYMBOL ( mlx4_put_slave_node_guid  )
EXPORT_SYMBOL ( mlx4_get_slave_node_guid  )
EXPORT_SYMBOL ( mlx4_is_slave_active  )
EXPORT_SYMBOL_GPL ( mlx4_counter_alloc  )
EXPORT_SYMBOL_GPL ( mlx4_counter_free  )
int mlx4_change_port_types ( struct mlx4_dev dev,
enum mlx4_port_type port_types 
)

Definition at line 619 of file main.c.

int mlx4_check_port_params ( struct mlx4_dev dev,
enum mlx4_port_type port_type 
)

Definition at line 146 of file main.c.

int mlx4_counter_alloc ( struct mlx4_dev dev,
u32 idx 
)

Definition at line 1456 of file main.c.

void mlx4_counter_free ( struct mlx4_dev dev,
u32  idx 
)

Definition at line 1480 of file main.c.

int mlx4_get_parav_qkey ( struct mlx4_dev dev,
u32  qpn,
u32 qkey 
)

Definition at line 411 of file main.c.

__be64 mlx4_get_slave_node_guid ( struct mlx4_dev dev,
int  slave 
)

Definition at line 451 of file main.c.

int mlx4_is_slave_active ( struct mlx4_dev dev,
int  slave 
)

Definition at line 462 of file main.c.

void mlx4_put_slave_node_guid ( struct mlx4_dev dev,
int  slave,
__be64  guid 
)

Definition at line 440 of file main.c.

int mlx4_restart_one ( struct pci_dev pdev)

Definition at line 2310 of file main.c.

void mlx4_sync_pkey_table ( struct mlx4_dev dev,
int  slave,
int  port,
int  i,
int  val 
)

Definition at line 429 of file main.c.

MODULE_AUTHOR ( "Roland Dreier"  )
MODULE_DESCRIPTION ( "Mellanox ConnectX HCA low-level driver )
MODULE_DEVICE_TABLE ( pci  ,
mlx4_pci_table   
)
module_exit ( mlx4_cleanup  )
module_init ( mlx4_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
module_param ( num_vfs  ,
int  ,
0444   
)
module_param ( probe_vf  ,
int  ,
0644   
)
module_param_array ( port_type_array  ,
int  ,
arr_argc,
0444   
)
module_param_named ( log_num_mgm_entry_size  ,
mlx4_log_num_mgm_entry_size  ,
int  ,
0444   
)
module_param_named ( log_num_mac  ,
log_num_mac  ,
int  ,
0444   
)
module_param_named ( log_num_vlan  ,
log_num_vlan  ,
int  ,
0444   
)
module_param_named ( use_prio  ,
use_prio  ,
bool  ,
0444   
)
module_param_named ( log_mtts_per_seg  ,
log_mtts_per_seg  ,
int  ,
0444   
)
MODULE_PARM_DESC ( num_vfs  ,
"enable #num_vfs functions if  num_vfs,
0"   
)
MODULE_PARM_DESC ( probe_vf  ,
"number of vfs to probe by pf driver (num_vfs > 0)"   
)
MODULE_PARM_DESC ( log_num_mgm_entry_size  ,
"log mgm  size,
that defines the num""of qp per  mcg,
for example:""10 gives 248.range:9<=""log_num_mgm_entry_size<=12.""Not in use with device managed""flow steering"   
)
MODULE_PARM_DESC ( log_num_mac  ,
"Log2 max number of MACs per ETH port (1-7)"   
)
MODULE_PARM_DESC ( log_num_vlan  ,
"Log2 max number of VLANs per ETH port (0-7)"   
)
MODULE_PARM_DESC ( use_prio  ,
"Enable steering by VLAN priority on ETH ports ""(0/1, default 0)"   
)
MODULE_PARM_DESC ( log_mtts_per_seg  ,
"Log2 number of MTT entries per segment (1-7)"   
)
MODULE_PARM_DESC ( port_type_array  ,
"Array of port types: HW_DEFAULT (0) is default ""1 for  IB,
2 for Ethernet"   
)
MODULE_VERSION ( DRV_VERSION  )

Variable Documentation

int log_mtts_per_seg = ilog2(MLX4_MTT_ENTRY_PER_SEG)

Definition at line 130 of file main.c.

int mlx4_log_num_mgm_entry_size = 10

Definition at line 88 of file main.c.

Definition at line 58 of file main.c.